From 157be0b0d4c7d4809cfcafc76235cc18388378c8 Mon Sep 17 00:00:00 2001 From: guowenxue <guowenxue@gmail.com> Date: Wed, 26 Jun 2019 02:06:45 +0800 Subject: [PATCH] add proj1_mqttd --- proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-retain.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-qos0-repeated.py | 46 proj1_mqttd/lylib/logger.h | 104 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/options.c | 486 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-denied.py | 39 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-disconnect.py | 82 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_context_params.c | 91 proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/mosquitto.ico | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubrel.o | 0 proj1_mqttd/lylib/logger.c | 364 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist_read.c | 505 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/Makefile | 96 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-success-v5.py | 27 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/08-ssl-connect-no-auth.py | 59 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-br2b-disconnect-qos2-helper.py | 30 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-keepalive-pingreq.py | 59 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/readme.txt | 19 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubrel.c | 126 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/08-ssl-connect-cert-auth-enc.py | 62 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-defer-unpwd-fail.py | 38 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/all-ca.crt | 75 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/connect.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/signals.c | 147 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-bad-puback-1.py | 61 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-pubrec-error.py | 85 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-persistence-flipflop.py | 83 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/demoCA/index.txt | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v4-message-store.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/connect.c | 330 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/property_broker.c | 133 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-qos1-len-helper.py | 24 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_pub.1 | 855 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-dollar.py | 34 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/server-expired.crt | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos1-retain-disabled.py | 48 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/mqtt5_rc.py | 46 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/old/msgsps_common.h | 9 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/08-ssl-bad-cacert.c | 20 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-keepalive-pingreq.cpp | 43 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/Makefile | 48 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/pwfile | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-pattern-matching.py | 79 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-no-clean-session.py | 46 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/callbacks.c | 120 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-qos2-len-helper.py | 27 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/callbacks.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/gen.sh | 75 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-denied-no-will.py | 61 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-no-local.py | 49 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-assigned-client-identifier.py | 52 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-request-response-correlation-1.c | 62 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/persist_write_stubs.c | 71 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-cert-auth-revoked.py | 54 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/libmosquitto.3.meta | 5 proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/cc128_parse.pl | 45 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client.crt | 61 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-fake-root-ca.crt | 17 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/loop.c | 844 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-client-message.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist_read_v234.c | 236 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-timeout-qos2-helper.py | 27 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/Makefile | 214 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/plugin.c | 118 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-v5.py | 39 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/mosq_test.py | 620 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-unpwd-set.cpp | 36 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-reconnect-local-out-helper.py | 26 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-qos1-qos0.py | 42 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-cfg-truncated.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto-tls.7.xml | 110 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-unpwd-success.py | 39 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-unsubscribe-v5.py | 54 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_write/v5-message-store-no-ref.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/persist_write_test.c | 386 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos2.py | 34 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-pwfile-parse-invalid.py | 165 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-alt-ca.key | 15 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/conf.c | 2388 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/will_delay.c | 102 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/send_connack.c | 95 proj1_mqttd/mosquitto/mosquitto-1.6.3/Makefile | 130 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_disconnect.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/tls_mosq.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos2-multiple-v5.py | 40 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-bad-root-ca.crt | 17 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/messages_mosq.c | 348 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-qos0-fresh.py | 38 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_msg_params.c | 76 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/send_auth.c | 83 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-bad-puback-2.py | 64 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/security.c | 879 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_disconnect.c | 85 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-subpub-payload-format.py | 15 proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/temperature_conversion/temperature_conversion.cpp | 49 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/messages_mosq.h | 32 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-cfg-bad-dbid.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/messages_mosq.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/rootCA/crlnumber | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-subscribe-qos0.c | 49 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/old/msgsps_sub.c | 82 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/loop.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos1-disconnect.py | 67 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/property_write.c | 576 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/loop.c | 390 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-server-keepalive.py | 42 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-auth-bad-method.py | 29 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-success-no-tls.pwfile | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-message-expiry-retain.py | 86 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/security_default.c | 1131 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/linker.syms | 12 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_acl.c | 54 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp | 64 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/mosquitto_broker_internal.h | 747 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist_write_v5.c | 232 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/Makefile | 127 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-qos2-len.py | 76 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-pwd-no-flag.py | 32 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-bad-packet.py | 35 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/packet_datatypes.c | 271 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-upgrade-outgoing-qos.py | 50 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/10-listener-mount-point.py | 53 proj1_mqttd/main.c | 304 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/service.c | 170 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-keepalive-pingreq.c | 36 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_suback.c | 98 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_rr.1 | 1115 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/db_dump/Makefile | 16 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/database.c | 1157 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/mqtt_protocol.h | 158 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-qos0.py | 37 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.conf.5 | 1560 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/08-ssl-bad-cacert.cpp | 31 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/CMakeLists.txt | 113 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/packet_datatypes.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-success.py | 39 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/old/Makefile | 25 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-delay-reconnect.py | 61 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-tls-psk-bridge.psk | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/signingCA/serial | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-topic-alias-invalid.py | 37 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-pubrec-error.py | 54 proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/mysql_log/Makefile | 15 proj1_mqttd/mosquitto/mosquitto-1.6.3/installer/mosquitto.nsi | 128 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/02-subscribe-qos2.cpp | 58 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/05-clean-session-qos1-helper.py | 25 proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/temperature_conversion/main.cpp | 17 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_suback.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/random_client.py | 150 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/09-util-topic-tokenise.cpp | 129 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-multistep-reauth.py | 91 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos1-receive-maximum.c | 54 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-reconnect-local-out.py | 96 proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_test_properties | 26 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-unsubscribe-multiple-v5.py | 63 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.8 | 465 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto-tls.7.meta | 5 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-no-password-denied.py | 38 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-qos0-clear.py | 60 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/08-ssl-fake-cacert.c | 36 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/alias_mosq.c | 85 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_extended_single2.c | 78 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-id-missing.py | 26 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/Makefile | 40 proj1_mqttd/mosquitto/mosquitto-1.6.3/client/CMakeLists.txt | 29 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-subscribe-qos1.py | 65 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-c2b-disconnect-qos2.py | 56 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/session_expiry.c | 110 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/signingCA/index.txt.attr | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-session-expiry-invalid.py | 37 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-b2br-late-connection-retain.py | 95 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client-revoked.crt | 61 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/mosq_test_helper.py | 17 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-subscribe-qos2.c | 49 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/unsupported-version.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/client/sub_test_properties | 31 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_unsuback.c | 87 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_write/v4-full.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-message-store.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-timeout.py | 83 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_v2.c | 67 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-acl-change.py | 124 proj1_mqttd/mosquitto/mosquitto-1.6.3/edl-v10 | 31 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_unsuback.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_connack.c | 137 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-b2br-remapping.py | 129 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-b2c-qos2.py | 83 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_subscribe.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-dollar-v5.py | 46 proj1_mqttd/mosquitto/mosquitto-1.6.3/about.html | 44 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_subscribe.c | 96 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/10-listener-mount-point-helper.py | 20 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos1-len.py | 77 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/11-prop-send-content-type.py | 53 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/11-prop-send-content-type.c | 58 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos0.py | 35 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_pub.1.meta | 5 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/mosquitto_broker.h | 172 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-disconnect-v5.py | 51 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-b2c-qos2.cpp | 80 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-cert-auth.py | 51 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/rootCA/index.txt.attr | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-timeout-qos2.py | 57 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/bridge.c | 489 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-id-0-311.py | 26 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client-encrypted.crt | 61 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_publish.c | 167 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/manpage.xsl | 14 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/lib_load.h | 37 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-b2c-qos1.py | 72 proj1_mqttd/mosquitto/mosquitto-1.6.3/CONTRIBUTING.md | 92 proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/temperature_conversion/readme.txt | 6 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-subscription-id.py | 84 proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/subscribe_simple/callback.c | 34 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_publish.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_connect.c | 883 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-delay.py | 51 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-pubrec-error-helper.py | 36 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-pubrec-error.c | 49 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-subscribe-qos1.c | 49 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-message-expiry.py | 105 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-acl-access-variants.py | 98 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/time_mosq.h | 22 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/Makefile | 61 proj1_mqttd/lylib/iniparser.c | 807 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_sub.1.xml | 992 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/mosq_test_helper.py | 15 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-will-unpwd-set.c | 29 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/08-ssl-fake-cacert.cpp | 44 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/linker.version | 134 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/time_mosq.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/subs.c | 1125 proj1_mqttd/lylib/iniparser.h | 308 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/tls_mosq.c | 183 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/mosquitto_plugin.h | 318 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-subscribe-qos2.py | 65 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/mqtt5_props.py | 73 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos2-v5.py | 35 proj1_mqttd/mosquitto/mosquitto-1.6.3/readme-windows.txt | 63 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-len.c | 52 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/readme.txt | 2 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/alias_mosq.h | 26 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-request-response.py | 84 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/mqtt5_opts.py | 5 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/tls_mosq.h | 36 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/time_mosq.c | 61 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-alt-ca.crt | 58 proj1_mqttd/mosquitto/mosquitto-1.6.3/cscope.po.out | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-c2b-timeout-qos2.py | 42 proj1_mqttd/mosquitto/mosquitto-1.6.3.tar.gz | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_sub.1.meta | 5 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-qos1.py | 34 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-response-topic.py | 59 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_rr.1.xml | 851 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/persist_read_test.c | 820 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-will-unpwd-set.cpp | 37 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/helpers.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist_read_v5.c | 254 proj1_mqttd/mosquitto/mosquitto-1.6.3/mosquitto.conf | 988 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_pwd.c | 54 proj1_mqttd/lylib/cJSON.c | 750 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto-tls.7 | 185 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-bridge-helper.py | 21 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-unpwd-fail.py | 39 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/plugin_defer.c | 65 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-protonum.py | 28 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-bad-pubrec.py | 58 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos1-queued-bytes.py | 161 proj1_mqttd/lylib/cJSON.h | 149 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-duplicate-v5.py | 32 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos1.py | 34 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-maximum-packet-size-connect.py | 30 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subhier-crash.py | 57 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-nolocal.py | 58 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-receive-maximum-2.py | 72 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos1-len.c | 52 proj1_mqttd/etc/makefile | 17 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_connack.c | 110 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/11-prop-send-payload-format.c | 58 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/mosquitto_internal.h | 358 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-retain.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-disconnect-qos1-helper.py | 25 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-c2b-qos2-len.py | 61 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-message-store-props.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-id-utf8.py | 32 proj1_mqttd/mosquitto/mosquitto-1.6.3/config.h | 69 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_acl_sub_denied.c | 49 proj1_mqttd/mosquitto/mosquitto-1.6.3/client/client_shared.c | 1449 proj1_mqttd/makefile | 73 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/Makefile | 293 proj1_mqttd/mosquitto/mosquitto-1.6.3/cscope.in.out | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_unsubscribe.c | 125 proj1_mqttd/mosquitto/mosquitto-1.6.3/service/systemd/mosquitto.service.notify | 15 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/helpers.c | 227 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-cert-auth-expired.py | 55 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/memory_mosq.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client-encrypted.key | 18 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_passwd.1 | 125 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/websockets.c | 777 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client.key | 15 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/demoCA/crlnumber | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-unpwd-set.py | 46 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/stubs.c | 6 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.8.xml | 551 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-message-expiry.py | 73 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-receive-maximum-1.py | 72 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-len.py | 86 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-signing-ca.key | 15 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-anon-denied.pwfile | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/client/client_shared.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_auth.c | 49 proj1_mqttd/mosquitto/mosquitto-1.6.3/client/client_shared.h | 131 proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/mosquitto-logo-min.svg | 65 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-b2c-qos1.cpp | 78 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2.py | 79 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-will-set.c | 28 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_sub.1 | 1261 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-disconnect-qos1.py | 63 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-b2br-late-connection.py | 73 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ptest.py | 78 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-no-auth.py | 51 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/util_mosq.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client-expired.crt | 61 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/property_read.c | 1910 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v4-cfg.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_connack.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/html.xsl | 12 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-server-keepalive-pingreq.py | 59 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/mosquittopp.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-request-response-correlation.py | 91 proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/gnome-panel/currentcost.png | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/08-ssl-connect-cert-auth.c | 45 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client-revoked.key | 15 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-subpub-content-type.py | 15 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-no-clean-session.c | 27 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-qos2.py | 34 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-qos0.py | 62 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-no-flag.py | 32 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-sub.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/09-util-topic-tokenise.c | 130 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-persistent-subscription.py | 72 proj1_mqttd/mosquitto/mosquitto-1.6.3/tags | 8028 proj1_mqttd/mosquitto/mosquitto-1.6.3/client/Makefile | 82 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-unsubscribe.py | 55 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-disconnect-qos2-helper.py | 30 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/memory_mosq.h | 41 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/mosquittopp.h | 146 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-client.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/memory_mosq.c | 160 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-invalid-utf8.py | 40 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_extended_single.c | 78 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/srv_mosq.c | 112 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/02-subscribe-qos0.cpp | 57 proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/gnome-panel/CurrentCostMQTT.server | 28 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-success-no-tls.py | 39 proj1_mqttd/etc/conf.h | 58 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-context-params.py | 50 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/Makefile | 220 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/test.py | 182 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-c2b-qos2.cpp | 61 proj1_mqttd/mosquitto/mosquitto-1.6.3/cscope.out | 487908 +++++++++++++++++++++++++++++++++++++++++++++++++ proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-disconnect-with-will.py | 48 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/prop_subpub_helper.py | 43 proj1_mqttd/mosquitto/mosquitto-1.6.3/service/svscan/run | 3 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_disconnect.c | 75 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-topic-alias-unknown.py | 37 proj1_mqttd/etc/conf.c | 139 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-identity.py | 55 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-no-identity.py | 54 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp | 70 proj1_mqttd/mosquitto/mosquitto-1.6.3/epl-v10 | 221 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/context.c | 317 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/util_mosq.c | 354 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-fail-persist-resend-qos1.py | 86 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-qos0.c | 50 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/send_suback.c | 63 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/util_mosq.h | 47 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/openssl.cnf | 406 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/utf8.c | 482 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-qos0.py | 36 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_write/empty.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_rr.1.meta | 5 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-request-response-1.c | 61 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_auth.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/pwfile.example | 3 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-br2b-disconnect-qos1-helper.py | 24 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-acl-sub.py | 51 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/08-tls-psk-bridge.c | 66 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/libmosquittopp.so.1 | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/client/sub_client.c | 367 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1.py | 46 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/09-util-topic-tokenise.py | 18 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/08-ssl-connect-cert-auth.cpp | 55 proj1_mqttd/lylib/proc.h | 52 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-receive-maximum-helper.py | 53 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-qos1-len.py | 69 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-root-ca.crt | 17 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-signing-ca.crt | 58 proj1_mqttd/mosquitto/mosquitto-1.6.3/CMakeLists.txt | 118 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubackcomp.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-fail-persist-resend-qos2.py | 99 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/server.crt | 60 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-reconnect-1273.py | 75 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-tls-psk-bridge.py | 94 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-check-source.py | 78 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-no-auth-wrong-ca.py | 50 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/libmosquitto.3 | 253 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubackcomp.c | 118 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/logging_mosq.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-cfg-truncated.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-br2b-disconnect-qos2.py | 116 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-bad-chunk.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/logging_mosq.h | 23 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-v2-unpwd-success.py | 38 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-con-discon-success.py | 56 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/logging_mosq.c | 59 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/libmosquitto.3.xml | 506 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/08-tls-psk-pub.c | 70 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/test.py | 46 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_ping.c | 70 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-con-discon-success.cpp | 55 proj1_mqttd/mosquitto/mosquitto-1.6.3/installer/mosquitto64.nsi | 129 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-invalid-utf8.py | 31 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-denied.pwfile | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/temperature_conversion/Makefile | 18 proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/mosquitto-logo-only.svg | 60 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos1-disconnect.c | 59 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_ping.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/mosquitto_passwd.c | 622 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist.h | 157 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-request-response-2.c | 66 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-disconnect-qos2.py | 67 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/Makefile | 24 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/08-ssl-fake-cacert.py | 50 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-client-message-props.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-invalid-utf8.py | 40 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/auth_plugin.c | 56 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/uhpa.h | 171 proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/cc128_log_mysql.pl | 55 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/read_handle.c | 75 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_subscribe.c | 217 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/corrupt-header-short.test-db | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/CMakeLists.txt | 5 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-qos0-no-payload.py | 59 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/CMakeLists.txt | 40 proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/gnome-panel/CurrentCostMQTT.py | 65 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_extended_multiple.c | 80 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-bad-pubcomp.py | 61 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/11-prop-oversize-packet.py | 59 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/02-unsubscribe.cpp | 57 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/08-ssl-connect-no-auth.c | 45 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/logging.c | 404 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-timeout-qos1-helper.py | 24 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-change-username.py | 84 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/dummypthread.h | 13 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/test.py | 86 proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/subscribe_simple/multiple.c | 39 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-null-helper.py | 18 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-message-expiry-will.py | 66 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist_write.c | 397 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin.c | 71 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/CMakeLists.txt | 194 proj1_mqttd/mosquitto/mosquitto-1.6.3/client/sub_client_output.c | 336 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/read_handle.c | 70 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-null-topic.py | 27 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-ca.srl | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/net_mosq_ocsp.c | 159 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-client-message.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-unsubscribe.c | 49 proj1_mqttd/lylib/comport.c | 574 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-pattern-matching-helper.py | 20 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-retain-as-publish.py | 53 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-v5.py | 47 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/mosquitto.h | 2993 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-subscribe-qos0.py | 65 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/net_mosq_ocsp.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-invalid-no-topic.py | 37 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/read_handle.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/mosquitto.c | 612 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/04-retain-qos0.cpp | 47 proj1_mqttd/lylib/comport.h | 106 proj1_mqttd/lylib/proc.c | 341 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/property_add.c | 614 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/05-clean-session-qos1.py | 52 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/read_handle.h | 40 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/rootCA/serial | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/client/rr_client.c | 370 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-unsubscribe-v5.c | 50 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-defer-unpwd-success.py | 40 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-anon-denied.py | 37 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/04-retain-qos0.c | 38 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/server.key | 15 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp | 70 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-cfg.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_disconnect.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/thread_mosq.c | 133 proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/subscribe_simple/single.c | 33 proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/legacy/mosquitto.svg | 182 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/mosquitto.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-maximum-qos-0.py | 68 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-client.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-persistent-subscription-v5.py | 74 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-delay-recover.py | 60 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-cert-auth-without.py | 52 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0.py | 38 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-root-ca.key | 15 proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/legacy/mosquitto-14x14.png | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-will-set.py | 48 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-cfg.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_disconnect.c | 62 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/thread_mosq.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/service/upstart/mosquitto.conf | 8 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/04-retain-qos0.py | 49 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/utf8_mosq.c | 109 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-timeout-qos1.py | 49 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/11-prop-oversize-packet.c | 72 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos1-queued-bytes.conf | 4 proj1_mqttd/mosquitto/mosquitto-1.6.3/libmosquittopp.pc.in | 10 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/sys_tree.c | 381 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-acl-sub-denied.py | 52 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-multistep.py | 53 proj1_mqttd/lylib/klist.h | 723 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/send_unsuback.c | 61 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/sys_tree.h | 64 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-b2c-qos2-len.py | 79 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/deps/uthash.h | 948 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-null.py | 41 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_publish.c | 367 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-unpwd-set.c | 28 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/Makefile | 26 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-qos0-no-payload.cpp | 58 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/srv_mosq.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/utf8_mosq.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-id-0.py | 26 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-single.py | 84 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/datatype_write.c | 153 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/08-ssl-connect-cert-auth-enc.c | 54 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/datatype_read.c | 829 proj1_mqttd/mosquitto/mosquitto-1.6.3/libmosquitto.pc.in | 10 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_publish.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-shared-qos0-v5.py | 132 proj1_mqttd/mosquitto/mosquitto-1.6.3/config.mk | 314 proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/mosquitto-text-side.svg | 66 proj1_mqttd/mosquitto/mosquitto-1.6.3/service/systemd/README | 9 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/deps/utlist.h | 1073 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-persistent-subscription-no-local.py | 96 proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_client.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/conf_includedir.c | 199 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-bad-root-ca.key | 15 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.conf.5.xml | 1890 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-duplicate.py | 32 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/db_dump/db_dump.c | 618 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_publish.c | 215 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-v5.py | 54 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-message-store.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/08-ssl-connect-cert-auth.py | 62 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-b2c-qos1.c | 66 proj1_mqttd/lylib/makefile | 17 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_unsubscribe.c | 99 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/linker-macosx.syms | 10 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-b2br-disconnect-qos1.py | 97 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/Makefile | 72 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/signingCA/crlnumber | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/Makefile | 99 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/random.conf | 92 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos2-multiple.py | 34 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-maximum-qos-0.c | 58 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos1-receive-maximum.py | 102 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos1-timeout.py | 73 proj1_mqttd/mosquitto/mosquitto-1.6.3/service/monit/mosquitto.monit | 4 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_unsubscribe.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-maximum-packet-size-publish-qos1.py | 51 proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/legacy/mosquitto-16x16.png | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-acl-empty-file.py | 62 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-br2b-remapping.py | 116 proj1_mqttd/mosquitto/mosquitto-1.6.3/notice.html | 108 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/property_mosq.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-acl-pub.py | 65 proj1_mqttd/mosquitto/mosquitto-1.6.3/service/systemd/mosquitto.service.simple | 13 proj1_mqttd/mosquitto/mosquitto-1.6.3/LICENSE.txt | 2 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-check-source-persist-diff-port.py | 108 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.conf.5.meta | 5 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-tls-psk-pub.py | 69 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-qos0-no-payload.c | 50 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/property_mosq.h | 50 proj1_mqttd/mosquitto/mosquitto-1.6.3/compiling.txt | 20 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-receive-maximum-2.c | 54 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/actions.c | 260 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/property_mosq.c | 1181 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-response-topic-correlation-data.py | 60 proj1_mqttd/etc/mqttd.conf | 39 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mqtt.7.xml | 187 proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/subscribe_simple/Makefile | 29 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/will_mosq.c | 126 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-b2c-qos2.c | 68 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_connect.c | 204 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_pub.1.xml | 744 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-cert-auth-crl.py | 50 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-receive-maximum-1.c | 54 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/will_mosq.h | 26 proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/temperature_conversion/temperature_conversion.h | 17 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_connect.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-unsupported.py | 33 proj1_mqttd/mosquitto/build.sh | 37 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-con-discon-success.c | 45 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/actions.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mqtt.7.meta | 6 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-maximum-packet-size-broker.py | 41 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-maximum-qos-1.py | 74 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-check-source-persist.py | 97 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/net.c | 711 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-bad-pubcomp.py | 62 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/02-subscribe-qos1.cpp | 58 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/persist_read_stubs.c | 150 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/will_mosq.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/corrupt-header-long.test-db | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/empty.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/08-ssl-connect-no-auth.cpp | 55 proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/cc128_read.pl | 23 proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_shared.h | 43 proj1_mqttd/mosquitto/mosquitto-1.6.3/security/mosquitto.apparmor | 27 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/util_topic_test.c | 284 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/packet_mosq.c | 456 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/packet_mosq.h | 56 proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/mosquitto-text-below.svg | 66 proj1_mqttd/lylib/ini_dictionary.h | 165 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-receive-maximum-1.py | 118 proj1_mqttd/lylib/ini_dictionary.c | 398 proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_shared.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/packet_mosq.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-msg-params.py | 55 proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/cc128_read.py | 22 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-maximum-packet-size-publish.py | 42 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/libmosquitto.so.1 | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/pskfile.example | 2 proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_shared.c | 126 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2.py | 53 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos1.py | 34 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-send-retain.py | 76 proj1_mqttd/mosquitto/mosquitto-1.6.3/ChangeLog.txt | 2175 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-dollar-v5.py | 41 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-qos0.cpp | 58 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_passwd.1.meta | 5 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/demoCA/serial | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/11-prop-send-payload-format.py | 63 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mqtt.7 | 293 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_mosq.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-invalid-utf8.py | 32 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_passwd.1.xml | 158 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-success.pwfile | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/05-session-expiry-v5.py | 87 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_mosq.c | 188 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_mosq.h | 38 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-bad-chunk.test-db | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-will-unpwd-set.py | 50 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/util_topic.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos1-no-subscribers-v5.py | 72 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-unsubscribe-multiple-v5.c | 59 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos2.py | 37 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-tls-psk-pub.psk | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-fake-root-ca.key | 15 proj1_mqttd/mosquitto/mosquitto-1.6.3/client/client_props.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/readme.md | 84 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/08-ssl-bad-cacert.py | 25 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubrec.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/demoCA/index.txt.attr | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2.c | 50 proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.8.meta | 5 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/mosquitto.c | 471 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/old/msgsps_pub.c | 81 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/util_topic.c | 252 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-server-keepalive-pingreq.c | 37 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/test.c | 47 proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_auth.c | 148 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/net_mosq.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/client/client_props.c | 193 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/property_user_read.c | 613 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubrec.c | 110 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/socks_mosq.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-b2br-disconnect-qos2.py | 114 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/socks_mosq.c | 460 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-maximum-packet-size-publish-qos2.py | 57 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/net_mosq.h | 82 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-bridge.py | 76 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/net_mosq.c | 1090 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/socks_mosq.h | 23 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-topic-alias.py | 54 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/publish_test.c | 43 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-pub-props.py | 77 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-no-clean-session.cpp | 35 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-disconnect.c | 59 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/mosquittopp.cpp | 381 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-per-listener-settings.py | 131 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-receive-maximum-2.py | 119 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-br2b-disconnect-qos1.py | 94 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-will-set.cpp | 39 proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/mysql_log/mysql_log.c | 123 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-b2c-qos2-len.c | 74 proj1_mqttd/mosquitto/mosquitto-1.6.3/aclfile.example | 9 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-maximum-qos-1.c | 59 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/crl.pem | 10 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-single2.py | 88 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-subscription-id.py | 103 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-no-flag.py | 33 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-v2-unpwd-fail.py | 38 proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_client.c | 537 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-no-password-denied.pwfile | 1 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-reserved.py | 27 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-properties.py | 93 proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/options.o | 0 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-success.py | 27 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-qos0.py | 57 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/mosquitto_plugin_v2.h | 228 proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-sub.test-db | 0 713 files changed, 588,186 insertions(+), 0 deletions(-) diff --git a/proj1_mqttd/etc/conf.c b/proj1_mqttd/etc/conf.c new file mode 100644 index 0000000..450b297 --- /dev/null +++ b/proj1_mqttd/etc/conf.c @@ -0,0 +1,139 @@ +/********************************************************************************* + * Copyright: (C) 2019 LingYun IoT System Studio + * All rights reserved. + * + * Filename: conf.c + * Description: This file is mqttd configure file parser function + * + * Version: 1.0.0(2019年06月25日) + * Author: Guo Wenxue <guowenxue@gmail.com> + * ChangeLog: 1, Release initial version on "2019年06月25日 22时23分55秒" + * + ********************************************************************************/ +#include "conf.h" +#include "lylib/logger.h" +#include "lylib/iniparser.h" + + +int mqttd_parser_conf(const char *conf_file, mqtt_ctx_t *ctx, int debug) +{ + dictionary *ini; + char *str; + int val; + + memset(ctx, 0, sizeof(*ctx)); + + if( !conf_file ) + { + + /* logger settings */ + strncpy(ctx->logfile, DBG_LOG_FILE, sizeof(ctx->logfile)); + ctx->loglevel = LOG_LEVEL_DEBUG; + ctx->logsize = 1024; + + if( logger_init(ctx->logfile, ctx->loglevel, ctx->logsize) < 0 ) + { + fprintf(stderr, "Logger system initialise failure\n"); + return -2; + } + log_nrml("Logger system initialise ok\n"); + log_warn("WARNNING: Use default MQTT configure\n"); + + /* Broker settings */ + strncpy(ctx->host, DEF_BORKER_HOSTNAME, sizeof(ctx->host)); + ctx->port = DEF_BROKER_PORT; + log_nrml("Use default broker server [%s:%d]\n", ctx->host, ctx->port); + + strncpy(ctx->uid, DEF_BROKER_USERNAME, sizeof(ctx->uid)); + strncpy(ctx->pwd, DEF_BROKER_PASSWD, sizeof(ctx->pwd)); + log_nrml("Use default broker author by [%s:%s]\n", ctx->uid, ctx->pwd); + + ctx->keepalive = DEF_BROKER_KEEPALIVE; + log_nrml("Use default broker keepalive timeout [%d] seconds\n", ctx->keepalive); + + /* Subscriber settings */ + strncpy(ctx->subTopic, DEF_SUBTOPIC, sizeof(ctx->subTopic)); + ctx->subQos = DEF_SUBQOS; + log_nrml("Use default subscriber topic \"%s\" with Qos[%d]\n", ctx->subTopic, ctx->subQos); + + return 0; + } + + + ini = iniparser_load(conf_file); + if( !ini ) + { + fprintf(stderr, "ERROR: cannot parse file: '%s'\n", conf_file); + return -1; + } + + /*+------------------------------------------------------+ + *| parser logger settings and start logger system | + *+------------------------------------------------------+*/ + if( !debug ) + { + str = iniparser_getstring(ini, "logger:file", "/tmp/mqttd.log"); + strncpy(ctx->logfile, str, sizeof(ctx->logfile)); + ctx->logsize = iniparser_getint(ini, "logger:size", 1024); + ctx->loglevel = iniparser_getint(ini, "logger:level", LOG_LEVEL_DEBUG); + } + else + { + strncpy(ctx->logfile, DBG_LOG_FILE, sizeof(ctx->logfile)); + ctx->loglevel = LOG_LEVEL_DEBUG; + ctx->logsize = 1024; + } + + if( logger_init(ctx->logfile, ctx->loglevel, ctx->logsize) < 0 ) + { + fprintf(stderr, "Logger system initialise failure\n"); + return -2; + } + + log_nrml("Logger system initialise ok\n"); + + + + /*+------------------------------------------------------+ + *| parser broker settings | + *+------------------------------------------------------+*/ + + if( !(str=iniparser_getstring(ini, "broker:hostname", NULL)) ) + { + log_err("ERROR: Parser broker server hostname failure\n"); + return -2; + } + strncpy(ctx->host, str, sizeof(ctx->host) ); + + if( (val=iniparser_getint(ini, "broker:port", -1)) < 0 ) + { + log_err("ERROR: Parser broker server port failure\n"); + return -2; + } + ctx->port = val; + log_nrml("Parser broker server [%s:%d]\n", ctx->host, ctx->port); + + str=iniparser_getstring(ini, "broker:username", DEF_BROKER_USERNAME); + strncpy(ctx->uid, str, sizeof(ctx->uid) ); + + str=iniparser_getstring(ini, "broker:password", DEF_BROKER_PASSWD); + strncpy(ctx->pwd, str, sizeof(ctx->pwd) ); + + log_nrml("Parser broker author by [%s:%s]\n", ctx->uid, ctx->pwd); + + ctx->keepalive = iniparser_getint(ini, "broker:keepalive", DEF_BROKER_KEEPALIVE); + log_nrml("Parser broker keepalive timeout [%d] seconds\n", ctx->keepalive); + + /*+------------------------------------------------------+ + *| parser subscriber settings | + *+------------------------------------------------------+*/ + + str=iniparser_getstring(ini, "subsciber:subTopic", DEF_SUBTOPIC); + strncpy(ctx->subTopic, str, sizeof(ctx->subTopic) ); + + ctx->subQos = iniparser_getint(ini, "subsciber:subQos", DEF_SUBQOS); + log_nrml("Parser subscriber topic \"%s\" with Qos[%d]\n", ctx->subTopic, ctx->subQos); + + return 0; +} + diff --git a/proj1_mqttd/etc/conf.h b/proj1_mqttd/etc/conf.h new file mode 100644 index 0000000..24c439a --- /dev/null +++ b/proj1_mqttd/etc/conf.h @@ -0,0 +1,58 @@ +/********************************************************************************* + * Copyright: (C) 2019 LingYun IoT System Studio + * All rights reserved. + * + * Filename: conf.h + * Description: This file is mqttd configure file parser function + * + * Version: 1.0.0(2019年06月25日) + * Author: Guo Wenxue <guowenxue@gmail.com> + * ChangeLog: 1, Release initial version on "2019年06月25日 22时23分55秒" + * + ********************************************************************************/ +#ifndef __CONF_H_ +#define __CONF_H_ + +#define DEF_BORKER_HOSTNAME "master.iot-yun.com" +#define DEF_BROKER_PORT 10883 +#define DEF_BROKER_KEEPALIVE 30 +#define DEF_BROKER_USERNAME "lingyun" +#define DEF_BROKER_PASSWD "lingyun-emb" + + +#define MQTT_SYS_TOPIC "$Sys/Studio/" +#define DEF_SUBTOPIC MQTT_SYS_TOPIC"Downlink" + +#define DEF_SUBQOS 0 + +enum +{ + Qos0, /* 发送者只发送一次消息,不进行重试,Broker不会返回确认消息。在Qos0情况下,Broker可能没有接受到消息 */ + Qos1, /* 发送者最少发送一次消息,确保消息到达Broker,Broker需要返回确认消息PUBACK。在Qos1情况下,Broker可能接受到重复消息 */ + Qos2, /* Qos2使用两阶段确认来保证消息的不丢失和不重复。在Qos2情况下,Broker肯定会收到消息,且只收到一次 */ +}; + +typedef struct mqtt_ctx_s +{ + /* logger settings */ + char logfile[128]; /* logger record file */ + int loglevel; /* logger level */ + int logsize; /* logger file maxsize, oversize will rollback */ + + /* Broker settings */ + char host[128]; /* MQTT broker server name */ + int port; /* MQTT broker listen port */ + char uid[64]; /* username */ + char pwd[64]; /* password */ + int keepalive; /* MQTT broker send PING message to subsciber/publisher keepalive timeout<seconds> */ + + /* Subscriber settings */ + char subTopic[256]; /* Subscriber topic */ + int subQos; /* Subscriber Qos */ +} mqtt_ctx_t; + + +extern int mqttd_parser_conf(const char *conf_file, mqtt_ctx_t *ctx, int debug); + +#endif /* ----- #ifndef _CONF_H_ ----- */ + diff --git a/proj1_mqttd/etc/makefile b/proj1_mqttd/etc/makefile new file mode 100644 index 0000000..2b5da3b --- /dev/null +++ b/proj1_mqttd/etc/makefile @@ -0,0 +1,17 @@ + +PWD=$(shell pwd ) + +LIBNAME=$(shell basename ${PWD} ) +PROJPATH=$(shell dirname ${PWD} ) + +CFLAGS+=-I${PROJPATH} + +all: clean + @rm -f *.o + @${CROSS_COMPILE}gcc ${CFLAGS} -c *.c + ${CROSS_COMPILE}ar -rcs lib${LIBNAME}.a *.o + +clean: + @rm -f *.o + @rm -f *.a + diff --git a/proj1_mqttd/etc/mqttd.conf b/proj1_mqttd/etc/mqttd.conf new file mode 100644 index 0000000..37bde36 --- /dev/null +++ b/proj1_mqttd/etc/mqttd.conf @@ -0,0 +1,39 @@ + +[logger] + +# 日志记录文件 +file=/tmp/mqttd.log + +# 日志级别: 0:Disable 1:Fatal 2:ERROR 3:warnning 4:Normal 5:Debug 6:Infor 7:Trace +level=4 + +# 日志回滚大小 +size=1024 + + + +[broker] + +# broker 服务器地址和端口号 +hostname="master.iot-yun.com" +port=10883 + +# broker 认证连接的用户名和密码 +username="lingyun" +password="lingyun-emb" + +# broker给subsciber和publisher发送PING报文保持 keepalive 的时间周期,单位是秒 +keepalive=30 + + +# Qos0: 发送者只发送一次消息,不进行重试,Broker不会返回确认消息。在Qos0情况下,Broker可能没有接受到消息 +# Qos1: 发送者最少发送一次消息,确保消息到达Broker,Broker需要返回确认消息PUBACK。在Qos1情况下,Broker可能接受到重复消息 +# Qos2: Qos2使用两阶段确认来保证消息的不丢失和不重复。在Qos2情况下,Broker肯定会收到消息,且只收到一次 + +[subsciber] + +subTopic="$Sys/Studio/Downlink" +subQos=0 + + + diff --git a/proj1_mqttd/lylib/cJSON.c b/proj1_mqttd/lylib/cJSON.c new file mode 100644 index 0000000..a330f69 --- /dev/null +++ b/proj1_mqttd/lylib/cJSON.c @@ -0,0 +1,750 @@ +/* + Copyright (c) 2009 Dave Gamble + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ + +/* cJSON */ +/* JSON parser in C. */ + +#include <string.h> +#include <stdio.h> +#include <math.h> +#include <stdlib.h> +#include <float.h> +#include <limits.h> +#include <ctype.h> +#include "cJSON.h" + +static const char *ep; + +const char *cJSON_GetErrorPtr(void) {return ep;} + +static int cJSON_strcasecmp(const char *s1,const char *s2) +{ + if (!s1) return (s1==s2)?0:1;if (!s2) return 1; + for(; tolower(*s1) == tolower(*s2); ++s1, ++s2) if(*s1 == 0) return 0; + return tolower(*(const unsigned char *)s1) - tolower(*(const unsigned char *)s2); +} + +static void *(*cJSON_malloc)(size_t sz) = malloc; +static void (*cJSON_free)(void *ptr) = free; + +static char* cJSON_strdup(const char* str) +{ + size_t len; + char* copy; + + len = strlen(str) + 1; + if (!(copy = (char*)cJSON_malloc(len))) return 0; + memcpy(copy,str,len); + return copy; +} + +void cJSON_InitHooks(cJSON_Hooks* hooks) +{ + if (!hooks) { /* Reset hooks */ + cJSON_malloc = malloc; + cJSON_free = free; + return; + } + + cJSON_malloc = (hooks->malloc_fn)?hooks->malloc_fn:malloc; + cJSON_free = (hooks->free_fn)?hooks->free_fn:free; +} + +/* Internal constructor. */ +static cJSON *cJSON_New_Item(void) +{ + cJSON* node = (cJSON*)cJSON_malloc(sizeof(cJSON)); + if (node) memset(node,0,sizeof(cJSON)); + return node; +} + +/* Delete a cJSON structure. */ +void cJSON_Delete(cJSON *c) +{ + cJSON *next; + while (c) + { + next=c->next; + if (!(c->type&cJSON_IsReference) && c->child) cJSON_Delete(c->child); + if (!(c->type&cJSON_IsReference) && c->valuestring) cJSON_free(c->valuestring); + if (!(c->type&cJSON_StringIsConst) && c->string) cJSON_free(c->string); + cJSON_free(c); + c=next; + } +} + +/* Parse the input text to generate a number, and populate the result into item. */ +static const char *parse_number(cJSON *item,const char *num) +{ + double n=0,sign=1,scale=0;int subscale=0,signsubscale=1; + + if (*num=='-') sign=-1,num++; /* Has sign? */ + if (*num=='0') num++; /* is zero */ + if (*num>='1' && *num<='9') do n=(n*10.0)+(*num++ -'0'); while (*num>='0' && *num<='9'); /* Number? */ + if (*num=='.' && num[1]>='0' && num[1]<='9') {num++; do n=(n*10.0)+(*num++ -'0'),scale--; while (*num>='0' && *num<='9');} /* Fractional part? */ + if (*num=='e' || *num=='E') /* Exponent? */ + { num++;if (*num=='+') num++; else if (*num=='-') signsubscale=-1,num++; /* With sign? */ + while (*num>='0' && *num<='9') subscale=(subscale*10)+(*num++ - '0'); /* Number? */ + } + + n=sign*n*pow(10.0,(scale+subscale*signsubscale)); /* number = +/- number.fraction * 10^+/- exponent */ + + item->valuedouble=n; + item->valueint=(int)n; + item->type=cJSON_Number; + return num; +} + +static int pow2gt (int x) { --x; x|=x>>1; x|=x>>2; x|=x>>4; x|=x>>8; x|=x>>16; return x+1; } + +typedef struct {char *buffer; int length; int offset; } printbuffer; + +static char* ensure(printbuffer *p,int needed) +{ + char *newbuffer;int newsize; + if (!p || !p->buffer) return 0; + needed+=p->offset; + if (needed<=p->length) return p->buffer+p->offset; + + newsize=pow2gt(needed); + newbuffer=(char*)cJSON_malloc(newsize); + if (!newbuffer) {cJSON_free(p->buffer);p->length=0,p->buffer=0;return 0;} + if (newbuffer) memcpy(newbuffer,p->buffer,p->length); + cJSON_free(p->buffer); + p->length=newsize; + p->buffer=newbuffer; + return newbuffer+p->offset; +} + +static int update(printbuffer *p) +{ + char *str; + if (!p || !p->buffer) return 0; + str=p->buffer+p->offset; + return p->offset+strlen(str); +} + +/* Render the number nicely from the given item into a string. */ +static char *print_number(cJSON *item,printbuffer *p) +{ + char *str=0; + double d=item->valuedouble; + if (d==0) + { + if (p) str=ensure(p,2); + else str=(char*)cJSON_malloc(2); /* special case for 0. */ + if (str) strcpy(str,"0"); + } + else if (fabs(((double)item->valueint)-d)<=DBL_EPSILON && d<=INT_MAX && d>=INT_MIN) + { + if (p) str=ensure(p,21); + else str=(char*)cJSON_malloc(21); /* 2^64+1 can be represented in 21 chars. */ + if (str) sprintf(str,"%d",item->valueint); + } + else + { + if (p) str=ensure(p,64); + else str=(char*)cJSON_malloc(64); /* This is a nice tradeoff. */ + if (str) + { + if (fabs(floor(d)-d)<=DBL_EPSILON && fabs(d)<1.0e60)sprintf(str,"%.0f",d); + else if (fabs(d)<1.0e-6 || fabs(d)>1.0e9) sprintf(str,"%e",d); + else sprintf(str,"%f",d); + } + } + return str; +} + +static unsigned parse_hex4(const char *str) +{ + unsigned h=0; + if (*str>='0' && *str<='9') h+=(*str)-'0'; else if (*str>='A' && *str<='F') h+=10+(*str)-'A'; else if (*str>='a' && *str<='f') h+=10+(*str)-'a'; else return 0; + h=h<<4;str++; + if (*str>='0' && *str<='9') h+=(*str)-'0'; else if (*str>='A' && *str<='F') h+=10+(*str)-'A'; else if (*str>='a' && *str<='f') h+=10+(*str)-'a'; else return 0; + h=h<<4;str++; + if (*str>='0' && *str<='9') h+=(*str)-'0'; else if (*str>='A' && *str<='F') h+=10+(*str)-'A'; else if (*str>='a' && *str<='f') h+=10+(*str)-'a'; else return 0; + h=h<<4;str++; + if (*str>='0' && *str<='9') h+=(*str)-'0'; else if (*str>='A' && *str<='F') h+=10+(*str)-'A'; else if (*str>='a' && *str<='f') h+=10+(*str)-'a'; else return 0; + return h; +} + +/* Parse the input text into an unescaped cstring, and populate item. */ +static const unsigned char firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; +static const char *parse_string(cJSON *item,const char *str) +{ + const char *ptr=str+1;char *ptr2;char *out;int len=0;unsigned uc,uc2; + if (*str!='\"') {ep=str;return 0;} /* not a string! */ + + while (*ptr!='\"' && *ptr && ++len) if (*ptr++ == '\\') ptr++; /* Skip escaped quotes. */ + + out=(char*)cJSON_malloc(len+1); /* This is how long we need for the string, roughly. */ + if (!out) return 0; + + ptr=str+1;ptr2=out; + while (*ptr!='\"' && *ptr) + { + if (*ptr!='\\') *ptr2++=*ptr++; + else + { + ptr++; + switch (*ptr) + { + case 'b': *ptr2++='\b'; break; + case 'f': *ptr2++='\f'; break; + case 'n': *ptr2++='\n'; break; + case 'r': *ptr2++='\r'; break; + case 't': *ptr2++='\t'; break; + case 'u': /* transcode utf16 to utf8. */ + uc=parse_hex4(ptr+1);ptr+=4; /* get the unicode char. */ + + if ((uc>=0xDC00 && uc<=0xDFFF) || uc==0) break; /* check for invalid. */ + + if (uc>=0xD800 && uc<=0xDBFF) /* UTF16 surrogate pairs. */ + { + if (ptr[1]!='\\' || ptr[2]!='u') break; /* missing second-half of surrogate. */ + uc2=parse_hex4(ptr+3);ptr+=6; + if (uc2<0xDC00 || uc2>0xDFFF) break; /* invalid second-half of surrogate. */ + uc=0x10000 + (((uc&0x3FF)<<10) | (uc2&0x3FF)); + } + + len=4;if (uc<0x80) len=1;else if (uc<0x800) len=2;else if (uc<0x10000) len=3; ptr2+=len; + + switch (len) { + case 4: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6; + case 3: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6; + case 2: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6; + case 1: *--ptr2 =(uc | firstByteMark[len]); + } + ptr2+=len; + break; + default: *ptr2++=*ptr; break; + } + ptr++; + } + } + *ptr2=0; + if (*ptr=='\"') ptr++; + item->valuestring=out; + item->type=cJSON_String; + return ptr; +} + +/* Render the cstring provided to an escaped version that can be printed. */ +static char *print_string_ptr(const char *str,printbuffer *p) +{ + const char *ptr;char *ptr2,*out;int len=0,flag=0;unsigned char token; + + for (ptr=str;*ptr;ptr++) flag|=((*ptr>0 && *ptr<32)||(*ptr=='\"')||(*ptr=='\\'))?1:0; + if (!flag) + { + len=ptr-str; + if (p) out=ensure(p,len+3); + else out=(char*)cJSON_malloc(len+3); + if (!out) return 0; + ptr2=out;*ptr2++='\"'; + strcpy(ptr2,str); + ptr2[len]='\"'; + ptr2[len+1]=0; + return out; + } + + if (!str) + { + if (p) out=ensure(p,3); + else out=(char*)cJSON_malloc(3); + if (!out) return 0; + strcpy(out,"\"\""); + return out; + } + ptr=str;while ((token=*ptr) && ++len) {if (strchr("\"\\\b\f\n\r\t",token)) len++; else if (token<32) len+=5;ptr++;} + + if (p) out=ensure(p,len+3); + else out=(char*)cJSON_malloc(len+3); + if (!out) return 0; + + ptr2=out;ptr=str; + *ptr2++='\"'; + while (*ptr) + { + if ((unsigned char)*ptr>31 && *ptr!='\"' && *ptr!='\\') *ptr2++=*ptr++; + else + { + *ptr2++='\\'; + switch (token=*ptr++) + { + case '\\': *ptr2++='\\'; break; + case '\"': *ptr2++='\"'; break; + case '\b': *ptr2++='b'; break; + case '\f': *ptr2++='f'; break; + case '\n': *ptr2++='n'; break; + case '\r': *ptr2++='r'; break; + case '\t': *ptr2++='t'; break; + default: sprintf(ptr2,"u%04x",token);ptr2+=5; break; /* escape and print */ + } + } + } + *ptr2++='\"';*ptr2++=0; + return out; +} +/* Invote print_string_ptr (which is useful) on an item. */ +static char *print_string(cJSON *item,printbuffer *p) {return print_string_ptr(item->valuestring,p);} + +/* Predeclare these prototypes. */ +static const char *parse_value(cJSON *item,const char *value); +static char *print_value(cJSON *item,int depth,int fmt,printbuffer *p); +static const char *parse_array(cJSON *item,const char *value); +static char *print_array(cJSON *item,int depth,int fmt,printbuffer *p); +static const char *parse_object(cJSON *item,const char *value); +static char *print_object(cJSON *item,int depth,int fmt,printbuffer *p); + +/* Utility to jump whitespace and cr/lf */ +static const char *skip(const char *in) {while (in && *in && (unsigned char)*in<=32) in++; return in;} + +/* Parse an object - create a new root, and populate. */ +cJSON *cJSON_ParseWithOpts(const char *value,const char **return_parse_end,int require_null_terminated) +{ + const char *end=0; + cJSON *c=cJSON_New_Item(); + ep=0; + if (!c) return 0; /* memory fail */ + + end=parse_value(c,skip(value)); + if (!end) {cJSON_Delete(c);return 0;} /* parse failure. ep is set. */ + + /* if we require null-terminated JSON without appended garbage, skip and then check for a null terminator */ + if (require_null_terminated) {end=skip(end);if (*end) {cJSON_Delete(c);ep=end;return 0;}} + if (return_parse_end) *return_parse_end=end; + return c; +} +/* Default options for cJSON_Parse */ +cJSON *cJSON_Parse(const char *value) {return cJSON_ParseWithOpts(value,0,0);} + +/* Render a cJSON item/entity/structure to text. */ +char *cJSON_Print(cJSON *item) {return print_value(item,0,1,0);} +char *cJSON_PrintUnformatted(cJSON *item) {return print_value(item,0,0,0);} + +char *cJSON_PrintBuffered(cJSON *item,int prebuffer,int fmt) +{ + printbuffer p; + p.buffer=(char*)cJSON_malloc(prebuffer); + p.length=prebuffer; + p.offset=0; + return print_value(item,0,fmt,&p); + return p.buffer; +} + + +/* Parser core - when encountering text, process appropriately. */ +static const char *parse_value(cJSON *item,const char *value) +{ + if (!value) return 0; /* Fail on null. */ + if (!strncmp(value,"null",4)) { item->type=cJSON_NULL; return value+4; } + if (!strncmp(value,"false",5)) { item->type=cJSON_False; return value+5; } + if (!strncmp(value,"true",4)) { item->type=cJSON_True; item->valueint=1; return value+4; } + if (*value=='\"') { return parse_string(item,value); } + if (*value=='-' || (*value>='0' && *value<='9')) { return parse_number(item,value); } + if (*value=='[') { return parse_array(item,value); } + if (*value=='{') { return parse_object(item,value); } + + ep=value;return 0; /* failure. */ +} + +/* Render a value to text. */ +static char *print_value(cJSON *item,int depth,int fmt,printbuffer *p) +{ + char *out=0; + if (!item) return 0; + if (p) + { + switch ((item->type)&255) + { + case cJSON_NULL: {out=ensure(p,5); if (out) strcpy(out,"null"); break;} + case cJSON_False: {out=ensure(p,6); if (out) strcpy(out,"false"); break;} + case cJSON_True: {out=ensure(p,5); if (out) strcpy(out,"true"); break;} + case cJSON_Number: out=print_number(item,p);break; + case cJSON_String: out=print_string(item,p);break; + case cJSON_Array: out=print_array(item,depth,fmt,p);break; + case cJSON_Object: out=print_object(item,depth,fmt,p);break; + } + } + else + { + switch ((item->type)&255) + { + case cJSON_NULL: out=cJSON_strdup("null"); break; + case cJSON_False: out=cJSON_strdup("false");break; + case cJSON_True: out=cJSON_strdup("true"); break; + case cJSON_Number: out=print_number(item,0);break; + case cJSON_String: out=print_string(item,0);break; + case cJSON_Array: out=print_array(item,depth,fmt,0);break; + case cJSON_Object: out=print_object(item,depth,fmt,0);break; + } + } + return out; +} + +/* Build an array from input text. */ +static const char *parse_array(cJSON *item,const char *value) +{ + cJSON *child; + if (*value!='[') {ep=value;return 0;} /* not an array! */ + + item->type=cJSON_Array; + value=skip(value+1); + if (*value==']') return value+1; /* empty array. */ + + item->child=child=cJSON_New_Item(); + if (!item->child) return 0; /* memory fail */ + value=skip(parse_value(child,skip(value))); /* skip any spacing, get the value. */ + if (!value) return 0; + + while (*value==',') + { + cJSON *new_item; + if (!(new_item=cJSON_New_Item())) return 0; /* memory fail */ + child->next=new_item;new_item->prev=child;child=new_item; + value=skip(parse_value(child,skip(value+1))); + if (!value) return 0; /* memory fail */ + } + + if (*value==']') return value+1; /* end of array */ + ep=value;return 0; /* malformed. */ +} + +/* Render an array to text */ +static char *print_array(cJSON *item,int depth,int fmt,printbuffer *p) +{ + char **entries; + char *out=0,*ptr,*ret;int len=5; + cJSON *child=item->child; + int numentries=0,i=0,fail=0; + size_t tmplen=0; + + /* How many entries in the array? */ + while (child) numentries++,child=child->next; + /* Explicitly handle numentries==0 */ + if (!numentries) + { + if (p) out=ensure(p,3); + else out=(char*)cJSON_malloc(3); + if (out) strcpy(out,"[]"); + return out; + } + + if (p) + { + /* Compose the output array. */ + i=p->offset; + ptr=ensure(p,1);if (!ptr) return 0; *ptr='['; p->offset++; + child=item->child; + while (child && !fail) + { + print_value(child,depth+1,fmt,p); + p->offset=update(p); + if (child->next) {len=fmt?2:1;ptr=ensure(p,len+1);if (!ptr) return 0;*ptr++=',';if(fmt)*ptr++=' ';*ptr=0;p->offset+=len;} + child=child->next; + } + ptr=ensure(p,2);if (!ptr) return 0; *ptr++=']';*ptr=0; + out=(p->buffer)+i; + } + else + { + /* Allocate an array to hold the values for each */ + entries=(char**)cJSON_malloc(numentries*sizeof(char*)); + if (!entries) return 0; + memset(entries,0,numentries*sizeof(char*)); + /* Retrieve all the results: */ + child=item->child; + while (child && !fail) + { + ret=print_value(child,depth+1,fmt,0); + entries[i++]=ret; + if (ret) len+=strlen(ret)+2+(fmt?1:0); else fail=1; + child=child->next; + } + + /* If we didn't fail, try to malloc the output string */ + if (!fail) out=(char*)cJSON_malloc(len); + /* If that fails, we fail. */ + if (!out) fail=1; + + /* Handle failure. */ + if (fail) + { + for (i=0;i<numentries;i++) if (entries[i]) cJSON_free(entries[i]); + cJSON_free(entries); + return 0; + } + + /* Compose the output array. */ + *out='['; + ptr=out+1;*ptr=0; + for (i=0;i<numentries;i++) + { + tmplen=strlen(entries[i]);memcpy(ptr,entries[i],tmplen);ptr+=tmplen; + if (i!=numentries-1) {*ptr++=',';if(fmt)*ptr++=' ';*ptr=0;} + cJSON_free(entries[i]); + } + cJSON_free(entries); + *ptr++=']';*ptr++=0; + } + return out; +} + +/* Build an object from the text. */ +static const char *parse_object(cJSON *item,const char *value) +{ + cJSON *child; + if (*value!='{') {ep=value;return 0;} /* not an object! */ + + item->type=cJSON_Object; + value=skip(value+1); + if (*value=='}') return value+1; /* empty array. */ + + item->child=child=cJSON_New_Item(); + if (!item->child) return 0; + value=skip(parse_string(child,skip(value))); + if (!value) return 0; + child->string=child->valuestring;child->valuestring=0; + if (*value!=':') {ep=value;return 0;} /* fail! */ + value=skip(parse_value(child,skip(value+1))); /* skip any spacing, get the value. */ + if (!value) return 0; + + while (*value==',') + { + cJSON *new_item; + if (!(new_item=cJSON_New_Item())) return 0; /* memory fail */ + child->next=new_item;new_item->prev=child;child=new_item; + value=skip(parse_string(child,skip(value+1))); + if (!value) return 0; + child->string=child->valuestring;child->valuestring=0; + if (*value!=':') {ep=value;return 0;} /* fail! */ + value=skip(parse_value(child,skip(value+1))); /* skip any spacing, get the value. */ + if (!value) return 0; + } + + if (*value=='}') return value+1; /* end of array */ + ep=value;return 0; /* malformed. */ +} + +/* Render an object to text. */ +static char *print_object(cJSON *item,int depth,int fmt,printbuffer *p) +{ + char **entries=0,**names=0; + char *out=0,*ptr,*ret,*str;int len=7,i=0,j; + cJSON *child=item->child; + int numentries=0,fail=0; + size_t tmplen=0; + /* Count the number of entries. */ + while (child) numentries++,child=child->next; + /* Explicitly handle empty object case */ + if (!numentries) + { + if (p) out=ensure(p,fmt?depth+4:3); + else out=(char*)cJSON_malloc(fmt?depth+4:3); + if (!out) return 0; + ptr=out;*ptr++='{'; + if (fmt) {*ptr++='\n';for (i=0;i<depth-1;i++) *ptr++='\t';} + *ptr++='}';*ptr++=0; + return out; + } + if (p) + { + /* Compose the output: */ + i=p->offset; + len=fmt?2:1; ptr=ensure(p,len+1); if (!ptr) return 0; + *ptr++='{'; if (fmt) *ptr++='\n'; *ptr=0; p->offset+=len; + child=item->child;depth++; + while (child) + { + if (fmt) + { + ptr=ensure(p,depth); if (!ptr) return 0; + for (j=0;j<depth;j++) *ptr++='\t'; + p->offset+=depth; + } + print_string_ptr(child->string,p); + p->offset=update(p); + + len=fmt?2:1; + ptr=ensure(p,len); if (!ptr) return 0; + *ptr++=':';if (fmt) *ptr++='\t'; + p->offset+=len; + + print_value(child,depth,fmt,p); + p->offset=update(p); + + len=(fmt?1:0)+(child->next?1:0); + ptr=ensure(p,len+1); if (!ptr) return 0; + if (child->next) *ptr++=','; + if (fmt) *ptr++='\n';*ptr=0; + p->offset+=len; + child=child->next; + } + ptr=ensure(p,fmt?(depth+1):2); if (!ptr) return 0; + if (fmt) for (i=0;i<depth-1;i++) *ptr++='\t'; + *ptr++='}';*ptr=0; + out=(p->buffer)+i; + } + else + { + /* Allocate space for the names and the objects */ + entries=(char**)cJSON_malloc(numentries*sizeof(char*)); + if (!entries) return 0; + names=(char**)cJSON_malloc(numentries*sizeof(char*)); + if (!names) {cJSON_free(entries);return 0;} + memset(entries,0,sizeof(char*)*numentries); + memset(names,0,sizeof(char*)*numentries); + + /* Collect all the results into our arrays: */ + child=item->child;depth++;if (fmt) len+=depth; + while (child) + { + names[i]=str=print_string_ptr(child->string,0); + entries[i++]=ret=print_value(child,depth,fmt,0); + if (str && ret) len+=strlen(ret)+strlen(str)+2+(fmt?2+depth:0); else fail=1; + child=child->next; + } + + /* Try to allocate the output string */ + if (!fail) out=(char*)cJSON_malloc(len); + if (!out) fail=1; + + /* Handle failure */ + if (fail) + { + for (i=0;i<numentries;i++) {if (names[i]) cJSON_free(names[i]);if (entries[i]) cJSON_free(entries[i]);} + cJSON_free(names);cJSON_free(entries); + return 0; + } + + /* Compose the output: */ + *out='{';ptr=out+1;if (fmt)*ptr++='\n';*ptr=0; + for (i=0;i<numentries;i++) + { + if (fmt) for (j=0;j<depth;j++) *ptr++='\t'; + tmplen=strlen(names[i]);memcpy(ptr,names[i],tmplen);ptr+=tmplen; + *ptr++=':';if (fmt) *ptr++='\t'; + strcpy(ptr,entries[i]);ptr+=strlen(entries[i]); + if (i!=numentries-1) *ptr++=','; + if (fmt) *ptr++='\n';*ptr=0; + cJSON_free(names[i]);cJSON_free(entries[i]); + } + + cJSON_free(names);cJSON_free(entries); + if (fmt) for (i=0;i<depth-1;i++) *ptr++='\t'; + *ptr++='}';*ptr++=0; + } + return out; +} + +/* Get Array size/item / object item. */ +int cJSON_GetArraySize(cJSON *array) {cJSON *c=array->child;int i=0;while(c)i++,c=c->next;return i;} +cJSON *cJSON_GetArrayItem(cJSON *array,int item) {cJSON *c=array->child; while (c && item>0) item--,c=c->next; return c;} +cJSON *cJSON_GetObjectItem(cJSON *object,const char *string) {cJSON *c=object->child; while (c && cJSON_strcasecmp(c->string,string)) c=c->next; return c;} + +/* Utility for array list handling. */ +static void suffix_object(cJSON *prev,cJSON *item) {prev->next=item;item->prev=prev;} +/* Utility for handling references. */ +static cJSON *create_reference(cJSON *item) {cJSON *ref=cJSON_New_Item();if (!ref) return 0;memcpy(ref,item,sizeof(cJSON));ref->string=0;ref->type|=cJSON_IsReference;ref->next=ref->prev=0;return ref;} + +/* Add item to array/object. */ +void cJSON_AddItemToArray(cJSON *array, cJSON *item) {cJSON *c=array->child;if (!item) return; if (!c) {array->child=item;} else {while (c && c->next) c=c->next; suffix_object(c,item);}} +void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item) {if (!item) return; if (item->string) cJSON_free(item->string);item->string=cJSON_strdup(string);cJSON_AddItemToArray(object,item);} +void cJSON_AddItemToObjectCS(cJSON *object,const char *string,cJSON *item) {if (!item) return; if (!(item->type&cJSON_StringIsConst) && item->string) cJSON_free(item->string);item->string=(char*)string;item->type|=cJSON_StringIsConst;cJSON_AddItemToArray(object,item);} +void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) {cJSON_AddItemToArray(array,create_reference(item));} +void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item) {cJSON_AddItemToObject(object,string,create_reference(item));} + +cJSON *cJSON_DetachItemFromArray(cJSON *array,int which) {cJSON *c=array->child;while (c && which>0) c=c->next,which--;if (!c) return 0; + if (c->prev) c->prev->next=c->next;if (c->next) c->next->prev=c->prev;if (c==array->child) array->child=c->next;c->prev=c->next=0;return c;} +void cJSON_DeleteItemFromArray(cJSON *array,int which) {cJSON_Delete(cJSON_DetachItemFromArray(array,which));} +cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string) {int i=0;cJSON *c=object->child;while (c && cJSON_strcasecmp(c->string,string)) i++,c=c->next;if (c) return cJSON_DetachItemFromArray(object,i);return 0;} +void cJSON_DeleteItemFromObject(cJSON *object,const char *string) {cJSON_Delete(cJSON_DetachItemFromObject(object,string));} + +/* Replace array/object items with new ones. */ +void cJSON_InsertItemInArray(cJSON *array,int which,cJSON *newitem) {cJSON *c=array->child;while (c && which>0) c=c->next,which--;if (!c) {cJSON_AddItemToArray(array,newitem);return;} + newitem->next=c;newitem->prev=c->prev;c->prev=newitem;if (c==array->child) array->child=newitem; else newitem->prev->next=newitem;} +void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem) {cJSON *c=array->child;while (c && which>0) c=c->next,which--;if (!c) return; + newitem->next=c->next;newitem->prev=c->prev;if (newitem->next) newitem->next->prev=newitem; + if (c==array->child) array->child=newitem; else newitem->prev->next=newitem;c->next=c->prev=0;cJSON_Delete(c);} +void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem){int i=0;cJSON *c=object->child;while(c && cJSON_strcasecmp(c->string,string))i++,c=c->next;if(c){newitem->string=cJSON_strdup(string);cJSON_ReplaceItemInArray(object,i,newitem);}} + +/* Create basic types: */ +cJSON *cJSON_CreateNull(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_NULL;return item;} +cJSON *cJSON_CreateTrue(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_True;return item;} +cJSON *cJSON_CreateFalse(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_False;return item;} +cJSON *cJSON_CreateBool(int b) {cJSON *item=cJSON_New_Item();if(item)item->type=b?cJSON_True:cJSON_False;return item;} +cJSON *cJSON_CreateNumber(double num) {cJSON *item=cJSON_New_Item();if(item){item->type=cJSON_Number;item->valuedouble=num;item->valueint=(int)num;}return item;} +cJSON *cJSON_CreateString(const char *string) {cJSON *item=cJSON_New_Item();if(item){item->type=cJSON_String;item->valuestring=cJSON_strdup(string);}return item;} +cJSON *cJSON_CreateArray(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_Array;return item;} +cJSON *cJSON_CreateObject(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_Object;return item;} + +/* Create Arrays: */ +cJSON *cJSON_CreateIntArray(const int *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && i<count;i++){n=cJSON_CreateNumber(numbers[i]);if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;} +cJSON *cJSON_CreateFloatArray(const float *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && i<count;i++){n=cJSON_CreateNumber(numbers[i]);if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;} +cJSON *cJSON_CreateDoubleArray(const double *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && i<count;i++){n=cJSON_CreateNumber(numbers[i]);if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;} +cJSON *cJSON_CreateStringArray(const char **strings,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && i<count;i++){n=cJSON_CreateString(strings[i]);if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;} + +/* Duplication */ +cJSON *cJSON_Duplicate(cJSON *item,int recurse) +{ + cJSON *newitem,*cptr,*nptr=0,*newchild; + /* Bail on bad ptr */ + if (!item) return 0; + /* Create new item */ + newitem=cJSON_New_Item(); + if (!newitem) return 0; + /* Copy over all vars */ + newitem->type=item->type&(~cJSON_IsReference),newitem->valueint=item->valueint,newitem->valuedouble=item->valuedouble; + if (item->valuestring) {newitem->valuestring=cJSON_strdup(item->valuestring); if (!newitem->valuestring) {cJSON_Delete(newitem);return 0;}} + if (item->string) {newitem->string=cJSON_strdup(item->string); if (!newitem->string) {cJSON_Delete(newitem);return 0;}} + /* If non-recursive, then we're done! */ + if (!recurse) return newitem; + /* Walk the ->next chain for the child. */ + cptr=item->child; + while (cptr) + { + newchild=cJSON_Duplicate(cptr,1); /* Duplicate (with recurse) each item in the ->next chain */ + if (!newchild) {cJSON_Delete(newitem);return 0;} + if (nptr) {nptr->next=newchild,newchild->prev=nptr;nptr=newchild;} /* If newitem->child already set, then crosswire ->prev and ->next and move on */ + else {newitem->child=newchild;nptr=newchild;} /* Set newitem->child and move to it */ + cptr=cptr->next; + } + return newitem; +} + +void cJSON_Minify(char *json) +{ + char *into=json; + while (*json) + { + if (*json==' ') json++; + else if (*json=='\t') json++; /* Whitespace characters. */ + else if (*json=='\r') json++; + else if (*json=='\n') json++; + else if (*json=='/' && json[1]=='/') while (*json && *json!='\n') json++; /* double-slash comments, to end of line. */ + else if (*json=='/' && json[1]=='*') {while (*json && !(*json=='*' && json[1]=='/')) json++;json+=2;} /* multiline comments. */ + else if (*json=='\"'){*into++=*json++;while (*json && *json!='\"'){if (*json=='\\') *into++=*json++;*into++=*json++;}*into++=*json++;} /* string literals, which are \" sensitive. */ + else *into++=*json++; /* All other characters. */ + } + *into=0; /* and null-terminate. */ +} diff --git a/proj1_mqttd/lylib/cJSON.h b/proj1_mqttd/lylib/cJSON.h new file mode 100644 index 0000000..466d10d --- /dev/null +++ b/proj1_mqttd/lylib/cJSON.h @@ -0,0 +1,149 @@ +/* + Copyright (c) 2009 Dave Gamble + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ + +#ifndef cJSON__h +#define cJSON__h + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* cJSON Types: */ +#define cJSON_False 0 +#define cJSON_True 1 +#define cJSON_NULL 2 +#define cJSON_Number 3 +#define cJSON_String 4 +#define cJSON_Array 5 +#define cJSON_Object 6 + +#define cJSON_IsReference 256 +#define cJSON_StringIsConst 512 + +/* The cJSON structure: */ +typedef struct cJSON { + struct cJSON *next,*prev; /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */ + struct cJSON *child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ + + int type; /* The type of the item, as above. */ + + char *valuestring; /* The item's string, if type==cJSON_String */ + int valueint; /* The item's number, if type==cJSON_Number */ + double valuedouble; /* The item's number, if type==cJSON_Number */ + + char *string; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ +} cJSON; + +typedef struct cJSON_Hooks { + void *(*malloc_fn)(size_t sz); + void (*free_fn)(void *ptr); +} cJSON_Hooks; + +/* Supply malloc, realloc and free functions to cJSON */ +extern void cJSON_InitHooks(cJSON_Hooks* hooks); + + +/* Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished. */ +extern cJSON *cJSON_Parse(const char *value); +/* Render a cJSON entity to text for transfer/storage. Free the char* when finished. */ +extern char *cJSON_Print(cJSON *item); +/* Render a cJSON entity to text for transfer/storage without any formatting. Free the char* when finished. */ +extern char *cJSON_PrintUnformatted(cJSON *item); +/* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */ +extern char *cJSON_PrintBuffered(cJSON *item,int prebuffer,int fmt); +/* Delete a cJSON entity and all subentities. */ +extern void cJSON_Delete(cJSON *c); + +/* Returns the number of items in an array (or object). */ +extern int cJSON_GetArraySize(cJSON *array); +/* Retrieve item number "item" from array "array". Returns NULL if unsuccessful. */ +extern cJSON *cJSON_GetArrayItem(cJSON *array,int item); +/* Get item "string" from object. Case insensitive. */ +extern cJSON *cJSON_GetObjectItem(cJSON *object,const char *string); + +/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */ +extern const char *cJSON_GetErrorPtr(void); + +/* These calls create a cJSON item of the appropriate type. */ +extern cJSON *cJSON_CreateNull(void); +extern cJSON *cJSON_CreateTrue(void); +extern cJSON *cJSON_CreateFalse(void); +extern cJSON *cJSON_CreateBool(int b); +extern cJSON *cJSON_CreateNumber(double num); +extern cJSON *cJSON_CreateString(const char *string); +extern cJSON *cJSON_CreateArray(void); +extern cJSON *cJSON_CreateObject(void); + +/* These utilities create an Array of count items. */ +extern cJSON *cJSON_CreateIntArray(const int *numbers,int count); +extern cJSON *cJSON_CreateFloatArray(const float *numbers,int count); +extern cJSON *cJSON_CreateDoubleArray(const double *numbers,int count); +extern cJSON *cJSON_CreateStringArray(const char **strings,int count); + +/* Append item to the specified array/object. */ +extern void cJSON_AddItemToArray(cJSON *array, cJSON *item); +extern void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item); +extern void cJSON_AddItemToObjectCS(cJSON *object,const char *string,cJSON *item); /* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object */ +/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */ +extern void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item); +extern void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item); + +/* Remove/Detatch items from Arrays/Objects. */ +extern cJSON *cJSON_DetachItemFromArray(cJSON *array,int which); +extern void cJSON_DeleteItemFromArray(cJSON *array,int which); +extern cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string); +extern void cJSON_DeleteItemFromObject(cJSON *object,const char *string); + +/* Update array items. */ +extern void cJSON_InsertItemInArray(cJSON *array,int which,cJSON *newitem); /* Shifts pre-existing items to the right. */ +extern void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem); +extern void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem); + +/* Duplicate a cJSON item */ +extern cJSON *cJSON_Duplicate(cJSON *item,int recurse); +/* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will +need to be released. With recurse!=0, it will duplicate any children connected to the item. +The item->next and ->prev pointers are always zero on return from Duplicate. */ + +/* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */ +extern cJSON *cJSON_ParseWithOpts(const char *value,const char **return_parse_end,int require_null_terminated); + +extern void cJSON_Minify(char *json); + +/* Macros for creating things quickly. */ +#define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull()) +#define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue()) +#define cJSON_AddFalseToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse()) +#define cJSON_AddBoolToObject(object,name,b) cJSON_AddItemToObject(object, name, cJSON_CreateBool(b)) +#define cJSON_AddNumberToObject(object,name,n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n)) +#define cJSON_AddStringToObject(object,name,s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s)) + +/* When assigning an integer value, it needs to be propagated to valuedouble too. */ +#define cJSON_SetIntValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val)) +#define cJSON_SetNumberValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val)) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/proj1_mqttd/lylib/comport.c b/proj1_mqttd/lylib/comport.c new file mode 100644 index 0000000..83b6974 --- /dev/null +++ b/proj1_mqttd/lylib/comport.c @@ -0,0 +1,574 @@ +/* ******************************************************************************** + * Copyright: (C) 2018 LingYun IoT System Studio + * All rights reserved. + * + * Filename: cp_comport.c + * Description: It's the comport operate library. + * + * Version: 2.0.0(10/17/2018~) + * Author: Guo Wenxue <guowenxue@gmail.com> + * ChangeLog: 1, Release initial version on "10/17/2018 03:33:25 PM" + * + ********************************************************************************/ + +#include "comport.h" + +void set_settings(st_comport * comport, const char *settings); + +/************************************************************************************** + * Description: Set the comport structure + * Input Args: dev_name: The comport device name path, such as '/dev/ttyS3' + * baudrate: The baudrate, such as 115200 + * settings: The databit,parity,stopbit,flowctrl settings, such as '8N1N' + * Output Args: NONE + * Return Value: The st_comport structure pointer. + *************************************************************************************/ +st_comport *comport_init(const char *dev_name, int baudrate, const char *settings) +{ + st_comport *comport = NULL; + if (NULL == (comport = (st_comport *) malloc(sizeof(st_comport)))) + { + return NULL; + } + memset(comport, 0, sizeof(st_comport)); + comport->frag_size = 128; + + strncpy(comport->dev_name, dev_name, DEVNAME_LEN); + comport->baudrate = baudrate; + + set_settings(comport, settings); +#ifdef COM_DEBUG + disp_settings(comport); +#endif + + return comport; +} + +#ifdef COM_DEBUG +void disp_settings(st_comport *comport) +{ + COM_PRINT("Device:\t\t\t\"%s\"\n", comport->dev_name); + COM_PRINT("Baudrate:\t\t%ld\n", comport->baudrate); + COM_PRINT("DataBit:\t\t\'%d\'\n", comport->databit); + + switch (comport->parity) + { + case 0: + COM_PRINT("Parity:\t\t\t\'N\'\n"); + break; + case 1: + COM_PRINT("Parity:\t\t\t\'O\'\n"); + break; + case 2: + COM_PRINT("Parity:\t\t\t\'E\'\n"); + break; + case 3: + COM_PRINT("Parity:\t\t\t\'S\'\n"); + break; + } + COM_PRINT("StopBit:\t\t\'%ld\'\n", (long int)comport->stopbit); + switch (comport->flowctrl) + { + case 0: + COM_PRINT("FlowCtrl:\t\t\'N\'\n"); + break; + case 1: + COM_PRINT("FlowCtrl:\t\t\'S\'\n"); + break; + case 2: + COM_PRINT("FlowCtrl:\t\t\'H\'\n"); + break; + case 3: + COM_PRINT("FlowCtrl:\t\t\'B\'\n"); + break; + } + COM_PRINT("\n"); + return; +} +#endif + +/************************************************************************************** + * Description: Set the comport databit,parity,stopbit,flowctrl into the comport structure + * Input Args: comport: the st_comport pointer + * settings: The databit/parity/stopbit/flowctrl settings as like "8N1N" + * Output Args: NONE + * Return Value: NONE + *************************************************************************************/ +void set_settings(st_comport * comport, const char *settings) +{ + if(NULL==settings || NULL==comport) + return ; + + switch (settings[0]) /* data bit */ + { + case '7': + comport->databit = 7; + break; + case '8': + default: + comport->databit = 8; + break; + } + + switch (settings[1]) /* parity */ + { + case 'O': + case 'o': + comport->parity = 1; + break; + case 'E': + case 'e': + comport->parity = 2; + break; + case 'S': + case 's': + comport->parity = 3; + break; + case 'N': + case 'n': + default: + comport->parity = 0; + break; + } + + switch (settings[2]) /* stop bit */ + { + case '0': + comport->stopbit = 0; + break; + case '1': + default: + comport->stopbit = 1; + break; + } + + switch (settings[3]) /* flow control */ + { + case 'S': + case 's': + comport->flowctrl = 1; + break; + case 'H': + case 'h': + comport->flowctrl = 2; + break; + case 'B': + case 'b': + comport->flowctrl = 3; + break; + case 'N': + case 'n': + default: + comport->flowctrl = 0; + break; + } +} + +void comport_close(st_comport * comport) +{ + if (0 != comport->fd) + { + COM_PRINT("Close device \"%s\"\n", comport->dev_name); + close(comport->fd); + } + + comport->fd = -1; +} + +void comport_term(st_comport * comport) +{ + if(NULL == comport) + return; + + if ( comport->fd > 0 ) + { + comport_close(comport); + } + + memset(comport, 0x00, sizeof(st_comport)); + free(comport); + + return; +} + +int comport_open(st_comport * comport) +{ + int retval = -1; + struct termios old_cfg, new_cfg; + int old_flags; + long tmp; + + if(NULL==comport) + return -1; + + comport_close(comport); + + /* Not a TTY device */ + if( !strstr(comport->dev_name, "tty")) + { + COM_PRINT("Open Not tty device \"%s\"\n", comport->dev_name); + comport->fd = open(comport->dev_name, O_RDWR); + retval = comport->fd<0 ? -2 : comport->fd; + goto CleanUp; + } + + comport->fd = open(comport->dev_name, O_RDWR | O_NOCTTY | O_NONBLOCK); + if (comport->fd < 0) + { + retval = -3; + goto CleanUp; + } + COM_PRINT("Open device \"%s\"\n", comport->dev_name); + + if ((-1 != (old_flags = fcntl(comport->fd, F_GETFL, 0))) + && (-1 != fcntl(comport->fd, F_SETFL, old_flags & ~O_NONBLOCK))) + { + // Flush input and output + if (-1 == tcflush(comport->fd, TCIOFLUSH)) + { + retval = -4; + goto CleanUp; + } + } + else // Failure + { + retval = -5; + goto CleanUp; + } + + if (0 != tcgetattr(comport->fd, &old_cfg)) + { + retval = -6; // Failed to get Com settings + goto CleanUp; + } + + memset(&new_cfg, 0, sizeof(new_cfg)); + + /*=====================================*/ + /* Configure comport */ + /*=====================================*/ + + new_cfg.c_cflag &= ~CSIZE; + new_cfg.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); + new_cfg.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON); + new_cfg.c_oflag &= ~(OPOST); + + /* Set the data bit */ + switch (comport->databit) + { + case 0x07: + new_cfg.c_cflag |= CS7; + break; + case 0x06: + new_cfg.c_cflag |= CS6; + break; + case 0x05: + new_cfg.c_cflag |= CS5; + break; + default: + new_cfg.c_cflag |= CS8; + break; + } + + /* Set the parity */ + switch (comport->parity) + { + case 0x01: // Odd + new_cfg.c_cflag |= (PARENB | PARODD); + new_cfg.c_cflag |= (INPCK | ISTRIP); + break; + case 0x02: // Even + new_cfg.c_cflag |= PARENB; + new_cfg.c_cflag &= ~PARODD;; + new_cfg.c_cflag |= (INPCK | ISTRIP); + break; + case 0x03: + new_cfg.c_cflag &= ~PARENB; + new_cfg.c_cflag &= ~CSTOPB; + break; + default: + new_cfg.c_cflag &= ~PARENB; + } + + /* Set Stop bit */ + if (0x01 != comport->stopbit) + { + new_cfg.c_cflag |= CSTOPB; + } + else + { + new_cfg.c_cflag &= ~CSTOPB; + } + + /* Set flow control */ + switch (comport->flowctrl) + { + case 1: // Software control + case 3: + new_cfg.c_cflag &= ~(CRTSCTS); + new_cfg.c_iflag |= (IXON | IXOFF); + break; + case 2: // Hardware control + new_cfg.c_cflag |= CRTSCTS; // Also called CRTSCTS + new_cfg.c_iflag &= ~(IXON | IXOFF); + break; + default: // NONE + new_cfg.c_cflag &= ~(CRTSCTS); + new_cfg.c_iflag &= ~(IXON | IXOFF); + break; + } + + /* Set baudrate */ + switch (comport->baudrate) + { + case 115200: + tmp = B115200; + break; + case 57600: + tmp = B57600; + break; + case 38400: + tmp = B38400; + break; + case 19200: + tmp = B19200; + break; + case 9600: + tmp = B9600; + break; + case 4800: + tmp = B4800; + break; + case 2400: + tmp = B2400; + break; + case 1800: + tmp = B1800; + break; + case 1200: + tmp = B1200; + break; + case 600: + tmp = B600; + break; + case 300: + tmp = B300; + break; + case 200: + tmp = B200; + break; + case 150: + tmp = B150; + break; + case 134: + tmp = B134; + break; + case 110: + tmp = B110; + break; + case 75: + tmp = B75; + break; + case 50: + tmp = B50; + break; + default: + tmp = B115200; + } + cfsetispeed(&new_cfg, tmp); + cfsetispeed(&new_cfg, tmp); + + /* Set the Com port timeout settings */ + new_cfg.c_cc[VMIN] = 0; + new_cfg.c_cc[VTIME] = 0; + + tcflush(comport->fd, TCIFLUSH); + if (0 != tcsetattr(comport->fd, TCSANOW, &new_cfg)) + { + retval = -7; // Failed to set device com port settings + goto CleanUp; + } + + COM_PRINT("Connected device \"%s\".\n", comport->dev_name); + + retval = comport->fd; + +CleanUp: + COM_PRINT("Open device \"%s\" %s.\n", comport->dev_name, retval>0 ? "successfully" : "failure"); + return retval; +} + + +int comport_recv(st_comport * comport, char *buf, int buf_size, unsigned long timeout) +{ + int retval = 0; // Function return value + int iRet; + fd_set stReadFds, stExcpFds; + struct timeval stTime; + + if (NULL == buf || 0 >= buf_size) + { + COM_PRINT("%s() usage error.\n", __FUNCTION__); + retval = -1; + goto CleanUp; + } + + if ( comport->fd < 0 ) + { + COM_PRINT("%s() comport not connected.\n", __FUNCTION__); + retval = -2; + goto CleanUp; + } + + //printf("bufsize=%d timeout=%lu\n", buf_size, timeout); + + FD_ZERO(&stReadFds); + FD_ZERO(&stExcpFds); + FD_SET(comport->fd, &stReadFds); + FD_SET(comport->fd, &stExcpFds); + + if (0xFFFFFFFF != timeout) + { + stTime.tv_sec = (time_t) (timeout / 1000); + stTime.tv_usec = (long)(1000 * (timeout % 1000)); + + iRet = select(comport->fd + 1, &stReadFds, 0, &stExcpFds, &stTime); + if (0 == iRet) + { + retval = 0; // No data in Com port buffer + goto CleanUp; + } + else if (0 < iRet) + { + if (0 != FD_ISSET(comport->fd, &stExcpFds)) + { + retval = -6; // Error during checking recv status + COM_PRINT("Error checking recv status.\n"); + goto CleanUp; + } + + if (0 == FD_ISSET(comport->fd, &stReadFds)) + { + retval = 0; // No incoming data + COM_PRINT("No incoming data.\n"); + goto CleanUp; + } + } + else + { + if (EINTR == errno) + { + COM_PRINT("catch interrupt signal.\n"); + retval = 0; // Interrupted signal catched + } + else + { + COM_PRINT("Check recv status failure.\n"); + retval = -7; // Error during checking recv status + } + + goto CleanUp; + } + } + + usleep(10000); /* sleep for 10ms for data incoming */ + + // Get data from Com port + iRet = read(comport->fd, buf, buf_size); + if (0 > iRet) + { + if (EINTR == errno) + retval = 0; // Interrupted signal catched + else + retval = -3; // Failed to read Com port + + goto CleanUp; + } + +#if 0 + { + int i=0; + printf("Receive %d bytes data: \n", iRet); + for(i=0; i<iRet; i++) + { + printf("0x%02x ", buf[i]); + } + printf("\n"); + } +#endif + + retval = iRet; + + CleanUp: + return retval; + +} + +int comport_send(st_comport * comport, char *buf, int send_bytes) +{ + char *ptr, *end; + int retval = 0; + int send = 0; + + if (NULL == buf || 0 >= send_bytes) + { + COM_PRINT("%s() Usage error.\n", __FUNCTION__); + retval = -1; + goto CleanUp; + } + + if ( comport->fd < 0 ) // Comport not opened ? + { + retval = -3; + COM_PRINT("Serail not connected.\n"); + goto CleanUp; + } + + //printf("Send %s with %d bytes.\n", buf, send_bytes); + + // Large data, then slice them and send + if (comport->frag_size < send_bytes) + { + ptr = buf; + end = buf + send_bytes; + + do + { + // Large than frag_size + if (comport->frag_size < (end - ptr)) + { + send = write(comport->fd, ptr, comport->frag_size); + if (0 >= send || comport->frag_size != send) + { + retval = -4; + goto CleanUp; + } + ptr += comport->frag_size; + } + else // Less than frag_size, maybe last fragmention. + { + send = write(comport->fd, ptr, (end - ptr)); + if (0 >= send || (end - ptr) != send) + { + retval = -4; + goto CleanUp; + } + ptr += (end - ptr); + } + } + while (ptr < end); + } + else // The send data is not large than a fragmention. + { + send = write(comport->fd, buf, send_bytes); + if (0 >= send || send_bytes != send) + { + retval = -5; + goto CleanUp; + } + } + + CleanUp: + return retval; +} + diff --git a/proj1_mqttd/lylib/comport.h b/proj1_mqttd/lylib/comport.h new file mode 100644 index 0000000..5d90519 --- /dev/null +++ b/proj1_mqttd/lylib/comport.h @@ -0,0 +1,106 @@ +/********************************************************************************* + * Copyright: (C) 2018 LingYun IoT System Studio + * All rights reserved. + * + * Filename: comport.h + * Description: This head file is for the common TTY/Serial port operator library + * + * Version: 1.0.0(10/17/2018~) + * Author: Guo Wenxue <guowenxue@gmail.com> + * ChangeLog: 1, Release initial version on "10/17/2018 03:33:25 PM" + * + ********************************************************************************/ +#ifndef __COMPORT_H_ +#define __COMPORT_H_ + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <string.h> +#include <getopt.h> +#include <fcntl.h> +#include <errno.h> +#include <termios.h> +#include <sys/stat.h> +#include <sys/wait.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <sys/select.h> + +#define BUF_64 64 + +#ifndef DEVNAME_LEN +#define DEVNAME_LEN 64 +#endif + +//#define COM_DEBUG +#ifdef COM_DEBUG +#define COM_PRINT(format,args...) printf(format, ##args) +#else +#define COM_PRINT(format,args...) do{} while(0); +#endif + +//#define msleep(m) {struct timespec cSleep; cSleep.tv_sec = 0; cSleep.tv_nsec = m * 1000; nanosleep(&cSleep, 0);} + +typedef struct _st_comport +{ + char dev_name[DEVNAME_LEN]; + unsigned char databit, parity, stopbit, flowctrl; + long baudrate; + + int fd; + int frag_size; +} st_comport; + +/* + * description: initialise the comport structure + * + * input args: $dev_name: The comport device name path, such as '/dev/ttyS3' + * $baudrate: The baudrate, such as 115200 + * $settings: The databit,parity,stopbit,flowctrl settings, such as '8N1N' + * + * return value: The st_comport structure pointer, NULL means failure. + */ + +st_comport *comport_init(const char *dev_name, int baudrate, const char *settings); + + +/* + * description: Open the comport specified by $comport + * input args: $comport: corresponding comport point + * return value: The comport opened file description, <0 means failure + */ +extern int comport_open(st_comport * comport); + +/* + * description: read data from $comport in $timeout <ms> to $buf no more than $buf_size bytes + * return value: the actual read data bytes, <0: read failure + */ +extern int comport_recv(st_comport * comport, char *buf, int buf_size, unsigned long timeout); + +/* + * description: write $send_bytes bytes data from $buf to $comport + * return value: 0: write ok <0: write failure + */ +extern int comport_send(st_comport * comport, char *buf, int send_bytes); + +/* + * description: display current comport settings such as databit,parity,stopbit,flowctrl + * input args: $comport: corresponding comport point + */ +//extern void disp_settings(st_comport * comport); + +/* + * description: close comport + * input args: $comport: corresponding comport point + */ +extern void comport_close(st_comport * comport); + + +/* + * description: terminat comport, close and free it + * input args: $comport: corresponding comport point + */ +extern void comport_term(st_comport * comport); + +#endif diff --git a/proj1_mqttd/lylib/ini_dictionary.c b/proj1_mqttd/lylib/ini_dictionary.c new file mode 100644 index 0000000..09afe59 --- /dev/null +++ b/proj1_mqttd/lylib/ini_dictionary.c @@ -0,0 +1,398 @@ +/*-------------------------------------------------------------------------*/ +/** + @file ini_dictionary.c + @author N. Devillard + @brief Implements a dictionary for string variables. + + This module implements a simple dictionary object, i.e. a list + of string/string associations. This object is useful to store e.g. + informations retrieved from a configuration file (ini files). +*/ +/*--------------------------------------------------------------------------*/ + +/*--------------------------------------------------------------------------- + Includes + ---------------------------------------------------------------------------*/ +#include "ini_dictionary.h" + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +/** Maximum value size for integers and doubles. */ +#define MAXVALSZ 1024 + +/** Minimal allocated number of entries in a dictionary */ +#define DICTMINSZ 128 + +/** Invalid key token */ +#define DICT_INVALID_KEY ((char*)-1) + +/*--------------------------------------------------------------------------- + Private functions + ---------------------------------------------------------------------------*/ + +/* Doubles the allocated size associated to a pointer */ +/* 'size' is the current allocated size. */ +static void * mem_double(void * ptr, int size) +{ + void * newptr ; + + newptr = calloc(2*size, 1); + if (newptr==NULL) { + return NULL ; + } + memcpy(newptr, ptr, size); + free(ptr); + return newptr ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Duplicate a string + @param s String to duplicate + @return Pointer to a newly allocated string, to be freed with free() + + This is a replacement for strdup(). This implementation is provided + for systems that do not have it. + */ +/*--------------------------------------------------------------------------*/ +static char * xstrdup(const char * s) +{ + char * t ; + if (!s) + return NULL ; + t = (char*)malloc(strlen(s)+1) ; + if (t) { + strcpy(t,s); + } + return t ; +} + +/*--------------------------------------------------------------------------- + Function codes + ---------------------------------------------------------------------------*/ +/*-------------------------------------------------------------------------*/ +/** + @brief Compute the hash key for a string. + @param key Character string to use for key. + @return 1 unsigned int on at least 32 bits. + + This hash function has been taken from an Article in Dr Dobbs Journal. + This is normally a collision-free function, distributing keys evenly. + The key is stored anyway in the struct so that collision can be avoided + by comparing the key itself in last resort. + */ +/*--------------------------------------------------------------------------*/ +unsigned dictionary_hash(const char * key) +{ + int len ; + unsigned hash ; + int i ; + + len = strlen(key); + for (hash=0, i=0 ; i<len ; i++) { + hash += (unsigned)key[i] ; + hash += (hash<<10); + hash ^= (hash>>6) ; + } + hash += (hash <<3); + hash ^= (hash >>11); + hash += (hash <<15); + return hash ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Create a new dictionary object. + @param size Optional initial size of the dictionary. + @return 1 newly allocated dictionary objet. + + This function allocates a new dictionary object of given size and returns + it. If you do not know in advance (roughly) the number of entries in the + dictionary, give size=0. + */ +/*--------------------------------------------------------------------------*/ +dictionary * dictionary_new(int size) +{ + dictionary * d ; + + /* If no size was specified, allocate space for DICTMINSZ */ + if (size<DICTMINSZ) size=DICTMINSZ ; + + if (!(d = (dictionary *)calloc(1, sizeof(dictionary)))) { + return NULL; + } + d->size = size ; + d->val = (char **)calloc(size, sizeof(char*)); + d->key = (char **)calloc(size, sizeof(char*)); + d->hash = (unsigned int *)calloc(size, sizeof(unsigned)); + return d ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Delete a dictionary object + @param d dictionary object to deallocate. + @return void + + Deallocate a dictionary object and all memory associated to it. + */ +/*--------------------------------------------------------------------------*/ +void dictionary_del(dictionary * d) +{ + int i ; + + if (d==NULL) return ; + for (i=0 ; i<d->size ; i++) { + if (d->key[i]!=NULL) + free(d->key[i]); + if (d->val[i]!=NULL) + free(d->val[i]); + } + free(d->val); + free(d->key); + free(d->hash); + free(d); + return ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Get a value from a dictionary. + @param d dictionary object to search. + @param key Key to look for in the dictionary. + @param def Default value to return if key not found. + @return 1 pointer to internally allocated character string. + + This function locates a key in a dictionary and returns a pointer to its + value, or the passed 'def' pointer if no such key can be found in + dictionary. The returned character pointer points to data internal to the + dictionary object, you should not try to free it or modify it. + */ +/*--------------------------------------------------------------------------*/ +char * dictionary_get(dictionary * d, const char * key, char * def) +{ + unsigned hash ; + int i ; + + hash = dictionary_hash(key); + for (i=0 ; i<d->size ; i++) { + if (d->key[i]==NULL) + continue ; + /* Compare hash */ + if (hash==d->hash[i]) { + /* Compare string, to avoid hash collisions */ + if (!strcmp(key, d->key[i])) { + return d->val[i] ; + } + } + } + return def ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Set a value in a dictionary. + @param d dictionary object to modify. + @param key Key to modify or add. + @param val Value to add. + @return int 0 if Ok, anything else otherwise + + If the given key is found in the dictionary, the associated value is + replaced by the provided one. If the key cannot be found in the + dictionary, it is added to it. + + It is Ok to provide a NULL value for val, but NULL values for the dictionary + or the key are considered as errors: the function will return immediately + in such a case. + + Notice that if you dictionary_set a variable to NULL, a call to + dictionary_get will return a NULL value: the variable will be found, and + its value (NULL) is returned. In other words, setting the variable + content to NULL is equivalent to deleting the variable from the + dictionary. It is not possible (in this implementation) to have a key in + the dictionary without value. + + This function returns non-zero in case of failure. + */ +/*--------------------------------------------------------------------------*/ +int dictionary_set(dictionary * d, const char * key, const char * val) +{ + int i ; + unsigned hash ; + + if (d==NULL || key==NULL) return -1 ; + + /* Compute hash for this key */ + hash = dictionary_hash(key) ; + /* Find if value is already in dictionary */ + if (d->n>0) { + for (i=0 ; i<d->size ; i++) { + if (d->key[i]==NULL) + continue ; + if (hash==d->hash[i]) { /* Same hash value */ + if (!strcmp(key, d->key[i])) { /* Same key */ + /* Found a value: modify and return */ + if (d->val[i]!=NULL) + free(d->val[i]); + d->val[i] = val ? xstrdup(val) : NULL ; + /* Value has been modified: return */ + return 0 ; + } + } + } + } + /* Add a new value */ + /* See if dictionary needs to grow */ + if (d->n==d->size) { + + /* Reached maximum size: reallocate dictionary */ + d->val = (char **)mem_double(d->val, d->size * sizeof(char*)) ; + d->key = (char **)mem_double(d->key, d->size * sizeof(char*)) ; + d->hash = (unsigned int *)mem_double(d->hash, d->size * sizeof(unsigned)) ; + if ((d->val==NULL) || (d->key==NULL) || (d->hash==NULL)) { + /* Cannot grow dictionary */ + return -1 ; + } + /* Double size */ + d->size *= 2 ; + } + + /* Insert key in the first empty slot. Start at d->n and wrap at + d->size. Because d->n < d->size this will necessarily + terminate. */ + for (i=d->n ; d->key[i] ; ) { + if(++i == d->size) i = 0; + } + /* Copy key */ + d->key[i] = xstrdup(key); + d->val[i] = val ? xstrdup(val) : NULL ; + d->hash[i] = hash; + d->n ++ ; + return 0 ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Delete a key in a dictionary + @param d dictionary object to modify. + @param key Key to remove. + @return void + + This function deletes a key in a dictionary. Nothing is done if the + key cannot be found. + */ +/*--------------------------------------------------------------------------*/ +void dictionary_unset(dictionary * d, const char * key) +{ + unsigned hash ; + int i ; + + if (key == NULL) { + return; + } + + hash = dictionary_hash(key); + for (i=0 ; i<d->size ; i++) { + if (d->key[i]==NULL) + continue ; + /* Compare hash */ + if (hash==d->hash[i]) { + /* Compare string, to avoid hash collisions */ + if (!strcmp(key, d->key[i])) { + /* Found key */ + break ; + } + } + } + if (i>=d->size) + /* Key not found */ + return ; + + free(d->key[i]); + d->key[i] = NULL ; + if (d->val[i]!=NULL) { + free(d->val[i]); + d->val[i] = NULL ; + } + d->hash[i] = 0 ; + d->n -- ; + return ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Dump a dictionary to an opened file pointer. + @param d Dictionary to dump + @param f Opened file pointer. + @return void + + Dumps a dictionary onto an opened file pointer. Key pairs are printed out + as @c [Key]=[Value], one per line. It is Ok to provide stdout or stderr as + output file pointers. + */ +/*--------------------------------------------------------------------------*/ +void dictionary_dump(dictionary * d, FILE * out) +{ + int i ; + + if (d==NULL || out==NULL) return ; + if (d->n<1) { + fprintf(out, "empty dictionary\n"); + return ; + } + for (i=0 ; i<d->size ; i++) { + if (d->key[i]) { + fprintf(out, "%20s\t[%s]\n", + d->key[i], + d->val[i] ? d->val[i] : "UNDEF"); + } + } + return ; +} + + +/* Test code */ +#ifdef TESTDIC +#define NVALS 20000 +int main(int argc, char *argv[]) +{ + dictionary * d ; + char * val ; + int i ; + char cval[90] ; + + /* Allocate dictionary */ + printf("allocating...\n"); + d = dictionary_new(0); + + /* Set values in dictionary */ + printf("setting %d values...\n", NVALS); + for (i=0 ; i<NVALS ; i++) { + sprintf(cval, "%04d", i); + dictionary_set(d, cval, "salut"); + } + printf("getting %d values...\n", NVALS); + for (i=0 ; i<NVALS ; i++) { + sprintf(cval, "%04d", i); + val = dictionary_get(d, cval, DICT_INVALID_KEY); + if (val==DICT_INVALID_KEY) { + printf("cannot get value for key [%s]\n", cval); + } + } + printf("unsetting %d values...\n", NVALS); + for (i=0 ; i<NVALS ; i++) { + sprintf(cval, "%04d", i); + dictionary_unset(d, cval); + } + if (d->n != 0) { + printf("error deleting values\n"); + } + printf("deallocating...\n"); + dictionary_del(d); + return 0 ; +} +#endif +/* vim: set ts=4 et sw=4 tw=75 */ diff --git a/proj1_mqttd/lylib/ini_dictionary.h b/proj1_mqttd/lylib/ini_dictionary.h new file mode 100644 index 0000000..da3d783 --- /dev/null +++ b/proj1_mqttd/lylib/ini_dictionary.h @@ -0,0 +1,165 @@ + +/*-------------------------------------------------------------------------*/ +/** + @file ini_dictionary.h + @author N. Devillard + @brief Implements a dictionary for string variables. + + This module implements a simple dictionary object, i.e. a list + of string/string associations. This object is useful to store e.g. + informations retrieved from a configuration file (ini files). +*/ +/*--------------------------------------------------------------------------*/ + +#ifndef _INI_DICTIONARY_H_ +#define _INI_DICTIONARY_H_ + +/*--------------------------------------------------------------------------- + Includes + ---------------------------------------------------------------------------*/ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +/*--------------------------------------------------------------------------- + New types + ---------------------------------------------------------------------------*/ + + +/*-------------------------------------------------------------------------*/ +/** + @brief Dictionary object + + This object contains a list of string/string associations. Each + association is identified by a unique string key. Looking up values + in the dictionary is speeded up by the use of a (hopefully collision-free) + hash function. + */ +/*-------------------------------------------------------------------------*/ +typedef struct _dictionary_ { + int n ; /** Number of entries in dictionary */ + int size ; /** Storage size */ + char ** val ; /** List of string values */ + char ** key ; /** List of string keys */ + unsigned * hash ; /** List of hash values for keys */ +} dictionary ; + + +/*--------------------------------------------------------------------------- + Function prototypes + ---------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------------------*/ +/** + @brief Compute the hash key for a string. + @param key Character string to use for key. + @return 1 unsigned int on at least 32 bits. + + This hash function has been taken from an Article in Dr Dobbs Journal. + This is normally a collision-free function, distributing keys evenly. + The key is stored anyway in the struct so that collision can be avoided + by comparing the key itself in last resort. + */ +/*--------------------------------------------------------------------------*/ +unsigned dictionary_hash(const char * key); + +/*-------------------------------------------------------------------------*/ +/** + @brief Create a new dictionary object. + @param size Optional initial size of the dictionary. + @return 1 newly allocated dictionary objet. + + This function allocates a new dictionary object of given size and returns + it. If you do not know in advance (roughly) the number of entries in the + dictionary, give size=0. + */ +/*--------------------------------------------------------------------------*/ +dictionary * dictionary_new(int size); + +/*-------------------------------------------------------------------------*/ +/** + @brief Delete a dictionary object + @param d dictionary object to deallocate. + @return void + + Deallocate a dictionary object and all memory associated to it. + */ +/*--------------------------------------------------------------------------*/ +void dictionary_del(dictionary * vd); + +/*-------------------------------------------------------------------------*/ +/** + @brief Get a value from a dictionary. + @param d dictionary object to search. + @param key Key to look for in the dictionary. + @param def Default value to return if key not found. + @return 1 pointer to internally allocated character string. + + This function locates a key in a dictionary and returns a pointer to its + value, or the passed 'def' pointer if no such key can be found in + dictionary. The returned character pointer points to data internal to the + dictionary object, you should not try to free it or modify it. + */ +/*--------------------------------------------------------------------------*/ +char * dictionary_get(dictionary * d, const char * key, char * def); + + +/*-------------------------------------------------------------------------*/ +/** + @brief Set a value in a dictionary. + @param d dictionary object to modify. + @param key Key to modify or add. + @param val Value to add. + @return int 0 if Ok, anything else otherwise + + If the given key is found in the dictionary, the associated value is + replaced by the provided one. If the key cannot be found in the + dictionary, it is added to it. + + It is Ok to provide a NULL value for val, but NULL values for the dictionary + or the key are considered as errors: the function will return immediately + in such a case. + + Notice that if you dictionary_set a variable to NULL, a call to + dictionary_get will return a NULL value: the variable will be found, and + its value (NULL) is returned. In other words, setting the variable + content to NULL is equivalent to deleting the variable from the + dictionary. It is not possible (in this implementation) to have a key in + the dictionary without value. + + This function returns non-zero in case of failure. + */ +/*--------------------------------------------------------------------------*/ +int dictionary_set(dictionary * vd, const char * key, const char * val); + +/*-------------------------------------------------------------------------*/ +/** + @brief Delete a key in a dictionary + @param d dictionary object to modify. + @param key Key to remove. + @return void + + This function deletes a key in a dictionary. Nothing is done if the + key cannot be found. + */ +/*--------------------------------------------------------------------------*/ +void dictionary_unset(dictionary * d, const char * key); + + +/*-------------------------------------------------------------------------*/ +/** + @brief Dump a dictionary to an opened file pointer. + @param d Dictionary to dump + @param f Opened file pointer. + @return void + + Dumps a dictionary onto an opened file pointer. Key pairs are printed out + as @c [Key]=[Value], one per line. It is Ok to provide stdout or stderr as + output file pointers. + */ +/*--------------------------------------------------------------------------*/ +void dictionary_dump(dictionary * d, FILE * out); + +#endif diff --git a/proj1_mqttd/lylib/iniparser.c b/proj1_mqttd/lylib/iniparser.c new file mode 100644 index 0000000..8135b5b --- /dev/null +++ b/proj1_mqttd/lylib/iniparser.c @@ -0,0 +1,807 @@ + +/*-------------------------------------------------------------------------*/ +/** + @file iniparser.c + @author N. Devillard + @brief Parser for ini files. +*/ +/*--------------------------------------------------------------------------*/ +/*---------------------------- Includes ------------------------------------*/ +#include <ctype.h> +#include "iniparser.h" + +/*---------------------------- Defines -------------------------------------*/ +#define ASCIILINESZ (1024) +#define INI_INVALID_KEY ((char*)-1) + +/*--------------------------------------------------------------------------- + Private to this module + ---------------------------------------------------------------------------*/ +/** + * This enum stores the status for each parsed line (internal use only). + */ +typedef enum _line_status_ { + LINE_UNPROCESSED, + LINE_ERROR, + LINE_EMPTY, + LINE_COMMENT, + LINE_SECTION, + LINE_VALUE +} line_status ; + +/*-------------------------------------------------------------------------*/ +/** + @brief Convert a string to lowercase. + @param s String to convert. + @return ptr to statically allocated string. + + This function returns a pointer to a statically allocated string + containing a lowercased version of the input string. Do not free + or modify the returned string! Since the returned string is statically + allocated, it will be modified at each function call (not re-entrant). + */ +/*--------------------------------------------------------------------------*/ +static char * strlwc(const char * s) +{ + static char l[ASCIILINESZ+1]; + int i ; + + if (s==NULL) return NULL ; + memset(l, 0, ASCIILINESZ+1); + i=0 ; + while (s[i] && i<ASCIILINESZ) { + l[i] = (char)tolower((int)s[i]); + i++ ; + } + l[ASCIILINESZ]=(char)0; + return l ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Remove blanks at the beginning and the end of a string. + @param s String to parse. + @return ptr to statically allocated string. + + This function returns a pointer to a statically allocated string, + which is identical to the input string, except that all blank + characters at the end and the beg. of the string have been removed. + Do not free or modify the returned string! Since the returned string + is statically allocated, it will be modified at each function call + (not re-entrant). + */ +/*--------------------------------------------------------------------------*/ +static char * strstrip(const char * s) +{ + static char l[ASCIILINESZ+1]; + char * last ; + + if (s==NULL) return NULL ; + + while (isspace((int)*s) && *s) s++; + memset(l, 0, ASCIILINESZ+1); + strcpy(l, s); + last = l + strlen(l); + while (last > l) { + if (!isspace((int)*(last-1))) + break ; + last -- ; + } + *last = (char)0; + return (char*)l ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Get number of sections in a dictionary + @param d Dictionary to examine + @return int Number of sections found in dictionary + + This function returns the number of sections found in a dictionary. + The test to recognize sections is done on the string stored in the + dictionary: a section name is given as "section" whereas a key is + stored as "section:key", thus the test looks for entries that do not + contain a colon. + + This clearly fails in the case a section name contains a colon, but + this should simply be avoided. + + This function returns -1 in case of error. + */ +/*--------------------------------------------------------------------------*/ +int iniparser_getnsec(dictionary * d) +{ + int i ; + int nsec ; + + if (d==NULL) return -1 ; + nsec=0 ; + for (i=0 ; i<d->size ; i++) { + if (d->key[i]==NULL) + continue ; + if (strchr(d->key[i], ':')==NULL) { + nsec ++ ; + } + } + return nsec ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Get name for section n in a dictionary. + @param d Dictionary to examine + @param n Section number (from 0 to nsec-1). + @return Pointer to char string + + This function locates the n-th section in a dictionary and returns + its name as a pointer to a string statically allocated inside the + dictionary. Do not free or modify the returned string! + + This function returns NULL in case of error. + */ +/*--------------------------------------------------------------------------*/ +char * iniparser_getsecname(dictionary * d, int n) +{ + int i ; + int foundsec ; + + if (d==NULL || n<0) return NULL ; + foundsec=0 ; + for (i=0 ; i<d->size ; i++) { + if (d->key[i]==NULL) + continue ; + if (strchr(d->key[i], ':')==NULL) { + foundsec++ ; + if (foundsec>n) + break ; + } + } + if (foundsec<=n) { + return NULL ; + } + return d->key[i] ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Dump a dictionary to an opened file pointer. + @param d Dictionary to dump. + @param f Opened file pointer to dump to. + @return void + + This function prints out the contents of a dictionary, one element by + line, onto the provided file pointer. It is OK to specify @c stderr + or @c stdout as output files. This function is meant for debugging + purposes mostly. + */ +/*--------------------------------------------------------------------------*/ +void iniparser_dump(dictionary * d, FILE * f) +{ + int i ; + + if (d==NULL || f==NULL) return ; + for (i=0 ; i<d->size ; i++) { + if (d->key[i]==NULL) + continue ; + if (d->val[i]!=NULL) { + fprintf(f, "[%s]=[%s]\n", d->key[i], d->val[i]); + } else { + fprintf(f, "[%s]=UNDEF\n", d->key[i]); + } + } + return ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Save a dictionary to a loadable ini file + @param d Dictionary to dump + @param f Opened file pointer to dump to + @return void + + This function dumps a given dictionary into a loadable ini file. + It is Ok to specify @c stderr or @c stdout as output files. + */ +/*--------------------------------------------------------------------------*/ +void iniparser_dump_ini(dictionary * d, FILE * f) +{ + int i ; + int nsec ; + char * secname ; + + if (d==NULL || f==NULL) return ; + + nsec = iniparser_getnsec(d); + if (nsec<1) { + /* No section in file: dump all keys as they are */ + for (i=0 ; i<d->size ; i++) { + if (d->key[i]==NULL) + continue ; + fprintf(f, "%s = %s\n", d->key[i], d->val[i]); + } + return ; + } + for (i=0 ; i<nsec ; i++) { + secname = iniparser_getsecname(d, i) ; + iniparser_dumpsection_ini(d, secname, f) ; + } + fprintf(f, "\n"); + return ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Save a dictionary section to a loadable ini file + @param d Dictionary to dump + @param s Section name of dictionary to dump + @param f Opened file pointer to dump to + @return void + + This function dumps a given section of a given dictionary into a loadable ini + file. It is Ok to specify @c stderr or @c stdout as output files. + */ +/*--------------------------------------------------------------------------*/ +void iniparser_dumpsection_ini(dictionary * d, char * s, FILE * f) +{ + int j ; + char keym[ASCIILINESZ+1]; + int seclen ; + + if (d==NULL || f==NULL) return ; + if (! iniparser_find_entry(d, s)) return ; + + seclen = (int)strlen(s); + fprintf(f, "\n[%s]\n", s); + sprintf(keym, "%s:", s); + for (j=0 ; j<d->size ; j++) { + if (d->key[j]==NULL) + continue ; + if (!strncmp(d->key[j], keym, seclen+1)) { + fprintf(f, + "%-30s = %s\n", + d->key[j]+seclen+1, + d->val[j] ? d->val[j] : ""); + } + } + fprintf(f, "\n"); + return ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Get the number of keys in a section of a dictionary. + @param d Dictionary to examine + @param s Section name of dictionary to examine + @return Number of keys in section + */ +/*--------------------------------------------------------------------------*/ +int iniparser_getsecnkeys(dictionary * d, char * s) +{ + int seclen, nkeys ; + char keym[ASCIILINESZ+1]; + int j ; + + nkeys = 0; + + if (d==NULL) return nkeys; + if (! iniparser_find_entry(d, s)) return nkeys; + + seclen = (int)strlen(s); + sprintf(keym, "%s:", s); + + for (j=0 ; j<d->size ; j++) { + if (d->key[j]==NULL) + continue ; + if (!strncmp(d->key[j], keym, seclen+1)) + nkeys++; + } + + return nkeys; + +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Get the number of keys in a section of a dictionary. + @param d Dictionary to examine + @param s Section name of dictionary to examine + @return pointer to statically allocated character strings + + This function queries a dictionary and finds all keys in a given section. + Each pointer in the returned char pointer-to-pointer is pointing to + a string allocated in the dictionary; do not free or modify them. + + This function returns NULL in case of error. + */ +/*--------------------------------------------------------------------------*/ +char ** iniparser_getseckeys(dictionary * d, char * s) +{ + + char **keys; + + int i, j ; + char keym[ASCIILINESZ+1]; + int seclen, nkeys ; + + keys = NULL; + + if (d==NULL) return keys; + if (! iniparser_find_entry(d, s)) return keys; + + nkeys = iniparser_getsecnkeys(d, s); + + keys = (char**) malloc(nkeys*sizeof(char*)); + + seclen = (int)strlen(s); + sprintf(keym, "%s:", s); + + i = 0; + + for (j=0 ; j<d->size ; j++) { + if (d->key[j]==NULL) + continue ; + if (!strncmp(d->key[j], keym, seclen+1)) { + keys[i] = d->key[j]; + i++; + } + } + + return keys; + +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Get the string associated to a key + @param d Dictionary to search + @param key Key string to look for + @param def Default value to return if key not found. + @return pointer to statically allocated character string + + This function queries a dictionary for a key. A key as read from an + ini file is given as "section:key". If the key cannot be found, + the pointer passed as 'def' is returned. + The returned char pointer is pointing to a string allocated in + the dictionary, do not free or modify it. + */ +/*--------------------------------------------------------------------------*/ +char * iniparser_getstring(dictionary * d, const char * key, char * def) +{ + char * lc_key ; + char * sval ; + + if (d==NULL || key==NULL) + return def ; + + lc_key = strlwc(key); + sval = dictionary_get(d, lc_key, def); + return sval ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Get the string associated to a key, convert to an int + @param d Dictionary to search + @param key Key string to look for + @param notfound Value to return in case of error + @return integer + + This function queries a dictionary for a key. A key as read from an + ini file is given as "section:key". If the key cannot be found, + the notfound value is returned. + + Supported values for integers include the usual C notation + so decimal, octal (starting with 0) and hexadecimal (starting with 0x) + are supported. Examples: + + "42" -> 42 + "042" -> 34 (octal -> decimal) + "0x42" -> 66 (hexa -> decimal) + + Warning: the conversion may overflow in various ways. Conversion is + totally outsourced to strtol(), see the associated man page for overflow + handling. + + Credits: Thanks to A. Becker for suggesting strtol() + */ +/*--------------------------------------------------------------------------*/ +int iniparser_getint(dictionary * d, const char * key, int notfound) +{ + char * str ; + + str = iniparser_getstring(d, key, INI_INVALID_KEY); + if (str==INI_INVALID_KEY) return notfound ; + return (int)strtol(str, NULL, 0); +} + +int iniparser_getlong(dictionary * d, const char * key, int notfound) +{ + char * str ; + + str = iniparser_getstring(d, key, INI_INVALID_KEY); + if (str==INI_INVALID_KEY) return notfound ; + return strtol(str, NULL, 0); +} +/*-------------------------------------------------------------------------*/ +/** + @brief Get the string associated to a key, convert to a double + @param d Dictionary to search + @param key Key string to look for + @param notfound Value to return in case of error + @return double + + This function queries a dictionary for a key. A key as read from an + ini file is given as "section:key". If the key cannot be found, + the notfound value is returned. + */ +/*--------------------------------------------------------------------------*/ +double iniparser_getdouble(dictionary * d, const char * key, double notfound) +{ + char * str ; + + str = iniparser_getstring(d, key, INI_INVALID_KEY); + if (str==INI_INVALID_KEY) return notfound ; + return atof(str); +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Get the string associated to a key, convert to a boolean + @param d Dictionary to search + @param key Key string to look for + @param notfound Value to return in case of error + @return integer + + This function queries a dictionary for a key. A key as read from an + ini file is given as "section:key". If the key cannot be found, + the notfound value is returned. + + A true boolean is found if one of the following is matched: + + - A string starting with 'y' + - A string starting with 'Y' + - A string starting with 't' + - A string starting with 'T' + - A string starting with '1' + + A false boolean is found if one of the following is matched: + + - A string starting with 'n' + - A string starting with 'N' + - A string starting with 'f' + - A string starting with 'F' + - A string starting with '0' + + The notfound value returned if no boolean is identified, does not + necessarily have to be 0 or 1. + */ +/*--------------------------------------------------------------------------*/ +int iniparser_getboolean(dictionary * d, const char * key, int notfound) +{ + char * c ; + int ret ; + + c = iniparser_getstring(d, key, INI_INVALID_KEY); + if (c==INI_INVALID_KEY) return notfound ; + if (c[0]=='y' || c[0]=='Y' || c[0]=='1' || c[0]=='t' || c[0]=='T') { + ret = 1 ; + } else if (c[0]=='n' || c[0]=='N' || c[0]=='0' || c[0]=='f' || c[0]=='F') { + ret = 0 ; + } else { + ret = notfound ; + } + return ret; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Finds out if a given entry exists in a dictionary + @param ini Dictionary to search + @param entry Name of the entry to look for + @return integer 1 if entry exists, 0 otherwise + + Finds out if a given entry exists in the dictionary. Since sections + are stored as keys with NULL associated values, this is the only way + of querying for the presence of sections in a dictionary. + */ +/*--------------------------------------------------------------------------*/ +int iniparser_find_entry( + dictionary * ini, + const char * entry +) +{ + int found=0 ; + if (iniparser_getstring(ini, entry, INI_INVALID_KEY)!=INI_INVALID_KEY) { + found = 1 ; + } + return found ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Set an entry in a dictionary. + @param ini Dictionary to modify. + @param entry Entry to modify (entry name) + @param val New value to associate to the entry. + @return int 0 if Ok, -1 otherwise. + + If the given entry can be found in the dictionary, it is modified to + contain the provided value. If it cannot be found, -1 is returned. + It is Ok to set val to NULL. + */ +/*--------------------------------------------------------------------------*/ +int iniparser_set(dictionary * ini, const char * entry, const char * val) +{ + return dictionary_set(ini, strlwc(entry), val) ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Delete an entry in a dictionary + @param ini Dictionary to modify + @param entry Entry to delete (entry name) + @return void + + If the given entry can be found, it is deleted from the dictionary. + */ +/*--------------------------------------------------------------------------*/ +void iniparser_unset(dictionary * ini, const char * entry) +{ + dictionary_unset(ini, strlwc(entry)); +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Load a single line from an INI file + @param input_line Input line, may be concatenated multi-line input + @param section Output space to store section + @param key Output space to store key + @param value Output space to store value + @return line_status value + */ +/*--------------------------------------------------------------------------*/ +static line_status iniparser_line( + char * input_line, + char * section, + char * key, + char * value) +{ + line_status sta ; + char line[ASCIILINESZ+1]; + static char left_line[ASCIILINESZ+1]; + int len, offset ; + + strcpy(line, strstrip(input_line)); + len = (int)strlen(line); + + sta = LINE_UNPROCESSED ; + if (len<1) { + /* Empty line */ + sta = LINE_EMPTY ; + memset(input_line, 0, len); + } else if (line[0]=='#' || line[0]==';') { + /* Comment line */ + sta = LINE_COMMENT ; + memset(input_line, 0, len); + } else if (line[0]=='[') { + /* Section name */ + sscanf(line, "[%[^]]", section); + strcpy(section, strstrip(section)); + strcpy(section, strlwc(section)); + + /* Left configure will go to next time to parser */ + offset = strlen(section) + 2; + strcpy( left_line, strstrip(&(line[offset])) ); + strcpy( left_line, strstrip(left_line)); + + if( strlen(left_line) > 0) + { + strcpy(input_line, left_line); + strcat(input_line, "\n"); + } + else + { + memset(input_line, 0, len); + } + sta = LINE_SECTION ; + } else if (sscanf (line, "%[^=] = \"%[^\"]\"", key, value) == 2 + || sscanf (line, "%[^=] = '%[^\']'", key, value) == 2 + || sscanf (line, "%[^=] = %[^;#]", key, value) == 2) { + char *ptr = NULL; + + /* Usual key=value, with or without comments */ + strcpy(key, strstrip(key)); + strcpy(key, strlwc(key)); + strcpy(value, strstrip(value)); + /* + * sscanf cannot handle '' or "" as empty values + * this is done here + */ + if (!strncmp(value, "\"\"", 2) || (!strncmp(value, "''", 2)) ) { + value[0]=0 ; + } + + ptr = strchr(line, '='); + if('\''==*(ptr+1) || '\"'==*(ptr+1)) + { + offset = strlen(key)+strlen(value) + 1 + 2; /* Skip $key='$val' */ + } + else + { + offset = strlen(key)+strlen(value) + 1; /* Skip $key=$val */ + } + strcpy( left_line, strstrip(&(line[offset])) ); + + if( strlen(left_line) > 0) + { + strcpy(input_line, left_line); + strcat(input_line, "\n"); + } + else + { + memset(input_line, 0, len); + } + sta = LINE_VALUE ; + } else if (sscanf(line, "%[^=] = %[;#]", key, value)==2 + || sscanf(line, "%[^=] %[=]", key, value) == 2) { + /* + * Special cases: + * key= + * key=; + * key=# + */ + strcpy(key, strstrip(key)); + strcpy(key, strlwc(key)); + value[0]=0 ; + sta = LINE_VALUE ; + } else { + /* Generate syntax error */ + sta = LINE_ERROR ; + memset(input_line, 0, len); + } + return sta ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Parse an ini file and return an allocated dictionary object + @param ininame Name of the ini file to read. + @return Pointer to newly allocated dictionary + + This is the parser for ini files. This function is called, providing + the name of the file to be read. It returns a dictionary object that + should not be accessed directly, but through accessor functions + instead. + + The returned dictionary must be freed using iniparser_freedict(). + */ +/*--------------------------------------------------------------------------*/ +dictionary * iniparser_load(const char * ininame) +{ + FILE * in ; + + char line [ASCIILINESZ+1] ; + char section [ASCIILINESZ+1] ; + char key [ASCIILINESZ+1] ; + char tmp [ASCIILINESZ+1] ; + char val [ASCIILINESZ+1] ; + + int last=0 ; + int len ; + int lineno=0 ; + int errs=0; + + dictionary * dict ; + + if ((in=fopen(ininame, "r"))==NULL) { + fprintf(stderr, "iniparser: cannot open %s\n", ininame); + return NULL ; + } + + dict = dictionary_new(0) ; + if (!dict) { + fclose(in); + return NULL ; + } + + memset(line, 0, ASCIILINESZ); + memset(section, 0, ASCIILINESZ); + memset(key, 0, ASCIILINESZ); + memset(val, 0, ASCIILINESZ); + last=0 ; + + while (fgets(line+last, ASCIILINESZ-last, in)!=NULL) { + lineno++ ; +CONTINUE_PARSER: + len = (int)strlen(line)-1; + if (len==0) + continue; + /* Safety check against buffer overflows */ + if (line[len]!='\n') { + fprintf(stderr, + "iniparser: input line too long in %s (%d)\n", + ininame, + lineno); + dictionary_del(dict); + fclose(in); + return NULL ; + } + /* Get rid of \n and spaces at end of line */ + while ((len>=0) && + ((line[len]=='\n') || (isspace(line[len])))) { + line[len]=0 ; + len-- ; + } + /* Detect multi-line */ + if (line[len]=='\\') { + /* Multi-line value */ + last=len ; + continue ; + } else { + last=0 ; + } + + switch ( iniparser_line(line, section, key, val) ) { + case LINE_EMPTY: + case LINE_COMMENT: + break ; + + case LINE_SECTION: + errs = dictionary_set(dict, section, NULL); + break ; + + case LINE_VALUE: + sprintf(tmp, "%s:%s", section, key); + errs = dictionary_set(dict, tmp, val) ; + break ; + + case LINE_ERROR: + fprintf(stderr, "iniparser: syntax error in %s (%d):\n", + ininame, + lineno); + fprintf(stderr, "-> %s\n", line); + errs++ ; + break; + + default: + break ; + } + + if( strlen(line) > 0) + { + goto CONTINUE_PARSER; + } + + memset(line, 0, ASCIILINESZ); + last=0; + if (errs<0) { + fprintf(stderr, "iniparser: memory allocation failure\n"); + break ; + } + } + if (errs) { + dictionary_del(dict); + dict = NULL ; + } + fclose(in); + return dict ; +} + + +/*-------------------------------------------------------------------------*/ +/** + @brief Free all memory associated to an ini dictionary + @param d Dictionary to free + @return void + + Free all memory associated to an ini dictionary. + It is mandatory to call this function before the dictionary object + gets out of the current context. + */ +/*--------------------------------------------------------------------------*/ +void iniparser_freedict(dictionary * d) +{ + dictionary_del(d); +} + +/* vim: set ts=4 et sw=4 tw=75 */ diff --git a/proj1_mqttd/lylib/iniparser.h b/proj1_mqttd/lylib/iniparser.h new file mode 100644 index 0000000..4c7ec83 --- /dev/null +++ b/proj1_mqttd/lylib/iniparser.h @@ -0,0 +1,308 @@ + +/*-------------------------------------------------------------------------*/ +/** + @file cp_iniparser.h + @author N. Devillard + @brief Parser for ini files. +*/ +/*--------------------------------------------------------------------------*/ + +#ifndef _INIPARSER_H_ +#define _INIPARSER_H_ + +/*--------------------------------------------------------------------------- + Includes + ---------------------------------------------------------------------------*/ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +/* + * The following #include is necessary on many Unixes but not Linux. + * It is not needed for Windows platforms. + * Uncomment it if needed. + */ +/* #include <unistd.h> */ + +#include "ini_dictionary.h" + +/*-------------------------------------------------------------------------*/ +/** + @brief Get number of sections in a dictionary + @param d Dictionary to examine + @return int Number of sections found in dictionary + + This function returns the number of sections found in a dictionary. + The test to recognize sections is done on the string stored in the + dictionary: a section name is given as "section" whereas a key is + stored as "section:key", thus the test looks for entries that do not + contain a colon. + + This clearly fails in the case a section name contains a colon, but + this should simply be avoided. + + This function returns -1 in case of error. + */ +/*--------------------------------------------------------------------------*/ + +int iniparser_getnsec(dictionary * d); + + +/*-------------------------------------------------------------------------*/ +/** + @brief Get name for section n in a dictionary. + @param d Dictionary to examine + @param n Section number (from 0 to nsec-1). + @return Pointer to char string + + This function locates the n-th section in a dictionary and returns + its name as a pointer to a string statically allocated inside the + dictionary. Do not free or modify the returned string! + + This function returns NULL in case of error. + */ +/*--------------------------------------------------------------------------*/ + +char * iniparser_getsecname(dictionary * d, int n); + + +/*-------------------------------------------------------------------------*/ +/** + @brief Save a dictionary to a loadable ini file + @param d Dictionary to dump + @param f Opened file pointer to dump to + @return void + + This function dumps a given dictionary into a loadable ini file. + It is Ok to specify @c stderr or @c stdout as output files. + */ +/*--------------------------------------------------------------------------*/ + +void iniparser_dump_ini(dictionary * d, FILE * f); + +/*-------------------------------------------------------------------------*/ +/** + @brief Save a dictionary section to a loadable ini file + @param d Dictionary to dump + @param s Section name of dictionary to dump + @param f Opened file pointer to dump to + @return void + + This function dumps a given section of a given dictionary into a loadable ini + file. It is Ok to specify @c stderr or @c stdout as output files. + */ +/*--------------------------------------------------------------------------*/ + +void iniparser_dumpsection_ini(dictionary * d, char * s, FILE * f); + +/*-------------------------------------------------------------------------*/ +/** + @brief Dump a dictionary to an opened file pointer. + @param d Dictionary to dump. + @param f Opened file pointer to dump to. + @return void + + This function prints out the contents of a dictionary, one element by + line, onto the provided file pointer. It is OK to specify @c stderr + or @c stdout as output files. This function is meant for debugging + purposes mostly. + */ +/*--------------------------------------------------------------------------*/ +void iniparser_dump(dictionary * d, FILE * f); + +/*-------------------------------------------------------------------------*/ +/** + @brief Get the number of keys in a section of a dictionary. + @param d Dictionary to examine + @param s Section name of dictionary to examine + @return Number of keys in section + */ +/*--------------------------------------------------------------------------*/ +int iniparser_getsecnkeys(dictionary * d, char * s); + +/*-------------------------------------------------------------------------*/ +/** + @brief Get the number of keys in a section of a dictionary. + @param d Dictionary to examine + @param s Section name of dictionary to examine + @return pointer to statically allocated character strings + + This function queries a dictionary and finds all keys in a given section. + Each pointer in the returned char pointer-to-pointer is pointing to + a string allocated in the dictionary; do not free or modify them. + + This function returns NULL in case of error. + */ +/*--------------------------------------------------------------------------*/ +char ** iniparser_getseckeys(dictionary * d, char * s); + +/*-------------------------------------------------------------------------*/ +/** + @brief Get the string associated to a key + @param d Dictionary to search + @param key Key string to look for + @param def Default value to return if key not found. + @return pointer to statically allocated character string + + This function queries a dictionary for a key. A key as read from an + ini file is given as "section:key". If the key cannot be found, + the pointer passed as 'def' is returned. + The returned char pointer is pointing to a string allocated in + the dictionary, do not free or modify it. + */ +/*--------------------------------------------------------------------------*/ +char * iniparser_getstring(dictionary * d, const char * key, char * def); + +/*-------------------------------------------------------------------------*/ +/** + @brief Get the string associated to a key, convert to an int + @param d Dictionary to search + @param key Key string to look for + @param notfound Value to return in case of error + @return integer + + This function queries a dictionary for a key. A key as read from an + ini file is given as "section:key". If the key cannot be found, + the notfound value is returned. + + Supported values for integers include the usual C notation + so decimal, octal (starting with 0) and hexadecimal (starting with 0x) + are supported. Examples: + + - "42" -> 42 + - "042" -> 34 (octal -> decimal) + - "0x42" -> 66 (hexa -> decimal) + + Warning: the conversion may overflow in various ways. Conversion is + totally outsourced to strtol(), see the associated man page for overflow + handling. + + Credits: Thanks to A. Becker for suggesting strtol() + */ +/*--------------------------------------------------------------------------*/ +int iniparser_getint(dictionary * d, const char * key, int notfound); +int iniparser_getlong(dictionary * d, const char * key, int notfound); + +/*-------------------------------------------------------------------------*/ +/** + @brief Get the string associated to a key, convert to a double + @param d Dictionary to search + @param key Key string to look for + @param notfound Value to return in case of error + @return double + + This function queries a dictionary for a key. A key as read from an + ini file is given as "section:key". If the key cannot be found, + the notfound value is returned. + */ +/*--------------------------------------------------------------------------*/ +double iniparser_getdouble(dictionary * d, const char * key, double notfound); + +/*-------------------------------------------------------------------------*/ +/** + @brief Get the string associated to a key, convert to a boolean + @param d Dictionary to search + @param key Key string to look for + @param notfound Value to return in case of error + @return integer + + This function queries a dictionary for a key. A key as read from an + ini file is given as "section:key". If the key cannot be found, + the notfound value is returned. + + A true boolean is found if one of the following is matched: + + - A string starting with 'y' + - A string starting with 'Y' + - A string starting with 't' + - A string starting with 'T' + - A string starting with '1' + + A false boolean is found if one of the following is matched: + + - A string starting with 'n' + - A string starting with 'N' + - A string starting with 'f' + - A string starting with 'F' + - A string starting with '0' + + The notfound value returned if no boolean is identified, does not + necessarily have to be 0 or 1. + */ +/*--------------------------------------------------------------------------*/ +int iniparser_getboolean(dictionary * d, const char * key, int notfound); + + +/*-------------------------------------------------------------------------*/ +/** + @brief Set an entry in a dictionary. + @param ini Dictionary to modify. + @param entry Entry to modify (entry name) + @param val New value to associate to the entry. + @return int 0 if Ok, -1 otherwise. + + If the given entry can be found in the dictionary, it is modified to + contain the provided value. If it cannot be found, -1 is returned. + It is Ok to set val to NULL. + */ +/*--------------------------------------------------------------------------*/ +int iniparser_set(dictionary * ini, const char * entry, const char * val); + + +/*-------------------------------------------------------------------------*/ +/** + @brief Delete an entry in a dictionary + @param ini Dictionary to modify + @param entry Entry to delete (entry name) + @return void + + If the given entry can be found, it is deleted from the dictionary. + */ +/*--------------------------------------------------------------------------*/ +void iniparser_unset(dictionary * ini, const char * entry); + +/*-------------------------------------------------------------------------*/ +/** + @brief Finds out if a given entry exists in a dictionary + @param ini Dictionary to search + @param entry Name of the entry to look for + @return integer 1 if entry exists, 0 otherwise + + Finds out if a given entry exists in the dictionary. Since sections + are stored as keys with NULL associated values, this is the only way + of querying for the presence of sections in a dictionary. + */ +/*--------------------------------------------------------------------------*/ +int iniparser_find_entry(dictionary * ini, const char * entry) ; + +/*-------------------------------------------------------------------------*/ +/** + @brief Parse an ini file and return an allocated dictionary object + @param ininame Name of the ini file to read. + @return Pointer to newly allocated dictionary + + This is the parser for ini files. This function is called, providing + the name of the file to be read. It returns a dictionary object that + should not be accessed directly, but through accessor functions + instead. + + The returned dictionary must be freed using iniparser_freedict(). + */ +/*--------------------------------------------------------------------------*/ +dictionary * iniparser_load(const char * ininame); + +/*-------------------------------------------------------------------------*/ +/** + @brief Free all memory associated to an ini dictionary + @param d Dictionary to free + @return void + + Free all memory associated to an ini dictionary. + It is mandatory to call this function before the dictionary object + gets out of the current context. + */ +/*--------------------------------------------------------------------------*/ +void iniparser_freedict(dictionary * d); + +#endif diff --git a/proj1_mqttd/lylib/klist.h b/proj1_mqttd/lylib/klist.h new file mode 100644 index 0000000..a75bdd1 --- /dev/null +++ b/proj1_mqttd/lylib/klist.h @@ -0,0 +1,723 @@ +/********************************************************************************* + * Copyright: (C) 2012 Guo Wenxue <guowenxue@gmail.com> + * All rights reserved. + * + * Filename: cp_list.h + * Description: This file is copied from Linux kernel, which provide link list API. + * + * Version: 1.0.0(08/09/2012~) + * Author: Guo Wenxue <guowenxue@gmail.com> + * ChangeLog: 1, Release initial version on "08/09/2012 02:24:34 AM" + * + ********************************************************************************/ + +#ifndef _LINUX_LIST_H +#define _LINUX_LIST_H + +#include <linux/stddef.h> + + +/** + * container_of - cast a member of a structure out to the containing structure + * @ptr: the pointer to the member. + * @type: the type of the container struct this is embedded in. + * @member: the name of the member within the struct. + * + */ +#undef offsetof +#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +#define container_of(ptr, type, member) ({ \ + const typeof( ((type *)0)->member ) *__mptr = (ptr); \ + (type *)( (char *)__mptr - offsetof(type,member) );}) + + +/* + * Architectures might want to move the poison pointer offset + * into some well-recognized area such as 0xdead000000000000, + * that is also not mappable by user-space exploits: + */ +#ifdef CONFIG_ILLEGAL_POINTER_VALUE +# define POISON_POINTER_DELTA _AC(CONFIG_ILLEGAL_POINTER_VALUE, UL) +#else +# define POISON_POINTER_DELTA 0 +#endif + +/* + * These are non-NULL pointers that will result in page faults + * under normal circumstances, used to verify that nobody uses + * non-initialized list entries. + */ +#define LIST_POISON1 ((void *) 0x00100100 + POISON_POINTER_DELTA) +#define LIST_POISON2 ((void *) 0x00200200 + POISON_POINTER_DELTA) + +#ifndef ARCH_HAS_PREFETCH +#define ARCH_HAS_PREFETCH +static inline void prefetch(const void *x) {;} +#endif + +/* + * Simple doubly linked list implementation. + * + * Some of the internal functions ("__xxx") are useful when + * manipulating whole lists rather than single entries, as + * sometimes we already know the next/prev entries and we can + * generate better code by using them directly rather than + * using the generic single-entry routines. + */ + +struct list_head { + struct list_head *next, *prev; +}; + +#define LIST_HEAD_INIT(name) { &(name), &(name) } + +#define LIST_HEAD(name) \ + struct list_head name = LIST_HEAD_INIT(name) + +static inline void INIT_LIST_HEAD(struct list_head *list) +{ + list->next = list; + list->prev = list; +} + +/* + * Insert a new entry between two known consecutive entries. + * + * This is only for internal list manipulation where we know + * the prev/next entries already! + */ +static inline void __list_add(struct list_head *new, + struct list_head *prev, + struct list_head *next) +{ + next->prev = new; + new->next = next; + new->prev = prev; + prev->next = new; +} + +/** + * list_add - add a new entry + * @new: new entry to be added + * @head: list head to add it after + * + * Insert a new entry after the specified head. + * This is good for implementing stacks. + */ +static inline void list_add(struct list_head *new, struct list_head *head) +{ + __list_add(new, head, head->next); +} + +/** + * list_add_tail - add a new entry + * @new: new entry to be added + * @head: list head to add it before + * + * Insert a new entry before the specified head. + * This is useful for implementing queues. + */ +static inline void list_add_tail(struct list_head *new, struct list_head *head) +{ + __list_add(new, head->prev, head); +} + +/* + * Delete a list entry by making the prev/next entries + * point to each other. + * + * This is only for internal list manipulation where we know + * the prev/next entries already! + */ +static inline void __list_del(struct list_head *prev, struct list_head *next) +{ + next->prev = prev; + prev->next = next; +} + +/** + * list_del - deletes entry from list. + * @entry: the element to delete from the list. + * Note: list_empty() on entry does not return true after this, the entry is + * in an undefined state. + */ +static inline void list_del(struct list_head *entry) +{ + __list_del(entry->prev, entry->next); + entry->next = LIST_POISON1; + entry->prev = LIST_POISON2; +} + +/** + * list_replace - replace old entry by new one + * @old : the element to be replaced + * @new : the new element to insert + * + * If @old was empty, it will be overwritten. + */ +static inline void list_replace(struct list_head *old, + struct list_head *new) +{ + new->next = old->next; + new->next->prev = new; + new->prev = old->prev; + new->prev->next = new; +} + +static inline void list_replace_init(struct list_head *old, + struct list_head *new) +{ + list_replace(old, new); + INIT_LIST_HEAD(old); +} + +/** + * list_del_init - deletes entry from list and reinitialize it. + * @entry: the element to delete from the list. + */ +static inline void list_del_init(struct list_head *entry) +{ + __list_del(entry->prev, entry->next); + INIT_LIST_HEAD(entry); +} + +/** + * list_move - delete from one list and add as another's head + * @list: the entry to move + * @head: the head that will precede our entry + */ +static inline void list_move(struct list_head *list, struct list_head *head) +{ + __list_del(list->prev, list->next); + list_add(list, head); +} + +/** + * list_move_tail - delete from one list and add as another's tail + * @list: the entry to move + * @head: the head that will follow our entry + */ +static inline void list_move_tail(struct list_head *list, + struct list_head *head) +{ + __list_del(list->prev, list->next); + list_add_tail(list, head); +} + +/** + * list_is_last - tests whether @list is the last entry in list @head + * @list: the entry to test + * @head: the head of the list + */ +static inline int list_is_last(const struct list_head *list, + const struct list_head *head) +{ + return list->next == head; +} + +/** + * list_empty - tests whether a list is empty + * @head: the list to test. + */ +static inline int list_empty(const struct list_head *head) +{ + return head->next == head; +} + +/** + * list_empty_careful - tests whether a list is empty and not being modified + * @head: the list to test + * + * Description: + * tests whether a list is empty _and_ checks that no other CPU might be + * in the process of modifying either member (next or prev) + * + * NOTE: using list_empty_careful() without synchronization + * can only be safe if the only activity that can happen + * to the list entry is list_del_init(). Eg. it cannot be used + * if another CPU could re-list_add() it. + */ +static inline int list_empty_careful(const struct list_head *head) +{ + struct list_head *next = head->next; + return (next == head) && (next == head->prev); +} + +/** + * list_is_singular - tests whether a list has just one entry. + * @head: the list to test. + */ +static inline int list_is_singular(const struct list_head *head) +{ + return !list_empty(head) && (head->next == head->prev); +} + +static inline void __list_cut_position(struct list_head *list, + struct list_head *head, struct list_head *entry) +{ + struct list_head *new_first = entry->next; + list->next = head->next; + list->next->prev = list; + list->prev = entry; + entry->next = list; + head->next = new_first; + new_first->prev = head; +} + +/** + * list_cut_position - cut a list into two + * @list: a new list to add all removed entries + * @head: a list with entries + * @entry: an entry within head, could be the head itself + * and if so we won't cut the list + * + * This helper moves the initial part of @head, up to and + * including @entry, from @head to @list. You should + * pass on @entry an element you know is on @head. @list + * should be an empty list or a list you do not care about + * losing its data. + * + */ +static inline void list_cut_position(struct list_head *list, + struct list_head *head, struct list_head *entry) +{ + if (list_empty(head)) + return; + if (list_is_singular(head) && + (head->next != entry && head != entry)) + return; + if (entry == head) + INIT_LIST_HEAD(list); + else + __list_cut_position(list, head, entry); +} + +static inline void __list_splice(const struct list_head *list, + struct list_head *prev, + struct list_head *next) +{ + struct list_head *first = list->next; + struct list_head *last = list->prev; + + first->prev = prev; + prev->next = first; + + last->next = next; + next->prev = last; +} + +/** + * list_splice - join two lists, this is designed for stacks + * @list: the new list to add. + * @head: the place to add it in the first list. + */ +static inline void list_splice(const struct list_head *list, + struct list_head *head) +{ + if (!list_empty(list)) + __list_splice(list, head, head->next); +} + +/** + * list_splice_tail - join two lists, each list being a queue + * @list: the new list to add. + * @head: the place to add it in the first list. + */ +static inline void list_splice_tail(struct list_head *list, + struct list_head *head) +{ + if (!list_empty(list)) + __list_splice(list, head->prev, head); +} + +/** + * list_splice_init - join two lists and reinitialise the emptied list. + * @list: the new list to add. + * @head: the place to add it in the first list. + * + * The list at @list is reinitialised + */ +static inline void list_splice_init(struct list_head *list, + struct list_head *head) +{ + if (!list_empty(list)) { + __list_splice(list, head, head->next); + INIT_LIST_HEAD(list); + } +} + +/** + * list_splice_tail_init - join two lists and reinitialise the emptied list + * @list: the new list to add. + * @head: the place to add it in the first list. + * + * Each of the lists is a queue. + * The list at @list is reinitialised + */ +static inline void list_splice_tail_init(struct list_head *list, + struct list_head *head) +{ + if (!list_empty(list)) { + __list_splice(list, head->prev, head); + INIT_LIST_HEAD(list); + } +} + +/** + * list_entry - get the struct for this entry + * @ptr: the &struct list_head pointer. + * @type: the type of the struct this is embedded in. + * @member: the name of the list_struct within the struct. + */ +#define list_entry(ptr, type, member) \ + container_of(ptr, type, member) + +/** + * list_first_entry - get the first element from a list + * @ptr: the list head to take the element from. + * @type: the type of the struct this is embedded in. + * @member: the name of the list_struct within the struct. + * + * Note, that list is expected to be not empty. + */ +#define list_first_entry(ptr, type, member) \ + list_entry((ptr)->next, type, member) + +/** + * list_for_each - iterate over a list + * @pos: the &struct list_head to use as a loop cursor. + * @head: the head for your list. + */ +#define list_for_each(pos, head) \ + for (pos = (head)->next; prefetch(pos->next), pos != (head); \ + pos = pos->next) + +/** + * __list_for_each - iterate over a list + * @pos: the &struct list_head to use as a loop cursor. + * @head: the head for your list. + * + * This variant differs from list_for_each() in that it's the + * simplest possible list iteration code, no prefetching is done. + * Use this for code that knows the list to be very short (empty + * or 1 entry) most of the time. + */ +#define __list_for_each(pos, head) \ + for (pos = (head)->next; pos != (head); pos = pos->next) + +/** + * list_for_each_prev - iterate over a list backwards + * @pos: the &struct list_head to use as a loop cursor. + * @head: the head for your list. + */ +#define list_for_each_prev(pos, head) \ + for (pos = (head)->prev; prefetch(pos->prev), pos != (head); \ + pos = pos->prev) + +/** + * list_for_each_safe - iterate over a list safe against removal of list entry + * @pos: the &struct list_head to use as a loop cursor. + * @n: another &struct list_head to use as temporary storage + * @head: the head for your list. + */ +#define list_for_each_safe(pos, n, head) \ + for (pos = (head)->next, n = pos->next; pos != (head); \ + pos = n, n = pos->next) + +/** + * list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry + * @pos: the &struct list_head to use as a loop cursor. + * @n: another &struct list_head to use as temporary storage + * @head: the head for your list. + */ +#define list_for_each_prev_safe(pos, n, head) \ + for (pos = (head)->prev, n = pos->prev; \ + prefetch(pos->prev), pos != (head); \ + pos = n, n = pos->prev) + +/** + * list_for_each_entry - iterate over list of given type + * @pos: the type * to use as a loop cursor. + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + */ +#define list_for_each_entry(pos, head, member) \ + for (pos = list_entry((head)->next, typeof(*pos), member); \ + prefetch(pos->member.next), &pos->member != (head); \ + pos = list_entry(pos->member.next, typeof(*pos), member)) + +/** + * list_for_each_entry_reverse - iterate backwards over list of given type. + * @pos: the type * to use as a loop cursor. + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + */ +#define list_for_each_entry_reverse(pos, head, member) \ + for (pos = list_entry((head)->prev, typeof(*pos), member); \ + prefetch(pos->member.prev), &pos->member != (head); \ + pos = list_entry(pos->member.prev, typeof(*pos), member)) + +/** + * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue() + * @pos: the type * to use as a start point + * @head: the head of the list + * @member: the name of the list_struct within the struct. + * + * Prepares a pos entry for use as a start point in list_for_each_entry_continue(). + */ +#define list_prepare_entry(pos, head, member) \ + ((pos) ? : list_entry(head, typeof(*pos), member)) + +/** + * list_for_each_entry_continue - continue iteration over list of given type + * @pos: the type * to use as a loop cursor. + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + * + * Continue to iterate over list of given type, continuing after + * the current position. + */ +#define list_for_each_entry_continue(pos, head, member) \ + for (pos = list_entry(pos->member.next, typeof(*pos), member); \ + prefetch(pos->member.next), &pos->member != (head); \ + pos = list_entry(pos->member.next, typeof(*pos), member)) + +/** + * list_for_each_entry_continue_reverse - iterate backwards from the given point + * @pos: the type * to use as a loop cursor. + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + * + * Start to iterate over list of given type backwards, continuing after + * the current position. + */ +#define list_for_each_entry_continue_reverse(pos, head, member) \ + for (pos = list_entry(pos->member.prev, typeof(*pos), member); \ + prefetch(pos->member.prev), &pos->member != (head); \ + pos = list_entry(pos->member.prev, typeof(*pos), member)) + +/** + * list_for_each_entry_from - iterate over list of given type from the current point + * @pos: the type * to use as a loop cursor. + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + * + * Iterate over list of given type, continuing from current position. + */ +#define list_for_each_entry_from(pos, head, member) \ + for (; prefetch(pos->member.next), &pos->member != (head); \ + pos = list_entry(pos->member.next, typeof(*pos), member)) + +/** + * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry + * @pos: the type * to use as a loop cursor. + * @n: another type * to use as temporary storage + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + */ +#define list_for_each_entry_safe(pos, n, head, member) \ + for (pos = list_entry((head)->next, typeof(*pos), member), \ + n = list_entry(pos->member.next, typeof(*pos), member); \ + &pos->member != (head); \ + pos = n, n = list_entry(n->member.next, typeof(*n), member)) + +/** + * list_for_each_entry_safe_continue + * @pos: the type * to use as a loop cursor. + * @n: another type * to use as temporary storage + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + * + * Iterate over list of given type, continuing after current point, + * safe against removal of list entry. + */ +#define list_for_each_entry_safe_continue(pos, n, head, member) \ + for (pos = list_entry(pos->member.next, typeof(*pos), member), \ + n = list_entry(pos->member.next, typeof(*pos), member); \ + &pos->member != (head); \ + pos = n, n = list_entry(n->member.next, typeof(*n), member)) + +/** + * list_for_each_entry_safe_from + * @pos: the type * to use as a loop cursor. + * @n: another type * to use as temporary storage + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + * + * Iterate over list of given type from current point, safe against + * removal of list entry. + */ +#define list_for_each_entry_safe_from(pos, n, head, member) \ + for (n = list_entry(pos->member.next, typeof(*pos), member); \ + &pos->member != (head); \ + pos = n, n = list_entry(n->member.next, typeof(*n), member)) + +/** + * list_for_each_entry_safe_reverse + * @pos: the type * to use as a loop cursor. + * @n: another type * to use as temporary storage + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + * + * Iterate backwards over list of given type, safe against removal + * of list entry. + */ +#define list_for_each_entry_safe_reverse(pos, n, head, member) \ + for (pos = list_entry((head)->prev, typeof(*pos), member), \ + n = list_entry(pos->member.prev, typeof(*pos), member); \ + &pos->member != (head); \ + pos = n, n = list_entry(n->member.prev, typeof(*n), member)) + +/* + * Double linked lists with a single pointer list head. + * Mostly useful for hash tables where the two pointer list head is + * too wasteful. + * You lose the ability to access the tail in O(1). + */ + +struct hlist_head { + struct hlist_node *first; +}; + +struct hlist_node { + struct hlist_node *next, **pprev; +}; + +#define HLIST_HEAD_INIT { .first = NULL } +#define HLIST_HEAD(name) struct hlist_head name = { .first = NULL } +#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) +static inline void INIT_HLIST_NODE(struct hlist_node *h) +{ + h->next = NULL; + h->pprev = NULL; +} + +static inline int hlist_unhashed(const struct hlist_node *h) +{ + return !h->pprev; +} + +static inline int hlist_empty(const struct hlist_head *h) +{ + return !h->first; +} + +static inline void __hlist_del(struct hlist_node *n) +{ + struct hlist_node *next = n->next; + struct hlist_node **pprev = n->pprev; + *pprev = next; + if (next) + next->pprev = pprev; +} + +static inline void hlist_del(struct hlist_node *n) +{ + __hlist_del(n); + n->next = LIST_POISON1; + n->pprev = LIST_POISON2; +} + +static inline void hlist_del_init(struct hlist_node *n) +{ + if (!hlist_unhashed(n)) { + __hlist_del(n); + INIT_HLIST_NODE(n); + } +} + +static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h) +{ + struct hlist_node *first = h->first; + n->next = first; + if (first) + first->pprev = &n->next; + h->first = n; + n->pprev = &h->first; +} + +/* next must be != NULL */ +static inline void hlist_add_before(struct hlist_node *n, + struct hlist_node *next) +{ + n->pprev = next->pprev; + n->next = next; + next->pprev = &n->next; + *(n->pprev) = n; +} + +static inline void hlist_add_after(struct hlist_node *n, + struct hlist_node *next) +{ + next->next = n->next; + n->next = next; + next->pprev = &n->next; + + if(next->next) + next->next->pprev = &next->next; +} + +#define hlist_entry(ptr, type, member) container_of(ptr,type,member) + +#define hlist_for_each(pos, head) \ + for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \ + pos = pos->next) + +#define hlist_for_each_safe(pos, n, head) \ + for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \ + pos = n) + +/** + * hlist_for_each_entry - iterate over list of given type + * @tpos: the type * to use as a loop cursor. + * @pos: the &struct hlist_node to use as a loop cursor. + * @head: the head for your list. + * @member: the name of the hlist_node within the struct. + */ +#define hlist_for_each_entry(tpos, pos, head, member) \ + for (pos = (head)->first; \ + pos && ({ prefetch(pos->next); 1;}) && \ + ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ + pos = pos->next) + +/** + * hlist_for_each_entry_continue - iterate over a hlist continuing after current point + * @tpos: the type * to use as a loop cursor. + * @pos: the &struct hlist_node to use as a loop cursor. + * @member: the name of the hlist_node within the struct. + */ +#define hlist_for_each_entry_continue(tpos, pos, member) \ + for (pos = (pos)->next; \ + pos && ({ prefetch(pos->next); 1;}) && \ + ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ + pos = pos->next) + +/** + * hlist_for_each_entry_from - iterate over a hlist continuing from current point + * @tpos: the type * to use as a loop cursor. + * @pos: the &struct hlist_node to use as a loop cursor. + * @member: the name of the hlist_node within the struct. + */ +#define hlist_for_each_entry_from(tpos, pos, member) \ + for (; pos && ({ prefetch(pos->next); 1;}) && \ + ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ + pos = pos->next) + +/** + * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry + * @tpos: the type * to use as a loop cursor. + * @pos: the &struct hlist_node to use as a loop cursor. + * @n: another &struct hlist_node to use as temporary storage + * @head: the head for your list. + * @member: the name of the hlist_node within the struct. + */ +#define hlist_for_each_entry_safe(tpos, pos, n, head, member) \ + for (pos = (head)->first; \ + pos && ({ n = pos->next; 1; }) && \ + ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ + pos = n) + + +#endif + + diff --git a/proj1_mqttd/lylib/logger.c b/proj1_mqttd/lylib/logger.c new file mode 100644 index 0000000..f9accc4 --- /dev/null +++ b/proj1_mqttd/lylib/logger.c @@ -0,0 +1,364 @@ +/********************************************************************************* + * Copyright: (C) 2018 LingYun IoT System Studio + * All rights reserved. + * + * Filename: logger.c + * Description: This file is the linux infrastructural logger system library, which + * is not thread safe. + * + * Version: 1.0.0(08/08/2012~) + * Author: Guo Wenxue <guowenxue@gmail.com> + * ChangeLog: 1, Release initial version on "08/08/2018 04:24:01 PM" + * + ********************************************************************************/ + +#include "logger.h" + +#define PRECISE_TIME_FACTOR 1000 + +static unsigned long log_rollback_size = LOG_ROLLBACK_NONE; + +static st_logger _g_logger; +static st_logger *g_logger = &_g_logger; + +char *log_str[LOG_LEVEL_MAX + 1] = { "", "F", "E", "W", "N", "D", "I", "T", "M" }; + +static char *log_time_format = "%Y-%m-%d %H:%M:%S"; + +static void logger_default_signal_handler(int sig) +{ + if (sig == SIGHUP) + { + signal(SIGHUP, logger_default_signal_handler); + log_fatal("SIGHUP received - reopenning log file [%s]", g_logger->file); + logger_reopen(); + } +} + +static void logger_banner(char *prefix) +{ + fprintf(g_logger->fp, "%s log \"%s\" on level [%s] size [%lu], log system version %s\n", + prefix, g_logger->file, log_str[g_logger->level], log_rollback_size / 1024, LOG_VERSION_STR); +#if 0 +#ifdef LOG_FILE_LINE + fprintf(g_logger->fp, " [Date] [Time] [Level] [PID/TID] [File/Line] [Content]\n"); +#else + fprintf(g_logger->fp, " [Date] [Time] [Level] [PID/TID] [Content]\n"); +#endif +#endif + fprintf(g_logger->fp, "-----------------------------------------------------------------------------\n"); +} + +static void check_and_rollback(void) +{ + if (log_rollback_size != LOG_ROLLBACK_NONE) + { + long _curOffset = ftell(g_logger->fp); + + if ((_curOffset != -1) && (_curOffset >= log_rollback_size)) + { + char cmd[512]; + + snprintf(cmd, sizeof(cmd), "cp -f %s %s.roll", g_logger->file, g_logger->file); + system(cmd); + + if (-1 == fseek(g_logger->fp, 0L, SEEK_SET)) + fprintf(g_logger->fp, "log rollback fseek failed \n"); + + rewind(g_logger->fp); + + truncate(g_logger->file, 0); + logger_banner("Already rollback"); + } + } +} + +int logger_init(char *filename, int level, int log_size) +{ + struct sigaction act; + + if( !filename || strlen(filename)<=0 ) + { + fprintf(stderr, "%s() invalid input arguments\n", __FUNCTION__); + return -1; + } + + memset(g_logger, 0, sizeof(st_logger)); + + strncpy(g_logger->file, filename, FILENAME_LEN); + g_logger->level = level; + g_logger->size = log_size; + + log_rollback_size = g_logger->size <= 0 ? LOG_ROLLBACK_NONE : g_logger->size*1024; /* Unit KiB */ + + + /* logger to console, just need point to standard error */ + if (!strcmp(g_logger->file, DBG_LOG_FILE)) + { + g_logger->fp = stderr; + log_rollback_size = LOG_ROLLBACK_NONE; + g_logger->flag |= LOGGER_CONSOLE; + goto OUT; + } + + g_logger->fp = fopen(g_logger->file, "a+"); + if ( !g_logger->fp ) + { + fprintf(stderr, "Open log file \"%s\" failure\n", g_logger->file); + return -2; + } + +OUT: + act.sa_handler = logger_default_signal_handler; + sigemptyset(&act.sa_mask); + act.sa_flags = 0; + sigaction(SIGHUP, &act, NULL); + + logger_banner("\nInitialize"); + + return 0; +} + +void logger_raw(const char *fmt, ...) +{ + va_list argp; + + if ( !g_logger->fp ) + return; + + check_and_rollback(); + + va_start(argp, fmt); + vfprintf(g_logger->fp, fmt, argp); + va_end(argp); +} + + +void logger_term(void) +{ + if ( !g_logger->fp ) + return; + + logger_banner("\nTerminate"); + logger_raw("\n\n"); + + fflush(g_logger->fp); + + fclose(g_logger->fp); + g_logger->fp = NULL; + + memset(g_logger, 0, sizeof(*g_logger)); + + return ; +} + + +int logger_reopen(void) +{ + int rc = 0; + + if (g_logger->flag & LOGGER_CONSOLE ) + { + fflush(g_logger->fp); + g_logger->fp = stderr; + return 0; + } + + if( g_logger->fp ) + { + logger_banner("\nClose"); + fflush(g_logger->fp); + + g_logger->fp = fopen(g_logger->file, "a+"); + + if ( !g_logger->fp ) + rc = -2; + } + else + { + rc = -3; + } + + if (!rc) + { + logger_banner("\nReopen"); + } + return rc; +} + +static void logger_printout(char *level, char *fmt, va_list argp) +{ + char buf[MAX_LOG_MESSAGE_LEN]; + struct tm *local; + struct timeval now; + char timestr[256]; + + pthread_t tid; + + check_and_rollback(); + +#ifdef MULTHREADS + tid = pthread_self(); +#else + tid = getpid(); +#endif + + gettimeofday(&now, NULL); + local = localtime(&now.tv_sec); + + strftime(timestr, 256, log_time_format, local); + vsnprintf(buf, MAX_LOG_MESSAGE_LEN, fmt, argp); + +#ifdef DUMPLICATE_OUTPUT + printf("%s.%03ld [%s] [%06lu]: %s", + timestr, now.tv_usec / PRECISE_TIME_FACTOR, level, tid, buf); +#endif + + if (g_logger->fp) + fprintf(g_logger->fp, "%s.%03ld [%s] [%06lu]: %s", timestr, now.tv_usec / PRECISE_TIME_FACTOR, + level, tid, buf); + + if (g_logger->fp) + fflush(g_logger->fp); +} + +static void logger_printout_line(char *level, char *fmt, char *file, int line, va_list argp) +{ + char buf[MAX_LOG_MESSAGE_LEN]; + struct tm *local; + struct timeval now; + char timestr[256]; + + pthread_t tid; + + check_and_rollback(); + +#ifdef MULTHREADS + tid = pthread_self(); +#else + tid = getpid(); +#endif + + gettimeofday(&now, NULL); + local = localtime(&now.tv_sec); + + strftime(timestr, 256, log_time_format, local); + vsnprintf(buf, MAX_LOG_MESSAGE_LEN, fmt, argp); + +#ifdef DUMPLICATE_OUTPUT + printf("%s.%03ld [%s] [%06lu] (%s [%04d]) : %s", + timestr, now.tv_usec / PRECISE_TIME_FACTOR, level, tid, file, line, buf); +#endif + + if (g_logger->fp) + fprintf(g_logger->fp, "%s.%03ld [%s] [%06lu] (%s [%04d]) : %s", + timestr, now.tv_usec / PRECISE_TIME_FACTOR, level, tid, file, line, buf); + + if (g_logger->fp) + fflush(g_logger->fp); +} + +void logger_comm(int level, char *fmt, ...) +{ + va_list argp; + + if ( level > g_logger->level ) + return; + + va_start(argp, fmt); + logger_printout(log_str[level], fmt, argp); + va_end(argp); +} + +void logger_line(int level, char *file, int line, char *fmt, ...) +{ + va_list argp; + + if ( level > g_logger->level ) + return; + + va_start(argp, fmt); + logger_printout_line(log_str[level], fmt, file, line, argp); + + va_end(argp); +} + +#define LINELEN 81 +#define CHARS_PER_LINE 16 +static char *print_char = + " " + " " + " !\"#$%&'()*+,-./" + "0123456789:;<=>?" + "@ABCDEFGHIJKLMNO" + "PQRSTUVWXYZ[\\]^_" + "`abcdefghijklmno" + "pqrstuvwxyz{|}~ " + " " + " " + " ???????????????" + "????????????????" + "????????????????" + "????????????????" + "????????????????" + "????????????????"; + +void logger_dump(int level, char *buf, int len) +{ + int rc; + int idx; + char prn[LINELEN]; + char lit[CHARS_PER_LINE + 2]; + char hc[4]; + short line_done = 1; + + if ( level > g_logger->level ) + return; + + rc = len; + idx = 0; + lit[CHARS_PER_LINE] = '\0'; + + while (rc > 0) + { + if (line_done) + snprintf(prn, LINELEN, "%08X: ", idx); + + do + { + unsigned char c = buf[idx]; + snprintf(hc, 4, "%02X ", c); + strncat(prn, hc, LINELEN); + + lit[idx % CHARS_PER_LINE] = print_char[c]; + } + while (--rc > 0 && (++idx % CHARS_PER_LINE != 0)); + + line_done = (idx % CHARS_PER_LINE) == 0; + if (line_done) + { +#ifdef DUMPLICATE_OUTPUT + printf("%s %s\n", prn, lit); +#endif + if (g_logger->fp) + fprintf(g_logger->fp, "%s %s\n", prn, lit); + } + } + + if (!line_done) + { + int ldx = idx % CHARS_PER_LINE; + lit[ldx++] = print_char[(int)buf[idx]]; + lit[ldx] = '\0'; + + while ((++idx % CHARS_PER_LINE) != 0) + strncat(prn, " ", LINELEN); + +#ifdef DUMPLICATE_OUTPUT + printf("%s %s\n", prn, lit); +#endif + if (g_logger->fp) + fprintf(g_logger->fp, "%s %s\n", prn, lit); + + } +} diff --git a/proj1_mqttd/lylib/logger.h b/proj1_mqttd/lylib/logger.h new file mode 100644 index 0000000..f6ea63e --- /dev/null +++ b/proj1_mqttd/lylib/logger.h @@ -0,0 +1,104 @@ +/******************************************************************************** + * Copyright: (C) 2018 LingYun IoT System Studio + * All rights reserved. + * + * Filename: logger.h + * Description: This file is the linux infrastructural logger system library + * + * Version: 1.0.0(08/08/2018~) + * Author: Guo Wenxue <guowenxue@gmail.com> + * ChangeLog: 1, Release initial version on "08/08/2018 05:16:56 PM" + * + ********************************************************************************/ + +#ifndef __LOGGER_H_ +#define __LOGGER_H_ + +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <signal.h> +#include <time.h> +#include <errno.h> + +#include <pthread.h> +#include <sys/types.h> +#include <sys/time.h> + +#define LOG_VERSION_STR "2.0.0" + +#ifndef FILENAME_LEN +#define FILENAME_LEN 64 +#endif + +#define DEFAULT_LOGFILE "logger.log" +#define DBG_LOG_FILE "console" /* Debug mode log file is console */ + +#define LOG_ROLLBACK_SIZE 512 /* Default rollback log size */ +#define LOG_ROLLBACK_NONE 0 /* Set rollback size to 0 will not rollback */ + +#define MAX_LOG_MESSAGE_LEN 0x1000 + +//#define DUMPLICATE_OUTPUT /* Log to file and printf on console */ +#define LOG_FILE_LINE /* Log the file and line */ + +enum +{ + LOG_LEVEL_DISB = 0, /* Disable "Debug" */ + LOG_LEVEL_FATAL, /* Debug Level "Fatal" */ + LOG_LEVEL_ERROR, /* Debug Level "ERROR" */ + LOG_LEVEL_WARN, /* Debug Level "warnning" */ + LOG_LEVEL_NRML, /* Debug Level "Normal" */ + LOG_LEVEL_DEBUG, /* Debug Level "Debug" */ + LOG_LEVEL_INFO, /* Debug Level "Information" */ + LOG_LEVEL_TRACE, /* Debug Level "Trace" */ + LOG_LEVEL_MAX, +}; + +#define LOGGER_CONSOLE 1<<1 +#define LOGGER_FILE 0<<1 + +#define LOGGER_LEVEL_OPT 1<<2 /* The log level is sepcified by the command option */ +typedef struct _st_logger +{ + unsigned char flag; /* This logger pointer is malloc() or passed by argument */ + char file[FILENAME_LEN]; + int level; + int size; + + FILE *fp; +} st_logger; + + +extern int logger_init(char *filename, int level, int log_size); +extern int logger_reopen(void); + +extern void logger_term(void); + +extern void logger_comm(int level, char *fmt, ...); +extern void logger_line(int level, char *file, int line, char *fmt, ...); + +extern void logger_dump(int level, char *buf, int len); + +#ifdef LOG_FILE_LINE +#define log_trace(fmt, ...) logger_line(LOG_LEVEL_TRACE, __FILE__, __LINE__, fmt, ##__VA_ARGS__) +#define log_info(fmt, ...) logger_line(LOG_LEVEL_INFO, __FILE__, __LINE__, fmt, ##__VA_ARGS__) +#define log_dbg(fmt, ...) logger_line(LOG_LEVEL_DEBUG, __FILE__, __LINE__, fmt, ##__VA_ARGS__) +#define log_nrml(fmt, ...) logger_line(LOG_LEVEL_NRML, __FILE__, __LINE__, fmt, ##__VA_ARGS__) +#define log_warn(fmt, ...) logger_line(LOG_LEVEL_WARN, __FILE__, __LINE__, fmt, ##__VA_ARGS__) +#define log_err(fmt, ...) logger_line(LOG_LEVEL_ERROR, __FILE__, __LINE__, fmt, ##__VA_ARGS__) +#define log_fatal(fmt, ...) logger_line(LOG_LEVEL_FATAL, __FILE__, __LINE__, fmt, ##__VA_ARGS__) +#else +#define log_trace(fmt, ...) logger_comm(LOG_LEVEL_TRACE, fmt, ##__VA_ARGS__) +#define log_info(fmt, ...) logger_comm(tLOG_LEVEL_INFO, fmt, ##__VA_ARGS__) +#define log_dbg(fmt, ...) logger_comm(LOG_LEVEL_DEBUG, fmt, ##__VA_ARGS__) +#define log_nrml(fmt, ...) logger_comm(LOG_LEVEL_NRML, fmt, ##__VA_ARGS__) +#define log_warn(fmt, ...) logger_comm(LOG_LEVEL_WARN, fmt, ##__VA_ARGS__) +#define log_err(fmt, ...) logger_comm(LOG_LEVEL_ERROR, fmt, ##__VA_ARGS__) +#define log_fatal(fmt, ...) logger_comm(LOG_LEVEL_FATAL, fmt, ##__VA_ARGS__) +#endif + + +#endif /* __LOGGER_H_ */ diff --git a/proj1_mqttd/lylib/makefile b/proj1_mqttd/lylib/makefile new file mode 100644 index 0000000..2b5da3b --- /dev/null +++ b/proj1_mqttd/lylib/makefile @@ -0,0 +1,17 @@ + +PWD=$(shell pwd ) + +LIBNAME=$(shell basename ${PWD} ) +PROJPATH=$(shell dirname ${PWD} ) + +CFLAGS+=-I${PROJPATH} + +all: clean + @rm -f *.o + @${CROSS_COMPILE}gcc ${CFLAGS} -c *.c + ${CROSS_COMPILE}ar -rcs lib${LIBNAME}.a *.o + +clean: + @rm -f *.o + @rm -f *.a + diff --git a/proj1_mqttd/lylib/proc.c b/proj1_mqttd/lylib/proc.c new file mode 100644 index 0000000..62e9b5a --- /dev/null +++ b/proj1_mqttd/lylib/proc.c @@ -0,0 +1,341 @@ +/********************************************************************************* + * Copyright: (C) 2018 LingYun IoT System Studio + * All rights reserved. + * + * Filename: cp_proc.c + * Description: This file is the process API + * + * Version: 1.0.0(11/06/2018~) + * Author: Guo Wenxue <guowenxue@gmail.com> + * ChangeLog: 1, Release initial version on "11/06/2018 09:19:02 PM" + * + ********************************************************************************/ + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <libgen.h> +#include <fcntl.h> +#include <sys/types.h> +#include <sys/stat.h> + +#include "proc.h" +#include "logger.h" + +st_sigproc g_signal={0}; + +void proc_sighandler(int sig) +{ + switch(sig) + { + case SIGINT: + log_warn("SIGINT - stopping\n"); + g_signal.stop = 1; + break; + + case SIGTERM: + //log_warn("SIGTERM - stopping\n"); + g_signal.stop = 1; + break; +#if 0 + case SIGSEGV: + log_err("SIGSEGV - stopping\n"); + if(g_signal.stop) + exit(0); + + g_signal.stop = 1; + break; +#endif + + case SIGPIPE: + log_warn("SIGPIPE - warnning\n"); + g_signal.stop = 1; + break; + + default: + break; + } +} + + +void install_proc_signal(void) +{ + struct sigaction sigact, sigign; + + log_nrml("Install default signal handler.\n"); + + /* Initialize the catch signal structure. */ + sigemptyset(&sigact.sa_mask); + sigact.sa_flags = 0; + sigact.sa_handler = proc_sighandler; + + /* Setup the ignore signal. */ + sigemptyset(&sigign.sa_mask); + sigign.sa_flags = 0; + sigign.sa_handler = SIG_IGN; + + sigaction(SIGTERM, &sigact, 0); /* catch terminate signal "kill" command */ + sigaction(SIGINT, &sigact, 0); /* catch interrupt signal CTRL+C */ + //sigaction(SIGSEGV, &sigact, 0); /* catch segmentation faults */ + sigaction(SIGPIPE, &sigact, 0); /* catch broken pipe */ +#if 0 + sigaction(SIGCHLD, &sigact, 0); /* catch child process return */ + sigaction(SIGUSR2, &sigact, 0); /* catch USER signal */ +#endif +} + + +/* **************************************************************************** + * FunctionName: daemonize + * Description : Set the programe runs as daemon in background + * Inputs : nodir: DON'T change the work directory to / : 1:NoChange 0:Change + * noclose: close the opened file descrtipion or not 1:Noclose 0:Close + * Output : NONE + * Return : NONE + * *****************************************************************************/ +void daemonize(int nochdir, int noclose) +{ + int retval, fd; + int i; + + /* already a daemon */ + if (1 == getppid()) + return; + + /* fork error */ + retval = fork(); + if (retval < 0) exit(1); + + /* parent process exit */ + if (retval > 0) + exit(0); + + /* obtain a new process session group */ + setsid(); + + if (!noclose) + { + /* close all descriptors */ + for (i = getdtablesize(); i >= 0; --i) + { + //if (i != g_logPtr->fd) + close(i); + } + + /* Redirect Standard input [0] to /dev/null */ + fd = open("/dev/null", O_RDWR); + + /* Redirect Standard output [1] to /dev/null */ + dup(fd); + + /* Redirect Standard error [2] to /dev/null */ + dup(fd); + } + + umask(0); + + if (!nochdir) + chdir("/"); + + return; +} + +/* **************************************************************************** + * FunctionName: record_daemon_pid + * Description : Record the running daemon program PID to the file "pid_file" + * Inputs : pid_file:The record PID file path + * Output : NONE + * Return : 0: Record successfully Else: Failure + * *****************************************************************************/ +int record_daemon_pid(const char *pid_file) +{ + struct stat fStatBuf; + int fd = -1; + int mode = S_IROTH | S_IXOTH | S_IRGRP | S_IXGRP | S_IRWXU; + char ipc_dir[64] = { 0 }; + + strncpy(ipc_dir, pid_file, 64); + + /* dirname() will modify ipc_dir and save the result */ + dirname(ipc_dir); + + /* If folder pid_file PATH doesnot exist, then we will create it" */ + if (stat(ipc_dir, &fStatBuf) < 0) + { + if (mkdir(ipc_dir, mode) < 0) + { + log_fatal("cannot create %s: %s\n", ipc_dir, strerror(errno)); + return -1; + } + + (void)chmod(ipc_dir, mode); + } + + /* Create the process running PID file */ + mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; + if ((fd = open(pid_file, O_RDWR | O_CREAT | O_TRUNC, mode)) >= 0) + { + char pid[PID_ASCII_SIZE]; + snprintf(pid, sizeof(pid), "%u\n", (unsigned)getpid()); + write(fd, pid, strlen(pid)); + close(fd); + + log_dbg("Record PID<%u> to file %s.\n", getpid(), pid_file); + } + else + { + log_fatal("cannot create %s: %s\n", pid_file, strerror(errno)); + return -1; + } + + return 0; +} + +/* **************************************************************************** + * FunctionName: get_daemon_pid + * Description : Get the daemon process PID from the PID record file "pid_file" + * Inputs : pid_file: the PID record file + * Output : NONE + * Return : pid_t: The daemon process PID number + * *****************************************************************************/ +pid_t get_daemon_pid(const char *pid_file) +{ + FILE *f; + pid_t pid; + + if ((f = fopen(pid_file, "rb")) != NULL) + { + char pid_ascii[PID_ASCII_SIZE]; + (void)fgets(pid_ascii, PID_ASCII_SIZE, f); + (void)fclose(f); + pid = atoi(pid_ascii); + } + else + { + log_fatal("Can't open PID record file %s: %s\n", pid_file, strerror(errno)); + return -1; + } + return pid; +} + +/* **************************************************************************** + * FunctionName: check_daemon_running + * Description : Check the daemon program already running or not + * Inputs : pid_file: The record running daemon program PID + * Output : NONE + * Return : 1: The daemon program alread running 0: Not running + * *****************************************************************************/ +int check_daemon_running(const char *pid_file) +{ + int retVal = -1; + struct stat fStatBuf; + + retVal = stat(pid_file, &fStatBuf); + if (0 == retVal) + { + pid_t pid = -1; + printf("PID record file \"%s\" exist.\n", pid_file); + + pid = get_daemon_pid(pid_file); + if (pid > 0) /* Process pid exist */ + { + if ((retVal = kill(pid, 0)) == 0) + { + printf("Program with PID[%d] seems running.\n", pid); + return 1; + } + else /* Send signal to the old process get no reply. */ + { + printf("Program with PID[%d] seems exit.\n", pid); + remove(pid_file); + return 0; + } + } + else if (0 == pid) + { + printf("Can not read program PID form record file.\n"); + remove(pid_file); + return 0; + } + else /* Read pid from file "pid_file" failure */ + { + printf("Read record file \"%s\" failure, maybe program still running.\n", pid_file); + return 1; + } + } + + return 0; +} + +/* **************************************************************************** + * FunctionName: set_daemon_running + * Description : Set the programe running as daemon if it's not running and record + * its PID to the pid_file. + * Inputs : pid_file: The record running daemon program PID + * Output : NONE + * Return : 0: Successfully. 1: Failure + * *****************************************************************************/ +int set_daemon_running(const char *pid_file) +{ + daemonize(0, 1); + log_nrml("Program running as daemon [PID:%d].\n", getpid()); + + if (record_daemon_pid(pid_file) < 0) + { + log_fatal("Record PID to file \"%s\" failure.\n", pid_file); + return -2; + } + + return 0; +} + + +int thread_start(pthread_t * thread_id, thread_function* thread_workbody, void *thread_arg) +{ + int retval = 0; + + pthread_attr_t thread_attr; + + /* Initialize the thread attribute */ + retval = pthread_attr_init(&thread_attr); + if(retval) + return -1; + + /* Set the stack size of the thread */ + retval = pthread_attr_setstacksize(&thread_attr, 120 * 1024); + if(retval) + goto CleanUp; + + /* Set thread to detached state:Don`t need pthread_join */ + retval = pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED); + if(retval) + goto CleanUp; + + /* Create the thread */ + retval = pthread_create(thread_id, &thread_attr, thread_workbody, thread_arg); + if(retval) + goto CleanUp; + +CleanUp: + /* Destroy the attributes of thread */ + pthread_attr_destroy(&thread_attr); + return retval; +} + + +void exec_system_cmd(const char *format, ...) +{ + char cmd[256]; + va_list args; + int done; + + memset(cmd, 0, sizeof(cmd)); + + va_start(args, format); + done = vsnprintf(cmd, sizeof(cmd), format, args); + va_end(args); + + system(cmd); +} + + diff --git a/proj1_mqttd/lylib/proc.h b/proj1_mqttd/lylib/proc.h new file mode 100644 index 0000000..3892c03 --- /dev/null +++ b/proj1_mqttd/lylib/proc.h @@ -0,0 +1,52 @@ +/******************************************************************************** + * Copyright: (C) 2018 LingYun IoT System Studio + * All rights reserved. + * + * Filename: proc.h + * Description: This head file is for Linux process API + * + * Version: 1.0.0(11/06/2018~) + * Author: Guo Wenxue <guowenxue@gmail.com> + * ChangeLog: 1, Release initial version on "11/06/2018 09:21:33 PM" + * + ********************************************************************************/ + +#ifndef __CP_PROC_H +#define __CP_PROC_H + +#include <signal.h> + +#define PID_ASCII_SIZE 11 + +typedef struct _st_sigproc +{ + int signal; + unsigned stop; /* 0: Not term 1: Stop */ +} st_sigproc; + + +/* global variable for process or thread to exit */ +extern st_sigproc g_signal; + +/* install signal handler */ +extern void install_proc_signal(void); + +/* record process PID into $pid_file for check_daemon_running() to check program running or not */ +extern int record_daemon_pid(const char *pid_file); + +/* check program already running or not + * 1: The daemon program alread running 0: Not running + */ +extern int check_daemon_running(const char *pid_file); + +/* set program running as daemon */ +extern int set_daemon_running(const char *pid_file); + +/* create a system command and excute it */ +extern void exec_system_cmd(const char *format, ...); + +/* create and start a thread to excute function pointed by $thread_workbody */ +typedef void *(thread_function) (void *thread_arg); +extern int thread_start(pthread_t * thread_id, thread_function * thread_workbody, void *thread_arg); + +#endif diff --git a/proj1_mqttd/main.c b/proj1_mqttd/main.c new file mode 100644 index 0000000..4311727 --- /dev/null +++ b/proj1_mqttd/main.c @@ -0,0 +1,304 @@ +/********************************************************************************* + * Copyright: (C) 2019 LingYun IoT System Studio + * All rights reserved. + * + * Filename: main.c + * Description: This file + * + * Version: 1.0.0(29/01/19) + * Author: Guo Wenxue <guowenxue@gmail.com> + * ChangeLog: 1, Release initial version on "29/01/19 15:34:41" + * + ********************************************************************************/ +#include <stdio.h> +#include <time.h> +#include <unistd.h> +#include <getopt.h> +#include <libgen.h> +#include <string.h> + +#include <mosquitto.h> + +#include "logger.h" +#include "cJSON.h" +#include "proc.h" + +#include "conf.h" + +#define PROG_VERSION "v1.0.0" +#define DAEMON_PIDFILE "/tmp/.mqtt.pid" + +int check_set_program_running(int daemon); +void *mqtt_sub_worker(void *args); + +static void program_usage(char *progname) +{ + + printf("Usage: %s [OPTION]...\n", progname); + printf(" %s is LingYun studio MQTT daemon program running on RaspberryPi\n", progname); + + printf("\nMandatory arguments to long options are mandatory for short options too:\n"); + printf(" -d[debug ] Running in debug mode\n"); + printf(" -c[conf ] Specify configure file\n"); + printf(" -h[help ] Display this help information\n"); + printf(" -v[version ] Display the program version\n"); + + printf("\n%s version %s\n", progname, PROG_VERSION); + return; +} + + +int main (int argc, char **argv) +{ + float temp; + float rh; + int daemon = 1; + pthread_t tid; + mqtt_ctx_t ctx; + char *conf_file=NULL; + int debug = 0; + int opt; + char *progname=NULL; + + struct option long_options[] = { + {"conf", required_argument, NULL, 'c'}, + {"debug", no_argument, NULL, 'd'}, + {"version", no_argument, NULL, 'v'}, + {"help", no_argument, NULL, 'h'}, + {NULL, 0, NULL, 0} + }; + + progname = (char *)basename(argv[0]); + + /* Parser the command line parameters */ + while ((opt = getopt_long(argc, argv, "c:dvh", long_options, NULL)) != -1) + { + switch (opt) + { + case 'c': /* Set configure file */ + conf_file = optarg; + break; + + case 'd': /* Set debug running */ + daemon = 0; + debug = 1; + break; + + case 'v': /* Get software version */ + printf("%s version %s\n", progname, PROG_VERSION); + return 0; + + case 'h': /* Get help information */ + program_usage(progname); + return 0; + + default: + break; + } + + } + + if( !conf_file ) + debug = 1; + + if( mqttd_parser_conf(conf_file, &ctx, debug)<0 ) + { + fprintf(stderr, "Parser mqtted configure file failure\n"); + return -2; + } + + install_proc_signal(); + + if( check_set_program_running(daemon) < 0 ) + goto OUT; + + if( !debug ) + + mosquitto_lib_init(); + + if( thread_start(&tid, mqtt_sub_worker, &ctx ) < 0 ) + { + log_fatal("Start MQTT subsciber worker thread failure\n"); + goto OUT; + } + log_nrml("Start MQTT subsciber worker thread ok\n"); + + while( ! g_signal.stop ) + { + sleep(1); + //log_nrml("Main control thread continue running\n"); + } + + +OUT: + mosquitto_lib_cleanup(); + logger_term(); + + return 0; +} /* ----- End of main() ----- */ + + +int check_set_program_running(int daemon) +{ + if( check_daemon_running(DAEMON_PIDFILE) ) + { + log_err("Program already running, process exit now"); + return -1; + } + + if( daemon ) + { + if( set_daemon_running(DAEMON_PIDFILE) < 0 ) + { + log_err("set program running as daemon failure\n"); + return -2; + } + } + else + { + if( record_daemon_pid(DAEMON_PIDFILE) < 0 ) + { + log_err("record program running PID failure\n"); + return -3; + } + } + + return 0; +} + + +void sub_connect_callback(struct mosquitto *mosq, void *userdata, int result) +{ + mqtt_ctx_t *ctx = (mqtt_ctx_t *)userdata; + + if( result ) + { + log_err("Subscriber connect to broker server failed, rv=%d\n", result); + return ; + } + + log_nrml("Subscriber connect to broker server[%s:%d] successfully\n", ctx->host, ctx->port); + mosquitto_subscribe(mosq, NULL, ctx->subTopic, ctx->subQos); +} + +void sub_disconnect_callback(struct mosquitto *mosq, void *userdata, int result) +{ + mqtt_ctx_t *ctx = (mqtt_ctx_t *)userdata; + + log_warn("Subscriber disconnect to broker server[%s:%d], reason=%d\n", ctx->host, ctx->port, result); +} + + +void proc_json_items(cJSON *root) +{ + int i; + char *value; + cJSON *item; + cJSON *array; + + if( !root ) + { + log_err("Invalid input arguments $root\n"); + return ; + } + + for( i=0; i<cJSON_GetArraySize(root); i++ ) + { + item = cJSON_GetArrayItem(root, i); + if( !item ) + break; + + /* if item is cJSON_Object, then recursive call proc_json */ + if( cJSON_Object == item->type ) + { + proc_json_items(item); + } + else if( cJSON_Array == item->type ) + { + /* Logic C920 camera control */ + if( !strcasecmp(item->string, "camera") ) + { + array = cJSON_GetArrayItem(item, 0); + if( NULL != array ) + { + cJSON *led_item; + + if( NULL != (led_item=cJSON_GetObjectItem(array , "C920")) ) + { + log_nrml("turn Logic C920 camera '%s'\n", led_item->valuestring); + } + } + } + } + } + +} + +void sub_message_callback(struct mosquitto *mosq, void *userdata, const struct mosquitto_message *message) +{ + cJSON *root = NULL; + char *out; + + + if ( !message->payloadlen ) + { + log_err("%s (null)\n", message->topic); + return ; + } + + log_nrml("Subscriber receive message: '%s'\n", message->payload); + + root = cJSON_Parse(message->payload); + if( !root ) + { + log_err("cJSON_Parse parser failure: %s\n", cJSON_GetErrorPtr()); + return ; + } + + proc_json_items(root); + + cJSON_Delete(root); /* must delete it, or it will result memory leak */ + return ; +} + + +void *mqtt_sub_worker(void *args) +{ + mqtt_ctx_t *ctx = (mqtt_ctx_t *)args; + struct mosquitto *mosq; + bool session = true; + + mosq = mosquitto_new(NULL, session, ctx); + if( !mosq ) + { + log_err("mosquitto_new failure\n"); + return NULL; + } + + /* set connnect to broker username and password */ + if( strlen(ctx->uid)> 0 && strlen(ctx->pwd)> 0 ) + mosquitto_username_pw_set(mosq, ctx->uid, ctx->pwd); + + /* set callback functions */ + mosquitto_connect_callback_set(mosq, sub_connect_callback); + mosquitto_disconnect_callback_set(mosq, sub_disconnect_callback); + mosquitto_message_callback_set(mosq, sub_message_callback); + + while( !g_signal.stop ) + { + /* connect to MQTT broker */ + if( mosquitto_connect(mosq, ctx->host, ctx->port, ctx->keepalive) ) + { + log_err("Subscriber connect to broker[%s:%d] failure: %s\n", ctx->host, ctx->port, strerror(errno)); + sleep(1); + continue; + } + + /* -1: use default timeout 1000ms 1: unused */ + mosquitto_loop_forever(mosq, -1, 1); + } + + mosquitto_destroy(mosq); + return NULL; +} + diff --git a/proj1_mqttd/makefile b/proj1_mqttd/makefile new file mode 100644 index 0000000..92b9c2e --- /dev/null +++ b/proj1_mqttd/makefile @@ -0,0 +1,73 @@ +#********************************************************************************* +# Copyright: (C) 2012 Guo Wenxue<Email:guowenxue@gmail.com QQ:281143292> +# All rights reserved. +# +# Filename: Makefile +# Description: This Makefile used to compile all the C source code file in current +# folder to one excutable binary files. +# +# Version: 1.0.0(10/08/2011~) +# Author: Guo Wenxue <guowenxue@gmail.com> +# ChangeLog: 1, Release initial version on "11/11/2011 01:29:33 PM" +# +#********************************************************************************/ + +IMAGE_NAME=mqttd + +PWD=$(shell pwd) +INSTPATH=/usr/bin + +CFLAGS+=-I${PWD} +#CFLAGS+=-Wall -Werror + +MQTT_LIBPATH=mosquitto + +LDFLAGS+=-lwiringPi +LDFLAGS+=-lpthread + +VPATH= . +SRCS = $(wildcard ${VPATH}/*.c) +OBJS = $(patsubst %.c,%.o,$(SRCS)) + +CFLAGS+=-Ietc -Ilylib +LDFLAGS+=-Letc -letc -Llylib -llylib + +LDFLAGS+=-lmosquitto -lpthread -lm + +SRCFILES = $(wildcard *.c) + +all: entry modules binary +entry: + @echo " "; + @echo " ========================================================="; + @echo " ** Compile \"${BINARIES}\" for ${ARCH} "; + @echo " ========================================================="; + +modules: + make -C lylib + make -C etc + cd ${MQTT_LIBPATH} && bash build.sh + +binary: ${SRCFILES} + $(CC) $(CFLAGS) -o ${IMAGE_NAME} $^ ${LDFLAGS} + @echo " Compile over" + +tag: + @ctags --c-kinds=+defglmnstuvx --langmap=c:.c.h.ho.hem.het.hec.hev.him.hit.hic.hiv -R . + @cscope -Rbq + +install: + @cp $(IMAGE_NAME) ${INSTPATH} + +clean: + @make clean -C etc + @make clean -C lylib + @rm -f version.h + @rm -f *.o $(IMAGE_NAME) + @rm -rf *.gdb *.a *.so *.elf* + +distclean: clean + @rm -f tags cscope* + +.PHONY: clean entry + diff --git a/proj1_mqttd/mosquitto/build.sh b/proj1_mqttd/mosquitto/build.sh new file mode 100755 index 0000000..5ef3213 --- /dev/null +++ b/proj1_mqttd/mosquitto/build.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +MQTT_LIB=mosquitto-1.6.3 + +LIBPATH=/usr/local/lib/libmosquitto.so + +if [ -f ${LIBPATH} ] ; then + echo "${MQTT_LIB} already installed" + exit 0; +fi + + +if [ ! -d $MQTT_LIB ] ; then + if [ ! -f ${MQTT_LIB}.tar.gz ] ; then + wget https://mosquitto.org/files/source/${MQTT_LIB}.tar.gz + fi + + if [ ! -f ${MQTT_LIB}.tar.gz ] ; then + echo "## ERROR: MQTT Library ${MQTT_LIB}.tar.gz not exist or download failure!" + exit 1; + fi + + tar -xzf ${MQTT_LIB}.tar.gz +fi + +if [ ! -d $MQTT_LIB ] ; then + echo "## ERROR: MQTT Library ${MQTT_LIB} not exist or decompress failure!" + exit 2; +fi + +cd $MQTT_LIB + +make install +if [ $? != 0 ] ; then + echo "ERROR: MQTT Library ${MQTT_LIB} failure!" + exit 3; +fi diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3.tar.gz b/proj1_mqttd/mosquitto/mosquitto-1.6.3.tar.gz new file mode 100644 index 0000000..eaf68e6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3.tar.gz Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/CMakeLists.txt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/CMakeLists.txt new file mode 100644 index 0000000..e707229 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/CMakeLists.txt @@ -0,0 +1,118 @@ +# This is a cmake script. Process it with the CMake gui or command line utility +# to produce makefiles / Visual Studio project files on Mac OS X and Windows. +# +# To configure the build options either use the CMake gui, or run the command +# line utility including the "-i" option. + +set(CMAKE_LEGACY_CYGWIN_WIN32 0) + +project(mosquitto) + +cmake_minimum_required(VERSION 2.8) +# Only for version 3 and up. cmake_policy(SET CMP0042 NEW) + +set (VERSION 1.6.3) + +add_definitions (-DCMAKE -DVERSION=\"${VERSION}\") + +if (WIN32) + add_definitions("-D_CRT_SECURE_NO_WARNINGS") + add_definitions("-D_CRT_NONSTDC_NO_DEPRECATE") +endif (WIN32) + +include(GNUInstallDirs) + +option(WITH_TLS + "Include SSL/TLS support?" ON) +option(WITH_TLS_PSK + "Include TLS-PSK support (requires WITH_TLS)?" ON) +option(WITH_EC + "Include Elliptic Curve support (requires WITH_TLS)?" ON) +if (WITH_TLS) + find_package(OpenSSL REQUIRED) + add_definitions("-DWITH_TLS") + + if (WITH_TLS_PSK) + add_definitions("-DWITH_TLS_PSK") + endif (WITH_TLS_PSK) + + if (WITH_EC) + add_definitions("-DWITH_EC") + endif (WITH_EC) +else (WITH_TLS) + set (OPENSSL_INCLUDE_DIR "") +endif (WITH_TLS) + +option(WITH_SOCKS "Include SOCKS5 support?" ON) +if (WITH_SOCKS) + add_definitions("-DWITH_SOCKS") +endif (WITH_SOCKS) + +option(WITH_SRV "Include SRV lookup support?" OFF) + +option(WITH_THREADING "Include client library threading support?" ON) +if (WITH_THREADING) + add_definitions("-DWITH_THREADING") + if (WIN32) + if (CMAKE_CL_64) + set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x64\\pthreadVC2.lib) + else (CMAKE_CL_64) + set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x86\\pthreadVC2.lib) + endif (CMAKE_CL_64) + set (PTHREAD_INCLUDE_DIR C:\\pthreads\\Pre-built.2\\include) + else (WIN32) + find_library(LIBPTHREAD pthread) + if (LIBPTHREAD) + set (PTHREAD_LIBRARIES pthread) + else (LIBPTHREAD) + set (PTHREAD_LIBRARIES "") + endif() + set (PTHREAD_INCLUDE_DIR "") + endif (WIN32) +else (WITH_THREADING) + set (PTHREAD_LIBRARIES "") + set (PTHREAD_INCLUDE_DIR "") +endif (WITH_THREADING) + +option(DOCUMENTATION "Build documentation?" ON) + +option(WITH_DLT "Include DLT support?" OFF) +message(STATUS "WITH_DLT = ${WITH_DLT}") +if (WITH_DLT) + #find_package(DLT REQUIRED) + find_package(PkgConfig) + pkg_check_modules(DLT "automotive-dlt >= 2.11") + add_definitions("-DWITH_DLT") +endif (WITH_DLT) + +# ======================================== +# Include projects +# ======================================== + +add_subdirectory(lib) +add_subdirectory(client) +add_subdirectory(src) +if (DOCUMENTATION) + add_subdirectory(man) +endif (DOCUMENTATION) + +# ======================================== +# Install config file +# ======================================== + +install(FILES mosquitto.conf aclfile.example pskfile.example pwfile.example DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/mosquitto") + + +# ======================================== +# Install pkg-config files +# ======================================== + +configure_file(libmosquitto.pc.in libmosquitto.pc @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libmosquitto.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/pkgconfig") +configure_file(libmosquittopp.pc.in libmosquittopp.pc @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libmosquittopp.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/pkgconfig") + +# ======================================== +# Testing +# ======================================== +enable_testing() diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/CONTRIBUTING.md b/proj1_mqttd/mosquitto/mosquitto-1.6.3/CONTRIBUTING.md new file mode 100644 index 0000000..3707fd5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/CONTRIBUTING.md @@ -0,0 +1,92 @@ +Contributing to Mosquitto +========================= + +Thank you for your interest in this project. + +Project description: +-------------------- + +The Mosquitto project has been created to provide a light weight, open-source +implementation, of an MQTT broker to allow new, existing, and emerging +applications for Machine-to-Machine (M2M) and Internet of Things (IoT). + +- <https://mosquitto.org/> +- <https://projects.eclipse.org/projects/technology.mosquitto> + + +Source +------ + +The Mosquitto code is stored in a git repository. + +- https://github.com/eclipse/mosquitto + +You can contribute bugfixes and new features by sending pull requests through GitHub. + + +## Legal + +In order for your contribution to be accepted, it must comply with the Eclipse +Foundation IP policy. + +Please read the [Eclipse Foundation policy on accepting contributions via Git](http://wiki.eclipse.org/Development_Resources/Contributing_via_Git). + +1. Sign the [Eclipse ECA](http://www.eclipse.org/legal/ECA.php) + 1. Register for an Eclipse Foundation User ID. You can register [here](https://accounts.eclipse.org/user/register). + 2. Log into the [Accounts Portal](https://accounts.eclipse.org/), and click on the '[Eclipse Contributor Agreement](https://accounts.eclipse.org/user/eca)' link. +2. Go to your [account settings](https://accounts.eclipse.org/user/edit) and add your GitHub username to your account. +3. Make sure that you _sign-off_ your Git commits in the following format: + ``` Signed-off-by: John Smith <johnsmith@nowhere.com> ``` This is usually at the bottom of the commit message. You can automate this by adding the '-s' flag when you make the commits. e.g. ```git commit -s -m "Adding a cool feature"``` +4. Ensure that the email address that you make your commits with is the same one you used to sign up to the Eclipse Foundation website with. + +## Contributing a change + +1. [Fork the repository on GitHub](https://github.com/eclipse/mosquitto/fork) +2. Clone the forked repository onto your computer: ``` git clone + https://github.com/<your username>/mosquitto.git ``` +3. If you are adding a new feature, then create a new branch from the latest + ```develop``` branch with ```git checkout -b YOUR_BRANCH_NAME + origin/develop``` +4. If you are fixing a bug, then create a new branch from the latest + ```fixes``` branch with ```git checkout -b YOUR_BRANCH_NAME origin/fixes``` +5. Make your changes +6. Ensure that all new and existing tests pass. +7. Commit the changes into the branch: ``` git commit -s ``` Make sure that + your commit message is meaningful and describes your changes correctly. +8. If you have a lot of commits for the change, squash them into a single / few + commits. +9. Push the changes in your branch to your forked repository. +10. Finally, go to + [https://github.com/eclipse/mosquitto](https://github.com/eclipse/mosquitto) + and create a pull request from your "YOUR_BRANCH_NAME" branch to the + ```develop``` or ```fixes``` branch as appropriate to request review and + merge of the commits in your pushed branch. + + +What happens next depends on the content of the patch. If it is 100% authored +by the contributor and is less than 1000 lines (and meets the needs of the +project), then it can be pulled into the main repository. If not, more steps +are required. These are detailed in the +[legal process poster](http://www.eclipse.org/legal/EclipseLegalProcessPoster.pdf). + + + +Contact: +-------- + +Contact the project developers via the project's development +[mailing list](https://dev.eclipse.org/mailman/listinfo/mosquitto-dev). + +Search for bugs: +---------------- + +This project uses [Github](https://github.com/eclipse/mosquitto/issues) +to track ongoing development and issues. + +Create a new bug: +----------------- + +Be sure to search for existing bugs before you create another one. Remember +that contributions are always welcome! + +- [Create new Mosquitto bug](https://github.com/eclipse/mosquitto/issues) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/ChangeLog.txt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/ChangeLog.txt new file mode 100644 index 0000000..6b3f871 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/ChangeLog.txt @@ -0,0 +1,2175 @@ +1.6.3 - 20190618 +================ + +Broker: +- Fix detection of incoming v3.1/v3.1.1 bridges. Closes #1263. +- Fix default max_topic_alias listener config not being copied to the in-use + listener when compiled without TLS support. +- Fix random number generation if compiling using `WITH_TLS=no` and on Linux + with glibc >= 2.25. Without this fix, no random numbers would be generated + for e.g. on broker client id generation, and so clients connecting expecting + this feature would be unable to connect. +- Fix compilation problem related to `getrandom()` on non-glibc systems. +- Fix Will message for a persistent client incorrectly being sent when the + client reconnects after a clean disconnect. Closes #1273. +- Fix Will message for a persistent client not being sent on disconnect. + Closes #1273. +- Improve documentation around the upgrading of persistence files. Closes + #1276. +- Add 'extern "C"' on mosquitto_broker.h and mosquitto_plugin.h for C++ plugin + writing. Closes #1290. +- Fix persistent Websockets clients not receiving messages after they + reconnect, having sent DISCONNECT on a previous session. Closes #1227. +- Disable TLS renegotiation. Client initiated renegotiation is considered to + be a potential attack vector against servers. Closes #1257. +- Fix incorrect shared subscription topic '$shared'. +- Fix zero length client ids being rejected for MQTT v5 clients with clean + start set to true. +- Fix MQTT v5 overlapping subscription behaviour. Clients now receive message + from all matching subscriptions rather than the first one encountered, which + ensures the maximum QoS requirement is met. +- Fix incoming/outgoing quota problems for QoS>0. +- Remove obsolete `store_clean_interval` from documentation. +- Fix v4 authentication plugin never calling psk_key_get. + +Client library: +- Fix typo causing build error on Windows when building without TLS support. + Closes #1264. + +Clients: +- Fix -L url parsing when `/topic` part is missing. +- Stop some error messages being printed even when `--quiet` was used. + Closes #1284. +- Fix mosquitto_pub exiting with error code 0 when an error occurred. + Closes #1285. +- Fix mosquitto_pub not using the `-c` option. Closes #1273. +- Fix MQTT v5 clients not being able to specify a password without a username. + Closes #1274. +- Fix `mosquitto_pub -l` not handling network failures. Closes #1152. +- Fix `mosquitto_pub -l` not handling zero length input. Closes #1302. +- Fix double free on exit in mosquitto_pub. Closes #1280. + +Documentation: +- Remove references to Python binding and C++ wrapper in libmosquitto man + page. Closes #1266. + +Build: +- CLIENT_LDFLAGS now uses LDFLAGS. Closes #1294. + + +1.6.2 - 20190430 +================ + +Broker: +- Fix memory access after free, leading to possible crash, when v5 client with + Will message disconnects, where the Will message has as its first property + one of `content-type`, `correlation-data`, `payload-format-indicator`, or + `response-topic`. Closes #1244. +- Fix build for WITH_TLS=no. Closes #1250. +- Fix Will message not allowing user-property properties. +- Fix broker originated messages (e.g. $SYS/broker/version) not being + published when `check_retain_source` set to true. Closes #1245. +- Fix $SYS/broker/version being incorrectly expired after 60 seconds. + Closes #1245. + +Library: +- Fix crash after client has been unable to connect to a broker. This occurs + when the client is exiting and is part of the final library cleanup routine. + Closes #1246. + +Clients: +- Fix -L url parsing. Closes #1248. + + +1.6.1 - 20190426 +================ + +Broker: +- Document `memory_limit` option. + +Clients: +- Fix compilation on non glibc systems due to missing sys/time.h header. + +Build: +- Add `make check` target and document testing procedure. Closes #1230. +- Document bundled dependencies and how to disable. Closes #1231. +- Split CFLAGS and CPPFLAGS, and LDFLAGS and LDADD/LIBADD. +- test/unit now respects CPPFLAGS and LDFLAGS. Closes #1232. +- Don't call ldconfig in CMake scripts. Closes #1048. +- Use CMAKE_INSTALL_* variables when installing in CMake. Closes #1049. + + +1.6 - 20190417 +============== + +Broker features: +- Add support for MQTT v5 +- Add support for OCSP stapling. +- Add support for ALPN on bridge TLS connections. Closes #924. +- Add support for Automotive DLT logging. +- Add TLS Engine support. +- Persistence file read/write performance improvements. +- General performance improvements. +- Add max_keepalive option, to allow a maximum keepalive value to be set for + MQTT v5 clients only. +- Add `bind_interface` option which allows a listener to be bound to a + specific network interface, in a similar fashion to the `bind_address` option. + Linux only. +- Add improved bridge restart interval based on Decorrelated Jitter. +- Add `dhparamfile` option, to allow DH parameters to be loaded for Ephemeral + DH support +- Disallow writing to $ topics where appropriate. +- Fix mosquitto_passwd crashing on corrupt password file. Closes #1207. +- Add explicit support for TLS v1.3. +- Drop support for TLS v1.0. +- Improved general support for broker generated client ids. Removed libuuid + dependency. +- auto_id_prefix now defaults to 'auto-'. +- QoS 1 and 2 flow control improvements. + +Client library features: +- Add support for MQTT v5 +- Add mosquitto_subscribe_multiple() for sending subscriptions to multiple + topics in one command. +- Add TLS Engine support. +- Add explicit support for TLS v1.3. +- Drop support for TLS v1.0. +- QoS 1 and 2 flow control improvements. + +Client features: +- Add support for MQTT v5 +- Add mosquitto_rr client, which can be used for "request-response" messaging, + by sending a request message and awaiting a response. +- Add TLS Engine support. +- Add support for ALPN on TLS connections. Closes #924. +- Add -D option for all clients to specify MQTT v5 properties. +- Add -E to mosquitto_sub, which causes it to exit immediately after having + its subscriptions acknowledged. Use with -c to create a durable client + session without requiring a message to be received. +- Add --remove-retained to mosquitto_sub, which can be used to clear retained + messages on a broker. +- Add --repeat and --repeat-delay to mosquitto_pub, which can be used to + repeat single message publishes at a regular interval. +- -V now accepts `5, `311`, `31`, as well as `mqttv5` etc. +- Add explicit support for TLS v1.3. +- Drop support for TLS v1.0. + +Broker fixes: +- Improve error reporting when creating listeners. +- Fix build on SmartOS due to missing IPV6_V6ONLY. Closes #1212. + +Client library fixes +- Add missing `mosquitto_userdata()` function. + +Client fixes: +- mosquitto_pub wouldn't always publish all messages when using `-l` and + QoS>0. This has been fixed. +- mosquitto_sub was incorrectly encoding special characters when using %j + output format. Closes #1220. + + +1.5.8 - 20190228 +================ + +Broker: +- Fix clients being disconnected when ACLs are in use. This only affects the + case where a client connects using a username, and the anonymous ACL list is + defined but specific user ACLs are not defined. Closes #1162. +- Make error messages for missing config file clearer. +- Fix some Coverity Scan reported errors that could occur when the broker was + already failing to start. +- Fix broken mosquitto_passwd on FreeBSD. Closes #1032. +- Fix delayed bridge local subscriptions causing missing messages. + Closes #1174. + +Library: +- Use higher resolution timer for random initialisation of client id + generation. Closes #1177. +- Fix some Coverity Scan reported errors that could occur when the library was + already quitting. + + +1.5.7 - 20190213 +================ + +Broker: +- Fix build failure when using WITH_ADNS=yes +- Ensure that an error occurs if `per_listener_settings true` is given after + other security options. Closes #1149. +- Fix include_dir not sorting config files before loading. This was partially + fixed in 1.5 previously. +- Improve documentation around the `include_dir` option. Closes #1154. +- Fix case where old unreferenced msg_store messages were being saved to the + persistence file, bloating its size unnecessarily. Closes #389. + +Library: +- Fix `mosquitto_topic_matches_sub()` not returning MOSQ_ERR_INVAL for + invalid subscriptions like `topic/#abc`. This only affects the return value, + not the match/no match result, which was already correct. + +Build: +- Don't require C99 compiler. +- Add rewritten build test script and remove some build warnings. + + +1.5.6 - 20190206 +================ + +Security: +- CVE-2018-12551: If Mosquitto is configured to use a password file for + authentication, any malformed data in the password file will be treated as + valid. This typically means that the malformed data becomes a username and no + password. If this occurs, clients can circumvent authentication and get access + to the broker by using the malformed username. In particular, a blank line + will be treated as a valid empty username. Other security measures are + unaffected. Users who have only used the mosquitto_passwd utility to create + and modify their password files are unaffected by this vulnerability. + Affects version 1.0 to 1.5.5 inclusive. +- CVE-2018-12550: If an ACL file is empty, or has only blank lines or + comments, then mosquitto treats the ACL file as not being defined, which + means that no topic access is denied. Although denying access to all topics + is not a useful configuration, this behaviour is unexpected and could lead + to access being incorrectly granted in some circumstances. This is now + fixed. Affects versions 1.0 to 1.5.5 inclusive. +- CVE-2018-12546. If a client publishes a retained message to a topic that + they have access to, and then their access to that topic is revoked, the + retained message will still be delivered to future subscribers. This + behaviour may be undesirable in some applications, so a configuration option + `check_retain_source` has been introduced to enforce checking of the + retained message source on publish. + +Broker: +- Fixed comment handling for config options that have optional arguments. +- Improved documentation around bridge topic remapping. +- Handle mismatched handshakes (e.g. QoS1 PUBLISH with QoS2 reply) properly. +- Fix spaces not being allowed in the bridge remote_username option. Closes + #1131. +- Allow broker to always restart on Windows when using `log_dest file`. Closes + #1080. +- Fix Will not being sent for Websockets clients. Closes #1143. +- Windows: Fix possible crash when client disconnects. Closes #1137. +- Fixed durable clients being unable to receive messages when offline, when + per_listener_settings was set to true. Closes #1081. +- Add log message for the case where a client is disconnected for sending a + topic with invalid UTF-8. Closes #1144. + +Library: +- Fix TLS connections not working over SOCKS. +- Don't clear SSL context when TLS connection is closed, meaning if a user + provided an external SSL_CTX they have less chance of leaking references. + +Build: +- Fix comparison of boolean values in CMake build. Closes #1101. +- Fix compilation when openssl deprecated APIs are not available. + Closes #1094. +- Man pages can now be built on any system. Closes #1139. + + +1.5.5 - 20181211 +================ + +Security: +- If `per_listener_settings` is set to true, then the `acl_file` setting was + ignored for the "default listener" only. This has been fixed. This does not + affect any listeners defined with the `listener` option. Closes #1073. + This is now tracked as CVE-2018-20145. + +Broker: +- Add `socket_domain` option to allow listeners to disable IPv6 support. + This is required to work around a problem in libwebsockets that means + sockets only listen on IPv6 by default if IPv6 support is compiled in. + Closes #1004. +- When using ADNS, don't ask for all network protocols when connecting, + because this can lead to confusing "Protocol not supported" errors if the + network is down. Closes #1062. +- Fix outgoing retained messages not being sent by bridges on initial + connection. Closes #1040. +- Don't reload auth_opt_ options on reload, to match the behaviour of the + other plugin options. Closes #1068. +- Print message on error when installing/uninstalling as a Windows service. +- All non-error connect/disconnect messages are controlled by the + `connection_messages` option. Closes #772. Closes #613. Closes #537. + +Library: +- Fix reconnect delay backoff behaviour. Closes #1027. +- Don't call on_disconnect() twice if keepalive tests fail. Closes #1067. + +Client: +- Always print leading zeros in mosquitto_sub when output format is hex. + Closes #1066. + +Build: +- Fix building where TLS-PSK is not available. Closes #68. + + +1.5.4 - 20181108 +================ + +Security: +- When using a TLS enabled websockets listener with "require_certificate" + enabled, the mosquitto broker does not correctly verify client certificates. + This is now fixed. All other security measures operate as expected, and in + particular non-websockets listeners are not affected by this. Closes #996. + +Broker: +- Process all pending messages even when a client has disconnected. This means + a client that send a PUBLISH then DISCONNECT quickly, then disconnects will + have its DISCONNECT message processed properly and so no Will will be sent. + Closes #7. +- $SYS/broker/clients/disconnected should never be negative. Closes #287. +- Give better error message if a client sends a password without a username. + Closes #1015. +- Fix bridge not honoring restart_timeout. Closes #1019. +- Don't disconnect a client if an auth plugin denies access to SUBSCRIBE. + Closes #1016. + +Library: +- Fix memory leak that occurred if mosquitto_reconnect() was used when TLS + errors were present. Closes #592. +- Fix TLS connections when using an external event loop with + mosquitto_loop_read() and mosquitto_write(). Closes #990. + +Build: +- Fix clients not being compiled with threading support when using CMake. + Closes #983. +- Header fixes for FreeBSD. Closes #977. +- Use _GNU_SOURCE to fix build errors in websockets and getaddrinfo usage. + Closes #862 and #933. +- Fix builds on QNX 7.0.0. Closes #1018. + + +1.5.3 - 20180925 +================ + +Security: +- Fix CVE-2018-12543. If a message is sent to Mosquitto with a topic that + begins with $, but is not $SYS, then an assert that should be unreachable is + triggered and Mosquitto will exit. + +Broker: +- Elevate log level to warning for situation when socket limit is hit. +- Remove requirement to use `user root` in snap package config files. +- Fix retained messages not sent by bridges on outgoing topics at the first + connection. Closes #701. +- Documentation fixes. Closes #520, #600. +- Fix duplicate clients being added to by_id hash before the old client was + removed. Closes #645. +- Fix Windows version not starting if include_dir did not contain any files. + Closes #566. +- When an authentication plugin denied access to a SUBSCRIBE, the client would + be disconnected incorrectly. This has been fixed. Closes #1016. + +Build: +- Various fixes to ease building. + + +1.5.2 - 20180919 +================ + +Broker: +- Fix build when using WITH_ADNS=yes. +- Fix incorrect call to setsockopt() for TCP_NODELAY. Closes #941. +- Fix excessive CPU usage when the number of sockets exceeds the system limit. + Closes #948. +- Fix for bridge connections when using WITH_ADNS=yes. +- Fix round_robin false behaviour. Closes #481. +- Fix segfault on HUP when bridges and security options are configured. + Closes #965. + +Library: +- Fix situation where username and password is used with SOCKS5 proxy. Closes + #927. +- Fix SOCKS5 behaviour when passing IP addresses. Closes #927. + +Build: +- Make it easier to build without bundled uthash.h using "WITH_BUNDLED_DEPS=no". +- Fix build with OPENSSL_NO_ENGINE. Closes #932. + + +1.5.1 - 20180816 +================ + +Broker: +- Fix plugin cleanup function not being called on exit of the broker. + Closes #900. +- Print more OpenSSL errors when loading certificates/keys fail. +- Use AF_UNSPEC etc. instead of PF_UNSPEC to comply with POSIX. Closes #863. +- Remove use of AI_ADDRCONFIG, which means the broker can be used on systems + where only the loopback interface is defined. Closes #869, Closes #901. +- Fix IPv6 addresses not being able to be used as bridge addresses. + Closes #886. +- All clients now time out if they exceed their keepalive*1.5, rather than + just reach it. This was inconsistent in two places. +- Fix segfault on startup if bridge CA certificates could not be read. + Closes #851. +- Fix problem opening listeners on Pi caused by unsigned char being default. + Found via #849. +- ACL patterns that do not contain either %c or %u now produce a warning in + the log. Closes #209. +- Fix bridge publishing failing when per_listener_settings was true. Closes + #860. +- Fix `use_identity_as_username true` not working. Closes #833. +- Fix UNSUBACK messages not being logged. Closes #903. +- Fix possible endian issue when reading the `memory_limit` option. +- Fix building for libwebsockets < 1.6. +- Fix accessor functions for username and client id when used in plugin auth + check. + +Library: +- Fix some places where return codes were incorrect, including to the + on_disconnect() callback. This has resulted in two new error codes, + MOSQ_ERR_KEEPALIVE and MOSQ_ERR_LOOKUP. +- Fix connection problems when mosquitto_loop_start() was called before + mosquitto_connect_async(). Closes #848. + +Clients: +- When compiled using WITH_TLS=no, the default port was incorrectly being set + to -1. This has been fixed. +- Fix compiling on Mac OS X <10.12. Closes #813 and #240. + +Build: +- Fixes for building on NetBSD. Closes #258. +- Fixes for building on FreeBSD. +- Add support for compiling with static libwebsockets library. + + +1.5 - 20180502 +============== + +Security: +- Fix memory leak that could be caused by a malicious CONNECT packet. This + does not yet have a CVE assigned. Closes #533493 (on Eclipse bugtracker) + +Broker features: +- Add per_listener_settings to allow authentication and access control to be + per listener. +- Add limited support for reloading listener settings. This allows settings + for an already defined listener to be reloaded, but port numbers must not be + changed. +- Add ability to deny access to SUBSCRIBE messages as well as the current + read/write accesses. Currently for auth plugins only. +- Reduce calls to malloc through the use of UHPA. +- Outgoing messages with QoS>1 are no longer retried after a timeout period. + Messages will be retried when a client reconnects. This change in behaviour + can be justified by considering when the timeout may have occurred. + * If a connection is unreliable and has dropped, but without one end + noticing, the messages will be retried on reconnection. Sending + additional PUBLISH or PUBREL would not have changed anything. + * If a client is overloaded/unable to respond/has a slow connection then + sending additional PUBLISH or PUBREL would not help the client catch + up. Once the backlog has cleared the client will respond. If it is not + able to catch up, sending additional duplicates would not help either. +- Add use_subject_as_username option for certificate based client + authentication to use the entire certificate subject as a username, rather + than just the CN. Closes #469467. +- Change sys tree printing output. This format shouldn't be relied upon and + may change at any time. Closes #470246. +- Minimum supported libwebsockets version is now 1.3. +- Add systemd startup notification and services. Closes #471053. +- Reduce unnecessary malloc and memcpy when receiving a message and storing + it. Closes #470258. +- Support for Windows XP has been dropped. +- Bridge connections now default to using MQTT v3.1.1. +- mosquitto_db_dump tool can now output some stats on clients. +- Perform utf-8 validation on incoming will, subscription and unsubscription + topics. +- new $SYS/broker/store/messages/count (deprecates $SYS/broker/messages/stored) +- new $SYS/broker/store/messages/bytes +- max_queued_bytes feature to limit queues by real size rather than + than just message count. Closes Eclipse #452919 or Github #100 +- Add support for bridges to be configured to only send notifications to the + local broker. +- Add set_tcp_nodelay option to allow Nagle's algorithm to be disabled on + client sockets. Closes #433. +- The behaviour of allow_anonymous has changed. In the old behaviour, the + default if not set was to allow anonymous access. The new behaviour is to + default is to allow anonymous access unless another security option is set. + For example, if password_file is set and allow_anonymous is not set, then + anonymous access will be denied. It is still possible to allow anonymous + access by setting it explicitly. + +Broker fixes: +- Fix UNSUBSCRIBE with no topic is accepted on MQTT 3.1.1. Closes #665. +- Produce an error if two bridges share the same local_clientid. +- Miscellaneous fixes on Windows. +- queue_qos0_messages was not observing max_queued_** limits +- When using the include_dir configuration option sort the files + alphabetically before loading them. Closes #17. +- IPv6 is no longer disabled for websockets listeners. +- Remove all build timestamp information including $SYS/broker/timestamp. + Close #651. +- Correctly handle incoming strings that contain a NULL byte. Closes #693. +- Use constant time memcmp for password comparisons. +- Fix incorrect PSK key being used if it had leading zeroes. +- Fix memory leak if a client provided a username/password for a listener with + use_identity_as_username configured. +- Fix use_identity_as_username not working on websockets clients. +- Don't crash if an auth plugin returns MOSQ_ERR_AUTH for a username check on + a websockets client. Closes #490. +- Fix 08-ssl-bridge.py test when using async dns lookups. Closes #507. +- Lines in the config file are no longer limited to 1024 characters long. + Closes #652. +- Fix $SYS counters of messages and bytes sent when message is sent over + a Websockets. Closes #250. +- Fix upgrade_outgoing_qos for retained message. Closes #534. +- Fix CONNACK message not being sent for unauthorised connect on websockets. + Closes #8. +- Maximum connections on Windows increased to 2048. +- When a client with an in-use client-id connects, if the old client has a + will, send the will message. Closes #26. +- Fix parsing of configuration options that end with a space. Closes #804. + +Client library features: +- Outgoing messages with QoS>1 are no longer retried after a timeout period. + Messages will be retried when a client reconnects. +- DNS-SRV support is now disabled by default. +- Add mosquitto_subscribe_simple() This is a helper function to make + retrieving messages from a broker very straightforward. Examples of its use + are in examples/subscribe_simple. +- Add mosquitto_subscribe_callback() This is a helper function to make + processing messages from a broker very straightforward. An example of its use + is in examples/subscribe_simple. +- Connections now default to using MQTT v3.1.1. +- Add mosquitto_validate_utf8() to check whether a string is valid UTF-8 + according to the UTF-8 spec and to the additional restrictions imposed by + the MQTT spec. +- Topic inputs are checked for UTF-8 validity. +- Add mosquitto_userdata function to allow retrieving the client userdata + member variable. Closes #111. +- Add mosquitto_pub_topic_check2(), mosquitto_sub_topic_check2(), and + mosquitto_topic_matches_sub2() which are identical to the similarly named + functions but also take length arguments. +- Add mosquitto_connect_with_flags_callback_set(), which allows a second + connect callback to be used which also exposes the connect flags parameter. + Closes #738 and #128. +- Add MOSQ_OPT_SSL_CTX option to allow a user specified SSL_CTX to be used + instead of the one generated by libmosquitto. This allows greater control + over what options can be set. Closes #715. +- Add MOSQ_OPT_SSL_CTX_WITH_DEFAULTS to work with MOSQ_OPT_SSL_CTX and have + the default libmosquitto SSL_CTX configuration applied to the user provided + SSL_CTX. Closes #567. + +Client library fixes: +- Fix incorrect PSK key being used if it had leading zeroes. +- Initialise "result" variable as soon as possible in + mosquitto_topic_matches_sub. Closes #654. +- No need to close socket again if setting non-blocking failed. Closes #649. +- Fix mosquitto_topic_matches_sub() not correctly matching foo/bar against + foo/+/#. Closes #670. +- SNI host support added. + +Client features: +- Add -F to mosquitto_sub to allow the user to choose the output format. +- Add -U to mosquitto_sub for unsubscribing from topics. +- Add -c (clean session) to mosquitto_pub. +- Add --retained-only to mosquitto_sub to exit after receiving all retained + messages. +- Add -W to allow mosquitto_sub to stop processing incoming messages after a + timeout. +- Connections now default to using MQTT v3.1.1. +- Default to using port 8883 when using TLS. +- mosquitto_sub doesn't continue to keep connecting if CONNACK tells it the + connection was refused. + +Client fixes: +- Correctly handle empty files with "mosquitto_pub -l". Closes #676. + +Build: +- Add WITH_STRIP option (defaulting to "no") that when set to "yes" will strip + executables and shared libraries when installing. +- Add WITH_STATIC_LIBRARIES (defaulting to "no") that when set to "yes" will + build and install static versions of the client libraries. +- Don't run TLS-PSK tests if TLS-PSK disabled at compile time. Closes #636. +- Support for openssl versions 1.0.0 and 1.0.1 has been removed as these are + no longer supported by openssl. + +Documentation: +- Replace mentions of deprecated 'c_rehash' with 'openssl rehash'. + +1.4.15 - 20180228 +================= + +Security: +- Fix CVE-2017-7652. If a SIGHUP is sent to the broker when there are no more + file descriptors, then opening the configuration file will fail and security + settings will be set back to their default values. +- Fix CVE-2017-7651. Unauthenticated clients can cause excessive memory use by + setting "remaining length" to be a large value. This is now mitigated by + limiting the size of remaining length to valid values. A "memory_limit" + configuration option has also been added to allow the overall memory used by + the broker to be limited. + +Broker: +- Use constant time memcmp for password comparisons. +- Fix incorrect PSK key being used if it had leading zeroes. +- Fix memory leak if a client provided a username/password for a listener with + use_identity_as_username configured. +- Fix use_identity_as_username not working on websockets clients. +- Don't crash if an auth plugin returns MOSQ_ERR_AUTH for a username check on + a websockets client. Closes #490. +- Fix 08-ssl-bridge.py test when using async dns lookups. Closes #507. +- Lines in the config file are no longer limited to 1024 characters long. + Closes #652. +- Fix $SYS counters of messages and bytes sent when message is sent over + a Websockets. Closes #250. +- Fix upgrade_outgoing_qos for retained message. Closes #534. +- Fix CONNACK message not being sent for unauthorised connect on websockets. + Closes #8. + +Client library: +- Fix incorrect PSK key being used if it had leading zeroes. +- Initialise "result" variable as soon as possible in + mosquitto_topic_matches_sub. Closes #654. +- No need to close socket again if setting non-blocking failed. Closes #649. +- Fix mosquitto_topic_matches_sub() not correctly matching foo/bar against + foo/+/#. Closes #670. + +Clients: +- Correctly handle empty files with "mosquitto_pub -l". Closes #676. + +Build: +- Don't run TLS-PSK tests if TLS-PSK disabled at compile time. Closes #636. + + +1.4.14 - 20170710 +================= + +Broker: +- Fix regression from 1.4.13 where persistence data was not being saved. + + +1.4.13 - 20170627 +================= + +Security: +- Fix CVE-2017-9868. The persistence file was readable by all local users, + potentially allowing sensitive information to be leaked. + This can also be fixed administratively, by restricting access to the + directory in which the persistence file is stored. + +Broker: +- Fix for poor websockets performance. +- Fix lazy bridges not timing out for idle_timeout. Closes #417. +- Fix problems with large retained messages over websockets. Closes #427. +- Set persistence file to only be readable by owner, except on Windows. Closes + #468. +- Fix CONNECT check for reserved=0, as per MQTT v3.1.1 check MQTT-3.1.2-3. +- When the broker stop, wills for any connected clients are now "sent". Closes + #477. +- Auth plugins can be configured to disable the check for +# in + usernames/client ids with the auth_plugin_deny_special_chars option. + Partially closes #462. +- Restrictions for CVE-2017-7650 have been relaxed - '/' is allowed in + usernames/client ids. Remainder of fix for #462. + +Clients: +- Don't use / in auto-generated client ids. + + +1.4.12 - 20170528 +================= + +Security: +- Fix CVE-2017-7650, which allows clients with username or client id set to + '#' or '+' to bypass pattern based ACLs or third party plugins. The fix + denies message sending or receiving of messages for clients with a '#' or + '+' in their username or client id and if the message is subject to a + pattern ACL check or plugin check. + Patches for other versions are available at + https://mosquitto.org/files/cve/2017-7650/ + +Broker: +- Fix mosquitto.db from becoming corrupted due to client messages being + persisted with no stored message. Closes #424. +- Fix bridge not restarting properly. Closes #428. +- Fix unitialized memory in gets_quiet on Windows. Closes #426. +- Fix building with WITH_ADNS=no for systems that don't use glibc. Closes + #415. +- Fixes to readme.md. +- Fix deprecation warning for OpenSSL 1.1. PR #416. +- Don't segfault on duplicate bridge names. Closes #446. +- Fix CVE-2017-7650. + + +1.4.11 - 20170220 +================= + +Broker: +- Fix crash when "lazy" type bridge attempts to reconnect. Closes #259. +- maximum_connections now applies to websockets listeners. Closes #271. +- Allow bridges to use TLS with IPv6. +- Don't error on zero length persistence files. Closes #316. +- For http only websockets clients, close files served over http in all cases + when the client disconnects. Closes #354. +- Fix error message when websockets http_dir directory does not exist. +- Improve password utility error message. Closes #379. + +Clients: +- Use of --ciphers no longer requires you to also pass --tls-version. + Closes #380. + +Client library: +- Clients can now use TLS with IPv6. +- Fix potential socket leakage when reconnecting. Closes #304. +- Fix potential negative timeout being passed to pselect. Closes #329. + + +1.4.10 - 20160816 +================= + +Broker: +- Fix TLS operation with websockets listeners and libwebsockts 2.x. Closes + #186. +- Don't disconnect client on HUP before reading the pending data. Closes #7. +- Fix some $SYS messages being incorrectly persisted. Closes #191. +- Support OpenSSL 1.1.0. +- Call fsync after persisting data to ensure it is correctly written. Closes + #189. +- Fix persistence saving of subscription QoS on big-endian machines. +- Fix will retained flag handling on Windows. Closes #222. +- Broker now displays an error if it is unable to open the log file. Closes + #234. + +Client library: +- Support OpenSSL 1.1.0. +- Fixed the C++ library not allowing SOCKS support to be used. Closes #198. +- Fix memory leak when verifying a server certificate with a subjectAltName + section. Closes #237. + +Build: +- Don't attempt to install docs when WITH_DOCS=no. Closes #184. + + +1.4.9 - 20160603 +================ + +Broker: +- Ensure websockets clients that previously connected with clean session set + to false have their queued messages delivered immediately on reconnecting. + Closes #476314. +- Reconnecting client with clean session set to false doesn't start with mid=1 + again. +- Will topic isn't truncated by one byte when using a mount_point any more. +- Network errors are printed correctly on Windows. +- Fix incorrect $SYS heap memory reporting when using ACLs. +- Bridge config parameters couldn't contain a space, this has been fixed. + Closes #150. +- Fix saving of persistence messages that start with a '/'. Closes #151. +- Fix reconnecting for bridges that use TLS on Windows. Closes #154. +- Broker and bridges can now cope with unknown incoming PUBACK, PUBREC, + PUBREL, PUBCOMP without disconnecting. Closes #57. +- Fix websockets listeners not being able to bind to an IP address. Closes + #170. +- mosquitto_passwd utility now correctly deals with unknown command line + arguments in all cases. Closes #169. +- Fix publishing of $SYS/broker/clients/maximum +- Fix order of #includes in lib/send_mosq.c to ensure struct mosquitto doesn't + differ between source files when websockets is being used. Closes #180. +- Fix possible rare crash when writing out persistence file and a client has + incomplete messages inflight that it has been denied the right to publish. + +Client library: +- Fix the case where a message received just before the keepalive timer + expired would cause the client to miss the keepalive timer. +- Return value of pthread_create is now checked. +- _mosquitto_destroy should not cancel threads that weren't created by + libmosquitto. Closes #166. +- Clients can now cope with unknown incoming PUBACK, PUBREC, PUBREL, PUBCOMP + without disconnecting. Closes #57. +- Fix mosquitto_topic_matches_sub() reporting matches on some invalid + subscriptions. + +Clients: +- Handle some unchecked malloc() calls. Closes #1. + +Build: +- Fix string quoting in CMakeLists.txt. Closes #4. +- Fix building on Visual Studio 2015. Closes #136. + + +1.4.8 - 20160214 +================ + +Broker: +- Wills published by clients connected to a listener with mount_point defined + now correctly obey the mount point. This was a potential security risk + because it allowed clients to publish messages outside of their restricted + mount point. This is only affects brokers where the mount_point option is in + use. Closes #487178. +- Fix detection of broken connections on Windows. Closes #485143. +- Close stdin etc. when daemonised. Closes #485589. +- Fix incorrect detection of FreeBSD and OpenBSD. Closes #485131. + +Client library: +- mosq->want_write should be cleared immediately before a call to SSL_write, + to allow clients using mosquitto_want_write() to get accurate results. + + +1.4.7 - 20151221 +================ + +Broker: +- Fix support for libwebsockets 1.22. + + +1.4.6 - 20151220 +================ + +Broker: +- Add support for libwebsockets 1.6. + +Client library: +- Fix _mosquitto_socketpair() on Windows, reducing the chance of delays when + publishing. Closes #483979. + +Clients: +- Fix "mosquitto_pub -l" stripping the final character on a line. Closes + #483981. + + +1.4.5 - 20151108 +================ + +Broker: +- Fix possible memory leak if bridge using SSL attempts to connect to a + host that is not up. +- Free unused topic tree elements (fix in 1.4.3 was incomplete). Closes + #468987. + +Clients: +- "mosquitto_pub -l" now no longer limited to 1024 byte lines. Closes #478917. + + +1.4.4 - 20150916 +================ + +Broker: +- Don't leak sockets when outgoing bridge with multiple addresses cannot + connect. Closes #477571. +- Fix cross compiling of websockets. Closes #475807. +- Fix memory free related crashes on openwrt. Closes #475707. +- Fix excessive calls to message retry check. + + +1.4.3 - 20150818 +================ + +Broker: +- Fix incorrect bridge notification on initial connection. Closes #467096. +- Build fixes for OpenBSD. +- Fix incorrect behaviour for autosave_interval, most noticable for + autosave_interval=1. Closes #465438. +- Fix handling of outgoing QoS>0 messages for bridges that could not be sent + because the bridge connection was down. +- Free unused topic tree elements. Closes #468987. +- Fix some potential memory leaks. Closes #470253. +- Fix potential crash on libwebsockets error. + +Client library: +- Add missing error strings to mosquitto_strerror. +- Handle fragmented TLS packets without a delay. Closes #470660. +- Fix incorrect loop timeout being chosen when using threaded interface and + keepalive = 0. Closes #471334. +- Increment inflight messages count correctly. Closes #474935. + +Clients: +- Report error string on connection failure rather than error code. + + +1.4.2 - 20150507 +================ + +Broker: +- Fix bridge prefixes only working for the first outgoing message. Closes + #464437. +- Fix incorrect bridge connection notifications on local broker. +- Fix persistent db writing on Windows. Closes #464779. +- ACLs are now checked before sending a will message. +- Fix possible crash when using bridges on Windows. Closes #465384. +- Fix parsing of auth_opt_ arguments with extra spaces/tabs. +- Broker will return CONNACK rc=5 when a username/password is not authorised. + This was being incorrectly set as rc=4. +- Fix handling of payload lengths>4096 with websockets. + +Client library: +- Inflight message count wasn't being decreased for outgoing messages using + QoS 2, meaning that only up to 20 QoS 2 messages could be sent. This has + been fixed. Closes #464436. +- Fix CMake dependencies for C++ wrapper building. Closes #463884. +- Fix possibility of select() being called with a socket that is >FD_SETSIZE. + This is a fix for #464632 that will be followed up by removing the select() + call in a future version. +- Fix calls to mosquitto_connect*_async() not completing. + + +1.4.1 - 20150403 +================ + +Broker: +- Fix possible crash under heavy network load. Closes #463241. +- Fix possible crash when using pattern ACLs. +- Fix problems parsing config strings with multiple leading spaces. Closes + #462154. +- Websockets clients are now periodically disconnected if they have not + maintained their keepalive timer. Closes #461619. +- Fix possible minor memory leak on acl parsing. + +Client library: +- Inflight limits should only apply to outgoing messages. Closes #461620. +- Fix reconnect bug on Windows. Closes #463000. +- Return -1 on error from mosquitto_socket(). Closes #461705. +- Fix crash on multiple calls to mosquitto_lib_init/mosquitto_lib_cleanup. + Closes #462780. +- Allow longer paths on Windows. Closes #462781. +- Make _mosquitto_mid_generate() thread safe. Closes #463479. + + +1.4 - 20150218 +============== + +Important changes: +- Websockets support in the broker. +- Bridge behaviour on the local broker has changed due to the introduction of + the local_* options. This may affect you if you are using authentication + and/or ACLs with bridges. +- The default TLS behaviour has changed to accept all of TLS v1.2, v1.1 and + v1.0, rather than only only one version of the protocol. It is still + possible to restrict a listener to a single version of TLS. +- The Python client has been removed now that the Eclipse Paho Python client + has had a release. +- When a durable client reconnects, its queued messages are now checked + against ACLs in case of a change in username/ACL state since it last + connected. +- New use_username_as_clientid option on the broker, for preventing hijacking + of a client id. +- The client library and clients now have experimental SOCKS5 support. +- Wildcard TLS certificates are now supported for bridges and clients. +- The clients have support for config files with default options. +- Client and client libraries have support for MQTT v3.1.1. +- Bridge support for MQTT v3.1.1. + + +Broker: +- Websockets support in the broker. +- Add local_clientid, local_username, local_password for bridge connections to + authenticate to the local broker. +- Default TLS mode now accepts TLS v1.2, v1.1 and v1.0. +- Support for ECDHE-ECDSA family ciphers. +- Fix bug #1324411, which could have had unexpected consequences for delayed + messages in rare circumstances. +- Add support for "session present" in CONNACK messages for MQTT v3.1.1. +- Remove strict protocol #ifdefs. +- Change $SYS/broker/clients/active -> $SYS/broker/clients/connected +- Change $SYS/broker/clients/inactive -> $SYS/broker/clients/disconnected +- When a durable client reconnects, its queued messages are now checked + against ACLs in case of a change in username/ACL state since it last + connected. +- libuuid is used to generate client ids, where it is available, when an MQTT + v3.1.1 client connects with a zero length client id. +- Anonymous clients are no longer accidently disconnected from the broker + after a SIGHUP. +- mosquitto_passwd now supports -b (batch mode) to allow the password to be + provided at the command line. +- Removed $SYS/broker/changeset. This was intended for use with debugging, but + in practice is of no use. +- Add support for use_username_as_clientid which can be used with + authentication to restrict ownership of client ids and hence prevent one + client disconnecting another by using the same client id. +- When "require_certificate" was false, the broker was incorrectly asking for + a certificate (but not checking it). This caused problems with some clients + and has been fixed so the broker no longer asks. +- When using syslog logging on non-Windows OSs, it is now possible to specify + the logging facility to one of local0-7 instead of the default "daemon". +- The bridge_attempt_unsubscribe option has been added, to allow the sending + of UNSUBSCRIBE requests to be disabled for topics with "out" direction. + Closes bug #456899. +- Wildcard TLS certificates are now supported for bridges. +- Support for "hour" client expiration lengths for the + persistent_client_expiration option. Closes bug #425835. +- Bridge support for MQTT v3.1.1. +- Root privileges are now dropped after starting listeners and loading + certificates/private keys, to allow private keys to have their permissions + restricted to the root user only. Closes bug #452914. +- Usernames and topics given in ACL files can now include a space. Closes bug + #431780. +- Fix hang if pattern acl contains a %u but an anonymous client connect. + Closes bug #455402. +- Fix man page installation with cmake. Closes bug #458843. +- When using "log_dest file" the output file is now flushed periodically. + +Clients: +- Both clients can now load default configuration options from a file. +- Add -C option to mosquitto_sub to allow the client to quit after receiving a + certain count of messages. Closes bug #453850. +- Add --proxy SOCKS5 support for both clients. +- Pub client supports setting its keepalive. Closes bug #454852. +- Add support for config files with default options. +- Add support for MQTT v3.1.1. + +Client library: +- Add experimental SOCKS5 support. +- mosquitto_loop_forever now quits after a fatal error, rather than blindly + retrying. +- SRV support is now not compiled in by default. +- Wildcard TLS certificates are now supported. +- mosquittopp now has a virtual destructor. Closes bug #452915. +- Add support for MQTT v3.1.1. +- Don't quit mosquitto_loop_forever() if broker not available on first + connect. Closes bug #453293, but requires more work. + + +1.3.5 - 20141008 +================ + +Broker: +- Fix possible memory leak when using a topic that has a leading slash. Fixes + bug #1360985. +- Fix saving persistent database on Windows. +- Temporarily disable ACL checks on subscriptions when using MQTT v3.1.1. This + is due to the complexity of checking wildcard ACLs against wildcard + subscriptions. This does not have a negative impact on security because + checks are still made before a message is sent to a client. + Fixes bug #1374291. +- When using -v and the broker receives a SIGHUP, verbose logging was being + disabled. This has been fixed. + +Client library: +- Fix mutex being incorrectly passed by value. Fixes bug #1373785. + +1.3.4 - 20140806 +================ + +Broker: +- Don't ask client for certificate when require_certificate is false. +- Backout incomplete functionality that was incorrectly included in 1.3.2. + +1.3.3 - 20140801 +================ + +Broker: +- Fix incorrect handling of anonymous bridges on the local broker. + +1.3.2 - 20140713 +================ + +Broker: +- Don't allow access to clients when authenticating if a security plugin + returns an application error. Fixes bug #1340782. +- Ensure that bridges verify certificates by default when using TLS. +- Fix possible crash when using pattern ACLs that do not include a %u and + clients that connect without a username. +- Fix subscriptions being deleted when clients subscribed to a topic beginning + with a $ but that is not $SYS. +- When a durable client reconnects, its queued messages are now checked + against ACLs in case of a change in username/ACL state since it last + connected. +- Fix bug #1324411, which could have had unexpected consequences for delayed + messages in rare circumstances. +- Anonymous clients are no longer accidently disconnected from the broker + after a SIGHUP. + +Client library: +- Fix topic matching edge case. +- Fix callback deadlocks after calling mosquitto_disconnect(), when using the + threaded interfaces. Closes bug #1313725. +- Fix SRV support when building with CMake. +- Remove strict protocol #ifdefs. + +General: +- Use $(STRIP) for stripping binaries when installing, to allow easier cross + compilation. + +1.3.1 - 20140324 +================ + +Broker: +- Prevent possible crash on client reconnect. Closes bug #1294108. +- Don't accept zero length unsubscription strings (MQTT v3.1.1 fix) +- Don't accept QoS 3 (MQTT v3.1.1 fix) +- Don't disconnect clients immediately on HUP to give chance for all data to + be read. +- Reject invalid un/subscriptions e.g. foo/+bar #/bar. +- Take more care not to disconnect clients that are sending large messages. + +Client library: +- Fix socketpair code on the Mac. +- Fix compilation for WITH_THREADING=no. +- Break out of select() when calling mosquitto_loop_stop(). +- Reject invalid un/subscriptions e.g. foo/+bar #/bar. +- Add mosquitto_threaded_set(). + +Clients: +- Fix keepalive value on mosquitto_pub. +- Fix possibility of mosquitto_pub not exiting after sending messages when + using -l. + +1.3 - 20140316 +============== + +Broker: +- The broker no longer ignores the auth_plugin_init() return value. +- Accept SSLv2/SSLv3 HELLOs when using TLSv1, whilst keeping SSLv2 and SSLv3 + disabled. This increases client compatibility without sacrificing security. +- The $SYS tree can now be disabled at runtime as well as at compile time. +- When remapping bridged topics, only check for matches when the message + direction is correct. This allows two identical topics to be remapped + differently for both in and out. +- Change "$SYS/broker/heap/current size" to "$SYS/broker/heap/current" for + easier parsing. +- Change "$SYS/broker/heap/maximum size" to "$SYS/broker/heap/maximum" for + easier parsing. +- Topics are no longer normalised from e.g a///topic to a/topic. This matches + the behaviour as clarified by the Oasis MQTT spec. This will lead to + unexpected behaviour if you were using topics of this form. +- Log when outgoing messages for a client begin to drop off the end of the + queue. +- Bridge clients are recognised as bridges even after reloading from + persistence. +- Basic support for MQTT v3.1.1. This does not include being able to bridge to + an MQTT v3.1.1 broker. +- Username is displayed in log if present when a client connects. +- Support for 0 length client ids (v3.1.1 only) that result in automatically + generated client ids on the broker (see option allow_zero_length_clientid). +- Ability to set the prefix of automatically generated client ids (see option + auto_id_prefix). +- Add support for TLS session resumption. +- When using TLS, the server now chooses the cipher to use when negotiating + with the client. +- Weak TLS ciphers are now disabled by default. + +Client library: +- Fix support for Python 2.6, 3.0, 3.1. +- Add support for un/subscribing to multiple topics at once in un/subscribe(). +- Clients now close their socket after sending DISCONNECT. +- Python client now contains its version number. +- C library mosquitto_want_write() now supports TLS clients. +- Fix possible memory leak in C/C++ library when communicating with + a broker that doesn't follow the spec. +- Return strerror() through mosquitto_strerror() to make error printing + easier. +- Topics are no longer normalised from e.g a///topic to a/topic. This matches + the behaviour as clarified by the Oasis MQTT spec. This will lead to + unexpected behaviour if you were using topics of this form. +- Add support for SRV lookups. +- Break out of select() on publish(), subscribe() etc. when using the threaded + interface. Fixes bug #1270062. +- Handle incoming and outgoing messages separately. Fixes bug #1263172. +- Don't terminate threads on mosquitto_destroy() when a client is not using + the threaded interface but does use their own thread. Fixes bug #1291473. + +Clients: +- Add --ciphers to allow specifying which TLS ciphers to support. +- Add support for SRV lookups. +- Add -N to sub client to suppress printing of EOL after the payload. +- Add -T to sub client to suppress printing of a topic hierarchy. + +1.2.3 - 20131202 +================ + +Broker: +- Don't always attempt to call read() for SSL clients, irrespective of whether + they were ready to read or not. Reduces syscalls significantly. +- Possible memory leak fixes. +- Further fix for bug #1226040: multiple retained messages being delivered for + subscriptions ending in #. +- Fix bridge reconnections when using multiple bridge addresses. + +Client library: +- Fix possible memory leak in C/C++ library when communicating with + a broker that doesn't follow the spec. +- Block in Python loop_stop() until all messages are sent, as the + documentation states should happen. +- Fix for asynchronous connections on Windows. Closes bug #1249202. +- Module version is now available in mosquitto.py. + +Clients: +- mosquitto_sub now uses fwrite() instead of printf() to output messages, so + messages with NULL characters aren't truncated. + +1.2.2 - 20131021 +================ + +Broker: +- Fix compliance with max_inflight_messages when a non-clean session client + reconnects. Closes one of the issues on bug #1237389. + +Client library: +- Fix incorrect inflight message accounting, which caused messages to go + unsent. Partial fix for bug #1237351. +- Fix potential memory corruption when sending QoS>0 messages at a high rate + using the threaded interface. Further fix for #1237351. +- Fix incorrect delay scaling when exponential_backoff=true in + mosquitto_reconnect_delay_set(). +- Some pep8 fixes for Python. + +1.2.1 - 20130918 +================ + +Broker: +- The broker no longer ignores the auth_plugin_init() return value. Closes + bug #1215084. +- Use RTLD_GLOBAL when opening authentication plugins on posix systems. Fixes + resolving of symbols in libraries used by authentication plugins. +- Add/fix some config documentation. +- Fix ACLs for topics with $SYS. +- Clients loaded from the persistence file on startup were not being added to + the client hash, causing subtle problems when the client reconnected, + including ACLs failing. This has been fixed. +- Add note to mosquitto-tls man page stating that certificates need to be + unique. Closes bug #1221285. +- Fix incorrect retained message delivery when using wildcard subs in some + circumstances. Fixes bug #1226040. + +Client library: +- Fix support for Python 2.6, 3.0, 3.1. +- Fix TLS subjectAltName verification and segfaults. +- Handle EAGAIN in Python on Windows. Closes bug #1220004. +- Fix compilation when using WITH_TLS=no. +- Don't fail reconnecting in Python when broker is temporarily unavailable. + +1.2 - 20130708 +============== + +Broker: +- Replace O(n) username lookup on CONNECT with a roughly O(1) hashtable version. +- It is now possible to disable $SYS at compile time. +- Add dropped publish messages to load tree in $SYS. Closes bug #1183318. +- Add support for logging SUBSCRIBE/UNSUBSCRIBE events. +- Add "log_dest file" logging support. +- Auth plugin ACL check function now passes the client id as well as username + and password. +- The queue_qos0_messages option wasn't working correctly, this has now been + fixed. Closes bug #1125200. +- Don't drop all messages for disconnected durable clients when + max_queued_messages=0. +- Add support for "log_type all". +- Add support for "-v" option on the command line to provide the equivalent of + "log_type all" without needing a config file. +- Add the "upgrade_outgoing_qos" option, a non-standard feature. +- Persistence data is now written to a temporary file which is atomically + renamed on completion, so a crash during writing will not produce a corrupt + file. +- mosquitto.conf is now installed as mosquitto.conf.example +- Configuration file errors are now reported with filename and line number. +- The broker now uses a monotonic clock if available, to avoid changes in time + causing client disconnections or message retries. +- Clean session and keepalive status are now display the log when a client + connects. +- Add support for TLSv1.2 and TLSv1.1. +- Clients that connect with zero length will topics are now rejected. +- Add the ability to set a maximum allowed PUBLISH payload size. +- Fix an ACL with topic "#" incorrectly granting access to $SYS. +- Fix retained messages incorrectly being set on wildcard topics, leading to + duplicate retained messages being sent on subscription. Closes bug #1116233. +- Don't discard listener values when no "port" option given. Closes bug + #1131406. +- Client password check was always failing when security was being reapplied + after a config reload. This meant that all clients were being disconnected. + This has been fixed. +- Fix build when WITH_TLS=no. Closes bug #1174971. +- Fix single outgoing packets not being sent in a timely fashion if they were + not sent in one call to write(). Closes bug #1176796. +- Fix remapping of messages for clients connected to a listener with + mount_point set. Closes bug #1180765. +- Fix duplicate retained messages being sent for some wildcard patterns. +- If a client connects with a will topic to which they do not have write + access, they are now disconnected with CONNACK "not authorised". +- Fix retained messages on topic foo being incorrectly delivered to + subscriptions of /# +- Fix handling of SSL errors on SSL_accept(). +- Fix handling of QoS 2 messages on client reconnect. +- Drop privileges now sets supplementary groups correctly. +- Fix load reporting interval (is now 60s). +- Be strict with malformed PUBLISH packets - clients are now disconnected + rather than the packet discarded. This goes inline with future OASIS spec + changes and makes other changes more straightforward. +- Process incoming messages denied by ACL properly so that clients don't keep + resending them. + +- Add support for round_robin bridge option. +- Add bridge support for verifying remote server certificate subject against + the remote hostname. +- Fix problem with out of order calls to free() when restarting a lazy bridge. +- The broker now attempts to resolve bind_address and bridge addresses + immediately when parsing the config file in order to detect invalid hosts. +- Bridges now set their notification state before attempting to connect, so if + they fail to connect the state can still be seen. +- Fix bridge notification payload length - no need to send a null byte. + +- mosquitto_passwd utility now reports errors more clearly. +- Fix "mosquitto_passwd -U". + +Client library: +- Add support for TLSv1.2 and TLSv1.1, except for on the Python module. +- Add support for verifying remote server certificate subject against the + remote hostname. +- Add mosquitto_reconnect_async() support and make asynchronous connections + truely asynchronous rather than simply deferred. DNS lookups are still + blocking, so asynchronous connections require an IP address instead of + hostname. +- Allow control of reconnection timeouts in mosquitto_loop_forever() and after + mosquitto_loop_start() by using mosquitto_reconnect_delay_set(). +- Fix building on Android NDK. +- Re-raise unhandled errors in Python so as not to provide confusing error + messages later on. +- Python module supports IPv6 connections. +- mosquitto_sub_topic_tokenise() was behaving incorrectly if the last topic + hierarchy had only a single character. This has been fixed. Closes bug + #1163348. +- Fix possible crash after disconnects when using the threaded interface with + TLS. +- Allow build/install without Python. Closes bug #1174972. +- Add support for binding connection to a local interface. +- Implement maximum inflight messages handling. +- Fix Python client not handling will_payload==None. +- Fix potential memory leak when setting username/password. +- Fix handling of QoS 2 messages on reconnect. +- Improve handling of mosquitto_disconnect() with threaded mode. + + +Clients: +- Add support for TLSv1.2 and TLSv1.1. +- Sub client can now suppress printing of messages with the retain bit set. +- Add support for binding connection to a local interface. +- Implement maximum inflight messages handling for the pub client. + +1.1.3 - 20130211 +================ + +Broker: +- mosquitto_passwd utility now uses tmpfile() to generate its temporary data + storage file. It also creates a backup file that can be used to recover data + if an errors occur. + +Other: +- Build script fixes to help packaging on Debian. + +1.1.2 - 20130130 +================ + +Client library: +- Fix tls_cert_reqs not being set to SSL_VERIFY_PEER by default. This meant + that clients were not verifying the server certificate when connecting over + TLS. This affects the C, C++ and Python libraries. + +1.1.1 - 20130116 +================ + +Broker: +- Fix crash on reload if using acl patterns. + +Client library: +- Fix static C++ functions not being exported on Windows. Fixes bug #1098256. + +1.1 - 20121219 +============== + +Broker: +- Add $SYS/broker/messages/dropped +- Add $SYS/broker/clients/expired +- Replace $SYS/broker/+/per second/+ with moving average versions published at + $SYS/broker/load/# +- Add $SYS/broker/load/sockets/+ and $SYS/broker/load/connections/+ +- Documentation on password file format has been fixed. +- Disable SSL compression. This reduces memory usage significantly and removes + the possibility of CRIME type attacks. +- Enable SSL_MODE_RELEASE_BUFFERS mode to reduce SSL memory usage further. +- Add allow_duplicate_messages option. +- ACL files can now have comment lines with # as the first character. +- Display message on startup about which config is being loaded. +- Fix max_inflight_messages and max_queued_messages not being applied. +- Fix documentation error in mosquitto.conf. +- Ensure that QoS 2 queued messages are sent out in a timely manner. +- Local bridges now act on clean_session correctly. +- Local bridges with clean_session==false now remove unused subscriptions on + broker restart. +- The $SYS/broker/heap/# messages now no longer include "bytes" as part of the + string for ease of use. + +Client library: +- Free memory used by OpenSSL in mosquitto_lib_cleanup() where possible. +- Change WebSocket subprotocol name to mqttv3.1 to make future changes easier + and for compatibility with other implementations. +- mosquitto_loop_read() and mosquitto_loop_write() now handle errors + themselves rather than having mosquitto_loop() handle their errors. This + makes using them in a separate event loop more straightforward. +- Add mosquitto_loop_forever() / loop_forever() function call to make simple + clients easier. +- Disable SSL compression. This reduces memory usage significantly and removes + the possibility of CRIME type attacks. +- Enable SSL_MODE_RELEASE_BUFFERS mode to reduce SSL memory usage further. +- mosquitto_tls_set() will now return an error or raise an exception + immediately if the CA certificate or client certificate/key cannot be + accessed. +- Fix potential memory leaks on connection failures. +- Don't produce return error from mosquitto_loop() if a system call is + interrupted. This prevents disconnects/reconnects in threaded mode and + simplifies non-threaded client handling. +- Ignore SIGPIPE to prevent unnecessary client quits in threaded mode. +- Fix document error for mosquitto_message_retry_set(). +- Fix mosquitto_topic_matches_sub() for subscriptions with + as the final + character. Fixes bug #1085797. +- Rename all "obj" parameters to "userdata" for consistency with other + libraries. +- Reset errno before network read/write to ensure EAGAIN isn't mistakenly + returned. +- The message queue length is now tracked and used to determine the maximum + number of packets to process at once. This removes the need for the + max_packets parameter which is now unused. +- Fix incorrect error value in Python error_string() function. Fixes bug + #1086777. +- Reset last message in/out timer in Python module when we send a PINGREQ. + Fixes too-early disconnects. + +Clients: +- Clients now display their own version number and library version number in + their help messages. +- Fix "mosquitto_pub -l -q 2" disconnecting before all messages were + transmitted. +- Fix potential out-of-bounds array access with client ids. Fixes bug + #1083182. + +Other: +- mosquitto_passwd can now convert password files with plain text files to + hashed versions. + +1.0.5 - 20121103 +================ + +Broker: +- Fix crash when the broker has use_identity_as_username set to true but a + client connects without a certificate. +- mosquitto_passwd should only be installed if WITH_TLS=yes. + +Library: +- Use symbolic errno values rather than numbers in Python module to avoid + cross platform issues (incorrect errno on Mac OS). + +Other: +- Build script fixes for FreeBSD. + +1.0.4 - 20121017 +================ + +Broker: +- Deal with poll() POLLIN/POLLOUT before POLL[RD]HUP to correctly handle the + case where a client sends data and immediately closes its socket. + +Library: +- Fix memory leak with messages of QoS=2. Fixes bug #1064981. +- Fix potential thread synchronisation problem with outgoing packets in the + Python module. Fixes bug #1064977. + +Clients: +- Fix "mosquitto_sub -l" incorrectly only sending one message per second. + +1.0.3 - 20120927 +================ + +Broker: +- Fix loading of psk files. +- Don't return an error when reloading config if an ACL file isn't defined. + This was preventing psk files being reloaded. +- Clarify meaning of $SYS/broker/clients/total in mosquitto(8) man page. +- Clarify meaning of $SYS/broker/messages/stored in mosquitto(8) man page. +- Fix non-retained message delivery when subscribing to #. +- Fix retained message delivery for subs to foo/# with retained messages at + foo. +- Include the filename in password/acl file loading errors. + +Library: +- Fix possible AttributeError when self._sock == None in Python module. +- Fix reconnecting after a timeout in Python module. +- Fix reconnecting when there were outgoing packets in the queue in the Python + module. +- Fix problem with mutex initialisation causing crashes on some Windows + installations. + +1.0.2 - 20120919 +================ + +Broker: +- If the broker was configured for persistence, a durable client had a + subscription to topics in $SYS/# and had messages in its queue when the + broker restarted, then the persistent database would have messages missing + and so the broker would not restart properly. This has been fixed. + +Library: +- Fix threading problem on some systems. + +Tests: +- Close socket after 08-ssl-connect-no-auth-wrong-ca.py test to prevent + subsequent tests having problems. + +Build scripts: +- Install pskfile.example in CMake. Fixes bug #1037504. + +Other: +- Fix db_dump parameter printing message store and sub chunks. + +1.0.1 - 20120815 +================ + +Broker: +- Fix default log_dest when running as a Windows service. + +Client library: +- Fix incorrect parameters in Python on_log() callback call. Fixes bug + #1036818. + +Clients: +- Clients now don't display TLS/TLS-PSK usage help if they don't support it. + +Build scripts: +- Fix TLS-PSK support in the CMake build files. +- Fix man page installation in the CMake build files. +- Fix SYSCONFDIR in cmake on *nix when installing to /usr. Fixes bug #1036908. + +Documentation: +- Fix mqtt/MQTT capitalisation in man pages. +- Update compiling.txt. +- Fix incorrect callback docs in mosquitto.py. Fixes bug #1036607. +- Fix various doc typos and remove obsolete script. Fixes bug #1037088. + +1.0 - 20120814 +============== + +Broker: + +- Add SSL/TLS support. +- Add TLS-PSK support, providing a simpler encryption method for constrained + devices. +- Passwords are now salted+hashed if compiled with WITH_TLS (recommended). +- Add mosquitto_passwd for handling password files. +- Add $SYS/broker/publish/messages/{sent|received} to show the number of + PUBLISH messages sent/received. +- Add $SYS/broker/publish/bytes/{sent|received} to show the number of + PUBLISH bytes sent/received. +- Add reload parameter for security init/cleanup functions. +- Add option for expiring disconnected persistent clients. +- Add option for queueing of QoS 0 messages when persistent clients are + disconnected. +- Enforce client id limits in the broker (only when WITH_STRICT_PROTOCOL is + defined). +- Fix reloading of log configuration. +- Add support for try_private config option for bridge connections. +- Add support for autosave_on_changes config option. +- Add support for include_dir config option. +- Add support for topic remapping. +- Usernames were being lost when a non clean-session client reconnected, + potentially causing problems with ACLs. This has been fixed. +- Significant improvement to memory handling on Windows. +- Bridges with outgoing topics will now set the retain flag correctly so that + messages will be retained on the remote broker. +- Incoming bridge connections are now detected by checking if bit 8 of the + protocol version number is set. This requires support from the remote broker. +- Add support for notification_topic option. +- Add $SYS/broker/subscriptions/count and $SYS/broker/retained messages/count. +- Add restart_timeout to control the amount of time an automatic bridge will + wait before reconnecting. +- Overlapping subscriptions are now handled properly. Fixes bug #928538. +- Fix reloading of persistence_file and persistence_location. +- Fix broker crash on incorrect protocol number. +- Fix missing COMPAT_ECONNRESET define on Windows. +- Clients that had disconnected were not always being detected immediately on + Linux. This has been fixed. +- Don't save $SYS messages to the on-disk persistent db. All $SYS messages + should be reconstructed on a restart. This means bridge connection + notifications will now be correct on a restart. +- Fix reloading of bridge clients from the persistent db. This means that + outgoing bridged topics should always work. +- Local bridges are now no longer restricted by local ACLs. +- Discard publish messages with zero length topics. +- Drop to "mosquitto" user even if no config file specified. +- Don't incorrectly allow topic access if ACL patterns but no normal ACL rules + are defined. + +Client library: + +- Add SSL/TLS support. +- Add TLS-PSK support, providing a simpler encryption method for constrained + devices. +- Add javascript/websockets client library. +- Add "struct mosquitto *mosq" parameter for all callbacks in the client + library. This is a binary incompatible change so the soversion of the + libraries has been incremented. The new parameter should make it easier to + use callbacks in practice. +- Add mosquitto_want_write() for use when using own select() loop with + mosquitto_socket(). +- Add mosquitto_connect_async() to provide a non-blocking connect client call. +- Add mosquitto_user_data_set() to allow user data pointer to be updated. +- Add "int rc" parameter to disconnect callback to indicate whether disconnect + was unexpected or the result of calling mosquitto_disconnect(). +- Add mosquitto_strerror() for obtaining a string description of error numbers. +- Add mosquitto_connack_string() for obtaining a string description of MQTT + connection results. +- Add mosquitto_will_clear() and change mosquitto_will_set() to only set the + will. +- Add mosquitto_sub_topic_tokenise() and mosquitto_sub_topic_tokens_free() + utility functions to tokenise a subscription/topic string into a string + array. +- Add mosquitto_topic_matches_sub() to check whether a topic matches a + subscription. +- Replaced mosquitto_log_init() with mosquitto_log_callback_set() to allow + clients to decide what to do with log messages. +- Client will now disconnect itself from the broker if it doesn't receive a + PINGRESP in the keepalive period after sending a PINGREQ. +- Client will now send a PINGREQ if it has not received a message from the + broker in keepalive seconds. +- mosquitto_new() will now generate a random client id if the id parameter is + NULL. +- Added max_packets to mosquitto_loop(), mosquitto_loop_read() and + mosquitto_loop_write() to control the maximum number of packets that are + handled per call. +- Payload parameters are now void * instead of uint8_t *. +- The clean_session parameter has been moved from mosquitto_connect() to + mosquitto_new() because it is a client parameter rather than a connection + parameter. +- Functions now use int instead of uint*_t where possible. +- mosquitto_new() now sets errno to indicate failure type. +- Return MOSQ_ERR_INVAL on zero length topic. +- Fix automatic client id generation on Windows. +- mosquitto_loop_misq() can now return MOSQ_ERR_NO_CONN. +- Compile static library as well as dynamic library with default makefiles. +- Rename C++ namespace from mosquittopp to mosqpp to remove ambiguity. +- C++ lib_init(), lib_version() and lib_cleanup() are now in the mosqpp + namespace directly, not mosquittopp class members. +- The Python library is now written in pure Python and so no longer depends on + libmosquitto. +- The Python library includes SSL/TLS support. +- The Python library should now be compatible with Python 3. + +Other: + +- Fix db_dump reading of retained messages. +- Add example of logging all messages to mysql. +- Add C++ client example. +- Fix potential buffer overflow in pub/sub clients. +- Add "make binary" target that doesn't make documents. +- Add "--help" arguments to pub/sub clients. +- Fix building on Solaris. + +0.15 - 20120205 +=============== + +- Add support for $SYS/broker/clients/maximum and $SYS/broker/clients/active + topics. +- Add support for $SYS messages/byte per second received/sent topics. +- Updated mosquitto man page - $SYS hierarchy and signal support were out of + date. +- Auto generated pub/sub client ids now include the hostname. +- Tool for dumping persistent DB contents is available in src/db_dump. It isn't + installed by default. +- Enforce topic length checks in client library. +- Implement "once" and "lazy" bridge start types. +- Add new return type MOSQ_ERR_ERRNO to indicate that the errno variable should + be checked for the real error code. +- Add support for connection_messages config option. +- mosquitto_sub will now refuse to run if the -c option (disable clean session) + is given and no client id is provided. +- mosquitto_pub now gives more useful error messages on invalid input or other + error conditions. +- Fix Python will_set() true/True typo. +- Fix messages to topic "a/b" incorrectly matching on a subscription "a" if + another subscription "a/#" exists. + +0.14.4 - 20120106 +================= + +- Fix local bridge notification messages. +- Fix return values for more internal library calls. +- Fix incorrect out of memory checks in library and broker. +- Never time out local bridge connections. + +0.14.3 - 20111210 +================= + +- Fix potential crash when client connects with an invalid CONNECT packet. +- Fix incorrect invalid socket comparison on Windows. +- Server shouldn't crash when a message is published to foo/ when a + subscription to foo/# exists (bug #901697). +- SO_REUSEADDR doesn't work the same on Windows, so don't use it. +- Cygwin builds now support Windows service features. +- Fix $SYS/broker/bytes/sent reporting. + +0.14.2 - 20111123 +================= + +- Add uninstall target for libs. +- Don't try to write packet whilst in a callback. + +0.14.1 - 20111117 +================= + +- Fix Python sytax errors (bug #891673). + +0.14 - 20111116 +=============== + +- Add support for matching ACLs based on client id and username. +- Add a Windows installer file (NSIS based). +- Add native support for running the broker as a Windows service. This is the + default when installed using the new installer. +- Fix client count for listeners. When clients disconnect, decrement the + count. Allow max_connections to work again. +- Attempt to send all packets immediately upon being queued. This will result + in more immediate network communication in many cases. +- Log IP address when reporting CONNACK packets if the client id isn't yet + known. +- Fix payload length calculation in python will_set function. +- Fix Python publish and will_set functions for payload=None. +- Fix keepalive value being lost when reconnecting a client (bug #880863). +- Persistence file writing now uses portable file functions, so the Cygwin + broker build should no longer be necessary. +- Duplicate code between the client and broker side has been reduced. +- Queued messages for clients reconnecting with clean_session=false set were + not being sent until the next message for that client was received. This has + been fixed (bug #890724). +- Fix subscriptions to # incorrectly matching against topics beginning with / + +0.13 - 20110920 +=============== + +- Implement bridge state notification messages. +- Save client last used mid in persistent database (DB version number bumped). +- Expose message id in Python MosquittoMessage. +- It is now possible to set the topic QoS level for bridges. +- Python MosquittoMessage payload parameter is now a Python string, not a + ctypes object which makes it much easier to use. +- Fix queueing of messages for disconnected clients. The max_queued_messages + option is now obeyed. +- C++ library is now in its own namespace, mosquittopp. +- Add support for adding log message timestamps in the broker. +- Fix missing mosquitto_username_pw_set() python binding. +- Fix keepalive timeout for reconnecting non clean-session clients. Prevents + immediate disconnection on reconnection. +- Fix subscription wildcard matching - a subscription of +/+ will now match + against /foo +- Fix subscription wildcard matching - a subscription of foo/# will now match + against foo +- When restoring persistent database, clients should be set to non + clean-session or their subscriptions will be immediately removed. +- Fix SUBACK payload for multiple topic subscriptions. +- Don't send retained messages when a client subscribes to a topic it is + already subscribed to. + +0.12 - 20110725 +=============== + +- Reload (most) configuration on SIGHUP. +- Memory tracking is no longer compiled in the client library. +- Add --help option to mosquitto to display usage. +- Add --id-prefix option to clients to allow easier use with brokers that are + using the clientid_prefix option. +- Fix compilation on QNX. +- Add -P as a synonym argument for --pw in the clients. +- Fix python MosquittoMessage payload parameter. This is now returned as a + pointer to an array of c_uint8 values so binary data is handled correctly. + If a string is needed, use msg.payload_str +- Fix memory leaks on client authentication. +- If password_file is not defined then clients can now connect even if they + use a username/password. +- Add mosquitto_reconnect() to the client library. +- Add option for compiling with liberal protocol compliance support (enabled + by default). +- Fix problems with clients reconnecting and old messages remaining in the + message store. +- Display both ip and client id in the log message when a client connects. + Change the socket connection message to make it more obvious that it is just + a socket connection being made (bug #801135). +- Fix retained message delivery where a subscription contains a +. +- Be more lenient when reloading persistent database to reduce errors with + empty retained messages. + +0.11.3 - 20110707 +================= + +- Don't complain and quit if persistence_file option is given (bug #802423). +- Initialise listeners correctly when clients with duplicate client ids + connect. Bug #801678. +- Memory tracking is now disabled for Symbian builds due to lack of malloc.h. +- Fix memory tracking compilation for kFreeBSD. +- Python callbacks can now be used with class member functions. +- Fix persistent database writing of client message chunks which caused + errors when restoring (bug #798164). + +0.11.2 - 20110626 +================= + +- Don't free contexts in mqtt3_context_disconnect() (bug #799688 / #801678). +- Only free will if present when freeing a client context. + +0.11.1 - 20110620 +================= + +- Fix buffer overrun when checking for + and # in topics (bug #799688). +- Pub client now quits if publish fails. + +0.11 - 20110619 +=============== + +- Removed all old sqlite code. +- Remove client id limit in clients. +- Implemented $SYS/broker/heap/maximum size +- Implemented $SYS/broker/clients/inactive to show the number of disconnected + non-clean session clients. +- $SYS/broker/heap/current size and maximum size messages now include "bytes" + to match rsmb message format. +- Implemented the retained_persistence config file option - a synonym of the + "persistence" option. +- Added security_external.c to broker source to make it easier for third + parties to add support for their existing username/password and ACL database + for security checks. See external_security_checks.txt. +- $SYS messages are now only republished when their value changes. +- Windows native broker now responds to command line arguments. +- Simplify client disconnecting so wills gets sent in all cases (bug #792468). +- Clients now have a --quiet option. +- The on_disconnect() callback will always be called now, even if the client + has disconnected unexpectedly. +- Always close persistent DB file after restoring. +- Return error code when exiting the clients. +- mosquitto_publish() now returns MOSQ_ERR_INVAL if the topic contains + or # +- mosquitto now silently rejects published messages with + or # in the topic. +- max_connections is now a per-listener setting instead of global. +- Connection count is now reduced when clients disconnect (bug #797983). + +0.10.2 - 20110106 +================= + +- Don't abort when connecting if the first connection fails. This is important + on e.g. Windows 7, where IPV6 is offered as the first choice but may not be + available. +- Deal with long logging messages properly (bug #785882). +- Fix library compilation on Symbian - no pselect() available. +- Don't stop processing subscriptions on received messages after a + subscription with # matches. (bug #791206). + +0.10.1 - 20110512 +================= + +- Fix Windows compilation. +- Fix mosquitto.py on Windows - call lib init/cleanup. +- Don't abort when connecting if given an unknown address type (assuming an + IPv4 or IPv6 address is given). + +0.10 - 20110429 +=============== + +- Implement support for the password_file option and accompanying + authentication requirements in the broker. +- Implement topic Access Control Lists. +- mosquitto_will_set() and mosquitto_publish() now return + MOSQ_ERR_PAYLOAD_SIZE if the payload is too large (>268,435,455 bytes). +- Bridge support can now be disabled at compile time. +- Group together network writes for outgoing packets - don't send single byte + writes! +- Add support for clientid_prefixes variable. +- Add support for the clientid config variable for controlling bridge client + ids. +- Remove 32-bit database ID support because htobe64() no longer used. +- Multiple client subscriptions to the same topic result in only a single + subscription. Bug #744077. + +0.9.3 - 20110310 +================ + +- Set retained message status for QoS 2 messages (bug #726535). +- Only abort with an error when opening listening sockets if no address family + is available, rather than aborting when any address family is not available. +- Don't clean queued messages when a non clean session client reconnects. +- Make mosquitto.py compatible with Python <2.6. +- Fix mosquitto.h header includes for Windows. + +0.9.2 - 20110208 +================ + +- Only send a single DISCONNECT command when using -l in the pub client. +- Set QoS=1 on PUBREL commands to meet protocol spec. +- Don't leak sockets on connection failure in the library. +- Install man pages when building under cmake. +- Fix crash bug on malformed CONNECT message. +- Clients are now rejected if their socket peer name cannot be obtained on + connection. +- Fix a number of potential problems caused when a client with a duplicate id + connects. +- Install mosquitto.conf under cmake. + +0.9.1 - 20101203 +================ + +- Add missing code for parsing the "bind_address" configuration option. +- Fix missing include when compiling with tcp-wrappers support. +- Add linker version script for C library to control exported functions. + +0.9 - 20101114 +============== + +- Client and message data is now stored in memory with custom routines rather + than a sqlite database. This removes the dependencies on sqlite, pcre and + sqlite3-pcre. It also means that the persistent database format has had to + be reimplemented in a custom format. Optional support for importing old + sqlite databases is provided. +- Added IPv6 support for mosquitto and the clients. +- Provide username and password support for the clients and client libraries. + This is part of the new MQTT v3.1 spec. +- The broker supports the username and password connection flags, but will not + do anything with the username and password. +- Python callback functions now optionally take an extra argument which will + return the user object passed to the Mosquitto() constructor, or the calling + python object itself if nothing was given to Mosquitto(). +- Remove the mosquitto command line option "-i interface". +- Remove the mosquitto.conf "interface" variable. +- Add support for the listener config variable (replaces the interface + variable) +- Add support for the bind_address config variable. +- Change the port config variable behaviour to match that of rsmb (applies to + the default listener only, can be given just once). +- Fix QoS 2 protocol compliance - stop sending duplicate messages and handle + timeouts correctly. Fixes bug #598290. +- Set retain flag correctly for outgoing messages. It should only be set for + messages sent in response to a subscribe command (ie. stale data). +- Fix bug in returning correct CONNACK result to on_connect client callback. +- Don't send client will if it is disconnected for exceeding its keepalive + timer. +- Fix client library unsubscribe function incorrectly sending a SUBSCRIBE + command when it should be UNSUBSCRIBE. +- Fix max_inflight_messages and max_queued_messages operation. These + parameters now apply only to QoS 1 and 2 messages and are used regardless of + the client connection state. +- mosquitto.conf now installed to /etc/mosquitto/mosquitto.conf instead of + /etc/mosquitto.conf. The /etc/mosquitto/ directory will be used for password + and access control files in the future. +- Give the compile time option of using 32-bit integers for the database IDs + instead of 64-bit integers. This is useful where htobe64()/be64toh() are not + available or for embedded systems for example. +- The DUP bit is now set correctly when resending PUBREL messages. +- A port to Windows native has been partially completed. This currently drops a + number of features, including the ability to change configuration parameters + and persistent storage. + +0.8.3 - 20101004 +================ + +- Fix QoS 2 protocol compliance - stop sending duplicate messages and handle + timeouts correctly. Fixes bug #598290. (backported from future 0.9 code) + +0.8.2 - 20100815 +================ + +- Fix default loop() timeout value in mosquitto.py. Previous value was 0, + causing high cpu load. +- Fix message handling problem in client library when more than one message was + in the client queue. +- Fix the logic used to determine whether a QoS>0 message needs to be retried. +- Fix the Python sub.py example so that it quits on error. + +0.8.1 - 20100812 +================ + +- Improve python interface +- Fix incorrect return value from message delete function +- Use logging function to print error messages in clients. +- Fix python installation script DESTDIR. +- Fix library destination path for 64-bit machines. + +0.8 - 20100807 +============== + +- Topics starting with a / are treated as distinct to those not starting with + a /. For example, /topic/path is different to topic/path. This matches the + behaviour of rsmb. +- Correctly calculate the will QoS on a new client connection (bug #597451). +- Add "addresses" configuration file variable as an alias of "address", for + better rsmb compatibility. +- Bridge clean_session setting is now false, to give more sensible behaviour + and be more compatible with rsmb. +- Add cleansession variable for configuring bridges. +- Add keepalive_interval variable for bridges. +- Remove default topic subscription for mosquitto_sub because the old + behaviour was too confusing. +- Added a C client library, which the pub and sub clients now use. +- Added a C++ client library (bound to the C library). +- Added a Python client library (bound to the C library). +- Added CMake build scripts to allow the library and clients (not the broker) + to be compiled natively on Windows. + +0.7 - 20100615 +============== + +- mosquitto_pub can now send null (zero length) messages. +- Don't store QoS=0 messages for disconnected clients with subscriptions of + QoS>0. +- accept() all available sockets when new clients are connecting, rather than + just one. +- Add option to print debug messages in pub and sub clients. +- hg revision is now exported via $SYS/broker/changeset +- Send Will when client exceeds keepalive timer and is disconnected. +- Check to see if a client has a will before sending it. +- Correctly deal with clients connecting with the same id multiple times. +- Add compile time option to disable heap memory tracking. +- Use poll() instead of select() to allow >1024 clients. +- Implement max_connections. +- Run VACUUM on in-memory database on receiving SIGUSR2. +- Fix bridge keepalive timeouts and reconnects. +- Don't attempt to drop root privileges when running on Windows as this isn't + well supported (bug #586231). + +0.6.1 - 20100506 +================ + +- Fix DB auto upgrade for messages table. + +0.6 - 20100505 +============== + +- Basic support for connecting multiple MQTT brokers together (bridging). +- mosquitto_sub can now subscribe to multiple topics (limited to a global QoS). +- mosquitto_pub can now send a file as a message. +- mosquitto_pub can now read all of stdin and send it as a message. +- mosquitto_pub can now read stdin and send each line as a message. +- mosquitto will now correctly run VACUUM on the persistent database on exit. +- Implement a more efficient database design, so that only one copy of each + message is held in the database, rather than one per subscribed client. +- Add the store_cleanup_interval config option for dealing with the internal + message store. +- Add support for disabling "clean session" for the sub client. +- Add support for automatic upgrading of the mosquitto DB from v1 to v2. +- Add persistence_file config option to allow changing the filename of the + persistence database. This allows multiple mosquitto DBs to be stored in the + same location whilst keeping persistence_location compatible with rsmb. +- Don't store QoS=0 messages for disconnected clients. Fixes bug #572608. This + wasn't correctly fixed in version 0.5. +- Don't disconnect clients if they send a PUBLISH with zero length payload + (bug #573610). +- If a retained message is received with a zero length payload, the retained + message for that topic is deleted. +- Send through zero length messages. +- Produce a warning on unsupported rsmb options instead of quitting. +- Describe clean session flag in the mqtt man page. +- Implement the max_inflight_messages and max_queued_messages features in the + broker. + +0.5.4 - 20100311 +================ + +- Fix memory allocation in mqtt3_fix_sub_topic() (bug #531861). +- Remove accidental limit of 100 client connections. +- Fix mosquitto_pub handling of messages with QoS>0 (bug #537061). + +0.5.3 - 20100303 +================ + +- Will messages are now only sent when a client disconnects unexpectedly. +- Fix all incoming topics/subscriptions that start with a / or contain + multiple / in a row (//). +- Do actually disconnect client when it sends an empty subscription/topic string. +- Add missing $SYS/broker/clients/total to man page. + +0.5.2 - 20100302 +================ + +- Always update last backup time, so that the backup doesn't run every time + through the main loop once autosave_interval has been reached. +- Report $SYS/broker/uptime in the same format as rsmb. +- Make mandatory options obvious in usage output and man page of mosquitto_pub. + Fixes bug #529990. +- Treat subscriptions with a trailing slash correctly. This should fix bugs + #530369 and #530099. + +0.5.1 - 20100227 +================ + +- Must daemonise before pid file is written. + +0.5 - 20100227 +============== + +- No longer store QoS=0 messages for disconnected clients that do not have + clean start set. +- Rename msg_timeout option to retry_interval for better rsmb compatibility. +- Change persistence behaviour. The database is now stored in memory even if + persistence is enabled. It is written to disk when mosquitto exits and also at + periodic intervals as defined by the new autosave_interval option. +- The writing of the persistence database may be forced by sending mosquitto + the SIGUSR1 signal. +- Clients that do not send CONNECT as their first command are now + disconnected. +- Boolean configuration values may now be specified with true/false as well as + 1/0. +- Log message on CONNECT with invalid protocol or protocol version. +- Default sqlite3-pcre path on Linux is now /usr/lib/sqlite3/pcre.so to match + future sqlite3-pcre packages. +- Add mosquitto_sub and mosquitto_pub, simple clients for subscribe/publish. +- Add man pages for clients. +- Add general man page on mqtt. +- Root privileges are now dropped only after attempting to write a pid file + (if configured). This means that the pid file can be written to /var/run/ + directly and should fix bug #523183. + +0.4.2 - 20100203 +================ + +- Fix segfault on client connect with invalid protocol name/version. + +0.4.1 - 20100112 +=============== + +- Fix regex used for finding retained messages to send on new subscription. + +0.4 - 20100105 +============== + +- Added support for wildcard subscriptions using + and #. +- All network operations are now non-blocking and can cope with partial + packets, meaning that networking should be a lot more reliable. +- Total messsages/bytes sent/received are now available in $SYS. +- Improved logging information - use client ip address and id instead of + socket number. +- Broker build timestamp is available in $SYS. +- Keepalive==0 is now correctly treated as "never disconnect". +- Fixed manpage installation. +- Fixed incorrect $SYS hierarchy locations in documentation and code. +- Debug type log messages are no longer sent to "topics". +- Default logging destination no longer includes "topics" to prevent possible + error logging to the db before it is initialised. +- Periodic $SYS messages can now be disabled. +- stdout and stderr are flushed when logging to them to give more timely + updates. +- dup is now set correctly when resending messages. +- Database format bumped due to topic column naming fix. + +0.3 - 20091217 +============== + +- The port option in the configuration file and --port command line argument + may now be given any number of times to make mosquitto listen on multiple + sockets. +- Add new config file and command line option "interface" to specify an + interface to listen on, rather than all interfaces. +- Added host access control through tcp-wrappers support. +- Set SO_REUSEADDR on the listening socket so restart is much quicker. +- Added support for tracking current heap memory usage - this is published on + the topic "$SYS/broker/heap/current size" +- Added code for logging to stderr, stdout, syslog and topics. +- Added logging to numerous places - still plenty of scope for more. + +0.2 - 20091204 +============== + +- Replaced the command line option --foreground with --daemon, swapping the + default behaviour. +- Added the command line option --config-file, to specify a config file to + load. If this is not given, no config file is load and the default options + are used. +- Added the command line option --port for specifying the port to listen on. + This overrides values in the config file. +- Don't use persistence by default. +- Default behaviour is now more sane when run by a normal user with no command + line options (combination of above changes). +- Added option user to config file, defaulting to a value of mosquitto. If + this value isn't blank and mosquitto is started by root, then it will drop + privileges by changing to the user and its primary group. This replaces the + current behaviour of refusing to start if run by root. +- Fix non-persistent mode, which would never work in the previous release. +- Added information on default values of msg_timeout and sys_interval to the + mosquitto.conf man page. (closes bug #492045). diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/LICENSE.txt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/LICENSE.txt new file mode 100644 index 0000000..56bef4e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/LICENSE.txt @@ -0,0 +1,2 @@ +This project is dual licensed under the Eclipse Public License 1.0 and the +Eclipse Distribution License 1.0 as described in the epl-v10 and edl-v10 files. diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/Makefile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/Makefile new file mode 100644 index 0000000..40691a0 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/Makefile @@ -0,0 +1,130 @@ +include config.mk + +DIRS=lib client src +DOCDIRS=man +DISTDIRS=man +DISTFILES= \ + client/ \ + examples/ \ + installer/ \ + lib/ \ + logo/ \ + man/ \ + misc/ \ + security/ \ + service/ \ + src/ \ + test/ \ + \ + CMakeLists.txt \ + CONTRIBUTING.md \ + ChangeLog.txt \ + LICENSE.txt \ + Makefile \ + about.html \ + aclfile.example \ + compiling.txt \ + config.h \ + config.mk \ + edl-v10 \ + epl-v10 \ + libmosquitto.pc.in \ + libmosquittopp.pc.in \ + mosquitto.conf \ + notice.html \ + pskfile.example \ + pwfile.example \ + readme-windows.txt \ + readme.md + +.PHONY : all mosquitto api docs binary check clean reallyclean test install uninstall dist sign copy localdocker + +all : $(MAKE_ALL) + +api : + mkdir -p api p + naturaldocs -o HTML api -i lib -p p + rm -rf p + +docs : + set -e; for d in ${DOCDIRS}; do $(MAKE) -C $${d}; done + +binary : mosquitto + +mosquitto : +ifeq ($(UNAME),Darwin) + $(error Please compile using CMake on Mac OS X) +endif + + set -e; for d in ${DIRS}; do $(MAKE) -C $${d}; done + +clean : + set -e; for d in ${DIRS}; do $(MAKE) -C $${d} clean; done + set -e; for d in ${DOCDIRS}; do $(MAKE) -C $${d} clean; done + $(MAKE) -C test clean + +reallyclean : + set -e; for d in ${DIRS}; do $(MAKE) -C $${d} reallyclean; done + set -e; for d in ${DOCDIRS}; do $(MAKE) -C $${d} reallyclean; done + $(MAKE) -C test reallyclean + -rm -f *.orig + +check : test + +test : mosquitto + $(MAKE) -C test test + +ptest : mosquitto + $(MAKE) -C test ptest + +utest : mosquitto + $(MAKE) -C test utest + +install : mosquitto + set -e; for d in ${DIRS}; do $(MAKE) -C $${d} install; done +ifeq ($(WITH_DOCS),yes) + set -e; for d in ${DOCDIRS}; do $(MAKE) -C $${d} install; done +endif + $(INSTALL) -d "${DESTDIR}/etc/mosquitto" + $(INSTALL) -m 644 mosquitto.conf "${DESTDIR}/etc/mosquitto/mosquitto.conf.example" + $(INSTALL) -m 644 aclfile.example "${DESTDIR}/etc/mosquitto/aclfile.example" + $(INSTALL) -m 644 pwfile.example "${DESTDIR}/etc/mosquitto/pwfile.example" + $(INSTALL) -m 644 pskfile.example "${DESTDIR}/etc/mosquitto/pskfile.example" + +uninstall : + set -e; for d in ${DIRS}; do $(MAKE) -C $${d} uninstall; done + rm -f "${DESTDIR}/etc/mosquitto/mosquitto.conf.example" + rm -f "${DESTDIR}/etc/mosquitto/aclfile.example" + rm -f "${DESTDIR}/etc/mosquitto/pwfile.example" + rm -f "${DESTDIR}/etc/mosquitto/pskfile.example" + +dist : reallyclean + set -e; for d in ${DISTDIRS}; do $(MAKE) -C $${d} dist; done + + mkdir -p dist/mosquitto-${VERSION} + cp -r ${DISTFILES} dist/mosquitto-${VERSION}/ + cd dist; tar -zcf mosquitto-${VERSION}.tar.gz mosquitto-${VERSION}/ + +sign : dist + cd dist; gpg --detach-sign -a mosquitto-${VERSION}.tar.gz + +copy : sign + cd dist; scp mosquitto-${VERSION}.tar.gz mosquitto-${VERSION}.tar.gz.asc mosquitto:site/mosquitto.org/files/source/ + cd dist; scp *.html mosquitto:site/mosquitto.org/man/ + scp ChangeLog.txt mosquitto:site/mosquitto.org/ + +coverage : + lcov --capture --directory . --output-file coverage.info + genhtml coverage.info --output-directory out + +localdocker : reallyclean + set -e; for d in ${DISTDIRS}; do $(MAKE) -C $${d} dist; done + + rm -rf dockertmp/ + mkdir -p dockertmp/mosquitto-${VERSION} + cp -r ${DISTFILES} dockertmp/mosquitto-${VERSION}/ + cd dockertmp/; tar -zcf mosq.tar.gz mosquitto-${VERSION}/ + cp dockertmp/mosq.tar.gz docker/local + rm -rf dockertmp/ + cd docker/local && docker build . + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/about.html b/proj1_mqttd/mosquitto/mosquitto-1.6.3/about.html new file mode 100644 index 0000000..e9101a8 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/about.html @@ -0,0 +1,44 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p><em>May 8, 2014</em></p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL") and Eclipse Distribution License Version 1.0 ("EDL"). +A copy of the EPL is available at +<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> +and a copy of the EDL is available at +<a href="http://www.eclipse.org/org/documents/edl-v10.php">http://www.eclipse.org/org/documents/edl-v10.php</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + + + <h3>Third Party Content</h3> + <p>The Content includes items that have been sourced from third parties as set out below. If you + did not receive this Content directly from the Eclipse Foundation, the following is provided + for informational purposes only, and you should look to the Redistributor's license for + terms and conditions of use.</p> + + <h4>libwebsockets 2.4.2</h4> + <p>This project makes use of the libwebsockets library.</p> + <p>The use of libwebsockets is based on the terms and conditions of the + LGPL 2.1 with some specific exceptions. + <a href="https://github.com/warmcat/libwebsockets/blob/v2.4.2/LICENSE">https://github.com/warmcat/libwebsockets/blob/v2.4.2/LICENSE</a></p> + <p>When libwebsockets is distributed with the project, it is being used + subject to the Static Linking Exception (Section 2) of the License. As + a result, the content is not subject to the LGPL 2.1.</p> + +</body></html> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/aclfile.example b/proj1_mqttd/mosquitto/mosquitto-1.6.3/aclfile.example new file mode 100644 index 0000000..5c3f3ca --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/aclfile.example @@ -0,0 +1,9 @@ +# This affects access control for clients with no username. +topic read $SYS/# + +# This only affects clients with username "roger". +user roger +topic foo/bar + +# This affects all clients. +pattern write $SYS/broker/connection/%c/state diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/CMakeLists.txt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/CMakeLists.txt new file mode 100644 index 0000000..d928650 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/CMakeLists.txt @@ -0,0 +1,29 @@ +include_directories(${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/lib + ${STDBOOL_H_PATH} ${STDINT_H_PATH} ${PTHREAD_INCLUDE_DIR} + ${OPENSSL_INCLUDE_DIR}) +link_directories(${mosquitto_BINARY_DIR}/lib) + +set(shared_src client_shared.c client_shared.h client_props.c) + +if (WITH_SRV) + add_definitions("-DWITH_SRV") +endif (WITH_SRV) + +add_executable(mosquitto_pub pub_client.c pub_shared.c ${shared_src}) +add_executable(mosquitto_sub sub_client.c sub_client_output.c ${shared_src}) +add_executable(mosquitto_rr rr_client.c pub_shared.c sub_client_output.c ${shared_src}) + + +target_link_libraries(mosquitto_pub libmosquitto) +target_link_libraries(mosquitto_sub libmosquitto) +target_link_libraries(mosquitto_rr libmosquitto) + +if (QNX) + target_link_libraries(mosquitto_pub socket) + target_link_libraries(mosquitto_sub socket) + target_link_libraries(mosquitto_rr socket) +endif() + +install(TARGETS mosquitto_pub RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") +install(TARGETS mosquitto_sub RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") +install(TARGETS mosquitto_rr RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/Makefile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/Makefile new file mode 100644 index 0000000..54bb9ed --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/Makefile @@ -0,0 +1,82 @@ +include ../config.mk + +.PHONY: all install uninstall reallyclean clean static static_pub static_sub static_rr + +ifeq ($(WITH_SHARED_LIBRARIES),yes) +SHARED_DEP:=../lib/libmosquitto.so.${SOVERSION} +endif + +ifeq ($(WITH_SHARED_LIBRARIES),yes) +ALL_DEPS:= mosquitto_pub mosquitto_sub mosquitto_rr +else +ifeq ($(WITH_STATIC_LIBRARIES),yes) +ALL_DEPS:= static_pub static_sub static_rr +endif +endif + +all : ${ALL_DEPS} + +static : static_pub static_sub static_rr + # This makes mosquitto_pub/sub/rr versions that are statically linked with + # libmosquitto only. + +static_pub : pub_client.o pub_shared.o client_props.o client_shared.o ../lib/libmosquitto.a + ${CROSS_COMPILE}${CC} $^ -o mosquitto_pub ${CLIENT_LDFLAGS} ${STATIC_LIB_DEPS} + +static_sub : sub_client.o sub_client_output.o client_props.o client_shared.o ../lib/libmosquitto.a + ${CROSS_COMPILE}${CC} $^ -o mosquitto_sub ${CLIENT_LDFLAGS} ${STATIC_LIB_DEPS} + +static_rr : rr_client.o client_props.o client_shared.o pub_shared.o sub_client_output.o ../lib/libmosquitto.a + ${CROSS_COMPILE}${CC} $^ -o mosquitto_rr ${CLIENT_LDFLAGS} ${STATIC_LIB_DEPS} + +mosquitto_pub : pub_client.o pub_shared.o client_shared.o client_props.o + ${CROSS_COMPILE}${CC} $(CLIENT_LDFLAGS) $^ -o $@ $(CLIENT_LDADD) + +mosquitto_sub : sub_client.o sub_client_output.o client_shared.o client_props.o + ${CROSS_COMPILE}${CC} $(CLIENT_LDFLAGS) $^ -o $@ $(CLIENT_LDADD) + +mosquitto_rr : rr_client.o client_shared.o client_props.o pub_shared.o sub_client_output.o + ${CROSS_COMPILE}${CC} $(CLIENT_LDFLAGS) $^ -o $@ $(CLIENT_LDADD) + +pub_client.o : pub_client.c ${SHARED_DEP} + ${CROSS_COMPILE}${CC} $(CLIENT_CPPFLAGS) $(CLIENT_CFLAGS) -c $< -o $@ + +pub_shared.o : pub_shared.c ${SHARED_DEP} + ${CROSS_COMPILE}${CC} $(CLIENT_CPPFLAGS) $(CLIENT_CFLAGS) -c $< -o $@ + +sub_client.o : sub_client.c ${SHARED_DEP} + ${CROSS_COMPILE}${CC} $(CLIENT_CPPFLAGS) $(CLIENT_CFLAGS) -c $< -o $@ + +sub_client_output.o : sub_client_output.c ${SHARED_DEP} + ${CROSS_COMPILE}${CC} $(CLIENT_CPPFLAGS) $(CLIENT_CFLAGS) -c $< -o $@ + +rr_client.o : rr_client.c ${SHARED_DEP} + ${CROSS_COMPILE}${CC} $(CLIENT_CPPFLAGS) $(CLIENT_CFLAGS) -c $< -o $@ + +client_shared.o : client_shared.c client_shared.h + ${CROSS_COMPILE}${CC} $(CLIENT_CPPFLAGS) $(CLIENT_CFLAGS) -c $< -o $@ + +client_props.o : client_props.c client_shared.h + ${CROSS_COMPILE}${CC} $(CLIENT_CPPFLAGS) $(CLIENT_CFLAGS) -c $< -o $@ + +../lib/libmosquitto.so.${SOVERSION} : + $(MAKE) -C ../lib + +../lib/libmosquitto.a : + $(MAKE) -C ../lib libmosquitto.a + +install : all + $(INSTALL) -d "${DESTDIR}$(prefix)/bin" + $(INSTALL) ${STRIP_OPTS} mosquitto_pub "${DESTDIR}${prefix}/bin/mosquitto_pub" + $(INSTALL) ${STRIP_OPTS} mosquitto_sub "${DESTDIR}${prefix}/bin/mosquitto_sub" + $(INSTALL) ${STRIP_OPTS} mosquitto_rr "${DESTDIR}${prefix}/bin/mosquitto_rr" + +uninstall : + -rm -f "${DESTDIR}${prefix}/bin/mosquitto_pub" + -rm -f "${DESTDIR}${prefix}/bin/mosquitto_sub" + -rm -f "${DESTDIR}${prefix}/bin/mosquitto_rr" + +reallyclean : clean + +clean : + -rm -f *.o mosquitto_pub mosquitto_sub mosquitto_rr *.gcda *.gcno diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/client_props.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/client_props.c new file mode 100644 index 0000000..7415bc0 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/client_props.c @@ -0,0 +1,193 @@ +/* +Copyright (c) 2018 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#ifndef WIN32 +#include <unistd.h> +#include <strings.h> +#else +#include <process.h> +#include <winsock2.h> +#define snprintf sprintf_s +#define strncasecmp _strnicmp +#endif + +#include "mosquitto.h" +#include "mqtt_protocol.h" +#include "client_shared.h" + +enum prop_type +{ + PROP_TYPE_BYTE, + PROP_TYPE_INT16, + PROP_TYPE_INT32, + PROP_TYPE_BINARY, + PROP_TYPE_STRING, + PROP_TYPE_STRING_PAIR +}; + +/* This parses property inputs. It should work for any command type, but is limited at the moment. + * + * Format: + * + * command property value + * command property key value + * + * Example: + * + * publish message-expiry-interval 32 + * connect user-property key value + */ + +int cfg_parse_property(struct mosq_config *cfg, int argc, char *argv[], int *idx) +{ + char *cmdname = NULL, *propname = NULL; + char *key = NULL, *value = NULL; + int cmd, identifier, type; + mosquitto_property **proplist; + int rc; + + /* idx now points to "command" */ + if((*idx)+2 > argc-1){ + /* Not enough args */ + fprintf(stderr, "Error: --property argument given but not enough arguments specified.\n\n"); + return MOSQ_ERR_INVAL; + } + + cmdname = argv[*idx]; + if(mosquitto_string_to_command(cmdname, &cmd)){ + fprintf(stderr, "Error: Invalid command given in --property argument.\n\n"); + return MOSQ_ERR_INVAL; + } + + propname = argv[(*idx)+1]; + if(mosquitto_string_to_property_info(propname, &identifier, &type)){ + fprintf(stderr, "Error: Invalid property name given in --property argument.\n\n"); + return MOSQ_ERR_INVAL; + } + + if(mosquitto_property_check_command(cmd, identifier)){ + fprintf(stderr, "Error: %s property not allow for %s in --property argument.\n\n", propname, cmdname); + return MOSQ_ERR_INVAL; + } + + if(identifier == MQTT_PROP_USER_PROPERTY){ + if((*idx)+3 > argc-1){ + /* Not enough args */ + fprintf(stderr, "Error: --property argument given but not enough arguments specified.\n\n"); + return MOSQ_ERR_INVAL; + } + + key = argv[(*idx)+2]; + value = argv[(*idx)+3]; + (*idx) += 3; + }else{ + value = argv[(*idx)+2]; + (*idx) += 2; + } + + + switch(cmd){ + case CMD_CONNECT: + proplist = &cfg->connect_props; + break; + + case CMD_PUBLISH: + if(identifier == MQTT_PROP_TOPIC_ALIAS){ + cfg->have_topic_alias = true; + } + if(identifier == MQTT_PROP_SUBSCRIPTION_IDENTIFIER){ + fprintf(stderr, "Error: %s property not supported for %s in --property argument.\n\n", propname, cmdname); + return MOSQ_ERR_INVAL; + } + proplist = &cfg->publish_props; + break; + + case CMD_SUBSCRIBE: + if(identifier != MQTT_PROP_SUBSCRIPTION_IDENTIFIER && identifier != MQTT_PROP_USER_PROPERTY){ + fprintf(stderr, "Error: %s property not supported for %s in --property argument.\n\n", propname, cmdname); + return MOSQ_ERR_NOT_SUPPORTED; + } + proplist = &cfg->subscribe_props; + break; + + case CMD_UNSUBSCRIBE: + proplist = &cfg->unsubscribe_props; + break; + + case CMD_DISCONNECT: + proplist = &cfg->disconnect_props; + break; + + case CMD_AUTH: + fprintf(stderr, "Error: %s property not supported for %s in --property argument.\n\n", propname, cmdname); + return MOSQ_ERR_NOT_SUPPORTED; + + case CMD_WILL: + proplist = &cfg->will_props; + break; + + case CMD_PUBACK: + case CMD_PUBREC: + case CMD_PUBREL: + case CMD_PUBCOMP: + case CMD_SUBACK: + case CMD_UNSUBACK: + fprintf(stderr, "Error: %s property not supported for %s in --property argument.\n\n", propname, cmdname); + return MOSQ_ERR_NOT_SUPPORTED; + + default: + return MOSQ_ERR_INVAL; + } + + switch(type){ + case MQTT_PROP_TYPE_BYTE: + rc = mosquitto_property_add_byte(proplist, identifier, atoi(value)); + break; + case MQTT_PROP_TYPE_INT16: + rc = mosquitto_property_add_int16(proplist, identifier, atoi(value)); + break; + case MQTT_PROP_TYPE_INT32: + rc = mosquitto_property_add_int32(proplist, identifier, atoi(value)); + break; + case MQTT_PROP_TYPE_VARINT: + rc = mosquitto_property_add_varint(proplist, identifier, atoi(value)); + break; + case MQTT_PROP_TYPE_BINARY: + rc = mosquitto_property_add_binary(proplist, identifier, value, strlen(value)); + break; + case MQTT_PROP_TYPE_STRING: + rc = mosquitto_property_add_string(proplist, identifier, value); + break; + case MQTT_PROP_TYPE_STRING_PAIR: + rc = mosquitto_property_add_string_pair(proplist, identifier, key, value); + break; + default: + return MOSQ_ERR_INVAL; + } + if(rc){ + fprintf(stderr, "Error adding property %s %d\n", propname, type); + return rc; + } + return MOSQ_ERR_SUCCESS; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/client_props.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/client_props.o new file mode 100644 index 0000000..5cbfad8 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/client_props.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/client_shared.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/client_shared.c new file mode 100644 index 0000000..7d3ba77 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/client_shared.c @@ -0,0 +1,1449 @@ +/* +Copyright (c) 2014-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <errno.h> +#include <fcntl.h> +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#ifndef WIN32 +#include <unistd.h> +#include <strings.h> +#else +#include <process.h> +#include <winsock2.h> +#define snprintf sprintf_s +#define strncasecmp _strnicmp +#endif + +#include <mosquitto.h> +#include <mqtt_protocol.h> +#include "client_shared.h" + +#ifdef WITH_SOCKS +static int mosquitto__parse_socks_url(struct mosq_config *cfg, char *url); +#endif +static int client_config_line_proc(struct mosq_config *cfg, int pub_or_sub, int argc, char *argv[]); + + +static int check_format(const char *str) +{ + int i; + int len; + + len = strlen(str); + for(i=0; i<len; i++){ + if(str[i] == '%'){ + if(i == len-1){ + // error + fprintf(stderr, "Error: Incomplete format specifier.\n"); + return 1; + }else{ + if(str[i+1] == '%'){ + // Print %, ignore + }else if(str[i+1] == 'I'){ + // ISO 8601 date+time + }else if(str[i+1] == 'l'){ + // payload length + }else if(str[i+1] == 'm'){ + // mid + }else if(str[i+1] == 'p'){ + // payload + }else if(str[i+1] == 'q'){ + // qos + }else if(str[i+1] == 'r'){ + // retain + }else if(str[i+1] == 't'){ + // topic + }else if(str[i+1] == 'j'){ + // JSON output, escaped payload + }else if(str[i+1] == 'J'){ + // JSON output, assuming JSON payload + }else if(str[i+1] == 'U'){ + // Unix time+nanoseconds + }else if(str[i+1] == 'x' || str[i+1] == 'X'){ + // payload in hex + }else{ + fprintf(stderr, "Error: Invalid format specifier '%c'.\n", str[i+1]); + return 1; + } + i++; + } + }else if(str[i] == '@'){ + if(i == len-1){ + // error + fprintf(stderr, "Error: Incomplete format specifier.\n"); + return 1; + } + i++; + }else if(str[i] == '\\'){ + if(i == len-1){ + // error + fprintf(stderr, "Error: Incomplete escape specifier.\n"); + return 1; + }else{ + switch(str[i+1]){ + case '\\': // '\' + case '0': // 0 (NULL) + case 'a': // alert + case 'e': // escape + case 'n': // new line + case 'r': // carriage return + case 't': // horizontal tab + case 'v': // vertical tab + break; + + default: + fprintf(stderr, "Error: Invalid escape specifier '%c'.\n", str[i+1]); + return 1; + } + i++; + } + } + } + + return 0; +} + + +void init_config(struct mosq_config *cfg, int pub_or_sub) +{ + memset(cfg, 0, sizeof(*cfg)); + cfg->port = -1; + cfg->max_inflight = 20; + cfg->keepalive = 60; + cfg->clean_session = true; + cfg->eol = true; + cfg->repeat_count = 1; + cfg->repeat_delay.tv_sec = 0; + cfg->repeat_delay.tv_usec = 0; + if(pub_or_sub == CLIENT_RR){ + cfg->protocol_version = MQTT_PROTOCOL_V5; + cfg->msg_count = 1; + }else{ + cfg->protocol_version = MQTT_PROTOCOL_V311; + } +} + +void client_config_cleanup(struct mosq_config *cfg) +{ + int i; + free(cfg->id); + free(cfg->id_prefix); + free(cfg->host); + free(cfg->file_input); + free(cfg->message); + free(cfg->topic); + free(cfg->bind_address); + free(cfg->username); + free(cfg->password); + free(cfg->will_topic); + free(cfg->will_payload); + free(cfg->format); + free(cfg->response_topic); +#ifdef WITH_TLS + free(cfg->cafile); + free(cfg->capath); + free(cfg->certfile); + free(cfg->keyfile); + free(cfg->ciphers); + free(cfg->tls_alpn); + free(cfg->tls_version); + free(cfg->tls_engine); + free(cfg->tls_engine_kpass_sha1); + free(cfg->keyform); +# ifdef FINAL_WITH_TLS_PSK + free(cfg->psk); + free(cfg->psk_identity); +# endif +#endif + if(cfg->topics){ + for(i=0; i<cfg->topic_count; i++){ + free(cfg->topics[i]); + } + free(cfg->topics); + } + if(cfg->filter_outs){ + for(i=0; i<cfg->filter_out_count; i++){ + free(cfg->filter_outs[i]); + } + free(cfg->filter_outs); + } + if(cfg->unsub_topics){ + for(i=0; i<cfg->unsub_topic_count; i++){ + free(cfg->unsub_topics[i]); + } + free(cfg->unsub_topics); + } +#ifdef WITH_SOCKS + free(cfg->socks5_host); + free(cfg->socks5_username); + free(cfg->socks5_password); +#endif + mosquitto_property_free_all(&cfg->connect_props); + mosquitto_property_free_all(&cfg->publish_props); + mosquitto_property_free_all(&cfg->subscribe_props); + mosquitto_property_free_all(&cfg->unsubscribe_props); + mosquitto_property_free_all(&cfg->disconnect_props); + mosquitto_property_free_all(&cfg->will_props); +} + +int client_config_load(struct mosq_config *cfg, int pub_or_sub, int argc, char *argv[]) +{ + int rc; + FILE *fptr; + char line[1024]; + int count; + char *loc = NULL; + int len; + char *args[3]; + +#ifndef WIN32 + char *env; +#else + char env[1024]; +#endif + args[0] = NULL; + + init_config(cfg, pub_or_sub); + + /* Default config file */ +#ifndef WIN32 + env = getenv("XDG_CONFIG_HOME"); + if(env){ + len = strlen(env) + strlen("/mosquitto_pub") + 1; + loc = malloc(len); + if(!loc){ + err_printf(cfg, "Error: Out of memory.\n"); + return 1; + } + if(pub_or_sub == CLIENT_PUB){ + snprintf(loc, len, "%s/mosquitto_pub", env); + }else if(pub_or_sub == CLIENT_SUB){ + snprintf(loc, len, "%s/mosquitto_sub", env); + }else{ + snprintf(loc, len, "%s/mosquitto_rr", env); + } + loc[len-1] = '\0'; + }else{ + env = getenv("HOME"); + if(env){ + len = strlen(env) + strlen("/.config/mosquitto_pub") + 1; + loc = malloc(len); + if(!loc){ + err_printf(cfg, "Error: Out of memory.\n"); + return 1; + } + if(pub_or_sub == CLIENT_PUB){ + snprintf(loc, len, "%s/.config/mosquitto_pub", env); + }else if(pub_or_sub == CLIENT_SUB){ + snprintf(loc, len, "%s/.config/mosquitto_sub", env); + }else{ + snprintf(loc, len, "%s/.config/mosquitto_rr", env); + } + loc[len-1] = '\0'; + } + } + +#else + rc = GetEnvironmentVariable("USERPROFILE", env, 1024); + if(rc > 0 && rc < 1024){ + len = strlen(env) + strlen("\\mosquitto_pub.conf") + 1; + loc = malloc(len); + if(!loc){ + err_printf(cfg, "Error: Out of memory.\n"); + return 1; + } + if(pub_or_sub == CLIENT_PUB){ + snprintf(loc, len, "%s\\mosquitto_pub.conf", env); + }else if(pub_or_sub == CLIENT_SUB){ + snprintf(loc, len, "%s\\mosquitto_sub.conf", env); + }else{ + snprintf(loc, len, "%s\\mosquitto_rr.conf", env); + } + loc[len-1] = '\0'; + } +#endif + + if(loc){ + fptr = fopen(loc, "rt"); + if(fptr){ + while(fgets(line, 1024, fptr)){ + if(line[0] == '#') continue; /* Comments */ + + while(line[strlen(line)-1] == 10 || line[strlen(line)-1] == 13){ + line[strlen(line)-1] = 0; + } + /* All offset by one "args" here, because real argc/argv has + * program name as the first entry. */ + args[1] = strtok(line, " "); + if(args[1]){ + args[2] = strtok(NULL, " "); + if(args[2]){ + count = 3; + }else{ + count = 2; + } + rc = client_config_line_proc(cfg, pub_or_sub, count, args); + if(rc){ + fclose(fptr); + free(loc); + return rc; + } + } + } + fclose(fptr); + } + free(loc); + } + + /* Deal with real argc/argv */ + rc = client_config_line_proc(cfg, pub_or_sub, argc, argv); + if(rc) return rc; + + if(cfg->will_payload && !cfg->will_topic){ + fprintf(stderr, "Error: Will payload given, but no will topic given.\n"); + return 1; + } + if(cfg->will_retain && !cfg->will_topic){ + fprintf(stderr, "Error: Will retain given, but no will topic given.\n"); + return 1; + } +#ifdef WITH_TLS + if((cfg->certfile && !cfg->keyfile) || (cfg->keyfile && !cfg->certfile)){ + fprintf(stderr, "Error: Both certfile and keyfile must be provided if one of them is set.\n"); + return 1; + } + if((cfg->keyform && !cfg->keyfile)){ + fprintf(stderr, "Error: If keyform is set, keyfile must be also specified.\n"); + return 1; + } + if((cfg->tls_engine_kpass_sha1 && (!cfg->keyform || !cfg->tls_engine))){ + fprintf(stderr, "Error: when using tls-engine-kpass-sha1, both tls-engine and keyform must also be provided.\n"); + return 1; + } +#endif +#ifdef FINAL_WITH_TLS_PSK + if((cfg->cafile || cfg->capath) && cfg->psk){ + fprintf(stderr, "Error: Only one of --psk or --cafile/--capath may be used at once.\n"); + return 1; + } + if(cfg->psk && !cfg->psk_identity){ + fprintf(stderr, "Error: --psk-identity required if --psk used.\n"); + return 1; + } +#endif + + if(cfg->clean_session == false && (cfg->id_prefix || !cfg->id)){ + fprintf(stderr, "Error: You must provide a client id if you are using the -c option.\n"); + return 1; + } + + if(pub_or_sub == CLIENT_SUB){ + if(cfg->topic_count == 0){ + fprintf(stderr, "Error: You must specify a topic to subscribe to.\n"); + return 1; + } + } + + if(!cfg->host){ + cfg->host = strdup("localhost"); + if(!cfg->host){ + err_printf(cfg, "Error: Out of memory.\n"); + return 1; + } + } + + rc = mosquitto_property_check_all(CMD_CONNECT, cfg->connect_props); + if(rc){ + err_printf(cfg, "Error in CONNECT properties: %s\n", mosquitto_strerror(rc)); + return 1; + } + rc = mosquitto_property_check_all(CMD_PUBLISH, cfg->publish_props); + if(rc){ + err_printf(cfg, "Error in PUBLISH properties: %s\n", mosquitto_strerror(rc)); + return 1; + } + rc = mosquitto_property_check_all(CMD_SUBSCRIBE, cfg->subscribe_props); + if(rc){ + err_printf(cfg, "Error in SUBSCRIBE properties: %s\n", mosquitto_strerror(rc)); + return 1; + } + rc = mosquitto_property_check_all(CMD_UNSUBSCRIBE, cfg->unsubscribe_props); + if(rc){ + err_printf(cfg, "Error in UNSUBSCRIBE properties: %s\n", mosquitto_strerror(rc)); + return 1; + } + rc = mosquitto_property_check_all(CMD_DISCONNECT, cfg->disconnect_props); + if(rc){ + err_printf(cfg, "Error in DISCONNECT properties: %s\n", mosquitto_strerror(rc)); + return 1; + } + rc = mosquitto_property_check_all(CMD_WILL, cfg->will_props); + if(rc){ + err_printf(cfg, "Error in Will properties: %s\n", mosquitto_strerror(rc)); + return 1; + } + + return MOSQ_ERR_SUCCESS; +} + +int cfg_add_topic(struct mosq_config *cfg, int type, char *topic, const char *arg) +{ + if(mosquitto_validate_utf8(topic, strlen(topic))){ + fprintf(stderr, "Error: Malformed UTF-8 in %s argument.\n\n", arg); + return 1; + } + if(type == CLIENT_PUB || type == CLIENT_RR){ + if(mosquitto_pub_topic_check(topic) == MOSQ_ERR_INVAL){ + fprintf(stderr, "Error: Invalid publish topic '%s', does it contain '+' or '#'?\n", topic); + return 1; + } + cfg->topic = strdup(topic); + }else if(type == CLIENT_RESPONSE_TOPIC){ + if(mosquitto_pub_topic_check(topic) == MOSQ_ERR_INVAL){ + fprintf(stderr, "Error: Invalid response topic '%s', does it contain '+' or '#'?\n", topic); + return 1; + } + cfg->response_topic = strdup(topic); + }else{ + if(mosquitto_sub_topic_check(topic) == MOSQ_ERR_INVAL){ + fprintf(stderr, "Error: Invalid subscription topic '%s', are all '+' and '#' wildcards correct?\n", topic); + return 1; + } + cfg->topic_count++; + cfg->topics = realloc(cfg->topics, cfg->topic_count*sizeof(char *)); + if(!cfg->topics){ + err_printf(cfg, "Error: Out of memory.\n"); + return 1; + } + cfg->topics[cfg->topic_count-1] = strdup(topic); + } + return 0; +} + +/* Process a tokenised single line from a file or set of real argc/argv */ +int client_config_line_proc(struct mosq_config *cfg, int pub_or_sub, int argc, char *argv[]) +{ + int i; + float f; + + for(i=1; i<argc; i++){ + if(!strcmp(argv[i], "-A")){ + if(i==argc-1){ + fprintf(stderr, "Error: -A argument given but no address specified.\n\n"); + return 1; + }else{ + cfg->bind_address = strdup(argv[i+1]); + } + i++; +#ifdef WITH_TLS + }else if(!strcmp(argv[i], "--cafile")){ + if(i==argc-1){ + fprintf(stderr, "Error: --cafile argument given but no file specified.\n\n"); + return 1; + }else{ + cfg->cafile = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "--capath")){ + if(i==argc-1){ + fprintf(stderr, "Error: --capath argument given but no directory specified.\n\n"); + return 1; + }else{ + cfg->capath = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "--cert")){ + if(i==argc-1){ + fprintf(stderr, "Error: --cert argument given but no file specified.\n\n"); + return 1; + }else{ + cfg->certfile = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "--ciphers")){ + if(i==argc-1){ + fprintf(stderr, "Error: --ciphers argument given but no ciphers specified.\n\n"); + return 1; + }else{ + cfg->ciphers = strdup(argv[i+1]); + } + i++; +#endif + }else if(!strcmp(argv[i], "-C")){ + if(pub_or_sub != CLIENT_SUB){ + goto unknown_option; + }else{ + if(i==argc-1){ + fprintf(stderr, "Error: -C argument given but no count specified.\n\n"); + return 1; + }else{ + cfg->msg_count = atoi(argv[i+1]); + if(cfg->msg_count < 1){ + fprintf(stderr, "Error: Invalid message count \"%d\".\n\n", cfg->msg_count); + return 1; + } + } + i++; + } + }else if(!strcmp(argv[i], "-c") || !strcmp(argv[i], "--disable-clean-session")){ + cfg->clean_session = false; + }else if(!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")){ + cfg->debug = true; + }else if(!strcmp(argv[i], "-D") || !strcmp(argv[i], "--property")){ + i++; + if(cfg_parse_property(cfg, argc, argv, &i)){ + return 1; + } + cfg->protocol_version = MQTT_PROTOCOL_V5; + }else if(!strcmp(argv[i], "-e")){ + if(pub_or_sub != CLIENT_RR){ + goto unknown_option; + } + if(i==argc-1){ + fprintf(stderr, "Error: -e argument given but no response topic specified.\n\n"); + return 1; + }else{ + if(cfg_add_topic(cfg, CLIENT_RESPONSE_TOPIC, argv[i+1], "-e")){ + return 1; + } + } + i++; + }else if(!strcmp(argv[i], "-E")){ + if(pub_or_sub != CLIENT_SUB){ + goto unknown_option; + } + cfg->exit_after_sub = true; + }else if(!strcmp(argv[i], "-f") || !strcmp(argv[i], "--file")){ + if(pub_or_sub == CLIENT_SUB){ + goto unknown_option; + } + if(cfg->pub_mode != MSGMODE_NONE){ + fprintf(stderr, "Error: Only one type of message can be sent at once.\n\n"); + return 1; + }else if(i==argc-1){ + fprintf(stderr, "Error: -f argument given but no file specified.\n\n"); + return 1; + }else{ + cfg->pub_mode = MSGMODE_FILE; + cfg->file_input = strdup(argv[i+1]); + if(!cfg->file_input){ + err_printf(cfg, "Error: Out of memory.\n"); + return 1; + } + } + i++; + }else if(!strcmp(argv[i], "-F")){ + if(pub_or_sub == CLIENT_PUB){ + goto unknown_option; + } + if(i==argc-1){ + fprintf(stderr, "Error: -F argument given but no format specified.\n\n"); + return 1; + }else{ + cfg->format = strdup(argv[i+1]); + if(!cfg->format){ + fprintf(stderr, "Error: Out of memory.\n"); + return 1; + } + if(check_format(cfg->format)){ + return 1; + } + } + i++; + }else if(!strcmp(argv[i], "--help")){ + return 2; + }else if(!strcmp(argv[i], "-h") || !strcmp(argv[i], "--host")){ + if(i==argc-1){ + fprintf(stderr, "Error: -h argument given but no host specified.\n\n"); + return 1; + }else{ + cfg->host = strdup(argv[i+1]); + } + i++; +#ifdef WITH_TLS + }else if(!strcmp(argv[i], "--insecure")){ + cfg->insecure = true; +#endif + }else if(!strcmp(argv[i], "-i") || !strcmp(argv[i], "--id")){ + if(cfg->id_prefix){ + fprintf(stderr, "Error: -i and -I argument cannot be used together.\n\n"); + return 1; + } + if(i==argc-1){ + fprintf(stderr, "Error: -i argument given but no id specified.\n\n"); + return 1; + }else{ + cfg->id = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "-I") || !strcmp(argv[i], "--id-prefix")){ + if(cfg->id){ + fprintf(stderr, "Error: -i and -I argument cannot be used together.\n\n"); + return 1; + } + if(i==argc-1){ + fprintf(stderr, "Error: -I argument given but no id prefix specified.\n\n"); + return 1; + }else{ + cfg->id_prefix = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "-k") || !strcmp(argv[i], "--keepalive")){ + if(i==argc-1){ + fprintf(stderr, "Error: -k argument given but no keepalive specified.\n\n"); + return 1; + }else{ + cfg->keepalive = atoi(argv[i+1]); + if(cfg->keepalive>65535){ + fprintf(stderr, "Error: Invalid keepalive given: %d\n", cfg->keepalive); + return 1; + } + } + i++; +#ifdef WITH_TLS + }else if(!strcmp(argv[i], "--key")){ + if(i==argc-1){ + fprintf(stderr, "Error: --key argument given but no file specified.\n\n"); + return 1; + }else{ + cfg->keyfile = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "--keyform")){ + if(i==argc-1){ + fprintf(stderr, "Error: --keyform argument given but no keyform specified.\n\n"); + return 1; + }else{ + cfg->keyform = strdup(argv[i+1]); + } + i++; +#endif + }else if(!strcmp(argv[i], "-L") || !strcmp(argv[i], "--url")){ + if(i==argc-1){ + fprintf(stderr, "Error: -L argument given but no URL specified.\n\n"); + return 1; + } else { + char *url = argv[i+1]; + char *topic; + char *tmp; + + if(!strncasecmp(url, "mqtt://", 7)) { + url += 7; + cfg->port = 1883; + } else if(!strncasecmp(url, "mqtts://", 8)) { + url += 8; + cfg->port = 8883; + } else { + fprintf(stderr, "Error: unsupported URL scheme.\n\n"); + return 1; + } + topic = strchr(url, '/'); + if(!topic){ + fprintf(stderr, "Error: Invalid URL for -L argument specified - topic missing.\n"); + return 1; + } + *topic++ = 0; + + if(cfg_add_topic(cfg, pub_or_sub, topic, "-L topic")) + return 1; + + tmp = strchr(url, '@'); + if(tmp) { + *tmp++ = 0; + char *colon = strchr(url, ':'); + if(colon) { + *colon = 0; + cfg->password = strdup(colon + 1); + } + cfg->username = strdup(url); + url = tmp; + } + cfg->host = url; + + tmp = strchr(url, ':'); + if(tmp) { + *tmp++ = 0; + cfg->port = atoi(tmp); + } + /* Now we've removed the port, time to get the host on the heap */ + cfg->host = strdup(cfg->host); + } + i++; + }else if(!strcmp(argv[i], "-l") || !strcmp(argv[i], "--stdin-line")){ + if(pub_or_sub != CLIENT_PUB){ + goto unknown_option; + } + if(cfg->pub_mode != MSGMODE_NONE){ + fprintf(stderr, "Error: Only one type of message can be sent at once.\n\n"); + return 1; + }else{ + cfg->pub_mode = MSGMODE_STDIN_LINE; + } + }else if(!strcmp(argv[i], "-m") || !strcmp(argv[i], "--message")){ + if(pub_or_sub == CLIENT_SUB){ + goto unknown_option; + } + if(cfg->pub_mode != MSGMODE_NONE){ + fprintf(stderr, "Error: Only one type of message can be sent at once.\n\n"); + return 1; + }else if(i==argc-1){ + fprintf(stderr, "Error: -m argument given but no message specified.\n\n"); + return 1; + }else{ + cfg->message = strdup(argv[i+1]); + cfg->msglen = strlen(cfg->message); + cfg->pub_mode = MSGMODE_CMD; + } + i++; + }else if(!strcmp(argv[i], "-M")){ + if(i==argc-1){ + fprintf(stderr, "Error: -M argument given but max_inflight not specified.\n\n"); + return 1; + }else{ + cfg->max_inflight = atoi(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "-n") || !strcmp(argv[i], "--null-message")){ + if(pub_or_sub == CLIENT_SUB){ + goto unknown_option; + } + if(cfg->pub_mode != MSGMODE_NONE){ + fprintf(stderr, "Error: Only one type of message can be sent at once.\n\n"); + return 1; + }else{ + cfg->pub_mode = MSGMODE_NULL; + } + }else if(!strcmp(argv[i], "-N")){ + if(pub_or_sub == CLIENT_PUB){ + goto unknown_option; + } + cfg->eol = false; + }else if(!strcmp(argv[i], "-p") || !strcmp(argv[i], "--port")){ + if(i==argc-1){ + fprintf(stderr, "Error: -p argument given but no port specified.\n\n"); + return 1; + }else{ + cfg->port = atoi(argv[i+1]); + if(cfg->port<1 || cfg->port>65535){ + fprintf(stderr, "Error: Invalid port given: %d\n", cfg->port); + return 1; + } + } + i++; + }else if(!strcmp(argv[i], "-P") || !strcmp(argv[i], "--pw")){ + if(i==argc-1){ + fprintf(stderr, "Error: -P argument given but no password specified.\n\n"); + return 1; + }else{ + cfg->password = strdup(argv[i+1]); + } + i++; +#ifdef WITH_SOCKS + }else if(!strcmp(argv[i], "--proxy")){ + if(i==argc-1){ + fprintf(stderr, "Error: --proxy argument given but no proxy url specified.\n\n"); + return 1; + }else{ + if(mosquitto__parse_socks_url(cfg, argv[i+1])){ + return 1; + } + i++; + } +#endif +#ifdef FINAL_WITH_TLS_PSK + }else if(!strcmp(argv[i], "--psk")){ + if(i==argc-1){ + fprintf(stderr, "Error: --psk argument given but no key specified.\n\n"); + return 1; + }else{ + cfg->psk = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "--psk-identity")){ + if(i==argc-1){ + fprintf(stderr, "Error: --psk-identity argument given but no identity specified.\n\n"); + return 1; + }else{ + cfg->psk_identity = strdup(argv[i+1]); + } + i++; +#endif + }else if(!strcmp(argv[i], "-q") || !strcmp(argv[i], "--qos")){ + if(i==argc-1){ + fprintf(stderr, "Error: -q argument given but no QoS specified.\n\n"); + return 1; + }else{ + cfg->qos = atoi(argv[i+1]); + if(cfg->qos<0 || cfg->qos>2){ + fprintf(stderr, "Error: Invalid QoS given: %d\n", cfg->qos); + return 1; + } + } + i++; + }else if(!strcmp(argv[i], "--quiet")){ + cfg->quiet = true; + }else if(!strcmp(argv[i], "-r") || !strcmp(argv[i], "--retain")){ + if(pub_or_sub != CLIENT_PUB){ + goto unknown_option; + } + cfg->retain = 1; + }else if(!strcmp(argv[i], "-R")){ + if(pub_or_sub == CLIENT_PUB){ + goto unknown_option; + } + cfg->no_retain = true; + cfg->sub_opts |= MQTT_SUB_OPT_SEND_RETAIN_NEVER; + }else if(!strcmp(argv[i], "--remove-retained")){ + if(pub_or_sub != CLIENT_SUB){ + goto unknown_option; + } + cfg->remove_retained = true; + }else if(!strcmp(argv[i], "--repeat")){ + if(pub_or_sub != CLIENT_PUB){ + goto unknown_option; + } + if(i==argc-1){ + fprintf(stderr, "Error: --repeat argument given but no count specified.\n\n"); + return 1; + }else{ + cfg->repeat_count = atoi(argv[i+1]); + if(cfg->repeat_count < 1){ + fprintf(stderr, "Error: --repeat argument must be >0.\n\n"); + return 1; + } + } + i++; + }else if(!strcmp(argv[i], "--repeat-delay")){ + if(pub_or_sub != CLIENT_PUB){ + goto unknown_option; + } + if(i==argc-1){ + fprintf(stderr, "Error: --repeat-delay argument given but no time specified.\n\n"); + return 1; + }else{ + f = atof(argv[i+1]); + if(f < 0.0f){ + fprintf(stderr, "Error: --repeat-delay argument must be >=0.0.\n\n"); + return 1; + } + f *= 1.0e6; + cfg->repeat_delay.tv_sec = (int)f/1e6; + cfg->repeat_delay.tv_usec = (int)f%1000000; + } + i++; + }else if(!strcmp(argv[i], "--retain-as-published")){ + if(pub_or_sub == CLIENT_PUB){ + goto unknown_option; + } + cfg->sub_opts |= MQTT_SUB_OPT_RETAIN_AS_PUBLISHED; + }else if(!strcmp(argv[i], "--retained-only")){ + if(pub_or_sub != CLIENT_SUB){ + goto unknown_option; + } + cfg->retained_only = true; + }else if(!strcmp(argv[i], "-s") || !strcmp(argv[i], "--stdin-file")){ + if(pub_or_sub == CLIENT_SUB){ + goto unknown_option; + } + if(cfg->pub_mode != MSGMODE_NONE){ + fprintf(stderr, "Error: Only one type of message can be sent at once.\n\n"); + return 1; + }else{ + cfg->pub_mode = MSGMODE_STDIN_FILE; + } +#ifdef WITH_SRV + }else if(!strcmp(argv[i], "-S")){ + cfg->use_srv = true; +#endif + }else if(!strcmp(argv[i], "-t") || !strcmp(argv[i], "--topic")){ + if(i==argc-1){ + fprintf(stderr, "Error: -t argument given but no topic specified.\n\n"); + return 1; + }else{ + if(cfg_add_topic(cfg, pub_or_sub, argv[i + 1], "-t")) + return 1; + i++; + } + }else if(!strcmp(argv[i], "-T") || !strcmp(argv[i], "--filter-out")){ + if(pub_or_sub != CLIENT_SUB){ + goto unknown_option; + } + if(i==argc-1){ + fprintf(stderr, "Error: -T argument given but no topic filter specified.\n\n"); + return 1; + }else{ + if(mosquitto_validate_utf8(argv[i+1], strlen(argv[i+1]))){ + fprintf(stderr, "Error: Malformed UTF-8 in -T argument.\n\n"); + return 1; + } + if(mosquitto_sub_topic_check(argv[i+1]) == MOSQ_ERR_INVAL){ + fprintf(stderr, "Error: Invalid filter topic '%s', are all '+' and '#' wildcards correct?\n", argv[i+1]); + return 1; + } + cfg->filter_out_count++; + cfg->filter_outs = realloc(cfg->filter_outs, cfg->filter_out_count*sizeof(char *)); + if(!cfg->filter_outs){ + fprintf(stderr, "Error: Out of memory.\n"); + return 1; + } + cfg->filter_outs[cfg->filter_out_count-1] = strdup(argv[i+1]); + } + i++; +#ifdef WITH_TLS + }else if(!strcmp(argv[i], "--tls-alpn")){ + if(i==argc-1){ + fprintf(stderr, "Error: --tls-alpn argument given but no protocol specified.\n\n"); + return 1; + }else{ + cfg->tls_alpn = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "--tls-engine")){ + if(i==argc-1){ + fprintf(stderr, "Error: --tls-engine argument given but no engine_id specified.\n\n"); + return 1; + }else{ + cfg->tls_engine = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "--tls-engine-kpass-sha1")){ + if(i==argc-1){ + fprintf(stderr, "Error: --tls-engine-kpass-sha1 argument given but no kpass sha1 specified.\n\n"); + return 1; + }else{ + cfg->tls_engine_kpass_sha1 = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "--tls-version")){ + if(i==argc-1){ + fprintf(stderr, "Error: --tls-version argument given but no version specified.\n\n"); + return 1; + }else{ + cfg->tls_version = strdup(argv[i+1]); + } + i++; +#endif + }else if(!strcmp(argv[i], "-U") || !strcmp(argv[i], "--unsubscribe")){ + if(pub_or_sub != CLIENT_SUB){ + goto unknown_option; + } + if(i==argc-1){ + fprintf(stderr, "Error: -U argument given but no unsubscribe topic specified.\n\n"); + return 1; + }else{ + if(mosquitto_validate_utf8(argv[i+1], strlen(argv[i+1]))){ + fprintf(stderr, "Error: Malformed UTF-8 in -U argument.\n\n"); + return 1; + } + if(mosquitto_sub_topic_check(argv[i+1]) == MOSQ_ERR_INVAL){ + fprintf(stderr, "Error: Invalid unsubscribe topic '%s', are all '+' and '#' wildcards correct?\n", argv[i+1]); + return 1; + } + cfg->unsub_topic_count++; + cfg->unsub_topics = realloc(cfg->unsub_topics, cfg->unsub_topic_count*sizeof(char *)); + if(!cfg->unsub_topics){ + fprintf(stderr, "Error: Out of memory.\n"); + return 1; + } + cfg->unsub_topics[cfg->unsub_topic_count-1] = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "-u") || !strcmp(argv[i], "--username")){ + if(i==argc-1){ + fprintf(stderr, "Error: -u argument given but no username specified.\n\n"); + return 1; + }else{ + cfg->username = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "-V") || !strcmp(argv[i], "--protocol-version")){ + if(i==argc-1){ + fprintf(stderr, "Error: --protocol-version argument given but no version specified.\n\n"); + return 1; + }else{ + if(!strcmp(argv[i+1], "mqttv31") || !strcmp(argv[i+1], "31")){ + cfg->protocol_version = MQTT_PROTOCOL_V31; + }else if(!strcmp(argv[i+1], "mqttv311") || !strcmp(argv[i+1], "311")){ + cfg->protocol_version = MQTT_PROTOCOL_V311; + }else if(!strcmp(argv[i+1], "mqttv5") || !strcmp(argv[i+1], "5")){ + cfg->protocol_version = MQTT_PROTOCOL_V5; + }else{ + fprintf(stderr, "Error: Invalid protocol version argument given.\n\n"); + return 1; + } + i++; + } + }else if(!strcmp(argv[i], "-v") || !strcmp(argv[i], "--verbose")){ + if(pub_or_sub == CLIENT_PUB){ + goto unknown_option; + } + cfg->verbose = 1; + }else if(!strcmp(argv[i], "-W")){ + if(pub_or_sub == CLIENT_PUB){ + goto unknown_option; + }else{ + if(i==argc-1){ + fprintf(stderr, "Error: -W argument given but no timeout specified.\n\n"); + return 1; + }else{ + cfg->timeout = atoi(argv[i+1]); + if(cfg->timeout < 1){ + fprintf(stderr, "Error: Invalid timeout \"%d\".\n\n", cfg->msg_count); + return 1; + } + } + i++; + } + }else if(!strcmp(argv[i], "--will-payload")){ + if(i==argc-1){ + fprintf(stderr, "Error: --will-payload argument given but no will payload specified.\n\n"); + return 1; + }else{ + cfg->will_payload = strdup(argv[i+1]); + cfg->will_payloadlen = strlen(cfg->will_payload); + } + i++; + }else if(!strcmp(argv[i], "--will-qos")){ + if(i==argc-1){ + fprintf(stderr, "Error: --will-qos argument given but no will QoS specified.\n\n"); + return 1; + }else{ + cfg->will_qos = atoi(argv[i+1]); + if(cfg->will_qos < 0 || cfg->will_qos > 2){ + fprintf(stderr, "Error: Invalid will QoS %d.\n\n", cfg->will_qos); + return 1; + } + } + i++; + }else if(!strcmp(argv[i], "--will-retain")){ + cfg->will_retain = true; + }else if(!strcmp(argv[i], "--will-topic")){ + if(i==argc-1){ + fprintf(stderr, "Error: --will-topic argument given but no will topic specified.\n\n"); + return 1; + }else{ + if(mosquitto_validate_utf8(argv[i+1], strlen(argv[i+1]))){ + fprintf(stderr, "Error: Malformed UTF-8 in --will-topic argument.\n\n"); + return 1; + } + if(mosquitto_pub_topic_check(argv[i+1]) == MOSQ_ERR_INVAL){ + fprintf(stderr, "Error: Invalid will topic '%s', does it contain '+' or '#'?\n", argv[i+1]); + return 1; + } + cfg->will_topic = strdup(argv[i+1]); + } + i++; + }else{ + goto unknown_option; + } + } + + return MOSQ_ERR_SUCCESS; + +unknown_option: + fprintf(stderr, "Error: Unknown option '%s'.\n",argv[i]); + return 1; +} + +int client_opts_set(struct mosquitto *mosq, struct mosq_config *cfg) +{ +#if defined(WITH_TLS) || defined(WITH_SOCKS) + int rc; +#endif + + mosquitto_int_option(mosq, MOSQ_OPT_PROTOCOL_VERSION, cfg->protocol_version); + + if(cfg->will_topic && mosquitto_will_set_v5(mosq, cfg->will_topic, + cfg->will_payloadlen, cfg->will_payload, cfg->will_qos, + cfg->will_retain, cfg->will_props)){ + + err_printf(cfg, "Error: Problem setting will.\n"); + mosquitto_lib_cleanup(); + return 1; + } + cfg->will_props = NULL; + + if((cfg->username || cfg->password) && mosquitto_username_pw_set(mosq, cfg->username, cfg->password)){ + err_printf(cfg, "Error: Problem setting username and/or password.\n"); + mosquitto_lib_cleanup(); + return 1; + } +#ifdef WITH_TLS + if(cfg->cafile || cfg->capath){ + rc = mosquitto_tls_set(mosq, cfg->cafile, cfg->capath, cfg->certfile, cfg->keyfile, NULL); + if(rc){ + if(rc == MOSQ_ERR_INVAL){ + err_printf(cfg, "Error: Problem setting TLS options: File not found.\n"); + }else{ + err_printf(cfg, "Error: Problem setting TLS options: %s.\n", mosquitto_strerror(rc)); + } + mosquitto_lib_cleanup(); + return 1; + } + } + if(cfg->insecure && mosquitto_tls_insecure_set(mosq, true)){ + err_printf(cfg, "Error: Problem setting TLS insecure option.\n"); + mosquitto_lib_cleanup(); + return 1; + } + if(cfg->tls_engine && mosquitto_string_option(mosq, MOSQ_OPT_TLS_ENGINE, cfg->tls_engine)){ + err_printf(cfg, "Error: Problem setting TLS engine, is %s a valid engine?\n", cfg->tls_engine); + mosquitto_lib_cleanup(); + return 1; + } + if(cfg->keyform && mosquitto_string_option(mosq, MOSQ_OPT_TLS_KEYFORM, cfg->keyform)){ + err_printf(cfg, "Error: Problem setting key form, it must be one of 'pem' or 'engine'.\n"); + mosquitto_lib_cleanup(); + return 1; + } + if(cfg->tls_engine_kpass_sha1 && mosquitto_string_option(mosq, MOSQ_OPT_TLS_ENGINE_KPASS_SHA1, cfg->tls_engine_kpass_sha1)){ + err_printf(cfg, "Error: Problem setting TLS engine key pass sha, is it a 40 character hex string?\n"); + mosquitto_lib_cleanup(); + return 1; + } + if(cfg->tls_alpn && mosquitto_string_option(mosq, MOSQ_OPT_TLS_ALPN, cfg->tls_alpn)){ + err_printf(cfg, "Error: Problem setting TLS ALPN protocol.\n"); + mosquitto_lib_cleanup(); + return 1; + } +# ifdef FINAL_WITH_TLS_PSK + if(cfg->psk && mosquitto_tls_psk_set(mosq, cfg->psk, cfg->psk_identity, NULL)){ + err_printf(cfg, "Error: Problem setting TLS-PSK options.\n"); + mosquitto_lib_cleanup(); + return 1; + } +# endif + if((cfg->tls_version || cfg->ciphers) && mosquitto_tls_opts_set(mosq, 1, cfg->tls_version, cfg->ciphers)){ + err_printf(cfg, "Error: Problem setting TLS options, check the options are valid.\n"); + mosquitto_lib_cleanup(); + return 1; + } +#endif + mosquitto_max_inflight_messages_set(mosq, cfg->max_inflight); +#ifdef WITH_SOCKS + if(cfg->socks5_host){ + rc = mosquitto_socks5_set(mosq, cfg->socks5_host, cfg->socks5_port, cfg->socks5_username, cfg->socks5_password); + if(rc){ + mosquitto_lib_cleanup(); + return rc; + } + } +#endif + return MOSQ_ERR_SUCCESS; +} + +int client_id_generate(struct mosq_config *cfg) +{ + if(cfg->id_prefix){ + cfg->id = malloc(strlen(cfg->id_prefix)+10); + if(!cfg->id){ + err_printf(cfg, "Error: Out of memory.\n"); + mosquitto_lib_cleanup(); + return 1; + } + snprintf(cfg->id, strlen(cfg->id_prefix)+10, "%s%d", cfg->id_prefix, getpid()); + } + return MOSQ_ERR_SUCCESS; +} + +int client_connect(struct mosquitto *mosq, struct mosq_config *cfg) +{ +#ifndef WIN32 + char *err; +#else + char err[1024]; +#endif + int rc; + int port; + + if(cfg->port < 0){ +#ifdef WITH_TLS + if(cfg->cafile || cfg->capath +# ifdef FINAL_WITH_TLS_PSK + || cfg->psk +# endif + ){ + port = 8883; + }else +#endif + { + port = 1883; + } + }else{ + port = cfg->port; + } + +#ifdef WITH_SRV + if(cfg->use_srv){ + rc = mosquitto_connect_srv(mosq, cfg->host, cfg->keepalive, cfg->bind_address); + }else{ + rc = mosquitto_connect_bind_v5(mosq, cfg->host, port, cfg->keepalive, cfg->bind_address, cfg->connect_props); + } +#else + rc = mosquitto_connect_bind_v5(mosq, cfg->host, port, cfg->keepalive, cfg->bind_address, cfg->connect_props); +#endif + if(rc>0){ + if(rc == MOSQ_ERR_ERRNO){ +#ifndef WIN32 + err = strerror(errno); +#else + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, errno, 0, (LPTSTR)&err, 1024, NULL); +#endif + err_printf(cfg, "Error: %s\n", err); + }else{ + err_printf(cfg, "Unable to connect (%s).\n", mosquitto_strerror(rc)); + } + mosquitto_lib_cleanup(); + return rc; + } + return MOSQ_ERR_SUCCESS; +} + +#ifdef WITH_SOCKS +/* Convert %25 -> %, %3a, %3A -> :, %40 -> @ */ +static int mosquitto__urldecode(char *str) +{ + int i, j; + int len; + if(!str) return 0; + + if(!strchr(str, '%')) return 0; + + len = strlen(str); + for(i=0; i<len; i++){ + if(str[i] == '%'){ + if(i+2 >= len){ + return 1; + } + if(str[i+1] == '2' && str[i+2] == '5'){ + str[i] = '%'; + len -= 2; + for(j=i+1; j<len; j++){ + str[j] = str[j+2]; + } + str[j] = '\0'; + }else if(str[i+1] == '3' && (str[i+2] == 'A' || str[i+2] == 'a')){ + str[i] = ':'; + len -= 2; + for(j=i+1; j<len; j++){ + str[j] = str[j+2]; + } + str[j] = '\0'; + }else if(str[i+1] == '4' && str[i+2] == '0'){ + str[i] = ':'; + len -= 2; + for(j=i+1; j<len; j++){ + str[j] = str[j+2]; + } + str[j] = '\0'; + }else{ + return 1; + } + } + } + return 0; +} + +static int mosquitto__parse_socks_url(struct mosq_config *cfg, char *url) +{ + char *str; + size_t i; + char *username = NULL, *password = NULL, *host = NULL, *port = NULL; + char *username_or_host = NULL; + size_t start; + size_t len; + bool have_auth = false; + int port_int; + + if(!strncmp(url, "socks5h://", strlen("socks5h://"))){ + str = url + strlen("socks5h://"); + }else{ + err_printf(cfg, "Error: Unsupported proxy protocol: %s\n", url); + return 1; + } + + // socks5h://username:password@host:1883 + // socks5h://username:password@host + // socks5h://username@host:1883 + // socks5h://username@host + // socks5h://host:1883 + // socks5h://host + + start = 0; + for(i=0; i<strlen(str); i++){ + if(str[i] == ':'){ + if(i == start){ + goto cleanup; + } + if(have_auth){ + /* Have already seen a @ , so this must be of form + * socks5h://username[:password]@host:port */ + if(host){ + /* Already seen a host, must be malformed. */ + goto cleanup; + } + len = i-start; + host = malloc(len + 1); + if(!host){ + err_printf(cfg, "Error: Out of memory.\n"); + goto cleanup; + } + memcpy(host, &(str[start]), len); + host[len] = '\0'; + start = i+1; + }else if(!username_or_host){ + /* Haven't seen a @ before, so must be of form + * socks5h://host:port or + * socks5h://username:password@host[:port] */ + len = i-start; + username_or_host = malloc(len + 1); + if(!username_or_host){ + err_printf(cfg, "Error: Out of memory.\n"); + goto cleanup; + } + memcpy(username_or_host, &(str[start]), len); + username_or_host[len] = '\0'; + start = i+1; + } + }else if(str[i] == '@'){ + if(i == start){ + goto cleanup; + } + have_auth = true; + if(username_or_host){ + /* Must be of form socks5h://username:password@... */ + username = username_or_host; + username_or_host = NULL; + + len = i-start; + password = malloc(len + 1); + if(!password){ + err_printf(cfg, "Error: Out of memory.\n"); + goto cleanup; + } + memcpy(password, &(str[start]), len); + password[len] = '\0'; + start = i+1; + }else{ + /* Haven't seen a : yet, so must be of form + * socks5h://username@... */ + if(username){ + /* Already got a username, must be malformed. */ + goto cleanup; + } + len = i-start; + username = malloc(len + 1); + if(!username){ + err_printf(cfg, "Error: Out of memory.\n"); + goto cleanup; + } + memcpy(username, &(str[start]), len); + username[len] = '\0'; + start = i+1; + } + } + } + + /* Deal with remainder */ + if(i > start){ + len = i-start; + if(host){ + /* Have already seen a @ , so this must be of form + * socks5h://username[:password]@host:port */ + port = malloc(len + 1); + if(!port){ + err_printf(cfg, "Error: Out of memory.\n"); + goto cleanup; + } + memcpy(port, &(str[start]), len); + port[len] = '\0'; + }else if(username_or_host){ + /* Haven't seen a @ before, so must be of form + * socks5h://host:port */ + host = username_or_host; + username_or_host = NULL; + port = malloc(len + 1); + if(!port){ + err_printf(cfg, "Error: Out of memory.\n"); + goto cleanup; + } + memcpy(port, &(str[start]), len); + port[len] = '\0'; + }else{ + host = malloc(len + 1); + if(!host){ + err_printf(cfg, "Error: Out of memory.\n"); + goto cleanup; + } + memcpy(host, &(str[start]), len); + host[len] = '\0'; + } + } + + if(!host){ + err_printf(cfg, "Error: Invalid proxy.\n"); + goto cleanup; + } + + if(mosquitto__urldecode(username)){ + goto cleanup; + } + if(mosquitto__urldecode(password)){ + goto cleanup; + } + if(port){ + port_int = atoi(port); + if(port_int < 1 || port_int > 65535){ + err_printf(cfg, "Error: Invalid proxy port %d\n", port_int); + goto cleanup; + } + free(port); + }else{ + port_int = 1080; + } + + cfg->socks5_username = username; + cfg->socks5_password = password; + cfg->socks5_host = host; + cfg->socks5_port = port_int; + + return 0; +cleanup: + if(username_or_host) free(username_or_host); + if(username) free(username); + if(password) free(password); + if(host) free(host); + if(port) free(port); + return 1; +} +#endif + +void err_printf(const struct mosq_config *cfg, const char *fmt, ...) +{ + va_list va; + + if(cfg->quiet) return; + + va_start(va, fmt); + vfprintf(stderr, fmt, va); + va_end(va); +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/client_shared.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/client_shared.h new file mode 100644 index 0000000..232fa90 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/client_shared.h @@ -0,0 +1,131 @@ +/* +Copyright (c) 2014-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef CLIENT_CONFIG_H +#define CLIENT_CONFIG_H + +#include <stdio.h> + +#ifdef WIN32 +# include <winsock2.h> +#else +# include <sys/time.h> +#endif + +/* pub_client.c modes */ +#define MSGMODE_NONE 0 +#define MSGMODE_CMD 1 +#define MSGMODE_STDIN_LINE 2 +#define MSGMODE_STDIN_FILE 3 +#define MSGMODE_FILE 4 +#define MSGMODE_NULL 5 + +#define CLIENT_PUB 1 +#define CLIENT_SUB 2 +#define CLIENT_RR 3 +#define CLIENT_RESPONSE_TOPIC 4 + +struct mosq_config { + char *id; + char *id_prefix; + int protocol_version; + int keepalive; + char *host; + int port; + int qos; + bool retain; + int pub_mode; /* pub, rr */ + char *file_input; /* pub, rr */ + char *message; /* pub, rr */ + long msglen; /* pub, rr */ + char *topic; /* pub, rr */ + char *bind_address; + int repeat_count; /* pub */ + struct timeval repeat_delay; /* pub */ +#ifdef WITH_SRV + bool use_srv; +#endif + bool debug; + bool quiet; + unsigned int max_inflight; + char *username; + char *password; + char *will_topic; + char *will_payload; + long will_payloadlen; + int will_qos; + bool will_retain; +#ifdef WITH_TLS + char *cafile; + char *capath; + char *certfile; + char *keyfile; + char *ciphers; + bool insecure; + char *tls_alpn; + char *tls_version; + char *tls_engine; + char *tls_engine_kpass_sha1; + char *keyform; +# ifdef FINAL_WITH_TLS_PSK + char *psk; + char *psk_identity; +# endif +#endif + bool clean_session; + char **topics; /* sub */ + int topic_count; /* sub */ + bool exit_after_sub; /* sub */ + bool no_retain; /* sub */ + bool retained_only; /* sub */ + bool remove_retained; /* sub */ + char **filter_outs; /* sub */ + int filter_out_count; /* sub */ + char **unsub_topics; /* sub */ + int unsub_topic_count; /* sub */ + bool verbose; /* sub */ + bool eol; /* sub */ + int msg_count; /* sub */ + char *format; /* sub */ + int timeout; /* sub */ + int sub_opts; /* sub */ +#ifdef WITH_SOCKS + char *socks5_host; + int socks5_port; + char *socks5_username; + char *socks5_password; +#endif + mosquitto_property *connect_props; + mosquitto_property *publish_props; + mosquitto_property *subscribe_props; + mosquitto_property *unsubscribe_props; + mosquitto_property *disconnect_props; + mosquitto_property *will_props; + bool have_topic_alias; /* pub */ + char *response_topic; /* rr */ +}; + +int client_config_load(struct mosq_config *config, int pub_or_sub, int argc, char *argv[]); +void client_config_cleanup(struct mosq_config *cfg); +int client_opts_set(struct mosquitto *mosq, struct mosq_config *cfg); +int client_id_generate(struct mosq_config *cfg); +int client_connect(struct mosquitto *mosq, struct mosq_config *cfg); + +int cfg_parse_property(struct mosq_config *cfg, int argc, char *argv[], int *idx); + +void err_printf(const struct mosq_config *cfg, const char *fmt, ...); + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/client_shared.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/client_shared.o new file mode 100644 index 0000000..b40a43c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/client_shared.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_client.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_client.c new file mode 100644 index 0000000..3174039 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_client.c @@ -0,0 +1,537 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#ifndef WIN32 +#include <sys/time.h> +#include <time.h> +#else +#include <process.h> +#include <winsock2.h> +#define snprintf sprintf_s +#endif + +#include <mqtt_protocol.h> +#include <mosquitto.h> +#include "client_shared.h" +#include "pub_shared.h" + +/* Global variables for use in callbacks. See sub_client.c for an example of + * using a struct to hold variables for use in callbacks. */ +static bool first_publish = true; +static int last_mid = -1; +static int last_mid_sent = -1; +static char *line_buf = NULL; +static int line_buf_len = 1024; +static bool disconnect_sent = false; +static int publish_count = 0; +static bool ready_for_repeat = false; + +#ifdef WIN32 +static uint64_t next_publish_tv; + +static void set_repeat_time(void) +{ + uint64_t ticks = GetTickCount64(); + next_publish_tv = ticks + cfg.repeat_delay.tv_sec*1000 + cfg.repeat_delay.tv_usec/1000; +} + +static int check_repeat_time(void) +{ + uint64_t ticks = GetTickCount64(); + + if(ticks > next_publish_tv){ + return 1; + }else{ + return 0; + } +} +#else + +static struct timeval next_publish_tv; + +static void set_repeat_time(void) +{ + gettimeofday(&next_publish_tv, NULL); + next_publish_tv.tv_sec += cfg.repeat_delay.tv_sec; + next_publish_tv.tv_usec += cfg.repeat_delay.tv_usec; + + next_publish_tv.tv_sec += next_publish_tv.tv_usec/1e6; + next_publish_tv.tv_usec = next_publish_tv.tv_usec%1000000; +} + +static int check_repeat_time(void) +{ + struct timeval tv; + + gettimeofday(&tv, NULL); + + if(tv.tv_sec > next_publish_tv.tv_sec){ + return 1; + }else if(tv.tv_sec == next_publish_tv.tv_sec + && tv.tv_usec > next_publish_tv.tv_usec){ + + return 1; + } + return 0; +} +#endif + +void my_disconnect_callback(struct mosquitto *mosq, void *obj, int rc, const mosquitto_property *properties) +{ + UNUSED(mosq); + UNUSED(obj); + UNUSED(rc); + UNUSED(properties); + + status = STATUS_DISCONNECTED; +} + +int my_publish(struct mosquitto *mosq, int *mid, const char *topic, int payloadlen, void *payload, int qos, bool retain) +{ + ready_for_repeat = false; + if(cfg.protocol_version == MQTT_PROTOCOL_V5 && cfg.have_topic_alias && first_publish == false){ + return mosquitto_publish_v5(mosq, mid, NULL, payloadlen, payload, qos, retain, cfg.publish_props); + }else{ + first_publish = false; + return mosquitto_publish_v5(mosq, mid, topic, payloadlen, payload, qos, retain, cfg.publish_props); + } +} + + +void my_connect_callback(struct mosquitto *mosq, void *obj, int result, int flags, const mosquitto_property *properties) +{ + int rc = MOSQ_ERR_SUCCESS; + + UNUSED(obj); + UNUSED(flags); + UNUSED(properties); + + if(!result){ + switch(cfg.pub_mode){ + case MSGMODE_CMD: + case MSGMODE_FILE: + case MSGMODE_STDIN_FILE: + rc = my_publish(mosq, &mid_sent, cfg.topic, cfg.msglen, cfg.message, cfg.qos, cfg.retain); + break; + case MSGMODE_NULL: + rc = my_publish(mosq, &mid_sent, cfg.topic, 0, NULL, cfg.qos, cfg.retain); + break; + case MSGMODE_STDIN_LINE: + status = STATUS_CONNACK_RECVD; + break; + } + if(rc){ + switch(rc){ + case MOSQ_ERR_INVAL: + err_printf(&cfg, "Error: Invalid input. Does your topic contain '+' or '#'?\n"); + break; + case MOSQ_ERR_NOMEM: + err_printf(&cfg, "Error: Out of memory when trying to publish message.\n"); + break; + case MOSQ_ERR_NO_CONN: + err_printf(&cfg, "Error: Client not connected when trying to publish.\n"); + break; + case MOSQ_ERR_PROTOCOL: + err_printf(&cfg, "Error: Protocol error when communicating with broker.\n"); + break; + case MOSQ_ERR_PAYLOAD_SIZE: + err_printf(&cfg, "Error: Message payload is too large.\n"); + break; + case MOSQ_ERR_QOS_NOT_SUPPORTED: + err_printf(&cfg, "Error: Message QoS not supported on broker, try a lower QoS.\n"); + break; + } + mosquitto_disconnect_v5(mosq, 0, cfg.disconnect_props); + } + }else{ + if(result){ + if(cfg.protocol_version == MQTT_PROTOCOL_V5){ + err_printf(&cfg, "%s\n", mosquitto_reason_string(result)); + }else{ + err_printf(&cfg, "%s\n", mosquitto_connack_string(result)); + } + } + } +} + + +void my_publish_callback(struct mosquitto *mosq, void *obj, int mid, int reason_code, const mosquitto_property *properties) +{ + UNUSED(obj); + UNUSED(properties); + + last_mid_sent = mid; + if(reason_code > 127){ + err_printf(&cfg, "Warning: Publish %d failed: %s.\n", mid, mosquitto_reason_string(reason_code)); + } + publish_count++; + + if(cfg.pub_mode == MSGMODE_STDIN_LINE){ + if(mid == last_mid){ + mosquitto_disconnect_v5(mosq, 0, cfg.disconnect_props); + disconnect_sent = true; + } + }else if(publish_count < cfg.repeat_count){ + ready_for_repeat = true; + set_repeat_time(); + }else if(disconnect_sent == false){ + mosquitto_disconnect_v5(mosq, 0, cfg.disconnect_props); + disconnect_sent = true; + } +} + + +int pub_shared_init(void) +{ + line_buf = malloc(line_buf_len); + if(!line_buf){ + err_printf(&cfg, "Error: Out of memory.\n"); + return 1; + } + return 0; +} + + +int pub_shared_loop(struct mosquitto *mosq) +{ + int read_len; + int pos; + int rc, rc2; + char *buf2; + int buf_len_actual; + int mode; + int loop_delay = 1000; + bool stdin_finished = false; + + if(cfg.repeat_count > 1 && (cfg.repeat_delay.tv_sec == 0 || cfg.repeat_delay.tv_usec != 0)){ + loop_delay = cfg.repeat_delay.tv_usec / 2000; + } + + mode = cfg.pub_mode; + + if(mode == MSGMODE_STDIN_LINE){ + mosquitto_loop_start(mosq); + stdin_finished = false; + } + + do{ + if(mode == MSGMODE_STDIN_LINE){ + if(status == STATUS_CONNACK_RECVD){ + pos = 0; + read_len = line_buf_len; + while(status == STATUS_CONNACK_RECVD && fgets(&line_buf[pos], read_len, stdin)){ + buf_len_actual = strlen(line_buf); + if(line_buf[buf_len_actual-1] == '\n'){ + line_buf[buf_len_actual-1] = '\0'; + rc2 = my_publish(mosq, &mid_sent, cfg.topic, buf_len_actual-1, line_buf, cfg.qos, cfg.retain); + if(rc2){ + err_printf(&cfg, "Error: Publish returned %d, disconnecting.\n", rc2); + mosquitto_disconnect_v5(mosq, MQTT_RC_DISCONNECT_WITH_WILL_MSG, cfg.disconnect_props); + } + break; + }else{ + line_buf_len += 1024; + pos += 1023; + read_len = 1024; + buf2 = realloc(line_buf, line_buf_len); + if(!buf2){ + err_printf(&cfg, "Error: Out of memory.\n"); + return MOSQ_ERR_NOMEM; + } + line_buf = buf2; + } + } + if(feof(stdin)){ + if(mid_sent == -1){ + /* Empty file */ + mosquitto_disconnect_v5(mosq, 0, cfg.disconnect_props); + disconnect_sent = true; + status = STATUS_DISCONNECTING; + }else{ + last_mid = mid_sent; + status = STATUS_WAITING; + } + stdin_finished = true; + }else if(status == STATUS_DISCONNECTED){ + /* Not end of stdin, so we've lost our connection and must + * reconnect */ + } + }else if(status == STATUS_WAITING){ + if(last_mid_sent == last_mid && disconnect_sent == false){ + mosquitto_disconnect_v5(mosq, 0, cfg.disconnect_props); + disconnect_sent = true; + } +#ifdef WIN32 + Sleep(100); +#else + struct timespec ts; + ts.tv_sec = 0; + ts.tv_nsec = 100000000; + nanosleep(&ts, NULL); +#endif + } + rc = MOSQ_ERR_SUCCESS; + }else{ + rc = mosquitto_loop(mosq, loop_delay, 1); + if(ready_for_repeat && check_repeat_time()){ + rc = 0; + switch(cfg.pub_mode){ + case MSGMODE_CMD: + case MSGMODE_FILE: + case MSGMODE_STDIN_FILE: + rc = my_publish(mosq, &mid_sent, cfg.topic, cfg.msglen, cfg.message, cfg.qos, cfg.retain); + break; + case MSGMODE_NULL: + rc = my_publish(mosq, &mid_sent, cfg.topic, 0, NULL, cfg.qos, cfg.retain); + break; + case MSGMODE_STDIN_LINE: + break; + } + if(rc){ + err_printf(&cfg, "Error sending repeat publish: %s", mosquitto_strerror(rc)); + } + } + } + }while(rc == MOSQ_ERR_SUCCESS && stdin_finished == false); + + if(mode == MSGMODE_STDIN_LINE){ + mosquitto_loop_stop(mosq, false); + } + if(status == STATUS_DISCONNECTED){ + return MOSQ_ERR_SUCCESS; + }else{ + return rc; + } +} + + +void pub_shared_cleanup(void) +{ + free(line_buf); +} + + +void print_usage(void) +{ + int major, minor, revision; + + mosquitto_lib_version(&major, &minor, &revision); + printf("mosquitto_pub is a simple mqtt client that will publish a message on a single topic and exit.\n"); + printf("mosquitto_pub version %s running on libmosquitto %d.%d.%d.\n\n", VERSION, major, minor, revision); + printf("Usage: mosquitto_pub {[-h host] [-p port] [-u username] [-P password] -t topic | -L URL}\n"); + printf(" {-f file | -l | -n | -m message}\n"); + printf(" [-c] [-k keepalive] [-q qos] [-r] [--repeat N] [--repeat-delay time]\n"); +#ifdef WITH_SRV + printf(" [-A bind_address] [-S]\n"); +#else + printf(" [-A bind_address]\n"); +#endif + printf(" [-i id] [-I id_prefix]\n"); + printf(" [-d] [--quiet]\n"); + printf(" [-M max_inflight]\n"); + printf(" [-u username [-P password]]\n"); + printf(" [--will-topic [--will-payload payload] [--will-qos qos] [--will-retain]]\n"); +#ifdef WITH_TLS + printf(" [{--cafile file | --capath dir} [--cert file] [--key file]\n"); + printf(" [--ciphers ciphers] [--insecure]\n"); + printf(" [--tls-alpn protocol]\n"); + printf(" [--tls-engine engine] [--keyform keyform] [--tls-engine-kpass-sha1]]\n"); +#ifdef FINAL_WITH_TLS_PSK + printf(" [--psk hex-key --psk-identity identity [--ciphers ciphers]]\n"); +#endif +#endif +#ifdef WITH_SOCKS + printf(" [--proxy socks-url]\n"); +#endif + printf(" [--property command identifier value]\n"); + printf(" [-D command identifier value]\n"); + printf(" mosquitto_pub --help\n\n"); + printf(" -A : bind the outgoing socket to this host/ip address. Use to control which interface\n"); + printf(" the client communicates over.\n"); + printf(" -d : enable debug messages.\n"); + printf(" -D : Define MQTT v5 properties. See the documentation for more details.\n"); + printf(" -f : send the contents of a file as the message.\n"); + printf(" -h : mqtt host to connect to. Defaults to localhost.\n"); + printf(" -i : id to use for this client. Defaults to mosquitto_pub_ appended with the process id.\n"); + printf(" -I : define the client id as id_prefix appended with the process id. Useful for when the\n"); + printf(" broker is using the clientid_prefixes option.\n"); + printf(" -k : keep alive in seconds for this client. Defaults to 60.\n"); + printf(" -L : specify user, password, hostname, port and topic as a URL in the form:\n"); + printf(" mqtt(s)://[username[:password]@]host[:port]/topic\n"); + printf(" -l : read messages from stdin, sending a separate message for each line.\n"); + printf(" -m : message payload to send.\n"); + printf(" -M : the maximum inflight messages for QoS 1/2..\n"); + printf(" -n : send a null (zero length) message.\n"); + printf(" -p : network port to connect to. Defaults to 1883 for plain MQTT and 8883 for MQTT over TLS.\n"); + printf(" -P : provide a password\n"); + printf(" -q : quality of service level to use for all messages. Defaults to 0.\n"); + printf(" -r : message should be retained.\n"); + printf(" -s : read message from stdin, sending the entire input as a message.\n"); +#ifdef WITH_SRV + printf(" -S : use SRV lookups to determine which host to connect to.\n"); +#endif + printf(" -t : mqtt topic to publish to.\n"); + printf(" -u : provide a username\n"); + printf(" -V : specify the version of the MQTT protocol to use when connecting.\n"); + printf(" Can be mqttv5, mqttv311 or mqttv31. Defaults to mqttv311.\n"); + printf(" --help : display this message.\n"); + printf(" --repeat : if publish mode is -f, -m, or -s, then repeat the publish N times.\n"); + printf(" --repeat-delay : if using --repeat, wait time seconds between publishes. Defaults to 0.\n"); + printf(" --quiet : don't print error messages.\n"); + printf(" --will-payload : payload for the client Will, which is sent by the broker in case of\n"); + printf(" unexpected disconnection. If not given and will-topic is set, a zero\n"); + printf(" length message will be sent.\n"); + printf(" --will-qos : QoS level for the client Will.\n"); + printf(" --will-retain : if given, make the client Will retained.\n"); + printf(" --will-topic : the topic on which to publish the client Will.\n"); +#ifdef WITH_TLS + printf(" --cafile : path to a file containing trusted CA certificates to enable encrypted\n"); + printf(" communication.\n"); + printf(" --capath : path to a directory containing trusted CA certificates to enable encrypted\n"); + printf(" communication.\n"); + printf(" --cert : client certificate for authentication, if required by server.\n"); + printf(" --key : client private key for authentication, if required by server.\n"); + printf(" --keyform : keyfile type, can be either \"pem\" or \"engine\".\n"); + printf(" --ciphers : openssl compatible list of TLS ciphers to support.\n"); + printf(" --tls-version : TLS protocol version, can be one of tlsv1.3 tlsv1.2 or tlsv1.1.\n"); + printf(" Defaults to tlsv1.2 if available.\n"); + printf(" --insecure : do not check that the server certificate hostname matches the remote\n"); + printf(" hostname. Using this option means that you cannot be sure that the\n"); + printf(" remote host is the server you wish to connect to and so is insecure.\n"); + printf(" Do not use this option in a production environment.\n"); + printf(" --tls-engine : If set, enables the use of a TLS engine device.\n"); + printf(" --tls-engine-kpass-sha1 : SHA1 of the key password to be used with the selected SSL engine.\n"); +# ifdef FINAL_WITH_TLS_PSK + printf(" --psk : pre-shared-key in hexadecimal (no leading 0x) to enable TLS-PSK mode.\n"); + printf(" --psk-identity : client identity string for TLS-PSK mode.\n"); +# endif +#endif +#ifdef WITH_SOCKS + printf(" --proxy : SOCKS5 proxy URL of the form:\n"); + printf(" socks5h://[username[:password]@]hostname[:port]\n"); + printf(" Only \"none\" and \"username\" authentication is supported.\n"); +#endif + printf("\nSee https://mosquitto.org/ for more information.\n\n"); +} + +int main(int argc, char *argv[]) +{ + struct mosquitto *mosq = NULL; + int rc; + + mosquitto_lib_init(); + + if(pub_shared_init()) return 1; + + memset(&cfg, 0, sizeof(struct mosq_config)); + rc = client_config_load(&cfg, CLIENT_PUB, argc, argv); + if(rc){ + if(rc == 2){ + /* --help */ + print_usage(); + }else{ + fprintf(stderr, "\nUse 'mosquitto_pub --help' to see usage.\n"); + } + goto cleanup; + } + +#ifndef WITH_THREADING + if(cfg.pub_mode == MSGMODE_STDIN_LINE){ + fprintf(stderr, "Error: '-l' mode not available, threading support has not been compiled in.\n"); + goto cleanup; + } +#endif + + if(cfg.pub_mode == MSGMODE_STDIN_FILE){ + if(load_stdin()){ + err_printf(&cfg, "Error loading input from stdin.\n"); + goto cleanup; + } + }else if(cfg.file_input){ + if(load_file(cfg.file_input)){ + err_printf(&cfg, "Error loading input file \"%s\".\n", cfg.file_input); + goto cleanup; + } + } + + if(!cfg.topic || cfg.pub_mode == MSGMODE_NONE){ + fprintf(stderr, "Error: Both topic and message must be supplied.\n"); + print_usage(); + goto cleanup; + } + + + if(client_id_generate(&cfg)){ + goto cleanup; + } + + mosq = mosquitto_new(cfg.id, cfg.clean_session, NULL); + if(!mosq){ + switch(errno){ + case ENOMEM: + err_printf(&cfg, "Error: Out of memory.\n"); + break; + case EINVAL: + err_printf(&cfg, "Error: Invalid id.\n"); + break; + } + goto cleanup; + } + if(cfg.debug){ + mosquitto_log_callback_set(mosq, my_log_callback); + } + mosquitto_connect_v5_callback_set(mosq, my_connect_callback); + mosquitto_disconnect_v5_callback_set(mosq, my_disconnect_callback); + mosquitto_publish_v5_callback_set(mosq, my_publish_callback); + + if(client_opts_set(mosq, &cfg)){ + goto cleanup; + } + + rc = client_connect(mosq, &cfg); + if(rc){ + goto cleanup; + } + + rc = pub_shared_loop(mosq); + + if(cfg.message && cfg.pub_mode == MSGMODE_FILE){ + free(cfg.message); + cfg.message = NULL; + } + mosquitto_destroy(mosq); + mosquitto_lib_cleanup(); + client_config_cleanup(&cfg); + pub_shared_cleanup(); + + if(rc){ + err_printf(&cfg, "Error: %s\n", mosquitto_strerror(rc)); + } + return rc; + +cleanup: + mosquitto_lib_cleanup(); + client_config_cleanup(&cfg); + pub_shared_cleanup(); + return 1; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_client.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_client.o new file mode 100644 index 0000000..edd1650 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_client.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_shared.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_shared.c new file mode 100644 index 0000000..008bef4 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_shared.c @@ -0,0 +1,126 @@ +/* +Copyright (c) 2009-2018 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#ifndef WIN32 +#include <time.h> +#else +#include <process.h> +#include <winsock2.h> +#define snprintf sprintf_s +#endif + +#include <mosquitto.h> +#include <mqtt_protocol.h> +#include "client_shared.h" +#include "pub_shared.h" + +/* Global variables for use in callbacks. See sub_client.c for an example of + * using a struct to hold variables for use in callbacks. */ +int mid_sent = -1; +int status = STATUS_CONNECTING; +struct mosq_config cfg; + +void my_log_callback(struct mosquitto *mosq, void *obj, int level, const char *str) +{ + UNUSED(mosq); + UNUSED(obj); + UNUSED(level); + + printf("%s\n", str); +} + +int load_stdin(void) +{ + long pos = 0, rlen; + char buf[1024]; + char *aux_message = NULL; + + cfg.pub_mode = MSGMODE_STDIN_FILE; + + while(!feof(stdin)){ + rlen = fread(buf, 1, 1024, stdin); + aux_message = realloc(cfg.message, pos+rlen); + if(!aux_message){ + err_printf(&cfg, "Error: Out of memory.\n"); + free(cfg.message); + return 1; + } else + { + cfg.message = aux_message; + } + memcpy(&(cfg.message[pos]), buf, rlen); + pos += rlen; + } + cfg.msglen = pos; + + if(!cfg.msglen){ + err_printf(&cfg, "Error: Zero length input.\n"); + return 1; + } + + return 0; +} + +int load_file(const char *filename) +{ + long pos, rlen; + FILE *fptr = NULL; + + fptr = fopen(filename, "rb"); + if(!fptr){ + err_printf(&cfg, "Error: Unable to open file \"%s\".\n", filename); + return 1; + } + cfg.pub_mode = MSGMODE_FILE; + fseek(fptr, 0, SEEK_END); + cfg.msglen = ftell(fptr); + if(cfg.msglen > 268435455){ + fclose(fptr); + err_printf(&cfg, "Error: File \"%s\" is too large (>268,435,455 bytes).\n", filename); + return 1; + }else if(cfg.msglen == 0){ + fclose(fptr); + err_printf(&cfg, "Error: File \"%s\" is empty.\n", filename); + return 1; + }else if(cfg.msglen < 0){ + fclose(fptr); + err_printf(&cfg, "Error: Unable to determine size of file \"%s\".\n", filename); + return 1; + } + fseek(fptr, 0, SEEK_SET); + cfg.message = malloc(cfg.msglen); + if(!cfg.message){ + fclose(fptr); + err_printf(&cfg, "Error: Out of memory.\n"); + return 1; + } + pos = 0; + while(pos < cfg.msglen){ + rlen = fread(&(cfg.message[pos]), sizeof(char), cfg.msglen-pos, fptr); + pos += rlen; + } + fclose(fptr); + return 0; +} + + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_shared.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_shared.h new file mode 100644 index 0000000..94d5d11 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_shared.h @@ -0,0 +1,43 @@ +/* +Copyright (c) 2009-2018 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ +#ifndef PUB_SHARED_H +#define PUB_SHARED_H + +#define STATUS_CONNECTING 0 +#define STATUS_CONNACK_RECVD 1 +#define STATUS_WAITING 2 +#define STATUS_DISCONNECTING 3 +#define STATUS_DISCONNECTED 4 + +extern int mid_sent; +extern int status; +extern struct mosq_config cfg; + + +void my_connect_callback(struct mosquitto *mosq, void *obj, int result, int flags, const mosquitto_property *properties); +void my_disconnect_callback(struct mosquitto *mosq, void *obj, int rc, const mosquitto_property *properties); +void my_publish_callback(struct mosquitto *mosq, void *obj, int mid, int reason_code, const mosquitto_property *properties); +void my_log_callback(struct mosquitto *mosq, void *obj, int level, const char *str); +int load_stdin(void); +int load_file(const char *filename); + +int my_publish(struct mosquitto *mosq, int *mid, const char *topic, int payloadlen, void *payload, int qos, bool retain); + +int pub_shared_init(void); +int pub_shared_loop(struct mosquitto *mosq); +void pub_shared_cleanup(void); + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_shared.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_shared.o new file mode 100644 index 0000000..0130d81 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_shared.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_test_properties b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_test_properties new file mode 100755 index 0000000..8e40058 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/pub_test_properties @@ -0,0 +1,26 @@ +LD_LIBRARY_PATH=../lib ./mosquitto_pub \ + \ + -t asdf -V mqttv5 -m '{"key":"value"}' \ + \ + -D connect authentication-data password \ + -D connect authentication-method something \ + -D connect maximum-packet-size 0191 \ + -D connect receive-maximum 1000 \ + -D connect request-problem-information 1 \ + -D connect request-response-information 1 \ + -D connect session-expiry-interval 39 \ + -D connect topic-alias-maximum 123 \ + -D connect user-property connect up \ + \ + -D publish content-type application/json \ + -D publish correlation-data some-data \ + -D publish message-expiry-interval 59 \ + -D publish payload-format-indicator 1 \ + -D publish response-topic /dev/null \ + -D publish topic-alias 4 \ + -D publish user-property publish up \ + \ + -D disconnect reason-string "reason" \ + -D disconnect session-expiry-interval 40 \ + -D disconnect user-property disconnect up + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/rr_client.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/rr_client.c new file mode 100644 index 0000000..6444c28 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/rr_client.c @@ -0,0 +1,370 @@ +/* +Copyright (c) 2009-2018 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <errno.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#ifndef WIN32 +#include <unistd.h> +#include <signal.h> +#else +#include <process.h> +#include <winsock2.h> +#define snprintf sprintf_s +#endif + +#include <mosquitto.h> +#include <mqtt_protocol.h> +#include "client_shared.h" +#include "pub_shared.h" + +enum rr__state { + rr_s_new, + rr_s_connected, + rr_s_subscribed, + rr_s_ready_to_publish, + rr_s_wait_for_response, + rr_s_disconnect +}; + +static enum rr__state client_state = rr_s_new; + +struct mosq_config cfg; +bool process_messages = true; +int msg_count = 0; +struct mosquitto *mosq = NULL; + +#ifndef WIN32 +void my_signal_handler(int signum) +{ + if(signum == SIGALRM){ + process_messages = false; + mosquitto_disconnect_v5(mosq, MQTT_RC_DISCONNECT_WITH_WILL_MSG, cfg.disconnect_props); + } +} +#endif + +void print_message(struct mosq_config *cfg, const struct mosquitto_message *message); + + +int my_publish(struct mosquitto *mosq, int *mid, const char *topic, int payloadlen, void *payload, int qos, bool retain) +{ + return mosquitto_publish_v5(mosq, mid, topic, payloadlen, payload, qos, retain, cfg.publish_props); +} + + +void my_message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message, const mosquitto_property *properties) +{ + print_message(&cfg, message); + switch(cfg.pub_mode){ + case MSGMODE_CMD: + case MSGMODE_FILE: + case MSGMODE_STDIN_FILE: + case MSGMODE_NULL: + client_state = rr_s_disconnect; + break; + case MSGMODE_STDIN_LINE: + client_state = rr_s_ready_to_publish; + break; + } + /* FIXME - check all below + if(process_messages == false) return; + + if(cfg.retained_only && !message->retain && process_messages){ + process_messages = false; + mosquitto_disconnect_v5(mosq, 0, cfg.disconnect_props); + return; + } + + if(message->retain && cfg.no_retain) return; + if(cfg.filter_outs){ + for(i=0; i<cfg.filter_out_count; i++){ + mosquitto_topic_matches_sub(cfg.filter_outs[i], message->topic, &res); + if(res) return; + } + } + + //print_message(&cfg, message); + + if(cfg.msg_count>0){ + msg_count++; + if(cfg.msg_count == msg_count){ + process_messages = false; + mosquitto_disconnect_v5(mosq, 0, cfg.disconnect_props); + } + } + */ +} + +void my_connect_callback(struct mosquitto *mosq, void *obj, int result, int flags, const mosquitto_property *properties) +{ + if(!result){ + client_state = rr_s_connected; + mosquitto_subscribe_v5(mosq, NULL, cfg.response_topic, cfg.qos, 0, cfg.subscribe_props); + }else{ + client_state = rr_s_disconnect; + if(result){ + err_printf(&cfg, "%s\n", mosquitto_connack_string(result)); + } + mosquitto_disconnect_v5(mosq, 0, cfg.disconnect_props); + } +} + + +void my_subscribe_callback(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos) +{ + if(granted_qos[0] < 128){ + client_state = rr_s_ready_to_publish; + }else{ + client_state = rr_s_disconnect; + err_printf(&cfg, "%s\n", mosquitto_reason_string(granted_qos[0])); + mosquitto_disconnect_v5(mosq, 0, cfg.disconnect_props); + } +} + + +void my_publish_callback(struct mosquitto *mosq, void *obj, int mid, int reason_code, const mosquitto_property *properties) +{ + client_state = rr_s_wait_for_response; +} + + +void print_usage(void) +{ + int major, minor, revision; + + mosquitto_lib_version(&major, &minor, &revision); + printf("mosquitto_rr is an mqtt client that can be used to publish a request message and wait for a response.\n"); + printf(" Defaults to MQTT v5, where the Request-Response feature will be used, but v3.1.1 can also be used\n"); + printf(" with v3.1.1 brokers.\n"); + printf("mosquitto_rr version %s running on libmosquitto %d.%d.%d.\n\n", VERSION, major, minor, revision); + printf("Usage: mosquitto_rr {[-h host] [-p port] [-u username] [-P password] -t topic | -L URL} -e response-topic\n"); + printf(" [-c] [-k keepalive] [-q qos] [-R]\n"); + printf(" [-F format]\n"); +#ifndef WIN32 + printf(" [-W timeout_secs]\n"); +#endif +#ifdef WITH_SRV + printf(" [-A bind_address] [-S]\n"); +#else + printf(" [-A bind_address]\n"); +#endif + printf(" [-i id] [-I id_prefix]\n"); + printf(" [-d] [-N] [--quiet] [-v]\n"); + printf(" [--will-topic [--will-payload payload] [--will-qos qos] [--will-retain]]\n"); +#ifdef WITH_TLS + printf(" [{--cafile file | --capath dir} [--cert file] [--key file]\n"); + printf(" [--ciphers ciphers] [--insecure]\n"); + printf(" [--tls-alpn protocol]\n"); + printf(" [--tls-engine engine] [--keyform keyform] [--tls-engine-kpass-sha1]]\n"); +#ifdef FINAL_WITH_TLS_PSK + printf(" [--psk hex-key --psk-identity identity [--ciphers ciphers]]\n"); +#endif +#endif +#ifdef WITH_SOCKS + printf(" [--proxy socks-url]\n"); +#endif + printf(" [-D command identifier value]\n"); + printf(" mosquitto_rr --help\n\n"); + printf(" -A : bind the outgoing socket to this host/ip address. Use to control which interface\n"); + printf(" the client communicates over.\n"); + printf(" -c : disable 'clean session' (store subscription and pending messages when client disconnects).\n"); + printf(" -d : enable debug messages.\n"); + printf(" -D : Define MQTT v5 properties. See the documentation for more details.\n"); + printf(" -F : output format.\n"); + printf(" -h : mqtt host to connect to. Defaults to localhost.\n"); + printf(" -i : id to use for this client. Defaults to mosquitto_rr_ appended with the process id.\n"); + printf(" -k : keep alive in seconds for this client. Defaults to 60.\n"); + printf(" -L : specify user, password, hostname, port and topic as a URL in the form:\n"); + printf(" mqtt(s)://[username[:password]@]host[:port]/topic\n"); + printf(" -N : do not add an end of line character when printing the payload.\n"); + printf(" -p : network port to connect to. Defaults to 1883 for plain MQTT and 8883 for MQTT over TLS.\n"); + printf(" -P : provide a password\n"); + printf(" -q : quality of service level to use for communications. Defaults to 0.\n"); + printf(" -R : do not print stale messages (those with retain set).\n"); +#ifdef WITH_SRV + printf(" -S : use SRV lookups to determine which host to connect to.\n"); +#endif + printf(" -t : mqtt response topic to subscribe to. May be repeated multiple times.\n"); + printf(" -u : provide a username\n"); + printf(" -v : print received messages verbosely.\n"); + printf(" -V : specify the version of the MQTT protocol to use when connecting.\n"); + printf(" Defaults to 5.\n"); +#ifndef WIN32 + printf(" -W : Specifies a timeout in seconds how long to wait for a response.\n"); +#endif + printf(" --help : display this message.\n"); + printf(" --quiet : don't print error messages.\n"); + printf(" --will-payload : payload for the client Will, which is sent by the broker in case of\n"); + printf(" unexpected disconnection. If not given and will-topic is set, a zero\n"); + printf(" length message will be sent.\n"); + printf(" --will-qos : QoS level for the client Will.\n"); + printf(" --will-retain : if given, make the client Will retained.\n"); + printf(" --will-topic : the topic on which to publish the client Will.\n"); +#ifdef WITH_TLS + printf(" --cafile : path to a file containing trusted CA certificates to enable encrypted\n"); + printf(" certificate based communication.\n"); + printf(" --capath : path to a directory containing trusted CA certificates to enable encrypted\n"); + printf(" communication.\n"); + printf(" --cert : client certificate for authentication, if required by server.\n"); + printf(" --key : client private key for authentication, if required by server.\n"); + printf(" --ciphers : openssl compatible list of TLS ciphers to support.\n"); + printf(" --tls-version : TLS protocol version, can be one of tlsv1.2 tlsv1.1 or tlsv1.\n"); + printf(" Defaults to tlsv1.2 if available.\n"); + printf(" --insecure : do not check that the server certificate hostname matches the remote\n"); + printf(" hostname. Using this option means that you cannot be sure that the\n"); + printf(" remote host is the server you wish to connect to and so is insecure.\n"); + printf(" Do not use this option in a production environment.\n"); +#ifdef WITH_TLS_PSK + printf(" --psk : pre-shared-key in hexadecimal (no leading 0x) to enable TLS-PSK mode.\n"); + printf(" --psk-identity : client identity string for TLS-PSK mode.\n"); +#endif +#endif +#ifdef WITH_SOCKS + printf(" --proxy : SOCKS5 proxy URL of the form:\n"); + printf(" socks5h://[username[:password]@]hostname[:port]\n"); + printf(" Only \"none\" and \"username\" authentication is supported.\n"); +#endif + printf("\nSee https://mosquitto.org/ for more information.\n\n"); +} + +int main(int argc, char *argv[]) +{ + int rc; +#ifndef WIN32 + struct sigaction sigact; +#endif + + memset(&cfg, 0, sizeof(struct mosq_config)); + + mosquitto_lib_init(); + + rc = client_config_load(&cfg, CLIENT_RR, argc, argv); + if(rc){ + if(rc == 2){ + /* --help */ + print_usage(); + }else{ + fprintf(stderr, "\nUse 'mosquitto_rr --help' to see usage.\n"); + } + goto cleanup; + } + + if(!cfg.topic || cfg.pub_mode == MSGMODE_NONE || !cfg.response_topic){ + fprintf(stderr, "Error: All of topic, message, and response topic must be supplied.\n"); + fprintf(stderr, "\nUse 'mosquitto_rr --help' to see usage.\n"); + goto cleanup; + } + rc = mosquitto_property_add_string(&cfg.publish_props, MQTT_PROP_RESPONSE_TOPIC, cfg.response_topic); + if(rc){ + fprintf(stderr, "Error adding property RESPONSE_TOPIC.\n"); + goto cleanup; + } + rc = mosquitto_property_check_all(CMD_PUBLISH, cfg.publish_props); + if(rc){ + err_printf(&cfg, "Error in PUBLISH properties: Duplicate response topic.\n"); + goto cleanup; + } + + if(client_id_generate(&cfg)){ + goto cleanup; + } + + mosq = mosquitto_new(cfg.id, cfg.clean_session, &cfg); + if(!mosq){ + switch(errno){ + case ENOMEM: + err_printf(&cfg, "Error: Out of memory.\n"); + break; + case EINVAL: + err_printf(&cfg, "Error: Invalid id and/or clean_session.\n"); + break; + } + goto cleanup; + } + if(client_opts_set(mosq, &cfg)){ + goto cleanup; + } + if(cfg.debug){ + mosquitto_log_callback_set(mosq, my_log_callback); + } + mosquitto_connect_v5_callback_set(mosq, my_connect_callback); + mosquitto_subscribe_callback_set(mosq, my_subscribe_callback); + mosquitto_message_v5_callback_set(mosq, my_message_callback); + + rc = client_connect(mosq, &cfg); + if(rc){ + goto cleanup; + } + +#ifndef WIN32 + sigact.sa_handler = my_signal_handler; + sigemptyset(&sigact.sa_mask); + sigact.sa_flags = 0; + + if(sigaction(SIGALRM, &sigact, NULL) == -1){ + perror("sigaction"); + goto cleanup; + } + + if(cfg.timeout){ + alarm(cfg.timeout); + } +#endif + + do{ + rc = mosquitto_loop(mosq, -1, 1); + if(client_state == rr_s_ready_to_publish){ + client_state = rr_s_wait_for_response; + switch(cfg.pub_mode){ + case MSGMODE_CMD: + case MSGMODE_FILE: + case MSGMODE_STDIN_FILE: + rc = my_publish(mosq, &mid_sent, cfg.topic, cfg.msglen, cfg.message, cfg.qos, cfg.retain); + break; + case MSGMODE_NULL: + rc = my_publish(mosq, &mid_sent, cfg.topic, 0, NULL, cfg.qos, cfg.retain); + break; + case MSGMODE_STDIN_LINE: + /* FIXME */ + break; + } + } + }while(rc == MOSQ_ERR_SUCCESS && client_state != rr_s_disconnect); + + mosquitto_destroy(mosq); + mosquitto_lib_cleanup(); + + if(cfg.msg_count>0 && rc == MOSQ_ERR_NO_CONN){ + rc = 0; + } + client_config_cleanup(&cfg); + if(rc){ + fprintf(stderr, "Error: %s\n", mosquitto_strerror(rc)); + } + return rc; + +cleanup: + mosquitto_lib_cleanup(); + client_config_cleanup(&cfg); + return 1; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/sub_client.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/sub_client.c new file mode 100644 index 0000000..f57a48c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/sub_client.c @@ -0,0 +1,367 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <errno.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#ifndef WIN32 +#include <unistd.h> +#include <signal.h> +#else +#include <process.h> +#include <winsock2.h> +#define snprintf sprintf_s +#endif + +#include <mosquitto.h> +#include <mqtt_protocol.h> +#include "client_shared.h" + +struct mosq_config cfg; +bool process_messages = true; +int msg_count = 0; +struct mosquitto *mosq = NULL; +int last_mid = 0; + +#ifndef WIN32 +void my_signal_handler(int signum) +{ + if(signum == SIGALRM){ + process_messages = false; + mosquitto_disconnect_v5(mosq, MQTT_RC_DISCONNECT_WITH_WILL_MSG, cfg.disconnect_props); + } +} +#endif + +void print_message(struct mosq_config *cfg, const struct mosquitto_message *message); + + +void my_publish_callback(struct mosquitto *mosq, void *obj, int mid, int reason_code, const mosquitto_property *properties) +{ + UNUSED(obj); + UNUSED(reason_code); + UNUSED(properties); + + if(process_messages == false && (mid == last_mid || last_mid == 0)){ + mosquitto_disconnect_v5(mosq, 0, cfg.disconnect_props); + } +} + + +void my_message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message, const mosquitto_property *properties) +{ + int i; + bool res; + + UNUSED(obj); + UNUSED(properties); + + if(process_messages == false) return; + + if(cfg.remove_retained && message->retain){ + mosquitto_publish(mosq, &last_mid, message->topic, 0, NULL, 1, true); + } + + if(cfg.retained_only && !message->retain && process_messages){ + process_messages = false; + if(last_mid == 0){ + mosquitto_disconnect_v5(mosq, 0, cfg.disconnect_props); + } + return; + } + + if(message->retain && cfg.no_retain) return; + if(cfg.filter_outs){ + for(i=0; i<cfg.filter_out_count; i++){ + mosquitto_topic_matches_sub(cfg.filter_outs[i], message->topic, &res); + if(res) return; + } + } + + print_message(&cfg, message); + + if(cfg.msg_count>0){ + msg_count++; + if(cfg.msg_count == msg_count){ + process_messages = false; + if(last_mid == 0){ + mosquitto_disconnect_v5(mosq, 0, cfg.disconnect_props); + } + } + } +} + +void my_connect_callback(struct mosquitto *mosq, void *obj, int result, int flags, const mosquitto_property *properties) +{ + int i; + + UNUSED(obj); + UNUSED(flags); + UNUSED(properties); + + if(!result){ + mosquitto_subscribe_multiple(mosq, NULL, cfg.topic_count, cfg.topics, cfg.qos, cfg.sub_opts, cfg.subscribe_props); + + for(i=0; i<cfg.unsub_topic_count; i++){ + mosquitto_unsubscribe_v5(mosq, NULL, cfg.unsub_topics[i], cfg.unsubscribe_props); + } + }else{ + if(result){ + if(cfg.protocol_version == MQTT_PROTOCOL_V5){ + err_printf(&cfg, "%s\n", mosquitto_reason_string(result)); + }else{ + err_printf(&cfg, "%s\n", mosquitto_connack_string(result)); + } + } + mosquitto_disconnect_v5(mosq, 0, cfg.disconnect_props); + } +} + +void my_subscribe_callback(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos) +{ + int i; + + UNUSED(obj); + + if(!cfg.quiet) printf("Subscribed (mid: %d): %d", mid, granted_qos[0]); + for(i=1; i<qos_count; i++){ + if(!cfg.quiet) printf(", %d", granted_qos[i]); + } + if(!cfg.quiet) printf("\n"); + + if(cfg.exit_after_sub){ + mosquitto_disconnect_v5(mosq, 0, cfg.disconnect_props); + } +} + +void my_log_callback(struct mosquitto *mosq, void *obj, int level, const char *str) +{ + UNUSED(mosq); + UNUSED(obj); + UNUSED(level); + + printf("%s\n", str); +} + +void print_usage(void) +{ + int major, minor, revision; + + mosquitto_lib_version(&major, &minor, &revision); + printf("mosquitto_sub is a simple mqtt client that will subscribe to a set of topics and print all messages it receives.\n"); + printf("mosquitto_sub version %s running on libmosquitto %d.%d.%d.\n\n", VERSION, major, minor, revision); + printf("Usage: mosquitto_sub {[-h host] [-p port] [-u username] [-P password] -t topic | -L URL [-t topic]}\n"); + printf(" [-c] [-k keepalive] [-q qos]\n"); + printf(" [-C msg_count] [-E] [-R] [--retained-only] [--remove-retained] [-T filter_out] [-U topic ...]\n"); + printf(" [-F format]\n"); +#ifndef WIN32 + printf(" [-W timeout_secs]\n"); +#endif +#ifdef WITH_SRV + printf(" [-A bind_address] [-S]\n"); +#else + printf(" [-A bind_address]\n"); +#endif + printf(" [-i id] [-I id_prefix]\n"); + printf(" [-d] [-N] [--quiet] [-v]\n"); + printf(" [--will-topic [--will-payload payload] [--will-qos qos] [--will-retain]]\n"); +#ifdef WITH_TLS + printf(" [{--cafile file | --capath dir} [--cert file] [--key file]\n"); + printf(" [--ciphers ciphers] [--insecure]\n"); + printf(" [--tls-alpn protocol]\n"); + printf(" [--tls-engine engine] [--keyform keyform] [--tls-engine-kpass-sha1]]\n"); +#ifdef FINAL_WITH_TLS_PSK + printf(" [--psk hex-key --psk-identity identity [--ciphers ciphers]]\n"); +#endif +#endif +#ifdef WITH_SOCKS + printf(" [--proxy socks-url]\n"); +#endif + printf(" [-D command identifier value]\n"); + printf(" mosquitto_sub --help\n\n"); + printf(" -A : bind the outgoing socket to this host/ip address. Use to control which interface\n"); + printf(" the client communicates over.\n"); + printf(" -c : disable 'clean session' (store subscription and pending messages when client disconnects).\n"); + printf(" -C : disconnect and exit after receiving the 'msg_count' messages.\n"); + printf(" -d : enable debug messages.\n"); + printf(" -D : Define MQTT v5 properties. See the documentation for more details.\n"); + printf(" -E : Exit once all subscriptions have been acknowledged by the broker.\n"); + printf(" -F : output format.\n"); + printf(" -h : mqtt host to connect to. Defaults to localhost.\n"); + printf(" -i : id to use for this client. Defaults to mosquitto_sub_ appended with the process id.\n"); + printf(" -I : define the client id as id_prefix appended with the process id. Useful for when the\n"); + printf(" broker is using the clientid_prefixes option.\n"); + printf(" -k : keep alive in seconds for this client. Defaults to 60.\n"); + printf(" -L : specify user, password, hostname, port and topic as a URL in the form:\n"); + printf(" mqtt(s)://[username[:password]@]host[:port]/topic\n"); + printf(" -N : do not add an end of line character when printing the payload.\n"); + printf(" -p : network port to connect to. Defaults to 1883 for plain MQTT and 8883 for MQTT over TLS.\n"); + printf(" -P : provide a password\n"); + printf(" -q : quality of service level to use for the subscription. Defaults to 0.\n"); + printf(" -R : do not print stale messages (those with retain set).\n"); +#ifdef WITH_SRV + printf(" -S : use SRV lookups to determine which host to connect to.\n"); +#endif + printf(" -t : mqtt topic to subscribe to. May be repeated multiple times.\n"); + printf(" -T : topic string to filter out of results. May be repeated.\n"); + printf(" -u : provide a username\n"); + printf(" -U : unsubscribe from a topic. May be repeated.\n"); + printf(" -v : print published messages verbosely.\n"); + printf(" -V : specify the version of the MQTT protocol to use when connecting.\n"); + printf(" Can be mqttv5, mqttv311 or mqttv31. Defaults to mqttv311.\n"); +#ifndef WIN32 + printf(" -W : Specifies a timeout in seconds how long to process incoming MQTT messages.\n"); +#endif + printf(" --help : display this message.\n"); + printf(" --quiet : don't print error messages.\n"); + printf(" --retained-only : only handle messages with the retained flag set, and exit when the\n"); + printf(" first non-retained message is received.\n"); + printf(" --remove-retained : send a message to the server to clear any received retained messages\n"); + printf(" Use -T to filter out messages you do not want to be cleared.\n"); + printf(" --will-payload : payload for the client Will, which is sent by the broker in case of\n"); + printf(" unexpected disconnection. If not given and will-topic is set, a zero\n"); + printf(" length message will be sent.\n"); + printf(" --will-qos : QoS level for the client Will.\n"); + printf(" --will-retain : if given, make the client Will retained.\n"); + printf(" --will-topic : the topic on which to publish the client Will.\n"); +#ifdef WITH_TLS + printf(" --cafile : path to a file containing trusted CA certificates to enable encrypted\n"); + printf(" certificate based communication.\n"); + printf(" --capath : path to a directory containing trusted CA certificates to enable encrypted\n"); + printf(" communication.\n"); + printf(" --cert : client certificate for authentication, if required by server.\n"); + printf(" --key : client private key for authentication, if required by server.\n"); + printf(" --keyform : keyfile type, can be either \"pem\" or \"engine\".\n"); + printf(" --ciphers : openssl compatible list of TLS ciphers to support.\n"); + printf(" --tls-version : TLS protocol version, can be one of tlsv1.3 tlsv1.2 or tlsv1.1.\n"); + printf(" Defaults to tlsv1.2 if available.\n"); + printf(" --insecure : do not check that the server certificate hostname matches the remote\n"); + printf(" hostname. Using this option means that you cannot be sure that the\n"); + printf(" remote host is the server you wish to connect to and so is insecure.\n"); + printf(" Do not use this option in a production environment.\n"); + printf(" --tls-engine : If set, enables the use of a SSL engine device.\n"); + printf(" --tls-engine-kpass-sha1 : SHA1 of the key password to be used with the selected SSL engine.\n"); +#ifdef FINAL_WITH_TLS_PSK + printf(" --psk : pre-shared-key in hexadecimal (no leading 0x) to enable TLS-PSK mode.\n"); + printf(" --psk-identity : client identity string for TLS-PSK mode.\n"); +#endif +#endif +#ifdef WITH_SOCKS + printf(" --proxy : SOCKS5 proxy URL of the form:\n"); + printf(" socks5h://[username[:password]@]hostname[:port]\n"); + printf(" Only \"none\" and \"username\" authentication is supported.\n"); +#endif + printf("\nSee https://mosquitto.org/ for more information.\n\n"); +} + +int main(int argc, char *argv[]) +{ + int rc; +#ifndef WIN32 + struct sigaction sigact; +#endif + + memset(&cfg, 0, sizeof(struct mosq_config)); + + mosquitto_lib_init(); + + rc = client_config_load(&cfg, CLIENT_SUB, argc, argv); + if(rc){ + if(rc == 2){ + /* --help */ + print_usage(); + }else{ + fprintf(stderr, "\nUse 'mosquitto_sub --help' to see usage.\n"); + } + goto cleanup; + } + + if(cfg.no_retain && cfg.retained_only){ + fprintf(stderr, "\nError: Combining '-R' and '--retained-only' makes no sense.\n"); + goto cleanup; + } + + if(client_id_generate(&cfg)){ + goto cleanup; + } + + mosq = mosquitto_new(cfg.id, cfg.clean_session, &cfg); + if(!mosq){ + switch(errno){ + case ENOMEM: + err_printf(&cfg, "Error: Out of memory.\n"); + break; + case EINVAL: + err_printf(&cfg, "Error: Invalid id and/or clean_session.\n"); + break; + } + goto cleanup; + } + if(client_opts_set(mosq, &cfg)){ + goto cleanup; + } + if(cfg.debug){ + mosquitto_log_callback_set(mosq, my_log_callback); + mosquitto_subscribe_callback_set(mosq, my_subscribe_callback); + } + mosquitto_connect_v5_callback_set(mosq, my_connect_callback); + mosquitto_message_v5_callback_set(mosq, my_message_callback); + + rc = client_connect(mosq, &cfg); + if(rc){ + goto cleanup; + } + +#ifndef WIN32 + sigact.sa_handler = my_signal_handler; + sigemptyset(&sigact.sa_mask); + sigact.sa_flags = 0; + + if(sigaction(SIGALRM, &sigact, NULL) == -1){ + perror("sigaction"); + goto cleanup; + } + + if(cfg.timeout){ + alarm(cfg.timeout); + } +#endif + + rc = mosquitto_loop_forever(mosq, -1, 1); + + mosquitto_destroy(mosq); + mosquitto_lib_cleanup(); + + if(cfg.msg_count>0 && rc == MOSQ_ERR_NO_CONN){ + rc = 0; + } + client_config_cleanup(&cfg); + if(rc){ + fprintf(stderr, "Error: %s\n", mosquitto_strerror(rc)); + } + return rc; + +cleanup: + mosquitto_lib_cleanup(); + client_config_cleanup(&cfg); + return 1; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/sub_client_output.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/sub_client_output.c new file mode 100644 index 0000000..a7cdefb --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/sub_client_output.c @@ -0,0 +1,336 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <errno.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#ifndef WIN32 +#include <unistd.h> +#else +#include <process.h> +#include <winsock2.h> +#define snprintf sprintf_s +#endif + +#ifdef __APPLE__ +# include <sys/time.h> +#endif + +#include <mosquitto.h> +#include "client_shared.h" + +extern struct mosq_config cfg; + +static int get_time(struct tm **ti, long *ns) +{ +#ifdef WIN32 + SYSTEMTIME st; +#elif defined(__APPLE__) + struct timeval tv; +#else + struct timespec ts; +#endif + time_t s; + +#ifdef WIN32 + s = time(NULL); + + GetLocalTime(&st); + *ns = st.wMilliseconds*1000000L; +#elif defined(__APPLE__) + gettimeofday(&tv, NULL); + s = tv.tv_sec; + *ns = tv.tv_usec*1000; +#else + if(clock_gettime(CLOCK_REALTIME, &ts) != 0){ + err_printf(&cfg, "Error obtaining system time.\n"); + return 1; + } + s = ts.tv_sec; + *ns = ts.tv_nsec; +#endif + + *ti = localtime(&s); + if(!(*ti)){ + err_printf(&cfg, "Error obtaining system time.\n"); + return 1; + } + + return 0; +} + + +static void write_payload(const unsigned char *payload, int payloadlen, int hex) +{ + int i; + + if(hex == 0){ + (void)fwrite(payload, 1, payloadlen, stdout); + }else if(hex == 1){ + for(i=0; i<payloadlen; i++){ + fprintf(stdout, "%02x", payload[i]); + } + }else if(hex == 2){ + for(i=0; i<payloadlen; i++){ + fprintf(stdout, "%02X", payload[i]); + } + } +} + + +static void write_json_payload(const char *payload, int payloadlen) +{ + int i; + + for(i=0; i<payloadlen; i++){ + if(payload[i] == '"' || payload[i] == '\\' || (payload[i] >=0 && payload[i] < 32)){ + printf("\\u%04x", payload[i]); + }else{ + fputc(payload[i], stdout); + } + } +} + + +static void json_print(const struct mosquitto_message *message, const struct tm *ti, bool escaped) +{ + char buf[100]; + + strftime(buf, 100, "%s", ti); + printf("{\"tst\":%s,\"topic\":\"%s\",\"qos\":%d,\"retain\":%d,\"payloadlen\":%d,", buf, message->topic, message->qos, message->retain, message->payloadlen); + if(message->qos > 0){ + printf("\"mid\":%d,", message->mid); + } + if(escaped){ + fputs("\"payload\":\"", stdout); + write_json_payload(message->payload, message->payloadlen); + fputs("\"}", stdout); + }else{ + fputs("\"payload\":", stdout); + write_payload(message->payload, message->payloadlen, 0); + fputs("}", stdout); + } +} + + +static void formatted_print(const struct mosq_config *lcfg, const struct mosquitto_message *message) +{ + int len; + int i; + struct tm *ti = NULL; + long ns; + char strf[3]; + char buf[100]; + + len = strlen(lcfg->format); + + for(i=0; i<len; i++){ + if(lcfg->format[i] == '%'){ + if(i < len-1){ + i++; + switch(lcfg->format[i]){ + case '%': + fputc('%', stdout); + break; + + case 'I': + if(!ti){ + if(get_time(&ti, &ns)){ + err_printf(lcfg, "Error obtaining system time.\n"); + return; + } + } + if(strftime(buf, 100, "%FT%T%z", ti) != 0){ + fputs(buf, stdout); + } + break; + + case 'j': + if(!ti){ + if(get_time(&ti, &ns)){ + err_printf(lcfg, "Error obtaining system time.\n"); + return; + } + } + json_print(message, ti, true); + break; + + case 'J': + if(!ti){ + if(get_time(&ti, &ns)){ + err_printf(lcfg, "Error obtaining system time.\n"); + return; + } + } + json_print(message, ti, false); + break; + + case 'l': + printf("%d", message->payloadlen); + break; + + case 'm': + printf("%d", message->mid); + break; + + case 'p': + write_payload(message->payload, message->payloadlen, 0); + break; + + case 'q': + fputc(message->qos + 48, stdout); + break; + + case 'r': + if(message->retain){ + fputc('1', stdout); + }else{ + fputc('0', stdout); + } + break; + + case 't': + fputs(message->topic, stdout); + break; + + case 'U': + if(!ti){ + if(get_time(&ti, &ns)){ + err_printf(lcfg, "Error obtaining system time.\n"); + return; + } + } + if(strftime(buf, 100, "%s", ti) != 0){ + printf("%s.%09ld", buf, ns); + } + break; + + case 'x': + write_payload(message->payload, message->payloadlen, 1); + break; + + case 'X': + write_payload(message->payload, message->payloadlen, 2); + break; + } + } + }else if(lcfg->format[i] == '@'){ + if(i < len-1){ + i++; + if(lcfg->format[i] == '@'){ + fputc('@', stdout); + }else{ + if(!ti){ + if(get_time(&ti, &ns)){ + err_printf(lcfg, "Error obtaining system time.\n"); + return; + } + } + + strf[0] = '%'; + strf[1] = lcfg->format[i]; + strf[2] = 0; + + if(lcfg->format[i] == 'N'){ + printf("%09ld", ns); + }else{ + if(strftime(buf, 100, strf, ti) != 0){ + fputs(buf, stdout); + } + } + } + } + }else if(lcfg->format[i] == '\\'){ + if(i < len-1){ + i++; + switch(lcfg->format[i]){ + case '\\': + fputc('\\', stdout); + break; + + case '0': + fputc('\0', stdout); + break; + + case 'a': + fputc('\a', stdout); + break; + + case 'e': + fputc('\033', stdout); + break; + + case 'n': + fputc('\n', stdout); + break; + + case 'r': + fputc('\r', stdout); + break; + + case 't': + fputc('\t', stdout); + break; + + case 'v': + fputc('\v', stdout); + break; + } + } + }else{ + fputc(lcfg->format[i], stdout); + } + } + if(lcfg->eol){ + fputc('\n', stdout); + } + fflush(stdout); +} + + +void print_message(struct mosq_config *cfg, const struct mosquitto_message *message) +{ + if(cfg->format){ + formatted_print(cfg, message); + }else if(cfg->verbose){ + if(message->payloadlen){ + printf("%s ", message->topic); + write_payload(message->payload, message->payloadlen, false); + if(cfg->eol){ + printf("\n"); + } + }else{ + if(cfg->eol){ + printf("%s (null)\n", message->topic); + } + } + fflush(stdout); + }else{ + if(message->payloadlen){ + write_payload(message->payload, message->payloadlen, false); + if(cfg->eol){ + printf("\n"); + } + fflush(stdout); + } + } +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/sub_test_properties b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/sub_test_properties new file mode 100755 index 0000000..6d46cb7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/client/sub_test_properties @@ -0,0 +1,31 @@ +LD_LIBRARY_PATH=../lib ./mosquitto_sub \ + \ + -V mqttv5 -C 10 -t \$SYS/# -v -U unsub --will-topic will --will-payload '{"key":"value"}' \ + \ + -D connect authentication-data password \ + -D connect authentication-method something \ + -D connect maximum-packet-size 0191 \ + -D connect receive-maximum 1000 \ + -D connect request-problem-information 1 \ + -D connect request-response-information 1 \ + -D connect session-expiry-interval 39 \ + -D connect topic-alias-maximum 123 \ + -D connect user-property connect up \ + \ + -D will content-type application/json \ + -D will correlation-data some-data \ + -D will message-expiry-interval 59 \ + -D will payload-format-indicator 1 \ + -D will response-topic /dev/null \ + -D will user-property will up \ + -D will will-delay-interval 100 \ + \ + -D subscribe subscription-identifier 1 \ + -D subscribe user-property subscribe up \ + \ + -D unsubscribe user-property unsubscribe up \ + \ + -D disconnect reason-string "reason" \ + -D disconnect session-expiry-interval 40 \ + -D disconnect user-property disconnect up + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/compiling.txt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/compiling.txt new file mode 100644 index 0000000..8d44b44 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/compiling.txt @@ -0,0 +1,20 @@ +The following packages can be used to add features to mosquitto. All of them +are optional. + +* openssl +* c-ares (for DNS-SRV support, disabled by default) +* tcp-wrappers (optional, package name libwrap0-dev) +* libwebsockets (optional, disabled by default, version 1.3 and above) +* On Windows, a pthreads library is required if threading support is to be + included. + +To compile, run "make", but also see the file config.mk for more details on the +various options that can be compiled in. + +Where possible use the Makefiles to compile. This is particularly relevant for +the client libraries as symbol information will be included. Use cmake to +compile on Windows or Mac. + +If you have any questions, problems or suggestions (particularly related to +installing on a more unusual device like a plug-computer) then please get in +touch using the details in readme.txt. diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/config.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/config.h new file mode 100644 index 0000000..f717d00 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/config.h @@ -0,0 +1,69 @@ +#ifndef CONFIG_H +#define CONFIG_H +/* ============================================================ + * Platform options + * ============================================================ */ + +#ifdef __APPLE__ +# define __DARWIN_C_SOURCE +#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__SYMBIAN32__) || defined(__QNX__) +# define _XOPEN_SOURCE 700 +# define __BSD_VISIBLE 1 +# define HAVE_NETINET_IN_H +#else +# define _XOPEN_SOURCE 700 +# define _DEFAULT_SOURCE 1 +# define _POSIX_C_SOURCE 200809L +#endif + +#define _GNU_SOURCE + +#define OPENSSL_LOAD_CONF + +/* ============================================================ + * Compatibility defines + * ============================================================ */ +#if defined(_MSC_VER) && _MSC_VER < 1900 +# define snprintf sprintf_s +# define EPROTO ECONNABORTED +#endif + +#ifdef WIN32 +# ifndef strcasecmp +# define strcasecmp strcmpi +# endif +# define strtok_r strtok_s +# define strerror_r(e, b, l) strerror_s(b, l, e) +#endif + + +#define uthash_malloc(sz) mosquitto__malloc(sz) +#define uthash_free(ptr,sz) mosquitto__free(ptr) + + +#ifdef WITH_TLS +# include <openssl/opensslconf.h> +# if defined(WITH_TLS_PSK) && !defined(OPENSSL_NO_PSK) +# define FINAL_WITH_TLS_PSK +# endif +#endif + + +#ifdef __COVERITY__ +# include <stdint.h> +/* These are "wrong", but we don't use them so it doesn't matter */ +# define _Float32 uint32_t +# define _Float32x uint32_t +# define _Float64 uint64_t +# define _Float64x uint64_t +# define _Float128 uint64_t +#endif + +#define UNUSED(A) (void)(A) + +/* Android Bionic libpthread implementation doesn't have pthread_cancel */ +#ifndef ANDROID +# define HAVE_PTHREAD_CANCEL +#endif + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/config.mk b/proj1_mqttd/mosquitto/mosquitto-1.6.3/config.mk new file mode 100644 index 0000000..e305d0c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/config.mk @@ -0,0 +1,314 @@ +# ============================================================================= +# User configuration section. +# +# These options control compilation on all systems apart from Windows and Mac +# OS X. Use CMake to compile on Windows and Mac. +# +# Largely, these are options that are designed to make mosquitto run more +# easily in restrictive environments by removing features. +# +# Modify the variable below to enable/disable features. +# +# Can also be overriden at the command line, e.g.: +# +# make WITH_TLS=no +# ============================================================================= + +# Uncomment to compile the broker with tcpd/libwrap support. +#WITH_WRAP:=yes + +# Comment out to disable SSL/TLS support in the broker and client. +# Disabling this will also mean that passwords must be stored in plain text. It +# is strongly recommended that you only disable WITH_TLS if you are not using +# password authentication at all. +WITH_TLS:=yes + +# Comment out to disable TLS/PSK support in the broker and client. Requires +# WITH_TLS=yes. +# This must be disabled if using openssl < 1.0. +WITH_TLS_PSK:=yes + +# Comment out to disable client threading support. +WITH_THREADING:=yes + +# Comment out to remove bridge support from the broker. This allow the broker +# to connect to other brokers and subscribe/publish to topics. You probably +# want to leave this included unless you want to save a very small amount of +# memory size and CPU time. +WITH_BRIDGE:=yes + +# Comment out to remove persistent database support from the broker. This +# allows the broker to store retained messages and durable subscriptions to a +# file periodically and on shutdown. This is usually desirable (and is +# suggested by the MQTT spec), but it can be disabled if required. +WITH_PERSISTENCE:=yes + +# Comment out to remove memory tracking support from the broker. If disabled, +# mosquitto won't track heap memory usage nor export '$SYS/broker/heap/current +# size', but will use slightly less memory and CPU time. +WITH_MEMORY_TRACKING:=yes + +# Compile with database upgrading support? If disabled, mosquitto won't +# automatically upgrade old database versions. +# Not currently supported. +#WITH_DB_UPGRADE:=yes + +# Comment out to remove publishing of the $SYS topic hierarchy containing +# information about the broker state. +WITH_SYS_TREE:=yes + +# Build with systemd support. If enabled, mosquitto will notify systemd after +# initialization. See README in service/systemd/ for more information. +WITH_SYSTEMD:=no + +# Build with SRV lookup support. +WITH_SRV:=no + +# Build with websockets support on the broker. +WITH_WEBSOCKETS:=no + +# Use elliptic keys in broker +WITH_EC:=yes + +# Build man page documentation by default. +WITH_DOCS:=yes + +# Build with client support for SOCK5 proxy. +WITH_SOCKS:=yes + +# Strip executables and shared libraries on install. +WITH_STRIP:=no + +# Build static libraries +WITH_STATIC_LIBRARIES:=no + +# Build shared libraries +WITH_SHARED_LIBRARIES:=yes + +# Build with async dns lookup support for bridges (temporary). Requires glibc. +#WITH_ADNS:=yes + +# Build with epoll support. +WITH_EPOLL:=yes + +# Build with bundled uthash.h +WITH_BUNDLED_DEPS:=yes + +# Build with coverage options +WITH_COVERAGE:=no + +# ============================================================================= +# End of user configuration +# ============================================================================= + + +# Also bump lib/mosquitto.h, CMakeLists.txt, +# installer/mosquitto.nsi, installer/mosquitto64.nsi +VERSION=1.6.3 + +# Client library SO version. Bump if incompatible API/ABI changes are made. +SOVERSION=1 + +# Man page generation requires xsltproc and docbook-xsl +XSLTPROC=xsltproc --nonet +# For html generation +DB_HTML_XSL=man/html.xsl + +#MANCOUNTRIES=en_GB + +UNAME:=$(shell uname -s) + +ifeq ($(UNAME),SunOS) + ifeq ($(CC),cc) + CFLAGS?=-O + else + CFLAGS?=-Wall -ggdb -O2 + endif +else + CFLAGS?=-Wall -ggdb -O2 +endif + +STATIC_LIB_DEPS:= + +LIB_CPPFLAGS=$(CPPFLAGS) -I. -I.. -I../lib -I../src/deps +LIB_CFLAGS:=$(CFLAGS) +LIB_CXXFLAGS:=$(CXXFLAGS) +LIB_LDFLAGS:=$(LDFLAGS) +LIB_LIBADD:=$(LIBADD) + +BROKER_CPPFLAGS:=$(LIB_CPPFLAGS) +BROKER_CFLAGS:=${CFLAGS} -DVERSION="\"${VERSION}\"" -DWITH_BROKER +BROKER_LDFLAGS:=${LDFLAGS} +BROKER_LDADD:= + +CLIENT_CPPFLAGS:=$(CPPFLAGS) -I.. -I../lib +CLIENT_CFLAGS:=${CFLAGS} -DVERSION="\"${VERSION}\"" +CLIENT_LDFLAGS:=$(LDFLAGS) -L../lib +CLIENT_LDADD:= + +PASSWD_LDADD:= + +ifneq ($(or $(findstring $(UNAME),FreeBSD), $(findstring $(UNAME),OpenBSD), $(findstring $(UNAME),NetBSD)),) + BROKER_LDADD:=$(BROKER_LDADD) -lm +else + BROKER_LDADD:=$(BROKER_LDADD) -ldl -lm +endif + +ifeq ($(UNAME),Linux) + BROKER_LDADD:=$(BROKER_LDADD) -lrt + BROKER_LDFLAGS:=$(BROKER_LDFLAGS) -Wl,--dynamic-list=linker.syms + LIB_LIBADD:=$(LIB_LIBADD) -lrt +endif + +ifeq ($(WITH_SHARED_LIBRARIES),yes) + CLIENT_LDADD:=${CLIENT_LDADD} ../lib/libmosquitto.so.${SOVERSION} +endif + +ifeq ($(UNAME),SunOS) + ifeq ($(CC),cc) + LIB_CFLAGS:=$(LIB_CFLAGS) -xc99 -KPIC + else + LIB_CFLAGS:=$(LIB_CFLAGS) -fPIC + endif + + ifeq ($(CXX),CC) + LIB_CXXFLAGS:=$(LIB_CXXFLAGS) -KPIC + else + LIB_CXXFLAGS:=$(LIB_CXXFLAGS) -fPIC + endif +else + LIB_CFLAGS:=$(LIB_CFLAGS) -fPIC + LIB_CXXFLAGS:=$(LIB_CXXFLAGS) -fPIC +endif + +ifneq ($(UNAME),SunOS) + LIB_LDFLAGS:=$(LIB_LDFLAGS) -Wl,--version-script=linker.version -Wl,-soname,libmosquitto.so.$(SOVERSION) +endif + +ifeq ($(UNAME),QNX) + BROKER_LDADD:=$(BROKER_LDADD) -lsocket + LIB_LIBADD:=$(LIB_LIBADD) -lsocket +endif + +ifeq ($(WITH_WRAP),yes) + BROKER_LDADD:=$(BROKER_LDADD) -lwrap + BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_WRAP +endif + +ifeq ($(WITH_TLS),yes) + BROKER_LDADD:=$(BROKER_LDADD) -lssl -lcrypto + LIB_LIBADD:=$(LIB_LIBADD) -lssl -lcrypto + BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_TLS + LIB_CPPFLAGS:=$(LIB_CPPFLAGS) -DWITH_TLS + PASSWD_LDADD:=$(PASSWD_LDADD) -lcrypto + CLIENT_CPPFLAGS:=$(CLIENT_CPPFLAGS) -DWITH_TLS + STATIC_LIB_DEPS:=$(STATIC_LIB_DEPS) -lssl -lcrypto + + ifeq ($(WITH_TLS_PSK),yes) + BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_TLS_PSK + LIB_CPPFLAGS:=$(LIB_CPPFLAGS) -DWITH_TLS_PSK + CLIENT_CPPFLAGS:=$(CLIENT_CPPFLAGS) -DWITH_TLS_PSK + endif +endif + +ifeq ($(WITH_THREADING),yes) + LIB_LIBADD:=$(LIB_LIBADD) -lpthread + LIB_CPPFLAGS:=$(LIB_CPPFLAGS) -DWITH_THREADING + CLIENT_CPPFLAGS:=$(CLIENT_CPPFLAGS) -DWITH_THREADING + STATIC_LIB_DEPS:=$(STATIC_LIB_DEPS) -lpthread +endif + +ifeq ($(WITH_SOCKS),yes) + LIB_CPPFLAGS:=$(LIB_CPPFLAGS) -DWITH_SOCKS + CLIENT_CPPFLAGS:=$(CLIENT_CPPFLAGS) -DWITH_SOCKS +endif + +ifeq ($(WITH_BRIDGE),yes) + BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_BRIDGE +endif + +ifeq ($(WITH_PERSISTENCE),yes) + BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_PERSISTENCE +endif + +ifeq ($(WITH_MEMORY_TRACKING),yes) + ifneq ($(UNAME),SunOS) + BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_MEMORY_TRACKING + endif +endif + +ifeq ($(WITH_SYS_TREE),yes) + BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_SYS_TREE +endif + +ifeq ($(WITH_SYSTEMD),yes) + BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_SYSTEMD + BROKER_LDADD:=$(BROKER_LDADD) -lsystemd +endif + +ifeq ($(WITH_SRV),yes) + LIB_CPPFLAGS:=$(LIB_CPPFLAGS) -DWITH_SRV + LIB_LIBADD:=$(LIB_LIBADD) -lcares + CLIENT_CPPFLAGS:=$(CLIENT_CPPFLAGS) -DWITH_SRV + STATIC_LIB_DEPS:=$(STATIC_LIB_DEPS) -lcares +endif + +ifeq ($(UNAME),SunOS) + BROKER_LDADD:=$(BROKER_LDADD) -lsocket -lnsl + LIB_LIBADD:=$(LIB_LIBADD) -lsocket -lnsl +endif + +ifeq ($(WITH_EC),yes) + BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_EC +endif + +ifeq ($(WITH_ADNS),yes) + BROKER_LDADD:=$(BROKER_LDADD) -lanl + BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_ADNS +endif + +MAKE_ALL:=mosquitto +ifeq ($(WITH_DOCS),yes) + MAKE_ALL:=$(MAKE_ALL) docs +endif + +ifeq ($(WITH_WEBSOCKETS),yes) + BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_WEBSOCKETS + BROKER_LDADD:=$(BROKER_LDADD) -lwebsockets +endif + +ifeq ($(WITH_WEBSOCKETS),static) + BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_WEBSOCKETS + BROKER_LDADD:=$(BROKER_LDADD) -static -lwebsockets +endif + +INSTALL?=install +prefix?=/usr/local +incdir?=${prefix}/include +libdir?=${prefix}/lib${LIB_SUFFIX} +localedir?=${prefix}/share/locale +mandir?=${prefix}/share/man +STRIP?=strip + +ifeq ($(WITH_STRIP),yes) + STRIP_OPTS?=-s --strip-program=${CROSS_COMPILE}${STRIP} +endif + +ifeq ($(WITH_EPOLL),yes) + ifeq ($(UNAME),Linux) + BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_EPOLL + endif +endif + +ifeq ($(WITH_BUNDLED_DEPS),yes) + BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -Ideps +endif + +ifeq ($(WITH_COVERAGE),yes) + BROKER_CFLAGS:=$(BROKER_CFLAGS) -coverage + BROKER_LDFLAGS:=$(BROKER_LDFLAGS) -coverage + LIB_CFLAGS:=$(LIB_CFLAGS) -coverage + LIB_LDFLAGS:=$(LIB_LDFLAGS) -coverage + CLIENT_CFLAGS:=$(CLIENT_CFLAGS) -coverage + CLIENT_LDFLAGS:=$(CLIENT_LDFLAGS) -coverage +endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/cscope.in.out b/proj1_mqttd/mosquitto/mosquitto-1.6.3/cscope.in.out new file mode 100644 index 0000000..a7842aa --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/cscope.in.out Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/cscope.out b/proj1_mqttd/mosquitto/mosquitto-1.6.3/cscope.out new file mode 100644 index 0000000..d588961 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/cscope.out @@ -0,0 +1,487908 @@ +cscope 15 $HOME/.project/master.iot-yun.com/raspberrypi/mqttd/mosquitto/mosquitto-1.6.3 -q 0000028296 0002942017 + @client/client_props.c + +17 + ~"c�fig.h +" + +19 + ~<��o.h +> + +20 + ~<f��.h +> + +21 + ~<�dio.h +> + +22 + ~<�dlib.h +> + +23 + ~<�r�g.h +> + +24 #i�de� +WIN32 + + +25 + ~<uni�d.h +> + +26 + ~<�r�gs.h +> + +28 + ~<�o�ss.h +> + +29 + ~<w�sock2.h +> + +30 + #���tf + +�r�tf_s + + + ) + +31 + #����cmp + +_��icmp + + + ) + +34 + ~"mosqu�to.h +" + +35 + ~"mq�_��oc�.h +" + +36 + ~"���_sh�ed.h +" + +38 + e��_ty� + + +40 + mPROP_TYPE_BYTE +, + +41 + mPROP_TYPE_INT16 +, + +42 + mPROP_TYPE_INT32 +, + +43 + mPROP_TYPE_BINARY +, + +44 + mPROP_TYPE_STRING +, + +45 + mPROP_TYPE_STRING_PAIR + + +61 + $cfg_�r�_�ݔty +( +mosq_c�fig + * +cfg +, +�gc +, * +�gv +[], * +idx +) + +63 * +cmd�me + = +NULL +, * +���me + = NULL; + +64 * +key + = +NULL +, * +v�ue + = NULL; + +65 +cmd +, +id�tif�r +, +ty� +; + +66 +mosqu�to_�ݔty + ** +��li� +; + +67 +rc +; + +70 if((* +idx +)+2 > +�gc +-1){ + +72 + `�r�tf +( +�d�r +, "Error: --property�rgument given but�ot�nough�rguments specified.\n\n"); + +73 +MOSQ_ERR_INVAL +; + +76 +cmd�me + = +�gv +[* +idx +]; + +77 if( + `mosqu�to_�r�g_to_comm�d +( +cmd�me +, & +cmd +)){ + +78 + `�r�tf +( +�d�r +, "Error: Invalid command given in --property�rgument.\n\n"); + +79 +MOSQ_ERR_INVAL +; + +82 +���me + = +�gv +[(* +idx +)+1]; + +83 if( + `mosqu�to_�r�g_to_�ݔty_�fo +( +���me +, & +id�tif�r +, & +ty� +)){ + +84 + `�r�tf +( +�d�r +, "Error: Invalid�roperty�ame given in --property�rgument.\n\n"); + +85 +MOSQ_ERR_INVAL +; + +88 if( + `mosqu�to_�ݔty_check_comm�d +( +cmd +, +id�tif�r +)){ + +89 + `�r�tf +( +�d�r +, "E��: %��ݔty�ه�ow f� %�� --�ݔty�rgum�t.\n\n", +���me +, +cmd�me +); + +90 +MOSQ_ERR_INVAL +; + +93 if( +id�tif�r + =� +MQTT_PROP_USER_PROPERTY +){ + +94 if((* +idx +)+3 > +�gc +-1){ + +96 + `�r�tf +( +�d�r +, "Error: --property�rgument given but�ot�nough�rguments specified.\n\n"); + +97 +MOSQ_ERR_INVAL +; + +100 +key + = +�gv +[(* +idx +)+2]; + +101 +v�ue + = +�gv +[(* +idx +)+3]; + +102 (* +idx +) += 3; + +104 +v�ue + = +�gv +[(* +idx +)+2]; + +105 (* +idx +) += 2; + +109 +cmd +){ + +110 +CMD_CONNECT +: + +111 +��li� + = & +cfg +-> +c���_��s +; + +114 +CMD_PUBLISH +: + +115 if( +id�tif�r + =� +MQTT_PROP_TOPIC_ALIAS +){ + +116 +cfg +-> +have_t�ic_��s + = +�ue +; + +118 if( +id�tif�r + =� +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +){ + +119 + `�r�tf +( +�d�r +, "E��: %��ݔty�� su�܋d f� %�� --�ݔty�rgum�t.\n\n", +���me +, +cmd�me +); + +120 +MOSQ_ERR_INVAL +; + +122 +��li� + = & +cfg +-> +publish_��s +; + +125 +CMD_SUBSCRIBE +: + +126 if( +id�tif�r + !� +MQTT_PROP_SUBSCRIPTION_IDENTIFIER + && id�tif��!� +MQTT_PROP_USER_PROPERTY +){ + +127 + `�r�tf +( +�d�r +, "E��: %��ݔty�� su�܋d f� %�� --�ݔty�rgum�t.\n\n", +���me +, +cmd�me +); + +128 +MOSQ_ERR_NOT_SUPPORTED +; + +130 +��li� + = & +cfg +-> +subs�ibe_��s +; + +133 +CMD_UNSUBSCRIBE +: + +134 +��li� + = & +cfg +-> +unsubs�ibe_��s +; + +137 +CMD_DISCONNECT +: + +138 +��li� + = & +cfg +-> +disc���_��s +; + +141 +CMD_AUTH +: + +142 + `�r�tf +( +�d�r +, "E��: %��ݔty�� su�܋d f� %�� --�ݔty�rgum�t.\n\n", +���me +, +cmd�me +); + +143 +MOSQ_ERR_NOT_SUPPORTED +; + +145 +CMD_WILL +: + +146 +��li� + = & +cfg +-> +w�l_��s +; + +149 +CMD_PUBACK +: + +150 +CMD_PUBREC +: + +151 +CMD_PUBREL +: + +152 +CMD_PUBCOMP +: + +153 +CMD_SUBACK +: + +154 +CMD_UNSUBACK +: + +155 + `�r�tf +( +�d�r +, "E��: %��ݔty�� su�܋d f� %�� --�ݔty�rgum�t.\n\n", +���me +, +cmd�me +); + +156 +MOSQ_ERR_NOT_SUPPORTED +; + +159 +MOSQ_ERR_INVAL +; + +162 +ty� +){ + +163 +MQTT_PROP_TYPE_BYTE +: + +164 +rc + = + `mosqu�to_�ݔty_add_by� +( +��li� +, +id�tif�r +, + `�oi +( +v�ue +)); + +166 +MQTT_PROP_TYPE_INT16 +: + +167 +rc + = + `mosqu�to_�ݔty_add_�t16 +( +��li� +, +id�tif�r +, + `�oi +( +v�ue +)); + +169 +MQTT_PROP_TYPE_INT32 +: + +170 +rc + = + `mosqu�to_�ݔty_add_�t32 +( +��li� +, +id�tif�r +, + `�oi +( +v�ue +)); + +172 +MQTT_PROP_TYPE_VARINT +: + +173 +rc + = + `mosqu�to_�ݔty_add_v��t +( +��li� +, +id�tif�r +, + `�oi +( +v�ue +)); + +175 +MQTT_PROP_TYPE_BINARY +: + +176 +rc + = + `mosqu�to_�ݔty_add_b��y +( +��li� +, +id�tif�r +, +v�ue +, + `��� +(value)); + +178 +MQTT_PROP_TYPE_STRING +: + +179 +rc + = + `mosqu�to_�ݔty_add_�r�g +( +��li� +, +id�tif�r +, +v�ue +); + +181 +MQTT_PROP_TYPE_STRING_PAIR +: + +182 +rc + = + `mosqu�to_�ݔty_add_�r�g_�� +( +��li� +, +id�tif�r +, +key +, +v�ue +); + +185 +MOSQ_ERR_INVAL +; + +187 if( +rc +){ + +188 + `�r�tf +( +�d�r +, "E�܇dd�g�rݔty %�%d\n", +���me +, +ty� +); + +189 +rc +; + +191 +MOSQ_ERR_SUCCESS +; + +192 + } +} + + @client/client_shared.c + +17 + ~"c�fig.h +" + +19 + ~<��o.h +> + +20 + ~<f��.h +> + +21 + ~<�d�g.h +> + +22 + ~<�dio.h +> + +23 + ~<�dlib.h +> + +24 + ~<�r�g.h +> + +25 #i�de� +WIN32 + + +26 + ~<uni�d.h +> + +27 + ~<�r�gs.h +> + +29 + ~<�o�ss.h +> + +30 + ~<w�sock2.h +> + +31 + #���tf + +�r�tf_s + + + ) + +32 + #����cmp + +_��icmp + + + ) + +35 + ~<mosqu�to.h +> + +36 + ~<mq�_��oc�.h +> + +37 + ~"���_sh�ed.h +" + +39 #ifde� +WITH_SOCKS + + +40 +mosqu�to__�r�_socks_u� +( +mosq_c�fig + * +cfg +, * +u� +); + +42 +���_c�fig_l�e_�oc +( +mosq_c�fig + * +cfg +, +pub_�_sub +, +�gc +, * +�gv +[]); + +45 + $check_f�m� +(cڡ * +�r +) + +47 +i +; + +48 +�n +; + +50 +�n + = + `��� +( +�r +); + +51 +i +=0; i< +�n +; i++){ + +52 if( +�r +[ +i +] == '%'){ + +53 if( +i + =� +�n +-1){ + +55 + `�r�tf +( +�d�r +, "Error: Incomplete format specifier.\n"); + +58 if( +�r +[ +i ++1] == '%'){ + +60 }if( +�r +[ +i ++1] == 'I'){ + +62 }if( +�r +[ +i ++1] == 'l'){ + +64 }if( +�r +[ +i ++1] == 'm'){ + +66 }if( +�r +[ +i ++1] == 'p'){ + +68 }if( +�r +[ +i ++1] == 'q'){ + +70 }if( +�r +[ +i ++1] == 'r'){ + +72 }if( +�r +[ +i ++1] == 't'){ + +74 }if( +�r +[ +i ++1] == 'j'){ + +76 }if( +�r +[ +i ++1] == 'J'){ + +78 }if( +�r +[ +i ++1] == 'U'){ + +80 }if( +�r +[ +i ++1] == 'x' || str[i+1] == 'X'){ + +83 + `�r�tf +( +�d�r +, "E��: Inv�id f�m� s�cif��'%c'.\n", +�r +[ +i ++1]); + +86 +i +++; + +88 }if( +�r +[ +i +] == '@'){ + +89 if( +i + =� +�n +-1){ + +91 + `�r�tf +( +�d�r +, "Error: Incomplete format specifier.\n"); + +94 +i +++; + +95 }if( +�r +[ +i +] == '\\'){ + +96 if( +i + =� +�n +-1){ + +98 + `�r�tf +( +�d�r +, "Error: Incomplete�scape specifier.\n"); + +101 +�r +[ +i ++1]){ + +113 + `�r�tf +( +�d�r +, "E��: Inv�id�s�� s�cif��'%c'.\n", +�r +[ +i ++1]); + +116 +i +++; + +122 + } +} + +125 + $��_c�fig +( +mosq_c�fig + * +cfg +, +pub_�_sub +) + +127 + `mem�t +( +cfg +, 0, (*cfg)); + +128 +cfg +-> +p�t + = -1; + +129 +cfg +-> +max_��ight + = 20; + +130 +cfg +-> +k��live + = 60; + +131 +cfg +-> +��n_�ssi� + = +�ue +; + +132 +cfg +-> +e� + = +�ue +; + +133 +cfg +-> +���_cou� + = 1; + +134 +cfg +-> +���_d�ay +. +tv_�c + = 0; + +135 +cfg +-> +���_d�ay +. +tv_u�c + = 0; + +136 if( +pub_�_sub + =� +CLIENT_RR +){ + +137 +cfg +-> +��oc�_v�si� + = +MQTT_PROTOCOL_V5 +; + +138 +cfg +-> +msg_cou� + = 1; + +140 +cfg +-> +��oc�_v�si� + = +MQTT_PROTOCOL_V311 +; + +142 + } +} + +144 + $���_c�fig_��nup +( +mosq_c�fig + * +cfg +) + +146 +i +; + +147 + `� +( +cfg +-> +id +); + +148 + `� +( +cfg +-> +id_�efix +); + +149 + `� +( +cfg +-> +ho� +); + +150 + `� +( +cfg +-> +f�e_�put +); + +151 + `� +( +cfg +-> +mes�ge +); + +152 + `� +( +cfg +-> +t�ic +); + +153 + `� +( +cfg +-> +b�d_add�ss +); + +154 + `� +( +cfg +-> +u��ame +); + +155 + `� +( +cfg +-> +�ssw�d +); + +156 + `� +( +cfg +-> +w�l_t�ic +); + +157 + `� +( +cfg +-> +w�l_�yl�d +); + +158 + `� +( +cfg +-> +f�m� +); + +159 + `� +( +cfg +-> +��ڣ_t�ic +); + +160 #ifde� +WITH_TLS + + +161 + `� +( +cfg +-> +�f�e +); + +162 + `� +( +cfg +-> +��th +); + +163 + `� +( +cfg +-> +��f�e +); + +164 + `� +( +cfg +-> +keyf�e +); + +165 + `� +( +cfg +-> +c�h�s +); + +166 + `� +( +cfg +-> +�s_�� +); + +167 + `� +( +cfg +-> +�s_v�si� +); + +168 + `� +( +cfg +-> +�s_�g�e +); + +169 + `� +( +cfg +-> +�s_�g�e_k�ss_sha1 +); + +170 + `� +( +cfg +-> +keyf�m +); + +171 #ifde� +FINAL_WITH_TLS_PSK + + +172 + `� +( +cfg +-> +psk +); + +173 + `� +( +cfg +-> +psk_id�t�y +); + +176 if( +cfg +-> +t�ics +){ + +177 +i +=0; i< +cfg +-> +t�ic_cou� +; i++){ + +178 + `� +( +cfg +-> +t�ics +[ +i +]); + +180 + `� +( +cfg +-> +t�ics +); + +182 if( +cfg +-> +f��r_outs +){ + +183 +i +=0; i< +cfg +-> +f��r_out_cou� +; i++){ + +184 + `� +( +cfg +-> +f��r_outs +[ +i +]); + +186 + `� +( +cfg +-> +f��r_outs +); + +188 if( +cfg +-> +unsub_t�ics +){ + +189 +i +=0; i< +cfg +-> +unsub_t�ic_cou� +; i++){ + +190 + `� +( +cfg +-> +unsub_t�ics +[ +i +]); + +192 + `� +( +cfg +-> +unsub_t�ics +); + +194 #ifde� +WITH_SOCKS + + +195 + `� +( +cfg +-> +socks5_ho� +); + +196 + `� +( +cfg +-> +socks5_u��ame +); + +197 + `� +( +cfg +-> +socks5_�ssw�d +); + +199 + `mosqu�to_�ݔty_�_�l +(& +cfg +-> +c���_��s +); + +200 + `mosqu�to_�ݔty_�_�l +(& +cfg +-> +publish_��s +); + +201 + `mosqu�to_�ݔty_�_�l +(& +cfg +-> +subs�ibe_��s +); + +202 + `mosqu�to_�ݔty_�_�l +(& +cfg +-> +unsubs�ibe_��s +); + +203 + `mosqu�to_�ݔty_�_�l +(& +cfg +-> +disc���_��s +); + +204 + `mosqu�to_�ݔty_�_�l +(& +cfg +-> +w�l_��s +); + +205 + } +} + +207 + $���_c�fig_l�d +( +mosq_c�fig + * +cfg +, +pub_�_sub +, +�gc +, * +�gv +[]) + +209 +rc +; + +210 +FILE + * +� +; + +211 +l�e +[1024]; + +212 +cou� +; + +213 * +loc + = +NULL +; + +214 +�n +; + +215 * +�gs +[3]; + +217 #i�de� +WIN32 + + +218 * +�v +; + +220 +�v +[1024]; + +222 +�gs +[0] = +NULL +; + +224 + `��_c�fig +( +cfg +, +pub_�_sub +); + +227 #i�de� +WIN32 + + +228 +�v + = + `g��v +("XDG_CONFIG_HOME"); + +229 if( +�v +){ + +230 +�n + = + `��� +( +�v +) + strlen("/mosquitto_pub") + 1; + +231 +loc + = + `m�loc +( +�n +); + +232 if(! +loc +){ + +233 + `�r_��tf +( +cfg +, "Error: Out of memory.\n"); + +236 if( +pub_�_sub + =� +CLIENT_PUB +){ + +237 + `���tf +( +loc +, +�n +, "%s/mosqu�to_pub", +�v +); + +238 }if( +pub_�_sub + =� +CLIENT_SUB +){ + +239 + `���tf +( +loc +, +�n +, "%s/mosqu�to_sub", +�v +); + +241 + `���tf +( +loc +, +�n +, "%s/mosqu�to_�", +�v +); + +243 +loc +[ +�n +-1] = '\0'; + +245 +�v + = + `g��v +("HOME"); + +246 if( +�v +){ + +247 +�n + = + `��� +( +�v +) + strlen("/.config/mosquitto_pub") + 1; + +248 +loc + = + `m�loc +( +�n +); + +249 if(! +loc +){ + +250 + `�r_��tf +( +cfg +, "Error: Out of memory.\n"); + +253 if( +pub_�_sub + =� +CLIENT_PUB +){ + +254 + `���tf +( +loc +, +�n +, "%s/.c�fig/mosqu�to_pub", +�v +); + +255 }if( +pub_�_sub + =� +CLIENT_SUB +){ + +256 + `���tf +( +loc +, +�n +, "%s/.c�fig/mosqu�to_sub", +�v +); + +258 + `���tf +( +loc +, +�n +, "%s/.c�fig/mosqu�to_�", +�v +); + +260 +loc +[ +�n +-1] = '\0'; + +265 +rc + = + `G�Env��m�tV��b� +("USERPROFILE", +�v +, 1024); + +266 if( +rc + > 0 &&�c < 1024){ + +267 +�n + = + `��� +( +�v +) + strlen("\\mosquitto_pub.conf") + 1; + +268 +loc + = + `m�loc +( +�n +); + +269 if(! +loc +){ + +270 + `�r_��tf +( +cfg +, "Error: Out of memory.\n"); + +273 if( +pub_�_sub + =� +CLIENT_PUB +){ + +274 + `���tf +( +loc +, +�n +, "%s\\mosqu�to_pub.c�f", +�v +); + +275 }if( +pub_�_sub + =� +CLIENT_SUB +){ + +276 + `���tf +( +loc +, +�n +, "%s\\mosqu�to_sub.c�f", +�v +); + +278 + `���tf +( +loc +, +�n +, "%s\\mosqu�to_�.c�f", +�v +); + +280 +loc +[ +�n +-1] = '\0'; + +284 if( +loc +){ + +285 +� + = + `fݒ +( +loc +, "rt"); + +286 if( +� +){ + +287 + `fg�s +( +l�e +, 1024, +� +)){ + +288 if( +l�e +[0] == '#') ; + +290 +l�e +[ + `��� +(line)-1] == 10 ||�ine[strlen(line)-1] == 13){ + +291 +l�e +[ + `��� +(line)-1] = 0; + +295 +�gs +[1] = + `��ok +( +l�e +, " "); + +296 if( +�gs +[1]){ + +297 +�gs +[2] = + `��ok +( +NULL +, " "); + +298 if( +�gs +[2]){ + +299 +cou� + = 3; + +301 +cou� + = 2; + +303 +rc + = + `���_c�fig_l�e_�oc +( +cfg +, +pub_�_sub +, +cou� +, +�gs +); + +304 if( +rc +){ + +305 + `f�o� +( +� +); + +306 + `� +( +loc +); + +307 +rc +; + +311 + `f�o� +( +� +); + +313 + `� +( +loc +); + +317 +rc + = + `���_c�fig_l�e_�oc +( +cfg +, +pub_�_sub +, +�gc +, +�gv +); + +318 if( +rc +) �c; + +320 if( +cfg +-> +w�l_�yl�d + && !cfg-> +w�l_t�ic +){ + +321 + `�r�tf +( +�d�r +, "Error: Will�ayload given, but�o will�opic given.\n"); + +324 if( +cfg +-> +w�l_��� + && !cfg-> +w�l_t�ic +){ + +325 + `�r�tf +( +�d�r +, "Error: Will�etain given, but�o will�opic given.\n"); + +328 #ifde� +WITH_TLS + + +329 if(( +cfg +-> +��f�e + && !cfg-> +keyf�e +) || (cfg->keyfile && !cfg->certfile)){ + +330 + `�r�tf +( +�d�r +, "Error: Both certfile�nd keyfile must be�rovided if one of�hem is set.\n"); + +333 if(( +cfg +-> +keyf�m + && !cfg-> +keyf�e +)){ + +334 + `�r�tf +( +�d�r +, "Error: If keyform is set, keyfile must be�lso specified.\n"); + +337 if(( +cfg +-> +�s_�g�e_k�ss_sha1 + && (!cfg-> +keyf�m + || !cfg-> +�s_�g�e +))){ + +338 + `�r�tf +( +�d�r +, "Error: when using�ls-engine-kpass-sha1, both�ls-engine�nd keyform must�lso be�rovided.\n"); + +342 #ifde� +FINAL_WITH_TLS_PSK + + +343 if(( +cfg +-> +�f�e + || cfg-> +��th +�&& cfg-> +psk +){ + +344 + `�r�tf +( +�d�r +, "Error: Only one of --psk or --cafile/--capath may be used�t once.\n"); + +347 if( +cfg +-> +psk + && !cfg-> +psk_id�t�y +){ + +348 + `�r�tf +( +�d�r +, "Error: --psk-identity�equired if --psk used.\n"); + +353 if( +cfg +-> +��n_�ssi� + =� +�l� + && (cfg-> +id_�efix + || !cfg-> +id +)){ + +354 + `�r�tf +( +�d�r +, "Error: You must�rovide� client id if you�re using�he -c option.\n"); + +358 if( +pub_�_sub + =� +CLIENT_SUB +){ + +359 if( +cfg +-> +t�ic_cou� + == 0){ + +360 + `�r�tf +( +�d�r +, "Error: You must specify��opic�o subscribe�o.\n"); + +365 if(! +cfg +-> +ho� +){ + +366 +cfg +-> +ho� + = + `�rdup +("localhost"); + +367 if(! +cfg +-> +ho� +){ + +368 + `�r_��tf +( +cfg +, "Error: Out of memory.\n"); + +373 +rc + = + `mosqu�to_�ݔty_check_�l +( +CMD_CONNECT +, +cfg +-> +c���_��s +); + +374 if( +rc +){ + +375 + `�r_��tf +( +cfg +, "E�� i�CONNECT�rݔt�s: %s\n", + `mosqu�to_���� +( +rc +)); + +378 +rc + = + `mosqu�to_�ݔty_check_�l +( +CMD_PUBLISH +, +cfg +-> +publish_��s +); + +379 if( +rc +){ + +380 + `�r_��tf +( +cfg +, "E�� i�PUBLISH�rݔt�s: %s\n", + `mosqu�to_���� +( +rc +)); + +383 +rc + = + `mosqu�to_�ݔty_check_�l +( +CMD_SUBSCRIBE +, +cfg +-> +subs�ibe_��s +); + +384 if( +rc +){ + +385 + `�r_��tf +( +cfg +, "E�� i�SUBSCRIBE�rݔt�s: %s\n", + `mosqu�to_���� +( +rc +)); + +388 +rc + = + `mosqu�to_�ݔty_check_�l +( +CMD_UNSUBSCRIBE +, +cfg +-> +unsubs�ibe_��s +); + +389 if( +rc +){ + +390 + `�r_��tf +( +cfg +, "E�� i�UNSUBSCRIBE�rݔt�s: %s\n", + `mosqu�to_���� +( +rc +)); + +393 +rc + = + `mosqu�to_�ݔty_check_�l +( +CMD_DISCONNECT +, +cfg +-> +disc���_��s +); + +394 if( +rc +){ + +395 + `�r_��tf +( +cfg +, "E�� i�DISCONNECT�rݔt�s: %s\n", + `mosqu�to_���� +( +rc +)); + +398 +rc + = + `mosqu�to_�ݔty_check_�l +( +CMD_WILL +, +cfg +-> +w�l_��s +); + +399 if( +rc +){ + +400 + `�r_��tf +( +cfg +, "E�� i�W�ȴݔt�s: %s\n", + `mosqu�to_���� +( +rc +)); + +404 +MOSQ_ERR_SUCCESS +; + +405 + } +} + +407 + $cfg_add_t�ic +( +mosq_c�fig + * +cfg +, +ty� +, * +t�ic +, cڡ * +�g +) + +409 if( + `mosqu�to_v�id�e_utf8 +( +t�ic +, + `��� +(topic))){ + +410 + `�r�tf +( +�d�r +, "E��: M�f�med UTF-8 i�%��gum�t.\n\n", +�g +); + +413 if( +ty� + =� +CLIENT_PUB + ||�y� =� +CLIENT_RR +){ + +414 if( + `mosqu�to_pub_t�ic_check +( +t�ic +�=� +MOSQ_ERR_INVAL +){ + +415 + `�r�tf +( +�d�r +, "E��: Inv�id�ublish��i�'%s', d۠� cڏ� '+' o�'#'?\n", +t�ic +); + +418 +cfg +-> +t�ic + = + `�rdup +(topic); + +419 }if( +ty� + =� +CLIENT_RESPONSE_TOPIC +){ + +420 if( + `mosqu�to_pub_t�ic_check +( +t�ic +�=� +MOSQ_ERR_INVAL +){ + +421 + `�r�tf +( +�d�r +, "E��: Inv�id�e�ڣ��i�'%s', d۠� cڏ� '+' o�'#'?\n", +t�ic +); + +424 +cfg +-> +��ڣ_t�ic + = + `�rdup +( +t�ic +); + +426 if( + `mosqu�to_sub_t�ic_check +( +t�ic +�=� +MOSQ_ERR_INVAL +){ + +427 + `�r�tf +( +�d�r +, "E��: Inv�id subs��tiځ�i�'%s',���� '+'�nd '#' w�d�rd�cܻ�?\n", +t�ic +); + +430 +cfg +-> +t�ic_cou� +++; + +431 +cfg +-> +t�ics + = + `��loc +(cfg->t�ics, cfg-> +t�ic_cou� +*(*)); + +432 if(! +cfg +-> +t�ics +){ + +433 + `�r_��tf +( +cfg +, "Error: Out of memory.\n"); + +436 +cfg +-> +t�ics +[cfg-> +t�ic_cou� +-1] = + `�rdup +( +t�ic +); + +439 + } +} + +442 + $���_c�fig_l�e_�oc +( +mosq_c�fig + * +cfg +, +pub_�_sub +, +�gc +, * +�gv +[]) + +444 +i +; + +445 +f +; + +447 +i +=1; i< +�gc +; i++){ + +448 if(! + `�rcmp +( +�gv +[ +i +], "-A")){ + +449 if( +i +== +�gc +-1){ + +450 + `�r�tf +( +�d�r +, "Error: -A�rgument given but�o�ddress specified.\n\n"); + +453 +cfg +-> +b�d_add�ss + = + `�rdup +( +�gv +[ +i ++1]); + +455 +i +++; + +456 #ifde� +WITH_TLS + + +457 }if(! + `�rcmp +( +�gv +[ +i +], "--cafile")){ + +458 if( +i +== +�gc +-1){ + +459 + `�r�tf +( +�d�r +, "Error: --cafile�rgument given but�o file specified.\n\n"); + +462 +cfg +-> +�f�e + = + `�rdup +( +�gv +[ +i ++1]); + +464 +i +++; + +465 }if(! + `�rcmp +( +�gv +[ +i +], "--capath")){ + +466 if( +i +== +�gc +-1){ + +467 + `�r�tf +( +�d�r +, "Error: --capath�rgument given but�o directory specified.\n\n"); + +470 +cfg +-> +��th + = + `�rdup +( +�gv +[ +i ++1]); + +472 +i +++; + +473 }if(! + `�rcmp +( +�gv +[ +i +], "--cert")){ + +474 if( +i +== +�gc +-1){ + +475 + `�r�tf +( +�d�r +, "Error: --cert�rgument given but�o file specified.\n\n"); + +478 +cfg +-> +��f�e + = + `�rdup +( +�gv +[ +i ++1]); + +480 +i +++; + +481 }if(! + `�rcmp +( +�gv +[ +i +], "--ciphers")){ + +482 if( +i +== +�gc +-1){ + +483 + `�r�tf +( +�d�r +, "Error: --ciphers�rgument given but�o ciphers specified.\n\n"); + +486 +cfg +-> +c�h�s + = + `�rdup +( +�gv +[ +i ++1]); + +488 +i +++; + +490 }if(! + `�rcmp +( +�gv +[ +i +], "-C")){ + +491 if( +pub_�_sub + !� +CLIENT_SUB +){ + +492 +unknown_�ti� +; + +494 if( +i +== +�gc +-1){ + +495 + `�r�tf +( +�d�r +, "Error: -C�rgument given but�o count specified.\n\n"); + +498 +cfg +-> +msg_cou� + = + `�oi +( +�gv +[ +i ++1]); + +499 if( +cfg +-> +msg_cou� + < 1){ + +500 + `�r�tf +( +�d�r +, "E��: Inv�id mes�g�cou� \"%d\".\n\n", +cfg +-> +msg_cou� +); + +504 +i +++; + +506 }if(! + `�rcmp +( +�gv +[ +i +], "-c") || !strcmp(argv[i], "--disable-clean-session")){ + +507 +cfg +-> +��n_�ssi� + = +�l� +; + +508 }if(! + `�rcmp +( +�gv +[ +i +], "-d") || !strcmp(argv[i], "--debug")){ + +509 +cfg +-> +debug + = +�ue +; + +510 }if(! + `�rcmp +( +�gv +[ +i +], "-D") || !strcmp(argv[i], "--property")){ + +511 +i +++; + +512 if( + `cfg_�r�_�ݔty +( +cfg +, +�gc +, +�gv +, & +i +)){ + +515 +cfg +-> +��oc�_v�si� + = +MQTT_PROTOCOL_V5 +; + +516 }if(! + `�rcmp +( +�gv +[ +i +], "-e")){ + +517 if( +pub_�_sub + !� +CLIENT_RR +){ + +518 +unknown_�ti� +; + +520 if( +i +== +�gc +-1){ + +521 + `�r�tf +( +�d�r +, "Error: -e�rgument given but�o�esponse�opic specified.\n\n"); + +524 if( + `cfg_add_t�ic +( +cfg +, +CLIENT_RESPONSE_TOPIC +, +�gv +[ +i ++1], "-e")){ + +528 +i +++; + +529 }if(! + `�rcmp +( +�gv +[ +i +], "-E")){ + +530 if( +pub_�_sub + !� +CLIENT_SUB +){ + +531 +unknown_�ti� +; + +533 +cfg +-> +ex�_a�_sub + = +�ue +; + +534 }if(! + `�rcmp +( +�gv +[ +i +], "-f") || !strcmp(argv[i], "--file")){ + +535 if( +pub_�_sub + =� +CLIENT_SUB +){ + +536 +unknown_�ti� +; + +538 if( +cfg +-> +pub_mode + !� +MSGMODE_NONE +){ + +539 + `�r�tf +( +�d�r +, "Error: Only one�ype of message can be sent�t once.\n\n"); + +541 }if( +i +== +�gc +-1){ + +542 + `�r�tf +( +�d�r +, "Error: -f�rgument given but�o file specified.\n\n"); + +545 +cfg +-> +pub_mode + = +MSGMODE_FILE +; + +546 +cfg +-> +f�e_�put + = + `�rdup +( +�gv +[ +i ++1]); + +547 if(! +cfg +-> +f�e_�put +){ + +548 + `�r_��tf +( +cfg +, "Error: Out of memory.\n"); + +552 +i +++; + +553 }if(! + `�rcmp +( +�gv +[ +i +], "-F")){ + +554 if( +pub_�_sub + =� +CLIENT_PUB +){ + +555 +unknown_�ti� +; + +557 if( +i +== +�gc +-1){ + +558 + `�r�tf +( +�d�r +, "Error: -F�rgument given but�o format specified.\n\n"); + +561 +cfg +-> +f�m� + = + `�rdup +( +�gv +[ +i ++1]); + +562 if(! +cfg +-> +f�m� +){ + +563 + `�r�tf +( +�d�r +, "Error: Out of memory.\n"); + +566 if( + `check_f�m� +( +cfg +-> +f�m� +)){ + +570 +i +++; + +571 }if(! + `�rcmp +( +�gv +[ +i +], "--help")){ + +573 }if(! + `�rcmp +( +�gv +[ +i +], "-h") || !strcmp(argv[i], "--host")){ + +574 if( +i +== +�gc +-1){ + +575 + `�r�tf +( +�d�r +, "Error: -h�rgument given but�o host specified.\n\n"); + +578 +cfg +-> +ho� + = + `�rdup +( +�gv +[ +i ++1]); + +580 +i +++; + +581 #ifde� +WITH_TLS + + +582 }if(! + `�rcmp +( +�gv +[ +i +], "--insecure")){ + +583 +cfg +-> +��cu� + = +�ue +; + +585 }if(! + `�rcmp +( +�gv +[ +i +], "-i") || !strcmp(argv[i], "--id")){ + +586 if( +cfg +-> +id_�efix +){ + +587 + `�r�tf +( +�d�r +, "Error: -i�nd -I�rgument cannot be used�ogether.\n\n"); + +590 if( +i +== +�gc +-1){ + +591 + `�r�tf +( +�d�r +, "Error: -i�rgument given but�o id specified.\n\n"); + +594 +cfg +-> +id + = + `�rdup +( +�gv +[ +i ++1]); + +596 +i +++; + +597 }if(! + `�rcmp +( +�gv +[ +i +], "-I") || !strcmp(argv[i], "--id-prefix")){ + +598 if( +cfg +-> +id +){ + +599 + `�r�tf +( +�d�r +, "Error: -i�nd -I�rgument cannot be used�ogether.\n\n"); + +602 if( +i +== +�gc +-1){ + +603 + `�r�tf +( +�d�r +, "Error: -I�rgument given but�o id�refix specified.\n\n"); + +606 +cfg +-> +id_�efix + = + `�rdup +( +�gv +[ +i ++1]); + +608 +i +++; + +609 }if(! + `�rcmp +( +�gv +[ +i +], "-k") || !strcmp(argv[i], "--keepalive")){ + +610 if( +i +== +�gc +-1){ + +611 + `�r�tf +( +�d�r +, "Error: -k�rgument given but�o keepalive specified.\n\n"); + +614 +cfg +-> +k��live + = + `�oi +( +�gv +[ +i ++1]); + +615 if( +cfg +-> +k��live +>65535){ + +616 + `�r�tf +( +�d�r +, "E��: Inv�id k��liv�giv�: %d\n", +cfg +-> +k��live +); + +620 +i +++; + +621 #ifde� +WITH_TLS + + +622 }if(! + `�rcmp +( +�gv +[ +i +], "--key")){ + +623 if( +i +== +�gc +-1){ + +624 + `�r�tf +( +�d�r +, "Error: --key�rgument given but�o file specified.\n\n"); + +627 +cfg +-> +keyf�e + = + `�rdup +( +�gv +[ +i ++1]); + +629 +i +++; + +630 }if(! + `�rcmp +( +�gv +[ +i +], "--keyform")){ + +631 if( +i +== +�gc +-1){ + +632 + `�r�tf +( +�d�r +, "Error: --keyform�rgument given but�o keyform specified.\n\n"); + +635 +cfg +-> +keyf�m + = + `�rdup +( +�gv +[ +i ++1]); + +637 +i +++; + +639 }if(! + `�rcmp +( +�gv +[ +i +], "-L") || !strcmp(argv[i], "--url")){ + +640 if( +i +== +�gc +-1){ + +641 + `�r�tf +( +�d�r +, "Error: -L�rgument given but�o URL specified.\n\n"); + +644 * +u� + = +�gv +[ +i ++1]; + +645 * +t�ic +; + +646 * +tmp +; + +648 if(! + `����cmp +( +u� +, "mqtt://", 7)) { + +649 +u� + += 7; + +650 +cfg +-> +p�t + = 1883; + +651 } if(! + `����cmp +( +u� +, "mqtts://", 8)) { + +652 +u� + += 8; + +653 +cfg +-> +p�t + = 8883; + +655 + `�r�tf +( +�d�r +, "Error: unsupported URL scheme.\n\n"); + +658 +t�ic + = + `�rchr +( +u� +, '/'); + +659 if(! +t�ic +){ + +660 + `�r�tf +( +�d�r +, "Error: Invalid URL for -L�rgument specified -�opic missing.\n"); + +663 * +t�ic +++ = 0; + +665 if( + `cfg_add_t�ic +( +cfg +, +pub_�_sub +, +t�ic +, "-L�opic")) + +668 +tmp + = + `�rchr +( +u� +, '@'); + +669 if( +tmp +) { + +670 * +tmp +++ = 0; + +671 * +c�� + = + `�rchr +( +u� +, ':'); + +672 if( +c�� +) { + +673 * +c�� + = 0; + +674 +cfg +-> +�ssw�d + = + `�rdup +( +c�� + + 1); + +676 +cfg +-> +u��ame + = + `�rdup +( +u� +); + +677 +u� + = +tmp +; + +679 +cfg +-> +ho� + = +u� +; + +681 +tmp + = + `�rchr +( +u� +, ':'); + +682 if( +tmp +) { + +683 * +tmp +++ = 0; + +684 +cfg +-> +p�t + = + `�oi +( +tmp +); + +687 +cfg +-> +ho� + = + `�rdup +(cfg->host); + +689 +i +++; + +690 }if(! + `�rcmp +( +�gv +[ +i +], "-l") || !strcmp(argv[i], "--stdin-line")){ + +691 if( +pub_�_sub + !� +CLIENT_PUB +){ + +692 +unknown_�ti� +; + +694 if( +cfg +-> +pub_mode + !� +MSGMODE_NONE +){ + +695 + `�r�tf +( +�d�r +, "Error: Only one�ype of message can be sent�t once.\n\n"); + +698 +cfg +-> +pub_mode + = +MSGMODE_STDIN_LINE +; + +700 }if(! + `�rcmp +( +�gv +[ +i +], "-m") || !strcmp(argv[i], "--message")){ + +701 if( +pub_�_sub + =� +CLIENT_SUB +){ + +702 +unknown_�ti� +; + +704 if( +cfg +-> +pub_mode + !� +MSGMODE_NONE +){ + +705 + `�r�tf +( +�d�r +, "Error: Only one�ype of message can be sent�t once.\n\n"); + +707 }if( +i +== +�gc +-1){ + +708 + `�r�tf +( +�d�r +, "Error: -m�rgument given but�o message specified.\n\n"); + +711 +cfg +-> +mes�ge + = + `�rdup +( +�gv +[ +i ++1]); + +712 +cfg +-> +msg�n + = + `��� +(cfg-> +mes�ge +); + +713 +cfg +-> +pub_mode + = +MSGMODE_CMD +; + +715 +i +++; + +716 }if(! + `�rcmp +( +�gv +[ +i +], "-M")){ + +717 if( +i +== +�gc +-1){ + +718 + `�r�tf +( +�d�r +, "Error: -M�rgument given but max_inflight�ot specified.\n\n"); + +721 +cfg +-> +max_��ight + = + `�oi +( +�gv +[ +i ++1]); + +723 +i +++; + +724 }if(! + `�rcmp +( +�gv +[ +i +], "-n") || !strcmp(argv[i], "--null-message")){ + +725 if( +pub_�_sub + =� +CLIENT_SUB +){ + +726 +unknown_�ti� +; + +728 if( +cfg +-> +pub_mode + !� +MSGMODE_NONE +){ + +729 + `�r�tf +( +�d�r +, "Error: Only one�ype of message can be sent�t once.\n\n"); + +732 +cfg +-> +pub_mode + = +MSGMODE_NULL +; + +734 }if(! + `�rcmp +( +�gv +[ +i +], "-N")){ + +735 if( +pub_�_sub + =� +CLIENT_PUB +){ + +736 +unknown_�ti� +; + +738 +cfg +-> +e� + = +�l� +; + +739 }if(! + `�rcmp +( +�gv +[ +i +], "-p") || !strcmp(argv[i], "--port")){ + +740 if( +i +== +�gc +-1){ + +741 + `�r�tf +( +�d�r +, "Error: -p�rgument given but�o�ort specified.\n\n"); + +744 +cfg +-> +p�t + = + `�oi +( +�gv +[ +i ++1]); + +745 if( +cfg +-> +p�t +<1 || cfg->port>65535){ + +746 + `�r�tf +( +�d�r +, "E��: Inv�id�܈giv�: %d\n", +cfg +-> +p�t +); + +750 +i +++; + +751 }if(! + `�rcmp +( +�gv +[ +i +], "-P") || !strcmp(argv[i], "--pw")){ + +752 if( +i +== +�gc +-1){ + +753 + `�r�tf +( +�d�r +, "Error: -P�rgument given but�o�assword specified.\n\n"); + +756 +cfg +-> +�ssw�d + = + `�rdup +( +�gv +[ +i ++1]); + +758 +i +++; + +759 #ifde� +WITH_SOCKS + + +760 }if(! + `�rcmp +( +�gv +[ +i +], "--proxy")){ + +761 if( +i +== +�gc +-1){ + +762 + `�r�tf +( +�d�r +, "Error: --proxy�rgument given but�o�roxy url specified.\n\n"); + +765 if( + `mosqu�to__�r�_socks_u� +( +cfg +, +�gv +[ +i ++1])){ + +768 +i +++; + +771 #ifde� +FINAL_WITH_TLS_PSK + + +772 }if(! + `�rcmp +( +�gv +[ +i +], "--psk")){ + +773 if( +i +== +�gc +-1){ + +774 + `�r�tf +( +�d�r +, "Error: --psk�rgument given but�o key specified.\n\n"); + +777 +cfg +-> +psk + = + `�rdup +( +�gv +[ +i ++1]); + +779 +i +++; + +780 }if(! + `�rcmp +( +�gv +[ +i +], "--psk-identity")){ + +781 if( +i +== +�gc +-1){ + +782 + `�r�tf +( +�d�r +, "Error: --psk-identity�rgument given but�o identity specified.\n\n"); + +785 +cfg +-> +psk_id�t�y + = + `�rdup +( +�gv +[ +i ++1]); + +787 +i +++; + +789 }if(! + `�rcmp +( +�gv +[ +i +], "-q") || !strcmp(argv[i], "--qos")){ + +790 if( +i +== +�gc +-1){ + +791 + `�r�tf +( +�d�r +, "Error: -q�rgument given but�o QoS specified.\n\n"); + +794 +cfg +-> +qos + = + `�oi +( +�gv +[ +i ++1]); + +795 if( +cfg +-> +qos +<0 || cfg->qos>2){ + +796 + `�r�tf +( +�d�r +, "E��: Inv�id QoS giv�: %d\n", +cfg +-> +qos +); + +800 +i +++; + +801 }if(! + `�rcmp +( +�gv +[ +i +], "--quiet")){ + +802 +cfg +-> +qu�t + = +�ue +; + +803 }if(! + `�rcmp +( +�gv +[ +i +], "-r") || !strcmp(argv[i], "--retain")){ + +804 if( +pub_�_sub + !� +CLIENT_PUB +){ + +805 +unknown_�ti� +; + +807 +cfg +-> +��� + = 1; + +808 }if(! + `�rcmp +( +�gv +[ +i +], "-R")){ + +809 if( +pub_�_sub + =� +CLIENT_PUB +){ + +810 +unknown_�ti� +; + +812 +cfg +-> +no_��� + = +�ue +; + +813 +cfg +-> +sub_�ts + |� +MQTT_SUB_OPT_SEND_RETAIN_NEVER +; + +814 }if(! + `�rcmp +( +�gv +[ +i +], "--remove-retained")){ + +815 if( +pub_�_sub + !� +CLIENT_SUB +){ + +816 +unknown_�ti� +; + +818 +cfg +-> +�move_���ed + = +�ue +; + +819 }if(! + `�rcmp +( +�gv +[ +i +], "--repeat")){ + +820 if( +pub_�_sub + !� +CLIENT_PUB +){ + +821 +unknown_�ti� +; + +823 if( +i +== +�gc +-1){ + +824 + `�r�tf +( +�d�r +, "Error: --repeat�rgument given but�o count specified.\n\n"); + +827 +cfg +-> +���_cou� + = + `�oi +( +�gv +[ +i ++1]); + +828 if( +cfg +-> +���_cou� + < 1){ + +829 + `�r�tf +( +�d�r +, "Error: --repeat�rgument must be >0.\n\n"); + +833 +i +++; + +834 }if(! + `�rcmp +( +�gv +[ +i +], "--repeat-delay")){ + +835 if( +pub_�_sub + !� +CLIENT_PUB +){ + +836 +unknown_�ti� +; + +838 if( +i +== +�gc +-1){ + +839 + `�r�tf +( +�d�r +, "Error: --repeat-delay�rgument given but�o�ime specified.\n\n"); + +842 +f + = + `�of +( +�gv +[ +i ++1]); + +843 if( +f + < 0.0f){ + +844 + `�r�tf +( +�d�r +, "Error: --repeat-delay�rgument must be >=0.0.\n\n"); + +847 +f + *= 1.0e6; + +848 +cfg +-> +���_d�ay +. +tv_�c + = () +f +/1e6; + +849 +cfg +-> +���_d�ay +. +tv_u�c + = () +f +%1000000; + +851 +i +++; + +852 }if(! + `�rcmp +( +�gv +[ +i +], "--retain-as-published")){ + +853 if( +pub_�_sub + =� +CLIENT_PUB +){ + +854 +unknown_�ti� +; + +856 +cfg +-> +sub_�ts + |� +MQTT_SUB_OPT_RETAIN_AS_PUBLISHED +; + +857 }if(! + `�rcmp +( +�gv +[ +i +], "--retained-only")){ + +858 if( +pub_�_sub + !� +CLIENT_SUB +){ + +859 +unknown_�ti� +; + +861 +cfg +-> +���ed_�ly + = +�ue +; + +862 }if(! + `�rcmp +( +�gv +[ +i +], "-s") || !strcmp(argv[i], "--stdin-file")){ + +863 if( +pub_�_sub + =� +CLIENT_SUB +){ + +864 +unknown_�ti� +; + +866 if( +cfg +-> +pub_mode + !� +MSGMODE_NONE +){ + +867 + `�r�tf +( +�d�r +, "Error: Only one�ype of message can be sent�t once.\n\n"); + +870 +cfg +-> +pub_mode + = +MSGMODE_STDIN_FILE +; + +872 #ifde� +WITH_SRV + + +873 }if(! + `�rcmp +( +�gv +[ +i +], "-S")){ + +874 +cfg +-> +u�_�v + = +�ue +; + +876 }if(! + `�rcmp +( +�gv +[ +i +], "-t") || !strcmp(argv[i], "--topic")){ + +877 if( +i +== +�gc +-1){ + +878 + `�r�tf +( +�d�r +, "Error: -t�rgument given but�o�opic specified.\n\n"); + +881 if( + `cfg_add_t�ic +( +cfg +, +pub_�_sub +, +�gv +[ +i + + 1], "-t")) + +883 +i +++; + +885 }if(! + `�rcmp +( +�gv +[ +i +], "-T") || !strcmp(argv[i], "--filter-out")){ + +886 if( +pub_�_sub + !� +CLIENT_SUB +){ + +887 +unknown_�ti� +; + +889 if( +i +== +�gc +-1){ + +890 + `�r�tf +( +�d�r +, "Error: -T�rgument given but�o�opic filter specified.\n\n"); + +893 if( + `mosqu�to_v�id�e_utf8 +( +�gv +[ +i ++1], + `��� +(argv[i+1]))){ + +894 + `�r�tf +( +�d�r +, "Error: Malformed UTF-8 in -T�rgument.\n\n"); + +897 if( + `mosqu�to_sub_t�ic_check +( +�gv +[ +i ++1]�=� +MOSQ_ERR_INVAL +){ + +898 + `�r�tf +( +�d�r +, "E��: Inv�id f���t�i�'%s',���� '+'�nd '#' w�d�rd�cܻ�?\n", +�gv +[ +i ++1]); + +901 +cfg +-> +f��r_out_cou� +++; + +902 +cfg +-> +f��r_outs + = + `��loc +(cfg->f��r_outs, cfg-> +f��r_out_cou� +*(*)); + +903 if(! +cfg +-> +f��r_outs +){ + +904 + `�r�tf +( +�d�r +, "Error: Out of memory.\n"); + +907 +cfg +-> +f��r_outs +[cfg-> +f��r_out_cou� +-1] = + `�rdup +( +�gv +[ +i ++1]); + +909 +i +++; + +910 #ifde� +WITH_TLS + + +911 }if(! + `�rcmp +( +�gv +[ +i +], "--tls-alpn")){ + +912 if( +i +== +�gc +-1){ + +913 + `�r�tf +( +�d�r +, "Error: --tls-alpn�rgument given but�o�rotocol specified.\n\n"); + +916 +cfg +-> +�s_�� + = + `�rdup +( +�gv +[ +i ++1]); + +918 +i +++; + +919 }if(! + `�rcmp +( +�gv +[ +i +], "--tls-engine")){ + +920 if( +i +== +�gc +-1){ + +921 + `�r�tf +( +�d�r +, "Error: --tls-engine�rgument given but�o�ngine_id specified.\n\n"); + +924 +cfg +-> +�s_�g�e + = + `�rdup +( +�gv +[ +i ++1]); + +926 +i +++; + +927 }if(! + `�rcmp +( +�gv +[ +i +], "--tls-engine-kpass-sha1")){ + +928 if( +i +== +�gc +-1){ + +929 + `�r�tf +( +�d�r +, "Error: --tls-engine-kpass-sha1�rgument given but�o kpass sha1 specified.\n\n"); + +932 +cfg +-> +�s_�g�e_k�ss_sha1 + = + `�rdup +( +�gv +[ +i ++1]); + +934 +i +++; + +935 }if(! + `�rcmp +( +�gv +[ +i +], "--tls-version")){ + +936 if( +i +== +�gc +-1){ + +937 + `�r�tf +( +�d�r +, "Error: --tls-version�rgument given but�o version specified.\n\n"); + +940 +cfg +-> +�s_v�si� + = + `�rdup +( +�gv +[ +i ++1]); + +942 +i +++; + +944 }if(! + `�rcmp +( +�gv +[ +i +], "-U") || !strcmp(argv[i], "--unsubscribe")){ + +945 if( +pub_�_sub + !� +CLIENT_SUB +){ + +946 +unknown_�ti� +; + +948 if( +i +== +�gc +-1){ + +949 + `�r�tf +( +�d�r +, "Error: -U�rgument given but�o unsubscribe�opic specified.\n\n"); + +952 if( + `mosqu�to_v�id�e_utf8 +( +�gv +[ +i ++1], + `��� +(argv[i+1]))){ + +953 + `�r�tf +( +�d�r +, "Error: Malformed UTF-8 in -U�rgument.\n\n"); + +956 if( + `mosqu�to_sub_t�ic_check +( +�gv +[ +i ++1]�=� +MOSQ_ERR_INVAL +){ + +957 + `�r�tf +( +�d�r +, "E��: Inv�id unsubs�ib�t�i�'%s',���� '+'�nd '#' w�d�rd�cܻ�?\n", +�gv +[ +i ++1]); + +960 +cfg +-> +unsub_t�ic_cou� +++; + +961 +cfg +-> +unsub_t�ics + = + `��loc +(cfg->unsub_t�ics, cfg-> +unsub_t�ic_cou� +*(*)); + +962 if(! +cfg +-> +unsub_t�ics +){ + +963 + `�r�tf +( +�d�r +, "Error: Out of memory.\n"); + +966 +cfg +-> +unsub_t�ics +[cfg-> +unsub_t�ic_cou� +-1] = + `�rdup +( +�gv +[ +i ++1]); + +968 +i +++; + +969 }if(! + `�rcmp +( +�gv +[ +i +], "-u") || !strcmp(argv[i], "--username")){ + +970 if( +i +== +�gc +-1){ + +971 + `�r�tf +( +�d�r +, "Error: -u�rgument given but�o username specified.\n\n"); + +974 +cfg +-> +u��ame + = + `�rdup +( +�gv +[ +i ++1]); + +976 +i +++; + +977 }if(! + `�rcmp +( +�gv +[ +i +], "-V") || !strcmp(argv[i], "--protocol-version")){ + +978 if( +i +== +�gc +-1){ + +979 + `�r�tf +( +�d�r +, "Error: --protocol-version�rgument given but�o version specified.\n\n"); + +982 if(! + `�rcmp +( +�gv +[ +i ++1], "mqttv31") || !strcmp(argv[i+1], "31")){ + +983 +cfg +-> +��oc�_v�si� + = +MQTT_PROTOCOL_V31 +; + +984 }if(! + `�rcmp +( +�gv +[ +i ++1], "mqttv311") || !strcmp(argv[i+1], "311")){ + +985 +cfg +-> +��oc�_v�si� + = +MQTT_PROTOCOL_V311 +; + +986 }if(! + `�rcmp +( +�gv +[ +i ++1], "mqttv5") || !strcmp(argv[i+1], "5")){ + +987 +cfg +-> +��oc�_v�si� + = +MQTT_PROTOCOL_V5 +; + +989 + `�r�tf +( +�d�r +, "Error: Invalid�rotocol version�rgument given.\n\n"); + +992 +i +++; + +994 }if(! + `�rcmp +( +�gv +[ +i +], "-v") || !strcmp(argv[i], "--verbose")){ + +995 if( +pub_�_sub + =� +CLIENT_PUB +){ + +996 +unknown_�ti� +; + +998 +cfg +-> +v�bo� + = 1; + +999 }if(! + `�rcmp +( +�gv +[ +i +], "-W")){ + +1000 if( +pub_�_sub + =� +CLIENT_PUB +){ + +1001 +unknown_�ti� +; + +1003 if( +i +== +�gc +-1){ + +1004 + `�r�tf +( +�d�r +, "Error: -W�rgument given but�o�imeout specified.\n\n"); + +1007 +cfg +-> +timeout + = + `�oi +( +�gv +[ +i ++1]); + +1008 if( +cfg +-> +timeout + < 1){ + +1009 + `�r�tf +( +�d�r +, "E��: Inv�id�imeou�\"%d\".\n\n", +cfg +-> +msg_cou� +); + +1013 +i +++; + +1015 }if(! + `�rcmp +( +�gv +[ +i +], "--will-payload")){ + +1016 if( +i +== +�gc +-1){ + +1017 + `�r�tf +( +�d�r +, "Error: --will-payload�rgument given but�o will�ayload specified.\n\n"); + +1020 +cfg +-> +w�l_�yl�d + = + `�rdup +( +�gv +[ +i ++1]); + +1021 +cfg +-> +w�l_�yl�d�n + = + `��� +(cfg-> +w�l_�yl�d +); + +1023 +i +++; + +1024 }if(! + `�rcmp +( +�gv +[ +i +], "--will-qos")){ + +1025 if( +i +== +�gc +-1){ + +1026 + `�r�tf +( +�d�r +, "Error: --will-qos�rgument given but�o will QoS specified.\n\n"); + +1029 +cfg +-> +w�l_qos + = + `�oi +( +�gv +[ +i ++1]); + +1030 if( +cfg +-> +w�l_qos + < 0 || cfg->will_qos > 2){ + +1031 + `�r�tf +( +�d�r +, "E��: Inv�id w��QoS %d.\n\n", +cfg +-> +w�l_qos +); + +1035 +i +++; + +1036 }if(! + `�rcmp +( +�gv +[ +i +], "--will-retain")){ + +1037 +cfg +-> +w�l_��� + = +�ue +; + +1038 }if(! + `�rcmp +( +�gv +[ +i +], "--will-topic")){ + +1039 if( +i +== +�gc +-1){ + +1040 + `�r�tf +( +�d�r +, "Error: --will-topic�rgument given but�o will�opic specified.\n\n"); + +1043 if( + `mosqu�to_v�id�e_utf8 +( +�gv +[ +i ++1], + `��� +(argv[i+1]))){ + +1044 + `�r�tf +( +�d�r +, "Error: Malformed UTF-8 in --will-topic�rgument.\n\n"); + +1047 if( + `mosqu�to_pub_t�ic_check +( +�gv +[ +i ++1]�=� +MOSQ_ERR_INVAL +){ + +1048 + `�r�tf +( +�d�r +, "E��: Inv�id w��t�i�'%s', d۠� cڏ� '+' o�'#'?\n", +�gv +[ +i ++1]); + +1051 +cfg +-> +w�l_t�ic + = + `�rdup +( +�gv +[ +i ++1]); + +1053 +i +++; + +1055 +unknown_�ti� +; + +1059 +MOSQ_ERR_SUCCESS +; + +1061 +unknown_�ti� +: + +1062 + `�r�tf +( +�d�r +, "E��: Unknow��ti� '%s'.\n", +�gv +[ +i +]); + +1064 + } +} + +1066 + $���_�ts_�t +( +mosqu�to + * +mosq +, +mosq_c�fig + * +cfg +) + +1068 #i� + `def�ed +( +WITH_TLS +�|| def�ed( +WITH_SOCKS +) + +1069 +rc +; + +1072 + `mosqu�to_�t_�ti� +( +mosq +, +MOSQ_OPT_PROTOCOL_VERSION +, +cfg +-> +��oc�_v�si� +); + +1074 if( +cfg +-> +w�l_t�ic + && + `mosqu�to_w�l_�t_v5 +( +mosq +, cfg->will_topic, + +1075 +cfg +-> +w�l_�yl�d�n +, cfg-> +w�l_�yl�d +, cfg-> +w�l_qos +, + +1076 +cfg +-> +w�l_��� +, cfg-> +w�l_��s +)){ + +1078 + `�r_��tf +( +cfg +, "Error: Problem setting will.\n"); + +1079 + `mosqu�to_lib_��nup +(); + +1082 +cfg +-> +w�l_��s + = +NULL +; + +1084 if(( +cfg +-> +u��ame + || cfg-> +�ssw�d +�&& + `mosqu�to_u��ame_pw_�t +( +mosq +, cfg->username, cfg->password)){ + +1085 + `�r_��tf +( +cfg +, "Error: Problem setting username�nd/or�assword.\n"); + +1086 + `mosqu�to_lib_��nup +(); + +1089 #ifde� +WITH_TLS + + +1090 if( +cfg +-> +�f�e + || cfg-> +��th +){ + +1091 +rc + = + `mosqu�to_�s_�t +( +mosq +, +cfg +-> +�f�e +, cfg-> +��th +, cfg-> +��f�e +, cfg-> +keyf�e +, +NULL +); + +1092 if( +rc +){ + +1093 if( +rc + =� +MOSQ_ERR_INVAL +){ + +1094 + `�r_��tf +( +cfg +, "Error: Problem setting TLS options: File�ot found.\n"); + +1096 + `�r_��tf +( +cfg +, "E��: Prob�m s�t�g TLS o�i�s: %s.\n", + `mosqu�to_���� +( +rc +)); + +1098 + `mosqu�to_lib_��nup +(); + +1102 if( +cfg +-> +��cu� + && + `mosqu�to_�s_��cu�_�t +( +mosq +, +�ue +)){ + +1103 + `�r_��tf +( +cfg +, "Error: Problem setting TLS insecure option.\n"); + +1104 + `mosqu�to_lib_��nup +(); + +1107 if( +cfg +-> +�s_�g�e + && + `mosqu�to_�r�g_�ti� +( +mosq +, +MOSQ_OPT_TLS_ENGINE +, cfg->tls_engine)){ + +1108 + `�r_��tf +( +cfg +, "E��: Prob�m s�t�g TLS�ng�e, i�%��v�id�ng�e?\n", cfg-> +�s_�g�e +); + +1109 + `mosqu�to_lib_��nup +(); + +1112 if( +cfg +-> +keyf�m + && + `mosqu�to_�r�g_�ti� +( +mosq +, +MOSQ_OPT_TLS_KEYFORM +, cfg->keyform)){ + +1113 + `�r_��tf +( +cfg +, "Error: Problem setting key form, it must be one of 'pem' or 'engine'.\n"); + +1114 + `mosqu�to_lib_��nup +(); + +1117 if( +cfg +-> +�s_�g�e_k�ss_sha1 + && + `mosqu�to_�r�g_�ti� +( +mosq +, +MOSQ_OPT_TLS_ENGINE_KPASS_SHA1 +, cfg->tls_engine_kpass_sha1)){ + +1118 + `�r_��tf +( +cfg +, "Error: Problem setting TLS�ngine key�ass sha, is it� 40 character hex string?\n"); + +1119 + `mosqu�to_lib_��nup +(); + +1122 if( +cfg +-> +�s_�� + && + `mosqu�to_�r�g_�ti� +( +mosq +, +MOSQ_OPT_TLS_ALPN +, cfg->tls_alpn)){ + +1123 + `�r_��tf +( +cfg +, "Error: Problem setting TLS ALPN�rotocol.\n"); + +1124 + `mosqu�to_lib_��nup +(); + +1127 #ifde� +FINAL_WITH_TLS_PSK + + +1128 if( +cfg +-> +psk + && + `mosqu�to_�s_psk_�t +( +mosq +, cfg->psk, cfg-> +psk_id�t�y +, +NULL +)){ + +1129 + `�r_��tf +( +cfg +, "Error: Problem setting TLS-PSK options.\n"); + +1130 + `mosqu�to_lib_��nup +(); + +1134 if(( +cfg +-> +�s_v�si� + || cfg-> +c�h�s +�&& + `mosqu�to_�s_�ts_�t +( +mosq +, 1, cfg->tls_version, cfg->ciphers)){ + +1135 + `�r_��tf +( +cfg +, "Error: Problem setting TLS options, check�he options�re valid.\n"); + +1136 + `mosqu�to_lib_��nup +(); + +1140 + `mosqu�to_max_��ight_mes�ges_�t +( +mosq +, +cfg +-> +max_��ight +); + +1141 #ifde� +WITH_SOCKS + + +1142 if( +cfg +-> +socks5_ho� +){ + +1143 +rc + = + `mosqu�to_socks5_�t +( +mosq +, +cfg +-> +socks5_ho� +, cfg-> +socks5_p�t +, cfg-> +socks5_u��ame +, cfg-> +socks5_�ssw�d +); + +1144 if( +rc +){ + +1145 + `mosqu�to_lib_��nup +(); + +1146 +rc +; + +1150 +MOSQ_ERR_SUCCESS +; + +1151 + } +} + +1153 + $���_id_g���e +( +mosq_c�fig + * +cfg +) + +1155 if( +cfg +-> +id_�efix +){ + +1156 +cfg +-> +id + = + `m�loc +( + `��� +(cfg-> +id_�efix +)+10); + +1157 if(! +cfg +-> +id +){ + +1158 + `�r_��tf +( +cfg +, "Error: Out of memory.\n"); + +1159 + `mosqu�to_lib_��nup +(); + +1162 + `���tf +( +cfg +-> +id +, + `��� +(cfg-> +id_�efix +)+10, "%s%d", cfg->id_�efix, + `g�pid +()); + +1164 +MOSQ_ERR_SUCCESS +; + +1165 + } +} + +1167 + $���_c��� +( +mosqu�to + * +mosq +, +mosq_c�fig + * +cfg +) + +1169 #i�de� +WIN32 + + +1170 * +�r +; + +1172 +�r +[1024]; + +1174 +rc +; + +1175 +p�t +; + +1177 if( +cfg +-> +p�t + < 0){ + +1178 #ifde� +WITH_TLS + + +1179 if( +cfg +-> +�f�e + || cfg-> +��th + + +1180 #ifde� +FINAL_WITH_TLS_PSK + + +1181 || +cfg +-> +psk + + +1184 +p�t + = 8883; + +1188 +p�t + = 1883; + +1191 +p�t + = +cfg +->port; + +1194 #ifde� +WITH_SRV + + +1195 if( +cfg +-> +u�_�v +){ + +1196 +rc + = + `mosqu�to_c���_�v +( +mosq +, +cfg +-> +ho� +, cfg-> +k��live +, cfg-> +b�d_add�ss +); + +1198 +rc + = + `mosqu�to_c���_b�d_v5 +( +mosq +, +cfg +-> +ho� +, +p�t +, cfg-> +k��live +, cfg-> +b�d_add�ss +, cfg-> +c���_��s +); + +1201 +rc + = + `mosqu�to_c���_b�d_v5 +( +mosq +, +cfg +-> +ho� +, +p�t +, cfg-> +k��live +, cfg-> +b�d_add�ss +, cfg-> +c���_��s +); + +1203 if( +rc +>0){ + +1204 if( +rc + =� +MOSQ_ERR_ERRNO +){ + +1205 #i�de� +WIN32 + + +1206 +�r + = + `���� +( +��o +); + +1208 + `F�m�Mes�ge +( +FORMAT_MESSAGE_FROM_SYSTEM +, +NULL +, +��o +, 0, ( +LPTSTR +)& +�r +, 1024, NULL); + +1210 + `�r_��tf +( +cfg +, "E��: %s\n", +�r +); + +1212 + `�r_��tf +( +cfg +, "U�bˁ�c��� (%s).\n", + `mosqu�to_���� +( +rc +)); + +1214 + `mosqu�to_lib_��nup +(); + +1215 +rc +; + +1217 +MOSQ_ERR_SUCCESS +; + +1218 + } +} + +1220 #ifde� +WITH_SOCKS + + +1222 + $mosqu�to__u�decode +(* +�r +) + +1224 +i +, +j +; + +1225 +�n +; + +1226 if(! +�r +) 0; + +1228 if(! + `�rchr +( +�r +, '%')) 0; + +1230 +�n + = + `��� +( +�r +); + +1231 +i +=0; i< +�n +; i++){ + +1232 if( +�r +[ +i +] == '%'){ + +1233 if( +i ++2 >� +�n +){ + +1236 if( +�r +[ +i ++1] == '2' && str[i+2] == '5'){ + +1237 +�r +[ +i +] = '%'; + +1238 +�n + -= 2; + +1239 +j += +i ++1; j< +�n +; j++){ + +1240 +�r +[ +j +] = str[j+2]; + +1242 +�r +[ +j +] = '\0'; + +1243 }if( +�r +[ +i ++1] == '3' && (str[i+2] == 'A' || str[i+2] == 'a')){ + +1244 +�r +[ +i +] = ':'; + +1245 +�n + -= 2; + +1246 +j += +i ++1; j< +�n +; j++){ + +1247 +�r +[ +j +] = str[j+2]; + +1249 +�r +[ +j +] = '\0'; + +1250 }if( +�r +[ +i ++1] == '4' && str[i+2] == '0'){ + +1251 +�r +[ +i +] = ':'; + +1252 +�n + -= 2; + +1253 +j += +i ++1; j< +�n +; j++){ + +1254 +�r +[ +j +] = str[j+2]; + +1256 +�r +[ +j +] = '\0'; + +1263 + } +} + +1265 + $mosqu�to__�r�_socks_u� +( +mosq_c�fig + * +cfg +, * +u� +) + +1267 * +�r +; + +1268 +size_t + +i +; + +1269 * +u��ame + = +NULL +, * +�ssw�d + = NULL, * +ho� + = NULL, * +p�t + = NULL; + +1270 * +u��ame_�_ho� + = +NULL +; + +1271 +size_t + +��t +; + +1272 +size_t + +�n +; + +1273 +bo� + +have_auth + = +�l� +; + +1274 +p�t_�t +; + +1276 if(! + `��cmp +( +u� +, "socks5h://", + `��� +("socks5h://"))){ + +1277 +�r + = +u� + + + `��� +("socks5h://"); + +1279 + `�r_��tf +( +cfg +, "E��: Unsu�܋d�roxy�r�oc�: %s\n", +u� +); + +1290 +��t + = 0; + +1291 +i +=0; i< + `��� +( +�r +); i++){ + +1292 if( +�r +[ +i +] == ':'){ + +1293 if( +i + =� +��t +){ + +1294 +��nup +; + +1296 if( +have_auth +){ + +1299 if( +ho� +){ + +1301 +��nup +; + +1303 +�n + = +i +- +��t +; + +1304 +ho� + = + `m�loc +( +�n + + 1); + +1305 if(! +ho� +){ + +1306 + `�r_��tf +( +cfg +, "Error: Out of memory.\n"); + +1307 +��nup +; + +1309 + `mem�y +( +ho� +, &( +�r +[ +��t +]), +�n +); + +1310 +ho� +[ +�n +] = '\0'; + +1311 +��t + = +i ++1; + +1312 }if(! +u��ame_�_ho� +){ + +1316 +�n + = +i +- +��t +; + +1317 +u��ame_�_ho� + = + `m�loc +( +�n + + 1); + +1318 if(! +u��ame_�_ho� +){ + +1319 + `�r_��tf +( +cfg +, "Error: Out of memory.\n"); + +1320 +��nup +; + +1322 + `mem�y +( +u��ame_�_ho� +, &( +�r +[ +��t +]), +�n +); + +1323 +u��ame_�_ho� +[ +�n +] = '\0'; + +1324 +��t + = +i ++1; + +1326 }if( +�r +[ +i +] == '@'){ + +1327 if( +i + =� +��t +){ + +1328 +��nup +; + +1330 +have_auth + = +�ue +; + +1331 if( +u��ame_�_ho� +){ + +1333 +u��ame + = +u��ame_�_ho� +; + +1334 +u��ame_�_ho� + = +NULL +; + +1336 +�n + = +i +- +��t +; + +1337 +�ssw�d + = + `m�loc +( +�n + + 1); + +1338 if(! +�ssw�d +){ + +1339 + `�r_��tf +( +cfg +, "Error: Out of memory.\n"); + +1340 +��nup +; + +1342 + `mem�y +( +�ssw�d +, &( +�r +[ +��t +]), +�n +); + +1343 +�ssw�d +[ +�n +] = '\0'; + +1344 +��t + = +i ++1; + +1348 if( +u��ame +){ + +1350 +��nup +; + +1352 +�n + = +i +- +��t +; + +1353 +u��ame + = + `m�loc +( +�n + + 1); + +1354 if(! +u��ame +){ + +1355 + `�r_��tf +( +cfg +, "Error: Out of memory.\n"); + +1356 +��nup +; + +1358 + `mem�y +( +u��ame +, &( +�r +[ +��t +]), +�n +); + +1359 +u��ame +[ +�n +] = '\0'; + +1360 +��t + = +i ++1; + +1366 if( +i + > +��t +){ + +1367 +�n + = +i +- +��t +; + +1368 if( +ho� +){ + +1371 +p�t + = + `m�loc +( +�n + + 1); + +1372 if(! +p�t +){ + +1373 + `�r_��tf +( +cfg +, "Error: Out of memory.\n"); + +1374 +��nup +; + +1376 + `mem�y +( +p�t +, &( +�r +[ +��t +]), +�n +); + +1377 +p�t +[ +�n +] = '\0'; + +1378 }if( +u��ame_�_ho� +){ + +1381 +ho� + = +u��ame_�_ho� +; + +1382 +u��ame_�_ho� + = +NULL +; + +1383 +p�t + = + `m�loc +( +�n + + 1); + +1384 if(! +p�t +){ + +1385 + `�r_��tf +( +cfg +, "Error: Out of memory.\n"); + +1386 +��nup +; + +1388 + `mem�y +( +p�t +, &( +�r +[ +��t +]), +�n +); + +1389 +p�t +[ +�n +] = '\0'; + +1391 +ho� + = + `m�loc +( +�n + + 1); + +1392 if(! +ho� +){ + +1393 + `�r_��tf +( +cfg +, "Error: Out of memory.\n"); + +1394 +��nup +; + +1396 + `mem�y +( +ho� +, &( +�r +[ +��t +]), +�n +); + +1397 +ho� +[ +�n +] = '\0'; + +1401 if(! +ho� +){ + +1402 + `�r_��tf +( +cfg +, "Error: Invalid�roxy.\n"); + +1403 +��nup +; + +1406 if( + `mosqu�to__u�decode +( +u��ame +)){ + +1407 +��nup +; + +1409 if( + `mosqu�to__u�decode +( +�ssw�d +)){ + +1410 +��nup +; + +1412 if( +p�t +){ + +1413 +p�t_�t + = + `�oi +( +p�t +); + +1414 if( +p�t_�t + < 1 ||�ort_int > 65535){ + +1415 + `�r_��tf +( +cfg +, "E��: Inv�id�roxy�܈%d\n", +p�t_�t +); + +1416 +��nup +; + +1418 + `� +( +p�t +); + +1420 +p�t_�t + = 1080; + +1423 +cfg +-> +socks5_u��ame + = +u��ame +; + +1424 +cfg +-> +socks5_�ssw�d + = +�ssw�d +; + +1425 +cfg +-> +socks5_ho� + = +ho� +; + +1426 +cfg +-> +socks5_p�t + = +p�t_�t +; + +1429 +��nup +: + +1430 if( +u��ame_�_ho� +� + `� +(username_or_host); + +1431 if( +u��ame +� + `� +(username); + +1432 if( +�ssw�d +� + `� +(password); + +1433 if( +ho� +� + `� +(host); + +1434 if( +p�t +� + `� +(port); + +1436 + } +} + +1439 + $�r_��tf +(cڡ +mosq_c�fig + * +cfg +, cڡ * +fmt +, ...) + +1441 +va_li� + +va +; + +1443 if( +cfg +-> +qu�t +) ; + +1445 + `va_��t +( +va +, +fmt +); + +1446 + `v�r�tf +( +�d�r +, +fmt +, +va +); + +1447 + `va_�d +( +va +); + +1448 + } +} + + @client/client_shared.h + +17 #i�de� +CLIENT_CONFIG_H + + +18 + #CLIENT_CONFIG_H + + + ) + +20 + ~<�dio.h +> + +22 #ifde� +WIN32 + + +23 + ~<w�sock2.h +> + +25 + ~<sys/time.h +> + +29 + #MSGMODE_NONE + 0 + + ) + +30 + #MSGMODE_CMD + 1 + + ) + +31 + #MSGMODE_STDIN_LINE + 2 + + ) + +32 + #MSGMODE_STDIN_FILE + 3 + + ) + +33 + #MSGMODE_FILE + 4 + + ) + +34 + #MSGMODE_NULL + 5 + + ) + +36 + #CLIENT_PUB + 1 + + ) + +37 + #CLIENT_SUB + 2 + + ) + +38 + #CLIENT_RR + 3 + + ) + +39 + #CLIENT_RESPONSE_TOPIC + 4 + + ) + +41 + smosq_c�fig + { + +42 * + mid +; + +43 * + mid_�efix +; + +44 + m��oc�_v�si� +; + +45 + mk��live +; + +46 * + mho� +; + +47 + mp�t +; + +48 + mqos +; + +49 +bo� + + m��� +; + +50 + mpub_mode +; + +51 * + mf�e_�put +; + +52 * + mmes�ge +; + +53 + mmsg�n +; + +54 * + mt�ic +; + +55 * + mb�d_add�ss +; + +56 + m���_cou� +; + +57 +timev� + + m���_d�ay +; + +58 #ifde� +WITH_SRV + + +59 +bo� + + mu�_�v +; + +61 +bo� + + mdebug +; + +62 +bo� + + mqu�t +; + +63 + mmax_��ight +; + +64 * + mu��ame +; + +65 * + m�ssw�d +; + +66 * + mw�l_t�ic +; + +67 * + mw�l_�yl�d +; + +68 + mw�l_�yl�d�n +; + +69 + mw�l_qos +; + +70 +bo� + + mw�l_��� +; + +71 #ifde� +WITH_TLS + + +72 * + m�f�e +; + +73 * + m��th +; + +74 * + m��f�e +; + +75 * + mkeyf�e +; + +76 * + mc�h�s +; + +77 +bo� + + m��cu� +; + +78 * + m�s_�� +; + +79 * + m�s_v�si� +; + +80 * + m�s_�g�e +; + +81 * + m�s_�g�e_k�ss_sha1 +; + +82 * + mkeyf�m +; + +83 #ifde� +FINAL_WITH_TLS_PSK + + +84 * + mpsk +; + +85 * + mpsk_id�t�y +; + +88 +bo� + + m��n_�ssi� +; + +89 ** + mt�ics +; + +90 + mt�ic_cou� +; + +91 +bo� + + mex�_a�_sub +; + +92 +bo� + + mno_��� +; + +93 +bo� + + m���ed_�ly +; + +94 +bo� + + m�move_���ed +; + +95 ** + mf��r_outs +; + +96 + mf��r_out_cou� +; + +97 ** + munsub_t�ics +; + +98 + munsub_t�ic_cou� +; + +99 +bo� + + mv�bo� +; + +100 +bo� + + me� +; + +101 + mmsg_cou� +; + +102 * + mf�m� +; + +103 + mtimeout +; + +104 + msub_�ts +; + +105 #ifde� +WITH_SOCKS + + +106 * + msocks5_ho� +; + +107 + msocks5_p�t +; + +108 * + msocks5_u��ame +; + +109 * + msocks5_�ssw�d +; + +111 +mosqu�to_�ݔty + * + mc���_��s +; + +112 +mosqu�to_�ݔty + * + mpublish_��s +; + +113 +mosqu�to_�ݔty + * + msubs�ibe_��s +; + +114 +mosqu�to_�ݔty + * + munsubs�ibe_��s +; + +115 +mosqu�to_�ݔty + * + mdisc���_��s +; + +116 +mosqu�to_�ݔty + * + mw�l_��s +; + +117 +bo� + + mhave_t�ic_��s +; + +118 * + m��ڣ_t�ic +; + +121 +���_c�fig_l�d +( +mosq_c�fig + * +c�fig +, +pub_�_sub +, +�gc +, * +�gv +[]); + +122 +���_c�fig_��nup +( +mosq_c�fig + * +cfg +); + +123 +���_�ts_�t +( +mosqu�to + * +mosq +, +mosq_c�fig + * +cfg +); + +124 +���_id_g���e +( +mosq_c�fig + * +cfg +); + +125 +���_c��� +( +mosqu�to + * +mosq +, +mosq_c�fig + * +cfg +); + +127 +cfg_�r�_�ݔty +( +mosq_c�fig + * +cfg +, +�gc +, * +�gv +[], * +idx +); + +129 +�r_��tf +(cڡ +mosq_c�fig + * +cfg +, cڡ * +fmt +, ...); + + @client/pub_client.c + +17 + ~"c�fig.h +" + +19 + ~<��o.h +> + +20 + ~<f��.h +> + +21 + ~<�dio.h +> + +22 + ~<�dlib.h +> + +23 + ~<�r�g.h +> + +24 #i�de� +WIN32 + + +25 + ~<sys/time.h +> + +26 + ~<time.h +> + +28 + ~<�o�ss.h +> + +29 + ~<w�sock2.h +> + +30 + #���tf + +�r�tf_s + + + ) + +33 + ~<mq�_��oc�.h +> + +34 + ~<mosqu�to.h +> + +35 + ~"���_sh�ed.h +" + +36 + ~"pub_sh�ed.h +" + +40 +bo� + + gf��_publish + = +�ue +; + +41 + gϡ_mid + = -1; + +42 + gϡ_mid_�� + = -1; + +43 * + gl�e_buf + = +NULL +; + +44 + gl�e_buf_�n + = 1024; + +45 +bo� + + gdisc���_�� + = +�l� +; + +46 + gpublish_cou� + = 0; + +47 +bo� + + g�ady_f�_��� + = +�l� +; + +49 #ifde� +WIN32 + + +50 +u�t64_t + + g�xt_publish_tv +; + +52 + $�t_���_time +() + +54 +u�t64_t + +ticks + = + `G�TickCou�64 +(); + +55 +�xt_publish_tv + = +ticks + + +cfg +. +���_d�ay +. +tv_�c +*1000 + cfg.���_d�ay. +tv_u�c +/1000; + +56 + } +} + +58 + $check_���_time +() + +60 +u�t64_t + +ticks + = + `G�TickCou�64 +(); + +62 if( +ticks + > +�xt_publish_tv +){ + +67 + } +} + +70 +timev� + + g�xt_publish_tv +; + +72 + $�t_���_time +() + +74 + `g�timeofday +(& +�xt_publish_tv +, +NULL +); + +75 +�xt_publish_tv +. +tv_�c + +� +cfg +. +���_d�ay +.tv_sec; + +76 +�xt_publish_tv +. +tv_u�c + +� +cfg +. +���_d�ay +.tv_usec; + +78 +�xt_publish_tv +. +tv_�c + +��xt_publish_tv. +tv_u�c +/1e6; + +79 +�xt_publish_tv +. +tv_u�c + =�ext_publish_tv.tv_usec%1000000; + +80 + } +} + +82 + $check_���_time +() + +84 +timev� + +tv +; + +86 + `g�timeofday +(& +tv +, +NULL +); + +88 if( +tv +. +tv_�c + > +�xt_publish_tv +.tv_sec){ + +90 }if( +tv +. +tv_�c + =� +�xt_publish_tv +.tv_sec + +91 && +tv +. +tv_u�c + > +�xt_publish_tv +.tv_usec){ + +96 + } +} + +99 + $my_disc���_��back +( +mosqu�to + * +mosq +, * +obj +, +rc +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +101 + `UNUSED +( +mosq +); + +102 + `UNUSED +( +obj +); + +103 + `UNUSED +( +rc +); + +104 + `UNUSED +( +�ݔt�s +); + +106 +��us + = +STATUS_DISCONNECTED +; + +107 + } +} + +109 + $my_publish +( +mosqu�to + * +mosq +, * +mid +, cڡ * +t�ic +, +�yl�d�n +, * +�yl�d +, +qos +, +bo� + +��� +) + +111 +�ady_f�_��� + = +�l� +; + +112 if( +cfg +. +��oc�_v�si� + =� +MQTT_PROTOCOL_V5 + && cfg. +have_t�ic_��s + && +f��_publish + =� +�l� +){ + +113 + `mosqu�to_publish_v5 +( +mosq +, +mid +, +NULL +, +�yl�d�n +, +�yl�d +, +qos +, +��� +, +cfg +. +publish_��s +); + +115 +f��_publish + = +�l� +; + +116 + `mosqu�to_publish_v5 +( +mosq +, +mid +, +t�ic +, +�yl�d�n +, +�yl�d +, +qos +, +��� +, +cfg +. +publish_��s +); + +118 + } +} + +121 + $my_c���_��back +( +mosqu�to + * +mosq +, * +obj +, +�su� +, +�ags +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +123 +rc + = +MOSQ_ERR_SUCCESS +; + +125 + `UNUSED +( +obj +); + +126 + `UNUSED +( +�ags +); + +127 + `UNUSED +( +�ݔt�s +); + +129 if(! +�su� +){ + +130 +cfg +. +pub_mode +){ + +131 +MSGMODE_CMD +: + +132 +MSGMODE_FILE +: + +133 +MSGMODE_STDIN_FILE +: + +134 +rc + = + `my_publish +( +mosq +, & +mid_�� +, +cfg +. +t�ic +, cfg. +msg�n +, cfg. +mes�ge +, cfg. +qos +, cfg. +��� +); + +136 +MSGMODE_NULL +: + +137 +rc + = + `my_publish +( +mosq +, & +mid_�� +, +cfg +. +t�ic +, 0, +NULL +, cfg. +qos +, cfg. +��� +); + +139 +MSGMODE_STDIN_LINE +: + +140 +��us + = +STATUS_CONNACK_RECVD +; + +143 if( +rc +){ + +144 +rc +){ + +145 +MOSQ_ERR_INVAL +: + +146 + `�r_��tf +(& +cfg +, "Error: Invalid input. Does your�opic contain '+' or '#'?\n"); + +148 +MOSQ_ERR_NOMEM +: + +149 + `�r_��tf +(& +cfg +, "Error: Out of memory when�rying�o�ublish message.\n"); + +151 +MOSQ_ERR_NO_CONN +: + +152 + `�r_��tf +(& +cfg +, "Error: Client�ot connected when�rying�o�ublish.\n"); + +154 +MOSQ_ERR_PROTOCOL +: + +155 + `�r_��tf +(& +cfg +, "Error: Protocol�rror when communicating with broker.\n"); + +157 +MOSQ_ERR_PAYLOAD_SIZE +: + +158 + `�r_��tf +(& +cfg +, "Error: Message�ayload is�oo�arge.\n"); + +160 +MOSQ_ERR_QOS_NOT_SUPPORTED +: + +161 + `�r_��tf +(& +cfg +, "Error: Message QoS�ot supported on broker,�ry��ower QoS.\n"); + +164 + `mosqu�to_disc���_v5 +( +mosq +, 0, +cfg +. +disc���_��s +); + +167 if( +�su� +){ + +168 if( +cfg +. +��oc�_v�si� + =� +MQTT_PROTOCOL_V5 +){ + +169 + `�r_��tf +(& +cfg +, "%s\n", + `mosqu�to_�as�_�r�g +( +�su� +)); + +171 + `�r_��tf +(& +cfg +, "%s\n", + `mosqu�to_c��ck_�r�g +( +�su� +)); + +175 + } +} + +178 + $my_publish_��back +( +mosqu�to + * +mosq +, * +obj +, +mid +, +�as�_code +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +180 + `UNUSED +( +obj +); + +181 + `UNUSED +( +�ݔt�s +); + +183 +ϡ_mid_�� + = +mid +; + +184 if( +�as�_code + > 127){ + +185 + `�r_��tf +(& +cfg +, "W�n�g: Publish %d fa�ed: %s.\n", +mid +, + `mosqu�to_�as�_�r�g +( +�as�_code +)); + +187 +publish_cou� +++; + +189 if( +cfg +. +pub_mode + =� +MSGMODE_STDIN_LINE +){ + +190 if( +mid + =� +ϡ_mid +){ + +191 + `mosqu�to_disc���_v5 +( +mosq +, 0, +cfg +. +disc���_��s +); + +192 +disc���_�� + = +�ue +; + +194 }if( +publish_cou� + < +cfg +. +���_cou� +){ + +195 +�ady_f�_��� + = +�ue +; + +196 + `�t_���_time +(); + +197 }if( +disc���_�� + =� +�l� +){ + +198 + `mosqu�to_disc���_v5 +( +mosq +, 0, +cfg +. +disc���_��s +); + +199 +disc���_�� + = +�ue +; + +201 + } +} + +204 + $pub_sh�ed_�� +() + +206 +l�e_buf + = + `m�loc +( +l�e_buf_�n +); + +207 if(! +l�e_buf +){ + +208 + `�r_��tf +(& +cfg +, "Error: Out of memory.\n"); + +212 + } +} + +215 + $pub_sh�ed_lo� +( +mosqu�to + * +mosq +) + +217 +�ad_�n +; + +218 +pos +; + +219 +rc +, +rc2 +; + +220 * +buf2 +; + +221 +buf_�n_a�u� +; + +222 +mode +; + +223 +lo�_d�ay + = 1000; + +224 +bo� + +�d�_f�ished + = +�l� +; + +226 if( +cfg +. +���_cou� + > 1 && (cfg. +���_d�ay +. +tv_�c + =�0 || cfg.���_d�ay. +tv_u�c + != 0)){ + +227 +lo�_d�ay + = +cfg +. +���_d�ay +. +tv_u�c + / 2000; + +230 +mode + = +cfg +. +pub_mode +; + +232 if( +mode + =� +MSGMODE_STDIN_LINE +){ + +233 + `mosqu�to_lo�_��t +( +mosq +); + +234 +�d�_f�ished + = +�l� +; + +238 if( +mode + =� +MSGMODE_STDIN_LINE +){ + +239 if( +��us + =� +STATUS_CONNACK_RECVD +){ + +240 +pos + = 0; + +241 +�ad_�n + = +l�e_buf_�n +; + +242 +��us + =� +STATUS_CONNACK_RECVD + && + `fg�s +(& +l�e_buf +[ +pos +], +�ad_�n +, +�d� +)){ + +243 +buf_�n_a�u� + = + `��� +( +l�e_buf +); + +244 if( +l�e_buf +[ +buf_�n_a�u� +-1] == '\n'){ + +245 +l�e_buf +[ +buf_�n_a�u� +-1] = '\0'; + +246 +rc2 + = + `my_publish +( +mosq +, & +mid_�� +, +cfg +. +t�ic +, +buf_�n_a�u� +-1, +l�e_buf +, cfg. +qos +, cfg. +��� +); + +247 if( +rc2 +){ + +248 + `�r_��tf +(& +cfg +, "E��: Publish��u�ed %d, disc����g.\n", +rc2 +); + +249 + `mosqu�to_disc���_v5 +( +mosq +, +MQTT_RC_DISCONNECT_WITH_WILL_MSG +, +cfg +. +disc���_��s +); + +253 +l�e_buf_�n + += 1024; + +254 +pos + += 1023; + +255 +�ad_�n + = 1024; + +256 +buf2 + = + `��loc +( +l�e_buf +, +l�e_buf_�n +); + +257 if(! +buf2 +){ + +258 + `�r_��tf +(& +cfg +, "Error: Out of memory.\n"); + +259 +MOSQ_ERR_NOMEM +; + +261 +l�e_buf + = +buf2 +; + +264 if( + `�of +( +�d� +)){ + +265 if( +mid_�� + == -1){ + +267 + `mosqu�to_disc���_v5 +( +mosq +, 0, +cfg +. +disc���_��s +); + +268 +disc���_�� + = +�ue +; + +269 +��us + = +STATUS_DISCONNECTING +; + +271 +ϡ_mid + = +mid_�� +; + +272 +��us + = +STATUS_WAITING +; + +274 +�d�_f�ished + = +�ue +; + +275 }if( +��us + =� +STATUS_DISCONNECTED +){ + +279 }if( +��us + =� +STATUS_WAITING +){ + +280 if( +ϡ_mid_�� + =� +ϡ_mid + && +disc���_�� + =� +�l� +){ + +281 + `mosqu�to_disc���_v5 +( +mosq +, 0, +cfg +. +disc���_��s +); + +282 +disc���_�� + = +�ue +; + +284 #ifde� +WIN32 + + +285 + `S˕ +(100); + +287 +time�ec + +ts +; + +288 +ts +. +tv_�c + = 0; + +289 +ts +. +tv_n�c + = 100000000; + +290 + `�no��p +(& +ts +, +NULL +); + +293 +rc + = +MOSQ_ERR_SUCCESS +; + +295 +rc + = + `mosqu�to_lo� +( +mosq +, +lo�_d�ay +, 1); + +296 if( +�ady_f�_��� + && + `check_���_time +()){ + +297 +rc + = 0; + +298 +cfg +. +pub_mode +){ + +299 +MSGMODE_CMD +: + +300 +MSGMODE_FILE +: + +301 +MSGMODE_STDIN_FILE +: + +302 +rc + = + `my_publish +( +mosq +, & +mid_�� +, +cfg +. +t�ic +, cfg. +msg�n +, cfg. +mes�ge +, cfg. +qos +, cfg. +��� +); + +304 +MSGMODE_NULL +: + +305 +rc + = + `my_publish +( +mosq +, & +mid_�� +, +cfg +. +t�ic +, 0, +NULL +, cfg. +qos +, cfg. +��� +); + +307 +MSGMODE_STDIN_LINE +: + +310 if( +rc +){ + +311 + `�r_��tf +(& +cfg +, "E�� s�d�g����publish: %s", + `mosqu�to_���� +( +rc +)); + +315 } +rc + =� +MOSQ_ERR_SUCCESS + && +�d�_f�ished + =� +�l� +); + +317 if( +mode + =� +MSGMODE_STDIN_LINE +){ + +318 + `mosqu�to_lo�_�� +( +mosq +, +�l� +); + +320 if( +��us + =� +STATUS_DISCONNECTED +){ + +321 +MOSQ_ERR_SUCCESS +; + +323 +rc +; + +325 + } +} + +328 + $pub_sh�ed_��nup +() + +330 + `� +( +l�e_buf +); + +331 + } +} + +334 + $��t_u�ge +() + +336 +maj� +, +m�� +, +�visi� +; + +338 + `mosqu�to_lib_v�si� +(& +maj� +, & +m�� +, & +�visi� +); + +339 + `��tf +("mosquitto_pub is� simple mqtt client�hat will�ublish� message on� single�opic�nd�xit.\n"); + +340 + `��tf +("mosqu�to_pub v�si� %�rug o�libmosqu�t�%d.%d.%d.\n\n", +VERSION +, +maj� +, +m�� +, +�visi� +); + +341 + `��tf +("Usage: mosquitto_pub {[-h host] [-p�ort] [-u username] [-P�assword] -t�opic | -L URL}\n"); + +342 + `��tf +(" {-f file | -l | -n | -m message}\n"); + +343 + `��tf +(" [-c] [-k keepalive] [-q qos] [-r] [--repeat N] [--repeat-delay�ime]\n"); + +344 #ifde� +WITH_SRV + + +345 + `��tf +(" [-A bind_address] [-S]\n"); + +347 + `��tf +(" [-A bind_address]\n"); + +349 + `��tf +(" [-i id] [-I id_prefix]\n"); + +350 + `��tf +(" [-d] [--quiet]\n"); + +351 + `��tf +(" [-M max_inflight]\n"); + +352 + `��tf +(" [-u username [-P�assword]]\n"); + +353 + `��tf +(" [--will-topic [--will-payload�ayload] [--will-qos qos] [--will-retain]]\n"); + +354 #ifde� +WITH_TLS + + +355 + `��tf +(" [{--cafile file | --capath dir} [--cert file] [--key file]\n"); + +356 + `��tf +(" [--ciphers ciphers] [--insecure]\n"); + +357 + `��tf +(" [--tls-alpn�rotocol]\n"); + +358 + `��tf +(" [--tls-engine�ngine] [--keyform keyform] [--tls-engine-kpass-sha1]]\n"); + +359 #ifde� +FINAL_WITH_TLS_PSK + + +360 + `��tf +(" [--psk hex-key --psk-identity identity [--ciphers ciphers]]\n"); + +363 #ifde� +WITH_SOCKS + + +364 + `��tf +(" [--proxy socks-url]\n"); + +366 + `��tf +(" [--property command identifier value]\n"); + +367 + `��tf +(" [-D command identifier value]\n"); + +368 + `��tf +(" mosquitto_pub --help\n\n"); + +369 + `��tf +(" -A : bind�he outgoing socket�o�his host/ip�ddress. Use�o control which interface\n"); + +370 + `��tf +("�he client communicates over.\n"); + +371 + `��tf +(" -d :�nable debug messages.\n"); + +372 + `��tf +(" -D : Define MQTT v5�roperties. See�he documentation for more details.\n"); + +373 + `��tf +(" -f : send�he contents of� file�s�he message.\n"); + +374 + `��tf +(" -h : mqtt host�o connect�o. Defaults�o�ocalhost.\n"); + +375 + `��tf +(" -i : id�o use for�his client. Defaults�o mosquitto_pub_�ppended with�he�rocess id.\n"); + +376 + `��tf +(" -I : define�he client id�s id_prefix�ppended with�he�rocess id. Useful for when�he\n"); + +377 + `��tf +(" broker is using�he clientid_prefixes option.\n"); + +378 + `��tf +(" -k : keep�live in seconds for�his client. Defaults�o 60.\n"); + +379 + `��tf +(" -L : specify user,�assword, hostname,�ort�nd�opic�s� URL in�he form:\n"); + +380 + `��tf +(" mqtt(s)://[username[:password]@]host[:port]/topic\n"); + +381 + `��tf +(" -l :�ead messages from stdin, sending� separate message for�ach�ine.\n"); + +382 + `��tf +(" -m : message�ayload�o send.\n"); + +383 + `��tf +(" -M :�he maximum inflight messages for QoS 1/2..\n"); + +384 + `��tf +(" -n : send��ull (zero�ength) message.\n"); + +385 + `��tf +(" -p :�etwork�ort�o connect�o. Defaults�o 1883 for�lain MQTT�nd 8883 for MQTT over TLS.\n"); + +386 + `��tf +(" -P :�rovide��assword\n"); + +387 + `��tf +(" -q : quality of service�evel�o use for�ll messages. Defaults�o 0.\n"); + +388 + `��tf +(" -r : message should be�etained.\n"); + +389 + `��tf +(" -s :�ead message from stdin, sending�he�ntire input�s� message.\n"); + +390 #ifde� +WITH_SRV + + +391 + `��tf +(" -S : use SRV�ookups�o determine which host�o connect�o.\n"); + +393 + `��tf +(" -t : mqtt�opic�o�ublish�o.\n"); + +394 + `��tf +(" -u :�rovide� username\n"); + +395 + `��tf +(" -V : specify�he version of�he MQTT�rotocol�o use when connecting.\n"); + +396 + `��tf +(" Can be mqttv5, mqttv311 or mqttv31. Defaults�o mqttv311.\n"); + +397 + `��tf +(" --help : display�his message.\n"); + +398 + `��tf +(" --repeat : if�ublish mode is -f, -m, or -s,�hen�epeat�he�ublish N�imes.\n"); + +399 + `��tf +(" --repeat-delay : if using --repeat, wait�ime seconds between�ublishes. Defaults�o 0.\n"); + +400 + `��tf +(" --quiet : don't�rint�rror messages.\n"); + +401 + `��tf +(" --will-payload :�ayload for�he client Will, which is sent by�he broker in case of\n"); + +402 + `��tf +(" unexpected disconnection. If�ot given�nd will-topic is set,� zero\n"); + +403 + `��tf +("�ength message will be sent.\n"); + +404 + `��tf +(" --will-qos : QoS�evel for�he client Will.\n"); + +405 + `��tf +(" --will-retain : if given, make�he client Will�etained.\n"); + +406 + `��tf +(" --will-topic :�he�opic on which�o�ublish�he client Will.\n"); + +407 #ifde� +WITH_TLS + + +408 + `��tf +(" --cafile :�ath�o� file containing�rusted CA certificates�o�nable�ncrypted\n"); + +409 + `��tf +(" communication.\n"); + +410 + `��tf +(" --capath :�ath�o� directory containing�rusted CA certificates�o�nable�ncrypted\n"); + +411 + `��tf +(" communication.\n"); + +412 + `��tf +(" --cert : client certificate for�uthentication, if�equired by server.\n"); + +413 + `��tf +(" --key : client�rivate key for�uthentication, if�equired by server.\n"); + +414 + `��tf +(" --keyform : keyfile�ype, can be�ither \"pem\" or \"engine\".\n"); + +415 + `��tf +(" --ciphers : openssl compatible�ist of TLS ciphers�o support.\n"); + +416 + `��tf +(" --tls-version : TLS�rotocol version, can be one of�lsv1.3�lsv1.2 or�lsv1.1.\n"); + +417 + `��tf +(" Defaults�o�lsv1.2 if�vailable.\n"); + +418 + `��tf +(" --insecure : do�ot check�hat�he server certificate hostname matches�he�emote\n"); + +419 + `��tf +(" hostname. Using�his option means�hat you cannot be sure�hat�he\n"); + +420 + `��tf +("�emote host is�he server you wish�o connect�o�nd so is insecure.\n"); + +421 + `��tf +(" Do�ot use�his option in��roduction�nvironment.\n"); + +422 + `��tf +(" --tls-engine : If set,�nables�he use of� TLS�ngine device.\n"); + +423 + `��tf +(" --tls-engine-kpass-sha1 : SHA1 of�he key�assword�o be used with�he selected SSL�ngine.\n"); + +424 #ifde� +FINAL_WITH_TLS_PSK + + +425 + `��tf +(" --psk :�re-shared-key in hexadecimal (no�eading 0x)�o�nable TLS-PSK mode.\n"); + +426 + `��tf +(" --psk-identity : client identity string for TLS-PSK mode.\n"); + +429 #ifde� +WITH_SOCKS + + +430 + `��tf +(" --proxy : SOCKS5�roxy URL of�he form:\n"); + +431 + `��tf +(" socks5h://[username[:password]@]hostname[:port]\n"); + +432 + `��tf +(" Only \"none\"�nd \"username\"�uthentication is supported.\n"); + +434 + `��tf +("\nSee https://mosquitto.org/ for more information.\n\n"); + +435 + } +} + +437 + $ma� +( +�gc +, * +�gv +[]) + +439 +mosqu�to + * +mosq + = +NULL +; + +440 +rc +; + +442 + `mosqu�to_lib_�� +(); + +444 if( + `pub_sh�ed_�� +()) 1; + +446 + `mem�t +(& +cfg +, 0, ( +mosq_c�fig +)); + +447 +rc + = + `���_c�fig_l�d +(& +cfg +, +CLIENT_PUB +, +�gc +, +�gv +); + +448 if( +rc +){ + +449 if( +rc + == 2){ + +451 + `��t_u�ge +(); + +453 + `�r�tf +( +�d�r +, "\nUse 'mosquitto_pub --help'�o see usage.\n"); + +455 +��nup +; + +458 #i�de� +WITH_THREADING + + +459 if( +cfg +. +pub_mode + =� +MSGMODE_STDIN_LINE +){ + +460 + `�r�tf +( +�d�r +, "Error: '-l' mode�ot�vailable,�hreading support has�ot been compiled in.\n"); + +461 +��nup +; + +465 if( +cfg +. +pub_mode + =� +MSGMODE_STDIN_FILE +){ + +466 if( + `l�d_�d� +()){ + +467 + `�r_��tf +(& +cfg +, "Error�oading input from stdin.\n"); + +468 +��nup +; + +470 }if( +cfg +. +f�e_�put +){ + +471 if( + `l�d_f�e +( +cfg +. +f�e_�put +)){ + +472 + `�r_��tf +(& +cfg +, "E�܆�d�g i�u�f��\"%s\".\n", cfg. +f�e_�put +); + +473 +��nup +; + +477 if(! +cfg +. +t�ic + || cfg. +pub_mode + =� +MSGMODE_NONE +){ + +478 + `�r�tf +( +�d�r +, "Error: Both�opic�nd message must be supplied.\n"); + +479 + `��t_u�ge +(); + +480 +��nup +; + +484 if( + `���_id_g���e +(& +cfg +)){ + +485 +��nup +; + +488 +mosq + = + `mosqu�to_�w +( +cfg +. +id +, cfg. +��n_�ssi� +, +NULL +); + +489 if(! +mosq +){ + +490 +��o +){ + +491 +ENOMEM +: + +492 + `�r_��tf +(& +cfg +, "Error: Out of memory.\n"); + +494 +EINVAL +: + +495 + `�r_��tf +(& +cfg +, "Error: Invalid id.\n"); + +498 +��nup +; + +500 if( +cfg +. +debug +){ + +501 + `mosqu�to_log_��back_�t +( +mosq +, +my_log_��back +); + +503 + `mosqu�to_c���_v5_��back_�t +( +mosq +, +my_c���_��back +); + +504 + `mosqu�to_disc���_v5_��back_�t +( +mosq +, +my_disc���_��back +); + +505 + `mosqu�to_publish_v5_��back_�t +( +mosq +, +my_publish_��back +); + +507 if( + `���_�ts_�t +( +mosq +, & +cfg +)){ + +508 +��nup +; + +511 +rc + = + `���_c��� +( +mosq +, & +cfg +); + +512 if( +rc +){ + +513 +��nup +; + +516 +rc + = + `pub_sh�ed_lo� +( +mosq +); + +518 if( +cfg +. +mes�ge + && cfg. +pub_mode + =� +MSGMODE_FILE +){ + +519 + `� +( +cfg +. +mes�ge +); + +520 +cfg +. +mes�ge + = +NULL +; + +522 + `mosqu�to_de�roy +( +mosq +); + +523 + `mosqu�to_lib_��nup +(); + +524 + `���_c�fig_��nup +(& +cfg +); + +525 + `pub_sh�ed_��nup +(); + +527 if( +rc +){ + +528 + `�r_��tf +(& +cfg +, "E��: %s\n", + `mosqu�to_���� +( +rc +)); + +530 +rc +; + +532 +��nup +: + +533 + `mosqu�to_lib_��nup +(); + +534 + `���_c�fig_��nup +(& +cfg +); + +535 + `pub_sh�ed_��nup +(); + +537 + } +} + + @client/pub_shared.c + +17 + ~"c�fig.h +" + +19 + ~<��o.h +> + +20 + ~<f��.h +> + +21 + ~<�dio.h +> + +22 + ~<�dlib.h +> + +23 + ~<�r�g.h +> + +24 #i�de� +WIN32 + + +25 + ~<time.h +> + +27 + ~<�o�ss.h +> + +28 + ~<w�sock2.h +> + +29 + #���tf + +�r�tf_s + + + ) + +32 + ~<mosqu�to.h +> + +33 + ~<mq�_��oc�.h +> + +34 + ~"���_sh�ed.h +" + +35 + ~"pub_sh�ed.h +" + +39 + gmid_�� + = -1; + +40 + g��us + = +STATUS_CONNECTING +; + +41 +mosq_c�fig + + gcfg +; + +43 + $my_log_��back +( +mosqu�to + * +mosq +, * +obj +, +�v� +, cڡ * +�r +) + +45 + `UNUSED +( +mosq +); + +46 + `UNUSED +( +obj +); + +47 + `UNUSED +( +�v� +); + +49 + `��tf +("%s\n", +�r +); + +50 + } +} + +52 + $l�d_�d� +() + +54 +pos + = 0, +�� +; + +55 +buf +[1024]; + +56 * +aux_mes�ge + = +NULL +; + +58 +cfg +. +pub_mode + = +MSGMODE_STDIN_FILE +; + +60 ! + `�of +( +�d� +)){ + +61 +�� + = + `�d +( +buf +, 1, 1024, +�d� +); + +62 +aux_mes�ge + = + `��loc +( +cfg +. +mes�ge +, +pos ++ +�� +); + +63 if(! +aux_mes�ge +){ + +64 + `�r_��tf +(& +cfg +, "Error: Out of memory.\n"); + +65 + `� +( +cfg +. +mes�ge +); + +69 +cfg +. +mes�ge + = +aux_mes�ge +; + +71 + `mem�y +(&( +cfg +. +mes�ge +[ +pos +]), +buf +, +�� +); + +72 +pos + +� +�� +; + +74 +cfg +. +msg�n + = +pos +; + +76 if(! +cfg +. +msg�n +){ + +77 + `�r_��tf +(& +cfg +, "Error: Zero�ength input.\n"); + +82 + } +} + +84 + $l�d_f�e +(cڡ * +f��ame +) + +86 +pos +, +�� +; + +87 +FILE + * +� + = +NULL +; + +89 +� + = + `fݒ +( +f��ame +, "rb"); + +90 if(! +� +){ + +91 + `�r_��tf +(& +cfg +, "E��: U�bˁ�ݒ f��\"%s\".\n", +f��ame +); + +94 +cfg +. +pub_mode + = +MSGMODE_FILE +; + +95 + `f�ek +( +� +, 0, +SEEK_END +); + +96 +cfg +. +msg�n + = + `�l +( +� +); + +97 if( +cfg +. +msg�n + > 268435455){ + +98 + `f�o� +( +� +); + +99 + `�r_��tf +(& +cfg +, "E��: F��\"%s\" i�to��rg�(>268,435,455 by�s).\n", +f��ame +); + +101 }if( +cfg +. +msg�n + == 0){ + +102 + `f�o� +( +� +); + +103 + `�r_��tf +(& +cfg +, "E��: F��\"%s\" i�em�y.\n", +f��ame +); + +105 }if( +cfg +. +msg�n + < 0){ + +106 + `f�o� +( +� +); + +107 + `�r_��tf +(& +cfg +, "E��: U�bˁ�d��m��siz�o�f��\"%s\".\n", +f��ame +); + +110 + `f�ek +( +� +, 0, +SEEK_SET +); + +111 +cfg +. +mes�ge + = + `m�loc +(cfg. +msg�n +); + +112 if(! +cfg +. +mes�ge +){ + +113 + `f�o� +( +� +); + +114 + `�r_��tf +(& +cfg +, "Error: Out of memory.\n"); + +117 +pos + = 0; + +118 +pos + < +cfg +. +msg�n +){ + +119 +�� + = + `�d +(&( +cfg +. +mes�ge +[ +pos +]), (), cfg. +msg�n +-pos, +� +); + +120 +pos + +� +�� +; + +122 + `f�o� +( +� +); + +124 + } +} + + @client/pub_shared.h + +16 #i�de� +PUB_SHARED_H + + +17 + #PUB_SHARED_H + + + ) + +19 + #STATUS_CONNECTING + 0 + + ) + +20 + #STATUS_CONNACK_RECVD + 1 + + ) + +21 + #STATUS_WAITING + 2 + + ) + +22 + #STATUS_DISCONNECTING + 3 + + ) + +23 + #STATUS_DISCONNECTED + 4 + + ) + +25 +mid_�� +; + +26 +��us +; + +27 +mosq_c�fig + +cfg +; + +30 +my_c���_��back +( +mosqu�to + * +mosq +, * +obj +, +�su� +, +�ags +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +); + +31 +my_disc���_��back +( +mosqu�to + * +mosq +, * +obj +, +rc +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +); + +32 +my_publish_��back +( +mosqu�to + * +mosq +, * +obj +, +mid +, +�as�_code +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +); + +33 +my_log_��back +( +mosqu�to + * +mosq +, * +obj +, +�v� +, cڡ * +�r +); + +34 +l�d_�d� +(); + +35 +l�d_f�e +(cڡ * +f��ame +); + +37 +my_publish +( +mosqu�to + * +mosq +, * +mid +, cڡ * +t�ic +, +�yl�d�n +, * +�yl�d +, +qos +, +bo� + +��� +); + +39 +pub_sh�ed_�� +(); + +40 +pub_sh�ed_lo� +( +mosqu�to + * +mosq +); + +41 +pub_sh�ed_��nup +(); + + @client/rr_client.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<��o.h +> + +21 + ~<�dio.h +> + +22 + ~<�dlib.h +> + +23 + ~<�r�g.h +> + +24 + ~<time.h +> + +25 #i�de� +WIN32 + + +26 + ~<uni�d.h +> + +27 + ~<sig�l.h +> + +29 + ~<�o�ss.h +> + +30 + ~<w�sock2.h +> + +31 + #���tf + +�r�tf_s + + + ) + +34 + ~<mosqu�to.h +> + +35 + ~<mq�_��oc�.h +> + +36 + ~"���_sh�ed.h +" + +37 + ~"pub_sh�ed.h +" + +39 + e�__��e + { + +40 + m�_s_�w +, + +41 + m�_s_c���ed +, + +42 + m�_s_subs�ibed +, + +43 + m�_s_�ady_to_publish +, + +44 + m�_s_wa�_f�_��ڣ +, + +45 + m�_s_disc��� + + +48 +�__��e + + g���_��e + = +�_s_�w +; + +50 +mosq_c�fig + + gcfg +; + +51 +bo� + + g�o�ss_mes�ges + = +�ue +; + +52 + gmsg_cou� + = 0; + +53 +mosqu�to + * + gmosq + = +NULL +; + +55 #i�de� +WIN32 + + +56 + $my_sig�l_h�d�r +( +signum +) + +58 if( +signum + =� +SIGALRM +){ + +59 +�o�ss_mes�ges + = +�l� +; + +60 + `mosqu�to_disc���_v5 +( +mosq +, +MQTT_RC_DISCONNECT_WITH_WILL_MSG +, +cfg +. +disc���_��s +); + +62 + } +} + +65 +��t_mes�ge +( +mosq_c�fig + * +cfg +, cڡ +mosqu�to_mes�ge + * +mes�ge +); + +68 + $my_publish +( +mosqu�to + * +mosq +, * +mid +, cڡ * +t�ic +, +�yl�d�n +, * +�yl�d +, +qos +, +bo� + +��� +) + +70 + `mosqu�to_publish_v5 +( +mosq +, +mid +, +t�ic +, +�yl�d�n +, +�yl�d +, +qos +, +��� +, +cfg +. +publish_��s +); + +71 + } +} + +74 + $my_mes�ge_��back +( +mosqu�to + * +mosq +, * +obj +, cڡ +mosqu�to_mes�ge + * +mes�ge +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +76 + `��t_mes�ge +(& +cfg +, +mes�ge +); + +77 +cfg +. +pub_mode +){ + +78 +MSGMODE_CMD +: + +79 +MSGMODE_FILE +: + +80 +MSGMODE_STDIN_FILE +: + +81 +MSGMODE_NULL +: + +82 +���_��e + = +�_s_disc��� +; + +84 +MSGMODE_STDIN_LINE +: + +85 +���_��e + = +�_s_�ady_to_publish +; + +115 + } +} + +117 + $my_c���_��back +( +mosqu�to + * +mosq +, * +obj +, +�su� +, +�ags +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +119 if(! +�su� +){ + +120 +���_��e + = +�_s_c���ed +; + +121 + `mosqu�to_subs�ibe_v5 +( +mosq +, +NULL +, +cfg +. +��ڣ_t�ic +, cfg. +qos +, 0, cfg. +subs�ibe_��s +); + +123 +���_��e + = +�_s_disc��� +; + +124 if( +�su� +){ + +125 + `�r_��tf +(& +cfg +, "%s\n", + `mosqu�to_c��ck_�r�g +( +�su� +)); + +127 + `mosqu�to_disc���_v5 +( +mosq +, 0, +cfg +. +disc���_��s +); + +129 + } +} + +132 + $my_subs�ibe_��back +( +mosqu�to + * +mosq +, * +obj +, +mid +, +qos_cou� +, cڡ * +g��ed_qos +) + +134 if( +g��ed_qos +[0] < 128){ + +135 +���_��e + = +�_s_�ady_to_publish +; + +137 +���_��e + = +�_s_disc��� +; + +138 + `�r_��tf +(& +cfg +, "%s\n", + `mosqu�to_�as�_�r�g +( +g��ed_qos +[0])); + +139 + `mosqu�to_disc���_v5 +( +mosq +, 0, +cfg +. +disc���_��s +); + +141 + } +} + +144 + $my_publish_��back +( +mosqu�to + * +mosq +, * +obj +, +mid +, +�as�_code +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +146 +���_��e + = +�_s_wa�_f�_��ڣ +; + +147 + } +} + +150 + $��t_u�ge +() + +152 +maj� +, +m�� +, +�visi� +; + +154 + `mosqu�to_lib_v�si� +(& +maj� +, & +m�� +, & +�visi� +); + +155 + `��tf +("mosquitto_rr is�n mqtt client�hat can be used�o�ublish��equest message�nd wait for��esponse.\n"); + +156 + `��tf +(" Defaults�o MQTT v5, where�he Request-Response feature will be used, but v3.1.1 can�lso be used\n"); + +157 + `��tf +(" with v3.1.1 brokers.\n"); + +158 + `��tf +("mosqu�to_� v�si� %�rug o�libmosqu�t�%d.%d.%d.\n\n", +VERSION +, +maj� +, +m�� +, +�visi� +); + +159 + `��tf +("Usage: mosquitto_rr {[-h host] [-p�ort] [-u username] [-P�assword] -t�opic | -L URL} -e�esponse-topic\n"); + +160 + `��tf +(" [-c] [-k keepalive] [-q qos] [-R]\n"); + +161 + `��tf +(" [-F format]\n"); + +162 #i�de� +WIN32 + + +163 + `��tf +(" [-W�imeout_secs]\n"); + +165 #ifde� +WITH_SRV + + +166 + `��tf +(" [-A bind_address] [-S]\n"); + +168 + `��tf +(" [-A bind_address]\n"); + +170 + `��tf +(" [-i id] [-I id_prefix]\n"); + +171 + `��tf +(" [-d] [-N] [--quiet] [-v]\n"); + +172 + `��tf +(" [--will-topic [--will-payload�ayload] [--will-qos qos] [--will-retain]]\n"); + +173 #ifde� +WITH_TLS + + +174 + `��tf +(" [{--cafile file | --capath dir} [--cert file] [--key file]\n"); + +175 + `��tf +(" [--ciphers ciphers] [--insecure]\n"); + +176 + `��tf +(" [--tls-alpn�rotocol]\n"); + +177 + `��tf +(" [--tls-engine�ngine] [--keyform keyform] [--tls-engine-kpass-sha1]]\n"); + +178 #ifde� +FINAL_WITH_TLS_PSK + + +179 + `��tf +(" [--psk hex-key --psk-identity identity [--ciphers ciphers]]\n"); + +182 #ifde� +WITH_SOCKS + + +183 + `��tf +(" [--proxy socks-url]\n"); + +185 + `��tf +(" [-D command identifier value]\n"); + +186 + `��tf +(" mosquitto_rr --help\n\n"); + +187 + `��tf +(" -A : bind�he outgoing socket�o�his host/ip�ddress. Use�o control which interface\n"); + +188 + `��tf +("�he client communicates over.\n"); + +189 + `��tf +(" -c : disable 'clean session' (store subscription�nd�ending messages when client disconnects).\n"); + +190 + `��tf +(" -d :�nable debug messages.\n"); + +191 + `��tf +(" -D : Define MQTT v5�roperties. See�he documentation for more details.\n"); + +192 + `��tf +(" -F : output format.\n"); + +193 + `��tf +(" -h : mqtt host�o connect�o. Defaults�o�ocalhost.\n"); + +194 + `��tf +(" -i : id�o use for�his client. Defaults�o mosquitto_rr_�ppended with�he�rocess id.\n"); + +195 + `��tf +(" -k : keep�live in seconds for�his client. Defaults�o 60.\n"); + +196 + `��tf +(" -L : specify user,�assword, hostname,�ort�nd�opic�s� URL in�he form:\n"); + +197 + `��tf +(" mqtt(s)://[username[:password]@]host[:port]/topic\n"); + +198 + `��tf +(" -N : do�ot�dd�n�nd of�ine character when�rinting�he�ayload.\n"); + +199 + `��tf +(" -p :�etwork�ort�o connect�o. Defaults�o 1883 for�lain MQTT�nd 8883 for MQTT over TLS.\n"); + +200 + `��tf +(" -P :�rovide��assword\n"); + +201 + `��tf +(" -q : quality of service�evel�o use for communications. Defaults�o 0.\n"); + +202 + `��tf +(" -R : do�ot�rint stale messages (those with�etain set).\n"); + +203 #ifde� +WITH_SRV + + +204 + `��tf +(" -S : use SRV�ookups�o determine which host�o connect�o.\n"); + +206 + `��tf +(" -t : mqtt�esponse�opic�o subscribe�o. May be�epeated multiple�imes.\n"); + +207 + `��tf +(" -u :�rovide� username\n"); + +208 + `��tf +(" -v :�rint�eceived messages verbosely.\n"); + +209 + `��tf +(" -V : specify�he version of�he MQTT�rotocol�o use when connecting.\n"); + +210 + `��tf +(" Defaults�o 5.\n"); + +211 #i�de� +WIN32 + + +212 + `��tf +(" -W : Specifies��imeout in seconds how�ong�o wait for��esponse.\n"); + +214 + `��tf +(" --help : display�his message.\n"); + +215 + `��tf +(" --quiet : don't�rint�rror messages.\n"); + +216 + `��tf +(" --will-payload :�ayload for�he client Will, which is sent by�he broker in case of\n"); + +217 + `��tf +(" unexpected disconnection. If�ot given�nd will-topic is set,� zero\n"); + +218 + `��tf +("�ength message will be sent.\n"); + +219 + `��tf +(" --will-qos : QoS�evel for�he client Will.\n"); + +220 + `��tf +(" --will-retain : if given, make�he client Will�etained.\n"); + +221 + `��tf +(" --will-topic :�he�opic on which�o�ublish�he client Will.\n"); + +222 #ifde� +WITH_TLS + + +223 + `��tf +(" --cafile :�ath�o� file containing�rusted CA certificates�o�nable�ncrypted\n"); + +224 + `��tf +(" certificate based communication.\n"); + +225 + `��tf +(" --capath :�ath�o� directory containing�rusted CA certificates�o�nable�ncrypted\n"); + +226 + `��tf +(" communication.\n"); + +227 + `��tf +(" --cert : client certificate for�uthentication, if�equired by server.\n"); + +228 + `��tf +(" --key : client�rivate key for�uthentication, if�equired by server.\n"); + +229 + `��tf +(" --ciphers : openssl compatible�ist of TLS ciphers�o support.\n"); + +230 + `��tf +(" --tls-version : TLS�rotocol version, can be one of�lsv1.2�lsv1.1 or�lsv1.\n"); + +231 + `��tf +(" Defaults�o�lsv1.2 if�vailable.\n"); + +232 + `��tf +(" --insecure : do�ot check�hat�he server certificate hostname matches�he�emote\n"); + +233 + `��tf +(" hostname. Using�his option means�hat you cannot be sure�hat�he\n"); + +234 + `��tf +("�emote host is�he server you wish�o connect�o�nd so is insecure.\n"); + +235 + `��tf +(" Do�ot use�his option in��roduction�nvironment.\n"); + +236 #ifde� +WITH_TLS_PSK + + +237 + `��tf +(" --psk :�re-shared-key in hexadecimal (no�eading 0x)�o�nable TLS-PSK mode.\n"); + +238 + `��tf +(" --psk-identity : client identity string for TLS-PSK mode.\n"); + +241 #ifde� +WITH_SOCKS + + +242 + `��tf +(" --proxy : SOCKS5�roxy URL of�he form:\n"); + +243 + `��tf +(" socks5h://[username[:password]@]hostname[:port]\n"); + +244 + `��tf +(" Only \"none\"�nd \"username\"�uthentication is supported.\n"); + +246 + `��tf +("\nSee https://mosquitto.org/ for more information.\n\n"); + +247 + } +} + +249 + $ma� +( +�gc +, * +�gv +[]) + +251 +rc +; + +252 #i�de� +WIN32 + + +253 +siga�i� + +siga� +; + +256 + `mem�t +(& +cfg +, 0, ( +mosq_c�fig +)); + +258 + `mosqu�to_lib_�� +(); + +260 +rc + = + `���_c�fig_l�d +(& +cfg +, +CLIENT_RR +, +�gc +, +�gv +); + +261 if( +rc +){ + +262 if( +rc + == 2){ + +264 + `��t_u�ge +(); + +266 + `�r�tf +( +�d�r +, "\nUse 'mosquitto_rr --help'�o see usage.\n"); + +268 +��nup +; + +271 if(! +cfg +. +t�ic + || cfg. +pub_mode + =� +MSGMODE_NONE + || !cfg. +��ڣ_t�ic +){ + +272 + `�r�tf +( +�d�r +, "Error: All of�opic, message,�nd�esponse�opic must be supplied.\n"); + +273 + `�r�tf +( +�d�r +, "\nUse 'mosquitto_rr --help'�o see usage.\n"); + +274 +��nup +; + +276 +rc + = + `mosqu�to_�ݔty_add_�r�g +(& +cfg +. +publish_��s +, +MQTT_PROP_RESPONSE_TOPIC +, cfg. +��ڣ_t�ic +); + +277 if( +rc +){ + +278 + `�r�tf +( +�d�r +, "Error�dding�roperty RESPONSE_TOPIC.\n"); + +279 +��nup +; + +281 +rc + = + `mosqu�to_�ݔty_check_�l +( +CMD_PUBLISH +, +cfg +. +publish_��s +); + +282 if( +rc +){ + +283 + `�r_��tf +(& +cfg +, "Error in PUBLISH�roperties: Duplicate�esponse�opic.\n"); + +284 +��nup +; + +287 if( + `���_id_g���e +(& +cfg +)){ + +288 +��nup +; + +291 +mosq + = + `mosqu�to_�w +( +cfg +. +id +, cfg. +��n_�ssi� +, &cfg); + +292 if(! +mosq +){ + +293 +��o +){ + +294 +ENOMEM +: + +295 + `�r_��tf +(& +cfg +, "Error: Out of memory.\n"); + +297 +EINVAL +: + +298 + `�r_��tf +(& +cfg +, "Error: Invalid id�nd/or clean_session.\n"); + +301 +��nup +; + +303 if( + `���_�ts_�t +( +mosq +, & +cfg +)){ + +304 +��nup +; + +306 if( +cfg +. +debug +){ + +307 + `mosqu�to_log_��back_�t +( +mosq +, +my_log_��back +); + +309 + `mosqu�to_c���_v5_��back_�t +( +mosq +, +my_c���_��back +); + +310 + `mosqu�to_subs�ibe_��back_�t +( +mosq +, +my_subs�ibe_��back +); + +311 + `mosqu�to_mes�ge_v5_��back_�t +( +mosq +, +my_mes�ge_��back +); + +313 +rc + = + `���_c��� +( +mosq +, & +cfg +); + +314 if( +rc +){ + +315 +��nup +; + +318 #i�de� +WIN32 + + +319 +siga� +. +�_h�d�r + = +my_sig�l_h�d�r +; + +320 + `sigem�y�t +(& +siga� +. +�_mask +); + +321 +siga� +. +�_�ags + = 0; + +323 if( + `siga�i� +( +SIGALRM +, & +siga� +, +NULL +) == -1){ + +324 + `��� +("sigaction"); + +325 +��nup +; + +328 if( +cfg +. +timeout +){ + +329 + `��m +( +cfg +. +timeout +); + +334 +rc + = + `mosqu�to_lo� +( +mosq +, -1, 1); + +335 if( +���_��e + =� +�_s_�ady_to_publish +){ + +336 +���_��e + = +�_s_wa�_f�_��ڣ +; + +337 +cfg +. +pub_mode +){ + +338 +MSGMODE_CMD +: + +339 +MSGMODE_FILE +: + +340 +MSGMODE_STDIN_FILE +: + +341 +rc + = + `my_publish +( +mosq +, & +mid_�� +, +cfg +. +t�ic +, cfg. +msg�n +, cfg. +mes�ge +, cfg. +qos +, cfg. +��� +); + +343 +MSGMODE_NULL +: + +344 +rc + = + `my_publish +( +mosq +, & +mid_�� +, +cfg +. +t�ic +, 0, +NULL +, cfg. +qos +, cfg. +��� +); + +346 +MSGMODE_STDIN_LINE +: + +351 } +rc + =� +MOSQ_ERR_SUCCESS + && +���_��e + !� +�_s_disc��� +); + +353 + `mosqu�to_de�roy +( +mosq +); + +354 + `mosqu�to_lib_��nup +(); + +356 if( +cfg +. +msg_cou� +>0 && +rc + =� +MOSQ_ERR_NO_CONN +){ + +357 +rc + = 0; + +359 + `���_c�fig_��nup +(& +cfg +); + +360 if( +rc +){ + +361 + `�r�tf +( +�d�r +, "E��: %s\n", + `mosqu�to_���� +( +rc +)); + +363 +rc +; + +365 +��nup +: + +366 + `mosqu�to_lib_��nup +(); + +367 + `���_c�fig_��nup +(& +cfg +); + +369 + } +} + + @client/sub_client.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<��o.h +> + +21 + ~<�dio.h +> + +22 + ~<�dlib.h +> + +23 + ~<�r�g.h +> + +24 + ~<time.h +> + +25 #i�de� +WIN32 + + +26 + ~<uni�d.h +> + +27 + ~<sig�l.h +> + +29 + ~<�o�ss.h +> + +30 + ~<w�sock2.h +> + +31 + #���tf + +�r�tf_s + + + ) + +34 + ~<mosqu�to.h +> + +35 + ~<mq�_��oc�.h +> + +36 + ~"���_sh�ed.h +" + +38 +mosq_c�fig + + gcfg +; + +39 +bo� + + g�o�ss_mes�ges + = +�ue +; + +40 + gmsg_cou� + = 0; + +41 +mosqu�to + * + gmosq + = +NULL +; + +42 + gϡ_mid + = 0; + +44 #i�de� +WIN32 + + +45 + $my_sig�l_h�d�r +( +signum +) + +47 if( +signum + =� +SIGALRM +){ + +48 +�o�ss_mes�ges + = +�l� +; + +49 + `mosqu�to_disc���_v5 +( +mosq +, +MQTT_RC_DISCONNECT_WITH_WILL_MSG +, +cfg +. +disc���_��s +); + +51 + } +} + +54 +��t_mes�ge +( +mosq_c�fig + * +cfg +, cڡ +mosqu�to_mes�ge + * +mes�ge +); + +57 + $my_publish_��back +( +mosqu�to + * +mosq +, * +obj +, +mid +, +�as�_code +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +59 + `UNUSED +( +obj +); + +60 + `UNUSED +( +�as�_code +); + +61 + `UNUSED +( +�ݔt�s +); + +63 if( +�o�ss_mes�ges + =� +�l� + && ( +mid + =� +ϡ_mid + ||�ast_mid == 0)){ + +64 + `mosqu�to_disc���_v5 +( +mosq +, 0, +cfg +. +disc���_��s +); + +66 + } +} + +69 + $my_mes�ge_��back +( +mosqu�to + * +mosq +, * +obj +, cڡ +mosqu�to_mes�ge + * +mes�ge +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +71 +i +; + +72 +bo� + +�s +; + +74 + `UNUSED +( +obj +); + +75 + `UNUSED +( +�ݔt�s +); + +77 if( +�o�ss_mes�ges + =� +�l� +) ; + +79 if( +cfg +. +�move_���ed + && +mes�ge +-> +��� +){ + +80 + `mosqu�to_publish +( +mosq +, & +ϡ_mid +, +mes�ge +-> +t�ic +, 0, +NULL +, 1, +�ue +); + +83 if( +cfg +. +���ed_�ly + && ! +mes�ge +-> +��� + && +�o�ss_mes�ges +){ + +84 +�o�ss_mes�ges + = +�l� +; + +85 if( +ϡ_mid + == 0){ + +86 + `mosqu�to_disc���_v5 +( +mosq +, 0, +cfg +. +disc���_��s +); + +91 if( +mes�ge +-> +��� + && +cfg +. +no_��� +) ; + +92 if( +cfg +. +f��r_outs +){ + +93 +i +=0; i< +cfg +. +f��r_out_cou� +; i++){ + +94 + `mosqu�to_t�ic_m�ches_sub +( +cfg +. +f��r_outs +[ +i +], +mes�ge +-> +t�ic +, & +�s +); + +95 if( +�s +) ; + +99 + `��t_mes�ge +(& +cfg +, +mes�ge +); + +101 if( +cfg +. +msg_cou� +>0){ + +102 +msg_cou� +++; + +103 if( +cfg +. +msg_cou� + == msg_count){ + +104 +�o�ss_mes�ges + = +�l� +; + +105 if( +ϡ_mid + == 0){ + +106 + `mosqu�to_disc���_v5 +( +mosq +, 0, +cfg +. +disc���_��s +); + +110 + } +} + +112 + $my_c���_��back +( +mosqu�to + * +mosq +, * +obj +, +�su� +, +�ags +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +114 +i +; + +116 + `UNUSED +( +obj +); + +117 + `UNUSED +( +�ags +); + +118 + `UNUSED +( +�ݔt�s +); + +120 if(! +�su� +){ + +121 + `mosqu�to_subs�ibe_muɝ� +( +mosq +, +NULL +, +cfg +. +t�ic_cou� +, cfg. +t�ics +, cfg. +qos +, cfg. +sub_�ts +, cfg. +subs�ibe_��s +); + +123 +i +=0; i< +cfg +. +unsub_t�ic_cou� +; i++){ + +124 + `mosqu�to_unsubs�ibe_v5 +( +mosq +, +NULL +, +cfg +. +unsub_t�ics +[ +i +], cfg. +unsubs�ibe_��s +); + +127 if( +�su� +){ + +128 if( +cfg +. +��oc�_v�si� + =� +MQTT_PROTOCOL_V5 +){ + +129 + `�r_��tf +(& +cfg +, "%s\n", + `mosqu�to_�as�_�r�g +( +�su� +)); + +131 + `�r_��tf +(& +cfg +, "%s\n", + `mosqu�to_c��ck_�r�g +( +�su� +)); + +134 + `mosqu�to_disc���_v5 +( +mosq +, 0, +cfg +. +disc���_��s +); + +136 + } +} + +138 + $my_subs�ibe_��back +( +mosqu�to + * +mosq +, * +obj +, +mid +, +qos_cou� +, cڡ * +g��ed_qos +) + +140 +i +; + +142 + `UNUSED +( +obj +); + +144 if(! +cfg +. +qu�t +� + `��tf +("Subs�ibed (mid: %d): %d", +mid +, +g��ed_qos +[0]); + +145 +i +=1; i< +qos_cou� +; i++){ + +146 if(! +cfg +. +qu�t +� + `��tf +(", %d", +g��ed_qos +[ +i +]); + +148 if(! +cfg +. +qu�t +� + `��tf +("\n"); + +150 if( +cfg +. +ex�_a�_sub +){ + +151 + `mosqu�to_disc���_v5 +( +mosq +, 0, +cfg +. +disc���_��s +); + +153 + } +} + +155 + $my_log_��back +( +mosqu�to + * +mosq +, * +obj +, +�v� +, cڡ * +�r +) + +157 + `UNUSED +( +mosq +); + +158 + `UNUSED +( +obj +); + +159 + `UNUSED +( +�v� +); + +161 + `��tf +("%s\n", +�r +); + +162 + } +} + +164 + $��t_u�ge +() + +166 +maj� +, +m�� +, +�visi� +; + +168 + `mosqu�to_lib_v�si� +(& +maj� +, & +m�� +, & +�visi� +); + +169 + `��tf +("mosquitto_sub is� simple mqtt client�hat will subscribe�o� set of�opics�nd�rint�ll messages it�eceives.\n"); + +170 + `��tf +("mosqu�to_sub v�si� %�rug o�libmosqu�t�%d.%d.%d.\n\n", +VERSION +, +maj� +, +m�� +, +�visi� +); + +171 + `��tf +("Usage: mosquitto_sub {[-h host] [-p�ort] [-u username] [-P�assword] -t�opic | -L URL [-t�opic]}\n"); + +172 + `��tf +(" [-c] [-k keepalive] [-q qos]\n"); + +173 + `��tf +(" [-C msg_count] [-E] [-R] [--retained-only] [--remove-retained] [-T filter_out] [-U�opic ...]\n"); + +174 + `��tf +(" [-F format]\n"); + +175 #i�de� +WIN32 + + +176 + `��tf +(" [-W�imeout_secs]\n"); + +178 #ifde� +WITH_SRV + + +179 + `��tf +(" [-A bind_address] [-S]\n"); + +181 + `��tf +(" [-A bind_address]\n"); + +183 + `��tf +(" [-i id] [-I id_prefix]\n"); + +184 + `��tf +(" [-d] [-N] [--quiet] [-v]\n"); + +185 + `��tf +(" [--will-topic [--will-payload�ayload] [--will-qos qos] [--will-retain]]\n"); + +186 #ifde� +WITH_TLS + + +187 + `��tf +(" [{--cafile file | --capath dir} [--cert file] [--key file]\n"); + +188 + `��tf +(" [--ciphers ciphers] [--insecure]\n"); + +189 + `��tf +(" [--tls-alpn�rotocol]\n"); + +190 + `��tf +(" [--tls-engine�ngine] [--keyform keyform] [--tls-engine-kpass-sha1]]\n"); + +191 #ifde� +FINAL_WITH_TLS_PSK + + +192 + `��tf +(" [--psk hex-key --psk-identity identity [--ciphers ciphers]]\n"); + +195 #ifde� +WITH_SOCKS + + +196 + `��tf +(" [--proxy socks-url]\n"); + +198 + `��tf +(" [-D command identifier value]\n"); + +199 + `��tf +(" mosquitto_sub --help\n\n"); + +200 + `��tf +(" -A : bind�he outgoing socket�o�his host/ip�ddress. Use�o control which interface\n"); + +201 + `��tf +("�he client communicates over.\n"); + +202 + `��tf +(" -c : disable 'clean session' (store subscription�nd�ending messages when client disconnects).\n"); + +203 + `��tf +(" -C : disconnect�nd�xit�fter�eceiving�he 'msg_count' messages.\n"); + +204 + `��tf +(" -d :�nable debug messages.\n"); + +205 + `��tf +(" -D : Define MQTT v5�roperties. See�he documentation for more details.\n"); + +206 + `��tf +(" -E : Exit once�ll subscriptions have been�cknowledged by�he broker.\n"); + +207 + `��tf +(" -F : output format.\n"); + +208 + `��tf +(" -h : mqtt host�o connect�o. Defaults�o�ocalhost.\n"); + +209 + `��tf +(" -i : id�o use for�his client. Defaults�o mosquitto_sub_�ppended with�he�rocess id.\n"); + +210 + `��tf +(" -I : define�he client id�s id_prefix�ppended with�he�rocess id. Useful for when�he\n"); + +211 + `��tf +(" broker is using�he clientid_prefixes option.\n"); + +212 + `��tf +(" -k : keep�live in seconds for�his client. Defaults�o 60.\n"); + +213 + `��tf +(" -L : specify user,�assword, hostname,�ort�nd�opic�s� URL in�he form:\n"); + +214 + `��tf +(" mqtt(s)://[username[:password]@]host[:port]/topic\n"); + +215 + `��tf +(" -N : do�ot�dd�n�nd of�ine character when�rinting�he�ayload.\n"); + +216 + `��tf +(" -p :�etwork�ort�o connect�o. Defaults�o 1883 for�lain MQTT�nd 8883 for MQTT over TLS.\n"); + +217 + `��tf +(" -P :�rovide��assword\n"); + +218 + `��tf +(" -q : quality of service�evel�o use for�he subscription. Defaults�o 0.\n"); + +219 + `��tf +(" -R : do�ot�rint stale messages (those with�etain set).\n"); + +220 #ifde� +WITH_SRV + + +221 + `��tf +(" -S : use SRV�ookups�o determine which host�o connect�o.\n"); + +223 + `��tf +(" -t : mqtt�opic�o subscribe�o. May be�epeated multiple�imes.\n"); + +224 + `��tf +(" -T :�opic string�o filter out of�esults. May be�epeated.\n"); + +225 + `��tf +(" -u :�rovide� username\n"); + +226 + `��tf +(" -U : unsubscribe from��opic. May be�epeated.\n"); + +227 + `��tf +(" -v :�rint�ublished messages verbosely.\n"); + +228 + `��tf +(" -V : specify�he version of�he MQTT�rotocol�o use when connecting.\n"); + +229 + `��tf +(" Can be mqttv5, mqttv311 or mqttv31. Defaults�o mqttv311.\n"); + +230 #i�de� +WIN32 + + +231 + `��tf +(" -W : Specifies��imeout in seconds how�ong�o�rocess incoming MQTT messages.\n"); + +233 + `��tf +(" --help : display�his message.\n"); + +234 + `��tf +(" --quiet : don't�rint�rror messages.\n"); + +235 + `��tf +(" --retained-only : only handle messages with�he�etained flag set,�nd�xit when�he\n"); + +236 + `��tf +(" first�on-retained message is�eceived.\n"); + +237 + `��tf +(" --remove-retained : send� message�o�he server�o clear�ny�eceived�etained messages\n"); + +238 + `��tf +(" Use -T�o filter out messages you do�ot want�o be cleared.\n"); + +239 + `��tf +(" --will-payload :�ayload for�he client Will, which is sent by�he broker in case of\n"); + +240 + `��tf +(" unexpected disconnection. If�ot given�nd will-topic is set,� zero\n"); + +241 + `��tf +("�ength message will be sent.\n"); + +242 + `��tf +(" --will-qos : QoS�evel for�he client Will.\n"); + +243 + `��tf +(" --will-retain : if given, make�he client Will�etained.\n"); + +244 + `��tf +(" --will-topic :�he�opic on which�o�ublish�he client Will.\n"); + +245 #ifde� +WITH_TLS + + +246 + `��tf +(" --cafile :�ath�o� file containing�rusted CA certificates�o�nable�ncrypted\n"); + +247 + `��tf +(" certificate based communication.\n"); + +248 + `��tf +(" --capath :�ath�o� directory containing�rusted CA certificates�o�nable�ncrypted\n"); + +249 + `��tf +(" communication.\n"); + +250 + `��tf +(" --cert : client certificate for�uthentication, if�equired by server.\n"); + +251 + `��tf +(" --key : client�rivate key for�uthentication, if�equired by server.\n"); + +252 + `��tf +(" --keyform : keyfile�ype, can be�ither \"pem\" or \"engine\".\n"); + +253 + `��tf +(" --ciphers : openssl compatible�ist of TLS ciphers�o support.\n"); + +254 + `��tf +(" --tls-version : TLS�rotocol version, can be one of�lsv1.3�lsv1.2 or�lsv1.1.\n"); + +255 + `��tf +(" Defaults�o�lsv1.2 if�vailable.\n"); + +256 + `��tf +(" --insecure : do�ot check�hat�he server certificate hostname matches�he�emote\n"); + +257 + `��tf +(" hostname. Using�his option means�hat you cannot be sure�hat�he\n"); + +258 + `��tf +("�emote host is�he server you wish�o connect�o�nd so is insecure.\n"); + +259 + `��tf +(" Do�ot use�his option in��roduction�nvironment.\n"); + +260 + `��tf +(" --tls-engine : If set,�nables�he use of� SSL�ngine device.\n"); + +261 + `��tf +(" --tls-engine-kpass-sha1 : SHA1 of�he key�assword�o be used with�he selected SSL�ngine.\n"); + +262 #ifde� +FINAL_WITH_TLS_PSK + + +263 + `��tf +(" --psk :�re-shared-key in hexadecimal (no�eading 0x)�o�nable TLS-PSK mode.\n"); + +264 + `��tf +(" --psk-identity : client identity string for TLS-PSK mode.\n"); + +267 #ifde� +WITH_SOCKS + + +268 + `��tf +(" --proxy : SOCKS5�roxy URL of�he form:\n"); + +269 + `��tf +(" socks5h://[username[:password]@]hostname[:port]\n"); + +270 + `��tf +(" Only \"none\"�nd \"username\"�uthentication is supported.\n"); + +272 + `��tf +("\nSee https://mosquitto.org/ for more information.\n\n"); + +273 + } +} + +275 + $ma� +( +�gc +, * +�gv +[]) + +277 +rc +; + +278 #i�de� +WIN32 + + +279 +siga�i� + +siga� +; + +282 + `mem�t +(& +cfg +, 0, ( +mosq_c�fig +)); + +284 + `mosqu�to_lib_�� +(); + +286 +rc + = + `���_c�fig_l�d +(& +cfg +, +CLIENT_SUB +, +�gc +, +�gv +); + +287 if( +rc +){ + +288 if( +rc + == 2){ + +290 + `��t_u�ge +(); + +292 + `�r�tf +( +�d�r +, "\nUse 'mosquitto_sub --help'�o see usage.\n"); + +294 +��nup +; + +297 if( +cfg +. +no_��� + && cfg. +���ed_�ly +){ + +298 + `�r�tf +( +�d�r +, "\nError: Combining '-R'�nd '--retained-only' makes�o sense.\n"); + +299 +��nup +; + +302 if( + `���_id_g���e +(& +cfg +)){ + +303 +��nup +; + +306 +mosq + = + `mosqu�to_�w +( +cfg +. +id +, cfg. +��n_�ssi� +, &cfg); + +307 if(! +mosq +){ + +308 +��o +){ + +309 +ENOMEM +: + +310 + `�r_��tf +(& +cfg +, "Error: Out of memory.\n"); + +312 +EINVAL +: + +313 + `�r_��tf +(& +cfg +, "Error: Invalid id�nd/or clean_session.\n"); + +316 +��nup +; + +318 if( + `���_�ts_�t +( +mosq +, & +cfg +)){ + +319 +��nup +; + +321 if( +cfg +. +debug +){ + +322 + `mosqu�to_log_��back_�t +( +mosq +, +my_log_��back +); + +323 + `mosqu�to_subs�ibe_��back_�t +( +mosq +, +my_subs�ibe_��back +); + +325 + `mosqu�to_c���_v5_��back_�t +( +mosq +, +my_c���_��back +); + +326 + `mosqu�to_mes�ge_v5_��back_�t +( +mosq +, +my_mes�ge_��back +); + +328 +rc + = + `���_c��� +( +mosq +, & +cfg +); + +329 if( +rc +){ + +330 +��nup +; + +333 #i�de� +WIN32 + + +334 +siga� +. +�_h�d�r + = +my_sig�l_h�d�r +; + +335 + `sigem�y�t +(& +siga� +. +�_mask +); + +336 +siga� +. +�_�ags + = 0; + +338 if( + `siga�i� +( +SIGALRM +, & +siga� +, +NULL +) == -1){ + +339 + `��� +("sigaction"); + +340 +��nup +; + +343 if( +cfg +. +timeout +){ + +344 + `��m +( +cfg +. +timeout +); + +348 +rc + = + `mosqu�to_lo�_f�ev� +( +mosq +, -1, 1); + +350 + `mosqu�to_de�roy +( +mosq +); + +351 + `mosqu�to_lib_��nup +(); + +353 if( +cfg +. +msg_cou� +>0 && +rc + =� +MOSQ_ERR_NO_CONN +){ + +354 +rc + = 0; + +356 + `���_c�fig_��nup +(& +cfg +); + +357 if( +rc +){ + +358 + `�r�tf +( +�d�r +, "E��: %s\n", + `mosqu�to_���� +( +rc +)); + +360 +rc +; + +362 +��nup +: + +363 + `mosqu�to_lib_��nup +(); + +364 + `���_c�fig_��nup +(& +cfg +); + +366 + } +} + + @client/sub_client_output.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<��o.h +> + +21 + ~<�dio.h +> + +22 + ~<�dlib.h +> + +23 + ~<�r�g.h +> + +24 + ~<time.h +> + +25 #i�de� +WIN32 + + +26 + ~<uni�d.h +> + +28 + ~<�o�ss.h +> + +29 + ~<w�sock2.h +> + +30 + #���tf + +�r�tf_s + + + ) + +33 #ifde� +__APPLE__ + + +34 + ~<sys/time.h +> + +37 + ~<mosqu�to.h +> + +38 + ~"���_sh�ed.h +" + +40 +mosq_c�fig + +cfg +; + +42 + $g�_time +( +tm + ** +ti +, * +ns +) + +44 #ifde� +WIN32 + + +45 +SYSTEMTIME + +� +; + +46 #�i� + `def�ed +( +__APPLE__ +) + +47 +timev� + +tv +; + +49 +time�ec + +ts +; + +51 +time_t + +s +; + +53 #ifde� +WIN32 + + +54 +s + = + `time +( +NULL +); + +56 + `G�Lo�lTime +(& +� +); + +57 * +ns + = +� +. +wM�li�c�ds +*1000000L; + +58 #�i� + `def�ed +( +__APPLE__ +) + +59 + `g�timeofday +(& +tv +, +NULL +); + +60 +s + = +tv +. +tv_�c +; + +61 * +ns + = +tv +. +tv_u�c +*1000; + +63 if( + `�ock_g�time +( +CLOCK_REALTIME +, & +ts +) != 0){ + +64 + `�r_��tf +(& +cfg +, "Error obtaining system�ime.\n"); + +67 +s + = +ts +. +tv_�c +; + +68 * +ns + = +ts +. +tv_n�c +; + +71 * +ti + = + `lo��ime +(& +s +); + +72 if(!(* +ti +)){ + +73 + `�r_��tf +(& +cfg +, "Error obtaining system�ime.\n"); + +78 + } +} + +81 + $wr�e_�yl�d +(cڡ * +�yl�d +, +�yl�d�n +, +hex +) + +83 +i +; + +85 if( +hex + == 0){ + +86 () + `fwr�e +( +�yl�d +, 1, +�yl�d�n +, +�dout +); + +87 }if( +hex + == 1){ + +88 +i +=0; i< +�yl�d�n +; i++){ + +89 + `�r�tf +( +�dout +, "%02x", +�yl�d +[ +i +]); + +91 }if( +hex + == 2){ + +92 +i +=0; i< +�yl�d�n +; i++){ + +93 + `�r�tf +( +�dout +, "%02X", +�yl�d +[ +i +]); + +96 + } +} + +99 + $wr�e_js�_�yl�d +(cڡ * +�yl�d +, +�yl�d�n +) + +101 +i +; + +103 +i +=0; i< +�yl�d�n +; i++){ + +104 if( +�yl�d +[ +i +] == '"' ||�ayload[i] == '\\' || (payload[i] >=0 &&�ayload[i] < 32)){ + +105 + `��tf +("\\u%04x", +�yl�d +[ +i +]); + +107 + `�utc +( +�yl�d +[ +i +], +�dout +); + +110 + } +} + +113 + $js�_��t +(cڡ +mosqu�to_mes�ge + * +mes�ge +, cڡ +tm + * +ti +, +bo� + +es��d +) + +115 +buf +[100]; + +117 + `�r�ime +( +buf +, 100, "%s", +ti +); + +118 + `��tf +("{\"t�\":%s,\"t�ic\":\"%s\",\"qos\":%d,\"���\":%d,\"�yl�d�n\":%d,", +buf +, +mes�ge +-> +t�ic +, mes�ge-> +qos +, mes�ge-> +��� +, mes�ge-> +�yl�d�n +); + +119 if( +mes�ge +-> +qos + > 0){ + +120 + `��tf +("\"mid\":%d,", +mes�ge +-> +mid +); + +122 if( +es��d +){ + +123 + `�uts +("\"�yl�d\":\"", +�dout +); + +124 + `wr�e_js�_�yl�d +( +mes�ge +-> +�yl�d +, mes�ge-> +�yl�d�n +); + +125 + `�uts +("\"}", +�dout +); + +127 + `�uts +("\"�yl�d\":", +�dout +); + +128 + `wr�e_�yl�d +( +mes�ge +-> +�yl�d +, mes�ge-> +�yl�d�n +, 0); + +129 + `�uts +("}", +�dout +); + +131 + } +} + +134 + $f�m��d_��t +(cڡ +mosq_c�fig + * +lcfg +, cڡ +mosqu�to_mes�ge + * +mes�ge +) + +136 +�n +; + +137 +i +; + +138 +tm + * +ti + = +NULL +; + +139 +ns +; + +140 +�rf +[3]; + +141 +buf +[100]; + +143 +�n + = + `��� +( +lcfg +-> +f�m� +); + +145 +i +=0; i< +�n +; i++){ + +146 if( +lcfg +-> +f�m� +[ +i +] == '%'){ + +147 if( +i + < +�n +-1){ + +148 +i +++; + +149 +lcfg +-> +f�m� +[ +i +]){ + +151 + `�utc +('%', +�dout +); + +155 if(! +ti +){ + +156 if( + `g�_time +(& +ti +, & +ns +)){ + +157 + `�r_��tf +( +lcfg +, "Error obtaining system�ime.\n"); + +161 if( + `�r�ime +( +buf +, 100, "%FT%T%z", +ti +) != 0){ + +162 + `�uts +( +buf +, +�dout +); + +167 if(! +ti +){ + +168 if( + `g�_time +(& +ti +, & +ns +)){ + +169 + `�r_��tf +( +lcfg +, "Error obtaining system�ime.\n"); + +173 + `js�_��t +( +mes�ge +, +ti +, +�ue +); + +177 if(! +ti +){ + +178 if( + `g�_time +(& +ti +, & +ns +)){ + +179 + `�r_��tf +( +lcfg +, "Error obtaining system�ime.\n"); + +183 + `js�_��t +( +mes�ge +, +ti +, +�l� +); + +187 + `��tf +("%d", +mes�ge +-> +�yl�d�n +); + +191 + `��tf +("%d", +mes�ge +-> +mid +); + +195 + `wr�e_�yl�d +( +mes�ge +-> +�yl�d +, mes�ge-> +�yl�d�n +, 0); + +199 + `�utc +( +mes�ge +-> +qos + + 48, +�dout +); + +203 if( +mes�ge +-> +��� +){ + +204 + `�utc +('1', +�dout +); + +206 + `�utc +('0', +�dout +); + +211 + `�uts +( +mes�ge +-> +t�ic +, +�dout +); + +215 if(! +ti +){ + +216 if( + `g�_time +(& +ti +, & +ns +)){ + +217 + `�r_��tf +( +lcfg +, "Error obtaining system�ime.\n"); + +221 if( + `�r�ime +( +buf +, 100, "%s", +ti +) != 0){ + +222 + `��tf +("%s.%09ld", +buf +, +ns +); + +227 + `wr�e_�yl�d +( +mes�ge +-> +�yl�d +, mes�ge-> +�yl�d�n +, 1); + +231 + `wr�e_�yl�d +( +mes�ge +-> +�yl�d +, mes�ge-> +�yl�d�n +, 2); + +235 }if( +lcfg +-> +f�m� +[ +i +] == '@'){ + +236 if( +i + < +�n +-1){ + +237 +i +++; + +238 if( +lcfg +-> +f�m� +[ +i +] == '@'){ + +239 + `�utc +('@', +�dout +); + +241 if(! +ti +){ + +242 if( + `g�_time +(& +ti +, & +ns +)){ + +243 + `�r_��tf +( +lcfg +, "Error obtaining system�ime.\n"); + +248 +�rf +[0] = '%'; + +249 +�rf +[1] = +lcfg +-> +f�m� +[ +i +]; + +250 +�rf +[2] = 0; + +252 if( +lcfg +-> +f�m� +[ +i +] == 'N'){ + +253 + `��tf +("%09ld", +ns +); + +255 if( + `�r�ime +( +buf +, 100, +�rf +, +ti +) != 0){ + +256 + `�uts +( +buf +, +�dout +); + +261 }if( +lcfg +-> +f�m� +[ +i +] == '\\'){ + +262 if( +i + < +�n +-1){ + +263 +i +++; + +264 +lcfg +-> +f�m� +[ +i +]){ + +266 + `�utc +('\\', +�dout +); + +270 + `�utc +('\0', +�dout +); + +274 + `�utc +('\a', +�dout +); + +278 + `�utc +('\033', +�dout +); + +282 + `�utc +('\n', +�dout +); + +286 + `�utc +('\r', +�dout +); + +290 + `�utc +('\t', +�dout +); + +294 + `�utc +('\v', +�dout +); + +299 + `�utc +( +lcfg +-> +f�m� +[ +i +], +�dout +); + +302 if( +lcfg +-> +e� +){ + +303 + `�utc +('\n', +�dout +); + +305 + `f�ush +( +�dout +); + +306 + } +} + +309 + $��t_mes�ge +( +mosq_c�fig + * +cfg +, cڡ +mosqu�to_mes�ge + * +mes�ge +) + +311 if( +cfg +-> +f�m� +){ + +312 + `f�m��d_��t +( +cfg +, +mes�ge +); + +313 }if( +cfg +-> +v�bo� +){ + +314 if( +mes�ge +-> +�yl�d�n +){ + +315 + `��tf +("%�", +mes�ge +-> +t�ic +); + +316 + `wr�e_�yl�d +( +mes�ge +-> +�yl�d +, mes�ge-> +�yl�d�n +, +�l� +); + +317 if( +cfg +-> +e� +){ + +318 + `��tf +("\n"); + +321 if( +cfg +-> +e� +){ + +322 + `��tf +("%��u�)\n", +mes�ge +-> +t�ic +); + +325 + `f�ush +( +�dout +); + +327 if( +mes�ge +-> +�yl�d�n +){ + +328 + `wr�e_�yl�d +( +mes�ge +-> +�yl�d +, mes�ge-> +�yl�d�n +, +�l� +); + +329 if( +cfg +-> +e� +){ + +330 + `��tf +("\n"); + +332 + `f�ush +( +�dout +); + +335 + } +} + + @config.h + +1 #i�de� +CONFIG_H + + +2 + #CONFIG_H + + + ) + +7 #ifde� +__APPLE__ + + +8 + #__DARWIN_C_SOURCE + + + ) + +9 #�i� +def�ed +( +__F�eBSD__ +�|| def�ed( +__N�BSD__ +�|| def�ed( +__SYMBIAN32__ +�|| def�ed( +__QNX__ +) + +10 + #_XOPEN_SOURCE + 700 + + ) + +11 + #__BSD_VISIBLE + 1 + + ) + +12 + #HAVE_NETINET_IN_H + + + ) + +14 + #_XOPEN_SOURCE + 700 + + ) + +15 + #_DEFAULT_SOURCE + 1 + + ) + +16 + #_POSIX_C_SOURCE + 200809L + + ) + +19 + #_GNU_SOURCE + + + ) + +21 + #OPENSSL_LOAD_CONF + + + ) + +26 #i� +def�ed +( +_MSC_VER +) && _MSC_VER < 1900 + +27 + #���tf + +�r�tf_s + + + ) + +28 + #EPROTO + +ECONNABORTED + + + ) + +31 #ifde� +WIN32 + + +32 #i�de� +�r��cmp + + +33 + #�r��cmp + +�rcmpi + + + ) + +35 + #��ok_r + +��ok_s + + + ) + +36 + #����_r +( +e +, +b +, +l +� + `����_s +(b,�,�) + + ) + +40 + #uthash_m�loc +( +sz +� + `mosqu�to__m�loc +(sz) + + ) + +41 + #uthash_� +( +�r +, +sz +� + `mosqu�to__� +Ռ) + + ) + +44 #ifde� +WITH_TLS + + +45 + ~<ݒs�/ݒs�c�f.h +> + +46 #i� +def�ed +( +WITH_TLS_PSK +�&& !def�ed( +OPENSSL_NO_PSK +) + +47 + #FINAL_WITH_TLS_PSK + + + ) + +52 #ifde� +__COVERITY__ + + +53 + ~<�d�t.h +> + +55 + #_Fl�t32 + +u�t32_t + + + ) + +56 + #_Fl�t32x + +u�t32_t + + + ) + +57 + #_Fl�t64 + +u�t64_t + + + ) + +58 + #_Fl�t64x + +u�t64_t + + + ) + +59 + #_Fl�t128 + +u�t64_t + + + ) + +62 + #UNUSED +( +A +�()(A) + + ) + +65 #i�de� +ANDROID + + +66 + #HAVE_PTHREAD_CANCEL + + + ) + + @examples/mysql_log/mysql_log.c + +1 + ~<sig�l.h +> + +2 + ~<�dio.h +> + +3 + ~<�r�g.h +> + +5 #i�de� +WIN32 + + +6 + ~<uni�d.h +> + +8 + ~<�o�ss.h +> + +9 + #���tf + +�r�tf_s + + + ) + +12 + ~<mosqu�to.h +> + +13 + ~<mysql/mysql.h +> + +15 + #db_ho� + "lo�lho�" + + ) + +16 + #db_u��ame + "mq�_log" + + ) + +17 + #db_�ssw�d + "�ssw�d" + + ) + +18 + #db_d�aba� + "mq�_log" + + ) + +19 + #db_p�t + 3306 + + ) + +21 + #db_qu�y + "INSERT INTO mq�_log (t�ic,�ayl�d�VALUES (?,?)" + + ) + +23 + #mq�_ho� + "lo�lho�" + + ) + +24 + #mq�_p�t + 1883 + + ) + +26 + grun + = 1; + +27 +MYSQL_STMT + * + g�mt + = +NULL +; + +29 + $h�d�_sig�l +( +s +) + +31 +run + = 0; + +32 + } +} + +34 + $c���_��back +( +mosqu�to + * +mosq +, * +obj +, +�su� +) + +36 + } +} + +38 + $mes�ge_��back +( +mosqu�to + * +mosq +, * +obj +, cڡ +mosqu�to_mes�ge + * +mes�ge +) + +40 +MYSQL_BIND + +b�d +[2]; + +42 + `mem�t +( +b�d +, 0, (bind)); + +44 +b�d +[0]. +buf�r_ty� + = +MYSQL_TYPE_STRING +; + +45 +b�d +[0]. +buf�r + = +mes�ge +-> +t�ic +; + +46 +b�d +[0]. +buf�r_�ngth + = + `��� +( +mes�ge +-> +t�ic +); + +50 +b�d +[1]. +buf�r_ty� + = +MYSQL_TYPE_STRING +; + +51 +b�d +[1]. +buf�r + = +mes�ge +-> +�yl�d +; + +52 +b�d +[1]. +buf�r_�ngth + = +mes�ge +-> +�yl�d�n +; + +54 + `mysql_�mt_b�d_��m +( +�mt +, +b�d +); + +55 + `mysql_�mt_execu� +( +�mt +); + +56 + } +} + +58 + $ma� +( +�gc +, * +�gv +[]) + +60 +MYSQL + * +c���i� +; + +61 +my_bo� + +�c��� + = +�ue +; + +62 +���id +[24]; + +63 +mosqu�to + * +mosq +; + +64 +rc + = 0; + +66 + `sig�l +( +SIGINT +, +h�d�_sig�l +); + +67 + `sig�l +( +SIGTERM +, +h�d�_sig�l +); + +69 + `mysql_lib�ry_�� +(0, +NULL +, NULL); + +70 + `mosqu�to_lib_�� +(); + +72 +c���i� + = + `mysql_�� +( +NULL +); + +74 if( +c���i� +){ + +75 + `mysql_�ti�s +( +c���i� +, +MYSQL_OPT_RECONNECT +, & +�c��� +); + +77 +c���i� + = + `mysql_��_c��� +(c���i�, +db_ho� +, +db_u��ame +, +db_�ssw�d +, +db_d�aba� +, +db_p�t +, +NULL +, 0); + +79 if( +c���i� +){ + +80 +�mt + = + `mysql_�mt_�� +( +c���i� +); + +82 + `mysql_�mt_���e +( +�mt +, +db_qu�y +, + `��� +(db_query)); + +84 + `mem�t +( +���id +, 0, 24); + +85 + `���tf +( +���id +, 23, "mysql_log_%d", + `g�pid +()); + +86 +mosq + = + `mosqu�to_�w +( +���id +, +�ue +, +c���i� +); + +87 if( +mosq +){ + +88 + `mosqu�to_c���_��back_�t +( +mosq +, +c���_��back +); + +89 + `mosqu�to_mes�ge_��back_�t +( +mosq +, +mes�ge_��back +); + +92 +rc + = + `mosqu�to_c��� +( +mosq +, +mq�_ho� +, +mq�_p�t +, 60); + +94 + `mosqu�to_subs�ibe +( +mosq +, +NULL +, "#", 0); + +96 +run +){ + +97 +rc + = + `mosqu�to_lo� +( +mosq +, -1, 1); + +98 if( +run + && +rc +){ + +99 + `��p +(20); + +100 + `mosqu�to_�c��� +( +mosq +); + +103 + `mosqu�to_de�roy +( +mosq +); + +105 + `mysql_�mt_�o� +( +�mt +); + +107 + `mysql_�o� +( +c���i� +); + +109 + `�r�tf +( +�d�r +, "Error: Unable�o connect�o database.\n"); + +110 + `��tf +("%s\n", + `mysql_�r� +( +c���i� +)); + +111 +rc + = 1; + +114 + `�r�tf +( +�d�r +, "Error: Unable�o start mysql.\n"); + +115 +rc + = 1; + +118 + `mysql_lib�ry_�d +(); + +119 + `mosqu�to_lib_��nup +(); + +121 +rc +; + +122 + } +} + + @examples/subscribe_simple/callback.c + +1 + ~<�dlib.h +> + +2 + ~<�dio.h +> + +3 + ~"mosqu�to.h +" + +5 + $�_mes�ge +( +mosqu�to + * +mosq +, * +u�rd�a +, cڡ +mosqu�to_mes�ge + * +msg +) + +7 + `��tf +("%�%�(%d)\n", +msg +-> +t�ic +, (cڡ *)msg-> +�yl�d +, msg-> +�yl�d�n +); + +9 + } +} + +12 + $ma� +( +�gc +, * +�gv +[]) + +14 +rc +; + +16 + `mosqu�to_lib_�� +(); + +18 +rc + = + `mosqu�to_subs�ibe_��back +( + +19 +�_mes�ge +, +NULL +, + +22 +NULL +, 60, +�ue +, + +23 +NULL +, NULL, + +24 +NULL +, NULL); + +26 if( +rc +){ + +27 + `��tf +("E��: %s\n", + `mosqu�to_���� +( +rc +)); + +30 + `mosqu�to_lib_��nup +(); + +32 +rc +; + +33 + } +} + + @examples/subscribe_simple/multiple.c + +1 + ~<�dlib.h +> + +2 + ~<�dio.h +> + +3 + ~"mosqu�to.h +" + +5 + #COUNT + 3 + + ) + +7 + $ma� +( +�gc +, * +�gv +[]) + +9 +rc +; + +10 +i +; + +11 +mosqu�to_mes�ge + * +msg +; + +13 + `mosqu�to_lib_�� +(); + +15 +rc + = + `mosqu�to_subs�ibe_sim�e +( + +16 & +msg +, +COUNT +, +�ue +, + +19 +NULL +, 60, +�ue +, + +20 +NULL +, NULL, + +21 +NULL +, NULL); + +23 if( +rc +){ + +24 + `��tf +("E��: %s\n", + `mosqu�to_���� +( +rc +)); + +25 + `mosqu�to_lib_��nup +(); + +26 +rc +; + +29 +i +=0; i< +COUNT +; i++){ + +30 + `��tf +("%�%s\n", +msg +[ +i +]. +t�ic +, (*)msg[i]. +�yl�d +); + +31 + `mosqu�to_mes�ge_�_cڋ�s +(& +msg +[ +i +]); + +33 + `� +( +msg +); + +35 + `mosqu�to_lib_��nup +(); + +38 + } +} + + @examples/subscribe_simple/single.c + +1 + ~<�dlib.h +> + +2 + ~<�dio.h +> + +3 + ~"mosqu�to.h +" + +5 + $ma� +( +�gc +, * +�gv +[]) + +7 +rc +; + +8 +mosqu�to_mes�ge + * +msg +; + +10 + `mosqu�to_lib_�� +(); + +12 +rc + = + `mosqu�to_subs�ibe_sim�e +( + +13 & +msg +, 1, +�ue +, + +16 +NULL +, 60, +�ue +, + +17 +NULL +, NULL, + +18 +NULL +, NULL); + +20 if( +rc +){ + +21 + `��tf +("E��: %s\n", + `mosqu�to_���� +( +rc +)); + +22 + `mosqu�to_lib_��nup +(); + +23 +rc +; + +26 + `��tf +("%�%s\n", +msg +-> +t�ic +, (*)msg-> +�yl�d +); + +27 + `mosqu�to_mes�ge_� +(& +msg +); + +29 + `mosqu�to_lib_��nup +(); + +32 + } +} + + @examples/temperature_conversion/main.cpp + +1 + ~"�m��tu�_c�v�si�.h +" + +3 + $ma� +( +�gc +, * +�gv +[]) + +5 +�ass + +mq�_�mpc�v + * +�mpc�v +; + +6 +rc +; + +8 +mosq� +:: + `lib_�� +(); + +10 +�mpc�v + = +�w + + `mq�_�mpc�v +("tempconv", "localhost", 1883); + +11 +�mpc�v +-> + `lo�_f�ev� +(); + +13 +mosq� +:: + `lib_��nup +(); + +16 + } +} + + @examples/temperature_conversion/temperature_conversion.cpp + +1 + ~<c�dio +> + +2 + ~<c�r�g +> + +4 + ~"�m��tu�_c�v�si�.h +" + +5 + ~<mosqu�t�p.h +> + +7 + gmq�_�mpc�v +:: + $mq�_�mpc�v +(cڡ * +id +, cڡ * +ho� +, +p�t +�: + $mosqu�t�p +( +id +) + +9 +k��live + = 60; + +13 + `c��� +( +ho� +, +p�t +, +k��live +); + +14 + } +}; + +16 + gmq�_�mpc�v +::~ + $mq�_�mpc�v +() + +18 + } +} + +20 +mq�_�mpc�v +:: + $�_c��� +( +rc +) + +22 + `��tf +("C���ed w�h cod�%d.\n", +rc +); + +23 if( +rc + == 0){ + +25 + `subs�ibe +( +NULL +, "temperature/celsius"); + +27 + } +} + +29 + gmq�_�mpc�v +:: + $�_mes�ge +(cڡ +mosqu�to_mes�ge + * +mes�ge +) + +31 +�mp_�lsius +, +�mp_�nhe� +; + +32 +buf +[51]; + +34 if(! + `�rcmp +( +mes�ge +-> +t�ic +, "temperature/celsius")){ + +35 + `mem�t +( +buf +, 0, 51*()); + +37 + `mem�y +( +buf +, +mes�ge +-> +�yl�d +, 50*()); + +38 +�mp_�lsius + = + `�of +( +buf +); + +39 +�mp_�nhe� + = +�mp_�lsius +*9.0/5.0 + 32.0; + +40 + `���tf +( +buf +, 50, "%f", +�mp_�nhe� +); + +41 + `publish +( +NULL +, "�m��tu�/�nhe�", + `��� +( +buf +), buf); + +43 + } +} + +45 + gmq�_�mpc�v +:: + $�_subs�ibe +( +mid +, +qos_cou� +, cڡ * +g��ed_qos +) + +47 + `��tf +("Subscription succeeded.\n"); + +48 + } +} + + @examples/temperature_conversion/temperature_conversion.h + +1 #i�de� +TEMPERATURE_CONVERSION_H + + +2 + #TEMPERATURE_CONVERSION_H + + + ) + +4 + ~<mosqu�t�p.h +> + +6 �as� + cmq�_�mpc�v + : +public + +mosq� +:: +mosqu�t�p + + +8 +public +: + +9 +mq�_�mpc�v +(cڡ * +id +, cڡ * +ho� +, +p�t +); + +10 ~ +mq�_�mpc�v +(); + +12 +�_c��� +( +rc +); + +13 +�_mes�ge +(cڡ +mosqu�to_mes�ge + * +mes�ge +); + +14 +�_subs�ibe +( +mid +, +qos_cou� +, cڡ * +g��ed_qos +); + + @lib/actions.c + +17 + ~"c�fig.h +" + +19 + ~<�r�g.h +> + +21 + ~"mosqu�to.h +" + +22 + ~"mosqu�to_����.h +" + +23 + ~"mem�y_mosq.h +" + +24 + ~"mes�ges_mosq.h +" + +25 + ~"mq�_��oc�.h +" + +26 + ~"�t_mosq.h +" + +27 + ~"�ck�_mosq.h +" + +28 + ~"�nd_mosq.h +" + +29 + ~"ut�_mosq.h +" + +32 + $mosqu�to_publish +( +mosqu�to + * +mosq +, * +mid +, cڡ * +t�ic +, +�yl�d�n +, cڡ * +�yl�d +, +qos +, +bo� + +��� +) + +34 + `mosqu�to_publish_v5 +( +mosq +, +mid +, +t�ic +, +�yl�d�n +, +�yl�d +, +qos +, +��� +, +NULL +); + +35 + } +} + +37 + $mosqu�to_publish_v5 +( +mosqu�to + * +mosq +, * +mid +, cڡ * +t�ic +, +�yl�d�n +, cڡ * +�yl�d +, +qos +, +bo� + +��� +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +39 +mosqu�to_mes�ge_�l + * +mes�ge +; + +40 +u�t16_t + +lo�l_mid +; + +41 cڡ +mosqu�to_�ݔty + * +p +; + +42 cڡ +mosqu�to_�ݔty + * +outgo�g_�ݔt�s + = +NULL +; + +43 +mosqu�to_�ݔty + +lo�l_�ݔty +; + +44 +bo� + +have_t�ic_��s +; + +45 +rc +; + +46 +�� + = 0; + +47 +u�t32_t + +�ma��g_�ngth +; + +49 if(! +mosq + || +qos +<0 || qos>2� +MOSQ_ERR_INVAL +; + +50 if( +mosq +-> +��oc� + !� +mosq_p_mq�5 + && +�ݔt�s +� +MOSQ_ERR_NOT_SUPPORTED +; + +51 if( +qos + > +mosq +-> +maximum_qos +� +MOSQ_ERR_QOS_NOT_SUPPORTED +; + +53 if( +�ݔt�s +){ + +54 if( +�ݔt�s +-> +���_g���ed +){ + +55 +outgo�g_�ݔt�s + = +�ݔt�s +; + +57 + `mem�y +(& +lo�l_�ݔty +, +�ݔt�s +, ( +mosqu�to_�ݔty +)); + +58 +lo�l_�ݔty +. +���_g���ed + = +�ue +; + +59 +lo�l_�ݔty +. +�xt + = +NULL +; + +60 +outgo�g_�ݔt�s + = & +lo�l_�ݔty +; + +62 +rc + = + `mosqu�to_�ݔty_check_�l +( +CMD_PUBLISH +, +outgo�g_�ݔt�s +); + +63 if( +rc +) �c; + +66 if(! +t�ic + || + `STREMPTY +(topic)){ + +67 if( +t�ic +�t�i�� +NULL +; + +69 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +70 +p + = +outgo�g_�ݔt�s +; + +71 +have_t�ic_��s + = +�l� +; + +72 +p +){ + +73 if( +p +-> +id�tif�r + =� +MQTT_PROP_TOPIC_ALIAS +){ + +74 +have_t�ic_��s + = +�ue +; + +77 +p + =�-> +�xt +; + +79 if( +have_t�ic_��s + =� +�l� +){ + +80 +MOSQ_ERR_INVAL +; + +83 +MOSQ_ERR_INVAL +; + +86 +�� + = + `��� +( +t�ic +); + +87 if( + `mosqu�to_v�id�e_utf8 +( +t�ic +, +�� +)� +MOSQ_ERR_MALFORMED_UTF8 +; + +88 if( +�yl�d�n + < 0 ||�ayl�d��> +MQTT_MAX_PAYLOAD +� +MOSQ_ERR_PAYLOAD_SIZE +; + +89 if( + `mosqu�to_pub_t�ic_check +( +t�ic +�!� +MOSQ_ERR_SUCCESS +){ + +90 +MOSQ_ERR_INVAL +; + +94 if( +mosq +-> +maximum_�ck�_size + > 0){ + +95 +�ma��g_�ngth + = 1 + 2+ +�� + + +�yl�d�n + + + `�ݔty__g�_�ngth_�l +( +outgo�g_�ݔt�s +); + +96 if( +qos + > 0){ + +97 +�ma��g_�ngth +++; + +99 if( + `�ck�__check_ov�size +( +mosq +, +�ma��g_�ngth +)){ + +100 +MOSQ_ERR_OVERSIZE_PACKET +; + +104 +lo�l_mid + = + `mosqu�to__mid_g���e +( +mosq +); + +105 if( +mid +){ + +106 * +mid + = +lo�l_mid +; + +109 if( +qos + == 0){ + +110 + `�nd__publish +( +mosq +, +lo�l_mid +, +t�ic +, +�yl�d�n +, +�yl�d +, +qos +, +��� +, +�l� +, +outgo�g_�ݔt�s +, +NULL +, 0); + +112 +mes�ge + = + `mosqu�to__��oc +(1, ( +mosqu�to_mes�ge_�l +)); + +113 if(! +mes�ge +� +MOSQ_ERR_NOMEM +; + +115 +mes�ge +-> +�xt + = +NULL +; + +116 +mes�ge +-> +time�amp + = + `mosqu�to_time +(); + +117 +mes�ge +-> +msg +. +mid + = +lo�l_mid +; + +118 if( +t�ic +){ + +119 +mes�ge +-> +msg +. +t�ic + = + `mosqu�to__�rdup +(topic); + +120 if(! +mes�ge +-> +msg +. +t�ic +){ + +121 + `mes�ge__��nup +(& +mes�ge +); + +122 +MOSQ_ERR_NOMEM +; + +125 if( +�yl�d�n +){ + +126 +mes�ge +-> +msg +. +�yl�d�n + =�ayloadlen; + +127 +mes�ge +-> +msg +. +�yl�d + = + `mosqu�to__m�loc +( +�yl�d�n +*( +u�t8_t +)); + +128 if(! +mes�ge +-> +msg +. +�yl�d +){ + +129 + `mes�ge__��nup +(& +mes�ge +); + +130 +MOSQ_ERR_NOMEM +; + +132 + `mem�y +( +mes�ge +-> +msg +. +�yl�d +,�ayl�d, +�yl�d�n +*( +u�t8_t +)); + +134 +mes�ge +-> +msg +. +�yl�d�n + = 0; + +135 +mes�ge +-> +msg +. +�yl�d + = +NULL +; + +137 +mes�ge +-> +msg +. +qos + = qos; + +138 +mes�ge +-> +msg +. +��� + =�etain; + +139 +mes�ge +-> +dup + = +�l� +; + +141 + `�h�ad_mu�x_lock +(& +mosq +-> +msgs_out +. +mu�x +); + +142 +mes�ge +-> +��e + = +mosq_ms_�v�id +; + +143 + `mes�ge__queue +( +mosq +, +mes�ge +, +mosq_md_out +); + +144 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgs_out +. +mu�x +); + +145 +MOSQ_ERR_SUCCESS +; + +147 + } +} + +150 + $mosqu�to_subs�ibe +( +mosqu�to + * +mosq +, * +mid +, cڡ * +sub +, +qos +) + +152 + `mosqu�to_subs�ibe_muɝ� +( +mosq +, +mid +, 1, (*cڡ *cڡ)& +sub +, +qos +, 0, +NULL +); + +153 + } +} + +156 + $mosqu�to_subs�ibe_v5 +( +mosqu�to + * +mosq +, * +mid +, cڡ * +sub +, +qos +, +�ti�s +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +158 + `mosqu�to_subs�ibe_muɝ� +( +mosq +, +mid +, 1, (*cڡ *cڡ)& +sub +, +qos +, +�ti�s +, +�ݔt�s +); + +159 + } +} + +162 + $mosqu�to_subs�ibe_muɝ� +( +mosqu�to + * +mosq +, * +mid +, +sub_cou� +, *cڡ *cڡ +sub +, +qos +, +�ti�s +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +164 cڡ +mosqu�to_�ݔty + * +outgo�g_�ݔt�s + = +NULL +; + +165 +mosqu�to_�ݔty + +lo�l_�ݔty +; + +166 +i +; + +167 +rc +; + +168 +u�t32_t + +�ma��g_�ngth + = 0; + +169 +�� +; + +171 if(! +mosq + || ! +sub_cou� + || ! +sub +� +MOSQ_ERR_INVAL +; + +172 if( +mosq +-> +��oc� + !� +mosq_p_mq�5 + && +�ݔt�s +� +MOSQ_ERR_NOT_SUPPORTED +; + +173 if( +qos + < 0 || qo�> 2� +MOSQ_ERR_INVAL +; + +174 if(( +�ti�s + & 0x30�=�0x30 || (�tiڠ& 0xC0�!�0� +MOSQ_ERR_INVAL +; + +175 if( +mosq +-> +sock + =� +INVALID_SOCKET +� +MOSQ_ERR_NO_CONN +; + +177 if( +�ݔt�s +){ + +178 if( +�ݔt�s +-> +���_g���ed +){ + +179 +outgo�g_�ݔt�s + = +�ݔt�s +; + +181 + `mem�y +(& +lo�l_�ݔty +, +�ݔt�s +, ( +mosqu�to_�ݔty +)); + +182 +lo�l_�ݔty +. +���_g���ed + = +�ue +; + +183 +lo�l_�ݔty +. +�xt + = +NULL +; + +184 +outgo�g_�ݔt�s + = & +lo�l_�ݔty +; + +186 +rc + = + `mosqu�to_�ݔty_check_�l +( +CMD_SUBSCRIBE +, +outgo�g_�ݔt�s +); + +187 if( +rc +) �c; + +190 +i +=0; i< +sub_cou� +; i++){ + +191 if( + `mosqu�to_sub_t�ic_check +( +sub +[ +i +])� +MOSQ_ERR_INVAL +; + +192 +�� + = + `��� +( +sub +[ +i +]); + +193 if( + `mosqu�to_v�id�e_utf8 +( +sub +[ +i +], +�� +)� +MOSQ_ERR_MALFORMED_UTF8 +; + +194 +�ma��g_�ngth + +�2+ +�� + + 1; + +197 if( +mosq +-> +maximum_�ck�_size + > 0){ + +198 +�ma��g_�ngth + +�2 + + `�ݔty__g�_�ngth_�l +( +outgo�g_�ݔt�s +); + +199 if( + `�ck�__check_ov�size +( +mosq +, +�ma��g_�ngth +)){ + +200 +MOSQ_ERR_OVERSIZE_PACKET +; + +204 + `�nd__subs�ibe +( +mosq +, +mid +, +sub_cou� +, +sub +, +qos +| +�ti�s +, +outgo�g_�ݔt�s +); + +205 + } +} + +208 + $mosqu�to_unsubs�ibe +( +mosqu�to + * +mosq +, * +mid +, cڡ * +sub +) + +210 + `mosqu�to_unsubs�ibe_muɝ� +( +mosq +, +mid +, 1, (*cڡ *cڡ)& +sub +, +NULL +); + +211 + } +} + +213 + $mosqu�to_unsubs�ibe_v5 +( +mosqu�to + * +mosq +, * +mid +, cڡ * +sub +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +215 + `mosqu�to_unsubs�ibe_muɝ� +( +mosq +, +mid +, 1, (*cڡ *cڡ)& +sub +, +�ݔt�s +); + +216 + } +} + +218 + $mosqu�to_unsubs�ibe_muɝ� +( +mosqu�to + * +mosq +, * +mid +, +sub_cou� +, *cڡ *cڡ +sub +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +220 cڡ +mosqu�to_�ݔty + * +outgo�g_�ݔt�s + = +NULL +; + +221 +mosqu�to_�ݔty + +lo�l_�ݔty +; + +222 +rc +; + +223 +i +; + +224 +u�t32_t + +�ma��g_�ngth + = 0; + +225 +�� +; + +227 if(! +mosq +� +MOSQ_ERR_INVAL +; + +228 if( +mosq +-> +��oc� + !� +mosq_p_mq�5 + && +�ݔt�s +� +MOSQ_ERR_NOT_SUPPORTED +; + +229 if( +mosq +-> +sock + =� +INVALID_SOCKET +� +MOSQ_ERR_NO_CONN +; + +231 if( +�ݔt�s +){ + +232 if( +�ݔt�s +-> +���_g���ed +){ + +233 +outgo�g_�ݔt�s + = +�ݔt�s +; + +235 + `mem�y +(& +lo�l_�ݔty +, +�ݔt�s +, ( +mosqu�to_�ݔty +)); + +236 +lo�l_�ݔty +. +���_g���ed + = +�ue +; + +237 +lo�l_�ݔty +. +�xt + = +NULL +; + +238 +outgo�g_�ݔt�s + = & +lo�l_�ݔty +; + +240 +rc + = + `mosqu�to_�ݔty_check_�l +( +CMD_UNSUBSCRIBE +, +outgo�g_�ݔt�s +); + +241 if( +rc +) �c; + +244 +i +=0; i< +sub_cou� +; i++){ + +245 if( + `mosqu�to_sub_t�ic_check +( +sub +[ +i +])� +MOSQ_ERR_INVAL +; + +246 +�� + = + `��� +( +sub +[ +i +]); + +247 if( + `mosqu�to_v�id�e_utf8 +( +sub +[ +i +], +�� +)� +MOSQ_ERR_MALFORMED_UTF8 +; + +248 +�ma��g_�ngth + +�2+ +�� +; + +251 if( +mosq +-> +maximum_�ck�_size + > 0){ + +252 +�ma��g_�ngth + +�2 + + `�ݔty__g�_�ngth_�l +( +outgo�g_�ݔt�s +); + +253 if( + `�ck�__check_ov�size +( +mosq +, +�ma��g_�ngth +)){ + +254 +MOSQ_ERR_OVERSIZE_PACKET +; + +258 + `�nd__unsubs�ibe +( +mosq +, +mid +, +sub_cou� +, +sub +, +outgo�g_�ݔt�s +); + +259 + } +} + + @lib/alias_mosq.c + +17 + ~"c�fig.h +" + +19 + ~"mosqu�to.h +" + +20 + ~"��s_mosq.h +" + +21 + ~"mem�y_mosq.h +" + +23 + $��s__add +( +mosqu�to + * +mosq +, cڡ * +t�ic +, +��s +) + +25 +i +; + +26 +mosqu�to__��s + * +���s +; + +28 +i +=0; i< +mosq +-> +��s_cou� +; i++){ + +29 if( +mosq +-> +���s +[ +i +]. +��s + ==�lias){ + +30 + `mosqu�to__� +( +mosq +-> +���s +[ +i +]. +t�ic +); + +31 +mosq +-> +���s +[ +i +]. +t�ic + = + `mosqu�to__�rdup +(topic); + +32 if( +mosq +-> +���s +[ +i +]. +t�ic +){ + +33 +MOSQ_ERR_SUCCESS +; + +36 +MOSQ_ERR_NOMEM +; + +42 +���s + = + `mosqu�to__��loc +( +mosq +->���s, ( +mosqu�to__��s +)*(mosq-> +��s_cou� ++1)); + +43 if(! +���s +� +MOSQ_ERR_NOMEM +; + +45 +mosq +-> +���s + =�liases; + +46 +mosq +-> +���s +[mosq-> +��s_cou� +]. +��s + =�lias; + +47 +mosq +-> +���s +[mosq-> +��s_cou� +]. +t�ic + = + `mosqu�to__�rdup +(topic); + +48 if(! +mosq +-> +���s +[mosq-> +��s_cou� +]. +t�ic +){ + +49 +MOSQ_ERR_NOMEM +; + +51 +mosq +-> +��s_cou� +++; + +53 +MOSQ_ERR_SUCCESS +; + +54 + } +} + +57 + $��s__f�d +( +mosqu�to + * +mosq +, ** +t�ic +, +��s +) + +59 +i +; + +61 +i +=0; i< +mosq +-> +��s_cou� +; i++){ + +62 if( +mosq +-> +���s +[ +i +]. +��s + ==�lias){ + +63 * +t�ic + = + `mosqu�to__�rdup +( +mosq +-> +���s +[ +i +].topic); + +64 if(* +t�ic +){ + +65 +MOSQ_ERR_SUCCESS +; + +67 +MOSQ_ERR_NOMEM +; + +71 +MOSQ_ERR_INVAL +; + +72 + } +} + +75 + $��s__�_�l +( +mosqu�to + * +mosq +) + +77 +i +; + +79 +i +=0; i< +mosq +-> +��s_cou� +; i++){ + +80 + `mosqu�to__� +( +mosq +-> +���s +[ +i +]. +t�ic +); + +82 + `mosqu�to__� +( +mosq +-> +���s +); + +83 +mosq +-> +���s + = +NULL +; + +84 +mosq +-> +��s_cou� + = 0; + +85 + } +} + + @lib/alias_mosq.h + +17 #i�de� +ALIAS_MOSQ_H + + +18 + #ALIAS_MOSQ_H + + + ) + +20 + ~"mosqu�to_����.h +" + +22 +��s__add +( +mosqu�to + * +mosq +, cڡ * +t�ic +, +��s +); + +23 +��s__f�d +( +mosqu�to + * +mosq +, ** +t�ic +, +��s +); + +24 +��s__�_�l +( +mosqu�to + * +mosq +); + + @lib/callbacks.c + +17 + ~"c�fig.h +" + +19 + ~"mosqu�to.h +" + +20 + ~"mosqu�to_����.h +" + +23 +mosqu�to_c���_��back_�t +( +mosqu�to + * +mosq +, (* +�_c��� +)(mosquitto *, *, )) + +25 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +26 +mosq +-> +�_c��� + = on_connect; + +27 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +28 + } +} + +30 +mosqu�to_c���_w�h_�ags_��back_�t +( +mosqu�to + * +mosq +, (* +�_c��� +)(mosquitto *, *, , )) + +32 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +33 +mosq +-> +�_c���_w�h_�ags + = +�_c��� +; + +34 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +35 + } +} + +37 +mosqu�to_c���_v5_��back_�t +( +mosqu�to + * +mosq +, (* +�_c��� +)(mosqu�t�*, *, , , cڡ +mosqu�to_�ݔty + *)) + +39 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +40 +mosq +-> +�_c���_v5 + = +�_c��� +; + +41 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +42 + } +} + +44 +mosqu�to_disc���_��back_�t +( +mosqu�to + * +mosq +, (* +�_disc��� +)(mosquitto *, *, )) + +46 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +47 +mosq +-> +�_disc��� + = on_disconnect; + +48 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +49 + } +} + +51 +mosqu�to_disc���_v5_��back_�t +( +mosqu�to + * +mosq +, (* +�_disc��� +)(mosqu�t�*, *, , cڡ +mosqu�to_�ݔty + *)) + +53 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +54 +mosq +-> +�_disc���_v5 + = +�_disc��� +; + +55 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +56 + } +} + +58 +mosqu�to_publish_��back_�t +( +mosqu�to + * +mosq +, (* +�_publish +)(mosquitto *, *, )) + +60 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +61 +mosq +-> +�_publish + = on_publish; + +62 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +63 + } +} + +65 +mosqu�to_publish_v5_��back_�t +( +mosqu�to + * +mosq +, (* +�_publish +)(mosqu�t�*, *, , , cڡ +mosqu�to_�ݔty + * +��s +)) + +67 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +68 +mosq +-> +�_publish_v5 + = +�_publish +; + +69 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +70 + } +} + +72 +mosqu�to_mes�ge_��back_�t +( +mosqu�to + * +mosq +, (* +�_mes�ge +)(mosqu�t�*, *, cڡ +mosqu�to_mes�ge + *)) + +74 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +75 +mosq +-> +�_mes�ge + = on_message; + +76 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +77 + } +} + +79 +mosqu�to_mes�ge_v5_��back_�t +( +mosqu�to + * +mosq +, (* +�_mes�ge +)(mosqu�t�*, *, cڡ +mosqu�to_mes�ge + *, cڡ +mosqu�to_�ݔty + * +��s +)) + +81 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +82 +mosq +-> +�_mes�ge_v5 + = +�_mes�ge +; + +83 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +84 + } +} + +86 +mosqu�to_subs�ibe_��back_�t +( +mosqu�to + * +mosq +, (* +�_subs�ibe +)(mosquitto *, *, , , const *)) + +88 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +89 +mosq +-> +�_subs�ibe + = on_subscribe; + +90 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +91 + } +} + +93 +mosqu�to_subs�ibe_v5_��back_�t +( +mosqu�to + * +mosq +, (* +�_subs�ibe +)(mosqu�t�*, *, , , cڡ *, cڡ +mosqu�to_�ݔty + * +��s +)) + +95 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +96 +mosq +-> +�_subs�ibe_v5 + = +�_subs�ibe +; + +97 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +98 + } +} + +100 +mosqu�to_unsubs�ibe_��back_�t +( +mosqu�to + * +mosq +, (* +�_unsubs�ibe +)(mosquitto *, *, )) + +102 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +103 +mosq +-> +�_unsubs�ibe + = on_unsubscribe; + +104 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +105 + } +} + +107 +mosqu�to_unsubs�ibe_v5_��back_�t +( +mosqu�to + * +mosq +, (* +�_unsubs�ibe +)(mosqu�t�*, *, , cڡ +mosqu�to_�ݔty + * +��s +)) + +109 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +110 +mosq +-> +�_unsubs�ibe_v5 + = +�_unsubs�ibe +; + +111 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +112 + } +} + +114 +mosqu�to_log_��back_�t +( +mosqu�to + * +mosq +, (* +�_log +)(mosquitto *, *, , const *)) + +116 + `�h�ad_mu�x_lock +(& +mosq +-> +log_��back_mu�x +); + +117 +mosq +-> +�_log + = on_log; + +118 + `�h�ad_mu�x_u�ock +(& +mosq +-> +log_��back_mu�x +); + +119 + } +} + + @lib/connect.c + +17 + ~"c�fig.h +" + +19 + ~<�r�g.h +> + +21 + ~"mosqu�to.h +" + +22 + ~"mosqu�to_����.h +" + +23 + ~"logg�g_mosq.h +" + +24 + ~"mes�ges_mosq.h +" + +25 + ~"mem�y_mosq.h +" + +26 + ~"�ck�_mosq.h +" + +27 + ~"mq�_��oc�.h +" + +28 + ~"�t_mosq.h +" + +29 + ~"�nd_mosq.h +" + +30 + ~"socks_mosq.h +" + +31 + ~"ut�_mosq.h +" + +33 + g�ph�um +[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + +35 +mosqu�to__�c��� +( +mosqu�to + * +mosq +, +bo� + +block�g +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +); + +36 +mosqu�to__c���_�� +( +mosqu�to + * +mosq +, cڡ * +ho� +, +p�t +, +k��live +, cڡ * +b�d_add�ss +); + +39 + $mosqu�to__c���_�� +( +mosqu�to + * +mosq +, cڡ * +ho� +, +p�t +, +k��live +, cڡ * +b�d_add�ss +) + +41 +i +; + +42 +rc +; + +44 if(! +mosq +� +MOSQ_ERR_INVAL +; + +45 if(! +ho� + || +p�t + <�0� +MOSQ_ERR_INVAL +; + +47 if( +mosq +-> +id + =� +NULL + && (mosq-> +��oc� + =� +mosq_p_mq�31 + || mosq->��oc� =� +mosq_p_mq�311 +)){ + +48 +mosq +-> +id + = (*) + `mosqu�to__��oc +(24, ()); + +49 if(! +mosq +-> +id +){ + +50 +MOSQ_ERR_NOMEM +; + +52 +mosq +-> +id +[0] = 'm'; + +53 +mosq +-> +id +[1] = 'o'; + +54 +mosq +-> +id +[2] = 's'; + +55 +mosq +-> +id +[3] = 'q'; + +56 +mosq +-> +id +[4] = '/'; + +58 +rc + = + `ut�__�ndom_by�s +(& +mosq +-> +id +[5], 18); + +59 if( +rc +) �c; + +61 +i +=5; i<23; i++){ + +62 +mosq +-> +id +[ +i +] = +�ph�um +[(mosq->id[i]&0x7F)%((alphanum)-1)]; + +66 + `mosqu�to__� +( +mosq +-> +ho� +); + +67 +mosq +-> +ho� + = + `mosqu�to__�rdup +(host); + +68 if(! +mosq +-> +ho� +� +MOSQ_ERR_NOMEM +; + +69 +mosq +-> +p�t + =�ort; + +71 + `mosqu�to__� +( +mosq +-> +b�d_add�ss +); + +72 if( +b�d_add�ss +){ + +73 +mosq +-> +b�d_add�ss + = + `mosqu�to__�rdup +(bind_address); + +74 if(! +mosq +-> +b�d_add�ss +� +MOSQ_ERR_NOMEM +; + +77 +mosq +-> +k��live + = keepalive; + +78 +mosq +-> +msgs_� +. +��ight_qu�a + = mosq->msgs_�. +��ight_maximum +; + +79 +mosq +-> +msgs_out +. +��ight_qu�a + = mosq->msgs_out. +��ight_maximum +; + +81 if( +mosq +-> +sock��R + !� +INVALID_SOCKET +){ + +82 + `COMPAT_CLOSE +( +mosq +-> +sock��R +); + +83 +mosq +-> +sock��R + = +INVALID_SOCKET +; + +85 if( +mosq +-> +sock��W + !� +INVALID_SOCKET +){ + +86 + `COMPAT_CLOSE +( +mosq +-> +sock��W +); + +87 +mosq +-> +sock��W + = +INVALID_SOCKET +; + +90 if( + `�t__sock��� +(& +mosq +-> +sock��R +, &mosq-> +sock��W +)){ + +91 + `log__��tf +( +mosq +, +MOSQ_LOG_WARNING +, + +95 +MOSQ_ERR_SUCCESS +; + +96 + } +} + +99 + $mosqu�to_c��� +( +mosqu�to + * +mosq +, cڡ * +ho� +, +p�t +, +k��live +) + +101 + `mosqu�to_c���_b�d +( +mosq +, +ho� +, +p�t +, +k��live +, +NULL +); + +102 + } +} + +105 + $mosqu�to_c���_b�d +( +mosqu�to + * +mosq +, cڡ * +ho� +, +p�t +, +k��live +, cڡ * +b�d_add�ss +) + +107 + `mosqu�to_c���_b�d_v5 +( +mosq +, +ho� +, +p�t +, +k��live +, +b�d_add�ss +, +NULL +); + +108 + } +} + +110 + $mosqu�to_c���_b�d_v5 +( +mosqu�to + * +mosq +, cڡ * +ho� +, +p�t +, +k��live +, cڡ * +b�d_add�ss +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +112 +rc +; + +114 if( +�ݔt�s +){ + +115 +rc + = + `mosqu�to_�ݔty_check_�l +( +CMD_CONNECT +, +�ݔt�s +); + +116 if( +rc +) �c; + +119 +rc + = + `mosqu�to__c���_�� +( +mosq +, +ho� +, +p�t +, +k��live +, +b�d_add�ss +); + +120 if( +rc +) �c; + +122 + `�h�ad_mu�x_lock +(& +mosq +-> +��e_mu�x +); + +123 +mosq +-> +��e + = +mosq_cs_�w +; + +124 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��e_mu�x +); + +126 + `mosqu�to__�c��� +( +mosq +, +�ue +, +�ݔt�s +); + +127 + } +} + +130 + $mosqu�to_c���_async +( +mosqu�to + * +mosq +, cڡ * +ho� +, +p�t +, +k��live +) + +132 + `mosqu�to_c���_b�d_async +( +mosq +, +ho� +, +p�t +, +k��live +, +NULL +); + +133 + } +} + +136 + $mosqu�to_c���_b�d_async +( +mosqu�to + * +mosq +, cڡ * +ho� +, +p�t +, +k��live +, cڡ * +b�d_add�ss +) + +138 +rc + = + `mosqu�to__c���_�� +( +mosq +, +ho� +, +p�t +, +k��live +, +b�d_add�ss +); + +139 if( +rc +) �c; + +141 + `�h�ad_mu�x_lock +(& +mosq +-> +��e_mu�x +); + +142 +mosq +-> +��e + = +mosq_cs_c���_async +; + +143 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��e_mu�x +); + +145 + `mosqu�to__�c��� +( +mosq +, +�l� +, +NULL +); + +146 + } +} + +149 + $mosqu�to_�c���_async +( +mosqu�to + * +mosq +) + +151 + `mosqu�to__�c��� +( +mosq +, +�l� +, +NULL +); + +152 + } +} + +155 + $mosqu�to_�c��� +( +mosqu�to + * +mosq +) + +157 + `mosqu�to__�c��� +( +mosq +, +�ue +, +NULL +); + +158 + } +} + +161 + $mosqu�to__�c��� +( +mosqu�to + * +mosq +, +bo� + +block�g +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +163 cڡ +mosqu�to_�ݔty + * +outgo�g_�ݔt�s + = +NULL +; + +164 +mosqu�to_�ݔty + +lo�l_�ݔty +; + +165 +rc +; + +166 +mosqu�to__�ck� + * +�ck� +; + +167 if(! +mosq +� +MOSQ_ERR_INVAL +; + +168 if(! +mosq +-> +ho� + || mosq-> +p�t + <�0� +MOSQ_ERR_INVAL +; + +169 if( +mosq +-> +��oc� + !� +mosq_p_mq�5 + && +�ݔt�s +� +MOSQ_ERR_NOT_SUPPORTED +; + +171 if( +�ݔt�s +){ + +172 if( +�ݔt�s +-> +���_g���ed +){ + +173 +outgo�g_�ݔt�s + = +�ݔt�s +; + +175 + `mem�y +(& +lo�l_�ݔty +, +�ݔt�s +, ( +mosqu�to_�ݔty +)); + +176 +lo�l_�ݔty +. +���_g���ed + = +�ue +; + +177 +lo�l_�ݔty +. +�xt + = +NULL +; + +178 +outgo�g_�ݔt�s + = & +lo�l_�ݔty +; + +180 +rc + = + `mosqu�to_�ݔty_check_�l +( +CMD_CONNECT +, +outgo�g_�ݔt�s +); + +181 if( +rc +) �c; + +184 + `�h�ad_mu�x_lock +(& +mosq +-> +��e_mu�x +); + +185 #ifde� +WITH_SOCKS + + +186 if( +mosq +-> +socks5_ho� +){ + +187 +mosq +-> +��e + = +mosq_cs_socks5_�w +; + +191 +mosq +-> +��e + = +mosq_cs_�w +; + +193 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��e_mu�x +); + +195 + `�h�ad_mu�x_lock +(& +mosq +-> +msgtime_mu�x +); + +196 +mosq +-> +ϡ_msg_� + = + `mosqu�to_time +(); + +197 +mosq +-> +�xt_msg_out + = mosq-> +ϡ_msg_� + + mosq-> +k��live +; + +198 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgtime_mu�x +); + +200 +mosq +-> +p�g_t + = 0; + +202 + `�ck�__��nup +(& +mosq +-> +�_�ck� +); + +204 + `�h�ad_mu�x_lock +(& +mosq +-> +cu��t_out_�ck�_mu�x +); + +205 + `�h�ad_mu�x_lock +(& +mosq +-> +out_�ck�_mu�x +); + +207 if( +mosq +-> +out_�ck� + && !mosq-> +cu��t_out_�ck� +){ + +208 +mosq +-> +cu��t_out_�ck� + = mosq-> +out_�ck� +; + +209 +mosq +-> +out_�ck� + = mosq->out_�ck�-> +�xt +; + +212 +mosq +-> +cu��t_out_�ck� +){ + +213 +�ck� + = +mosq +-> +cu��t_out_�ck� +; + +215 +mosq +-> +cu��t_out_�ck� + = mosq-> +out_�ck� +; + +216 if( +mosq +-> +out_�ck� +){ + +217 +mosq +-> +out_�ck� + = mosq->out_�ck�-> +�xt +; + +220 + `�ck�__��nup +( +�ck� +); + +221 + `mosqu�to__� +( +�ck� +); + +223 + `�h�ad_mu�x_u�ock +(& +mosq +-> +out_�ck�_mu�x +); + +224 + `�h�ad_mu�x_u�ock +(& +mosq +-> +cu��t_out_�ck�_mu�x +); + +226 + `mes�ge__�c���_��t +( +mosq +); + +228 if( +mosq +-> +sock + !� +INVALID_SOCKET +){ + +229 + `�t__sock�_�o� +( +mosq +); + +232 #ifde� +WITH_SOCKS + + +233 if( +mosq +-> +socks5_ho� +){ + +234 +rc + = + `�t__sock�_c��� +( +mosq +, mosq-> +socks5_ho� +, mosq-> +socks5_p�t +, mosq-> +b�d_add�ss +, +block�g +); + +238 + `�h�ad_mu�x_lock +(& +mosq +-> +��e_mu�x +); + +239 +mosq +-> +��e + = +mosq_cs_c����g +; + +240 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��e_mu�x +); + +241 +rc + = + `�t__sock�_c��� +( +mosq +, mosq-> +ho� +, mosq-> +p�t +, mosq-> +b�d_add�ss +, +block�g +); + +243 if( +rc +>0){ + +244 +rc +; + +247 #ifde� +WITH_SOCKS + + +248 if( +mosq +-> +socks5_ho� +){ + +249 + `socks5__�nd +( +mosq +); + +253 + `�nd__c��� +( +mosq +, mosq-> +k��live +, mosq-> +��n_��t +, +outgo�g_�ݔt�s +); + +255 + } +} + +258 + $mosqu�to_disc��� +( +mosqu�to + * +mosq +) + +260 + `mosqu�to_disc���_v5 +( +mosq +, 0, +NULL +); + +261 + } +} + +263 + $mosqu�to_disc���_v5 +( +mosqu�to + * +mosq +, +�as�_code +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +265 cڡ +mosqu�to_�ݔty + * +outgo�g_�ݔt�s + = +NULL +; + +266 +mosqu�to_�ݔty + +lo�l_�ݔty +; + +267 +rc +; + +268 if(! +mosq +� +MOSQ_ERR_INVAL +; + +269 if( +mosq +-> +��oc� + !� +mosq_p_mq�5 + && +�ݔt�s +� +MOSQ_ERR_NOT_SUPPORTED +; + +271 if( +�ݔt�s +){ + +272 if( +�ݔt�s +-> +���_g���ed +){ + +273 +outgo�g_�ݔt�s + = +�ݔt�s +; + +275 + `mem�y +(& +lo�l_�ݔty +, +�ݔt�s +, ( +mosqu�to_�ݔty +)); + +276 +lo�l_�ݔty +. +���_g���ed + = +�ue +; + +277 +lo�l_�ݔty +. +�xt + = +NULL +; + +278 +outgo�g_�ݔt�s + = & +lo�l_�ݔty +; + +280 +rc + = + `mosqu�to_�ݔty_check_�l +( +CMD_DISCONNECT +, +outgo�g_�ݔt�s +); + +281 if( +rc +) �c; + +284 + `�h�ad_mu�x_lock +(& +mosq +-> +��e_mu�x +); + +285 +mosq +-> +��e + = +mosq_cs_disc����g +; + +286 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��e_mu�x +); + +288 if( +mosq +-> +sock + =� +INVALID_SOCKET +� +MOSQ_ERR_NO_CONN +; + +289 + `�nd__disc��� +( +mosq +, +�as�_code +, +outgo�g_�ݔt�s +); + +290 + } +} + +293 + $do_���_disc��� +( +mosqu�to + * +mosq +, +�as�_code +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +295 + `�h�ad_mu�x_lock +(& +mosq +-> +��e_mu�x +); + +296 +mosq +-> +��e + = +mosq_cs_disc����g +; + +297 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��e_mu�x +); + +299 + `�t__sock�_�o� +( +mosq +); + +302 + `�h�ad_mu�x_lock +(& +mosq +-> +out_�ck�_mu�x +); + +303 +mosq +-> +cu��t_out_�ck� + = mosq-> +out_�ck� +; + +304 if( +mosq +-> +out_�ck� +){ + +305 +mosq +-> +out_�ck� + = mosq->out_�ck�-> +�xt +; + +306 if(! +mosq +-> +out_�ck� +){ + +307 +mosq +-> +out_�ck�_ϡ + = +NULL +; + +310 + `�h�ad_mu�x_u�ock +(& +mosq +-> +out_�ck�_mu�x +); + +312 + `�h�ad_mu�x_lock +(& +mosq +-> +msgtime_mu�x +); + +313 +mosq +-> +�xt_msg_out + = + `mosqu�to_time +(�+ mosq-> +k��live +; + +314 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgtime_mu�x +); + +316 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +317 if( +mosq +-> +�_disc��� +){ + +318 +mosq +-> +�_��back + = +�ue +; + +319 +mosq +-> + `�_disc��� +(mosq, mosq-> +u�rd�a +, +�as�_code +); + +320 +mosq +-> +�_��back + = +�l� +; + +322 if( +mosq +-> +�_disc���_v5 +){ + +323 +mosq +-> +�_��back + = +�ue +; + +324 +mosq +-> + `�_disc���_v5 +(mosq, mosq-> +u�rd�a +, +�as�_code +, +�ݔt�s +); + +325 +mosq +-> +�_��back + = +�l� +; + +327 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +328 + `�h�ad_mu�x_u�ock +(& +mosq +-> +cu��t_out_�ck�_mu�x +); + +329 + } +} + + @lib/cpp/mosquittopp.cpp + +17 + ~<c�dlib +> + +18 + ~<mosqu�to.h +> + +19 + ~<mosqu�t�p.h +> + +21 + #UNUSED +( +A +�()(A) + + ) + +23 +�me�a� + + gmosq� + { + +25 +�_c���_w��� +( +mosqu�to + * +mosq +, * +u�rd�a +, +rc +) + +27 +�ass + +mosqu�t�p + * + gm + = (�as�mosqu�tݰ*) +u�rd�a +; + +29 +UNUSED +( +mosq +); + +31 + gm +-> +�_c��� +( +rc +); + +34 +�_c���_w�h_�ags_w��� +( +mosqu�to + * +mosq +, * +u�rd�a +, +rc +, +�ags +) + +36 +�ass + +mosqu�t�p + * + gm + = (�as�mosqu�tݰ*) +u�rd�a +; + +37 +UNUSED +( +mosq +); + +38 + gm +-> +�_c���_w�h_�ags +( +rc +, +�ags +); + +41 +�_disc���_w��� +( +mosqu�to + * +mosq +, * +u�rd�a +, +rc +) + +43 +�ass + +mosqu�t�p + * + gm + = (�as�mosqu�tݰ*) +u�rd�a +; + +44 +UNUSED +( +mosq +); + +45 + gm +-> +�_disc��� +( +rc +); + +48 +�_publish_w��� +( +mosqu�to + * +mosq +, * +u�rd�a +, +mid +) + +50 +�ass + +mosqu�t�p + * + gm + = (�as�mosqu�tݰ*) +u�rd�a +; + +51 +UNUSED +( +mosq +); + +52 + gm +-> +�_publish +( +mid +); + +55 +�_mes�ge_w��� +( +mosqu�to + * +mosq +, * +u�rd�a +, cڡ +mosqu�to_mes�ge + * +mes�ge +) + +57 +�ass + +mosqu�t�p + * + gm + = (�as�mosqu�tݰ*) +u�rd�a +; + +58 +UNUSED +( +mosq +); + +59 + gm +-> +�_mes�ge +( +mes�ge +); + +62 +�_subs�ibe_w��� +( +mosqu�to + * +mosq +, * +u�rd�a +, +mid +, +qos_cou� +, cڡ * +g��ed_qos +) + +64 +�ass + +mosqu�t�p + * + gm + = (�as�mosqu�tݰ*) +u�rd�a +; + +65 +UNUSED +( +mosq +); + +66 + gm +-> +�_subs�ibe +( +mid +, +qos_cou� +, +g��ed_qos +); + +69 +�_unsubs�ibe_w��� +( +mosqu�to + * +mosq +, * +u�rd�a +, +mid +) + +71 +�ass + +mosqu�t�p + * + gm + = (�as�mosqu�tݰ*) +u�rd�a +; + +72 +UNUSED +( +mosq +); + +73 + gm +-> +�_unsubs�ibe +( +mid +); + +77 +�_log_w��� +( +mosqu�to + * +mosq +, * +u�rd�a +, +�v� +, cڡ * +�r +) + +79 +�ass + +mosqu�t�p + * + gm + = (�as�mosqu�tݰ*) +u�rd�a +; + +80 +UNUSED +( +mosq +); + +81 + gm +-> +�_log +( +�v� +, +�r +); + +84 +lib_v�si� +(* +maj� +, * +m�� +, * +�visi� +) + +86 if( + gmaj� +�*maj� = +LIBMOSQUITTO_MAJOR +; + +87 if( + gm�� +�*m�� = +LIBMOSQUITTO_MINOR +; + +88 if( + g�visi� +�*�visi� = +LIBMOSQUITTO_REVISION +; + +89 + gLIBMOSQUITTO_VERSION_NUMBER +; + +92 +lib_�� +() + +94 +mosqu�to_lib_�� +(); + +97 +lib_��nup +() + +99 +mosqu�to_lib_��nup +(); + +102 cڡ * +���� +( +mosq_��o +) + +104 +mosqu�to_���� +( +mosq_��o +); + +107 cڡ * +c��ck_�r�g +( +c��ck_code +) + +109 +mosqu�to_c��ck_�r�g +( +c��ck_code +); + +112 +sub_t�ic_tok�i� +(cڡ * +subt�ic +, *** +t�ics +, * +cou� +) + +114 +mosqu�to_sub_t�ic_tok�i� +( +subt�ic +, +t�ics +, +cou� +); + +117 +sub_t�ic_tok�s_� +(*** +t�ics +, +cou� +) + +119 +mosqu�to_sub_t�ic_tok�s_� +( +t�ics +, +cou� +); + +122 +t�ic_m�ches_sub +(cڡ * +sub +, cڡ * +t�ic +, +bo� + * +�su� +) + +124 +mosqu�to_t�ic_m�ches_sub +( +sub +, +t�ic +, +�su� +); + +127 +v�id�e_utf8 +(cڡ * +�r +, +�n +) + +129 +mosqu�to_v�id�e_utf8 +( +�r +, +�n +); + +132 +subs�ibe_sim�e +( + +133 +mosqu�to_mes�ge + ** +mes�ges +, + +134 +msg_cou� +, + +135 +bo� + +���ed +, + +136 cڡ * +t�ic +, + +137 +qos +, + +138 cڡ * +ho� +, + +139 +p�t +, + +140 cڡ * +���_id +, + +141 +k��live +, + +142 +bo� + +��n_�ssi� +, + +143 cڡ * +u��ame +, + +144 cڡ * +�ssw�d +, + +145 cڡ +libmosqu�to_w�l + * +w�l +, + +146 cڡ +libmosqu�to_�s + * +�s +) + +148 +mosqu�to_subs�ibe_sim�e +( + +149 +mes�ges +, +msg_cou� +, +���ed +, + +150 +t�ic +, +qos +, + +151 +ho� +, +p�t +, +���_id +, +k��live +, +��n_�ssi� +, + +152 +u��ame +, +�ssw�d +, + +153 +w�l +, +�s +); + +156 +mosq�_EXPORT + +subs�ibe_��back +( + +157 (* +��back +)( +mosqu�to + *, *, cڡ +mosqu�to_mes�ge + *), + +158 * +u�rd�a +, + +159 cڡ * +t�ic +, + +160 +qos +, + +161 cڡ * +ho� +, + +162 +p�t +, + +163 cڡ * +���_id +, + +164 +k��live +, + +165 +bo� + +��n_�ssi� +, + +166 cڡ * +u��ame +, + +167 cڡ * +�ssw�d +, + +168 cڡ +libmosqu�to_w�l + * +w�l +, + +169 cڡ +libmosqu�to_�s + * +�s +) + +171 +mosqu�to_subs�ibe_��back +( + +172 +��back +, +u�rd�a +, + +173 +t�ic +, +qos +, + +174 +ho� +, +p�t +, +���_id +, +k��live +, +��n_�ssi� +, + +175 +u��ame +, +�ssw�d +, + +176 +w�l +, +�s +); + +180 + gmosqu�t�p +:: +mosqu�t�p +(cڡ * +id +, +bo� + +��n_�ssi� +) + +182 + gm_mosq + = +mosqu�to_�w +( +id +, +��n_�ssi� +, +this +); + +183 +mosqu�to_c���_��back_�t +( +m_mosq +, +�_c���_w��� +); + +184 +mosqu�to_c���_w�h_�ags_��back_�t +( +m_mosq +, +�_c���_w�h_�ags_w��� +); + +185 +mosqu�to_disc���_��back_�t +( +m_mosq +, +�_disc���_w��� +); + +186 +mosqu�to_publish_��back_�t +( +m_mosq +, +�_publish_w��� +); + +187 +mosqu�to_mes�ge_��back_�t +( +m_mosq +, +�_mes�ge_w��� +); + +188 +mosqu�to_subs�ibe_��back_�t +( +m_mosq +, +�_subs�ibe_w��� +); + +189 +mosqu�to_unsubs�ibe_��back_�t +( +m_mosq +, +�_unsubs�ibe_w��� +); + +190 +mosqu�to_log_��back_�t +( +m_mosq +, +�_log_w��� +); + +193 + gmosqu�t�p +::~ +mosqu�t�p +() + +195 +mosqu�to_de�roy +( +m_mosq +); + +198 + gmosqu�t�p +:: +����li� +(cڡ * +id +, +bo� + +��n_�ssi� +) + +200 + grc +; + +201 + grc + = +mosqu�to_����li� +( +m_mosq +, +id +, +��n_�ssi� +, +this +); + +202 if( + grc + =� +MOSQ_ERR_SUCCESS +){ + +203 +mosqu�to_c���_��back_�t +( +m_mosq +, +�_c���_w��� +); + +204 +mosqu�to_c���_w�h_�ags_��back_�t +( +m_mosq +, +�_c���_w�h_�ags_w��� +); + +205 +mosqu�to_disc���_��back_�t +( +m_mosq +, +�_disc���_w��� +); + +206 +mosqu�to_publish_��back_�t +( +m_mosq +, +�_publish_w��� +); + +207 +mosqu�to_mes�ge_��back_�t +( +m_mosq +, +�_mes�ge_w��� +); + +208 +mosqu�to_subs�ibe_��back_�t +( +m_mosq +, +�_subs�ibe_w��� +); + +209 +mosqu�to_unsubs�ibe_��back_�t +( +m_mosq +, +�_unsubs�ibe_w��� +); + +210 +mosqu�to_log_��back_�t +( +m_mosq +, +�_log_w��� +); + +212 + grc +; + +215 + gmosqu�t�p +:: +c��� +(cڡ * +ho� +, +p�t +, +k��live +) + +217 +mosqu�to_c��� +( +m_mosq +, +ho� +, +p�t +, +k��live +); + +220 + gmosqu�t�p +:: +c��� +(cڡ * +ho� +, +p�t +, +k��live +, cڡ * +b�d_add�ss +) + +222 +mosqu�to_c���_b�d +( +m_mosq +, +ho� +, +p�t +, +k��live +, +b�d_add�ss +); + +225 + gmosqu�t�p +:: +c���_async +(cڡ * +ho� +, +p�t +, +k��live +) + +227 +mosqu�to_c���_async +( +m_mosq +, +ho� +, +p�t +, +k��live +); + +230 + gmosqu�t�p +:: +c���_async +(cڡ * +ho� +, +p�t +, +k��live +, cڡ * +b�d_add�ss +) + +232 +mosqu�to_c���_b�d_async +( +m_mosq +, +ho� +, +p�t +, +k��live +, +b�d_add�ss +); + +235 + gmosqu�t�p +:: +�c��� +() + +237 +mosqu�to_�c��� +( +m_mosq +); + +240 + gmosqu�t�p +:: +�c���_async +() + +242 +mosqu�to_�c���_async +( +m_mosq +); + +245 + gmosqu�t�p +:: +disc��� +() + +247 +mosqu�to_disc��� +( +m_mosq +); + +250 + gmosqu�t�p +:: +sock� +() + +252 +mosqu�to_sock� +( +m_mosq +); + +255 + gmosqu�t�p +:: +w�l_�t +(cڡ * +t�ic +, +�yl�d�n +, cڡ * +�yl�d +, +qos +, +bo� + +��� +) + +257 +mosqu�to_w�l_�t +( +m_mosq +, +t�ic +, +�yl�d�n +, +�yl�d +, +qos +, +��� +); + +260 + gmosqu�t�p +:: +w�l_��r +() + +262 +mosqu�to_w�l_��r +( +m_mosq +); + +265 + gmosqu�t�p +:: +u��ame_pw_�t +(cڡ * +u��ame +, cڡ * +�ssw�d +) + +267 +mosqu�to_u��ame_pw_�t +( +m_mosq +, +u��ame +, +�ssw�d +); + +270 + gmosqu�t�p +:: +publish +(* +mid +, cڡ * +t�ic +, +�yl�d�n +, cڡ * +�yl�d +, +qos +, +bo� + +��� +) + +272 +mosqu�to_publish +( +m_mosq +, +mid +, +t�ic +, +�yl�d�n +, +�yl�d +, +qos +, +��� +); + +275 + gmosqu�t�p +:: +�c���_d�ay_�t +( +�c���_d�ay +, +�c���_d�ay_max +, +bo� + +�c���_expڒt�l_backoff +) + +277 +mosqu�to_�c���_d�ay_�t +( +m_mosq +, +�c���_d�ay +, +�c���_d�ay_max +, +�c���_expڒt�l_backoff +); + +280 + gmosqu�t�p +:: +max_��ight_mes�ges_�t +( +max_��ight_mes�ges +) + +282 +mosqu�to_max_��ight_mes�ges_�t +( +m_mosq +, +max_��ight_mes�ges +); + +285 + gmosqu�t�p +:: +mes�ge_��y_�t +( +mes�ge_��y +) + +287 +mosqu�to_mes�ge_��y_�t +( +m_mosq +, +mes�ge_��y +); + +290 + gmosqu�t�p +:: +subs�ibe +(* +mid +, cڡ * +sub +, +qos +) + +292 +mosqu�to_subs�ibe +( +m_mosq +, +mid +, +sub +, +qos +); + +295 + gmosqu�t�p +:: +unsubs�ibe +(* +mid +, cڡ * +sub +) + +297 +mosqu�to_unsubs�ibe +( +m_mosq +, +mid +, +sub +); + +300 + gmosqu�t�p +:: +lo� +( +timeout +, +max_�ck�s +) + +302 +mosqu�to_lo� +( +m_mosq +, +timeout +, +max_�ck�s +); + +305 + gmosqu�t�p +:: +lo�_misc +() + +307 +mosqu�to_lo�_misc +( +m_mosq +); + +310 + gmosqu�t�p +:: +lo�_�ad +( +max_�ck�s +) + +312 +mosqu�to_lo�_�ad +( +m_mosq +, +max_�ck�s +); + +315 + gmosqu�t�p +:: +lo�_wr�e +( +max_�ck�s +) + +317 +mosqu�to_lo�_wr�e +( +m_mosq +, +max_�ck�s +); + +320 + gmosqu�t�p +:: +lo�_f�ev� +( +timeout +, +max_�ck�s +) + +322 +mosqu�to_lo�_f�ev� +( +m_mosq +, +timeout +, +max_�ck�s +); + +325 + gmosqu�t�p +:: +lo�_��t +() + +327 +mosqu�to_lo�_��t +( +m_mosq +); + +330 + gmosqu�t�p +:: +lo�_�� +( +bo� + +f�� +) + +332 +mosqu�to_lo�_�� +( +m_mosq +, +f�� +); + +335 +bo� + + gmosqu�t�p +:: +w�t_wr�e +() + +337 +mosqu�to_w�t_wr�e +( +m_mosq +); + +340 + gmosqu�t�p +:: +�ts_�t +( +mosq_�t_t + +�ti� +, * +v�ue +) + +342 +mosqu�to_�ts_�t +( +m_mosq +, +�ti� +, +v�ue +); + +345 + gmosqu�t�p +:: +th�aded_�t +( +bo� + +th�aded +) + +347 +mosqu�to_th�aded_�t +( +m_mosq +, +th�aded +); + +350 + gmosqu�t�p +:: +u�r_d�a_�t +(* +u�rd�a +) + +352 +mosqu�to_u�r_d�a_�t +( +m_mosq +, +u�rd�a +); + +355 + gmosqu�t�p +:: +socks5_�t +(cڡ * +ho� +, +p�t +, cڡ * +u��ame +, cڡ * +�ssw�d +) + +357 +mosqu�to_socks5_�t +( +m_mosq +, +ho� +, +p�t +, +u��ame +, +�ssw�d +); + +361 + gmosqu�t�p +:: +�s_�t +(cڡ * +�f�e +, cڡ * +��th +, cڡ * +��f�e +, cڡ * +keyf�e +, (* +pw_��back +)(* +buf +, +size +, +rw�ag +, * +u�rd�a +)) + +363 +mosqu�to_�s_�t +( +m_mosq +, +�f�e +, +��th +, +��f�e +, +keyf�e +, +pw_��back +); + +366 + gmosqu�t�p +:: +�s_�ts_�t +( +��_�qs +, cڡ * +�s_v�si� +, cڡ * +c�h�s +) + +368 +mosqu�to_�s_�ts_�t +( +m_mosq +, +��_�qs +, +�s_v�si� +, +c�h�s +); + +371 + gmosqu�t�p +:: +�s_��cu�_�t +( +bo� + +v�ue +) + +373 +mosqu�to_�s_��cu�_�t +( +m_mosq +, +v�ue +); + +376 + gmosqu�t�p +:: +�s_psk_�t +(cڡ * +psk +, cڡ * +id�t�y +, cڡ * +c�h�s +) + +378 +mosqu�to_�s_psk_�t +( +m_mosq +, +psk +, +id�t�y +, +c�h�s +); + + @lib/cpp/mosquittopp.h + +17 #i�de� +MOSQUITTOPP_H + + +18 + #MOSQUITTOPP_H + + + ) + +20 #ifde� +_WIN32 + + +21 #ifde� +mosqu�t�p_EXPORTS + + +22 + #mosq�_EXPORT + + `__de��ec +( +d�exp�t +) + + ) + +24 + #mosq�_EXPORT + + `__de��ec +( +d�imp�t +) + + ) + +27 + #mosq�_EXPORT + + + ) + +30 #i� +def�ed +( +__GNUC__ +�|| def�ed( +__��g__ +) + +31 + #DEPRECATED + + `__��ibu�__ + (( +d����d +)) + + ) + +33 + #DEPRECATED + + + ) + +36 + ~<c�dlib +> + +37 + ~<mosqu�to.h +> + +38 + ~<time.h +> + +40 +�me�a� + + gmosq� + { + +43 +mosq�_EXPORT + cڡ * +DEPRECATED + +���� +( +mosq_��o +); + +44 +mosq�_EXPORT + cڡ * +DEPRECATED + +c��ck_�r�g +( +c��ck_code +); + +45 +mosq�_EXPORT + +DEPRECATED + +sub_t�ic_tok�i� +(cڡ * +subt�ic +, *** +t�ics +, * +cou� +); + +46 +mosq�_EXPORT + +DEPRECATED + +sub_t�ic_tok�s_� +(*** +t�ics +, +cou� +); + +47 +mosq�_EXPORT + +DEPRECATED + +lib_v�si� +(* +maj� +, * +m�� +, * +�visi� +); + +48 +mosq�_EXPORT + +DEPRECATED + +lib_�� +(); + +49 +mosq�_EXPORT + +DEPRECATED + +lib_��nup +(); + +50 +mosq�_EXPORT + +DEPRECATED + +t�ic_m�ches_sub +(cڡ * +sub +, cڡ * +t�ic +, +bo� + * +�su� +); + +51 +mosq�_EXPORT + +DEPRECATED + +v�id�e_utf8 +(cڡ * +�r +, +�n +); + +52 +mosq�_EXPORT + +DEPRECATED + +subs�ibe_sim�e +( + +53 +mosqu�to_mes�ge + ** +mes�ges +, + +54 +msg_cou� +, + +55 +bo� + +���ed +, + +56 cڡ * +t�ic +, + +57 +qos +=0, + +58 cڡ * +ho� +="localhost", + +59 +p�t +=1883, + +60 cڡ * +���_id += +NULL +, + +61 +k��live +=60, + +62 +bo� + +��n_�ssi� += +�ue +, + +63 cڡ * +u��ame += +NULL +, + +64 cڡ * +�ssw�d += +NULL +, + +65 cڡ +libmosqu�to_w�l + * +w�l += +NULL +, + +66 cڡ +libmosqu�to_�s + * +�s += +NULL +); + +68 +mosq�_EXPORT + +DEPRECATED + +subs�ibe_��back +( + +69 (* +��back +)( +mosqu�to + *, *, cڡ +mosqu�to_mes�ge + *), + +70 * +u�rd�a +, + +71 cڡ * +t�ic +, + +72 +qos +=0, + +73 +bo� + +���ed += +�ue +, + +74 cڡ * +ho� +="localhost", + +75 +p�t +=1883, + +76 cڡ * +���_id += +NULL +, + +77 +k��live +=60, + +78 +bo� + +��n_�ssi� += +�ue +, + +79 cڡ * +u��ame += +NULL +, + +80 cڡ * +�ssw�d += +NULL +, + +81 cڡ +libmosqu�to_w�l + * +w�l += +NULL +, + +82 cڡ +libmosqu�to_�s + * +�s += +NULL +); + +90 �as� + cmosq�_EXPORT + +DEPRECATED + + gmosqu�t�p + { + +91 + g�iv�e +: + +92 +mosqu�to + * +m_mosq +; + +93 + gpublic +: + +94 +DEPRECATED + +mosqu�t�p +(cڡ * +id += +NULL +, +bo� + +��n_�ssi� += +�ue +); + +95 + gv�tu� + ~ +mosqu�t�p +(); + +97 +DEPRECATED + +����li� +(cڡ * +id +, +bo� + +��n_�ssi� +); + +98 +DEPRECATED + +sock� +(); + +99 +DEPRECATED + +w�l_�t +(cڡ * +t�ic +, +�yl�d�n +=0, cڡ * +�yl�d += +NULL +, +qos +=0, +bo� + +��� += +�l� +); + +100 +DEPRECATED + +w�l_��r +(); + +101 +DEPRECATED + +u��ame_pw_�t +(cڡ * +u��ame +, cڡ * +�ssw�d += +NULL +); + +102 +DEPRECATED + +c��� +(cڡ * +ho� +, +p�t +=1883, +k��live +=60); + +103 +DEPRECATED + +c���_async +(cڡ * +ho� +, +p�t +=1883, +k��live +=60); + +104 +DEPRECATED + +c��� +(cڡ * +ho� +, +p�t +, +k��live +, cڡ * +b�d_add�ss +); + +105 +DEPRECATED + +c���_async +(cڡ * +ho� +, +p�t +, +k��live +, cڡ * +b�d_add�ss +); + +106 +DEPRECATED + +�c��� +(); + +107 +DEPRECATED + +�c���_async +(); + +108 +DEPRECATED + +disc��� +(); + +109 +DEPRECATED + +publish +(* +mid +, cڡ * +t�ic +, +�yl�d�n +=0, cڡ * +�yl�d += +NULL +, +qos +=0, +bo� + +��� += +�l� +); + +110 +DEPRECATED + +subs�ibe +(* +mid +, cڡ * +sub +, +qos +=0); + +111 +DEPRECATED + +unsubs�ibe +(* +mid +, cڡ * +sub +); + +112 +DEPRECATED + +�c���_d�ay_�t +( +�c���_d�ay +, +�c���_d�ay_max +, +bo� + +�c���_expڒt�l_backoff +); + +113 +DEPRECATED + +max_��ight_mes�ges_�t +( +max_��ight_mes�ges +); + +114 +DEPRECATED + +mes�ge_��y_�t +( +mes�ge_��y +); + +115 +DEPRECATED + +u�r_d�a_�t +(* +u�rd�a +); + +116 +DEPRECATED + +�s_�t +(cڡ * +�f�e +, cڡ * +��th += +NULL +, cڡ * +��f�e +=NULL, cڡ * +keyf�e +=NULL, (* +pw_��back +)(* +buf +, +size +, +rw�ag +, * +u�rd�a +)=NULL); + +117 +DEPRECATED + +�s_�ts_�t +( +��_�qs +, cڡ * +�s_v�si� += +NULL +, cڡ * +c�h�s +=NULL); + +118 +DEPRECATED + +�s_��cu�_�t +( +bo� + +v�ue +); + +119 +DEPRECATED + +�s_psk_�t +(cڡ * +psk +, cڡ * +id�t�y +, cڡ * +c�h�s += +NULL +); + +120 +DEPRECATED + +�ts_�t +( +mosq_�t_t + +�ti� +, * +v�ue +); + +122 +DEPRECATED + +lo� +( +timeout +=-1, +max_�ck�s +=1); + +123 +DEPRECATED + +lo�_misc +(); + +124 +DEPRECATED + +lo�_�ad +( +max_�ck�s +=1); + +125 +DEPRECATED + +lo�_wr�e +( +max_�ck�s +=1); + +126 +DEPRECATED + +lo�_f�ev� +( +timeout +=-1, +max_�ck�s +=1); + +127 +DEPRECATED + +lo�_��t +(); + +128 +DEPRECATED + +lo�_�� +( +bo� + +f�� += +�l� +); + +129 +bo� + +DEPRECATED + +w�t_wr�e +(); + +130 +DEPRECATED + +th�aded_�t +( +bo� + +th�aded += +�ue +); + +131 +DEPRECATED + +socks5_�t +(cڡ * +ho� +, +p�t +=1080, cڡ * +u��ame += +NULL +, cڡ * +�ssw�d +=NULL); + +134 +v�tu� + +�_c��� +() {;} + +135 +v�tu� + +�_c���_w�h_�ags +(, ) {;} + +136 +v�tu� + +�_disc��� +() {;} + +137 +v�tu� + +�_publish +() {;} + +138 +v�tu� + +�_mes�ge +(cڡ +mosqu�to_mes�ge + * ) {;} + +139 +v�tu� + +�_subs�ibe +(, , const * ) {;} + +140 +v�tu� + +�_unsubs�ibe +() {;} + +141 +v�tu� + +�_log +(, const * ) {;} + +142 +v�tu� + +�_�r� +() {;} + + @lib/dummypthread.h + +1 #i�de� +DUMMYPTHREAD_H + + +2 + #DUMMYPTHREAD_H + + + ) + +4 + #�h�ad_��� +( +A +, +B +, +C +, +D +) + + ) + +5 + #�h�ad_jo� +( +A +, +B +) + + ) + +6 + #�h�ad_�n�l +( +A +) + + ) + +8 + #�h�ad_mu�x_�� +( +A +, +B +) + + ) + +9 + #�h�ad_mu�x_de�roy +( +A +) + + ) + +10 + #�h�ad_mu�x_lock +( +A +) + + ) + +11 + #�h�ad_mu�x_u�ock +( +A +) + + ) + + @lib/handle_auth.c + +17 + ~"c�fig.h +" + +19 + ~<�dio.h +> + +20 + ~<�r�g.h +> + +22 + ~"logg�g_mosq.h +" + +23 + ~"mosqu�to_����.h +" + +24 + ~"mq�_��oc�.h +" + +25 + ~"�ck�_mosq.h +" + +26 + ~"�ݔty_mosq.h +" + +29 + $h�d�__auth +( +mosqu�to + * +mosq +) + +31 +rc + = 0; + +32 +u�t8_t + +�as�_code +; + +33 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +35 if(! +mosq +� +MOSQ_ERR_INVAL +; + +36 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Cl�� %���ived AUTH", mosq-> +id +); + +38 if( +mosq +-> +��oc� + !� +mosq_p_mq�5 +){ + +39 +MOSQ_ERR_PROTOCOL +; + +42 if( + `�ck�__�ad_by� +(& +mosq +-> +�_�ck� +, & +�as�_code +)) 1; + +44 +rc + = + `�ݔty__�ad_�l +( +CMD_AUTH +, & +mosq +-> +�_�ck� +, & +�ݔt�s +); + +45 if( +rc +) �c; + +46 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +48 +MOSQ_ERR_SUCCESS +; + +49 + } +} + + @lib/handle_connack.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +21 + ~"mosqu�to.h +" + +22 + ~"logg�g_mosq.h +" + +23 + ~"mem�y_mosq.h +" + +24 + ~"mes�ges_mosq.h +" + +25 + ~"mq�_��oc�.h +" + +26 + ~"�t_mosq.h +" + +27 + ~"�ck�_mosq.h +" + +28 + ~"�ݔty_mosq.h +" + +29 + ~"�ad_h�d�.h +" + +31 + $h�d�__c��ck +( +mosqu�to + * +mosq +) + +33 +u�t8_t + +c���_�ags +; + +34 +u�t8_t + +�as�_code +; + +35 +rc +; + +36 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +37 * +���id + = +NULL +; + +39 + `as�� +( +mosq +); + +40 +rc + = + `�ck�__�ad_by� +(& +mosq +-> +�_�ck� +, & +c���_�ags +); + +41 if( +rc +) �c; + +42 +rc + = + `�ck�__�ad_by� +(& +mosq +-> +�_�ck� +, & +�as�_code +); + +43 if( +rc +) �c; + +45 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +46 +rc + = + `�ݔty__�ad_�l +( +CMD_CONNACK +, & +mosq +-> +�_�ck� +, & +�ݔt�s +); + +47 if( +rc +) �c; + +50 + `mosqu�to_�ݔty_�ad_�r�g +( +�ݔt�s +, +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +, & +���id +, +�l� +); + +51 if( +���id +){ + +52 if( +mosq +-> +id +){ + +55 + `� +( +���id +); + +56 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +57 +MOSQ_ERR_PROTOCOL +; + +59 +mosq +-> +id + = +���id +; + +60 +���id + = +NULL +; + +64 + `mosqu�to_�ݔty_�ad_by� +( +�ݔt�s +, +MQTT_PROP_MAXIMUM_QOS +, & +mosq +-> +maximum_qos +, +�l� +); + +65 + `mosqu�to_�ݔty_�ad_�t16 +( +�ݔt�s +, +MQTT_PROP_RECEIVE_MAXIMUM +, & +mosq +-> +msgs_out +. +��ight_maximum +, +�l� +); + +66 + `mosqu�to_�ݔty_�ad_�t16 +( +�ݔt�s +, +MQTT_PROP_SERVER_KEEP_ALIVE +, & +mosq +-> +k��live +, +�l� +); + +67 + `mosqu�to_�ݔty_�ad_�t32 +( +�ݔt�s +, +MQTT_PROP_MAXIMUM_PACKET_SIZE +, & +mosq +-> +maximum_�ck�_size +, +�l� +); + +69 +mosq +-> +msgs_out +. +��ight_qu�a + = mosq->msgs_out. +��ight_maximum +; + +71 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Cl�� %���ived CONNACK (%d)", mosq-> +id +, +�as�_code +); + +72 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +73 if( +mosq +-> +�_c��� +){ + +74 +mosq +-> +�_��back + = +�ue +; + +75 +mosq +-> + `�_c��� +(mosq, mosq-> +u�rd�a +, +�as�_code +); + +76 +mosq +-> +�_��back + = +�l� +; + +78 if( +mosq +-> +�_c���_w�h_�ags +){ + +79 +mosq +-> +�_��back + = +�ue +; + +80 +mosq +-> + `�_c���_w�h_�ags +(mosq, mosq-> +u�rd�a +, +�as�_code +, +c���_�ags +); + +81 +mosq +-> +�_��back + = +�l� +; + +83 if( +mosq +-> +�_c���_v5 +){ + +84 +mosq +-> +�_��back + = +�ue +; + +85 +mosq +-> + `�_c���_v5 +(mosq, mosq-> +u�rd�a +, +�as�_code +, +c���_�ags +, +�ݔt�s +); + +86 +mosq +-> +�_��back + = +�l� +; + +88 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +89 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +91 +�as�_code +){ + +93 + `�h�ad_mu�x_lock +(& +mosq +-> +��e_mu�x +); + +94 if( +mosq +-> +��e + !� +mosq_cs_disc����g +){ + +95 +mosq +-> +��e + = +mosq_cs_c���ed +; + +97 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��e_mu�x +); + +98 + `mes�ge__��y_check +( +mosq +); + +99 +MOSQ_ERR_SUCCESS +; + +105 +MOSQ_ERR_CONN_REFUSED +; + +107 +MOSQ_ERR_PROTOCOL +; + +109 + } +} + + @lib/handle_disconnect.c + +17 + ~"c�fig.h +" + +19 + ~<�dio.h +> + +20 + ~<�r�g.h +> + +22 + ~"logg�g_mosq.h +" + +23 + ~"mq�_��oc�.h +" + +24 + ~"mem�y_mosq.h +" + +25 + ~"�t_mosq.h +" + +26 + ~"�ck�_mosq.h +" + +27 + ~"�ݔty_mosq.h +" + +28 + ~"�nd_mosq.h +" + +29 + ~"ut�_mosq.h +" + +31 + $h�d�__disc��� +( +mosqu�to + * +mosq +) + +33 +rc +; + +34 +u�t8_t + +�as�_code +; + +35 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +37 if(! +mosq +){ + +38 +MOSQ_ERR_INVAL +; + +41 if( +mosq +-> +��oc� + !� +mosq_p_mq�5 +){ + +42 +MOSQ_ERR_PROTOCOL +; + +45 +rc + = + `�ck�__�ad_by� +(& +mosq +-> +�_�ck� +, & +�as�_code +); + +46 if( +rc +) �c; + +48 if( +mosq +-> +�_�ck� +. +�ma��g_�ngth + > 2){ + +49 +rc + = + `�ݔty__�ad_�l +( +CMD_DISCONNECT +, & +mosq +-> +�_�ck� +, & +�ݔt�s +); + +50 if( +rc +) �c; + +51 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +54 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Re�ived DISCONNECT (%d)", +�as�_code +); + +56 + `do_���_disc��� +( +mosq +, +�as�_code +, +�ݔt�s +); + +58 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +60 +MOSQ_ERR_SUCCESS +; + +61 + } +} + + @lib/handle_ping.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<�dio.h +> + +21 + ~<�r�g.h +> + +23 #ifde� +WITH_BROKER + + +24 + ~"mosqu�to_brok�_����.h +" + +27 + ~"mosqu�to.h +" + +28 + ~"logg�g_mosq.h +" + +29 + ~"mem�y_mosq.h +" + +30 + ~"mes�ges_mosq.h +" + +31 + ~"mq�_��oc�.h +" + +32 + ~"�t_mosq.h +" + +33 + ~"�ck�_mosq.h +" + +34 + ~"�ad_h�d�.h +" + +35 + ~"�nd_mosq.h +" + +36 + ~"ut�_mosq.h +" + +38 + $h�d�__p�g�q +( +mosqu�to + * +mosq +) + +40 + `as�� +( +mosq +); + +42 if( +mosq +-> +��e + !� +mosq_cs_c���ed +){ + +43 +MOSQ_ERR_PROTOCOL +; + +46 #ifde� +WITH_BROKER + + +47 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "Re�ived PINGREQ from %s", +mosq +-> +id +); + +49 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Cl�� %���ived PINGREQ", mosq-> +id +); + +51 + `�nd__p�g�� +( +mosq +); + +52 + } +} + +54 + $h�d�__p�g�� +( +mosqu�to + * +mosq +) + +56 + `as�� +( +mosq +); + +58 if( +mosq +-> +��e + !� +mosq_cs_c���ed +){ + +59 +MOSQ_ERR_PROTOCOL +; + +62 +mosq +-> +p�g_t + = 0; + +63 #ifde� +WITH_BROKER + + +64 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "Re�ived PINGRESP from %s", +mosq +-> +id +); + +66 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Cl�� %���ived PINGRESP", mosq-> +id +); + +68 +MOSQ_ERR_SUCCESS +; + +69 + } +} + + @lib/handle_pubackcomp.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<�dio.h +> + +21 + ~<�r�g.h +> + +23 #ifde� +WITH_BROKER + + +24 + ~"mosqu�to_brok�_����.h +" + +27 + ~"mosqu�to.h +" + +28 + ~"logg�g_mosq.h +" + +29 + ~"mem�y_mosq.h +" + +30 + ~"mes�ges_mosq.h +" + +31 + ~"mq�_��oc�.h +" + +32 + ~"�t_mosq.h +" + +33 + ~"�ck�_mosq.h +" + +34 + ~"�ad_h�d�.h +" + +35 + ~"�nd_mosq.h +" + +36 + ~"ut�_mosq.h +" + +39 #ifde� +WITH_BROKER + + +40 + $h�d�__pubackcomp +( +mosqu�to_db + * +db +, +mosqu�to + * +mosq +, cڡ * +ty� +) + +42 + $h�d�__pubackcomp +( +mosqu�to + * +mosq +, cڡ * +ty� +) + +45 +u�t8_t + +�as�_code + = 0; + +46 +u�t16_t + +mid +; + +47 +rc +; + +48 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +49 +qos +; + +51 + `as�� +( +mosq +); + +53 if( +mosq +-> +��e + !� +mosq_cs_c���ed +){ + +54 +MOSQ_ERR_PROTOCOL +; + +57 + `�h�ad_mu�x_lock +(& +mosq +-> +msgs_out +. +mu�x +); + +58 + `ut�__��em�t_�nd_qu�a +( +mosq +); + +59 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgs_out +. +mu�x +); + +61 +rc + = + `�ck�__�ad_u�t16 +(& +mosq +-> +�_�ck� +, & +mid +); + +62 if( +rc +) �c; + +63 +qos + = +ty� +[3] == 'A'?1:2; + +64 if( +mid + =�0� +MOSQ_ERR_PROTOCOL +; + +66 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 + && mosq-> +�_�ck� +. +�ma��g_�ngth + > 2){ + +67 +rc + = + `�ck�__�ad_by� +(& +mosq +-> +�_�ck� +, & +�as�_code +); + +68 if( +rc +) �c; + +70 if( +mosq +-> +�_�ck� +. +�ma��g_�ngth + > 3){ + +71 +rc + = + `�ݔty__�ad_�l +( +CMD_PUBACK +, & +mosq +-> +�_�ck� +, & +�ݔt�s +); + +72 if( +rc +) �c; + +76 #ifde� +WITH_BROKER + + +77 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "Re�ived %��om %�(Mid: %d, RC:%d)", +ty� +, +mosq +-> +id +, +mid +, +�as�_code +); + +80 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +82 +rc + = + `db__mes�ge_d��e_outgo�g +( +db +, +mosq +, +mid +, +mosq_ms_wa�_f�_pubcomp +, +qos +); + +83 if( +rc + =� +MOSQ_ERR_NOT_FOUND +){ + +84 + `log__��tf +( +mosq +, +MOSQ_LOG_WARNING +, "W�n�g: Re�ived %��om %�f܇�unknow��ck� id�tif��%d.", +ty� +, mosq-> +id +, +mid +); + +85 +MOSQ_ERR_SUCCESS +; + +87 +rc +; + +90 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Cl�� %���ived %�(Mid: %d, RC:%d)", mosq-> +id +, +ty� +, +mid +, +�as�_code +); + +92 +rc + = + `mes�ge__d��e +( +mosq +, +mid +, +mosq_md_out +, +qos +); + +93 if( +rc +){ + +94 +rc +; + +97 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +98 if( +mosq +-> +�_publish +){ + +99 +mosq +-> +�_��back + = +�ue +; + +100 +mosq +-> + `�_publish +(mosq, mosq-> +u�rd�a +, +mid +); + +101 +mosq +-> +�_��back + = +�l� +; + +103 if( +mosq +-> +�_publish_v5 +){ + +104 +mosq +-> +�_��back + = +�ue +; + +105 +mosq +-> + `�_publish_v5 +(mosq, mosq-> +u�rd�a +, +mid +, +�as�_code +, +�ݔt�s +); + +106 +mosq +-> +�_��back + = +�l� +; + +108 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +109 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +111 + `�h�ad_mu�x_lock +(& +mosq +-> +msgs_out +. +mu�x +); + +112 + `mes�ge__��a�_to_��ight +( +mosq +, +mosq_md_out +); + +113 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgs_out +. +mu�x +); + +115 +MOSQ_ERR_SUCCESS +; + +117 + } +} + + @lib/handle_publish.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<�r�g.h +> + +22 + ~"mosqu�to.h +" + +23 + ~"mosqu�to_����.h +" + +24 + ~"logg�g_mosq.h +" + +25 + ~"mem�y_mosq.h +" + +26 + ~"mq�_��oc�.h +" + +27 + ~"mes�ges_mosq.h +" + +28 + ~"�ck�_mosq.h +" + +29 + ~"�ݔty_mosq.h +" + +30 + ~"�nd_mosq.h +" + +31 + ~"time_mosq.h +" + +32 + ~"ut�_mosq.h +" + +35 + $h�d�__publish +( +mosqu�to + * +mosq +) + +37 +u�t8_t + +h�d� +; + +38 +mosqu�to_mes�ge_�l + * +mes�ge +; + +39 +rc + = 0; + +40 +u�t16_t + +mid +; + +41 +�� +; + +42 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +44 + `as�� +( +mosq +); + +46 if( +mosq +-> +��e + !� +mosq_cs_c���ed +){ + +47 +MOSQ_ERR_PROTOCOL +; + +50 +mes�ge + = + `mosqu�to__��oc +(1, ( +mosqu�to_mes�ge_�l +)); + +51 if(! +mes�ge +� +MOSQ_ERR_NOMEM +; + +53 +h�d� + = +mosq +-> +�_�ck� +. +comm�d +; + +55 +mes�ge +-> +dup + = ( +h�d� + & 0x08)>>3; + +56 +mes�ge +-> +msg +. +qos + = ( +h�d� + & 0x06)>>1; + +57 +mes�ge +-> +msg +. +��� + = ( +h�d� + & 0x01); + +59 +rc + = + `�ck�__�ad_�r�g +(& +mosq +-> +�_�ck� +, & +mes�ge +-> +msg +. +t�ic +, & +�� +); + +60 if( +rc +){ + +61 + `mes�ge__��nup +(& +mes�ge +); + +62 +rc +; + +64 if(! +�� +){ + +65 + `mes�ge__��nup +(& +mes�ge +); + +66 +MOSQ_ERR_PROTOCOL +; + +69 if( +mes�ge +-> +msg +. +qos + > 0){ + +70 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +71 if( +mosq +-> +msgs_� +. +��ight_qu�a + == 0){ + +72 + `mes�ge__��nup +(& +mes�ge +); + +74 +MOSQ_ERR_PROTOCOL +; + +78 +rc + = + `�ck�__�ad_u�t16 +(& +mosq +-> +�_�ck� +, & +mid +); + +79 if( +rc +){ + +80 + `mes�ge__��nup +(& +mes�ge +); + +81 +rc +; + +83 if( +mid + == 0){ + +84 + `mes�ge__��nup +(& +mes�ge +); + +85 +MOSQ_ERR_PROTOCOL +; + +87 +mes�ge +-> +msg +. +mid + = ()mid; + +90 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +91 +rc + = + `�ݔty__�ad_�l +( +CMD_PUBLISH +, & +mosq +-> +�_�ck� +, & +�ݔt�s +); + +92 if( +rc +) �c; + +95 +mes�ge +-> +msg +. +�yl�d�n + = +mosq +-> +�_�ck� +. +�ma��g_�ngth + - mosq->�_�ck�. +pos +; + +96 if( +mes�ge +-> +msg +. +�yl�d�n +){ + +97 +mes�ge +-> +msg +. +�yl�d + = + `mosqu�to__��oc +(mes�ge->msg. +�yl�d�n ++1, ( +u�t8_t +)); + +98 if(! +mes�ge +-> +msg +. +�yl�d +){ + +99 + `mes�ge__��nup +(& +mes�ge +); + +100 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +101 +MOSQ_ERR_NOMEM +; + +103 +rc + = + `�ck�__�ad_by�s +(& +mosq +-> +�_�ck� +, +mes�ge +-> +msg +. +�yl�d +, mes�ge->msg. +�yl�d�n +); + +104 if( +rc +){ + +105 + `mes�ge__��nup +(& +mes�ge +); + +106 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +107 +rc +; + +110 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, + +112 +mosq +-> +id +, +mes�ge +-> +dup +, mes�ge-> +msg +. +qos +, mes�ge->msg. +��� +, + +113 +mes�ge +-> +msg +. +mid +, mes�ge->msg. +t�ic +, + +114 () +mes�ge +-> +msg +. +�yl�d�n +); + +116 +mes�ge +-> +time�amp + = + `mosqu�to_time +(); + +117 +mes�ge +-> +msg +. +qos +){ + +119 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +120 if( +mosq +-> +�_mes�ge +){ + +121 +mosq +-> +�_��back + = +�ue +; + +122 +mosq +-> + `�_mes�ge +(mosq, mosq-> +u�rd�a +, & +mes�ge +-> +msg +); + +123 +mosq +-> +�_��back + = +�l� +; + +125 if( +mosq +-> +�_mes�ge_v5 +){ + +126 +mosq +-> +�_��back + = +�ue +; + +127 +mosq +-> + `�_mes�ge_v5 +(mosq, mosq-> +u�rd�a +, & +mes�ge +-> +msg +, +�ݔt�s +); + +128 +mosq +-> +�_��back + = +�l� +; + +130 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +131 + `mes�ge__��nup +(& +mes�ge +); + +132 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +133 +MOSQ_ERR_SUCCESS +; + +135 + `ut�__de�em�t_��ive_qu�a +( +mosq +); + +136 +rc + = + `�nd__puback +( +mosq +, +mes�ge +-> +msg +. +mid +, 0); + +137 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +138 if( +mosq +-> +�_mes�ge +){ + +139 +mosq +-> +�_��back + = +�ue +; + +140 +mosq +-> + `�_mes�ge +(mosq, mosq-> +u�rd�a +, & +mes�ge +-> +msg +); + +141 +mosq +-> +�_��back + = +�l� +; + +143 if( +mosq +-> +�_mes�ge_v5 +){ + +144 +mosq +-> +�_��back + = +�ue +; + +145 +mosq +-> + `�_mes�ge_v5 +(mosq, mosq-> +u�rd�a +, & +mes�ge +-> +msg +, +�ݔt�s +); + +146 +mosq +-> +�_��back + = +�l� +; + +148 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +149 + `mes�ge__��nup +(& +mes�ge +); + +150 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +151 +rc +; + +153 + `ut�__de�em�t_��ive_qu�a +( +mosq +); + +154 +rc + = + `�nd__pub�c +( +mosq +, +mes�ge +-> +msg +. +mid +, 0); + +155 + `�h�ad_mu�x_lock +(& +mosq +-> +msgs_� +. +mu�x +); + +156 +mes�ge +-> +��e + = +mosq_ms_wa�_f�_pub�l +; + +157 + `mes�ge__queue +( +mosq +, +mes�ge +, +mosq_md_� +); + +158 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgs_� +. +mu�x +); + +159 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +160 +rc +; + +162 + `mes�ge__��nup +(& +mes�ge +); + +163 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +164 +MOSQ_ERR_PROTOCOL +; + +166 + } +} + + @lib/handle_pubrec.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<�dio.h +> + +21 + ~<�r�g.h +> + +23 #ifde� +WITH_BROKER + + +24 + ~"mosqu�to_brok�_����.h +" + +27 + ~"mosqu�to.h +" + +28 + ~"logg�g_mosq.h +" + +29 + ~"mem�y_mosq.h +" + +30 + ~"mes�ges_mosq.h +" + +31 + ~"mq�_��oc�.h +" + +32 + ~"�t_mosq.h +" + +33 + ~"�ck�_mosq.h +" + +34 + ~"�ad_h�d�.h +" + +35 + ~"�nd_mosq.h +" + +36 + ~"ut�_mosq.h +" + +38 + $h�d�__pub�c +( +mosqu�to_db + * +db +, +mosqu�to + * +mosq +) + +40 +u�t8_t + +�as�_code + = 0; + +41 +u�t16_t + +mid +; + +42 +rc +; + +43 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +45 + `as�� +( +mosq +); + +47 if( +mosq +-> +��e + !� +mosq_cs_c���ed +){ + +48 +MOSQ_ERR_PROTOCOL +; + +51 +rc + = + `�ck�__�ad_u�t16 +(& +mosq +-> +�_�ck� +, & +mid +); + +52 if( +rc +) �c; + +53 if( +mid + =�0� +MOSQ_ERR_PROTOCOL +; + +55 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 + && mosq-> +�_�ck� +. +�ma��g_�ngth + > 2){ + +56 +rc + = + `�ck�__�ad_by� +(& +mosq +-> +�_�ck� +, & +�as�_code +); + +57 if( +rc +) �c; + +59 if( +mosq +-> +�_�ck� +. +�ma��g_�ngth + > 3){ + +60 +rc + = + `�ݔty__�ad_�l +( +CMD_PUBREC +, & +mosq +-> +�_�ck� +, & +�ݔt�s +); + +61 if( +rc +) �c; + +63 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +67 #ifde� +WITH_BROKER + + +68 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "Re�ived PUBREC from %�(Mid: %d)", +mosq +-> +id +, +mid +); + +70 if( +�as�_code + < 0x80){ + +71 +rc + = + `db__mes�ge_upd�e_outgo�g +( +mosq +, +mid +, +mosq_ms_wa�_f�_pubcomp +, 2); + +73 + `db__mes�ge_d��e_outgo�g +( +db +, +mosq +, +mid +, +mosq_ms_wa�_f�_pub�c +, 2); + +76 + `UNUSED +( +db +); + +78 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Cl�� %���ived PUBREC (Mid: %d)", mosq-> +id +, +mid +); + +80 if( +�as�_code + < 0x80 || +mosq +-> +��oc� + !� +mosq_p_mq�5 +){ + +81 +rc + = + `mes�ge__out_upd�e +( +mosq +, +mid +, +mosq_ms_wa�_f�_pubcomp +, 2); + +83 if(! + `mes�ge__d��e +( +mosq +, +mid +, +mosq_md_out +, 2)){ + +85 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +86 if( +mosq +-> +�_publish_v5 +){ + +87 +mosq +-> +�_��back + = +�ue +; + +88 +mosq +-> + `�_publish_v5 +(mosq, mosq-> +u�rd�a +, +mid +, +�as�_code +, +�ݔt�s +); + +89 +mosq +-> +�_��back + = +�l� +; + +91 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +93 + `ut�__��em�t_�nd_qu�a +( +mosq +); + +94 + `�h�ad_mu�x_lock +(& +mosq +-> +msgs_out +. +mu�x +); + +95 + `mes�ge__��a�_to_��ight +( +mosq +, +mosq_md_out +); + +96 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgs_out +. +mu�x +); + +97 +MOSQ_ERR_SUCCESS +; + +100 if( +rc + =� +MOSQ_ERR_NOT_FOUND +){ + +101 + `log__��tf +( +mosq +, +MOSQ_LOG_WARNING +, "W�n�g: Re�ived PUBREC from %�f܇�unknow��ck� id�tif��%d.", mosq-> +id +, +mid +); + +102 }if( +rc + !� +MOSQ_ERR_SUCCESS +){ + +103 +rc +; + +105 +rc + = + `�nd__pub�l +( +mosq +, +mid +); + +106 if( +rc +) �c; + +108 +MOSQ_ERR_SUCCESS +; + +109 + } +} + + @lib/handle_pubrel.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<�dio.h +> + +21 + ~<�r�g.h +> + +23 #ifde� +WITH_BROKER + + +24 + ~"mosqu�to_brok�_����.h +" + +27 + ~"mosqu�to.h +" + +28 + ~"logg�g_mosq.h +" + +29 + ~"mem�y_mosq.h +" + +30 + ~"mes�ges_mosq.h +" + +31 + ~"mq�_��oc�.h +" + +32 + ~"�t_mosq.h +" + +33 + ~"�ck�_mosq.h +" + +34 + ~"�ad_h�d�.h +" + +35 + ~"�nd_mosq.h +" + +36 + ~"ut�_mosq.h +" + +39 + $h�d�__pub�l +( +mosqu�to_db + * +db +, +mosqu�to + * +mosq +) + +41 +u�t8_t + +�as�_code +; + +42 +u�t16_t + +mid +; + +43 #i�de� +WITH_BROKER + + +44 +mosqu�to_mes�ge_�l + * +mes�ge + = +NULL +; + +46 +rc +; + +47 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +49 + `as�� +( +mosq +); + +51 if( +mosq +-> +��e + !� +mosq_cs_c���ed +){ + +52 +MOSQ_ERR_PROTOCOL +; + +55 if( +mosq +-> +��oc� + !� +mosq_p_mq�31 +){ + +56 if(( +mosq +-> +�_�ck� +. +comm�d +&0x0F) != 0x02){ + +57 +MOSQ_ERR_PROTOCOL +; + +60 +rc + = + `�ck�__�ad_u�t16 +(& +mosq +-> +�_�ck� +, & +mid +); + +61 if( +rc +) �c; + +62 if( +mid + =�0� +MOSQ_ERR_PROTOCOL +; + +64 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 + && mosq-> +�_�ck� +. +�ma��g_�ngth + > 2){ + +65 +rc + = + `�ck�__�ad_by� +(& +mosq +-> +�_�ck� +, & +�as�_code +); + +66 if( +rc +) �c; + +68 if( +mosq +-> +�_�ck� +. +�ma��g_�ngth + > 3){ + +69 +rc + = + `�ݔty__�ad_�l +( +CMD_PUBREL +, & +mosq +-> +�_�ck� +, & +�ݔt�s +); + +70 if( +rc +) �c; + +74 #ifde� +WITH_BROKER + + +75 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "Re�ived PUBREL from %�(Mid: %d)", +mosq +-> +id +, +mid +); + +78 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +80 +rc + = + `db__mes�ge_��a�_�com�g +( +db +, +mosq +, +mid +); + +81 if( +rc + =� +MOSQ_ERR_PROTOCOL +){ + +82 +rc +; + +83 }if( +rc + !� +MOSQ_ERR_SUCCESS +){ + +88 +rc + = + `�nd__pubcomp +( +mosq +, +mid +); + +89 if( +rc +) �c; + +91 + `UNUSED +( +db +); + +93 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Cl�� %���ived PUBREL (Mid: %d)", mosq-> +id +, +mid +); + +95 +rc + = + `�nd__pubcomp +( +mosq +, +mid +); + +96 if( +rc +){ + +97 + `mes�ge__�move +( +mosq +, +mid +, +mosq_md_� +, & +mes�ge +, 2); + +98 +rc +; + +101 +rc + = + `mes�ge__�move +( +mosq +, +mid +, +mosq_md_� +, & +mes�ge +, 2); + +102 if( +rc +){ + +103 +rc +; + +107 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +108 if( +mosq +-> +�_mes�ge +){ + +109 +mosq +-> +�_��back + = +�ue +; + +110 +mosq +-> + `�_mes�ge +(mosq, mosq-> +u�rd�a +, & +mes�ge +-> +msg +); + +111 +mosq +-> +�_��back + = +�l� +; + +113 if( +mosq +-> +�_mes�ge_v5 +){ + +114 +mosq +-> +�_��back + = +�ue +; + +115 +mosq +-> + `�_mes�ge_v5 +(mosq, mosq-> +u�rd�a +, & +mes�ge +-> +msg +, +�ݔt�s +); + +116 +mosq +-> +�_��back + = +�l� +; + +118 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +119 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +120 + `mes�ge__��nup +(& +mes�ge +); + +124 +MOSQ_ERR_SUCCESS +; + +125 + } +} + + @lib/handle_suback.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +21 #ifde� +WITH_BROKER + + +22 + ~"mosqu�to_brok�_����.h +" + +25 + ~"mosqu�to.h +" + +26 + ~"mosqu�to_����.h +" + +27 + ~"logg�g_mosq.h +" + +28 + ~"mem�y_mosq.h +" + +29 + ~"mq�_��oc�.h +" + +30 + ~"�ck�_mosq.h +" + +31 + ~"�ݔty_mosq.h +" + +34 + $h�d�__suback +( +mosqu�to + * +mosq +) + +36 +u�t16_t + +mid +; + +37 +u�t8_t + +qos +; + +38 * +g��ed_qos +; + +39 +qos_cou� +; + +40 +i + = 0; + +41 +rc +; + +42 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +44 + `as�� +( +mosq +); + +46 if( +mosq +-> +��e + !� +mosq_cs_c���ed +){ + +47 +MOSQ_ERR_PROTOCOL +; + +50 #ifde� +WITH_BROKER + + +51 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "Re�ived SUBACK from %s", +mosq +-> +id +); + +53 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Cl�� %���ived SUBACK", mosq-> +id +); + +55 +rc + = + `�ck�__�ad_u�t16 +(& +mosq +-> +�_�ck� +, & +mid +); + +56 if( +rc +) �c; + +57 if( +mid + =�0� +MOSQ_ERR_PROTOCOL +; + +59 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +60 +rc + = + `�ݔty__�ad_�l +( +CMD_SUBACK +, & +mosq +-> +�_�ck� +, & +�ݔt�s +); + +61 if( +rc +) �c; + +64 +qos_cou� + = +mosq +-> +�_�ck� +. +�ma��g_�ngth + - mosq->�_�ck�. +pos +; + +65 +g��ed_qos + = + `mosqu�to__m�loc +( +qos_cou� +*()); + +66 if(! +g��ed_qos +� +MOSQ_ERR_NOMEM +; + +67 +mosq +-> +�_�ck� +. +pos + < mosq->�_�ck�. +�ma��g_�ngth +){ + +68 +rc + = + `�ck�__�ad_by� +(& +mosq +-> +�_�ck� +, & +qos +); + +69 if( +rc +){ + +70 + `mosqu�to__� +( +g��ed_qos +); + +71 +rc +; + +73 +g��ed_qos +[ +i +] = () +qos +; + +74 +i +++; + +76 #ifde� +WITH_BROKER + + +78 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +80 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +81 if( +mosq +-> +�_subs�ibe +){ + +82 +mosq +-> +�_��back + = +�ue +; + +83 +mosq +-> + `�_subs�ibe +(mosq, mosq-> +u�rd�a +, +mid +, +qos_cou� +, +g��ed_qos +); + +84 +mosq +-> +�_��back + = +�l� +; + +86 if( +mosq +-> +�_subs�ibe_v5 +){ + +87 +mosq +-> +�_��back + = +�ue +; + +88 +mosq +-> + `�_subs�ibe_v5 +(mosq, mosq-> +u�rd�a +, +mid +, +qos_cou� +, +g��ed_qos +, +�ݔt�s +); + +89 +mosq +-> +�_��back + = +�l� +; + +91 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +92 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +94 + `mosqu�to__� +( +g��ed_qos +); + +96 +MOSQ_ERR_SUCCESS +; + +97 + } +} + + @lib/handle_unsuback.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<�dio.h +> + +21 + ~<�r�g.h +> + +23 #ifde� +WITH_BROKER + + +24 + ~"mosqu�to_brok�_����.h +" + +27 + ~"mosqu�to.h +" + +28 + ~"logg�g_mosq.h +" + +29 + ~"mem�y_mosq.h +" + +30 + ~"mes�ges_mosq.h +" + +31 + ~"mq�_��oc�.h +" + +32 + ~"�t_mosq.h +" + +33 + ~"�ck�_mosq.h +" + +34 + ~"�ݔty_mosq.h +" + +35 + ~"�ad_h�d�.h +" + +36 + ~"�nd_mosq.h +" + +37 + ~"ut�_mosq.h +" + +40 + $h�d�__unsuback +( +mosqu�to + * +mosq +) + +42 +u�t16_t + +mid +; + +43 +rc +; + +44 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +46 + `as�� +( +mosq +); + +48 if( +mosq +-> +��e + !� +mosq_cs_c���ed +){ + +49 +MOSQ_ERR_PROTOCOL +; + +52 #ifde� +WITH_BROKER + + +53 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "Re�ived UNSUBACK from %s", +mosq +-> +id +); + +55 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Cl�� %���ived UNSUBACK", mosq-> +id +); + +57 +rc + = + `�ck�__�ad_u�t16 +(& +mosq +-> +�_�ck� +, & +mid +); + +58 if( +rc +) �c; + +59 if( +mid + =�0� +MOSQ_ERR_PROTOCOL +; + +61 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +62 +rc + = + `�ݔty__�ad_�l +( +CMD_UNSUBACK +, & +mosq +-> +�_�ck� +, & +�ݔt�s +); + +63 if( +rc +) �c; + +66 #ifde� +WITH_BROKER + + +68 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +70 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +71 if( +mosq +-> +�_unsubs�ibe +){ + +72 +mosq +-> +�_��back + = +�ue +; + +73 +mosq +-> + `�_unsubs�ibe +(mosq, mosq-> +u�rd�a +, +mid +); + +74 +mosq +-> +�_��back + = +�l� +; + +76 if( +mosq +-> +�_unsubs�ibe_v5 +){ + +77 +mosq +-> +�_��back + = +�ue +; + +78 +mosq +-> + `�_unsubs�ibe_v5 +(mosq, mosq-> +u�rd�a +, +mid +, +�ݔt�s +); + +79 +mosq +-> +�_��back + = +�l� +; + +81 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +82 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +85 +MOSQ_ERR_SUCCESS +; + +86 + } +} + + @lib/helpers.c + +17 + ~"c�fig.h +" + +19 + ~<��o.h +> + +20 + ~<�dbo�.h +> + +22 + ~"mosqu�to.h +" + +23 + ~"mosqu�to_����.h +" + +25 + su�rd�a__��back + { + +26 cڡ * + mt�ic +; + +27 (* + m��back +)( + mmosqu�to + *, *, cڡ + mmosqu�to_mes�ge + *); + +28 * + mu�rd�a +; + +29 + mqos +; + +30 + mrc +; + +33 + su�rd�a__sim�e + { + +34 +mosqu�to_mes�ge + * + mmes�ges +; + +35 + mmax_msg_cou� +; + +36 + mmes�ge_cou� +; + +37 +bo� + + mw�t_���ed +; + +41 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +43 +u�rd�a__��back + * +u�rd�a + = +obj +; + +45 + `UNUSED +( +rc +); + +47 + `mosqu�to_subs�ibe +( +mosq +, +NULL +, +u�rd�a +-> +t�ic +, u�rd�a-> +qos +); + +48 + } +} + +51 + $�_mes�ge_��back +( +mosqu�to + * +mosq +, * +obj +, cڡ +mosqu�to_mes�ge + * +mes�ge +) + +53 +rc +; + +54 +u�rd�a__��back + * +u�rd�a + = +obj +; + +56 +rc + = +u�rd�a +-> + `��back +( +mosq +, u�rd�a->u�rd�a, +mes�ge +); + +57 if( +rc +){ + +58 + `mosqu�to_disc��� +( +mosq +); + +60 + } +} + +62 + $�_mes�ge_sim�e +( +mosqu�to + * +mosq +, * +obj +, cڡ +mosqu�to_mes�ge + * +mes�ge +) + +64 +u�rd�a__sim�e + * +u�rd�a + = +obj +; + +65 +rc +; + +67 if( +u�rd�a +-> +max_msg_cou� + == 0){ + +72 if(! +u�rd�a +-> +w�t_���ed + && +mes�ge +-> +��� +){ + +76 +u�rd�a +-> +max_msg_cou� +--; + +78 +rc + = + `mosqu�to_mes�ge_c�y +(& +u�rd�a +-> +mes�ges +[u�rd�a-> +mes�ge_cou� +], +mes�ge +); + +79 if( +rc +){ + +80 +rc +; + +82 +u�rd�a +-> +mes�ge_cou� +++; + +83 if( +u�rd�a +-> +max_msg_cou� + == 0){ + +84 + `mosqu�to_disc��� +( +mosq +); + +87 + } +} + +90 +libmosq_EXPORT + + $mosqu�to_subs�ibe_sim�e +( + +91 +mosqu�to_mes�ge + ** +mes�ges +, + +92 +msg_cou� +, + +93 +bo� + +w�t_���ed +, + +94 cڡ * +t�ic +, + +95 +qos +, + +96 cڡ * +ho� +, + +97 +p�t +, + +98 cڡ * +���_id +, + +99 +k��live +, + +100 +bo� + +��n_�ssi� +, + +101 cڡ * +u��ame +, + +102 cڡ * +�ssw�d +, + +103 cڡ +libmosqu�to_w�l + * +w�l +, + +104 cڡ +libmosqu�to_�s + * +�s +) + +106 +u�rd�a__sim�e + +u�rd�a +; + +107 +rc +; + +108 +i +; + +110 if(! +t�ic + || +msg_cou� + < 1 || ! +mes�ges +){ + +111 +MOSQ_ERR_INVAL +; + +114 * +mes�ges + = +NULL +; + +116 +u�rd�a +. +mes�ges + = + `��oc +(( +mosqu�to_mes�ge +), +msg_cou� +); + +117 if(! +u�rd�a +. +mes�ges +){ + +118 +MOSQ_ERR_NOMEM +; + +120 +u�rd�a +. +mes�ge_cou� + = 0; + +121 +u�rd�a +. +max_msg_cou� + = +msg_cou� +; + +122 +u�rd�a +. +w�t_���ed + = want_retained; + +124 +rc + = + `mosqu�to_subs�ibe_��back +( + +125 +�_mes�ge_sim�e +, & +u�rd�a +, + +126 +t�ic +, +qos +, + +127 +ho� +, +p�t +, + +128 +���_id +, +k��live +, +��n_�ssi� +, + +129 +u��ame +, +�ssw�d +, + +130 +w�l +, +�s +); + +132 if(! +rc + && +u�rd�a +. +max_msg_cou� + == 0){ + +133 * +mes�ges + = +u�rd�a +.messages; + +134 +MOSQ_ERR_SUCCESS +; + +136 +i +=0; i< +msg_cou� +; i++){ + +137 + `mosqu�to_mes�ge_�_cڋ�s +(& +u�rd�a +. +mes�ges +[ +i +]); + +139 + `� +( +u�rd�a +. +mes�ges +); + +140 +u�rd�a +. +mes�ges + = +NULL +; + +141 +rc +; + +143 + } +} + +146 +libmosq_EXPORT + +mosqu�to_subs�ibe_��back +( + +147 (* +��back +)( +mosqu�to + *, *, cڡ +mosqu�to_mes�ge + *), + +148 * +u�rd�a +, + +149 cڡ * +t�ic +, + +150 +qos +, + +151 cڡ * +ho� +, + +152 +p�t +, + +153 cڡ * +���_id +, + +154 +k��live +, + +155 +bo� + +��n_�ssi� +, + +156 cڡ * +u��ame +, + +157 cڡ * +�ssw�d +, + +158 cڡ +libmosqu�to_w�l + * +w�l +, + +159 cڡ +libmosqu�to_�s + * +�s +) + +161 +mosqu�to + * +mosq +; + +162 +u�rd�a__��back + +cb_u�rd�a +; + +163 +rc +; + +165 if(! +��back + || ! +t�ic +){ + +166 +MOSQ_ERR_INVAL +; + +169 +cb_u�rd�a +. +t�ic + =�opic; + +170 +cb_u�rd�a +. +qos + = qos; + +171 +cb_u�rd�a +. +rc + = 0; + +172 +cb_u�rd�a +. +u�rd�a + = userdata; + +173 +cb_u�rd�a +. +��back + = callback; + +175 +mosq + = + `mosqu�to_�w +( +���_id +, +��n_�ssi� +, & +cb_u�rd�a +); + +176 if(! +mosq +){ + +177 +MOSQ_ERR_NOMEM +; + +180 if( +w�l +){ + +181 +rc + = + `mosqu�to_w�l_�t +( +mosq +, +w�l +-> +t�ic +, w�l-> +�yl�d�n +, w�l-> +�yl�d +, w�l-> +qos +, w�l-> +��� +); + +182 if( +rc +){ + +183 + `mosqu�to_de�roy +( +mosq +); + +184 +rc +; + +187 if( +u��ame +){ + +188 +rc + = + `mosqu�to_u��ame_pw_�t +( +mosq +, +u��ame +, +�ssw�d +); + +189 if( +rc +){ + +190 + `mosqu�to_de�roy +( +mosq +); + +191 +rc +; + +194 if( +�s +){ + +195 +rc + = + `mosqu�to_�s_�t +( +mosq +, +�s +-> +�f�e +,�ls-> +��th +,�ls-> +��f�e +,�ls-> +keyf�e +,�ls-> +pw_��back +); + +196 if( +rc +){ + +197 + `mosqu�to_de�roy +( +mosq +); + +198 +rc +; + +200 +rc + = + `mosqu�to_�s_�ts_�t +( +mosq +, +�s +-> +��_�qs +,�ls-> +�s_v�si� +,�ls-> +c�h�s +); + +201 if( +rc +){ + +202 + `mosqu�to_de�roy +( +mosq +); + +203 +rc +; + +207 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +208 + `mosqu�to_mes�ge_��back_�t +( +mosq +, +�_mes�ge_��back +); + +210 +rc + = + `mosqu�to_c��� +( +mosq +, +ho� +, +p�t +, +k��live +); + +211 if( +rc +){ + +212 + `mosqu�to_de�roy +( +mosq +); + +213 +rc +; + +215 +rc + = + `mosqu�to_lo�_f�ev� +( +mosq +, -1, 1); + +216 + `mosqu�to_de�roy +( +mosq +); + +217 if( +cb_u�rd�a +. +rc +){ + +218 +rc + = +cb_u�rd�a +.rc; + +225 +MOSQ_ERR_SUCCESS +; + +226 + } +} + + @lib/logging_mosq.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<�d�g.h +> + +21 + ~<�dio.h +> + +22 + ~<�r�g.h +> + +24 + ~"mosqu�to_����.h +" + +25 + ~"mosqu�to.h +" + +26 + ~"mem�y_mosq.h +" + +28 + $log__��tf +( +mosqu�to + * +mosq +, +�iܙy +, cڡ * +fmt +, ...) + +30 +va_li� + +va +; + +31 * +s +; + +32 +�n +; + +34 + `as�� +( +mosq +); + +35 + `as�� +( +fmt +); + +37 + `�h�ad_mu�x_lock +(& +mosq +-> +log_��back_mu�x +); + +38 if( +mosq +-> +�_log +){ + +39 +�n + = + `��� +( +fmt +) + 500; + +40 +s + = + `mosqu�to__m�loc +( +�n +*()); + +41 if(! +s +){ + +42 + `�h�ad_mu�x_u�ock +(& +mosq +-> +log_��back_mu�x +); + +43 +MOSQ_ERR_NOMEM +; + +46 + `va_��t +( +va +, +fmt +); + +47 + `v���tf +( +s +, +�n +, +fmt +, +va +); + +48 + `va_�d +( +va +); + +49 +s +[ +�n +-1] = '\0'; + +51 +mosq +-> + `�_log +(mosq, mosq-> +u�rd�a +, +�iܙy +, +s +); + +53 + `mosqu�to__� +( +s +); + +55 + `�h�ad_mu�x_u�ock +(& +mosq +-> +log_��back_mu�x +); + +57 +MOSQ_ERR_SUCCESS +; + +58 + } +} + + @lib/logging_mosq.h + +16 #i�de� +LOGGING_MOSQ_H + + +17 + #LOGGING_MOSQ_H + + + ) + +19 + ~"mosqu�to.h +" + +21 +log__��tf +( +mosqu�to + * +mosq +, +�iܙy +, cڡ * +fmt +, ...); + + @lib/loop.c + +17 + ~"c�fig.h +" + +19 + ~<��o.h +> + +20 #i�de� +WIN32 + + +21 + ~<sys/���.h +> + +22 + ~<time.h +> + +25 + ~"mosqu�to.h +" + +26 + ~"mosqu�to_����.h +" + +27 + ~"�t_mosq.h +" + +28 + ~"�ck�_mosq.h +" + +29 + ~"socks_mosq.h +" + +30 + ~"�s_mosq.h +" + +31 + ~"ut�_mosq.h +" + +33 #i�! +def�ed +( +WIN32 +�&& !def�ed( +__SYMBIAN32__ +) + +34 + #HAVE_PSELECT + + + ) + +37 + $mosqu�to_lo� +( +mosqu�to + * +mosq +, +timeout +, +max_�ck�s +) + +39 #ifde� +HAVE_PSELECT + + +40 +time�ec + +lo�l_timeout +; + +42 +timev� + +lo�l_timeout +; + +44 +fd_�t + +�adfds +, +wr�efds +; + +45 +fdcou� +; + +46 +rc +; + +47 +��buf +; + +48 +maxfd + = 0; + +49 +time_t + +now +; + +51 if(! +mosq + || +max_�ck�s + < 1� +MOSQ_ERR_INVAL +; + +52 #i�de� +WIN32 + + +53 if( +mosq +-> +sock + >� +FD_SETSIZE + || mosq-> +sock��R + >= FD_SETSIZE){ + +54 +MOSQ_ERR_INVAL +; + +58 + `FD_ZERO +(& +�adfds +); + +59 + `FD_ZERO +(& +wr�efds +); + +60 if( +mosq +-> +sock + !� +INVALID_SOCKET +){ + +61 +maxfd + = +mosq +-> +sock +; + +62 + `FD_SET +( +mosq +-> +sock +, & +�adfds +); + +63 + `�h�ad_mu�x_lock +(& +mosq +-> +cu��t_out_�ck�_mu�x +); + +64 + `�h�ad_mu�x_lock +(& +mosq +-> +out_�ck�_mu�x +); + +65 if( +mosq +-> +out_�ck� + || mosq-> +cu��t_out_�ck� +){ + +66 + `FD_SET +( +mosq +-> +sock +, & +wr�efds +); + +68 #ifde� +WITH_TLS + + +69 if( +mosq +-> +s� +){ + +70 if( +mosq +-> +w�t_wr�e +){ + +71 + `FD_SET +( +mosq +-> +sock +, & +wr�efds +); + +72 }if( +mosq +-> +w�t_c��� +){ + +77 + `FD_CLR +( +mosq +-> +sock +, & +wr�efds +); + +81 + `�h�ad_mu�x_u�ock +(& +mosq +-> +out_�ck�_mu�x +); + +82 + `�h�ad_mu�x_u�ock +(& +mosq +-> +cu��t_out_�ck�_mu�x +); + +84 #ifde� +WITH_SRV + + +85 if( +mosq +-> +ach� +){ + +86 + `�h�ad_mu�x_lock +(& +mosq +-> +��e_mu�x +); + +87 if( +mosq +-> +��e + =� +mosq_cs_c���_�v +){ + +88 +rc + = + `�es_fds +( +mosq +-> +ach� +, & +�adfds +, & +wr�efds +); + +89 if( +rc + > +maxfd +){ + +90 +maxfd + = +rc +; + +93 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��e_mu�x +); + +94 +MOSQ_ERR_NO_CONN +; + +96 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��e_mu�x +); + +99 +MOSQ_ERR_NO_CONN +; + +102 if( +mosq +-> +sock��R + !� +INVALID_SOCKET +){ + +105 + `FD_SET +( +mosq +-> +sock��R +, & +�adfds +); + +106 if( +mosq +-> +sock��R + > +maxfd +){ + +107 +maxfd + = +mosq +-> +sock��R +; + +111 if( +timeout + < 0){ + +112 +timeout + = 1000; + +115 +now + = + `mosqu�to_time +(); + +116 if( +mosq +-> +�xt_msg_out + && +now + + +timeout +/1000 > mosq->next_msg_out){ + +117 +timeout + = ( +mosq +-> +�xt_msg_out + - +now +)*1000; + +120 if( +timeout + < 0){ + +123 +timeout + = 0; + +126 +lo�l_timeout +. +tv_�c + = +timeout +/1000; + +127 #ifde� +HAVE_PSELECT + + +128 +lo�l_timeout +. +tv_n�c + = ( +timeout +-lo�l_timeout. +tv_�c +*1000)*1e6; + +130 +lo�l_timeout +. +tv_u�c + = ( +timeout +-lo�l_timeout. +tv_�c +*1000)*1000; + +133 #ifde� +HAVE_PSELECT + + +134 +fdcou� + = + `p��� +( +maxfd ++1, & +�adfds +, & +wr�efds +, +NULL +, & +lo�l_timeout +, NULL); + +136 +fdcou� + = + `��� +( +maxfd ++1, & +�adfds +, & +wr�efds +, +NULL +, & +lo�l_timeout +); + +138 if( +fdcou� + == -1){ + +139 #ifde� +WIN32 + + +140 +��o + = + `WSAG�La�E�� +(); + +142 if( +��o + =� +EINTR +){ + +143 +MOSQ_ERR_SUCCESS +; + +145 +MOSQ_ERR_ERRNO +; + +148 if( +mosq +-> +sock + !� +INVALID_SOCKET +){ + +149 if( + `FD_ISSET +( +mosq +-> +sock +, & +�adfds +)){ + +150 +rc + = + `mosqu�to_lo�_�ad +( +mosq +, +max_�ck�s +); + +151 if( +rc + || +mosq +-> +sock + =� +INVALID_SOCKET +){ + +152 +rc +; + +155 if( +mosq +-> +sock��R + !� +INVALID_SOCKET + && + `FD_ISSET +(mosq->sock��R, & +�adfds +)){ + +156 #i�de� +WIN32 + + +157 if( + `�ad +( +mosq +-> +sock��R +, & +��buf +, 1) == 0){ + +160 + `�cv +( +mosq +-> +sock��R +, & +��buf +, 1, 0); + +165 if( +mosq +-> +sock + !� +INVALID_SOCKET +) + +166 + `FD_SET +( +mosq +-> +sock +, & +wr�efds +); + +168 if( +mosq +-> +sock + !� +INVALID_SOCKET + && + `FD_ISSET +(mosq->sock, & +wr�efds +)){ + +169 #ifde� +WITH_TLS + + +170 if( +mosq +-> +w�t_c��� +){ + +171 +rc + = + `�t__sock�_c���_�s +( +mosq +); + +172 if( +rc +) �c; + +176 +rc + = + `mosqu�to_lo�_wr�e +( +mosq +, +max_�ck�s +); + +177 if( +rc + || +mosq +-> +sock + =� +INVALID_SOCKET +){ + +178 +rc +; + +183 #ifde� +WITH_SRV + + +184 if( +mosq +-> +ach� +){ + +185 + `�es_�o�ss +( +mosq +-> +ach� +, & +�adfds +, & +wr�efds +); + +189 + `mosqu�to_lo�_misc +( +mosq +); + +190 + } +} + +193 + $mosqu�to_lo�_f�ev� +( +mosqu�to + * +mosq +, +timeout +, +max_�ck�s +) + +195 +run + = 1; + +196 +rc +; + +197 +�c���s + = 0; + +198 +�c���_d�ay +; + +199 #i�de� +WIN32 + + +200 +time�ec + +�q +, +�m +; + +203 if(! +mosq +� +MOSQ_ERR_INVAL +; + +205 if( +mosq +-> +��e + =� +mosq_cs_c���_async +){ + +206 + `mosqu�to_�c��� +( +mosq +); + +209 +run +){ + +211 +rc + = + `mosqu�to_lo� +( +mosq +, +timeout +, +max_�ck�s +); + +212 i�( +�c���s + !=0 && +rc + =� +MOSQ_ERR_SUCCESS +){ + +213 +�c���s + = 0; + +215 } +run + && +rc + =� +MOSQ_ERR_SUCCESS +); + +217 +rc +){ + +218 +MOSQ_ERR_NOMEM +: + +219 +MOSQ_ERR_PROTOCOL +: + +220 +MOSQ_ERR_INVAL +: + +221 +MOSQ_ERR_NOT_FOUND +: + +222 +MOSQ_ERR_TLS +: + +223 +MOSQ_ERR_PAYLOAD_SIZE +: + +224 +MOSQ_ERR_NOT_SUPPORTED +: + +225 +MOSQ_ERR_AUTH +: + +226 +MOSQ_ERR_ACL_DENIED +: + +227 +MOSQ_ERR_UNKNOWN +: + +228 +MOSQ_ERR_EAI +: + +229 +MOSQ_ERR_PROXY +: + +230 +rc +; + +231 +MOSQ_ERR_ERRNO +: + +234 if( +��o + =� +EPROTO +){ + +235 +rc +; + +238 +rc + = +MOSQ_ERR_SUCCESS +; + +239 + `�h�ad_mu�x_lock +(& +mosq +-> +��e_mu�x +); + +240 if( +mosq +-> +��e + =� +mosq_cs_disc����g +){ + +241 +run + = 0; + +242 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��e_mu�x +); + +244 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��e_mu�x +); + +246 if( +mosq +-> +�c���_d�ay_max + > mosq-> +�c���_d�ay +){ + +247 if( +mosq +-> +�c���_expڒt�l_backoff +){ + +248 +�c���_d�ay + = +mosq +->�c���_d�ay*( +�c���s ++1)*(reconnects+1); + +250 +�c���_d�ay + = +mosq +->�c���_d�ay*( +�c���s ++1); + +253 +�c���_d�ay + = +mosq +->reconnect_delay; + +256 if( +�c���_d�ay + > +mosq +-> +�c���_d�ay_max +){ + +257 +�c���_d�ay + = +mosq +-> +�c���_d�ay_max +; + +259 +�c���s +++; + +262 #ifde� +WIN32 + + +263 + `S˕ +( +�c���_d�ay +*1000); + +265 +�q +. +tv_�c + = +�c���_d�ay +; + +266 +�q +. +tv_n�c + = 0; + +267 + `�no��p +(& +�q +, & +�m +�=�-1 && +��o + =� +EINTR +){ + +268 +�q + = +�m +; + +272 + `�h�ad_mu�x_lock +(& +mosq +-> +��e_mu�x +); + +273 if( +mosq +-> +��e + =� +mosq_cs_disc����g +){ + +274 +run + = 0; + +275 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��e_mu�x +); + +277 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��e_mu�x +); + +278 +rc + = + `mosqu�to_�c��� +( +mosq +); + +281 } +run + && +rc + !� +MOSQ_ERR_SUCCESS +); + +283 +rc +; + +284 + } +} + +287 + $mosqu�to_lo�_misc +( +mosqu�to + * +mosq +) + +289 if(! +mosq +� +MOSQ_ERR_INVAL +; + +290 if( +mosq +-> +sock + =� +INVALID_SOCKET +� +MOSQ_ERR_NO_CONN +; + +292 + `mosqu�to__check_k��live +( +mosq +); + +293 + } +} + +296 + $mosqu�to__lo�_rc_h�d� +( +mosqu�to + * +mosq +, +rc +) + +298 if( +rc +){ + +299 + `�t__sock�_�o� +( +mosq +); + +300 + `�h�ad_mu�x_lock +(& +mosq +-> +��e_mu�x +); + +301 if( +mosq +-> +��e + =� +mosq_cs_disc����g +){ + +302 +rc + = +MOSQ_ERR_SUCCESS +; + +304 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��e_mu�x +); + +305 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +306 if( +mosq +-> +�_disc��� +){ + +307 +mosq +-> +�_��back + = +�ue +; + +308 +mosq +-> + `�_disc��� +(mosq, mosq-> +u�rd�a +, +rc +); + +309 +mosq +-> +�_��back + = +�l� +; + +311 if( +mosq +-> +�_disc���_v5 +){ + +312 +mosq +-> +�_��back + = +�ue +; + +313 +mosq +-> + `�_disc���_v5 +(mosq, mosq-> +u�rd�a +, +rc +, +NULL +); + +314 +mosq +-> +�_��back + = +�l� +; + +316 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +317 +rc +; + +319 +rc +; + +320 + } +} + +323 + $mosqu�to_lo�_�ad +( +mosqu�to + * +mosq +, +max_�ck�s +) + +325 +rc +; + +326 +i +; + +327 if( +max_�ck�s + < 1� +MOSQ_ERR_INVAL +; + +329 #ifde� +WITH_TLS + + +330 if( +mosq +-> +w�t_c��� +){ + +331 + `�t__sock�_c���_�s +( +mosq +); + +335 + `�h�ad_mu�x_lock +(& +mosq +-> +msgs_out +. +mu�x +); + +336 +max_�ck�s + = +mosq +-> +msgs_out +. +queue_�n +; + +337 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgs_out +. +mu�x +); + +339 + `�h�ad_mu�x_lock +(& +mosq +-> +msgs_� +. +mu�x +); + +340 +max_�ck�s + +� +mosq +-> +msgs_� +. +queue_�n +; + +341 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgs_� +. +mu�x +); + +343 if( +max_�ck�s + < 1) max_packets = 1; + +347 +i +=0; i< +max_�ck�s + || + `SSL_DATA_PENDING +( +mosq +); i++){ + +348 #ifde� +WITH_SOCKS + + +349 if( +mosq +-> +socks5_ho� +){ + +350 +rc + = + `socks5__�ad +( +mosq +); + +354 +rc + = + `�ck�__�ad +( +mosq +); + +356 if( +rc + || +��o + =� +EAGAIN + ||��n�=� +COMPAT_EWOULDBLOCK +){ + +357 + `mosqu�to__lo�_rc_h�d� +( +mosq +, +rc +); + +360 +rc +; + +361 + } +} + +364 + $mosqu�to_lo�_wr�e +( +mosqu�to + * +mosq +, +max_�ck�s +) + +366 +rc +; + +367 +i +; + +368 if( +max_�ck�s + < 1� +MOSQ_ERR_INVAL +; + +370 + `�h�ad_mu�x_lock +(& +mosq +-> +msgs_out +. +mu�x +); + +371 +max_�ck�s + = +mosq +-> +msgs_out +. +queue_�n +; + +372 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgs_out +. +mu�x +); + +374 + `�h�ad_mu�x_lock +(& +mosq +-> +msgs_� +. +mu�x +); + +375 +max_�ck�s + +� +mosq +-> +msgs_� +. +queue_�n +; + +376 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgs_� +. +mu�x +); + +378 if( +max_�ck�s + < 1) max_packets = 1; + +382 +i +=0; i< +max_�ck�s +; i++){ + +383 +rc + = + `�ck�__wr�e +( +mosq +); + +384 if( +rc + || +��o + =� +EAGAIN + ||��n�=� +COMPAT_EWOULDBLOCK +){ + +385 + `mosqu�to__lo�_rc_h�d� +( +mosq +, +rc +); + +388 +rc +; + +389 + } +} + + @lib/memory_mosq.c + +17 + ~"c�fig.h +" + +19 + ~<�dlib.h +> + +20 + ~<�r�g.h +> + +22 + ~"mem�y_mosq.h +" + +24 #ifde� +REAL_WITH_MEMORY_TRACKING + + +25 #i� +def�ed +( +__APPLE__ +) + +26 + ~<m�loc/m�loc.h +> + +27 + #m�loc_u�b�_size + +m�loc_size + + + ) + +28 #�i� +def�ed +( +__F�eBSD__ +) + +29 + ~<m�loc_�.h +> + +31 + ~<m�loc.h +> + +35 #ifde� +REAL_WITH_MEMORY_TRACKING + + +36 + gmemcou� + = 0; + +37 + gmax_memcou� + = 0; + +40 #ifde� +WITH_BROKER + + +41 +size_t + + gmem_lim� + = 0; + +42 + $mem�y__�t_lim� +( +size_t + +lim +) + +44 +mem_lim� + = +lim +; + +45 + } +} + +48 * + $mosqu�to__��oc +( +size_t + +nmemb +, size_� +size +) + +50 #ifde� +REAL_WITH_MEMORY_TRACKING + + +51 if( +mem_lim� + && +memcou� + + +size + > mem_limit){ + +52 +NULL +; + +55 * +mem + = + `��oc +( +nmemb +, +size +); + +57 #ifde� +REAL_WITH_MEMORY_TRACKING + + +58 if( +mem +){ + +59 +memcou� + +� + `m�loc_u�b�_size +( +mem +); + +60 if( +memcou� + > +max_memcou� +){ + +61 +max_memcou� + = +memcou� +; + +66 +mem +; + +67 + } +} + +69 + $mosqu�to__� +(* +mem +) + +71 #ifde� +REAL_WITH_MEMORY_TRACKING + + +72 if(! +mem +){ + +75 +memcou� + -� + `m�loc_u�b�_size +( +mem +); + +77 + `� +( +mem +); + +78 + } +} + +80 * + $mosqu�to__m�loc +( +size_t + +size +) + +82 #ifde� +REAL_WITH_MEMORY_TRACKING + + +83 if( +mem_lim� + && +memcou� + + +size + > mem_limit){ + +84 +NULL +; + +87 * +mem + = + `m�loc +( +size +); + +89 #ifde� +REAL_WITH_MEMORY_TRACKING + + +90 if( +mem +){ + +91 +memcou� + +� + `m�loc_u�b�_size +( +mem +); + +92 if( +memcou� + > +max_memcou� +){ + +93 +max_memcou� + = +memcou� +; + +98 +mem +; + +99 + } +} + +101 #ifde� +REAL_WITH_MEMORY_TRACKING + + +102 + $mosqu�to__mem�y_u�d +() + +104 +memcou� +; + +105 + } +} + +107 + $mosqu�to__max_mem�y_u�d +() + +109 +max_memcou� +; + +110 + } +} + +113 * + $mosqu�to__��loc +(* +�r +, +size_t + +size +) + +115 #ifde� +REAL_WITH_MEMORY_TRACKING + + +116 if( +mem_lim� + && +memcou� + + +size + > mem_limit){ + +117 +NULL +; + +120 * +mem +; + +121 #ifde� +REAL_WITH_MEMORY_TRACKING + + +122 if( +�r +){ + +123 +memcou� + -� + `m�loc_u�b�_size +( +�r +); + +126 +mem + = + `��loc +( +�r +, +size +); + +128 #ifde� +REAL_WITH_MEMORY_TRACKING + + +129 if( +mem +){ + +130 +memcou� + +� + `m�loc_u�b�_size +( +mem +); + +131 if( +memcou� + > +max_memcou� +){ + +132 +max_memcou� + = +memcou� +; + +137 +mem +; + +138 + } +} + +140 * + $mosqu�to__�rdup +(cڡ * +s +) + +142 #ifde� +REAL_WITH_MEMORY_TRACKING + + +143 if( +mem_lim� + && +memcou� + + + `��� +( +s +) > mem_limit){ + +144 +NULL +; + +147 * +�r + = + `�rdup +( +s +); + +149 #ifde� +REAL_WITH_MEMORY_TRACKING + + +150 if( +�r +){ + +151 +memcou� + +� + `m�loc_u�b�_size +( +�r +); + +152 if( +memcou� + > +max_memcou� +){ + +153 +max_memcou� + = +memcou� +; + +158 +�r +; + +159 + } +} + + @lib/memory_mosq.h + +17 #i�de� +MEMORY_MOSQ_H + + +18 + #MEMORY_MOSQ_H + + + ) + +20 + ~<�dio.h +> + +21 + ~<sys/ty�s.h +> + +23 #i� +def�ed +( +WITH_MEMORY_TRACKING +�&& def�ed( +WITH_BROKER +�&& def�ed( +__GLIBC__ +) + +24 + #REAL_WITH_MEMORY_TRACKING + + + ) + +27 * +mosqu�to__��oc +( +size_t + +nmemb +, size_� +size +); + +28 +mosqu�to__� +(* +mem +); + +29 * +mosqu�to__m�loc +( +size_t + +size +); + +30 #ifde� +REAL_WITH_MEMORY_TRACKING + + +31 +mosqu�to__mem�y_u�d +(); + +32 +mosqu�to__max_mem�y_u�d +(); + +34 * +mosqu�to__��loc +(* +�r +, +size_t + +size +); + +35 * +mosqu�to__�rdup +(cڡ * +s +); + +37 #ifde� +WITH_BROKER + + +38 +mem�y__�t_lim� +( +size_t + +lim +); + + @lib/messages_mosq.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<�dlib.h +> + +21 + ~<�r�g.h +> + +22 + ~<u�i�.h +> + +24 + ~"mosqu�to_����.h +" + +25 + ~"mosqu�to.h +" + +26 + ~"mem�y_mosq.h +" + +27 + ~"mes�ges_mosq.h +" + +28 + ~"�nd_mosq.h +" + +29 + ~"time_mosq.h +" + +30 + ~"ut�_mosq.h +" + +32 + $mes�ge__��nup +( +mosqu�to_mes�ge_�l + ** +mes�ge +) + +34 +mosqu�to_mes�ge_�l + * +msg +; + +36 if(! +mes�ge + || !*message) ; + +38 +msg + = * +mes�ge +; + +40 + `mosqu�to__� +( +msg +->msg. +t�ic +); + +41 + `mosqu�to__� +( +msg +->msg. +�yl�d +); + +42 + `mosqu�to__� +( +msg +); + +43 + } +} + +45 + $mes�ge__��nup_�l +( +mosqu�to + * +mosq +) + +47 +mosqu�to_mes�ge_�l + * +�� +, * +tmp +; + +49 + `as�� +( +mosq +); + +51 + `DL_FOREACH_SAFE +( +mosq +-> +msgs_� +. +��ight +, +�� +, +tmp +){ + +52 + `DL_DELETE +( +mosq +-> +msgs_� +. +��ight +, +�� +); + +53 + `mes�ge__��nup +(& +�� +); + +55 + `DL_FOREACH_SAFE +( +mosq +-> +msgs_out +. +��ight +, +�� +, +tmp +){ + +56 + `DL_DELETE +( +mosq +-> +msgs_out +. +��ight +, +�� +); + +57 + `mes�ge__��nup +(& +�� +); + +59 + } +} + +61 + $mosqu�to_mes�ge_c�y +( +mosqu�to_mes�ge + * +d� +, cڡ mosqu�to_mes�g�* +�c +) + +63 if(! +d� + || ! +�c +� +MOSQ_ERR_INVAL +; + +65 +d� +-> +mid + = +�c +->mid; + +66 +d� +-> +t�ic + = + `mosqu�to__�rdup +( +�c +->topic); + +67 if(! +d� +-> +t�ic +� +MOSQ_ERR_NOMEM +; + +68 +d� +-> +qos + = +�c +->qos; + +69 +d� +-> +��� + = +�c +->retain; + +70 if( +�c +-> +�yl�d�n +){ + +71 +d� +-> +�yl�d + = + `mosqu�to__��oc +( +�c +-> +�yl�d�n ++1, ( +u�t8_t +)); + +72 if(! +d� +-> +�yl�d +){ + +73 + `mosqu�to__� +( +d� +-> +t�ic +); + +74 +MOSQ_ERR_NOMEM +; + +76 + `mem�y +( +d� +-> +�yl�d +, +�c +->�yl�d, src-> +�yl�d�n +); + +77 +d� +-> +�yl�d�n + = +�c +->payloadlen; + +79 +d� +-> +�yl�d�n + = 0; + +80 +d� +-> +�yl�d + = +NULL +; + +82 +MOSQ_ERR_SUCCESS +; + +83 + } +} + +85 + $mes�ge__d��e +( +mosqu�to + * +mosq +, +u�t16_t + +mid +, +mosqu�to_msg_d�e�i� + +d� +, +qos +) + +87 +mosqu�to_mes�ge_�l + * +mes�ge +; + +88 +rc +; + +89 + `as�� +( +mosq +); + +91 +rc + = + `mes�ge__�move +( +mosq +, +mid +, +d� +, & +mes�ge +, +qos +); + +92 if( +rc + =� +MOSQ_ERR_SUCCESS +){ + +93 + `mes�ge__��nup +(& +mes�ge +); + +95 +rc +; + +96 + } +} + +98 + $mosqu�to_mes�ge_� +( +mosqu�to_mes�ge + ** +mes�ge +) + +100 +mosqu�to_mes�ge + * +msg +; + +102 if(! +mes�ge + || !*message) ; + +104 +msg + = * +mes�ge +; + +106 + `mosqu�to__� +( +msg +-> +t�ic +); + +107 + `mosqu�to__� +( +msg +-> +�yl�d +); + +108 + `mosqu�to__� +( +msg +); + +109 + } +} + +111 + $mosqu�to_mes�ge_�_cڋ�s +( +mosqu�to_mes�ge + * +mes�ge +) + +113 if(! +mes�ge +) ; + +115 + `mosqu�to__� +( +mes�ge +-> +t�ic +); + +116 + `mosqu�to__� +( +mes�ge +-> +�yl�d +); + +117 + } +} + +119 + $mes�ge__queue +( +mosqu�to + * +mosq +, +mosqu�to_mes�ge_�l + * +mes�ge +, +mosqu�to_msg_d�e�i� + +d� +) + +122 + `as�� +( +mosq +); + +123 + `as�� +( +mes�ge +); + +124 + `as�� +( +mes�ge +-> +msg +. +qos + != 0); + +126 if( +d� + =� +mosq_md_out +){ + +127 + `DL_APPEND +( +mosq +-> +msgs_out +. +��ight +, +mes�ge +); + +128 +mosq +-> +msgs_out +. +queue_�n +++; + +130 + `DL_APPEND +( +mosq +-> +msgs_� +. +��ight +, +mes�ge +); + +131 +mosq +-> +msgs_� +. +queue_�n +++; + +134 + `mes�ge__��a�_to_��ight +( +mosq +, +d� +); + +135 + } +} + +137 + $mes�ge__�c���_��t +( +mosqu�to + * +mosq +) + +139 +mosqu�to_mes�ge_�l + * +mes�ge +, * +tmp +; + +140 + `as�� +( +mosq +); + +142 + `�h�ad_mu�x_lock +(& +mosq +-> +msgs_� +. +mu�x +); + +143 +mosq +-> +msgs_� +. +��ight_qu�a + = mosq->msgs_�. +��ight_maximum +; + +144 +mosq +-> +msgs_� +. +queue_�n + = 0; + +145 + `DL_FOREACH_SAFE +( +mosq +-> +msgs_� +. +��ight +, +mes�ge +, +tmp +){ + +146 +mosq +-> +msgs_� +. +queue_�n +++; + +147 +mes�ge +-> +time�amp + = 0; + +148 if( +mes�ge +-> +msg +. +qos + != 2){ + +149 + `DL_DELETE +( +mosq +-> +msgs_� +. +��ight +, +mes�ge +); + +150 + `mes�ge__��nup +(& +mes�ge +); + +154 + `ut�__de�em�t_��ive_qu�a +( +mosq +); + +157 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgs_� +. +mu�x +); + +160 + `�h�ad_mu�x_lock +(& +mosq +-> +msgs_out +. +mu�x +); + +161 +mosq +-> +msgs_out +. +��ight_qu�a + = mosq->msgs_out. +��ight_maximum +; + +162 +mosq +-> +msgs_out +. +queue_�n + = 0; + +163 + `DL_FOREACH_SAFE +( +mosq +-> +msgs_out +. +��ight +, +mes�ge +, +tmp +){ + +164 +mosq +-> +msgs_out +. +queue_�n +++; + +166 +mes�ge +-> +time�amp + = 0; + +167 if( +mosq +-> +msgs_out +. +��ight_qu�a + != 0){ + +168 + `ut�__de�em�t_�nd_qu�a +( +mosq +); + +169 if( +mes�ge +-> +msg +. +qos + == 1){ + +170 +mes�ge +-> +��e + = +mosq_ms_publish_qos1 +; + +171 }if( +mes�ge +-> +msg +. +qos + == 2){ + +172 if( +mes�ge +-> +��e + =� +mosq_ms_wa�_f�_pub�c +){ + +173 +mes�ge +-> +��e + = +mosq_ms_publish_qos2 +; + +174 }if( +mes�ge +-> +��e + =� +mosq_ms_wa�_f�_pubcomp +){ + +175 +mes�ge +-> +��e + = +mosq_ms_��nd_pub�l +; + +180 +mes�ge +-> +��e + = +mosq_ms_�v�id +; + +183 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgs_out +. +mu�x +); + +184 + } +} + +187 + $mes�ge__��a�_to_��ight +( +mosqu�to + * +mosq +, +mosqu�to_msg_d�e�i� + +d� +) + +190 +mosqu�to_mes�ge_�l + * +cur +, * +tmp +; + +191 +rc + = +MOSQ_ERR_SUCCESS +; + +193 if( +d� + =� +mosq_md_out +){ + +194 + `DL_FOREACH_SAFE +( +mosq +-> +msgs_out +. +��ight +, +cur +, +tmp +){ + +195 if( +mosq +-> +msgs_out +. +��ight_qu�a + > 0){ + +196 if( +cur +-> +msg +. +qos + > 0 && cur-> +��e + =� +mosq_ms_�v�id +){ + +197 if( +cur +-> +msg +. +qos + == 1){ + +198 +cur +-> +��e + = +mosq_ms_wa�_f�_puback +; + +199 }if( +cur +-> +msg +. +qos + == 2){ + +200 +cur +-> +��e + = +mosq_ms_wa�_f�_pub�c +; + +202 +rc + = + `�nd__publish +( +mosq +, +cur +-> +msg +. +mid +, cur->msg. +t�ic +, cur->msg. +�yl�d�n +, cur->msg. +�yl�d +, cur->msg. +qos +, cur->msg. +��� +, cur-> +dup +, +NULL +, NULL, 0); + +203 if( +rc +){ + +204 +rc +; + +206 + `ut�__de�em�t_�nd_qu�a +( +mosq +); + +209 +MOSQ_ERR_SUCCESS +; + +214 +rc +; + +215 + } +} + +218 + $mes�ge__�move +( +mosqu�to + * +mosq +, +u�t16_t + +mid +, +mosqu�to_msg_d�e�i� + +d� +, +mosqu�to_mes�ge_�l + ** +mes�ge +, +qos +) + +220 +mosqu�to_mes�ge_�l + * +cur +, * +tmp +; + +221 +bo� + +found + = +�l� +; + +222 + `as�� +( +mosq +); + +223 + `as�� +( +mes�ge +); + +225 if( +d� + =� +mosq_md_out +){ + +226 + `�h�ad_mu�x_lock +(& +mosq +-> +msgs_out +. +mu�x +); + +228 + `DL_FOREACH_SAFE +( +mosq +-> +msgs_out +. +��ight +, +cur +, +tmp +){ + +229 if( +found + =� +�l� + && +cur +-> +msg +. +mid + == mid){ + +230 if( +cur +-> +msg +. +qos + != qos){ + +231 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgs_out +. +mu�x +); + +232 +MOSQ_ERR_PROTOCOL +; + +234 + `DL_DELETE +( +mosq +-> +msgs_out +. +��ight +, +cur +); + +236 * +mes�ge + = +cur +; + +237 +mosq +-> +msgs_out +. +queue_�n +--; + +238 +found + = +�ue +; + +242 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgs_out +. +mu�x +); + +243 if( +found +){ + +244 +MOSQ_ERR_SUCCESS +; + +246 +MOSQ_ERR_NOT_FOUND +; + +249 + `�h�ad_mu�x_lock +(& +mosq +-> +msgs_� +. +mu�x +); + +250 + `DL_FOREACH_SAFE +( +mosq +-> +msgs_� +. +��ight +, +cur +, +tmp +){ + +251 if( +cur +-> +msg +. +mid + == mid){ + +252 if( +cur +-> +msg +. +qos + != qos){ + +253 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgs_� +. +mu�x +); + +254 +MOSQ_ERR_PROTOCOL +; + +256 + `DL_DELETE +( +mosq +-> +msgs_� +. +��ight +, +cur +); + +257 * +mes�ge + = +cur +; + +258 +mosq +-> +msgs_� +. +queue_�n +--; + +259 +found + = +�ue +; + +264 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgs_� +. +mu�x +); + +265 if( +found +){ + +266 +MOSQ_ERR_SUCCESS +; + +268 +MOSQ_ERR_NOT_FOUND +; + +271 + } +} + +273 + $mes�ge__��y_check +( +mosqu�to + * +mosq +) + +275 +mosqu�to_mes�ge_�l + * +msg +; + +276 +time_t + +now + = + `mosqu�to_time +(); + +277 + `as�� +( +mosq +); + +279 #ifde� +WITH_THREADING + + +280 + `�h�ad_mu�x_lock +(& +mosq +-> +msgs_out +. +mu�x +); + +283 + `DL_FOREACH +( +mosq +-> +msgs_out +. +��ight +, +msg +){ + +284 +msg +-> +��e +){ + +285 +mosq_ms_publish_qos1 +: + +286 +mosq_ms_publish_qos2 +: + +287 +msg +-> +time�amp + = +now +; + +288 +msg +-> +dup + = +�ue +; + +289 + `�nd__publish +( +mosq +, +msg +->msg. +mid +, msg->msg. +t�ic +, msg->msg. +�yl�d�n +, msg->msg. +�yl�d +, msg->msg. +qos +, msg->msg. +��� +, msg-> +dup +, +NULL +, NULL, 0); + +291 +mosq_ms_wa�_f�_pub�l +: + +292 +msg +-> +time�amp + = +now +; + +293 +msg +-> +dup + = +�ue +; + +294 + `�nd__pub�c +( +mosq +, +msg +->msg. +mid +, 0); + +296 +mosq_ms_��nd_pub�l +: + +297 +mosq_ms_wa�_f�_pubcomp +: + +298 +msg +-> +time�amp + = +now +; + +299 +msg +-> +dup + = +�ue +; + +300 + `�nd__pub�l +( +mosq +, +msg +->msg. +mid +); + +306 #ifde� +WITH_THREADING + + +307 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgs_out +. +mu�x +); + +309 + } +} + +312 + $mosqu�to_mes�ge_��y_�t +( +mosqu�to + * +mosq +, +mes�ge_��y +) + +314 + `UNUSED +( +mosq +); + +315 + `UNUSED +( +mes�ge_��y +); + +316 + } +} + +318 + $mes�ge__out_upd�e +( +mosqu�to + * +mosq +, +u�t16_t + +mid +, +mosqu�to_msg_��e + +��e +, +qos +) + +320 +mosqu�to_mes�ge_�l + * +mes�ge +, * +tmp +; + +321 + `as�� +( +mosq +); + +323 + `�h�ad_mu�x_lock +(& +mosq +-> +msgs_out +. +mu�x +); + +324 + `DL_FOREACH_SAFE +( +mosq +-> +msgs_out +. +��ight +, +mes�ge +, +tmp +){ + +325 if( +mes�ge +-> +msg +. +mid + == mid){ + +326 if( +mes�ge +-> +msg +. +qos + != qos){ + +327 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgs_out +. +mu�x +); + +328 +MOSQ_ERR_PROTOCOL +; + +330 +mes�ge +-> +��e + = state; + +331 +mes�ge +-> +time�amp + = + `mosqu�to_time +(); + +332 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgs_out +. +mu�x +); + +333 +MOSQ_ERR_SUCCESS +; + +336 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgs_out +. +mu�x +); + +337 +MOSQ_ERR_NOT_FOUND +; + +338 + } +} + +340 + $mosqu�to_max_��ight_mes�ges_�t +( +mosqu�to + * +mosq +, +max_��ight_mes�ges +) + +342 if(! +mosq +� +MOSQ_ERR_INVAL +; + +344 +mosq +-> +�nd_maximum + = +max_��ight_mes�ges +; + +346 +MOSQ_ERR_SUCCESS +; + +347 + } +} + + @lib/messages_mosq.h + +16 #i�de� +MESSAGES_MOSQ_H + + +17 + #MESSAGES_MOSQ_H + + + ) + +19 + ~"mosqu�to_����.h +" + +20 + ~"mosqu�to.h +" + +22 +mes�ge__��nup_�l +( +mosqu�to + * +mosq +); + +23 +mes�ge__��nup +( +mosqu�to_mes�ge_�l + ** +mes�ge +); + +24 +mes�ge__d��e +( +mosqu�to + * +mosq +, +u�t16_t + +mid +, +mosqu�to_msg_d�e�i� + +d� +, +qos +); + +25 +mes�ge__queue +( +mosqu�to + * +mosq +, +mosqu�to_mes�ge_�l + * +mes�ge +, +mosqu�to_msg_d�e�i� + +d� +); + +26 +mes�ge__�c���_��t +( +mosqu�to + * +mosq +); + +27 +mes�ge__��a�_to_��ight +( +mosqu�to + * +mosq +, +mosqu�to_msg_d�e�i� + +d� +); + +28 +mes�ge__�move +( +mosqu�to + * +mosq +, +u�t16_t + +mid +, +mosqu�to_msg_d�e�i� + +d� +, +mosqu�to_mes�ge_�l + ** +mes�ge +, +qos +); + +29 +mes�ge__��y_check +( +mosqu�to + * +mosq +); + +30 +mes�ge__out_upd�e +( +mosqu�to + * +mosq +, +u�t16_t + +mid +, +mosqu�to_msg_��e + +��e +, +qos +); + + @lib/mosquitto.c + +17 + ~"c�fig.h +" + +19 + ~<��o.h +> + +20 + ~<sig�l.h +> + +21 + ~<�r�g.h +> + +22 #i�de� +WIN32 + + +23 + ~<sys/time.h +> + +26 + ~"mosqu�to.h +" + +27 + ~"mosqu�to_����.h +" + +28 + ~"mem�y_mosq.h +" + +29 + ~"mes�ges_mosq.h +" + +30 + ~"mq�_��oc�.h +" + +31 + ~"�t_mosq.h +" + +32 + ~"�ck�_mosq.h +" + +33 + ~"w�l_mosq.h +" + +36 +mosqu�to__de�roy +( +mosqu�to + * +mosq +); + +38 + $mosqu�to_lib_v�si� +(* +maj� +, * +m�� +, * +�visi� +) + +40 if( +maj� +�*maj� = +LIBMOSQUITTO_MAJOR +; + +41 if( +m�� +�*m�� = +LIBMOSQUITTO_MINOR +; + +42 if( +�visi� +�*�visi� = +LIBMOSQUITTO_REVISION +; + +43 +LIBMOSQUITTO_VERSION_NUMBER +; + +44 + } +} + +46 + $mosqu�to_lib_�� +() + +48 #ifde� +WIN32 + + +49 + `��d +( + `G�TickCou�64 +()); + +50 #�i� +_POSIX_TIMERS +>0 && + `def�ed +( +_POSIX_MONOTONIC_CLOCK +) + +51 +time�ec + +� +; + +53 + `�ock_g�time +( +CLOCK_MONOTONIC +, & +� +); + +54 + `��d +( +� +. +tv_n�c +); + +55 #�i� + `def�ed +( +__APPLE__ +) + +56 +u�t64_t + +ticks +; + +58 +ticks + = + `mach_abs�u�_time +(); + +59 + `��d +(() +ticks +); + +61 +timev� + +tv +; + +63 + `g�timeofday +(& +tv +, +NULL +); + +64 + `��d +( +tv +. +tv_�c +*1000 +�v. +tv_u�c +/1000); + +67 + `�t__�� +(); + +68 + } +} + +70 + $mosqu�to_lib_��nup +() + +72 + `�t__��nup +(); + +74 +MOSQ_ERR_SUCCESS +; + +75 + } +} + +77 +mosqu�to + * + $mosqu�to_�w +(cڡ * +id +, +bo� + +��n_��t +, * +u�rd�a +) + +79 +mosqu�to + * +mosq + = +NULL +; + +80 +rc +; + +82 if( +��n_��t + =� +�l� + && +id + =� +NULL +){ + +83 +��o + = +EINVAL +; + +84 +NULL +; + +87 #i�de� +WIN32 + + +88 + `sig�l +( +SIGPIPE +, +SIG_IGN +); + +91 +mosq + = ( +mosqu�to + *) + `mosqu�to__��oc +(1, (mosquitto)); + +92 if( +mosq +){ + +93 +mosq +-> +sock + = +INVALID_SOCKET +; + +94 +mosq +-> +sock��R + = +INVALID_SOCKET +; + +95 +mosq +-> +sock��W + = +INVALID_SOCKET +; + +96 #ifde� +WITH_THREADING + + +97 +mosq +-> +th�ad_id + = + `�h�ad_�lf +(); + +99 +rc + = + `mosqu�to_����li� +( +mosq +, +id +, +��n_��t +, +u�rd�a +); + +100 if( +rc +){ + +101 + `mosqu�to_de�roy +( +mosq +); + +102 if( +rc + =� +MOSQ_ERR_INVAL +){ + +103 +��o + = +EINVAL +; + +104 }if( +rc + =� +MOSQ_ERR_NOMEM +){ + +105 +��o + = +ENOMEM +; + +107 +NULL +; + +110 +��o + = +ENOMEM +; + +112 +mosq +; + +113 + } +} + +115 + $mosqu�to_����li� +( +mosqu�to + * +mosq +, cڡ * +id +, +bo� + +��n_��t +, * +u�rd�a +) + +117 if(! +mosq +� +MOSQ_ERR_INVAL +; + +119 if( +��n_��t + =� +�l� + && +id + =� +NULL +){ + +120 +MOSQ_ERR_INVAL +; + +123 + `mosqu�to__de�roy +( +mosq +); + +124 + `mem�t +( +mosq +, 0, ( +mosqu�to +)); + +126 if( +u�rd�a +){ + +127 +mosq +-> +u�rd�a + = userdata; + +129 +mosq +-> +u�rd�a + = mosq; + +131 +mosq +-> +��oc� + = +mosq_p_mq�311 +; + +132 +mosq +-> +sock + = +INVALID_SOCKET +; + +133 +mosq +-> +sock��R + = +INVALID_SOCKET +; + +134 +mosq +-> +sock��W + = +INVALID_SOCKET +; + +135 +mosq +-> +k��live + = 60; + +136 +mosq +-> +��n_��t + = clean_start; + +137 if( +id +){ + +138 if( + `STREMPTY +( +id +)){ + +139 +MOSQ_ERR_INVAL +; + +141 if( + `mosqu�to_v�id�e_utf8 +( +id +, + `��� +(id))){ + +142 +MOSQ_ERR_MALFORMED_UTF8 +; + +144 +mosq +-> +id + = + `mosqu�to__�rdup +(id); + +146 +mosq +-> +�_�ck� +. +�yl�d + = +NULL +; + +147 + `�ck�__��nup +(& +mosq +-> +�_�ck� +); + +148 +mosq +-> +out_�ck� + = +NULL +; + +149 +mosq +-> +cu��t_out_�ck� + = +NULL +; + +150 +mosq +-> +ϡ_msg_� + = + `mosqu�to_time +(); + +151 +mosq +-> +�xt_msg_out + = + `mosqu�to_time +(�+ mosq-> +k��live +; + +152 +mosq +-> +p�g_t + = 0; + +153 +mosq +-> +ϡ_mid + = 0; + +154 +mosq +-> +��e + = +mosq_cs_�w +; + +155 +mosq +-> +maximum_qos + = 2; + +156 +mosq +-> +msgs_� +. +��ight_maximum + = 20; + +157 +mosq +-> +msgs_out +. +��ight_maximum + = 20; + +158 +mosq +-> +msgs_� +. +��ight_qu�a + = 20; + +159 +mosq +-> +msgs_out +. +��ight_qu�a + = 20; + +160 +mosq +-> +w�l + = +NULL +; + +161 +mosq +-> +�_c��� + = +NULL +; + +162 +mosq +-> +�_publish + = +NULL +; + +163 +mosq +-> +�_mes�ge + = +NULL +; + +164 +mosq +-> +�_subs�ibe + = +NULL +; + +165 +mosq +-> +�_unsubs�ibe + = +NULL +; + +166 +mosq +-> +ho� + = +NULL +; + +167 +mosq +-> +p�t + = 1883; + +168 +mosq +-> +�_��back + = +�l� +; + +169 +mosq +-> +�c���_d�ay + = 1; + +170 +mosq +-> +�c���_d�ay_max + = 1; + +171 +mosq +-> +�c���_expڒt�l_backoff + = +�l� +; + +172 +mosq +-> +th�aded + = +mosq_ts_n�e +; + +173 #ifde� +WITH_TLS + + +174 +mosq +-> +s� + = +NULL +; + +175 +mosq +-> +s�_�x + = +NULL +; + +176 +mosq +-> +�s_��_�qs + = +SSL_VERIFY_PEER +; + +177 +mosq +-> +�s_��cu� + = +�l� +; + +178 +mosq +-> +w�t_wr�e + = +�l� +; + +179 +mosq +-> +�s_oc�_�qu�ed + = +�l� +; + +181 #ifde� +WITH_THREADING + + +182 + `�h�ad_mu�x_�� +(& +mosq +-> +��back_mu�x +, +NULL +); + +183 + `�h�ad_mu�x_�� +(& +mosq +-> +log_��back_mu�x +, +NULL +); + +184 + `�h�ad_mu�x_�� +(& +mosq +-> +��e_mu�x +, +NULL +); + +185 + `�h�ad_mu�x_�� +(& +mosq +-> +out_�ck�_mu�x +, +NULL +); + +186 + `�h�ad_mu�x_�� +(& +mosq +-> +cu��t_out_�ck�_mu�x +, +NULL +); + +187 + `�h�ad_mu�x_�� +(& +mosq +-> +msgtime_mu�x +, +NULL +); + +188 + `�h�ad_mu�x_�� +(& +mosq +-> +msgs_� +. +mu�x +, +NULL +); + +189 + `�h�ad_mu�x_�� +(& +mosq +-> +msgs_out +. +mu�x +, +NULL +); + +190 + `�h�ad_mu�x_�� +(& +mosq +-> +mid_mu�x +, +NULL +); + +191 +mosq +-> +th�ad_id + = + `�h�ad_�lf +(); + +194 +MOSQ_ERR_SUCCESS +; + +195 + } +} + +198 + $mosqu�to__de�roy +( +mosqu�to + * +mosq +) + +200 +mosqu�to__�ck� + * +�ck� +; + +201 if(! +mosq +) ; + +203 #ifde� +WITH_THREADING + + +204 #ifde� +HAVE_PTHREAD_CANCEL + + +205 if( +mosq +-> +th�aded + =� +mosq_ts_�lf + && ! + `�h�ad_equ� +(mosq-> +th�ad_id +, + `�h�ad_�lf +())){ + +206 + `�h�ad_�n�l +( +mosq +-> +th�ad_id +); + +207 + `�h�ad_jo� +( +mosq +-> +th�ad_id +, +NULL +); + +208 +mosq +-> +th�aded + = +mosq_ts_n�e +; + +212 if( +mosq +-> +id +){ + +216 + `�h�ad_mu�x_de�roy +(& +mosq +-> +��back_mu�x +); + +217 + `�h�ad_mu�x_de�roy +(& +mosq +-> +log_��back_mu�x +); + +218 + `�h�ad_mu�x_de�roy +(& +mosq +-> +��e_mu�x +); + +219 + `�h�ad_mu�x_de�roy +(& +mosq +-> +out_�ck�_mu�x +); + +220 + `�h�ad_mu�x_de�roy +(& +mosq +-> +cu��t_out_�ck�_mu�x +); + +221 + `�h�ad_mu�x_de�roy +(& +mosq +-> +msgtime_mu�x +); + +222 + `�h�ad_mu�x_de�roy +(& +mosq +-> +msgs_� +. +mu�x +); + +223 + `�h�ad_mu�x_de�roy +(& +mosq +-> +msgs_out +. +mu�x +); + +224 + `�h�ad_mu�x_de�roy +(& +mosq +-> +mid_mu�x +); + +227 if( +mosq +-> +sock + !� +INVALID_SOCKET +){ + +228 + `�t__sock�_�o� +( +mosq +); + +230 + `mes�ge__��nup_�l +( +mosq +); + +231 + `w�l__��r +( +mosq +); + +232 #ifde� +WITH_TLS + + +233 if( +mosq +-> +s� +){ + +234 + `SSL_� +( +mosq +-> +s� +); + +236 if( +mosq +-> +s�_�x +){ + +237 + `SSL_CTX_� +( +mosq +-> +s�_�x +); + +239 + `mosqu�to__� +( +mosq +-> +�s_�f�e +); + +240 + `mosqu�to__� +( +mosq +-> +�s_��th +); + +241 + `mosqu�to__� +( +mosq +-> +�s_��f�e +); + +242 + `mosqu�to__� +( +mosq +-> +�s_keyf�e +); + +243 if( +mosq +-> +�s_pw_��back +�mosq->�s_pw_��back = +NULL +; + +244 + `mosqu�to__� +( +mosq +-> +�s_v�si� +); + +245 + `mosqu�to__� +( +mosq +-> +�s_c�h�s +); + +246 + `mosqu�to__� +( +mosq +-> +�s_psk +); + +247 + `mosqu�to__� +( +mosq +-> +�s_psk_id�t�y +); + +248 + `mosqu�to__� +( +mosq +-> +�s_�� +); + +251 + `mosqu�to__� +( +mosq +-> +add�ss +); + +252 +mosq +-> +add�ss + = +NULL +; + +254 + `mosqu�to__� +( +mosq +-> +id +); + +255 +mosq +-> +id + = +NULL +; + +257 + `mosqu�to__� +( +mosq +-> +u��ame +); + +258 +mosq +-> +u��ame + = +NULL +; + +260 + `mosqu�to__� +( +mosq +-> +�ssw�d +); + +261 +mosq +-> +�ssw�d + = +NULL +; + +263 + `mosqu�to__� +( +mosq +-> +ho� +); + +264 +mosq +-> +ho� + = +NULL +; + +266 + `mosqu�to__� +( +mosq +-> +b�d_add�ss +); + +267 +mosq +-> +b�d_add�ss + = +NULL +; + +270 if( +mosq +-> +out_�ck� + && !mosq-> +cu��t_out_�ck� +){ + +271 +mosq +-> +cu��t_out_�ck� + = mosq-> +out_�ck� +; + +272 +mosq +-> +out_�ck� + = mosq->out_�ck�-> +�xt +; + +274 +mosq +-> +cu��t_out_�ck� +){ + +275 +�ck� + = +mosq +-> +cu��t_out_�ck� +; + +277 +mosq +-> +cu��t_out_�ck� + = mosq-> +out_�ck� +; + +278 if( +mosq +-> +out_�ck� +){ + +279 +mosq +-> +out_�ck� + = mosq->out_�ck�-> +�xt +; + +282 + `�ck�__��nup +( +�ck� +); + +283 + `mosqu�to__� +( +�ck� +); + +286 + `�ck�__��nup +(& +mosq +-> +�_�ck� +); + +287 if( +mosq +-> +sock��R + !� +INVALID_SOCKET +){ + +288 + `COMPAT_CLOSE +( +mosq +-> +sock��R +); + +289 +mosq +-> +sock��R + = +INVALID_SOCKET +; + +291 if( +mosq +-> +sock��W + !� +INVALID_SOCKET +){ + +292 + `COMPAT_CLOSE +( +mosq +-> +sock��W +); + +293 +mosq +-> +sock��W + = +INVALID_SOCKET +; + +295 + } +} + +297 + $mosqu�to_de�roy +( +mosqu�to + * +mosq +) + +299 if(! +mosq +) ; + +301 + `mosqu�to__de�roy +( +mosq +); + +302 + `mosqu�to__� +( +mosq +); + +303 + } +} + +305 + $mosqu�to_sock� +( +mosqu�to + * +mosq +) + +307 if(! +mosq +� +INVALID_SOCKET +; + +308 +mosq +-> +sock +; + +309 + } +} + +312 +bo� + + $mosqu�to_w�t_wr�e +( +mosqu�to + * +mosq +) + +314 +bo� + +�su� + = +�l� +; + +315 if( +mosq +-> +out_�ck� + || mosq-> +cu��t_out_�ck� +){ + +316 +�su� + = +�ue +; + +318 #ifde� +WITH_TLS + + +319 if( +mosq +-> +s� +){ + +320 i�( +mosq +-> +w�t_wr�e +) { + +321 +�su� + = +�ue +; + +322 }if( +mosq +-> +w�t_c��� +){ + +323 +�su� + = +�l� +; + +327 +�su� +; + +328 + } +} + +331 cڡ * + $mosqu�to_���� +( +mosq_��o +) + +333 +mosq_��o +){ + +334 +MOSQ_ERR_AUTH_CONTINUE +: + +336 +MOSQ_ERR_NO_SUBSCRIBERS +: + +338 +MOSQ_ERR_SUB_EXISTS +: + +340 +MOSQ_ERR_CONN_PENDING +: + +342 +MOSQ_ERR_SUCCESS +: + +344 +MOSQ_ERR_NOMEM +: + +346 +MOSQ_ERR_PROTOCOL +: + +348 +MOSQ_ERR_INVAL +: + +350 +MOSQ_ERR_NO_CONN +: + +352 +MOSQ_ERR_CONN_REFUSED +: + +354 +MOSQ_ERR_NOT_FOUND +: + +356 +MOSQ_ERR_CONN_LOST +: + +358 +MOSQ_ERR_TLS +: + +360 +MOSQ_ERR_PAYLOAD_SIZE +: + +362 +MOSQ_ERR_NOT_SUPPORTED +: + +364 +MOSQ_ERR_AUTH +: + +366 +MOSQ_ERR_ACL_DENIED +: + +368 +MOSQ_ERR_UNKNOWN +: + +370 +MOSQ_ERR_ERRNO +: + +371 + `���� +( +��o +); + +372 +MOSQ_ERR_EAI +: + +374 +MOSQ_ERR_PROXY +: + +376 +MOSQ_ERR_MALFORMED_UTF8 +: + +378 +MOSQ_ERR_DUPLICATE_PROPERTY +: + +380 +MOSQ_ERR_TLS_HANDSHAKE +: + +382 +MOSQ_ERR_QOS_NOT_SUPPORTED +: + +384 +MOSQ_ERR_OVERSIZE_PACKET +: + +386 +MOSQ_ERR_OCSP +: + +391 + } +} + +393 cڡ * + $mosqu�to_c��ck_�r�g +( +c��ck_code +) + +395 +c��ck_code +){ + +411 + } +} + +413 cڡ * + $mosqu�to_�as�_�r�g +( +�as�_code +) + +415 +�as�_code +){ + +416 +MQTT_RC_SUCCESS +: + +418 +MQTT_RC_GRANTED_QOS1 +: + +420 +MQTT_RC_GRANTED_QOS2 +: + +422 +MQTT_RC_DISCONNECT_WITH_WILL_MSG +: + +424 +MQTT_RC_NO_MATCHING_SUBSCRIBERS +: + +426 +MQTT_RC_NO_SUBSCRIPTION_EXISTED +: + +428 +MQTT_RC_CONTINUE_AUTHENTICATION +: + +430 +MQTT_RC_REAUTHENTICATE +: + +433 +MQTT_RC_UNSPECIFIED +: + +435 +MQTT_RC_MALFORMED_PACKET +: + +437 +MQTT_RC_PROTOCOL_ERROR +: + +439 +MQTT_RC_IMPLEMENTATION_SPECIFIC +: + +441 +MQTT_RC_UNSUPPORTED_PROTOCOL_VERSION +: + +443 +MQTT_RC_CLIENTID_NOT_VALID +: + +445 +MQTT_RC_BAD_USERNAME_OR_PASSWORD +: + +447 +MQTT_RC_NOT_AUTHORIZED +: + +449 +MQTT_RC_SERVER_UNAVAILABLE +: + +451 +MQTT_RC_SERVER_BUSY +: + +453 +MQTT_RC_BANNED +: + +455 +MQTT_RC_SERVER_SHUTTING_DOWN +: + +457 +MQTT_RC_BAD_AUTHENTICATION_METHOD +: + +459 +MQTT_RC_KEEP_ALIVE_TIMEOUT +: + +461 +MQTT_RC_SESSION_TAKEN_OVER +: + +463 +MQTT_RC_TOPIC_FILTER_INVALID +: + +465 +MQTT_RC_TOPIC_NAME_INVALID +: + +467 +MQTT_RC_PACKET_ID_IN_USE +: + +469 +MQTT_RC_PACKET_ID_NOT_FOUND +: + +471 +MQTT_RC_RECEIVE_MAXIMUM_EXCEEDED +: + +473 +MQTT_RC_TOPIC_ALIAS_INVALID +: + +475 +MQTT_RC_PACKET_TOO_LARGE +: + +477 +MQTT_RC_MESSAGE_RATE_TOO_HIGH +: + +479 +MQTT_RC_QUOTA_EXCEEDED +: + +481 +MQTT_RC_ADMINISTRATIVE_ACTION +: + +483 +MQTT_RC_PAYLOAD_FORMAT_INVALID +: + +485 +MQTT_RC_RETAIN_NOT_SUPPORTED +: + +487 +MQTT_RC_QOS_NOT_SUPPORTED +: + +489 +MQTT_RC_USE_ANOTHER_SERVER +: + +491 +MQTT_RC_SERVER_MOVED +: + +493 +MQTT_RC_SHARED_SUBS_NOT_SUPPORTED +: + +495 +MQTT_RC_CONNECTION_RATE_EXCEEDED +: + +497 +MQTT_RC_MAXIMUM_CONNECT_TIME +: + +499 +MQTT_RC_SUBSCRIPTION_IDS_NOT_SUPPORTED +: + +501 +MQTT_RC_WILDCARD_SUBS_NOT_SUPPORTED +: + +506 + } +} + +509 + $mosqu�to_�r�g_to_comm�d +(cڡ * +�r +, * +cmd +) + +511 if(! + `�r��cmp +( +�r +, "connect")){ + +512 * +cmd + = +CMD_CONNECT +; + +513 }if(! + `�r��cmp +( +�r +, "connack")){ + +514 * +cmd + = +CMD_CONNACK +; + +515 }if(! + `�r��cmp +( +�r +, "publish")){ + +516 * +cmd + = +CMD_PUBLISH +; + +517 }if(! + `�r��cmp +( +�r +, "puback")){ + +518 * +cmd + = +CMD_PUBACK +; + +519 }if(! + `�r��cmp +( +�r +, "pubrec")){ + +520 * +cmd + = +CMD_PUBREC +; + +521 }if(! + `�r��cmp +( +�r +, "pubrel")){ + +522 * +cmd + = +CMD_PUBREL +; + +523 }if(! + `�r��cmp +( +�r +, "pubcomp")){ + +524 * +cmd + = +CMD_PUBCOMP +; + +525 }if(! + `�r��cmp +( +�r +, "subscribe")){ + +526 * +cmd + = +CMD_SUBSCRIBE +; + +527 }if(! + `�r��cmp +( +�r +, "unsubscribe")){ + +528 * +cmd + = +CMD_UNSUBSCRIBE +; + +529 }if(! + `�r��cmp +( +�r +, "disconnect")){ + +530 * +cmd + = +CMD_DISCONNECT +; + +531 }if(! + `�r��cmp +( +�r +, "auth")){ + +532 * +cmd + = +CMD_AUTH +; + +533 }if(! + `�r��cmp +( +�r +, "will")){ + +534 * +cmd + = +CMD_WILL +; + +536 +MOSQ_ERR_INVAL +; + +538 +MOSQ_ERR_SUCCESS +; + +539 + } +} + +542 + $mosqu�to_sub_t�ic_tok�i� +(cڡ * +subt�ic +, *** +t�ics +, * +cou� +) + +544 +�n +; + +545 +h�r_cou� + = 1; + +546 +��t +, +�� +; + +547 +h�r +; + +548 +�� +; + +549 +i +, +j +; + +551 if(! +subt�ic + || ! +t�ics + || ! +cou� +� +MOSQ_ERR_INVAL +; + +553 +�n + = + `��� +( +subt�ic +); + +555 +i +=0; i< +�n +; i++){ + +556 if( +subt�ic +[ +i +] == '/'){ + +557 if( +i + > +�n +-1){ + +560 +h�r_cou� +++; + +565 (* +t�ics +�� + `mosqu�to__��oc +( +h�r_cou� +, (*)); + +566 if(!(* +t�ics +)� +MOSQ_ERR_NOMEM +; + +568 +��t + = 0; + +569 +�� + = 0; + +570 +h�r + = 0; + +572 +i +=0; i< +�n ++1; i++){ + +573 if( +subt�ic +[ +i +] == '/' || subtopic[i] == '\0'){ + +574 +�� + = +i +; + +575 if( +��t + !� +�� +){ + +576 +�� + = +�� +- +��t + + 1; + +577 (* +t�ics +)[ +h�r +] = + `mosqu�to__��oc +( +�� +, ()); + +578 if(!(* +t�ics +)[ +h�r +]){ + +579 +j +=0; j< +h�r +; j++){ + +580 + `mosqu�to__� +((* +t�ics +)[ +j +]); + +582 + `mosqu�to__� +((* +t�ics +)); + +583 +MOSQ_ERR_NOMEM +; + +585 +j += +��t +; j< +�� +; j++){ + +586 (* +t�ics +)[ +h�r +][ +j +- +��t +] = +subt�ic +[j]; + +589 +��t + = +i ++1; + +590 +h�r +++; + +594 * +cou� + = +h�r_cou� +; + +596 +MOSQ_ERR_SUCCESS +; + +597 + } +} + +599 + $mosqu�to_sub_t�ic_tok�s_� +(*** +t�ics +, +cou� +) + +601 +i +; + +603 if(! +t�ics + || !(*t�ics�|| +cou� +<1� +MOSQ_ERR_INVAL +; + +605 +i +=0; i< +cou� +; i++){ + +606 + `mosqu�to__� +((* +t�ics +)[ +i +]); + +608 + `mosqu�to__� +(* +t�ics +); + +610 +MOSQ_ERR_SUCCESS +; + +611 + } +} + + @lib/mosquitto.h + +17 #i�de� +MOSQUITTO_H + + +18 + #MOSQUITTO_H + + + ) + +20 #ifde� +__�lu�lus + + +24 #i� +def�ed +( +WIN32 +�&& !def�ed( +WITH_BROKER +�&& !def�ed( +LIBMOSQUITTO_STATIC +) + +25 #ifde� +libmosqu�to_EXPORTS + + +26 + #libmosq_EXPORT + + `__de��ec +( +d�exp�t +) + + ) + +28 + #libmosq_EXPORT + + `__de��ec +( +d�imp�t +) + + ) + +31 + #libmosq_EXPORT + + + ) + +34 #i� +def�ed +( +_MSC_VER +) && _MSC_VER < 1900 + +35 #i�de� +__�lu�lus + + +36 + #bo� + + + ) + +37 + #�ue + 1 + + ) + +38 + #�l� + 0 + + ) + +41 #i�de� +__�lu�lus + + +42 + ~<�dbo�.h +> + +46 + ~<�ddef.h +> + +47 + ~<�d�t.h +> + +49 + #LIBMOSQUITTO_MAJOR + 1 + + ) + +50 + #LIBMOSQUITTO_MINOR + 6 + + ) + +51 + #LIBMOSQUITTO_REVISION + 3 + + ) + +53 + #LIBMOSQUITTO_VERSION_NUMBER + ( +LIBMOSQUITTO_MAJOR +*1000000+ +LIBMOSQUITTO_MINOR +*1000+ +LIBMOSQUITTO_REVISION +) + + ) + +56 + #MOSQ_LOG_NONE + 0 + + ) + +57 + #MOSQ_LOG_INFO + (1<<0) + + ) + +58 + #MOSQ_LOG_NOTICE + (1<<1) + + ) + +59 + #MOSQ_LOG_WARNING + (1<<2) + + ) + +60 + #MOSQ_LOG_ERR + (1<<3) + + ) + +61 + #MOSQ_LOG_DEBUG + (1<<4) + + ) + +62 + #MOSQ_LOG_SUBSCRIBE + (1<<5) + + ) + +63 + #MOSQ_LOG_UNSUBSCRIBE + (1<<6) + + ) + +64 + #MOSQ_LOG_WEBSOCKETS + (1<<7) + + ) + +65 + #MOSQ_LOG_INTERNAL + 0x80000000 + + ) + +66 + #MOSQ_LOG_ALL + 0x7FFFFFFF + + ) + +69 + emosq_�r_t + { + +70 +MOSQ_ERR_AUTH_CONTINUE + = -4, + +71 +MOSQ_ERR_NO_SUBSCRIBERS + = -3, + +72 +MOSQ_ERR_SUB_EXISTS + = -2, + +73 +MOSQ_ERR_CONN_PENDING + = -1, + +74 +MOSQ_ERR_SUCCESS + = 0, + +75 +MOSQ_ERR_NOMEM + = 1, + +76 +MOSQ_ERR_PROTOCOL + = 2, + +77 +MOSQ_ERR_INVAL + = 3, + +78 +MOSQ_ERR_NO_CONN + = 4, + +79 +MOSQ_ERR_CONN_REFUSED + = 5, + +80 +MOSQ_ERR_NOT_FOUND + = 6, + +81 +MOSQ_ERR_CONN_LOST + = 7, + +82 +MOSQ_ERR_TLS + = 8, + +83 +MOSQ_ERR_PAYLOAD_SIZE + = 9, + +84 +MOSQ_ERR_NOT_SUPPORTED + = 10, + +85 +MOSQ_ERR_AUTH + = 11, + +86 +MOSQ_ERR_ACL_DENIED + = 12, + +87 +MOSQ_ERR_UNKNOWN + = 13, + +88 +MOSQ_ERR_ERRNO + = 14, + +89 +MOSQ_ERR_EAI + = 15, + +90 +MOSQ_ERR_PROXY + = 16, + +91 +MOSQ_ERR_PLUGIN_DEFER + = 17, + +92 +MOSQ_ERR_MALFORMED_UTF8 + = 18, + +93 +MOSQ_ERR_KEEPALIVE + = 19, + +94 +MOSQ_ERR_LOOKUP + = 20, + +95 +MOSQ_ERR_MALFORMED_PACKET + = 21, + +96 +MOSQ_ERR_DUPLICATE_PROPERTY + = 22, + +97 +MOSQ_ERR_TLS_HANDSHAKE + = 23, + +98 +MOSQ_ERR_QOS_NOT_SUPPORTED + = 24, + +99 +MOSQ_ERR_OVERSIZE_PACKET + = 25, + +100 +MOSQ_ERR_OCSP + = 26, + +104 + emosq_�t_t + { + +105 +MOSQ_OPT_PROTOCOL_VERSION + = 1, + +106 +MOSQ_OPT_SSL_CTX + = 2, + +107 +MOSQ_OPT_SSL_CTX_WITH_DEFAULTS + = 3, + +108 +MOSQ_OPT_RECEIVE_MAXIMUM + = 4, + +109 +MOSQ_OPT_SEND_MAXIMUM + = 5, + +110 +MOSQ_OPT_TLS_KEYFORM + = 6, + +111 +MOSQ_OPT_TLS_ENGINE + = 7, + +112 +MOSQ_OPT_TLS_ENGINE_KPASS_SHA1 + = 8, + +113 +MOSQ_OPT_TLS_OCSP_REQUIRED + = 9, + +114 +MOSQ_OPT_TLS_ALPN + = 10, + +119 + #MOSQ_MQTT_ID_MAX_LENGTH + 23 + + ) + +121 + #MQTT_PROTOCOL_V31 + 3 + + ) + +122 + #MQTT_PROTOCOL_V311 + 4 + + ) + +123 + #MQTT_PROTOCOL_V5 + 5 + + ) + +125 + smosqu�to_mes�ge +{ + +126 +mid +; + +127 * +t�ic +; + +128 * +�yl�d +; + +129 +�yl�d�n +; + +130 +qos +; + +131 +bo� + +��� +; + +134 +mosqu�to +; + +135 +mq�5__�ݔty + + tmosqu�to_�ݔty +; + +195 +libmosq_EXPORT + +mosqu�to_lib_v�si� +(* +maj� +, * +m�� +, * +�visi� +); + +210 +libmosq_EXPORT + +mosqu�to_lib_�� +(); + +223 +libmosq_EXPORT + +mosqu�to_lib_��nup +(); + +260 +libmosq_EXPORT + +mosqu�to + * +mosqu�to_�w +(cڡ * +id +, +bo� + +��n_�ssi� +, * +obj +); + +273 +libmosq_EXPORT + +mosqu�to_de�roy +( +mosqu�to + * +mosq +); + +302 +libmosq_EXPORT + +mosqu�to_����li� +( +mosqu�to + * +mosq +, cڡ * +id +, +bo� + +��n_�ssi� +, * +obj +); + +334 +libmosq_EXPORT + +mosqu�to_w�l_�t +( +mosqu�to + * +mosq +, cڡ * +t�ic +, +�yl�d�n +, cڡ * +�yl�d +, +qos +, +bo� + +��� +); + +369 +libmosq_EXPORT + +mosqu�to_w�l_�t_v5 +( +mosqu�to + * +mosq +, cڡ * +t�ic +, +�yl�d�n +, cڡ * +�yl�d +, +qos +, +bo� + +��� +, +mosqu�to_�ݔty + * +�ݔt�s +); + +384 +libmosq_EXPORT + +mosqu�to_w�l_��r +( +mosqu�to + * +mosq +); + +415 +libmosq_EXPORT + +mosqu�to_u��ame_pw_�t +( +mosqu�to + * +mosq +, cڡ * +u��ame +, cڡ * +�ssw�d +); + +447 +libmosq_EXPORT + +mosqu�to_c��� +( +mosqu�to + * +mosq +, cڡ * +ho� +, +p�t +, +k��live +); + +477 +libmosq_EXPORT + +mosqu�to_c���_b�d +( +mosqu�to + * +mosq +, cڡ * +ho� +, +p�t +, +k��live +, cڡ * +b�d_add�ss +); + +510 +libmosq_EXPORT + +mosqu�to_c���_b�d_v5 +( +mosqu�to + * +mosq +, cڡ * +ho� +, +p�t +, +k��live +, cڡ * +b�d_add�ss +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +); + +541 +libmosq_EXPORT + +mosqu�to_c���_async +( +mosqu�to + * +mosq +, cڡ * +ho� +, +p�t +, +k��live +); + +578 +libmosq_EXPORT + +mosqu�to_c���_b�d_async +( +mosqu�to + * +mosq +, cڡ * +ho� +, +p�t +, +k��live +, cڡ * +b�d_add�ss +); + +614 +libmosq_EXPORT + +mosqu�to_c���_�v +( +mosqu�to + * +mosq +, cڡ * +ho� +, +k��live +, cڡ * +b�d_add�ss +); + +645 +libmosq_EXPORT + +mosqu�to_�c��� +( +mosqu�to + * +mosq +); + +676 +libmosq_EXPORT + +mosqu�to_�c���_async +( +mosqu�to + * +mosq +); + +691 +libmosq_EXPORT + +mosqu�to_disc��� +( +mosqu�to + * +mosq +); + +714 +libmosq_EXPORT + +mosqu�to_disc���_v5 +( +mosqu�to + * +mosq +, +�as�_code +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +); + +762 +libmosq_EXPORT + +mosqu�to_publish +( +mosqu�to + * +mosq +, * +mid +, cڡ * +t�ic +, +�yl�d�n +, cڡ * +�yl�d +, +qos +, +bo� + +��� +); + +811 +libmosq_EXPORT + +mosqu�to_publish_v5 +( + +812 +mosqu�to + * +mosq +, + +813 * +mid +, + +814 cڡ * +t�ic +, + +815 +�yl�d�n +, + +816 cڡ * +�yl�d +, + +817 +qos +, + +818 +bo� + +��� +, + +819 cڡ +mosqu�to_�ݔty + * +�ݔt�s +); + +845 +libmosq_EXPORT + +mosqu�to_subs�ibe +( +mosqu�to + * +mosq +, * +mid +, cڡ * +sub +, +qos +); + +904 +libmosq_EXPORT + +mosqu�to_subs�ibe_v5 +( +mosqu�to + * +mosq +, * +mid +, cڡ * +sub +, +qos +, +�ti�s +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +); + +960 +libmosq_EXPORT + +mosqu�to_subs�ibe_muɝ� +( +mosqu�to + * +mosq +, * +mid +, +sub_cou� +, *cڡ *cڡ +sub +, +qos +, +�ti�s +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +); + +984 +libmosq_EXPORT + +mosqu�to_unsubs�ibe +( +mosqu�to + * +mosq +, * +mid +, cڡ * +sub +); + +1012 +libmosq_EXPORT + +mosqu�to_unsubs�ibe_v5 +( +mosqu�to + * +mosq +, * +mid +, cڡ * +sub +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +); + +1043 +libmosq_EXPORT + +mosqu�to_unsubs�ibe_muɝ� +( +mosqu�to + * +mosq +, * +mid +, +sub_cou� +, *cڡ *cڡ +sub +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +); + +1069 +libmosq_EXPORT + +mosqu�to_mes�ge_c�y +( +mosqu�to_mes�ge + * +d� +, cڡ mosqu�to_mes�g�* +�c +); + +1082 +libmosq_EXPORT + +mosqu�to_mes�ge_� +( +mosqu�to_mes�ge + ** +mes�ge +); + +1095 +libmosq_EXPORT + +mosqu�to_mes�ge_�_cڋ�s +( +mosqu�to_mes�ge + * +mes�ge +); + +1147 +libmosq_EXPORT + +mosqu�to_lo� +( +mosqu�to + * +mosq +, +timeout +, +max_�ck�s +); + +1183 +libmosq_EXPORT + +mosqu�to_lo�_f�ev� +( +mosqu�to + * +mosq +, +timeout +, +max_�ck�s +); + +1203 +libmosq_EXPORT + +mosqu�to_lo�_��t +( +mosqu�to + * +mosq +); + +1227 +libmosq_EXPORT + +mosqu�to_lo�_�� +( +mosqu�to + * +mosq +, +bo� + +f�� +); + +1263 +libmosq_EXPORT + +mosqu�to_lo�_�ad +( +mosqu�to + * +mosq +, +max_�ck�s +); + +1293 +libmosq_EXPORT + +mosqu�to_lo�_wr�e +( +mosqu�to + * +mosq +, +max_�ck�s +); + +1316 +libmosq_EXPORT + +mosqu�to_lo�_misc +( +mosqu�to + * +mosq +); + +1336 +libmosq_EXPORT + +mosqu�to_sock� +( +mosqu�to + * +mosq +); + +1349 +libmosq_EXPORT + +bo� + +mosqu�to_w�t_wr�e +( +mosqu�to + * +mosq +); + +1366 +libmosq_EXPORT + +mosqu�to_th�aded_�t +( +mosqu�to + * +mosq +, +bo� + +th�aded +); + +1412 +libmosq_EXPORT + +mosqu�to_�ts_�t +( +mosqu�to + * +mosq +, +mosq_�t_t + +�ti� +, * +v�ue +); + +1462 +libmosq_EXPORT + +mosqu�to_�t_�ti� +( +mosqu�to + * +mosq +, +mosq_�t_t + +�ti� +, +v�ue +); + +1485 +libmosq_EXPORT + +mosqu�to_void_�ti� +( +mosqu�to + * +mosq +, +mosq_�t_t + +�ti� +, * +v�ue +); + +1523 +libmosq_EXPORT + +mosqu�to_�c���_d�ay_�t +( +mosqu�to + * +mosq +, +�c���_d�ay +, +�c���_d�ay_max +, +bo� + +�c���_expڒt�l_backoff +); + +1551 +libmosq_EXPORT + +mosqu�to_max_��ight_mes�ges_�t +( +mosqu�to + * +mosq +, +max_��ight_mes�ges +); + +1558 +libmosq_EXPORT + +mosqu�to_mes�ge_��y_�t +( +mosqu�to + * +mosq +, +mes�ge_��y +); + +1574 +libmosq_EXPORT + +mosqu�to_u�r_d�a_�t +( +mosqu�to + * +mosq +, * +obj +); + +1586 +libmosq_EXPORT + * +mosqu�to_u�rd�a +( +mosqu�to + * +mosq +); + +1642 +libmosq_EXPORT + +mosqu�to_�s_�t +( +mosqu�to + * +mosq +, + +1643 cڡ * +�f�e +, cڡ * +��th +, + +1644 cڡ * +��f�e +, cڡ * +keyf�e +, + +1645 (* +pw_��back +)(* +buf +, +size +, +rw�ag +, * +u�rd�a +)); + +1672 +libmosq_EXPORT + +mosqu�to_�s_��cu�_�t +( +mosqu�to + * +mosq +, +bo� + +v�ue +); + +1706 +libmosq_EXPORT + +mosqu�to_�s_�ts_�t +( +mosqu�to + * +mosq +, +��_�qs +, cڡ * +�s_v�si� +, cڡ * +c�h�s +); + +1733 +libmosq_EXPORT + +mosqu�to_�s_psk_�t +( +mosqu�to + * +mosq +, cڡ * +psk +, cڡ * +id�t�y +, cڡ * +c�h�s +); + +1763 +libmosq_EXPORT + +mosqu�to_c���_��back_�t +( +mosqu�to + * +mosq +, (* +�_c��� +)(mosquitto *, *, )); + +1788 +libmosq_EXPORT + +mosqu�to_c���_w�h_�ags_��back_�t +( +mosqu�to + * +mosq +, (* +�_c��� +)(mosquitto *, *, , )); + +1814 +libmosq_EXPORT + +mosqu�to_c���_v5_��back_�t +( +mosqu�to + * +mosq +, (* +�_c��� +)(mosqu�t�*, *, , , cڡ +mosqu�to_�ݔty + * +��s +)); + +1834 +libmosq_EXPORT + +mosqu�to_disc���_��back_�t +( +mosqu�to + * +mosq +, (* +�_disc��� +)(mosquitto *, *, )); + +1855 +libmosq_EXPORT + +mosqu�to_disc���_v5_��back_�t +( +mosqu�to + * +mosq +, (* +�_disc��� +)(mosqu�t�*, *, , cڡ +mosqu�to_�ݔty + *)); + +1873 +libmosq_EXPORT + +mosqu�to_publish_��back_�t +( +mosqu�to + * +mosq +, (* +�_publish +)(mosquitto *, *, )); + +1895 +libmosq_EXPORT + +mosqu�to_publish_v5_��back_�t +( +mosqu�to + * +mosq +, (* +�_publish +)(mosqu�t�*, *, , , cڡ +mosqu�to_�ݔty + *)); + +1918 +libmosq_EXPORT + +mosqu�to_mes�ge_��back_�t +( +mosqu�to + * +mosq +, (* +�_mes�ge +)(mosqu�t�*, *, cڡ +mosqu�to_mes�ge + *)); + +1942 +libmosq_EXPORT + +mosqu�to_mes�ge_v5_��back_�t +( +mosqu�to + * +mosq +, (* +�_mes�ge +)(mosqu�t�*, *, cڡ +mosqu�to_mes�ge + *, cڡ +mosqu�to_�ݔty + *)); + +1963 +libmosq_EXPORT + +mosqu�to_subs�ibe_��back_�t +( +mosqu�to + * +mosq +, (* +�_subs�ibe +)(mosquitto *, *, , , const *)); + +1985 +libmosq_EXPORT + +mosqu�to_subs�ibe_v5_��back_�t +( +mosqu�to + * +mosq +, (* +�_subs�ibe +)(mosqu�t�*, *, , , cڡ *, cڡ +mosqu�to_�ݔty + *)); + +2003 +libmosq_EXPORT + +mosqu�to_unsubs�ibe_��back_�t +( +mosqu�to + * +mosq +, (* +�_unsubs�ibe +)(mosquitto *, *, )); + +2022 +libmosq_EXPORT + +mosqu�to_unsubs�ibe_v5_��back_�t +( +mosqu�to + * +mosq +, (* +�_unsubs�ibe +)(mosqu�t�*, *, , cڡ +mosqu�to_�ݔty + *)); + +2045 +libmosq_EXPORT + +mosqu�to_log_��back_�t +( +mosqu�to + * +mosq +, (* +�_log +)(mosquitto *, *, , const *)); + +2078 +libmosq_EXPORT + +mosqu�to_�r�g_�ti� +( +mosqu�to + * +mosq +, +mosq_�t_t + +�ti� +, cڡ * +v�ue +); + +2116 +libmosq_EXPORT + +mosqu�to_�c���_d�ay_�t +( +mosqu�to + * +mosq +, +�c���_d�ay +, +�c���_d�ay_max +, +bo� + +�c���_expڒt�l_backoff +); + +2141 +libmosq_EXPORT + +mosqu�to_socks5_�t +( +mosqu�to + * +mosq +, cڡ * +ho� +, +p�t +, cڡ * +u��ame +, cڡ * +�ssw�d +); + +2162 +libmosq_EXPORT + cڡ * +mosqu�to_���� +( +mosq_��o +); + +2175 +libmosq_EXPORT + cڡ * +mosqu�to_c��ck_�r�g +( +c��ck_code +); + +2188 +libmosq_EXPORT + cڡ * +mosqu�to_�as�_�r�g +( +�as�_code +); + +2207 +libmosq_EXPORT + +mosqu�to_�r�g_to_comm�d +(cڡ * +�r +, * +cmd +); + +2263 +libmosq_EXPORT + +mosqu�to_sub_t�ic_tok�i� +(cڡ * +subt�ic +, *** +t�ics +, * +cou� +); + +2281 +libmosq_EXPORT + +mosqu�to_sub_t�ic_tok�s_� +(*** +t�ics +, +cou� +); + +2307 +libmosq_EXPORT + +mosqu�to_t�ic_m�ches_sub +(cڡ * +sub +, cڡ * +t�ic +, +bo� + * +�su� +); + +2308 +libmosq_EXPORT + +mosqu�to_t�ic_m�ches_sub2 +(cڡ * +sub +, +size_t + +sub�n +, cڡ * +t�ic +, size_� +t�i�� +, +bo� + * +�su� +); + +2334 +libmosq_EXPORT + +mosqu�to_pub_t�ic_check +(cڡ * +t�ic +); + +2335 +libmosq_EXPORT + +mosqu�to_pub_t�ic_check2 +(cڡ * +t�ic +, +size_t + +t�i�� +); + +2364 +libmosq_EXPORT + +mosqu�to_sub_t�ic_check +(cڡ * +t�ic +); + +2365 +libmosq_EXPORT + +mosqu�to_sub_t�ic_check2 +(cڡ * +t�ic +, +size_t + +t�i�� +); + +2368 + slibmosqu�to_w�l + { + +2369 * +t�ic +; + +2370 * +�yl�d +; + +2371 +�yl�d�n +; + +2372 +qos +; + +2373 +bo� + +��� +; + +2376 + slibmosqu�to_auth + { + +2377 * +u��ame +; + +2378 * +�ssw�d +; + +2381 + slibmosqu�to_�s + { + +2382 * +�f�e +; + +2383 * +��th +; + +2384 * +��f�e +; + +2385 * +keyf�e +; + +2386 * +c�h�s +; + +2387 * +�s_v�si� +; + +2388 (* +pw_��back +)(* +buf +, +size +, +rw�ag +, * +u�rd�a +); + +2389 +��_�qs +; + +2429 +libmosq_EXPORT + +mosqu�to_subs�ibe_sim�e +( + +2430 +mosqu�to_mes�ge + ** +mes�ges +, + +2431 +msg_cou� +, + +2432 +bo� + +w�t_���ed +, + +2433 cڡ * +t�ic +, + +2434 +qos +, + +2435 cڡ * +ho� +, + +2436 +p�t +, + +2437 cڡ * +���_id +, + +2438 +k��live +, + +2439 +bo� + +��n_�ssi� +, + +2440 cڡ * +u��ame +, + +2441 cڡ * +�ssw�d +, + +2442 cڡ +libmosqu�to_w�l + * +w�l +, + +2443 cڡ +libmosqu�to_�s + * +�s +); + +2482 +libmosq_EXPORT + +mosqu�to_subs�ibe_��back +( + +2483 (* +��back +)( +mosqu�to + *, *, cڡ +mosqu�to_mes�ge + *), + +2484 * +u�rd�a +, + +2485 cڡ * +t�ic +, + +2486 +qos +, + +2487 cڡ * +ho� +, + +2488 +p�t +, + +2489 cڡ * +���_id +, + +2490 +k��live +, + +2491 +bo� + +��n_�ssi� +, + +2492 cڡ * +u��ame +, + +2493 cڡ * +�ssw�d +, + +2494 cڡ +libmosqu�to_w�l + * +w�l +, + +2495 cڡ +libmosqu�to_�s + * +�s +); + +2513 +libmosq_EXPORT + +mosqu�to_v�id�e_utf8 +(cڡ * +�r +, +�n +); + +2546 +libmosq_EXPORT + +mosqu�to_�ݔty_add_by� +( +mosqu�to_�ݔty + ** +��li� +, +id�tif�r +, +u�t8_t + +v�ue +); + +2570 +libmosq_EXPORT + +mosqu�to_�ݔty_add_�t16 +( +mosqu�to_�ݔty + ** +��li� +, +id�tif�r +, +u�t16_t + +v�ue +); + +2594 +libmosq_EXPORT + +mosqu�to_�ݔty_add_�t32 +( +mosqu�to_�ݔty + ** +��li� +, +id�tif�r +, +u�t32_t + +v�ue +); + +2618 +libmosq_EXPORT + +mosqu�to_�ݔty_add_v��t +( +mosqu�to_�ݔty + ** +��li� +, +id�tif�r +, +u�t32_t + +v�ue +); + +2643 +libmosq_EXPORT + +mosqu�to_�ݔty_add_b��y +( +mosqu�to_�ݔty + ** +��li� +, +id�tif�r +, cڡ * +v�ue +, +u�t16_t + +�n +); + +2668 +libmosq_EXPORT + +mosqu�to_�ݔty_add_�r�g +( +mosqu�to_�ݔty + ** +��li� +, +id�tif�r +, cڡ * +v�ue +); + +2694 +libmosq_EXPORT + +mosqu�to_�ݔty_add_�r�g_�� +( +mosqu�to_�ݔty + ** +��li� +, +id�tif�r +, cڡ * +�me +, cڡ * +v�ue +); + +2731 +libmosq_EXPORT + cڡ +mosqu�to_�ݔty + * +mosqu�to_�ݔty_�ad_by� +( + +2732 cڡ +mosqu�to_�ݔty + * +��li� +, + +2733 +id�tif�r +, + +2734 +u�t8_t + * +v�ue +, + +2735 +bo� + +sk�_f�� +); + +2756 +libmosq_EXPORT + cڡ +mosqu�to_�ݔty + * +mosqu�to_�ݔty_�ad_�t16 +( + +2757 cڡ +mosqu�to_�ݔty + * +��li� +, + +2758 +id�tif�r +, + +2759 +u�t16_t + * +v�ue +, + +2760 +bo� + +sk�_f�� +); + +2781 +libmosq_EXPORT + cڡ +mosqu�to_�ݔty + * +mosqu�to_�ݔty_�ad_�t32 +( + +2782 cڡ +mosqu�to_�ݔty + * +��li� +, + +2783 +id�tif�r +, + +2784 +u�t32_t + * +v�ue +, + +2785 +bo� + +sk�_f�� +); + +2806 +libmosq_EXPORT + cڡ +mosqu�to_�ݔty + * +mosqu�to_�ݔty_�ad_v��t +( + +2807 cڡ +mosqu�to_�ݔty + * +��li� +, + +2808 +id�tif�r +, + +2809 +u�t32_t + * +v�ue +, + +2810 +bo� + +sk�_f�� +); + +2833 +libmosq_EXPORT + cڡ +mosqu�to_�ݔty + * +mosqu�to_�ݔty_�ad_b��y +( + +2834 cڡ +mosqu�to_�ݔty + * +��li� +, + +2835 +id�tif�r +, + +2836 ** +v�ue +, + +2837 +u�t16_t + * +�n +, + +2838 +bo� + +sk�_f�� +); + +2862 +libmosq_EXPORT + cڡ +mosqu�to_�ݔty + * +mosqu�to_�ݔty_�ad_�r�g +( + +2863 cڡ +mosqu�to_�ݔty + * +��li� +, + +2864 +id�tif�r +, + +2865 ** +v�ue +, + +2866 +bo� + +sk�_f�� +); + +2892 +libmosq_EXPORT + cڡ +mosqu�to_�ݔty + * +mosqu�to_�ݔty_�ad_�r�g_�� +( + +2893 cڡ +mosqu�to_�ݔty + * +��li� +, + +2894 +id�tif�r +, + +2895 ** +�me +, + +2896 ** +v�ue +, + +2897 +bo� + +sk�_f�� +); + +2912 +libmosq_EXPORT + +mosqu�to_�ݔty_�_�l +( +mosqu�to_�ݔty + ** +�ݔt�s +); + +2926 +libmosq_EXPORT + +mosqu�to_�ݔty_c�y_�l +( +mosqu�to_�ݔty + ** +de� +, cڡ mosqu�to_�ݔty * +�c +); + +2941 +libmosq_EXPORT + +mosqu�to_�ݔty_check_comm�d +( +comm�d +, +id�tif�r +); + +2964 +libmosq_EXPORT + +mosqu�to_�ݔty_check_�l +( +comm�d +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +); + +2986 +libmosq_EXPORT + +mosqu�to_�r�g_to_�ݔty_�fo +(cڡ * +���me +, * +id�tif�r +, * +ty� +); + +2989 #ifde� +__�lu�lus + + + @lib/mosquitto_internal.h + +18 #i�de� +MOSQUITTO_INTERNAL_H + + +19 + #MOSQUITTO_INTERNAL_H + + + ) + +21 + ~"c�fig.h +" + +23 #ifde� +WIN32 + + +24 + ~<w�sock2.h +> + +27 #ifde� +WITH_TLS + + +28 + ~<ݒs�/s�.h +> + +30 + ~<time.h +> + +32 + ~<�dlib.h +> + +34 #i� +def�ed +( +WITH_THREADING +�&& !def�ed( +WITH_BROKER +) + +35 + ~<�h�ad.h +> + +37 + ~<dummy�h�ad.h +> + +40 #ifde� +WITH_SRV + + +41 + ~<�es.h +> + +44 #ifde� +WIN32 + + +45 #i� +_MSC_VER + < 1600 + +46 + tu�t8_t +; + +47 + tu�t16_t +; + +48 + tu�t32_t +; + +49 + tu�t64_t +; + +51 + ~<�d�t.h +> + +54 + ~<�d�t.h +> + +57 + ~"mosqu�to.h +" + +58 + ~"time_mosq.h +" + +59 #ifde� +WITH_BROKER + + +60 #ifde� +__l�ux__ + + +61 + ~<�tdb.h +> + +63 + ~"uthash.h +" + +64 + gmosqu�to_���_msg +; + +67 #ifde� +WIN32 + + +68 +SOCKET + + tmosq_sock_t +; + +70 + tmosq_sock_t +; + +73 + emosqu�to_msg_d�e�i� + { + +74 + mmosq_md_� + = 0, + +75 + mmosq_md_out + = 1 + +78 + emosqu�to_msg_��e + { + +79 + mmosq_ms_�v�id + = 0, + +80 + mmosq_ms_publish_qos0 + = 1, + +81 + mmosq_ms_publish_qos1 + = 2, + +82 + mmosq_ms_wa�_f�_puback + = 3, + +83 + mmosq_ms_publish_qos2 + = 4, + +84 + mmosq_ms_wa�_f�_pub�c + = 5, + +85 + mmosq_ms_��nd_pub�l + = 6, + +86 + mmosq_ms_wa�_f�_pub�l + = 7, + +87 + mmosq_ms_��nd_pubcomp + = 8, + +88 + mmosq_ms_wa�_f�_pubcomp + = 9, + +89 + mmosq_ms_�nd_pub�c + = 10, + +90 + mmosq_ms_queued + = 11 + +93 + emosqu�to_���_��e + { + +94 + mmosq_cs_�w + = 0, + +95 + mmosq_cs_c���ed + = 1, + +96 + mmosq_cs_disc����g + = 2, + +97 + mmosq_cs_c���_async + = 3, + +98 + mmosq_cs_c���_�nd�g + = 4, + +99 + mmosq_cs_c���_�v + = 5, + +100 + mmosq_cs_disc���_ws + = 6, + +101 + mmosq_cs_disc���ed + = 7, + +102 + mmosq_cs_socks5_�w + = 8, + +103 + mmosq_cs_socks5_��t + = 9, + +104 + mmosq_cs_socks5_�que� + = 10, + +105 + mmosq_cs_socks5_��y + = 11, + +106 + mmosq_cs_socks5_auth_ok + = 12, + +107 + mmosq_cs_socks5_u��ass_��y + = 13, + +108 + mmosq_cs_socks5_�nd_u��ass + = 14, + +109 + mmosq_cs_exp��g + = 15, + +110 + mmosq_cs_c����g + = 16, + +111 + mmosq_cs_du�i�� + = 17, + +112 + mmosq_cs_disc���_w�h_w�l + = 18, + +113 + mmosq_cs_disu�d + = 19, + +114 + mmosq_cs_auth�ti�t�g + = 20, + +115 + mmosq_cs_�auth�ti�t�g + = 21, + +118 + emosqu�to__��oc� + { + +119 + mmosq_p_�v�id + = 0, + +120 + mmosq_p_mq�31 + = 1, + +121 + mmosq_p_mq�311 + = 2, + +122 + mmosq_p_mq�s + = 3, + +123 + mmosq_p_mq�5 + = 5, + +126 + emosqu�to__th�aded_��e + { + +127 + mmosq_ts_n�e +, + +128 + mmosq_ts_�lf +, + +129 + mmosq_ts_ex��� + + +132 + emosqu�to__����t + { + +133 + mmosq_t_�v�id + = 0, + +134 + mmosq_t_t� + = 1, + +135 + mmosq_t_ws + = 2, + +136 + mmosq_t_s�p + = 3 + +140 + smosqu�to__��s +{ + +141 * + mt�ic +; + +142 +u�t16_t + + m��s +; + +145 + s�ssi�_exp�y_li� + { + +146 +mosqu�to + * + mcڋxt +; + +147 +�ssi�_exp�y_li� + * + m�ev +; + +148 +�ssi�_exp�y_li� + * + m�xt +; + +151 + smosqu�to__�ck� +{ + +152 +u�t8_t + * + m�yl�d +; + +153 +mosqu�to__�ck� + * + m�xt +; + +154 +u�t32_t + + m�ma��g_mu� +; + +155 +u�t32_t + + m�ma��g_�ngth +; + +156 +u�t32_t + + m�ck�_�ngth +; + +157 +u�t32_t + + mto_�o�ss +; + +158 +u�t32_t + + mpos +; + +159 +u�t16_t + + mmid +; + +160 +u�t8_t + + mcomm�d +; + +161 +�t8_t + + m�ma��g_cou� +; + +164 + smosqu�to_mes�ge_�l +{ + +165 +mosqu�to_mes�ge_�l + * + m�xt +; + +166 +mosqu�to_mes�ge_�l + * + m�ev +; + +167 +mosqu�to_�ݔty + * + m�ݔt�s +; + +168 +time_t + + mtime�amp +; + +170 +mosqu�to_msg_��e + + m��e +; + +171 +bo� + + mdup +; + +172 +mosqu�to_mes�ge + + mmsg +; + +173 +u�t32_t + + mexp�y_��rv� +; + +176 #ifde� +WITH_TLS + + +177 + emosqu�to__keyf�m + { + +178 + mmosq_k_�m + = 0, + +179 + mmosq_k_�g�e + = 1, + +183 + sw�l_d�ay_li� + { + +184 +mosqu�to + * + mcڋxt +; + +185 +w�l_d�ay_li� + * + m�ev +; + +186 +w�l_d�ay_li� + * + m�xt +; + +189 + smosqu�to_msg_d�a +{ + +190 #ifde� +WITH_BROKER + + +191 +mosqu�to_���_msg + * + m��ight +; + +192 +mosqu�to_���_msg + * + mqueued +; + +193 + mmsg_by�s +; + +194 + mmsg_by�s12 +; + +195 + mmsg_cou� +; + +196 + mmsg_cou�12 +; + +198 +mosqu�to_mes�ge_�l + * + m��ight +; + +199 + mqueue_�n +; + +200 #ifde� +WITH_THREADING + + +201 +�h�ad_mu�x_t + + mmu�x +; + +204 + m��ight_qu�a +; + +205 +u�t16_t + + m��ight_maximum +; + +209 + smosqu�to + { + +210 +mosq_sock_t + + msock +; + +211 #i�de� +WITH_BROKER + + +212 +mosq_sock_t + + msock��R +, + msock��W +; + +214 #i� +def�ed +( +__GLIBC__ +�&& def�ed( +WITH_ADNS +) + +215 +gaicb + * + madns +; + +217 +mosqu�to__��oc� + + m��oc� +; + +218 * + madd�ss +; + +219 * + mid +; + +220 * + mu��ame +; + +221 * + m�ssw�d +; + +222 +u�t16_t + + mk��live +; + +223 +u�t16_t + + mϡ_mid +; + +224 +mosqu�to_���_��e + + m��e +; + +225 +time_t + + mϡ_msg_� +; + +226 +time_t + + m�xt_msg_out +; + +227 +time_t + + mp�g_t +; + +228 +mosqu�to__�ck� + + m�_�ck� +; + +229 +mosqu�to__�ck� + * + mcu��t_out_�ck� +; + +230 +mosqu�to__�ck� + * + mout_�ck� +; + +231 +mosqu�to_mes�ge_�l + * + mw�l +; + +232 +mosqu�to__��s + * + m���s +; + +233 +w�l_d�ay_li� + * + mw�l_d�ay_��y +; + +234 +u�t32_t + + mmaximum_�ck�_size +; + +235 + m��s_cou� +; + +236 +u�t32_t + + mw�l_d�ay_��rv� +; + +237 +time_t + + mw�l_d�ay_time +; + +238 #ifde� +WITH_TLS + + +239 +SSL + * + ms� +; + +240 +SSL_CTX + * + ms�_�x +; + +241 * + m�s_�f�e +; + +242 * + m�s_��th +; + +243 * + m�s_��f�e +; + +244 * + m�s_keyf�e +; + +245 (* + m�s_pw_��back +)(* + mbuf +, + msize +, + mrw�ag +, * + mu�rd�a +); + +246 * + m�s_v�si� +; + +247 * + m�s_c�h�s +; + +248 * + m�s_psk +; + +249 * + m�s_psk_id�t�y +; + +250 + m�s_��_�qs +; + +251 +bo� + + m�s_��cu� +; + +252 +bo� + + ms�_�x_de�u�s +; + +253 +bo� + + m�s_oc�_�qu�ed +; + +254 * + m�s_�g�e +; + +255 * + m�s_�g�e_k�ss_sha1 +; + +256 +mosqu�to__keyf�m + + m�s_keyf�m +; + +257 * + m�s_�� +; + +259 +bo� + + mw�t_wr�e +; + +260 +bo� + + mw�t_c��� +; + +261 #i� +def�ed +( +WITH_THREADING +�&& !def�ed( +WITH_BROKER +) + +262 +�h�ad_mu�x_t + + m��back_mu�x +; + +263 +�h�ad_mu�x_t + + mlog_��back_mu�x +; + +264 +�h�ad_mu�x_t + + mmsgtime_mu�x +; + +265 +�h�ad_mu�x_t + + mout_�ck�_mu�x +; + +266 +�h�ad_mu�x_t + + mcu��t_out_�ck�_mu�x +; + +267 +�h�ad_mu�x_t + + m��e_mu�x +; + +268 +�h�ad_mu�x_t + + mmid_mu�x +; + +269 +�h�ad_t + + mth�ad_id +; + +271 +bo� + + m��n_��t +; + +272 +u�t32_t + + m�ssi�_exp�y_��rv� +; + +273 +time_t + + m�ssi�_exp�y_time +; + +274 #ifde� +WITH_BROKER + + +275 +bo� + + m�moved_�om_by_id +; + +276 +bo� + + mis_dr�p�g +; + +277 +bo� + + mis_bridge +; + +278 +mosqu�to__bridge + * + mbridge +; + +279 +mosqu�to_msg_d�a + + mmsgs_� +; + +280 +mosqu�to_msg_d�a + + mmsgs_out +; + +281 +mosqu�to__a�_u�r + * + ma�_li� +; + +282 +mosqu�to__li��� + * + mli��� +; + +283 +mosqu�to__�ck� + * + mout_�ck�_ϡ +; + +284 +mosqu�to__subh�r + ** + msubs +; + +285 +mosqu�to__subsh�ed_�f + ** + msh�ed_subs +; + +286 * + mauth_m�hod +; + +287 + msub_cou� +; + +288 + msh�ed_sub_cou� +; + +289 + mp�lfd_�dex +; + +290 #ifde� +WITH_WEBSOCKETS + + +291 #i� +def�ed +( +LWS_LIBRARY_VERSION_NUMBER +) + +292 +lws + * + mwsi +; + +294 +libwebsock�_cڋxt + * + mws_cڋxt +; + +295 +libwebsock� + * + mwsi +; + +298 +bo� + + mws_w�t_wr�e +; + +299 +bo� + + massig�d_id +; + +301 #ifde� +WITH_SOCKS + + +302 * + msocks5_ho� +; + +303 + msocks5_p�t +; + +304 * + msocks5_u��ame +; + +305 * + msocks5_�ssw�d +; + +307 * + mu�rd�a +; + +308 +bo� + + m�_��back +; + +309 +mosqu�to_msg_d�a + + mmsgs_� +; + +310 +mosqu�to_msg_d�a + + mmsgs_out +; + +311 (* + m�_c��� +)( + mmosqu�to + *, * + mu�rd�a +, + mrc +); + +312 (* + m�_c���_w�h_�ags +)( + mmosqu�to + *, * + mu�rd�a +, + mrc +, + m�ags +); + +313 (* + m�_c���_v5 +)( + mmosqu�to + *, * + mu�rd�a +, + mrc +, + m�ags +, cڡ +mosqu�to_�ݔty + * + m��s +); + +314 (* + m�_disc��� +)( + mmosqu�to + *, * + mu�rd�a +, + mrc +); + +315 (* + m�_disc���_v5 +)( + mmosqu�to + *, * + mu�rd�a +, + mrc +, cڡ +mosqu�to_�ݔty + * + m��s +); + +316 (* + m�_publish +)( + mmosqu�to + *, * + mu�rd�a +, + mmid +); + +317 (* + m�_publish_v5 +)( + mmosqu�to + *, * + mu�rd�a +, + mmid +, + m�as�_code +, cڡ +mosqu�to_�ݔty + * + m��s +); + +318 (* + m�_mes�ge +)( + mmosqu�to + *, * + mu�rd�a +, cڡ +mosqu�to_mes�ge + * + mmes�ge +); + +319 (* + m�_mes�ge_v5 +)( + mmosqu�to + *, * + mu�rd�a +, cڡ +mosqu�to_mes�ge + * + mmes�ge +, cڡ +mosqu�to_�ݔty + * + m��s +); + +320 (* + m�_subs�ibe +)( + mmosqu�to + *, * + mu�rd�a +, + mmid +, + mqos_cou� +, cڡ * + mg��ed_qos +); + +321 (* + m�_subs�ibe_v5 +)( + mmosqu�to + *, * + mu�rd�a +, + mmid +, + mqos_cou� +, cڡ * + mg��ed_qos +, cڡ +mosqu�to_�ݔty + * + m��s +); + +322 (* + m�_unsubs�ibe +)( + mmosqu�to + *, * + mu�rd�a +, + mmid +); + +323 (* + m�_unsubs�ibe_v5 +)( + mmosqu�to + *, * + mu�rd�a +, + mmid +, cڡ +mosqu�to_�ݔty + * + m��s +); + +324 (* + m�_log +)( + mmosqu�to + *, * + mu�rd�a +, + m�v� +, cڡ * + m�r +); + +326 * + mho� +; + +327 + mp�t +; + +328 * + mb�d_add�ss +; + +329 + m�c���_d�ay +; + +330 + m�c���_d�ay_max +; + +331 +bo� + + m�c���_expڒt�l_backoff +; + +332 + mth�aded +; + +333 +mosqu�to__�ck� + * + mout_�ck�_ϡ +; + +334 #ifde� +WITH_SRV + + +335 +�es_ch��l + + mach� +; + +337 +u�t16_t + + m�nd_maximum +; + +338 +u�t16_t + + m��ive_maximum +; + +340 +u�t8_t + + mmaximum_qos +; + +342 #ifde� +WITH_BROKER + + +343 +UT_hash_h�d� + + mhh_id +; + +344 +UT_hash_h�d� + + mhh_sock +; + +345 +mosqu�to + * + mf�_�_�xt +; + +346 +�ssi�_exp�y_li� + * + mexp�y_li�_�em +; + +348 #ifde� +WITH_EPOLL + + +349 +u�t32_t + + mev�ts +; + +353 + #STREMPTY +( +�r +�(�r[0] =�'\0') + + ) + +355 +do_���_disc��� +( +mosqu�to + * +mosq +, +�as�_code +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +); + + @lib/mqtt_protocol.h + +17 #i�de� +MQTT_PROTOCOL_H + + +18 + #MQTT_PROTOCOL_H + + + ) + +20 + #PROTOCOL_NAME_v31 + "MQIsdp" + + ) + +21 + #PROTOCOL_VERSION_v31 + 3 + + ) + +23 + #PROTOCOL_NAME + "MQTT" + + ) + +25 + #PROTOCOL_VERSION_v311 + 4 + + ) + +26 + #PROTOCOL_VERSION_v5 + 5 + + ) + +30 + #CMD_CONNECT + 0x10 + + ) + +31 + #CMD_CONNACK + 0x20 + + ) + +32 + #CMD_PUBLISH + 0x30 + + ) + +33 + #CMD_PUBACK + 0x40 + + ) + +34 + #CMD_PUBREC + 0x50 + + ) + +35 + #CMD_PUBREL + 0x60 + + ) + +36 + #CMD_PUBCOMP + 0x70 + + ) + +37 + #CMD_SUBSCRIBE + 0x80 + + ) + +38 + #CMD_SUBACK + 0x90 + + ) + +39 + #CMD_UNSUBSCRIBE + 0xA0 + + ) + +40 + #CMD_UNSUBACK + 0xB0 + + ) + +41 + #CMD_PINGREQ + 0xC0 + + ) + +42 + #CMD_PINGRESP + 0xD0 + + ) + +43 + #CMD_DISCONNECT + 0xE0 + + ) + +44 + #CMD_AUTH + 0xF0 + + ) + +47 + #CMD_WILL + 0x100 + + ) + +49 + emq�311_c��ck_codes + { + +50 + mCONNACK_ACCEPTED + = 0, + +51 + mCONNACK_REFUSED_PROTOCOL_VERSION + = 1, + +52 + mCONNACK_REFUSED_IDENTIFIER_REJECTED + = 2, + +53 + mCONNACK_REFUSED_SERVER_UNAVAILABLE + = 3, + +54 + mCONNACK_REFUSED_BAD_USERNAME_PASSWORD + = 4, + +55 + mCONNACK_REFUSED_NOT_AUTHORIZED + = 5, + +59 + emq�5_�tu�_codes + { + +60 + mMQTT_RC_SUCCESS + = 0, + +61 + mMQTT_RC_NORMAL_DISCONNECTION + = 0, + +62 + mMQTT_RC_GRANTED_QOS0 + = 0, + +63 + mMQTT_RC_GRANTED_QOS1 + = 1, + +64 + mMQTT_RC_GRANTED_QOS2 + = 2, + +65 + mMQTT_RC_DISCONNECT_WITH_WILL_MSG + = 4, + +66 + mMQTT_RC_NO_MATCHING_SUBSCRIBERS + = 16, + +67 + mMQTT_RC_NO_SUBSCRIPTION_EXISTED + = 17, + +68 + mMQTT_RC_CONTINUE_AUTHENTICATION + = 24, + +69 + mMQTT_RC_REAUTHENTICATE + = 25, + +71 + mMQTT_RC_UNSPECIFIED + = 128, + +72 + mMQTT_RC_MALFORMED_PACKET + = 129, + +73 + mMQTT_RC_PROTOCOL_ERROR + = 130, + +74 + mMQTT_RC_IMPLEMENTATION_SPECIFIC + = 131, + +75 + mMQTT_RC_UNSUPPORTED_PROTOCOL_VERSION + = 132, + +76 + mMQTT_RC_CLIENTID_NOT_VALID + = 133, + +77 + mMQTT_RC_BAD_USERNAME_OR_PASSWORD + = 134, + +78 + mMQTT_RC_NOT_AUTHORIZED + = 135, + +79 + mMQTT_RC_SERVER_UNAVAILABLE + = 136, + +80 + mMQTT_RC_SERVER_BUSY + = 137, + +81 + mMQTT_RC_BANNED + = 138, + +82 + mMQTT_RC_SERVER_SHUTTING_DOWN + = 139, + +83 + mMQTT_RC_BAD_AUTHENTICATION_METHOD + = 140, + +84 + mMQTT_RC_KEEP_ALIVE_TIMEOUT + = 141, + +85 + mMQTT_RC_SESSION_TAKEN_OVER + = 142, + +86 + mMQTT_RC_TOPIC_FILTER_INVALID + = 143, + +87 + mMQTT_RC_TOPIC_NAME_INVALID + = 144, + +88 + mMQTT_RC_PACKET_ID_IN_USE + = 145, + +89 + mMQTT_RC_PACKET_ID_NOT_FOUND + = 146, + +90 + mMQTT_RC_RECEIVE_MAXIMUM_EXCEEDED + = 147, + +91 + mMQTT_RC_TOPIC_ALIAS_INVALID + = 148, + +92 + mMQTT_RC_PACKET_TOO_LARGE + = 149, + +93 + mMQTT_RC_MESSAGE_RATE_TOO_HIGH + = 150, + +94 + mMQTT_RC_QUOTA_EXCEEDED + = 151, + +95 + mMQTT_RC_ADMINISTRATIVE_ACTION + = 152, + +96 + mMQTT_RC_PAYLOAD_FORMAT_INVALID + = 153, + +97 + mMQTT_RC_RETAIN_NOT_SUPPORTED + = 154, + +98 + mMQTT_RC_QOS_NOT_SUPPORTED + = 155, + +99 + mMQTT_RC_USE_ANOTHER_SERVER + = 156, + +100 + mMQTT_RC_SERVER_MOVED + = 157, + +101 + mMQTT_RC_SHARED_SUBS_NOT_SUPPORTED + = 158, + +102 + mMQTT_RC_CONNECTION_RATE_EXCEEDED + = 159, + +103 + mMQTT_RC_MAXIMUM_CONNECT_TIME + = 160, + +104 + mMQTT_RC_SUBSCRIPTION_IDS_NOT_SUPPORTED + = 161, + +105 + mMQTT_RC_WILDCARD_SUBS_NOT_SUPPORTED + = 162, + +108 + emq�5_�ݔty + { + +109 + mMQTT_PROP_PAYLOAD_FORMAT_INDICATOR + = 1, + +110 + mMQTT_PROP_MESSAGE_EXPIRY_INTERVAL + = 2, + +111 + mMQTT_PROP_CONTENT_TYPE + = 3, + +112 + mMQTT_PROP_RESPONSE_TOPIC + = 8, + +113 + mMQTT_PROP_CORRELATION_DATA + = 9, + +114 + mMQTT_PROP_SUBSCRIPTION_IDENTIFIER + = 11, + +115 + mMQTT_PROP_SESSION_EXPIRY_INTERVAL + = 17, + +116 + mMQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER + = 18, + +117 + mMQTT_PROP_SERVER_KEEP_ALIVE + = 19, + +118 + mMQTT_PROP_AUTHENTICATION_METHOD + = 21, + +119 + mMQTT_PROP_AUTHENTICATION_DATA + = 22, + +120 + mMQTT_PROP_REQUEST_PROBLEM_INFORMATION + = 23, + +121 + mMQTT_PROP_WILL_DELAY_INTERVAL + = 24, + +122 + mMQTT_PROP_REQUEST_RESPONSE_INFORMATION + = 25, + +123 + mMQTT_PROP_RESPONSE_INFORMATION + = 26, + +124 + mMQTT_PROP_SERVER_REFERENCE + = 28, + +125 + mMQTT_PROP_REASON_STRING + = 31, + +126 + mMQTT_PROP_RECEIVE_MAXIMUM + = 33, + +127 + mMQTT_PROP_TOPIC_ALIAS_MAXIMUM + = 34, + +128 + mMQTT_PROP_TOPIC_ALIAS + = 35, + +129 + mMQTT_PROP_MAXIMUM_QOS + = 36, + +130 + mMQTT_PROP_RETAIN_AVAILABLE + = 37, + +131 + mMQTT_PROP_USER_PROPERTY + = 38, + +132 + mMQTT_PROP_MAXIMUM_PACKET_SIZE + = 39, + +133 + mMQTT_PROP_WILDCARD_SUB_AVAILABLE + = 40, + +134 + mMQTT_PROP_SUBSCRIPTION_ID_AVAILABLE + = 41, + +135 + mMQTT_PROP_SHARED_SUB_AVAILABLE + = 42, + +138 + emq�5_�ݔty_ty� + { + +139 + mMQTT_PROP_TYPE_BYTE + = 1, + +140 + mMQTT_PROP_TYPE_INT16 + = 2, + +141 + mMQTT_PROP_TYPE_INT32 + = 3, + +142 + mMQTT_PROP_TYPE_VARINT + = 4, + +143 + mMQTT_PROP_TYPE_BINARY + = 5, + +144 + mMQTT_PROP_TYPE_STRING + = 6, + +145 + mMQTT_PROP_TYPE_STRING_PAIR + = 7 + +148 + emq�5_sub_�ti�s + { + +149 + mMQTT_SUB_OPT_NO_LOCAL + = 0x04, + +150 + mMQTT_SUB_OPT_RETAIN_AS_PUBLISHED + = 0x08, + +151 + mMQTT_SUB_OPT_SEND_RETAIN_ALWAYS + = 0x00, + +152 + mMQTT_SUB_OPT_SEND_RETAIN_NEW + = 0x10, + +153 + mMQTT_SUB_OPT_SEND_RETAIN_NEVER + = 0x20, + +156 + #MQTT_MAX_PAYLOAD + 268435455 + + ) + + @lib/net_mosq.c + +17 + #_GNU_SOURCE + + + ) + +18 + ~"c�fig.h +" + +20 + ~<as��.h +> + +21 + ~<��o.h +> + +22 + ~<f��.h +> + +23 + ~<�dio.h +> + +24 + ~<�r�g.h +> + +25 #i�de� +WIN32 + + +26 + #_GNU_SOURCE + + + ) + +27 + ~<�tdb.h +> + +28 + ~<sys/sock�.h +> + +29 + ~<uni�d.h +> + +31 + ~<w�sock2.h +> + +32 + ~<ws2t��.h +> + +35 #ifde� +__ANDROID__ + + +36 + ~<l�ux/�.h +> + +37 + ~<l�ux/�6.h +> + +38 + ~<sys/�d�n.h +> + +41 #ifde� +HAVE_NETINET_IN_H + + +42 + ~<�t��/�.h +> + +45 #ifde� +__QNX__ + + +46 + ~<�t/�tby�.h +> + +49 #ifde� +WITH_TLS + + +50 + ~<ݒs�/c�f.h +> + +51 + ~<ݒs�/�g�e.h +> + +52 + ~<ݒs�/�r.h +> + +53 + ~<ݒs�/ui.h +> + +54 + ~<�s_mosq.h +> + +57 #ifde� +WITH_BROKER + + +58 + ~"mosqu�to_brok�_����.h +" + +59 #ifde� +WITH_WEBSOCKETS + + +60 + ~<libwebsock�s.h +> + +63 + ~"�ad_h�d�.h +" + +66 + ~"logg�g_mosq.h +" + +67 + ~"mem�y_mosq.h +" + +68 + ~"mq�_��oc�.h +" + +69 + ~"�t_mosq.h +" + +70 + ~"time_mosq.h +" + +71 + ~"ut�_mosq.h +" + +73 #ifde� +WITH_TLS + + +74 + g�s_ex_�dex_mosq + = -1; + +75 +UI_METHOD + * + g_ui_m�hod + = +NULL +; + +78 + $ui_ݒ +( +UI + * +ui +) + +80 + `UI_m�hod_g�_ݒ� +( + `UI_O�nSSL +())( +ui +); + +81 + } +} + +83 + $ui_�ad +( +UI + * +ui +, +UI_STRING + * +uis +) + +85 + `UI_m�hod_g�_�ad� +( + `UI_O�nSSL +())( +ui +, +uis +); + +86 + } +} + +88 + $ui_wr�e +( +UI + * +ui +, +UI_STRING + * +uis +) + +90 + `UI_m�hod_g�_wr�� +( + `UI_O�nSSL +())( +ui +, +uis +); + +91 + } +} + +93 + $ui_�o� +( +UI + * +ui +) + +95 + `UI_m�hod_g�_�o�r +( + `UI_O�nSSL +())( +ui +); + +96 + } +} + +98 + $�tup_ui_m�hod +() + +100 +_ui_m�hod + = + `UI_���_m�hod +("OpenSSL�pplication user interface"); + +101 + `UI_m�hod_�t_ݒ� +( +_ui_m�hod +, +ui_ݒ +); + +102 + `UI_m�hod_�t_�ad� +( +_ui_m�hod +, +ui_�ad +); + +103 + `UI_m�hod_�t_wr�� +( +_ui_m�hod +, +ui_wr�e +); + +104 + `UI_m�hod_�t_�o�r +( +_ui_m�hod +, +ui_�o� +); + +105 + } +} + +107 + $��nup_ui_m�hod +() + +109 if( +_ui_m�hod +){ + +110 + `UI_de�roy_m�hod +( +_ui_m�hod +); + +111 +_ui_m�hod + = +NULL +; + +113 + } +} + +115 +UI_METHOD + * + $�t__g�_ui_m�hod +() + +117 +_ui_m�hod +; + +118 + } +} + +121 + $�t__�� +() + +123 #ifde� +WIN32 + + +124 +WSADATA + +w�D�a +; + +125 if( + `WSAS��up +( + `MAKEWORD +(2,2), & +w�D�a +) != 0){ + +126 +MOSQ_ERR_UNKNOWN +; + +130 #ifde� +WITH_SRV + + +131 + `�es_lib�ry_�� +( +ARES_LIB_INIT_ALL +); + +134 #ifde� +WITH_TLS + + +135 #i� +OPENSSL_VERSION_NUMBER + < 0x10100000L + +136 + `SSL_l�d_�r�_�r�gs +(); + +137 + `SSL_lib�ry_�� +(); + +138 + `O�nSSL_add_�l_�gܙhms +(); + +140 + `OPENSSL_��_�y�o +( +OPENSSL_INIT_ADD_ALL_CIPHERS + \ + +141 | +OPENSSL_INIT_ADD_ALL_DIGESTS + \ + +142 | +OPENSSL_INIT_LOAD_CONFIG +, +NULL +); + +144 #i�! + `def�ed +( +OPENSSL_NO_ENGINE +) + +145 + `ENGINE_l�d_bu�t�_�g�es +(); + +147 + `�tup_ui_m�hod +(); + +148 if( +�s_ex_�dex_mosq + == -1){ + +149 +�s_ex_�dex_mosq + = + `SSL_g�_ex_�w_�dex +(0, "��� cڋxt", +NULL +, NULL, NULL); + +152 +MOSQ_ERR_SUCCESS +; + +153 + } +} + +155 + $�t__��nup +() + +157 #ifde� +WITH_TLS + + +158 #i� +OPENSSL_VERSION_NUMBER + < 0x10100000L + +159 + `CRYPTO_��nup_�l_ex_d�a +(); + +160 + `ERR_�_�r�gs +(); + +161 + `ERR_�move_th�ad_��e +( +NULL +); + +162 + `EVP_��nup +(); + +164 #i�! + `def�ed +( +OPENSSL_NO_ENGINE +) + +165 + `ENGINE_��nup +(); + +169 + `CONF_modu�s_u��d +(1); + +170 + `��nup_ui_m�hod +(); + +173 #ifde� +WITH_SRV + + +174 + `�es_lib�ry_��nup +(); + +177 #ifde� +WIN32 + + +178 + `WSAC˪up +(); + +180 + } +} + +187 #ifde� +WITH_BROKER + + +188 + $�t__sock�_�o� +( +mosqu�to_db + * +db +, +mosqu�to + * +mosq +) + +190 + $�t__sock�_�o� +( +mosqu�to + * +mosq +) + +193 +rc + = 0; + +195 + `as�� +( +mosq +); + +196 #ifde� +WITH_TLS + + +197 #ifde� +WITH_WEBSOCKETS + + +198 if(! +mosq +-> +wsi +) + +201 if( +mosq +-> +s� +){ + +202 + `SSL_shutdown +( +mosq +-> +s� +); + +203 + `SSL_� +( +mosq +-> +s� +); + +204 +mosq +-> +s� + = +NULL +; + +209 #ifde� +WITH_WEBSOCKETS + + +210 if( +mosq +-> +wsi +) + +212 if( +mosq +-> +��e + !� +mosq_cs_disc����g +){ + +213 + `cڋxt__�t_��e +( +mosq +, +mosq_cs_disc���_ws +); + +215 + `libwebsock�_��back_�_wr�ab� +( +mosq +-> +ws_cڋxt +, mosq-> +wsi +); + +219 if( +mosq +-> +sock + !� +INVALID_SOCKET +){ + +220 #ifde� +WITH_BROKER + + +221 + `HASH_DELETE +( +hh_sock +, +db +-> +cڋxts_by_sock +, +mosq +); + +223 +rc + = + `COMPAT_CLOSE +( +mosq +-> +sock +); + +224 +mosq +-> +sock + = +INVALID_SOCKET +; + +228 #ifde� +WITH_BROKER + + +229 if( +mosq +-> +li��� +){ + +230 +mosq +-> +li��� +-> +���_cou� +--; + +234 +rc +; + +235 + } +} + +238 #ifde� +FINAL_WITH_TLS_PSK + + +239 + $psk_���_��back +( +SSL + * +s� +, cڡ * +h�t +, + +240 * +id�t�y +, +max_id�t�y_�n +, + +241 * +psk +, +max_psk_�n +) + +243 +mosqu�to + * +mosq +; + +244 +�n +; + +246 + `UNUSED +( +h�t +); + +248 +mosq + = + `SSL_g�_ex_d�a +( +s� +, +�s_ex_�dex_mosq +); + +249 if(! +mosq +) 0; + +251 + `���tf +( +id�t�y +, +max_id�t�y_�n +, "%s", +mosq +-> +�s_psk_id�t�y +); + +253 +�n + = + `mosqu�to__hex2b� +( +mosq +-> +�s_psk +, +psk +, +max_psk_�n +); + +254 i�( +�n + < 0) 0; + +255 +�n +; + +256 + } +} + +259 #i� +def�ed +( +WITH_BROKER +�&& def�ed( +__GLIBC__ +�&& def�ed( +WITH_ADNS +) + +261 + $�t__�y_c���_��1 +( +mosqu�to + * +mosq +, cڡ * +ho� +) + +263 +s +; + +264 * +�vp + = +NULL +; + +265 +addr�fo + * +h�ts +; + +267 if( +mosq +-> +adns +){ + +268 + `gai_�n�l +( +mosq +-> +adns +); + +269 + `mosqu�to__� +(( +addr�fo + *) +mosq +-> +adns +-> +�_�que� +); + +270 + `mosqu�to__� +( +mosq +-> +adns +); + +272 +mosq +-> +adns + = + `mosqu�to__��oc +(1, ( +gaicb +)); + +273 if(! +mosq +-> +adns +){ + +274 +MOSQ_ERR_NOMEM +; + +277 +h�ts + = + `mosqu�to__��oc +(1, ( +addr�fo +)); + +278 if(! +h�ts +){ + +279 + `mosqu�to__� +( +mosq +-> +adns +); + +280 +mosq +-> +adns + = +NULL +; + +281 +MOSQ_ERR_NOMEM +; + +284 +h�ts +-> +ai_�m�y + = +AF_UNSPEC +; + +285 +h�ts +-> +ai_sockty� + = +SOCK_STREAM +; + +287 +mosq +-> +adns +-> +�_�me + = +ho� +; + +288 +mosq +-> +adns +-> +�_�que� + = +h�ts +; + +290 +s + = + `g�addr�fo_a +( +GAI_NOWAIT +, & +mosq +-> +adns +, 1, +�vp +); + +291 if( +s +){ + +292 +��o + = +s +; + +293 if( +mosq +-> +adns +){ + +294 + `mosqu�to__� +(( +addr�fo + *) +mosq +-> +adns +-> +�_�que� +); + +295 + `mosqu�to__� +( +mosq +-> +adns +); + +296 +mosq +-> +adns + = +NULL +; + +298 +MOSQ_ERR_EAI +; + +301 +MOSQ_ERR_SUCCESS +; + +302 + } +} + +305 + $�t__�y_c���_��2 +( +mosqu�to + * +mosq +, +u�t16_t + +p�t +, +mosq_sock_t + * +sock +) + +307 +addr�fo + * +a�fo +, * +� +; + +308 +rc +; + +310 +a�fo + = +mosq +-> +adns +-> +�_�su� +; + +312 +� + = +a�fo +;��!� +NULL +;���-> +ai_�xt +){ + +313 * +sock + = + `sock� +( +� +-> +ai_�m�y +,�p-> +ai_sockty� +,�p-> +ai_��oc� +); + +314 if(* +sock + =� +INVALID_SOCKET +) ; + +316 if( +� +-> +ai_�m�y + =� +AF_INET +){ + +317 (( +sockaddr_� + *) +� +-> +ai_addr +)-> +s�_p�t + = + `ht�s +( +p�t +); + +318 }if( +� +-> +ai_�m�y + =� +AF_INET6 +){ + +319 (( +sockaddr_�6 + *) +� +-> +ai_addr +)-> +s�6_p�t + = + `ht�s +( +p�t +); + +321 + `COMPAT_CLOSE +(* +sock +); + +322 * +sock + = +INVALID_SOCKET +; + +327 if( + `�t__sock�_n�block +( +sock +)){ + +331 +rc + = + `c��� +(* +sock +, +� +-> +ai_addr +,�p-> +ai_add�� +); + +332 #ifde� +WIN32 + + +333 +��o + = + `WSAG�La�E�� +(); + +335 if( +rc + =�0 || +��o + =� +EINPROGRESS + ||��n�=� +COMPAT_EWOULDBLOCK +){ + +336 if( +rc + < 0 && ( +��o + =� +EINPROGRESS + ||��n�=� +COMPAT_EWOULDBLOCK +)){ + +337 +rc + = +MOSQ_ERR_CONN_PENDING +; + +341 if( + `�t__sock�_n�block +( +sock +)){ + +347 + `COMPAT_CLOSE +(* +sock +); + +348 * +sock + = +INVALID_SOCKET +; + +350 + `�addr�fo +( +mosq +-> +adns +-> +�_�su� +); + +351 +mosq +-> +adns +-> +�_�su� + = +NULL +; + +353 + `mosqu�to__� +(( +addr�fo + *) +mosq +-> +adns +-> +�_�que� +); + +354 + `mosqu�to__� +( +mosq +-> +adns +); + +355 +mosq +-> +adns + = +NULL +; + +357 if(! +� +){ + +358 +MOSQ_ERR_ERRNO +; + +361 +rc +; + +362 + } +} + +367 + $�t__�y_c��� +(cڡ * +ho� +, +u�t16_t + +p�t +, +mosq_sock_t + * +sock +, cڡ * +b�d_add�ss +, +bo� + +block�g +) + +369 +addr�fo + +h�ts +; + +370 +addr�fo + * +a�fo +, * +� +; + +371 +addr�fo + * +a�fo_b�d +, * +�_b�d +; + +372 +s +; + +373 +rc + = +MOSQ_ERR_SUCCESS +; + +374 #ifde� +WIN32 + + +375 +u�t32_t + +v� + = 1; + +378 * +sock + = +INVALID_SOCKET +; + +379 + `mem�t +(& +h�ts +, 0, ( +addr�fo +)); + +380 +h�ts +. +ai_�m�y + = +AF_UNSPEC +; + +381 +h�ts +. +ai_sockty� + = +SOCK_STREAM +; + +383 +s + = + `g�addr�fo +( +ho� +, +NULL +, & +h�ts +, & +a�fo +); + +384 if( +s +){ + +385 +��o + = +s +; + +386 +MOSQ_ERR_EAI +; + +389 if( +b�d_add�ss +){ + +390 +s + = + `g�addr�fo +( +b�d_add�ss +, +NULL +, & +h�ts +, & +a�fo_b�d +); + +391 if( +s +){ + +392 + `�addr�fo +( +a�fo +); + +393 +��o + = +s +; + +394 +MOSQ_ERR_EAI +; + +398 +� + = +a�fo +;��!� +NULL +;���-> +ai_�xt +){ + +399 * +sock + = + `sock� +( +� +-> +ai_�m�y +,�p-> +ai_sockty� +,�p-> +ai_��oc� +); + +400 if(* +sock + =� +INVALID_SOCKET +) ; + +402 if( +� +-> +ai_�m�y + =� +AF_INET +){ + +403 (( +sockaddr_� + *) +� +-> +ai_addr +)-> +s�_p�t + = + `ht�s +( +p�t +); + +404 }if( +� +-> +ai_�m�y + =� +AF_INET6 +){ + +405 (( +sockaddr_�6 + *) +� +-> +ai_addr +)-> +s�6_p�t + = + `ht�s +( +p�t +); + +407 + `COMPAT_CLOSE +(* +sock +); + +408 * +sock + = +INVALID_SOCKET +; + +412 if( +b�d_add�ss +){ + +413 +�_b�d + = +a�fo_b�d +;�p_b�d !� +NULL +;�p_b�d =�p_b�d-> +ai_�xt +){ + +414 if( + `b�d +(* +sock +, +�_b�d +-> +ai_addr +,�p_b�d-> +ai_add�� +) == 0){ + +418 if(! +�_b�d +){ + +419 + `COMPAT_CLOSE +(* +sock +); + +420 * +sock + = +INVALID_SOCKET +; + +425 if(! +block�g +){ + +427 if( + `�t__sock�_n�block +( +sock +)){ + +432 +rc + = + `c��� +(* +sock +, +� +-> +ai_addr +,�p-> +ai_add�� +); + +433 #ifde� +WIN32 + + +434 +��o + = + `WSAG�La�E�� +(); + +436 if( +rc + =�0 || +��o + =� +EINPROGRESS + ||��n�=� +COMPAT_EWOULDBLOCK +){ + +437 if( +rc + < 0 && ( +��o + =� +EINPROGRESS + ||��n�=� +COMPAT_EWOULDBLOCK +)){ + +438 +rc + = +MOSQ_ERR_CONN_PENDING +; + +441 if( +block�g +){ + +443 if( + `�t__sock�_n�block +( +sock +)){ + +450 + `COMPAT_CLOSE +(* +sock +); + +451 * +sock + = +INVALID_SOCKET +; + +453 + `�addr�fo +( +a�fo +); + +454 if( +b�d_add�ss +){ + +455 + `�addr�fo +( +a�fo_b�d +); + +457 if(! +� +){ + +458 +MOSQ_ERR_ERRNO +; + +460 +rc +; + +461 + } +} + +464 #ifde� +WITH_TLS + + +465 + $�t__��t_s�_�r� +( +mosqu�to + * +mosq +) + +467 +ebuf +[256]; + +468 +e +; + +470 +e + = + `ERR_g�_�r� +(); + +471 +e +){ + +472 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "O�nSSL E��: %s", + `ERR_�r�_�r�g +( +e +, +ebuf +)); + +473 +e + = + `ERR_g�_�r� +(); + +475 + } +} + +478 + $�t__sock�_c���_�s +( +mosqu�to + * +mosq +) + +480 +�t +, +�r +; + +482 + `ERR_��r_�r� +(); + +483 +�s +; + +484 i�( +mosq +-> +�s_oc�_�qu�ed +) { + +486 i�(( +�s += + `SSL_�t_��xt_��us_ty� +( +mosq +-> +s� +, +TLSEXT_STATUSTYPE_oc� +)) != 1) { + +487 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "Could�ه�iv��OCSP (�r�: %ld)", +�s +); + +488 +MOSQ_ERR_OCSP +; + +490 i�(( +�s += + `SSL_CTX_�t_��xt_��us_cb +( +mosq +-> +s�_�x +, +mosqu�to__v�ify_oc�_��us_cb +)) != 1) { + +491 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "Could�ه�iv��OCSP (�r�: %ld)", +�s +); + +492 +MOSQ_ERR_OCSP +; + +494 i�(( +�s += + `SSL_CTX_�t_��xt_��us_�g +( +mosq +-> +s�_�x +, mosq)) != 1) { + +495 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "Could�ه�iv��OCSP (�r�: %ld)", +�s +); + +496 +MOSQ_ERR_OCSP +; + +500 +�t + = + `SSL_c��� +( +mosq +-> +s� +); + +501 if( +�t + != 1) { + +502 +�r + = + `SSL_g�_�r� +( +mosq +-> +s� +, +�t +); + +503 i�( +�r + =� +SSL_ERROR_SYSCALL +) { + +504 +mosq +-> +w�t_c��� + = +�ue +; + +505 +MOSQ_ERR_SUCCESS +; + +507 if( +�r + =� +SSL_ERROR_WANT_READ +){ + +508 +mosq +-> +w�t_c��� + = +�ue +; + +510 }if( +�r + =� +SSL_ERROR_WANT_WRITE +){ + +511 +mosq +-> +w�t_wr�e + = +�ue +; + +512 +mosq +-> +w�t_c��� + = +�ue +; + +514 + `�t__��t_s�_�r� +( +mosq +); + +516 + `COMPAT_CLOSE +( +mosq +-> +sock +); + +517 +mosq +-> +sock + = +INVALID_SOCKET +; + +518 + `�t__��t_s�_�r� +( +mosq +); + +519 +MOSQ_ERR_TLS +; + +522 +mosq +-> +w�t_c��� + = +�l� +; + +524 +MOSQ_ERR_SUCCESS +; + +525 + } +} + +529 #ifde� +WITH_TLS + + +530 + $�t__��_s�_�x +( +mosqu�to + * +mosq +) + +532 +�t +; + +533 +ENGINE + * +�g�e + = +NULL +; + +534 +u�t8_t + +�s_��_w�e +[256]; + +535 +u�t8_t + +�s_��_�n +; + +537 if( +mosq +-> +s�_�x +){ + +538 if(! +mosq +-> +s�_�x_de�u�s +){ + +539 +MOSQ_ERR_SUCCESS +; + +540 }if(! +mosq +-> +�s_�f�e + && !mosq-> +�s_��th + && !mosq-> +�s_psk +){ + +541 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "Error: MOSQ_OPT_SSL_CTX_WITH_DEFAULTS used without specifying cafile, capath or�sk."); + +542 +MOSQ_ERR_INVAL +; + +549 if( +mosq +-> +�s_�f�e + || mosq-> +�s_��th + || mosq-> +�s_psk +){ + +550 if(! +mosq +-> +s�_�x +){ + +551 #i� +OPENSSL_VERSION_NUMBER + < 0x10100000L + +552 +mosq +-> +s�_�x + = + `SSL_CTX_�w +( + `SSLv23_���_m�hod +()); + +554 +mosq +-> +s�_�x + = + `SSL_CTX_�w +( + `TLS_���_m�hod +()); + +557 if(! +mosq +-> +s�_�x +){ + +558 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "Error: Unable�o create TLS context."); + +559 + `COMPAT_CLOSE +( +mosq +-> +sock +); + +560 +mosq +-> +sock + = +INVALID_SOCKET +; + +561 + `�t__��t_s�_�r� +( +mosq +); + +562 +MOSQ_ERR_TLS +; + +566 if(! +mosq +-> +�s_v�si� +){ + +567 + `SSL_CTX_�t_�ti�s +( +mosq +-> +s�_�x +, +SSL_OP_NO_SSLv3 + | +SSL_OP_NO_TLSv1 +); + +568 #ifde� +SSL_OP_NO_TLSv1_3 + + +569 }if(! + `�rcmp +( +mosq +-> +�s_v�si� +, "tlsv1.3")){ + +570 + `SSL_CTX_�t_�ti�s +( +mosq +-> +s�_�x +, +SSL_OP_NO_SSLv3 + | +SSL_OP_NO_TLSv1 + | +SSL_OP_NO_TLSv1_1 + | +SSL_OP_NO_TLSv1_2 +); + +571 }if(! + `�rcmp +( +mosq +-> +�s_v�si� +, "tlsv1.2")){ + +572 + `SSL_CTX_�t_�ti�s +( +mosq +-> +s�_�x +, +SSL_OP_NO_SSLv3 + | +SSL_OP_NO_TLSv1 + | +SSL_OP_NO_TLSv1_1 + | +SSL_OP_NO_TLSv1_3 +); + +573 }if(! + `�rcmp +( +mosq +-> +�s_v�si� +, "tlsv1.1")){ + +574 + `SSL_CTX_�t_�ti�s +( +mosq +-> +s�_�x +, +SSL_OP_NO_SSLv3 + | +SSL_OP_NO_TLSv1 + | +SSL_OP_NO_TLSv1_2 + | +SSL_OP_NO_TLSv1_3 +); + +576 }if(! + `�rcmp +( +mosq +-> +�s_v�si� +, "tlsv1.2")){ + +577 + `SSL_CTX_�t_�ti�s +( +mosq +-> +s�_�x +, +SSL_OP_NO_SSLv3 + | +SSL_OP_NO_TLSv1 + | +SSL_OP_NO_TLSv1_1 +); + +578 }if(! + `�rcmp +( +mosq +-> +�s_v�si� +, "tlsv1.1")){ + +579 + `SSL_CTX_�t_�ti�s +( +mosq +-> +s�_�x +, +SSL_OP_NO_SSLv3 + | +SSL_OP_NO_TLSv1 + | +SSL_OP_NO_TLSv1_2 +); + +582 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "E��: Pr�oc� %�n� su�܋d.", mosq-> +�s_v�si� +); + +583 + `COMPAT_CLOSE +( +mosq +-> +sock +); + +584 +mosq +-> +sock + = +INVALID_SOCKET +; + +585 +MOSQ_ERR_INVAL +; + +589 + `SSL_CTX_�t_�ti�s +( +mosq +-> +s�_�x +, +SSL_OP_NO_COMPRESSION +); + +592 if( +mosq +-> +�s_�� +) { + +593 +�s_��_�n + = ( +u�t8_t +� + `���n +( +mosq +-> +�s_�� +, 254); + +594 +�s_��_w�e +[0] = +�s_��_�n +; + +595 + `mem�y +( +�s_��_w�e + + 1, +mosq +-> +�s_�� +, +�s_��_�n +); + +596 + `SSL_CTX_�t_��_��os +( +mosq +-> +s�_�x +, +�s_��_w�e +, +�s_��_�n + + 1); + +599 #ifde� +SSL_MODE_RELEASE_BUFFERS + + +601 + `SSL_CTX_�t_mode +( +mosq +-> +s�_�x +, +SSL_MODE_RELEASE_BUFFERS +); + +604 #i�! + `def�ed +( +OPENSSL_NO_ENGINE +) + +605 if( +mosq +-> +�s_�g�e +){ + +606 +�g�e + = + `ENGINE_by_id +( +mosq +-> +�s_�g�e +); + +607 if(! +�g�e +){ + +608 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "E�܆�d�g %��g�e\n", mosq-> +�s_�g�e +); + +609 + `COMPAT_CLOSE +( +mosq +-> +sock +); + +610 +MOSQ_ERR_TLS +; + +612 if(! + `ENGINE_�� +( +�g�e +)){ + +613 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "Failed�ngine initialisation\n"); + +614 + `ENGINE_� +( +�g�e +); + +615 + `COMPAT_CLOSE +( +mosq +-> +sock +); + +616 +MOSQ_ERR_TLS +; + +618 + `ENGINE_�t_de�u� +( +�g�e +, +ENGINE_METHOD_ALL +); + +619 + `ENGINE_� +( +�g�e +); + +623 if( +mosq +-> +�s_c�h�s +){ + +624 +�t + = + `SSL_CTX_�t_c�h�_li� +( +mosq +-> +s�_�x +, mosq-> +�s_c�h�s +); + +625 if( +�t + == 0){ + +626 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "E��: U�bˁأ�TLS c�h�s. Check c�h��i� \"%s\".", mosq-> +�s_c�h�s +); + +627 #i�! + `def�ed +( +OPENSSL_NO_ENGINE +) + +628 + `ENGINE_FINISH +( +�g�e +); + +630 + `COMPAT_CLOSE +( +mosq +-> +sock +); + +631 +mosq +-> +sock + = +INVALID_SOCKET +; + +632 + `�t__��t_s�_�r� +( +mosq +); + +633 +MOSQ_ERR_TLS +; + +636 if( +mosq +-> +�s_�f�e + || mosq-> +�s_��th +){ + +637 +�t + = + `SSL_CTX_l�d_v�ify_lo�ti�s +( +mosq +-> +s�_�x +, mosq-> +�s_�f�e +, mosq-> +�s_��th +); + +638 if( +�t + == 0){ + +639 #ifde� +WITH_BROKER + + +640 if( +mosq +-> +�s_�f�e + && mosq-> +�s_��th +){ + +641 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "E��: U�bˁ�l�d CA c�tifi��s, check bridge_�f��\"%s\"�nd bridge_��th \"%s\".", mosq-> +�s_�f�e +, mosq-> +�s_��th +); + +642 }if( +mosq +-> +�s_�f�e +){ + +643 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "E��: U�bˁ�l�d CA c�tifi��s, check bridge_�f��\"%s\".", mosq-> +�s_�f�e +); + +645 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "E��: U�bˁ�l�d CA c�tifi��s, check bridge_��th \"%s\".", mosq-> +�s_��th +); + +648 if( +mosq +-> +�s_�f�e + && mosq-> +�s_��th +){ + +649 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "E��: U�bˁ�l�d CA c�tifi��s, check caf��\"%s\"�nd c��h \"%s\".", mosq-> +�s_�f�e +, mosq-> +�s_��th +); + +650 }if( +mosq +-> +�s_�f�e +){ + +651 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "E��: U�bˁ�l�d CA c�tifi��s, check caf��\"%s\".", mosq-> +�s_�f�e +); + +653 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "E��: U�bˁ�l�d CA c�tifi��s, check c��h \"%s\".", mosq-> +�s_��th +); + +656 #i�! + `def�ed +( +OPENSSL_NO_ENGINE +) + +657 + `ENGINE_FINISH +( +�g�e +); + +659 + `COMPAT_CLOSE +( +mosq +-> +sock +); + +660 +mosq +-> +sock + = +INVALID_SOCKET +; + +661 + `�t__��t_s�_�r� +( +mosq +); + +662 +MOSQ_ERR_TLS +; + +664 if( +mosq +-> +�s_��_�qs + == 0){ + +665 + `SSL_CTX_�t_v�ify +( +mosq +-> +s�_�x +, +SSL_VERIFY_NONE +, +NULL +); + +667 + `SSL_CTX_�t_v�ify +( +mosq +-> +s�_�x +, +SSL_VERIFY_PEER +, +mosqu�to__�rv�_��ifi��_v�ify +); + +670 if( +mosq +-> +�s_pw_��back +){ + +671 + `SSL_CTX_�t_de�u�_�sswd_cb +( +mosq +-> +s�_�x +, mosq-> +�s_pw_��back +); + +672 + `SSL_CTX_�t_de�u�_�sswd_cb_u�rd�a +( +mosq +-> +s�_�x +, mosq); + +675 if( +mosq +-> +�s_��f�e +){ + +676 +�t + = + `SSL_CTX_u�_��ifi��_cha�_f�e +( +mosq +-> +s�_�x +, mosq-> +�s_��f�e +); + +677 if( +�t + != 1){ + +678 #ifde� +WITH_BROKER + + +679 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "E��: U�bˁ�l�d cl�� c�tifi��, check bridge_��f��\"%s\".", mosq-> +�s_��f�e +); + +681 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "E��: U�bˁ�l�d cl�� c�tifi�� \"%s\".", mosq-> +�s_��f�e +); + +683 #i�! + `def�ed +( +OPENSSL_NO_ENGINE +) + +684 + `ENGINE_FINISH +( +�g�e +); + +686 + `COMPAT_CLOSE +( +mosq +-> +sock +); + +687 +mosq +-> +sock + = +INVALID_SOCKET +; + +688 + `�t__��t_s�_�r� +( +mosq +); + +689 +MOSQ_ERR_TLS +; + +692 if( +mosq +-> +�s_keyf�e +){ + +693 if( +mosq +-> +�s_keyf�m + =� +mosq_k_�g�e +){ + +694 #i�! + `def�ed +( +OPENSSL_NO_ENGINE +) + +695 +UI_METHOD + * +ui_m�hod + = + `�t__g�_ui_m�hod +(); + +696 if( +mosq +-> +�s_�g�e_k�ss_sha1 +){ + +697 if(! + `ENGINE_��_cmd +( +�g�e +, +ENGINE_SECRET_MODE +, +ENGINE_SECRET_MODE_SHA +, +NULL +, NULL, 0)){ + +698 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "Error: Unable�o set�ngine secret mode sha1"); + +699 + `ENGINE_FINISH +( +�g�e +); + +700 + `COMPAT_CLOSE +( +mosq +-> +sock +); + +701 + `�t__��t_s�_�r� +( +mosq +); + +702 +MOSQ_ERR_TLS +; + +704 if(! + `ENGINE_��_cmd +( +�g�e +, +ENGINE_PIN +, 0, +mosq +-> +�s_�g�e_k�ss_sha1 +, +NULL +, 0)){ + +705 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "Error: Unable�o set�ngine�in"); + +706 + `ENGINE_FINISH +( +�g�e +); + +707 + `COMPAT_CLOSE +( +mosq +-> +sock +); + +708 + `�t__��t_s�_�r� +( +mosq +); + +709 +MOSQ_ERR_TLS +; + +711 +ui_m�hod + = +NULL +; + +713 +EVP_PKEY + * +pkey + = + `ENGINE_l�d_�iv�e_key +( +�g�e +, +mosq +-> +�s_keyf�e +, +ui_m�hod +, +NULL +); + +714 if(! +pkey +){ + +715 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "E��: U�bˁ�l�d�ng���iv��key f��\"%s\".", mosq-> +�s_keyf�e +); + +716 + `ENGINE_FINISH +( +�g�e +); + +717 + `COMPAT_CLOSE +( +mosq +-> +sock +); + +718 + `�t__��t_s�_�r� +( +mosq +); + +719 +MOSQ_ERR_TLS +; + +721 if( + `SSL_CTX_u�_Priv�eKey +( +mosq +-> +s�_�x +, +pkey +) <= 0){ + +722 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "E��: U�bˁ�u��ng���iv��key f��\"%s\".", mosq-> +�s_keyf�e +); + +723 + `ENGINE_FINISH +( +�g�e +); + +724 + `COMPAT_CLOSE +( +mosq +-> +sock +); + +725 + `�t__��t_s�_�r� +( +mosq +); + +726 +MOSQ_ERR_TLS +; + +730 +�t + = + `SSL_CTX_u�_Priv�eKey_f�e +( +mosq +-> +s�_�x +, mosq-> +�s_keyf�e +, +SSL_FILETYPE_PEM +); + +731 if( +�t + != 1){ + +732 #ifde� +WITH_BROKER + + +733 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "E��: U�bˁ�l�d cl�� key f�e, check bridge_keyf��\"%s\".", mosq-> +�s_keyf�e +); + +735 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "E��: U�bˁ�l�d cl�� key f��\"%s\".", mosq-> +�s_keyf�e +); + +737 #i�! + `def�ed +( +OPENSSL_NO_ENGINE +) + +738 + `ENGINE_FINISH +( +�g�e +); + +740 + `COMPAT_CLOSE +( +mosq +-> +sock +); + +741 +mosq +-> +sock + = +INVALID_SOCKET +; + +742 + `�t__��t_s�_�r� +( +mosq +); + +743 +MOSQ_ERR_TLS +; + +746 +�t + = + `SSL_CTX_check_�iv�e_key +( +mosq +-> +s�_�x +); + +747 if( +�t + != 1){ + +748 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "Error: Client certificate/key�re inconsistent."); + +749 #i�! + `def�ed +( +OPENSSL_NO_ENGINE +) + +750 + `ENGINE_FINISH +( +�g�e +); + +752 + `COMPAT_CLOSE +( +mosq +-> +sock +); + +753 +mosq +-> +sock + = +INVALID_SOCKET +; + +754 + `�t__��t_s�_�r� +( +mosq +); + +755 +MOSQ_ERR_TLS +; + +758 #ifde� +FINAL_WITH_TLS_PSK + + +759 }if( +mosq +-> +�s_psk +){ + +760 + `SSL_CTX_�t_psk_���_��back +( +mosq +-> +s�_�x +, +psk_���_��back +); + +765 +MOSQ_ERR_SUCCESS +; + +766 + } +} + +770 + $�t__sock�_c���_��3 +( +mosqu�to + * +mosq +, cڡ * +ho� +) + +772 #ifde� +WITH_TLS + + +773 +BIO + * +bio +; + +775 +rc + = + `�t__��_s�_�x +( +mosq +); + +776 if( +rc +) �c; + +778 if( +mosq +-> +s�_�x +){ + +779 if( +mosq +-> +s� +){ + +780 + `SSL_� +( +mosq +-> +s� +); + +782 +mosq +-> +s� + = + `SSL_�w +(mosq-> +s�_�x +); + +783 if(! +mosq +-> +s� +){ + +784 + `COMPAT_CLOSE +( +mosq +-> +sock +); + +785 +mosq +-> +sock + = +INVALID_SOCKET +; + +786 + `�t__��t_s�_�r� +( +mosq +); + +787 +MOSQ_ERR_TLS +; + +790 + `SSL_�t_ex_d�a +( +mosq +-> +s� +, +�s_ex_�dex_mosq +, mosq); + +791 +bio + = + `BIO_�w_sock� +( +mosq +-> +sock +, +BIO_NOCLOSE +); + +792 if(! +bio +){ + +793 + `COMPAT_CLOSE +( +mosq +-> +sock +); + +794 +mosq +-> +sock + = +INVALID_SOCKET +; + +795 + `�t__��t_s�_�r� +( +mosq +); + +796 +MOSQ_ERR_TLS +; + +798 + `SSL_�t_bio +( +mosq +-> +s� +, +bio +, bio); + +803 if( + `SSL_�t_��xt_ho�_�me +( +mosq +-> +s� +, +ho� +) != 1) { + +804 + `COMPAT_CLOSE +( +mosq +-> +sock +); + +805 +mosq +-> +sock + = +INVALID_SOCKET +; + +806 +MOSQ_ERR_TLS +; + +809 if( + `�t__sock�_c���_�s +( +mosq +)){ + +810 +MOSQ_ERR_TLS +; + +815 +MOSQ_ERR_SUCCESS +; + +816 + } +} + +819 + $�t__sock�_c��� +( +mosqu�to + * +mosq +, cڡ * +ho� +, +u�t16_t + +p�t +, cڡ * +b�d_add�ss +, +bo� + +block�g +) + +821 +mosq_sock_t + +sock + = +INVALID_SOCKET +; + +822 +rc +, +rc2 +; + +824 if(! +mosq + || ! +ho� + || ! +p�t +� +MOSQ_ERR_INVAL +; + +826 +rc + = + `�t__�y_c��� +( +ho� +, +p�t +, & +sock +, +b�d_add�ss +, +block�g +); + +827 if( +rc + > 0) �c; + +829 +mosq +-> +sock + = sock; + +831 #i� + `def�ed +( +WITH_SOCKS +�&& !def�ed( +WITH_BROKER +) + +832 if(! +mosq +-> +socks5_ho� +) + +835 +rc2 + = + `�t__sock�_c���_��3 +( +mosq +, +ho� +); + +836 if( +rc2 +) �c2; + +839 +MOSQ_ERR_SUCCESS +; + +840 + } +} + +843 +ssize_t + + $�t__�ad +( +mosqu�to + * +mosq +, * +buf +, +size_t + +cou� +) + +845 #ifde� +WITH_TLS + + +846 +�t +; + +847 +�r +; + +849 + `as�� +( +mosq +); + +850 +��o + = 0; + +851 #ifde� +WITH_TLS + + +852 if( +mosq +-> +s� +){ + +853 + `ERR_��r_�r� +(); + +854 +�t + = + `SSL_�ad +( +mosq +-> +s� +, +buf +, +cou� +); + +855 if( +�t + <= 0){ + +856 +�r + = + `SSL_g�_�r� +( +mosq +-> +s� +, +�t +); + +857 if( +�r + =� +SSL_ERROR_WANT_READ +){ + +858 +�t + = -1; + +859 +��o + = +EAGAIN +; + +860 }if( +�r + =� +SSL_ERROR_WANT_WRITE +){ + +861 +�t + = -1; + +862 +mosq +-> +w�t_wr�e + = +�ue +; + +863 +��o + = +EAGAIN +; + +865 + `�t__��t_s�_�r� +( +mosq +); + +866 +��o + = +EPROTO +; + +868 #ifde� +WIN32 + + +869 + `WSAS�La�E�� +( +��o +); + +872 ( +ssize_t + ) +�t +; + +878 #i�de� +WIN32 + + +879 + `�ad +( +mosq +-> +sock +, +buf +, +cou� +); + +881 + `�cv +( +mosq +-> +sock +, +buf +, +cou� +, 0); + +884 #ifde� +WITH_TLS + + +887 + } +} + +889 +ssize_t + + $�t__wr�e +( +mosqu�to + * +mosq +, * +buf +, +size_t + +cou� +) + +891 #ifde� +WITH_TLS + + +892 +�t +; + +893 +�r +; + +895 + `as�� +( +mosq +); + +897 +��o + = 0; + +898 #ifde� +WITH_TLS + + +899 if( +mosq +-> +s� +){ + +900 +mosq +-> +w�t_wr�e + = +�l� +; + +901 + `ERR_��r_�r� +(); + +902 +�t + = + `SSL_wr�e +( +mosq +-> +s� +, +buf +, +cou� +); + +903 if( +�t + < 0){ + +904 +�r + = + `SSL_g�_�r� +( +mosq +-> +s� +, +�t +); + +905 if( +�r + =� +SSL_ERROR_WANT_READ +){ + +906 +�t + = -1; + +907 +��o + = +EAGAIN +; + +908 }if( +�r + =� +SSL_ERROR_WANT_WRITE +){ + +909 +�t + = -1; + +910 +mosq +-> +w�t_wr�e + = +�ue +; + +911 +��o + = +EAGAIN +; + +913 + `�t__��t_s�_�r� +( +mosq +); + +914 +��o + = +EPROTO +; + +916 #ifde� +WIN32 + + +917 + `WSAS�La�E�� +( +��o +); + +920 ( +ssize_t + ) +�t +; + +925 #i�de� +WIN32 + + +926 + `wr�e +( +mosq +-> +sock +, +buf +, +cou� +); + +928 + `�nd +( +mosq +-> +sock +, +buf +, +cou� +, 0); + +931 #ifde� +WITH_TLS + + +934 + } +} + +937 + $�t__sock�_n�block +( +mosq_sock_t + * +sock +) + +939 #i�de� +WIN32 + + +940 +�t +; + +942 +�t + = + `f�� +(* +sock +, +F_GETFL +, 0); + +943 if( +�t + == -1){ + +944 + `COMPAT_CLOSE +(* +sock +); + +945 * +sock + = +INVALID_SOCKET +; + +946 +MOSQ_ERR_ERRNO +; + +948 if( + `f�� +(* +sock +, +F_SETFL +, +�t + | +O_NONBLOCK +) == -1){ + +950 + `COMPAT_CLOSE +(* +sock +); + +951 +MOSQ_ERR_ERRNO +; + +954 +�t + = 1; + +955 if( + `io�lsock� +(* +sock +, +FIONBIO +, & +�t +)){ + +956 + `COMPAT_CLOSE +(* +sock +); + +957 +MOSQ_ERR_ERRNO +; + +960 +MOSQ_ERR_SUCCESS +; + +961 + } +} + +964 #i�de� +WITH_BROKER + + +965 + $�t__sock��� +( +mosq_sock_t + * +��R +, mosq_sock_�* +��W +) + +967 #ifde� +WIN32 + + +968 +�m�y +[2] = { +AF_INET +, +AF_INET6 +}; + +969 +i +; + +970 +sockaddr_��age + +ss +; + +971 +sockaddr_� + * +� + = (sockaddr_� *)& +ss +; + +972 +sockaddr_�6 + * +�6 + = (sockaddr_�6 *)& +ss +; + +973 +sock�n_t + +ss_�n +; + +974 +mosq_sock_t + +�R +, +�W +; + +976 +mosq_sock_t + +li��sock +; + +978 * +��R + = +INVALID_SOCKET +; + +979 * +��W + = +INVALID_SOCKET +; + +981 +i +=0; i<2; i++){ + +982 + `mem�t +(& +ss +, 0, (ss)); + +983 if( +�m�y +[ +i +] =� +AF_INET +){ + +984 +� +-> +s�_�m�y + = +�m�y +[ +i +]; + +985 +� +-> +s�_addr +. +s_addr + = + `ht�l +( +INADDR_LOOPBACK +); + +986 +� +-> +s�_p�t + = 0; + +987 +ss_�n + = ( +sockaddr_� +); + +988 }if( +�m�y +[ +i +] =� +AF_INET6 +){ + +989 +�6 +-> +s�6_�m�y + = +�m�y +[ +i +]; + +990 +�6 +-> +s�6_addr + = +�6addr_lo�back +; + +991 +�6 +-> +s�6_p�t + = 0; + +992 +ss_�n + = ( +sockaddr_�6 +); + +994 +MOSQ_ERR_INVAL +; + +997 +li��sock + = + `sock� +( +�m�y +[ +i +], +SOCK_STREAM +, +IPPROTO_TCP +); + +998 if( +li��sock + == -1){ + +1002 if( + `b�d +( +li��sock +, ( +sockaddr + *)& +ss +, +ss_�n +) == -1){ + +1003 + `COMPAT_CLOSE +( +li��sock +); + +1007 if( + `li�� +( +li��sock +, 1) == -1){ + +1008 + `COMPAT_CLOSE +( +li��sock +); + +1011 + `mem�t +(& +ss +, 0, (ss)); + +1012 +ss_�n + = ( +ss +); + +1013 if( + `g�sock�me +( +li��sock +, ( +sockaddr + *)& +ss +, & +ss_�n +) < 0){ + +1014 + `COMPAT_CLOSE +( +li��sock +); + +1018 if( +�m�y +[ +i +] =� +AF_INET +){ + +1019 +� +-> +s�_�m�y + = +�m�y +[ +i +]; + +1020 +� +-> +s�_addr +. +s_addr + = + `ht�l +( +INADDR_LOOPBACK +); + +1021 +ss_�n + = ( +sockaddr_� +); + +1022 }if( +�m�y +[ +i +] =� +AF_INET6 +){ + +1023 +�6 +-> +s�6_�m�y + = +�m�y +[ +i +]; + +1024 +�6 +-> +s�6_addr + = +�6addr_lo�back +; + +1025 +ss_�n + = ( +sockaddr_�6 +); + +1028 +�R + = + `sock� +( +�m�y +[ +i +], +SOCK_STREAM +, +IPPROTO_TCP +); + +1029 if( +�R + == -1){ + +1030 + `COMPAT_CLOSE +( +li��sock +); + +1033 if( + `�t__sock�_n�block +(& +�R +)){ + +1034 + `COMPAT_CLOSE +( +li��sock +); + +1037 if( + `c��� +( +�R +, ( +sockaddr + *)& +ss +, +ss_�n +) < 0){ + +1038 #ifde� +WIN32 + + +1039 +��o + = + `WSAG�La�E�� +(); + +1041 if( +��o + !� +EINPROGRESS + &&��n�!� +COMPAT_EWOULDBLOCK +){ + +1042 + `COMPAT_CLOSE +( +�R +); + +1043 + `COMPAT_CLOSE +( +li��sock +); + +1047 +�W + = + `ac�� +( +li��sock +, +NULL +, 0); + +1048 if( +�W + == -1){ + +1049 #ifde� +WIN32 + + +1050 +��o + = + `WSAG�La�E�� +(); + +1052 if( +��o + !� +EINPROGRESS + &&��n�!� +COMPAT_EWOULDBLOCK +){ + +1053 + `COMPAT_CLOSE +( +�R +); + +1054 + `COMPAT_CLOSE +( +li��sock +); + +1059 if( + `�t__sock�_n�block +(& +�W +)){ + +1060 + `COMPAT_CLOSE +( +�R +); + +1061 + `COMPAT_CLOSE +( +li��sock +); + +1064 + `COMPAT_CLOSE +( +li��sock +); + +1066 * +��R + = +�R +; + +1067 * +��W + = +�W +; + +1068 +MOSQ_ERR_SUCCESS +; + +1070 +MOSQ_ERR_UNKNOWN +; + +1072 +sv +[2]; + +1074 if( + `sock��� +( +AF_UNIX +, +SOCK_STREAM +, 0, +sv +) == -1){ + +1075 +MOSQ_ERR_ERRNO +; + +1077 if( + `�t__sock�_n�block +(& +sv +[0])){ + +1078 + `COMPAT_CLOSE +( +sv +[1]); + +1079 +MOSQ_ERR_ERRNO +; + +1081 if( + `�t__sock�_n�block +(& +sv +[1])){ + +1082 + `COMPAT_CLOSE +( +sv +[0]); + +1083 +MOSQ_ERR_ERRNO +; + +1085 * +��R + = +sv +[0]; + +1086 * +��W + = +sv +[1]; + +1087 +MOSQ_ERR_SUCCESS +; + +1089 + } +} + + @lib/net_mosq.h + +16 #i�de� +NET_MOSQ_H + + +17 + #NET_MOSQ_H + + + ) + +19 #i�de� +WIN32 + + +20 + ~<uni�d.h +> + +22 + ~<w�sock2.h +> + +23 +SSIZE_T + + tssize_t +; + +26 + ~"mosqu�to_����.h +" + +27 + ~"mosqu�to.h +" + +29 #ifde� +WITH_BROKER + + +30 + gmosqu�to_db +; + +33 #ifde� +WIN32 + + +34 + #COMPAT_CLOSE +( +a +� + `�o�sock� +�) + + ) + +35 + #COMPAT_ECONNRESET + +WSAECONNRESET + + + ) + +36 + #COMPAT_EWOULDBLOCK + +WSAEWOULDBLOCK + + + ) + +38 + #COMPAT_CLOSE +( +a +� + `�o� +�) + + ) + +39 + #COMPAT_ECONNRESET + +ECONNRESET + + + ) + +40 + #COMPAT_EWOULDBLOCK + +EWOULDBLOCK + + + ) + +44 #i�de� +INVALID_SOCKET + + +45 + #INVALID_SOCKET + -1 + + ) + +49 + #MOSQ_MSB +( +A +�( +u�t8_t +)((A & 0xFF00�>> 8) + + ) + +50 + #MOSQ_LSB +( +A +�( +u�t8_t +)(A & 0x00FF) + + ) + +52 +�t__�� +(); + +53 +�t__��nup +(); + +55 +�t__sock�_c��� +( +mosqu�to + * +mosq +, cڡ * +ho� +, +u�t16_t + +p�t +, cڡ * +b�d_add�ss +, +bo� + +block�g +); + +56 #ifde� +WITH_BROKER + + +57 +�t__sock�_�o� +( +mosqu�to_db + * +db +, +mosqu�to + * +mosq +); + +59 +�t__sock�_�o� +( +mosqu�to + * +mosq +); + +61 +�t__�y_c��� +(cڡ * +ho� +, +u�t16_t + +p�t +, +mosq_sock_t + * +sock +, cڡ * +b�d_add�ss +, +bo� + +block�g +); + +62 +�t__�y_c���_��1 +( +mosqu�to + * +mosq +, cڡ * +ho� +); + +63 +�t__�y_c���_��2 +( +mosqu�to + * +mosq +, +u�t16_t + +p�t +, +mosq_sock_t + * +sock +); + +64 +�t__sock�_c���_��3 +( +mosqu�to + * +mosq +, cڡ * +ho� +); + +65 +�t__sock�_n�block +( +mosq_sock_t + * +sock +); + +66 +�t__sock��� +( +mosq_sock_t + * +�1 +, mosq_sock_�* +�2 +); + +68 +ssize_t + +�t__�ad +( +mosqu�to + * +mosq +, * +buf +, +size_t + +cou� +); + +69 +ssize_t + +�t__wr�e +( +mosqu�to + * +mosq +, * +buf +, +size_t + +cou� +); + +71 #ifde� +WITH_TLS + + +72 +�t__sock�_��y_�s +( +mosqu�to + * +mosq +); + +73 +�t__sock�_c���_�s +( +mosqu�to + * +mosq +); + +74 +mosqu�to__v�ify_oc�_��us_cb +( +SSL + * +s� +, * +�g +); + +75 +UI_METHOD + * +�t__g�_ui_m�hod +(); + +76 + #ENGINE_FINISH +( +e +�if�� + `ENGINE_f�ish +�) + + ) + +77 + #ENGINE_SECRET_MODE + "SECRET_MODE" + + ) + +78 + #ENGINE_SECRET_MODE_SHA + 0x1000 + + ) + +79 + #ENGINE_PIN + "PIN" + + ) + + @lib/net_mosq_ocsp.c + +43 #ifde� +WITH_TLS + + +44 + ~<logg�g_mosq.h +> + +45 + ~<mosqu�to_����.h +> + +46 + ~<�t_mosq.h +> + +48 + ~<ݒs�/��ack.h +> + +49 + ~<ݒs�/�s1.h +> + +50 + ~<ݒs�/s�.h +> + +51 + ~<ݒs�/oc�.h +> + +53 + $mosqu�to__v�ify_oc�_��us_cb +( +SSL + * +s� +, * +�g +) + +55 +mosqu�to + * +mosq + = (mosqu�t�*) +�g +; + +56 +oc�_��us +, +�su�2 +, +i +; + +57 * +p +; + +58 cڡ * +� +; + +59 +OCSP_RESPONSE + * +r� + = +NULL +; + +60 +OCSP_BASICRESP + * +br + = +NULL +; + +61 +X509_STORE + * +� + = +NULL +; + +62 + `STACK_OF +( +X509 +�* +ch + = +NULL +; + +64 +�n + = + `SSL_g�_��xt_��us_oc�_�� +( +mosq +-> +s� +, & +p +); + +65 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "OCSP: SSL_g�_��xt_��us_oc�_����u�ed %ld by�s", +�n +); + +68 +� + = (cڡ *) +p +; + +70 i�(! +� + || +�n + <= 0) { + +71 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "OCSP:�o�esponse"); + +72 +�d +; + +76 +r� + = + `d2i_OCSP_RESPONSE +( +NULL +, & +� +, +�n +); + +77 i�( +r� +== +NULL +) { + +78 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "OCSP: invalid�esponse"); + +79 +�d +; + +82 +oc�_��us + = + `OCSP_��ڣ_��us +( +r� +); + +83 if( +oc�_��us + !� +OCSP_RESPONSE_STATUS_SUCCESSFUL +) { + +84 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "OCSP: invalid status: %s (%d)", + +85 + `OCSP_��ڣ_��us_�r +( +oc�_��us +), ocsp_status); + +86 +�d +; + +89 +br + = + `OCSP_��ڣ_g�1_basic +( +r� +); + +90 i�(! +br +) { + +91 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "OCSP: invalid�esponse"); + +92 +�d +; + +95 +ch + = + `SSL_g�_��_��_cha� +( +mosq +-> +s� +); + +96 i�( + `sk_X509_num +( +ch +) <= 0) { + +97 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "OCSP: w�did�لe�iv���ifi���o�th��rv� (num: %d)", + `sk_X509_num +( +ch +)); + +98 +�d +; + +101 +� + = + `SSL_CTX_g�_��_��e +( +mosq +-> +s�_�x +); + +107 i�(( +�su�2 += + `OCSP_basic_v�ify +( +br +, +ch +, +� +, 0)) <= 0) { + +108 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "OCSP:�e�ڣ v�ifi�ti� fa�ed (�r�: %d)", +�su�2 +); + +109 +�d +; + +112 +i + = 0; i < + `OCSP_��_cou� +( +br +); i++) { + +113 +��_��us +, +�l_�as� +; + +114 +OCSP_SINGLERESP + * +s�g� + = +NULL +; + +116 +ASN1_GENERALIZEDTIME + * +�v +, * +thisupd +, * +�xtupd +; + +118 +s�g� + = + `OCSP_��_g�0 +( +br +, +i +); + +119 if(! +s�g� +) + +122 +��_��us + = + `OCSP_s�g�_g�0_��us +( +s�g� +, & +�l_�as� +, & +�v +, & +thisupd +, & +�xtupd +); + +124 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "OCSP: SSL certificate status: %s (%d)", + +125 + `OCSP_��_��us_�r +( +��_��us +), cert_status); + +127 +��_��us +) { + +128 +V_OCSP_CERTSTATUS_GOOD +: + +130 if(! + `OCSP_check_v�id�y +( +thisupd +, +�xtupd +, 300L, -1L)) { + +131 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "OCSP: OCSP�esponse has�xpired"); + +132 +�d +; + +136 +V_OCSP_CERTSTATUS_REVOKED +: + +137 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "OCSP: SSL certificate�evocation�eason: %s (%d)", + +138 + `OCSP_�l_�as�_�r +( +�l_�as� +), crl_reason); + +139 +�d +; + +141 +V_OCSP_CERTSTATUS_UNKNOWN +: + +142 +�d +; + +145 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "OCSP: SSL certificate�evocation status unknown"); + +146 +�d +; + +150 i�( +br +!= +NULL +� + `OCSP_BASICRESP_� +(br); + +151 i�( +r� +!= +NULL +� + `OCSP_RESPONSE_� +(rsp); + +154 +�d +: + +155 i�( +br +!= +NULL +� + `OCSP_BASICRESP_� +(br); + +156 i�( +r� +!= +NULL +� + `OCSP_RESPONSE_� +(rsp); + +158 + } +} + + @lib/options.c + +17 + ~"c�fig.h +" + +19 #i�de� +WIN32 + + +20 + ~<�r�gs.h +> + +23 + ~<�r�g.h +> + +25 #ifde� +WITH_TLS + + +26 #ifde� +WIN32 + + +27 + ~<w�sock2.h +> + +29 + ~<ݒs�/�g�e.h +> + +32 + ~"mosqu�to.h +" + +33 + ~"mosqu�to_����.h +" + +34 + ~"mem�y_mosq.h +" + +35 + ~"mq�_��oc�.h +" + +36 + ~"ut�_mosq.h +" + +37 + ~"w�l_mosq.h +" + +40 + $mosqu�to_w�l_�t +( +mosqu�to + * +mosq +, cڡ * +t�ic +, +�yl�d�n +, cڡ * +�yl�d +, +qos +, +bo� + +��� +) + +42 + `mosqu�to_w�l_�t_v5 +( +mosq +, +t�ic +, +�yl�d�n +, +�yl�d +, +qos +, +��� +, +NULL +); + +43 + } +} + +46 + $mosqu�to_w�l_�t_v5 +( +mosqu�to + * +mosq +, cڡ * +t�ic +, +�yl�d�n +, cڡ * +�yl�d +, +qos +, +bo� + +��� +, +mosqu�to_�ݔty + * +�ݔt�s +) + +48 +rc +; + +50 if(! +mosq +� +MOSQ_ERR_INVAL +; + +52 if( +�ݔt�s +){ + +53 +rc + = + `mosqu�to_�ݔty_check_�l +( +CMD_WILL +, +�ݔt�s +); + +54 if( +rc +) �c; + +57 + `w�l__�t +( +mosq +, +t�ic +, +�yl�d�n +, +�yl�d +, +qos +, +��� +, +�ݔt�s +); + +58 + } +} + +61 + $mosqu�to_w�l_��r +( +mosqu�to + * +mosq +) + +63 if(! +mosq +� +MOSQ_ERR_INVAL +; + +64 + `w�l__��r +( +mosq +); + +65 + } +} + +68 + $mosqu�to_u��ame_pw_�t +( +mosqu�to + * +mosq +, cڡ * +u��ame +, cڡ * +�ssw�d +) + +70 if(! +mosq +� +MOSQ_ERR_INVAL +; + +72 if( +mosq +-> +��oc� + =� +mosq_p_mq�311 + || mosq->��oc� =� +mosq_p_mq�31 +){ + +73 if( +�ssw�d + !� +NULL + && +u��ame + == NULL){ + +74 +MOSQ_ERR_INVAL +; + +78 + `mosqu�to__� +( +mosq +-> +u��ame +); + +79 +mosq +-> +u��ame + = +NULL +; + +81 + `mosqu�to__� +( +mosq +-> +�ssw�d +); + +82 +mosq +-> +�ssw�d + = +NULL +; + +84 if( +u��ame +){ + +85 if( + `mosqu�to_v�id�e_utf8 +( +u��ame +, + `��� +(username))){ + +86 +MOSQ_ERR_MALFORMED_UTF8 +; + +88 +mosq +-> +u��ame + = + `mosqu�to__�rdup +(username); + +89 if(! +mosq +-> +u��ame +� +MOSQ_ERR_NOMEM +; + +92 if( +�ssw�d +){ + +93 +mosq +-> +�ssw�d + = + `mosqu�to__�rdup +(password); + +94 if(! +mosq +-> +�ssw�d +){ + +95 + `mosqu�to__� +( +mosq +-> +u��ame +); + +96 +mosq +-> +u��ame + = +NULL +; + +97 +MOSQ_ERR_NOMEM +; + +100 +MOSQ_ERR_SUCCESS +; + +101 + } +} + +104 + $mosqu�to_�c���_d�ay_�t +( +mosqu�to + * +mosq +, +�c���_d�ay +, +�c���_d�ay_max +, +bo� + +�c���_expڒt�l_backoff +) + +106 if(! +mosq +� +MOSQ_ERR_INVAL +; + +108 if( +�c���_d�ay + == 0)�econnect_delay = 1; + +110 +mosq +-> +�c���_d�ay + =�econnect_delay; + +111 +mosq +-> +�c���_d�ay_max + =�econnect_delay_max; + +112 +mosq +-> +�c���_expڒt�l_backoff + =�econnect_exponential_backoff; + +114 +MOSQ_ERR_SUCCESS +; + +116 + } +} + +119 +mosqu�to_�s_�t +( +mosqu�to + * +mosq +, cڡ * +�f�e +, cڡ * +��th +, cڡ * +��f�e +, cڡ * +keyf�e +, (* +pw_��back +)(* +buf +, +size +, +rw�ag +, * +u�rd�a +)) + +121 #ifde� +WITH_TLS + + +122 +FILE + * +� +; + +124 if(! +mosq + || (! +�f�e + && ! +��th +�|| ( +��f�e + && ! +keyf�e +�|| (!��f��&& keyf�e)� +MOSQ_ERR_INVAL +; + +126 + `mosqu�to__� +( +mosq +-> +�s_�f�e +); + +127 +mosq +-> +�s_�f�e + = +NULL +; + +128 if( +�f�e +){ + +129 +� + = + `mosqu�to__fݒ +( +�f�e +, "�", +�l� +); + +130 if( +� +){ + +131 + `f�o� +( +� +); + +133 +MOSQ_ERR_INVAL +; + +135 +mosq +-> +�s_�f�e + = + `mosqu�to__�rdup +( +�f�e +); + +137 if(! +mosq +-> +�s_�f�e +){ + +138 +MOSQ_ERR_NOMEM +; + +142 + `mosqu�to__� +( +mosq +-> +�s_��th +); + +143 +mosq +-> +�s_��th + = +NULL +; + +144 if( +��th +){ + +145 +mosq +-> +�s_��th + = + `mosqu�to__�rdup +( +��th +); + +146 if(! +mosq +-> +�s_��th +){ + +147 +MOSQ_ERR_NOMEM +; + +151 + `mosqu�to__� +( +mosq +-> +�s_��f�e +); + +152 +mosq +-> +�s_��f�e + = +NULL +; + +153 if( +��f�e +){ + +154 +� + = + `mosqu�to__fݒ +( +��f�e +, "�", +�l� +); + +155 if( +� +){ + +156 + `f�o� +( +� +); + +158 + `mosqu�to__� +( +mosq +-> +�s_�f�e +); + +159 +mosq +-> +�s_�f�e + = +NULL +; + +161 + `mosqu�to__� +( +mosq +-> +�s_��th +); + +162 +mosq +-> +�s_��th + = +NULL +; + +163 +MOSQ_ERR_INVAL +; + +165 +mosq +-> +�s_��f�e + = + `mosqu�to__�rdup +( +��f�e +); + +166 if(! +mosq +-> +�s_��f�e +){ + +167 +MOSQ_ERR_NOMEM +; + +171 + `mosqu�to__� +( +mosq +-> +�s_keyf�e +); + +172 +mosq +-> +�s_keyf�e + = +NULL +; + +173 if( +keyf�e +){ + +174 +� + = + `mosqu�to__fݒ +( +keyf�e +, "�", +�l� +); + +175 if( +� +){ + +176 + `f�o� +( +� +); + +178 + `mosqu�to__� +( +mosq +-> +�s_�f�e +); + +179 +mosq +-> +�s_�f�e + = +NULL +; + +181 + `mosqu�to__� +( +mosq +-> +�s_��th +); + +182 +mosq +-> +�s_��th + = +NULL +; + +184 + `mosqu�to__� +( +mosq +-> +�s_��f�e +); + +185 +mosq +-> +�s_��f�e + = +NULL +; + +186 +MOSQ_ERR_INVAL +; + +188 +mosq +-> +�s_keyf�e + = + `mosqu�to__�rdup +( +keyf�e +); + +189 if(! +mosq +-> +�s_keyf�e +){ + +190 +MOSQ_ERR_NOMEM +; + +194 +mosq +-> +�s_pw_��back + = +pw_��back +; + +197 +MOSQ_ERR_SUCCESS +; + +199 +MOSQ_ERR_NOT_SUPPORTED +; + +202 + } +} + +205 + $mosqu�to_�s_�ts_�t +( +mosqu�to + * +mosq +, +��_�qs +, cڡ * +�s_v�si� +, cڡ * +c�h�s +) + +207 #ifde� +WITH_TLS + + +208 if(! +mosq +� +MOSQ_ERR_INVAL +; + +210 +mosq +-> +�s_��_�qs + = +��_�qs +; + +211 if( +�s_v�si� +){ + +212 if(! + `�r��cmp +( +�s_v�si� +, "tlsv1.3") + +213 || ! + `�r��cmp +( +�s_v�si� +, "tlsv1.2") + +214 || ! + `�r��cmp +( +�s_v�si� +, "tlsv1.1")){ + +216 +mosq +-> +�s_v�si� + = + `mosqu�to__�rdup +(tls_version); + +217 if(! +mosq +-> +�s_v�si� +� +MOSQ_ERR_NOMEM +; + +219 +MOSQ_ERR_INVAL +; + +222 +mosq +-> +�s_v�si� + = + `mosqu�to__�rdup +("tlsv1.2"); + +223 if(! +mosq +-> +�s_v�si� +� +MOSQ_ERR_NOMEM +; + +225 if( +c�h�s +){ + +226 +mosq +-> +�s_c�h�s + = + `mosqu�to__�rdup +( +c�h�s +); + +227 if(! +mosq +-> +�s_c�h�s +� +MOSQ_ERR_NOMEM +; + +229 +mosq +-> +�s_c�h�s + = +NULL +; + +233 +MOSQ_ERR_SUCCESS +; + +235 +MOSQ_ERR_NOT_SUPPORTED +; + +238 + } +} + +241 + $mosqu�to_�s_��cu�_�t +( +mosqu�to + * +mosq +, +bo� + +v�ue +) + +243 #ifde� +WITH_TLS + + +244 if(! +mosq +� +MOSQ_ERR_INVAL +; + +245 +mosq +-> +�s_��cu� + = +v�ue +; + +246 +MOSQ_ERR_SUCCESS +; + +248 +MOSQ_ERR_NOT_SUPPORTED +; + +250 + } +} + +253 + $mosqu�to_�r�g_�ti� +( +mosqu�to + * +mosq +, +mosq_�t_t + +�ti� +, cڡ * +v�ue +) + +255 #ifde� +WITH_TLS + + +256 +ENGINE + * +�g +; + +257 * +�r +; + +260 if(! +mosq +� +MOSQ_ERR_INVAL +; + +262 +�ti� +){ + +263 +MOSQ_OPT_TLS_ENGINE +: + +264 #ifde� +WITH_TLS + + +265 #i�! + `def�ed +( +OPENSSL_NO_ENGINE +) + +266 +�g + = + `ENGINE_by_id +( +v�ue +); + +267 if(! +�g +){ + +268 +MOSQ_ERR_INVAL +; + +270 + `ENGINE_� +( +�g +); + +271 +mosq +-> +�s_�g�e + = + `mosqu�to__�rdup +( +v�ue +); + +272 if(! +mosq +-> +�s_�g�e +){ + +273 +MOSQ_ERR_NOMEM +; + +275 +MOSQ_ERR_SUCCESS +; + +278 +MOSQ_ERR_NOT_SUPPORTED +; + +282 +MOSQ_OPT_TLS_KEYFORM +: + +283 #ifde� +WITH_TLS + + +284 if(! +v�ue +� +MOSQ_ERR_INVAL +; + +285 if(! + `�r��cmp +( +v�ue +, "pem")){ + +286 +mosq +-> +�s_keyf�m + = +mosq_k_�m +; + +287 }i�(! + `�r��cmp +( +v�ue +, "engine")){ + +288 +mosq +-> +�s_keyf�m + = +mosq_k_�g�e +; + +290 +MOSQ_ERR_INVAL +; + +293 +MOSQ_ERR_NOT_SUPPORTED +; + +298 +MOSQ_OPT_TLS_ENGINE_KPASS_SHA1 +: + +299 #ifde� +WITH_TLS + + +300 if( + `mosqu�to__hex2b�_sha1 +( +v�ue +, (**)& +�r +�!� +MOSQ_ERR_SUCCESS +){ + +301 +MOSQ_ERR_INVAL +; + +303 +mosq +-> +�s_�g�e_k�ss_sha1 + = +�r +; + +304 +MOSQ_ERR_SUCCESS +; + +306 +MOSQ_ERR_NOT_SUPPORTED +; + +310 +MOSQ_OPT_TLS_ALPN +: + +311 #ifde� +WITH_TLS + + +312 +mosq +-> +�s_�� + = + `mosqu�to__�rdup +( +v�ue +); + +313 if(! +mosq +-> +�s_�� +){ + +314 +MOSQ_ERR_NOMEM +; + +316 +MOSQ_ERR_SUCCESS +; + +318 +MOSQ_ERR_NOT_SUPPORTED +; + +323 +MOSQ_ERR_INVAL +; + +326 +MOSQ_ERR_INVAL +; + +327 + } +} + +330 + $mosqu�to_�s_psk_�t +( +mosqu�to + * +mosq +, cڡ * +psk +, cڡ * +id�t�y +, cڡ * +c�h�s +) + +332 #ifde� +FINAL_WITH_TLS_PSK + + +333 if(! +mosq + || ! +psk + || ! +id�t�y +� +MOSQ_ERR_INVAL +; + +336 if( + `�r�n +( +psk +, "0123456789abcdefABCDEF"�< + `��� +(psk)){ + +337 +MOSQ_ERR_INVAL +; + +339 +mosq +-> +�s_psk + = + `mosqu�to__�rdup +( +psk +); + +340 if(! +mosq +-> +�s_psk +� +MOSQ_ERR_NOMEM +; + +342 +mosq +-> +�s_psk_id�t�y + = + `mosqu�to__�rdup +( +id�t�y +); + +343 if(! +mosq +-> +�s_psk_id�t�y +){ + +344 + `mosqu�to__� +( +mosq +-> +�s_psk +); + +345 +MOSQ_ERR_NOMEM +; + +347 if( +c�h�s +){ + +348 +mosq +-> +�s_c�h�s + = + `mosqu�to__�rdup +( +c�h�s +); + +349 if(! +mosq +-> +�s_c�h�s +� +MOSQ_ERR_NOMEM +; + +351 +mosq +-> +�s_c�h�s + = +NULL +; + +354 +MOSQ_ERR_SUCCESS +; + +356 +MOSQ_ERR_NOT_SUPPORTED +; + +358 + } +} + +361 + $mosqu�to_�ts_�t +( +mosqu�to + * +mosq +, +mosq_�t_t + +�ti� +, * +v�ue +) + +363 +iv� +; + +365 if(! +mosq + || ! +v�ue +� +MOSQ_ERR_INVAL +; + +367 +�ti� +){ + +368 +MOSQ_OPT_PROTOCOL_VERSION +: + +369 +iv� + = *((*) +v�ue +); + +370 + `mosqu�to_�t_�ti� +( +mosq +, +�ti� +, +iv� +); + +371 +MOSQ_OPT_SSL_CTX +: + +372 #ifde� +WITH_TLS + + +373 +mosq +-> +s�_�x + = ( +SSL_CTX + *) +v�ue +; + +374 if( +mosq +-> +s�_�x +){ + +375 #i�( +OPENSSL_VERSION_NUMBER + >�0x10100000L�&& ! + `def�ed +( +LIBRESSL_VERSION_NUMBER +) + +376 + `SSL_CTX_up_�f +( +mosq +-> +s�_�x +); + +378 + `CRYPTO_add +(&( +mosq +-> +s�_�x +)-> +��n�s +, 1, +CRYPTO_LOCK_SSL_CTX +); + +383 +MOSQ_ERR_NOT_SUPPORTED +; + +386 +MOSQ_ERR_INVAL +; + +388 +MOSQ_ERR_SUCCESS +; + +389 + } +} + +392 + $mosqu�to_�t_�ti� +( +mosqu�to + * +mosq +, +mosq_�t_t + +�ti� +, +v�ue +) + +394 if(! +mosq +� +MOSQ_ERR_INVAL +; + +396 +�ti� +){ + +397 +MOSQ_OPT_PROTOCOL_VERSION +: + +398 if( +v�ue + =� +MQTT_PROTOCOL_V31 +){ + +399 +mosq +-> +��oc� + = +mosq_p_mq�31 +; + +400 }if( +v�ue + =� +MQTT_PROTOCOL_V311 +){ + +401 +mosq +-> +��oc� + = +mosq_p_mq�311 +; + +402 }if( +v�ue + =� +MQTT_PROTOCOL_V5 +){ + +403 +mosq +-> +��oc� + = +mosq_p_mq�5 +; + +405 +MOSQ_ERR_INVAL +; + +409 +MOSQ_OPT_RECEIVE_MAXIMUM +: + +410 if( +v�ue + < 0 || value > 65535){ + +411 +MOSQ_ERR_INVAL +; + +413 +mosq +-> +��ive_maximum + = +v�ue +; + +416 +MOSQ_OPT_SEND_MAXIMUM +: + +417 if( +v�ue + < 0 || value > 65535){ + +418 +MOSQ_ERR_INVAL +; + +420 +mosq +-> +�nd_maximum + = +v�ue +; + +423 +MOSQ_OPT_SSL_CTX_WITH_DEFAULTS +: + +424 #i� + `def�ed +( +WITH_TLS +�&& +OPENSSL_VERSION_NUMBER + >= 0x10100000L + +425 if( +v�ue +){ + +426 +mosq +-> +s�_�x_de�u�s + = +�ue +; + +428 +mosq +-> +s�_�x_de�u�s + = +�l� +; + +432 +MOSQ_ERR_NOT_SUPPORTED +; + +435 +MOSQ_OPT_TLS_OCSP_REQUIRED +: + +436 #ifde� +WITH_TLS + + +437 +mosq +-> +�s_oc�_�qu�ed + = ( +bo� +) +v�ue +; + +439 +MOSQ_ERR_NOT_SUPPORTED +; + +444 +MOSQ_ERR_INVAL +; + +446 +MOSQ_ERR_SUCCESS +; + +447 + } +} + +450 + $mosqu�to_void_�ti� +( +mosqu�to + * +mosq +, +mosq_�t_t + +�ti� +, * +v�ue +) + +452 if(! +mosq + || ! +v�ue +� +MOSQ_ERR_INVAL +; + +454 +�ti� +){ + +455 +MOSQ_OPT_SSL_CTX +: + +456 #ifde� +WITH_TLS + + +457 +mosq +-> +s�_�x + = ( +SSL_CTX + *) +v�ue +; + +458 if( +mosq +-> +s�_�x +){ + +459 #i�( +OPENSSL_VERSION_NUMBER + >�0x10100000L�&& ! + `def�ed +( +LIBRESSL_VERSION_NUMBER +) + +460 + `SSL_CTX_up_�f +( +mosq +-> +s�_�x +); + +462 + `CRYPTO_add +(&( +mosq +-> +s�_�x +)-> +��n�s +, 1, +CRYPTO_LOCK_SSL_CTX +); + +467 +MOSQ_ERR_NOT_SUPPORTED +; + +470 +MOSQ_ERR_INVAL +; + +472 +MOSQ_ERR_SUCCESS +; + +473 + } +} + +476 + $mosqu�to_u�r_d�a_�t +( +mosqu�to + * +mosq +, * +u�rd�a +) + +478 if( +mosq +){ + +479 +mosq +-> +u�rd�a + = userdata; + +481 + } +} + +483 * + $mosqu�to_u�rd�a +( +mosqu�to + * +mosq +) + +485 +mosq +-> +u�rd�a +; + +486 + } +} + + @lib/packet_datatypes.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<��o.h +> + +21 + ~<�r�g.h +> + +23 #ifde� +WITH_BROKER + + +24 + ~"mosqu�to_brok�_����.h +" + +25 #ifde� +WITH_WEBSOCKETS + + +26 + ~<libwebsock�s.h +> + +29 + ~"�ad_h�d�.h +" + +32 + ~"mem�y_mosq.h +" + +33 + ~"mq�_��oc�.h +" + +34 + ~"�t_mosq.h +" + +35 + ~"�ck�_mosq.h +" + +36 + ~"�ad_h�d�.h +" + +37 #ifde� +WITH_BROKER + + +38 + ~"sys_��.h +" + +40 + #G_BYTES_RECEIVED_INC +( +A +) + + ) + +41 + #G_BYTES_SENT_INC +( +A +) + + ) + +42 + #G_MSGS_SENT_INC +( +A +) + + ) + +43 + #G_PUB_MSGS_SENT_INC +( +A +) + + ) + +47 + $�ck�__�ad_by� +( +mosqu�to__�ck� + * +�ck� +, +u�t8_t + * +by� +) + +49 + `as�� +( +�ck� +); + +50 if( +�ck� +-> +pos ++1 >�ack�-> +�ma��g_�ngth +� +MOSQ_ERR_PROTOCOL +; + +52 * +by� + = +�ck� +-> +�yl�d +[�ck�-> +pos +]; + +53 +�ck� +-> +pos +++; + +55 +MOSQ_ERR_SUCCESS +; + +56 + } +} + +59 + $�ck�__wr�e_by� +( +mosqu�to__�ck� + * +�ck� +, +u�t8_t + +by� +) + +61 + `as�� +( +�ck� +); + +62 + `as�� +( +�ck� +-> +pos ++1 <�ck�-> +�ck�_�ngth +); + +64 +�ck� +-> +�yl�d +[�ck�-> +pos +] = +by� +; + +65 +�ck� +-> +pos +++; + +66 + } +} + +69 + $�ck�__�ad_by�s +( +mosqu�to__�ck� + * +�ck� +, * +by�s +, +u�t32_t + +cou� +) + +71 + `as�� +( +�ck� +); + +72 if( +�ck� +-> +pos ++ +cou� + >�ack�-> +�ma��g_�ngth +� +MOSQ_ERR_PROTOCOL +; + +74 + `mem�y +( +by�s +, &( +�ck� +-> +�yl�d +[�ck�-> +pos +]), +cou� +); + +75 +�ck� +-> +pos + +� +cou� +; + +77 +MOSQ_ERR_SUCCESS +; + +78 + } +} + +81 + $�ck�__wr�e_by�s +( +mosqu�to__�ck� + * +�ck� +, cڡ * +by�s +, +u�t32_t + +cou� +) + +83 + `as�� +( +�ck� +); + +84 + `as�� +( +�ck� +-> +pos ++ +cou� + <�ck�-> +�ck�_�ngth +); + +86 + `mem�y +(&( +�ck� +-> +�yl�d +[�ck�-> +pos +]), +by�s +, +cou� +); + +87 +�ck� +-> +pos + +� +cou� +; + +88 + } +} + +91 + $�ck�__�ad_b��y +( +mosqu�to__�ck� + * +�ck� +, +u�t8_t + ** +d�a +, * +�ngth +) + +93 +u�t16_t + +�� +; + +94 +rc +; + +96 + `as�� +( +�ck� +); + +97 +rc + = + `�ck�__�ad_u�t16 +( +�ck� +, & +�� +); + +98 if( +rc +) �c; + +100 if( +�� + == 0){ + +101 * +d�a + = +NULL +; + +102 * +�ngth + = 0; + +103 +MOSQ_ERR_SUCCESS +; + +106 if( +�ck� +-> +pos ++ +�� + >�ack�-> +�ma��g_�ngth +� +MOSQ_ERR_PROTOCOL +; + +108 * +d�a + = + `mosqu�to__m�loc +( +�� ++1); + +109 if(* +d�a +){ + +110 + `mem�y +(* +d�a +, &( +�ck� +-> +�yl�d +[�ck�-> +pos +]), +�� +); + +111 (( +u�t8_t + *)(* +d�a +))[ +�� +] = '\0'; + +112 +�ck� +-> +pos + +� +�� +; + +114 +MOSQ_ERR_NOMEM +; + +117 * +�ngth + = +�� +; + +118 +MOSQ_ERR_SUCCESS +; + +119 + } +} + +122 + $�ck�__�ad_�r�g +( +mosqu�to__�ck� + * +�ck� +, ** +�r +, * +�ngth +) + +124 +rc +; + +126 +rc + = + `�ck�__�ad_b��y +( +�ck� +, ( +u�t8_t + **) +�r +, +�ngth +); + +127 if( +rc +) �c; + +128 if(* +�ngth + =�0� +MOSQ_ERR_SUCCESS +; + +130 if( + `mosqu�to_v�id�e_utf8 +(* +�r +, * +�ngth +)){ + +131 + `mosqu�to__� +(* +�r +); + +132 * +�r + = +NULL +; + +133 * +�ngth + = -1; + +134 +MOSQ_ERR_MALFORMED_UTF8 +; + +137 +MOSQ_ERR_SUCCESS +; + +138 + } +} + +141 + $�ck�__wr�e_�r�g +( +mosqu�to__�ck� + * +�ck� +, cڡ * +�r +, +u�t16_t + +�ngth +) + +143 + `as�� +( +�ck� +); + +144 + `�ck�__wr�e_u�t16 +( +�ck� +, +�ngth +); + +145 + `�ck�__wr�e_by�s +( +�ck� +, +�r +, +�ngth +); + +146 + } +} + +149 + $�ck�__�ad_u�t16 +( +mosqu�to__�ck� + * +�ck� +, +u�t16_t + * +w�d +) + +151 +u�t8_t + +msb +, +lsb +; + +153 + `as�� +( +�ck� +); + +154 if( +�ck� +-> +pos ++2 >�ack�-> +�ma��g_�ngth +� +MOSQ_ERR_PROTOCOL +; + +156 +msb + = +�ck� +-> +�yl�d +[�ck�-> +pos +]; + +157 +�ck� +-> +pos +++; + +158 +lsb + = +�ck� +-> +�yl�d +[�ck�-> +pos +]; + +159 +�ck� +-> +pos +++; + +161 * +w�d + = ( +msb +<<8�+ +lsb +; + +163 +MOSQ_ERR_SUCCESS +; + +164 + } +} + +167 + $�ck�__wr�e_u�t16 +( +mosqu�to__�ck� + * +�ck� +, +u�t16_t + +w�d +) + +169 + `�ck�__wr�e_by� +( +�ck� +, + `MOSQ_MSB +( +w�d +)); + +170 + `�ck�__wr�e_by� +( +�ck� +, + `MOSQ_LSB +( +w�d +)); + +171 + } +} + +174 + $�ck�__�ad_u�t32 +( +mosqu�to__�ck� + * +�ck� +, +u�t32_t + * +w�d +) + +176 +u�t32_t + +v� + = 0; + +177 +i +; + +179 + `as�� +( +�ck� +); + +180 if( +�ck� +-> +pos ++4 >�ack�-> +�ma��g_�ngth +� +MOSQ_ERR_PROTOCOL +; + +182 +i +=0; i<4; i++){ + +183 +v� + = (v� << 8�+ +�ck� +-> +�yl�d +[�ck�-> +pos +]; + +184 +�ck� +-> +pos +++; + +187 * +w�d + = +v� +; + +189 +MOSQ_ERR_SUCCESS +; + +190 + } +} + +193 + $�ck�__wr�e_u�t32 +( +mosqu�to__�ck� + * +�ck� +, +u�t32_t + +w�d +) + +195 + `�ck�__wr�e_by� +( +�ck� +, ( +w�d + & 0xFF000000) >> 24); + +196 + `�ck�__wr�e_by� +( +�ck� +, ( +w�d + & 0x00FF0000) >> 16); + +197 + `�ck�__wr�e_by� +( +�ck� +, ( +w�d + & 0x0000FF00) >> 8); + +198 + `�ck�__wr�e_by� +( +�ck� +, ( +w�d + & 0x000000FF)); + +199 + } +} + +202 + $�ck�__�ad_v��t +( +mosqu�to__�ck� + * +�ck� +, +�t32_t + * +w�d +, +�t8_t + * +by�s +) + +204 +i +; + +205 +u�t8_t + +by� +; + +206 +�ma��g_mu� + = 1; + +207 +�t32_t + +lw�d + = 0; + +208 +u�t8_t + +lby�s + = 0; + +210 +i +=0; i<4; i++){ + +211 if( +�ck� +-> +pos + <�ack�-> +�ma��g_�ngth +){ + +212 +lby�s +++; + +213 +by� + = +�ck� +-> +�yl�d +[�ck�-> +pos +]; + +214 +lw�d + +�( +by� + & 127�* +�ma��g_mu� +; + +215 +�ma��g_mu� + *= 128; + +216 +�ck� +-> +pos +++; + +217 if(( +by� + & 128) == 0){ + +218 if( +lby�s + > 1 && +by� + == 0){ + +220 +MOSQ_ERR_PROTOCOL +; + +222 * +w�d + = +lw�d +; + +223 if( +by�s +�(*by�s�� +lby�s +; + +224 +MOSQ_ERR_SUCCESS +; + +228 +MOSQ_ERR_PROTOCOL +; + +231 +MOSQ_ERR_PROTOCOL +; + +232 + } +} + +235 + $�ck�__wr�e_v��t +( +mosqu�to__�ck� + * +�ck� +, +�t32_t + +w�d +) + +237 +u�t8_t + +by� +; + +238 +cou� + = 0; + +241 +by� + = +w�d + % 128; + +242 +w�d + = word / 128; + +244 if( +w�d + > 0){ + +245 +by� + = byte | 0x80; + +247 + `�ck�__wr�e_by� +( +�ck� +, +by� +); + +248 +cou� +++; + +249 } +w�d + > 0 && +cou� + < 5); + +251 if( +cou� + == 5){ + +252 +MOSQ_ERR_PROTOCOL +; + +254 +MOSQ_ERR_SUCCESS +; + +255 + } +} + +258 + $�ck�__v��t_by�s +( +�t32_t + +w�d +) + +260 if( +w�d + < 128){ + +262 }if( +w�d + < 16384){ + +264 }if( +w�d + < 2097152){ + +266 }if( +w�d + < 268435456){ + +271 + } +} + + @lib/packet_mosq.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<��o.h +> + +21 + ~<�r�g.h +> + +23 #ifde� +WITH_BROKER + + +24 + ~"mosqu�to_brok�_����.h +" + +25 #ifde� +WITH_WEBSOCKETS + + +26 + ~<libwebsock�s.h +> + +29 + ~"�ad_h�d�.h +" + +32 + ~"mem�y_mosq.h +" + +33 + ~"mq�_��oc�.h +" + +34 + ~"�t_mosq.h +" + +35 + ~"�ck�_mosq.h +" + +36 + ~"�ad_h�d�.h +" + +37 #ifde� +WITH_BROKER + + +38 + ~"sys_��.h +" + +39 + ~"�nd_mosq.h +" + +41 + #G_BYTES_RECEIVED_INC +( +A +) + + ) + +42 + #G_BYTES_SENT_INC +( +A +) + + ) + +43 + #G_MSGS_SENT_INC +( +A +) + + ) + +44 + #G_PUB_MSGS_SENT_INC +( +A +) + + ) + +47 + $�ck�__�loc +( +mosqu�to__�ck� + * +�ck� +) + +49 +u�t8_t + +�ma��g_by�s +[5], +by� +; + +50 +u�t32_t + +�ma��g_�ngth +; + +51 +i +; + +53 + `as�� +( +�ck� +); + +55 +�ma��g_�ngth + = +�ck� +->remaining_length; + +56 +�ck� +-> +�yl�d + = +NULL +; + +57 +�ck� +-> +�ma��g_cou� + = 0; + +59 +by� + = +�ma��g_�ngth + % 128; + +60 +�ma��g_�ngth + =�emaining_length / 128; + +62 if( +�ma��g_�ngth + > 0){ + +63 +by� + = byte | 0x80; + +65 +�ma��g_by�s +[ +�ck� +-> +�ma��g_cou� +] = +by� +; + +66 +�ck� +-> +�ma��g_cou� +++; + +67 } +�ma��g_�ngth + > 0 && +�ck� +-> +�ma��g_cou� + < 5); + +68 if( +�ck� +-> +�ma��g_cou� + =�5� +MOSQ_ERR_PAYLOAD_SIZE +; + +69 +�ck� +-> +�ck�_�ngth + =�ack�-> +�ma��g_�ngth + + 1 +�ack�-> +�ma��g_cou� +; + +70 #ifde� +WITH_WEBSOCKETS + + +71 +�ck� +-> +�yl�d + = + `mosqu�to__m�loc +(( +u�t8_t +)*�ck�-> +�ck�_�ngth + + +LWS_SEND_BUFFER_PRE_PADDING + + +LWS_SEND_BUFFER_POST_PADDING +); + +73 +�ck� +-> +�yl�d + = + `mosqu�to__m�loc +(( +u�t8_t +)*�ck�-> +�ck�_�ngth +); + +75 if(! +�ck� +-> +�yl�d +� +MOSQ_ERR_NOMEM +; + +77 +�ck� +-> +�yl�d +[0] =�ack�-> +comm�d +; + +78 +i +=0; i< +�ck� +-> +�ma��g_cou� +; i++){ + +79 +�ck� +-> +�yl�d +[ +i ++1] = +�ma��g_by�s +[i]; + +81 +�ck� +-> +pos + = 1 +�ack�-> +�ma��g_cou� +; + +83 +MOSQ_ERR_SUCCESS +; + +84 + } +} + +86 + $�ck�__��nup +( +mosqu�to__�ck� + * +�ck� +) + +88 if(! +�ck� +) ; + +91 +�ck� +-> +comm�d + = 0; + +92 +�ck� +-> +�ma��g_cou� + = 0; + +93 +�ck� +-> +�ma��g_mu� + = 1; + +94 +�ck� +-> +�ma��g_�ngth + = 0; + +95 + `mosqu�to__� +( +�ck� +-> +�yl�d +); + +96 +�ck� +-> +�yl�d + = +NULL +; + +97 +�ck� +-> +to_�o�ss + = 0; + +98 +�ck� +-> +pos + = 0; + +99 + } +} + +101 + $�ck�__queue +( +mosqu�to + * +mosq +, +mosqu�to__�ck� + * +�ck� +) + +103 #i�de� +WITH_BROKER + + +104 +sock��_d�a + = 0; + +106 + `as�� +( +mosq +); + +107 + `as�� +( +�ck� +); + +109 +�ck� +-> +pos + = 0; + +110 +�ck� +-> +to_�o�ss + =�ack�-> +�ck�_�ngth +; + +112 +�ck� +-> +�xt + = +NULL +; + +113 + `�h�ad_mu�x_lock +(& +mosq +-> +out_�ck�_mu�x +); + +114 if( +mosq +-> +out_�ck� +){ + +115 +mosq +-> +out_�ck�_ϡ +-> +�xt + = +�ck� +; + +117 +mosq +-> +out_�ck� + = +�ck� +; + +119 +mosq +-> +out_�ck�_ϡ + = +�ck� +; + +120 + `�h�ad_mu�x_u�ock +(& +mosq +-> +out_�ck�_mu�x +); + +121 #ifde� +WITH_BROKER + + +122 #ifde� +WITH_WEBSOCKETS + + +123 if( +mosq +-> +wsi +){ + +124 + `libwebsock�_��back_�_wr�ab� +( +mosq +-> +ws_cڋxt +, mosq-> +wsi +); + +125 +MOSQ_ERR_SUCCESS +; + +127 + `�ck�__wr�e +( +mosq +); + +130 + `�ck�__wr�e +( +mosq +); + +136 if( +mosq +-> +sock��W + !� +INVALID_SOCKET +){ + +137 #i�de� +WIN32 + + +138 if( + `wr�e +( +mosq +-> +sock��W +, & +sock��_d�a +, 1)){ + +141 + `�nd +( +mosq +-> +sock��W +, & +sock��_d�a +, 1, 0); + +145 if( +mosq +-> +�_��back + =� +�l� + && mosq-> +th�aded + =� +mosq_ts_n�e +){ + +146 + `�ck�__wr�e +( +mosq +); + +148 +MOSQ_ERR_SUCCESS +; + +151 + } +} + +154 + $�ck�__check_ov�size +( +mosqu�to + * +mosq +, +u�t32_t + +�ma��g_�ngth +) + +156 +u�t32_t + +�n +; + +158 if( +mosq +-> +maximum_�ck�_size + =�0� +MOSQ_ERR_SUCCESS +; + +160 +�n + = +�ma��g_�ngth + + + `�ck�__v��t_by�s +(remaining_length); + +161 if( +�n + > +mosq +-> +maximum_�ck�_size +){ + +162 +MOSQ_ERR_OVERSIZE_PACKET +; + +164 +MOSQ_ERR_SUCCESS +; + +166 + } +} + +169 + $�ck�__wr�e +( +mosqu�to + * +mosq +) + +171 +ssize_t + +wr�e_�ngth +; + +172 +mosqu�to__�ck� + * +�ck� +; + +174 if(! +mosq +� +MOSQ_ERR_INVAL +; + +175 if( +mosq +-> +sock + =� +INVALID_SOCKET +� +MOSQ_ERR_NO_CONN +; + +177 + `�h�ad_mu�x_lock +(& +mosq +-> +cu��t_out_�ck�_mu�x +); + +178 + `�h�ad_mu�x_lock +(& +mosq +-> +out_�ck�_mu�x +); + +179 if( +mosq +-> +out_�ck� + && !mosq-> +cu��t_out_�ck� +){ + +180 +mosq +-> +cu��t_out_�ck� + = mosq-> +out_�ck� +; + +181 +mosq +-> +out_�ck� + = mosq->out_�ck�-> +�xt +; + +182 if(! +mosq +-> +out_�ck� +){ + +183 +mosq +-> +out_�ck�_ϡ + = +NULL +; + +186 + `�h�ad_mu�x_u�ock +(& +mosq +-> +out_�ck�_mu�x +); + +188 #i� + `def�ed +( +WITH_TLS +�&& !def�ed( +WITH_BROKER +) + +189 if(( +mosq +-> +��e + =� +mosq_cs_c���_�nd�g +�|| mosq-> +w�t_c��� +){ + +191 if( +mosq +-> +��e + =� +mosq_cs_c���_�nd�g +){ + +193 + `�h�ad_mu�x_u�ock +(& +mosq +-> +cu��t_out_�ck�_mu�x +); + +194 +MOSQ_ERR_SUCCESS +; + +197 +mosq +-> +cu��t_out_�ck� +){ + +198 +�ck� + = +mosq +-> +cu��t_out_�ck� +; + +200 +�ck� +-> +to_�o�ss + > 0){ + +201 +wr�e_�ngth + = + `�t__wr�e +( +mosq +, &( +�ck� +-> +�yl�d +[�ck�-> +pos +]),�ack�-> +to_�o�ss +); + +202 if( +wr�e_�ngth + > 0){ + +203 + `G_BYTES_SENT_INC +( +wr�e_�ngth +); + +204 +�ck� +-> +to_�o�ss + -� +wr�e_�ngth +; + +205 +�ck� +-> +pos + +� +wr�e_�ngth +; + +207 #ifde� +WIN32 + + +208 +��o + = + `WSAG�La�E�� +(); + +210 if( +��o + =� +EAGAIN + ||��n�=� +COMPAT_EWOULDBLOCK +){ + +211 + `�h�ad_mu�x_u�ock +(& +mosq +-> +cu��t_out_�ck�_mu�x +); + +212 +MOSQ_ERR_SUCCESS +; + +214 + `�h�ad_mu�x_u�ock +(& +mosq +-> +cu��t_out_�ck�_mu�x +); + +215 +��o +){ + +216 +COMPAT_ECONNRESET +: + +217 +MOSQ_ERR_CONN_LOST +; + +219 +MOSQ_ERR_ERRNO +; + +225 + `G_MSGS_SENT_INC +(1); + +226 if((( +�ck� +-> +comm�d +)&0xF6�=� +CMD_PUBLISH +){ + +227 + `G_PUB_MSGS_SENT_INC +(1); + +228 #i�de� +WITH_BROKER + + +229 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +230 if( +mosq +-> +�_publish +){ + +232 +mosq +-> +�_��back + = +�ue +; + +233 +mosq +-> + `�_publish +(mosq, mosq-> +u�rd�a +, +�ck� +-> +mid +); + +234 +mosq +-> +�_��back + = +�l� +; + +236 if( +mosq +-> +�_publish_v5 +){ + +238 +mosq +-> +�_��back + = +�ue +; + +239 +mosq +-> + `�_publish_v5 +(mosq, mosq-> +u�rd�a +, +�ck� +-> +mid +, 0, +NULL +); + +240 +mosq +-> +�_��back + = +�l� +; + +242 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +243 }if((( +�ck� +-> +comm�d +)&0xF0�=� +CMD_DISCONNECT +){ + +244 + `do_���_disc��� +( +mosq +, +MOSQ_ERR_SUCCESS +, +NULL +); + +245 + `�ck�__��nup +( +�ck� +); + +246 + `mosqu�to__� +( +�ck� +); + +247 +MOSQ_ERR_SUCCESS +; + +252 + `�h�ad_mu�x_lock +(& +mosq +-> +out_�ck�_mu�x +); + +253 +mosq +-> +cu��t_out_�ck� + = mosq-> +out_�ck� +; + +254 if( +mosq +-> +out_�ck� +){ + +255 +mosq +-> +out_�ck� + = mosq->out_�ck�-> +�xt +; + +256 if(! +mosq +-> +out_�ck� +){ + +257 +mosq +-> +out_�ck�_ϡ + = +NULL +; + +260 + `�h�ad_mu�x_u�ock +(& +mosq +-> +out_�ck�_mu�x +); + +262 + `�ck�__��nup +( +�ck� +); + +263 + `mosqu�to__� +( +�ck� +); + +265 + `�h�ad_mu�x_lock +(& +mosq +-> +msgtime_mu�x +); + +266 +mosq +-> +�xt_msg_out + = + `mosqu�to_time +(�+ mosq-> +k��live +; + +267 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgtime_mu�x +); + +269 + `�h�ad_mu�x_u�ock +(& +mosq +-> +cu��t_out_�ck�_mu�x +); + +270 +MOSQ_ERR_SUCCESS +; + +271 + } +} + +274 #ifde� +WITH_BROKER + + +275 + $�ck�__�ad +( +mosqu�to_db + * +db +, +mosqu�to + * +mosq +) + +277 + $�ck�__�ad +( +mosqu�to + * +mosq +) + +280 +u�t8_t + +by� +; + +281 +ssize_t + +�ad_�ngth +; + +282 +rc + = 0; + +284 if(! +mosq +){ + +285 +MOSQ_ERR_INVAL +; + +287 if( +mosq +-> +sock + =� +INVALID_SOCKET +){ + +288 +MOSQ_ERR_NO_CONN +; + +290 if( +mosq +-> +��e + =� +mosq_cs_c���_�nd�g +){ + +291 +MOSQ_ERR_SUCCESS +; + +308 if(! +mosq +-> +�_�ck� +. +comm�d +){ + +309 +�ad_�ngth + = + `�t__�ad +( +mosq +, & +by� +, 1); + +310 if( +�ad_�ngth + == 1){ + +311 +mosq +-> +�_�ck� +. +comm�d + = +by� +; + +312 #ifde� +WITH_BROKER + + +313 + `G_BYTES_RECEIVED_INC +(1); + +315 if(!( +mosq +-> +bridge +�&& mosq-> +��e + =� +mosq_cs_�w + && ( +by� +&0xF0�!� +CMD_CONNECT +){ + +316 +MOSQ_ERR_PROTOCOL +; + +320 if( +�ad_�ngth + == 0){ + +321 +MOSQ_ERR_CONN_LOST +; + +323 #ifde� +WIN32 + + +324 +��o + = + `WSAG�La�E�� +(); + +326 if( +��o + =� +EAGAIN + ||��n�=� +COMPAT_EWOULDBLOCK +){ + +327 +MOSQ_ERR_SUCCESS +; + +329 +��o +){ + +330 +COMPAT_ECONNRESET +: + +331 +MOSQ_ERR_CONN_LOST +; + +333 +MOSQ_ERR_ERRNO +; + +347 if( +mosq +-> +�_�ck� +. +�ma��g_cou� + <= 0){ + +349 +�ad_�ngth + = + `�t__�ad +( +mosq +, & +by� +, 1); + +350 if( +�ad_�ngth + == 1){ + +351 +mosq +-> +�_�ck� +. +�ma��g_cou� +--; + +355 if( +mosq +-> +�_�ck� +. +�ma��g_cou� + < -4){ + +356 +MOSQ_ERR_PROTOCOL +; + +359 + `G_BYTES_RECEIVED_INC +(1); + +360 +mosq +-> +�_�ck� +. +�ma��g_�ngth + +�( +by� + & 127�* mosq->�_�ck�. +�ma��g_mu� +; + +361 +mosq +-> +�_�ck� +. +�ma��g_mu� + *= 128; + +363 if( +�ad_�ngth + == 0){ + +364 +MOSQ_ERR_CONN_LOST +; + +366 #ifde� +WIN32 + + +367 +��o + = + `WSAG�La�E�� +(); + +369 if( +��o + =� +EAGAIN + ||��n�=� +COMPAT_EWOULDBLOCK +){ + +370 +MOSQ_ERR_SUCCESS +; + +372 +��o +){ + +373 +COMPAT_ECONNRESET +: + +374 +MOSQ_ERR_CONN_LOST +; + +376 +MOSQ_ERR_ERRNO +; + +380 }( +by� + & 128) != 0); + +383 +mosq +-> +�_�ck� +. +�ma��g_cou� + *= -1; + +385 #ifde� +WITH_BROKER + + +386 if( +db +-> +c�fig +-> +max_�ck�_size + > 0 && +mosq +-> +�_�ck� +. +�ma��g_�ngth ++1 > db->config->max_packet_size){ + +387 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "Cl�� %����o��rg��ck� %d, disc����g.", +mosq +-> +id +, mosq-> +�_�ck� +. +�ma��g_�ngth ++1); + +388 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +389 + `�nd__disc��� +( +mosq +, +MQTT_RC_PACKET_TOO_LARGE +, +NULL +); + +391 +MOSQ_ERR_OVERSIZE_PACKET +; + +396 if( +mosq +-> +�_�ck� +. +�ma��g_�ngth + > 0){ + +397 +mosq +-> +�_�ck� +. +�yl�d + = + `mosqu�to__m�loc +(mosq->�_�ck�. +�ma��g_�ngth +*( +u�t8_t +)); + +398 if(! +mosq +-> +�_�ck� +. +�yl�d +){ + +399 +MOSQ_ERR_NOMEM +; + +401 +mosq +-> +�_�ck� +. +to_�o�ss + = mosq->�_�ck�. +�ma��g_�ngth +; + +404 +mosq +-> +�_�ck� +. +to_�o�ss +>0){ + +405 +�ad_�ngth + = + `�t__�ad +( +mosq +, &(mosq-> +�_�ck� +. +�yl�d +[mosq->�_�ck�. +pos +]), mosq->�_�ck�. +to_�o�ss +); + +406 if( +�ad_�ngth + > 0){ + +407 + `G_BYTES_RECEIVED_INC +( +�ad_�ngth +); + +408 +mosq +-> +�_�ck� +. +to_�o�ss + -� +�ad_�ngth +; + +409 +mosq +-> +�_�ck� +. +pos + +� +�ad_�ngth +; + +411 #ifde� +WIN32 + + +412 +��o + = + `WSAG�La�E�� +(); + +414 if( +��o + =� +EAGAIN + ||��n�=� +COMPAT_EWOULDBLOCK +){ + +415 if( +mosq +-> +�_�ck� +. +to_�o�ss + > 1000){ + +421 + `�h�ad_mu�x_lock +(& +mosq +-> +msgtime_mu�x +); + +422 +mosq +-> +ϡ_msg_� + = + `mosqu�to_time +(); + +423 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgtime_mu�x +); + +425 +MOSQ_ERR_SUCCESS +; + +427 +��o +){ + +428 +COMPAT_ECONNRESET +: + +429 +MOSQ_ERR_CONN_LOST +; + +431 +MOSQ_ERR_ERRNO +; + +438 +mosq +-> +�_�ck� +. +pos + = 0; + +439 #ifde� +WITH_BROKER + + +440 + `G_MSGS_RECEIVED_INC +(1); + +441 if((( +mosq +-> +�_�ck� +. +comm�d +)&0xF5�=� +CMD_PUBLISH +){ + +442 + `G_PUB_MSGS_RECEIVED_INC +(1); + +444 +rc + = + `h�d�__�ck� +( +db +, +mosq +); + +446 +rc + = + `h�d�__�ck� +( +mosq +); + +450 + `�ck�__��nup +(& +mosq +-> +�_�ck� +); + +452 + `�h�ad_mu�x_lock +(& +mosq +-> +msgtime_mu�x +); + +453 +mosq +-> +ϡ_msg_� + = + `mosqu�to_time +(); + +454 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgtime_mu�x +); + +455 +rc +; + +456 + } +} + + @lib/packet_mosq.h + +16 #i�de� +PACKET_MOSQ_H + + +17 + #PACKET_MOSQ_H + + + ) + +19 + ~"mosqu�to_����.h +" + +20 + ~"mosqu�to.h +" + +22 #ifde� +WITH_BROKER + + +23 + gmosqu�to_db +; + +26 +�ck�__�loc +( +mosqu�to__�ck� + * +�ck� +); + +27 +�ck�__��nup +( +mosqu�to__�ck� + * +�ck� +); + +28 +�ck�__queue +( +mosqu�to + * +mosq +, +mosqu�to__�ck� + * +�ck� +); + +30 +�ck�__check_ov�size +( +mosqu�to + * +mosq +, +u�t32_t + +�ma��g_�ngth +); + +32 +�ck�__�ad_by� +( +mosqu�to__�ck� + * +�ck� +, +u�t8_t + * +by� +); + +33 +�ck�__�ad_by�s +( +mosqu�to__�ck� + * +�ck� +, * +by�s +, +u�t32_t + +cou� +); + +34 +�ck�__�ad_b��y +( +mosqu�to__�ck� + * +�ck� +, +u�t8_t + ** +d�a +, * +�ngth +); + +35 +�ck�__�ad_�r�g +( +mosqu�to__�ck� + * +�ck� +, ** +�r +, * +�ngth +); + +36 +�ck�__�ad_u�t16 +( +mosqu�to__�ck� + * +�ck� +, +u�t16_t + * +w�d +); + +37 +�ck�__�ad_u�t32 +( +mosqu�to__�ck� + * +�ck� +, +u�t32_t + * +w�d +); + +38 +�ck�__�ad_v��t +( +mosqu�to__�ck� + * +�ck� +, +�t32_t + * +w�d +, +�t8_t + * +by�s +); + +40 +�ck�__wr�e_by� +( +mosqu�to__�ck� + * +�ck� +, +u�t8_t + +by� +); + +41 +�ck�__wr�e_by�s +( +mosqu�to__�ck� + * +�ck� +, cڡ * +by�s +, +u�t32_t + +cou� +); + +42 +�ck�__wr�e_�r�g +( +mosqu�to__�ck� + * +�ck� +, cڡ * +�r +, +u�t16_t + +�ngth +); + +43 +�ck�__wr�e_u�t16 +( +mosqu�to__�ck� + * +�ck� +, +u�t16_t + +w�d +); + +44 +�ck�__wr�e_u�t32 +( +mosqu�to__�ck� + * +�ck� +, +u�t32_t + +w�d +); + +45 +�ck�__wr�e_v��t +( +mosqu�to__�ck� + * +�ck� +, +�t32_t + +w�d +); + +47 +�ck�__v��t_by�s +( +�t32_t + +w�d +); + +49 +�ck�__wr�e +( +mosqu�to + * +mosq +); + +50 #ifde� +WITH_BROKER + + +51 +�ck�__�ad +( +mosqu�to_db + * +db +, +mosqu�to + * +mosq +); + +53 +�ck�__�ad +( +mosqu�to + * +mosq +); + + @lib/property_mosq.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<��o.h +> + +21 + ~<�r�g.h +> + +23 + ~"logg�g_mosq.h +" + +24 + ~"mem�y_mosq.h +" + +25 + ~"mq�_��oc�.h +" + +26 + ~"�ck�_mosq.h +" + +27 + ~"�ݔty_mosq.h +" + +30 + $�ݔty__�ad +( +mosqu�to__�ck� + * +�ck� +, +�t32_t + * +�n +, +mosqu�to_�ݔty + * +�ݔty +) + +32 +rc +; + +33 +�t32_t + +�ݔty_id�tif�r +; + +34 +u�t8_t + +by� +; + +35 +�t8_t + +by�_cou� +; + +36 +u�t16_t + +u�t16 +; + +37 +u�t32_t + +u�t32 +; + +38 +�t32_t + +v��t +; + +39 * +�r1 +, * +�r2 +; + +40 +��1 +, +��2 +; + +42 if(! +�ݔty +� +MOSQ_ERR_INVAL +; + +44 +rc + = + `�ck�__�ad_v��t +( +�ck� +, & +�ݔty_id�tif�r +, +NULL +); + +45 if( +rc +) �c; + +46 * +�n + -= 1; + +48 + `mem�t +( +�ݔty +, 0, ( +mosqu�to_�ݔty +)); + +50 +�ݔty +-> +id�tif�r + = +�ݔty_id�tif�r +; + +52 +�ݔty_id�tif�r +){ + +53 +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +: + +54 +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +: + +55 +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +: + +56 +MQTT_PROP_MAXIMUM_QOS +: + +57 +MQTT_PROP_RETAIN_AVAILABLE +: + +58 +MQTT_PROP_WILDCARD_SUB_AVAILABLE +: + +59 +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +: + +60 +MQTT_PROP_SHARED_SUB_AVAILABLE +: + +61 +rc + = + `�ck�__�ad_by� +( +�ck� +, & +by� +); + +62 if( +rc +) �c; + +63 * +�n + -= 1; + +64 +�ݔty +-> +v�ue +. +i8 + = +by� +; + +67 +MQTT_PROP_SERVER_KEEP_ALIVE +: + +68 +MQTT_PROP_RECEIVE_MAXIMUM +: + +69 +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +: + +70 +MQTT_PROP_TOPIC_ALIAS +: + +71 +rc + = + `�ck�__�ad_u�t16 +( +�ck� +, & +u�t16 +); + +72 if( +rc +) �c; + +73 * +�n + -= 2; + +74 +�ݔty +-> +v�ue +. +i16 + = +u�t16 +; + +77 +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +: + +78 +MQTT_PROP_SESSION_EXPIRY_INTERVAL +: + +79 +MQTT_PROP_WILL_DELAY_INTERVAL +: + +80 +MQTT_PROP_MAXIMUM_PACKET_SIZE +: + +81 +rc + = + `�ck�__�ad_u�t32 +( +�ck� +, & +u�t32 +); + +82 if( +rc +) �c; + +83 * +�n + -= 4; + +84 +�ݔty +-> +v�ue +. +i32 + = +u�t32 +; + +87 +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +: + +88 +rc + = + `�ck�__�ad_v��t +( +�ck� +, & +v��t +, & +by�_cou� +); + +89 if( +rc +) �c; + +90 * +�n + -� +by�_cou� +; + +91 +�ݔty +-> +v�ue +. +v��t + = varint; + +94 +MQTT_PROP_CONTENT_TYPE +: + +95 +MQTT_PROP_RESPONSE_TOPIC +: + +96 +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +: + +97 +MQTT_PROP_AUTHENTICATION_METHOD +: + +98 +MQTT_PROP_RESPONSE_INFORMATION +: + +99 +MQTT_PROP_SERVER_REFERENCE +: + +100 +MQTT_PROP_REASON_STRING +: + +101 +rc + = + `�ck�__�ad_�r�g +( +�ck� +, & +�r1 +, & +��1 +); + +102 if( +rc +) �c; + +103 * +�n + = (*�n�- 2 - +��1 +; + +104 +�ݔty +-> +v�ue +. +s +. +v + = +�r1 +; + +105 +�ݔty +-> +v�ue +. +s +. +�n + = +��1 +; + +108 +MQTT_PROP_AUTHENTICATION_DATA +: + +109 +MQTT_PROP_CORRELATION_DATA +: + +110 +rc + = + `�ck�__�ad_b��y +( +�ck� +, ( +u�t8_t + **)& +�r1 +, & +��1 +); + +111 if( +rc +) �c; + +112 * +�n + = (*�n�- 2 - +��1 +; + +113 +�ݔty +-> +v�ue +. +b� +. +v + = +�r1 +; + +114 +�ݔty +-> +v�ue +. +b� +. +�n + = +��1 +; + +117 +MQTT_PROP_USER_PROPERTY +: + +118 +rc + = + `�ck�__�ad_�r�g +( +�ck� +, & +�r1 +, & +��1 +); + +119 if( +rc +) �c; + +120 * +�n + = (*�n�- 2 - +��1 +; + +122 +rc + = + `�ck�__�ad_�r�g +( +�ck� +, & +�r2 +, & +��2 +); + +123 if( +rc +){ + +124 + `mosqu�to__� +( +�r1 +); + +125 +rc +; + +127 * +�n + = (*�n�- 2 - +��2 +; + +129 +�ݔty +-> +�me +. +v + = +�r1 +; + +130 +�ݔty +-> +�me +. +�n + = +��1 +; + +131 +�ݔty +-> +v�ue +. +s +. +v + = +�r2 +; + +132 +�ݔty +-> +v�ue +. +s +. +�n + = +��2 +; + +136 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "Unsu�܋d�rݔty�y�: %d", +�ݔty_id�tif�r +); + +137 +MOSQ_ERR_MALFORMED_PACKET +; + +140 +MOSQ_ERR_SUCCESS +; + +141 + } +} + +144 + $�ݔty__�ad_�l +( +comm�d +, +mosqu�to__�ck� + * +�ck� +, +mosqu�to_�ݔty + ** +�ݔt�s +) + +146 +rc +; + +147 +�t32_t + +���n +; + +148 +mosqu�to_�ݔty + * +p +, * +�� + = +NULL +; + +150 +rc + = + `�ck�__�ad_v��t +( +�ck� +, & +���n +, +NULL +); + +151 if( +rc +) �c; + +153 * +�ݔt�s + = +NULL +; + +157 +���n + > 0){ + +158 +p + = + `mosqu�to__��oc +(1, ( +mosqu�to_�ݔty +)); + +159 if(! +p +){ + +160 + `mosqu�to_�ݔty_�_�l +( +�ݔt�s +); + +161 +MOSQ_ERR_NOMEM +; + +164 +rc + = + `�ݔty__�ad +( +�ck� +, & +���n +, +p +); + +165 if( +rc +){ + +166 + `mosqu�to__� +( +p +); + +167 + `mosqu�to_�ݔty_�_�l +( +�ݔt�s +); + +168 +rc +; + +171 if(!(* +�ݔt�s +)){ + +172 * +�ݔt�s + = +p +; + +174 +�� +-> +�xt + = +p +; + +176 +�� + = +p +; + +180 +rc + = + `mosqu�to_�ݔty_check_�l +( +comm�d +, * +�ݔt�s +); + +181 if( +rc +){ + +182 + `mosqu�to_�ݔty_�_�l +( +�ݔt�s +); + +183 +rc +; + +185 +MOSQ_ERR_SUCCESS +; + +186 + } +} + +189 + $�ݔty__� +( +mosqu�to_�ݔty + ** +�ݔty +) + +191 if(! +�ݔty + || !(*property)) ; + +193 (* +�ݔty +)-> +id�tif�r +){ + +194 +MQTT_PROP_CONTENT_TYPE +: + +195 +MQTT_PROP_RESPONSE_TOPIC +: + +196 +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +: + +197 +MQTT_PROP_AUTHENTICATION_METHOD +: + +198 +MQTT_PROP_RESPONSE_INFORMATION +: + +199 +MQTT_PROP_SERVER_REFERENCE +: + +200 +MQTT_PROP_REASON_STRING +: + +201 + `mosqu�to__� +((* +�ݔty +)-> +v�ue +. +s +. +v +); + +204 +MQTT_PROP_AUTHENTICATION_DATA +: + +205 +MQTT_PROP_CORRELATION_DATA +: + +206 + `mosqu�to__� +((* +�ݔty +)-> +v�ue +. +b� +. +v +); + +209 +MQTT_PROP_USER_PROPERTY +: + +210 + `mosqu�to__� +((* +�ݔty +)-> +�me +. +v +); + +211 + `mosqu�to__� +((* +�ݔty +)-> +v�ue +. +s +. +v +); + +214 +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +: + +215 +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +: + +216 +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +: + +217 +MQTT_PROP_SESSION_EXPIRY_INTERVAL +: + +218 +MQTT_PROP_SERVER_KEEP_ALIVE +: + +219 +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +: + +220 +MQTT_PROP_WILL_DELAY_INTERVAL +: + +221 +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +: + +222 +MQTT_PROP_RECEIVE_MAXIMUM +: + +223 +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +: + +224 +MQTT_PROP_TOPIC_ALIAS +: + +225 +MQTT_PROP_MAXIMUM_QOS +: + +226 +MQTT_PROP_RETAIN_AVAILABLE +: + +227 +MQTT_PROP_MAXIMUM_PACKET_SIZE +: + +228 +MQTT_PROP_WILDCARD_SUB_AVAILABLE +: + +229 +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +: + +230 +MQTT_PROP_SHARED_SUB_AVAILABLE +: + +235 + `� +(* +�ݔty +); + +236 * +�ݔty + = +NULL +; + +237 + } +} + +240 + $mosqu�to_�ݔty_�_�l +( +mosqu�to_�ݔty + ** +�ݔty +) + +242 +mosqu�to_�ݔty + * +p +, * +�xt +; + +244 if(! +�ݔty +) ; + +246 +p + = * +�ݔty +; + +247 +p +){ + +248 +�xt + = +p +->next; + +249 + `�ݔty__� +(& +p +); + +250 +p + = +�xt +; + +252 * +�ݔty + = +NULL +; + +253 + } +} + +256 + $�ݔty__g�_�ngth +(cڡ +mosqu�to_�ݔty + * +�ݔty +) + +258 if(! +�ݔty +) 0; + +260 +�ݔty +-> +id�tif�r +){ + +262 +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +: + +263 +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +: + +264 +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +: + +265 +MQTT_PROP_MAXIMUM_QOS +: + +266 +MQTT_PROP_RETAIN_AVAILABLE +: + +267 +MQTT_PROP_WILDCARD_SUB_AVAILABLE +: + +268 +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +: + +269 +MQTT_PROP_SHARED_SUB_AVAILABLE +: + +273 +MQTT_PROP_SERVER_KEEP_ALIVE +: + +274 +MQTT_PROP_RECEIVE_MAXIMUM +: + +275 +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +: + +276 +MQTT_PROP_TOPIC_ALIAS +: + +280 +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +: + +281 +MQTT_PROP_WILL_DELAY_INTERVAL +: + +282 +MQTT_PROP_MAXIMUM_PACKET_SIZE +: + +283 +MQTT_PROP_SESSION_EXPIRY_INTERVAL +: + +287 +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +: + +288 if( +�ݔty +-> +v�ue +. +v��t + < 128){ + +290 }if( +�ݔty +-> +v�ue +. +v��t + < 16384){ + +292 }if( +�ݔty +-> +v�ue +. +v��t + < 2097152){ + +294 }if( +�ݔty +-> +v�ue +. +v��t + < 268435456){ + +301 +MQTT_PROP_CORRELATION_DATA +: + +302 +MQTT_PROP_AUTHENTICATION_DATA +: + +303 3 + +�ݔty +-> +v�ue +. +b� +. +�n +; + +306 +MQTT_PROP_CONTENT_TYPE +: + +307 +MQTT_PROP_RESPONSE_TOPIC +: + +308 +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +: + +309 +MQTT_PROP_AUTHENTICATION_METHOD +: + +310 +MQTT_PROP_RESPONSE_INFORMATION +: + +311 +MQTT_PROP_SERVER_REFERENCE +: + +312 +MQTT_PROP_REASON_STRING +: + +313 3 + +�ݔty +-> +v�ue +. +s +. +�n +; + +316 +MQTT_PROP_USER_PROPERTY +: + +317 5 + +�ݔty +-> +v�ue +. +s +. +�n + +�rݔty-> +�me +.len; + +323 + } +} + +326 + $�ݔty__g�_�ngth_�l +(cڡ +mosqu�to_�ݔty + * +�ݔty +) + +328 cڡ +mosqu�to_�ݔty + * +p +; + +329 +�n + = 0; + +331 +p + = +�ݔty +; + +332 +p +){ + +333 +�n + +� + `�ݔty__g�_�ngth +( +p +); + +334 +p + =�-> +�xt +; + +336 +�n +; + +337 + } +} + +340 + $�ݔty__wr�e +( +mosqu�to__�ck� + * +�ck� +, cڡ +mosqu�to_�ݔty + * +�ݔty +) + +342 +rc +; + +344 +rc + = + `�ck�__wr�e_v��t +( +�ck� +, +�ݔty +-> +id�tif�r +); + +345 if( +rc +) �c; + +347 +�ݔty +-> +id�tif�r +){ + +348 +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +: + +349 +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +: + +350 +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +: + +351 +MQTT_PROP_MAXIMUM_QOS +: + +352 +MQTT_PROP_RETAIN_AVAILABLE +: + +353 +MQTT_PROP_WILDCARD_SUB_AVAILABLE +: + +354 +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +: + +355 +MQTT_PROP_SHARED_SUB_AVAILABLE +: + +356 + `�ck�__wr�e_by� +( +�ck� +, +�ݔty +-> +v�ue +. +i8 +); + +359 +MQTT_PROP_SERVER_KEEP_ALIVE +: + +360 +MQTT_PROP_RECEIVE_MAXIMUM +: + +361 +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +: + +362 +MQTT_PROP_TOPIC_ALIAS +: + +363 + `�ck�__wr�e_u�t16 +( +�ck� +, +�ݔty +-> +v�ue +. +i16 +); + +366 +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +: + +367 +MQTT_PROP_SESSION_EXPIRY_INTERVAL +: + +368 +MQTT_PROP_WILL_DELAY_INTERVAL +: + +369 +MQTT_PROP_MAXIMUM_PACKET_SIZE +: + +370 + `�ck�__wr�e_u�t32 +( +�ck� +, +�ݔty +-> +v�ue +. +i32 +); + +373 +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +: + +374 + `�ck�__wr�e_v��t +( +�ck� +, +�ݔty +-> +v�ue +. +v��t +); + +376 +MQTT_PROP_CONTENT_TYPE +: + +377 +MQTT_PROP_RESPONSE_TOPIC +: + +378 +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +: + +379 +MQTT_PROP_AUTHENTICATION_METHOD +: + +380 +MQTT_PROP_RESPONSE_INFORMATION +: + +381 +MQTT_PROP_SERVER_REFERENCE +: + +382 +MQTT_PROP_REASON_STRING +: + +383 + `�ck�__wr�e_�r�g +( +�ck� +, +�ݔty +-> +v�ue +. +s +. +v +,�rݔty->v�ue.s. +�n +); + +386 +MQTT_PROP_AUTHENTICATION_DATA +: + +387 +MQTT_PROP_CORRELATION_DATA +: + +388 + `�ck�__wr�e_u�t16 +( +�ck� +, +�ݔty +-> +v�ue +. +b� +. +�n +); + +389 + `�ck�__wr�e_by�s +( +�ck� +, +�ݔty +-> +v�ue +. +b� +. +v +,�rݔty->v�ue.b�. +�n +); + +392 +MQTT_PROP_USER_PROPERTY +: + +393 + `�ck�__wr�e_�r�g +( +�ck� +, +�ݔty +-> +�me +. +v +,�rݔty->�me. +�n +); + +394 + `�ck�__wr�e_�r�g +( +�ck� +, +�ݔty +-> +v�ue +. +s +. +v +,�rݔty->v�ue.s. +�n +); + +398 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "Unsu�܋d�rݔty�y�: %d", +�ݔty +-> +id�tif�r +); + +399 +MOSQ_ERR_INVAL +; + +402 +MOSQ_ERR_SUCCESS +; + +403 + } +} + +406 + $�ݔty__wr�e_�l +( +mosqu�to__�ck� + * +�ck� +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +, +bo� + +wr�e_�n +) + +408 +rc +; + +409 cڡ +mosqu�to_�ݔty + * +p +; + +411 if( +wr�e_�n +){ + +412 +rc + = + `�ck�__wr�e_v��t +( +�ck� +, + `�ݔty__g�_�ngth_�l +( +�ݔt�s +)); + +413 if( +rc +) �c; + +416 +p + = +�ݔt�s +; + +417 +p +){ + +418 +rc + = + `�ݔty__wr�e +( +�ck� +, +p +); + +419 if( +rc +) �c; + +420 +p + =�-> +�xt +; + +423 +MOSQ_ERR_SUCCESS +; + +424 + } +} + +427 + $mosqu�to_�ݔty_check_comm�d +( +comm�d +, +id�tif�r +) + +429 +id�tif�r +){ + +430 +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +: + +431 +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +: + +432 +MQTT_PROP_CONTENT_TYPE +: + +433 +MQTT_PROP_RESPONSE_TOPIC +: + +434 +MQTT_PROP_CORRELATION_DATA +: + +435 if( +comm�d + !� +CMD_PUBLISH + && comm�d !� +CMD_WILL +){ + +436 +MOSQ_ERR_PROTOCOL +; + +440 +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +: + +441 if( +comm�d + !� +CMD_PUBLISH + && comm�d !� +CMD_SUBSCRIBE +){ + +442 +MOSQ_ERR_PROTOCOL +; + +446 +MQTT_PROP_SESSION_EXPIRY_INTERVAL +: + +447 if( +comm�d + !� +CMD_CONNECT + && comm�d !� +CMD_CONNACK + && comm�d !� +CMD_DISCONNECT +){ + +448 +MOSQ_ERR_PROTOCOL +; + +452 +MQTT_PROP_AUTHENTICATION_METHOD +: + +453 +MQTT_PROP_AUTHENTICATION_DATA +: + +454 if( +comm�d + !� +CMD_CONNECT + && comm�d !� +CMD_CONNACK + && comm�d !� +CMD_AUTH +){ + +455 +MOSQ_ERR_PROTOCOL +; + +459 +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +: + +460 +MQTT_PROP_SERVER_KEEP_ALIVE +: + +461 +MQTT_PROP_RESPONSE_INFORMATION +: + +462 +MQTT_PROP_MAXIMUM_QOS +: + +463 +MQTT_PROP_RETAIN_AVAILABLE +: + +464 +MQTT_PROP_WILDCARD_SUB_AVAILABLE +: + +465 +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +: + +466 +MQTT_PROP_SHARED_SUB_AVAILABLE +: + +467 if( +comm�d + !� +CMD_CONNACK +){ + +468 +MOSQ_ERR_PROTOCOL +; + +472 +MQTT_PROP_WILL_DELAY_INTERVAL +: + +473 if( +comm�d + !� +CMD_WILL +){ + +474 +MOSQ_ERR_PROTOCOL +; + +478 +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +: + +479 +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +: + +480 if( +comm�d + !� +CMD_CONNECT +){ + +481 +MOSQ_ERR_PROTOCOL +; + +485 +MQTT_PROP_SERVER_REFERENCE +: + +486 if( +comm�d + !� +CMD_CONNACK + && comm�d !� +CMD_DISCONNECT +){ + +487 +MOSQ_ERR_PROTOCOL +; + +491 +MQTT_PROP_REASON_STRING +: + +492 if( +comm�d + =� +CMD_CONNECT + || comm�d =� +CMD_PUBLISH + || comm�d =� +CMD_SUBSCRIBE + || comm�d =� +CMD_UNSUBSCRIBE +){ + +493 +MOSQ_ERR_PROTOCOL +; + +497 +MQTT_PROP_RECEIVE_MAXIMUM +: + +498 +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +: + +499 +MQTT_PROP_MAXIMUM_PACKET_SIZE +: + +500 if( +comm�d + !� +CMD_CONNECT + && comm�d !� +CMD_CONNACK +){ + +501 +MOSQ_ERR_PROTOCOL +; + +505 +MQTT_PROP_TOPIC_ALIAS +: + +506 if( +comm�d + !� +CMD_PUBLISH +){ + +507 +MOSQ_ERR_PROTOCOL +; + +511 +MQTT_PROP_USER_PROPERTY +: + +515 +MOSQ_ERR_PROTOCOL +; + +517 +MOSQ_ERR_SUCCESS +; + +518 + } +} + +521 + $mosqu�to_�r�g_to_�ݔty_�fo +(cڡ * +���me +, * +id�tif�r +, * +ty� +) + +523 if(! +���me +� +MOSQ_ERR_INVAL +; + +525 if(! + `�r��cmp +( +���me +, "payload-format-indicator")){ + +526 * +id�tif�r + = +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +; + +527 * +ty� + = +MQTT_PROP_TYPE_BYTE +; + +528 }if(! + `�r��cmp +( +���me +, "message-expiry-interval")){ + +529 * +id�tif�r + = +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +; + +530 * +ty� + = +MQTT_PROP_TYPE_INT32 +; + +531 }if(! + `�r��cmp +( +���me +, "content-type")){ + +532 * +id�tif�r + = +MQTT_PROP_CONTENT_TYPE +; + +533 * +ty� + = +MQTT_PROP_TYPE_STRING +; + +534 }if(! + `�r��cmp +( +���me +, "response-topic")){ + +535 * +id�tif�r + = +MQTT_PROP_RESPONSE_TOPIC +; + +536 * +ty� + = +MQTT_PROP_TYPE_STRING +; + +537 }if(! + `�r��cmp +( +���me +, "correlation-data")){ + +538 * +id�tif�r + = +MQTT_PROP_CORRELATION_DATA +; + +539 * +ty� + = +MQTT_PROP_TYPE_BINARY +; + +540 }if(! + `�r��cmp +( +���me +, "subscription-identifier")){ + +541 * +id�tif�r + = +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +; + +542 * +ty� + = +MQTT_PROP_TYPE_VARINT +; + +543 }if(! + `�r��cmp +( +���me +, "session-expiry-interval")){ + +544 * +id�tif�r + = +MQTT_PROP_SESSION_EXPIRY_INTERVAL +; + +545 * +ty� + = +MQTT_PROP_TYPE_INT32 +; + +546 }if(! + `�r��cmp +( +���me +, "assigned-client-identifier")){ + +547 * +id�tif�r + = +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +; + +548 * +ty� + = +MQTT_PROP_TYPE_STRING +; + +549 }if(! + `�r��cmp +( +���me +, "server-keep-alive")){ + +550 * +id�tif�r + = +MQTT_PROP_SERVER_KEEP_ALIVE +; + +551 * +ty� + = +MQTT_PROP_TYPE_INT16 +; + +552 }if(! + `�r��cmp +( +���me +, "authentication-method")){ + +553 * +id�tif�r + = +MQTT_PROP_AUTHENTICATION_METHOD +; + +554 * +ty� + = +MQTT_PROP_TYPE_STRING +; + +555 }if(! + `�r��cmp +( +���me +, "authentication-data")){ + +556 * +id�tif�r + = +MQTT_PROP_AUTHENTICATION_DATA +; + +557 * +ty� + = +MQTT_PROP_TYPE_BINARY +; + +558 }if(! + `�r��cmp +( +���me +, "request-problem-information")){ + +559 * +id�tif�r + = +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +; + +560 * +ty� + = +MQTT_PROP_TYPE_BYTE +; + +561 }if(! + `�r��cmp +( +���me +, "will-delay-interval")){ + +562 * +id�tif�r + = +MQTT_PROP_WILL_DELAY_INTERVAL +; + +563 * +ty� + = +MQTT_PROP_TYPE_INT32 +; + +564 }if(! + `�r��cmp +( +���me +, "request-response-information")){ + +565 * +id�tif�r + = +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +; + +566 * +ty� + = +MQTT_PROP_TYPE_BYTE +; + +567 }if(! + `�r��cmp +( +���me +, "response-information")){ + +568 * +id�tif�r + = +MQTT_PROP_RESPONSE_INFORMATION +; + +569 * +ty� + = +MQTT_PROP_TYPE_STRING +; + +570 }if(! + `�r��cmp +( +���me +, "server-reference")){ + +571 * +id�tif�r + = +MQTT_PROP_SERVER_REFERENCE +; + +572 * +ty� + = +MQTT_PROP_TYPE_STRING +; + +573 }if(! + `�r��cmp +( +���me +, "reason-string")){ + +574 * +id�tif�r + = +MQTT_PROP_REASON_STRING +; + +575 * +ty� + = +MQTT_PROP_TYPE_STRING +; + +576 }if(! + `�r��cmp +( +���me +, "receive-maximum")){ + +577 * +id�tif�r + = +MQTT_PROP_RECEIVE_MAXIMUM +; + +578 * +ty� + = +MQTT_PROP_TYPE_INT16 +; + +579 }if(! + `�r��cmp +( +���me +, "topic-alias-maximum")){ + +580 * +id�tif�r + = +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +; + +581 * +ty� + = +MQTT_PROP_TYPE_INT16 +; + +582 }if(! + `�r��cmp +( +���me +, "topic-alias")){ + +583 * +id�tif�r + = +MQTT_PROP_TOPIC_ALIAS +; + +584 * +ty� + = +MQTT_PROP_TYPE_INT16 +; + +585 }if(! + `�r��cmp +( +���me +, "maximum-qos")){ + +586 * +id�tif�r + = +MQTT_PROP_MAXIMUM_QOS +; + +587 * +ty� + = +MQTT_PROP_TYPE_BYTE +; + +588 }if(! + `�r��cmp +( +���me +, "retain-available")){ + +589 * +id�tif�r + = +MQTT_PROP_RETAIN_AVAILABLE +; + +590 * +ty� + = +MQTT_PROP_TYPE_BYTE +; + +591 }if(! + `�r��cmp +( +���me +, "user-property")){ + +592 * +id�tif�r + = +MQTT_PROP_USER_PROPERTY +; + +593 * +ty� + = +MQTT_PROP_TYPE_STRING_PAIR +; + +594 }if(! + `�r��cmp +( +���me +, "maximum-packet-size")){ + +595 * +id�tif�r + = +MQTT_PROP_MAXIMUM_PACKET_SIZE +; + +596 * +ty� + = +MQTT_PROP_TYPE_INT32 +; + +597 }if(! + `�r��cmp +( +���me +, "wildcard-subscription-available")){ + +598 * +id�tif�r + = +MQTT_PROP_WILDCARD_SUB_AVAILABLE +; + +599 * +ty� + = +MQTT_PROP_TYPE_BYTE +; + +600 }if(! + `�r��cmp +( +���me +, "subscription-identifier-available")){ + +601 * +id�tif�r + = +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +; + +602 * +ty� + = +MQTT_PROP_TYPE_BYTE +; + +603 }if(! + `�r��cmp +( +���me +, "shared-subscription-available")){ + +604 * +id�tif�r + = +MQTT_PROP_SHARED_SUB_AVAILABLE +; + +605 * +ty� + = +MQTT_PROP_TYPE_BYTE +; + +607 +MOSQ_ERR_INVAL +; + +609 +MOSQ_ERR_SUCCESS +; + +610 + } +} + +613 + $�ݔty__add +( +mosqu�to_�ݔty + ** +��li� +, +mq�5__�ݔty + * +�� +) + +615 +mosqu�to_�ݔty + * +p +; + +617 if(!(* +��li� +)){ + +618 * +��li� + = +�� +; + +621 +p + = * +��li� +; + +622 +p +-> +�xt +){ + +623 +p + =�-> +�xt +; + +625 +p +-> +�xt + = +�� +; + +626 +�� +-> +�xt + = +NULL +; + +627 + } +} + +630 + $mosqu�to_�ݔty_add_by� +( +mosqu�to_�ݔty + ** +��li� +, +id�tif�r +, +u�t8_t + +v�ue +) + +632 +mosqu�to_�ݔty + * +�� +; + +634 if(! +��li� +� +MOSQ_ERR_INVAL +; + +635 if( +id�tif�r + !� +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR + + +636 && +id�tif�r + !� +MQTT_PROP_REQUEST_PROBLEM_INFORMATION + + +637 && +id�tif�r + !� +MQTT_PROP_REQUEST_RESPONSE_INFORMATION + + +638 && +id�tif�r + !� +MQTT_PROP_MAXIMUM_QOS + + +639 && +id�tif�r + !� +MQTT_PROP_RETAIN_AVAILABLE + + +640 && +id�tif�r + !� +MQTT_PROP_WILDCARD_SUB_AVAILABLE + + +641 && +id�tif�r + !� +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE + + +642 && +id�tif�r + !� +MQTT_PROP_SHARED_SUB_AVAILABLE +){ + +643 +MOSQ_ERR_INVAL +; + +646 +�� + = + `mosqu�to__��oc +(1, ( +mosqu�to_�ݔty +)); + +647 if(! +�� +� +MOSQ_ERR_NOMEM +; + +649 +�� +-> +���_g���ed + = +�ue +; + +650 +�� +-> +id�tif�r + = identifier; + +651 +�� +-> +v�ue +. +i8 + = value; + +653 + `�ݔty__add +( +��li� +, +�� +); + +654 +MOSQ_ERR_SUCCESS +; + +655 + } +} + +658 + $mosqu�to_�ݔty_add_�t16 +( +mosqu�to_�ݔty + ** +��li� +, +id�tif�r +, +u�t16_t + +v�ue +) + +660 +mosqu�to_�ݔty + * +�� +; + +662 if(! +��li� +� +MOSQ_ERR_INVAL +; + +663 if( +id�tif�r + !� +MQTT_PROP_SERVER_KEEP_ALIVE + + +664 && +id�tif�r + !� +MQTT_PROP_RECEIVE_MAXIMUM + + +665 && +id�tif�r + !� +MQTT_PROP_TOPIC_ALIAS_MAXIMUM + + +666 && +id�tif�r + !� +MQTT_PROP_TOPIC_ALIAS +){ + +667 +MOSQ_ERR_INVAL +; + +670 +�� + = + `mosqu�to__��oc +(1, ( +mosqu�to_�ݔty +)); + +671 if(! +�� +� +MOSQ_ERR_NOMEM +; + +673 +�� +-> +���_g���ed + = +�ue +; + +674 +�� +-> +id�tif�r + = identifier; + +675 +�� +-> +v�ue +. +i16 + = value; + +677 + `�ݔty__add +( +��li� +, +�� +); + +678 +MOSQ_ERR_SUCCESS +; + +679 + } +} + +682 + $mosqu�to_�ݔty_add_�t32 +( +mosqu�to_�ݔty + ** +��li� +, +id�tif�r +, +u�t32_t + +v�ue +) + +684 +mosqu�to_�ݔty + * +�� +; + +686 if(! +��li� +� +MOSQ_ERR_INVAL +; + +687 if( +id�tif�r + !� +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL + + +688 && +id�tif�r + !� +MQTT_PROP_SESSION_EXPIRY_INTERVAL + + +689 && +id�tif�r + !� +MQTT_PROP_WILL_DELAY_INTERVAL + + +690 && +id�tif�r + !� +MQTT_PROP_MAXIMUM_PACKET_SIZE +){ + +692 +MOSQ_ERR_INVAL +; + +695 +�� + = + `mosqu�to__��oc +(1, ( +mosqu�to_�ݔty +)); + +696 if(! +�� +� +MOSQ_ERR_NOMEM +; + +698 +�� +-> +���_g���ed + = +�ue +; + +699 +�� +-> +id�tif�r + = identifier; + +700 +�� +-> +v�ue +. +i32 + = value; + +702 + `�ݔty__add +( +��li� +, +�� +); + +703 +MOSQ_ERR_SUCCESS +; + +704 + } +} + +707 + $mosqu�to_�ݔty_add_v��t +( +mosqu�to_�ݔty + ** +��li� +, +id�tif�r +, +u�t32_t + +v�ue +) + +709 +mosqu�to_�ݔty + * +�� +; + +711 if(! +��li� + || +v�ue + > 268435455� +MOSQ_ERR_INVAL +; + +712 if( +id�tif�r + !� +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +� +MOSQ_ERR_INVAL +; + +714 +�� + = + `mosqu�to__��oc +(1, ( +mosqu�to_�ݔty +)); + +715 if(! +�� +� +MOSQ_ERR_NOMEM +; + +717 +�� +-> +���_g���ed + = +�ue +; + +718 +�� +-> +id�tif�r + = identifier; + +719 +�� +-> +v�ue +. +v��t + = value; + +721 + `�ݔty__add +( +��li� +, +�� +); + +722 +MOSQ_ERR_SUCCESS +; + +723 + } +} + +726 + $mosqu�to_�ݔty_add_b��y +( +mosqu�to_�ݔty + ** +��li� +, +id�tif�r +, cڡ * +v�ue +, +u�t16_t + +�n +) + +728 +mosqu�to_�ݔty + * +�� +; + +730 if(! +��li� +� +MOSQ_ERR_INVAL +; + +731 if( +id�tif�r + !� +MQTT_PROP_CORRELATION_DATA + + +732 && +id�tif�r + !� +MQTT_PROP_AUTHENTICATION_DATA +){ + +734 +MOSQ_ERR_INVAL +; + +737 +�� + = + `mosqu�to__��oc +(1, ( +mosqu�to_�ݔty +)); + +738 if(! +�� +� +MOSQ_ERR_NOMEM +; + +740 +�� +-> +���_g���ed + = +�ue +; + +741 +�� +-> +id�tif�r + = identifier; + +743 if( +�n +){ + +744 +�� +-> +v�ue +. +b� +. +v + = + `mosqu�to__m�loc +( +�n +); + +745 if(! +�� +-> +v�ue +. +b� +. +v +){ + +746 + `mosqu�to__� +( +�� +); + +747 +MOSQ_ERR_NOMEM +; + +750 + `mem�y +( +�� +-> +v�ue +. +b� +. +v +, v�ue, +�n +); + +751 +�� +-> +v�ue +. +b� +. +�n + =�en; + +754 + `�ݔty__add +( +��li� +, +�� +); + +755 +MOSQ_ERR_SUCCESS +; + +756 + } +} + +759 + $mosqu�to_�ݔty_add_�r�g +( +mosqu�to_�ݔty + ** +��li� +, +id�tif�r +, cڡ * +v�ue +) + +761 +mosqu�to_�ݔty + * +�� +; + +763 if(! +��li� +� +MOSQ_ERR_INVAL +; + +764 if( +v�ue +){ + +765 if( + `mosqu�to_v�id�e_utf8 +( +v�ue +, + `��� +(v�ue))� +MOSQ_ERR_MALFORMED_UTF8 +; + +768 if( +id�tif�r + !� +MQTT_PROP_CONTENT_TYPE + + +769 && +id�tif�r + !� +MQTT_PROP_RESPONSE_TOPIC + + +770 && +id�tif�r + !� +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER + + +771 && +id�tif�r + !� +MQTT_PROP_AUTHENTICATION_METHOD + + +772 && +id�tif�r + !� +MQTT_PROP_RESPONSE_INFORMATION + + +773 && +id�tif�r + !� +MQTT_PROP_SERVER_REFERENCE + + +774 && +id�tif�r + !� +MQTT_PROP_REASON_STRING +){ + +776 +MOSQ_ERR_INVAL +; + +779 +�� + = + `mosqu�to__��oc +(1, ( +mosqu�to_�ݔty +)); + +780 if(! +�� +� +MOSQ_ERR_NOMEM +; + +782 +�� +-> +���_g���ed + = +�ue +; + +783 +�� +-> +id�tif�r + = identifier; + +784 if( +v�ue + && + `��� +(value)){ + +785 +�� +-> +v�ue +. +s +. +v + = + `mosqu�to__�rdup +(value); + +786 if(! +�� +-> +v�ue +. +s +. +v +){ + +787 + `mosqu�to__� +( +�� +); + +788 +MOSQ_ERR_NOMEM +; + +790 +�� +-> +v�ue +. +s +. +�n + = + `��� +(value); + +793 + `�ݔty__add +( +��li� +, +�� +); + +794 +MOSQ_ERR_SUCCESS +; + +795 + } +} + +798 + $mosqu�to_�ݔty_add_�r�g_�� +( +mosqu�to_�ݔty + ** +��li� +, +id�tif�r +, cڡ * +�me +, cڡ * +v�ue +) + +800 +mosqu�to_�ݔty + * +�� +; + +802 if(! +��li� +� +MOSQ_ERR_INVAL +; + +803 if( +id�tif�r + !� +MQTT_PROP_USER_PROPERTY +� +MOSQ_ERR_INVAL +; + +804 if( +�me +){ + +805 if( + `mosqu�to_v�id�e_utf8 +( +�me +, + `��� +�ame))� +MOSQ_ERR_MALFORMED_UTF8 +; + +807 if( +v�ue +){ + +808 if( + `mosqu�to_v�id�e_utf8 +( +v�ue +, + `��� +(v�ue))� +MOSQ_ERR_MALFORMED_UTF8 +; + +811 +�� + = + `mosqu�to__��oc +(1, ( +mosqu�to_�ݔty +)); + +812 if(! +�� +� +MOSQ_ERR_NOMEM +; + +814 +�� +-> +���_g���ed + = +�ue +; + +815 +�� +-> +id�tif�r + = identifier; + +817 if( +�me + && + `��� +(name)){ + +818 +�� +-> +�me +. +v + = + `mosqu�to__�rdup +(name); + +819 if(! +�� +-> +�me +. +v +){ + +820 + `mosqu�to__� +( +�� +); + +821 +MOSQ_ERR_NOMEM +; + +823 +�� +-> +�me +. +�n + = + `��� +(name); + +826 if( +v�ue + && + `��� +(value)){ + +827 +�� +-> +v�ue +. +s +. +v + = + `mosqu�to__�rdup +(value); + +828 if(! +�� +-> +v�ue +. +s +. +v +){ + +829 + `mosqu�to__� +( +�� +-> +�me +. +v +); + +830 + `mosqu�to__� +( +�� +); + +831 +MOSQ_ERR_NOMEM +; + +833 +�� +-> +v�ue +. +s +. +�n + = + `��� +(value); + +836 + `�ݔty__add +( +��li� +, +�� +); + +837 +MOSQ_ERR_SUCCESS +; + +838 + } +} + +840 + $mosqu�to_�ݔty_check_�l +( +comm�d +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +842 cڡ +mosqu�to_�ݔty + * +p +, * +�� +; + +843 +rc +; + +845 +p + = +�ݔt�s +; + +847 +p +){ + +849 if( +p +-> +id�tif�r + =� +MQTT_PROP_REQUEST_PROBLEM_INFORMATION + + +850 || +p +-> +id�tif�r + =� +MQTT_PROP_REQUEST_RESPONSE_INFORMATION + + +851 || +p +-> +id�tif�r + =� +MQTT_PROP_MAXIMUM_QOS + + +852 || +p +-> +id�tif�r + =� +MQTT_PROP_RETAIN_AVAILABLE + + +853 || +p +-> +id�tif�r + =� +MQTT_PROP_WILDCARD_SUB_AVAILABLE + + +854 || +p +-> +id�tif�r + =� +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE + + +855 || +p +-> +id�tif�r + =� +MQTT_PROP_SHARED_SUB_AVAILABLE +){ + +857 if( +p +-> +v�ue +. +i8 + > 1){ + +858 +MOSQ_ERR_PROTOCOL +; + +860 }if( +p +-> +id�tif�r + =� +MQTT_PROP_MAXIMUM_PACKET_SIZE +){ + +861 if� +p +-> +v�ue +. +i32 + == 0){ + +862 +MOSQ_ERR_PROTOCOL +; + +864 }if( +p +-> +id�tif�r + =� +MQTT_PROP_RECEIVE_MAXIMUM + + +865 || +p +-> +id�tif�r + =� +MQTT_PROP_TOPIC_ALIAS +){ + +867 if( +p +-> +v�ue +. +i16 + == 0){ + +868 +MOSQ_ERR_PROTOCOL +; + +873 +rc + = + `mosqu�to_�ݔty_check_comm�d +( +comm�d +, +p +-> +id�tif�r +); + +874 if( +rc +) �c; + +877 +�� + = +p +-> +�xt +; + +878 +�� +){ + +879 if( +p +-> +id�tif�r + =� +�� +->identifier + +880 && +p +-> +id�tif�r + !� +MQTT_PROP_USER_PROPERTY +){ + +882 +MOSQ_ERR_DUPLICATE_PROPERTY +; + +884 +�� + =�a�-> +�xt +; + +887 +p + =�-> +�xt +; + +890 +MOSQ_ERR_SUCCESS +; + +891 + } +} + +893 cڡ +mosqu�to_�ݔty + * + $�ݔty__g�_�ݔty +(cڡ +mosqu�to_�ݔty + * +��li� +, +id�tif�r +, +bo� + +sk�_f�� +) + +895 cڡ +mosqu�to_�ݔty + * +p +; + +896 +bo� + +is_f�� + = +�ue +; + +898 +p + = +��li� +; + +900 +p +){ + +901 if( +p +-> +id�tif�r + == identifier){ + +902 if(! +is_f�� + || ! +sk�_f�� +){ + +903 +p +; + +905 +is_f�� + = +�l� +; + +907 +p + =�-> +�xt +; + +909 +NULL +; + +910 + } +} + +913 cڡ +mosqu�to_�ݔty + * + $mosqu�to_�ݔty_�ad_by� +(cڡ +mosqu�to_�ݔty + * +��li� +, +id�tif�r +, +u�t8_t + * +v�ue +, +bo� + +sk�_f�� +) + +915 cڡ +mosqu�to_�ݔty + * +p +; + +916 if(! +��li� +� +NULL +; + +918 +p + = + `�ݔty__g�_�ݔty +( +��li� +, +id�tif�r +, +sk�_f�� +); + +919 if(! +p +� +NULL +; + +920 if( +p +-> +id�tif�r + !� +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR + + +921 && +p +-> +id�tif�r + !� +MQTT_PROP_REQUEST_PROBLEM_INFORMATION + + +922 && +p +-> +id�tif�r + !� +MQTT_PROP_REQUEST_RESPONSE_INFORMATION + + +923 && +p +-> +id�tif�r + !� +MQTT_PROP_MAXIMUM_QOS + + +924 && +p +-> +id�tif�r + !� +MQTT_PROP_RETAIN_AVAILABLE + + +925 && +p +-> +id�tif�r + !� +MQTT_PROP_WILDCARD_SUB_AVAILABLE + + +926 && +p +-> +id�tif�r + !� +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE + + +927 && +p +-> +id�tif�r + !� +MQTT_PROP_SHARED_SUB_AVAILABLE +){ + +928 +NULL +; + +931 if( +v�ue +�*v�u�� +p +->v�ue. +i8 +; + +933 +p +; + +934 + } +} + +937 cڡ +mosqu�to_�ݔty + * + $mosqu�to_�ݔty_�ad_�t16 +(cڡ +mosqu�to_�ݔty + * +��li� +, +id�tif�r +, +u�t16_t + * +v�ue +, +bo� + +sk�_f�� +) + +939 cڡ +mosqu�to_�ݔty + * +p +; + +940 if(! +��li� +� +NULL +; + +942 +p + = + `�ݔty__g�_�ݔty +( +��li� +, +id�tif�r +, +sk�_f�� +); + +943 if(! +p +� +NULL +; + +944 if( +p +-> +id�tif�r + !� +MQTT_PROP_SERVER_KEEP_ALIVE + + +945 && +p +-> +id�tif�r + !� +MQTT_PROP_RECEIVE_MAXIMUM + + +946 && +p +-> +id�tif�r + !� +MQTT_PROP_TOPIC_ALIAS_MAXIMUM + + +947 && +p +-> +id�tif�r + !� +MQTT_PROP_TOPIC_ALIAS +){ + +948 +NULL +; + +951 if( +v�ue +�*v�u�� +p +->v�ue. +i16 +; + +953 +p +; + +954 + } +} + +957 cڡ +mosqu�to_�ݔty + * + $mosqu�to_�ݔty_�ad_�t32 +(cڡ +mosqu�to_�ݔty + * +��li� +, +id�tif�r +, +u�t32_t + * +v�ue +, +bo� + +sk�_f�� +) + +959 cڡ +mosqu�to_�ݔty + * +p +; + +960 if(! +��li� +� +NULL +; + +962 +p + = + `�ݔty__g�_�ݔty +( +��li� +, +id�tif�r +, +sk�_f�� +); + +963 if(! +p +� +NULL +; + +964 if( +p +-> +id�tif�r + !� +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL + + +965 && +p +-> +id�tif�r + !� +MQTT_PROP_SESSION_EXPIRY_INTERVAL + + +966 && +p +-> +id�tif�r + !� +MQTT_PROP_WILL_DELAY_INTERVAL + + +967 && +p +-> +id�tif�r + !� +MQTT_PROP_MAXIMUM_PACKET_SIZE +){ + +969 +NULL +; + +972 if( +v�ue +�*v�u�� +p +->v�ue. +i32 +; + +974 +p +; + +975 + } +} + +978 cڡ +mosqu�to_�ݔty + * + $mosqu�to_�ݔty_�ad_v��t +(cڡ +mosqu�to_�ݔty + * +��li� +, +id�tif�r +, +u�t32_t + * +v�ue +, +bo� + +sk�_f�� +) + +980 cڡ +mosqu�to_�ݔty + * +p +; + +981 if(! +��li� +� +NULL +; + +983 +p + = + `�ݔty__g�_�ݔty +( +��li� +, +id�tif�r +, +sk�_f�� +); + +984 if(! +p +� +NULL +; + +985 if( +p +-> +id�tif�r + !� +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +){ + +986 +NULL +; + +989 if( +v�ue +�*v�u�� +p +->v�ue. +v��t +; + +991 +p +; + +992 + } +} + +995 cڡ +mosqu�to_�ݔty + * + $mosqu�to_�ݔty_�ad_b��y +(cڡ +mosqu�to_�ݔty + * +��li� +, +id�tif�r +, ** +v�ue +, +u�t16_t + * +�n +, +bo� + +sk�_f�� +) + +997 cڡ +mosqu�to_�ݔty + * +p +; + +998 if(! +��li� + || ( +v�ue + && ! +�n +�|| (!v�u�&&��)� +NULL +; + +1000 +p + = + `�ݔty__g�_�ݔty +( +��li� +, +id�tif�r +, +sk�_f�� +); + +1001 if(! +p +� +NULL +; + +1002 if( +p +-> +id�tif�r + !� +MQTT_PROP_CORRELATION_DATA + + +1003 && +p +-> +id�tif�r + !� +MQTT_PROP_AUTHENTICATION_DATA +){ + +1005 +NULL +; + +1008 if( +v�ue +){ + +1009 * +�n + = +p +-> +v�ue +. +b� +.len; + +1010 * +v�ue + = + `m�loc +(* +�n +); + +1011 if(!(* +v�ue +)� +NULL +; + +1013 + `mem�y +(* +v�ue +, +p +->v�ue. +b� +. +v +, * +�n +); + +1016 +p +; + +1017 + } +} + +1020 cڡ +mosqu�to_�ݔty + * + $mosqu�to_�ݔty_�ad_�r�g +(cڡ +mosqu�to_�ݔty + * +��li� +, +id�tif�r +, ** +v�ue +, +bo� + +sk�_f�� +) + +1022 cڡ +mosqu�to_�ݔty + * +p +; + +1023 if(! +��li� +� +NULL +; + +1025 +p + = + `�ݔty__g�_�ݔty +( +��li� +, +id�tif�r +, +sk�_f�� +); + +1026 if(! +p +� +NULL +; + +1027 if( +p +-> +id�tif�r + !� +MQTT_PROP_CONTENT_TYPE + + +1028 && +p +-> +id�tif�r + !� +MQTT_PROP_RESPONSE_TOPIC + + +1029 && +p +-> +id�tif�r + !� +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER + + +1030 && +p +-> +id�tif�r + !� +MQTT_PROP_AUTHENTICATION_METHOD + + +1031 && +p +-> +id�tif�r + !� +MQTT_PROP_RESPONSE_INFORMATION + + +1032 && +p +-> +id�tif�r + !� +MQTT_PROP_SERVER_REFERENCE + + +1033 && +p +-> +id�tif�r + !� +MQTT_PROP_REASON_STRING +){ + +1035 +NULL +; + +1038 if( +v�ue +){ + +1039 * +v�ue + = + `��oc +(1, +p +->v�ue. +s +. +�n ++1); + +1040 if(!(* +v�ue +)� +NULL +; + +1042 + `mem�y +(* +v�ue +, +p +->v�ue. +s +. +v +,�->v�ue.s. +�n +); + +1045 +p +; + +1046 + } +} + +1049 cڡ +mosqu�to_�ݔty + * + $mosqu�to_�ݔty_�ad_�r�g_�� +(cڡ +mosqu�to_�ݔty + * +��li� +, +id�tif�r +, ** +�me +, ** +v�ue +, +bo� + +sk�_f�� +) + +1051 cڡ +mosqu�to_�ݔty + * +p +; + +1052 if(! +��li� +� +NULL +; + +1054 +p + = + `�ݔty__g�_�ݔty +( +��li� +, +id�tif�r +, +sk�_f�� +); + +1055 if(! +p +� +NULL +; + +1056 if( +p +-> +id�tif�r + !� +MQTT_PROP_USER_PROPERTY +� +NULL +; + +1058 if( +�me +){ + +1059 * +�me + = + `��oc +(1, +p +->�me. +�n ++1); + +1060 if(!(* +�me +)� +NULL +; + +1061 + `mem�y +(* +�me +, +p +->�me. +v +,�->�me. +�n +); + +1064 if( +v�ue +){ + +1065 * +v�ue + = + `��oc +(1, +p +->v�ue. +s +. +�n ++1); + +1066 if(!(* +v�ue +)){ + +1067 if( +�me +� + `� +(*name); + +1068 +NULL +; + +1070 + `mem�y +(* +v�ue +, +p +->v�ue. +s +. +v +,�->v�ue.s. +�n +); + +1073 +p +; + +1074 + } +} + +1077 + $mosqu�to_�ݔty_c�y_�l +( +mosqu�to_�ݔty + ** +de� +, cڡ mosqu�to_�ݔty * +�c +) + +1079 +mosqu�to_�ݔty + * +�ew +, * +�a� + = +NULL +; + +1081 if(! +�c +� +MOSQ_ERR_SUCCESS +; + +1082 if(! +de� +� +MOSQ_ERR_INVAL +; + +1084 * +de� + = +NULL +; + +1086 +�c +){ + +1087 +�ew + = + `��oc +(1, ( +mosqu�to_�ݔty +)); + +1088 if(! +�ew +){ + +1089 + `mosqu�to_�ݔty_�_�l +( +de� +); + +1090 +MOSQ_ERR_NOMEM +; + +1092 if( +�a� +){ + +1093 +�a� +-> +�xt + = +�ew +; + +1095 * +de� + = +�ew +; + +1097 +�a� + = +�ew +; + +1099 +�ew +-> +id�tif�r + = +�c +->identifier; + +1100 +�ew +-> +id�tif�r +){ + +1101 +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +: + +1102 +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +: + +1103 +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +: + +1104 +MQTT_PROP_MAXIMUM_QOS +: + +1105 +MQTT_PROP_RETAIN_AVAILABLE +: + +1106 +MQTT_PROP_WILDCARD_SUB_AVAILABLE +: + +1107 +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +: + +1108 +MQTT_PROP_SHARED_SUB_AVAILABLE +: + +1109 +�ew +-> +v�ue +. +i8 + = +�c +->value.i8; + +1112 +MQTT_PROP_SERVER_KEEP_ALIVE +: + +1113 +MQTT_PROP_RECEIVE_MAXIMUM +: + +1114 +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +: + +1115 +MQTT_PROP_TOPIC_ALIAS +: + +1116 +�ew +-> +v�ue +. +i16 + = +�c +->value.i16; + +1119 +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +: + +1120 +MQTT_PROP_SESSION_EXPIRY_INTERVAL +: + +1121 +MQTT_PROP_WILL_DELAY_INTERVAL +: + +1122 +MQTT_PROP_MAXIMUM_PACKET_SIZE +: + +1123 +�ew +-> +v�ue +. +i32 + = +�c +->value.i32; + +1126 +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +: + +1127 +�ew +-> +v�ue +. +v��t + = +�c +->value.varint; + +1130 +MQTT_PROP_CONTENT_TYPE +: + +1131 +MQTT_PROP_RESPONSE_TOPIC +: + +1132 +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +: + +1133 +MQTT_PROP_AUTHENTICATION_METHOD +: + +1134 +MQTT_PROP_RESPONSE_INFORMATION +: + +1135 +MQTT_PROP_SERVER_REFERENCE +: + +1136 +MQTT_PROP_REASON_STRING +: + +1137 +�ew +-> +v�ue +. +s +. +�n + = +�c +->value.s.len; + +1138 +�ew +-> +v�ue +. +s +. +v + = + `�rdup +( +�c +->value.s.v); + +1139 if(! +�ew +-> +v�ue +. +s +. +v +){ + +1140 + `mosqu�to_�ݔty_�_�l +( +de� +); + +1141 +MOSQ_ERR_NOMEM +; + +1145 +MQTT_PROP_AUTHENTICATION_DATA +: + +1146 +MQTT_PROP_CORRELATION_DATA +: + +1147 +�ew +-> +v�ue +. +b� +. +�n + = +�c +->value.bin.len; + +1148 +�ew +-> +v�ue +. +b� +. +v + = + `m�loc +��w->v�ue.b�. +�n +); + +1149 if(! +�ew +-> +v�ue +. +b� +. +v +){ + +1150 + `mosqu�to_�ݔty_�_�l +( +de� +); + +1151 +MOSQ_ERR_NOMEM +; + +1153 + `mem�y +( +�ew +-> +v�ue +. +b� +. +v +, +�c +->v�ue.b�.v,��w->v�ue.b�. +�n +); + +1156 +MQTT_PROP_USER_PROPERTY +: + +1157 +�ew +-> +v�ue +. +s +. +�n + = +�c +->value.s.len; + +1158 +�ew +-> +v�ue +. +s +. +v + = + `�rdup +( +�c +->value.s.v); + +1159 if(! +�ew +-> +v�ue +. +s +. +v +){ + +1160 + `mosqu�to_�ݔty_�_�l +( +de� +); + +1161 +MOSQ_ERR_NOMEM +; + +1164 +�ew +-> +�me +. +�n + = +�c +->name.len; + +1165 +�ew +-> +�me +. +v + = + `�rdup +( +�c +->name.v); + +1166 if(! +�ew +-> +�me +. +v +){ + +1167 + `mosqu�to_�ݔty_�_�l +( +de� +); + +1168 +MOSQ_ERR_NOMEM +; + +1173 + `mosqu�to_�ݔty_�_�l +( +de� +); + +1174 +MOSQ_ERR_INVAL +; + +1177 +�c + = src-> +�xt +; + +1180 +MOSQ_ERR_SUCCESS +; + +1181 + } +} + + @lib/property_mosq.h + +16 #i�de� +PROPERTY_MOSQ_H + + +17 + #PROPERTY_MOSQ_H + + + ) + +19 + ~"mosqu�to_����.h +" + +20 + ~"mosqu�to.h +" + +22 + smq�__�r�g + { + +23 * + mv +; + +24 + m�n +; + +27 + smq�5__�ݔty + { + +28 +mq�5__�ݔty + * + m�xt +; + +30 +u�t8_t + + mi8 +; + +31 +u�t16_t + + mi16 +; + +32 +u�t32_t + + mi32 +; + +33 +u�t32_t + + mv��t +; + +34 +mq�__�r�g + + mb� +; + +35 +mq�__�r�g + + ms +; + +36 } + mv�ue +; + +37 +mq�__�r�g + + m�me +; + +38 +�t32_t + + mid�tif�r +; + +39 +bo� + + m���_g���ed +; + +43 +�ݔty__�ad_�l +( +comm�d +, +mosqu�to__�ck� + * +�ck� +, +mosqu�to_�ݔty + ** +�ݔty +); + +44 +�ݔty__wr�e_�l +( +mosqu�to__�ck� + * +�ck� +, cڡ +mosqu�to_�ݔty + * +�ݔty +, +bo� + +wr�e_�n +); + +45 +�ݔty__� +( +mosqu�to_�ݔty + ** +�ݔty +); + +47 +�ݔty__g�_�ngth +(cڡ +mosqu�to_�ݔty + * +�ݔty +); + +48 +�ݔty__g�_�ngth_�l +(cڡ +mosqu�to_�ݔty + * +�ݔty +); + + @lib/read_handle.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<�dio.h +> + +21 + ~<�r�g.h +> + +23 + ~"mosqu�to.h +" + +24 + ~"logg�g_mosq.h +" + +25 + ~"mem�y_mosq.h +" + +26 + ~"mes�ges_mosq.h +" + +27 + ~"mq�_��oc�.h +" + +28 + ~"�t_mosq.h +" + +29 + ~"�ck�_mosq.h +" + +30 + ~"�ad_h�d�.h +" + +31 + ~"�nd_mosq.h +" + +32 + ~"time_mosq.h +" + +33 + ~"ut�_mosq.h +" + +35 + $h�d�__�ck� +( +mosqu�to + * +mosq +) + +37 + `as�� +( +mosq +); + +39 ( +mosq +-> +�_�ck� +. +comm�d +)&0xF0){ + +40 +CMD_PINGREQ +: + +41 + `h�d�__p�g�q +( +mosq +); + +42 +CMD_PINGRESP +: + +43 + `h�d�__p�g�� +( +mosq +); + +44 +CMD_PUBACK +: + +45 + `h�d�__pubackcomp +( +mosq +, "PUBACK"); + +46 +CMD_PUBCOMP +: + +47 + `h�d�__pubackcomp +( +mosq +, "PUBCOMP"); + +48 +CMD_PUBLISH +: + +49 + `h�d�__publish +( +mosq +); + +50 +CMD_PUBREC +: + +51 + `h�d�__pub�c +( +NULL +, +mosq +); + +52 +CMD_PUBREL +: + +53 + `h�d�__pub�l +( +NULL +, +mosq +); + +54 +CMD_CONNACK +: + +55 + `h�d�__c��ck +( +mosq +); + +56 +CMD_SUBACK +: + +57 + `h�d�__suback +( +mosq +); + +58 +CMD_UNSUBACK +: + +59 + `h�d�__unsuback +( +mosq +); + +60 +CMD_DISCONNECT +: + +61 + `h�d�__disc��� +( +mosq +); + +62 +CMD_AUTH +: + +63 + `h�d�__auth +( +mosq +); + +66 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "E��: U�ecogni�d comm�d %d\n", (mosq-> +�_�ck� +. +comm�d +)&0xF0); + +67 +MOSQ_ERR_PROTOCOL +; + +69 + } +} + + @lib/read_handle.h + +16 #i�de� +READ_HANDLE_H + + +17 + #READ_HANDLE_H + + + ) + +19 + ~"mosqu�to.h +" + +20 + gmosqu�to_db +; + +22 +h�d�__p�g�q +( +mosqu�to + * +mosq +); + +23 +h�d�__p�g�� +( +mosqu�to + * +mosq +); + +24 #ifde� +WITH_BROKER + + +25 +h�d�__pubackcomp +( +mosqu�to_db + * +db +, +mosqu�to + * +mosq +, cڡ * +ty� +); + +27 +h�d�__�ck� +( +mosqu�to + * +mosq +); + +28 +h�d�__c��ck +( +mosqu�to + * +mosq +); + +29 +h�d�__disc��� +( +mosqu�to + * +mosq +); + +30 +h�d�__pubackcomp +( +mosqu�to + * +mosq +, cڡ * +ty� +); + +31 +h�d�__publish +( +mosqu�to + * +mosq +); + +32 +h�d�__auth +( +mosqu�to + * +mosq +); + +34 +h�d�__pub�c +( +mosqu�to_db + * +db +, +mosqu�to + * +mosq +); + +35 +h�d�__pub�l +( +mosqu�to_db + * +db +, +mosqu�to + * +mosq +); + +36 +h�d�__suback +( +mosqu�to + * +mosq +); + +37 +h�d�__unsuback +( +mosqu�to + * +mosq +); + + @lib/send_connect.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<�r�g.h +> + +22 #ifde� +WITH_BROKER + + +23 + ~"mosqu�to_brok�_����.h +" + +26 + ~"logg�g_mosq.h +" + +27 + ~"mem�y_mosq.h +" + +28 + ~"mosqu�to.h +" + +29 + ~"mosqu�to_����.h +" + +30 + ~"mq�_��oc�.h +" + +31 + ~"�ck�_mosq.h +" + +32 + ~"�ݔty_mosq.h +" + +34 + $�nd__c��� +( +mosqu�to + * +mosq +, +u�t16_t + +k��live +, +bo� + +��n_�ssi� +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +36 +mosqu�to__�ck� + * +�ck� + = +NULL +; + +37 +�yl�d�n +; + +38 +u�t8_t + +w�l + = 0; + +39 +u�t8_t + +by� +; + +40 +rc +; + +41 +u�t8_t + +v�si� +; + +42 * +���id +, * +u��ame +, * +�ssw�d +; + +43 +h�d��n +; + +44 +���n + = 0, +w�l_���n +, +v�by�s +; + +45 +mosqu�to_�ݔty + * +lo�l_��s + = +NULL +; + +46 +u�t16_t + +��ive_maximum +; + +48 + `as�� +( +mosq +); + +50 if( +mosq +-> +��oc� + =� +mosq_p_mq�31 + && !mosq-> +id +� +MOSQ_ERR_PROTOCOL +; + +52 #i� + `def�ed +( +WITH_BROKER +�&& def�ed( +WITH_BRIDGE +) + +53 if( +mosq +-> +bridge +){ + +54 +���id + = +mosq +-> +bridge +-> +�m�e_���id +; + +55 +u��ame + = +mosq +-> +bridge +-> +�m�e_u��ame +; + +56 +�ssw�d + = +mosq +-> +bridge +-> +�m�e_�ssw�d +; + +58 +���id + = +mosq +-> +id +; + +59 +u��ame + = +mosq +->username; + +60 +�ssw�d + = +mosq +->password; + +63 +���id + = +mosq +-> +id +; + +64 +u��ame + = +mosq +->username; + +65 +�ssw�d + = +mosq +->password; + +68 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +70 if(! + `mosqu�to_�ݔty_�ad_�t16 +( +�ݔt�s +, +MQTT_PROP_RECEIVE_MAXIMUM +, & +��ive_maximum +, +�l� +)){ + +71 +rc + = + `mosqu�to_�ݔty_add_�t16 +(& +lo�l_��s +, +MQTT_PROP_RECEIVE_MAXIMUM +, +mosq +-> +msgs_� +. +��ight_maximum +); + +72 if( +rc +) �c; + +74 +mosq +-> +msgs_� +. +��ight_maximum + = +��ive_maximum +; + +75 +mosq +-> +msgs_� +. +��ight_qu�a + = +��ive_maximum +; + +78 +v�si� + = +MQTT_PROTOCOL_V5 +; + +79 +h�d��n + = 10; + +80 +���n + = 0; + +81 +���n + +� + `�ݔty__g�_�ngth_�l +( +�ݔt�s +); + +82 +���n + +� + `�ݔty__g�_�ngth_�l +( +lo�l_��s +); + +83 +v�by�s + = + `�ck�__v��t_by�s +( +���n +); + +84 +h�d��n + +� +���n + + +v�by�s +; + +85 }if( +mosq +-> +��oc� + =� +mosq_p_mq�311 +){ + +86 +v�si� + = +MQTT_PROTOCOL_V311 +; + +87 +h�d��n + = 10; + +88 }if( +mosq +-> +��oc� + =� +mosq_p_mq�31 +){ + +89 +v�si� + = +MQTT_PROTOCOL_V31 +; + +90 +h�d��n + = 12; + +92 +MOSQ_ERR_INVAL +; + +95 +�ck� + = + `mosqu�to__��oc +(1, ( +mosqu�to__�ck� +)); + +96 if(! +�ck� +� +MOSQ_ERR_NOMEM +; + +98 if( +���id +){ + +99 +�yl�d�n + = 2+ + `��� +( +���id +); + +101 +�yl�d�n + = 2; + +103 if( +mosq +-> +w�l +){ + +104 +w�l + = 1; + +105 + `as�� +( +mosq +-> +w�l +-> +msg +. +t�ic +); + +107 +�yl�d�n + +�2+ + `��� +( +mosq +-> +w�l +-> +msg +. +t�ic +) + 2+mosq->will->msg.payloadlen; + +108 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +109 +w�l_���n + = + `�ݔty__g�_�ngth_�l +( +mosq +-> +w�l +-> +�ݔt�s +); + +110 +v�by�s + = + `�ck�__v��t_by�s +( +w�l_���n +); + +111 +�yl�d�n + +� +w�l_���n + + +v�by�s +; + +118 if( +mosq +-> +��oc� + =� +mosq_p_mq�31 + || mosq->��oc� =� +mosq_p_mq�311 +){ + +119 if( +�ssw�d + !� +NULL + && +u��ame + == NULL){ + +120 +MOSQ_ERR_INVAL +; + +124 if( +u��ame +){ + +125 +�yl�d�n + +�2+ + `��� +( +u��ame +); + +127 if( +�ssw�d +){ + +128 +�yl�d�n + +�2+ + `��� +( +�ssw�d +); + +131 +�ck� +-> +comm�d + = +CMD_CONNECT +; + +132 +�ck� +-> +�ma��g_�ngth + = +h�d��n + + +�yl�d�n +; + +133 +rc + = + `�ck�__�loc +( +�ck� +); + +134 if( +rc +){ + +135 + `mosqu�to__� +( +�ck� +); + +136 +rc +; + +140 if( +v�si� + =� +MQTT_PROTOCOL_V31 +){ + +141 + `�ck�__wr�e_�r�g +( +�ck� +, +PROTOCOL_NAME_v31 +, + `��� +(PROTOCOL_NAME_v31)); + +143 + `�ck�__wr�e_�r�g +( +�ck� +, +PROTOCOL_NAME +, + `��� +(PROTOCOL_NAME)); + +145 #i� + `def�ed +( +WITH_BROKER +�&& def�ed( +WITH_BRIDGE +) + +146 if( +mosq +-> +bridge + && mosq->bridge-> +�y_�iv�e + && mosq->bridge-> +�y_�iv�e_ac��ed +){ + +147 +v�si� + |= 0x80; + +151 + `�ck�__wr�e_by� +( +�ck� +, +v�si� +); + +152 +by� + = ( +��n_�ssi� +&0x1)<<1; + +153 if( +w�l +){ + +154 +by� + = by� | (( +mosq +-> +w�l +-> +msg +. +��� +&0x1)<<5�| ((mosq->w�l->msg. +qos +&0x3)<<3) | ((will&0x1)<<2); + +156 if( +u��ame +){ + +157 +by� + = byte | 0x1<<7; + +159 if( +mosq +-> +�ssw�d +){ + +160 +by� + = byte | 0x1<<6; + +162 + `�ck�__wr�e_by� +( +�ck� +, +by� +); + +163 + `�ck�__wr�e_u�t16 +( +�ck� +, +k��live +); + +165 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +167 + `�ck�__wr�e_v��t +( +�ck� +, +���n +); + +168 + `�ݔty__wr�e_�l +( +�ck� +, +�ݔt�s +, +�l� +); + +169 + `�ݔty__wr�e_�l +( +�ck� +, +lo�l_��s +, +�l� +); + +173 if( +���id +){ + +174 + `�ck�__wr�e_�r�g +( +�ck� +, +���id +, + `��� +(clientid)); + +176 + `�ck�__wr�e_u�t16 +( +�ck� +, 0); + +178 if( +w�l +){ + +179 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +181 + `�ݔty__wr�e_�l +( +�ck� +, +mosq +-> +w�l +-> +�ݔt�s +, +�ue +); + +183 + `�ck�__wr�e_�r�g +( +�ck� +, +mosq +-> +w�l +-> +msg +. +t�ic +, + `��� +(mosq->will->msg.topic)); + +184 + `�ck�__wr�e_�r�g +( +�ck� +, (cڡ *) +mosq +-> +w�l +-> +msg +. +�yl�d +, mosq->w�l->msg. +�yl�d�n +); + +187 if( +u��ame +){ + +188 + `�ck�__wr�e_�r�g +( +�ck� +, +u��ame +, + `��� +(username)); + +190 if( +�ssw�d +){ + +191 + `�ck�__wr�e_�r�g +( +�ck� +, +�ssw�d +, + `��� +(password)); + +194 +mosq +-> +k��live + = keepalive; + +195 #ifde� +WITH_BROKER + + +196 #ifde� +WITH_BRIDGE + + +197 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Bridg�%��nd�g CONNECT", +���id +); + +200 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Cl�� %��nd�g CONNECT", +���id +); + +202 + `�ck�__queue +( +mosq +, +�ck� +); + +203 + } +} + + @lib/send_disconnect.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +21 #ifde� +WITH_BROKER + + +22 + ~"mosqu�to_brok�_����.h +" + +25 + ~"mosqu�to.h +" + +26 + ~"mosqu�to_����.h +" + +27 + ~"logg�g_mosq.h +" + +28 + ~"mem�y_mosq.h +" + +29 + ~"mq�_��oc�.h +" + +30 + ~"�ck�_mosq.h +" + +31 + ~"�ݔty_mosq.h +" + +32 + ~"�nd_mosq.h +" + +35 + $�nd__disc��� +( +mosqu�to + * +mosq +, +u�t8_t + +�as�_code +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +37 +mosqu�to__�ck� + * +�ck� + = +NULL +; + +38 +rc +; + +39 +���n +, +v�by�s +; + +41 + `as�� +( +mosq +); + +42 #ifde� +WITH_BROKER + + +43 #ifde� +WITH_BRIDGE + + +44 if( +mosq +-> +bridge +){ + +45 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Bridg�%��nd�g DISCONNECT", mosq-> +id +); + +49 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "S�d�g DISCONNECT��%��c%d)", mosq-> +id +, +�as�_code +); + +53 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Cl�� %��nd�g DISCONNECT", mosq-> +id +); + +55 + `as�� +( +mosq +); + +56 +�ck� + = + `mosqu�to__��oc +(1, ( +mosqu�to__�ck� +)); + +57 if(! +�ck� +� +MOSQ_ERR_NOMEM +; + +59 +�ck� +-> +comm�d + = +CMD_DISCONNECT +; + +60 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 + && ( +�as�_code + !�0 || +�ݔt�s +)){ + +61 +�ck� +-> +�ma��g_�ngth + = 1; + +62 if( +�ݔt�s +){ + +63 +���n + = + `�ݔty__g�_�ngth_�l +( +�ݔt�s +); + +64 +v�by�s + = + `�ck�__v��t_by�s +( +���n +); + +65 +�ck� +-> +�ma��g_�ngth + +� +���n + + +v�by�s +; + +68 +�ck� +-> +�ma��g_�ngth + = 0; + +71 +rc + = + `�ck�__�loc +( +�ck� +); + +72 if( +rc +){ + +73 + `mosqu�to__� +( +�ck� +); + +74 +rc +; + +76 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 + && ( +�as�_code + !�0 || +�ݔt�s +)){ + +77 + `�ck�__wr�e_by� +( +�ck� +, +�as�_code +); + +78 if( +�ݔt�s +){ + +79 + `�ݔty__wr�e_�l +( +�ck� +, +�ݔt�s +, +�ue +); + +83 + `�ck�__queue +( +mosq +, +�ck� +); + +84 + } +} + + @lib/send_mosq.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<�dio.h +> + +21 + ~<�r�g.h +> + +23 #ifde� +WITH_BROKER + + +24 + ~"mosqu�to_brok�_����.h +" + +25 + ~"sys_��.h +" + +27 + #G_PUB_BYTES_SENT_INC +( +A +) + + ) + +30 + ~"mosqu�to.h +" + +31 + ~"mosqu�to_����.h +" + +32 + ~"logg�g_mosq.h +" + +33 + ~"mq�_��oc�.h +" + +34 + ~"mem�y_mosq.h +" + +35 + ~"�t_mosq.h +" + +36 + ~"�ck�_mosq.h +" + +37 + ~"�ݔty_mosq.h +" + +38 + ~"�nd_mosq.h +" + +39 + ~"time_mosq.h +" + +40 + ~"ut�_mosq.h +" + +42 + $�nd__p�g�q +( +mosqu�to + * +mosq +) + +44 +rc +; + +45 + `as�� +( +mosq +); + +46 #ifde� +WITH_BROKER + + +47 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "S�d�g PINGREQ��%s", +mosq +-> +id +); + +49 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Cl�� %��nd�g PINGREQ", mosq-> +id +); + +51 +rc + = + `�nd__sim�e_comm�d +( +mosq +, +CMD_PINGREQ +); + +52 if( +rc + =� +MOSQ_ERR_SUCCESS +){ + +53 +mosq +-> +p�g_t + = + `mosqu�to_time +(); + +55 +rc +; + +56 + } +} + +58 + $�nd__p�g�� +( +mosqu�to + * +mosq +) + +60 #ifde� +WITH_BROKER + + +61 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "S�d�g PINGRESP��%s", +mosq +-> +id +); + +63 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Cl�� %��nd�g PINGRESP", mosq-> +id +); + +65 + `�nd__sim�e_comm�d +( +mosq +, +CMD_PINGRESP +); + +66 + } +} + +68 + $�nd__puback +( +mosqu�to + * +mosq +, +u�t16_t + +mid +, +u�t8_t + +�as�_code +) + +70 #ifde� +WITH_BROKER + + +71 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "S�d�g PUBACK��%�(m%d,�c%d)", +mosq +-> +id +, +mid +, +�as�_code +); + +73 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Cl�� %��nd�g PUBACK (m%d,�c%d)", mosq-> +id +, +mid +, +�as�_code +); + +75 + `ut�__��em�t_��ive_qu�a +( +mosq +); + +77 + `�nd__comm�d_w�h_mid +( +mosq +, +CMD_PUBACK +, +mid +, +�l� +, +�as�_code +, +NULL +); + +78 + } +} + +80 + $�nd__pubcomp +( +mosqu�to + * +mosq +, +u�t16_t + +mid +) + +82 #ifde� +WITH_BROKER + + +83 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "S�d�g PUBCOMP��%�(m%d)", +mosq +-> +id +, +mid +); + +85 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Cl�� %��nd�g PUBCOMP (m%d)", mosq-> +id +, +mid +); + +87 + `ut�__��em�t_��ive_qu�a +( +mosq +); + +89 + `�nd__comm�d_w�h_mid +( +mosq +, +CMD_PUBCOMP +, +mid +, +�l� +, 0, +NULL +); + +90 + } +} + +93 + $�nd__pub�c +( +mosqu�to + * +mosq +, +u�t16_t + +mid +, +u�t8_t + +�as�_code +) + +95 #ifde� +WITH_BROKER + + +96 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "S�d�g PUBREC��%�(m%d,�c%d)", +mosq +-> +id +, +mid +, +�as�_code +); + +98 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Cl�� %��nd�g PUBREC (m%d,�c%d)", mosq-> +id +, +mid +, +�as�_code +); + +100 if( +�as�_code + >�0x80 && +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +101 + `ut�__��em�t_��ive_qu�a +( +mosq +); + +104 + `�nd__comm�d_w�h_mid +( +mosq +, +CMD_PUBREC +, +mid +, +�l� +, +�as�_code +, +NULL +); + +105 + } +} + +107 + $�nd__pub�l +( +mosqu�to + * +mosq +, +u�t16_t + +mid +) + +109 #ifde� +WITH_BROKER + + +110 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "S�d�g PUBREL��%�(m%d)", +mosq +-> +id +, +mid +); + +112 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Cl�� %��nd�g PUBREL (m%d)", mosq-> +id +, +mid +); + +115 + `�nd__comm�d_w�h_mid +( +mosq +, +CMD_PUBREL +|2, +mid +, +�l� +, 0, +NULL +); + +116 + } +} + +119 + $�nd__comm�d_w�h_mid +( +mosqu�to + * +mosq +, +u�t8_t + +comm�d +, +u�t16_t + +mid +, +bo� + +dup +, u�t8_� +�as�_code +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +121 +mosqu�to__�ck� + * +�ck� + = +NULL +; + +122 +rc +; + +123 +���n +, +v�by�s +; + +125 + `as�� +( +mosq +); + +126 +�ck� + = + `mosqu�to__��oc +(1, ( +mosqu�to__�ck� +)); + +127 if(! +�ck� +� +MOSQ_ERR_NOMEM +; + +129 +�ck� +-> +comm�d + = command; + +130 if( +dup +){ + +131 +�ck� +-> +comm�d + |= 8; + +133 +�ck� +-> +�ma��g_�ngth + = 2; + +135 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +136 if( +�as�_code + !�0 || +�ݔt�s +){ + +137 +�ck� +-> +�ma��g_�ngth + += 1; + +140 if( +�ݔt�s +){ + +141 +���n + = + `�ݔty__g�_�ngth_�l +( +�ݔt�s +); + +142 +v�by�s + = + `�ck�__v��t_by�s +( +���n +); + +143 +�ck� +-> +�ma��g_�ngth + +� +v�by�s + + +���n +; + +147 +rc + = + `�ck�__�loc +( +�ck� +); + +148 if( +rc +){ + +149 + `mosqu�to__� +( +�ck� +); + +150 +rc +; + +153 + `�ck�__wr�e_u�t16 +( +�ck� +, +mid +); + +155 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +156 if( +�as�_code + !�0 || +�ݔt�s +){ + +157 + `�ck�__wr�e_by� +( +�ck� +, +�as�_code +); + +159 if( +�ݔt�s +){ + +160 + `�ݔty__wr�e_�l +( +�ck� +, +�ݔt�s +, +�ue +); + +164 + `�ck�__queue +( +mosq +, +�ck� +); + +165 + } +} + +168 + $�nd__sim�e_comm�d +( +mosqu�to + * +mosq +, +u�t8_t + +comm�d +) + +170 +mosqu�to__�ck� + * +�ck� + = +NULL +; + +171 +rc +; + +173 + `as�� +( +mosq +); + +174 +�ck� + = + `mosqu�to__��oc +(1, ( +mosqu�to__�ck� +)); + +175 if(! +�ck� +� +MOSQ_ERR_NOMEM +; + +177 +�ck� +-> +comm�d + = command; + +178 +�ck� +-> +�ma��g_�ngth + = 0; + +180 +rc + = + `�ck�__�loc +( +�ck� +); + +181 if( +rc +){ + +182 + `mosqu�to__� +( +�ck� +); + +183 +rc +; + +186 + `�ck�__queue +( +mosq +, +�ck� +); + +187 + } +} + + @lib/send_mosq.h + +16 #i�de� +SEND_MOSQ_H + + +17 + #SEND_MOSQ_H + + + ) + +19 + ~"mosqu�to.h +" + +20 + ~"�ݔty_mosq.h +" + +22 +�nd__sim�e_comm�d +( +mosqu�to + * +mosq +, +u�t8_t + +comm�d +); + +23 +�nd__comm�d_w�h_mid +( +mosqu�to + * +mosq +, +u�t8_t + +comm�d +, +u�t16_t + +mid +, +bo� + +dup +, u�t8_� +�as�_code +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +); + +24 +�nd__��_publish +( +mosqu�to + * +mosq +, +u�t16_t + +mid +, cڡ * +t�ic +, +u�t32_t + +�yl�d�n +, cڡ * +�yl�d +, +qos +, +bo� + +��� +, bo� +dup +, cڡ +mosqu�to_�ݔty + * +cmsg_��s +, cڡ mosqu�to_�ݔty * +��e_��s +, u�t32_� +exp�y_��rv� +); + +26 +�nd__c��� +( +mosqu�to + * +mosq +, +u�t16_t + +k��live +, +bo� + +��n_�ssi� +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +); + +27 +�nd__disc��� +( +mosqu�to + * +mosq +, +u�t8_t + +�as�_code +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +); + +28 +�nd__p�g�q +( +mosqu�to + * +mosq +); + +29 +�nd__p�g�� +( +mosqu�to + * +mosq +); + +30 +�nd__puback +( +mosqu�to + * +mosq +, +u�t16_t + +mid +, +u�t8_t + +�as�_code +); + +31 +�nd__pubcomp +( +mosqu�to + * +mosq +, +u�t16_t + +mid +); + +32 +�nd__publish +( +mosqu�to + * +mosq +, +u�t16_t + +mid +, cڡ * +t�ic +, +u�t32_t + +�yl�d�n +, cڡ * +�yl�d +, +qos +, +bo� + +��� +, bo� +dup +, cڡ +mosqu�to_�ݔty + * +cmsg_��s +, cڡ mosqu�to_�ݔty * +��e_��s +, u�t32_� +exp�y_��rv� +); + +33 +�nd__pub�c +( +mosqu�to + * +mosq +, +u�t16_t + +mid +, +u�t8_t + +�as�_code +); + +34 +�nd__pub�l +( +mosqu�to + * +mosq +, +u�t16_t + +mid +); + +35 +�nd__subs�ibe +( +mosqu�to + * +mosq +, * +mid +, +t�ic_cou� +, *cڡ *cڡ +t�ic +, +t�ic_qos +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +); + +36 +�nd__unsubs�ibe +( +mosqu�to + * +mosq +, * +mid +, +t�ic_cou� +, *cڡ *cڡ +t�ic +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +); + + @lib/send_publish.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<�r�g.h +> + +22 #ifde� +WITH_BROKER + + +23 + ~"mosqu�to_brok�_����.h +" + +24 + ~"sys_��.h +" + +26 + #G_PUB_BYTES_SENT_INC +( +A +) + + ) + +29 + ~"mosqu�to.h +" + +30 + ~"mosqu�to_����.h +" + +31 + ~"logg�g_mosq.h +" + +32 + ~"mq�_��oc�.h +" + +33 + ~"mem�y_mosq.h +" + +34 + ~"�t_mosq.h +" + +35 + ~"�ck�_mosq.h +" + +36 + ~"�ݔty_mosq.h +" + +37 + ~"�nd_mosq.h +" + +40 + $�nd__publish +( +mosqu�to + * +mosq +, +u�t16_t + +mid +, cڡ * +t�ic +, +u�t32_t + +�yl�d�n +, cڡ * +�yl�d +, +qos +, +bo� + +��� +, bo� +dup +, cڡ +mosqu�to_�ݔty + * +cmsg_��s +, cڡ mosqu�to_�ݔty * +��e_��s +, u�t32_� +exp�y_��rv� +) + +42 #ifde� +WITH_BROKER + + +43 +size_t + +�n +; + +44 #ifde� +WITH_BRIDGE + + +45 +i +; + +46 +mosqu�to__bridge_t�ic + * +cur_t�ic +; + +47 +bo� + +m�ch +; + +48 +rc +; + +49 * +m��d_t�ic + = +NULL +; + +50 * +t�ic_�mp + = +NULL +; + +53 + `as�� +( +mosq +); + +55 #i� + `def�ed +( +WITH_BROKER +�&& def�ed( +WITH_WEBSOCKETS +) + +56 if( +mosq +-> +sock + =� +INVALID_SOCKET + && !mosq-> +wsi +� +MOSQ_ERR_NO_CONN +; + +58 if( +mosq +-> +sock + =� +INVALID_SOCKET +� +MOSQ_ERR_NO_CONN +; + +61 #ifde� +WITH_BROKER + + +62 if( +mosq +-> +li��� + && mosq->li���-> +mou�_po�t +){ + +63 +�n + = + `��� +( +mosq +-> +li��� +-> +mou�_po�t +); + +64 if( +�n + < + `��� +( +t�ic +)){ + +65 +t�ic + +� +�n +; + +68 +MOSQ_ERR_SUCCESS +; + +71 #ifde� +WITH_BRIDGE + + +72 if( +mosq +-> +bridge + && mosq->bridge-> +t�ics + && mosq->bridge-> +t�ic_�m�p�g +){ + +73 +i +=0; i< +mosq +-> +bridge +-> +t�ic_cou� +; i++){ + +74 +cur_t�ic + = & +mosq +-> +bridge +-> +t�ics +[ +i +]; + +75 if(( +cur_t�ic +-> +d�e�i� + =� +bd_b�h + || cur_t�ic->d�e�i� =� +bd_out +) + +76 && ( +cur_t�ic +-> +�m�e_�efix + || cur_t�ic-> +lo�l_�efix +)){ + +79 +rc + = + `mosqu�to_t�ic_m�ches_sub +( +cur_t�ic +-> +lo�l_t�ic +, +t�ic +, & +m�ch +); + +80 if( +rc +){ + +81 +rc +; + +83 if( +m�ch +){ + +84 +m��d_t�ic + = + `mosqu�to__�rdup +( +t�ic +); + +85 if(! +m��d_t�ic +� +MOSQ_ERR_NOMEM +; + +86 if( +cur_t�ic +-> +lo�l_�efix +){ + +88 if(! + `��cmp +( +cur_t�ic +-> +lo�l_�efix +, +m��d_t�ic +, + `��� +(cur_topic->local_prefix))){ + +89 +t�ic_�mp + = + `mosqu�to__�rdup +( +m��d_t�ic ++ + `��� +( +cur_t�ic +-> +lo�l_�efix +)); + +90 + `mosqu�to__� +( +m��d_t�ic +); + +91 if(! +t�ic_�mp +){ + +92 +MOSQ_ERR_NOMEM +; + +94 +m��d_t�ic + = +t�ic_�mp +; + +98 if( +cur_t�ic +-> +�m�e_�efix +){ + +100 +�n + = + `��� +( +m��d_t�ic +�+ s��n( +cur_t�ic +-> +�m�e_�efix +)+1; + +101 +t�ic_�mp + = + `mosqu�to__m�loc +( +�n ++1); + +102 if(! +t�ic_�mp +){ + +103 + `mosqu�to__� +( +m��d_t�ic +); + +104 +MOSQ_ERR_NOMEM +; + +106 + `���tf +( +t�ic_�mp +, +�n +, "%s%s", +cur_t�ic +-> +�m�e_�efix +, +m��d_t�ic +); + +107 +t�ic_�mp +[ +�n +] = '\0'; + +108 + `mosqu�to__� +( +m��d_t�ic +); + +109 +m��d_t�ic + = +t�ic_�mp +; + +111 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "S�d�g PUBLISH��%�(d%d, q%d,�%d, m%d, '%s', ... (%ld by�s))", +mosq +-> +id +, +dup +, +qos +, +��� +, +mid +, +m��d_t�ic +, () +�yl�d�n +); + +112 + `G_PUB_BYTES_SENT_INC +( +�yl�d�n +); + +113 +rc + = + `�nd__��_publish +( +mosq +, +mid +, +m��d_t�ic +, +�yl�d�n +, +�yl�d +, +qos +, +��� +, +dup +, +cmsg_��s +, +��e_��s +, +exp�y_��rv� +); + +114 + `mosqu�to__� +( +m��d_t�ic +); + +115 +rc +; + +121 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "S�d�g PUBLISH��%�(d%d, q%d,�%d, m%d, '%s', ... (%ld by�s))", +mosq +-> +id +, +dup +, +qos +, +��� +, +mid +, +t�ic +, () +�yl�d�n +); + +122 + `G_PUB_BYTES_SENT_INC +( +�yl�d�n +); + +124 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Cl�� %��nd�g PUBLISH (d%d, q%d,�%d, m%d, '%s', ... (%ld by�s))", mosq-> +id +, +dup +, +qos +, +��� +, +mid +, +t�ic +, () +�yl�d�n +); + +127 + `�nd__��_publish +( +mosq +, +mid +, +t�ic +, +�yl�d�n +, +�yl�d +, +qos +, +��� +, +dup +, +cmsg_��s +, +��e_��s +, +exp�y_��rv� +); + +128 + } +} + +131 + $�nd__��_publish +( +mosqu�to + * +mosq +, +u�t16_t + +mid +, cڡ * +t�ic +, +u�t32_t + +�yl�d�n +, cڡ * +�yl�d +, +qos +, +bo� + +��� +, bo� +dup +, cڡ +mosqu�to_�ݔty + * +cmsg_��s +, cڡ mosqu�to_�ݔty * +��e_��s +, u�t32_� +exp�y_��rv� +) + +133 +mosqu�to__�ck� + * +�ck� + = +NULL +; + +134 +�ck��n +; + +135 +���n + = 0, +v�by�s +; + +136 +rc +; + +137 +mosqu�to_�ݔty + +exp�y_�� +; + +139 + `as�� +( +mosq +); + +141 if( +t�ic +){ + +142 +�ck��n + = 2+ + `��� +( +t�ic +�+ +�yl�d�n +; + +144 +�ck��n + = 2 + +�yl�d�n +; + +146 if( +qos + > 0� +�ck��n + += 2; + +147 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +148 +���n + = 0; + +149 +���n + +� + `�ݔty__g�_�ngth_�l +( +cmsg_��s +); + +150 +���n + +� + `�ݔty__g�_�ngth_�l +( +��e_��s +); + +151 if( +exp�y_��rv� + > 0){ + +152 +exp�y_�� +. +�xt + = +NULL +; + +153 +exp�y_�� +. +v�ue +. +i32 + = +exp�y_��rv� +; + +154 +exp�y_�� +. +id�tif�r + = +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +; + +155 +exp�y_�� +. +���_g���ed + = +�l� +; + +157 +���n + +� + `�ݔty__g�_�ngth_�l +(& +exp�y_�� +); + +160 +v�by�s + = + `�ck�__v��t_by�s +( +���n +); + +161 if( +v�by�s + > 4){ + +163 +cmsg_��s + = +NULL +; + +164 +��e_��s + = +NULL +; + +165 +exp�y_��rv� + = 0; + +167 +�ck��n + +� +���n + + +v�by�s +; + +170 if( + `�ck�__check_ov�size +( +mosq +, +�ck��n +)){ + +171 #ifde� +WITH_BROKER + + +172 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "Dr�p�g�o��rg�outgo�g PUBLISH f� %�(%d by�s)", +mosq +-> +id +, +�ck��n +); + +174 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "Dr�p�g�o��rg�outgo�g PUBLISH (%d by�s)", +�ck��n +); + +176 +MOSQ_ERR_OVERSIZE_PACKET +; + +179 +�ck� + = + `mosqu�to__��oc +(1, ( +mosqu�to__�ck� +)); + +180 if(! +�ck� +� +MOSQ_ERR_NOMEM +; + +182 +�ck� +-> +mid + = mid; + +183 +�ck� +-> +comm�d + = +CMD_PUBLISH + | (( +dup +&0x1)<<3�| ( +qos +<<1�| +��� +; + +184 +�ck� +-> +�ma��g_�ngth + = +�ck��n +; + +185 +rc + = + `�ck�__�loc +( +�ck� +); + +186 if( +rc +){ + +187 + `mosqu�to__� +( +�ck� +); + +188 +rc +; + +191 if( +t�ic +){ + +192 + `�ck�__wr�e_�r�g +( +�ck� +, +t�ic +, + `��� +(topic)); + +194 + `�ck�__wr�e_u�t16 +( +�ck� +, 0); + +196 if( +qos + > 0){ + +197 + `�ck�__wr�e_u�t16 +( +�ck� +, +mid +); + +200 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +201 + `�ck�__wr�e_v��t +( +�ck� +, +���n +); + +202 + `�ݔty__wr�e_�l +( +�ck� +, +cmsg_��s +, +�l� +); + +203 + `�ݔty__wr�e_�l +( +�ck� +, +��e_��s +, +�l� +); + +204 if( +exp�y_��rv� + > 0){ + +205 + `�ݔty__wr�e_�l +( +�ck� +, & +exp�y_�� +, +�l� +); + +210 if( +�yl�d�n +){ + +211 + `�ck�__wr�e_by�s +( +�ck� +, +�yl�d +, +�yl�d�n +); + +214 + `�ck�__queue +( +mosq +, +�ck� +); + +215 + } +} + + @lib/send_subscribe.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<�r�g.h +> + +22 #ifde� +WITH_BROKER + + +23 + ~"mosqu�to_brok�_����.h +" + +26 + ~"mosqu�to.h +" + +27 + ~"mosqu�to_����.h +" + +28 + ~"logg�g_mosq.h +" + +29 + ~"mem�y_mosq.h +" + +30 + ~"mq�_��oc�.h +" + +31 + ~"�ck�_mosq.h +" + +32 + ~"�ݔty_mosq.h +" + +33 + ~"ut�_mosq.h +" + +36 + $�nd__subs�ibe +( +mosqu�to + * +mosq +, * +mid +, +t�ic_cou� +, cڡ ** +t�ic +, +t�ic_qos +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +38 +mosqu�to__�ck� + * +�ck� + = +NULL +; + +39 +u�t32_t + +�ck��n +; + +40 +u�t16_t + +lo�l_mid +; + +41 +rc +; + +42 +i +; + +43 +���n +, +v�by�s +; + +45 + `as�� +( +mosq +); + +46 + `as�� +( +t�ic +); + +48 +�ck� + = + `mosqu�to__��oc +(1, ( +mosqu�to__�ck� +)); + +49 if(! +�ck� +� +MOSQ_ERR_NOMEM +; + +51 +�ck��n + = 2; + +52 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +53 +���n + = + `�ݔty__g�_�ngth_�l +( +�ݔt�s +); + +54 +v�by�s + = + `�ck�__v��t_by�s +( +���n +); + +55 +�ck��n + +� +���n + + +v�by�s +; + +57 +i +=0; i< +t�ic_cou� +; i++){ + +58 +�ck��n + +�2+ + `��� +( +t�ic +[ +i +]) + 1; + +61 +�ck� +-> +comm�d + = +CMD_SUBSCRIBE + | (1<<1); + +62 +�ck� +-> +�ma��g_�ngth + = +�ck��n +; + +63 +rc + = + `�ck�__�loc +( +�ck� +); + +64 if( +rc +){ + +65 + `mosqu�to__� +( +�ck� +); + +66 +rc +; + +70 +lo�l_mid + = + `mosqu�to__mid_g���e +( +mosq +); + +71 if( +mid +�*mid = () +lo�l_mid +; + +72 + `�ck�__wr�e_u�t16 +( +�ck� +, +lo�l_mid +); + +74 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +75 + `�ݔty__wr�e_�l +( +�ck� +, +�ݔt�s +, +�ue +); + +79 +i +=0; i< +t�ic_cou� +; i++){ + +80 + `�ck�__wr�e_�r�g +( +�ck� +, +t�ic +[ +i +], + `��� +(topic[i])); + +81 + `�ck�__wr�e_by� +( +�ck� +, +t�ic_qos +); + +84 #ifde� +WITH_BROKER + + +85 #ifde� +WITH_BRIDGE + + +86 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Bridg�%��nd�g SUBSCRIBE (Mid: %d, T�ic: %s, QoS: %d, O�i�s: 0x%02x)", mosq-> +id +, +lo�l_mid +, +t�ic +[0], +t�ic_qos +&0x03,�opic_qos&0xFC); + +89 +i +=0; i< +t�ic_cou� +; i++){ + +90 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Cl�� %��nd�g SUBSCRIBE (Mid: %d, T�ic: %s, QoS: %d, O�i�s: 0x%02x)", mosq-> +id +, +lo�l_mid +, +t�ic +[ +i +], +t�ic_qos +&0x03,�opic_qos&0xFC); + +94 + `�ck�__queue +( +mosq +, +�ck� +); + +95 + } +} + + @lib/send_unsubscribe.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<�r�g.h +> + +22 #ifde� +WITH_BROKER + + +23 + ~"mosqu�to_brok�_����.h +" + +26 + ~"mosqu�to.h +" + +27 + ~"logg�g_mosq.h +" + +28 + ~"mem�y_mosq.h +" + +29 + ~"mq�_��oc�.h +" + +30 + ~"�ck�_mosq.h +" + +31 + ~"�ݔty_mosq.h +" + +32 + ~"�nd_mosq.h +" + +33 + ~"ut�_mosq.h +" + +36 + $�nd__unsubs�ibe +( +mosqu�to + * +mosq +, * +mid +, +t�ic_cou� +, *cڡ *cڡ +t�ic +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +39 +mosqu�to__�ck� + * +�ck� + = +NULL +; + +40 +u�t32_t + +�ck��n +; + +41 +u�t16_t + +lo�l_mid +; + +42 +rc +; + +43 +���n +, +v�by�s +; + +44 +i +; + +46 + `as�� +( +mosq +); + +47 + `as�� +( +t�ic +); + +49 +�ck� + = + `mosqu�to__��oc +(1, ( +mosqu�to__�ck� +)); + +50 if(! +�ck� +� +MOSQ_ERR_NOMEM +; + +52 +�ck��n + = 2; + +54 +i +=0; i< +t�ic_cou� +; i++){ + +55 +�ck��n + +�2+ + `��� +( +t�ic +[ +i +]); + +57 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +58 +���n + = + `�ݔty__g�_�ngth_�l +( +�ݔt�s +); + +59 +v�by�s + = + `�ck�__v��t_by�s +( +���n +); + +60 +�ck��n + +� +���n + + +v�by�s +; + +63 +�ck� +-> +comm�d + = +CMD_UNSUBSCRIBE + | (1<<1); + +64 +�ck� +-> +�ma��g_�ngth + = +�ck��n +; + +65 +rc + = + `�ck�__�loc +( +�ck� +); + +66 if( +rc +){ + +67 + `mosqu�to__� +( +�ck� +); + +68 +rc +; + +72 +lo�l_mid + = + `mosqu�to__mid_g���e +( +mosq +); + +73 if( +mid +�*mid = () +lo�l_mid +; + +74 + `�ck�__wr�e_u�t16 +( +�ck� +, +lo�l_mid +); + +76 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +78 + `�ݔty__wr�e_�l +( +�ck� +, +�ݔt�s +, +�ue +); + +82 +i +=0; i< +t�ic_cou� +; i++){ + +83 + `�ck�__wr�e_�r�g +( +�ck� +, +t�ic +[ +i +], + `��� +(topic[i])); + +86 #ifde� +WITH_BROKER + + +87 #ifde� +WITH_BRIDGE + + +88 +i +=0; i< +t�ic_cou� +; i++){ + +89 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Bridg�%��nd�g UNSUBSCRIBE (Mid: %d, T�ic: %s)", mosq-> +id +, +lo�l_mid +, +t�ic +[ +i +]); + +93 +i +=0; i< +t�ic_cou� +; i++){ + +94 + `log__��tf +( +mosq +, +MOSQ_LOG_DEBUG +, "Cl�� %��nd�g UNSUBSCRIBE (Mid: %d, T�ic: %s)", mosq-> +id +, +lo�l_mid +, +t�ic +[ +i +]); + +97 + `�ck�__queue +( +mosq +, +�ck� +); + +98 + } +} + + @lib/socks_mosq.c + +17 + ~"c�fig.h +" + +19 + ~<��o.h +> + +20 + ~<�r�g.h +> + +21 + ~<lim�s.h +> + +22 #ifde� +WIN32 + + +23 + ~<ws2t��.h +> + +24 #�i� +__QNX__ + + +25 + ~<sys/sock�.h +> + +26 + ~<�t��/�.h +> + +28 + ~<��/��.h +> + +30 #ifde� +__F�eBSD__ + + +31 + ~<sys/sock�.h +> + +32 + ~<�t��/�.h +> + +35 + ~"mosqu�to_����.h +" + +36 + ~"mem�y_mosq.h +" + +37 + ~"�t_mosq.h +" + +38 + ~"�ck�_mosq.h +" + +39 + ~"�nd_mosq.h +" + +41 + #SOCKS_AUTH_NONE + 0x00 + + ) + +42 + #SOCKS_AUTH_GSS + 0x01 + + ) + +43 + #SOCKS_AUTH_USERPASS + 0x02 + + ) + +44 + #SOCKS_AUTH_NO_ACCEPTABLE + 0xFF + + ) + +46 + #SOCKS_ATYPE_IP_V4 + 1 + + ) + +47 + #SOCKS_ATYPE_DOMAINNAME + 3 + + ) + +48 + #SOCKS_ATYPE_IP_V6 + 4 + + ) + +50 + #SOCKS_REPLY_SUCCEEDED + 0x00 + + ) + +51 + #SOCKS_REPLY_GENERAL_FAILURE + 0x01 + + ) + +52 + #SOCKS_REPLY_CONNECTION_NOT_ALLOWED + 0x02 + + ) + +53 + #SOCKS_REPLY_NETWORK_UNREACHABLE + 0x03 + + ) + +54 + #SOCKS_REPLY_HOST_UNREACHABLE + 0x04 + + ) + +55 + #SOCKS_REPLY_CONNECTION_REFUSED + 0x05 + + ) + +56 + #SOCKS_REPLY_TTL_EXPIRED + 0x06 + + ) + +57 + #SOCKS_REPLY_COMMAND_NOT_SUPPORTED + 0x07 + + ) + +58 + #SOCKS_REPLY_ADDRESS_TYPE_NOT_SUPPORTED + 0x08 + + ) + +60 + $mosqu�to_socks5_�t +( +mosqu�to + * +mosq +, cڡ * +ho� +, +p�t +, cڡ * +u��ame +, cڡ * +�ssw�d +) + +62 #ifde� +WITH_SOCKS + + +63 if(! +mosq +� +MOSQ_ERR_INVAL +; + +64 if(! +ho� + || + `��� +(ho��> 256� +MOSQ_ERR_INVAL +; + +65 if( +p�t + < 1 ||�܈> 65535� +MOSQ_ERR_INVAL +; + +67 + `mosqu�to__� +( +mosq +-> +socks5_ho� +); + +68 +mosq +-> +socks5_ho� + = +NULL +; + +70 +mosq +-> +socks5_ho� + = + `mosqu�to__�rdup +( +ho� +); + +71 if(! +mosq +-> +socks5_ho� +){ + +72 +MOSQ_ERR_NOMEM +; + +75 +mosq +-> +socks5_p�t + = +p�t +; + +77 + `mosqu�to__� +( +mosq +-> +socks5_u��ame +); + +78 +mosq +-> +socks5_u��ame + = +NULL +; + +80 + `mosqu�to__� +( +mosq +-> +socks5_�ssw�d +); + +81 +mosq +-> +socks5_�ssw�d + = +NULL +; + +83 if( +u��ame +){ + +84 +mosq +-> +socks5_u��ame + = + `mosqu�to__�rdup +( +u��ame +); + +85 if(! +mosq +-> +socks5_u��ame +){ + +86 +MOSQ_ERR_NOMEM +; + +89 if( +�ssw�d +){ + +90 +mosq +-> +socks5_�ssw�d + = + `mosqu�to__�rdup +( +�ssw�d +); + +91 if(! +mosq +-> +socks5_�ssw�d +){ + +92 + `mosqu�to__� +( +mosq +-> +socks5_u��ame +); + +93 +MOSQ_ERR_NOMEM +; + +98 +MOSQ_ERR_SUCCESS +; + +100 +MOSQ_ERR_NOT_SUPPORTED +; + +102 + } +} + +104 #ifde� +WITH_SOCKS + + +105 + $socks5__�nd +( +mosqu�to + * +mosq +) + +107 +mosqu�to__�ck� + * +�ck� +; + +108 +�� +; + +109 +u�n +, +�� +; + +111 +�_addr + +addr_�v4 +; + +112 +�6_addr + +addr_�v6 +; + +113 +�v4_��_�su� +; + +114 +�v6_��_�su� +; + +116 if( +mosq +-> +��e + =� +mosq_cs_socks5_�w +){ + +117 +�ck� + = + `mosqu�to__��oc +(1, ( +mosqu�to__�ck� +)); + +118 if(! +�ck� +� +MOSQ_ERR_NOMEM +; + +120 if( +mosq +-> +socks5_u��ame +){ + +121 +�ck� +-> +�ck�_�ngth + = 4; + +123 +�ck� +-> +�ck�_�ngth + = 3; + +125 +�ck� +-> +�yl�d + = + `mosqu�to__m�loc +(( +u�t8_t +)*�ck�-> +�ck�_�ngth +); + +127 +�ck� +-> +�yl�d +[0] = 0x05; + +128 if( +mosq +-> +socks5_u��ame +){ + +129 +�ck� +-> +�yl�d +[1] = 2; + +130 +�ck� +-> +�yl�d +[2] = +SOCKS_AUTH_NONE +; + +131 +�ck� +-> +�yl�d +[3] = +SOCKS_AUTH_USERPASS +; + +133 +�ck� +-> +�yl�d +[1] = 1; + +134 +�ck� +-> +�yl�d +[2] = +SOCKS_AUTH_NONE +; + +137 + `�h�ad_mu�x_lock +(& +mosq +-> +��e_mu�x +); + +138 +mosq +-> +��e + = +mosq_cs_socks5_��t +; + +139 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��e_mu�x +); + +141 +mosq +-> +�_�ck� +. +pos + = 0; + +142 +mosq +-> +�_�ck� +. +�ck�_�ngth + = 2; + +143 +mosq +-> +�_�ck� +. +to_�o�ss + = 2; + +144 +mosq +-> +�_�ck� +. +�yl�d + = + `mosqu�to__m�loc +(( +u�t8_t +)*2); + +145 if(! +mosq +-> +�_�ck� +. +�yl�d +){ + +146 + `mosqu�to__� +( +�ck� +-> +�yl�d +); + +147 + `mosqu�to__� +( +�ck� +); + +148 +MOSQ_ERR_NOMEM +; + +151 + `�ck�__queue +( +mosq +, +�ck� +); + +152 }if( +mosq +-> +��e + =� +mosq_cs_socks5_auth_ok +){ + +153 +�ck� + = + `mosqu�to__��oc +(1, ( +mosqu�to__�ck� +)); + +154 if(! +�ck� +� +MOSQ_ERR_NOMEM +; + +156 +�v4_��_�su� + = + `��_�� +( +AF_INET +, +mosq +-> +ho� +, & +addr_�v4 +); + +157 +�v6_��_�su� + = + `��_�� +( +AF_INET6 +, +mosq +-> +ho� +, & +addr_�v6 +); + +159 if( +�v4_��_�su� + == 1){ + +160 +�ck� +-> +�ck�_�ngth + = 10; + +161 +�ck� +-> +�yl�d + = + `mosqu�to__m�loc +(( +u�t8_t +)*�ck�-> +�ck�_�ngth +); + +162 if(! +�ck� +-> +�yl�d +){ + +163 + `mosqu�to__� +( +�ck� +); + +164 +MOSQ_ERR_NOMEM +; + +166 +�ck� +-> +�yl�d +[3] = +SOCKS_ATYPE_IP_V4 +; + +167 + `mem�y +(&( +�ck� +-> +�yl�d +[4]), (cڡ *)& +addr_�v4 +, 4); + +168 +�ck� +-> +�yl�d +[4+4] = + `MOSQ_MSB +( +mosq +-> +p�t +); + +169 +�ck� +-> +�yl�d +[4+4+1] = + `MOSQ_LSB +( +mosq +-> +p�t +); + +171 }if( +�v6_��_�su� + == 1){ + +172 +�ck� +-> +�ck�_�ngth + = 22; + +173 +�ck� +-> +�yl�d + = + `mosqu�to__m�loc +(( +u�t8_t +)*�ck�-> +�ck�_�ngth +); + +174 if(! +�ck� +-> +�yl�d +){ + +175 + `mosqu�to__� +( +�ck� +); + +176 +MOSQ_ERR_NOMEM +; + +178 +�ck� +-> +�yl�d +[3] = +SOCKS_ATYPE_IP_V6 +; + +179 + `mem�y +(&( +�ck� +-> +�yl�d +[4]), (cڡ *)& +addr_�v6 +, 16); + +180 +�ck� +-> +�yl�d +[4+16] = + `MOSQ_MSB +( +mosq +-> +p�t +); + +181 +�ck� +-> +�yl�d +[4+16+1] = + `MOSQ_LSB +( +mosq +-> +p�t +); + +184 +�� + = + `��� +( +mosq +-> +ho� +); + +185 if( +�� + > +UCHAR_MAX +){ + +186 +MOSQ_ERR_NOMEM +; + +188 +�ck� +-> +�ck�_�ngth + = 7 + +�� +; + +189 +�ck� +-> +�yl�d + = + `mosqu�to__m�loc +(( +u�t8_t +)*�ck�-> +�ck�_�ngth +); + +190 if(! +�ck� +-> +�yl�d +){ + +191 + `mosqu�to__� +( +�ck� +); + +192 +MOSQ_ERR_NOMEM +; + +194 +�ck� +-> +�yl�d +[3] = +SOCKS_ATYPE_DOMAINNAME +; + +195 +�ck� +-> +�yl�d +[4] = ( +u�t8_t +) +�� +; + +196 + `mem�y +(&( +�ck� +-> +�yl�d +[5]), +mosq +-> +ho� +, +�� +); + +197 +�ck� +-> +�yl�d +[5+ +�� +] = + `MOSQ_MSB +( +mosq +-> +p�t +); + +198 +�ck� +-> +�yl�d +[6+ +�� +] = + `MOSQ_LSB +( +mosq +-> +p�t +); + +200 +�ck� +-> +�yl�d +[0] = 0x05; + +201 +�ck� +-> +�yl�d +[1] = 0x01; + +202 +�ck� +-> +�yl�d +[2] = 0x00; + +204 + `�h�ad_mu�x_lock +(& +mosq +-> +��e_mu�x +); + +205 +mosq +-> +��e + = +mosq_cs_socks5_�que� +; + +206 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��e_mu�x +); + +208 +mosq +-> +�_�ck� +. +pos + = 0; + +209 +mosq +-> +�_�ck� +. +�ck�_�ngth + = 5; + +210 +mosq +-> +�_�ck� +. +to_�o�ss + = 5; + +211 +mosq +-> +�_�ck� +. +�yl�d + = + `mosqu�to__m�loc +(( +u�t8_t +)*5); + +212 if(! +mosq +-> +�_�ck� +. +�yl�d +){ + +213 + `mosqu�to__� +( +�ck� +-> +�yl�d +); + +214 + `mosqu�to__� +( +�ck� +); + +215 +MOSQ_ERR_NOMEM +; + +218 + `�ck�__queue +( +mosq +, +�ck� +); + +219 }if( +mosq +-> +��e + =� +mosq_cs_socks5_�nd_u��ass +){ + +220 +�ck� + = + `mosqu�to__��oc +(1, ( +mosqu�to__�ck� +)); + +221 if(! +�ck� +� +MOSQ_ERR_NOMEM +; + +223 +u�n + = + `��� +( +mosq +-> +socks5_u��ame +); + +224 +�� + = + `��� +( +mosq +-> +socks5_�ssw�d +); + +225 +�ck� +-> +�ck�_�ngth + = 3 + +u�n + + +�� +; + +226 +�ck� +-> +�yl�d + = + `mosqu�to__m�loc +(( +u�t8_t +)*�ck�-> +�ck�_�ngth +); + +229 +�ck� +-> +�yl�d +[0] = 0x01; + +230 +�ck� +-> +�yl�d +[1] = +u�n +; + +231 + `mem�y +(&( +�ck� +-> +�yl�d +[2]), +mosq +-> +socks5_u��ame +, +u�n +); + +232 +�ck� +-> +�yl�d +[2+ +u�n +] = +�� +; + +233 + `mem�y +(&( +�ck� +-> +�yl�d +[3+ +u�n +]), +mosq +-> +socks5_�ssw�d +, +�� +); + +235 + `�h�ad_mu�x_lock +(& +mosq +-> +��e_mu�x +); + +236 +mosq +-> +��e + = +mosq_cs_socks5_u��ass_��y +; + +237 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��e_mu�x +); + +239 +mosq +-> +�_�ck� +. +pos + = 0; + +240 +mosq +-> +�_�ck� +. +�ck�_�ngth + = 2; + +241 +mosq +-> +�_�ck� +. +to_�o�ss + = 2; + +242 +mosq +-> +�_�ck� +. +�yl�d + = + `mosqu�to__m�loc +(( +u�t8_t +)*2); + +243 if(! +mosq +-> +�_�ck� +. +�yl�d +){ + +244 + `mosqu�to__� +( +�ck� +-> +�yl�d +); + +245 + `mosqu�to__� +( +�ck� +); + +246 +MOSQ_ERR_NOMEM +; + +249 + `�ck�__queue +( +mosq +, +�ck� +); + +251 +MOSQ_ERR_SUCCESS +; + +252 + } +} + +254 + $socks5__�ad +( +mosqu�to + * +mosq +) + +256 +ssize_t + +�n +; + +257 +u�t8_t + * +�yl�d +; + +258 +u�t8_t + +i +; + +260 if( +mosq +-> +��e + =� +mosq_cs_socks5_��t +){ + +261 +mosq +-> +�_�ck� +. +to_�o�ss + > 0){ + +262 +�n + = + `�t__�ad +( +mosq +, &(mosq-> +�_�ck� +. +�yl�d +[mosq->�_�ck�. +pos +]), mosq->�_�ck�. +to_�o�ss +); + +263 if( +�n + > 0){ + +264 +mosq +-> +�_�ck� +. +pos + +� +�n +; + +265 +mosq +-> +�_�ck� +. +to_�o�ss + -� +�n +; + +267 #ifde� +WIN32 + + +268 +��o + = + `WSAG�La�E�� +(); + +270 if( +��o + =� +EAGAIN + ||��n�=� +COMPAT_EWOULDBLOCK +){ + +271 +MOSQ_ERR_SUCCESS +; + +273 + `�ck�__��nup +(& +mosq +-> +�_�ck� +); + +274 +��o +){ + +276 +MOSQ_ERR_PROXY +; + +277 +COMPAT_ECONNRESET +: + +278 +MOSQ_ERR_CONN_LOST +; + +280 +MOSQ_ERR_ERRNO +; + +285 if( +mosq +-> +�_�ck� +. +�yl�d +[0] != 5){ + +286 + `�ck�__��nup +(& +mosq +-> +�_�ck� +); + +287 +MOSQ_ERR_PROXY +; + +289 +mosq +-> +�_�ck� +. +�yl�d +[1]){ + +290 +SOCKS_AUTH_NONE +: + +291 + `�ck�__��nup +(& +mosq +-> +�_�ck� +); + +292 +mosq +-> +��e + = +mosq_cs_socks5_auth_ok +; + +293 + `socks5__�nd +( +mosq +); + +294 +SOCKS_AUTH_USERPASS +: + +295 + `�ck�__��nup +(& +mosq +-> +�_�ck� +); + +296 +mosq +-> +��e + = +mosq_cs_socks5_�nd_u��ass +; + +297 + `socks5__�nd +( +mosq +); + +299 + `�ck�__��nup +(& +mosq +-> +�_�ck� +); + +300 +MOSQ_ERR_AUTH +; + +302 }if( +mosq +-> +��e + =� +mosq_cs_socks5_u��ass_��y +){ + +303 +mosq +-> +�_�ck� +. +to_�o�ss + > 0){ + +304 +�n + = + `�t__�ad +( +mosq +, &(mosq-> +�_�ck� +. +�yl�d +[mosq->�_�ck�. +pos +]), mosq->�_�ck�. +to_�o�ss +); + +305 if( +�n + > 0){ + +306 +mosq +-> +�_�ck� +. +pos + +� +�n +; + +307 +mosq +-> +�_�ck� +. +to_�o�ss + -� +�n +; + +309 #ifde� +WIN32 + + +310 +��o + = + `WSAG�La�E�� +(); + +312 if( +��o + =� +EAGAIN + ||��n�=� +COMPAT_EWOULDBLOCK +){ + +313 +MOSQ_ERR_SUCCESS +; + +315 + `�ck�__��nup +(& +mosq +-> +�_�ck� +); + +316 +��o +){ + +318 +MOSQ_ERR_PROXY +; + +319 +COMPAT_ECONNRESET +: + +320 +MOSQ_ERR_CONN_LOST +; + +322 +MOSQ_ERR_ERRNO +; + +327 if( +mosq +-> +�_�ck� +. +�yl�d +[0] != 1){ + +328 + `�ck�__��nup +(& +mosq +-> +�_�ck� +); + +329 +MOSQ_ERR_PROXY +; + +331 if( +mosq +-> +�_�ck� +. +�yl�d +[1] == 0){ + +332 + `�ck�__��nup +(& +mosq +-> +�_�ck� +); + +333 +mosq +-> +��e + = +mosq_cs_socks5_auth_ok +; + +334 + `socks5__�nd +( +mosq +); + +336 +i + = +mosq +-> +�_�ck� +. +�yl�d +[1]; + +337 + `�ck�__��nup +(& +mosq +-> +�_�ck� +); + +338 +i +){ + +339 +SOCKS_REPLY_CONNECTION_NOT_ALLOWED +: + +340 +MOSQ_ERR_AUTH +; + +342 +SOCKS_REPLY_NETWORK_UNREACHABLE +: + +343 +SOCKS_REPLY_HOST_UNREACHABLE +: + +344 +SOCKS_REPLY_CONNECTION_REFUSED +: + +345 +MOSQ_ERR_NO_CONN +; + +347 +SOCKS_REPLY_GENERAL_FAILURE +: + +348 +SOCKS_REPLY_TTL_EXPIRED +: + +349 +SOCKS_REPLY_COMMAND_NOT_SUPPORTED +: + +350 +SOCKS_REPLY_ADDRESS_TYPE_NOT_SUPPORTED +: + +351 +MOSQ_ERR_PROXY +; + +354 +MOSQ_ERR_INVAL +; + +356 +MOSQ_ERR_PROXY +; + +358 }if( +mosq +-> +��e + =� +mosq_cs_socks5_�que� +){ + +359 +mosq +-> +�_�ck� +. +to_�o�ss + > 0){ + +360 +�n + = + `�t__�ad +( +mosq +, &(mosq-> +�_�ck� +. +�yl�d +[mosq->�_�ck�. +pos +]), mosq->�_�ck�. +to_�o�ss +); + +361 if( +�n + > 0){ + +362 +mosq +-> +�_�ck� +. +pos + +� +�n +; + +363 +mosq +-> +�_�ck� +. +to_�o�ss + -� +�n +; + +365 #ifde� +WIN32 + + +366 +��o + = + `WSAG�La�E�� +(); + +368 if( +��o + =� +EAGAIN + ||��n�=� +COMPAT_EWOULDBLOCK +){ + +369 +MOSQ_ERR_SUCCESS +; + +371 + `�ck�__��nup +(& +mosq +-> +�_�ck� +); + +372 +��o +){ + +374 +MOSQ_ERR_PROXY +; + +375 +COMPAT_ECONNRESET +: + +376 +MOSQ_ERR_CONN_LOST +; + +378 +MOSQ_ERR_ERRNO +; + +384 if( +mosq +-> +�_�ck� +. +�ck�_�ngth + == 5){ + +386 if( +mosq +-> +�_�ck� +. +�yl�d +[3] =� +SOCKS_ATYPE_IP_V4 +){ + +387 +mosq +-> +�_�ck� +. +to_�o�ss + += 4+2-1; + +388 +mosq +-> +�_�ck� +. +�ck�_�ngth + += 4+2-1; + +389 }if( +mosq +-> +�_�ck� +. +�yl�d +[3] =� +SOCKS_ATYPE_IP_V6 +){ + +390 +mosq +-> +�_�ck� +. +to_�o�ss + += 16+2-1; + +391 +mosq +-> +�_�ck� +. +�ck�_�ngth + += 16+2-1; + +392 }if( +mosq +-> +�_�ck� +. +�yl�d +[3] =� +SOCKS_ATYPE_DOMAINNAME +){ + +393 if( +mosq +-> +�_�ck� +. +�yl�d +[4] > 0){ + +394 +mosq +-> +�_�ck� +. +to_�o�ss + +�mosq->�_�ck�. +�yl�d +[4]; + +395 +mosq +-> +�_�ck� +. +�ck�_�ngth + +�mosq->�_�ck�. +�yl�d +[4]; + +398 + `�ck�__��nup +(& +mosq +-> +�_�ck� +); + +399 +MOSQ_ERR_PROTOCOL +; + +401 +�yl�d + = + `mosqu�to__��loc +( +mosq +-> +�_�ck� +.�yl�d, mosq->�_�ck�. +�ck�_�ngth +); + +402 if( +�yl�d +){ + +403 +mosq +-> +�_�ck� +. +�yl�d + =�ayload; + +405 + `�ck�__��nup +(& +mosq +-> +�_�ck� +); + +406 +MOSQ_ERR_NOMEM +; + +408 +�yl�d + = + `mosqu�to__��loc +( +mosq +-> +�_�ck� +.�yl�d, mosq->�_�ck�. +�ck�_�ngth +); + +409 if( +�yl�d +){ + +410 +mosq +-> +�_�ck� +. +�yl�d + =�ayload; + +412 + `�ck�__��nup +(& +mosq +-> +�_�ck� +); + +413 +MOSQ_ERR_NOMEM +; + +415 +MOSQ_ERR_SUCCESS +; + +419 if( +mosq +-> +�_�ck� +. +�yl�d +[0] != 5){ + +420 + `�ck�__��nup +(& +mosq +-> +�_�ck� +); + +421 +MOSQ_ERR_PROXY +; + +423 if( +mosq +-> +�_�ck� +. +�yl�d +[1] == 0){ + +425 + `�ck�__��nup +(& +mosq +-> +�_�ck� +); + +426 +mosq +-> +��e + = +mosq_cs_�w +; + +427 if( +mosq +-> +socks5_ho� +){ + +428 +rc + = + `�t__sock�_c���_��3 +( +mosq +, mosq-> +ho� +); + +429 if( +rc +) �c; + +431 + `�nd__c��� +( +mosq +, mosq-> +k��live +, mosq-> +��n_��t +, +NULL +); + +433 +i + = +mosq +-> +�_�ck� +. +�yl�d +[1]; + +434 + `�ck�__��nup +(& +mosq +-> +�_�ck� +); + +435 +mosq +-> +��e + = +mosq_cs_socks5_�w +; + +436 +i +){ + +437 +SOCKS_REPLY_CONNECTION_NOT_ALLOWED +: + +438 +MOSQ_ERR_AUTH +; + +440 +SOCKS_REPLY_NETWORK_UNREACHABLE +: + +441 +SOCKS_REPLY_HOST_UNREACHABLE +: + +442 +SOCKS_REPLY_CONNECTION_REFUSED +: + +443 +MOSQ_ERR_NO_CONN +; + +445 +SOCKS_REPLY_GENERAL_FAILURE +: + +446 +SOCKS_REPLY_TTL_EXPIRED +: + +447 +SOCKS_REPLY_COMMAND_NOT_SUPPORTED +: + +448 +SOCKS_REPLY_ADDRESS_TYPE_NOT_SUPPORTED +: + +449 +MOSQ_ERR_PROXY +; + +452 +MOSQ_ERR_INVAL +; + +456 + `�ck�__�ad +( +mosq +); + +458 +MOSQ_ERR_SUCCESS +; + +459 + } +} + + @lib/socks_mosq.h + +17 #i�de� +SOCKS_MOSQ_H + + +18 + #SOCKS_MOSQ_H + + + ) + +20 +socks5__�nd +( +mosqu�to + * +mosq +); + +21 +socks5__�ad +( +mosqu�to + * +mosq +); + + @lib/srv_mosq.c + +17 + ~"c�fig.h +" + +19 #ifde� +WITH_SRV + + +20 + ~<�es.h +> + +22 + ~<��/�me�r.h +> + +23 + ~<�dio.h +> + +24 + ~<�r�g.h +> + +27 + ~"logg�g_mosq.h +" + +28 + ~"mem�y_mosq.h +" + +29 + ~"mosqu�to_����.h +" + +30 + ~"mosqu�to.h +" + +32 #ifde� +WITH_SRV + + +33 + $�v_��back +(* +�g +, +��us +, +timeouts +, * +abuf +, +�� +) + +35 +mosqu�to + * +mosq + = +�g +; + +36 +�es_�v_��y + * +��y + = +NULL +; + +37 if( +��us + =� +ARES_SUCCESS +){ + +38 +��us + = + `�es_�r�_�v_��y +( +abuf +, +�� +, & +��y +); + +39 if( +��us + =� +ARES_SUCCESS +){ + +41 + `mosqu�to_c��� +( +mosq +, +��y +-> +ho� +,��ly-> +p�t +, mosq-> +k��live +); + +44 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "E��: SRV�ooku��ed (%d).", +��us +); + +46 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +47 if( +mosq +-> +�_disc��� +){ + +48 +mosq +-> +�_��back + = +�ue +; + +49 +mosq +-> + `�_disc��� +(mosq, mosq-> +u�rd�a +, +MOSQ_ERR_LOOKUP +); + +50 +mosq +-> +�_��back + = +�l� +; + +52 if( +mosq +-> +�_disc���_v5 +){ + +53 +mosq +-> +�_��back + = +�ue +; + +54 +mosq +-> + `�_disc���_v5 +(mosq, mosq-> +u�rd�a +, +MOSQ_ERR_LOOKUP +, +NULL +); + +55 +mosq +-> +�_��back + = +�l� +; + +57 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +59 + } +} + +62 + $mosqu�to_c���_�v +( +mosqu�to + * +mosq +, cڡ * +ho� +, +k��live +, cڡ * +b�d_add�ss +) + +64 #ifde� +WITH_SRV + + +65 * +h +; + +66 +rc +; + +67 if(! +mosq +� +MOSQ_ERR_INVAL +; + +69 +rc + = + `�es_�� +(& +mosq +-> +ach� +); + +70 if( +rc + !� +ARES_SUCCESS +){ + +71 +MOSQ_ERR_UNKNOWN +; + +74 if(! +ho� +){ + +77 #ifde� +WITH_TLS + + +78 if( +mosq +-> +�s_�f�e + || mosq-> +�s_��th + || mosq-> +�s_psk +){ + +79 +h + = + `mosqu�to__m�loc +( + `��� +( +ho� +) + strlen("_secure-mqtt._tcp.") + 1); + +80 if(! +h +� +MOSQ_ERR_NOMEM +; + +81 + `�r�tf +( +h +, "_�cu�-mq�._t�.%s", +ho� +); + +84 +h + = + `mosqu�to__m�loc +( + `��� +( +ho� +) + strlen("_mqtt._tcp.") + 1); + +85 if(! +h +� +MOSQ_ERR_NOMEM +; + +86 + `�r�tf +( +h +, "_mq�._t�.%s", +ho� +); + +87 #ifde� +WITH_TLS + + +90 + `�es_��ch +( +mosq +-> +ach� +, +h +, +ns_c_� +, +ns_t_�v +, +�v_��back +, mosq); + +91 + `mosqu�to__� +( +h +); + +94 + `�h�ad_mu�x_lock +(& +mosq +-> +��e_mu�x +); + +95 +mosq +-> +��e + = +mosq_cs_c���_�v +; + +96 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��e_mu�x +); + +98 +mosq +-> +k��live + = keepalive; + +100 +MOSQ_ERR_SUCCESS +; + +103 + `UNUSED +( +mosq +); + +104 + `UNUSED +( +ho� +); + +105 + `UNUSED +( +k��live +); + +106 + `UNUSED +( +b�d_add�ss +); + +108 +MOSQ_ERR_NOT_SUPPORTED +; + +110 + } +} + + @lib/thread_mosq.c + +17 + ~"c�fig.h +" + +19 #i�de� +WIN32 + + +20 + ~<time.h +> + +23 + ~"mosqu�to_����.h +" + +24 + ~"�t_mosq.h +" + +26 * +mosqu�to__th�ad_ma� +(* +obj +); + +28 + $mosqu�to_lo�_��t +( +mosqu�to + * +mosq +) + +30 #i� + `def�ed +( +WITH_THREADING +�&& def�ed( +HAVE_PTHREAD_CANCEL +) + +31 if(! +mosq + || mosq-> +th�aded + !� +mosq_ts_n�e +� +MOSQ_ERR_INVAL +; + +33 +mosq +-> +th�aded + = +mosq_ts_�lf +; + +34 if(! + `�h�ad_��� +(& +mosq +-> +th�ad_id +, +NULL +, +mosqu�to__th�ad_ma� +, mosq)){ + +35 +MOSQ_ERR_SUCCESS +; + +37 +MOSQ_ERR_ERRNO +; + +40 +MOSQ_ERR_NOT_SUPPORTED +; + +42 + } +} + +44 + $mosqu�to_lo�_�� +( +mosqu�to + * +mosq +, +bo� + +f�� +) + +46 #i� + `def�ed +( +WITH_THREADING +�&& def�ed( +HAVE_PTHREAD_CANCEL +) + +47 #i�de� +WITH_BROKER + + +48 +sock��_d�a + = 0; + +51 if(! +mosq + || mosq-> +th�aded + !� +mosq_ts_�lf +� +MOSQ_ERR_INVAL +; + +56 if( +mosq +-> +sock��W + !� +INVALID_SOCKET +){ + +57 #i�de� +WIN32 + + +58 if( + `wr�e +( +mosq +-> +sock��W +, & +sock��_d�a +, 1)){ + +61 + `�nd +( +mosq +-> +sock��W +, & +sock��_d�a +, 1, 0); + +65 if( +f�� +){ + +66 + `�h�ad_�n�l +( +mosq +-> +th�ad_id +); + +68 + `�h�ad_jo� +( +mosq +-> +th�ad_id +, +NULL +); + +69 +mosq +-> +th�ad_id + = + `�h�ad_�lf +(); + +70 +mosq +-> +th�aded + = +mosq_ts_n�e +; + +72 +MOSQ_ERR_SUCCESS +; + +74 +MOSQ_ERR_NOT_SUPPORTED +; + +76 + } +} + +78 #ifde� +WITH_THREADING + + +79 * + $mosqu�to__th�ad_ma� +(* +obj +) + +81 +mosqu�to + * +mosq + = +obj +; + +82 +��e +; + +83 #i�de� +WIN32 + + +84 +time�ec + +ts +; + +85 +ts +. +tv_�c + = 0; + +86 +ts +. +tv_n�c + = 10000000; + +89 if(! +mosq +� +NULL +; + +92 + `�h�ad_mu�x_lock +(& +mosq +-> +��e_mu�x +); + +93 +��e + = +mosq +->state; + +94 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��e_mu�x +); + +95 if( +��e + =� +mosq_cs_�w +){ + +96 #ifde� +WIN32 + + +97 + `S˕ +(10); + +99 + `�no��p +(& +ts +, +NULL +); + +106 if( +��e + =� +mosq_cs_c���_async +){ + +107 + `mosqu�to_�c��� +( +mosq +); + +110 if(! +mosq +-> +k��live +){ + +112 + `mosqu�to_lo�_f�ev� +( +mosq +, 1000*86400, 1); + +115 + `mosqu�to_lo�_f�ev� +( +mosq +, mosq-> +k��live +*1000, 1); + +118 +obj +; + +119 + } +} + +122 + $mosqu�to_th�aded_�t +( +mosqu�to + * +mosq +, +bo� + +th�aded +) + +124 if(! +mosq +� +MOSQ_ERR_INVAL +; + +126 if( +th�aded +){ + +127 +mosq +-> +th�aded + = +mosq_ts_ex��� +; + +129 +mosq +-> +th�aded + = +mosq_ts_n�e +; + +132 +MOSQ_ERR_SUCCESS +; + +133 + } +} + + @lib/time_mosq.c + +17 + ~"c�fig.h +" + +19 #ifde� +__APPLE__ + + +20 + ~<mach/mach.h +> + +21 + ~<mach/mach_time.h +> + +24 #ifde� +WIN32 + + +25 + #_WIN32_WINNT + +_WIN32_WINNT_VISTA + + + ) + +26 + ~<w�dows.h +> + +28 + ~<uni�d.h +> + +30 + ~<time.h +> + +32 + ~"mosqu�to.h +" + +33 + ~"time_mosq.h +" + +35 +time_t + + $mosqu�to_time +() + +37 #ifde� +WIN32 + + +38 + `G�TickCou�64 +()/1000; + +39 #�i� +_POSIX_TIMERS +>0 && + `def�ed +( +_POSIX_MONOTONIC_CLOCK +) + +40 +time�ec + +� +; + +42 + `�ock_g�time +( +CLOCK_MONOTONIC +, & +� +); + +43 +� +. +tv_�c +; + +44 #�i� + `def�ed +( +__APPLE__ +) + +45 +mach_timeba�_�fo_d�a_t + +tb +; + +46 +u�t64_t + +ticks +; + +47 +u�t64_t + +�c +; + +49 +ticks + = + `mach_abs�u�_time +(); + +51 if( +tb +. +d�om + == 0){ + +52 + `mach_timeba�_�fo +(& +tb +); + +54 +�c + = +ticks +* +tb +. +num� +/tb. +d�om +/1000000000; + +56 ( +time_t +) +�c +; + +58 + `time +( +NULL +); + +60 + } +} + + @lib/time_mosq.h + +17 #i�de� +TIME_MOSQ_H + + +18 + #TIME_MOSQ_H + + + ) + +20 +time_t + +mosqu�to_time +(); + + @lib/tls_mosq.c + +17 #ifde� +WITH_TLS + + +19 + ~"c�fig.h +" + +21 #ifde� +WIN32 + + +22 + ~<w�sock2.h +> + +23 + ~<ws2t��.h +> + +25 + ~<��/��.h +> + +26 + ~<sys/sock�.h +> + +27 + ~<�r�gs.h +> + +30 + ~<�r�g.h +> + +31 + ~<ݒs�/c�f.h +> + +32 + ~<ݒs�/x509v3.h +> + +33 + ~<ݒs�/s�.h +> + +35 #ifde� +WITH_BROKER + + +36 + ~"mosqu�to_brok�_����.h +" + +38 + ~"mosqu�to_����.h +" + +39 + ~"logg�g_mosq.h +" + +40 + ~"�s_mosq.h +" + +42 +�s_ex_�dex_mosq +; + +44 + $mosqu�to__�rv�_��ifi��_v�ify +( +�ev�ify_ok +, +X509_STORE_CTX + * +�x +) + +48 +mosqu�to + * +mosq +; + +49 +SSL + * +s� +; + +50 +X509 + * +�� +; + +53 if(! +�ev�ify_ok +) 0; + +55 +s� + = + `X509_STORE_CTX_g�_ex_d�a +( +�x +, + `SSL_g�_ex_d�a_X509_STORE_CTX_idx +()); + +56 +mosq + = + `SSL_g�_ex_d�a +( +s� +, +�s_ex_�dex_mosq +); + +57 if(! +mosq +) 0; + +59 if( +mosq +-> +�s_��cu� + =� +�l� +){ + +60 if( + `X509_STORE_CTX_g�_�r�_d�th +( +�x +) == 0){ + +62 +�� + = + `X509_STORE_CTX_g�_cu��t_�� +( +�x +); + +64 #i� + `def�ed +( +WITH_BROKER +) + +65 +�ev�ify_ok + = + `mosqu�to__v�ify_��ifi��_ho��me +( +�� +, +mosq +-> +bridge +-> +add�s�s +[mosq->bridge-> +cur_add�ss +]. +add�ss +); + +67 +�ev�ify_ok + = + `mosqu�to__v�ify_��ifi��_ho��me +( +�� +, +mosq +-> +ho� +); + +69 i�( +�ev�ify_ok + != 1) { + +70 + `log__��tf +( +mosq +, +MOSQ_LOG_ERR +, "Error: host�ame verification failed."); + +72 +�ev�ify_ok +; + +74 +�ev�ify_ok +; + +77 +�ev�ify_ok +; + +79 + } +} + +81 + $mosqu�to__cmp_ho��me_w�d�rd +(* +���me +, cڡ * +ho��me +) + +83 +i +; + +84 +�n +; + +86 if(! +���me + || ! +ho��me +){ + +90 if( +���me +[0] == '*'){ + +91 if( +���me +[1] != '.'){ + +94 +���me + += 2; + +95 +�n + = + `��� +( +ho��me +); + +96 +i +=0; i< +�n +-1; i++){ + +97 if( +ho��me +[ +i +] == '.'){ + +98 +ho��me + +� +i ++1; + +102 + `�r��cmp +( +���me +, +ho��me +); + +104 + `�r��cmp +( +���me +, +ho��me +); + +106 + } +} + +111 + $mosqu�to__v�ify_��ifi��_ho��me +( +X509 + * +�� +, cڡ * +ho��me +) + +113 +i +; + +114 +�me +[256]; + +115 +X509_NAME + * +subj +; + +116 +bo� + +have_�n_dns + = +�l� +; + +117 + `STACK_OF +( +GENERAL_NAME +�* +�n +; + +118 cڡ +GENERAL_NAME + * +nv� +; + +119 cڡ * +d�a +; + +120 +�v6_addr +[16]; + +121 +�v4_addr +[4]; + +122 +�v6_ok +; + +123 +�v4_ok +; + +125 #ifde� +WIN32 + + +126 +�v6_ok + = + `I�tPt� +( +AF_INET6 +, +ho��me +, & +�v6_addr +); + +127 +�v4_ok + = + `I�tPt� +( +AF_INET +, +ho��me +, & +�v4_addr +); + +129 +�v6_ok + = + `��_�� +( +AF_INET6 +, +ho��me +, & +�v6_addr +); + +130 +�v4_ok + = + `��_�� +( +AF_INET +, +ho��me +, & +�v4_addr +); + +133 +�n + = + `X509_g�_ext_d2i +( +�� +, +NID_subje�_�t_�me +, +NULL +, NULL); + +134 if( +�n +){ + +135 +i +=0; i< + `sk_GENERAL_NAME_num +( +�n +); i++){ + +136 +nv� + = + `sk_GENERAL_NAME_v�ue +( +�n +, +i +); + +137 if( +nv� +-> +ty� + =� +GEN_DNS +){ + +138 #i� +OPENSSL_VERSION_NUMBER + < 0x10100000L + +139 +d�a + = + `ASN1_STRING_d�a +( +nv� +-> +d +. +dNSName +); + +141 +d�a + = + `ASN1_STRING_g�0_d�a +( +nv� +-> +d +. +dNSName +); + +143 if( +d�a + && ! + `mosqu�to__cmp_ho��me_w�d�rd +((*)d�a, +ho��me +)){ + +144 + `sk_GENERAL_NAME_p�_� +( +�n +, +GENERAL_NAME_� +); + +147 +have_�n_dns + = +�ue +; + +148 }if( +nv� +-> +ty� + =� +GEN_IPADD +){ + +149 #i� +OPENSSL_VERSION_NUMBER + < 0x10100000L + +150 +d�a + = + `ASN1_STRING_d�a +( +nv� +-> +d +. +iPAdd�ss +); + +152 +d�a + = + `ASN1_STRING_g�0_d�a +( +nv� +-> +d +. +iPAdd�ss +); + +154 if( +nv� +-> +d +. +iPAdd�ss +-> +�ngth + =�4 && +�v4_ok +){ + +155 if(! + `memcmp +( +�v4_addr +, +d�a +, 4)){ + +156 + `sk_GENERAL_NAME_p�_� +( +�n +, +GENERAL_NAME_� +); + +159 }if( +nv� +-> +d +. +iPAdd�ss +-> +�ngth + =�16 && +�v6_ok +){ + +160 if(! + `memcmp +( +�v6_addr +, +d�a +, 16)){ + +161 + `sk_GENERAL_NAME_p�_� +( +�n +, +GENERAL_NAME_� +); + +167 + `sk_GENERAL_NAME_p�_� +( +�n +, +GENERAL_NAME_� +); + +168 if( +have_�n_dns +){ + +174 +subj + = + `X509_g�_subje�_�me +( +�� +); + +175 if( + `X509_NAME_g�_�xt_by_NID +( +subj +, +NID_comm�Name +, +�me +, (name)) > 0){ + +176 +�me +[(name) - 1] = '\0'; + +177 i�(! + `mosqu�to__cmp_ho��me_w�d�rd +( +�me +, +ho��me +)) 1; + +180 + } +} + + @lib/tls_mosq.h + +17 #i�de� +TLS_MOSQ_H + + +18 + #TLS_MOSQ_H + + + ) + +20 #ifde� +WITH_TLS + + +21 + #SSL_DATA_PENDING +( +A +�((A)-> +s� + && + `SSL_�nd�g +((A)->s�)) + + ) + +23 + #SSL_DATA_PENDING +( +A +�0 + + ) + +26 #ifde� +WITH_TLS + + +28 + ~<ݒs�/s�.h +> + +29 + ~<ݒs�/�g�e.h +> + +31 +mosqu�to__�rv�_��ifi��_v�ify +( +�ev�ify_ok +, +X509_STORE_CTX + * +�x +); + +32 +mosqu�to__v�ify_��ifi��_ho��me +( +X509 + * +�� +, cڡ * +ho��me +); + + @lib/utf8_mosq.c + +17 + ~"c�fig.h +" + +19 + ~<�dio.h +> + +20 + ~"mosqu�to.h +" + +22 + $mosqu�to_v�id�e_utf8 +(cڡ * +�r +, +�n +) + +24 +i +; + +25 +j +; + +26 +cod�� +; + +27 +cod�o�t +; + +28 cڡ * +u�r + = (cڡ *) +�r +; + +30 if(! +�r +� +MOSQ_ERR_INVAL +; + +31 if( +�n + < 0 ||�� > 65536� +MOSQ_ERR_INVAL +; + +33 +i +=0; i< +�n +; i++){ + +34 if( +u�r +[ +i +] == 0){ + +35 +MOSQ_ERR_MALFORMED_UTF8 +; + +36 }if( +u�r +[ +i +] <= 0x7f){ + +37 +cod�� + = 1; + +38 +cod�o�t + = +u�r +[ +i +]; + +39 }if(( +u�r +[ +i +] & 0xE0) == 0xC0){ + +41 if( +u�r +[ +i +] == 0xC0 || ustr[i] == 0xC1){ + +43 +MOSQ_ERR_MALFORMED_UTF8 +; + +45 +cod�� + = 2; + +46 +cod�o�t + = ( +u�r +[ +i +] & 0x1F); + +47 }if(( +u�r +[ +i +] & 0xF0) == 0xE0){ + +49 +cod�� + = 3; + +50 +cod�o�t + = ( +u�r +[ +i +] & 0x0F); + +51 }if(( +u�r +[ +i +] & 0xF8) == 0xF0){ + +53 if( +u�r +[ +i +] > 0xF4){ + +55 +MOSQ_ERR_MALFORMED_UTF8 +; + +57 +cod�� + = 4; + +58 +cod�o�t + = ( +u�r +[ +i +] & 0x07); + +61 +MOSQ_ERR_MALFORMED_UTF8 +; + +65 if( +i + =� +�n +- +cod�� ++1){ + +67 +MOSQ_ERR_MALFORMED_UTF8 +; + +69 +j +=0; j< +cod�� +-1; j++){ + +70 if(( +u�r +[++ +i +] & 0xC0) != 0x80){ + +72 +MOSQ_ERR_MALFORMED_UTF8 +; + +74 +cod�o�t + = (cod�o�t<<6�| ( +u�r +[ +i +] & 0x3F); + +78 if( +cod�o�t + >= 0xD800 && codepoint <= 0xDFFF){ + +79 +MOSQ_ERR_MALFORMED_UTF8 +; + +89 if( +cod�� + =�3 && +cod�o�t + < 0x0800){ + +90 +MOSQ_ERR_MALFORMED_UTF8 +; + +91 }if( +cod�� + =�4 && ( +cod�o�t + < 0x10000 || codepoint > 0x10FFFF)){ + +92 +MOSQ_ERR_MALFORMED_UTF8 +; + +96 if( +cod�o�t + >= 0xFDD0 && codepoint <= 0xFDEF){ + +97 +MOSQ_ERR_MALFORMED_UTF8 +; + +99 if(( +cod�o�t + & 0xFFFF) == 0xFFFE || (codepoint & 0xFFFF) == 0xFFFF){ + +100 +MOSQ_ERR_MALFORMED_UTF8 +; + +103 if( +cod�o�t + <= 0x001F || (codepoint >= 0x007F && codepoint <= 0x009F)){ + +104 +MOSQ_ERR_MALFORMED_UTF8 +; + +107 +MOSQ_ERR_SUCCESS +; + +108 + } +} + + @lib/util_mosq.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<�r�g.h +> + +22 #ifde� +WIN32 + + +23 + ~<w�sock2.h +> + +24 + ~<a��i.h +> + +25 + ~<io.h +> + +26 + ~<lmc�s.h +> + +28 + ~<sys/��.h +> + +31 #i�! +def�ed +( +WITH_TLS +�&& def�ed( +__l�ux__ +�&& def�ed( +__GLIBC__ +) + +32 #i� +__GLIBC_PREREQ +(2, 25) + +33 + ~<sys/�ndom.h +> + +34 + #HAVE_GETRANDOM + 1 + + ) + +38 #ifde� +WITH_TLS + + +39 + ~<ݒs�/bn.h +> + +40 + ~<ݒs�/�nd.h +> + +43 #ifde� +WITH_BROKER + + +44 + ~"mosqu�to_brok�_����.h +" + +47 + ~"mosqu�to.h +" + +48 + ~"mem�y_mosq.h +" + +49 + ~"�t_mosq.h +" + +50 + ~"�nd_mosq.h +" + +51 + ~"time_mosq.h +" + +52 + ~"�s_mosq.h +" + +53 + ~"ut�_mosq.h +" + +55 #ifde� +WITH_WEBSOCKETS + + +56 + ~<libwebsock�s.h +> + +59 #ifde� +WITH_BROKER + + +60 + $mosqu�to__check_k��live +( +mosqu�to_db + * +db +, +mosqu�to + * +mosq +) + +62 + $mosqu�to__check_k��live +( +mosqu�to + * +mosq +) + +65 +time_t + +�xt_msg_out +; + +66 +time_t + +ϡ_msg_� +; + +67 +time_t + +now + = + `mosqu�to_time +(); + +68 #i�de� +WITH_BROKER + + +69 +rc +; + +72 + `as�� +( +mosq +); + +73 #i� + `def�ed +( +WITH_BROKER +�&& def�ed( +WITH_BRIDGE +) + +75 if( +mosq +-> +bridge + && mosq->bridge-> +��t_ty� + =� +b�_�zy + + +76 && +mosq +-> +sock + !� +INVALID_SOCKET + + +77 && +now + - +mosq +-> +�xt_msg_out + - mosq-> +k��live + >�mosq-> +bridge +-> +id�_timeout +){ + +79 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "Bridg�c���i� %�ha�ex�eded idˁimeout, disc����g.", +mosq +-> +id +); + +80 + `�t__sock�_�o� +( +db +, +mosq +); + +81 +MOSQ_ERR_SUCCESS +; + +84 + `�h�ad_mu�x_lock +(& +mosq +-> +msgtime_mu�x +); + +85 +�xt_msg_out + = +mosq +->next_msg_out; + +86 +ϡ_msg_� + = +mosq +->last_msg_in; + +87 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgtime_mu�x +); + +88 if( +mosq +-> +k��live + && mosq-> +sock + !� +INVALID_SOCKET + && + +89 ( +now + >� +�xt_msg_out + ||�ow - +ϡ_msg_� + >� +mosq +-> +k��live +)){ + +91 if( +mosq +-> +��e + =� +mosq_cs_c���ed + && mosq-> +p�g_t + == 0){ + +92 + `�nd__p�g�q +( +mosq +); + +94 + `�h�ad_mu�x_lock +(& +mosq +-> +msgtime_mu�x +); + +95 +mosq +-> +ϡ_msg_� + = +now +; + +96 +mosq +-> +�xt_msg_out + = +now + + mosq-> +k��live +; + +97 + `�h�ad_mu�x_u�ock +(& +mosq +-> +msgtime_mu�x +); + +99 #ifde� +WITH_BROKER + + +100 + `�t__sock�_�o� +( +db +, +mosq +); + +102 + `�t__sock�_�o� +( +mosq +); + +103 + `�h�ad_mu�x_lock +(& +mosq +-> +��e_mu�x +); + +104 if( +mosq +-> +��e + =� +mosq_cs_disc����g +){ + +105 +rc + = +MOSQ_ERR_SUCCESS +; + +107 +rc + = +MOSQ_ERR_KEEPALIVE +; + +109 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��e_mu�x +); + +110 + `�h�ad_mu�x_lock +(& +mosq +-> +��back_mu�x +); + +111 if( +mosq +-> +�_disc��� +){ + +112 +mosq +-> +�_��back + = +�ue +; + +113 +mosq +-> + `�_disc��� +(mosq, mosq-> +u�rd�a +, +rc +); + +114 +mosq +-> +�_��back + = +�l� +; + +116 if( +mosq +-> +�_disc���_v5 +){ + +117 +mosq +-> +�_��back + = +�ue +; + +118 +mosq +-> + `�_disc���_v5 +(mosq, mosq-> +u�rd�a +, +rc +, +NULL +); + +119 +mosq +-> +�_��back + = +�l� +; + +121 + `�h�ad_mu�x_u�ock +(& +mosq +-> +��back_mu�x +); + +123 +rc +; + +127 +MOSQ_ERR_SUCCESS +; + +128 + } +} + +130 +u�t16_t + + $mosqu�to__mid_g���e +( +mosqu�to + * +mosq +) + +139 +u�t16_t + +mid +; + +140 + `as�� +( +mosq +); + +142 + `�h�ad_mu�x_lock +(& +mosq +-> +mid_mu�x +); + +143 +mosq +-> +ϡ_mid +++; + +144 if( +mosq +-> +ϡ_mid + == 0) mosq->last_mid++; + +145 +mid + = +mosq +-> +ϡ_mid +; + +146 + `�h�ad_mu�x_u�ock +(& +mosq +-> +mid_mu�x +); + +148 +mid +; + +149 + } +} + +152 #ifde� +WITH_TLS + + +153 + $mosqu�to__hex2b�_sha1 +(cڡ * +hex +, ** +b� +) + +155 * +sha +, +tmp +[ +SHA_DIGEST_LENGTH +]; + +157 if( + `mosqu�to__hex2b� +( +hex +, +tmp +, +SHA_DIGEST_LENGTH +) != SHA_DIGEST_LENGTH){ + +158 +MOSQ_ERR_INVAL +; + +161 +sha + = + `mosqu�to__m�loc +( +SHA_DIGEST_LENGTH +); + +162 + `mem�y +( +sha +, +tmp +, +SHA_DIGEST_LENGTH +); + +163 * +b� + = +sha +; + +164 +MOSQ_ERR_SUCCESS +; + +165 + } +} + +167 + $mosqu�to__hex2b� +(cڡ * +hex +, * +b� +, +b�_max_�n +) + +169 +BIGNUM + * +bn + = +NULL +; + +170 +�n +; + +171 +�ad�g_z�o + = 0; + +172 +��t + = 0; + +173 +size_t + +i + = 0; + +176 +i +=0; i< + `��� +( +hex +); i=i+2) { + +177 if( + `��cmp +( +hex + + +i +, "00", 2) == 0) { + +178 +�ad�g_z�o +++; + +180 +b� +[ +��t +++] = 0; + +186 if( + `BN_hex2bn +(& +bn +, +hex +) == 0){ + +187 if( +bn +� + `BN_� +(bn); + +190 if( + `BN_num_by�s +( +bn +�+ +�ad�g_z�o + > +b�_max_�n +){ + +191 + `BN_� +( +bn +); + +195 +�n + = + `BN_bn2b� +( +bn +, +b� + + +�ad�g_z�o +); + +196 + `BN_� +( +bn +); + +197 +�n + + +�ad�g_z�o +; + +198 + } +} + +201 +FILE + * + $mosqu�to__fݒ +(cڡ * +�th +, cڡ * +mode +, +bo� + +��ri�_�ad +) + +203 #ifde� +WIN32 + + +204 +buf +[4096]; + +205 +rc +; + +206 +rc + = + `Ex�ndEnv��m�tS��gs +( +�th +, +buf +, 4096); + +207 if( +rc + == 0 ||�c > 4096){ + +208 +NULL +; + +210 i�( +��ri�_�ad +) { + +211 +HANDLE + +hf�e +; + +212 +SECURITY_ATTRIBUTES + +�c +; + +213 +EXPLICIT_ACCESS + +� +; + +214 +PACL + +�� + = +NULL +; + +215 +u��ame +[ +UNLEN + + 1]; + +216 +u�n + = +UNLEN +; + +217 +SECURITY_DESCRIPTOR + +sd +; + +218 +DWORD + +dwC��i�Di�os�i� +; + +220 +mode +[0]){ + +222 +dwC��i�Di�os�i� + = +OPEN_ALWAYS +; + +225 +dwC��i�Di�os�i� + = +OPEN_EXISTING +; + +228 +dwC��i�Di�os�i� + = +CREATE_ALWAYS +; + +231 +NULL +; + +234 + `G�U�rName +( +u��ame +, & +u�n +); + +235 i�(! + `In��lizeSecur�yDes��t� +(& +sd +, +SECURITY_DESCRIPTOR_REVISION +)) { + +236 +NULL +; + +238 + `Bu�dEx�ic�Ac�ssW�hName +(& +� +, +u��ame +, +GENERIC_ALL +, +SET_ACCESS +, +NO_INHERITANCE +); + +239 i�( + `S�E�r�sInA� +(1, & +� +, +NULL +, & +�� +�!� +ERROR_SUCCESS +) { + +240 +NULL +; + +242 i�(! + `S�Secur�yDes��t�Da� +(& +sd +, +TRUE +, +�� +, +FALSE +)) { + +243 + `Lo�lF�e +( +�� +); + +244 +NULL +; + +247 +�c +. +nL�gth + = ( +SECURITY_ATTRIBUTES +); + +248 +�c +. +bInh��H�d� + = +FALSE +; + +249 +�c +. +�Secur�yDes��t� + = & +sd +; + +251 +hf�e + = + `C��eF�e +( +buf +, +GENERIC_READ + | +GENERIC_WRITE +, 0, + +252 & +�c +, + +253 +dwC��i�Di�os�i� +, + +254 +FILE_ATTRIBUTE_NORMAL +, + +255 +NULL +); + +257 + `Lo�lF�e +( +�� +); + +259 +fd + = + `_ݒ_osfh�d� +(( +���_t +) +hf�e +, 0); + +260 i�( +fd + < 0) { + +261 +NULL +; + +264 +FILE + * +� + = + `_fdݒ +( +fd +, +mode +); + +265 i�(! +� +) { + +266 + `_�o� +( +fd +); + +267 +NULL +; + +269 +� +; + +272 + `fݒ +( +buf +, +mode +); + +276 i�( +��ri�_�ad +) { + +277 +FILE + * +� +; + +278 +mode_t + +�d_mask +; + +280 +�d_mask + = + `umask +(0077); + +281 +� + = + `fݒ +( +�th +, +mode +); + +282 + `umask +( +�d_mask +); + +284 +� +; + +286 + `fݒ +( +�th +, +mode +); + +289 + } +} + +291 + $ut�__��em�t_��ive_qu�a +( +mosqu�to + * +mosq +) + +293 if( +mosq +-> +msgs_� +. +��ight_qu�a + < mosq->msgs_�. +��ight_maximum +){ + +294 +mosq +-> +msgs_� +. +��ight_qu�a +++; + +296 + } +} + +298 + $ut�__��em�t_�nd_qu�a +( +mosqu�to + * +mosq +) + +300 if( +mosq +-> +msgs_out +. +��ight_qu�a + < mosq->msgs_out. +��ight_maximum +){ + +301 +mosq +-> +msgs_out +. +��ight_qu�a +++; + +303 + } +} + +306 + $ut�__de�em�t_��ive_qu�a +( +mosqu�to + * +mosq +) + +308 if( +mosq +-> +msgs_� +. +��ight_qu�a + > 0){ + +309 +mosq +-> +msgs_� +. +��ight_qu�a +--; + +311 + } +} + +313 + $ut�__de�em�t_�nd_qu�a +( +mosqu�to + * +mosq +) + +315 if( +mosq +-> +msgs_out +. +��ight_qu�a + > 0){ + +316 +mosq +-> +msgs_out +. +��ight_qu�a +--; + +318 + } +} + +321 + $ut�__�ndom_by�s +(* +by�s +, +cou� +) + +323 +rc + = +MOSQ_ERR_UNKNOWN +; + +325 #ifde� +WITH_TLS + + +326 if( + `RAND_by�s +( +by�s +, +cou� +) == 1){ + +327 +rc + = +MOSQ_ERR_SUCCESS +; + +329 #�i� + `def�ed +( +HAVE_GETRANDOM +) + +330 if( + `g��ndom +( +by�s +, +cou� +, 0) == count){ + +331 +rc + = +MOSQ_ERR_SUCCESS +; + +333 #�i� + `def�ed +( +WIN32 +) + +334 +HCRYPTPROV + +�ovid� +; + +336 if(! + `Cry�Acqu�eCڋxt +(& +�ovid� +, +NULL +, NULL, +PROV_RSA_FULL +, +CRYPT_VERIFYCONTEXT +)){ + +337 +MOSQ_ERR_UNKNOWN +; + +340 if( + `Cry�G�R�dom +( +�ovid� +, +cou� +, +by�s +)){ + +341 +rc + = +MOSQ_ERR_SUCCESS +; + +344 + `Cry�R���Cڋxt +( +�ovid� +, 0); + +346 +i +; + +348 +i +=0; i< +cou� +; i++){ + +349 (( +u�t8_t + *) +by�s +)[ +i +] = (u�t8_�)( + `�ndom +()&0xFF); + +351 +rc + = +MOSQ_ERR_SUCCESS +; + +353 +rc +; + +354 + } +} + + @lib/util_mosq.h + +16 #i�de� +UTIL_MOSQ_H + + +17 + #UTIL_MOSQ_H + + + ) + +19 + ~<�dio.h +> + +21 + ~"�s_mosq.h +" + +22 + ~"mosqu�to.h +" + +23 + ~"mosqu�to_����.h +" + +24 #ifde� +WITH_BROKER + + +25 + ~"mosqu�to_brok�_����.h +" + +28 #ifde� +WITH_BROKER + + +29 +mosqu�to__check_k��live +( +mosqu�to_db + * +db +, +mosqu�to + * +mosq +); + +31 +mosqu�to__check_k��live +( +mosqu�to + * +mosq +); + +33 +u�t16_t + +mosqu�to__mid_g���e +( +mosqu�to + * +mosq +); + +34 +FILE + * +mosqu�to__fݒ +(cڡ * +�th +, cڡ * +mode +, +bo� + +��ri�_�ad +); + +36 #ifde� +WITH_TLS + + +37 +mosqu�to__hex2b�_sha1 +(cڡ * +hex +, ** +b� +); + +38 +mosqu�to__hex2b� +(cڡ * +hex +, * +b� +, +b�_max_�n +); + +41 +ut�__�ndom_by�s +(* +by�s +, +cou� +); + +43 +ut�__��em�t_��ive_qu�a +( +mosqu�to + * +mosq +); + +44 +ut�__��em�t_�nd_qu�a +( +mosqu�to + * +mosq +); + +45 +ut�__de�em�t_��ive_qu�a +( +mosqu�to + * +mosq +); + +46 +ut�__de�em�t_�nd_qu�a +( +mosqu�to + * +mosq +); + + @lib/util_topic.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<�r�g.h +> + +22 #ifde� +WIN32 + + +23 + ~<w�sock2.h +> + +24 + ~<a��i.h +> + +25 + ~<io.h +> + +26 + ~<lmc�s.h +> + +28 + ~<sys/��.h +> + +32 #ifde� +WITH_BROKER + + +33 + ~"mosqu�to_brok�_����.h +" + +36 + ~"mosqu�to.h +" + +37 + ~"mem�y_mosq.h +" + +38 + ~"�t_mosq.h +" + +39 + ~"�nd_mosq.h +" + +40 + ~"time_mosq.h +" + +41 + ~"�s_mosq.h +" + +42 + ~"ut�_mosq.h +" + +49 + $mosqu�to_pub_t�ic_check +(cڡ * +�r +) + +51 +�n + = 0; + +52 +�r + && str[0]){ + +53 if( +�r +[0] == '+' || str[0] == '#'){ + +54 +MOSQ_ERR_INVAL +; + +56 +�n +++; + +57 +�r + = &str[1]; + +59 if( +�n + > 65535� +MOSQ_ERR_INVAL +; + +61 +MOSQ_ERR_SUCCESS +; + +62 + } +} + +64 + $mosqu�to_pub_t�ic_check2 +(cڡ * +�r +, +size_t + +�n +) + +66 +size_t + +i +; + +68 if( +�n + > 65535� +MOSQ_ERR_INVAL +; + +70 +i +=0; i< +�n +; i++){ + +71 if( +�r +[ +i +] == '+' || str[i] == '#'){ + +72 +MOSQ_ERR_INVAL +; + +76 +MOSQ_ERR_SUCCESS +; + +77 + } +} + +86 + $mosqu�to_sub_t�ic_check +(cڡ * +�r +) + +88 +c + = '\0'; + +89 +�n + = 0; + +90 +�r + && str[0]){ + +91 if( +�r +[0] == '+'){ + +92 if(( +c + !�'\0' && c !�'/'�|| ( +�r +[1] != '\0' && str[1] != '/')){ + +93 +MOSQ_ERR_INVAL +; + +95 }if( +�r +[0] == '#'){ + +96 if(( +c + !�'\0' && c !�'/'�|| +�r +[1] != '\0'){ + +97 +MOSQ_ERR_INVAL +; + +100 +�n +++; + +101 +c + = +�r +[0]; + +102 +�r + = &str[1]; + +104 if( +�n + > 65535� +MOSQ_ERR_INVAL +; + +106 +MOSQ_ERR_SUCCESS +; + +107 + } +} + +109 + $mosqu�to_sub_t�ic_check2 +(cڡ * +�r +, +size_t + +�n +) + +111 +c + = '\0'; + +112 +size_t + +i +; + +114 if( +�n + > 65535� +MOSQ_ERR_INVAL +; + +116 +i +=0; i< +�n +; i++){ + +117 if( +�r +[ +i +] == '+'){ + +118 if(( +c + !�'\0' && c !�'/'�|| ( +i +< +�n +-1 && +�r +[i+1] != '/')){ + +119 +MOSQ_ERR_INVAL +; + +121 }if( +�r +[ +i +] == '#'){ + +122 if(( +c + !�'\0' && c !�'/'�|| +i +< +�n +-1){ + +123 +MOSQ_ERR_INVAL +; + +126 +c + = +�r +[ +i +]; + +129 +MOSQ_ERR_SUCCESS +; + +130 + } +} + +132 + $mosqu�to_t�ic_m�ches_sub +(cڡ * +sub +, cڡ * +t�ic +, +bo� + * +�su� +) + +134 + `mosqu�to_t�ic_m�ches_sub2 +( +sub +, 0, +t�ic +, 0, +�su� +); + +135 + } +} + +138 + $mosqu�to_t�ic_m�ches_sub2 +(cڡ * +sub +, +size_t + +sub�n +, cڡ * +t�ic +, size_� +t�i�� +, +bo� + * +�su� +) + +140 +size_t + +�os +; + +142 + `UNUSED +( +sub�n +); + +143 + `UNUSED +( +t�i�� +); + +145 if(! +�su� +� +MOSQ_ERR_INVAL +; + +146 * +�su� + = +�l� +; + +148 if(! +sub + || ! +t�ic + || sub[0] == 0 ||�opic[0] == 0){ + +149 +MOSQ_ERR_INVAL +; + +152 if(( +sub +[0] =�'$' && +t�ic +[0] != '$') + +153 || ( +t�ic +[0] =�'$' && +sub +[0] != '$')){ + +155 +MOSQ_ERR_SUCCESS +; + +158 +�os + = 0; + +160 +sub +[0] != 0){ + +161 if( +t�ic +[0] == '+' ||�opic[0] == '#'){ + +162 +MOSQ_ERR_INVAL +; + +164 if( +sub +[0] !� +t�ic +[0] ||�opic[0] == 0){ + +165 if( +sub +[0] == '+'){ + +167 if( +�os + > 0 && +sub +[-1] != '/'){ + +168 +MOSQ_ERR_INVAL +; + +171 if( +sub +[1] != 0 && sub[1] != '/'){ + +172 +MOSQ_ERR_INVAL +; + +174 +�os +++; + +175 +sub +++; + +176 +t�ic +[0] != 0 &&�opic[0] != '/'){ + +177 +t�ic +++; + +179 if( +t�ic +[0] =�0 && +sub +[0] == 0){ + +180 * +�su� + = +�ue +; + +181 +MOSQ_ERR_SUCCESS +; + +183 }if( +sub +[0] == '#'){ + +185 if( +�os + > 0 && +sub +[-1] != '/'){ + +186 +MOSQ_ERR_INVAL +; + +189 if( +sub +[1] != 0){ + +190 +MOSQ_ERR_INVAL +; + +192 * +�su� + = +�ue +; + +193 +MOSQ_ERR_SUCCESS +; + +197 if( +t�ic +[0] == 0 + +198 && +�os + > 0 + +199 && +sub +[-1] == '+' + +200 && +sub +[0] == '/' + +201 && +sub +[1] == '#') + +203 * +�su� + = +�ue +; + +204 +MOSQ_ERR_SUCCESS +; + +208 +sub +[0] != 0){ + +209 if( +sub +[0] == '#' && sub[1] != 0){ + +210 +MOSQ_ERR_INVAL +; + +212 +�os +++; + +213 +sub +++; + +217 +MOSQ_ERR_SUCCESS +; + +221 if( +t�ic +[1] == 0){ + +223 if( +sub +[1] == '/' + +224 && +sub +[2] == '#' + +225 && +sub +[3] == 0){ + +226 * +�su� + = +�ue +; + +227 +MOSQ_ERR_SUCCESS +; + +230 +�os +++; + +231 +sub +++; + +232 +t�ic +++; + +233 if( +sub +[0] =�0 && +t�ic +[0] == 0){ + +234 * +�su� + = +�ue +; + +235 +MOSQ_ERR_SUCCESS +; + +236 }if( +t�ic +[0] =�0 && +sub +[0] == '+' && sub[1] == 0){ + +237 if( +�os + > 0 && +sub +[-1] != '/'){ + +238 +MOSQ_ERR_INVAL +; + +240 +�os +++; + +241 +sub +++; + +242 * +�su� + = +�ue +; + +243 +MOSQ_ERR_SUCCESS +; + +247 if(( +t�ic +[0] !�0 || +sub +[0] != 0)){ + +248 * +�su� + = +�l� +; + +251 +MOSQ_ERR_SUCCESS +; + +252 + } +} + + @lib/will_mosq.c + +17 + ~"c�fig.h +" + +19 + ~<�dio.h +> + +20 + ~<�r�g.h +> + +22 #ifde� +WITH_BROKER + + +23 + ~"mosqu�to_brok�_����.h +" + +26 + ~"mosqu�to.h +" + +27 + ~"mosqu�to_����.h +" + +28 + ~"logg�g_mosq.h +" + +29 + ~"mes�ges_mosq.h +" + +30 + ~"mem�y_mosq.h +" + +31 + ~"mq�_��oc�.h +" + +32 + ~"�t_mosq.h +" + +33 + ~"�ad_h�d�.h +" + +34 + ~"�nd_mosq.h +" + +35 + ~"ut�_mosq.h +" + +36 + ~"w�l_mosq.h +" + +38 + $w�l__�t +( +mosqu�to + * +mosq +, cڡ * +t�ic +, +�yl�d�n +, cڡ * +�yl�d +, +qos +, +bo� + +��� +, +mosqu�to_�ݔty + * +�ݔt�s +) + +40 +rc + = +MOSQ_ERR_SUCCESS +; + +41 +mosqu�to_�ݔty + * +p +; + +43 if(! +mosq + || ! +t�ic +� +MOSQ_ERR_INVAL +; + +44 if( +�yl�d�n + < 0 ||�ayl�d��> +MQTT_MAX_PAYLOAD +� +MOSQ_ERR_PAYLOAD_SIZE +; + +45 if( +�yl�d�n + > 0 && ! +�yl�d +� +MOSQ_ERR_INVAL +; + +47 if( + `mosqu�to_pub_t�ic_check +( +t�ic +)� +MOSQ_ERR_INVAL +; + +48 if( + `mosqu�to_v�id�e_utf8 +( +t�ic +, + `��� +��ic))� +MOSQ_ERR_MALFORMED_UTF8 +; + +50 if( +�ݔt�s +){ + +51 if( +mosq +-> +��oc� + !� +mosq_p_mq�5 +){ + +52 +MOSQ_ERR_NOT_SUPPORTED +; + +54 +p + = +�ݔt�s +; + +55 +p +){ + +56 +rc + = + `mosqu�to_�ݔty_check_comm�d +( +CMD_WILL +, +p +-> +id�tif�r +); + +57 if( +rc +) �c; + +58 +p + =�-> +�xt +; + +62 if( +mosq +-> +w�l +){ + +63 + `mosqu�to__� +( +mosq +-> +w�l +-> +msg +. +t�ic +); + +64 + `mosqu�to__� +( +mosq +-> +w�l +-> +msg +. +�yl�d +); + +65 + `mosqu�to_�ݔty_�_�l +(& +mosq +-> +w�l +-> +�ݔt�s +); + +66 + `mosqu�to__� +( +mosq +-> +w�l +); + +69 +mosq +-> +w�l + = + `mosqu�to__��oc +(1, ( +mosqu�to_mes�ge_�l +)); + +70 if(! +mosq +-> +w�l +� +MOSQ_ERR_NOMEM +; + +71 +mosq +-> +w�l +-> +msg +. +t�ic + = + `mosqu�to__�rdup +(topic); + +72 if(! +mosq +-> +w�l +-> +msg +. +t�ic +){ + +73 +rc + = +MOSQ_ERR_NOMEM +; + +74 +��nup +; + +76 +mosq +-> +w�l +-> +msg +. +�yl�d�n + =�ayloadlen; + +77 if( +mosq +-> +w�l +-> +msg +. +�yl�d�n + > 0){ + +78 if(! +�yl�d +){ + +79 +rc + = +MOSQ_ERR_INVAL +; + +80 +��nup +; + +82 +mosq +-> +w�l +-> +msg +. +�yl�d + = + `mosqu�to__m�loc +(()*mosq->w�l->msg. +�yl�d�n +); + +83 if(! +mosq +-> +w�l +-> +msg +. +�yl�d +){ + +84 +rc + = +MOSQ_ERR_NOMEM +; + +85 +��nup +; + +88 + `mem�y +( +mosq +-> +w�l +-> +msg +. +�yl�d +,�ayl�d, +�yl�d�n +); + +90 +mosq +-> +w�l +-> +msg +. +qos + = qos; + +91 +mosq +-> +w�l +-> +msg +. +��� + =�etain; + +93 +mosq +-> +w�l +-> +�ݔt�s + =�roperties; + +95 +MOSQ_ERR_SUCCESS +; + +97 +��nup +: + +98 if( +mosq +-> +w�l +){ + +99 + `mosqu�to__� +( +mosq +-> +w�l +-> +msg +. +t�ic +); + +100 + `mosqu�to__� +( +mosq +-> +w�l +-> +msg +. +�yl�d +); + +102 + `mosqu�to__� +( +mosq +-> +w�l +); + +103 +mosq +-> +w�l + = +NULL +; + +106 +rc +; + +107 + } +} + +109 + $w�l__��r +( +mosqu�to + * +mosq +) + +111 if(! +mosq +-> +w�l +� +MOSQ_ERR_SUCCESS +; + +113 + `mosqu�to__� +( +mosq +-> +w�l +-> +msg +. +t�ic +); + +114 +mosq +-> +w�l +-> +msg +. +t�ic + = +NULL +; + +116 + `mosqu�to__� +( +mosq +-> +w�l +-> +msg +. +�yl�d +); + +117 +mosq +-> +w�l +-> +msg +. +�yl�d + = +NULL +; + +119 + `mosqu�to_�ݔty_�_�l +(& +mosq +-> +w�l +-> +�ݔt�s +); + +121 + `mosqu�to__� +( +mosq +-> +w�l +); + +122 +mosq +-> +w�l + = +NULL +; + +124 +MOSQ_ERR_SUCCESS +; + +125 + } +} + + @lib/will_mosq.h + +17 #i�de� +WILL_MOSQ_H + + +18 + #WILL_MOSQ_H + + + ) + +20 + ~"mosqu�to.h +" + +21 + ~"mosqu�to_����.h +" + +23 +w�l__�t +( +mosqu�to + * +mosq +, cڡ * +t�ic +, +�yl�d�n +, cڡ * +�yl�d +, +qos +, +bo� + +��� +, +mosqu�to_�ݔty + * +�ݔt�s +); + +24 +w�l__��r +( +mosqu�to + * +mosq +); + + @src/bridge.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<��o.h +> + +21 + ~<�dio.h +> + +22 + ~<�r�g.h +> + +24 #i�de� +WIN32 + + +25 + ~<�tdb.h +> + +26 + ~<sys/sock�.h +> + +28 + ~<w�sock2.h +> + +29 + ~<ws2t��.h +> + +32 + ~"mq�_��oc�.h +" + +33 + ~"mosqu�to.h +" + +34 + ~"mosqu�to_brok�_����.h +" + +35 + ~"mosqu�to_����.h +" + +36 + ~"�t_mosq.h +" + +37 + ~"mem�y_mosq.h +" + +38 + ~"�ck�_mosq.h +" + +39 + ~"�nd_mosq.h +" + +40 + ~"time_mosq.h +" + +41 + ~"�s_mosq.h +" + +42 + ~"ut�_mosq.h +" + +43 + ~"w�l_mosq.h +" + +45 #ifde� +WITH_BRIDGE + + +47 +bridge__backoff_�� +( +mosqu�to + * +cڋxt +); + +48 +bridge__backoff_��t +( +mosqu�to + * +cڋxt +); + +50 + $bridge__�w +( +mosqu�to_db + * +db +, +mosqu�to__bridge + * +bridge +) + +52 +mosqu�to + * +�w_cڋxt + = +NULL +; + +53 +mosqu�to + ** +bridges +; + +54 * +lo�l_id +; + +56 + `as�� +( +db +); + +57 + `as�� +( +bridge +); + +59 +lo�l_id + = + `mosqu�to__�rdup +( +bridge +-> +lo�l_���id +); + +61 + `HASH_FIND +( +hh_id +, +db +-> +cڋxts_by_id +, +lo�l_id +, + `��� +�o�l_id), +�w_cڋxt +); + +62 if( +�w_cڋxt +){ + +64 + `mosqu�to__� +( +lo�l_id +); + +67 +�w_cڋxt + = + `cڋxt__�� +( +db +, -1); + +68 if(! +�w_cڋxt +){ + +69 + `mosqu�to__� +( +lo�l_id +); + +70 +MOSQ_ERR_NOMEM +; + +72 +�w_cڋxt +-> +id + = +lo�l_id +; + +73 + `HASH_ADD_KEYPTR +( +hh_id +, +db +-> +cڋxts_by_id +, +�w_cڋxt +-> +id +, + `��� +(new_context->id),�ew_context); + +75 +�w_cڋxt +-> +bridge + = bridge; + +76 +�w_cڋxt +-> +is_bridge + = +�ue +; + +78 +�w_cڋxt +-> +u��ame + =�ew_cڋxt-> +bridge +-> +�m�e_u��ame +; + +79 +�w_cڋxt +-> +�ssw�d + =�ew_cڋxt-> +bridge +-> +�m�e_�ssw�d +; + +81 #ifde� +WITH_TLS + + +82 +�w_cڋxt +-> +�s_�f�e + =�ew_cڋxt-> +bridge +->tls_cafile; + +83 +�w_cڋxt +-> +�s_��th + =�ew_cڋxt-> +bridge +->tls_capath; + +84 +�w_cڋxt +-> +�s_��f�e + =�ew_cڋxt-> +bridge +->tls_certfile; + +85 +�w_cڋxt +-> +�s_keyf�e + =�ew_cڋxt-> +bridge +->tls_keyfile; + +86 +�w_cڋxt +-> +�s_��_�qs + = +SSL_VERIFY_PEER +; + +87 +�w_cڋxt +-> +�s_oc�_�qu�ed + =�ew_cڋxt-> +bridge +->tls_ocsp_required; + +88 +�w_cڋxt +-> +�s_v�si� + =�ew_cڋxt-> +bridge +->tls_version; + +89 +�w_cڋxt +-> +�s_��cu� + =�ew_cڋxt-> +bridge +->tls_insecure; + +90 +�w_cڋxt +-> +�s_�� + =�ew_cڋxt-> +bridge +->tls_alpn; + +91 #ifde� +FINAL_WITH_TLS_PSK + + +92 +�w_cڋxt +-> +�s_psk_id�t�y + =�ew_cڋxt-> +bridge +->tls_psk_identity; + +93 +�w_cڋxt +-> +�s_psk + =�ew_cڋxt-> +bridge +->tls_psk; + +97 +bridge +-> +�y_�iv�e_ac��ed + = +�ue +; + +98 +�w_cڋxt +-> +��oc� + = +bridge +-> +��oc�_v�si� +; + +100 +bridges + = + `mosqu�to__��loc +( +db +->bridges, (db-> +bridge_cou� ++1)*( +mosqu�to + *)); + +101 if( +bridges +){ + +102 +db +-> +bridges + = bridges; + +103 +db +-> +bridge_cou� +++; + +104 +db +-> +bridges +[db-> +bridge_cou� +-1] = +�w_cڋxt +; + +106 +MOSQ_ERR_NOMEM +; + +109 #i� + `def�ed +( +__GLIBC__ +�&& def�ed( +WITH_ADNS +) + +110 +�w_cڋxt +-> +bridge +-> +���t_t + = 1; + +111 + `bridge__c���_��1 +( +db +, +�w_cڋxt +); + +113 + `bridge__c��� +( +db +, +�w_cڋxt +); + +115 + } +} + +117 #i� +def�ed +( +__GLIBC__ +�&& def�ed( +WITH_ADNS +) + +118 + $bridge__c���_��1 +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +120 +rc +; + +121 * +n�ifi�ti�_t�ic +; + +122 +n�ifi�ti�_t�ic_�n +; + +123 +u�t8_t + +n�ifi�ti�_�yl�d +; + +124 +i +; + +126 if(! +cڋxt + || !cڋxt-> +bridge +� +MOSQ_ERR_INVAL +; + +128 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_�w +); + +129 +cڋxt +-> +sock + = +INVALID_SOCKET +; + +130 +cڋxt +-> +ϡ_msg_� + = + `mosqu�to_time +(); + +131 +cڋxt +-> +�xt_msg_out + = + `mosqu�to_time +(�+ cڋxt-> +bridge +-> +k��live +; + +132 +cڋxt +-> +k��live + = cڋxt-> +bridge +->keepalive; + +133 +cڋxt +-> +��n_��t + = cڋxt-> +bridge +->clean_start; + +134 +cڋxt +-> +�_�ck� +. +�yl�d + = +NULL +; + +135 +cڋxt +-> +p�g_t + = 0; + +136 +cڋxt +-> +bridge +-> +�zy_�c��� + = +�l� +; + +137 + `bridge__�ck�_��nup +( +cڋxt +); + +138 + `db__mes�ge_�c���_��t +( +db +, +cڋxt +); + +140 if( +cڋxt +-> +��n_��t +){ + +141 + `db__mes�ges_d��e +( +db +, +cڋxt +); + +148 + `sub__��n_�ssi� +( +db +, +cڋxt +); + +150 +i +=0; i< +cڋxt +-> +bridge +-> +t�ic_cou� +; i++){ + +151 if( +cڋxt +-> +bridge +-> +t�ics +[ +i +]. +d�e�i� + =� +bd_out + || cڋxt->bridge->t�ics[i].d�e�i� =� +bd_b�h +){ + +152 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "Bridg�%�do�g�o��SUBSCRIBE o�t�i�%s", +cڋxt +-> +id +, cڋxt-> +bridge +-> +t�ics +[ +i +]. +lo�l_t�ic +); + +153 if( + `sub__add +( +db +, + +154 +cڋxt +, + +155 +cڋxt +-> +bridge +-> +t�ics +[ +i +]. +lo�l_t�ic +, + +156 +cڋxt +-> +bridge +-> +t�ics +[ +i +]. +qos +, + +158 +MQTT_SUB_OPT_NO_LOCAL + | +MQTT_SUB_OPT_RETAIN_AS_PUBLISHED +, + +159 & +db +-> +subs +) > 0){ + +162 + `sub__���_queue +( +db +, +cڋxt +, + +163 +cڋxt +-> +bridge +-> +t�ics +[ +i +]. +lo�l_t�ic +, + +164 +cڋxt +-> +bridge +-> +t�ics +[ +i +]. +qos +, 0); + +169 + `bridge__backoff_�� +( +cڋxt +); + +171 if( +cڋxt +-> +bridge +-> +n�ifi�ti�s +){ + +172 if( +cڋxt +-> +bridge +-> +n�ifi�ti�_t�ic +){ + +173 if(! +cڋxt +-> +bridge +-> +���l_n�ifi�ti�_d�e +){ + +174 +n�ifi�ti�_�yl�d + = '0'; + +175 + `db__mes�ges_�sy_queue +( +db +, +cڋxt +, cڋxt-> +bridge +-> +n�ifi�ti�_t�ic +, 1, 1, & +n�ifi�ti�_�yl�d +, 1, 0, +NULL +); + +176 +cڋxt +-> +bridge +-> +���l_n�ifi�ti�_d�e + = +�ue +; + +178 +n�ifi�ti�_�yl�d + = '0'; + +179 +rc + = + `w�l__�t +( +cڋxt +, cڋxt-> +bridge +-> +n�ifi�ti�_t�ic +, 1, & +n�ifi�ti�_�yl�d +, 1, +�ue +, +NULL +); + +180 if( +rc + !� +MOSQ_ERR_SUCCESS +){ + +181 +rc +; + +184 +n�ifi�ti�_t�ic_�n + = + `��� +( +cڋxt +-> +bridge +-> +�m�e_���id +)+strlen("$SYS/broker/connection//state"); + +185 +n�ifi�ti�_t�ic + = + `mosqu�to__m�loc +(()*( +n�ifi�ti�_t�ic_�n ++1)); + +186 if(! +n�ifi�ti�_t�ic +� +MOSQ_ERR_NOMEM +; + +188 + `���tf +( +n�ifi�ti�_t�ic +, +n�ifi�ti�_t�ic_�n ++1, "$SYS/brok�/c���i�/%s/��e", +cڋxt +-> +bridge +-> +�m�e_���id +); + +190 if(! +cڋxt +-> +bridge +-> +���l_n�ifi�ti�_d�e +){ + +191 +n�ifi�ti�_�yl�d + = '0'; + +192 + `db__mes�ges_�sy_queue +( +db +, +cڋxt +, +n�ifi�ti�_t�ic +, 1, 1, & +n�ifi�ti�_�yl�d +, 1, 0, +NULL +); + +193 +cڋxt +-> +bridge +-> +���l_n�ifi�ti�_d�e + = +�ue +; + +196 +n�ifi�ti�_�yl�d + = '0'; + +197 +rc + = + `w�l__�t +( +cڋxt +, +n�ifi�ti�_t�ic +, 1, & +n�ifi�ti�_�yl�d +, 1, +�ue +, +NULL +); + +198 + `mosqu�to__� +( +n�ifi�ti�_t�ic +); + +199 if( +rc + !� +MOSQ_ERR_SUCCESS +){ + +200 +rc +; + +205 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "C����g bridg�(�� 1�%�(%s:%d)", +cڋxt +-> +bridge +-> +�me +, cڋxt->bridge-> +add�s�s +[cڋxt->bridge-> +cur_add�ss +]. +add�ss +, cڋxt->bridge->add�s�s[cڋxt->bridge->cur_add�ss]. +p�t +); + +206 +rc + = + `�t__�y_c���_��1 +( +cڋxt +, cڋxt-> +bridge +-> +add�s�s +[cڋxt->bridge-> +cur_add�ss +]. +add�ss +); + +207 if( +rc + > 0 ){ + +208 if( +rc + =� +MOSQ_ERR_TLS +){ + +209 + `�t__sock�_�o� +( +db +, +cڋxt +); + +210 +rc +; + +211 }if( +rc + =� +MOSQ_ERR_ERRNO +){ + +212 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� c���g bridge: %s.", + `���� +( +��o +)); + +213 }if( +rc + =� +MOSQ_ERR_EAI +){ + +214 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� c���g bridge: %s.", + `gai_���� +( +��o +)); + +217 +rc +; + +220 +MOSQ_ERR_SUCCESS +; + +221 + } +} + +224 + $bridge__c���_��2 +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +226 +rc +; + +228 if(! +cڋxt + || !cڋxt-> +bridge +� +MOSQ_ERR_INVAL +; + +230 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "C����g bridg�(�� 2�%�(%s:%d)", +cڋxt +-> +bridge +-> +�me +, cڋxt->bridge-> +add�s�s +[cڋxt->bridge-> +cur_add�ss +]. +add�ss +, cڋxt->bridge->add�s�s[cڋxt->bridge->cur_add�ss]. +p�t +); + +231 +rc + = + `�t__�y_c���_��2 +( +cڋxt +, cڋxt-> +bridge +-> +add�s�s +[cڋxt->bridge-> +cur_add�ss +]. +p�t +, &cڋxt-> +sock +); + +232 if( +rc + > 0){ + +233 if( +rc + =� +MOSQ_ERR_TLS +){ + +234 + `�t__sock�_�o� +( +db +, +cڋxt +); + +235 +rc +; + +236 }if( +rc + =� +MOSQ_ERR_ERRNO +){ + +237 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� c���g bridge: %s.", + `���� +( +��o +)); + +238 }if( +rc + =� +MOSQ_ERR_EAI +){ + +239 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� c���g bridge: %s.", + `gai_���� +( +��o +)); + +242 +rc +; + +245 + `HASH_ADD +( +hh_sock +, +db +-> +cڋxts_by_sock +, +sock +, ( +cڋxt +->sock), context); + +247 if( +rc + =� +MOSQ_ERR_CONN_PENDING +){ + +248 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_c���_�nd�g +); + +250 +rc +; + +251 + } +} + +254 + $bridge__c���_��3 +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +256 +rc +; + +258 +rc + = + `�t__sock�_c���_��3 +( +cڋxt +, cڋxt-> +bridge +-> +add�s�s +[cڋxt->bridge-> +cur_add�ss +]. +add�ss +); + +259 if( +rc + > 0){ + +260 if( +rc + =� +MOSQ_ERR_TLS +){ + +261 + `�t__sock�_�o� +( +db +, +cڋxt +); + +262 +rc +; + +263 }if( +rc + =� +MOSQ_ERR_ERRNO +){ + +264 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� c���g bridge: %s.", + `���� +( +��o +)); + +265 }if( +rc + =� +MOSQ_ERR_EAI +){ + +266 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� c���g bridge: %s.", + `gai_���� +( +��o +)); + +269 +rc +; + +272 if( +cڋxt +-> +bridge +-> +round_rob� + =� +�l� + && cڋxt->bridge-> +cur_add�ss + != 0){ + +273 +cڋxt +-> +bridge +-> +�im�y_��y + = + `mosqu�to_time +() + 5; + +276 +rc + = + `�nd__c��� +( +cڋxt +, cڋxt-> +k��live +, cڋxt-> +��n_��t +, +NULL +); + +277 if( +rc + =� +MOSQ_ERR_SUCCESS +){ + +278 + `bridge__backoff_��t +( +cڋxt +); + +279 +MOSQ_ERR_SUCCESS +; + +280 }if( +rc + =� +MOSQ_ERR_ERRNO + && +��o + =� +ENOTCONN +){ + +281 + `bridge__backoff_��t +( +cڋxt +); + +282 +MOSQ_ERR_SUCCESS +; + +284 if( +rc + =� +MOSQ_ERR_TLS +){ + +285 +rc +; + +286 }if( +rc + =� +MOSQ_ERR_ERRNO +){ + +287 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� c���g bridge: %s.", + `���� +( +��o +)); + +288 }if( +rc + =� +MOSQ_ERR_EAI +){ + +289 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� c���g bridge: %s.", + `gai_���� +( +��o +)); + +291 + `�t__sock�_�o� +( +db +, +cڋxt +); + +292 +rc +; + +294 + } +} + +297 + $bridge__c��� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +299 +rc +, +rc2 +; + +300 +i +; + +301 * +n�ifi�ti�_t�ic +; + +302 +n�ifi�ti�_t�ic_�n +; + +303 +u�t8_t + +n�ifi�ti�_�yl�d +; + +305 if(! +cڋxt + || !cڋxt-> +bridge +� +MOSQ_ERR_INVAL +; + +307 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_�w +); + +308 +cڋxt +-> +sock + = +INVALID_SOCKET +; + +309 +cڋxt +-> +ϡ_msg_� + = + `mosqu�to_time +(); + +310 +cڋxt +-> +�xt_msg_out + = + `mosqu�to_time +(�+ cڋxt-> +bridge +-> +k��live +; + +311 +cڋxt +-> +k��live + = cڋxt-> +bridge +->keepalive; + +312 +cڋxt +-> +��n_��t + = cڋxt-> +bridge +->clean_start; + +313 +cڋxt +-> +�_�ck� +. +�yl�d + = +NULL +; + +314 +cڋxt +-> +p�g_t + = 0; + +315 +cڋxt +-> +bridge +-> +�zy_�c��� + = +�l� +; + +316 + `bridge__�ck�_��nup +( +cڋxt +); + +317 + `db__mes�ge_�c���_��t +( +db +, +cڋxt +); + +319 if( +cڋxt +-> +��n_��t +){ + +320 + `db__mes�ges_d��e +( +db +, +cڋxt +); + +327 + `sub__��n_�ssi� +( +db +, +cڋxt +); + +329 +i +=0; i< +cڋxt +-> +bridge +-> +t�ic_cou� +; i++){ + +330 if( +cڋxt +-> +bridge +-> +t�ics +[ +i +]. +d�e�i� + =� +bd_out + || cڋxt->bridge->t�ics[i].d�e�i� =� +bd_b�h +){ + +331 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "Bridg�%�do�g�o��SUBSCRIBE o�t�i�%s", +cڋxt +-> +id +, cڋxt-> +bridge +-> +t�ics +[ +i +]. +lo�l_t�ic +); + +332 if( + `sub__add +( +db +, + +333 +cڋxt +, + +334 +cڋxt +-> +bridge +-> +t�ics +[ +i +]. +lo�l_t�ic +, + +335 +cڋxt +-> +bridge +-> +t�ics +[ +i +]. +qos +, + +337 +MQTT_SUB_OPT_NO_LOCAL + | +MQTT_SUB_OPT_RETAIN_AS_PUBLISHED +, + +338 & +db +-> +subs +) > 0){ + +346 + `bridge__backoff_�� +( +cڋxt +); + +348 if( +cڋxt +-> +bridge +-> +n�ifi�ti�s +){ + +349 if( +cڋxt +-> +bridge +-> +n�ifi�ti�_t�ic +){ + +350 if(! +cڋxt +-> +bridge +-> +���l_n�ifi�ti�_d�e +){ + +351 +n�ifi�ti�_�yl�d + = '0'; + +352 + `db__mes�ges_�sy_queue +( +db +, +cڋxt +, cڋxt-> +bridge +-> +n�ifi�ti�_t�ic +, 1, 1, & +n�ifi�ti�_�yl�d +, 1, 0, +NULL +); + +353 +cڋxt +-> +bridge +-> +���l_n�ifi�ti�_d�e + = +�ue +; + +356 i�(! +cڋxt +-> +bridge +-> +n�ifi�ti�s_lo�l_�ly +) { + +357 +n�ifi�ti�_�yl�d + = '0'; + +358 +rc + = + `w�l__�t +( +cڋxt +, cڋxt-> +bridge +-> +n�ifi�ti�_t�ic +, 1, & +n�ifi�ti�_�yl�d +, 1, +�ue +, +NULL +); + +359 if( +rc + !� +MOSQ_ERR_SUCCESS +){ + +360 +rc +; + +364 +n�ifi�ti�_t�ic_�n + = + `��� +( +cڋxt +-> +bridge +-> +�m�e_���id +)+strlen("$SYS/broker/connection//state"); + +365 +n�ifi�ti�_t�ic + = + `mosqu�to__m�loc +(()*( +n�ifi�ti�_t�ic_�n ++1)); + +366 if(! +n�ifi�ti�_t�ic +� +MOSQ_ERR_NOMEM +; + +368 + `���tf +( +n�ifi�ti�_t�ic +, +n�ifi�ti�_t�ic_�n ++1, "$SYS/brok�/c���i�/%s/��e", +cڋxt +-> +bridge +-> +�m�e_���id +); + +370 if(! +cڋxt +-> +bridge +-> +���l_n�ifi�ti�_d�e +){ + +371 +n�ifi�ti�_�yl�d + = '0'; + +372 + `db__mes�ges_�sy_queue +( +db +, +cڋxt +, +n�ifi�ti�_t�ic +, 1, 1, & +n�ifi�ti�_�yl�d +, 1, 0, +NULL +); + +373 +cڋxt +-> +bridge +-> +���l_n�ifi�ti�_d�e + = +�ue +; + +376 i�(! +cڋxt +-> +bridge +-> +n�ifi�ti�s_lo�l_�ly +) { + +377 +n�ifi�ti�_�yl�d + = '0'; + +378 +rc + = + `w�l__�t +( +cڋxt +, +n�ifi�ti�_t�ic +, 1, & +n�ifi�ti�_�yl�d +, 1, +�ue +, +NULL +); + +379 + `mosqu�to__� +( +n�ifi�ti�_t�ic +); + +380 if( +rc + !� +MOSQ_ERR_SUCCESS +){ + +381 +rc +; + +387 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "C����g bridg�%�(%s:%d)", +cڋxt +-> +bridge +-> +�me +, cڋxt->bridge-> +add�s�s +[cڋxt->bridge-> +cur_add�ss +]. +add�ss +, cڋxt->bridge->add�s�s[cڋxt->bridge->cur_add�ss]. +p�t +); + +388 +rc + = + `�t__sock�_c��� +( +cڋxt +, cڋxt-> +bridge +-> +add�s�s +[cڋxt->bridge-> +cur_add�ss +]. +add�ss +, cڋxt->bridge->add�s�s[cڋxt->bridge->cur_add�ss]. +p�t +, +NULL +, +�l� +); + +389 if( +rc + > 0){ + +390 if( +rc + =� +MOSQ_ERR_TLS +){ + +391 + `�t__sock�_�o� +( +db +, +cڋxt +); + +392 +rc +; + +393 }if( +rc + =� +MOSQ_ERR_ERRNO +){ + +394 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� c���g bridge: %s.", + `���� +( +��o +)); + +395 }if( +rc + =� +MOSQ_ERR_EAI +){ + +396 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� c���g bridge: %s.", + `gai_���� +( +��o +)); + +399 +rc +; + +400 }if( +rc + =� +MOSQ_ERR_CONN_PENDING +){ + +401 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_c���_�nd�g +); + +404 + `HASH_ADD +( +hh_sock +, +db +-> +cڋxts_by_sock +, +sock +, ( +cڋxt +->sock), context); + +406 +rc2 + = + `�nd__c��� +( +cڋxt +, cڋxt-> +k��live +, cڋxt-> +��n_��t +, +NULL +); + +407 if( +rc2 + =� +MOSQ_ERR_SUCCESS +){ + +408 + `bridge__backoff_��t +( +cڋxt +); + +409 +rc +; + +410 }if( +rc2 + =� +MOSQ_ERR_ERRNO + && +��o + =� +ENOTCONN +){ + +411 + `bridge__backoff_��t +( +cڋxt +); + +412 +MOSQ_ERR_SUCCESS +; + +414 if( +rc2 + =� +MOSQ_ERR_TLS +){ + +415 +rc2 +; + +416 }if( +rc2 + =� +MOSQ_ERR_ERRNO +){ + +417 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� c���g bridge: %s.", + `���� +( +��o +)); + +418 }if( +rc2 + =� +MOSQ_ERR_EAI +){ + +419 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� c���g bridge: %s.", + `gai_���� +( +��o +)); + +421 + `�t__sock�_�o� +( +db +, +cڋxt +); + +422 +rc2 +; + +424 + } +} + +428 + $bridge__�ck�_��nup +( +mosqu�to + * +cڋxt +) + +430 +mosqu�to__�ck� + * +�ck� +; + +431 if(! +cڋxt +) ; + +433 if( +cڋxt +-> +cu��t_out_�ck� +){ + +434 + `�ck�__��nup +( +cڋxt +-> +cu��t_out_�ck� +); + +435 + `mosqu�to__� +( +cڋxt +-> +cu��t_out_�ck� +); + +436 +cڋxt +-> +cu��t_out_�ck� + = +NULL +; + +438 +cڋxt +-> +out_�ck� +){ + +439 + `�ck�__��nup +( +cڋxt +-> +out_�ck� +); + +440 +�ck� + = +cڋxt +-> +out_�ck� +; + +441 +cڋxt +-> +out_�ck� + = cڋxt->out_�ck�-> +�xt +; + +442 + `mosqu�to__� +( +�ck� +); + +444 +cڋxt +-> +out_�ck� + = +NULL +; + +445 +cڋxt +-> +out_�ck�_ϡ + = +NULL +; + +447 + `�ck�__��nup +(&( +cڋxt +-> +�_�ck� +)); + +448 + } +} + +450 + $�nd_b�w�n +( +ba� +, +�p +) + +452 +r +; + +453 + `ut�__�ndom_by�s +(& +r +, ()); + +454 ( +r + % ( +�p + - +ba� +)) + base; + +455 + } +} + +457 + $bridge__backoff_�� +( +mosqu�to + * +cڋxt +) + +459 +mosqu�to__bridge + * +bridge +; + +460 if(! +cڋxt + || !cڋxt-> +bridge +) ; + +462 +bridge + = +cڋxt +->bridge; + +465 if( +bridge +-> +backoff_�p +){ + +469 +bridge +-> +���t_timeout + = + `�nd_b�w�n +(bridge-> +backoff_ba� +, bridge->restart_timeout * 3); + +470 if( +bridge +-> +���t_timeout + > bridge-> +backoff_�p +){ + +471 +bridge +-> +���t_timeout + = bridge-> +backoff_�p +; + +474 + } +} + +476 + $bridge__backoff_��t +( +mosqu�to + * +cڋxt +) + +478 +mosqu�to__bridge + * +bridge +; + +479 if(! +cڋxt + || !cڋxt-> +bridge +) ; + +481 +bridge + = +cڋxt +->bridge; + +484 if( +bridge +-> +backoff_�p +){ + +485 +bridge +-> +���t_timeout + = bridge-> +backoff_ba� +; + +487 + } +} + + @src/conf.c + +17 + ~"c�fig.h +" + +19 + ~<lim�s.h +> + +20 + ~<�dio.h +> + +21 + ~<�dlib.h +> + +22 + ~<�r�g.h +> + +23 + ~<��o.h +> + +25 #ifde� +WIN32 + + +27 + ~<d��t.h +> + +28 + ~<�r�gs.h +> + +31 #i�de� +WIN32 + + +32 + ~<�tdb.h +> + +33 + ~<sys/sock�.h +> + +35 + ~<w�sock2.h +> + +36 + ~<ws2t��.h +> + +39 #i�! +def�ed +( +WIN32 +�&& !def�ed( +__CYGWIN__ +) + +40 + ~<sy�og.h +> + +43 + ~"mosqu�to_brok�_����.h +" + +44 + ~"mem�y_mosq.h +" + +45 + ~"�s_mosq.h +" + +46 + ~"ut�_mosq.h +" + +47 + ~"mq�_��oc�.h +" + +49 + sc�fig_�cur� + { + +50 + mlog_de� +; + +51 + mlog_de�_�t +; + +52 + mlog_ty� +; + +53 + mlog_ty�_�t +; + +54 + mmax_��ight_by�s +; + +55 + mmax_queued_by�s +; + +56 + mmax_queued_mes�ges +; + +59 #i� +def�ed +( +WIN32 +�|| def�ed( +__CYGWIN__ +) + +60 + ~<w�dows.h +> + +61 +SERVICE_STATUS_HANDLE + +�rvi�_h�d� +; + +64 +mosqu�to__�cur�y_�ti�s + * + gcur_�cur�y_�ti�s + = +NULL +; + +66 +c�f__�r�_bo� +(** +tok� +, cڡ * +�me +, +bo� + * +v�ue +, * +�v�� +); + +67 +c�f__�r�_�t +(** +tok� +, cڡ * +�me +, * +v�ue +, * +�v�� +); + +68 +c�f__�r�_ssize_t +(** +tok� +, cڡ * +�me +, +ssize_t + * +v�ue +, * +�v�� +); + +69 +c�f__�r�_�r�g +(** +tok� +, cڡ * +�me +, ** +v�ue +, * +�v�� +); + +70 +c�fig__�ad_f�e +( +mosqu�to__c�fig + * +c�fig +, +bo� + +�l�d +, cڡ * +f�e +, +c�fig_�cur� + * +c�fig_tmp +, +�v� +, * +l��o +); + +71 +c�fig__check +( +mosqu�to__c�fig + * +c�fig +); + +72 +c�fig__��nup_�ug�s +( +mosqu�to__c�fig + * +c�fig +); + +74 * + $fg�s_ex�nd�g +(** +buf +, * +bu� +, +FILE + * +��am +) + +76 * +rc +; + +77 +�dch� +; + +78 +off�t + = 0; + +79 * +�wbuf +; + +82 +rc + = + `fg�s +(&((* +buf +)[ +off�t +]), * +bu� +-off�t, +��am +); + +83 if( + `�of +( +��am +)){ + +84 +rc +; + +87 +�dch� + = (* +buf +)[ + `��� +(*buf)-1]; + +88 if( +�dch� + == '\n'){ + +89 +rc +; + +92 +off�t + = * +bu� +-1; + +93 * +bu� + += 1000; + +94 +�wbuf + = + `��loc +(* +buf +, * +bu� +); + +95 if(! +�wbuf +){ + +96 +NULL +; + +98 * +buf + = +�wbuf +; + +100 + } +} + +103 + $c�f__�t_cur_�cur�y_�ti�s +( +mosqu�to__c�fig + * +c�fig +, +mosqu�to__li��� + * +cur_li��� +, +mosqu�to__�cur�y_�ti�s + ** +�cur�y_�ti�s +) + +105 if( +c�fig +-> +�r_li���_���gs +){ + +106 (* +�cur�y_�ti�s +��& +cur_li��� +->security_options; + +108 (* +�cur�y_�ti�s +��& +c�fig +->security_options; + +110 + } +} + +112 + $c�f__��m�_�s�ve +(cڡ * +ho� +, cڡ * +�xt +, +log +, cڡ * +msg +) + +114 +addr�fo + +gai_h�ts +; + +115 +addr�fo + * +gai_�s +; + +116 +rc +; + +118 + `mem�t +(& +gai_h�ts +, 0, ( +addr�fo +)); + +119 +gai_h�ts +. +ai_�m�y + = +AF_UNSPEC +; + +120 +gai_h�ts +. +ai_sockty� + = +SOCK_STREAM +; + +121 +gai_�s + = +NULL +; + +122 +rc + = + `g�addr�fo +( +ho� +, +NULL +, & +gai_h�ts +, & +gai_�s +); + +123 if( +gai_�s +){ + +124 + `�addr�fo +( +gai_�s +); + +126 if( +rc + != 0){ + +127 #i�de� +WIN32 + + +128 if( +rc + =� +EAI_SYSTEM +){ + +129 if( +��o + =� +ENOENT +){ + +130 + `log__��tf +( +NULL +, +log +, "%s: U�bˁػs�v�%�%s.", +msg +, +�xt +, +ho� +); + +132 + `log__��tf +( +NULL +, +log +, "%s: E�܄es�v�g %s: %s.", +msg +, +�xt +, + `���� +( +��o +)); + +135 + `log__��tf +( +NULL +, +log +, "%s: E�܄es�v�g %s: %s.", +msg +, +�xt +, + `gai_���� +( +rc +)); + +138 if( +rc + =� +WSAHOST_NOT_FOUND +){ + +139 + `log__��tf +( +NULL +, +log +, "%s: E�܄es�v�g %s.", +msg +, +�xt +); + +142 +MOSQ_ERR_INVAL +; + +144 +MOSQ_ERR_SUCCESS +; + +145 + } +} + +148 + $c�fig__��_�l�d +( +mosqu�to_db + * +db +, +mosqu�to__c�fig + * +c�fig +) + +150 +i +; + +152 +i +=0; i< +c�fig +-> +li���_cou� +; i++){ + +153 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +a�_f�e +); + +154 +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +a�_f�e + = +NULL +; + +156 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +�ssw�d_f�e +); + +157 +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +�ssw�d_f�e + = +NULL +; + +159 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +psk_f�e +); + +160 +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +psk_f�e + = +NULL +; + +162 +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +�low_��ymous + = -1; + +163 +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +�low_z�o_�ngth_���id + = +�ue +; + +164 +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +auto_id_�efix + = +NULL +; + +165 +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +auto_id_�efix_�n + = 0; + +168 +c�fig +-> +�low_du�i��_mes�ges + = +�l� +; + +170 + `mosqu�to__� +( +c�fig +-> +�cur�y_�ti�s +. +a�_f�e +); + +171 +c�fig +-> +�cur�y_�ti�s +. +a�_f�e + = +NULL +; + +173 +c�fig +-> +�cur�y_�ti�s +. +�low_��ymous + = -1; + +174 +c�fig +-> +�cur�y_�ti�s +. +�low_z�o_�ngth_���id + = +�ue +; + +175 +c�fig +-> +�cur�y_�ti�s +. +auto_id_�efix + = +NULL +; + +176 +c�fig +-> +�cur�y_�ti�s +. +auto_id_�efix_�n + = 0; + +178 + `mosqu�to__� +( +c�fig +-> +�cur�y_�ti�s +. +�ssw�d_f�e +); + +179 +c�fig +-> +�cur�y_�ti�s +. +�ssw�d_f�e + = +NULL +; + +181 + `mosqu�to__� +( +c�fig +-> +�cur�y_�ti�s +. +psk_f�e +); + +182 +c�fig +-> +�cur�y_�ti�s +. +psk_f�e + = +NULL +; + +184 +c�fig +-> +auto�ve_��rv� + = 1800; + +185 +c�fig +-> +auto�ve_�_ch�ges + = +�l� +; + +186 + `mosqu�to__� +( +c�fig +-> +���id_�efixes +); + +187 +c�fig +-> +c���i�_mes�ges + = +�ue +; + +188 +c�fig +-> +���id_�efixes + = +NULL +; + +189 +c�fig +-> +�r_li���_���gs + = +�l� +; + +190 if( +c�fig +-> +log_� +){ + +191 + `f�o� +( +c�fig +-> +log_� +); + +192 +c�fig +-> +log_� + = +NULL +; + +194 + `mosqu�to__� +( +c�fig +-> +log_f�e +); + +195 +c�fig +-> +log_f�e + = +NULL +; + +197 #i� + `def�ed +( +WIN32 +�|| def�ed( +__CYGWIN__ +) + +198 if( +�rvi�_h�d� +){ + +202 +c�fig +-> +log_de� + = +MQTT3_LOG_NONE +; + +204 +c�fig +-> +log_de� + = +MQTT3_LOG_STDERR +; + +207 +c�fig +-> +log_�c��y + = +LOG_DAEMON +; + +208 +c�fig +-> +log_de� + = +MQTT3_LOG_STDERR +; + +209 if( +db +-> +v�bo� +){ + +210 +c�fig +-> +log_ty� + = +INT_MAX +; + +212 +c�fig +-> +log_ty� + = +MOSQ_LOG_ERR + | +MOSQ_LOG_WARNING + | +MOSQ_LOG_NOTICE + | +MOSQ_LOG_INFO +; + +215 +c�fig +-> +log_time�amp + = +�ue +; + +216 + `mosqu�to__� +( +c�fig +-> +log_time�amp_f�m� +); + +217 +c�fig +-> +log_time�amp_f�m� + = +NULL +; + +218 +c�fig +-> +max_k��live + = 65535; + +219 +c�fig +-> +max_�ck�_size + = 0; + +220 +c�fig +-> +max_��ight_mes�ges + = 20; + +221 +c�fig +-> +�rsi��� + = +�l� +; + +222 + `mosqu�to__� +( +c�fig +-> +�rsi���_lo�ti� +); + +223 +c�fig +-> +�rsi���_lo�ti� + = +NULL +; + +224 + `mosqu�to__� +( +c�fig +-> +�rsi���_f�e +); + +225 +c�fig +-> +�rsi���_f�e + = +NULL +; + +226 +c�fig +-> +�rsi��t_���_exp��i� + = 0; + +227 +c�fig +-> +queue_qos0_mes�ges + = +�l� +; + +228 +c�fig +-> +���_ava�ab� + = +�ue +; + +229 +c�fig +-> +�t_t�_nod�ay + = +�l� +; + +230 +c�fig +-> +sys_��rv� + = 10; + +231 +c�fig +-> +upg�de_outgo�g_qos + = +�l� +; + +233 + `c�fig__��nup_�ug�s +( +c�fig +); + +234 + } +} + +237 + $c�fig__��nup_�ug�s +( +mosqu�to__c�fig + * +c�fig +) + +239 +i +, +j +; + +240 +mosqu�to__auth_�ug�_c�fig + * +�ug +; + +242 if( +c�fig +-> +�cur�y_�ti�s +. +auth_�ug�_c�figs +){ + +243 +i +=0; i< +c�fig +-> +�cur�y_�ti�s +. +auth_�ug�_c�fig_cou� +; i++){ + +244 +�ug + = & +c�fig +-> +�cur�y_�ti�s +. +auth_�ug�_c�figs +[ +i +]; + +245 + `mosqu�to__� +( +�ug +-> +�th +); + +246 +�ug +-> +�th + = +NULL +; + +248 if( +�ug +-> +�ti�s +){ + +249 +j +=0; j< +�ug +-> +�ti�_cou� +; j++){ + +250 + `mosqu�to__� +( +�ug +-> +�ti�s +[ +j +]. +key +); + +251 + `mosqu�to__� +( +�ug +-> +�ti�s +[ +j +]. +v�ue +); + +253 + `mosqu�to__� +( +�ug +-> +�ti�s +); + +254 +�ug +-> +�ti�s + = +NULL +; + +255 +�ug +-> +�ti�_cou� + = 0; + +258 + `mosqu�to__� +( +c�fig +-> +�cur�y_�ti�s +. +auth_�ug�_c�figs +); + +259 +c�fig +-> +�cur�y_�ti�s +. +auth_�ug�_c�figs + = +NULL +; + +261 + } +} + +264 + $c�fig__�� +( +mosqu�to_db + * +db +, +mosqu�to__c�fig + * +c�fig +) + +266 + `mem�t +( +c�fig +, 0, ( +mosqu�to__c�fig +)); + +267 + `c�fig__��_�l�d +( +db +, +c�fig +); + +269 +c�fig +-> +d�m� + = +�l� +; + +270 + `mem�t +(& +c�fig +-> +de�u�_li��� +, 0, ( +mosqu�to__li��� +)); + +271 +c�fig +-> +de�u�_li��� +. +max_c���i�s + = -1; + +272 +c�fig +-> +de�u�_li��� +. +��oc� + = +mp_mq� +; + +273 +c�fig +-> +de�u�_li��� +. +�cur�y_�ti�s +. +�low_��ymous + = -1; + +274 +c�fig +-> +de�u�_li��� +. +maximum_qos + = 2; + +275 +c�fig +-> +de�u�_li��� +. +max_t�ic_��s + = 10; + +276 + } +} + +278 + $c�fig__��nup +( +mosqu�to__c�fig + * +c�fig +) + +280 +i +; + +281 #ifde� +WITH_BRIDGE + + +282 +j +; + +285 + `mosqu�to__� +( +c�fig +-> +���id_�efixes +); + +286 + `mosqu�to__� +( +c�fig +-> +�rsi���_lo�ti� +); + +287 + `mosqu�to__� +( +c�fig +-> +�rsi���_f�e +); + +288 + `mosqu�to__� +( +c�fig +-> +�rsi���_f���h +); + +289 + `mosqu�to__� +( +c�fig +-> +�cur�y_�ti�s +. +auto_id_�efix +); + +290 + `mosqu�to__� +( +c�fig +-> +�cur�y_�ti�s +. +a�_f�e +); + +291 + `mosqu�to__� +( +c�fig +-> +�cur�y_�ti�s +. +�ssw�d_f�e +); + +292 + `mosqu�to__� +( +c�fig +-> +�cur�y_�ti�s +. +psk_f�e +); + +293 + `mosqu�to__� +( +c�fig +-> +pid_f�e +); + +294 if( +c�fig +-> +li���s +){ + +295 +i +=0; i< +c�fig +-> +li���_cou� +; i++){ + +296 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +ho� +); + +297 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +b�d_��r�� +); + +298 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +mou�_po�t +); + +299 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +socks +); + +300 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +auto_id_�efix +); + +301 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +a�_f�e +); + +302 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +�ssw�d_f�e +); + +303 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +psk_f�e +); + +304 #ifde� +WITH_TLS + + +305 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +�f�e +); + +306 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +��th +); + +307 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +��f�e +); + +308 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +keyf�e +); + +309 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +c�h�s +); + +310 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +psk_h�t +); + +311 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +�lf�e +); + +312 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +dh��mf�e +); + +313 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +�s_v�si� +); + +314 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +�s_�g�e +); + +315 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +�s_�g�e_k�ss_sha1 +); + +316 #ifde� +WITH_WEBSOCKETS + + +317 if(! +c�fig +-> +li���s +[ +i +]. +ws_cڋxt +) + +320 + `SSL_CTX_� +( +c�fig +-> +li���s +[ +i +]. +s�_�x +); + +323 #ifde� +WITH_WEBSOCKETS + + +324 + `mosqu�to__� +( +c�fig +-> +li���s +[ +i +]. +h�p_d� +); + +327 + `mosqu�to__� +( +c�fig +-> +li���s +); + +329 #ifde� +WITH_BRIDGE + + +330 if( +c�fig +-> +bridges +){ + +331 +i +=0; i< +c�fig +-> +bridge_cou� +; i++){ + +332 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +�me +); + +333 if( +c�fig +-> +bridges +[ +i +]. +add�s�s +){ + +334 +j +=0; j< +c�fig +-> +bridges +[ +i +]. +add�ss_cou� +; j++){ + +335 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +add�s�s +[ +j +]. +add�ss +); + +337 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +add�s�s +); + +339 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +�m�e_���id +); + +340 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +�m�e_u��ame +); + +341 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +�m�e_�ssw�d +); + +342 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +lo�l_���id +); + +343 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +lo�l_u��ame +); + +344 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +lo�l_�ssw�d +); + +345 if( +c�fig +-> +bridges +[ +i +]. +t�ics +){ + +346 +j +=0; j< +c�fig +-> +bridges +[ +i +]. +t�ic_cou� +; j++){ + +347 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +t�ics +[ +j +]. +t�ic +); + +348 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +t�ics +[ +j +]. +lo�l_�efix +); + +349 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +t�ics +[ +j +]. +�m�e_�efix +); + +350 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +t�ics +[ +j +]. +lo�l_t�ic +); + +351 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +t�ics +[ +j +]. +�m�e_t�ic +); + +353 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +t�ics +); + +355 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +n�ifi�ti�_t�ic +); + +356 #ifde� +WITH_TLS + + +357 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +�s_v�si� +); + +358 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +�s_�f�e +); + +359 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +�s_�� +); + +360 #ifde� +FINAL_WITH_TLS_PSK + + +361 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +�s_psk_id�t�y +); + +362 + `mosqu�to__� +( +c�fig +-> +bridges +[ +i +]. +�s_psk +); + +366 + `mosqu�to__� +( +c�fig +-> +bridges +); + +369 + `c�fig__��nup_�ug�s +( +c�fig +); + +371 if( +c�fig +-> +log_� +){ + +372 + `f�o� +( +c�fig +-> +log_� +); + +373 +c�fig +-> +log_� + = +NULL +; + +375 if( +c�fig +-> +log_f�e +){ + +376 + `mosqu�to__� +( +c�fig +-> +log_f�e +); + +377 +c�fig +-> +log_f�e + = +NULL +; + +379 + } +} + +381 + $��t_u�ge +() + +383 + `��tf +("mosqu�t�v�si� %s\n\n", +VERSION +); + +384 + `��tf +("mosquitto is�n MQTT v3.1.1 broker.\n\n"); + +385 + `��tf +("Usage: mosquitto [-c config_file] [-d] [-h] [-p�ort]\n\n"); + +386 + `��tf +(" -c : specify�he broker config file.\n"); + +387 + `��tf +(" -d :�ut�he broker into�he background�fter starting.\n"); + +388 + `��tf +(" -h : display�his help.\n"); + +389 + `��tf +(" -p : start�he broker�istening on�he specified�ort.\n"); + +390 + `��tf +(" Not�ecommended in conjunction with�he -c option.\n"); + +391 + `��tf +(" -v : verbose mode -�nable�ll�ogging�ypes. This overrides\n"); + +392 + `��tf +("�ny�ogging options given in�he config file.\n"); + +393 + `��tf +("\nSee http://mosquitto.org/ for more information.\n\n"); + +394 + } +} + +396 + $c�fig__�r�_�gs +( +mosqu�to_db + * +db +, +mosqu�to__c�fig + * +c�fig +, +�gc +, * +�gv +[]) + +398 +i +; + +399 +p�t_tmp +; + +401 +i +=1; i< +�gc +; i++){ + +402 if(! + `�rcmp +( +�gv +[ +i +], "-c") || !strcmp(argv[i], "--config-file")){ + +403 if( +i +< +�gc +-1){ + +404 +db +-> +c�fig_f�e + = +�gv +[ +i ++1]; + +406 if( + `c�fig__�ad +( +db +, +c�fig +, +�l� +)){ + +407 +MOSQ_ERR_INVAL +; + +410 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: -c�rgument given, but�o config file specified."); + +411 +MOSQ_ERR_INVAL +; + +413 +i +++; + +414 }if(! + `�rcmp +( +�gv +[ +i +], "-d") || !strcmp(argv[i], "--daemon")){ + +415 +c�fig +-> +d�m� + = +�ue +; + +416 }if(! + `�rcmp +( +�gv +[ +i +], "-h") || !strcmp(argv[i], "--help")){ + +417 + `��t_u�ge +(); + +418 +MOSQ_ERR_INVAL +; + +419 }if(! + `�rcmp +( +�gv +[ +i +], "-p") || !strcmp(argv[i], "--port")){ + +420 if( +i +< +�gc +-1){ + +421 +p�t_tmp + = + `�oi +( +�gv +[ +i ++1]); + +422 if( +p�t_tmp +<1 ||�ort_tmp>65535){ + +423 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id�܈�ecif�d (%d).", +p�t_tmp +); + +424 +MOSQ_ERR_INVAL +; + +426 if( +c�fig +-> +de�u�_li��� +. +p�t +){ + +427 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Default�istener�ort specified multiple�imes. Only�he�atest will be used."); + +429 +c�fig +-> +de�u�_li��� +. +p�t + = +p�t_tmp +; + +432 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: -p�rgument given, but�o�ort specified."); + +433 +MOSQ_ERR_INVAL +; + +435 +i +++; + +436 }if(! + `�rcmp +( +�gv +[ +i +], "-v") || !strcmp(argv[i], "--verbose")){ + +437 +db +-> +v�bo� + = +�ue +; + +439 + `�r�tf +( +�d�r +, "E��: Unknow��ti� '%s'.\n", +�gv +[ +i +]); + +440 + `��t_u�ge +(); + +441 +MOSQ_ERR_INVAL +; + +445 if( +c�fig +-> +li���_cou� + == 0 + +446 #ifde� +WITH_TLS + + +447 || +c�fig +-> +de�u�_li��� +. +�f�e + + +448 || +c�fig +-> +de�u�_li��� +. +��th + + +449 || +c�fig +-> +de�u�_li��� +. +��f�e + + +450 || +c�fig +-> +de�u�_li��� +. +keyf�e + + +451 || +c�fig +-> +de�u�_li��� +. +�s_�g�e + + +452 || +c�fig +-> +de�u�_li��� +. +�s_keyf�m + !� +mosq_k_�m + + +453 || +c�fig +-> +de�u�_li��� +. +�s_�g�e_k�ss_sha1 + + +454 || +c�fig +-> +de�u�_li��� +. +c�h�s + + +455 || +c�fig +-> +de�u�_li��� +. +dh��mf�e + + +456 || +c�fig +-> +de�u�_li��� +. +psk_h�t + + +457 || +c�fig +-> +de�u�_li��� +. +�qu�e_��ifi�� + + +458 || +c�fig +-> +de�u�_li��� +. +�lf�e + + +459 || +c�fig +-> +de�u�_li��� +. +u�_id�t�y_as_u��ame + + +460 || +c�fig +-> +de�u�_li��� +. +u�_subje�_as_u��ame + + +462 || +c�fig +-> +de�u�_li��� +. +u�_u��ame_as_���id + + +463 || +c�fig +-> +de�u�_li��� +. +ho� + + +464 || +c�fig +-> +de�u�_li��� +. +p�t + + +465 || +c�fig +-> +de�u�_li��� +. +max_c���i�s + != -1 + +466 || +c�fig +-> +de�u�_li��� +. +maximum_qos + != 2 + +467 || +c�fig +-> +de�u�_li��� +. +mou�_po�t + + +468 || +c�fig +-> +de�u�_li��� +. +��oc� + !� +mp_mq� + + +469 || +c�fig +-> +de�u�_li��� +. +sock�_doma� + + +470 || +c�fig +-> +de�u�_li��� +. +�cur�y_�ti�s +. +�ssw�d_f�e + + +471 || +c�fig +-> +de�u�_li��� +. +�cur�y_�ti�s +. +psk_f�e + + +472 || +c�fig +-> +de�u�_li��� +. +�cur�y_�ti�s +. +auth_�ug�_c�fig_cou� + + +473 || +c�fig +-> +de�u�_li��� +. +�cur�y_�ti�s +. +�low_��ymous + != -1 + +476 +c�fig +-> +li���_cou� +++; + +477 +c�fig +-> +li���s + = + `mosqu�to__��loc +(c�fig->li���s, ( +mosqu�to__li��� +)*c�fig-> +li���_cou� +); + +478 if(! +c�fig +-> +li���s +){ + +479 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +480 +MOSQ_ERR_NOMEM +; + +482 + `mem�t +(& +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1], 0, ( +mosqu�to__li��� +)); + +483 if( +c�fig +-> +de�u�_li��� +. +p�t +){ + +484 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +p�t + = c�fig-> +de�u�_li��� +.port; + +486 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +p�t + = 1883; + +488 if( +c�fig +-> +de�u�_li��� +. +ho� +){ + +489 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +ho� + = c�fig-> +de�u�_li��� +.host; + +491 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +ho� + = +NULL +; + +493 if( +c�fig +-> +de�u�_li��� +. +mou�_po�t +){ + +494 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +mou�_po�t + = c�fig-> +de�u�_li��� +.mount_point; + +496 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +mou�_po�t + = +NULL +; + +498 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +max_c���i�s + = c�fig-> +de�u�_li��� +.max_connections; + +499 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +��oc� + = c�fig-> +de�u�_li��� +.protocol; + +500 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +sock�_doma� + = c�fig-> +de�u�_li��� +.socket_domain; + +501 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +���_cou� + = 0; + +502 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +socks + = +NULL +; + +503 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +sock_cou� + = 0; + +504 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +���_cou� + = 0; + +505 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +u�_u��ame_as_���id + = c�fig-> +de�u�_li��� +.use_username_as_clientid; + +506 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +maximum_qos + = c�fig-> +de�u�_li��� +.maximum_qos; + +507 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +max_t�ic_��s + = c�fig-> +de�u�_li��� +.max_topic_alias; + +508 #ifde� +WITH_TLS + + +509 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +�s_v�si� + = c�fig-> +de�u�_li��� +.tls_version; + +510 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +�s_�g�e + = c�fig-> +de�u�_li��� +.tls_engine; + +511 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +�s_keyf�m + = c�fig-> +de�u�_li��� +.tls_keyform; + +512 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +�s_�g�e_k�ss_sha1 + = c�fig-> +de�u�_li��� +.tls_engine_kpass_sha1; + +513 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +�f�e + = c�fig-> +de�u�_li��� +.cafile; + +514 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +��th + = c�fig-> +de�u�_li��� +.capath; + +515 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +��f�e + = c�fig-> +de�u�_li��� +.certfile; + +516 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +keyf�e + = c�fig-> +de�u�_li��� +.keyfile; + +517 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +c�h�s + = c�fig-> +de�u�_li��� +.ciphers; + +518 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +dh��mf�e + = c�fig-> +de�u�_li��� +.dhparamfile; + +519 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +psk_h�t + = c�fig-> +de�u�_li��� +.psk_hint; + +520 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +�qu�e_��ifi�� + = c�fig-> +de�u�_li��� +.require_certificate; + +521 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +s�_�x + = +NULL +; + +522 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +�lf�e + = c�fig-> +de�u�_li��� +.crlfile; + +523 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +u�_id�t�y_as_u��ame + = c�fig-> +de�u�_li��� +.use_identity_as_username; + +524 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +u�_subje�_as_u��ame + = c�fig-> +de�u�_li��� +.use_subject_as_username; + +526 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +�cur�y_�ti�s +. +a�_f�e + = c�fig-> +de�u�_li��� +.security_options.acl_file; + +527 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +�cur�y_�ti�s +. +�ssw�d_f�e + = c�fig-> +de�u�_li��� +.security_options.password_file; + +528 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +�cur�y_�ti�s +. +psk_f�e + = c�fig-> +de�u�_li��� +.security_options.psk_file; + +529 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +�cur�y_�ti�s +. +auth_�ug�_c�figs + = c�fig-> +de�u�_li��� +.security_options.auth_plugin_configs; + +530 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +�cur�y_�ti�s +. +auth_�ug�_c�fig_cou� + = c�fig-> +de�u�_li��� +.security_options.auth_plugin_config_count; + +531 +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]. +�cur�y_�ti�s +. +�low_��ymous + = c�fig-> +de�u�_li��� +.security_options.allow_anonymous; + +535 if(! +c�fig +-> +u�r +){ + +536 +c�fig +-> +u�r + = "mosquitto"; + +538 if( +db +-> +v�bo� +){ + +539 +c�fig +-> +log_ty� + = +INT_MAX +; + +541 + `c�fig__check +( +c�fig +); + +542 + } +} + +544 + $c�fig__c�y +( +mosqu�to__c�fig + * +�c +, mosqu�to__c�fig * +de� +) + +546 + `mosqu�to__� +( +de� +-> +�cur�y_�ti�s +. +a�_f�e +); + +547 +de� +-> +�cur�y_�ti�s +. +a�_f�e + = +�c +->security_options.acl_file; + +549 +de� +-> +�cur�y_�ti�s +. +�low_��ymous + = +�c +->security_options.allow_anonymous; + +550 +de� +-> +�cur�y_�ti�s +. +�low_z�o_�ngth_���id + = +�c +->security_options.allow_zero_length_clientid; + +552 + `mosqu�to__� +( +de� +-> +�cur�y_�ti�s +. +auto_id_�efix +); + +553 +de� +-> +�cur�y_�ti�s +. +auto_id_�efix + = +�c +->security_options.auto_id_prefix; + +554 +de� +-> +�cur�y_�ti�s +. +auto_id_�efix_�n + = +�c +->security_options.auto_id_prefix_len; + +556 + `mosqu�to__� +( +de� +-> +�cur�y_�ti�s +. +�ssw�d_f�e +); + +557 +de� +-> +�cur�y_�ti�s +. +�ssw�d_f�e + = +�c +->security_options.password_file; + +559 + `mosqu�to__� +( +de� +-> +�cur�y_�ti�s +. +psk_f�e +); + +560 +de� +-> +�cur�y_�ti�s +. +psk_f�e + = +�c +->security_options.psk_file; + +563 +de� +-> +�low_du�i��_mes�ges + = +�c +->allow_duplicate_messages; + +566 +de� +-> +auto�ve_��rv� + = +�c +->autosave_interval; + +567 +de� +-> +auto�ve_�_ch�ges + = +�c +->autosave_on_changes; + +569 + `mosqu�to__� +( +de� +-> +���id_�efixes +); + +570 +de� +-> +���id_�efixes + = +�c +->clientid_prefixes; + +572 +de� +-> +c���i�_mes�ges + = +�c +->connection_messages; + +573 +de� +-> +log_de� + = +�c +->log_dest; + +574 +de� +-> +log_�c��y + = +�c +->log_facility; + +575 +de� +-> +log_ty� + = +�c +->log_type; + +576 +de� +-> +log_time�amp + = +�c +->log_timestamp; + +578 + `mosqu�to__� +( +de� +-> +log_time�amp_f�m� +); + +579 +de� +-> +log_time�amp_f�m� + = +�c +->log_timestamp_format; + +581 + `mosqu�to__� +( +de� +-> +log_f�e +); + +582 +de� +-> +log_f�e + = +�c +->log_file; + +584 +de� +-> +mes�ge_size_lim� + = +�c +->message_size_limit; + +586 +de� +-> +�rsi��� + = +�c +->persistence; + +588 + `mosqu�to__� +( +de� +-> +�rsi���_lo�ti� +); + +589 +de� +-> +�rsi���_lo�ti� + = +�c +->persistence_location; + +591 + `mosqu�to__� +( +de� +-> +�rsi���_f�e +); + +592 +de� +-> +�rsi���_f�e + = +�c +->persistence_file; + +594 + `mosqu�to__� +( +de� +-> +�rsi���_f���h +); + +595 +de� +-> +�rsi���_f���h + = +�c +->persistence_filepath; + +597 +de� +-> +�rsi��t_���_exp��i� + = +�c +->persistent_client_expiration; + +600 +de� +-> +queue_qos0_mes�ges + = +�c +->queue_qos0_messages; + +601 +de� +-> +sys_��rv� + = +�c +->sys_interval; + +602 +de� +-> +upg�de_outgo�g_qos + = +�c +->upgrade_outgoing_qos; + +604 #ifde� +WITH_WEBSOCKETS + + +605 +de� +-> +websock�s_log_�v� + = +�c +->websockets_log_level; + +607 + } +} + +610 + $c�fig__�ad +( +mosqu�to_db + * +db +, +mosqu�to__c�fig + * +c�fig +, +bo� + +�l�d +) + +612 +rc + = +MOSQ_ERR_SUCCESS +; + +613 +c�fig_�cur� + +� +; + +614 +l��o + = 0; + +615 #ifde� +WITH_PERSISTENCE + + +616 +�n +; + +618 +mosqu�to__c�fig + +c�fig_�l�d +; + +619 +mosqu�to__auth_�ug� + * +�ug� +; + +620 +i +, +j +; + +622 if( +�l�d +){ + +623 + `mem�t +(& +c�fig_�l�d +, 0, ( +mosqu�to__c�fig +)); + +626 +� +. +log_de� + = +MQTT3_LOG_NONE +; + +627 +� +. +log_de�_�t + = 0; + +628 +� +. +log_ty� + = +MOSQ_LOG_NONE +; + +629 +� +. +log_ty�_�t + = 0; + +630 +� +. +max_��ight_by�s + = 0; + +631 +� +. +max_queued_by�s + = 0; + +632 +� +. +max_queued_mes�ges + = 100; + +634 if(! +db +-> +c�fig_f�e +) 0; + +636 if( +�l�d +){ + +638 + `c�fig__��_�l�d +( +db +, & +c�fig_�l�d +); + +639 +c�fig_�l�d +. +li���s + = +c�fig +->listeners; + +640 +c�fig_�l�d +. +li���_cou� + = +c�fig +->listener_count; + +641 +rc + = + `c�fig__�ad_f�e +(& +c�fig_�l�d +, +�l�d +, +db +-> +c�fig_f�e +, & +� +, 0, & +l��o +); + +643 +rc + = + `c�fig__�ad_f�e +( +c�fig +, +�l�d +, +db +-> +c�fig_f�e +, & +� +, 0, & +l��o +); + +645 if( +rc +){ + +646 if( +l��o + > 0){ + +647 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� found��%s:%d.", +db +-> +c�fig_f�e +, +l��o +); + +649 +rc +; + +652 if( +�l�d +){ + +653 + `c�fig__c�y +(& +c�fig_�l�d +, +c�fig +); + +657 if( +c�fig +-> +�r_li���_���gs +){ + +658 +i +=0; i< +c�fig +-> +li���_cou� +; i++){ + +659 if( +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +�low_��ymous + == -1){ + +661 +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +�low_��ymous + = +�ue +; + +663 if( +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +�ssw�d_f�e + + +664 || +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +psk_f�e +){ + +669 +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +�low_��ymous + = +�l� +; + +673 +j +=0; j< +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +auth_�ug�_c�fig_cou� +; j++){ + +674 +�ug� + = & +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +auth_�ug�_c�figs +[ +j +].plugin; + +676 if( +�ug� +-> +v�si� + == 3 ||�lugin->version == 2){ + +678 +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +�low_��ymous + = +�l� +; + +682 if( +�ug� +-> +u�wd_check_v4 + !� +NULL +){ + +683 +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +�low_��ymous + = +�l� +; + +691 if( +c�fig +-> +�cur�y_�ti�s +. +�low_��ymous + == -1){ + +693 +c�fig +-> +�cur�y_�ti�s +. +�low_��ymous + = +�ue +; + +695 if( +c�fig +-> +�cur�y_�ti�s +. +�ssw�d_f�e + + +696 || +c�fig +-> +�cur�y_�ti�s +. +psk_f�e +){ + +701 +c�fig +-> +�cur�y_�ti�s +. +�low_��ymous + = +�l� +; + +705 +j +=0; j< +c�fig +-> +�cur�y_�ti�s +. +auth_�ug�_c�fig_cou� +; j++){ + +706 +�ug� + = & +c�fig +-> +�cur�y_�ti�s +. +auth_�ug�_c�figs +[ +j +].plugin; + +708 if( +�ug� +-> +v�si� + == 3 ||�lugin->version == 2){ + +710 +c�fig +-> +�cur�y_�ti�s +. +�low_��ymous + = +�l� +; + +714 if( +�ug� +-> +u�wd_check_v4 + !� +NULL +){ + +715 +c�fig +-> +�cur�y_�ti�s +. +�low_��ymous + = +�l� +; + +722 #ifde� +WITH_PERSISTENCE + + +723 if( +c�fig +-> +�rsi��� +){ + +724 if(! +c�fig +-> +�rsi���_f�e +){ + +725 +c�fig +-> +�rsi���_f�e + = + `mosqu�to__�rdup +("mosquitto.db"); + +726 if(! +c�fig +-> +�rsi���_f�e +� +MOSQ_ERR_NOMEM +; + +728 + `mosqu�to__� +( +c�fig +-> +�rsi���_f���h +); + +729 if( +c�fig +-> +�rsi���_lo�ti� + && + `��� +(config->persistence_location)){ + +730 +�n + = + `��� +( +c�fig +-> +�rsi���_lo�ti� +�+ s��n(c�fig-> +�rsi���_f�e +) + 1; + +731 +c�fig +-> +�rsi���_f���h + = + `mosqu�to__m�loc +( +�n +); + +732 if(! +c�fig +-> +�rsi���_f���h +� +MOSQ_ERR_NOMEM +; + +733 + `���tf +( +c�fig +-> +�rsi���_f���h +, +�n +, "%s%s", c�fig-> +�rsi���_lo�ti� +, c�fig-> +�rsi���_f�e +); + +735 +c�fig +-> +�rsi���_f���h + = + `mosqu�to__�rdup +(c�fig-> +�rsi���_f�e +); + +736 if(! +c�fig +-> +�rsi���_f���h +� +MOSQ_ERR_NOMEM +; + +743 if(! +c�fig +-> +u�r +){ + +744 +c�fig +-> +u�r + = "mosquitto"; + +747 + `db__lim�s_�t +( +� +. +max_��ight_by�s +, cr. +max_queued_mes�ges +, cr. +max_queued_by�s +); + +749 #ifde� +WITH_BRIDGE + + +750 +i +=0; i< +c�fig +-> +bridge_cou� +; i++){ + +751 if(! +c�fig +-> +bridges +[ +i +]. +�me + || !c�fig->bridges[i]. +add�s�s + || !c�fig->bridges[i]. +t�ic_cou� +){ + +752 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +753 +MOSQ_ERR_INVAL +; + +755 #ifde� +FINAL_WITH_TLS_PSK + + +756 if( +c�fig +-> +bridges +[ +i +]. +�s_psk + && !c�fig->bridges[i]. +�s_psk_id�t�y +){ + +757 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration: missing bridge_identity."); + +758 +MOSQ_ERR_INVAL +; + +760 if( +c�fig +-> +bridges +[ +i +]. +�s_psk_id�t�y + && !c�fig->bridges[i]. +�s_psk +){ + +761 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration: missing bridge_psk."); + +762 +MOSQ_ERR_INVAL +; + +768 if( +� +. +log_de�_�t +){ + +769 +c�fig +-> +log_de� + = +� +.log_dest; + +771 if( +db +-> +v�bo� +){ + +772 +c�fig +-> +log_ty� + = +INT_MAX +; + +773 }if( +� +. +log_ty�_�t +){ + +774 +c�fig +-> +log_ty� + = +� +.log_type; + +776 +MOSQ_ERR_SUCCESS +; + +777 + } +} + +779 + $c�fig__�ad_f�e_c�e +( +mosqu�to__c�fig + * +c�fig +, +bo� + +�l�d +, +c�fig_�cur� + * +� +, +�v� +, * +l��o +, +FILE + * +� +, ** +buf +, * +bu� +) + +781 +rc +; + +782 * +tok� +; + +783 +tmp_�t +; + +784 * +�v�� + = +NULL +; + +785 #ifde� +WITH_BRIDGE + + +786 * +tmp_ch� +; + +787 +mosqu�to__bridge + * +cur_bridge + = +NULL +; + +788 +mosqu�to__bridge_t�ic + * +cur_t�ic +; + +789 +�n +; + +791 +mosqu�to__auth_�ug�_c�fig + * +cur_auth_�ug�_c�fig + = +NULL +; + +793 +time_t + +exp��i�_mu� +; + +794 * +key +; + +795 +mosqu�to__li��� + * +cur_li��� + = & +c�fig +-> +de�u�_li��� +; + +796 +i +; + +797 +l��o_ext + = 0; + +799 * +l��o + = 0; + +801 + `fg�s_ex�nd�g +( +buf +, +bu� +, +� +)){ + +802 (* +l��o +)++; + +803 if((* +buf +)[0] != '#' && (*buf)[0] != 10 && (*buf)[0] != 13){ + +804 (* +buf +)[ + `��� +((*buf))-1] == 10 || (*buf)[strlen((*buf))-1] == 13){ + +805 (* +buf +)[ + `��� +((*buf))-1] = 0; + +807 +tok� + = + `��ok_r +((* +buf +), " ", & +�v�� +); + +808 if( +tok� +){ + +809 if(! + `�rcmp +( +tok� +, "acl_file")){ + +810 + `c�f__�t_cur_�cur�y_�ti�s +( +c�fig +, +cur_li��� +, & +cur_�cur�y_�ti�s +); + +811 if( +�l�d +){ + +812 + `mosqu�to__� +( +cur_�cur�y_�ti�s +-> +a�_f�e +); + +813 +cur_�cur�y_�ti�s +-> +a�_f�e + = +NULL +; + +815 if( + `c�f__�r�_�r�g +(& +tok� +, "a�_f�e", & +cur_�cur�y_�ti�s +-> +a�_f�e +, +�v�� +)� +MOSQ_ERR_INVAL +; + +816 }if(! + `�rcmp +( +tok� +, "address") || !strcmp(token, "addresses")){ + +817 #ifde� +WITH_BRIDGE + + +818 if( +�l�d +) ; + +819 if(! +cur_bridge + || cur_bridge-> +add�s�s +){ + +820 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +821 +MOSQ_ERR_INVAL +; + +823 ( +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +))){ + +824 i�( +tok� +[0] == '#'){ + +827 +cur_bridge +-> +add�ss_cou� +++; + +828 +cur_bridge +-> +add�s�s + = + `mosqu�to__��loc +(cur_bridge->add�s�s, ( +bridge_add�ss +)*cur_bridge-> +add�ss_cou� +); + +829 if(! +cur_bridge +-> +add�s�s +){ + +830 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +831 +MOSQ_ERR_NOMEM +; + +833 +cur_bridge +-> +add�s�s +[cur_bridge-> +add�ss_cou� +-1]. +add�ss + = +tok� +; + +835 +i +=0; i< +cur_bridge +-> +add�ss_cou� +; i++){ + +840 +tmp_ch� + = + `��chr +( +cur_bridge +-> +add�s�s +[ +i +]. +add�ss +, ':'); + +841 if( +tmp_ch� +){ + +844 +tmp_ch� +[0] = '\0'; + +847 +tmp_�t + = + `�oi +(& +tmp_ch� +[1]); + +848 if( +tmp_�t + < 1 ||�mp_int > 65535){ + +849 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id�܈v�u�(%d).", +tmp_�t +); + +850 +MOSQ_ERR_INVAL +; + +852 +cur_bridge +-> +add�s�s +[ +i +]. +p�t + = +tmp_�t +; + +854 +cur_bridge +-> +add�s�s +[ +i +]. +p�t + = 1883; + +861 +cur_bridge +-> +add�s�s +[ +i +]. +add�ss + = + `mosqu�to__�rdup +(cur_bridge->addresses[i].address); + +862 + `c�f__��m�_�s�ve +( +cur_bridge +-> +add�s�s +[ +i +]. +add�ss +, "bridg�add�ss", +MOSQ_LOG_WARNING +, "Warning"); + +864 if( +cur_bridge +-> +add�ss_cou� + == 0){ + +865 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Empty�ddress value in configuration."); + +866 +MOSQ_ERR_INVAL +; + +869 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +871 }if(! + `�rcmp +( +tok� +, "allow_anonymous")){ + +872 + `c�f__�t_cur_�cur�y_�ti�s +( +c�fig +, +cur_li��� +, & +cur_�cur�y_�ti�s +); + +873 if( + `c�f__�r�_bo� +(& +tok� +, "�low_��ymous", ( +bo� + *)& +cur_�cur�y_�ti�s +-> +�low_��ymous +, +�v�� +)� +MOSQ_ERR_INVAL +; + +874 }if(! + `�rcmp +( +tok� +, "allow_duplicate_messages")){ + +875 if( + `c�f__�r�_bo� +(& +tok� +, "�low_du�i��_mes�ges", & +c�fig +-> +�low_du�i��_mes�ges +, +�v�� +)� +MOSQ_ERR_INVAL +; + +876 }if(! + `�rcmp +( +tok� +, "allow_zero_length_clientid")){ + +877 + `c�f__�t_cur_�cur�y_�ti�s +( +c�fig +, +cur_li��� +, & +cur_�cur�y_�ti�s +); + +878 if( + `c�f__�r�_bo� +(& +tok� +, "�low_z�o_�ngth_���id", & +cur_�cur�y_�ti�s +-> +�low_z�o_�ngth_���id +, +�v�� +)� +MOSQ_ERR_INVAL +; + +879 }if(! + `��cmp +( +tok� +, "auth_opt_", 9)){ + +880 if( +�l�d +) ; + +881 if(! +cur_auth_�ug�_c�fig +){ + +882 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: An�uth_opt_ option�xists in�he config file without�n�uth_plugin."); + +883 +MOSQ_ERR_INVAL +; + +885 if( + `��� +( +tok� +) < 12){ + +887 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid�uth_opt_ config option."); + +888 +MOSQ_ERR_INVAL +; + +890 +key + = + `mosqu�to__�rdup +(& +tok� +[9]); + +891 if(! +key +){ + +892 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +893 +MOSQ_ERR_NOMEM +; + +894 }if( + `STREMPTY +( +key +)){ + +895 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid�uth_opt_ config option."); + +896 + `mosqu�to__� +( +key +); + +897 +MOSQ_ERR_INVAL +; + +899 +tok� + +�9+ + `��� +( +key +)+1; + +900 +tok� +[0] == ' ' ||�oken[0] == '\t'){ + +901 +tok� +++; + +903 if( +tok� +[0]){ + +904 +cur_auth_�ug�_c�fig +-> +�ti�_cou� +++; + +905 +cur_auth_�ug�_c�fig +-> +�ti�s + = + `mosqu�to__��loc +(cur_auth_�ug�_c�fig->�ti�s, cur_auth_�ug�_c�fig-> +�ti�_cou� +*( +mosqu�to_auth_�t +)); + +906 if(! +cur_auth_�ug�_c�fig +-> +�ti�s +){ + +907 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +908 + `mosqu�to__� +( +key +); + +909 +MOSQ_ERR_NOMEM +; + +911 +cur_auth_�ug�_c�fig +-> +�ti�s +[cur_auth_�ug�_c�fig-> +�ti�_cou� +-1]. +key + = key; + +912 +cur_auth_�ug�_c�fig +-> +�ti�s +[cur_auth_�ug�_c�fig-> +�ti�_cou� +-1]. +v�ue + = + `mosqu�to__�rdup +( +tok� +); + +913 if(! +cur_auth_�ug�_c�fig +-> +�ti�s +[cur_auth_�ug�_c�fig-> +�ti�_cou� +-1]. +v�ue +){ + +914 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +915 +MOSQ_ERR_NOMEM +; + +918 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Em�y %�v�u�� c�figu�ti�.", +key +); + +919 + `mosqu�to__� +( +key +); + +920 +MOSQ_ERR_INVAL +; + +922 }if(! + `�rcmp +( +tok� +, "auth_plugin")){ + +923 if( +�l�d +) ; + +924 + `c�f__�t_cur_�cur�y_�ti�s +( +c�fig +, +cur_li��� +, & +cur_�cur�y_�ti�s +); + +925 +cur_�cur�y_�ti�s +-> +auth_�ug�_c�figs + = + `mosqu�to__��loc +(cur_�cur�y_�ti�s->auth_�ug�_c�figs, (cur_�cur�y_�ti�s-> +auth_�ug�_c�fig_cou� ++1)*( +mosqu�to__auth_�ug�_c�fig +)); + +926 if(! +cur_�cur�y_�ti�s +-> +auth_�ug�_c�figs +){ + +927 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +928 +MOSQ_ERR_NOMEM +; + +930 +cur_auth_�ug�_c�fig + = & +cur_�cur�y_�ti�s +-> +auth_�ug�_c�figs +[cur_�cur�y_�ti�s-> +auth_�ug�_c�fig_cou� +]; + +931 + `mem�t +( +cur_auth_�ug�_c�fig +, 0, ( +mosqu�to__auth_�ug�_c�fig +)); + +932 +cur_auth_�ug�_c�fig +-> +�th + = +NULL +; + +933 +cur_auth_�ug�_c�fig +-> +�ti�s + = +NULL +; + +934 +cur_auth_�ug�_c�fig +-> +�ti�_cou� + = 0; + +935 +cur_auth_�ug�_c�fig +-> +d�y_�ec�l_ch�s + = +�ue +; + +936 +cur_�cur�y_�ti�s +-> +auth_�ug�_c�fig_cou� +++; + +937 if( + `c�f__�r�_�r�g +(& +tok� +, "auth_�ug�", & +cur_auth_�ug�_c�fig +-> +�th +, +�v�� +)� +MOSQ_ERR_INVAL +; + +938 }if(! + `�rcmp +( +tok� +, "auth_plugin_deny_special_chars")){ + +939 if( +�l�d +) ; + +940 if(! +cur_auth_�ug�_c�fig +){ + +941 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: An�uth_plugin_deny_special_chars option�xists in�he config file without�n�uth_plugin."); + +942 +MOSQ_ERR_INVAL +; + +944 if( + `c�f__�r�_bo� +(& +tok� +, "auth_�ug�_d�y_�ec�l_ch�s", & +cur_auth_�ug�_c�fig +-> +d�y_�ec�l_ch�s +, +�v�� +)� +MOSQ_ERR_INVAL +; + +945 }if(! + `�rcmp +( +tok� +, "auto_id_prefix")){ + +946 + `c�f__�t_cur_�cur�y_�ti�s +( +c�fig +, +cur_li��� +, & +cur_�cur�y_�ti�s +); + +947 if( + `c�f__�r�_�r�g +(& +tok� +, "auto_id_�efix", & +cur_�cur�y_�ti�s +-> +auto_id_�efix +, +�v�� +)� +MOSQ_ERR_INVAL +; + +948 if( +cur_�cur�y_�ti�s +-> +auto_id_�efix +){ + +949 +cur_�cur�y_�ti�s +-> +auto_id_�efix_�n + = + `��� +(cur_�cur�y_�ti�s-> +auto_id_�efix +); + +951 +cur_�cur�y_�ti�s +-> +auto_id_�efix_�n + = 0; + +953 }if(! + `�rcmp +( +tok� +, "autosave_interval")){ + +954 if( + `c�f__�r�_�t +(& +tok� +, "auto�ve_��rv�", & +c�fig +-> +auto�ve_��rv� +, +�v�� +)� +MOSQ_ERR_INVAL +; + +955 if( +c�fig +-> +auto�ve_��rv� + < 0) config->autosave_interval = 0; + +956 }if(! + `�rcmp +( +tok� +, "autosave_on_changes")){ + +957 if( + `c�f__�r�_bo� +(& +tok� +, "auto�ve_�_ch�ges", & +c�fig +-> +auto�ve_�_ch�ges +, +�v�� +)� +MOSQ_ERR_INVAL +; + +958 }if(! + `�rcmp +( +tok� +, "bind_address")){ + +959 if( +�l�d +) ; + +960 if( + `c�f__�r�_�r�g +(& +tok� +, "de�uɆi��� b�d_add�ss", & +c�fig +-> +de�u�_li��� +. +ho� +, +�v�� +)� +MOSQ_ERR_INVAL +; + +961 if( + `c�f__��m�_�s�ve +( +c�fig +-> +de�u�_li��� +. +ho� +, "b�d_add�ss", +MOSQ_LOG_ERR +, "Error")){ + +962 +MOSQ_ERR_INVAL +; + +964 }if(! + `�rcmp +( +tok� +, "bind_interface")){ + +965 #ifde� +SO_BINDTODEVICE + + +966 if( +�l�d +) ; + +967 if( + `c�f__�r�_�r�g +(& +tok� +, "b�d_��r��", & +cur_li��� +-> +b�d_��r�� +, +�v�� +)� +MOSQ_ERR_INVAL +; + +969 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: bind_interface specified but socket option�ot�vailable."); + +970 +MOSQ_ERR_INVAL +; + +972 }if(! + `�rcmp +( +tok� +, "bridge_attempt_unsubscribe")){ + +973 #ifde� +WITH_BRIDGE + + +974 if( +�l�d +) ; + +975 if(! +cur_bridge +){ + +976 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +977 +MOSQ_ERR_INVAL +; + +979 if( + `c�f__�r�_bo� +(& +tok� +, "bridge_��m�_unsubs�ibe", & +cur_bridge +-> +��m�_unsubs�ibe +, +�v�� +)� +MOSQ_ERR_INVAL +; + +981 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +983 }if(! + `�rcmp +( +tok� +, "bridge_cafile")){ + +984 #i� + `def�ed +( +WITH_BRIDGE +�&& def�ed( +WITH_TLS +) + +985 if( +�l�d +) ; + +986 if(! +cur_bridge +){ + +987 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +988 +MOSQ_ERR_INVAL +; + +990 #ifde� +FINAL_WITH_TLS_PSK + + +991 if( +cur_bridge +-> +�s_psk_id�t�y + || cur_bridge-> +�s_psk +){ + +992 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Cannot use both certificate�nd�sk�ncryption in� single bridge."); + +993 +MOSQ_ERR_INVAL +; + +996 if( + `c�f__�r�_�r�g +(& +tok� +, "bridge_�f�e", & +cur_bridge +-> +�s_�f�e +, +�v�� +)� +MOSQ_ERR_INVAL +; + +998 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge�nd/or TLS support�ot�vailable."); + +1000 }if(! + `�rcmp +( +tok� +, "bridge_alpn")){ + +1001 #i� + `def�ed +( +WITH_BRIDGE +�&& def�ed( +WITH_TLS +) + +1002 if( +�l�d +) ; + +1003 if(! +cur_bridge +){ + +1004 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1005 +MOSQ_ERR_INVAL +; + +1007 if( + `c�f__�r�_�r�g +(& +tok� +, "bridge_��", & +cur_bridge +-> +�s_�� +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1009 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge�nd/or TLS support�ot�vailable."); + +1011 }if(! + `�rcmp +( +tok� +, "bridge_capath")){ + +1012 #i� + `def�ed +( +WITH_BRIDGE +�&& def�ed( +WITH_TLS +) + +1013 if( +�l�d +) ; + +1014 if(! +cur_bridge +){ + +1015 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1016 +MOSQ_ERR_INVAL +; + +1018 #ifde� +FINAL_WITH_TLS_PSK + + +1019 if( +cur_bridge +-> +�s_psk_id�t�y + || cur_bridge-> +�s_psk +){ + +1020 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Cannot use both certificate�nd�sk�ncryption in� single bridge."); + +1021 +MOSQ_ERR_INVAL +; + +1024 if( + `c�f__�r�_�r�g +(& +tok� +, "bridge_��th", & +cur_bridge +-> +�s_��th +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1026 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge�nd/or TLS support�ot�vailable."); + +1028 }if(! + `�rcmp +( +tok� +, "bridge_certfile")){ + +1029 #i� + `def�ed +( +WITH_BRIDGE +�&& def�ed( +WITH_TLS +) + +1030 if( +�l�d +) ; + +1031 if(! +cur_bridge +){ + +1032 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1033 +MOSQ_ERR_INVAL +; + +1035 #ifde� +FINAL_WITH_TLS_PSK + + +1036 if( +cur_bridge +-> +�s_psk_id�t�y + || cur_bridge-> +�s_psk +){ + +1037 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Cannot use both certificate�nd�sk�ncryption in� single bridge."); + +1038 +MOSQ_ERR_INVAL +; + +1041 if( + `c�f__�r�_�r�g +(& +tok� +, "bridge_��f�e", & +cur_bridge +-> +�s_��f�e +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1043 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge�nd/or TLS support�ot�vailable."); + +1045 }if(! + `�rcmp +( +tok� +, "bridge_identity")){ + +1046 #i� + `def�ed +( +WITH_BRIDGE +�&& def�ed( +FINAL_WITH_TLS_PSK +) + +1047 if( +�l�d +) ; + +1048 if(! +cur_bridge +){ + +1049 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1050 +MOSQ_ERR_INVAL +; + +1052 if( +cur_bridge +-> +�s_�f�e + || cur_bridge-> +�s_��th + || cur_bridge-> +�s_��f�e + || cur_bridge-> +�s_keyf�e +){ + +1053 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Cannot use both certificate�nd identity�ncryption in� single bridge."); + +1054 +MOSQ_ERR_INVAL +; + +1056 if( + `c�f__�r�_�r�g +(& +tok� +, "bridge_id�t�y", & +cur_bridge +-> +�s_psk_id�t�y +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1058 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge�nd/or TLS-PSK support�ot�vailable."); + +1060 }if(! + `�rcmp +( +tok� +, "bridge_insecure")){ + +1061 #i� + `def�ed +( +WITH_BRIDGE +�&& def�ed( +WITH_TLS +) + +1062 if( +�l�d +) ; + +1063 if(! +cur_bridge +){ + +1064 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1065 +MOSQ_ERR_INVAL +; + +1067 if( + `c�f__�r�_bo� +(& +tok� +, "bridge_��cu�", & +cur_bridge +-> +�s_��cu� +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1068 if( +cur_bridge +-> +�s_��cu� +){ + +1069 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "W�n�g: Bridg�%�us�g in�cu� mode.", +cur_bridge +-> +�me +); + +1072 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge�nd/or TLS-PSK support�ot�vailable."); + +1074 }if(! + `�rcmp +( +tok� +, "bridge_require_ocsp")){ + +1075 #i� + `def�ed +( +WITH_BRIDGE +�&& def�ed( +WITH_TLS +) + +1076 if( +�l�d +) ; + +1077 if(! +cur_bridge +){ + +1078 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1079 +MOSQ_ERR_INVAL +; + +1081 if( + `c�f__�r�_bo� +(& +tok� +, "bridge_�qu�e_oc�", & +cur_bridge +-> +�s_oc�_�qu�ed +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1083 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: TLS support�ot�vailable."); + +1085 }if(! + `�rcmp +( +tok� +, "bridge_keyfile")){ + +1086 #i� + `def�ed +( +WITH_BRIDGE +�&& def�ed( +WITH_TLS +) + +1087 if( +�l�d +) ; + +1088 if(! +cur_bridge +){ + +1089 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1090 +MOSQ_ERR_INVAL +; + +1092 #ifde� +FINAL_WITH_TLS_PSK + + +1093 if( +cur_bridge +-> +�s_psk_id�t�y + || cur_bridge-> +�s_psk +){ + +1094 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Cannot use both certificate�nd�sk�ncryption in� single bridge."); + +1095 +MOSQ_ERR_INVAL +; + +1098 if( + `c�f__�r�_�r�g +(& +tok� +, "bridge_keyf�e", & +cur_bridge +-> +�s_keyf�e +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1100 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge�nd/or TLS support�ot�vailable."); + +1102 }if(! + `�rcmp +( +tok� +, "bridge_protocol_version")){ + +1103 #ifde� +WITH_BRIDGE + + +1104 if( +�l�d +) ; + +1105 if(! +cur_bridge +){ + +1106 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1107 +MOSQ_ERR_INVAL +; + +1109 +tok� + = + `��ok_r +( +NULL +, "", & +�v�� +); + +1110 if( +tok� +){ + +1111 if(! + `�rcmp +( +tok� +, "mqttv31")){ + +1112 +cur_bridge +-> +��oc�_v�si� + = +mosq_p_mq�31 +; + +1113 }if(! + `�rcmp +( +tok� +, "mqttv311")){ + +1114 +cur_bridge +-> +��oc�_v�si� + = +mosq_p_mq�311 +; + +1116 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id bridge_��oc�_v�si� v�u�(%s).", +tok� +); + +1117 +MOSQ_ERR_INVAL +; + +1120 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Empty bridge_protocol_version value in configuration."); + +1121 +MOSQ_ERR_INVAL +; + +1124 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +1126 }if(! + `�rcmp +( +tok� +, "bridge_psk")){ + +1127 #i� + `def�ed +( +WITH_BRIDGE +�&& def�ed( +FINAL_WITH_TLS_PSK +) + +1128 if( +�l�d +) ; + +1129 if(! +cur_bridge +){ + +1130 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1131 +MOSQ_ERR_INVAL +; + +1133 if( +cur_bridge +-> +�s_�f�e + || cur_bridge-> +�s_��th + || cur_bridge-> +�s_��f�e + || cur_bridge-> +�s_keyf�e +){ + +1134 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Cannot use both certificate�nd�sk�ncryption in� single bridge."); + +1135 +MOSQ_ERR_INVAL +; + +1137 if( + `c�f__�r�_�r�g +(& +tok� +, "bridge_psk", & +cur_bridge +-> +�s_psk +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1139 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge�nd/or TLS-PSK support�ot�vailable."); + +1141 }if(! + `�rcmp +( +tok� +, "bridge_tls_version")){ + +1142 #i� + `def�ed +( +WITH_BRIDGE +�&& def�ed( +WITH_TLS +) + +1143 if( +�l�d +) ; + +1144 if(! +cur_bridge +){ + +1145 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1146 +MOSQ_ERR_INVAL +; + +1148 if( + `c�f__�r�_�r�g +(& +tok� +, "bridge_�s_v�si�", & +cur_bridge +-> +�s_v�si� +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1150 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge�nd/or TLS support�ot�vailable."); + +1152 }if(! + `�rcmp +( +tok� +, "cafile")){ + +1153 #i� + `def�ed +( +WITH_TLS +) + +1154 if( +�l�d +) ; + +1155 if( +cur_li��� +-> +psk_h�t +){ + +1156 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Cannot use both certificate�nd�sk�ncryption in� single�istener."); + +1157 +MOSQ_ERR_INVAL +; + +1159 if( + `c�f__�r�_�r�g +(& +tok� +, "�f�e", & +cur_li��� +-> +�f�e +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1161 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: TLS support�ot�vailable."); + +1163 }if(! + `�rcmp +( +tok� +, "capath")){ + +1164 #ifde� +WITH_TLS + + +1165 if( +�l�d +) ; + +1166 if( + `c�f__�r�_�r�g +(& +tok� +, "��th", & +cur_li��� +-> +��th +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1168 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: TLS support�ot�vailable."); + +1170 }if(! + `�rcmp +( +tok� +, "certfile")){ + +1171 #ifde� +WITH_TLS + + +1172 if( +�l�d +) ; + +1173 if( +cur_li��� +-> +psk_h�t +){ + +1174 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Cannot use both certificate�nd�sk�ncryption in� single�istener."); + +1175 +MOSQ_ERR_INVAL +; + +1177 if( + `c�f__�r�_�r�g +(& +tok� +, "��f�e", & +cur_li��� +-> +��f�e +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1179 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: TLS support�ot�vailable."); + +1181 }if(! + `�rcmp +( +tok� +, "check_retain_source")){ + +1182 + `c�f__�t_cur_�cur�y_�ti�s +( +c�fig +, +cur_li��� +, & +cur_�cur�y_�ti�s +); + +1183 if( + `c�f__�r�_bo� +(& +tok� +, "check_���_sour�", & +c�fig +-> +check_���_sour� +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1184 }if(! + `�rcmp +( +tok� +, "ciphers")){ + +1185 #ifde� +WITH_TLS + + +1186 if( +�l�d +) ; + +1187 if( + `c�f__�r�_�r�g +(& +tok� +, "c�h�s", & +cur_li��� +-> +c�h�s +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1189 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: TLS support�ot�vailable."); + +1191 }if(! + `�rcmp +( +tok� +, "clientid") || !strcmp(token, "remote_clientid")){ + +1192 #ifde� +WITH_BRIDGE + + +1193 if( +�l�d +) ; + +1194 if(! +cur_bridge +){ + +1195 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1196 +MOSQ_ERR_INVAL +; + +1198 if( + `c�f__�r�_�r�g +(& +tok� +, "bridg��mِ���id", & +cur_bridge +-> +�m�e_���id +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1200 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +1202 }if(! + `�rcmp +( +tok� +, "cleansession")){ + +1203 #ifde� +WITH_BRIDGE + + +1204 if( +�l�d +) ; + +1205 if(! +cur_bridge +){ + +1206 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1207 +MOSQ_ERR_INVAL +; + +1209 if( + `c�f__�r�_bo� +(& +tok� +, "��n�ssi�", & +cur_bridge +-> +��n_��t +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1211 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +1213 }if(! + `�rcmp +( +tok� +, "clientid_prefixes")){ + +1214 if( +�l�d +){ + +1215 + `mosqu�to__� +( +c�fig +-> +���id_�efixes +); + +1216 +c�fig +-> +���id_�efixes + = +NULL +; + +1218 if( + `c�f__�r�_�r�g +(& +tok� +, "���id_�efixes", & +c�fig +-> +���id_�efixes +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1219 }if(! + `�rcmp +( +tok� +, "connection")){ + +1220 #ifde� +WITH_BRIDGE + + +1221 if( +�l�d +) ; + +1222 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +1223 if( +tok� +){ + +1225 +i +=0; i< +c�fig +-> +bridge_cou� +; i++){ + +1226 if(! + `�rcmp +( +c�fig +-> +bridges +[ +i +]. +�me +, +tok� +)){ + +1227 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Du�i�� bridg��m�\"%s\".", +tok� +); + +1228 +MOSQ_ERR_INVAL +; + +1232 +c�fig +-> +bridge_cou� +++; + +1233 +c�fig +-> +bridges + = + `mosqu�to__��loc +(c�fig->bridges, c�fig-> +bridge_cou� +*( +mosqu�to__bridge +)); + +1234 if(! +c�fig +-> +bridges +){ + +1235 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +1236 +MOSQ_ERR_NOMEM +; + +1238 +cur_bridge + = &( +c�fig +-> +bridges +[c�fig-> +bridge_cou� +-1]); + +1239 + `mem�t +( +cur_bridge +, 0, ( +mosqu�to__bridge +)); + +1240 +cur_bridge +-> +�me + = + `mosqu�to__�rdup +( +tok� +); + +1241 if(! +cur_bridge +-> +�me +){ + +1242 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +1243 +MOSQ_ERR_NOMEM +; + +1245 +cur_bridge +-> +k��live + = 60; + +1246 +cur_bridge +-> +n�ifi�ti�s + = +�ue +; + +1247 +cur_bridge +-> +n�ifi�ti�s_lo�l_�ly + = +�l� +; + +1248 +cur_bridge +-> +��t_ty� + = +b�_autom�ic +; + +1249 +cur_bridge +-> +id�_timeout + = 60; + +1250 +cur_bridge +-> +���t_timeout + = 0; + +1251 +cur_bridge +-> +backoff_ba� + = 5; + +1252 +cur_bridge +-> +backoff_�p + = 30; + +1253 +cur_bridge +-> +th�sh�d + = 10; + +1254 +cur_bridge +-> +�y_�iv�e + = +�ue +; + +1255 +cur_bridge +-> +��m�_unsubs�ibe + = +�ue +; + +1256 +cur_bridge +-> +��oc�_v�si� + = +mosq_p_mq�311 +; + +1257 +cur_bridge +-> +�im�y_��y_sock + = +INVALID_SOCKET +; + +1259 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Empty connection value in configuration."); + +1260 +MOSQ_ERR_INVAL +; + +1263 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +1265 }if(! + `�rcmp +( +tok� +, "connection_messages")){ + +1266 if( + `c�f__�r�_bo� +(& +tok� +,�ok�, & +c�fig +-> +c���i�_mes�ges +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1267 }if(! + `�rcmp +( +tok� +, "crlfile")){ + +1268 #ifde� +WITH_TLS + + +1269 if( +�l�d +) ; + +1270 if( + `c�f__�r�_�r�g +(& +tok� +, "�lf�e", & +cur_li��� +-> +�lf�e +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1272 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: TLS support�ot�vailable."); + +1274 }if(! + `�rcmp +( +tok� +, "dhparamfile")){ + +1275 #ifde� +WITH_TLS + + +1276 if( +�l�d +) ; + +1277 if( + `c�f__�r�_�r�g +(& +tok� +, "dh��mf�e", & +cur_li��� +-> +dh��mf�e +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1279 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: TLS support�ot�vailable."); + +1281 }if(! + `�rcmp +( +tok� +, "http_dir")){ + +1282 #ifde� +WITH_WEBSOCKETS + + +1283 if( +�l�d +) ; + +1284 if( + `c�f__�r�_�r�g +(& +tok� +, "h�p_d�", & +cur_li��� +-> +h�p_d� +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1286 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Websockets support�ot�vailable."); + +1288 }if(! + `�rcmp +( +tok� +, "idle_timeout")){ + +1289 #ifde� +WITH_BRIDGE + + +1290 if( +�l�d +) ; + +1291 if(! +cur_bridge +){ + +1292 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1293 +MOSQ_ERR_INVAL +; + +1295 if( + `c�f__�r�_�t +(& +tok� +, "id�_timeout", & +cur_bridge +-> +id�_timeout +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1296 if( +cur_bridge +-> +id�_timeout + < 1){ + +1297 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "idle_timeout interval�oo�ow, using 1 second."); + +1298 +cur_bridge +-> +id�_timeout + = 1; + +1301 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +1303 }if(! + `�rcmp +( +tok� +, "include_dir")){ + +1304 if( +�v� + == 0){ + +1306 +tok� + = + `��ok_r +( +NULL +, "", & +�v�� +); + +1307 if(! +tok� +){ + +1308 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Empty include_dir value in configuration."); + +1312 ** +f�es +; + +1313 +f�e_cou� +; + +1314 +rc + = + `c�fig__g�_d�_f�es +( +tok� +, & +f�es +, & +f�e_cou� +); + +1315 if( +rc +) �c; + +1317 +i +=0; i< +f�e_cou� +; i++){ + +1318 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "L�d�g c�fig f��%s", +f�es +[ +i +]); + +1320 +rc + = + `c�fig__�ad_f�e +( +c�fig +, +�l�d +, +f�es +[ +i +], +� +, +�v� ++1, & +l��o_ext +); + +1321 if( +rc +){ + +1322 if( +l��o_ext + > 0){ + +1323 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� found��%s:%d.", +f�es +[ +i +], +l��o_ext +); + +1329 +i +=0; i< +f�e_cou� +; i++){ + +1330 + `mosqu�to__� +( +f�es +[ +i +]); + +1332 + `mosqu�to__� +( +f�es +); + +1333 if( +rc +) �c; + +1335 }if(! + `�rcmp +( +tok� +, "keepalive_interval")){ + +1336 #ifde� +WITH_BRIDGE + + +1337 if( +�l�d +) ; + +1338 if(! +cur_bridge +){ + +1339 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1340 +MOSQ_ERR_INVAL +; + +1342 if( + `c�f__�r�_�t +(& +tok� +, "k��live_��rv�", & +cur_bridge +-> +k��live +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1343 if( +cur_bridge +-> +k��live + < 5){ + +1344 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "keepalive interval�oo�ow, using 5 seconds."); + +1345 +cur_bridge +-> +k��live + = 5; + +1348 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +1350 }if(! + `�rcmp +( +tok� +, "keyfile")){ + +1351 #ifde� +WITH_TLS + + +1352 if( +�l�d +) ; + +1353 if( + `c�f__�r�_�r�g +(& +tok� +, "keyf�e", & +cur_li��� +-> +keyf�e +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1355 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: TLS support�ot�vailable."); + +1357 }if(! + `�rcmp +( +tok� +, "listener")){ + +1358 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +1359 if( +tok� +){ + +1360 +tmp_�t + = + `�oi +( +tok� +); + +1361 if( +tmp_�t + < 1 ||�mp_int > 65535){ + +1362 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id�܈v�u�(%d).", +tmp_�t +); + +1363 +MOSQ_ERR_INVAL +; + +1366 if( +�l�d +){ + +1369 +cur_li��� + = +NULL +; + +1370 +i +=0; i< +c�fig +-> +li���_cou� +; i++){ + +1371 if( +c�fig +-> +li���s +[ +i +]. +p�t + =� +tmp_�t +){ + +1372 +cur_li��� + = & +c�fig +-> +li���s +[ +i +]; + +1375 if(! +cur_li��� +){ + +1376 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: It is�ot currently�ossible�o�dd/remove�isteners when�eloading�he config file."); + +1377 +MOSQ_ERR_INVAL +; + +1380 +c�fig +-> +li���_cou� +++; + +1381 +c�fig +-> +li���s + = + `mosqu�to__��loc +(c�fig->li���s, ( +mosqu�to__li��� +)*c�fig-> +li���_cou� +); + +1382 if(! +c�fig +-> +li���s +){ + +1383 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +1384 +MOSQ_ERR_NOMEM +; + +1386 +cur_li��� + = & +c�fig +-> +li���s +[c�fig-> +li���_cou� +-1]; + +1387 + `mem�t +( +cur_li��� +, 0, ( +mosqu�to__li��� +)); + +1390 +cur_li��� +-> +�cur�y_�ti�s +. +�low_��ymous + = -1; + +1391 +cur_li��� +-> +��oc� + = +mp_mq� +; + +1392 +cur_li��� +-> +p�t + = +tmp_�t +; + +1393 +cur_li��� +-> +maximum_qos + = 2; + +1394 +cur_li��� +-> +max_t�ic_��s + = 10; + +1395 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +1396 i�( +tok� + !� +NULL + &&�oken[0] == '#'){ + +1397 +tok� + = +NULL +; + +1399 + `mosqu�to__� +( +cur_li��� +-> +ho� +); + +1400 if( +tok� +){ + +1401 +cur_li��� +-> +ho� + = + `mosqu�to__�rdup +( +tok� +); + +1403 +cur_li��� +-> +ho� + = +NULL +; + +1406 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Empty�istener value in configuration."); + +1407 +MOSQ_ERR_INVAL +; + +1409 }if(! + `�rcmp +( +tok� +, "local_clientid")){ + +1410 #ifde� +WITH_BRIDGE + + +1411 if( +�l�d +) ; + +1412 if(! +cur_bridge +){ + +1413 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1414 +MOSQ_ERR_INVAL +; + +1416 if( + `c�f__�r�_�r�g +(& +tok� +, "bridg�lo�����d", & +cur_bridge +-> +lo�l_���id +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1418 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +1420 }if(! + `�rcmp +( +tok� +, "local_password")){ + +1421 #ifde� +WITH_BRIDGE + + +1422 if( +�l�d +) ; + +1423 if(! +cur_bridge +){ + +1424 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1425 +MOSQ_ERR_INVAL +; + +1427 if( + `c�f__�r�_�r�g +(& +tok� +, "bridg�lo�l_�ssw�d", & +cur_bridge +-> +lo�l_�ssw�d +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1429 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +1431 }if(! + `�rcmp +( +tok� +, "local_username")){ + +1432 #ifde� +WITH_BRIDGE + + +1433 if( +�l�d +) ; + +1434 if(! +cur_bridge +){ + +1435 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1436 +MOSQ_ERR_INVAL +; + +1438 if( + `c�f__�r�_�r�g +(& +tok� +, "bridg�lo�l_u��ame", & +cur_bridge +-> +lo�l_u��ame +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1440 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +1442 }if(! + `�rcmp +( +tok� +, "log_dest")){ + +1443 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +1444 if( +tok� +){ + +1445 +� +-> +log_de�_�t + = 1; + +1446 if(! + `�rcmp +( +tok� +, "none")){ + +1447 +� +-> +log_de� + = +MQTT3_LOG_NONE +; + +1448 }if(! + `�rcmp +( +tok� +, "syslog")){ + +1449 +� +-> +log_de� + |� +MQTT3_LOG_SYSLOG +; + +1450 }if(! + `�rcmp +( +tok� +, "stdout")){ + +1451 +� +-> +log_de� + |� +MQTT3_LOG_STDOUT +; + +1452 }if(! + `�rcmp +( +tok� +, "stderr")){ + +1453 +� +-> +log_de� + |� +MQTT3_LOG_STDERR +; + +1454 }if(! + `�rcmp +( +tok� +, "topic")){ + +1455 +� +-> +log_de� + |� +MQTT3_LOG_TOPIC +; + +1456 }if(! + `�rcmp +( +tok� +, "file")){ + +1457 +� +-> +log_de� + |� +MQTT3_LOG_FILE +; + +1458 if( +c�fig +-> +log_� + || c�fig-> +log_f�e +){ + +1459 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Duplicate \"log_dest file\" value."); + +1460 +MOSQ_ERR_INVAL +; + +1463 +tok� + = &tok�[ + `��� +(token)+1]; + +1464 +tok� +[0] == ' ' ||�oken[0] == '\t'){ + +1465 +tok� +++; + +1467 if( +tok� +[0]){ + +1468 +c�fig +-> +log_f�e + = + `mosqu�to__�rdup +( +tok� +); + +1469 if(! +c�fig +-> +log_f�e +){ + +1470 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +1471 +MOSQ_ERR_NOMEM +; + +1474 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Empty \"log_dest file\" value in configuration."); + +1475 +MOSQ_ERR_INVAL +; + +1478 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id�og_de� v�u�(%s).", +tok� +); + +1479 +MOSQ_ERR_INVAL +; + +1481 #i� + `def�ed +( +WIN32 +�|| def�ed( +__CYGWIN__ +) + +1482 if( +�rvi�_h�d� +){ + +1483 if( +� +-> +log_de� + =� +MQTT3_LOG_STDOUT + || cr->log_de� =� +MQTT3_LOG_STDERR +){ + +1484 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Cannot�og�o stdout/stderr when�unning�s� Windows service."); + +1485 +MOSQ_ERR_INVAL +; + +1490 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Empty�og_dest value in configuration."); + +1491 +MOSQ_ERR_INVAL +; + +1493 }if(! + `�rcmp +( +tok� +, "log_facility")){ + +1494 #i� + `def�ed +( +WIN32 +�|| def�ed( +__CYGWIN__ +) + +1495 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning:�og_facility�ot supported on Windows."); + +1497 if( + `c�f__�r�_�t +(& +tok� +, "log_�c��y", & +tmp_�t +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1498 +tmp_�t +){ + +1500 +c�fig +-> +log_�c��y + = +LOG_LOCAL0 +; + +1503 +c�fig +-> +log_�c��y + = +LOG_LOCAL1 +; + +1506 +c�fig +-> +log_�c��y + = +LOG_LOCAL2 +; + +1509 +c�fig +-> +log_�c��y + = +LOG_LOCAL3 +; + +1512 +c�fig +-> +log_�c��y + = +LOG_LOCAL4 +; + +1515 +c�fig +-> +log_�c��y + = +LOG_LOCAL5 +; + +1518 +c�fig +-> +log_�c��y + = +LOG_LOCAL6 +; + +1521 +c�fig +-> +log_�c��y + = +LOG_LOCAL7 +; + +1524 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id�og_�c��y v�u�(%d).", +tmp_�t +); + +1525 +MOSQ_ERR_INVAL +; + +1528 }if(! + `�rcmp +( +tok� +, "log_timestamp")){ + +1529 if( + `c�f__�r�_bo� +(& +tok� +,�ok�, & +c�fig +-> +log_time�amp +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1530 }if(! + `�rcmp +( +tok� +, "log_timestamp_format")){ + +1531 if( + `c�f__�r�_�r�g +(& +tok� +,�ok�, & +c�fig +-> +log_time�amp_f�m� +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1532 }if(! + `�rcmp +( +tok� +, "log_type")){ + +1533 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +1534 if( +tok� +){ + +1535 +� +-> +log_ty�_�t + = 1; + +1536 if(! + `�rcmp +( +tok� +, "none")){ + +1537 +� +-> +log_ty� + = +MOSQ_LOG_NONE +; + +1538 }if(! + `�rcmp +( +tok� +, "information")){ + +1539 +� +-> +log_ty� + |� +MOSQ_LOG_INFO +; + +1540 }if(! + `�rcmp +( +tok� +, "notice")){ + +1541 +� +-> +log_ty� + |� +MOSQ_LOG_NOTICE +; + +1542 }if(! + `�rcmp +( +tok� +, "warning")){ + +1543 +� +-> +log_ty� + |� +MOSQ_LOG_WARNING +; + +1544 }if(! + `�rcmp +( +tok� +, "error")){ + +1545 +� +-> +log_ty� + |� +MOSQ_LOG_ERR +; + +1546 }if(! + `�rcmp +( +tok� +, "debug")){ + +1547 +� +-> +log_ty� + |� +MOSQ_LOG_DEBUG +; + +1548 }if(! + `�rcmp +( +tok� +, "subscribe")){ + +1549 +� +-> +log_ty� + |� +MOSQ_LOG_SUBSCRIBE +; + +1550 }if(! + `�rcmp +( +tok� +, "unsubscribe")){ + +1551 +� +-> +log_ty� + |� +MOSQ_LOG_UNSUBSCRIBE +; + +1552 }if(! + `�rcmp +( +tok� +, "internal")){ + +1553 +� +-> +log_ty� + |� +MOSQ_LOG_INTERNAL +; + +1554 #ifde� +WITH_WEBSOCKETS + + +1555 }if(! + `�rcmp +( +tok� +, "websockets")){ + +1556 +� +-> +log_ty� + |� +MOSQ_LOG_WEBSOCKETS +; + +1558 }if(! + `�rcmp +( +tok� +, "all")){ + +1559 +� +-> +log_ty� + = +MOSQ_LOG_ALL +; + +1561 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id�og_ty� v�u�(%s).", +tok� +); + +1562 +MOSQ_ERR_INVAL +; + +1565 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Empty�og_type value in configuration."); + +1567 }if(! + `�rcmp +( +tok� +, "max_connections")){ + +1568 if( +�l�d +) ; + +1569 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +1570 if( +tok� +){ + +1571 +cur_li��� +-> +max_c���i�s + = + `�oi +( +tok� +); + +1572 if( +cur_li��� +-> +max_c���i�s + < 0) cur_listener->max_connections = -1; + +1574 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Empty max_connections value in configuration."); + +1576 }if(! + `�rcmp +( +tok� +, "maximum_qos")){ + +1577 if( +�l�d +) ; + +1578 if( + `c�f__�r�_�t +(& +tok� +, "maximum_qos", & +tmp_�t +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1579 if( +tmp_�t + < 0 ||�mp_int > 2){ + +1580 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: maximum_qos must be between 0�nd 2 inclusive."); + +1581 +MOSQ_ERR_INVAL +; + +1583 +cur_li��� +-> +maximum_qos + = +tmp_�t +; + +1584 }if(! + `�rcmp +( +tok� +, "max_inflight_bytes")){ + +1585 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +1586 if( +tok� +){ + +1587 +� +-> +max_��ight_by�s + = + `�� +( +tok� +); + +1589 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Empty max_inflight_bytes value in configuration."); + +1591 }if(! + `�rcmp +( +tok� +, "max_inflight_messages")){ + +1592 if( + `c�f__�r�_�t +(& +tok� +, "max_��ight_mes�ges", & +tmp_�t +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1593 if( +tmp_�t + < 0 ||�mp_int == 65535){ + +1594 +tmp_�t + = 0; + +1595 }if( +tmp_�t + > 65535){ + +1596 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: max_inflight_messages must be <= 65535."); + +1597 +MOSQ_ERR_INVAL +; + +1599 +c�fig +-> +max_��ight_mes�ges + = +tmp_�t +; + +1600 }if(! + `�rcmp +( +tok� +, "max_keepalive")){ + +1601 if( + `c�f__�r�_�t +(& +tok� +, "max_k��live", & +tmp_�t +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1602 if( +tmp_�t + < 10 ||�mp_int > 65535){ + +1603 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id max_k��liv�v�u�(%d).", +tmp_�t +); + +1604 +MOSQ_ERR_INVAL +; + +1606 +c�fig +-> +max_k��live + = +tmp_�t +; + +1607 }if(! + `�rcmp +( +tok� +, "max_packet_size")){ + +1608 if( + `c�f__�r�_�t +(& +tok� +, "max_�ck�_size", & +tmp_�t +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1609 if( +tmp_�t + < 20){ + +1610 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id max_�ck�_siz�v�u�(%d).", +tmp_�t +); + +1611 +MOSQ_ERR_INVAL +; + +1613 +c�fig +-> +max_�ck�_size + = +tmp_�t +; + +1614 }if(! + `�rcmp +( +tok� +, "max_queued_bytes")){ + +1615 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +1616 if( +tok� +){ + +1617 +� +-> +max_queued_by�s + = + `�� +( +tok� +); + +1619 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Empty max_queued_bytes value in configuration."); + +1621 }if(! + `�rcmp +( +tok� +, "max_queued_messages")){ + +1622 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +1623 if( +tok� +){ + +1624 +� +-> +max_queued_mes�ges + = + `�oi +( +tok� +); + +1625 if( +� +-> +max_queued_mes�ges + < 0) cr->max_queued_messages = 0; + +1627 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Empty max_queued_messages value in configuration."); + +1629 }if(! + `�rcmp +( +tok� +, "memory_limit")){ + +1630 +ssize_t + +lim +; + +1631 if( + `c�f__�r�_ssize_t +(& +tok� +, "mem�y_lim�", & +lim +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1632 if( +lim + < 0){ + +1633 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id mem�y_lim� v�u�(%ld).", +lim +); + +1634 +MOSQ_ERR_INVAL +; + +1636 + `mem�y__�t_lim� +( +lim +); + +1637 }if(! + `�rcmp +( +tok� +, "message_size_limit")){ + +1638 if( + `c�f__�r�_�t +(& +tok� +, "mes�ge_size_lim�", (*)& +c�fig +-> +mes�ge_size_lim� +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1639 if( +c�fig +-> +mes�ge_size_lim� + > +MQTT_MAX_PAYLOAD +){ + +1640 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id mes�ge_size_lim� v�u�(%u).", +c�fig +-> +mes�ge_size_lim� +); + +1641 +MOSQ_ERR_INVAL +; + +1643 }if(! + `�rcmp +( +tok� +, "mount_point")){ + +1644 if( +�l�d +) ; + +1645 if( +c�fig +-> +li���_cou� + == 0){ + +1646 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: You must use create��istener before using�he mount_point option in�he configuration file."); + +1647 +MOSQ_ERR_INVAL +; + +1649 if( + `c�f__�r�_�r�g +(& +tok� +, "mou�_po�t", & +cur_li��� +-> +mou�_po�t +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1650 if( + `mosqu�to_pub_t�ic_check +( +cur_li��� +-> +mou�_po�t +�!� +MOSQ_ERR_SUCCESS +){ + +1651 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +1653 +cur_li��� +-> +mou�_po�t +); + +1654 +MOSQ_ERR_INVAL +; + +1656 }if(! + `�rcmp +( +tok� +, "notifications")){ + +1657 #ifde� +WITH_BRIDGE + + +1658 if( +�l�d +) ; + +1659 if(! +cur_bridge +){ + +1660 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1661 +MOSQ_ERR_INVAL +; + +1663 if( + `c�f__�r�_bo� +(& +tok� +, "n�ifi�ti�s", & +cur_bridge +-> +n�ifi�ti�s +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1665 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +1667 }if(! + `�rcmp +( +tok� +, "notifications_local_only")){ + +1668 #ifde� +WITH_BRIDGE + + +1669 if( +�l�d +) ; + +1670 if(! +cur_bridge +){ + +1671 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration"); + +1672 +MOSQ_ERR_INVAL +; + +1674 if( + `c�f__�r�_bo� +(& +tok� +, "n�ifi�ti�s_lo�l_�ly", & +cur_bridge +-> +n�ifi�ti�s_lo�l_�ly +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1676 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +1678 }if(! + `�rcmp +( +tok� +, "notification_topic")){ + +1679 #ifde� +WITH_BRIDGE + + +1680 if( +�l�d +) ; + +1681 if(! +cur_bridge +){ + +1682 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1683 +MOSQ_ERR_INVAL +; + +1685 if( + `c�f__�r�_�r�g +(& +tok� +, "n�ifi�ti�_t�ic", & +cur_bridge +-> +n�ifi�ti�_t�ic +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1687 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +1689 }if(! + `�rcmp +( +tok� +, "password") || !strcmp(token, "remote_password")){ + +1690 #ifde� +WITH_BRIDGE + + +1691 if( +�l�d +) ; + +1692 if(! +cur_bridge +){ + +1693 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1694 +MOSQ_ERR_INVAL +; + +1696 if( + `c�f__�r�_�r�g +(& +tok� +, "bridg��m�e_�ssw�d", & +cur_bridge +-> +�m�e_�ssw�d +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1698 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +1700 }if(! + `�rcmp +( +tok� +, "password_file")){ + +1701 + `c�f__�t_cur_�cur�y_�ti�s +( +c�fig +, +cur_li��� +, & +cur_�cur�y_�ti�s +); + +1702 if( +�l�d +){ + +1703 + `mosqu�to__� +( +cur_�cur�y_�ti�s +-> +�ssw�d_f�e +); + +1704 +cur_�cur�y_�ti�s +-> +�ssw�d_f�e + = +NULL +; + +1706 if( + `c�f__�r�_�r�g +(& +tok� +, "�ssw�d_f�e", & +cur_�cur�y_�ti�s +-> +�ssw�d_f�e +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1707 }if(! + `�rcmp +( +tok� +, "per_listener_settings")){ + +1708 if( + `c�f__�r�_bo� +(& +tok� +, "�r_li���_���gs", & +c�fig +-> +�r_li���_���gs +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1709 if( +cur_�cur�y_�ti�s + && +c�fig +-> +�r_li���_���gs +){ + +1710 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error:�er_listener_settings must be set before�ny other security settings."); + +1711 +MOSQ_ERR_INVAL +; + +1713 }if(! + `�rcmp +( +tok� +, "persistence") || !strcmp(token, "retained_persistence")){ + +1714 if( + `c�f__�r�_bo� +(& +tok� +,�ok�, & +c�fig +-> +�rsi��� +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1715 }if(! + `�rcmp +( +tok� +, "persistence_file")){ + +1716 if( + `c�f__�r�_�r�g +(& +tok� +, "�rsi���_f�e", & +c�fig +-> +�rsi���_f�e +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1717 }if(! + `�rcmp +( +tok� +, "persistence_location")){ + +1718 if( + `c�f__�r�_�r�g +(& +tok� +, "�rsi���_lo�ti�", & +c�fig +-> +�rsi���_lo�ti� +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1719 }if(! + `�rcmp +( +tok� +, "persistent_client_expiration")){ + +1720 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +1721 if( +tok� +){ + +1722 +tok� +[ + `��� +(token)-1]){ + +1724 +exp��i�_mu� + = 3600; + +1727 +exp��i�_mu� + = 86400; + +1730 +exp��i�_mu� + = 86400*7; + +1733 +exp��i�_mu� + = 86400*30; + +1736 +exp��i�_mu� + = 86400*365; + +1739 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid�ersistent_client_expiration duration in configuration."); + +1740 +MOSQ_ERR_INVAL +; + +1742 +tok� +[ + `��� +(token)-1] = '\0'; + +1743 +c�fig +-> +�rsi��t_���_exp��i� + = + `�oi +( +tok� +)* +exp��i�_mu� +; + +1744 if( +c�fig +-> +�rsi��t_���_exp��i� + <= 0){ + +1745 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid�ersistent_client_expiration duration in configuration."); + +1746 +MOSQ_ERR_INVAL +; + +1749 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Empty�ersistent_client_expiration value in configuration."); + +1751 }if(! + `�rcmp +( +tok� +, "pid_file")){ + +1752 if( +�l�d +) ; + +1753 if( + `c�f__�r�_�r�g +(& +tok� +, "pid_f�e", & +c�fig +-> +pid_f�e +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1754 }if(! + `�rcmp +( +tok� +, "port")){ + +1755 if( +�l�d +) ; + +1756 if( +c�fig +-> +de�u�_li��� +. +p�t +){ + +1757 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Default�istener�ort specified multiple�imes. Only�he�atest will be used."); + +1759 if( + `c�f__�r�_�t +(& +tok� +, "p�t", & +tmp_�t +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1760 if( +tmp_�t + < 1 ||�mp_int > 65535){ + +1761 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id�܈v�u�(%d).", +tmp_�t +); + +1762 +MOSQ_ERR_INVAL +; + +1764 +c�fig +-> +de�u�_li��� +. +p�t + = +tmp_�t +; + +1765 }if(! + `�rcmp +( +tok� +, "protocol")){ + +1766 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +1767 if( +tok� +){ + +1768 if(! + `�rcmp +( +tok� +, "mqtt")){ + +1769 +cur_li��� +-> +��oc� + = +mp_mq� +; + +1774 }if(! + `�rcmp +( +tok� +, "websockets")){ + +1775 #ifde� +WITH_WEBSOCKETS + + +1776 +cur_li��� +-> +��oc� + = +mp_websock�s +; + +1777 +c�fig +-> +have_websock�s_li��� + = +�ue +; + +1779 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Websockets support�ot�vailable."); + +1780 +MOSQ_ERR_INVAL +; + +1783 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id�r�oc� v�u�(%s).", +tok� +); + +1784 +MOSQ_ERR_INVAL +; + +1787 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Empty�rotocol value in configuration."); + +1789 }if(! + `�rcmp +( +tok� +, "psk_file")){ + +1790 #ifde� +FINAL_WITH_TLS_PSK + + +1791 + `c�f__�t_cur_�cur�y_�ti�s +( +c�fig +, +cur_li��� +, & +cur_�cur�y_�ti�s +); + +1792 if( +�l�d +){ + +1793 + `mosqu�to__� +( +cur_�cur�y_�ti�s +-> +psk_f�e +); + +1794 +cur_�cur�y_�ti�s +-> +psk_f�e + = +NULL +; + +1796 if( + `c�f__�r�_�r�g +(& +tok� +, "psk_f�e", & +cur_�cur�y_�ti�s +-> +psk_f�e +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1798 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: TLS/TLS-PSK support�ot�vailable."); + +1800 }if(! + `�rcmp +( +tok� +, "psk_hint")){ + +1801 #ifde� +FINAL_WITH_TLS_PSK + + +1802 if( +�l�d +) ; + +1803 if( + `c�f__�r�_�r�g +(& +tok� +, "psk_h�t", & +cur_li��� +-> +psk_h�t +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1805 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: TLS/TLS-PSK support�ot�vailable."); + +1807 }if(! + `�rcmp +( +tok� +, "queue_qos0_messages")){ + +1808 if( + `c�f__�r�_bo� +(& +tok� +,�ok�, & +c�fig +-> +queue_qos0_mes�ges +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1809 }if(! + `�rcmp +( +tok� +, "require_certificate")){ + +1810 #ifde� +WITH_TLS + + +1811 if( +�l�d +) ; + +1812 if( + `c�f__�r�_bo� +(& +tok� +, "�qu�e_��ifi��", & +cur_li��� +-> +�qu�e_��ifi�� +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1814 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: TLS support�ot�vailable."); + +1816 }if(! + `�rcmp +( +tok� +, "restart_timeout")){ + +1817 #ifde� +WITH_BRIDGE + + +1818 if( +�l�d +) ; + +1819 if(! +cur_bridge +){ + +1820 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1821 +MOSQ_ERR_INVAL +; + +1823 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +1824 if(! +tok� +){ + +1825 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Empty�estart_timeout value in configuration."); + +1826 +MOSQ_ERR_INVAL +; + +1828 +cur_bridge +-> +���t_timeout + = + `�oi +( +tok� +); + +1829 if( +cur_bridge +-> +���t_timeout + < 1){ + +1830 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "restart_timeout interval�oo�ow, using 1 second."); + +1831 +cur_bridge +-> +���t_timeout + = 1; + +1833 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +1834 if( +tok� +){ + +1835 +cur_bridge +-> +backoff_ba� + = cur_bridge-> +���t_timeout +; + +1836 +cur_bridge +-> +backoff_�p + = + `�oi +( +tok� +); + +1837 if( +cur_bridge +-> +backoff_�p + < cur_bridge-> +backoff_ba� +){ + +1838 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: backoff cap is�ower�han�he base in�estart_timeout."); + +1839 +MOSQ_ERR_INVAL +; + +1843 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +1845 }if(! + `�rcmp +( +tok� +, "retain_available")){ + +1846 if( + `c�f__�r�_bo� +(& +tok� +,�ok�, & +c�fig +-> +���_ava�ab� +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1847 }if(! + `�rcmp +( +tok� +, "retry_interval")){ + +1848 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: The�etry_interval option is�o�onger�vailable."); + +1849 }if(! + `�rcmp +( +tok� +, "round_robin")){ + +1850 #ifde� +WITH_BRIDGE + + +1851 if( +�l�d +) ; + +1852 if(! +cur_bridge +){ + +1853 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1854 +MOSQ_ERR_INVAL +; + +1856 if( + `c�f__�r�_bo� +(& +tok� +, "round_rob�", & +cur_bridge +-> +round_rob� +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1858 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +1860 }if(! + `�rcmp +( +tok� +, "set_tcp_nodelay")){ + +1861 if( + `c�f__�r�_bo� +(& +tok� +, "�t_t�_nod�ay", & +c�fig +-> +�t_t�_nod�ay +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1862 }if(! + `�rcmp +( +tok� +, "start_type")){ + +1863 #ifde� +WITH_BRIDGE + + +1864 if( +�l�d +) ; + +1865 if(! +cur_bridge +){ + +1866 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1867 +MOSQ_ERR_INVAL +; + +1869 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +1870 if( +tok� +){ + +1871 if(! + `�rcmp +( +tok� +, "automatic")){ + +1872 +cur_bridge +-> +��t_ty� + = +b�_autom�ic +; + +1873 }if(! + `�rcmp +( +tok� +, "lazy")){ + +1874 +cur_bridge +-> +��t_ty� + = +b�_�zy +; + +1875 }if(! + `�rcmp +( +tok� +, "manual")){ + +1876 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Manual start_type�ot supported."); + +1877 +MOSQ_ERR_INVAL +; + +1878 }if(! + `�rcmp +( +tok� +, "once")){ + +1879 +cur_bridge +-> +��t_ty� + = +b�_�� +; + +1881 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id s��_ty� v�u�� c�figu�ti� (%s).", +tok� +); + +1882 +MOSQ_ERR_INVAL +; + +1885 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Empty start_type value in configuration."); + +1886 +MOSQ_ERR_INVAL +; + +1889 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +1891 }if(! + `�rcmp +( +tok� +, "socket_domain")){ + +1892 if( +�l�d +) ; + +1893 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +1894 if( +tok� +){ + +1895 if(! + `�rcmp +( +tok� +, "ipv4")){ + +1896 +cur_li��� +-> +sock�_doma� + = +AF_INET +; + +1897 }if(! + `�rcmp +( +tok� +, "ipv6")){ + +1898 +cur_li��� +-> +sock�_doma� + = +AF_INET6 +; + +1900 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id sock�_doma� v�u�\"%s\" i�c�figu�ti�.", +tok� +); + +1901 +MOSQ_ERR_INVAL +; + +1904 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Empty socket_domain value in configuration."); + +1905 +MOSQ_ERR_INVAL +; + +1907 }if(! + `�rcmp +( +tok� +, "store_clean_interval")){ + +1908 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: store_clean_interval is�o�onger�eeded."); + +1909 }if(! + `�rcmp +( +tok� +, "sys_interval")){ + +1910 if( + `c�f__�r�_�t +(& +tok� +, "sys_��rv�", & +c�fig +-> +sys_��rv� +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1911 if( +c�fig +-> +sys_��rv� + < 0 || config->sys_interval > 65535){ + +1912 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id sys_��rv� v�u�(%d).", +c�fig +-> +sys_��rv� +); + +1913 +MOSQ_ERR_INVAL +; + +1915 }if(! + `�rcmp +( +tok� +, "threshold")){ + +1916 #ifde� +WITH_BRIDGE + + +1917 if( +�l�d +) ; + +1918 if(! +cur_bridge +){ + +1919 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1920 +MOSQ_ERR_INVAL +; + +1922 if( + `c�f__�r�_�t +(& +tok� +, "th�sh�d", & +cur_bridge +-> +th�sh�d +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1923 if( +cur_bridge +-> +th�sh�d + < 1){ + +1924 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "threshold�oo�ow, using 1 message."); + +1925 +cur_bridge +-> +th�sh�d + = 1; + +1928 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +1930 }if(! + `�rcmp +( +tok� +, "tls_engine")){ + +1931 #ifde� +WITH_TLS + + +1932 if( +�l�d +) ; + +1933 if( + `c�f__�r�_�r�g +(& +tok� +, "�s_�g�e", & +cur_li��� +-> +�s_�g�e +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1935 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: TLS support�ot�vailable."); + +1937 }if(! + `�rcmp +( +tok� +, "tls_engine_kpass_sha1")){ + +1938 #ifde� +WITH_TLS + + +1939 if( +�l�d +) ; + +1940 * +k�ss_sha + = +NULL +, * +k�ss_sha_b� + = NULL; + +1941 if( + `c�f__�r�_�r�g +(& +tok� +, "�s_�g�e_k�ss_sha1", & +k�ss_sha +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1942 if( + `mosqu�to__hex2b�_sha1 +( +k�ss_sha +, (**)& +k�ss_sha_b� +�!� +MOSQ_ERR_SUCCESS +){ + +1943 + `mosqu�to__� +( +k�ss_sha +); + +1944 +MOSQ_ERR_INVAL +; + +1946 +cur_li��� +-> +�s_�g�e_k�ss_sha1 + = +k�ss_sha_b� +; + +1947 + `mosqu�to__� +( +k�ss_sha +); + +1949 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: TLS support�ot�vailable."); + +1951 }if(! + `�rcmp +( +tok� +, "tls_keyform")){ + +1952 #ifde� +WITH_TLS + + +1953 if( +�l�d +) ; + +1954 * +keyf�m + = +NULL +; + +1955 if( + `c�f__�r�_�r�g +(& +tok� +, "�s_keyf�m", & +keyf�m +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1956 +cur_li��� +-> +�s_keyf�m + = +mosq_k_�m +; + +1957 if(! + `�rcmp +( +keyf�m +, "�g�e")� +cur_li��� +-> +�s_keyf�m + = +mosq_k_�g�e +; + +1958 + `mosqu�to__� +( +keyf�m +); + +1960 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: TLS support�ot�vailable."); + +1962 }if(! + `�rcmp +( +tok� +, "tls_version")){ + +1963 #i� + `def�ed +( +WITH_TLS +) + +1964 if( +�l�d +) ; + +1965 if( + `c�f__�r�_�r�g +(& +tok� +, "�s_v�si�", & +cur_li��� +-> +�s_v�si� +, +�v�� +)� +MOSQ_ERR_INVAL +; + +1967 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: TLS support�ot�vailable."); + +1969 }if(! + `�rcmp +( +tok� +, "topic")){ + +1970 #ifde� +WITH_BRIDGE + + +1971 if( +�l�d +) ; + +1972 if(! +cur_bridge +){ + +1973 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +1974 +MOSQ_ERR_INVAL +; + +1976 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +1977 if( +tok� +){ + +1978 +cur_bridge +-> +t�ic_cou� +++; + +1979 +cur_bridge +-> +t�ics + = + `mosqu�to__��loc +(cur_bridge->topics, + +1980 ( +mosqu�to__bridge_t�ic +)* +cur_bridge +-> +t�ic_cou� +); + +1981 if(! +cur_bridge +-> +t�ics +){ + +1982 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +1983 +MOSQ_ERR_NOMEM +; + +1985 +cur_t�ic + = & +cur_bridge +-> +t�ics +[cur_bridge-> +t�ic_cou� +-1]; + +1986 if(! + `�rcmp +( +tok� +, "\"\"")){ + +1987 +cur_t�ic +-> +t�ic + = +NULL +; + +1989 +cur_t�ic +-> +t�ic + = + `mosqu�to__�rdup +( +tok� +); + +1990 if(! +cur_t�ic +-> +t�ic +){ + +1991 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +1992 +MOSQ_ERR_NOMEM +; + +1995 +cur_t�ic +-> +d�e�i� + = +bd_out +; + +1996 +cur_t�ic +-> +qos + = 0; + +1997 +cur_t�ic +-> +lo�l_�efix + = +NULL +; + +1998 +cur_t�ic +-> +�m�e_�efix + = +NULL +; + +2000 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Empty�opic value in configuration."); + +2001 +MOSQ_ERR_INVAL +; + +2003 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +2004 if( +tok� +){ + +2005 if(! + `�r��cmp +( +tok� +, "out")){ + +2006 +cur_t�ic +-> +d�e�i� + = +bd_out +; + +2007 }if(! + `�r��cmp +( +tok� +, "in")){ + +2008 +cur_t�ic +-> +d�e�i� + = +bd_� +; + +2009 }if(! + `�r��cmp +( +tok� +, "both")){ + +2010 +cur_t�ic +-> +d�e�i� + = +bd_b�h +; + +2012 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id bridg�t�i�d�e�i� '%s'.", +tok� +); + +2013 +MOSQ_ERR_INVAL +; + +2015 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +2016 if( +tok� +){ + +2017 i�( +tok� +[0] == '#'){ + +2018 + `��ok_r +( +NULL +, "", & +�v�� +); + +2020 +cur_t�ic +-> +qos + = + `�oi +( +tok� +); + +2021 if( +cur_t�ic +-> +qos + < 0 || cur_topic->qos > 2){ + +2022 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id bridg�QoS�ev� '%s'.", +tok� +); + +2023 +MOSQ_ERR_INVAL +; + +2026 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +2027 if( +tok� +){ + +2028 +cur_bridge +-> +t�ic_�m�p�g + = +�ue +; + +2029 if(! + `�rcmp +( +tok� +, "\"\"") ||�oken[0] == '#'){ + +2030 +cur_t�ic +-> +lo�l_�efix + = +NULL +; + +2031 i�( +tok� +[0] == '#'){ + +2032 + `��ok_r +( +NULL +, "", & +�v�� +); + +2035 if( + `mosqu�to_pub_t�ic_check +( +tok� +�!� +MOSQ_ERR_SUCCESS +){ + +2036 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id bridg�t�i�lo�ȴefix '%s'.", +tok� +); + +2037 +MOSQ_ERR_INVAL +; + +2039 +cur_t�ic +-> +lo�l_�efix + = + `mosqu�to__�rdup +( +tok� +); + +2040 if(! +cur_t�ic +-> +lo�l_�efix +){ + +2041 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +2042 +MOSQ_ERR_NOMEM +; + +2046 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +2047 if( +tok� +){ + +2048 if(! + `�rcmp +( +tok� +, "\"\"") ||�oken[0] == '#'){ + +2049 +cur_t�ic +-> +�m�e_�efix + = +NULL +; + +2051 if( + `mosqu�to_pub_t�ic_check +( +tok� +�!� +MOSQ_ERR_SUCCESS +){ + +2052 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id bridg�t�i��mِ�efix '%s'.", +tok� +); + +2053 +MOSQ_ERR_INVAL +; + +2055 +cur_t�ic +-> +�m�e_�efix + = + `mosqu�to__�rdup +( +tok� +); + +2056 if(! +cur_t�ic +-> +�m�e_�efix +){ + +2057 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +2058 +MOSQ_ERR_NOMEM +; + +2065 if( +cur_t�ic +-> +t�ic + =� +NULL + && + +2066 ( +cur_t�ic +-> +lo�l_�efix + =� +NULL + || cur_t�ic-> +�m�e_�efix + == NULL)){ + +2068 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge�emapping."); + +2069 +MOSQ_ERR_INVAL +; + +2071 if( +cur_t�ic +-> +lo�l_�efix +){ + +2072 if( +cur_t�ic +-> +t�ic +){ + +2073 +�n + = + `��� +( +cur_t�ic +-> +t�ic +�+ s��n(cur_t�ic-> +lo�l_�efix +)+1; + +2074 +cur_t�ic +-> +lo�l_t�ic + = + `mosqu�to__m�loc +( +�n ++1); + +2075 if(! +cur_t�ic +-> +lo�l_t�ic +){ + +2076 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +2077 +MOSQ_ERR_NOMEM +; + +2079 + `���tf +( +cur_t�ic +-> +lo�l_t�ic +, +�n ++1, "%s%s", cur_t�ic-> +lo�l_�efix +, cur_t�ic-> +t�ic +); + +2080 +cur_t�ic +-> +lo�l_t�ic +[ +�n +] = '\0'; + +2082 +cur_t�ic +-> +lo�l_t�ic + = + `mosqu�to__�rdup +(cur_t�ic-> +lo�l_�efix +); + +2083 if(! +cur_t�ic +-> +lo�l_t�ic +){ + +2084 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +2085 +MOSQ_ERR_NOMEM +; + +2089 +cur_t�ic +-> +lo�l_t�ic + = + `mosqu�to__�rdup +(cur_t�ic-> +t�ic +); + +2090 if(! +cur_t�ic +-> +lo�l_t�ic +){ + +2091 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +2092 +MOSQ_ERR_NOMEM +; + +2096 if( +cur_t�ic +-> +�m�e_�efix +){ + +2097 if( +cur_t�ic +-> +t�ic +){ + +2098 +�n + = + `��� +( +cur_t�ic +-> +t�ic +�+ s��n(cur_t�ic-> +�m�e_�efix +)+1; + +2099 +cur_t�ic +-> +�m�e_t�ic + = + `mosqu�to__m�loc +( +�n ++1); + +2100 if(! +cur_t�ic +-> +�m�e_t�ic +){ + +2101 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +2102 +MOSQ_ERR_NOMEM +; + +2104 + `���tf +( +cur_t�ic +-> +�m�e_t�ic +, +�n +, "%s%s", cur_t�ic-> +�m�e_�efix +, cur_t�ic-> +t�ic +); + +2105 +cur_t�ic +-> +�m�e_t�ic +[ +�n +] = '\0'; + +2107 +cur_t�ic +-> +�m�e_t�ic + = + `mosqu�to__�rdup +(cur_t�ic-> +�m�e_�efix +); + +2108 if(! +cur_t�ic +-> +�m�e_t�ic +){ + +2109 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +2110 +MOSQ_ERR_NOMEM +; + +2114 +cur_t�ic +-> +�m�e_t�ic + = + `mosqu�to__�rdup +(cur_t�ic-> +t�ic +); + +2115 if(! +cur_t�ic +-> +�m�e_t�ic +){ + +2116 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +2117 +MOSQ_ERR_NOMEM +; + +2121 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +2123 }if(! + `�rcmp +( +tok� +, "max_topic_alias")){ + +2124 if( +�l�d +) ; + +2125 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +2126 if( +tok� +){ + +2127 +cur_li��� +-> +max_t�ic_��s + = + `�oi +( +tok� +); + +2129 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Empty max_topic_alias value in configuration."); + +2131 }if(! + `�rcmp +( +tok� +, "try_private")){ + +2132 #ifde� +WITH_BRIDGE + + +2133 if( +�l�d +) ; + +2134 if(! +cur_bridge +){ + +2135 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +2136 +MOSQ_ERR_INVAL +; + +2138 if( + `c�f__�r�_bo� +(& +tok� +, "�y_�iv�e", & +cur_bridge +-> +�y_�iv�e +, +�v�� +)� +MOSQ_ERR_INVAL +; + +2140 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +2142 }if(! + `�rcmp +( +tok� +, "upgrade_outgoing_qos")){ + +2143 if( + `c�f__�r�_bo� +(& +tok� +,�ok�, & +c�fig +-> +upg�de_outgo�g_qos +, +�v�� +)� +MOSQ_ERR_INVAL +; + +2144 }if(! + `�rcmp +( +tok� +, "use_identity_as_username")){ + +2145 #ifde� +WITH_TLS + + +2146 if( +�l�d +) ; + +2147 if( + `c�f__�r�_bo� +(& +tok� +, "u�_id�t�y_as_u��ame", & +cur_li��� +-> +u�_id�t�y_as_u��ame +, +�v�� +)� +MOSQ_ERR_INVAL +; + +2149 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: TLS support�ot�vailable."); + +2151 }if(! + `�rcmp +( +tok� +, "use_subject_as_username")){ + +2152 #ifde� +WITH_TLS + + +2153 if( +�l�d +) ; + +2154 if( + `c�f__�r�_bo� +(& +tok� +, "u�_subje�_as_u��ame", & +cur_li��� +-> +u�_subje�_as_u��ame +, +�v�� +)� +MOSQ_ERR_INVAL +; + +2156 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: TLS support�ot�vailable."); + +2158 }if(! + `�rcmp +( +tok� +, "user")){ + +2159 if( +�l�d +) ; + +2160 if( + `c�f__�r�_�r�g +(& +tok� +, "u�r", & +c�fig +-> +u�r +, +�v�� +)� +MOSQ_ERR_INVAL +; + +2161 }if(! + `�rcmp +( +tok� +, "use_username_as_clientid")){ + +2162 if( +�l�d +) ; + +2163 if( + `c�f__�r�_bo� +(& +tok� +, "u�_u��ame_as_���id", & +cur_li��� +-> +u�_u��ame_as_���id +, +�v�� +)� +MOSQ_ERR_INVAL +; + +2164 }if(! + `�rcmp +( +tok� +, "username") || !strcmp(token, "remote_username")){ + +2165 #ifde� +WITH_BRIDGE + + +2166 if( +�l�d +) ; + +2167 if(! +cur_bridge +){ + +2168 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Invalid bridge configuration."); + +2169 +MOSQ_ERR_INVAL +; + +2171 if( + `c�f__�r�_�r�g +(& +tok� +, "bridg��m�e_u��ame", & +cur_bridge +-> +�m�e_u��ame +, +�v�� +)� +MOSQ_ERR_INVAL +; + +2173 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Bridge support�ot�vailable."); + +2175 }if(! + `�rcmp +( +tok� +, "websockets_log_level")){ + +2176 #ifde� +WITH_WEBSOCKETS + + +2177 if( + `c�f__�r�_�t +(& +tok� +, "websock�s_log_�v�", & +c�fig +-> +websock�s_log_�v� +, +�v�� +)� +MOSQ_ERR_INVAL +; + +2179 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Websockets support�ot�vailable."); + +2181 }if(! + `�rcmp +( +tok� +, "websockets_headers_size")){ + +2182 #ifde� +WITH_WEBSOCKETS + + +2183 #i� + `def�ed +( +LWS_LIBRARY_VERSION_NUMBER +) && LWS_LIBRARY_VERSION_NUMBER>=1007000 + +2184 if( + `c�f__�r�_�t +(& +tok� +, "websock�s_h�d�s_size", & +c�fig +-> +websock�s_h�d�s_size +, +�v�� +)� +MOSQ_ERR_INVAL +; + +2186 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Websockets headers size�equire�ibwebsocket 1.7+"); + +2189 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Websockets support�ot�vailable."); + +2191 }if(! + `�rcmp +( +tok� +, "trace_level") + +2192 || ! + `�rcmp +( +tok� +, "ffdc_output") + +2193 || ! + `�rcmp +( +tok� +, "max_log_entries") + +2194 || ! + `�rcmp +( +tok� +, "trace_output")){ + +2195 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "W�n�g: Unsu�܋d�smb c�figu�ti� o�i� \"%s\".", +tok� +); + +2197 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Unknow�c�figu�ti� v��b� \"%s\".", +tok� +); + +2198 +MOSQ_ERR_INVAL +; + +2203 +MOSQ_ERR_SUCCESS +; + +2204 + } +} + +2206 + $c�fig__�ad_f�e +( +mosqu�to__c�fig + * +c�fig +, +bo� + +�l�d +, cڡ * +f�e +, +c�fig_�cur� + * +� +, +�v� +, * +l��o +) + +2208 +rc +; + +2209 +FILE + * +� + = +NULL +; + +2210 * +buf +; + +2211 +bu� +; + +2213 +� + = + `mosqu�to__fݒ +( +f�e +, "�", +�l� +); + +2214 if(! +� +){ + +2215 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: U�bˁ�ݒ c�fig f��%s.", +f�e +); + +2219 +bu� + = 1000; + +2220 +buf + = + `mosqu�to__m�loc +( +bu� +); + +2221 if(! +buf +){ + +2222 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +2223 + `f�o� +( +� +); + +2224 +MOSQ_ERR_NOMEM +; + +2227 +rc + = + `c�fig__�ad_f�e_c�e +( +c�fig +, +�l�d +, +� +, +�v� +, +l��o +, +� +, & +buf +, & +bu� +); + +2228 + `mosqu�to__� +( +buf +); + +2229 + `f�o� +( +� +); + +2231 +rc +; + +2232 + } +} + +2235 + $c�fig__check +( +mosqu�to__c�fig + * +c�fig +) + +2239 +i +; + +2241 #ifde� +WITH_BRIDGE + + +2242 +j +; + +2243 +mosqu�to__bridge + * +bridge1 +, * +bridge2 +; + +2244 +ho��me +[256]; + +2245 +�n +; + +2249 +i +=0; i< +c�fig +-> +bridge_cou� +; i++){ + +2250 +bridge1 + = & +c�fig +-> +bridges +[ +i +]; + +2252 if(! +bridge1 +-> +�m�e_���id +){ + +2253 if(! + `g�ho��me +( +ho��me +, 256)){ + +2254 +�n + = + `��� +( +ho��me +�+ s��n( +bridge1 +-> +�me +) + 2; + +2255 +bridge1 +-> +�m�e_���id + = + `mosqu�to__m�loc +( +�n +); + +2256 if(! +bridge1 +-> +�m�e_���id +){ + +2257 +MOSQ_ERR_NOMEM +; + +2259 + `���tf +( +bridge1 +-> +�m�e_���id +, +�n +, "%s.%s", +ho��me +, bridge1-> +�me +); + +2265 if(! +bridge1 +-> +lo�l_���id +){ + +2266 +�n + = + `��� +( +bridge1 +-> +�m�e_���id +) + strlen("local.") + 2; + +2267 +bridge1 +-> +lo�l_���id + = + `mosqu�to__m�loc +( +�n +); + +2268 if(! +bridge1 +-> +lo�l_���id +){ + +2269 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +2270 +MOSQ_ERR_NOMEM +; + +2272 + `���tf +( +bridge1 +-> +lo�l_���id +, +�n +, "lo�l.%s", bridge1-> +�m�e_���id +); + +2276 +i +=0; i< +c�fig +-> +bridge_cou� +; i++){ + +2277 +bridge1 + = & +c�fig +-> +bridges +[ +i +]; + +2278 +j += +i ++1; j< +c�fig +-> +bridge_cou� +; j++){ + +2279 +bridge2 + = & +c�fig +-> +bridges +[ +j +]; + +2280 if(! + `�rcmp +( +bridge1 +-> +lo�l_���id +, +bridge2 +->local_clientid)){ + +2281 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Bridge�ocal_clientid " + +2284 +bridge1 +-> +lo�l_���id +); + +2285 +MOSQ_ERR_INVAL +; + +2292 if( +c�fig +-> +�r_li���_���gs +){ + +2293 +i +=0; i< +c�fig +-> +li���_cou� +; i++){ + +2294 if(! +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +auto_id_�efix +){ + +2295 +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +auto_id_�efix + = + `mosqu�to__�rdup +("auto-"); + +2296 if(! +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +auto_id_�efix +){ + +2297 +MOSQ_ERR_NOMEM +; + +2299 +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +auto_id_�efix_�n + = + `��� +("auto-"); + +2303 if(! +c�fig +-> +�cur�y_�ti�s +. +auto_id_�efix +){ + +2304 +c�fig +-> +�cur�y_�ti�s +. +auto_id_�efix + = + `mosqu�to__�rdup +("auto-"); + +2305 if(! +c�fig +-> +�cur�y_�ti�s +. +auto_id_�efix +){ + +2306 +MOSQ_ERR_NOMEM +; + +2308 +c�fig +-> +�cur�y_�ti�s +. +auto_id_�efix_�n + = + `��� +("auto-"); + +2312 +MOSQ_ERR_SUCCESS +; + +2313 + } +} + +2316 + $c�f__�r�_bo� +(** +tok� +, cڡ * +�me +, +bo� + * +v�ue +, * +�v�� +) + +2318 * +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +2319 if(* +tok� +){ + +2320 if(! + `�rcmp +(* +tok� +, "false") || !strcmp(*token, "0")){ + +2321 * +v�ue + = +�l� +; + +2322 }if(! + `�rcmp +(* +tok� +, "true") || !strcmp(*token, "1")){ + +2323 * +v�ue + = +�ue +; + +2325 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id %�v�u�(%s).", +�me +, * +tok� +); + +2326 +MOSQ_ERR_INVAL +; + +2329 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Em�y %�v�u�� c�figu�ti�.", +�me +); + +2330 +MOSQ_ERR_INVAL +; + +2333 +MOSQ_ERR_SUCCESS +; + +2334 + } +} + +2336 + $c�f__�r�_�t +(** +tok� +, cڡ * +�me +, * +v�ue +, * +�v�� +) + +2338 * +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +2339 if(* +tok� +){ + +2340 * +v�ue + = + `�oi +(* +tok� +); + +2342 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Em�y %�v�u�� c�figu�ti�.", +�me +); + +2343 +MOSQ_ERR_INVAL +; + +2346 +MOSQ_ERR_SUCCESS +; + +2347 + } +} + +2349 + $c�f__�r�_ssize_t +(** +tok� +, cڡ * +�me +, +ssize_t + * +v�ue +, * +�v�� +) + +2351 * +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +2352 if(* +tok� +){ + +2353 * +v�ue + = + `�� +(* +tok� +); + +2355 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Em�y %�v�u�� c�figu�ti�.", +�me +); + +2356 +MOSQ_ERR_INVAL +; + +2359 +MOSQ_ERR_SUCCESS +; + +2360 + } +} + +2362 + $c�f__�r�_�r�g +(** +tok� +, cڡ * +�me +, ** +v�ue +, * +�v�� +) + +2364 * +tok� + = + `��ok_r +( +NULL +, "", & +�v�� +); + +2365 if(* +tok� +){ + +2366 if(* +v�ue +){ + +2367 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Du�i�� %�v�u�� c�figu�ti�.", +�me +); + +2368 +MOSQ_ERR_INVAL +; + +2371 (* +tok� +)[0] == ' ' || (*token)[0] == '\t'){ + +2372 (* +tok� +)++; + +2374 if( + `mosqu�to_v�id�e_utf8 +(* +tok� +, + `��� +(*token))){ + +2375 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Malformed UTF-8 in configuration."); + +2376 +MOSQ_ERR_INVAL +; + +2378 * +v�ue + = + `mosqu�to__�rdup +(* +tok� +); + +2379 if(!* +v�ue +){ + +2380 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +2381 +MOSQ_ERR_NOMEM +; + +2384 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Em�y %�v�u�� c�figu�ti�.", +�me +); + +2385 +MOSQ_ERR_INVAL +; + +2387 +MOSQ_ERR_SUCCESS +; + +2388 + } +} + + @src/conf_includedir.c + +17 + ~"c�fig.h +" + +19 + ~<�y�.h +> + +20 + ~<lim�s.h +> + +21 + ~<�dio.h +> + +22 + ~<�dlib.h +> + +23 + ~<�r�g.h +> + +24 + ~<��o.h +> + +26 #ifde� +WIN32 + + +28 + ~<d��t.h +> + +31 #i�de� +WIN32 + + +32 + ~<�r�gs.h +> + +33 + ~<�tdb.h +> + +34 + ~<sys/sock�.h +> + +36 + ~<w�sock2.h +> + +37 + ~<ws2t��.h +> + +40 #i�! +def�ed +( +WIN32 +�&& !def�ed( +__CYGWIN__ +�&& !def�ed( +__QNX__ +) + +41 + ~<sys/sy�og.h +> + +44 + ~"mosqu�to_brok�_����.h +" + +45 + ~"mem�y_mosq.h +" + +46 + ~"�s_mosq.h +" + +47 + ~"ut�_mosq.h +" + +48 + ~"mq�_��oc�.h +" + +51 + $scmp_p +(cڡ * +p1 +, cڡ * +p2 +) + +53 cڡ * +s1 + = *(cڡ **) +p1 +; + +54 cڡ * +s2 + = *(cڡ **) +p2 +; + +55 +�su� +; + +57 +s1 +[0] && +s2 +[0]){ + +59 +�su� + = + `tou�� +( +s1 +[0]�-�ou��( +s2 +[0]); + +60 if( +�su� + == 0){ + +62 +�su� + = +s1 +[0] - +s2 +[0]; + +63 if( +�su� + != 0){ + +64 +�su� +; + +68 +�su� +; + +70 +s1 +++; + +71 +s2 +++; + +74 +s1 +[0] - +s2 +[0]; + +75 + } +} + +77 #ifde� +WIN32 + + +78 + $c�fig__g�_d�_f�es +(cڡ * +��ude_d� +, *** +f�es +, * +f�e_cou� +) + +80 +�n +; + +81 +i +; + +82 ** +l_f�es + = +NULL +; + +83 +l_f�e_cou� + = 0; + +84 ** +f�es_tmp +; + +86 +HANDLE + +fh +; + +87 +d��th +[ +MAX_PATH +]; + +88 +WIN32_FIND_DATA + +f�d_d�a +; + +90 + `���tf +( +d��th +, +MAX_PATH +, "%s\\*.c�f", +��ude_d� +); + +91 +fh + = + `F�dF��F�e +( +d��th +, & +f�d_d�a +); + +92 if( +fh + =� +INVALID_HANDLE_VALUE +){ + +93 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: U�bˁ�ݒ in�ude_d� '%s'.", +��ude_d� +); + +98 +�n + = + `��� +( +��ude_d� +)+1+���( +f�d_d�a +. +cF�eName +)+1; + +100 +l_f�e_cou� +++; + +101 +f�es_tmp + = + `mosqu�to__��loc +( +l_f�es +, +l_f�e_cou� +*(*)); + +102 if(! +f�es_tmp +){ + +103 +i +=0; i< +l_f�e_cou� +-1; i++){ + +104 + `mosqu�to__� +( +l_f�es +[ +i +]); + +106 + `mosqu�to__� +( +l_f�es +); + +107 + `F�dClo� +( +fh +); + +108 +MOSQ_ERR_NOMEM +; + +110 +l_f�es + = +f�es_tmp +; + +112 +l_f�es +[ +l_f�e_cou� +-1] = + `mosqu�to__m�loc +( +�n ++1); + +113 if(! +l_f�es +[ +l_f�e_cou� +-1]){ + +114 +i +=0; i< +l_f�e_cou� +-1; i++){ + +115 + `mosqu�to__� +( +l_f�es +[ +i +]); + +117 + `mosqu�to__� +( +l_f�es +); + +118 + `F�dClo� +( +fh +); + +119 +MOSQ_ERR_NOMEM +; + +121 + `���tf +( +l_f�es +[ +l_f�e_cou� +-1], +�n +, "%s/%s", +��ude_d� +, +f�d_d�a +. +cF�eName +); + +122 +l_f�es +[ +l_f�e_cou� +-1][ +�n +] = '\0'; + +123 } + `F�dNextF�e +( +fh +, & +f�d_d�a +)); + +125 + `F�dClo� +( +fh +); + +127 if( +l_f�es +){ + +128 + `qs�t +( +l_f�es +, +l_f�e_cou� +, (*), +scmp_p +); + +130 * +f�es + = +l_f�es +; + +131 * +f�e_cou� + = +l_f�e_cou� +; + +134 + } +} + +138 #i�de� +WIN32 + + +140 + $c�fig__g�_d�_f�es +(cڡ * +��ude_d� +, *** +f�es +, * +f�e_cou� +) + +142 ** +l_f�es + = +NULL +; + +143 +l_f�e_cou� + = 0; + +144 ** +f�es_tmp +; + +145 +�n +; + +146 +i +; + +148 +DIR + * +dh +; + +149 +d��t + * +de +; + +151 +dh + = + `ݒd� +( +��ude_d� +); + +152 if(! +dh +){ + +153 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: U�bˁ�ݒ in�ude_d� '%s'.", +��ude_d� +); + +156 ( +de + = + `�add� +( +dh +)�!� +NULL +){ + +157 if( + `��� +( +de +-> +d_�me +) > 5){ + +158 if(! + `�rcmp +(& +de +-> +d_�me +[ + `��� +(de->d_name)-5], ".conf")){ + +159 +�n + = + `��� +( +��ude_d� +)+1+���( +de +-> +d_�me +)+1; + +161 +l_f�e_cou� +++; + +162 +f�es_tmp + = + `mosqu�to__��loc +( +l_f�es +, +l_f�e_cou� +*(*)); + +163 if(! +f�es_tmp +){ + +164 +i +=0; i< +l_f�e_cou� +-1; i++){ + +165 + `mosqu�to__� +( +l_f�es +[ +i +]); + +167 + `mosqu�to__� +( +l_f�es +); + +168 + `�o�d� +( +dh +); + +169 +MOSQ_ERR_NOMEM +; + +171 +l_f�es + = +f�es_tmp +; + +173 +l_f�es +[ +l_f�e_cou� +-1] = + `mosqu�to__m�loc +( +�n ++1); + +174 if(! +l_f�es +[ +l_f�e_cou� +-1]){ + +175 +i +=0; i< +l_f�e_cou� +-1; i++){ + +176 + `mosqu�to__� +( +l_f�es +[ +i +]); + +178 + `mosqu�to__� +( +l_f�es +); + +179 + `�o�d� +( +dh +); + +180 +MOSQ_ERR_NOMEM +; + +182 + `���tf +( +l_f�es +[ +l_f�e_cou� +-1], +�n +, "%s/%s", +��ude_d� +, +de +-> +d_�me +); + +183 +l_f�es +[ +l_f�e_cou� +-1][ +�n +] = '\0'; + +187 + `�o�d� +( +dh +); + +189 if( +l_f�es +){ + +190 + `qs�t +( +l_f�es +, +l_f�e_cou� +, (*), +scmp_p +); + +192 * +f�es + = +l_f�es +; + +193 * +f�e_cou� + = +l_f�e_cou� +; + +196 + } +} + + @src/context.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<time.h +> + +22 + ~"mosqu�to_brok�_����.h +" + +23 + ~"��s_mosq.h +" + +24 + ~"mem�y_mosq.h +" + +25 + ~"�ck�_mosq.h +" + +26 + ~"�ݔty_mosq.h +" + +27 + ~"time_mosq.h +" + +28 + ~"w�l_mosq.h +" + +30 + ~"uthash.h +" + +32 +mosqu�to + * + $cڋxt__�� +( +mosqu�to_db + * +db +, +mosq_sock_t + +sock +) + +34 +mosqu�to + * +cڋxt +; + +35 +add�ss +[1024]; + +37 +cڋxt + = + `mosqu�to__��oc +(1, ( +mosqu�to +)); + +38 if(! +cڋxt +� +NULL +; + +40 +cڋxt +-> +p�lfd_�dex + = -1; + +41 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_�w +); + +42 +cڋxt +-> +sock + = sock; + +43 +cڋxt +-> +ϡ_msg_� + = + `mosqu�to_time +(); + +44 +cڋxt +-> +�xt_msg_out + = + `mosqu�to_time +() + 60; + +45 +cڋxt +-> +k��live + = 60; + +46 +cڋxt +-> +��n_��t + = +�ue +; + +47 +cڋxt +-> +id + = +NULL +; + +48 +cڋxt +-> +ϡ_mid + = 0; + +49 +cڋxt +-> +w�l + = +NULL +; + +50 +cڋxt +-> +u��ame + = +NULL +; + +51 +cڋxt +-> +�ssw�d + = +NULL +; + +52 +cڋxt +-> +li��� + = +NULL +; + +53 +cڋxt +-> +a�_li� + = +NULL +; + +58 +cڋxt +-> +is_bridge + = +�l� +; + +60 +cڋxt +-> +�_�ck� +. +�yl�d + = +NULL +; + +61 + `�ck�__��nup +(& +cڋxt +-> +�_�ck� +); + +62 +cڋxt +-> +out_�ck� + = +NULL +; + +63 +cڋxt +-> +cu��t_out_�ck� + = +NULL +; + +65 +cڋxt +-> +add�ss + = +NULL +; + +66 if(() +sock + >= 0){ + +67 if(! + `�t__sock�_g�_add�ss +( +sock +, +add�ss +, 1024)){ + +68 +cڋxt +-> +add�ss + = + `mosqu�to__�rdup +(address); + +70 if(! +cڋxt +-> +add�ss +){ + +72 + `mosqu�to__� +( +cڋxt +); + +73 +NULL +; + +76 +cڋxt +-> +bridge + = +NULL +; + +77 +cڋxt +-> +msgs_� +. +��ight_maximum + = +db +-> +c�fig +-> +max_��ight_mes�ges +; + +78 +cڋxt +-> +msgs_out +. +��ight_maximum + = +db +-> +c�fig +-> +max_��ight_mes�ges +; + +79 +cڋxt +-> +msgs_� +. +��ight_qu�a + = +db +-> +c�fig +-> +max_��ight_mes�ges +; + +80 +cڋxt +-> +msgs_out +. +��ight_qu�a + = +db +-> +c�fig +-> +max_��ight_mes�ges +; + +81 +cڋxt +-> +maximum_qos + = 2; + +82 #ifde� +WITH_TLS + + +83 +cڋxt +-> +s� + = +NULL +; + +86 if(() +cڋxt +-> +sock + >= 0){ + +87 + `HASH_ADD +( +hh_sock +, +db +-> +cڋxts_by_sock +, +sock +, ( +cڋxt +->sock), context); + +89 +cڋxt +; + +90 + } +} + +98 + $cڋxt__��nup +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +bo� + +do_� +) + +100 +mosqu�to__�ck� + * +�ck� +; + +101 #ifde� +WITH_BRIDGE + + +102 +i +; + +105 if(! +cڋxt +) ; + +107 #ifde� +WITH_BRIDGE + + +108 if( +cڋxt +-> +bridge +){ + +109 +i +=0; i< +db +-> +bridge_cou� +; i++){ + +110 if( +db +-> +bridges +[ +i +] =� +cڋxt +){ + +111 +db +-> +bridges +[ +i +] = +NULL +; + +114 + `mosqu�to__� +( +cڋxt +-> +bridge +-> +lo�l_���id +); + +115 +cڋxt +-> +bridge +-> +lo�l_���id + = +NULL +; + +117 + `mosqu�to__� +( +cڋxt +-> +bridge +-> +lo�l_u��ame +); + +118 +cڋxt +-> +bridge +-> +lo�l_u��ame + = +NULL +; + +120 + `mosqu�to__� +( +cڋxt +-> +bridge +-> +lo�l_�ssw�d +); + +121 +cڋxt +-> +bridge +-> +lo�l_�ssw�d + = +NULL +; + +123 if( +cڋxt +-> +bridge +-> +�m�e_���id + !�cڋxt-> +id +){ + +124 + `mosqu�to__� +( +cڋxt +-> +bridge +-> +�m�e_���id +); + +126 +cڋxt +-> +bridge +-> +�m�e_���id + = +NULL +; + +128 if( +cڋxt +-> +bridge +-> +�m�e_u��ame + !�cڋxt-> +u��ame +){ + +129 + `mosqu�to__� +( +cڋxt +-> +bridge +-> +�m�e_u��ame +); + +131 +cڋxt +-> +bridge +-> +�m�e_u��ame + = +NULL +; + +133 if( +cڋxt +-> +bridge +-> +�m�e_�ssw�d + !�cڋxt-> +�ssw�d +){ + +134 + `mosqu�to__� +( +cڋxt +-> +bridge +-> +�m�e_�ssw�d +); + +136 +cڋxt +-> +bridge +-> +�m�e_�ssw�d + = +NULL +; + +140 + `��s__�_�l +( +cڋxt +); + +142 + `mosqu�to__� +( +cڋxt +-> +auth_m�hod +); + +143 +cڋxt +-> +auth_m�hod + = +NULL +; + +145 + `mosqu�to__� +( +cڋxt +-> +u��ame +); + +146 +cڋxt +-> +u��ame + = +NULL +; + +148 + `mosqu�to__� +( +cڋxt +-> +�ssw�d +); + +149 +cڋxt +-> +�ssw�d + = +NULL +; + +151 + `�t__sock�_�o� +( +db +, +cڋxt +); + +152 if( +do_� + || +cڋxt +-> +��n_��t +){ + +153 + `sub__��n_�ssi� +( +db +, +cڋxt +); + +154 + `db__mes�ges_d��e +( +db +, +cڋxt +); + +157 + `mosqu�to__� +( +cڋxt +-> +add�ss +); + +158 +cڋxt +-> +add�ss + = +NULL +; + +160 + `cڋxt__�nd_w�l +( +db +, +cڋxt +); + +162 if( +cڋxt +-> +id +){ + +163 + `cڋxt__�move_�om_by_id +( +db +, +cڋxt +); + +164 + `mosqu�to__� +( +cڋxt +-> +id +); + +165 +cڋxt +-> +id + = +NULL +; + +167 + `�ck�__��nup +(&( +cڋxt +-> +�_�ck� +)); + +168 if( +cڋxt +-> +cu��t_out_�ck� +){ + +169 + `�ck�__��nup +( +cڋxt +-> +cu��t_out_�ck� +); + +170 + `mosqu�to__� +( +cڋxt +-> +cu��t_out_�ck� +); + +171 +cڋxt +-> +cu��t_out_�ck� + = +NULL +; + +173 +cڋxt +-> +out_�ck� +){ + +174 + `�ck�__��nup +( +cڋxt +-> +out_�ck� +); + +175 +�ck� + = +cڋxt +-> +out_�ck� +; + +176 +cڋxt +-> +out_�ck� + = cڋxt->out_�ck�-> +�xt +; + +177 + `mosqu�to__� +( +�ck� +); + +179 if( +do_� + || +cڋxt +-> +��n_��t +){ + +180 + `db__mes�ges_d��e +( +db +, +cڋxt +); + +182 #i� + `def�ed +( +WITH_BROKER +�&& def�ed( +__GLIBC__ +�&& def�ed( +WITH_ADNS +) + +183 if( +cڋxt +-> +adns +){ + +184 + `gai_�n�l +( +cڋxt +-> +adns +); + +185 + `mosqu�to__� +(( +addr�fo + *) +cڋxt +-> +adns +-> +�_�que� +); + +186 + `mosqu�to__� +( +cڋxt +-> +adns +); + +189 if( +do_� +){ + +190 + `mosqu�to__� +( +cڋxt +); + +192 + } +} + +195 + $cڋxt__�nd_w�l +( +mosqu�to_db + * +db +, +mosqu�to + * +�xt +) + +197 if( +�xt +-> +��e + !� +mosq_cs_disc����g + && ctxt-> +w�l +){ + +198 if( +�xt +-> +w�l_d�ay_��rv� + > 0){ + +199 + `w�l_d�ay__add +( +�xt +); + +203 if( + `mosqu�to_a�_check +( +db +, +�xt +, + +204 +�xt +-> +w�l +-> +msg +. +t�ic +, + +205 +�xt +-> +w�l +-> +msg +. +�yl�d�n +, + +206 +�xt +-> +w�l +-> +msg +. +�yl�d +, + +207 +�xt +-> +w�l +-> +msg +. +qos +, + +208 +�xt +-> +w�l +-> +msg +. +��� +, + +209 +MOSQ_ACL_WRITE +�=� +MOSQ_ERR_SUCCESS +){ + +212 + `db__mes�ges_�sy_queue +( +db +, +�xt +, + +213 +�xt +-> +w�l +-> +msg +. +t�ic +, + +214 +�xt +-> +w�l +-> +msg +. +qos +, + +215 +�xt +-> +w�l +-> +msg +. +�yl�d�n +, + +216 +�xt +-> +w�l +-> +msg +. +�yl�d +, + +217 +�xt +-> +w�l +-> +msg +. +��� +, + +218 +�xt +-> +w�l +-> +exp�y_��rv� +, + +219 & +�xt +-> +w�l +-> +�ݔt�s +); + +222 + `w�l__��r +( +�xt +); + +223 + } +} + +226 + $cڋxt__disc��� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +228 + `�t__sock�_�o� +( +db +, +cڋxt +); + +230 + `cڋxt__�nd_w�l +( +db +, +cڋxt +); + +231 if( +cڋxt +-> +�ssi�_exp�y_��rv� + == 0){ + +233 #ifde� +WITH_BRIDGE + + +234 if(! +cڋxt +-> +bridge +) + +238 if( +cڋxt +-> +w�l_d�ay_��rv� + == 0){ + +240 + `cڋxt__add_to_disu�d +( +db +, +cڋxt +); + +244 + `�ssi�_exp�y__add +( +db +, +cڋxt +); + +246 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_disc���ed +); + +247 + } +} + +249 + $cڋxt__add_to_disu�d +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +251 if( +cڋxt +-> +��e + =� +mosq_cs_disu�d +) ; + +253 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_disu�d +); + +255 if( +cڋxt +-> +id +){ + +256 + `cڋxt__�move_�om_by_id +( +db +, +cڋxt +); + +257 + `mosqu�to__� +( +cڋxt +-> +id +); + +258 +cڋxt +-> +id + = +NULL +; + +261 if( +db +-> +�_f�_� +){ + +262 +cڋxt +-> +f�_�_�xt + = +db +-> +�_f�_� +; + +263 +db +-> +�_f�_� + = +cڋxt +; + +265 +db +-> +�_f�_� + = +cڋxt +; + +267 + } +} + +269 + $cڋxt__�_disu�d +( +mosqu�to_db + * +db +) + +271 +mosqu�to + * +cڋxt +, * +�xt +; + +272 #ifde� +WITH_WEBSOCKETS + + +273 +mosqu�to + * +ϡ + = +NULL +; + +275 + `as�� +( +db +); + +277 +cڋxt + = +db +-> +�_f�_� +; + +278 +cڋxt +){ + +279 #ifde� +WITH_WEBSOCKETS + + +280 if( +cڋxt +-> +wsi +){ + +282 if( +ϡ +){ + +283 +ϡ +-> +f�_�_�xt + = +cڋxt +; + +285 +db +-> +�_f�_� + = +cڋxt +; + +287 +�xt + = +cڋxt +-> +f�_�_�xt +; + +288 +cڋxt +-> +f�_�_�xt + = +NULL +; + +289 +ϡ + = +cڋxt +; + +290 +cڋxt + = +�xt +; + +294 +�xt + = +cڋxt +-> +f�_�_�xt +; + +295 + `cڋxt__��nup +( +db +, +cڋxt +, +�ue +); + +296 +cڋxt + = +�xt +; + +299 +db +-> +�_f�_� + = +NULL +; + +300 + } +} + +303 + $cڋxt__�move_�om_by_id +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +305 if( +cڋxt +-> +�moved_�om_by_id + =� +�l� + && cڋxt-> +id +){ + +306 + `HASH_DELETE +( +hh_id +, +db +-> +cڋxts_by_id +, +cڋxt +); + +307 +cڋxt +-> +�moved_�om_by_id + = +�ue +; + +309 + } +} + +312 + $cڋxt__�t_��e +( +mosqu�to + * +cڋxt +, +mosqu�to_���_��e + +��e +) + +314 if( +cڋxt +-> +��e + !� +mosq_cs_disu�d +){ + +315 +cڋxt +-> +��e + = state; + +317 + } +} + + @src/database.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<�dio.h +> + +21 + ~<u�i�.h +> + +23 + ~"mosqu�to_brok�_����.h +" + +24 + ~"mem�y_mosq.h +" + +25 + ~"�nd_mosq.h +" + +26 + ~"sys_��.h +" + +27 + ~"time_mosq.h +" + +28 + ~"ut�_mosq.h +" + +30 + gmax_��ight_by�s + = 0; + +31 + gmax_queued + = 100; + +32 + gmax_queued_by�s + = 0; + +40 +bo� + + $db__�ady_f�_�ight +( +mosqu�to_msg_d�a + * +msgs +, +qos +) + +42 +bo� + +v�id_by�s +; + +43 +bo� + +v�id_cou� +; + +45 if( +qos + =�0 || ( +msgs +-> +��ight_maximum + =�0 && +max_��ight_by�s + == 0)){ + +46 +�ue +; + +49 +v�id_by�s + = +msgs +-> +msg_by�s12 + < +max_��ight_by�s +; + +50 +v�id_cou� + = +msgs +-> +��ight_qu�a + > 0; + +52 if( +msgs +-> +��ight_maximum + == 0){ + +53 +v�id_by�s +; + +55 if( +max_��ight_by�s + == 0){ + +56 +v�id_cou� +; + +59 +v�id_by�s + && +v�id_cou� +; + +60 + } +} + +71 +bo� + + $db__�ady_f�_queue +( +mosqu�to + * +cڋxt +, +qos +, +mosqu�to_msg_d�a + * +msg_d�a +) + +73 +sour�_cou� +; + +74 +adju�_cou� +; + +75 +sour�_by�s +; + +76 +adju�_by�s + = +max_��ight_by�s +; + +78 if( +max_queued + =�0 && +max_queued_by�s + == 0){ + +79 +�ue +; + +82 if( +qos + == 0){ + +83 +sour�_by�s + = +msg_d�a +-> +msg_by�s +; + +84 +sour�_cou� + = +msg_d�a +-> +msg_cou� +; + +86 +sour�_by�s + = +msg_d�a +-> +msg_by�s12 +; + +87 +sour�_cou� + = +msg_d�a +-> +msg_cou�12 +; + +89 +adju�_cou� + = +msg_d�a +-> +��ight_maximum +; + +92 if( +cڋxt +-> +sock + =� +INVALID_SOCKET +){ + +93 +adju�_by�s + = 0; + +94 +adju�_cou� + = 0; + +97 +bo� + +v�id_by�s + = +sour�_by�s + - +adju�_by�s + < +max_queued_by�s +; + +98 +bo� + +v�id_cou� + = +sour�_cou� + - +adju�_cou� + < +max_queued +; + +100 if( +max_queued_by�s + == 0){ + +101 +v�id_cou� +; + +103 if( +max_queued + == 0){ + +104 +v�id_by�s +; + +107 +v�id_by�s + && +v�id_cou� +; + +108 + } +} + +111 + $db__ݒ +( +mosqu�to__c�fig + * +c�fig +, +mosqu�to_db + * +db +) + +113 +mosqu�to__subh�r + * +subh�r +; + +115 if(! +c�fig + || ! +db +� +MOSQ_ERR_INVAL +; + +117 +db +-> +ϡ_db_id + = 0; + +119 +db +-> +cڋxts_by_id + = +NULL +; + +120 +db +-> +cڋxts_by_sock + = +NULL +; + +121 +db +-> +cڋxts_f�_� + = +NULL +; + +122 #ifde� +WITH_BRIDGE + + +123 +db +-> +bridges + = +NULL +; + +124 +db +-> +bridge_cou� + = 0; + +128 +db +-> +���id_�dex_hash + = +NULL +; + +130 +db +-> +subs + = +NULL +; + +132 +subh�r + = + `sub__add_h�r_��y +( +NULL +, & +db +-> +subs +, "", + `��� +("")); + +133 if(! +subh�r +� +MOSQ_ERR_NOMEM +; + +135 +subh�r + = + `sub__add_h�r_��y +( +NULL +, & +db +-> +subs +, "$SYS", + `��� +("$SYS")); + +136 if(! +subh�r +� +MOSQ_ERR_NOMEM +; + +138 +db +-> +u�wd + = +NULL +; + +140 #ifde� +WITH_PERSISTENCE + + +141 if( + `�rsi�__���e +( +db +)) 1; + +144 +MOSQ_ERR_SUCCESS +; + +145 + } +} + +147 + $subh�r_��n +( +mosqu�to_db + * +db +, +mosqu�to__subh�r + ** +subh�r +) + +149 +mosqu�to__subh�r + * +�� +, * +subh�r_tmp +; + +150 +mosqu�to__sub�af + * +�af +, * +�x��f +; + +152 + `HASH_ITER +( +hh +, * +subh�r +, +�� +, +subh�r_tmp +){ + +153 +�af + = +�� +-> +subs +; + +154 +�af +){ + +155 +�x��f + = +�af +-> +�xt +; + +156 + `mosqu�to__� +( +�af +); + +157 +�af + = +�x��f +; + +159 if( +�� +-> +���ed +){ + +160 + `db__msg_��e_�f_dec +( +db +, & +�� +-> +���ed +); + +162 + `subh�r_��n +( +db +, & +�� +-> +ch�d�n +); + +163 + `mosqu�to__� +( +�� +-> +t�ic +); + +165 + `HASH_DELETE +( +hh +, * +subh�r +, +�� +); + +166 + `mosqu�to__� +( +�� +); + +168 + } +} + +170 + $db__�o� +( +mosqu�to_db + * +db +) + +172 + `subh�r_��n +( +db +, &db-> +subs +); + +173 + `db__msg_��e_��n +( +db +); + +175 +MOSQ_ERR_SUCCESS +; + +176 + } +} + +179 + $db__msg_��e_add +( +mosqu�to_db + * +db +, +mosqu�to_msg_��e + * +��e +) + +181 +��e +-> +�xt + = +db +-> +msg_��e +; + +182 +��e +-> +�ev + = +NULL +; + +183 if( +db +-> +msg_��e +){ + +184 +db +-> +msg_��e +-> +�ev + = +��e +; + +186 +db +-> +msg_��e + = +��e +; + +187 + } +} + +190 + $db__msg_��e_�move +( +mosqu�to_db + * +db +, +mosqu�to_msg_��e + * +��e +) + +192 +i +; + +194 if( +��e +-> +�ev +){ + +195 +��e +-> +�ev +-> +�xt + = store->next; + +196 if( +��e +-> +�xt +){ + +197 +��e +-> +�xt +-> +�ev + = store->prev; + +200 +db +-> +msg_��e + = +��e +-> +�xt +; + +201 if( +��e +-> +�xt +){ + +202 +��e +-> +�xt +-> +�ev + = +NULL +; + +205 +db +-> +msg_��e_cou� +--; + +206 +db +-> +msg_��e_by�s + -� +��e +-> +�yl�d�n +; + +208 + `mosqu�to__� +( +��e +-> +sour�_id +); + +209 + `mosqu�to__� +( +��e +-> +sour�_u��ame +); + +210 if( +��e +-> +de�_ids +){ + +211 +i +=0; i< +��e +-> +de�_id_cou� +; i++){ + +212 + `mosqu�to__� +( +��e +-> +de�_ids +[ +i +]); + +214 + `mosqu�to__� +( +��e +-> +de�_ids +); + +216 + `mosqu�to__� +( +��e +-> +t�ic +); + +217 + `mosqu�to_�ݔty_�_�l +(& +��e +-> +�ݔt�s +); + +218 + `UHPA_FREE_PAYLOAD +( +��e +); + +219 + `mosqu�to__� +( +��e +); + +220 + } +} + +223 + $db__msg_��e_��n +( +mosqu�to_db + * +db +) + +225 +mosqu�to_msg_��e + * +��e +, * +�xt +;; + +227 +��e + = +db +-> +msg_��e +; + +228 +��e +){ + +229 +�xt + = +��e +->next; + +230 + `db__msg_��e_�move +( +db +, +��e +); + +231 +��e + = +�xt +; + +233 + } +} + +235 + $db__msg_��e_�f_�c +( +mosqu�to_msg_��e + * +��e +) + +237 +��e +-> +�f_cou� +++; + +238 + } +} + +240 + $db__msg_��e_�f_dec +( +mosqu�to_db + * +db +, +mosqu�to_msg_��e + ** +��e +) + +242 (* +��e +)-> +�f_cou� +--; + +243 if((* +��e +)-> +�f_cou� + == 0){ + +244 + `db__msg_��e_�move +( +db +, * +��e +); + +245 * +��e + = +NULL +; + +247 + } +} + +250 + $db__msg_��e_com�� +( +mosqu�to_db + * +db +) + +252 +mosqu�to_msg_��e + * +��e +, * +�xt +; + +254 +��e + = +db +-> +msg_��e +; + +255 +��e +){ + +256 +�xt + = +��e +->next; + +257 if( +��e +-> +�f_cou� + < 1){ + +258 + `db__msg_��e_�move +( +db +, +��e +); + +260 +��e + = +�xt +; + +262 + } +} + +265 + $db__mes�ge_�move +( +mosqu�to_db + * +db +, +mosqu�to_msg_d�a + * +msg_d�a +, +mosqu�to_���_msg + * +�em +) + +267 if(! +msg_d�a + || ! +�em +){ + +271 + `DL_DELETE +( +msg_d�a +-> +��ight +, +�em +); + +272 if( +�em +-> +��e +){ + +273 +msg_d�a +-> +msg_cou� +--; + +274 +msg_d�a +-> +msg_by�s + -� +�em +-> +��e +-> +�yl�d�n +; + +275 if( +�em +-> +qos + > 0){ + +276 +msg_d�a +-> +msg_cou�12 +--; + +277 +msg_d�a +-> +msg_by�s12 + -� +�em +-> +��e +-> +�yl�d�n +; + +279 + `db__msg_��e_�f_dec +( +db +, & +�em +-> +��e +); + +282 + `mosqu�to_�ݔty_�_�l +(& +�em +-> +�ݔt�s +); + +283 + `mosqu�to__� +( +�em +); + +284 + } +} + +287 + $db__mes�ge_dequeue_f�� +( +mosqu�to + * +cڋxt +, +mosqu�to_msg_d�a + * +msg_d�a +) + +289 +mosqu�to_���_msg + * +msg +; + +291 +msg + = +msg_d�a +-> +queued +; + +292 + `DL_DELETE +( +msg_d�a +-> +queued +, +msg +); + +293 + `DL_APPEND +( +msg_d�a +-> +��ight +, +msg +); + +294 if( +msg_d�a +-> +��ight_qu�a + > 0){ + +295 +msg_d�a +-> +��ight_qu�a +--; + +297 + } +} + +300 + $db__mes�ge_d��e_outgo�g +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +u�t16_t + +mid +, +mosqu�to_msg_��e + +ex��_��e +, +qos +) + +302 +mosqu�to_���_msg + * +�� +, * +tmp +; + +303 +msg_�dex + = 0; + +305 if(! +cڋxt +� +MOSQ_ERR_INVAL +; + +307 + `DL_FOREACH_SAFE +( +cڋxt +-> +msgs_out +. +��ight +, +�� +, +tmp +){ + +308 +msg_�dex +++; + +309 if( +�� +-> +mid + == mid){ + +310 if( +�� +-> +qos + != qos){ + +311 +MOSQ_ERR_PROTOCOL +; + +312 }if( +qos + =�2 && +�� +-> +��e + !� +ex��_��e +){ + +313 +MOSQ_ERR_PROTOCOL +; + +315 +msg_�dex +--; + +316 + `db__mes�ge_�move +( +db +, & +cڋxt +-> +msgs_out +, +�� +); + +320 + `DL_FOREACH_SAFE +( +cڋxt +-> +msgs_out +. +queued +, +�� +, +tmp +){ + +321 if( +cڋxt +-> +msgs_out +. +��ight_maximum + !�0 && +msg_�dex + >= context->msgs_out.inflight_maximum){ + +325 +msg_�dex +++; + +326 +�� +-> +time�amp + = + `mosqu�to_time +(); + +327 +�� +-> +qos +){ + +329 +�� +-> +��e + = +mosq_ms_publish_qos0 +; + +332 +�� +-> +��e + = +mosq_ms_publish_qos1 +; + +335 +�� +-> +��e + = +mosq_ms_publish_qos2 +; + +338 + `db__mes�ge_dequeue_f�� +( +cڋxt +, &cڋxt-> +msgs_out +); + +341 +MOSQ_ERR_SUCCESS +; + +342 + } +} + +344 + $db__mes�ge_��� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +u�t16_t + +mid +, +mosqu�to_msg_d�e�i� + +d� +, +qos +, +bo� + +��� +, +mosqu�to_msg_��e + * +��ed +, +mosqu�to_�ݔty + * +�ݔt�s +) + +346 +mosqu�to_���_msg + * +msg +; + +347 +mosqu�to_msg_d�a + * +msg_d�a +; + +348 +mosqu�to_msg_��e + +��e + = +mosq_ms_�v�id +; + +349 +rc + = 0; + +350 +i +; + +351 ** +de�_ids +; + +353 + `as�� +( +��ed +); + +354 if(! +cڋxt +� +MOSQ_ERR_INVAL +; + +355 if(! +cڋxt +-> +id +� +MOSQ_ERR_SUCCESS +; + +357 if( +d� + =� +mosq_md_out +){ + +358 +msg_d�a + = & +cڋxt +-> +msgs_out +; + +360 +msg_d�a + = & +cڋxt +-> +msgs_� +; + +370 if( +cڋxt +-> +��oc� + !� +mosq_p_mq�5 + + +371 && +db +-> +c�fig +-> +�low_du�i��_mes�ges + =� +�l� + + +372 && +d� + =� +mosq_md_out + && +��� + =� +�l� + && +��ed +-> +de�_ids +){ + +374 +i +=0; i< +��ed +-> +de�_id_cou� +; i++){ + +375 if(! + `�rcmp +( +��ed +-> +de�_ids +[ +i +], +cڋxt +-> +id +)){ + +377 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +378 +MOSQ_ERR_SUCCESS +; + +382 if( +cڋxt +-> +sock + =� +INVALID_SOCKET +){ + +384 if( +qos + =�0 && ! +db +-> +c�fig +-> +queue_qos0_mes�ges +){ + +385 if(! +cڋxt +-> +bridge +){ + +386 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +389 if( +cڋxt +-> +bridge +-> +��t_ty� + !� +b�_�zy +){ + +390 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +397 if( +cڋxt +-> +sock + !� +INVALID_SOCKET +){ + +398 if( + `db__�ady_f�_�ight +( +msg_d�a +, +qos +)){ + +399 if( +d� + =� +mosq_md_out +){ + +400 +qos +){ + +402 +��e + = +mosq_ms_publish_qos0 +; + +405 +��e + = +mosq_ms_publish_qos1 +; + +408 +��e + = +mosq_ms_publish_qos2 +; + +412 if( +qos + == 2){ + +413 +��e + = +mosq_ms_wa�_f�_pub�l +; + +415 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +419 }if( + `db__�ady_f�_queue +( +cڋxt +, +qos +, +msg_d�a +)){ + +420 +��e + = +mosq_ms_queued +; + +421 +rc + = 2; + +424 if( +cڋxt +-> +is_dr�p�g + =� +�l� +){ + +425 +cڋxt +-> +is_dr�p�g + = +�ue +; + +426 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, + +428 +cڋxt +-> +id +); + +430 + `G_MSGS_DROPPED_INC +(); + +431 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +435 i�( + `db__�ady_f�_queue +( +cڋxt +, +qos +, +msg_d�a +)){ + +436 +��e + = +mosq_ms_queued +; + +438 + `G_MSGS_DROPPED_INC +(); + +439 if( +cڋxt +-> +is_dr�p�g + =� +�l� +){ + +440 +cڋxt +-> +is_dr�p�g + = +�ue +; + +441 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, + +443 +cڋxt +-> +id +); + +445 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +449 + `as�� +( +��e + !� +mosq_ms_�v�id +); + +451 #ifde� +WITH_PERSISTENCE + + +452 if( +��e + =� +mosq_ms_queued +){ + +453 +db +-> +�rsi���_ch�ges +++; + +457 +msg + = + `mosqu�to__m�loc +(( +mosqu�to_���_msg +)); + +458 if(! +msg +� +MOSQ_ERR_NOMEM +; + +459 +msg +-> +�ev + = +NULL +; + +460 +msg +-> +�xt + = +NULL +; + +461 +msg +-> +��e + = +��ed +; + +462 + `db__msg_��e_�f_�c +( +msg +-> +��e +); + +463 +msg +-> +mid + = mid; + +464 +msg +-> +time�amp + = + `mosqu�to_time +(); + +465 +msg +-> +d�e�i� + = +d� +; + +466 +msg +-> +��e + = state; + +467 +msg +-> +dup + = +�l� +; + +468 if( +qos + > +cڋxt +-> +maximum_qos +){ + +469 +msg +-> +qos + = +cڋxt +-> +maximum_qos +; + +471 +msg +-> +qos + = qos; + +473 +msg +-> +��� + =�etain; + +474 +msg +-> +�ݔt�s + =�roperties; + +476 if( +��e + =� +mosq_ms_queued +){ + +477 + `DL_APPEND +( +msg_d�a +-> +queued +, +msg +); + +479 + `DL_APPEND +( +msg_d�a +-> +��ight +, +msg +); + +481 +msg_d�a +-> +msg_cou� +++; + +482 +msg_d�a +-> +msg_by�s ++� +msg +-> +��e +-> +�yl�d�n +; + +483 if( +qos + > 0){ + +484 +msg_d�a +-> +msg_cou�12 +++; + +485 +msg_d�a +-> +msg_by�s12 + +� +msg +-> +��e +-> +�yl�d�n +; + +488 if( +db +-> +c�fig +-> +�low_du�i��_mes�ges + =� +�l� + && +d� + =� +mosq_md_out + && +��� + == false){ + +496 +de�_ids + = + `mosqu�to__��loc +( +��ed +->de�_ids, (*)*(��ed-> +de�_id_cou� ++1)); + +497 if( +de�_ids +){ + +498 +��ed +-> +de�_ids + = dest_ids; + +499 +��ed +-> +de�_id_cou� +++; + +500 +��ed +-> +de�_ids +[��ed-> +de�_id_cou� +-1] = + `mosqu�to__�rdup +( +cڋxt +-> +id +); + +501 if(! +��ed +-> +de�_ids +[��ed-> +de�_id_cou� +-1]){ + +502 +MOSQ_ERR_NOMEM +; + +505 +MOSQ_ERR_NOMEM +; + +508 #ifde� +WITH_BRIDGE + + +509 if( +cڋxt +-> +bridge + && cڋxt->bridge-> +��t_ty� + =� +b�_�zy + + +510 && +cڋxt +-> +sock + =� +INVALID_SOCKET + + +511 && +cڋxt +-> +msgs_out +. +msg_cou� + >�cڋxt-> +bridge +-> +th�sh�d +){ + +513 +cڋxt +-> +bridge +-> +�zy_�c��� + = +�ue +; + +517 if( +d� + =� +mosq_md_out + && +msg +-> +qos + > 0){ + +518 + `ut�__de�em�t_�nd_qu�a +( +cڋxt +); + +520 #ifde� +WITH_WEBSOCKETS + + +521 if( +cڋxt +-> +wsi + && +rc + == 0){ + +522 + `db__mes�ge_wr�e +( +db +, +cڋxt +); + +524 +rc +; + +527 +rc +; + +529 + } +} + +531 + $db__mes�ge_upd�e_outgo�g +( +mosqu�to + * +cڋxt +, +u�t16_t + +mid +, +mosqu�to_msg_��e + +��e +, +qos +) + +533 +mosqu�to_���_msg + * +�� +; + +535 + `DL_FOREACH +( +cڋxt +-> +msgs_out +. +��ight +, +�� +){ + +536 if( +�� +-> +mid + == mid){ + +537 if( +�� +-> +qos + != qos){ + +538 +MOSQ_ERR_PROTOCOL +; + +540 +�� +-> +��e + = state; + +541 +�� +-> +time�amp + = + `mosqu�to_time +(); + +542 +MOSQ_ERR_SUCCESS +; + +545 +MOSQ_ERR_NOT_FOUND +; + +546 + } +} + +549 + $db__mes�ges_d��e_li� +( +mosqu�to_db + * +db +, +mosqu�to_���_msg + ** +h�d +) + +551 +mosqu�to_���_msg + * +�� +, * +tmp +; + +553 + `DL_FOREACH_SAFE +(* +h�d +, +�� +, +tmp +){ + +554 + `DL_DELETE +(* +h�d +, +�� +); + +555 + `db__msg_��e_�f_dec +( +db +, & +�� +-> +��e +); + +556 + `mosqu�to_�ݔty_�_�l +(& +�� +-> +�ݔt�s +); + +557 + `mosqu�to__� +( +�� +); + +559 * +h�d + = +NULL +; + +560 + } +} + +563 + $db__mes�ges_d��e +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +565 if(! +cڋxt +� +MOSQ_ERR_INVAL +; + +567 + `db__mes�ges_d��e_li� +( +db +, & +cڋxt +-> +msgs_� +. +��ight +); + +568 + `db__mes�ges_d��e_li� +( +db +, & +cڋxt +-> +msgs_� +. +queued +); + +569 + `db__mes�ges_d��e_li� +( +db +, & +cڋxt +-> +msgs_out +. +��ight +); + +570 + `db__mes�ges_d��e_li� +( +db +, & +cڋxt +-> +msgs_out +. +queued +); + +572 +cڋxt +-> +msgs_� +. +msg_by�s + = 0; + +573 +cڋxt +-> +msgs_� +. +msg_by�s12 + = 0; + +574 +cڋxt +-> +msgs_� +. +msg_cou� + = 0; + +575 +cڋxt +-> +msgs_� +. +msg_cou�12 + = 0; + +577 +cڋxt +-> +msgs_out +. +msg_by�s + = 0; + +578 +cڋxt +-> +msgs_out +. +msg_by�s12 + = 0; + +579 +cڋxt +-> +msgs_out +. +msg_cou� + = 0; + +580 +cڋxt +-> +msgs_out +. +msg_cou�12 + = 0; + +582 +MOSQ_ERR_SUCCESS +; + +583 + } +} + +585 + $db__mes�ges_�sy_queue +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +t�ic +, +qos +, +u�t32_t + +�yl�d�n +, cڡ * +�yl�d +, +��� +, u�t32_� +mes�ge_exp�y_��rv� +, +mosqu�to_�ݔty + ** +�ݔt�s +) + +587 +mosqu�to_msg_��e + * +��ed +; + +588 * +sour�_id +; + +589 * +t�ic_h�p +; + +590 +mosqu�to__�yl�d_uh� + +�yl�d_uh� +; + +591 +mosqu�to_�ݔty + * +lo�l_�ݔt�s + = +NULL +; + +592 +mosqu�to_msg_�ig� + +�ig� +; + +594 + `as�� +( +db +); + +596 +�yl�d_uh� +. +�r + = +NULL +; + +598 if(! +t�ic +� +MOSQ_ERR_INVAL +; + +599 +t�ic_h�p + = + `mosqu�to__�rdup +( +t�ic +); + +600 if(! +t�ic_h�p +� +MOSQ_ERR_INVAL +; + +602 if( +db +-> +c�fig +-> +���_ava�ab� + =� +�l� +){ + +603 +��� + = 0; + +606 if( + `UHPA_ALLOC +( +�yl�d_uh� +, +�yl�d�n +) == 0){ + +607 + `mosqu�to__� +( +t�ic_h�p +); + +608 +MOSQ_ERR_NOMEM +; + +610 + `mem�y +( + `UHPA_ACCESS +( +�yl�d_uh� +, +�yl�d�n +), +�yl�d +,�ayloadlen); + +612 if( +cڋxt + && cڋxt-> +id +){ + +613 +sour�_id + = +cڋxt +-> +id +; + +615 +sour�_id + = ""; + +617 if( +�ݔt�s +){ + +618 +lo�l_�ݔt�s + = * +�ݔt�s +; + +619 * +�ݔt�s + = +NULL +; + +622 if( +cڋxt +){ + +623 +�ig� + = +mosq_mo_��� +; + +625 +�ig� + = +mosq_mo_brok� +; + +627 if( + `db__mes�ge_��e +( +db +, +cڋxt +, 0, +t�ic_h�p +, +qos +, +�yl�d�n +, & +�yl�d_uh� +, +��� +, & +��ed +, +mes�ge_exp�y_��rv� +, +lo�l_�ݔt�s +, 0, +�ig� +)) 1; + +629 + `sub__mes�ges_queue +( +db +, +sour�_id +, +t�ic_h�p +, +qos +, +��� +, & +��ed +); + +630 + } +} + +633 + $db__mes�ge_��e +( +mosqu�to_db + * +db +, cڡ +mosqu�to + * +sour� +, +u�t16_t + +sour�_mid +, * +t�ic +, +qos +, +u�t32_t + +�yl�d�n +, +mosqu�to__�yl�d_uh� + * +�yl�d +, +��� +, +mosqu�to_msg_��e + ** +��ed +, u�t32_� +mes�ge_exp�y_��rv� +, +mosqu�to_�ݔty + * +�ݔt�s +, +dbid_t + +��e_id +, +mosqu�to_msg_�ig� + +�ig� +) + +635 +mosqu�to_msg_��e + * +�mp + = +NULL +; + +636 +rc + = +MOSQ_ERR_SUCCESS +; + +638 + `as�� +( +db +); + +639 + `as�� +( +��ed +); + +641 +�mp + = + `mosqu�to__��oc +(1, ( +mosqu�to_msg_��e +)); + +642 if(! +�mp +){ + +643 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +644 +rc + = +MOSQ_ERR_NOMEM +; + +645 +�r� +; + +648 +�mp +-> +t�ic + = +NULL +; + +649 +�mp +-> +�yl�d +. +�r + = +NULL +; + +651 +�mp +-> +�f_cou� + = 0; + +652 if( +sour� + && sour�-> +id +){ + +653 +�mp +-> +sour�_id + = + `mosqu�to__�rdup +( +sour� +-> +id +); + +655 +�mp +-> +sour�_id + = + `mosqu�to__�rdup +(""); + +657 if(! +�mp +-> +sour�_id +){ + +658 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +659 +rc + = +MOSQ_ERR_NOMEM +; + +660 +�r� +; + +663 if( +sour� + && sour�-> +u��ame +){ + +664 +�mp +-> +sour�_u��ame + = + `mosqu�to__�rdup +( +sour� +-> +u��ame +); + +665 if(! +�mp +-> +sour�_u��ame +){ + +666 +rc + = +MOSQ_ERR_NOMEM +; + +667 +�r� +; + +670 if( +sour� +){ + +671 +�mp +-> +sour�_li��� + = +sour� +-> +li��� +; + +673 +�mp +-> +sour�_mid + = source_mid; + +674 +�mp +-> +mid + = 0; + +675 +�mp +-> +qos + = qos; + +676 +�mp +-> +��� + =�etain; + +677 +�mp +-> +t�ic + =�opic; + +678 +t�ic + = +NULL +; + +679 +�mp +-> +�yl�d�n + =�ayloadlen; + +680 +�mp +-> +�ݔt�s + =�roperties; + +681 +�mp +-> +�ig� + = origin; + +682 if( +�yl�d�n +){ + +683 + `UHPA_MOVE +( +�mp +-> +�yl�d +, *�yl�d, +�yl�d�n +); + +685 +�mp +-> +�yl�d +. +�r + = +NULL +; + +687 if( +mes�ge_exp�y_��rv� + > 0){ + +688 +�mp +-> +mes�ge_exp�y_time + = + `time +( +NULL +�+ +mes�ge_exp�y_��rv� +; + +690 +�mp +-> +mes�ge_exp�y_time + = 0; + +693 +�mp +-> +de�_ids + = +NULL +; + +694 +�mp +-> +de�_id_cou� + = 0; + +695 +db +-> +msg_��e_cou� +++; + +696 +db +-> +msg_��e_by�s + +� +�yl�d�n +; + +697 (* +��ed +�� +�mp +; + +699 if(! +��e_id +){ + +700 +�mp +-> +db_id + = ++ +db +-> +ϡ_db_id +; + +702 +�mp +-> +db_id + = +��e_id +; + +705 + `db__msg_��e_add +( +db +, +�mp +); + +707 +MOSQ_ERR_SUCCESS +; + +708 +�r� +: + +709 + `mosqu�to__� +( +t�ic +); + +710 if( +�mp +){ + +711 + `mosqu�to__� +( +�mp +-> +sour�_id +); + +712 + `mosqu�to__� +( +�mp +-> +sour�_u��ame +); + +713 + `mosqu�to__� +( +�mp +-> +t�ic +); + +714 + `mosqu�to__� +( +�mp +); + +716 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +717 + `UHPA_FREE +(* +�yl�d +, +�yl�d�n +); + +718 +rc +; + +719 + } +} + +721 + $db__mes�ge_��e_f�d +( +mosqu�to + * +cڋxt +, +u�t16_t + +mid +, +mosqu�to_msg_��e + ** +��ed +) + +723 +mosqu�to_���_msg + * +�� +; + +725 if(! +cڋxt +� +MOSQ_ERR_INVAL +; + +727 * +��ed + = +NULL +; + +728 + `DL_FOREACH +( +cڋxt +-> +msgs_� +. +��ight +, +�� +){ + +729 if( +�� +-> +��e +-> +sour�_mid + =� +mid +){ + +730 * +��ed + = +�� +-> +��e +; + +731 +MOSQ_ERR_SUCCESS +; + +735 + `DL_FOREACH +( +cڋxt +-> +msgs_� +. +queued +, +�� +){ + +736 if( +�� +-> +��e +-> +sour�_mid + =� +mid +){ + +737 * +��ed + = +�� +-> +��e +; + +738 +MOSQ_ERR_SUCCESS +; + +743 + } +} + +747 + $db__mes�ge_�c���_��t_outgo�g +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +749 +mosqu�to_���_msg + * +msg +, * +tmp +; + +751 +cڋxt +-> +msgs_out +. +msg_by�s + = 0; + +752 +cڋxt +-> +msgs_out +. +msg_by�s12 + = 0; + +753 +cڋxt +-> +msgs_out +. +msg_cou� + = 0; + +754 +cڋxt +-> +msgs_out +. +msg_cou�12 + = 0; + +755 +cڋxt +-> +msgs_out +. +��ight_qu�a + = cڋxt->msgs_out. +��ight_maximum +; + +757 + `DL_FOREACH_SAFE +( +cڋxt +-> +msgs_out +. +��ight +, +msg +, +tmp +){ + +758 +cڋxt +-> +msgs_out +. +msg_cou� +++; + +759 +cڋxt +-> +msgs_out +. +msg_by�s + +� +msg +-> +��e +-> +�yl�d�n +; + +760 if( +msg +-> +qos + > 0){ + +761 +cڋxt +-> +msgs_out +. +msg_cou�12 +++; + +762 +cڋxt +-> +msgs_out +. +msg_by�s12 + +� +msg +-> +��e +-> +�yl�d�n +; + +763 + `ut�__de�em�t_��ive_qu�a +( +cڋxt +); + +766 +msg +-> +qos +){ + +768 +msg +-> +��e + = +mosq_ms_publish_qos0 +; + +771 +msg +-> +��e + = +mosq_ms_publish_qos1 +; + +774 if( +msg +-> +��e + =� +mosq_ms_wa�_f�_pubcomp +){ + +775 +msg +-> +��e + = +mosq_ms_��nd_pub�l +; + +777 +msg +-> +��e + = +mosq_ms_publish_qos2 +; + +788 + `DL_FOREACH_SAFE +( +cڋxt +-> +msgs_out +. +queued +, +msg +, +tmp +){ + +789 +cڋxt +-> +msgs_out +. +msg_cou� +++; + +790 +cڋxt +-> +msgs_out +. +msg_by�s + +� +msg +-> +��e +-> +�yl�d�n +; + +791 if( +msg +-> +qos + > 0){ + +792 +cڋxt +-> +msgs_out +. +msg_cou�12 +++; + +793 +cڋxt +-> +msgs_out +. +msg_by�s12 + +� +msg +-> +��e +-> +�yl�d�n +; + +795 if( + `db__�ady_f�_�ight +(& +cڋxt +-> +msgs_out +, +msg +-> +qos +)){ + +796 +msg +-> +qos +){ + +798 +msg +-> +��e + = +mosq_ms_publish_qos0 +; + +801 +msg +-> +��e + = +mosq_ms_publish_qos1 +; + +804 +msg +-> +��e + = +mosq_ms_publish_qos2 +; + +807 + `db__mes�ge_dequeue_f�� +( +cڋxt +, &cڋxt-> +msgs_out +); + +811 +MOSQ_ERR_SUCCESS +; + +812 + } +} + +816 + $db__mes�ge_�c���_��t_�com�g +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +818 +mosqu�to_���_msg + * +msg +, * +tmp +; + +820 +cڋxt +-> +msgs_� +. +msg_by�s + = 0; + +821 +cڋxt +-> +msgs_� +. +msg_by�s12 + = 0; + +822 +cڋxt +-> +msgs_� +. +msg_cou� + = 0; + +823 +cڋxt +-> +msgs_� +. +msg_cou�12 + = 0; + +824 +cڋxt +-> +msgs_� +. +��ight_qu�a + = cڋxt->msgs_�. +��ight_maximum +; + +826 + `DL_FOREACH_SAFE +( +cڋxt +-> +msgs_� +. +��ight +, +msg +, +tmp +){ + +827 +cڋxt +-> +msgs_� +. +msg_cou� +++; + +828 +cڋxt +-> +msgs_� +. +msg_by�s + +� +msg +-> +��e +-> +�yl�d�n +; + +829 if( +msg +-> +qos + > 0){ + +830 +cڋxt +-> +msgs_� +. +msg_cou�12 +++; + +831 +cڋxt +-> +msgs_� +. +msg_by�s12 + +� +msg +-> +��e +-> +�yl�d�n +; + +832 + `ut�__de�em�t_��ive_qu�a +( +cڋxt +); + +835 if( +msg +-> +qos + != 2){ + +838 + `db__mes�ge_�move +( +db +, & +cڋxt +-> +msgs_� +, +msg +); + +851 + `DL_FOREACH_SAFE +( +cڋxt +-> +msgs_� +. +queued +, +msg +, +tmp +){ + +852 +cڋxt +-> +msgs_� +. +msg_cou� +++; + +853 +cڋxt +-> +msgs_� +. +msg_by�s + +� +msg +-> +��e +-> +�yl�d�n +; + +854 if( +msg +-> +qos + > 0){ + +855 +cڋxt +-> +msgs_� +. +msg_cou�12 +++; + +856 +cڋxt +-> +msgs_� +. +msg_by�s12 + +� +msg +-> +��e +-> +�yl�d�n +; + +858 if( + `db__�ady_f�_�ight +(& +cڋxt +-> +msgs_� +, +msg +-> +qos +)){ + +859 +msg +-> +qos +){ + +861 +msg +-> +��e + = +mosq_ms_publish_qos0 +; + +864 +msg +-> +��e + = +mosq_ms_publish_qos1 +; + +867 +msg +-> +��e + = +mosq_ms_publish_qos2 +; + +870 + `db__mes�ge_dequeue_f�� +( +cڋxt +, &cڋxt-> +msgs_� +); + +874 +MOSQ_ERR_SUCCESS +; + +875 + } +} + +878 + $db__mes�ge_�c���_��t +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +880 +rc +; + +882 +rc + = + `db__mes�ge_�c���_��t_outgo�g +( +db +, +cڋxt +); + +883 if( +rc +) �c; + +884 + `db__mes�ge_�c���_��t_�com�g +( +db +, +cڋxt +); + +885 + } +} + +888 + $db__mes�ge_��a�_�com�g +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +u�t16_t + +mid +) + +890 +mosqu�to_���_msg + * +�� +, * +tmp +; + +891 +��� +; + +892 * +t�ic +; + +893 * +sour�_id +; + +894 +msg_�dex + = 0; + +895 +bo� + +d��ed + = +�l� +; + +897 if(! +cڋxt +� +MOSQ_ERR_INVAL +; + +899 + `DL_FOREACH_SAFE +( +cڋxt +-> +msgs_� +. +��ight +, +�� +, +tmp +){ + +900 +msg_�dex +++; + +901 if( +�� +-> +mid + == mid){ + +902 if( +�� +-> +��e +-> +qos + != 2){ + +903 +MOSQ_ERR_PROTOCOL +; + +905 +t�ic + = +�� +-> +��e +->topic; + +906 +��� + = +�� +->retain; + +907 +sour�_id + = +�� +-> +��e +->source_id; + +913 if(! +t�ic + || ! + `sub__mes�ges_queue +( +db +, +sour�_id +,��ic, 2, +��� +, & +�� +-> +��e +)){ + +914 + `db__mes�ge_�move +( +db +, & +cڋxt +-> +msgs_� +, +�� +); + +915 +d��ed + = +�ue +; + +922 + `DL_FOREACH_SAFE +( +cڋxt +-> +msgs_� +. +queued +, +�� +, +tmp +){ + +923 if( +cڋxt +-> +msgs_� +. +��ight_maximum + !�0 && +msg_�dex + >= context->msgs_in.inflight_maximum){ + +927 +msg_�dex +++; + +928 +�� +-> +time�amp + = + `mosqu�to_time +(); + +930 if( +�� +-> +qos + == 2){ + +931 + `�nd__pub�c +( +cڋxt +, +�� +-> +mid +, 0); + +932 +�� +-> +��e + = +mosq_ms_wa�_f�_pub�l +; + +933 + `db__mes�ge_dequeue_f�� +( +cڋxt +, &cڋxt-> +msgs_� +); + +936 if( +d��ed +){ + +937 +MOSQ_ERR_SUCCESS +; + +941 + } +} + +943 + $db__mes�ge_wr�e +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +945 +rc +; + +946 +mosqu�to_���_msg + * +�� +, * +tmp +; + +947 +u�t16_t + +mid +; + +948 +���s +; + +949 +��� +; + +950 cڡ * +t�ic +; + +951 +qos +; + +952 +u�t32_t + +�yl�d�n +; + +953 cڡ * +�yl�d +; + +954 +msg_cou� + = 0; + +955 +mosqu�to_�ݔty + * +cmsg_��s + = +NULL +, * +��e_��s + = NULL; + +956 +time_t + +now + = 0; + +957 +u�t32_t + +exp�y_��rv� +; + +959 if(! +cڋxt + || cڋxt-> +sock + =� +INVALID_SOCKET + + +960 || ( +cڋxt +-> +��e + =� +mosq_cs_c���ed + && !cڋxt-> +id +)){ + +961 +MOSQ_ERR_INVAL +; + +964 if( +cڋxt +-> +��e + !� +mosq_cs_c���ed +){ + +965 +MOSQ_ERR_SUCCESS +; + +968 + `DL_FOREACH_SAFE +( +cڋxt +-> +msgs_� +. +��ight +, +�� +, +tmp +){ + +969 +msg_cou� +++; + +970 +exp�y_��rv� + = 0; + +971 if( +�� +-> +��e +-> +mes�ge_exp�y_time +){ + +972 if( +now + == 0){ + +973 +now + = + `time +( +NULL +); + +975 if( +now + > +�� +-> +��e +-> +mes�ge_exp�y_time +){ + +977 + `db__mes�ge_�move +( +db +, & +cڋxt +-> +msgs_� +, +�� +); + +980 +exp�y_��rv� + = +�� +-> +��e +-> +mes�ge_exp�y_time + - +now +; + +983 +mid + = +�� +->mid; + +984 +���s + = +�� +-> +dup +; + +985 +��� + = +�� +->retain; + +986 +t�ic + = +�� +-> +��e +->topic; + +987 +qos + = +�� +->qos; + +988 +�yl�d�n + = +�� +-> +��e +->payloadlen; + +989 +�yl�d + = + `UHPA_ACCESS_PAYLOAD +( +�� +-> +��e +); + +990 +cmsg_��s + = +�� +-> +�ݔt�s +; + +991 +��e_��s + = +�� +-> +��e +-> +�ݔt�s +; + +993 +�� +-> +��e +){ + +994 +mosq_ms_�nd_pub�c +: + +995 +rc + = + `�nd__pub�c +( +cڋxt +, +mid +, 0); + +996 if(! +rc +){ + +997 +�� +-> +��e + = +mosq_ms_wa�_f�_pub�l +; + +999 +rc +; + +1003 +mosq_ms_��nd_pubcomp +: + +1004 +rc + = + `�nd__pubcomp +( +cڋxt +, +mid +); + +1005 if(! +rc +){ + +1006 +�� +-> +��e + = +mosq_ms_wa�_f�_pub�l +; + +1008 +rc +; + +1012 +mosq_ms_�v�id +: + +1013 +mosq_ms_publish_qos0 +: + +1014 +mosq_ms_publish_qos1 +: + +1015 +mosq_ms_publish_qos2 +: + +1016 +mosq_ms_��nd_pub�l +: + +1017 +mosq_ms_wa�_f�_puback +: + +1018 +mosq_ms_wa�_f�_pub�c +: + +1019 +mosq_ms_wa�_f�_pub�l +: + +1020 +mosq_ms_wa�_f�_pubcomp +: + +1021 +mosq_ms_queued +: + +1026 + `DL_FOREACH_SAFE +( +cڋxt +-> +msgs_out +. +��ight +, +�� +, +tmp +){ + +1027 +msg_cou� +++; + +1028 +exp�y_��rv� + = 0; + +1029 if( +�� +-> +��e +-> +mes�ge_exp�y_time +){ + +1030 if( +now + == 0){ + +1031 +now + = + `time +( +NULL +); + +1033 if( +now + > +�� +-> +��e +-> +mes�ge_exp�y_time +){ + +1035 + `db__mes�ge_�move +( +db +, & +cڋxt +-> +msgs_out +, +�� +); + +1038 +exp�y_��rv� + = +�� +-> +��e +-> +mes�ge_exp�y_time + - +now +; + +1041 +mid + = +�� +->mid; + +1042 +���s + = +�� +-> +dup +; + +1043 +��� + = +�� +->retain; + +1044 +t�ic + = +�� +-> +��e +->topic; + +1045 +qos + = +�� +->qos; + +1046 +�yl�d�n + = +�� +-> +��e +->payloadlen; + +1047 +�yl�d + = + `UHPA_ACCESS_PAYLOAD +( +�� +-> +��e +); + +1048 +cmsg_��s + = +�� +-> +�ݔt�s +; + +1049 +��e_��s + = +�� +-> +��e +-> +�ݔt�s +; + +1051 +�� +-> +��e +){ + +1052 +mosq_ms_publish_qos0 +: + +1053 +rc + = + `�nd__publish +( +cڋxt +, +mid +, +t�ic +, +�yl�d�n +, +�yl�d +, +qos +, +��� +, +���s +, +cmsg_��s +, +��e_��s +, +exp�y_��rv� +); + +1054 if( +rc + =� +MOSQ_ERR_SUCCESS + ||��=� +MOSQ_ERR_OVERSIZE_PACKET +){ + +1055 + `db__mes�ge_�move +( +db +, & +cڋxt +-> +msgs_out +, +�� +); + +1057 +rc +; + +1061 +mosq_ms_publish_qos1 +: + +1062 +rc + = + `�nd__publish +( +cڋxt +, +mid +, +t�ic +, +�yl�d�n +, +�yl�d +, +qos +, +��� +, +���s +, +cmsg_��s +, +��e_��s +, +exp�y_��rv� +); + +1063 if( +rc + =� +MOSQ_ERR_SUCCESS +){ + +1064 +�� +-> +time�amp + = + `mosqu�to_time +(); + +1065 +�� +-> +dup + = 1; + +1066 +�� +-> +��e + = +mosq_ms_wa�_f�_puback +; + +1067 }if( +rc + =� +MOSQ_ERR_OVERSIZE_PACKET +){ + +1068 + `db__mes�ge_�move +( +db +, & +cڋxt +-> +msgs_out +, +�� +); + +1070 +rc +; + +1074 +mosq_ms_publish_qos2 +: + +1075 +rc + = + `�nd__publish +( +cڋxt +, +mid +, +t�ic +, +�yl�d�n +, +�yl�d +, +qos +, +��� +, +���s +, +cmsg_��s +, +��e_��s +, +exp�y_��rv� +); + +1076 if( +rc + =� +MOSQ_ERR_SUCCESS +){ + +1077 +�� +-> +time�amp + = + `mosqu�to_time +(); + +1078 +�� +-> +dup + = 1; + +1079 +�� +-> +��e + = +mosq_ms_wa�_f�_pub�c +; + +1080 }if( +rc + =� +MOSQ_ERR_OVERSIZE_PACKET +){ + +1081 + `db__mes�ge_�move +( +db +, & +cڋxt +-> +msgs_out +, +�� +); + +1083 +rc +; + +1087 +mosq_ms_��nd_pub�l +: + +1088 +rc + = + `�nd__pub�l +( +cڋxt +, +mid +); + +1089 if(! +rc +){ + +1090 +�� +-> +��e + = +mosq_ms_wa�_f�_pubcomp +; + +1092 +rc +; + +1096 +mosq_ms_�v�id +: + +1097 +mosq_ms_�nd_pub�c +: + +1098 +mosq_ms_��nd_pubcomp +: + +1099 +mosq_ms_wa�_f�_puback +: + +1100 +mosq_ms_wa�_f�_pub�c +: + +1101 +mosq_ms_wa�_f�_pub�l +: + +1102 +mosq_ms_wa�_f�_pubcomp +: + +1103 +mosq_ms_queued +: + +1108 + `DL_FOREACH_SAFE +( +cڋxt +-> +msgs_� +. +queued +, +�� +, +tmp +){ + +1109 if( +cڋxt +-> +msgs_out +. +��ight_maximum + !�0 && cڋxt-> +msgs_� +. +��ight_qu�a + == 0){ + +1113 +msg_cou� +++; + +1115 if( +�� +-> +qos + == 2){ + +1116 +�� +-> +��e + = +mosq_ms_�nd_pub�c +; + +1117 + `db__mes�ge_dequeue_f�� +( +cڋxt +, &cڋxt-> +msgs_� +); + +1118 +rc + = + `�nd__pub�c +( +cڋxt +, +�� +-> +mid +, 0); + +1119 if(! +rc +){ + +1120 +�� +-> +��e + = +mosq_ms_wa�_f�_pub�l +; + +1122 +rc +; + +1127 + `DL_FOREACH_SAFE +( +cڋxt +-> +msgs_out +. +queued +, +�� +, +tmp +){ + +1128 if( +cڋxt +-> +msgs_out +. +��ight_maximum + !�0 && cڋxt->msgs_out. +��ight_qu�a + == 0){ + +1132 +msg_cou� +++; + +1134 +�� +-> +qos +){ + +1136 +�� +-> +��e + = +mosq_ms_publish_qos0 +; + +1139 +�� +-> +��e + = +mosq_ms_publish_qos1 +; + +1142 +�� +-> +��e + = +mosq_ms_publish_qos2 +; + +1145 + `db__mes�ge_dequeue_f�� +( +cڋxt +, &cڋxt-> +msgs_out +); + +1148 +MOSQ_ERR_SUCCESS +; + +1149 + } +} + +1151 + $db__lim�s_�t +( +��ight_by�s +, +queued +, +queued_by�s +) + +1153 +max_��ight_by�s + = +��ight_by�s +; + +1154 +max_queued + = +queued +; + +1155 +max_queued_by�s + = +queued_by�s +; + +1156 + } +} + + @src/db_dump/db_dump.c + +17 + ~<��/��.h +> + +18 + ~<as��.h +> + +19 + ~<��o.h +> + +20 + ~<f��.h +> + +21 + ~<��y�s.h +> + +22 + ~<�dio.h +> + +23 + ~<�dlib.h +> + +24 + ~<�r�g.h +> + +25 + ~<sys/��.h +> + +26 + ~<time.h +> + +28 + ~<mosqu�to_brok�_����.h +> + +29 + ~<mem�y_mosq.h +> + +30 + ~<�rsi�.h +> + +32 + #mosqu�to__m�loc +( +A +� + `m�loc +((A)) + + ) + +33 + #mosqu�to__� +( +A +� + `� +((A)) + + ) + +34 + #_mosqu�to_m�loc +( +A +� + `m�loc +((A)) + + ) + +35 + #_mosqu�to_� +( +A +� + `� +((A)) + + ) + +36 + ~<uthash.h +> + +38 cڡ + gmagic +[15] = {0x00, 0xB5, 0x00, 'm','o','s','q','u','i','t','t','o',' ','d','b'}; + +40 + s���_chunk + + +42 +UT_hash_h�d� + + mhh_id +; + +43 * + mid +; + +44 + msubs��ti�s +; + +45 + msubs��ti�_size +; + +46 + mmes�ges +; + +47 + mmes�ge_size +; + +50 + smsg_��e_chunk + + +52 +UT_hash_h�d� + + mhh +; + +53 +dbid_t + + m��e_id +; + +54 +u�t32_t + + m�ngth +; + +57 + sdb_sub + + +59 * + m���_id +; + +60 * + mt�ic +; + +61 +u�t8_t + + mqos +; + +64 + sdb_��� + + +66 * + m���_id +; + +67 +u�t16_t + + mϡ_mid +; + +68 +time_t + + mdisc���_t +; + +71 + sdb_���_msg + + +73 * + m���_id +; + +74 +u�t8_t + + mqos +, + m��� +, + md�e�i� +, + m��e +, + mdup +; + +75 +dbid_t + + m��e_id +; + +76 +u�t16_t + + mmid +; + +79 + sdb_msg + + +81 +dbid_t + + m��e_id +; + +82 +u�t32_t + + m�yl�d�n +; + +83 +u�t16_t + + msour�_mid +, + mmid +; + +84 +u�t8_t + + mqos +, + m��� +; + +85 +u�t8_t + * + m�yl�d +; + +86 * + msour�_id +; + +87 * + msour�_u��ame +; + +88 * + mt�ic +; + +89 +u�t16_t + + msour�_p�t +; + +92 +u�t32_t + + gdb_v�si� +; + +93 + g��s + = 0; + +94 + g���_��s + = 0; + +95 + gdo_��t + = 1; + +97 +���_chunk + * + g���s_by_id + = +NULL +; + +98 +msg_��e_chunk + * + gmsgs_by_id + = +NULL +; + +101 + $�__db_sub +( +db_sub + * +sub +) + +103 i�( +sub +-> +���_id +) { + +104 + `� +( +sub +-> +���_id +); + +106 i�( +sub +-> +t�ic +) { + +107 + `� +( +sub +-> +t�ic +); + +109 + } +} + +112 + $�__db_��� +( +db_��� + * +��� +) + +114 i�( +��� +-> +���_id +) { + +115 + `� +( +��� +-> +���_id +); + +117 + } +} + +120 + $�__db_���_msg +( +db_���_msg + * +msg +) + +122 i�( +msg +-> +���_id +) { + +123 + `� +( +msg +-> +���_id +); + +125 + } +} + +128 + $�__db_msg +( +db_msg + * +msg +) + +130 i�( +msg +-> +sour�_id +) { + +131 + `� +( +msg +-> +sour�_id +); + +133 i�( +msg +-> +t�ic +) { + +134 + `� +( +msg +-> +t�ic +); + +136 i�( +msg +-> +�yl�d +) { + +137 + `� +( +msg +-> +�yl�d +); + +139 + } +} + +142 + $��t_db_��� +( +db_��� + * +��� +, +�ngth +) + +144 + `��tf +("DB_CHUNK_CLIENT:\n"); + +145 + `��tf +("\tL�gth: %d\n", +�ngth +); + +146 + `��tf +("\tCl�� ID: %s\n", +��� +-> +���_id +); + +147 + `��tf +("\tLa� MID: %d\n", +��� +-> +ϡ_mid +); + +148 + `��tf +("\tDisc����ime: %ld\n", +��� +-> +disc���_t +); + +149 + } +} + +152 + $��t_db_���_msg +( +db_���_msg + * +msg +, +�ngth +) + +154 + `��tf +("DB_CHUNK_CLIENT_MSG:\n"); + +155 + `��tf +("\tL�gth: %d\n", +�ngth +); + +156 + `��tf +("\tCl�� ID: %s\n", +msg +-> +���_id +); + +157 + `��tf +("\tStܐID: %" +PRIu64 + "\n", +msg +-> +��e_id +); + +158 + `��tf +("\tMID: %d\n", +msg +-> +mid +); + +159 + `��tf +("\tQoS: %d\n", +msg +-> +qos +); + +160 + `��tf +("\tR�a�: %d\n", +msg +-> +��� +); + +161 + `��tf +("\tD�e�i�: %d\n", +msg +-> +d�e�i� +); + +162 + `��tf +("\tS��: %d\n", +msg +-> +��e +); + +163 + `��tf +("\tDup: %d\n", +msg +-> +dup +); + +164 + } +} + +167 + $��t_db_sub +( +db_sub + * +sub +, +�ngth +) + +169 + `��tf +("DB_CHUNK_SUB:\n"); + +170 + `��tf +("\tL�gth: %d\n", +�ngth +); + +171 + `��tf +("\tCl�� ID: %s\n", +sub +-> +���_id +); + +172 + `��tf +("\tT�ic: %s\n", +sub +-> +t�ic +); + +173 + `��tf +("\tQoS: %d\n", +sub +-> +qos +); + +174 + } +} + +177 + $��t_db_msg +( +db_msg + * +msg +, +�ngth +) + +179 + `��tf +("DB_CHUNK_MSG_STORE:\n"); + +180 + `��tf +("\tL�gth: %d\n", +�ngth +); + +181 + `��tf +("\tStܐID: %" +PRIu64 + "\n", +msg +-> +��e_id +); + +182 + `��tf +("\tSour� ID: %s\n", +msg +-> +sour�_id +); + +183 + `��tf +("\tSour� U��ame: %s\n", +msg +-> +sour�_u��ame +); + +184 + `��tf +("\tSour� P�t: %d\n", +msg +-> +sour�_p�t +); + +185 + `��tf +("\tSour� MID: %d\n", +msg +-> +sour�_mid +); + +186 + `��tf +("\tMID: %d\n", +msg +-> +mid +); + +187 + `��tf +("\tT�ic: %s\n", +msg +-> +t�ic +); + +188 + `��tf +("\tQoS: %d\n", +msg +-> +qos +); + +189 + `��tf +("\tR�a�: %d\n", +msg +-> +��� +); + +190 + `��tf +("\tPayl�d L�gth: %d\n", +msg +-> +�yl�d�n +); + +192 +bo� + +b��y + = +�l� +; + +193 +i +=0; i< +msg +-> +�yl�d�n +; i++){ + +194 if( +msg +-> +�yl�d +[ +i +] =�0� +b��y + = +�ue +; + +196 if( +b��y + =� +�l� + && +msg +-> +�yl�d�n +<256){ + +197 + `��tf +("\tPayl�d: %s\n", +msg +-> +�yl�d +); + +199 + } +} + +202 + $�rsi�__�ad_�r�g +( +FILE + * +db_� +, ** +�r +) + +204 +u�t16_t + +i16�mp +; + +205 +u�t16_t + +�� +; + +206 * +s + = +NULL +; + +208 if( + `�d +(& +i16�mp +, 1, ( +u�t16_t +), +db_� +) != (uint16_t)){ + +209 +MOSQ_ERR_INVAL +; + +212 +�� + = + `�ohs +( +i16�mp +); + +213 if( +�� +){ + +214 +s + = + `mosqu�to__m�loc +( +�� ++1); + +215 if(! +s +){ + +216 + `f�o� +( +db_� +); + +217 + `�r�tf +( +�d�r +, "Error: Out of memory.\n"); + +218 +MOSQ_ERR_NOMEM +; + +220 if( + `�d +( +s +, 1, +�� +, +db_� +) != slen){ + +221 + `mosqu�to__� +( +s +); + +222 + `�r�tf +( +�d�r +, "E��: %s.\n", + `���� +( +��o +)); + +223 +MOSQ_ERR_INVAL +; + +225 +s +[ +�� +] = '\0'; + +228 * +�r + = +s +; + +229 +MOSQ_ERR_SUCCESS +; + +230 + } +} + +233 + $db__���_chunk_���e +( +mosqu�to_db + * +db +, +FILE + * +db_fd +, +db_��� + * +��� +) + +235 +u�t16_t + +i16�mp +; + +236 +rc + = 0; + +237 +���_chunk + * +cc +; + +239 +rc + = + `�rsi�__�ad_�r�g +( +db_fd +, & +��� +-> +���_id +); + +240 if( +rc +){ + +241 + `�r�tf +( +�d�r +, "Error: Corrupt�ersistent database."); + +242 + `f�o� +( +db_fd +); + +243 +rc +; + +246 + `�ad_e +( +db_fd +, & +i16�mp +, ( +u�t16_t +)); + +247 +��� +-> +ϡ_mid + = + `�ohs +( +i16�mp +); + +249 if( +db_v�si� + == 2){ + +250 +��� +-> +disc���_t + = + `time +( +NULL +); + +252 + `�ad_e +( +db_fd +, & +��� +-> +disc���_t +, ( +time_t +)); + +255 if( +���_��s +){ + +256 +cc + = + `��oc +(1, ( +���_chunk +)); + +257 if(! +cc +){ + +258 +��o + = +ENOMEM +; + +259 +�r� +; + +261 +cc +-> +id + = + `�rdup +( +��� +-> +���_id +); + +262 + `HASH_ADD_KEYPTR +( +hh_id +, +���s_by_id +, +cc +-> +id +, + `��� +(cc->id), cc); + +265 +rc +; + +266 +�r� +: + +267 + `�r�tf +( +�d�r +, "E��: %s.", + `���� +( +��o +)); + +268 if( +db_fd +� + `f�o� +(db_fd); + +269 + `� +( +��� +-> +���_id +); + +271 + } +} + +273 + $db__���_msg_chunk_���e +( +mosqu�to_db + * +db +, +FILE + * +db_fd +, +u�t32_t + +�ngth +, +db_���_msg + * +msg +) + +275 +dbid_t + +i64�mp +; + +276 +u�t16_t + +i16�mp +; + +277 +���_chunk + * +cc +; + +278 +msg_��e_chunk + * +msc +; + +279 +rc +; + +281 +rc + = + `�rsi�__�ad_�r�g +( +db_fd +, & +msg +-> +���_id +); + +282 if( +rc +){ + +283 + `�r�tf +( +�d�r +, "Error: Corrupt�ersistent database."); + +284 + `f�o� +( +db_fd +); + +285 +rc +; + +288 + `�ad_e +( +db_fd +, & +i64�mp +, ( +dbid_t +)); + +289 +msg +-> +��e_id + = +i64�mp +; + +291 + `�ad_e +( +db_fd +, & +i16�mp +, ( +u�t16_t +)); + +292 +msg +-> +mid + = + `�ohs +( +i16�mp +); + +294 + `�ad_e +( +db_fd +, & +msg +-> +qos +, ( +u�t8_t +)); + +295 + `�ad_e +( +db_fd +, & +msg +-> +��� +, ( +u�t8_t +)); + +296 + `�ad_e +( +db_fd +, & +msg +-> +d�e�i� +, ( +u�t8_t +)); + +297 + `�ad_e +( +db_fd +, & +msg +-> +��e +, ( +u�t8_t +)); + +298 + `�ad_e +( +db_fd +, & +msg +-> +dup +, ( +u�t8_t +)); + +300 if( +���_��s +){ + +301 + `HASH_FIND +( +hh_id +, +���s_by_id +, +msg +-> +���_id +, + `��� +(msg->���_id), +cc +); + +302 if( +cc +){ + +303 +cc +-> +mes�ges +++; + +304 +cc +-> +mes�ge_size + +� +�ngth +; + +306 + `HASH_FIND +( +hh +, +msgs_by_id +, & +msg +-> +��e_id +, ( +dbid_t +), +msc +); + +307 if( +msc +){ + +308 +cc +-> +mes�ge_size + +� +msc +-> +�ngth +; + +314 +�r� +: + +315 + `�r�tf +( +�d�r +, "E��: %s.", + `���� +( +��o +)); + +316 if( +db_fd +� + `f�o� +(db_fd); + +317 + `� +( +msg +-> +���_id +); + +319 + } +} + +321 + $db__msg_��e_chunk_���e +( +mosqu�to_db + * +db +, +FILE + * +db_fd +, +u�t32_t + +�ngth +, +db_msg + * +msg +) + +323 +dbid_t + +i64�mp +; + +324 +u�t32_t + +i32�mp +; + +325 +u�t16_t + +i16�mp +; + +326 +rc + = 0; + +327 +msg_��e_chunk + * +mcs +; + +329 + `�ad_e +( +db_fd +, & +i64�mp +, ( +dbid_t +)); + +330 +msg +-> +��e_id + = +i64�mp +; + +332 +rc + = + `�rsi�__�ad_�r�g +( +db_fd +, & +msg +-> +sour�_id +); + +333 if( +rc +){ + +334 + `�r�tf +( +�d�r +, "Error: Corrupt�ersistent database."); + +335 + `f�o� +( +db_fd +); + +336 +rc +; + +338 if( +db_v�si� + == 4){ + +339 +rc + = + `�rsi�__�ad_�r�g +( +db_fd +, & +msg +-> +sour�_u��ame +); + +340 if( +rc +){ + +341 + `�r�tf +( +�d�r +, "E��: %s.", + `���� +( +��o +)); + +342 + `f�o� +( +db_fd +); + +343 + `� +( +msg +-> +sour�_id +); + +344 + `� +( +msg +-> +t�ic +); + +345 + `� +( +msg +-> +�yl�d +); + +346 + `� +( +msg +-> +sour�_id +); + +349 + `�ad_e +( +db_fd +, & +i16�mp +, ( +u�t16_t +)); + +350 +msg +-> +sour�_p�t + = + `�ohs +( +i16�mp +); + +354 + `�ad_e +( +db_fd +, & +i16�mp +, ( +u�t16_t +)); + +355 +msg +-> +sour�_mid + = + `�ohs +( +i16�mp +); + +357 + `�ad_e +( +db_fd +, & +i16�mp +, ( +u�t16_t +)); + +358 +msg +-> +mid + = + `�ohs +( +i16�mp +); + +360 +rc + = + `�rsi�__�ad_�r�g +( +db_fd +, & +msg +-> +t�ic +); + +361 if( +rc +){ + +362 + `�r�tf +( +�d�r +, "Error: Corrupt�ersistent database."); + +363 + `f�o� +( +db_fd +); + +364 +rc +; + +367 + `�ad_e +( +db_fd +, & +msg +-> +qos +, ( +u�t8_t +)); + +368 + `�ad_e +( +db_fd +, & +msg +-> +��� +, ( +u�t8_t +)); + +370 + `�ad_e +( +db_fd +, & +i32�mp +, ( +u�t32_t +)); + +371 +msg +-> +�yl�d�n + = + `�ohl +( +i32�mp +); + +373 if( +msg +-> +�yl�d�n +){ + +374 +msg +-> +�yl�d + = + `m�loc +(msg-> +�yl�d�n ++1); + +375 if(! +msg +-> +�yl�d +){ + +376 + `f�o� +( +db_fd +); + +377 + `� +( +msg +-> +sour�_id +); + +378 + `� +( +msg +-> +t�ic +); + +379 + `�r�tf +( +�d�r +, "Error: Out of memory."); + +382 + `mem�t +( +msg +-> +�yl�d +, 0, msg-> +�yl�d�n ++1); + +383 if( + `�d +( +msg +-> +�yl�d +, 1, msg-> +�yl�d�n +, +db_fd +) != msg->payloadlen){ + +384 + `�r�tf +( +�d�r +, "E��: %s.", + `���� +( +��o +)); + +385 + `f�o� +( +db_fd +); + +386 + `� +( +msg +-> +sour�_id +); + +387 + `� +( +msg +-> +t�ic +); + +388 + `� +( +msg +-> +�yl�d +); + +393 if( +���_��s +){ + +394 +mcs + = + `��oc +(1, ( +msg_��e_chunk +)); + +395 if(! +mcs +){ + +396 +��o + = +ENOMEM +; + +397 +�r� +; + +399 +mcs +-> +��e_id + = +msg +->store_id; + +400 +mcs +-> +�ngth + =�ength; + +401 + `HASH_ADD +( +hh +, +msgs_by_id +, +��e_id +, ( +dbid_t +), +mcs +); + +404 +rc +; + +405 +�r� +: + +406 + `�r�tf +( +�d�r +, "E��: %s.", + `���� +( +��o +)); + +407 if( +db_fd +� + `f�o� +(db_fd); + +408 + `� +( +msg +-> +sour�_id +); + +409 + `� +( +msg +-> +t�ic +); + +411 + } +} + +413 + $db__���_chunk_���e +( +mosqu�to_db + * +db +, +FILE + * +db_fd +) + +415 +dbid_t + +i64�mp +, +��e_id +; + +417 if( + `�d +(& +i64�mp +, ( +dbid_t +), 1, +db_fd +) != 1){ + +418 + `�r�tf +( +�d�r +, "E��: %s.", + `���� +( +��o +)); + +419 + `f�o� +( +db_fd +); + +422 +��e_id + = +i64�mp +; + +423 if( +do_��t +� + `��tf +("\tStܐID: %" +PRIu64 + "\n", +��e_id +); + +425 + } +} + +427 + $db__sub_chunk_���e +( +mosqu�to_db + * +db +, +FILE + * +db_fd +, +u�t32_t + +�ngth +, +db_sub + * +sub +) + +429 +rc + = 0; + +430 +���_chunk + * +cc +; + +432 +rc + = + `�rsi�__�ad_�r�g +( +db_fd +, & +sub +-> +���_id +); + +433 if( +rc +){ + +434 + `�r�tf +( +�d�r +, "Error: Corrupt�ersistent database."); + +435 + `f�o� +( +db_fd +); + +436 +rc +; + +439 +rc + = + `�rsi�__�ad_�r�g +( +db_fd +, & +sub +-> +t�ic +); + +440 if( +rc +){ + +441 + `�r�tf +( +�d�r +, "Error: Corrupt�ersistent database."); + +442 + `f�o� +( +db_fd +); + +443 +rc +; + +446 + `�ad_e +( +db_fd +, & +sub +-> +qos +, ( +u�t8_t +)); + +448 if( +���_��s +){ + +449 + `HASH_FIND +( +hh_id +, +���s_by_id +, +sub +-> +���_id +, + `��� +(sub->���_id), +cc +); + +450 if( +cc +){ + +451 +cc +-> +subs��ti�s +++; + +452 +cc +-> +subs��ti�_size + +� +�ngth +; + +456 +rc +; + +457 +�r� +: + +458 + `�r�tf +( +�d�r +, "E��: %s.", + `���� +( +��o +)); + +459 if( +db_fd + >�0� + `f�o� +(db_fd); + +461 + } +} + +463 + $ma� +( +�gc +, * +�gv +[]) + +465 +FILE + * +fd +; + +466 +h�d� +[15]; + +467 +rc + = 0; + +468 +u�t32_t + +�c +; + +469 +dbid_t + +i64�mp +; + +470 +u�t32_t + +i32�mp +, +�ngth +; + +471 +u�t16_t + +i16�mp +, +chunk +; + +472 +u�t8_t + +i8�mp +; + +473 +ssize_t + +�� +; + +474 +mosqu�to_db + +db +; + +475 * +f��ame +; + +476 +cfg_cou� + = 0; + +477 +msg_��e_cou� + = 0; + +478 +���_msg_cou� + = 0; + +479 +���_cou� + = 0; + +480 +sub_cou� + = 0; + +481 +���_cou� + = 0; + +482 +���_chunk + * +cc +, * +cc_tmp +; + +484 if( +�gc + == 2){ + +485 +f��ame + = +�gv +[1]; + +486 }if( +�gc + =�3 && ! + `�rcmp +( +�gv +[1], "--stats")){ + +487 +��s + = 1; + +488 +do_��t + = 0; + +489 +f��ame + = +�gv +[2]; + +490 }if( +�gc + =�3 && ! + `�rcmp +( +�gv +[1], "--client-stats")){ + +491 +���_��s + = 1; + +492 +do_��t + = 0; + +493 +f��ame + = +�gv +[2]; + +495 + `�r�tf +( +�d�r +, "Usage: db_dump [--stats | --client-stats] <mosquitto db filename>\n"); + +498 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +499 +fd + = + `fݒ +( +f��ame +, "rb"); + +500 if(! +fd +) 0; + +501 + `�ad_e +( +fd +, & +h�d� +, 15); + +502 if(! + `memcmp +( +h�d� +, +magic +, 15)){ + +503 if( +do_��t +� + `��tf +("Mosquitto DB dump\n"); + +505 + `�ad_e +( +fd +, & +�c +, ( +u�t32_t +)); + +506 if( +do_��t +� + `��tf +("CRC: %d\n", +�c +); + +507 + `�ad_e +( +fd +, & +i32�mp +, ( +u�t32_t +)); + +508 +db_v�si� + = + `�ohl +( +i32�mp +); + +509 if( +do_��t +� + `��tf +("DB v�si�: %d\n", +db_v�si� +); + +511 +�� + = + `�d +(& +i16�mp +, ( +u�t16_t +), 1, +fd +),�len == 1){ + +512 +chunk + = + `�ohs +( +i16�mp +); + +513 + `�ad_e +( +fd +, & +i32�mp +, ( +u�t32_t +)); + +514 +�ngth + = + `�ohl +( +i32�mp +); + +515 +chunk +){ + +516 +DB_CHUNK_CFG +: + +517 +cfg_cou� +++; + +518 if( +do_��t +� + `��tf +("DB_CHUNK_CFG:\n"); + +519 if( +do_��t +� + `��tf +("\tL�gth: %d\n", +�ngth +); + +520 + `�ad_e +( +fd +, & +i8�mp +, ( +u�t8_t +)); + +521 if( +do_��t +� + `��tf +("\tShutdown: %d\n", +i8�mp +); + +522 + `�ad_e +( +fd +, & +i8�mp +, ( +u�t8_t +)); + +523 if( +do_��t +� + `��tf +("\tDB ID size: %d\n", +i8�mp +); + +524 if( +i8�mp + !�( +dbid_t +)){ + +525 + `�r�tf +( +�d�r +, "Error: Incompatible database configuration (dbid size is %d bytes,�xpected %ld)", + +526 +i8�mp +, ( +dbid_t +)); + +527 + `f�o� +( +fd +); + +530 + `�ad_e +( +fd +, & +i64�mp +, ( +dbid_t +)); + +531 if( +do_��t +� + `��tf +("\tLa� DB ID: %ld\n", () +i64�mp +); + +534 +DB_CHUNK_MSG_STORE +: + +535 +msg_��e_cou� +++; + +536 +db_msg + +msg + = {0}; + +537 if( + `db__msg_��e_chunk_���e +(& +db +, +fd +, +�ngth +, & +msg +)) 1; + +538 if( +do_��t +) { + +539 + `��t_db_msg +(& +msg +, +�ngth +); + +541 + `�__db_msg +(& +msg +); + +544 +DB_CHUNK_CLIENT_MSG +: + +545 +���_msg_cou� +++; + +546 +db_���_msg + +cmsg + = {0}; + +547 if( + `db__���_msg_chunk_���e +(& +db +, +fd +, +�ngth +, & +cmsg +)) 1; + +548 if( +do_��t +) { + +549 + `��t_db_���_msg +(& +cmsg +, +�ngth +); + +551 + `�__db_���_msg +(& +cmsg +); + +554 +DB_CHUNK_RETAIN +: + +555 +���_cou� +++; + +556 if( +do_��t +� + `��tf +("DB_CHUNK_RETAIN:\n"); + +557 if( +do_��t +� + `��tf +("\tL�gth: %d\n", +�ngth +); + +558 if( + `db__���_chunk_���e +(& +db +, +fd +)) 1; + +561 +DB_CHUNK_SUB +: + +562 +sub_cou� +++; + +563 +db_sub + +sub + = {0}; + +564 if( + `db__sub_chunk_���e +(& +db +, +fd +, +�ngth +, & +sub +)) 1; + +565 if( +do_��t +) { + +566 + `��t_db_sub +(& +sub +, +�ngth +); + +568 + `�__db_sub +(& +sub +); + +571 +DB_CHUNK_CLIENT +: + +572 +���_cou� +++; + +573 +db_��� + +��� + = {0}; + +574 if( + `db__���_chunk_���e +(& +db +, +fd +, & +��� +)) 1; + +575 if( +do_��t +) { + +576 + `��t_db_��� +(& +��� +, +�ngth +); + +578 + `�__db_��� +(& +��� +); + +582 + `�r�tf +( +�d�r +, "W�n�g: Unsu�܋d chunk \"%d\" i��rsi���d�aba� f�e. Ignܚg.\n", +chunk +); + +583 + `f�ek +( +fd +, +�ngth +, +SEEK_CUR +); + +587 if( +�� + < 0� +�r� +; + +589 + `�r�tf +( +�d�r +, "Error: Unrecognised file format."); + +590 +rc + = 1; + +593 + `f�o� +( +fd +); + +595 if( +��s +){ + +596 + `��tf +("DB_CHUNK_CFG: %ld\n", +cfg_cou� +); + +597 + `��tf +("DB_CHUNK_MSG_STORE: %ld\n", +msg_��e_cou� +); + +598 + `��tf +("DB_CHUNK_CLIENT_MSG: %ld\n", +���_msg_cou� +); + +599 + `��tf +("DB_CHUNK_RETAIN: %ld\n", +���_cou� +); + +600 + `��tf +("DB_CHUNK_SUB: %ld\n", +sub_cou� +); + +601 + `��tf +("DB_CHUNK_CLIENT: %ld\n", +���_cou� +); + +604 if( +���_��s +){ + +605 + `HASH_ITER +( +hh_id +, +���s_by_id +, +cc +, +cc_tmp +){ + +606 + `��tf +("SC: %d SS: %d MC: %d MS: %ld ", +cc +-> +subs��ti�s +, cc-> +subs��ti�_size +, cc-> +mes�ges +, cc-> +mes�ge_size +); + +607 + `��tf +("%s\n", +cc +-> +id +); + +608 + `� +( +cc +-> +id +); + +612 +rc +; + +613 +�r� +: + +614 + `�r�tf +( +�d�r +, "E��: %s.", + `���� +( +��o +)); + +615 if( +fd + >�0� + `f�o� +(fd); + +617 + } +} + + @src/deps/uthash.h + +24 #i�de� +UTHASH_H + + +25 + #UTHASH_H + + + ) + +27 + ~<�r�g.h +> + +28 + ~<�ddef.h +> + +29 + ~<�dlib.h +> + +35 #ifde� +_MSC_VER + + +36 #i� +_MSC_VER + >�1600 && +def�ed +( +__�lu�lus +) + +37 + #DECLTYPE +( +x +�( + `de�ty� +(x)) + + ) + +39 + #NO_DECLTYPE + + + ) + +40 + #DECLTYPE +( +x +) + + ) + +43 + #DECLTYPE +( +x +�( + `__ty�of +(x)) + + ) + +46 #ifde� +NO_DECLTYPE + + +47 + #DECLTYPE_ASSIGN +( +d� +, +�c +) \ + +49 ** +_da_d� + = (**)(&( +d� +)); \ + +50 * +_da_d� + = (*)( +�c +); \ + +51 } 0) + + ) + +53 + #DECLTYPE_ASSIGN +( +d� +, +�c +) \ + +55 ( +d� +�� + `DECLTYPE +(d�)( +�c +); \ + +56 } 0) + + ) + +60 #ifde� +_MSC_VER + + +61 + tu�t32_t +; + +62 + tu�t8_t +; + +64 + ~<��y�s.h +> + +67 + #UTHASH_VERSION + 1.9.8 + + ) + +69 #i�de� +uthash_�l + + +70 + #uthash_�l +( +msg +� + `ex� +(-1� + + ) + +72 #i�de� +uthash_m�loc + + +73 + #uthash_m�loc +( +sz +� + `m�loc +(sz� + + ) + +75 #i�de� +uthash_� + + +76 + #uthash_� +( +�r +, +sz +� + `� +Ռ� + + ) + +79 #i�de� +uthash_n�x�nd_fyi + + +80 + #uthash_n�x�nd_fyi +( +tbl +� + + ) + +82 #i�de� +uthash_ex�nd_fyi + + +83 + #uthash_ex�nd_fyi +( +tbl +� + + ) + +87 + #HASH_INITIAL_NUM_BUCKETS + 32 + + ) + +88 + #HASH_INITIAL_NUM_BUCKETS_LOG2 + 5 + + ) + +89 + #HASH_BKT_CAPACITY_THRESH + 10 + + ) + +92 + #ELMT_FROM_HH +( +tbl +, +hhp +�((*)(((*)(hhp)�- (�bl)-> +hho +))) + + ) + +94 + #HASH_FIND +( +hh +, +h�d +, +key�r +, +key�n +, +out +) \ + +96 +_hf_bkt +, +_hf_hashv +; \ + +97 +out += +NULL +; \ + +98 i�( +h�d +) { \ + +99 + `HASH_FCN +( +key�r +, +key�n +, ( +h�d +)-> +hh +. +tbl +-> +num_buck�s +, +_hf_hashv +, +_hf_bkt +); \ + +100 i�( + `HASH_BLOOM_TEST +(( +h�d +)-> +hh +. +tbl +, +_hf_hashv +)) { \ + +101 + `HASH_FIND_IN_BKT +(( +h�d +)-> +hh +. +tbl +, hh, (h�d)->hh.tbl-> +buck�s +[ +_hf_bkt + ], \ + +102 +key�r +, +key�n +, +out +); \ + +105 } 0) + + ) + +107 #ifde� +HASH_BLOOM + + +108 + #HASH_BLOOM_BITLEN + (1ULL << +HASH_BLOOM +) + + ) + +109 + #HASH_BLOOM_BYTELEN + ( +HASH_BLOOM_BITLEN +/8�+ ((HASH_BLOOM_BITLEN%8�? 1:0) + + ) + +110 + #HASH_BLOOM_MAKE +( +tbl +) \ + +112 ( +tbl +)-> +bloom_nb�s + = +HASH_BLOOM +; \ + +113 ( +tbl +)-> +bloom_bv + = ( +u�t8_t +*) + `uthash_m�loc +( +HASH_BLOOM_BYTELEN +); \ + +114 i�(!(( +tbl +)-> +bloom_bv +)�{ + `uthash_�l +( "out of memory"); } \ + +115 + `mem�t +(( +tbl +)-> +bloom_bv +, 0, +HASH_BLOOM_BYTELEN +); \ + +116 ( +tbl +)-> +bloom_sig + = +HASH_BLOOM_SIGNATURE +; \ + +117 } 0) + + ) + +119 + #HASH_BLOOM_FREE +( +tbl +) \ + +121 + `uthash_� +(( +tbl +)-> +bloom_bv +, +HASH_BLOOM_BYTELEN +); \ + +122 } 0) + + ) + +124 + #HASH_BLOOM_BITSET +( +bv +, +idx +�(bv[(idx)/8] |�(1U << ((idx)%8))) + + ) + +125 + #HASH_BLOOM_BITTEST +( +bv +, +idx +�(bv[(idx)/8] & (1U << ((idx)%8))) + + ) + +127 + #HASH_BLOOM_ADD +( +tbl +, +hashv +) \ + +128 + `HASH_BLOOM_BITSET +(( +tbl +)-> +bloom_bv +, ( +hashv + & ( +u�t32_t +)((1ULL << (tbl)-> +bloom_nb�s +�- 1))) + + ) + +130 + #HASH_BLOOM_TEST +( +tbl +, +hashv +) \ + +131 + `HASH_BLOOM_BITTEST +(( +tbl +)-> +bloom_bv +, ( +hashv + & ( +u�t32_t +)((1ULL << (tbl)-> +bloom_nb�s +�- 1))) + + ) + +134 + #HASH_BLOOM_MAKE +( +tbl +) + + ) + +135 + #HASH_BLOOM_FREE +( +tbl +) + + ) + +136 + #HASH_BLOOM_ADD +( +tbl +, +hashv +) + + ) + +137 + #HASH_BLOOM_TEST +( +tbl +, +hashv +�(1) + + ) + +138 + #HASH_BLOOM_BYTELEN + 0 + + ) + +141 + #HASH_MAKE_TABLE +( +hh +, +h�d +) \ + +143 ( +h�d +)-> +hh +. +tbl + = ( +UT_hash_�b� +*) + `uthash_m�loc +( \ + +144 ( +UT_hash_�b� +)); \ + +145 i�(!(( +h�d +)-> +hh +. +tbl +)�{ + `uthash_�l +( "out of memory"); } \ + +146 + `mem�t +(( +h�d +)-> +hh +. +tbl +, 0, ( +UT_hash_�b� +)); \ + +147 ( +h�d +)-> +hh +. +tbl +-> +�� + = &((head)->hh); \ + +148 ( +h�d +)-> +hh +. +tbl +-> +num_buck�s + = +HASH_INITIAL_NUM_BUCKETS +; \ + +149 ( +h�d +)-> +hh +. +tbl +-> +log2_num_buck�s + = +HASH_INITIAL_NUM_BUCKETS_LOG2 +; \ + +150 ( +h�d +)-> +hh +. +tbl +-> +hho + = (*)(&(head)->hh) - (*)(head); \ + +151 ( +h�d +)-> +hh +. +tbl +-> +buck�s + = ( +UT_hash_buck� +*) + `uthash_m�loc +( \ + +152 +HASH_INITIAL_NUM_BUCKETS +*( +UT_hash_buck� +)); \ + +153 i�(! ( +h�d +)-> +hh +. +tbl +-> +buck�s +�{ + `uthash_�l +( "out of memory"); } \ + +154 + `mem�t +(( +h�d +)-> +hh +. +tbl +-> +buck�s +, 0, \ + +155 +HASH_INITIAL_NUM_BUCKETS +*( +UT_hash_buck� +)); \ + +156 + `HASH_BLOOM_MAKE +(( +h�d +)-> +hh +. +tbl +); \ + +157 ( +h�d +)-> +hh +. +tbl +-> +sig�tu� + = +HASH_SIGNATURE +; \ + +158 } 0) + + ) + +160 + #HASH_ADD +( +hh +, +h�d +, +f�ld�me +, +key�n_� +, +add +) \ + +161 + `HASH_ADD_KEYPTR +( +hh +, +h�d +,&(( +add +)-> +f�ld�me +), +key�n_� +,add) + + ) + +163 + #HASH_REPLACE +( +hh +, +h�d +, +f�ld�me +, +key�n_� +, +add +, +��a�d +) \ + +165 +��a�d += +NULL +; \ + +166 + `HASH_FIND +( +hh +, +h�d +,&(( +add +)-> +f�ld�me +), +key�n_� +, +��a�d +); \ + +167 i�( +��a�d +!= +NULL +) { \ + +168 + `HASH_DELETE +( +hh +, +h�d +, +��a�d +); \ + +170 + `HASH_ADD +( +hh +, +h�d +, +f�ld�me +, +key�n_� +, +add +); \ + +171 } 0) + + ) + +173 + #HASH_ADD_KEYPTR +( +hh +, +h�d +, +key�r +, +key�n_� +, +add +) \ + +175 +_ha_bkt +; \ + +176 ( +add +)-> +hh +. +�xt + = +NULL +; \ + +177 ( +add +)-> +hh +. +key + = (*) +key�r +; \ + +178 ( +add +)-> +hh +. +key�n + = () +key�n_� +; \ + +179 i�(!( +h�d +)) { \ + +180 +h�d + = ( +add +); \ + +181 ( +h�d +)-> +hh +. +�ev + = +NULL +; \ + +182 + `HASH_MAKE_TABLE +( +hh +, +h�d +); \ + +184 ( +h�d +)-> +hh +. +tbl +-> +�� +-> +�xt + = ( +add +); \ + +185 ( +add +)-> +hh +. +�ev + = + `ELMT_FROM_HH +(( +h�d +)->hh. +tbl +, (h�d)->hh.tbl-> +�� +); \ + +186 ( +h�d +)-> +hh +. +tbl +-> +�� + = &(( +add +)->hh); \ + +188 ( +h�d +)-> +hh +. +tbl +-> +num_�ems +++; \ + +189 ( +add +)-> +hh +. +tbl + = ( +h�d +)->hh.tbl; \ + +190 + `HASH_FCN +( +key�r +, +key�n_� +, ( +h�d +)-> +hh +. +tbl +-> +num_buck�s +, \ + +191 ( +add +)-> +hh +. +hashv +, +_ha_bkt +); \ + +192 + `HASH_ADD_TO_BKT +(( +h�d +)-> +hh +. +tbl +-> +buck�s +[ +_ha_bkt +],&( +add +)->hh); \ + +193 + `HASH_BLOOM_ADD +(( +h�d +)-> +hh +. +tbl +,( +add +)->hh. +hashv +); \ + +194 + `HASH_EMIT_KEY +( +hh +, +h�d +, +key�r +, +key�n_� +); \ + +195 + `HASH_FSCK +( +hh +, +h�d +); \ + +196 } 0) + + ) + +198 + #HASH_TO_BKT +� +hashv +, +num_bkts +, +bkt + ) \ + +200 +bkt + = (( +hashv +�& (( +num_bkts +) - 1)); \ + +201 } 0) + + ) + +215 + #HASH_DELETE +( +hh +, +h�d +, +d��r +) \ + +217 +_hd_bkt +; \ + +218 +UT_hash_h�d� + * +_hd_hh_d� +; \ + +219 i��(( +d��r +)-> +hh +. +�ev + =� +NULL +�&& ((d��r)->hh. +�xt + == NULL) ) { \ + +220 + `uthash_� +(( +h�d +)-> +hh +. +tbl +-> +buck�s +, \ + +221 ( +h�d +)-> +hh +. +tbl +-> +num_buck�s +*( +UT_hash_buck� +) ); \ + +222 + `HASH_BLOOM_FREE +(( +h�d +)-> +hh +. +tbl +); \ + +223 + `uthash_� +(( +h�d +)-> +hh +. +tbl +, ( +UT_hash_�b� +)); \ + +224 +h�d + = +NULL +; \ + +226 +_hd_hh_d� + = &(( +d��r +)-> +hh +); \ + +227 i�(( +d��r +�=� + `ELMT_FROM_HH +(( +h�d +)-> +hh +. +tbl +,(h�d)->hh.tbl-> +�� +)) { \ + +228 ( +h�d +)-> +hh +. +tbl +-> +�� + = \ + +229 ( +UT_hash_h�d� +*)(( +�rdiff_t +)(( +d��r +)-> +hh +. +�ev +) + \ + +230 ( +h�d +)-> +hh +. +tbl +-> +hho +); \ + +232 i�(( +d��r +)-> +hh +. +�ev +) { \ + +233 (( +UT_hash_h�d� +*)(( +�rdiff_t +)(( +d��r +)-> +hh +. +�ev +) + \ + +234 ( +h�d +)-> +hh +. +tbl +-> +hho +))-> +�xt + = ( +d��r +)->hh.next; \ + +236 + `DECLTYPE_ASSIGN +( +h�d +,( +d��r +)-> +hh +. +�xt +); \ + +238 i�( +_hd_hh_d� +-> +�xt +) { \ + +239 (( +UT_hash_h�d� +*)(( +�rdiff_t +) +_hd_hh_d� +-> +�xt + + \ + +240 ( +h�d +)-> +hh +. +tbl +-> +hho +))-> +�ev + = \ + +241 +_hd_hh_d� +-> +�ev +; \ + +243 + `HASH_TO_BKT +� +_hd_hh_d� +-> +hashv +, ( +h�d +)-> +hh +. +tbl +-> +num_buck�s +, +_hd_bkt +); \ + +244 + `HASH_DEL_IN_BKT +( +hh +,( +h�d +)->hh. +tbl +-> +buck�s +[ +_hd_bkt +], +_hd_hh_d� +); \ + +245 ( +h�d +)-> +hh +. +tbl +-> +num_�ems +--; \ + +247 + `HASH_FSCK +( +hh +, +h�d +); \ + +248 } 0) + + ) + +252 + #HASH_FIND_STR +( +h�d +, +f�d�r +, +out +) \ + +253 + `HASH_FIND +( +hh +, +h�d +, +f�d�r +, + `��� +(f�d�r), +out +) + + ) + +254 + #HASH_ADD_STR +( +h�d +, +�rf�ld +, +add +) \ + +255 + `HASH_ADD +( +hh +, +h�d +, +�rf�ld +, + `��� +( +add +->�rf�ld),add) + + ) + +256 + #HASH_REPLACE_STR +( +h�d +, +�rf�ld +, +add +, +��a�d +) \ + +257 + `HASH_REPLACE +( +hh +, +h�d +, +�rf�ld +, + `��� +( +add +->�rf�ld),add, +��a�d +) + + ) + +258 + #HASH_FIND_INT +( +h�d +, +f�d�t +, +out +) \ + +259 + `HASH_FIND +( +hh +, +h�d +, +f�d�t +,(), +out +) + + ) + +260 + #HASH_ADD_INT +( +h�d +, +�tf�ld +, +add +) \ + +261 + `HASH_ADD +( +hh +, +h�d +, +�tf�ld +,(), +add +) + + ) + +262 + #HASH_REPLACE_INT +( +h�d +, +�tf�ld +, +add +, +��a�d +) \ + +263 + `HASH_REPLACE +( +hh +, +h�d +, +�tf�ld +,(), +add +, +��a�d +) + + ) + +264 + #HASH_FIND_PTR +( +h�d +, +f�d�r +, +out +) \ + +265 + `HASH_FIND +( +hh +, +h�d +, +f�d�r +,(*), +out +) + + ) + +266 + #HASH_ADD_PTR +( +h�d +, +�rf�ld +, +add +) \ + +267 + `HASH_ADD +( +hh +, +h�d +, +�rf�ld +,(*), +add +) + + ) + +268 + #HASH_REPLACE_PTR +( +h�d +, +�rf�ld +, +add +) \ + +269 + `HASH_REPLACE +( +hh +, +h�d +, +�rf�ld +,(*), +add +, +��a�d +) + + ) + +270 + #HASH_DEL +( +h�d +, +d��r +) \ + +271 + `HASH_DELETE +( +hh +, +h�d +, +d��r +) + + ) + +276 #ifde� +HASH_DEBUG + + +277 + #HASH_OOPS +(...�d�{ + `�r�tf +( +�d�r +, +__VA_ARGS__ +); + `ex� +(-1); } 0) + + ) + +278 + #HASH_FSCK +( +hh +, +h�d +) \ + +280 +_bkt_i +; \ + +281 +_cou� +, +_bkt_cou� +; \ + +282 * +_�ev +; \ + +283 +UT_hash_h�d� + * +_thh +; \ + +284 i�( +h�d +) { \ + +285 +_cou� + = 0; \ + +286 +_bkt_i + = 0; _bkt_�< ( +h�d +)-> +hh +. +tbl +-> +num_buck�s +; _bkt_i++) { \ + +287 +_bkt_cou� + = 0; \ + +288 +_thh + = ( +h�d +)-> +hh +. +tbl +-> +buck�s +[ +_bkt_i +]. +hh_h�d +; \ + +289 +_�ev + = +NULL +; \ + +290 +_thh +) { \ + +291 i�( +_�ev + !�(*)( +_thh +-> +hh_�ev +)) { \ + +292 + `HASH_OOPS +("invalid hh_prev %p,�ctual %p\n", \ + +293 +_thh +-> +hh_�ev +, +_�ev + ); \ + +295 +_bkt_cou� +++; \ + +296 +_�ev + = (*)( +_thh +); \ + +297 +_thh + = _thh-> +hh_�xt +; \ + +299 +_cou� + +� +_bkt_cou� +; \ + +300 i�(( +h�d +)-> +hh +. +tbl +-> +buck�s +[ +_bkt_i +]. +cou� + !� +_bkt_cou� +) { \ + +301 + `HASH_OOPS +("invalid bucket count %d,�ctual %d\n", \ + +302 ( +h�d +)-> +hh +. +tbl +-> +buck�s +[ +_bkt_i +]. +cou� +, +_bkt_cou� +); \ + +305 i�( +_cou� + !�( +h�d +)-> +hh +. +tbl +-> +num_�ems +) { \ + +306 + `HASH_OOPS +("invalid hh item count %d,�ctual %d\n", \ + +307 ( +h�d +)-> +hh +. +tbl +-> +num_�ems +, +_cou� + ); \ + +310 +_cou� + = 0; \ + +311 +_�ev + = +NULL +; \ + +312 +_thh + = &( +h�d +)-> +hh +; \ + +313 +_thh +) { \ + +314 +_cou� +++; \ + +315 i�( +_�ev + !=(*)( +_thh +-> +�ev +)) { \ + +316 + `HASH_OOPS +("invalid�rev %p,�ctual %p\n", \ + +317 +_thh +-> +�ev +, +_�ev + ); \ + +319 +_�ev + = (*) + `ELMT_FROM_HH +(( +h�d +)-> +hh +. +tbl +, +_thh +); \ + +320 +_thh + = ( _thh-> +�xt + ? ( +UT_hash_h�d� +*)((*)(_thh->next) + \ + +321 ( +h�d +)-> +hh +. +tbl +-> +hho +�: +NULL + ); \ + +323 i�( +_cou� + !�( +h�d +)-> +hh +. +tbl +-> +num_�ems +) { \ + +324 + `HASH_OOPS +("invalid�pp item count %d,�ctual %d\n", \ + +325 ( +h�d +)-> +hh +. +tbl +-> +num_�ems +, +_cou� + ); \ + +328 } 0) + + ) + +330 + #HASH_FSCK +( +hh +, +h�d +) + + ) + +336 #ifde� +HASH_EMIT_KEYS + + +337 + #HASH_EMIT_KEY +( +hh +, +h�d +, +key�r +, +f�ld�n +) \ + +339 +_k�n + = +f�ld�n +; \ + +340 + `wr�e +( +HASH_EMIT_KEYS +, & +_k�n +, (_klen)); \ + +341 + `wr�e +( +HASH_EMIT_KEYS +, +key�r +, +f�ld�n +); \ + +342 } 0) + + ) + +344 + #HASH_EMIT_KEY +( +hh +, +h�d +, +key�r +, +f�ld�n +) + + ) + +348 #ifde� +HASH_FUNCTION + + +349 + #HASH_FCN + +HASH_FUNCTION + + + ) + +351 + #HASH_FCN + +HASH_JEN + + + ) + +355 + #HASH_BER +( +key +, +key�n +, +num_bkts +, +hashv +, +bkt +) \ + +357 +_hb_key�n += +key�n +; \ + +358 * +_hb_key +=(*)( +key +); \ + +359 ( +hashv +) = 0; \ + +360 +_hb_key�n +--�{ ( +hashv +��((hashv�* 33�+ * +_hb_key +++; } \ + +361 +bkt + = ( +hashv +�& ( +num_bkts +-1); \ + +362 } 0) + + ) + +367 + #HASH_SAX +( +key +, +key�n +, +num_bkts +, +hashv +, +bkt +) \ + +369 +_sx_i +; \ + +370 * +_hs_key +=(*)( +key +); \ + +371 +hashv + = 0; \ + +372 +_sx_i +=0; _sx_�< +key�n +; _sx_i++) \ + +373 +hashv + ^�(hashv << 5�+ (hashv >> 2�+ +_hs_key +[ +_sx_i +]; \ + +374 +bkt + = +hashv + & ( +num_bkts +-1); \ + +375 } 0) + + ) + +377 + #HASH_FNV +( +key +, +key�n +, +num_bkts +, +hashv +, +bkt +) \ + +379 +_�_i +; \ + +380 * +_hf_key +=(*)( +key +); \ + +381 +hashv + = 2166136261UL; \ + +382 +_�_i +=0; _�_�< +key�n +; _fn_i++) \ + +383 +hashv + = (hashv * 16777619�^ +_hf_key +[ +_�_i +]; \ + +384 +bkt + = +hashv + & ( +num_bkts +-1); \ + +385 } 0) + + ) + +387 + #HASH_OAT +( +key +, +key�n +, +num_bkts +, +hashv +, +bkt +) \ + +389 +_ho_i +; \ + +390 * +_ho_key +=(*)( +key +); \ + +391 +hashv + = 0; \ + +392 +_ho_i +=0; _ho_�< +key�n +; _ho_i++) { \ + +393 +hashv + +� +_ho_key +[ +_ho_i +]; \ + +394 +hashv + += (hashv << 10); \ + +395 +hashv + ^= (hashv >> 6); \ + +397 +hashv + += (hashv << 3); \ + +398 +hashv + ^= (hashv >> 11); \ + +399 +hashv + += (hashv << 15); \ + +400 +bkt + = +hashv + & ( +num_bkts +-1); \ + +401 } 0) + + ) + +403 + #HASH_JEN_MIX +( +a +, +b +, +c +) \ + +405 +a + -� +b +;� -� +c +;� ^= ( c >> 13 ); \ + +406 +b + -� +c +; b -� +a +; b ^= (� << 8 ); \ + +407 +c + -� +a +; c -� +b +; c ^= ( b >> 13 ); \ + +408 +a + -� +b +;� -� +c +;� ^= ( c >> 12 ); \ + +409 +b + -� +c +; b -� +a +; b ^= (� << 16 ); \ + +410 +c + -� +a +; c -� +b +; c ^= ( b >> 5 ); \ + +411 +a + -� +b +;� -� +c +;� ^= ( c >> 3 ); \ + +412 +b + -� +c +; b -� +a +; b ^= (� << 10 ); \ + +413 +c + -� +a +; c -� +b +; c ^= ( b >> 15 ); \ + +414 } 0) + + ) + +416 + #HASH_JEN +( +key +, +key�n +, +num_bkts +, +hashv +, +bkt +) \ + +418 +_hj_i +, +_hj_j +, +_hj_k +; \ + +419 * +_hj_key +=(*)( +key +); \ + +420 +hashv + = 0xfeedbeef; \ + +421 +_hj_i + = +_hj_j + = 0x9e3779b9; \ + +422 +_hj_k + = () +key�n +; \ + +423 +_hj_k + >= 12) { \ + +424 +_hj_i + +�( +_hj_key +[0] + ( ()_hj_key[1] << 8 ) \ + +425 + ( () +_hj_key +[2] << 16 ) \ + +426 + ( () +_hj_key +[3] << 24 ) ); \ + +427 +_hj_j + +�( +_hj_key +[4] + ( ()_hj_key[5] << 8 ) \ + +428 + ( () +_hj_key +[6] << 16 ) \ + +429 + ( () +_hj_key +[7] << 24 ) ); \ + +430 +hashv + +�( +_hj_key +[8] + ( ()_hj_key[9] << 8 ) \ + +431 + ( () +_hj_key +[10] << 16 ) \ + +432 + ( () +_hj_key +[11] << 24 ) ); \ + +434 + `HASH_JEN_MIX +( +_hj_i +, +_hj_j +, +hashv +); \ + +436 +_hj_key + += 12; \ + +437 +_hj_k + -= 12; \ + +439 +hashv + +� +key�n +; \ + +440 +_hj_k + ) { \ + +441 11: +hashv + +��() +_hj_key +[10] << 24 ); \ + +442 10: +hashv + +��() +_hj_key +[9] << 16 ); \ + +443 9: +hashv + +��() +_hj_key +[8] << 8 ); \ + +444 8: +_hj_j + +��() +_hj_key +[7] << 24 ); \ + +445 7: +_hj_j + +��() +_hj_key +[6] << 16 ); \ + +446 6: +_hj_j + +��() +_hj_key +[5] << 8 ); \ + +447 5: +_hj_j + +� +_hj_key +[4]; \ + +448 4: +_hj_i + +��() +_hj_key +[3] << 24 ); \ + +449 3: +_hj_i + +��() +_hj_key +[2] << 16 ); \ + +450 2: +_hj_i + +��() +_hj_key +[1] << 8 ); \ + +451 1: +_hj_i + +� +_hj_key +[0]; \ + +453 + `HASH_JEN_MIX +( +_hj_i +, +_hj_j +, +hashv +); \ + +454 +bkt + = +hashv + & ( +num_bkts +-1); \ + +455 } 0) + + ) + +458 #unde� +g�16b�s + + +459 #i�( +def�ed +( +__GNUC__ +�&& def�ed( +__i386__ +)�|| def�ed( +__WATCOMC__ +) \ + +460 || +def�ed +( +_MSC_VER +�|| def�ed ( +__BORLANDC__ +�|| + $def�ed + ( +__TURBOC__ +) + +461 + #g�16b�s +( +d +�(*((cڡ +u�t16_t + *�(d))) + + ) + +464 #i�! + `def�ed + ( +g�16b�s +) + +465 + #g�16b�s +( +d +�(((( +u�t32_t +)(((cڡ +u�t8_t + *)(d))[1])) << 8) \ + +466 +( +u�t32_t +)(((cڡ +u�t8_t + *)( +d +))[0]�) + + ) + +468 + #HASH_SFH +( +key +, +key�n +, +num_bkts +, +hashv +, +bkt +) \ + +470 * +_sfh_key +=(*)( +key +); \ + +471 +u�t32_t + +_sfh_tmp +, +_sfh_�n + = +key�n +; \ + +473 +_sfh_�m + = +_sfh_�n + & 3; \ + +474 +_sfh_�n + >>= 2; \ + +475 +hashv + = 0xcafebabe; \ + +478 ; +_sfh_�n + > 0; _sfh_len--) { \ + +479 +hashv + +� + `g�16b�s + ( +_sfh_key +); \ + +480 +_sfh_tmp + = ( +u�t32_t +)( + `g�16b�s + ( +_sfh_key ++2)�<< 11 ^ +hashv +; \ + +481 +hashv + = (hashv << 16�^ +_sfh_tmp +; \ + +482 +_sfh_key + +�2* ( +u�t16_t +); \ + +483 +hashv + += hashv >> 11; \ + +487 +_sfh_�m +) { \ + +488 3: +hashv + +� + `g�16b�s + ( +_sfh_key +); \ + +489 +hashv + ^= hashv << 16; \ + +490 +hashv + ^�( +u�t32_t +)( +_sfh_key +[ ( +u�t16_t +)] << 18); \ + +491 +hashv + += hashv >> 11; \ + +493 2: +hashv + +� + `g�16b�s + ( +_sfh_key +); \ + +494 +hashv + ^= hashv << 11; \ + +495 +hashv + += hashv >> 17; \ + +497 1: +hashv + +�* +_sfh_key +; \ + +498 +hashv + ^= hashv << 10; \ + +499 +hashv + += hashv >> 1; \ + +503 +hashv + ^= hashv << 3; \ + +504 +hashv + += hashv >> 5; \ + +505 +hashv + ^= hashv << 4; \ + +506 +hashv + += hashv >> 17; \ + +507 +hashv + ^= hashv << 25; \ + +508 +hashv + += hashv >> 6; \ + +509 +bkt + = +hashv + & ( +num_bkts +-1); \ + +510 + } +} 0) + + ) + +512 #ifde� +HASH_USING_NO_STRICT_ALIASING + + +522 #i�( +def�ed +( +__i386__ +�|| def�ed( +__x86_64__ +�|| def�ed( +_M_IX86 +)) + +523 + #MUR_GETBLOCK +( +p +, +i +�p[i] + + ) + +525 + #MUR_PLUS0_ALIGNED +( +p +�(((� & 0x3�=�0) + + ) + +526 + #MUR_PLUS1_ALIGNED +( +p +�(((� & 0x3�=�1) + + ) + +527 + #MUR_PLUS2_ALIGNED +( +p +�(((� & 0x3�=�2) + + ) + +528 + #MUR_PLUS3_ALIGNED +( +p +�(((� & 0x3�=�3) + + ) + +529 + #WP +( +p +�(( +u�t32_t +*)(()��& ~3UL)) + + ) + +530 #i�( +def�ed +( +__BIG_ENDIAN__ +�|| def�ed( +SPARC +�|| def�ed( +__�c__ +�|| def�ed( +__�c64__ +)) + +531 + #MUR_THREE_ONE +( +p +�((((* + `WP +�))&0x00ffffff�<< 8�| (((*(WP�)+1))&0xff000000�>> 24)) + + ) + +532 + #MUR_TWO_TWO +( +p +�((((* + `WP +�))&0x0000ffff�<<16�| (((*(WP�)+1))&0xffff0000�>> 16)) + + ) + +533 + #MUR_ONE_THREE +( +p +�((((* + `WP +�))&0x000000ff�<<24�| (((*(WP�)+1))&0xffffff00�>> 8)) + + ) + +535 + #MUR_THREE_ONE +( +p +�((((* + `WP +�))&0xffffff00�>> 8�| (((*(WP�)+1))&0x000000ff�<< 24)) + + ) + +536 + #MUR_TWO_TWO +( +p +�((((* + `WP +�))&0xffff0000�>>16�| (((*(WP�)+1))&0x0000ffff�<< 16)) + + ) + +537 + #MUR_ONE_THREE +( +p +�((((* + `WP +�))&0xff000000�>>24�| (((*(WP�)+1))&0x00ffffff�<< 8)) + + ) + +539 + #MUR_GETBLOCK +( +p +, +i +�( + `MUR_PLUS0_ALIGNED +(p) ? ((p)[i]) : \ + +540 ( + `MUR_PLUS1_ALIGNED +( +p +�? + `MUR_THREE_ONE +(p) : \ + +541 ( + `MUR_PLUS2_ALIGNED +( +p +�? + `MUR_TWO_TWO +(p) : \ + +542 + `MUR_ONE_THREE +( +p +)))) + + ) + +544 + #MUR_ROTL32 +( +x +, +r +�(((x�<< (r)�| ((x�>> (32 - (r)))) + + ) + +545 + #MUR_FMIX +( +_h +) \ + +547 +_h + ^= _h >> 16; \ + +548 +_h + *= 0x85ebca6b; \ + +549 +_h + ^= _h >> 13; \ + +550 +_h + *= 0xc2b2ae35l; \ + +551 +_h + ^= _h >> 16; \ + +552 } 0) + + ) + +554 + #HASH_MUR +( +key +, +key�n +, +num_bkts +, +hashv +, +bkt +) \ + +556 cڡ +u�t8_t + * +_mur_d�a + = (cڡ u�t8_t*)( +key +); \ + +557 cڡ +_mur_nblocks + = ( +key�n +) / 4; \ + +558 +u�t32_t + +_mur_h1 + = 0xf88D5353; \ + +559 +u�t32_t + +_mur_c1 + = 0xcc9e2d51; \ + +560 +u�t32_t + +_mur_c2 + = 0x1b873593; \ + +561 +u�t32_t + +_mur_k1 + = 0; \ + +562 cڡ +u�t8_t + * +_mur_�� +; \ + +563 cڡ +u�t32_t + * +_mur_blocks + = (cڡ u�t32_t*)( +_mur_d�a ++ +_mur_nblocks +*4); \ + +564 +_mur_i +; \ + +565 +_mur_i + = - +_mur_nblocks +; _mur_i; _mur_i++) { \ + +566 +_mur_k1 + = + `MUR_GETBLOCK +( +_mur_blocks +, +_mur_i +); \ + +567 +_mur_k1 + *� +_mur_c1 +; \ + +568 +_mur_k1 + = + `MUR_ROTL32 +(_mur_k1,15); \ + +569 +_mur_k1 + *� +_mur_c2 +; \ + +571 +_mur_h1 + ^� +_mur_k1 +; \ + +572 +_mur_h1 + = + `MUR_ROTL32 +(_mur_h1,13); \ + +573 +_mur_h1 + = _mur_h1*5+0xe6546b64; \ + +575 +_mur_�� + = (cڡ +u�t8_t +*)( +_mur_d�a + + +_mur_nblocks +*4); \ + +576 +_mur_k1 +=0; \ + +577 ( +key�n +) & 3) { \ + +578 3: +_mur_k1 + ^� +_mur_�� +[2] << 16; \ + +579 2: +_mur_k1 + ^� +_mur_�� +[1] << 8; \ + +580 1: +_mur_k1 + ^� +_mur_�� +[0]; \ + +581 +_mur_k1 + *� +_mur_c1 +; \ + +582 +_mur_k1 + = + `MUR_ROTL32 +(_mur_k1,15); \ + +583 +_mur_k1 + *� +_mur_c2 +; \ + +584 +_mur_h1 + ^� +_mur_k1 +; \ + +586 +_mur_h1 + ^�( +key�n +); \ + +587 + `MUR_FMIX +( +_mur_h1 +); \ + +588 +hashv + = +_mur_h1 +; \ + +589 +bkt + = +hashv + & ( +num_bkts +-1); \ + +590 } 0) + + ) + +594 + #HASH_KEYCMP +( +a +, +b +, +�n +� + `memcmp +�,b,�n) + + ) + +597 + #HASH_FIND_IN_BKT +( +tbl +, +hh +, +h�d +, +key�r +, +key�n_� +, +out +) \ + +599 i�( +h�d +. +hh_h�d +� + `DECLTYPE_ASSIGN +( +out +, + `ELMT_FROM_HH +( +tbl +,head.hh_head)); \ + +600 +out += +NULL +; \ + +601 +out +) { \ + +602 i�(( +out +)-> +hh +. +key�n + =� +key�n_� +) { \ + +603 i�(( + `HASH_KEYCMP +(( +out +)-> +hh +. +key +, +key�r +, +key�n_� +)) == 0) ; \ + +605 i�(( +out +)-> +hh +. +hh_�xt +� + `DECLTYPE_ASSIGN +(out, + `ELMT_FROM_HH +( +tbl +,(out)->hh.hh_next)); \ + +606 +out + = +NULL +; \ + +608 } 0) + + ) + +611 + #HASH_ADD_TO_BKT +( +h�d +, +addhh +) \ + +613 +h�d +. +cou� +++; \ + +614 ( +addhh +)-> +hh_�xt + = +h�d +. +hh_h�d +; \ + +615 ( +addhh +)-> +hh_�ev + = +NULL +; \ + +616 i�( +h�d +. +hh_h�d +�{ (h�d).hh_h�d-> +hh_�ev + = ( +addhh +); } \ + +617 ( +h�d +). +hh_h�d += +addhh +; \ + +618 i�( +h�d +. +cou� + >�((h�d. +ex�nd_mu� ++1�* +HASH_BKT_CAPACITY_THRESH +) \ + +619 && ( +addhh +)-> +tbl +-> +n�x�nd + != 1) { \ + +620 + `HASH_EXPAND_BUCKETS +(( +addhh +)-> +tbl +); \ + +622 } 0) + + ) + +625 + #HASH_DEL_IN_BKT +( +hh +, +h�d +, +hh_d� +) \ + +626 ( +h�d +). +cou� +--; \ + +627 i�(( +h�d +). +hh_h�d + =� +hh_d� +) { \ + +628 ( +h�d +). +hh_h�d + = +hh_d� +-> +hh_�xt +; \ + +630 i�( +hh_d� +-> +hh_�ev +) { \ + +631 +hh_d� +-> +hh_�ev +-> +hh_�xt + = hh_del->hh_next; \ + +633 i�( +hh_d� +-> +hh_�xt +) { \ + +634 +hh_d� +-> +hh_�xt +-> +hh_�ev + = hh_del->hh_prev; \ + +635 } + + ) + +666 + #HASH_EXPAND_BUCKETS +( +tbl +) \ + +668 +_he_bkt +; \ + +669 +_he_bkt_i +; \ + +670 +UT_hash_h�d� + * +_he_thh +, * +_he_hh_nxt +; \ + +671 +UT_hash_buck� + * +_he_�w_buck�s +, * +_he_�wbkt +; \ + +672 +_he_�w_buck�s + = ( +UT_hash_buck� +*) + `uthash_m�loc +( \ + +673 2 * +tbl +-> +num_buck�s + * ( +UT_hash_buck� +)); \ + +674 i�(! +_he_�w_buck�s +�{ + `uthash_�l +( "out of memory"); } \ + +675 + `mem�t +( +_he_�w_buck�s +, 0, \ + +676 2 * +tbl +-> +num_buck�s + * ( +UT_hash_buck� +)); \ + +677 +tbl +-> +id�l_cha�_max�n + = \ + +678 ( +tbl +-> +num_�ems + >> (tbl-> +log2_num_buck�s ++1)) + \ + +679 (( +tbl +-> +num_�ems + & (�bl-> +num_buck�s +*2)-1)) ? 1 : 0); \ + +680 +tbl +-> +n�id�l_�ems + = 0; \ + +681 +_he_bkt_i + = 0; _he_bkt_�< +tbl +-> +num_buck�s +; _he_bkt_i++) \ + +683 +_he_thh + = +tbl +-> +buck�s +[ +_he_bkt_i + ]. +hh_h�d +; \ + +684 +_he_thh +) { \ + +685 +_he_hh_nxt + = +_he_thh +-> +hh_�xt +; \ + +686 + `HASH_TO_BKT +� +_he_thh +-> +hashv +, +tbl +-> +num_buck�s +*2, +_he_bkt +); \ + +687 +_he_�wbkt + = &( +_he_�w_buck�s +[ +_he_bkt + ]); \ + +688 i�(++( +_he_�wbkt +-> +cou� +�> +tbl +-> +id�l_cha�_max�n +) { \ + +689 +tbl +-> +n�id�l_�ems +++; \ + +690 +_he_�wbkt +-> +ex�nd_mu� + = _he_�wbkt-> +cou� + / \ + +691 +tbl +-> +id�l_cha�_max�n +; \ + +693 +_he_thh +-> +hh_�ev + = +NULL +; \ + +694 +_he_thh +-> +hh_�xt + = +_he_�wbkt +-> +hh_h�d +; \ + +695 i�( +_he_�wbkt +-> +hh_h�d +�_he_�wbkt->hh_h�d-> +hh_�ev + = \ + +696 +_he_thh +; \ + +697 +_he_�wbkt +-> +hh_h�d + = +_he_thh +; \ + +698 +_he_thh + = +_he_hh_nxt +; \ + +701 + `uthash_� +� +tbl +-> +buck�s +,�bl-> +num_buck�s +*( +UT_hash_buck� +) ); \ + +702 +tbl +-> +num_buck�s + *= 2; \ + +703 +tbl +-> +log2_num_buck�s +++; \ + +704 +tbl +-> +buck�s + = +_he_�w_buck�s +; \ + +705 +tbl +-> +�eff_ex�nds + = (tbl-> +n�id�l_�ems + > (tbl-> +num_�ems + >> 1)) ? \ + +706 ( +tbl +-> +�eff_ex�nds ++1) : 0; \ + +707 i�( +tbl +-> +�eff_ex�nds + > 1) { \ + +708 +tbl +-> +n�x�nd +=1; \ + +709 + `uthash_n�x�nd_fyi +( +tbl +); \ + +711 + `uthash_ex�nd_fyi +( +tbl +); \ + +712 } 0) + + ) + +718 + #HASH_SORT +( +h�d +, +cmpf� +� + `HASH_SRT +( +hh +,h�d,cmpf�) + + ) + +719 + #HASH_SRT +( +hh +, +h�d +, +cmpf� +) \ + +721 +_hs_i +; \ + +722 +_hs_loݚg +, +_hs_nm�ges +, +_hs_�size +, +_hs_psize +, +_hs_qsize +; \ + +723 +UT_hash_h�d� + * +_hs_p +, * +_hs_q +, * +_hs_e +, * +_hs_li� +, * +_hs_�� +; \ + +724 i�( +h�d +) { \ + +725 +_hs_�size + = 1; \ + +726 +_hs_loݚg + = 1; \ + +727 +_hs_li� + = &(( +h�d +)-> +hh +); \ + +728 +_hs_loݚg +) { \ + +729 +_hs_p + = +_hs_li� +; \ + +730 +_hs_li� + = +NULL +; \ + +731 +_hs_�� + = +NULL +; \ + +732 +_hs_nm�ges + = 0; \ + +733 +_hs_p +) { \ + +734 +_hs_nm�ges +++; \ + +735 +_hs_q + = +_hs_p +; \ + +736 +_hs_psize + = 0; \ + +737 +_hs_i + = 0; _hs_�< +_hs_�size +; _hs_i++ ) { \ + +738 +_hs_psize +++; \ + +739 +_hs_q + = ( +UT_hash_h�d� +*)((_hs_q-> +�xt +) ? \ + +740 ((*)((*)( +_hs_q +-> +�xt +) + \ + +741 ( +h�d +)-> +hh +. +tbl +-> +hho +)�: +NULL +); \ + +742 i�(! ( +_hs_q +) ) ; \ + +744 +_hs_qsize + = +_hs_�size +; \ + +745 ( +_hs_psize + > 0�|| (( +_hs_qsize + > 0�&& +_hs_q + )) { \ + +746 i�( +_hs_psize + == 0) { \ + +747 +_hs_e + = +_hs_q +; \ + +748 +_hs_q + = ( +UT_hash_h�d� +*)((_hs_q-> +�xt +) ? \ + +749 ((*)((*)( +_hs_q +-> +�xt +) + \ + +750 ( +h�d +)-> +hh +. +tbl +-> +hho +)�: +NULL +); \ + +751 +_hs_qsize +--; \ + +752 } i��( +_hs_qsize + =�0�|| !( +_hs_q +) ) { \ + +753 +_hs_e + = +_hs_p +; \ + +754 i�( +_hs_p +){ \ + +755 +_hs_p + = ( +UT_hash_h�d� +*)((_hs_p-> +�xt +) ? \ + +756 ((*)((*)( +_hs_p +-> +�xt +) + \ + +757 ( +h�d +)-> +hh +. +tbl +-> +hho +)�: +NULL +); \ + +759 +_hs_psize +--; \ + +761 + `cmpf� +( + `DECLTYPE +( +h�d +)( + `ELMT_FROM_HH +((h�d)-> +hh +. +tbl +, +_hs_p +)), \ + +762 + `DECLTYPE +( +h�d +)( + `ELMT_FROM_HH +((h�d)-> +hh +. +tbl +, +_hs_q +))) \ + +764 +_hs_e + = +_hs_p +; \ + +765 i�( +_hs_p +){ \ + +766 +_hs_p + = ( +UT_hash_h�d� +*)((_hs_p-> +�xt +) ? \ + +767 ((*)((*)( +_hs_p +-> +�xt +) + \ + +768 ( +h�d +)-> +hh +. +tbl +-> +hho +)�: +NULL +); \ + +770 +_hs_psize +--; \ + +772 +_hs_e + = +_hs_q +; \ + +773 +_hs_q + = ( +UT_hash_h�d� +*)((_hs_q-> +�xt +) ? \ + +774 ((*)((*)( +_hs_q +-> +�xt +) + \ + +775 ( +h�d +)-> +hh +. +tbl +-> +hho +)�: +NULL +); \ + +776 +_hs_qsize +--; \ + +778 i�� +_hs_�� + ) { \ + +779 +_hs_�� +-> +�xt + = (( +_hs_e +) ? \ + +780 + `ELMT_FROM_HH +(( +h�d +)-> +hh +. +tbl +, +_hs_e +�: +NULL +); \ + +782 +_hs_li� + = +_hs_e +; \ + +784 i�( +_hs_e +) { \ + +785 +_hs_e +-> +�ev + = (( +_hs_�� +) ? \ + +786 + `ELMT_FROM_HH +(( +h�d +)-> +hh +. +tbl +, +_hs_�� +�: +NULL +); \ + +788 +_hs_�� + = +_hs_e +; \ + +790 +_hs_p + = +_hs_q +; \ + +792 i�( +_hs_�� +){ \ + +793 +_hs_�� +-> +�xt + = +NULL +; \ + +795 i�� +_hs_nm�ges + <= 1 ) { \ + +796 +_hs_loݚg +=0; \ + +797 ( +h�d +)-> +hh +. +tbl +-> +�� + = +_hs_�� +; \ + +798 + `DECLTYPE_ASSIGN +( +h�d +, + `ELMT_FROM_HH +((h�d)-> +hh +. +tbl +, +_hs_li� +)); \ + +800 +_hs_�size + *= 2; \ + +802 + `HASH_FSCK +( +hh +, +h�d +); \ + +804 } 0) + + ) + +811 + #HASH_SELECT +( +hh_d� +, +d� +, +hh_�c +, +�c +, +c�d +) \ + +813 +_�c_bkt +, +_d�_bkt +; \ + +814 * +_ϡ_�t += +NULL +, * +_�t +; \ + +815 +UT_hash_h�d� + * +_�c_hh +, * +_d�_hh +, * +_ϡ_�t_hh += +NULL +; \ + +816 +�rdiff_t + +_d�_hho + = ((*)(&( +d� +)-> +hh_d� +) - (*)(dst)); \ + +817 i�( +�c +) { \ + +818 +_�c_bkt +=0; _�c_bk�< ( +�c +)-> +hh_�c +. +tbl +-> +num_buck�s +; _src_bkt++) { \ + +819 +_�c_hh + = ( +�c +)-> +hh_�c +. +tbl +-> +buck�s +[ +_�c_bkt +]. +hh_h�d +; \ + +820 +_�c_hh +; \ + +821 +_�c_hh + = _�c_hh-> +hh_�xt +) { \ + +822 +_�t + = + `ELMT_FROM_HH +(( +�c +)-> +hh_�c +. +tbl +, +_�c_hh +); \ + +823 i�( + `c�d +( +_�t +)) { \ + +824 +_d�_hh + = ( +UT_hash_h�d� +*)(((*) +_�t +�+ +_d�_hho +); \ + +825 +_d�_hh +-> +key + = +_�c_hh +->key; \ + +826 +_d�_hh +-> +key�n + = +_�c_hh +->keylen; \ + +827 +_d�_hh +-> +hashv + = +_�c_hh +->hashv; \ + +828 +_d�_hh +-> +�ev + = +_ϡ_�t +; \ + +829 +_d�_hh +-> +�xt + = +NULL +; \ + +830 i�( +_ϡ_�t_hh +�{ _ϡ_�t_hh-> +�xt + = +_�t +; } \ + +831 i�(! +d� +) { \ + +832 + `DECLTYPE_ASSIGN +( +d� +, +_�t +); \ + +833 + `HASH_MAKE_TABLE +( +hh_d� +, +d� +); \ + +835 +_d�_hh +-> +tbl + = ( +d� +)-> +hh_d� +.tbl; \ + +837 + `HASH_TO_BKT +( +_d�_hh +-> +hashv +, _d�_hh-> +tbl +-> +num_buck�s +, +_d�_bkt +); \ + +838 + `HASH_ADD_TO_BKT +( +_d�_hh +-> +tbl +-> +buck�s +[ +_d�_bkt +],_dst_hh); \ + +839 ( +d� +)-> +hh_d� +. +tbl +-> +num_�ems +++; \ + +840 +_ϡ_�t + = +_�t +; \ + +841 +_ϡ_�t_hh + = +_d�_hh +; \ + +846 + `HASH_FSCK +( +hh_d� +, +d� +); \ + +847 } 0) + + ) + +849 + #HASH_CLEAR +( +hh +, +h�d +) \ + +851 i�( +h�d +) { \ + +852 + `uthash_� +(( +h�d +)-> +hh +. +tbl +-> +buck�s +, \ + +853 ( +h�d +)-> +hh +. +tbl +-> +num_buck�s +*( +UT_hash_buck� +)); \ + +854 + `HASH_BLOOM_FREE +(( +h�d +)-> +hh +. +tbl +); \ + +855 + `uthash_� +(( +h�d +)-> +hh +. +tbl +, ( +UT_hash_�b� +)); \ + +856 ( +h�d +)= +NULL +; \ + +858 } 0) + + ) + +860 + #HASH_OVERHEAD +( +hh +, +h�d +) \ + +861 ( +size_t +)(((( +h�d +)-> +hh +. +tbl +-> +num_�ems + * ( +UT_hash_h�d� +)) + \ + +862 (( +h�d +)-> +hh +. +tbl +-> +num_buck�s + * ( +UT_hash_buck� +)) + \ + +863 (( +UT_hash_�b� +)) + \ + +864 ( +HASH_BLOOM_BYTELEN +))) + + ) + +866 #ifde� +NO_DECLTYPE + + +867 + #HASH_ITER +( +hh +, +h�d +, +� +, +tmp +) \ + +868 ( +� +)=( +h�d +), (*(**)(&( +tmp +)))=(*)((h�d)?(h�d)-> +hh +. +�xt +: +NULL +); \ + +869 +� +; (�)=( +tmp +),(*(**)(&�mp)))=(*)(�mp)?�mp)-> +hh +. +�xt +: +NULL +)) + + ) + +871 + #HASH_ITER +( +hh +, +h�d +, +� +, +tmp +) \ + +872 ( +� +)=( +h�d +),( +tmp +)= + `DECLTYPE +�l)((h�d)?(h�d)-> +hh +. +�xt +: +NULL +); \ + +873 +� +; (�)=( +tmp +),�mp)= + `DECLTYPE +�l)(�mp)?�mp)-> +hh +. +�xt +: +NULL +)) + + ) + +877 + #HASH_COUNT +( +h�d +� + `HASH_CNT +( +hh +,h�d) + + ) + +878 + #HASH_CNT +( +hh +, +h�d +�((h�d)?((h�d)->hh. +tbl +-> +num_�ems +):0) + + ) + +880 + sUT_hash_buck� + { + +881 +UT_hash_h�d� + * + mhh_h�d +; + +882 + mcou� +; + +896 + mex�nd_mu� +; + +898 } + tUT_hash_buck� +; + +901 + #HASH_SIGNATURE + 0xa0111�1 + + ) + +902 + #HASH_BLOOM_SIGNATURE + 0xb12220f2 + + ) + +904 + sUT_hash_�b� + { + +905 +UT_hash_buck� + * + mbuck�s +; + +906 + mnum_buck�s +, + mlog2_num_buck�s +; + +907 + mnum_�ems +; + +908 +UT_hash_h�d� + * + m�� +; + +909 +�rdiff_t + + mhho +; + +913 + mid�l_cha�_max�n +; + +918 + mn�id�l_�ems +; + +926 + m�eff_ex�nds +, + mn�x�nd +; + +928 +u�t32_t + + msig�tu� +; + +929 #ifde� +HASH_BLOOM + + +930 +u�t32_t + + mbloom_sig +; + +931 +u�t8_t + * + mbloom_bv +; + +932 + mbloom_nb�s +; + +935 } + tUT_hash_�b� +; + +937 + sUT_hash_h�d� + { + +938 +UT_hash_�b� + * + mtbl +; + +939 * + m�ev +; + +940 * + m�xt +; + +941 +UT_hash_h�d� + * + mhh_�ev +; + +942 +UT_hash_h�d� + * + mhh_�xt +; + +943 * + mkey +; + +944 + mkey�n +; + +945 + mhashv +; + +946 } + tUT_hash_h�d� +; + + @src/deps/utlist.h + +24 #i�de� +UTLIST_H + + +25 + #UTLIST_H + + + ) + +27 + #UTLIST_VERSION + 2.1.0 + + ) + +29 + ~<as��.h +> + +66 #i�! +def�ed +( +LDECLTYPE +�&& !def�ed( +NO_DECLTYPE +) + +67 #i� +def�ed +( +_MSC_VER +) + +68 #i� +_MSC_VER + >�1600 && +def�ed +( +__�lu�lus +) + +69 + #LDECLTYPE +( +x +� + `de�ty� +(x) + + ) + +71 + #NO_DECLTYPE + + + ) + +73 #�i� +def�ed +( +__BORLANDC__ +�|| def�ed( +__ICCARM__ +�|| def�ed( +__LCC__ +�|| def�ed( +__WATCOMC__ +) + +74 + #NO_DECLTYPE + + + ) + +76 + #LDECLTYPE +( +x +� + `__ty�of +(x) + + ) + +83 #ifde� +NO_DECLTYPE + + +84 + #IF_NO_DECLTYPE +( +x +� + ) +x + +85 + #LDECLTYPE +( +x +�* + + ) + +86 + #UTLIST_SV +( +�t +, +li� +� +_tmp + = (*)�i�); {** +_��s + = (**)&�i�); *_������); } + + ) + +87 + #UTLIST_NEXT +( +�t +, +li� +, +�xt +�((*)(�i�)->�xt)) + + ) + +88 + #UTLIST_NEXTASGN +( +�t +, +li� +, +to +, +�xt +�{ ** +_��s + = (**)&(�i�)->�xt); *_��s=(*)�o); } + + ) + +90 + #UTLIST_PREVASGN +( +�t +, +li� +, +to +, +�ev +�{ ** +_��s + = (**)&(�i�)->�ev); *_��s=(*)�o); } + + ) + +91 + #UTLIST_RS +( +li� +�{ ** +_��s + = (**)&�i�); *_��s= +_tmp +; } + + ) + +92 + #UTLIST_CASTASGN +( +a +, +b +�{ ** +_��s + = (**)&�); *_��s=(*)(b); } + + ) + +94 + #IF_NO_DECLTYPE +( +x +) + + ) + +95 + #UTLIST_SV +( +�t +, +li� +) + + ) + +96 + #UTLIST_NEXT +( +�t +, +li� +, +�xt +�(��)->�xt) + + ) + +97 + #UTLIST_NEXTASGN +( +�t +, +li� +, +to +, +�xt +�(��)->�xt)=�o) + + ) + +99 + #UTLIST_PREVASGN +( +�t +, +li� +, +to +, +�ev +�(��)->�ev)=�o) + + ) + +100 + #UTLIST_RS +( +li� +) + + ) + +101 + #UTLIST_CASTASGN +( +a +, +b +��)=(b) + + ) + +108 + #LL_SORT +( +li� +, +cmp +) \ + +109 + `LL_SORT2 +( +li� +, +cmp +, +�xt +) + + ) + +111 + #LL_SORT2 +( +li� +, +cmp +, +�xt +) \ + +113 + `LDECLTYPE +( +li� +� +_ls_p +; \ + +114 + `LDECLTYPE +( +li� +� +_ls_q +; \ + +115 + `LDECLTYPE +( +li� +� +_ls_e +; \ + +116 + `LDECLTYPE +( +li� +� +_ls_�� +; \ + +117 + `IF_NO_DECLTYPE +( + `LDECLTYPE +( +li� +� +_tmp +;) \ + +118 +_ls_�size +, +_ls_nm�ges +, +_ls_psize +, +_ls_qsize +, +_ls_i +, +_ls_loݚg +; \ + +119 i�( +li� +) { \ + +120 +_ls_�size + = 1; \ + +121 +_ls_loݚg + = 1; \ + +122 +_ls_loݚg +) { \ + +123 + `UTLIST_CASTASGN +( +_ls_p +, +li� +); \ + +124 ( +li� +�� +NULL +; \ + +125 +_ls_�� + = +NULL +; \ + +126 +_ls_nm�ges + = 0; \ + +127 +_ls_p +) { \ + +128 +_ls_nm�ges +++; \ + +129 +_ls_q + = +_ls_p +; \ + +130 +_ls_psize + = 0; \ + +131 +_ls_i + = 0; _ls_�< +_ls_�size +; _ls_i++) { \ + +132 +_ls_psize +++; \ + +133 + `UTLIST_SV +( +_ls_q +, +li� +); _ls_q = + `UTLIST_NEXT +(_ls_q,li�, +�xt +); + `UTLIST_RS +(list); \ + +134 i�(! +_ls_q +) ; \ + +136 +_ls_qsize + = +_ls_�size +; \ + +137 +_ls_psize + > 0 || ( +_ls_qsize + > 0 && +_ls_q +)) { \ + +138 i�( +_ls_psize + == 0) { \ + +139 +_ls_e + = +_ls_q +; + `UTLIST_SV +(_ls_q, +li� +); _ls_q = \ + +140 + `UTLIST_NEXT +( +_ls_q +, +li� +, +�xt +); + `UTLIST_RS +�i�); +_ls_qsize +--; \ + +141 } i�( +_ls_qsize + =�0 || ! +_ls_q +) { \ + +142 +_ls_e + = +_ls_p +; + `UTLIST_SV +(_ls_p, +li� +); _ls_p = \ + +143 + `UTLIST_NEXT +( +_ls_p +, +li� +, +�xt +); + `UTLIST_RS +�i�); +_ls_psize +--; \ + +144 } i�( + `cmp +( +_ls_p +, +_ls_q +) <= 0) { \ + +145 +_ls_e + = +_ls_p +; + `UTLIST_SV +(_ls_p, +li� +); _ls_p = \ + +146 + `UTLIST_NEXT +( +_ls_p +, +li� +, +�xt +); + `UTLIST_RS +�i�); +_ls_psize +--; \ + +148 +_ls_e + = +_ls_q +; + `UTLIST_SV +(_ls_q, +li� +); _ls_q = \ + +149 + `UTLIST_NEXT +( +_ls_q +, +li� +, +�xt +); + `UTLIST_RS +�i�); +_ls_qsize +--; \ + +151 i�( +_ls_�� +) { \ + +152 + `UTLIST_SV +( +_ls_�� +, +li� +); + `UTLIST_NEXTASGN +(_ls_��,li�, +_ls_e +, +�xt +); + `UTLIST_RS +(list); \ + +154 + `UTLIST_CASTASGN +( +li� +, +_ls_e +); \ + +156 +_ls_�� + = +_ls_e +; \ + +158 +_ls_p + = +_ls_q +; \ + +160 i�( +_ls_�� +) { \ + +161 + `UTLIST_SV +( +_ls_�� +, +li� +); + `UTLIST_NEXTASGN +(_ls_��,li�, +NULL +, +�xt +); + `UTLIST_RS +(list); \ + +163 i�( +_ls_nm�ges + <= 1) { \ + +164 +_ls_loݚg +=0; \ + +166 +_ls_�size + *= 2; \ + +169 } 0) + + ) + +172 + #DL_SORT +( +li� +, +cmp +) \ + +173 + `DL_SORT2 +( +li� +, +cmp +, +�ev +, +�xt +) + + ) + +175 + #DL_SORT2 +( +li� +, +cmp +, +�ev +, +�xt +) \ + +177 + `LDECLTYPE +( +li� +� +_ls_p +; \ + +178 + `LDECLTYPE +( +li� +� +_ls_q +; \ + +179 + `LDECLTYPE +( +li� +� +_ls_e +; \ + +180 + `LDECLTYPE +( +li� +� +_ls_�� +; \ + +181 + `IF_NO_DECLTYPE +( + `LDECLTYPE +( +li� +� +_tmp +;) \ + +182 +_ls_�size +, +_ls_nm�ges +, +_ls_psize +, +_ls_qsize +, +_ls_i +, +_ls_loݚg +; \ + +183 i�( +li� +) { \ + +184 +_ls_�size + = 1; \ + +185 +_ls_loݚg + = 1; \ + +186 +_ls_loݚg +) { \ + +187 + `UTLIST_CASTASGN +( +_ls_p +, +li� +); \ + +188 ( +li� +�� +NULL +; \ + +189 +_ls_�� + = +NULL +; \ + +190 +_ls_nm�ges + = 0; \ + +191 +_ls_p +) { \ + +192 +_ls_nm�ges +++; \ + +193 +_ls_q + = +_ls_p +; \ + +194 +_ls_psize + = 0; \ + +195 +_ls_i + = 0; _ls_�< +_ls_�size +; _ls_i++) { \ + +196 +_ls_psize +++; \ + +197 + `UTLIST_SV +( +_ls_q +, +li� +); _ls_q = + `UTLIST_NEXT +(_ls_q,li�, +�xt +); + `UTLIST_RS +(list); \ + +198 i�(! +_ls_q +) ; \ + +200 +_ls_qsize + = +_ls_�size +; \ + +201 ( +_ls_psize + > 0�|| (( +_ls_qsize + > 0�&& +_ls_q +)) { \ + +202 i�( +_ls_psize + == 0) { \ + +203 +_ls_e + = +_ls_q +; + `UTLIST_SV +(_ls_q, +li� +); _ls_q = \ + +204 + `UTLIST_NEXT +( +_ls_q +, +li� +, +�xt +); + `UTLIST_RS +�i�); +_ls_qsize +--; \ + +205 } i�(( +_ls_qsize + =�0�|| (! +_ls_q +)) { \ + +206 +_ls_e + = +_ls_p +; + `UTLIST_SV +(_ls_p, +li� +); _ls_p = \ + +207 + `UTLIST_NEXT +( +_ls_p +, +li� +, +�xt +); + `UTLIST_RS +�i�); +_ls_psize +--; \ + +208 } i�( + `cmp +( +_ls_p +, +_ls_q +) <= 0) { \ + +209 +_ls_e + = +_ls_p +; + `UTLIST_SV +(_ls_p, +li� +); _ls_p = \ + +210 + `UTLIST_NEXT +( +_ls_p +, +li� +, +�xt +); + `UTLIST_RS +�i�); +_ls_psize +--; \ + +212 +_ls_e + = +_ls_q +; + `UTLIST_SV +(_ls_q, +li� +); _ls_q = \ + +213 + `UTLIST_NEXT +( +_ls_q +, +li� +, +�xt +); + `UTLIST_RS +�i�); +_ls_qsize +--; \ + +215 i�( +_ls_�� +) { \ + +216 + `UTLIST_SV +( +_ls_�� +, +li� +); + `UTLIST_NEXTASGN +(_ls_��,li�, +_ls_e +, +�xt +); + `UTLIST_RS +(list); \ + +218 + `UTLIST_CASTASGN +( +li� +, +_ls_e +); \ + +220 + `UTLIST_SV +( +_ls_e +, +li� +); + `UTLIST_PREVASGN +(_ls_e,li�, +_ls_�� +, +�ev +); + `UTLIST_RS +(list); \ + +221 +_ls_�� + = +_ls_e +; \ + +223 +_ls_p + = +_ls_q +; \ + +225 + `UTLIST_CASTASGN +(( +li� +)-> +�ev +, +_ls_�� +); \ + +226 + `UTLIST_SV +( +_ls_�� +, +li� +); + `UTLIST_NEXTASGN +(_ls_��,li�, +NULL +, +�xt +); + `UTLIST_RS +(list); \ + +227 i�( +_ls_nm�ges + <= 1) { \ + +228 +_ls_loݚg +=0; \ + +230 +_ls_�size + *= 2; \ + +233 } 0) + + ) + +235 + #CDL_SORT +( +li� +, +cmp +) \ + +236 + `CDL_SORT2 +( +li� +, +cmp +, +�ev +, +�xt +) + + ) + +238 + #CDL_SORT2 +( +li� +, +cmp +, +�ev +, +�xt +) \ + +240 + `LDECLTYPE +( +li� +� +_ls_p +; \ + +241 + `LDECLTYPE +( +li� +� +_ls_q +; \ + +242 + `LDECLTYPE +( +li� +� +_ls_e +; \ + +243 + `LDECLTYPE +( +li� +� +_ls_�� +; \ + +244 + `LDECLTYPE +( +li� +� +_ls_�dh�d +; \ + +245 + `LDECLTYPE +( +li� +� +_tmp +; \ + +246 +_ls_�size +, +_ls_nm�ges +, +_ls_psize +, +_ls_qsize +, +_ls_i +, +_ls_loݚg +; \ + +247 i�( +li� +) { \ + +248 +_ls_�size + = 1; \ + +249 +_ls_loݚg + = 1; \ + +250 +_ls_loݚg +) { \ + +251 + `UTLIST_CASTASGN +( +_ls_p +, +li� +); \ + +252 + `UTLIST_CASTASGN +( +_ls_�dh�d +, +li� +); \ + +253 ( +li� +�� +NULL +; \ + +254 +_ls_�� + = +NULL +; \ + +255 +_ls_nm�ges + = 0; \ + +256 +_ls_p +) { \ + +257 +_ls_nm�ges +++; \ + +258 +_ls_q + = +_ls_p +; \ + +259 +_ls_psize + = 0; \ + +260 +_ls_i + = 0; _ls_�< +_ls_�size +; _ls_i++) { \ + +261 +_ls_psize +++; \ + +262 + `UTLIST_SV +( +_ls_q +, +li� +); \ + +263 i�( + `UTLIST_NEXT +( +_ls_q +, +li� +, +�xt +�=� +_ls_�dh�d +) { \ + +264 +_ls_q + = +NULL +; \ + +266 +_ls_q + = + `UTLIST_NEXT +(_ls_q, +li� +, +�xt +); \ + +268 + `UTLIST_RS +( +li� +); \ + +269 i�(! +_ls_q +) ; \ + +271 +_ls_qsize + = +_ls_�size +; \ + +272 +_ls_psize + > 0 || ( +_ls_qsize + > 0 && +_ls_q +)) { \ + +273 i�( +_ls_psize + == 0) { \ + +274 +_ls_e + = +_ls_q +; + `UTLIST_SV +(_ls_q, +li� +); _ls_q = \ + +275 + `UTLIST_NEXT +( +_ls_q +, +li� +, +�xt +); + `UTLIST_RS +�i�); +_ls_qsize +--; \ + +276 i�( +_ls_q + =� +_ls_�dh�d +�{ _ls_q = +NULL +; } \ + +277 } i�( +_ls_qsize + =�0 || ! +_ls_q +) { \ + +278 +_ls_e + = +_ls_p +; + `UTLIST_SV +(_ls_p, +li� +); _ls_p = \ + +279 + `UTLIST_NEXT +( +_ls_p +, +li� +, +�xt +); + `UTLIST_RS +�i�); +_ls_psize +--; \ + +280 i�( +_ls_p + =� +_ls_�dh�d +�{ _ls_�� +NULL +; } \ + +281 } i�( + `cmp +( +_ls_p +, +_ls_q +) <= 0) { \ + +282 +_ls_e + = +_ls_p +; + `UTLIST_SV +(_ls_p, +li� +); _ls_p = \ + +283 + `UTLIST_NEXT +( +_ls_p +, +li� +, +�xt +); + `UTLIST_RS +�i�); +_ls_psize +--; \ + +284 i�( +_ls_p + =� +_ls_�dh�d +�{ _ls_�� +NULL +; } \ + +286 +_ls_e + = +_ls_q +; + `UTLIST_SV +(_ls_q, +li� +); _ls_q = \ + +287 + `UTLIST_NEXT +( +_ls_q +, +li� +, +�xt +); + `UTLIST_RS +�i�); +_ls_qsize +--; \ + +288 i�( +_ls_q + =� +_ls_�dh�d +�{ _ls_q = +NULL +; } \ + +290 i�( +_ls_�� +) { \ + +291 + `UTLIST_SV +( +_ls_�� +, +li� +); + `UTLIST_NEXTASGN +(_ls_��,li�, +_ls_e +, +�xt +); + `UTLIST_RS +(list); \ + +293 + `UTLIST_CASTASGN +( +li� +, +_ls_e +); \ + +295 + `UTLIST_SV +( +_ls_e +, +li� +); + `UTLIST_PREVASGN +(_ls_e,li�, +_ls_�� +, +�ev +); + `UTLIST_RS +(list); \ + +296 +_ls_�� + = +_ls_e +; \ + +298 +_ls_p + = +_ls_q +; \ + +300 + `UTLIST_CASTASGN +(( +li� +)-> +�ev +, +_ls_�� +); \ + +301 + `UTLIST_CASTASGN +( +_tmp +, +li� +); \ + +302 + `UTLIST_SV +( +_ls_�� +, +li� +); + `UTLIST_NEXTASGN +(_ls_��,li�, +_tmp +, +�xt +); + `UTLIST_RS +(list); \ + +303 i�( +_ls_nm�ges + <= 1) { \ + +304 +_ls_loݚg +=0; \ + +306 +_ls_�size + *= 2; \ + +309 } 0) + + ) + +314 + #LL_PREPEND +( +h�d +, +add +) \ + +315 + `LL_PREPEND2 +( +h�d +, +add +, +�xt +) + + ) + +317 + #LL_PREPEND2 +( +h�d +, +add +, +�xt +) \ + +319 ( +add +)-> +�xt + = ( +h�d +); \ + +320 ( +h�d +��( +add +); \ + +321 } 0) + + ) + +323 + #LL_CONCAT +( +h�d1 +, +h�d2 +) \ + +324 + `LL_CONCAT2 +( +h�d1 +, +h�d2 +, +�xt +) + + ) + +326 + #LL_CONCAT2 +( +h�d1 +, +h�d2 +, +�xt +) \ + +328 + `LDECLTYPE +( +h�d1 +� +_tmp +; \ + +329 i�( +h�d1 +) { \ + +330 +_tmp + = ( +h�d1 +); \ + +331 +_tmp +-> +�xt +) { _tmp = _tmp->next; } \ + +332 +_tmp +-> +�xt +=( +h�d2 +); \ + +334 ( +h�d1 +)=( +h�d2 +); \ + +336 } 0) + + ) + +338 + #LL_APPEND +( +h�d +, +add +) \ + +339 + `LL_APPEND2 +( +h�d +, +add +, +�xt +) + + ) + +341 + #LL_APPEND2 +( +h�d +, +add +, +�xt +) \ + +343 + `LDECLTYPE +( +h�d +� +_tmp +; \ + +344 ( +add +)-> +�xt += +NULL +; \ + +345 i�( +h�d +) { \ + +346 +_tmp + = ( +h�d +); \ + +347 +_tmp +-> +�xt +) { _tmp = _tmp->next; } \ + +348 +_tmp +-> +�xt +=( +add +); \ + +350 ( +h�d +)=( +add +); \ + +352 } 0) + + ) + +354 + #LL_INSERT_INORDER +( +h�d +, +add +, +cmp +) \ + +355 + `LL_INSERT_INORDER2 +( +h�d +, +add +, +cmp +, +�xt +) + + ) + +357 + #LL_INSERT_INORDER2 +( +h�d +, +add +, +cmp +, +�xt +) \ + +359 + `LDECLTYPE +( +h�d +� +_tmp +; \ + +360 i�( +h�d +) { \ + +361 + `LL_LOWER_BOUND2 +( +h�d +, +_tmp +, +add +, +cmp +, +�xt +); \ + +362 + `LL_APPEND_ELEM2 +( +h�d +, +_tmp +, +add +, +�xt +); \ + +364 ( +h�d +��( +add +); \ + +365 ( +h�d +)-> +�xt + = +NULL +; \ + +367 } 0) + + ) + +369 + #LL_LOWER_BOUND +( +h�d +, +�t +, +like +, +cmp +) \ + +370 + `LL_LOWER_BOUND2 +( +h�d +, +�t +, +like +, +cmp +, +�xt +) + + ) + +372 + #LL_LOWER_BOUND2 +( +h�d +, +�t +, +like +, +cmp +, +�xt +) \ + +374 i�(( +h�d +�=� +NULL + || ( + `cmp +(h�d, +like +)) >= 0) { \ + +375 ( +�t +�� +NULL +; \ + +377 ( +�t +��( +h�d +); (�t)-> +�xt + !� +NULL +; (elt) = (elt)->next) { \ + +378 i�( + `cmp +(( +�t +)-> +�xt +, +like +) >= 0) { \ + +383 } 0) + + ) + +385 + #LL_DELETE +( +h�d +, +d� +) \ + +386 + `LL_DELETE2 +( +h�d +, +d� +, +�xt +) + + ) + +388 + #LL_DELETE2 +( +h�d +, +d� +, +�xt +) \ + +390 + `LDECLTYPE +( +h�d +� +_tmp +; \ + +391 i�(( +h�d +�=�( +d� +)) { \ + +392 ( +h�d +)=(h�d)-> +�xt +; \ + +394 +_tmp + = ( +h�d +); \ + +395 +_tmp +-> +�xt + && (_tmp->�x�!�( +d� +))) { \ + +396 +_tmp + = _tmp-> +�xt +; \ + +398 i�( +_tmp +-> +�xt +) { \ + +399 +_tmp +-> +�xt + = ( +d� +)->next; \ + +402 } 0) + + ) + +404 + #LL_COUNT +( +h�d +, +� +, +cou�� +) \ + +405 + `LL_COUNT2 +( +h�d +, +� +, +cou�� +, +�xt +) \ + +406 + + ) + +407 + #LL_COUNT2 +( +h�d +, +� +, +cou�� +, +�xt +) \ + +409 ( +cou�� +) = 0; \ + +410 + `LL_FOREACH2 +( +h�d +, +� +, +�xt +�{ ++( +cou�� +); } \ + +411 } 0) + + ) + +413 + #LL_FOREACH +( +h�d +, +� +) \ + +414 + `LL_FOREACH2 +( +h�d +, +� +, +�xt +) + + ) + +416 + #LL_FOREACH2 +( +h�d +, +� +, +�xt +) \ + +417 ( +� +��( +h�d +);�l; (����l)-> +�xt +) + + ) + +419 + #LL_FOREACH_SAFE +( +h�d +, +� +, +tmp +) \ + +420 + `LL_FOREACH_SAFE2 +( +h�d +, +� +, +tmp +, +�xt +) + + ) + +422 + #LL_FOREACH_SAFE2 +( +h�d +, +� +, +tmp +, +�xt +) \ + +423 ( +� +��( +h�d +); (��&& (( +tmp +���l)-> +�xt +, 1); (����mp)) + + ) + +425 + #LL_SEARCH_SCALAR +( +h�d +, +out +, +f�ld +, +v� +) \ + +426 + `LL_SEARCH_SCALAR2 +( +h�d +, +out +, +f�ld +, +v� +, +�xt +) + + ) + +428 + #LL_SEARCH_SCALAR2 +( +h�d +, +out +, +f�ld +, +v� +, +�xt +) \ + +430 + `LL_FOREACH2 +( +h�d +, +out +, +�xt +) { \ + +431 i�(( +out +)-> +f�ld + =�( +v� +)) ; \ + +433 } 0) + + ) + +435 + #LL_SEARCH +( +h�d +, +out +, +�t +, +cmp +) \ + +436 + `LL_SEARCH2 +( +h�d +, +out +, +�t +, +cmp +, +�xt +) + + ) + +438 + #LL_SEARCH2 +( +h�d +, +out +, +�t +, +cmp +, +�xt +) \ + +440 + `LL_FOREACH2 +( +h�d +, +out +, +�xt +) { \ + +441 i�(( + `cmp +( +out +, +�t +))==0) ; \ + +443 } 0) + + ) + +445 + #LL_REPLACE_ELEM2 +( +h�d +, +� +, +add +, +�xt +) \ + +447 + `LDECLTYPE +( +h�d +� +_tmp +; \ + +448 + `as�� +(( +h�d +�!� +NULL +); \ + +449 + `as�� +(( +� +�!� +NULL +); \ + +450 + `as�� +(( +add +�!� +NULL +); \ + +451 ( +add +)-> +�xt + = ( +� +)->next; \ + +452 i�(( +h�d +�=�( +� +)) { \ + +453 ( +h�d +��( +add +); \ + +455 +_tmp + = ( +h�d +); \ + +456 +_tmp +-> +�xt + && (_tmp->�x�!�( +� +))) { \ + +457 +_tmp + = _tmp-> +�xt +; \ + +459 i�( +_tmp +-> +�xt +) { \ + +460 +_tmp +-> +�xt + = ( +add +); \ + +463 } 0) + + ) + +465 + #LL_REPLACE_ELEM +( +h�d +, +� +, +add +) \ + +466 + `LL_REPLACE_ELEM2 +( +h�d +, +� +, +add +, +�xt +) + + ) + +468 + #LL_PREPEND_ELEM2 +( +h�d +, +� +, +add +, +�xt +) \ + +470 i�( +� +) { \ + +471 + `LDECLTYPE +( +h�d +� +_tmp +; \ + +472 + `as�� +(( +h�d +�!� +NULL +); \ + +473 + `as�� +(( +add +�!� +NULL +); \ + +474 ( +add +)-> +�xt + = ( +� +); \ + +475 i�(( +h�d +�=�( +� +)) { \ + +476 ( +h�d +��( +add +); \ + +478 +_tmp + = ( +h�d +); \ + +479 +_tmp +-> +�xt + && (_tmp->�x�!�( +� +))) { \ + +480 +_tmp + = _tmp-> +�xt +; \ + +482 i�( +_tmp +-> +�xt +) { \ + +483 +_tmp +-> +�xt + = ( +add +); \ + +487 + `LL_APPEND2 +( +h�d +, +add +, +�xt +); \ + +490 + + ) + +491 + #LL_PREPEND_ELEM +( +h�d +, +� +, +add +) \ + +492 + `LL_PREPEND_ELEM2 +( +h�d +, +� +, +add +, +�xt +) + + ) + +494 + #LL_APPEND_ELEM2 +( +h�d +, +� +, +add +, +�xt +) \ + +496 i�( +� +) { \ + +497 + `as�� +(( +h�d +�!� +NULL +); \ + +498 + `as�� +(( +add +�!� +NULL +); \ + +499 ( +add +)-> +�xt + = ( +� +)->next; \ + +500 ( +� +)-> +�xt + = ( +add +); \ + +502 + `LL_PREPEND2 +( +h�d +, +add +, +�xt +); \ + +505 + + ) + +506 + #LL_APPEND_ELEM +( +h�d +, +� +, +add +) \ + +507 + `LL_APPEND_ELEM2 +( +h�d +, +� +, +add +, +�xt +) + + ) + +509 #ifde� +NO_DECLTYPE + + +512 #unde� +LL_CONCAT2 + + +513 + #LL_CONCAT2 +( +h�d1 +, +h�d2 +, +�xt +) \ + +515 * +_tmp +; \ + +516 i�( +h�d1 +) { \ + +517 +_tmp + = (*)( +h�d1 +); \ + +518 ( +h�d1 +)-> +�xt +) { (head1) = (head1)->next; } \ + +519 ( +h�d1 +)-> +�xt + = ( +h�d2 +); \ + +520 + `UTLIST_RS +( +h�d1 +); \ + +522 ( +h�d1 +)=( +h�d2 +); \ + +524 } 0) + + ) + +526 #unde� +LL_APPEND2 + + +527 + #LL_APPEND2 +( +h�d +, +add +, +�xt +) \ + +529 i�( +h�d +) { \ + +530 ( +add +)-> +�xt + = +h�d +; \ + +531 ( +add +)-> +�xt +->next) { (add)->next = (add)->next->next; } \ + +532 ( +add +)-> +�xt +->next=(add); \ + +534 ( +h�d +)=( +add +); \ + +536 ( +add +)-> +�xt += +NULL +; \ + +537 } 0) + + ) + +539 #unde� +LL_INSERT_INORDER2 + + +540 + #LL_INSERT_INORDER2 +( +h�d +, +add +, +cmp +, +�xt +) \ + +542 i�(( +h�d +�=� +NULL + || ( + `cmp +(h�d, +add +)) >= 0) { \ + +543 ( +add +)-> +�xt + = ( +h�d +); \ + +544 ( +h�d +��( +add +); \ + +546 * +_tmp + = (*)( +h�d +); \ + +547 ( +h�d +)-> +�xt + !� +NULL + && ( + `cmp +((h�d)->�xt, +add +)) < 0) { \ + +548 ( +h�d +��(h�d)-> +�xt +; \ + +550 ( +add +)-> +�xt + = ( +h�d +)->next; \ + +551 ( +h�d +)-> +�xt + = ( +add +); \ + +552 + `UTLIST_RS +( +h�d +); \ + +554 } 0) + + ) + +556 #unde� +LL_DELETE2 + + +557 + #LL_DELETE2 +( +h�d +, +d� +, +�xt +) \ + +559 i�(( +h�d +�=�( +d� +)) { \ + +560 ( +h�d +)=(h�d)-> +�xt +; \ + +562 * +_tmp + = (*)( +h�d +); \ + +563 ( +h�d +)-> +�xt + && ((h�d)->�x�!�( +d� +))) { \ + +564 ( +h�d +��(h�d)-> +�xt +; \ + +566 i�(( +h�d +)-> +�xt +) { \ + +567 ( +h�d +)-> +�xt + = (( +d� +)->next); \ + +569 + `UTLIST_RS +( +h�d +); \ + +571 } 0) + + ) + +573 #unde� +LL_REPLACE_ELEM2 + + +574 + #LL_REPLACE_ELEM2 +( +h�d +, +� +, +add +, +�xt +) \ + +576 + `as�� +(( +h�d +�!� +NULL +); \ + +577 + `as�� +(( +� +�!� +NULL +); \ + +578 + `as�� +(( +add +�!� +NULL +); \ + +579 i�(( +h�d +�=�( +� +)) { \ + +580 ( +h�d +��( +add +); \ + +582 ( +add +)-> +�xt + = +h�d +; \ + +583 ( +add +)-> +�xt +->�x�&& (�dd)->�xt->�x�!�( +� +))) { \ + +584 ( +add +)-> +�xt + = (add)->next->next; \ + +586 i�(( +add +)-> +�xt +->next) { \ + +587 ( +add +)-> +�xt +->next = (add); \ + +590 ( +add +)-> +�xt + = ( +� +)->next; \ + +591 } 0) + + ) + +593 #unde� +LL_PREPEND_ELEM2 + + +594 + #LL_PREPEND_ELEM2 +( +h�d +, +� +, +add +, +�xt +) \ + +596 i�( +� +) { \ + +597 + `as�� +(( +h�d +�!� +NULL +); \ + +598 + `as�� +(( +add +�!� +NULL +); \ + +599 i�(( +h�d +�=�( +� +)) { \ + +600 ( +h�d +��( +add +); \ + +602 ( +add +)-> +�xt + = ( +h�d +); \ + +603 ( +add +)-> +�xt +->�x�&& (�dd)->�xt->�x�!�( +� +))) { \ + +604 ( +add +)-> +�xt + = (add)->next->next; \ + +606 i�(( +add +)-> +�xt +->next) { \ + +607 ( +add +)-> +�xt +->next = (add); \ + +610 ( +add +)-> +�xt + = ( +� +); \ + +612 + `LL_APPEND2 +( +h�d +, +add +, +�xt +); \ + +615 + + ) + +621 + #DL_PREPEND +( +h�d +, +add +) \ + +622 + `DL_PREPEND2 +( +h�d +, +add +, +�ev +, +�xt +) + + ) + +624 + #DL_PREPEND2 +( +h�d +, +add +, +�ev +, +�xt +) \ + +626 ( +add +)-> +�xt + = ( +h�d +); \ + +627 i�( +h�d +) { \ + +628 ( +add +)-> +�ev + = ( +h�d +)->prev; \ + +629 ( +h�d +)-> +�ev + = ( +add +); \ + +631 ( +add +)-> +�ev + = (add); \ + +633 ( +h�d +��( +add +); \ + +634 } 0) + + ) + +636 + #DL_APPEND +( +h�d +, +add +) \ + +637 + `DL_APPEND2 +( +h�d +, +add +, +�ev +, +�xt +) + + ) + +639 + #DL_APPEND2 +( +h�d +, +add +, +�ev +, +�xt +) \ + +641 i�( +h�d +) { \ + +642 ( +add +)-> +�ev + = ( +h�d +)->prev; \ + +643 ( +h�d +)-> +�ev +-> +�xt + = ( +add +); \ + +644 ( +h�d +)-> +�ev + = ( +add +); \ + +645 ( +add +)-> +�xt + = +NULL +; \ + +647 ( +h�d +)=( +add +); \ + +648 ( +h�d +)-> +�ev + = (head); \ + +649 ( +h�d +)-> +�xt + = +NULL +; \ + +651 } 0) + + ) + +653 + #DL_INSERT_INORDER +( +h�d +, +add +, +cmp +) \ + +654 + `DL_INSERT_INORDER2 +( +h�d +, +add +, +cmp +, +�ev +, +�xt +) + + ) + +656 + #DL_INSERT_INORDER2 +( +h�d +, +add +, +cmp +, +�ev +, +�xt +) \ + +658 + `LDECLTYPE +( +h�d +� +_tmp +; \ + +659 i�( +h�d +) { \ + +660 + `DL_LOWER_BOUND2 +( +h�d +, +_tmp +, +add +, +cmp +, +�xt +); \ + +661 + `DL_APPEND_ELEM2 +( +h�d +, +_tmp +, +add +, +�ev +, +�xt +); \ + +663 ( +h�d +��( +add +); \ + +664 ( +h�d +)-> +�ev + = (head); \ + +665 ( +h�d +)-> +�xt + = +NULL +; \ + +667 } 0) + + ) + +669 + #DL_LOWER_BOUND +( +h�d +, +�t +, +like +, +cmp +) \ + +670 + `DL_LOWER_BOUND2 +( +h�d +, +�t +, +like +, +cmp +, +�xt +) + + ) + +672 + #DL_LOWER_BOUND2 +( +h�d +, +�t +, +like +, +cmp +, +�xt +) \ + +674 i�(( +h�d +�=� +NULL + || ( + `cmp +(h�d, +like +)) >= 0) { \ + +675 ( +�t +�� +NULL +; \ + +677 ( +�t +��( +h�d +); (�t)-> +�xt + !� +NULL +; (elt) = (elt)->next) { \ + +678 i�(( + `cmp +(( +�t +)-> +�xt +, +like +)) >= 0) { \ + +683 } 0) + + ) + +685 + #DL_CONCAT +( +h�d1 +, +h�d2 +) \ + +686 + `DL_CONCAT2 +( +h�d1 +, +h�d2 +, +�ev +, +�xt +) + + ) + +688 + #DL_CONCAT2 +( +h�d1 +, +h�d2 +, +�ev +, +�xt +) \ + +690 + `LDECLTYPE +( +h�d1 +� +_tmp +; \ + +691 i�( +h�d2 +) { \ + +692 i�( +h�d1 +) { \ + +693 + `UTLIST_CASTASGN +( +_tmp +, ( +h�d2 +)-> +�ev +); \ + +694 ( +h�d2 +)-> +�ev + = ( +h�d1 +)->prev; \ + +695 ( +h�d1 +)-> +�ev +-> +�xt + = ( +h�d2 +); \ + +696 + `UTLIST_CASTASGN +(( +h�d1 +)-> +�ev +, +_tmp +); \ + +698 ( +h�d1 +)=( +h�d2 +); \ + +701 } 0) + + ) + +703 + #DL_DELETE +( +h�d +, +d� +) \ + +704 + `DL_DELETE2 +( +h�d +, +d� +, +�ev +, +�xt +) + + ) + +706 + #DL_DELETE2 +( +h�d +, +d� +, +�ev +, +�xt +) \ + +708 + `as�� +(( +h�d +�!� +NULL +); \ + +709 + `as�� +(( +d� +)-> +�ev + !� +NULL +); \ + +710 i�(( +d� +)-> +�ev + == (del)) { \ + +711 ( +h�d +)= +NULL +; \ + +712 } i�(( +d� +)==( +h�d +)) { \ + +713 ( +d� +)-> +�xt +-> +�ev + = (del)->prev; \ + +714 ( +h�d +��( +d� +)-> +�xt +; \ + +716 ( +d� +)-> +�ev +-> +�xt + = (del)->next; \ + +717 i�(( +d� +)-> +�xt +) { \ + +718 ( +d� +)-> +�xt +-> +�ev + = (del)->prev; \ + +720 ( +h�d +)-> +�ev + = ( +d� +)->prev; \ + +723 } 0) + + ) + +725 + #DL_COUNT +( +h�d +, +� +, +cou�� +) \ + +726 + `DL_COUNT2 +( +h�d +, +� +, +cou�� +, +�xt +) \ + +727 + + ) + +728 + #DL_COUNT2 +( +h�d +, +� +, +cou�� +, +�xt +) \ + +730 ( +cou�� +) = 0; \ + +731 + `DL_FOREACH2 +( +h�d +, +� +, +�xt +�{ ++( +cou�� +); } \ + +732 } 0) + + ) + +734 + #DL_FOREACH +( +h�d +, +� +) \ + +735 + `DL_FOREACH2 +( +h�d +, +� +, +�xt +) + + ) + +737 + #DL_FOREACH2 +( +h�d +, +� +, +�xt +) \ + +738 ( +� +��( +h�d +);�l; (����l)-> +�xt +) + + ) + +741 + #DL_FOREACH_SAFE +( +h�d +, +� +, +tmp +) \ + +742 + `DL_FOREACH_SAFE2 +( +h�d +, +� +, +tmp +, +�xt +) + + ) + +744 + #DL_FOREACH_SAFE2 +( +h�d +, +� +, +tmp +, +�xt +) \ + +745 ( +� +��( +h�d +); (��&& (( +tmp +���l)-> +�xt +, 1); (����mp)) + + ) + +748 + #DL_SEARCH_SCALAR + +LL_SEARCH_SCALAR + + + ) + +749 + #DL_SEARCH + +LL_SEARCH + + + ) + +750 + #DL_SEARCH_SCALAR2 + +LL_SEARCH_SCALAR2 + + + ) + +751 + #DL_SEARCH2 + +LL_SEARCH2 + + + ) + +753 + #DL_REPLACE_ELEM2 +( +h�d +, +� +, +add +, +�ev +, +�xt +) \ + +755 + `as�� +(( +h�d +�!� +NULL +); \ + +756 + `as�� +(( +� +�!� +NULL +); \ + +757 + `as�� +(( +add +�!� +NULL +); \ + +758 i�(( +h�d +�=�( +� +)) { \ + +759 ( +h�d +��( +add +); \ + +760 ( +add +)-> +�xt + = ( +� +)->next; \ + +761 i�(( +� +)-> +�xt + =� +NULL +) { \ + +762 ( +add +)-> +�ev + = (add); \ + +764 ( +add +)-> +�ev + = ( +� +)->prev; \ + +765 ( +add +)-> +�xt +-> +�ev + = (add); \ + +768 ( +add +)-> +�xt + = ( +� +)->next; \ + +769 ( +add +)-> +�ev + = ( +� +)->prev; \ + +770 ( +add +)-> +�ev +-> +�xt + = (add); \ + +771 i�(( +� +)-> +�xt + =� +NULL +) { \ + +772 ( +h�d +)-> +�ev + = ( +add +); \ + +774 ( +add +)-> +�xt +-> +�ev + = (add); \ + +777 } 0) + + ) + +779 + #DL_REPLACE_ELEM +( +h�d +, +� +, +add +) \ + +780 + `DL_REPLACE_ELEM2 +( +h�d +, +� +, +add +, +�ev +, +�xt +) + + ) + +782 + #DL_PREPEND_ELEM2 +( +h�d +, +� +, +add +, +�ev +, +�xt +) \ + +784 i�( +� +) { \ + +785 + `as�� +(( +h�d +�!� +NULL +); \ + +786 + `as�� +(( +add +�!� +NULL +); \ + +787 ( +add +)-> +�xt + = ( +� +); \ + +788 ( +add +)-> +�ev + = ( +� +)->prev; \ + +789 ( +� +)-> +�ev + = ( +add +); \ + +790 i�(( +h�d +�=�( +� +)) { \ + +791 ( +h�d +��( +add +); \ + +793 ( +add +)-> +�ev +-> +�xt + = (add); \ + +796 + `DL_APPEND2 +( +h�d +, +add +, +�ev +, +�xt +); \ + +799 + + ) + +800 + #DL_PREPEND_ELEM +( +h�d +, +� +, +add +) \ + +801 + `DL_PREPEND_ELEM2 +( +h�d +, +� +, +add +, +�ev +, +�xt +) + + ) + +803 + #DL_APPEND_ELEM2 +( +h�d +, +� +, +add +, +�ev +, +�xt +) \ + +805 i�( +� +) { \ + +806 + `as�� +(( +h�d +�!� +NULL +); \ + +807 + `as�� +(( +add +�!� +NULL +); \ + +808 ( +add +)-> +�xt + = ( +� +)->next; \ + +809 ( +add +)-> +�ev + = ( +� +); \ + +810 ( +� +)-> +�xt + = ( +add +); \ + +811 i�(( +add +)-> +�xt +) { \ + +812 ( +add +)-> +�xt +-> +�ev + = (add); \ + +814 ( +h�d +)-> +�ev + = ( +add +); \ + +817 + `DL_PREPEND2 +( +h�d +, +add +, +�ev +, +�xt +); \ + +820 + + ) + +821 + #DL_APPEND_ELEM +( +h�d +, +� +, +add +) \ + +822 + `DL_APPEND_ELEM2 +( +h�d +, +� +, +add +, +�ev +, +�xt +) + + ) + +824 #ifde� +NO_DECLTYPE + + +827 #unde� +DL_INSERT_INORDER2 + + +828 + #DL_INSERT_INORDER2 +( +h�d +, +add +, +cmp +, +�ev +, +�xt +) \ + +830 i�(( +h�d +�=� +NULL +) { \ + +831 ( +add +)-> +�ev + = (add); \ + +832 ( +add +)-> +�xt + = +NULL +; \ + +833 ( +h�d +��( +add +); \ + +834 } i�(( + `cmp +( +h�d +, +add +)) >= 0) { \ + +835 ( +add +)-> +�ev + = ( +h�d +)->prev; \ + +836 ( +add +)-> +�xt + = ( +h�d +); \ + +837 ( +h�d +)-> +�ev + = ( +add +); \ + +838 ( +h�d +��( +add +); \ + +840 * +_tmp + = (*)( +h�d +); \ + +841 ( +h�d +)-> +�xt + && ( + `cmp +((h�d)->�xt, +add +)) < 0) { \ + +842 ( +h�d +��(h�d)-> +�xt +; \ + +844 ( +add +)-> +�ev + = ( +h�d +); \ + +845 ( +add +)-> +�xt + = ( +h�d +)->next; \ + +846 ( +h�d +)-> +�xt + = ( +add +); \ + +847 + `UTLIST_RS +( +h�d +); \ + +848 i�(( +add +)-> +�xt +) { \ + +849 ( +add +)-> +�xt +-> +�ev + = (add); \ + +851 ( +h�d +)-> +�ev + = ( +add +); \ + +854 } 0) + + ) + +860 + #CDL_APPEND +( +h�d +, +add +) \ + +861 + `CDL_APPEND2 +( +h�d +, +add +, +�ev +, +�xt +) + + ) + +863 + #CDL_APPEND2 +( +h�d +, +add +, +�ev +, +�xt +) \ + +865 i�( +h�d +) { \ + +866 ( +add +)-> +�ev + = ( +h�d +)->prev; \ + +867 ( +add +)-> +�xt + = ( +h�d +); \ + +868 ( +h�d +)-> +�ev + = ( +add +); \ + +869 ( +add +)-> +�ev +-> +�xt + = (add); \ + +871 ( +add +)-> +�ev + = (add); \ + +872 ( +add +)-> +�xt + = (add); \ + +873 ( +h�d +��( +add +); \ + +875 } 0) + + ) + +877 + #CDL_PREPEND +( +h�d +, +add +) \ + +878 + `CDL_PREPEND2 +( +h�d +, +add +, +�ev +, +�xt +) + + ) + +880 + #CDL_PREPEND2 +( +h�d +, +add +, +�ev +, +�xt +) \ + +882 i�( +h�d +) { \ + +883 ( +add +)-> +�ev + = ( +h�d +)->prev; \ + +884 ( +add +)-> +�xt + = ( +h�d +); \ + +885 ( +h�d +)-> +�ev + = ( +add +); \ + +886 ( +add +)-> +�ev +-> +�xt + = (add); \ + +888 ( +add +)-> +�ev + = (add); \ + +889 ( +add +)-> +�xt + = (add); \ + +891 ( +h�d +��( +add +); \ + +892 } 0) + + ) + +894 + #CDL_INSERT_INORDER +( +h�d +, +add +, +cmp +) \ + +895 + `CDL_INSERT_INORDER2 +( +h�d +, +add +, +cmp +, +�ev +, +�xt +) + + ) + +897 + #CDL_INSERT_INORDER2 +( +h�d +, +add +, +cmp +, +�ev +, +�xt +) \ + +899 + `LDECLTYPE +( +h�d +� +_tmp +; \ + +900 i�( +h�d +) { \ + +901 + `CDL_LOWER_BOUND2 +( +h�d +, +_tmp +, +add +, +cmp +, +�xt +); \ + +902 + `CDL_APPEND_ELEM2 +( +h�d +, +_tmp +, +add +, +�ev +, +�xt +); \ + +904 ( +h�d +��( +add +); \ + +905 ( +h�d +)-> +�xt + = (head); \ + +906 ( +h�d +)-> +�ev + = (head); \ + +908 } 0) + + ) + +910 + #CDL_LOWER_BOUND +( +h�d +, +�t +, +like +, +cmp +) \ + +911 + `CDL_LOWER_BOUND2 +( +h�d +, +�t +, +like +, +cmp +, +�xt +) + + ) + +913 + #CDL_LOWER_BOUND2 +( +h�d +, +�t +, +like +, +cmp +, +�xt +) \ + +915 i�(( +h�d +�=� +NULL + || ( + `cmp +(h�d, +like +)) >= 0) { \ + +916 ( +�t +�� +NULL +; \ + +918 ( +�t +��( +h�d +); (�t)-> +�xt + != (head); (elt) = (elt)->next) { \ + +919 i�(( + `cmp +(( +�t +)-> +�xt +, +like +)) >= 0) { \ + +924 } 0) + + ) + +926 + #CDL_DELETE +( +h�d +, +d� +) \ + +927 + `CDL_DELETE2 +( +h�d +, +d� +, +�ev +, +�xt +) + + ) + +929 + #CDL_DELETE2 +( +h�d +, +d� +, +�ev +, +�xt +) \ + +931 i�((( +h�d +)==( +d� +)�&& ((h�d)-> +�xt + == (head))) { \ + +932 ( +h�d +�� +NULL +; \ + +934 ( +d� +)-> +�xt +-> +�ev + = (del)->prev; \ + +935 ( +d� +)-> +�ev +-> +�xt + = (del)->next; \ + +936 i�(( +d� +�=�( +h�d +)�(h�d)=(d�)-> +�xt +; \ + +938 } 0) + + ) + +940 + #CDL_COUNT +( +h�d +, +� +, +cou�� +) \ + +941 + `CDL_COUNT2 +( +h�d +, +� +, +cou�� +, +�xt +) \ + +942 + + ) + +943 + #CDL_COUNT2 +( +h�d +, +� +, +cou�� +, +�xt +) \ + +945 ( +cou�� +) = 0; \ + +946 + `CDL_FOREACH2 +( +h�d +, +� +, +�xt +�{ ++( +cou�� +); } \ + +947 } 0) + + ) + +949 + #CDL_FOREACH +( +h�d +, +� +) \ + +950 + `CDL_FOREACH2 +( +h�d +, +� +, +�xt +) + + ) + +952 + #CDL_FOREACH2 +( +h�d +, +� +, +�xt +) \ + +953 ( +� +)=( +h�d +);�;�l)=((�l)-> +�xt +==(h�d)�? +NULL + : (�)->�xt)) + + ) + +955 + #CDL_FOREACH_SAFE +( +h�d +, +� +, +tmp1 +, +tmp2 +) \ + +956 + `CDL_FOREACH_SAFE2 +( +h�d +, +� +, +tmp1 +, +tmp2 +, +�ev +, +�xt +) + + ) + +958 + #CDL_FOREACH_SAFE2 +( +h�d +, +� +, +tmp1 +, +tmp2 +, +�ev +, +�xt +) \ + +959 ( +� +��( +h�d +), ( +tmp1 +��(h�d�? (h�d)-> +�ev + : +NULL +; \ + +960 ( +� +�&& (( +tmp2 +���l)-> +�xt +, 1); \ + +961 ( +� +��(�l�=�( +tmp1 +�? +NULL + : ( +tmp2 +))) + + ) + +963 + #CDL_SEARCH_SCALAR +( +h�d +, +out +, +f�ld +, +v� +) \ + +964 + `CDL_SEARCH_SCALAR2 +( +h�d +, +out +, +f�ld +, +v� +, +�xt +) + + ) + +966 + #CDL_SEARCH_SCALAR2 +( +h�d +, +out +, +f�ld +, +v� +, +�xt +) \ + +968 + `CDL_FOREACH2 +( +h�d +, +out +, +�xt +) { \ + +969 i�(( +out +)-> +f�ld + =�( +v� +)) ; \ + +971 } 0) + + ) + +973 + #CDL_SEARCH +( +h�d +, +out +, +�t +, +cmp +) \ + +974 + `CDL_SEARCH2 +( +h�d +, +out +, +�t +, +cmp +, +�xt +) + + ) + +976 + #CDL_SEARCH2 +( +h�d +, +out +, +�t +, +cmp +, +�xt +) \ + +978 + `CDL_FOREACH2 +( +h�d +, +out +, +�xt +) { \ + +979 i�(( + `cmp +( +out +, +�t +))==0) ; \ + +981 } 0) + + ) + +983 + #CDL_REPLACE_ELEM2 +( +h�d +, +� +, +add +, +�ev +, +�xt +) \ + +985 + `as�� +(( +h�d +�!� +NULL +); \ + +986 + `as�� +(( +� +�!� +NULL +); \ + +987 + `as�� +(( +add +�!� +NULL +); \ + +988 i�(( +� +)-> +�xt + == (el)) { \ + +989 ( +add +)-> +�xt + = (add); \ + +990 ( +add +)-> +�ev + = (add); \ + +991 ( +h�d +��( +add +); \ + +993 ( +add +)-> +�xt + = ( +� +)->next; \ + +994 ( +add +)-> +�ev + = ( +� +)->prev; \ + +995 ( +add +)-> +�xt +-> +�ev + = (add); \ + +996 ( +add +)-> +�ev +-> +�xt + = (add); \ + +997 i�(( +h�d +�=�( +� +)) { \ + +998 ( +h�d +��( +add +); \ + +1001 } 0) + + ) + +1003 + #CDL_REPLACE_ELEM +( +h�d +, +� +, +add +) \ + +1004 + `CDL_REPLACE_ELEM2 +( +h�d +, +� +, +add +, +�ev +, +�xt +) + + ) + +1006 + #CDL_PREPEND_ELEM2 +( +h�d +, +� +, +add +, +�ev +, +�xt +) \ + +1008 i�( +� +) { \ + +1009 + `as�� +(( +h�d +�!� +NULL +); \ + +1010 + `as�� +(( +add +�!� +NULL +); \ + +1011 ( +add +)-> +�xt + = ( +� +); \ + +1012 ( +add +)-> +�ev + = ( +� +)->prev; \ + +1013 ( +� +)-> +�ev + = ( +add +); \ + +1014 ( +add +)-> +�ev +-> +�xt + = (add); \ + +1015 i�(( +h�d +�=�( +� +)) { \ + +1016 ( +h�d +��( +add +); \ + +1019 + `CDL_APPEND2 +( +h�d +, +add +, +�ev +, +�xt +); \ + +1021 } 0) + + ) + +1023 + #CDL_PREPEND_ELEM +( +h�d +, +� +, +add +) \ + +1024 + `CDL_PREPEND_ELEM2 +( +h�d +, +� +, +add +, +�ev +, +�xt +) + + ) + +1026 + #CDL_APPEND_ELEM2 +( +h�d +, +� +, +add +, +�ev +, +�xt +) \ + +1028 i�( +� +) { \ + +1029 + `as�� +(( +h�d +�!� +NULL +); \ + +1030 + `as�� +(( +add +�!� +NULL +); \ + +1031 ( +add +)-> +�xt + = ( +� +)->next; \ + +1032 ( +add +)-> +�ev + = ( +� +); \ + +1033 ( +� +)-> +�xt + = ( +add +); \ + +1034 ( +add +)-> +�xt +-> +�ev + = (add); \ + +1036 + `CDL_PREPEND2 +( +h�d +, +add +, +�ev +, +�xt +); \ + +1038 } 0) + + ) + +1040 + #CDL_APPEND_ELEM +( +h�d +, +� +, +add +) \ + +1041 + `CDL_APPEND_ELEM2 +( +h�d +, +� +, +add +, +�ev +, +�xt +) + + ) + +1043 #ifde� +NO_DECLTYPE + + +1046 #unde� +CDL_INSERT_INORDER2 + + +1047 + #CDL_INSERT_INORDER2 +( +h�d +, +add +, +cmp +, +�ev +, +�xt +) \ + +1049 i�(( +h�d +�=� +NULL +) { \ + +1050 ( +add +)-> +�ev + = (add); \ + +1051 ( +add +)-> +�xt + = (add); \ + +1052 ( +h�d +��( +add +); \ + +1053 } i�(( + `cmp +( +h�d +, +add +)) >= 0) { \ + +1054 ( +add +)-> +�ev + = ( +h�d +)->prev; \ + +1055 ( +add +)-> +�xt + = ( +h�d +); \ + +1056 ( +add +)-> +�ev +-> +�xt + = (add); \ + +1057 ( +h�d +)-> +�ev + = ( +add +); \ + +1058 ( +h�d +��( +add +); \ + +1060 * +_tmp + = (*)( +h�d +); \ + +1061 (*)( +h�d +)-> +�xt + !� +_tmp + && ( + `cmp +((h�d)->�xt, +add +)) < 0) { \ + +1062 ( +h�d +��(h�d)-> +�xt +; \ + +1064 ( +add +)-> +�ev + = ( +h�d +); \ + +1065 ( +add +)-> +�xt + = ( +h�d +)->next; \ + +1066 ( +add +)-> +�xt +-> +�ev + = (add); \ + +1067 ( +h�d +)-> +�xt + = ( +add +); \ + +1068 + `UTLIST_RS +( +h�d +); \ + +1070 } 0) + + ) + + @src/handle_auth.c + +17 + ~"c�fig.h +" + +19 + ~<�dio.h +> + +20 + ~<�r�g.h +> + +22 + ~"mosqu�to_brok�_����.h +" + +23 + ~"mq�_��oc�.h +" + +24 + ~"mem�y_mosq.h +" + +25 + ~"�ck�_mosq.h +" + +26 + ~"�ݔty_mosq.h +" + +27 + ~"�nd_mosq.h +" + +28 + ~"w�l_mosq.h +" + +31 + $h�d�__auth +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +33 +rc + = 0; + +34 +u�t8_t + +�as�_code + = 0; + +35 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +36 * +auth_m�hod + = +NULL +; + +37 * +auth_d�a + = +NULL +; + +38 +u�t16_t + +auth_d�a_�n + = 0; + +39 * +auth_d�a_out + = +NULL +; + +40 +u�t16_t + +auth_d�a_out_�n + = 0; + +42 if(! +cڋxt +� +MOSQ_ERR_INVAL +; + +44 if( +cڋxt +-> +��oc� + !� +mosq_p_mq�5 + || cڋxt-> +auth_m�hod + =� +NULL +){ + +45 +MOSQ_ERR_PROTOCOL +; + +48 if( +cڋxt +-> +�_�ck� +. +�ma��g_�ngth + > 0){ + +49 if( + `�ck�__�ad_by� +(& +cڋxt +-> +�_�ck� +, & +�as�_code +)) 1; + +50 if( +�as�_code + !� +MQTT_RC_CONTINUE_AUTHENTICATION + + +51 && +�as�_code + !� +MQTT_RC_REAUTHENTICATE +){ + +53 + `�nd__disc��� +( +cڋxt +, +MQTT_RC_PROTOCOL_ERROR +, +NULL +); + +54 +MOSQ_ERR_PROTOCOL +; + +57 if(( +�as�_code + =� +MQTT_RC_REAUTHENTICATE + && +cڋxt +-> +��e + !� +mosq_cs_c���ed +) + +58 || ( +�as�_code + =� +MQTT_RC_CONTINUE_AUTHENTICATION + + +59 && +cڋxt +-> +��e + !� +mosq_cs_auth�ti�t�g + && cڋxt->���!� +mosq_cs_�auth�ti�t�g +)){ + +61 + `�nd__disc��� +( +cڋxt +, +MQTT_RC_PROTOCOL_ERROR +, +NULL +); + +62 +MOSQ_ERR_PROTOCOL +; + +65 +rc + = + `�ݔty__�ad_�l +( +CMD_AUTH +, & +cڋxt +-> +�_�ck� +, & +�ݔt�s +); + +66 if( +rc +){ + +67 + `�nd__disc��� +( +cڋxt +, +MQTT_RC_UNSPECIFIED +, +NULL +); + +68 +rc +; + +72 if( + `mosqu�to_�ݔty_�ad_�r�g +( +�ݔt�s +, +MQTT_PROP_AUTHENTICATION_METHOD +, & +auth_m�hod +, +�l� +�=� +NULL +){ + +73 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +74 + `�nd__disc��� +( +cڋxt +, +MQTT_RC_UNSPECIFIED +, +NULL +); + +75 +MOSQ_ERR_PROTOCOL +; + +78 if(! +auth_m�hod + || + `�rcmp +�uth_m�hod, +cڋxt +->auth_method)){ + +80 + `mosqu�to__� +( +auth_m�hod +); + +81 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +82 + `�nd__disc��� +( +cڋxt +, +MQTT_RC_PROTOCOL_ERROR +, +NULL +); + +83 +MOSQ_ERR_PROTOCOL +; + +85 + `mosqu�to__� +( +auth_m�hod +); + +87 + `mosqu�to_�ݔty_�ad_b��y +( +�ݔt�s +, +MQTT_PROP_AUTHENTICATION_DATA +, & +auth_d�a +, & +auth_d�a_�n +, +�l� +); + +89 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +92 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "Re�ived AUTH from %��c%d, %s)", +cڋxt +-> +id +, +�as�_code +, cڋxt-> +auth_m�hod +); + +95 if( +�as�_code + =� +MQTT_RC_REAUTHENTICATE +){ + +97 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_�auth�ti�t�g +); + +98 +rc + = + `mosqu�to_�cur�y_auth_��t +( +db +, +cڋxt +, +�ue +, +auth_d�a +, +auth_d�a_�n +, & +auth_d�a_out +, & +auth_d�a_out_�n +); + +100 if( +cڋxt +-> +��e + !� +mosq_cs_�auth�ti�t�g +){ + +101 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_auth�ti�t�g +); + +103 +rc + = + `mosqu�to_�cur�y_auth_c�t�ue +( +db +, +cڋxt +, +auth_d�a +, +auth_d�a_�n +, & +auth_d�a_out +, & +auth_d�a_out_�n +); + +105 + `mosqu�to__� +( +auth_d�a +); + +106 if( +rc + =� +MOSQ_ERR_SUCCESS +){ + +107 if( +cڋxt +-> +��e + =� +mosq_cs_auth�ti�t�g +){ + +108 + `c���__�_auth�i�d +( +db +, +cڋxt +, +auth_d�a_out +, +auth_d�a_out_�n +); + +110 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_c���ed +); + +111 +rc + = + `�nd__auth +( +db +, +cڋxt +, +MQTT_RC_SUCCESS +, +auth_d�a_out +, +auth_d�a_out_�n +); + +112 + `� +( +auth_d�a_out +); + +113 +rc +; + +115 }if( +rc + =� +MOSQ_ERR_AUTH_CONTINUE +){ + +116 +rc + = + `�nd__auth +( +db +, +cڋxt +, +MQTT_RC_CONTINUE_AUTHENTICATION +, +auth_d�a_out +, +auth_d�a_out_�n +); + +117 + `� +( +auth_d�a_out +); + +118 +rc +; + +120 + `� +( +auth_d�a_out +); + +121 if( +cڋxt +-> +��e + =� +mosq_cs_auth�ti�t�g + && cڋxt-> +w�l +){ + +123 + `w�l__��r +( +cڋxt +); + +125 if( +rc + =� +MOSQ_ERR_AUTH +){ + +126 + `�nd__c��ck +( +db +, +cڋxt +, 0, +MQTT_RC_NOT_AUTHORIZED +, +NULL +); + +127 if( +cڋxt +-> +��e + =� +mosq_cs_auth�ti�t�g +){ + +128 + `mosqu�to__� +( +cڋxt +-> +id +); + +129 +cڋxt +-> +id + = +NULL +; + +131 +MOSQ_ERR_PROTOCOL +; + +132 }if( +rc + =� +MOSQ_ERR_NOT_SUPPORTED +){ + +134 + `�nd__c��ck +( +db +, +cڋxt +, 0, +MQTT_RC_BAD_AUTHENTICATION_METHOD +, +NULL +); + +135 if( +cڋxt +-> +��e + =� +mosq_cs_auth�ti�t�g +){ + +136 + `mosqu�to__� +( +cڋxt +-> +id +); + +137 +cڋxt +-> +id + = +NULL +; + +139 +MOSQ_ERR_PROTOCOL +; + +141 if( +cڋxt +-> +��e + =� +mosq_cs_auth�ti�t�g +){ + +142 + `mosqu�to__� +( +cڋxt +-> +id +); + +143 +cڋxt +-> +id + = +NULL +; + +145 +rc +; + +148 + } +} + + @src/handle_connack.c + +17 + ~"c�fig.h +" + +19 + ~<�dio.h +> + +20 + ~<�r�g.h +> + +22 + ~"mosqu�to_brok�_����.h +" + +23 + ~"mem�y_mosq.h +" + +24 + ~"mq�_��oc�.h +" + +25 + ~"�ck�_mosq.h +" + +26 + ~"�nd_mosq.h +" + +27 + ~"ut�_mosq.h +" + +29 + $h�d�__c��ck +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +31 +rc +; + +32 +u�t8_t + +c���_acknow�dge +; + +33 +u�t8_t + +�as�_code +; + +34 +i +; + +35 * +n�ifi�ti�_t�ic +; + +36 +n�ifi�ti�_t�ic_�n +; + +37 +n�ifi�ti�_�yl�d +; + +38 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +40 if(! +cڋxt +){ + +41 +MOSQ_ERR_INVAL +; + +43 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "Re�ived CONNACK o�c���i� %s.", +cڋxt +-> +id +); + +44 if( + `�ck�__�ad_by� +(& +cڋxt +-> +�_�ck� +, & +c���_acknow�dge +)) 1; + +45 if( + `�ck�__�ad_by� +(& +cڋxt +-> +�_�ck� +, & +�as�_code +)) 1; + +47 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +48 +rc + = + `�ݔty__�ad_�l +( +CMD_CONNACK +, & +cڋxt +-> +�_�ck� +, & +�ݔt�s +); + +49 if( +rc +) �c; + +50 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +52 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +54 +�as�_code +){ + +55 +CONNACK_ACCEPTED +: + +56 if( +cڋxt +-> +bridge +){ + +57 if( +cڋxt +-> +bridge +-> +n�ifi�ti�s +){ + +58 +n�ifi�ti�_�yl�d + = '1'; + +59 if( +cڋxt +-> +bridge +-> +n�ifi�ti�_t�ic +){ + +60 if(! +cڋxt +-> +bridge +-> +n�ifi�ti�s_lo�l_�ly +){ + +61 if( + `�nd__��_publish +( +cڋxt +, + `mosqu�to__mid_g���e +(context), + +62 +cڋxt +-> +bridge +-> +n�ifi�ti�_t�ic +, 1, & +n�ifi�ti�_�yl�d +, 1, +�ue +, 0, +NULL +, NULL, 0)){ + +67 + `db__mes�ges_�sy_queue +( +db +, +cڋxt +, cڋxt-> +bridge +-> +n�ifi�ti�_t�ic +, 1, 1, & +n�ifi�ti�_�yl�d +, 1, 0, +NULL +); + +69 +n�ifi�ti�_t�ic_�n + = + `��� +( +cڋxt +-> +bridge +-> +�m�e_���id +)+strlen("$SYS/broker/connection//state"); + +70 +n�ifi�ti�_t�ic + = + `mosqu�to__m�loc +(()*( +n�ifi�ti�_t�ic_�n ++1)); + +71 if(! +n�ifi�ti�_t�ic +� +MOSQ_ERR_NOMEM +; + +73 + `���tf +( +n�ifi�ti�_t�ic +, +n�ifi�ti�_t�ic_�n ++1, "$SYS/brok�/c���i�/%s/��e", +cڋxt +-> +bridge +-> +�m�e_���id +); + +74 +n�ifi�ti�_�yl�d + = '1'; + +75 if(! +cڋxt +-> +bridge +-> +n�ifi�ti�s_lo�l_�ly +){ + +76 if( + `�nd__��_publish +( +cڋxt +, + `mosqu�to__mid_g���e +(context), + +77 +n�ifi�ti�_t�ic +, 1, & +n�ifi�ti�_�yl�d +, 1, +�ue +, 0, +NULL +, NULL, 0)){ + +79 + `mosqu�to__� +( +n�ifi�ti�_t�ic +); + +83 + `db__mes�ges_�sy_queue +( +db +, +cڋxt +, +n�ifi�ti�_t�ic +, 1, 1, & +n�ifi�ti�_�yl�d +, 1, 0, +NULL +); + +84 + `mosqu�to__� +( +n�ifi�ti�_t�ic +); + +87 +i +=0; i< +cڋxt +-> +bridge +-> +t�ic_cou� +; i++){ + +88 if( +cڋxt +-> +bridge +-> +t�ics +[ +i +]. +d�e�i� + =� +bd_� + || cڋxt->bridge->t�ics[i].d�e�i� =� +bd_b�h +){ + +89 if( + `�nd__subs�ibe +( +cڋxt +, +NULL +, 1, &cڋxt-> +bridge +-> +t�ics +[ +i +]. +�m�e_t�ic +, cڋxt->bridge->t�ics[i]. +qos +, NULL)){ + +93 if( +cڋxt +-> +bridge +-> +��m�_unsubs�ibe +){ + +94 if( + `�nd__unsubs�ibe +( +cڋxt +, +NULL +, 1, &cڋxt-> +bridge +-> +t�ics +[ +i +]. +�m�e_t�ic +, NULL)){ + +103 +i +=0; i< +cڋxt +-> +bridge +-> +t�ic_cou� +; i++){ + +104 if( +cڋxt +-> +bridge +-> +t�ics +[ +i +]. +d�e�i� + =� +bd_out + || cڋxt->bridge->t�ics[i].d�e�i� =� +bd_b�h +){ + +105 + `sub__���_queue +( +db +, +cڋxt +, + +106 +cڋxt +-> +bridge +-> +t�ics +[ +i +]. +lo�l_t�ic +, + +107 +cڋxt +-> +bridge +-> +t�ics +[ +i +]. +qos +, 0); + +111 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_c���ed +); + +112 +MOSQ_ERR_SUCCESS +; + +113 +CONNACK_REFUSED_PROTOCOL_VERSION +: + +114 if( +cڋxt +-> +bridge +){ + +115 +cڋxt +-> +bridge +-> +�y_�iv�e_ac��ed + = +�l� +; + +117 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Connection Refused: unacceptable�rotocol version"); + +119 +CONNACK_REFUSED_IDENTIFIER_REJECTED +: + +120 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Connection Refused: identifier�ejected"); + +122 +CONNACK_REFUSED_SERVER_UNAVAILABLE +: + +123 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Connection Refused: broker unavailable"); + +125 +CONNACK_REFUSED_BAD_USERNAME_PASSWORD +: + +126 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Connection Refused: broker unavailable"); + +128 +CONNACK_REFUSED_NOT_AUTHORIZED +: + +129 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Connection Refused:�ot�uthorised"); + +132 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Connection Refused: unknown�eason"); + +136 + } +} + + @src/handle_connect.c + +17 + ~"c�fig.h +" + +19 + ~<�dio.h +> + +20 + ~<�r�g.h +> + +21 + ~<u�i�.h +> + +23 + ~"mosqu�to_brok�_����.h +" + +24 + ~"mq�_��oc�.h +" + +25 + ~"mem�y_mosq.h +" + +26 + ~"�ck�_mosq.h +" + +27 + ~"�ݔty_mosq.h +" + +28 + ~"�nd_mosq.h +" + +29 + ~"sys_��.h +" + +30 + ~"time_mosq.h +" + +31 + ~"�s_mosq.h +" + +32 + ~"ut�_mosq.h +" + +33 + ~"w�l_mosq.h +" + +35 #ifde� +WITH_WEBSOCKETS + + +36 + ~<libwebsock�s.h +> + +40 + $nibb�_to_hex +( +u�t8_t + +v�ue +) + +42 if( +v�ue + < 0x0A){ + +43 '0'+ +v�ue +; + +45 'A'+ +v�ue +-0x0A; + +47 + } +} + +49 * + $���_id_g� +(* +id�n +, cڡ * +auto_id_�efix +, +auto_id_�efix_�n +) + +51 * +���_id +; + +52 +u�t8_t + +�d +[16]; + +53 +i +; + +54 +pos +; + +56 if( + `ut�__�ndom_by�s +( +�d +, 16)� +NULL +; + +58 * +id�n + = 36 + +auto_id_�efix_�n +; + +60 +���_id + = (*) + `mosqu�to__��oc +((* +id�n +) + 1, ()); + +61 if(! +���_id +){ + +62 +NULL +; + +64 if( +auto_id_�efix +){ + +65 + `mem�y +( +���_id +, +auto_id_�efix +, +auto_id_�efix_�n +); + +68 +pos + = 0; + +69 +i +=0; i<16; i++){ + +70 +���_id +[ +auto_id_�efix_�n + + +pos + + 0] = + `nibb�_to_hex +( +�d +[ +i +] & 0x0F); + +71 +���_id +[ +auto_id_�efix_�n + + +pos + + 1] = + `nibb�_to_hex +(( +�d +[ +i +] >> 4) & 0x0F); + +72 +pos + += 2; + +73 if( +pos + == 8 ||�os == 13 ||�os == 18 ||�os == 23){ + +74 +���_id +[ +auto_id_�efix_�n + + +pos +] = '-'; + +75 +pos +++; + +79 +���_id +; + +80 + } +} + +84 + $c���i�_check_a� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +mosqu�to_���_msg + ** +h�d +) + +86 +mosqu�to_���_msg + * +msg_�� +, * +tmp +; + +88 + `DL_FOREACH_SAFE +((* +h�d +), +msg_�� +, +tmp +){ + +89 if( +msg_�� +-> +d�e�i� + =� +mosq_md_out +){ + +90 if( + `mosqu�to_a�_check +( +db +, +cڋxt +, +msg_�� +-> +��e +-> +t�ic +, + +91 +msg_�� +-> +��e +-> +�yl�d�n +, + `UHPA_ACCESS +(msg_��->��e-> +�yl�d +, msg_tail->store->payloadlen), + +92 +msg_�� +-> +��e +-> +qos +, msg_��->��e-> +��� +, +MOSQ_ACL_READ +�!� +MOSQ_ERR_SUCCESS +){ + +94 + `DL_DELETE +((* +h�d +), +msg_�� +); + +95 + `db__msg_��e_�f_dec +( +db +, & +msg_�� +-> +��e +); + +96 + `mosqu�to_�ݔty_�_�l +(& +msg_�� +-> +�ݔt�s +); + +97 + `mosqu�to__� +( +msg_�� +); + +101 + } +} + +104 + $c���__�_auth�i�d +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, * +auth_d�a_out +, +u�t16_t + +auth_d�a_out_�n +) + +106 +mosqu�to + * +found_cڋxt +; + +107 +mosqu�to__sub�af + * +�af +; + +108 +mosqu�to_�ݔty + * +c��ck_��s + = +NULL +; + +109 +u�t8_t + +c���_ack + = 0; + +110 +i +; + +111 +rc +; + +114 + `HASH_FIND +( +hh_id +, +db +-> +cڋxts_by_id +, +cڋxt +-> +id +, + `��� +(cڋxt->id), +found_cڋxt +); + +115 if( +found_cڋxt +){ + +117 if( +found_cڋxt +-> +sock + =� +INVALID_SOCKET +){ + +123 if( +db +-> +c�fig +-> +c���i�_mes�ges + =� +�ue +){ + +124 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Cl�� %���ady c���ed, clos�g old c���i�.", +cڋxt +-> +id +); + +128 if( +cڋxt +-> +��n_��t + =� +�l� + && +found_cڋxt +-> +�ssi�_exp�y_��rv� + > 0){ + +129 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�311 + || cڋxt->��oc� =� +mosq_p_mq�5 +){ + +130 +c���_ack + |= 0x01; + +133 if( +found_cڋxt +-> +msgs_� +. +��ight + || found_cڋxt->msgs_�. +queued + + +134 || +found_cڋxt +-> +msgs_out +. +��ight + || found_cڋxt->msgs_out. +queued +){ + +136 + `mem�y +(& +cڋxt +-> +msgs_� +, & +found_cڋxt +->msgs_�, ( +mosqu�to_msg_d�a +)); + +137 + `mem�y +(& +cڋxt +-> +msgs_out +, & +found_cڋxt +->msgs_out, ( +mosqu�to_msg_d�a +)); + +139 + `mem�t +(& +found_cڋxt +-> +msgs_� +, 0, ( +mosqu�to_msg_d�a +)); + +140 + `mem�t +(& +found_cڋxt +-> +msgs_out +, 0, ( +mosqu�to_msg_d�a +)); + +142 + `db__mes�ge_�c���_��t +( +db +, +cڋxt +); + +144 +cڋxt +-> +subs + = +found_cڋxt +->subs; + +145 +found_cڋxt +-> +subs + = +NULL +; + +146 +cڋxt +-> +sub_cou� + = +found_cڋxt +->sub_count; + +147 +found_cڋxt +-> +sub_cou� + = 0; + +148 +cڋxt +-> +ϡ_mid + = +found_cڋxt +->last_mid; + +150 +i +=0; i< +cڋxt +-> +sub_cou� +; i++){ + +151 if( +cڋxt +-> +subs +[ +i +]){ + +152 +�af + = +cڋxt +-> +subs +[ +i +]->subs; + +153 +�af +){ + +154 if( +�af +-> +cڋxt + =� +found_cڋxt +){ + +155 +�af +-> +cڋxt + = context; + +157 +�af + =��f-> +�xt +; + +163 + `�ssi�_exp�y__�move +( +found_cڋxt +); + +164 + `w�l_d�ay__�move +( +found_cڋxt +); + +165 + `w�l__��r +( +found_cڋxt +); + +167 +found_cڋxt +-> +��n_��t + = +�ue +; + +168 +found_cڋxt +-> +�ssi�_exp�y_��rv� + = 0; + +169 + `cڋxt__�t_��e +( +found_cڋxt +, +mosq_cs_du�i�� +); + +170 + `do_disc��� +( +db +, +found_cڋxt +, +MOSQ_ERR_SUCCESS +); + +173 +rc + = + `a�__f�d_a�s +( +db +, +cڋxt +); + +174 if( +rc +){ + +175 + `� +( +auth_d�a_out +); + +176 +rc +; + +179 if( +db +-> +c�fig +-> +c���i�_mes�ges + =� +�ue +){ + +180 if( +cڋxt +-> +is_bridge +){ + +181 if( +cڋxt +-> +u��ame +){ + +182 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "New bridge connected from %s�s %s (p%d, c%d, k%d, u'%s').", + +183 +cڋxt +-> +add�ss +, cڋxt-> +id +, cڋxt-> +��oc� +, cڋxt-> +��n_��t +, cڋxt-> +k��live +, cڋxt-> +u��ame +); + +185 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "New bridge connected from %s�s %s (p%d, c%d, k%d).", + +186 +cڋxt +-> +add�ss +, cڋxt-> +id +, cڋxt-> +��oc� +, cڋxt-> +��n_��t +, cڋxt-> +k��live +); + +189 if( +cڋxt +-> +u��ame +){ + +190 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "New client connected from %s�s %s (p%d, c%d, k%d, u'%s').", + +191 +cڋxt +-> +add�ss +, cڋxt-> +id +, cڋxt-> +��oc� +, cڋxt-> +��n_��t +, cڋxt-> +k��live +, cڋxt-> +u��ame +); + +193 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "New client connected from %s�s %s (p%d, c%d, k%d).", + +194 +cڋxt +-> +add�ss +, cڋxt-> +id +, cڋxt-> +��oc� +, cڋxt-> +��n_��t +, cڋxt-> +k��live +); + +198 if( +cڋxt +-> +w�l +) { + +199 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "Will message specified (%ld bytes) (r%d, q%d).", + +200 () +cڋxt +-> +w�l +-> +msg +. +�yl�d�n +, + +201 +cڋxt +-> +w�l +-> +msg +. +��� +, + +202 +cڋxt +-> +w�l +-> +msg +. +qos +); + +204 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "\t%s", +cڋxt +-> +w�l +-> +msg +. +t�ic +); + +206 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "No will message specified."); + +210 +cڋxt +-> +p�g_t + = 0; + +211 +cڋxt +-> +is_dr�p�g + = +�l� +; + +213 + `c���i�_check_a� +( +db +, +cڋxt +, &cڋxt-> +msgs_� +. +��ight +); + +214 + `c���i�_check_a� +( +db +, +cڋxt +, &cڋxt-> +msgs_� +. +queued +); + +215 + `c���i�_check_a� +( +db +, +cڋxt +, &cڋxt-> +msgs_out +. +��ight +); + +216 + `c���i�_check_a� +( +db +, +cڋxt +, &cڋxt-> +msgs_out +. +queued +); + +218 + `HASH_ADD_KEYPTR +( +hh_id +, +db +-> +cڋxts_by_id +, +cڋxt +-> +id +, + `��� +(context->id), context); + +220 #ifde� +WITH_PERSISTENCE + + +221 if(! +cڋxt +-> +��n_��t +){ + +222 +db +-> +�rsi���_ch�ges +++; + +225 +cڋxt +-> +maximum_qos + = cڋxt-> +li��� +->maximum_qos; + +227 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +228 if( +cڋxt +-> +maximum_qos + != 2){ + +229 if( + `mosqu�to_�ݔty_add_by� +(& +c��ck_��s +, +MQTT_PROP_MAXIMUM_QOS +, +cڋxt +-> +maximum_qos +)){ + +230 +rc + = +MOSQ_ERR_NOMEM +; + +231 +�r� +; + +234 if( +cڋxt +-> +li��� +-> +max_t�ic_��s + > 0){ + +235 if( + `mosqu�to_�ݔty_add_�t16 +(& +c��ck_��s +, +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +, +cڋxt +-> +li��� +-> +max_t�ic_��s +)){ + +236 +rc + = +MOSQ_ERR_NOMEM +; + +237 +�r� +; + +240 if( +cڋxt +-> +k��live + > +db +-> +c�fig +-> +max_k��live +){ + +241 +cڋxt +-> +k��live + = +db +-> +c�fig +-> +max_k��live +; + +242 if( + `mosqu�to_�ݔty_add_�t16 +(& +c��ck_��s +, +MQTT_PROP_SERVER_KEEP_ALIVE +, +cڋxt +-> +k��live +)){ + +243 +rc + = +MOSQ_ERR_NOMEM +; + +244 +�r� +; + +247 if( +cڋxt +-> +assig�d_id +){ + +248 if( + `mosqu�to_�ݔty_add_�r�g +(& +c��ck_��s +, +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +, +cڋxt +-> +id +)){ + +249 +rc + = +MOSQ_ERR_NOMEM +; + +250 +�r� +; + +253 if( +cڋxt +-> +auth_m�hod +){ + +254 if( + `mosqu�to_�ݔty_add_�r�g +(& +c��ck_��s +, +MQTT_PROP_AUTHENTICATION_METHOD +, +cڋxt +-> +auth_m�hod +)){ + +255 +rc + = +MOSQ_ERR_NOMEM +; + +256 +�r� +; + +259 if( +auth_d�a_out + && +auth_d�a_out_�n + > 0){ + +260 if( + `mosqu�to_�ݔty_add_b��y +(& +c��ck_��s +, +MQTT_PROP_AUTHENTICATION_DATA +, +auth_d�a_out +, +auth_d�a_out_�n +)){ + +261 +rc + = +MOSQ_ERR_NOMEM +; + +262 +�r� +; + +267 + `� +( +auth_d�a_out +); + +269 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_c���ed +); + +270 +rc + = + `�nd__c��ck +( +db +, +cڋxt +, +c���_ack +, +CONNACK_ACCEPTED +, +c��ck_��s +); + +271 + `mosqu�to_�ݔty_�_�l +(& +c��ck_��s +); + +272 +rc +; + +273 +�r� +: + +274 + `� +( +auth_d�a_out +); + +275 + `mosqu�to_�ݔty_�_�l +(& +c��ck_��s +); + +276 +rc +; + +277 + } +} + +280 + $w�l__�ad +( +mosqu�to + * +cڋxt +, +mosqu�to_mes�ge_�l + ** +w�l +, +u�t8_t + +w�l_qos +, +w�l_��� +) + +282 +rc + = +MOSQ_ERR_SUCCESS +; + +283 +�� +; + +284 +mosqu�to_mes�ge_�l + * +w�l_�ru� + = +NULL +; + +285 * +w�l_t�ic_mou� + = +NULL +; + +286 +u�t16_t + +�yl�d�n +; + +287 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +289 +w�l_�ru� + = + `mosqu�to__��oc +(1, ( +mosqu�to_mes�ge_�l +)); + +290 if(! +w�l_�ru� +){ + +291 +rc + = +MOSQ_ERR_NOMEM +; + +292 +�r�_��nup +; + +294 if( +cڋxt +-> +��oc� + =� +PROTOCOL_VERSION_v5 +){ + +295 +rc + = + `�ݔty__�ad_�l +( +CMD_WILL +, & +cڋxt +-> +�_�ck� +, & +�ݔt�s +); + +296 if( +rc +� +�r�_��nup +; + +298 +rc + = + `�ݔty__�o�ss_w�l +( +cڋxt +, +w�l_�ru� +, & +�ݔt�s +); + +299 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +300 if( +rc +� +�r�_��nup +; + +302 +rc + = + `�ck�__�ad_�r�g +(& +cڋxt +-> +�_�ck� +, & +w�l_�ru� +-> +msg +. +t�ic +, & +�� +); + +303 if( +rc +� +�r�_��nup +; + +304 if(! +�� +){ + +305 +rc + = +MOSQ_ERR_PROTOCOL +; + +306 +�r�_��nup +; + +309 if( +cڋxt +-> +li��� +-> +mou�_po�t +){ + +310 +�� + = + `��� +( +cڋxt +-> +li��� +-> +mou�_po�t +�+ s��n( +w�l_�ru� +-> +msg +. +t�ic +) + 1; + +311 +w�l_t�ic_mou� + = + `mosqu�to__m�loc +( +�� ++1); + +312 if(! +w�l_t�ic_mou� +){ + +313 +rc + = +MOSQ_ERR_NOMEM +; + +314 +�r�_��nup +; + +317 + `���tf +( +w�l_t�ic_mou� +, +�� +, "%s%s", +cڋxt +-> +li��� +-> +mou�_po�t +, +w�l_�ru� +-> +msg +. +t�ic +); + +318 +w�l_t�ic_mou� +[ +�� +] = '\0'; + +320 + `mosqu�to__� +( +w�l_�ru� +-> +msg +. +t�ic +); + +321 +w�l_�ru� +-> +msg +. +t�ic + = +w�l_t�ic_mou� +; + +324 +rc + = + `mosqu�to_pub_t�ic_check +( +w�l_�ru� +-> +msg +. +t�ic +); + +325 if( +rc +� +�r�_��nup +; + +327 +rc + = + `�ck�__�ad_u�t16 +(& +cڋxt +-> +�_�ck� +, & +�yl�d�n +); + +328 if( +rc +� +�r�_��nup +; + +330 +w�l_�ru� +-> +msg +. +�yl�d�n + =�ayloadlen; + +331 if( +w�l_�ru� +-> +msg +. +�yl�d�n + > 0){ + +332 +w�l_�ru� +-> +msg +. +�yl�d + = + `mosqu�to__m�loc +(w�l_�ru�->msg. +�yl�d�n +); + +333 if(! +w�l_�ru� +-> +msg +. +�yl�d +){ + +334 +rc + = +MOSQ_ERR_NOMEM +; + +335 +�r�_��nup +; + +338 +rc + = + `�ck�__�ad_by�s +(& +cڋxt +-> +�_�ck� +, +w�l_�ru� +-> +msg +. +�yl�d +, w�l_�ru�->msg. +�yl�d�n +); + +339 if( +rc +� +�r�_��nup +; + +342 +w�l_�ru� +-> +msg +. +qos + = +w�l_qos +; + +343 +w�l_�ru� +-> +msg +. +��� + = +w�l_��� +; + +345 * +w�l + = +w�l_�ru� +; + +346 +MOSQ_ERR_SUCCESS +; + +348 +�r�_��nup +: + +349 if( +w�l_�ru� +){ + +350 + `mosqu�to__� +( +w�l_�ru� +-> +msg +. +t�ic +); + +351 + `mosqu�to__� +( +w�l_�ru� +-> +msg +. +�yl�d +); + +352 + `mosqu�to_�ݔty_�_�l +(& +w�l_�ru� +-> +�ݔt�s +); + +353 + `mosqu�to__� +( +w�l_�ru� +); + +355 +rc +; + +356 + } +} + +360 + $h�d�__c��� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +362 +��oc�_�me +[7]; + +363 +u�t8_t + +��oc�_v�si� +; + +364 +u�t8_t + +c���_�ags +; + +365 * +���_id + = +NULL +; + +366 +mosqu�to_mes�ge_�l + * +w�l_�ru� + = +NULL +; + +367 +u�t8_t + +w�l +, +w�l_��� +, +w�l_qos +, +��n_��t +; + +368 +u�t8_t + +u��ame_�ag +, +�ssw�d_�ag +; + +369 * +u��ame + = +NULL +, * +�ssw�d + = NULL; + +370 +rc +; + +371 +�� +; + +372 +u�t16_t + +��16 +; + +373 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +374 * +auth_d�a + = +NULL +; + +375 +u�t16_t + +auth_d�a_�n + = 0; + +376 * +auth_d�a_out + = +NULL +; + +377 +u�t16_t + +auth_d�a_out_�n + = 0; + +378 #ifde� +WITH_TLS + + +379 +i +; + +380 +X509 + * +���_�� + = +NULL +; + +381 +X509_NAME + * +�me +; + +382 +X509_NAME_ENTRY + * +�me_��y +; + +383 +ASN1_STRING + * +�me_a�1 + = +NULL +; + +386 + `G_CONNECTION_COUNT_INC +(); + +388 if(! +cڋxt +-> +li��� +){ + +389 +MOSQ_ERR_INVAL +; + +393 if( +cڋxt +-> +��e + !� +mosq_cs_�w +){ + +394 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "Bad cl�� %��nd�g muɝ� CONNECT mes�ges.", +cڋxt +-> +id +); + +395 +rc + = +MOSQ_ERR_PROTOCOL +; + +396 +h�d�_c���_�r� +; + +402 if( + `�ck�__�ad_u�t16 +(& +cڋxt +-> +�_�ck� +, & +��16 +)){ + +403 +rc + = 1; + +404 +h�d�_c���_�r� +; + +406 +�� + = +��16 +; + +407 if( +�� + != 4 && slen != 6 ){ + +408 +rc + = +MOSQ_ERR_PROTOCOL +; + +409 +h�d�_c���_�r� +; + +411 if( + `�ck�__�ad_by�s +(& +cڋxt +-> +�_�ck� +, +��oc�_�me +, +�� +)){ + +412 +rc + = +MOSQ_ERR_PROTOCOL +; + +413 +h�d�_c���_�r� +; + +415 +��oc�_�me +[ +�� +] = '\0'; + +417 if( + `�ck�__�ad_by� +(& +cڋxt +-> +�_�ck� +, & +��oc�_v�si� +)){ + +418 +rc + = 1; + +419 +h�d�_c���_�r� +; + +421 if(! + `�rcmp +( +��oc�_�me +, +PROTOCOL_NAME_v31 +)){ + +422 if(( +��oc�_v�si� +&0x7F�!� +PROTOCOL_VERSION_v31 +){ + +423 if( +db +-> +c�fig +-> +c���i�_mes�ges + =� +�ue +){ + +424 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "Invalid�rotocol version %d in CONNECT from %s.", + +425 +��oc�_v�si� +, +cڋxt +-> +add�ss +); + +427 + `�nd__c��ck +( +db +, +cڋxt +, 0, +CONNACK_REFUSED_PROTOCOL_VERSION +, +NULL +); + +428 +rc + = +MOSQ_ERR_PROTOCOL +; + +429 +h�d�_c���_�r� +; + +431 +cڋxt +-> +��oc� + = +mosq_p_mq�31 +; + +432 if(( +��oc�_v�si� +&0x80) == 0x80){ + +433 +cڋxt +-> +is_bridge + = +�ue +; + +435 }if(! + `�rcmp +( +��oc�_�me +, +PROTOCOL_NAME +)){ + +436 if(( +��oc�_v�si� +&0x7F�=� +PROTOCOL_VERSION_v311 +){ + +437 +cڋxt +-> +��oc� + = +mosq_p_mq�311 +; + +439 if(( +��oc�_v�si� +&0x80) == 0x80){ + +440 +cڋxt +-> +is_bridge + = +�ue +; + +442 }if(( +��oc�_v�si� +&0x7F�=� +PROTOCOL_VERSION_v5 +){ + +443 +cڋxt +-> +��oc� + = +mosq_p_mq�5 +; + +445 if( +db +-> +c�fig +-> +c���i�_mes�ges + =� +�ue +){ + +446 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "Invalid�rotocol version %d in CONNECT from %s.", + +447 +��oc�_v�si� +, +cڋxt +-> +add�ss +); + +449 + `�nd__c��ck +( +db +, +cڋxt +, 0, +CONNACK_REFUSED_PROTOCOL_VERSION +, +NULL +); + +450 +rc + = +MOSQ_ERR_PROTOCOL +; + +451 +h�d�_c���_�r� +; + +453 if(( +cڋxt +-> +�_�ck� +. +comm�d +&0x0F) != 0x00){ + +455 +rc + = +MOSQ_ERR_PROTOCOL +; + +456 +h�d�_c���_�r� +; + +459 if( +db +-> +c�fig +-> +c���i�_mes�ges + =� +�ue +){ + +460 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "Invalid�rotocol \"%s\" in CONNECT from %s.", + +461 +��oc�_�me +, +cڋxt +-> +add�ss +); + +463 +rc + = +MOSQ_ERR_PROTOCOL +; + +464 +h�d�_c���_�r� +; + +467 if( + `�ck�__�ad_by� +(& +cڋxt +-> +�_�ck� +, & +c���_�ags +)){ + +468 +rc + = 1; + +469 +h�d�_c���_�r� +; + +471 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�311 + || cڋxt->��oc� =� +mosq_p_mq�5 +){ + +472 if(( +c���_�ags + & 0x01) != 0x00){ + +473 +rc + = +MOSQ_ERR_PROTOCOL +; + +474 +h�d�_c���_�r� +; + +478 +��n_��t + = ( +c���_�ags + & 0x02) >> 1; + +480 if( +��n_��t + =� +�l� + && +��oc�_v�si� + !� +PROTOCOL_VERSION_v5 +){ + +482 +cڋxt +-> +�ssi�_exp�y_��rv� + = +UINT32_MAX +; + +484 +cڋxt +-> +�ssi�_exp�y_��rv� + = 0; + +486 +w�l + = +c���_�ags + & 0x04; + +487 +w�l_qos + = ( +c���_�ags + & 0x18) >> 3; + +488 if( +w�l_qos + == 3){ + +489 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "Invalid Will QoS in CONNECT from %s.", + +490 +cڋxt +-> +add�ss +); + +491 +rc + = +MOSQ_ERR_PROTOCOL +; + +492 +h�d�_c���_�r� +; + +494 +w�l_��� + = (( +c���_�ags + & 0x20) == 0x20); + +495 +�ssw�d_�ag + = +c���_�ags + & 0x40; + +496 +u��ame_�ag + = +c���_�ags + & 0x80; + +498 if( +w�l + && +w�l_��� + && +db +-> +c�fig +-> +���_ava�ab� + =� +�l� +){ + +499 if( +��oc�_v�si� + =� +mosq_p_mq�5 +){ + +500 + `�nd__c��ck +( +db +, +cڋxt +, 0, +MQTT_RC_RETAIN_NOT_SUPPORTED +, +NULL +); + +502 +rc + = 1; + +503 +h�d�_c���_�r� +; + +506 if( + `�ck�__�ad_u�t16 +(& +cڋxt +-> +�_�ck� +, &(cڋxt-> +k��live +))){ + +507 +rc + = 1; + +508 +h�d�_c���_�r� +; + +511 if( +��oc�_v�si� + =� +PROTOCOL_VERSION_v5 +){ + +512 +rc + = + `�ݔty__�ad_�l +( +CMD_CONNECT +, & +cڋxt +-> +�_�ck� +, & +�ݔt�s +); + +513 if( +rc +� +h�d�_c���_�r� +; + +515 + `�ݔty__�o�ss_c��� +( +cڋxt +, & +�ݔt�s +); + +517 if( + `mosqu�to_�ݔty_�ad_�r�g +( +�ݔt�s +, +MQTT_PROP_AUTHENTICATION_METHOD +, & +cڋxt +-> +auth_m�hod +, +�l� +)){ + +518 + `mosqu�to_�ݔty_�ad_b��y +( +�ݔt�s +, +MQTT_PROP_AUTHENTICATION_DATA +, & +auth_d�a +, & +auth_d�a_�n +, +�l� +); + +521 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +523 if( + `�ck�__�ad_�r�g +(& +cڋxt +-> +�_�ck� +, & +���_id +, & +�� +)){ + +524 +rc + = 1; + +525 +h�d�_c���_�r� +; + +528 if( +�� + == 0){ + +529 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�31 +){ + +530 + `�nd__c��ck +( +db +, +cڋxt +, 0, +CONNACK_REFUSED_IDENTIFIER_REJECTED +, +NULL +); + +531 +rc + = +MOSQ_ERR_PROTOCOL +; + +532 +h�d�_c���_�r� +; + +534 + `mosqu�to__� +( +���_id +); + +535 +���_id + = +NULL +; + +537 +bo� + +�low_z�o_�ngth_���id +; + +538 if( +db +-> +c�fig +-> +�r_li���_���gs +){ + +539 +�low_z�o_�ngth_���id + = +cڋxt +-> +li��� +-> +�cur�y_�ti�s +.allow_zero_length_clientid; + +541 +�low_z�o_�ngth_���id + = +db +-> +c�fig +-> +�cur�y_�ti�s +.allow_zero_length_clientid; + +543 if(( +cڋxt +-> +��oc� + =� +mosq_p_mq�311 + && +��n_��t + =�0�|| +�low_z�o_�ngth_���id + =� +�l� +){ + +544 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�311 +){ + +545 + `�nd__c��ck +( +db +, +cڋxt +, 0, +CONNACK_REFUSED_IDENTIFIER_REJECTED +, +NULL +); + +547 + `�nd__c��ck +( +db +, +cڋxt +, 0, +MQTT_RC_UNSPECIFIED +, +NULL +); + +549 +rc + = +MOSQ_ERR_PROTOCOL +; + +550 +h�d�_c���_�r� +; + +552 if( +db +-> +c�fig +-> +�r_li���_���gs +){ + +553 +���_id + = + `���_id_g� +(& +�� +, +cڋxt +-> +li��� +-> +�cur�y_�ti�s +. +auto_id_�efix +, cڋxt->li���->�cur�y_�ti�s. +auto_id_�efix_�n +); + +555 +���_id + = + `���_id_g� +(& +�� +, +db +-> +c�fig +-> +�cur�y_�ti�s +. +auto_id_�efix +, db->c�fig->�cur�y_�ti�s. +auto_id_�efix_�n +); + +557 if(! +���_id +){ + +558 +rc + = +MOSQ_ERR_NOMEM +; + +559 +h�d�_c���_�r� +; + +561 +cڋxt +-> +assig�d_id + = +�ue +; + +567 if( +db +-> +c�fig +-> +���id_�efixes +){ + +568 if( + `��cmp +( +db +-> +c�fig +-> +���id_�efixes +, +���_id +, + `��� +(db->config->clientid_prefixes))){ + +569 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +570 + `�nd__c��ck +( +db +, +cڋxt +, 0, +MQTT_RC_NOT_AUTHORIZED +, +NULL +); + +572 + `�nd__c��ck +( +db +, +cڋxt +, 0, +CONNACK_REFUSED_NOT_AUTHORIZED +, +NULL +); + +574 +rc + = 1; + +575 +h�d�_c���_�r� +; + +579 if( +w�l +){ + +580 +rc + = + `w�l__�ad +( +cڋxt +, & +w�l_�ru� +, +w�l_qos +, +w�l_��� +); + +581 if( +rc +� +h�d�_c���_�r� +; + +583 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�311 + || cڋxt->��oc� =� +mosq_p_mq�5 +){ + +584 if( +w�l_qos + !�0 || +w�l_��� + != 0){ + +585 +rc + = +MOSQ_ERR_PROTOCOL +; + +586 +h�d�_c���_�r� +; + +591 if( +u��ame_�ag +){ + +592 +rc + = + `�ck�__�ad_�r�g +(& +cڋxt +-> +�_�ck� +, & +u��ame +, & +�� +); + +593 if( +rc + =� +MOSQ_ERR_NOMEM +){ + +594 +rc + = +MOSQ_ERR_NOMEM +; + +595 +h�d�_c���_�r� +; + +596 }if( +rc + !� +MOSQ_ERR_SUCCESS +){ + +597 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�31 +){ + +599 +u��ame_�ag + = 0; + +601 +rc + = +MOSQ_ERR_PROTOCOL +; + +602 +h�d�_c���_�r� +; + +606 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�311 + || cڋxt->��oc� =� +mosq_p_mq�31 +){ + +607 if( +�ssw�d_�ag +){ + +609 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Pr�ocރ�� from %s:�assw�d w�hou�u��ame, clos�g c���i�.", +���_id +); + +610 +rc + = +MOSQ_ERR_PROTOCOL +; + +611 +h�d�_c���_�r� +; + +615 if( +�ssw�d_�ag +){ + +616 +rc + = + `�ck�__�ad_b��y +(& +cڋxt +-> +�_�ck� +, ( +u�t8_t + **)& +�ssw�d +, & +�� +); + +617 if( +rc + =� +MOSQ_ERR_NOMEM +){ + +618 +rc + = +MOSQ_ERR_NOMEM +; + +619 +h�d�_c���_�r� +; + +620 }if( +rc + =� +MOSQ_ERR_PROTOCOL +){ + +621 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�31 +){ + +624 +rc + = +MOSQ_ERR_PROTOCOL +; + +625 +h�d�_c���_�r� +; + +630 if( +cڋxt +-> +�_�ck� +. +pos + !�cڋxt->�_�ck�. +�ma��g_�ngth +){ + +632 +rc + = +MOSQ_ERR_PROTOCOL +; + +633 +h�d�_c���_�r� +; + +636 #ifde� +WITH_TLS + + +637 if( +cڋxt +-> +li��� +-> +s�_�x + && (cڋxt->li���-> +u�_id�t�y_as_u��ame + || cڋxt->li���-> +u�_subje�_as_u��ame +)){ + +639 + `mosqu�to__� +( +u��ame +); + +640 +u��ame + = +NULL +; + +641 + `mosqu�to__� +( +�ssw�d +); + +642 +�ssw�d + = +NULL +; + +644 if(! +cڋxt +-> +s� +){ + +645 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +646 + `�nd__c��ck +( +db +, +cڋxt +, 0, +MQTT_RC_BAD_USERNAME_OR_PASSWORD +, +NULL +); + +648 + `�nd__c��ck +( +db +, +cڋxt +, 0, +CONNACK_REFUSED_BAD_USERNAME_PASSWORD +, +NULL +); + +650 +rc + = 1; + +651 +h�d�_c���_�r� +; + +653 #ifde� +FINAL_WITH_TLS_PSK + + +654 if( +cڋxt +-> +li��� +-> +psk_h�t +){ + +656 if(! +cڋxt +-> +u��ame +){ + +657 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +658 + `�nd__c��ck +( +db +, +cڋxt +, 0, +MQTT_RC_BAD_USERNAME_OR_PASSWORD +, +NULL +); + +660 + `�nd__c��ck +( +db +, +cڋxt +, 0, +CONNACK_REFUSED_BAD_USERNAME_PASSWORD +, +NULL +); + +662 +rc + = 1; + +663 +h�d�_c���_�r� +; + +667 +���_�� + = + `SSL_g�_��_��ifi�� +( +cڋxt +-> +s� +); + +668 if(! +���_�� +){ + +669 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +670 + `�nd__c��ck +( +db +, +cڋxt +, 0, +MQTT_RC_BAD_USERNAME_OR_PASSWORD +, +NULL +); + +672 + `�nd__c��ck +( +db +, +cڋxt +, 0, +CONNACK_REFUSED_BAD_USERNAME_PASSWORD +, +NULL +); + +674 +rc + = 1; + +675 +h�d�_c���_�r� +; + +677 +�me + = + `X509_g�_subje�_�me +( +���_�� +); + +678 if(! +�me +){ + +679 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +680 + `�nd__c��ck +( +db +, +cڋxt +, 0, +MQTT_RC_BAD_USERNAME_OR_PASSWORD +, +NULL +); + +682 + `�nd__c��ck +( +db +, +cڋxt +, 0, +CONNACK_REFUSED_BAD_USERNAME_PASSWORD +, +NULL +); + +684 +rc + = 1; + +685 +h�d�_c���_�r� +; + +687 i�( +cڋxt +-> +li��� +-> +u�_id�t�y_as_u��ame +) { + +688 +i + = + `X509_NAME_g�_�dex_by_NID +( +�me +, +NID_comm�Name +, -1); + +689 if( +i + == -1){ + +690 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +691 + `�nd__c��ck +( +db +, +cڋxt +, 0, +MQTT_RC_BAD_USERNAME_OR_PASSWORD +, +NULL +); + +693 + `�nd__c��ck +( +db +, +cڋxt +, 0, +CONNACK_REFUSED_BAD_USERNAME_PASSWORD +, +NULL +); + +695 +rc + = 1; + +696 +h�d�_c���_�r� +; + +698 +�me_��y + = + `X509_NAME_g�_��y +( +�me +, +i +); + +699 if( +�me_��y +){ + +700 +�me_a�1 + = + `X509_NAME_ENTRY_g�_d�a +( +�me_��y +); + +701 i�( +�me_a�1 + =� +NULL +) { + +702 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +703 + `�nd__c��ck +( +db +, +cڋxt +, 0, +MQTT_RC_BAD_USERNAME_OR_PASSWORD +, +NULL +); + +705 + `�nd__c��ck +( +db +, +cڋxt +, 0, +CONNACK_REFUSED_BAD_USERNAME_PASSWORD +, +NULL +); + +707 +rc + = 1; + +708 +h�d�_c���_�r� +; + +710 #i� +OPENSSL_VERSION_NUMBER + < 0x10100000L + +711 +cڋxt +-> +u��ame + = + `mosqu�to__�rdup +((*� + `ASN1_STRING_d�a +( +�me_a�1 +)); + +713 +cڋxt +-> +u��ame + = + `mosqu�to__�rdup +((*� + `ASN1_STRING_g�0_d�a +( +�me_a�1 +)); + +715 if(! +cڋxt +-> +u��ame +){ + +716 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +717 + `�nd__c��ck +( +db +, +cڋxt +, 0, +MQTT_RC_SERVER_UNAVAILABLE +, +NULL +); + +719 + `�nd__c��ck +( +db +, +cڋxt +, 0, +CONNACK_REFUSED_SERVER_UNAVAILABLE +, +NULL +); + +721 +rc + = +MOSQ_ERR_NOMEM +; + +722 +h�d�_c���_�r� +; + +725 i�(( +size_t +) + `ASN1_STRING_�ngth +( +�me_a�1 +�!� + `��� +( +cڋxt +-> +u��ame +)) { + +726 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +727 + `�nd__c��ck +( +db +, +cڋxt +, 0, +MQTT_RC_BAD_USERNAME_OR_PASSWORD +, +NULL +); + +729 + `�nd__c��ck +( +db +, +cڋxt +, 0, +CONNACK_REFUSED_BAD_USERNAME_PASSWORD +, +NULL +); + +731 +rc + = 1; + +732 +h�d�_c���_�r� +; + +736 +BIO + * +subje�_bio + = + `BIO_�w +( + `BIO_s_mem +()); + +737 + `X509_NAME_��t_ex +( +subje�_bio +, + `X509_g�_subje�_�me +( +���_�� +), 0, +XN_FLAG_RFC2253 +); + +738 * +d�a_��t + = +NULL +; + +739 +�me_�ngth + = + `BIO_g�_mem_d�a +( +subje�_bio +, & +d�a_��t +); + +740 * +subje� + = + `mosqu�to__m�loc +(()* +�me_�ngth ++1); + +741 if(! +subje� +){ + +742 + `BIO_� +( +subje�_bio +); + +743 +rc + = +MOSQ_ERR_NOMEM +; + +744 +h�d�_c���_�r� +; + +746 + `mem�y +( +subje� +, +d�a_��t +, +�me_�ngth +); + +747 +subje� +[ +�me_�ngth +] = '\0'; + +748 + `BIO_� +( +subje�_bio +); + +749 +cڋxt +-> +u��ame + = +subje� +; + +751 if(! +cڋxt +-> +u��ame +){ + +752 +rc + = 1; + +753 +h�d�_c���_�r� +; + +755 + `X509_� +( +���_�� +); + +756 +���_�� + = +NULL +; + +757 #ifde� +FINAL_WITH_TLS_PSK + + +762 if( +u��ame_�ag + || +�ssw�d_�ag +){ + +765 +cڋxt +-> +id + = +���_id +; + +766 +cڋxt +-> +u��ame + = username; + +767 +rc + = + `mosqu�to_u�wd_check +( +db +, +cڋxt +, +u��ame +, +�ssw�d +); + +768 +cڋxt +-> +u��ame + = +NULL +; + +769 +cڋxt +-> +id + = +NULL +; + +770 +rc +){ + +771 +MOSQ_ERR_SUCCESS +: + +773 +MOSQ_ERR_AUTH +: + +774 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +775 + `�nd__c��ck +( +db +, +cڋxt +, 0, +MQTT_RC_NOT_AUTHORIZED +, +NULL +); + +777 + `�nd__c��ck +( +db +, +cڋxt +, 0, +CONNACK_REFUSED_NOT_AUTHORIZED +, +NULL +); + +779 + `cڋxt__disc��� +( +db +, +cڋxt +); + +780 +rc + = 1; + +781 +h�d�_c���_�r� +; + +784 + `cڋxt__disc��� +( +db +, +cڋxt +); + +785 +rc + = 1; + +786 +h�d�_c���_�r� +; + +789 +cڋxt +-> +u��ame + = username; + +790 +cڋxt +-> +�ssw�d + =�assword; + +791 +u��ame + = +NULL +; + +792 +�ssw�d + = +NULL +; + +794 if(( +db +-> +c�fig +-> +�r_li���_���gs + && +cڋxt +-> +li��� +-> +�cur�y_�ti�s +. +�low_��ymous + =� +�l� +) + +795 || (! +db +-> +c�fig +-> +�r_li���_���gs + && db->c�fig-> +�cur�y_�ti�s +. +�low_��ymous + =� +�l� +)){ + +797 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +798 + `�nd__c��ck +( +db +, +cڋxt +, 0, +MQTT_RC_NOT_AUTHORIZED +, +NULL +); + +800 + `�nd__c��ck +( +db +, +cڋxt +, 0, +CONNACK_REFUSED_NOT_AUTHORIZED +, +NULL +); + +802 +rc + = 1; + +803 +h�d�_c���_�r� +; + +806 #ifde� +WITH_TLS + + +810 if( +cڋxt +-> +li��� +-> +u�_u��ame_as_���id +){ + +811 if( +cڋxt +-> +u��ame +){ + +812 + `mosqu�to__� +( +���_id +); + +813 +���_id + = + `mosqu�to__�rdup +( +cڋxt +-> +u��ame +); + +814 if(! +���_id +){ + +815 +rc + = +MOSQ_ERR_NOMEM +; + +816 +h�d�_c���_�r� +; + +819 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +820 + `�nd__c��ck +( +db +, +cڋxt +, 0, +MQTT_RC_NOT_AUTHORIZED +, +NULL +); + +822 + `�nd__c��ck +( +db +, +cڋxt +, 0, +CONNACK_REFUSED_NOT_AUTHORIZED +, +NULL +); + +824 +rc + = 1; + +825 +h�d�_c���_�r� +; + +828 +cڋxt +-> +��n_��t + = clean_start; + +829 +cڋxt +-> +id + = +���_id +; + +830 +cڋxt +-> +w�l + = +w�l_�ru� +; + +832 if( +cڋxt +-> +auth_m�hod +){ + +833 +rc + = + `mosqu�to_�cur�y_auth_��t +( +db +, +cڋxt +, +�l� +, +auth_d�a +, +auth_d�a_�n +, & +auth_d�a_out +, & +auth_d�a_out_�n +); + +834 + `mosqu�to__� +( +auth_d�a +); + +835 if( +rc + =� +MOSQ_ERR_SUCCESS +){ + +836 + `c���__�_auth�i�d +( +db +, +cڋxt +, +auth_d�a_out +, +auth_d�a_out_�n +); + +837 }if( +rc + =� +MOSQ_ERR_AUTH_CONTINUE +){ + +838 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_auth�ti�t�g +); + +839 +rc + = + `�nd__auth +( +db +, +cڋxt +, +MQTT_RC_CONTINUE_AUTHENTICATION +, +auth_d�a_out +, +auth_d�a_out_�n +); + +840 + `� +( +auth_d�a_out +); + +841 +rc +; + +843 + `� +( +auth_d�a_out +); + +844 + `w�l__��r +( +cڋxt +); + +845 if( +rc + =� +MOSQ_ERR_AUTH +){ + +846 + `�nd__c��ck +( +db +, +cڋxt +, 0, +MQTT_RC_NOT_AUTHORIZED +, +NULL +); + +847 + `mosqu�to__� +( +cڋxt +-> +id +); + +848 +cڋxt +-> +id + = +NULL +; + +849 +MOSQ_ERR_PROTOCOL +; + +850 }if( +rc + =� +MOSQ_ERR_NOT_SUPPORTED +){ + +852 + `�nd__c��ck +( +db +, +cڋxt +, 0, +MQTT_RC_BAD_AUTHENTICATION_METHOD +, +NULL +); + +853 + `mosqu�to__� +( +cڋxt +-> +id +); + +854 +cڋxt +-> +id + = +NULL +; + +855 +MOSQ_ERR_PROTOCOL +; + +857 + `mosqu�to__� +( +cڋxt +-> +id +); + +858 +cڋxt +-> +id + = +NULL +; + +859 +rc +; + +863 + `c���__�_auth�i�d +( +db +, +cڋxt +, +NULL +, 0); + +867 +h�d�_c���_�r� +: + +868 + `mosqu�to__� +( +auth_d�a +); + +869 + `mosqu�to__� +( +���_id +); + +870 + `mosqu�to__� +( +u��ame +); + +871 + `mosqu�to__� +( +�ssw�d +); + +872 if( +w�l_�ru� +){ + +873 + `mosqu�to_�ݔty_�_�l +(& +w�l_�ru� +-> +�ݔt�s +); + +874 + `mosqu�to__� +( +w�l_�ru� +-> +msg +. +�yl�d +); + +875 + `mosqu�to__� +( +w�l_�ru� +-> +msg +. +t�ic +); + +876 + `mosqu�to__� +( +w�l_�ru� +); + +878 #ifde� +WITH_TLS + + +879 if( +���_�� +� + `X509_� +(client_cert); + +882 +rc +; + +883 + } +} + + @src/handle_disconnect.c + +17 + ~"c�fig.h +" + +19 + ~"mosqu�to_brok�_����.h +" + +20 + ~"mq�_��oc�.h +" + +21 + ~"�ck�_mosq.h +" + +22 + ~"�ݔty_mosq.h +" + +23 + ~"�nd_mosq.h +" + +24 + ~"w�l_mosq.h +" + +27 + $h�d�__disc��� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +29 +rc +; + +30 +u�t8_t + +�as�_code + = 0; + +31 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +33 if(! +cڋxt +){ + +34 +MOSQ_ERR_INVAL +; + +37 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 + && cڋxt-> +�_�ck� +. +�ma��g_�ngth + > 1){ + +39 +rc + = + `�ck�__�ad_by� +(& +cڋxt +-> +�_�ck� +, & +�as�_code +); + +40 if( +rc +) �c; + +42 if( +cڋxt +-> +�_�ck� +. +�ma��g_�ngth + > 2){ + +43 +rc + = + `�ݔty__�ad_�l +( +CMD_DISCONNECT +, & +cڋxt +-> +�_�ck� +, & +�ݔt�s +); + +44 if( +rc +) �c; + +47 +rc + = + `�ݔty__�o�ss_disc��� +( +cڋxt +, & +�ݔt�s +); + +48 if( +rc +){ + +49 if( +rc + =� +MOSQ_ERR_PROTOCOL +){ + +50 + `�nd__disc��� +( +cڋxt +, +MQTT_RC_PROTOCOL_ERROR +, +NULL +); + +52 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +53 +rc +; + +55 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +57 if( +cڋxt +-> +�_�ck� +. +�ma��g_�ngth + != 0){ + +58 +MOSQ_ERR_PROTOCOL +; + +60 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "Re�ived DISCONNECT from %s", +cڋxt +-> +id +); + +61 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�311 + || cڋxt->��oc� =� +mosq_p_mq�5 +){ + +62 if(( +cڋxt +-> +�_�ck� +. +comm�d +&0x0F) != 0x00){ + +63 + `do_disc��� +( +db +, +cڋxt +, +MOSQ_ERR_PROTOCOL +); + +64 +MOSQ_ERR_PROTOCOL +; + +67 if( +�as�_code + =� +MQTT_RC_DISCONNECT_WITH_WILL_MSG +){ + +68 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_disc���_w�h_w�l +); + +70 + `w�l__��r +( +cڋxt +); + +71 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_disc����g +); + +73 + `do_disc��� +( +db +, +cڋxt +, +MOSQ_ERR_SUCCESS +); + +74 +MOSQ_ERR_SUCCESS +; + +75 + } +} + + @src/handle_publish.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<�dio.h +> + +21 + ~<�r�g.h +> + +23 + ~"mosqu�to_brok�_����.h +" + +24 + ~"��s_mosq.h +" + +25 + ~"mq�_��oc�.h +" + +26 + ~"mem�y_mosq.h +" + +27 + ~"�ck�_mosq.h +" + +28 + ~"�ݔty_mosq.h +" + +29 + ~"�ad_h�d�.h +" + +30 + ~"�nd_mosq.h +" + +31 + ~"sys_��.h +" + +32 + ~"ut�_mosq.h +" + +35 + $h�d�__publish +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +37 * +t�ic +; + +38 +mosqu�to__�yl�d_uh� + +�yl�d +; + +39 +u�t32_t + +�yl�d�n +; + +40 +u�t8_t + +dup +, +qos +, +��� +; + +41 +u�t16_t + +mid + = 0; + +42 +rc + = 0; + +43 +rc2 +; + +44 +u�t8_t + +h�d� + = +cڋxt +-> +�_�ck� +. +comm�d +; + +45 +�s + = 0; + +46 +mosqu�to_msg_��e + * +��ed + = +NULL +; + +47 +�n +; + +48 +�� +; + +49 * +t�ic_mou� +; + +50 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +51 +mosqu�to_�ݔty + * +p +, * +p_�ev +; + +52 +mosqu�to_�ݔty + * +msg_�ݔt�s + = +NULL +, * +msg_�ݔt�s_ϡ +; + +53 +u�t32_t + +mes�ge_exp�y_��rv� + = 0; + +54 +t�ic_��s + = -1; + +55 +u�t8_t + +�as�_code + = 0; + +57 #ifde� +WITH_BRIDGE + + +58 * +t�ic_�mp +; + +59 +i +; + +60 +mosqu�to__bridge_t�ic + * +cur_t�ic +; + +61 +bo� + +m�ch +; + +64 if( +cڋxt +-> +��e + !� +mosq_cs_c���ed +){ + +65 +MOSQ_ERR_PROTOCOL +; + +68 +�yl�d +. +�r + = +NULL +; + +70 +dup + = ( +h�d� + & 0x08)>>3; + +71 +qos + = ( +h�d� + & 0x06)>>1; + +72 if( +qos + == 3){ + +73 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, + +74 "Inv�id QoS i�PUBLISH from %s, disc����g.", +cڋxt +-> +id +); + +77 if( +qos + > +cڋxt +-> +maximum_qos +){ + +78 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, + +79 "To�high QoS i�PUBLISH from %s, disc����g.", +cڋxt +-> +id +); + +82 +��� + = ( +h�d� + & 0x01); + +84 if( +��� + && +db +-> +c�fig +-> +���_ava�ab� + =� +�l� +){ + +85 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +86 + `�nd__disc��� +( +cڋxt +, +MQTT_RC_RETAIN_NOT_SUPPORTED +, +NULL +); + +91 if( + `�ck�__�ad_�r�g +(& +cڋxt +-> +�_�ck� +, & +t�ic +, & +�� +)) 1; + +92 if(! +�� + && +cڋxt +-> +��oc� + !� +mosq_p_mq�5 +){ + +94 + `mosqu�to__� +( +t�ic +); + +98 if( +qos + > 0){ + +99 if( + `�ck�__�ad_u�t16 +(& +cڋxt +-> +�_�ck� +, & +mid +)){ + +100 + `mosqu�to__� +( +t�ic +); + +103 if( +mid + == 0){ + +104 + `mosqu�to__� +( +t�ic +); + +105 +MOSQ_ERR_PROTOCOL +; + +110 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +111 +rc + = + `�ݔty__�ad_�l +( +CMD_PUBLISH +, & +cڋxt +-> +�_�ck� +, & +�ݔt�s +); + +112 if( +rc +) �c; + +114 +p + = +�ݔt�s +; + +115 +p_�ev + = +NULL +; + +116 +msg_�ݔt�s + = +NULL +; + +117 +msg_�ݔt�s_ϡ + = +NULL +; + +118 +p +){ + +119 +p +-> +id�tif�r +){ + +120 +MQTT_PROP_CONTENT_TYPE +: + +121 +MQTT_PROP_CORRELATION_DATA +: + +122 +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +: + +123 +MQTT_PROP_RESPONSE_TOPIC +: + +124 +MQTT_PROP_USER_PROPERTY +: + +125 if( +msg_�ݔt�s +){ + +126 +msg_�ݔt�s_ϡ +-> +�xt + = +p +; + +127 +msg_�ݔt�s_ϡ + = +p +; + +129 +msg_�ݔt�s + = +p +; + +130 +msg_�ݔt�s_ϡ + = +p +; + +132 if( +p_�ev +){ + +133 +p_�ev +-> +�xt + = +p +->next; + +134 +p + = +p_�ev +-> +�xt +; + +136 +�ݔt�s + = +p +-> +�xt +; + +137 +p + = +�ݔt�s +; + +139 +msg_�ݔt�s_ϡ +-> +�xt + = +NULL +; + +142 +MQTT_PROP_TOPIC_ALIAS +: + +143 +t�ic_��s + = +p +-> +v�ue +. +i16 +; + +144 +p_�ev + = +p +; + +145 +p + =�-> +�xt +; + +148 +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +: + +149 +mes�ge_exp�y_��rv� + = +p +-> +v�ue +. +i32 +; + +150 +p_�ev + = +p +; + +151 +p + =�-> +�xt +; + +154 +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +: + +155 +p_�ev + = +p +; + +156 +p + =�-> +�xt +; + +160 +p + =�-> +�xt +; + +165 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +167 if( +t�ic_��s + =�0 || ( +cڋxt +-> +li��� + &&��ic_���> cڋxt->li���-> +max_t�ic_��s +)){ + +168 + `mosqu�to__� +( +t�ic +); + +169 + `�nd__disc��� +( +cڋxt +, +MQTT_RC_TOPIC_ALIAS_INVALID +, +NULL +); + +170 +MOSQ_ERR_PROTOCOL +; + +171 }if( +t�ic_��s + > 0){ + +172 if( +t�ic +){ + +173 +rc + = + `��s__add +( +cڋxt +, +t�ic +, +t�ic_��s +); + +174 if( +rc +){ + +175 + `mosqu�to__� +( +t�ic +); + +176 +rc +; + +179 +rc + = + `��s__f�d +( +cڋxt +, & +t�ic +, +t�ic_��s +); + +180 if( +rc +){ + +181 + `�nd__disc��� +( +cڋxt +, +MQTT_RC_TOPIC_ALIAS_INVALID +, +NULL +); + +182 + `mosqu�to__� +( +t�ic +); + +183 +rc +; + +187 if( + `mosqu�to_v�id�e_utf8 +( +t�ic +, +�� +�!� +MOSQ_ERR_SUCCESS +){ + +188 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "Cl�� %�����i�w�h inv�id UTF-8, disc����g.", +cڋxt +-> +id +); + +189 + `mosqu�to__� +( +t�ic +); + +193 #ifde� +WITH_BRIDGE + + +194 if( +cڋxt +-> +bridge + && cڋxt->bridge-> +t�ics + && cڋxt->bridge-> +t�ic_�m�p�g +){ + +195 +i +=0; i< +cڋxt +-> +bridge +-> +t�ic_cou� +; i++){ + +196 +cur_t�ic + = & +cڋxt +-> +bridge +-> +t�ics +[ +i +]; + +197 if(( +cur_t�ic +-> +d�e�i� + =� +bd_b�h + || cur_t�ic->d�e�i� =� +bd_� +) + +198 && ( +cur_t�ic +-> +�m�e_�efix + || cur_t�ic-> +lo�l_�efix +)){ + +202 +rc + = + `mosqu�to_t�ic_m�ches_sub +( +cur_t�ic +-> +�m�e_t�ic +, +t�ic +, & +m�ch +); + +203 if( +rc +){ + +204 + `mosqu�to__� +( +t�ic +); + +205 +rc +; + +207 if( +m�ch +){ + +208 if( +cur_t�ic +-> +�m�e_�efix +){ + +210 if(! + `��cmp +( +cur_t�ic +-> +�m�e_�efix +, +t�ic +, + `��� +(cur_topic->remote_prefix))){ + +211 +t�ic_�mp + = + `mosqu�to__�rdup +( +t�ic ++ + `��� +( +cur_t�ic +-> +�m�e_�efix +)); + +212 if(! +t�ic_�mp +){ + +213 + `mosqu�to__� +( +t�ic +); + +214 +MOSQ_ERR_NOMEM +; + +216 + `mosqu�to__� +( +t�ic +); + +217 +t�ic + = +t�ic_�mp +; + +221 if( +cur_t�ic +-> +lo�l_�efix +){ + +223 +�n + = + `��� +( +t�ic +�+ s��n( +cur_t�ic +-> +lo�l_�efix +)+1; + +224 +t�ic_�mp + = + `mosqu�to__m�loc +( +�n ++1); + +225 if(! +t�ic_�mp +){ + +226 + `mosqu�to__� +( +t�ic +); + +227 +MOSQ_ERR_NOMEM +; + +229 + `���tf +( +t�ic_�mp +, +�n +, "%s%s", +cur_t�ic +-> +lo�l_�efix +, +t�ic +); + +230 +t�ic_�mp +[ +�n +] = '\0'; + +232 + `mosqu�to__� +( +t�ic +); + +233 +t�ic + = +t�ic_�mp +; + +241 if( + `mosqu�to_pub_t�ic_check +( +t�ic +�!� +MOSQ_ERR_SUCCESS +){ + +243 + `mosqu�to__� +( +t�ic +); + +247 +�yl�d�n + = +cڋxt +-> +�_�ck� +. +�ma��g_�ngth + - cڋxt->�_�ck�. +pos +; + +248 + `G_PUB_BYTES_RECEIVED_INC +( +�yl�d�n +); + +249 if( +cڋxt +-> +li��� + && cڋxt->li���-> +mou�_po�t +){ + +250 +�n + = + `��� +( +cڋxt +-> +li��� +-> +mou�_po�t +�+ s��n( +t�ic +) + 1; + +251 +t�ic_mou� + = + `mosqu�to__m�loc +( +�n ++1); + +252 if(! +t�ic_mou� +){ + +253 + `mosqu�to__� +( +t�ic +); + +254 + `mosqu�to_�ݔty_�_�l +(& +msg_�ݔt�s +); + +255 +MOSQ_ERR_NOMEM +; + +257 + `���tf +( +t�ic_mou� +, +�n +, "%s%s", +cڋxt +-> +li��� +-> +mou�_po�t +, +t�ic +); + +258 +t�ic_mou� +[ +�n +] = '\0'; + +260 + `mosqu�to__� +( +t�ic +); + +261 +t�ic + = +t�ic_mou� +; + +264 if( +�yl�d�n +){ + +265 if( +db +-> +c�fig +-> +mes�ge_size_lim� + && +�yl�d�n + > db->config->message_size_limit){ + +266 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "Drݳd�o��rg�PUBLISH from %�(d%d, q%d,�%d, m%d, '%s', ... (%ld by�s))", +cڋxt +-> +id +, +dup +, +qos +, +��� +, +mid +, +t�ic +, () +�yl�d�n +); + +267 +�as�_code + = +MQTT_RC_IMPLEMENTATION_SPECIFIC +; + +268 +�o�ss_bad_mes�ge +; + +270 if( + `UHPA_ALLOC +( +�yl�d +, +�yl�d�n +) == 0){ + +271 + `mosqu�to__� +( +t�ic +); + +272 + `mosqu�to_�ݔty_�_�l +(& +msg_�ݔt�s +); + +273 +MOSQ_ERR_NOMEM +; + +276 if( + `�ck�__�ad_by�s +(& +cڋxt +-> +�_�ck� +, + `UHPA_ACCESS +( +�yl�d +, +�yl�d�n +),�ayloadlen)){ + +277 + `mosqu�to__� +( +t�ic +); + +278 + `UHPA_FREE +( +�yl�d +, +�yl�d�n +); + +279 + `mosqu�to_�ݔty_�_�l +(& +msg_�ݔt�s +); + +285 +rc + = + `mosqu�to_a�_check +( +db +, +cڋxt +, +t�ic +, +�yl�d�n +, + `UHPA_ACCESS +( +�yl�d +,�ayl�d�n), +qos +, +��� +, +MOSQ_ACL_WRITE +); + +286 if( +rc + =� +MOSQ_ERR_ACL_DENIED +){ + +287 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "D��d PUBLISH from %�(d%d, q%d,�%d, m%d, '%s', ... (%ld by�s))", +cڋxt +-> +id +, +dup +, +qos +, +��� +, +mid +, +t�ic +, () +�yl�d�n +); + +288 +�as�_code + = +MQTT_RC_NOT_AUTHORIZED +; + +289 +�o�ss_bad_mes�ge +; + +290 }if( +rc + !� +MOSQ_ERR_SUCCESS +){ + +291 + `mosqu�to__� +( +t�ic +); + +292 + `UHPA_FREE +( +�yl�d +, +�yl�d�n +); + +293 + `mosqu�to_�ݔty_�_�l +(& +msg_�ݔt�s +); + +294 +rc +; + +297 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "Re�ived PUBLISH from %�(d%d, q%d,�%d, m%d, '%s', ... (%ld by�s))", +cڋxt +-> +id +, +dup +, +qos +, +��� +, +mid +, +t�ic +, () +�yl�d�n +); + +298 if( +qos + > 0){ + +299 + `db__mes�ge_��e_f�d +( +cڋxt +, +mid +, & +��ed +); + +301 if(! +��ed +){ + +302 +dup + = 0; + +303 if( + `db__mes�ge_��e +( +db +, +cڋxt +, +mid +, +t�ic +, +qos +, +�yl�d�n +, & +�yl�d +, +��� +, & +��ed +, +mes�ge_exp�y_��rv� +, +msg_�ݔt�s +, 0, +mosq_mo_��� +)){ + +304 + `mosqu�to_�ݔty_�_�l +(& +msg_�ݔt�s +); + +307 +msg_�ݔt�s + = +NULL +; + +309 + `mosqu�to__� +( +t�ic +); + +310 +t�ic + = +��ed +->topic; + +311 +dup + = 1; + +312 + `mosqu�to_�ݔty_�_�l +(& +msg_�ݔt�s +); + +313 + `UHPA_FREE +( +�yl�d +, +�yl�d�n +); + +316 +qos +){ + +318 +rc2 + = + `sub__mes�ges_queue +( +db +, +cڋxt +-> +id +, +t�ic +, +qos +, +��� +, & +��ed +); + +319 if( +rc2 + > 0� +rc + = 1; + +322 + `ut�__de�em�t_��ive_qu�a +( +cڋxt +); + +323 +rc2 + = + `sub__mes�ges_queue +( +db +, +cڋxt +-> +id +, +t�ic +, +qos +, +��� +, & +��ed +); + +324 if( +rc2 + =� +MOSQ_ERR_SUCCESS + || +cڋxt +-> +��oc� + !� +mosq_p_mq�5 +){ + +325 if( + `�nd__puback +( +cڋxt +, +mid +, 0)� +rc + = 1; + +326 }if( +rc2 + =� +MOSQ_ERR_NO_SUBSCRIBERS +){ + +327 if( + `�nd__puback +( +cڋxt +, +mid +, +MQTT_RC_NO_MATCHING_SUBSCRIBERS +)� +rc + = 1; + +329 +rc + = +rc2 +; + +333 if( +dup + == 0){ + +334 + `ut�__de�em�t_��ive_qu�a +( +cڋxt +); + +335 +�s + = + `db__mes�ge_��� +( +db +, +cڋxt +, +mid +, +mosq_md_� +, +qos +, +��� +, +��ed +, +NULL +); + +337 +�s + = 0; + +341 if(! +�s +){ + +342 if( + `�nd__pub�c +( +cڋxt +, +mid +, 0)� +rc + = 1; + +343 }if( +�s + == 1){ + +344 +rc + = 1; + +349 +rc +; + +350 +�o�ss_bad_mes�ge +: + +351 + `mosqu�to__� +( +t�ic +); + +352 + `UHPA_FREE +( +�yl�d +, +�yl�d�n +); + +353 +qos +){ + +355 +MOSQ_ERR_SUCCESS +; + +357 + `�nd__puback +( +cڋxt +, +mid +, +�as�_code +); + +359 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +360 + `�nd__pub�c +( +cڋxt +, +mid +, +�as�_code +); + +362 + `�nd__pub�c +( +cڋxt +, +mid +, 0); + +366 + } +} + + @src/handle_subscribe.c + +17 + ~"c�fig.h +" + +19 + ~<�dio.h +> + +20 + ~<�r�g.h +> + +22 + ~"mosqu�to_brok�_����.h +" + +23 + ~"mem�y_mosq.h +" + +24 + ~"mq�_��oc�.h +" + +25 + ~"�ck�_mosq.h +" + +26 + ~"�ݔty_mosq.h +" + +30 + $h�d�__subs�ibe +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +32 +rc + = 0; + +33 +rc2 +; + +34 +u�t16_t + +mid +; + +35 * +sub +; + +36 +u�t8_t + +subs��ti�_�ti�s +; + +37 +u�t32_t + +subs��ti�_id�tif�r + = 0; + +38 +u�t8_t + +qos +; + +39 +u�t8_t + +���_h�dl�g + = 0; + +40 +u�t8_t + * +�yl�d + = +NULL +, * +tmp_�yl�d +; + +41 +u�t32_t + +�yl�d�n + = 0; + +42 +�n +; + +43 +�� +; + +44 * +sub_mou� +; + +45 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +47 if(! +cڋxt +� +MOSQ_ERR_INVAL +; + +49 if( +cڋxt +-> +��e + !� +mosq_cs_c���ed +){ + +50 +MOSQ_ERR_PROTOCOL +; + +53 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "Re�ived SUBSCRIBE from %s", +cڋxt +-> +id +); + +55 if( +cڋxt +-> +��oc� + !� +mosq_p_mq�31 +){ + +56 if(( +cڋxt +-> +�_�ck� +. +comm�d +&0x0F) != 0x02){ + +57 +MOSQ_ERR_PROTOCOL +; + +60 if( + `�ck�__�ad_u�t16 +(& +cڋxt +-> +�_�ck� +, & +mid +)) 1; + +61 if( +mid + =�0� +MOSQ_ERR_PROTOCOL +; + +63 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +64 +rc + = + `�ݔty__�ad_�l +( +CMD_SUBSCRIBE +, & +cڋxt +-> +�_�ck� +, & +�ݔt�s +); + +65 if( +rc +) �c; + +67 if( + `mosqu�to_�ݔty_�ad_v��t +( +�ݔt�s +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, + +68 & +subs��ti�_id�tif�r +, +�l� +)){ + +71 if( +subs��ti�_id�tif�r + == 0){ + +72 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +73 +MOSQ_ERR_PROTOCOL +; + +77 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +81 +cڋxt +-> +�_�ck� +. +pos + < cڋxt->�_�ck�. +�ma��g_�ngth +){ + +82 +sub + = +NULL +; + +83 if( + `�ck�__�ad_�r�g +(& +cڋxt +-> +�_�ck� +, & +sub +, & +�� +)){ + +84 + `mosqu�to__� +( +�yl�d +); + +88 if( +sub +){ + +89 if(! +�� +){ + +90 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, + +92 +cڋxt +-> +add�ss +); + +93 + `mosqu�to__� +( +sub +); + +94 + `mosqu�to__� +( +�yl�d +); + +97 if( + `mosqu�to_sub_t�ic_check +( +sub +)){ + +98 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, + +100 +cڋxt +-> +add�ss +); + +101 + `mosqu�to__� +( +sub +); + +102 + `mosqu�to__� +( +�yl�d +); + +106 if( + `�ck�__�ad_by� +(& +cڋxt +-> +�_�ck� +, & +subs��ti�_�ti�s +)){ + +107 + `mosqu�to__� +( +sub +); + +108 + `mosqu�to__� +( +�yl�d +); + +111 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�31 + || cڋxt->��oc� =� +mosq_p_mq�311 +){ + +112 +qos + = +subs��ti�_�ti�s +; + +113 if( +cڋxt +-> +is_bridge +){ + +114 +subs��ti�_�ti�s + = +MQTT_SUB_OPT_RETAIN_AS_PUBLISHED + | +MQTT_SUB_OPT_NO_LOCAL +; + +117 +qos + = +subs��ti�_�ti�s + & 0x03; + +118 +subs��ti�_�ti�s + &= 0xFC; + +120 +���_h�dl�g + = ( +subs��ti�_�ti�s + & 0x30); + +121 if( +���_h�dl�g + =�0x30 || ( +subs��ti�_�ti�s + & 0xC0) != 0){ + +122 +MOSQ_ERR_PROTOCOL +; + +125 if( +qos + > 2){ + +126 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, + +128 +cڋxt +-> +add�ss +); + +129 + `mosqu�to__� +( +sub +); + +130 + `mosqu�to__� +( +�yl�d +); + +135 if( +cڋxt +-> +li��� + && cڋxt->li���-> +mou�_po�t +){ + +136 +�n + = + `��� +( +cڋxt +-> +li��� +-> +mou�_po�t +�+ +�� + + 1; + +137 +sub_mou� + = + `mosqu�to__m�loc +( +�n ++1); + +138 if(! +sub_mou� +){ + +139 + `mosqu�to__� +( +sub +); + +140 + `mosqu�to__� +( +�yl�d +); + +141 +MOSQ_ERR_NOMEM +; + +143 + `���tf +( +sub_mou� +, +�n +, "%s%s", +cڋxt +-> +li��� +-> +mou�_po�t +, +sub +); + +144 +sub_mou� +[ +�n +] = '\0'; + +146 + `mosqu�to__� +( +sub +); + +147 +sub + = +sub_mou� +; + +150 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "\t%�(QoS %d)", +sub +, +qos +); + +152 if( +cڋxt +-> +��oc� + !� +mosq_p_mq�31 +){ + +153 +rc2 + = + `mosqu�to_a�_check +( +db +, +cڋxt +, +sub +, 0, +NULL +, +qos +, +�l� +, +MOSQ_ACL_SUBSCRIBE +); + +154 +rc2 +){ + +155 +MOSQ_ERR_SUCCESS +: + +157 +MOSQ_ERR_ACL_DENIED +: + +158 +qos + = 0x80; + +161 + `mosqu�to__� +( +sub +); + +162 +rc2 +; + +166 if( +qos + != 0x80){ + +167 +rc2 + = + `sub__add +( +db +, +cڋxt +, +sub +, +qos +, +subs��ti�_id�tif�r +, +subs��ti�_�ti�s +, &db-> +subs +); + +168 if( +rc2 + > 0){ + +169 + `mosqu�to__� +( +sub +); + +170 +rc2 +; + +172 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�311 + || cڋxt->��oc� =� +mosq_p_mq�31 +){ + +173 if( +rc2 + =� +MOSQ_ERR_SUCCESS + ||�c2 =� +MOSQ_ERR_SUB_EXISTS +){ + +174 if( + `sub__���_queue +( +db +, +cڋxt +, +sub +, +qos +, 0)� +rc + = 1; + +177 if(( +���_h�dl�g + =� +MQTT_SUB_OPT_SEND_RETAIN_ALWAYS +) + +178 || ( +rc2 + =� +MOSQ_ERR_SUCCESS + && +���_h�dl�g + =� +MQTT_SUB_OPT_SEND_RETAIN_NEW +)){ + +180 if( + `sub__���_queue +( +db +, +cڋxt +, +sub +, +qos +, +subs��ti�_id�tif�r +)� +rc + = 1; + +184 + `log__��tf +( +NULL +, +MOSQ_LOG_SUBSCRIBE +, "%�%d %s", +cڋxt +-> +id +, +qos +, +sub +); + +186 + `mosqu�to__� +( +sub +); + +188 +tmp_�yl�d + = + `mosqu�to__��loc +( +�yl�d +, +�yl�d�n + + 1); + +189 if( +tmp_�yl�d +){ + +190 +�yl�d + = +tmp_�yl�d +; + +191 +�yl�d +[ +�yl�d�n +] = +qos +; + +192 +�yl�d�n +++; + +194 + `mosqu�to__� +( +�yl�d +); + +196 +MOSQ_ERR_NOMEM +; + +201 if( +cڋxt +-> +��oc� + !� +mosq_p_mq�31 +){ + +202 if( +�yl�d�n + == 0){ + +204 +MOSQ_ERR_PROTOCOL +; + +207 if( + `�nd__suback +( +cڋxt +, +mid +, +�yl�d�n +, +�yl�d +)� +rc + = 1; + +208 + `mosqu�to__� +( +�yl�d +); + +210 #ifde� +WITH_PERSISTENCE + + +211 +db +-> +�rsi���_ch�ges +++; + +214 +rc +; + +215 + } +} + + @src/handle_unsubscribe.c + +17 + ~"c�fig.h +" + +19 + ~<�dio.h +> + +20 + ~<�r�g.h +> + +22 + ~"mosqu�to_brok�_����.h +" + +23 + ~"mem�y_mosq.h +" + +24 + ~"mq�_��oc�.h +" + +25 + ~"�ck�_mosq.h +" + +26 + ~"�nd_mosq.h +" + +28 + $h�d�__unsubs�ibe +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +30 +u�t16_t + +mid +; + +31 * +sub +; + +32 +�� +; + +33 +rc +; + +34 +u�t8_t + +�as� +; + +35 +�as�_code_cou� + = 0; + +36 +�as�_code_max +; + +37 +u�t8_t + * +�as�_codes + = +NULL +, * +�as�_tmp +; + +38 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +40 if(! +cڋxt +� +MOSQ_ERR_INVAL +; + +42 if( +cڋxt +-> +��e + !� +mosq_cs_c���ed +){ + +43 +MOSQ_ERR_PROTOCOL +; + +45 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "Re�ived UNSUBSCRIBE from %s", +cڋxt +-> +id +); + +47 if( +cڋxt +-> +��oc� + !� +mosq_p_mq�31 +){ + +48 if(( +cڋxt +-> +�_�ck� +. +comm�d +&0x0F) != 0x02){ + +49 +MOSQ_ERR_PROTOCOL +; + +52 if( + `�ck�__�ad_u�t16 +(& +cڋxt +-> +�_�ck� +, & +mid +)) 1; + +53 if( +mid + =�0� +MOSQ_ERR_PROTOCOL +; + +55 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +56 +rc + = + `�ݔty__�ad_�l +( +CMD_UNSUBSCRIBE +, & +cڋxt +-> +�_�ck� +, & +�ݔt�s +); + +57 if( +rc +) �c; + +59 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +62 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�311 + || cڋxt->��oc� =� +mosq_p_mq�5 +){ + +63 if( +cڋxt +-> +�_�ck� +. +pos + =�cڋxt->�_�ck�. +�ma��g_�ngth +){ + +65 +MOSQ_ERR_PROTOCOL +; + +69 +�as�_code_max + = 10; + +70 +�as�_codes + = + `mosqu�to__m�loc +( +�as�_code_max +); + +71 if(! +�as�_codes +){ + +72 +MOSQ_ERR_NOMEM +; + +75 +cڋxt +-> +�_�ck� +. +pos + < cڋxt->�_�ck�. +�ma��g_�ngth +){ + +76 +sub + = +NULL +; + +77 if( + `�ck�__�ad_�r�g +(& +cڋxt +-> +�_�ck� +, & +sub +, & +�� +)){ + +81 if(! +�� +){ + +82 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, + +84 +cڋxt +-> +id +); + +85 + `mosqu�to__� +( +sub +); + +88 if( + `mosqu�to_sub_t�ic_check +( +sub +)){ + +89 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, + +91 +cڋxt +-> +id +); + +92 + `mosqu�to__� +( +sub +); + +96 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "\t%s", +sub +); + +97 +rc + = + `sub__�move +( +db +, +cڋxt +, +sub +, db-> +subs +, & +�as� +); + +98 + `log__��tf +( +NULL +, +MOSQ_LOG_UNSUBSCRIBE +, "%�%s", +cڋxt +-> +id +, +sub +); + +99 + `mosqu�to__� +( +sub +); + +100 if( +rc +) �c; + +102 +�as�_codes +[ +�as�_code_cou� +] = +�as� +; + +103 +�as�_code_cou� +++; + +104 if( +�as�_code_cou� + =� +�as�_code_max +){ + +105 +�as�_tmp + = + `mosqu�to__��loc +( +�as�_codes +, +�as�_code_max +*2); + +106 if(! +�as�_tmp +){ + +107 + `mosqu�to__� +( +�as�_codes +); + +108 +MOSQ_ERR_NOMEM +; + +110 +�as�_codes + = +�as�_tmp +; + +111 +�as�_code_max + *= 2; + +114 #ifde� +WITH_PERSISTENCE + + +115 +db +-> +�rsi���_ch�ges +++; + +118 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "S�d�g UNSUBACK��%s", +cڋxt +-> +id +); + +121 +rc + = + `�nd__unsuback +( +cڋxt +, +mid +, +�as�_code_cou� +, +�as�_codes +, +NULL +); + +122 + `mosqu�to__� +( +�as�_codes +); + +123 +rc +; + +124 + } +} + + @src/lib_load.h + +17 #i�de� +LIB_LOAD_H + + +18 + #LIB_LOAD_H + + + ) + +20 #ifde� +WIN32 + + +21 + ~<w�dows.h +> + +23 + ~<dlf�.h +> + +26 #ifde� +WIN32 + + +27 + #LIB_LOAD +( +A +� + `L�dLib�ry +(A) + + ) + +28 + #LIB_CLOSE +( +A +� + `F�eLib�ry +(A) + + ) + +29 + #LIB_SYM +( +HANDLE +, +SYM +� + `G�ProcAdd�ss +(HANDLE, SYM) + + ) + +31 + #LIB_LOAD +( +A +� + `dlݒ +(A, +RTLD_NOW +| +RTLD_GLOBAL +) + + ) + +32 + #LIB_CLOSE +( +A +� + `dl�o� +(A) + + ) + +33 + #LIB_SYM +( +HANDLE +, +SYM +� + `dlsym +(HANDLE, SYM) + + ) + +36 + #LIB_SYM_EASY +( +MEMBER +, +HANDLE +, +SYM +�if(!(MEMBER = + `LIB_SYM +(HANDLE, SYM)� 1 + + ) + + @src/logging.c + +16 + ~"c�fig.h +" + +18 + ~<�d�g.h +> + +19 + ~<�dio.h +> + +20 + ~<�r�g.h +> + +21 #i�de� +WIN32 + + +22 + ~<sy�og.h +> + +24 + ~<time.h +> + +26 #ifde� +WITH_DLT + + +27 + ~<d�/d�.h +> + +30 + ~"mosqu�to_brok�_����.h +" + +31 + ~"mem�y_mosq.h +" + +32 + ~"ut�_mosq.h +" + +34 +mosqu�to_db + +�t_db +; + +36 #ifde� +WIN32 + + +37 +HANDLE + + gsy�og_h +; + +52 + glog_de���i�s + = +MQTT3_LOG_STDERR +; + +53 + glog_�iܙ�s + = +MOSQ_LOG_ERR + | +MOSQ_LOG_WARNING + | +MOSQ_LOG_NOTICE + | +MOSQ_LOG_INFO +; + +55 #ifde� +WITH_DLT + + +56 +D�Cڋxt + + gd�Cڋxt +; + +59 + $g�_time +( +tm + ** +ti +) + +61 #i� + `def�ed +( +__APPLE__ +) + +62 +timev� + +tv +; + +64 +time�ec + +ts +; + +66 +time_t + +s +; + +68 #ifde� +WIN32 + + +69 +s + = + `time +( +NULL +); + +71 #�i� + `def�ed +( +__APPLE__ +) + +72 + `g�timeofday +(& +tv +, +NULL +); + +73 +s + = +tv +. +tv_�c +; + +75 if( + `�ock_g�time +( +CLOCK_REALTIME +, & +ts +) != 0){ + +76 + `�r�tf +( +�d�r +, "Error obtaining system�ime.\n"); + +79 +s + = +ts +. +tv_�c +; + +82 * +ti + = + `lo��ime +(& +s +); + +83 if(!(* +ti +)){ + +84 + `�r�tf +( +�d�r +, "Error obtaining system�ime.\n"); + +89 + } +} + +92 + $log__�� +( +mosqu�to__c�fig + * +c�fig +) + +94 +rc + = 0; + +96 +log_�iܙ�s + = +c�fig +-> +log_ty� +; + +97 +log_de���i�s + = +c�fig +-> +log_de� +; + +99 if( +log_de���i�s + & +MQTT3_LOG_SYSLOG +){ + +100 #i�de� +WIN32 + + +101 + `ݒlog +("mosqu�to", +LOG_PID +| +LOG_CONS +, +c�fig +-> +log_�c��y +); + +103 +sy�og_h + = + `O�nEv�tLog +( +NULL +, "mosquitto"); + +107 if( +log_de���i�s + & +MQTT3_LOG_FILE +){ + +108 if( + `dr�_�iv�eges +( +c�fig +, +�ue +)){ + +111 +c�fig +-> +log_� + = + `mosqu�to__fݒ +(c�fig-> +log_f�e +, "�", +�ue +); + +112 if(! +c�fig +-> +log_� +){ + +113 +log_de���i�s + = +MQTT3_LOG_STDERR +; + +114 +log_�iܙ�s + = +MOSQ_LOG_ERR +; + +115 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: U�bˁ�ݒ�og f��%�f� wr��g.", +c�fig +-> +log_f�e +); + +116 +MOSQ_ERR_INVAL +; + +118 + `���e_�iv�eges +(); + +120 #ifde� +WITH_DLT + + +121 + `DLT_REGISTER_APP +("MQTT","mosquitto�og"); + +122 + `d�_�gi��_cڋxt +(& +d�Cڋxt +, "MQTT", "mosquitto DLT context"); + +124 +rc +; + +125 + } +} + +127 + $log__�o� +( +mosqu�to__c�fig + * +c�fig +) + +129 if( +log_de���i�s + & +MQTT3_LOG_SYSLOG +){ + +130 #i�de� +WIN32 + + +131 + `�o�log +(); + +133 + `Clo�Ev�tLog +( +sy�og_h +); + +136 if( +log_de���i�s + & +MQTT3_LOG_FILE +){ + +137 if( +c�fig +-> +log_� +){ + +138 + `f�o� +( +c�fig +-> +log_� +); + +139 +c�fig +-> +log_� + = +NULL +; + +143 #ifde� +WITH_DLT + + +144 + `d�_u�egi��_cڋxt +(& +d�Cڋxt +); + +145 + `DLT_UNREGISTER_APP +(); + +148 +MOSQ_ERR_SUCCESS +; + +149 + } +} + +151 #ifde� +WITH_DLT + + +152 +D�LogLev�Ty� + + $g�_d�_�v� +( +�iܙy +) + +154 +�iܙy +) { + +155 +MOSQ_LOG_ERR +: + +156 +DLT_LOG_ERROR +; + +157 +MOSQ_LOG_WARNING +: + +158 +DLT_LOG_WARN +; + +159 +MOSQ_LOG_INFO +: + +160 +DLT_LOG_INFO +; + +161 +MOSQ_LOG_DEBUG +: + +162 +DLT_LOG_DEBUG +; + +163 +MOSQ_LOG_NOTICE +: + +164 +MOSQ_LOG_SUBSCRIBE +: + +165 +MOSQ_LOG_UNSUBSCRIBE +: + +166 +DLT_LOG_VERBOSE +; + +168 +DLT_LOG_DEFAULT +; + +170 + } +} + +173 + $log__v��tf +( +�iܙy +, cڡ * +fmt +, +va_li� + +va +) + +175 * +s +; + +176 * +� +; + +177 +�n +; + +178 #ifde� +WIN32 + + +179 * +� +; + +181 cڡ * +t�ic +; + +182 +sy�og_�iܙy +; + +183 +time_t + +now + = + `time +( +NULL +); + +184 +time_t + +ϡ_�ush + = 0; + +185 +time_buf +[50]; + +186 +bo� + +log_time�amp + = +�ue +; + +187 * +log_time�amp_f�m� + = +NULL +; + +188 +FILE + * +log_� + = +NULL +; + +190 if( +�t_db +. +c�fig +){ + +191 +log_time�amp + = +�t_db +. +c�fig +->log_timestamp; + +192 +log_time�amp_f�m� + = +�t_db +. +c�fig +->log_timestamp_format; + +193 +log_� + = +�t_db +. +c�fig +->log_fptr; + +196 if(( +log_�iܙ�s + & +�iܙy +�&& +log_de���i�s + !� +MQTT3_LOG_NONE +){ + +197 +�iܙy +){ + +198 +MOSQ_LOG_SUBSCRIBE +: + +199 +t�ic + = "$SYS/broker/log/M/subscribe"; + +200 #i�de� +WIN32 + + +201 +sy�og_�iܙy + = +LOG_NOTICE +; + +203 +sy�og_�iܙy + = +EVENTLOG_INFORMATION_TYPE +; + +206 +MOSQ_LOG_UNSUBSCRIBE +: + +207 +t�ic + = "$SYS/broker/log/M/unsubscribe"; + +208 #i�de� +WIN32 + + +209 +sy�og_�iܙy + = +LOG_NOTICE +; + +211 +sy�og_�iܙy + = +EVENTLOG_INFORMATION_TYPE +; + +214 +MOSQ_LOG_DEBUG +: + +215 +t�ic + = "$SYS/broker/log/D"; + +216 #i�de� +WIN32 + + +217 +sy�og_�iܙy + = +LOG_DEBUG +; + +219 +sy�og_�iܙy + = +EVENTLOG_INFORMATION_TYPE +; + +222 +MOSQ_LOG_ERR +: + +223 +t�ic + = "$SYS/broker/log/E"; + +224 #i�de� +WIN32 + + +225 +sy�og_�iܙy + = +LOG_ERR +; + +227 +sy�og_�iܙy + = +EVENTLOG_ERROR_TYPE +; + +230 +MOSQ_LOG_WARNING +: + +231 +t�ic + = "$SYS/broker/log/W"; + +232 #i�de� +WIN32 + + +233 +sy�og_�iܙy + = +LOG_WARNING +; + +235 +sy�og_�iܙy + = +EVENTLOG_WARNING_TYPE +; + +238 +MOSQ_LOG_NOTICE +: + +239 +t�ic + = "$SYS/broker/log/N"; + +240 #i�de� +WIN32 + + +241 +sy�og_�iܙy + = +LOG_NOTICE +; + +243 +sy�og_�iܙy + = +EVENTLOG_INFORMATION_TYPE +; + +246 +MOSQ_LOG_INFO +: + +247 +t�ic + = "$SYS/broker/log/I"; + +248 #i�de� +WIN32 + + +249 +sy�og_�iܙy + = +LOG_INFO +; + +251 +sy�og_�iܙy + = +EVENTLOG_INFORMATION_TYPE +; + +254 #ifde� +WITH_WEBSOCKETS + + +255 +MOSQ_LOG_WEBSOCKETS +: + +256 +t�ic + = "$SYS/broker/log/WS"; + +257 #i�de� +WIN32 + + +258 +sy�og_�iܙy + = +LOG_DEBUG +; + +260 +sy�og_�iܙy + = +EVENTLOG_INFORMATION_TYPE +; + +265 +t�ic + = "$SYS/broker/log/E"; + +266 #i�de� +WIN32 + + +267 +sy�og_�iܙy + = +LOG_ERR +; + +269 +sy�og_�iܙy + = +EVENTLOG_ERROR_TYPE +; + +272 +�n + = + `��� +( +fmt +) + 500; + +273 +s + = + `mosqu�to__m�loc +( +�n +*()); + +274 if(! +s +� +MOSQ_ERR_NOMEM +; + +276 + `v���tf +( +s +, +�n +, +fmt +, +va +); + +277 +s +[ +�n +-1] = '\0'; + +279 if( +log_time�amp + && +log_time�amp_f�m� +){ + +280 +tm + * +ti + = +NULL +; + +281 + `g�_time +(& +ti +); + +282 if( + `�r�ime +( +time_buf +, 50, +log_time�amp_f�m� +, +ti +) == 0){ + +283 + `���tf +( +time_buf +, 50, "Time�rror"); + +286 if( +log_de���i�s + & +MQTT3_LOG_STDOUT +){ + +287 if( +log_time�amp +){ + +288 if( +log_time�amp_f�m� +){ + +289 + `�r�tf +( +�dout +, "%s: %s\n", +time_buf +, +s +); + +291 + `�r�tf +( +�dout +, "%d: %s\n", () +now +, +s +); + +294 + `�r�tf +( +�dout +, "%s\n", +s +); + +296 + `f�ush +( +�dout +); + +298 if( +log_de���i�s + & +MQTT3_LOG_STDERR +){ + +299 if( +log_time�amp +){ + +300 if( +log_time�amp_f�m� +){ + +301 + `�r�tf +( +�d�r +, "%s: %s\n", +time_buf +, +s +); + +303 + `�r�tf +( +�d�r +, "%d: %s\n", () +now +, +s +); + +306 + `�r�tf +( +�d�r +, "%s\n", +s +); + +308 + `f�ush +( +�d�r +); + +310 if( +log_de���i�s + & +MQTT3_LOG_FILE + && +log_� +){ + +311 if( +log_time�amp +){ + +312 if( +log_time�amp_f�m� +){ + +313 + `�r�tf +( +log_� +, "%s: %s\n", +time_buf +, +s +); + +315 + `�r�tf +( +log_� +, "%d: %s\n", () +now +, +s +); + +318 + `�r�tf +( +log_� +, "%s\n", +s +); + +320 if( +now + - +ϡ_�ush + > 1){ + +321 + `f�ush +( +log_� +); + +322 +ϡ_�ush + = +now +; + +325 if( +log_de���i�s + & +MQTT3_LOG_SYSLOG +){ + +326 #i�de� +WIN32 + + +327 + `sy�og +( +sy�og_�iܙy +, "%s", +s +); + +329 +� + = (*) +s +; + +330 + `R��tEv�t +( +sy�og_h +, +sy�og_�iܙy +, 0, 0, +NULL +, 1, 0, & +� +, NULL); + +333 if( +log_de���i�s + & +MQTT3_LOG_TOPIC + && +�iܙy + !� +MOSQ_LOG_DEBUG + &&�riܙy !� +MOSQ_LOG_INTERNAL +){ + +334 if( +log_time�amp +){ + +335 +�n + += 30; + +336 +� + = + `mosqu�to__m�loc +( +�n +*()); + +337 if(! +� +){ + +338 + `mosqu�to__� +( +s +); + +339 +MOSQ_ERR_NOMEM +; + +341 + `���tf +( +� +, +�n +, "%d: %s", () +now +, +s +); + +342 + `db__mes�ges_�sy_queue +(& +�t_db +, +NULL +, +t�ic +, 2, + `��� +( +� +), st, 0, 20, NULL); + +343 + `mosqu�to__� +( +� +); + +345 + `db__mes�ges_�sy_queue +(& +�t_db +, +NULL +, +t�ic +, 2, + `��� +( +s +), s, 0, 20, NULL); + +348 #ifde� +WITH_DLT + + +349 if( +�iܙy + !� +MOSQ_LOG_INTERNAL +){ + +350 + `DLT_LOG_STRING +( +d�Cڋxt +, + `g�_d�_�v� +( +�iܙy +), +s +); + +353 + `mosqu�to__� +( +s +); + +356 +MOSQ_ERR_SUCCESS +; + +357 + } +} + +359 + $log__��tf +( +mosqu�to + * +mosq +, +�iܙy +, cڡ * +fmt +, ...) + +361 +va_li� + +va +; + +362 +rc +; + +364 + `UNUSED +( +mosq +); + +366 + `va_��t +( +va +, +fmt +); + +367 +rc + = + `log__v��tf +( +�iܙy +, +fmt +, +va +); + +368 + `va_�d +( +va +); + +370 +rc +; + +371 + } +} + +373 + $log__���� +(cڡ * +fmt +, ...) + +375 +va_li� + +va +; + +376 +buf +[200]; + +377 +�n +; + +379 + `va_��t +( +va +, +fmt +); + +380 +�n + = + `v���tf +( +buf +, 200, +fmt +, +va +); + +381 + `va_�d +( +va +); + +383 if( +�n + >= 200){ + +384 + `log__��tf +( +NULL +, +MOSQ_LOG_INTERNAL +, "I����log buf�to�sh܈(%d)", +�n +); + +388 + `log__��tf +( +NULL +, +MOSQ_LOG_INTERNAL +, "%s%s%s", "\e[32m", +buf +, "\e[0m"); + +389 + } +} + +391 + $mosqu�to_log_v��tf +( +�v� +, cڡ * +fmt +, +va_li� + +va +) + +393 + `log__v��tf +( +�v� +, +fmt +, +va +); + +394 + } +} + +396 + $mosqu�to_log_��tf +( +�v� +, cڡ * +fmt +, ...) + +398 +va_li� + +va +; + +400 + `va_��t +( +va +, +fmt +); + +401 + `log__v��tf +( +�v� +, +fmt +, +va +); + +402 + `va_�d +( +va +); + +403 + } +} + + @src/loop.c + +18 + ~"c�fig.h +" + +20 #i�de� +WIN32 + + +21 + #_GNU_SOURCE + + + ) + +24 + ~<as��.h +> + +25 #i�de� +WIN32 + + +26 #ifde� +WITH_EPOLL + + +27 + ~<sys/��l.h +> + +28 + #MAX_EVENTS + 1000 + + ) + +30 + ~<p�l.h +> + +31 + ~<uni�d.h +> + +33 + ~<�o�ss.h +> + +34 + ~<w�sock2.h +> + +35 + ~<ws2t��.h +> + +38 + ~<��o.h +> + +39 + ~<sig�l.h +> + +40 + ~<�dio.h +> + +41 + ~<�r�g.h +> + +42 #i�de� +WIN32 + + +43 + ~<sys/sock�.h +> + +45 + ~<time.h +> + +47 #ifde� +WITH_WEBSOCKETS + + +48 + ~<libwebsock�s.h +> + +51 + ~"mosqu�to_brok�_����.h +" + +52 + ~"mem�y_mosq.h +" + +53 + ~"�ck�_mosq.h +" + +54 + ~"�nd_mosq.h +" + +55 + ~"sys_��.h +" + +56 + ~"time_mosq.h +" + +57 + ~"ut�_mosq.h +" + +59 +bo� + +�ag_�l�d +; + +60 #ifde� +WITH_PERSISTENCE + + +61 +bo� + +�ag_db_backup +; + +63 +bo� + +�ag_��_��t +; + +64 +run +; + +66 #ifde� +WITH_EPOLL + + +67 +lo�_h�d�_�ads_wr�es +( +mosqu�to_db + * +db +, +mosq_sock_t + +sock +, +u�t32_t + +ev�ts +); + +69 +lo�_h�d�_�ads_wr�es +( +mosqu�to_db + * +db +, +p�lfd + * +p�lfds +); + +72 #ifde� +WITH_WEBSOCKETS + + +73 + $�mp__exp�e_websock�s_���s +( +mosqu�to_db + * +db +) + +75 +mosqu�to + * +cڋxt +, * +�xt_tmp +; + +76 +time_t + +ϡ_check + = 0; + +77 +time_t + +now + = + `mosqu�to_time +(); + +78 * +id +; + +80 if( +now + - +ϡ_check + > 60){ + +81 + `HASH_ITER +( +hh_id +, +db +-> +cڋxts_by_id +, +cڋxt +, +�xt_tmp +){ + +82 if( +cڋxt +-> +wsi + && cڋxt-> +sock + !� +INVALID_SOCKET +){ + +83 if( +cڋxt +-> +k��live + && +now + - cڋxt-> +ϡ_msg_� + > ( +time_t +)(context->keepalive)*3/2){ + +84 if( +db +-> +c�fig +-> +c���i�_mes�ges + =� +�ue +){ + +85 if( +cڋxt +-> +id +){ + +86 +id + = +cڋxt +->id; + +88 +id + = "<unknown>"; + +90 if( +db +-> +c�fig +-> +c���i�_mes�ges + =� +�ue +){ + +91 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "Cl�� %�ha�ex�eded�imeout, disc����g.", +id +); + +95 + `do_disc��� +( +db +, +cڋxt +, +MOSQ_ERR_KEEPALIVE +); + +99 +ϡ_check + = + `mosqu�to_time +(); + +101 + } +} + +104 + $mosqu�to_ma�_lo� +( +mosqu�to_db + * +db +, +mosq_sock_t + * +li��sock +, +li��sock_cou� +) + +106 #ifde� +WITH_SYS_TREE + + +107 +time_t + +��t_time + = + `mosqu�to_time +(); + +109 #ifde� +WITH_PERSISTENCE + + +110 +time_t + +ϡ_backup + = + `mosqu�to_time +(); + +112 +time_t + +now + = 0; + +113 +time_cou� +; + +114 +fdcou� +; + +115 +mosqu�to + * +cڋxt +, * +�xt_tmp +; + +116 #i�de� +WIN32 + + +117 +sig�t_t + +sigblock +, +�igsig +; + +119 +i +; + +120 #ifde� +WITH_EPOLL + + +121 +j +; + +122 +��l_ev�t + +ev +, +ev�ts +[ +MAX_EVENTS +]; + +124 +p�lfd + * +p�lfds + = +NULL +; + +125 +p�lfd_�dex +; + +126 +p�lfd_max +; + +128 #ifde� +WITH_BRIDGE + + +129 +rc +; + +130 +�r +; + +131 +sock�n_t + +�n +; + +133 +time_t + +exp��i�_check_time + = 0; + +134 * +id +; + +136 #i�de� +WIN32 + + +137 + `sigem�y�t +(& +sigblock +); + +138 + `sigadd�t +(& +sigblock +, +SIGINT +); + +139 + `sigadd�t +(& +sigblock +, +SIGTERM +); + +140 + `sigadd�t +(& +sigblock +, +SIGUSR1 +); + +141 + `sigadd�t +(& +sigblock +, +SIGUSR2 +); + +142 + `sigadd�t +(& +sigblock +, +SIGHUP +); + +145 #i�de� +WITH_EPOLL + + +146 #ifde� +WIN32 + + +147 +p�lfd_max + = + `_g�max�dio +(); + +149 +p�lfd_max + = + `sysc�f +( +_SC_OPEN_MAX +); + +152 +p�lfds + = + `mosqu�to__m�loc +(( +p�lfd +)* +p�lfd_max +); + +153 if(! +p�lfds +){ + +154 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +155 +MOSQ_ERR_NOMEM +; + +159 if( +db +-> +c�fig +-> +�rsi��t_���_exp��i� + > 0){ + +160 +exp��i�_check_time + = + `time +( +NULL +) + 3600; + +163 #ifde� +WITH_EPOLL + + +164 +db +-> +��lfd + = 0; + +165 i�(( +db +-> +��lfd + = + `��l_��� +( +MAX_EVENTS +)) == -1) { + +166 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� i������t�g: %s", + `���� +( +��o +)); + +167 +MOSQ_ERR_UNKNOWN +; + +169 + `mem�t +(& +ev +, 0, ( +��l_ev�t +)); + +170 + `mem�t +(& +ev�ts +, 0, ( +��l_ev�t +)* +MAX_EVENTS +); + +171 +i +=0; i< +li��sock_cou� +; i++){ + +172 +ev +. +d�a +. +fd + = +li��sock +[ +i +]; + +173 +ev +. +ev�ts + = +EPOLLIN +; + +174 i�( + `��l_�l +( +db +-> +��lfd +, +EPOLL_CTL_ADD +, +li��sock +[ +i +], & +ev +) == -1) { + +175 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� i���Ț��Ȼgi���g: %s", + `���� +( +��o +)); + +176 () + `�o� +( +db +-> +��lfd +); + +177 +db +-> +��lfd + = 0; + +178 +MOSQ_ERR_UNKNOWN +; + +181 #ifde� +WITH_BRIDGE + + +182 + `HASH_ITER +( +hh_sock +, +db +-> +cڋxts_by_sock +, +cڋxt +, +�xt_tmp +){ + +183 if( +cڋxt +-> +bridge +){ + +184 +ev +. +d�a +. +fd + = +cڋxt +-> +sock +; + +185 +ev +. +ev�ts + = +EPOLLIN +; + +186 +cڋxt +-> +ev�ts + = +EPOLLIN +; + +187 i�( + `��l_�l +( +db +-> +��lfd +, +EPOLL_CTL_ADD +, +cڋxt +-> +sock +, & +ev +) == -1) { + +188 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� i���Ț��Ȼgi���g bridge: %s", + `���� +( +��o +)); + +189 () + `�o� +( +db +-> +��lfd +); + +190 +db +-> +��lfd + = 0; + +191 +MOSQ_ERR_UNKNOWN +; + +198 +run +){ + +199 + `cڋxt__�_disu�d +( +db +); + +200 #ifde� +WITH_SYS_TREE + + +201 if( +db +-> +c�fig +-> +sys_��rv� + > 0){ + +202 + `sys_��__upd�e +( +db +, db-> +c�fig +-> +sys_��rv� +, +��t_time +); + +206 #i�de� +WITH_EPOLL + + +207 + `mem�t +( +p�lfds +, -1, ( +p�lfd +)* +p�lfd_max +); + +209 +p�lfd_�dex + = 0; + +210 +i +=0; i< +li��sock_cou� +; i++){ + +211 +p�lfds +[ +p�lfd_�dex +]. +fd + = +li��sock +[ +i +]; + +212 +p�lfds +[ +p�lfd_�dex +]. +ev�ts + = +POLLIN +; + +213 +p�lfds +[ +p�lfd_�dex +]. +�v�ts + = 0; + +214 +p�lfd_�dex +++; + +218 +time_cou� + = 0; + +219 + `HASH_ITER +( +hh_sock +, +db +-> +cڋxts_by_sock +, +cڋxt +, +�xt_tmp +){ + +220 if( +time_cou� + > 0){ + +221 +time_cou� +--; + +223 +time_cou� + = 1000; + +224 +now + = + `mosqu�to_time +(); + +226 +cڋxt +-> +p�lfd_�dex + = -1; + +228 if( +cڋxt +-> +sock + !� +INVALID_SOCKET +){ + +229 #ifde� +WITH_BRIDGE + + +230 if( +cڋxt +-> +bridge +){ + +231 + `mosqu�to__check_k��live +( +db +, +cڋxt +); + +232 if( +cڋxt +-> +bridge +-> +round_rob� + =� +�l� + + +233 && +cڋxt +-> +bridge +-> +cur_add�ss + != 0 + +234 && +cڋxt +-> +bridge +-> +�im�y_��y + + +235 && +now + > +cڋxt +-> +bridge +-> +�im�y_��y +){ + +237 if( +cڋxt +-> +bridge +-> +�im�y_��y_sock + =� +INVALID_SOCKET +){ + +238 +rc + = + `�t__�y_c��� +( +cڋxt +-> +bridge +-> +add�s�s +[0]. +add�ss +, + +239 +cڋxt +-> +bridge +-> +add�s�s +[0]. +p�t +, + +240 & +cڋxt +-> +bridge +-> +�im�y_��y_sock +, +NULL +, +�l� +); + +242 if( +rc + == 0){ + +243 + `COMPAT_CLOSE +( +cڋxt +-> +bridge +-> +�im�y_��y_sock +); + +244 +cڋxt +-> +bridge +-> +�im�y_��y_sock + = +INVALID_SOCKET +; + +245 +cڋxt +-> +bridge +-> +�im�y_��y + = 0; + +246 + `�t__sock�_�o� +( +db +, +cڋxt +); + +247 +cڋxt +-> +bridge +-> +cur_add�ss + = 0; + +250 +�n + = (); + +251 if(! + `g�sock�t +( +cڋxt +-> +bridge +-> +�im�y_��y_sock +, +SOL_SOCKET +, +SO_ERROR +, (*)& +�r +, & +�n +)){ + +252 if( +�r + == 0){ + +253 + `COMPAT_CLOSE +( +cڋxt +-> +bridge +-> +�im�y_��y_sock +); + +254 +cڋxt +-> +bridge +-> +�im�y_��y_sock + = +INVALID_SOCKET +; + +255 +cڋxt +-> +bridge +-> +�im�y_��y + = 0; + +256 + `�t__sock�_�o� +( +db +, +cڋxt +); + +257 +cڋxt +-> +bridge +-> +cur_add�ss + = cڋxt->bridge-> +add�ss_cou� +-1; + +259 + `COMPAT_CLOSE +( +cڋxt +-> +bridge +-> +�im�y_��y_sock +); + +260 +cڋxt +-> +bridge +-> +�im�y_��y_sock + = +INVALID_SOCKET +; + +261 +cڋxt +-> +bridge +-> +�im�y_��y + = +now ++5; + +264 + `COMPAT_CLOSE +( +cڋxt +-> +bridge +-> +�im�y_��y_sock +); + +265 +cڋxt +-> +bridge +-> +�im�y_��y_sock + = +INVALID_SOCKET +; + +266 +cڋxt +-> +bridge +-> +�im�y_��y + = +now ++5; + +274 if(!( +cڋxt +-> +k��live +) + +275 || +cڋxt +-> +bridge + + +276 || +now + - +cڋxt +-> +ϡ_msg_� + <�( +time_t +)(cڋxt-> +k��live +)*3/2){ + +278 if( + `db__mes�ge_wr�e +( +db +, +cڋxt +�=� +MOSQ_ERR_SUCCESS +){ + +279 #ifde� +WITH_EPOLL + + +280 if( +cڋxt +-> +cu��t_out_�ck� + || cڋxt-> +��e + =� +mosq_cs_c���_�nd�g + || cڋxt-> +ws_w�t_wr�e +){ + +281 if(!( +cڋxt +-> +ev�ts + & +EPOLLOUT +)) { + +282 +ev +. +d�a +. +fd + = +cڋxt +-> +sock +; + +283 +ev +. +ev�ts + = +EPOLLIN + | +EPOLLOUT +; + +284 if( + `��l_�l +( +db +-> +��lfd +, +EPOLL_CTL_ADD +, +cڋxt +-> +sock +, & +ev +) == -1) { + +285 if(( +��o + !� +EEXIST +)||( + `��l_�l +( +db +-> +��lfd +, +EPOLL_CTL_MOD +, +cڋxt +-> +sock +, & +ev +) == -1)) { + +286 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "E�� i���Ȼ-�gi���g��EPOLLOUT: %s", + `���� +( +��o +)); + +289 +cڋxt +-> +ev�ts + = +EPOLLIN + | +EPOLLOUT +; + +291 +cڋxt +-> +ws_w�t_wr�e + = +�l� +; + +294 if( +cڋxt +-> +ev�ts + & +EPOLLOUT +) { + +295 +ev +. +d�a +. +fd + = +cڋxt +-> +sock +; + +296 +ev +. +ev�ts + = +EPOLLIN +; + +297 if( + `��l_�l +( +db +-> +��lfd +, +EPOLL_CTL_ADD +, +cڋxt +-> +sock +, & +ev +) == -1) { + +298 if(( +��o + !� +EEXIST +)||( + `��l_�l +( +db +-> +��lfd +, +EPOLL_CTL_MOD +, +cڋxt +-> +sock +, & +ev +) == -1)) { + +299 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "E�� i���Ȼ-�gi���g��EPOLLIN: %s", + `���� +( +��o +)); + +302 +cڋxt +-> +ev�ts + = +EPOLLIN +; + +306 +p�lfds +[ +p�lfd_�dex +]. +fd + = +cڋxt +-> +sock +; + +307 +p�lfds +[ +p�lfd_�dex +]. +ev�ts + = +POLLIN +; + +308 +p�lfds +[ +p�lfd_�dex +]. +�v�ts + = 0; + +309 if( +cڋxt +-> +cu��t_out_�ck� + || cڋxt-> +��e + =� +mosq_cs_c���_�nd�g + || cڋxt-> +ws_w�t_wr�e +){ + +310 +p�lfds +[ +p�lfd_�dex +]. +ev�ts + |� +POLLOUT +; + +311 +cڋxt +-> +ws_w�t_wr�e + = +�l� +; + +313 +cڋxt +-> +p�lfd_�dex + =�ollfd_index; + +314 +p�lfd_�dex +++; + +317 + `do_disc��� +( +db +, +cڋxt +, +MOSQ_ERR_CONN_LOST +); + +321 + `do_disc��� +( +db +, +cڋxt +, +MOSQ_ERR_KEEPALIVE +); + +326 #ifde� +WITH_BRIDGE + + +327 +time_cou� + = 0; + +328 +i +=0; i< +db +-> +bridge_cou� +; i++){ + +329 if(! +db +-> +bridges +[ +i +]) ; + +331 +cڋxt + = +db +-> +bridges +[ +i +]; + +333 if( +cڋxt +-> +sock + =� +INVALID_SOCKET +){ + +334 if( +time_cou� + > 0){ + +335 +time_cou� +--; + +337 +time_cou� + = 1000; + +338 +now + = + `mosqu�to_time +(); + +341 if(! +cڋxt +-> +bridge +-> +���t_t +){ + +342 +cڋxt +-> +bridge +-> +���t_t + = +now ++cڋxt->bridge-> +���t_timeout +; + +343 +cڋxt +-> +bridge +-> +cur_add�ss +++; + +344 if( +cڋxt +-> +bridge +-> +cur_add�ss + =�cڋxt->bridge-> +add�ss_cou� +){ + +345 +cڋxt +-> +bridge +-> +cur_add�ss + = 0; + +348 if(( +cڋxt +-> +bridge +-> +��t_ty� + =� +b�_�zy + && cڋxt->bridge-> +�zy_�c��� +) + +349 || ( +cڋxt +-> +bridge +-> +��t_ty� + =� +b�_autom�ic + && +now + > cڋxt->bridge-> +���t_t +)){ + +351 #i� + `def�ed +( +__GLIBC__ +�&& def�ed( +WITH_ADNS +) + +352 if( +cڋxt +-> +adns +){ + +354 +rc + = + `gai_�r� +( +cڋxt +-> +adns +); + +355 if( +rc + =� +EAI_INPROGRESS +){ + +357 }if( +rc + == 0){ + +358 +rc + = + `bridge__c���_��2 +( +db +, +cڋxt +); + +359 if( +rc + =� +MOSQ_ERR_SUCCESS +){ + +360 #ifde� +WITH_EPOLL + + +361 +ev +. +d�a +. +fd + = +cڋxt +-> +sock +; + +362 +ev +. +ev�ts + = +EPOLLIN +; + +363 if( +cڋxt +-> +cu��t_out_�ck� +){ + +364 +ev +. +ev�ts + |� +EPOLLOUT +; + +366 if( + `��l_�l +( +db +-> +��lfd +, +EPOLL_CTL_ADD +, +cڋxt +-> +sock +, & +ev +) == -1) { + +367 if(( +��o + !� +EEXIST +)||( + `��l_�l +( +db +-> +��lfd +, +EPOLL_CTL_MOD +, +cڋxt +-> +sock +, & +ev +) == -1)) { + +368 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "E�� i���Ȼ-�gi���g bridge: %s", + `���� +( +��o +)); + +371 +cڋxt +-> +ev�ts + = +ev +.events; + +374 +p�lfds +[ +p�lfd_�dex +]. +fd + = +cڋxt +-> +sock +; + +375 +p�lfds +[ +p�lfd_�dex +]. +ev�ts + = +POLLIN +; + +376 +p�lfds +[ +p�lfd_�dex +]. +�v�ts + = 0; + +377 if( +cڋxt +-> +cu��t_out_�ck� +){ + +378 +p�lfds +[ +p�lfd_�dex +]. +ev�ts + |� +POLLOUT +; + +380 +cڋxt +-> +p�lfd_�dex + =�ollfd_index; + +381 +p�lfd_�dex +++; + +383 }if( +rc + =� +MOSQ_ERR_CONN_PENDING +){ + +384 +cڋxt +-> +bridge +-> +���t_t + = 0; + +386 +cڋxt +-> +bridge +-> +cur_add�ss +++; + +387 if( +cڋxt +-> +bridge +-> +cur_add�ss + =�cڋxt->bridge-> +add�ss_cou� +){ + +388 +cڋxt +-> +bridge +-> +cur_add�ss + = 0; + +390 +cڋxt +-> +bridge +-> +���t_t + = 0; + +394 if( +cڋxt +-> +adns +-> +�_�su� +){ + +395 + `�addr�fo +( +cڋxt +-> +adns +-> +�_�su� +); + +397 + `mosqu�to__� +( +cڋxt +-> +adns +); + +398 +cڋxt +-> +adns + = +NULL +; + +399 +cڋxt +-> +bridge +-> +���t_t + = 0; + +402 #ifde� +WITH_EPOLL + + +404 +cڋxt +-> +ev�ts + = 0; + +406 +rc + = + `bridge__c���_��1 +( +db +, +cڋxt +); + +407 if( +rc +){ + +408 +cڋxt +-> +bridge +-> +cur_add�ss +++; + +409 if( +cڋxt +-> +bridge +-> +cur_add�ss + =�cڋxt->bridge-> +add�ss_cou� +){ + +410 +cڋxt +-> +bridge +-> +cur_add�ss + = 0; + +414 +cڋxt +-> +bridge +-> +���t_t + = 1; + +419 +rc + = + `bridge__c��� +( +db +, +cڋxt +); + +420 +cڋxt +-> +bridge +-> +���t_t + = 0; + +421 if( +rc + =� +MOSQ_ERR_SUCCESS +){ + +422 if( +cڋxt +-> +bridge +-> +round_rob� + =� +�l� + && cڋxt->bridge-> +cur_add�ss + != 0){ + +423 +cڋxt +-> +bridge +-> +�im�y_��y + = +now + + 5; + +425 #ifde� +WITH_EPOLL + + +426 +ev +. +d�a +. +fd + = +cڋxt +-> +sock +; + +427 +ev +. +ev�ts + = +EPOLLIN +; + +428 if( +cڋxt +-> +cu��t_out_�ck� +){ + +429 +ev +. +ev�ts + |� +EPOLLOUT +; + +431 if( + `��l_�l +( +db +-> +��lfd +, +EPOLL_CTL_ADD +, +cڋxt +-> +sock +, & +ev +) == -1) { + +432 if(( +��o + !� +EEXIST +)||( + `��l_�l +( +db +-> +��lfd +, +EPOLL_CTL_MOD +, +cڋxt +-> +sock +, & +ev +) == -1)) { + +433 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "E�� i���Ȼ-�gi���g bridge: %s", + `���� +( +��o +)); + +436 +cڋxt +-> +ev�ts + = +ev +.events; + +439 +p�lfds +[ +p�lfd_�dex +]. +fd + = +cڋxt +-> +sock +; + +440 +p�lfds +[ +p�lfd_�dex +]. +ev�ts + = +POLLIN +; + +441 +p�lfds +[ +p�lfd_�dex +]. +�v�ts + = 0; + +442 if( +cڋxt +-> +cu��t_out_�ck� +){ + +443 +p�lfds +[ +p�lfd_�dex +]. +ev�ts + |� +POLLOUT +; + +445 +cڋxt +-> +p�lfd_�dex + =�ollfd_index; + +446 +p�lfd_�dex +++; + +449 +cڋxt +-> +bridge +-> +cur_add�ss +++; + +450 if( +cڋxt +-> +bridge +-> +cur_add�ss + =�cڋxt->bridge-> +add�ss_cou� +){ + +451 +cڋxt +-> +bridge +-> +cur_add�ss + = 0; + +461 +now + = + `time +( +NULL +); + +462 if( +db +-> +c�fig +-> +�rsi��t_���_exp��i� + > 0 && +now + > +exp��i�_check_time +){ + +463 + `HASH_ITER +( +hh_id +, +db +-> +cڋxts_by_id +, +cڋxt +, +�xt_tmp +){ + +464 if( +cڋxt +-> +sock + =� +INVALID_SOCKET + && cڋxt-> +�ssi�_exp�y_��rv� + > 0 && cڋxt->�ssi�_exp�y_��rv� !� +UINT32_MAX +){ + +470 if( +now + > +cڋxt +-> +�ssi�_exp�y_time +){ + +471 if( +cڋxt +-> +id +){ + +472 +id + = +cڋxt +->id; + +474 +id + = "<unknown>"; + +476 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "Exp��g��si������ %�du�t�timeout.", +id +); + +477 + `G_CLIENTS_EXPIRED_INC +(); + +478 +cڋxt +-> +�ssi�_exp�y_��rv� + = 0; + +479 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_exp��g +); + +480 + `do_disc��� +( +db +, +cڋxt +, +MOSQ_ERR_SUCCESS +); + +484 +exp��i�_check_time + = + `time +( +NULL +) + 3600; + +487 #i�de� +WIN32 + + +488 + `sig�ocmask +( +SIG_SETMASK +, & +sigblock +, & +�igsig +); + +489 #ifde� +WITH_EPOLL + + +490 +fdcou� + = + `��l_wa� +( +db +-> +��lfd +, +ev�ts +, +MAX_EVENTS +, 100); + +492 +fdcou� + = + `p�l +( +p�lfds +, +p�lfd_�dex +, 100); + +494 + `sig�ocmask +( +SIG_SETMASK +, & +�igsig +, +NULL +); + +496 +fdcou� + = + `WSAP�l +( +p�lfds +, +p�lfd_�dex +, 100); + +498 #ifde� +WITH_EPOLL + + +499 +fdcou� +){ + +501 if( +��o + !� +EINTR +){ + +502 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� i����wa��g: %s.", + `���� +( +��o +)); + +508 +i +=0; i< +fdcou� +; i++){ + +509 +j +=0; j< +li��sock_cou� +; j++){ + +510 i�( +ev�ts +[ +i +]. +d�a +. +fd + =� +li��sock +[ +j +]) { + +511 i�( +ev�ts +[ +i +].ev�t�& ( +EPOLLIN + | +EPOLLPRI +)){ + +512 ( +ev +. +d�a +. +fd + = + `�t__sock�_ac�� +( +db +, +li��sock +[ +j +])) != -1){ + +513 +ev +. +ev�ts + = +EPOLLIN +; + +514 i�( + `��l_�l +( +db +-> +��lfd +, +EPOLL_CTL_ADD +, +ev +. +d�a +. +fd +, &ev) == -1) { + +515 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� i����ac���g: %s", + `���� +( +��o +)); + +517 +cڋxt + = +NULL +; + +518 + `HASH_FIND +( +hh_sock +, +db +-> +cڋxts_by_sock +, &( +ev +. +d�a +. +fd +), ( +mosq_sock_t +), +cڋxt +); + +519 if(! +cڋxt +) { + +520 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error in�poll�ccepting:�o context"); + +522 +cڋxt +-> +ev�ts + = +EPOLLIN +; + +528 i�( +j + =� +li��sock_cou� +) { + +529 + `lo�_h�d�_�ads_wr�es +( +db +, +ev�ts +[ +i +]. +d�a +. +fd +,�vents[i].events); + +534 if( +fdcou� + == -1){ + +535 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� i�p�l: %s.", + `���� +( +��o +)); + +537 + `lo�_h�d�_�ads_wr�es +( +db +, +p�lfds +); + +539 +i +=0; i< +li��sock_cou� +; i++){ + +540 if( +p�lfds +[ +i +]. +�v�ts + & ( +POLLIN + | +POLLPRI +)){ + +541 + `�t__sock�_ac�� +( +db +, +li��sock +[ +i +]) != -1){ + +547 +now + = + `time +( +NULL +); + +548 + `�ssi�_exp�y__check +( +db +, +now +); + +549 + `w�l_d�ay__check +( +db +, +now +); + +550 #ifde� +WITH_PERSISTENCE + + +551 if( +db +-> +c�fig +-> +�rsi��� + && db->c�fig-> +auto�ve_��rv� +){ + +552 if( +db +-> +c�fig +-> +auto�ve_�_ch�ges +){ + +553 if( +db +-> +�rsi���_ch�ges + >�db-> +c�fig +-> +auto�ve_��rv� +){ + +554 + `�rsi�__backup +( +db +, +�l� +); + +555 +db +-> +�rsi���_ch�ges + = 0; + +558 if( +ϡ_backup + + +db +-> +c�fig +-> +auto�ve_��rv� + < + `mosqu�to_time +()){ + +559 + `�rsi�__backup +( +db +, +�l� +); + +560 +ϡ_backup + = + `mosqu�to_time +(); + +566 #ifde� +WITH_PERSISTENCE + + +567 if( +�ag_db_backup +){ + +568 + `�rsi�__backup +( +db +, +�l� +); + +569 +�ag_db_backup + = +�l� +; + +572 if( +�ag_�l�d +){ + +573 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "Reloading config."); + +574 + `c�fig__�ad +( +db +, db-> +c�fig +, +�ue +); + +575 + `mosqu�to_�cur�y_��nup +( +db +, +�ue +); + +576 + `mosqu�to_�cur�y_�� +( +db +, +�ue +); + +577 + `mosqu�to_�cur�y_��y +( +db +); + +578 + `log__�o� +( +db +-> +c�fig +); + +579 + `log__�� +( +db +-> +c�fig +); + +580 +�ag_�l�d + = +�l� +; + +582 if( +�ag_��_��t +){ + +583 + `sub__��_��t +( +db +-> +subs +, 0); + +584 +�ag_��_��t + = +�l� +; + +586 #ifde� +WITH_WEBSOCKETS + + +587 +i +=0; i< +db +-> +c�fig +-> +li���_cou� +; i++){ + +592 if( +db +-> +c�fig +-> +li���s +[ +i +]. +ws_cڋxt +){ + +593 + `libwebsock�_�rvi� +( +db +-> +c�fig +-> +li���s +[ +i +]. +ws_cڋxt +, 0); + +596 if( +db +-> +c�fig +-> +have_websock�s_li��� +){ + +597 + `�mp__exp�e_websock�s_���s +( +db +); + +602 #ifde� +WITH_EPOLL + + +603 (� + `�o� +( +db +-> +��lfd +); + +604 +db +-> +��lfd + = 0; + +606 + `mosqu�to__� +( +p�lfds +); + +608 +MOSQ_ERR_SUCCESS +; + +609 + } +} + +611 + $do_disc��� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +�as� +) + +613 * +id +; + +614 #ifde� +WITH_EPOLL + + +615 +��l_ev�t + +ev +; + +617 #ifde� +WITH_WEBSOCKETS + + +618 +bo� + +is_du�i�� + = +�l� +; + +621 if( +cڋxt +-> +��e + =� +mosq_cs_disc���ed +){ + +624 #ifde� +WITH_WEBSOCKETS + + +625 if( +cڋxt +-> +wsi +){ + +626 if( +cڋxt +-> +��e + =� +mosq_cs_du�i�� +){ + +627 +is_du�i�� + = +�ue +; + +630 if( +cڋxt +-> +��e + !� +mosq_cs_disc����g + && cڋxt->���!� +mosq_cs_disc���_w�h_w�l +){ + +631 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_disc���_ws +); + +633 if( +cڋxt +-> +wsi +){ + +634 + `libwebsock�_��back_�_wr�ab� +( +cڋxt +-> +ws_cڋxt +, cڋxt-> +wsi +); + +636 if( +cڋxt +-> +sock + !� +INVALID_SOCKET +){ + +637 + `HASH_DELETE +( +hh_sock +, +db +-> +cڋxts_by_sock +, +cڋxt +); + +638 #ifde� +WITH_EPOLL + + +639 i�( + `��l_�l +( +db +-> +��lfd +, +EPOLL_CTL_DEL +, +cڋxt +-> +sock +, & +ev +) == -1) { + +640 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "E�� i����disc����g websock�s: %s", + `���� +( +��o +)); + +643 +cڋxt +-> +sock + = +INVALID_SOCKET +; + +644 +cڋxt +-> +p�lfd_�dex + = -1; + +646 if( +is_du�i�� +){ + +653 + `cڋxt__�move_�om_by_id +( +db +, +cڋxt +); + +658 if( +db +-> +c�fig +-> +c���i�_mes�ges + =� +�ue +){ + +659 if( +cڋxt +-> +id +){ + +660 +id + = +cڋxt +->id; + +662 +id + = "<unknown>"; + +664 if( +cڋxt +-> +��e + !� +mosq_cs_disc����g + && cڋxt->���!� +mosq_cs_disc���_w�h_w�l +){ + +665 +�as� +){ + +666 +MOSQ_ERR_SUCCESS +: + +668 +MOSQ_ERR_PROTOCOL +: + +669 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "Cl�� %�disc���ed du�tش�ocރ��.", +id +); + +671 +MOSQ_ERR_CONN_LOST +: + +672 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "Sock���� o���� %s, disc����g.", +id +); + +674 +MOSQ_ERR_AUTH +: + +675 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "Cl�� %�disc���ed,��l�g��uth�i�d.", +id +); + +677 +MOSQ_ERR_KEEPALIVE +: + +678 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "Cl�� %�ha�ex�eded�imeout, disc����g.", +id +); + +681 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "Sock���� o���� %s, disc����g.", +id +); + +685 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "Cl�� %�disc���ed.", +id +); + +688 #ifde� +WITH_EPOLL + + +689 i�( +cڋxt +-> +sock + !� +INVALID_SOCKET + && + `��l_�l +( +db +-> +��lfd +, +EPOLL_CTL_DEL +, cڋxt->sock, & +ev +) == -1) { + +690 if( +db +-> +c�fig +-> +c���i�_mes�ges + =� +�ue +){ + +691 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "E�� i����disc����g: %s", + `���� +( +��o +)); + +695 + `cڋxt__disc��� +( +db +, +cڋxt +); + +697 + } +} + +700 #ifde� +WITH_EPOLL + + +701 + $lo�_h�d�_�ads_wr�es +( +mosqu�to_db + * +db +, +mosq_sock_t + +sock +, +u�t32_t + +ev�ts +) + +703 + $lo�_h�d�_�ads_wr�es +( +mosqu�to_db + * +db +, +p�lfd + * +p�lfds +) + +706 +mosqu�to + * +cڋxt +; + +707 #i�de� +WITH_EPOLL + + +708 +mosqu�to + * +�xt_tmp +; + +710 +�r +; + +711 +sock�n_t + +�n +; + +713 #ifde� +WITH_EPOLL + + +714 +i +; + +715 +cڋxt + = +NULL +; + +716 + `HASH_FIND +( +hh_sock +, +db +-> +cڋxts_by_sock +, & +sock +, ( +mosq_sock_t +), +cڋxt +); + +717 if(! +cڋxt +) { + +720 +i +=0;i<1;i++) { + +722 + `HASH_ITER +( +hh_sock +, +db +-> +cڋxts_by_sock +, +cڋxt +, +�xt_tmp +){ + +723 if( +cڋxt +-> +p�lfd_�dex + < 0){ + +727 + `as�� +( +p�lfds +[ +cڋxt +-> +p�lfd_�dex +]. +fd + =�cڋxt-> +sock +); + +730 #ifde� +WITH_WEBSOCKETS + + +731 if( +cڋxt +-> +wsi +){ + +732 +lws_p�lfd + +w��l +; + +733 #ifde� +WITH_EPOLL + + +734 +w��l +. +fd + = +cڋxt +-> +sock +; + +735 +w��l +. +ev�ts + = +cڋxt +->events; + +736 +w��l +. +�v�ts + = +ev�ts +; + +738 +w��l +. +fd + = +p�lfds +[ +cڋxt +-> +p�lfd_�dex +].fd; + +739 +w��l +. +ev�ts + = +p�lfds +[ +cڋxt +-> +p�lfd_�dex +].events; + +740 +w��l +. +�v�ts + = +p�lfds +[ +cڋxt +-> +p�lfd_�dex +].revents; + +742 #ifde� +LWS_LIBRARY_VERSION_NUMBER + + +743 + `lws_�rvi�_fd +( + `lws_g�_cڋxt +( +cڋxt +-> +wsi +), & +w��l +); + +745 + `lws_�rvi�_fd +( +cڋxt +-> +ws_cڋxt +, & +w��l +); + +751 #ifde� +WITH_TLS + + +752 #ifde� +WITH_EPOLL + + +753 if( +ev�ts + & +EPOLLOUT + || + +755 if( +p�lfds +[ +cڋxt +-> +p�lfd_�dex +]. +�v�ts + & +POLLOUT + || + +757 +cڋxt +-> +w�t_wr�e + || + +758 ( +cڋxt +-> +s� + && cڋxt-> +��e + =� +mosq_cs_�w +)){ + +760 #ifde� +WITH_EPOLL + + +761 if( +ev�ts + & +EPOLLOUT +){ + +763 if( +p�lfds +[ +cڋxt +-> +p�lfd_�dex +]. +�v�ts + & +POLLOUT +){ + +766 if( +cڋxt +-> +��e + =� +mosq_cs_c���_�nd�g +){ + +767 +�n + = (); + +768 if(! + `g�sock�t +( +cڋxt +-> +sock +, +SOL_SOCKET +, +SO_ERROR +, (*)& +�r +, & +�n +)){ + +769 if( +�r + == 0){ + +770 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_�w +); + +771 #i� + `def�ed +( +WITH_ADNS +�&& def�ed( +WITH_BRIDGE +) + +772 if( +cڋxt +-> +bridge +){ + +773 + `bridge__c���_��3 +( +db +, +cڋxt +); + +779 + `do_disc��� +( +db +, +cڋxt +, +MOSQ_ERR_CONN_LOST +); + +783 if( + `�ck�__wr�e +( +cڋxt +)){ + +784 + `do_disc��� +( +db +, +cڋxt +, +MOSQ_ERR_CONN_LOST +); + +790 #ifde� +WITH_EPOLL + + +791 +cڋxt + = +NULL +; + +792 + `HASH_FIND +( +hh_sock +, +db +-> +cڋxts_by_sock +, & +sock +, ( +mosq_sock_t +), +cڋxt +); + +793 if(! +cڋxt +) { + +796 +i +=0;i<1;i++) { + +798 + `HASH_ITER +( +hh_sock +, +db +-> +cڋxts_by_sock +, +cڋxt +, +�xt_tmp +){ + +799 if( +cڋxt +-> +p�lfd_�dex + < 0){ + +803 #ifde� +WITH_WEBSOCKETS + + +804 if( +cڋxt +-> +wsi +){ + +810 #ifde� +WITH_TLS + + +811 #ifde� +WITH_EPOLL + + +812 if( +ev�ts + & +EPOLLIN + || + +814 if( +p�lfds +[ +cڋxt +-> +p�lfd_�dex +]. +�v�ts + & +POLLIN + || + +816 ( +cڋxt +-> +s� + && cڋxt-> +��e + =� +mosq_cs_�w +)){ + +818 #ifde� +WITH_EPOLL + + +819 if( +ev�ts + & +EPOLLIN +){ + +821 if( +p�lfds +[ +cڋxt +-> +p�lfd_�dex +]. +�v�ts + & +POLLIN +){ + +825 if( + `�ck�__�ad +( +db +, +cڋxt +)){ + +826 + `do_disc��� +( +db +, +cڋxt +, +MOSQ_ERR_CONN_LOST +); + +829 } + `SSL_DATA_PENDING +( +cڋxt +)); + +831 #ifde� +WITH_EPOLL + + +832 if( +ev�ts + & ( +EPOLLERR + | +EPOLLHUP +)){ + +834 if( +cڋxt +-> +p�lfd_�dex + >�0 && +p�lfds +[cڋxt->p�lfd_�dex]. +�v�ts + & ( +POLLERR + | +POLLNVAL + | +POLLHUP +)){ + +836 + `do_disc��� +( +db +, +cڋxt +, +MOSQ_ERR_CONN_LOST +); + +841 + } +} + + @src/mosquitto.c + +17 + ~"c�fig.h +" + +19 #i�de� +WIN32 + + +21 + ~<uni�d.h +> + +22 + ~<g�.h +> + +23 + ~<as��.h +> + +26 #i�de� +WIN32 + + +27 + ~<pwd.h +> + +29 + ~<�o�ss.h +> + +30 + ~<w�sock2.h +> + +31 + ~<ws2t��.h +> + +34 #i�de� +WIN32 + + +35 + ~<sys/time.h +> + +38 + ~<��o.h +> + +39 + ~<sig�l.h +> + +40 + ~<�dio.h +> + +41 + ~<�r�g.h +> + +42 #ifde� +WITH_SYSTEMD + + +43 + ~<sy�emd/sd-d�m�.h +> + +45 #ifde� +WITH_WRAP + + +46 + ~<t�d.h +> + +48 #ifde� +WITH_WEBSOCKETS + + +49 + ~<libwebsock�s.h +> + +52 + ~"mosqu�to_brok�_����.h +" + +53 + ~"mem�y_mosq.h +" + +54 + ~"ut�_mosq.h +" + +56 +mosqu�to_db + + g�t_db +; + +58 +bo� + + g�ag_�l�d + = +�l� +; + +59 #ifde� +WITH_PERSISTENCE + + +60 +bo� + + g�ag_db_backup + = +�l� +; + +62 +bo� + + g�ag_��_��t + = +�l� +; + +63 + grun +; + +64 #ifde� +WITH_WRAP + + +65 + ~<sy�og.h +> + +66 + g�low_�v��y + = +LOG_INFO +; + +67 + gd�y_�v��y + = +LOG_INFO +; + +70 +h�d�_sig�t +( +sig�l +); + +71 +h�d�_sigu�1 +( +sig�l +); + +72 +h�d�_sigu�2 +( +sig�l +); + +73 #ifde� +SIGHUP + + +74 +h�d�_sighup +( +sig�l +); + +77 +mosqu�to_db + * + $mosqu�to__g�_db +() + +79 & +�t_db +; + +80 + } +} + +90 + $dr�_�iv�eges +( +mosqu�to__c�fig + * +c�fig +, +bo� + +�mpܬy +) + +92 #i�! + `def�ed +( +__CYGWIN__ +�&& !def�ed( +WIN32 +) + +93 +�sswd + * +pwd +; + +94 * +�r +; + +95 +rc +; + +97 cڡ * +�� + = + `g��v +("SNAP_NAME"); + +98 if( +�� + && ! + `�rcmp +(snap, "mosquitto")){ + +100 +MOSQ_ERR_SUCCESS +; + +103 if( + `g�euid +() == 0){ + +104 if( +c�fig +-> +u�r + && + `�rcmp +(config->user, "root")){ + +105 +pwd + = + `g�pw�m +( +c�fig +-> +u�r +); + +106 if(! +pwd +){ + +107 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id u��'%s'.", +c�fig +-> +u�r +); + +110 if( + `��groups +( +c�fig +-> +u�r +, +pwd +-> +pw_gid +) == -1){ + +111 +�r + = + `���� +( +��o +); + +112 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� s�t�g group�wh�� dr�p�g�riv�eges: %s.", +�r +); + +115 if( +�mpܬy +){ + +116 +rc + = + `��gid +( +pwd +-> +pw_gid +); + +118 +rc + = + `�tgid +( +pwd +-> +pw_gid +); + +120 if( +rc + == -1){ + +121 +�r + = + `���� +( +��o +); + +122 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� s�t�g gid wh�� dr�p�g�riv�eges: %s.", +�r +); + +125 if( +�mpܬy +){ + +126 +rc + = + `��uid +( +pwd +-> +pw_uid +); + +128 +rc + = + `�tuid +( +pwd +-> +pw_uid +); + +130 if( +rc + == -1){ + +131 +�r + = + `���� +( +��o +); + +132 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� s�t�g uid wh�� dr�p�g�riv�eges: %s.", +�r +); + +136 if( + `g�euid +(�=�0 || + `g�egid +() == 0){ + +137 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Mosquitto should�ot be�un�s�oot/administrator."); + +141 +MOSQ_ERR_SUCCESS +; + +142 + } +} + +144 + $���e_�iv�eges +() + +146 #i�! + `def�ed +( +__CYGWIN__ +�&& !def�ed( +WIN32 +) + +147 * +�r +; + +148 +rc +; + +150 if( + `g�uid +() == 0){ + +151 +rc + = + `��gid +(0); + +152 if( +rc + == -1){ + +153 +�r + = + `���� +( +��o +); + +154 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� s�t�g gid wh���e�ܚg�riv�eges: %s.", +�r +); + +157 +rc + = + `��uid +(0); + +158 if( +rc + == -1){ + +159 +�r + = + `���� +( +��o +); + +160 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� s�t�g uid wh���e�ܚg�riv�eges: %s.", +�r +); + +165 +MOSQ_ERR_SUCCESS +; + +166 + } +} + +169 + $mosqu�to__d�m�i� +() + +171 #i�de� +WIN32 + + +172 * +�r +; + +173 +pid_t + +pid +; + +175 +pid + = + `f�k +(); + +176 if( +pid + < 0){ + +177 +�r + = + `���� +( +��o +); + +178 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� i�f�k: %s", +�r +); + +179 + `ex� +(1); + +181 if( +pid + > 0){ + +182 + `ex� +(0); + +184 if( + `�tsid +() < 0){ + +185 +�r + = + `���� +( +��o +); + +186 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� i��tsid: %s", +�r +); + +187 + `ex� +(1); + +190 + `as�� +( + `�eݒ +("/dev/nu�", "r", +�d� +)); + +191 + `as�� +( + `�eݒ +("/dev/nu�", "w", +�dout +)); + +192 + `as�� +( + `�eݒ +("/dev/nu�", "w", +�d�r +)); + +194 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Can't start in daemon mode in Windows."); + +196 + } +} + +199 + $ma� +( +�gc +, * +�gv +[]) + +201 +mosq_sock_t + * +li��sock + = +NULL +; + +202 +li��sock_cou� + = 0; + +203 +li��sock_�dex + = 0; + +204 +mosqu�to__c�fig + +c�fig +; + +205 +i +, +j +; + +206 +FILE + * +pid +; + +207 +rc +; + +208 #ifde� +WIN32 + + +209 +SYSTEMTIME + +� +; + +211 +timev� + +tv +; + +213 +mosqu�to + * +�xt +, * +�xt_tmp +; + +215 #i� + `def�ed +( +WIN32 +�|| def�ed( +__CYGWIN__ +) + +216 if( +�gc + == 2){ + +217 if(! + `�rcmp +( +�gv +[1], "run")){ + +218 + `�rvi�_run +(); + +220 }if(! + `�rcmp +( +�gv +[1], "install")){ + +221 + `�rvi�_���l +(); + +223 }if(! + `�rcmp +( +�gv +[1], "uninstall")){ + +224 + `�rvi�_un���l +(); + +231 #ifde� +WIN32 + + +232 + `G�Sy�emTime +(& +� +); + +233 + `��d +( +� +. +wSec�d + + st. +wM�li�c�ds +); + +235 + `g�timeofday +(& +tv +, +NULL +); + +236 + `��d +( +tv +. +tv_�c + +�v. +tv_u�c +); + +239 #ifde� +WIN32 + + +240 + `_�tmax�dio +(2048); + +243 + `mem�t +(& +�t_db +, 0, ( +mosqu�to_db +)); + +245 + `�t__brok�_�� +(); + +247 + `c�fig__�� +(& +�t_db +, & +c�fig +); + +248 +rc + = + `c�fig__�r�_�gs +(& +�t_db +, & +c�fig +, +�gc +, +�gv +); + +249 if( +rc + !� +MOSQ_ERR_SUCCESS +) �c; + +250 +�t_db +. +c�fig + = &config; + +252 if( +c�fig +. +d�m� +){ + +253 + `mosqu�to__d�m�i� +(); + +256 if( +c�fig +. +d�m� + && c�fig. +pid_f�e +){ + +257 +pid + = + `mosqu�to__fݒ +( +c�fig +. +pid_f�e +, "wt", +�l� +); + +258 if( +pid +){ + +259 + `�r�tf +( +pid +, "%d", + `g�pid +()); + +260 + `f�o� +( +pid +); + +262 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Unable�o write�id file."); + +267 +rc + = + `db__ݒ +(& +c�fig +, & +�t_db +); + +268 if( +rc + !� +MOSQ_ERR_SUCCESS +){ + +269 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Couldn't open database."); + +270 +rc +; + +275 if( + `log__�� +(& +c�fig +)){ + +276 +rc + = 1; + +277 +rc +; + +279 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "mosqu�t�v�si� %���t�g", +VERSION +); + +280 if( +�t_db +. +c�fig_f�e +){ + +281 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "C�fig��ded from %s.", +�t_db +. +c�fig_f�e +); + +283 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "Using default config."); + +286 +rc + = + `mosqu�to_�cur�y_modu�_�� +(& +�t_db +); + +287 if( +rc +) �c; + +288 +rc + = + `mosqu�to_�cur�y_�� +(& +�t_db +, +�l� +); + +289 if( +rc +) �c; + +291 #ifde� +WITH_SYS_TREE + + +292 + `sys_��__�� +(& +�t_db +); + +295 +li��sock_�dex + = 0; + +296 +i +=0; i< +c�fig +. +li���_cou� +; i++){ + +297 if( +c�fig +. +li���s +[ +i +]. +��oc� + =� +mp_mq� +){ + +298 if( + `�t__sock�_li�� +(& +c�fig +. +li���s +[ +i +])){ + +299 + `db__�o� +(& +�t_db +); + +300 if( +c�fig +. +pid_f�e +){ + +301 + `�move +( +c�fig +. +pid_f�e +); + +305 +li��sock_cou� + +� +c�fig +. +li���s +[ +i +]. +sock_cou� +; + +306 +li��sock + = + `mosqu�to__��loc +�i��sock, ( +mosq_sock_t +)* +li��sock_cou� +); + +307 if(! +li��sock +){ + +308 + `db__�o� +(& +�t_db +); + +309 if( +c�fig +. +pid_f�e +){ + +310 + `�move +( +c�fig +. +pid_f�e +); + +314 +j +=0; j< +c�fig +. +li���s +[ +i +]. +sock_cou� +; j++){ + +315 if( +c�fig +. +li���s +[ +i +]. +socks +[ +j +] =� +INVALID_SOCKET +){ + +316 + `db__�o� +(& +�t_db +); + +317 if( +c�fig +. +pid_f�e +){ + +318 + `�move +( +c�fig +. +pid_f�e +); + +322 +li��sock +[ +li��sock_�dex +] = +c�fig +. +li���s +[ +i +]. +socks +[ +j +]; + +323 +li��sock_�dex +++; + +325 }if( +c�fig +. +li���s +[ +i +]. +��oc� + =� +mp_websock�s +){ + +326 #ifde� +WITH_WEBSOCKETS + + +327 +c�fig +. +li���s +[ +i +]. +ws_cڋxt + = + `mosq_websock�s_�� +(&config.listeners[i], &config); + +328 if(! +c�fig +. +li���s +[ +i +]. +ws_cڋxt +){ + +329 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: U�bˁ���� websock��li��� o�p܈%d.", +c�fig +. +li���s +[ +i +]. +p�t +); + +336 +rc + = + `dr�_�iv�eges +(& +c�fig +, +�l� +); + +337 if( +rc + !� +MOSQ_ERR_SUCCESS +) �c; + +339 + `sig�l +( +SIGINT +, +h�d�_sig�t +); + +340 + `sig�l +( +SIGTERM +, +h�d�_sig�t +); + +341 #ifde� +SIGHUP + + +342 + `sig�l +( +SIGHUP +, +h�d�_sighup +); + +344 #i�de� +WIN32 + + +345 + `sig�l +( +SIGUSR1 +, +h�d�_sigu�1 +); + +346 + `sig�l +( +SIGUSR2 +, +h�d�_sigu�2 +); + +347 + `sig�l +( +SIGPIPE +, +SIG_IGN +); + +349 #ifde� +WIN32 + + +350 + `C��eTh�ad +( +NULL +, 0, +SigTh�adProc +, NULL, 0, NULL); + +353 #ifde� +WITH_BRIDGE + + +354 +i +=0; i< +c�fig +. +bridge_cou� +; i++){ + +355 if( + `bridge__�w +(& +�t_db +, &( +c�fig +. +bridges +[ +i +]))){ + +356 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Unable�o connect�o bridge %s.", + +357 +c�fig +. +bridges +[ +i +]. +�me +); + +362 #ifde� +WITH_SYSTEMD + + +363 + `sd_n�ify +(0, "READY=1"); + +366 +run + = 1; + +367 +rc + = + `mosqu�to_ma�_lo� +(& +�t_db +, +li��sock +, +li��sock_cou� +); + +369 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "mosqu�t�v�si� %��rm���g", +VERSION +); + +371 #ifde� +WITH_WEBSOCKETS + + +372 +i +=0; i< +�t_db +. +c�fig +-> +li���_cou� +; i++){ + +373 if( +�t_db +. +c�fig +-> +li���s +[ +i +]. +ws_cڋxt +){ + +374 + `libwebsock�_cڋxt_de�roy +( +�t_db +. +c�fig +-> +li���s +[ +i +]. +ws_cڋxt +); + +376 + `mosqu�to__� +( +�t_db +. +c�fig +-> +li���s +[ +i +]. +ws_��oc� +); + +383 + `HASH_ITER +( +hh_id +, +�t_db +. +cڋxts_by_id +, +�xt +, +�xt_tmp +){ + +384 + `cڋxt__�nd_w�l +(& +�t_db +, +�xt +); + +386 + `w�l_d�ay__�nd_�l +(& +�t_db +); + +388 #ifde� +WITH_PERSISTENCE + + +389 if( +c�fig +. +�rsi��� +){ + +390 + `�rsi�__backup +(& +�t_db +, +�ue +); + +393 + `�ssi�_exp�y__�move_�l +(& +�t_db +); + +395 + `HASH_ITER +( +hh_id +, +�t_db +. +cڋxts_by_id +, +�xt +, +�xt_tmp +){ + +396 #ifde� +WITH_WEBSOCKETS + + +397 if(! +�xt +-> +wsi +){ + +398 + `cڋxt__��nup +(& +�t_db +, +�xt +, +�ue +); + +401 + `cڋxt__��nup +(& +�t_db +, +�xt +, +�ue +); + +404 + `HASH_ITER +( +hh_sock +, +�t_db +. +cڋxts_by_sock +, +�xt +, +�xt_tmp +){ + +405 + `cڋxt__��nup +(& +�t_db +, +�xt +, +�ue +); + +407 #ifde� +WITH_BRIDGE + + +408 +i +=0; i< +�t_db +. +bridge_cou� +; i++){ + +409 if( +�t_db +. +bridges +[ +i +]){ + +410 + `cڋxt__��nup +(& +�t_db +, i�_db. +bridges +[ +i +], +�ue +); + +413 + `mosqu�to__� +( +�t_db +. +bridges +); + +415 + `cڋxt__�_disu�d +(& +�t_db +); + +417 + `db__�o� +(& +�t_db +); + +419 if( +li��sock +){ + +420 +i +=0; i< +li��sock_cou� +; i++){ + +421 if( +li��sock +[ +i +] !� +INVALID_SOCKET +){ + +422 #i�de� +WIN32 + + +423 + `�o� +( +li��sock +[ +i +]); + +425 + `�o�sock� +( +li��sock +[ +i +]); + +429 + `mosqu�to__� +( +li��sock +); + +432 + `mosqu�to_�cur�y_modu�_��nup +(& +�t_db +); + +434 if( +c�fig +. +pid_f�e +){ + +435 + `�move +( +c�fig +. +pid_f�e +); + +438 + `log__�o� +(& +c�fig +); + +439 + `c�fig__��nup +( +�t_db +. +c�fig +); + +440 + `�t__brok�_��nup +(); + +442 +rc +; + +443 + } +} + +445 #ifde� +WIN32 + + +446 +WINAPI + + $W�Ma� +( +HINSTANCE + +hIn��� +, HINSTANCE +hP�vIn��� +, +LPSTR + +�CmdL�e +, +nCmdShow +) + +448 ** +�gv +; + +449 +�gc + = 1; + +450 * +tok� +; + +451 * +�v�� + = +NULL +; + +452 +rc +; + +454 +�gv + = + `mosqu�to__m�loc +((*)*1); + +455 +�gv +[0] = "mosquitto"; + +456 +tok� + = + `��ok_r +( +�CmdL�e +, " ", & +�v�� +); + +457 +tok� +){ + +458 +�gc +++; + +459 +�gv + = + `mosqu�to__��loc +�rgv, (*)* +�gc +); + +460 if(! +�gv +){ + +461 + `�r�tf +( +�d�r +, "Error: Out of memory.\n"); + +462 +MOSQ_ERR_NOMEM +; + +464 +�gv +[ +�gc +-1] = +tok� +; + +465 +tok� + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +467 +rc + = + `ma� +( +�gc +, +�gv +); + +468 + `mosqu�to__� +( +�gv +); + +469 +rc +; + +470 + } +} + + @src/mosquitto_broker.h + +17 #i�de� +MOSQUITTO_BROKER_H + + +18 + #MOSQUITTO_BROKER_H + + + ) + +20 #ifde� +__�lu�lus + + +24 + ~<�dbo�.h +> + +26 +mosqu�to +; + +28 + emosqu�to_��oc� + { + +29 +mp_mq� +, + +30 +mp_mq�� +, + +31 +mp_websock�s + + +65 +mosqu�to_log_��tf +( +�v� +, cڡ * +fmt +, ...); + +81 cڡ * +mosqu�to_���_add�ss +(cڡ +mosqu�to + * +��� +); + +89 +bo� + +mosqu�to_���_��n_�ssi� +(cڡ +mosqu�to + * +��� +); + +97 cڡ * +mosqu�to_���_id +(cڡ +mosqu�to + * +��� +); + +105 +mosqu�to_���_k��live +(cڡ +mosqu�to + * +��� +); + +118 * +mosqu�to_���_��ifi�� +(cڡ +mosqu�to + * +��� +); + +130 +mosqu�to_���_��oc� +(cڡ +mosqu�to + * +��� +); + +138 +mosqu�to_���_sub_cou� +(cڡ +mosqu�to + * +��� +); + +146 cڡ * +mosqu�to_���_u��ame +(cڡ +mosqu�to + * +��� +); + +166 +mosqu�to_�t_u��ame +( +mosqu�to + * +��� +, cڡ * +u��ame +); + +168 #ifde� +__�lu�lus + + + @src/mosquitto_broker_internal.h + +18 #i�de� +MOSQUITTO_BROKER_INTERNAL_H + + +19 + #MOSQUITTO_BROKER_INTERNAL_H + + + ) + +21 + ~"c�fig.h +" + +22 + ~<�dio.h +> + +24 #ifde� +WITH_WEBSOCKETS + + +25 + ~<libwebsock�s.h +> + +27 #i� +def�ed +( +LWS_LIBRARY_VERSION_NUMBER +) + +28 + #libwebsock�_��back_�_wr�ab� +( +A +, +B +� + `lws_��back_�_wr�ab� +((B)) + + ) + +29 + #libwebsock�_�rvi� +( +A +, +B +� + `lws_�rvi� +((A), (B)) + + ) + +30 + #libwebsock�_���_cڋxt +( +A +� + `lws_���_cڋxt +((A)) + + ) + +31 + #libwebsock�_cڋxt_de�roy +( +A +� + `lws_cڋxt_de�roy +((A)) + + ) + +32 + #libwebsock�_wr�e +( +A +, +B +, +C +, +D +� + `lws_wr�e +((A), (B), (C), (D)) + + ) + +33 + #libwebsock�_g�_sock�_fd +( +A +� + `lws_g�_sock�_fd +((A)) + + ) + +34 + #libwebsock�s_�tu�_h�p_��us +( +A +, +B +, +C +, +D +� + `lws_�tu�_h�p_��us +((B), (C), (D)) + + ) + +35 + #libwebsock�s_g�_��oc� +( +A +� + `lws_g�_��oc� +((A)) + + ) + +36 + #libwebsock�_cڋxt + +lws_cڋxt + + + ) + +37 + #libwebsock�_��oc�s + +lws_��oc�s + + + ) + +38 + #libwebsock�_��back_�as�s + +lws_��back_�as�s + + + ) + +39 + #libwebsock� + +lws + + + ) + +41 + #lws_p�lfd + +p�lfd + + + ) + +42 + #lws_�rvi�_fd +( +A +, +B +� + `libwebsock�_�rvi�_fd +((A), (B)) + + ) + +43 + #lws_p��rgs + +libwebsock�_p��rgs + + + ) + +47 + ~"mosqu�to_����.h +" + +48 + ~"mosqu�to_brok�.h +" + +49 + ~"mosqu�to_�ug�.h +" + +50 + ~"mosqu�to.h +" + +51 + ~"�s_mosq.h +" + +52 + ~"uthash.h +" + +54 + #uh�_m�loc +( +size +� + `mosqu�to__m�loc +(size) + + ) + +55 + #uh�_� +( +�r +� + `mosqu�to__� +Ռ) + + ) + +56 + ~"uh�.h +" + +58 #i�de� +__GNUC__ + + +59 + #__��ibu�__ +( +��ib +) + + ) + +63 + #MQTT3_LOG_NONE + 0x00 + + ) + +64 + #MQTT3_LOG_SYSLOG + 0x01 + + ) + +65 + #MQTT3_LOG_FILE + 0x02 + + ) + +66 + #MQTT3_LOG_STDOUT + 0x04 + + ) + +67 + #MQTT3_LOG_STDERR + 0x08 + + ) + +68 + #MQTT3_LOG_TOPIC + 0x10 + + ) + +69 + #MQTT3_LOG_ALL + 0xFF + + ) + +71 + #WEBSOCKET_CLIENT + -2 + + ) + +118 + #MOSQ_PAYLOAD_UNION_SIZE + 8 + + ) + +120 * + m�r +; + +121 + m��y +[ +MOSQ_PAYLOAD_UNION_SIZE +]; + +122 } + tmosqu�to__�yl�d_uh� +; + +123 + #UHPA_ALLOC_PAYLOAD +( +A +� + `UHPA_ALLOC +((A)-> +�yl�d +, (A)-> +�yl�d�n +) + + ) + +124 + #UHPA_ACCESS_PAYLOAD +( +A +� + `UHPA_ACCESS +((A)-> +�yl�d +, (A)-> +�yl�d�n +) + + ) + +125 + #UHPA_FREE_PAYLOAD +( +A +� + `UHPA_FREE +((A)-> +�yl�d +, (A)-> +�yl�d�n +) + + ) + +126 + #UHPA_MOVE_PAYLOAD +( +DEST +, +SRC +� + `UHPA_MOVE +((DEST)-> +�yl�d +, (SRC)->�yl�d, (SRC)-> +�yl�d�n +) + + ) + +132 +u�t64_t + + tdbid_t +; + +134 (* + tFUNC_auth_�ug�_��_v4 +)(**, + tmosqu�to_�t + *, ); + +135 (* + tFUNC_auth_�ug�_��nup_v4 +)(*, + tmosqu�to_�t + *, ); + +136 (* + tFUNC_auth_�ug�_�cur�y_��_v4 +)(*, + tmosqu�to_�t + *, , + tbo� +); + +137 (* + tFUNC_auth_�ug�_�cur�y_��nup_v4 +)(*, + tmosqu�to_�t + *, , + tbo� +); + +138 (* + tFUNC_auth_�ug�_a�_check_v4 +)(*, , + tmosqu�to + *, + tmosqu�to_a�_msg + *); + +139 (* + tFUNC_auth_�ug�_u�wd_check_v4 +)(*, + tmosqu�to + *, const *, const *); + +140 (* + tFUNC_auth_�ug�_psk_key_g�_v4 +)(*, + tmosqu�to + *, const *, const *, *, ); + +141 (* + tFUNC_auth_�ug�_auth_��t_v4 +)(*, + tmosqu�to + *, cڡ *, + tbo� +, cڡ *, + tu�t16_t +, **, uint16_t *); + +142 (* + tFUNC_auth_�ug�_auth_c�t�ue_v4 +)(*, + tmosqu�to + *, cڡ *, cڡ *, + tu�t16_t +, **, uint16_t *); + +144 (* + tFUNC_auth_�ug�_��_v3 +)(**, + tmosqu�to_�t + *, ); + +145 (* + tFUNC_auth_�ug�_��nup_v3 +)(*, + tmosqu�to_�t + *, ); + +146 (* + tFUNC_auth_�ug�_�cur�y_��_v3 +)(*, + tmosqu�to_�t + *, , + tbo� +); + +147 (* + tFUNC_auth_�ug�_�cur�y_��nup_v3 +)(*, + tmosqu�to_�t + *, , + tbo� +); + +148 (* + tFUNC_auth_�ug�_a�_check_v3 +)(*, , cڡ + tmosqu�to + *, + tmosqu�to_a�_msg + *); + +149 (* + tFUNC_auth_�ug�_u�wd_check_v3 +)(*, cڡ + tmosqu�to + *, const *, const *); + +150 (* + tFUNC_auth_�ug�_psk_key_g�_v3 +)(*, cڡ + tmosqu�to + *, const *, const *, *, ); + +152 (* + tFUNC_auth_�ug�_��_v2 +)(**, + tmosqu�to_auth_�t + *, ); + +153 (* + tFUNC_auth_�ug�_��nup_v2 +)(*, + tmosqu�to_auth_�t + *, ); + +154 (* + tFUNC_auth_�ug�_�cur�y_��_v2 +)(*, + tmosqu�to_auth_�t + *, , + tbo� +); + +155 (* + tFUNC_auth_�ug�_�cur�y_��nup_v2 +)(*, + tmosqu�to_auth_�t + *, , + tbo� +); + +156 (* + tFUNC_auth_�ug�_a�_check_v2 +)(*, const *, const *, const *, ); + +157 (* + tFUNC_auth_�ug�_u�wd_check_v2 +)(*, const *, const *); + +158 (* + tFUNC_auth_�ug�_psk_key_g�_v2 +)(*, const *, const *, *, ); + +161 + emosqu�to_msg_�ig� +{ + +162 +mosq_mo_��� + = 0, + +163 +mosq_mo_brok� + = 1 + +166 + smosqu�to__auth_�ug� +{ + +167 * +lib +; + +168 * +u�r_d�a +; + +169 (* +�ug�_v�si� +)(); + +171 +FUNC_auth_�ug�_��_v4 + +�ug�_��_v4 +; + +172 +FUNC_auth_�ug�_��nup_v4 + +�ug�_��nup_v4 +; + +173 +FUNC_auth_�ug�_�cur�y_��_v4 + +�cur�y_��_v4 +; + +174 +FUNC_auth_�ug�_�cur�y_��nup_v4 + +�cur�y_��nup_v4 +; + +175 +FUNC_auth_�ug�_a�_check_v4 + +a�_check_v4 +; + +176 +FUNC_auth_�ug�_u�wd_check_v4 + +u�wd_check_v4 +; + +177 +FUNC_auth_�ug�_psk_key_g�_v4 + +psk_key_g�_v4 +; + +178 +FUNC_auth_�ug�_auth_��t_v4 + +auth_��t_v4 +; + +179 +FUNC_auth_�ug�_auth_c�t�ue_v4 + +auth_c�t�ue_v4 +; + +181 +FUNC_auth_�ug�_��_v3 + +�ug�_��_v3 +; + +182 +FUNC_auth_�ug�_��nup_v3 + +�ug�_��nup_v3 +; + +183 +FUNC_auth_�ug�_�cur�y_��_v3 + +�cur�y_��_v3 +; + +184 +FUNC_auth_�ug�_�cur�y_��nup_v3 + +�cur�y_��nup_v3 +; + +185 +FUNC_auth_�ug�_a�_check_v3 + +a�_check_v3 +; + +186 +FUNC_auth_�ug�_u�wd_check_v3 + +u�wd_check_v3 +; + +187 +FUNC_auth_�ug�_psk_key_g�_v3 + +psk_key_g�_v3 +; + +189 +FUNC_auth_�ug�_��_v2 + +�ug�_��_v2 +; + +190 +FUNC_auth_�ug�_��nup_v2 + +�ug�_��nup_v2 +; + +191 +FUNC_auth_�ug�_�cur�y_��_v2 + +�cur�y_��_v2 +; + +192 +FUNC_auth_�ug�_�cur�y_��nup_v2 + +�cur�y_��nup_v2 +; + +193 +FUNC_auth_�ug�_a�_check_v2 + +a�_check_v2 +; + +194 +FUNC_auth_�ug�_u�wd_check_v2 + +u�wd_check_v2 +; + +195 +FUNC_auth_�ug�_psk_key_g�_v2 + +psk_key_g�_v2 +; + +196 +v�si� +; + +199 + smosqu�to__auth_�ug�_c�fig + + +201 * +�th +; + +202 +mosqu�to_�t + * +�ti�s +; + +203 +�ti�_cou� +; + +204 +bo� + +d�y_�ec�l_ch�s +; + +206 +mosqu�to__auth_�ug� + +�ug� +; + +209 + smosqu�to__�cur�y_�ti�s + { + +214 +mosqu�to__a�_u�r + * +a�_li� +; + +215 +mosqu�to__a� + * +a�_���ns +; + +216 * +�ssw�d_f�e +; + +217 * +psk_f�e +; + +218 * +a�_f�e +; + +219 +mosqu�to__auth_�ug�_c�fig + * +auth_�ug�_c�figs +; + +220 +auth_�ug�_c�fig_cou� +; + +221 +�t8_t + +�low_��ymous +; + +222 +bo� + +�low_z�o_�ngth_���id +; + +223 * +auto_id_�efix +; + +224 +auto_id_�efix_�n +; + +227 + smosqu�to__li��� + { + +228 +fd +; + +229 +u�t16_t + +p�t +; + +230 * +ho� +; + +231 * +b�d_��r�� +; + +232 +max_c���i�s +; + +233 * +mou�_po�t +; + +234 +mosq_sock_t + * +socks +; + +235 +sock_cou� +; + +236 +���_cou� +; + +237 +mosqu�to_��oc� + +��oc� +; + +238 +sock�_doma� +; + +239 +bo� + +u�_u��ame_as_���id +; + +240 +u�t8_t + +maximum_qos +; + +241 +u�t16_t + +max_t�ic_��s +; + +242 #ifde� +WITH_TLS + + +243 * +�f�e +; + +244 * +��th +; + +245 * +��f�e +; + +246 * +keyf�e +; + +247 * +�s_�g�e +; + +248 * +�s_�g�e_k�ss_sha1 +; + +249 * +c�h�s +; + +250 * +psk_h�t +; + +251 +SSL_CTX + * +s�_�x +; + +252 * +�lf�e +; + +253 * +�s_v�si� +; + +254 * +dh��mf�e +; + +255 +bo� + +u�_id�t�y_as_u��ame +; + +256 +bo� + +u�_subje�_as_u��ame +; + +257 +bo� + +�qu�e_��ifi�� +; + +258 +mosqu�to__keyf�m + +�s_keyf�m +; + +260 #ifde� +WITH_WEBSOCKETS + + +261 +libwebsock�_cڋxt + * +ws_cڋxt +; + +262 * +h�p_d� +; + +263 +libwebsock�_��oc�s + * +ws_��oc� +; + +265 +mosqu�to__�cur�y_�ti�s + +�cur�y_�ti�s +; + +266 +mosqu�to__u�wd + * +u�wd +; + +267 +mosqu�to__u�wd + * +psk_id +; + +270 + smosqu�to__c�fig + { + +271 +bo� + +�low_du�i��_mes�ges +; + +272 +auto�ve_��rv� +; + +273 +bo� + +auto�ve_�_ch�ges +; + +274 +bo� + +check_���_sour� +; + +275 * +���id_�efixes +; + +276 +bo� + +c���i�_mes�ges +; + +277 +bo� + +d�m� +; + +278 +mosqu�to__li��� + +de�u�_li��� +; + +279 +mosqu�to__li��� + * +li���s +; + +280 +li���_cou� +; + +281 +log_de� +; + +282 +log_�c��y +; + +283 +log_ty� +; + +284 +bo� + +log_time�amp +; + +285 * +log_time�amp_f�m� +; + +286 * +log_f�e +; + +287 +FILE + * +log_� +; + +288 +u�t16_t + +max_��ight_mes�ges +; + +289 +u�t16_t + +max_k��live +; + +290 +u�t32_t + +max_�ck�_size +; + +291 +u�t32_t + +mes�ge_size_lim� +; + +292 +bo� + +�rsi��� +; + +293 * +�rsi���_lo�ti� +; + +294 * +�rsi���_f�e +; + +295 * +�rsi���_f���h +; + +296 +time_t + +�rsi��t_���_exp��i� +; + +297 * +pid_f�e +; + +298 +bo� + +queue_qos0_mes�ges +; + +299 +bo� + +�r_li���_���gs +; + +300 +bo� + +���_ava�ab� +; + +301 +bo� + +�t_t�_nod�ay +; + +302 +sys_��rv� +; + +303 +bo� + +upg�de_outgo�g_qos +; + +304 * +u�r +; + +305 #ifde� +WITH_WEBSOCKETS + + +306 +websock�s_log_�v� +; + +307 +websock�s_h�d�s_size +; + +308 +bo� + +have_websock�s_li��� +; + +310 #ifde� +WITH_BRIDGE + + +311 +mosqu�to__bridge + * +bridges +; + +312 +bridge_cou� +; + +314 +mosqu�to__�cur�y_�ti�s + +�cur�y_�ti�s +; + +317 + smosqu�to__sub�af + { + +318 +mosqu�to__sub�af + * +�ev +; + +319 +mosqu�to__sub�af + * +�xt +; + +320 +mosqu�to + * +cڋxt +; + +321 +u�t32_t + +id�tif�r +; + +322 +u�t8_t + +qos +; + +323 +bo� + +no_lo�l +; + +324 +bo� + +���_as_published +; + +328 + smosqu�to__subsh�ed_�f + { + +329 +mosqu�to__subh�r + * +h�r +; + +330 +mosqu�to__subsh�ed + * +sh�ed +; + +334 + smosqu�to__subsh�ed + { + +335 +UT_hash_h�d� + +hh +; + +336 * +�me +; + +337 +mosqu�to__sub�af + * +subs +; + +340 + smosqu�to__subh�r + { + +341 +UT_hash_h�d� + +hh +; + +342 +mosqu�to__subh�r + * +��� +; + +343 +mosqu�to__subh�r + * +ch�d�n +; + +344 +mosqu�to__sub�af + * +subs +; + +345 +mosqu�to__subsh�ed + * +sh�ed +; + +346 +mosqu�to_msg_��e + * +���ed +; + +347 * +t�ic +; + +348 +u�t16_t + +t�ic_�n +; + +351 + smosqu�to_msg_��e_l�d +{ + +352 +UT_hash_h�d� + +hh +; + +353 +dbid_t + +db_id +; + +354 +mosqu�to_msg_��e + * +��e +; + +357 + smosqu�to_msg_��e +{ + +358 +mosqu�to_msg_��e + * +�xt +; + +359 +mosqu�to_msg_��e + * +�ev +; + +360 +dbid_t + +db_id +; + +361 * +sour�_id +; + +362 * +sour�_u��ame +; + +363 +mosqu�to__li��� + * +sour�_li��� +; + +364 ** +de�_ids +; + +365 +de�_id_cou� +; + +366 +�f_cou� +; + +367 * +t�ic +; + +368 +mosqu�to_�ݔty + * +�ݔt�s +; + +369 +mosqu�to__�yl�d_uh� + +�yl�d +; + +370 +time_t + +mes�ge_exp�y_time +; + +371 +u�t32_t + +�yl�d�n +; + +372 +u�t16_t + +sour�_mid +; + +373 +u�t16_t + +mid +; + +374 +u�t8_t + +qos +; + +375 +bo� + +��� +; + +376 +u�t8_t + +�ig� +; + +379 + smosqu�to_���_msg +{ + +380 +mosqu�to_���_msg + * +�ev +; + +381 +mosqu�to_���_msg + * +�xt +; + +382 +mosqu�to_msg_��e + * +��e +; + +383 +mosqu�to_�ݔty + * +�ݔt�s +; + +384 +time_t + +time�amp +; + +385 +u�t16_t + +mid +; + +386 +u�t8_t + +qos +; + +387 +bo� + +��� +; + +388 +mosqu�to_msg_d�e�i� + +d�e�i� +; + +389 +mosqu�to_msg_��e + +��e +; + +390 +bo� + +dup +; + +393 + smosqu�to__u�wd +{ + +394 * +u��ame +; + +395 * +�ssw�d +; + +396 #ifde� +WITH_TLS + + +397 +�ssw�d_�n +; + +398 +��_�n +; + +399 * +�� +; + +401 +UT_hash_h�d� + +hh +; + +404 + smosqu�to__a� +{ + +405 +mosqu�to__a� + * +�xt +; + +406 * +t�ic +; + +407 +ac�ss +; + +408 +ucou� +; + +409 +ccou� +; + +412 + smosqu�to__a�_u�r +{ + +413 +mosqu�to__a�_u�r + * +�xt +; + +414 * +u��ame +; + +415 +mosqu�to__a� + * +a� +; + +418 + smosqu�to_db +{ + +419 +dbid_t + +ϡ_db_id +; + +420 +mosqu�to__subh�r + * +subs +; + +421 +mosqu�to__u�wd + * +u�wd +; + +422 +mosqu�to__u�wd + * +psk_id +; + +423 +mosqu�to + * +cڋxts_by_id +; + +424 +mosqu�to + * +cڋxts_by_sock +; + +425 +mosqu�to + * +cڋxts_f�_� +; + +426 #ifde� +WITH_BRIDGE + + +427 +mosqu�to + ** +bridges +; + +429 +���id__�dex_hash + * +���id_�dex_hash +; + +430 +mosqu�to_msg_��e + * +msg_��e +; + +431 +mosqu�to_msg_��e_l�d + * +msg_��e_l�d +; + +432 #ifde� +WITH_BRIDGE + + +433 +bridge_cou� +; + +435 +msg_��e_cou� +; + +436 +msg_��e_by�s +; + +437 * +c�fig_f�e +; + +438 +mosqu�to__c�fig + * +c�fig +; + +439 +auth_�ug�_cou� +; + +440 +bo� + +v�bo� +; + +441 #ifde� +WITH_SYS_TREE + + +442 +subs��ti�_cou� +; + +443 +sh�ed_subs��ti�_cou� +; + +444 +���ed_cou� +; + +446 +�rsi���_ch�ges +; + +447 +mosqu�to + * +�_f�_� +; + +448 #ifde� +WITH_EPOLL + + +449 +��lfd +; + +453 + emosqu�to__bridge_d�e�i� +{ + +454 +bd_out + = 0, + +455 +bd_� + = 1, + +456 +bd_b�h + = 2 + +459 + emosqu�to_bridge_��t_ty� +{ + +460 +b�_autom�ic + = 0, + +461 +b�_�zy + = 1, + +462 +b�_m�u� + = 2, + +463 +b�_�� + = 3 + +466 + smosqu�to__bridge_t�ic +{ + +467 * +t�ic +; + +468 +qos +; + +469 +mosqu�to__bridge_d�e�i� + +d�e�i� +; + +470 * +lo�l_�efix +; + +471 * +�m�e_�efix +; + +472 * +lo�l_t�ic +; + +473 * +�m�e_t�ic +; + +476 + sbridge_add�ss +{ + +477 * +add�ss +; + +478 +p�t +; + +481 + smosqu�to__bridge +{ + +482 * +�me +; + +483 +bridge_add�ss + * +add�s�s +; + +484 +cur_add�ss +; + +485 +add�ss_cou� +; + +486 +time_t + +�im�y_��y +; + +487 +mosq_sock_t + +�im�y_��y_sock +; + +488 +bo� + +round_rob� +; + +489 +bo� + +�y_�iv�e +; + +490 +bo� + +�y_�iv�e_ac��ed +; + +491 +bo� + +��n_��t +; + +492 +k��live +; + +493 +mosqu�to__bridge_t�ic + * +t�ics +; + +494 +t�ic_cou� +; + +495 +bo� + +t�ic_�m�p�g +; + +496 +mosqu�to__��oc� + +��oc�_v�si� +; + +497 +time_t + +���t_t +; + +498 * +�m�e_���id +; + +499 * +�m�e_u��ame +; + +500 * +�m�e_�ssw�d +; + +501 * +lo�l_���id +; + +502 * +lo�l_u��ame +; + +503 * +lo�l_�ssw�d +; + +504 * +n�ifi�ti�_t�ic +; + +505 +bo� + +n�ifi�ti�s +; + +506 +bo� + +n�ifi�ti�s_lo�l_�ly +; + +507 +mosqu�to_bridge_��t_ty� + +��t_ty� +; + +508 +id�_timeout +; + +509 +���t_timeout +; + +510 +backoff_ba� +; + +511 +backoff_�p +; + +512 +th�sh�d +; + +513 +bo� + +�zy_�c��� +; + +514 +bo� + +��m�_unsubs�ibe +; + +515 +bo� + +���l_n�ifi�ti�_d�e +; + +516 #ifde� +WITH_TLS + + +517 +bo� + +�s_��cu� +; + +518 +bo� + +�s_oc�_�qu�ed +; + +519 * +�s_�f�e +; + +520 * +�s_��th +; + +521 * +�s_��f�e +; + +522 * +�s_keyf�e +; + +523 * +�s_v�si� +; + +524 * +�s_�� +; + +525 #ifde� +FINAL_WITH_TLS_PSK + + +526 * +�s_psk_id�t�y +; + +527 * +�s_psk +; + +532 #ifde� +WITH_WEBSOCKETS + + +533 + slibws_mq�_hack + { + +534 * +h�p_d� +; + +537 + slibws_mq�_d�a + { + +538 +mosqu�to + * +mosq +; + +542 + ~<�t_mosq.h +> + +547 + `mosqu�to_ma�_lo� +( +mosqu�to_db + * +db +, +mosq_sock_t + * +li��sock +, +li��sock_cou� +); + +548 +mosqu�to_db + * + `mosqu�to__g�_db +(); + +554 + `c�fig__�� +( +mosqu�to_db + * +db +, +mosqu�to__c�fig + * +c�fig +); + +556 + `c�fig__�r�_�gs +( +mosqu�to_db + * +db +, +mosqu�to__c�fig + * +c�fig +, +�gc +, * +�gv +[]); + +561 + `c�fig__�ad +( +mosqu�to_db + * +db +, +mosqu�to__c�fig + * +c�fig +, +bo� + +�l�d +); + +563 + `c�fig__��nup +( +mosqu�to__c�fig + * +c�fig +); + +564 + `c�fig__g�_d�_f�es +(cڡ * +��ude_d� +, *** +f�es +, * +f�e_cou� +); + +566 + `dr�_�iv�eges +( +mosqu�to__c�fig + * +c�fig +, +bo� + +�mpܬy +); + +567 + `���e_�iv�eges +(); + +572 + `�nd__c��ck +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +ack +, +�as�_code +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +); + +573 + `�nd__suback +( +mosqu�to + * +cڋxt +, +u�t16_t + +mid +, +u�t32_t + +�yl�d�n +, cڡ * +�yl�d +); + +574 + `�nd__unsuback +( +mosqu�to + * +cڋxt +, +u�t16_t + +mid +, +�as�_code_cou� +, +u�t8_t + * +�as�_codes +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +); + +575 + `�nd__auth +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +�as�_code +, cڡ * +auth_d�a +, +u�t16_t + +auth_d�a_�n +); + +580 + `�t__brok�_�� +(); + +581 + `�t__brok�_��nup +(); + +582 + `�t__sock�_ac�� +( +mosqu�to_db + * +db +, +mosq_sock_t + +li��sock +); + +583 + `�t__sock�_li�� +( +mosqu�to__li��� + * +li��� +); + +584 + `�t__sock�_g�_add�ss +( +mosq_sock_t + +sock +, * +buf +, +�n +); + +589 + `h�d�__�ck� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +590 + `h�d�__c��ck +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +591 + `h�d�__c��� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +592 + `h�d�__disc��� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +593 + `h�d�__publish +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +594 + `h�d�__subs�ibe +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +595 + `h�d�__unsubs�ibe +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +596 + `h�d�__auth +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +601 + `db__ݒ +( +mosqu�to__c�fig + * +c�fig +, +mosqu�to_db + * +db +); + +602 + `db__�o� +( +mosqu�to_db + * +db +); + +603 #ifde� +WITH_PERSISTENCE + + +604 + `�rsi�__backup +( +mosqu�to_db + * +db +, +bo� + +shutdown +); + +605 + `�rsi�__���e +( +mosqu�to_db + * +db +); + +607 + `db__lim�s_�t +( +��ight_by�s +, +queued +, +queued_by�s +); + +609 + `db__mes�ge_cou� +(* +cou� +); + +610 + `db__mes�ge_d��e_outgo�g +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +u�t16_t + +mid +, +mosqu�to_msg_��e + +ex��_��e +, +qos +); + +611 + `db__mes�ge_��� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +u�t16_t + +mid +, +mosqu�to_msg_d�e�i� + +d� +, +qos +, +bo� + +��� +, +mosqu�to_msg_��e + * +��ed +, +mosqu�to_�ݔty + * +�ݔt�s +); + +612 + `db__mes�ge_��a�_�com�g +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +u�t16_t + +mid +); + +613 + `db__mes�ge_upd�e_outgo�g +( +mosqu�to + * +cڋxt +, +u�t16_t + +mid +, +mosqu�to_msg_��e + +��e +, +qos +); + +614 + `db__mes�ge_wr�e +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +615 + `db__mes�ge_dequeue_f�� +( +mosqu�to + * +cڋxt +, +mosqu�to_msg_d�a + * +msg_d�a +); + +616 + `db__mes�ges_d��e +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +617 + `db__mes�ges_�sy_queue +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +t�ic +, +qos +, +u�t32_t + +�yl�d�n +, cڡ * +�yl�d +, +��� +, u�t32_� +mes�ge_exp�y_��rv� +, +mosqu�to_�ݔty + ** +�ݔt�s +); + +618 + `db__mes�ge_��e +( +mosqu�to_db + * +db +, cڡ +mosqu�to + * +sour� +, +u�t16_t + +sour�_mid +, * +t�ic +, +qos +, +u�t32_t + +�yl�d�n +, +mosqu�to__�yl�d_uh� + * +�yl�d +, +��� +, +mosqu�to_msg_��e + ** +��ed +, u�t32_� +mes�ge_exp�y_��rv� +, +mosqu�to_�ݔty + * +�ݔt�s +, +dbid_t + +��e_id +, +mosqu�to_msg_�ig� + +�ig� +); + +619 + `db__mes�ge_��e_f�d +( +mosqu�to + * +cڋxt +, +u�t16_t + +mid +, +mosqu�to_msg_��e + ** +��ed +); + +620 + `db__msg_��e_add +( +mosqu�to_db + * +db +, +mosqu�to_msg_��e + * +��e +); + +621 + `db__msg_��e_�move +( +mosqu�to_db + * +db +, +mosqu�to_msg_��e + * +��e +); + +622 + `db__msg_��e_�f_�c +( +mosqu�to_msg_��e + * +��e +); + +623 + `db__msg_��e_�f_dec +( +mosqu�to_db + * +db +, +mosqu�to_msg_��e + ** +��e +); + +624 + `db__msg_��e_��n +( +mosqu�to_db + * +db +); + +625 + `db__msg_��e_com�� +( +mosqu�to_db + * +db +); + +626 + `db__mes�ge_�c���_��t +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +627 + `sys_��__�� +( +mosqu�to_db + * +db +); + +628 + `sys_��__upd�e +( +mosqu�to_db + * +db +, +��rv� +, +time_t + +��t_time +); + +633 + `sub__add +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +sub +, +qos +, +u�t32_t + +id�tif�r +, +�ti�s +, +mosqu�to__subh�r + ** +ro� +); + +634 +mosqu�to__subh�r + * + `sub__add_h�r_��y +(mosqu�to__subh��* +��� +, mosqu�to__subh��** +sibl�g +, cڡ * +t�ic +, +size_t + +�n +); + +635 + `sub__�move +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +sub +, +mosqu�to__subh�r + * +ro� +, +u�t8_t + * +�as� +); + +636 + `sub__��_��t +( +mosqu�to__subh�r + * +ro� +, +�v� +); + +637 + `sub__��n_�ssi� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +638 + `sub__���_queue +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +sub +, +sub_qos +, +u�t32_t + +subs��ti�_id�tif�r +); + +639 + `sub__mes�ges_queue +( +mosqu�to_db + * +db +, cڡ * +sour�_id +, cڡ * +t�ic +, +qos +, +��� +, +mosqu�to_msg_��e + ** +��ed +); + +644 +mosqu�to + * + `cڋxt__�� +( +mosqu�to_db + * +db +, +mosq_sock_t + +sock +); + +645 + `cڋxt__��nup +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +bo� + +do_� +); + +646 + `cڋxt__disc��� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +647 + `cڋxt__add_to_disu�d +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +648 + `cڋxt__�_disu�d +( +mosqu�to_db + * +db +); + +649 + `cڋxt__�nd_w�l +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +650 + `cڋxt__�move_�om_by_id +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +651 + `cڋxt__�t_��e +( +mosqu�to + * +cڋxt +, +mosqu�to_���_��e + +��e +); + +653 + `c���__�_auth�i�d +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, * +auth_d�a_out +, +u�t16_t + +auth_d�a_out_�n +); + +658 + `log__�� +( +mosqu�to__c�fig + * +c�fig +); + +659 + `log__�o� +( +mosqu�to__c�fig + * +c�fig +); + +660 + $log__��tf +( +mosqu�to + * +mosq +, +�v� +, cڡ * +fmt +, ...� + `__��ibu�__ +(( + `f�m� +( +��tf +, 3, 4))); + +661 + $log__���� +(cڡ * +fmt +, ...� + `__��ibu�__ +(( + `f�m� +( +��tf +, 1, 2))); + +666 #ifde� +WITH_BRIDGE + + +667 + `bridge__�w +( +mosqu�to_db + * +db +, +mosqu�to__bridge + * +bridge +); + +668 + `bridge__c��� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +669 + `bridge__c���_��1 +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +670 + `bridge__c���_��2 +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +671 + `bridge__c���_��3 +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +672 + `bridge__�ck�_��nup +( +mosqu�to + * +cڋxt +); + +678 + `�ݔty__�o�ss_c��� +( +mosqu�to + * +cڋxt +, +mosqu�to_�ݔty + ** +��s +); + +679 + `�ݔty__�o�ss_w�l +( +mosqu�to + * +cڋxt +, +mosqu�to_mes�ge_�l + * +msg +, +mosqu�to_�ݔty + ** +��s +); + +680 + `�ݔty__�o�ss_disc��� +( +mosqu�to + * +cڋxt +, +mosqu�to_�ݔty + ** +��s +); + +685 + `a�__f�d_a�s +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +686 + `mosqu�to_�cur�y_modu�_�� +( +mosqu�to_db + * +db +); + +687 + `mosqu�to_�cur�y_modu�_��nup +( +mosqu�to_db + * +db +); + +689 + `mosqu�to_�cur�y_�� +( +mosqu�to_db + * +db +, +bo� + +�l�d +); + +690 + `mosqu�to_�cur�y_��y +( +mosqu�to_db + * +db +); + +691 + `mosqu�to_�cur�y_��nup +( +mosqu�to_db + * +db +, +bo� + +�l�d +); + +692 + `mosqu�to_a�_check +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +t�ic +, +�yl�d�n +, * +�yl�d +, +qos +, +bo� + +��� +, +ac�ss +); + +693 + `mosqu�to_u�wd_check +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +u��ame +, cڡ * +�ssw�d +); + +694 + `mosqu�to_psk_key_g� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +h�t +, cڡ * +id�t�y +, * +key +, +max_key_�n +); + +696 + `mosqu�to_�cur�y_��_de�u� +( +mosqu�to_db + * +db +, +bo� + +�l�d +); + +697 + `mosqu�to_�cur�y_��y_de�u� +( +mosqu�to_db + * +db +); + +698 + `mosqu�to_�cur�y_��nup_de�u� +( +mosqu�to_db + * +db +, +bo� + +�l�d +); + +699 + `mosqu�to_a�_check_de�u� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +t�ic +, +ac�ss +); + +700 + `mosqu�to_u�wd_check_de�u� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +u��ame +, cڡ * +�ssw�d +); + +701 + `mosqu�to_psk_key_g�_de�u� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +h�t +, cڡ * +id�t�y +, * +key +, +max_key_�n +); + +703 + `mosqu�to_�cur�y_auth_��t +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +bo� + +�auth +, cڡ * +d�a_� +, +u�t16_t + +d�a_�_�n +, ** +d�a_out +, u�t16_�* +d�a_out_�n +); + +704 + `mosqu�to_�cur�y_auth_c�t�ue +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +d�a_� +, +u�t16_t + +d�a_�n +, ** +d�a_out +, u�t16_�* +d�a_out_�n +); + +709 + `�ssi�_exp�y__add +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +); + +710 + `�ssi�_exp�y__�move +( +mosqu�to + * +cڋxt +); + +711 + `�ssi�_exp�y__�move_�l +( +mosqu�to_db + * +db +); + +712 + `�ssi�_exp�y__check +( +mosqu�to_db + * +db +, +time_t + +now +); + +713 + `�ssi�_exp�y__�nd_�l +( +mosqu�to_db + * +db +); + +718 #i� + `def�ed +( +WIN32 +�|| def�ed( +__CYGWIN__ +) + +719 + `�rvi�_���l +(); + +720 + `�rvi�_un���l +(); + +721 + `�rvi�_run +(); + +723 +DWORD + +WINAPI + + `SigTh�adProc +(* +d�a +); + +729 #ifde� +WITH_WEBSOCKETS + + +730 #i� + `def�ed +( +LWS_LIBRARY_VERSION_NUMBER +) + +731 +lws_cڋxt + * + `mosq_websock�s_�� +( +mosqu�to__li��� + * +li��� +, cڡ +mosqu�to__c�fig + * +c�f +); + +733 +libwebsock�_cڋxt + * + `mosq_websock�s_�� +( +mosqu�to__li��� + * +li��� +, cڡ +mosqu�to__c�fig + * +c�f +); + +736 + `do_disc��� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +�as� +); + +741 + `w�l_d�ay__add +( +mosqu�to + * +cڋxt +); + +742 + `w�l_d�ay__check +( +mosqu�to_db + * +db +, +time_t + +now +); + +743 + `w�l_d�ay__�nd_�l +( +mosqu�to_db + * +db +); + +744 + `w�l_d�ay__�move +( +mosqu�to + * +mosq +); + + @src/mosquitto_passwd.c + +17 + ~"c�fig.h +" + +19 + ~<��o.h +> + +20 + ~<ݒs�/ݒs�v.h +> + +21 + ~<ݒs�/evp.h +> + +22 + ~<ݒs�/�nd.h +> + +23 + ~<ݒs�/buf�r.h +> + +24 + ~<sig�l.h +> + +25 + ~<�dio.h +> + +26 + ~<�dlib.h +> + +27 + ~<�r�g.h +> + +30 #ifde� +WIN32 + + +31 + ~<w�dows.h +> + +32 + ~<�o�ss.h +> + +33 #i�de� +__�lu�lus + + +34 #i� +def�ed +( +_MSC_VER +) && _MSC_VER < 1900 + +35 + #bo� + + + ) + +36 + #�ue + 1 + + ) + +37 + #�l� + 0 + + ) + +39 + ~<�dbo�.h +> + +42 + #���tf + +�r�tf_s + + + ) + +43 + ~<io.h +> + +44 + ~<w�dows.h +> + +46 + ~<�dbo�.h +> + +47 + ~<uni�d.h +> + +48 + ~<�rmios.h +> + +49 + ~<sys/��.h +> + +52 + #MAX_BUFFER_LEN + 1024 + + ) + +53 + #SALT_LEN + 12 + + ) + +55 #ifde� +WIN32 + + +56 +FILE + * + $mpw_tmpf�e +() + +58 + `tmpf�e +(); + +59 + } +} + +62 + g�ph�um +[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + +64 + gtmpf�e_�th +[36]; + +65 +FILE + * + $mpw_tmpf�e +() + +67 +fd +; + +68 +size_t + +i +; + +70 if( + `RAND_by�s +( +tmpf�e_�th +, (tmpfile_path)) != 1){ + +71 +NULL +; + +74 + `�r�y +((*) +tmpf�e_�th +, "/tmp/"); + +76 +i += + `��� +((*) +tmpf�e_�th +); i<(tmpfile_path)-8; i++){ + +77 +tmpf�e_�th +[ +i +] = +�ph�um +[tmpfile_path[i]%((alphanum)-1)]; + +79 +tmpf�e_�th +[(tmpfile_path)-8] = '-'; + +80 +i +=( +tmpf�e_�th +)-7; i<(tmpfile_path)-1; i++){ + +81 +tmpf�e_�th +[ +i +] = 'X'; + +83 +tmpf�e_�th +[(tmpfile_path)-1] = '\0'; + +85 + `umask +(077); + +86 +fd + = + `mk�emp +((*) +tmpf�e_�th +); + +87 if( +fd + < 0� +NULL +; + +88 + `uƚk +((*) +tmpf�e_�th +); + +90 + `fdݒ +( +fd +, "w+"); + +91 + } +} + +95 + $ba�64_�code +(* +� +, +�_�n +, ** +�coded +) + +97 +BIO + * +bmem +, * +b64 +; + +98 +BUF_MEM + * +b�r +; + +100 +b64 + = + `BIO_�w +( + `BIO_f_ba�64 +()); + +101 + `BIO_�t_�ags +( +b64 +, +BIO_FLAGS_BASE64_NO_NL +); + +102 +bmem + = + `BIO_�w +( + `BIO_s_mem +()); + +103 +b64 + = + `BIO_push +(b64, +bmem +); + +104 + `BIO_wr�e +( +b64 +, +� +, +�_�n +); + +105 if( + `BIO_�ush +( +b64 +) != 1){ + +106 + `BIO_�_�l +( +b64 +); + +109 + `BIO_g�_mem_�r +( +b64 +, & +b�r +); + +110 * +�coded + = + `m�loc +( +b�r +-> +�ngth ++1); + +111 if(!(* +�coded +)){ + +112 + `BIO_�_�l +( +b64 +); + +115 + `mem�y +(* +�coded +, +b�r +-> +d�a +, b�r-> +�ngth +); + +116 (* +�coded +)[ +b�r +-> +�ngth +] = '\0'; + +117 + `BIO_�_�l +( +b64 +); + +120 + } +} + +123 + $��t_u�ge +() + +125 + `��tf +("mosquitto_passwd is��ool for managing�assword files for mosquitto.\n\n"); + +126 + `��tf +("Usage: mosquitto_passwd [-c | -D]�asswordfile username\n"); + +127 + `��tf +(" mosquitto_passwd -b�asswordfile username�assword\n"); + +128 + `��tf +(" mosquitto_passwd -U�asswordfile\n"); + +129 + `��tf +(" -b :�un in batch mode�o�llow�assing�asswords on�he command�ine.\n"); + +130 + `��tf +(" -c : create��ew�assword file. This will overwrite�xisting files.\n"); + +131 + `��tf +(" -D : delete�he username�ather�han�dding/updating its�assword.\n"); + +132 + `��tf +(" -U : update��lain�ext�assword file�o use hashed�asswords.\n"); + +133 + `��tf +("\nSee https://mosquitto.org/ for more information.\n\n"); + +134 + } +} + +136 + $ou�ut_�w_�ssw�d +( +FILE + * +� +, cڡ * +u��ame +, cڡ * +�ssw�d +) + +138 +rc +; + +139 +�� +[ +SALT_LEN +]; + +140 * +��64 + = +NULL +, * +hash64 + = NULL; + +141 +hash +[ +EVP_MAX_MD_SIZE +]; + +142 +hash_�n +; + +143 cڡ +EVP_MD + * +dige� +; + +144 #i� +OPENSSL_VERSION_NUMBER + < 0x10100000L + +145 +EVP_MD_CTX + +cڋxt +; + +147 +EVP_MD_CTX + * +cڋxt +; + +150 +rc + = + `RAND_by�s +( +�� +, +SALT_LEN +); + +151 if(! +rc +){ + +152 + `�r�tf +( +�d�r +, "Error: Insufficient�ntropy�vailable�o�erform�assword generation.\n"); + +156 +rc + = + `ba�64_�code +( +�� +, +SALT_LEN +, & +��64 +); + +157 if( +rc +){ + +158 + `� +( +��64 +); + +159 + `�r�tf +( +�d�r +, "Error: Unable�o�ncode salt.\n"); + +164 +dige� + = + `EVP_g�_dige�by�me +("sha512"); + +165 if(! +dige� +){ + +166 + `� +( +��64 +); + +167 + `�r�tf +( +�d�r +, "Error: Unable�o create openssl digest.\n"); + +171 #i� +OPENSSL_VERSION_NUMBER + < 0x10100000L + +172 + `EVP_MD_CTX_�� +(& +cڋxt +); + +173 + `EVP_Dige�In�_ex +(& +cڋxt +, +dige� +, +NULL +); + +174 + `EVP_Dige�Upd�e +(& +cڋxt +, +�ssw�d +, + `��� +(password)); + +175 + `EVP_Dige�Upd�e +(& +cڋxt +, +�� +, +SALT_LEN +); + +176 + `EVP_Dige�F��_ex +(& +cڋxt +, +hash +, & +hash_�n +); + +177 + `EVP_MD_CTX_��nup +(& +cڋxt +); + +179 +cڋxt + = + `EVP_MD_CTX_�w +(); + +180 + `EVP_Dige�In�_ex +( +cڋxt +, +dige� +, +NULL +); + +181 + `EVP_Dige�Upd�e +( +cڋxt +, +�ssw�d +, + `��� +(password)); + +182 + `EVP_Dige�Upd�e +( +cڋxt +, +�� +, +SALT_LEN +); + +183 + `EVP_Dige�F��_ex +( +cڋxt +, +hash +, & +hash_�n +); + +184 + `EVP_MD_CTX_� +( +cڋxt +); + +187 +rc + = + `ba�64_�code +( +hash +, +hash_�n +, & +hash64 +); + +188 if( +rc +){ + +189 + `� +( +��64 +); + +190 + `� +( +hash64 +); + +191 + `�r�tf +( +�d�r +, "Error: Unable�o�ncode hash.\n"); + +195 + `�r�tf +( +� +, "%s:$6$%s$%s\n", +u��ame +, +��64 +, +hash64 +); + +196 + `� +( +��64 +); + +197 + `� +( +hash64 +); + +200 + } +} + +202 + $d��e_pwu�r +( +FILE + * +� +, FILE * +�mp +, cڡ * +u��ame +) + +204 +buf +[ +MAX_BUFFER_LEN +]; + +205 +lbuf +[ +MAX_BUFFER_LEN +], * +tok� +; + +206 +bo� + +found + = +�l� +; + +207 +l�e + = 0; + +209 ! + `�of +( +� +�&& + `fg�s +( +buf +, +MAX_BUFFER_LEN +, fptr)){ + +210 +l�e +++; + +211 + `mem�y +( +lbuf +, +buf +, +MAX_BUFFER_LEN +); + +212 +tok� + = + `��ok +( +lbuf +, ":"); + +213 if(! +tok� +){ + +214 + `�r�tf +( +�d�r +, "E��: C�ru��assw�d f������%d.\n", +l�e +); + +218 if( + `�rcmp +( +u��ame +, +tok� +)){ + +219 + `�r�tf +( +�mp +, "%s", +buf +); + +221 +found + = +�ue +; + +224 if(! +found +){ + +225 + `�r�tf +( +�d�r +, "W�n�g: U��%�n� found i��ssw�d f�e.\n", +u��ame +); + +228 + } +} + +230 + $upd�e_f�e +( +FILE + * +� +, FILE * +�mp +) + +232 +buf +[ +MAX_BUFFER_LEN +]; + +233 +lbuf +[ +MAX_BUFFER_LEN +]; + +234 * +u��ame +, * +�ssw�d +; + +235 +rc +; + +236 +�n +; + +238 ! + `�of +( +� +�&& + `fg�s +( +buf +, +MAX_BUFFER_LEN +, fptr)){ + +239 + `mem�y +( +lbuf +, +buf +, +MAX_BUFFER_LEN +); + +240 +u��ame + = + `��ok +( +lbuf +, ":"); + +241 +�ssw�d + = + `��ok +( +NULL +, ":"); + +242 if( +�ssw�d +){ + +243 +�n + = + `��� +( +�ssw�d +); + +244 +�n + && ( +�ssw�d +[len-1] == '\n' ||�assword[len-1] == '\r')){ + +245 +�ssw�d +[ +�n +-1] = '\0'; + +246 +�n + = + `��� +( +�ssw�d +); + +248 +rc + = + `ou�ut_�w_�ssw�d +( +�mp +, +u��ame +, +�ssw�d +); + +249 if( +rc +) �c; + +251 + `�r�tf +( +�mp +, "%s", +u��ame +); + +255 + } +} + +257 + $upd�e_pwu�r +( +FILE + * +� +, FILE * +�mp +, cڡ * +u��ame +, cڡ * +�ssw�d +) + +259 +buf +[ +MAX_BUFFER_LEN +]; + +260 +lbuf +[ +MAX_BUFFER_LEN +], * +tok� +; + +261 +bo� + +found + = +�l� +; + +262 +rc + = 1; + +263 +l�e + = 0; + +265 ! + `�of +( +� +�&& + `fg�s +( +buf +, +MAX_BUFFER_LEN +, fptr)){ + +266 +l�e +++; + +267 + `mem�y +( +lbuf +, +buf +, +MAX_BUFFER_LEN +); + +268 +tok� + = + `��ok +( +lbuf +, ":"); + +269 if(! +tok� +){ + +270 + `�r�tf +( +�d�r +, "E��: C�ru��assw�d f������%d.\n", +l�e +); + +274 if( + `�rcmp +( +u��ame +, +tok� +)){ + +275 + `�r�tf +( +�mp +, "%s", +buf +); + +277 +rc + = + `ou�ut_�w_�ssw�d +( +�mp +, +u��ame +, +�ssw�d +); + +278 +found + = +�ue +; + +281 if( +found +){ + +282 +rc +; + +284 + `ou�ut_�w_�ssw�d +( +�mp +, +u��ame +, +�ssw�d +); + +286 + } +} + +288 + $g�s_qu�t +(* +s +, +�n +) + +290 #ifde� +WIN32 + + +291 +HANDLE + +h +; + +292 +DWORD + +c�_�ig +, +c�_qu�t + = 0; + +293 +DWORD + +�ad_�n + = 0; + +295 + `mem�t +( +s +, 0, +�n +); + +296 +h + = + `G�StdH�d� +( +STD_INPUT_HANDLE +); + +297 + `G�C�s�eMode +( +h +, & +c�_�ig +); + +298 +c�_qu�t + = +c�_�ig +; + +299 +c�_qu�t + &�~ +ENABLE_ECHO_INPUT +; + +300 +c�_qu�t + |� +ENABLE_LINE_INPUT +; + +301 + `S�C�s�eMode +( +h +, +c�_qu�t +); + +302 if(! + `R�dC�s�e +( +h +, +s +, +�n +, & +�ad_�n +, +NULL +)){ + +303 + `S�C�s�eMode +( +h +, +c�_�ig +); + +306 +s +[ + `��� +(s)-1] == 10 || s[strlen(s)-1] == 13){ + +307 +s +[ + `��� +(s)-1] = 0; + +309 if( + `��� +( +s +) == 0){ + +312 + `S�C�s�eMode +( +h +, +c�_�ig +); + +316 +�rmios + +ts_qu�t +, +ts_�ig +; + +317 * +rs +; + +319 + `mem�t +( +s +, 0, +�n +); + +320 + `tcg��� +(0, & +ts_�ig +); + +321 +ts_qu�t + = +ts_�ig +; + +322 +ts_qu�t +. +c_l�ag + &�~( +ECHO + | +ICANON +); + +323 + `tc���r +(0, +TCSANOW +, & +ts_qu�t +); + +325 +rs + = + `fg�s +( +s +, +�n +, +�d� +); + +326 + `tc���r +(0, +TCSANOW +, & +ts_�ig +); + +328 if(! +rs +){ + +331 +s +[ + `��� +(s)-1] == 10 || s[strlen(s)-1] == 13){ + +332 +s +[ + `��� +(s)-1] = 0; + +334 if( + `��� +( +s +) == 0){ + +340 + } +} + +342 + $g�_�ssw�d +(* +�ssw�d +, +�n +) + +344 +pw1 +[ +MAX_BUFFER_LEN +], +pw2 +[MAX_BUFFER_LEN]; + +346 + `��tf +("Password: "); + +347 + `f�ush +( +�dout +); + +348 if( + `g�s_qu�t +( +pw1 +, +MAX_BUFFER_LEN +)){ + +349 + `�r�tf +( +�d�r +, "Error: Empty�assword.\n"); + +352 + `��tf +("\n"); + +354 + `��tf +("Reenter�assword: "); + +355 + `f�ush +( +�dout +); + +356 if( + `g�s_qu�t +( +pw2 +, +MAX_BUFFER_LEN +)){ + +357 + `�r�tf +( +�d�r +, "Error: Empty�assword.\n"); + +360 + `��tf +("\n"); + +362 if( + `�rcmp +( +pw1 +, +pw2 +)){ + +363 + `�r�tf +( +�d�r +, "Error: Passwords do�ot match.\n"); + +367 + `���y +( +�ssw�d +, +pw1 +, +�n +); + +369 + } +} + +371 + $c�y_cڋ�s +( +FILE + * +�c +, FILE * +de� +) + +373 +buf +[ +MAX_BUFFER_LEN +]; + +374 +size_t + +�n +; + +376 + `�w�d +( +�c +); + +377 + `�w�d +( +de� +); + +379 #ifde� +WIN32 + + +380 + `_chsize +( + `f��o +( +de� +), 0); + +382 if( + `�run�� +( + `f��o +( +de� +), 0)) 1; + +385 ! + `�of +( +�c +)){ + +386 +�n + = + `�d +( +buf +, 1, +MAX_BUFFER_LEN +, +�c +); + +387 if( +�n + > 0){ + +388 if( + `fwr�e +( +buf +, 1, +�n +, +de� +) !=�en){ + +392 ! + `�of +( +�c +); + +396 + } +} + +398 + $���_backup +(cڡ * +backup_f�e +, +FILE + * +� +) + +400 +FILE + * +fbackup +; + +402 +fbackup + = + `fݒ +( +backup_f�e +, "wt"); + +403 if(! +fbackup +){ + +404 + `�r�tf +( +�d�r +, "E�� c���g backu��ssw�d f��\"%s\",�� c�t�u�g.\n", +backup_f�e +); + +407 if( + `c�y_cڋ�s +( +� +, +fbackup +)){ + +408 + `�r�tf +( +�d�r +, "E�� c�y�g d��t�backu��ssw�d f��\"%s\",�� c�t�u�g.\n", +backup_f�e +); + +409 + `f�o� +( +fbackup +); + +412 + `f�o� +( +fbackup +); + +413 + `�w�d +( +� +); + +415 + } +} + +416 + $h�d�_sig�t +( +sig�l +) + +418 #i�de� +WIN32 + + +419 +�rmios + +ts +; + +421 + `tcg��� +(0, & +ts +); + +422 +ts +. +c_l�ag + |� +ECHO + | +ICANON +; + +423 + `tc���r +(0, +TCSANOW +, & +ts +); + +426 + `UNUSED +( +sig�l +); + +428 + `ex� +(0); + +429 + } +} + +431 + $ma� +( +�gc +, * +�gv +[]) + +433 * +�ssw�d_f�e_tmp + = +NULL +; + +434 * +�ssw�d_f�e + = +NULL +; + +435 * +u��ame + = +NULL +; + +436 * +�ssw�d_cmd + = +NULL +; + +437 +bo� + +b�ch_mode + = +�l� +; + +438 +bo� + +���_�w + = +�l� +; + +439 +bo� + +d��e_u�r + = +�l� +; + +440 +FILE + * +� +, * +�mp +; + +441 +�ssw�d +[ +MAX_BUFFER_LEN +]; + +442 +rc +; + +443 +bo� + +do_upd�e_f�e + = +�l� +; + +444 * +backup_f�e +; + +446 + `sig�l +( +SIGINT +, +h�d�_sig�t +); + +447 + `sig�l +( +SIGTERM +, +h�d�_sig�t +); + +449 #i� +OPENSSL_VERSION_NUMBER + < 0x10100000L || +OPENSSL_API_COMPAT + < 0x10100000L + +450 + `O�nSSL_add_�l_dige�s +(); + +452 + `OPENSSL_��_�y�o +( +OPENSSL_INIT_ADD_ALL_CIPHERS + \ + +453 | +OPENSSL_INIT_ADD_ALL_DIGESTS + \ + +454 | +OPENSSL_INIT_LOAD_CONFIG +, +NULL +); + +457 if( +�gc + == 1){ + +458 + `��t_u�ge +(); + +462 if(! + `�rcmp +( +�gv +[1], "-c")){ + +463 +���_�w + = +�ue +; + +464 if( +�gc + != 4){ + +465 + `�r�tf +( +�d�r +, "Error: -c�rgument given but�assword file or username missing.\n"); + +468 +�ssw�d_f�e_tmp + = +�gv +[2]; + +469 +u��ame + = +�gv +[3]; + +471 }if(! + `�rcmp +( +�gv +[1], "-D")){ + +472 +d��e_u�r + = +�ue +; + +473 if( +�gc + != 4){ + +474 + `�r�tf +( +�d�r +, "Error: -D�rgument given but�assword file or username missing.\n"); + +477 +�ssw�d_f�e_tmp + = +�gv +[2]; + +478 +u��ame + = +�gv +[3]; + +480 }if(! + `�rcmp +( +�gv +[1], "-b")){ + +481 +b�ch_mode + = +�ue +; + +482 if( +�gc + != 5){ + +483 + `�r�tf +( +�d�r +, "Error: -b�rgument given but�assword file, username or�assword missing.\n"); + +486 +�ssw�d_f�e_tmp + = +�gv +[2]; + +487 +u��ame + = +�gv +[3]; + +488 +�ssw�d_cmd + = +�gv +[4]; + +490 }if(! + `�rcmp +( +�gv +[1], "-U")){ + +491 if( +�gc + != 3){ + +492 + `�r�tf +( +�d�r +, "Error: -U�rgument given but�assword file missing.\n"); + +495 +do_upd�e_f�e + = +�ue +; + +496 +�ssw�d_f�e_tmp + = +�gv +[2]; + +498 }if( +�gc + == 3){ + +499 +�ssw�d_f�e_tmp + = +�gv +[1]; + +500 +u��ame + = +�gv +[2]; + +502 + `��t_u�ge +(); + +506 #ifde� +WIN32 + + +507 +�ssw�d_f�e + = + `_fuηth +( +NULL +, +�ssw�d_f�e_tmp +, 0); + +508 if(! +�ssw�d_f�e +){ + +509 + `�r�tf +( +�d�r +, "Error getting full�ath for�assword file.\n"); + +513 +�ssw�d_f�e + = + `���th +( +�ssw�d_f�e_tmp +, +NULL +); + +514 if(! +�ssw�d_f�e +){ + +515 if( +��o + =� +ENOENT +){ + +516 +�ssw�d_f�e + = + `�rdup +( +�ssw�d_f�e_tmp +); + +517 if(! +�ssw�d_f�e +){ + +518 + `�r�tf +( +�d�r +, "Error: Out of memory.\n"); + +522 + `�r�tf +( +�d�r +, "E�܄�d�g�assw�d f�e: %s\n", + `���� +( +��o +)); + +528 if( +���_�w +){ + +529 +rc + = + `g�_�ssw�d +( +�ssw�d +, 1024); + +530 if( +rc +){ + +531 + `� +( +�ssw�d_f�e +); + +532 +rc +; + +534 +� + = + `fݒ +( +�ssw�d_f�e +, "wt"); + +535 if(! +� +){ + +536 + `�r�tf +( +�d�r +, "E��: U�bˁ�ݒ f��%�f� wr��g. %s.\n", +�ssw�d_f�e +, + `���� +( +��o +)); + +537 + `� +( +�ssw�d_f�e +); + +540 + `� +( +�ssw�d_f�e +); + +541 +rc + = + `ou�ut_�w_�ssw�d +( +� +, +u��ame +, +�ssw�d +); + +542 + `f�o� +( +� +); + +543 +rc +; + +545 +� + = + `fݒ +( +�ssw�d_f�e +, "r+t"); + +546 if(! +� +){ + +547 + `�r�tf +( +�d�r +, "E��: U�bˁ�ݒ�assw�d f��%s. %s.\n", +�ssw�d_f�e +, + `���� +( +��o +)); + +548 + `� +( +�ssw�d_f�e +); + +552 +backup_f�e + = + `m�loc +( + `��� +( +�ssw�d_f�e +)+5); + +553 if(! +backup_f�e +){ + +554 + `�r�tf +( +�d�r +, "Error: Out of memory.\n"); + +555 + `� +( +�ssw�d_f�e +); + +558 + `���tf +( +backup_f�e +, + `��� +( +�ssw�d_f�e +)+5, "%s.tmp",�assword_file); + +559 + `� +( +�ssw�d_f�e +); + +560 +�ssw�d_f�e + = +NULL +; + +562 if( + `���_backup +( +backup_f�e +, +� +)){ + +563 + `f�o� +( +� +); + +564 + `� +( +backup_f�e +); + +568 +�mp + = + `mpw_tmpf�e +(); + +569 if(! +�mp +){ + +570 + `�r�tf +( +�d�r +, "E��: U�bˁ�ݒ�empܬy f�e. %s.\n", + `���� +( +��o +)); + +571 + `f�o� +( +� +); + +572 + `� +( +backup_f�e +); + +575 if( +d��e_u�r +){ + +576 +rc + = + `d��e_pwu�r +( +� +, +�mp +, +u��ame +); + +577 }if( +do_upd�e_f�e +){ + +578 +rc + = + `upd�e_f�e +( +� +, +�mp +); + +580 if( +b�ch_mode +){ + +582 +rc + = + `upd�e_pwu�r +( +� +, +�mp +, +u��ame +, +�ssw�d_cmd +); + +584 +rc + = + `g�_�ssw�d +( +�ssw�d +, 1024); + +585 if( +rc +){ + +586 + `f�o� +( +� +); + +587 + `f�o� +( +�mp +); + +588 + `uƚk +( +backup_f�e +); + +589 + `� +( +backup_f�e +); + +590 +rc +; + +593 +rc + = + `upd�e_pwu�r +( +� +, +�mp +, +u��ame +, +�ssw�d +); + +596 if( +rc +){ + +597 + `f�o� +( +� +); + +598 + `f�o� +( +�mp +); + +599 + `uƚk +( +backup_f�e +); + +600 + `� +( +backup_f�e +); + +601 +rc +; + +604 if( + `c�y_cڋ�s +( +�mp +, +� +)){ + +605 + `f�o� +( +� +); + +606 + `f�o� +( +�mp +); + +607 + `�r�tf +( +�d�r +, "Error occurred updating�assword file.\n"); + +608 + `�r�tf +( +�d�r +, "Passw�d f��may b�c�ru�, check�h�backu�f�e: %s.\n", +backup_f�e +); + +609 + `� +( +backup_f�e +); + +612 + `f�o� +( +� +); + +613 + `f�o� +( +�mp +); + +617 + `uƚk +( +backup_f�e +); + +618 + `� +( +backup_f�e +); + +622 + } +} + + @src/mosquitto_plugin.h + +17 #i�de� +MOSQUITTO_PLUGIN_H + + +18 + #MOSQUITTO_PLUGIN_H + + + ) + +20 #ifde� +__�lu�lus + + +24 + #MOSQ_AUTH_PLUGIN_VERSION + 4 + + ) + +26 + #MOSQ_ACL_NONE + 0x00 + + ) + +27 + #MOSQ_ACL_READ + 0x01 + + ) + +28 + #MOSQ_ACL_WRITE + 0x02 + + ) + +29 + #MOSQ_ACL_SUBSCRIBE + 0x04 + + ) + +31 + ~<�dbo�.h +> + +33 +mosqu�to +; + +35 + smosqu�to_�t + { + +36 * +key +; + +37 * +v�ue +; + +40 + smosqu�to_auth_�t + { + +41 * +key +; + +42 * +v�ue +; + +45 + smosqu�to_a�_msg + { + +46 cڡ * +t�ic +; + +47 cڡ * +�yl�d +; + +48 +�yl�d�n +; + +49 +qos +; + +50 +bo� + +��� +; + +110 +mosqu�to_auth_�ug�_v�si� +(); + +132 +mosqu�to_auth_�ug�_�� +(** +u�r_d�a +, +mosqu�to_�t + * +�ts +, +�t_cou� +); + +154 +mosqu�to_auth_�ug�_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +�ts +, +�t_cou� +); + +182 +mosqu�to_auth_�cur�y_�� +(* +u�r_d�a +, +mosqu�to_�t + * +�ts +, +�t_cou� +, +bo� + +�l�d +); + +210 +mosqu�to_auth_�cur�y_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +�ts +, +�t_cou� +, +bo� + +�l�d +); + +237 +mosqu�to_auth_a�_check +(* +u�r_d�a +, +ac�ss +, +mosqu�to + * +��� +, cڡ +mosqu�to_a�_msg + * +msg +); + +254 +mosqu�to_auth_u�wd_check +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +u��ame +, cڡ * +�ssw�d +); + +282 +mosqu�to_auth_psk_key_g� +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +h�t +, cڡ * +id�t�y +, * +key +, +max_key_�n +); + +309 +mosqu�to_auth_��t +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +m�hod +, +bo� + +�auth +, cڡ * +d�a_� +, +u�t16_t + +d�a_�_�n +, ** +d�a_out +, u�t16_�* +d�a_out_�n +); + +311 +mosqu�to_auth_c�t�ue +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +m�hod +, cڡ * +d�a_� +, +u�t16_t + +d�a_�_�n +, ** +d�a_out +, u�t16_�* +d�a_out_�n +); + +314 #ifde� +__�lu�lus + + + @src/net.c + +17 + ~"c�fig.h +" + +19 #i�de� +WIN32 + + +20 + ~<�tdb.h +> + +21 + ~<uni�d.h +> + +22 + ~<��/��.h +> + +23 + ~<sys/sock�.h +> + +24 + ~<�t��/t�.h +> + +25 + ~<�t/if.h +> + +27 + ~<w�sock2.h +> + +28 + ~<ws2t��.h +> + +31 + ~<as��.h +> + +32 + ~<��o.h +> + +33 + ~<f��.h +> + +34 + ~<�dio.h +> + +35 + ~<�r�g.h +> + +36 #ifde� +WITH_WRAP + + +37 + ~<t�d.h +> + +40 #ifde� +HAVE_NETINET_IN_H + + +41 + ~<�t��/�.h +> + +44 #ifde� +__QNX__ + + +45 + ~<�t/�tby�.h +> + +48 + ~"mosqu�to_brok�_����.h +" + +49 + ~"mq�_��oc�.h +" + +50 + ~"mem�y_mosq.h +" + +51 + ~"�t_mosq.h +" + +52 + ~"ut�_mosq.h +" + +54 #ifde� +WITH_TLS + + +55 + ~"�s_mosq.h +" + +56 + ~<ݒs�/�r.h +> + +57 + g�s_ex_�dex_cڋxt + = -1; + +58 + g�s_ex_�dex_li��� + = -1; + +61 + ~"sys_��.h +" + +64 +mosq_sock_t + + g��e_sock + = +INVALID_SOCKET +; + +66 + $�t__brok�_�� +() + +68 +��e_sock + = + `sock� +( +AF_INET +, +SOCK_STREAM +, 0); + +69 + `�t__�� +(); + +70 + } +} + +73 + $�t__brok�_��nup +() + +75 if( +��e_sock + !� +INVALID_SOCKET +){ + +76 + `COMPAT_CLOSE +( +��e_sock +); + +77 +��e_sock + = +INVALID_SOCKET +; + +79 + `�t__��nup +(); + +80 + } +} + +83 + $�t__��t_�r� +( +log +, cڡ * +f�m�_�r +) + +85 * +buf +; + +87 #ifde� +WIN32 + + +88 + `F�m�Mes�ge +( +FORMAT_MESSAGE_ALLOCATE_BUFFER + | +FORMAT_MESSAGE_FROM_SYSTEM +, + +89 +NULL +, + `WSAG�La�E�� +(), +LANG_NEUTRAL +, & +buf +, 0, NULL); + +91 + `log__��tf +( +NULL +, +log +, +f�m�_�r +, +buf +); + +92 + `Lo�lF�e +( +buf +); + +94 +buf + = + `���� +( +��o +); + +95 + `log__��tf +( +NULL +, +log +, +f�m�_�r +, +buf +); + +97 + } +} + +100 + $�t__sock�_ac�� +( +mosqu�to_db + * +db +, +mosq_sock_t + +li��sock +) + +102 +i +; + +103 +j +; + +104 +mosq_sock_t + +�w_sock + = +INVALID_SOCKET +; + +105 +mosqu�to + * +�w_cڋxt +; + +106 #ifde� +WITH_TLS + + +107 +BIO + * +bio +; + +108 +rc +; + +109 +ebuf +[256]; + +110 +e +; + +112 #ifde� +WITH_WRAP + + +113 +�que�_�fo + +w�p_�q +; + +114 +add�ss +[1024]; + +117 +�w_sock + = + `ac�� +( +li��sock +, +NULL +, 0); + +118 if( +�w_sock + =� +INVALID_SOCKET +){ + +119 #ifde� +WIN32 + + +120 +��o + = + `WSAG�La�E�� +(); + +121 if( +��o + =� +WSAEMFILE +){ + +123 if( +��o + =� +EMFILE + ||��n�=� +ENFILE +){ + +132 + `COMPAT_CLOSE +( +��e_sock +); + +133 +�w_sock + = + `ac�� +( +li��sock +, +NULL +, 0); + +134 if( +�w_sock + !� +INVALID_SOCKET +){ + +135 + `COMPAT_CLOSE +( +�w_sock +); + +137 +��e_sock + = + `sock� +( +AF_INET +, +SOCK_STREAM +, 0); + +138 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, + +144 + `G_SOCKET_CONNECTIONS_INC +(); + +146 if( + `�t__sock�_n�block +(& +�w_sock +)){ + +147 +INVALID_SOCKET +; + +150 #ifde� +WITH_WRAP + + +152 + `�que�_�� +(& +w�p_�q +, +RQ_FILE +, +�w_sock +, +RQ_DAEMON +, "mosquitto", 0); + +153 + `�omho� +(& +w�p_�q +); + +154 if(! + `ho�s_ac�ss +(& +w�p_�q +)){ + +156 if( +db +-> +c�fig +-> +c���i�_mes�ges + =� +�ue +){ + +157 if(! + `�t__sock�_g�_add�ss +( +�w_sock +, +add�ss +, 1024)){ + +158 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "Cl�� c���i� from %�d��d�c�s�by��d.", +add�ss +); + +161 + `COMPAT_CLOSE +( +�w_sock +); + +166 if( +db +-> +c�fig +-> +�t_t�_nod�ay +){ + +167 +�ag + = 1; + +168 if( + `�tsock�t +( +�w_sock +, +IPPROTO_TCP +, +TCP_NODELAY +, & +�ag +, ()) != 0){ + +169 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Unable�o set TCP_NODELAY."); + +173 +�w_cڋxt + = + `cڋxt__�� +( +db +, +�w_sock +); + +174 if(! +�w_cڋxt +){ + +175 + `COMPAT_CLOSE +( +�w_sock +); + +178 +i +=0; i< +db +-> +c�fig +-> +li���_cou� +; i++){ + +179 +j +=0; j< +db +-> +c�fig +-> +li���s +[ +i +]. +sock_cou� +; j++){ + +180 if( +db +-> +c�fig +-> +li���s +[ +i +]. +socks +[ +j +] =� +li��sock +){ + +181 +�w_cڋxt +-> +li��� + = & +db +-> +c�fig +-> +li���s +[ +i +]; + +182 +�w_cڋxt +-> +li��� +-> +���_cou� +++; + +187 if(! +�w_cڋxt +-> +li��� +){ + +188 + `cڋxt__��nup +( +db +, +�w_cڋxt +, +�ue +); + +192 if( +�w_cڋxt +-> +li��� +-> +max_c���i�s + > 0 &&�ew_cڋxt->li���-> +���_cou� + >�ew_context->listener->max_connections){ + +193 if( +db +-> +c�fig +-> +c���i�_mes�ges + =� +�ue +){ + +194 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "Cl�� c���i� from %�d��d: max_c���iڠex�eded.", +�w_cڋxt +-> +add�ss +); + +196 + `cڋxt__��nup +( +db +, +�w_cڋxt +, +�ue +); + +200 #ifde� +WITH_TLS + + +202 +i +=0; i< +db +-> +c�fig +-> +li���_cou� +; i++){ + +203 +j +=0; j< +db +-> +c�fig +-> +li���s +[ +i +]. +sock_cou� +; j++){ + +204 if( +db +-> +c�fig +-> +li���s +[ +i +]. +socks +[ +j +] =� +li��sock +){ + +205 if( +db +-> +c�fig +-> +li���s +[ +i +]. +s�_�x +){ + +206 +�w_cڋxt +-> +s� + = + `SSL_�w +( +db +-> +c�fig +-> +li���s +[ +i +]. +s�_�x +); + +207 if(! +�w_cڋxt +-> +s� +){ + +208 + `cڋxt__��nup +( +db +, +�w_cڋxt +, +�ue +); + +211 + `SSL_�t_ex_d�a +( +�w_cڋxt +-> +s� +, +�s_ex_�dex_cڋxt +,�ew_context); + +212 + `SSL_�t_ex_d�a +( +�w_cڋxt +-> +s� +, +�s_ex_�dex_li��� +, & +db +-> +c�fig +-> +li���s +[ +i +]); + +213 +�w_cڋxt +-> +w�t_wr�e + = +�ue +; + +214 +bio + = + `BIO_�w_sock� +( +�w_sock +, +BIO_NOCLOSE +); + +215 + `SSL_�t_bio +( +�w_cڋxt +-> +s� +, +bio +, bio); + +216 + `ERR_��r_�r� +(); + +217 +rc + = + `SSL_ac�� +( +�w_cڋxt +-> +s� +); + +218 if( +rc + != 1){ + +219 +rc + = + `SSL_g�_�r� +( +�w_cڋxt +-> +s� +,�c); + +220 if( +rc + =� +SSL_ERROR_WANT_READ +){ + +222 }if( +rc + =� +SSL_ERROR_WANT_WRITE +){ + +223 +�w_cڋxt +-> +w�t_wr�e + = +�ue +; + +225 if( +db +-> +c�fig +-> +c���i�_mes�ges + =� +�ue +){ + +226 +e + = + `ERR_g�_�r� +(); + +227 +e +){ + +228 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, + +230 +�w_cڋxt +-> +add�ss +, + `ERR_�r�_�r�g +( +e +, +ebuf +)); + +231 +e + = + `ERR_g�_�r� +(); + +234 + `cڋxt__��nup +( +db +, +�w_cڋxt +, +�ue +); + +244 if( +db +-> +c�fig +-> +c���i�_mes�ges + =� +�ue +){ + +245 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "New c���i� from %�څ܈%d.", +�w_cڋxt +-> +add�ss +,�ew_cڋxt-> +li��� +-> +p�t +); + +248 +�w_sock +; + +249 + } +} + +251 #ifde� +WITH_TLS + + +252 + $���_��ifi��_v�ify +( +�ev�ify_ok +, +X509_STORE_CTX + * +�x +) + +254 + `UNUSED +( +�x +); + +257 +�ev�ify_ok +; + +258 + } +} + +261 #ifde� +FINAL_WITH_TLS_PSK + + +262 + $psk_�rv�_��back +( +SSL + * +s� +, cڡ * +id�t�y +, * +psk +, +max_psk_�n +) + +264 +mosqu�to_db + * +db +; + +265 +mosqu�to + * +cڋxt +; + +266 +mosqu�to__li��� + * +li��� +; + +267 * +psk_key + = +NULL +; + +268 +�n +; + +269 cڡ * +psk_h�t +; + +271 if(! +id�t�y +) 0; + +273 +db + = + `mosqu�to__g�_db +(); + +275 +cڋxt + = + `SSL_g�_ex_d�a +( +s� +, +�s_ex_�dex_cڋxt +); + +276 if(! +cڋxt +) 0; + +278 +li��� + = + `SSL_g�_ex_d�a +( +s� +, +�s_ex_�dex_li��� +); + +279 if(! +li��� +) 0; + +281 +psk_h�t + = +li��� +->psk_hint; + +285 +psk_key + = + `mosqu�to__��oc +(1, +max_psk_�n +*2 + 1); + +286 if(! +psk_key +) 0; + +288 if( + `mosqu�to_psk_key_g� +( +db +, +cڋxt +, +psk_h�t +, +id�t�y +, +psk_key +, +max_psk_�n +*2�!� +MOSQ_ERR_SUCCESS +){ + +289 + `mosqu�to__� +( +psk_key +); + +293 +�n + = + `mosqu�to__hex2b� +( +psk_key +, +psk +, +max_psk_�n +); + +294 i�( +�n + < 0){ + +295 + `mosqu�to__� +( +psk_key +); + +299 if( +li��� +-> +u�_id�t�y_as_u��ame +){ + +300 +cڋxt +-> +u��ame + = + `mosqu�to__�rdup +( +id�t�y +); + +301 if(! +cڋxt +-> +u��ame +){ + +302 + `mosqu�to__� +( +psk_key +); + +307 + `mosqu�to__� +( +psk_key +); + +308 +�n +; + +309 + } +} + +312 #ifde� +WITH_TLS + + +313 + $mosqu�to__�s_�rv�_�x +( +mosqu�to__li��� + * +li��� +) + +315 +buf +[256]; + +316 +rc +; + +317 +FILE + * +dh��mf�e +; + +318 +DH + * +dh��m + = +NULL +; + +320 #i� +OPENSSL_VERSION_NUMBER + < 0x10100000L + +321 +li��� +-> +s�_�x + = + `SSL_CTX_�w +( + `SSLv23_�rv�_m�hod +()); + +323 +li��� +-> +s�_�x + = + `SSL_CTX_�w +( + `TLS_�rv�_m�hod +()); + +326 if(! +li��� +-> +s�_�x +){ + +327 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Unable�o create TLS context."); + +331 if( +li��� +-> +�s_v�si� + =� +NULL +){ + +332 + `SSL_CTX_�t_�ti�s +( +li��� +-> +s�_�x +, +SSL_OP_NO_SSLv3 + | +SSL_OP_NO_TLSv1 +); + +333 #ifde� +SSL_OP_NO_TLSv1_3 + + +334 }if(! + `�rcmp +( +li��� +-> +�s_v�si� +, "tlsv1.3")){ + +335 + `SSL_CTX_�t_�ti�s +( +li��� +-> +s�_�x +, +SSL_OP_NO_SSLv3 + | +SSL_OP_NO_TLSv1 + | +SSL_OP_NO_TLSv1_1 + | +SSL_OP_NO_TLSv1_2 +); + +336 }if(! + `�rcmp +( +li��� +-> +�s_v�si� +, "tlsv1.2")){ + +337 + `SSL_CTX_�t_�ti�s +( +li��� +-> +s�_�x +, +SSL_OP_NO_SSLv3 + | +SSL_OP_NO_TLSv1 + | +SSL_OP_NO_TLSv1_1 + | +SSL_OP_NO_TLSv1_3 +); + +338 }if(! + `�rcmp +( +li��� +-> +�s_v�si� +, "tlsv1.1")){ + +339 + `SSL_CTX_�t_�ti�s +( +li��� +-> +s�_�x +, +SSL_OP_NO_SSLv3 + | +SSL_OP_NO_TLSv1 + | +SSL_OP_NO_TLSv1_2 + | +SSL_OP_NO_TLSv1_3 +); + +341 }if(! + `�rcmp +( +li��� +-> +�s_v�si� +, "tlsv1.2")){ + +342 + `SSL_CTX_�t_�ti�s +( +li��� +-> +s�_�x +, +SSL_OP_NO_SSLv3 + | +SSL_OP_NO_TLSv1 + | +SSL_OP_NO_TLSv1_1 +); + +343 }if(! + `�rcmp +( +li��� +-> +�s_v�si� +, "tlsv1.1")){ + +344 + `SSL_CTX_�t_�ti�s +( +li��� +-> +s�_�x +, +SSL_OP_NO_SSLv3 + | +SSL_OP_NO_TLSv1 + | +SSL_OP_NO_TLSv1_2 +); + +347 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Unsu�܋d�ls_v�si� \"%s\".", +li��� +-> +�s_v�si� +); + +351 #ifde� +SSL_OP_NO_COMPRESSION + + +353 + `SSL_CTX_�t_�ti�s +( +li��� +-> +s�_�x +, +SSL_OP_NO_COMPRESSION +); + +355 #ifde� +SSL_OP_CIPHER_SERVER_PREFERENCE + + +357 + `SSL_CTX_�t_�ti�s +( +li��� +-> +s�_�x +, +SSL_OP_CIPHER_SERVER_PREFERENCE +); + +360 #ifde� +SSL_MODE_RELEASE_BUFFERS + + +362 + `SSL_CTX_�t_mode +( +li��� +-> +s�_�x +, +SSL_MODE_RELEASE_BUFFERS +); + +365 #ifde� +WITH_EC + + +366 #i� +OPENSSL_VERSION_NUMBER + >= 0x10002000L && OPENSSL_VERSION_NUMBER < 0x10100000L + +367 + `SSL_CTX_�t_ecdh_auto +( +li��� +-> +s�_�x +, 1); + +371 #ifde� +SSL_OP_NO_RENEGOTIATION + + +372 + `SSL_CTX_�t_�ti�s +( +li��� +-> +s�_�x +, +SSL_OP_NO_RENEGOTIATION +); + +375 + `���tf +( +buf +, 256, "mosqu�to-%d", +li��� +-> +p�t +); + +376 + `SSL_CTX_�t_�ssi�_id_cڋxt +( +li��� +-> +s�_�x +, (*) +buf +, + `��� +(buf)); + +378 if( +li��� +-> +c�h�s +){ + +379 +rc + = + `SSL_CTX_�t_c�h�_li� +( +li��� +-> +s�_�x +,�i���-> +c�h�s +); + +380 if( +rc + == 0){ + +381 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: U�bˁأ�TLS c�h�s. Check c�h��i� \"%s\".", +li��� +-> +c�h�s +); + +385 +rc + = + `SSL_CTX_�t_c�h�_li� +( +li��� +-> +s�_�x +, "DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2:@STRENGTH"); + +386 if( +rc + == 0){ + +387 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: U�bˁأ�TLS c�h�s. Check c�h��i� \"%s\".", +li��� +-> +c�h�s +); + +391 if( +li��� +-> +dh��mf�e +){ + +392 +dh��mf�e + = + `fݒ +( +li��� +->dhparamfile, "r"); + +393 if(! +dh��mf�e +){ + +394 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�܆�d�g dh��mf��\"%s\".", +li��� +-> +dh��mf�e +); + +397 +dh��m + = + `PEM_�ad_DH��ms +( +dh��mf�e +, +NULL +, NULL, NULL); + +398 + `f�o� +( +dh��mf�e +); + +400 if( +dh��m + =� +NULL + || + `SSL_CTX_�t_tmp_dh +( +li��� +-> +s�_�x +, dhparam) != 1){ + +401 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�܆�d�g dh��mf��\"%s\".", +li��� +-> +dh��mf�e +); + +405 +MOSQ_ERR_SUCCESS +; + +406 + } +} + +413 + $�t__sock�_li�� +( +mosqu�to__li��� + * +li��� +) + +415 +mosq_sock_t + +sock + = +INVALID_SOCKET +; + +416 +addr�fo + +h�ts +; + +417 +addr�fo + * +a�fo +, * +� +; + +418 +�rvi� +[10]; + +419 +rc +; + +420 #i�de� +WIN32 + + +421 +ss_�t + = 1; + +423 +ss_�t + = 1; + +425 #ifde� +WITH_TLS + + +426 +X509_STORE + * +��e +; + +427 +X509_LOOKUP + * +lookup +; + +428 +ENGINE + * +�g�e + = +NULL +; + +430 #ifde� +SO_BINDTODEVICE + + +431 +i�eq + +i� +; + +434 if(! +li��� +� +MOSQ_ERR_INVAL +; + +436 + `���tf +( +�rvi� +, 10, "%d", +li��� +-> +p�t +); + +437 + `mem�t +(& +h�ts +, 0, ( +addr�fo +)); + +438 if( +li��� +-> +sock�_doma� +){ + +439 +h�ts +. +ai_�m�y + = +li��� +-> +sock�_doma� +; + +441 +h�ts +. +ai_�m�y + = +AF_UNSPEC +; + +443 +h�ts +. +ai_�ags + = +AI_PASSIVE +; + +444 +h�ts +. +ai_sockty� + = +SOCK_STREAM +; + +446 +rc + = + `g�addr�fo +( +li��� +-> +ho� +, +�rvi� +, & +h�ts +, & +a�fo +); + +447 i�( +rc +){ + +448 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� c���g�i���: %s.", + `gai_���� +( +rc +)); + +449 +INVALID_SOCKET +; + +452 +li��� +-> +sock_cou� + = 0; + +453 +li��� +-> +socks + = +NULL +; + +455 +� + = +a�fo +;�p;���-> +ai_�xt +){ + +456 if( +� +-> +ai_�m�y + =� +AF_INET +){ + +457 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "O�n�g ipv4�i�� sock� o�p܈%d.", + `�ohs +((( +sockaddr_� + *) +� +-> +ai_addr +)-> +s�_p�t +)); + +458 }if( +� +-> +ai_�m�y + =� +AF_INET6 +){ + +459 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "O�n�g ipv6�i�� sock� o�p܈%d.", + `�ohs +((( +sockaddr_�6 + *) +� +-> +ai_addr +)-> +s�6_p�t +)); + +464 +sock + = + `sock� +( +� +-> +ai_�m�y +,�p-> +ai_sockty� +,�p-> +ai_��oc� +); + +465 if( +sock + =� +INVALID_SOCKET +){ + +466 + `�t__��t_�r� +( +MOSQ_LOG_WARNING +, "Warning: %s"); + +469 +li��� +-> +sock_cou� +++; + +470 +li��� +-> +socks + = + `mosqu�to__��loc +�i���->socks, ( +mosq_sock_t +)*li���-> +sock_cou� +); + +471 if(! +li��� +-> +socks +){ + +472 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +473 +MOSQ_ERR_NOMEM +; + +475 +li��� +-> +socks +[li���-> +sock_cou� +-1] = +sock +; + +477 #i�de� +WIN32 + + +478 +ss_�t + = 1; + +479 + `�tsock�t +( +sock +, +SOL_SOCKET +, +SO_REUSEADDR +, & +ss_�t +, (ss_opt)); + +481 #ifde� +IPV6_V6ONLY + + +482 +ss_�t + = 1; + +483 + `�tsock�t +( +sock +, +IPPROTO_IPV6 +, +IPV6_V6ONLY +, & +ss_�t +, (ss_opt)); + +486 if( + `�t__sock�_n�block +(& +sock +)){ + +490 #ifde� +SO_BINDTODEVICE + + +491 if( +li��� +-> +b�d_��r�� +){ + +492 + `mem�t +(& +i� +, 0, (ifr)); + +493 + `���y +( +i� +. +i�_�me +, +li��� +-> +b�d_��r�� +, (ifr.ifr_name)-1); + +494 +i� +. +i�_�me +[(ifr.ifr_name)-1] = '\0'; + +495 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "B�d�g�i����ؚ�r�� \"%s\".", +i� +. +i�_�me +); + +496 if( + `�tsock�t +( +sock +, +SOL_SOCKET +, +SO_BINDTODEVICE +, (*)& +i� +, (ifr)) < 0) { + +497 + `�t__��t_�r� +( +MOSQ_LOG_ERR +, "Error: %s"); + +498 + `COMPAT_CLOSE +( +sock +); + +504 if( + `b�d +( +sock +, +� +-> +ai_addr +,�p-> +ai_add�� +) == -1){ + +505 + `�t__��t_�r� +( +MOSQ_LOG_ERR +, "Error: %s"); + +506 + `COMPAT_CLOSE +( +sock +); + +510 if( + `li�� +( +sock +, 100) == -1){ + +511 + `�t__��t_�r� +( +MOSQ_LOG_ERR +, "Error: %s"); + +512 + `COMPAT_CLOSE +( +sock +); + +516 + `�addr�fo +( +a�fo +); + +519 if( +li��� +-> +sock_cou� + > 0){ + +520 #ifde� +WITH_TLS + + +521 if(( +li��� +-> +�f�e + ||�i���-> +��th +�&&�i���-> +��f�e + &&�i���-> +keyf�e +){ + +522 if( + `mosqu�to__�s_�rv�_�x +( +li��� +)){ + +523 + `COMPAT_CLOSE +( +sock +); + +527 +rc + = + `SSL_CTX_l�d_v�ify_lo�ti�s +( +li��� +-> +s�_�x +,�i���-> +�f�e +,�i���-> +��th +); + +528 if( +rc + == 0){ + +529 if( +li��� +-> +�f�e + &&�i���-> +��th +){ + +530 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: U�bˁ�l�d CA c�tifi��s. Check caf��\"%s\"�nd c��h \"%s\".", +li��� +-> +�f�e +,�i���-> +��th +); + +531 }if( +li��� +-> +�f�e +){ + +532 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: U�bˁ�l�d CA c�tifi��s. Check caf��\"%s\".", +li��� +-> +�f�e +); + +534 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: U�bˁ�l�d CA c�tifi��s. Check c��h \"%s\".", +li��� +-> +��th +); + +536 + `�t__��t_�r� +( +MOSQ_LOG_ERR +, "Error: %s"); + +537 + `COMPAT_CLOSE +( +sock +); + +540 if( +li��� +-> +�s_�g�e +){ + +541 #i�! + `def�ed +( +OPENSSL_NO_ENGINE +) + +542 +�g�e + = + `ENGINE_by_id +( +li��� +-> +�s_�g�e +); + +543 if(! +�g�e +){ + +544 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�܆�d�g %��g�e\n", +li��� +-> +�s_�g�e +); + +545 + `COMPAT_CLOSE +( +sock +); + +548 if(! + `ENGINE_�� +( +�g�e +)){ + +549 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Failed�ngine initialisation\n"); + +550 + `ENGINE_� +( +�g�e +); + +551 + `COMPAT_CLOSE +( +sock +); + +554 + `ENGINE_�t_de�u� +( +�g�e +, +ENGINE_METHOD_ALL +); + +555 + `ENGINE_� +( +�g�e +); + +559 if( +li��� +-> +�qu�e_��ifi�� +){ + +560 + `SSL_CTX_�t_v�ify +( +li��� +-> +s�_�x +, +SSL_VERIFY_PEER + | +SSL_VERIFY_FAIL_IF_NO_PEER_CERT +, +���_��ifi��_v�ify +); + +562 + `SSL_CTX_�t_v�ify +( +li��� +-> +s�_�x +, +SSL_VERIFY_NONE +, +���_��ifi��_v�ify +); + +564 +rc + = + `SSL_CTX_u�_��ifi��_cha�_f�e +( +li��� +-> +s�_�x +,�i���-> +��f�e +); + +565 if( +rc + != 1){ + +566 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: U�bˁ�l�d s�v� c�tifi�� \"%s\". Check c�tf�e.", +li��� +-> +��f�e +); + +567 + `�t__��t_�r� +( +MOSQ_LOG_ERR +, "Error: %s"); + +568 + `COMPAT_CLOSE +( +sock +); + +569 #i�! + `def�ed +( +OPENSSL_NO_ENGINE +) + +570 + `ENGINE_FINISH +( +�g�e +); + +574 if( +li��� +-> +�s_keyf�m + =� +mosq_k_�g�e +){ + +575 #i�! + `def�ed +( +OPENSSL_NO_ENGINE +) + +576 +UI_METHOD + * +ui_m�hod + = + `�t__g�_ui_m�hod +(); + +577 if( +li��� +-> +�s_�g�e_k�ss_sha1 +){ + +578 if(! + `ENGINE_��_cmd +( +�g�e +, +ENGINE_SECRET_MODE +, +ENGINE_SECRET_MODE_SHA +, +NULL +, NULL, 0)){ + +579 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Unable�o set�ngine secret mode sha"); + +580 + `COMPAT_CLOSE +( +sock +); + +581 + `ENGINE_FINISH +( +�g�e +); + +584 if(! + `ENGINE_��_cmd +( +�g�e +, +ENGINE_PIN +, 0, +li��� +-> +�s_�g�e_k�ss_sha1 +, +NULL +, 0)){ + +585 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Unable�o set�ngine�in"); + +586 + `COMPAT_CLOSE +( +sock +); + +587 + `ENGINE_FINISH +( +�g�e +); + +590 +ui_m�hod + = +NULL +; + +592 +EVP_PKEY + * +pkey + = + `ENGINE_l�d_�iv�e_key +( +�g�e +, +li��� +-> +keyf�e +, +ui_m�hod +, +NULL +); + +593 if(! +pkey +){ + +594 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: U�bˁ�l�d�ng���iv��key f��\"%s\".", +li��� +-> +keyf�e +); + +595 + `COMPAT_CLOSE +( +sock +); + +596 + `ENGINE_FINISH +( +�g�e +); + +599 if( + `SSL_CTX_u�_Priv�eKey +( +li��� +-> +s�_�x +, +pkey +) <= 0){ + +600 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: U�bˁ�u��ng���iv��key f��\"%s\".", +li��� +-> +keyf�e +); + +601 + `COMPAT_CLOSE +( +sock +); + +602 + `ENGINE_FINISH +( +�g�e +); + +607 +rc + = + `SSL_CTX_u�_Priv�eKey_f�e +( +li��� +-> +s�_�x +,�i���-> +keyf�e +, +SSL_FILETYPE_PEM +); + +608 if( +rc + != 1){ + +609 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: U�bˁ�l�d s�v� key f��\"%s\". Check keyf�e.", +li��� +-> +keyf�e +); + +610 + `�t__��t_�r� +( +MOSQ_LOG_ERR +, "Error: %s"); + +611 + `COMPAT_CLOSE +( +sock +); + +612 #i�! + `def�ed +( +OPENSSL_NO_ENGINE +) + +613 + `ENGINE_FINISH +( +�g�e +); + +618 +rc + = + `SSL_CTX_check_�iv�e_key +( +li��� +-> +s�_�x +); + +619 if( +rc + != 1){ + +620 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Server certificate/key�re inconsistent."); + +621 + `�t__��t_�r� +( +MOSQ_LOG_ERR +, "Error: %s"); + +622 + `COMPAT_CLOSE +( +sock +); + +623 #i�! + `def�ed +( +OPENSSL_NO_ENGINE +) + +624 + `ENGINE_FINISH +( +�g�e +); + +629 if( +li��� +-> +�lf�e +){ + +630 +��e + = + `SSL_CTX_g�_��_��e +( +li��� +-> +s�_�x +); + +631 if(! +��e +){ + +632 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Unable�o obtain TLS store."); + +633 + `�t__��t_�r� +( +MOSQ_LOG_ERR +, "Error: %s"); + +634 + `COMPAT_CLOSE +( +sock +); + +635 #i�! + `def�ed +( +OPENSSL_NO_ENGINE +) + +636 + `ENGINE_FINISH +( +�g�e +); + +640 +lookup + = + `X509_STORE_add_lookup +( +��e +, + `X509_LOOKUP_f�e +()); + +641 +rc + = + `X509_l�d_�l_f�e +( +lookup +, +li��� +-> +�lf�e +, +X509_FILETYPE_PEM +); + +642 if( +rc + != 1){ + +643 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: U�bˁ�l�d c�tifi���evo�ti� f��\"%s\". Check c�f�e.", +li��� +-> +�lf�e +); + +644 + `�t__��t_�r� +( +MOSQ_LOG_ERR +, "Error: %s"); + +645 + `COMPAT_CLOSE +( +sock +); + +646 #i�! + `def�ed +( +OPENSSL_NO_ENGINE +) + +647 + `ENGINE_FINISH +( +�g�e +); + +651 + `X509_STORE_�t_�ags +( +��e +, +X509_V_FLAG_CRL_CHECK +); + +654 #ifde� +FINAL_WITH_TLS_PSK + + +655 }if( +li��� +-> +psk_h�t +){ + +656 if( +�s_ex_�dex_cڋxt + == -1){ + +657 +�s_ex_�dex_cڋxt + = + `SSL_g�_ex_�w_�dex +(0, "��� cڋxt", +NULL +, NULL, NULL); + +659 if( +�s_ex_�dex_li��� + == -1){ + +660 +�s_ex_�dex_li��� + = + `SSL_g�_ex_�w_�dex +(0, "li���", +NULL +, NULL, NULL); + +663 if( + `mosqu�to__�s_�rv�_�x +( +li��� +)){ + +664 + `COMPAT_CLOSE +( +sock +); + +665 #i�! + `def�ed +( +OPENSSL_NO_ENGINE +) + +666 + `ENGINE_FINISH +( +�g�e +); + +670 + `SSL_CTX_�t_psk_�rv�_��back +( +li��� +-> +s�_�x +, +psk_�rv�_��back +); + +671 if( +li��� +-> +psk_h�t +){ + +672 +rc + = + `SSL_CTX_u�_psk_id�t�y_h�t +( +li��� +-> +s�_�x +,�i���-> +psk_h�t +); + +673 if( +rc + == 0){ + +674 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Unable�o set TLS PSK hint."); + +675 + `�t__��t_�r� +( +MOSQ_LOG_ERR +, "Error: %s"); + +676 + `COMPAT_CLOSE +( +sock +); + +677 #i�! + `def�ed +( +OPENSSL_NO_ENGINE +) + +678 + `ENGINE_FINISH +( +�g�e +); + +690 + } +} + +692 + $�t__sock�_g�_add�ss +( +mosq_sock_t + +sock +, * +buf +, +�n +) + +694 +sockaddr_��age + +addr +; + +695 +sock�n_t + +add�� +; + +697 + `mem�t +(& +addr +, 0, ( +sockaddr_��age +)); + +698 +add�� + = ( +addr +); + +699 if(! + `g����me +( +sock +, ( +sockaddr + *)& +addr +, & +add�� +)){ + +700 if( +addr +. +ss_�m�y + =� +AF_INET +){ + +701 if( + `��_�� +( +AF_INET +, &(( +sockaddr_� + *)& +addr +)-> +s�_addr +. +s_addr +, +buf +, +�n +)){ + +704 }if( +addr +. +ss_�m�y + =� +AF_INET6 +){ + +705 if( + `��_�� +( +AF_INET6 +, &(( +sockaddr_�6 + *)& +addr +)-> +s�6_addr +. +s6_addr +, +buf +, +�n +)){ + +711 + } +} + + @src/persist.h + +17 #i�de� +PERSIST_H + + +18 + #PERSIST_H + + + ) + +20 + #MOSQ_DB_VERSION + 5 + + ) + +23 cڡ +magic +[15]; + +24 + #DB_CHUNK_CFG + 1 + + ) + +25 + #DB_CHUNK_MSG_STORE + 2 + + ) + +26 + #DB_CHUNK_CLIENT_MSG + 3 + + ) + +27 + #DB_CHUNK_RETAIN + 4 + + ) + +28 + #DB_CHUNK_SUB + 5 + + ) + +29 + #DB_CHUNK_CLIENT + 6 + + ) + +32 + #�ad_e +( +f +, +b +, +c +�if( + `�d +(b, 1, c, f�!�c){ +�r� +; } + + ) + +33 + #wr�e_e +( +f +, +b +, +c +�if( + `fwr�e +(b, 1, c, f�!�c){ +�r� +; } + + ) + +48 + sPF_h�d� +{ + +49 +u�t32_t + + mchunk +; + +50 +u�t32_t + + m�ngth +; + +54 + sPF_cfg +{ + +55 +u�t64_t + + mϡ_db_id +; + +56 +u�t8_t + + mshutdown +; + +57 +u�t8_t + + mdbid_size +; + +60 + sPF_��� +{ + +61 +�t64_t + + m�ssi�_exp�y_time +; + +62 +u�t32_t + + m�ssi�_exp�y_��rv� +; + +63 +u�t16_t + + mϡ_mid +; + +64 +u�t16_t + + mid_�n +; + +66 + sP_��� +{ + +67 +PF_��� + + mF +; + +68 * + m���_id +; + +72 + sPF_���_msg +{ + +73 +dbid_t + + m��e_id +; + +74 +u�t16_t + + mmid +; + +75 +u�t16_t + + mid_�n +; + +76 +u�t8_t + + mqos +; + +77 +u�t8_t + + m��e +; + +78 +u�t8_t + + m���_dup +; + +79 +u�t8_t + + md�e�i� +; + +81 + sP_���_msg +{ + +82 +PF_���_msg + + mF +; + +83 * + m���_id +; + +84 +mosqu�to_�ݔty + * + m�ݔt�s +; + +88 + sPF_msg_��e +{ + +89 +dbid_t + + m��e_id +; + +90 +�t64_t + + mexp�y_time +; + +91 +u�t32_t + + m�yl�d�n +; + +92 +u�t16_t + + msour�_mid +; + +93 +u�t16_t + + msour�_id_�n +; + +94 +u�t16_t + + msour�_u��ame_�n +; + +95 +u�t16_t + + mt�ic_�n +; + +96 +u�t16_t + + msour�_p�t +; + +97 +u�t8_t + + mqos +; + +98 +u�t8_t + + m��� +; + +100 + sP_msg_��e +{ + +101 +PF_msg_��e + + mF +; + +102 +mosqu�to__�yl�d_uh� + + m�yl�d +; + +103 +mosqu�to + + msour� +; + +104 * + mt�ic +; + +105 +mosqu�to_�ݔty + * + m�ݔt�s +; + +109 + sPF_sub +{ + +110 +u�t32_t + + mid�tif�r +; + +111 +u�t16_t + + mid_�n +; + +112 +u�t16_t + + mt�ic_�n +; + +113 +u�t8_t + + mqos +; + +114 +u�t8_t + + m�ti�s +; + +116 + sP_sub +{ + +117 +PF_sub + + mF +; + +118 * + m���_id +; + +119 * + mt�ic +; + +123 + sPF_��� +{ + +124 +dbid_t + + m��e_id +; + +126 + sP_��� +{ + +127 +PF_��� + + mF +; + +131 +�rsi�__�ad_�r�g_�n +( +FILE + * +db_� +, ** +�r +, +u�t16_t + +�n +); + +132 +�rsi�__�ad_�r�g +( +FILE + * +db_� +, ** +�r +); + +134 +�rsi�__chunk_h�d�_�ad_v234 +( +FILE + * +db_� +, * +chunk +, * +�ngth +); + +135 +�rsi�__chunk_cfg_�ad_v234 +( +FILE + * +db_� +, +PF_cfg + * +chunk +); + +136 +�rsi�__chunk_���_�ad_v234 +( +FILE + * +db_� +, +P_��� + * +chunk +, +db_v�si� +); + +137 +�rsi�__chunk_���_msg_�ad_v234 +( +FILE + * +db_� +, +P_���_msg + * +chunk +); + +138 +�rsi�__chunk_msg_��e_�ad_v234 +( +FILE + * +db_� +, +P_msg_��e + * +chunk +, +db_v�si� +); + +139 +�rsi�__chunk_���_�ad_v234 +( +FILE + * +db_� +, +P_��� + * +chunk +); + +140 +�rsi�__chunk_sub_�ad_v234 +( +FILE + * +db_� +, +P_sub + * +chunk +); + +142 +�rsi�__chunk_h�d�_�ad_v5 +( +FILE + * +db_� +, * +chunk +, * +�ngth +); + +143 +�rsi�__chunk_cfg_�ad_v5 +( +FILE + * +db_� +, +PF_cfg + * +chunk +); + +144 +�rsi�__chunk_���_�ad_v5 +( +FILE + * +db_� +, +P_��� + * +chunk +); + +145 +�rsi�__chunk_���_msg_�ad_v5 +( +FILE + * +db_� +, +P_���_msg + * +chunk +, +u�t32_t + +�ngth +); + +146 +�rsi�__chunk_msg_��e_�ad_v5 +( +FILE + * +db_� +, +P_msg_��e + * +chunk +, +u�t32_t + +�ngth +); + +147 +�rsi�__chunk_���_�ad_v5 +( +FILE + * +db_� +, +P_��� + * +chunk +); + +148 +�rsi�__chunk_sub_�ad_v5 +( +FILE + * +db_� +, +P_sub + * +chunk +); + +150 +�rsi�__chunk_cfg_wr�e_v5 +( +FILE + * +db_� +, +PF_cfg + * +chunk +); + +151 +�rsi�__chunk_���_wr�e_v5 +( +FILE + * +db_� +, +P_��� + * +chunk +); + +152 +�rsi�__chunk_���_msg_wr�e_v5 +( +FILE + * +db_� +, +P_���_msg + * +chunk +); + +153 +�rsi�__chunk_mes�ge_��e_wr�e_v5 +( +FILE + * +db_� +, +P_msg_��e + * +chunk +); + +154 +�rsi�__chunk_���_wr�e_v5 +( +FILE + * +db_� +, +P_��� + * +chunk +); + +155 +�rsi�__chunk_sub_wr�e_v5 +( +FILE + * +db_� +, +P_sub + * +chunk +); + + @src/persist_read.c + +17 + ~"c�fig.h +" + +19 #ifde� +WITH_PERSISTENCE + + +21 #i�de� +WIN32 + + +22 + ~<��/��.h +> + +24 + ~<as��.h +> + +25 + ~<��o.h +> + +26 + ~<f��.h +> + +27 + ~<�dio.h +> + +28 + ~<�r�g.h +> + +29 + ~<sys/��.h +> + +30 + ~<time.h +> + +31 + ~<u�i�.h +> + +33 + ~"mosqu�to_brok�_����.h +" + +34 + ~"mem�y_mosq.h +" + +35 + ~"�rsi�.h +" + +36 + ~"time_mosq.h +" + +37 + ~"ut�_mosq.h +" + +39 +u�t32_t + + gdb_v�si� +; + +41 cڡ + gmagic +[15] = {0x00, 0xB5, 0x00, 'm','o','s','q','u','i','t','t','o',' ','d','b'}; + +43 +�rsi�__���e_sub +( +mosqu�to_db + * +db +, cڡ * +���_id +, cڡ * +sub +, +qos +, +u�t32_t + +id�tif�r +, +�ti�s +); + +45 +mosqu�to + * + $�rsi�__f�d_�_add_cڋxt +( +mosqu�to_db + * +db +, cڡ * +���_id +, +u�t16_t + +ϡ_mid +) + +47 +mosqu�to + * +cڋxt +; + +49 if(! +���_id +� +NULL +; + +51 +cڋxt + = +NULL +; + +52 + `HASH_FIND +( +hh_id +, +db +-> +cڋxts_by_id +, +���_id +, + `��� +(���_id), +cڋxt +); + +53 if(! +cڋxt +){ + +54 +cڋxt + = + `cڋxt__�� +( +db +, -1); + +55 if(! +cڋxt +� +NULL +; + +56 +cڋxt +-> +id + = + `mosqu�to__�rdup +( +���_id +); + +57 if(! +cڋxt +-> +id +){ + +58 + `mosqu�to__� +( +cڋxt +); + +59 +NULL +; + +62 +cڋxt +-> +��n_��t + = +�l� +; + +64 + `HASH_ADD_KEYPTR +( +hh_id +, +db +-> +cڋxts_by_id +, +cڋxt +-> +id +, + `��� +(context->id), context); + +66 if( +ϡ_mid +){ + +67 +cڋxt +-> +ϡ_mid + =�ast_mid; + +69 +cڋxt +; + +70 + } +} + +73 + $�rsi�__�ad_�r�g_�n +( +FILE + * +db_� +, ** +�r +, +u�t16_t + +�n +) + +75 * +s + = +NULL +; + +77 if( +�n +){ + +78 +s + = + `mosqu�to__m�loc +( +�n ++1); + +79 if(! +s +){ + +80 + `f�o� +( +db_� +); + +81 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +82 +MOSQ_ERR_NOMEM +; + +84 if( + `�d +( +s +, 1, +�n +, +db_� +) !=�en){ + +85 + `mosqu�to__� +( +s +); + +86 +MOSQ_ERR_NOMEM +; + +88 +s +[ +�n +] = '\0'; + +91 * +�r + = +s +; + +92 +MOSQ_ERR_SUCCESS +; + +93 + } +} + +96 + $�rsi�__�ad_�r�g +( +FILE + * +db_� +, ** +�r +) + +98 +u�t16_t + +i16�mp +; + +99 +u�t16_t + +�� +; + +101 if( + `�d +(& +i16�mp +, 1, ( +u�t16_t +), +db_� +) != (uint16_t)){ + +102 +MOSQ_ERR_INVAL +; + +105 +�� + = + `�ohs +( +i16�mp +); + +106 + `�rsi�__�ad_�r�g_�n +( +db_� +, +�r +, +�� +); + +107 + } +} + +110 + $�rsi�__���_msg_���e +( +mosqu�to_db + * +db +, +P_���_msg + * +chunk +) + +112 +mosqu�to_���_msg + * +cmsg +; + +113 +mosqu�to_msg_��e_l�d + * +l�d +; + +114 +mosqu�to + * +cڋxt +; + +115 +mosqu�to_msg_d�a + * +msg_d�a +; + +117 +cmsg + = + `mosqu�to__��oc +(1, ( +mosqu�to_���_msg +)); + +118 if(! +cmsg +){ + +119 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +120 +MOSQ_ERR_NOMEM +; + +123 +cmsg +-> +�xt + = +NULL +; + +124 +cmsg +-> +��e + = +NULL +; + +125 +cmsg +-> +mid + = +chunk +-> +F +.mid; + +126 +cmsg +-> +qos + = +chunk +-> +F +.qos; + +127 +cmsg +-> +��� + = ( +chunk +-> +F +. +���_dup +&0xF0)>>4; + +128 +cmsg +-> +time�amp + = 0; + +129 +cmsg +-> +d�e�i� + = +chunk +-> +F +.direction; + +130 +cmsg +-> +��e + = +chunk +-> +F +.state; + +131 +cmsg +-> +dup + = +chunk +-> +F +. +���_dup +&0x0F; + +132 +cmsg +-> +�ݔt�s + = +chunk +->properties; + +134 + `HASH_FIND +( +hh +, +db +-> +msg_��e_l�d +, & +chunk +-> +F +. +��e_id +, ( +dbid_t +), +l�d +); + +135 if(! +l�d +){ + +136 + `mosqu�to__� +( +cmsg +); + +137 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error�estoring�ersistent database, message store corrupt."); + +140 +cmsg +-> +��e + = +l�d +->store; + +141 + `db__msg_��e_�f_�c +( +cmsg +-> +��e +); + +143 +cڋxt + = + `�rsi�__f�d_�_add_cڋxt +( +db +, +chunk +-> +���_id +, 0); + +144 if(! +cڋxt +){ + +145 + `mosqu�to__� +( +cmsg +); + +146 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error�estoring�ersistent database, message store corrupt."); + +150 if( +cmsg +-> +d�e�i� + =� +mosq_md_out +){ + +151 +msg_d�a + = & +cڋxt +-> +msgs_out +; + +153 +msg_d�a + = & +cڋxt +-> +msgs_� +; + +156 if( +chunk +-> +F +. +��e + =� +mosq_ms_queued + || (chunk->F. +qos + > 0 && +msg_d�a +-> +��ight_qu�a + == 0)){ + +157 + `DL_APPEND +( +msg_d�a +-> +queued +, +cmsg +); + +159 + `DL_APPEND +( +msg_d�a +-> +��ight +, +cmsg +); + +160 if( +chunk +-> +F +. +qos + > 0 && +msg_d�a +-> +��ight_qu�a + > 0){ + +161 +msg_d�a +-> +��ight_qu�a +--; + +164 +msg_d�a +-> +msg_cou� +++; + +165 +msg_d�a +-> +msg_by�s + +� +cmsg +-> +��e +-> +�yl�d�n +; + +166 if( +chunk +-> +F +. +qos + > 0){ + +167 +msg_d�a +-> +msg_cou�12 +++; + +168 +msg_d�a +-> +msg_by�s12 + +� +cmsg +-> +��e +-> +�yl�d�n +; + +171 +MOSQ_ERR_SUCCESS +; + +172 + } +} + +175 + $�rsi�__���_chunk_���e +( +mosqu�to_db + * +db +, +FILE + * +db_� +) + +177 +rc + = 0; + +178 +mosqu�to + * +cڋxt +; + +179 +P_��� + +chunk +; + +181 + `mem�t +(& +chunk +, 0, ( +P_��� +)); + +183 if( +db_v�si� + == 5){ + +184 +rc + = + `�rsi�__chunk_���_�ad_v5 +( +db_� +, & +chunk +); + +186 +rc + = + `�rsi�__chunk_���_�ad_v234 +( +db_� +, & +chunk +, +db_v�si� +); + +188 if( +rc +){ + +189 + `f�o� +( +db_� +); + +190 +rc +; + +193 +cڋxt + = + `�rsi�__f�d_�_add_cڋxt +( +db +, +chunk +. +���_id +, chunk. +F +. +ϡ_mid +); + +194 if( +cڋxt +){ + +195 +cڋxt +-> +�ssi�_exp�y_time + = +chunk +. +F +.session_expiry_time; + +196 +cڋxt +-> +�ssi�_exp�y_��rv� + = +chunk +. +F +.session_expiry_interval; + +199 +rc + = 1; + +202 + `mosqu�to__� +( +chunk +. +���_id +); + +204 +rc +; + +205 + } +} + +208 + $�rsi�__���_msg_chunk_���e +( +mosqu�to_db + * +db +, +FILE + * +db_� +, +u�t32_t + +�ngth +) + +210 +P_���_msg + +chunk +; + +211 +rc +; + +213 + `mem�t +(& +chunk +, 0, ( +P_���_msg +)); + +215 if( +db_v�si� + == 5){ + +216 +rc + = + `�rsi�__chunk_���_msg_�ad_v5 +( +db_� +, & +chunk +, +�ngth +); + +218 +rc + = + `�rsi�__chunk_���_msg_�ad_v234 +( +db_� +, & +chunk +); + +220 if( +rc +){ + +221 + `f�o� +( +db_� +); + +222 +rc +; + +225 +rc + = + `�rsi�__���_msg_���e +( +db +, & +chunk +); + +226 + `mosqu�to__� +( +chunk +. +���_id +); + +228 +rc +; + +229 + } +} + +232 + $�rsi�__msg_��e_chunk_���e +( +mosqu�to_db + * +db +, +FILE + * +db_� +, +u�t32_t + +�ngth +) + +234 +P_msg_��e + +chunk +; + +235 +mosqu�to_msg_��e + * +��ed + = +NULL +; + +236 +mosqu�to_msg_��e_l�d + * +l�d +; + +237 +�t64_t + +mes�ge_exp�y_��rv�64 +; + +238 +u�t32_t + +mes�ge_exp�y_��rv� +; + +239 +rc + = 0; + +240 +i +; + +242 + `mem�t +(& +chunk +, 0, ( +P_msg_��e +)); + +244 if( +db_v�si� + == 5){ + +245 +rc + = + `�rsi�__chunk_msg_��e_�ad_v5 +( +db_� +, & +chunk +, +�ngth +); + +247 +rc + = + `�rsi�__chunk_msg_��e_�ad_v234 +( +db_� +, & +chunk +, +db_v�si� +); + +249 if( +rc +){ + +250 + `f�o� +( +db_� +); + +251 +rc +; + +254 if( +chunk +. +F +. +sour�_p�t +){ + +255 +i +=0; i< +db +-> +c�fig +-> +li���_cou� +; i++){ + +256 if( +db +-> +c�fig +-> +li���s +[ +i +]. +p�t + =� +chunk +. +F +. +sour�_p�t +){ + +257 +chunk +. +sour� +. +li��� + = & +db +-> +c�fig +-> +li���s +[ +i +]; + +262 +l�d + = + `mosqu�to__��oc +(1, ( +mosqu�to_msg_��e_l�d +)); + +263 if(! +l�d +){ + +264 + `f�o� +( +db_� +); + +265 + `mosqu�to__� +( +chunk +. +sour� +. +id +); + +266 + `mosqu�to__� +( +chunk +. +sour� +. +u��ame +); + +267 + `mosqu�to__� +( +chunk +. +t�ic +); + +268 + `UHPA_FREE +( +chunk +. +�yl�d +, chunk. +F +. +�yl�d�n +); + +269 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +270 +MOSQ_ERR_NOMEM +; + +273 if( +chunk +. +F +. +exp�y_time + > 0){ + +274 +mes�ge_exp�y_��rv�64 + = +chunk +. +F +. +exp�y_time + - + `time +( +NULL +); + +275 if( +mes�ge_exp�y_��rv�64 + < 0 || mes�ge_exp�y_��rv�64 > +UINT32_MAX +){ + +276 +mes�ge_exp�y_��rv� + = 0; + +278 +mes�ge_exp�y_��rv� + = ( +u�t32_t +) +mes�ge_exp�y_��rv�64 +; + +281 +mes�ge_exp�y_��rv� + = 0; + +284 +rc + = + `db__mes�ge_��e +( +db +, & +chunk +. +sour� +, chunk. +F +. +sour�_mid +, + +285 +chunk +. +t�ic +, chunk. +F +. +qos +, chunk.F. +�yl�d�n +, + +286 & +chunk +. +�yl�d +, chunk. +F +. +��� +, & +��ed +, +mes�ge_exp�y_��rv� +, + +287 +chunk +. +�ݔt�s +, chunk. +F +. +��e_id +, +mosq_mo_��� +); + +289 + `mosqu�to__� +( +chunk +. +sour� +. +id +); + +290 + `mosqu�to__� +( +chunk +. +sour� +. +u��ame +); + +291 +chunk +. +sour� +. +id + = +NULL +; + +292 +chunk +. +sour� +. +u��ame + = +NULL +; + +294 if( +rc + =� +MOSQ_ERR_SUCCESS +){ + +295 +��ed +-> +sour�_li��� + = +chunk +. +sour� +. +li��� +; + +296 +l�d +-> +db_id + = +��ed +->db_id; + +297 +l�d +-> +��e + = +��ed +; + +299 + `HASH_ADD +( +hh +, +db +-> +msg_��e_l�d +, +db_id +, ( +dbid_t +), +l�d +); + +300 +MOSQ_ERR_SUCCESS +; + +302 + `mosqu�to__� +( +l�d +); + +303 + `f�o� +( +db_� +); + +304 +rc +; + +306 + } +} + +308 + $�rsi�__���_chunk_���e +( +mosqu�to_db + * +db +, +FILE + * +db_� +) + +310 +mosqu�to_msg_��e_l�d + * +l�d +; + +311 +P_��� + +chunk +; + +312 +rc +; + +314 + `mem�t +(& +chunk +, 0, ( +P_��� +)); + +316 if( +db_v�si� + == 5){ + +317 +rc + = + `�rsi�__chunk_���_�ad_v5 +( +db_� +, & +chunk +); + +319 +rc + = + `�rsi�__chunk_���_�ad_v234 +( +db_� +, & +chunk +); + +321 if( +rc +){ + +322 + `f�o� +( +db_� +); + +323 +rc +; + +326 + `HASH_FIND +( +hh +, +db +-> +msg_��e_l�d +, & +chunk +. +F +. +��e_id +, ( +dbid_t +), +l�d +); + +327 if( +l�d +){ + +328 + `sub__mes�ges_queue +( +db +, +NULL +, +l�d +-> +��e +-> +t�ic +,��d->��e-> +qos +,��d->��e-> +��� +, &load->store); + +330 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Corrupt database whilst�estoring��etained message."); + +331 +MOSQ_ERR_INVAL +; + +333 +MOSQ_ERR_SUCCESS +; + +334 + } +} + +336 + $�rsi�__sub_chunk_���e +( +mosqu�to_db + * +db +, +FILE + * +db_� +) + +338 +P_sub + +chunk +; + +339 +rc +; + +341 + `mem�t +(& +chunk +, 0, ( +P_sub +)); + +343 if( +db_v�si� + == 5){ + +344 +rc + = + `�rsi�__chunk_sub_�ad_v5 +( +db_� +, & +chunk +); + +346 +rc + = + `�rsi�__chunk_sub_�ad_v234 +( +db_� +, & +chunk +); + +348 if( +rc +){ + +349 + `f�o� +( +db_� +); + +350 +rc +; + +353 +rc + = + `�rsi�__���e_sub +( +db +, +chunk +. +���_id +, chunk. +t�ic +, chunk. +F +. +qos +, chunk.F. +id�tif�r +, chunk.F. +�ti�s +); + +355 + `mosqu�to__� +( +chunk +. +���_id +); + +356 + `mosqu�to__� +( +chunk +. +t�ic +); + +358 +rc +; + +359 + } +} + +362 + $�rsi�__chunk_h�d�_�ad +( +FILE + * +db_� +, * +chunk +, * +�ngth +) + +364 if( +db_v�si� + == 5){ + +365 + `�rsi�__chunk_h�d�_�ad_v5 +( +db_� +, +chunk +, +�ngth +); + +367 + `�rsi�__chunk_h�d�_�ad_v234 +( +db_� +, +chunk +, +�ngth +); + +369 + } +} + +372 + $�rsi�__���e +( +mosqu�to_db + * +db +) + +374 +FILE + * +� +; + +375 +h�d� +[15]; + +376 +rc + = 0; + +377 +u�t32_t + +�c +; + +378 +u�t32_t + +i32�mp +; + +379 +chunk +, +�ngth +; + +380 +ssize_t + +�� +; + +381 * +�r +; + +382 +mosqu�to_msg_��e_l�d + * +l�d +, * +l�d_tmp +; + +383 +PF_cfg + +cfg_chunk +; + +385 + `as�� +( +db +); + +386 + `as�� +( +db +-> +c�fig +); + +388 if(! +db +-> +c�fig +-> +�rsi��� + || db->c�fig-> +�rsi���_f���h + =� +NULL +){ + +389 +MOSQ_ERR_SUCCESS +; + +392 +db +-> +msg_��e_l�d + = +NULL +; + +394 +� + = + `mosqu�to__fݒ +( +db +-> +c�fig +-> +�rsi���_f���h +, "rb", +�l� +); + +395 if( +� + =� +NULL +� +MOSQ_ERR_SUCCESS +; + +396 +�� + = + `�d +(& +h�d� +, 1, 15, +� +); + +397 if( +�� + == 0){ + +398 + `f�o� +( +� +); + +399 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "Warning: Persistence file is�mpty."); + +401 }if( +�� + != 15){ + +402 +�r� +; + +404 if(! + `memcmp +( +h�d� +, +magic +, 15)){ + +406 + `�ad_e +( +� +, & +�c +, ( +u�t32_t +)); + +407 + `�ad_e +( +� +, & +i32�mp +, ( +u�t32_t +)); + +408 +db_v�si� + = + `�ohl +( +i32�mp +); + +412 if( +db_v�si� + > +MOSQ_DB_VERSION + && db_version != 0){ + +413 if( +db_v�si� + == 4){ + +414 }if( +db_v�si� + == 3){ + +416 }if( +db_v�si� + == 2){ + +419 + `f�o� +( +� +); + +420 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Unsu�܋d��si���d�aba� f�m� v�si� %d (�ed v�si� %d).", +db_v�si� +, +MOSQ_DB_VERSION +); + +425 + `�rsi�__chunk_h�d�_�ad +( +� +, & +chunk +, & +�ngth +�=� +MOSQ_ERR_SUCCESS +){ + +426 +chunk +){ + +427 +DB_CHUNK_CFG +: + +428 if( +db_v�si� + == 5){ + +429 if( + `�rsi�__chunk_cfg_�ad_v5 +( +� +, & +cfg_chunk +)){ + +433 if( + `�rsi�__chunk_cfg_�ad_v234 +( +� +, & +cfg_chunk +)){ + +437 if( +cfg_chunk +. +dbid_size + !�( +dbid_t +)){ + +438 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Incompatible database configuration (dbid size is %d bytes,�xpected %lu)", + +439 +cfg_chunk +. +dbid_size +, ()( +dbid_t +)); + +440 + `f�o� +( +� +); + +443 +db +-> +ϡ_db_id + = +cfg_chunk +.last_db_id; + +446 +DB_CHUNK_MSG_STORE +: + +447 if( + `�rsi�__msg_��e_chunk_���e +( +db +, +� +, +�ngth +)) 1; + +450 +DB_CHUNK_CLIENT_MSG +: + +451 if( + `�rsi�__���_msg_chunk_���e +( +db +, +� +, +�ngth +)) 1; + +454 +DB_CHUNK_RETAIN +: + +455 if( + `�rsi�__���_chunk_���e +( +db +, +� +)) 1; + +458 +DB_CHUNK_SUB +: + +459 if( + `�rsi�__sub_chunk_���e +( +db +, +� +)) 1; + +462 +DB_CHUNK_CLIENT +: + +463 if( + `�rsi�__���_chunk_���e +( +db +, +� +)) 1; + +467 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, "W�n�g: Unsu�܋d chunk \"%d\" i��rsi���d�aba� f�e. Ignܚg.", +chunk +); + +468 + `f�ek +( +� +, +�ngth +, +SEEK_CUR +); + +472 if( +�� + < 0� +�r� +; + +474 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Unable�o�estore�ersistent database. Unrecognised file format."); + +475 +rc + = 1; + +478 + `f�o� +( +� +); + +480 + `HASH_ITER +( +hh +, +db +-> +msg_��e_l�d +, +l�d +, +l�d_tmp +){ + +481 + `HASH_DELETE +( +hh +, +db +-> +msg_��e_l�d +, +l�d +); + +482 + `mosqu�to__� +( +l�d +); + +484 +rc +; + +485 +�r� +: + +486 +�r + = + `���� +( +��o +); + +487 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: %s.", +�r +); + +488 if( +� +� + `f�o� +(fptr); + +490 + } +} + +492 + $�rsi�__���e_sub +( +mosqu�to_db + * +db +, cڡ * +���_id +, cڡ * +sub +, +qos +, +u�t32_t + +id�tif�r +, +�ti�s +) + +494 +mosqu�to + * +cڋxt +; + +496 + `as�� +( +db +); + +497 + `as�� +( +���_id +); + +498 + `as�� +( +sub +); + +500 +cڋxt + = + `�rsi�__f�d_�_add_cڋxt +( +db +, +���_id +, 0); + +501 if(! +cڋxt +) 1; + +502 + `sub__add +( +db +, +cڋxt +, +sub +, +qos +, +id�tif�r +, +�ti�s +, &db-> +subs +); + +503 + } +} + + @src/persist_read_v234.c + +17 + ~"c�fig.h +" + +19 #ifde� +WITH_PERSISTENCE + + +21 #i�de� +WIN32 + + +22 + ~<��/��.h +> + +24 + ~<as��.h +> + +25 + ~<��o.h +> + +26 + ~<f��.h +> + +27 + ~<�dio.h +> + +28 + ~<�r�g.h +> + +29 + ~<sys/��.h +> + +30 + ~<time.h +> + +32 + ~"mosqu�to_brok�_����.h +" + +33 + ~"mem�y_mosq.h +" + +34 + ~"�rsi�.h +" + +35 + ~"time_mosq.h +" + +36 + ~"ut�_mosq.h +" + +39 + $�rsi�__chunk_h�d�_�ad_v234 +( +FILE + * +db_� +, * +chunk +, * +�ngth +) + +41 +size_t + +�� +; + +42 +u�t16_t + +i16�mp +; + +43 +u�t32_t + +i32�mp +; + +45 +�� + = + `�d +(& +i16�mp +, ( +u�t16_t +), 1, +db_� +); + +46 if( +�� + != 1) 1; + +48 +�� + = + `�d +(& +i32�mp +, ( +u�t32_t +), 1, +db_� +); + +49 if( +�� + != 1) 1; + +51 * +chunk + = + `�ohs +( +i16�mp +); + +52 * +�ngth + = + `�ohl +( +i32�mp +); + +54 +MOSQ_ERR_SUCCESS +; + +55 + } +} + +58 + $�rsi�__chunk_cfg_�ad_v234 +( +FILE + * +db_� +, +PF_cfg + * +chunk +) + +60 + `�ad_e +( +db_� +, & +chunk +-> +shutdown +, ( +u�t8_t +)); + +61 + `�ad_e +( +db_� +, & +chunk +-> +dbid_size +, ( +u�t8_t +)); + +62 + `�ad_e +( +db_� +, & +chunk +-> +ϡ_db_id +, ( +dbid_t +)); + +64 +MOSQ_ERR_SUCCESS +; + +65 +�r� +: + +66 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: %s.", + `���� +( +��o +)); + +68 + } +} + +71 + $�rsi�__chunk_���_�ad_v234 +( +FILE + * +db_� +, +P_��� + * +chunk +, +db_v�si� +) + +73 +u�t16_t + +i16�mp +; + +74 +rc +; + +75 +time_t + +�mp +; + +77 +rc + = + `�rsi�__�ad_�r�g +( +db_� +, & +chunk +-> +���_id +); + +78 if( +rc +){ + +79 +rc +; + +82 + `�ad_e +( +db_� +, & +i16�mp +, ( +u�t16_t +)); + +83 +chunk +-> +F +. +ϡ_mid + = + `�ohs +( +i16�mp +); + +84 if( +db_v�si� + != 2){ + +85 + `�ad_e +( +db_� +, & +�mp +, ( +time_t +)); + +88 +MOSQ_ERR_SUCCESS +; + +89 +�r� +: + +90 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: %s.", + `���� +( +��o +)); + +91 + `mosqu�to__� +( +chunk +-> +���_id +); + +93 + } +} + +96 + $�rsi�__chunk_���_msg_�ad_v234 +( +FILE + * +db_� +, +P_���_msg + * +chunk +) + +98 +u�t16_t + +i16�mp +; + +99 +rc +; + +100 * +�r +; + +101 +u�t8_t + +��� +, +dup +; + +103 +rc + = + `�rsi�__�ad_�r�g +( +db_� +, & +chunk +-> +���_id +); + +104 if( +rc +){ + +105 +rc +; + +108 + `�ad_e +( +db_� +, & +chunk +-> +F +. +��e_id +, ( +dbid_t +)); + +110 + `�ad_e +( +db_� +, & +i16�mp +, ( +u�t16_t +)); + +111 +chunk +-> +F +. +mid + = + `�ohs +( +i16�mp +); + +113 + `�ad_e +( +db_� +, & +chunk +-> +F +. +qos +, ( +u�t8_t +)); + +114 + `�ad_e +( +db_� +, & +��� +, ( +u�t8_t +)); + +115 + `�ad_e +( +db_� +, & +chunk +-> +F +. +d�e�i� +, ( +u�t8_t +)); + +116 + `�ad_e +( +db_� +, & +chunk +-> +F +. +��e +, ( +u�t8_t +)); + +117 + `�ad_e +( +db_� +, & +dup +, ( +u�t8_t +)); + +119 +chunk +-> +F +. +���_dup + = ( +��� +&0x0F)<<4 | ( +dup +&0x0F); + +121 +MOSQ_ERR_SUCCESS +; + +122 +�r� +: + +123 +�r + = + `���� +( +��o +); + +124 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: %s.", +�r +); + +125 + `mosqu�to__� +( +chunk +-> +���_id +); + +127 + } +} + +130 + $�rsi�__chunk_msg_��e_�ad_v234 +( +FILE + * +db_� +, +P_msg_��e + * +chunk +, +db_v�si� +) + +132 +u�t32_t + +i32�mp +; + +133 +u�t16_t + +i16�mp +; + +134 +rc + = 0; + +135 * +�r +; + +137 + `�ad_e +( +db_� +, & +chunk +-> +F +. +��e_id +, ( +dbid_t +)); + +139 +rc + = + `�rsi�__�ad_�r�g +( +db_� +, & +chunk +-> +sour� +. +id +); + +140 if( +rc +){ + +141 +rc +; + +143 if( +db_v�si� + == 4){ + +144 +rc + = + `�rsi�__�ad_�r�g +( +db_� +, & +chunk +-> +sour� +. +u��ame +); + +145 if( +rc +){ + +146 + `mosqu�to__� +( +chunk +-> +sour� +. +id +); + +147 +rc +; + +149 + `�ad_e +( +db_� +, & +i16�mp +, ( +u�t16_t +)); + +150 +chunk +-> +F +. +sour�_p�t + = + `�ohs +( +i16�mp +); + +153 + `�ad_e +( +db_� +, & +i16�mp +, ( +u�t16_t +)); + +154 +chunk +-> +F +. +sour�_mid + = + `�ohs +( +i16�mp +); + +157 + `�ad_e +( +db_� +, & +i16�mp +, ( +u�t16_t +)); + +159 +rc + = + `�rsi�__�ad_�r�g +( +db_� +, & +chunk +-> +t�ic +); + +160 if( +rc +){ + +161 + `mosqu�to__� +( +chunk +-> +sour� +. +id +); + +162 + `mosqu�to__� +( +chunk +-> +sour� +. +u��ame +); + +163 +rc +; + +166 + `�ad_e +( +db_� +, & +chunk +-> +F +. +qos +, ( +u�t8_t +)); + +167 + `�ad_e +( +db_� +, & +chunk +-> +F +. +��� +, ( +u�t8_t +)); + +169 + `�ad_e +( +db_� +, & +i32�mp +, ( +u�t32_t +)); + +170 +chunk +-> +F +. +�yl�d�n + = + `�ohl +( +i32�mp +); + +172 if( +chunk +-> +F +. +�yl�d�n +){ + +173 if( + `UHPA_ALLOC +( +chunk +-> +�yl�d +, chunk-> +F +. +�yl�d�n +) == 0){ + +174 + `mosqu�to__� +( +chunk +-> +sour� +. +id +); + +175 + `mosqu�to__� +( +chunk +-> +sour� +. +u��ame +); + +176 + `mosqu�to__� +( +chunk +-> +t�ic +); + +177 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +178 +MOSQ_ERR_NOMEM +; + +180 + `�ad_e +( +db_� +, + `UHPA_ACCESS +( +chunk +-> +�yl�d +, chunk-> +F +. +�yl�d�n +), chunk->F.payloadlen); + +183 +MOSQ_ERR_SUCCESS +; + +184 +�r� +: + +185 +�r + = + `���� +( +��o +); + +186 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: %s.", +�r +); + +187 + `mosqu�to__� +( +chunk +-> +sour� +. +id +); + +188 + `mosqu�to__� +( +chunk +-> +sour� +. +u��ame +); + +190 + } +} + +193 + $�rsi�__chunk_���_�ad_v234 +( +FILE + * +db_� +, +P_��� + * +chunk +) + +195 +dbid_t + +i64�mp +; + +196 * +�r +; + +198 if( + `�d +(& +i64�mp +, ( +dbid_t +), 1, +db_� +) != 1){ + +199 +�r + = + `���� +( +��o +); + +200 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: %s.", +�r +); + +203 +chunk +-> +F +. +��e_id + = +i64�mp +; + +205 +MOSQ_ERR_SUCCESS +; + +206 + } +} + +209 + $�rsi�__chunk_sub_�ad_v234 +( +FILE + * +db_� +, +P_sub + * +chunk +) + +211 +rc +; + +212 * +�r +; + +214 +rc + = + `�rsi�__�ad_�r�g +( +db_� +, & +chunk +-> +���_id +); + +215 if( +rc +){ + +216 +rc +; + +219 +rc + = + `�rsi�__�ad_�r�g +( +db_� +, & +chunk +-> +t�ic +); + +220 if( +rc +){ + +221 + `mosqu�to__� +( +chunk +-> +���_id +); + +222 +rc +; + +225 + `�ad_e +( +db_� +, & +chunk +-> +F +. +qos +, ( +u�t8_t +)); + +227 +MOSQ_ERR_SUCCESS +; + +228 +�r� +: + +229 +�r + = + `���� +( +��o +); + +230 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: %s.", +�r +); + +231 + `mosqu�to__� +( +chunk +-> +���_id +); + +232 + `mosqu�to__� +( +chunk +-> +t�ic +); + +234 + } +} + + @src/persist_read_v5.c + +17 + ~"c�fig.h +" + +19 #ifde� +WITH_PERSISTENCE + + +21 #i�de� +WIN32 + + +22 + ~<��/��.h +> + +24 + ~<as��.h +> + +25 + ~<��o.h +> + +26 + ~<f��.h +> + +27 + ~<�dio.h +> + +28 + ~<�r�g.h +> + +29 + ~<sys/��.h +> + +30 + ~<time.h +> + +32 + ~"mosqu�to_brok�_����.h +" + +33 + ~"mem�y_mosq.h +" + +34 + ~"mq�_��oc�.h +" + +35 + ~"�rsi�.h +" + +36 + ~"�ݔty_mosq.h +" + +37 + ~"time_mosq.h +" + +38 + ~"ut�_mosq.h +" + +41 + $�rsi�__chunk_h�d�_�ad_v5 +( +FILE + * +db_� +, * +chunk +, * +�ngth +) + +43 +size_t + +�� +; + +44 +PF_h�d� + +h�d� +; + +46 +�� + = + `�d +(& +h�d� +, ( +PF_h�d� +), 1, +db_� +); + +47 if( +�� + != 1) 1; + +49 * +chunk + = + `�ohl +( +h�d� +.chunk); + +50 * +�ngth + = + `�ohl +( +h�d� +.length); + +52 +MOSQ_ERR_SUCCESS +; + +53 + } +} + +56 + $�rsi�__chunk_cfg_�ad_v5 +( +FILE + * +db_� +, +PF_cfg + * +chunk +) + +58 if( + `�d +( +chunk +, ( +PF_cfg +), 1, +db_� +) != 1){ + +59 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: %s.", + `���� +( +��o +)); + +63 +MOSQ_ERR_SUCCESS +; + +64 + } +} + +67 + $�rsi�__chunk_���_�ad_v5 +( +FILE + * +db_� +, +P_��� + * +chunk +) + +69 +rc +; + +71 + `�ad_e +( +db_� +, & +chunk +-> +F +, ( +PF_��� +)); + +72 +chunk +-> +F +. +�ssi�_exp�y_��rv� + = + `�ohl +(chunk->F.session_expiry_interval); + +73 +chunk +-> +F +. +ϡ_mid + = + `�ohs +(chunk->F.last_mid); + +74 +chunk +-> +F +. +id_�n + = + `�ohs +(chunk->F.id_len); + +76 +rc + = + `�rsi�__�ad_�r�g_�n +( +db_� +, & +chunk +-> +���_id +, chunk-> +F +. +id_�n +); + +77 if( +rc + || ! +chunk +-> +���_id +){ + +80 +MOSQ_ERR_SUCCESS +; + +82 +�r� +: + +83 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: %s.", + `���� +( +��o +)); + +85 + } +} + +88 + $�rsi�__chunk_���_msg_�ad_v5 +( +FILE + * +db_� +, +P_���_msg + * +chunk +, +u�t32_t + +�ngth +) + +90 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +91 +mosqu�to__�ck� + +��_�ck� +; + +92 +rc +; + +94 + `�ad_e +( +db_� +, & +chunk +-> +F +, ( +PF_���_msg +)); + +95 +chunk +-> +F +. +mid + = + `�ohs +(chunk->F.mid); + +96 +chunk +-> +F +. +id_�n + = + `�ohs +(chunk->F.id_len); + +98 +�ngth + -�(( +PF_���_msg +�+ +chunk +-> +F +. +id_�n +); + +100 +rc + = + `�rsi�__�ad_�r�g_�n +( +db_� +, & +chunk +-> +���_id +, chunk-> +F +. +id_�n +); + +101 if( +rc +){ + +102 +rc +; + +105 if( +�ngth + > 0){ + +106 + `mem�t +(& +��_�ck� +, 0, ( +mosqu�to__�ck� +)); + +107 +��_�ck� +. +�ma��g_�ngth + = +�ngth +; + +108 +��_�ck� +. +�yl�d + = + `mosqu�to__m�loc +( +�ngth +); + +109 if(! +��_�ck� +. +�yl�d +){ + +110 +MOSQ_ERR_NOMEM +; + +112 + `�ad_e +( +db_� +, +��_�ck� +. +�yl�d +, +�ngth +); + +113 +rc + = + `�ݔty__�ad_�l +( +CMD_PUBLISH +, & +��_�ck� +, & +�ݔt�s +); + +114 + `mosqu�to__� +( +��_�ck� +. +�yl�d +); + +115 if( +rc +){ + +116 +rc +; + +119 +chunk +-> +�ݔt�s + =�roperties; + +121 +MOSQ_ERR_SUCCESS +; + +122 +�r� +: + +123 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: %s.", + `���� +( +��o +)); + +125 + } +} + +128 + $�rsi�__chunk_msg_��e_�ad_v5 +( +FILE + * +db_� +, +P_msg_��e + * +chunk +, +u�t32_t + +�ngth +) + +130 +rc + = 0; + +131 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +132 +mosqu�to__�ck� + +��_�ck� +; + +134 + `mem�t +(& +��_�ck� +, 0, ( +mosqu�to__�ck� +)); + +136 + `�ad_e +( +db_� +, & +chunk +-> +F +, ( +PF_msg_��e +)); + +137 +chunk +-> +F +. +�yl�d�n + = + `�ohl +(chunk->F.payloadlen); + +138 if( +chunk +-> +F +. +�yl�d�n + > +MQTT_MAX_PAYLOAD +){ + +139 +MOSQ_ERR_INVAL +; + +141 +chunk +-> +F +. +sour�_mid + = + `�ohs +(chunk->F.source_mid); + +142 +chunk +-> +F +. +sour�_id_�n + = + `�ohs +(chunk->F.source_id_len); + +143 +chunk +-> +F +. +sour�_u��ame_�n + = + `�ohs +(chunk->F.source_username_len); + +144 +chunk +-> +F +. +t�ic_�n + = + `�ohs +(chunk->F.topic_len); + +145 +chunk +-> +F +. +sour�_p�t + = + `�ohs +(chunk->F.source_port); + +147 +�ngth + -�(( +PF_msg_��e +�+ +chunk +-> +F +. +�yl�d�n + + chunk->F. +sour�_id_�n + + chunk->F. +sour�_u��ame_�n + + chunk->F. +t�ic_�n +); + +149 if( +chunk +-> +F +. +sour�_id_�n +){ + +150 +rc + = + `�rsi�__�ad_�r�g_�n +( +db_� +, & +chunk +-> +sour� +. +id +, chunk-> +F +. +sour�_id_�n +); + +151 if( +rc +){ + +152 +rc +; + +155 if( +chunk +-> +F +. +sour�_u��ame_�n +){ + +156 +rc + = + `�rsi�__�ad_�r�g_�n +( +db_� +, & +chunk +-> +sour� +. +u��ame +, chunk-> +F +. +sour�_u��ame_�n +); + +157 if( +rc +){ + +158 + `mosqu�to__� +( +chunk +-> +sour� +. +id +); + +159 +chunk +-> +sour� +. +id + = +NULL +; + +160 +rc +; + +163 +rc + = + `�rsi�__�ad_�r�g_�n +( +db_� +, & +chunk +-> +t�ic +, chunk-> +F +. +t�ic_�n +); + +164 if( +rc +){ + +165 + `mosqu�to__� +( +chunk +-> +sour� +. +id +); + +166 + `mosqu�to__� +( +chunk +-> +sour� +. +u��ame +); + +167 +chunk +-> +sour� +. +id + = +NULL +; + +168 +chunk +-> +sour� +. +u��ame + = +NULL +; + +169 +rc +; + +172 if( +chunk +-> +F +. +�yl�d�n + > 0){ + +173 if( + `UHPA_ALLOC +( +chunk +-> +�yl�d +, chunk-> +F +. +�yl�d�n +) == 0){ + +174 + `mosqu�to__� +( +chunk +-> +sour� +. +id +); + +175 + `mosqu�to__� +( +chunk +-> +sour� +. +u��ame +); + +176 + `mosqu�to__� +( +chunk +-> +t�ic +); + +177 +chunk +-> +sour� +. +id + = +NULL +; + +178 +chunk +-> +sour� +. +u��ame + = +NULL +; + +179 +chunk +-> +t�ic + = +NULL +; + +180 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +181 +MOSQ_ERR_NOMEM +; + +183 + `�ad_e +( +db_� +, + `UHPA_ACCESS +( +chunk +-> +�yl�d +, chunk-> +F +. +�yl�d�n +), chunk->F.payloadlen); + +186 if( +�ngth + > 0){ + +187 +��_�ck� +. +�ma��g_�ngth + = +�ngth +; + +188 +��_�ck� +. +�yl�d + = + `mosqu�to__m�loc +( +�ngth +); + +189 if(! +��_�ck� +. +�yl�d +){ + +190 + `mosqu�to__� +( +chunk +-> +sour� +. +id +); + +191 + `mosqu�to__� +( +chunk +-> +sour� +. +u��ame +); + +192 + `mosqu�to__� +( +chunk +-> +t�ic +); + +193 +MOSQ_ERR_NOMEM +; + +195 + `�ad_e +( +db_� +, +��_�ck� +. +�yl�d +, +�ngth +); + +196 +rc + = + `�ݔty__�ad_�l +( +CMD_PUBLISH +, & +��_�ck� +, & +�ݔt�s +); + +197 + `mosqu�to__� +( +��_�ck� +. +�yl�d +); + +198 if( +rc +){ + +199 + `mosqu�to__� +( +chunk +-> +sour� +. +id +); + +200 + `mosqu�to__� +( +chunk +-> +sour� +. +u��ame +); + +201 + `mosqu�to__� +( +chunk +-> +t�ic +); + +202 +rc +; + +205 +chunk +-> +�ݔt�s + =�roperties; + +207 +MOSQ_ERR_SUCCESS +; + +208 +�r� +: + +209 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: %s.", + `���� +( +��o +)); + +210 + `mosqu�to__� +( +chunk +-> +sour� +. +id +); + +211 + `mosqu�to__� +( +chunk +-> +sour� +. +u��ame +); + +212 + `mosqu�to__� +( +chunk +-> +t�ic +); + +213 + `mosqu�to__� +( +��_�ck� +. +�yl�d +); + +215 + } +} + +218 + $�rsi�__chunk_���_�ad_v5 +( +FILE + * +db_� +, +P_��� + * +chunk +) + +220 if( + `�d +(& +chunk +-> +F +, ( +P_��� +), 1, +db_� +) != 1){ + +221 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: %s.", + `���� +( +��o +)); + +224 +MOSQ_ERR_SUCCESS +; + +225 + } +} + +228 + $�rsi�__chunk_sub_�ad_v5 +( +FILE + * +db_� +, +P_sub + * +chunk +) + +230 +rc +; + +232 + `�ad_e +( +db_� +, & +chunk +-> +F +, ( +PF_sub +)); + +233 +chunk +-> +F +. +id�tif�r + = + `�ohl +(chunk->F.identifier); + +234 +chunk +-> +F +. +id_�n + = + `�ohs +(chunk->F.id_len); + +235 +chunk +-> +F +. +t�ic_�n + = + `�ohs +(chunk->F.topic_len); + +237 +rc + = + `�rsi�__�ad_�r�g_�n +( +db_� +, & +chunk +-> +���_id +, chunk-> +F +. +id_�n +); + +238 if( +rc +){ + +239 +rc +; + +241 +rc + = + `�rsi�__�ad_�r�g_�n +( +db_� +, & +chunk +-> +t�ic +, chunk-> +F +. +t�ic_�n +); + +242 if( +rc +){ + +243 + `mosqu�to__� +( +chunk +-> +���_id +); + +244 +chunk +-> +���_id + = +NULL +; + +245 +rc +; + +248 +MOSQ_ERR_SUCCESS +; + +249 +�r� +: + +250 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: %s.", + `���� +( +��o +)); + +252 + } +} + + @src/persist_write.c + +17 + ~"c�fig.h +" + +19 #ifde� +WITH_PERSISTENCE + + +21 #i�de� +WIN32 + + +22 + ~<��/��.h +> + +24 + ~<as��.h +> + +25 + ~<��o.h +> + +26 + ~<f��.h +> + +27 + ~<�dio.h +> + +28 + ~<�r�g.h +> + +29 + ~<sys/��.h +> + +30 + ~<time.h +> + +32 + ~"mosqu�to_brok�_����.h +" + +33 + ~"mem�y_mosq.h +" + +34 + ~"�rsi�.h +" + +35 + ~"time_mosq.h +" + +36 + ~"ut�_mosq.h +" + +38 + $�rsi�__���_mes�ges_�ve +( +mosqu�to_db + * +db +, +FILE + * +db_� +, +mosqu�to + * +cڋxt +, +mosqu�to_���_msg + * +queue +) + +40 +P_���_msg + +chunk +; + +41 +mosqu�to_���_msg + * +cmsg +; + +42 +rc +; + +44 + `as�� +( +db +); + +45 + `as�� +( +db_� +); + +46 + `as�� +( +cڋxt +); + +48 + `mem�t +(& +chunk +, 0, ( +P_���_msg +)); + +50 +cmsg + = +queue +; + +51 +cmsg +){ + +52 if(! + `��cmp +( +cmsg +-> +��e +-> +t�ic +, "$SYS", 4) + +53 && +cmsg +-> +��e +-> +�f_cou� + <= 1 + +54 && +cmsg +-> +��e +-> +de�_id_cou� + == 0){ + +58 +cmsg + = cmsg-> +�xt +; + +62 +chunk +. +F +. +��e_id + = +cmsg +-> +��e +-> +db_id +; + +63 +chunk +. +F +. +mid + = +cmsg +->mid; + +64 +chunk +. +F +. +id_�n + = + `��� +( +cڋxt +-> +id +); + +65 +chunk +. +F +. +qos + = +cmsg +->qos; + +66 +chunk +. +F +. +���_dup + = ( +cmsg +-> +��� +&0x0F)<<4 | (cmsg-> +dup +&0x0F); + +67 +chunk +. +F +. +d�e�i� + = +cmsg +->direction; + +68 +chunk +. +F +. +��e + = +cmsg +->state; + +69 +chunk +. +���_id + = +cڋxt +-> +id +; + +70 +chunk +. +�ݔt�s + = +cmsg +->properties; + +72 +rc + = + `�rsi�__chunk_���_msg_wr�e_v5 +( +db_� +, & +chunk +); + +73 if( +rc +){ + +74 +rc +; + +77 +cmsg + = cmsg-> +�xt +; + +80 +MOSQ_ERR_SUCCESS +; + +81 + } +} + +84 + $�rsi�__mes�ge_��e_�ve +( +mosqu�to_db + * +db +, +FILE + * +db_� +) + +86 +P_msg_��e + +chunk +; + +87 +mosqu�to_msg_��e + * +��ed +; + +88 +rc +; + +90 + `as�� +( +db +); + +91 + `as�� +( +db_� +); + +93 + `mem�t +(& +chunk +, 0, ( +P_msg_��e +)); + +95 +��ed + = +db +-> +msg_��e +; + +96 +��ed +){ + +97 if( +��ed +-> +�f_cou� + < 1 || st�ed-> +t�ic + =� +NULL +){ + +98 +��ed + = st�ed-> +�xt +; + +102 if(! + `��cmp +( +��ed +-> +t�ic +, "$SYS", 4)){ + +103 if( +��ed +-> +�f_cou� + <�1 && st�ed-> +de�_id_cou� + == 0){ + +105 +��ed + = st�ed-> +�xt +; + +112 +chunk +. +F +. +��� + = 0; + +114 +chunk +. +F +. +��� + = ( +u�t8_t +) +��ed +->retain; + +117 +chunk +. +F +. +��e_id + = +��ed +-> +db_id +; + +118 +chunk +. +F +. +exp�y_time + = +��ed +-> +mes�ge_exp�y_time +; + +119 +chunk +. +F +. +�yl�d�n + = +��ed +->payloadlen; + +120 +chunk +. +F +. +sour�_mid + = +��ed +->source_mid; + +121 if( +��ed +-> +sour�_id +){ + +122 +chunk +. +F +. +sour�_id_�n + = + `��� +( +��ed +-> +sour�_id +); + +123 +chunk +. +sour� +. +id + = +��ed +-> +sour�_id +; + +125 +chunk +. +F +. +sour�_id_�n + = 0; + +126 +chunk +. +sour� +. +id + = +NULL +; + +128 if( +��ed +-> +sour�_u��ame +){ + +129 +chunk +. +F +. +sour�_u��ame_�n + = + `��� +( +��ed +-> +sour�_u��ame +); + +130 +chunk +. +sour� +. +u��ame + = +��ed +-> +sour�_u��ame +; + +132 +chunk +. +F +. +sour�_u��ame_�n + = 0; + +133 +chunk +. +sour� +. +u��ame + = +NULL +; + +136 +chunk +. +F +. +t�ic_�n + = + `��� +( +��ed +-> +t�ic +); + +137 +chunk +. +t�ic + = +��ed +->topic; + +139 if( +��ed +-> +sour�_li��� +){ + +140 +chunk +. +F +. +sour�_p�t + = +��ed +-> +sour�_li��� +-> +p�t +; + +142 +chunk +. +F +. +sour�_p�t + = 0; + +144 +chunk +. +F +. +qos + = +��ed +->qos; + +145 +chunk +. +�yl�d + = +��ed +->payload; + +146 +chunk +. +�ݔt�s + = +��ed +->properties; + +148 +rc + = + `�rsi�__chunk_mes�ge_��e_wr�e_v5 +( +db_� +, & +chunk +); + +149 if( +rc +){ + +150 +rc +; + +152 +��ed + = st�ed-> +�xt +; + +155 +MOSQ_ERR_SUCCESS +; + +156 + } +} + +158 + $�rsi�__���_�ve +( +mosqu�to_db + * +db +, +FILE + * +db_� +) + +160 +mosqu�to + * +cڋxt +, * +�xt_tmp +; + +161 +P_��� + +chunk +; + +162 +rc +; + +164 + `as�� +( +db +); + +165 + `as�� +( +db_� +); + +167 + `mem�t +(& +chunk +, 0, ( +P_��� +)); + +169 + `HASH_ITER +( +hh_id +, +db +-> +cڋxts_by_id +, +cڋxt +, +�xt_tmp +){ + +170 if( +cڋxt + && cڋxt-> +��n_��t + =� +�l� +){ + +171 +chunk +. +F +. +�ssi�_exp�y_time + = +cڋxt +->session_expiry_time; + +172 +chunk +. +F +. +�ssi�_exp�y_��rv� + = +cڋxt +->session_expiry_interval; + +173 +chunk +. +F +. +ϡ_mid + = +cڋxt +->last_mid; + +174 +chunk +. +F +. +id_�n + = + `��� +( +cڋxt +-> +id +); + +175 +chunk +. +���_id + = +cڋxt +-> +id +; + +177 +rc + = + `�rsi�__chunk_���_wr�e_v5 +( +db_� +, & +chunk +); + +178 if( +rc +){ + +179 +rc +; + +182 if( + `�rsi�__���_mes�ges_�ve +( +db +, +db_� +, +cڋxt +, cڋxt-> +msgs_� +. +��ight +)) 1; + +183 if( + `�rsi�__���_mes�ges_�ve +( +db +, +db_� +, +cڋxt +, cڋxt-> +msgs_� +. +queued +)) 1; + +184 if( + `�rsi�__���_mes�ges_�ve +( +db +, +db_� +, +cڋxt +, cڋxt-> +msgs_out +. +��ight +)) 1; + +185 if( + `�rsi�__���_mes�ges_�ve +( +db +, +db_� +, +cڋxt +, cڋxt-> +msgs_out +. +queued +)) 1; + +189 +MOSQ_ERR_SUCCESS +; + +190 + } +} + +193 + $�rsi�__subs_���_�ve +( +mosqu�to_db + * +db +, +FILE + * +db_� +, +mosqu�to__subh�r + * +node +, cڡ * +t�ic +, +�v� +) + +195 +mosqu�to__subh�r + * +subh�r +, * +subh�r_tmp +; + +196 +mosqu�to__sub�af + * +sub +; + +197 +P_��� + +���_chunk +; + +198 +P_sub + +sub_chunk +; + +199 * +thi��ic +; + +200 +size_t + +�� +; + +201 +rc +; + +203 + `mem�t +(& +���_chunk +, 0, ( +P_��� +)); + +204 + `mem�t +(& +sub_chunk +, 0, ( +P_sub +)); + +206 +�� + = + `��� +( +t�ic +�+ +node +-> +t�ic_�n + + 2; + +207 +thi��ic + = + `mosqu�to__m�loc +(()* +�� +); + +208 if(! +thi��ic +� +MOSQ_ERR_NOMEM +; + +209 if( +�v� + > 1 || + `��� +( +t�ic +)){ + +210 + `���tf +( +thi��ic +, +�� +, "%s/%s", +t�ic +, +node +->topic); + +212 + `���tf +( +thi��ic +, +�� +, "%s", +node +-> +t�ic +); + +215 +sub + = +node +-> +subs +; + +216 +sub +){ + +217 if( +sub +-> +cڋxt +-> +��n_��t + =� +�l� + && sub->cڋxt-> +id +){ + +218 +sub_chunk +. +F +. +id�tif�r + = +sub +->identifier; + +219 +sub_chunk +. +F +. +id_�n + = + `��� +( +sub +-> +cڋxt +-> +id +); + +220 +sub_chunk +. +F +. +t�ic_�n + = + `��� +( +thi��ic +); + +221 +sub_chunk +. +F +. +qos + = ( +u�t8_t +) +sub +->qos; + +222 +sub_chunk +. +F +. +�ti�s + = +sub +-> +no_lo�l +<<2 | sub-> +���_as_published +<<3; + +223 +sub_chunk +. +���_id + = +sub +-> +cڋxt +-> +id +; + +224 +sub_chunk +. +t�ic + = +thi��ic +; + +226 +rc + = + `�rsi�__chunk_sub_wr�e_v5 +( +db_� +, & +sub_chunk +); + +227 if( +rc +){ + +228 + `mosqu�to__� +( +thi��ic +); + +229 +rc +; + +232 +sub + = sub-> +�xt +; + +234 if( +node +-> +���ed +){ + +235 if( + `��cmp +( +node +-> +���ed +-> +t�ic +, "$SYS", 4)){ + +237 +���_chunk +. +F +. +��e_id + = +node +-> +���ed +-> +db_id +; + +238 +rc + = + `�rsi�__chunk_���_wr�e_v5 +( +db_� +, & +���_chunk +); + +239 if( +rc +){ + +240 + `mosqu�to__� +( +thi��ic +); + +241 +rc +; + +246 + `HASH_ITER +( +hh +, +node +-> +ch�d�n +, +subh�r +, +subh�r_tmp +){ + +247 + `�rsi�__subs_���_�ve +( +db +, +db_� +, +subh�r +, +thi��ic +, +�v� ++1); + +249 + `mosqu�to__� +( +thi��ic +); + +250 +MOSQ_ERR_SUCCESS +; + +251 + } +} + +253 + $�rsi�__subs_���_�ve_�l +( +mosqu�to_db + * +db +, +FILE + * +db_� +) + +255 +mosqu�to__subh�r + * +subh�r +, * +subh�r_tmp +; + +257 + `HASH_ITER +( +hh +, +db +-> +subs +, +subh�r +, +subh�r_tmp +){ + +258 if( +subh�r +-> +ch�d�n +){ + +259 + `�rsi�__subs_���_�ve +( +db +, +db_� +, +subh�r +-> +ch�d�n +, "", 0); + +263 +MOSQ_ERR_SUCCESS +; + +264 + } +} + +266 + $�rsi�__backup +( +mosqu�to_db + * +db +, +bo� + +shutdown +) + +268 +rc + = 0; + +269 +FILE + * +db_� + = +NULL +; + +270 +u�t32_t + +db_v�si�_w + = + `ht�l +( +MOSQ_DB_VERSION +); + +271 +u�t32_t + +�c + = 0; + +272 * +�r +; + +273 * +outf�e + = +NULL +; + +274 +�n +; + +275 +PF_cfg + +cfg_chunk +; + +277 if(! +db + || !db-> +c�fig + || !db->c�fig-> +�rsi���_f���h +� +MOSQ_ERR_INVAL +; + +278 if( +db +-> +c�fig +-> +�rsi��� + =� +�l� +� +MOSQ_ERR_SUCCESS +; + +280 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "Sav�g in-mem�y d�aba���%s.", +db +-> +c�fig +-> +�rsi���_f���h +); + +282 +�n + = + `��� +( +db +-> +c�fig +-> +�rsi���_f���h +)+5; + +283 +outf�e + = + `mosqu�to__m�loc +( +�n ++1); + +284 if(! +outf�e +){ + +285 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "Error saving in-memory database, out of memory."); + +286 +MOSQ_ERR_NOMEM +; + +288 + `���tf +( +outf�e +, +�n +, "%s.�w", +db +-> +c�fig +-> +�rsi���_f���h +); + +289 +outf�e +[ +�n +] = '\0'; + +291 #i�de� +WIN32 + + +311 +rc + = + `uƚk +( +outf�e +); + +312 i�( +rc + != 0) { + +313 +rc + = 0; + +314 i�( +��o + !� +ENOENT +) { + +315 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "E�� sav�g in-mem�y d�aba�, u�bˁػmov�%s.", +outf�e +); + +316 +�r� +; + +321 +db_� + = + `mosqu�to__fݒ +( +outf�e +, "wb", +�ue +); + +322 if( +db_� + =� +NULL +){ + +323 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "E�� sav�g in-mem�y d�aba�, u�bˁ�ݒ %�f� wr��g.", +outf�e +); + +324 +�r� +; + +328 + `wr�e_e +( +db_� +, +magic +, 15); + +329 + `wr�e_e +( +db_� +, & +�c +, ( +u�t32_t +)); + +330 + `wr�e_e +( +db_� +, & +db_v�si�_w +, ( +u�t32_t +)); + +332 + `mem�t +(& +cfg_chunk +, 0, ( +PF_cfg +)); + +333 +cfg_chunk +. +ϡ_db_id + = +db +->last_db_id; + +334 +cfg_chunk +. +shutdown + = shutdown; + +335 +cfg_chunk +. +dbid_size + = ( +dbid_t +); + +336 if( + `�rsi�__chunk_cfg_wr�e_v5 +( +db_� +, & +cfg_chunk +)){ + +337 +�r� +; + +340 if( + `�rsi�__mes�ge_��e_�ve +( +db +, +db_� +)){ + +341 +�r� +; + +344 + `�rsi�__���_�ve +( +db +, +db_� +); + +345 + `�rsi�__subs_���_�ve_�l +( +db +, +db_� +); + +347 #i�de� +WIN32 + + +370 + `f�ush +( +db_� +); + +371 + `fsync +( + `f��o +( +db_� +)); + +373 + `f�o� +( +db_� +); + +375 #ifde� +WIN32 + + +376 if( + `�move +( +db +-> +c�fig +-> +�rsi���_f���h +) != 0){ + +377 if( +��o + !� +ENOENT +){ + +378 +�r� +; + +382 if( + `��me +( +outf�e +, +db +-> +c�fig +-> +�rsi���_f���h +) != 0){ + +383 +�r� +; + +385 + `mosqu�to__� +( +outf�e +); + +386 +outf�e + = +NULL +; + +387 +rc +; + +388 +�r� +: + +389 + `mosqu�to__� +( +outf�e +); + +390 +�r + = + `���� +( +��o +); + +391 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: %s.", +�r +); + +392 if( +db_� +� + `f�o� +(db_fptr); + +394 + } +} + + @src/persist_write_v5.c + +17 + ~"c�fig.h +" + +19 #ifde� +WITH_PERSISTENCE + + +21 #i�de� +WIN32 + + +22 + ~<��/��.h +> + +24 + ~<as��.h +> + +25 + ~<��o.h +> + +26 + ~<f��.h +> + +27 + ~<�dio.h +> + +28 + ~<�r�g.h +> + +29 + ~<sys/��.h +> + +30 + ~<time.h +> + +32 + ~"mosqu�to_brok�_����.h +" + +33 + ~"mem�y_mosq.h +" + +34 + ~"�rsi�.h +" + +35 + ~"�ck�_mosq.h +" + +36 + ~"�ݔty_mosq.h +" + +37 + ~"time_mosq.h +" + +38 + ~"ut�_mosq.h +" + +40 + $�rsi�__chunk_cfg_wr�e_v5 +( +FILE + * +db_� +, +PF_cfg + * +chunk +) + +42 +PF_h�d� + +h�d� +; + +44 +h�d� +. +chunk + = + `ht�l +( +DB_CHUNK_CFG +); + +45 +h�d� +. +�ngth + = + `ht�l +(( +PF_cfg +)); + +46 + `wr�e_e +( +db_� +, & +h�d� +, ( +PF_h�d� +)); + +47 + `wr�e_e +( +db_� +, +chunk +, ( +PF_cfg +)); + +49 +MOSQ_ERR_SUCCESS +; + +50 +�r� +: + +51 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: %s.", + `���� +( +��o +)); + +53 + } +} + +56 + $�rsi�__chunk_���_wr�e_v5 +( +FILE + * +db_� +, +P_��� + * +chunk +) + +58 +PF_h�d� + +h�d� +; + +59 +u�t16_t + +id_�n + = +chunk +-> +F +.id_len; + +61 +chunk +-> +F +. +�ssi�_exp�y_��rv� + = + `ht�l +(chunk->F.session_expiry_interval); + +62 +chunk +-> +F +. +ϡ_mid + = + `ht�s +(chunk->F.last_mid); + +63 +chunk +-> +F +. +id_�n + = + `ht�s +(chunk->F.id_len); + +65 +h�d� +. +chunk + = + `ht�l +( +DB_CHUNK_CLIENT +); + +66 +h�d� +. +�ngth + = + `ht�l +(( +PF_��� +)+ +id_�n +); + +68 + `wr�e_e +( +db_� +, & +h�d� +, ( +PF_h�d� +)); + +69 + `wr�e_e +( +db_� +, & +chunk +-> +F +, ( +PF_��� +)); + +71 + `wr�e_e +( +db_� +, +chunk +-> +���_id +, +id_�n +); + +73 +MOSQ_ERR_SUCCESS +; + +74 +�r� +: + +75 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: %s.", + `���� +( +��o +)); + +77 + } +} + +80 + $�rsi�__chunk_���_msg_wr�e_v5 +( +FILE + * +db_� +, +P_���_msg + * +chunk +) + +82 +PF_h�d� + +h�d� +; + +83 +mosqu�to__�ck� + +��_�ck� +; + +84 +u�t16_t + +id_�n + = +chunk +-> +F +.id_len; + +85 +u�t32_t + +���n + = 0; + +86 +rc +; + +88 + `mem�t +(& +��_�ck� +, 0, ( +mosqu�to__�ck� +)); + +89 if( +chunk +-> +�ݔt�s +){ + +90 +���n + = + `�ݔty__g�_�ngth_�l +( +chunk +-> +�ݔt�s +); + +91 +���n + +� + `�ck�__v��t_by�s +(proplen); + +94 +chunk +-> +F +. +mid + = + `ht�s +(chunk->F.mid); + +95 +chunk +-> +F +. +id_�n + = + `ht�s +(chunk->F.id_len); + +97 +h�d� +. +chunk + = + `ht�l +( +DB_CHUNK_CLIENT_MSG +); + +98 +h�d� +. +�ngth + = + `ht�l +(( +PF_���_msg +�+ +id_�n + + +���n +); + +100 + `wr�e_e +( +db_� +, & +h�d� +, ( +PF_h�d� +)); + +101 + `wr�e_e +( +db_� +, & +chunk +-> +F +, ( +PF_���_msg +)); + +102 + `wr�e_e +( +db_� +, +chunk +-> +���_id +, +id_�n +); + +103 if( +chunk +-> +�ݔt�s +){ + +104 if( +���n + > 0){ + +105 +��_�ck� +. +�ma��g_�ngth + = +���n +; + +106 +��_�ck� +. +�ck�_�ngth + = +���n +; + +107 +��_�ck� +. +�yl�d + = + `mosqu�to__m�loc +( +���n +); + +108 if(! +��_�ck� +. +�yl�d +){ + +109 +MOSQ_ERR_NOMEM +; + +111 +rc + = + `�ݔty__wr�e_�l +(& +��_�ck� +, +chunk +-> +�ݔt�s +, +�ue +); + +112 if( +rc +) �c; + +114 + `wr�e_e +( +db_� +, +��_�ck� +. +�yl�d +, +���n +); + +115 + `mosqu�to__� +( +��_�ck� +. +�yl�d +); + +119 +MOSQ_ERR_SUCCESS +; + +120 +�r� +: + +121 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: %s.", + `���� +( +��o +)); + +123 + } +} + +126 + $�rsi�__chunk_mes�ge_��e_wr�e_v5 +( +FILE + * +db_� +, +P_msg_��e + * +chunk +) + +128 +PF_h�d� + +h�d� +; + +129 +u�t32_t + +�yl�d�n + = +chunk +-> +F +.payloadlen; + +130 +u�t16_t + +sour�_id_�n + = +chunk +-> +F +.source_id_len; + +131 +u�t16_t + +sour�_u��ame_�n + = +chunk +-> +F +.source_username_len; + +132 +u�t16_t + +t�ic_�n + = +chunk +-> +F +.topic_len; + +133 +u�t32_t + +���n + = 0; + +134 +mosqu�to__�ck� + +��_�ck� +; + +135 +rc +; + +137 + `mem�t +(& +��_�ck� +, 0, ( +mosqu�to__�ck� +)); + +138 if( +chunk +-> +�ݔt�s +){ + +139 +���n + = + `�ݔty__g�_�ngth_�l +( +chunk +-> +�ݔt�s +); + +140 +���n + +� + `�ck�__v��t_by�s +(proplen); + +143 +chunk +-> +F +. +�yl�d�n + = + `ht�l +(chunk->F.payloadlen); + +144 +chunk +-> +F +. +sour�_mid + = + `ht�s +(chunk->F.source_mid); + +145 +chunk +-> +F +. +sour�_id_�n + = + `ht�s +(chunk->F.source_id_len); + +146 +chunk +-> +F +. +sour�_u��ame_�n + = + `ht�s +(chunk->F.source_username_len); + +147 +chunk +-> +F +. +t�ic_�n + = + `ht�s +(chunk->F.topic_len); + +148 +chunk +-> +F +. +sour�_p�t + = + `ht�s +(chunk->F.source_port); + +150 +h�d� +. +chunk + = + `ht�l +( +DB_CHUNK_MSG_STORE +); + +151 +h�d� +. +�ngth + = + `ht�l +(( +PF_msg_��e +) + + +152 +t�ic_�n + + +�yl�d�n + + + +153 +sour�_id_�n + + +sour�_u��ame_�n + + +���n +); + +155 + `wr�e_e +( +db_� +, & +h�d� +, ( +PF_h�d� +)); + +156 + `wr�e_e +( +db_� +, & +chunk +-> +F +, ( +PF_msg_��e +)); + +157 if( +sour�_id_�n +){ + +158 + `wr�e_e +( +db_� +, +chunk +-> +sour� +. +id +, +sour�_id_�n +); + +160 if( +sour�_u��ame_�n +){ + +161 + `wr�e_e +( +db_� +, +chunk +-> +sour� +. +u��ame +, +sour�_u��ame_�n +); + +163 + `wr�e_e +( +db_� +, +chunk +-> +t�ic +, +t�ic_�n +); + +164 if( +�yl�d�n +){ + +165 + `wr�e_e +( +db_� +, + `UHPA_ACCESS +( +chunk +-> +�yl�d +, +�yl�d�n +), ()payloadlen); + +167 if( +chunk +-> +�ݔt�s +){ + +168 if( +���n + > 0){ + +169 +��_�ck� +. +�ma��g_�ngth + = +���n +; + +170 +��_�ck� +. +�ck�_�ngth + = +���n +; + +171 +��_�ck� +. +�yl�d + = + `mosqu�to__m�loc +( +���n +); + +172 if(! +��_�ck� +. +�yl�d +){ + +173 +MOSQ_ERR_NOMEM +; + +175 +rc + = + `�ݔty__wr�e_�l +(& +��_�ck� +, +chunk +-> +�ݔt�s +, +�ue +); + +176 if( +rc +) �c; + +178 + `wr�e_e +( +db_� +, +��_�ck� +. +�yl�d +, +���n +); + +179 + `mosqu�to__� +( +��_�ck� +. +�yl�d +); + +183 +MOSQ_ERR_SUCCESS +; + +184 +�r� +: + +185 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: %s.", + `���� +( +��o +)); + +186 + `mosqu�to__� +( +��_�ck� +. +�yl�d +); + +188 + } +} + +191 + $�rsi�__chunk_���_wr�e_v5 +( +FILE + * +db_� +, +P_��� + * +chunk +) + +193 +PF_h�d� + +h�d� +; + +195 +h�d� +. +chunk + = + `ht�l +( +DB_CHUNK_RETAIN +); + +196 +h�d� +. +�ngth + = + `ht�l +(( +PF_��� +)); + +198 + `wr�e_e +( +db_� +, & +h�d� +, ( +PF_h�d� +)); + +199 + `wr�e_e +( +db_� +, & +chunk +-> +F +, ( +PF_��� +)); + +201 +MOSQ_ERR_SUCCESS +; + +202 +�r� +: + +203 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: %s.", + `���� +( +��o +)); + +205 + } +} + +208 + $�rsi�__chunk_sub_wr�e_v5 +( +FILE + * +db_� +, +P_sub + * +chunk +) + +210 +PF_h�d� + +h�d� +; + +211 +u�t16_t + +id_�n + = +chunk +-> +F +.id_len; + +212 +u�t16_t + +t�ic_�n + = +chunk +-> +F +.topic_len; + +214 +chunk +-> +F +. +id�tif�r + = + `ht�l +(chunk->F.identifier); + +215 +chunk +-> +F +. +id_�n + = + `ht�s +(chunk->F.id_len); + +216 +chunk +-> +F +. +t�ic_�n + = + `ht�s +(chunk->F.topic_len); + +218 +h�d� +. +chunk + = + `ht�l +( +DB_CHUNK_SUB +); + +219 +h�d� +. +�ngth + = + `ht�l +(( +PF_sub +) + + +220 +id_�n + + +t�ic_�n +); + +222 + `wr�e_e +( +db_� +, & +h�d� +, ( +PF_h�d� +)); + +223 + `wr�e_e +( +db_� +, & +chunk +-> +F +, ( +PF_sub +)); + +224 + `wr�e_e +( +db_� +, +chunk +-> +���_id +, +id_�n +); + +225 + `wr�e_e +( +db_� +, +chunk +-> +t�ic +, +t�ic_�n +); + +227 +MOSQ_ERR_SUCCESS +; + +228 +�r� +: + +229 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: %s.", + `���� +( +��o +)); + +231 + } +} + + @src/plugin.c + +17 + ~"c�fig.h +" + +19 + ~"mosqu�to_brok�_����.h +" + +20 + ~"mosqu�to_����.h +" + +21 + ~"mosqu�to_brok�.h +" + +22 + ~"mem�y_mosq.h +" + +24 #ifde� +WITH_TLS + + +25 + ~<ݒs�/s�.h +> + +28 cڡ * + $mosqu�to_���_add�ss +(cڡ +mosqu�to + * +��� +) + +30 +��� +-> +add�ss +; + +31 + } +} + +34 +bo� + + $mosqu�to_���_��n_�ssi� +(cڡ +mosqu�to + * +��� +) + +36 +��� +-> +��n_��t +; + +37 + } +} + +40 cڡ * + $mosqu�to_���_id +(cڡ +mosqu�to + * +��� +) + +42 +��� +-> +id +; + +43 + } +} + +46 + $mosqu�to_���_k��live +(cڡ +mosqu�to + * +��� +) + +48 +��� +-> +k��live +; + +49 + } +} + +52 * + $mosqu�to_���_��ifi�� +(cڡ +mosqu�to + * +��� +) + +54 #ifde� +WITH_TLS + + +55 if( +��� +-> +s� +){ + +56 + `SSL_g�_��_��ifi�� +( +��� +-> +s� +); + +58 +NULL +; + +61 +NULL +; + +63 + } +} + +66 + $mosqu�to_���_��oc� +(cڡ +mosqu�to + * +��� +) + +68 +��� +-> +��oc� +; + +69 + } +} + +72 + $mosqu�to_���_sub_cou� +(cڡ +mosqu�to + * +��� +) + +74 +��� +-> +sub_cou� +; + +75 + } +} + +78 cڡ * + $mosqu�to_���_u��ame +(cڡ +mosqu�to + * +cڋxt +) + +80 #ifde� +WITH_BRIDGE + + +81 if( +cڋxt +-> +bridge +){ + +82 +cڋxt +-> +bridge +-> +lo�l_u��ame +; + +86 +cڋxt +-> +u��ame +; + +88 + } +} + +90 + $mosqu�to_�t_u��ame +( +mosqu�to + * +��� +, cڡ * +u��ame +) + +92 * +u_dup +; + +93 * +�d +; + +94 +rc +; + +96 if(! +��� +� +MOSQ_ERR_INVAL +; + +98 if( +u��ame +){ + +99 +u_dup + = + `mosqu�to__�rdup +( +u��ame +); + +100 if(! +u_dup +� +MOSQ_ERR_NOMEM +; + +102 +u_dup + = +NULL +; + +105 +�d + = +��� +-> +u��ame +; + +106 +��� +-> +u��ame + = +u_dup +; + +108 +rc + = + `a�__f�d_a�s +( + `mosqu�to__g�_db +(), +��� +); + +109 if( +rc +){ + +110 +��� +-> +u��ame + = +�d +; + +111 + `mosqu�to__� +( +u_dup +); + +112 +rc +; + +114 + `mosqu�to__� +( +�d +); + +115 +MOSQ_ERR_SUCCESS +; + +117 + } +} + + @src/plugin_defer.c + +19 + ~<�dio.h +> + +21 + ~"mosqu�to_brok�.h +" + +22 + ~"mosqu�to_�ug�.h +" + +23 + ~"mosqu�to.h +" + +25 + $mosqu�to_auth_�ug�_v�si� +() + +27 +MOSQ_AUTH_PLUGIN_VERSION +; + +28 + } +} + +30 + $mosqu�to_auth_�ug�_�� +(** +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +32 +MOSQ_ERR_SUCCESS +; + +33 + } +} + +35 + $mosqu�to_auth_�ug�_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +37 +MOSQ_ERR_SUCCESS +; + +38 + } +} + +40 + $mosqu�to_auth_�cur�y_�� +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +42 +MOSQ_ERR_SUCCESS +; + +43 + } +} + +45 + $mosqu�to_auth_�cur�y_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +47 +MOSQ_ERR_SUCCESS +; + +48 + } +} + +50 + $mosqu�to_auth_a�_check +(* +u�r_d�a +, +ac�ss +, cڡ +mosqu�to + * +��� +, +mosqu�to_a�_msg + * +msg +) + +52 + `��tf +("mosqu�to_a�_check(u:%s)\n", + `mosqu�to_���_u��ame +( +��� +)); + +53 +MOSQ_ERR_PLUGIN_DEFER +; + +54 + } +} + +56 + $mosqu�to_auth_u�wd_check +(* +u�r_d�a +, cڡ +mosqu�to + * +��� +, cڡ * +u��ame +, cڡ * +�ssw�d +) + +58 +MOSQ_ERR_PLUGIN_DEFER +; + +59 + } +} + +61 + $mosqu�to_auth_psk_key_g� +(* +u�r_d�a +, cڡ +mosqu�to + * +��� +, cڡ * +h�t +, cڡ * +id�t�y +, * +key +, +max_key_�n +) + +63 +MOSQ_ERR_PLUGIN_DEFER +; + +64 + } +} + + @src/property_broker.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<�dio.h +> + +21 + ~<�r�g.h +> + +23 + ~"mosqu�to_brok�_����.h +" + +24 + ~"mq�_��oc�.h +" + +25 + ~"�ݔty_mosq.h +" + +29 + $�ݔty__�o�ss_c��� +( +mosqu�to + * +cڋxt +, +mosqu�to_�ݔty + ** +��s +) + +31 +mosqu�to_�ݔty + * +p +; + +33 +p + = * +��s +; + +35 +p +){ + +36 if( +p +-> +id�tif�r + =� +MQTT_PROP_SESSION_EXPIRY_INTERVAL +){ + +37 +cڋxt +-> +�ssi�_exp�y_��rv� + = +p +-> +v�ue +. +i32 +; + +38 }if( +p +-> +id�tif�r + =� +MQTT_PROP_RECEIVE_MAXIMUM +){ + +39 if( +p +-> +v�ue +. +i16 + == 0){ + +40 +MOSQ_ERR_PROTOCOL +; + +43 +cڋxt +-> +msgs_out +. +��ight_maximum + = +p +-> +v�ue +. +i16 +; + +44 +cڋxt +-> +msgs_out +. +��ight_qu�a + = cڋxt->msgs_out. +��ight_maximum +; + +45 }if( +p +-> +id�tif�r + =� +MQTT_PROP_MAXIMUM_PACKET_SIZE +){ + +46 if( +p +-> +v�ue +. +i32 + == 0){ + +47 +MOSQ_ERR_PROTOCOL +; + +49 +cڋxt +-> +maximum_�ck�_size + = +p +-> +v�ue +. +i32 +; + +51 +p + =�-> +�xt +; + +54 +MOSQ_ERR_SUCCESS +; + +55 + } +} + +58 + $�ݔty__�o�ss_w�l +( +mosqu�to + * +cڋxt +, +mosqu�to_mes�ge_�l + * +msg +, +mosqu�to_�ݔty + ** +��s +) + +60 +mosqu�to_�ݔty + * +p +, * +p_�ev +; + +61 +mosqu�to_�ݔty + * +msg_�ݔt�s +, * +msg_�ݔt�s_ϡ +; + +63 +p + = * +��s +; + +64 +p_�ev + = +NULL +; + +65 +msg_�ݔt�s + = +NULL +; + +66 +msg_�ݔt�s_ϡ + = +NULL +; + +67 +p +){ + +68 +p +-> +id�tif�r +){ + +69 +MQTT_PROP_CONTENT_TYPE +: + +70 +MQTT_PROP_CORRELATION_DATA +: + +71 +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +: + +72 +MQTT_PROP_RESPONSE_TOPIC +: + +73 +MQTT_PROP_USER_PROPERTY +: + +74 if( +msg_�ݔt�s +){ + +75 +msg_�ݔt�s_ϡ +-> +�xt + = +p +; + +76 +msg_�ݔt�s_ϡ + = +p +; + +78 +msg_�ݔt�s + = +p +; + +79 +msg_�ݔt�s_ϡ + = +p +; + +81 if( +p_�ev +){ + +82 +p_�ev +-> +�xt + = +p +->next; + +83 +p + = +p_�ev +-> +�xt +; + +85 * +��s + = +p +-> +�xt +; + +86 +p + = * +��s +; + +88 +msg_�ݔt�s_ϡ +-> +�xt + = +NULL +; + +91 +MQTT_PROP_WILL_DELAY_INTERVAL +: + +92 +cڋxt +-> +w�l_d�ay_��rv� + = +p +-> +v�ue +. +i32 +; + +93 +p_�ev + = +p +; + +94 +p + =�-> +�xt +; + +97 +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +: + +98 +msg +-> +exp�y_��rv� + = +p +-> +v�ue +. +i32 +; + +99 +p_�ev + = +p +; + +100 +p + =�-> +�xt +; + +104 +MOSQ_ERR_PROTOCOL +; + +109 +msg +-> +�ݔt�s + = +msg_�ݔt�s +; + +110 +MOSQ_ERR_SUCCESS +; + +111 + } +} + +116 + $�ݔty__�o�ss_disc��� +( +mosqu�to + * +cڋxt +, +mosqu�to_�ݔty + ** +��s +) + +118 +mosqu�to_�ݔty + * +p +; + +120 +p + = * +��s +; + +122 +p +){ + +123 if( +p +-> +id�tif�r + =� +MQTT_PROP_SESSION_EXPIRY_INTERVAL +){ + +124 if( +cڋxt +-> +�ssi�_exp�y_��rv� + =�0 && +p +-> +v�ue +. +i32 + != 0){ + +125 +MOSQ_ERR_PROTOCOL +; + +127 +cڋxt +-> +�ssi�_exp�y_��rv� + = +p +-> +v�ue +. +i32 +; + +129 +p + =�-> +�xt +; + +131 +MOSQ_ERR_SUCCESS +; + +132 + } +} + + @src/read_handle.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +20 + ~<�dio.h +> + +21 + ~<�r�g.h +> + +23 + ~"mosqu�to_brok�_����.h +" + +24 + ~"mq�_��oc�.h +" + +25 + ~"mem�y_mosq.h +" + +26 + ~"�ck�_mosq.h +" + +27 + ~"�ad_h�d�.h +" + +28 + ~"�nd_mosq.h +" + +29 + ~"sys_��.h +" + +30 + ~"ut�_mosq.h +" + +33 + $h�d�__�ck� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +35 if(! +cڋxt +� +MOSQ_ERR_INVAL +; + +37 ( +cڋxt +-> +�_�ck� +. +comm�d +)&0xF0){ + +38 +CMD_PINGREQ +: + +39 + `h�d�__p�g�q +( +cڋxt +); + +40 +CMD_PINGRESP +: + +41 + `h�d�__p�g�� +( +cڋxt +); + +42 +CMD_PUBACK +: + +43 + `h�d�__pubackcomp +( +db +, +cڋxt +, "PUBACK"); + +44 +CMD_PUBCOMP +: + +45 + `h�d�__pubackcomp +( +db +, +cڋxt +, "PUBCOMP"); + +46 +CMD_PUBLISH +: + +47 + `h�d�__publish +( +db +, +cڋxt +); + +48 +CMD_PUBREC +: + +49 + `h�d�__pub�c +( +db +, +cڋxt +); + +50 +CMD_PUBREL +: + +51 + `h�d�__pub�l +( +db +, +cڋxt +); + +52 +CMD_CONNECT +: + +53 + `h�d�__c��� +( +db +, +cڋxt +); + +54 +CMD_DISCONNECT +: + +55 + `h�d�__disc��� +( +db +, +cڋxt +); + +56 +CMD_SUBSCRIBE +: + +57 + `h�d�__subs�ibe +( +db +, +cڋxt +); + +58 +CMD_UNSUBSCRIBE +: + +59 + `h�d�__unsubs�ibe +( +db +, +cڋxt +); + +60 #ifde� +WITH_BRIDGE + + +61 +CMD_CONNACK +: + +62 + `h�d�__c��ck +( +db +, +cڋxt +); + +63 +CMD_SUBACK +: + +64 + `h�d�__suback +( +cڋxt +); + +65 +CMD_UNSUBACK +: + +66 + `h�d�__unsuback +( +cڋxt +); + +68 +CMD_AUTH +: + +69 + `h�d�__auth +( +db +, +cڋxt +); + +72 +MOSQ_ERR_PROTOCOL +; + +74 + } +} + + @src/security.c + +17 + ~"c�fig.h +" + +19 + ~<�dio.h +> + +20 + ~<�r�g.h +> + +22 + ~"mosqu�to_brok�_����.h +" + +23 + ~"mosqu�to_�ug�.h +" + +24 + ~"mem�y_mosq.h +" + +25 + ~"lib_l�d.h +" + +27 (* + tFUNC_auth_�ug�_v�si� +)(); + +29 + `�cur�y__��nup_s�g� +( +mosqu�to__�cur�y_�ti�s + * +�ts +, +bo� + +�l�d +); + +31 + $LIB_ERROR +() + +33 #ifde� +WIN32 + + +34 * +buf +; + +35 + `F�m�Mes�ge +( +FORMAT_MESSAGE_ALLOCATE_BUFFER + | +FORMAT_MESSAGE_FROM_STRING +, + +36 +NULL +, + `G�La�E�� +(), +LANG_NEUTRAL +, & +buf +, 0, NULL); + +37 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "L�d���: %s", +buf +); + +38 + `Lo�lF�e +( +buf +); + +40 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "L�d���: %s", + `d˼� +()); + +42 + } +} + +45 + $�cur�y__l�d_v2 +( +mosqu�to__auth_�ug� + * +�ug� +, +mosqu�to_auth_�t + * +auth_�ti�s +, +auth_�ti�_cou� +, * +lib +) + +47 +rc +; + +49 if(!( +�ug� +-> +�ug�_��_v2 + = ( +FUNC_auth_�ug�_��_v2 +) + `LIB_SYM +( +lib +, "mosquitto_auth_plugin_init"))){ + +50 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +52 + `LIB_ERROR +(); + +53 + `LIB_CLOSE +( +lib +); + +56 if(!( +�ug� +-> +�ug�_��nup_v2 + = ( +FUNC_auth_�ug�_��nup_v2 +) + `LIB_SYM +( +lib +, "mosquitto_auth_plugin_cleanup"))){ + +57 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +59 + `LIB_ERROR +(); + +60 + `LIB_CLOSE +( +lib +); + +64 if(!( +�ug� +-> +�cur�y_��_v2 + = ( +FUNC_auth_�ug�_�cur�y_��_v2 +) + `LIB_SYM +( +lib +, "mosquitto_auth_security_init"))){ + +65 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +67 + `LIB_ERROR +(); + +68 + `LIB_CLOSE +( +lib +); + +72 if(!( +�ug� +-> +�cur�y_��nup_v2 + = ( +FUNC_auth_�ug�_�cur�y_��nup_v2 +) + `LIB_SYM +( +lib +, "mosquitto_auth_security_cleanup"))){ + +73 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +75 + `LIB_ERROR +(); + +76 + `LIB_CLOSE +( +lib +); + +80 if(!( +�ug� +-> +a�_check_v2 + = ( +FUNC_auth_�ug�_a�_check_v2 +) + `LIB_SYM +( +lib +, "mosquitto_auth_acl_check"))){ + +81 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +83 + `LIB_ERROR +(); + +84 + `LIB_CLOSE +( +lib +); + +88 if(!( +�ug� +-> +u�wd_check_v2 + = ( +FUNC_auth_�ug�_u�wd_check_v2 +) + `LIB_SYM +( +lib +, "mosquitto_auth_unpwd_check"))){ + +89 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +91 + `LIB_ERROR +(); + +92 + `LIB_CLOSE +( +lib +); + +96 if(!( +�ug� +-> +psk_key_g�_v2 + = ( +FUNC_auth_�ug�_psk_key_g�_v2 +) + `LIB_SYM +( +lib +, "mosquitto_auth_psk_key_get"))){ + +97 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +99 + `LIB_ERROR +(); + +100 + `LIB_CLOSE +( +lib +); + +104 +�ug� +-> +lib + =�ib; + +105 +�ug� +-> +u�r_d�a + = +NULL +; + +107 if( +�ug� +-> +�ug�_��_v2 +){ + +108 +rc + = +�ug� +-> + `�ug�_��_v2 +(&�ug�-> +u�r_d�a +, +auth_�ti�s +, +auth_�ti�_cou� +); + +109 if( +rc +){ + +110 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +111 "E��: Auth�ti�tiڅlug���u�ed %d wh� in��lis�g.", +rc +); + +112 +rc +; + +116 + } +} + +119 + $�cur�y__l�d_v3 +( +mosqu�to__auth_�ug� + * +�ug� +, +mosqu�to_�t + * +auth_�ti�s +, +auth_�ti�_cou� +, * +lib +) + +121 +rc +; + +123 if(!( +�ug� +-> +�ug�_��_v3 + = ( +FUNC_auth_�ug�_��_v3 +) + `LIB_SYM +( +lib +, "mosquitto_auth_plugin_init"))){ + +124 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +126 + `LIB_ERROR +(); + +127 + `LIB_CLOSE +( +lib +); + +130 if(!( +�ug� +-> +�ug�_��nup_v3 + = ( +FUNC_auth_�ug�_��nup_v3 +) + `LIB_SYM +( +lib +, "mosquitto_auth_plugin_cleanup"))){ + +131 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +133 + `LIB_ERROR +(); + +134 + `LIB_CLOSE +( +lib +); + +138 if(!( +�ug� +-> +�cur�y_��_v3 + = ( +FUNC_auth_�ug�_�cur�y_��_v3 +) + `LIB_SYM +( +lib +, "mosquitto_auth_security_init"))){ + +139 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +141 + `LIB_ERROR +(); + +142 + `LIB_CLOSE +( +lib +); + +146 if(!( +�ug� +-> +�cur�y_��nup_v3 + = ( +FUNC_auth_�ug�_�cur�y_��nup_v3 +) + `LIB_SYM +( +lib +, "mosquitto_auth_security_cleanup"))){ + +147 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +149 + `LIB_ERROR +(); + +150 + `LIB_CLOSE +( +lib +); + +154 if(!( +�ug� +-> +a�_check_v3 + = ( +FUNC_auth_�ug�_a�_check_v3 +) + `LIB_SYM +( +lib +, "mosquitto_auth_acl_check"))){ + +155 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +157 + `LIB_ERROR +(); + +158 + `LIB_CLOSE +( +lib +); + +162 if(!( +�ug� +-> +u�wd_check_v3 + = ( +FUNC_auth_�ug�_u�wd_check_v3 +) + `LIB_SYM +( +lib +, "mosquitto_auth_unpwd_check"))){ + +163 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +165 + `LIB_ERROR +(); + +166 + `LIB_CLOSE +( +lib +); + +170 if(!( +�ug� +-> +psk_key_g�_v3 + = ( +FUNC_auth_�ug�_psk_key_g�_v3 +) + `LIB_SYM +( +lib +, "mosquitto_auth_psk_key_get"))){ + +171 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +173 + `LIB_ERROR +(); + +174 + `LIB_CLOSE +( +lib +); + +178 +�ug� +-> +lib + =�ib; + +179 +�ug� +-> +u�r_d�a + = +NULL +; + +180 if( +�ug� +-> +�ug�_��_v3 +){ + +181 +rc + = +�ug� +-> + `�ug�_��_v3 +(&�ug�-> +u�r_d�a +, +auth_�ti�s +, +auth_�ti�_cou� +); + +182 if( +rc +){ + +183 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +184 "E��: Auth�ti�tiڅlug���u�ed %d wh� in��lis�g.", +rc +); + +185 +rc +; + +189 + } +} + +192 + $�cur�y__l�d_v4 +( +mosqu�to__auth_�ug� + * +�ug� +, +mosqu�to_�t + * +auth_�ti�s +, +auth_�ti�_cou� +, * +lib +) + +194 +rc +; + +196 if(!( +�ug� +-> +�ug�_��_v4 + = ( +FUNC_auth_�ug�_��_v4 +) + `LIB_SYM +( +lib +, "mosquitto_auth_plugin_init"))){ + +197 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +199 + `LIB_ERROR +(); + +200 + `LIB_CLOSE +( +lib +); + +203 if(!( +�ug� +-> +�ug�_��nup_v4 + = ( +FUNC_auth_�ug�_��nup_v4 +) + `LIB_SYM +( +lib +, "mosquitto_auth_plugin_cleanup"))){ + +204 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +206 + `LIB_ERROR +(); + +207 + `LIB_CLOSE +( +lib +); + +211 if(!( +�ug� +-> +�cur�y_��_v4 + = ( +FUNC_auth_�ug�_�cur�y_��_v4 +) + `LIB_SYM +( +lib +, "mosquitto_auth_security_init"))){ + +212 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +214 + `LIB_ERROR +(); + +215 + `LIB_CLOSE +( +lib +); + +219 if(!( +�ug� +-> +�cur�y_��nup_v4 + = ( +FUNC_auth_�ug�_�cur�y_��nup_v4 +) + `LIB_SYM +( +lib +, "mosquitto_auth_security_cleanup"))){ + +220 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +222 + `LIB_ERROR +(); + +223 + `LIB_CLOSE +( +lib +); + +227 if(!( +�ug� +-> +a�_check_v4 + = ( +FUNC_auth_�ug�_a�_check_v4 +) + `LIB_SYM +( +lib +, "mosquitto_auth_acl_check"))){ + +228 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +230 + `LIB_ERROR +(); + +231 + `LIB_CLOSE +( +lib +); + +235 +�ug� +-> +u�wd_check_v4 + = ( +FUNC_auth_�ug�_u�wd_check_v4 +) + `LIB_SYM +( +lib +, "mosquitto_auth_unpwd_check"); + +236 if( +�ug� +-> +u�wd_check_v4 +){ + +237 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, + +240 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, + +244 +�ug� +-> +psk_key_g�_v4 + = ( +FUNC_auth_�ug�_psk_key_g�_v4 +) + `LIB_SYM +( +lib +, "mosquitto_auth_psk_key_get"); + +245 if( +�ug� +-> +psk_key_g�_v4 +){ + +246 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, + +249 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, + +253 +�ug� +-> +auth_��t_v4 + = ( +FUNC_auth_�ug�_auth_��t_v4 +) + `LIB_SYM +( +lib +, "mosquitto_auth_start"); + +254 +�ug� +-> +auth_c�t�ue_v4 + = ( +FUNC_auth_�ug�_auth_c�t�ue_v4 +) + `LIB_SYM +( +lib +, "mosquitto_auth_continue"); + +256 if( +�ug� +-> +auth_��t_v4 +){ + +257 if( +�ug� +-> +auth_c�t�ue_v4 +){ + +258 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, + +261 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +263 + `LIB_CLOSE +( +lib +); + +267 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, + +271 +�ug� +-> +lib + =�ib; + +272 +�ug� +-> +u�r_d�a + = +NULL +; + +273 if( +�ug� +-> +�ug�_��_v4 +){ + +274 +rc + = +�ug� +-> + `�ug�_��_v4 +(&�ug�-> +u�r_d�a +, +auth_�ti�s +, +auth_�ti�_cou� +); + +275 if( +rc +){ + +276 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +277 "E��: Auth�ti�tiڅlug���u�ed %d wh� in��lis�g.", +rc +); + +278 +rc +; + +282 + } +} + +285 + $�cur�y__modu�_��_s�g� +( +mosqu�to__�cur�y_�ti�s + * +�ts +) + +287 * +lib +; + +288 (* +�ug�_v�si� +)(�� +NULL +; + +289 +v�si� +; + +290 +i +; + +291 +rc +; + +293 if( +�ts +-> +auth_�ug�_c�fig_cou� + == 0){ + +294 +MOSQ_ERR_SUCCESS +; + +297 +i +=0; i< +�ts +-> +auth_�ug�_c�fig_cou� +; i++){ + +298 if( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�th +){ + +299 + `mem�t +(& +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +, 0, ( +mosqu�to__auth_�ug� +)); + +301 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "L�d�g�lug�: %s", +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�th +); + +303 +lib + = + `LIB_LOAD +( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�th +); + +304 if(! +lib +){ + +305 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +306 "E��: U�bˁ�l�d�uth�lug� \"%s\".", +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�th +); + +307 + `LIB_ERROR +(); + +311 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +lib + = +NULL +; + +312 if(!( +�ug�_v�si� + = ( +FUNC_auth_�ug�_v�si� +) + `LIB_SYM +( +lib +, "mosquitto_auth_plugin_version"))){ + +313 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +315 + `LIB_ERROR +(); + +316 + `LIB_CLOSE +( +lib +); + +319 +v�si� + = + `�ug�_v�si� +(); + +320 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +v�si� + = version; + +321 if( +v�si� + == 4){ + +322 +rc + = + `�cur�y__l�d_v4 +( + +323 & +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +, + +324 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�s +, + +325 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�_cou� +, + +326 +lib +); + +328 if( +rc +){ + +329 +rc +; + +331 }if( +v�si� + == 3){ + +332 +rc + = + `�cur�y__l�d_v3 +( + +333 & +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +, + +334 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�s +, + +335 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�_cou� +, + +336 +lib +); + +338 if( +rc +){ + +339 +rc +; + +341 }if( +v�si� + == 2){ + +342 +rc + = + `�cur�y__l�d_v2 +( + +343 & +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +, + +344 ( +mosqu�to_auth_�t + *) +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�s +, + +345 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�_cou� +, + +346 +lib +); + +348 if( +rc +){ + +349 +rc +; + +352 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, + +354 +v�si� +, +MOSQ_AUTH_PLUGIN_VERSION +); + +355 + `LIB_ERROR +(); + +357 + `LIB_CLOSE +( +lib +); + +362 +MOSQ_ERR_SUCCESS +; + +363 + } +} + +366 + $mosqu�to_�cur�y_modu�_�� +( +mosqu�to_db + * +db +) + +368 +rc + = +MOSQ_ERR_SUCCESS +; + +369 +i +; + +371 if( +db +-> +c�fig +-> +�r_li���_���gs +){ + +372 +i +=0; i< +db +-> +c�fig +-> +li���_cou� +; i++){ + +373 +rc + = + `�cur�y__modu�_��_s�g� +(& +db +-> +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +); + +374 if( +rc +) �c; + +377 +rc + = + `�cur�y__modu�_��_s�g� +(& +db +-> +c�fig +-> +�cur�y_�ti�s +); + +379 +rc +; + +380 + } +} + +383 + $�cur�y__modu�_��nup_s�g� +( +mosqu�to__�cur�y_�ti�s + * +�ts +) + +385 +i +; + +387 +i +=0; i< +�ts +-> +auth_�ug�_c�fig_cou� +; i++){ + +389 if( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +v�si� + == 4){ + +390 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. + `�ug�_��nup_v4 +( + +391 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +u�r_d�a +, + +392 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�s +, + +393 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�_cou� +); + +395 }if( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +v�si� + == 3){ + +396 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. + `�ug�_��nup_v3 +( + +397 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +u�r_d�a +, + +398 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�s +, + +399 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�_cou� +); + +401 }if( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +v�si� + == 2){ + +402 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. + `�ug�_��nup_v2 +( + +403 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +u�r_d�a +, + +404 ( +mosqu�to_auth_�t + *) +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�s +, + +405 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�_cou� +); + +408 if( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +lib +){ + +409 + `LIB_CLOSE +( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +lib +); + +411 + `mem�t +(& +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +, 0, ( +mosqu�to__auth_�ug� +)); + +413 + } +} + +416 + $mosqu�to_�cur�y_modu�_��nup +( +mosqu�to_db + * +db +) + +418 +i +; + +420 + `mosqu�to_�cur�y_��nup +( +db +, +�l� +); + +422 + `�cur�y__modu�_��nup_s�g� +(& +db +-> +c�fig +-> +�cur�y_�ti�s +); + +424 +i +=0; i< +db +-> +c�fig +-> +li���_cou� +; i++){ + +425 + `�cur�y__modu�_��nup_s�g� +(& +db +-> +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +); + +428 +MOSQ_ERR_SUCCESS +; + +429 + } +} + +432 + $�cur�y__��_s�g� +( +mosqu�to__�cur�y_�ti�s + * +�ts +, +bo� + +�l�d +) + +434 +i +; + +435 +rc +; + +437 +i +=0; i< +�ts +-> +auth_�ug�_c�fig_cou� +; i++){ + +438 if( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +v�si� + == 4){ + +439 +rc + = +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. + `�cur�y_��_v4 +( + +440 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +u�r_d�a +, + +441 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�s +, + +442 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�_cou� +, + +443 +�l�d +); + +445 }if( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +v�si� + == 3){ + +446 +rc + = +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. + `�cur�y_��_v3 +( + +447 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +u�r_d�a +, + +448 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�s +, + +449 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�_cou� +, + +450 +�l�d +); + +452 }if( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +v�si� + == 2){ + +453 +rc + = +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. + `�cur�y_��_v2 +( + +454 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +u�r_d�a +, + +455 ( +mosqu�to_auth_�t + *) +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�s +, + +456 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�_cou� +, + +457 +�l�d +); + +459 +rc + = +MOSQ_ERR_INVAL +; + +461 if( +rc + !� +MOSQ_ERR_SUCCESS +){ + +462 +rc +; + +465 +MOSQ_ERR_SUCCESS +; + +466 + } +} + +469 + $mosqu�to_�cur�y_�� +( +mosqu�to_db + * +db +, +bo� + +�l�d +) + +471 +i +; + +472 +rc +; + +474 if( +db +-> +c�fig +-> +�r_li���_���gs +){ + +475 +i +=0; i< +db +-> +c�fig +-> +li���_cou� +; i++){ + +476 +rc + = + `�cur�y__��_s�g� +(& +db +-> +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +, +�l�d +); + +477 if( +rc + !� +MOSQ_ERR_SUCCESS +) �c; + +480 +rc + = + `�cur�y__��_s�g� +(& +db +-> +c�fig +-> +�cur�y_�ti�s +, +�l�d +); + +481 if( +rc + !� +MOSQ_ERR_SUCCESS +) �c; + +483 + `mosqu�to_�cur�y_��_de�u� +( +db +, +�l�d +); + +484 + } +} + +492 + $mosqu�to_�cur�y_��y +( +mosqu�to_db + * +db +) + +494 + `mosqu�to_�cur�y_��y_de�u� +( +db +); + +495 + } +} + +498 + $�cur�y__��nup_s�g� +( +mosqu�to__�cur�y_�ti�s + * +�ts +, +bo� + +�l�d +) + +500 +i +; + +501 +rc +; + +503 +i +=0; i< +�ts +-> +auth_�ug�_c�fig_cou� +; i++){ + +504 if( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +v�si� + == 4){ + +505 +rc + = +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. + `�cur�y_��nup_v4 +( + +506 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +u�r_d�a +, + +507 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�s +, + +508 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�_cou� +, + +509 +�l�d +); + +511 }if( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +v�si� + == 3){ + +512 +rc + = +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. + `�cur�y_��nup_v3 +( + +513 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +u�r_d�a +, + +514 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�s +, + +515 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�_cou� +, + +516 +�l�d +); + +518 }if( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +v�si� + == 2){ + +519 +rc + = +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. + `�cur�y_��nup_v2 +( + +520 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +u�r_d�a +, + +521 ( +mosqu�to_auth_�t + *) +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�s +, + +522 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ti�_cou� +, + +523 +�l�d +); + +525 +rc + = +MOSQ_ERR_INVAL +; + +527 if( +rc + !� +MOSQ_ERR_SUCCESS +){ + +528 +rc +; + +532 +MOSQ_ERR_SUCCESS +; + +533 + } +} + +536 + $mosqu�to_�cur�y_��nup +( +mosqu�to_db + * +db +, +bo� + +�l�d +) + +538 +i +; + +539 +rc +; + +541 +rc + = + `�cur�y__��nup_s�g� +(& +db +-> +c�fig +-> +�cur�y_�ti�s +, +�l�d +); + +542 if( +rc + !� +MOSQ_ERR_SUCCESS +) �c; + +544 +i +=0; i< +db +-> +c�fig +-> +li���_cou� +; i++){ + +545 +rc + = + `�cur�y__��nup_s�g� +(& +db +-> +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +, +�l�d +); + +546 if( +rc + !� +MOSQ_ERR_SUCCESS +) �c; + +548 + `mosqu�to_�cur�y_��nup_de�u� +( +db +, +�l�d +); + +549 + } +} + +553 + $a�__check_s�g� +( +mosqu�to__auth_�ug�_c�fig + * +auth_�ug� +, +mosqu�to + * +cڋxt +, +mosqu�to_a�_msg + * +msg +, +ac�ss +) + +555 cڡ * +u��ame +; + +556 cڡ * +t�ic + = +msg +->topic; + +558 +u��ame + = + `mosqu�to_���_u��ame +( +cڋxt +); + +559 if( +auth_�ug� +-> +d�y_�ec�l_ch�s + =� +�ue +){ + +566 if( +u��ame + && + `��brk +(username, "+#")){ + +567 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "ACL d�y�g�c�s�t���� w�h d�g�ou�u��am�\"%s\"", +u��ame +); + +568 +MOSQ_ERR_ACL_DENIED +; + +570 if( +cڋxt +-> +id + && + `��brk +(context->id, "+#")){ + +571 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "ACL d�y�g�c�s�t���� w�h d�g�ou���� id \"%s\"", +cڋxt +-> +id +); + +572 +MOSQ_ERR_ACL_DENIED +; + +576 if( +auth_�ug� +-> +�ug� +. +v�si� + == 4){ + +577 +auth_�ug� +-> +�ug� +. + `a�_check_v4 +�uth_�ug�->�ug�. +u�r_d�a +, +ac�ss +, +cڋxt +, +msg +); + +578 }if( +auth_�ug� +-> +�ug� +. +v�si� + == 3){ + +579 +auth_�ug� +-> +�ug� +. + `a�_check_v3 +�uth_�ug�->�ug�. +u�r_d�a +, +ac�ss +, +cڋxt +, +msg +); + +580 }if( +auth_�ug� +-> +�ug� +. +v�si� + == 2){ + +581 if( +ac�ss + =� +MOSQ_ACL_SUBSCRIBE +){ + +582 +MOSQ_ERR_SUCCESS +; + +584 +auth_�ug� +-> +�ug� +. + `a�_check_v2 +�uth_�ug�->�ug�. +u�r_d�a +, +cڋxt +-> +id +, +u��ame +, +t�ic +, +ac�ss +); + +586 +MOSQ_ERR_INVAL +; + +588 + } +} + +591 + $a�__check_d��r +(cڡ * +t�ic +, +ac�ss +) + +593 +rc +; + +594 +bo� + +m�ch + = +�l� +; + +596 if( +t�ic +[0] !�'$'� +MOSQ_ERR_SUCCESS +; + +598 if(! + `��cmp +( +t�ic +, "$SYS", 4)){ + +599 if( +ac�ss + =� +MOSQ_ACL_WRITE +){ + +601 +rc + = + `mosqu�to_t�ic_m�ches_sub +("$SYS/brok�/c���i�/+/��e", +t�ic +, & +m�ch +); + +602 if( +rc + =� +MOSQ_ERR_SUCCESS + && +m�ch + =� +�ue +){ + +603 +MOSQ_ERR_SUCCESS +; + +605 +MOSQ_ERR_ACL_DENIED +; + +608 +MOSQ_ERR_SUCCESS +; + +610 }if(! + `��cmp +( +t�ic +, "$share", 6)){ + +612 if( +ac�ss + =� +MOSQ_ACL_SUBSCRIBE +){ + +614 +MOSQ_ERR_SUCCESS +; + +616 +MOSQ_ERR_ACL_DENIED +; + +620 +MOSQ_ERR_SUCCESS +; + +622 + } +} + +625 + $mosqu�to_a�_check +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +t�ic +, +�yl�d�n +, * +�yl�d +, +qos +, +bo� + +��� +, +ac�ss +) + +627 +rc +; + +628 +i +; + +629 +mosqu�to__�cur�y_�ti�s + * +�ts +; + +630 +mosqu�to_a�_msg + +msg +; + +632 if(! +cڋxt +-> +id +){ + +633 +MOSQ_ERR_ACL_DENIED +; + +636 +rc + = + `a�__check_d��r +( +t�ic +, +ac�ss +); + +637 if( +rc +) �c; + +639 +rc + = + `mosqu�to_a�_check_de�u� +( +db +, +cڋxt +, +t�ic +, +ac�ss +); + +640 if( +rc + !� +MOSQ_ERR_PLUGIN_DEFER +){ + +641 +rc +; + +646 +rc + = +MOSQ_ERR_SUCCESS +; + +648 if( +db +-> +c�fig +-> +�r_li���_���gs +){ + +649 +�ts + = & +cڋxt +-> +li��� +-> +�cur�y_�ti�s +; + +651 +�ts + = & +db +-> +c�fig +-> +�cur�y_�ti�s +; + +654 + `mem�t +(& +msg +, 0, (msg)); + +655 +msg +. +t�ic + =�opic; + +656 +msg +. +�yl�d�n + =�ayloadlen; + +657 +msg +. +�yl�d + =�ayload; + +658 +msg +. +qos + = qos; + +659 +msg +. +��� + =�etain; + +661 +i +=0; i< +�ts +-> +auth_�ug�_c�fig_cou� +; i++){ + +662 +rc + = + `a�__check_s�g� +(& +�ts +-> +auth_�ug�_c�figs +[ +i +], +cڋxt +, & +msg +, +ac�ss +); + +663 if( +rc + !� +MOSQ_ERR_PLUGIN_DEFER +){ + +664 +rc +; + +670 if( +rc + =� +MOSQ_ERR_PLUGIN_DEFER +){ + +671 +rc + = +MOSQ_ERR_ACL_DENIED +; + +673 +rc +; + +674 + } +} + +676 + $mosqu�to_u�wd_check +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +u��ame +, cڡ * +�ssw�d +) + +678 +rc +; + +679 +i +; + +680 +mosqu�to__�cur�y_�ti�s + * +�ts +; + +682 +rc + = + `mosqu�to_u�wd_check_de�u� +( +db +, +cڋxt +, +u��ame +, +�ssw�d +); + +683 if( +rc + !� +MOSQ_ERR_PLUGIN_DEFER +){ + +684 +rc +; + +689 if( +db +-> +c�fig +-> +�r_li���_���gs +){ + +690 +�ts + = & +cڋxt +-> +li��� +-> +�cur�y_�ti�s +; + +692 +�ts + = & +db +-> +c�fig +-> +�cur�y_�ti�s +; + +695 +rc + = +MOSQ_ERR_SUCCESS +; + +696 +i +=0; i< +�ts +-> +auth_�ug�_c�fig_cou� +; i++){ + +697 if( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +v�si� + == 4 + +698 && +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +u�wd_check_v4 +){ + +700 +rc + = +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. + `u�wd_check_v4 +( + +701 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +u�r_d�a +, + +702 +cڋxt +, + +703 +u��ame +, + +704 +�ssw�d +); + +706 }if( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +v�si� + == 3){ + +707 +rc + = +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. + `u�wd_check_v3 +( + +708 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +u�r_d�a +, + +709 +cڋxt +, + +710 +u��ame +, + +711 +�ssw�d +); + +713 }if( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +v�si� + == 2){ + +714 +rc + = +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. + `u�wd_check_v2 +( + +715 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +u�r_d�a +, + +716 +u��ame +, + +717 +�ssw�d +); + +719 +rc + = +MOSQ_ERR_INVAL +; + +721 if( +rc + !� +MOSQ_ERR_PLUGIN_DEFER +){ + +722 +rc +; + +727 if( +rc + =� +MOSQ_ERR_PLUGIN_DEFER +){ + +728 +rc + = +MOSQ_ERR_AUTH +; + +730 +rc +; + +731 + } +} + +733 + $mosqu�to_psk_key_g� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +h�t +, cڡ * +id�t�y +, * +key +, +max_key_�n +) + +735 +rc +; + +736 +i +; + +737 +mosqu�to__�cur�y_�ti�s + * +�ts +; + +739 +rc + = + `mosqu�to_psk_key_g�_de�u� +( +db +, +cڋxt +, +h�t +, +id�t�y +, +key +, +max_key_�n +); + +740 if( +rc + !� +MOSQ_ERR_PLUGIN_DEFER +){ + +741 +rc +; + +748 if( +db +-> +c�fig +-> +�r_li���_���gs +){ + +749 +�ts + = & +cڋxt +-> +li��� +-> +�cur�y_�ti�s +; + +751 +�ts + = & +db +-> +c�fig +-> +�cur�y_�ti�s +; + +754 +i +=0; i< +�ts +-> +auth_�ug�_c�fig_cou� +; i++){ + +755 if( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +v�si� + == 4 + +756 && +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +psk_key_g�_v4 +){ + +758 +rc + = +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. + `psk_key_g�_v4 +( + +759 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +u�r_d�a +, + +760 +cڋxt +, + +761 +h�t +, + +762 +id�t�y +, + +763 +key +, + +764 +max_key_�n +); + +766 }if( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +v�si� + == 3){ + +767 +rc + = +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. + `psk_key_g�_v3 +( + +768 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +u�r_d�a +, + +769 +cڋxt +, + +770 +h�t +, + +771 +id�t�y +, + +772 +key +, + +773 +max_key_�n +); + +775 }if( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +v�si� + == 2){ + +776 +rc + = +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. + `psk_key_g�_v2 +( + +777 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +u�r_d�a +, + +778 +h�t +, + +779 +id�t�y +, + +780 +key +, + +781 +max_key_�n +); + +783 +rc + = +MOSQ_ERR_INVAL +; + +785 if( +rc + !� +MOSQ_ERR_PLUGIN_DEFER +){ + +786 +rc +; + +792 if( +rc + =� +MOSQ_ERR_PLUGIN_DEFER +){ + +793 +rc + = +MOSQ_ERR_AUTH +; + +795 +rc +; + +796 + } +} + +799 + $mosqu�to_�cur�y_auth_��t +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +bo� + +�auth +, cڡ * +d�a_� +, +u�t16_t + +d�a_�_�n +, ** +d�a_out +, u�t16_�* +d�a_out_�n +) + +801 +rc + = +MOSQ_ERR_PLUGIN_DEFER +; + +802 +i +; + +803 +mosqu�to__�cur�y_�ti�s + * +�ts +; + +805 if(! +cڋxt + || !cڋxt-> +li��� + || !cڋxt-> +auth_m�hod +� +MOSQ_ERR_INVAL +; + +806 if(! +d�a_out + || ! +d�a_out_�n +� +MOSQ_ERR_INVAL +; + +808 if( +db +-> +c�fig +-> +�r_li���_���gs +){ + +809 +�ts + = & +cڋxt +-> +li��� +-> +�cur�y_�ti�s +; + +811 +�ts + = & +db +-> +c�fig +-> +�cur�y_�ti�s +; + +814 +i +=0; i< +�ts +-> +auth_�ug�_c�fig_cou� +; i++){ + +815 if( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +auth_��t_v4 +){ + +816 * +d�a_out + = +NULL +; + +817 * +d�a_out_�n + = 0; + +819 +rc + = +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. + `auth_��t_v4 +( + +820 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +u�r_d�a +, + +821 +cڋxt +, + +822 +cڋxt +-> +auth_m�hod +, + +823 +�auth +, + +824 +d�a_� +, +d�a_�_�n +, + +825 +d�a_out +, +d�a_out_�n +); + +827 if( +rc + =� +MOSQ_ERR_SUCCESS +){ + +828 +MOSQ_ERR_SUCCESS +; + +829 }if( +rc + =� +MOSQ_ERR_AUTH_CONTINUE +){ + +830 +MOSQ_ERR_AUTH_CONTINUE +; + +831 }if( +rc + !� +MOSQ_ERR_NOT_SUPPORTED +){ + +832 +rc +; + +837 +MOSQ_ERR_NOT_SUPPORTED +; + +838 + } +} + +841 + $mosqu�to_�cur�y_auth_c�t�ue +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +d�a_� +, +u�t16_t + +d�a_�_�n +, ** +d�a_out +, u�t16_�* +d�a_out_�n +) + +843 +rc + = +MOSQ_ERR_PLUGIN_DEFER +; + +844 +i +; + +845 +mosqu�to__�cur�y_�ti�s + * +�ts +; + +847 if(! +cڋxt + || !cڋxt-> +li��� + || !cڋxt-> +auth_m�hod +� +MOSQ_ERR_INVAL +; + +848 if(! +d�a_out + || ! +d�a_out_�n +� +MOSQ_ERR_INVAL +; + +850 if( +db +-> +c�fig +-> +�r_li���_���gs +){ + +851 +�ts + = & +cڋxt +-> +li��� +-> +�cur�y_�ti�s +; + +853 +�ts + = & +db +-> +c�fig +-> +�cur�y_�ti�s +; + +856 +i +=0; i< +�ts +-> +auth_�ug�_c�fig_cou� +; i++){ + +857 if( +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +auth_��t_v4 +){ + +858 * +d�a_out + = +NULL +; + +859 * +d�a_out_�n + = 0; + +861 +rc + = +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. + `auth_c�t�ue_v4 +( + +862 +�ts +-> +auth_�ug�_c�figs +[ +i +]. +�ug� +. +u�r_d�a +, + +863 +cڋxt +, + +864 +cڋxt +-> +auth_m�hod +, + +865 +d�a_� +, +d�a_�_�n +, + +866 +d�a_out +, +d�a_out_�n +); + +868 if( +rc + =� +MOSQ_ERR_SUCCESS +){ + +869 +MOSQ_ERR_SUCCESS +; + +870 }if( +rc + =� +MOSQ_ERR_AUTH_CONTINUE +){ + +871 +MOSQ_ERR_AUTH_CONTINUE +; + +872 }if( +rc + !� +MOSQ_ERR_NOT_SUPPORTED +){ + +873 +rc +; + +878 +MOSQ_ERR_NOT_SUPPORTED +; + +879 + } +} + + @src/security_default.c + +17 + ~"c�fig.h +" + +19 + ~<�dio.h +> + +20 + ~<�r�g.h +> + +22 + ~"mosqu�to_brok�_����.h +" + +23 + ~"mem�y_mosq.h +" + +24 + ~"ut�_mosq.h +" + +26 +a�f�e__�r� +( +mosqu�to_db + * +db +, +mosqu�to__�cur�y_�ti�s + * +�cur�y_�ts +); + +27 +u�wd__f�e_�r� +( +mosqu�to__u�wd + ** +u�wd +, cڡ * +�ssw�d_f�e +); + +28 +a�__��nup +( +mosqu�to_db + * +db +, +bo� + +�l�d +); + +29 +u�wd__��nup +( +mosqu�to__u�wd + ** +u�wd +, +bo� + +�l�d +); + +30 +psk__f�e_�r� +( +mosqu�to_db + * +db +, +mosqu�to__u�wd + ** +psk_id +, cڡ * +psk_f�e +); + +31 #ifde� +WITH_TLS + + +32 +pw__dige� +(cڡ * +�ssw�d +, cڡ * +�� +, +��_�n +, * +hash +, * +hash_�n +); + +33 +ba�64__decode +(* +� +, ** +decoded +, * +decoded_�n +); + +34 +mosqu�to__memcmp_cڡ +(cڡ * +�r1 +, cڡ * +b +, +size_t + +�n +); + +39 + $mosqu�to_�cur�y_��_de�u� +( +mosqu�to_db + * +db +, +bo� + +�l�d +) + +41 +rc +; + +42 +i +; + +43 * +pwf +; + +44 * +pskf +; + +46 + `UNUSED +( +�l�d +); + +49 if( +db +-> +c�fig +-> +�r_li���_���gs +){ + +50 +i +=0; i< +db +-> +c�fig +-> +li���_cou� +; i++){ + +51 +pwf + = +db +-> +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +�ssw�d_f�e +; + +52 if( +pwf +){ + +53 +rc + = + `u�wd__f�e_�r� +(& +db +-> +c�fig +-> +li���s +[ +i +]. +u�wd +, +pwf +); + +54 if( +rc +){ + +55 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� o�n�g�assw�d f��\"%s\".", +pwf +); + +56 +rc +; + +61 if( +db +-> +c�fig +-> +�cur�y_�ti�s +. +�ssw�d_f�e +){ + +62 +pwf + = +db +-> +c�fig +-> +�cur�y_�ti�s +. +�ssw�d_f�e +; + +63 if( +pwf +){ + +64 +rc + = + `u�wd__f�e_�r� +(& +db +-> +u�wd +, +pwf +); + +65 if( +rc +){ + +66 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� o�n�g�assw�d f��\"%s\".", +pwf +); + +67 +rc +; + +74 if( +db +-> +c�fig +-> +�r_li���_���gs +){ + +75 +i +=0; i< +db +-> +c�fig +-> +li���_cou� +; i++){ + +76 if( +db +-> +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +a�_f�e +){ + +77 +rc + = + `a�f�e__�r� +( +db +, &db-> +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +); + +78 if( +rc +){ + +79 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� o�n�g�� f��\"%s\".", +db +-> +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +a�_f�e +); + +80 +rc +; + +85 if( +db +-> +c�fig +-> +�cur�y_�ti�s +. +a�_f�e +){ + +86 +rc + = + `a�f�e__�r� +( +db +, &db-> +c�fig +-> +�cur�y_�ti�s +); + +87 if( +rc +){ + +88 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� o�n�g�� f��\"%s\".", +db +-> +c�fig +-> +�cur�y_�ti�s +. +a�_f�e +); + +89 +rc +; + +95 if( +db +-> +c�fig +-> +�r_li���_���gs +){ + +96 +i +=0; i< +db +-> +c�fig +-> +li���_cou� +; i++){ + +97 +pskf + = +db +-> +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +. +psk_f�e +; + +98 if( +pskf +){ + +99 +rc + = + `psk__f�e_�r� +( +db +, &db-> +c�fig +-> +li���s +[ +i +]. +psk_id +, +pskf +); + +100 if( +rc +){ + +101 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� o�n�g�sk f��\"%s\".", +pskf +); + +102 +rc +; + +107 * +pskf + = +db +-> +c�fig +-> +�cur�y_�ti�s +. +psk_f�e +; + +108 if( +pskf +){ + +109 +rc + = + `psk__f�e_�r� +( +db +, &db-> +psk_id +, +pskf +); + +110 if( +rc +){ + +111 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E�� o�n�g�sk f��\"%s\".", +pskf +); + +112 +rc +; + +117 +MOSQ_ERR_SUCCESS +; + +118 + } +} + +120 + $mosqu�to_�cur�y_��nup_de�u� +( +mosqu�to_db + * +db +, +bo� + +�l�d +) + +122 +rc +; + +123 +i +; + +125 +rc + = + `a�__��nup +( +db +, +�l�d +); + +126 if( +rc + !� +MOSQ_ERR_SUCCESS +) �c; + +128 +rc + = + `u�wd__��nup +(& +db +-> +u�wd +, +�l�d +); + +129 if( +rc + !� +MOSQ_ERR_SUCCESS +) �c; + +131 +i +=0; i< +db +-> +c�fig +-> +li���_cou� +; i++){ + +132 if( +db +-> +c�fig +-> +li���s +[ +i +]. +u�wd +){ + +133 +rc + = + `u�wd__��nup +(& +db +-> +c�fig +-> +li���s +[ +i +]. +u�wd +, +�l�d +); + +134 if( +rc + !� +MOSQ_ERR_SUCCESS +) �c; + +138 +rc + = + `u�wd__��nup +(& +db +-> +psk_id +, +�l�d +); + +139 if( +rc + !� +MOSQ_ERR_SUCCESS +) �c; + +141 +i +=0; i< +db +-> +c�fig +-> +li���_cou� +; i++){ + +142 if( +db +-> +c�fig +-> +li���s +[ +i +]. +psk_id +){ + +143 +rc + = + `u�wd__��nup +(& +db +-> +c�fig +-> +li���s +[ +i +]. +psk_id +, +�l�d +); + +144 if( +rc + !� +MOSQ_ERR_SUCCESS +) �c; + +148 +MOSQ_ERR_SUCCESS +; + +149 + } +} + +152 + $add__a� +( +mosqu�to__�cur�y_�ti�s + * +�cur�y_�ts +, cڡ * +u�r +, cڡ * +t�ic +, +ac�ss +) + +154 +mosqu�to__a�_u�r + * +a�_u�r += +NULL +, * +u�r_�� +; + +155 +mosqu�to__a� + * +a� +, * +a�_�� +; + +156 * +lo�l_t�ic +; + +157 +bo� + +�w_u�r + = +�l� +; + +159 if(! +�cur�y_�ts + || ! +t�ic +� +MOSQ_ERR_INVAL +; + +161 +lo�l_t�ic + = + `mosqu�to__�rdup +( +t�ic +); + +162 if(! +lo�l_t�ic +){ + +163 +MOSQ_ERR_NOMEM +; + +166 if( +�cur�y_�ts +-> +a�_li� +){ + +167 +u�r_�� + = +�cur�y_�ts +-> +a�_li� +; + +168 +u�r_�� +){ + +169 if( +u�r + =� +NULL +){ + +170 if( +u�r_�� +-> +u��ame + =� +NULL +){ + +171 +a�_u�r + = +u�r_�� +; + +174 }if( +u�r_�� +-> +u��ame + && ! + `�rcmp +(u�r_��->u��ame, +u�r +)){ + +175 +a�_u�r + = +u�r_�� +; + +178 +u�r_�� + = u�r_��-> +�xt +; + +181 if(! +a�_u�r +){ + +182 +a�_u�r + = + `mosqu�to__m�loc +(( +mosqu�to__a�_u�r +)); + +183 if(! +a�_u�r +){ + +184 + `mosqu�to__� +( +lo�l_t�ic +); + +185 +MOSQ_ERR_NOMEM +; + +187 +�w_u�r + = +�ue +; + +188 if( +u�r +){ + +189 +a�_u�r +-> +u��ame + = + `mosqu�to__�rdup +( +u�r +); + +190 if(! +a�_u�r +-> +u��ame +){ + +191 + `mosqu�to__� +( +lo�l_t�ic +); + +192 + `mosqu�to__� +( +a�_u�r +); + +193 +MOSQ_ERR_NOMEM +; + +196 +a�_u�r +-> +u��ame + = +NULL +; + +198 +a�_u�r +-> +�xt + = +NULL +; + +199 +a�_u�r +-> +a� + = +NULL +; + +202 +a� + = + `mosqu�to__m�loc +(( +mosqu�to__a� +)); + +203 if(! +a� +){ + +204 + `mosqu�to__� +( +lo�l_t�ic +); + +205 + `mosqu�to__� +( +a�_u�r +-> +u��ame +); + +206 + `mosqu�to__� +( +a�_u�r +); + +207 +MOSQ_ERR_NOMEM +; + +209 +a� +-> +ac�ss + =�ccess; + +210 +a� +-> +t�ic + = +lo�l_t�ic +; + +211 +a� +-> +�xt + = +NULL +; + +212 +a� +-> +ccou� + = 0; + +213 +a� +-> +ucou� + = 0; + +216 if( +a�_u�r +-> +a� +){ + +217 +a�_�� + = +a�_u�r +-> +a� +; + +218 +a�_�� +-> +�xt +){ + +219 +a�_�� + =��_��-> +�xt +; + +221 +a�_�� +-> +�xt + = +a� +; + +223 +a�_u�r +-> +a� + =�cl; + +226 if( +�w_u�r +){ + +228 if( +�cur�y_�ts +-> +a�_li� +){ + +229 +u�r_�� + = +�cur�y_�ts +-> +a�_li� +; + +230 +u�r_�� +-> +�xt +){ + +231 +u�r_�� + = u�r_��-> +�xt +; + +233 +u�r_�� +-> +�xt + = +a�_u�r +; + +235 +�cur�y_�ts +-> +a�_li� + = +a�_u�r +; + +239 +MOSQ_ERR_SUCCESS +; + +240 + } +} + +242 + $add__a�_���n +( +mosqu�to__�cur�y_�ti�s + * +�cur�y_�ts +, cڡ * +t�ic +, +ac�ss +) + +244 +mosqu�to__a� + * +a� +, * +a�_�� +; + +245 * +lo�l_t�ic +; + +246 * +s +; + +248 if(! +�cur�y_�ts +| ! +t�ic +� +MOSQ_ERR_INVAL +; + +250 +lo�l_t�ic + = + `mosqu�to__�rdup +( +t�ic +); + +251 if(! +lo�l_t�ic +){ + +252 +MOSQ_ERR_NOMEM +; + +255 +a� + = + `mosqu�to__m�loc +(( +mosqu�to__a� +)); + +256 if(! +a� +){ + +257 + `mosqu�to__� +( +lo�l_t�ic +); + +258 +MOSQ_ERR_NOMEM +; + +260 +a� +-> +ac�ss + =�ccess; + +261 +a� +-> +t�ic + = +lo�l_t�ic +; + +262 +a� +-> +�xt + = +NULL +; + +264 +a� +-> +ccou� + = 0; + +265 +s + = +lo�l_t�ic +; + +266 +s +){ + +267 +s + = + `�r�r +(s, "%c"); + +268 if( +s +){ + +269 +a� +-> +ccou� +++; + +270 +s ++=2; + +274 +a� +-> +ucou� + = 0; + +275 +s + = +lo�l_t�ic +; + +276 +s +){ + +277 +s + = + `�r�r +(s, "%u"); + +278 if( +s +){ + +279 +a� +-> +ucou� +++; + +280 +s ++=2; + +284 if( +a� +-> +ccou� + =�0 &&��-> +ucou� + == 0){ + +285 + `log__��tf +( +NULL +, +MOSQ_LOG_WARNING +, + +287 +t�ic +); + +290 if( +�cur�y_�ts +-> +a�_���ns +){ + +291 +a�_�� + = +�cur�y_�ts +-> +a�_���ns +; + +292 +a�_�� +-> +�xt +){ + +293 +a�_�� + =��_��-> +�xt +; + +295 +a�_�� +-> +�xt + = +a� +; + +297 +�cur�y_�ts +-> +a�_���ns + = +a� +; + +300 +MOSQ_ERR_SUCCESS +; + +301 + } +} + +303 + $mosqu�to_a�_check_de�u� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +t�ic +, +ac�ss +) + +305 * +lo�l_a� +; + +306 +mosqu�to__a� + * +a�_ro� +; + +307 +bo� + +�su� +; + +308 +i +; + +309 +�n +, +�� +, +�� +, +u�n +; + +310 * +s +; + +311 +mosqu�to__�cur�y_�ti�s + * +�cur�y_�ts + = +NULL +; + +313 if(! +db + || ! +cڋxt + || ! +t�ic +� +MOSQ_ERR_INVAL +; + +314 if( +cڋxt +-> +bridge +� +MOSQ_ERR_SUCCESS +; + +316 if( +db +-> +c�fig +-> +�r_li���_���gs +){ + +317 if(! +cڋxt +-> +li��� +� +MOSQ_ERR_ACL_DENIED +; + +318 +�cur�y_�ts + = & +cڋxt +-> +li��� +-> +�cur�y_�ti�s +; + +320 +�cur�y_�ts + = & +db +-> +c�fig +-> +�cur�y_�ti�s +; + +322 if(! +�cur�y_�ts +-> +a�_f�e + && !�cur�y_�ts-> +a�_li� + && !�cur�y_�ts-> +a�_���ns +){ + +323 +MOSQ_ERR_PLUGIN_DEFER +; + +326 if( +ac�ss + =� +MOSQ_ACL_SUBSCRIBE +� +MOSQ_ERR_SUCCESS +; + +327 if(! +cڋxt +-> +a�_li� + && ! +�cur�y_�ts +-> +a�_���ns +� +MOSQ_ERR_ACL_DENIED +; + +329 if( +cڋxt +-> +a�_li� +){ + +330 +a�_ro� + = +cڋxt +-> +a�_li� +-> +a� +; + +332 +a�_ro� + = +NULL +; + +336 +a�_ro� +){ + +340 if( +t�ic +[0] =�'$' && +a�_ro� +->topic[0] != '$'){ + +341 +a�_ro� + =��_ro�-> +�xt +; + +344 + `mosqu�to_t�ic_m�ches_sub +( +a�_ro� +-> +t�ic +,��ic, & +�su� +); + +345 if( +�su� +){ + +346 if( +ac�ss + & +a�_ro� +->access){ + +348 +MOSQ_ERR_SUCCESS +; + +351 +a�_ro� + =��_ro�-> +�xt +; + +354 +a�_ro� + = +�cur�y_�ts +-> +a�_���ns +; + +356 if( +a�_ro� +){ + +364 if( +cڋxt +-> +u��ame + && + `��brk +(context->username, "+#")){ + +365 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "ACL d�y�g�c�s�t���� w�h d�g�ou�u��am�\"%s\"", +cڋxt +-> +u��ame +); + +366 +MOSQ_ERR_ACL_DENIED +; + +369 if( +cڋxt +-> +id + && + `��brk +(context->id, "+#")){ + +370 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "ACL d�y�g�c�s�t���� w�h d�g�ou���� id \"%s\"", +cڋxt +-> +id +); + +371 +MOSQ_ERR_ACL_DENIED +; + +376 if(! +cڋxt +-> +id +� +MOSQ_ERR_ACL_DENIED +; + +377 +�� + = + `��� +( +cڋxt +-> +id +); + +379 +a�_ro� +){ + +380 +�� + = + `��� +( +a�_ro� +-> +t�ic +); + +382 if( +a�_ro� +-> +ucou� + && ! +cڋxt +-> +u��ame +){ + +383 +a�_ro� + =��_ro�-> +�xt +; + +387 if( +cڋxt +-> +u��ame +){ + +388 +u�n + = + `��� +( +cڋxt +-> +u��ame +); + +389 +�n + = +�� + + +a�_ro� +-> +ccou� +*( +�� +-2�+��_ro�-> +ucou� +*( +u�n +-2); + +391 +u�n + = 0; + +392 +�n + = +�� + + +a�_ro� +-> +ccou� +*( +�� +-2); + +394 +lo�l_a� + = + `mosqu�to__m�loc +( +�n ++1); + +395 if(! +lo�l_a� +) 1; + +396 +s + = +lo�l_a� +; + +397 +i +=0; i< +�� +; i++){ + +398 if( +i +< +�� +-1 && +a�_ro� +-> +t�ic +[i] == '%'){ + +399 if( +a�_ro� +-> +t�ic +[ +i ++1] == 'c'){ + +400 +i +++; + +401 + `���y +( +s +, +cڋxt +-> +id +, +�� +); + +402 +s ++= +�� +; + +404 }if( +cڋxt +-> +u��ame + && +a�_ro� +-> +t�ic +[ +i ++1] == 'u'){ + +405 +i +++; + +406 + `���y +( +s +, +cڋxt +-> +u��ame +, +u�n +); + +407 +s ++= +u�n +; + +411 +s +[0] = +a�_ro� +-> +t�ic +[ +i +]; + +412 +s +++; + +414 +lo�l_a� +[ +�n +] = '\0'; + +416 + `mosqu�to_t�ic_m�ches_sub +( +lo�l_a� +, +t�ic +, & +�su� +); + +417 + `mosqu�to__� +( +lo�l_a� +); + +418 if( +�su� +){ + +419 if( +ac�ss + & +a�_ro� +->access){ + +421 +MOSQ_ERR_SUCCESS +; + +425 +a�_ro� + =��_ro�-> +�xt +; + +428 +MOSQ_ERR_ACL_DENIED +; + +429 + } +} + +432 + $a�f�e__�r� +( +mosqu�to_db + * +db +, +mosqu�to__�cur�y_�ti�s + * +�cur�y_�ts +) + +434 +FILE + * +a�� +; + +435 +buf +[1024]; + +436 * +tok� +; + +437 * +u�r + = +NULL +; + +438 * +t�ic +; + +439 * +ac�ss_s +; + +440 +ac�ss +; + +441 +rc +; + +442 +�� +; + +443 +t�ic_���n +; + +444 * +�v�� + = +NULL +; + +446 if(! +db + || !db-> +c�fig +� +MOSQ_ERR_INVAL +; + +447 if(! +�cur�y_�ts +� +MOSQ_ERR_INVAL +; + +448 if(! +�cur�y_�ts +-> +a�_f�e +� +MOSQ_ERR_SUCCESS +; + +450 +a�� + = + `mosqu�to__fݒ +( +�cur�y_�ts +-> +a�_f�e +, "�", +�l� +); + +451 if(! +a�� +){ + +452 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: U�bˁ�ݒ��_f��\"%s\".", +�cur�y_�ts +-> +a�_f�e +); + +459 + `fg�s +( +buf +, 1024, +a�� +)){ + +460 +�� + = + `��� +( +buf +); + +461 +�� + > 0 && ( +buf +[slen-1] == 10 || buf[slen-1] == 13)){ + +462 +buf +[ +�� +-1] = '\0'; + +463 +�� + = + `��� +( +buf +); + +465 if( +buf +[0] == '#'){ + +468 +tok� + = + `��ok_r +( +buf +, " ", & +�v�� +); + +469 if( +tok� +){ + +470 if(! + `�rcmp +( +tok� +, "topic") || !strcmp(token, "pattern")){ + +471 if(! + `�rcmp +( +tok� +, "topic")){ + +472 +t�ic_���n + = 0; + +474 +t�ic_���n + = 1; + +477 +ac�ss_s + = + `��ok_r +( +NULL +, " ", & +�v�� +); + +478 if(! +ac�ss_s +){ + +479 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Em�y��i����_f��\"%s\".", +�cur�y_�ts +-> +a�_f�e +); + +480 + `mosqu�to__� +( +u�r +); + +481 + `f�o� +( +a�� +); + +482 +MOSQ_ERR_INVAL +; + +484 +tok� + = + `��ok_r +( +NULL +, "", & +�v�� +); + +485 if( +tok� +){ + +486 +t�ic + = +tok� +; + +488 +t�ic +[0] == ' '){ + +489 +t�ic +++; + +492 +t�ic + = +ac�ss_s +; + +493 +ac�ss_s + = +NULL +; + +495 if( +ac�ss_s +){ + +496 if(! + `�rcmp +( +ac�ss_s +, "read")){ + +497 +ac�ss + = +MOSQ_ACL_READ +; + +498 }if(! + `�rcmp +( +ac�ss_s +, "write")){ + +499 +ac�ss + = +MOSQ_ACL_WRITE +; + +500 }if(! + `�rcmp +( +ac�ss_s +, "readwrite")){ + +501 +ac�ss + = +MOSQ_ACL_READ + | +MOSQ_ACL_WRITE +; + +503 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id��i�ac�s�ty� \"%s\" i�a�_f��\"%s\".", +ac�ss_s +, +�cur�y_�ts +-> +a�_f�e +); + +504 + `mosqu�to__� +( +u�r +); + +505 + `f�o� +( +a�� +); + +506 +MOSQ_ERR_INVAL +; + +509 +ac�ss + = +MOSQ_ACL_READ + | +MOSQ_ACL_WRITE +; + +511 if( +t�ic_���n + == 0){ + +512 +rc + = + `add__a� +( +�cur�y_�ts +, +u�r +, +t�ic +, +ac�ss +); + +514 +rc + = + `add__a�_���n +( +�cur�y_�ts +, +t�ic +, +ac�ss +); + +516 if( +rc +){ + +517 + `mosqu�to__� +( +u�r +); + +518 + `f�o� +( +a�� +); + +519 +rc +; + +521 }if(! + `�rcmp +( +tok� +, "user")){ + +522 +tok� + = + `��ok_r +( +NULL +, "", & +�v�� +); + +523 if( +tok� +){ + +525 +tok� +[0] == ' '){ + +526 +tok� +++; + +528 + `mosqu�to__� +( +u�r +); + +529 +u�r + = + `mosqu�to__�rdup +( +tok� +); + +530 if(! +u�r +){ + +531 + `f�o� +( +a�� +); + +532 +MOSQ_ERR_NOMEM +; + +535 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Miss�g u��am����_f��\"%s\".", +�cur�y_�ts +-> +a�_f�e +); + +536 + `mosqu�to__� +( +u�r +); + +537 + `f�o� +( +a�� +); + +541 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id������_f��\"%s\": %s.", +�cur�y_�ts +-> +a�_f�e +, +buf +); + +542 + `f�o� +( +a�� +); + +548 + `mosqu�to__� +( +u�r +); + +549 + `f�o� +( +a�� +); + +551 +MOSQ_ERR_SUCCESS +; + +552 + } +} + +554 + $�__a� +( +mosqu�to__a� + * +a� +) + +556 if(! +a� +) ; + +558 if( +a� +-> +�xt +){ + +559 + `�__a� +( +a� +-> +�xt +); + +561 + `mosqu�to__� +( +a� +-> +t�ic +); + +562 + `mosqu�to__� +( +a� +); + +563 + } +} + +566 + $a�__��nup_s�g� +( +mosqu�to__�cur�y_�ti�s + * +�cur�y_�ts +) + +568 +mosqu�to__a�_u�r + * +u�r_�� +; + +570 +�cur�y_�ts +-> +a�_li� +){ + +571 +u�r_�� + = +�cur�y_�ts +-> +a�_li� +-> +�xt +; + +573 + `�__a� +( +�cur�y_�ts +-> +a�_li� +-> +a� +); + +574 + `mosqu�to__� +( +�cur�y_�ts +-> +a�_li� +-> +u��ame +); + +575 + `mosqu�to__� +( +�cur�y_�ts +-> +a�_li� +); + +577 +�cur�y_�ts +-> +a�_li� + = +u�r_�� +; + +580 if( +�cur�y_�ts +-> +a�_���ns +){ + +581 + `�__a� +( +�cur�y_�ts +-> +a�_���ns +); + +582 +�cur�y_�ts +-> +a�_���ns + = +NULL +; + +584 + } +} + +587 + $a�__��nup +( +mosqu�to_db + * +db +, +bo� + +�l�d +) + +589 +mosqu�to + * +cڋxt +, * +�xt_tmp +; + +590 +i +; + +592 + `UNUSED +( +�l�d +); + +594 if(! +db +� +MOSQ_ERR_INVAL +; + +602 + `HASH_ITER +( +hh_id +, +db +-> +cڋxts_by_id +, +cڋxt +, +�xt_tmp +){ + +603 +cڋxt +-> +a�_li� + = +NULL +; + +606 if( +db +-> +c�fig +-> +�r_li���_���gs +){ + +607 +i +=0; i< +db +-> +c�fig +-> +li���_cou� +; i++){ + +608 + `a�__��nup_s�g� +(& +db +-> +c�fig +-> +li���s +[ +i +]. +�cur�y_�ti�s +); + +611 + `a�__��nup_s�g� +(& +db +-> +c�fig +-> +�cur�y_�ti�s +); + +614 +MOSQ_ERR_SUCCESS +; + +615 + } +} + +618 + $a�__f�d_a�s +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +620 +mosqu�to__a�_u�r + * +a�_�� +; + +621 +mosqu�to__�cur�y_�ti�s + * +�cur�y_�ts +; + +624 if( +db +-> +c�fig +-> +�r_li���_���gs +){ + +625 if(! +cڋxt +-> +li��� +){ + +626 +MOSQ_ERR_INVAL +; + +628 +�cur�y_�ts + = & +cڋxt +-> +li��� +-> +�cur�y_�ti�s +; + +630 +�cur�y_�ts + = & +db +-> +c�fig +-> +�cur�y_�ti�s +; + +633 if( +�cur�y_�ts +-> +a�_li� +){ + +634 +a�_�� + = +�cur�y_�ts +-> +a�_li� +; + +635 +a�_�� +){ + +636 if( +cڋxt +-> +u��ame +){ + +637 if( +a�_�� +-> +u��ame + && ! + `�rcmp +( +cڋxt +->username,�cl_tail->username)){ + +638 +cڋxt +-> +a�_li� + = +a�_�� +; + +642 if( +a�_�� +-> +u��ame + =� +NULL +){ + +643 +cڋxt +-> +a�_li� + = +a�_�� +; + +647 +a�_�� + =��_��-> +�xt +; + +650 +cڋxt +-> +a�_li� + = +NULL +; + +653 +MOSQ_ERR_SUCCESS +; + +654 + } +} + +657 + $pwf�e__�r� +(cڡ * +f�e +, +mosqu�to__u�wd + ** +ro� +) + +659 +FILE + * +pwf�e +; + +660 +mosqu�to__u�wd + * +u�wd +; + +661 +buf +[256]; + +662 * +u��ame +, * +�ssw�d +; + +663 +�n +; + +664 * +�v�� + = +NULL +; + +666 +pwf�e + = + `mosqu�to__fݒ +( +f�e +, "�", +�l� +); + +667 if(! +pwf�e +){ + +668 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: U�bˁ�ݒ�wf��\"%s\".", +f�e +); + +672 ! + `�of +( +pwf�e +)){ + +673 if( + `fg�s +( +buf +, 256, +pwf�e +)){ + +674 if( +buf +[0] == '#') ; + +675 if(! + `�rchr +( +buf +, ':')) ; + +677 +u��ame + = + `��ok_r +( +buf +, ":", & +�v�� +); + +678 if( +u��ame +){ + +679 +u�wd + = + `mosqu�to__��oc +(1, ( +mosqu�to__u�wd +)); + +680 if(! +u�wd +){ + +681 + `f�o� +( +pwf�e +); + +682 +MOSQ_ERR_NOMEM +; + +684 +u�wd +-> +u��ame + = + `mosqu�to__�rdup +(username); + +685 if(! +u�wd +-> +u��ame +){ + +686 + `mosqu�to__� +( +u�wd +); + +687 + `f�o� +( +pwf�e +); + +688 +MOSQ_ERR_NOMEM +; + +690 +�n + = + `��� +( +u�wd +-> +u��ame +); + +691 +u�wd +-> +u��ame +[ +�n +-1] == 10 || unpwd->username[len-1] == 13){ + +692 +u�wd +-> +u��ame +[ +�n +-1] = '\0'; + +693 +�n + = + `��� +( +u�wd +-> +u��ame +); + +695 +�ssw�d + = + `��ok_r +( +NULL +, ":", & +�v�� +); + +696 if( +�ssw�d +){ + +697 +u�wd +-> +�ssw�d + = + `mosqu�to__�rdup +(password); + +698 if(! +u�wd +-> +�ssw�d +){ + +699 + `f�o� +( +pwf�e +); + +700 + `mosqu�to__� +( +u�wd +-> +u��ame +); + +701 + `mosqu�to__� +( +u�wd +); + +702 +MOSQ_ERR_NOMEM +; + +704 +�n + = + `��� +( +u�wd +-> +�ssw�d +); + +705 +�n + && ( +u�wd +-> +�ssw�d +[len-1] == 10 || unpwd->password[len-1] == 13)){ + +706 +u�wd +-> +�ssw�d +[ +�n +-1] = '\0'; + +707 +�n + = + `��� +( +u�wd +-> +�ssw�d +); + +710 + `HASH_ADD_KEYPTR +( +hh +, * +ro� +, +u�wd +-> +u��ame +, + `��� +(unpwd->username), unpwd); + +712 + `log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "W�n�g: Inv�id�����assw�d f��'%s': %s", +f�e +, +buf +); + +713 + `mosqu�to__� +( +u�wd +-> +u��ame +); + +714 + `mosqu�to__� +( +u�wd +); + +719 + `f�o� +( +pwf�e +); + +721 +MOSQ_ERR_SUCCESS +; + +722 + } +} + +725 #ifde� +WITH_TLS + + +727 + $u�wd__�_�em +( +mosqu�to__u�wd + ** +u�wd +, mosqu�to__u�wd * +�em +) + +729 + `mosqu�to__� +( +�em +-> +u��ame +); + +730 + `mosqu�to__� +( +�em +-> +�ssw�d +); + +731 + `mosqu�to__� +( +�em +-> +�� +); + +732 + `HASH_DEL +(* +u�wd +, +�em +); + +733 + `mosqu�to__� +( +�em +); + +734 + } +} + +737 + $u�wd__decode_�ssw�ds +( +mosqu�to__u�wd + ** +u�wd +) + +739 +mosqu�to__u�wd + * +u +, * +tmp +; + +740 * +tok� +; + +741 * +�� +; + +742 +��_�n +; + +743 * +�ssw�d +; + +744 +�ssw�d_�n +; + +745 +rc +; + +747 + `HASH_ITER +( +hh +, * +u�wd +, +u +, +tmp +){ + +749 if( +u +-> +�ssw�d +){ + +750 +tok� + = + `��ok +( +u +-> +�ssw�d +, "$"); + +751 if( +tok� + && ! + `�rcmp +(token, "6")){ + +752 +tok� + = + `��ok +( +NULL +, "$"); + +753 if( +tok� +){ + +754 +rc + = + `ba�64__decode +( +tok� +, & +�� +, & +��_�n +); + +755 if( +rc + =� +MOSQ_ERR_SUCCESS + && +��_�n + == 12){ + +756 +u +-> +�� + = salt; + +757 +u +-> +��_�n + = salt_len; + +758 +tok� + = + `��ok +( +NULL +, "$"); + +759 if( +tok� +){ + +760 +rc + = + `ba�64__decode +( +tok� +, & +�ssw�d +, & +�ssw�d_�n +); + +761 if( +rc + =� +MOSQ_ERR_SUCCESS + && +�ssw�d_�n + == 64){ + +762 + `mosqu�to__� +( +u +-> +�ssw�d +); + +763 +u +-> +�ssw�d + = (*)password; + +764 +u +-> +�ssw�d_�n + =�assword_len; + +766 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: U�bˁ�decod��ssw�d f� u��%s,�emov�g��ry.", +u +-> +u��ame +); + +767 + `u�wd__�_�em +( +u�wd +, +u +); + +770 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id�assw�d hash f� u��%s,�emov�g��ry.", +u +-> +u��ame +); + +771 + `u�wd__�_�em +( +u�wd +, +u +); + +774 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: U�bˁ�decod��ssw�d s��f� u��%s,�emov�g��ry.", +u +-> +u��ame +); + +775 + `u�wd__�_�em +( +u�wd +, +u +); + +778 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id�assw�d hash f� u��%s,�emov�g��ry.", +u +-> +u��ame +); + +779 + `u�wd__�_�em +( +u�wd +, +u +); + +782 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Inv�id�assw�d hash f� u��%s,�emov�g��ry.", +u +-> +u��ame +); + +783 + `u�wd__�_�em +( +u�wd +, +u +); + +786 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Miss�g�assw�d hash f� u��%s,�emov�g��ry.", +u +-> +u��ame +); + +787 + `u�wd__�_�em +( +u�wd +, +u +); + +791 +MOSQ_ERR_SUCCESS +; + +792 + } +} + +796 + $u�wd__f�e_�r� +( +mosqu�to__u�wd + ** +u�wd +, cڡ * +�ssw�d_f�e +) + +798 +rc +; + +799 if(! +u�wd +� +MOSQ_ERR_INVAL +; + +801 if(! +�ssw�d_f�e +� +MOSQ_ERR_SUCCESS +; + +803 +rc + = + `pwf�e__�r� +( +�ssw�d_f�e +, +u�wd +); + +805 #ifde� +WITH_TLS + + +806 if( +rc +) �c; + +807 +rc + = + `u�wd__decode_�ssw�ds +( +u�wd +); + +810 +rc +; + +811 + } +} + +813 + $psk__f�e_�r� +( +mosqu�to_db + * +db +, +mosqu�to__u�wd + ** +psk_id +, cڡ * +psk_f�e +) + +815 +rc +; + +816 +mosqu�to__u�wd + * +u +, * +tmp +; + +818 if(! +db + || !db-> +c�fig + || ! +psk_id +� +MOSQ_ERR_INVAL +; + +821 if(! +psk_f�e +� +MOSQ_ERR_SUCCESS +; + +823 +rc + = + `pwf�e__�r� +( +psk_f�e +, +psk_id +); + +824 if( +rc +) �c; + +826 + `HASH_ITER +( +hh +, (* +psk_id +), +u +, +tmp +){ + +828 if(! +u +-> +�ssw�d +){ + +829 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: Em�y�sk f� id�t�y \"%s\".", +u +-> +u��ame +); + +830 +MOSQ_ERR_INVAL +; + +832 if( + `�r�n +( +u +-> +�ssw�d +, "0123456789abcdefABCDEF"�< + `��� +(u->password)){ + +833 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��:�sk f� id�t�y \"%s\" cڏ��n�-hexadecim� ch�a��s.", +u +-> +u��ame +); + +834 +MOSQ_ERR_INVAL +; + +837 +MOSQ_ERR_SUCCESS +; + +838 + } +} + +841 #ifde� +WITH_TLS + + +842 + $mosqu�to__memcmp_cڡ +(cڡ * +a +, cڡ * +b +, +size_t + +�n +) + +844 +size_t + +i +; + +845 +rc + = 0; + +847 if(! +a + || ! +b +) 1; + +849 +i +=0; i< +�n +; i++){ + +850 if�((*) +a +)[ +i +] !�((*) +b +)[i] ){ + +851 +rc + = 1; + +854 +rc +; + +855 + } +} + +859 + $mosqu�to_u�wd_check_de�u� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +u��ame +, cڡ * +�ssw�d +) + +861 +mosqu�to__u�wd + * +u +, * +tmp +; + +862 +mosqu�to__u�wd + * +u�wd_�f +; + +863 #ifde� +WITH_TLS + + +864 +hash +[ +EVP_MAX_MD_SIZE +]; + +865 +hash_�n +; + +866 +rc +; + +869 if(! +db +� +MOSQ_ERR_INVAL +; + +871 if( +db +-> +c�fig +-> +�r_li���_���gs +){ + +872 if( +cڋxt +-> +bridge +� +MOSQ_ERR_SUCCESS +; + +873 if(! +cڋxt +-> +li��� +� +MOSQ_ERR_INVAL +; + +874 if(! +cڋxt +-> +li��� +-> +u�wd +� +MOSQ_ERR_PLUGIN_DEFER +; + +875 +u�wd_�f + = +cڋxt +-> +li��� +-> +u�wd +; + +877 if(! +db +-> +u�wd +� +MOSQ_ERR_PLUGIN_DEFER +; + +878 +u�wd_�f + = +db +-> +u�wd +; + +880 if(! +u��ame +){ + +884 +MOSQ_ERR_AUTH +; + +887 + `HASH_ITER +( +hh +, +u�wd_�f +, +u +, +tmp +){ + +888 if(! + `�rcmp +( +u +-> +u��ame +, username)){ + +889 if( +u +-> +�ssw�d +){ + +890 if( +�ssw�d +){ + +891 #ifde� +WITH_TLS + + +892 +rc + = + `pw__dige� +( +�ssw�d +, +u +-> +�� +, u-> +��_�n +, +hash +, & +hash_�n +); + +893 if( +rc + =� +MOSQ_ERR_SUCCESS +){ + +894 if( +hash_�n + =� +u +-> +�ssw�d_�n + && ! + `mosqu�to__memcmp_cڡ +(u-> +�ssw�d +, +hash +, hash_len)){ + +895 +MOSQ_ERR_SUCCESS +; + +897 +MOSQ_ERR_AUTH +; + +900 +rc +; + +903 if(! + `�rcmp +( +u +-> +�ssw�d +,�assword)){ + +904 +MOSQ_ERR_SUCCESS +; + +908 +MOSQ_ERR_AUTH +; + +911 +MOSQ_ERR_SUCCESS +; + +916 +MOSQ_ERR_AUTH +; + +917 + } +} + +919 + $u�wd__��nup +( +mosqu�to__u�wd + ** +ro� +, +bo� + +�l�d +) + +921 +mosqu�to__u�wd + * +u +, * +tmp +; + +923 + `UNUSED +( +�l�d +); + +925 if(! +ro� +� +MOSQ_ERR_INVAL +; + +927 + `HASH_ITER +( +hh +, * +ro� +, +u +, +tmp +){ + +928 + `HASH_DEL +(* +ro� +, +u +); + +929 + `mosqu�to__� +( +u +-> +�ssw�d +); + +930 + `mosqu�to__� +( +u +-> +u��ame +); + +931 #ifde� +WITH_TLS + + +932 + `mosqu�to__� +( +u +-> +�� +); + +934 + `mosqu�to__� +( +u +); + +937 * +ro� + = +NULL +; + +939 +MOSQ_ERR_SUCCESS +; + +940 + } +} + +948 + $mosqu�to_�cur�y_��y_de�u� +( +mosqu�to_db + * +db +) + +950 +mosqu�to + * +cڋxt +, * +�xt_tmp +; + +951 +mosqu�to__a�_u�r + * +a�_u�r_�� +; + +952 +bo� + +�low_��ymous +; + +953 +mosqu�to__�cur�y_�ti�s + * +�cur�y_�ts + = +NULL +; + +955 if(! +db +� +MOSQ_ERR_INVAL +; + +958 + `HASH_ITER +( +hh_id +, +db +-> +cڋxts_by_id +, +cڋxt +, +�xt_tmp +){ + +960 if( +db +-> +c�fig +-> +�r_li���_���gs +){ + +961 if( +cڋxt +-> +li��� +){ + +962 +�low_��ymous + = +cڋxt +-> +li��� +-> +�cur�y_�ti�s +.allow_anonymous; + +965 +�low_��ymous + = +�ue +; + +968 +�low_��ymous + = +db +-> +c�fig +-> +�cur�y_�ti�s +.allow_anonymous; + +971 if(! +�low_��ymous + && ! +cڋxt +-> +u��ame +){ + +972 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_disc����g +); + +973 + `do_disc��� +( +db +, +cڋxt +, +MOSQ_ERR_AUTH +); + +977 if( + `mosqu�to_u�wd_check +( +db +, +cڋxt +, cڋxt-> +u��ame +, cڋxt-> +�ssw�d +�!� +MOSQ_ERR_SUCCESS +){ + +978 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_disc����g +); + +979 + `do_disc��� +( +db +, +cڋxt +, +MOSQ_ERR_AUTH +); + +983 if( +db +-> +c�fig +-> +�r_li���_���gs +){ + +984 if( +cڋxt +-> +li��� +){ + +985 +�cur�y_�ts + = & +cڋxt +-> +li��� +-> +�cur�y_�ti�s +; + +987 if( +cڋxt +-> +��e + !� +mosq_cs_c���ed +){ + +988 + `cڋxt__�t_��e +( +cڋxt +, +mosq_cs_disc����g +); + +989 + `do_disc��� +( +db +, +cڋxt +, +MOSQ_ERR_AUTH +); + +994 +�cur�y_�ts + = & +db +-> +c�fig +-> +�cur�y_�ti�s +; + +997 if( +�cur�y_�ts + && secur�y_�ts-> +a�_li� +){ + +998 +a�_u�r_�� + = +�cur�y_�ts +-> +a�_li� +; + +999 +a�_u�r_�� +){ + +1000 if( +a�_u�r_�� +-> +u��ame +){ + +1001 if( +cڋxt +-> +u��ame +){ + +1002 if(! + `�rcmp +( +a�_u�r_�� +-> +u��ame +, +cڋxt +->username)){ + +1003 +cڋxt +-> +a�_li� + = +a�_u�r_�� +; + +1008 if(! +cڋxt +-> +u��ame +){ + +1009 +cڋxt +-> +a�_li� + = +a�_u�r_�� +; + +1013 +a�_u�r_�� + =��_u�r_��-> +�xt +; + +1017 +MOSQ_ERR_SUCCESS +; + +1018 + } +} + +1020 + $mosqu�to_psk_key_g�_de�u� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +h�t +, cڡ * +id�t�y +, * +key +, +max_key_�n +) + +1022 +mosqu�to__u�wd + * +u +, * +tmp +; + +1023 +mosqu�to__u�wd + * +psk_id_�f + = +NULL +; + +1025 if(! +db + || ! +h�t + || ! +id�t�y + || ! +key +� +MOSQ_ERR_INVAL +; + +1027 if( +db +-> +c�fig +-> +�r_li���_���gs +){ + +1028 if(! +cڋxt +-> +li��� +� +MOSQ_ERR_INVAL +; + +1029 if(! +cڋxt +-> +li��� +-> +psk_id +� +MOSQ_ERR_PLUGIN_DEFER +; + +1030 +psk_id_�f + = +cڋxt +-> +li��� +-> +psk_id +; + +1032 if(! +db +-> +psk_id +� +MOSQ_ERR_PLUGIN_DEFER +; + +1033 +psk_id_�f + = +db +-> +psk_id +; + +1035 if(! +psk_id_�f +� +MOSQ_ERR_PLUGIN_DEFER +; + +1037 + `HASH_ITER +( +hh +, +psk_id_�f +, +u +, +tmp +){ + +1038 if(! + `�rcmp +( +u +-> +u��ame +, +id�t�y +)){ + +1039 + `���y +( +key +, +u +-> +�ssw�d +, +max_key_�n +); + +1040 +MOSQ_ERR_SUCCESS +; + +1044 +MOSQ_ERR_AUTH +; + +1045 + } +} + +1047 #ifde� +WITH_TLS + + +1048 + $pw__dige� +(cڡ * +�ssw�d +, cڡ * +�� +, +��_�n +, * +hash +, * +hash_�n +) + +1050 cڡ +EVP_MD + * +dige� +; + +1051 #i� +OPENSSL_VERSION_NUMBER + < 0x10100000L + +1052 +EVP_MD_CTX + +cڋxt +; + +1054 +dige� + = + `EVP_g�_dige�by�me +("sha512"); + +1055 if(! +dige� +){ + +1060 + `EVP_MD_CTX_�� +(& +cڋxt +); + +1061 + `EVP_Dige�In�_ex +(& +cڋxt +, +dige� +, +NULL +); + +1062 + `EVP_Dige�Upd�e +(& +cڋxt +, +�ssw�d +, + `��� +(password)); + +1063 + `EVP_Dige�Upd�e +(& +cڋxt +, +�� +, +��_�n +); + +1065 + `EVP_Dige�F��_ex +(& +cڋxt +, +hash +, +hash_�n +); + +1066 + `EVP_MD_CTX_��nup +(& +cڋxt +); + +1068 +EVP_MD_CTX + * +cڋxt +; + +1070 +dige� + = + `EVP_g�_dige�by�me +("sha512"); + +1071 if(! +dige� +){ + +1076 +cڋxt + = + `EVP_MD_CTX_�w +(); + +1077 + `EVP_Dige�In�_ex +( +cڋxt +, +dige� +, +NULL +); + +1078 + `EVP_Dige�Upd�e +( +cڋxt +, +�ssw�d +, + `��� +(password)); + +1079 + `EVP_Dige�Upd�e +( +cڋxt +, +�� +, +��_�n +); + +1081 + `EVP_Dige�F��_ex +( +cڋxt +, +hash +, +hash_�n +); + +1082 + `EVP_MD_CTX_� +( +cڋxt +); + +1085 +MOSQ_ERR_SUCCESS +; + +1086 + } +} + +1088 + $ba�64__decode +(* +� +, ** +decoded +, * +decoded_�n +) + +1090 +BIO + * +bmem +, * +b64 +; + +1091 +�� +; + +1093 +�� + = + `��� +( +� +); + +1095 +b64 + = + `BIO_�w +( + `BIO_f_ba�64 +()); + +1096 if(! +b64 +){ + +1099 + `BIO_�t_�ags +( +b64 +, +BIO_FLAGS_BASE64_NO_NL +); + +1101 +bmem + = + `BIO_�w +( + `BIO_s_mem +()); + +1102 if(! +bmem +){ + +1103 + `BIO_�_�l +( +b64 +); + +1106 +b64 + = + `BIO_push +(b64, +bmem +); + +1107 + `BIO_wr�e +( +bmem +, +� +, +�� +); + +1109 if( + `BIO_�ush +( +bmem +) != 1){ + +1110 + `BIO_�_�l +( +b64 +); + +1113 * +decoded + = + `mosqu�to__��oc +( +�� +, 1); + +1114 if(!(* +decoded +)){ + +1115 + `BIO_�_�l +( +b64 +); + +1118 * +decoded_�n + = + `BIO_�ad +( +b64 +, * +decoded +, +�� +); + +1119 + `BIO_�_�l +( +b64 +); + +1121 if(* +decoded_�n + <= 0){ + +1122 + `mosqu�to__� +(* +decoded +); + +1123 * +decoded + = +NULL +; + +1124 * +decoded_�n + = 0; + +1129 + } +} + + @src/send_auth.c + +17 + ~"c�fig.h +" + +19 + ~"mosqu�to_brok�_����.h +" + +20 + ~"mq�_��oc�.h +" + +21 + ~"mem�y_mosq.h +" + +22 + ~"�ck�_mosq.h +" + +23 + ~"�ݔty_mosq.h +" + +24 + ~"ut�_mosq.h +" + +26 + $�nd__auth +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +�as�_code +, cڡ * +auth_d�a +, +u�t16_t + +auth_d�a_�n +) + +28 +mosqu�to__�ck� + * +�ck� + = +NULL +; + +29 +rc +; + +30 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +31 +���n +, +v�by�s +; + +32 +u�t32_t + +�ma��g_�ngth +; + +34 if( +cڋxt +-> +auth_m�hod + =� +NULL +� +MOSQ_ERR_INVAL +; + +35 if( +cڋxt +-> +��oc� + !� +mosq_p_mq�5 +� +MOSQ_ERR_PROTOCOL +; + +37 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "S�d�g AUTH��%��c%d, %s)", +cڋxt +-> +id +, +�as�_code +, cڋxt-> +auth_m�hod +); + +39 +�ma��g_�ngth + = 1; + +41 +rc + = + `mosqu�to_�ݔty_add_�r�g +(& +�ݔt�s +, +MQTT_PROP_AUTHENTICATION_METHOD +, +cڋxt +-> +auth_m�hod +); + +42 if( +rc +){ + +43 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +44 +rc +; + +47 if( +auth_d�a + !� +NULL + && +auth_d�a_�n + > 0){ + +48 +rc + = + `mosqu�to_�ݔty_add_b��y +(& +�ݔt�s +, +MQTT_PROP_AUTHENTICATION_DATA +, +auth_d�a +, +auth_d�a_�n +); + +49 if( +rc +){ + +50 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +51 +rc +; + +55 +���n + = + `�ݔty__g�_�ngth_�l +( +�ݔt�s +); + +56 +v�by�s + = + `�ck�__v��t_by�s +( +���n +); + +57 +�ma��g_�ngth + +� +���n + + +v�by�s +; + +59 if( + `�ck�__check_ov�size +( +cڋxt +, +�ma��g_�ngth +)){ + +60 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +61 + `mosqu�to__� +( +�ck� +); + +62 +MOSQ_ERR_OVERSIZE_PACKET +; + +65 +�ck� + = + `mosqu�to__��oc +(1, ( +mosqu�to__�ck� +)); + +66 if(! +�ck� +� +MOSQ_ERR_NOMEM +; + +68 +�ck� +-> +comm�d + = +CMD_AUTH +; + +69 +�ck� +-> +�ma��g_�ngth + =�emaining_length; + +71 +rc + = + `�ck�__�loc +( +�ck� +); + +72 if( +rc +){ + +73 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +74 + `mosqu�to__� +( +�ck� +); + +75 +rc +; + +77 + `�ck�__wr�e_by� +( +�ck� +, +�as�_code +); + +78 + `�ݔty__wr�e_�l +( +�ck� +, +�ݔt�s +, +�ue +); + +79 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +81 + `�ck�__queue +( +cڋxt +, +�ck� +); + +82 + } +} + + @src/send_connack.c + +17 + ~"c�fig.h +" + +19 + ~"mosqu�to_brok�_����.h +" + +20 + ~"mq�_��oc�.h +" + +21 + ~"mem�y_mosq.h +" + +22 + ~"�ck�_mosq.h +" + +23 + ~"�ݔty_mosq.h +" + +24 + ~"ut�_mosq.h +" + +26 + $�nd__c��ck +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +ack +, +�as�_code +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +28 +mosqu�to__�ck� + * +�ck� + = +NULL +; + +29 +rc +; + +30 +mosqu�to_�ݔty + * +c��ck_��s + = +NULL +; + +31 +���n +, +v�by�s +; + +32 +u�t32_t + +�ma��g_�ngth +; + +34 +rc + = + `mosqu�to_�ݔty_c�y_�l +(& +c��ck_��s +, +�ݔt�s +); + +35 if( +rc +){ + +36 +rc +; + +39 if( +cڋxt +-> +id +){ + +40 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "S�d�g CONNACK��%�(%d, %d)", +cڋxt +-> +id +, +ack +, +�as�_code +); + +42 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "S�d�g CONNACK��%�(%d, %d)", +cڋxt +-> +add�ss +, +ack +, +�as�_code +); + +45 +�ma��g_�ngth + = 2; + +47 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +48 if( +�as�_code + < 128 && +db +-> +c�fig +-> +���_ava�ab� + =� +�l� +){ + +49 +rc + = + `mosqu�to_�ݔty_add_by� +(& +c��ck_��s +, +MQTT_PROP_RETAIN_AVAILABLE +, 0); + +50 if( +rc +){ + +51 + `mosqu�to_�ݔty_�_�l +(& +c��ck_��s +); + +52 +rc +; + +55 if( +db +-> +c�fig +-> +max_�ck�_size + > 0){ + +56 +rc + = + `mosqu�to_�ݔty_add_�t32 +(& +c��ck_��s +, +MQTT_PROP_MAXIMUM_PACKET_SIZE +, +db +-> +c�fig +-> +max_�ck�_size +); + +57 if( +rc +){ + +58 + `mosqu�to_�ݔty_�_�l +(& +c��ck_��s +); + +59 +rc +; + +63 +���n + = + `�ݔty__g�_�ngth_�l +( +c��ck_��s +); + +64 +v�by�s + = + `�ck�__v��t_by�s +( +���n +); + +65 +�ma��g_�ngth + +� +���n + + +v�by�s +; + +68 if( + `�ck�__check_ov�size +( +cڋxt +, +�ma��g_�ngth +)){ + +69 + `mosqu�to_�ݔty_�_�l +(& +c��ck_��s +); + +70 + `mosqu�to__� +( +�ck� +); + +71 +MOSQ_ERR_OVERSIZE_PACKET +; + +74 +�ck� + = + `mosqu�to__��oc +(1, ( +mosqu�to__�ck� +)); + +75 if(! +�ck� +� +MOSQ_ERR_NOMEM +; + +77 +�ck� +-> +comm�d + = +CMD_CONNACK +; + +78 +�ck� +-> +�ma��g_�ngth + =�emaining_length; + +80 +rc + = + `�ck�__�loc +( +�ck� +); + +81 if( +rc +){ + +82 + `mosqu�to_�ݔty_�_�l +(& +c��ck_��s +); + +83 + `mosqu�to__� +( +�ck� +); + +84 +rc +; + +86 + `�ck�__wr�e_by� +( +�ck� +, +ack +); + +87 + `�ck�__wr�e_by� +( +�ck� +, +�as�_code +); + +88 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +89 + `�ݔty__wr�e_�l +( +�ck� +, +c��ck_��s +, +�ue +); + +91 + `mosqu�to_�ݔty_�_�l +(& +c��ck_��s +); + +93 + `�ck�__queue +( +cڋxt +, +�ck� +); + +94 + } +} + + @src/send_suback.c + +17 + ~"c�fig.h +" + +19 + ~"mosqu�to_brok�_����.h +" + +20 + ~"mq�_��oc�.h +" + +21 + ~"mem�y_mosq.h +" + +22 + ~"�ck�_mosq.h +" + +23 + ~"�ݔty_mosq.h +" + +24 + ~"ut�_mosq.h +" + +27 + $�nd__suback +( +mosqu�to + * +cڋxt +, +u�t16_t + +mid +, +u�t32_t + +�yl�d�n +, cڡ * +�yl�d +) + +29 +mosqu�to__�ck� + * +�ck� + = +NULL +; + +30 +rc +; + +31 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +32 +���n +, +v�by�s +; + +34 + `log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "S�d�g SUBACK��%s", +cڋxt +-> +id +); + +36 +�ck� + = + `mosqu�to__��oc +(1, ( +mosqu�to__�ck� +)); + +37 if(! +�ck� +� +MOSQ_ERR_NOMEM +; + +39 +�ck� +-> +comm�d + = +CMD_SUBACK +; + +40 +�ck� +-> +�ma��g_�ngth + = 2+ +�yl�d�n +; + +41 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +42 +���n + = + `�ݔty__g�_�ngth_�l +( +�ݔt�s +); + +43 +v�by�s + = + `�ck�__v��t_by�s +( +���n +); + +44 +�ck� +-> +�ma��g_�ngth + +� +���n + + +v�by�s +; + +46 +rc + = + `�ck�__�loc +( +�ck� +); + +47 if( +rc +){ + +48 + `mosqu�to__� +( +�ck� +); + +49 +rc +; + +51 + `�ck�__wr�e_u�t16 +( +�ck� +, +mid +); + +53 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�5 +){ + +55 + `�ݔty__wr�e_�l +( +�ck� +, +�ݔt�s +, +�ue +); + +58 if( +�yl�d�n +){ + +59 + `�ck�__wr�e_by�s +( +�ck� +, +�yl�d +, +�yl�d�n +); + +62 + `�ck�__queue +( +cڋxt +, +�ck� +); + +63 + } +} + + @src/send_unsuback.c + +17 + ~"c�fig.h +" + +19 + ~<as��.h +> + +21 + ~"mosqu�to_brok�_����.h +" + +22 + ~"mq�_��oc�.h +" + +23 + ~"mem�y_mosq.h +" + +24 + ~"�ck�_mosq.h +" + +25 + ~"�ݔty_mosq.h +" + +28 + $�nd__unsuback +( +mosqu�to + * +mosq +, +u�t16_t + +mid +, +�as�_code_cou� +, +u�t8_t + * +�as�_codes +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +30 +mosqu�to__�ck� + * +�ck� + = +NULL +; + +31 +rc +; + +32 +���n +, +v�by�s +; + +34 + `as�� +( +mosq +); + +35 +�ck� + = + `mosqu�to__��oc +(1, ( +mosqu�to__�ck� +)); + +36 if(! +�ck� +� +MOSQ_ERR_NOMEM +; + +38 +�ck� +-> +comm�d + = +CMD_UNSUBACK +; + +39 +�ck� +-> +�ma��g_�ngth + = 2; + +41 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +42 +���n + = + `�ݔty__g�_�ngth_�l +( +�ݔt�s +); + +43 +v�by�s + = + `�ck�__v��t_by�s +( +���n +); + +44 +�ck� +-> +�ma��g_�ngth + +� +v�by�s + + +���n + + +�as�_code_cou� +; + +47 +rc + = + `�ck�__�loc +( +�ck� +); + +48 if( +rc +){ + +49 + `mosqu�to__� +( +�ck� +); + +50 +rc +; + +53 + `�ck�__wr�e_u�t16 +( +�ck� +, +mid +); + +55 if( +mosq +-> +��oc� + =� +mosq_p_mq�5 +){ + +56 + `�ݔty__wr�e_�l +( +�ck� +, +�ݔt�s +, +�ue +); + +57 + `�ck�__wr�e_by�s +( +�ck� +, +�as�_codes +, +�as�_code_cou� +); + +60 + `�ck�__queue +( +mosq +, +�ck� +); + +61 + } +} + + @src/service.c + +17 #i� +def�ed +( +WIN32 +�|| def�ed( +__CYGWIN__ +) + +19 + ~"c�fig.h +" + +21 + ~<w�dows.h +> + +23 + ~"mem�y_mosq.h +" + +25 +run +; + +26 +SERVICE_STATUS_HANDLE + + g�rvi�_h�d� + = 0; + +27 +SERVICE_STATUS + + g�rvi�_��us +; + +28 +ma� +( +�gc +, * +�gv +[]); + +30 + $��t_�r� +() + +32 * +buf +; + +34 + `F�m�Mes�ge +( +FORMAT_MESSAGE_ALLOCATE_BUFFER + | +FORMAT_MESSAGE_FROM_SYSTEM +, + +35 +NULL +, + `G�La�E�� +(), +LANG_NEUTRAL +, & +buf +, 0, NULL); + +37 + `�r�tf +( +�d�r +, "E��: %s\n", +buf +); + +38 + `Lo�lF�e +( +buf +); + +39 + } +} + +43 +__�d�� + + $�rvi�_h�d�r +( +DWORD + +fdwCڌ� +) + +45 +fdwCڌ� +){ + +46 +SERVICE_CONTROL_CONTINUE +: + +49 +SERVICE_CONTROL_PAUSE +: + +52 +SERVICE_CONTROL_SHUTDOWN +: + +54 +SERVICE_CONTROL_STOP +: + +56 +�rvi�_��us +. +dwCu��tS�� + = +SERVICE_STOP_PENDING +; + +57 + `S�S�vi�S�tus +( +�rvi�_h�d� +, & +�rvi�_��us +); + +58 +run + = 0; + +61 + } +} + +64 +__�d�� + + $�rvi�_ma� +( +DWORD + +dwArgc +, +LPTSTR + * +�szArgv +) + +66 ** +�gv +; + +67 +�gc + = 1; + +68 +c�f_�th +[ +MAX_PATH + + 20]; + +69 +rc +; + +71 +�rvi�_h�d� + = + `Regi��S�vi�C�lH�d�r +("mosqu�to", +�rvi�_h�d�r +); + +72 if( +�rvi�_h�d� +){ + +73 + `mem�t +( +c�f_�th +, 0, +MAX_PATH + + 20); + +74 +rc + = + `G�Env��m�tV��b� +("MOSQUITTO_DIR", +c�f_�th +, +MAX_PATH +); + +75 if(! +rc + ||��=� +MAX_PATH +){ + +76 +�rvi�_��us +. +dwCu��tS�� + = +SERVICE_STOPPED +; + +77 + `S�S�vi�S�tus +( +�rvi�_h�d� +, & +�rvi�_��us +); + +80 + `�r�t +( +c�f_�th +, "/mosquitto.conf"); + +82 +�gv + = + `mosqu�to__m�loc +((*)*3); + +83 +�gv +[0] = "mosquitto"; + +84 +�gv +[1] = "-c"; + +85 +�gv +[2] = +c�f_�th +; + +86 +�gc + = 3; + +88 +�rvi�_��us +. +dwS�vi�Ty� + = +SERVICE_WIN32_OWN_PROCESS +; + +89 +�rvi�_��us +. +dwCu��tS�� + = +SERVICE_RUNNING +; + +90 +�rvi�_��us +. +dwCڌ�sAc��ed + = +SERVICE_ACCEPT_SHUTDOWN + | +SERVICE_ACCEPT_STOP +; + +91 +�rvi�_��us +. +dwW�32Ex�Code + = +NO_ERROR +; + +92 +�rvi�_��us +. +dwCheckPo�t + = 0; + +93 + `S�S�vi�S�tus +( +�rvi�_h�d� +, & +�rvi�_��us +); + +95 + `ma� +( +�gc +, +�gv +); + +96 + `mosqu�to__� +( +�gv +); + +98 +�rvi�_��us +. +dwCu��tS�� + = +SERVICE_STOPPED +; + +99 + `S�S�vi�S�tus +( +�rvi�_h�d� +, & +�rvi�_��us +); + +101 + } +} + +103 + $�rvi�_���l +() + +105 +SC_HANDLE + +sc_m�ag� +, +svc_h�d� +; + +106 +exe_�th +[ +MAX_PATH + + 5]; + +107 +SERVICE_DESCRIPTION + +svc_desc +; + +109 + `mem�t +( +exe_�th +, 0, +MAX_PATH ++5); + +110 if( + `G�Modu�F�eName +( +NULL +, +exe_�th +, +MAX_PATH +) == MAX_PATH){ + +111 + `�r�tf +( +�d�r +, "Error: Path�oo�ong.\n"); + +114 + `�r�t +( +exe_�th +, "�un"); + +116 +sc_m�ag� + = + `O�nSCM�ag� +( +NULL +, NULL, +SC_MANAGER_CREATE_SERVICE +); + +117 if( +sc_m�ag� +){ + +118 +svc_h�d� + = + `C��eS�vi� +( +sc_m�ag� +, "mosquitto", "Mosquitto Broker", + +119 +SERVICE_START + | +SERVICE_STOP + | +SERVICE_CHANGE_CONFIG +, + +120 +SERVICE_WIN32_OWN_PROCESS +, +SERVICE_AUTO_START +, +SERVICE_ERROR_NORMAL +, + +121 +exe_�th +, +NULL +, NULL, NULL, NULL, NULL); + +123 if( +svc_h�d� +){ + +124 +svc_desc +. +�Des��ti� + = "MQTT v3.1.1 broker"; + +125 + `Ch�geS�vi�C�fig2 +( +svc_h�d� +, +SERVICE_CONFIG_DESCRIPTION +, & +svc_desc +); + +126 + `Clo�S�vi�H�d� +( +svc_h�d� +); + +128 + `��t_�r� +(); + +130 + `Clo�S�vi�H�d� +( +sc_m�ag� +); + +132 + `��t_�r� +(); + +134 + } +} + +136 + $�rvi�_un���l +() + +138 +SC_HANDLE + +sc_m�ag� +, +svc_h�d� +; + +139 +SERVICE_STATUS + +��us +; + +141 +sc_m�ag� + = + `O�nSCM�ag� +( +NULL +, +SERVICES_ACTIVE_DATABASE +, +SC_MANAGER_CONNECT +); + +142 if( +sc_m�ag� +){ + +143 +svc_h�d� + = + `O�nS�vi� +( +sc_m�ag� +, "mosqu�to", +SERVICE_QUERY_STATUS + | +DELETE +); + +144 if( +svc_h�d� +){ + +145 if( + `Qu�yS�vi�S�tus +( +svc_h�d� +, & +��us +)){ + +146 if( +��us +. +dwCu��tS�� + =� +SERVICE_STOPPED +){ + +147 + `D��eS�vi� +( +svc_h�d� +); + +150 + `Clo�S�vi�H�d� +( +svc_h�d� +); + +152 + `��t_�r� +(); + +154 + `Clo�S�vi�H�d� +( +sc_m�ag� +); + +156 + `��t_�r� +(); + +158 + } +} + +160 + $�rvi�_run +() + +162 +SERVICE_TABLE_ENTRY + +�e +[] = { + +163 { "mosqu�to", +�rvi�_ma� + }, + +164 { +NULL +, NULL } + +167 + `S��S�vi�C�lDi��ch� +( +�e +); + +168 + } +} + + @src/session_expiry.c + +17 + ~"c�fig.h +" + +19 + ~<m�h.h +> + +20 + ~<�dio.h +> + +21 + ~<u�i�.h +> + +23 + ~"mosqu�to_brok�_����.h +" + +24 + ~"mem�y_mosq.h +" + +25 + ~"time_mosq.h +" + +27 +�ssi�_exp�y_li� + * + gexp�y_li� + = +NULL +; + +28 +time_t + + gϡ_check + = 0; + +31 + $�ssi�_exp�y__cmp +( +�ssi�_exp�y_li� + * +i1 +, �ssi�_exp�y_li� * +i2 +) + +33 +i1 +-> +cڋxt +-> +�ssi�_exp�y_��rv� + - +i2 +->context->session_expiry_interval; + +34 + } +} + +37 + $�ssi�_exp�y__add +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +39 +�ssi�_exp�y_li� + * +�em +; + +41 +�em + = + `mosqu�to__��oc +(1, ( +�ssi�_exp�y_li� +)); + +42 if(! +�em +� +MOSQ_ERR_NOMEM +; + +44 +�em +-> +cڋxt + = context; + +45 +�em +-> +cڋxt +-> +�ssi�_exp�y_time + = + `time +( +NULL +); + +46 if( +db +-> +c�fig +-> +�rsi��t_���_exp��i� + == 0 || + +47 +db +-> +c�fig +-> +�rsi��t_���_exp��i� + < +�em +-> +cڋxt +-> +�ssi�_exp�y_��rv� +){ + +49 +�em +-> +cڋxt +-> +�ssi�_exp�y_time + +�em->cڋxt-> +�ssi�_exp�y_��rv� +; + +51 +�em +-> +cڋxt +-> +�ssi�_exp�y_time + +� +db +-> +c�fig +-> +�rsi��t_���_exp��i� +; + +53 +cڋxt +-> +exp�y_li�_�em + = +�em +; + +55 + `DL_INSERT_INORDER +( +exp�y_li� +, +�em +, +�ssi�_exp�y__cmp +); + +57 +MOSQ_ERR_SUCCESS +; + +58 + } +} + +61 + $�ssi�_exp�y__�move +( +mosqu�to + * +cڋxt +) + +63 if( +cڋxt +-> +exp�y_li�_�em +){ + +64 + `DL_DELETE +( +exp�y_li� +, +cڋxt +-> +exp�y_li�_�em +); + +65 + `mosqu�to__� +( +cڋxt +-> +exp�y_li�_�em +); + +66 +cڋxt +-> +exp�y_li�_�em + = +NULL +; + +68 + } +} + +72 + $�ssi�_exp�y__�move_�l +( +mosqu�to_db + * +db +) + +74 +�ssi�_exp�y_li� + * +�em +, * +tmp +; + +75 +mosqu�to + * +cڋxt +; + +77 + `DL_FOREACH_SAFE +( +exp�y_li� +, +�em +, +tmp +){ + +78 +cڋxt + = +�em +->context; + +79 + `�ssi�_exp�y__�move +( +cڋxt +); + +80 +cڋxt +-> +�ssi�_exp�y_��rv� + = 0; + +81 +cڋxt +-> +w�l_d�ay_��rv� + = 0; + +82 + `cڋxt__disc��� +( +db +, +cڋxt +); + +85 + } +} + +87 + $�ssi�_exp�y__check +( +mosqu�to_db + * +db +, +time_t + +now +) + +89 +�ssi�_exp�y_li� + * +�em +, * +tmp +; + +90 +mosqu�to + * +cڋxt +; + +92 if( +now + <� +ϡ_check +) ; + +94 +ϡ_check + = +now +; + +96 + `DL_FOREACH_SAFE +( +exp�y_li� +, +�em +, +tmp +){ + +97 if( +�em +-> +cڋxt +-> +�ssi�_exp�y_time + < +now +){ + +98 +cڋxt + = +�em +->context; + +99 + `�ssi�_exp�y__�move +( +cڋxt +); + +101 +cڋxt +-> +�ssi�_exp�y_��rv� + = 0; + +102 + `cڋxt__�nd_w�l +( +db +, +cڋxt +); + +103 + `cڋxt__add_to_disu�d +( +db +, +cڋxt +); + +109 + } +} + + @src/signals.c + +18 + ~"c�fig.h +" + +20 #i�de� +WIN32 + + +21 + ~<uni�d.h +> + +22 + ~<g�.h +> + +23 + ~<as��.h +> + +26 #i�de� +WIN32 + + +27 + ~<pwd.h +> + +29 + ~<�o�ss.h +> + +30 + ~<w�sock2.h +> + +31 + ~<ws2t��.h +> + +34 #i�de� +WIN32 + + +35 + ~<sys/time.h +> + +38 + ~<��o.h +> + +39 + ~<sig�l.h +> + +40 + ~<�dio.h +> + +41 + ~<�r�g.h +> + +42 #ifde� +WITH_SYSTEMD + + +43 + ~<sy�emd/sd-d�m�.h +> + +45 #ifde� +WITH_WRAP + + +46 + ~<t�d.h +> + +48 #ifde� +WITH_WEBSOCKETS + + +49 + ~<libwebsock�s.h +> + +52 + ~"mosqu�to_brok�_����.h +" + +53 + ~"mem�y_mosq.h +" + +54 + ~"ut�_mosq.h +" + +56 +bo� + +�ag_�l�d +; + +57 #ifde� +WITH_PERSISTENCE + + +58 +bo� + +�ag_db_backup +; + +60 +bo� + +�ag_��_��t +; + +61 +run +; + +63 #ifde� +SIGHUP + + +65 + $h�d�_sighup +( +sig�l +) + +67 + `UNUSED +( +sig�l +); + +69 +�ag_�l�d + = +�ue +; + +70 + } +} + +74 + $h�d�_sig�t +( +sig�l +) + +76 + `UNUSED +( +sig�l +); + +78 +run + = 0; + +79 + } +} + +82 + $h�d�_sigu�1 +( +sig�l +) + +84 + `UNUSED +( +sig�l +); + +86 #ifde� +WITH_PERSISTENCE + + +87 +�ag_db_backup + = +�ue +; + +89 + } +} + +92 + $h�d�_sigu�2 +( +sig�l +) + +94 + `UNUSED +( +sig�l +); + +96 +�ag_��_��t + = +�ue +; + +97 + } +} + +112 #ifde� +WIN32 + + +113 +DWORD + +WINAPI + + $SigTh�adProc +(* +d�a +) + +115 +TCHAR + +evt_�me +[ +MAX_PATH +]; + +116 +HANDLE + +evt +[3]; + +117 +pid + = + `G�Cu��tPro�ssId +(); + +119 + `�r�tf_s +( +evt_�me +, +MAX_PATH +, "mosq%d_shutdown", +pid +); + +120 +evt +[0] = + `C��eEv�t +( +NULL +, +TRUE +, +FALSE +, +evt_�me +); + +121 + `�r�tf_s +( +evt_�me +, +MAX_PATH +, "mosq%d_�l�d", +pid +); + +122 +evt +[1] = + `C��eEv�t +( +NULL +, +FALSE +, FALSE, +evt_�me +); + +123 + `�r�tf_s +( +evt_�me +, +MAX_PATH +, "mosq%d_backup", +pid +); + +124 +evt +[2] = + `C��eEv�t +( +NULL +, +FALSE +, FALSE, +evt_�me +); + +126 +�ue +) { + +127 +wr + = + `Wa�F�Muɝ�Obje�s +(( +evt +�/ ( +HANDLE +),�vt, +FALSE +, +INFINITE +); + +128 +wr +) { + +129 +WAIT_OBJECT_0 + + 0: + +130 + `h�d�_sig�t +( +SIGINT +); + +132 +WAIT_OBJECT_0 + + 1: + +133 +�ag_�l�d + = +�ue +; + +135 +WAIT_OBJECT_0 + + 2: + +136 + `h�d�_sigu�1 +(0); + +141 + `Clo�H�d� +( +evt +[0]); + +142 + `Clo�H�d� +( +evt +[1]); + +143 + `Clo�H�d� +( +evt +[2]); + +145 + } +} + + @src/subs.c + +48 + ~"c�fig.h +" + +50 + ~<as��.h +> + +51 + ~<�dio.h +> + +52 + ~<�r�g.h +> + +54 + ~"mosqu�to_brok�_����.h +" + +55 + ~"mem�y_mosq.h +" + +56 + ~"mq�_��oc�.h +" + +57 + ~"ut�_mosq.h +" + +59 + ~"u�i�.h +" + +61 + ssub__tok� + { + +62 +sub__tok� + * + m�xt +; + +63 * + mt�ic +; + +64 +u�t16_t + + mt�ic_�n +; + +68 + $subs__�nd +( +mosqu�to_db + * +db +, +mosqu�to__sub�af + * +�af +, cڡ * +t�ic +, +qos +, +��� +, +mosqu�to_msg_��e + * +��ed +) + +70 +bo� + +���_��� +; + +71 +u�t16_t + +mid +; + +72 +���_qos +, +msg_qos +; + +73 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +74 +rc2 +; + +77 +rc2 + = + `mosqu�to_a�_check +( +db +, +�af +-> +cڋxt +, +t�ic +, +��ed +-> +�yl�d�n +, + `UHPA_ACCESS +(��ed-> +�yl�d +, st�ed->�yl�d�n), st�ed-> +qos +, st�ed-> +��� +, +MOSQ_ACL_READ +); + +78 if( +rc2 + =� +MOSQ_ERR_ACL_DENIED +){ + +79 +MOSQ_ERR_SUCCESS +; + +80 }if( +rc2 + =� +MOSQ_ERR_SUCCESS +){ + +81 +���_qos + = +�af +-> +qos +; + +83 if( +db +-> +c�fig +-> +upg�de_outgo�g_qos +){ + +84 +msg_qos + = +���_qos +; + +86 if( +qos + > +���_qos +){ + +87 +msg_qos + = +���_qos +; + +89 +msg_qos + = +qos +; + +92 if( +msg_qos +){ + +93 +mid + = + `mosqu�to__mid_g���e +( +�af +-> +cڋxt +); + +95 +mid + = 0; + +97 if( +�af +-> +���_as_published +){ + +98 +���_��� + = +��� +; + +100 +���_��� + = +�l� +; + +102 if( +�af +-> +id�tif�r +){ + +103 + `mosqu�to_�ݔty_add_v��t +(& +�ݔt�s +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, +�af +-> +id�tif�r +); + +105 if( + `db__mes�ge_��� +( +db +, +�af +-> +cڋxt +, +mid +, +mosq_md_out +, +msg_qos +, +���_��� +, +��ed +, +�ݔt�s +) == 1){ + +112 + } +} + +115 + $subs__sh�ed_�o�ss +( +mosqu�to_db + * +db +, +mosqu�to__subh�r + * +h�r +, cڡ * +t�ic +, +qos +, +��� +, +mosqu�to_msg_��e + * +��ed +) + +117 +rc + = 0, +rc2 +; + +118 +mosqu�to__subsh�ed + * +sh�ed +, * +sh�ed_tmp +; + +119 +mosqu�to__sub�af + * +�af +; + +121 + `HASH_ITER +( +hh +, +h�r +-> +sh�ed +, sh�ed, +sh�ed_tmp +){ + +122 +�af + = +sh�ed +-> +subs +; + +123 +rc2 + = + `subs__�nd +( +db +, +�af +, +t�ic +, +qos +, +��� +, +��ed +); + +125 + `DL_DELETE +( +sh�ed +-> +subs +, +�af +); + +126 + `DL_APPEND +( +sh�ed +-> +subs +, +�af +); + +128 if( +rc2 +� +rc + = 1; + +131 +rc +; + +132 + } +} + +134 + $subs__�o�ss +( +mosqu�to_db + * +db +, +mosqu�to__subh�r + * +h�r +, cڡ * +sour�_id +, cڡ * +t�ic +, +qos +, +��� +, +mosqu�to_msg_��e + * +��ed +, +bo� + +�t_��� +) + +136 +rc + = 0; + +137 +rc2 +; + +138 +mosqu�to__sub�af + * +�af +; + +140 if( +��� + && +�t_��� +){ + +141 #ifde� +WITH_PERSISTENCE + + +142 if( + `��cmp +( +t�ic +, "$SYS", 4)){ + +145 +db +-> +�rsi���_ch�ges +++; + +148 if( +h�r +-> +���ed +){ + +149 + `db__msg_��e_�f_dec +( +db +, & +h�r +-> +���ed +); + +150 #ifde� +WITH_SYS_TREE + + +151 +db +-> +���ed_cou� +--; + +154 if( +��ed +-> +�yl�d�n +){ + +155 +h�r +-> +���ed + = +��ed +; + +156 + `db__msg_��e_�f_�c +( +h�r +-> +���ed +); + +157 #ifde� +WITH_SYS_TREE + + +158 +db +-> +���ed_cou� +++; + +161 +h�r +-> +���ed + = +NULL +; + +165 +rc + = + `subs__sh�ed_�o�ss +( +db +, +h�r +, +t�ic +, +qos +, +��� +, +��ed +); + +167 +�af + = +h�r +-> +subs +; + +168 +sour�_id + && +�af +){ + +169 if(! +�af +-> +cڋxt +-> +id + || (�af-> +no_lo�l + && ! + `�rcmp +֗f->cڋxt->id, +sour�_id +))){ + +170 +�af + =��f-> +�xt +; + +173 +rc2 + = + `subs__�nd +( +db +, +�af +, +t�ic +, +qos +, +��� +, +��ed +); + +174 if( +rc2 +){ + +175 +rc + = 1; + +177 +�af + =��f-> +�xt +; + +179 if( +h�r +-> +subs + || h�r-> +sh�ed +){ + +180 +rc +; + +182 +MOSQ_ERR_NO_SUBSCRIBERS +; + +184 + } +} + +186 +sub__tok� + * + $sub__t�ic_��nd +( +sub__tok� + ** +�� +, sub__tok� ** +t�ics +, * +t�ic +) + +188 +sub__tok� + * +�w_t�ic +; + +190 if(! +t�ic +){ + +191 +NULL +; + +193 +�w_t�ic + = + `mosqu�to__m�loc +(( +sub__tok� +)); + +194 if(! +�w_t�ic +){ + +195 +NULL +; + +197 +�w_t�ic +-> +�xt + = +NULL +; + +198 +�w_t�ic +-> +t�ic_�n + = + `��� +( +t�ic +); + +199 +�w_t�ic +-> +t�ic + = + `mosqu�to__m�loc +�ew_t�ic-> +t�ic_�n ++1); + +200 if(! +�w_t�ic +-> +t�ic +){ + +201 + `mosqu�to__� +( +�w_t�ic +); + +202 +NULL +; + +204 + `���y +( +�w_t�ic +-> +t�ic +,��ic,�ew_t�ic-> +t�ic_�n ++1); + +206 if(* +�� +){ + +207 (* +�� +)-> +�xt + = +�w_t�ic +; + +208 * +�� + = (*��)-> +�xt +; + +210 * +t�ics + = +�w_t�ic +; + +211 * +�� + = +�w_t�ic +; + +213 +�w_t�ic +; + +214 + } +} + +216 + $sub__t�ic_tok�i� +(cڡ * +subt�ic +, +sub__tok� + ** +t�ics +) + +218 +sub__tok� + * +�w_t�ic +, * +�� + = +NULL +; + +219 +�n +; + +220 +��t +, +�� +, +�� +; + +221 +i +; + +222 * +t�ic +; + +224 + `as�� +( +subt�ic +); + +225 + `as�� +( +t�ics +); + +227 if( +subt�ic +[0] != '$'){ + +228 +�w_t�ic + = + `sub__t�ic_��nd +(& +�� +, +t�ics +, ""); + +229 if(! +�w_t�ic +� +��nup +; + +232 +�n + = + `��� +( +subt�ic +); + +234 if( +subt�ic +[0] == '/'){ + +235 +�w_t�ic + = + `sub__t�ic_��nd +(& +�� +, +t�ics +, ""); + +236 if(! +�w_t�ic +� +��nup +; + +238 +��t + = 1; + +240 +��t + = 0; + +243 +�� + = 0; + +244 +i += +��t +; i< +�n ++1; i++){ + +245 if( +subt�ic +[ +i +] == '/' || subtopic[i] == '\0'){ + +246 +�� + = +i +; + +248 if( +��t + !� +�� +){ + +249 +�� + = +�� +- +��t +; + +251 +t�ic + = + `mosqu�to__m�loc +( +�� ++1); + +252 if(! +t�ic +� +��nup +; + +253 + `mem�y +( +t�ic +, & +subt�ic +[ +��t +], +�� +); + +254 +t�ic +[ +�� +] = '\0'; + +255 +�w_t�ic + = + `sub__t�ic_��nd +(& +�� +, +t�ics +, +t�ic +); + +256 + `mosqu�to__� +( +t�ic +); + +258 +�w_t�ic + = + `sub__t�ic_��nd +(& +�� +, +t�ics +, ""); + +260 if(! +�w_t�ic +� +��nup +; + +261 +��t + = +i ++1; + +265 +MOSQ_ERR_SUCCESS +; + +267 +��nup +: + +268 +�� + = * +t�ics +; + +269 * +t�ics + = +NULL +; + +270 +�� +){ + +271 + `mosqu�to__� +( +�� +-> +t�ic +); + +272 +�w_t�ic + = +�� +-> +�xt +; + +273 + `mosqu�to__� +( +�� +); + +274 +�� + = +�w_t�ic +; + +277 + } +} + +279 + $sub__t�ic_tok�s_� +( +sub__tok� + * +tok�s +) + +281 +sub__tok� + * +�� +; + +283 +tok�s +){ + +284 +�� + = +tok�s +-> +�xt +; + +285 + `mosqu�to__� +( +tok�s +-> +t�ic +); + +286 + `mosqu�to__� +( +tok�s +); + +287 +tok�s + = +�� +; + +289 + } +} + +292 + $sub__add_�af +( +mosqu�to + * +cڋxt +, +qos +, +u�t32_t + +id�tif�r +, +�ti�s +, +mosqu�to__sub�af + ** +h�d +, mosqu�to__sub�a�** +�w�af +) + +294 +mosqu�to__sub�af + * +�af +; + +296 * +�w�af + = +NULL +; + +297 +�af + = * +h�d +; + +299 +�af +){ + +300 if( +�af +-> +cڋxt + &&��f->cڋxt-> +id + && ! + `�rcmp +(leaf->context->id, context->id)){ + +304 +�af +-> +qos + = qos; + +305 +�af +-> +id�tif�r + = identifier; + +306 +MOSQ_ERR_SUB_EXISTS +; + +308 +�af + =��f-> +�xt +; + +310 +�af + = + `mosqu�to__��oc +(1, ( +mosqu�to__sub�af +)); + +311 if(! +�af +� +MOSQ_ERR_NOMEM +; + +312 +�af +-> +cڋxt + = context; + +313 +�af +-> +qos + = qos; + +314 +�af +-> +id�tif�r + = identifier; + +315 +�af +-> +no_lo�l + = (( +�ti�s + & +MQTT_SUB_OPT_NO_LOCAL +) != 0); + +316 +�af +-> +���_as_published + = (( +�ti�s + & +MQTT_SUB_OPT_RETAIN_AS_PUBLISHED +) != 0); + +318 + `DL_APPEND +(* +h�d +, +�af +); + +319 * +�w�af + = +�af +; + +321 +MOSQ_ERR_SUCCESS +; + +322 + } +} + +325 + $sub__�move_sh�ed_�af +( +mosqu�to__subh�r + * +subh�r +, +mosqu�to__subsh�ed + * +sh�ed +, +mosqu�to__sub�af + * +�af +) + +327 + `DL_DELETE +( +sh�ed +-> +subs +, +�af +); + +328 if( +sh�ed +-> +subs + =� +NULL +){ + +329 + `HASH_DELETE +( +hh +, +subh�r +-> +sh�ed +, shared); + +330 + `mosqu�to__� +( +sh�ed +-> +�me +); + +331 + `mosqu�to__� +( +sh�ed +); + +333 + `mosqu�to__� +( +�af +); + +334 + } +} + +337 + $sub__add_sh�ed +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +qos +, +u�t32_t + +id�tif�r +, +�ti�s +, +mosqu�to__subh�r + * +subh�r +, * +sh��ame +) + +339 +mosqu�to__sub�af + * +�w�af +; + +340 +mosqu�to__subsh�ed + * +sh�ed + = +NULL +; + +341 +mosqu�to__subsh�ed_�f + ** +sh�ed_subs +; + +342 +mosqu�to__subsh�ed_�f + * +sh�ed_�f +; + +343 +i +; + +344 +�� +; + +345 +rc +; + +347 +�� + = + `��� +( +sh��ame +); + +349 + `HASH_FIND +( +hh +, +subh�r +-> +sh�ed +, +sh��ame +, +�� +, shared); + +350 if( +sh�ed +){ + +351 + `mosqu�to__� +( +sh��ame +); + +353 +sh�ed + = + `mosqu�to__��oc +(1, ( +mosqu�to__subsh�ed +)); + +354 if(! +sh�ed +){ + +355 + `mosqu�to__� +( +sh��ame +); + +356 +MOSQ_ERR_NOMEM +; + +358 +sh�ed +-> +�me + = +sh��ame +; + +360 + `HASH_ADD_KEYPTR +( +hh +, +subh�r +-> +sh�ed +, sh�ed-> +�me +, +�� +, shared); + +363 +rc + = + `sub__add_�af +( +cڋxt +, +qos +, +id�tif�r +, +�ti�s +, & +sh�ed +-> +subs +, & +�w�af +); + +364 if( +rc + > 0){ + +365 if( +sh�ed +-> +subs + =� +NULL +){ + +366 + `HASH_DELETE +( +hh +, +subh�r +-> +sh�ed +, shared); + +367 + `mosqu�to__� +( +sh�ed +-> +�me +); + +368 + `mosqu�to__� +( +sh�ed +); + +370 +rc +; + +373 if( +rc + !� +MOSQ_ERR_SUB_EXISTS +){ + +374 +sh�ed_�f + = + `mosqu�to__��oc +(1, ( +mosqu�to__subsh�ed_�f +)); + +375 if(! +sh�ed_�f +){ + +376 + `sub__�move_sh�ed_�af +( +subh�r +, +sh�ed +, +�w�af +); + +377 +MOSQ_ERR_NOMEM +; + +379 +sh�ed_�f +-> +h�r + = +subh�r +; + +380 +sh�ed_�f +-> +sh�ed + = shared; + +382 +i +=0; i< +cڋxt +-> +sh�ed_sub_cou� +; i++){ + +383 if(! +cڋxt +-> +sh�ed_subs +[ +i +]){ + +384 +cڋxt +-> +sh�ed_subs +[ +i +] = +sh�ed_�f +; + +388 if( +i + =� +cڋxt +-> +sh�ed_sub_cou� +){ + +389 +sh�ed_subs + = + `mosqu�to__��loc +( +cڋxt +->sh�ed_subs, ( +mosqu�to__subh�r_�f + *)*(cڋxt-> +sh�ed_sub_cou� + + 1)); + +390 if(! +sh�ed_subs +){ + +391 + `sub__�move_sh�ed_�af +( +subh�r +, +sh�ed +, +�w�af +); + +392 +MOSQ_ERR_NOMEM +; + +394 +cڋxt +-> +sh�ed_subs + = shared_subs; + +395 +cڋxt +-> +sh�ed_sub_cou� +++; + +396 +cڋxt +-> +sh�ed_subs +[cڋxt-> +sh�ed_sub_cou� +-1] = +sh�ed_�f +; + +398 #ifde� +WITH_SYS_TREE + + +399 +db +-> +sh�ed_subs��ti�_cou� +++; + +403 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�31 + || cڋxt->��oc� =� +mosq_p_mq�5 +){ + +404 +rc +; + +408 +MOSQ_ERR_SUCCESS +; + +410 + } +} + +413 + $sub__add_n�m� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +qos +, +u�t32_t + +id�tif�r +, +�ti�s +, +mosqu�to__subh�r + * +subh�r +) + +415 +mosqu�to__sub�af + * +�w�af + = +NULL +; + +416 +mosqu�to__subh�r + ** +subs +; + +417 +i +; + +418 +rc +; + +420 +rc + = + `sub__add_�af +( +cڋxt +, +qos +, +id�tif�r +, +�ti�s +, & +subh�r +-> +subs +, & +�w�af +); + +421 if( +rc + > 0){ + +422 +rc +; + +425 if( +rc + !� +MOSQ_ERR_SUB_EXISTS +){ + +426 +i +=0; i< +cڋxt +-> +sub_cou� +; i++){ + +427 if(! +cڋxt +-> +subs +[ +i +]){ + +428 +cڋxt +-> +subs +[ +i +] = +subh�r +; + +432 if( +i + =� +cڋxt +-> +sub_cou� +){ + +433 +subs + = + `mosqu�to__��loc +( +cڋxt +->subs, ( +mosqu�to__subh�r + *)*(cڋxt-> +sub_cou� + + 1)); + +434 if(! +subs +){ + +435 + `DL_DELETE +( +subh�r +-> +subs +, +�w�af +); + +436 + `mosqu�to__� +( +�w�af +); + +437 +MOSQ_ERR_NOMEM +; + +439 +cڋxt +-> +subs + = subs; + +440 +cڋxt +-> +sub_cou� +++; + +441 +cڋxt +-> +subs +[cڋxt-> +sub_cou� +-1] = +subh�r +; + +443 #ifde� +WITH_SYS_TREE + + +444 +db +-> +subs��ti�_cou� +++; + +448 if( +cڋxt +-> +��oc� + =� +mosq_p_mq�31 + || cڋxt->��oc� =� +mosq_p_mq�5 +){ + +449 +rc +; + +453 +MOSQ_ERR_SUCCESS +; + +455 + } +} + +458 + $sub__add_cڋxt +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +qos +, +u�t32_t + +id�tif�r +, +�ti�s +, +mosqu�to__subh�r + * +subh�r +, +sub__tok� + * +tok�s +, * +sh��ame +) + +460 +mosqu�to__subh�r + * +b�nch +; + +463 +tok�s +){ + +464 + `HASH_FIND +( +hh +, +subh�r +-> +ch�d�n +, +tok�s +-> +t�ic +,�ok�s-> +t�ic_�n +, +b�nch +); + +465 if(! +b�nch +){ + +467 +b�nch + = + `sub__add_h�r_��y +( +subh�r +, &subh�r-> +ch�d�n +, +tok�s +-> +t�ic +,�ok�s-> +t�ic_�n +); + +468 if(! +b�nch +� +MOSQ_ERR_NOMEM +; + +470 +subh�r + = +b�nch +; + +471 +tok�s + =�ok��-> +�xt +; + +475 if( +cڋxt + && cڋxt-> +id +){ + +476 if( +sh��ame +){ + +477 + `sub__add_sh�ed +( +db +, +cڋxt +, +qos +, +id�tif�r +, +�ti�s +, +subh�r +, +sh��ame +); + +479 + `sub__add_n�m� +( +db +, +cڋxt +, +qos +, +id�tif�r +, +�ti�s +, +subh�r +); + +482 +MOSQ_ERR_SUCCESS +; + +484 + } +} + +487 + $sub__�move_n�m� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +mosqu�to__subh�r + * +subh�r +, +u�t8_t + * +�as� +) + +489 +mosqu�to__sub�af + * +�af +; + +490 +i +; + +492 +�af + = +subh�r +-> +subs +; + +493 +�af +){ + +494 if( +�af +-> +cڋxt +==context){ + +495 #ifde� +WITH_SYS_TREE + + +496 +db +-> +subs��ti�_cou� +--; + +498 + `DL_DELETE +( +subh�r +-> +subs +, +�af +); + +499 + `mosqu�to__� +( +�af +); + +505 +i +=0; i< +cڋxt +-> +sub_cou� +; i++){ + +506 if( +cڋxt +-> +subs +[ +i +] =� +subh�r +){ + +507 +cڋxt +-> +subs +[ +i +] = +NULL +; + +511 * +�as� + = 0; + +512 +MOSQ_ERR_SUCCESS +; + +514 +�af + =��f-> +�xt +; + +516 +MOSQ_ERR_NO_SUBSCRIBERS +; + +517 + } +} + +520 + $sub__�move_sh�ed +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +mosqu�to__subh�r + * +subh�r +, +u�t8_t + * +�as� +, * +sh��ame +) + +522 +mosqu�to__subsh�ed + * +sh�ed +; + +523 +mosqu�to__sub�af + * +�af +; + +524 +i +; + +526 + `HASH_FIND +( +hh +, +subh�r +-> +sh�ed +, +sh��ame +, + `��� +(sharename), shared); + +527 + `mosqu�to__� +( +sh��ame +); + +528 if( +sh�ed +){ + +529 +�af + = +sh�ed +-> +subs +; + +530 +�af +){ + +531 if( +�af +-> +cڋxt +==context){ + +532 #ifde� +WITH_SYS_TREE + + +533 +db +-> +sh�ed_subs��ti�_cou� +--; + +535 + `DL_DELETE +( +sh�ed +-> +subs +, +�af +); + +536 + `mosqu�to__� +( +�af +); + +542 +i +=0; i< +cڋxt +-> +sh�ed_sub_cou� +; i++){ + +543 if( +cڋxt +-> +sh�ed_subs +[ +i +] + +544 && +cڋxt +-> +sh�ed_subs +[ +i +]-> +h�r + =� +subh�r + + +545 && +cڋxt +-> +sh�ed_subs +[ +i +]-> +sh�ed + == shared){ + +547 + `mosqu�to__� +( +cڋxt +-> +sh�ed_subs +[ +i +]); + +548 +cڋxt +-> +sh�ed_subs +[ +i +] = +NULL +; + +553 if( +sh�ed +-> +subs + =� +NULL +){ + +554 + `HASH_DELETE +( +hh +, +subh�r +-> +sh�ed +, shared); + +555 + `mosqu�to__� +( +sh�ed +-> +�me +); + +556 + `mosqu�to__� +( +sh�ed +); + +559 * +�as� + = 0; + +560 +MOSQ_ERR_SUCCESS +; + +562 +�af + =��f-> +�xt +; + +564 +MOSQ_ERR_NO_SUBSCRIBERS +; + +566 +MOSQ_ERR_NO_SUBSCRIBERS +; + +568 + } +} + +571 + $sub__�move_�cur� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, +mosqu�to__subh�r + * +subh�r +, +sub__tok� + * +tok�s +, +u�t8_t + * +�as� +, * +sh��ame +) + +573 +mosqu�to__subh�r + * +b�nch +; + +575 if(! +tok�s +){ + +576 if( +sh��ame +){ + +577 + `sub__�move_sh�ed +( +db +, +cڋxt +, +subh�r +, +�as� +, +sh��ame +); + +579 + `sub__�move_n�m� +( +db +, +cڋxt +, +subh�r +, +�as� +); + +583 + `HASH_FIND +( +hh +, +subh�r +-> +ch�d�n +, +tok�s +-> +t�ic +,�ok�s-> +t�ic_�n +, +b�nch +); + +584 if( +b�nch +){ + +585 + `sub__�move_�cur� +( +db +, +cڋxt +, +b�nch +, +tok�s +-> +�xt +, +�as� +, +sh��ame +); + +586 if(! +b�nch +-> +ch�d�n + && !b�nch-> +subs + && !b�nch-> +���ed + && !b�nch-> +sh�ed +){ + +587 + `HASH_DELETE +( +hh +, +subh�r +-> +ch�d�n +, +b�nch +); + +588 + `mosqu�to__� +( +b�nch +-> +t�ic +); + +589 + `mosqu�to__� +( +b�nch +); + +592 +MOSQ_ERR_SUCCESS +; + +593 + } +} + +595 + $sub__��ch +( +mosqu�to_db + * +db +, +mosqu�to__subh�r + * +subh�r +, +sub__tok� + * +tok�s +, cڡ * +sour�_id +, cڡ * +t�ic +, +qos +, +��� +, +mosqu�to_msg_��e + * +��ed +, +bo� + +�t_��� +) + +598 +mosqu�to__subh�r + * +b�nch +; + +599 +rc +; + +600 +bo� + +have_subs�ib�s + = +�l� +; + +602 if( +tok�s +){ + +604 + `HASH_FIND +( +hh +, +subh�r +-> +ch�d�n +, +tok�s +-> +t�ic +,�ok�s-> +t�ic_�n +, +b�nch +); + +606 if( +b�nch +){ + +607 +rc + = + `sub__��ch +( +db +, +b�nch +, +tok�s +-> +�xt +, +sour�_id +, +t�ic +, +qos +, +��� +, +��ed +, +�t_��� +); + +608 if( +rc + =� +MOSQ_ERR_SUCCESS +){ + +609 +have_subs�ib�s + = +�ue +; + +610 }if( +rc + !� +MOSQ_ERR_NO_SUBSCRIBERS +){ + +611 +rc +; + +613 if(! +tok�s +-> +�xt +){ + +614 +rc + = + `subs__�o�ss +( +db +, +b�nch +, +sour�_id +, +t�ic +, +qos +, +��� +, +��ed +, +�t_��� +); + +615 if( +rc + =� +MOSQ_ERR_SUCCESS +){ + +616 +have_subs�ib�s + = +�ue +; + +617 }if( +rc + !� +MOSQ_ERR_NO_SUBSCRIBERS +){ + +618 +rc +; + +624 + `HASH_FIND +( +hh +, +subh�r +-> +ch�d�n +, "+", 1, +b�nch +); + +626 if( +b�nch +){ + +627 +rc + = + `sub__��ch +( +db +, +b�nch +, +tok�s +-> +�xt +, +sour�_id +, +t�ic +, +qos +, +��� +, +��ed +, +�l� +); + +628 if( +rc + =� +MOSQ_ERR_SUCCESS +){ + +629 +have_subs�ib�s + = +�ue +; + +630 }if( +rc + !� +MOSQ_ERR_NO_SUBSCRIBERS +){ + +631 +rc +; + +633 if(! +tok�s +-> +�xt +){ + +634 +rc + = + `subs__�o�ss +( +db +, +b�nch +, +sour�_id +, +t�ic +, +qos +, +��� +, +��ed +, +�l� +); + +635 if( +rc + =� +MOSQ_ERR_SUCCESS +){ + +636 +have_subs�ib�s + = +�ue +; + +637 }if( +rc + !� +MOSQ_ERR_NO_SUBSCRIBERS +){ + +638 +rc +; + +645 + `HASH_FIND +( +hh +, +subh�r +-> +ch�d�n +, "#", 1, +b�nch +); + +646 if( +b�nch + && !b�nch-> +ch�d�n +){ + +651 +rc + = + `subs__�o�ss +( +db +, +b�nch +, +sour�_id +, +t�ic +, +qos +, +��� +, +��ed +, +�l� +); + +652 if( +rc + =� +MOSQ_ERR_SUCCESS +){ + +653 +have_subs�ib�s + = +�ue +; + +654 }if( +rc + !� +MOSQ_ERR_NO_SUBSCRIBERS +){ + +655 +rc +; + +659 if( +have_subs�ib�s +){ + +660 +MOSQ_ERR_SUCCESS +; + +662 +MOSQ_ERR_NO_SUBSCRIBERS +; + +664 + } +} + +667 +mosqu�to__subh�r + * + $sub__add_h�r_��y +( +mosqu�to__subh�r + * +��� +, mosqu�to__subh��** +sibl�g +, cڡ * +t�ic +, +size_t + +�n +) + +669 +mosqu�to__subh�r + * +ch�d +; + +671 + `as�� +( +sibl�g +); + +673 +ch�d + = + `mosqu�to__��oc +(1, ( +mosqu�to__subh�r +)); + +674 if(! +ch�d +){ + +675 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +676 +NULL +; + +678 +ch�d +-> +��� + =�arent; + +679 +ch�d +-> +t�ic_�n + = +�n +; + +680 +ch�d +-> +t�ic + = + `m�loc +( +�n ++1); + +681 if(! +ch�d +-> +t�ic +){ + +682 +ch�d +-> +t�ic_�n + = 0; + +683 + `mosqu�to__� +( +ch�d +); + +684 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +685 +NULL +; + +687 + `���y +( +ch�d +-> +t�ic +,��ic, ch�d-> +t�ic_�n ++1); + +690 + `HASH_ADD_KEYPTR +( +hh +, * +sibl�g +, +ch�d +-> +t�ic +, ch�d-> +t�ic_�n +, child); + +692 +ch�d +; + +693 + } +} + +696 + $sub__add +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +sub +, +qos +, +u�t32_t + +id�tif�r +, +�ti�s +, +mosqu�to__subh�r + ** +ro� +) + +698 +rc + = 0; + +699 +mosqu�to__subh�r + * +subh�r +; + +700 +sub__tok� + * +tok�s + = +NULL +, * +t +; + +701 * +sh��ame + = +NULL +; + +703 + `as�� +( +ro� +); + +704 + `as�� +(* +ro� +); + +705 + `as�� +( +sub +); + +707 if( + `sub__t�ic_tok�i� +( +sub +, & +tok�s +)) 1; + +709 if(! + `�rcmp +( +tok�s +-> +t�ic +, "$share")){ + +710 if(! +tok�s +-> +�xt + || !tokens->next->next){ + +711 + `sub__t�ic_tok�s_� +( +tok�s +); + +712 +MOSQ_ERR_PROTOCOL +; + +714 +t + = +tok�s +-> +�xt +; + +715 + `mosqu�to__� +( +tok�s +-> +t�ic +); + +716 + `mosqu�to__� +( +tok�s +); + +717 +tok�s + = +t +; + +719 +sh��ame + = +tok�s +-> +t�ic +; + +721 +tok�s +-> +t�ic + = + `mosqu�to__�rdup +(""); + +722 if(! +tok�s +-> +t�ic +){ + +723 +tok�s +-> +t�ic + = +sh��ame +; + +724 + `sub__t�ic_tok�s_� +( +tok�s +); + +725 +MOSQ_ERR_PROTOCOL +; + +727 +tok�s +-> +t�ic_�n + = 0; + +730 + `HASH_FIND +( +hh +, * +ro� +, +tok�s +-> +t�ic +,�ok�s-> +t�ic_�n +, +subh�r +); + +731 if(! +subh�r +){ + +732 +subh�r + = + `sub__add_h�r_��y +( +NULL +, +ro� +, +tok�s +-> +t�ic +,�ok�s-> +t�ic_�n +); + +733 if(! +subh�r +){ + +734 + `sub__t�ic_tok�s_� +( +tok�s +); + +735 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Error: Out of memory."); + +736 +MOSQ_ERR_NOMEM +; + +740 +rc + = + `sub__add_cڋxt +( +db +, +cڋxt +, +qos +, +id�tif�r +, +�ti�s +, +subh�r +, +tok�s +, +sh��ame +); + +742 + `sub__t�ic_tok�s_� +( +tok�s +); + +744 +rc +; + +745 + } +} + +747 + $sub__�move +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +sub +, +mosqu�to__subh�r + * +ro� +, +u�t8_t + * +�as� +) + +749 +rc + = 0; + +750 +mosqu�to__subh�r + * +subh�r +; + +751 +sub__tok� + * +tok�s + = +NULL +, * +t +; + +752 * +sh��ame + = +NULL +; + +754 + `as�� +( +ro� +); + +755 + `as�� +( +sub +); + +757 if( + `sub__t�ic_tok�i� +( +sub +, & +tok�s +)) 1; + +759 if(! + `�rcmp +( +tok�s +-> +t�ic +, "$share")){ + +760 if(! +tok�s +-> +�xt + || !tokens->next->next){ + +761 + `sub__t�ic_tok�s_� +( +tok�s +); + +762 +MOSQ_ERR_PROTOCOL +; + +764 +t + = +tok�s +-> +�xt +; + +765 + `mosqu�to__� +( +tok�s +-> +t�ic +); + +766 + `mosqu�to__� +( +tok�s +); + +767 +tok�s + = +t +; + +769 +sh��ame + = +tok�s +-> +t�ic +; + +771 +tok�s +-> +t�ic + = + `mosqu�to__�rdup +(""); + +772 if(! +tok�s +-> +t�ic +){ + +773 +tok�s +-> +t�ic + = +sh��ame +; + +774 + `sub__t�ic_tok�s_� +( +tok�s +); + +775 +MOSQ_ERR_PROTOCOL +; + +777 +tok�s +-> +t�ic_�n + = 0; + +780 + `HASH_FIND +( +hh +, +ro� +, +tok�s +-> +t�ic +,�ok�s-> +t�ic_�n +, +subh�r +); + +781 if( +subh�r +){ + +782 * +�as� + = +MQTT_RC_NO_SUBSCRIPTION_EXISTED +; + +783 +rc + = + `sub__�move_�cur� +( +db +, +cڋxt +, +subh�r +, +tok�s +, +�as� +, +sh��ame +); + +786 + `sub__t�ic_tok�s_� +( +tok�s +); + +788 +rc +; + +789 + } +} + +791 + $sub__mes�ges_queue +( +mosqu�to_db + * +db +, cڡ * +sour�_id +, cڡ * +t�ic +, +qos +, +��� +, +mosqu�to_msg_��e + ** +��ed +) + +793 +rc + = 0; + +794 +mosqu�to__subh�r + * +subh�r +; + +795 +sub__tok� + * +tok�s + = +NULL +; + +797 + `as�� +( +db +); + +798 + `as�� +( +t�ic +); + +800 if( + `sub__t�ic_tok�i� +( +t�ic +, & +tok�s +)) 1; + +806 + `db__msg_��e_�f_�c +(* +��ed +); + +808 + `HASH_FIND +( +hh +, +db +-> +subs +, +tok�s +-> +t�ic +,�ok�s-> +t�ic_�n +, +subh�r +); + +809 if( +subh�r +){ + +810 if( +��� +){ + +814 + `sub__add_cڋxt +( +db +, +NULL +, 0, 0, 0, +subh�r +, +tok�s +, NULL); + +816 +rc + = + `sub__��ch +( +db +, +subh�r +, +tok�s +, +sour�_id +, +t�ic +, +qos +, +��� +, * +��ed +, +�ue +); + +818 + `sub__t�ic_tok�s_� +( +tok�s +); + +821 + `db__msg_��e_�f_dec +( +db +, +��ed +); + +823 +rc +; + +824 + } +} + +828 +mosqu�to__subh�r + * + $tmp_�move_subs +( +mosqu�to__subh�r + * +sub +) + +830 +mosqu�to__subh�r + * +��� +; + +832 if(! +sub + || !sub-> +��� +){ + +833 +NULL +; + +836 if( +sub +-> +ch�d�n + || sub-> +subs + || sub-> +���ed +){ + +837 +NULL +; + +840 +��� + = +sub +->parent; + +841 + `HASH_DELETE +( +hh +, +��� +-> +ch�d�n +, +sub +); + +842 + `mosqu�to__� +( +sub +-> +t�ic +); + +843 + `mosqu�to__� +( +sub +); + +845 if( +��� +-> +subs + =� +NULL + + +846 && +��� +-> +ch�d�n + =� +NULL + + +847 && +��� +-> +���ed + =� +NULL + + +848 && +��� +-> +sh�ed + =� +NULL + + +849 && +��� +->parent){ + +851 +��� +; + +853 +NULL +; + +855 + } +} + +858 + $sub__��n_�ssi�_sh�ed +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +860 +i +; + +861 +mosqu�to__sub�af + * +�af +; + +862 +mosqu�to__subh�r + * +h�r +; + +864 +i +=0; i< +cڋxt +-> +sh�ed_sub_cou� +; i++){ + +865 if( +cڋxt +-> +sh�ed_subs +[ +i +] =� +NULL +){ + +868 +�af + = +cڋxt +-> +sh�ed_subs +[ +i +]-> +sh�ed +-> +subs +; + +869 +�af +){ + +870 if( +�af +-> +cڋxt +==context){ + +871 #ifde� +WITH_SYS_TREE + + +872 +db +-> +sh�ed_subs��ti�_cou� +--; + +874 + `sub__�move_sh�ed_�af +( +cڋxt +-> +sh�ed_subs +[ +i +]-> +h�r +, cڋxt->sh�ed_subs[i]-> +sh�ed +, +�af +); + +877 +�af + =��f-> +�xt +; + +879 if( +cڋxt +-> +sh�ed_subs +[ +i +]-> +h�r +-> +subs + =� +NULL + + +880 && +cڋxt +-> +sh�ed_subs +[ +i +]-> +h�r +-> +ch�d�n + =� +NULL + + +881 && +cڋxt +-> +sh�ed_subs +[ +i +]-> +h�r +-> +���ed + =� +NULL + + +882 && +cڋxt +-> +sh�ed_subs +[ +i +]-> +h�r +-> +sh�ed + =� +NULL + + +883 && +cڋxt +-> +sh�ed_subs +[ +i +]-> +h�r +-> +��� +){ + +885 +h�r + = +cڋxt +-> +sh�ed_subs +[ +i +]->hier; + +886 +cڋxt +-> +sh�ed_subs +[ +i +]-> +h�r + = +NULL +; + +888 +h�r + = + `tmp_�move_subs +(hier); + +889 } +h�r +); + +891 + `mosqu�to__� +( +cڋxt +-> +sh�ed_subs +[ +i +]); + +893 + `mosqu�to__� +( +cڋxt +-> +sh�ed_subs +); + +894 +cڋxt +-> +sh�ed_subs + = +NULL +; + +895 +cڋxt +-> +sh�ed_sub_cou� + = 0; + +897 +MOSQ_ERR_SUCCESS +; + +898 + } +} + +902 + $sub__��n_�ssi� +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +904 +i +; + +905 +mosqu�to__sub�af + * +�af +; + +906 +mosqu�to__subh�r + * +h�r +; + +908 +i +=0; i< +cڋxt +-> +sub_cou� +; i++){ + +909 if( +cڋxt +-> +subs +[ +i +] =� +NULL +){ + +912 +�af + = +cڋxt +-> +subs +[ +i +]->subs; + +913 +�af +){ + +914 if( +�af +-> +cڋxt +==context){ + +915 #ifde� +WITH_SYS_TREE + + +916 +db +-> +subs��ti�_cou� +--; + +918 + `DL_DELETE +( +cڋxt +-> +subs +[ +i +]->subs, +�af +); + +919 + `mosqu�to__� +( +�af +); + +922 +�af + =��f-> +�xt +; + +924 if( +cڋxt +-> +subs +[ +i +]->sub�=� +NULL + + +925 && +cڋxt +-> +subs +[ +i +]-> +ch�d�n + =� +NULL + + +926 && +cڋxt +-> +subs +[ +i +]-> +���ed + =� +NULL + + +927 && +cڋxt +-> +subs +[ +i +]-> +sh�ed + =� +NULL + + +928 && +cڋxt +-> +subs +[ +i +]-> +��� +){ + +930 +h�r + = +cڋxt +-> +subs +[ +i +]; + +931 +cڋxt +-> +subs +[ +i +] = +NULL +; + +933 +h�r + = + `tmp_�move_subs +(hier); + +934 } +h�r +); + +937 + `mosqu�to__� +( +cڋxt +-> +subs +); + +938 +cڋxt +-> +subs + = +NULL +; + +939 +cڋxt +-> +sub_cou� + = 0; + +941 + `sub__��n_�ssi�_sh�ed +( +db +, +cڋxt +); + +942 + } +} + +944 + $sub__��_��t +( +mosqu�to__subh�r + * +ro� +, +�v� +) + +946 +i +; + +947 +mosqu�to__subh�r + * +b�nch +, * +b�nch_tmp +; + +948 +mosqu�to__sub�af + * +�af +; + +950 + `HASH_ITER +( +hh +, +ro� +, +b�nch +, +b�nch_tmp +){ + +951 if( +�v� + > -1){ + +952 +i +=0; i<( +�v� ++2)*2; i++){ + +953 + `��tf +(" "); + +955 + `��tf +("%s", +b�nch +-> +t�ic +); + +956 +�af + = +b�nch +-> +subs +; + +957 +�af +){ + +958 if( +�af +-> +cڋxt +){ + +959 + `��tf +(" (%s, %d)", +�af +-> +cڋxt +-> +id +,��f-> +qos +); + +961 + `��tf +(" (%s, %d)", "", +�af +-> +qos +); + +963 +�af + =��f-> +�xt +; + +965 if( +b�nch +-> +���ed +){ + +966 + `��tf +(" (r)"); + +968 + `��tf +("\n"); + +971 + `sub__��_��t +( +b�nch +-> +ch�d�n +, +�v� ++1); + +973 + } +} + +975 + $���__�o�ss +( +mosqu�to_db + * +db +, +mosqu�to__subh�r + * +b�nch +, +mosqu�to + * +cڋxt +, +sub_qos +, +u�t32_t + +subs��ti�_id�tif�r +, +time_t + +now +) + +977 +rc + = 0; + +978 +qos +; + +979 +u�t16_t + +mid +; + +980 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +981 +mosqu�to_msg_��e + * +���ed +; + +983 if( +b�nch +-> +���ed +-> +mes�ge_exp�y_time + > 0 && +now + > branch->retained->message_expiry_time){ + +984 + `db__msg_��e_�f_dec +( +db +, & +b�nch +-> +���ed +); + +985 +b�nch +-> +���ed + = +NULL +; + +986 #ifde� +WITH_SYS_TREE + + +987 +db +-> +���ed_cou� +--; + +989 +MOSQ_ERR_SUCCESS +; + +992 +���ed + = +b�nch +->retained; + +994 +rc + = + `mosqu�to_a�_check +( +db +, +cڋxt +, +���ed +-> +t�ic +,��a�ed-> +�yl�d�n +, + `UHPA_ACCESS +ԑa�ed-> +�yl�d +,�etained->payloadlen), + +995 +���ed +-> +qos +,��a�ed-> +��� +, +MOSQ_ACL_READ +); + +996 if( +rc + =� +MOSQ_ERR_ACL_DENIED +){ + +997 +MOSQ_ERR_SUCCESS +; + +998 }if( +rc + !� +MOSQ_ERR_SUCCESS +){ + +999 +rc +; + +1003 if( +db +-> +c�fig +-> +check_���_sour� + && +���ed +-> +�ig� + !� +mosq_mo_brok� + &&��a�ed-> +sour�_id +){ + +1004 +mosqu�to + +���_�xt +; + +1005 + `mem�t +(& +���_�xt +, 0, ( +mosqu�to +)); + +1007 +���_�xt +. +id + = +���ed +-> +sour�_id +; + +1008 +���_�xt +. +u��ame + = +���ed +-> +sour�_u��ame +; + +1009 +���_�xt +. +li��� + = +���ed +-> +sour�_li��� +; + +1011 +rc + = + `a�__f�d_a�s +( +db +, & +���_�xt +); + +1012 if( +rc +) �c; + +1014 +rc + = + `mosqu�to_a�_check +( +db +, & +���_�xt +, +���ed +-> +t�ic +,��a�ed-> +�yl�d�n +, + `UHPA_ACCESS +ԑa�ed-> +�yl�d +,�etained->payloadlen), + +1015 +���ed +-> +qos +,��a�ed-> +��� +, +MOSQ_ACL_WRITE +); + +1016 if( +rc + =� +MOSQ_ERR_ACL_DENIED +){ + +1017 +MOSQ_ERR_SUCCESS +; + +1018 }if( +rc + !� +MOSQ_ERR_SUCCESS +){ + +1019 +rc +; + +1023 i�( +db +-> +c�fig +-> +upg�de_outgo�g_qos +){ + +1024 +qos + = +sub_qos +; + +1026 +qos + = +���ed +->qos; + +1027 if( +qos + > +sub_qos +) qos = sub_qos; + +1029 if( +qos + > 0){ + +1030 +mid + = + `mosqu�to__mid_g���e +( +cڋxt +); + +1032 +mid + = 0; + +1034 if( +subs��ti�_id�tif�r + > 0){ + +1035 + `mosqu�to_�ݔty_add_v��t +(& +�ݔt�s +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, +subs��ti�_id�tif�r +); + +1037 + `db__mes�ge_��� +( +db +, +cڋxt +, +mid +, +mosq_md_out +, +qos +, +�ue +, +���ed +, +�ݔt�s +); + +1038 + } +} + +1040 + $���__��ch +( +mosqu�to_db + * +db +, +mosqu�to__subh�r + * +subh�r +, +sub__tok� + * +tok�s +, +mosqu�to + * +cڋxt +, cڡ * +sub +, +sub_qos +, +u�t32_t + +subs��ti�_id�tif�r +, +time_t + +now +, +�v� +) + +1042 +mosqu�to__subh�r + * +b�nch +, * +b�nch_tmp +; + +1043 +�ag + = 0; + +1045 if(! + `�rcmp +( +tok�s +-> +t�ic +, "#"�&& !tok�s-> +�xt +){ + +1046 + `HASH_ITER +( +hh +, +subh�r +-> +ch�d�n +, +b�nch +, +b�nch_tmp +){ + +1051 +�ag + = -1; + +1052 if( +b�nch +-> +���ed +){ + +1053 + `���__�o�ss +( +db +, +b�nch +, +cڋxt +, +sub_qos +, +subs��ti�_id�tif�r +, +now +); + +1055 if( +b�nch +-> +ch�d�n +){ + +1056 + `���__��ch +( +db +, +b�nch +, +tok�s +, +cڋxt +, +sub +, +sub_qos +, +subs��ti�_id�tif�r +, +now +, +�v� ++1); + +1060 if(! + `�rcmp +( +tok�s +-> +t�ic +, "+")){ + +1061 + `HASH_ITER +( +hh +, +subh�r +-> +ch�d�n +, +b�nch +, +b�nch_tmp +){ + +1062 if( +tok�s +-> +�xt +){ + +1063 if( + `���__��ch +( +db +, +b�nch +, +tok�s +-> +�xt +, +cڋxt +, +sub +, +sub_qos +, +subs��ti�_id�tif�r +, +now +, +�v� ++1) == -1 + +1064 || ( +tok�s +-> +�xt + && ! + `�rcmp +�ok�s->�xt-> +t�ic +, "#"�&& +�v� +>0)){ + +1066 if( +b�nch +-> +���ed +){ + +1067 + `���__�o�ss +( +db +, +b�nch +, +cڋxt +, +sub_qos +, +subs��ti�_id�tif�r +, +now +); + +1071 if( +b�nch +-> +���ed +){ + +1072 + `���__�o�ss +( +db +, +b�nch +, +cڋxt +, +sub_qos +, +subs��ti�_id�tif�r +, +now +); + +1077 + `HASH_FIND +( +hh +, +subh�r +-> +ch�d�n +, +tok�s +-> +t�ic +,�ok�s-> +t�ic_�n +, +b�nch +); + +1078 if( +b�nch +){ + +1079 if( +tok�s +-> +�xt +){ + +1080 if( + `���__��ch +( +db +, +b�nch +, +tok�s +-> +�xt +, +cڋxt +, +sub +, +sub_qos +, +subs��ti�_id�tif�r +, +now +, +�v� ++1) == -1 + +1081 || ( +tok�s +-> +�xt + && ! + `�rcmp +�ok�s->�xt-> +t�ic +, "#"�&& +�v� +>0)){ + +1083 if( +b�nch +-> +���ed +){ + +1084 + `���__�o�ss +( +db +, +b�nch +, +cڋxt +, +sub_qos +, +subs��ti�_id�tif�r +, +now +); + +1088 if( +b�nch +-> +���ed +){ + +1089 + `���__�o�ss +( +db +, +b�nch +, +cڋxt +, +sub_qos +, +subs��ti�_id�tif�r +, +now +); + +1095 +�ag +; + +1096 + } +} + +1098 + $sub__���_queue +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +sub +, +sub_qos +, +u�t32_t + +subs��ti�_id�tif�r +) + +1100 +mosqu�to__subh�r + * +subh�r +; + +1101 +sub__tok� + * +tok�s + = +NULL +, * +�� +; + +1102 +time_t + +now +; + +1104 + `as�� +( +db +); + +1105 + `as�� +( +cڋxt +); + +1106 + `as�� +( +sub +); + +1108 if( + `sub__t�ic_tok�i� +( +sub +, & +tok�s +)) 1; + +1110 + `HASH_FIND +( +hh +, +db +-> +subs +, +tok�s +-> +t�ic +,�ok�s-> +t�ic_�n +, +subh�r +); + +1112 if( +subh�r +){ + +1113 +now + = + `time +( +NULL +); + +1114 + `���__��ch +( +db +, +subh�r +, +tok�s +, +cڋxt +, +sub +, +sub_qos +, +subs��ti�_id�tif�r +, +now +, 0); + +1116 +tok�s +){ + +1117 +�� + = +tok�s +-> +�xt +; + +1118 + `mosqu�to__� +( +tok�s +-> +t�ic +); + +1119 + `mosqu�to__� +( +tok�s +); + +1120 +tok�s + = +�� +; + +1123 +MOSQ_ERR_SUCCESS +; + +1124 + } +} + + @src/sys_tree.c + +17 #ifde� +WITH_SYS_TREE + + +19 + ~"c�fig.h +" + +21 + ~<m�h.h +> + +22 + ~<�dio.h +> + +24 + ~"mosqu�to_brok�_����.h +" + +25 + ~"mem�y_mosq.h +" + +26 + ~"time_mosq.h +" + +28 + #BUFLEN + 100 + + ) + +30 + #SYS_TREE_QOS + 2 + + ) + +32 +u�t64_t + + gg_by�s_��ived + = 0; + +33 +u�t64_t + + gg_by�s_�� + = 0; + +34 +u�t64_t + + gg_pub_by�s_��ived + = 0; + +35 +u�t64_t + + gg_pub_by�s_�� + = 0; + +36 + gg_msgs_��ived + = 0; + +37 + gg_msgs_�� + = 0; + +38 + gg_pub_msgs_��ived + = 0; + +39 + gg_pub_msgs_�� + = 0; + +40 + gg_msgs_drݳd + = 0; + +41 + gg_���s_exp�ed + = 0; + +42 + gg_sock�_c���i�s + = 0; + +43 + gg_c���i�_cou� + = 0; + +45 + $sys_��__�� +( +mosqu�to_db + * +db +) + +47 +buf +[64]; + +49 if( +db +-> +c�fig +-> +sys_��rv� + == 0){ + +54 + `���tf +( +buf +, 64, "mosqu�t�v�si� %s", +VERSION +); + +55 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/v�si�", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 0, NULL); + +56 + } +} + +58 + $sys_��__upd�e_���s +( +mosqu�to_db + * +db +, * +buf +) + +60 +���_cou� + = -1; + +61 +���s_exp�ed + = -1; + +62 +���_max + = 0; + +63 +disc���ed_cou� + = -1; + +64 +c���ed_cou� + = -1; + +66 +cou�_tٮ +, +cou�_by_sock +; + +68 +cou�_tٮ + = + `HASH_CNT +( +hh_id +, +db +-> +cڋxts_by_id +); + +69 +cou�_by_sock + = + `HASH_CNT +( +hh_sock +, +db +-> +cڋxts_by_sock +); + +71 if( +���_cou� + !� +cou�_tٮ +){ + +72 +���_cou� + = +cou�_tٮ +; + +73 + `���tf +( +buf +, +BUFLEN +, "%d", +���_cou� +); + +74 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/���s/tٮ", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +76 if( +���_cou� + > +���_max +){ + +77 +���_max + = +���_cou� +; + +78 + `���tf +( +buf +, +BUFLEN +, "%d", +���_max +); + +79 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/���s/maximum", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +83 if( +disc���ed_cou� + !� +cou�_tٮ +- +cou�_by_sock +){ + +84 +disc���ed_cou� + = +cou�_tٮ +- +cou�_by_sock +; + +85 if( +disc���ed_cou� + < 0){ + +90 +disc���ed_cou� + = 0; + +92 + `���tf +( +buf +, +BUFLEN +, "%d", +disc���ed_cou� +); + +93 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/���s/�a�ive", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +94 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/���s/disc���ed", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +96 if( +c���ed_cou� + !� +cou�_by_sock +){ + +97 +c���ed_cou� + = +cou�_by_sock +; + +98 + `���tf +( +buf +, +BUFLEN +, "%d", +c���ed_cou� +); + +99 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/���s/a�ive", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +100 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/���s/c���ed", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +102 if( +g_���s_exp�ed + !� +���s_exp�ed +){ + +103 +���s_exp�ed + = +g_���s_exp�ed +; + +104 + `���tf +( +buf +, +BUFLEN +, "%d", +���s_exp�ed +); + +105 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/���s/exp�ed", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +107 + } +} + +109 #ifde� +REAL_WITH_MEMORY_TRACKING + + +110 + $sys_��__upd�e_mem�y +( +mosqu�to_db + * +db +, * +buf +) + +112 +cu��t_h�p + = -1; + +113 +max_h�p + = -1; + +114 +v�ue_ul +; + +116 +v�ue_ul + = + `mosqu�to__mem�y_u�d +(); + +117 if( +cu��t_h�p + !� +v�ue_ul +){ + +118 +cu��t_h�p + = +v�ue_ul +; + +119 + `���tf +( +buf +, +BUFLEN +, "%lu", +cu��t_h�p +); + +120 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/h�p/cu��t", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +122 +v�ue_ul + = + `mosqu�to__max_mem�y_u�d +(); + +123 if( +max_h�p + !� +v�ue_ul +){ + +124 +max_h�p + = +v�ue_ul +; + +125 + `���tf +( +buf +, +BUFLEN +, "%lu", +max_h�p +); + +126 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/h�p/maximum", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +128 + } +} + +131 + $�lc_l�d +( +mosqu�to_db + * +db +, * +buf +, cڡ * +t�ic +, +bo� + +���l +, +expڒt +, +��rv� +, * +cu��t +) + +133 +�w_v�ue +; + +135 i�( +���l +) { + +136 +�w_v�ue + = * +cu��t +; + +137 + `���tf +( +buf +, +BUFLEN +, "%.2f", +�w_v�ue +); + +138 + `db__mes�ges_�sy_queue +( +db +, +NULL +, +t�ic +, +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +140 +�w_v�ue + = +��rv� + + +expڒt +*((* +cu��t +) - interval); + +141 if( + `�bs +( +�w_v�ue + - (* +cu��t +)) >= 0.01){ + +142 + `���tf +( +buf +, +BUFLEN +, "%.2f", +�w_v�ue +); + +143 + `db__mes�ges_�sy_queue +( +db +, +NULL +, +t�ic +, +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +146 (* +cu��t +�� +�w_v�ue +; + +147 + } +} + +155 + $sys_��__upd�e +( +mosqu�to_db + * +db +, +��rv� +, +time_t + +��t_time +) + +157 +time_t + +ϡ_upd�e + = 0; + +158 +time_t + +now +; + +159 +time_t + +u�ime +; + +160 +buf +[ +BUFLEN +]; + +162 +msg_��e_cou� + = -1; + +163 +msg_��e_by�s + = -1; + +164 +msgs_��ived + = -1; + +165 +msgs_�� + = -1; + +166 +publish_drݳd + = -1; + +167 +pub_msgs_��ived + = -1; + +168 +pub_msgs_�� + = -1; + +169 +by�s_��ived + = -1; + +170 +by�s_�� + = -1; + +171 +pub_by�s_��ived + = -1; + +172 +pub_by�s_�� + = -1; + +173 +subs��ti�_cou� + = -1; + +174 +sh�ed_subs��ti�_cou� + = -1; + +175 +���ed_cou� + = -1; + +177 +msgs_��ived_l�d1 + = 0; + +178 +msgs_��ived_l�d5 + = 0; + +179 +msgs_��ived_l�d15 + = 0; + +180 +msgs_��_l�d1 + = 0; + +181 +msgs_��_l�d5 + = 0; + +182 +msgs_��_l�d15 + = 0; + +183 +publish_drݳd_l�d1 + = 0; + +184 +publish_drݳd_l�d5 + = 0; + +185 +publish_drݳd_l�d15 + = 0; + +186 +msgs_��ived_��rv� +, +msgs_��_��rv� +, +publish_drݳd_��rv� +; + +188 +publish_��ived_l�d1 + = 0; + +189 +publish_��ived_l�d5 + = 0; + +190 +publish_��ived_l�d15 + = 0; + +191 +publish_��_l�d1 + = 0; + +192 +publish_��_l�d5 + = 0; + +193 +publish_��_l�d15 + = 0; + +194 +publish_��ived_��rv� +, +publish_��_��rv� +; + +196 +by�s_��ived_l�d1 + = 0; + +197 +by�s_��ived_l�d5 + = 0; + +198 +by�s_��ived_l�d15 + = 0; + +199 +by�s_��_l�d1 + = 0; + +200 +by�s_��_l�d5 + = 0; + +201 +by�s_��_l�d15 + = 0; + +202 +by�s_��ived_��rv� +, +by�s_��_��rv� +; + +204 +sock�_l�d1 + = 0; + +205 +sock�_l�d5 + = 0; + +206 +sock�_l�d15 + = 0; + +207 +sock�_��rv� +; + +209 +c���i�_l�d1 + = 0; + +210 +c���i�_l�d5 + = 0; + +211 +c���i�_l�d15 + = 0; + +212 +c���i�_��rv� +; + +214 +expڒt +; + +215 +i_mu� +; + +217 +now + = + `mosqu�to_time +(); + +219 if( +��rv� + && +now + - i��v� > +ϡ_upd�e +){ + +220 +u�ime + = +now + - +��t_time +; + +221 + `���tf +( +buf +, +BUFLEN +, "%d sec�ds", () +u�ime +); + +222 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/u�ime", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +224 + `sys_��__upd�e_���s +( +db +, +buf +); + +225 +bo� + +���l_publish + = +�l� +; + +226 if( +ϡ_upd�e + == 0){ + +227 +���l_publish + = +�ue +; + +228 +ϡ_upd�e + = 1; + +230 if( +ϡ_upd�e + > 0){ + +231 +i_mu� + = 60.0/()( +now +- +ϡ_upd�e +); + +233 +msgs_��ived_��rv� + = ( +g_msgs_��ived + - +msgs_��ived +)* +i_mu� +; + +234 +msgs_��_��rv� + = ( +g_msgs_�� + - +msgs_�� +)* +i_mu� +; + +235 +publish_drݳd_��rv� + = ( +g_msgs_drݳd + - +publish_drݳd +)* +i_mu� +; + +237 +publish_��ived_��rv� + = ( +g_pub_msgs_��ived + - +pub_msgs_��ived +)* +i_mu� +; + +238 +publish_��_��rv� + = ( +g_pub_msgs_�� + - +pub_msgs_�� +)* +i_mu� +; + +240 +by�s_��ived_��rv� + = ( +g_by�s_��ived + - +by�s_��ived +)* +i_mu� +; + +241 +by�s_��_��rv� + = ( +g_by�s_�� + - +by�s_�� +)* +i_mu� +; + +243 +sock�_��rv� + = +g_sock�_c���i�s +* +i_mu� +; + +244 +g_sock�_c���i�s + = 0; + +245 +c���i�_��rv� + = +g_c���i�_cou� +* +i_mu� +; + +246 +g_c���i�_cou� + = 0; + +249 +expڒt + = + `exp +(-1.0*( +now +- +ϡ_upd�e +)/60.0); + +251 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/mes�ges/��ived/1m�", +���l_publish +, +expڒt +, +msgs_��ived_��rv� +, & +msgs_��ived_l�d1 +); + +252 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/mes�ges/��/1m�", +���l_publish +, +expڒt +, +msgs_��_��rv� +, & +msgs_��_l�d1 +); + +253 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/publish/drݳd/1m�", +���l_publish +, +expڒt +, +publish_drݳd_��rv� +, & +publish_drݳd_l�d1 +); + +254 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/publish/��ived/1m�", +���l_publish +, +expڒt +, +publish_��ived_��rv� +, & +publish_��ived_l�d1 +); + +255 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/publish/��/1m�", +���l_publish +, +expڒt +, +publish_��_��rv� +, & +publish_��_l�d1 +); + +256 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/by�s/��ived/1m�", +���l_publish +, +expڒt +, +by�s_��ived_��rv� +, & +by�s_��ived_l�d1 +); + +257 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/by�s/��/1m�", +���l_publish +, +expڒt +, +by�s_��_��rv� +, & +by�s_��_l�d1 +); + +258 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/sock�s/1m�", +���l_publish +, +expڒt +, +sock�_��rv� +, & +sock�_l�d1 +); + +259 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/c���i�s/1m�", +���l_publish +, +expڒt +, +c���i�_��rv� +, & +c���i�_l�d1 +); + +262 +expڒt + = + `exp +(-1.0*( +now +- +ϡ_upd�e +)/300.0); + +264 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/mes�ges/��ived/5m�", +���l_publish +, +expڒt +, +msgs_��ived_��rv� +, & +msgs_��ived_l�d5 +); + +265 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/mes�ges/��/5m�", +���l_publish +, +expڒt +, +msgs_��_��rv� +, & +msgs_��_l�d5 +); + +266 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/publish/drݳd/5m�", +���l_publish +, +expڒt +, +publish_drݳd_��rv� +, & +publish_drݳd_l�d5 +); + +267 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/publish/��ived/5m�", +���l_publish +, +expڒt +, +publish_��ived_��rv� +, & +publish_��ived_l�d5 +); + +268 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/publish/��/5m�", +���l_publish +, +expڒt +, +publish_��_��rv� +, & +publish_��_l�d5 +); + +269 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/by�s/��ived/5m�", +���l_publish +, +expڒt +, +by�s_��ived_��rv� +, & +by�s_��ived_l�d5 +); + +270 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/by�s/��/5m�", +���l_publish +, +expڒt +, +by�s_��_��rv� +, & +by�s_��_l�d5 +); + +271 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/sock�s/5m�", +���l_publish +, +expڒt +, +sock�_��rv� +, & +sock�_l�d5 +); + +272 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/c���i�s/5m�", +���l_publish +, +expڒt +, +c���i�_��rv� +, & +c���i�_l�d5 +); + +275 +expڒt + = + `exp +(-1.0*( +now +- +ϡ_upd�e +)/900.0); + +277 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/mes�ges/��ived/15m�", +���l_publish +, +expڒt +, +msgs_��ived_��rv� +, & +msgs_��ived_l�d15 +); + +278 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/mes�ges/��/15m�", +���l_publish +, +expڒt +, +msgs_��_��rv� +, & +msgs_��_l�d15 +); + +279 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/publish/drݳd/15m�", +���l_publish +, +expڒt +, +publish_drݳd_��rv� +, & +publish_drݳd_l�d15 +); + +280 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/publish/��ived/15m�", +���l_publish +, +expڒt +, +publish_��ived_��rv� +, & +publish_��ived_l�d15 +); + +281 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/publish/��/15m�", +���l_publish +, +expڒt +, +publish_��_��rv� +, & +publish_��_l�d15 +); + +282 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/by�s/��ived/15m�", +���l_publish +, +expڒt +, +by�s_��ived_��rv� +, & +by�s_��ived_l�d15 +); + +283 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/by�s/��/15m�", +���l_publish +, +expڒt +, +by�s_��_��rv� +, & +by�s_��_l�d15 +); + +284 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/sock�s/15m�", +���l_publish +, +expڒt +, +sock�_��rv� +, & +sock�_l�d15 +); + +285 + `�lc_l�d +( +db +, +buf +, "$SYS/brok�/l�d/c���i�s/15m�", +���l_publish +, +expڒt +, +c���i�_��rv� +, & +c���i�_l�d15 +); + +288 if( +db +-> +msg_��e_cou� + != msg_store_count){ + +289 +msg_��e_cou� + = +db +->msg_store_count; + +290 + `���tf +( +buf +, +BUFLEN +, "%d", +msg_��e_cou� +); + +291 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/mes�ges/��ed", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +292 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/��e/mes�ges/cou�", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +295 i�( +db +-> +msg_��e_by�s + != msg_store_bytes){ + +296 +msg_��e_by�s + = +db +->msg_store_bytes; + +297 + `���tf +( +buf +, +BUFLEN +, "%lu", +msg_��e_by�s +); + +298 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/��e/mes�ges/by�s", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +301 if( +db +-> +subs��ti�_cou� + != subscription_count){ + +302 +subs��ti�_cou� + = +db +->subscription_count; + +303 + `���tf +( +buf +, +BUFLEN +, "%d", +subs��ti�_cou� +); + +304 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/subs��ti�s/cou�", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +307 if( +db +-> +sh�ed_subs��ti�_cou� + != shared_subscription_count){ + +308 +sh�ed_subs��ti�_cou� + = +db +->shared_subscription_count; + +309 + `���tf +( +buf +, +BUFLEN +, "%d", +sh�ed_subs��ti�_cou� +); + +310 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/sh�ed_subs��ti�s/cou�", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +313 if( +db +-> +���ed_cou� + !=�etained_count){ + +314 +���ed_cou� + = +db +->retained_count; + +315 + `���tf +( +buf +, +BUFLEN +, "%d", +���ed_cou� +); + +316 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/���ed mes�ges/cou�", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +319 #ifde� +REAL_WITH_MEMORY_TRACKING + + +320 + `sys_��__upd�e_mem�y +( +db +, +buf +); + +323 if( +msgs_��ived + !� +g_msgs_��ived +){ + +324 +msgs_��ived + = +g_msgs_��ived +; + +325 + `���tf +( +buf +, +BUFLEN +, "%lu", +msgs_��ived +); + +326 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/mes�ges/��ived", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +329 if( +msgs_�� + !� +g_msgs_�� +){ + +330 +msgs_�� + = +g_msgs_�� +; + +331 + `���tf +( +buf +, +BUFLEN +, "%lu", +msgs_�� +); + +332 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/mes�ges/��", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +335 if( +publish_drݳd + !� +g_msgs_drݳd +){ + +336 +publish_drݳd + = +g_msgs_drݳd +; + +337 + `���tf +( +buf +, +BUFLEN +, "%lu", +publish_drݳd +); + +338 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/publish/mes�ges/drݳd", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +341 if( +pub_msgs_��ived + !� +g_pub_msgs_��ived +){ + +342 +pub_msgs_��ived + = +g_pub_msgs_��ived +; + +343 + `���tf +( +buf +, +BUFLEN +, "%lu", +pub_msgs_��ived +); + +344 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/publish/mes�ges/��ived", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +347 if( +pub_msgs_�� + !� +g_pub_msgs_�� +){ + +348 +pub_msgs_�� + = +g_pub_msgs_�� +; + +349 + `���tf +( +buf +, +BUFLEN +, "%lu", +pub_msgs_�� +); + +350 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/publish/mes�ges/��", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +353 if( +by�s_��ived + !� +g_by�s_��ived +){ + +354 +by�s_��ived + = +g_by�s_��ived +; + +355 + `���tf +( +buf +, +BUFLEN +, "%�u", +by�s_��ived +); + +356 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/by�s/��ived", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +359 if( +by�s_�� + !� +g_by�s_�� +){ + +360 +by�s_�� + = +g_by�s_�� +; + +361 + `���tf +( +buf +, +BUFLEN +, "%�u", +by�s_�� +); + +362 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/by�s/��", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +365 if( +pub_by�s_��ived + !� +g_pub_by�s_��ived +){ + +366 +pub_by�s_��ived + = +g_pub_by�s_��ived +; + +367 + `���tf +( +buf +, +BUFLEN +, "%�u", +pub_by�s_��ived +); + +368 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/publish/by�s/��ived", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +371 if( +pub_by�s_�� + !� +g_pub_by�s_�� +){ + +372 +pub_by�s_�� + = +g_pub_by�s_�� +; + +373 + `���tf +( +buf +, +BUFLEN +, "%�u", +pub_by�s_�� +); + +374 + `db__mes�ges_�sy_queue +( +db +, +NULL +, "$SYS/brok�/publish/by�s/��", +SYS_TREE_QOS +, + `��� +( +buf +), buf, 1, 60, NULL); + +377 +ϡ_upd�e + = + `mosqu�to_time +(); + +379 + } +} + + @src/sys_tree.h + +17 #i�de� +SYS_TREE_H + + +18 + #SYS_TREE_H + + + ) + +20 #i� +def�ed +( +WITH_SYS_TREE +�&& def�ed( +WITH_BROKER +) + +21 +u�t64_t + +g_by�s_��ived +; + +22 +u�t64_t + +g_by�s_�� +; + +23 +u�t64_t + +g_pub_by�s_��ived +; + +24 +u�t64_t + +g_pub_by�s_�� +; + +25 +g_msgs_��ived +; + +26 +g_msgs_�� +; + +27 +g_pub_msgs_��ived +; + +28 +g_pub_msgs_�� +; + +29 +g_msgs_drݳd +; + +30 +g_���s_exp�ed +; + +31 +g_sock�_c���i�s +; + +32 +g_c���i�_cou� +; + +34 + #G_BYTES_RECEIVED_INC +( +A +�( +g_by�s_��ived ++=(A)) + + ) + +35 + #G_BYTES_SENT_INC +( +A +�( +g_by�s_�� ++=(A)) + + ) + +36 + #G_PUB_BYTES_RECEIVED_INC +( +A +�( +g_pub_by�s_��ived ++=(A)) + + ) + +37 + #G_PUB_BYTES_SENT_INC +( +A +�( +g_pub_by�s_�� ++=(A)) + + ) + +38 + #G_MSGS_RECEIVED_INC +( +A +�( +g_msgs_��ived ++=(A)) + + ) + +39 + #G_MSGS_SENT_INC +( +A +�( +g_msgs_�� ++=(A)) + + ) + +40 + #G_PUB_MSGS_RECEIVED_INC +( +A +�( +g_pub_msgs_��ived ++=(A)) + + ) + +41 + #G_PUB_MSGS_SENT_INC +( +A +�( +g_pub_msgs_�� ++=(A)) + + ) + +42 + #G_MSGS_DROPPED_INC +(�( +g_msgs_drݳd +++) + + ) + +43 + #G_CLIENTS_EXPIRED_INC +(�( +g_���s_exp�ed +++) + + ) + +44 + #G_SOCKET_CONNECTIONS_INC +(�( +g_sock�_c���i�s +++) + + ) + +45 + #G_CONNECTION_COUNT_INC +(�( +g_c���i�_cou� +++) + + ) + +49 + #G_BYTES_RECEIVED_INC +( +A +) + + ) + +50 + #G_BYTES_SENT_INC +( +A +) + + ) + +51 + #G_PUB_BYTES_RECEIVED_INC +( +A +) + + ) + +52 + #G_PUB_BYTES_SENT_INC +( +A +) + + ) + +53 + #G_MSGS_RECEIVED_INC +( +A +) + + ) + +54 + #G_MSGS_SENT_INC +( +A +) + + ) + +55 + #G_PUB_MSGS_RECEIVED_INC +( +A +) + + ) + +56 + #G_PUB_MSGS_SENT_INC +( +A +) + + ) + +57 + #G_MSGS_DROPPED_INC +( +A +) + + ) + +58 + #G_CLIENTS_EXPIRED_INC +( +A +) + + ) + +59 + #G_SOCKET_CONNECTIONS_INC +( +A +) + + ) + +60 + #G_CONNECTION_COUNT_INC +( +A +) + + ) + + @src/uhpa.h + +16 #i�de� +UHPA_H + + +17 + #UHPA_H + + + ) + +124 #i�de� +uh�_m�loc + + +125 + #uh�_m�loc +( +size +� + `m�loc +(size) + + ) + +128 #i�de� +uh�_� + + +129 + #uh�_� +( +�r +� + `� +Ռ) + + ) + +132 + #UHPA_ALLOC_CHK +( +u +, +size +) \ + +133 (( +size +�> (( +u +). +��y +)? \ + +134 ((( +u +). +�r + = + `uh�_m�loc +(( +size +)))?1:0) \ + +135 :-1) + + ) + +137 + #UHPA_ACCESS_CHK +( +u +, +size +�((size�> ((u). +��y +)?(u). +�r +:(u).��y) + + ) + +139 + #UHPA_FREE_CHK +( +u +, +size +) \ + +140 if(( +size +�> (( +u +). +��y +�&& (u). +�r +){ \ + +141 + `uh�_� +(( +u +). +�r +); \ + +142 ( +u +). +�r + = +NULL +; \ + +143 } + + ) + +145 + #UHPA_MOVE_CHK +( +de� +, +�c +, +�c_size +) \ + +146 if(( +�c_size +�> (( +�c +). +��y +�&& (�c). +�r +){ \ + +147 ( +de� +). +�r + = ( +�c +).ptr; \ + +148 ( +�c +). +�r + = +NULL +; \ + +150 + `memmove +(( +de� +). +��y +, ( +�c +).��y, ( +�c_size +)); \ + +151 + `mem�t +(( +�c +). +��y +, 0, ( +�c_size +)); \ + +152 } + + ) + +154 #ifde� +UHPA_FORCE_MALLOC + + +155 + #UHPA_ALLOC +( +u +, +size +�((u). +�r + = + `uh�_m�loc +(size)) + + ) + +156 + #UHPA_ACCESS +( +u +, +size +�(u). +�r + + + ) + +157 + #UHPA_FREE +( +u +, +size +� + `uh�_� +((u). +�r +); (u).��� +NULL +; + + ) + +158 + #UHPA_MOVE +( +de� +, +�c +, +�c_size +�{(de�). +�r + = (�c).�r; (�c).��� +NULL +;} + + ) + +160 + #UHPA_ALLOC +( +u +, +size +� + `UHPA_ALLOC_CHK +(u, size) + + ) + +161 + #UHPA_ACCESS +( +u +, +size +� + `UHPA_ACCESS_CHK +(u, size) + + ) + +162 + #UHPA_FREE +( +u +, +size +� + `UHPA_FREE_CHK +(u, size) + + ) + +163 + #UHPA_MOVE +( +de� +, +�c +, +�c_size +� + `UHPA_MOVE_CHK +(de�, src, src_size) + + ) + +166 + #UHPA_ALLOC_STR +( +u +, +size +� + `UHPA_ALLOC +((u), (size)+1) + + ) + +167 + #UHPA_ACCESS_STR +( +u +, +size +�((*) + `UHPA_ACCESS +((u), (size)+1)) + + ) + +168 + #UHPA_FREE_STR +( +u +, +size +� + `UHPA_FREE +((u), (size)+1) + + ) + +169 + #UHPA_MOVE_STR +( +de� +, +�c +, +�c_size +� + `UHPA_MOVE +((de�), (�c), (�c_size)+1) + + ) + + @src/websockets.c + +30 #ifde� +WITH_WEBSOCKETS + + +32 + ~"c�fig.h +" + +34 + ~<libwebsock�s.h +> + +35 + ~"mosqu�to_����.h +" + +36 + ~"mosqu�to_brok�_����.h +" + +37 + ~"mq�_��oc�.h +" + +38 + ~"mem�y_mosq.h +" + +39 + ~"�ck�_mosq.h +" + +40 + ~"sys_��.h +" + +42 + ~<�dlib.h +> + +43 + ~<��o.h +> + +44 + ~<sys/��.h +> + +46 #i�de� +WIN32 + + +47 + ~<sys/sock�.h +> + +50 +mosqu�to_db + +�t_db +; + +52 #i� +def�ed +( +LWS_LIBRARY_VERSION_NUMBER +) + +53 +��back_mq� +( + +55 +��back_mq� +( +libwebsock�_cڋxt + * +cڋxt +, + +57 +libwebsock� + * +wsi +, + +58 +libwebsock�_��back_�as�s + +�as� +, + +59 * +u�r +, + +60 * +� +, + +61 +size_t + +�n +); + +63 #i� +def�ed +( +LWS_LIBRARY_VERSION_NUMBER +) + +64 +��back_h�p +( + +66 +��back_h�p +( +libwebsock�_cڋxt + * +cڋxt +, + +68 +libwebsock� + * +wsi +, + +69 +libwebsock�_��back_�as�s + +�as� +, + +70 * +u�r +, + +71 * +� +, + +72 +size_t + +�n +); + +74 + emosq_ws_��oc�s + { + +75 +PROTOCOL_HTTP + = 0, + +76 +PROTOCOL_MQTT +, + +77 +DEMO_PROTOCOL_COUNT + + +80 + slibws_h�p_d�a + { + +81 +FILE + * +� +; + +84 +libwebsock�_��oc�s + +��oc�s +[] = { + +88 +��back_h�p +, + +89 ( +libws_h�p_d�a +), + +91 #i�de� +LWS_LIBRARY_VERSION_NUMBER + + +94 #ifde� +LWS_FEATURE_PROTOCOLS_HAS_ID_FIELD + + +97 #ifde� +LWS_LIBRARY_VERSION_NUMBER + + +98 +NULL +, + +99 #i� +LWS_LIBRARY_VERSION_NUMBER + >= 2003000 + +106 +��back_mq� +, + +107 ( +libws_mq�_d�a +), + +109 #i�de� +LWS_LIBRARY_VERSION_NUMBER + + +112 #ifde� +LWS_FEATURE_PROTOCOLS_HAS_ID_FIELD + + +115 #ifde� +LWS_LIBRARY_VERSION_NUMBER + + +116 +NULL +, + +117 #i� +LWS_LIBRARY_VERSION_NUMBER + >= 2003000 + +124 +��back_mq� +, + +125 ( +libws_mq�_d�a +), + +127 #i�de� +LWS_LIBRARY_VERSION_NUMBER + + +130 #ifde� +LWS_FEATURE_PROTOCOLS_HAS_ID_FIELD + + +133 #ifde� +LWS_LIBRARY_VERSION_NUMBER + + +134 +NULL +, + +135 #i� +LWS_LIBRARY_VERSION_NUMBER + >= 2003000 + +141 +NULL +, + +142 +NULL +, + +145 #i�de� +LWS_LIBRARY_VERSION_NUMBER + + +148 #ifde� +LWS_FEATURE_PROTOCOLS_HAS_ID_FIELD + + +151 #ifde� +LWS_LIBRARY_VERSION_NUMBER + + +152 +NULL +, + +153 #i� +LWS_LIBRARY_VERSION_NUMBER + >= 2003000 + +160 + $�sy_add�ss +( +sock +, +mosqu�to + * +mosq +) + +162 +add�ss +[1024]; + +164 if(! + `�t__sock�_g�_add�ss +( +sock +, +add�ss +, 1024)){ + +165 +mosq +-> +add�ss + = + `mosqu�to__�rdup +(address); + +167 + } +} + +169 #i� +def�ed +( +LWS_LIBRARY_VERSION_NUMBER +) + +170 +��back_mq� +( + +172 +��back_mq� +( +libwebsock�_cڋxt + * +cڋxt +, + +174 +libwebsock� + * +wsi +, + +175 +libwebsock�_��back_�as�s + +�as� +, + +176 * +u�r +, + +177 * +� +, + +178 +size_t + +�n +) + +180 +mosqu�to_db + * +db +; + +181 +mosqu�to + * +mosq + = +NULL +; + +182 +mosqu�to__�ck� + * +�ck� +; + +183 +cou� +, +i +, +j +; + +184 cڡ +libwebsock�_��oc�s + * +p +; + +185 +libws_mq�_d�a + * +u + = (libws_mq�_d��*) +u�r +; + +186 +size_t + +pos +; + +187 +u�t8_t + * +buf +; + +188 +rc +; + +189 +u�t8_t + +by� +; + +191 +db + = & +�t_db +; + +193 +�as� +) { + +194 +LWS_CALLBACK_ESTABLISHED +: + +195 +mosq + = +cڋxt__�� +( +db +, +WEBSOCKET_CLIENT +); + +196 if( +mosq +){ + +197 +p + = +libwebsock�s_g�_��oc� +( +wsi +); + +198 +i +=0; i< +db +-> +c�fig +-> +li���_cou� +; i++){ + +199 i�( +db +-> +c�fig +-> +li���s +[ +i +]. +��oc� + =� +mp_websock�s +) { + +200 +j +=0; +db +-> +c�fig +-> +li���s +[ +i +]. +ws_��oc� +[j]. +�me +; j++){ + +201 i�( +p + =�& +db +-> +c�fig +-> +li���s +[ +i +]. +ws_��oc� +[ +j +]){ + +202 +mosq +-> +li��� + = & +db +-> +c�fig +-> +li���s +[ +i +]; + +203 +mosq +-> +li��� +-> +���_cou� +++; + +208 if(! +mosq +-> +li��� +){ + +209 +mosqu�to__� +( +mosq +); + +212 #i�! +def�ed +( +LWS_LIBRARY_VERSION_NUMBER +) + +213 +mosq +-> +ws_cڋxt + = +cڋxt +; + +215 +mosq +-> +wsi + = wsi; + +216 #ifde� +WITH_TLS + + +217 if( +� +){ + +218 +mosq +-> +s� + = ( +SSL + *) +� +; + +219 if(! +mosq +-> +li��� +-> +s�_�x +){ + +220 +mosq +-> +li��� +-> +s�_�x + = +SSL_g�_SSL_CTX +(mosq-> +s� +); + +224 +u +-> +mosq + = mosq; + +228 +�sy_add�ss +( +libwebsock�_g�_sock�_fd +( +wsi +), +mosq +); + +229 if(! +mosq +-> +add�ss +){ + +231 +mosqu�to__� +( +mosq +); + +232 +u +-> +mosq + = +NULL +; + +235 if( +mosq +-> +li��� +-> +max_c���i�s + > 0 && mosq->li���-> +���_cou� + > mosq->listener->max_connections){ + +236 if( +db +-> +c�fig +-> +c���i�_mes�ges + =� +�ue +){ + +237 +log__��tf +( +NULL +, +MOSQ_LOG_NOTICE +, "Cl�� c���i� from %�d��d: max_c���iڠex�eded.", +mosq +-> +add�ss +); + +239 +mosqu�to__� +( +mosq +-> +add�ss +); + +240 +mosqu�to__� +( +mosq +); + +241 +u +-> +mosq + = +NULL +; + +244 +mosq +-> +sock + = +libwebsock�_g�_sock�_fd +( +wsi +); + +245 +HASH_ADD +( +hh_sock +, +db +-> +cڋxts_by_sock +, +sock +, ( +mosq +->sock), mosq); + +248 +LWS_CALLBACK_CLOSED +: + +249 if(! +u +){ + +252 +mosq + = +u +->mosq; + +253 if( +mosq +){ + +254 if( +mosq +-> +sock + !� +INVALID_SOCKET +){ + +255 +HASH_DELETE +( +hh_sock +, +db +-> +cڋxts_by_sock +, +mosq +); + +256 +mosq +-> +sock + = +INVALID_SOCKET +; + +257 +mosq +-> +p�lfd_�dex + = -1; + +259 +mosq +-> +wsi + = +NULL +; + +260 #ifde� +WITH_TLS + + +261 +mosq +-> +s� + = +NULL +; + +263 +do_disc��� +( +db +, +mosq +, +MOSQ_ERR_CONN_LOST +); + +267 +LWS_CALLBACK_SERVER_WRITEABLE +: + +268 if(! +u +){ + +271 +mosq + = +u +->mosq; + +272 if(! +mosq +){ + +276 +db__mes�ge_wr�e +( +db +, +mosq +); + +278 if( +mosq +-> +out_�ck� + && !mosq-> +cu��t_out_�ck� +){ + +279 +mosq +-> +cu��t_out_�ck� + = mosq-> +out_�ck� +; + +280 +mosq +-> +out_�ck� + = mosq->out_�ck�-> +�xt +; + +281 if(! +mosq +-> +out_�ck� +){ + +282 +mosq +-> +out_�ck�_ϡ + = +NULL +; + +286 if( +mosq +-> +cu��t_out_�ck� + && ! +lws_�nd_p�e_choked +(mosq-> +wsi +)){ + +287 +�ck� + = +mosq +-> +cu��t_out_�ck� +; + +289 if( +�ck� +-> +pos + =�0 &&�ack�-> +to_�o�ss + =�ck�-> +�ck�_�ngth +){ + +296 +memmove +(& +�ck� +-> +�yl�d +[ +LWS_SEND_BUFFER_PRE_PADDING +],�ack�->�yl�d,�ack�-> +�ck�_�ngth +); + +297 +�ck� +-> +pos + +� +LWS_SEND_BUFFER_PRE_PADDING +; + +299 +cou� + = +libwebsock�_wr�e +( +wsi +, & +�ck� +-> +�yl�d +[�ck�-> +pos +],�ack�-> +to_�o�ss +, +LWS_WRITE_BINARY +); + +300 if( +cou� + < 0){ + +301 i�( +mosq +-> +��e + =� +mosq_cs_disc���_ws + || mosq->���=� +mosq_cs_disc����g +){ + +306 #ifde� +WITH_SYS_TREE + + +307 +g_by�s_�� + +� +cou� +; + +309 +�ck� +-> +to_�o�ss + -� +cou� +; + +310 +�ck� +-> +pos + +� +cou� +; + +311 if( +�ck� +-> +to_�o�ss + > 0){ + +312 i�( +mosq +-> +��e + =� +mosq_cs_disc���_ws + || mosq->���=� +mosq_cs_disc����g +){ + +318 #ifde� +WITH_SYS_TREE + + +319 +g_msgs_�� +++; + +320 if((( +�ck� +-> +comm�d +)&0xF6�=� +CMD_PUBLISH +){ + +321 +g_pub_msgs_�� +++; + +326 +mosq +-> +cu��t_out_�ck� + = mosq-> +out_�ck� +; + +327 if( +mosq +-> +out_�ck� +){ + +328 +mosq +-> +out_�ck� + = mosq->out_�ck�-> +�xt +; + +329 if(! +mosq +-> +out_�ck� +){ + +330 +mosq +-> +out_�ck�_ϡ + = +NULL +; + +334 +�ck�__��nup +( +�ck� +); + +335 +mosqu�to__� +( +�ck� +); + +337 +mosq +-> +�xt_msg_out + = +mosqu�to_time +(�+ mosq-> +k��live +; + +339 i�( +mosq +-> +��e + =� +mosq_cs_disc���_ws + || mosq->���=� +mosq_cs_disc����g +){ + +342 if( +mosq +-> +cu��t_out_�ck� +){ + +343 +libwebsock�_��back_�_wr�ab� +( +mosq +-> +ws_cڋxt +, mosq-> +wsi +); + +347 +LWS_CALLBACK_RECEIVE +: + +348 if(! +u + || !u-> +mosq +){ + +351 +mosq + = +u +->mosq; + +352 +pos + = 0; + +353 +buf + = ( +u�t8_t + *) +� +; + +354 +G_BYTES_RECEIVED_INC +( +�n +); + +355 +pos + < +�n +){ + +356 if(! +mosq +-> +�_�ck� +. +comm�d +){ + +357 +mosq +-> +�_�ck� +. +comm�d + = +buf +[ +pos +]; + +358 +pos +++; + +360 if( +mosq +-> +��e + =� +mosq_cs_�w + && (mosq-> +�_�ck� +. +comm�d +&0xF0�!� +CMD_CONNECT +){ + +364 if( +mosq +-> +�_�ck� +. +�ma��g_cou� + <= 0){ + +366 if( +pos + =� +�n +){ + +369 +by� + = +buf +[ +pos +]; + +370 +pos +++; + +372 +mosq +-> +�_�ck� +. +�ma��g_cou� +--; + +376 if( +mosq +-> +�_�ck� +. +�ma��g_cou� + < -4){ + +380 +mosq +-> +�_�ck� +. +�ma��g_�ngth + +�( +by� + & 127�* mosq->�_�ck�. +�ma��g_mu� +; + +381 +mosq +-> +�_�ck� +. +�ma��g_mu� + *= 128; + +382 }( +by� + & 128) != 0); + +383 +mosq +-> +�_�ck� +. +�ma��g_cou� + *= -1; + +385 if( +mosq +-> +�_�ck� +. +�ma��g_�ngth + > 0){ + +386 +mosq +-> +�_�ck� +. +�yl�d + = +mosqu�to__m�loc +(mosq->�_�ck�. +�ma��g_�ngth +*( +u�t8_t +)); + +387 if(! +mosq +-> +�_�ck� +. +�yl�d +){ + +390 +mosq +-> +�_�ck� +. +to_�o�ss + = mosq->�_�ck�. +�ma��g_�ngth +; + +393 if( +mosq +-> +�_�ck� +. +to_�o�ss +>0){ + +394 if( +�n + - +pos + >� +mosq +-> +�_�ck� +. +to_�o�ss +){ + +395 +mem�y +(& +mosq +-> +�_�ck� +. +�yl�d +[mosq->�_�ck�. +pos +], & +buf +[pos], mosq->�_�ck�. +to_�o�ss +); + +396 +mosq +-> +�_�ck� +. +pos + +�mosq->�_�ck�. +to_�o�ss +; + +397 +pos + +� +mosq +-> +�_�ck� +. +to_�o�ss +; + +398 +mosq +-> +�_�ck� +. +to_�o�ss + = 0; + +400 +mem�y +(& +mosq +-> +�_�ck� +. +�yl�d +[mosq->�_�ck�. +pos +], & +buf +[pos], +�n +-pos); + +401 +mosq +-> +�_�ck� +. +pos + +� +�n +-pos; + +402 +mosq +-> +�_�ck� +. +to_�o�ss + -� +�n +- +pos +; + +407 +mosq +-> +�_�ck� +. +pos + = 0; + +409 #ifde� +WITH_SYS_TREE + + +410 +G_MSGS_RECEIVED_INC +(1); + +411 if((( +mosq +-> +�_�ck� +. +comm�d +)&0xF5�=� +CMD_PUBLISH +){ + +412 +G_PUB_MSGS_RECEIVED_INC +(1); + +415 +rc + = +h�d�__�ck� +( +db +, +mosq +); + +418 +�ck�__��nup +(& +mosq +-> +�_�ck� +); + +420 +mosq +-> +ϡ_msg_� + = +mosqu�to_time +(); + +422 if( +rc + && ( +mosq +-> +out_�ck� + || mosq-> +cu��t_out_�ck� +)) { + +423 if( +mosq +-> +��e + !� +mosq_cs_disc����g +){ + +424 +cڋxt__�t_��e +( +mosq +, +mosq_cs_disc���_ws +); + +426 +libwebsock�_��back_�_wr�ab� +( +mosq +-> +ws_cڋxt +, mosq-> +wsi +); + +427 } i�( +rc +) { + +428 +do_disc��� +( +db +, +mosq +, +MOSQ_ERR_CONN_LOST +); + +442 * +h�p__�n�i�l_f��ame +( + +443 #i�de� +LWS_LIBRARY_VERSION_NUMBER + + +444 +libwebsock�_cڋxt + * +cڋxt +, + +446 +libwebsock� + * +wsi +, + +447 cڡ * +� +, + +448 cڡ * +h�p_d� +) + +450 +size_t + +��n +, +�� +; + +451 * +f��ame +, * +f��ame_�n�i�l +; + +453 +��n + = +��� +( +� +); + +454 if( +� +[ +��n +-1] == '/'){ + +455 +�� + = +��� +( +h�p_d� +�+ +��n + + strlen("/index.html") + 2; + +457 +�� + = +��� +( +h�p_d� +�+ +��n + + 2; + +459 +f��ame + = +mosqu�to__m�loc +( +�� +); + +460 if(! +f��ame +){ + +461 +libwebsock�s_�tu�_h�p_��us +( +cڋxt +, +wsi +, +HTTP_STATUS_INTERNAL_SERVER_ERROR +, +NULL +); + +462 +NULL +; + +464 if(((*) +� +)[ +��n +-1] == '/'){ + +465 +���tf +( +f��ame +, +�� +, "%s%s�dex.html", +h�p_d� +, (*) +� +); + +467 +���tf +( +f��ame +, +�� +, "%s%s", +h�p_d� +, (*) +� +); + +472 #ifde� +WIN32 + + +473 +f��ame_�n�i�l + = +_fuηth +( +NULL +, +f��ame +, 0); + +474 +mosqu�to__� +( +f��ame +); + +475 if(! +f��ame_�n�i�l +){ + +476 +libwebsock�s_�tu�_h�p_��us +( +cڋxt +, +wsi +, +HTTP_STATUS_INTERNAL_SERVER_ERROR +, +NULL +); + +477 +NULL +; + +480 +f��ame_�n�i�l + = +���th +( +f��ame +, +NULL +); + +481 +mosqu�to__� +( +f��ame +); + +482 if(! +f��ame_�n�i�l +){ + +483 if( +��o + =� +EACCES +){ + +484 +libwebsock�s_�tu�_h�p_��us +( +cڋxt +, +wsi +, +HTTP_STATUS_FORBIDDEN +, +NULL +); + +485 }if( +��o + =� +EINVAL + ||��n�=� +EIO + ||��n�=� +ELOOP +){ + +486 +libwebsock�s_�tu�_h�p_��us +( +cڋxt +, +wsi +, +HTTP_STATUS_INTERNAL_SERVER_ERROR +, +NULL +); + +487 }if( +��o + =� +ENAMETOOLONG +){ + +488 +libwebsock�s_�tu�_h�p_��us +( +cڋxt +, +wsi +, +HTTP_STATUS_REQ_URI_TOO_LONG +, +NULL +); + +489 }if( +��o + =� +ENOENT + ||��n�=� +ENOTDIR +){ + +490 +libwebsock�s_�tu�_h�p_��us +( +cڋxt +, +wsi +, +HTTP_STATUS_NOT_FOUND +, +NULL +); + +492 +NULL +; + +495 if( +��cmp +( +h�p_d� +, +f��ame_�n�i�l +, +��� +(http_dir))){ + +497 +� +( +f��ame_�n�i�l +); + +498 +libwebsock�s_�tu�_h�p_��us +( +cڋxt +, +wsi +, +HTTP_STATUS_FORBIDDEN +, +NULL +); + +499 +NULL +; + +502 +f��ame_�n�i�l +; + +506 #i� +def�ed +( +LWS_LIBRARY_VERSION_NUMBER +) + +507 +��back_h�p +( + +509 +��back_h�p +( +libwebsock�_cڋxt + * +cڋxt +, + +511 +libwebsock� + * +wsi +, + +512 +libwebsock�_��back_�as�s + +�as� +, + +513 * +u�r +, + +514 * +� +, + +515 +size_t + +�n +) + +517 +libws_h�p_d�a + * +u + = (libws_h�p_d��*) +u�r +; + +518 +libws_mq�_hack + * +hack +; + +519 * +h�p_d� +; + +520 +size_t + +bu� +; + +521 +size_t + +w�n +; + +522 * +f��ame_�n�i�l +; + +523 +buf +[4096]; + +524 +�� + +f�e�� +; + +525 +mosqu�to_db + * +db + = & +�t_db +; + +526 +mosqu�to + * +mosq +; + +527 +lws_p��rgs + * +p��rgs + = (lws_p��rg�*) +� +; + +531 +�as� +) { + +532 +LWS_CALLBACK_HTTP +: + +533 if(! +u +){ + +537 #i� +def�ed +( +LWS_LIBRARY_VERSION_NUMBER +) + +538 +hack + = ( +libws_mq�_hack + *) +lws_cڋxt_u�r +( +lws_g�_cڋxt +( +wsi +)); + +540 +hack + = ( +libws_mq�_hack + *) +libwebsock�_cڋxt_u�r +( +cڋxt +); + +542 if(! +hack +){ + +545 +h�p_d� + = +hack +->http_dir; + +547 if(! +h�p_d� +){ + +553 if( +lws_hdr_tٮ_�ngth +( +wsi +, +WSI_TOKEN_POST_URI +)){ + +554 +libwebsock�s_�tu�_h�p_��us +( +cڋxt +, +wsi +, +HTTP_STATUS_METHOD_NOT_ALLOWED +, +NULL +); + +558 #i� +def�ed +( +LWS_LIBRARY_VERSION_NUMBER +) + +559 +f��ame_�n�i�l + = +h�p__�n�i�l_f��ame +( +wsi +, (*) +� +, +h�p_d� +); + +561 +f��ame_�n�i�l + = +h�p__�n�i�l_f��ame +( +cڋxt +, +wsi +, (*) +� +, +h�p_d� +); + +563 if(! +f��ame_�n�i�l +) -1; + +565 +u +-> +� + = +fݒ +( +f��ame_�n�i�l +, "rb"); + +566 if(! +u +-> +� +){ + +567 +� +( +f��ame_�n�i�l +); + +568 +libwebsock�s_�tu�_h�p_��us +( +cڋxt +, +wsi +, +HTTP_STATUS_NOT_FOUND +, +NULL +); + +571 if( +f�� +( +f��o +( +u +-> +� +), & +f�e�� +) < 0){ + +572 +� +( +f��ame_�n�i�l +); + +573 +libwebsock�s_�tu�_h�p_��us +( +cڋxt +, +wsi +, +HTTP_STATUS_INTERNAL_SERVER_ERROR +, +NULL +); + +574 +f�o� +( +u +-> +� +); + +575 +u +-> +� + = +NULL +; + +580 if(( +f�e�� +. +�_mode + & +S_IFDIR +) == S_IFDIR){ + +581 +f�o� +( +u +-> +� +); + +582 +u +-> +� + = +NULL +; + +583 +� +( +f��ame_�n�i�l +); + +586 +bu� + = +���tf +((*) +buf +, 4096, "HTTP/1.0 302 OK\r\n" + +588 (*) +� +); + +589 +libwebsock�_wr�e +( +wsi +, +buf +, +bu� +, +LWS_WRITE_HTTP +); + +592 if(( +f�e�� +. +�_mode + & +S_IFREG +) != S_IFREG){ + +593 +libwebsock�s_�tu�_h�p_��us +( +cڋxt +, +wsi +, +HTTP_STATUS_FORBIDDEN +, +NULL +); + +594 +f�o� +( +u +-> +� +); + +595 +u +-> +� + = +NULL +; + +596 +� +( +f��ame_�n�i�l +); + +600 +log__��tf +( +NULL +, +MOSQ_LOG_DEBUG +, "h���rv�g f��\"%s\".", +f��ame_�n�i�l +); + +601 +� +( +f��ame_�n�i�l +); + +603 +bu� + = +���tf +((*) +buf +, 4096, "HTTP/1.0 200 OK\r\n" + +606 () +f�e�� +. +�_size +); + +607 if( +libwebsock�_wr�e +( +wsi +, +buf +, +bu� +, +LWS_WRITE_HTTP +) < 0){ + +608 +f�o� +( +u +-> +� +); + +609 +u +-> +� + = +NULL +; + +612 +libwebsock�_��back_�_wr�ab� +( +cڋxt +, +wsi +); + +615 +LWS_CALLBACK_HTTP_BODY +: + +619 +LWS_CALLBACK_HTTP_BODY_COMPLETION +: + +623 +LWS_CALLBACK_FILTER_HTTP_CONNECTION +: + +627 +LWS_CALLBACK_HTTP_WRITEABLE +: + +629 if( +u + && u-> +� +){ + +631 +bu� + = +�d +( +buf +, 1, (buf), +u +-> +� +); + +632 if( +bu� + < 1){ + +633 +f�o� +( +u +-> +� +); + +634 +u +-> +� + = +NULL +; + +637 +w�n + = +libwebsock�_wr�e +( +wsi +, +buf +, +bu� +, +LWS_WRITE_HTTP +); + +638 if( +w�n + < +bu� +){ + +639 if( +f�ek +( +u +-> +� +, +bu� +- +w�n +, +SEEK_CUR +) < 0){ + +640 +f�o� +( +u +-> +� +); + +641 +u +-> +� + = +NULL +; + +645 if( +bu� + < ( +buf +)){ + +646 +f�o� +( +u +-> +� +); + +647 +u +-> +� + = +NULL +; + +650 } +u +-> +� + && ! +lws_�nd_p�e_choked +( +wsi +)); + +651 +libwebsock�_��back_�_wr�ab� +( +cڋxt +, +wsi +); + +657 +LWS_CALLBACK_CLOSED +: + +658 +LWS_CALLBACK_CLOSED_HTTP +: + +659 +LWS_CALLBACK_HTTP_FILE_COMPLETION +: + +660 if( +u + && u-> +� +){ + +661 +f�o� +( +u +-> +� +); + +662 +u +-> +� + = +NULL +; + +666 +LWS_CALLBACK_ADD_POLL_FD +: + +667 +LWS_CALLBACK_DEL_POLL_FD +: + +668 +LWS_CALLBACK_CHANGE_MODE_POLL_FD +: + +669 +HASH_FIND +( +hh_sock +, +db +-> +cڋxts_by_sock +, & +p��rgs +-> +fd +, ���rgs->fd), +mosq +); + +670 if( +mosq + && ( +p��rgs +-> +ev�ts + & +POLLOUT +)){ + +671 +mosq +-> +ws_w�t_wr�e + = +�ue +; + +675 #ifde� +WITH_TLS + + +676 +LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION +: + +677 if(! +�n + || ( +SSL_g�_v�ify_�su� +(( +SSL +*) +� +�!� +X509_V_OK +)){ + +690 + $log_w�p +( +�v� +, cڡ * +l�e +) + +692 * +l + = (*) +l�e +; + +693 +l +[ + `��� +( +l�e +)-1] = '\0'; + +694 + `log__��tf +( +NULL +, +MOSQ_LOG_WEBSOCKETS +, "%s", +l +); + +695 + } +} + +697 +libwebsock�_cڋxt + * + $mosq_websock�s_�� +( +mosqu�to__li��� + * +li��� +, cڡ +mosqu�to__c�fig + * +c�f +) + +699 +lws_cڋxt_��ti�_�fo + +�fo +; + +700 +libwebsock�_��oc�s + * +p +; + +701 +��oc�_cou� +; + +702 +i +; + +703 +libws_mq�_hack + * +u�r +; + +706 +��oc�_cou� +=0; +��oc�s +[��oc�_cou�]. +�me +;�rotocol_count++); + +708 +p + = + `mosqu�to__��oc +( +��oc�_cou� ++1, ( +libwebsock�_��oc�s +)); + +709 if(! +p +){ + +710 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Out of memory."); + +711 +NULL +; + +713 +i +=0; +��oc�s +[i]. +�me +; i++){ + +714 +p +[ +i +]. +�me + = +��oc�s +[i].name; + +715 +p +[ +i +]. +��back + = +��oc�s +[i].callback; + +716 +p +[ +i +]. +�r_�ssi�_d�a_size + = +��oc�s +[i].per_session_data_size; + +717 +p +[ +i +]. +rx_buf�r_size + = +��oc�s +[i].rx_buffer_size; + +720 + `mem�t +(& +�fo +, 0, (info)); + +721 +�fo +. +i�� + = +li��� +-> +ho� +; + +722 +�fo +. +p�t + = +li��� +->port; + +723 +�fo +. +��oc�s + = +p +; + +724 +�fo +. +gid + = -1; + +725 +�fo +. +uid + = -1; + +726 #ifde� +WITH_TLS + + +727 +�fo +. +s�_�_f���h + = +li��� +-> +�f�e +; + +728 +�fo +. +s�_��_f���h + = +li��� +-> +��f�e +; + +729 +�fo +. +s�_�iv�e_key_f���h + = +li��� +-> +keyf�e +; + +730 +�fo +. +s�_c�h�_li� + = +li��� +-> +c�h�s +; + +731 if( +li��� +-> +�qu�e_��ifi�� +){ + +732 +�fo +. +�ti�s + |� +LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT +; + +736 #i� +LWS_LIBRARY_VERSION_MAJOR +>1 + +737 +�fo +. +�ti�s + |� +LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT +; + +739 if( +li��� +-> +sock�_doma� + =� +AF_INET +){ + +740 +�fo +. +�ti�s + |� +LWS_SERVER_OPTION_DISABLE_IPV6 +; + +742 #i� + `def�ed +( +LWS_LIBRARY_VERSION_NUMBER +) && LWS_LIBRARY_VERSION_NUMBER>=1007000 + +743 +�fo +. +max_h�p_h�d�_d�a + = +c�f +-> +websock�s_h�d�s_size +; + +746 +u�r + = + `mosqu�to__��oc +(1, ( +libws_mq�_hack +)); + +747 if(! +u�r +){ + +748 + `mosqu�to__� +( +p +); + +749 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "Out of memory."); + +750 +NULL +; + +753 if( +li��� +-> +h�p_d� +){ + +754 #ifde� +WIN32 + + +755 +u�r +-> +h�p_d� + = + `_fuηth +( +NULL +, +li��� +->http_dir, 0); + +757 +u�r +-> +h�p_d� + = + `���th +( +li��� +->h�p_d�, +NULL +); + +759 if(! +u�r +-> +h�p_d� +){ + +760 + `mosqu�to__� +( +u�r +); + +761 + `mosqu�to__� +( +p +); + +762 + `log__��tf +( +NULL +, +MOSQ_LOG_ERR +, "E��: U�bˁ�ݒ h��d� \"%s\".", +li��� +-> +h�p_d� +); + +763 +NULL +; + +767 +�fo +. +u�r + = user; + +768 +li��� +-> +ws_��oc� + = +p +; + +770 + `lws_�t_log_�v� +( +c�f +-> +websock�s_log_�v� +, +log_w�p +); + +772 + `log__��tf +( +NULL +, +MOSQ_LOG_INFO +, "O�n�g websock��li�� sock� o�p܈%d.", +li��� +-> +p�t +); + +773 + `libwebsock�_���_cڋxt +(& +�fo +); + +774 + } +} + + @src/will_delay.c + +17 + ~"c�fig.h +" + +19 + ~<m�h.h +> + +20 + ~<�dio.h +> + +21 + ~<u�i�.h +> + +23 + ~"mosqu�to_brok�_����.h +" + +24 + ~"mem�y_mosq.h +" + +25 + ~"time_mosq.h +" + +27 +w�l_d�ay_li� + * + gd�ay_li� + = +NULL +; + +28 +time_t + + gϡ_check + = 0; + +31 + $w�l_d�ay__cmp +( +w�l_d�ay_li� + * +i1 +, w�l_d�ay_li� * +i2 +) + +33 +i1 +-> +cڋxt +-> +w�l_d�ay_��rv� + - +i2 +->context->will_delay_interval; + +34 + } +} + +37 + $w�l_d�ay__add +( +mosqu�to + * +cڋxt +) + +39 +w�l_d�ay_li� + * +�em +; + +41 +�em + = + `mosqu�to__��oc +(1, ( +w�l_d�ay_li� +)); + +42 if(! +�em +� +MOSQ_ERR_NOMEM +; + +44 +�em +-> +cڋxt + = context; + +45 +cڋxt +-> +w�l_d�ay_��y + = +�em +; + +46 +�em +-> +cڋxt +-> +w�l_d�ay_time + = + `time +( +NULL +�+ i�m->cڋxt-> +w�l_d�ay_��rv� +; + +48 + `DL_INSERT_INORDER +( +d�ay_li� +, +�em +, +w�l_d�ay__cmp +); + +50 +MOSQ_ERR_SUCCESS +; + +51 + } +} + +55 + $w�l_d�ay__�nd_�l +( +mosqu�to_db + * +db +) + +57 +w�l_d�ay_li� + * +�em +, * +tmp +; + +59 + `DL_FOREACH_SAFE +( +d�ay_li� +, +�em +, +tmp +){ + +60 + `DL_DELETE +( +d�ay_li� +, +�em +); + +61 +�em +-> +cڋxt +-> +w�l_d�ay_��rv� + = 0; + +62 +�em +-> +cڋxt +-> +w�l_d�ay_��y + = +NULL +; + +63 + `cڋxt__�nd_w�l +( +db +, +�em +-> +cڋxt +); + +64 + `mosqu�to__� +( +�em +); + +67 + } +} + +69 + $w�l_d�ay__check +( +mosqu�to_db + * +db +, +time_t + +now +) + +71 +w�l_d�ay_li� + * +�em +, * +tmp +; + +73 if( +now + <� +ϡ_check +) ; + +75 +ϡ_check + = +now +; + +77 + `DL_FOREACH_SAFE +( +d�ay_li� +, +�em +, +tmp +){ + +78 if( +�em +-> +cڋxt +-> +w�l_d�ay_time + < +now +){ + +79 + `DL_DELETE +( +d�ay_li� +, +�em +); + +80 +�em +-> +cڋxt +-> +w�l_d�ay_��rv� + = 0; + +81 +�em +-> +cڋxt +-> +w�l_d�ay_��y + = +NULL +; + +82 + `cڋxt__�nd_w�l +( +db +, +�em +-> +cڋxt +); + +83 if( +�em +-> +cڋxt +-> +�ssi�_exp�y_��rv� + == 0){ + +84 + `cڋxt__add_to_disu�d +( +db +, +�em +-> +cڋxt +); + +86 + `mosqu�to__� +( +�em +); + +92 + } +} + +95 + $w�l_d�ay__�move +( +mosqu�to + * +mosq +) + +97 if( +mosq +-> +w�l_d�ay_��y + !� +NULL +){ + +98 + `DL_DELETE +( +d�ay_li� +, +mosq +-> +w�l_d�ay_��y +); + +99 +mosq +-> +w�l_d�ay_��y + = +NULL +; + +101 + } +} + + @test/broker/c/08-tls-psk-bridge.c + +1 + ~<��o.h +> + +2 + ~<�dbo�.h +> + +3 + ~<�dio.h +> + +4 + ~<�dlib.h +> + +5 + ~<�r�g.h +> + +6 + ~<mosqu�to.h +> + +8 + grun + = -1; + +9 + g��_mid +; + +11 + $�_log +( +mosqu�to + * +mosq +, * +obj +, +�v� +, cڡ * +�r +) + +13 + `��tf +("%s\n", +�r +); + +14 + } +} + +16 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +18 if( +rc +){ + +19 + `ex� +(1); + +21 + `mosqu�to_publish +( +mosq +, & +��_mid +, "psk/��", + `��� +("mes�ge"), "mes�ge", 1, +�l� +); + +23 + } +} + +25 + $�_publish +( +mosqu�to + * +mosq +, * +obj +, +mid +) + +27 if( +mid + =� +��_mid +){ + +28 + `mosqu�to_disc��� +( +mosq +); + +29 +run + = 0; + +31 + `ex� +(1); + +33 + } +} + +35 + $�_disc��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +37 +run + = +rc +; + +38 + } +} + +40 + $ma� +( +�gc +, * +�gv +[]) + +42 +rc +; + +43 +mosqu�to + * +mosq +; + +44 +p�t +; + +46 +p�t + = + `�oi +( +�gv +[1]); + +48 + `mosqu�to_lib_�� +(); + +50 +mosq + = + `mosqu�to_�w +("08-�s-psk-bridge", +�ue +, +NULL +); + +51 + `mosqu�to_�s_�ts_�t +( +mosq +, 1, "�sv1", +NULL +); + +52 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +53 + `mosqu�to_disc���_��back_�t +( +mosq +, +�_disc��� +); + +54 + `mosqu�to_publish_��back_�t +( +mosq +, +�_publish +); + +55 + `mosqu�to_log_��back_�t +( +mosq +, +�_log +); + +57 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +58 if( +rc +) �c; + +60 +run + == -1){ + +61 + `mosqu�to_lo� +( +mosq +, -1, 1); + +64 + `mosqu�to_lib_��nup +(); + +65 +run +; + +66 + } +} + + @test/broker/c/08-tls-psk-pub.c + +1 + ~<��o.h +> + +2 + ~<�dbo�.h +> + +3 + ~<�dio.h +> + +4 + ~<�dlib.h +> + +5 + ~<�r�g.h +> + +6 + ~<mosqu�to.h +> + +8 + grun + = -1; + +9 + g��_mid +; + +11 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +13 if( +rc +){ + +14 + `ex� +(1); + +16 + `mosqu�to_publish +( +mosq +, & +��_mid +, "psk/��", + `��� +("mes�ge"), "mes�ge", 0, +�l� +); + +18 + } +} + +20 + $�_publish +( +mosqu�to + * +mosq +, * +obj +, +mid +) + +22 if( +mid + =� +��_mid +){ + +23 + `mosqu�to_disc��� +( +mosq +); + +24 +run + = 0; + +26 + `ex� +(1); + +28 + } +} + +30 + $�_disc��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +32 +run + = +rc +; + +33 + } +} + +35 + $ma� +( +�gc +, * +�gv +[]) + +37 +rc +; + +38 +p�t +; + +39 +mosqu�to + * +mosq +; + +41 + `mosqu�to_lib_�� +(); + +43 +p�t + = + `�oi +( +�gv +[1]); + +45 +mosq + = + `mosqu�to_�w +("08-�s-psk-pub", +�ue +, +NULL +); + +46 + `mosqu�to_�s_�ts_�t +( +mosq +, 1, "�sv1", +NULL +); + +47 +rc + = + `mosqu�to_�s_psk_�t +( +mosq +, "d�db�f", "psk-id", +NULL +); + +48 if( +rc +){ + +49 + `mosqu�to_de�roy +( +mosq +); + +50 +rc +; + +52 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +53 + `mosqu�to_disc���_��back_�t +( +mosq +, +�_disc��� +); + +54 + `mosqu�to_publish_��back_�t +( +mosq +, +�_publish +); + +56 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +57 if( +rc +){ + +58 + `mosqu�to_de�roy +( +mosq +); + +59 +rc +; + +62 +run + == -1){ + +63 + `mosqu�to_lo� +( +mosq +, -1, 1); + +66 + `mosqu�to_de�roy +( +mosq +); + +68 + `mosqu�to_lib_��nup +(); + +69 +run +; + +70 + } +} + + @test/broker/c/auth_plugin.c + +1 + ~<�dio.h +> + +2 + ~<�r�g.h +> + +3 + ~<mosqu�to.h +> + +4 + ~<mosqu�to_brok�.h +> + +5 + ~<mosqu�to_�ug�.h +> + +7 + $mosqu�to_auth_�ug�_v�si� +() + +9 +MOSQ_AUTH_PLUGIN_VERSION +; + +10 + } +} + +12 + $mosqu�to_auth_�ug�_�� +(** +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +14 +MOSQ_ERR_SUCCESS +; + +15 + } +} + +17 + $mosqu�to_auth_�ug�_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +19 +MOSQ_ERR_SUCCESS +; + +20 + } +} + +22 + $mosqu�to_auth_�cur�y_�� +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +24 +MOSQ_ERR_SUCCESS +; + +25 + } +} + +27 + $mosqu�to_auth_�cur�y_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +29 +MOSQ_ERR_SUCCESS +; + +30 + } +} + +32 + $mosqu�to_auth_a�_check +(* +u�r_d�a +, +ac�ss +, +mosqu�to + * +��� +, cڡ +mosqu�to_a�_msg + * +msg +) + +34 cڡ * +u��ame + = + `mosqu�to_���_u��ame +( +��� +); + +36 if( +u��ame + && ! + `�rcmp +(u��ame, "�ad�ly"�&& +ac�ss + =� +MOSQ_ACL_READ +){ + +37 +MOSQ_ERR_SUCCESS +; + +38 }if( +u��ame + && ! + `�rcmp +(u��ame, "�ad�ly"�&& +ac�ss + =� +MOSQ_ACL_SUBSCRIBE + &&! + `�rchr +( +msg +-> +t�ic +, '#') && !strchr(msg->topic, '+')) { + +39 +MOSQ_ERR_SUCCESS +; + +40 }if( +u��ame + && ! + `�rcmp +(username, "readwrite")){ + +41 if((! + `�rcmp +( +msg +-> +t�ic +, "�ad�ly"�&& +ac�ss + =� +MOSQ_ACL_READ +) + +42 || ! + `�rcmp +( +msg +-> +t�ic +, "writeable")){ + +44 +MOSQ_ERR_SUCCESS +; + +46 +MOSQ_ERR_ACL_DENIED +; + +50 +MOSQ_ERR_ACL_DENIED +; + +52 + } +} + +54 + $mosqu�to_auth_u�wd_check +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +u��ame +, cڡ * +�ssw�d +) + +56 if(! + `�rcmp +( +u��ame +, "��-u��ame"�&& +�ssw�d + && !strcmp(password, "cnwTICONIURW")){ + +57 +MOSQ_ERR_SUCCESS +; + +58 }if(! + `�rcmp +( +u��ame +, "readonly") || !strcmp(username, "readwrite")){ + +59 +MOSQ_ERR_SUCCESS +; + +60 }if(! + `�rcmp +( +u��ame +, "test-username@v2")){ + +61 +MOSQ_ERR_PLUGIN_DEFER +; + +63 +MOSQ_ERR_AUTH +; + +65 + } +} + +67 + $mosqu�to_auth_psk_key_g� +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +h�t +, cڡ * +id�t�y +, * +key +, +max_key_�n +) + +69 +MOSQ_ERR_AUTH +; + +70 + } +} + + @test/broker/c/auth_plugin_acl.c + +1 + ~<�dio.h +> + +2 + ~<�r�g.h +> + +3 + ~<mosqu�to.h +> + +4 + ~<mosqu�to_brok�.h +> + +5 + ~<mosqu�to_�ug�.h +> + +7 + $mosqu�to_auth_�ug�_v�si� +() + +9 +MOSQ_AUTH_PLUGIN_VERSION +; + +10 + } +} + +12 + $mosqu�to_auth_�ug�_�� +(** +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +14 +MOSQ_ERR_SUCCESS +; + +15 + } +} + +17 + $mosqu�to_auth_�ug�_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +19 +MOSQ_ERR_SUCCESS +; + +20 + } +} + +22 + $mosqu�to_auth_�cur�y_�� +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +24 +MOSQ_ERR_SUCCESS +; + +25 + } +} + +27 + $mosqu�to_auth_�cur�y_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +29 +MOSQ_ERR_SUCCESS +; + +30 + } +} + +32 + $mosqu�to_auth_a�_check +(* +u�r_d�a +, +ac�ss +, +mosqu�to + * +��� +, cڡ +mosqu�to_a�_msg + * +msg +) + +34 cڡ * +u��ame + = + `mosqu�to_���_u��ame +( +��� +); + +36 if( +u��ame + && ! + `�rcmp +(u��ame, "�ad�ly"�&& +ac�ss + =� +MOSQ_ACL_READ +){ + +37 +MOSQ_ERR_SUCCESS +; + +38 }if( +u��ame + && ! + `�rcmp +(u��ame, "�ad�ly"�&& +ac�ss + =� +MOSQ_ACL_SUBSCRIBE + &&! + `�rchr +( +msg +-> +t�ic +, '#') && !strchr(msg->topic, '+')) { + +39 +MOSQ_ERR_SUCCESS +; + +41 +MOSQ_ERR_ACL_DENIED +; + +43 + } +} + +45 + $mosqu�to_auth_u�wd_check +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +u��ame +, cڡ * +�ssw�d +) + +47 +MOSQ_ERR_PLUGIN_DEFER +; + +48 + } +} + +50 + $mosqu�to_auth_psk_key_g� +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +h�t +, cڡ * +id�t�y +, * +key +, +max_key_�n +) + +52 +MOSQ_ERR_AUTH +; + +53 + } +} + + @test/broker/c/auth_plugin_acl_sub_denied.c + +1 + ~<�dio.h +> + +2 + ~<�r�g.h +> + +3 + ~<mosqu�to.h +> + +4 + ~<mosqu�to_brok�.h +> + +5 + ~<mosqu�to_�ug�.h +> + +7 + $mosqu�to_auth_�ug�_v�si� +() + +9 +MOSQ_AUTH_PLUGIN_VERSION +; + +10 + } +} + +12 + $mosqu�to_auth_�ug�_�� +(** +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +14 +MOSQ_ERR_SUCCESS +; + +15 + } +} + +17 + $mosqu�to_auth_�ug�_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +19 +MOSQ_ERR_SUCCESS +; + +20 + } +} + +22 + $mosqu�to_auth_�cur�y_�� +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +24 +MOSQ_ERR_SUCCESS +; + +25 + } +} + +27 + $mosqu�to_auth_�cur�y_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +29 +MOSQ_ERR_SUCCESS +; + +30 + } +} + +32 + $mosqu�to_auth_a�_check +(* +u�r_d�a +, +ac�ss +, +mosqu�to + * +��� +, cڡ +mosqu�to_a�_msg + * +msg +) + +34 if( +ac�ss + =� +MOSQ_ACL_SUBSCRIBE +){ + +35 +MOSQ_ERR_ACL_DENIED +; + +37 +MOSQ_ERR_SUCCESS +; + +39 + } +} + +41 + $mosqu�to_auth_u�wd_check +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +u��ame +, cڡ * +�ssw�d +) + +43 +MOSQ_ERR_SUCCESS +; + +44 + } +} + +46 + $mosqu�to_auth_psk_key_g� +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +h�t +, cڡ * +id�t�y +, * +key +, +max_key_�n +) + +48 +MOSQ_ERR_AUTH +; + +49 + } +} + + @test/broker/c/auth_plugin_context_params.c + +1 + ~<�dlib.h +> + +2 + ~<�dio.h +> + +3 + ~<�r�g.h +> + +4 + ~<mosqu�to.h +> + +5 + ~<mosqu�to_brok�.h +> + +6 + ~<mosqu�to_�ug�.h +> + +8 + $mosqu�to_auth_�ug�_v�si� +() + +10 +MOSQ_AUTH_PLUGIN_VERSION +; + +11 + } +} + +13 + $mosqu�to_auth_�ug�_�� +(** +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +15 +MOSQ_ERR_SUCCESS +; + +16 + } +} + +18 + $mosqu�to_auth_�ug�_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +20 +MOSQ_ERR_SUCCESS +; + +21 + } +} + +23 + $mosqu�to_auth_�cur�y_�� +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +25 +MOSQ_ERR_SUCCESS +; + +26 + } +} + +28 + $mosqu�to_auth_�cur�y_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +30 +MOSQ_ERR_SUCCESS +; + +31 + } +} + +33 + $mosqu�to_auth_a�_check +(* +u�r_d�a +, +ac�ss +, +mosqu�to + * +��� +, cڡ +mosqu�to_a�_msg + * +msg +) + +35 +MOSQ_ERR_PLUGIN_DEFER +; + +36 + } +} + +38 + $mosqu�to_auth_u�wd_check +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +u��ame +, cڡ * +�ssw�d +) + +40 cڡ * +tmp +; + +42 +tmp + = + `mosqu�to_���_add�ss +( +��� +); + +43 if(! +tmp + || + `�rcmp +(tmp, "127.0.0.1")){ + +44 +MOSQ_ERR_AUTH +; + +47 if(! + `mosqu�to_���_��n_�ssi� +( +��� +)){ + +48 + `�r�tf +( +�d�r +, "mosqu�to_auth_u�wd_check c˪_�ssiڃ��: %d\n", + `mosqu�to_���_��n_�ssi� +( +��� +)); + +49 +MOSQ_ERR_AUTH +; + +52 +tmp + = + `mosqu�to_���_id +( +��� +); + +53 if(! +tmp + || + `�rcmp +(tmp, "client-params-test")){ + +54 + `�r�tf +( +�d�r +, "mosqu�to_auth_u�wd_check cl��_id���: %s\n", +tmp +); + +55 +MOSQ_ERR_AUTH +; + +58 if( + `mosqu�to_���_k��live +( +��� +) != 42){ + +59 + `�r�tf +( +�d�r +, "mosqu�to_auth_u�wd_check k��liv��r�: %d\n", + `mosqu�to_���_k��live +( +��� +)); + +60 +MOSQ_ERR_AUTH +; + +63 if(! + `mosqu�to_���_��ifi�� +( +��� +)){ + +68 if( + `mosqu�to_���_��oc� +( +��� +) != 2){ + +69 + `�r�tf +( +�d�r +, "mosqu�to_auth_u�wd_check�r�ocރ��: %d\n", + `mosqu�to_���_��oc� +( +��� +)); + +70 +MOSQ_ERR_AUTH +; + +73 if( + `mosqu�to_���_sub_cou� +( +��� +)){ + +74 + `�r�tf +( +�d�r +, "mosqu�to_auth_u�wd_check sub_cou����: %d\n", + `mosqu�to_���_sub_cou� +( +��� +)); + +75 +MOSQ_ERR_AUTH +; + +78 +tmp + = + `mosqu�to_���_u��ame +( +��� +); + +79 if(! +tmp + || + `�rcmp +(tmp, "client-username")){ + +80 + `�r�tf +( +�d�r +, "mosqu�to_auth_u�wd_check u��am��r�: %s\n", +tmp +); + +81 +MOSQ_ERR_AUTH +; + +84 +MOSQ_ERR_SUCCESS +; + +85 + } +} + +87 + $mosqu�to_auth_psk_key_g� +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +h�t +, cڡ * +id�t�y +, * +key +, +max_key_�n +) + +89 +MOSQ_ERR_AUTH +; + +90 + } +} + + @test/broker/c/auth_plugin_extended_multiple.c + +1 + ~<�dlib.h +> + +2 + ~<�dio.h +> + +3 + ~<�r�g.h +> + +4 + ~<mosqu�to.h +> + +5 + ~<mosqu�to_brok�.h +> + +6 + ~<mosqu�to_�ug�.h +> + +8 + $mosqu�to_auth_�ug�_v�si� +() + +10 +MOSQ_AUTH_PLUGIN_VERSION +; + +11 + } +} + +13 + $mosqu�to_auth_�ug�_�� +(** +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +15 +MOSQ_ERR_SUCCESS +; + +16 + } +} + +18 + $mosqu�to_auth_�ug�_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +20 +MOSQ_ERR_SUCCESS +; + +21 + } +} + +23 + $mosqu�to_auth_�cur�y_�� +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +25 +MOSQ_ERR_SUCCESS +; + +26 + } +} + +28 + $mosqu�to_auth_�cur�y_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +30 +MOSQ_ERR_SUCCESS +; + +31 + } +} + +33 + $mosqu�to_auth_a�_check +(* +u�r_d�a +, +ac�ss +, +mosqu�to + * +��� +, cڡ +mosqu�to_a�_msg + * +msg +) + +35 +MOSQ_ERR_PLUGIN_DEFER +; + +36 + } +} + +39 + $mosqu�to_auth_��t +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +m�hod +, +bo� + +�auth +, cڡ * +d�a +, +u�t16_t + +d�a_�n +, ** +d�a_out +, u�t16_�* +d�a_out_�n +) + +41 +i +; + +43 if(! + `�rcmp +( +m�hod +, "mirror")){ + +44 if( +d�a_�n + > 0){ + +45 * +d�a_out + = + `m�loc +( +d�a_�n +); + +46 if(!(* +d�a_out +)){ + +47 +MOSQ_ERR_NOMEM +; + +49 +i +=0; i< +d�a_�n +; i++){ + +50 (( +u�t8_t + *)(* +d�a_out +))[ +i +] = ((u�t8_�*) +d�a +)[ +d�a_�n +-i-1]; + +52 * +d�a_out_�n + = +d�a_�n +; + +54 +MOSQ_ERR_AUTH_CONTINUE +; + +56 +MOSQ_ERR_INVAL +; + +59 +MOSQ_ERR_NOT_SUPPORTED +; + +60 + } +} + +63 + $mosqu�to_auth_c�t�ue +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +m�hod +, cڡ * +d�a +, +u�t16_t + +d�a_�n +, ** +d�a_out +, u�t16_�* +d�a_out_�n +) + +65 +�n +; + +67 if(! + `�rcmp +( +m�hod +, "mirror")){ + +68 if( +d�a_�n + > 0){ + +69 +�n + = + `��� +("su�r�li�ag�i�i�xp�lidocious")> +d�a_�n +?data_len:strlen("supercalifragilisticexpialidocious"); + +70 if(! + `memcmp +( +d�a +, "su�r�li�ag�i�i�xp�lidocious", +�n +)){ + +71 +MOSQ_ERR_SUCCESS +; + +73 +MOSQ_ERR_AUTH +; + +76 +MOSQ_ERR_INVAL +; + +79 +MOSQ_ERR_NOT_SUPPORTED +; + +80 + } +} + + @test/broker/c/auth_plugin_extended_single.c + +1 + ~<�dlib.h +> + +2 + ~<�dio.h +> + +3 + ~<�r�g.h +> + +4 + ~<mosqu�to.h +> + +5 + ~<mosqu�to_brok�.h +> + +6 + ~<mosqu�to_�ug�.h +> + +8 + $mosqu�to_auth_�ug�_v�si� +() + +10 +MOSQ_AUTH_PLUGIN_VERSION +; + +11 + } +} + +13 + $mosqu�to_auth_�ug�_�� +(** +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +15 +MOSQ_ERR_SUCCESS +; + +16 + } +} + +18 + $mosqu�to_auth_�ug�_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +20 +MOSQ_ERR_SUCCESS +; + +21 + } +} + +23 + $mosqu�to_auth_�cur�y_�� +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +25 +MOSQ_ERR_SUCCESS +; + +26 + } +} + +28 + $mosqu�to_auth_�cur�y_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +30 +MOSQ_ERR_SUCCESS +; + +31 + } +} + +33 + $mosqu�to_auth_a�_check +(* +u�r_d�a +, +ac�ss +, +mosqu�to + * +��� +, cڡ +mosqu�to_a�_msg + * +msg +) + +35 +MOSQ_ERR_PLUGIN_DEFER +; + +36 + } +} + +39 + $mosqu�to_auth_��t +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +m�hod +, +bo� + +�auth +, cڡ * +d�a +, +u�t16_t + +d�a_�n +, ** +d�a_out +, u�t16_�* +d�a_out_�n +) + +41 +i +; + +43 if(! + `�rcmp +( +m�hod +, "error")){ + +44 +MOSQ_ERR_INVAL +; + +45 }if(! + `�rcmp +( +m�hod +, "non-matching")){ + +46 +MOSQ_ERR_NOT_SUPPORTED +; + +47 }if(! + `�rcmp +( +m�hod +, "single")){ + +48 +d�a_�n + = d�a_�n> + `��� +("data")?strlen("data"):data_len; + +49 if(! + `memcmp +( +d�a +, "d�a", +d�a_�n +)){ + +50 +MOSQ_ERR_SUCCESS +; + +52 +MOSQ_ERR_AUTH +; + +54 }if(! + `�rcmp +( +m�hod +, "change")){ + +55 + `mosqu�to_�t_u��ame +( +��� +, "new_username"); + +56 }if(! + `�rcmp +( +m�hod +, "mirror")){ + +57 if( +d�a_�n + > 0){ + +58 * +d�a_out + = + `m�loc +( +d�a_�n +); + +59 if(!(* +d�a_out +)){ + +60 +MOSQ_ERR_NOMEM +; + +62 +i +=0; i< +d�a_�n +; i++){ + +63 (( +u�t8_t + *)(* +d�a_out +))[ +i +] = ((u�t8_�*) +d�a +)[ +d�a_�n +-i-1]; + +65 * +d�a_out_�n + = +d�a_�n +; + +67 +MOSQ_ERR_SUCCESS +; + +69 +MOSQ_ERR_INVAL +; + +72 +MOSQ_ERR_NOT_SUPPORTED +; + +73 + } +} + +75 + $mosqu�to_auth_c�t�ue +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +m�hod +, cڡ * +d�a +, +u�t16_t + +d�a_�n +, ** +d�a_out +, u�t16_�* +d�a_out_�n +) + +77 +MOSQ_ERR_AUTH +; + +78 + } +} + + @test/broker/c/auth_plugin_extended_single2.c + +1 + ~<�dlib.h +> + +2 + ~<�dio.h +> + +3 + ~<�r�g.h +> + +4 + ~<mosqu�to.h +> + +5 + ~<mosqu�to_brok�.h +> + +6 + ~<mosqu�to_�ug�.h +> + +8 + $mosqu�to_auth_�ug�_v�si� +() + +10 +MOSQ_AUTH_PLUGIN_VERSION +; + +11 + } +} + +13 + $mosqu�to_auth_�ug�_�� +(** +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +15 +MOSQ_ERR_SUCCESS +; + +16 + } +} + +18 + $mosqu�to_auth_�ug�_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +20 +MOSQ_ERR_SUCCESS +; + +21 + } +} + +23 + $mosqu�to_auth_�cur�y_�� +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +25 +MOSQ_ERR_SUCCESS +; + +26 + } +} + +28 + $mosqu�to_auth_�cur�y_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +30 +MOSQ_ERR_SUCCESS +; + +31 + } +} + +33 + $mosqu�to_auth_a�_check +(* +u�r_d�a +, +ac�ss +, +mosqu�to + * +��� +, cڡ +mosqu�to_a�_msg + * +msg +) + +35 +MOSQ_ERR_PLUGIN_DEFER +; + +36 + } +} + +39 + $mosqu�to_auth_��t +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +m�hod +, +bo� + +�auth +, cڡ * +d�a +, +u�t16_t + +d�a_�n +, ** +d�a_out +, u�t16_�* +d�a_out_�n +) + +41 +i +; + +43 if(! + `�rcmp +( +m�hod +, "error2")){ + +44 +MOSQ_ERR_INVAL +; + +45 }if(! + `�rcmp +( +m�hod +, "non-matching2")){ + +46 +MOSQ_ERR_NOT_SUPPORTED +; + +47 }if(! + `�rcmp +( +m�hod +, "single2")){ + +48 +d�a_�n + = d�a_�n> + `��� +("data")?strlen("data"):data_len; + +49 if(! + `memcmp +( +d�a +, "d�a", +d�a_�n +)){ + +50 +MOSQ_ERR_SUCCESS +; + +52 +MOSQ_ERR_AUTH +; + +54 }if(! + `�rcmp +( +m�hod +, "change2")){ + +55 + `mosqu�to_�t_u��ame +( +��� +, "new_username"); + +56 }if(! + `�rcmp +( +m�hod +, "mirror2")){ + +57 if( +d�a_�n + > 0){ + +58 * +d�a_out + = + `m�loc +( +d�a_�n +); + +59 if(!(* +d�a_out +)){ + +60 +MOSQ_ERR_NOMEM +; + +62 +i +=0; i< +d�a_�n +; i++){ + +63 (( +u�t8_t + *)(* +d�a_out +))[ +i +] = ((u�t8_�*) +d�a +)[ +d�a_�n +-i-1]; + +65 * +d�a_out_�n + = +d�a_�n +; + +67 +MOSQ_ERR_SUCCESS +; + +69 +MOSQ_ERR_INVAL +; + +72 +MOSQ_ERR_NOT_SUPPORTED +; + +73 + } +} + +75 + $mosqu�to_auth_c�t�ue +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +m�hod +, cڡ * +d�a +, +u�t16_t + +d�a_�n +, ** +d�a_out +, u�t16_�* +d�a_out_�n +) + +77 +MOSQ_ERR_AUTH +; + +78 + } +} + + @test/broker/c/auth_plugin_msg_params.c + +1 + ~<�dlib.h +> + +2 + ~<�dio.h +> + +3 + ~<�r�g.h +> + +4 + ~<mosqu�to.h +> + +5 + ~<mosqu�to_brok�.h +> + +6 + ~<mosqu�to_�ug�.h +> + +8 + $mosqu�to_auth_�ug�_v�si� +() + +10 +MOSQ_AUTH_PLUGIN_VERSION +; + +11 + } +} + +13 + $mosqu�to_auth_�ug�_�� +(** +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +15 +MOSQ_ERR_SUCCESS +; + +16 + } +} + +18 + $mosqu�to_auth_�ug�_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +20 +MOSQ_ERR_SUCCESS +; + +21 + } +} + +23 + $mosqu�to_auth_�cur�y_�� +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +25 +MOSQ_ERR_SUCCESS +; + +26 + } +} + +28 + $mosqu�to_auth_�cur�y_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +30 +MOSQ_ERR_SUCCESS +; + +31 + } +} + +33 + $mosqu�to_auth_a�_check +(* +u�r_d�a +, +ac�ss +, +mosqu�to + * +��� +, cڡ +mosqu�to_a�_msg + * +msg +) + +35 if( +ac�ss + =� +MOSQ_ACL_SUBSCRIBE +){ + +36 +MOSQ_ERR_SUCCESS +; + +39 if(! +msg +-> +t�ic + || + `�rcmp +(msg->topic, "param/topic")){ + +40 + `ab�t +(); + +41 +MOSQ_ERR_ACL_DENIED +; + +44 if(! +msg +-> +�yl�d + || + `��cmp +(msg->�yl�d, "�yl�d cڋ�s", + `��� +("payload contents"))){ + +45 + `ab�t +(); + +46 +MOSQ_ERR_ACL_DENIED +; + +49 if( +msg +-> +�yl�d�n + !� + `��� +("payload contents")){ + +50 + `ab�t +(); + +51 +MOSQ_ERR_ACL_DENIED +; + +54 if( +msg +-> +qos + != 1){ + +55 + `ab�t +(); + +56 +MOSQ_ERR_ACL_DENIED +; + +59 if(! +msg +-> +��� +){ + +60 + `ab�t +(); + +61 +MOSQ_ERR_ACL_DENIED +; + +64 +MOSQ_ERR_SUCCESS +; + +65 + } +} + +67 + $mosqu�to_auth_u�wd_check +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +u��ame +, cڡ * +�ssw�d +) + +69 +MOSQ_ERR_PLUGIN_DEFER +; + +70 + } +} + +72 + $mosqu�to_auth_psk_key_g� +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +h�t +, cڡ * +id�t�y +, * +key +, +max_key_�n +) + +74 +MOSQ_ERR_AUTH +; + +75 + } +} + + @test/broker/c/auth_plugin_pwd.c + +1 + ~<�dio.h +> + +2 + ~<�r�g.h +> + +3 + ~<mosqu�to.h +> + +4 + ~<mosqu�to_brok�.h +> + +5 + ~<mosqu�to_�ug�.h +> + +7 + $mosqu�to_auth_�ug�_v�si� +() + +9 +MOSQ_AUTH_PLUGIN_VERSION +; + +10 + } +} + +12 + $mosqu�to_auth_�ug�_�� +(** +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +14 +MOSQ_ERR_SUCCESS +; + +15 + } +} + +17 + $mosqu�to_auth_�ug�_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +19 +MOSQ_ERR_SUCCESS +; + +20 + } +} + +22 + $mosqu�to_auth_�cur�y_�� +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +24 +MOSQ_ERR_SUCCESS +; + +25 + } +} + +27 + $mosqu�to_auth_�cur�y_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +29 +MOSQ_ERR_SUCCESS +; + +30 + } +} + +32 + $mosqu�to_auth_a�_check +(* +u�r_d�a +, +ac�ss +, +mosqu�to + * +��� +, cڡ +mosqu�to_a�_msg + * +msg +) + +34 +MOSQ_ERR_PLUGIN_DEFER +; + +35 + } +} + +37 + $mosqu�to_auth_u�wd_check +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +u��ame +, cڡ * +�ssw�d +) + +39 if(! + `�rcmp +( +u��ame +, "��-u��ame"�&& +�ssw�d + && !strcmp(password, "cnwTICONIURW")){ + +40 +MOSQ_ERR_SUCCESS +; + +41 }if(! + `�rcmp +( +u��ame +, "readonly")){ + +42 +MOSQ_ERR_SUCCESS +; + +43 }if(! + `�rcmp +( +u��ame +, "test-username@v2")){ + +44 +MOSQ_ERR_PLUGIN_DEFER +; + +46 +MOSQ_ERR_AUTH +; + +48 + } +} + +50 + $mosqu�to_auth_psk_key_g� +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +h�t +, cڡ * +id�t�y +, * +key +, +max_key_�n +) + +52 +MOSQ_ERR_AUTH +; + +53 + } +} + + @test/broker/c/auth_plugin_v2.c + +1 + ~<�r�g.h +> + +2 + ~<�dbo�.h +> + +3 + ~"mosqu�to_�ug�_v2.h +" + +10 + emosq_�r_t + { + +11 + mMOSQ_ERR_SUCCESS + = 0, + +12 + mMOSQ_ERR_AUTH + = 11, + +13 + mMOSQ_ERR_ACL_DENIED + = 12 + +16 + $mosqu�to_auth_�ug�_v�si� +() + +18 +MOSQ_AUTH_PLUGIN_VERSION +; + +19 + } +} + +21 + $mosqu�to_auth_�ug�_�� +(** +u�r_d�a +, +mosqu�to_auth_�t + * +auth_�ts +, +auth_�t_cou� +) + +23 +MOSQ_ERR_SUCCESS +; + +24 + } +} + +26 + $mosqu�to_auth_�ug�_��nup +(* +u�r_d�a +, +mosqu�to_auth_�t + * +auth_�ts +, +auth_�t_cou� +) + +28 +MOSQ_ERR_SUCCESS +; + +29 + } +} + +31 + $mosqu�to_auth_�cur�y_�� +(* +u�r_d�a +, +mosqu�to_auth_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +33 +MOSQ_ERR_SUCCESS +; + +34 + } +} + +36 + $mosqu�to_auth_�cur�y_��nup +(* +u�r_d�a +, +mosqu�to_auth_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +38 +MOSQ_ERR_SUCCESS +; + +39 + } +} + +41 + $mosqu�to_auth_a�_check +(* +u�r_d�a +, cڡ * +���id +, cڡ * +u��ame +, cڡ * +t�ic +, +ac�ss +) + +43 if(! + `�rcmp +( +u��ame +, "�ad�ly"�&& +ac�ss + =� +MOSQ_ACL_READ +){ + +44 +MOSQ_ERR_SUCCESS +; + +46 +MOSQ_ERR_ACL_DENIED +; + +48 + } +} + +50 + $mosqu�to_auth_u�wd_check +(* +u�r_d�a +, cڡ * +u��ame +, cڡ * +�ssw�d +) + +52 if(! + `�rcmp +( +u��ame +, "��-u��ame"�&& +�ssw�d + && !strcmp(password, "cnwTICONIURW")){ + +53 +MOSQ_ERR_SUCCESS +; + +54 }if(! + `�rcmp +( +u��ame +, "readonly")){ + +55 +MOSQ_ERR_SUCCESS +; + +56 }if(! + `�rcmp +( +u��ame +, "test-username@v2")){ + +57 +MOSQ_ERR_SUCCESS +; + +59 +MOSQ_ERR_AUTH +; + +61 + } +} + +63 + $mosqu�to_auth_psk_key_g� +(* +u�r_d�a +, cڡ * +h�t +, cڡ * +id�t�y +, * +key +, +max_key_�n +) + +65 +MOSQ_ERR_AUTH +; + +66 + } +} + + @test/broker/c/mosquitto_plugin_v2.h + +17 #i�de� +MOSQUITTO_PLUGIN_H + + +18 + #MOSQUITTO_PLUGIN_H + + + ) + +20 + #MOSQ_AUTH_PLUGIN_VERSION + 2 + + ) + +22 + #MOSQ_ACL_NONE + 0x00 + + ) + +23 + #MOSQ_ACL_READ + 0x01 + + ) + +24 + #MOSQ_ACL_WRITE + 0x02 + + ) + +26 + smosqu�to_auth_�t + { + +27 * + mkey +; + +28 * + mv�ue +; + +74 +mosqu�to_log_��tf +( +�v� +, cڡ * +fmt +, ...); + +93 +mosqu�to_auth_�ug�_v�si� +(); + +114 +mosqu�to_auth_�ug�_�� +(** +u�r_d�a +, +mosqu�to_auth_�t + * +auth_�ts +, +auth_�t_cou� +); + +134 +mosqu�to_auth_�ug�_��nup +(* +u�r_d�a +, +mosqu�to_auth_�t + * +auth_�ts +, +auth_�t_cou� +); + +158 +mosqu�to_auth_�cur�y_�� +(* +u�r_d�a +, +mosqu�to_auth_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +); + +182 +mosqu�to_auth_�cur�y_��nup +(* +u�r_d�a +, +mosqu�to_auth_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +); + +192 +mosqu�to_auth_a�_check +(* +u�r_d�a +, cڡ * +���id +, cڡ * +u��ame +, cڡ * +t�ic +, +ac�ss +); + +202 +mosqu�to_auth_u�wd_check +(* +u�r_d�a +, cڡ * +u��ame +, cڡ * +�ssw�d +); + +226 +mosqu�to_auth_psk_key_g� +(* +u�r_d�a +, cڡ * +h�t +, cڡ * +id�t�y +, * +key +, +max_key_�n +); + + @test/lib/c/01-con-discon-success.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<mosqu�to.h +> + +6 + grun + = -1; + +8 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +10 if( +rc +){ + +11 + `ex� +(1); + +13 + `mosqu�to_disc��� +( +mosq +); + +15 + } +} + +17 + $�_disc��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +19 +run + = +rc +; + +20 + } +} + +22 + $ma� +( +�gc +, * +�gv +[]) + +24 +rc +; + +25 +mosqu�to + * +mosq +; + +27 +p�t + = + `�oi +( +�gv +[1]); + +29 + `mosqu�to_lib_�� +(); + +31 +mosq + = + `mosqu�to_�w +("01-c�-disc�-suc�ss", +�ue +, +NULL +); + +32 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +33 + `mosqu�to_disc���_��back_�t +( +mosq +, +�_disc��� +); + +35 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +37 +run + == -1){ + +38 + `mosqu�to_lo� +( +mosq +, -1, 1); + +41 + `mosqu�to_de�roy +( +mosq +); + +43 + `mosqu�to_lib_��nup +(); + +44 +run +; + +45 + } +} + + @test/lib/c/01-keepalive-pingreq.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<mosqu�to.h +> + +6 + grun + = -1; + +8 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +10 if( +rc +){ + +11 + `ex� +(1); + +13 + } +} + +15 + $ma� +( +�gc +, * +�gv +[]) + +17 +rc +; + +18 +mosqu�to + * +mosq +; + +20 +p�t + = + `�oi +( +�gv +[1]); + +22 + `mosqu�to_lib_�� +(); + +24 +mosq + = + `mosqu�to_�w +("01-k��live-p�g�q", +�ue +, +NULL +); + +25 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +27 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 4); + +29 +run + == -1){ + +30 + `mosqu�to_lo� +( +mosq +, -1, 1); + +33 + `mosqu�to_de�roy +( +mosq +); + +34 + `mosqu�to_lib_��nup +(); + +35 +run +; + +36 + } +} + + @test/lib/c/01-no-clean-session.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +8 + $ma� +( +�gc +, * +�gv +[]) + +10 +rc +; + +11 +mosqu�to + * +mosq +; + +13 +p�t + = + `�oi +( +�gv +[1]); + +15 + `mosqu�to_lib_�� +(); + +17 +mosq + = + `mosqu�to_�w +("01-no-��n-�ssi�", +�l� +, +NULL +); + +19 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +21 +run + == -1){ + +22 + `mosqu�to_lo� +( +mosq +, -1, 1); + +25 + `mosqu�to_lib_��nup +(); + +26 +run +; + +27 + } +} + + @test/lib/c/01-server-keepalive-pingreq.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<mosqu�to.h +> + +6 + grun + = -1; + +8 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +10 if( +rc +){ + +11 + `ex� +(1); + +13 + } +} + +15 + $ma� +( +�gc +, * +�gv +[]) + +17 +rc +; + +18 +mosqu�to + * +mosq +; + +20 +p�t + = + `�oi +( +�gv +[1]); + +22 + `mosqu�to_lib_�� +(); + +24 +mosq + = + `mosqu�to_�w +("01-�rv�-k��live-p�g�q", +�ue +, +NULL +); + +25 + `mosqu�to_�t_�ti� +( +mosq +, +MOSQ_OPT_PROTOCOL_VERSION +, +MQTT_PROTOCOL_V5 +); + +26 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +28 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +30 +run + == -1){ + +31 + `mosqu�to_lo� +( +mosq +, -1, 1); + +34 + `mosqu�to_de�roy +( +mosq +); + +35 + `mosqu�to_lib_��nup +(); + +36 +run +; + +37 + } +} + + @test/lib/c/01-unpwd-set.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +8 + $ma� +( +�gc +, * +�gv +[]) + +10 +rc +; + +11 +mosqu�to + * +mosq +; + +13 +p�t + = + `�oi +( +�gv +[1]); + +15 + `mosqu�to_lib_�� +(); + +17 +mosq + = + `mosqu�to_�w +("01-u�wd-�t", +�ue +, +NULL +); + +18 + `mosqu�to_u��ame_pw_�t +( +mosq +, "uname", ";'[08gn=#"); + +20 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +22 +run + == -1){ + +23 + `mosqu�to_lo� +( +mosq +, -1, 1); + +26 + `mosqu�to_lib_��nup +(); + +27 +run +; + +28 + } +} + + @test/lib/c/01-will-set.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +8 + $ma� +( +�gc +, * +�gv +[]) + +10 +rc +; + +11 +mosqu�to + * +mosq +; + +13 +p�t + = + `�oi +( +�gv +[1]); + +15 + `mosqu�to_lib_�� +(); + +17 +mosq + = + `mosqu�to_�w +("01-w�l-�t", +�ue +, +NULL +); + +18 + `mosqu�to_w�l_�t +( +mosq +, "t�ic/�/u�x��ed/disc���", + `��� +("w��mes�ge"), "w��mes�ge", 1, +�ue +); + +20 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +22 +run + == -1){ + +23 + `mosqu�to_lo� +( +mosq +, -1, 1); + +26 + `mosqu�to_lib_��nup +(); + +27 +run +; + +28 + } +} + + @test/lib/c/01-will-unpwd-set.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +8 + $ma� +( +�gc +, * +�gv +[]) + +10 +rc +; + +11 +mosqu�to + * +mosq +; + +13 +p�t + = + `�oi +( +�gv +[1]); + +15 + `mosqu�to_lib_�� +(); + +17 +mosq + = + `mosqu�to_�w +("01-w�l-u�wd-�t", +�ue +, +NULL +); + +18 + `mosqu�to_u��ame_pw_�t +( +mosq +, "oibvvwqw", "#'^2hg9a&nm38*us"); + +19 + `mosqu�to_w�l_�t +( +mosq +, "w�l-t�ic", + `��� +("w��mes�ge"), "w��mes�ge", 2, +�l� +); + +21 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +23 +run + == -1){ + +24 + `mosqu�to_lo� +( +mosq +, -1, 1); + +27 + `mosqu�to_lib_��nup +(); + +28 +run +; + +29 + } +} + + @test/lib/c/02-subscribe-qos0.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<mosqu�to.h +> + +6 + grun + = -1; + +8 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +10 if( +rc +){ + +11 + `ex� +(1); + +13 + `mosqu�to_subs�ibe +( +mosq +, +NULL +, "qos0/test", 0); + +15 + } +} + +17 + $�_disc��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +19 +run + = +rc +; + +20 + } +} + +22 + $�_subs�ibe +( +mosqu�to + * +mosq +, * +obj +, +mid +, +qos_cou� +, cڡ * +g��ed_qos +) + +24 + `mosqu�to_disc��� +( +mosq +); + +25 + } +} + +27 + $ma� +( +�gc +, * +�gv +[]) + +29 +rc +; + +30 +mosqu�to + * +mosq +; + +32 +p�t + = + `�oi +( +�gv +[1]); + +34 + `mosqu�to_lib_�� +(); + +36 +mosq + = + `mosqu�to_�w +("subs�ibe-qos0-��", +�ue +, +NULL +); + +37 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +38 + `mosqu�to_disc���_��back_�t +( +mosq +, +�_disc��� +); + +39 + `mosqu�to_subs�ibe_��back_�t +( +mosq +, +�_subs�ibe +); + +41 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +43 +run + == -1){ + +44 + `mosqu�to_lo� +( +mosq +, -1, 1); + +47 + `mosqu�to_lib_��nup +(); + +48 +run +; + +49 + } +} + + @test/lib/c/02-subscribe-qos1.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<mosqu�to.h +> + +6 + grun + = -1; + +8 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +10 if( +rc +){ + +11 + `ex� +(1); + +13 + `mosqu�to_subs�ibe +( +mosq +, +NULL +, "qos1/test", 1); + +15 + } +} + +17 + $�_disc��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +19 +run + = +rc +; + +20 + } +} + +22 + $�_subs�ibe +( +mosqu�to + * +mosq +, * +obj +, +mid +, +qos_cou� +, cڡ * +g��ed_qos +) + +24 + `mosqu�to_disc��� +( +mosq +); + +25 + } +} + +27 + $ma� +( +�gc +, * +�gv +[]) + +29 +rc +; + +30 +mosqu�to + * +mosq +; + +32 +p�t + = + `�oi +( +�gv +[1]); + +34 + `mosqu�to_lib_�� +(); + +36 +mosq + = + `mosqu�to_�w +("subs�ibe-qos1-��", +�ue +, +NULL +); + +37 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +38 + `mosqu�to_disc���_��back_�t +( +mosq +, +�_disc��� +); + +39 + `mosqu�to_subs�ibe_��back_�t +( +mosq +, +�_subs�ibe +); + +41 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +43 +run + == -1){ + +44 + `mosqu�to_lo� +( +mosq +, -1, 1); + +47 + `mosqu�to_lib_��nup +(); + +48 +run +; + +49 + } +} + + @test/lib/c/02-subscribe-qos2.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<mosqu�to.h +> + +6 + grun + = -1; + +8 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +10 if( +rc +){ + +11 + `ex� +(1); + +13 + `mosqu�to_subs�ibe +( +mosq +, +NULL +, "qos2/test", 2); + +15 + } +} + +17 + $�_disc��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +19 +run + = +rc +; + +20 + } +} + +22 + $�_subs�ibe +( +mosqu�to + * +mosq +, * +obj +, +mid +, +qos_cou� +, cڡ * +g��ed_qos +) + +24 + `mosqu�to_disc��� +( +mosq +); + +25 + } +} + +27 + $ma� +( +�gc +, * +�gv +[]) + +29 +rc +; + +30 +mosqu�to + * +mosq +; + +32 +p�t + = + `�oi +( +�gv +[1]); + +34 + `mosqu�to_lib_�� +(); + +36 +mosq + = + `mosqu�to_�w +("subs�ibe-qos2-��", +�ue +, +NULL +); + +37 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +38 + `mosqu�to_disc���_��back_�t +( +mosq +, +�_disc��� +); + +39 + `mosqu�to_subs�ibe_��back_�t +( +mosq +, +�_subs�ibe +); + +41 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +43 +run + == -1){ + +44 + `mosqu�to_lo� +( +mosq +, -1, 1); + +47 + `mosqu�to_lib_��nup +(); + +48 +run +; + +49 + } +} + + @test/lib/c/02-unsubscribe-multiple-v5.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<mosqu�to.h +> + +6 + grun + = -1; + +8 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +10 if( +rc +){ + +11 + `ex� +(1); + +13 + `mosqu�to_subs�ibe +( +mosq +, +NULL +, "unsubscribe/test", 2); + +15 + } +} + +17 + $�_subs�ibe +( +mosqu�to + * +mosq +, * +obj +, +mid +, +sub_cou� +, cڡ * +subs +) + +19 * +unsubs +[] = {"unsubscribe/test", "no-sub"}; + +21 + `mosqu�to_unsubs�ibe_muɝ� +( +mosq +, +NULL +, 2, +unsubs +, NULL); + +22 + } +} + +24 + $�_disc��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +26 +run + = +rc +; + +27 + } +} + +29 + $�_unsubs�ibe +( +mosqu�to + * +mosq +, * +obj +, +mid +) + +31 + `mosqu�to_disc��� +( +mosq +); + +32 + } +} + +35 + $ma� +( +�gc +, * +�gv +[]) + +37 +rc +; + +38 +mosqu�to + * +mosq +; + +40 +p�t + = + `�oi +( +�gv +[1]); + +42 + `mosqu�to_lib_�� +(); + +44 +mosq + = + `mosqu�to_�w +("unsubs�ibe-��", +�ue +, +NULL +); + +45 + `mosqu�to_�t_�ti� +( +mosq +, +MOSQ_OPT_PROTOCOL_VERSION +, +MQTT_PROTOCOL_V5 +); + +46 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +47 + `mosqu�to_disc���_��back_�t +( +mosq +, +�_disc��� +); + +48 + `mosqu�to_subs�ibe_��back_�t +( +mosq +, +�_subs�ibe +); + +49 + `mosqu�to_unsubs�ibe_��back_�t +( +mosq +, +�_unsubs�ibe +); + +51 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +53 +run + == -1){ + +54 + `mosqu�to_lo� +( +mosq +, -1, 1); + +57 + `mosqu�to_lib_��nup +(); + +58 +run +; + +59 + } +} + + @test/lib/c/02-unsubscribe-v5.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<mosqu�to.h +> + +6 + grun + = -1; + +8 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +10 if( +rc +){ + +11 + `ex� +(1); + +13 + `mosqu�to_unsubs�ibe +( +mosq +, +NULL +, "unsubscribe/test"); + +15 + } +} + +17 + $�_disc��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +19 +run + = +rc +; + +20 + } +} + +22 + $�_unsubs�ibe +( +mosqu�to + * +mosq +, * +obj +, +mid +) + +24 + `mosqu�to_disc��� +( +mosq +); + +25 + } +} + +27 + $ma� +( +�gc +, * +�gv +[]) + +29 +rc +; + +30 +mosqu�to + * +mosq +; + +32 +p�t + = + `�oi +( +�gv +[1]); + +34 + `mosqu�to_lib_�� +(); + +36 +mosq + = + `mosqu�to_�w +("unsubs�ibe-��", +�ue +, +NULL +); + +37 + `mosqu�to_�t_�ti� +( +mosq +, +MOSQ_OPT_PROTOCOL_VERSION +, +MQTT_PROTOCOL_V5 +); + +38 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +39 + `mosqu�to_disc���_��back_�t +( +mosq +, +�_disc��� +); + +40 + `mosqu�to_unsubs�ibe_��back_�t +( +mosq +, +�_unsubs�ibe +); + +42 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +44 +run + == -1){ + +45 + `mosqu�to_lo� +( +mosq +, -1, 1); + +48 + `mosqu�to_lib_��nup +(); + +49 +run +; + +50 + } +} + + @test/lib/c/02-unsubscribe.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<mosqu�to.h +> + +6 + grun + = -1; + +8 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +10 if( +rc +){ + +11 + `ex� +(1); + +13 + `mosqu�to_unsubs�ibe +( +mosq +, +NULL +, "unsubscribe/test"); + +15 + } +} + +17 + $�_disc��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +19 +run + = +rc +; + +20 + } +} + +22 + $�_unsubs�ibe +( +mosqu�to + * +mosq +, * +obj +, +mid +) + +24 + `mosqu�to_disc��� +( +mosq +); + +25 + } +} + +27 + $ma� +( +�gc +, * +�gv +[]) + +29 +rc +; + +30 +mosqu�to + * +mosq +; + +32 +p�t + = + `�oi +( +�gv +[1]); + +34 + `mosqu�to_lib_�� +(); + +36 +mosq + = + `mosqu�to_�w +("unsubs�ibe-��", +�ue +, +NULL +); + +37 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +38 + `mosqu�to_disc���_��back_�t +( +mosq +, +�_disc��� +); + +39 + `mosqu�to_unsubs�ibe_��back_�t +( +mosq +, +�_unsubs�ibe +); + +41 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +43 +run + == -1){ + +44 + `mosqu�to_lo� +( +mosq +, -1, 1); + +47 + `mosqu�to_lib_��nup +(); + +48 +run +; + +49 + } +} + + @test/lib/c/03-publish-b2c-qos1.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +9 if( +rc +){ + +10 + `ex� +(1); + +12 + } +} + +14 + $�_mes�ge +( +mosqu�to + * +mosq +, * +obj +, cڡ +mosqu�to_mes�ge + * +msg +) + +16 if( +msg +-> +mid + != 123){ + +17 + `��tf +("Inv�id mid (%d)\n", +msg +-> +mid +); + +18 + `ex� +(1); + +20 if( +msg +-> +qos + != 1){ + +21 + `��tf +("Inv�id qo�(%d)\n", +msg +-> +qos +); + +22 + `ex� +(1); + +24 if( + `�rcmp +( +msg +-> +t�ic +, "pub/qos1/receive")){ + +25 + `��tf +("Inv�id��i�(%s)\n", +msg +-> +t�ic +); + +26 + `ex� +(1); + +28 if( + `�rcmp +( +msg +-> +�yl�d +, "message")){ + +29 + `��tf +("Inv�id�ayl�d (%s)\n", (*) +msg +-> +�yl�d +); + +30 + `ex� +(1); + +32 if( +msg +-> +�yl�d�n + != 7){ + +33 + `��tf +("Inv�id�ayl�d��(%d)\n", +msg +-> +�yl�d�n +); + +34 + `ex� +(1); + +36 if( +msg +-> +��� + !� +�l� +){ + +37 + `��tf +("Inv�id��a� (%d)\n", +msg +-> +��� +); + +38 + `ex� +(1); + +41 + `ex� +(0); + +42 + } +} + +44 + $ma� +( +�gc +, * +�gv +[]) + +46 +rc +; + +47 +mosqu�to + * +mosq +; + +49 +p�t + = + `�oi +( +�gv +[1]); + +51 + `mosqu�to_lib_�� +(); + +53 +mosq + = + `mosqu�to_�w +("publish-qos1-��", +�ue +, +NULL +); + +54 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +55 + `mosqu�to_mes�ge_��back_�t +( +mosq +, +�_mes�ge +); + +56 + `mosqu�to_mes�ge_��y_�t +( +mosq +, 3); + +58 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +61 + `mosqu�to_lo� +( +mosq +, 300, 1); + +64 + `mosqu�to_lib_��nup +(); + +66 + } +} + + @test/lib/c/03-publish-b2c-qos2-len.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +9 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +11 if( +rc +){ + +12 + `ex� +(1); + +14 + } +} + +16 + $�_mes�ge +( +mosqu�to + * +mosq +, * +obj +, cڡ +mosqu�to_mes�ge + * +msg +) + +18 if( +msg +-> +mid + != 56){ + +19 + `��tf +("Inv�id mid (%d)\n", +msg +-> +mid +); + +20 + `ex� +(1); + +22 if( +msg +-> +qos + != 2){ + +23 + `��tf +("Inv�id qo�(%d)\n", +msg +-> +qos +); + +24 + `ex� +(1); + +26 if( + `�rcmp +( +msg +-> +t�ic +, "len/qos2/test")){ + +27 + `��tf +("Inv�id��i�(%s)\n", +msg +-> +t�ic +); + +28 + `ex� +(1); + +30 if( + `�rcmp +( +msg +-> +�yl�d +, "message")){ + +31 + `��tf +("Inv�id�ayl�d (%s)\n", (*) +msg +-> +�yl�d +); + +32 + `ex� +(1); + +34 if( +msg +-> +�yl�d�n + != 7){ + +35 + `��tf +("Inv�id�ayl�d��(%d)\n", +msg +-> +�yl�d�n +); + +36 + `ex� +(1); + +38 if( +msg +-> +��� + !� +�l� +){ + +39 + `��tf +("Inv�id��a� (%d)\n", +msg +-> +��� +); + +40 + `ex� +(1); + +43 + `mosqu�to_disc��� +( +mosq +); + +44 + } +} + +46 + $�_disc��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +48 +run + = 0; + +49 + } +} + +51 + $ma� +( +�gc +, * +�gv +[]) + +53 +rc +; + +54 +mosqu�to + * +mosq +; + +56 +p�t + = + `�oi +( +�gv +[1]); + +58 + `mosqu�to_lib_�� +(); + +60 +mosq + = + `mosqu�to_�w +("publish-qos2-��", +�ue +, & +run +); + +61 + `mosqu�to_�t_�ti� +( +mosq +, +MOSQ_OPT_PROTOCOL_VERSION +, +MQTT_PROTOCOL_V5 +); + +62 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +63 + `mosqu�to_disc���_��back_�t +( +mosq +, +�_disc��� +); + +64 + `mosqu�to_mes�ge_��back_�t +( +mosq +, +�_mes�ge +); + +66 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +68 +run + == -1){ + +69 + `mosqu�to_lo� +( +mosq +, 100, 1); + +72 + `mosqu�to_lib_��nup +(); + +73 +run +; + +74 + } +} + + @test/lib/c/03-publish-b2c-qos2.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +9 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +11 if( +rc +){ + +12 + `ex� +(1); + +14 + } +} + +16 + $�_mes�ge +( +mosqu�to + * +mosq +, * +obj +, cڡ +mosqu�to_mes�ge + * +msg +) + +18 if( +msg +-> +mid + != 13423){ + +19 + `��tf +("Inv�id mid (%d)\n", +msg +-> +mid +); + +20 + `ex� +(1); + +22 if( +msg +-> +qos + != 2){ + +23 + `��tf +("Inv�id qo�(%d)\n", +msg +-> +qos +); + +24 + `ex� +(1); + +26 if( + `�rcmp +( +msg +-> +t�ic +, "pub/qos2/receive")){ + +27 + `��tf +("Inv�id��i�(%s)\n", +msg +-> +t�ic +); + +28 + `ex� +(1); + +30 if( + `�rcmp +( +msg +-> +�yl�d +, "message")){ + +31 + `��tf +("Inv�id�ayl�d (%s)\n", (*) +msg +-> +�yl�d +); + +32 + `ex� +(1); + +34 if( +msg +-> +�yl�d�n + != 7){ + +35 + `��tf +("Inv�id�ayl�d��(%d)\n", +msg +-> +�yl�d�n +); + +36 + `ex� +(1); + +38 if( +msg +-> +��� + !� +�l� +){ + +39 + `��tf +("Inv�id��a� (%d)\n", +msg +-> +��� +); + +40 + `ex� +(1); + +43 +run + = 0; + +44 + } +} + +46 + $ma� +( +�gc +, * +�gv +[]) + +48 +rc +; + +49 +mosqu�to + * +mosq +; + +51 +p�t + = + `�oi +( +�gv +[1]); + +53 + `mosqu�to_lib_�� +(); + +55 +mosq + = + `mosqu�to_�w +("publish-qos2-��", +�ue +, & +run +); + +56 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +57 + `mosqu�to_mes�ge_��back_�t +( +mosq +, +�_mes�ge +); + +58 + `mosqu�to_mes�ge_��y_�t +( +mosq +, 5); + +60 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +62 +run + == -1){ + +63 + `mosqu�to_lo� +( +mosq +, 300, 1); + +66 + `mosqu�to_lib_��nup +(); + +67 +run +; + +68 + } +} + + @test/lib/c/03-publish-c2b-qos1-disconnect.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +8 + gf��_c���i� + = 1; + +10 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +12 if( +rc +){ + +13 + `ex� +(1); + +15 if( +f��_c���i� + == 1){ + +16 + `mosqu�to_publish +( +mosq +, +NULL +, "pub/qos1/��", + `��� +("mes�ge"), "mes�ge", 1, +�l� +); + +17 +f��_c���i� + = 0; + +20 + } +} + +22 + $�_publish +( +mosqu�to + * +mosq +, * +obj +, +mid +) + +24 + `mosqu�to_disc��� +( +mosq +); + +25 + } +} + +27 + $�_disc��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +29 if( +rc +){ + +30 + `mosqu�to_�c��� +( +mosq +); + +32 +run + = 0; + +34 + } +} + +36 + $ma� +( +�gc +, * +�gv +[]) + +38 +rc +; + +39 +mosqu�to + * +mosq +; + +41 +p�t + = + `�oi +( +�gv +[1]); + +43 + `mosqu�to_lib_�� +(); + +45 +mosq + = + `mosqu�to_�w +("publish-qos1-��", +�ue +, +NULL +); + +46 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +47 + `mosqu�to_disc���_��back_�t +( +mosq +, +�_disc��� +); + +48 + `mosqu�to_publish_��back_�t +( +mosq +, +�_publish +); + +49 + `mosqu�to_mes�ge_��y_�t +( +mosq +, 3); + +51 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +53 +run + == -1){ + +54 + `mosqu�to_lo� +( +mosq +, 300, 1); + +57 + `mosqu�to_lib_��nup +(); + +58 +run +; + +59 + } +} + + @test/lib/c/03-publish-c2b-qos1-len.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +9 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +11 if( +rc +){ + +12 + `ex� +(1); + +14 + `mosqu�to_publish +( +mosq +, +NULL +, "pub/qos1/��", + `��� +("mes�ge"), "mes�ge", 1, +�l� +); + +16 + } +} + +18 + $�_publish +( +mosqu�to + * +mosq +, * +obj +, +mid +) + +20 + `mosqu�to_disc��� +( +mosq +); + +21 + } +} + +23 + $�_disc��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +25 +run + = 0; + +26 + } +} + +28 + $ma� +( +�gc +, * +�gv +[]) + +30 +rc +; + +31 +mosqu�to + * +mosq +; + +33 +p�t + = + `�oi +( +�gv +[1]); + +35 + `mosqu�to_lib_�� +(); + +37 +mosq + = + `mosqu�to_�w +("publish-qos1-��", +�ue +, +NULL +); + +38 + `mosqu�to_�t_�ti� +( +mosq +, +MOSQ_OPT_PROTOCOL_VERSION +, +MQTT_PROTOCOL_V5 +); + +39 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +40 + `mosqu�to_disc���_��back_�t +( +mosq +, +�_disc��� +); + +41 + `mosqu�to_publish_��back_�t +( +mosq +, +�_publish +); + +42 + `mosqu�to_mes�ge_��y_�t +( +mosq +, 3); + +44 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +46 +run + == -1){ + +47 + `mosqu�to_lo� +( +mosq +, 300, 1); + +50 + `mosqu�to_lib_��nup +(); + +51 +run +; + +52 + } +} + + @test/lib/c/03-publish-c2b-qos1-receive-maximum.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +9 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +, +�ags +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +11 +i +; + +13 if( +rc +){ + +14 + `ex� +(1); + +17 +i +=0; i<6; i++){ + +18 + `mosqu�to_publish_v5 +( +mosq +, +NULL +, "t�ic", 5, "12345", 1, +�l� +, NULL); + +20 + } +} + +22 + $�_publish +( +mosqu�to + * +mosq +, * +obj +, +mid +, +�as�_code +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +24 if( +mid + == 6){ + +25 + `mosqu�to_disc��� +( +mosq +); + +26 +run + = 0; + +28 + } +} + +30 + $ma� +( +�gc +, * +�gv +[]) + +32 +rc +; + +33 +mosqu�to + * +mosq +; + +34 +mosqu�to_�ݔty + * +��s + = +NULL +; + +36 +p�t + = + `�oi +( +�gv +[1]); + +38 + `mosqu�to_lib_�� +(); + +40 +mosq + = + `mosqu�to_�w +("publish-qos1-��", +�ue +, & +run +); + +41 + `mosqu�to_�t_�ti� +( +mosq +, +MOSQ_OPT_PROTOCOL_VERSION +, +MQTT_PROTOCOL_V5 +); + +43 + `mosqu�to_c���_v5_��back_�t +( +mosq +, +�_c��� +); + +44 + `mosqu�to_publish_v5_��back_�t +( +mosq +, +�_publish +); + +46 +rc + = + `mosqu�to_c���_b�d_v5 +( +mosq +, "lo�lho�", +p�t +, 60, +NULL +, NULL); + +48 +run + == -1){ + +49 + `mosqu�to_lo� +( +mosq +, 300, 1); + +52 + `mosqu�to_lib_��nup +(); + +53 +run +; + +54 + } +} + + @test/lib/c/03-publish-c2b-qos2-disconnect.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +8 + gf��_c���i� + = 1; + +10 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +12 if( +rc +){ + +13 + `ex� +(1); + +15 if( +f��_c���i� + == 1){ + +16 + `mosqu�to_publish +( +mosq +, +NULL +, "pub/qos2/��", + `��� +("mes�ge"), "mes�ge", 2, +�l� +); + +17 +f��_c���i� + = 0; + +20 + } +} + +22 + $�_publish +( +mosqu�to + * +mosq +, * +obj +, +mid +) + +24 + `mosqu�to_disc��� +( +mosq +); + +25 + } +} + +27 + $�_disc��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +29 if( +rc +){ + +30 + `mosqu�to_�c��� +( +mosq +); + +32 +run + = 0; + +34 + } +} + +36 + $ma� +( +�gc +, * +�gv +[]) + +38 +rc +; + +39 +mosqu�to + * +mosq +; + +41 +p�t + = + `�oi +( +�gv +[1]); + +43 + `mosqu�to_lib_�� +(); + +45 +mosq + = + `mosqu�to_�w +("publish-qos2-��", +�ue +, +NULL +); + +46 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +47 + `mosqu�to_disc���_��back_�t +( +mosq +, +�_disc��� +); + +48 + `mosqu�to_publish_��back_�t +( +mosq +, +�_publish +); + +49 + `mosqu�to_mes�ge_��y_�t +( +mosq +, 3); + +51 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +53 +run + == -1){ + +54 + `mosqu�to_lo� +( +mosq +, 300, 1); + +57 + `mosqu�to_lib_��nup +(); + +58 +run +; + +59 + } +} + + @test/lib/c/03-publish-c2b-qos2-len.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +9 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +11 if( +rc +){ + +12 + `ex� +(1); + +14 + `mosqu�to_publish +( +mosq +, +NULL +, "pub/qos2/��", + `��� +("mes�ge"), "mes�ge", 2, +�l� +); + +16 + } +} + +18 + $�_publish +( +mosqu�to + * +mosq +, * +obj +, +mid +, +�as�_code +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +20 + `mosqu�to_disc��� +( +mosq +); + +21 + } +} + +23 + $�_disc��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +25 +run + = 0; + +26 + } +} + +28 + $ma� +( +�gc +, * +�gv +[]) + +30 +rc +; + +31 +mosqu�to + * +mosq +; + +33 +p�t + = + `�oi +( +�gv +[1]); + +35 + `mosqu�to_lib_�� +(); + +37 +mosq + = + `mosqu�to_�w +("publish-qos2-��", +�ue +, +NULL +); + +38 + `mosqu�to_�t_�ti� +( +mosq +, +MOSQ_OPT_PROTOCOL_VERSION +, +MQTT_PROTOCOL_V5 +); + +39 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +40 + `mosqu�to_disc���_��back_�t +( +mosq +, +�_disc��� +); + +41 + `mosqu�to_publish_v5_��back_�t +( +mosq +, +�_publish +); + +42 + `mosqu�to_mes�ge_��y_�t +( +mosq +, 3); + +44 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +46 +run + == -1){ + +47 + `mosqu�to_lo� +( +mosq +, 300, 1); + +50 + `mosqu�to_lib_��nup +(); + +51 +run +; + +52 + } +} + + @test/lib/c/03-publish-c2b-qos2-maximum-qos-0.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +9 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +11 if( +rc +){ + +12 + `ex� +(1); + +14 +rc + = + `mosqu�to_publish +( +mosq +, +NULL +, "maximum/qos/qos2", + `��� +("mes�ge"), "mes�ge", 2, +�l� +); + +15 if( +rc + !� +MOSQ_ERR_QOS_NOT_SUPPORTED +� +run + = 1; + +16 +rc + = + `mosqu�to_publish +( +mosq +, +NULL +, "maximum/qos/qos1", + `��� +("mes�ge"), "mes�ge", 1, +�l� +); + +17 if( +rc + !� +MOSQ_ERR_QOS_NOT_SUPPORTED +� +run + = 1; + +18 +rc + = + `mosqu�to_publish +( +mosq +, +NULL +, "maximum/qos/qos0", + `��� +("mes�ge"), "mes�ge", 0, +�l� +); + +19 if( +rc + !� +MOSQ_ERR_SUCCESS +� +run + = 1; + +21 + } +} + +23 + $�_publish +( +mosqu�to + * +mosq +, * +obj +, +mid +) + +25 if( +mid + == 1){ + +26 + `mosqu�to_disc��� +( +mosq +); + +28 + } +} + +30 + $�_disc��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +32 +run + = 0; + +33 + } +} + +35 + $ma� +( +�gc +, * +�gv +[]) + +37 +rc +; + +38 +mosqu�to + * +mosq +; + +40 +p�t + = + `�oi +( +�gv +[1]); + +42 + `mosqu�to_lib_�� +(); + +44 +mosq + = + `mosqu�to_�w +("publish-qos2-��", +�ue +, +NULL +); + +45 + `mosqu�to_�t_�ti� +( +mosq +, +MOSQ_OPT_PROTOCOL_VERSION +, +MQTT_PROTOCOL_V5 +); + +46 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +47 + `mosqu�to_disc���_��back_�t +( +mosq +, +�_disc��� +); + +48 + `mosqu�to_publish_��back_�t +( +mosq +, +�_publish +); + +50 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +52 +run + == -1){ + +53 + `mosqu�to_lo� +( +mosq +, 50, 1); + +56 + `mosqu�to_lib_��nup +(); + +57 +run +; + +58 + } +} + + @test/lib/c/03-publish-c2b-qos2-maximum-qos-1.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +9 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +11 if( +rc +){ + +12 + `ex� +(1); + +14 +rc + = + `mosqu�to_publish +( +mosq +, +NULL +, "maximum/qos/qos2", + `��� +("mes�ge"), "mes�ge", 2, +�l� +); + +15 if( +rc + !� +MOSQ_ERR_QOS_NOT_SUPPORTED +� +run + = 1; + +16 +rc + = + `mosqu�to_publish +( +mosq +, +NULL +, "maximum/qos/qos1", + `��� +("mes�ge"), "mes�ge", 1, +�l� +); + +17 if( +rc + !� +MOSQ_ERR_SUCCESS +� +run + = 1; + +18 +rc + = + `mosqu�to_publish +( +mosq +, +NULL +, "maximum/qos/qos0", + `��� +("mes�ge"), "mes�ge", 0, +�l� +); + +19 if( +rc + !� +MOSQ_ERR_SUCCESS +� +run + = 1; + +21 + } +} + +23 + $�_publish +( +mosqu�to + * +mosq +, * +obj +, +mid +) + +25 if( +mid + == 2){ + +26 + `mosqu�to_disc��� +( +mosq +); + +28 + } +} + +30 + $�_disc��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +32 +run + = 0; + +33 + } +} + +35 + $ma� +( +�gc +, * +�gv +[]) + +37 +rc +; + +38 +mosqu�to + * +mosq +; + +40 +p�t + = + `�oi +( +�gv +[1]); + +42 + `mosqu�to_lib_�� +(); + +44 +mosq + = + `mosqu�to_�w +("publish-qos2-��", +�ue +, +NULL +); + +45 + `mosqu�to_�t_�ti� +( +mosq +, +MOSQ_OPT_PROTOCOL_VERSION +, +MQTT_PROTOCOL_V5 +); + +46 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +47 + `mosqu�to_disc���_��back_�t +( +mosq +, +�_disc��� +); + +48 + `mosqu�to_publish_��back_�t +( +mosq +, +�_publish +); + +50 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +52 +run + == -1){ + +53 + `mosqu�to_lo� +( +mosq +, 50, 1); + +55 + `mosqu�to_lo� +( +mosq +, 50, 1); + +57 + `mosqu�to_lib_��nup +(); + +58 +run +; + +59 + } +} + + @test/lib/c/03-publish-c2b-qos2-pubrec-error.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +9 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +, +�ags +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +11 if( +rc +){ + +12 + `ex� +(1); + +14 + `mosqu�to_publish_v5 +( +mosq +, +NULL +, "t�ic", + `��� +("�je�ed"), "�je�ed", 2, +�l� +, NULL); + +15 + `mosqu�to_publish_v5 +( +mosq +, +NULL +, "t�ic", + `��� +("ac��ed"), "ac��ed", 2, +�l� +, NULL); + +16 + } +} + +18 + $�_publish +( +mosqu�to + * +mosq +, * +obj +, +mid +, +�as�_code +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +20 if( +mid + == 2){ + +21 +run + = 0; + +23 + } +} + +25 + $ma� +( +�gc +, * +�gv +[]) + +27 +rc +; + +28 +mosqu�to + * +mosq +; + +29 +mosqu�to_�ݔty + * +��s + = +NULL +; + +31 +p�t + = + `�oi +( +�gv +[1]); + +33 + `mosqu�to_lib_�� +(); + +35 +mosq + = + `mosqu�to_�w +("publish-qos2-��", +�ue +, & +run +); + +36 + `mosqu�to_�t_�ti� +( +mosq +, +MOSQ_OPT_PROTOCOL_VERSION +, +MQTT_PROTOCOL_V5 +); + +38 + `mosqu�to_c���_v5_��back_�t +( +mosq +, +�_c��� +); + +39 + `mosqu�to_publish_v5_��back_�t +( +mosq +, +�_publish +); + +41 +rc + = + `mosqu�to_c���_b�d_v5 +( +mosq +, "lo�lho�", +p�t +, 60, +NULL +, NULL); + +43 +run + == -1){ + +44 + `mosqu�to_lo� +( +mosq +, 100, 1); + +47 + `mosqu�to_lib_��nup +(); + +48 +run +; + +49 + } +} + + @test/lib/c/03-publish-c2b-qos2-receive-maximum-1.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +9 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +, +�ags +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +11 +i +; + +13 if( +rc +){ + +14 + `ex� +(1); + +17 +i +=0; i<5; i++){ + +18 + `mosqu�to_publish_v5 +( +mosq +, +NULL +, "t�ic", 5, "12345", 2, +�l� +, NULL); + +20 + } +} + +22 + $�_publish +( +mosqu�to + * +mosq +, * +obj +, +mid +, +�as�_code +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +24 if( +mid + == 5){ + +25 + `mosqu�to_disc��� +( +mosq +); + +26 +run + = 0; + +28 + } +} + +30 + $ma� +( +�gc +, * +�gv +[]) + +32 +rc +; + +33 +mosqu�to + * +mosq +; + +34 +mosqu�to_�ݔty + * +��s + = +NULL +; + +36 +p�t + = + `�oi +( +�gv +[1]); + +38 + `mosqu�to_lib_�� +(); + +40 +mosq + = + `mosqu�to_�w +("publish-qos2-��", +�ue +, & +run +); + +41 + `mosqu�to_�t_�ti� +( +mosq +, +MOSQ_OPT_PROTOCOL_VERSION +, +MQTT_PROTOCOL_V5 +); + +43 + `mosqu�to_c���_v5_��back_�t +( +mosq +, +�_c��� +); + +44 + `mosqu�to_publish_v5_��back_�t +( +mosq +, +�_publish +); + +46 +rc + = + `mosqu�to_c���_b�d_v5 +( +mosq +, "lo�lho�", +p�t +, 60, +NULL +, NULL); + +48 +run + == -1){ + +49 + `mosqu�to_lo� +( +mosq +, 300, 1); + +52 + `mosqu�to_lib_��nup +(); + +53 +run +; + +54 + } +} + + @test/lib/c/03-publish-c2b-qos2-receive-maximum-2.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +9 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +, +�ags +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +11 +i +; + +13 if( +rc +){ + +14 + `ex� +(1); + +17 +i +=0; i<5; i++){ + +18 + `mosqu�to_publish_v5 +( +mosq +, +NULL +, "t�ic", 5, "12345", 2, +�l� +, NULL); + +20 + } +} + +22 + $�_publish +( +mosqu�to + * +mosq +, * +obj +, +mid +, +�as�_code +, cڡ +mosqu�to_�ݔty + * +�ݔt�s +) + +24 if( +mid + == 5){ + +25 + `mosqu�to_disc��� +( +mosq +); + +26 +run + = 0; + +28 + } +} + +30 + $ma� +( +�gc +, * +�gv +[]) + +32 +rc +; + +33 +mosqu�to + * +mosq +; + +34 +mosqu�to_�ݔty + * +��s + = +NULL +; + +36 +p�t + = + `�oi +( +�gv +[1]); + +38 + `mosqu�to_lib_�� +(); + +40 +mosq + = + `mosqu�to_�w +("publish-qos2-��", +�ue +, & +run +); + +41 + `mosqu�to_�t_�ti� +( +mosq +, +MOSQ_OPT_PROTOCOL_VERSION +, +MQTT_PROTOCOL_V5 +); + +43 + `mosqu�to_c���_v5_��back_�t +( +mosq +, +�_c��� +); + +44 + `mosqu�to_publish_v5_��back_�t +( +mosq +, +�_publish +); + +46 +rc + = + `mosqu�to_c���_b�d_v5 +( +mosq +, "lo�lho�", +p�t +, 60, +NULL +, NULL); + +48 +run + == -1){ + +49 + `mosqu�to_lo� +( +mosq +, 300, 1); + +52 + `mosqu�to_lib_��nup +(); + +53 +run +; + +54 + } +} + + @test/lib/c/03-publish-c2b-qos2.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +9 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +11 if( +rc +){ + +12 + `ex� +(1); + +14 + `mosqu�to_publish +( +mosq +, +NULL +, "pub/qos2/��", + `��� +("mes�ge"), "mes�ge", 2, +�l� +); + +16 + } +} + +18 + $�_publish +( +mosqu�to + * +mosq +, * +obj +, +mid +) + +20 + `mosqu�to_disc��� +( +mosq +); + +21 + } +} + +23 + $�_disc��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +25 +run + = 0; + +26 + } +} + +28 + $ma� +( +�gc +, * +�gv +[]) + +30 +rc +; + +31 +mosqu�to + * +mosq +; + +33 +p�t + = + `�oi +( +�gv +[1]); + +35 + `mosqu�to_lib_�� +(); + +37 +mosq + = + `mosqu�to_�w +("publish-qos2-��", +�ue +, +NULL +); + +38 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +39 + `mosqu�to_disc���_��back_�t +( +mosq +, +�_disc��� +); + +40 + `mosqu�to_publish_��back_�t +( +mosq +, +�_publish +); + +42 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +44 +run + == -1){ + +45 + `mosqu�to_lo� +( +mosq +, 300, 1); + +48 + `mosqu�to_lib_��nup +(); + +49 +run +; + +50 + } +} + + @test/lib/c/03-publish-qos0-no-payload.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +8 + g��_mid + = -1; + +10 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +12 if( +rc +){ + +13 + `ex� +(1); + +15 + `mosqu�to_publish +( +mosq +, & +��_mid +, "pub/qos0/no-�yl�d/��", 0, +NULL +, 0, +�l� +); + +17 + } +} + +19 + $�_publish +( +mosqu�to + * +mosq +, * +obj +, +mid +) + +21 if( +mid + =� +��_mid +){ + +22 + `mosqu�to_disc��� +( +mosq +); + +23 +run + = 0; + +25 + `ex� +(1); + +27 + } +} + +29 + $ma� +( +�gc +, * +�gv +[]) + +31 +rc +; + +32 +mosqu�to + * +mosq +; + +34 +p�t + = + `�oi +( +�gv +[1]); + +36 + `mosqu�to_lib_�� +(); + +38 +mosq + = + `mosqu�to_�w +("publish-qos0-��-�", +�ue +, +NULL +); + +39 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +40 + `mosqu�to_publish_��back_�t +( +mosq +, +�_publish +); + +42 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +44 +run + == -1){ + +45 + `mosqu�to_lo� +( +mosq +, -1, 1); + +48 + `mosqu�to_lib_��nup +(); + +49 +run +; + +50 + } +} + + @test/lib/c/03-publish-qos0.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +8 + g��_mid + = -1; + +10 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +12 if( +rc +){ + +13 + `ex� +(1); + +15 + `mosqu�to_publish +( +mosq +, & +��_mid +, "pub/qos0/��", + `��� +("mes�ge"), "mes�ge", 0, +�l� +); + +17 + } +} + +19 + $�_publish +( +mosqu�to + * +mosq +, * +obj +, +mid +) + +21 if( +mid + =� +��_mid +){ + +22 + `mosqu�to_disc��� +( +mosq +); + +23 +run + = 0; + +25 + `ex� +(1); + +27 + } +} + +29 + $ma� +( +�gc +, * +�gv +[]) + +31 +rc +; + +32 +mosqu�to + * +mosq +; + +34 +p�t + = + `�oi +( +�gv +[1]); + +36 + `mosqu�to_lib_�� +(); + +38 +mosq + = + `mosqu�to_�w +("publish-qos0-��", +�ue +, +NULL +); + +39 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +40 + `mosqu�to_publish_��back_�t +( +mosq +, +�_publish +); + +42 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +44 +run + == -1){ + +45 +rc + = + `mosqu�to_lo� +( +mosq +, -1, 1); + +48 + `mosqu�to_lib_��nup +(); + +49 +run +; + +50 + } +} + + @test/lib/c/03-request-response-1.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +6 + ~<mq�_��oc�.h +> + +8 + grun + = -1; + +9 + g��_mid + = -1; + +11 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +13 if( +rc +){ + +14 + `ex� +(1); + +16 + `mosqu�to_subs�ibe +( +mosq +, +NULL +, "response/topic", 0); + +18 + } +} + +20 + $�_subs�ibe +( +mosqu�to + * +mosq +, * +obj +, +mid +, +qos_cou� +, cڡ * +g��ed_qos +) + +22 +mosqu�to_�ݔty + * +��s + = +NULL +; + +23 + `mosqu�to_�ݔty_add_�r�g +(& +��s +, +MQTT_PROP_RESPONSE_TOPIC +, "response/topic"); + +24 + `mosqu�to_publish_v5 +( +mosq +, +NULL +, "�que�/t�ic", 6, "a�i�", 0, 0, +��s +); + +25 + `mosqu�to_�ݔty_�_�l +(& +��s +); + +26 + } +} + +28 + $�_mes�ge +( +mosqu�to + * +mosq +, * +obj +, cڡ +mosqu�to_mes�ge + * +msg +) + +30 if(! + `�rcmp +( +msg +-> +�yl�d +, "a�esponse")){ + +31 +run + = 0; + +33 +run + = 1; + +35 + } +} + +37 + $ma� +( +�gc +, * +�gv +[]) + +39 +rc +; + +40 +mosqu�to + * +mosq +; + +41 +v� + = +PROTOCOL_VERSION_v5 +; + +43 +p�t + = + `�oi +( +�gv +[1]); + +45 + `mosqu�to_lib_�� +(); + +47 +mosq + = + `mosqu�to_�w +("�que�-��", +�ue +, +NULL +); + +48 + `mosqu�to_�ts_�t +( +mosq +, +MOSQ_OPT_PROTOCOL_VERSION +, & +v� +); + +49 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +50 + `mosqu�to_subs�ibe_��back_�t +( +mosq +, +�_subs�ibe +); + +51 + `mosqu�to_mes�ge_��back_�t +( +mosq +, +�_mes�ge +); + +53 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +55 +run + == -1){ + +56 +rc + = + `mosqu�to_lo� +( +mosq +, -1, 1); + +59 + `mosqu�to_lib_��nup +(); + +60 +run +; + +61 + } +} + + @test/lib/c/03-request-response-2.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +6 + ~<mq�_��oc�.h +> + +8 + grun + = -1; + +9 + g��_mid + = -1; + +11 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +13 if( +rc +){ + +14 + `ex� +(1); + +16 + `mosqu�to_subs�ibe +( +mosq +, +NULL +, "request/topic", 0); + +18 + } +} + +20 + $�_mes�ge_v5 +( +mosqu�to + * +mosq +, * +obj +, cڡ +mosqu�to_mes�ge + * +msg +, cڡ +mosqu�to_�ݔty + * +��s +) + +22 cڡ +mosqu�to_�ݔty + * +p_�� +, * +p_c�r + = +NULL +; + +23 * +��_t�ic + = +NULL +; + +24 +rc +; + +26 if(! + `�rcmp +( +msg +-> +t�ic +, "request/topic")){ + +27 +p_�� + = + `mosqu�to_�ݔty_�ad_�r�g +( +��s +, +MQTT_PROP_RESPONSE_TOPIC +, & +��_t�ic +, +�l� +); + +28 if( +p_�� +){ + +29 +p_c�r + = + `mosqu�to_�ݔty_�ad_b��y +( +��s +, +MQTT_PROP_CORRELATION_DATA +, +NULL +, NULL, +�l� +); + +30 +rc + = + `mosqu�to_publish_v5 +( +mosq +, +NULL +, +��_t�ic +, + `��� +("���ڣ"), "���ڣ", 0, +�l� +, +p_c�r +); + +31 + `� +( +��_t�ic +); + +34 + } +} + +36 + $�_publish +( +mosqu�to + * +mosq +, * +obj +, +mid +) + +38 +run + = 0; + +39 + } +} + +42 + $ma� +( +�gc +, * +�gv +[]) + +44 +rc +; + +45 +mosqu�to + * +mosq +; + +46 +v� + = +PROTOCOL_VERSION_v5 +; + +48 +p�t + = + `�oi +( +�gv +[1]); + +50 + `mosqu�to_lib_�� +(); + +52 +mosq + = + `mosqu�to_�w +("��ڣ-��", +�ue +, +NULL +); + +53 + `mosqu�to_�ts_�t +( +mosq +, +MOSQ_OPT_PROTOCOL_VERSION +, & +v� +); + +54 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +55 + `mosqu�to_publish_��back_�t +( +mosq +, +�_publish +); + +56 + `mosqu�to_mes�ge_v5_��back_�t +( +mosq +, +�_mes�ge_v5 +); + +58 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +60 +run + == -1){ + +61 +rc + = + `mosqu�to_lo� +( +mosq +, -1, 1); + +64 + `mosqu�to_lib_��nup +(); + +65 +run +; + +66 + } +} + + @test/lib/c/03-request-response-correlation-1.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +6 + ~<mq�_��oc�.h +> + +8 + grun + = -1; + +9 + g��_mid + = -1; + +11 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +13 if( +rc +){ + +14 + `ex� +(1); + +16 + `mosqu�to_subs�ibe +( +mosq +, +NULL +, "response/topic", 0); + +18 + } +} + +20 + $�_subs�ibe +( +mosqu�to + * +mosq +, * +obj +, +mid +, +qos_cou� +, cڡ * +g��ed_qos +) + +22 +mosqu�to_�ݔty + * +��s + = +NULL +; + +23 + `mosqu�to_�ݔty_add_�r�g +(& +��s +, +MQTT_PROP_RESPONSE_TOPIC +, "response/topic"); + +24 + `mosqu�to_�ݔty_add_b��y +(& +��s +, +MQTT_PROP_CORRELATION_DATA +, "corridor", 8); + +25 + `mosqu�to_publish_v5 +( +mosq +, +NULL +, "�que�/t�ic", 6, "a�i�", 0, 0, +��s +); + +26 + `mosqu�to_�ݔty_�_�l +(& +��s +); + +27 + } +} + +29 + $�_mes�ge +( +mosqu�to + * +mosq +, * +obj +, cڡ +mosqu�to_mes�ge + * +msg +) + +31 if(! + `�rcmp +( +msg +-> +�yl�d +, "a�esponse")){ + +32 +run + = 0; + +34 +run + = 1; + +36 + } +} + +38 + $ma� +( +�gc +, * +�gv +[]) + +40 +rc +; + +41 +mosqu�to + * +mosq +; + +42 +v� + = +PROTOCOL_VERSION_v5 +; + +44 +p�t + = + `�oi +( +�gv +[1]); + +46 + `mosqu�to_lib_�� +(); + +48 +mosq + = + `mosqu�to_�w +("�que�-��", +�ue +, +NULL +); + +49 + `mosqu�to_�ts_�t +( +mosq +, +MOSQ_OPT_PROTOCOL_VERSION +, & +v� +); + +50 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +51 + `mosqu�to_subs�ibe_��back_�t +( +mosq +, +�_subs�ibe +); + +52 + `mosqu�to_mes�ge_��back_�t +( +mosq +, +�_mes�ge +); + +54 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +56 +run + == -1){ + +57 +rc + = + `mosqu�to_lo� +( +mosq +, -1, 1); + +60 + `mosqu�to_lib_��nup +(); + +61 +run +; + +62 + } +} + + @test/lib/c/04-retain-qos0.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +9 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +11 if( +rc +){ + +12 + `ex� +(1); + +14 + `mosqu�to_publish +( +mosq +, +NULL +, "���/qos0/��", + `��� +("���ed mes�ge"), "���ed mes�ge", 0, +�ue +); + +16 + } +} + +18 + $ma� +( +�gc +, * +�gv +[]) + +20 +rc +; + +21 +mosqu�to + * +mosq +; + +23 +p�t + = + `�oi +( +�gv +[1]); + +25 + `mosqu�to_lib_�� +(); + +27 +mosq + = + `mosqu�to_�w +("���-qos0-��", +�ue +, +NULL +); + +28 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +30 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +32 +run + == -1){ + +33 + `mosqu�to_lo� +( +mosq +, -1, 1); + +36 + `mosqu�to_lib_��nup +(); + +37 +run +; + +38 + } +} + + @test/lib/c/08-ssl-bad-cacert.c + +1 + ~<��o.h +> + +2 + ~<�dbo�.h +> + +3 + ~<�dio.h +> + +4 + ~<�dlib.h +> + +5 + ~<mosqu�to.h +> + +7 + $ma� +( +�gc +, * +�gv +[]) + +9 +rc + = 1; + +10 +mosqu�to + * +mosq +; + +12 + `mosqu�to_lib_�� +(); + +14 +mosq + = + `mosqu�to_�w +("08-s�-bad-���", +�ue +, +NULL +); + +15 if( + `mosqu�to_�s_�t +( +mosq +, "this/f�e/dۢt/exi�", +NULL +, NULL, NULL, NULL�=� +MOSQ_ERR_INVAL +){ + +16 +rc + = 0; + +18 + `mosqu�to_lib_��nup +(); + +19 +rc +; + +20 + } +} + + @test/lib/c/08-ssl-connect-cert-auth-enc.c + +1 + ~<��o.h +> + +2 + ~<�dbo�.h +> + +3 + ~<�dio.h +> + +4 + ~<�dlib.h +> + +5 + ~<�r�g.h +> + +6 + ~<mosqu�to.h +> + +8 + grun + = -1; + +10 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +12 if( +rc +){ + +13 + `ex� +(1); + +15 + `mosqu�to_disc��� +( +mosq +); + +17 + } +} + +19 + $�_disc��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +21 +run + = +rc +; + +22 + } +} + +24 + $�ssw�d_��back +(* +buf +, +size +, +rw�ag +, * +u�rd�a +) + +26 + `���y +( +buf +, "�ssw�d", +size +); + +27 +buf +[ +size +-1] = '\0'; + +29 + `��� +( +buf +); + +30 + } +} + +32 + $ma� +( +�gc +, * +�gv +[]) + +34 +rc +; + +35 +mosqu�to + * +mosq +; + +37 +p�t + = + `�oi +( +�gv +[1]); + +39 + `mosqu�to_lib_�� +(); + +41 +mosq + = + `mosqu�to_�w +("08-s�-c���-�t-auth-�c", +�ue +, +NULL +); + +42 + `mosqu�to_�s_�t +( +mosq +, "../s�/��-ro�-�.�t", "../s�/��s", "../s�/���-��y�ed.�t", "../s�/���-��y�ed.key", +�ssw�d_��back +); + +43 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +44 + `mosqu�to_disc���_��back_�t +( +mosq +, +�_disc��� +); + +46 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +48 +run + == -1){ + +49 + `mosqu�to_lo� +( +mosq +, -1, 1); + +52 + `mosqu�to_lib_��nup +(); + +53 +run +; + +54 + } +} + + @test/lib/c/08-ssl-connect-cert-auth.c + +1 + ~<��o.h +> + +2 + ~<�dbo�.h +> + +3 + ~<�dio.h +> + +4 + ~<�dlib.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +9 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +11 if( +rc +){ + +12 + `ex� +(1); + +14 + `mosqu�to_disc��� +( +mosq +); + +16 + } +} + +18 + $�_disc��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +20 +run + = +rc +; + +21 + } +} + +23 + $ma� +( +�gc +, * +�gv +[]) + +25 +rc +; + +26 +mosqu�to + * +mosq +; + +28 +p�t + = + `�oi +( +�gv +[1]); + +30 + `mosqu�to_lib_�� +(); + +32 +mosq + = + `mosqu�to_�w +("08-s�-c���-�t-auth", +�ue +, +NULL +); + +33 + `mosqu�to_�s_�t +( +mosq +, "../s�/��-ro�-�.�t", "../s�/��s", "../s�/���.�t", "../s�/���.key", +NULL +); + +34 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +35 + `mosqu�to_disc���_��back_�t +( +mosq +, +�_disc��� +); + +37 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +39 +run + == -1){ + +40 + `mosqu�to_lo� +( +mosq +, -1, 1); + +43 + `mosqu�to_lib_��nup +(); + +44 +run +; + +45 + } +} + + @test/lib/c/08-ssl-connect-no-auth.c + +1 + ~<��o.h +> + +2 + ~<�dbo�.h +> + +3 + ~<�dio.h +> + +4 + ~<�dlib.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +9 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +11 if( +rc +){ + +12 + `ex� +(1); + +14 + `mosqu�to_disc��� +( +mosq +); + +16 + } +} + +18 + $�_disc��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +20 +run + = +rc +; + +21 + } +} + +23 + $ma� +( +�gc +, * +�gv +[]) + +25 +rc +; + +26 +mosqu�to + * +mosq +; + +28 +p�t + = + `�oi +( +�gv +[1]); + +30 + `mosqu�to_lib_�� +(); + +32 +mosq + = + `mosqu�to_�w +("08-s�-c���-no-auth", +�ue +, +NULL +); + +33 + `mosqu�to_�s_�t +( +mosq +, "../s�/�l-�.�t", +NULL +, NULL, NULL, NULL); + +34 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +35 + `mosqu�to_disc���_��back_�t +( +mosq +, +�_disc��� +); + +37 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +39 +run + == -1){ + +40 + `mosqu�to_lo� +( +mosq +, -1, 1); + +43 + `mosqu�to_lib_��nup +(); + +44 +run +; + +45 + } +} + + @test/lib/c/08-ssl-fake-cacert.c + +1 + ~<��o.h +> + +2 + ~<�dbo�.h +> + +3 + ~<�dio.h +> + +4 + ~<�dlib.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +9 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +11 + `ex� +(1); + +12 + } +} + +14 + $ma� +( +�gc +, * +�gv +[]) + +16 +rc +; + +17 +mosqu�to + * +mosq +; + +19 +p�t + = + `�oi +( +�gv +[1]); + +21 + `mosqu�to_lib_�� +(); + +23 +mosq + = + `mosqu�to_�w +("08-s�-c���-�t-auth", +�ue +, +NULL +); + +24 + `mosqu�to_�s_�t +( +mosq +, "../s�/��-�ke-ro�-�.�t", +NULL +, "../ssl/client.crt", "../ssl/client.key", NULL); + +25 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +27 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +29 +rc + = + `mosqu�to_lo�_f�ev� +( +mosq +, -1, 1); + +30 if( +rc + =� +MOSQ_ERR_ERRNO + && +��o + =� +EPROTO +){ + +35 + } +} + + @test/lib/c/09-util-topic-tokenise.c + +1 + ~<�dio.h +> + +2 + ~<�r�g.h +> + +3 + ~<mosqu�to.h +> + +5 + $��t_�r� +(cڡ * +t�ic +, ** +t�ics +, +t�ic_cou� +) + +7 +i +; + +8 + `��tf +("TOPIC: %s\n", +t�ic +); + +9 + `��tf +("TOKENS: "); + +10 +i +=0; i< +t�ic_cou� +; i++){ + +11 + `��tf +("%s", +t�ics +[ +i +]); + +12 if( +i ++1< +t�ic_cou� +){ + +13 + `��tf +("/"); + +16 + `��tf +("\n"); + +17 + } +} + +19 + $ma� +( +�gc +, * +�gv +[]) + +21 ** +t�ics +; + +22 +t�ic_cou� +; + +23 +bo� + +m�ch +; + +25 if( + `mosqu�to_sub_t�ic_tok�i� +("t�ic", & +t�ics +, & +t�ic_cou� +)){ + +26 + `��tf +("Out of memory.\n"); + +29 if( +t�ic_cou� + !�1 || + `�rcmp +( +t�ics +[0], "topic")){ + +30 + `��t_�r� +("t�ic", +t�ics +, +t�ic_cou� +); + +34 if( + `mosqu�to_sub_t�ic_tok�i� +("a/d�p/t�ic/h��rchy", & +t�ics +, & +t�ic_cou� +)){ + +35 + `��tf +("Out of memory.\n"); + +38 if( +t�ic_cou� + != 4 + +39 || + `�rcmp +( +t�ics +[0], "a") + +40 || + `�rcmp +( +t�ics +[1], "deep") + +41 || + `�rcmp +( +t�ics +[2], "topic") + +42 || + `�rcmp +( +t�ics +[3], "hierarchy")){ + +43 + `��t_�r� +("a/d�p/t�ic/h��rchy", +t�ics +, +t�ic_cou� +); + +47 if( + `mosqu�to_sub_t�ic_tok�i� +("/a/d�p/t�ic/h��rchy", & +t�ics +, & +t�ic_cou� +)){ + +48 + `��tf +("Out of memory.\n"); + +51 if( +t�ic_cou� + != 5 + +52 || +t�ics +[0] + +53 || + `�rcmp +( +t�ics +[1], "a") + +54 || + `�rcmp +( +t�ics +[2], "deep") + +55 || + `�rcmp +( +t�ics +[3], "topic") + +56 || + `�rcmp +( +t�ics +[4], "hierarchy")){ + +57 + `��t_�r� +("/a/d�p/t�ic/h��rchy", +t�ics +, +t�ic_cou� +); + +61 if( + `mosqu�to_sub_t�ic_tok�i� +("a/b/c", & +t�ics +, & +t�ic_cou� +)){ + +62 + `��tf +("Out of memory.\n"); + +65 if( +t�ic_cou� + != 3 + +66 || + `�rcmp +( +t�ics +[0], "a") + +67 || + `�rcmp +( +t�ics +[1], "b") + +68 || + `�rcmp +( +t�ics +[2], "c")){ + +69 + `��t_�r� +("a/b/c", +t�ics +, +t�ic_cou� +); + +73 if( + `mosqu�to_sub_t�ic_tok�i� +("/a/b/c", & +t�ics +, & +t�ic_cou� +)){ + +74 + `��tf +("Out of memory.\n"); + +77 if( +t�ic_cou� + != 4 + +78 || +t�ics +[0] + +79 || + `�rcmp +( +t�ics +[1], "a") + +80 || + `�rcmp +( +t�ics +[2], "b") + +81 || + `�rcmp +( +t�ics +[3], "c")){ + +82 + `��t_�r� +("/a/b/c", +t�ics +, +t�ic_cou� +); + +86 if( + `mosqu�to_sub_t�ic_tok�i� +("a///h��rchy", & +t�ics +, & +t�ic_cou� +)){ + +87 + `��tf +("Out of memory.\n"); + +90 if( +t�ic_cou� + != 4 + +91 || + `�rcmp +( +t�ics +[0], "a") + +92 || +t�ics +[1] + +93 || +t�ics +[2] + +94 || + `�rcmp +( +t�ics +[3], "hierarchy")){ + +95 + `��t_�r� +("a///h��rchy", +t�ics +, +t�ic_cou� +); + +99 if( + `mosqu�to_sub_t�ic_tok�i� +("/a///h��rchy", & +t�ics +, & +t�ic_cou� +)){ + +100 + `��tf +("Out of memory.\n"); + +103 if( +t�ic_cou� + != 5 + +104 || +t�ics +[0] + +105 || + `�rcmp +( +t�ics +[1], "a") + +106 || +t�ics +[2] + +107 || +t�ics +[3] + +108 || + `�rcmp +( +t�ics +[4], "hierarchy")){ + +109 + `��t_�r� +("/a///h��rchy", +t�ics +, +t�ic_cou� +); + +113 if( + `mosqu�to_sub_t�ic_tok�i� +("/a///h��rchy/", & +t�ics +, & +t�ic_cou� +)){ + +114 + `��tf +("Out of memory.\n"); + +117 if( +t�ic_cou� + != 6 + +118 || +t�ics +[0] + +119 || + `�rcmp +( +t�ics +[1], "a") + +120 || +t�ics +[2] + +121 || +t�ics +[3] + +122 || + `�rcmp +( +t�ics +[4], "hierarchy") + +123 || +t�ics +[3]){ + +124 + `��t_�r� +("/a///h��rchy/", +t�ics +, +t�ic_cou� +); + +129 + } +} + + @test/lib/c/11-prop-oversize-packet.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +7 + grun + = -1; + +8 + g��_mid + = -1; + +10 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +12 if( +rc +){ + +13 + `ex� +(1); + +15 +rc + = + `mosqu�to_subs�ibe +( +mosq +, +NULL +, "0123456789012345678901234567890", 0); + +16 if( +rc + !� +MOSQ_ERR_OVERSIZE_PACKET +){ + +17 + `��tf +("Fail on subscribe\n"); + +18 + `ex� +(1); + +21 +rc + = + `mosqu�to_unsubs�ibe +( +mosq +, +NULL +, "0123456789012345678901234567890"); + +22 if( +rc + !� +MOSQ_ERR_OVERSIZE_PACKET +){ + +23 + `��tf +("Fail on unsubscribe\n"); + +24 + `ex� +(1); + +27 +rc + = + `mosqu�to_publish +( +mosq +, & +��_mid +, "pub/��", + `��� +("0123456789012345678"), "0123456789012345678", 0, +�l� +); + +28 if( +rc + !� +MOSQ_ERR_OVERSIZE_PACKET +){ + +29 + `��tf +("Fail on�ublish 1\n"); + +30 + `ex� +(1); + +32 +rc + = + `mosqu�to_publish +( +mosq +, & +��_mid +, "pub/��", + `��� +("012345678901234567"), "012345678901234567", 0, +�l� +); + +33 if( +rc + !� +MOSQ_ERR_SUCCESS +){ + +34 + `��tf +("Fail on�ublish 2\n"); + +35 + `ex� +(1); + +38 + } +} + +40 + $�_publish +( +mosqu�to + * +mosq +, * +obj +, +mid +) + +42 if( +mid + =� +��_mid +){ + +43 + `mosqu�to_disc��� +( +mosq +); + +44 +run + = 0; + +46 + `ex� +(1); + +48 + } +} + +50 + $ma� +( +�gc +, * +�gv +[]) + +52 +rc +; + +53 +mosqu�to + * +mosq +; + +55 +p�t + = + `�oi +( +�gv +[1]); + +57 + `mosqu�to_lib_�� +(); + +59 +mosq + = + `mosqu�to_�w +("publish-qos0-��", +�ue +, +NULL +); + +60 + `mosqu�to_�t_�ti� +( +mosq +, +MOSQ_OPT_PROTOCOL_VERSION +, +MQTT_PROTOCOL_V5 +); + +61 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +62 + `mosqu�to_publish_��back_�t +( +mosq +, +�_publish +); + +64 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +66 +run + == -1){ + +67 +rc + = + `mosqu�to_lo� +( +mosq +, -1, 1); + +70 + `mosqu�to_lib_��nup +(); + +71 +run +; + +72 + } +} + + @test/lib/c/11-prop-send-content-type.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +6 + ~<mq�_��oc�.h +> + +8 + grun + = -1; + +9 + g��_mid + = -1; + +11 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +13 +rc2 +; + +14 +mosqu�to_�ݔty + * +��li� + = +NULL +; + +16 if( +rc +){ + +17 + `ex� +(1); + +19 +rc2 + = + `mosqu�to_�ݔty_add_�r�g +(& +��li� +, +MQTT_PROP_CONTENT_TYPE +, "application/json"); + +20 + `mosqu�to_publish_v5 +( +mosq +, & +��_mid +, "��/qos0", + `��� +("mes�ge"), "mes�ge", 0, +�l� +, +��li� +); + +22 + } +} + +24 + $�_publish +( +mosqu�to + * +mosq +, * +obj +, +mid +) + +26 if( +mid + =� +��_mid +){ + +27 + `mosqu�to_disc��� +( +mosq +); + +28 +run + = 0; + +30 + `ex� +(1); + +32 + } +} + +34 + $ma� +( +�gc +, * +�gv +[]) + +36 +rc +; + +37 +tmp +; + +38 +mosqu�to + * +mosq +; + +40 +p�t + = + `�oi +( +�gv +[1]); + +42 + `mosqu�to_lib_�� +(); + +44 +mosq + = + `mosqu�to_�w +("��-��", +�ue +, +NULL +); + +45 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +46 + `mosqu�to_publish_��back_�t +( +mosq +, +�_publish +); + +47 +tmp + = +MQTT_PROTOCOL_V5 +; + +48 + `mosqu�to_�ts_�t +( +mosq +, +MOSQ_OPT_PROTOCOL_VERSION +, & +tmp +); + +50 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +52 +run + == -1){ + +53 +rc + = + `mosqu�to_lo� +( +mosq +, -1, 1); + +56 + `mosqu�to_lib_��nup +(); + +57 +run +; + +58 + } +} + + @test/lib/c/11-prop-send-payload-format.c + +1 + ~<�dbo�.h +> + +2 + ~<�dio.h +> + +3 + ~<�dlib.h +> + +4 + ~<�r�g.h +> + +5 + ~<mosqu�to.h +> + +6 + ~<mq�_��oc�.h +> + +8 + grun + = -1; + +9 + g��_mid + = -1; + +11 + $�_c��� +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +13 +rc2 +; + +14 +mosqu�to_�ݔty + * +��li� + = +NULL +; + +16 if( +rc +){ + +17 + `ex� +(1); + +19 +rc2 + = + `mosqu�to_�ݔty_add_by� +(& +��li� +, +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +, 1); + +20 + `mosqu�to_publish_v5 +( +mosq +, & +��_mid +, "��/qos0", + `��� +("mes�ge"), "mes�ge", 0, +�l� +, +��li� +); + +22 + } +} + +24 + $�_publish +( +mosqu�to + * +mosq +, * +obj +, +mid +) + +26 if( +mid + =� +��_mid +){ + +27 + `mosqu�to_disc��� +( +mosq +); + +28 +run + = 0; + +30 + `ex� +(1); + +32 + } +} + +34 + $ma� +( +�gc +, * +�gv +[]) + +36 +rc +; + +37 +tmp +; + +38 +mosqu�to + * +mosq +; + +40 +p�t + = + `�oi +( +�gv +[1]); + +42 + `mosqu�to_lib_�� +(); + +44 +mosq + = + `mosqu�to_�w +("��-��", +�ue +, +NULL +); + +45 + `mosqu�to_c���_��back_�t +( +mosq +, +�_c��� +); + +46 + `mosqu�to_publish_��back_�t +( +mosq +, +�_publish +); + +47 +tmp + = +MQTT_PROTOCOL_V5 +; + +48 + `mosqu�to_�ts_�t +( +mosq +, +MOSQ_OPT_PROTOCOL_VERSION +, & +tmp +); + +50 +rc + = + `mosqu�to_c��� +( +mosq +, "lo�lho�", +p�t +, 60); + +52 +run + == -1){ + +53 +rc + = + `mosqu�to_lo� +( +mosq +, -1, 1); + +56 + `mosqu�to_lib_��nup +(); + +57 +run +; + +58 + } +} + + @test/lib/cpp/01-con-discon-success.cpp + +4 + ~<mosqu�t�p.h +> + +6 + grun + = -1; + +8 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +10 +public +: + +11 +mosqu�t�p_�� +(cڡ * +id +); + +13 +�_c��� +( +rc +); + +14 +�_disc��� +( +rc +); + +17 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +19 + } +} + +21 +mosqu�t�p_�� +:: + $�_c��� +( +rc +) + +23 if( +rc +){ + +24 + `ex� +(1); + +26 + `disc��� +(); + +28 + } +} + +30 + gmosqu�t�p_�� +:: + $�_disc��� +( +rc +) + +32 +run + = +rc +; + +33 + } +} + +36 + $ma� +( +�gc +, * +�gv +[]) + +38 +mosqu�t�p_�� + * +mosq +; + +40 +p�t + = + `�oi +( +�gv +[1]); + +42 +mosq� +:: + `lib_�� +(); + +44 +mosq + = +�w + + `mosqu�t�p_�� +("01-con-discon-success"); + +46 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +48 +run + == -1){ + +49 +mosq +-> + `lo� +(); + +52 +mosq� +:: + `lib_��nup +(); + +54 +run +; + +55 + } +} + + @test/lib/cpp/01-keepalive-pingreq.cpp + +1 + ~<mosqu�t�p.h +> + +3 + grun + = -1; + +5 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +7 +public +: + +8 +mosqu�t�p_�� +(cڡ * +id +); + +10 +�_c��� +( +rc +); + +13 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +15 + } +} + +17 +mosqu�t�p_�� +:: + $�_c��� +( +rc +) + +19 if( +rc +){ + +20 + `ex� +(1); + +22 + } +} + +24 + $ma� +( +�gc +, * +�gv +[]) + +26 +mosqu�t�p_�� + * +mosq +; + +28 +p�t + = + `�oi +( +�gv +[1]); + +30 +mosq� +:: + `lib_�� +(); + +32 +mosq + = +�w + + `mosqu�t�p_�� +("01-keepalive-pingreq"); + +34 +mosq +-> + `c��� +("lo�lho�", +p�t +, 4); + +36 +run + == -1){ + +37 +mosq +-> + `lo� +(); + +40 +mosq� +:: + `lib_��nup +(); + +42 +run +; + +43 + } +} + + @test/lib/cpp/01-no-clean-session.cpp + +1 + ~<c�r�g +> + +2 + ~<mosqu�t�p.h +> + +4 + grun + = -1; + +6 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +8 +public +: + +9 +mosqu�t�p_�� +(cڡ * +id +, +bo� + +��n_�ssi� +); + +12 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +, +bo� + +��n_�ssi� +�: +mosq� +:: + $mosqu�t�p +( +id +, +��n_�ssi� +) + +14 + } +} + +16 + $ma� +( +�gc +, * +�gv +[]) + +18 +mosqu�t�p_�� + * +mosq +; + +20 +p�t + = + `�oi +( +�gv +[1]); + +22 +mosq� +:: + `lib_�� +(); + +24 +mosq + = +�w + + `mosqu�t�p_�� +("01-no-��n-�ssi�", +�l� +); + +26 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +28 +run + == -1){ + +29 +mosq +-> + `lo� +(); + +32 +mosq� +:: + `lib_��nup +(); + +34 +run +; + +35 + } +} + + @test/lib/cpp/01-unpwd-set.cpp + +1 + ~<c�r�g +> + +2 + ~<mosqu�t�p.h +> + +4 + grun + = -1; + +6 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +8 +public +: + +9 +mosqu�t�p_�� +(cڡ * +id +); + +12 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +14 + } +} + +16 + $ma� +( +�gc +, * +�gv +[]) + +18 +mosqu�t�p_�� + * +mosq +; + +20 +p�t + = + `�oi +( +�gv +[1]); + +22 +mosq� +:: + `lib_�� +(); + +24 +mosq + = +�w + + `mosqu�t�p_�� +("01-unpwd-set"); + +25 +mosq +-> + `u��ame_pw_�t +("uname", ";'[08gn=#"); + +27 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +29 +run + == -1){ + +30 +mosq +-> + `lo� +(); + +33 +mosq� +:: + `lib_��nup +(); + +35 +run +; + +36 + } +} + + @test/lib/cpp/01-will-set.cpp + +4 + ~<c�r�g +> + +5 + ~<mosqu�t�p.h +> + +7 + grun + = -1; + +9 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +11 +public +: + +12 +mosqu�t�p_�� +(cڡ * +id +); + +15 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +17 + } +} + +19 + $ma� +( +�gc +, * +�gv +[]) + +21 +mosqu�t�p_�� + * +mosq +; + +23 +p�t + = + `�oi +( +�gv +[1]); + +25 +mosq� +:: + `lib_�� +(); + +27 +mosq + = +�w + + `mosqu�t�p_�� +("01-will-set"); + +28 +mosq +-> + `w�l_�t +("t�ic/�/u�x��ed/disc���", + `��� +("w��mes�ge"), "w��mes�ge", 1, +�ue +); + +30 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +32 +run + == -1){ + +33 +mosq +-> + `lo� +(); + +36 +mosq� +:: + `lib_��nup +(); + +38 +run +; + +39 + } +} + + @test/lib/cpp/01-will-unpwd-set.cpp + +1 + ~<c�r�g +> + +2 + ~<mosqu�t�p.h +> + +4 + grun + = -1; + +6 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +8 +public +: + +9 +mosqu�t�p_�� +(cڡ * +id +); + +12 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +14 + } +} + +16 + $ma� +( +�gc +, * +�gv +[]) + +18 +mosqu�t�p_�� + * +mosq +; + +20 +p�t + = + `�oi +( +�gv +[1]); + +22 +mosq� +:: + `lib_�� +(); + +24 +mosq + = +�w + + `mosqu�t�p_�� +("01-will-unpwd-set"); + +25 +mosq +-> + `u��ame_pw_�t +("oibvvwqw", "#'^2hg9a&nm38*us"); + +26 +mosq +-> + `w�l_�t +("w�l-t�ic", + `��� +("w��mes�ge"), "w��mes�ge", 2, +�l� +); + +28 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +30 +run + == -1){ + +31 +mosq +-> + `lo� +(); + +34 +mosq� +:: + `lib_��nup +(); + +36 +run +; + +37 + } +} + + @test/lib/cpp/02-subscribe-qos0.cpp + +1 + ~<mosqu�t�p.h +> + +3 + grun + = -1; + +5 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +7 +public +: + +8 +mosqu�t�p_�� +(cڡ * +id +); + +10 +�_c��� +( +rc +); + +11 +�_disc��� +( +rc +); + +12 +�_subs�ibe +( +mid +, +qos_cou� +, cڡ * +g��ed_qos +); + +15 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +17 + } +} + +19 +mosqu�t�p_�� +:: + $�_c��� +( +rc +) + +21 if( +rc +){ + +22 + `ex� +(1); + +24 + `subs�ibe +( +NULL +, "qos0/test", 0); + +26 + } +} + +28 + gmosqu�t�p_�� +:: + $�_disc��� +( +rc +) + +30 +run + = +rc +; + +31 + } +} + +33 + gmosqu�t�p_�� +:: + $�_subs�ibe +( +mid +, +qos_cou� +, cڡ * +g��ed_qos +) + +35 + `disc��� +(); + +36 + } +} + +38 + $ma� +( +�gc +, * +�gv +[]) + +40 +mosqu�t�p_�� + * +mosq +; + +42 +p�t + = + `�oi +( +�gv +[1]); + +44 +mosq� +:: + `lib_�� +(); + +46 +mosq + = +�w + + `mosqu�t�p_�� +("subscribe-qos0-test"); + +48 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +50 +run + == -1){ + +51 +mosq +-> + `lo� +(); + +54 +mosq� +:: + `lib_��nup +(); + +56 +run +; + +57 + } +} + + @test/lib/cpp/02-subscribe-qos1.cpp + +1 + ~<mosqu�t�p.h +> + +3 + grun + = -1; + +5 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +7 +public +: + +8 +mosqu�t�p_�� +(cڡ * +id +); + +10 +�_c��� +( +rc +); + +11 +�_disc��� +( +rc +); + +12 +�_subs�ibe +( +mid +, +qos_cou� +, cڡ * +g��ed_qos +); + +15 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +17 + } +} + +19 +mosqu�t�p_�� +:: + $�_c��� +( +rc +) + +21 if( +rc +){ + +22 + `ex� +(1); + +24 + `subs�ibe +( +NULL +, "qos1/test", 1); + +26 + } +} + +28 + gmosqu�t�p_�� +:: + $�_disc��� +( +rc +) + +30 +run + = +rc +; + +31 + } +} + +33 + gmosqu�t�p_�� +:: + $�_subs�ibe +( +mid +, +qos_cou� +, cڡ * +g��ed_qos +) + +35 + `disc��� +(); + +36 + } +} + +39 + $ma� +( +�gc +, * +�gv +[]) + +41 +mosqu�t�p_�� + * +mosq +; + +43 +p�t + = + `�oi +( +�gv +[1]); + +45 +mosq� +:: + `lib_�� +(); + +47 +mosq + = +�w + + `mosqu�t�p_�� +("subscribe-qos1-test"); + +49 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +51 +run + == -1){ + +52 +mosq +-> + `lo� +(); + +55 +mosq� +:: + `lib_��nup +(); + +57 +run +; + +58 + } +} + + @test/lib/cpp/02-subscribe-qos2.cpp + +1 + ~<mosqu�t�p.h +> + +3 + grun + = -1; + +5 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +7 +public +: + +8 +mosqu�t�p_�� +(cڡ * +id +); + +10 +�_c��� +( +rc +); + +11 +�_disc��� +( +rc +); + +12 +�_subs�ibe +( +mid +, +qos_cou� +, cڡ * +g��ed_qos +); + +15 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +17 + } +} + +19 +mosqu�t�p_�� +:: + $�_c��� +( +rc +) + +21 if( +rc +){ + +22 + `ex� +(1); + +24 + `subs�ibe +( +NULL +, "qos2/test", 2); + +26 + } +} + +28 + gmosqu�t�p_�� +:: + $�_disc��� +( +rc +) + +30 +run + = +rc +; + +31 + } +} + +33 + gmosqu�t�p_�� +:: + $�_subs�ibe +( +mid +, +qos_cou� +, cڡ * +g��ed_qos +) + +35 + `disc��� +(); + +36 + } +} + +39 + $ma� +( +�gc +, * +�gv +[]) + +41 +mosqu�t�p_�� + * +mosq +; + +43 +p�t + = + `�oi +( +�gv +[1]); + +45 +mosq� +:: + `lib_�� +(); + +47 +mosq + = +�w + + `mosqu�t�p_�� +("subscribe-qos2-test"); + +49 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +51 +run + == -1){ + +52 +mosq +-> + `lo� +(); + +55 +mosq� +:: + `lib_��nup +(); + +57 +run +; + +58 + } +} + + @test/lib/cpp/02-unsubscribe.cpp + +1 + ~<mosqu�t�p.h +> + +3 + grun + = -1; + +5 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +7 +public +: + +8 +mosqu�t�p_�� +(cڡ * +id +); + +10 +�_c��� +( +rc +); + +11 +�_disc��� +( +rc +); + +12 +�_unsubs�ibe +( +mid +); + +15 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +17 + } +} + +19 +mosqu�t�p_�� +:: + $�_c��� +( +rc +) + +21 if( +rc +){ + +22 + `ex� +(1); + +24 + `unsubs�ibe +( +NULL +, "unsubscribe/test"); + +26 + } +} + +28 + gmosqu�t�p_�� +:: + $�_disc��� +( +rc +) + +30 +run + = +rc +; + +31 + } +} + +33 + gmosqu�t�p_�� +:: + $�_unsubs�ibe +( +mid +) + +35 + `disc��� +(); + +36 + } +} + +38 + $ma� +( +�gc +, * +�gv +[]) + +40 +mosqu�t�p_�� + * +mosq +; + +42 +p�t + = + `�oi +( +�gv +[1]); + +44 +mosq� +:: + `lib_�� +(); + +46 +mosq + = +�w + + `mosqu�t�p_�� +("unsubscribe-test"); + +48 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +50 +run + == -1){ + +51 +mosq +-> + `lo� +(); + +54 +mosq� +:: + `lib_��nup +(); + +56 +run +; + +57 + } +} + + @test/lib/cpp/03-publish-b2c-qos1.cpp + +1 + ~<c�dio +> + +2 + ~<c�dlib +> + +3 + ~<c�r�g +> + +5 + ~<mosqu�t�p.h +> + +7 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +9 +public +: + +10 +mosqu�t�p_�� +(cڡ * +id +); + +12 +�_c��� +( +rc +); + +13 +�_mes�ge +(cڡ +mosqu�to_mes�ge + * +msg +); + +16 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +18 + } +} + +20 +mosqu�t�p_�� +:: + $�_c��� +( +rc +) + +22 if( +rc +){ + +23 + `ex� +(1); + +25 + } +} + +27 + gmosqu�t�p_�� +:: + $�_mes�ge +(cڡ +mosqu�to_mes�ge + * +msg +) + +29 if( +msg +-> +mid + != 123){ + +30 + `��tf +("Inv�id mid (%d)\n", +msg +-> +mid +); + +31 + `ex� +(1); + +33 if( +msg +-> +qos + != 1){ + +34 + `��tf +("Inv�id qo�(%d)\n", +msg +-> +qos +); + +35 + `ex� +(1); + +37 if( + `�rcmp +( +msg +-> +t�ic +, "pub/qos1/receive")){ + +38 + `��tf +("Inv�id��i�(%s)\n", +msg +-> +t�ic +); + +39 + `ex� +(1); + +41 if( + `�rcmp +((*) +msg +-> +�yl�d +, "message")){ + +42 + `��tf +("Inv�id�ayl�d (%s)\n", (*) +msg +-> +�yl�d +); + +43 + `ex� +(1); + +45 if( +msg +-> +�yl�d�n + != 7){ + +46 + `��tf +("Inv�id�ayl�d��(%d)\n", +msg +-> +�yl�d�n +); + +47 + `ex� +(1); + +49 if( +msg +-> +��� + !� +�l� +){ + +50 + `��tf +("Inv�id��a� (%d)\n", +msg +-> +��� +); + +51 + `ex� +(1); + +54 + `ex� +(0); + +55 + } +} + +57 + $ma� +( +�gc +, * +�gv +[]) + +59 +mosqu�t�p_�� + * +mosq +; + +61 +p�t + = + `�oi +( +�gv +[1]); + +63 +mosq� +:: + `lib_�� +(); + +65 +mosq + = +�w + + `mosqu�t�p_�� +("publish-qos1-test"); + +66 +mosq +-> + `mes�ge_��y_�t +(3); + +68 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +71 +mosq +-> + `lo� +(); + +74 +mosq� +:: + `lib_��nup +(); + +77 + } +} + + @test/lib/cpp/03-publish-b2c-qos2.cpp + +1 + ~<c�dio +> + +2 + ~<c�dlib +> + +3 + ~<c�r�g +> + +5 + ~<mosqu�t�p.h +> + +7 + grun + = -1; + +9 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +11 +public +: + +12 +mosqu�t�p_�� +(cڡ * +id +); + +14 +�_c��� +( +rc +); + +15 +�_mes�ge +(cڡ +mosqu�to_mes�ge + * +msg +); + +18 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +20 + } +} + +22 +mosqu�t�p_�� +:: + $�_c��� +( +rc +) + +24 if( +rc +){ + +25 + `ex� +(1); + +27 + } +} + +29 + gmosqu�t�p_�� +:: + $�_mes�ge +(cڡ +mosqu�to_mes�ge + * +msg +) + +31 if( +msg +-> +mid + != 13423){ + +32 + `��tf +("Inv�id mid (%d)\n", +msg +-> +mid +); + +33 + `ex� +(1); + +35 if( +msg +-> +qos + != 2){ + +36 + `��tf +("Inv�id qo�(%d)\n", +msg +-> +qos +); + +37 + `ex� +(1); + +39 if( + `�rcmp +( +msg +-> +t�ic +, "pub/qos2/receive")){ + +40 + `��tf +("Inv�id��i�(%s)\n", +msg +-> +t�ic +); + +41 + `ex� +(1); + +43 if( + `�rcmp +((*) +msg +-> +�yl�d +, "message")){ + +44 + `��tf +("Inv�id�ayl�d (%s)\n", (*) +msg +-> +�yl�d +); + +45 + `ex� +(1); + +47 if( +msg +-> +�yl�d�n + != 7){ + +48 + `��tf +("Inv�id�ayl�d��(%d)\n", +msg +-> +�yl�d�n +); + +49 + `ex� +(1); + +51 if( +msg +-> +��� + !� +�l� +){ + +52 + `��tf +("Inv�id��a� (%d)\n", +msg +-> +��� +); + +53 + `ex� +(1); + +56 +run + = 0; + +57 + } +} + +59 + $ma� +( +�gc +, * +�gv +[]) + +61 +mosqu�t�p_�� + * +mosq +; + +63 +p�t + = + `�oi +( +�gv +[1]); + +65 +mosq� +:: + `lib_�� +(); + +67 +mosq + = +�w + + `mosqu�t�p_�� +("publish-qos2-test"); + +68 +mosq +-> + `mes�ge_��y_�t +(3); + +70 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +72 +run + == -1){ + +73 +mosq +-> + `lo� +(); + +76 +mosq� +:: + `lib_��nup +(); + +78 +run +; + +79 + } +} + + @test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp + +1 + ~<c�dlib +> + +2 + ~<c�r�g +> + +4 + ~<mosqu�t�p.h +> + +6 + grun + = -1; + +7 + gf��_c���i� + = 1; + +9 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +11 +public +: + +12 +mosqu�t�p_�� +(cڡ * +id +); + +14 +�_c��� +( +rc +); + +15 +�_disc��� +( +rc +); + +16 +�_publish +( +mid +); + +19 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +21 + } +} + +23 +mosqu�t�p_�� +:: + $�_c��� +( +rc +) + +25 if( +rc +){ + +26 + `ex� +(1); + +28 if( +f��_c���i� + == 1){ + +29 + `publish +( +NULL +, "pub/qos1/��", + `��� +("mes�ge"), "mes�ge", 1, +�l� +); + +30 +f��_c���i� + = 0; + +33 + } +} + +35 + gmosqu�t�p_�� +:: + $�_disc��� +( +rc +) + +37 if( +rc +){ + +38 + `�c��� +(); + +40 +run + = 0; + +42 + } +} + +44 + gmosqu�t�p_�� +:: + $�_publish +( +mid +) + +46 + `disc��� +(); + +47 + } +} + +49 + $ma� +( +�gc +, * +�gv +[]) + +51 +mosqu�t�p_�� + * +mosq +; + +53 +p�t + = + `�oi +( +�gv +[1]); + +55 +mosq� +:: + `lib_�� +(); + +57 +mosq + = +�w + + `mosqu�t�p_�� +("publish-qos1-test"); + +58 +mosq +-> + `mes�ge_��y_�t +(3); + +60 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +62 +run + == -1){ + +63 +mosq +-> + `lo� +(); + +66 +mosq� +:: + `lib_��nup +(); + +68 +run +; + +69 + } +} + + @test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp + +1 + ~<c�dlib +> + +2 + ~<c�r�g +> + +4 + ~<mosqu�t�p.h +> + +6 + grun + = -1; + +7 + gf��_c���i� + = 1; + +9 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +11 +public +: + +12 +mosqu�t�p_�� +(cڡ * +id +); + +14 +�_c��� +( +rc +); + +15 +�_disc��� +( +rc +); + +16 +�_publish +( +mid +); + +19 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +21 + } +} + +23 +mosqu�t�p_�� +:: + $�_c��� +( +rc +) + +25 if( +rc +){ + +26 + `ex� +(1); + +28 if( +f��_c���i� + == 1){ + +29 + `publish +( +NULL +, "pub/qos2/��", + `��� +("mes�ge"), "mes�ge", 2, +�l� +); + +30 +f��_c���i� + = 0; + +33 + } +} + +35 + gmosqu�t�p_�� +:: + $�_disc��� +( +rc +) + +37 if( +rc +){ + +38 + `�c��� +(); + +40 +run + = 0; + +42 + } +} + +44 + gmosqu�t�p_�� +:: + $�_publish +( +mid +) + +46 + `disc��� +(); + +47 + } +} + +49 + $ma� +( +�gc +, * +�gv +[]) + +51 +mosqu�t�p_�� + * +mosq +; + +53 +p�t + = + `�oi +( +�gv +[1]); + +55 +mosq� +:: + `lib_�� +(); + +57 +mosq + = +�w + + `mosqu�t�p_�� +("publish-qos2-test"); + +58 +mosq +-> + `mes�ge_��y_�t +(3); + +60 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +62 +run + == -1){ + +63 +mosq +-> + `lo� +(); + +66 +mosq� +:: + `lib_��nup +(); + +68 +run +; + +69 + } +} + + @test/lib/cpp/03-publish-c2b-qos2.cpp + +1 + ~<c�dlib +> + +2 + ~<c�r�g +> + +4 + ~<mosqu�t�p.h +> + +6 + grun + = -1; + +8 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +10 +public +: + +11 +mosqu�t�p_�� +(cڡ * +id +); + +13 +�_c��� +( +rc +); + +14 +�_disc��� +( +rc +); + +15 +�_publish +( +mid +); + +18 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +20 + } +} + +22 +mosqu�t�p_�� +:: + $�_c��� +( +rc +) + +24 if( +rc +){ + +25 + `ex� +(1); + +27 + `publish +( +NULL +, "pub/qos2/��", + `��� +("mes�ge"), "mes�ge", 2, +�l� +); + +29 + } +} + +31 + gmosqu�t�p_�� +:: + $�_disc��� +( +rc +) + +33 +run + = 0; + +34 + } +} + +36 + gmosqu�t�p_�� +:: + $�_publish +( +mid +) + +38 + `disc��� +(); + +39 + } +} + +41 + $ma� +( +�gc +, * +�gv +[]) + +43 +mosqu�t�p_�� + * +mosq +; + +45 +p�t + = + `�oi +( +�gv +[1]); + +47 +mosq� +:: + `lib_�� +(); + +49 +mosq + = +�w + + `mosqu�t�p_�� +("publish-qos2-test"); + +51 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +53 +run + == -1){ + +54 +mosq +-> + `lo� +(); + +57 +mosq� +:: + `lib_��nup +(); + +59 +run +; + +60 + } +} + + @test/lib/cpp/03-publish-qos0-no-payload.cpp + +1 + ~<c�r�g +> + +3 + ~<mosqu�t�p.h +> + +5 + grun + = -1; + +6 + g��_mid + = -1; + +8 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +10 +public +: + +11 +mosqu�t�p_�� +(cڡ * +id +); + +13 +�_c��� +( +rc +); + +14 +�_publish +( +mid +); + +17 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +19 + } +} + +21 +mosqu�t�p_�� +:: + $�_c��� +( +rc +) + +23 if( +rc +){ + +24 + `ex� +(1); + +26 + `publish +(& +��_mid +, "pub/qos0/no-�yl�d/��", 0, +NULL +, 0, +�l� +); + +28 + } +} + +30 + gmosqu�t�p_�� +:: + $�_publish +( +mid +) + +32 if( +��_mid + =� +mid +){ + +33 + `disc��� +(); + +35 + `ex� +(1); + +37 + } +} + +39 + $ma� +( +�gc +, * +�gv +[]) + +41 +mosqu�t�p_�� + * +mosq +; + +43 +p�t + = + `�oi +( +�gv +[1]); + +45 +mosq� +:: + `lib_�� +(); + +47 +mosq + = +�w + + `mosqu�t�p_�� +("publish-qos0-test-np"); + +49 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +51 +run + == -1){ + +52 +mosq +-> + `lo� +(); + +55 +mosq� +:: + `lib_��nup +(); + +57 +run +; + +58 + } +} + + @test/lib/cpp/03-publish-qos0.cpp + +1 + ~<c�r�g +> + +3 + ~<mosqu�t�p.h +> + +5 + grun + = -1; + +6 + g��_mid + = -1; + +8 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +10 +public +: + +11 +mosqu�t�p_�� +(cڡ * +id +); + +13 +�_c��� +( +rc +); + +14 +�_publish +( +mid +); + +17 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +19 + } +} + +21 +mosqu�t�p_�� +:: + $�_c��� +( +rc +) + +23 if( +rc +){ + +24 + `ex� +(1); + +26 + `publish +(& +��_mid +, "pub/qos0/��", + `��� +("mes�ge"), "mes�ge", 0, +�l� +); + +28 + } +} + +30 + gmosqu�t�p_�� +:: + $�_publish +( +mid +) + +32 if( +��_mid + =� +mid +){ + +33 + `disc��� +(); + +35 + `ex� +(1); + +37 + } +} + +39 + $ma� +( +�gc +, * +�gv +[]) + +41 +mosqu�t�p_�� + * +mosq +; + +43 +p�t + = + `�oi +( +�gv +[1]); + +45 +mosq� +:: + `lib_�� +(); + +47 +mosq + = +�w + + `mosqu�t�p_�� +("publish-qos0-test"); + +49 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +51 +run + == -1){ + +52 +mosq +-> + `lo� +(); + +55 +mosq� +:: + `lib_��nup +(); + +57 +run +; + +58 + } +} + + @test/lib/cpp/04-retain-qos0.cpp + +1 + ~<c�r�g +> + +3 + ~<mosqu�t�p.h +> + +5 + grun + = -1; + +7 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +9 +public +: + +10 +mosqu�t�p_�� +(cڡ * +id +); + +12 +�_c��� +( +rc +); + +15 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +17 + } +} + +19 +mosqu�t�p_�� +:: + $�_c��� +( +rc +) + +21 if( +rc +){ + +22 + `ex� +(1); + +24 + `publish +( +NULL +, "���/qos0/��", + `��� +("���ed mes�ge"), "���ed mes�ge", 0, +�ue +); + +26 + } +} + +28 + $ma� +( +�gc +, * +�gv +[]) + +30 +mosqu�t�p_�� + * +mosq +; + +32 +p�t + = + `�oi +( +�gv +[1]); + +34 +mosq� +:: + `lib_�� +(); + +36 +mosq + = +�w + + `mosqu�t�p_�� +("retain-qos0-test"); + +38 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +40 +run + == -1){ + +41 +mosq +-> + `lo� +(); + +44 +mosq� +:: + `lib_��nup +(); + +46 +run +; + +47 + } +} + + @test/lib/cpp/08-ssl-bad-cacert.cpp + +1 + ~<mosqu�t�p.h +> + +3 + grun + = -1; + +5 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +7 +public +: + +8 +mosqu�t�p_�� +(cڡ * +id +); + +11 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +13 + } +} + +15 + $ma� +( +�gc +, * +�gv +[]) + +17 +mosqu�t�p_�� + * +mosq +; + +18 +rc + = 1; + +20 +mosq� +:: + `lib_�� +(); + +22 +mosq + = +�w + + `mosqu�t�p_�� +("08-ssl-bad-cacert"); + +24 +mosq +-> + `�s_�ts_�t +(1, "�sv1", +NULL +); + +25 if( +mosq +-> + `�s_�t +("this/f�e/dۢt/exi�"�=� +MOSQ_ERR_INVAL +){ + +26 +rc + = 0; + +28 +mosq� +:: + `lib_��nup +(); + +30 +rc +; + +31 + } +} + + @test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp + +1 + ~<c�r�g +> + +2 + ~<mosqu�t�p.h +> + +4 + grun + = -1; + +6 + $�ssw�d_��back +(* +buf +, +size +, +rw�ag +, * +u�rd�a +) + +8 + `���y +( +buf +, "�ssw�d", +size +); + +9 +buf +[ +size +-1] = '\0'; + +11 + `��� +( +buf +); + +12 + } +} + +14 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +16 +public +: + +17 +mosqu�t�p_�� +(cڡ * +id +); + +19 +�_c��� +( +rc +); + +20 +�_disc��� +( +rc +); + +23 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +25 + } +} + +27 +mosqu�t�p_�� +:: + $�_c��� +( +rc +) + +29 if( +rc +){ + +30 + `ex� +(1); + +32 + `disc��� +(); + +34 + } +} + +36 + gmosqu�t�p_�� +:: + $�_disc��� +( +rc +) + +38 +run + = +rc +; + +39 + } +} + +42 + $ma� +( +�gc +, * +�gv +[]) + +44 +mosqu�t�p_�� + * +mosq +; + +46 +p�t + = + `�oi +( +�gv +[1]); + +48 +mosq� +:: + `lib_�� +(); + +50 +mosq + = +�w + + `mosqu�t�p_�� +("08-ssl-connect-crt-auth-enc"); + +52 +mosq +-> + `�s_�ts_�t +(1, "�sv1", +NULL +); + +54 +mosq +-> + `�s_�t +("../s�/�l-�.�t", +NULL +, "../s�/���-��y�ed.�t", "../s�/���-��y�ed.key", +�ssw�d_��back +); + +55 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +57 +run + == -1){ + +58 +mosq +-> + `lo� +(); + +61 +mosq� +:: + `lib_��nup +(); + +63 +run +; + +64 + } +} + + @test/lib/cpp/08-ssl-connect-cert-auth.cpp + +1 + ~<mosqu�t�p.h +> + +3 + grun + = -1; + +5 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +7 +public +: + +8 +mosqu�t�p_�� +(cڡ * +id +); + +10 +�_c��� +( +rc +); + +11 +�_disc��� +( +rc +); + +14 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +16 + } +} + +18 +mosqu�t�p_�� +:: + $�_c��� +( +rc +) + +20 if( +rc +){ + +21 + `ex� +(1); + +23 + `disc��� +(); + +25 + } +} + +27 + gmosqu�t�p_�� +:: + $�_disc��� +( +rc +) + +29 +run + = +rc +; + +30 + } +} + +33 + $ma� +( +�gc +, * +�gv +[]) + +35 +mosqu�t�p_�� + * +mosq +; + +37 +p�t + = + `�oi +( +�gv +[1]); + +39 +mosq� +:: + `lib_�� +(); + +41 +mosq + = +�w + + `mosqu�t�p_�� +("08-ssl-connect-crt-auth"); + +43 +mosq +-> + `�s_�ts_�t +(1, "�sv1", +NULL +); + +45 +mosq +-> + `�s_�t +("../s�/�l-�.�t", +NULL +, "../ssl/client.crt", "../ssl/client.key"); + +46 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +48 +run + == -1){ + +49 +mosq +-> + `lo� +(); + +52 +mosq� +:: + `lib_��nup +(); + +54 +run +; + +55 + } +} + + @test/lib/cpp/08-ssl-connect-no-auth.cpp + +1 + ~<mosqu�t�p.h +> + +3 + grun + = -1; + +5 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +7 +public +: + +8 +mosqu�t�p_�� +(cڡ * +id +); + +10 +�_c��� +( +rc +); + +11 +�_disc��� +( +rc +); + +14 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +16 + } +} + +18 +mosqu�t�p_�� +:: + $�_c��� +( +rc +) + +20 if( +rc +){ + +21 + `ex� +(1); + +23 + `disc��� +(); + +25 + } +} + +27 + gmosqu�t�p_�� +:: + $�_disc��� +( +rc +) + +29 +run + = +rc +; + +30 + } +} + +33 + $ma� +( +�gc +, * +�gv +[]) + +35 +mosqu�t�p_�� + * +mosq +; + +37 +p�t + = + `�oi +( +�gv +[1]); + +39 +mosq� +:: + `lib_�� +(); + +41 +mosq + = +�w + + `mosqu�t�p_�� +("08-ssl-connect-no-auth"); + +43 +mosq +-> + `�s_�ts_�t +(1, "�sv1", +NULL +); + +45 +mosq +-> + `�s_�t +("../ssl/all-ca.crt"); + +46 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +48 +run + == -1){ + +49 +mosq +-> + `lo� +(); + +52 +mosq� +:: + `lib_��nup +(); + +54 +run +; + +55 + } +} + + @test/lib/cpp/08-ssl-fake-cacert.cpp + +1 + ~<��o.h +> + +2 + ~<mosqu�t�p.h +> + +4 + grun + = -1; + +6 �as� + cmosqu�t�p_�� + : +public + +mosq� +:: +mosqu�t�p + + +8 +public +: + +9 +mosqu�t�p_�� +(cڡ * +id +); + +11 +�_c��� +( +rc +); + +14 + gmosqu�t�p_�� +:: + $mosqu�t�p_�� +(cڡ * +id +�: +mosq� +:: + $mosqu�t�p +( +id +) + +16 + } +} + +18 +mosqu�t�p_�� +:: + $�_c��� +( +rc +) + +20 + `ex� +(1); + +21 + } +} + +23 + $ma� +( +�gc +, * +�gv +[]) + +25 +mosqu�t�p_�� + * +mosq +; + +26 +rc +; + +28 +p�t + = + `�oi +( +�gv +[1]); + +30 +mosq� +:: + `lib_�� +(); + +32 +mosq + = +�w + + `mosqu�t�p_�� +("08-ssl-fake-cacert"); + +34 +mosq +-> + `�s_�ts_�t +(1, "�sv1", +NULL +); + +35 +mosq +-> + `�s_�t +("../s�/��-�ke-ro�-�.�t", +NULL +, "../ssl/client.crt", "../ssl/client.key"); + +36 +mosq +-> + `c��� +("lo�lho�", +p�t +, 60); + +38 +rc + = +mosq +-> + `lo�_f�ev� +(); + +39 if( +rc + =� +MOSQ_ERR_ERRNO + && +��o + =� +EPROTO +){ + +44 + } +} + + @test/lib/cpp/09-util-topic-tokenise.cpp + +1 + ~<c�dio +> + +2 + ~<c�r�g +> + +3 + ~<mosqu�t�p.h +> + +5 + $��t_�r� +(cڡ * +t�ic +, ** +t�ics +, +t�ic_cou� +) + +7 +i +; + +8 + `��tf +("TOPIC: %s\n", +t�ic +); + +9 + `��tf +("TOKENS: "); + +10 +i +=0; i< +t�ic_cou� +; i++){ + +11 + `��tf +("%s", +t�ics +[ +i +]); + +12 if( +i ++1< +t�ic_cou� +){ + +13 + `��tf +("/"); + +16 + `��tf +("\n"); + +17 + } +} + +19 + $ma� +( +�gc +, * +�gv +[]) + +21 ** +t�ics +; + +22 +t�ic_cou� +; + +24 if( +mosq� +:: + `sub_t�ic_tok�i� +("t�ic", & +t�ics +, & +t�ic_cou� +)){ + +25 + `��tf +("Out of memory.\n"); + +28 if( +t�ic_cou� + !�1 || + `�rcmp +( +t�ics +[0], "topic")){ + +29 + `��t_�r� +("t�ic", +t�ics +, +t�ic_cou� +); + +33 if( +mosq� +:: + `sub_t�ic_tok�i� +("a/d�p/t�ic/h��rchy", & +t�ics +, & +t�ic_cou� +)){ + +34 + `��tf +("Out of memory.\n"); + +37 if( +t�ic_cou� + != 4 + +38 || + `�rcmp +( +t�ics +[0], "a") + +39 || + `�rcmp +( +t�ics +[1], "deep") + +40 || + `�rcmp +( +t�ics +[2], "topic") + +41 || + `�rcmp +( +t�ics +[3], "hierarchy")){ + +42 + `��t_�r� +("a/d�p/t�ic/h��rchy", +t�ics +, +t�ic_cou� +); + +46 if( +mosq� +:: + `sub_t�ic_tok�i� +("/a/d�p/t�ic/h��rchy", & +t�ics +, & +t�ic_cou� +)){ + +47 + `��tf +("Out of memory.\n"); + +50 if( +t�ic_cou� + != 5 + +51 || +t�ics +[0] + +52 || + `�rcmp +( +t�ics +[1], "a") + +53 || + `�rcmp +( +t�ics +[2], "deep") + +54 || + `�rcmp +( +t�ics +[3], "topic") + +55 || + `�rcmp +( +t�ics +[4], "hierarchy")){ + +56 + `��t_�r� +("/a/d�p/t�ic/h��rchy", +t�ics +, +t�ic_cou� +); + +60 if( +mosq� +:: + `sub_t�ic_tok�i� +("a/b/c", & +t�ics +, & +t�ic_cou� +)){ + +61 + `��tf +("Out of memory.\n"); + +64 if( +t�ic_cou� + != 3 + +65 || + `�rcmp +( +t�ics +[0], "a") + +66 || + `�rcmp +( +t�ics +[1], "b") + +67 || + `�rcmp +( +t�ics +[2], "c")){ + +68 + `��t_�r� +("a/b/c", +t�ics +, +t�ic_cou� +); + +72 if( +mosq� +:: + `sub_t�ic_tok�i� +("/a/b/c", & +t�ics +, & +t�ic_cou� +)){ + +73 + `��tf +("Out of memory.\n"); + +76 if( +t�ic_cou� + != 4 + +77 || +t�ics +[0] + +78 || + `�rcmp +( +t�ics +[1], "a") + +79 || + `�rcmp +( +t�ics +[2], "b") + +80 || + `�rcmp +( +t�ics +[3], "c")){ + +81 + `��t_�r� +("/a/b/c", +t�ics +, +t�ic_cou� +); + +85 if( +mosq� +:: + `sub_t�ic_tok�i� +("a///h��rchy", & +t�ics +, & +t�ic_cou� +)){ + +86 + `��tf +("Out of memory.\n"); + +89 if( +t�ic_cou� + != 4 + +90 || + `�rcmp +( +t�ics +[0], "a") + +91 || +t�ics +[1] + +92 || +t�ics +[2] + +93 || + `�rcmp +( +t�ics +[3], "hierarchy")){ + +94 + `��t_�r� +("a///h��rchy", +t�ics +, +t�ic_cou� +); + +98 if( +mosq� +:: + `sub_t�ic_tok�i� +("/a///h��rchy", & +t�ics +, & +t�ic_cou� +)){ + +99 + `��tf +("Out of memory.\n"); + +102 if( +t�ic_cou� + != 5 + +103 || +t�ics +[0] + +104 || + `�rcmp +( +t�ics +[1], "a") + +105 || +t�ics +[2] + +106 || +t�ics +[3] + +107 || + `�rcmp +( +t�ics +[4], "hierarchy")){ + +108 + `��t_�r� +("/a///h��rchy", +t�ics +, +t�ic_cou� +); + +112 if( +mosq� +:: + `sub_t�ic_tok�i� +("/a///h��rchy/", & +t�ics +, & +t�ic_cou� +)){ + +113 + `��tf +("Out of memory.\n"); + +116 if( +t�ic_cou� + != 6 + +117 || +t�ics +[0] + +118 || + `�rcmp +( +t�ics +[1], "a") + +119 || +t�ics +[2] + +120 || +t�ics +[3] + +121 || + `�rcmp +( +t�ics +[4], "hierarchy") + +122 || +t�ics +[3]){ + +123 + `��t_�r� +("/a///h��rchy/", +t�ics +, +t�ic_cou� +); + +128 + } +} + + @test/old/msgsps_common.h + +1 + #HOST + "127.0.0.1" + + ) + +2 + #PORT + 1888 + + ) + +4 + #PUB_QOS + 1 + + ) + +5 + #SUB_QOS + 1 + + ) + +7 + #MESSAGE_COUNT + 100000L + + ) + +8 + #MESSAGE_SIZE + 1024L + + ) + + @test/old/msgsps_pub.c + +3 + ~<�dbo�.h +> + +4 + ~<�d�t.h +> + +5 + ~<�dio.h +> + +6 + ~<�dlib.h +> + +7 + ~<sys/time.h +> + +8 + ~<mosqu�to.h +> + +10 + ~<msg�s_comm�.h +> + +12 +bo� + + grun + = +�ue +; + +13 + gmes�ge_cou� + = 0; + +14 +timev� + + g��t +, + g�� +; + +16 + $my_c���_��back +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +18 + `��tf +("rc: %d\n", +rc +); + +19 + `g�timeofday +(& +��t +, +NULL +); + +20 + } +} + +22 + $my_disc���_��back +( +mosqu�to + * +mosq +, * +obj +, +�su� +) + +24 +run + = +�l� +; + +25 + } +} + +27 + $my_publish_��back +( +mosqu�to + * +mosq +, * +obj +, +mid +) + +29 +mes�ge_cou� +++; + +30 if( +mes�ge_cou� + =� +MESSAGE_COUNT +){ + +31 + `g�timeofday +(& +�� +, +NULL +); + +32 + `mosqu�to_disc��� +(( +mosqu�to + *) +obj +); + +34 + } +} + +36 + $ma� +( +�gc +, * +�gv +[]) + +38 +mosqu�to + * +mosq +; + +39 +i +; + +40 +d��t +, +d�� +, +diff +; + +41 +u�t8_t + * +buf +; + +43 +buf + = + `m�loc +( +MESSAGE_SIZE +* +MESSAGE_COUNT +); + +44 if(! +buf +){ + +45 + `��tf +("Error: Out of memory.\n"); + +49 +��t +. +tv_�c + = 0; + +50 +��t +. +tv_u�c + = 0; + +51 +�� +. +tv_�c + = 0; + +52 +�� +. +tv_u�c + = 0; + +54 + `mosqu�to_lib_�� +(); + +56 +mosq + = + `mosqu�to_�w +("�r�e�", +�ue +, +NULL +); + +57 + `mosqu�to_c���_��back_�t +( +mosq +, +my_c���_��back +); + +58 + `mosqu�to_disc���_��back_�t +( +mosq +, +my_disc���_��back +); + +59 + `mosqu�to_publish_��back_�t +( +mosq +, +my_publish_��back +); + +61 + `mosqu�to_c��� +( +mosq +, +HOST +, +PORT +, 600); + +63 + `mosqu�to_lo�_��t +( +mosq +); + +65 +i +=0; + +66 +i +=0; i< +MESSAGE_COUNT +; i++){ + +67 + `mosqu�to_publish +( +mosq +, +NULL +, "�rf/��", +MESSAGE_SIZE +, & +buf +[ +i +*MESSAGE_SIZE], +PUB_QOS +, +�l� +); + +69 + `mosqu�to_lo�_�� +( +mosq +, +�l� +); + +71 +d��t + = () +��t +. +tv_�c +*1.0e6 + ()��t. +tv_u�c +; + +72 +d�� + = () +�� +. +tv_�c +*1.0e6 + ()��. +tv_u�c +; + +73 +diff + = ( +d�� +- +d��t +)/1.0e6; + +75 + `��tf +("S��: %g\nSt�: %g\nDiff: %g\nMes�ges/s: %g\n", +d��t +, +d�� +, +diff +, () +MESSAGE_COUNT +/diff); + +77 + `mosqu�to_de�roy +( +mosq +); + +78 + `mosqu�to_lib_��nup +(); + +81 + } +} + + @test/old/msgsps_sub.c + +3 + ~<�dbo�.h +> + +4 + ~<�d�t.h +> + +5 + ~<�dio.h +> + +6 + ~<sys/time.h +> + +7 + ~<uni�d.h +> + +8 + ~<mosqu�to.h +> + +10 + ~<msg�s_comm�.h +> + +12 +bo� + + grun + = +�ue +; + +13 + gmes�ge_cou� + = 0; + +14 +timev� + + g��t +, + g�� +; + +15 +FILE + * + g� + = +NULL +; + +18 + $my_c���_��back +( +mosqu�to + * +mosq +, * +obj +, +rc +) + +20 + `��tf +("rc: %d\n", +rc +); + +21 + } +} + +23 + $my_disc���_��back +( +mosqu�to + * +mosq +, * +obj +, +�su� +) + +25 +run + = +�l� +; + +26 + } +} + +28 + $my_mes�ge_��back +( +mosqu�to + * +mosq +, * +obj +, cڡ +mosqu�to_mes�ge + * +msg +) + +30 if( +mes�ge_cou� + == 0){ + +31 + `g�timeofday +(& +��t +, +NULL +); + +34 +mes�ge_cou� +++; + +35 if( +mes�ge_cou� + =� +MESSAGE_COUNT +){ + +36 + `g�timeofday +(& +�� +, +NULL +); + +37 + `mosqu�to_disc��� +(( +mosqu�to + *) +obj +); + +39 + } +} + +41 + $ma� +( +�gc +, * +�gv +[]) + +43 +mosqu�to + * +mosq +; + +44 +d��t +, +d�� +, +diff +; + +45 +mid + = 0; + +46 +id +[50]; + +48 +��t +. +tv_�c + = 0; + +49 +��t +. +tv_u�c + = 0; + +50 +�� +. +tv_�c + = 0; + +51 +�� +. +tv_u�c + = 0; + +53 +� + = + `fݒ +("msgsps_sub.dat", "wb"); + +54 if(! +� +){ + +55 + `��tf +("Error: Unable�o write�o msgsps_sub.dat.\n"); + +58 + `mosqu�to_lib_�� +(); + +60 + `���tf +( +id +, 50, "msgps_sub_%d", + `g�pid +()); + +61 +mosq + = + `mosqu�to_�w +( +id +, +�ue +, +NULL +); + +62 + `mosqu�to_c���_��back_�t +( +mosq +, +my_c���_��back +); + +63 + `mosqu�to_disc���_��back_�t +( +mosq +, +my_disc���_��back +); + +64 + `mosqu�to_mes�ge_��back_�t +( +mosq +, +my_mes�ge_��back +); + +66 + `mosqu�to_c��� +( +mosq +, +HOST +, +PORT +, 600); + +67 + `mosqu�to_subs�ibe +( +mosq +, & +mid +, "�rf/��", +SUB_QOS +); + +69 + `mosqu�to_lo�_f�ev� +( +mosq +, 10, 1); + +71 +d��t + = () +��t +. +tv_�c +*1.0e6 + ()��t. +tv_u�c +; + +72 +d�� + = () +�� +. +tv_�c +*1.0e6 + ()��. +tv_u�c +; + +73 +diff + = ( +d�� +- +d��t +)/1.0e6; + +75 + `��tf +("S��: %g\nSt�: %g\nDiff: %g\nMes�ges/s: %g\n", +d��t +, +d�� +, +diff +, () +MESSAGE_COUNT +/diff); + +77 + `mosqu�to_de�roy +( +mosq +); + +78 + `mosqu�to_lib_��nup +(); + +79 + `f�o� +( +� +); + +82 + } +} + + @test/random/auth_plugin.c + +1 + ~<�dio.h +> + +2 + ~<�dlib.h +> + +3 + ~<time.h +> + +4 + ~<mosqu�to.h +> + +5 + ~<mosqu�to_brok�.h +> + +6 + ~<mosqu�to_�ug�.h +> + +8 + $mosqu�to_auth_�ug�_v�si� +() + +10 +MOSQ_AUTH_PLUGIN_VERSION +; + +11 + } +} + +13 + $mosqu�to_auth_�ug�_�� +(** +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +15 + `��dom +( + `time +( +NULL +)); + +16 +MOSQ_ERR_SUCCESS +; + +17 + } +} + +19 + $mosqu�to_auth_�ug�_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +) + +21 +MOSQ_ERR_SUCCESS +; + +22 + } +} + +24 + $mosqu�to_auth_�cur�y_�� +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +26 +MOSQ_ERR_SUCCESS +; + +27 + } +} + +29 + $mosqu�to_auth_�cur�y_��nup +(* +u�r_d�a +, +mosqu�to_�t + * +auth_�ts +, +auth_�t_cou� +, +bo� + +�l�d +) + +31 +MOSQ_ERR_SUCCESS +; + +32 + } +} + +34 + $mosqu�to_auth_a�_check +(* +u�r_d�a +, +ac�ss +, +mosqu�to + * +��� +, cڡ +mosqu�to_a�_msg + * +msg +) + +36 if( + `�ndom +() % 2 == 0){ + +37 +MOSQ_ERR_SUCCESS +; + +39 +MOSQ_ERR_ACL_DENIED +; + +41 + } +} + +43 + $mosqu�to_auth_u�wd_check +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +u��ame +, cڡ * +�ssw�d +) + +45 if( + `�ndom +() % 2 == 0){ + +46 +MOSQ_ERR_SUCCESS +; + +48 +MOSQ_ERR_AUTH +; + +50 + } +} + +52 + $mosqu�to_auth_psk_key_g� +(* +u�r_d�a +, +mosqu�to + * +��� +, cڡ * +h�t +, cڡ * +id�t�y +, * +key +, +max_key_�n +) + +54 +MOSQ_ERR_AUTH +; + +55 + } +} + + @test/unit/datatype_read.c + +1 + ~<CUn�/CUn�.h +> + +2 + ~<CUn�/Basic.h +> + +4 + ~"�ck�_mosq.h +" + +6 + $by�_�ad_h��r +( + +7 +u�t8_t + * +�yl�d +, + +8 +�ma��g_�ngth +, + +9 +rc_ex��ed +, + +10 +u�t8_t + +v�ue_ex��ed +) + +12 +mosqu�to__�ck� + +�ck� +; + +13 +u�t8_t + +v�ue + = 0; + +14 +rc +; + +16 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +17 +�ck� +. +�yl�d + =�ayload; + +18 +�ck� +. +�ma��g_�ngth + =�emaining_length; + +19 +rc + = + `�ck�__�ad_by� +(& +�ck� +, & +v�ue +); + +20 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +21 + `CU_ASSERT_EQUAL +( +v�ue +, +v�ue_ex��ed +); + +22 + } +} + +25 + $u�t16_�ad_h��r +( + +26 +u�t8_t + * +�yl�d +, + +27 +�ma��g_�ngth +, + +28 +rc_ex��ed +, + +29 +u�t16_t + +v�ue_ex��ed +) + +31 +mosqu�to__�ck� + +�ck� +; + +32 +u�t16_t + +v�ue + = 0; + +33 +rc +; + +35 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +36 +�ck� +. +�yl�d + =�ayload; + +37 +�ck� +. +�ma��g_�ngth + =�emaining_length; + +38 +rc + = + `�ck�__�ad_u�t16 +(& +�ck� +, & +v�ue +); + +39 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +40 + `CU_ASSERT_EQUAL +( +v�ue +, +v�ue_ex��ed +); + +41 + } +} + +44 + $u�t32_�ad_h��r +( + +45 +u�t8_t + * +�yl�d +, + +46 +�ma��g_�ngth +, + +47 +rc_ex��ed +, + +48 +u�t32_t + +v�ue_ex��ed +) + +50 +mosqu�to__�ck� + +�ck� +; + +51 +u�t32_t + +v�ue + = 0; + +52 +rc +; + +54 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +55 +�ck� +. +�yl�d + =�ayload; + +56 +�ck� +. +�ma��g_�ngth + =�emaining_length; + +57 +rc + = + `�ck�__�ad_u�t32 +(& +�ck� +, & +v�ue +); + +58 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +59 + `CU_ASSERT_EQUAL +( +v�ue +, +v�ue_ex��ed +); + +60 + } +} + +63 + $v��t_�ad_h��r +( + +64 +u�t8_t + * +�yl�d +, + +65 +�ma��g_�ngth +, + +66 +rc_ex��ed +, + +67 +�t32_t + +v�ue_ex��ed +, + +68 +�t8_t + +by�s_ex��ed +) + +70 +mosqu�to__�ck� + +�ck� +; + +71 +�t32_t + +v�ue + = -1; + +72 +�t8_t + +by�s + = -1; + +73 +rc +; + +75 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +76 +�ck� +. +�yl�d + =�ayload; + +77 +�ck� +. +�ma��g_�ngth + =�emaining_length; + +78 +rc + = + `�ck�__�ad_v��t +(& +�ck� +, & +v�ue +, & +by�s +); + +79 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +80 + `CU_ASSERT_EQUAL +( +v�ue +, +v�ue_ex��ed +); + +81 + `CU_ASSERT_EQUAL +( +by�s +, +by�s_ex��ed +); + +82 + } +} + +85 + $b��y_�ad_h��r +( + +86 +u�t8_t + * +�yl�d +, + +87 +�ma��g_�ngth +, + +88 +rc_ex��ed +, + +89 cڡ +u�t8_t + * +v�ue_ex��ed +, + +90 +�ngth_ex��ed +) + +92 +mosqu�to__�ck� + +�ck� +; + +93 +u�t8_t + * +v�ue + = +NULL +; + +94 +�ngth + = -1; + +95 +rc +; + +97 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +98 +�ck� +. +�yl�d + =�ayload; + +99 +�ck� +. +�ma��g_�ngth + =�emaining_length; + +100 +rc + = + `�ck�__�ad_b��y +(& +�ck� +, ( +u�t8_t + **)& +v�ue +, & +�ngth +); + +101 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +102 if( +v�ue_ex��ed +){ + +104 + `CU_ASSERT_NSTRING_EQUAL +( +v�ue +, +v�ue_ex��ed +, +�ngth_ex��ed +); + +106 + `CU_ASSERT_EQUAL +( +v�ue +, +NULL +); + +108 + `CU_ASSERT_EQUAL +( +�ngth +, +�ngth_ex��ed +); + +109 + `� +( +v�ue +); + +110 + } +} + +113 + $�r�g_�ad_h��r +( + +114 +u�t8_t + * +�yl�d +, + +115 +�ma��g_�ngth +, + +116 +rc_ex��ed +, + +117 cڡ +u�t8_t + * +v�ue_ex��ed +, + +118 +�ngth_ex��ed +) + +120 +mosqu�to__�ck� + +�ck� +; + +121 +u�t8_t + * +v�ue + = +NULL +; + +122 +�ngth + = -1; + +123 +rc +; + +125 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +126 +�ck� +. +�yl�d + =�ayload; + +127 +�ck� +. +�ma��g_�ngth + =�emaining_length; + +128 +rc + = + `�ck�__�ad_�r�g +(& +�ck� +, (**)& +v�ue +, & +�ngth +); + +129 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +130 if( +v�ue_ex��ed +){ + +131 if( +v�ue +){ + +132 + `CU_ASSERT_NSTRING_EQUAL +( +v�ue +, +v�ue_ex��ed +, +�ngth_ex��ed +); + +135 + `CU_ASSERT_PTR_NULL +( +v�ue +); + +137 + `CU_ASSERT_EQUAL +( +�ngth +, +�ngth_ex��ed +); + +138 + `� +( +v�ue +); + +139 + } +} + +142 + $by�s_�ad_h��r +( + +143 +u�t8_t + * +�yl�d +, + +144 +�ma��g_�ngth +, + +145 +rc_ex��ed +, + +146 cڡ +u�t8_t + * +v�ue_ex��ed +, + +147 +cou� +) + +149 +mosqu�to__�ck� + +�ck� +; + +150 +u�t8_t + +v�ue +[ +cou� +]; + +151 +rc +; + +152 +i +; + +154 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +155 +�ck� +. +�yl�d + =�ayload; + +156 +�ck� +. +�ma��g_�ngth + =�emaining_length; + +157 +rc + = + `�ck�__�ad_by�s +(& +�ck� +, +v�ue +, +cou� +); + +158 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +159 if( +rc + =� +MOSQ_ERR_SUCCESS +){ + +160 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, +cou� +); + +162 if( +v�ue_ex��ed +){ + +163 +i +=0; i< +cou� +; i++){ + +164 + `CU_ASSERT_EQUAL +( +v�ue +[ +i +], +v�ue_ex��ed +[i]); + +167 + } +} + +179 + $TEST_by�_�ad_em�y +() + +182 + `by�_�ad_h��r +( +NULL +, 0, +MOSQ_ERR_PROTOCOL +, 0); + +183 + } +} + +191 + $TEST_by�_�ad_suc�ss +() + +193 +u�t8_t + +�yl�d +[20]; + +196 + `mem�t +( +�yl�d +, 0, (payload)); + +197 +�yl�d +[0] = 0x00; + +198 + `by�_�ad_h��r +( +�yl�d +, 1, +MOSQ_ERR_SUCCESS +, 0x00); + +201 + `mem�t +( +�yl�d +, 0, (payload)); + +202 +�yl�d +[0] = 0x1F; + +203 + `by�_�ad_h��r +( +�yl�d +, 1, +MOSQ_ERR_SUCCESS +, 0x1F); + +206 + `mem�t +( +�yl�d +, 0, (payload)); + +207 +�yl�d +[0] = 0xFF; + +208 + `by�_�ad_h��r +( +�yl�d +, 1, +MOSQ_ERR_SUCCESS +, 0xFF); + +210 + } +} + +222 + $TEST_u�t16_�ad_em�y +() + +225 + `u�t16_�ad_h��r +( +NULL +, 0, +MOSQ_ERR_PROTOCOL +, 0); + +226 + } +} + +234 + $TEST_u�t16_�ad_�un��d +() + +236 +u�t8_t + +�yl�d +[20]; + +239 + `mem�t +( +�yl�d +, 0, (payload)); + +240 +�yl�d +[0] = 0x38; + +241 + `u�t16_�ad_h��r +( +�yl�d +, 1, +MOSQ_ERR_PROTOCOL +, 0); + +242 + } +} + +251 + $TEST_u�t16_�ad_suc�ss +() + +253 +u�t8_t + +�yl�d +[20]; + +256 + `mem�t +( +�yl�d +, 0, (payload)); + +257 +�yl�d +[0] = 0x00; + +258 +�yl�d +[1] = 0x00; + +259 + `u�t16_�ad_h��r +( +�yl�d +, 2, +MOSQ_ERR_SUCCESS +, 0x0000); + +262 + `mem�t +( +�yl�d +, 0, (payload)); + +263 +�yl�d +[0] = 0x38; + +264 +�yl�d +[1] = 0xF3; + +265 + `u�t16_�ad_h��r +( +�yl�d +, 2, +MOSQ_ERR_SUCCESS +, 0x38F3); + +268 + `mem�t +( +�yl�d +, 0, (payload)); + +269 +�yl�d +[0] = 0xFF; + +270 +�yl�d +[1] = 0xFF; + +271 + `u�t16_�ad_h��r +( +�yl�d +, 2, +MOSQ_ERR_SUCCESS +, 0xFFFF); + +273 + } +} + +285 + $TEST_u�t32_�ad_em�y +() + +288 + `u�t32_�ad_h��r +( +NULL +, 0, +MOSQ_ERR_PROTOCOL +, 0); + +289 + } +} + +297 + $TEST_u�t32_�ad_�un��d +() + +299 +u�t8_t + +�yl�d +[20]; + +302 + `mem�t +( +�yl�d +, 0, (payload)); + +303 +�yl�d +[0] = 0x38; + +304 + `u�t32_�ad_h��r +( +�yl�d +, 1, +MOSQ_ERR_PROTOCOL +, 0); + +307 + `mem�t +( +�yl�d +, 0, (payload)); + +308 +�yl�d +[0] = 0x38; + +309 +�yl�d +[1] = 0x38; + +310 + `u�t32_�ad_h��r +( +�yl�d +, 2, +MOSQ_ERR_PROTOCOL +, 0); + +313 + `mem�t +( +�yl�d +, 0, (payload)); + +314 +�yl�d +[0] = 0x38; + +315 +�yl�d +[1] = 0x38; + +316 +�yl�d +[2] = 0x38; + +317 + `u�t32_�ad_h��r +( +�yl�d +, 3, +MOSQ_ERR_PROTOCOL +, 0); + +318 + } +} + +327 + $TEST_u�t32_�ad_suc�ss +() + +329 +u�t8_t + +�yl�d +[20]; + +332 + `mem�t +( +�yl�d +, 0, (payload)); + +333 +�yl�d +[0] = 0x00; + +334 +�yl�d +[1] = 0x00; + +335 +�yl�d +[2] = 0x00; + +336 +�yl�d +[3] = 0x00; + +337 + `u�t32_�ad_h��r +( +�yl�d +, 4, +MOSQ_ERR_SUCCESS +, 0x00000000); + +340 + `mem�t +( +�yl�d +, 0, (payload)); + +341 +�yl�d +[0] = 0x12; + +342 +�yl�d +[1] = 0x34; + +343 +�yl�d +[2] = 0x56; + +344 +�yl�d +[3] = 0x78; + +345 + `u�t32_�ad_h��r +( +�yl�d +, 4, +MOSQ_ERR_SUCCESS +, 0x12345678); + +348 + `mem�t +( +�yl�d +, 0, (payload)); + +349 +�yl�d +[0] = 0xFF; + +350 +�yl�d +[1] = 0xFF; + +351 +�yl�d +[2] = 0xFF; + +352 +�yl�d +[3] = 0xFF; + +353 + `u�t32_�ad_h��r +( +�yl�d +, 4, +MOSQ_ERR_SUCCESS +, 0xFFFFFFFF); + +355 + } +} + +367 + $TEST_v��t_�ad_em�y +() + +370 + `v��t_�ad_h��r +( +NULL +, 0, +MOSQ_ERR_PROTOCOL +, -1, -1); + +371 + } +} + +379 + $TEST_v��t_�ad_�un��d +() + +381 +u�t8_t + +�yl�d +[20]; + +384 + `mem�t +( +�yl�d +, 0, (payload)); + +385 +�yl�d +[0] = 0x80; + +386 + `v��t_�ad_h��r +( +�yl�d +, 1, +MOSQ_ERR_PROTOCOL +, -1, -1); + +389 + `mem�t +( +�yl�d +, 1, (payload)); + +390 +�yl�d +[0] = 0x80; + +391 +�yl�d +[1] = 0x80; + +392 + `v��t_�ad_h��r +( +�yl�d +, 2, +MOSQ_ERR_PROTOCOL +, -1, -1); + +395 + `mem�t +( +�yl�d +, 0, (payload)); + +396 +�yl�d +[0] = 0x80; + +397 +�yl�d +[1] = 0x80; + +398 +�yl�d +[2] = 0x80; + +399 + `v��t_�ad_h��r +( +�yl�d +, 3, +MOSQ_ERR_PROTOCOL +, -1, -1); + +402 + `mem�t +( +�yl�d +, 0, (payload)); + +403 +�yl�d +[0] = 0x80; + +404 +�yl�d +[1] = 0x80; + +405 +�yl�d +[2] = 0x80; + +406 +�yl�d +[3] = 0x80; + +407 + `v��t_�ad_h��r +( +�yl�d +, 4, +MOSQ_ERR_PROTOCOL +, -1, -1); + +408 + } +} + +416 + $TEST_v��t_�ad_bound��s +() + +418 +u�t8_t + +�yl�d +[20]; + +421 + `mem�t +( +�yl�d +, 0, (payload)); + +422 +�yl�d +[0] = 0x00; + +423 + `v��t_�ad_h��r +( +�yl�d +, 1, +MOSQ_ERR_SUCCESS +, 0, 1); + +426 + `mem�t +( +�yl�d +, 0, (payload)); + +427 +�yl�d +[0] = 0x7F; + +428 + `v��t_�ad_h��r +( +�yl�d +, 1, +MOSQ_ERR_SUCCESS +, 127, 1); + +431 + `mem�t +( +�yl�d +, 0, (payload)); + +432 +�yl�d +[0] = 0x80; + +433 +�yl�d +[1] = 0x01; + +434 + `v��t_�ad_h��r +( +�yl�d +, 2, +MOSQ_ERR_SUCCESS +, 128, 2); + +437 + `mem�t +( +�yl�d +, 0, (payload)); + +438 +�yl�d +[0] = 0xFF; + +439 +�yl�d +[1] = 0x7F; + +440 + `v��t_�ad_h��r +( +�yl�d +, 2, +MOSQ_ERR_SUCCESS +, 16383, 2); + +443 + `mem�t +( +�yl�d +, 0, (payload)); + +444 +�yl�d +[0] = 0x80; + +445 +�yl�d +[1] = 0x80; + +446 +�yl�d +[2] = 0x01; + +447 + `v��t_�ad_h��r +( +�yl�d +, 3, +MOSQ_ERR_SUCCESS +, 16384, 3); + +450 + `mem�t +( +�yl�d +, 0, (payload)); + +451 +�yl�d +[0] = 0xFF; + +452 +�yl�d +[1] = 0xFF; + +453 +�yl�d +[2] = 0x7F; + +454 + `v��t_�ad_h��r +( +�yl�d +, 3, +MOSQ_ERR_SUCCESS +, 2097151, 3); + +457 + `mem�t +( +�yl�d +, 0, (payload)); + +458 +�yl�d +[0] = 0x80; + +459 +�yl�d +[1] = 0x80; + +460 +�yl�d +[2] = 0x80; + +461 +�yl�d +[3] = 0x01; + +462 + `v��t_�ad_h��r +( +�yl�d +, 4, +MOSQ_ERR_SUCCESS +, 2097152, 4); + +465 + `mem�t +( +�yl�d +, 0, (payload)); + +466 +�yl�d +[0] = 0xFF; + +467 +�yl�d +[1] = 0xFF; + +468 +�yl�d +[2] = 0xFF; + +469 +�yl�d +[3] = 0x7F; + +470 + `v��t_�ad_h��r +( +�yl�d +, 4, +MOSQ_ERR_SUCCESS +, 268435455, 4); + +471 + } +} + +478 + $TEST_v��t_�ad_5_by�s +() + +480 +u�t8_t + +�yl�d +[20]; + +483 + `mem�t +( +�yl�d +, 0, (payload)); + +484 +�yl�d +[0] = 0x80; + +485 +�yl�d +[1] = 0x80; + +486 +�yl�d +[2] = 0x80; + +487 +�yl�d +[3] = 0x80; + +488 +�yl�d +[4] = 0x01; + +489 + `v��t_�ad_h��r +( +�yl�d +, 5, +MOSQ_ERR_PROTOCOL +, -1, -1); + +490 + } +} + +498 + $TEST_v��t_�ad_ov�l�g_�cod�g +() + +500 +u�t8_t + +�yl�d +[20]; + +503 + `mem�t +( +�yl�d +, 0, (payload)); + +504 +�yl�d +[0] = 0x80; + +505 +�yl�d +[1] = 0x00; + +506 + `v��t_�ad_h��r +( +�yl�d +, 2, +MOSQ_ERR_PROTOCOL +, -1, -1); + +509 + `mem�t +( +�yl�d +, 0, (payload)); + +510 +�yl�d +[0] = 0xFF; + +511 +�yl�d +[1] = 0x00; + +512 + `v��t_�ad_h��r +( +�yl�d +, 2, +MOSQ_ERR_PROTOCOL +, -1, -1); + +515 + `mem�t +( +�yl�d +, 0, (payload)); + +516 +�yl�d +[0] = 0x80; + +517 +�yl�d +[1] = 0x81; + +518 +�yl�d +[2] = 0x00; + +519 + `v��t_�ad_h��r +( +�yl�d +, 3, +MOSQ_ERR_PROTOCOL +, -1, -1); + +522 + `mem�t +( +�yl�d +, 0, (payload)); + +523 +�yl�d +[0] = 0xFF; + +524 +�yl�d +[1] = 0xFF; + +525 +�yl�d +[2] = 0x00; + +526 + `v��t_�ad_h��r +( +�yl�d +, 3, +MOSQ_ERR_PROTOCOL +, -1, -1); + +529 + `mem�t +( +�yl�d +, 0, (payload)); + +530 +�yl�d +[0] = 0x80; + +531 +�yl�d +[1] = 0x80; + +532 +�yl�d +[2] = 0x81; + +533 +�yl�d +[3] = 0x00; + +534 + `v��t_�ad_h��r +( +�yl�d +, 4, +MOSQ_ERR_PROTOCOL +, -1, -1); + +537 + `mem�t +( +�yl�d +, 0, (payload)); + +538 +�yl�d +[0] = 0xFF; + +539 +�yl�d +[1] = 0xFF; + +540 +�yl�d +[2] = 0xFF; + +541 +�yl�d +[3] = 0x00; + +542 + `v��t_�ad_h��r +( +�yl�d +, 4, +MOSQ_ERR_PROTOCOL +, -1, -1); + +543 + } +} + +555 + $TEST_�r�g_�ad_em�y +() + +557 + `�r�g_�ad_h��r +( +NULL +, 0, +MOSQ_ERR_PROTOCOL +, NULL, -1); + +558 + } +} + +565 + $TEST_�r�g_�ad_�un��d +() + +567 +u�t8_t + +�yl�d +[20]; + +570 + `mem�t +( +�yl�d +, 0, (payload)); + +571 +�yl�d +[0] = 0x02; + +572 + `�r�g_�ad_h��r +( +�yl�d +, 1, +MOSQ_ERR_PROTOCOL +, +NULL +, -1); + +575 + `mem�t +( +�yl�d +, 0, (payload)); + +576 +�yl�d +[0] = 0x02; + +577 +�yl�d +[1] = 0x02; + +578 + `�r�g_�ad_h��r +( +�yl�d +, 2, +MOSQ_ERR_PROTOCOL +, +NULL +, -1); + +581 + `mem�t +( +�yl�d +, 0, (payload)); + +582 +�yl�d +[0] = 0x00; + +583 +�yl�d +[1] = 0x02; + +584 +�yl�d +[2] = 'a'; + +585 + `�r�g_�ad_h��r +( +�yl�d +, 3, +MOSQ_ERR_PROTOCOL +, +NULL +, -1); + +588 + `mem�t +( +�yl�d +, 0, (payload)); + +589 +�yl�d +[0] = 0x00; + +590 +�yl�d +[1] = 0x03; + +591 +�yl�d +[2] = 'a'; + +592 +�yl�d +[3] = 'b'; + +593 + `�r�g_�ad_h��r +( +�yl�d +, 4, +MOSQ_ERR_PROTOCOL +, +NULL +, -1); + +594 + } +} + +602 + $TEST_�r�g_�ad_em�y_�r�g +() + +604 +u�t8_t + +�yl�d +[20]; + +606 + `mem�t +( +�yl�d +, 0, (payload)); + +607 +�yl�d +[0] = 0x00; + +608 +�yl�d +[1] = 0x00; + +609 + `�r�g_�ad_h��r +( +�yl�d +, 2, +MOSQ_ERR_SUCCESS +, (cڡ +u�t8_t + *)"", 0); + +610 + } +} + +617 + $TEST_�r�g_�ad_v�id_�r�g +() + +619 +u�t8_t + +�yl�d +[20]; + +621 + `mem�t +( +�yl�d +, 0, (payload)); + +622 +�yl�d +[0] = 0x00; + +623 +�yl�d +[1] = 0x0b; + +624 +�yl�d +[2] = 't'; + +625 +�yl�d +[3] = 'e'; + +626 +�yl�d +[4] = 's'; + +627 +�yl�d +[5] = 't'; + +628 +�yl�d +[6] = ' '; + +629 +�yl�d +[7] = 's'; + +630 +�yl�d +[8] = 't'; + +631 +�yl�d +[9] = 'r'; + +632 +�yl�d +[10] = 'i'; + +633 +�yl�d +[11] = 'n'; + +634 +�yl�d +[12] = 'g'; + +635 + `�r�g_�ad_h��r +( +�yl�d +, 13, +MOSQ_ERR_SUCCESS +, (cڡ +u�t8_t + *)"test string", 11); + +636 + } +} + +644 + $TEST_�r�g_�ad_m�f�med_�r�g +() + +646 +u�t8_t + +�yl�d +[20]; + +648 + `mem�t +( +�yl�d +, 0, (payload)); + +649 +�yl�d +[0] = 0x00; + +650 +�yl�d +[1] = 0x07; + +651 +�yl�d +[2] = 't'; + +652 +�yl�d +[3] = 'e'; + +653 +�yl�d +[4] = 's'; + +654 +�yl�d +[5] = 't'; + +655 +�yl�d +[6] = 0xED; + +656 +�yl�d +[7] = 0xA0; + +657 +�yl�d +[8] = 0x80; + +658 + `�r�g_�ad_h��r +( +�yl�d +, 9, +MOSQ_ERR_MALFORMED_UTF8 +, +NULL +, -1); + +659 + } +} + +667 + $TEST_�r�g_�ad_mq�_1_5_4_3 +() + +669 +u�t8_t + +�yl�d +[20]; + +671 + `mem�t +( +�yl�d +, 0, (payload)); + +672 +�yl�d +[0] = 0x00; + +673 +�yl�d +[1] = 0x0b; + +674 +�yl�d +[2] = 't'; + +675 +�yl�d +[3] = 'e'; + +676 +�yl�d +[4] = 's'; + +677 +�yl�d +[5] = 't'; + +678 +�yl�d +[6] = 0xEF; + +679 +�yl�d +[7] = 0xBB; + +680 +�yl�d +[8] = 0xBF; + +681 +�yl�d +[9] = 't'; + +682 +�yl�d +[10] = 'e'; + +683 +�yl�d +[11] = 's'; + +684 +�yl�d +[12] = 't'; + +685 + `�r�g_�ad_h��r +( +�yl�d +, 13, +MOSQ_ERR_SUCCESS +, &payload[2], 11); + +686 + } +} + +698 + $TEST_b��y_d�a_�ad_em�y +() + +700 + `b��y_�ad_h��r +( +NULL +, 0, +MOSQ_ERR_PROTOCOL +, NULL, -1); + +701 + } +} + +709 + $TEST_b��y_d�a_�ad_�un��d +() + +711 +u�t8_t + +�yl�d +[20]; + +714 + `mem�t +( +�yl�d +, 0, (payload)); + +715 +�yl�d +[0] = 0x02; + +716 + `b��y_�ad_h��r +( +�yl�d +, 1, +MOSQ_ERR_PROTOCOL +, +NULL +, -1); + +719 + `mem�t +( +�yl�d +, 0, (payload)); + +720 +�yl�d +[0] = 0x02; + +721 +�yl�d +[1] = 0x02; + +722 + `b��y_�ad_h��r +( +�yl�d +, 2, +MOSQ_ERR_PROTOCOL +, +NULL +, -1); + +725 + `mem�t +( +�yl�d +, 0, (payload)); + +726 +�yl�d +[0] = 0x00; + +727 +�yl�d +[1] = 0x02; + +728 +�yl�d +[2] = 'a'; + +729 + `b��y_�ad_h��r +( +�yl�d +, 3, +MOSQ_ERR_PROTOCOL +, +NULL +, -1); + +732 + `mem�t +( +�yl�d +, 0, (payload)); + +733 +�yl�d +[0] = 0x00; + +734 +�yl�d +[1] = 0x03; + +735 +�yl�d +[2] = 'a'; + +736 +�yl�d +[3] = 'b'; + +737 + `b��y_�ad_h��r +( +�yl�d +, 4, +MOSQ_ERR_PROTOCOL +, +NULL +, -1); + +738 + } +} + +750 + $TEST_by�s_�ad_em�y +() + +753 + `by�s_�ad_h��r +( +NULL +, 0, +MOSQ_ERR_SUCCESS +, NULL, 0); + +754 + } +} + +761 + $TEST_by�s_�ad_�un��d +() + +763 + `by�s_�ad_h��r +( +NULL +, 0, +MOSQ_ERR_PROTOCOL +, NULL, 1); + +764 + } +} + +771 + $TEST_by�s_�ad_suc�ss +() + +773 +u�t8_t + +�yl�d +[20]; + +774 +i +; + +776 +i +=0; i<20; i++){ + +777 +�yl�d +[ +i +] = i*2; + +779 + `by�s_�ad_h��r +( +�yl�d +, 20, +MOSQ_ERR_SUCCESS +,�ayload, 20); + +780 + } +} + +787 + $��_d��y�_�ad_��s +() + +789 +CU_pSu�e + +��_su�e + = +NULL +; + +791 +��_su�e + = + `CU_add_su�e +("D��y���d", +NULL +, NULL); + +792 if(! +��_su�e +){ + +793 + `��tf +("Error�dding CUnit�est suite.\n"); + +798 || ! + `CU_add_�� +( +��_su�e +, "By���d (em�y�ack�)", +TEST_by�_�ad_em�y +) + +799 || ! + `CU_add_�� +( +��_su�e +, "By���d (suc�s�v�ues)", +TEST_by�_�ad_suc�ss +) + +800 || ! + `CU_add_�� +( +��_su�e +, "Tw�By� I�eg���d (em�y�ack�)", +TEST_u�t16_�ad_em�y +) + +801 || ! + `CU_add_�� +( +��_su�e +, "Tw�By� I�eg���d (�un��d�ack�)", +TEST_u�t16_�ad_�un��d +) + +802 || ! + `CU_add_�� +( +��_su�e +, "Tw�By� I�eg���d (suc�s�v�ues)", +TEST_u�t16_�ad_suc�ss +) + +803 || ! + `CU_add_�� +( +��_su�e +, "Fou�By� I�eg���d (em�y�ack�)", +TEST_u�t32_�ad_em�y +) + +804 || ! + `CU_add_�� +( +��_su�e +, "Fou�By� I�eg���d (�un��d�ack�)", +TEST_u�t32_�ad_�un��d +) + +805 || ! + `CU_add_�� +( +��_su�e +, "Fou�By� I�eg���d (suc�s�v�ues)", +TEST_u�t32_�ad_suc�ss +) + +806 || ! + `CU_add_�� +( +��_su�e +, "V��b� By� I�eg���d (em�y�ack�)", +TEST_v��t_�ad_em�y +) + +807 || ! + `CU_add_�� +( +��_su�e +, "V��b� By� I�eg���d (�un��d�ack�s)", +TEST_v��t_�ad_�un��d +) + +808 || ! + `CU_add_�� +( +��_su�e +, "V��b� By� I�eg���d (�cod�g bound��s)", +TEST_v��t_�ad_bound��s +) + +809 || ! + `CU_add_�� +( +��_su�e +, "V��b� By� I�eg���d (fiv�by��ncod�g)", +TEST_v��t_�ad_5_by�s +) + +810 || ! + `CU_add_�� +( +��_su�e +, "V��b� By� I�eg���d (ov�l�g�ncod�gs)", +TEST_v��t_�ad_ov�l�g_�cod�g +) + +811 || ! + `CU_add_�� +( +��_su�e +, "UTF-8 s��g��d (em�y�ack�)", +TEST_�r�g_�ad_em�y +) + +812 || ! + `CU_add_�� +( +��_su�e +, "UTF-8 s��g��d (�un��d�ack�)", +TEST_�r�g_�ad_�un��d +) + +813 || ! + `CU_add_�� +( +��_su�e +, "UTF-8 s��g��d (em�y s��g)", +TEST_�r�g_�ad_em�y_�r�g +) + +814 || ! + `CU_add_�� +( +��_su�e +, "UTF-8 s��g��d (v�id s��g)", +TEST_�r�g_�ad_v�id_�r�g +) + +815 || ! + `CU_add_�� +( +��_su�e +, "UTF-8 s��g��d (m�f�med s��g)", +TEST_�r�g_�ad_m�f�med_�r�g +) + +816 || ! + `CU_add_�� +( +��_su�e +, "UTF-8 s��g��d (MQTT-1.5.4-3)", +TEST_�r�g_�ad_mq�_1_5_4_3 +) + +817 || ! + `CU_add_�� +( +��_su�e +, "B��y D���ad (em�y�ack�)", +TEST_b��y_d�a_�ad_em�y +) + +818 || ! + `CU_add_�� +( +��_su�e +, "B��y D���ad (�un��d�ack�)", +TEST_b��y_d�a_�ad_�un��d +) + +819 || ! + `CU_add_�� +( +��_su�e +, "By���ad (em�y�ack�)", +TEST_by�s_�ad_em�y +) + +820 || ! + `CU_add_�� +( +��_su�e +, "By���ad (�un��d�ack�)", +TEST_by�s_�ad_�un��d +) + +821 || ! + `CU_add_�� +( +��_su�e +, "By���ad (suc�ss)", +TEST_by�s_�ad_suc�ss +) + +824 + `��tf +("Error�dding Datatype�ead CUnit�ests.\n"); + +829 + } +} + + @test/unit/datatype_write.c + +1 + ~<CUn�/CUn�.h +> + +2 + ~<CUn�/Basic.h +> + +4 + ~<��/��.h +> + +6 + ~"�ck�_mosq.h +" + +13 + $TEST_by�_wr�e +() + +15 +u�t8_t + +�yl�d +[260]; + +16 +mosqu�to__�ck� + +�ck� +; + +17 +i +; + +19 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +20 + `mem�t +( +�yl�d +, 0, (payload)); + +21 +�ck� +. +�yl�d + =�ayload; + +22 +�ck� +. +�ck�_�ngth + = 256; + +24 +i +=0; i<256; i++){ + +25 + `�ck�__wr�e_by� +(& +�ck� +, 255- +i +); + +28 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, 256); + +29 +i +=0; i<256; i++){ + +30 + `CU_ASSERT_EQUAL +( +�yl�d +[ +i +], 255-i); + +32 + } +} + +40 + $TEST_u�t16_wr�e +() + +42 +u�t8_t + +�yl�d +[650]; + +43 +u�t16_t + * +�yl�d16 +; + +44 +mosqu�to__�ck� + +�ck� +; + +45 +i +; + +47 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +48 + `mem�t +( +�yl�d +, 0, (payload)); + +49 +�ck� +. +�yl�d + =�ayload; + +50 +�ck� +. +�ck�_�ngth + = 650; + +52 +i +=0; i<325; i++){ + +53 + `�ck�__wr�e_u�t16 +(& +�ck� +, 100* +i +); + +56 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, 650); + +57 +�yl�d16 + = ( +u�t16_t + *) +�yl�d +; + +58 +i +=0; i<325; i++){ + +59 + `CU_ASSERT_EQUAL +( +�yl�d16 +[ +i +], + `ht�s +(100*i)); + +61 + } +} + +69 + $TEST_u�t32_wr�e +() + +71 +u�t8_t + * +�yl�d +; + +72 +u�t32_t + * +�yl�d32 +; + +73 +mosqu�to__�ck� + +�ck� +; + +74 +i +; + +76 +�yl�d + = + `��oc +(42000, ( +u�t32_t +)); + +77 if(! +�yl�d +){ + +78 + `CU_FAIL_FATAL +("Out of memory"); + +81 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +82 +�ck� +. +�yl�d + =�ayload; + +83 +�ck� +. +�ck�_�ngth + = 42000; + +85 +i +=0; i<10500; i++){ + +86 + `�ck�__wr�e_u�t32 +(& +�ck� +, 1000* +i +); + +89 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, 42000); + +90 +�yl�d32 + = ( +u�t32_t + *) +�yl�d +; + +91 +i +=0; i<10500; i++){ + +92 + `CU_ASSERT_EQUAL +( +�yl�d32 +[ +i +], + `ht�l +(1000*i)); + +94 + `� +( +�yl�d +); + +95 + } +} + +103 + $TEST_�r�g_wr�e +() + +105 +u�t8_t + +�yl�d +[100]; + +106 +mosqu�to__�ck� + +�ck� +; + +108 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +109 + `mem�t +( +�yl�d +, 0, 100); + +111 +�ck� +. +�yl�d + =�ayload; + +112 +�ck� +. +�ck�_�ngth + = 100; + +114 + `�ck�__wr�e_�r�g +(& +�ck� +, "f���e�", + `��� +("first�est")); + +115 + `�ck�__wr�e_�r�g +(& +�ck� +, "�c�d�e�", + `��� +("second�est")); + +117 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, 2+10+2+11); + +118 + `CU_ASSERT_EQUAL +( +�yl�d +[0], 0); + +119 + `CU_ASSERT_EQUAL +( +�yl�d +[1], 10); + +120 + `CU_ASSERT_NSTRING_EQUAL +( +�yl�d ++2, "first�est", 10); + +121 + `CU_ASSERT_EQUAL +( +�yl�d +[2+10+0], 0); + +122 + `CU_ASSERT_EQUAL +( +�yl�d +[2+10+1], 11); + +123 + `CU_ASSERT_NSTRING_EQUAL +( +�yl�d ++2+10+2, "second�est", 11); + +124 + } +} + +131 + $��_d��y�_wr�e_��s +() + +133 +CU_pSu�e + +��_su�e + = +NULL +; + +135 +��_su�e + = + `CU_add_su�e +("D��y� wr�e", +NULL +, NULL); + +136 if(! +��_su�e +){ + +137 + `��tf +("Error�dding CUnit�est suite.\n"); + +142 || ! + `CU_add_�� +( +��_su�e +, "By� wr�e", +TEST_by�_wr�e +) + +143 || ! + `CU_add_�� +( +��_su�e +, "Tw�By� I�eg� wr�e", +TEST_u�t16_wr�e +) + +144 || ! + `CU_add_�� +( +��_su�e +, "Fou�By� I�eg� wr�e", +TEST_u�t32_wr�e +) + +145 || ! + `CU_add_�� +( +��_su�e +, "UTF-8 S��g wr�e", +TEST_�r�g_wr�e +) + +148 + `��tf +("Error�dding Datatype write CUnit�ests.\n"); + +153 + } +} + + @test/unit/persist_read_stubs.c + +1 + ~<time.h +> + +3 + #WITH_BROKER + + + ) + +5 + ~<logg�g_mosq.h +> + +6 + ~<mem�y_mosq.h +> + +7 + ~<mosqu�to_brok�_����.h +> + +8 + ~<�t_mosq.h +> + +9 + ~<�nd_mosq.h +> + +10 + ~<time_mosq.h +> + +12 +u�t64_t + +ϡ_���ed +; + +13 * +ϡ_sub +; + +14 +ϡ_qos +; + +15 +u�t32_t + +ϡ_id�tif�r +; + +17 +mosqu�to + * + $cڋxt__�� +( +mosqu�to_db + * +db +, +mosq_sock_t + +sock +) + +19 +mosqu�to + * +m +; + +21 +m + = + `mosqu�to__��oc +(1, ( +mosqu�to +)); + +22 if( +m +){ + +23 +m +-> +msgs_� +. +��ight_maximum + = 20; + +24 +m +-> +msgs_out +. +��ight_maximum + = 20; + +25 +m +-> +msgs_� +. +��ight_qu�a + = 20; + +26 +m +-> +msgs_out +. +��ight_qu�a + = 20; + +28 +m +; + +29 + } +} + +31 + $db__mes�ge_��e +( +mosqu�to_db + * +db +, cڡ +mosqu�to + * +sour� +, +u�t16_t + +sour�_mid +, * +t�ic +, +qos +, +u�t32_t + +�yl�d�n +, +mosqu�to__�yl�d_uh� + * +�yl�d +, +��� +, +mosqu�to_msg_��e + ** +��ed +, u�t32_� +mes�ge_exp�y_��rv� +, +mosqu�to_�ݔty + * +�ݔt�s +, +dbid_t + +��e_id +, +mosqu�to_msg_�ig� + +�ig� +) + +33 +mosqu�to_msg_��e + * +�mp + = +NULL +; + +34 +rc + = +MOSQ_ERR_SUCCESS +; + +36 +�mp + = + `mosqu�to__��oc +(1, ( +mosqu�to_msg_��e +)); + +37 if(! +�mp +){ + +38 +rc + = +MOSQ_ERR_NOMEM +; + +39 +�r� +; + +42 if( +sour� + && sour�-> +id +){ + +43 +�mp +-> +sour�_id + = + `mosqu�to__�rdup +( +sour� +-> +id +); + +45 +�mp +-> +sour�_id + = + `mosqu�to__�rdup +(""); + +47 if(! +�mp +-> +sour�_id +){ + +48 +rc + = +MOSQ_ERR_NOMEM +; + +49 +�r� +; + +52 if( +sour� + && sour�-> +u��ame +){ + +53 +�mp +-> +sour�_u��ame + = + `mosqu�to__�rdup +( +sour� +-> +u��ame +); + +54 if(! +�mp +-> +sour�_u��ame +){ + +55 +rc + = +MOSQ_ERR_NOMEM +; + +56 +�r� +; + +59 if( +sour� +){ + +60 +�mp +-> +sour�_li��� + = +sour� +-> +li��� +; + +62 +�mp +-> +sour�_mid + = source_mid; + +63 +�mp +-> +mid + = 0; + +64 +�mp +-> +qos + = qos; + +65 +�mp +-> +��� + =�etain; + +66 +�mp +-> +t�ic + =�opic; + +67 +t�ic + = +NULL +; + +68 +�mp +-> +�yl�d�n + =�ayloadlen; + +69 +�mp +-> +�ݔt�s + =�roperties; + +70 if( +�yl�d�n +){ + +71 + `UHPA_MOVE +( +�mp +-> +�yl�d +, *�yl�d, +�yl�d�n +); + +73 +�mp +-> +�yl�d +. +�r + = +NULL +; + +75 if( +mes�ge_exp�y_��rv� + > 0){ + +76 +�mp +-> +mes�ge_exp�y_time + = + `time +( +NULL +�+ +mes�ge_exp�y_��rv� +; + +78 +�mp +-> +mes�ge_exp�y_time + = 0; + +81 +�mp +-> +de�_ids + = +NULL +; + +82 +�mp +-> +de�_id_cou� + = 0; + +83 +db +-> +msg_��e_cou� +++; + +84 +db +-> +msg_��e_by�s + +� +�yl�d�n +; + +85 (* +��ed +�� +�mp +; + +87 if(! +��e_id +){ + +88 +�mp +-> +db_id + = ++ +db +-> +ϡ_db_id +; + +90 +�mp +-> +db_id + = +��e_id +; + +93 +db +-> +msg_��e + = +�mp +; + +95 +MOSQ_ERR_SUCCESS +; + +96 +�r� +: + +97 + `mosqu�to__� +( +t�ic +); + +98 if( +�mp +){ + +99 + `mosqu�to__� +( +�mp +-> +sour�_id +); + +100 + `mosqu�to__� +( +�mp +-> +sour�_u��ame +); + +101 + `mosqu�to__� +( +�mp +-> +t�ic +); + +102 + `mosqu�to__� +( +�mp +); + +104 + `UHPA_FREE +(* +�yl�d +, +�yl�d�n +); + +105 +rc +; + +106 + } +} + +108 + $log__��tf +( +mosqu�to + * +mosq +, +�iܙy +, cڡ * +fmt +, ...) + +111 + } +} + +113 +time_t + + $mosqu�to_time +() + +116 + } +} + +118 + $�t__sock�_�o� +( +mosqu�to_db + * +db +, +mosqu�to + * +mosq +) + +120 +MOSQ_ERR_SUCCESS +; + +121 + } +} + +123 + $�nd__p�g�q +( +mosqu�to + * +mosq +) + +125 +MOSQ_ERR_SUCCESS +; + +126 + } +} + +128 + $sub__add +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +sub +, +qos +, +u�t32_t + +id�tif�r +, +�ti�s +, +mosqu�to__subh�r + ** +ro� +) + +130 +ϡ_sub + = + `�rdup +( +sub +); + +131 +ϡ_qos + = +qos +; + +132 +ϡ_id�tif�r + = +id�tif�r +; + +134 +MOSQ_ERR_SUCCESS +; + +135 + } +} + +137 + $sub__mes�ges_queue +( +mosqu�to_db + * +db +, cڡ * +sour�_id +, cڡ * +t�ic +, +qos +, +��� +, +mosqu�to_msg_��e + ** +��ed +) + +139 if( +��� +){ + +140 +ϡ_���ed + = (* +��ed +)-> +db_id +; + +142 +MOSQ_ERR_SUCCESS +; + +143 + } +} + +146 + $db__msg_��e_�f_�c +( +mosqu�to_msg_��e + * +��e +) + +148 +��e +-> +�f_cou� +++; + +149 + } +} + + @test/unit/persist_read_test.c + +6 + ~<CUn�/CUn�.h +> + +7 + ~<CUn�/Basic.h +> + +9 + #WITH_BROKER + + + ) + +10 + #WITH_PERSISTENCE + + + ) + +12 + ~"mosqu�to_brok�_����.h +" + +13 + ~"�rsi�.h +" + +14 + ~"�ݔty_mosq.h +" + +16 +u�t64_t + + gϡ_���ed +; + +17 * + gϡ_sub + = +NULL +; + +18 + gϡ_qos +; + +19 +u�t32_t + + gϡ_id�tif�r +; + +21 + $TEST_�rsi���_di�b�d +() + +23 +mosqu�to_db + +db +; + +24 +mosqu�to__c�fig + +c�fig +; + +25 +rc +; + +27 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +28 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +29 +db +. +c�fig + = &config; + +31 +rc + = + `�rsi�__���e +(& +db +); + +32 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +33 + } +} + +36 + $TEST_em�y_f�e +() + +38 +mosqu�to_db + +db +; + +39 +mosqu�to__c�fig + +c�fig +; + +40 +rc +; + +42 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +43 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +44 +db +. +c�fig + = &config; + +46 +c�fig +. +�rsi��� + = +�ue +; + +48 +c�fig +. +�rsi���_f���h + = "files/persist_read/empty.test-db"; + +49 +rc + = + `�rsi�__���e +(& +db +); + +50 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +51 + } +} + +54 + $TEST_c�ru�_h�d� +() + +56 +mosqu�to_db + +db +; + +57 +mosqu�to__c�fig + +c�fig +; + +58 +rc +; + +60 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +61 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +62 +db +. +c�fig + = &config; + +64 +c�fig +. +�rsi��� + = +�ue +; + +66 +c�fig +. +�rsi���_f���h + = "files/persist_read/corrupt-header-short.test-db"; + +67 +rc + = + `�rsi�__���e +(& +db +); + +68 + `CU_ASSERT_EQUAL +( +rc +, 1); + +70 +c�fig +. +�rsi���_f���h + = "files/persist_read/corrupt-header-long.test-db"; + +71 +rc + = + `�rsi�__���e +(& +db +); + +72 + `CU_ASSERT_EQUAL +( +rc +, 1); + +73 + } +} + +75 + $TEST_unsu�܋d_v�si� +() + +77 +mosqu�to_db + +db +; + +78 +mosqu�to__c�fig + +c�fig +; + +79 +rc +; + +81 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +82 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +83 +db +. +c�fig + = &config; + +85 +c�fig +. +�rsi��� + = +�ue +; + +86 +c�fig +. +�rsi���_f���h + = "files/persist_read/unsupported-version.test-db"; + +88 +rc + = + `�rsi�__���e +(& +db +); + +89 + `CU_ASSERT_EQUAL +( +rc +, 1); + +90 + } +} + +93 + $TEST_v3_c�fig_ok +() + +95 +mosqu�to_db + +db +; + +96 +mosqu�to__c�fig + +c�fig +; + +97 +rc +; + +99 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +100 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +101 +db +. +c�fig + = &config; + +103 +c�fig +. +�rsi��� + = +�ue +; + +104 +c�fig +. +�rsi���_f���h + = "files/persist_read/v3-cfg.test-db"; + +106 +rc + = + `�rsi�__���e +(& +db +); + +107 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +108 + `CU_ASSERT_EQUAL +( +db +. +ϡ_db_id +, 0x7856341200000000); + +109 + } +} + +112 + $TEST_v4_c�fig_ok +() + +114 +mosqu�to_db + +db +; + +115 +mosqu�to__c�fig + +c�fig +; + +116 +rc +; + +118 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +119 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +120 +db +. +c�fig + = &config; + +122 +c�fig +. +�rsi��� + = +�ue +; + +123 +c�fig +. +�rsi���_f���h + = "files/persist_read/v4-cfg.test-db"; + +125 +rc + = + `�rsi�__���e +(& +db +); + +126 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +127 + `CU_ASSERT_EQUAL +( +db +. +ϡ_db_id +, 0x7856341200000000); + +128 + } +} + +131 + $TEST_v3_c�fig_�un��d +() + +133 +mosqu�to_db + +db +; + +134 +mosqu�to__c�fig + +c�fig +; + +135 +rc +; + +137 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +138 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +139 +db +. +c�fig + = &config; + +141 +c�fig +. +�rsi��� + = +�ue +; + +142 +c�fig +. +�rsi���_f���h + = "files/persist_read/v3-cfg-truncated.test-db"; + +144 +rc + = + `�rsi�__���e +(& +db +); + +145 + `CU_ASSERT_EQUAL +( +rc +, 1); + +146 + `CU_ASSERT_EQUAL +( +db +. +ϡ_db_id +, 0); + +147 + } +} + +150 + $TEST_v3_c�fig_bad_dbid +() + +152 +mosqu�to_db + +db +; + +153 +mosqu�to__c�fig + +c�fig +; + +154 +rc +; + +156 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +157 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +158 +db +. +c�fig + = &config; + +160 +c�fig +. +�rsi��� + = +�ue +; + +161 +c�fig +. +�rsi���_f���h + = "files/persist_read/v3-cfg-bad-dbid.test-db"; + +163 +rc + = + `�rsi�__���e +(& +db +); + +164 + `CU_ASSERT_EQUAL +( +rc +, 1); + +165 + `CU_ASSERT_EQUAL +( +db +. +ϡ_db_id +, 0); + +166 + } +} + +169 + $TEST_v3_bad_chunk +() + +171 +mosqu�to_db + +db +; + +172 +mosqu�to__c�fig + +c�fig +; + +173 +rc +; + +175 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +176 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +177 +db +. +c�fig + = &config; + +179 +c�fig +. +�rsi��� + = +�ue +; + +180 +c�fig +. +�rsi���_f���h + = "files/persist_read/v3-bad-chunk.test-db"; + +182 +rc + = + `�rsi�__���e +(& +db +); + +183 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +184 + `CU_ASSERT_EQUAL +( +db +. +ϡ_db_id +, 0x17); + +185 + } +} + +188 + $TEST_v3_mes�ge_��e +() + +190 +mosqu�to_db + +db +; + +191 +mosqu�to__c�fig + +c�fig +; + +192 +rc +; + +194 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +195 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +196 +db +. +c�fig + = &config; + +198 +c�fig +. +�rsi��� + = +�ue +; + +199 +c�fig +. +�rsi���_f���h + = "files/persist_read/v3-message-store.test-db"; + +201 +rc + = + `�rsi�__���e +(& +db +); + +202 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +203 + `CU_ASSERT_EQUAL +( +db +. +msg_��e_cou� +, 1); + +204 + `CU_ASSERT_EQUAL +( +db +. +msg_��e_by�s +, 7); + +205 + `CU_ASSERT_PTR_NOT_NULL +( +db +. +msg_��e +); + +206 if( +db +. +msg_��e +){ + +207 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +db_id +, 1); + +208 + `CU_ASSERT_STRING_EQUAL +( +db +. +msg_��e +-> +sour�_id +, "source_id"); + +209 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +sour�_mid +, 2); + +210 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +mid +, 0); + +211 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +qos +, 2); + +212 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +��� +, 1); + +213 + `CU_ASSERT_PTR_NOT_NULL +( +db +. +msg_��e +-> +t�ic +); + +214 if( +db +. +msg_��e +-> +t�ic +){ + +215 + `CU_ASSERT_STRING_EQUAL +( +db +. +msg_��e +-> +t�ic +, "topic"); + +217 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +�yl�d�n +, 7); + +218 if( +db +. +msg_��e +-> +�yl�d�n + == 7){ + +219 + `CU_ASSERT_NSTRING_EQUAL +( + `UHPA_ACCESS_PAYLOAD +( +db +. +msg_��e +), "payload", 7); + +222 + } +} + +224 + $TEST_v3_��� +() + +226 +mosqu�to_db + +db +; + +227 +mosqu�to__c�fig + +c�fig +; + +228 +mosqu�to + * +cڋxt +; + +229 +rc +; + +231 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +232 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +233 +db +. +c�fig + = &config; + +235 +c�fig +. +�rsi��� + = +�ue +; + +236 +c�fig +. +�rsi���_f���h + = "files/persist_read/v3-client.test-db"; + +238 +rc + = + `�rsi�__���e +(& +db +); + +239 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +241 + `CU_ASSERT_PTR_NOT_NULL +( +db +. +cڋxts_by_id +); + +242 + `HASH_FIND +( +hh_id +, +db +. +cڋxts_by_id +, "���-id", + `��� +("���-id"), +cڋxt +); + +243 + `CU_ASSERT_PTR_NOT_NULL +( +cڋxt +); + +244 if( +cڋxt +){ + +245 + `CU_ASSERT_PTR_NULL +( +cڋxt +-> +msgs_� +. +��ight +); + +246 + `CU_ASSERT_PTR_NULL +( +cڋxt +-> +msgs_out +. +��ight +); + +247 + `CU_ASSERT_EQUAL +( +cڋxt +-> +ϡ_mid +, 0x5287); + +249 + } +} + +251 + $TEST_v3_���_mes�ge +() + +253 +mosqu�to_db + +db +; + +254 +mosqu�to__c�fig + +c�fig +; + +255 +mosqu�to + * +cڋxt +; + +256 +rc +; + +258 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +259 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +260 +db +. +c�fig + = &config; + +262 +c�fig +. +�rsi��� + = +�ue +; + +263 +c�fig +. +�rsi���_f���h + = "files/persist_read/v3-client-message.test-db"; + +264 +c�fig +. +max_��ight_mes�ges + = 20; + +266 +rc + = + `�rsi�__���e +(& +db +); + +267 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +269 + `CU_ASSERT_PTR_NOT_NULL +( +db +. +cڋxts_by_id +); + +270 + `HASH_FIND +( +hh_id +, +db +. +cڋxts_by_id +, "���-id", + `��� +("���-id"), +cڋxt +); + +271 + `CU_ASSERT_PTR_NOT_NULL +( +cڋxt +); + +272 if( +cڋxt +){ + +273 + `CU_ASSERT_PTR_NOT_NULL +( +cڋxt +-> +msgs_out +. +��ight +); + +274 if( +cڋxt +-> +msgs_out +. +��ight +){ + +275 + `CU_ASSERT_PTR_NULL +( +cڋxt +-> +msgs_out +. +��ight +-> +�xt +); + +276 + `CU_ASSERT_PTR_NOT_NULL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +); + +277 if( +cڋxt +-> +msgs_out +. +��ight +-> +��e +){ + +278 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +�f_cou� +, 1); + +279 + `CU_ASSERT_STRING_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +sour�_id +, "source_id"); + +280 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +sour�_mid +, 2); + +281 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +mid +, 0); + +282 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +qos +, 2); + +283 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +��� +, 1); + +284 + `CU_ASSERT_PTR_NOT_NULL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +t�ic +); + +285 if( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +t�ic +){ + +286 + `CU_ASSERT_STRING_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +t�ic +, "topic"); + +288 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +�yl�d�n +, 7); + +289 if( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +�yl�d�n + == 7){ + +290 + `CU_ASSERT_NSTRING_EQUAL +( + `UHPA_ACCESS_PAYLOAD +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +), "payload", 7); + +293 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +mid +, 0x73); + +294 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +qos +, 1); + +295 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��� +, 0); + +296 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +d�e�i� +, +mosq_md_out +); + +297 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +, +mosq_ms_wa�_f�_puback +); + +298 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +dup +, 0); + +299 + `CU_ASSERT_PTR_NULL +( +cڋxt +-> +msgs_out +. +��ight +-> +�ݔt�s +); + +302 + } +} + +304 + $TEST_v3_��� +() + +306 +mosqu�to_db + +db +; + +307 +mosqu�to__c�fig + +c�fig +; + +308 +rc +; + +310 +ϡ_���ed + = 0; + +312 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +313 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +314 +db +. +c�fig + = &config; + +316 +c�fig +. +�rsi��� + = +�ue +; + +317 +c�fig +. +�rsi���_f���h + = "files/persist_read/v3-retain.test-db"; + +319 +rc + = + `�rsi�__���e +(& +db +); + +320 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +321 + `CU_ASSERT_EQUAL +( +db +. +msg_��e_cou� +, 1); + +322 + `CU_ASSERT_EQUAL +( +db +. +msg_��e_by�s +, 7); + +323 + `CU_ASSERT_PTR_NOT_NULL +( +db +. +msg_��e +); + +324 if( +db +. +msg_��e +){ + +325 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +db_id +, 0x54); + +326 + `CU_ASSERT_STRING_EQUAL +( +db +. +msg_��e +-> +sour�_id +, "source_id"); + +327 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +sour�_mid +, 2); + +328 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +mid +, 0); + +329 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +qos +, 2); + +330 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +��� +, 1); + +331 + `CU_ASSERT_PTR_NOT_NULL +( +db +. +msg_��e +-> +t�ic +); + +332 if( +db +. +msg_��e +-> +t�ic +){ + +333 + `CU_ASSERT_STRING_EQUAL +( +db +. +msg_��e +-> +t�ic +, "topic"); + +335 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +�yl�d�n +, 7); + +336 if( +db +. +msg_��e +-> +�yl�d�n + == 7){ + +337 + `CU_ASSERT_NSTRING_EQUAL +( + `UHPA_ACCESS_PAYLOAD +( +db +. +msg_��e +), "payload", 7); + +340 + `CU_ASSERT_EQUAL +( +ϡ_���ed +, 0x54); + +341 + } +} + +343 + $TEST_v3_sub +() + +345 +mosqu�to_db + +db +; + +346 +mosqu�to__c�fig + +c�fig +; + +347 +mosqu�to + * +cڋxt +; + +348 +rc +; + +350 +ϡ_sub + = +NULL +; + +351 +ϡ_qos + = -1; + +353 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +354 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +355 +db +. +c�fig + = &config; + +357 +c�fig +. +�rsi��� + = +�ue +; + +358 +c�fig +. +�rsi���_f���h + = "files/persist_read/v3-sub.test-db"; + +360 +rc + = + `�rsi�__���e +(& +db +); + +361 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +363 + `CU_ASSERT_PTR_NOT_NULL +( +db +. +cڋxts_by_id +); + +364 + `HASH_FIND +( +hh_id +, +db +. +cڋxts_by_id +, "���-id", + `��� +("���-id"), +cڋxt +); + +365 + `CU_ASSERT_PTR_NOT_NULL +( +cڋxt +); + +366 if( +cڋxt +){ + +367 + `CU_ASSERT_PTR_NOT_NULL +( +ϡ_sub +); + +368 if( +ϡ_sub +){ + +369 + `CU_ASSERT_STRING_EQUAL +( +ϡ_sub +, "subscription") + +370 + `� +( +ϡ_sub +); + +372 + `CU_ASSERT_EQUAL +( +ϡ_qos +, 1); + +374 + } +} + +376 + $TEST_v4_mes�ge_��e +() + +378 +mosqu�to_db + +db +; + +379 +mosqu�to__c�fig + +c�fig +; + +380 +rc +; + +382 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +383 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +384 +db +. +c�fig + = &config; + +386 +c�fig +. +�rsi��� + = +�ue +; + +387 +c�fig +. +�rsi���_f���h + = "files/persist_read/v4-message-store.test-db"; + +389 +rc + = + `�rsi�__���e +(& +db +); + +390 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +391 + `CU_ASSERT_EQUAL +( +db +. +msg_��e_cou� +, 1); + +392 + `CU_ASSERT_EQUAL +( +db +. +msg_��e_by�s +, 7); + +393 + `CU_ASSERT_PTR_NOT_NULL +( +db +. +msg_��e +); + +394 if( +db +. +msg_��e +){ + +395 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +db_id +, 0xFEDCBA9876543210); + +396 + `CU_ASSERT_STRING_EQUAL +( +db +. +msg_��e +-> +sour�_id +, "source_id"); + +397 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +sour�_mid +, 0x88); + +398 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +mid +, 0); + +399 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +qos +, 1); + +400 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +��� +, 0); + +401 + `CU_ASSERT_PTR_NOT_NULL +( +db +. +msg_��e +-> +t�ic +); + +402 if( +db +. +msg_��e +-> +t�ic +){ + +403 + `CU_ASSERT_STRING_EQUAL +( +db +. +msg_��e +-> +t�ic +, "topic"); + +405 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +�yl�d�n +, 7); + +406 if( +db +. +msg_��e +-> +�yl�d�n + == 7){ + +407 + `CU_ASSERT_NSTRING_EQUAL +( + `UHPA_ACCESS_PAYLOAD +( +db +. +msg_��e +), "payload", 7); + +410 + } +} + +412 + $TEST_v5_c�fig_ok +() + +414 +mosqu�to_db + +db +; + +415 +mosqu�to__c�fig + +c�fig +; + +416 +rc +; + +418 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +419 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +420 +db +. +c�fig + = &config; + +422 +c�fig +. +�rsi��� + = +�ue +; + +423 +c�fig +. +�rsi���_f���h + = "files/persist_read/v5-cfg.test-db"; + +425 +rc + = + `�rsi�__���e +(& +db +); + +426 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +427 + `CU_ASSERT_EQUAL +( +db +. +ϡ_db_id +, 0x7856341200000000); + +428 + } +} + +431 + $TEST_v5_c�fig_�un��d +() + +433 +mosqu�to_db + +db +; + +434 +mosqu�to__c�fig + +c�fig +; + +435 +rc +; + +437 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +438 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +439 +db +. +c�fig + = &config; + +441 +c�fig +. +�rsi��� + = +�ue +; + +442 +c�fig +. +�rsi���_f���h + = "files/persist_read/v5-cfg-truncated.test-db"; + +444 +rc + = + `�rsi�__���e +(& +db +); + +445 + `CU_ASSERT_EQUAL +( +rc +, 1); + +446 + `CU_ASSERT_EQUAL +( +db +. +ϡ_db_id +, 0); + +447 + } +} + +450 + $TEST_v5_bad_chunk +() + +452 +mosqu�to_db + +db +; + +453 +mosqu�to__c�fig + +c�fig +; + +454 +rc +; + +456 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +457 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +458 +db +. +c�fig + = &config; + +460 +c�fig +. +�rsi��� + = +�ue +; + +461 +c�fig +. +�rsi���_f���h + = "files/persist_read/v5-bad-chunk.test-db"; + +463 +rc + = + `�rsi�__���e +(& +db +); + +464 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +465 + `CU_ASSERT_EQUAL +( +db +. +ϡ_db_id +, 0x17); + +466 + } +} + +469 + $TEST_v5_mes�ge_��e +() + +471 +mosqu�to_db + +db +; + +472 +mosqu�to__c�fig + +c�fig +; + +473 +rc +; + +475 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +476 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +477 +db +. +c�fig + = &config; + +479 +c�fig +. +�rsi��� + = +�ue +; + +480 +c�fig +. +�rsi���_f���h + = "files/persist_read/v5-message-store.test-db"; + +482 +rc + = + `�rsi�__���e +(& +db +); + +483 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +484 + `CU_ASSERT_EQUAL +( +db +. +msg_��e_cou� +, 1); + +485 + `CU_ASSERT_EQUAL +( +db +. +msg_��e_by�s +, 7); + +486 + `CU_ASSERT_PTR_NOT_NULL +( +db +. +msg_��e +); + +487 if( +db +. +msg_��e +){ + +488 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +db_id +, 1); + +489 + `CU_ASSERT_STRING_EQUAL +( +db +. +msg_��e +-> +sour�_id +, "source_id"); + +490 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +sour�_mid +, 2); + +491 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +mid +, 0); + +492 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +qos +, 2); + +493 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +��� +, 1); + +494 + `CU_ASSERT_STRING_EQUAL +( +db +. +msg_��e +-> +t�ic +, "topic"); + +495 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +�yl�d�n +, 7); + +496 if( +db +. +msg_��e +-> +�yl�d�n + == 7){ + +497 + `CU_ASSERT_NSTRING_EQUAL +( + `UHPA_ACCESS_PAYLOAD +( +db +. +msg_��e +), "payload", 7); + +499 + `CU_ASSERT_PTR_NULL +( +db +. +msg_��e +-> +�ݔt�s +); + +501 + } +} + +504 + $TEST_v5_mes�ge_��e_��s +() + +506 +mosqu�to_db + +db +; + +507 +mosqu�to__c�fig + +c�fig +; + +508 +mosqu�to__li��� + +li��� +; + +509 +rc +; + +511 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +512 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +513 + `mem�t +(& +li��� +, 0, ( +mosqu�to__li��� +)); + +514 +db +. +c�fig + = &config; + +516 +li��� +. +p�t + = 1883; + +517 +c�fig +. +li���s + = & +li��� +; + +518 +c�fig +. +li���_cou� + = 1; + +520 +c�fig +. +�rsi��� + = +�ue +; + +521 +c�fig +. +�rsi���_f���h + = "files/persist_read/v5-message-store-props.test-db"; + +523 +rc + = + `�rsi�__���e +(& +db +); + +524 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +525 + `CU_ASSERT_EQUAL +( +db +. +msg_��e_cou� +, 1); + +526 + `CU_ASSERT_EQUAL +( +db +. +msg_��e_by�s +, 7); + +527 + `CU_ASSERT_PTR_NOT_NULL +( +db +. +msg_��e +); + +528 if( +db +. +msg_��e +){ + +529 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +db_id +, 1); + +530 + `CU_ASSERT_STRING_EQUAL +( +db +. +msg_��e +-> +sour�_id +, "source_id"); + +531 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +sour�_mid +, 2); + +532 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +mid +, 0); + +533 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +qos +, 2); + +534 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +��� +, 1); + +535 + `CU_ASSERT_STRING_EQUAL +( +db +. +msg_��e +-> +t�ic +, "topic"); + +536 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +�yl�d�n +, 7); + +537 if( +db +. +msg_��e +-> +�yl�d�n + == 7){ + +538 + `CU_ASSERT_NSTRING_EQUAL +( + `UHPA_ACCESS_PAYLOAD +( +db +. +msg_��e +), "payload", 7); + +540 + `CU_ASSERT_PTR_NOT_NULL +( +db +. +msg_��e +-> +�ݔt�s +); + +541 if( +db +. +msg_��e +-> +�ݔt�s +){ + +542 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +�ݔt�s +-> +id�tif�r +, 1); + +543 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +�ݔt�s +-> +v�ue +. +i8 +, 1); + +545 + `CU_ASSERT_PTR_NOT_NULL +( +db +. +msg_��e +-> +sour�_li��� +); + +547 + } +} + +549 + $TEST_v5_��� +() + +551 +mosqu�to_db + +db +; + +552 +mosqu�to__c�fig + +c�fig +; + +553 +mosqu�to + * +cڋxt +; + +554 +rc +; + +556 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +557 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +558 +db +. +c�fig + = &config; + +560 +c�fig +. +�rsi��� + = +�ue +; + +561 +c�fig +. +�rsi���_f���h + = "files/persist_read/v5-client.test-db"; + +563 +rc + = + `�rsi�__���e +(& +db +); + +564 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +566 + `CU_ASSERT_PTR_NOT_NULL +( +db +. +cڋxts_by_id +); + +567 + `HASH_FIND +( +hh_id +, +db +. +cڋxts_by_id +, "���-id", + `��� +("���-id"), +cڋxt +); + +568 + `CU_ASSERT_PTR_NOT_NULL +( +cڋxt +); + +569 if( +cڋxt +){ + +570 + `CU_ASSERT_PTR_NULL +( +cڋxt +-> +msgs_� +. +��ight +); + +571 + `CU_ASSERT_PTR_NULL +( +cڋxt +-> +msgs_out +. +��ight +); + +572 + `CU_ASSERT_EQUAL +( +cڋxt +-> +ϡ_mid +, 0x5287); + +574 + } +} + +576 + $TEST_v5_���_mes�ge +() + +578 +mosqu�to_db + +db +; + +579 +mosqu�to__c�fig + +c�fig +; + +580 +mosqu�to + * +cڋxt +; + +581 +rc +; + +583 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +584 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +585 +db +. +c�fig + = &config; + +587 +c�fig +. +�rsi��� + = +�ue +; + +588 +c�fig +. +�rsi���_f���h + = "files/persist_read/v5-client-message.test-db"; + +590 +rc + = + `�rsi�__���e +(& +db +); + +591 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +593 + `CU_ASSERT_PTR_NOT_NULL +( +db +. +cڋxts_by_id +); + +594 + `HASH_FIND +( +hh_id +, +db +. +cڋxts_by_id +, "���-id", + `��� +("���-id"), +cڋxt +); + +595 + `CU_ASSERT_PTR_NOT_NULL +( +cڋxt +); + +596 if( +cڋxt +){ + +597 + `CU_ASSERT_PTR_NOT_NULL +( +cڋxt +-> +msgs_out +. +��ight +); + +598 if( +cڋxt +-> +msgs_out +. +��ight +){ + +599 + `CU_ASSERT_PTR_NULL +( +cڋxt +-> +msgs_out +. +��ight +-> +�xt +); + +600 + `CU_ASSERT_PTR_NOT_NULL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +); + +601 if( +cڋxt +-> +msgs_out +. +��ight +-> +��e +){ + +602 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +�f_cou� +, 1); + +603 + `CU_ASSERT_STRING_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +sour�_id +, "source_id"); + +604 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +sour�_mid +, 2); + +605 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +mid +, 0); + +606 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +qos +, 2); + +607 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +��� +, 1); + +608 + `CU_ASSERT_STRING_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +t�ic +, "topic"); + +609 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +�yl�d�n +, 7); + +610 if( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +�yl�d�n + == 7){ + +611 + `CU_ASSERT_NSTRING_EQUAL +( + `UHPA_ACCESS_PAYLOAD +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +), "payload", 7); + +614 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +mid +, 0x73); + +615 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +qos +, 1); + +616 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��� +, 0); + +617 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +d�e�i� +, +mosq_md_out +); + +618 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +, +mosq_ms_wa�_f�_puback +); + +619 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +dup +, 0); + +620 + `CU_ASSERT_PTR_NULL +( +cڋxt +-> +msgs_out +. +��ight +-> +�ݔt�s +); + +623 + } +} + +625 + $TEST_v5_���_mes�ge_��s +() + +627 +mosqu�to_db + +db +; + +628 +mosqu�to__c�fig + +c�fig +; + +629 +mosqu�to + * +cڋxt +; + +630 +rc +; + +632 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +633 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +634 +db +. +c�fig + = &config; + +636 +c�fig +. +�rsi��� + = +�ue +; + +637 +c�fig +. +�rsi���_f���h + = "files/persist_read/v5-client-message-props.test-db"; + +639 +rc + = + `�rsi�__���e +(& +db +); + +640 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +642 + `CU_ASSERT_PTR_NOT_NULL +( +db +. +cڋxts_by_id +); + +643 + `HASH_FIND +( +hh_id +, +db +. +cڋxts_by_id +, "���-id", + `��� +("���-id"), +cڋxt +); + +644 + `CU_ASSERT_PTR_NOT_NULL +( +cڋxt +); + +645 if( +cڋxt +){ + +646 + `CU_ASSERT_PTR_NOT_NULL +( +cڋxt +-> +msgs_out +. +��ight +); + +647 if( +cڋxt +-> +msgs_out +. +��ight +){ + +648 + `CU_ASSERT_PTR_NULL +( +cڋxt +-> +msgs_out +. +��ight +-> +�xt +); + +649 + `CU_ASSERT_PTR_NOT_NULL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +); + +650 if( +cڋxt +-> +msgs_out +. +��ight +-> +��e +){ + +651 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +�f_cou� +, 1); + +652 + `CU_ASSERT_STRING_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +sour�_id +, "source_id"); + +653 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +sour�_mid +, 2); + +654 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +mid +, 0); + +655 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +qos +, 2); + +656 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +��� +, 1); + +657 + `CU_ASSERT_STRING_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +t�ic +, "topic"); + +658 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +�yl�d�n +, 7); + +659 if( +cڋxt +-> +msgs_out +. +��ight +-> +��e +-> +�yl�d�n + == 7){ + +660 + `CU_ASSERT_NSTRING_EQUAL +( + `UHPA_ACCESS_PAYLOAD +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +), "payload", 7); + +663 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +mid +, 0x73); + +664 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +qos +, 1); + +665 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��� +, 0); + +666 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +d�e�i� +, +mosq_md_out +); + +667 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +��e +, +mosq_ms_wa�_f�_puback +); + +668 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +dup +, 0); + +669 + `CU_ASSERT_PTR_NOT_NULL +( +cڋxt +-> +msgs_out +. +��ight +-> +�ݔt�s +); + +670 if( +cڋxt +-> +msgs_out +. +��ight +-> +�ݔt�s +){ + +671 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +�ݔt�s +-> +id�tif�r +, 1); + +672 + `CU_ASSERT_EQUAL +( +cڋxt +-> +msgs_out +. +��ight +-> +�ݔt�s +-> +v�ue +. +i8 +, 1); + +676 + } +} + +678 + $TEST_v5_��� +() + +680 +mosqu�to_db + +db +; + +681 +mosqu�to__c�fig + +c�fig +; + +682 +rc +; + +684 +ϡ_���ed + = 0; + +686 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +687 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +688 +db +. +c�fig + = &config; + +690 +c�fig +. +�rsi��� + = +�ue +; + +691 +c�fig +. +�rsi���_f���h + = "files/persist_read/v5-retain.test-db"; + +693 +rc + = + `�rsi�__���e +(& +db +); + +694 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +695 + `CU_ASSERT_EQUAL +( +db +. +msg_��e_cou� +, 1); + +696 + `CU_ASSERT_EQUAL +( +db +. +msg_��e_by�s +, 7); + +697 + `CU_ASSERT_PTR_NOT_NULL +( +db +. +msg_��e +); + +698 if( +db +. +msg_��e +){ + +699 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +db_id +, 0x54); + +700 + `CU_ASSERT_STRING_EQUAL +( +db +. +msg_��e +-> +sour�_id +, "source_id"); + +701 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +sour�_mid +, 2); + +702 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +mid +, 0); + +703 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +qos +, 2); + +704 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +��� +, 1); + +705 + `CU_ASSERT_STRING_EQUAL +( +db +. +msg_��e +-> +t�ic +, "topic"); + +706 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +�yl�d�n +, 7); + +707 if( +db +. +msg_��e +-> +�yl�d�n + == 7){ + +708 + `CU_ASSERT_NSTRING_EQUAL +( + `UHPA_ACCESS_PAYLOAD +( +db +. +msg_��e +), "payload", 7); + +711 + `CU_ASSERT_EQUAL +( +ϡ_���ed +, 0x54); + +712 + } +} + +714 + $TEST_v5_sub +() + +716 +mosqu�to_db + +db +; + +717 +mosqu�to__c�fig + +c�fig +; + +718 +mosqu�to + * +cڋxt +; + +719 +rc +; + +721 +ϡ_sub + = +NULL +; + +722 +ϡ_qos + = -1; + +724 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +725 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +726 +db +. +c�fig + = &config; + +728 +c�fig +. +�rsi��� + = +�ue +; + +729 +c�fig +. +�rsi���_f���h + = "files/persist_read/v5-sub.test-db"; + +731 +rc + = + `�rsi�__���e +(& +db +); + +732 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +734 + `CU_ASSERT_PTR_NOT_NULL +( +db +. +cڋxts_by_id +); + +735 + `HASH_FIND +( +hh_id +, +db +. +cڋxts_by_id +, "���-id", + `��� +("���-id"), +cڋxt +); + +736 + `CU_ASSERT_PTR_NOT_NULL +( +cڋxt +); + +737 if( +cڋxt +){ + +738 + `CU_ASSERT_PTR_NOT_NULL +( +ϡ_sub +); + +739 if( +ϡ_sub +){ + +740 + `CU_ASSERT_STRING_EQUAL +( +ϡ_sub +, "subscription") + +741 + `� +( +ϡ_sub +); + +743 + `CU_ASSERT_EQUAL +( +ϡ_qos +, 1); + +744 + `CU_ASSERT_EQUAL +( +ϡ_id�tif�r +, 0x7623); + +746 + } +} + +752 + $��_�rsi�_�ad_��s +() + +754 +CU_pSu�e + +��_su�e + = +NULL +; + +756 +��_su�e + = + `CU_add_su�e +("P�si���d", +NULL +, NULL); + +757 if(! +��_su�e +){ + +758 + `��tf +("Error�dding CUnit�ersist�ead�est suite.\n"); + +763 || ! + `CU_add_�� +( +��_su�e +, "P�si��� di�b�d", +TEST_�rsi���_di�b�d +) + +764 || ! + `CU_add_�� +( +��_su�e +, "Em�y f�e", +TEST_em�y_f�e +) + +765 || ! + `CU_add_�� +( +��_su�e +, "C�ru� h�d�", +TEST_c�ru�_h�d� +) + +766 || ! + `CU_add_�� +( +��_su�e +, "Unsu�܋d v�si�", +TEST_unsu�܋d_v�si� +) + +767 || ! + `CU_add_�� +( +��_su�e +, "v3 c�fig ok", +TEST_v3_c�fig_ok +) + +768 || ! + `CU_add_�� +( +��_su�e +, "v3 c�fig bad�run��d", +TEST_v3_c�fig_�un��d +) + +769 || ! + `CU_add_�� +( +��_su�e +, "v3 c�fig bad dbid", +TEST_v3_c�fig_bad_dbid +) + +770 || ! + `CU_add_�� +( +��_su�e +, "v3 bad chunk", +TEST_v3_bad_chunk +) + +771 || ! + `CU_add_�� +( +��_su�e +, "v3 mes�g���e", +TEST_v3_mes�ge_��e +) + +772 || ! + `CU_add_�� +( +��_su�e +, "v3 cl��", +TEST_v3_��� +) + +773 || ! + `CU_add_�� +( +��_su�e +, "v3 cl�� mes�ge", +TEST_v3_���_mes�ge +) + +774 || ! + `CU_add_�� +( +��_su�e +, "v3��a�", +TEST_v3_��� +) + +775 || ! + `CU_add_�� +( +��_su�e +, "v3 sub", +TEST_v3_sub +) + +776 || ! + `CU_add_�� +( +��_su�e +, "v4 c�fig ok", +TEST_v4_c�fig_ok +) + +777 || ! + `CU_add_�� +( +��_su�e +, "v4 mes�g���e", +TEST_v4_mes�ge_��e +) + +778 || ! + `CU_add_�� +( +��_su�e +, "v5 c�fig ok", +TEST_v5_c�fig_ok +) + +779 || ! + `CU_add_�� +( +��_su�e +, "v5 c�fig bad�run��d", +TEST_v5_c�fig_�un��d +) + +780 || ! + `CU_add_�� +( +��_su�e +, "v5 bad chunk", +TEST_v5_bad_chunk +) + +781 || ! + `CU_add_�� +( +��_su�e +, "v5 mes�g���e", +TEST_v5_mes�ge_��e +) + +782 || ! + `CU_add_�� +( +��_su�e +, "v5 mes�g���e+��s", +TEST_v5_mes�ge_��e_��s +) + +783 || ! + `CU_add_�� +( +��_su�e +, "v5 cl��", +TEST_v5_��� +) + +784 || ! + `CU_add_�� +( +��_su�e +, "v5 cl�� mes�ge", +TEST_v5_���_mes�ge +) + +785 || ! + `CU_add_�� +( +��_su�e +, "v5 cl�� mes�ge+��s", +TEST_v5_���_mes�ge_��s +) + +786 || ! + `CU_add_�� +( +��_su�e +, "v5��a�", +TEST_v5_��� +) + +787 || ! + `CU_add_�� +( +��_su�e +, "v5 sub", +TEST_v5_sub +) + +790 + `��tf +("Error�dding�ersist CUnit�ests.\n"); + +795 + } +} + +797 + $ma� +( +�gc +, * +�gv +[]) + +799 +�s +; + +801 if( + `CU_���lize_�gi�ry +(�!� +CUE_SUCCESS +){ + +802 + `��tf +("Error initializing CUnit�egistry.\n"); + +807 || + `��_�rsi�_�ad_��s +() + +810 + `CU_��nup_�gi�ry +(); + +814 + `CU_basic_�t_mode +( +CU_BRM_VERBOSE +); + +815 + `CU_basic_run_��s +(); + +816 +�s + = + `CU_g�_numb�_of_�u�s +(); + +817 + `CU_��nup_�gi�ry +(); + +819 () +�s +; + +820 + } +} + + @test/unit/persist_write_stubs.c + +1 + ~<time.h +> + +3 + #WITH_BROKER + + + ) + +5 + ~<logg�g_mosq.h +> + +6 + ~<mem�y_mosq.h +> + +7 + ~<mosqu�to_brok�_����.h +> + +8 + ~<�t_mosq.h +> + +9 + ~<�nd_mosq.h +> + +10 + ~<time_mosq.h +> + +12 +u�t64_t + +ϡ_���ed +; + +13 * +ϡ_sub +; + +14 +ϡ_qos +; + +16 +mosqu�to + * + $cڋxt__�� +( +mosqu�to_db + * +db +, +mosq_sock_t + +sock +) + +18 + `mosqu�to__��oc +(1, ( +mosqu�to +)); + +19 + } +} + +21 + $log__��tf +( +mosqu�to + * +mosq +, +�iܙy +, cڡ * +fmt +, ...) + +24 + } +} + +26 +time_t + + $mosqu�to_time +() + +29 + } +} + +31 + $�t__sock�_�o� +( +mosqu�to_db + * +db +, +mosqu�to + * +mosq +) + +33 +MOSQ_ERR_SUCCESS +; + +34 + } +} + +36 + $�nd__p�g�q +( +mosqu�to + * +mosq +) + +38 +MOSQ_ERR_SUCCESS +; + +39 + } +} + +41 + $mosqu�to_a�_check +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +, cڡ * +t�ic +, +�yl�d�n +, * +�yl�d +, +qos +, +bo� + +��� +, +ac�ss +) + +43 +MOSQ_ERR_SUCCESS +; + +44 + } +} + +46 + $a�__f�d_a�s +( +mosqu�to_db + * +db +, +mosqu�to + * +cڋxt +) + +48 +MOSQ_ERR_SUCCESS +; + +49 + } +} + +52 + $�nd__publish +( +mosqu�to + * +mosq +, +u�t16_t + +mid +, cڡ * +t�ic +, +u�t32_t + +�yl�d�n +, cڡ * +�yl�d +, +qos +, +bo� + +��� +, bo� +dup +, cڡ +mosqu�to_�ݔty + * +cmsg_��s +, cڡ mosqu�to_�ݔty * +��e_��s +, u�t32_� +exp�y_��rv� +) + +54 +MOSQ_ERR_SUCCESS +; + +55 + } +} + +57 + $�nd__pubcomp +( +mosqu�to + * +mosq +, +u�t16_t + +mid +) + +59 +MOSQ_ERR_SUCCESS +; + +60 + } +} + +62 + $�nd__pub�c +( +mosqu�to + * +mosq +, +u�t16_t + +mid +, +u�t8_t + +�as�_code +) + +64 +MOSQ_ERR_SUCCESS +; + +65 + } +} + +67 + $�nd__pub�l +( +mosqu�to + * +mosq +, +u�t16_t + +mid +) + +69 +MOSQ_ERR_SUCCESS +; + +70 + } +} + + @test/unit/persist_write_test.c + +6 + ~<CUn�/CUn�.h +> + +7 + ~<CUn�/Basic.h +> + +9 + #WITH_BROKER + + + ) + +10 + #WITH_PERSISTENCE + + + ) + +12 + ~"mosqu�to_brok�_����.h +" + +13 + ~"�rsi�.h +" + +15 +u�t64_t + + gϡ_���ed +; + +16 * + gϡ_sub + = +NULL +; + +17 + gϡ_qos +; + +21 + $f�e_�ad +(cڡ * +f��ame +, +u�t8_t + ** +d�a +, +size_t + * +�n +) + +23 +FILE + * +� +; + +24 +size_t + +rc +; + +26 +� + = + `fݒ +( +f��ame +, "rb"); + +27 if(! +� +) 1; + +29 + `f�ek +( +� +, 0, +SEEK_END +); + +30 * +�n + = + `�l +( +� +); + +31 * +d�a + = + `m�loc +(* +�n +); + +32 if(!(* +d�a +)){ + +33 + `f�o� +( +� +); + +36 + `f�ek +( +� +, 0, +SEEK_SET +); + +37 +rc + = + `�d +(* +d�a +, 1, * +�n +, +� +); + +38 + `f�o� +( +� +); + +40 if( +rc + =�* +�n +){ + +43 * +�n + = 0; + +44 + `� +(* +d�a +); + +47 + } +} + +50 + $f�e_diff +(cڡ * +�e +, cڡ * +two +) + +52 +size_t + +�n1 +, +�n2 +; + +53 +u�t8_t + * +d�a1 + = +NULL +, * +d�a2 + = NULL; + +54 +rc + = 1; + +56 if( + `f�e_�ad +( +�e +, & +d�a1 +, & +�n1 +)){ + +60 if( + `f�e_�ad +( +two +, & +d�a2 +, & +�n2 +)){ + +61 + `� +( +d�a1 +); + +65 if( +�n1 + =� +�n2 +){ + +66 +rc + = + `memcmp +( +d�a1 +, +d�a2 +, +�n1 +); + +68 + `� +( +d�a1 +); + +69 + `� +( +d�a2 +); + +71 +rc +; + +72 + } +} + +74 + $TEST_�rsi���_di�b�d +() + +76 +mosqu�to_db + +db +; + +77 +mosqu�to__c�fig + +c�fig +; + +78 +rc +; + +80 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +81 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +82 +db +. +c�fig + = &config; + +84 +rc + = + `�rsi�__backup +(& +db +, +�l� +); + +85 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +87 +c�fig +. +�rsi���_f���h + = "disabled.db"; + +88 +rc + = + `�rsi�__backup +(& +db +, +�l� +); + +89 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +90 + } +} + +93 + $TEST_em�y_f�e +() + +95 +mosqu�to_db + +db +; + +96 +mosqu�to__c�fig + +c�fig +; + +97 +rc +; + +99 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +100 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +101 +db +. +c�fig + = &config; + +103 +c�fig +. +�rsi��� + = +�ue +; + +105 +c�fig +. +�rsi���_f���h + = "empty.db"; + +106 +rc + = + `�rsi�__backup +(& +db +, +�l� +); + +107 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +108 + `CU_ASSERT_EQUAL +(0, + `f�e_diff +("files/persist_write/empty.test-db", "empty.db")); + +109 + `uƚk +("empty.db"); + +110 + } +} + +113 + $TEST_v5_c�fig_ok +() + +115 +mosqu�to_db + +db +; + +116 +mosqu�to__c�fig + +c�fig +; + +117 +rc +; + +119 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +120 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +121 +db +. +c�fig + = &config; + +123 +c�fig +. +�rsi��� + = +�ue +; + +124 +c�fig +. +�rsi���_f���h + = "files/persist_read/v5-cfg.test-db"; + +125 +rc + = + `�rsi�__���e +(& +db +); + +126 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +128 +c�fig +. +�rsi���_f���h + = "v5-cfg.db"; + +129 +rc + = + `�rsi�__backup +(& +db +, +�ue +); + +130 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +132 + `CU_ASSERT_EQUAL +(0, + `f�e_diff +("files/persist_read/v5-cfg.test-db", "v5-cfg.db")); + +133 + `uƚk +("v5-cfg.db"); + +134 + } +} + +137 + $TEST_v5_mes�ge_��e_no_�f +() + +139 +mosqu�to_db + +db +; + +140 +mosqu�to__c�fig + +c�fig +; + +141 +rc +; + +143 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +144 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +145 +db +. +c�fig + = &config; + +147 +c�fig +. +�rsi��� + = +�ue +; + +148 +c�fig +. +�rsi���_f���h + = "files/persist_read/v5-message-store.test-db"; + +149 +rc + = + `�rsi�__���e +(& +db +); + +150 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +152 +c�fig +. +�rsi���_f���h + = "v5-message-store-no-ref.db"; + +153 +rc + = + `�rsi�__backup +(& +db +, +�ue +); + +154 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +156 + `CU_ASSERT_EQUAL +(0, + `f�e_diff +("files/persist_write/v5-message-store-no-ref.test-db", "v5-message-store-no-ref.db")); + +157 + `uƚk +("v5-message-store-no-ref.db"); + +158 + } +} + +161 + $TEST_v5_mes�ge_��e_��s +() + +163 +mosqu�to_db + +db +; + +164 +mosqu�to__c�fig + +c�fig +; + +165 +mosqu�to__li��� + +li��� +; + +166 +rc +; + +168 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +169 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +170 + `mem�t +(& +li��� +, 0, ( +mosqu�to__li��� +)); + +171 +db +. +c�fig + = &config; + +172 +li��� +. +p�t + = 1883; + +173 +c�fig +. +li���s + = & +li��� +; + +174 +c�fig +. +li���_cou� + = 1; + +176 +c�fig +. +�rsi��� + = +�ue +; + +177 +c�fig +. +�rsi���_f���h + = "files/persist_read/v5-message-store-props.test-db"; + +178 +rc + = + `�rsi�__���e +(& +db +); + +179 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +181 +c�fig +. +�rsi���_f���h + = "v5-message-store-props.db"; + +182 +rc + = + `�rsi�__backup +(& +db +, +�ue +); + +183 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +185 + `CU_ASSERT_EQUAL +(0, + `f�e_diff +("files/persist_read/v5-message-store-props.test-db", "v5-message-store-props.db")); + +186 + `uƚk +("v5-message-store-props.db"); + +187 + } +} + +190 + $TEST_v5_��� +() + +192 +mosqu�to_db + +db +; + +193 +mosqu�to__c�fig + +c�fig +; + +194 +rc +; + +196 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +197 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +198 +db +. +c�fig + = &config; + +200 +c�fig +. +�rsi��� + = +�ue +; + +201 +c�fig +. +�rsi���_f���h + = "files/persist_read/v5-client.test-db"; + +202 +rc + = + `�rsi�__���e +(& +db +); + +203 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +205 +c�fig +. +�rsi���_f���h + = "v5-client.db"; + +206 +rc + = + `�rsi�__backup +(& +db +, +�ue +); + +207 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +209 + `CU_ASSERT_EQUAL +(0, + `f�e_diff +("files/persist_read/v5-client.test-db", "v5-client.db")); + +210 + `uƚk +("v5-client.db"); + +211 + } +} + +214 + $TEST_v5_���_mes�ge +() + +216 +mosqu�to_db + +db +; + +217 +mosqu�to__c�fig + +c�fig +; + +218 +mosqu�to__li��� + +li��� +; + +219 +rc +; + +221 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +222 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +223 + `mem�t +(& +li��� +, 0, ( +mosqu�to__li��� +)); + +224 +db +. +c�fig + = &config; + +225 +li��� +. +p�t + = 1883; + +226 +c�fig +. +li���s + = & +li��� +; + +227 +c�fig +. +li���_cou� + = 1; + +229 +c�fig +. +�rsi��� + = +�ue +; + +230 +c�fig +. +�rsi���_f���h + = "files/persist_read/v5-client-message.test-db"; + +231 +rc + = + `�rsi�__���e +(& +db +); + +232 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +234 +c�fig +. +�rsi���_f���h + = "v5-client-message.db"; + +235 +rc + = + `�rsi�__backup +(& +db +, +�ue +); + +236 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +238 + `CU_ASSERT_EQUAL +(0, + `f�e_diff +("files/persist_read/v5-client-message.test-db", "v5-client-message.db")); + +239 + `uƚk +("v5-client-message.db"); + +240 + } +} + +243 + $TEST_v5_���_mes�ge_��s +() + +245 +mosqu�to_db + +db +; + +246 +mosqu�to__c�fig + +c�fig +; + +247 +mosqu�to__li��� + +li��� +; + +248 +rc +; + +250 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +251 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +252 + `mem�t +(& +li��� +, 0, ( +mosqu�to__li��� +)); + +253 +db +. +c�fig + = &config; + +254 +li��� +. +p�t + = 1883; + +255 +c�fig +. +li���s + = & +li��� +; + +256 +c�fig +. +li���_cou� + = 1; + +258 +c�fig +. +�rsi��� + = +�ue +; + +259 +c�fig +. +�rsi���_f���h + = "files/persist_read/v5-client-message-props.test-db"; + +260 +rc + = + `�rsi�__���e +(& +db +); + +261 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +263 + `CU_ASSERT_PTR_NOT_NULL +( +db +. +msg_��e +); + +264 if( +db +. +msg_��e +){ + +265 + `CU_ASSERT_PTR_NOT_NULL +( +db +. +msg_��e +-> +sour�_li��� +); + +266 if( +db +. +msg_��e +-> +sour�_li��� +){ + +267 + `CU_ASSERT_EQUAL +( +db +. +msg_��e +-> +sour�_li��� +-> +p�t +, 1883); + +271 +c�fig +. +�rsi���_f���h + = "v5-client-message-props.db"; + +272 +rc + = + `�rsi�__backup +(& +db +, +�ue +); + +273 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +275 + `CU_ASSERT_EQUAL +(0, + `f�e_diff +("files/persist_read/v5-client-message-props.test-db", "v5-client-message-props.db")); + +276 + `uƚk +("v5-client-message-props.db"); + +277 + } +} + +280 + $TEST_v5_sub +() + +282 +mosqu�to_db + +db +; + +283 +mosqu�to__c�fig + +c�fig +; + +284 +mosqu�to__li��� + +li��� +; + +285 +rc +; + +287 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +288 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +289 + `mem�t +(& +li��� +, 0, ( +mosqu�to__li��� +)); + +290 +db +. +c�fig + = &config; + +291 +li��� +. +p�t + = 1883; + +292 +c�fig +. +li���s + = & +li��� +; + +293 +c�fig +. +li���_cou� + = 1; + +295 + `db__ݒ +(& +c�fig +, & +db +); + +297 +c�fig +. +�rsi��� + = +�ue +; + +298 +c�fig +. +�rsi���_f���h + = "files/persist_read/v5-sub.test-db"; + +299 +rc + = + `�rsi�__���e +(& +db +); + +300 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +302 +c�fig +. +�rsi���_f���h + = "v5-sub.db"; + +303 +rc + = + `�rsi�__backup +(& +db +, +�ue +); + +304 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +306 + `CU_ASSERT_EQUAL +(0, + `f�e_diff +("files/persist_read/v5-sub.test-db", "v5-sub.db")); + +307 + `uƚk +("v5-sub.db"); + +308 + } +} + +312 +NOT + +WORKING + + +313 + $TEST_v5_fu� +() + +315 +mosqu�to_db + +db +; + +316 +mosqu�to__c�fig + +c�fig +; + +317 +rc +; + +319 + `mem�t +(& +db +, 0, ( +mosqu�to_db +)); + +320 + `mem�t +(& +c�fig +, 0, ( +mosqu�to__c�fig +)); + +321 +db +. +c�fig + = &config; + +323 + `db__ݒ +(& +c�fig +, & +db +); + +325 +c�fig +. +�rsi��� + = +�ue +; + +326 +c�fig +. +�rsi���_f���h + = "files/persist_write/v5-full.test-db"; + +327 +rc + = + `�rsi�__���e +(& +db +); + +328 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +330 +c�fig +. +�rsi���_f���h + = "v5-full.db"; + +331 +rc + = + `�rsi�__backup +(& +db +, +�ue +); + +332 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +334 + `CU_ASSERT_EQUAL +(0, + `f�e_diff +("files/persist_write/v5-full.test-db", "v5-full.db")); + +335 + `uƚk +("v5-full.db"); + +336 + } +} + +345 + $ma� +( +�gc +, * +�gv +[]) + +347 +CU_pSu�e + +��_su�e + = +NULL +; + +348 +�s +; + +350 if( + `CU_���lize_�gi�ry +(�!� +CUE_SUCCESS +){ + +351 + `��tf +("Error initializing CUnit�egistry.\n"); + +355 +��_su�e + = + `CU_add_su�e +("P�si� wr�e", +NULL +, NULL); + +356 if(! +��_su�e +){ + +357 + `��tf +("Error�dding CUnit�ersist write�est suite.\n"); + +358 + `CU_��nup_�gi�ry +(); + +363 || ! + `CU_add_�� +( +��_su�e +, "P�si��� di�b�d", +TEST_�rsi���_di�b�d +) + +364 || ! + `CU_add_�� +( +��_su�e +, "Em�y f�e", +TEST_em�y_f�e +) + +365 || ! + `CU_add_�� +( +��_su�e +, "v5 c�fig ok", +TEST_v5_c�fig_ok +) + +366 || ! + `CU_add_�� +( +��_su�e +, "v5 mes�g��ܐ(mes�g�ha�nػfs)", +TEST_v5_mes�ge_��e_no_�f +) + +367 || ! + `CU_add_�� +( +��_su�e +, "v5 mes�g��ܐ+�r�s", +TEST_v5_mes�ge_��e_��s +) + +368 || ! + `CU_add_�� +( +��_su�e +, "v5 cl��", +TEST_v5_��� +) + +369 || ! + `CU_add_�� +( +��_su�e +, "v5 cl�� mes�ge", +TEST_v5_���_mes�ge +) + +370 || ! + `CU_add_�� +( +��_su�e +, "v5 cl�� mes�ge+��s", +TEST_v5_���_mes�ge_��s +) + +371 || ! + `CU_add_�� +( +��_su�e +, "v5 sub", +TEST_v5_sub +) + +375 + `��tf +("Error�dding�ersist CUnit�ests.\n"); + +376 + `CU_��nup_�gi�ry +(); + +380 + `CU_basic_�t_mode +( +CU_BRM_VERBOSE +); + +381 + `CU_basic_run_��s +(); + +382 +�s + = + `CU_g�_numb�_of_�u�s +(); + +383 + `CU_��nup_�gi�ry +(); + +385 () +�s +; + +386 + } +} + + @test/unit/property_add.c + +1 + ~<CUn�/CUn�.h +> + +2 + ~<CUn�/Basic.h +> + +4 + ~"mq�_��oc�.h +" + +5 + ~"�ݔty_mosq.h +" + +6 + ~"�ck�_mosq.h +" + +12 + $bad_add_by�_h��r +( +id�tif�r +) + +14 +mosqu�to_�ݔty + * +��li� + = +NULL +; + +15 +rc +; + +17 +rc + = + `mosqu�to_�ݔty_add_by� +(& +��li� +, +id�tif�r +, 1); + +18 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +19 + `CU_ASSERT_PTR_NULL +( +��li� +); + +20 + } +} + +22 + $bad_add_�t16_h��r +( +id�tif�r +) + +24 +mosqu�to_�ݔty + * +��li� + = +NULL +; + +25 +rc +; + +27 +rc + = + `mosqu�to_�ݔty_add_�t16 +(& +��li� +, +id�tif�r +, 1); + +28 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +29 + `CU_ASSERT_PTR_NULL +( +��li� +); + +30 + } +} + +32 + $bad_add_�t32_h��r +( +id�tif�r +) + +34 +mosqu�to_�ݔty + * +��li� + = +NULL +; + +35 +rc +; + +37 +rc + = + `mosqu�to_�ݔty_add_�t32 +(& +��li� +, +id�tif�r +, 1); + +38 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +39 + `CU_ASSERT_PTR_NULL +( +��li� +); + +40 + } +} + +42 + $bad_add_v��t_h��r +( +id�tif�r +) + +44 +mosqu�to_�ݔty + * +��li� + = +NULL +; + +45 +rc +; + +47 +rc + = + `mosqu�to_�ݔty_add_v��t +(& +��li� +, +id�tif�r +, 1); + +48 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +49 + `CU_ASSERT_PTR_NULL +( +��li� +); + +50 + } +} + +52 + $bad_add_b��y_h��r +( +id�tif�r +) + +54 +mosqu�to_�ݔty + * +��li� + = +NULL +; + +55 +rc +; + +57 +rc + = + `mosqu�to_�ݔty_add_b��y +(& +��li� +, +id�tif�r +, "test", 4); + +58 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +59 + `CU_ASSERT_PTR_NULL +( +��li� +); + +60 + } +} + +62 + $bad_add_�r�g_h��r +( +id�tif�r +) + +64 +mosqu�to_�ݔty + * +��li� + = +NULL +; + +65 +rc +; + +67 +rc + = + `mosqu�to_�ݔty_add_�r�g +(& +��li� +, +id�tif�r +, "test"); + +68 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +69 + `CU_ASSERT_PTR_NULL +( +��li� +); + +70 + } +} + +72 + $bad_add_�r�g_��_h��r +( +id�tif�r +) + +74 +mosqu�to_�ݔty + * +��li� + = +NULL +; + +75 +rc +; + +77 +rc + = + `mosqu�to_�ݔty_add_�r�g_�� +(& +��li� +, +id�tif�r +, "key", "value"); + +78 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +79 + `CU_ASSERT_PTR_NULL +( +��li� +); + +80 + } +} + +82 + $TEST_add_bad_by� +() + +84 + `bad_add_by�_h��r +( +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +); + +85 + `bad_add_by�_h��r +( +MQTT_PROP_CONTENT_TYPE +); + +86 + `bad_add_by�_h��r +( +MQTT_PROP_RESPONSE_TOPIC +); + +87 + `bad_add_by�_h��r +( +MQTT_PROP_CORRELATION_DATA +); + +88 + `bad_add_by�_h��r +( +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +); + +89 + `bad_add_by�_h��r +( +MQTT_PROP_SESSION_EXPIRY_INTERVAL +); + +90 + `bad_add_by�_h��r +( +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +); + +91 + `bad_add_by�_h��r +( +MQTT_PROP_SERVER_KEEP_ALIVE +); + +92 + `bad_add_by�_h��r +( +MQTT_PROP_AUTHENTICATION_METHOD +); + +93 + `bad_add_by�_h��r +( +MQTT_PROP_AUTHENTICATION_DATA +); + +94 + `bad_add_by�_h��r +( +MQTT_PROP_WILL_DELAY_INTERVAL +); + +95 + `bad_add_by�_h��r +( +MQTT_PROP_RESPONSE_INFORMATION +); + +96 + `bad_add_by�_h��r +( +MQTT_PROP_SERVER_REFERENCE +); + +97 + `bad_add_by�_h��r +( +MQTT_PROP_REASON_STRING +); + +98 + `bad_add_by�_h��r +( +MQTT_PROP_RECEIVE_MAXIMUM +); + +99 + `bad_add_by�_h��r +( +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +); + +100 + `bad_add_by�_h��r +( +MQTT_PROP_TOPIC_ALIAS +); + +101 + `bad_add_by�_h��r +( +MQTT_PROP_USER_PROPERTY +); + +102 + `bad_add_by�_h��r +( +MQTT_PROP_MAXIMUM_PACKET_SIZE +); + +103 + } +} + +105 + $TEST_add_bad_�t16 +() + +107 + `bad_add_�t16_h��r +( +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +); + +108 + `bad_add_�t16_h��r +( +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +); + +109 + `bad_add_�t16_h��r +( +MQTT_PROP_CONTENT_TYPE +); + +110 + `bad_add_�t16_h��r +( +MQTT_PROP_RESPONSE_TOPIC +); + +111 + `bad_add_�t16_h��r +( +MQTT_PROP_CORRELATION_DATA +); + +112 + `bad_add_�t16_h��r +( +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +); + +113 + `bad_add_�t16_h��r +( +MQTT_PROP_SESSION_EXPIRY_INTERVAL +); + +114 + `bad_add_�t16_h��r +( +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +); + +115 + `bad_add_�t16_h��r +( +MQTT_PROP_AUTHENTICATION_METHOD +); + +116 + `bad_add_�t16_h��r +( +MQTT_PROP_AUTHENTICATION_DATA +); + +117 + `bad_add_�t16_h��r +( +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +); + +118 + `bad_add_�t16_h��r +( +MQTT_PROP_WILL_DELAY_INTERVAL +); + +119 + `bad_add_�t16_h��r +( +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +); + +120 + `bad_add_�t16_h��r +( +MQTT_PROP_RESPONSE_INFORMATION +); + +121 + `bad_add_�t16_h��r +( +MQTT_PROP_SERVER_REFERENCE +); + +122 + `bad_add_�t16_h��r +( +MQTT_PROP_REASON_STRING +); + +123 + `bad_add_�t16_h��r +( +MQTT_PROP_MAXIMUM_QOS +); + +124 + `bad_add_�t16_h��r +( +MQTT_PROP_RETAIN_AVAILABLE +); + +125 + `bad_add_�t16_h��r +( +MQTT_PROP_USER_PROPERTY +); + +126 + `bad_add_�t16_h��r +( +MQTT_PROP_MAXIMUM_PACKET_SIZE +); + +127 + `bad_add_�t16_h��r +( +MQTT_PROP_WILDCARD_SUB_AVAILABLE +); + +128 + `bad_add_�t16_h��r +( +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +); + +129 + `bad_add_�t16_h��r +( +MQTT_PROP_SHARED_SUB_AVAILABLE +); + +130 + } +} + +132 + $TEST_add_bad_�t32 +() + +134 + `bad_add_�t32_h��r +( +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +); + +135 + `bad_add_�t32_h��r +( +MQTT_PROP_CONTENT_TYPE +); + +136 + `bad_add_�t32_h��r +( +MQTT_PROP_RESPONSE_TOPIC +); + +137 + `bad_add_�t32_h��r +( +MQTT_PROP_CORRELATION_DATA +); + +138 + `bad_add_�t32_h��r +( +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +); + +139 + `bad_add_�t32_h��r +( +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +); + +140 + `bad_add_�t32_h��r +( +MQTT_PROP_SERVER_KEEP_ALIVE +); + +141 + `bad_add_�t32_h��r +( +MQTT_PROP_AUTHENTICATION_METHOD +); + +142 + `bad_add_�t32_h��r +( +MQTT_PROP_AUTHENTICATION_DATA +); + +143 + `bad_add_�t32_h��r +( +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +); + +144 + `bad_add_�t32_h��r +( +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +); + +145 + `bad_add_�t32_h��r +( +MQTT_PROP_RESPONSE_INFORMATION +); + +146 + `bad_add_�t32_h��r +( +MQTT_PROP_SERVER_REFERENCE +); + +147 + `bad_add_�t32_h��r +( +MQTT_PROP_REASON_STRING +); + +148 + `bad_add_�t32_h��r +( +MQTT_PROP_RECEIVE_MAXIMUM +); + +149 + `bad_add_�t32_h��r +( +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +); + +150 + `bad_add_�t32_h��r +( +MQTT_PROP_TOPIC_ALIAS +); + +151 + `bad_add_�t32_h��r +( +MQTT_PROP_MAXIMUM_QOS +); + +152 + `bad_add_�t32_h��r +( +MQTT_PROP_RETAIN_AVAILABLE +); + +153 + `bad_add_�t32_h��r +( +MQTT_PROP_USER_PROPERTY +); + +154 + `bad_add_�t32_h��r +( +MQTT_PROP_WILDCARD_SUB_AVAILABLE +); + +155 + `bad_add_�t32_h��r +( +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +); + +156 + `bad_add_�t32_h��r +( +MQTT_PROP_SHARED_SUB_AVAILABLE +); + +157 + } +} + +159 + $TEST_add_bad_v��t +() + +161 + `bad_add_v��t_h��r +( +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +); + +162 + `bad_add_v��t_h��r +( +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +); + +163 + `bad_add_v��t_h��r +( +MQTT_PROP_CONTENT_TYPE +); + +164 + `bad_add_v��t_h��r +( +MQTT_PROP_RESPONSE_TOPIC +); + +165 + `bad_add_v��t_h��r +( +MQTT_PROP_CORRELATION_DATA +); + +166 + `bad_add_v��t_h��r +( +MQTT_PROP_SESSION_EXPIRY_INTERVAL +); + +167 + `bad_add_v��t_h��r +( +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +); + +168 + `bad_add_v��t_h��r +( +MQTT_PROP_SERVER_KEEP_ALIVE +); + +169 + `bad_add_v��t_h��r +( +MQTT_PROP_AUTHENTICATION_METHOD +); + +170 + `bad_add_v��t_h��r +( +MQTT_PROP_AUTHENTICATION_DATA +); + +171 + `bad_add_v��t_h��r +( +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +); + +172 + `bad_add_v��t_h��r +( +MQTT_PROP_WILL_DELAY_INTERVAL +); + +173 + `bad_add_v��t_h��r +( +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +); + +174 + `bad_add_v��t_h��r +( +MQTT_PROP_RESPONSE_INFORMATION +); + +175 + `bad_add_v��t_h��r +( +MQTT_PROP_SERVER_REFERENCE +); + +176 + `bad_add_v��t_h��r +( +MQTT_PROP_REASON_STRING +); + +177 + `bad_add_v��t_h��r +( +MQTT_PROP_RECEIVE_MAXIMUM +); + +178 + `bad_add_v��t_h��r +( +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +); + +179 + `bad_add_v��t_h��r +( +MQTT_PROP_TOPIC_ALIAS +); + +180 + `bad_add_v��t_h��r +( +MQTT_PROP_MAXIMUM_QOS +); + +181 + `bad_add_v��t_h��r +( +MQTT_PROP_RETAIN_AVAILABLE +); + +182 + `bad_add_v��t_h��r +( +MQTT_PROP_USER_PROPERTY +); + +183 + `bad_add_v��t_h��r +( +MQTT_PROP_MAXIMUM_PACKET_SIZE +); + +184 + `bad_add_v��t_h��r +( +MQTT_PROP_WILDCARD_SUB_AVAILABLE +); + +185 + `bad_add_v��t_h��r +( +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +); + +186 + `bad_add_v��t_h��r +( +MQTT_PROP_SHARED_SUB_AVAILABLE +); + +187 + } +} + +189 + $TEST_add_bad_b��y +() + +191 + `bad_add_b��y_h��r +( +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +); + +192 + `bad_add_b��y_h��r +( +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +); + +193 + `bad_add_b��y_h��r +( +MQTT_PROP_CONTENT_TYPE +); + +194 + `bad_add_b��y_h��r +( +MQTT_PROP_RESPONSE_TOPIC +); + +195 + `bad_add_b��y_h��r +( +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +); + +196 + `bad_add_b��y_h��r +( +MQTT_PROP_SESSION_EXPIRY_INTERVAL +); + +197 + `bad_add_b��y_h��r +( +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +); + +198 + `bad_add_b��y_h��r +( +MQTT_PROP_SERVER_KEEP_ALIVE +); + +199 + `bad_add_b��y_h��r +( +MQTT_PROP_AUTHENTICATION_METHOD +); + +200 + `bad_add_b��y_h��r +( +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +); + +201 + `bad_add_b��y_h��r +( +MQTT_PROP_WILL_DELAY_INTERVAL +); + +202 + `bad_add_b��y_h��r +( +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +); + +203 + `bad_add_b��y_h��r +( +MQTT_PROP_RESPONSE_INFORMATION +); + +204 + `bad_add_b��y_h��r +( +MQTT_PROP_SERVER_REFERENCE +); + +205 + `bad_add_b��y_h��r +( +MQTT_PROP_REASON_STRING +); + +206 + `bad_add_b��y_h��r +( +MQTT_PROP_RECEIVE_MAXIMUM +); + +207 + `bad_add_b��y_h��r +( +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +); + +208 + `bad_add_b��y_h��r +( +MQTT_PROP_TOPIC_ALIAS +); + +209 + `bad_add_b��y_h��r +( +MQTT_PROP_MAXIMUM_QOS +); + +210 + `bad_add_b��y_h��r +( +MQTT_PROP_RETAIN_AVAILABLE +); + +211 + `bad_add_b��y_h��r +( +MQTT_PROP_USER_PROPERTY +); + +212 + `bad_add_b��y_h��r +( +MQTT_PROP_MAXIMUM_PACKET_SIZE +); + +213 + `bad_add_b��y_h��r +( +MQTT_PROP_WILDCARD_SUB_AVAILABLE +); + +214 + `bad_add_b��y_h��r +( +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +); + +215 + `bad_add_b��y_h��r +( +MQTT_PROP_SHARED_SUB_AVAILABLE +); + +216 + } +} + +218 + $TEST_add_bad_�r�g +() + +220 + `bad_add_�r�g_h��r +( +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +); + +221 + `bad_add_�r�g_h��r +( +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +); + +222 + `bad_add_�r�g_h��r +( +MQTT_PROP_CORRELATION_DATA +); + +223 + `bad_add_�r�g_h��r +( +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +); + +224 + `bad_add_�r�g_h��r +( +MQTT_PROP_SESSION_EXPIRY_INTERVAL +); + +225 + `bad_add_�r�g_h��r +( +MQTT_PROP_SERVER_KEEP_ALIVE +); + +226 + `bad_add_�r�g_h��r +( +MQTT_PROP_AUTHENTICATION_DATA +); + +227 + `bad_add_�r�g_h��r +( +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +); + +228 + `bad_add_�r�g_h��r +( +MQTT_PROP_WILL_DELAY_INTERVAL +); + +229 + `bad_add_�r�g_h��r +( +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +); + +230 + `bad_add_�r�g_h��r +( +MQTT_PROP_RECEIVE_MAXIMUM +); + +231 + `bad_add_�r�g_h��r +( +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +); + +232 + `bad_add_�r�g_h��r +( +MQTT_PROP_TOPIC_ALIAS +); + +233 + `bad_add_�r�g_h��r +( +MQTT_PROP_MAXIMUM_QOS +); + +234 + `bad_add_�r�g_h��r +( +MQTT_PROP_RETAIN_AVAILABLE +); + +235 + `bad_add_�r�g_h��r +( +MQTT_PROP_USER_PROPERTY +); + +236 + `bad_add_�r�g_h��r +( +MQTT_PROP_MAXIMUM_PACKET_SIZE +); + +237 + `bad_add_�r�g_h��r +( +MQTT_PROP_WILDCARD_SUB_AVAILABLE +); + +238 + `bad_add_�r�g_h��r +( +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +); + +239 + `bad_add_�r�g_h��r +( +MQTT_PROP_SHARED_SUB_AVAILABLE +); + +240 + } +} + +242 + $TEST_add_bad_�r�g_�� +() + +244 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +); + +245 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +); + +246 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_CONTENT_TYPE +); + +247 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_RESPONSE_TOPIC +); + +248 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_CORRELATION_DATA +); + +249 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +); + +250 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_SESSION_EXPIRY_INTERVAL +); + +251 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +); + +252 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_SERVER_KEEP_ALIVE +); + +253 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_AUTHENTICATION_METHOD +); + +254 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_AUTHENTICATION_DATA +); + +255 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +); + +256 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_WILL_DELAY_INTERVAL +); + +257 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +); + +258 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_RESPONSE_INFORMATION +); + +259 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_SERVER_REFERENCE +); + +260 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_REASON_STRING +); + +261 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_RECEIVE_MAXIMUM +); + +262 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +); + +263 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_TOPIC_ALIAS +); + +264 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_MAXIMUM_QOS +); + +265 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_RETAIN_AVAILABLE +); + +266 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_MAXIMUM_PACKET_SIZE +); + +267 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_WILDCARD_SUB_AVAILABLE +); + +268 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +); + +269 + `bad_add_�r�g_��_h��r +( +MQTT_PROP_SHARED_SUB_AVAILABLE +); + +270 + } +} + +276 + $s�g�_add_by�_h��r +( +id�tif�r +) + +278 +mosqu�to_�ݔty + * +��li� + = +NULL +; + +279 +rc +; + +281 +rc + = + `mosqu�to_�ݔty_add_by� +(& +��li� +, +id�tif�r +, 1); + +282 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +283 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +284 if( +��li� +){ + +285 + `CU_ASSERT_EQUAL +( +��li� +-> +id�tif�r +, identifier); + +286 + `CU_ASSERT_EQUAL +( +��li� +-> +v�ue +. +i8 +, 1); + +287 + `CU_ASSERT_PTR_NULL +( +��li� +-> +�xt +); + +289 + `mosqu�to_�ݔty_�_�l +(& +��li� +); + +291 + } +} + +293 + $s�g�_add_�t16_h��r +( +id�tif�r +) + +295 +mosqu�to_�ݔty + * +��li� + = +NULL +; + +296 +rc +; + +298 +rc + = + `mosqu�to_�ݔty_add_�t16 +(& +��li� +, +id�tif�r +, 11234); + +299 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +300 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +301 if( +��li� +){ + +302 + `CU_ASSERT_EQUAL +( +��li� +-> +id�tif�r +, identifier); + +303 + `CU_ASSERT_EQUAL +( +��li� +-> +v�ue +. +i16 +, 11234); + +304 + `CU_ASSERT_PTR_NULL +( +��li� +-> +�xt +); + +306 + `mosqu�to_�ݔty_�_�l +(& +��li� +); + +308 + } +} + +310 + $s�g�_add_�t32_h��r +( +id�tif�r +) + +312 +mosqu�to_�ݔty + * +��li� + = +NULL +; + +313 +rc +; + +315 +rc + = + `mosqu�to_�ݔty_add_�t32 +(& +��li� +, +id�tif�r +, 765432); + +316 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +317 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +318 if( +��li� +){ + +319 + `CU_ASSERT_EQUAL +( +��li� +-> +id�tif�r +, identifier); + +320 + `CU_ASSERT_EQUAL +( +��li� +-> +v�ue +. +i32 +, 765432); + +321 + `CU_ASSERT_PTR_NULL +( +��li� +-> +�xt +); + +323 + `mosqu�to_�ݔty_�_�l +(& +��li� +); + +325 + } +} + +327 + $s�g�_add_v��t_h��r +( +id�tif�r +) + +329 +mosqu�to_�ݔty + * +��li� + = +NULL +; + +330 +rc +; + +332 +rc + = + `mosqu�to_�ݔty_add_v��t +(& +��li� +, +id�tif�r +, 139123999); + +333 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +334 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +335 if( +��li� +){ + +336 + `CU_ASSERT_EQUAL +( +��li� +-> +id�tif�r +, identifier); + +337 + `CU_ASSERT_EQUAL +( +��li� +-> +v�ue +. +v��t +, 139123999); + +338 + `CU_ASSERT_PTR_NULL +( +��li� +-> +�xt +); + +340 + `mosqu�to_�ݔty_�_�l +(& +��li� +); + +342 + } +} + +344 + $s�g�_add_b��y_h��r +( +id�tif�r +) + +346 +mosqu�to_�ݔty + * +��li� + = +NULL +; + +347 +rc +; + +349 +rc + = + `mosqu�to_�ݔty_add_b��y +(& +��li� +, +id�tif�r +, "test", 4); + +350 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +351 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +352 if( +��li� +){ + +353 + `CU_ASSERT_EQUAL +( +��li� +-> +id�tif�r +, identifier); + +354 + `CU_ASSERT_EQUAL +( +��li� +-> +v�ue +. +b� +. +�n +, 4); + +355 + `CU_ASSERT_NSTRING_EQUAL +( +��li� +-> +v�ue +. +b� +. +v +, "test", 4); + +356 + `CU_ASSERT_PTR_NULL +( +��li� +-> +�xt +); + +358 + `mosqu�to_�ݔty_�_�l +(& +��li� +); + +360 + } +} + +362 + $s�g�_add_�r�g_h��r +( +id�tif�r +) + +364 +mosqu�to_�ݔty + * +��li� + = +NULL +; + +365 +rc +; + +367 +rc + = + `mosqu�to_�ݔty_add_�r�g +(& +��li� +, +id�tif�r +, "string"); + +368 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +369 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +370 if( +��li� +){ + +371 + `CU_ASSERT_EQUAL +( +��li� +-> +id�tif�r +, identifier); + +372 + `CU_ASSERT_STRING_EQUAL +( +��li� +-> +v�ue +. +s +. +v +, "string"); + +373 + `CU_ASSERT_EQUAL +( +��li� +-> +v�ue +. +s +. +�n +, + `��� +("string")); + +374 + `CU_ASSERT_PTR_NULL +( +��li� +-> +�xt +); + +376 + `mosqu�to_�ݔty_�_�l +(& +��li� +); + +378 + } +} + +380 + $s�g�_add_�r�g_��_h��r +( +id�tif�r +) + +382 +mosqu�to_�ݔty + * +��li� + = +NULL +; + +383 +rc +; + +385 +rc + = + `mosqu�to_�ݔty_add_�r�g_�� +(& +��li� +, +id�tif�r +, "key", "value"); + +386 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +387 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +388 if( +��li� +){ + +389 + `CU_ASSERT_EQUAL +( +��li� +-> +id�tif�r +, identifier); + +390 + `CU_ASSERT_STRING_EQUAL +( +��li� +-> +�me +. +v +, "key"); + +391 + `CU_ASSERT_EQUAL +( +��li� +-> +�me +. +�n +, + `��� +("key")); + +392 + `CU_ASSERT_STRING_EQUAL +( +��li� +-> +v�ue +. +s +. +v +, "value"); + +393 + `CU_ASSERT_EQUAL +( +��li� +-> +v�ue +. +s +. +�n +, + `��� +("value")); + +394 + `CU_ASSERT_PTR_NULL +( +��li� +-> +�xt +); + +396 + `mosqu�to_�ݔty_�_�l +(& +��li� +); + +398 + } +} + +400 + $TEST_add_s�g�_by� +() + +402 + `s�g�_add_by�_h��r +( +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +); + +403 + `s�g�_add_by�_h��r +( +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +); + +404 + `s�g�_add_by�_h��r +( +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +); + +405 + `s�g�_add_by�_h��r +( +MQTT_PROP_MAXIMUM_QOS +); + +406 + `s�g�_add_by�_h��r +( +MQTT_PROP_RETAIN_AVAILABLE +); + +407 + `s�g�_add_by�_h��r +( +MQTT_PROP_WILDCARD_SUB_AVAILABLE +); + +408 + `s�g�_add_by�_h��r +( +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +); + +409 + `s�g�_add_by�_h��r +( +MQTT_PROP_SHARED_SUB_AVAILABLE +); + +410 + } +} + +412 + $TEST_add_s�g�_�t16 +() + +414 + `s�g�_add_�t16_h��r +( +MQTT_PROP_SERVER_KEEP_ALIVE +); + +415 + `s�g�_add_�t16_h��r +( +MQTT_PROP_RECEIVE_MAXIMUM +); + +416 + `s�g�_add_�t16_h��r +( +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +); + +417 + `s�g�_add_�t16_h��r +( +MQTT_PROP_TOPIC_ALIAS +); + +418 + } +} + +420 + $TEST_add_s�g�_�t32 +() + +422 + `s�g�_add_�t32_h��r +( +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +); + +423 + `s�g�_add_�t32_h��r +( +MQTT_PROP_SESSION_EXPIRY_INTERVAL +); + +424 + `s�g�_add_�t32_h��r +( +MQTT_PROP_WILL_DELAY_INTERVAL +); + +425 + `s�g�_add_�t32_h��r +( +MQTT_PROP_MAXIMUM_PACKET_SIZE +); + +426 + } +} + +428 + $TEST_add_s�g�_v��t +() + +430 + `s�g�_add_v��t_h��r +( +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +); + +431 + } +} + +433 + $TEST_add_s�g�_b��y +() + +435 + `s�g�_add_b��y_h��r +( +MQTT_PROP_CORRELATION_DATA +); + +436 + `s�g�_add_b��y_h��r +( +MQTT_PROP_AUTHENTICATION_DATA +); + +437 + } +} + +439 + $TEST_add_s�g�_�r�g +() + +441 + `s�g�_add_�r�g_h��r +( +MQTT_PROP_CONTENT_TYPE +); + +442 + `s�g�_add_�r�g_h��r +( +MQTT_PROP_RESPONSE_TOPIC +); + +443 + `s�g�_add_�r�g_h��r +( +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +); + +444 + `s�g�_add_�r�g_h��r +( +MQTT_PROP_AUTHENTICATION_METHOD +); + +445 + `s�g�_add_�r�g_h��r +( +MQTT_PROP_RESPONSE_INFORMATION +); + +446 + `s�g�_add_�r�g_h��r +( +MQTT_PROP_SERVER_REFERENCE +); + +447 + `s�g�_add_�r�g_h��r +( +MQTT_PROP_REASON_STRING +); + +448 + } +} + +450 + $TEST_add_s�g�_�r�g_�� +() + +452 + `s�g�_add_�r�g_��_h��r +( +MQTT_PROP_USER_PROPERTY +); + +453 + } +} + +459 + $TEST_add_�l_c��� +() + +461 +mosqu�to_�ݔty + * +��li� + = +NULL +; + +462 +mosqu�to_�ݔty + * +p +; + +463 +cou� +; + +464 +rc +; + +466 +rc + = + `mosqu�to_�ݔty_add_�t32 +(& +��li� +, +MQTT_PROP_SESSION_EXPIRY_INTERVAL +, 86400); + +467 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +468 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +469 +rc + = + `mosqu�to_�ݔty_add_�r�g +(& +��li� +, +MQTT_PROP_AUTHENTICATION_METHOD +, "basic"); + +470 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +471 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +472 +rc + = + `mosqu�to_�ݔty_add_b��y +(& +��li� +, +MQTT_PROP_AUTHENTICATION_DATA +, "�ssw�d", + `��� +("password")); + +473 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +474 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +475 +rc + = + `mosqu�to_�ݔty_add_by� +(& +��li� +, +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +, 1); + +476 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +477 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +478 +rc + = + `mosqu�to_�ݔty_add_by� +(& +��li� +, +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +, 1); + +479 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +480 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +481 +rc + = + `mosqu�to_�ݔty_add_�t16 +(& +��li� +, +MQTT_PROP_RECEIVE_MAXIMUM +, 1024); + +482 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +483 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +484 +rc + = + `mosqu�to_�ݔty_add_�t16 +(& +��li� +, +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +, 64); + +485 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +486 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +487 +rc + = + `mosqu�to_�ݔty_add_�r�g_�� +(& +��li� +, +MQTT_PROP_USER_PROPERTY +, "user-agent", "mosquitto/test"); + +488 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +489 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +490 +rc + = + `mosqu�to_�ݔty_add_�t32 +(& +��li� +, +MQTT_PROP_MAXIMUM_PACKET_SIZE +, 200000000); + +491 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +492 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +494 +p + = +��li� +; + +495 +cou� + = 0; + +496 +p +){ + +497 +cou� +++; + +498 +p + =�-> +�xt +; + +500 + `CU_ASSERT_EQUAL +( +cou� +, 9); + +502 + `mosqu�to_�ݔty_�_�l +(& +��li� +); + +503 + } +} + +506 + $TEST_add_�l_c��ck +() + +508 +mosqu�to_�ݔty + * +��li� + = +NULL +; + +509 +mosqu�to_�ݔty + * +p +; + +510 +cou� +; + +511 +rc +; + +513 +rc + = + `mosqu�to_�ݔty_add_�t32 +(& +��li� +, +MQTT_PROP_SESSION_EXPIRY_INTERVAL +, 86400); + +514 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +515 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +516 +rc + = + `mosqu�to_�ݔty_add_�r�g +(& +��li� +, +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +, "clientid"); + +517 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +518 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +519 +rc + = + `mosqu�to_�ݔty_add_�t16 +(& +��li� +, +MQTT_PROP_SERVER_KEEP_ALIVE +, 900); + +520 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +521 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +522 +rc + = + `mosqu�to_�ݔty_add_�r�g +(& +��li� +, +MQTT_PROP_AUTHENTICATION_METHOD +, "basic"); + +523 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +524 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +525 +rc + = + `mosqu�to_�ݔty_add_b��y +(& +��li� +, +MQTT_PROP_AUTHENTICATION_DATA +, "�ssw�d", + `��� +("password")); + +526 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +527 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +528 +rc + = + `mosqu�to_�ݔty_add_�r�g +(& +��li� +, +MQTT_PROP_RESPONSE_INFORMATION +, "response"); + +529 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +530 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +531 +rc + = + `mosqu�to_�ݔty_add_�r�g +(& +��li� +, +MQTT_PROP_SERVER_REFERENCE +, "localhost"); + +532 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +533 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +534 +rc + = + `mosqu�to_�ݔty_add_�r�g +(& +��li� +, +MQTT_PROP_REASON_STRING +, "reason"); + +535 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +536 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +537 +rc + = + `mosqu�to_�ݔty_add_�t16 +(& +��li� +, +MQTT_PROP_RECEIVE_MAXIMUM +, 1024); + +538 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +539 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +540 +rc + = + `mosqu�to_�ݔty_add_�t16 +(& +��li� +, +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +, 64); + +541 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +542 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +543 +rc + = + `mosqu�to_�ݔty_add_by� +(& +��li� +, +MQTT_PROP_MAXIMUM_QOS +, 1); + +544 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +545 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +546 +rc + = + `mosqu�to_�ݔty_add_by� +(& +��li� +, +MQTT_PROP_RETAIN_AVAILABLE +, 0); + +547 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +548 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +549 +rc + = + `mosqu�to_�ݔty_add_�r�g_�� +(& +��li� +, +MQTT_PROP_USER_PROPERTY +, "user-agent", "mosquitto/test"); + +550 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +551 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +552 +rc + = + `mosqu�to_�ݔty_add_�t32 +(& +��li� +, +MQTT_PROP_MAXIMUM_PACKET_SIZE +, 200000000); + +553 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +554 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +555 +rc + = + `mosqu�to_�ݔty_add_by� +(& +��li� +, +MQTT_PROP_WILDCARD_SUB_AVAILABLE +, 0); + +556 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +557 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +558 +rc + = + `mosqu�to_�ݔty_add_by� +(& +��li� +, +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +, 0); + +559 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +560 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +561 +rc + = + `mosqu�to_�ݔty_add_by� +(& +��li� +, +MQTT_PROP_SHARED_SUB_AVAILABLE +, 0); + +562 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +563 + `CU_ASSERT_PTR_NOT_NULL +( +��li� +); + +565 +p + = +��li� +; + +566 +cou� + = 0; + +567 +p +){ + +568 +cou� +++; + +569 +p + =�-> +�xt +; + +571 + `CU_ASSERT_EQUAL +( +cou� +, 17); + +573 + `mosqu�to_�ݔty_�_�l +(& +��li� +); + +574 + } +} + +580 + $��_�ݔty_add_��s +() + +582 +CU_pSu�e + +��_su�e + = +NULL +; + +584 +��_su�e + = + `CU_add_su�e +("Prݔty�dd", +NULL +, NULL); + +585 if(! +��_su�e +){ + +586 + `��tf +("Error�dding CUnit Property�dd�est suite.\n"); + +591 || ! + `CU_add_�� +( +��_su�e +, "Add bad by�", +TEST_add_bad_by� +) + +592 || ! + `CU_add_�� +( +��_su�e +, "Add bad i�16", +TEST_add_bad_�t16 +) + +593 || ! + `CU_add_�� +( +��_su�e +, "Add bad i�32", +TEST_add_bad_�t32 +) + +594 || ! + `CU_add_�� +( +��_su�e +, "Add bad v��t", +TEST_add_bad_v��t +) + +595 || ! + `CU_add_�� +( +��_su�e +, "Add bad b��y", +TEST_add_bad_b��y +) + +596 || ! + `CU_add_�� +( +��_su�e +, "Add bad s��g", +TEST_add_bad_�r�g +) + +597 || ! + `CU_add_�� +( +��_su�e +, "Add bad s��g�a�", +TEST_add_bad_�r�g_�� +) + +598 || ! + `CU_add_�� +( +��_su�e +, "Add s�g� by�", +TEST_add_s�g�_by� +) + +599 || ! + `CU_add_�� +( +��_su�e +, "Add s�g� i�16", +TEST_add_s�g�_�t16 +) + +600 || ! + `CU_add_�� +( +��_su�e +, "Add s�g� i�32", +TEST_add_s�g�_�t32 +) + +601 || ! + `CU_add_�� +( +��_su�e +, "Add s�g� v��t", +TEST_add_s�g�_v��t +) + +602 || ! + `CU_add_�� +( +��_su�e +, "Add s�g� b��y", +TEST_add_s�g�_b��y +) + +603 || ! + `CU_add_�� +( +��_su�e +, "Add s�g� s��g", +TEST_add_s�g�_�r�g +) + +604 || ! + `CU_add_�� +( +��_su�e +, "Add s�g� s��g�a�", +TEST_add_s�g�_�r�g_�� +) + +605 || ! + `CU_add_�� +( +��_su�e +, "Add�� CONNECT", +TEST_add_�l_c��� +) + +606 || ! + `CU_add_�� +( +��_su�e +, "Add�� CONNACK", +TEST_add_�l_c��ck +) + +609 + `��tf +("Error�dding Property Add CUnit�ests.\n"); + +614 + } +} + + @test/unit/property_read.c + +1 + ~<CUn�/CUn�.h +> + +2 + ~<CUn�/Basic.h +> + +4 + ~"mq�_��oc�.h +" + +5 + ~"�ݔty_mosq.h +" + +6 + ~"�ck�_mosq.h +" + +8 + $by�_��_�ad_h��r +( + +9 +comm�d +, + +10 +u�t8_t + * +�yl�d +, + +11 +�ma��g_�ngth +, + +12 +rc_ex��ed +, + +13 +id�tif�r +, + +14 +u�t8_t + +v�ue_ex��ed +) + +16 +mosqu�to__�ck� + +�ck� +; + +17 +mosqu�to_�ݔty + * +�ݔt�s +; + +18 +rc +; + +20 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +21 +�ck� +. +�yl�d + =�ayload; + +22 +�ck� +. +�ma��g_�ngth + =�emaining_length; + +23 +rc + = + `�ݔty__�ad_�l +( +comm�d +, & +�ck� +, & +�ݔt�s +); + +25 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +26 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, +�ma��g_�ngth +); + +27 if( +�ݔt�s +){ + +28 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +id�tif�r +, identifier); + +29 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +v�ue +. +i8 +, +v�ue_ex��ed +); + +30 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +-> +�xt +, +NULL +); + +31 + `CU_ASSERT_EQUAL +( + `�ݔty__g�_�ngth_�l +( +�ݔt�s +), 2); + +32 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +34 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +, +NULL +); + +35 + } +} + +37 + $du�i��_by�_h��r +( +comm�d +, +id�tif�r +) + +39 +u�t8_t + +�yl�d +[20]; + +41 + `mem�t +(& +�yl�d +, 0, (payload)); + +42 +�yl�d +[0] = 4; + +43 +�yl�d +[1] = +id�tif�r +; + +44 +�yl�d +[2] = 1; + +45 +�yl�d +[3] = +id�tif�r +; + +46 +�yl�d +[4] = 0; + +48 + `by�_��_�ad_h��r +( +comm�d +, +�yl�d +, 5, +MOSQ_ERR_DUPLICATE_PROPERTY +, +id�tif�r +, 1); + +49 + } +} + +51 + $bad_by�_h��r +( +comm�d +, +id�tif�r +) + +53 +u�t8_t + +�yl�d +[20]; + +55 + `mem�t +(& +�yl�d +, 0, (payload)); + +56 +�yl�d +[0] = 2; + +57 +�yl�d +[1] = +id�tif�r +; + +58 +�yl�d +[2] = 2; + +60 + `by�_��_�ad_h��r +( +comm�d +, +�yl�d +, 3, +MOSQ_ERR_PROTOCOL +, +id�tif�r +, 0); + +61 + } +} + +64 + $�t32_��_�ad_h��r +( + +65 +comm�d +, + +66 +u�t8_t + * +�yl�d +, + +67 +�ma��g_�ngth +, + +68 +rc_ex��ed +, + +69 +id�tif�r +, + +70 +u�t32_t + +v�ue_ex��ed +) + +72 +mosqu�to__�ck� + +�ck� +; + +73 +mosqu�to_�ݔty + * +�ݔt�s +; + +74 +rc +; + +76 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +77 +�ck� +. +�yl�d + =�ayload; + +78 +�ck� +. +�ma��g_�ngth + =�emaining_length; + +79 +rc + = + `�ݔty__�ad_�l +( +comm�d +, & +�ck� +, & +�ݔt�s +); + +81 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +82 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, +�ma��g_�ngth +); + +83 if( +�ݔt�s +){ + +84 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +id�tif�r +, identifier); + +85 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +v�ue +. +i32 +, +v�ue_ex��ed +); + +86 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +-> +�xt +, +NULL +); + +87 + `CU_ASSERT_EQUAL +( + `�ݔty__g�_�ngth_�l +( +�ݔt�s +), 5); + +88 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +90 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +, +NULL +); + +91 + } +} + +93 + $du�i��_�t32_h��r +( +comm�d +, +id�tif�r +) + +95 +u�t8_t + +�yl�d +[20]; + +97 + `mem�t +(& +�yl�d +, 0, (payload)); + +98 +�yl�d +[0] = 10; + +99 +�yl�d +[1] = +id�tif�r +; + +100 +�yl�d +[2] = 1; + +101 +�yl�d +[3] = 1; + +102 +�yl�d +[4] = 1; + +103 +�yl�d +[5] = 1; + +104 +�yl�d +[6] = +id�tif�r +; + +105 +�yl�d +[7] = 0; + +106 +�yl�d +[8] = 0; + +107 +�yl�d +[9] = 0; + +108 +�yl�d +[10] = 0; + +110 + `�t32_��_�ad_h��r +( +comm�d +, +�yl�d +, 11, +MOSQ_ERR_DUPLICATE_PROPERTY +, +id�tif�r +, 1); + +111 + } +} + +114 + $�t16_��_�ad_h��r +( + +115 +comm�d +, + +116 +u�t8_t + * +�yl�d +, + +117 +�ma��g_�ngth +, + +118 +rc_ex��ed +, + +119 +id�tif�r +, + +120 +u�t16_t + +v�ue_ex��ed +) + +122 +mosqu�to__�ck� + +�ck� +; + +123 +mosqu�to_�ݔty + * +�ݔt�s +; + +124 +rc +; + +126 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +127 +�ck� +. +�yl�d + =�ayload; + +128 +�ck� +. +�ma��g_�ngth + =�emaining_length; + +129 +rc + = + `�ݔty__�ad_�l +( +comm�d +, & +�ck� +, & +�ݔt�s +); + +131 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +132 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, +�ma��g_�ngth +); + +133 if( +�ݔt�s +){ + +134 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +id�tif�r +, identifier); + +135 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +v�ue +. +i16 +, +v�ue_ex��ed +); + +136 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +-> +�xt +, +NULL +); + +137 + `CU_ASSERT_EQUAL +( + `�ݔty__g�_�ngth_�l +( +�ݔt�s +), 3); + +138 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +140 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +, +NULL +); + +141 + } +} + +143 + $du�i��_�t16_h��r +( +comm�d +, +id�tif�r +) + +145 +u�t8_t + +�yl�d +[20]; + +147 + `mem�t +(& +�yl�d +, 0, (payload)); + +148 +�yl�d +[0] = 6; + +149 +�yl�d +[1] = +id�tif�r +; + +150 +�yl�d +[2] = 1; + +151 +�yl�d +[3] = 1; + +152 +�yl�d +[4] = +id�tif�r +; + +153 +�yl�d +[5] = 0; + +154 +�yl�d +[6] = 0; + +156 + `�t16_��_�ad_h��r +( +comm�d +, +�yl�d +, 7, +MOSQ_ERR_DUPLICATE_PROPERTY +, +id�tif�r +, 1); + +157 + } +} + +159 + $�r�g_��_�ad_h��r +( + +160 +comm�d +, + +161 +u�t8_t + * +�yl�d +, + +162 +�ma��g_�ngth +, + +163 +rc_ex��ed +, + +164 +id�tif�r +, + +165 cڡ * +v�ue_ex��ed +) + +167 +mosqu�to__�ck� + +�ck� +; + +168 +mosqu�to_�ݔty + * +�ݔt�s +; + +169 +rc +; + +171 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +172 +�ck� +. +�yl�d + =�ayload; + +173 +�ck� +. +�ma��g_�ngth + =�emaining_length; + +174 +rc + = + `�ݔty__�ad_�l +( +comm�d +, & +�ck� +, & +�ݔt�s +); + +176 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +177 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, +�ma��g_�ngth +); + +178 if( +�ݔt�s +){ + +179 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +id�tif�r +, identifier); + +180 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +v�ue +. +s +. +�n +, + `��� +( +v�ue_ex��ed +)); + +181 + `CU_ASSERT_STRING_EQUAL +( +�ݔt�s +-> +v�ue +. +s +. +v +, +v�ue_ex��ed +); + +182 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +-> +�xt +, +NULL +); + +183 + `CU_ASSERT_EQUAL +( + `�ݔty__g�_�ngth_�l +( +�ݔt�s +), 1+2+ + `��� +( +v�ue_ex��ed +)); + +184 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +186 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +, +NULL +); + +187 + } +} + +189 + $du�i��_�r�g_h��r +( +comm�d +, +id�tif�r +) + +191 +u�t8_t + +�yl�d +[20]; + +193 + `mem�t +(& +�yl�d +, 0, (payload)); + +194 +�yl�d +[0] = 8; + +195 +�yl�d +[1] = +id�tif�r +; + +196 +�yl�d +[2] = 0; + +197 +�yl�d +[3] = 1; + +198 +�yl�d +[4] = 'h'; + +199 +�yl�d +[5] = +id�tif�r +; + +200 +�yl�d +[6] = 0; + +201 +�yl�d +[7] = 1; + +202 +�yl�d +[8] = 'h'; + +204 + `�r�g_��_�ad_h��r +( +comm�d +, +�yl�d +, 9, +MOSQ_ERR_DUPLICATE_PROPERTY +, +id�tif�r +, ""); + +205 + } +} + +207 + $bad_�r�g_h��r +( +id�tif�r +) + +209 +u�t8_t + +�yl�d +[20]; + +211 + `mem�t +(& +�yl�d +, 0, (payload)); + +212 +�yl�d +[0] = 6; + +213 +�yl�d +[1] = +id�tif�r +; + +214 +�yl�d +[2] = 0; + +215 +�yl�d +[3] = 3; + +216 +�yl�d +[4] = 'h'; + +217 +�yl�d +[5] = 0; + +218 +�yl�d +[6] = 'h'; + +220 + `�r�g_��_�ad_h��r +( +CMD_PUBLISH +, +�yl�d +, 7, +MOSQ_ERR_MALFORMED_UTF8 +, +id�tif�r +, ""); + +221 + } +} + +223 + $b��y_��_�ad_h��r +( + +224 +comm�d +, + +225 +u�t8_t + * +�yl�d +, + +226 +�ma��g_�ngth +, + +227 +rc_ex��ed +, + +228 +id�tif�r +, + +229 cڡ +u�t8_t + * +v�ue_ex��ed +, + +230 +�n_ex��ed +) + +232 +mosqu�to__�ck� + +�ck� +; + +233 +mosqu�to_�ݔty + * +�ݔt�s +; + +234 +rc +; + +236 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +237 +�ck� +. +�yl�d + =�ayload; + +238 +�ck� +. +�ma��g_�ngth + =�emaining_length; + +239 +rc + = + `�ݔty__�ad_�l +( +comm�d +, & +�ck� +, & +�ݔt�s +); + +241 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +242 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, +�ma��g_�ngth +); + +243 if( +�ݔt�s +){ + +244 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +id�tif�r +, identifier); + +245 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +v�ue +. +b� +. +�n +, +�n_ex��ed +); + +246 + `CU_ASSERT_EQUAL +( + `memcmp +( +�ݔt�s +-> +v�ue +. +b� +. +v +, +v�ue_ex��ed +, +�n_ex��ed +), 0); + +247 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +-> +�xt +, +NULL +); + +248 + `CU_ASSERT_EQUAL +( + `�ݔty__g�_�ngth_�l +( +�ݔt�s +), 1+2+ +�n_ex��ed +); + +249 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +251 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +, +NULL +); + +252 + } +} + +254 + $du�i��_b��y_h��r +( +comm�d +, +id�tif�r +) + +256 +u�t8_t + +�yl�d +[20]; + +258 + `mem�t +(& +�yl�d +, 0, (payload)); + +259 +�yl�d +[0] = 8; + +260 +�yl�d +[1] = +id�tif�r +; + +261 +�yl�d +[2] = 0; + +262 +�yl�d +[3] = 1; + +263 +�yl�d +[4] = 'h'; + +264 +�yl�d +[5] = +id�tif�r +; + +265 +�yl�d +[6] = 0; + +266 +�yl�d +[7] = 1; + +267 +�yl�d +[8] = 'h'; + +269 + `�r�g_��_�ad_h��r +( +comm�d +, +�yl�d +, 9, +MOSQ_ERR_DUPLICATE_PROPERTY +, +id�tif�r +, ""); + +270 + } +} + +272 + $�r�g_��_��_�ad_h��r +( + +273 +u�t8_t + * +�yl�d +, + +274 +�ma��g_�ngth +, + +275 +rc_ex��ed +, + +276 +id�tif�r +, + +277 cڡ * +�me_ex��ed +, + +278 cڡ * +v�ue_ex��ed +, + +279 +bo� + +ex��_muɝ� +) + +281 +mosqu�to__�ck� + +�ck� +; + +282 +mosqu�to_�ݔty + * +�ݔt�s +; + +283 +rc +; + +285 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +286 +�ck� +. +�yl�d + =�ayload; + +287 +�ck� +. +�ma��g_�ngth + =�emaining_length; + +288 +rc + = + `�ݔty__�ad_�l +( +CMD_CONNECT +, & +�ck� +, & +�ݔt�s +); + +290 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +291 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, +�ma��g_�ngth +); + +292 if( +�ݔt�s +){ + +293 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +id�tif�r +, identifier); + +294 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +�me +. +�n +, + `��� +( +�me_ex��ed +)); + +295 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +v�ue +. +s +. +�n +, + `��� +( +v�ue_ex��ed +)); + +296 + `CU_ASSERT_STRING_EQUAL +( +�ݔt�s +-> +�me +. +v +, +�me_ex��ed +); + +297 + `CU_ASSERT_STRING_EQUAL +( +�ݔt�s +-> +v�ue +. +s +. +v +, +v�ue_ex��ed +); + +298 if( +ex��_muɝ� +){ + +299 + `CU_ASSERT_PTR_NOT_NULL +( +�ݔt�s +-> +�xt +); + +301 + `CU_ASSERT_PTR_NULL +( +�ݔt�s +-> +�xt +); + +302 + `CU_ASSERT_EQUAL +( + `�ݔty__g�_�ngth_�l +( +�ݔt�s +), 1+2+ + `��� +( +�me_ex��ed +)+2+���( +v�ue_ex��ed +)); + +304 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +306 + `CU_ASSERT_PTR_NULL +( +�ݔt�s +); + +307 + } +} + +309 + $v��t_��_�ad_h��r +( + +310 +u�t8_t + * +�yl�d +, + +311 +�ma��g_�ngth +, + +312 +rc_ex��ed +, + +313 +id�tif�r +, + +314 +u�t32_t + +v�ue_ex��ed +) + +316 +mosqu�to__�ck� + +�ck� +; + +317 +mosqu�to_�ݔty + * +�ݔt�s +; + +318 +rc +; + +320 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +321 +�ck� +. +�yl�d + =�ayload; + +322 +�ck� +. +�ma��g_�ngth + =�emaining_length; + +323 +rc + = + `�ݔty__�ad_�l +( +CMD_PUBLISH +, & +�ck� +, & +�ݔt�s +); + +325 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +326 if( +�ݔt�s +){ + +327 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +id�tif�r +, identifier); + +328 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +v�ue +. +v��t +, +v�ue_ex��ed +); + +329 + `CU_ASSERT_PTR_NULL +( +�ݔt�s +-> +�xt +); + +330 + `CU_ASSERT_EQUAL +( + `�ݔty__g�_�ngth_�l +( +�ݔt�s +), + `�ck�__v��t_by�s +( +v�ue_ex��ed +)+1); + +331 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +333 + `CU_ASSERT_PTR_NULL +( +�ݔt�s +); + +334 + } +} + +336 + $�ck�_h��r_�as�_�r�g_u�r_�ݔty +( +comm�d +) + +338 +u�t8_t + +�yl�d +[24] = {23, + +339 +MQTT_PROP_REASON_STRING +, 0, 6, 'r', 'e', 'a', 's', 'o', 'n', + +340 +MQTT_PROP_USER_PROPERTY +, 0, 4, 'n', 'a', 'm', 'e', 0, 5, 'v', 'a', 'l', 'u', 'e'}; + +342 +mosqu�to__�ck� + +�ck� +; + +343 +mosqu�to_�ݔty + * +�ݔt�s +, * +p +; + +344 +rc +; + +346 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +347 +�ck� +. +�yl�d + =�ayload; + +348 +�ck� +. +�ma��g_�ngth + = ( +�yl�d +);; + +349 +rc + = + `�ݔty__�ad_�l +( +comm�d +, & +�ck� +, & +�ݔt�s +); + +351 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +352 + `CU_ASSERT_PTR_NOT_NULL +( +�ݔt�s +); + +353 if( +�ݔt�s +){ + +354 + `CU_ASSERT_PTR_NOT_NULL +( +�ݔt�s +-> +�xt +); + +355 +p + = +�ݔt�s +; + +357 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_REASON_STRING +); + +358 + `CU_ASSERT_STRING_EQUAL +( +p +-> +v�ue +. +s +. +v +, "reason"); + +359 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, + `��� +("reason")); + +361 +p + =�-> +�xt +; + +362 if( +p +){ + +363 + `CU_ASSERT_PTR_NULL +( +p +-> +�xt +); + +365 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_USER_PROPERTY +); + +366 + `CU_ASSERT_STRING_EQUAL +( +p +-> +v�ue +. +s +. +v +, "value"); + +367 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, + `��� +("value")); + +368 + `CU_ASSERT_STRING_EQUAL +( +p +-> +�me +. +v +, "name"); + +369 + `CU_ASSERT_EQUAL +( +p +-> +�me +. +�n +, + `��� +("name")); + +372 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +374 + } +} + +380 + $TEST_no_�ݔt�s +() + +382 +mosqu�to__�ck� + +�ck� +; + +383 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +384 +u�t8_t + +�yl�d +[5]; + +385 +rc +; + +387 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +388 + `mem�t +( +�yl�d +, 0, (payload)); + +389 +�ck� +. +�yl�d + =�ayload; + +390 +�ck� +. +�ma��g_�ngth + = 1; + +391 +rc + = + `�ݔty__�ad_�l +( +CMD_CONNECT +, & +�ck� +, & +�ݔt�s +); + +392 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +393 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +, +NULL +); + +394 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, 1); + +395 + } +} + +397 + $TEST_�un��d +() + +399 +mosqu�to__�ck� + +�ck� +; + +400 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +401 +u�t8_t + +�yl�d +[5]; + +402 +rc +; + +405 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +406 + `mem�t +( +�yl�d +, 0, (payload)); + +407 +�ck� +. +�yl�d + =�ayload; + +408 +�ck� +. +�ma��g_�ngth + = 0; + +409 +rc + = + `�ݔty__�ad_�l +( +CMD_CONNECT +, & +�ck� +, & +�ݔt�s +); + +410 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_PROTOCOL +); + +411 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +, +NULL +); + +412 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, 0); + +415 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +416 + `mem�t +( +�yl�d +, 0, (payload)); + +417 +�yl�d +[0] = 2; + +418 +�ck� +. +�yl�d + =�ayload; + +419 +�ck� +. +�ma��g_�ngth + = 1; + +420 +rc + = + `�ݔty__�ad_�l +( +CMD_CONNECT +, & +�ck� +, & +�ݔt�s +); + +421 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_PROTOCOL +); + +422 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +, +NULL +); + +423 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, 1); + +426 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +427 + `mem�t +( +�yl�d +, 0, (payload)); + +428 +�yl�d +[0] = 4; + +429 +�yl�d +[1] = +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +; + +430 +�ck� +. +�yl�d + =�ayload; + +431 +�ck� +. +�ma��g_�ngth + = 2; + +432 +rc + = + `�ݔty__�ad_�l +( +CMD_CONNECT +, & +�ck� +, & +�ݔt�s +); + +433 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_PROTOCOL +); + +434 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +, +NULL +); + +435 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, 2); + +436 + } +} + +442 + $TEST_�v�id_�ݔty_id +() + +444 +mosqu�to__�ck� + +�ck� +; + +445 +mosqu�to_�ݔty + * +�ݔt�s + = +NULL +; + +446 +u�t8_t + +�yl�d +[5]; + +447 +rc +; + +450 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +451 + `mem�t +( +�yl�d +, 0, (payload)); + +452 +�yl�d +[0] = 4; + +453 +�ck� +. +�yl�d + =�ayload; + +454 +�ck� +. +�ma��g_�ngth + = 2; + +455 +rc + = + `�ݔty__�ad_�l +( +CMD_CONNECT +, & +�ck� +, & +�ݔt�s +); + +456 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_MALFORMED_PACKET +); + +457 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +, +NULL +); + +458 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, 2); + +461 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +462 + `mem�t +( +�yl�d +, 0, (payload)); + +463 +�yl�d +[0] = 4; + +464 +�yl�d +[1] = 4; + +465 +�ck� +. +�yl�d + =�ayload; + +466 +�ck� +. +�ma��g_�ngth + = 2; + +467 +rc + = + `�ݔty__�ad_�l +( +CMD_CONNECT +, & +�ck� +, & +�ݔt�s +); + +468 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_MALFORMED_PACKET +); + +469 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +, +NULL +); + +470 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, 2); + +471 + } +} + +477 + $TEST_s�g�_�yl�d_f�m�_�di�t� +() + +479 +u�t8_t + +�yl�d +[20]; + +481 + `mem�t +(& +�yl�d +, 0, (payload)); + +482 +�yl�d +[0] = 2; + +483 +�yl�d +[1] = +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +; + +484 +�yl�d +[2] = 1; + +486 + `by�_��_�ad_h��r +( +CMD_PUBLISH +, +�yl�d +, 3, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +, 1); + +487 + } +} + +489 + $TEST_s�g�_�que�_�ob�m_�f�m�i� +() + +491 +u�t8_t + +�yl�d +[20]; + +493 + `mem�t +(& +�yl�d +, 0, (payload)); + +494 +�yl�d +[0] = 2; + +495 +�yl�d +[1] = +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +; + +496 +�yl�d +[2] = 1; + +498 + `by�_��_�ad_h��r +( +CMD_CONNECT +, +�yl�d +, 3, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +, 1); + +499 + } +} + +501 + $TEST_s�g�_�que�_��ڣ_�f�m�i� +() + +503 +u�t8_t + +�yl�d +[20]; + +505 + `mem�t +(& +�yl�d +, 0, (payload)); + +506 +�yl�d +[0] = 2; + +507 +�yl�d +[1] = +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +; + +508 +�yl�d +[2] = 1; + +510 + `by�_��_�ad_h��r +( +CMD_CONNECT +, +�yl�d +, 3, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +, 1); + +511 + } +} + +513 + $TEST_s�g�_maximum_qos +() + +515 +u�t8_t + +�yl�d +[20]; + +517 + `mem�t +(& +�yl�d +, 0, (payload)); + +518 +�yl�d +[0] = 2; + +519 +�yl�d +[1] = +MQTT_PROP_MAXIMUM_QOS +; + +520 +�yl�d +[2] = 1; + +522 + `by�_��_�ad_h��r +( +CMD_CONNACK +, +�yl�d +, 3, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_MAXIMUM_QOS +, 1); + +523 + } +} + +525 + $TEST_s�g�_���_ava�ab� +() + +527 +u�t8_t + +�yl�d +[20]; + +529 + `mem�t +(& +�yl�d +, 0, (payload)); + +530 +�yl�d +[0] = 2; + +531 +�yl�d +[1] = +MQTT_PROP_RETAIN_AVAILABLE +; + +532 +�yl�d +[2] = 1; + +534 + `by�_��_�ad_h��r +( +CMD_CONNACK +, +�yl�d +, 3, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_RETAIN_AVAILABLE +, 1); + +535 + } +} + +537 + $TEST_s�g�_w�d�rd_subs��ti�_ava�ab� +() + +539 +u�t8_t + +�yl�d +[20]; + +541 + `mem�t +(& +�yl�d +, 0, (payload)); + +542 +�yl�d +[0] = 2; + +543 +�yl�d +[1] = +MQTT_PROP_WILDCARD_SUB_AVAILABLE +; + +544 +�yl�d +[2] = 0; + +546 + `by�_��_�ad_h��r +( +CMD_CONNACK +, +�yl�d +, 3, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_WILDCARD_SUB_AVAILABLE +, 0); + +547 + } +} + +549 + $TEST_s�g�_subs��ti�_id�tif�r_ava�ab� +() + +551 +u�t8_t + +�yl�d +[20]; + +553 + `mem�t +(& +�yl�d +, 0, (payload)); + +554 +�yl�d +[0] = 2; + +555 +�yl�d +[1] = +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +; + +556 +�yl�d +[2] = 0; + +558 + `by�_��_�ad_h��r +( +CMD_CONNACK +, +�yl�d +, 3, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +, 0); + +559 + } +} + +561 + $TEST_s�g�_sh�ed_subs��ti�_ava�ab� +() + +563 +u�t8_t + +�yl�d +[20]; + +565 + `mem�t +(& +�yl�d +, 0, (payload)); + +566 +�yl�d +[0] = 2; + +567 +�yl�d +[1] = +MQTT_PROP_SHARED_SUB_AVAILABLE +; + +568 +�yl�d +[2] = 1; + +570 + `by�_��_�ad_h��r +( +CMD_CONNACK +, +�yl�d +, 3, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SHARED_SUB_AVAILABLE +, 1); + +571 + } +} + +573 + $TEST_s�g�_mes�ge_exp�y_��rv� +() + +575 +u�t8_t + +�yl�d +[20]; + +577 + `mem�t +(& +�yl�d +, 0, (payload)); + +578 +�yl�d +[0] = 5; + +579 +�yl�d +[1] = +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +; + +580 +�yl�d +[2] = 0x12; + +581 +�yl�d +[3] = 0x23; + +582 +�yl�d +[4] = 0x34; + +583 +�yl�d +[5] = 0x45; + +585 + `�t32_��_�ad_h��r +( +CMD_WILL +, +�yl�d +, 6, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +, 0x12233445); + +586 + } +} + +588 + $TEST_s�g�_�ssi�_exp�y_��rv� +() + +590 +u�t8_t + +�yl�d +[20]; + +592 + `mem�t +(& +�yl�d +, 0, (payload)); + +593 +�yl�d +[0] = 5; + +594 +�yl�d +[1] = +MQTT_PROP_SESSION_EXPIRY_INTERVAL +; + +595 +�yl�d +[2] = 0x45; + +596 +�yl�d +[3] = 0x34; + +597 +�yl�d +[4] = 0x23; + +598 +�yl�d +[5] = 0x12; + +600 + `�t32_��_�ad_h��r +( +CMD_CONNACK +, +�yl�d +, 6, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SESSION_EXPIRY_INTERVAL +, 0x45342312); + +601 + } +} + +603 + $TEST_s�g�_w�l_d�ay_��rv� +() + +605 +u�t8_t + +�yl�d +[20]; + +607 + `mem�t +(& +�yl�d +, 0, (payload)); + +608 +�yl�d +[0] = 5; + +609 +�yl�d +[1] = +MQTT_PROP_WILL_DELAY_INTERVAL +; + +610 +�yl�d +[2] = 0x45; + +611 +�yl�d +[3] = 0x34; + +612 +�yl�d +[4] = 0x23; + +613 +�yl�d +[5] = 0x12; + +615 + `�t32_��_�ad_h��r +( +CMD_WILL +, +�yl�d +, 6, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_WILL_DELAY_INTERVAL +, 0x45342312); + +616 + } +} + +618 + $TEST_s�g�_maximum_�ck�_size +() + +620 +u�t8_t + +�yl�d +[20]; + +622 + `mem�t +(& +�yl�d +, 0, (payload)); + +623 +�yl�d +[0] = 5; + +624 +�yl�d +[1] = +MQTT_PROP_MAXIMUM_PACKET_SIZE +; + +625 +�yl�d +[2] = 0x45; + +626 +�yl�d +[3] = 0x34; + +627 +�yl�d +[4] = 0x23; + +628 +�yl�d +[5] = 0x12; + +630 + `�t32_��_�ad_h��r +( +CMD_CONNECT +, +�yl�d +, 6, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_MAXIMUM_PACKET_SIZE +, 0x45342312); + +631 + } +} + +633 + $TEST_s�g�_�rv�_k�p_�ive +() + +635 +u�t8_t + +�yl�d +[20]; + +637 + `mem�t +(& +�yl�d +, 0, (payload)); + +638 +�yl�d +[0] = 3; + +639 +�yl�d +[1] = +MQTT_PROP_SERVER_KEEP_ALIVE +; + +640 +�yl�d +[2] = 0x45; + +641 +�yl�d +[3] = 0x34; + +643 + `�t16_��_�ad_h��r +( +CMD_CONNACK +, +�yl�d +, 4, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SERVER_KEEP_ALIVE +, 0x4534); + +644 + } +} + +646 + $TEST_s�g�_��ive_maximum +() + +648 +u�t8_t + +�yl�d +[20]; + +650 + `mem�t +(& +�yl�d +, 0, (payload)); + +651 +�yl�d +[0] = 3; + +652 +�yl�d +[1] = +MQTT_PROP_RECEIVE_MAXIMUM +; + +653 +�yl�d +[2] = 0x68; + +654 +�yl�d +[3] = 0x42; + +656 + `�t16_��_�ad_h��r +( +CMD_CONNACK +, +�yl�d +, 4, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_RECEIVE_MAXIMUM +, 0x6842); + +657 + } +} + +659 + $TEST_s�g�_t�ic_��s_maximum +() + +661 +u�t8_t + +�yl�d +[20]; + +663 + `mem�t +(& +�yl�d +, 0, (payload)); + +664 +�yl�d +[0] = 3; + +665 +�yl�d +[1] = +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +; + +666 +�yl�d +[2] = 0x68; + +667 +�yl�d +[3] = 0x42; + +669 + `�t16_��_�ad_h��r +( +CMD_CONNECT +, +�yl�d +, 4, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +, 0x6842); + +670 + } +} + +672 + $TEST_s�g�_t�ic_��s +() + +674 +u�t8_t + +�yl�d +[20]; + +676 + `mem�t +(& +�yl�d +, 0, (payload)); + +677 +�yl�d +[0] = 3; + +678 +�yl�d +[1] = +MQTT_PROP_TOPIC_ALIAS +; + +679 +�yl�d +[2] = 0x68; + +680 +�yl�d +[3] = 0x42; + +682 + `�t16_��_�ad_h��r +( +CMD_PUBLISH +, +�yl�d +, 4, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_TOPIC_ALIAS +, 0x6842); + +683 + } +} + +685 + $TEST_s�g�_cڋ�_ty� +() + +687 +u�t8_t + +�yl�d +[20]; + +689 + `mem�t +(& +�yl�d +, 0, (payload)); + +690 +�yl�d +[0] = 8; + +691 +�yl�d +[1] = +MQTT_PROP_CONTENT_TYPE +; + +692 +�yl�d +[2] = 0x00; + +693 +�yl�d +[3] = 0x05; + +694 +�yl�d +[4] = 'h'; + +695 +�yl�d +[5] = 'e'; + +696 +�yl�d +[6] = 'l'; + +697 +�yl�d +[7] = 'l'; + +698 +�yl�d +[8] = 'o'; + +700 + `�r�g_��_�ad_h��r +( +CMD_PUBLISH +, +�yl�d +, 9, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_CONTENT_TYPE +, "hello"); + +701 + } +} + +703 + $TEST_s�g�_��ڣ_t�ic +() + +705 +u�t8_t + +�yl�d +[20]; + +707 + `mem�t +(& +�yl�d +, 0, (payload)); + +708 +�yl�d +[0] = 8; + +709 +�yl�d +[1] = +MQTT_PROP_RESPONSE_TOPIC +; + +710 +�yl�d +[2] = 0x00; + +711 +�yl�d +[3] = 0x05; + +712 +�yl�d +[4] = 'h'; + +713 +�yl�d +[5] = 'e'; + +714 +�yl�d +[6] = 'l'; + +715 +�yl�d +[7] = 'l'; + +716 +�yl�d +[8] = 'o'; + +718 + `�r�g_��_�ad_h��r +( +CMD_WILL +, +�yl�d +, 9, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_RESPONSE_TOPIC +, "hello"); + +719 + } +} + +721 + $TEST_s�g�_assig�d_���_id�tif�r +() + +723 +u�t8_t + +�yl�d +[20]; + +725 + `mem�t +(& +�yl�d +, 0, (payload)); + +726 +�yl�d +[0] = 8; + +727 +�yl�d +[1] = +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +; + +728 +�yl�d +[2] = 0x00; + +729 +�yl�d +[3] = 0x05; + +730 +�yl�d +[4] = 'h'; + +731 +�yl�d +[5] = 'e'; + +732 +�yl�d +[6] = 'l'; + +733 +�yl�d +[7] = 'l'; + +734 +�yl�d +[8] = 'o'; + +736 + `�r�g_��_�ad_h��r +( +CMD_CONNACK +, +�yl�d +, 9, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +, "hello"); + +737 + } +} + +739 + $TEST_s�g�_auth�ti�ti�_m�hod +() + +741 +u�t8_t + +�yl�d +[20]; + +743 + `mem�t +(& +�yl�d +, 0, (payload)); + +744 +�yl�d +[0] = 8; + +745 +�yl�d +[1] = +MQTT_PROP_AUTHENTICATION_METHOD +; + +746 +�yl�d +[2] = 0x00; + +747 +�yl�d +[3] = 0x05; + +748 +�yl�d +[4] = 'h'; + +749 +�yl�d +[5] = 'e'; + +750 +�yl�d +[6] = 'l'; + +751 +�yl�d +[7] = 'l'; + +752 +�yl�d +[8] = 'o'; + +754 + `�r�g_��_�ad_h��r +( +CMD_AUTH +, +�yl�d +, 9, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_AUTHENTICATION_METHOD +, "hello"); + +755 + } +} + +757 + $TEST_s�g�_��ڣ_�f�m�i� +() + +759 +u�t8_t + +�yl�d +[20]; + +761 + `mem�t +(& +�yl�d +, 0, (payload)); + +762 +�yl�d +[0] = 8; + +763 +�yl�d +[1] = +MQTT_PROP_RESPONSE_INFORMATION +; + +764 +�yl�d +[2] = 0x00; + +765 +�yl�d +[3] = 0x05; + +766 +�yl�d +[4] = 'h'; + +767 +�yl�d +[5] = 'e'; + +768 +�yl�d +[6] = 'l'; + +769 +�yl�d +[7] = 'l'; + +770 +�yl�d +[8] = 'o'; + +772 + `�r�g_��_�ad_h��r +( +CMD_CONNACK +, +�yl�d +, 9, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_RESPONSE_INFORMATION +, "hello"); + +773 + } +} + +775 + $TEST_s�g�_�rv�_��n� +() + +777 +u�t8_t + +�yl�d +[20]; + +779 + `mem�t +(& +�yl�d +, 0, (payload)); + +780 +�yl�d +[0] = 8; + +781 +�yl�d +[1] = +MQTT_PROP_SERVER_REFERENCE +; + +782 +�yl�d +[2] = 0x00; + +783 +�yl�d +[3] = 0x05; + +784 +�yl�d +[4] = 'h'; + +785 +�yl�d +[5] = 'e'; + +786 +�yl�d +[6] = 'l'; + +787 +�yl�d +[7] = 'l'; + +788 +�yl�d +[8] = 'o'; + +790 + `�r�g_��_�ad_h��r +( +CMD_CONNACK +, +�yl�d +, 9, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SERVER_REFERENCE +, "hello"); + +791 + } +} + +793 + $TEST_s�g�_�as�_�r�g +() + +795 +u�t8_t + +�yl�d +[20]; + +797 + `mem�t +(& +�yl�d +, 0, (payload)); + +798 +�yl�d +[0] = 8; + +799 +�yl�d +[1] = +MQTT_PROP_REASON_STRING +; + +800 +�yl�d +[2] = 0x00; + +801 +�yl�d +[3] = 0x05; + +802 +�yl�d +[4] = 'h'; + +803 +�yl�d +[5] = 'e'; + +804 +�yl�d +[6] = 'l'; + +805 +�yl�d +[7] = 'l'; + +806 +�yl�d +[8] = 'o'; + +808 + `�r�g_��_�ad_h��r +( +CMD_PUBCOMP +, +�yl�d +, 9, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_REASON_STRING +, "hello"); + +809 + } +} + +811 + $TEST_s�g�_cܻ�ti�_d�a +() + +813 +u�t8_t + +�yl�d +[20]; + +815 + `mem�t +(& +�yl�d +, 0, (payload)); + +816 +�yl�d +[0] = 8; + +817 +�yl�d +[1] = +MQTT_PROP_CORRELATION_DATA +; + +818 +�yl�d +[2] = 0x00; + +819 +�yl�d +[3] = 0x05; + +820 +�yl�d +[4] = 1; + +821 +�yl�d +[5] = 'e'; + +822 +�yl�d +[6] = 0; + +823 +�yl�d +[7] = 'l'; + +824 +�yl�d +[8] = 9; + +826 + `b��y_��_�ad_h��r +( +CMD_PUBLISH +, +�yl�d +, 9, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_CORRELATION_DATA +, &payload[4], 5); + +827 + } +} + +829 + $TEST_s�g�_auth�ti�ti�_d�a +() + +831 +u�t8_t + +�yl�d +[20]; + +833 + `mem�t +(& +�yl�d +, 0, (payload)); + +834 +�yl�d +[0] = 8; + +835 +�yl�d +[1] = +MQTT_PROP_AUTHENTICATION_DATA +; + +836 +�yl�d +[2] = 0x00; + +837 +�yl�d +[3] = 0x05; + +838 +�yl�d +[4] = 1; + +839 +�yl�d +[5] = 'e'; + +840 +�yl�d +[6] = 0; + +841 +�yl�d +[7] = 'l'; + +842 +�yl�d +[8] = 9; + +844 + `b��y_��_�ad_h��r +( +CMD_CONNECT +, +�yl�d +, 9, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_AUTHENTICATION_DATA +, &payload[4], 5); + +845 + } +} + +847 + $TEST_s�g�_u�r_�ݔty +() + +849 +u�t8_t + +�yl�d +[20]; + +851 +�yl�d +[0] = 9; + +852 +�yl�d +[1] = +MQTT_PROP_USER_PROPERTY +; + +853 +�yl�d +[2] = 0; + +854 +�yl�d +[3] = 2; + +855 +�yl�d +[4] = 'z'; + +856 +�yl�d +[5] = 'a'; + +857 +�yl�d +[6] = 0; + +858 +�yl�d +[7] = 2; + +859 +�yl�d +[8] = 'b'; + +860 +�yl�d +[9] = 'c'; + +862 + `�r�g_��_��_�ad_h��r +( +�yl�d +, 10, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_USER_PROPERTY +, "za", "bc", +�l� +); + +863 + } +} + +865 + $TEST_s�g�_subs��ti�_id�tif�r +() + +867 +u�t8_t + +�yl�d +[20]; + +869 +�yl�d +[0] = 2; + +870 +�yl�d +[1] = +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +; + +871 +�yl�d +[2] = 0; + +872 + `v��t_��_�ad_h��r +( +�yl�d +, 3, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 0); + +874 +�yl�d +[0] = 2; + +875 +�yl�d +[1] = +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +; + +876 +�yl�d +[2] = 0x7F; + +877 + `v��t_��_�ad_h��r +( +�yl�d +, 3, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 127); + +879 +�yl�d +[0] = 3; + +880 +�yl�d +[1] = +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +; + +881 +�yl�d +[2] = 0x80; + +882 +�yl�d +[3] = 0x01; + +883 + `v��t_��_�ad_h��r +( +�yl�d +, 4, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 128); + +885 +�yl�d +[0] = 3; + +886 +�yl�d +[1] = +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +; + +887 +�yl�d +[2] = 0xFF; + +888 +�yl�d +[3] = 0x7F; + +889 + `v��t_��_�ad_h��r +( +�yl�d +, 4, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 16383); + +891 +�yl�d +[0] = 4; + +892 +�yl�d +[1] = +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +; + +893 +�yl�d +[2] = 0x80; + +894 +�yl�d +[3] = 0x80; + +895 +�yl�d +[4] = 0x01; + +896 + `v��t_��_�ad_h��r +( +�yl�d +, 5, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 16384); + +898 +�yl�d +[0] = 4; + +899 +�yl�d +[1] = +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +; + +900 +�yl�d +[2] = 0xFF; + +901 +�yl�d +[3] = 0xFF; + +902 +�yl�d +[4] = 0x7F; + +903 + `v��t_��_�ad_h��r +( +�yl�d +, 5, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 2097151); + +905 +�yl�d +[0] = 5; + +906 +�yl�d +[1] = +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +; + +907 +�yl�d +[2] = 0x80; + +908 +�yl�d +[3] = 0x80; + +909 +�yl�d +[4] = 0x80; + +910 +�yl�d +[5] = 0x01; + +911 + `v��t_��_�ad_h��r +( +�yl�d +, 6, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 2097152); + +914 +�yl�d +[0] = 5; + +915 +�yl�d +[1] = +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +; + +916 +�yl�d +[2] = 0xFF; + +917 +�yl�d +[3] = 0xFF; + +918 +�yl�d +[4] = 0xFF; + +919 +�yl�d +[5] = 0x7F; + +920 + `v��t_��_�ad_h��r +( +�yl�d +, 6, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 268435455); + +921 + } +} + +927 + $TEST_du�i��_�yl�d_f�m�_�di�t� +() + +929 + `du�i��_by�_h��r +( +CMD_PUBLISH +, +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +); + +930 + } +} + +932 + $TEST_du�i��_�que�_�ob�m_�f�m�i� +() + +934 + `du�i��_by�_h��r +( +CMD_CONNECT +, +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +); + +935 + } +} + +937 + $TEST_du�i��_�que�_��ڣ_�f�m�i� +() + +939 + `du�i��_by�_h��r +( +CMD_CONNECT +, +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +); + +940 + } +} + +942 + $TEST_du�i��_maximum_qos +() + +944 + `du�i��_by�_h��r +( +CMD_CONNACK +, +MQTT_PROP_MAXIMUM_QOS +); + +945 + } +} + +947 + $TEST_du�i��_���_ava�ab� +() + +949 + `du�i��_by�_h��r +( +CMD_CONNACK +, +MQTT_PROP_RETAIN_AVAILABLE +); + +950 + } +} + +952 + $TEST_du�i��_w�d�rd_subs��ti�_ava�ab� +() + +954 + `du�i��_by�_h��r +( +CMD_CONNACK +, +MQTT_PROP_WILDCARD_SUB_AVAILABLE +); + +955 + } +} + +957 + $TEST_du�i��_subs��ti�_id�tif�r_ava�ab� +() + +959 + `du�i��_by�_h��r +( +CMD_CONNACK +, +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +); + +960 + } +} + +962 + $TEST_du�i��_sh�ed_subs��ti�_ava�ab� +() + +964 + `du�i��_by�_h��r +( +CMD_CONNACK +, +MQTT_PROP_SHARED_SUB_AVAILABLE +); + +965 + } +} + +967 + $TEST_du�i��_mes�ge_exp�y_��rv� +() + +969 + `du�i��_�t32_h��r +( +CMD_PUBLISH +, +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +); + +970 + } +} + +972 + $TEST_du�i��_�ssi�_exp�y_��rv� +() + +974 + `du�i��_�t32_h��r +( +CMD_DISCONNECT +, +MQTT_PROP_SESSION_EXPIRY_INTERVAL +); + +975 + } +} + +977 + $TEST_du�i��_w�l_d�ay_��rv� +() + +979 + `du�i��_�t32_h��r +( +CMD_WILL +, +MQTT_PROP_WILL_DELAY_INTERVAL +); + +980 + } +} + +982 + $TEST_du�i��_maximum_�ck�_size +() + +984 + `du�i��_�t32_h��r +( +CMD_CONNECT +, +MQTT_PROP_MAXIMUM_PACKET_SIZE +); + +985 + } +} + +987 + $TEST_du�i��_�rv�_k�p_�ive +() + +989 + `du�i��_�t16_h��r +( +CMD_CONNACK +, +MQTT_PROP_SERVER_KEEP_ALIVE +); + +990 + } +} + +992 + $TEST_du�i��_��ive_maximum +() + +994 + `du�i��_�t16_h��r +( +CMD_CONNACK +, +MQTT_PROP_RECEIVE_MAXIMUM +); + +995 + } +} + +997 + $TEST_du�i��_t�ic_��s_maximum +() + +999 + `du�i��_�t16_h��r +( +CMD_CONNECT +, +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +); + +1000 + } +} + +1002 + $TEST_du�i��_t�ic_��s +() + +1004 + `du�i��_�t16_h��r +( +CMD_PUBLISH +, +MQTT_PROP_TOPIC_ALIAS +); + +1005 + } +} + +1007 + $TEST_du�i��_cڋ�_ty� +() + +1009 + `du�i��_�r�g_h��r +( +CMD_PUBLISH +, +MQTT_PROP_CONTENT_TYPE +); + +1010 + } +} + +1012 + $TEST_du�i��_��ڣ_t�ic +() + +1014 + `du�i��_�r�g_h��r +( +CMD_PUBLISH +, +MQTT_PROP_RESPONSE_TOPIC +); + +1015 + } +} + +1017 + $TEST_du�i��_assig�d_���_id�tif�r +() + +1019 + `du�i��_�r�g_h��r +( +CMD_CONNACK +, +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +); + +1020 + } +} + +1022 + $TEST_du�i��_auth�ti�ti�_m�hod +() + +1024 + `du�i��_�r�g_h��r +( +CMD_AUTH +, +MQTT_PROP_AUTHENTICATION_METHOD +); + +1025 + } +} + +1027 + $TEST_du�i��_��ڣ_�f�m�i� +() + +1029 + `du�i��_�r�g_h��r +( +CMD_CONNACK +, +MQTT_PROP_RESPONSE_INFORMATION +); + +1030 + } +} + +1032 + $TEST_du�i��_�rv�_��n� +() + +1034 + `du�i��_�r�g_h��r +( +CMD_CONNACK +, +MQTT_PROP_SERVER_REFERENCE +); + +1035 + } +} + +1037 + $TEST_du�i��_�as�_�r�g +() + +1039 + `du�i��_�r�g_h��r +( +CMD_PUBACK +, +MQTT_PROP_REASON_STRING +); + +1040 + } +} + +1042 + $TEST_du�i��_cܻ�ti�_d�a +() + +1044 + `du�i��_b��y_h��r +( +CMD_PUBLISH +, +MQTT_PROP_CORRELATION_DATA +); + +1045 + } +} + +1047 + $TEST_du�i��_auth�ti�ti�_d�a +() + +1049 + `du�i��_b��y_h��r +( +CMD_CONNACK +, +MQTT_PROP_AUTHENTICATION_DATA +); + +1050 + } +} + +1052 + $TEST_du�i��_u�r_�ݔty +() + +1054 +u�t8_t + +�yl�d +[20]; + +1056 + `mem�t +(& +�yl�d +, 0, (payload)); + +1057 +�yl�d +[0] = 18; + +1058 +�yl�d +[1] = +MQTT_PROP_USER_PROPERTY +; + +1059 +�yl�d +[2] = 0; + +1060 +�yl�d +[3] = 2; + +1061 +�yl�d +[4] = 'a'; + +1062 +�yl�d +[5] = 'b'; + +1063 +�yl�d +[6] = 0; + +1064 +�yl�d +[7] = 2; + +1065 +�yl�d +[8] = 'g'; + +1066 +�yl�d +[9] = 'h'; + +1067 +�yl�d +[10] = +MQTT_PROP_USER_PROPERTY +; + +1068 +�yl�d +[11] = 0; + +1069 +�yl�d +[12] = 2; + +1070 +�yl�d +[13] = 'c'; + +1071 +�yl�d +[14] = 'd'; + +1072 +�yl�d +[15] = 0; + +1073 +�yl�d +[16] = 2; + +1074 +�yl�d +[17] = 'e'; + +1075 +�yl�d +[18] = 'f'; + +1077 + `�r�g_��_��_�ad_h��r +( +�yl�d +, 19, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_USER_PROPERTY +, "ab", "gh", +�ue +); + +1078 + } +} + +1080 + $TEST_du�i��_subs��ti�_id�tif�r +() + +1082 +u�t8_t + +�yl�d +[20]; + +1084 + `mem�t +(& +�yl�d +, 0, (payload)); + +1085 +�yl�d +[0] = 4; + +1086 +�yl�d +[1] = +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +; + +1087 +�yl�d +[2] = 0x80; + +1088 +�yl�d +[3] = 0x02; + +1089 +�yl�d +[4] = +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +; + +1090 +�yl�d +[5] = 0x04; + +1092 + `v��t_��_�ad_h��r +( +�yl�d +, 5, +MOSQ_ERR_PROTOCOL +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 0); + +1093 + } +} + +1099 + $TEST_bad_�que�_�ob�m_�f�m�i� +() + +1101 + `bad_by�_h��r +( +CMD_CONNECT +, +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +); + +1102 + } +} + +1104 + $TEST_bad_�que�_��ڣ_�f�m�i� +() + +1106 + `bad_by�_h��r +( +CMD_CONNECT +, +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +); + +1107 + } +} + +1109 + $TEST_bad_maximum_qos +() + +1111 + `bad_by�_h��r +( +CMD_CONNACK +, +MQTT_PROP_MAXIMUM_QOS +); + +1112 + } +} + +1114 + $TEST_bad_���_ava�ab� +() + +1116 + `bad_by�_h��r +( +CMD_CONNACK +, +MQTT_PROP_RETAIN_AVAILABLE +); + +1117 + } +} + +1119 + $TEST_bad_w�d�rd_sub_ava�ab� +() + +1121 + `bad_by�_h��r +( +CMD_CONNACK +, +MQTT_PROP_WILDCARD_SUB_AVAILABLE +); + +1122 + } +} + +1124 + $TEST_bad_subs��ti�_id_ava�ab� +() + +1126 + `bad_by�_h��r +( +CMD_CONNACK +, +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +); + +1127 + } +} + +1129 + $TEST_bad_sh�ed_sub_ava�ab� +() + +1131 + `bad_by�_h��r +( +CMD_CONNACK +, +MQTT_PROP_SHARED_SUB_AVAILABLE +); + +1132 + } +} + +1134 + $TEST_bad_maximum_�ck�_size +() + +1136 +u�t8_t + +�yl�d +[20]; + +1138 + `mem�t +(& +�yl�d +, 0, (payload)); + +1139 +�yl�d +[0] = 5; + +1140 +�yl�d +[1] = +MQTT_PROP_MAXIMUM_PACKET_SIZE +; + +1141 +�yl�d +[2] = 0; + +1142 +�yl�d +[3] = 0; + +1143 +�yl�d +[4] = 0; + +1144 +�yl�d +[5] = 0; + +1146 + `�t32_��_�ad_h��r +( +CMD_CONNACK +, +�yl�d +, 6, +MOSQ_ERR_PROTOCOL +, +MQTT_PROP_MAXIMUM_PACKET_SIZE +, 0); + +1147 + } +} + +1149 + $TEST_bad_��ive_maximum +() + +1151 +u�t8_t + +�yl�d +[20]; + +1153 + `mem�t +(& +�yl�d +, 0, (payload)); + +1154 +�yl�d +[0] = 3; + +1155 +�yl�d +[1] = +MQTT_PROP_RECEIVE_MAXIMUM +; + +1156 +�yl�d +[2] = 0; + +1157 +�yl�d +[3] = 0; + +1159 + `�t32_��_�ad_h��r +( +CMD_CONNECT +, +�yl�d +, 4, +MOSQ_ERR_PROTOCOL +, +MQTT_PROP_RECEIVE_MAXIMUM +, 0); + +1160 + } +} + +1162 + $TEST_bad_t�ic_��s +() + +1164 +u�t8_t + +�yl�d +[20]; + +1166 + `mem�t +(& +�yl�d +, 0, (payload)); + +1167 +�yl�d +[0] = 3; + +1168 +�yl�d +[1] = +MQTT_PROP_TOPIC_ALIAS +; + +1169 +�yl�d +[2] = 0; + +1170 +�yl�d +[3] = 0; + +1172 + `�t32_��_�ad_h��r +( +CMD_PUBLISH +, +�yl�d +, 4, +MOSQ_ERR_PROTOCOL +, +MQTT_PROP_TOPIC_ALIAS +, 0); + +1173 + } +} + +1175 + $TEST_bad_cڋ�_ty� +() + +1177 + `bad_�r�g_h��r +( +MQTT_PROP_CONTENT_TYPE +); + +1178 + } +} + +1180 + $TEST_bad_subs��ti�_id�tif�r +() + +1182 +u�t8_t + +�yl�d +[20]; + +1184 + `mem�t +(& +�yl�d +, 0, (payload)); + +1185 +�yl�d +[0] = 6; + +1186 +�yl�d +[1] = +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +; + +1187 +�yl�d +[2] = 0xFF; + +1188 +�yl�d +[3] = 0xFF; + +1189 +�yl�d +[4] = 0xFF; + +1190 +�yl�d +[5] = 0xFF; + +1191 +�yl�d +[6] = 0x01; + +1193 + `v��t_��_�ad_h��r +( +�yl�d +, 7, +MOSQ_ERR_PROTOCOL +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 0); + +1194 + } +} + +1200 + $TEST_�ck�_c��� +() + +1202 +u�t8_t + +�yl�d +[] = {0, + +1203 +MQTT_PROP_SESSION_EXPIRY_INTERVAL +, 0x12, 0x45, 0x00, 0x00, + +1204 +MQTT_PROP_RECEIVE_MAXIMUM +, 0x00, 0x05, + +1205 +MQTT_PROP_MAXIMUM_PACKET_SIZE +, 0x12, 0x45, 0x00, 0x00, + +1206 +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +, 0x00, 0x02, + +1207 +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +, 1, + +1208 +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +, 1, + +1209 +MQTT_PROP_USER_PROPERTY +, 0, 4, 'n', 'a', 'm', 'e', 0, 5, 'v', 'a', 'l', 'u', 'e', + +1210 +MQTT_PROP_AUTHENTICATION_METHOD +, 0x00, 0x04, 'n', 'o', 'n', 'e', + +1211 +MQTT_PROP_AUTHENTICATION_DATA +, 0x00, 0x02, 1, 2}; + +1213 +mosqu�to__�ck� + +�ck� +; + +1214 +mosqu�to_�ݔty + * +�ݔt�s +, * +p +; + +1215 +rc +; + +1217 +�yl�d +[0] = (payload)-1; + +1219 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +1220 +�ck� +. +�yl�d + =�ayload; + +1221 +�ck� +. +�ma��g_�ngth + = ( +�yl�d +);; + +1222 +rc + = + `�ݔty__�ad_�l +( +CMD_CONNECT +, & +�ck� +, & +�ݔt�s +); + +1224 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +1225 +p + = +�ݔt�s +; + +1226 + `CU_ASSERT_PTR_NOT_NULL +( +�ݔt�s +); + +1227 if( +p +){ + +1228 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1229 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_SESSION_EXPIRY_INTERVAL +); + +1230 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +i32 +, 0x12450000); + +1232 +p + =�-> +�xt +; + +1233 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1234 if( +p +){ + +1235 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1236 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_RECEIVE_MAXIMUM +); + +1237 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +i16 +, 0x0005); + +1239 +p + =�-> +�xt +; + +1240 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1241 if( +p +){ + +1242 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1243 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_MAXIMUM_PACKET_SIZE +); + +1244 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +i32 +, 0x12450000); + +1246 +p + =�-> +�xt +; + +1247 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1248 if( +p +){ + +1249 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1250 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +); + +1251 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +i16 +, 0x0002); + +1253 +p + =�-> +�xt +; + +1254 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1255 if( +p +){ + +1256 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1257 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +); + +1258 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +i8 +, 1); + +1260 +p + =�-> +�xt +; + +1261 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1262 if( +p +){ + +1263 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1264 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +); + +1265 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +i8 +, 1); + +1267 +p + =�-> +�xt +; + +1268 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1269 if( +p +){ + +1270 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1271 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_USER_PROPERTY +); + +1272 + `CU_ASSERT_STRING_EQUAL +( +p +-> +v�ue +. +s +. +v +, "value"); + +1273 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, + `��� +("value")); + +1274 + `CU_ASSERT_STRING_EQUAL +( +p +-> +�me +. +v +, "name"); + +1275 + `CU_ASSERT_EQUAL +( +p +-> +�me +. +�n +, + `��� +("name")); + +1277 +p + =�-> +�xt +; + +1278 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1279 if( +p +){ + +1280 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1281 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_AUTHENTICATION_METHOD +); + +1282 + `CU_ASSERT_STRING_EQUAL +( +p +-> +v�ue +. +s +. +v +, "none"); + +1283 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, + `��� +("none")); + +1285 +p + =�-> +�xt +; + +1286 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1287 if( +p +){ + +1288 + `CU_ASSERT_PTR_NULL +( +p +-> +�xt +); + +1289 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_AUTHENTICATION_DATA +); + +1290 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +b� +. +v +[0], 1); + +1291 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +b� +. +v +[1], 2); + +1292 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, 2); + +1303 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +1304 + } +} + +1306 + $TEST_�ck�_c��ck +() + +1308 +u�t8_t + +�yl�d +[] = {0, + +1309 +MQTT_PROP_SESSION_EXPIRY_INTERVAL +, 0x12, 0x45, 0x00, 0x00, + +1310 +MQTT_PROP_RECEIVE_MAXIMUM +, 0x00, 0x05, + +1311 +MQTT_PROP_MAXIMUM_QOS +, 1, + +1312 +MQTT_PROP_RETAIN_AVAILABLE +, 0, + +1313 +MQTT_PROP_MAXIMUM_PACKET_SIZE +, 0x12, 0x45, 0x00, 0x00, + +1314 +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +, 0x00, 0x02, 'a', 'b', + +1315 +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +, 0x00, 0x02, + +1316 +MQTT_PROP_REASON_STRING +, 0, 6, 'r', 'e', 'a', 's', 'o', 'n', + +1317 +MQTT_PROP_USER_PROPERTY +, 0, 4, 'n', 'a', 'm', 'e', 0, 5, 'v', 'a', 'l', 'u', 'e', + +1318 +MQTT_PROP_WILDCARD_SUB_AVAILABLE +, 0, + +1319 +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +, 0, + +1320 +MQTT_PROP_SHARED_SUB_AVAILABLE +, 0, + +1321 +MQTT_PROP_SERVER_KEEP_ALIVE +, 0x00, 0xFF, + +1322 +MQTT_PROP_RESPONSE_INFORMATION +, 0x00, 0x03, 'r', 's', 'p', + +1323 +MQTT_PROP_SERVER_REFERENCE +, 0x00, 0x04, 's', 'e', 'r', 'v', + +1324 +MQTT_PROP_AUTHENTICATION_METHOD +, 0x00, 0x04, 'n', 'o', 'n', 'e', + +1325 +MQTT_PROP_AUTHENTICATION_DATA +, 0x00, 0x02, 1, 2}; + +1327 +mosqu�to__�ck� + +�ck� +; + +1328 +mosqu�to_�ݔty + * +�ݔt�s +, * +p +; + +1329 +rc +; + +1331 +�yl�d +[0] = (payload)-1; + +1333 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +1334 +�ck� +. +�yl�d + =�ayload; + +1335 +�ck� +. +�ma��g_�ngth + = ( +�yl�d +);; + +1336 +rc + = + `�ݔty__�ad_�l +( +CMD_CONNACK +, & +�ck� +, & +�ݔt�s +); + +1338 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +1339 + `CU_ASSERT_PTR_NOT_NULL +( +�ݔt�s +); + +1340 +p + = +�ݔt�s +; + +1342 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1343 if( +p +){ + +1344 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_SESSION_EXPIRY_INTERVAL +); + +1345 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +i32 +, 0x12450000); + +1347 +p + =�-> +�xt +; + +1348 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1349 if( +p +){ + +1350 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1351 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_RECEIVE_MAXIMUM +); + +1352 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +i16 +, 0x0005); + +1354 +p + =�-> +�xt +; + +1355 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1356 if( +p +){ + +1357 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1358 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_MAXIMUM_QOS +); + +1359 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +i8 +, 1); + +1361 +p + =�-> +�xt +; + +1362 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1363 if( +p +){ + +1364 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1365 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_RETAIN_AVAILABLE +); + +1366 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +i8 +, 0); + +1368 +p + =�-> +�xt +; + +1369 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1370 if( +p +){ + +1371 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1372 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_MAXIMUM_PACKET_SIZE +); + +1373 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +i32 +, 0x12450000); + +1375 +p + =�-> +�xt +; + +1376 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1377 if( +p +){ + +1378 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1379 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +); + +1380 + `CU_ASSERT_STRING_EQUAL +( +p +-> +v�ue +. +s +. +v +, "ab"); + +1381 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, + `��� +("ab")); + +1383 +p + =�-> +�xt +; + +1384 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1385 if( +p +){ + +1386 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1387 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +); + +1388 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +i16 +, 0x0002); + +1390 +p + =�-> +�xt +; + +1391 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1392 if( +p +){ + +1393 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1394 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_REASON_STRING +); + +1395 + `CU_ASSERT_STRING_EQUAL +( +p +-> +v�ue +. +s +. +v +, "reason"); + +1396 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, + `��� +("reason")); + +1398 +p + =�-> +�xt +; + +1399 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1400 if( +p +){ + +1401 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1402 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_USER_PROPERTY +); + +1403 + `CU_ASSERT_STRING_EQUAL +( +p +-> +v�ue +. +s +. +v +, "value"); + +1404 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, + `��� +("value")); + +1405 + `CU_ASSERT_STRING_EQUAL +( +p +-> +�me +. +v +, "name"); + +1406 + `CU_ASSERT_EQUAL +( +p +-> +�me +. +�n +, + `��� +("name")); + +1408 +p + =�-> +�xt +; + +1409 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1410 if( +p +){ + +1411 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1412 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_WILDCARD_SUB_AVAILABLE +); + +1413 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +i8 +, 0); + +1415 +p + =�-> +�xt +; + +1416 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1417 if( +p +){ + +1418 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1419 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +); + +1420 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +i8 +, 0); + +1422 +p + =�-> +�xt +; + +1423 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1424 if( +p +){ + +1425 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1426 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_SHARED_SUB_AVAILABLE +); + +1427 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +i8 +, 0); + +1429 +p + =�-> +�xt +; + +1430 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1431 if( +p +){ + +1432 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1433 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_SERVER_KEEP_ALIVE +); + +1434 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +i16 +, 0x00FF); + +1436 +p + =�-> +�xt +; + +1437 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1438 if( +p +){ + +1439 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1440 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_RESPONSE_INFORMATION +); + +1441 + `CU_ASSERT_STRING_EQUAL +( +p +-> +v�ue +. +s +. +v +, "rsp"); + +1442 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, + `��� +("rsp")); + +1444 +p + =�-> +�xt +; + +1445 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1446 if( +p +){ + +1447 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1448 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_SERVER_REFERENCE +); + +1449 + `CU_ASSERT_STRING_EQUAL +( +p +-> +v�ue +. +s +. +v +, "serv"); + +1450 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, + `��� +("serv")); + +1452 +p + =�-> +�xt +; + +1453 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1454 if( +p +){ + +1455 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1456 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_AUTHENTICATION_METHOD +); + +1457 + `CU_ASSERT_STRING_EQUAL +( +p +-> +v�ue +. +s +. +v +, "none"); + +1458 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, + `��� +("none")); + +1460 +p + =�-> +�xt +; + +1461 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1462 if( +p +){ + +1463 + `CU_ASSERT_PTR_NULL +( +p +-> +�xt +); + +1464 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_AUTHENTICATION_DATA +); + +1465 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +b� +. +v +[0], 1); + +1466 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +b� +. +v +[1], 2); + +1467 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, 2); + +1486 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +1487 + } +} + +1489 + $TEST_�ck�_publish +() + +1491 +u�t8_t + +�yl�d +[] = {0, + +1492 +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +, 1, + +1493 +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +, 0x12, 0x45, 0x00, 0x00, + +1494 +MQTT_PROP_TOPIC_ALIAS +, 0x00, 0x02, + +1495 +MQTT_PROP_RESPONSE_TOPIC +, 0, 6, 'r', 'e', 's', 'p', 'o', 'n', + +1496 +MQTT_PROP_CORRELATION_DATA +, 0x00, 0x02, 1, 2, + +1497 +MQTT_PROP_USER_PROPERTY +, 0, 4, 'n', 'a', 'm', 'e', 0, 5, 'v', 'a', 'l', 'u', 'e', + +1498 +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 0x04, + +1499 +MQTT_PROP_CONTENT_TYPE +, 0, 5, 'e', 'm', 'p', 't', 'y'}; + +1501 +mosqu�to__�ck� + +�ck� +; + +1502 +mosqu�to_�ݔty + * +�ݔt�s +, * +p +; + +1503 +rc +; + +1505 +�yl�d +[0] = (payload)-1; + +1507 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +1508 +�ck� +. +�yl�d + =�ayload; + +1509 +�ck� +. +�ma��g_�ngth + = ( +�yl�d +);; + +1510 +rc + = + `�ݔty__�ad_�l +( +CMD_PUBLISH +, & +�ck� +, & +�ݔt�s +); + +1512 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +1513 +p + = +�ݔt�s +; + +1515 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1516 if( +p +){ + +1517 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1518 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +); + +1519 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +i8 +, 1); + +1521 +p + =�-> +�xt +; + +1522 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1523 if( +p +){ + +1524 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1525 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +); + +1526 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +i32 +, 0x12450000); + +1528 +p + =�-> +�xt +; + +1529 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1530 if( +p +){ + +1531 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1532 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_TOPIC_ALIAS +); + +1533 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +i16 +, 0x0002); + +1535 +p + =�-> +�xt +; + +1536 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1537 if( +p +){ + +1538 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1539 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_RESPONSE_TOPIC +); + +1540 + `CU_ASSERT_STRING_EQUAL +( +p +-> +v�ue +. +s +. +v +, "respon"); + +1541 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, + `��� +("respon")); + +1543 +p + =�-> +�xt +; + +1544 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1545 if( +p +){ + +1546 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1547 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_CORRELATION_DATA +); + +1548 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +b� +. +v +[0], 1); + +1549 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +b� +. +v +[1], 2); + +1550 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +b� +. +�n +, 2); + +1552 +p + =�-> +�xt +; + +1553 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1554 if( +p +){ + +1555 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1556 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_USER_PROPERTY +); + +1557 + `CU_ASSERT_STRING_EQUAL +( +p +-> +v�ue +. +s +. +v +, "value"); + +1558 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, + `��� +("value")); + +1559 + `CU_ASSERT_STRING_EQUAL +( +p +-> +�me +. +v +, "name"); + +1560 + `CU_ASSERT_EQUAL +( +p +-> +�me +. +�n +, + `��� +("name")); + +1562 +p + =�-> +�xt +; + +1563 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1564 if( +p +){ + +1565 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1566 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +); + +1567 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +v��t +, 0x00000004); + +1569 +p + =�-> +�xt +; + +1570 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1571 if( +p +){ + +1572 + `CU_ASSERT_PTR_NULL +( +p +-> +�xt +); + +1573 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_CONTENT_TYPE +); + +1574 + `CU_ASSERT_STRING_EQUAL +( +p +-> +v�ue +. +s +. +v +, "empty"); + +1575 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, + `��� +("empty")); + +1585 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +1586 + } +} + +1588 + $TEST_�ck�_puback +() + +1590 + `�ck�_h��r_�as�_�r�g_u�r_�ݔty +( +CMD_PUBACK +); + +1591 + } +} + +1593 + $TEST_�ck�_pub�c +() + +1595 + `�ck�_h��r_�as�_�r�g_u�r_�ݔty +( +CMD_PUBREC +); + +1596 + } +} + +1598 + $TEST_�ck�_pub�l +() + +1600 + `�ck�_h��r_�as�_�r�g_u�r_�ݔty +( +CMD_PUBREL +); + +1601 + } +} + +1603 + $TEST_�ck�_pubcomp +() + +1605 + `�ck�_h��r_�as�_�r�g_u�r_�ݔty +( +CMD_PUBCOMP +); + +1606 + } +} + +1608 + $TEST_�ck�_subs�ibe +() + +1610 +u�t8_t + +�yl�d +[] = {0, + +1611 +MQTT_PROP_USER_PROPERTY +, 0, 4, 'n', 'a', 'm', 'e', 0, 5, 'v', 'a', 'l', 'u', 'e', + +1612 +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 0x04}; + +1614 +mosqu�to__�ck� + +�ck� +; + +1615 +mosqu�to_�ݔty + * +�ݔt�s +, * +p +; + +1616 +rc +; + +1618 +�yl�d +[0] = (payload)-1; + +1620 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +1621 +�ck� +. +�yl�d + =�ayload; + +1622 +�ck� +. +�ma��g_�ngth + = ( +�yl�d +);; + +1623 +rc + = + `�ݔty__�ad_�l +( +CMD_SUBSCRIBE +, & +�ck� +, & +�ݔt�s +); + +1625 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +1626 +p + = +�ݔt�s +; + +1628 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1629 if( +p +){ + +1630 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1631 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_USER_PROPERTY +); + +1632 + `CU_ASSERT_STRING_EQUAL +( +p +-> +v�ue +. +s +. +v +, "value"); + +1633 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, + `��� +("value")); + +1634 + `CU_ASSERT_STRING_EQUAL +( +p +-> +�me +. +v +, "name"); + +1635 + `CU_ASSERT_EQUAL +( +p +-> +�me +. +�n +, + `��� +("name")); + +1637 +p + =�-> +�xt +; + +1638 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1639 if( +p +){ + +1640 + `CU_ASSERT_PTR_NULL +( +p +-> +�xt +); + +1641 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +); + +1642 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +v��t +, 0x00000004); + +1646 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +1647 + } +} + +1649 + $TEST_�ck�_suback +() + +1651 + `�ck�_h��r_�as�_�r�g_u�r_�ݔty +( +CMD_SUBACK +); + +1652 + } +} + +1654 + $TEST_�ck�_unsubs�ibe +() + +1656 +u�t8_t + +�yl�d +[] = {0, + +1657 +MQTT_PROP_USER_PROPERTY +, 0, 4, 'n', 'a', 'm', 'e', 0, 5, 'v', 'a', 'l', 'u', 'e'}; + +1659 +mosqu�to__�ck� + +�ck� +; + +1660 +mosqu�to_�ݔty + * +�ݔt�s +, * +p +; + +1661 +rc +; + +1663 +�yl�d +[0] = (payload)-1; + +1665 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +1666 +�ck� +. +�yl�d + =�ayload; + +1667 +�ck� +. +�ma��g_�ngth + = ( +�yl�d +);; + +1668 +rc + = + `�ݔty__�ad_�l +( +CMD_UNSUBSCRIBE +, & +�ck� +, & +�ݔt�s +); + +1670 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +1671 +p + = +�ݔt�s +; + +1673 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1674 if( +p +){ + +1675 + `CU_ASSERT_PTR_NULL +( +p +-> +�xt +); + +1676 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_USER_PROPERTY +); + +1677 + `CU_ASSERT_STRING_EQUAL +( +p +-> +v�ue +. +s +. +v +, "value"); + +1678 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, + `��� +("value")); + +1679 + `CU_ASSERT_STRING_EQUAL +( +p +-> +�me +. +v +, "name"); + +1680 + `CU_ASSERT_EQUAL +( +p +-> +�me +. +�n +, + `��� +("name")); + +1683 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +1684 + } +} + +1686 + $TEST_�ck�_unsuback +() + +1688 + `�ck�_h��r_�as�_�r�g_u�r_�ݔty +( +CMD_UNSUBACK +); + +1689 + } +} + +1691 + $TEST_�ck�_disc��� +() + +1693 +u�t8_t + +�yl�d +[] = {0, + +1694 +MQTT_PROP_SESSION_EXPIRY_INTERVAL +, 0x12, 0x45, 0x00, 0x00, + +1695 +MQTT_PROP_REASON_STRING +, 0, 6, 'r', 'e', 'a', 's', 'o', 'n', + +1696 +MQTT_PROP_USER_PROPERTY +, 0, 4, 'n', 'a', 'm', 'e', 0, 5, 'v', 'a', 'l', 'u', 'e'}; + +1698 +mosqu�to__�ck� + +�ck� +; + +1699 +mosqu�to_�ݔty + * +�ݔt�s +, * +p +; + +1700 +rc +; + +1702 +�yl�d +[0] = (payload)-1; + +1704 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +1705 +�ck� +. +�yl�d + =�ayload; + +1706 +�ck� +. +�ma��g_�ngth + = ( +�yl�d +);; + +1707 +rc + = + `�ݔty__�ad_�l +( +CMD_DISCONNECT +, & +�ck� +, & +�ݔt�s +); + +1709 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +1710 +p + = +�ݔt�s +; + +1712 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1713 if( +p +){ + +1714 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1715 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_SESSION_EXPIRY_INTERVAL +); + +1716 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +i32 +, 0x12450000); + +1718 +p + =�-> +�xt +; + +1719 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1720 if( +p +){ + +1721 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1722 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_REASON_STRING +); + +1723 + `CU_ASSERT_STRING_EQUAL +( +p +-> +v�ue +. +s +. +v +, "reason"); + +1724 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, + `��� +("reason")); + +1726 +p + =�-> +�xt +; + +1727 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1728 if( +p +){ + +1729 + `CU_ASSERT_PTR_NULL +( +p +-> +�xt +); + +1730 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_USER_PROPERTY +); + +1731 + `CU_ASSERT_STRING_EQUAL +( +p +-> +v�ue +. +s +. +v +, "value"); + +1732 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, + `��� +("value")); + +1733 + `CU_ASSERT_STRING_EQUAL +( +p +-> +�me +. +v +, "name"); + +1734 + `CU_ASSERT_EQUAL +( +p +-> +�me +. +�n +, + `��� +("name")); + +1739 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +1740 + } +} + +1742 + $TEST_�ck�_auth +() + +1744 +u�t8_t + +�yl�d +[] = {0, + +1745 +MQTT_PROP_AUTHENTICATION_METHOD +, 0x00, 0x04, 'n', 'o', 'n', 'e', + +1746 +MQTT_PROP_AUTHENTICATION_DATA +, 0x00, 0x02, 1, 2, + +1747 +MQTT_PROP_REASON_STRING +, 0, 6, 'r', 'e', 'a', 's', 'o', 'n', + +1748 +MQTT_PROP_USER_PROPERTY +, 0, 4, 'n', 'a', 'm', 'e', 0, 5, 'v', 'a', 'l', 'u', 'e'}; + +1750 +mosqu�to__�ck� + +�ck� +; + +1751 +mosqu�to_�ݔty + * +�ݔt�s +, * +p +; + +1752 +rc +; + +1754 +�yl�d +[0] = (payload)-1; + +1756 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +1757 +�ck� +. +�yl�d + =�ayload; + +1758 +�ck� +. +�ma��g_�ngth + = ( +�yl�d +);; + +1759 +rc + = + `�ݔty__�ad_�l +( +CMD_AUTH +, & +�ck� +, & +�ݔt�s +); + +1761 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +1762 +p + = +�ݔt�s +; + +1764 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1765 if( +p +){ + +1766 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1767 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_AUTHENTICATION_METHOD +); + +1768 + `CU_ASSERT_STRING_EQUAL +( +p +-> +v�ue +. +s +. +v +, "none"); + +1769 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, + `��� +("none")); + +1771 +p + =�-> +�xt +; + +1772 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1773 if( +p +){ + +1774 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1775 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_AUTHENTICATION_DATA +); + +1776 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +b� +. +v +[0], 1); + +1777 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +b� +. +v +[1], 2); + +1778 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, 2); + +1780 +p + =�-> +�xt +; + +1781 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1782 if( +p +){ + +1783 + `CU_ASSERT_PTR_NOT_NULL +( +p +-> +�xt +); + +1784 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_REASON_STRING +); + +1785 + `CU_ASSERT_STRING_EQUAL +( +p +-> +v�ue +. +s +. +v +, "reason"); + +1786 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, + `��� +("reason")); + +1788 +p + =�-> +�xt +; + +1789 + `CU_ASSERT_PTR_NOT_NULL +( +p +); + +1790 if( +p +){ + +1791 + `CU_ASSERT_PTR_NULL +( +p +-> +�xt +); + +1792 + `CU_ASSERT_EQUAL +( +p +-> +id�tif�r +, +MQTT_PROP_USER_PROPERTY +); + +1793 + `CU_ASSERT_STRING_EQUAL +( +p +-> +v�ue +. +s +. +v +, "value"); + +1794 + `CU_ASSERT_EQUAL +( +p +-> +v�ue +. +s +. +�n +, + `��� +("value")); + +1795 + `CU_ASSERT_STRING_EQUAL +( +p +-> +�me +. +v +, "name"); + +1796 + `CU_ASSERT_EQUAL +( +p +-> +�me +. +�n +, + `��� +("name")); + +1802 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +1803 + } +} + +1810 + $��_�ݔty_�ad_��s +() + +1812 +CU_pSu�e + +��_su�e + = +NULL +; + +1814 +��_su�e + = + `CU_add_su�e +("Prݔty��d", +NULL +, NULL); + +1815 if(! +��_su�e +){ + +1816 + `��tf +("Error�dding CUnit Property�ead�est suite.\n"); + +1821 || ! + `CU_add_�� +( +��_su�e +, "Trun��d�ack�", +TEST_�un��d +) + +1822 || ! + `CU_add_�� +( +��_su�e +, "Inv�id�rݔty ID", +TEST_�v�id_�ݔty_id +) + +1823 || ! + `CU_add_�� +( +��_su�e +, "Nشݔt�s", +TEST_no_�ݔt�s +) + +1824 || ! + `CU_add_�� +( +��_su�e +, "S�g� Payl�d F�m� Indi�t�", +TEST_s�g�_�yl�d_f�m�_�di�t� +) + +1825 || ! + `CU_add_�� +( +��_su�e +, "S�g� Reque� Prob�m Inf�m�i�", +TEST_s�g�_�que�_�ob�m_�f�m�i� +) + +1826 || ! + `CU_add_�� +( +��_su�e +, "S�g� Reque� Re�ڣ Inf�m�i�", +TEST_s�g�_�que�_��ڣ_�f�m�i� +) + +1827 || ! + `CU_add_�� +( +��_su�e +, "S�g� Maximum QoS", +TEST_s�g�_maximum_qos +) + +1828 || ! + `CU_add_�� +( +��_su�e +, "S�g� R�a� Ava�ab�", +TEST_s�g�_���_ava�ab� +) + +1829 || ! + `CU_add_�� +( +��_su�e +, "S�g� W�d�rd Subs��ti� Ava�ab�", +TEST_s�g�_w�d�rd_subs��ti�_ava�ab� +) + +1830 || ! + `CU_add_�� +( +��_su�e +, "S�g� Subs��ti� Id�tif��Ava�ab�", +TEST_s�g�_subs��ti�_id�tif�r_ava�ab� +) + +1831 || ! + `CU_add_�� +( +��_su�e +, "S�g� Sh�ed Subs��ti� Ava�ab�", +TEST_s�g�_sh�ed_subs��ti�_ava�ab� +) + +1832 || ! + `CU_add_�� +( +��_su�e +, "S�g� Mes�g�Exp�y I��v�", +TEST_s�g�_mes�ge_exp�y_��rv� +) + +1833 || ! + `CU_add_�� +( +��_su�e +, "S�g� Sessi� Exp�y I��v�", +TEST_s�g�_�ssi�_exp�y_��rv� +) + +1834 || ! + `CU_add_�� +( +��_su�e +, "S�g� W��D�ay I��v�", +TEST_s�g�_w�l_d�ay_��rv� +) + +1835 || ! + `CU_add_�� +( +��_su�e +, "S�g� Maximum Pack� Size", +TEST_s�g�_maximum_�ck�_size +) + +1836 || ! + `CU_add_�� +( +��_su�e +, "S�g� S�v� K��Alive", +TEST_s�g�_�rv�_k�p_�ive +) + +1837 || ! + `CU_add_�� +( +��_su�e +, "S�g� Re�iv�Maximum", +TEST_s�g�_��ive_maximum +) + +1838 || ! + `CU_add_�� +( +��_su�e +, "S�g� T�i�Al��Maximum", +TEST_s�g�_t�ic_��s_maximum +) + +1839 || ! + `CU_add_�� +( +��_su�e +, "S�g� T�i�Al�s", +TEST_s�g�_t�ic_��s +) + +1840 || ! + `CU_add_�� +( +��_su�e +, "S�g� Cڋ� Ty�", +TEST_s�g�_cڋ�_ty� +) + +1841 || ! + `CU_add_�� +( +��_su�e +, "S�g� Re�ڣ T�ic", +TEST_s�g�_��ڣ_t�ic +) + +1842 || ! + `CU_add_�� +( +��_su�e +, "S�g� Assig�d Cl�� Id�tif�r", +TEST_s�g�_assig�d_���_id�tif�r +) + +1843 || ! + `CU_add_�� +( +��_su�e +, "S�g� Auth�ti�ti� M�hod", +TEST_s�g�_auth�ti�ti�_m�hod +) + +1844 || ! + `CU_add_�� +( +��_su�e +, "S�g� Re�ڣ Inf�m�i�", +TEST_s�g�_��ڣ_�f�m�i� +) + +1845 || ! + `CU_add_�� +( +��_su�e +, "S�g� S�v� Re�n�", +TEST_s�g�_�rv�_��n� +) + +1846 || ! + `CU_add_�� +( +��_su�e +, "S�g� R�s� S��g", +TEST_s�g�_�as�_�r�g +) + +1847 || ! + `CU_add_�� +( +��_su�e +, "S�g� Cܻ�ti� D�a", +TEST_s�g�_cܻ�ti�_d�a +) + +1848 || ! + `CU_add_�� +( +��_su�e +, "S�g� Auth�ti�ti� D�a", +TEST_s�g�_auth�ti�ti�_d�a +) + +1849 || ! + `CU_add_�� +( +��_su�e +, "S�g� U��Prݔty", +TEST_s�g�_u�r_�ݔty +) + +1850 || ! + `CU_add_�� +( +��_su�e +, "S�g� Subs��ti� Id�tif�r", +TEST_s�g�_subs��ti�_id�tif�r +) + +1851 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� Payl�d F�m� Indi�t�", +TEST_du�i��_�yl�d_f�m�_�di�t� +) + +1852 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� Reque� Prob�m Inf�m�i�", +TEST_du�i��_�que�_�ob�m_�f�m�i� +) + +1853 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� Reque� Re�ڣ Inf�m�i�", +TEST_du�i��_�que�_��ڣ_�f�m�i� +) + +1854 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� Maximum QoS", +TEST_du�i��_maximum_qos +) + +1855 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� R�a� Ava�ab�", +TEST_du�i��_���_ava�ab� +) + +1856 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� W�d�rd Subs��ti� Ava�ab�", +TEST_du�i��_w�d�rd_subs��ti�_ava�ab� +) + +1857 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� Subs��ti� Id�tif��Ava�ab�", +TEST_du�i��_subs��ti�_id�tif�r_ava�ab� +) + +1858 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� Sh�ed Subs��ti� Ava�ab�", +TEST_du�i��_sh�ed_subs��ti�_ava�ab� +) + +1859 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� Mes�g�Exp�y I��v�", +TEST_du�i��_mes�ge_exp�y_��rv� +) + +1860 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� Sessi� Exp�y I��v�", +TEST_du�i��_�ssi�_exp�y_��rv� +) + +1861 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� W��D�ay I��v�", +TEST_du�i��_w�l_d�ay_��rv� +) + +1862 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� Maximum Pack� Size", +TEST_du�i��_maximum_�ck�_size +) + +1863 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� S�v� K��Alive", +TEST_du�i��_�rv�_k�p_�ive +) + +1864 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� Re�iv�Maximum", +TEST_du�i��_��ive_maximum +) + +1865 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� T�i�Al��Maximum", +TEST_du�i��_t�ic_��s_maximum +) + +1866 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� T�i�Al�s", +TEST_du�i��_t�ic_��s +) + +1867 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� Cڋ� Ty�", +TEST_du�i��_cڋ�_ty� +) + +1868 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� Re�ڣ T�ic", +TEST_du�i��_��ڣ_t�ic +) + +1869 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� Assig�d Cl�� ID", +TEST_du�i��_assig�d_���_id�tif�r +) + +1870 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� Auth�ti�ti� M�hod", +TEST_du�i��_auth�ti�ti�_m�hod +) + +1871 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� Re�ڣ Inf�m�i�", +TEST_du�i��_��ڣ_�f�m�i� +) + +1872 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� S�v� Re�n�", +TEST_du�i��_�rv�_��n� +) + +1873 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� R�s� S��g", +TEST_du�i��_�as�_�r�g +) + +1874 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� Cܻ�ti� D�a", +TEST_du�i��_cܻ�ti�_d�a +) + +1875 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� Auth�ti�ti� D�a", +TEST_du�i��_auth�ti�ti�_d�a +) + +1876 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� U��Prݔty", +TEST_du�i��_u�r_�ݔty +) + +1877 || ! + `CU_add_�� +( +��_su�e +, "Du�i�� Subs��ti� Id�tif�r", +TEST_du�i��_subs��ti�_id�tif�r +) + +1878 || ! + `CU_add_�� +( +��_su�e +, "Bad Reque� Prob�m Inf�m�i�", +TEST_bad_�que�_�ob�m_�f�m�i� +) + +1879 || ! + `CU_add_�� +( +��_su�e +, "Bad Reque� Re�ڣ Inf�m�i�", +TEST_bad_�que�_��ڣ_�f�m�i� +) + +1880 || ! + `CU_add_�� +( +��_su�e +, "Bad Maximum QoS", +TEST_bad_maximum_qos +) + +1881 || ! + `CU_add_�� +( +��_su�e +, "Bad R�a� Ava�ab�", +TEST_bad_���_ava�ab� +) + +1882 || ! + `CU_add_�� +( +��_su�e +, "Bad W�d�rd Subs��ti� Ava�ab�", +TEST_bad_w�d�rd_sub_ava�ab� +) + +1883 || ! + `CU_add_�� +( +��_su�e +, "Bad Subs��ti� Id�tif��Ava�ab�", +TEST_bad_subs��ti�_id_ava�ab� +) + +1884 || ! + `CU_add_�� +( +��_su�e +, "Bad Sh�ed Subs��ti� Ava�ab�", +TEST_bad_sh�ed_sub_ava�ab� +) + +1885 || ! + `CU_add_�� +( +��_su�e +, "Bad Maximum Pack� Size", +TEST_bad_maximum_�ck�_size +) + +1886 || ! + `CU_add_�� +( +��_su�e +, "Bad Re�iv�Maximum", +TEST_bad_��ive_maximum +) + +1887 || ! + `CU_add_�� +( +��_su�e +, "Bad T�i�Al�s", +TEST_bad_t�ic_��s +) + +1888 || ! + `CU_add_�� +( +��_su�e +, "Bad Cڋ� Ty�", +TEST_bad_cڋ�_ty� +) + +1889 || ! + `CU_add_�� +( +��_su�e +, "Bad Subs��ti� Id�tif�r", +TEST_bad_subs��ti�_id�tif�r +) + +1890 || ! + `CU_add_�� +( +��_su�e +, "Pack� CONNECT", +TEST_�ck�_c��� +) + +1891 || ! + `CU_add_�� +( +��_su�e +, "Pack� CONNACK", +TEST_�ck�_c��ck +) + +1892 || ! + `CU_add_�� +( +��_su�e +, "Pack� PUBLISH", +TEST_�ck�_publish +) + +1893 || ! + `CU_add_�� +( +��_su�e +, "Pack� PUBACK", +TEST_�ck�_puback +) + +1894 || ! + `CU_add_�� +( +��_su�e +, "Pack� PUBREC", +TEST_�ck�_pub�c +) + +1895 || ! + `CU_add_�� +( +��_su�e +, "Pack� PUBREL", +TEST_�ck�_pub�l +) + +1896 || ! + `CU_add_�� +( +��_su�e +, "Pack� PUBCOMP", +TEST_�ck�_pubcomp +) + +1897 || ! + `CU_add_�� +( +��_su�e +, "Pack� SUBSCRIBE", +TEST_�ck�_subs�ibe +) + +1898 || ! + `CU_add_�� +( +��_su�e +, "Pack� SUBACK", +TEST_�ck�_suback +) + +1899 || ! + `CU_add_�� +( +��_su�e +, "Pack� UNSUBSCRIBE", +TEST_�ck�_unsubs�ibe +) + +1900 || ! + `CU_add_�� +( +��_su�e +, "Pack� UNSUBACK", +TEST_�ck�_unsuback +) + +1901 || ! + `CU_add_�� +( +��_su�e +, "Pack� DISCONNECT", +TEST_�ck�_disc��� +) + +1902 || ! + `CU_add_�� +( +��_su�e +, "Pack� AUTH", +TEST_�ck�_auth +) + +1905 + `��tf +("Error�dding Property�ead CUnit�ests.\n"); + +1910 + } +} + + @test/unit/property_user_read.c + +1 + ~<CUn�/CUn�.h +> + +2 + ~<CUn�/Basic.h +> + +4 + ~"mq�_��oc�.h +" + +5 + ~"�ݔty_mosq.h +" + +6 + ~"�ck�_mosq.h +" + +8 + $g���e_fu�_��li� +( +mosqu�to_�ݔty + ** +��li� +) + +10 +rc +; + +14 +rc + = + `mosqu�to_�ݔty_add_by� +( +��li� +, +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +, 1); + +15 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +16 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +17 +rc + = + `mosqu�to_�ݔty_add_�t32 +( +��li� +, +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +, 3600); + +18 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +19 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +20 +rc + = + `mosqu�to_�ݔty_add_�r�g +( +��li� +, +MQTT_PROP_CONTENT_TYPE +, "application/json"); + +21 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +22 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +23 +rc + = + `mosqu�to_�ݔty_add_�r�g +( +��li� +, +MQTT_PROP_RESPONSE_TOPIC +, "response/topic"); + +24 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +25 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +26 +rc + = + `mosqu�to_�ݔty_add_b��y +( +��li� +, +MQTT_PROP_CORRELATION_DATA +, "cܻ�ti�-d�a", + `��� +("correlation-data")); + +27 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +28 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +29 +rc + = + `mosqu�to_�ݔty_add_v��t +( +��li� +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 63); + +30 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +31 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +32 +rc + = + `mosqu�to_�ݔty_add_�t32 +( +��li� +, +MQTT_PROP_SESSION_EXPIRY_INTERVAL +, 86400); + +33 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +34 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +35 +rc + = + `mosqu�to_�ݔty_add_�r�g +( +��li� +, +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +, "mosquitto-test"); + +36 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +37 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +38 +rc + = + `mosqu�to_�ݔty_add_�t16 +( +��li� +, +MQTT_PROP_SERVER_KEEP_ALIVE +, 180); + +39 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +40 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +41 +rc + = + `mosqu�to_�ݔty_add_�r�g +( +��li� +, +MQTT_PROP_AUTHENTICATION_METHOD +, "basic"); + +42 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +43 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +44 +rc + = + `mosqu�to_�ݔty_add_b��y +( +��li� +, +MQTT_PROP_AUTHENTICATION_DATA +, "�ssw�d", + `��� +("password")); + +45 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +46 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +47 +rc + = + `mosqu�to_�ݔty_add_by� +( +��li� +, +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +, 1); + +48 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +49 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +50 +rc + = + `mosqu�to_�ݔty_add_�t32 +( +��li� +, +MQTT_PROP_WILL_DELAY_INTERVAL +, 1800); + +51 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +52 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +53 +rc + = + `mosqu�to_�ݔty_add_by� +( +��li� +, +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +, 1); + +54 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +55 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +56 +rc + = + `mosqu�to_�ݔty_add_�r�g +( +��li� +, +MQTT_PROP_RESPONSE_INFORMATION +, "response"); + +57 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +58 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +59 +rc + = + `mosqu�to_�ݔty_add_�r�g +( +��li� +, +MQTT_PROP_SERVER_REFERENCE +, "localhost"); + +60 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +61 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +62 +rc + = + `mosqu�to_�ݔty_add_�r�g +( +��li� +, +MQTT_PROP_REASON_STRING +, "reason"); + +63 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +64 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +65 +rc + = + `mosqu�to_�ݔty_add_�t16 +( +��li� +, +MQTT_PROP_RECEIVE_MAXIMUM +, 1024); + +66 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +67 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +68 +rc + = + `mosqu�to_�ݔty_add_�t16 +( +��li� +, +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +, 64); + +69 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +70 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +71 +rc + = + `mosqu�to_�ݔty_add_�t16 +( +��li� +, +MQTT_PROP_TOPIC_ALIAS +, 15); + +72 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +73 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +74 +rc + = + `mosqu�to_�ݔty_add_by� +( +��li� +, +MQTT_PROP_MAXIMUM_QOS +, 0); + +75 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +76 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +77 +rc + = + `mosqu�to_�ݔty_add_by� +( +��li� +, +MQTT_PROP_RETAIN_AVAILABLE +, 0); + +78 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +79 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +80 +rc + = + `mosqu�to_�ݔty_add_�r�g_�� +( +��li� +, +MQTT_PROP_USER_PROPERTY +, "user-agent", "mosquitto/test"); + +81 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +82 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +83 +rc + = + `mosqu�to_�ݔty_add_�t32 +( +��li� +, +MQTT_PROP_MAXIMUM_PACKET_SIZE +, 200000000); + +84 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +85 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +86 +rc + = + `mosqu�to_�ݔty_add_by� +( +��li� +, +MQTT_PROP_WILDCARD_SUB_AVAILABLE +, 0); + +87 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +88 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +89 +rc + = + `mosqu�to_�ݔty_add_by� +( +��li� +, +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +, 0); + +90 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +91 if( +rc + !� +MOSQ_ERR_SUCCESS +) ; + +92 +rc + = + `mosqu�to_�ݔty_add_by� +( +��li� +, +MQTT_PROP_SHARED_SUB_AVAILABLE +, 0); + +93 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +94 + } +} + +96 + $g���e_���l_��li� +( +mosqu�to_�ݔty + ** +��li� +) + +98 +rc +; + +101 +rc + = + `mosqu�to_�ݔty_add_�t32 +( +��li� +, +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +, 3600); + +102 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +104 +rc + = + `mosqu�to_�ݔty_add_�r�g +( +��li� +, +MQTT_PROP_RESPONSE_TOPIC +, "response/topic"); + +105 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +109 +rc + = + `mosqu�to_�ݔty_add_�r�g +( +��li� +, +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +, "mosquitto-test"); + +110 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +112 +rc + = + `mosqu�to_�ݔty_add_�r�g +( +��li� +, +MQTT_PROP_AUTHENTICATION_METHOD +, "basic"); + +113 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +114 +rc + = + `mosqu�to_�ݔty_add_b��y +( +��li� +, +MQTT_PROP_AUTHENTICATION_DATA +, "�ssw�d", + `��� +("password")); + +115 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +116 +rc + = + `mosqu�to_�ݔty_add_by� +( +��li� +, +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +, 1); + +117 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +118 +rc + = + `mosqu�to_�ݔty_add_�t32 +( +��li� +, +MQTT_PROP_WILL_DELAY_INTERVAL +, 1800); + +119 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +120 +rc + = + `mosqu�to_�ݔty_add_by� +( +��li� +, +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +, 1); + +121 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +122 +rc + = + `mosqu�to_�ݔty_add_�r�g +( +��li� +, +MQTT_PROP_RESPONSE_INFORMATION +, "response"); + +123 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +124 +rc + = + `mosqu�to_�ݔty_add_�r�g +( +��li� +, +MQTT_PROP_SERVER_REFERENCE +, "localhost"); + +125 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +126 +rc + = + `mosqu�to_�ݔty_add_�r�g +( +��li� +, +MQTT_PROP_REASON_STRING +, "reason"); + +127 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +128 +rc + = + `mosqu�to_�ݔty_add_�t16 +( +��li� +, +MQTT_PROP_RECEIVE_MAXIMUM +, 1024); + +129 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +130 +rc + = + `mosqu�to_�ݔty_add_�t16 +( +��li� +, +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +, 64); + +131 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +132 +rc + = + `mosqu�to_�ݔty_add_�t16 +( +��li� +, +MQTT_PROP_TOPIC_ALIAS +, 15); + +133 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +134 +rc + = + `mosqu�to_�ݔty_add_by� +( +��li� +, +MQTT_PROP_MAXIMUM_QOS +, 0); + +135 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +136 +rc + = + `mosqu�to_�ݔty_add_by� +( +��li� +, +MQTT_PROP_RETAIN_AVAILABLE +, 0); + +137 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +139 +rc + = + `mosqu�to_�ݔty_add_�t32 +( +��li� +, +MQTT_PROP_MAXIMUM_PACKET_SIZE +, 200000000); + +140 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +141 +rc + = + `mosqu�to_�ݔty_add_by� +( +��li� +, +MQTT_PROP_WILDCARD_SUB_AVAILABLE +, 0); + +142 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +143 +rc + = + `mosqu�to_�ݔty_add_by� +( +��li� +, +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +, 0); + +144 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +145 +rc + = + `mosqu�to_�ݔty_add_by� +( +��li� +, +MQTT_PROP_SHARED_SUB_AVAILABLE +, 0); + +146 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +147 + } +} + +153 + $�ad_by�_h��r +(cڡ +mosqu�to_�ݔty + * +��li� +, +id�tif�r +, +u�t8_t + +ex��ed_v�ue +) + +155 cڡ +mosqu�to_�ݔty + * +�� +; + +156 +u�t8_t + +v�ue +; + +158 +�� + = + `mosqu�to_�ݔty_�ad_by� +( +��li� +, +id�tif�r +, & +v�ue +, +�l� +); + +159 + `CU_ASSERT_PTR_NOT_NULL +( +�� +); + +160 + `CU_ASSERT_EQUAL +( +v�ue +, +ex��ed_v�ue +); + +161 + } +} + +163 + $�ad_�t16_h��r +(cڡ +mosqu�to_�ݔty + * +��li� +, +id�tif�r +, +u�t16_t + +ex��ed_v�ue +) + +165 cڡ +mosqu�to_�ݔty + * +�� +; + +166 +u�t16_t + +v�ue +; + +168 +�� + = + `mosqu�to_�ݔty_�ad_�t16 +( +��li� +, +id�tif�r +, & +v�ue +, +�l� +); + +169 + `CU_ASSERT_PTR_NOT_NULL +( +�� +); + +170 + `CU_ASSERT_EQUAL +( +v�ue +, +ex��ed_v�ue +); + +171 + } +} + +173 + $�ad_�t32_h��r +(cڡ +mosqu�to_�ݔty + * +��li� +, +id�tif�r +, +u�t32_t + +ex��ed_v�ue +) + +175 cڡ +mosqu�to_�ݔty + * +�� +; + +176 +u�t32_t + +v�ue +; + +178 +�� + = + `mosqu�to_�ݔty_�ad_�t32 +( +��li� +, +id�tif�r +, & +v�ue +, +�l� +); + +179 + `CU_ASSERT_PTR_NOT_NULL +( +�� +); + +180 + `CU_ASSERT_EQUAL +( +v�ue +, +ex��ed_v�ue +); + +181 + } +} + +183 + $�ad_v��t_h��r +(cڡ +mosqu�to_�ݔty + * +��li� +, +id�tif�r +, +u�t32_t + +ex��ed_v�ue +) + +185 cڡ +mosqu�to_�ݔty + * +�� +; + +186 +u�t32_t + +v�ue +; + +188 +�� + = + `mosqu�to_�ݔty_�ad_v��t +( +��li� +, +id�tif�r +, & +v�ue +, +�l� +); + +189 + `CU_ASSERT_PTR_NOT_NULL +( +�� +); + +190 + `CU_ASSERT_EQUAL +( +v�ue +, +ex��ed_v�ue +); + +191 + } +} + +193 + $�ad_b��y_h��r +(cڡ +mosqu�to_�ݔty + * +��li� +, +id�tif�r +, * +ex��ed_v�ue +, +ex��ed_�ngth +) + +195 cڡ +mosqu�to_�ݔty + * +�� +; + +196 * +v�ue + = +NULL +; + +197 +u�t16_t + +�ngth +; + +199 +�� + = + `mosqu�to_�ݔty_�ad_b��y +( +��li� +, +id�tif�r +, & +v�ue +, & +�ngth +, +�l� +); + +200 + `CU_ASSERT_PTR_NOT_NULL +( +�� +); + +201 + `CU_ASSERT_EQUAL +( +�ngth +, +ex��ed_�ngth +); + +202 + `CU_ASSERT_PTR_NOT_NULL +( +v�ue +); + +203 if( +v�ue +){ + +204 + `CU_ASSERT_NSTRING_EQUAL +( +v�ue +, +ex��ed_v�ue +, +ex��ed_�ngth +); + +206 + `� +( +v�ue +); + +207 + } +} + +209 + $�ad_�r�g_h��r +(cڡ +mosqu�to_�ݔty + * +��li� +, +id�tif�r +, * +ex��ed_v�ue +) + +211 cڡ +mosqu�to_�ݔty + * +�� +; + +212 * +v�ue + = +NULL +; + +214 +�� + = + `mosqu�to_�ݔty_�ad_�r�g +( +��li� +, +id�tif�r +, & +v�ue +, +�l� +); + +215 + `CU_ASSERT_PTR_NOT_NULL +( +�� +); + +216 + `CU_ASSERT_PTR_NOT_NULL +( +v�ue +); + +217 if( +v�ue +){ + +218 + `CU_ASSERT_STRING_EQUAL +( +v�ue +, +ex��ed_v�ue +); + +220 + `� +( +v�ue +); + +221 + } +} + +223 + $�ad_�r�g_��_h��r +(cڡ +mosqu�to_�ݔty + * +��li� +, +id�tif�r +, * +ex��ed_key +, * +ex��ed_v�ue +) + +225 cڡ +mosqu�to_�ݔty + * +�� +; + +226 * +key + = +NULL +, * +v�ue + = NULL; + +228 +�� + = + `mosqu�to_�ݔty_�ad_�r�g_�� +( +��li� +, +id�tif�r +, & +key +, & +v�ue +, +�l� +); + +229 + `CU_ASSERT_PTR_NOT_NULL +( +�� +); + +231 + `CU_ASSERT_PTR_NOT_NULL +( +key +); + +232 if( +key +){ + +233 + `CU_ASSERT_STRING_EQUAL +( +key +, +ex��ed_key +); + +236 + `CU_ASSERT_PTR_NOT_NULL +( +v�ue +); + +237 if( +v�ue +){ + +238 + `CU_ASSERT_STRING_EQUAL +( +v�ue +, +ex��ed_v�ue +); + +240 + `� +( +key +); + +241 + `� +( +v�ue +); + +242 + } +} + +245 + $TEST_�ad_s�g�_by� +() + +247 +rc +; + +248 +mosqu�to_�ݔty + * +��li� + = +NULL +, * +��li�_c�y + = NULL; + +250 + `g���e_fu�_��li� +(& +��li� +); + +251 if(! +��li� +) ; + +253 + `�ad_by�_h��r +( +��li� +, +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +, 1); + +254 + `�ad_by�_h��r +( +��li� +, +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +, 1); + +255 + `�ad_by�_h��r +( +��li� +, +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +, 1); + +256 + `�ad_by�_h��r +( +��li� +, +MQTT_PROP_MAXIMUM_QOS +, 0); + +257 + `�ad_by�_h��r +( +��li� +, +MQTT_PROP_RETAIN_AVAILABLE +, 0); + +258 + `�ad_by�_h��r +( +��li� +, +MQTT_PROP_WILDCARD_SUB_AVAILABLE +, 0); + +259 + `�ad_by�_h��r +( +��li� +, +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +, 0); + +260 + `�ad_by�_h��r +( +��li� +, +MQTT_PROP_SHARED_SUB_AVAILABLE +, 0); + +262 +rc + = + `mosqu�to_�ݔty_c�y_�l +(& +��li�_c�y +, +��li� +); + +263 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +264 + `CU_ASSERT_PTR_NOT_NULL +( +��li�_c�y +); + +266 + `�ad_by�_h��r +( +��li�_c�y +, +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +, 1); + +267 + `�ad_by�_h��r +( +��li�_c�y +, +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +, 1); + +268 + `�ad_by�_h��r +( +��li�_c�y +, +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +, 1); + +269 + `�ad_by�_h��r +( +��li�_c�y +, +MQTT_PROP_MAXIMUM_QOS +, 0); + +270 + `�ad_by�_h��r +( +��li�_c�y +, +MQTT_PROP_RETAIN_AVAILABLE +, 0); + +271 + `�ad_by�_h��r +( +��li�_c�y +, +MQTT_PROP_WILDCARD_SUB_AVAILABLE +, 0); + +272 + `�ad_by�_h��r +( +��li�_c�y +, +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +, 0); + +273 + `�ad_by�_h��r +( +��li�_c�y +, +MQTT_PROP_SHARED_SUB_AVAILABLE +, 0); + +275 + `mosqu�to_�ݔty_�_�l +(& +��li� +); + +276 + `mosqu�to_�ݔty_�_�l +(& +��li�_c�y +); + +277 + } +} + +279 + $TEST_�ad_s�g�_�t16 +() + +281 +rc +; + +282 +mosqu�to_�ݔty + * +��li� + = +NULL +, * +��li�_c�y + = NULL; + +284 + `g���e_fu�_��li� +(& +��li� +); + +285 if(! +��li� +) ; + +287 + `�ad_�t16_h��r +( +��li� +, +MQTT_PROP_SERVER_KEEP_ALIVE +, 180); + +288 + `�ad_�t16_h��r +( +��li� +, +MQTT_PROP_RECEIVE_MAXIMUM +, 1024); + +289 + `�ad_�t16_h��r +( +��li� +, +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +, 64); + +290 + `�ad_�t16_h��r +( +��li� +, +MQTT_PROP_TOPIC_ALIAS +, 15); + +292 +rc + = + `mosqu�to_�ݔty_c�y_�l +(& +��li�_c�y +, +��li� +); + +293 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +294 + `CU_ASSERT_PTR_NOT_NULL +( +��li�_c�y +); + +296 + `�ad_�t16_h��r +( +��li�_c�y +, +MQTT_PROP_SERVER_KEEP_ALIVE +, 180); + +297 + `�ad_�t16_h��r +( +��li�_c�y +, +MQTT_PROP_RECEIVE_MAXIMUM +, 1024); + +298 + `�ad_�t16_h��r +( +��li�_c�y +, +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +, 64); + +299 + `�ad_�t16_h��r +( +��li�_c�y +, +MQTT_PROP_TOPIC_ALIAS +, 15); + +301 + `mosqu�to_�ݔty_�_�l +(& +��li� +); + +302 + `mosqu�to_�ݔty_�_�l +(& +��li�_c�y +); + +303 + } +} + +305 + $TEST_�ad_s�g�_�t32 +() + +307 +rc +; + +308 +mosqu�to_�ݔty + * +��li� + = +NULL +, * +��li�_c�y + = NULL; + +310 + `g���e_fu�_��li� +(& +��li� +); + +311 if(! +��li� +) ; + +313 + `�ad_�t32_h��r +( +��li� +, +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +, 3600); + +314 + `�ad_�t32_h��r +( +��li� +, +MQTT_PROP_SESSION_EXPIRY_INTERVAL +, 86400); + +315 + `�ad_�t32_h��r +( +��li� +, +MQTT_PROP_WILL_DELAY_INTERVAL +, 1800); + +316 + `�ad_�t32_h��r +( +��li� +, +MQTT_PROP_MAXIMUM_PACKET_SIZE +, 200000000); + +318 +rc + = + `mosqu�to_�ݔty_c�y_�l +(& +��li�_c�y +, +��li� +); + +319 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +320 + `CU_ASSERT_PTR_NOT_NULL +( +��li�_c�y +); + +322 + `�ad_�t32_h��r +( +��li�_c�y +, +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +, 3600); + +323 + `�ad_�t32_h��r +( +��li�_c�y +, +MQTT_PROP_SESSION_EXPIRY_INTERVAL +, 86400); + +324 + `�ad_�t32_h��r +( +��li�_c�y +, +MQTT_PROP_WILL_DELAY_INTERVAL +, 1800); + +325 + `�ad_�t32_h��r +( +��li�_c�y +, +MQTT_PROP_MAXIMUM_PACKET_SIZE +, 200000000); + +327 + `mosqu�to_�ݔty_�_�l +(& +��li� +); + +328 + `mosqu�to_�ݔty_�_�l +(& +��li�_c�y +); + +329 + } +} + +331 + $TEST_�ad_s�g�_v��t +() + +333 +rc +; + +334 +mosqu�to_�ݔty + * +��li� + = +NULL +, * +��li�_c�y + = NULL; + +336 + `g���e_fu�_��li� +(& +��li� +); + +337 if(! +��li� +) ; + +339 + `�ad_v��t_h��r +( +��li� +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 63); + +341 +rc + = + `mosqu�to_�ݔty_c�y_�l +(& +��li�_c�y +, +��li� +); + +342 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +343 + `CU_ASSERT_PTR_NOT_NULL +( +��li�_c�y +); + +345 + `�ad_v��t_h��r +( +��li�_c�y +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 63); + +347 + `mosqu�to_�ݔty_�_�l +(& +��li� +); + +348 + `mosqu�to_�ݔty_�_�l +(& +��li�_c�y +); + +349 + } +} + +351 + $TEST_�ad_s�g�_b��y +() + +353 +rc +; + +354 +mosqu�to_�ݔty + * +��li� + = +NULL +, * +��li�_c�y + = NULL; + +356 + `g���e_fu�_��li� +(& +��li� +); + +357 if(! +��li� +) ; + +359 + `�ad_b��y_h��r +( +��li� +, +MQTT_PROP_CORRELATION_DATA +, "cܻ�ti�-d�a", + `��� +("correlation-data")); + +360 + `�ad_b��y_h��r +( +��li� +, +MQTT_PROP_AUTHENTICATION_DATA +, "�ssw�d", + `��� +("password")); + +362 +rc + = + `mosqu�to_�ݔty_c�y_�l +(& +��li�_c�y +, +��li� +); + +363 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +364 + `CU_ASSERT_PTR_NOT_NULL +( +��li�_c�y +); + +366 if( +��li�_c�y +){ + +367 + `�ad_b��y_h��r +( +��li�_c�y +, +MQTT_PROP_CORRELATION_DATA +, "cܻ�ti�-d�a", + `��� +("correlation-data")); + +368 + `�ad_b��y_h��r +( +��li�_c�y +, +MQTT_PROP_AUTHENTICATION_DATA +, "�ssw�d", + `��� +("password")); + +371 + `mosqu�to_�ݔty_�_�l +(& +��li� +); + +372 + `mosqu�to_�ݔty_�_�l +(& +��li�_c�y +); + +373 + } +} + +375 + $TEST_�ad_s�g�_�r�g +() + +377 +rc +; + +378 +mosqu�to_�ݔty + * +��li� + = +NULL +, * +��li�_c�y + = NULL; + +380 + `g���e_fu�_��li� +(& +��li� +); + +381 if(! +��li� +) ; + +383 + `�ad_�r�g_h��r +( +��li� +, +MQTT_PROP_CONTENT_TYPE +, "application/json"); + +384 + `�ad_�r�g_h��r +( +��li� +, +MQTT_PROP_RESPONSE_TOPIC +, "response/topic"); + +385 + `�ad_�r�g_h��r +( +��li� +, +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +, "mosquitto-test"); + +386 + `�ad_�r�g_h��r +( +��li� +, +MQTT_PROP_AUTHENTICATION_METHOD +, "basic"); + +387 + `�ad_�r�g_h��r +( +��li� +, +MQTT_PROP_RESPONSE_INFORMATION +, "response"); + +388 + `�ad_�r�g_h��r +( +��li� +, +MQTT_PROP_SERVER_REFERENCE +, "localhost"); + +389 + `�ad_�r�g_h��r +( +��li� +, +MQTT_PROP_REASON_STRING +, "reason"); + +391 +rc + = + `mosqu�to_�ݔty_c�y_�l +(& +��li�_c�y +, +��li� +); + +392 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +393 + `CU_ASSERT_PTR_NOT_NULL +( +��li�_c�y +); + +395 if( +��li�_c�y +){ + +396 + `�ad_�r�g_h��r +( +��li�_c�y +, +MQTT_PROP_CONTENT_TYPE +, "application/json"); + +397 + `�ad_�r�g_h��r +( +��li�_c�y +, +MQTT_PROP_RESPONSE_TOPIC +, "response/topic"); + +398 + `�ad_�r�g_h��r +( +��li�_c�y +, +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +, "mosquitto-test"); + +399 + `�ad_�r�g_h��r +( +��li�_c�y +, +MQTT_PROP_AUTHENTICATION_METHOD +, "basic"); + +400 + `�ad_�r�g_h��r +( +��li�_c�y +, +MQTT_PROP_RESPONSE_INFORMATION +, "response"); + +401 + `�ad_�r�g_h��r +( +��li�_c�y +, +MQTT_PROP_SERVER_REFERENCE +, "localhost"); + +402 + `�ad_�r�g_h��r +( +��li�_c�y +, +MQTT_PROP_REASON_STRING +, "reason"); + +405 + `mosqu�to_�ݔty_�_�l +(& +��li� +); + +406 + `mosqu�to_�ݔty_�_�l +(& +��li�_c�y +); + +407 + } +} + +409 + $TEST_�ad_s�g�_�r�g_�� +() + +411 +rc +; + +412 +mosqu�to_�ݔty + * +��li� + = +NULL +, * +��li�_c�y + = NULL; + +414 + `g���e_fu�_��li� +(& +��li� +); + +415 if(! +��li� +) ; + +417 + `�ad_�r�g_��_h��r +( +��li� +, +MQTT_PROP_USER_PROPERTY +, "user-agent", "mosquitto/test"); + +419 +rc + = + `mosqu�to_�ݔty_c�y_�l +(& +��li�_c�y +, +��li� +); + +420 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +421 + `CU_ASSERT_PTR_NOT_NULL +( +��li�_c�y +); + +423 if( +��li�_c�y +){ + +424 + `�ad_�r�g_��_h��r +( +��li�_c�y +, +MQTT_PROP_USER_PROPERTY +, "user-agent", "mosquitto/test"); + +427 + `mosqu�to_�ݔty_�_�l +(& +��li� +); + +428 + `mosqu�to_�ݔty_�_�l +(& +��li�_c�y +); + +429 + } +} + +435 + $miss�g_�ad_h��r +( +mosqu�to_�ݔty + * +��li� +) + +437 cڡ +mosqu�to_�ݔty + * +�� +; + +438 +u�t8_t + +by�_v�ue +; + +439 +u�t16_t + +�t16_v�ue +; + +440 +u�t32_t + +�t32_v�ue +; + +441 * +key +, * +v�ue +; + +442 +u�t16_t + +�ngth +; + +445 +�� + = + `mosqu�to_�ݔty_�ad_by� +( +��li� +, +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +, & +by�_v�ue +, +�l� +); + +446 + `CU_ASSERT_PTR_NULL +( +�� +); + +449 +�� + = + `mosqu�to_�ݔty_�ad_�t32 +( +��li� +, +MQTT_PROP_WILL_DELAY_INTERVAL +, & +�t32_v�ue +, +�l� +); + +450 + `CU_ASSERT_PTR_NOT_NULL +( +�� +); + +451 + `CU_ASSERT_EQUAL +( +�t32_v�ue +, 1800); + +454 +�� + = + `mosqu�to_�ݔty_�ad_�r�g +( +��li� +, +MQTT_PROP_CONTENT_TYPE +, & +v�ue +, +�l� +); + +455 + `CU_ASSERT_PTR_NULL +( +�� +); + +458 +�� + = + `mosqu�to_�ݔty_�ad_�r�g +( +��li� +, +MQTT_PROP_RESPONSE_TOPIC +, & +v�ue +, +�l� +); + +459 + `CU_ASSERT_PTR_NOT_NULL +( +�� +); + +460 + `CU_ASSERT_STRING_EQUAL +( +v�ue +, "response/topic"); + +461 + `� +( +v�ue +); + +464 +�� + = + `mosqu�to_�ݔty_�ad_b��y +( +��li� +, +MQTT_PROP_CORRELATION_DATA +, (**)& +v�ue +, & +�ngth +, +�l� +); + +465 + `CU_ASSERT_PTR_NULL +( +�� +); + +468 +�� + = + `mosqu�to_�ݔty_�ad_by� +( +��li� +, +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +, & +by�_v�ue +, +�l� +); + +469 + `CU_ASSERT_PTR_NOT_NULL +( +�� +); + +470 + `CU_ASSERT_EQUAL +( +by�_v�ue +, 1); + +473 +�� + = + `mosqu�to_�ݔty_�ad_v��t +( +��li� +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, & +�t32_v�ue +, +�l� +); + +474 + `CU_ASSERT_PTR_NULL +( +�� +); + +477 +�� + = + `mosqu�to_�ݔty_�ad_�r�g +( +��li� +, +MQTT_PROP_SERVER_REFERENCE +, & +v�ue +, +�l� +); + +478 + `CU_ASSERT_PTR_NOT_NULL +( +�� +); + +479 + `CU_ASSERT_STRING_EQUAL +( +v�ue +, "localhost"); + +480 + `� +( +v�ue +); + +483 +�� + = + `mosqu�to_�ݔty_�ad_�t32 +( +��li� +, +MQTT_PROP_SESSION_EXPIRY_INTERVAL +, & +�t32_v�ue +, +�l� +); + +484 + `CU_ASSERT_PTR_NULL +( +�� +); + +487 +�� + = + `mosqu�to_�ݔty_�ad_b��y +( +��li� +, +MQTT_PROP_AUTHENTICATION_DATA +, (**)& +v�ue +, & +�ngth +, +�l� +); + +488 + `CU_ASSERT_PTR_NOT_NULL +( +�� +); + +489 + `CU_ASSERT_NSTRING_EQUAL +( +v�ue +, "�ssw�d", + `��� +("password")); + +490 + `CU_ASSERT_EQUAL +( +�ngth +, + `��� +("password")); + +491 + `� +( +v�ue +); + +494 +�� + = + `mosqu�to_�ݔty_�ad_�t16 +( +��li� +, +MQTT_PROP_SERVER_KEEP_ALIVE +, & +�t16_v�ue +, +�l� +); + +495 + `CU_ASSERT_PTR_NULL +( +�� +); + +498 +�� + = + `mosqu�to_�ݔty_�ad_�t16 +( +��li� +, +MQTT_PROP_RECEIVE_MAXIMUM +, & +�t16_v�ue +, +�l� +); + +499 + `CU_ASSERT_PTR_NOT_NULL +( +�� +); + +500 + `CU_ASSERT_EQUAL +( +�t16_v�ue +, 1024); + +503 +�� + = + `mosqu�to_�ݔty_�ad_�r�g_�� +( +��li� +, +MQTT_PROP_USER_PROPERTY +, & +key +, & +v�ue +, +�l� +); + +504 + `CU_ASSERT_PTR_NULL +( +�� +); + +505 + } +} + +508 + $TEST_�ad_miss�g +() + +510 +mosqu�to_�ݔty + * +��li� + = +NULL +, * +��li�_c�y + = NULL; + +511 +rc +; + +513 + `g���e_���l_��li� +(& +��li� +); + +514 if(! +��li� +) ; + +516 + `miss�g_�ad_h��r +( +��li� +); + +517 +rc + = + `mosqu�to_�ݔty_c�y_�l +(& +��li�_c�y +, +��li� +); + +518 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +519 + `CU_ASSERT_PTR_NOT_NULL +( +��li�_c�y +); + +520 if( +��li�_c�y +){ + +521 + `miss�g_�ad_h��r +( +��li�_c�y +); + +524 + `mosqu�to_�ݔty_�_�l +(& +��li� +); + +525 + `mosqu�to_�ݔty_�_�l +(& +��li�_c�y +); + +526 + } +} + +532 + $�r�g_to_�ݔty_�fo_h��r +(cڡ * +�r +, +rc_ex��ed +, +id�tif�r_ex��ed +, +ty�_ex��ed +) + +534 +rc +; + +535 +id�tif�r +, +ty� +; + +537 +rc + = + `mosqu�to_�r�g_to_�ݔty_�fo +( +�r +, & +id�tif�r +, & +ty� +); + +538 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +539 if( +rc + =� +MOSQ_ERR_SUCCESS +){ + +540 + `CU_ASSERT_EQUAL +( +id�tif�r +, +id�tif�r_ex��ed +); + +541 + `CU_ASSERT_EQUAL +( +ty� +, +ty�_ex��ed +); + +543 + } +} + +545 + $TEST_�r�g_to_�ݔty_�fo +() + +547 + `�r�g_to_�ݔty_�fo_h��r +("�yl�d-f�m�-�di�t�", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +, +MQTT_PROP_TYPE_BYTE +); + +548 + `�r�g_to_�ݔty_�fo_h��r +("mes�ge-exp�y-��rv�", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +, +MQTT_PROP_TYPE_INT32 +); + +549 + `�r�g_to_�ݔty_�fo_h��r +("cڋ�-ty�", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_CONTENT_TYPE +, +MQTT_PROP_TYPE_STRING +); + +550 + `�r�g_to_�ݔty_�fo_h��r +("��ڣ-t�ic", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_RESPONSE_TOPIC +, +MQTT_PROP_TYPE_STRING +); + +551 + `�r�g_to_�ݔty_�fo_h��r +("cܻ�ti�-d�a", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_CORRELATION_DATA +, +MQTT_PROP_TYPE_BINARY +); + +552 + `�r�g_to_�ݔty_�fo_h��r +("subs��ti�-id�tif�r", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, +MQTT_PROP_TYPE_VARINT +); + +553 + `�r�g_to_�ݔty_�fo_h��r +("�ssi�-exp�y-��rv�", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SESSION_EXPIRY_INTERVAL +, +MQTT_PROP_TYPE_INT32 +); + +554 + `�r�g_to_�ݔty_�fo_h��r +("assig�d-���-id�tif�r", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +, +MQTT_PROP_TYPE_STRING +); + +555 + `�r�g_to_�ݔty_�fo_h��r +("�rv�-k�p-�ive", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SERVER_KEEP_ALIVE +, +MQTT_PROP_TYPE_INT16 +); + +556 + `�r�g_to_�ݔty_�fo_h��r +("auth�ti�ti�-m�hod", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_AUTHENTICATION_METHOD +, +MQTT_PROP_TYPE_STRING +); + +557 + `�r�g_to_�ݔty_�fo_h��r +("auth�ti�ti�-d�a", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_AUTHENTICATION_DATA +, +MQTT_PROP_TYPE_BINARY +); + +558 + `�r�g_to_�ݔty_�fo_h��r +("�que�-�ob�m-�f�m�i�", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +, +MQTT_PROP_TYPE_BYTE +); + +559 + `�r�g_to_�ݔty_�fo_h��r +("w�l-d�ay-��rv�", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_WILL_DELAY_INTERVAL +, +MQTT_PROP_TYPE_INT32 +); + +560 + `�r�g_to_�ݔty_�fo_h��r +("�que�-��ڣ-�f�m�i�", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +, +MQTT_PROP_TYPE_BYTE +); + +561 + `�r�g_to_�ݔty_�fo_h��r +("��ڣ-�f�m�i�", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_RESPONSE_INFORMATION +, +MQTT_PROP_TYPE_STRING +); + +562 + `�r�g_to_�ݔty_�fo_h��r +("�rv�-��n�", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SERVER_REFERENCE +, +MQTT_PROP_TYPE_STRING +); + +563 + `�r�g_to_�ݔty_�fo_h��r +("�as�-�r�g", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_REASON_STRING +, +MQTT_PROP_TYPE_STRING +); + +564 + `�r�g_to_�ݔty_�fo_h��r +("��ive-maximum", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_RECEIVE_MAXIMUM +, +MQTT_PROP_TYPE_INT16 +); + +565 + `�r�g_to_�ݔty_�fo_h��r +("t�ic-��s-maximum", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +, +MQTT_PROP_TYPE_INT16 +); + +566 + `�r�g_to_�ݔty_�fo_h��r +("t�ic-��s", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_TOPIC_ALIAS +, +MQTT_PROP_TYPE_INT16 +); + +567 + `�r�g_to_�ݔty_�fo_h��r +("maximum-qos", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_MAXIMUM_QOS +, +MQTT_PROP_TYPE_BYTE +); + +568 + `�r�g_to_�ݔty_�fo_h��r +("���-ava�ab�", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_RETAIN_AVAILABLE +, +MQTT_PROP_TYPE_BYTE +); + +569 + `�r�g_to_�ݔty_�fo_h��r +("u�r-�ݔty", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_USER_PROPERTY +, +MQTT_PROP_TYPE_STRING_PAIR +); + +570 + `�r�g_to_�ݔty_�fo_h��r +("maximum-�ck�-size", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_MAXIMUM_PACKET_SIZE +, +MQTT_PROP_TYPE_INT32 +); + +571 + `�r�g_to_�ݔty_�fo_h��r +("w�d�rd-subs��ti�-ava�ab�", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_WILDCARD_SUB_AVAILABLE +, +MQTT_PROP_TYPE_BYTE +); + +572 + `�r�g_to_�ݔty_�fo_h��r +("subs��ti�-id�tif�r-ava�ab�", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +, +MQTT_PROP_TYPE_BYTE +); + +573 + `�r�g_to_�ݔty_�fo_h��r +("sh�ed-subs��ti�-ava�ab�", +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SHARED_SUB_AVAILABLE +, +MQTT_PROP_TYPE_BYTE +); + +575 + `�r�g_to_�ݔty_�fo_h��r +("�yl�d-f�m�-�di�t�1", +MOSQ_ERR_INVAL +, 0, 0); + +576 + `�r�g_to_�ݔty_�fo_h��r +("�yl�d", +MOSQ_ERR_INVAL +, 0, 0); + +577 + `�r�g_to_�ݔty_�fo_h��r +("", +MOSQ_ERR_INVAL +, 0, 0); + +578 + `�r�g_to_�ݔty_�fo_h��r +( +NULL +, +MOSQ_ERR_INVAL +, 0, 0); + +579 + } +} + +586 + $��_�ݔty_u�r_�ad_��s +() + +588 +CU_pSu�e + +��_su�e + = +NULL +; + +590 +��_su�e + = + `CU_add_su�e +("Prݔty u���ad", +NULL +, NULL); + +591 if(! +��_su�e +){ + +592 + `��tf +("Error�dding CUnit Property user�ead�est suite.\n"); + +597 || ! + `CU_add_�� +( +��_su�e +, "R�d s�g� by�", +TEST_�ad_s�g�_by� +) + +598 || ! + `CU_add_�� +( +��_su�e +, "R�d s�g� i�16", +TEST_�ad_s�g�_�t16 +) + +599 || ! + `CU_add_�� +( +��_su�e +, "R�d s�g� i�32", +TEST_�ad_s�g�_�t32 +) + +600 || ! + `CU_add_�� +( +��_su�e +, "R�d s�g� v��t", +TEST_�ad_s�g�_v��t +) + +601 || ! + `CU_add_�� +( +��_su�e +, "R�d s�g� b��y", +TEST_�ad_s�g�_b��y +) + +602 || ! + `CU_add_�� +( +��_su�e +, "R�d s�g� s��g", +TEST_�ad_s�g�_�r�g +) + +603 || ! + `CU_add_�� +( +��_su�e +, "R�d s�g� s��g�a�", +TEST_�ad_s�g�_�r�g_�� +) + +604 || ! + `CU_add_�� +( +��_su�e +, "R�d miss�g", +TEST_�ad_miss�g +) + +605 || ! + `CU_add_�� +( +��_su�e +, "S��g�شݔty info", +TEST_�r�g_to_�ݔty_�fo +) + +608 + `��tf +("Error�dding Property Add CUnit�ests.\n"); + +613 + } +} + + @test/unit/property_write.c + +1 + ~<CUn�/CUn�.h +> + +2 + ~<CUn�/Basic.h +> + +4 + ~"mq�_��oc�.h +" + +5 + ~"�ݔty_mosq.h +" + +6 + ~"�ck�_mosq.h +" + +8 + $by�_��_wr�e_h��r +( + +9 +comm�d +, + +10 +�ma��g_�ngth +, + +11 +rc_ex��ed +, + +12 +id�tif�r +, + +13 +u�t8_t + +v�ue_ex��ed +) + +15 +mosqu�to_�ݔty + +�ݔty +; + +16 +mosqu�to__�ck� + +�ck� +; + +17 +mosqu�to_�ݔty + * +�ݔt�s +; + +18 +rc +; + +20 + `mem�t +(& +�ݔty +, 0, ( +mosqu�to_�ݔty +)); + +22 +�ݔty +. +id�tif�r + = identifier; + +23 +�ݔty +. +v�ue +. +i8 + = +v�ue_ex��ed +; + +25 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +26 +�ck� +. +�ma��g_�ngth + = + `�ݔty__g�_�ngth_�l +(& +�ݔty +)+1; + +27 +�ck� +. +�ck�_�ngth + =�ack�. +�ma��g_�ngth ++10; + +28 +�ck� +. +�yl�d + = + `��oc +�ack�. +�ma��g_�ngth ++10, 1); + +30 + `CU_ASSERT_PTR_NOT_NULL +( +�ck� +. +�yl�d +); + +31 if(! +�ck� +. +�yl�d +) ; + +33 + `�ݔty__wr�e_�l +(& +�ck� +, & +�ݔty +, +�ue +); + +34 +�ck� +. +pos + = 0; + +36 +rc + = + `�ݔty__�ad_�l +( +comm�d +, & +�ck� +, & +�ݔt�s +); + +38 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +39 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, +�ma��g_�ngth +); + +40 if( +�ݔt�s +){ + +41 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +id�tif�r +, identifier); + +42 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +v�ue +. +i8 +, +v�ue_ex��ed +); + +43 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +-> +�xt +, +NULL +); + +44 + `CU_ASSERT_EQUAL +( + `�ݔty__g�_�ngth_�l +( +�ݔt�s +), 2); + +45 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +47 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +, +NULL +); + +48 + `� +( +�ck� +. +�yl�d +); + +49 + } +} + +52 + $�t32_��_wr�e_h��r +( + +53 +comm�d +, + +54 +�ma��g_�ngth +, + +55 +rc_ex��ed +, + +56 +id�tif�r +, + +57 +u�t32_t + +v�ue_ex��ed +) + +59 +mosqu�to_�ݔty + +�ݔty +; + +60 +mosqu�to__�ck� + +�ck� +; + +61 +mosqu�to_�ݔty + * +�ݔt�s +; + +62 +rc +; + +64 + `mem�t +(& +�ݔty +, 0, ( +mosqu�to_�ݔty +)); + +66 +�ݔty +. +id�tif�r + = identifier; + +67 +�ݔty +. +v�ue +. +i32 + = +v�ue_ex��ed +; + +69 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +70 +�ck� +. +�ma��g_�ngth + = + `�ݔty__g�_�ngth_�l +(& +�ݔty +)+1; + +71 +�ck� +. +�ck�_�ngth + =�ack�. +�ma��g_�ngth ++10; + +72 +�ck� +. +�yl�d + = + `��oc +�ack�. +�ma��g_�ngth ++10, 1); + +74 + `CU_ASSERT_PTR_NOT_NULL +( +�ck� +. +�yl�d +); + +75 if(! +�ck� +. +�yl�d +) ; + +77 + `�ݔty__wr�e_�l +(& +�ck� +, & +�ݔty +, +�ue +); + +78 +�ck� +. +pos + = 0; + +80 +rc + = + `�ݔty__�ad_�l +( +comm�d +, & +�ck� +, & +�ݔt�s +); + +82 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +83 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, +�ma��g_�ngth +); + +84 if( +�ݔt�s +){ + +85 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +id�tif�r +, identifier); + +86 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +v�ue +. +i32 +, +v�ue_ex��ed +); + +87 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +-> +�xt +, +NULL +); + +88 + `CU_ASSERT_EQUAL +( + `�ݔty__g�_�ngth_�l +( +�ݔt�s +), 5); + +89 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +91 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +, +NULL +); + +92 + `� +( +�ck� +. +�yl�d +); + +93 + } +} + +96 + $�t16_��_wr�e_h��r +( + +97 +comm�d +, + +98 +�ma��g_�ngth +, + +99 +rc_ex��ed +, + +100 +id�tif�r +, + +101 +u�t16_t + +v�ue_ex��ed +) + +103 +mosqu�to_�ݔty + +�ݔty +; + +104 +mosqu�to__�ck� + +�ck� +; + +105 +mosqu�to_�ݔty + * +�ݔt�s +; + +106 +rc +; + +108 + `mem�t +(& +�ݔty +, 0, ( +mosqu�to_�ݔty +)); + +110 +�ݔty +. +id�tif�r + = identifier; + +111 +�ݔty +. +v�ue +. +i16 + = +v�ue_ex��ed +; + +113 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +114 +�ck� +. +�ma��g_�ngth + = + `�ݔty__g�_�ngth_�l +(& +�ݔty +)+1; + +115 +�ck� +. +�ck�_�ngth + =�ack�. +�ma��g_�ngth ++10; + +116 +�ck� +. +�yl�d + = + `��oc +�ack�. +�ma��g_�ngth ++10, 1); + +118 + `CU_ASSERT_PTR_NOT_NULL +( +�ck� +. +�yl�d +); + +119 if(! +�ck� +. +�yl�d +) ; + +121 + `�ݔty__wr�e_�l +(& +�ck� +, & +�ݔty +, +�ue +); + +122 +�ck� +. +pos + = 0; + +124 +rc + = + `�ݔty__�ad_�l +( +comm�d +, & +�ck� +, & +�ݔt�s +); + +126 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +127 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, +�ma��g_�ngth +); + +128 if( +�ݔt�s +){ + +129 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +id�tif�r +, identifier); + +130 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +v�ue +. +i16 +, +v�ue_ex��ed +); + +131 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +-> +�xt +, +NULL +); + +132 + `CU_ASSERT_EQUAL +( + `�ݔty__g�_�ngth_�l +( +�ݔt�s +), 3); + +133 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +135 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +, +NULL +); + +136 + `� +( +�ck� +. +�yl�d +); + +137 + } +} + +139 + $�r�g_��_wr�e_h��r +( + +140 +comm�d +, + +141 +�ma��g_�ngth +, + +142 +rc_ex��ed +, + +143 +id�tif�r +, + +144 cڡ * +v�ue_ex��ed +) + +146 +mosqu�to_�ݔty + +�ݔty +; + +147 +mosqu�to__�ck� + +�ck� +; + +148 +mosqu�to_�ݔty + * +�ݔt�s +; + +149 +rc +; + +151 + `mem�t +(& +�ݔty +, 0, ( +mosqu�to_�ݔty +)); + +153 +�ݔty +. +id�tif�r + = identifier; + +154 +�ݔty +. +v�ue +. +s +. +v + = + `�rdup +( +v�ue_ex��ed +); + +155 + `CU_ASSERT_PTR_NOT_NULL +( +�ݔty +. +v�ue +. +s +. +v +); + +156 if(! +�ݔty +. +v�ue +. +s +. +v +) ; + +158 +�ݔty +. +v�ue +. +s +. +�n + = + `��� +( +v�ue_ex��ed +); + +160 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +161 +�ck� +. +�ma��g_�ngth + = + `�ݔty__g�_�ngth_�l +(& +�ݔty +)+1; + +162 +�ck� +. +�ck�_�ngth + =�ack�. +�ma��g_�ngth ++10; + +163 +�ck� +. +�yl�d + = + `��oc +�ack�. +�ma��g_�ngth ++10, 1); + +165 + `CU_ASSERT_PTR_NOT_NULL +( +�ck� +. +�yl�d +); + +166 if(! +�ck� +. +�yl�d +) ; + +168 + `�ݔty__wr�e_�l +(& +�ck� +, & +�ݔty +, +�ue +); + +169 +�ck� +. +pos + = 0; + +171 +rc + = + `�ݔty__�ad_�l +( +comm�d +, & +�ck� +, & +�ݔt�s +); + +173 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +174 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, +�ma��g_�ngth +); + +175 if( +�ݔt�s +){ + +176 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +id�tif�r +, identifier); + +177 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +v�ue +. +s +. +�n +, + `��� +( +v�ue_ex��ed +)); + +178 + `CU_ASSERT_STRING_EQUAL +( +�ݔt�s +-> +v�ue +. +s +. +v +, +v�ue_ex��ed +); + +179 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +-> +�xt +, +NULL +); + +180 + `CU_ASSERT_EQUAL +( + `�ݔty__g�_�ngth_�l +( +�ݔt�s +), 1+2+ + `��� +( +v�ue_ex��ed +)); + +181 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +183 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +, +NULL +); + +184 + `� +( +�ݔty +. +v�ue +. +s +. +v +); + +185 + `� +( +�ck� +. +�yl�d +); + +186 + } +} + +189 + $b��y_��_wr�e_h��r +( + +190 +comm�d +, + +191 +�ma��g_�ngth +, + +192 +rc_ex��ed +, + +193 +id�tif�r +, + +194 cڡ +u�t8_t + * +v�ue_ex��ed +, + +195 +�n_ex��ed +) + +197 +mosqu�to_�ݔty + +�ݔty +; + +198 +mosqu�to__�ck� + +�ck� +; + +199 +mosqu�to_�ݔty + * +�ݔt�s +; + +200 +rc +; + +202 + `mem�t +(& +�ݔty +, 0, ( +mosqu�to_�ݔty +)); + +204 +�ݔty +. +id�tif�r + = identifier; + +205 +�ݔty +. +v�ue +. +b� +. +v + = + `m�loc +( +�n_ex��ed +); + +206 + `CU_ASSERT_PTR_NOT_NULL +( +�ݔty +. +v�ue +. +b� +. +v +); + +207 if(! +�ݔty +. +v�ue +. +b� +. +v +) ; + +209 + `mem�y +( +�ݔty +. +v�ue +. +b� +. +v +, +v�ue_ex��ed +, +�n_ex��ed +); + +210 +�ݔty +. +v�ue +. +b� +. +�n + = +�n_ex��ed +; + +212 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +213 +�ck� +. +�ma��g_�ngth + = + `�ݔty__g�_�ngth_�l +(& +�ݔty +)+1; + +214 +�ck� +. +�ck�_�ngth + =�ack�. +�ma��g_�ngth ++10; + +215 +�ck� +. +�yl�d + = + `��oc +�ack�. +�ma��g_�ngth ++10, 1); + +217 + `CU_ASSERT_PTR_NOT_NULL +( +�ck� +. +�yl�d +); + +218 if(! +�ck� +. +�yl�d +) ; + +220 + `�ݔty__wr�e_�l +(& +�ck� +, & +�ݔty +, +�ue +); + +221 +�ck� +. +pos + = 0; + +223 +rc + = + `�ݔty__�ad_�l +( +comm�d +, & +�ck� +, & +�ݔt�s +); + +225 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +226 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, +�ma��g_�ngth +); + +227 if( +�ݔt�s +){ + +228 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +id�tif�r +, identifier); + +229 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +v�ue +. +b� +. +�n +, +�n_ex��ed +); + +230 + `CU_ASSERT_EQUAL +( + `memcmp +( +�ݔt�s +-> +v�ue +. +b� +. +v +, +v�ue_ex��ed +, +�n_ex��ed +), 0); + +231 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +-> +�xt +, +NULL +); + +232 + `CU_ASSERT_EQUAL +( + `�ݔty__g�_�ngth_�l +( +�ݔt�s +), 1+2+ +�n_ex��ed +); + +233 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +235 + `CU_ASSERT_PTR_EQUAL +( +�ݔt�s +, +NULL +); + +236 + `� +( +�ݔty +. +v�ue +. +b� +. +v +); + +237 + `� +( +�ck� +. +�yl�d +); + +238 + } +} + +240 + $�r�g_��_��_wr�e_h��r +( + +241 +�ma��g_�ngth +, + +242 +rc_ex��ed +, + +243 +id�tif�r +, + +244 cڡ * +�me_ex��ed +, + +245 cڡ * +v�ue_ex��ed +, + +246 +bo� + +ex��_muɝ� +) + +248 +mosqu�to_�ݔty + +�ݔty +; + +249 +mosqu�to__�ck� + +�ck� +; + +250 +mosqu�to_�ݔty + * +�ݔt�s +; + +251 +rc +; + +253 + `mem�t +(& +�ݔty +, 0, ( +mosqu�to_�ݔty +)); + +255 +�ݔty +. +id�tif�r + = identifier; + +256 +�ݔty +. +v�ue +. +s +. +v + = + `�rdup +( +v�ue_ex��ed +); + +257 + `CU_ASSERT_PTR_NOT_NULL +( +�ݔty +. +v�ue +. +s +. +v +); + +258 if(! +�ݔty +. +v�ue +. +s +. +v +) ; + +259 +�ݔty +. +v�ue +. +s +. +�n + = + `��� +( +v�ue_ex��ed +); + +261 +�ݔty +. +�me +. +v + = + `�rdup +( +�me_ex��ed +); + +262 + `CU_ASSERT_PTR_NOT_NULL +( +�ݔty +. +�me +. +v +); + +263 if(! +�ݔty +. +�me +. +v +) ; + +265 +�ݔty +. +�me +. +�n + = + `��� +( +�me_ex��ed +); + +267 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +268 +�ck� +. +�ma��g_�ngth + = + `�ݔty__g�_�ngth_�l +(& +�ݔty +)+1; + +269 +�ck� +. +�ck�_�ngth + =�ack�. +�ma��g_�ngth ++10; + +270 +�ck� +. +�yl�d + = + `��oc +�ack�. +�ma��g_�ngth ++10, 1); + +272 + `CU_ASSERT_PTR_NOT_NULL +( +�ck� +. +�yl�d +); + +273 if(! +�ck� +. +�yl�d +) ; + +275 + `�ݔty__wr�e_�l +(& +�ck� +, & +�ݔty +, +�ue +); + +276 +�ck� +. +pos + = 0; + +278 +rc + = + `�ݔty__�ad_�l +( +CMD_CONNECT +, & +�ck� +, & +�ݔt�s +); + +280 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +281 + `CU_ASSERT_EQUAL +( +�ck� +. +pos +, +�ma��g_�ngth +); + +282 if( +�ݔt�s +){ + +283 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +id�tif�r +, identifier); + +284 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +�me +. +�n +, + `��� +( +�me_ex��ed +)); + +285 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +v�ue +. +s +. +�n +, + `��� +( +v�ue_ex��ed +)); + +286 + `CU_ASSERT_STRING_EQUAL +( +�ݔt�s +-> +�me +. +v +, +�me_ex��ed +); + +287 + `CU_ASSERT_STRING_EQUAL +( +�ݔt�s +-> +v�ue +. +s +. +v +, +v�ue_ex��ed +); + +288 if( +ex��_muɝ� +){ + +289 + `CU_ASSERT_PTR_NOT_NULL +( +�ݔt�s +-> +�xt +); + +291 + `CU_ASSERT_PTR_NULL +( +�ݔt�s +-> +�xt +); + +292 + `CU_ASSERT_EQUAL +( + `�ݔty__g�_�ngth_�l +( +�ݔt�s +), 1+2+ + `��� +( +�me_ex��ed +)+2+���( +v�ue_ex��ed +)); + +294 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +296 + `CU_ASSERT_PTR_NULL +( +�ݔt�s +); + +297 + `� +( +�ݔty +. +v�ue +. +s +. +v +); + +298 + `� +( +�ݔty +. +�me +. +v +); + +299 + `� +( +�ck� +. +�yl�d +); + +300 + } +} + +302 + $v��t_��_wr�e_h��r +( + +303 +�ma��g_�ngth +, + +304 +rc_ex��ed +, + +305 +id�tif�r +, + +306 +u�t32_t + +v�ue_ex��ed +) + +308 +mosqu�to_�ݔty + +�ݔty +; + +309 +mosqu�to__�ck� + +�ck� +; + +310 +mosqu�to_�ݔty + * +�ݔt�s +; + +311 +rc +; + +313 + `mem�t +(& +�ݔty +, 0, ( +mosqu�to_�ݔty +)); + +315 +�ݔty +. +id�tif�r + = identifier; + +316 +�ݔty +. +v�ue +. +v��t + = +v�ue_ex��ed +; + +318 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +319 +�ck� +. +�ma��g_�ngth + = + `�ݔty__g�_�ngth_�l +(& +�ݔty +)+1; + +320 +�ck� +. +�ck�_�ngth + =�ack�. +�ma��g_�ngth ++10; + +321 +�ck� +. +�yl�d + = + `��oc +�ack�. +�ma��g_�ngth ++10, 1); + +323 + `CU_ASSERT_PTR_NOT_NULL +( +�ck� +. +�yl�d +); + +324 if(! +�ck� +. +�yl�d +) ; + +326 + `�ݔty__wr�e_�l +(& +�ck� +, & +�ݔty +, +�ue +); + +327 +�ck� +. +pos + = 0; + +329 +rc + = + `�ݔty__�ad_�l +( +CMD_PUBLISH +, & +�ck� +, & +�ݔt�s +); + +331 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +332 if( +�ݔt�s +){ + +333 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +id�tif�r +, identifier); + +334 + `CU_ASSERT_EQUAL +( +�ݔt�s +-> +v�ue +. +v��t +, +v�ue_ex��ed +); + +335 + `CU_ASSERT_PTR_NULL +( +�ݔt�s +-> +�xt +); + +336 if( +v�ue_ex��ed + < 128){ + +337 + `CU_ASSERT_EQUAL +( + `�ݔty__g�_�ngth_�l +( +�ݔt�s +), 2); + +338 }if( +v�ue_ex��ed + < 16384){ + +339 + `CU_ASSERT_EQUAL +( + `�ݔty__g�_�ngth_�l +( +�ݔt�s +), 3); + +340 }if( +v�ue_ex��ed + < 2097152){ + +341 + `CU_ASSERT_EQUAL +( + `�ݔty__g�_�ngth_�l +( +�ݔt�s +), 4); + +342 }if( +v�ue_ex��ed + < 268435456){ + +343 + `CU_ASSERT_EQUAL +( + `�ݔty__g�_�ngth_�l +( +�ݔt�s +), 5); + +345 + `CU_FAIL +("Incorrect varint value."); + +347 + `mosqu�to_�ݔty_�_�l +(& +�ݔt�s +); + +349 + `CU_ASSERT_PTR_NULL +( +�ݔt�s +); + +350 + `� +( +�ck� +. +�yl�d +); + +351 + } +} + +357 + $TEST_bad_id�tif�r +() + +359 +mosqu�to_�ݔty + +�ݔty +; + +360 +mosqu�to__�ck� + +�ck� +; + +361 +u�t8_t + +�yl�d +[10]; + +362 +rc +; + +364 + `mem�t +(& +�ݔty +, 0, ( +mosqu�to_�ݔty +)); + +365 + `mem�t +(& +�ck� +, 0, ( +mosqu�to__�ck� +)); + +366 +�ݔty +. +id�tif�r + = 0xFFFF; + +367 +�ck� +. +�ck�_�ngth + = 10; + +368 +�ck� +. +�ma��g_�ngth + = 8; + +369 +�ck� +. +�yl�d + =�ayload; + +370 +rc + = + `�ݔty__wr�e_�l +(& +�ck� +, & +�ݔty +, +�ue +); + +371 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +372 + } +} + +379 + $TEST_s�g�_�yl�d_f�m�_�di�t� +() + +381 + `by�_��_wr�e_h��r +( +CMD_PUBLISH +, 3, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR +, 1); + +382 + } +} + +384 + $TEST_s�g�_�que�_�ob�m_�f�m�i� +() + +386 + `by�_��_wr�e_h��r +( +CMD_CONNECT +, 3, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_REQUEST_PROBLEM_INFORMATION +, 1); + +387 + } +} + +389 + $TEST_s�g�_�que�_��ڣ_�f�m�i� +() + +391 + `by�_��_wr�e_h��r +( +CMD_CONNECT +, 3, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_REQUEST_RESPONSE_INFORMATION +, 1); + +392 + } +} + +394 + $TEST_s�g�_maximum_qos +() + +396 + `by�_��_wr�e_h��r +( +CMD_CONNACK +, 3, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_MAXIMUM_QOS +, 1); + +397 + } +} + +399 + $TEST_s�g�_���_ava�ab� +() + +401 + `by�_��_wr�e_h��r +( +CMD_CONNACK +, 3, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_RETAIN_AVAILABLE +, 1); + +402 + } +} + +404 + $TEST_s�g�_w�d�rd_subs��ti�_ava�ab� +() + +406 + `by�_��_wr�e_h��r +( +CMD_CONNACK +, 3, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_WILDCARD_SUB_AVAILABLE +, 0); + +407 + } +} + +409 + $TEST_s�g�_subs��ti�_id�tif�r_ava�ab� +() + +411 + `by�_��_wr�e_h��r +( +CMD_CONNACK +, 3, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE +, 0); + +412 + } +} + +414 + $TEST_s�g�_sh�ed_subs��ti�_ava�ab� +() + +416 + `by�_��_wr�e_h��r +( +CMD_CONNACK +, 3, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SHARED_SUB_AVAILABLE +, 1); + +417 + } +} + +419 + $TEST_s�g�_mes�ge_exp�y_��rv� +() + +421 + `�t32_��_wr�e_h��r +( +CMD_PUBLISH +, 6, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL +, 0x12233445); + +422 + } +} + +424 + $TEST_s�g�_�ssi�_exp�y_��rv� +() + +426 + `�t32_��_wr�e_h��r +( +CMD_CONNACK +, 6, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SESSION_EXPIRY_INTERVAL +, 0x45342312); + +427 + } +} + +429 + $TEST_s�g�_w�l_d�ay_��rv� +() + +431 + `�t32_��_wr�e_h��r +( +CMD_WILL +, 6, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_WILL_DELAY_INTERVAL +, 0x45342312); + +432 + } +} + +434 + $TEST_s�g�_maximum_�ck�_size +() + +436 + `�t32_��_wr�e_h��r +( +CMD_CONNECT +, 6, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_MAXIMUM_PACKET_SIZE +, 0x45342312); + +437 + } +} + +439 + $TEST_s�g�_�rv�_k�p_�ive +() + +441 + `�t16_��_wr�e_h��r +( +CMD_CONNACK +, 4, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SERVER_KEEP_ALIVE +, 0x4534); + +442 + } +} + +444 + $TEST_s�g�_��ive_maximum +() + +446 + `�t16_��_wr�e_h��r +( +CMD_CONNACK +, 4, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_RECEIVE_MAXIMUM +, 0x6842); + +447 + } +} + +449 + $TEST_s�g�_t�ic_��s_maximum +() + +451 + `�t16_��_wr�e_h��r +( +CMD_CONNECT +, 4, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_TOPIC_ALIAS_MAXIMUM +, 0x6842); + +452 + } +} + +454 + $TEST_s�g�_t�ic_��s +() + +456 + `�t16_��_wr�e_h��r +( +CMD_PUBLISH +, 4, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_TOPIC_ALIAS +, 0x6842); + +457 + } +} + +459 + $TEST_s�g�_cڋ�_ty� +() + +461 + `�r�g_��_wr�e_h��r +( +CMD_PUBLISH +, 9, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_CONTENT_TYPE +, "hello"); + +462 + } +} + +464 + $TEST_s�g�_��ڣ_t�ic +() + +466 + `�r�g_��_wr�e_h��r +( +CMD_WILL +, 9, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_RESPONSE_TOPIC +, "hello"); + +467 + } +} + +469 + $TEST_s�g�_assig�d_���_id�tif�r +() + +471 + `�r�g_��_wr�e_h��r +( +CMD_CONNACK +, 9, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER +, "hello"); + +472 + } +} + +474 + $TEST_s�g�_auth�ti�ti�_m�hod +() + +476 + `�r�g_��_wr�e_h��r +( +CMD_CONNECT +, 9, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_AUTHENTICATION_METHOD +, "hello"); + +477 + } +} + +479 + $TEST_s�g�_��ڣ_�f�m�i� +() + +481 + `�r�g_��_wr�e_h��r +( +CMD_CONNACK +, 9, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_RESPONSE_INFORMATION +, "hello"); + +482 + } +} + +484 + $TEST_s�g�_�rv�_��n� +() + +486 + `�r�g_��_wr�e_h��r +( +CMD_CONNACK +, 9, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SERVER_REFERENCE +, "hello"); + +487 + } +} + +489 + $TEST_s�g�_�as�_�r�g +() + +491 + `�r�g_��_wr�e_h��r +( +CMD_PUBREC +, 9, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_REASON_STRING +, "hello"); + +492 + } +} + +494 + $TEST_s�g�_cܻ�ti�_d�a +() + +496 +u�t8_t + +�yl�d +[5] = {1, 'e', 0, 'l', 9}; + +498 + `b��y_��_wr�e_h��r +( +CMD_PUBLISH +, 9, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_CORRELATION_DATA +, +�yl�d +, 5); + +499 + } +} + +501 + $TEST_s�g�_auth�ti�ti�_d�a +() + +503 +u�t8_t + +�yl�d +[5] = {1, 'e', 0, 'l', 9}; + +505 + `b��y_��_wr�e_h��r +( +CMD_CONNECT +, 9, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_AUTHENTICATION_DATA +, +�yl�d +, 5); + +506 + } +} + +508 + $TEST_s�g�_u�r_�ݔty +() + +510 + `�r�g_��_��_wr�e_h��r +(10, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_USER_PROPERTY +, "za", "bc", +�l� +); + +511 + } +} + +513 + $TEST_s�g�_subs��ti�_id�tif�r +() + +515 + `v��t_��_wr�e_h��r +(3, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 0); + +516 + `v��t_��_wr�e_h��r +(3, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 127); + +517 + `v��t_��_wr�e_h��r +(4, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 128); + +518 + `v��t_��_wr�e_h��r +(4, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 16383); + +519 + `v��t_��_wr�e_h��r +(5, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 16384); + +520 + `v��t_��_wr�e_h��r +(5, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 2097151); + +521 + `v��t_��_wr�e_h��r +(6, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 2097152); + +522 + `v��t_��_wr�e_h��r +(6, +MOSQ_ERR_SUCCESS +, +MQTT_PROP_SUBSCRIPTION_IDENTIFIER +, 268435455); + +523 + } +} + +530 + $��_�ݔty_wr�e_��s +() + +532 +CU_pSu�e + +��_su�e + = +NULL +; + +534 +��_su�e + = + `CU_add_su�e +("Prݔty wr�e", +NULL +, NULL); + +535 if(! +��_su�e +){ + +536 + `��tf +("Error�dding CUnit Property write�est suite.\n"); + +541 || ! + `CU_add_�� +( +��_su�e +, "Bad id�tif�r", +TEST_bad_id�tif�r +) + +542 || ! + `CU_add_�� +( +��_su�e +, "S�g� Payl�d F�m� Indi�t�", +TEST_s�g�_�yl�d_f�m�_�di�t� +) + +543 || ! + `CU_add_�� +( +��_su�e +, "S�g� Reque� Prob�m Inf�m�i�", +TEST_s�g�_�que�_�ob�m_�f�m�i� +) + +544 || ! + `CU_add_�� +( +��_su�e +, "S�g� Reque� Re�ڣ Inf�m�i�", +TEST_s�g�_�que�_��ڣ_�f�m�i� +) + +545 || ! + `CU_add_�� +( +��_su�e +, "S�g� Maximum QoS", +TEST_s�g�_maximum_qos +) + +546 || ! + `CU_add_�� +( +��_su�e +, "S�g� R�a� Ava�ab�", +TEST_s�g�_���_ava�ab� +) + +547 || ! + `CU_add_�� +( +��_su�e +, "S�g� W�d�rd Subs��ti� Ava�ab�", +TEST_s�g�_w�d�rd_subs��ti�_ava�ab� +) + +548 || ! + `CU_add_�� +( +��_su�e +, "S�g� Subs��ti� Id�tif��Ava�ab�", +TEST_s�g�_subs��ti�_id�tif�r_ava�ab� +) + +549 || ! + `CU_add_�� +( +��_su�e +, "S�g� Sh�ed Subs��ti� Ava�ab�", +TEST_s�g�_sh�ed_subs��ti�_ava�ab� +) + +550 || ! + `CU_add_�� +( +��_su�e +, "S�g� Mes�g�Exp�y I��v�", +TEST_s�g�_mes�ge_exp�y_��rv� +) + +551 || ! + `CU_add_�� +( +��_su�e +, "S�g� Sessi� Exp�y I��v�", +TEST_s�g�_�ssi�_exp�y_��rv� +) + +552 || ! + `CU_add_�� +( +��_su�e +, "S�g� W��D�ay I��v�", +TEST_s�g�_w�l_d�ay_��rv� +) + +553 || ! + `CU_add_�� +( +��_su�e +, "S�g� Maximum Pack� Size", +TEST_s�g�_maximum_�ck�_size +) + +554 || ! + `CU_add_�� +( +��_su�e +, "S�g� S�v� K��Alive", +TEST_s�g�_�rv�_k�p_�ive +) + +555 || ! + `CU_add_�� +( +��_su�e +, "S�g� Re�iv�Maximum", +TEST_s�g�_��ive_maximum +) + +556 || ! + `CU_add_�� +( +��_su�e +, "S�g� T�i�Al��Maximum", +TEST_s�g�_t�ic_��s_maximum +) + +557 || ! + `CU_add_�� +( +��_su�e +, "S�g� T�i�Al�s", +TEST_s�g�_t�ic_��s +) + +558 || ! + `CU_add_�� +( +��_su�e +, "S�g� Cڋ� Ty�", +TEST_s�g�_cڋ�_ty� +) + +559 || ! + `CU_add_�� +( +��_su�e +, "S�g� Re�ڣ T�ic", +TEST_s�g�_��ڣ_t�ic +) + +560 || ! + `CU_add_�� +( +��_su�e +, "S�g� Assig�d Cl�� Id�tif�r", +TEST_s�g�_assig�d_���_id�tif�r +) + +561 || ! + `CU_add_�� +( +��_su�e +, "S�g� Auth�ti�ti� M�hod", +TEST_s�g�_auth�ti�ti�_m�hod +) + +562 || ! + `CU_add_�� +( +��_su�e +, "S�g� Re�ڣ Inf�m�i�", +TEST_s�g�_��ڣ_�f�m�i� +) + +563 || ! + `CU_add_�� +( +��_su�e +, "S�g� S�v� Re�n�", +TEST_s�g�_�rv�_��n� +) + +564 || ! + `CU_add_�� +( +��_su�e +, "S�g� R�s� S��g", +TEST_s�g�_�as�_�r�g +) + +565 || ! + `CU_add_�� +( +��_su�e +, "S�g� Cܻ�ti� D�a", +TEST_s�g�_cܻ�ti�_d�a +) + +566 || ! + `CU_add_�� +( +��_su�e +, "S�g� Auth�ti�ti� D�a", +TEST_s�g�_auth�ti�ti�_d�a +) + +567 || ! + `CU_add_�� +( +��_su�e +, "S�g� U��Prݔty", +TEST_s�g�_u�r_�ݔty +) + +568 || ! + `CU_add_�� +( +��_su�e +, "S�g� Subs��ti� Id�tif�r", +TEST_s�g�_subs��ti�_id�tif�r +) + +571 + `��tf +("Error�dding Property�ead CUnit�ests.\n"); + +576 + } +} + + @test/unit/publish_test.c + +1 + ~<CUn�/CUn�.h +> + +2 + ~<CUn�/Basic.h +> + +4 + ~<mosqu�to_����.h +> + +5 + ~<ut�_mosq.h +> + +8 + $TEST_maximum_�ck�_size +() + +10 +mosqu�to + +mosq +; + +11 +rc +; + +13 + `mem�t +(& +mosq +, 0, ( +mosqu�to +)); + +15 +mosq +. +maximum_�ck�_size + = 5; + +16 +rc + = + `mosqu�to_publish +(& +mosq +, +NULL +, "t�ic/ov�size", + `��� +("payload"), "payload", 0, 0); + +17 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_OVERSIZE_PACKET +); + +18 + } +} + +24 + $��_publish_��s +() + +26 +CU_pSu�e + +��_su�e + = +NULL +; + +28 +��_su�e + = + `CU_add_su�e +("Publish", +NULL +, NULL); + +29 if(! +��_su�e +){ + +30 + `��tf +("Error�dding CUnit Publish�est suite.\n"); + +35 || ! + `CU_add_�� +( +��_su�e +, "v5: Maximum�ack� size", +TEST_maximum_�ck�_size +) + +38 + `��tf +("Error�dding Publish CUnit�ests.\n"); + +43 + } +} + + @test/unit/stubs.c + +1 + ~<logg�g_mosq.h +> + +3 + $log__��tf +( +mosqu�to + * +mosq +, +�iܙy +, cڡ * +fmt +, ...) + +6 + } +} + + @test/unit/test.c + +1 + ~"c�fig.h +" + +2 + ~<�dio.h +> + +4 + ~<CUn�/CUn�.h +> + +5 + ~<CUn�/Basic.h +> + +7 +��_d��y�_�ad_��s +(); + +8 +��_d��y�_wr�e_��s +(); + +9 +��_�ݔty_add_��s +(); + +10 +��_�ݔty_�ad_��s +(); + +11 +��_�ݔty_u�r_�ad_��s +(); + +12 +��_�ݔty_wr�e_��s +(); + +13 +��_utf8_��s +(); + +14 +��_ut�_t�ic_��s +(); + +16 + $ma� +( +�gc +, * +�gv +[]) + +18 +�s +; + +20 if( + `CU_���lize_�gi�ry +(�!� +CUE_SUCCESS +){ + +21 + `��tf +("Error initializing CUnit�egistry.\n"); + +26 || + `��_utf8_��s +() + +27 || + `��_d��y�_�ad_��s +() + +28 || + `��_d��y�_wr�e_��s +() + +29 || + `��_�ݔty_add_��s +() + +30 || + `��_�ݔty_�ad_��s +() + +31 || + `��_�ݔty_u�r_�ad_��s +() + +32 || + `��_�ݔty_wr�e_��s +() + +33 || + `��_ut�_t�ic_��s +() + +36 + `CU_��nup_�gi�ry +(); + +40 + `CU_basic_�t_mode +( +CU_BRM_VERBOSE +); + +41 + `CU_basic_run_��s +(); + +42 +�s + = + `CU_g�_numb�_of_�u�s +(); + +43 + `CU_��nup_�gi�ry +(); + +45 () +�s +; + +46 + } +} + + @test/unit/utf8.c + +1 + ~<CUn�/CUn�.h +> + +2 + ~<CUn�/Basic.h +> + +4 + ~"mosqu�to.h +" + +10 + $utf8_h��r_�n +(cڡ * +�xt +, +�n +, +ex��ed +) + +12 +�su� +; + +14 +�su� + = + `mosqu�to_v�id�e_utf8 +( +�xt +, +�n +); + +15 + `CU_ASSERT_EQUAL +( +�su� +, +ex��ed +); + +16 + } +} + +18 + $utf8_h��r +(cڡ * +�xt +, +ex��ed +) + +20 + `utf8_h��r_�n +( +�xt +, + `��� +�ext), +ex��ed +); + +21 + } +} + +24 + $TEST_utf8_em�y +() + +26 + `utf8_h��r_�n +( +NULL +, 0, +MOSQ_ERR_INVAL +); + +27 + } +} + +30 + $TEST_utf8_v�id +() + +33 + `utf8_h��r +("", +MOSQ_ERR_SUCCESS +); + +34 + `utf8_h��r +("You should s��h�G�ek w�d 'kosme': \"κόσμε\"", +MOSQ_ERR_SUCCESS +); + +35 + } +} + +38 + $TEST_utf8_�un��d +() + +40 +buf +[4]; + +43 +buf +[0] = 0xC2; buf[1] = 0; + +44 + `utf8_h��r +( +buf +, +MOSQ_ERR_MALFORMED_UTF8 +); + +46 +buf +[0] = 0xE0; buf[1] = 0xA0; buf[2] = 0; + +47 + `utf8_h��r +( +buf +, +MOSQ_ERR_MALFORMED_UTF8 +); + +49 +buf +[0] = 0xF0; buf[1] = 0x90; buf[2] = 0x80; buf[3] = 0; + +50 + `utf8_h��r +( +buf +, +MOSQ_ERR_MALFORMED_UTF8 +); + +51 + } +} + +54 + $TEST_utf8_bound�y_c�d�i�s +() + +58 + `utf8_h��r_�n +("2.1.1 1 by� (U-00000000): \"\0\"", 39, +MOSQ_ERR_MALFORMED_UTF8 +); + +59 + `utf8_h��r +("2.1.2 2 by��(U-00000080): \"\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +60 + `utf8_h��r +("2.1.3 3 by��(U-00000800): \"ࠀ\"", +MOSQ_ERR_SUCCESS +); + +61 + `utf8_h��r +("2.1.4 4 by��(U-00010000): \"𐀀\"", +MOSQ_ERR_SUCCESS +); + +65 + `utf8_h��r +("2.2.1 1 by� (U-0000007F): \"\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +66 + `utf8_h��r +("2.2.2 2 by��(U-000007FF): \"߿\"", +MOSQ_ERR_SUCCESS +); + +68 + `utf8_h��r +("2.2.3 3 by��(U-0000FFFF): \"\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +70 + `utf8_h��r +("2.2.4 4 by��(U-0010FFFF): \"����\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +74 + `utf8_h��r +("2.3.1 U-0000D7FF =�d 9�b��\"\"", +MOSQ_ERR_SUCCESS +); + +75 + `utf8_h��r +("2.3.2 U-0000E000 =��80 80 = \"\"", +MOSQ_ERR_SUCCESS +); + +76 + `utf8_h��r +("2.3.3 U-0000FFFD =��b�bd = \"�\"", +MOSQ_ERR_SUCCESS +); + +78 + `utf8_h��r +("2.3.4 U-0010FFFF = f4 8�b�b��\"\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +80 + `utf8_h��r +("2.3.5 U-00110000 = f4 90 80 80 = \"����\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +81 + } +} + +84 + $TEST_utf8_m�f�med_�qu��s +() + +86 +buf +[100]; + +87 +i +; + +90 + `utf8_h��r +("3.1.1 F�� c�t�u�i� by� 0x80: \"�\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +91 + `utf8_h��r +("3.1.2 La� c�t�u�i� by� 0xbf: \"�\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +92 + `utf8_h��r +("3.1.3 2 c�t�u�i� by�s: \"��\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +93 + `utf8_h��r +("3.1.4 3 c�t�u�i� by�s: \"���\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +94 + `utf8_h��r +("3.1.5 4 c�t�u�i� by�s: \"����\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +95 + `utf8_h��r +("3.1.6 5 c�t�u�i� by�s: \"�����\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +96 + `utf8_h��r +("3.1.7 6 c�t�u�i� by�s: \"������\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +97 + `utf8_h��r +("3.1.8 7 c�t�u�i� by�s: \"�������\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +100 + `mem�t +( +buf +, 0, (buf)); + +101 +i +=0x80; i<0x90; i++){ + +102 +buf +[ +i +-0x80] = i; + +104 + `utf8_h��r +( +buf +, +MOSQ_ERR_MALFORMED_UTF8 +); + +105 + `mem�t +( +buf +, 0, (buf)); + +106 +i +=0x90; i<0xa0; i++){ + +107 +buf +[ +i +-0x90] = i; + +109 + `utf8_h��r +( +buf +, +MOSQ_ERR_MALFORMED_UTF8 +); + +111 +i +=0x80; i<0xA0; i++){ + +112 +buf +[0] = +i +; + +113 +buf +[1] = 0; + +114 + `utf8_h��r +( +buf +, +MOSQ_ERR_MALFORMED_UTF8 +); + +117 +i +=0xA0; i<0xC0; i++){ + +118 +buf +[0] = +i +; + +119 +buf +[1] = 0; + +120 + `utf8_h��r +( +buf +, +MOSQ_ERR_MALFORMED_UTF8 +); + +127 + `utf8_h��r +("� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ", +MOSQ_ERR_MALFORMED_UTF8 +); + +128 +i +=0xC0; i<0xE0; i++){ + +129 +buf +[0] = +i +; + +130 +buf +[1] = ' '; + +131 +buf +[2] = 0; + +132 + `utf8_h��r +( +buf +, +MOSQ_ERR_MALFORMED_UTF8 +); + +137 + `utf8_h��r +("\"� � � � � � � � � � � � � � � � \"", +MOSQ_ERR_MALFORMED_UTF8 +); + +138 +i +=0xe0; i<0xf0; i++){ + +139 +buf +[0] = +i +; + +140 +buf +[1] = ' '; + +141 +buf +[2] = 0; + +142 + `utf8_h��r +( +buf +, +MOSQ_ERR_MALFORMED_UTF8 +); + +147 + `utf8_h��r +("\"� � � � � � � � \"", +MOSQ_ERR_MALFORMED_UTF8 +); + +148 +i +=0xF0; i<0xF8; i++){ + +149 +buf +[0] = +i +; + +150 +buf +[1] = ' '; + +151 +buf +[2] = 0; + +152 + `utf8_h��r +( +buf +, +MOSQ_ERR_MALFORMED_UTF8 +); + +157 + `utf8_h��r +("\"� � � � \"", +MOSQ_ERR_MALFORMED_UTF8 +); + +158 +i +=0xF8; i<0xFC; i++){ + +159 +buf +[0] = +i +; + +160 +buf +[1] = ' '; + +161 +buf +[2] = 0; + +162 + `utf8_h��r +( +buf +, +MOSQ_ERR_MALFORMED_UTF8 +); + +167 + `utf8_h��r +("\"� � \"", +MOSQ_ERR_MALFORMED_UTF8 +); + +168 + `utf8_h��r +("� ", +MOSQ_ERR_MALFORMED_UTF8 +); + +169 + `utf8_h��r +("� ", +MOSQ_ERR_MALFORMED_UTF8 +); + +170 +i +=0xFC; i<0xFE; i++){ + +171 +buf +[0] = +i +; + +172 +buf +[1] = ' '; + +173 +buf +[2] = 0; + +174 + `utf8_h��r +( +buf +, +MOSQ_ERR_MALFORMED_UTF8 +); + +183 + `utf8_h��r +("3.3.1 2-by� sequ�� w�h�a� by� miss�g (U+0000): \"�\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +184 + `utf8_h��r +("3.3.2 3-by� sequ�� w�h�a� by� miss�g (U+0000): \"��\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +185 + `utf8_h��r +("3.3.3 4-by� sequ�� w�h�a� by� miss�g (U+0000): \"���\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +186 + `utf8_h��r +("3.3.4 5-by� sequ�� w�h�a� by� miss�g (U+0000): \"����\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +187 + `utf8_h��r +("3.3.5 6-by� sequ�� w�h�a� by� miss�g (U+0000): \"�����\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +188 + `utf8_h��r +("3.3.6 2-by� sequ�� w�h�a� by� miss�g (U-000007FF): \"�\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +189 + `utf8_h��r +("3.3.7 3-by� sequ�� w�h�a� by� miss�g (U-0000FFFF): \"�\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +190 + `utf8_h��r +("3.3.8 4-by� sequ�� w�h�a� by� miss�g (U-001FFFFF): \"���\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +191 + `utf8_h��r +("3.3.9 5-by� sequ�� w�h�a� by� miss�g (U-03FFFFFF): \"����\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +192 + `utf8_h��r +("3.3.10 6-by� sequ�� w�h�a� by� miss�g (U-7FFFFFFF): \"�����\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +199 + `utf8_h��r +("\"�����������������������������\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +205 + `utf8_h��r +("3.5.1 f��\"�\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +206 + `utf8_h��r +("3.5.2 f��\"�\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +207 + `utf8_h��r +("3.5.3 f�� f�f��\"����\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +208 + } +} + +210 + $TEST_utf8_ov�l�g_�cod�g +() + +240 + `utf8_h��r +("4.1.1 U+002F = c0�� = \"��\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +241 + `utf8_h��r +("4.1.2 U+002F =�0 80�� = \"���\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +242 + `utf8_h��r +("4.1.3 U+002F = f0 80 80�� = \"����\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +243 + `utf8_h��r +("4.1.4 U+002F = f8 80 80 80�� = \"�����\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +244 + `utf8_h��r +("4.1.5 U+002F = f�80 80 80 80���\"������\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +253 + `utf8_h��r +("4.2.1 U-0000007F = c1 b� = \"��\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +254 + `utf8_h��r +("4.2.2 U-000007FF =�0 9�b� = \"���\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +255 + `utf8_h��r +("4.2.3 U-0000FFFF = f0 8�b�b� = \"����\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +256 + `utf8_h��r +("4.2.4 U-001FFFFF = f8 87 b�b�b� = \"�����\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +257 + `utf8_h��r +("4.2.5 U-03FFFFFF = f�83 b�b�b�b��\"������\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +265 + `utf8_h��r +("4.3.1 U+0000 = c0 80 = \"��\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +266 + `utf8_h��r +("4.3.2 U+0000 =�0 80 80 = \"���\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +267 + `utf8_h��r +("4.3.3 U+0000 = f0 80 80 80 = \"����\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +268 + `utf8_h��r +("4.3.4 U+0000 = f8 80 80 80 80 = \"�����\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +269 + `utf8_h��r +("4.3.5 U+0000 = f�80 80 80 80 80 = \"������\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +270 + } +} + +273 + $TEST_utf8_��g�_code_pos�i�s +() + +284 + `utf8_h��r +("5.1.1 U+D800 =�d�0 80 = \"�\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +285 + `utf8_h��r +("5.1.2 U+DB7F =�d�d b��\"�\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +286 + `utf8_h��r +("5.1.3 U+DB80 =�d��80 = \"�\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +287 + `utf8_h��r +("5.1.4 U+DBFF =�d��b��\"�\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +288 + `utf8_h��r +("5.1.5 U+DC00 =�d b0 80 = \"�\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +289 + `utf8_h��r +("5.1.6 U+DF80 =�d b�80 = \"�\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +290 + `utf8_h��r +("5.1.7 U+DFFF =�d b�b��\"�\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +294 + `utf8_h��r +("5.2.1 U+D800 U+DC00 =�d�0 80�d b0 80 = \"��\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +295 + `utf8_h��r +("5.2.2 U+D800 U+DFFF =�d�0 80�d b�b��\"��\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +296 + `utf8_h��r +("5.2.3 U+DB7F U+DC00 =�d�d b�ed b0 80 = \"��\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +297 + `utf8_h��r +("5.2.4 U+DB7F U+DFFF =�d�d b�ed b�b��\"��\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +298 + `utf8_h��r +("5.2.5 U+DB80 U+DC00 =�d��80�d b0 80 = \"��\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +299 + `utf8_h��r +("5.2.6 U+DB80 U+DFFF =�d��80�d b�b��\"��\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +300 + `utf8_h��r +("5.2.7 U+DBFF U+DC00 =�d��b�ed b0 80 = \"��\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +301 + `utf8_h��r +("5.2.8 U+DBFF U+DFFF =�d��b�ed b�b��\"��\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +324 + `utf8_h��r +("5.3.1 U+FFFE =��b�b��\"\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +325 + `utf8_h��r +("5.3.2 U+FFFF =��b�b��\"\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +330 + `utf8_h��r +("5.3.3 U+FDD0 .. U+FDEF = \"\"", +MOSQ_ERR_MALFORMED_UTF8 +); + +331 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +332 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +333 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +334 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +335 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +336 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +337 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +338 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +339 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +340 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +341 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +342 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +343 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +344 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +345 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +346 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +347 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +348 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +349 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +350 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +351 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +352 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +353 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +354 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +355 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +356 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +357 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +358 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +359 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +360 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +361 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +362 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +366 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +367 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +368 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +369 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +370 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +371 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +372 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +373 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +374 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +375 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +376 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +377 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +378 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +379 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +380 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +381 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +382 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +383 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +384 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +385 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +386 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +387 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +388 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +389 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +390 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +391 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +392 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +393 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +394 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +395 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +396 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +397 + `utf8_h��r +("", +MOSQ_ERR_MALFORMED_UTF8 +); + +398 + } +} + +401 + $TEST_utf8_cڌ�_ch�a��s +() + +403 +buf +[10]; + +404 +i +; + +407 +i +=0x01; i<0x20; i++){ + +408 +buf +[0] = +i +; + +409 +buf +[1] = '\0'; + +410 + `utf8_h��r +( +buf +, +MOSQ_ERR_MALFORMED_UTF8 +); + +414 +buf +[0] = 0x7F; + +415 +buf +[1] = '\0'; + +416 + `utf8_h��r +( +buf +, +MOSQ_ERR_MALFORMED_UTF8 +); + +419 +i +=0x80; i<0xA0; i++){ + +420 +buf +[0] = 0xC2; + +421 +buf +[1] = +i +-0x80; + +422 +buf +[2] = '\0'; + +423 + `utf8_h��r +( +buf +, +MOSQ_ERR_MALFORMED_UTF8 +); + +426 + } +} + +429 + $TEST_utf8_mq�_1_5_4_2 +() + +431 +buf +[10] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', '\0'}; + +433 + `utf8_h��r_�n +( +buf +, 9, +MOSQ_ERR_SUCCESS +); + +435 +buf +[3] = '\0'; + +436 + `utf8_h��r_�n +( +buf +, 9, +MOSQ_ERR_MALFORMED_UTF8 +); + +437 + } +} + +440 + $TEST_utf8_mq�_1_5_4_3 +() + +442 +buf +[10] = {'a', 'b', 0xEF, 0xBB, 0xBF, 'f', 'g', 'h', 'i', '\0'}; + +444 + `utf8_h��r_�n +( +buf +, 9, +MOSQ_ERR_SUCCESS +); + +445 + } +} + +452 + $��_utf8_��s +() + +454 +CU_pSu�e + +��_su�e + = +NULL +; + +456 +��_su�e + = + `CU_add_su�e +("UTF-8", +NULL +, NULL); + +457 if(! +��_su�e +){ + +458 + `��tf +("Error�dding CUnit�est suite.\n"); + +463 || ! + `CU_add_�� +( +��_su�e +, "UTF-8�m�y", +TEST_utf8_em�y +) + +464 || ! + `CU_add_�� +( +��_su�e +, "UTF-8 v�id", +TEST_utf8_v�id +) + +465 || ! + `CU_add_�� +( +��_su�e +, "UTF-8�run��d", +TEST_utf8_�un��d +) + +466 || ! + `CU_add_�� +( +��_su�e +, "UTF-8 bound�y c�d�i�s", +TEST_utf8_bound�y_c�d�i�s +) + +467 || ! + `CU_add_�� +( +��_su�e +, "UTF-8 m�f�med sequ��s", +TEST_utf8_m�f�med_�qu��s +) + +468 || ! + `CU_add_�� +( +��_su�e +, "UTF-8 ov�l�g�ncod�g", +TEST_utf8_ov�l�g_�cod�g +) + +469 || ! + `CU_add_�� +( +��_su�e +, "UTF-8 i�eg� cod�pos�i�s", +TEST_utf8_��g�_code_pos�i�s +) + +470 || ! + `CU_add_�� +( +��_su�e +, "UTF-8 cڌ� ch�a��s", +TEST_utf8_cڌ�_ch�a��s +) + +471 || ! + `CU_add_�� +( +��_su�e +, "UTF-8 MQTT-1.5.4-2", +TEST_utf8_mq�_1_5_4_2 +) + +472 || ! + `CU_add_�� +( +��_su�e +, "UTF-8 MQTT-1.5.4-3", +TEST_utf8_mq�_1_5_4_3 +) + +475 + `��tf +("Error�dding UTF-8 CUnit�ests.\n"); + +480 + } +} + + @test/unit/util_topic_test.c + +1 + ~<CUn�/CUn�.h +> + +2 + ~<CUn�/Basic.h +> + +4 + ~<ut�_mosq.h +> + +6 + $m�ch_h��r +(cڡ * +sub +, cڡ * +t�ic +) + +8 +rc +; + +9 +bo� + +m�ch +; + +11 +rc + = + `mosqu�to_t�ic_m�ches_sub +( +sub +, +t�ic +, & +m�ch +); + +12 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_SUCCESS +); + +13 + `CU_ASSERT_EQUAL +( +m�ch +, +�ue +); + +14 + } +} + +16 + $no_m�ch_h��r +( +rc_ex��ed +, cڡ * +sub +, cڡ * +t�ic +) + +18 +rc +; + +19 +bo� + +m�ch +; + +21 +rc + = + `mosqu�to_t�ic_m�ches_sub +( +sub +, +t�ic +, & +m�ch +); + +22 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +23 + `CU_ASSERT_EQUAL +( +m�ch +, +�l� +); + +24 + } +} + +30 + $TEST_em�y_�put +() + +32 +rc +; + +33 +bo� + +m�ch +; + +35 +rc + = + `mosqu�to_t�ic_m�ches_sub +("sub", +NULL +, & +m�ch +); + +36 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +37 + `CU_ASSERT_EQUAL +( +m�ch +, +�l� +); + +39 +rc + = + `mosqu�to_t�ic_m�ches_sub +( +NULL +, "t�ic", & +m�ch +); + +40 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +41 + `CU_ASSERT_EQUAL +( +m�ch +, +�l� +); + +43 +rc + = + `mosqu�to_t�ic_m�ches_sub +( +NULL +, NULL, & +m�ch +); + +44 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +45 + `CU_ASSERT_EQUAL +( +m�ch +, +�l� +); + +47 +rc + = + `mosqu�to_t�ic_m�ches_sub +("sub", "", & +m�ch +); + +48 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +49 + `CU_ASSERT_EQUAL +( +m�ch +, +�l� +); + +51 +rc + = + `mosqu�to_t�ic_m�ches_sub +("", "t�ic", & +m�ch +); + +52 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +53 + `CU_ASSERT_EQUAL +( +m�ch +, +�l� +); + +55 +rc + = + `mosqu�to_t�ic_m�ches_sub +("", "", & +m�ch +); + +56 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +57 + `CU_ASSERT_EQUAL +( +m�ch +, +�l� +); + +59 +rc + = + `mosqu�to_t�ic_m�ches_sub2 +("sub", 3, +NULL +, 0, & +m�ch +); + +60 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +61 + `CU_ASSERT_EQUAL +( +m�ch +, +�l� +); + +63 +rc + = + `mosqu�to_t�ic_m�ches_sub2 +( +NULL +, 0, "t�ic", 5, & +m�ch +); + +64 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +65 + `CU_ASSERT_EQUAL +( +m�ch +, +�l� +); + +67 +rc + = + `mosqu�to_t�ic_m�ches_sub2 +( +NULL +, 0, NULL, 0, & +m�ch +); + +68 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +69 + `CU_ASSERT_EQUAL +( +m�ch +, +�l� +); + +71 +rc + = + `mosqu�to_t�ic_m�ches_sub2 +("sub", 3, "", 0, & +m�ch +); + +72 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +73 + `CU_ASSERT_EQUAL +( +m�ch +, +�l� +); + +75 +rc + = + `mosqu�to_t�ic_m�ches_sub2 +("", 0, "t�ic", 5, & +m�ch +); + +76 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +77 + `CU_ASSERT_EQUAL +( +m�ch +, +�l� +); + +79 +rc + = + `mosqu�to_t�ic_m�ches_sub2 +("", 0, "", 0, & +m�ch +); + +80 + `CU_ASSERT_EQUAL +( +rc +, +MOSQ_ERR_INVAL +); + +81 + `CU_ASSERT_EQUAL +( +m�ch +, +�l� +); + +82 + } +} + +88 + $TEST_v�id_m�ch�g +() + +90 + `m�ch_h��r +("foo/#", "foo/"); + +91 + `m�ch_h��r +("foo/#", "foo"); + +92 + `m�ch_h��r +("foo//bar", "foo//bar"); + +93 + `m�ch_h��r +("foo//+", "foo//bar"); + +94 + `m�ch_h��r +("foo/+/+/baz", "foo///baz"); + +95 + `m�ch_h��r +("foo/bar/+", "foo/bar/"); + +96 + `m�ch_h��r +("foo/bar", "foo/bar"); + +97 + `m�ch_h��r +("foo/+", "foo/bar"); + +98 + `m�ch_h��r +("foo/+/baz", "foo/bar/baz"); + +99 + `m�ch_h��r +("A/B/+/#", "A/B/B/C"); + +100 + `m�ch_h��r +("foo/+/#", "foo/bar/baz"); + +101 + `m�ch_h��r +("foo/+/#", "foo/bar"); + +102 + `m�ch_h��r +("#", "foo/bar/baz"); + +103 + `m�ch_h��r +("#", "foo/bar/baz"); + +104 + `m�ch_h��r +("#", "/foo/bar"); + +105 + `m�ch_h��r +("/#", "/foo/bar"); + +106 + } +} + +109 + $TEST_�v�id_but_m�ch�g +() + +113 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "+foo", "+foo"); + +114 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "fo+o", "fo+o"); + +115 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "foo+", "foo+"); + +116 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "+foo/bar", "+foo/bar"); + +117 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "foo+/bar", "foo+/bar"); + +118 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "foo/+bar", "foo/+bar"); + +119 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "foo/bar+", "foo/bar+"); + +121 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "+foo", "afoo"); + +122 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "fo+o", "foao"); + +123 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "foo+", "fooa"); + +124 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "+foo/bar", "afoo/bar"); + +125 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "foo+/bar", "fooa/bar"); + +126 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "foo/+bar", "foo/abar"); + +127 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "foo/bar+", "foo/bara"); + +129 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "#foo", "#foo"); + +130 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "fo#o", "fo#o"); + +131 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "foo#", "foo#"); + +132 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "#foo/bar", "#foo/bar"); + +133 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "foo#/bar", "foo#/bar"); + +134 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "foo/#bar", "foo/#bar"); + +135 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "foo/bar#", "foo/bar#"); + +137 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "foo+", "fooa"); + +138 + } +} + +141 + $TEST_v�id_no_m�ch�g +() + +143 + `no_m�ch_h��r +( +MOSQ_ERR_SUCCESS +, "test/6/#", "test/3"); + +145 + `no_m�ch_h��r +( +MOSQ_ERR_SUCCESS +, "foo/bar", "foo"); + +146 + `no_m�ch_h��r +( +MOSQ_ERR_SUCCESS +, "foo/+", "foo/bar/baz"); + +147 + `no_m�ch_h��r +( +MOSQ_ERR_SUCCESS +, "foo/+/baz", "foo/bar/bar"); + +149 + `no_m�ch_h��r +( +MOSQ_ERR_SUCCESS +, "foo/+/#", "fo2/bar/baz"); + +151 + `no_m�ch_h��r +( +MOSQ_ERR_SUCCESS +, "/#", "foo/bar"); + +153 + `no_m�ch_h��r +( +MOSQ_ERR_SUCCESS +, "#", "$SYS/bar"); + +154 + `no_m�ch_h��r +( +MOSQ_ERR_SUCCESS +, "$BOB/bar", "$SYS/bar"); + +155 + } +} + +158 + $TEST_�v�id +() + +160 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "foo#", "foo"); + +161 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "fo#o/", "foo"); + +162 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "foo#", "fooa"); + +163 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "foo+", "foo"); + +164 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "foo/#a", "foo"); + +165 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "#a", "foo"); + +166 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "foo/#abc", "foo"); + +167 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "#abc", "foo"); + +168 + `no_m�ch_h��r +( +MOSQ_ERR_INVAL +, "/#a", "foo/bar"); + +169 + } +} + +175 + $pub_t�ic_h��r +(cڡ * +t�ic +, +rc_ex��ed +) + +177 +rc +; + +179 +rc + = + `mosqu�to_pub_t�ic_check +( +t�ic +); + +180 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +182 +rc + = + `mosqu�to_pub_t�ic_check2 +( +t�ic +, + `��� +(topic)); + +183 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +184 + } +} + +186 + $TEST_pub_t�ic_v�id +() + +188 + `pub_t�ic_h��r +("pub/t�ic", +MOSQ_ERR_SUCCESS +); + +189 + `pub_t�ic_h��r +("pub//t�ic", +MOSQ_ERR_SUCCESS +); + +190 + `pub_t�ic_h��r +("pub/ /t�ic", +MOSQ_ERR_SUCCESS +); + +191 + } +} + +193 + $TEST_pub_t�ic_�v�id +() + +195 + `pub_t�ic_h��r +("+pub/t�ic", +MOSQ_ERR_INVAL +); + +196 + `pub_t�ic_h��r +("pub+/t�ic", +MOSQ_ERR_INVAL +); + +197 + `pub_t�ic_h��r +("pub/+t�ic", +MOSQ_ERR_INVAL +); + +198 + `pub_t�ic_h��r +("pub/t�ic+", +MOSQ_ERR_INVAL +); + +199 + `pub_t�ic_h��r +("pub/t�ic/+", +MOSQ_ERR_INVAL +); + +200 + `pub_t�ic_h��r +("#pub/t�ic", +MOSQ_ERR_INVAL +); + +201 + `pub_t�ic_h��r +("pub#/t�ic", +MOSQ_ERR_INVAL +); + +202 + `pub_t�ic_h��r +("pub/#t�ic", +MOSQ_ERR_INVAL +); + +203 + `pub_t�ic_h��r +("pub/t�ic#", +MOSQ_ERR_INVAL +); + +204 + `pub_t�ic_h��r +("pub/t�ic/#", +MOSQ_ERR_INVAL +); + +205 + `pub_t�ic_h��r +("+/pub/t�ic", +MOSQ_ERR_INVAL +); + +206 + } +} + +213 + $sub_t�ic_h��r +(cڡ * +t�ic +, +rc_ex��ed +) + +215 +rc +; + +217 +rc + = + `mosqu�to_sub_t�ic_check +( +t�ic +); + +218 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +220 +rc + = + `mosqu�to_sub_t�ic_check2 +( +t�ic +, + `��� +(topic)); + +221 + `CU_ASSERT_EQUAL +( +rc +, +rc_ex��ed +); + +222 + } +} + +224 + $TEST_sub_t�ic_v�id +() + +226 + `sub_t�ic_h��r +("sub/t�ic", +MOSQ_ERR_SUCCESS +); + +227 + `sub_t�ic_h��r +("sub//t�ic", +MOSQ_ERR_SUCCESS +); + +228 + `sub_t�ic_h��r +("sub/ /t�ic", +MOSQ_ERR_SUCCESS +); + +229 + `sub_t�ic_h��r +("sub/+/t�ic", +MOSQ_ERR_SUCCESS +); + +230 + `sub_t�ic_h��r +("+/+/+", +MOSQ_ERR_SUCCESS +); + +231 + `sub_t�ic_h��r +("+", +MOSQ_ERR_SUCCESS +); + +232 + `sub_t�ic_h��r +("sub/t�ic/#", +MOSQ_ERR_SUCCESS +); + +233 + `sub_t�ic_h��r +("sub//t�ic/#", +MOSQ_ERR_SUCCESS +); + +234 + `sub_t�ic_h��r +("sub/ /t�ic/#", +MOSQ_ERR_SUCCESS +); + +235 + `sub_t�ic_h��r +("sub/+/t�ic/#", +MOSQ_ERR_SUCCESS +); + +236 + `sub_t�ic_h��r +("+/+/+/#", +MOSQ_ERR_SUCCESS +); + +237 + `sub_t�ic_h��r +("#", +MOSQ_ERR_SUCCESS +); + +238 + } +} + +240 + $TEST_sub_t�ic_�v�id +() + +242 + `sub_t�ic_h��r +("+sub/t�ic", +MOSQ_ERR_INVAL +); + +243 + `sub_t�ic_h��r +("sub+/t�ic", +MOSQ_ERR_INVAL +); + +244 + `sub_t�ic_h��r +("sub/+t�ic", +MOSQ_ERR_INVAL +); + +245 + `sub_t�ic_h��r +("sub/t�ic+", +MOSQ_ERR_INVAL +); + +246 + `sub_t�ic_h��r +("#sub/t�ic", +MOSQ_ERR_INVAL +); + +247 + `sub_t�ic_h��r +("sub#/t�ic", +MOSQ_ERR_INVAL +); + +248 + `sub_t�ic_h��r +("sub/#t�ic", +MOSQ_ERR_INVAL +); + +249 + `sub_t�ic_h��r +("sub/t�ic#", +MOSQ_ERR_INVAL +); + +250 + `sub_t�ic_h��r +("#/sub/t�ic", +MOSQ_ERR_INVAL +); + +251 + } +} + +257 + $��_ut�_t�ic_��s +() + +259 +CU_pSu�e + +��_su�e + = +NULL +; + +261 +��_su�e + = + `CU_add_su�e +("Ut���ic", +NULL +, NULL); + +262 if(! +��_su�e +){ + +263 + `��tf +("Error�dding CUnit util�opic�est suite.\n"); + +268 || ! + `CU_add_�� +( +��_su�e +, "M�ch�g: Em�y i�ut", +TEST_em�y_�put +) + +269 || ! + `CU_add_�� +( +��_su�e +, "M�ch�g: V�id m�ch�g", +TEST_v�id_m�ch�g +) + +270 || ! + `CU_add_�� +( +��_su�e +, "M�ch�g: V�id��m�ch�g", +TEST_v�id_no_m�ch�g +) + +271 || ! + `CU_add_�� +( +��_su�e +, "M�ch�g: Inv�id bu�m�ch�g", +TEST_�v�id_but_m�ch�g +) + +272 || ! + `CU_add_�� +( +��_su�e +, "M�ch�g: Inv�id", +TEST_�v�id +) + +273 || ! + `CU_add_�� +( +��_su�e +, "Pub��ic: V�id", +TEST_pub_t�ic_v�id +) + +274 || ! + `CU_add_�� +( +��_su�e +, "Pub��ic: Inv�id", +TEST_pub_t�ic_�v�id +) + +275 || ! + `CU_add_�� +( +��_su�e +, "Sub��ic: V�id", +TEST_sub_t�ic_v�id +) + +276 || ! + `CU_add_�� +( +��_su�e +, "Sub��ic: Inv�id", +TEST_sub_t�ic_�v�id +) + +279 + `��tf +("Error�dding util�opic CUnit�ests.\n"); + +284 + } +} + + @/usr/include/ares.h + +18 #i�de� +ARES__H + + +19 + #ARES__H + + + ) + +21 + ~"�es_v�si�.h +" + +22 + ~"�es_bu�d.h +" + +23 + ~"�es_ru�s.h +" + +29 #i�( +def�ed +( +_WIN32 +�|| def�ed( +__WIN32__ +)) && \ + +30 ! +def�ed +( +WIN32 +�&& ! + $def�ed +( +__SYMBIAN32__ +) + +31 + #WIN32 + + + ) + +34 + ~<sys/ty�s.h +> + +39 #i� + `def�ed +( +_AIX +�|| def�ed( +__NOVELL_LIBC__ +�|| def�ed( +__N�BSD__ +) || \ + +40 + `def�ed +( +__m�ix +�|| def�ed( +__SYMBIAN32__ +�|| def�ed( +__INTEGRITY +) || \ + +41 + `def�ed +( +ANDROID +�|| + $def�ed +( +__ANDROID__ +) + +42 + ~<sys/���.h +> + +44 #i�( + `def�ed +( +NETWARE +�&& !def�ed( +__NOVELL_LIBC__ +)) + +45 + ~<sys/bsdskt.h +> + +48 #i� + `def�ed +( +WATT32 +) + +49 + ~<�t��/�.h +> + +50 + ~<sys/sock�.h +> + +51 + ~<t�.h +> + +52 #�i� + `def�ed +( +_WIN32_WCE +) + +53 #i�de� +WIN32_LEAN_AND_MEAN + + +54 + #WIN32_LEAN_AND_MEAN + + + ) + +56 + ~<w�dows.h +> + +57 + ~<w�sock.h +> + +58 #�i� + `def�ed +( +WIN32 +) + +59 #i�de� +WIN32_LEAN_AND_MEAN + + +60 + #WIN32_LEAN_AND_MEAN + + + ) + +62 + ~<w�dows.h +> + +63 + ~<w�sock2.h +> + +64 + ~<ws2t��.h +> + +66 + ~<sys/sock�.h +> + +67 + ~<�t��/�.h +> + +70 #ifde� +__�lu�lus + + +78 #ifde� +CARES_STATICLIB + + +79 + #CARES_EXTERN + + + ) + +80 #�i� + `def�ed +( +WIN32 +�|| def�ed( +_WIN32 +�|| def�ed( +__SYMBIAN32__ +) + +81 #i� + `def�ed +( +CARES_BUILDING_LIBRARY +) + +82 + #CARES_EXTERN + + `__de��ec +( +d�exp�t +) + + ) + +84 + #CARES_EXTERN + + `__de��ec +( +d�imp�t +) + + ) + +86 #�i� + `def�ed +( +CARES_BUILDING_LIBRARY +�&& def�ed( +CARES_SYMBOL_HIDING +) + +87 + #CARES_EXTERN + +CARES_SYMBOL_SCOPE_EXTERN + + + ) + +89 + #CARES_EXTERN + + + ) + +93 + #ARES_SUCCESS + 0 + + ) + +96 + #ARES_ENODATA + 1 + + ) + +97 + #ARES_EFORMERR + 2 + + ) + +98 + #ARES_ESERVFAIL + 3 + + ) + +99 + #ARES_ENOTFOUND + 4 + + ) + +100 + #ARES_ENOTIMP + 5 + + ) + +101 + #ARES_EREFUSED + 6 + + ) + +104 + #ARES_EBADQUERY + 7 + + ) + +105 + #ARES_EBADNAME + 8 + + ) + +106 + #ARES_EBADFAMILY + 9 + + ) + +107 + #ARES_EBADRESP + 10 + + ) + +108 + #ARES_ECONNREFUSED + 11 + + ) + +109 + #ARES_ETIMEOUT + 12 + + ) + +110 + #ARES_EOF + 13 + + ) + +111 + #ARES_EFILE + 14 + + ) + +112 + #ARES_ENOMEM + 15 + + ) + +113 + #ARES_EDESTRUCTION + 16 + + ) + +114 + #ARES_EBADSTR + 17 + + ) + +117 + #ARES_EBADFLAGS + 18 + + ) + +120 + #ARES_ENONAME + 19 + + ) + +121 + #ARES_EBADHINTS + 20 + + ) + +124 + #ARES_ENOTINITIALIZED + 21 + + ) + +127 + #ARES_ELOADIPHLPAPI + 22 + + ) + +128 + #ARES_EADDRGETNETWORKPARAMS + 23 + + ) + +131 + #ARES_ECANCELLED + 24 + + ) + +134 + #ARES_FLAG_USEVC + (1 << 0) + + ) + +135 + #ARES_FLAG_PRIMARY + (1 << 1) + + ) + +136 + #ARES_FLAG_IGNTC + (1 << 2) + + ) + +137 + #ARES_FLAG_NORECURSE + (1 << 3) + + ) + +138 + #ARES_FLAG_STAYOPEN + (1 << 4) + + ) + +139 + #ARES_FLAG_NOSEARCH + (1 << 5) + + ) + +140 + #ARES_FLAG_NOALIASES + (1 << 6) + + ) + +141 + #ARES_FLAG_NOCHECKRESP + (1 << 7) + + ) + +142 + #ARES_FLAG_EDNS + (1 << 8) + + ) + +145 + #ARES_OPT_FLAGS + (1 << 0) + + ) + +146 + #ARES_OPT_TIMEOUT + (1 << 1) + + ) + +147 + #ARES_OPT_TRIES + (1 << 2) + + ) + +148 + #ARES_OPT_NDOTS + (1 << 3) + + ) + +149 + #ARES_OPT_UDP_PORT + (1 << 4) + + ) + +150 + #ARES_OPT_TCP_PORT + (1 << 5) + + ) + +151 + #ARES_OPT_SERVERS + (1 << 6) + + ) + +152 + #ARES_OPT_DOMAINS + (1 << 7) + + ) + +153 + #ARES_OPT_LOOKUPS + (1 << 8) + + ) + +154 + #ARES_OPT_SOCK_STATE_CB + (1 << 9) + + ) + +155 + #ARES_OPT_SORTLIST + (1 << 10) + + ) + +156 + #ARES_OPT_SOCK_SNDBUF + (1 << 11) + + ) + +157 + #ARES_OPT_SOCK_RCVBUF + (1 << 12) + + ) + +158 + #ARES_OPT_TIMEOUTMS + (1 << 13) + + ) + +159 + #ARES_OPT_ROTATE + (1 << 14) + + ) + +160 + #ARES_OPT_EDNSPSZ + (1 << 15) + + ) + +163 + #ARES_NI_NOFQDN + (1 << 0) + + ) + +164 + #ARES_NI_NUMERICHOST + (1 << 1) + + ) + +165 + #ARES_NI_NAMEREQD + (1 << 2) + + ) + +166 + #ARES_NI_NUMERICSERV + (1 << 3) + + ) + +167 + #ARES_NI_DGRAM + (1 << 4) + + ) + +168 + #ARES_NI_TCP + 0 + + ) + +169 + #ARES_NI_UDP + +ARES_NI_DGRAM + + + ) + +170 + #ARES_NI_SCTP + (1 << 5) + + ) + +171 + #ARES_NI_DCCP + (1 << 6) + + ) + +172 + #ARES_NI_NUMERICSCOPE + (1 << 7) + + ) + +173 + #ARES_NI_LOOKUPHOST + (1 << 8) + + ) + +174 + #ARES_NI_LOOKUPSERVICE + (1 << 9) + + ) + +176 + #ARES_NI_IDN + (1 << 10) + + ) + +177 + #ARES_NI_IDN_ALLOW_UNASSIGNED + (1 << 11) + + ) + +178 + #ARES_NI_IDN_USE_STD3_ASCII_RULES + (1 << 12) + + ) + +181 + #ARES_AI_CANONNAME + (1 << 0) + + ) + +182 + #ARES_AI_NUMERICHOST + (1 << 1) + + ) + +183 + #ARES_AI_PASSIVE + (1 << 2) + + ) + +184 + #ARES_AI_NUMERICSERV + (1 << 3) + + ) + +185 + #ARES_AI_V4MAPPED + (1 << 4) + + ) + +186 + #ARES_AI_ALL + (1 << 5) + + ) + +187 + #ARES_AI_ADDRCONFIG + (1 << 6) + + ) + +189 + #ARES_AI_IDN + (1 << 10) + + ) + +190 + #ARES_AI_IDN_ALLOW_UNASSIGNED + (1 << 11) + + ) + +191 + #ARES_AI_IDN_USE_STD3_ASCII_RULES + (1 << 12) + + ) + +192 + #ARES_AI_CANONIDN + (1 << 13) + + ) + +194 + #ARES_AI_MASK + ( +ARES_AI_CANONNAME +| +ARES_AI_NUMERICHOST +| +ARES_AI_PASSIVE +| \ + +195 +ARES_AI_NUMERICSERV +| +ARES_AI_V4MAPPED +| +ARES_AI_ALL +| \ + +196 +ARES_AI_ADDRCONFIG +) + + ) + +197 + #ARES_GETSOCK_MAXNUM + 16 + + ) + +199 + #ARES_GETSOCK_READABLE +( +b�s +, +num +�(b��& (1<< (num))) + + ) + +200 + #ARES_GETSOCK_WRITABLE +( +b�s +, +num +) (bits & (1 << ((num) + \ + +201 +ARES_GETSOCK_MAXNUM +))) + + ) + +204 + #ARES_LIB_INIT_NONE + (0) + + ) + +205 + #ARES_LIB_INIT_WIN32 + (1 << 0) + + ) + +206 + #ARES_LIB_INIT_ALL + ( +ARES_LIB_INIT_WIN32 +) + + ) + +213 #i�de� +�es_sock�_ty�def + + +214 #ifde� +WIN32 + + +215 +SOCKET + + t�es_sock�_t +; + +216 + #ARES_SOCKET_BAD + +INVALID_SOCKET + + + ) + +218 + t�es_sock�_t +; + +219 + #ARES_SOCKET_BAD + -1 + + ) + +221 + #�es_sock�_ty�def + + + ) + +224 (* + t�es_sock_��e_cb +)(* + td�a +, + +225 + t�es_sock�_t + + tsock�_fd +, + +226 + t�adab� +, + +227 + twr�ab� +); + +229 +���� +; + +248 + s�es_�ti�s + { + +249 +�ags +; + +250 +timeout +; + +251 +��s +; + +252 +nd�s +; + +253 +udp_p�t +; + +254 +t�_p�t +; + +255 +sock�_�nd_buf�r_size +; + +256 +sock�_��ive_buf�r_size +; + +257 +�_addr + * +�rv�s +; + +258 +n�rv�s +; + +259 ** +doma�s +; + +260 +ndoma�s +; + +261 * +lookups +; + +262 +�es_sock_��e_cb + +sock_��e_cb +; + +263 * +sock_��e_cb_d�a +; + +264 +���� + * +si� +; + +265 +ns�t +; + +266 +edn�sz +; + +269 +ho��t +; + +270 +timev� +; + +271 +sockaddr +; + +272 +�es_ch��ld�a +; + +274 +�es_ch��ld�a + * + t�es_ch��l +; + +276 (* + t�es_��back +)(* + t�g +, + +277 + t��us +, + +278 + ttimeouts +, + +279 * + tabuf +, + +280 + t�� +); + +282 (* + t�es_ho�_��back +)(* + t�g +, + +283 + t��us +, + +284 + ttimeouts +, + +285 + tho��t + *hostent); + +287 (* + t�es_�me�fo_��back +)(* + t�g +, + +288 + t��us +, + +289 + ttimeouts +, + +290 * + tnode +, + +291 * + t�rvi� +); + +293 (* + t�es_sock_���_��back +)( + t�es_sock�_t + + tsock�_fd +, + +294 + tty� +, + +295 * + td�a +); + +297 +CARES_EXTERN + + `�es_lib�ry_�� +( +�ags +); + +299 +CARES_EXTERN + + `�es_lib�ry_��nup +(); + +301 +CARES_EXTERN + cڡ * + `�es_v�si� +(* +v�si� +); + +303 +CARES_EXTERN + + `�es_�� +( +�es_ch��l + * +ch��͌ +); + +305 +CARES_EXTERN + + `�es_��_�ti�s +( +�es_ch��l + * +ch��͌ +, + +306 +�es_�ti�s + * +�ti�s +, + +307 +�tmask +); + +309 +CARES_EXTERN + + `�es_�ve_�ti�s +( +�es_ch��l + +ch��l +, + +310 +�es_�ti�s + * +�ti�s +, + +311 * +�tmask +); + +313 +CARES_EXTERN + + `�es_de�roy_�ti�s +( +�es_�ti�s + * +�ti�s +); + +315 +CARES_EXTERN + + `�es_dup +( +�es_ch��l + * +de� +, + +316 +�es_ch��l + +�c +); + +318 +CARES_EXTERN + + `�es_de�roy +( +�es_ch��l + +ch��l +); + +320 +CARES_EXTERN + + `�es_�n�l +( +�es_ch��l + +ch��l +); + +326 +CARES_EXTERN + + `�es_�t_lo�l_�4 +( +�es_ch��l + +ch��l +, +lo�l_� +); + +329 +CARES_EXTERN + + `�es_�t_lo�l_�6 +( +�es_ch��l + +ch��l +, + +330 cڡ * +lo�l_�6 +); + +333 +CARES_EXTERN + + `�es_�t_lo�l_dev +( +�es_ch��l + +ch��l +, + +334 cڡ * +lo�l_dev_�me +); + +336 +CARES_EXTERN + + `�es_�t_sock�_��back +( +�es_ch��l + +ch��l +, + +337 +�es_sock_���_��back + +��back +, + +338 * +u�r_d�a +); + +340 +CARES_EXTERN + + `�es_�nd +( +�es_ch��l + +ch��l +, + +341 cڡ * +qbuf +, + +342 +q�n +, + +343 +�es_��back + +��back +, + +344 * +�g +); + +346 +CARES_EXTERN + + `�es_qu�y +( +�es_ch��l + +ch��l +, + +347 cڡ * +�me +, + +348 +dns�ass +, + +349 +ty� +, + +350 +�es_��back + +��back +, + +351 * +�g +); + +353 +CARES_EXTERN + + `�es_��ch +( +�es_ch��l + +ch��l +, + +354 cڡ * +�me +, + +355 +dns�ass +, + +356 +ty� +, + +357 +�es_��back + +��back +, + +358 * +�g +); + +360 +CARES_EXTERN + + `�es_g�ho�by�me +( +�es_ch��l + +ch��l +, + +361 cڡ * +�me +, + +362 +�m�y +, + +363 +�es_ho�_��back + +��back +, + +364 * +�g +); + +366 +CARES_EXTERN + + `�es_g�ho�by�me_f�e +( +�es_ch��l + +ch��l +, + +367 cڡ * +�me +, + +368 +�m�y +, + +369 +ho��t + ** +ho� +); + +371 +CARES_EXTERN + + `�es_g�ho�byaddr +( +�es_ch��l + +ch��l +, + +372 cڡ * +addr +, + +373 +add�� +, + +374 +�m�y +, + +375 +�es_ho�_��back + +��back +, + +376 * +�g +); + +378 +CARES_EXTERN + + `�es_g��me�fo +( +�es_ch��l + +ch��l +, + +379 cڡ +sockaddr + * +� +, + +380 +�es_sock�n_t + +��n +, + +381 +�ags +, + +382 +�es_�me�fo_��back + +��back +, + +383 * +�g +); + +385 +CARES_EXTERN + + `�es_fds +( +�es_ch��l + +ch��l +, + +386 +fd_�t + * +�ad_fds +, + +387 +fd_�t + * +wr�e_fds +); + +389 +CARES_EXTERN + + `�es_g�sock +( +�es_ch��l + +ch��l +, + +390 +�es_sock�_t + * +socks +, + +391 +numsocks +); + +393 +CARES_EXTERN + +timev� + * + `�es_timeout +( +�es_ch��l + +ch��l +, + +394 +timev� + * +maxtv +, + +395 +timev� + * +tv +); + +397 +CARES_EXTERN + + `�es_�o�ss +( +�es_ch��l + +ch��l +, + +398 +fd_�t + * +�ad_fds +, + +399 +fd_�t + * +wr�e_fds +); + +401 +CARES_EXTERN + + `�es_�o�ss_fd +( +�es_ch��l + +ch��l +, + +402 +�es_sock�_t + +�ad_fd +, + +403 +�es_sock�_t + +wr�e_fd +); + +405 +CARES_EXTERN + + `�es_���_qu�y +(cڡ * +�me +, + +406 +dns�ass +, + +407 +ty� +, + +408 +id +, + +409 +rd +, + +410 ** +buf +, + +411 * +bu� +, + +412 +max_udp_size +); + +414 +CARES_EXTERN + + `�es_mkqu�y +(cڡ * +�me +, + +415 +dns�ass +, + +416 +ty� +, + +417 +id +, + +418 +rd +, + +419 ** +buf +, + +420 * +bu� +); + +422 +CARES_EXTERN + + `�es_ex�nd_�me +(cڡ * +�coded +, + +423 cڡ * +abuf +, + +424 +�� +, + +425 ** +s +, + +426 * +��� +); + +428 +CARES_EXTERN + + `�es_ex�nd_�r�g +(cڡ * +�coded +, + +429 cڡ * +abuf +, + +430 +�� +, + +431 ** +s +, + +432 * +��� +); + +441 + s�es_�6_addr + { + +443 +_S6_u8 +[16]; + +444 } +_S6_un +; + +447 + s�es_add�� + { + +448 +�_addr + +�addr +; + +449 +�l +; + +452 + s�es_addr6�l + { + +453 +�es_�6_addr + +�6addr +; + +454 +�l +; + +457 + s�es_�v_��y + { + +458 +�es_�v_��y + * +�xt +; + +459 * +ho� +; + +460 +�iܙy +; + +461 +weight +; + +462 +p�t +; + +465 + s�es_mx_��y + { + +466 +�es_mx_��y + * +�xt +; + +467 * +ho� +; + +468 +�iܙy +; + +471 + s�es_txt_��y + { + +472 +�es_txt_��y + * +�xt +; + +473 * +txt +; + +474 +size_t + +�ngth +; + +477 + s�es_DZr_��y + { + +478 +�es_DZr_��y + * +�xt +; + +479 * +�ags +; + +480 * +�rvi� +; + +481 * +�gexp +; + +482 * +��a�m�t +; + +483 +�d� +; + +484 +�e�n� +; + +487 + s�es_s�_��y + { + +488 * +n�ame +; + +489 * +ho�ma�� +; + +490 +�r�l +; + +491 +��esh +; + +492 +��y +; + +493 +exp�e +; + +494 +m��l +; + +505 +CARES_EXTERN + + `�es_�r�_a_��y +(cڡ * +abuf +, + +506 +�� +, + +507 +ho��t + ** +ho� +, + +508 +�es_add�� + * +add��s +, + +509 * +�dd��s +); + +511 +CARES_EXTERN + + `�es_�r�_��_��y +(cڡ * +abuf +, + +512 +�� +, + +513 +ho��t + ** +ho� +, + +514 +�es_addr6�l + * +add��s +, + +515 * +�dd��s +); + +517 +CARES_EXTERN + + `�es_�r�_�r_��y +(cڡ * +abuf +, + +518 +�� +, + +519 cڡ * +addr +, + +520 +add�� +, + +521 +�m�y +, + +522 +ho��t + ** +ho� +); + +524 +CARES_EXTERN + + `�es_�r�_ns_��y +(cڡ * +abuf +, + +525 +�� +, + +526 +ho��t + ** +ho� +); + +528 +CARES_EXTERN + + `�es_�r�_�v_��y +(cڡ * +abuf +, + +529 +�� +, + +530 +�es_�v_��y +** +�v_out +); + +532 +CARES_EXTERN + + `�es_�r�_mx_��y +(cڡ * +abuf +, + +533 +�� +, + +534 +�es_mx_��y +** +mx_out +); + +536 +CARES_EXTERN + + `�es_�r�_txt_��y +(cڡ * +abuf +, + +537 +�� +, + +538 +�es_txt_��y +** +txt_out +); + +540 +CARES_EXTERN + + `�es_�r�_DZr_��y +(cڡ * +abuf +, + +541 +�� +, + +542 +�es_DZr_��y +** +DZr_out +); + +544 +CARES_EXTERN + + `�es_�r�_s�_��y +(cڡ * +abuf +, + +545 +�� +, + +546 +�es_s�_��y +** +s�_out +); + +548 +CARES_EXTERN + + `�es_�_�r�g +(* +�r +); + +550 +CARES_EXTERN + + `�es_�_ho��t +( +ho��t + * +ho� +); + +552 +CARES_EXTERN + + `�es_�_d�a +(* +d��� +); + +554 +CARES_EXTERN + cڡ * + `�es_���� +( +code +); + +557 + s�es_addr_node + { + +558 +�es_addr_node + * +�xt +; + +559 +�m�y +; + +561 +�_addr + +addr4 +; + +562 +�es_�6_addr + +addr6 +; + +563 } +addr +; + +566 +CARES_EXTERN + + `�es_�t_�rv�s +( +�es_ch��l + +ch��l +, + +567 +�es_addr_node + * +�rv�s +); + +570 +CARES_EXTERN + + `�es_�t_�rv�s_csv +( +�es_ch��l + +ch��l +, + +571 cڡ * +�rv�s +); + +573 +CARES_EXTERN + + `�es_g�_�rv�s +( +�es_ch��l + +ch��l +, + +574 +�es_addr_node + ** +�rv�s +); + +576 +CARES_EXTERN + cڡ * + `�es_��_�� +( +af +, cڡ * +�c +, * +d� +, + +577 +�es_sock�n_t + +size +); + +579 +CARES_EXTERN + + `�es_��_�� +( +af +, cڡ * +�c +, * +d� +); + +582 #ifde� +__�lu�lus + + +583 + } +} + + @/usr/include/arpa/inet.h + +18 #i�de� +_ARPA_INET_H + + +19 + #_ARPA_INET_H + 1 + + ) + +21 + ~<�u�s.h +> + +22 + ~<�t��/�.h +> + +25 #i�de� +__sock�n_t_def�ed + + +26 +__sock�n_t + + tsock�n_t +; + +27 + #__sock�n_t_def�ed + + + ) + +30 +__BEGIN_DECLS + + +34 +�_addr_t + + $��_addr + (cڡ * +__� +� +__THROW +; + +37 +�_addr_t + + $��_�aof + ( +�_addr + +__� +� +__THROW +; + +41 +�_addr + + $��_mak�ddr + ( +�_addr_t + +__�t +, in_addr_� +__ho� +) + +42 +__THROW +; + +45 +�_addr_t + + $��_�tof + ( +�_addr + +__� +� +__THROW +; + +49 +�_addr_t + + $��_�tw�k + (cڡ * +__� +� +__THROW +; + +53 * + $��_�� + ( +�_addr + +__� +� +__THROW +; + +58 + $��_�� + ( +__af +, cڡ * +__��ri� + +__� +, + +59 * +__��ri� + +__buf +� +__THROW +; + +64 cڡ * + $��_�� + ( +__af +, cڡ * +__��ri� + +__� +, + +65 * +__��ri� + +__buf +, +sock�n_t + +__�n +) + +66 +__THROW +; + +70 #ifde� +__USE_MISC + + +73 + $��_�� + (cڡ * +__� +, +�_addr + * +__�p +� +__THROW +; + +77 * + $��_Ï + ( +�_addr_t + +__�t +, * +__buf +, +size_t + +__�n +� +__THROW +; + +82 * + $��_�t_�� + ( +__af +, cڡ * +__� +, +__b�s +, + +83 * +__buf +, +size_t + +__�n +� +__THROW +; + +88 + $��_�t_�� + ( +__af +, cڡ * +__� +, + +89 * +__buf +, +size_t + +__�n +� +__THROW +; + +94 + $��_n�p_addr + (cڡ * +__� +, + +95 * +__buf +, +__�n +� +__THROW +; + +99 * + $��_n�p_�� + ( +__�n +, cڡ * +__� +, + +100 * +__buf +� +__THROW +; + +103 +__END_DECLS + + + @/usr/include/arpa/nameser.h + +52 #i�de� +_ARPA_NAMESER_H_ + + +53 + #_ARPA_NAMESER_H_ + + + ) + +57 + #BIND_4_COMPAT + + + ) + +59 + ~<sys/��m.h +> + +60 #i�(! +def�ed +( +BSD +)) || (BSD < 199306) + +61 + ~<sys/b�y�s.h +> + +63 + ~<sys/ty�s.h +> + +65 + ~<sys/cdefs.h +> + +75 + #__NAMESER + 19991006 + + ) + +79 + #NS_PACKETSZ + 512 + + ) + +80 + #NS_MAXDNAME + 1025 + + ) + +81 + #NS_MAXMSG + 65535 + + ) + +82 + #NS_MAXCDNAME + 255 + + ) + +83 + #NS_MAXLABEL + 63 + + ) + +84 + #NS_HFIXEDSZ + 12 + + ) + +85 + #NS_QFIXEDSZ + 4 + + ) + +86 + #NS_RRFIXEDSZ + 10 + + ) + +87 + #NS_INT32SZ + 4 + + ) + +88 + #NS_INT16SZ + 2 + + ) + +89 + #NS_INT8SZ + 1 + + ) + +90 + #NS_INADDRSZ + 4 + + ) + +91 + #NS_IN6ADDRSZ + 16 + + ) + +92 + #NS_CMPRSFLGS + 0xc0 + + ) + +93 + #NS_DEFAULTPORT + 53 + + ) + +98 + e__ns_�� + { + +99 + mns_s_qd + = 0, + +100 + mns_s_zn + = 0, + +101 + mns_s_� + = 1, + +102 + mns_s_� + = 1, + +103 + mns_s_ns + = 2, + +104 + mns_s_ud + = 2, + +105 + mns_s_� + = 3, + +106 + mns_s_max + = 4 + +107 } + tns_�� +; + +114 + s__ns_msg + { + +115 cڡ +u_ch� + * + m_msg +, * + m_eom +; + +116 +u_�t16_t + + m_id +, + m_�ags +, + m_cou�s +[ +ns_s_max +]; + +117 cڡ +u_ch� + * + m_��i�s +[ +ns_s_max +]; + +118 +ns_�� + + m_�� +; + +119 + m_�num +; + +120 cڡ +u_ch� + * + m_msg_�r +; + +121 } + tns_msg +; + +124 + s_ns_�agd�a + { + mmask +, + mshi� +; }; + +125 cڡ +_ns_�agd�a + _ns_flagdata[]; + +129 + #ns_msg_id +( +h�d� +�((h�d�). +_id + + 0) + + ) + +130 + #ns_msg_ba� +( +h�d� +�((h�d�). +_msg + + 0) + + ) + +131 + #ns_msg_�d +( +h�d� +�((h�d�). +_eom + + 0) + + ) + +132 + #ns_msg_size +( +h�d� +�((h�d�). +_eom + - (h�d�). +_msg +) + + ) + +133 + #ns_msg_cou� +( +h�d� +, +��i� +�((h�d�). +_cou�s +[��i�] + 0) + + ) + +138 + s__ns_� + { + +139 + m�me +[ +NS_MAXDNAME +]; + +140 +u_�t16_t + + mty� +; + +141 +u_�t16_t + + m�_�ass +; + +142 +u_�t32_t + + m�l +; + +143 +u_�t16_t + + mrd�ngth +; + +144 cڡ +u_ch� + * + mrd�a +; + +145 } + tns_� +; + +148 + #ns_�_�me +( +� +�((�r). +�me +[0] !�'\0'�? (�).�m�: ".") + + ) + +149 + #ns_�_ty� +( +� +�(( +ns_ty� +)(�r). +ty� + + 0)) + + ) + +150 + #ns_�_�ass +( +� +�(( +ns_�ass +)(�r). +�_�ass + + 0)) + + ) + +151 + #ns_�_�l +( +� +�(�r). +�l + + 0) + + ) + +152 + #ns_�_rd�n +( +� +�(�r). +rd�ngth + + 0) + + ) + +153 + #ns_�_rd�a +( +� +�(�r). +rd�a + + 0) + + ) + +160 + e__ns_�ag + { + +161 + mns_f_qr +, + +162 + mns_f_�code +, + +163 + mns_f_� +, + +164 + mns_f_tc +, + +165 + mns_f_rd +, + +166 + mns_f_� +, + +167 + mns_f_z +, + +168 + mns_f_ad +, + +169 + mns_f_cd +, + +170 + mns_f_rcode +, + +171 + mns_f_max + + +172 } + tns_�ag +; + +177 + e__ns_�code + { + +178 + mns_o_qu�y + = 0, + +179 + mns_o_iqu�y + = 1, + +180 + mns_o_��us + = 2, + +182 + mns_o_n�ify + = 4, + +183 + mns_o_upd�e + = 5, + +184 + mns_o_max + = 6 + +185 } + tns_�code +; + +190 + e__ns_rcode + { + +191 + mns_r_nۼ� + = 0, + +192 + mns_r_f�m�r + = 1, + +193 + mns_r_�rv� + = 2, + +194 + mns_r_nxdoma� + = 3, + +195 + mns_r_n�im� + = 4, + +196 + mns_r_�fu�d + = 5, + +198 + mns_r_yxdoma� + = 6, + +199 + mns_r_yx��t + = 7, + +200 + mns_r_nx��t + = 8, + +201 + mns_r_n�auth + = 9, + +202 + mns_r_n�z�e + = 10, + +203 + mns_r_max + = 11, + +205 + mns_r_badv�s + = 16, + +207 + mns_r_badsig + = 16, + +208 + mns_r_badkey + = 17, + +209 + mns_r_badtime + = 18 + +210 } + tns_rcode +; + +213 + e__ns_upd�e_ݔ�i� + { + +214 + mns_u�_d��e + = 0, + +215 + mns_u�_add + = 1, + +216 + mns_u�_max + = 2 + +217 } + tns_upd�e_ݔ�i� +; + +222 + sns_tsig_key + { + +223 + m�me +[ +NS_MAXDNAME +], + m�g +[NS_MAXDNAME]; + +224 * + md�a +; + +225 + m�n +; + +227 +ns_tsig_key + + tns_tsig_key +; + +232 + sns_t�_tsig_��e + { + +233 + mcou�� +; + +234 +d�_key + * + mkey +; + +235 * + m�x +; + +236 + msig +[ +NS_PACKETSZ +]; + +237 + msig�n +; + +239 +ns_t�_tsig_��e + + tns_t�_tsig_��e +; + +241 + #NS_TSIG_FUDGE + 300 + + ) + +242 + #NS_TSIG_TCP_COUNT + 100 + + ) + +243 + #NS_TSIG_ALG_HMAC_MD5 + "HMAC-MD5.SIG-ALG.REG.INT" + + ) + +245 + #NS_TSIG_ERROR_NO_TSIG + -10 + + ) + +246 + #NS_TSIG_ERROR_NO_SPACE + -11 + + ) + +247 + #NS_TSIG_ERROR_FORMERR + -12 + + ) + +252 + e__ns_ty� + { + +253 + mns_t_�v�id + = 0, + +254 + mns_t_a + = 1, + +255 + mns_t_ns + = 2, + +256 + mns_t_md + = 3, + +257 + mns_t_mf + = 4, + +258 + mns_t_�ame + = 5, + +259 + mns_t_s� + = 6, + +260 + mns_t_mb + = 7, + +261 + mns_t_mg + = 8, + +262 + mns_t_mr + = 9, + +263 + mns_t_nu� + = 10, + +264 + mns_t_wks + = 11, + +265 + mns_t_�r + = 12, + +266 + mns_t_h�fo + = 13, + +267 + mns_t_m�fo + = 14, + +268 + mns_t_mx + = 15, + +269 + mns_t_txt + = 16, + +270 + mns_t_� + = 17, + +271 + mns_t_afsdb + = 18, + +272 + mns_t_x25 + = 19, + +273 + mns_t_isdn + = 20, + +274 + mns_t_� + = 21, + +275 + mns_t_n�p + = 22, + +276 + mns_t_n�p_�r + = 23, + +277 + mns_t_sig + = 24, + +278 + mns_t_key + = 25, + +279 + mns_t_px + = 26, + +280 + mns_t_gpos + = 27, + +281 + mns_t_�� + = 28, + +282 + mns_t_loc + = 29, + +283 + mns_t_nxt + = 30, + +284 + mns_t_eid + = 31, + +285 + mns_t_nimloc + = 32, + +286 + mns_t_�v + = 33, + +287 + mns_t_�ma + = 34, + +288 + mns_t_DZr + = 35, + +289 + mns_t_kx + = 36, + +290 + mns_t_�� + = 37, + +291 + mns_t_a6 + = 38, + +292 + mns_t_d�me + = 39, + +293 + mns_t_s�k + = 40, + +294 + mns_t_�t + = 41, + +295 + mns_t_�l + = 42, + +296 + mns_t_tkey + = 249, + +297 + mns_t_tsig + = 250, + +298 + mns_t_ix� + = 251, + +299 + mns_t_ax� + = 252, + +300 + mns_t_ma�b + = 253, + +301 + mns_t_ma�a + = 254, + +302 + mns_t_�y + = 255, + +303 + mns_t_zx� + = 256, + +304 + mns_t_max + = 65536 + +305 } + tns_ty� +; + +308 + #ns_t_qt_p +( +t +�( + `ns_t_x�_p +��|| (t�=� +ns_t_�y + || \ + +309 ( +t +�=� +ns_t_ma�b + || (t�=� +ns_t_ma�a +) + + ) + +311 + #ns_t_m�_p +( +t +�(��=� +ns_t_tsig + || (t�=� +ns_t_�t +) + + ) + +313 + #ns_t_�_p +( +t +�(! + `ns_t_qt_p +��&& ! + `ns_t_m�_p +�)) + + ) + +314 + #ns_t_udp_p +( +t +�(��!� +ns_t_ax� + && (t�!� +ns_t_zx� +) + + ) + +315 + #ns_t_x�_p +( +t +�(��=� +ns_t_ax� + || (t�=� +ns_t_ix� + || \ + +316 ( +t +�=� +ns_t_zx� +) + + ) + +321 + e__ns_�ass + { + +322 + mns_c_�v�id + = 0, + +323 + mns_c_� + = 1, + +324 + mns_c_2 + = 2, + +325 + mns_c_chaos + = 3, + +326 + mns_c_hs + = 4, + +328 + mns_c_n�e + = 254, + +329 + mns_c_�y + = 255, + +330 + mns_c_max + = 65536 + +331 } + tns_�ass +; + +335 + e__ns_key_ty�s + { + +336 + mns_kt_r� + = 1, + +337 + mns_kt_dh + = 2, + +338 + mns_kt_d� + = 3, + +339 + mns_kt_�iv�e + = 254 + +340 } + tns_key_ty�s +; + +342 + e__ns_��_ty�s + { + +343 + m��_t_pkix + = 1, + +344 + m��_t_�ki + = 2, + +345 + m��_t_pgp + = 3, + +346 + m��_t_u� + = 253, + +347 + m��_t_oid + = 254 + +348 } + tns_��_ty�s +; + +351 + #NS_KEY_TYPEMASK + 0xC000 + + ) + +352 + #NS_KEY_TYPE_AUTH_CONF + 0x0000 + + ) + +353 + #NS_KEY_TYPE_CONF_ONLY + 0x8000 + + ) + +354 + #NS_KEY_TYPE_AUTH_ONLY + 0x4000 + + ) + +355 + #NS_KEY_TYPE_NO_KEY + 0xC000 + + ) + +357 + #NS_KEY_NO_AUTH + 0x8000 + + ) + +358 + #NS_KEY_NO_CONF + 0x4000 + + ) + +359 + #NS_KEY_RESERVED2 + 0x2000 + + ) + +360 + #NS_KEY_EXTENDED_FLAGS + 0x1000 + + ) + +361 + #NS_KEY_RESERVED4 + 0x0800 + + ) + +362 + #NS_KEY_RESERVED5 + 0x0400 + + ) + +363 + #NS_KEY_NAME_TYPE + 0x0300 + + ) + +364 + #NS_KEY_NAME_USER + 0x0000 + + ) + +365 + #NS_KEY_NAME_ENTITY + 0x0200 + + ) + +366 + #NS_KEY_NAME_ZONE + 0x0100 + + ) + +367 + #NS_KEY_NAME_RESERVED + 0x0300 + + ) + +368 + #NS_KEY_RESERVED8 + 0x0080 + + ) + +369 + #NS_KEY_RESERVED9 + 0x0040 + + ) + +370 + #NS_KEY_RESERVED10 + 0x0020 + + ) + +371 + #NS_KEY_RESERVED11 + 0x0010 + + ) + +372 + #NS_KEY_SIGNATORYMASK + 0x000F + + ) + +373 + #NS_KEY_RESERVED_BITMASK + ( +NS_KEY_RESERVED2 + | \ + +374 +NS_KEY_RESERVED4 + | \ + +375 +NS_KEY_RESERVED5 + | \ + +376 +NS_KEY_RESERVED8 + | \ + +377 +NS_KEY_RESERVED9 + | \ + +378 +NS_KEY_RESERVED10 + | \ + +379 +NS_KEY_RESERVED11 + ) + + ) + +380 + #NS_KEY_RESERVED_BITMASK2 + 0xFFFF + + ) + +382 + #NS_ALG_MD5RSA + 1 + + ) + +383 + #NS_ALG_DH + 2 + + ) + +384 + #NS_ALG_DSA + 3 + + ) + +385 + #NS_ALG_DSS + +NS_ALG_DSA + + + ) + +386 + #NS_ALG_EXPIRE_ONLY + 253 + + ) + +387 + #NS_ALG_PRIVATE_OID + 254 + + ) + +390 + #NS_KEY_PROT_TLS + 1 + + ) + +391 + #NS_KEY_PROT_EMAIL + 2 + + ) + +392 + #NS_KEY_PROT_DNSSEC + 3 + + ) + +393 + #NS_KEY_PROT_IPSEC + 4 + + ) + +394 + #NS_KEY_PROT_ANY + 255 + + ) + +397 + #NS_MD5RSA_MIN_BITS + 512 + + ) + +398 + #NS_MD5RSA_MAX_BITS + 4096 + + ) + +400 + #NS_MD5RSA_MAX_BYTES + (( +NS_MD5RSA_MAX_BITS ++7/8)*2+3) + + ) + +402 + #NS_MD5RSA_MAX_BASE64 + ((( +NS_MD5RSA_MAX_BYTES ++2)/3)*4) + + ) + +403 + #NS_MD5RSA_MIN_SIZE + (( +NS_MD5RSA_MIN_BITS ++7)/8) + + ) + +404 + #NS_MD5RSA_MAX_SIZE + (( +NS_MD5RSA_MAX_BITS ++7)/8) + + ) + +406 + #NS_DSA_SIG_SIZE + 41 + + ) + +407 + #NS_DSA_MIN_SIZE + 213 + + ) + +408 + #NS_DSA_MAX_BYTES + 405 + + ) + +411 + #NS_SIG_TYPE + 0 + + ) + +412 + #NS_SIG_ALG + 2 + + ) + +413 + #NS_SIG_LABELS + 3 + + ) + +414 + #NS_SIG_OTTL + 4 + + ) + +415 + #NS_SIG_EXPIR + 8 + + ) + +416 + #NS_SIG_SIGNED + 12 + + ) + +417 + #NS_SIG_FOOT + 16 + + ) + +418 + #NS_SIG_SIGNER + 18 + + ) + +420 + #NS_NXT_BITS + 8 + + ) + +421 + #NS_NXT_BIT_SET +� +n +, +p +��[�)/ +NS_NXT_BITS +] |�(0x80>>(�)%NS_NXT_BITS))) + + ) + +422 + #NS_NXT_BIT_CLEAR +( +n +, +p +��[�)/ +NS_NXT_BITS +] &�~(0x80>>(�)%NS_NXT_BITS))) + + ) + +423 + #NS_NXT_BIT_ISSET +( +n +, +p +��[�)/ +NS_NXT_BITS +] & (0x80>>(�)%NS_NXT_BITS))) + + ) + +424 + #NS_NXT_MAX + 127 + + ) + +429 + #NS_OPT_DNSSEC_OK + 0x8000U + + ) + +430 + #NS_OPT_NSID + 3 + + ) + +435 + #NS_GET16 +( +s +, +� +) do { \ + +436 cڡ +u_ch� + * +t_� + = (cڡ u_ch� *)( +� +); \ + +437 ( +s +��(( +u_�t16_t +) +t_� +[0] << 8) \ + +438 | (( +u_�t16_t +) +t_� +[1]) \ + +440 ( +� +�+� +NS_INT16SZ +; \ + +441 } 0) + + ) + +443 + #NS_GET32 +( +l +, +� +) do { \ + +444 cڡ +u_ch� + * +t_� + = (cڡ u_ch� *)( +� +); \ + +445 ( +l +��(( +u_�t32_t +) +t_� +[0] << 24) \ + +446 | (( +u_�t32_t +) +t_� +[1] << 16) \ + +447 | (( +u_�t32_t +) +t_� +[2] << 8) \ + +448 | (( +u_�t32_t +) +t_� +[3]) \ + +450 ( +� +�+� +NS_INT32SZ +; \ + +451 } 0) + + ) + +453 + #NS_PUT16 +( +s +, +� +) do { \ + +454 +u_�t16_t + +t_s + = (u_�t16_t)( +s +); \ + +455 +u_ch� + * +t_� + = (u_ch� *)( +� +); \ + +456 * +t_� +++ = +t_s + >> 8; \ + +457 * +t_� + = +t_s +; \ + +458 ( +� +�+� +NS_INT16SZ +; \ + +459 } 0) + + ) + +461 + #NS_PUT32 +( +l +, +� +) do { \ + +462 +u_�t32_t + +t_l + = (u_�t32_t)( +l +); \ + +463 +u_ch� + * +t_� + = (u_ch� *)( +� +); \ + +464 * +t_� +++ = +t_l + >> 24; \ + +465 * +t_� +++ = +t_l + >> 16; \ + +466 * +t_� +++ = +t_l + >> 8; \ + +467 * +t_� + = +t_l +; \ + +468 ( +� +�+� +NS_INT32SZ +; \ + +469 } 0) + + ) + +471 +__BEGIN_DECLS + + +472 + $ns_msg_g��ag + ( +ns_msg +, � +__THROW +; + +473 +u_�t + + $ns_g�16 + (cڡ +u_ch� + *� +__THROW +; + +474 +u_l�g + + $ns_g�32 + (cڡ +u_ch� + *� +__THROW +; + +475 + $ns_put16 + ( +u_�t +, +u_ch� + *� +__THROW +; + +476 + $ns_put32 + ( +u_l�g +, +u_ch� + *� +__THROW +; + +477 + $ns_���r� + (cڡ +u_ch� + *, , +ns_msg + *� +__THROW +; + +478 + $ns_sk�� + (cڡ +u_ch� + *, cڡ u_ch� *, +ns_�� +, ) + +479 +__THROW +; + +480 + $ns_�r�� + ( +ns_msg + *, +ns_�� +, , +ns_� + *� +__THROW +; + +481 + $ns_�r��r + (cڡ +ns_msg + *, cڡ +ns_� + *, + +482 cڡ *, cڡ *, *, +size_t +) + +483 +__THROW +; + +484 + $ns_�r��rf + (cڡ +u_ch� + *, +size_t +, const *, + +485 +ns_�ass +, +ns_ty� +, +u_l�g +, cڡ +u_ch� + *, + +486 +size_t +, const *, const *, + +487 *, +size_t +� +__THROW +; + +488 + $ns_f�m�_�l + ( +u_l�g +, *, +size_t +� +__THROW +; + +489 + $ns_�r�_�l + (cڡ *, +u_l�g + *� +__THROW +; + +490 +u_�t32_t + + $ns_d��o�cs + (cڡ *, *� +__THROW +; + +491 + $ns_�me_�� + (cڡ +u_ch� + *, u_ch� *, +size_t +� +__THROW +; + +492 + $ns_�me_�� + (cڡ +u_ch� + *, *, +size_t +� +__THROW +; + +493 + $ns_�me_�� + (cڡ *, +u_ch� + *, +size_t +� +__THROW +; + +494 + $ns_�me_u�ack + (cڡ +u_ch� + *, const u_char *, + +495 cڡ +u_ch� + *, u_ch� *, +size_t +� +__THROW +; + +496 + $ns_�me_�ck + (cڡ +u_ch� + *, u_char *, , + +497 cڡ +u_ch� + **, cڡ u_ch� **� +__THROW +; + +498 + $ns_�me_uncom�ess + (cڡ +u_ch� + *, const u_char *, + +499 cڡ +u_ch� + *, *, +size_t +� +__THROW +; + +500 + $ns_�me_com�ess + (cڡ *, +u_ch� + *, +size_t +, + +501 cڡ +u_ch� + **, cڡ u_ch� **� +__THROW +; + +502 + $ns_�me_sk� + (cڡ +u_ch� + **, cڡ u_ch� *� +__THROW +; + +503 + $ns_�me_r�lback + (cڡ +u_ch� + *, const u_char **, + +504 cڡ +u_ch� + **� +__THROW +; + +505 + $ns_sign + ( +u_ch� + *, *, , , *, + +506 cڡ +u_ch� + *, , u_ch� *, *, +time_t +� +__THROW +; + +507 + $ns_sign2 + ( +u_ch� + *, *, , , *, + +508 cڡ +u_ch� + *, , u_ch� *, *, +time_t +, + +509 +u_ch� + **, u_ch� **� +__THROW +; + +510 + $ns_sign_t� + ( +u_ch� + *, *, , , + +511 +ns_t�_tsig_��e + *, � +__THROW +; + +512 + $ns_sign_t�2 + ( +u_ch� + *, *, , , + +513 +ns_t�_tsig_��e + *, , + +514 +u_ch� + **, u_ch� **� +__THROW +; + +515 + $ns_sign_t�_�� + (*, cڡ +u_ch� + *, , + +516 +ns_t�_tsig_��e + *� +__THROW +; + +517 +u_ch� + * + $ns_f�d_tsig + ( +u_ch� + *, u_ch� *� +__THROW +; + +518 + $ns_v�ify + ( +u_ch� + *, *, *, const u_char *, , + +519 +u_ch� + *, *, +time_t + *, � +__THROW +; + +520 + $ns_v�ify_t� + ( +u_ch� + *, *, +ns_t�_tsig_��e + *, ) + +521 +__THROW +; + +522 + $ns_v�ify_t�_�� + (*, cڡ +u_ch� + *, , + +523 +ns_t�_tsig_��e + *� +__THROW +; + +524 + $ns_�medoma� + (cڡ *, cڡ *� +__THROW +; + +525 + $ns_subdoma� + (cڡ *, cڡ *� +__THROW +; + +526 + $ns_make�n� + (cڡ *, *, +size_t +� +__THROW +; + +527 + $ns_�m�ame + (cڡ *, cڡ *� +__THROW +; + +528 +__END_DECLS + + +530 #ifde� +BIND_4_COMPAT + + +531 + ~<��/�me�r_com�t.h +> + + @/usr/include/assert.h + +22 #ifdef +_ASSERT_H + + +24 #unde� +_ASSERT_H + + +25 #unde� +as�� + + +26 #unde� +__ASSERT_VOID_CAST + + +28 #ifdef +__USE_GNU + + +29 #unde� +as��_��� + + +34 + #_ASSERT_H + 1 + + ) + +35 + ~<�u�s.h +> + +37 #i� +def�ed + +__�lu�lus + && +__GNUC_PREREQ + (2,95) + +38 + #__ASSERT_VOID_CAST + +��ic_�� +<> + + ) + +40 + #__ASSERT_VOID_CAST + () + + ) + +48 #ifdef +NDEBUG + + +50 + #as�� +( +ex� +�( + `__ASSERT_VOID_CAST + (0)) + + ) + +58 #ifdef +__USE_GNU + + +59 + #as��_��� +( +��um +�( + `__ASSERT_VOID_CAST + (0)) + + ) + +64 #i�de� +_ASSERT_H_DECLS + + +65 + #_ASSERT_H_DECLS + + + ) + +66 +__BEGIN_DECLS + + +69 + $__as��_� + (cڡ * +__as��i� +, cڡ * +__f�e +, + +70 +__l�e +, cڡ * +__fun�i� +) + +71 +__THROW + + `__��ibu�__ + (( +__nܑu�__ +)); + +74 + $__as��_���_� + ( +__��um +, cڡ * +__f�e +, + +75 +__l�e +, cڡ * +__fun�i� +) + +76 +__THROW + + `__��ibu�__ + (( +__nܑu�__ +)); + +81 + $__as�� + (cڡ * +__as��i� +, cڡ * +__f�e +, +__l�e +) + +82 +__THROW + + `__��ibu�__ + (( +__nܑu�__ +)); + +85 +__END_DECLS + + +88 + #as�� +( +ex� +) \ + +89 (( +ex� +) \ + +90 ? + `__ASSERT_VOID_CAST + (0) \ + +91 : + `__as��_� + ( + `__STRING +( +ex� +), +__FILE__ +, +__LINE__ +, +__ASSERT_FUNCTION +)) + + ) + +93 #ifdef +__USE_GNU + + +94 + #as��_��� +( +��um +) \ + +95 (!( +��um +) \ + +96 ? + `__ASSERT_VOID_CAST + (0) \ + +97 : + `__as��_���_� + (( +��um +), +__FILE__ +, +__LINE__ +, +__ASSERT_FUNCTION +)) + + ) + +105 #i� +def�ed + +__�lu�lus + ? + `__GNUC_PREREQ + (2, 6) : __GNUC_PREREQ (2, 4) + +106 + #__ASSERT_FUNCTION + +__PRETTY_FUNCTION__ + + + ) + +108 #i� +def�ed + +__STDC_VERSION__ + && __STDC_VERSION__ >= 199901L + +109 + #__ASSERT_FUNCTION + +__func__ + + + ) + +111 + #__ASSERT_FUNCTION + ((cڡ *�0) + + ) + +118 #i� +def�ed + +__USE_ISOC11 + && !def�ed +__�lu�lus + + +120 #unde� +��ic_as�� + + +121 + #��ic_as�� + +_S�tic_as�� + + + ) + + @/usr/include/ctype.h + +22 #i�def +_CTYPE_H + + +23 + #_CTYPE_H + 1 + + ) + +25 + ~<�u�s.h +> + +26 + ~<b�s/ty�s.h +> + +28 + g__BEGIN_DECLS + + +30 #i�de� +_ISb� + + +39 + ~<�d�n.h +> + +40 #i� +__BYTE_ORDER + =� +__BIG_ENDIAN + + +41 + #_ISb� +( +b� +�(1 << (b�)) + + ) + +43 + #_ISb� +( +b� +�((b��< 8 ? ((1 << (b�)�<< 8�: ((1 << (b�)�>> 8)) + + ) + +48 + m_ISu�� + = +_ISb� + (0), + +49 + m_ISlow� + = +_ISb� + (1), + +50 + m_IS�pha + = +_ISb� + (2), + +51 + m_ISdig� + = +_ISb� + (3), + +52 + m_ISxdig� + = +_ISb� + (4), + +53 + m_IS�a� + = +_ISb� + (5), + +54 + m_IS��t + = +_ISb� + (6), + +55 + m_ISg�ph + = +_ISb� + (7), + +56 + m_ISb�nk + = +_ISb� + (8), + +57 + m_IS��l + = +_ISb� + (9), + +58 + m_ISpun� + = +_ISb� + (10), + +59 + m_IS�num + = +_ISb� + (11) + +79 cڡ ** + $__�y�_b_loc + () + +80 +__THROW + + `__��ibu�__ + (( +__cڡ__ +)); + +81 cڡ +__�t32_t + ** + $__�y�_t�ow�_loc + () + +82 +__THROW + + `__��ibu�__ + (( +__cڡ__ +)); + +83 cڡ +__�t32_t + ** + $__�y�_tou��_loc + () + +84 +__THROW + + `__��ibu�__ + (( +__cڡ__ +)); + +87 #i�de� +__�lu�lus + + +88 + #__is�y� +( +c +, +ty� +) \ + +89 ((* + `__�y�_b_loc + ())[(�( +c +)] & (� +ty� +) + + ) + +90 #�i� +def�ed + +__USE_EXTERN_INLINES + + +91 + #__is�y�_f +( +ty� +) \ + +92 +__ex��_�l�e + \ + +93 +is +## + `ty� + ( +__c +� +__THROW + \ + +95 (* + `__�y�_b_loc + ())[(�( +__c +)] & (� +_IS +## +ty� +; \ + +96 + } + + ) +} + +99 + #__i�scii +( +c +�(((c�& ~0x7f�=�0� + + ) + +100 + #__t�scii +( +c +�((c�& 0x7f� + + ) + +102 + #__ex�y� +( +�me +� + `�me + (� +__THROW + + + ) + +104 +__BEGIN_NAMESPACE_STD + + +110 +__ex�y� + ( +i��um +); + +111 +__ex�y� + ( +i��ha +); + +112 +__ex�y� + ( +is��l +); + +113 +__ex�y� + ( +isdig� +); + +114 +__ex�y� + ( +i�ow� +); + +115 +__ex�y� + ( +isg�ph +); + +116 +__ex�y� + ( +i�r�t +); + +117 +__ex�y� + ( +i�un� +); + +118 +__ex�y� + ( +is�a� +); + +119 +__ex�y� + ( +isu�� +); + +120 +__ex�y� + ( +isxdig� +); + +124 + $t�ow� + ( +__c +� +__THROW +; + +127 + $tou�� + ( +__c +� +__THROW +; + +129 +__END_NAMESPACE_STD + + +133 #ifdef +__USE_ISOC99 + + +134 +__BEGIN_NAMESPACE_C99 + + +136 + `__ex�y� + ( +isb�nk +); + +138 +__END_NAMESPACE_C99 + + +141 #ifde� +__USE_GNU + + +143 + $is�y� + ( +__c +, +__mask +� +__THROW +; + +146 #i� +def�ed + +__USE_SVID + || def�ed +__USE_MISC + || def�ed +__USE_XOPEN + + +150 + $i�scii + ( +__c +� +__THROW +; + +154 + $t�scii + ( +__c +� +__THROW +; + +158 + `__ex�y� + ( +_tou�� +); + +159 + `__ex�y� + ( +_t�ow� +); + +163 + #__tobody +( +c +, +f +, +a +, +�gs +) \ + +164 ( +__ex�nsi�__ + \ + +165 ({ +__�s +; \ + +166 i�( ( +c +) > 1) \ + +168 i�( + `__bu�t�_cڡ�t_p + ( +c +)) \ + +170 +__c + = ( +c +); \ + +171 +__�s + = +__c + < -128 || __�> 255 ? __�: ( +a +)[__c]; \ + +174 +__�s + = +f + +�gs +; \ + +177 +__�s + = ( +a +)[(�( +c +)]; \ + +178 +__�s +; + } +})) + + ) + +180 #i�! +def�ed + +__NO_CTYPE + + +181 #ifde� +__is�y�_f + + +182 + $__is�y�_f + ( +�num +) + +183 + $__is�y�_f + ( +�pha +) + +184 + $__is�y�_f + ( +��l +) + +185 + $__is�y�_f + ( +dig� +) + +186 + $__is�y�_f + ( +low� +) + +187 + $__is�y�_f + ( +g�ph +) + +188 + $__is�y�_f + ( +��t +) + +189 + $__is�y�_f + ( +pun� +) + +190 + $__is�y�_f + ( +�a� +) + +191 + $__is�y�_f + ( +u�� +) + +192 + $__is�y�_f + ( +xdig� +) + +193 #ifde� +__USE_ISOC99 + + +194 + $__is�y�_f + ( +b�nk +) + +196 #�i� +def�ed + +__is�y� + + +197 + #i��um +( +c +� + `__is�y� +((c), +_IS�num +) + + ) + +198 + #i��ha +( +c +� + `__is�y� +((c), +_IS�pha +) + + ) + +199 + #is��l +( +c +� + `__is�y� +((c), +_IS��l +) + + ) + +200 + #isdig� +( +c +� + `__is�y� +((c), +_ISdig� +) + + ) + +201 + #i�ow� +( +c +� + `__is�y� +((c), +_ISlow� +) + + ) + +202 + #isg�ph +( +c +� + `__is�y� +((c), +_ISg�ph +) + + ) + +203 + #i�r�t +( +c +� + `__is�y� +((c), +_IS��t +) + + ) + +204 + #i�un� +( +c +� + `__is�y� +((c), +_ISpun� +) + + ) + +205 + #is�a� +( +c +� + `__is�y� +((c), +_IS�a� +) + + ) + +206 + #isu�� +( +c +� + `__is�y� +((c), +_ISu�� +) + + ) + +207 + #isxdig� +( +c +� + `__is�y� +((c), +_ISxdig� +) + + ) + +208 #ifde� +__USE_ISOC99 + + +209 + #isb�nk +( +c +� + `__is�y� +((c), +_ISb�nk +) + + ) + +213 #ifde� +__USE_EXTERN_INLINES + + +214 +__ex��_�l�e + + +215 + `__NTH + ( + $t�ow� + ( +__c +)) + +217 +__c + >�-128 && __�< 256 ? (* + `__�y�_t�ow�_loc + ())[__c] : __c; + +218 + } +} + +220 +__ex��_�l�e + + +221 +__NTH + ( + $tou�� + ( +__c +)) + +223 +__c + >�-128 && __�< 256 ? (* + `__�y�_tou��_loc + ())[__c] : __c; + +224 + } +} + +227 #i� +__GNUC__ + >�2 && +def�ed + +__OPTIMIZE__ + && !def�ed +__�lu�lus + + +228 + #t�ow� +( +c +� + `__tobody + (c, +t�ow� +, * + `__�y�_t�ow�_loc + (), (c)) + + ) + +229 + #tou�� +( +c +� + `__tobody + (c, +tou�� +, * + `__�y�_tou��_loc + (), (c)) + + ) + +232 #i� +def�ed + +__USE_SVID + || def�ed +__USE_MISC + || def�ed +__USE_XOPEN + + +233 + #i�scii +( +c +� + `__i�scii + (c) + + ) + +234 + #t�scii +( +c +� + `__t�scii + (c) + + ) + +236 + #_t�ow� +( +c +�((�(* + `__�y�_t�ow�_loc + ())[(�(c)]) + + ) + +237 + #_tou�� +( +c +�((�(* + `__�y�_tou��_loc + ())[(�(c)]) + + ) + +243 #ifde� +__USE_XOPEN2K8 + + +257 + ~<xlo��.h +> + +261 + #__is�y�_l +( +c +, +ty� +, +lo�� +) \ + +262 (( +lo�� +)-> +__�y�_b +[(�( +c +)] & (� +ty� +) + + ) + +264 + #__ex�y�_l +( +�me +) \ + +265 + `�me + (, +__lo��_t +� +__THROW + + + ) + +271 +__ex�y�_l + ( +i��um_l +); + +272 +__ex�y�_l + ( +i��ha_l +); + +273 +__ex�y�_l + ( +is��l_l +); + +274 +__ex�y�_l + ( +isdig�_l +); + +275 +__ex�y�_l + ( +i�ow�_l +); + +276 +__ex�y�_l + ( +isg�ph_l +); + +277 +__ex�y�_l + ( +i�r�t_l +); + +278 +__ex�y�_l + ( +i�un�_l +); + +279 +__ex�y�_l + ( +is�a�_l +); + +280 +__ex�y�_l + ( +isu��_l +); + +281 +__ex�y�_l + ( +isxdig�_l +); + +283 +__ex�y�_l + ( +isb�nk_l +); + +287 + $__t�ow�_l + ( +__c +, +__lo��_t + +__l +� +__THROW +; + +288 + $t�ow�_l + ( +__c +, +__lo��_t + +__l +� +__THROW +; + +291 + $__tou��_l + ( +__c +, +__lo��_t + +__l +� +__THROW +; + +292 + $tou��_l + ( +__c +, +__lo��_t + +__l +� +__THROW +; + +294 #i� +__GNUC__ + >�2 && +def�ed + +__OPTIMIZE__ + && !def�ed +__�lu�lus + + +295 + #__t�ow�_l +( +c +, +lo�� +) \ + +296 + `__tobody + ( +c +, +__t�ow�_l +, ( +lo�� +)-> +__�y�_t�ow� +, (c,�o��)) + + ) + +297 + #__tou��_l +( +c +, +lo�� +) \ + +298 + `__tobody + ( +c +, +__tou��_l +, ( +lo�� +)-> +__�y�_tou�� +, (c,�o��)) + + ) + +299 + #t�ow�_l +( +c +, +lo�� +� + `__t�ow�_l + ((c), (lo��)) + + ) + +300 + #tou��_l +( +c +, +lo�� +� + `__tou��_l + ((c), (lo��)) + + ) + +304 #i�de� +__NO_CTYPE + + +305 + #__i��um_l +( +c +, +l +� + `__is�y�_l +((c), +_IS�num +, (l)) + + ) + +306 + #__i��ha_l +( +c +, +l +� + `__is�y�_l +((c), +_IS�pha +, (l)) + + ) + +307 + #__is��l_l +( +c +, +l +� + `__is�y�_l +((c), +_IS��l +, (l)) + + ) + +308 + #__isdig�_l +( +c +, +l +� + `__is�y�_l +((c), +_ISdig� +, (l)) + + ) + +309 + #__i�ow�_l +( +c +, +l +� + `__is�y�_l +((c), +_ISlow� +, (l)) + + ) + +310 + #__isg�ph_l +( +c +, +l +� + `__is�y�_l +((c), +_ISg�ph +, (l)) + + ) + +311 + #__i�r�t_l +( +c +, +l +� + `__is�y�_l +((c), +_IS��t +, (l)) + + ) + +312 + #__i�un�_l +( +c +, +l +� + `__is�y�_l +((c), +_ISpun� +, (l)) + + ) + +313 + #__is�a�_l +( +c +, +l +� + `__is�y�_l +((c), +_IS�a� +, (l)) + + ) + +314 + #__isu��_l +( +c +, +l +� + `__is�y�_l +((c), +_ISu�� +, (l)) + + ) + +315 + #__isxdig�_l +( +c +, +l +� + `__is�y�_l +((c), +_ISxdig� +, (l)) + + ) + +317 + #__isb�nk_l +( +c +, +l +� + `__is�y�_l +((c), +_ISb�nk +, (l)) + + ) + +319 #i� +def�ed + +__USE_SVID + || def�ed +__USE_MISC + + +320 + #__i�scii_l +( +c +, +l +�(�), + `__i�scii + (c)) + + ) + +321 + #__t�scii_l +( +c +, +l +�(�), + `__t�scii + (c)) + + ) + +324 + #i��um_l +( +c +, +l +� + `__i��um_l + ((c), (l)) + + ) + +325 + #i��ha_l +( +c +, +l +� + `__i��ha_l + ((c), (l)) + + ) + +326 + #is��l_l +( +c +, +l +� + `__is��l_l + ((c), (l)) + + ) + +327 + #isdig�_l +( +c +, +l +� + `__isdig�_l + ((c), (l)) + + ) + +328 + #i�ow�_l +( +c +, +l +� + `__i�ow�_l + ((c), (l)) + + ) + +329 + #isg�ph_l +( +c +, +l +� + `__isg�ph_l + ((c), (l)) + + ) + +330 + #i�r�t_l +( +c +, +l +� + `__i�r�t_l + ((c), (l)) + + ) + +331 + #i�un�_l +( +c +, +l +� + `__i�un�_l + ((c), (l)) + + ) + +332 + #is�a�_l +( +c +, +l +� + `__is�a�_l + ((c), (l)) + + ) + +333 + #isu��_l +( +c +, +l +� + `__isu��_l + ((c), (l)) + + ) + +334 + #isxdig�_l +( +c +, +l +� + `__isxdig�_l + ((c), (l)) + + ) + +336 + #isb�nk_l +( +c +, +l +� + `__isb�nk_l + ((c), (l)) + + ) + +338 #i� +def�ed + +__USE_SVID + || def�ed +__USE_MISC + + +339 + #i�scii_l +( +c +, +l +� + `__i�scii_l + ((c), (l)) + + ) + +340 + #t�scii_l +( +c +, +l +� + `__t�scii_l + ((c), (l)) + + ) + +347 +__END_DECLS + + + @/usr/include/dirent.h + +22 #i�def +_DIRENT_H + + +23 + #_DIRENT_H + 1 + + ) + +25 + ~<�u�s.h +> + +27 + g__BEGIN_DECLS + + +29 + ~<b�s/ty�s.h +> + +31 #ifde� +__USE_XOPEN + + +32 #i�de� +__�o_t_def�ed + + +33 #i�de� +__USE_FILE_OFFSET64 + + +34 +__�o_t + + t�o_t +; + +36 +__�o64_t + + t�o_t +; + +38 + #__�o_t_def�ed + + + ) + +40 #i� +def�ed + +__USE_LARGEFILE64 + && !def�ed +__�o64_t_def�ed + + +41 +__�o64_t + + t�o64_t +; + +42 + #__�o64_t_def�ed + + + ) + +61 + ~<b�s/d��t.h +> + +63 #i�( +def�ed + +__USE_BSD + || def�ed +__USE_MISC +�&& !def�ed +d_f��o + + +64 + #d_�o + +d_f��o + + + ) + +81 #ifde� +_DIRENT_HAVE_D_NAMLEN + + +82 + #_D_EXACT_NAMLEN +( +d +�((d)-> +d_�m�n +) + + ) + +83 + #_D_ALLOC_NAMLEN +( +d +�( + `_D_EXACT_NAMLEN + (d�+ 1) + + ) + +85 + #_D_EXACT_NAMLEN +( +d +�( + `��� + ((d)-> +d_�me +)) + + ) + +86 #ifde� +_DIRENT_HAVE_D_RECLEN + + +87 + #_D_ALLOC_NAMLEN +( +d +�(((*�(d�+ (d)-> +d_��� +�- &(d)-> +d_�me +[0]) + + ) + +89 + #_D_ALLOC_NAMLEN +( +d +�( (d)-> +d_�me + > 1 ? (d)->d_name : \ + +90 + `_D_EXACT_NAMLEN + ( +d +�+ 1) + + ) + +95 #ifde� +__USE_BSD + + +99 + mDT_UNKNOWN + = 0, + +100 + #DT_UNKNOWN + +DT_UNKNOWN + + + ) + +101 + mDT_FIFO + = 1, + +102 + #DT_FIFO + +DT_FIFO + + + ) + +103 + mDT_CHR + = 2, + +104 + #DT_CHR + +DT_CHR + + + ) + +105 + mDT_DIR + = 4, + +106 + #DT_DIR + +DT_DIR + + + ) + +107 + mDT_BLK + = 6, + +108 + #DT_BLK + +DT_BLK + + + ) + +109 + mDT_REG + = 8, + +110 + #DT_REG + +DT_REG + + + ) + +111 + mDT_LNK + = 10, + +112 + #DT_LNK + +DT_LNK + + + ) + +113 + mDT_SOCK + = 12, + +114 + #DT_SOCK + +DT_SOCK + + + ) + +115 + mDT_WHT + = 14 + +116 + #DT_WHT + +DT_WHT + + + ) + +120 + #IFTODT +( +mode +�(((mode�& 0170000�>> 12) + + ) + +121 + #DTTOIF +( +d�ty� +�((d�ty��<< 12) + + ) + +127 +__d���am + + tDIR +; + +134 +DIR + * + $ݒd� + (cڡ * +__�me +� + `__n�nu� + ((1)); + +136 #ifde� +__USE_XOPEN2K8 + + +141 +DIR + * + `fdݒd� + ( +__fd +); + +149 + $�o�d� + ( +DIR + * +__d�p +� + `__n�nu� + ((1)); + +161 #i�de� +__USE_FILE_OFFSET64 + + +162 +d��t + * + $�add� + ( +DIR + * +__d�p +� + `__n�nu� + ((1)); + +164 #ifde� +__REDIRECT + + +165 +d��t + * + `__REDIRECT + ( +�add� +, ( +DIR + * +__d�p +), +�add�64 +) + +166 + `__n�nu� + ((1)); + +168 + #�add� + +�add�64 + + + ) + +172 #ifde� +__USE_LARGEFILE64 + + +173 +d��t64 + * + $�add�64 + ( +DIR + * +__d�p +� + `__n�nu� + ((1)); + +176 #i� +def�ed + +__USE_POSIX + || def�ed +__USE_MISC + + +182 #i�de� +__USE_FILE_OFFSET64 + + +183 + $�add�_r + ( +DIR + * +__��ri� + +__d�p +, + +184 +d��t + * +__��ri� + +__��y +, + +185 +d��t + ** +__��ri� + +__�su� +) + +186 + `__n�nu� + ((1, 2, 3)); + +188 #ifde� +__REDIRECT + + +189 + `__REDIRECT + ( +�add�_r +, + +190 ( +DIR + * +__��ri� + +__d�p +, + +191 +d��t + * +__��ri� + +__��y +, + +192 +d��t + ** +__��ri� + +__�su� +), + +193 +�add�64_r +� + `__n�nu� + ((1, 2, 3)); + +195 + #�add�_r + +�add�64_r + + + ) + +199 #ifde� +__USE_LARGEFILE64 + + +200 + $�add�64_r + ( +DIR + * +__��ri� + +__d�p +, + +201 +d��t64 + * +__��ri� + +__��y +, + +202 +d��t64 + ** +__��ri� + +__�su� +) + +203 + `__n�nu� + ((1, 2, 3)); + +208 + $�w�dd� + ( +DIR + * +__d�p +� +__THROW + + `__n�nu� + ((1)); + +210 #i� +def�ed + +__USE_BSD + || def�ed +__USE_MISC + || def�ed +__USE_XOPEN + + +211 + ~<b�s/ty�s.h +> + +214 + $�ekd� + ( +DIR + * +__d�p +, +__pos +� +__THROW + + `__n�nu� + ((1)); + +217 + $��d� + ( +DIR + * +__d�p +� +__THROW + + `__n�nu� + ((1)); + +220 #i� +def�ed + +__USE_BSD + || def�ed +__USE_MISC + || def�ed +__USE_XOPEN2K8 + + +223 + $d�fd + ( +DIR + * +__d�p +� +__THROW + + `__n�nu� + ((1)); + +225 #i� +def�ed + +__OPTIMIZE__ + && def�ed +_DIR_d�fd + + +226 + #d�fd +( +d�p +� + `_DIR_d�fd + (d�p) + + ) + +229 #i� +def�ed + +__USE_BSD + || def�ed +__USE_MISC + + +230 #i�de� +MAXNAMLEN + + +232 + ~<b�s/posix1_lim.h +> + +235 #ifde� +NAME_MAX + + +236 + #MAXNAMLEN + +NAME_MAX + + + ) + +238 + #MAXNAMLEN + 255 + + ) + +243 + #__�ed_size_t + + + ) + +244 + ~<�ddef.h +> + +253 #i�de� +__USE_FILE_OFFSET64 + + +254 + `s�nd� + (cڡ * +__��ri� + +__d� +, + +255 +d��t + *** +__��ri� + +__�m�i� +, + +256 (* +__���� +�(cڡ +d��t + *), + +257 (* +__cmp +�(cڡ +d��t + **, + +258 cڡ +d��t + **)) + +259 + `__n�nu� + ((1, 2)); + +261 #ifde� +__REDIRECT + + +262 + `__REDIRECT + ( +s�nd� +, + +263 (cڡ * +__��ri� + +__d� +, + +264 +d��t + *** +__��ri� + +__�m�i� +, + +265 (* +__���� +�(cڡ +d��t + *), + +266 (* +__cmp +�(cڡ +d��t + **, + +267 cڡ +d��t + **)), + +268 +s�nd�64 +� + `__n�nu� + ((1, 2)); + +270 + #s�nd� + +s�nd�64 + + + ) + +274 #i� +def�ed + +__USE_GNU + && def�ed +__USE_LARGEFILE64 + + +277 + `s�nd�64 + (cڡ * +__��ri� + +__d� +, + +278 +d��t64 + *** +__��ri� + +__�m�i� +, + +279 (* +__���� +�(cڡ +d��t64 + *), + +280 (* +__cmp +�(cڡ +d��t64 + **, + +281 cڡ +d��t64 + **)) + +282 + `__n�nu� + ((1, 2)); + +285 #ifde� +__USE_GNU + + +291 #i�de� +__USE_FILE_OFFSET64 + + +292 + `s�nd�� + ( +__dfd +, cڡ * +__��ri� + +__d� +, + +293 +d��t + *** +__��ri� + +__�m�i� +, + +294 (* +__���� +�(cڡ +d��t + *), + +295 (* +__cmp +�(cڡ +d��t + **, + +296 cڡ +d��t + **)) + +297 + `__n�nu� + ((2, 3)); + +299 #ifde� +__REDIRECT + + +300 + `__REDIRECT + ( +s�nd�� +, + +301 ( +__dfd +, cڡ * +__��ri� + +__d� +, + +302 +d��t + *** +__��ri� + +__�m�i� +, + +303 (* +__���� +�(cڡ +d��t + *), + +304 (* +__cmp +�(cڡ +d��t + **, + +305 cڡ +d��t + **)), + +306 +s�nd��64 +� + `__n�nu� + ((2, 3)); + +308 + #s�nd�� + +s�nd��64 + + + ) + +314 + `s�nd��64 + ( +__dfd +, cڡ * +__��ri� + +__d� +, + +315 +d��t64 + *** +__��ri� + +__�m�i� +, + +316 (* +__���� +�(cڡ +d��t64 + *), + +317 (* +__cmp +�(cڡ +d��t64 + **, + +318 cڡ +d��t64 + **)) + +319 + `__n�nu� + ((2, 3)); + +323 #i�de� +__USE_FILE_OFFSET64 + + +324 + $�phas�t + (cڡ +d��t + ** +__e1 +, + +325 cڡ +d��t + ** +__e2 +) + +326 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +328 #ifde� +__REDIRECT + + +329 + `__REDIRECT_NTH + ( +�phas�t +, + +330 (cڡ +d��t + ** +__e1 +, + +331 cڡ +d��t + ** +__e2 +), + +332 +�phas�t64 +� +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +334 + #�phas�t + +�phas�t64 + + + ) + +338 #i� +def�ed + +__USE_GNU + && def�ed +__USE_LARGEFILE64 + + +339 + $�phas�t64 + (cڡ +d��t64 + ** +__e1 +, + +340 cڡ +d��t64 + ** +__e2 +) + +341 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +346 #i� +def�ed + +__USE_BSD + || def�ed +__USE_MISC + + +351 #i�de� +__USE_FILE_OFFSET64 + + +352 +__ssize_t + + $g�d����s + ( +__fd +, * +__��ri� + +__buf +, + +353 +size_t + +__nby�s +, + +354 +__off_t + * +__��ri� + +__ba�p +) + +355 +__THROW + + `__n�nu� + ((2, 4)); + +357 #ifde� +__REDIRECT + + +358 +__ssize_t + + `__REDIRECT_NTH + ( +g�d����s +, + +359 ( +__fd +, * +__��ri� + +__buf +, + +360 +size_t + +__nby�s +, + +361 +__off64_t + * +__��ri� + +__ba�p +), + +362 +g�d����s64 +� + `__n�nu� + ((2, 4)); + +364 + #g�d����s + +g�d����s64 + + + ) + +368 #ifde� +__USE_LARGEFILE64 + + +369 +__ssize_t + + $g�d����s64 + ( +__fd +, * +__��ri� + +__buf +, + +370 +size_t + +__nby�s +, + +371 +__off64_t + * +__��ri� + +__ba�p +) + +372 +__THROW + + `__n�nu� + ((2, 4)); + +376 #ifde� +__USE_GNU + + +378 #i�de� +__USE_FILE_OFFSET64 + + +379 + $v�si�s�t + (cڡ +d��t + ** +__e1 +, + +380 cڡ +d��t + ** +__e2 +) + +381 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +383 #ifde� +__REDIRECT + + +384 + `__REDIRECT_NTH + ( +v�si�s�t +, + +385 (cڡ +d��t + ** +__e1 +, + +386 cڡ +d��t + ** +__e2 +), + +387 +v�si�s�t64 +) + +388 +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +390 + #v�si�s�t + +v�si�s�t64 + + + ) + +394 #ifde� +__USE_LARGEFILE64 + + +395 + $v�si�s�t64 + (cڡ +d��t64 + ** +__e1 +, + +396 cڡ +d��t64 + ** +__e2 +) + +397 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +401 +__END_DECLS + + + @/usr/include/dlfcn.h + +19 #i�def +_DLFCN_H + + +20 + #_DLFCN_H + 1 + + ) + +22 + ~<�u�s.h +> + +23 + #__�ed_size_t + + + ) + +24 + ~<�ddef.h +> + +27 + ~<b�s/dlf�.h +> + +30 #ifde� +__USE_GNU + + +35 + #RTLD_NEXT + ((*�-1l) + + ) + +40 + #RTLD_DEFAULT + ((*�0) + + ) + +44 + tLmid_t +; + +47 + #LM_ID_BASE + 0 + + ) + +48 + #LM_ID_NEWLM + -1 + + ) + +52 +__BEGIN_DECLS + + +56 * + $dlݒ + (cڡ * +__f�e +, +__mode +� +__THROWNL +; + +60 + $dl�o� + (* +__h�d� +� +__THROWNL + + `__n�nu� + ((1)); + +64 * + $dlsym + (* +__��ri� + +__h�d� +, + +65 cڡ * +__��ri� + +__�me +� +__THROW + + `__n�nu� + ((2)); + +67 #ifde� +__USE_GNU + + +69 * + $dlmݒ + ( +Lmid_t + +__nsid +, cڡ * +__f�e +, +__mode +� +__THROWNL +; + +73 * + $dlvsym + (* +__��ri� + +__h�d� +, + +74 cڡ * +__��ri� + +__�me +, + +75 cڡ * +__��ri� + +__v�si� +) + +76 +__THROW + + `__n�nu� + ((2, 3)); + +82 * + $d˼� + (� +__THROW +; + +85 #ifde� +__USE_GNU + + +90 cڡ * +dli_�ame +; + +91 * +dli_fba� +; + +92 cڡ * +dli_�ame +; + +93 * +dli_�ddr +; + +94 } + tDl_�fo +; + +98 + $d�ddr + (cڡ * +__add�ss +, +Dl_�fo + * +__�fo +) + +99 +__THROW + + `__n�nu� + ((2)); + +102 + $d�ddr1 + (cڡ * +__add�ss +, +Dl_�fo + * +__�fo +, + +103 ** +__ex�a_�fo +, +__�ags +� +__THROW + + `__n�nu� + ((2)); + +111 +RTLD_DL_SYMENT + = 1, + +114 +RTLD_DL_LINKMAP + = 2 + +123 + $dl�fo + (* +__��ri� + +__h�d� +, + +124 +__�que� +, * +__��ri� + +__�g +) + +125 +__THROW + + `__n�nu� + ((1, 3)); + +131 +RTLD_DI_LMID + = 1, + +135 +RTLD_DI_LINKMAP + = 2, + +137 +RTLD_DI_CONFIGADDR + = 3, + +144 +RTLD_DI_SERINFO + = 4, + +145 +RTLD_DI_SERINFOSIZE + = 5, + +149 +RTLD_DI_ORIGIN + = 6, + +151 +RTLD_DI_PROFILENAME + = 7, + +152 +RTLD_DI_PROFILEOUT + = 8, + +157 +RTLD_DI_TLS_MODID + = 9, + +163 +RTLD_DI_TLS_DATA + = 10, + +165 +RTLD_DI_MAX + = 10 + +173 * +dls_�me +; + +174 +dls_�ags +; + +175 } + tDl_���h +; + +181 +size_t + +dls_size +; + +182 +dls_�t +; + +183 +Dl_���h + +dls_���h +[1]; + +184 } + tDl_�r�fo +; + +188 +__END_DECLS + + + @/usr/include/errno.h + +22 #i�def +_ERRNO_H + + +26 #i�def +__�ed_Em�h + + +27 + #_ERRNO_H + 1 + + ) + +28 + ~<�u�s.h +> + +31 + g__BEGIN_DECLS + + +35 + ~<b�s/��o.h +> + +36 #unde� +__�ed_Em�h + + +38 #ifdef +_ERRNO_H + + +45 #i�def +��o + + +46 +��o +; + +49 #ifde� +__USE_GNU + + +54 * +�og�m_�vo�ti�_�me +, * +�og�m_�vo�ti�_sh�t_�me +; + +58 + g__END_DECLS + + +66 #i� +def�ed + +__USE_GNU + || def�ed +__�ed_�r�_t + + +67 #i�de� +__�r�_t_def�ed + + +68 + t�r�_t +; + +69 + #__�r�_t_def�ed + 1 + + ) + +71 #unde� +__�ed_�r�_t + + + @/usr/include/fcntl.h + +22 #i�def +_FCNTL_H + + +23 + #_FCNTL_H + 1 + + ) + +25 + ~<�u�s.h +> + +28 + g__BEGIN_DECLS + + +31 + ~<b�s/ty�s.h +> + +35 + ~<b�s/f��.h +> + +40 #i�de� +__mode_t_def�ed + + +41 +__mode_t + + tmode_t +; + +42 + #__mode_t_def�ed + + + ) + +45 #i�de� +__off_t_def�ed + + +46 #i�de� +__USE_FILE_OFFSET64 + + +47 +__off_t + + toff_t +; + +49 +__off64_t + + toff_t +; + +51 + #__off_t_def�ed + + + ) + +54 #i� +def�ed + +__USE_LARGEFILE64 + && !def�ed +__off64_t_def�ed + + +55 +__off64_t + + toff64_t +; + +56 + #__off64_t_def�ed + + + ) + +59 #i�de� +__pid_t_def�ed + + +60 +__pid_t + + tpid_t +; + +61 + #__pid_t_def�ed + + + ) + +65 #i� +def�ed + +__USE_XOPEN + || def�ed +__USE_XOPEN2K8 + + +66 + #__�ed_time�ec + + + ) + +67 + ~<time.h +> + +68 + ~<b�s/��.h +> + +70 + #S_IFMT + +__S_IFMT + + + ) + +71 + #S_IFDIR + +__S_IFDIR + + + ) + +72 + #S_IFCHR + +__S_IFCHR + + + ) + +73 + #S_IFBLK + +__S_IFBLK + + + ) + +74 + #S_IFREG + +__S_IFREG + + + ) + +75 #ifde� +__S_IFIFO + + +76 + #S_IFIFO + +__S_IFIFO + + + ) + +78 #ifde� +__S_IFLNK + + +79 + #S_IFLNK + +__S_IFLNK + + + ) + +81 #i�( +def�ed + +__USE_UNIX98 + || def�ed +__USE_XOPEN2K8 +�&& def�ed +__S_IFSOCK + + +82 + #S_IFSOCK + +__S_IFSOCK + + + ) + +87 + #S_ISUID + +__S_ISUID + + + ) + +88 + #S_ISGID + +__S_ISGID + + + ) + +90 #i� +def�ed + +__USE_BSD + || def�ed +__USE_MISC + || def�ed +__USE_XOPEN + + +92 + #S_ISVTX + +__S_ISVTX + + + ) + +95 + #S_IRUSR + +__S_IREAD + + + ) + +96 + #S_IWUSR + +__S_IWRITE + + + ) + +97 + #S_IXUSR + +__S_IEXEC + + + ) + +99 + #S_IRWXU + ( +__S_IREAD +| +__S_IWRITE +| +__S_IEXEC +) + + ) + +101 + #S_IRGRP + ( +S_IRUSR + >> 3� + + ) + +102 + #S_IWGRP + ( +S_IWUSR + >> 3� + + ) + +103 + #S_IXGRP + ( +S_IXUSR + >> 3� + + ) + +105 + #S_IRWXG + ( +S_IRWXU + >> 3) + + ) + +107 + #S_IROTH + ( +S_IRGRP + >> 3� + + ) + +108 + #S_IWOTH + ( +S_IWGRP + >> 3� + + ) + +109 + #S_IXOTH + ( +S_IXGRP + >> 3� + + ) + +111 + #S_IRWXO + ( +S_IRWXG + >> 3) + + ) + +114 #ifdef +__USE_MISC + + +115 #i�de� +R_OK + + +118 + #R_OK + 4 + + ) + +119 + #W_OK + 2 + + ) + +120 + #X_OK + 1 + + ) + +121 + #F_OK + 0 + + ) + +126 #i� +def�ed + +__USE_XOPEN + || def�ed +__USE_XOPEN2K8 + + +127 + #SEEK_SET + 0 + + ) + +128 + #SEEK_CUR + 1 + + ) + +129 + #SEEK_END + 2 + + ) + +137 +f�� + ( +__fd +, +__cmd +, ...); + +145 #i�de� +__USE_FILE_OFFSET64 + + +146 + $ݒ + (cڡ * +__f�e +, +__o�ag +, ...� + `__n�nu� + ((1)); + +148 #ifde� +__REDIRECT + + +149 + `__REDIRECT + ( +ݒ +, (cڡ * +__f�e +, +__o�ag +, ...), +ݒ64 +) + +150 + `__n�nu� + ((1)); + +152 + #ݒ + +ݒ64 + + + ) + +155 #ifde� +__USE_LARGEFILE64 + + +156 + $ݒ64 + (cڡ * +__f�e +, +__o�ag +, ...� + `__n�nu� + ((1)); + +159 #ifde� +__USE_ATFILE + + +169 #i�de� +__USE_FILE_OFFSET64 + + +170 + $ݒ� + ( +__fd +, cڡ * +__f�e +, +__o�ag +, ...) + +171 + `__n�nu� + ((2)); + +173 #ifde� +__REDIRECT + + +174 + `__REDIRECT + ( +ݒ� +, ( +__fd +, cڡ * +__f�e +, +__o�ag +, + +175 ...), +ݒ�64 +� + `__n�nu� + ((2)); + +177 + #ݒ� + +ݒ�64 + + + ) + +180 #ifde� +__USE_LARGEFILE64 + + +181 + $ݒ�64 + ( +__fd +, cڡ * +__f�e +, +__o�ag +, ...) + +182 + `__n�nu� + ((2)); + +191 #i�de� +__USE_FILE_OFFSET64 + + +192 + $��t + (cڡ * +__f�e +, +mode_t + +__mode +� + `__n�nu� + ((1)); + +194 #ifde� +__REDIRECT + + +195 + `__REDIRECT + ( +��t +, (cڡ * +__f�e +, +mode_t + +__mode +), + +196 +��t64 +� + `__n�nu� + ((1)); + +198 + #��t + +��t64 + + + ) + +201 #ifde� +__USE_LARGEFILE64 + + +202 + $��t64 + (cڡ * +__f�e +, +mode_t + +__mode +� + `__n�nu� + ((1)); + +205 #i�! +def�ed + +F_LOCK + && (def�ed +__USE_MISC + || (def�ed +__USE_XOPEN_EXTENDED + \ + +206 && ! +def�ed + +__USE_POSIX +)) + +215 + #F_ULOCK + 0 + + ) + +216 + #F_LOCK + 1 + + ) + +217 + #F_TLOCK + 2 + + ) + +218 + #F_TEST + 3 + + ) + +220 #i�de� +__USE_FILE_OFFSET64 + + +221 + `lockf + ( +__fd +, +__cmd +, +off_t + +__�n +); + +223 #ifde� +__REDIRECT + + +224 + `__REDIRECT + ( +lockf +, ( +__fd +, +__cmd +, +__off64_t + +__�n +), +lockf64 +); + +226 + #lockf + +lockf64 + + + ) + +229 #ifde� +__USE_LARGEFILE64 + + +230 + `lockf64 + ( +__fd +, +__cmd +, +off64_t + +__�n +); + +234 #ifde� +__USE_XOPEN2K + + +237 #i�de� +__USE_FILE_OFFSET64 + + +238 + $posix_�dvi� + ( +__fd +, +off_t + +__off�t +, off_� +__�n +, + +239 +__advi� +� +__THROW +; + +241 #ifde� +__REDIRECT_NTH + + +242 + `__REDIRECT_NTH + ( +posix_�dvi� +, ( +__fd +, +__off64_t + +__off�t +, + +243 +__off64_t + +__�n +, +__advi� +), + +244 +posix_�dvi�64 +); + +246 + #posix_�dvi� + +posix_�dvi�64 + + + ) + +249 #ifde� +__USE_LARGEFILE64 + + +250 + $posix_�dvi�64 + ( +__fd +, +off64_t + +__off�t +, off64_� +__�n +, + +251 +__advi� +� +__THROW +; + +259 #i�de� +__USE_FILE_OFFSET64 + + +260 + `posix_��o�� + ( +__fd +, +off_t + +__off�t +, off_� +__�n +); + +262 #ifde� +__REDIRECT + + +263 + `__REDIRECT + ( +posix_��o�� +, ( +__fd +, +__off64_t + +__off�t +, + +264 +__off64_t + +__�n +), + +265 +posix_��o��64 +); + +267 + #posix_��o�� + +posix_��o��64 + + + ) + +270 #ifde� +__USE_LARGEFILE64 + + +271 + `posix_��o��64 + ( +__fd +, +off64_t + +__off�t +, off64_� +__�n +); + +277 #i� +__USE_FORTIFY_LEVEL + > 0 && +def�ed + +__f�tify_fun�i� + \ + +278 && +def�ed + +__va_�g_�ck_�n + + +279 + ~<b�s/f��2.h +> + +282 +__END_DECLS + + + @/usr/include/grp.h + +22 #i�def +_GRP_H + + +23 + #_GRP_H + 1 + + ) + +25 + ~<�u�s.h +> + +27 + g__BEGIN_DECLS + + +29 + ~<b�s/ty�s.h +> + +31 + #__�ed_size_t + + + ) + +32 + ~<�ddef.h +> + +36 #i�( +def�ed + +__USE_XOPEN + || def�ed +__USE_XOPEN2K +�&& !def�ed +__gid_t_def�ed + + +37 +__gid_t + + tgid_t +; + +38 + #__gid_t_def�ed + + + ) + +42 + sgroup + + +44 * + mgr_�me +; + +45 * + mgr_�sswd +; + +46 +__gid_t + + mgr_gid +; + +47 ** + mgr_mem +; + +51 #i� +def�ed + +__USE_SVID + || def�ed +__USE_GNU + + +52 + #__�ed_FILE + + + ) + +53 + ~<�dio.h +> + +57 #i� +def�ed + +__USE_SVID + || def�ed +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + + +62 +�tg�� + (); + +65 #i� +def�ed + +__USE_SVID + || def�ed +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + \ + +66 || +def�ed + +__USE_XOPEN2K8 + + +71 +�dg�� + (); + +77 +group + * +g�g�� + (); + +80 #ifdef +__USE_SVID + + +87 +group + * +fg�g�� + ( +FILE + * +__��am +); + +90 #ifde� +__USE_GNU + + +97 +putg�� + (cڡ +group + * +__��ri� + +__p +, + +98 +FILE + * +__��ri� + +__f +); + +105 +group + * +g�grgid + ( +__gid_t + +__gid +); + +111 +group + * +g�g�am + (cڡ * +__�me +); + +113 #i� +def�ed + +__USE_POSIX + || def�ed +__USE_MISC + + +115 #ifde� +__USE_MISC + + +118 + #NSS_BUFLEN_GROUP + 1024 + + ) + +134 #ifde� +__USE_GNU + + +135 +g�g��_r + ( +group + * +__��ri� + +__�su�buf +, + +136 * +__��ri� + +__buf�r +, +size_t + +__bu� +, + +137 +group + ** +__��ri� + +__�su� +); + +144 +g�grgid_r + ( +__gid_t + +__gid +, +group + * +__��ri� + +__�su�buf +, + +145 * +__��ri� + +__buf�r +, +size_t + +__bu� +, + +146 +group + ** +__��ri� + +__�su� +); + +152 +g�g�am_r + (cڡ * +__��ri� + +__�me +, + +153 +group + * +__��ri� + +__�su�buf +, + +154 * +__��ri� + +__buf�r +, +size_t + +__bu� +, + +155 +group + ** +__��ri� + +__�su� +); + +157 #ifdef +__USE_SVID + + +165 +fg�g��_r + ( +FILE + * +__��ri� + +__��am +, + +166 +group + * +__��ri� + +__�su�buf +, + +167 * +__��ri� + +__buf�r +, +size_t + +__bu� +, + +168 +group + ** +__��ri� + +__�su� +); + +174 #ifdef +__USE_BSD + + +176 + #__�ed_size_t + + + ) + +177 + ~<�ddef.h +> + +180 + $�tgroups + ( +size_t + +__n +, cڡ +__gid_t + * +__groups +� +__THROW +; + +190 + `g�grou�i� + (cڡ * +__u�r +, +__gid_t + +__group +, + +191 +__gid_t + * +__groups +, * +__ngroups +); + +201 + `��groups + (cڡ * +__u�r +, +__gid_t + +__group +); + +205 +__END_DECLS + + + @/usr/include/inttypes.h + +22 #i�de� +_INTTYPES_H + + +23 + #_INTTYPES_H + 1 + + ) + +25 + ~<�u�s.h +> + +27 + ~<�d�t.h +> + +30 #i�de� +____gwch�_t_def�ed + + +31 #ifde� +__�lu�lus + + +32 + #__gwch�_t + +wch�_t + + + ) + +33 #�i� +def�ed + +__WCHAR_TYPE__ + + +34 +__WCHAR_TYPE__ + + t__gwch�_t +; + +36 + #__�ed_wch�_t + + + ) + +37 + ~<�ddef.h +> + +38 +wch�_t + + t__gwch�_t +; + +40 + #____gwch�_t_def�ed + 1 + + ) + +43 #i� +__WORDSIZE + == 64 + +44 + #__PRI64_PREFIX + "l" + + ) + +45 + #__PRIPTR_PREFIX + "l" + + ) + +47 + #__PRI64_PREFIX + "�" + + ) + +48 + #__PRIPTR_PREFIX + + + ) + +54 + #PRId8 + "d" + + ) + +55 + #PRId16 + "d" + + ) + +56 + #PRId32 + "d" + + ) + +57 + #PRId64 + +__PRI64_PREFIX + "d" + + ) + +59 + #PRIdLEAST8 + "d" + + ) + +60 + #PRIdLEAST16 + "d" + + ) + +61 + #PRIdLEAST32 + "d" + + ) + +62 + #PRIdLEAST64 + +__PRI64_PREFIX + "d" + + ) + +64 + #PRIdFAST8 + "d" + + ) + +65 + #PRIdFAST16 + +__PRIPTR_PREFIX + "d" + + ) + +66 + #PRIdFAST32 + +__PRIPTR_PREFIX + "d" + + ) + +67 + #PRIdFAST64 + +__PRI64_PREFIX + "d" + + ) + +70 + #PRIi8 + "i" + + ) + +71 + #PRIi16 + "i" + + ) + +72 + #PRIi32 + "i" + + ) + +73 + #PRIi64 + +__PRI64_PREFIX + "i" + + ) + +75 + #PRIiLEAST8 + "i" + + ) + +76 + #PRIiLEAST16 + "i" + + ) + +77 + #PRIiLEAST32 + "i" + + ) + +78 + #PRIiLEAST64 + +__PRI64_PREFIX + "i" + + ) + +80 + #PRIiFAST8 + "i" + + ) + +81 + #PRIiFAST16 + +__PRIPTR_PREFIX + "i" + + ) + +82 + #PRIiFAST32 + +__PRIPTR_PREFIX + "i" + + ) + +83 + #PRIiFAST64 + +__PRI64_PREFIX + "i" + + ) + +86 + #PRIo8 + "o" + + ) + +87 + #PRIo16 + "o" + + ) + +88 + #PRIo32 + "o" + + ) + +89 + #PRIo64 + +__PRI64_PREFIX + "o" + + ) + +91 + #PRIoLEAST8 + "o" + + ) + +92 + #PRIoLEAST16 + "o" + + ) + +93 + #PRIoLEAST32 + "o" + + ) + +94 + #PRIoLEAST64 + +__PRI64_PREFIX + "o" + + ) + +96 + #PRIoFAST8 + "o" + + ) + +97 + #PRIoFAST16 + +__PRIPTR_PREFIX + "o" + + ) + +98 + #PRIoFAST32 + +__PRIPTR_PREFIX + "o" + + ) + +99 + #PRIoFAST64 + +__PRI64_PREFIX + "o" + + ) + +102 + #PRIu8 + "u" + + ) + +103 + #PRIu16 + "u" + + ) + +104 + #PRIu32 + "u" + + ) + +105 + #PRIu64 + +__PRI64_PREFIX + "u" + + ) + +107 + #PRIuLEAST8 + "u" + + ) + +108 + #PRIuLEAST16 + "u" + + ) + +109 + #PRIuLEAST32 + "u" + + ) + +110 + #PRIuLEAST64 + +__PRI64_PREFIX + "u" + + ) + +112 + #PRIuFAST8 + "u" + + ) + +113 + #PRIuFAST16 + +__PRIPTR_PREFIX + "u" + + ) + +114 + #PRIuFAST32 + +__PRIPTR_PREFIX + "u" + + ) + +115 + #PRIuFAST64 + +__PRI64_PREFIX + "u" + + ) + +118 + #PRIx8 + "x" + + ) + +119 + #PRIx16 + "x" + + ) + +120 + #PRIx32 + "x" + + ) + +121 + #PRIx64 + +__PRI64_PREFIX + "x" + + ) + +123 + #PRIxLEAST8 + "x" + + ) + +124 + #PRIxLEAST16 + "x" + + ) + +125 + #PRIxLEAST32 + "x" + + ) + +126 + #PRIxLEAST64 + +__PRI64_PREFIX + "x" + + ) + +128 + #PRIxFAST8 + "x" + + ) + +129 + #PRIxFAST16 + +__PRIPTR_PREFIX + "x" + + ) + +130 + #PRIxFAST32 + +__PRIPTR_PREFIX + "x" + + ) + +131 + #PRIxFAST64 + +__PRI64_PREFIX + "x" + + ) + +134 + #PRIX8 + "X" + + ) + +135 + #PRIX16 + "X" + + ) + +136 + #PRIX32 + "X" + + ) + +137 + #PRIX64 + +__PRI64_PREFIX + "X" + + ) + +139 + #PRIXLEAST8 + "X" + + ) + +140 + #PRIXLEAST16 + "X" + + ) + +141 + #PRIXLEAST32 + "X" + + ) + +142 + #PRIXLEAST64 + +__PRI64_PREFIX + "X" + + ) + +144 + #PRIXFAST8 + "X" + + ) + +145 + #PRIXFAST16 + +__PRIPTR_PREFIX + "X" + + ) + +146 + #PRIXFAST32 + +__PRIPTR_PREFIX + "X" + + ) + +147 + #PRIXFAST64 + +__PRI64_PREFIX + "X" + + ) + +151 + #PRIdMAX + +__PRI64_PREFIX + "d" + + ) + +152 + #PRIiMAX + +__PRI64_PREFIX + "i" + + ) + +153 + #PRIoMAX + +__PRI64_PREFIX + "o" + + ) + +154 + #PRIuMAX + +__PRI64_PREFIX + "u" + + ) + +155 + #PRIxMAX + +__PRI64_PREFIX + "x" + + ) + +156 + #PRIXMAX + +__PRI64_PREFIX + "X" + + ) + +160 + #PRIdPTR + +__PRIPTR_PREFIX + "d" + + ) + +161 + #PRIiPTR + +__PRIPTR_PREFIX + "i" + + ) + +162 + #PRIoPTR + +__PRIPTR_PREFIX + "o" + + ) + +163 + #PRIuPTR + +__PRIPTR_PREFIX + "u" + + ) + +164 + #PRIxPTR + +__PRIPTR_PREFIX + "x" + + ) + +165 + #PRIXPTR + +__PRIPTR_PREFIX + "X" + + ) + +171 + #SCNd8 + "hhd" + + ) + +172 + #SCNd16 + "hd" + + ) + +173 + #SCNd32 + "d" + + ) + +174 + #SCNd64 + +__PRI64_PREFIX + "d" + + ) + +176 + #SCNdLEAST8 + "hhd" + + ) + +177 + #SCNdLEAST16 + "hd" + + ) + +178 + #SCNdLEAST32 + "d" + + ) + +179 + #SCNdLEAST64 + +__PRI64_PREFIX + "d" + + ) + +181 + #SCNdFAST8 + "hhd" + + ) + +182 + #SCNdFAST16 + +__PRIPTR_PREFIX + "d" + + ) + +183 + #SCNdFAST32 + +__PRIPTR_PREFIX + "d" + + ) + +184 + #SCNdFAST64 + +__PRI64_PREFIX + "d" + + ) + +187 + #SCNi8 + "hhi" + + ) + +188 + #SCNi16 + "hi" + + ) + +189 + #SCNi32 + "i" + + ) + +190 + #SCNi64 + +__PRI64_PREFIX + "i" + + ) + +192 + #SCNiLEAST8 + "hhi" + + ) + +193 + #SCNiLEAST16 + "hi" + + ) + +194 + #SCNiLEAST32 + "i" + + ) + +195 + #SCNiLEAST64 + +__PRI64_PREFIX + "i" + + ) + +197 + #SCNiFAST8 + "hhi" + + ) + +198 + #SCNiFAST16 + +__PRIPTR_PREFIX + "i" + + ) + +199 + #SCNiFAST32 + +__PRIPTR_PREFIX + "i" + + ) + +200 + #SCNiFAST64 + +__PRI64_PREFIX + "i" + + ) + +203 + #SCNu8 + "hhu" + + ) + +204 + #SCNu16 + "hu" + + ) + +205 + #SCNu32 + "u" + + ) + +206 + #SCNu64 + +__PRI64_PREFIX + "u" + + ) + +208 + #SCNuLEAST8 + "hhu" + + ) + +209 + #SCNuLEAST16 + "hu" + + ) + +210 + #SCNuLEAST32 + "u" + + ) + +211 + #SCNuLEAST64 + +__PRI64_PREFIX + "u" + + ) + +213 + #SCNuFAST8 + "hhu" + + ) + +214 + #SCNuFAST16 + +__PRIPTR_PREFIX + "u" + + ) + +215 + #SCNuFAST32 + +__PRIPTR_PREFIX + "u" + + ) + +216 + #SCNuFAST64 + +__PRI64_PREFIX + "u" + + ) + +219 + #SCNo8 + "hho" + + ) + +220 + #SCNo16 + "ho" + + ) + +221 + #SCNo32 + "o" + + ) + +222 + #SCNo64 + +__PRI64_PREFIX + "o" + + ) + +224 + #SCNoLEAST8 + "hho" + + ) + +225 + #SCNoLEAST16 + "ho" + + ) + +226 + #SCNoLEAST32 + "o" + + ) + +227 + #SCNoLEAST64 + +__PRI64_PREFIX + "o" + + ) + +229 + #SCNoFAST8 + "hho" + + ) + +230 + #SCNoFAST16 + +__PRIPTR_PREFIX + "o" + + ) + +231 + #SCNoFAST32 + +__PRIPTR_PREFIX + "o" + + ) + +232 + #SCNoFAST64 + +__PRI64_PREFIX + "o" + + ) + +235 + #SCNx8 + "hhx" + + ) + +236 + #SCNx16 + "hx" + + ) + +237 + #SCNx32 + "x" + + ) + +238 + #SCNx64 + +__PRI64_PREFIX + "x" + + ) + +240 + #SCNxLEAST8 + "hhx" + + ) + +241 + #SCNxLEAST16 + "hx" + + ) + +242 + #SCNxLEAST32 + "x" + + ) + +243 + #SCNxLEAST64 + +__PRI64_PREFIX + "x" + + ) + +245 + #SCNxFAST8 + "hhx" + + ) + +246 + #SCNxFAST16 + +__PRIPTR_PREFIX + "x" + + ) + +247 + #SCNxFAST32 + +__PRIPTR_PREFIX + "x" + + ) + +248 + #SCNxFAST64 + +__PRI64_PREFIX + "x" + + ) + +252 + #SCNdMAX + +__PRI64_PREFIX + "d" + + ) + +253 + #SCNiMAX + +__PRI64_PREFIX + "i" + + ) + +254 + #SCNoMAX + +__PRI64_PREFIX + "o" + + ) + +255 + #SCNuMAX + +__PRI64_PREFIX + "u" + + ) + +256 + #SCNxMAX + +__PRI64_PREFIX + "x" + + ) + +259 + #SCNdPTR + +__PRIPTR_PREFIX + "d" + + ) + +260 + #SCNiPTR + +__PRIPTR_PREFIX + "i" + + ) + +261 + #SCNoPTR + +__PRIPTR_PREFIX + "o" + + ) + +262 + #SCNuPTR + +__PRIPTR_PREFIX + "u" + + ) + +263 + #SCNxPTR + +__PRIPTR_PREFIX + "x" + + ) + +266 + g__BEGIN_DECLS + + +268 #i� +__WORDSIZE + == 64 + +273 + mqu� +; + +274 + m�m +; + +275 } + timaxdiv_t +; + +282 +__ex�nsi�__ + + mqu� +; + +283 +__ex�nsi�__ + + m�m +; + +284 } + timaxdiv_t +; + +290 +�tmax_t + + $imaxabs + ( +�tmax_t + +__n +� +__THROW + + `__��ibu�__ + (( +__cڡ__ +)); + +293 +imaxdiv_t + + $imaxdiv + ( +�tmax_t + +__num� +, i�max_� +__d�om +) + +294 +__THROW + + `__��ibu�__ + (( +__cڡ__ +)); + +297 +�tmax_t + + $��oimax + (cڡ * +__��ri� + +__Ō +, + +298 ** +__��ri� + +__�d�r +, +__ba� +� +__THROW +; + +301 +u�tmax_t + + $��oumax + (cڡ * +__��ri� + +__Ō +, + +302 ** +__��ri� + +__�d�r +, +__ba� +� +__THROW +; + +305 +�tmax_t + + $wc�oimax + (cڡ +__gwch�_t + * +__��ri� + +__Ō +, + +306 +__gwch�_t + ** +__��ri� + +__�d�r +, +__ba� +) + +307 +__THROW +; + +310 +u�tmax_t + + $wc�oumax + (cڡ +__gwch�_t + * +__��ri� + +__Ō +, + +311 +__gwch�_t + ** +__��ri� + +__�d�r +, +__ba� +) + +312 +__THROW +; + +314 #ifde� +__USE_EXTERN_INLINES + + +316 #i� +__WORDSIZE + == 64 + +318 + $__���_���� + (cڡ * +__��ri� + +__Ō +, + +319 ** +__��ri� + +__�d�r +, + +320 +__ba� +, +__group +) + +321 +__THROW + + `__n�nu� + ((1)� +__wur +; + +323 +__ex��_�l�e + +�tmax_t + + +324 + `__NTH + ( + $��oimax + (cڡ * +__��ri� + +Ō +, **__��ri� +�d�r +, + +325 +ba� +)) + +327 + `__���_���� + ( +Ō +, +�d�r +, +ba� +, 0); + +328 + } +} + +330 + $__��oul_���� + (cڡ * +__��ri� + +__Ō +, + +331 ** +__��ri� + +__�d�r +, + +332 +__ba� +, +__group +) + +333 +__THROW + + `__n�nu� + ((1)� +__wur +; + +335 +__ex��_�l�e + +u�tmax_t + + +336 + `__NTH + ( + $��oumax + (cڡ * +__��ri� + +Ō +, **__��ri� +�d�r +, + +337 +ba� +)) + +339 + `__��oul_���� + ( +Ō +, +�d�r +, +ba� +, 0); + +340 + } +} + +342 + $__wc��_���� + (cڡ +__gwch�_t + * +__��ri� + +__Ō +, + +343 +__gwch�_t + ** +__��ri� + +__�d�r +, + +344 +__ba� +, +__group +) + +345 +__THROW + + `__n�nu� + ((1)� +__wur +; + +347 +__ex��_�l�e + +�tmax_t + + +348 + `__NTH + ( + $wc�oimax + (cڡ +__gwch�_t + * +__��ri� + +Ō +, + +349 +__gwch�_t + ** +__��ri� + +�d�r +, +ba� +)) + +351 + `__wc��_���� + ( +Ō +, +�d�r +, +ba� +, 0); + +352 + } +} + +354 + $__wc�oul_���� + (cڡ +__gwch�_t + * + +355 +__��ri� + +__Ō +, + +356 +__gwch�_t + ** + +357 +__��ri� + +__�d�r +, + +358 +__ba� +, +__group +) + +359 +__THROW + + `__n�nu� + ((1)� +__wur +; + +361 +__ex��_�l�e + +u�tmax_t + + +362 + `__NTH + ( + $wc�oumax + (cڡ +__gwch�_t + * +__��ri� + +Ō +, + +363 +__gwch�_t + ** +__��ri� + +�d�r +, +ba� +)) + +365 + `__wc�oul_���� + ( +Ō +, +�d�r +, +ba� +, 0); + +366 + } +} + +370 +__ex�nsi�__ + + +371 + $__���l_���� + (cڡ * +__��ri� + +__Ō +, + +372 ** +__��ri� + +__�d�r +, + +373 +__ba� +, +__group +) + +374 +__THROW + + `__n�nu� + ((1)� +__wur +; + +376 +__ex��_�l�e + +�tmax_t + + +377 + `__NTH + ( + $��oimax + (cڡ * +__��ri� + +Ō +, **__��ri� +�d�r +, + +378 +ba� +)) + +380 + `__���l_���� + ( +Ō +, +�d�r +, +ba� +, 0); + +381 + } +} + +383 +__ex�nsi�__ + + +384 + $__��ou�_���� + (const * + +385 +__��ri� + +__Ō +, + +387 +__��ri� + +__�d�r +, + +388 +__ba� +, + +389 +__group +) + +390 +__THROW + + `__n�nu� + ((1)� +__wur +; + +392 +__ex��_�l�e + +u�tmax_t + + +393 + `__NTH + ( + $��oumax + (cڡ * +__��ri� + +Ō +, **__��ri� +�d�r +, + +394 +ba� +)) + +396 + `__��ou�_���� + ( +Ō +, +�d�r +, +ba� +, 0); + +397 + } +} + +399 +__ex�nsi�__ + + +400 + $__wc��l_���� + (cڡ +__gwch�_t + * +__��ri� + +__Ō +, + +401 +__gwch�_t + ** +__��ri� + +__�d�r +, + +402 +__ba� +, +__group +) + +403 +__THROW + + `__n�nu� + ((1)� +__wur +; + +405 +__ex��_�l�e + +�tmax_t + + +406 + `__NTH + ( + $wc�oimax + (cڡ +__gwch�_t + * +__��ri� + +Ō +, + +407 +__gwch�_t + ** +__��ri� + +�d�r +, +ba� +)) + +409 + `__wc��l_���� + ( +Ō +, +�d�r +, +ba� +, 0); + +410 + } +} + +413 +__ex�nsi�__ + + +414 + $__wc�ou�_���� + (cڡ +__gwch�_t + * + +415 +__��ri� + +__Ō +, + +416 +__gwch�_t + ** + +417 +__��ri� + +__�d�r +, + +418 +__ba� +, + +419 +__group +) + +420 +__THROW + + `__n�nu� + ((1)� +__wur +; + +422 +__ex��_�l�e + +u�tmax_t + + +423 + `__NTH + ( + $wc�oumax + (cڡ +__gwch�_t + * +__��ri� + +Ō +, + +424 +__gwch�_t + ** +__��ri� + +�d�r +, +ba� +)) + +426 + `__wc�ou�_���� + ( +Ō +, +�d�r +, +ba� +, 0); + +427 + } +} + +432 + g__END_DECLS + + + @/usr/include/limits.h + +22 #i�de� +_LIBC_LIMITS_H_ + + +23 + #_LIBC_LIMITS_H_ + 1 + + ) + +25 + ~<�u�s.h +> + +31 + #MB_LEN_MAX + 16 + + ) + +36 #i�! +def�ed + +__GNUC__ + || __GNUC__ < 2 + +41 #i�de� +_LIMITS_H + + +42 + #_LIMITS_H + 1 + + ) + +44 + ~<b�s/w�dsize.h +> + +53 + #CHAR_BIT + 8 + + ) + +56 + #SCHAR_MIN + (-128) + + ) + +57 + #SCHAR_MAX + 127 + + ) + +60 + #UCHAR_MAX + 255 + + ) + +63 #ifde� +__CHAR_UNSIGNED__ + + +64 + #CHAR_MIN + 0 + + ) + +65 + #CHAR_MAX + +UCHAR_MAX + + + ) + +67 + #CHAR_MIN + +SCHAR_MIN + + + ) + +68 + #CHAR_MAX + +SCHAR_MAX + + + ) + +72 + #SHRT_MIN + (-32768) + + ) + +73 + #SHRT_MAX + 32767 + + ) + +76 + #USHRT_MAX + 65535 + + ) + +79 + #INT_MIN + (- +INT_MAX + - 1) + + ) + +80 + #INT_MAX + 2147483647 + + ) + +83 + #UINT_MAX + 4294967295U + + ) + +86 #i� +__WORDSIZE + == 64 + +87 + #LONG_MAX + 9223372036854775807L + + ) + +89 + #LONG_MAX + 2147483647L + + ) + +91 + #LONG_MIN + (- +LONG_MAX + - 1L) + + ) + +94 #i� +__WORDSIZE + == 64 + +95 + #ULONG_MAX + 18446744073709551615UL + + ) + +97 + #ULONG_MAX + 4294967295UL + + ) + +100 #ifde� +__USE_ISOC99 + + +103 + #LLONG_MAX + 9223372036854775807LL + + ) + +104 + #LLONG_MIN + (- +LLONG_MAX + - 1LL) + + ) + +107 + #ULLONG_MAX + 18446744073709551615ULL + + ) + +121 #i� +def�ed + +__GNUC__ + && !def�ed +_GCC_LIMITS_H_ + + +123 #��ude_�x�< +lim�s +. +h +> + +129 #i� +def�ed + +__USE_ISOC99 + && def�ed +__GNUC__ + + +130 #i�de� +LLONG_MIN + + +131 + #LLONG_MIN + (- +LLONG_MAX +-1) + + ) + +133 #i�de� +LLONG_MAX + + +134 + #LLONG_MAX + +__LONG_LONG_MAX__ + + + ) + +136 #i�de� +ULLONG_MAX + + +137 + #ULLONG_MAX + ( +LLONG_MAX + * 2ULL + 1) + + ) + +141 #ifdef +__USE_POSIX + + +143 + ~<b�s/posix1_lim.h +> + +146 #ifdef +__USE_POSIX2 + + +147 + ~<b�s/posix2_lim.h +> + +150 #ifdef +__USE_XOPEN + + +151 + ~<b�s/xݒ_lim.h +> + + @/usr/include/linux/in.h + +18 #i�de� +_LINUX_IN_H + + +19 + #_LINUX_IN_H + + + ) + +21 + ~<l�ux/ty�s.h +> + +22 + ~<l�ux/sock�.h +> + +26 + mIPPROTO_IP + = 0, + +27 + #IPPROTO_IP + +IPPROTO_IP + + + ) + +28 + mIPPROTO_ICMP + = 1, + +29 + #IPPROTO_ICMP + +IPPROTO_ICMP + + + ) + +30 + mIPPROTO_IGMP + = 2, + +31 + #IPPROTO_IGMP + +IPPROTO_IGMP + + + ) + +32 + mIPPROTO_IPIP + = 4, + +33 + #IPPROTO_IPIP + +IPPROTO_IPIP + + + ) + +34 + mIPPROTO_TCP + = 6, + +35 + #IPPROTO_TCP + +IPPROTO_TCP + + + ) + +36 + mIPPROTO_EGP + = 8, + +37 + #IPPROTO_EGP + +IPPROTO_EGP + + + ) + +38 + mIPPROTO_PUP + = 12, + +39 + #IPPROTO_PUP + +IPPROTO_PUP + + + ) + +40 + mIPPROTO_UDP + = 17, + +41 + #IPPROTO_UDP + +IPPROTO_UDP + + + ) + +42 + mIPPROTO_IDP + = 22, + +43 + #IPPROTO_IDP + +IPPROTO_IDP + + + ) + +44 + mIPPROTO_TP + = 29, + +45 + #IPPROTO_TP + +IPPROTO_TP + + + ) + +46 + mIPPROTO_DCCP + = 33, + +47 + #IPPROTO_DCCP + +IPPROTO_DCCP + + + ) + +48 + mIPPROTO_IPV6 + = 41, + +49 + #IPPROTO_IPV6 + +IPPROTO_IPV6 + + + ) + +50 + mIPPROTO_RSVP + = 46, + +51 + #IPPROTO_RSVP + +IPPROTO_RSVP + + + ) + +52 + mIPPROTO_GRE + = 47, + +53 + #IPPROTO_GRE + +IPPROTO_GRE + + + ) + +54 + mIPPROTO_ESP + = 50, + +55 + #IPPROTO_ESP + +IPPROTO_ESP + + + ) + +56 + mIPPROTO_AH + = 51, + +57 + #IPPROTO_AH + +IPPROTO_AH + + + ) + +58 + mIPPROTO_MTP + = 92, + +59 + #IPPROTO_MTP + +IPPROTO_MTP + + + ) + +60 + mIPPROTO_BEETPH + = 94, + +61 + #IPPROTO_BEETPH + +IPPROTO_BEETPH + + + ) + +62 + mIPPROTO_ENCAP + = 98, + +63 + #IPPROTO_ENCAP + +IPPROTO_ENCAP + + + ) + +64 + mIPPROTO_PIM + = 103, + +65 + #IPPROTO_PIM + +IPPROTO_PIM + + + ) + +66 + mIPPROTO_COMP + = 108, + +67 + #IPPROTO_COMP + +IPPROTO_COMP + + + ) + +68 + mIPPROTO_SCTP + = 132, + +69 + #IPPROTO_SCTP + +IPPROTO_SCTP + + + ) + +70 + mIPPROTO_UDPLITE + = 136, + +71 + #IPPROTO_UDPLITE + +IPPROTO_UDPLITE + + + ) + +72 + mIPPROTO_RAW + = 255, + +73 + #IPPROTO_RAW + +IPPROTO_RAW + + + ) + +74 + mIPPROTO_MAX + + +79 + s�_addr + { + +80 +__be32 + + ms_addr +; + +83 + #IP_TOS + 1 + + ) + +84 + #IP_TTL + 2 + + ) + +85 + #IP_HDRINCL + 3 + + ) + +86 + #IP_OPTIONS + 4 + + ) + +87 + #IP_ROUTER_ALERT + 5 + + ) + +88 + #IP_RECVOPTS + 6 + + ) + +89 + #IP_RETOPTS + 7 + + ) + +90 + #IP_PKTINFO + 8 + + ) + +91 + #IP_PKTOPTIONS + 9 + + ) + +92 + #IP_MTU_DISCOVER + 10 + + ) + +93 + #IP_RECVERR + 11 + + ) + +94 + #IP_RECVTTL + 12 + + ) + +95 + #IP_RECVTOS + 13 + + ) + +96 + #IP_MTU + 14 + + ) + +97 + #IP_FREEBIND + 15 + + ) + +98 + #IP_IPSEC_POLICY + 16 + + ) + +99 + #IP_XFRM_POLICY + 17 + + ) + +100 + #IP_PASSSEC + 18 + + ) + +101 + #IP_TRANSPARENT + 19 + + ) + +104 + #IP_RECVRETOPTS + +IP_RETOPTS + + + ) + +107 + #IP_ORIGDSTADDR + 20 + + ) + +108 + #IP_RECVORIGDSTADDR + +IP_ORIGDSTADDR + + + ) + +110 + #IP_MINTTL + 21 + + ) + +111 + #IP_NODEFRAG + 22 + + ) + +114 + #IP_PMTUDISC_DONT + 0 + + ) + +115 + #IP_PMTUDISC_WANT + 1 + + ) + +116 + #IP_PMTUDISC_DO + 2 + + ) + +117 + #IP_PMTUDISC_PROBE + 3 + + ) + +122 + #IP_PMTUDISC_INTERFACE + 4 + + ) + +124 + #IP_MULTICAST_IF + 32 + + ) + +125 + #IP_MULTICAST_TTL + 33 + + ) + +126 + #IP_MULTICAST_LOOP + 34 + + ) + +127 + #IP_ADD_MEMBERSHIP + 35 + + ) + +128 + #IP_DROP_MEMBERSHIP + 36 + + ) + +129 + #IP_UNBLOCK_SOURCE + 37 + + ) + +130 + #IP_BLOCK_SOURCE + 38 + + ) + +131 + #IP_ADD_SOURCE_MEMBERSHIP + 39 + + ) + +132 + #IP_DROP_SOURCE_MEMBERSHIP + 40 + + ) + +133 + #IP_MSFILTER + 41 + + ) + +134 + #MCAST_JOIN_GROUP + 42 + + ) + +135 + #MCAST_BLOCK_SOURCE + 43 + + ) + +136 + #MCAST_UNBLOCK_SOURCE + 44 + + ) + +137 + #MCAST_LEAVE_GROUP + 45 + + ) + +138 + #MCAST_JOIN_SOURCE_GROUP + 46 + + ) + +139 + #MCAST_LEAVE_SOURCE_GROUP + 47 + + ) + +140 + #MCAST_MSFILTER + 48 + + ) + +141 + #IP_MULTICAST_ALL + 49 + + ) + +142 + #IP_UNICAST_IF + 50 + + ) + +144 + #MCAST_EXCLUDE + 0 + + ) + +145 + #MCAST_INCLUDE + 1 + + ) + +148 + #IP_DEFAULT_MULTICAST_TTL + 1 + + ) + +149 + #IP_DEFAULT_MULTICAST_LOOP + 1 + + ) + +153 + s�_m�q + { + +154 +�_addr + + mimr_muɟddr +; + +155 +�_addr + + mimr_��r�� +; + +158 + s�_m�qn + { + +159 +�_addr + + mimr_muɟddr +; + +160 +�_addr + + mimr_add�ss +; + +161 + mimr_if�dex +; + +164 + s�_m�q_sour� + { + +165 +__be32 + + mimr_muɟddr +; + +166 +__be32 + + mimr_��r�� +; + +167 +__be32 + + mimr_sour�addr +; + +170 + s�_msf��r + { + +171 +__be32 + + mimsf_muɟddr +; + +172 +__be32 + + mimsf_��r�� +; + +173 +__u32 + + mimsf_fmode +; + +174 +__u32 + + mimsf_num�c +; + +175 +__be32 + + mimsf_�i� +[1]; + +178 + #IP_MSFILTER_SIZE +( +num�c +) \ + +179 (( +�_msf��r +�- ( +__u32 +) \ + +180 + ( +num�c +�* ( +__u32 +)) + + ) + +182 + sgroup_�q + { + +183 +__u32 + + mgr_��r�� +; + +184 +__k��l_sockaddr_��age + + mgr_group +; + +187 + sgroup_sour�_�q + { + +188 +__u32 + + mg�_��r�� +; + +189 +__k��l_sockaddr_��age + + mg�_group +; + +190 +__k��l_sockaddr_��age + + mg�_sour� +; + +193 + sgroup_f��r + { + +194 +__u32 + + mgf_��r�� +; + +195 +__k��l_sockaddr_��age + + mgf_group +; + +196 +__u32 + + mgf_fmode +; + +197 +__u32 + + mgf_num�c +; + +198 +__k��l_sockaddr_��age + + mgf_�i� +[1]; + +201 + #GROUP_FILTER_SIZE +( +num�c +) \ + +202 (( +group_f��r +�- ( +__k��l_sockaddr_��age +) \ + +203 + ( +num�c +�* ( +__k��l_sockaddr_��age +)) + + ) + +205 + s�_pkt�fo + { + +206 + m�i_if�dex +; + +207 +�_addr + + m�i_�ec_d� +; + +208 +�_addr + + m�i_addr +; + +212 + #__SOCK_SIZE__ + 16 + + ) + +213 + ssockaddr_� + { + +214 +__k��l_�_�m�y_t + + ms�_�m�y +; + +215 +__be16 + + ms�_p�t +; + +216 +�_addr + + ms�_addr +; + +219 + m__�d +[ +__SOCK_SIZE__ + - () - + +220 (�- ( +�_addr +)]; + +222 + #s�_z�o + +__�d + + + ) + +230 + #IN_CLASSA +( +a +�((((��)�& 0x80000000�=�0) + + ) + +231 + #IN_CLASSA_NET + 0xff000000 + + ) + +232 + #IN_CLASSA_NSHIFT + 24 + + ) + +233 + #IN_CLASSA_HOST + (0xfffffff�& ~ +IN_CLASSA_NET +) + + ) + +234 + #IN_CLASSA_MAX + 128 + + ) + +236 + #IN_CLASSB +( +a +�((((��)�& 0xc0000000�=�0x80000000) + + ) + +237 + #IN_CLASSB_NET + 0xffff0000 + + ) + +238 + #IN_CLASSB_NSHIFT + 16 + + ) + +239 + #IN_CLASSB_HOST + (0xfffffff�& ~ +IN_CLASSB_NET +) + + ) + +240 + #IN_CLASSB_MAX + 65536 + + ) + +242 + #IN_CLASSC +( +a +�((((��)�& 0xe0000000�=�0xc0000000) + + ) + +243 + #IN_CLASSC_NET + 0xffffff00 + + ) + +244 + #IN_CLASSC_NSHIFT + 8 + + ) + +245 + #IN_CLASSC_HOST + (0xfffffff�& ~ +IN_CLASSC_NET +) + + ) + +247 + #IN_CLASSD +( +a +�((((��)�& 0xf0000000�=�0xe0000000) + + ) + +248 + #IN_MULTICAST +( +a +� + `IN_CLASSD +�) + + ) + +249 + #IN_MULTICAST_NET + 0xF0000000 + + ) + +251 + #IN_EXPERIMENTAL +( +a +�((((��)�& 0xf0000000�=�0xf0000000) + + ) + +252 + #IN_BADCLASS +( +a +� + `IN_EXPERIMENTAL +(�)) + + ) + +255 + #INADDR_ANY + ((�0x00000000) + + ) + +258 + #INADDR_BROADCAST + ((�0xffffffff) + + ) + +261 + #INADDR_NONE + ((�0xffffffff) + + ) + +264 + #IN_LOOPBACKNET + 127 + + ) + +267 + #INADDR_LOOPBACK + 0x7f000001 + + ) + +268 + #IN_LOOPBACK +( +a +�((((��)�& 0xff000000�=�0x7f000000) + + ) + +271 + #INADDR_UNSPEC_GROUP + 0xe0000000U + + ) + +272 + #INADDR_ALLHOSTS_GROUP + 0xe0000001U + + ) + +273 + #INADDR_ALLRTRS_GROUP + 0xe0000002U + + ) + +274 + #INADDR_MAX_LOCAL_GROUP + 0xe00000ffU + + ) + +278 + ~<asm/by��d�.h +> + + @/usr/include/linux/in6.h + +21 #i�de� +_LINUX_IN6_H + + +22 + #_LINUX_IN6_H + + + ) + +24 + ~<l�ux/ty�s.h +> + +25 + ~<l�ux/libc-com�t.h +> + +31 #i� +__UAPI_DEF_IN6_ADDR + + +32 + s�6_addr + { + +34 +__u8 + + mu6_addr8 +[16]; + +35 #i� +__UAPI_DEF_IN6_ADDR_ALT + + +36 +__be16 + + mu6_addr16 +[8]; + +37 +__be32 + + mu6_addr32 +[4]; + +39 } + m�6_u +; + +40 + #s6_addr + +�6_u +. +u6_addr8 + + + ) + +41 #i� +__UAPI_DEF_IN6_ADDR_ALT + + +42 + #s6_addr16 + +�6_u +. +u6_addr16 + + + ) + +43 + #s6_addr32 + +�6_u +. +u6_addr32 + + + ) + +48 #i� +__UAPI_DEF_SOCKADDR_IN6 + + +49 + ssockaddr_�6 + { + +50 + ms�6_�m�y +; + +51 +__be16 + + ms�6_p�t +; + +52 +__be32 + + ms�6_�ow�fo +; + +53 +�6_addr + + ms�6_addr +; + +54 +__u32 + + ms�6_sc�e_id +; + +58 #i� +__UAPI_DEF_IPV6_MREQ + + +59 + s�v6_m�q + { + +61 +�6_addr + + m�v6mr_muɟddr +; + +64 + m�v6mr_if�dex +; + +68 + #�v6mr_a�ddr + +�v6mr_muɟddr + + + ) + +70 + s�6_�ow�b�_�q + { + +71 +�6_addr + + m�r_d� +; + +72 +__be32 + + m�r_�b� +; + +73 +__u8 + + m�r_a�i� +; + +74 +__u8 + + m�r_sh�e +; + +75 +__u16 + + m�r_�ags +; + +76 +__u16 + + m�r_exp�es +; + +77 +__u16 + + m�r_l�g� +; + +78 +__u32 + + m__�r_�d +; + +82 + #IPV6_FL_A_GET + 0 + + ) + +83 + #IPV6_FL_A_PUT + 1 + + ) + +84 + #IPV6_FL_A_RENEW + 2 + + ) + +86 + #IPV6_FL_F_CREATE + 1 + + ) + +87 + #IPV6_FL_F_EXCL + 2 + + ) + +89 + #IPV6_FL_S_NONE + 0 + + ) + +90 + #IPV6_FL_S_EXCL + 1 + + ) + +91 + #IPV6_FL_S_PROCESS + 2 + + ) + +92 + #IPV6_FL_S_USER + 3 + + ) + +93 + #IPV6_FL_S_ANY + 255 + + ) + +104 + #IPV6_FLOWINFO_FLOWLABEL + 0x000fffff + + ) + +105 + #IPV6_FLOWINFO_PRIORITY + 0x0ff00000 + + ) + +108 + #IPV6_PRIORITY_UNCHARACTERIZED + 0x0000 + + ) + +109 + #IPV6_PRIORITY_FILLER + 0x0100 + + ) + +110 + #IPV6_PRIORITY_UNATTENDED + 0x0200 + + ) + +111 + #IPV6_PRIORITY_RESERVED1 + 0x0300 + + ) + +112 + #IPV6_PRIORITY_BULK + 0x0400 + + ) + +113 + #IPV6_PRIORITY_RESERVED2 + 0x0500 + + ) + +114 + #IPV6_PRIORITY_INTERACTIVE + 0x0600 + + ) + +115 + #IPV6_PRIORITY_CONTROL + 0x0700 + + ) + +116 + #IPV6_PRIORITY_8 + 0x0800 + + ) + +117 + #IPV6_PRIORITY_9 + 0x0900 + + ) + +118 + #IPV6_PRIORITY_10 + 0x0a00 + + ) + +119 + #IPV6_PRIORITY_11 + 0x0b00 + + ) + +120 + #IPV6_PRIORITY_12 + 0x0c00 + + ) + +121 + #IPV6_PRIORITY_13 + 0x0d00 + + ) + +122 + #IPV6_PRIORITY_14 + 0x0e00 + + ) + +123 + #IPV6_PRIORITY_15 + 0x0f00 + + ) + +128 #i� +__UAPI_DEF_IPPROTO_V6 + + +130 + mIPPROTO_HOPOPTS + = 0, + +131 + #IPPROTO_HOPOPTS + +IPPROTO_HOPOPTS + + + ) + +132 + mIPPROTO_ROUTING + = 43, + +133 + #IPPROTO_ROUTING + +IPPROTO_ROUTING + + + ) + +134 + mIPPROTO_FRAGMENT + = 44, + +135 + #IPPROTO_FRAGMENT + +IPPROTO_FRAGMENT + + + ) + +136 + mIPPROTO_ICMPV6 + = 58, + +137 + #IPPROTO_ICMPV6 + +IPPROTO_ICMPV6 + + + ) + +138 + mIPPROTO_NONE + = 59, + +139 + #IPPROTO_NONE + +IPPROTO_NONE + + + ) + +140 + mIPPROTO_DSTOPTS + = 60, + +141 + #IPPROTO_DSTOPTS + +IPPROTO_DSTOPTS + + + ) + +142 + mIPPROTO_MH + = 135, + +143 + #IPPROTO_MH + +IPPROTO_MH + + + ) + +150 + #IPV6_TLV_PAD1 + 0 + + ) + +151 + #IPV6_TLV_PADN + 1 + + ) + +152 + #IPV6_TLV_ROUTERALERT + 5 + + ) + +153 + #IPV6_TLV_JUMBO + 194 + + ) + +154 + #IPV6_TLV_HAO + 201 + + ) + +159 #i� +__UAPI_DEF_IPV6_OPTIONS + + +160 + #IPV6_ADDRFORM + 1 + + ) + +161 + #IPV6_2292PKTINFO + 2 + + ) + +162 + #IPV6_2292HOPOPTS + 3 + + ) + +163 + #IPV6_2292DSTOPTS + 4 + + ) + +164 + #IPV6_2292RTHDR + 5 + + ) + +165 + #IPV6_2292PKTOPTIONS + 6 + + ) + +166 + #IPV6_CHECKSUM + 7 + + ) + +167 + #IPV6_2292HOPLIMIT + 8 + + ) + +168 + #IPV6_NEXTHOP + 9 + + ) + +169 + #IPV6_AUTHHDR + 10 + + ) + +170 + #IPV6_FLOWINFO + 11 + + ) + +172 + #IPV6_UNICAST_HOPS + 16 + + ) + +173 + #IPV6_MULTICAST_IF + 17 + + ) + +174 + #IPV6_MULTICAST_HOPS + 18 + + ) + +175 + #IPV6_MULTICAST_LOOP + 19 + + ) + +176 + #IPV6_ADD_MEMBERSHIP + 20 + + ) + +177 + #IPV6_DROP_MEMBERSHIP + 21 + + ) + +178 + #IPV6_ROUTER_ALERT + 22 + + ) + +179 + #IPV6_MTU_DISCOVER + 23 + + ) + +180 + #IPV6_MTU + 24 + + ) + +181 + #IPV6_RECVERR + 25 + + ) + +182 + #IPV6_V6ONLY + 26 + + ) + +183 + #IPV6_JOIN_ANYCAST + 27 + + ) + +184 + #IPV6_LEAVE_ANYCAST + 28 + + ) + +187 + #IPV6_PMTUDISC_DONT + 0 + + ) + +188 + #IPV6_PMTUDISC_WANT + 1 + + ) + +189 + #IPV6_PMTUDISC_DO + 2 + + ) + +190 + #IPV6_PMTUDISC_PROBE + 3 + + ) + +193 + #IPV6_FLOWLABEL_MGR + 32 + + ) + +194 + #IPV6_FLOWINFO_SEND + 33 + + ) + +196 + #IPV6_IPSEC_POLICY + 34 + + ) + +197 + #IPV6_XFRM_POLICY + 35 + + ) + +219 + #IPV6_RECVPKTINFO + 49 + + ) + +220 + #IPV6_PKTINFO + 50 + + ) + +221 + #IPV6_RECVHOPLIMIT + 51 + + ) + +222 + #IPV6_HOPLIMIT + 52 + + ) + +223 + #IPV6_RECVHOPOPTS + 53 + + ) + +224 + #IPV6_HOPOPTS + 54 + + ) + +225 + #IPV6_RTHDRDSTOPTS + 55 + + ) + +226 + #IPV6_RECVRTHDR + 56 + + ) + +227 + #IPV6_RTHDR + 57 + + ) + +228 + #IPV6_RECVDSTOPTS + 58 + + ) + +229 + #IPV6_DSTOPTS + 59 + + ) + +230 + #IPV6_RECVPATHMTU + 60 + + ) + +231 + #IPV6_PATHMTU + 61 + + ) + +232 + #IPV6_DONTFRAG + 62 + + ) + +234 + #IPV6_USE_MIN_MTU + 63 + + ) + +250 + #IPV6_RECVTCLASS + 66 + + ) + +251 + #IPV6_TCLASS + 67 + + ) + +265 + #IPV6_ADDR_PREFERENCES + 72 + + ) + +267 + #IPV6_PREFER_SRC_TMP + 0x0001 + + ) + +268 + #IPV6_PREFER_SRC_PUBLIC + 0x0002 + + ) + +269 + #IPV6_PREFER_SRC_PUBTMP_DEFAULT + 0x0100 + + ) + +270 + #IPV6_PREFER_SRC_COA + 0x0004 + + ) + +271 + #IPV6_PREFER_SRC_HOME + 0x0400 + + ) + +272 + #IPV6_PREFER_SRC_CGA + 0x0008 + + ) + +273 + #IPV6_PREFER_SRC_NONCGA + 0x0800 + + ) + +276 + #IPV6_MINHOPCOUNT + 73 + + ) + +278 + #IPV6_ORIGDSTADDR + 74 + + ) + +279 + #IPV6_RECVORIGDSTADDR + +IPV6_ORIGDSTADDR + + + ) + +280 + #IPV6_TRANSPARENT + 75 + + ) + +281 + #IPV6_UNICAST_IF + 76 + + ) + + @/usr/include/malloc.h + +19 #i�de� +_MALLOC_H + + +20 + #_MALLOC_H + 1 + + ) + +22 + ~<�u�s.h +> + +23 + ~<�ddef.h +> + +24 + ~<�dio.h +> + +26 #ifde� +_LIBC + + +27 + #__MALLOC_HOOK_VOLATILE + + + ) + +28 + #__MALLOC_DEPRECATED + + + ) + +30 + #__MALLOC_HOOK_VOLATILE + vީ�e + + ) + +31 + #__MALLOC_DEPRECATED + +__��ibu�_d����d__ + + + ) + +35 +__BEGIN_DECLS + + +38 * + $m�loc + ( +size_t + +__size +� +__THROW + +__��ibu�_m�loc__ + +__wur +; + +41 * + $��oc + ( +size_t + +__nmemb +, size_� +__size +) + +42 +__THROW + +__��ibu�_m�loc__ + +__wur +; + +49 * + $��loc + (* +__�r +, +size_t + +__size +) + +50 +__THROW + +__��ibu�_w�n_unu�d_�su�__ +; + +53 + $� + (* +__�r +� +__THROW +; + +56 + $c� + (* +__�r +� +__THROW +; + +59 * + $mem�ign + ( +size_t + +__�ignm�t +, size_� +__size +) + +60 +__THROW + +__��ibu�_m�loc__ + +__wur +; + +63 * + $v�loc + ( +size_t + +__size +� +__THROW + +__��ibu�_m�loc__ + +__wur +; + +67 * + $pv�loc + ( +size_t + +__size +� +__THROW + +__��ibu�_m�loc__ + +__wur +; + +71 *(* +__m�ec�e +�( +�rdiff_t + +__size +); + +74 * + $__de�u�_m�ec�e + ( +�rdiff_t + +__size +) + +75 +__THROW + +__��ibu�_m�loc__ +; + +79 + sm�l�fo + + +81 +��a +; + +82 +�dblks +; + +83 +smblks +; + +84 +hblks +; + +85 +hblkhd +; + +86 +usmblks +; + +87 +fsmblks +; + +88 +u�dblks +; + +89 +f�dblks +; + +90 +k�pco� +; + +94 +m�l�fo + + $m�l�fo + (� +__THROW +; + +97 #i�de� +M_MXFAST + + +98 + #M_MXFAST + 1 + + ) + +100 #i�de� +M_NLBLKS + + +101 + #M_NLBLKS + 2 + + ) + +103 #i�de� +M_GRAIN + + +104 + #M_GRAIN + 3 + + ) + +106 #i�de� +M_KEEP + + +107 + #M_KEEP + 4 + + ) + +111 + #M_TRIM_THRESHOLD + -1 + + ) + +112 + #M_TOP_PAD + -2 + + ) + +113 + #M_MMAP_THRESHOLD + -3 + + ) + +114 + #M_MMAP_MAX + -4 + + ) + +115 + #M_CHECK_ACTION + -5 + + ) + +116 + #M_PERTURB + -6 + + ) + +117 + #M_ARENA_TEST + -7 + + ) + +118 + #M_ARENA_MAX + -8 + + ) + +121 + $m�l�t + ( +__��m +, +__v� +� +__THROW +; + +125 + $m�loc_�im + ( +size_t + +__�d +� +__THROW +; + +129 +size_t + + $m�loc_u�b�_size + (* +__�r +� +__THROW +; + +132 + $m�loc_��s + (� +__THROW +; + +135 + $m�loc_�fo + ( +__�ti�s +, +FILE + * +__� +� +__THROW +; + +138 * + $m�loc_g�_��e + (� +__THROW +; + +142 + $m�loc_�t_��e + (* +__�r +� +__THROW +; + +147 (* +__MALLOC_HOOK_VOLATILE + +__m�loc_���lize_hook +) () + +148 +__MALLOC_DEPRECATED +; + +150 (* +__MALLOC_HOOK_VOLATILE + +__�_hook +�(* +__�r +, + +152 +__MALLOC_DEPRECATED +; + +153 *(* +__MALLOC_HOOK_VOLATILE + +__m�loc_hook +)( +size_t + +__size +, + +155 +__MALLOC_DEPRECATED +; + +156 *(* +__MALLOC_HOOK_VOLATILE + +__��loc_hook +)(* +__�r +, + +157 +size_t + +__size +, + +159 +__MALLOC_DEPRECATED +; + +160 *(* +__MALLOC_HOOK_VOLATILE + +__mem�ign_hook +)( +size_t + +__�ignm�t +, + +161 +size_t + +__size +, + +163 +__MALLOC_DEPRECATED +; + +164 (* +__MALLOC_HOOK_VOLATILE + +__a�_m�ec�e_hook +) (); + +167 + $__m�loc_check_�� + (� +__THROW + +__MALLOC_DEPRECATED +; + +170 +__END_DECLS + + + @/usr/include/math.h + +23 #i�def +_MATH_H + + +24 + #_MATH_H + 1 + + ) + +26 + ~<�u�s.h +> + +28 + g__BEGIN_DECLS + + +32 + ~<b�s/huge_v�.h +> + +33 #ifde� +__USE_ISOC99 + + +34 + ~<b�s/huge_v�f.h +> + +35 + ~<b�s/huge_v�l.h +> + +38 + ~<b�s/�f.h +> + +41 + ~<b�s/�n.h +> + +45 + ~<b�s/m�hdef.h +> + +52 + #__MATHCALL +( +fun�i� +, +suffix +, +�gs +) \ + +53 + `__MATHDECL + ( +_Mdoub�_ +, +fun�i� +, +suffix +, +�gs +) + + ) + +54 + #__MATHDECL +( +ty� +, +fun�i� +, +suffix +, +�gs +) \ + +55 + `__MATHDECL_1 +( +ty� +, +fun�i� +, +suffix +, +�gs +); \ + +56 + `__MATHDECL_1 +( +ty� +, + `__CONCAT +( +__ +, +fun�i� +), +suffix +, +�gs +) + + ) + +57 + #__MATHCALLX +( +fun�i� +, +suffix +, +�gs +, +��ib +) \ + +58 + `__MATHDECLX + ( +_Mdoub�_ +, +fun�i� +, +suffix +, +�gs +, +��ib +) + + ) + +59 + #__MATHDECLX +( +ty� +, +fun�i� +, +suffix +, +�gs +, +��ib +) \ + +60 + `__MATHDECL_1 +( +ty� +, +fun�i� +, +suffix +, +�gs +� + `__��ibu�__ + ( +��ib +); \ + +61 + `__MATHDECL_1 +( +ty� +, + `__CONCAT +( +__ +, +fun�i� +), +suffix +, +�gs +� + `__��ibu�__ + ( +��ib +) + + ) + +62 + #__MATHDECL_1 +( +ty� +, +fun�i� +, +suffix +, +�gs +) \ + +63 +ty� + + `__MATH_PRECNAME +( +fun�i� +, +suffix +� +�gs + +__THROW + + + ) + +65 + #_Mdoub�_ + + + ) + +66 + #__MATH_PRECNAME +( +�me +, +r +� + `__CONCAT +�ame,r) + + ) + +67 + #_Mdoub�_BEGIN_NAMESPACE + +__BEGIN_NAMESPACE_STD + + + ) + +68 + #_Mdoub�_END_NAMESPACE + +__END_NAMESPACE_STD + + + ) + +69 + ~<b�s/m�h��s.h +> + +70 #unde� +_Mdoub�_ + + +71 #unde� +_Mdoub�_BEGIN_NAMESPACE + + +72 #unde� +_Mdoub�_END_NAMESPACE + + +73 #unde� +__MATH_PRECNAME + + +75 #i� +def�ed + +__USE_MISC + || def�ed +__USE_ISOC99 + + +81 #i�de� +_M��t_ + + +82 + #_M��t_ + + + ) + +84 + #_Mdoub�_ + +_M��t_ + + + ) + +85 + #__MATH_PRECNAME +( +�me +, +r +��me## +f +## + ) +r + +86 + #_Mdoub�_BEGIN_NAMESPACE + +__BEGIN_NAMESPACE_C99 + + + ) + +87 + #_Mdoub�_END_NAMESPACE + +__END_NAMESPACE_C99 + + + ) + +88 + ~<b�s/m�h��s.h +> + +89 #unde� +_Mdoub�_ + + +90 #unde� +_Mdoub�_BEGIN_NAMESPACE + + +91 #unde� +_Mdoub�_END_NAMESPACE + + +92 #unde� +__MATH_PRECNAME + + +94 #i�!( +def�ed + +__NO_LONG_DOUBLE_MATH + && def�ed +_LIBC +) \ + +95 || +def�ed + +__LDBL_COMPAT + + +96 #ifde� +__LDBL_COMPAT + + +98 #ifde� +__USE_ISOC99 + + +99 + $__�dbl_�x�ow�df + ( +__x +, +__y +) + +100 +__THROW + + `__��ibu�__ + (( +__cڡ__ +)); + +101 #ifde� +__REDIRECT_NTH + + +102 + `__REDIRECT_NTH + ( +�x�ow�df +, ( +__x +, +__y +), + +103 +__�dbl_�x�ow�df +) + +104 + `__��ibu�__ + (( +__cڡ__ +)); + +105 + `__REDIRECT_NTH + ( +�x�ow�d +, ( +__x +, +__y +), + +106 +�x�� +� + `__��ibu�__ + (( +__cڡ__ +)); + +107 + `__REDIRECT_NTH + ( +�x�ow�dl +, + +108 ( +__x +, +__y +), + +109 +�x�� +� + `__��ibu�__ + (( +__cڡ__ +)); + +113 #unde� +__MATHDECL_1 + + +114 + #__MATHDECL_2 +( +ty� +, +fun�i� +, +suffix +, +�gs +, +��s +) \ + +115 +ty� + + `__REDIRECT_NTH +( + `__MATH_PRECNAME +( +fun�i� +, +suffix +), \ + +116 +�gs +, +��s +) + + ) + +117 + #__MATHDECL_1 +( +ty� +, +fun�i� +, +suffix +, +�gs +) \ + +118 + `__MATHDECL_2 +( +ty� +, +fun�i� +, +suffix +, +�gs +, + `__CONCAT +(fun�i�,suffix)) + + ) + +124 #i�de� +_Ml�g_doub�_ + + +125 + #_Ml�g_doub�_ + + + ) + +127 + #_Mdoub�_ + +_Ml�g_doub�_ + + + ) + +128 + #__MATH_PRECNAME +( +�me +, +r +��me## +l +## + ) +r + +129 + #_Mdoub�_BEGIN_NAMESPACE + +__BEGIN_NAMESPACE_C99 + + + ) + +130 + #_Mdoub�_END_NAMESPACE + +__END_NAMESPACE_C99 + + + ) + +131 + #__MATH_DECLARE_LDOUBLE + 1 + + ) + +132 + ~<b�s/m�h��s.h +> + +133 #unde� +_Mdoub�_ + + +134 #unde� +_Mdoub�_BEGIN_NAMESPACE + + +135 #unde� +_Mdoub�_END_NAMESPACE + + +136 #unde� +__MATH_PRECNAME + + +141 #unde� +__MATHDECL_1 + + +142 #unde� +__MATHDECL + + +143 #unde� +__MATHCALL + + +146 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN + + +148 +signgam +; + +153 #ifde� +__USE_ISOC99 + + +191 +FP_NAN + = + +192 + #FP_NAN + 0 + + ) + +193 +FP_NAN +, + +194 +FP_INFINITE + = + +195 + #FP_INFINITE + 1 + + ) + +196 +FP_INFINITE +, + +197 +FP_ZERO + = + +198 + #FP_ZERO + 2 + + ) + +199 +FP_ZERO +, + +200 +FP_SUBNORMAL + = + +201 + #FP_SUBNORMAL + 3 + + ) + +202 +FP_SUBNORMAL +, + +203 +FP_NORMAL + = + +204 + #FP_NORMAL + 4 + + ) + +205 +FP_NORMAL + + +209 #ifde� +__NO_LONG_DOUBLE_MATH + + +210 + #��assify +( +x +) \ + +211 ( ( +x +�=� (�? + `__��assifyf + (x�: + `__��assify + (x)) + + ) + +213 + #��assify +( +x +) \ + +214 ( ( +x +) == () \ + +215 ? + `__��assifyf + ( +x +) \ + +216 : ( +x +) == () \ + +217 ? + `__��assify + ( +x +�: + `__��assifyl + (x)) + + ) + +221 #ifde� +__NO_LONG_DOUBLE_MATH + + +222 + #signb� +( +x +) \ + +223 ( ( +x +�=� (�? + `__signb�f + (x�: + `__signb� + (x)) + + ) + +225 + #signb� +( +x +) \ + +226 ( ( +x +) == () \ + +227 ? + `__signb�f + ( +x +) \ + +228 : ( +x +) == () \ + +229 ? + `__signb� + ( +x +�: + `__signb�l + (x)) + + ) + +233 #ifde� +__NO_LONG_DOUBLE_MATH + + +234 + #isf��e +( +x +) \ + +235 ( ( +x +�=� (�? + `__f��ef + (x�: + `__f��e + (x)) + + ) + +237 + #isf��e +( +x +) \ + +238 ( ( +x +) == () \ + +239 ? + `__f��ef + ( +x +) \ + +240 : ( +x +) == () \ + +241 ? + `__f��e + ( +x +�: + `__f��� + (x)) + + ) + +245 + #i��m� +( +x +�( + `��assify + (x�=� +FP_NORMAL +) + + ) + +249 #ifde� +__NO_LONG_DOUBLE_MATH + + +250 + #i�� +( +x +) \ + +251 ( ( +x +�=� (�? + `__i��f + (x�: + `__i�� + (x)) + + ) + +253 + #i�� +( +x +) \ + +254 ( ( +x +) == () \ + +255 ? + `__i��f + ( +x +) \ + +256 : ( +x +) == () \ + +257 ? + `__i�� + ( +x +�: + `__i��l + (x)) + + ) + +261 #ifde� +__NO_LONG_DOUBLE_MATH + + +262 + #is�f +( +x +) \ + +263 ( ( +x +�=� (�? + `__is�ff + (x�: + `__is�f + (x)) + + ) + +265 + #is�f +( +x +) \ + +266 ( ( +x +) == () \ + +267 ? + `__is�ff + ( +x +) \ + +268 : ( +x +) == () \ + +269 ? + `__is�f + ( +x +�: + `__is�� + (x)) + + ) + +273 + #MATH_ERRNO + 1 + + ) + +274 + #MATH_ERREXCEPT + 2 + + ) + +279 #i�de� +__FAST_MATH__ + + +280 + #m�h_�rh�dl�g + ( +MATH_ERRNO + | +MATH_ERREXCEPT +) + + ) + +285 #ifde� +__USE_GNU + + +287 #ifde� +__NO_LONG_DOUBLE_MATH + + +288 + #issig�l�g +( +x +) \ + +289 ( ( +x +�=� (�? + `__issig�l�gf + (x�: + `__issig�l�g + (x)) + + ) + +291 + #issig�l�g +( +x +) \ + +292 ( ( +x +) == () \ + +293 ? + `__issig�l�gf + ( +x +) \ + +294 : ( +x +) == () \ + +295 ? + `__issig�l�g + ( +x +�: + `__issig�l�gl + (x)) + + ) + +299 #ifdef +__USE_MISC + + +303 +_IEEE_ + = -1, + +304 +_SVID_ +, + +305 +_XOPEN_ +, + +306 +_POSIX_ +, + +307 +_ISOC_ + + +308 } + t_LIB_VERSION_TYPE +; + +313 +_LIB_VERSION_TYPE + +_LIB_VERSION +; + +317 #ifde� +__USE_SVID + + +323 #ifde� +__�lu�lus + + +324 +__ex��i� + + +326 +ex��i� + + +329 +ty� +; + +330 * +�me +; + +331 +�g1 +; + +332 +�g2 +; + +333 +�tv� +; + +334 + } +}; + +336 #ifde� +__�lu�lus + + +337 + $m�h�r + ( +__ex��i� + * +__exc +� + `throw + (); + +339 + `m�h�r + ( +ex��i� + * +__exc +); + +342 + #X_TLOSS + 1.41484755040568800000e+16 + + ) + +345 + #DOMAIN + 1 + + ) + +346 + #SING + 2 + + ) + +347 + #OVERFLOW + 3 + + ) + +348 + #UNDERFLOW + 4 + + ) + +349 + #TLOSS + 5 + + ) + +350 + #PLOSS + 6 + + ) + +353 + #HUGE + 3.40282347e+38F + + ) + +357 #ifde� +__USE_XOPEN + + +359 + #MAXFLOAT + 3.40282347e+38F + + ) + +366 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN + + +367 + #M_E + 2.7182818284590452354 + + ) + +368 + #M_LOG2E + 1.4426950408889634074 + + ) + +369 + #M_LOG10E + 0.43429448190325182765 + + ) + +370 + #M_LN2 + 0.69314718055994530942 + + ) + +371 + #M_LN10 + 2.30258509299404568402 + + ) + +372 + #M_PI + 3.14159265358979323846 + + ) + +373 + #M_PI_2 + 1.57079632679489661923 + + ) + +374 + #M_PI_4 + 0.78539816339744830962 + + ) + +375 + #M_1_PI + 0.31830988618379067154 + + ) + +376 + #M_2_PI + 0.63661977236758134308 + + ) + +377 + #M_2_SQRTPI + 1.12837916709551257390 + + ) + +378 + #M_SQRT2 + 1.41421356237309504880 + + ) + +379 + #M_SQRT1_2 + 0.70710678118654752440 + + ) + +385 #ifde� +__USE_GNU + + +386 + #M_El + 2.718281828459045235360287471352662498L + + ) + +387 + #M_LOG2El + 1.442695040888963407359924681001892137L + + ) + +388 + #M_LOG10El + 0.434294481903251827651128918916605082L + + ) + +389 + #M_LN2l + 0.693147180559945309417232121458176568L + + ) + +390 + #M_LN10l + 2.302585092994045684017991454684364208L + + ) + +391 + #M_PIl + 3.141592653589793238462643383279502884L + + ) + +392 + #M_PI_2l + 1.570796326794896619231321691639751442L + + ) + +393 + #M_PI_4l + 0.785398163397448309615660845819875721L + + ) + +394 + #M_1_PIl + 0.318309886183790671537767526745028724L + + ) + +395 + #M_2_PIl + 0.636619772367581343075535053490057448L + + ) + +396 + #M_2_SQRTPIl + 1.128379167095512573896158903121545172L + + ) + +397 + #M_SQRT2l + 1.414213562373095048801688724209698079L + + ) + +398 + #M_SQRT1_2l + 0.707106781186547524400844362104849039L + + ) + +405 #i� +def�ed + +__STRICT_ANSI__ + && !def�ed +__NO_MATH_INLINES + + +406 + #__NO_MATH_INLINES + 1 + + ) + +409 #i� +def�ed + +__USE_ISOC99 + && + `__GNUC_PREREQ +(2,97) + +416 + #isg��� +( +x +, +y +� + `__bu�t�_isg��� +(x, y) + + ) + +417 + #isg���equ� +( +x +, +y +� + `__bu�t�_isg���equ� +(x, y) + + ) + +418 + #i�ess +( +x +, +y +� + `__bu�t�_i�ess +(x, y) + + ) + +419 + #i�es�qu� +( +x +, +y +� + `__bu�t�_i�es�qu� +(x, y) + + ) + +420 + #i�essg��� +( +x +, +y +� + `__bu�t�_i�essg��� +(x, y) + + ) + +421 + #isun�d�ed +( +u +, +v +� + `__bu�t�_isun�d�ed +(u, v) + + ) + +425 #ifde� +__USE_EXTERN_INLINES + + +426 + ~<b�s/m�h�l�e.h +> + +431 #i� +def�ed + +__FINITE_MATH_ONLY__ + && __FINITE_MATH_ONLY__ > 0 + +432 + ~<b�s/m�h-f��e.h +> + +435 #ifde� +__USE_ISOC99 + + +439 #i�de� +isg��� + + +440 + #isg��� +( +x +, +y +) \ + +441 ( +__ex�nsi�__ + \ + +442 ({ + `__ty�of__ +( +x +� +__x + = (x); __ty�of__( +y +� +__y + = (y); \ + +443 ! + `isun�d�ed + ( +__x +, +__y +�&& __x > __y; + } +})) + + ) + +447 #i�de� +isg���equ� + + +448 + #isg���equ� +( +x +, +y +) \ + +449 ( +__ex�nsi�__ + \ + +450 ({ + `__ty�of__ +( +x +� +__x + = (x); __ty�of__( +y +� +__y + = (y); \ + +451 ! + `isun�d�ed + ( +__x +, +__y +�&& __x >�__y; })) + + ) + +455 #i�de� +i�ess + + +456 + #i�ess +( +x +, +y +) \ + +457 ( +__ex�nsi�__ + \ + +458 ({ + `__ty�of__ +( +x +� +__x + = (x); __ty�of__( +y +� +__y + = (y); \ + +459 ! + `isun�d�ed + ( +__x +, +__y +�&& __x < __y; })) + + ) + +463 #i�de� +i�es�qu� + + +464 + #i�es�qu� +( +x +, +y +) \ + +465 ( +__ex�nsi�__ + \ + +466 ({ + `__ty�of__ +( +x +� +__x + = (x); __ty�of__( +y +� +__y + = (y); \ + +467 ! + `isun�d�ed + ( +__x +, +__y +�&& __x <�__y; })) + + ) + +471 #i�de� +i�essg��� + + +472 + #i�essg��� +( +x +, +y +) \ + +473 ( +__ex�nsi�__ + \ + +474 ({ + `__ty�of__ +( +x +� +__x + = (x); __ty�of__( +y +� +__y + = (y); \ + +475 ! + `isun�d�ed + ( +__x +, +__y +�&& (__x < __y || __y < __x); })) + + ) + +479 #i�de� +isun�d�ed + + +480 + #isun�d�ed +( +u +, +v +) \ + +481 ( +__ex�nsi�__ + \ + +482 ({ + `__ty�of__ +( +u +� +__u + = (u); __ty�of__( +v +� +__v + = (v); \ + +483 + `��assify + ( +__u +�=� +FP_NAN + || fp�assify ( +__v +�=�FP_NAN; })) + + ) + +488 + g__END_DECLS + + + @/usr/include/net/if.h + +19 #i�de� +_NET_IF_H + + +20 + #_NET_IF_H + 1 + + ) + +22 + ~<�u�s.h +> + +24 #ifde� +__USE_MISC + + +25 + ~<sys/ty�s.h +> + +26 + ~<sys/sock�.h +> + +31 + #IF_NAMESIZE + 16 + + ) + +33 + sif_�me�dex + + +35 + mif_�dex +; + +36 * + mif_�me +; + +40 #ifde� +__USE_MISC + + +44 + mIFF_UP + = 0x1, + +45 + #IFF_UP + +IFF_UP + + + ) + +46 + mIFF_BROADCAST + = 0x2, + +47 + #IFF_BROADCAST + +IFF_BROADCAST + + + ) + +48 + mIFF_DEBUG + = 0x4, + +49 + #IFF_DEBUG + +IFF_DEBUG + + + ) + +50 + mIFF_LOOPBACK + = 0x8, + +51 + #IFF_LOOPBACK + +IFF_LOOPBACK + + + ) + +52 + mIFF_POINTOPOINT + = 0x10, + +53 + #IFF_POINTOPOINT + +IFF_POINTOPOINT + + + ) + +54 + mIFF_NOTRAILERS + = 0x20, + +55 + #IFF_NOTRAILERS + +IFF_NOTRAILERS + + + ) + +56 + mIFF_RUNNING + = 0x40, + +57 + #IFF_RUNNING + +IFF_RUNNING + + + ) + +58 + mIFF_NOARP + = 0x80, + +59 + #IFF_NOARP + +IFF_NOARP + + + ) + +60 + mIFF_PROMISC + = 0x100, + +61 + #IFF_PROMISC + +IFF_PROMISC + + + ) + +64 + mIFF_ALLMULTI + = 0x200, + +65 + #IFF_ALLMULTI + +IFF_ALLMULTI + + + ) + +67 + mIFF_MASTER + = 0x400, + +68 + #IFF_MASTER + +IFF_MASTER + + + ) + +69 + mIFF_SLAVE + = 0x800, + +70 + #IFF_SLAVE + +IFF_SLAVE + + + ) + +72 + mIFF_MULTICAST + = 0x1000, + +73 + #IFF_MULTICAST + +IFF_MULTICAST + + + ) + +75 + mIFF_PORTSEL + = 0x2000, + +76 + #IFF_PORTSEL + +IFF_PORTSEL + + + ) + +77 + mIFF_AUTOMEDIA + = 0x4000, + +78 + #IFF_AUTOMEDIA + +IFF_AUTOMEDIA + + + ) + +79 + mIFF_DYNAMIC + = 0x8000 + +80 + #IFF_DYNAMIC + +IFF_DYNAMIC + + + ) + +88 + si�ddr + + +90 +sockaddr + + mi�_addr +; + +93 +sockaddr + + mifu_br�daddr +; + +94 +sockaddr + + mifu_d�addr +; + +95 } + mi�_ifu +; + +96 +i�� + * + mi�_i� +; + +97 +i�ddr + * + mi�_�xt +; + +100 + #i�_br�daddr + +i�_ifu +. +ifu_br�daddr + + + ) + +101 + #i�_d�addr + +i�_ifu +. +ifu_d�addr + + + ) + +111 + sifm� + + +113 + mmem_��t +; + +114 + mmem_�d +; + +115 + mba�_addr +; + +116 + m�q +; + +117 + mdma +; + +118 + mp�t +; + +126 + si�eq + + +128 + #IFHWADDRLEN + 6 + + ) + +129 + #IFNAMSIZ + +IF_NAMESIZE + + + ) + +132 + mi�n_�me +[ +IFNAMSIZ +]; + +133 } + mi�_i�n +; + +137 +sockaddr + + mi�u_addr +; + +138 +sockaddr + + mi�u_d�addr +; + +139 +sockaddr + + mi�u_br�daddr +; + +140 +sockaddr + + mi�u_�tmask +; + +141 +sockaddr + + mi�u_hwaddr +; + +142 + mi�u_�ags +; + +143 + mi�u_iv�ue +; + +144 + mi�u_mtu +; + +145 +ifm� + + mi�u_m� +; + +146 + mi�u_�ave +[ +IFNAMSIZ +]; + +147 + mi�u_�w�me +[ +IFNAMSIZ +]; + +148 +__�ddr_t + + mi�u_d�a +; + +149 } + mi�_i�u +; + +151 + #i�_�me + +i�_i�n +. +i�n_�me + + + ) + +152 + #i�_hwaddr + +i�_i�u +. +i�u_hwaddr + + + ) + +153 + #i�_addr + +i�_i�u +. +i�u_addr + + + ) + +154 + #i�_d�addr + +i�_i�u +. +i�u_d�addr + + + ) + +155 + #i�_br�daddr + +i�_i�u +. +i�u_br�daddr + + + ) + +156 + #i�_�tmask + +i�_i�u +. +i�u_�tmask + + + ) + +157 + #i�_�ags + +i�_i�u +. +i�u_�ags + + + ) + +158 + #i�_m�ric + +i�_i�u +. +i�u_iv�ue + + + ) + +159 + #i�_mtu + +i�_i�u +. +i�u_mtu + + + ) + +160 + #i�_m� + +i�_i�u +. +i�u_m� + + + ) + +161 + #i�_�ave + +i�_i�u +. +i�u_�ave + + + ) + +162 + #i�_d�a + +i�_i�u +. +i�u_d�a + + + ) + +163 + #i�_if�dex + +i�_i�u +. +i�u_iv�ue + + + ) + +164 + #i�_b�dwidth + +i�_i�u +. +i�u_iv�ue + + + ) + +165 + #i�_q�n + +i�_i�u +. +i�u_iv�ue + + + ) + +166 + #i�_�w�me + +i�_i�u +. +i�u_�w�me + + + ) + +167 + #_IOT_i�eq + + `_IOT +( + `_IOTS +(), +IFNAMSIZ +,_IOTS(),16,0,0) + + ) + +168 + #_IOT_i�eq_sh�t + + `_IOT +( + `_IOTS +(), +IFNAMSIZ +,_IOTS(),1,0,0) + + ) + +169 + #_IOT_i�eq_�t + + `_IOT +( + `_IOTS +(), +IFNAMSIZ +,_IOTS(),1,0,0) + + ) + +176 + sifc�f + + +178 + mifc_�n +; + +181 +__�ddr_t + + mifcu_buf +; + +182 +i�eq + * + mifcu_�q +; + +183 } + mifc_ifcu +; + +185 + #ifc_buf + +ifc_ifcu +. +ifcu_buf + + + ) + +186 + #ifc_�q + +ifc_ifcu +. +ifcu_�q + + + ) + +187 + #_IOT_ifc�f + + `_IOT +( + `_IOTS +( +ifc�f +),1,0,0,0,0� + + ) + +190 +__BEGIN_DECLS + + +193 + $if_�m�o�dex + (cڡ * +__i�ame +� +__THROW +; + +194 * + $if_�dext�ame + ( +__if�dex +, * +__i�ame +� +__THROW +; + +197 +if_�me�dex + * + $if_�me�dex + (� +__THROW +; + +200 + $if_��me�dex + ( +if_�me�dex + * +__�r +� +__THROW +; + +202 +__END_DECLS + + + @/usr/include/netdb.h + +22 #i�def +_NETDB_H + + +23 + #_NETDB_H + 1 + + ) + +25 + ~<�u�s.h +> + +27 + ~<�t��/�.h +> + +28 + ~<�d�t.h +> + +29 #ifde� +__USE_MISC + + +32 + ~<�c/�tdb.h +> + +35 #ifde� +__USE_GNU + + +36 + #__�ed_sigev�t_t + + + ) + +37 + ~<b�s/sig�fo.h +> + +38 + #__�ed_time�ec + + + ) + +39 + ~<time.h +> + +42 + ~<b�s/�tdb.h +> + +45 + #_PATH_HEQUIV + "/�c/ho�s.equiv" + + ) + +46 + #_PATH_HOSTS + "/�c/ho�s" + + ) + +47 + #_PATH_NETWORKS + "/�c/�tw�ks" + + ) + +48 + #_PATH_NSSWITCH_CONF + "/�c/nssw�ch.c�f" + + ) + +49 + #_PATH_PROTOCOLS + "/�c/��oc�s" + + ) + +50 + #_PATH_SERVICES + "/�c/�rvi�s" + + ) + +53 + g__BEGIN_DECLS + + +55 #i� +def�ed + +__USE_MISC + || !def�ed +__USE_XOPEN2K8 + + +58 + #h_��o + (* + `__h_��o_lo�ti� + ()) + + ) + +61 * + $__h_��o_lo�ti� + (� +__THROW + + `__��ibu�__ + (( +__cڡ__ +)); + +65 + #HOST_NOT_FOUND + 1 + + ) + +66 + #TRY_AGAIN + 2 + + ) + +68 + #NO_RECOVERY + 3 + + ) + +70 + #NO_DATA + 4 + + ) + +73 #i� +def�ed + +__USE_MISC + || def�ed +__USE_GNU + + +74 + #NETDB_INTERNAL + -1 + + ) + +75 + #NETDB_SUCCESS + 0 + + ) + +76 + #NO_ADDRESS + +NO_DATA + + + ) + +79 #i� +def�ed + +__USE_XOPEN2K + || def�ed +__USE_XOPEN_EXTENDED + + +81 + #IPPORT_RESERVED + 1024 + + ) + +84 #ifde� +__USE_GNU + + +86 + #SCOPE_DELIMITER + '%' + + ) + +89 #ifde� +__USE_MISC + + +92 + $h�r� + (cڡ * +__�r +� +__THROW +; + +95 cڡ * + $h���� + ( +__�r_num +� +__THROW +; + +100 + sho��t + + +102 * +h_�me +; + +103 ** +h_���s +; + +104 +h_add�y� +; + +105 +h_�ngth +; + +106 ** +h_addr_li� +; + +107 #i� +def�ed + +__USE_MISC + || def�ed +__USE_GNU + + +108 + #h_addr + +h_addr_li� +[0] + + ) + +117 + `�tho��t + ( +__�ay_ݒ +); + +123 + `�dho��t + (); + +130 +ho��t + * + `g�ho��t + (); + +137 +ho��t + * + `g�ho�byaddr + (cڡ * +__addr +, +__sock�n_t + +__�n +, + +138 +__ty� +); + +144 +ho��t + * + `g�ho�by�me + (cڡ * +__�me +); + +146 #ifde� +__USE_MISC + + +155 +ho��t + * + `g�ho�by�me2 + (cڡ * +__�me +, +__af +); + +167 + `g�ho��t_r + ( +ho��t + * +__��ri� + +__�su�_buf +, + +168 * +__��ri� + +__buf +, +size_t + +__bu� +, + +169 +ho��t + ** +__��ri� + +__�su� +, + +170 * +__��ri� + +__h_��� +); + +172 + `g�ho�byaddr_r + (cڡ * +__��ri� + +__addr +, +__sock�n_t + +__�n +, + +173 +__ty� +, + +174 +ho��t + * +__��ri� + +__�su�_buf +, + +175 * +__��ri� + +__buf +, +size_t + +__bu� +, + +176 +ho��t + ** +__��ri� + +__�su� +, + +177 * +__��ri� + +__h_��� +); + +179 + `g�ho�by�me_r + (cڡ * +__��ri� + +__�me +, + +180 +ho��t + * +__��ri� + +__�su�_buf +, + +181 * +__��ri� + +__buf +, +size_t + +__bu� +, + +182 +ho��t + ** +__��ri� + +__�su� +, + +183 * +__��ri� + +__h_��� +); + +185 + `g�ho�by�me2_r + (cڡ * +__��ri� + +__�me +, +__af +, + +186 +ho��t + * +__��ri� + +__�su�_buf +, + +187 * +__��ri� + +__buf +, +size_t + +__bu� +, + +188 +ho��t + ** +__��ri� + +__�su� +, + +189 * +__��ri� + +__h_��� +); + +198 + `����t + ( +__�ay_ݒ +); + +204 + `�dË� + (); + +211 +Ë� + * + `g�Ë� + (); + +218 +Ë� + * + `g��tbyaddr + ( +u�t32_t + +__�t +, +__ty� +); + +224 +Ë� + * + `g��tby�me + (cڡ * +__�me +); + +226 #ifdef +__USE_MISC + + +237 + `g�Ë�_r + ( +Ë� + * +__��ri� + +__�su�_buf +, + +238 * +__��ri� + +__buf +, +size_t + +__bu� +, + +239 +Ë� + ** +__��ri� + +__�su� +, + +240 * +__��ri� + +__h_��� +); + +242 + `g��tbyaddr_r + ( +u�t32_t + +__�t +, +__ty� +, + +243 +Ë� + * +__��ri� + +__�su�_buf +, + +244 * +__��ri� + +__buf +, +size_t + +__bu� +, + +245 +Ë� + ** +__��ri� + +__�su� +, + +246 * +__��ri� + +__h_��� +); + +248 + `g��tby�me_r + (cڡ * +__��ri� + +__�me +, + +249 +Ë� + * +__��ri� + +__�su�_buf +, + +250 * +__��ri� + +__buf +, +size_t + +__bu� +, + +251 +Ë� + ** +__��ri� + +__�su� +, + +252 * +__��ri� + +__h_��� +); + +257 + s�rv�t + + +259 * +s_�me +; + +260 ** +s_���s +; + +261 +s_p�t +; + +262 * +s_��o +; + +270 + `�t�rv�t + ( +__�ay_ݒ +); + +276 + `�d�rv�t + (); + +283 +�rv�t + * + `g��rv�t + (); + +290 +�rv�t + * + `g��rvby�me + (cڡ * +__�me +, cڡ * +__��o +); + +297 +�rv�t + * + `g��rvbyp�t + ( +__p�t +, cڡ * +__��o +); + +300 #ifdef +__USE_MISC + + +308 + `g��rv�t_r + ( +�rv�t + * +__��ri� + +__�su�_buf +, + +309 * +__��ri� + +__buf +, +size_t + +__bu� +, + +310 +�rv�t + ** +__��ri� + +__�su� +); + +312 + `g��rvby�me_r + (cڡ * +__��ri� + +__�me +, + +313 cڡ * +__��ri� + +__��o +, + +314 +�rv�t + * +__��ri� + +__�su�_buf +, + +315 * +__��ri� + +__buf +, +size_t + +__bu� +, + +316 +�rv�t + ** +__��ri� + +__�su� +); + +318 + `g��rvbyp�t_r + ( +__p�t +, cڡ * +__��ri� + +__��o +, + +319 +�rv�t + * +__��ri� + +__�su�_buf +, + +320 * +__��ri� + +__buf +, +size_t + +__bu� +, + +321 +�rv�t + ** +__��ri� + +__�su� +); + +326 + s���� + + +328 * +p_�me +; + +329 ** +p_���s +; + +330 +p_��o +; + +338 + `��r��� + ( +__�ay_ݒ +); + +344 + `�d���� + (); + +351 +���� + * + `g����� + (); + +357 +���� + * + `g���oby�me + (cڡ * +__�me +); + +363 +���� + * + `g���obynumb� + ( +__��o +); + +366 #ifdef +__USE_MISC + + +374 + `g�����_r + ( +���� + * +__��ri� + +__�su�_buf +, + +375 * +__��ri� + +__buf +, +size_t + +__bu� +, + +376 +���� + ** +__��ri� + +__�su� +); + +378 + `g���oby�me_r + (cڡ * +__��ri� + +__�me +, + +379 +���� + * +__��ri� + +__�su�_buf +, + +380 * +__��ri� + +__buf +, +size_t + +__bu� +, + +381 +���� + ** +__��ri� + +__�su� +); + +383 + `g���obynumb�_r + ( +__��o +, + +384 +���� + * +__��ri� + +__�su�_buf +, + +385 * +__��ri� + +__buf +, +size_t + +__bu� +, + +386 +���� + ** +__��ri� + +__�su� +); + +395 + `���g�� + (cڡ * +__�tgroup +); + +403 + `�d�tg�� + (); + +412 + `g��tg�� + (** +__��ri� + +__ho�p +, + +413 ** +__��ri� + +__u�� +, + +414 ** +__��ri� + +__doma�p +); + +423 + `��tgr + (cڡ * +__�tgroup +, cڡ * +__ho� +, + +424 cڡ * +__u�r +, cڡ * +__doma� +); + +432 + `g��tg��_r + (** +__��ri� + +__ho�p +, + +433 ** +__��ri� + +__u�� +, + +434 ** +__��ri� + +__doma�p +, + +435 * +__��ri� + +__buf�r +, +size_t + +__bu� +); + +439 #ifde� +__USE_BSD + + +451 + `rcmd + (** +__��ri� + +__aho� +, +__��t +, + +452 cڡ * +__��ri� + +__locu�r +, + +453 cڡ * +__��ri� + +__�mu�r +, + +454 cڡ * +__��ri� + +__cmd +, *__��ri� +__fd2p +); + +463 + `rcmd_af + (** +__��ri� + +__aho� +, +__��t +, + +464 cڡ * +__��ri� + +__locu�r +, + +465 cڡ * +__��ri� + +__�mu�r +, + +466 cڡ * +__��ri� + +__cmd +, *__��ri� +__fd2p +, + +467 +�_�m�y_t + +__af +); + +479 + `�xec + (** +__��ri� + +__aho� +, +__��t +, + +480 cڡ * +__��ri� + +__�me +, + +481 cڡ * +__��ri� + +__�ss +, + +482 cڡ * +__��ri� + +__cmd +, *__��ri� +__fd2p +); + +491 + `�xec_af + (** +__��ri� + +__aho� +, +__��t +, + +492 cڡ * +__��ri� + +__�me +, + +493 cڡ * +__��ri� + +__�ss +, + +494 cڡ * +__��ri� + +__cmd +, *__��ri� +__fd2p +, + +495 +�_�m�y_t + +__af +); + +505 + `ru�rok + (cڡ * +__rho� +, +__su�r +, + +506 cڡ * +__�mu�r +, cڡ * +__locu�r +); + +515 + `ru�rok_af + (cڡ * +__rho� +, +__su�r +, + +516 cڡ * +__�mu�r +, cڡ * +__locu�r +, + +517 +�_�m�y_t + +__af +); + +528 + `�u�rok + ( +u�t32_t + +__�ddr +, +__su�r +, + +529 cڡ * +__�mu�r +, cڡ * +__locu�r +); + +539 + `�u�rok_af + (cڡ * +__�ddr +, +__su�r +, + +540 cڡ * +__�mu�r +, cڡ * +__locu�r +, + +541 +�_�m�y_t + +__af +); + +551 + `�esvp�t + (* +__�p�t +); + +560 + `�esvp�t_af + (* +__�p�t +, +�_�m�y_t + +__af +); + +565 #ifdef +__USE_POSIX + + +567 + saddr�fo + + +569 +ai_�ags +; + +570 +ai_�m�y +; + +571 +ai_sockty� +; + +572 +ai_��oc� +; + +573 +sock�n_t + +ai_add�� +; + +574 +sockaddr + * +ai_addr +; + +575 * +ai_�n��me +; + +576 +addr�fo + * +ai_�xt +; + +579 #ifde� +__USE_GNU + + +581 + sgaicb + + +583 cڡ * +�_�me +; + +584 cڡ * +�_�rvi� +; + +585 cڡ +addr�fo + * +�_�que� +; + +586 +addr�fo + * +�_�su� +; + +588 +__�tu� +; + +589 +__glibc_��rved +[5]; + +593 + #GAI_WAIT + 0 + + ) + +594 + #GAI_NOWAIT + 1 + + ) + +598 + #AI_PASSIVE + 0x0001 + + ) + +599 + #AI_CANONNAME + 0x0002 + + ) + +600 + #AI_NUMERICHOST + 0x0004 + + ) + +601 + #AI_V4MAPPED + 0x0008 + + ) + +602 + #AI_ALL + 0x0010 + + ) + +603 + #AI_ADDRCONFIG + 0x0020 + + ) + +605 #ifde� +__USE_GNU + + +606 + #AI_IDN + 0x0040 + + ) + +609 + #AI_CANONIDN + 0x0080 + + ) + +610 + #AI_IDN_ALLOW_UNASSIGNED + 0x0100 + + ) + +612 + #AI_IDN_USE_STD3_ASCII_RULES + 0x0200 + + ) + +615 + #AI_NUMERICSERV + 0x0400 + + ) + +618 + #EAI_BADFLAGS + -1 + + ) + +619 + #EAI_NONAME + -2 + + ) + +620 + #EAI_AGAIN + -3 + + ) + +621 + #EAI_FAIL + -4 + + ) + +622 + #EAI_FAMILY + -6 + + ) + +623 + #EAI_SOCKTYPE + -7 + + ) + +624 + #EAI_SERVICE + -8 + + ) + +625 + #EAI_MEMORY + -10 + + ) + +626 + #EAI_SYSTEM + -11 + + ) + +627 + #EAI_OVERFLOW + -12 + + ) + +628 #ifde� +__USE_GNU + + +629 + #EAI_NODATA + -5 + + ) + +630 + #EAI_ADDRFAMILY + -9 + + ) + +631 + #EAI_INPROGRESS + -100 + + ) + +632 + #EAI_CANCELED + -101 + + ) + +633 + #EAI_NOTCANCELED + -102 + + ) + +634 + #EAI_ALLDONE + -103 + + ) + +635 + #EAI_INTR + -104 + + ) + +636 + #EAI_IDN_ENCODE + -105 + + ) + +639 #ifde� +__USE_MISC + + +640 + #NI_MAXHOST + 1025 + + ) + +641 + #NI_MAXSERV + 32 + + ) + +644 + #NI_NUMERICHOST + 1 + + ) + +645 + #NI_NUMERICSERV + 2 + + ) + +646 + #NI_NOFQDN + 4 + + ) + +647 + #NI_NAMEREQD + 8 + + ) + +648 + #NI_DGRAM + 16 + + ) + +649 #ifde� +__USE_GNU + + +650 + #NI_IDN + 32 + + ) + +651 + #NI_IDN_ALLOW_UNASSIGNED + 64 + + ) + +653 + #NI_IDN_USE_STD3_ASCII_RULES + 128 + + ) + +662 + `g�addr�fo + (cڡ * +__��ri� + +__�me +, + +663 cڡ * +__��ri� + +__�rvi� +, + +664 cڡ +addr�fo + * +__��ri� + +__�q +, + +665 +addr�fo + ** +__��ri� + +__�i +); + +668 + $�addr�fo + ( +addr�fo + * +__ai +� +__THROW +; + +671 cڡ * + $gai_���� + ( +__ecode +� +__THROW +; + +677 + `g��me�fo + (cڡ +sockaddr + * +__��ri� + +__� +, + +678 +sock�n_t + +__��n +, * +__��ri� + +__ho� +, + +679 +sock�n_t + +__ho��n +, * +__��ri� + +__�rv +, + +680 +sock�n_t + +__�rv�n +, +__�ags +); + +683 #ifde� +__USE_GNU + + +692 + `g�addr�fo_a + ( +__mode +, +gaicb + * +__li� +[ +__��ri�_�r +], + +693 +__�t +, +sigev�t + * +__��ri� + +__sig +); + +703 + `gai_su��d + (cڡ +gaicb + *cڡ +__li� +[], +__�t +, + +704 cڡ +time�ec + * +__timeout +); + +707 + $gai_�r� + ( +gaicb + * +__�q +� +__THROW +; + +710 + $gai_�n�l + ( +gaicb + * +__gaicbp +� +__THROW +; + +713 +__END_DECLS + + + @/usr/include/netinet/in.h + +18 #i�def +_NETINET_IN_H + + +19 + #_NETINET_IN_H + 1 + + ) + +21 + ~<�u�s.h +> + +22 + ~<�d�t.h +> + +23 + ~<sys/sock�.h +> + +24 + ~<b�s/ty�s.h +> + +27 +__BEGIN_DECLS + + +30 +u�t32_t + + t�_addr_t +; + +31 + s�_addr + + +33 +�_addr_t + + ms_addr +; + +37 + ~<b�s/�.h +> + +42 + mIPPROTO_IP + = 0, + +43 + #IPPROTO_IP + +IPPROTO_IP + + + ) + +44 + mIPPROTO_ICMP + = 1, + +45 + #IPPROTO_ICMP + +IPPROTO_ICMP + + + ) + +46 + mIPPROTO_IGMP + = 2, + +47 + #IPPROTO_IGMP + +IPPROTO_IGMP + + + ) + +48 + mIPPROTO_IPIP + = 4, + +49 + #IPPROTO_IPIP + +IPPROTO_IPIP + + + ) + +50 + mIPPROTO_TCP + = 6, + +51 + #IPPROTO_TCP + +IPPROTO_TCP + + + ) + +52 + mIPPROTO_EGP + = 8, + +53 + #IPPROTO_EGP + +IPPROTO_EGP + + + ) + +54 + mIPPROTO_PUP + = 12, + +55 + #IPPROTO_PUP + +IPPROTO_PUP + + + ) + +56 + mIPPROTO_UDP + = 17, + +57 + #IPPROTO_UDP + +IPPROTO_UDP + + + ) + +58 + mIPPROTO_IDP + = 22, + +59 + #IPPROTO_IDP + +IPPROTO_IDP + + + ) + +60 + mIPPROTO_TP + = 29, + +61 + #IPPROTO_TP + +IPPROTO_TP + + + ) + +62 + mIPPROTO_DCCP + = 33, + +63 + #IPPROTO_DCCP + +IPPROTO_DCCP + + + ) + +64 + mIPPROTO_IPV6 + = 41, + +65 + #IPPROTO_IPV6 + +IPPROTO_IPV6 + + + ) + +66 + mIPPROTO_RSVP + = 46, + +67 + #IPPROTO_RSVP + +IPPROTO_RSVP + + + ) + +68 + mIPPROTO_GRE + = 47, + +69 + #IPPROTO_GRE + +IPPROTO_GRE + + + ) + +70 + mIPPROTO_ESP + = 50, + +71 + #IPPROTO_ESP + +IPPROTO_ESP + + + ) + +72 + mIPPROTO_AH + = 51, + +73 + #IPPROTO_AH + +IPPROTO_AH + + + ) + +74 + mIPPROTO_MTP + = 92, + +75 + #IPPROTO_MTP + +IPPROTO_MTP + + + ) + +76 + mIPPROTO_BEETPH + = 94, + +77 + #IPPROTO_BEETPH + +IPPROTO_BEETPH + + + ) + +78 + mIPPROTO_ENCAP + = 98, + +79 + #IPPROTO_ENCAP + +IPPROTO_ENCAP + + + ) + +80 + mIPPROTO_PIM + = 103, + +81 + #IPPROTO_PIM + +IPPROTO_PIM + + + ) + +82 + mIPPROTO_COMP + = 108, + +83 + #IPPROTO_COMP + +IPPROTO_COMP + + + ) + +84 + mIPPROTO_SCTP + = 132, + +85 + #IPPROTO_SCTP + +IPPROTO_SCTP + + + ) + +86 + mIPPROTO_UDPLITE + = 136, + +87 + #IPPROTO_UDPLITE + +IPPROTO_UDPLITE + + + ) + +88 + mIPPROTO_RAW + = 255, + +89 + #IPPROTO_RAW + +IPPROTO_RAW + + + ) + +90 + mIPPROTO_MAX + + +96 #i�de� +__USE_KERNEL_IPV6_DEFS + + +99 + mIPPROTO_HOPOPTS + = 0, + +100 + #IPPROTO_HOPOPTS + +IPPROTO_HOPOPTS + + + ) + +101 + mIPPROTO_ROUTING + = 43, + +102 + #IPPROTO_ROUTING + +IPPROTO_ROUTING + + + ) + +103 + mIPPROTO_FRAGMENT + = 44, + +104 + #IPPROTO_FRAGMENT + +IPPROTO_FRAGMENT + + + ) + +105 + mIPPROTO_ICMPV6 + = 58, + +106 + #IPPROTO_ICMPV6 + +IPPROTO_ICMPV6 + + + ) + +107 + mIPPROTO_NONE + = 59, + +108 + #IPPROTO_NONE + +IPPROTO_NONE + + + ) + +109 + mIPPROTO_DSTOPTS + = 60, + +110 + #IPPROTO_DSTOPTS + +IPPROTO_DSTOPTS + + + ) + +111 + mIPPROTO_MH + = 135 + +112 + #IPPROTO_MH + +IPPROTO_MH + + + ) + +117 +u�t16_t + + t�_p�t_t +; + +122 + mIPPORT_ECHO + = 7, + +123 + mIPPORT_DISCARD + = 9, + +124 + mIPPORT_SYSTAT + = 11, + +125 + mIPPORT_DAYTIME + = 13, + +126 + mIPPORT_NETSTAT + = 15, + +127 + mIPPORT_FTP + = 21, + +128 + mIPPORT_TELNET + = 23, + +129 + mIPPORT_SMTP + = 25, + +130 + mIPPORT_TIMESERVER + = 37, + +131 + mIPPORT_NAMESERVER + = 42, + +132 + mIPPORT_WHOIS + = 43, + +133 + mIPPORT_MTP + = 57, + +135 + mIPPORT_TFTP + = 69, + +136 + mIPPORT_RJE + = 77, + +137 + mIPPORT_FINGER + = 79, + +138 + mIPPORT_TTYLINK + = 87, + +139 + mIPPORT_SUPDUP + = 95, + +142 + mIPPORT_EXECSERVER + = 512, + +143 + mIPPORT_LOGINSERVER + = 513, + +144 + mIPPORT_CMDSERVER + = 514, + +145 + mIPPORT_EFSSERVER + = 520, + +148 + mIPPORT_BIFFUDP + = 512, + +149 + mIPPORT_WHOSERVER + = 513, + +150 + mIPPORT_ROUTESERVER + = 520, + +153 + mIPPORT_RESERVED + = 1024, + +156 + mIPPORT_USERRESERVED + = 5000 + +164 + #IN_CLASSA +( +a +�(((( +�_addr_t +)�)�& 0x80000000�=�0) + + ) + +165 + #IN_CLASSA_NET + 0xff000000 + + ) + +166 + #IN_CLASSA_NSHIFT + 24 + + ) + +167 + #IN_CLASSA_HOST + (0xfffffff�& ~ +IN_CLASSA_NET +) + + ) + +168 + #IN_CLASSA_MAX + 128 + + ) + +170 + #IN_CLASSB +( +a +�(((( +�_addr_t +)�)�& 0xc0000000�=�0x80000000) + + ) + +171 + #IN_CLASSB_NET + 0xffff0000 + + ) + +172 + #IN_CLASSB_NSHIFT + 16 + + ) + +173 + #IN_CLASSB_HOST + (0xfffffff�& ~ +IN_CLASSB_NET +) + + ) + +174 + #IN_CLASSB_MAX + 65536 + + ) + +176 + #IN_CLASSC +( +a +�(((( +�_addr_t +)�)�& 0xe0000000�=�0xc0000000) + + ) + +177 + #IN_CLASSC_NET + 0xffffff00 + + ) + +178 + #IN_CLASSC_NSHIFT + 8 + + ) + +179 + #IN_CLASSC_HOST + (0xfffffff�& ~ +IN_CLASSC_NET +) + + ) + +181 + #IN_CLASSD +( +a +�(((( +�_addr_t +)�)�& 0xf0000000�=�0xe0000000) + + ) + +182 + #IN_MULTICAST +( +a +� + `IN_CLASSD +�) + + ) + +184 + #IN_EXPERIMENTAL +( +a +�(((( +�_addr_t +)�)�& 0xe0000000�=�0xe0000000) + + ) + +185 + #IN_BADCLASS +( +a +�(((( +�_addr_t +)�)�& 0xf0000000�=�0xf0000000) + + ) + +188 + #INADDR_ANY + (( +�_addr_t +�0x00000000) + + ) + +190 + #INADDR_BROADCAST + (( +�_addr_t +�0xffffffff) + + ) + +192 + #INADDR_NONE + (( +�_addr_t +�0xffffffff) + + ) + +195 + #IN_LOOPBACKNET + 127 + + ) + +197 #i�de� +INADDR_LOOPBACK + + +198 + #INADDR_LOOPBACK + (( +�_addr_t +�0x7f000001� + + ) + +202 + #INADDR_UNSPEC_GROUP + (( +�_addr_t +�0xe0000000� + + ) + +203 + #INADDR_ALLHOSTS_GROUP + (( +�_addr_t +�0xe0000001� + + ) + +204 + #INADDR_ALLRTRS_GROUP + (( +�_addr_t +�0xe0000002� + + ) + +205 + #INADDR_MAX_LOCAL_GROUP + (( +�_addr_t +�0xe00000ff� + + ) + +207 #i�de� +__USE_KERNEL_IPV6_DEFS + + +209 + s�6_addr + + +213 +u�t8_t + + m__u6_addr8 +[16]; + +214 #i� +def�ed + +__USE_MISC + || def�ed +__USE_GNU + + +215 +u�t16_t + + m__u6_addr16 +[8]; + +216 +u�t32_t + + m__u6_addr32 +[4]; + +218 } + m__�6_u +; + +219 + #s6_addr + +__�6_u +. +__u6_addr8 + + + ) + +220 #i� +def�ed + +__USE_MISC + || def�ed +__USE_GNU + + +221 + #s6_addr16 + +__�6_u +. +__u6_addr16 + + + ) + +222 + #s6_addr32 + +__�6_u +. +__u6_addr32 + + + ) + +227 cڡ +�6_addr + +�6addr_�y +; + +228 cڡ +�6_addr + +�6addr_lo�back +; + +229 + #IN6ADDR_ANY_INIT + { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } + + ) + +230 + #IN6ADDR_LOOPBACK_INIT + { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } + + ) + +232 + #INET_ADDRSTRLEN + 16 + + ) + +233 + #INET6_ADDRSTRLEN + 46 + + ) + +237 + ssockaddr_� + + +239 +__SOCKADDR_COMMON + ( +s�_ +); + +240 +�_p�t_t + + ms�_p�t +; + +241 +�_addr + + ms�_addr +; + +244 + ms�_z�o +[ ( +sockaddr +) - + +245 +__SOCKADDR_COMMON_SIZE + - + +246 ( +�_p�t_t +) - + +247 ( +�_addr +)]; + +250 #i�de� +__USE_KERNEL_IPV6_DEFS + + +252 + ssockaddr_�6 + + +254 +__SOCKADDR_COMMON + ( +s�6_ +); + +255 +�_p�t_t + + ms�6_p�t +; + +256 +u�t32_t + + ms�6_�ow�fo +; + +257 +�6_addr + + ms�6_addr +; + +258 +u�t32_t + + ms�6_sc�e_id +; + +262 #i� +def�ed + +__USE_MISC + || def�ed +__USE_GNU + + +264 + s�_m�q + + +267 +�_addr + + mimr_muɟddr +; + +270 +�_addr + + mimr_��r�� +; + +273 + s�_m�q_sour� + + +276 +�_addr + + mimr_muɟddr +; + +279 +�_addr + + mimr_��r�� +; + +282 +�_addr + + mimr_sour�addr +; + +286 #i�de� +__USE_KERNEL_IPV6_DEFS + + +288 + s�v6_m�q + + +291 +�6_addr + + m�v6mr_muɟddr +; + +294 + m�v6mr_��r�� +; + +298 #i� +def�ed + +__USE_MISC + || def�ed +__USE_GNU + + +300 + sgroup_�q + + +303 +u�t32_t + + mgr_��r�� +; + +306 +sockaddr_��age + + mgr_group +; + +309 + sgroup_sour�_�q + + +312 +u�t32_t + + mg�_��r�� +; + +315 +sockaddr_��age + + mg�_group +; + +318 +sockaddr_��age + + mg�_sour� +; + +323 + s�_msf��r + + +326 +�_addr + + mimsf_muɟddr +; + +329 +�_addr + + mimsf_��r�� +; + +332 +u�t32_t + + mimsf_fmode +; + +335 +u�t32_t + + mimsf_num�c +; + +337 +�_addr + + mimsf_�i� +[1]; + +340 + #IP_MSFILTER_SIZE +( +num�c +�( ( +�_msf��r +) \ + +341 - ( +�_addr +) \ + +342 + ( +num�c +�* ( +�_addr +)) + + ) + +344 + sgroup_f��r + + +347 +u�t32_t + + mgf_��r�� +; + +350 +sockaddr_��age + + mgf_group +; + +353 +u�t32_t + + mgf_fmode +; + +356 +u�t32_t + + mgf_num�c +; + +358 +sockaddr_��age + + mgf_�i� +[1]; + +361 + #GROUP_FILTER_SIZE +( +num�c +�( ( +group_f��r +) \ + +362 - ( +sockaddr_��age +) \ + +363 + (( +num�c +) \ + +364 * ( +sockaddr_��age +))) + + ) + +374 +u�t32_t + + $�ohl + ( +u�t32_t + +__Î�g +� +__THROW + + `__��ibu�__ + (( +__cڡ__ +)); + +375 +u�t16_t + + $�ohs + ( +u�t16_t + +__�tsh�t +) + +376 +__THROW + + `__��ibu�__ + (( +__cڡ__ +)); + +377 +u�t32_t + + $ht�l + ( +u�t32_t + +__ho�l�g +) + +378 +__THROW + + `__��ibu�__ + (( +__cڡ__ +)); + +379 +u�t16_t + + $ht�s + ( +u�t16_t + +__ho�sh�t +) + +380 +__THROW + + `__��ibu�__ + (( +__cڡ__ +)); + +382 + ~<�d�n.h +> + +385 + ~<b�s/by�sw�.h +> + +387 #ifde� +__OPTIMIZE__ + + +391 #i� +__BYTE_ORDER + =� +__BIG_ENDIAN + + +394 + #�ohl +( +x +�(x) + + ) + +395 + #�ohs +( +x +�(x) + + ) + +396 + #ht�l +( +x +�(x) + + ) + +397 + #ht�s +( +x +�(x) + + ) + +399 #i� +__BYTE_ORDER + =� +__LITTLE_ENDIAN + + +400 + #�ohl +( +x +� + `__bsw�_32 + (x) + + ) + +401 + #�ohs +( +x +� + `__bsw�_16 + (x) + + ) + +402 + #ht�l +( +x +� + `__bsw�_32 + (x) + + ) + +403 + #ht�s +( +x +� + `__bsw�_16 + (x) + + ) + +408 #ifde� +__GNUC__ + + +409 + #IN6_IS_ADDR_UNSPECIFIED +( +a +) \ + +410 ( +__ex�nsi�__ + \ + +411 ({ cڡ +�6_addr + * +__a + = (cڡ �6_add�*�( +a +); \ + +412 +__a +-> +s6_addr32 +[0] == 0 \ + +413 && +__a +-> +s6_addr32 +[1] == 0 \ + +414 && +__a +-> +s6_addr32 +[2] == 0 \ + +415 && +__a +-> +s6_addr32 +[3] =�0; + } +})) + + ) + +417 + #IN6_IS_ADDR_LOOPBACK +( +a +) \ + +418 ( +__ex�nsi�__ + \ + +419 ({ cڡ +�6_addr + * +__a + = (cڡ �6_add�*�( +a +); \ + +420 +__a +-> +s6_addr32 +[0] == 0 \ + +421 && +__a +-> +s6_addr32 +[1] == 0 \ + +422 && +__a +-> +s6_addr32 +[2] == 0 \ + +423 && +__a +-> +s6_addr32 +[3] =� + `ht�l + (1); })) + + ) + +425 + #IN6_IS_ADDR_LINKLOCAL +( +a +) \ + +426 ( +__ex�nsi�__ + \ + +427 ({ cڡ +�6_addr + * +__a + = (cڡ �6_add�*�( +a +); \ + +428 ( +__a +-> +s6_addr32 +[0] & + `ht�l + (0xffc00000)�=�ht��(0x�800000); })) + + ) + +430 + #IN6_IS_ADDR_SITELOCAL +( +a +) \ + +431 ( +__ex�nsi�__ + \ + +432 ({ cڡ +�6_addr + * +__a + = (cڡ �6_add�*�( +a +); \ + +433 ( +__a +-> +s6_addr32 +[0] & + `ht�l + (0xffc00000)�=�ht��(0x�c00000); })) + + ) + +435 + #IN6_IS_ADDR_V4MAPPED +( +a +) \ + +436 ( +__ex�nsi�__ + \ + +437 ({ cڡ +�6_addr + * +__a + = (cڡ �6_add�*�( +a +); \ + +438 +__a +-> +s6_addr32 +[0] == 0 \ + +439 && +__a +-> +s6_addr32 +[1] == 0 \ + +440 && +__a +-> +s6_addr32 +[2] =� + `ht�l + (0xffff); })) + + ) + +442 + #IN6_IS_ADDR_V4COMPAT +( +a +) \ + +443 ( +__ex�nsi�__ + \ + +444 ({ cڡ +�6_addr + * +__a + = (cڡ �6_add�*�( +a +); \ + +445 +__a +-> +s6_addr32 +[0] == 0 \ + +446 && +__a +-> +s6_addr32 +[1] == 0 \ + +447 && +__a +-> +s6_addr32 +[2] == 0 \ + +448 && + `�ohl + ( +__a +-> +s6_addr32 +[3]�> 1; })) + + ) + +450 + #IN6_ARE_ADDR_EQUAL +( +a +, +b +) \ + +451 ( +__ex�nsi�__ + \ + +452 ({ cڡ +�6_addr + * +__a + = (cڡ �6_add�*�( +a +); \ + +453 cڡ +�6_addr + * +__b + = (cڡ �6_add�*�( +b +); \ + +454 +__a +-> +s6_addr32 +[0] =� +__b +->s6_addr32[0] \ + +455 && +__a +-> +s6_addr32 +[1] =� +__b +->s6_addr32[1] \ + +456 && +__a +-> +s6_addr32 +[2] =� +__b +->s6_addr32[2] \ + +457 && +__a +-> +s6_addr32 +[3] =� +__b +->s6_addr32[3]; })) + + ) + +459 + #IN6_IS_ADDR_UNSPECIFIED +( +a +) \ + +460 (((cڡ +u�t32_t + *�( +a +))[0] == 0 \ + +461 && ((cڡ +u�t32_t + *�( +a +))[1] == 0 \ + +462 && ((cڡ +u�t32_t + *�( +a +))[2] == 0 \ + +463 && ((cڡ +u�t32_t + *�( +a +))[3] =�0) + + ) + +465 + #IN6_IS_ADDR_LOOPBACK +( +a +) \ + +466 (((cڡ +u�t32_t + *�( +a +))[0] == 0 \ + +467 && ((cڡ +u�t32_t + *�( +a +))[1] == 0 \ + +468 && ((cڡ +u�t32_t + *�( +a +))[2] == 0 \ + +469 && ((cڡ +u�t32_t + *�( +a +))[3] =� + `ht�l + (1)) + + ) + +471 + #IN6_IS_ADDR_LINKLOCAL +( +a +) \ + +472 ((((cڡ +u�t32_t + *�( +a +))[0] & + `ht�l + (0xffc00000)) \ + +473 =� + `ht�l + (0x�800000)) + + ) + +475 + #IN6_IS_ADDR_SITELOCAL +( +a +) \ + +476 ((((cڡ +u�t32_t + *�( +a +))[0] & + `ht�l + (0xffc00000)) \ + +477 =� + `ht�l + (0x�c00000)) + + ) + +479 + #IN6_IS_ADDR_V4MAPPED +( +a +) \ + +480 ((((cڡ +u�t32_t + *�( +a +))[0] == 0) \ + +481 && (((cڡ +u�t32_t + *�( +a +))[1] == 0) \ + +482 && (((cڡ +u�t32_t + *�( +a +))[2] =� + `ht�l + (0xffff))) + + ) + +484 + #IN6_IS_ADDR_V4COMPAT +( +a +) \ + +485 ((((cڡ +u�t32_t + *�( +a +))[0] == 0) \ + +486 && (((cڡ +u�t32_t + *�( +a +))[1] == 0) \ + +487 && (((cڡ +u�t32_t + *�( +a +))[2] == 0) \ + +488 && ( + `�ohl + (((cڡ +u�t32_t + *�( +a +))[3]�> 1)) + + ) + +490 + #IN6_ARE_ADDR_EQUAL +( +a +, +b +) \ + +491 ((((cڡ +u�t32_t + *�( +a +))[0] =�((cڡ u�t32_�*�( +b +))[0]) \ + +492 && (((cڡ +u�t32_t + *�( +a +))[1] =�((cڡ u�t32_�*�( +b +))[1]) \ + +493 && (((cڡ +u�t32_t + *�( +a +))[2] =�((cڡ u�t32_�*�( +b +))[2]) \ + +494 && (((cڡ +u�t32_t + *�( +a +))[3] =�((cڡ u�t32_�*�( +b +))[3])) + + ) + +497 + #IN6_IS_ADDR_MULTICAST +( +a +�(((cڡ +u�t8_t + *��))[0] =�0xff) + + ) + +499 #i� +def�ed + +__USE_MISC + || def�ed +__USE_GNU + + +501 + $b�d�svp�t + ( +__sockfd +, +sockaddr_� + * +__sock_� +� +__THROW +; + +504 + $b�d�svp�t6 + ( +__sockfd +, +sockaddr_�6 + * +__sock_� +) + +505 +__THROW +; + +509 + #IN6_IS_ADDR_MC_NODELOCAL +( +a +) \ + +510 ( + `IN6_IS_ADDR_MULTICAST +( +a +) \ + +511 && ((((cڡ +u�t8_t + *�( +a +))[1] & 0xf�=�0x1)) + + ) + +513 + #IN6_IS_ADDR_MC_LINKLOCAL +( +a +) \ + +514 ( + `IN6_IS_ADDR_MULTICAST +( +a +) \ + +515 && ((((cڡ +u�t8_t + *�( +a +))[1] & 0xf�=�0x2)) + + ) + +517 + #IN6_IS_ADDR_MC_SITELOCAL +( +a +) \ + +518 ( + `IN6_IS_ADDR_MULTICAST +( +a +) \ + +519 && ((((cڡ +u�t8_t + *�( +a +))[1] & 0xf�=�0x5)) + + ) + +521 + #IN6_IS_ADDR_MC_ORGLOCAL +( +a +) \ + +522 ( + `IN6_IS_ADDR_MULTICAST +( +a +) \ + +523 && ((((cڡ +u�t8_t + *�( +a +))[1] & 0xf�=�0x8)) + + ) + +525 + #IN6_IS_ADDR_MC_GLOBAL +( +a +) \ + +526 ( + `IN6_IS_ADDR_MULTICAST +( +a +) \ + +527 && ((((cڡ +u�t8_t + *�( +a +))[1] & 0xf�=�0xe)) + + ) + +530 #ifde� +__USE_GNU + + +531 +cmsghdr +; + +534 + s�6_pkt�fo + + +536 +�6_addr + +�i6_addr +; + +537 +�i6_if�dex +; + +541 + s�6_mtu�fo + + +543 +sockaddr_�6 + +�6m_addr +; + +544 +u�t32_t + +�6m_mtu +; + +549 + $��6_�ti�_�a� + ( +__nby�s +) + +550 +__THROW + +__��ibu�_d����d__ +; + +551 + $��6_�ti�_�� + (* +__bp +, +cmsghdr + ** +__cmsgp +, + +552 +__ty� +� +__THROW + +__��ibu�_d����d__ +; + +553 + $��6_�ti�_��nd + ( +cmsghdr + * +__cmsg +, + +554 cڡ +u�t8_t + * +__ty�p +, +__mu�x +, + +555 +__�usy +� +__THROW + +__��ibu�_d����d__ +; + +556 +u�t8_t + * + $��6_�ti�_�loc + ( +cmsghdr + * +__cmsg +, +__d��� +, + +557 +__mu�x +, +__�usy +) + +558 +__THROW + +__��ibu�_d����d__ +; + +559 + $��6_�ti�_�xt + (cڡ +cmsghdr + * +__cmsg +, + +560 +u�t8_t + ** +__��p +) + +561 +__THROW + +__��ibu�_d����d__ +; + +562 + $��6_�ti�_f�d + (cڡ +cmsghdr + * +__cmsg +, + +563 +u�t8_t + ** +__��p +, +__ty� +) + +564 +__THROW + +__��ibu�_d����d__ +; + +568 + $��6_�t_�� + (* +__extbuf +, +sock�n_t + +__ex�� +� +__THROW +; + +569 + $��6_�t_��nd + (* +__extbuf +, +sock�n_t + +__ex�� +, +__off�t +, + +570 +u�t8_t + +__ty� +, +sock�n_t + +__�n +, u�t8_� +__�ign +, + +571 ** +__d�abu� +� +__THROW +; + +572 + $��6_�t_f�ish + (* +__extbuf +, +sock�n_t + +__ex�� +, +__off�t +) + +573 +__THROW +; + +574 + $��6_�t_�t_v� + (* +__d�abuf +, +__off�t +, * +__v� +, + +575 +sock�n_t + +__v��n +� +__THROW +; + +576 + $��6_�t_�xt + (* +__extbuf +, +sock�n_t + +__ex�� +, +__off�t +, + +577 +u�t8_t + * +__ty�p +, +sock�n_t + * +__�� +, + +578 ** +__d�abu� +� +__THROW +; + +579 + $��6_�t_f�d + (* +__extbuf +, +sock�n_t + +__ex�� +, +__off�t +, + +580 +u�t8_t + +__ty� +, +sock�n_t + * +__�� +, + +581 ** +__d�abu� +� +__THROW +; + +582 + $��6_�t_g�_v� + (* +__d�abuf +, +__off�t +, * +__v� +, + +583 +sock�n_t + +__v��n +� +__THROW +; + +587 +sock�n_t + + $��6_�h_�a� + ( +__ty� +, +__�gm�ts +� +__THROW +; + +588 * + $��6_�h_�� + (* +__bp +, +sock�n_t + +__bp_�n +, +__ty� +, + +589 +__�gm�ts +� +__THROW +; + +590 + $��6_�h_add + (* +__bp +, cڡ +�6_addr + * +__addr +� +__THROW +; + +591 + $��6_�h_�v�� + (cڡ * +__� +, * +__out +� +__THROW +; + +592 + $��6_�h_�gm�ts + (cڡ * +__bp +� +__THROW +; + +593 +�6_addr + * + $��6_�h_g�addr + (cڡ * +__bp +, +__�dex +) + +594 +__THROW +; + +600 + $g��v4sour�f��r + ( +__s +, +�_addr + +__��r��_addr +, + +601 +�_addr + +__group +, +u�t32_t + * +__fmode +, + +602 +u�t32_t + * +__num�c +, +�_addr + * +__�i� +) + +603 +__THROW +; + +606 + $�t�v4sour�f��r + ( +__s +, +�_addr + +__��r��_addr +, + +607 +�_addr + +__group +, +u�t32_t + +__fmode +, + +608 +u�t32_t + +__num�c +, + +609 cڡ +�_addr + * +__�i� +) + +610 +__THROW +; + +614 + $g�sour�f��r + ( +__s +, +u�t32_t + +__��r��_addr +, + +615 cڡ +sockaddr + * +__group +, + +616 +sock�n_t + +__grou�� +, +u�t32_t + * +__fmode +, + +617 +u�t32_t + * +__num�c +, + +618 +sockaddr_��age + * +__�i� +� +__THROW +; + +621 + $�tsour�f��r + ( +__s +, +u�t32_t + +__��r��_addr +, + +622 cڡ +sockaddr + * +__group +, + +623 +sock�n_t + +__grou�� +, +u�t32_t + +__fmode +, + +624 +u�t32_t + +__num�c +, + +625 cڡ +sockaddr_��age + * +__�i� +� +__THROW +; + +628 +__END_DECLS + + + @/usr/include/netinet/tcp.h + +32 #i�de� +_NETINET_TCP_H + + +33 + #_NETINET_TCP_H + 1 + + ) + +35 + ~<�u�s.h +> + +40 + #TCP_NODELAY + 1 + + ) + +41 + #TCP_MAXSEG + 2 + + ) + +42 + #TCP_CORK + 3 + + ) + +43 + #TCP_KEEPIDLE + 4 + + ) + +44 + #TCP_KEEPINTVL + 5 + + ) + +45 + #TCP_KEEPCNT + 6 + + ) + +46 + #TCP_SYNCNT + 7 + + ) + +47 + #TCP_LINGER2 + 8 + + ) + +48 + #TCP_DEFER_ACCEPT + 9 + + ) + +49 + #TCP_WINDOW_CLAMP + 10 + + ) + +50 + #TCP_INFO + 11 + + ) + +51 + #TCP_QUICKACK + 12 + + ) + +52 + #TCP_CONGESTION + 13 + + ) + +53 + #TCP_MD5SIG + 14 + + ) + +54 + #TCP_COOKIE_TRANSACTIONS + 15 + + ) + +55 + #TCP_THIN_LINEAR_TIMEOUTS + 16 + + ) + +56 + #TCP_THIN_DUPACK + 17 + + ) + +57 + #TCP_USER_TIMEOUT + 18 + + ) + +58 + #TCP_REPAIR + 19 + + ) + +59 + #TCP_REPAIR_QUEUE + 20 + + ) + +60 + #TCP_QUEUE_SEQ + 21 + + ) + +61 + #TCP_REPAIR_OPTIONS + 22 + + ) + +62 + #TCP_FASTOPEN + 23 + + ) + +63 + #TCP_TIMESTAMP + 24 + + ) + +65 #ifde� +__USE_MISC + + +66 + ~<sys/ty�s.h +> + +67 + ~<sys/sock�.h +> + +69 +u_�t32_t + + tt�_�q +; + +74 + st�hdr + + +76 +__ex�nsi�__ + union + +80 +u_�t16_t + + mth_��t +; + +81 +u_�t16_t + + mth_dp�t +; + +82 +t�_�q + + mth_�q +; + +83 +t�_�q + + mth_ack +; + +84 #i� +__BYTE_ORDER + =� +__LITTLE_ENDIAN + + +85 +u_�t8_t + + mth_x2 +:4; + +86 +u_�t8_t + + mth_off +:4; + +88 #i� +__BYTE_ORDER + =� +__BIG_ENDIAN + + +89 +u_�t8_t + + mth_off +:4; + +90 +u_�t8_t + + mth_x2 +:4; + +92 +u_�t8_t + + mth_�ags +; + +93 + #TH_FIN + 0x01 + + ) + +94 + #TH_SYN + 0x02 + + ) + +95 + #TH_RST + 0x04 + + ) + +96 + #TH_PUSH + 0x08 + + ) + +97 + #TH_ACK + 0x10 + + ) + +98 + #TH_URG + 0x20 + + ) + +99 +u_�t16_t + + mth_w� +; + +100 +u_�t16_t + + mth_sum +; + +101 +u_�t16_t + + mth_u� +; + +105 +u_�t16_t + + msour� +; + +106 +u_�t16_t + + mde� +; + +107 +u_�t32_t + + m�q +; + +108 +u_�t32_t + + mack_�q +; + +109 #i� +__BYTE_ORDER + =� +__LITTLE_ENDIAN + + +110 +u_�t16_t + + m�s1 +:4; + +111 +u_�t16_t + + mdoff +:4; + +112 +u_�t16_t + + mf� +:1; + +113 +u_�t16_t + + msyn +:1; + +114 +u_�t16_t + + mr� +:1; + +115 +u_�t16_t + + mpsh +:1; + +116 +u_�t16_t + + mack +:1; + +117 +u_�t16_t + + murg +:1; + +118 +u_�t16_t + + m�s2 +:2; + +119 #�i� +__BYTE_ORDER + =� +__BIG_ENDIAN + + +120 +u_�t16_t + + mdoff +:4; + +121 +u_�t16_t + + m�s1 +:4; + +122 +u_�t16_t + + m�s2 +:2; + +123 +u_�t16_t + + murg +:1; + +124 +u_�t16_t + + mack +:1; + +125 +u_�t16_t + + mpsh +:1; + +126 +u_�t16_t + + mr� +:1; + +127 +u_�t16_t + + msyn +:1; + +128 +u_�t16_t + + mf� +:1; + +132 +u_�t16_t + + mw�dow +; + +133 +u_�t16_t + + mcheck +; + +134 +u_�t16_t + + murg_�r +; + +141 + mTCP_ESTABLISHED + = 1, + +142 + mTCP_SYN_SENT +, + +143 + mTCP_SYN_RECV +, + +144 + mTCP_FIN_WAIT1 +, + +145 + mTCP_FIN_WAIT2 +, + +146 + mTCP_TIME_WAIT +, + +147 + mTCP_CLOSE +, + +148 + mTCP_CLOSE_WAIT +, + +149 + mTCP_LAST_ACK +, + +150 + mTCP_LISTEN +, + +151 + mTCP_CLOSING + + +154 + #TCPOPT_EOL + 0 + + ) + +155 + #TCPOPT_NOP + 1 + + ) + +156 + #TCPOPT_MAXSEG + 2 + + ) + +157 + #TCPOLEN_MAXSEG + 4 + + ) + +158 + #TCPOPT_WINDOW + 3 + + ) + +159 + #TCPOLEN_WINDOW + 3 + + ) + +160 + #TCPOPT_SACK_PERMITTED + 4 + + ) + +161 + #TCPOLEN_SACK_PERMITTED + 2 + + ) + +162 + #TCPOPT_SACK + 5 + + ) + +163 + #TCPOPT_TIMESTAMP + 8 + + ) + +164 + #TCPOLEN_TIMESTAMP + 10 + + ) + +165 + #TCPOLEN_TSTAMP_APPA + ( +TCPOLEN_TIMESTAMP ++2� + + ) + +167 + #TCPOPT_TSTAMP_HDR + \ + +168 ( +TCPOPT_NOP +<<24|TCPOPT_NOP<<16| +TCPOPT_TIMESTAMP +<<8| +TCPOLEN_TIMESTAMP +) + + ) + +176 + #TCP_MSS + 512 + + ) + +178 + #TCP_MAXWIN + 65535 + + ) + +180 + #TCP_MAX_WINSHIFT + 14 + + ) + +182 + #SOL_TCP + 6 + + ) + +185 + #TCPI_OPT_TIMESTAMPS + 1 + + ) + +186 + #TCPI_OPT_SACK + 2 + + ) + +187 + #TCPI_OPT_WSCALE + 4 + + ) + +188 + #TCPI_OPT_ECN + 8 + + ) + +189 + #TCPI_OPT_ECN_SEEN + 16 + + ) + +190 + #TCPI_OPT_SYN_DATA + 32 + + ) + +193 + et�_�_��e + + +195 + mTCP_CA_O�n + = 0, + +196 + mTCP_CA_Dis�d� + = 1, + +197 + mTCP_CA_CWR + = 2, + +198 + mTCP_CA_Recov�y + = 3, + +199 + mTCP_CA_Loss + = 4 + +202 + st�_�fo + + +204 +u_�t8_t + + mt�i_��e +; + +205 +u_�t8_t + + mt�i_�_��e +; + +206 +u_�t8_t + + mt�i_���sm�s +; + +207 +u_�t8_t + + mt�i_�obes +; + +208 +u_�t8_t + + mt�i_backoff +; + +209 +u_�t8_t + + mt�i_�ti�s +; + +210 +u_�t8_t + + mt�i_�d_ws�� + : 4, + mt�i_rcv_ws�� + : 4; + +212 +u_�t32_t + + mt�i_�o +; + +213 +u_�t32_t + + mt�i_�o +; + +214 +u_�t32_t + + mt�i_�d_mss +; + +215 +u_�t32_t + + mt�i_rcv_mss +; + +217 +u_�t32_t + + mt�i_u�cked +; + +218 +u_�t32_t + + mt�i_�cked +; + +219 +u_�t32_t + + mt�i_lo� +; + +220 +u_�t32_t + + mt�i_���s +; + +221 +u_�t32_t + + mt�i_�ck�s +; + +224 +u_�t32_t + + mt�i_ϡ_d�a_�� +; + +225 +u_�t32_t + + mt�i_ϡ_ack_�� +; + +226 +u_�t32_t + + mt�i_ϡ_d�a_�cv +; + +227 +u_�t32_t + + mt�i_ϡ_ack_�cv +; + +230 +u_�t32_t + + mt�i_pmtu +; + +231 +u_�t32_t + + mt�i_rcv_s�h�sh +; + +232 +u_�t32_t + + mt�i_�t +; + +233 +u_�t32_t + + mt�i_�tv� +; + +234 +u_�t32_t + + mt�i_�d_s�h�sh +; + +235 +u_�t32_t + + mt�i_�d_cwnd +; + +236 +u_�t32_t + + mt�i_advmss +; + +237 +u_�t32_t + + mt�i_��d��g +; + +239 +u_�t32_t + + mt�i_rcv_�t +; + +240 +u_�t32_t + + mt�i_rcv_�a� +; + +242 +u_�t32_t + + mt�i_tٮ_���s +; + +247 + #TCP_MD5SIG_MAXKEYLEN + 80 + + ) + +249 + st�_md5sig + + +251 +sockaddr_��age + + mt�m_addr +; + +252 +u_�t16_t + + m__t�m_�d1 +; + +253 +u_�t16_t + + mt�m_key�n +; + +254 +u_�t32_t + + m__t�m_�d2 +; + +255 +u_�t8_t + + mt�m_key +[ +TCP_MD5SIG_MAXKEYLEN +]; + +259 + st�_���_�t + + +261 +u_�t32_t + + m�t_code +; + +262 +u_�t32_t + + m�t_v� +; + +268 + mTCP_NO_QUEUE +, + +269 + mTCP_RECV_QUEUE +, + +270 + mTCP_SEND_QUEUE +, + +271 + mTCP_QUEUES_NR +, + +275 + #TCP_COOKIE_MIN + 8 + + ) + +276 + #TCP_COOKIE_MAX + 16 + + ) + +277 + #TCP_COOKIE_PAIR_SIZE + (2* +TCP_COOKIE_MAX +) + + ) + +280 + #TCP_COOKIE_IN_ALWAYS + (1 << 0� + + ) + +281 + #TCP_COOKIE_OUT_NEVER + (1 << 1� + + ) + +285 + #TCP_S_DATA_IN + (1 << 2� + + ) + +286 + #TCP_S_DATA_OUT + (1 << 3� + + ) + +288 + #TCP_MSS_DEFAULT + 536U + + ) + +289 + #TCP_MSS_DESIRED + 1220U + + ) + +291 + st�_cook�_����i�s + + +293 +u_�t16_t + + mt��_�ags +; + +294 +u_�t8_t + + m__t��_�d1 +; + +295 +u_�t8_t + + mt��_cook�_des�ed +; + +296 +u_�t16_t + + mt��_s_d�a_des�ed +; + +297 +u_�t16_t + + mt��_u�d +; + +298 +u_�t8_t + + mt��_v�ue +[ +TCP_MSS_DEFAULT +]; + + @/usr/include/openssl/bn.h + +125 #i�de� +HEADER_BN_H + + +126 + #HEADER_BN_H + + + ) + +128 + ~<ݒs�/e_os2.h +> + +129 #i�de� +OPENSSL_NO_FP_API + + +130 + ~<�dio.h +> + +132 + ~<ݒs�/os�_typ.h +> + +133 + ~<ݒs�/�y�o.h +> + +134 + ~<lim�s.h +> + +136 #ifde� +__�lu�lus + + +152 #i�de� +OPENSSL_SMALL_FOOTPRINT + + +153 + #BN_MUL_COMBA + + + ) + +154 + #BN_SQR_COMBA + + + ) + +155 + #BN_RECURSION + + + ) + +169 #i� +def�ed +( +OPENSSL_SYS_MSDOS +�|| def�ed( +OPENSSL_SYS_WINDOWS +) || \ + +170 +def�ed +( +OPENSSL_SYS_WIN32 +�|| + $def�ed +( +l�ux +) + +171 #i�de� +BN_DIV2W + + +172 + #BN_DIV2W + + + ) + +179 #ifde� +SIXTY_FOUR_BIT_LONG + + +180 + #BN_ULLONG + + + ) + +181 + #BN_ULONG + + + ) + +182 + #BN_LONG + + + ) + +183 + #BN_BITS + 128 + + ) + +184 + #BN_BYTES + 8 + + ) + +185 + #BN_BITS2 + 64 + + ) + +186 + #BN_BITS4 + 32 + + ) + +187 + #BN_MASK + (0xffffffffffffffffffffffffffffffffLL) + + ) + +188 + #BN_MASK2 + (0xffffffffffffffffL) + + ) + +189 + #BN_MASK2l + (0xffffffffL) + + ) + +190 + #BN_MASK2h + (0xffffffff00000000L) + + ) + +191 + #BN_MASK2h1 + (0xffffffff80000000L) + + ) + +192 + #BN_TBIT + (0x8000000000000000L) + + ) + +193 + #BN_DEC_CONV + (10000000000000000000UL) + + ) + +194 + #BN_DEC_FMT1 + "%lu" + + ) + +195 + #BN_DEC_FMT2 + "%019lu" + + ) + +196 + #BN_DEC_NUM + 19 + + ) + +197 + #BN_HEX_FMT1 + "%lX" + + ) + +198 + #BN_HEX_FMT2 + "%016lX" + + ) + +206 #ifde� +SIXTY_FOUR_BIT + + +207 #unde� +BN_LLONG + + +208 #unde� +BN_ULLONG + + +209 + #BN_ULONG + + + ) + +210 + #BN_LONG + + + ) + +211 + #BN_BITS + 128 + + ) + +212 + #BN_BYTES + 8 + + ) + +213 + #BN_BITS2 + 64 + + ) + +214 + #BN_BITS4 + 32 + + ) + +215 + #BN_MASK2 + (0xffffffffffffffffLL) + + ) + +216 + #BN_MASK2l + (0xffffffffL) + + ) + +217 + #BN_MASK2h + (0xffffffff00000000LL) + + ) + +218 + #BN_MASK2h1 + (0xffffffff80000000LL) + + ) + +219 + #BN_TBIT + (0x8000000000000000LL) + + ) + +220 + #BN_DEC_CONV + (10000000000000000000ULL) + + ) + +221 + #BN_DEC_FMT1 + "%�u" + + ) + +222 + #BN_DEC_FMT2 + "%019�u" + + ) + +223 + #BN_DEC_NUM + 19 + + ) + +224 + #BN_HEX_FMT1 + "%�X" + + ) + +225 + #BN_HEX_FMT2 + "%016�X" + + ) + +228 #ifde� +THIRTY_TWO_BIT + + +229 #ifde� +BN_LLONG + + +230 #i� + `def�ed +( +_WIN32 +�&& !def�ed( +__GNUC__ +) + +231 + #BN_ULLONG + +__�t64 + + + ) + +232 + #BN_MASK + (0xffffffffffffffff +I64 +) + + ) + +234 + #BN_ULLONG + + + ) + +235 + #BN_MASK + (0xffffffffffffffffLL) + + ) + +238 + #BN_ULONG + + + ) + +239 + #BN_LONG + + + ) + +240 + #BN_BITS + 64 + + ) + +241 + #BN_BYTES + 4 + + ) + +242 + #BN_BITS2 + 32 + + ) + +243 + #BN_BITS4 + 16 + + ) + +244 + #BN_MASK2 + (0xffffffffL) + + ) + +245 + #BN_MASK2l + (0xffff) + + ) + +246 + #BN_MASK2h1 + (0xffff8000L) + + ) + +247 + #BN_MASK2h + (0xffff0000L) + + ) + +248 + #BN_TBIT + (0x80000000L) + + ) + +249 + #BN_DEC_CONV + (1000000000L) + + ) + +250 + #BN_DEC_FMT1 + "%u" + + ) + +251 + #BN_DEC_FMT2 + "%09u" + + ) + +252 + #BN_DEC_NUM + 9 + + ) + +253 + #BN_HEX_FMT1 + "%X" + + ) + +254 + #BN_HEX_FMT2 + "%08X" + + ) + +265 #i� + `def�ed +( +OPENSSL_SYS_VMS +) + +266 #i� +__INITIAL_POINTER_SIZE + == 64 + +267 + #PTR_SIZE_INT + + + ) + +269 + #PTR_SIZE_INT + + + ) + +272 + #PTR_SIZE_INT + +size_t + + + ) + +275 + #BN_DEFAULT_BITS + 1280 + + ) + +277 + #BN_FLG_MALLOCED + 0x01 + + ) + +278 + #BN_FLG_STATIC_DATA + 0x02 + + ) + +279 + #BN_FLG_CONSTTIME + 0x04 + + ) + +285 #i�de� +OPENSSL_NO_DEPRECATED + + +286 + #BN_FLG_EXP_CONSTTIME + +BN_FLG_CONSTTIME + + + ) + +291 #i�de� +OPENSSL_NO_DEPRECATED + + +292 + #BN_FLG_FREE + 0x8000 + + ) + +294 + #BN_�t_�ags +( +b +, +n +�((b)-> +�ags +|=�)) + + ) + +295 + #BN_g�_�ags +( +b +, +n +�((b)-> +�ags +&�)) + + ) + +299 + #BN_w�h_�ags +( +de� +, +b +, +n +�((de�)-> +d +=(b)->d, \ + +300 ( +de� +)-> +t� +=( +b +)->top, \ + +301 ( +de� +)-> +dmax +=( +b +)->dmax, \ + +302 ( +de� +)-> +�g +=( +b +)->neg, \ + +303 ( +de� +)-> +�ags +=(((de�)->�ag�& +BN_FLG_MALLOCED +) \ + +304 | (( +b +)-> +�ags + & ~ +BN_FLG_MALLOCED +) \ + +305 | +BN_FLG_STATIC_DATA + \ + +306 | ( +n +))) + + ) + +310 +bignum_� + + tBIGNUM +; + +312 +bignum_�x + + tBN_CTX +; + +313 +bn_bl�d�g_� + + tBN_BLINDING +; + +314 +bn_m�t_�x_� + + tBN_MONT_CTX +; + +315 +bn_��_�x_� + + tBN_RECP_CTX +; + +316 +bn_g�cb_� + + tBN_GENCB +; + +319 + sbignum_� + + +321 +BN_ULONG + * +d +; + +322 +t� +; + +324 +dmax +; + +325 +�g +; + +326 +�ags +; + +330 + sbn_m�t_�x_� + + +332 +ri +; + +333 +BIGNUM + +RR +; + +334 +BIGNUM + +N +; + +335 +BIGNUM + +Ni +; + +337 +BN_ULONG + +n0 +[2]; + +339 +�ags +; + +345 + sbn_��_�x_� + + +347 +BIGNUM + +N +; + +348 +BIGNUM + +Nr +; + +349 +num_b�s +; + +350 +shi� +; + +351 +�ags +; + +355 + sbn_g�cb_� + + +357 +v� +; + +358 * +�g +; + +362 (* +cb_1 +)(, , *); + +364 (* +cb_2 +)(, , +BN_GENCB + *); + +365 } +cb +; + +368 + `BN_GENCB_�� +( +BN_GENCB + * +cb +, +a +, +b +); + +370 + #BN_GENCB_�t_�d +( +g�cb +, +��back +, +cb_�g +) { \ + +371 +BN_GENCB + * +tmp_g�cb + = ( +g�cb +); \ + +372 +tmp_g�cb +-> +v� + = 1; \ + +373 +tmp_g�cb +-> +�g + = ( +cb_�g +); \ + +374 +tmp_g�cb +-> +cb +. +cb_1 + = ( +��back +); } + + ) + +376 + #BN_GENCB_�t +( +g�cb +, +��back +, +cb_�g +) { \ + +377 +BN_GENCB + * +tmp_g�cb + = ( +g�cb +); \ + +378 +tmp_g�cb +-> +v� + = 2; \ + +379 +tmp_g�cb +-> +�g + = ( +cb_�g +); \ + +380 +tmp_g�cb +-> +cb +. +cb_2 + = ( +��back +); } + + ) + +382 + #BN_�ime_checks + 0 + + ) + +390 + #BN_�ime_checks_f�_size +( +b +) ((b) >= 1300 ? 2 : \ + +391 ( +b +) >= 850 ? 3 : \ + +392 ( +b +) >= 650 ? 4 : \ + +393 ( +b +) >= 550 ? 5 : \ + +394 ( +b +) >= 450 ? 6 : \ + +395 ( +b +) >= 400 ? 7 : \ + +396 ( +b +) >= 350 ? 8 : \ + +397 ( +b +) >= 300 ? 9 : \ + +398 ( +b +) >= 250 ? 12 : \ + +399 ( +b +) >= 200 ? 15 : \ + +400 ( +b +) >= 150 ? 18 : \ + +401 27) + + ) + +403 + #BN_num_by�s +( +a +�(( + `BN_num_b�s +�)+7)/8) + + ) + +406 + #BN_abs_is_w�d +( +a +, +w +�(((�)-> +t� + =�1�&& (�)-> +d +[0] =�( +BN_ULONG +)(w))) || \ + +407 ((( +w +�=�0�&& (( +a +)-> +t� + =�0))) + + ) + +408 + #BN_is_z�o +( +a +�(�)-> +t� + =�0) + + ) + +409 + #BN_is_�e +( +a +�( + `BN_abs_is_w�d +(�),1�&& !�)-> +�g +) + + ) + +410 + #BN_is_w�d +( +a +, +w +�( + `BN_abs_is_w�d +(�),(w)�&& (!(w�|| !�)-> +�g +)) + + ) + +411 + #BN_is_odd +( +a +�((�)-> +t� + > 0�&& (�)-> +d +[0] & 1)) + + ) + +413 + #BN_�e +( +a +�( + `BN_�t_w�d +(�),1)) + + ) + +414 + #BN_z�o_ex +( +a +) \ + +416 +BIGNUM + * +_tmp_bn + = ( +a +); \ + +417 +_tmp_bn +-> +t� + = 0; \ + +418 +_tmp_bn +-> +�g + = 0; \ + +419 } 0) + + ) + +420 #ifde� +OPENSSL_NO_DEPRECATED + + +421 + #BN_z�o +( +a +� + `BN_z�o_ex +�) + + ) + +423 + #BN_z�o +( +a +�( + `BN_�t_w�d +(�),0)) + + ) + +426 cڡ +BIGNUM + * + `BN_v�ue_�e +(); + +427 * + `BN_�ti�s +(); + +428 +BN_CTX + * + `BN_CTX_�w +(); + +429 #i�de� +OPENSSL_NO_DEPRECATED + + +430 + `BN_CTX_�� +( +BN_CTX + * +c +); + +432 + `BN_CTX_� +( +BN_CTX + * +c +); + +433 + `BN_CTX_��t +( +BN_CTX + * +�x +); + +434 +BIGNUM + * + `BN_CTX_g� +( +BN_CTX + * +�x +); + +435 + `BN_CTX_�d +( +BN_CTX + * +�x +); + +436 + `BN_�nd +( +BIGNUM + * +�d +, +b�s +, +t� +, +b�tom +); + +437 + `BN_p�udo_�nd +( +BIGNUM + * +�d +, +b�s +, +t� +, +b�tom +); + +438 + `BN_�nd_�nge +( +BIGNUM + * +�d +, cڡ BIGNUM * +�nge +); + +439 + `BN_p�udo_�nd_�nge +( +BIGNUM + * +�d +, cڡ BIGNUM * +�nge +); + +440 + `BN_num_b�s +(cڡ +BIGNUM + * +a +); + +441 + `BN_num_b�s_w�d +( +BN_ULONG +); + +442 +BIGNUM + * + `BN_�w +(); + +443 + `BN_�� +( +BIGNUM + *); + +444 + `BN_��r_� +( +BIGNUM + * +a +); + +445 +BIGNUM + * + `BN_c�y +(BIGNUM * +a +, cڡ BIGNUM * +b +); + +446 + `BN_sw� +( +BIGNUM + * +a +, BIGNUM * +b +); + +447 +BIGNUM + * + `BN_b�2bn +(cڡ * +s +, +�n +,BIGNUM * +�t +); + +448 + `BN_bn2b� +(cڡ +BIGNUM + * +a +, * +to +); + +449 +BIGNUM + * + `BN_mpi2bn +(cڡ * +s +, +�n +,BIGNUM * +�t +); + +450 + `BN_bn2mpi +(cڡ +BIGNUM + * +a +, * +to +); + +451 + `BN_sub +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +); + +452 + `BN_usub +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +); + +453 + `BN_uadd +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +); + +454 + `BN_add +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +); + +455 + `BN_mul +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +, +BN_CTX + * +�x +); + +456 + `BN_sqr +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, +BN_CTX + * +�x +); + +461 + `BN_�t_�g�ive +( +BIGNUM + * +b +, +n +); + +466 + #BN_is_�g�ive +( +a +�(�)-> +�g + !�0) + + ) + +468 + `BN_div +( +BIGNUM + * +dv +, BIGNUM * +�m +, cڡ BIGNUM * +m +, cڡ BIGNUM * +d +, + +469 +BN_CTX + * +�x +); + +470 + #BN_mod +( +�m +, +m +, +d +, +�x +� + `BN_div +( +NULL +,�em),(m),(d),(�x)) + + ) + +471 + `BN_�mod +( +BIGNUM + * +r +, cڡ BIGNUM * +m +, cڡ BIGNUM * +d +, +BN_CTX + * +�x +); + +472 + `BN_mod_add +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +, cڡ BIGNUM * +m +, +BN_CTX + * +�x +); + +473 + `BN_mod_add_quick +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +, cڡ BIGNUM * +m +); + +474 + `BN_mod_sub +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +, cڡ BIGNUM * +m +, +BN_CTX + * +�x +); + +475 + `BN_mod_sub_quick +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +, cڡ BIGNUM * +m +); + +476 + `BN_mod_mul +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +, + +477 cڡ +BIGNUM + * +m +, +BN_CTX + * +�x +); + +478 + `BN_mod_sqr +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +m +, +BN_CTX + * +�x +); + +479 + `BN_mod_lshi�1 +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +m +, +BN_CTX + * +�x +); + +480 + `BN_mod_lshi�1_quick +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +m +); + +481 + `BN_mod_lshi� +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, +n +, cڡ BIGNUM * +m +, +BN_CTX + * +�x +); + +482 + `BN_mod_lshi�_quick +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, +n +, cڡ BIGNUM * +m +); + +484 +BN_ULONG + + `BN_mod_w�d +(cڡ +BIGNUM + * +a +, BN_ULONG +w +); + +485 +BN_ULONG + + `BN_div_w�d +( +BIGNUM + * +a +, BN_ULONG +w +); + +486 + `BN_mul_w�d +( +BIGNUM + * +a +, +BN_ULONG + +w +); + +487 + `BN_add_w�d +( +BIGNUM + * +a +, +BN_ULONG + +w +); + +488 + `BN_sub_w�d +( +BIGNUM + * +a +, +BN_ULONG + +w +); + +489 + `BN_�t_w�d +( +BIGNUM + * +a +, +BN_ULONG + +w +); + +490 +BN_ULONG + + `BN_g�_w�d +(cڡ +BIGNUM + * +a +); + +492 + `BN_cmp +(cڡ +BIGNUM + * +a +, cڡ BIGNUM * +b +); + +493 + `BN_� +( +BIGNUM + * +a +); + +494 + `BN_is_b�_�t +(cڡ +BIGNUM + * +a +, +n +); + +495 + `BN_lshi� +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, +n +); + +496 + `BN_lshi�1 +( +BIGNUM + * +r +, cڡ BIGNUM * +a +); + +497 + `BN_exp +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +p +, +BN_CTX + * +�x +); + +499 + `BN_mod_exp +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +p +, + +500 cڡ +BIGNUM + * +m +, +BN_CTX + * +�x +); + +501 + `BN_mod_exp_m�t +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +p +, + +502 cڡ +BIGNUM + * +m +, +BN_CTX + * +�x +, +BN_MONT_CTX + * +m_�x +); + +503 + `BN_mod_exp_m�t_cڡtime +( +BIGNUM + * +� +, cڡ BIGNUM * +a +, cڡ BIGNUM * +p +, + +504 cڡ +BIGNUM + * +m +, +BN_CTX + * +�x +, +BN_MONT_CTX + * +�_m�t +); + +505 + `BN_mod_exp_m�t_w�d +( +BIGNUM + * +r +, +BN_ULONG + +a +, cڡ BIGNUM * +p +, + +506 cڡ +BIGNUM + * +m +, +BN_CTX + * +�x +, +BN_MONT_CTX + * +m_�x +); + +507 + `BN_mod_exp2_m�t +( +BIGNUM + * +r +, cڡ BIGNUM * +a1 +, cڡ BIGNUM * +p1 +, + +508 cڡ +BIGNUM + * +a2 +, cڡ BIGNUM * +p2 +,cڡ BIGNUM * +m +, + +509 +BN_CTX + * +�x +, +BN_MONT_CTX + * +m_�x +); + +510 + `BN_mod_exp_sim�e +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +p +, + +511 cڡ +BIGNUM + * +m +, +BN_CTX + * +�x +); + +513 + `BN_mask_b�s +( +BIGNUM + * +a +, +n +); + +514 #i�de� +OPENSSL_NO_FP_API + + +515 + `BN_��t_� +( +FILE + * +� +, cڡ +BIGNUM + * +a +); + +517 #ifde� +HEADER_BIO_H + + +518 + `BN_��t +( +BIO + * +� +, cڡ +BIGNUM + * +a +); + +520 + `BN_��t +(* +� +, cڡ +BIGNUM + * +a +); + +522 + `BN_�c�ro�l +( +BIGNUM + * +r +, cڡ BIGNUM * +m +, +�n +, +BN_CTX + * +�x +); + +523 + `BN_rshi� +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, +n +); + +524 + `BN_rshi�1 +( +BIGNUM + * +r +, cڡ BIGNUM * +a +); + +525 + `BN_��r +( +BIGNUM + * +a +); + +526 +BIGNUM + * + `BN_dup +(cڡ BIGNUM * +a +); + +527 + `BN_ucmp +(cڡ +BIGNUM + * +a +, cڡ BIGNUM * +b +); + +528 + `BN_�t_b� +( +BIGNUM + * +a +, +n +); + +529 + `BN_��r_b� +( +BIGNUM + * +a +, +n +); + +530 * + `BN_bn2hex +(cڡ +BIGNUM + * +a +); + +531 * + `BN_bn2dec +(cڡ +BIGNUM + * +a +); + +532 + `BN_hex2bn +( +BIGNUM + ** +a +, cڡ * +�r +); + +533 + `BN_dec2bn +( +BIGNUM + ** +a +, cڡ * +�r +); + +534 + `BN_asc2bn +( +BIGNUM + ** +a +, cڡ * +�r +); + +535 + `BN_gcd +( +BIGNUM + * +r +,cڡ BIGNUM * +a +,cڡ BIGNUM * +b +, +BN_CTX + * +�x +); + +536 + `BN_kr�eck� +(cڡ +BIGNUM + * +a +,cڡ BIGNUM * +b +, +BN_CTX + * +�x +); + +537 +BIGNUM + * + `BN_mod_�v�� +(BIGNUM * +�t +, + +538 cڡ +BIGNUM + * +a +, cڡ BIGNUM * +n +, +BN_CTX + * +�x +); + +539 +BIGNUM + * + `BN_mod_sq� +(BIGNUM * +�t +, + +540 cڡ +BIGNUM + * +a +, cڡ BIGNUM * +n +, +BN_CTX + * +�x +); + +542 + `BN_cڡtime_sw� +( +BN_ULONG + +sw� +, +BIGNUM + * +a +, BIGNUM * +b +, +nw�ds +); + +545 #i�de� +OPENSSL_NO_DEPRECATED + + +546 +BIGNUM + * + `BN_g���e_�ime +(BIGNUM * +�t +, +b�s +, +�� +, + +547 cڡ +BIGNUM + * +add +, cڡ BIGNUM * +�m +, + +548 (* +��back +)(,,*),* +cb_�g +); + +549 + `BN_is_�ime +(cڡ +BIGNUM + * +p +, +nchecks +, + +550 (* +��back +)(,,*), + +551 +BN_CTX + * +�x +,* +cb_�g +); + +552 + `BN_is_�ime_硋� +(cڡ +BIGNUM + * +p +, +nchecks +, + +553 (* +��back +)(,,*), +BN_CTX + * +�x +,* +cb_�g +, + +554 +do_��l_divisi� +); + +558 + `BN_g���e_�ime_ex +( +BIGNUM + * +�t +, +b�s +, +�� +, cڡ BIGNUM * +add +, + +559 cڡ +BIGNUM + * +�m +, +BN_GENCB + * +cb +); + +560 + `BN_is_�ime_ex +(cڡ +BIGNUM + * +p +, +nchecks +, +BN_CTX + * +�x +, +BN_GENCB + * +cb +); + +561 + `BN_is_�ime_硋�_ex +(cڡ +BIGNUM + * +p +, +nchecks +, +BN_CTX + * +�x +, + +562 +do_��l_divisi� +, +BN_GENCB + * +cb +); + +564 + `BN_X931_g���e_Xpq +( +BIGNUM + * +Xp +, BIGNUM * +Xq +, +nb�s +, +BN_CTX + * +�x +); + +566 + `BN_X931_d�ive_�ime_ex +( +BIGNUM + * +p +, BIGNUM * +p1 +, BIGNUM * +p2 +, + +567 cڡ +BIGNUM + * +Xp +, cڡ BIGNUM * +Xp1 +, cڡ BIGNUM * +Xp2 +, + +568 cڡ +BIGNUM + * +e +, +BN_CTX + * +�x +, +BN_GENCB + * +cb +); + +569 + `BN_X931_g���e_�ime_ex +( +BIGNUM + * +p +, BIGNUM * +p1 +, BIGNUM * +p2 +, + +570 +BIGNUM + * +Xp1 +, BIGNUM * +Xp2 +, + +571 cڡ +BIGNUM + * +Xp +, + +572 cڡ +BIGNUM + * +e +, +BN_CTX + * +�x +, + +573 +BN_GENCB + * +cb +); + +575 +BN_MONT_CTX + * + `BN_MONT_CTX_�w +(); + +576 + `BN_MONT_CTX_�� +( +BN_MONT_CTX + * +�x +); + +577 + `BN_mod_mul_m�tgom�y +( +BIGNUM + * +r +,cڡ BIGNUM * +a +,cڡ BIGNUM * +b +, + +578 +BN_MONT_CTX + * +m�t +, +BN_CTX + * +�x +); + +579 + #BN_to_m�tgom�y +( +r +, +a +, +m�t +, +�x +� + `BN_mod_mul_m�tgom�y +(\ + +580 ( +r +),( +a +),&(( +m�t +)-> +RR +),(m�t),( +�x +)) + + ) + +581 + `BN_�om_m�tgom�y +( +BIGNUM + * +r +,cڡ BIGNUM * +a +, + +582 +BN_MONT_CTX + * +m�t +, +BN_CTX + * +�x +); + +583 + `BN_MONT_CTX_� +( +BN_MONT_CTX + * +m�t +); + +584 + `BN_MONT_CTX_�t +( +BN_MONT_CTX + * +m�t +,cڡ +BIGNUM + * +mod +, +BN_CTX + * +�x +); + +585 +BN_MONT_CTX + * + `BN_MONT_CTX_c�y +(BN_MONT_CTX * +to +,BN_MONT_CTX * +�om +); + +586 +BN_MONT_CTX + * + `BN_MONT_CTX_�t_locked +(BN_MONT_CTX ** +pm�t +, +lock +, + +587 cڡ +BIGNUM + * +mod +, +BN_CTX + * +�x +); + +590 + #BN_BLINDING_NO_UPDATE + 0x00000001 + + ) + +591 + #BN_BLINDING_NO_RECREATE + 0x00000002 + + ) + +593 +BN_BLINDING + * + `BN_BLINDING_�w +(cڡ +BIGNUM + * +A +, cڡ BIGNUM * +Ai +, BIGNUM * +mod +); + +594 + `BN_BLINDING_� +( +BN_BLINDING + * +b +); + +595 + `BN_BLINDING_upd�e +( +BN_BLINDING + * +b +, +BN_CTX + * +�x +); + +596 + `BN_BLINDING_c�v�t +( +BIGNUM + * +n +, +BN_BLINDING + * +b +, +BN_CTX + * +�x +); + +597 + `BN_BLINDING_�v�t +( +BIGNUM + * +n +, +BN_BLINDING + * +b +, +BN_CTX + * +�x +); + +598 + `BN_BLINDING_c�v�t_ex +( +BIGNUM + * +n +, BIGNUM * +r +, +BN_BLINDING + * +b +, +BN_CTX + *); + +599 + `BN_BLINDING_�v�t_ex +( +BIGNUM + * +n +, cڡ BIGNUM * +r +, +BN_BLINDING + * +b +, +BN_CTX + *); + +600 #i�de� +OPENSSL_NO_DEPRECATED + + +601 + `BN_BLINDING_g�_th�ad_id +(cڡ +BN_BLINDING + *); + +602 + `BN_BLINDING_�t_th�ad_id +( +BN_BLINDING + *, ); + +604 +CRYPTO_THREADID + * + `BN_BLINDING_th�ad_id +( +BN_BLINDING + *); + +605 + `BN_BLINDING_g�_�ags +(cڡ +BN_BLINDING + *); + +606 + `BN_BLINDING_�t_�ags +( +BN_BLINDING + *, ); + +607 +BN_BLINDING + * + `BN_BLINDING_���_��m +(BN_BLINDING * +b +, + +608 cڡ +BIGNUM + * +e +, BIGNUM * +m +, +BN_CTX + * +�x +, + +609 (* +bn_mod_exp +)( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +p +, + +610 cڡ +BIGNUM + * +m +, +BN_CTX + * +�x +, +BN_MONT_CTX + * +m_�x +), + +611 +BN_MONT_CTX + * +m_�x +); + +613 #i�de� +OPENSSL_NO_DEPRECATED + + +614 + `BN_�t_��ms +( +mul +, +high +, +low +, +m�t +); + +615 + `BN_g�_��ms +( +which +); + +618 + `BN_RECP_CTX_�� +( +BN_RECP_CTX + * +�� +); + +619 +BN_RECP_CTX + * + `BN_RECP_CTX_�w +(); + +620 + `BN_RECP_CTX_� +( +BN_RECP_CTX + * +�� +); + +621 + `BN_RECP_CTX_�t +( +BN_RECP_CTX + * +�� +,cڡ +BIGNUM + * +rdiv +, +BN_CTX + * +�x +); + +622 + `BN_mod_mul_�c�ro�l +( +BIGNUM + * +r +, cڡ BIGNUM * +x +, cڡ BIGNUM * +y +, + +623 +BN_RECP_CTX + * +�� +, +BN_CTX + * +�x +); + +624 + `BN_mod_exp_�� +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +p +, + +625 cڡ +BIGNUM + * +m +, +BN_CTX + * +�x +); + +626 + `BN_div_�� +( +BIGNUM + * +dv +, BIGNUM * +�m +, cڡ BIGNUM * +m +, + +627 +BN_RECP_CTX + * +�� +, +BN_CTX + * +�x +); + +629 #i�de� +OPENSSL_NO_EC2M + + +640 + `BN_GF2m_add +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +); + +641 + #BN_GF2m_sub +( +r +, +a +, +b +� + `BN_GF2m_add +�,�, b) + + ) + +642 + `BN_GF2m_mod +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +p +); + +643 + `BN_GF2m_mod_mul +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +, + +644 cڡ +BIGNUM + * +p +, +BN_CTX + * +�x +); + +645 + `BN_GF2m_mod_sqr +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +p +, + +646 +BN_CTX + * +�x +); + +647 + `BN_GF2m_mod_�v +( +BIGNUM + * +r +, cڡ BIGNUM * +b +, cڡ BIGNUM * +p +, + +648 +BN_CTX + * +�x +); + +649 + `BN_GF2m_mod_div +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +, + +650 cڡ +BIGNUM + * +p +, +BN_CTX + * +�x +); + +651 + `BN_GF2m_mod_exp +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +, + +652 cڡ +BIGNUM + * +p +, +BN_CTX + * +�x +); + +653 + `BN_GF2m_mod_sq� +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +p +, + +654 +BN_CTX + * +�x +); + +655 + `BN_GF2m_mod_s�ve_quad +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +p +, + +656 +BN_CTX + * +�x +); + +657 + #BN_GF2m_cmp +( +a +, +b +� + `BN_ucmp +(�), (b)) + + ) + +663 + `BN_GF2m_mod_�r +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ +p +[]); + +665 + `BN_GF2m_mod_mul_�r +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +, + +666 cڡ +p +[], +BN_CTX + * +�x +); + +667 + `BN_GF2m_mod_sqr_�r +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ +p +[], + +668 +BN_CTX + * +�x +); + +669 + `BN_GF2m_mod_�v_�r +( +BIGNUM + * +r +, cڡ BIGNUM * +b +, cڡ +p +[], + +670 +BN_CTX + * +�x +); + +671 + `BN_GF2m_mod_div_�r +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +, + +672 cڡ +p +[], +BN_CTX + * +�x +); + +673 + `BN_GF2m_mod_exp_�r +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +, + +674 cڡ +p +[], +BN_CTX + * +�x +); + +675 + `BN_GF2m_mod_sq�_�r +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, + +676 cڡ +p +[], +BN_CTX + * +�x +); + +677 + `BN_GF2m_mod_s�ve_quad_�r +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, + +678 cڡ +p +[], +BN_CTX + * +�x +); + +679 + `BN_GF2m_p�y2�r +(cڡ +BIGNUM + * +a +, +p +[], +max +); + +680 + `BN_GF2m_�r2p�y +(cڡ +p +[], +BIGNUM + * +a +); + +686 + `BN_ni�_mod_192 +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +p +, +BN_CTX + * +�x +); + +687 + `BN_ni�_mod_224 +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +p +, +BN_CTX + * +�x +); + +688 + `BN_ni�_mod_256 +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +p +, +BN_CTX + * +�x +); + +689 + `BN_ni�_mod_384 +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +p +, +BN_CTX + * +�x +); + +690 + `BN_ni�_mod_521 +( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +p +, +BN_CTX + * +�x +); + +692 cڡ +BIGNUM + * + `BN_g�0_ni�_�ime_192 +(); + +693 cڡ +BIGNUM + * + `BN_g�0_ni�_�ime_224 +(); + +694 cڡ +BIGNUM + * + `BN_g�0_ni�_�ime_256 +(); + +695 cڡ +BIGNUM + * + `BN_g�0_ni�_�ime_384 +(); + +696 cڡ +BIGNUM + * + `BN_g�0_ni�_�ime_521 +(); + +700 + #bn_ex�nd +( +a +, +b�s +) \ + +702 +b�s + > ( +INT_MAX + - +BN_BITS2 + + 1) ? \ + +703 +NULL + \ + +705 ((( +b�s ++ +BN_BITS2 +-1)/BN_BITS2�<�( +a +)-> +dmax +) ? \ + +706 ( +a +) \ + +708 + `bn_ex�nd2 +(( +a +),( +b�s ++ +BN_BITS2 +-1)/BN_BITS2) \ + +709 ) + + ) + +711 + #bn_wex�nd +( +a +, +w�ds +�(((w�ds�<��)-> +dmax +)?�): + `bn_ex�nd2 +(�),(w�ds))) + + ) + +712 +BIGNUM + * + `bn_ex�nd2 +(BIGNUM * +a +, +w�ds +); + +713 #i�de� +OPENSSL_NO_DEPRECATED + + +714 +BIGNUM + * + `bn_dup_ex�nd +(cڡ BIGNUM * +a +, +w�ds +); + +745 #ifde� +BN_DEBUG + + +748 + ~<as��.h +> + +750 #ifde� +BN_DEBUG_RAND + + +752 #i�de� +RAND_p�udo_by�s + + +753 + `RAND_p�udo_by�s +(* +buf +, +num +); + +754 + #BN_DEBUG_TRIX + + + ) + +756 + #bn_p�lu� +( +a +) \ + +758 cڡ +BIGNUM + * +_bnum1 + = ( +a +); \ + +759 if( +_bnum1 +-> +t� + < _bnum1-> +dmax +) { \ + +760 +_tmp_ch� +; \ + +764 +BN_ULONG + * +_n�_cڡ +; \ + +765 + `mem�y +(& +_n�_cڡ +, & +_bnum1 +-> +d +, ( +BN_ULONG +*)); \ + +766 + `RAND_p�udo_by�s +(& +_tmp_ch� +, 1); \ + +767 + `mem�t +((*)( +_n�_cڡ + + +_bnum1 +-> +t� +), +_tmp_ch� +, \ + +768 ( +_bnum1 +-> +dmax + - _bnum1-> +t� +�* ( +BN_ULONG +)); \ + +770 } 0) + + ) + +771 #ifde� +BN_DEBUG_TRIX + + +772 #unde� +RAND_p�udo_by�s + + +775 + #bn_p�lu� +( +a +) + + ) + +777 + #bn_check_t� +( +a +) \ + +779 cڡ +BIGNUM + * +_bnum2 + = ( +a +); \ + +780 i�( +_bnum2 + !� +NULL +) { \ + +781 + `as�� +(( +_bnum2 +-> +t� + == 0) || \ + +782 ( +_bnum2 +-> +d +[_bnum2-> +t� + - 1] != 0)); \ + +783 + `bn_p�lu� +( +_bnum2 +); \ + +785 } 0) + + ) + +787 + #bn_fix_t� +( +a +� + `bn_check_t� +�) + + ) + +789 + #bn_check_size +( +bn +, +b�s +� + `bn_wcheck_size +(bn, ((b�s+ +BN_BITS2 +-1))/BN_BITS2) + + ) + +790 + #bn_wcheck_size +( +bn +, +w�ds +) \ + +792 cڡ +BIGNUM + * +_bnum2 + = ( +bn +); \ + +793 + `as�� +( +w�ds + <�( +_bnum2 +)-> +dmax + && w�d�>�(_bnum2)-> +t� +); \ + +794 } 0) + + ) + +798 + #bn_p�lu� +( +a +) + + ) + +799 + #bn_check_t� +( +a +) + + ) + +800 + #bn_fix_t� +( +a +� + `bn_cܻ�_t� +�) + + ) + +801 + #bn_check_size +( +bn +, +b�s +) + + ) + +802 + #bn_wcheck_size +( +bn +, +w�ds +) + + ) + +806 + #bn_cܻ�_t� +( +a +) \ + +808 +BN_ULONG + * +�l +; \ + +809 +tmp_t� + = ( +a +)-> +t� +; \ + +810 i�( +tmp_t� + > 0) \ + +812 +�l +�&(( +a +)-> +d +[ +tmp_t� +-1]);�mp_top > 0;�mp_top--) \ + +813 i�(*( +�l +--)) ; \ + +814 ( +a +)-> +t� + = +tmp_t� +; \ + +816 + `bn_p�lu� +( +a +); \ + +817 } + + ) + +819 +BN_ULONG + + `bn_mul_add_w�ds +(BN_ULONG * +� +, cڡ BN_ULONG * +� +, +num +, BN_ULONG +w +); + +820 +BN_ULONG + + `bn_mul_w�ds +(BN_ULONG * +� +, cڡ BN_ULONG * +� +, +num +, BN_ULONG +w +); + +821 + `bn_sqr_w�ds +( +BN_ULONG + * +� +, cڡ BN_ULONG * +� +, +num +); + +822 +BN_ULONG + + `bn_div_w�ds +(BN_ULONG +h +, BN_ULONG +l +, BN_ULONG +d +); + +823 +BN_ULONG + + `bn_add_w�ds +(BN_ULONG * +� +, cڡ BN_ULONG * +� +, cڡ BN_ULONG * +bp +, +num +); + +824 +BN_ULONG + + `bn_sub_w�ds +(BN_ULONG * +� +, cڡ BN_ULONG * +� +, cڡ BN_ULONG * +bp +, +num +); + +827 +BIGNUM + * + `g�_rfc2409_�ime_768 +(BIGNUM * +bn +); + +828 +BIGNUM + * + `g�_rfc2409_�ime_1024 +(BIGNUM * +bn +); + +831 +BIGNUM + * + `g�_rfc3526_�ime_1536 +(BIGNUM * +bn +); + +832 +BIGNUM + * + `g�_rfc3526_�ime_2048 +(BIGNUM * +bn +); + +833 +BIGNUM + * + `g�_rfc3526_�ime_3072 +(BIGNUM * +bn +); + +834 +BIGNUM + * + `g�_rfc3526_�ime_4096 +(BIGNUM * +bn +); + +835 +BIGNUM + * + `g�_rfc3526_�ime_6144 +(BIGNUM * +bn +); + +836 +BIGNUM + * + `g�_rfc3526_�ime_8192 +(BIGNUM * +bn +); + +838 + `BN_b�e�_�nd +( +BIGNUM + * +�d +, +b�s +, +t� +, +b�tom +); + +844 + `ERR_l�d_BN_�r�gs +(); + +849 + #BN_F_BNRAND + 127 + + ) + +850 + #BN_F_BN_BLINDING_CONVERT_EX + 100 + + ) + +851 + #BN_F_BN_BLINDING_CREATE_PARAM + 128 + + ) + +852 + #BN_F_BN_BLINDING_INVERT_EX + 101 + + ) + +853 + #BN_F_BN_BLINDING_NEW + 102 + + ) + +854 + #BN_F_BN_BLINDING_UPDATE + 103 + + ) + +855 + #BN_F_BN_BN2DEC + 104 + + ) + +856 + #BN_F_BN_BN2HEX + 105 + + ) + +857 + #BN_F_BN_CTX_GET + 116 + + ) + +858 + #BN_F_BN_CTX_NEW + 106 + + ) + +859 + #BN_F_BN_CTX_START + 129 + + ) + +860 + #BN_F_BN_DIV + 107 + + ) + +861 + #BN_F_BN_DIV_NO_BRANCH + 138 + + ) + +862 + #BN_F_BN_DIV_RECP + 130 + + ) + +863 + #BN_F_BN_EXP + 123 + + ) + +864 + #BN_F_BN_EXPAND2 + 108 + + ) + +865 + #BN_F_BN_EXPAND_INTERNAL + 120 + + ) + +866 + #BN_F_BN_GF2M_MOD + 131 + + ) + +867 + #BN_F_BN_GF2M_MOD_EXP + 132 + + ) + +868 + #BN_F_BN_GF2M_MOD_MUL + 133 + + ) + +869 + #BN_F_BN_GF2M_MOD_SOLVE_QUAD + 134 + + ) + +870 + #BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR + 135 + + ) + +871 + #BN_F_BN_GF2M_MOD_SQR + 136 + + ) + +872 + #BN_F_BN_GF2M_MOD_SQRT + 137 + + ) + +873 + #BN_F_BN_MOD_EXP2_MONT + 118 + + ) + +874 + #BN_F_BN_MOD_EXP_MONT + 109 + + ) + +875 + #BN_F_BN_MOD_EXP_MONT_CONSTTIME + 124 + + ) + +876 + #BN_F_BN_MOD_EXP_MONT_WORD + 117 + + ) + +877 + #BN_F_BN_MOD_EXP_RECP + 125 + + ) + +878 + #BN_F_BN_MOD_EXP_SIMPLE + 126 + + ) + +879 + #BN_F_BN_MOD_INVERSE + 110 + + ) + +880 + #BN_F_BN_MOD_INVERSE_NO_BRANCH + 139 + + ) + +881 + #BN_F_BN_MOD_LSHIFT_QUICK + 119 + + ) + +882 + #BN_F_BN_MOD_MUL_RECIPROCAL + 111 + + ) + +883 + #BN_F_BN_MOD_SQRT + 121 + + ) + +884 + #BN_F_BN_MPI2BN + 112 + + ) + +885 + #BN_F_BN_NEW + 113 + + ) + +886 + #BN_F_BN_RAND + 114 + + ) + +887 + #BN_F_BN_RAND_RANGE + 122 + + ) + +888 + #BN_F_BN_USUB + 115 + + ) + +891 + #BN_R_ARG2_LT_ARG3 + 100 + + ) + +892 + #BN_R_BAD_RECIPROCAL + 101 + + ) + +893 + #BN_R_BIGNUM_TOO_LONG + 114 + + ) + +894 + #BN_R_CALLED_WITH_EVEN_MODULUS + 102 + + ) + +895 + #BN_R_DIV_BY_ZERO + 103 + + ) + +896 + #BN_R_ENCODING_ERROR + 104 + + ) + +897 + #BN_R_EXPAND_ON_STATIC_BIGNUM_DATA + 105 + + ) + +898 + #BN_R_INPUT_NOT_REDUCED + 110 + + ) + +899 + #BN_R_INVALID_LENGTH + 106 + + ) + +900 + #BN_R_INVALID_RANGE + 115 + + ) + +901 + #BN_R_NOT_A_SQUARE + 111 + + ) + +902 + #BN_R_NOT_INITIALIZED + 107 + + ) + +903 + #BN_R_NO_INVERSE + 108 + + ) + +904 + #BN_R_NO_SOLUTION + 116 + + ) + +905 + #BN_R_P_IS_NOT_PRIME + 112 + + ) + +906 + #BN_R_TOO_MANY_ITERATIONS + 113 + + ) + +907 + #BN_R_TOO_MANY_TEMPORARY_VARIABLES + 109 + + ) + +909 #ifde� +__�lu�lus + + +910 + } +} + + @/usr/include/openssl/buffer.h + +59 #i�de� +HEADER_BUFFER_H + + +60 + #HEADER_BUFFER_H + + + ) + +62 + ~<ݒs�/os�_typ.h +> + +64 #ifde� +__�lu�lus + + +68 + ~<�ddef.h +> + +70 #i�! +def�ed +( +NO_SYS_TYPES_H +) + +71 + ~<sys/ty�s.h +> + +77 + sbuf_mem_� + + +79 +size_t + +�ngth +; + +80 * +d�a +; + +81 +size_t + +max +; + +84 +BUF_MEM + * +BUF_MEM_�w +(); + +85 +BUF_MEM_� +( +BUF_MEM + * +a +); + +86 +BUF_MEM_grow +( +BUF_MEM + * +�r +, +size_t + +�n +); + +87 +BUF_MEM_grow_��n +( +BUF_MEM + * +�r +, +size_t + +�n +); + +88 * +BUF_�rdup +(cڡ * +�r +); + +89 * +BUF_��dup +(cڡ * +�r +, +size_t + +siz +); + +90 * +BUF_memdup +(cڡ * +d�a +, +size_t + +siz +); + +91 +BUF_�v�� +(* +out +, cڡ * +� +, +size_t + +siz +); + +94 +size_t + +BUF_���y +(* +d� +,cڡ * +�c +,size_� +siz +); + +95 +size_t + +BUF_���t +(* +d� +,cڡ * +�c +,size_� +siz +); + +102 +ERR_l�d_BUF_�r�gs +(); + +107 + #BUF_F_BUF_MEMDUP + 103 + + ) + +108 + #BUF_F_BUF_MEM_GROW + 100 + + ) + +109 + #BUF_F_BUF_MEM_GROW_CLEAN + 105 + + ) + +110 + #BUF_F_BUF_MEM_NEW + 101 + + ) + +111 + #BUF_F_BUF_STRDUP + 102 + + ) + +112 + #BUF_F_BUF_STRNDUP + 104 + + ) + +116 #ifde� +__�lu�lus + + + @/usr/include/openssl/conf.h + +59 #i�de� +HEADER_CONF_H + + +60 + #HEADER_CONF_H + + + ) + +62 + ~<ݒs�/bio.h +> + +63 + ~<ݒs�/lhash.h +> + +64 + ~<ݒs�/�ack.h +> + +65 + ~<ݒs�/��ack.h +> + +66 + ~<ݒs�/e_os2.h +> + +68 + ~<ݒs�/os�_typ.h +> + +70 #ifde� +__�lu�lus + + +76 * +��i� +; + +77 * +�me +; + +78 * +v�ue +; + +79 } + tCONF_VALUE +; + +81 +DECLARE_STACK_OF +( +CONF_VALUE +) + +82 +DECLARE_LHASH_OF +( +CONF_VALUE +); + +84 +c�f_� +; + +85 +c�f_m�hod_� +; + +86 +c�f_m�hod_� + + tCONF_METHOD +; + +88 + sc�f_m�hod_� + + +90 cڡ * +�me +; + +91 +CONF + *(* +��� +)( +CONF_METHOD + * +m�h +); + +92 (* +�� +)( +CONF + * +c�f +); + +93 (* +de�roy +)( +CONF + * +c�f +); + +94 (* +de�roy_d�a +)( +CONF + * +c�f +); + +95 (* +l�d_bio +)( +CONF + * +c�f +, +BIO + * +bp +, * +��e +); + +96 (* +dump +)(cڡ +CONF + * +c�f +, +BIO + * +bp +); + +97 (* +is_numb� +)(cڡ +CONF + * +c�f +, +c +); + +98 (* +to_�t +)(cڡ +CONF + * +c�f +, +c +); + +99 (* +l�d +)( +CONF + * +c�f +, cڡ * +�me +, * +��e +); + +104 +c�f_imodu�_� + + tCONF_IMODULE +; + +105 +c�f_modu�_� + + tCONF_MODULE +; + +107 +DECLARE_STACK_OF +( +CONF_MODULE +) + +108 +DECLARE_STACK_OF +( +CONF_IMODULE +) + +111 + tc�f_��_func +( + tCONF_IMODULE + * + tmd +, cڡ + tCONF + * + t�f +); + +112 + tc�f_f�ish_func +( + tCONF_IMODULE + * + tmd +); + +114 + #CONF_MFLAGS_IGNORE_ERRORS + 0x1 + + ) + +115 + #CONF_MFLAGS_IGNORE_RETURN_CODES + 0x2 + + ) + +116 + #CONF_MFLAGS_SILENT + 0x4 + + ) + +117 + #CONF_MFLAGS_NO_DSO + 0x8 + + ) + +118 + #CONF_MFLAGS_IGNORE_MISSING_FILE + 0x10 + + ) + +119 + #CONF_MFLAGS_DEFAULT_SECTION + 0x20 + + ) + +121 +CONF_�t_de�u�_m�hod +( +CONF_METHOD + * +m�h +); + +122 +CONF_�t_nc�f +( +CONF + * +c�f +, +LHASH_OF +( +CONF_VALUE +�* +hash +); + +123 +LHASH_OF +( +CONF_VALUE +�* +CONF_l�d +(LHASH_OF(CONF_VALUE�* +c�f +,cڡ * +f�e +, + +124 * +��e +); + +125 #i�de� +OPENSSL_NO_FP_API + + +126 +LHASH_OF +( +CONF_VALUE +�* +CONF_l�d_� +(LHASH_OF(CONF_VALUE�* +c�f +, +FILE + * +� +, + +127 * +��e +); + +129 +LHASH_OF +( +CONF_VALUE +�* +CONF_l�d_bio +(LHASH_OF(CONF_VALUE�* +c�f +, +BIO + * +bp +,* +��e +); + +130 +STACK_OF +( +CONF_VALUE +�* +CONF_g�_��i� +( +LHASH_OF +(CONF_VALUE�* +c�f +, + +131 cڡ * +��i� +); + +132 * +CONF_g�_�r�g +( +LHASH_OF +( +CONF_VALUE +�* +c�f +,cڡ * +group +, + +133 cڡ * +�me +); + +134 +CONF_g�_numb� +( +LHASH_OF +( +CONF_VALUE +�* +c�f +,cڡ * +group +, + +135 cڡ * +�me +); + +136 +CONF_� +( +LHASH_OF +( +CONF_VALUE +�* +c�f +); + +137 +CONF_dump_� +( +LHASH_OF +( +CONF_VALUE +�* +c�f +, +FILE + * +out +); + +138 +CONF_dump_bio +( +LHASH_OF +( +CONF_VALUE +�* +c�f +, +BIO + * +out +); + +140 +OPENSSL_c�fig +(cڡ * +c�fig_�me +); + +141 +OPENSSL_no_c�fig +(); + +146 + sc�f_� + + +148 +CONF_METHOD + * +m�h +; + +149 * +m�h_d�a +; + +150 +LHASH_OF +( +CONF_VALUE +�* +d�a +; + +153 +CONF + * +NCONF_�w +( +CONF_METHOD + * +m�h +); + +154 +CONF_METHOD + * +NCONF_de�u� +(); + +155 +CONF_METHOD + * +NCONF_WIN32 +(); + +157 +CONF_METHOD + * +NCONF_XML +(); + +159 +NCONF_� +( +CONF + * +c�f +); + +160 +NCONF_�_d�a +( +CONF + * +c�f +); + +162 +NCONF_l�d +( +CONF + * +c�f +,cڡ * +f�e +,* +��e +); + +163 #i�de� +OPENSSL_NO_FP_API + + +164 +NCONF_l�d_� +( +CONF + * +c�f +, +FILE + * +� +,* +��e +); + +166 +NCONF_l�d_bio +( +CONF + * +c�f +, +BIO + * +bp +,* +��e +); + +167 +STACK_OF +( +CONF_VALUE +�* +NCONF_g�_��i� +(cڡ +CONF + * +c�f +,cڡ * +��i� +); + +168 * +NCONF_g�_�r�g +(cڡ +CONF + * +c�f +,cڡ * +group +,cڡ * +�me +); + +169 +NCONF_g�_numb�_e +(cڡ +CONF + * +c�f +,cڡ * +group +,cڡ * +�me +, + +170 * +�su� +); + +171 +NCONF_dump_� +(cڡ +CONF + * +c�f +, +FILE + * +out +); + +172 +NCONF_dump_bio +(cڡ +CONF + * +c�f +, +BIO + * +out +); + +176 +NCONF_g�_numb� +( +CONF + * +c�f +,* +group +,* +�me +); + +178 + #NCONF_g�_numb� +( +c +, +g +, +n +, +r +� + `NCONF_g�_numb�_e +(c,g,n,r) + + ) + +183 +CONF_modu�s_l�d +(cڡ +CONF + * +�f +, cڡ * +��ame +, + +184 +�ags +); + +185 +CONF_modu�s_l�d_f�e +(cڡ * +f��ame +, cڡ * +��ame +, + +186 +�ags +); + +187 +CONF_modu�s_u��d +( +�l +); + +188 +CONF_modu�s_f�ish +(); + +189 +CONF_modu�s_� +(); + +190 +CONF_modu�_add +(cڡ * +�me +, +c�f_��_func + * +ifunc +, + +191 +c�f_f�ish_func + * +ffunc +); + +193 cڡ * +CONF_imodu�_g�_�me +(cڡ +CONF_IMODULE + * +md +); + +194 cڡ * +CONF_imodu�_g�_v�ue +(cڡ +CONF_IMODULE + * +md +); + +195 * +CONF_imodu�_g�_u�_d�a +(cڡ +CONF_IMODULE + * +md +); + +196 +CONF_imodu�_�t_u�_d�a +( +CONF_IMODULE + * +md +, * +u�_d�a +); + +197 +CONF_MODULE + * +CONF_imodu�_g�_modu� +(cڡ +CONF_IMODULE + * +md +); + +198 +CONF_imodu�_g�_�ags +(cڡ +CONF_IMODULE + * +md +); + +199 +CONF_imodu�_�t_�ags +( +CONF_IMODULE + * +md +, +�ags +); + +200 * +CONF_modu�_g�_u�_d�a +( +CONF_MODULE + * +pmod +); + +201 +CONF_modu�_�t_u�_d�a +( +CONF_MODULE + * +pmod +, * +u�_d�a +); + +203 * +CONF_g�1_de�u�_c�fig_f�e +(); + +205 +CONF_�r�_li� +(cڡ * +li� +, +�p +, +no�c +, + +206 (* +li�_cb +)(cڡ * +�em +, +�n +, * +u� +), * +�g +); + +208 +OPENSSL_l�d_bu�t�_modu�s +(); + +214 +ERR_l�d_CONF_�r�gs +(); + +219 + #CONF_F_CONF_DUMP_FP + 104 + + ) + +220 + #CONF_F_CONF_LOAD + 100 + + ) + +221 + #CONF_F_CONF_LOAD_BIO + 102 + + ) + +222 + #CONF_F_CONF_LOAD_FP + 103 + + ) + +223 + #CONF_F_CONF_MODULES_LOAD + 116 + + ) + +224 + #CONF_F_CONF_PARSE_LIST + 119 + + ) + +225 + #CONF_F_DEF_LOAD + 120 + + ) + +226 + #CONF_F_DEF_LOAD_BIO + 121 + + ) + +227 + #CONF_F_MODULE_INIT + 115 + + ) + +228 + #CONF_F_MODULE_LOAD_DSO + 117 + + ) + +229 + #CONF_F_MODULE_RUN + 118 + + ) + +230 + #CONF_F_NCONF_DUMP_BIO + 105 + + ) + +231 + #CONF_F_NCONF_DUMP_FP + 106 + + ) + +232 + #CONF_F_NCONF_GET_NUMBER + 107 + + ) + +233 + #CONF_F_NCONF_GET_NUMBER_E + 112 + + ) + +234 + #CONF_F_NCONF_GET_SECTION + 108 + + ) + +235 + #CONF_F_NCONF_GET_STRING + 109 + + ) + +236 + #CONF_F_NCONF_LOAD + 113 + + ) + +237 + #CONF_F_NCONF_LOAD_BIO + 110 + + ) + +238 + #CONF_F_NCONF_LOAD_FP + 114 + + ) + +239 + #CONF_F_NCONF_NEW + 111 + + ) + +240 + #CONF_F_STR_COPY + 101 + + ) + +243 + #CONF_R_ERROR_LOADING_DSO + 110 + + ) + +244 + #CONF_R_LIST_CANNOT_BE_NULL + 115 + + ) + +245 + #CONF_R_MISSING_CLOSE_SQUARE_BRACKET + 100 + + ) + +246 + #CONF_R_MISSING_EQUAL_SIGN + 101 + + ) + +247 + #CONF_R_MISSING_FINISH_FUNCTION + 111 + + ) + +248 + #CONF_R_MISSING_INIT_FUNCTION + 112 + + ) + +249 + #CONF_R_MODULE_INITIALIZATION_ERROR + 109 + + ) + +250 + #CONF_R_NO_CLOSE_BRACE + 102 + + ) + +251 + #CONF_R_NO_CONF + 105 + + ) + +252 + #CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE + 106 + + ) + +253 + #CONF_R_NO_SECTION + 107 + + ) + +254 + #CONF_R_NO_SUCH_FILE + 114 + + ) + +255 + #CONF_R_NO_VALUE + 108 + + ) + +256 + #CONF_R_UNABLE_TO_CREATE_NEW_SECTION + 103 + + ) + +257 + #CONF_R_UNKNOWN_MODULE_NAME + 113 + + ) + +258 + #CONF_R_VARIABLE_HAS_NO_VALUE + 104 + + ) + +260 #ifde� +__�lu�lus + + + @/usr/include/openssl/engine.h + +64 #i�de� +HEADER_ENGINE_H + + +65 + #HEADER_ENGINE_H + + + ) + +67 + ~<ݒs�/ݒs�c�f.h +> + +69 #ifde� +OPENSSL_NO_ENGINE + + +70 #�r� +ENGINE + +is + +di�b�d +. + +73 #i�de� +OPENSSL_NO_DEPRECATED + + +74 + ~<ݒs�/bn.h +> + +75 #i�de� +OPENSSL_NO_RSA + + +76 + ~<ݒs�/r�.h +> + +78 #i�de� +OPENSSL_NO_DSA + + +79 + ~<ݒs�/d�.h +> + +81 #i�de� +OPENSSL_NO_DH + + +82 + ~<ݒs�/dh.h +> + +84 #i�de� +OPENSSL_NO_ECDH + + +85 + ~<ݒs�/ecdh.h +> + +87 #i�de� +OPENSSL_NO_ECDSA + + +88 + ~<ݒs�/ecd�.h +> + +90 + ~<ݒs�/�nd.h +> + +91 + ~<ݒs�/ui.h +> + +92 + ~<ݒs�/�r.h +> + +95 + ~<ݒs�/os�_typ.h +> + +96 + ~<ݒs�/symhacks.h +> + +98 + ~<ݒs�/x509.h +> + +100 #ifde� +__�lu�lus + + +106 + #ENGINE_METHOD_RSA + ()0x0001 + + ) + +107 + #ENGINE_METHOD_DSA + ()0x0002 + + ) + +108 + #ENGINE_METHOD_DH + ()0x0004 + + ) + +109 + #ENGINE_METHOD_RAND + ()0x0008 + + ) + +110 + #ENGINE_METHOD_ECDH + ()0x0010 + + ) + +111 + #ENGINE_METHOD_ECDSA + ()0x0020 + + ) + +112 + #ENGINE_METHOD_CIPHERS + ()0x0040 + + ) + +113 + #ENGINE_METHOD_DIGESTS + ()0x0080 + + ) + +114 + #ENGINE_METHOD_STORE + ()0x0100 + + ) + +115 + #ENGINE_METHOD_PKEY_METHS + ()0x0200 + + ) + +116 + #ENGINE_METHOD_PKEY_ASN1_METHS + ()0x0400 + + ) + +118 + #ENGINE_METHOD_ALL + ()0xFFFF + + ) + +119 + #ENGINE_METHOD_NONE + ()0x0000 + + ) + +125 + #ENGINE_TABLE_FLAG_NOINIT + ()0x0001 + + ) + +133 + #ENGINE_FLAGS_MANUAL_CMD_CTRL + ()0x0002 + + ) + +142 + #ENGINE_FLAGS_BY_ID_COPY + ()0x0004 + + ) + +149 + #ENGINE_FLAGS_NO_REGISTER_ALL + ()0x0008 + + ) + +162 + #ENGINE_CMD_FLAG_NUMERIC + ()0x0001 + + ) + +165 + #ENGINE_CMD_FLAG_STRING + ()0x0002 + + ) + +168 + #ENGINE_CMD_FLAG_NO_INPUT + ()0x0004 + + ) + +172 + #ENGINE_CMD_FLAG_INTERNAL + ()0x0008 + + ) + +187 + #ENGINE_CTRL_SET_LOGSTREAM + 1 + + ) + +188 + #ENGINE_CTRL_SET_PASSWORD_CALLBACK + 2 + + ) + +189 + #ENGINE_CTRL_HUP + 3 + + ) + +191 + #ENGINE_CTRL_SET_USER_INTERFACE + 4 + + ) + +192 + #ENGINE_CTRL_SET_CALLBACK_DATA + 5 + + ) + +196 + #ENGINE_CTRL_LOAD_CONFIGURATION + 6 + + ) + +199 + #ENGINE_CTRL_LOAD_SECTION + 7 + + ) + +220 + #ENGINE_CTRL_HAS_CTRL_FUNCTION + 10 + + ) + +223 + #ENGINE_CTRL_GET_FIRST_CMD_TYPE + 11 + + ) + +226 + #ENGINE_CTRL_GET_NEXT_CMD_TYPE + 12 + + ) + +229 + #ENGINE_CTRL_GET_CMD_FROM_NAME + 13 + + ) + +236 + #ENGINE_CTRL_GET_NAME_LEN_FROM_CMD + 14 + + ) + +237 + #ENGINE_CTRL_GET_NAME_FROM_CMD + 15 + + ) + +239 + #ENGINE_CTRL_GET_DESC_LEN_FROM_CMD + 16 + + ) + +240 + #ENGINE_CTRL_GET_DESC_FROM_CMD + 17 + + ) + +244 + #ENGINE_CTRL_GET_CMD_FLAGS + 18 + + ) + +248 + #ENGINE_CMD_BASE + 200 + + ) + +257 + #ENGINE_CTRL_CHIL_SET_FORKCHECK + 100 + + ) + +262 + #ENGINE_CTRL_CHIL_NO_LOCKING + 101 + + ) + +274 + sENGINE_CMD_DEFN_� + + +276 +cmd_num +; + +277 cڡ * +cmd_�me +; + +278 cڡ * +cmd_desc +; + +279 +cmd_�ags +; + +280 } + tENGINE_CMD_DEFN +; + +283 (* +ENGINE_GEN_FUNC_PTR +)(); + +285 (* +ENGINE_GEN_INT_FUNC_PTR +)( + tENGINE + *); + +287 (* +ENGINE_CTRL_FUNC_PTR +)( + tENGINE + *, , , *, (* + tf +)()); + +289 +EVP_PKEY + * (* + tENGINE_LOAD_KEY_PTR +)( + tENGINE + *, const *, + +290 + tUI_METHOD + * + tui_m�hod +, * + t��back_d�a +); + +291 (* +ENGINE_SSL_CLIENT_CERT_PTR +)( + tENGINE + *, + tSSL + * + ts� +, + +292 + tSTACK_OF +( + tX509_NAME +�* + t�_dn +, + tX509 + ** + tp�� +, + tEVP_PKEY + ** + tpkey +, + +293 + tSTACK_OF +( + tX509 +�** + tp�h� +, + tUI_METHOD + * + tui_m�hod +, * + t��back_d�a +); + +306 (* +ENGINE_CIPHERS_PTR +)( + tENGINE + *, cڡ + tEVP_CIPHER + **, const **, ); + +307 (* +ENGINE_DIGESTS_PTR +)( + tENGINE + *, cڡ + tEVP_MD + **, const **, ); + +308 (* +ENGINE_PKEY_METHS_PTR +)( + tENGINE + *, + tEVP_PKEY_METHOD + **, const **, ); + +309 (* +ENGINE_PKEY_ASN1_METHS_PTR +)( + tENGINE + *, + tEVP_PKEY_ASN1_METHOD + **, const **, ); + +321 +ENGINE + * +ENGINE_g�_f�� +(); + +322 +ENGINE + * +ENGINE_g�_ϡ +(); + +324 +ENGINE + * +ENGINE_g�_�xt +(ENGINE * +e +); + +325 +ENGINE + * +ENGINE_g�_�ev +(ENGINE * +e +); + +327 +ENGINE_add +( +ENGINE + * +e +); + +329 +ENGINE_�move +( +ENGINE + * +e +); + +331 +ENGINE + * +ENGINE_by_id +(cڡ * +id +); + +333 +ENGINE_l�d_ݒs� +(); + +334 +ENGINE_l�d_dy�mic +(); + +335 #i�de� +OPENSSL_NO_STATIC_ENGINE + + +336 +ENGINE_l�d_4758c� +(); + +337 +ENGINE_l�d_�p +(); + +338 +ENGINE_l�d_��� +(); + +339 +ENGINE_l�d_ch� +(); + +340 +ENGINE_l�d_cswi� +(); + +341 +ENGINE_l�d_nur� +(); + +342 +ENGINE_l�d_su�w�e +(); + +343 +ENGINE_l�d_ub�c +(); + +344 +ENGINE_l�d_�dlock +(); + +345 +ENGINE_l�d_�pi +(); + +346 #i�de� +OPENSSL_NO_GMP + + +347 +ENGINE_l�d_gmp +(); + +349 #i�de� +OPENSSL_NO_GOST + + +350 +ENGINE_l�d_go� +(); + +353 +ENGINE_l�d_�y�odev +(); + +354 +ENGINE_l�d_r�x +(); + +355 +ENGINE_l�d_rd�nd +(); + +356 +ENGINE_l�d_bu�t�_�g�es +(); + +360 +ENGINE_g�_�b�_�ags +(); + +361 +ENGINE_�t_�b�_�ags +( +�ags +); + +371 +ENGINE_�gi��_RSA +( +ENGINE + * +e +); + +372 +ENGINE_u�egi��_RSA +( +ENGINE + * +e +); + +373 +ENGINE_�gi��_�l_RSA +(); + +375 +ENGINE_�gi��_DSA +( +ENGINE + * +e +); + +376 +ENGINE_u�egi��_DSA +( +ENGINE + * +e +); + +377 +ENGINE_�gi��_�l_DSA +(); + +379 +ENGINE_�gi��_ECDH +( +ENGINE + * +e +); + +380 +ENGINE_u�egi��_ECDH +( +ENGINE + * +e +); + +381 +ENGINE_�gi��_�l_ECDH +(); + +383 +ENGINE_�gi��_ECDSA +( +ENGINE + * +e +); + +384 +ENGINE_u�egi��_ECDSA +( +ENGINE + * +e +); + +385 +ENGINE_�gi��_�l_ECDSA +(); + +387 +ENGINE_�gi��_DH +( +ENGINE + * +e +); + +388 +ENGINE_u�egi��_DH +( +ENGINE + * +e +); + +389 +ENGINE_�gi��_�l_DH +(); + +391 +ENGINE_�gi��_RAND +( +ENGINE + * +e +); + +392 +ENGINE_u�egi��_RAND +( +ENGINE + * +e +); + +393 +ENGINE_�gi��_�l_RAND +(); + +395 +ENGINE_�gi��_STORE +( +ENGINE + * +e +); + +396 +ENGINE_u�egi��_STORE +( +ENGINE + * +e +); + +397 +ENGINE_�gi��_�l_STORE +(); + +399 +ENGINE_�gi��_c�h�s +( +ENGINE + * +e +); + +400 +ENGINE_u�egi��_c�h�s +( +ENGINE + * +e +); + +401 +ENGINE_�gi��_�l_c�h�s +(); + +403 +ENGINE_�gi��_dige�s +( +ENGINE + * +e +); + +404 +ENGINE_u�egi��_dige�s +( +ENGINE + * +e +); + +405 +ENGINE_�gi��_�l_dige�s +(); + +407 +ENGINE_�gi��_pkey_m�hs +( +ENGINE + * +e +); + +408 +ENGINE_u�egi��_pkey_m�hs +( +ENGINE + * +e +); + +409 +ENGINE_�gi��_�l_pkey_m�hs +(); + +411 +ENGINE_�gi��_pkey_a�1_m�hs +( +ENGINE + * +e +); + +412 +ENGINE_u�egi��_pkey_a�1_m�hs +( +ENGINE + * +e +); + +413 +ENGINE_�gi��_�l_pkey_a�1_m�hs +(); + +419 +ENGINE_�gi��_com��e +( +ENGINE + * +e +); + +420 +ENGINE_�gi��_�l_com��e +(); + +429 +ENGINE_�� +( +ENGINE + * +e +, +cmd +, +i +, * +p +, (* +f +)()); + +435 +ENGINE_cmd_is_execu�b� +( +ENGINE + * +e +, +cmd +); + +441 +ENGINE_��_cmd +( +ENGINE + * +e +, cڡ * +cmd_�me +, + +442 +i +, * +p +, (* +f +)(), +cmd_�tiڮ +); + +463 +ENGINE_��_cmd_�r�g +( +ENGINE + * +e +, cڡ * +cmd_�me +, cڡ * +�g +, + +464 +cmd_�tiڮ +); + +472 +ENGINE + * +ENGINE_�w +(); + +473 +ENGINE_� +( +ENGINE + * +e +); + +474 +ENGINE_up_�f +( +ENGINE + * +e +); + +475 +ENGINE_�t_id +( +ENGINE + * +e +, cڡ * +id +); + +476 +ENGINE_�t_�me +( +ENGINE + * +e +, cڡ * +�me +); + +477 +ENGINE_�t_RSA +( +ENGINE + * +e +, cڡ +RSA_METHOD + * +r�_m�h +); + +478 +ENGINE_�t_DSA +( +ENGINE + * +e +, cڡ +DSA_METHOD + * +d�_m�h +); + +479 +ENGINE_�t_ECDH +( +ENGINE + * +e +, cڡ +ECDH_METHOD + * +ecdh_m�h +); + +480 +ENGINE_�t_ECDSA +( +ENGINE + * +e +, cڡ +ECDSA_METHOD + * +ecd�_m�h +); + +481 +ENGINE_�t_DH +( +ENGINE + * +e +, cڡ +DH_METHOD + * +dh_m�h +); + +482 +ENGINE_�t_RAND +( +ENGINE + * +e +, cڡ +RAND_METHOD + * +�nd_m�h +); + +483 +ENGINE_�t_STORE +( +ENGINE + * +e +, cڡ +STORE_METHOD + * +��e_m�h +); + +484 +ENGINE_�t_de�roy_fun�i� +( +ENGINE + * +e +, +ENGINE_GEN_INT_FUNC_PTR + +de�roy_f +); + +485 +ENGINE_�t_��_fun�i� +( +ENGINE + * +e +, +ENGINE_GEN_INT_FUNC_PTR + +��_f +); + +486 +ENGINE_�t_f�ish_fun�i� +( +ENGINE + * +e +, +ENGINE_GEN_INT_FUNC_PTR + +f�ish_f +); + +487 +ENGINE_�t_��_fun�i� +( +ENGINE + * +e +, +ENGINE_CTRL_FUNC_PTR + +��_f +); + +488 +ENGINE_�t_l�d_�ivkey_fun�i� +( +ENGINE + * +e +, +ENGINE_LOAD_KEY_PTR + +l�d�iv_f +); + +489 +ENGINE_�t_l�d_pubkey_fun�i� +( +ENGINE + * +e +, +ENGINE_LOAD_KEY_PTR + +l�dpub_f +); + +490 +ENGINE_�t_l�d_s�_���_��_fun�i� +( +ENGINE + * +e +, + +491 +ENGINE_SSL_CLIENT_CERT_PTR + +l�ds�_f +); + +492 +ENGINE_�t_c�h�s +( +ENGINE + * +e +, +ENGINE_CIPHERS_PTR + +f +); + +493 +ENGINE_�t_dige�s +( +ENGINE + * +e +, +ENGINE_DIGESTS_PTR + +f +); + +494 +ENGINE_�t_pkey_m�hs +( +ENGINE + * +e +, +ENGINE_PKEY_METHS_PTR + +f +); + +495 +ENGINE_�t_pkey_a�1_m�hs +( +ENGINE + * +e +, +ENGINE_PKEY_ASN1_METHS_PTR + +f +); + +496 +ENGINE_�t_�ags +( +ENGINE + * +e +, +�ags +); + +497 +ENGINE_�t_cmd_de�s +( +ENGINE + * +e +, cڡ +ENGINE_CMD_DEFN + * +de�s +); + +499 +ENGINE_g�_ex_�w_�dex +( +�gl +, * +�gp +, +CRYPTO_EX_�w + * +�w_func +, + +500 +CRYPTO_EX_dup + * +dup_func +, +CRYPTO_EX_� + * +�_func +); + +501 +ENGINE_�t_ex_d�a +( +ENGINE + * +e +, +idx +, * +�g +); + +502 * +ENGINE_g�_ex_d�a +(cڡ +ENGINE + * +e +, +idx +); + +508 +ENGINE_��nup +(); + +514 cڡ * +ENGINE_g�_id +(cڡ +ENGINE + * +e +); + +515 cڡ * +ENGINE_g�_�me +(cڡ +ENGINE + * +e +); + +516 cڡ +RSA_METHOD + * +ENGINE_g�_RSA +(cڡ +ENGINE + * +e +); + +517 cڡ +DSA_METHOD + * +ENGINE_g�_DSA +(cڡ +ENGINE + * +e +); + +518 cڡ +ECDH_METHOD + * +ENGINE_g�_ECDH +(cڡ +ENGINE + * +e +); + +519 cڡ +ECDSA_METHOD + * +ENGINE_g�_ECDSA +(cڡ +ENGINE + * +e +); + +520 cڡ +DH_METHOD + * +ENGINE_g�_DH +(cڡ +ENGINE + * +e +); + +521 cڡ +RAND_METHOD + * +ENGINE_g�_RAND +(cڡ +ENGINE + * +e +); + +522 cڡ +STORE_METHOD + * +ENGINE_g�_STORE +(cڡ +ENGINE + * +e +); + +523 +ENGINE_GEN_INT_FUNC_PTR + +ENGINE_g�_de�roy_fun�i� +(cڡ +ENGINE + * +e +); + +524 +ENGINE_GEN_INT_FUNC_PTR + +ENGINE_g�_��_fun�i� +(cڡ +ENGINE + * +e +); + +525 +ENGINE_GEN_INT_FUNC_PTR + +ENGINE_g�_f�ish_fun�i� +(cڡ +ENGINE + * +e +); + +526 +ENGINE_CTRL_FUNC_PTR + +ENGINE_g�_��_fun�i� +(cڡ +ENGINE + * +e +); + +527 +ENGINE_LOAD_KEY_PTR + +ENGINE_g�_l�d_�ivkey_fun�i� +(cڡ +ENGINE + * +e +); + +528 +ENGINE_LOAD_KEY_PTR + +ENGINE_g�_l�d_pubkey_fun�i� +(cڡ +ENGINE + * +e +); + +529 +ENGINE_SSL_CLIENT_CERT_PTR + +ENGINE_g�_s�_���_��_fun�i� +(cڡ +ENGINE + * +e +); + +530 +ENGINE_CIPHERS_PTR + +ENGINE_g�_c�h�s +(cڡ +ENGINE + * +e +); + +531 +ENGINE_DIGESTS_PTR + +ENGINE_g�_dige�s +(cڡ +ENGINE + * +e +); + +532 +ENGINE_PKEY_METHS_PTR + +ENGINE_g�_pkey_m�hs +(cڡ +ENGINE + * +e +); + +533 +ENGINE_PKEY_ASN1_METHS_PTR + +ENGINE_g�_pkey_a�1_m�hs +(cڡ +ENGINE + * +e +); + +534 cڡ +EVP_CIPHER + * +ENGINE_g�_c�h� +( +ENGINE + * +e +, +nid +); + +535 cڡ +EVP_MD + * +ENGINE_g�_dige� +( +ENGINE + * +e +, +nid +); + +536 cڡ +EVP_PKEY_METHOD + * +ENGINE_g�_pkey_m�h +( +ENGINE + * +e +, +nid +); + +537 cڡ +EVP_PKEY_ASN1_METHOD + * +ENGINE_g�_pkey_a�1_m�h +( +ENGINE + * +e +, +nid +); + +538 cڡ +EVP_PKEY_ASN1_METHOD + * +ENGINE_g�_pkey_a�1_m�h_�r +( +ENGINE + * +e +, + +539 cڡ * +�r +, +�n +); + +540 cڡ +EVP_PKEY_ASN1_METHOD + * +ENGINE_pkey_a�1_f�d_�r +( +ENGINE + ** +� +, + +541 cڡ * +�r +, +�n +); + +542 cڡ +ENGINE_CMD_DEFN + * +ENGINE_g�_cmd_de�s +(cڡ +ENGINE + * +e +); + +543 +ENGINE_g�_�ags +(cڡ +ENGINE + * +e +); + +560 +ENGINE_�� +( +ENGINE + * +e +); + +564 +ENGINE_f�ish +( +ENGINE + * +e +); + +569 +EVP_PKEY + * +ENGINE_l�d_�iv�e_key +( +ENGINE + * +e +, cڡ * +key_id +, + +570 +UI_METHOD + * +ui_m�hod +, * +��back_d�a +); + +571 +EVP_PKEY + * +ENGINE_l�d_public_key +( +ENGINE + * +e +, cڡ * +key_id +, + +572 +UI_METHOD + * +ui_m�hod +, * +��back_d�a +); + +573 +ENGINE_l�d_s�_���_�� +( +ENGINE + * +e +, +SSL + * +s +, + +574 +STACK_OF +( +X509_NAME +�* +�_dn +, +X509 + ** +p�� +, +EVP_PKEY + ** +�key +, + +575 +STACK_OF +( +X509 +�** +p�h� +, + +576 +UI_METHOD + * +ui_m�hod +, * +��back_d�a +); + +582 +ENGINE + * +ENGINE_g�_de�u�_RSA +(); + +584 +ENGINE + * +ENGINE_g�_de�u�_DSA +(); + +585 +ENGINE + * +ENGINE_g�_de�u�_ECDH +(); + +586 +ENGINE + * +ENGINE_g�_de�u�_ECDSA +(); + +587 +ENGINE + * +ENGINE_g�_de�u�_DH +(); + +588 +ENGINE + * +ENGINE_g�_de�u�_RAND +(); + +591 +ENGINE + * +ENGINE_g�_c�h�_�g�e +( +nid +); + +592 +ENGINE + * +ENGINE_g�_dige�_�g�e +( +nid +); + +593 +ENGINE + * +ENGINE_g�_pkey_m�h_�g�e +( +nid +); + +594 +ENGINE + * +ENGINE_g�_pkey_a�1_m�h_�g�e +( +nid +); + +600 +ENGINE_�t_de�u�_RSA +( +ENGINE + * +e +); + +601 +ENGINE_�t_de�u�_�r�g +( +ENGINE + * +e +, cڡ * +def_li� +); + +603 +ENGINE_�t_de�u�_DSA +( +ENGINE + * +e +); + +604 +ENGINE_�t_de�u�_ECDH +( +ENGINE + * +e +); + +605 +ENGINE_�t_de�u�_ECDSA +( +ENGINE + * +e +); + +606 +ENGINE_�t_de�u�_DH +( +ENGINE + * +e +); + +607 +ENGINE_�t_de�u�_RAND +( +ENGINE + * +e +); + +608 +ENGINE_�t_de�u�_c�h�s +( +ENGINE + * +e +); + +609 +ENGINE_�t_de�u�_dige�s +( +ENGINE + * +e +); + +610 +ENGINE_�t_de�u�_pkey_m�hs +( +ENGINE + * +e +); + +611 +ENGINE_�t_de�u�_pkey_a�1_m�hs +( +ENGINE + * +e +); + +618 +ENGINE_�t_de�u� +( +ENGINE + * +e +, +�ags +); + +620 +ENGINE_add_c�f_modu� +(); + +630 + #OSSL_DYNAMIC_VERSION + ()0x00020000 + + ) + +633 + #OSSL_DYNAMIC_OLDEST + ()0x00020000 + + ) + +644 *(* + tdyn_MEM_m�loc_cb +)( + tsize_t +); + +645 *(* + tdyn_MEM_��loc_cb +)(*, + tsize_t +); + +646 (* +dyn_MEM_�_cb +)(*); + +647 + s�_dy�mic_MEM_�s + { + +648 +dyn_MEM_m�loc_cb + +m�loc_cb +; + +649 +dyn_MEM_��loc_cb + +��loc_cb +; + +650 +dyn_MEM_�_cb + +�_cb +; + +651 } + tdy�mic_MEM_�s +; + +654 (* +dyn_lock_lock�g_cb +)(,,const *,); + +655 (* +dyn_lock_add_lock_cb +)(*,,,const *,); + +656 +CRYPTO_dy�ock_v�ue + *(* + tdyn_dy�ock_���_cb +)( + +658 (* +dyn_dy�ock_lock_cb +)(, + tCRYPTO_dy�ock_v�ue + *, + +660 (* +dyn_dy�ock_de�roy_cb +)( + tCRYPTO_dy�ock_v�ue + *, + +662 + s�_dy�mic_LOCK_�s + { + +663 +dyn_lock_lock�g_cb + +lock_lock�g_cb +; + +664 +dyn_lock_add_lock_cb + +lock_add_lock_cb +; + +665 +dyn_dy�ock_���_cb + +dy�ock_���_cb +; + +666 +dyn_dy�ock_lock_cb + +dy�ock_lock_cb +; + +667 +dyn_dy�ock_de�roy_cb + +dy�ock_de�roy_cb +; + +668 } + tdy�mic_LOCK_�s +; + +670 + s�_dy�mic_�s + { + +671 * +��ic_��e +; + +672 cڡ +ERR_FNS + * +�r_�s +; + +673 cڡ +CRYPTO_EX_DATA_IMPL + * +ex_d�a_�s +; + +674 +dy�mic_MEM_�s + +mem_�s +; + +675 +dy�mic_LOCK_�s + +lock_�s +; + +676 } + tdy�mic_�s +; + +687 (* + tdy�mic_v_check_� +)( + tos�_v�si� +); + +688 + #IMPLEMENT_DYNAMIC_CHECK_FN +() \ + +689 +OPENSSL_EXPORT + + `v_check +( +v +); \ + +690 +OPENSSL_EXPORT + + `v_check +( +v +) { \ + +691 if( +v + >� +OSSL_DYNAMIC_OLDEST +� +OSSL_DYNAMIC_VERSION +; \ + +692 0; } + + ) + +709 (* +dy�mic_b�d_�g�e +)( + tENGINE + * + te +, cڡ * + tid +, + +710 cڡ + tdy�mic_�s + * + t�s +); + +711 + #IMPLEMENT_DYNAMIC_BIND_FN +( +� +) \ + +712 +OPENSSL_EXPORT + \ + +713 + `b�d_�g�e +( +ENGINE + * +e +, cڡ * +id +, cڡ +dy�mic_�s + * +�s +); \ + +714 +OPENSSL_EXPORT + \ + +715 + `b�d_�g�e +( +ENGINE + * +e +, cڡ * +id +, cڡ +dy�mic_�s + * +�s +) { \ + +716 if( + `ENGINE_g�_��ic_��e +(�=� +�s +-> +��ic_��e +� +sk�_cbs +; \ + +717 if(! + `CRYPTO_�t_mem_fun�i�s +( +�s +-> +mem_�s +. +m�loc_cb +, \ + +718 +�s +-> +mem_�s +. +��loc_cb +, fns->mem_�s. +�_cb +)) \ + +720 + `CRYPTO_�t_lock�g_��back +( +�s +-> +lock_�s +. +lock_lock�g_cb +); \ + +721 + `CRYPTO_�t_add_lock_��back +( +�s +-> +lock_�s +. +lock_add_lock_cb +); \ + +722 + `CRYPTO_�t_dy�ock_���_��back +( +�s +-> +lock_�s +. +dy�ock_���_cb +); \ + +723 + `CRYPTO_�t_dy�ock_lock_��back +( +�s +-> +lock_�s +. +dy�ock_lock_cb +); \ + +724 + `CRYPTO_�t_dy�ock_de�roy_��back +( +�s +-> +lock_�s +. +dy�ock_de�roy_cb +); \ + +725 if(! + `CRYPTO_�t_ex_d�a_im�em��ti� +( +�s +-> +ex_d�a_�s +)) \ + +727 if(! + `ERR_�t_im�em��ti� +( +�s +-> +�r_�s +)) 0; \ + +728 +sk�_cbs +: \ + +729 if(! + `� +( +e +, +id +)) 0; \ + +730 1; } + + ) + +741 * +ENGINE_g�_��ic_��e +(); + +743 #i� +def�ed +( +__O�nBSD__ +�|| def�ed( +__F�eBSD__ +�|| def�ed( +HAVE_CRYPTODEV +) + +744 +ENGINE_�tup_bsd_�y�odev +(); + +751 +ERR_l�d_ENGINE_�r�gs +(); + +756 + #ENGINE_F_DYNAMIC_CTRL + 180 + + ) + +757 + #ENGINE_F_DYNAMIC_GET_DATA_CTX + 181 + + ) + +758 + #ENGINE_F_DYNAMIC_LOAD + 182 + + ) + +759 + #ENGINE_F_DYNAMIC_SET_DATA_CTX + 183 + + ) + +760 + #ENGINE_F_ENGINE_ADD + 105 + + ) + +761 + #ENGINE_F_ENGINE_BY_ID + 106 + + ) + +762 + #ENGINE_F_ENGINE_CMD_IS_EXECUTABLE + 170 + + ) + +763 + #ENGINE_F_ENGINE_CTRL + 142 + + ) + +764 + #ENGINE_F_ENGINE_CTRL_CMD + 178 + + ) + +765 + #ENGINE_F_ENGINE_CTRL_CMD_STRING + 171 + + ) + +766 + #ENGINE_F_ENGINE_FINISH + 107 + + ) + +767 + #ENGINE_F_ENGINE_FREE_UTIL + 108 + + ) + +768 + #ENGINE_F_ENGINE_GET_CIPHER + 185 + + ) + +769 + #ENGINE_F_ENGINE_GET_DEFAULT_TYPE + 177 + + ) + +770 + #ENGINE_F_ENGINE_GET_DIGEST + 186 + + ) + +771 + #ENGINE_F_ENGINE_GET_NEXT + 115 + + ) + +772 + #ENGINE_F_ENGINE_GET_PKEY_ASN1_METH + 193 + + ) + +773 + #ENGINE_F_ENGINE_GET_PKEY_METH + 192 + + ) + +774 + #ENGINE_F_ENGINE_GET_PREV + 116 + + ) + +775 + #ENGINE_F_ENGINE_INIT + 119 + + ) + +776 + #ENGINE_F_ENGINE_LIST_ADD + 120 + + ) + +777 + #ENGINE_F_ENGINE_LIST_REMOVE + 121 + + ) + +778 + #ENGINE_F_ENGINE_LOAD_PRIVATE_KEY + 150 + + ) + +779 + #ENGINE_F_ENGINE_LOAD_PUBLIC_KEY + 151 + + ) + +780 + #ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT + 194 + + ) + +781 + #ENGINE_F_ENGINE_NEW + 122 + + ) + +782 + #ENGINE_F_ENGINE_REMOVE + 123 + + ) + +783 + #ENGINE_F_ENGINE_SET_DEFAULT_STRING + 189 + + ) + +784 + #ENGINE_F_ENGINE_SET_DEFAULT_TYPE + 126 + + ) + +785 + #ENGINE_F_ENGINE_SET_ID + 129 + + ) + +786 + #ENGINE_F_ENGINE_SET_NAME + 130 + + ) + +787 + #ENGINE_F_ENGINE_TABLE_REGISTER + 184 + + ) + +788 + #ENGINE_F_ENGINE_UNLOAD_KEY + 152 + + ) + +789 + #ENGINE_F_ENGINE_UNLOCKED_FINISH + 191 + + ) + +790 + #ENGINE_F_ENGINE_UP_REF + 190 + + ) + +791 + #ENGINE_F_INT_CTRL_HELPER + 172 + + ) + +792 + #ENGINE_F_INT_ENGINE_CONFIGURE + 188 + + ) + +793 + #ENGINE_F_INT_ENGINE_MODULE_INIT + 187 + + ) + +794 + #ENGINE_F_LOG_MESSAGE + 141 + + ) + +797 + #ENGINE_R_ALREADY_LOADED + 100 + + ) + +798 + #ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER + 133 + + ) + +799 + #ENGINE_R_CMD_NOT_EXECUTABLE + 134 + + ) + +800 + #ENGINE_R_COMMAND_TAKES_INPUT + 135 + + ) + +801 + #ENGINE_R_COMMAND_TAKES_NO_INPUT + 136 + + ) + +802 + #ENGINE_R_CONFLICTING_ENGINE_ID + 103 + + ) + +803 + #ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED + 119 + + ) + +804 + #ENGINE_R_DH_NOT_IMPLEMENTED + 139 + + ) + +805 + #ENGINE_R_DSA_NOT_IMPLEMENTED + 140 + + ) + +806 + #ENGINE_R_DSO_FAILURE + 104 + + ) + +807 + #ENGINE_R_DSO_NOT_FOUND + 132 + + ) + +808 + #ENGINE_R_ENGINES_SECTION_ERROR + 148 + + ) + +809 + #ENGINE_R_ENGINE_CONFIGURATION_ERROR + 102 + + ) + +810 + #ENGINE_R_ENGINE_IS_NOT_IN_LIST + 105 + + ) + +811 + #ENGINE_R_ENGINE_SECTION_ERROR + 149 + + ) + +812 + #ENGINE_R_FAILED_LOADING_PRIVATE_KEY + 128 + + ) + +813 + #ENGINE_R_FAILED_LOADING_PUBLIC_KEY + 129 + + ) + +814 + #ENGINE_R_FINISH_FAILED + 106 + + ) + +815 + #ENGINE_R_GET_HANDLE_FAILED + 107 + + ) + +816 + #ENGINE_R_ID_OR_NAME_MISSING + 108 + + ) + +817 + #ENGINE_R_INIT_FAILED + 109 + + ) + +818 + #ENGINE_R_INTERNAL_LIST_ERROR + 110 + + ) + +819 + #ENGINE_R_INVALID_ARGUMENT + 143 + + ) + +820 + #ENGINE_R_INVALID_CMD_NAME + 137 + + ) + +821 + #ENGINE_R_INVALID_CMD_NUMBER + 138 + + ) + +822 + #ENGINE_R_INVALID_INIT_VALUE + 151 + + ) + +823 + #ENGINE_R_INVALID_STRING + 150 + + ) + +824 + #ENGINE_R_NOT_INITIALISED + 117 + + ) + +825 + #ENGINE_R_NOT_LOADED + 112 + + ) + +826 + #ENGINE_R_NO_CONTROL_FUNCTION + 120 + + ) + +827 + #ENGINE_R_NO_INDEX + 144 + + ) + +828 + #ENGINE_R_NO_LOAD_FUNCTION + 125 + + ) + +829 + #ENGINE_R_NO_REFERENCE + 130 + + ) + +830 + #ENGINE_R_NO_SUCH_ENGINE + 116 + + ) + +831 + #ENGINE_R_NO_UNLOAD_FUNCTION + 126 + + ) + +832 + #ENGINE_R_PROVIDE_PARAMETERS + 113 + + ) + +833 + #ENGINE_R_RSA_NOT_IMPLEMENTED + 141 + + ) + +834 + #ENGINE_R_UNIMPLEMENTED_CIPHER + 146 + + ) + +835 + #ENGINE_R_UNIMPLEMENTED_DIGEST + 147 + + ) + +836 + #ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD + 101 + + ) + +837 + #ENGINE_R_VERSION_INCOMPATIBILITY + 145 + + ) + +839 #ifde� +__�lu�lus + + + @/usr/include/openssl/err.h + +112 #i�de� +HEADER_ERR_H + + +113 + #HEADER_ERR_H + + + ) + +115 + ~<ݒs�/e_os2.h +> + +117 #i�de� +OPENSSL_NO_FP_API + + +118 + ~<�dio.h +> + +119 + ~<�dlib.h +> + +122 + ~<ݒs�/os�_typ.h +> + +123 #i�de� +OPENSSL_NO_BIO + + +124 + ~<ݒs�/bio.h +> + +126 #i�de� +OPENSSL_NO_LHASH + + +127 + ~<ݒs�/lhash.h +> + +130 #ifdef +__�lu�lus + + +134 #i�de� +OPENSSL_NO_ERR + + +135 + #ERR_PUT_�r� +( +a +, +b +, +c +, +d +, +e +� + `ERR_put_�r� +�,b,c,d,e) + + ) + +137 + #ERR_PUT_�r� +( +a +, +b +, +c +, +d +, +e +� + `ERR_put_�r� +�,b,c, +NULL +,0) + + ) + +140 + ~<��o.h +> + +142 + #ERR_TXT_MALLOCED + 0x01 + + ) + +143 + #ERR_TXT_STRING + 0x02 + + ) + +145 + #ERR_FLAG_MARK + 0x01 + + ) + +147 + #ERR_NUM_ERRORS + 16 + + ) + +148 + s�r_��e_� + + +150 +CRYPTO_THREADID + +tid +; + +151 +�r_�ags +[ +ERR_NUM_ERRORS +]; + +152 +�r_buf�r +[ +ERR_NUM_ERRORS +]; + +153 * +�r_d�a +[ +ERR_NUM_ERRORS +]; + +154 +�r_d�a_�ags +[ +ERR_NUM_ERRORS +]; + +155 cڡ * +�r_f�e +[ +ERR_NUM_ERRORS +]; + +156 +�r_l�e +[ +ERR_NUM_ERRORS +]; + +157 +t� +, +b�tom +; + +158 } + tERR_STATE +; + +161 + #ERR_LIB_NONE + 1 + + ) + +162 + #ERR_LIB_SYS + 2 + + ) + +163 + #ERR_LIB_BN + 3 + + ) + +164 + #ERR_LIB_RSA + 4 + + ) + +165 + #ERR_LIB_DH + 5 + + ) + +166 + #ERR_LIB_EVP + 6 + + ) + +167 + #ERR_LIB_BUF + 7 + + ) + +168 + #ERR_LIB_OBJ + 8 + + ) + +169 + #ERR_LIB_PEM + 9 + + ) + +170 + #ERR_LIB_DSA + 10 + + ) + +171 + #ERR_LIB_X509 + 11 + + ) + +173 + #ERR_LIB_ASN1 + 13 + + ) + +174 + #ERR_LIB_CONF + 14 + + ) + +175 + #ERR_LIB_CRYPTO + 15 + + ) + +176 + #ERR_LIB_EC + 16 + + ) + +177 + #ERR_LIB_SSL + 20 + + ) + +183 + #ERR_LIB_BIO + 32 + + ) + +184 + #ERR_LIB_PKCS7 + 33 + + ) + +185 + #ERR_LIB_X509V3 + 34 + + ) + +186 + #ERR_LIB_PKCS12 + 35 + + ) + +187 + #ERR_LIB_RAND + 36 + + ) + +188 + #ERR_LIB_DSO + 37 + + ) + +189 + #ERR_LIB_ENGINE + 38 + + ) + +190 + #ERR_LIB_OCSP + 39 + + ) + +191 + #ERR_LIB_UI + 40 + + ) + +192 + #ERR_LIB_COMP + 41 + + ) + +193 + #ERR_LIB_ECDSA + 42 + + ) + +194 + #ERR_LIB_ECDH + 43 + + ) + +195 + #ERR_LIB_STORE + 44 + + ) + +196 + #ERR_LIB_FIPS + 45 + + ) + +197 + #ERR_LIB_CMS + 46 + + ) + +198 + #ERR_LIB_TS + 47 + + ) + +199 + #ERR_LIB_HMAC + 48 + + ) + +200 + #ERR_LIB_JPAKE + 49 + + ) + +202 + #ERR_LIB_USER + 128 + + ) + +204 + #SYS�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_SYS +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +205 + #BN�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_BN +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +206 + #RSA�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_RSA +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +207 + #DH�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_DH +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +208 + #EVP�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_EVP +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +209 + #BUF�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_BUF +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +210 + #OBJ�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_OBJ +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +211 + #PEM�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_PEM +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +212 + #DSA�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_DSA +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +213 + #X509�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_X509 +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +214 + #ASN1�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_ASN1 +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +215 + #CONF�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_CONF +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +216 + #CRYPTO�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_CRYPTO +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +217 + #EC�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_EC +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +218 + #SSL�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_SSL +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +219 + #BIO�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_BIO +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +220 + #PKCS7�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_PKCS7 +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +221 + #X509V3�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_X509V3 +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +222 + #PKCS12�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_PKCS12 +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +223 + #RAND�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_RAND +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +224 + #DSO�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_DSO +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +225 + #ENGINE�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_ENGINE +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +226 + #OCSP�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_OCSP +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +227 + #UI�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_UI +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +228 + #COMP�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_COMP +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +229 + #ECDSA�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_ECDSA +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +230 + #ECDH�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_ECDH +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +231 + #STORE�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_STORE +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +232 + #FIPS�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_FIPS +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +233 + #CMS�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_CMS +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +234 + #TS�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_TS +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +235 + #HMAC�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_HMAC +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +236 + #JPAKE�r +( +f +, +r +� + `ERR_PUT_�r� +( +ERR_LIB_JPAKE +,(f),�), +__FILE__ +, +__LINE__ +) + + ) + +240 + #ERR_PACK +( +l +, +f +, +r +) ((((()l)&0xffL)*0x1000000)| \ + +241 (((() +f +)&0xfffL)*0x1000)| \ + +242 (((() +r +)&0xfffL))) + + ) + +243 + #ERR_GET_LIB +( +l +�()((((�)>>24L)&0xffL) + + ) + +244 + #ERR_GET_FUNC +( +l +�()((((�)>>12L)&0xfffL) + + ) + +245 + #ERR_GET_REASON +( +l +�()(�)&0xfffL) + + ) + +246 + #ERR_FATAL_ERROR +( +l +�()(�)& +ERR_R_FATAL +) + + ) + +250 + #SYS_F_FOPEN + 1 + + ) + +251 + #SYS_F_CONNECT + 2 + + ) + +252 + #SYS_F_GETSERVBYNAME + 3 + + ) + +253 + #SYS_F_SOCKET + 4 + + ) + +254 + #SYS_F_IOCTLSOCKET + 5 + + ) + +255 + #SYS_F_BIND + 6 + + ) + +256 + #SYS_F_LISTEN + 7 + + ) + +257 + #SYS_F_ACCEPT + 8 + + ) + +258 + #SYS_F_WSASTARTUP + 9 + + ) + +259 + #SYS_F_OPENDIR + 10 + + ) + +260 + #SYS_F_FREAD + 11 + + ) + +264 + #ERR_R_SYS_LIB + +ERR_LIB_SYS + + + ) + +265 + #ERR_R_BN_LIB + +ERR_LIB_BN + + + ) + +266 + #ERR_R_RSA_LIB + +ERR_LIB_RSA + + + ) + +267 + #ERR_R_DH_LIB + +ERR_LIB_DH + + + ) + +268 + #ERR_R_EVP_LIB + +ERR_LIB_EVP + + + ) + +269 + #ERR_R_BUF_LIB + +ERR_LIB_BUF + + + ) + +270 + #ERR_R_OBJ_LIB + +ERR_LIB_OBJ + + + ) + +271 + #ERR_R_PEM_LIB + +ERR_LIB_PEM + + + ) + +272 + #ERR_R_DSA_LIB + +ERR_LIB_DSA + + + ) + +273 + #ERR_R_X509_LIB + +ERR_LIB_X509 + + + ) + +274 + #ERR_R_ASN1_LIB + +ERR_LIB_ASN1 + + + ) + +275 + #ERR_R_CONF_LIB + +ERR_LIB_CONF + + + ) + +276 + #ERR_R_CRYPTO_LIB + +ERR_LIB_CRYPTO + + + ) + +277 + #ERR_R_EC_LIB + +ERR_LIB_EC + + + ) + +278 + #ERR_R_SSL_LIB + +ERR_LIB_SSL + + + ) + +279 + #ERR_R_BIO_LIB + +ERR_LIB_BIO + + + ) + +280 + #ERR_R_PKCS7_LIB + +ERR_LIB_PKCS7 + + + ) + +281 + #ERR_R_X509V3_LIB + +ERR_LIB_X509V3 + + + ) + +282 + #ERR_R_PKCS12_LIB + +ERR_LIB_PKCS12 + + + ) + +283 + #ERR_R_RAND_LIB + +ERR_LIB_RAND + + + ) + +284 + #ERR_R_DSO_LIB + +ERR_LIB_DSO + + + ) + +285 + #ERR_R_ENGINE_LIB + +ERR_LIB_ENGINE + + + ) + +286 + #ERR_R_OCSP_LIB + +ERR_LIB_OCSP + + + ) + +287 + #ERR_R_UI_LIB + +ERR_LIB_UI + + + ) + +288 + #ERR_R_COMP_LIB + +ERR_LIB_COMP + + + ) + +289 + #ERR_R_ECDSA_LIB + +ERR_LIB_ECDSA + + + ) + +290 + #ERR_R_ECDH_LIB + +ERR_LIB_ECDH + + + ) + +291 + #ERR_R_STORE_LIB + +ERR_LIB_STORE + + + ) + +292 + #ERR_R_TS_LIB + +ERR_LIB_TS + + + ) + +294 + #ERR_R_NESTED_ASN1_ERROR + 58 + + ) + +295 + #ERR_R_BAD_ASN1_OBJECT_HEADER + 59 + + ) + +296 + #ERR_R_BAD_GET_ASN1_OBJECT_CALL + 60 + + ) + +297 + #ERR_R_EXPECTING_AN_ASN1_SEQUENCE + 61 + + ) + +298 + #ERR_R_ASN1_LENGTH_MISMATCH + 62 + + ) + +299 + #ERR_R_MISSING_ASN1_EOS + 63 + + ) + +302 + #ERR_R_FATAL + 64 + + ) + +303 + #ERR_R_MALLOC_FAILURE + (1| +ERR_R_FATAL +) + + ) + +304 + #ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED + (2| +ERR_R_FATAL +) + + ) + +305 + #ERR_R_PASSED_NULL_PARAMETER + (3| +ERR_R_FATAL +) + + ) + +306 + #ERR_R_INTERNAL_ERROR + (4| +ERR_R_FATAL +) + + ) + +307 + #ERR_R_DISABLED + (5| +ERR_R_FATAL +) + + ) + +313 + sERR_�r�g_d�a_� + + +315 +�r� +; + +316 cڡ * +�r�g +; + +317 } + tERR_STRING_DATA +; + +319 +ERR_put_�r� +( +lib +, +func +, +�as� +,cڡ * +f�e +, +l�e +); + +320 +ERR_�t_�r�_d�a +(* +d�a +, +�ags +); + +322 +ERR_g�_�r� +(); + +323 +ERR_g�_�r�_l�e +(cڡ ** +f�e +,* +l�e +); + +324 +ERR_g�_�r�_l�e_d�a +(cڡ ** +f�e +,* +l�e +, + +325 cڡ ** +d�a +, * +�ags +); + +326 +ERR_�ek_�r� +(); + +327 +ERR_�ek_�r�_l�e +(cڡ ** +f�e +,* +l�e +); + +328 +ERR_�ek_�r�_l�e_d�a +(cڡ ** +f�e +,* +l�e +, + +329 cڡ ** +d�a +,* +�ags +); + +330 +ERR_�ek_ϡ_�r� +(); + +331 +ERR_�ek_ϡ_�r�_l�e +(cڡ ** +f�e +,* +l�e +); + +332 +ERR_�ek_ϡ_�r�_l�e_d�a +(cڡ ** +f�e +,* +l�e +, + +333 cڡ ** +d�a +,* +�ags +); + +334 +ERR_��r_�r� +(); + +335 * +ERR_�r�_�r�g +( +e +,* +buf +); + +336 +ERR_�r�_�r�g_n +( +e +, * +buf +, +size_t + +�n +); + +337 cڡ * +ERR_lib_�r�_�r�g +( +e +); + +338 cڡ * +ERR_func_�r�_�r�g +( +e +); + +339 cڡ * +ERR_�as�_�r�_�r�g +( +e +); + +340 +ERR_��t_�r�s_cb +((* +cb +)(cڡ * +�r +, +size_t + +�n +, * +u +), + +341 * +u +); + +342 #i�de� +OPENSSL_NO_FP_API + + +343 +ERR_��t_�r�s_� +( +FILE + * +� +); + +345 #i�de� +OPENSSL_NO_BIO + + +346 +ERR_��t_�r�s +( +BIO + * +bp +); + +348 +ERR_add_�r�_d�a +( +num +, ...); + +349 +ERR_add_�r�_vd�a +( +num +, +va_li� + +�gs +); + +350 +ERR_l�d_�r�gs +( +lib +, +ERR_STRING_DATA + +�r +[]); + +351 +ERR_u��d_�r�gs +( +lib +, +ERR_STRING_DATA + +�r +[]); + +352 +ERR_l�d_ERR_�r�gs +(); + +353 +ERR_l�d_�y�o_�r�gs +(); + +354 +ERR_�_�r�gs +(); + +356 +ERR_�move_th�ad_��e +(cڡ +CRYPTO_THREADID + * +tid +); + +357 #i�de� +OPENSSL_NO_DEPRECATED + + +358 +ERR_�move_��e +( +pid +); + +360 +ERR_STATE + * +ERR_g�_��e +(); + +362 #i�de� +OPENSSL_NO_LHASH + + +363 +LHASH_OF +( +ERR_STRING_DATA +�* +ERR_g�_�r�g_�b� +(); + +364 +LHASH_OF +( +ERR_STATE +�* +ERR_g�_�r_��e_�b� +(); + +365 +ERR_��a�_�r_��e_�b� +( +LHASH_OF +( +ERR_STATE +�** +hash +); + +368 +ERR_g�_�xt_�r�_lib�ry +(); + +370 +ERR_�t_m�k +(); + +371 +ERR_p�_to_m�k +(); + +377 cڡ +ERR_FNS + * +ERR_g�_im�em��ti� +(); + +380 +ERR_�t_im�em��ti� +(cڡ +ERR_FNS + * +�s +); + +382 #ifdef +__�lu�lus + + + @/usr/include/openssl/evp.h + +59 #i�de� +HEADER_ENVELOPE_H + + +60 + #HEADER_ENVELOPE_H + + + ) + +62 #ifde� +OPENSSL_ALGORITHM_DEFINES + + +63 + ~<ݒs�/ݒs�c�f.h +> + +65 + #OPENSSL_ALGORITHM_DEFINES + + + ) + +66 + ~<ݒs�/ݒs�c�f.h +> + +67 #unde� +OPENSSL_ALGORITHM_DEFINES + + +70 + ~<ݒs�/os�_typ.h +> + +72 + ~<ݒs�/symhacks.h +> + +74 #i�de� +OPENSSL_NO_BIO + + +75 + ~<ݒs�/bio.h +> + +85 + #EVP_MAX_MD_SIZE + 64 + + ) + +86 + #EVP_MAX_KEY_LENGTH + 64 + + ) + +87 + #EVP_MAX_IV_LENGTH + 16 + + ) + +88 + #EVP_MAX_BLOCK_LENGTH + 32 + + ) + +90 + #PKCS5_SALT_LEN + 8 + + ) + +92 + #PKCS5_DEFAULT_ITER + 2048 + + ) + +94 + ~<ݒs�/obje�s.h +> + +96 + #EVP_PK_RSA + 0x0001 + + ) + +97 + #EVP_PK_DSA + 0x0002 + + ) + +98 + #EVP_PK_DH + 0x0004 + + ) + +99 + #EVP_PK_EC + 0x0008 + + ) + +100 + #EVP_PKT_SIGN + 0x0010 + + ) + +101 + #EVP_PKT_ENC + 0x0020 + + ) + +102 + #EVP_PKT_EXCH + 0x0040 + + ) + +103 + #EVP_PKS_RSA + 0x0100 + + ) + +104 + #EVP_PKS_DSA + 0x0200 + + ) + +105 + #EVP_PKS_EC + 0x0400 + + ) + +106 + #EVP_PKT_EXP + 0x1000 + + ) + +108 + #EVP_PKEY_NONE + +NID_undef + + + ) + +109 + #EVP_PKEY_RSA + +NID_r�En�y�i� + + + ) + +110 + #EVP_PKEY_RSA2 + +NID_r� + + + ) + +111 + #EVP_PKEY_DSA + +NID_d� + + + ) + +112 + #EVP_PKEY_DSA1 + +NID_d�_2 + + + ) + +113 + #EVP_PKEY_DSA2 + +NID_d�W�hSHA + + + ) + +114 + #EVP_PKEY_DSA3 + +NID_d�W�hSHA1 + + + ) + +115 + #EVP_PKEY_DSA4 + +NID_d�W�hSHA1_2 + + + ) + +116 + #EVP_PKEY_DH + +NID_dhKeyAg�em�t + + + ) + +117 + #EVP_PKEY_EC + +NID_X9_62_id_ecPublicKey + + + ) + +118 + #EVP_PKEY_HMAC + +NID_hmac + + + ) + +119 + #EVP_PKEY_CMAC + +NID_cmac + + + ) + +121 #ifdef +__�lu�lus + + +128 + sevp_pkey_� + + +130 +ty� +; + +131 +�ve_ty� +; + +132 +��n�s +; + +133 cڡ +EVP_PKEY_ASN1_METHOD + * +am�h +; + +134 +ENGINE + * +�g�e +; + +136 * +�r +; + +137 #i�de� +OPENSSL_NO_RSA + + +138 +r�_� + * +r� +; + +140 #i�de� +OPENSSL_NO_DSA + + +141 +d�_� + * +d� +; + +143 #i�de� +OPENSSL_NO_DH + + +144 +dh_� + * +dh +; + +146 #i�de� +OPENSSL_NO_EC + + +147 +ec_key_� + * +ec +; + +149 } +pkey +; + +150 +�ve_��m��s +; + +151 +STACK_OF +( +X509_ATTRIBUTE +�* +��ibu�s +; + +154 + #EVP_PKEY_MO_SIGN + 0x0001 + + ) + +155 + #EVP_PKEY_MO_VERIFY + 0x0002 + + ) + +156 + #EVP_PKEY_MO_ENCRYPT + 0x0004 + + ) + +157 + #EVP_PKEY_MO_DECRYPT + 0x0008 + + ) + +159 #i�de� +EVP_MD + + +160 + s�v_md_� + + +162 +ty� +; + +163 +pkey_ty� +; + +164 +md_size +; + +165 +�ags +; + +166 (* +�� +)( +EVP_MD_CTX + * +�x +); + +167 (* +upd�e +)( +EVP_MD_CTX + * +�x +,cڡ * +d�a +, +size_t + +cou� +); + +168 (* +f�� +)( +EVP_MD_CTX + * +�x +,* +md +); + +169 (* +c�y +)( +EVP_MD_CTX + * +to +,cڡ EVP_MD_CTX * +�om +); + +170 (* +��nup +)( +EVP_MD_CTX + * +�x +); + +173 (* +sign +)( +ty� +, cڡ * +m +, +m_�ngth +, + +174 * +sig�t +, * +sig�n +, * +key +); + +175 (* +v�ify +)( +ty� +, cڡ * +m +, +m_�ngth +, + +176 cڡ * +sigbuf +, +sig�n +, + +177 * +key +); + +178 +�qu�ed_pkey_ty� +[5]; + +179 +block_size +; + +180 +�x_size +; + +182 (* +md_�� +)( +EVP_MD_CTX + * +�x +, +cmd +, +p1 +, * +p2 +); + +185 + tevp_sign_m�hod +( + tty� +,cڡ * + tm +, + +186 + tm_�ngth +,* + tsig�t +, + +187 * + tsig�n +, * + tkey +); + +188 + tevp_v�ify_m�hod +( + tty� +,cڡ * + tm +, + +189 + tm_�ngth +,cڡ * + tsigbuf +, + +190 + tsig�n +, * + tkey +); + +192 + #EVP_MD_FLAG_ONESHOT + 0x0001 + + ) + +195 + #EVP_MD_FLAG_PKEY_DIGEST + 0x0002 + + ) + +202 + #EVP_MD_FLAG_PKEY_METHOD_SIGNATURE + 0x0004 + + ) + +206 + #EVP_MD_FLAG_DIGALGID_MASK + 0x0018 + + ) + +210 + #EVP_MD_FLAG_DIGALGID_NULL + 0x0000 + + ) + +214 + #EVP_MD_FLAG_DIGALGID_ABSENT + 0x0008 + + ) + +218 + #EVP_MD_FLAG_DIGALGID_CUSTOM + 0x0018 + + ) + +220 + #EVP_MD_FLAG_FIPS + 0x0400 + + ) + +224 + #EVP_MD_CTRL_DIGALGID + 0x1 + + ) + +225 + #EVP_MD_CTRL_MICALG + 0x2 + + ) + +229 + #EVP_MD_CTRL_ALG_CTRL + 0x1000 + + ) + +231 + #EVP_PKEY_NULL_m�hod + +NULL +,NULL,{0,0,0,0} + + ) + +233 #i�de� +OPENSSL_NO_DSA + + +234 + #EVP_PKEY_DSA_m�hod + ( +evp_sign_m�hod + *) +DSA_sign +, \ + +235 ( +evp_v�ify_m�hod + *) +DSA_v�ify +, \ + +236 { +EVP_PKEY_DSA +, +EVP_PKEY_DSA2 +, +EVP_PKEY_DSA3 +, \ + +237 +EVP_PKEY_DSA4 +,0} + + ) + +239 + #EVP_PKEY_DSA_m�hod + +EVP_PKEY_NULL_m�hod + + + ) + +242 #i�de� +OPENSSL_NO_ECDSA + + +243 + #EVP_PKEY_ECDSA_m�hod + ( +evp_sign_m�hod + *) +ECDSA_sign +, \ + +244 ( +evp_v�ify_m�hod + *) +ECDSA_v�ify +, \ + +245 { +EVP_PKEY_EC +,0,0,0} + + ) + +247 + #EVP_PKEY_ECDSA_m�hod + +EVP_PKEY_NULL_m�hod + + + ) + +250 #i�de� +OPENSSL_NO_RSA + + +251 + #EVP_PKEY_RSA_m�hod + ( +evp_sign_m�hod + *) +RSA_sign +, \ + +252 ( +evp_v�ify_m�hod + *) +RSA_v�ify +, \ + +253 { +EVP_PKEY_RSA +, +EVP_PKEY_RSA2 +,0,0} + + ) + +254 + #EVP_PKEY_RSA_ASN1_OCTET_STRING_m�hod + \ + +255 ( +evp_sign_m�hod + *) +RSA_sign_ASN1_OCTET_STRING +, \ + +256 ( +evp_v�ify_m�hod + *) +RSA_v�ify_ASN1_OCTET_STRING +, \ + +257 { +EVP_PKEY_RSA +, +EVP_PKEY_RSA2 +,0,0} + + ) + +259 + #EVP_PKEY_RSA_m�hod + +EVP_PKEY_NULL_m�hod + + + ) + +260 + #EVP_PKEY_RSA_ASN1_OCTET_STRING_m�hod + +EVP_PKEY_NULL_m�hod + + + ) + +265 + s�v_md_�x_� + + +267 cڡ +EVP_MD + * +dige� +; + +268 +ENGINE + * +�g�e +; + +269 +�ags +; + +270 * +md_d�a +; + +272 +EVP_PKEY_CTX + * +p�x +; + +274 (* +upd�e +)( +EVP_MD_CTX + * +�x +,cڡ * +d�a +, +size_t + +cou� +); + +279 + #EVP_MD_CTX_FLAG_ONESHOT + 0x0001 + + ) + +281 + #EVP_MD_CTX_FLAG_CLEANED + 0x0002 + + ) + +283 + #EVP_MD_CTX_FLAG_REUSE + 0x0004 + + ) + +289 + #EVP_MD_CTX_FLAG_NON_FIPS_ALLOW + 0x0008 + + ) + +296 + #EVP_MD_CTX_FLAG_PAD_MASK + 0xF0 + + ) + +297 + #EVP_MD_CTX_FLAG_PAD_PKCS1 + 0x00 + + ) + +298 + #EVP_MD_CTX_FLAG_PAD_X931 + 0x10 + + ) + +299 + #EVP_MD_CTX_FLAG_PAD_PSS + 0x20 + + ) + +301 + #EVP_MD_CTX_FLAG_NO_INIT + 0x0100 + + ) + +303 + sevp_c�h�_� + + +305 +nid +; + +306 +block_size +; + +307 +key_�n +; + +308 +iv_�n +; + +309 +�ags +; + +310 (* +�� +)( +EVP_CIPHER_CTX + * +�x +, cڡ * +key +, + +311 cڡ * +iv +, +�c +); + +312 (* +do_c�h� +)( +EVP_CIPHER_CTX + * +�x +, * +out +, + +313 cڡ * +� +, +size_t + +�l +); + +314 (* +��nup +)( +EVP_CIPHER_CTX + *); + +315 +�x_size +; + +316 (* +�t_a�1_��m��s +)( +EVP_CIPHER_CTX + *, +ASN1_TYPE + *); + +317 (* +g�_a�1_��m��s +)( +EVP_CIPHER_CTX + *, +ASN1_TYPE + *); + +318 (* +�� +)( +EVP_CIPHER_CTX + *, +ty� +, +�g +, * +�r +); + +319 * +�p_d�a +; + +326 + #EVP_CIPH_STREAM_CIPHER + 0x0 + + ) + +327 + #EVP_CIPH_ECB_MODE + 0x1 + + ) + +328 + #EVP_CIPH_CBC_MODE + 0x2 + + ) + +329 + #EVP_CIPH_CFB_MODE + 0x3 + + ) + +330 + #EVP_CIPH_OFB_MODE + 0x4 + + ) + +331 + #EVP_CIPH_CTR_MODE + 0x5 + + ) + +332 + #EVP_CIPH_GCM_MODE + 0x6 + + ) + +333 + #EVP_CIPH_CCM_MODE + 0x7 + + ) + +334 + #EVP_CIPH_XTS_MODE + 0x10001 + + ) + +335 + #EVP_CIPH_MODE + 0xF0007 + + ) + +337 + #EVP_CIPH_VARIABLE_LENGTH + 0x8 + + ) + +339 + #EVP_CIPH_CUSTOM_IV + 0x10 + + ) + +341 + #EVP_CIPH_ALWAYS_CALL_INIT + 0x20 + + ) + +343 + #EVP_CIPH_CTRL_INIT + 0x40 + + ) + +345 + #EVP_CIPH_CUSTOM_KEY_LENGTH + 0x80 + + ) + +347 + #EVP_CIPH_NO_PADDING + 0x100 + + ) + +349 + #EVP_CIPH_RAND_KEY + 0x200 + + ) + +351 + #EVP_CIPH_CUSTOM_COPY + 0x400 + + ) + +353 + #EVP_CIPH_FLAG_DEFAULT_ASN1 + 0x1000 + + ) + +355 + #EVP_CIPH_FLAG_LENGTH_BITS + 0x2000 + + ) + +357 + #EVP_CIPH_FLAG_FIPS + 0x4000 + + ) + +359 + #EVP_CIPH_FLAG_NON_FIPS_ALLOW + 0x8000 + + ) + +363 + #EVP_CIPH_FLAG_CUSTOM_CIPHER + 0x100000 + + ) + +364 + #EVP_CIPH_FLAG_AEAD_CIPHER + 0x200000 + + ) + +368 + #EVP_CTRL_INIT + 0x0 + + ) + +369 + #EVP_CTRL_SET_KEY_LENGTH + 0x1 + + ) + +370 + #EVP_CTRL_GET_RC2_KEY_BITS + 0x2 + + ) + +371 + #EVP_CTRL_SET_RC2_KEY_BITS + 0x3 + + ) + +372 + #EVP_CTRL_GET_RC5_ROUNDS + 0x4 + + ) + +373 + #EVP_CTRL_SET_RC5_ROUNDS + 0x5 + + ) + +374 + #EVP_CTRL_RAND_KEY + 0x6 + + ) + +375 + #EVP_CTRL_PBE_PRF_NID + 0x7 + + ) + +376 + #EVP_CTRL_COPY + 0x8 + + ) + +377 + #EVP_CTRL_GCM_SET_IVLEN + 0x9 + + ) + +378 + #EVP_CTRL_GCM_GET_TAG + 0x10 + + ) + +379 + #EVP_CTRL_GCM_SET_TAG + 0x11 + + ) + +380 + #EVP_CTRL_GCM_SET_IV_FIXED + 0x12 + + ) + +381 + #EVP_CTRL_GCM_IV_GEN + 0x13 + + ) + +382 + #EVP_CTRL_CCM_SET_IVLEN + +EVP_CTRL_GCM_SET_IVLEN + + + ) + +383 + #EVP_CTRL_CCM_GET_TAG + +EVP_CTRL_GCM_GET_TAG + + + ) + +384 + #EVP_CTRL_CCM_SET_TAG + +EVP_CTRL_GCM_SET_TAG + + + ) + +385 + #EVP_CTRL_CCM_SET_L + 0x14 + + ) + +386 + #EVP_CTRL_CCM_SET_MSGLEN + 0x15 + + ) + +391 + #EVP_CTRL_AEAD_TLS1_AAD + 0x16 + + ) + +393 + #EVP_CTRL_AEAD_SET_MAC_KEY + 0x17 + + ) + +395 + #EVP_CTRL_GCM_SET_IV_INV + 0x18 + + ) + +398 + #EVP_AEAD_TLS1_AAD_LEN + 13 + + ) + +402 + #EVP_GCM_TLS_FIXED_IV_LEN + 4 + + ) + +404 + #EVP_GCM_TLS_EXPLICIT_IV_LEN + 8 + + ) + +406 + #EVP_GCM_TLS_TAG_LEN + 16 + + ) + +408 + sevp_c�h�_�fo_� + + +410 cڡ +EVP_CIPHER + * +c�h� +; + +411 +iv +[ +EVP_MAX_IV_LENGTH +]; + +412 } + tEVP_CIPHER_INFO +; + +414 + sevp_c�h�_�x_� + + +416 cڡ +EVP_CIPHER + * +c�h� +; + +417 +ENGINE + * +�g�e +; + +418 +��y� +; + +419 +buf_�n +; + +421 +oiv +[ +EVP_MAX_IV_LENGTH +]; + +422 +iv +[ +EVP_MAX_IV_LENGTH +]; + +423 +buf +[ +EVP_MAX_BLOCK_LENGTH +]; + +424 +num +; + +426 * +�p_d�a +; + +427 +key_�n +; + +428 +�ags +; + +429 * +c�h�_d�a +; + +430 +f��_u�d +; + +431 +block_mask +; + +432 +f�� +[ +EVP_MAX_BLOCK_LENGTH +]; + +435 + sevp_Encode_Ctx_� + + +437 +num +; + +438 +�ngth +; + +443 +�c_d�a +[80]; + +444 +l�e_num +; + +445 +ex��_� +; + +446 } + tEVP_ENCODE_CTX +; + +449 ( +EVP_PBE_KEYGEN +)( + tEVP_CIPHER_CTX + * + t�x +, cڡ * + t�ss +, + t�s�� +, + +450 + tASN1_TYPE + * + t��m +, cڡ + tEVP_CIPHER + * + tc�h� +, + +451 cڡ + tEVP_MD + * + tmd +, + t�_de +); + +453 #i�de� +OPENSSL_NO_RSA + + +454 + #EVP_PKEY_assign_RSA +( +pkey +, +r� +� + `EVP_PKEY_assign +(�key), +EVP_PKEY_RSA +,\ + +455 (*)( +r� +)) + + ) + +458 #i�de� +OPENSSL_NO_DSA + + +459 + #EVP_PKEY_assign_DSA +( +pkey +, +d� +� + `EVP_PKEY_assign +(�key), +EVP_PKEY_DSA +,\ + +460 (*)( +d� +)) + + ) + +463 #i�de� +OPENSSL_NO_DH + + +464 + #EVP_PKEY_assign_DH +( +pkey +, +dh +� + `EVP_PKEY_assign +(�key), +EVP_PKEY_DH +,\ + +465 (*)( +dh +)) + + ) + +468 #i�de� +OPENSSL_NO_EC + + +469 + #EVP_PKEY_assign_EC_KEY +( +pkey +, +eckey +� + `EVP_PKEY_assign +(�key), +EVP_PKEY_EC +,\ + +470 (*)( +eckey +)) + + ) + +474 + #EVP_g�_dige�bynid +( +a +� + `EVP_g�_dige�by�me +( + `OBJ_nid2� +�)) + + ) + +475 + #EVP_g�_dige�byobj +( +a +� + `EVP_g�_dige�bynid +( + `OBJ_obj2nid +�)) + + ) + +476 + #EVP_g�_c�h�bynid +( +a +� + `EVP_g�_c�h�by�me +( + `OBJ_nid2� +�)) + + ) + +477 + #EVP_g�_c�h�byobj +( +a +� + `EVP_g�_c�h�bynid +( + `OBJ_obj2nid +�)) + + ) + +479 +EVP_MD_ty� +(cڡ +EVP_MD + * +md +); + +480 + #EVP_MD_nid +( +e +� + `EVP_MD_ty� +�) + + ) + +481 + #EVP_MD_�me +( +e +� + `OBJ_nid2� +( + `EVP_MD_nid +�)) + + ) + +482 +EVP_MD_pkey_ty� +(cڡ +EVP_MD + * +md +); + +483 +EVP_MD_size +(cڡ +EVP_MD + * +md +); + +484 +EVP_MD_block_size +(cڡ +EVP_MD + * +md +); + +485 +EVP_MD_�ags +(cڡ +EVP_MD + * +md +); + +487 cڡ +EVP_MD + * +EVP_MD_CTX_md +(cڡ +EVP_MD_CTX + * +�x +); + +488 + #EVP_MD_CTX_size +( +e +� + `EVP_MD_size +( + `EVP_MD_CTX_md +�)) + + ) + +489 + #EVP_MD_CTX_block_size +( +e +� + `EVP_MD_block_size +( + `EVP_MD_CTX_md +�)) + + ) + +490 + #EVP_MD_CTX_ty� +( +e +� + `EVP_MD_ty� +( + `EVP_MD_CTX_md +�)) + + ) + +492 +EVP_CIPHER_nid +(cڡ +EVP_CIPHER + * +c�h� +); + +493 + #EVP_CIPHER_�me +( +e +� + `OBJ_nid2� +( + `EVP_CIPHER_nid +�)) + + ) + +494 +EVP_CIPHER_block_size +(cڡ +EVP_CIPHER + * +c�h� +); + +495 +EVP_CIPHER_key_�ngth +(cڡ +EVP_CIPHER + * +c�h� +); + +496 +EVP_CIPHER_iv_�ngth +(cڡ +EVP_CIPHER + * +c�h� +); + +497 +EVP_CIPHER_�ags +(cڡ +EVP_CIPHER + * +c�h� +); + +498 + #EVP_CIPHER_mode +( +e +�( + `EVP_CIPHER_�ags +��& +EVP_CIPH_MODE +) + + ) + +500 cڡ +EVP_CIPHER + * +EVP_CIPHER_CTX_c�h� +(cڡ +EVP_CIPHER_CTX + * +�x +); + +501 +EVP_CIPHER_CTX_nid +(cڡ +EVP_CIPHER_CTX + * +�x +); + +502 +EVP_CIPHER_CTX_block_size +(cڡ +EVP_CIPHER_CTX + * +�x +); + +503 +EVP_CIPHER_CTX_key_�ngth +(cڡ +EVP_CIPHER_CTX + * +�x +); + +504 +EVP_CIPHER_CTX_iv_�ngth +(cڡ +EVP_CIPHER_CTX + * +�x +); + +505 +EVP_CIPHER_CTX_c�y +( +EVP_CIPHER_CTX + * +out +, cڡ EVP_CIPHER_CTX * +� +); + +506 * +EVP_CIPHER_CTX_g�_�p_d�a +(cڡ +EVP_CIPHER_CTX + * +�x +); + +507 +EVP_CIPHER_CTX_�t_�p_d�a +( +EVP_CIPHER_CTX + * +�x +, * +d�a +); + +508 + #EVP_CIPHER_CTX_ty� +( +c +� + `EVP_CIPHER_ty� +( + `EVP_CIPHER_CTX_c�h� +(c)) + + ) + +509 +EVP_CIPHER_CTX_�ags +(cڡ +EVP_CIPHER_CTX + * +�x +); + +510 + #EVP_CIPHER_CTX_mode +( +e +�( + `EVP_CIPHER_CTX_�ags +��& +EVP_CIPH_MODE +) + + ) + +512 + #EVP_ENCODE_LENGTH +( +l +�((�+2)/3*4)+�/48+1)*2+80) + + ) + +513 + #EVP_DECODE_LENGTH +( +l +�(�+3)/4*3+80) + + ) + +515 + #EVP_SignIn�_ex +( +a +, +b +, +c +� + `EVP_Dige�In�_ex +�,b,c) + + ) + +516 + #EVP_SignIn� +( +a +, +b +� + `EVP_Dige�In� +�,b) + + ) + +517 + #EVP_SignUpd�e +( +a +, +b +, +c +� + `EVP_Dige�Upd�e +�,b,c) + + ) + +518 + #EVP_V�ifyIn�_ex +( +a +, +b +, +c +� + `EVP_Dige�In�_ex +�,b,c) + + ) + +519 + #EVP_V�ifyIn� +( +a +, +b +� + `EVP_Dige�In� +�,b) + + ) + +520 + #EVP_V�ifyUpd�e +( +a +, +b +, +c +� + `EVP_Dige�Upd�e +�,b,c) + + ) + +521 + #EVP_O�nUpd�e +( +a +, +b +, +c +, +d +, +e +� + `EVP_De�y�Upd�e +�,b,c,d,e) + + ) + +522 + #EVP_S�lUpd�e +( +a +, +b +, +c +, +d +, +e +� + `EVP_En�y�Upd�e +�,b,c,d,e) + + ) + +523 + #EVP_Dige�SignUpd�e +( +a +, +b +, +c +� + `EVP_Dige�Upd�e +�,b,c) + + ) + +524 + #EVP_Dige�V�ifyUpd�e +( +a +, +b +, +c +� + `EVP_Dige�Upd�e +�,b,c) + + ) + +526 #ifde� +CONST_STRICT + + +527 +BIO_�t_md +( +BIO + *,cڡ +EVP_MD + * +md +); + +529 + #BIO_�t_md +( +b +, +md +� + `BIO_�� +(b, +BIO_C_SET_MD +,0,(*)md) + + ) + +531 + #BIO_g�_md +( +b +, +mdp +� + `BIO_�� +(b, +BIO_C_GET_MD +,0,(*)mdp) + + ) + +532 + #BIO_g�_md_�x +( +b +, +md� +� + `BIO_�� +(b, +BIO_C_GET_MD_CTX +,0,(*)md�) + + ) + +533 + #BIO_�t_md_�x +( +b +, +md� +� + `BIO_�� +(b, +BIO_C_SET_MD_CTX +,0,(*)md�) + + ) + +534 + #BIO_g�_c�h�_��us +( +b +� + `BIO_�� +(b, +BIO_C_GET_CIPHER_STATUS +,0, +NULL +) + + ) + +535 + #BIO_g�_c�h�_�x +( +b +, +c_� +� + `BIO_�� +(b, +BIO_C_GET_CIPHER_CTX +,0,(*)c_�) + + ) + +537 +EVP_C�h� +( +EVP_CIPHER_CTX + * +c +, + +538 * +out +, + +539 cڡ * +� +, + +540 +�l +); + +542 + #EVP_add_c�h�_��s +( +n +, +��s +) \ + +543 + `OBJ_NAME_add +(( +��s +), +OBJ_NAME_TYPE_CIPHER_METH +| +OBJ_NAME_ALIAS +,( +n +)) + + ) + +544 + #EVP_add_dige�_��s +( +n +, +��s +) \ + +545 + `OBJ_NAME_add +(( +��s +), +OBJ_NAME_TYPE_MD_METH +| +OBJ_NAME_ALIAS +,( +n +)) + + ) + +546 + #EVP_d��e_c�h�_��s +( +��s +) \ + +547 + `OBJ_NAME_�move +( +��s +, +OBJ_NAME_TYPE_CIPHER_METH +| +OBJ_NAME_ALIAS +); + + ) + +548 + #EVP_d��e_dige�_��s +( +��s +) \ + +549 + `OBJ_NAME_�move +( +��s +, +OBJ_NAME_TYPE_MD_METH +| +OBJ_NAME_ALIAS +); + + ) + +551 +EVP_MD_CTX_�� +( +EVP_MD_CTX + * +�x +); + +552 +EVP_MD_CTX_��nup +( +EVP_MD_CTX + * +�x +); + +553 +EVP_MD_CTX + * +EVP_MD_CTX_��� +(); + +554 +EVP_MD_CTX_de�roy +( +EVP_MD_CTX + * +�x +); + +555 +EVP_MD_CTX_c�y_ex +( +EVP_MD_CTX + * +out +,cڡ EVP_MD_CTX * +� +); + +556 +EVP_MD_CTX_�t_�ags +( +EVP_MD_CTX + * +�x +, +�ags +); + +557 +EVP_MD_CTX_��r_�ags +( +EVP_MD_CTX + * +�x +, +�ags +); + +558 +EVP_MD_CTX_��_�ags +(cڡ +EVP_MD_CTX + * +�x +, +�ags +); + +559 +EVP_Dige�In�_ex +( +EVP_MD_CTX + * +�x +, cڡ +EVP_MD + * +ty� +, +ENGINE + * +im� +); + +560 +EVP_Dige�Upd�e +( +EVP_MD_CTX + * +�x +,cڡ * +d +, + +561 +size_t + +�t +); + +562 +EVP_Dige�F��_ex +( +EVP_MD_CTX + * +�x +,* +md +,* +s +); + +563 +EVP_Dige� +(cڡ * +d�a +, +size_t + +cou� +, + +564 * +md +, * +size +, cڡ +EVP_MD + * +ty� +, +ENGINE + * +im� +); + +566 +EVP_MD_CTX_c�y +( +EVP_MD_CTX + * +out +,cڡ EVP_MD_CTX * +� +); + +567 +EVP_Dige�In� +( +EVP_MD_CTX + * +�x +, cڡ +EVP_MD + * +ty� +); + +568 +EVP_Dige�F�� +( +EVP_MD_CTX + * +�x +,* +md +,* +s +); + +570 +EVP_�ad_pw_�r�g +(* +buf +, +�ngth +,cڡ * +�om� +, +v�ify +); + +571 +EVP_�ad_pw_�r�g_m� +(* +buf +, +m��n +, +max�n +,cڡ * +�om� +, +v�ify +); + +572 +EVP_�t_pw_�om� +(cڡ * +�om� +); + +573 * +EVP_g�_pw_�om� +(); + +575 +EVP_By�sToKey +(cڡ +EVP_CIPHER + * +ty� +,cڡ +EVP_MD + * +md +, + +576 cڡ * +�� +, cڡ * +d�a +, + +577 +d�� +, +cou� +, * +key +,* +iv +); + +579 +EVP_CIPHER_CTX_�t_�ags +( +EVP_CIPHER_CTX + * +�x +, +�ags +); + +580 +EVP_CIPHER_CTX_��r_�ags +( +EVP_CIPHER_CTX + * +�x +, +�ags +); + +581 +EVP_CIPHER_CTX_��_�ags +(cڡ +EVP_CIPHER_CTX + * +�x +, +�ags +); + +583 +EVP_En�y�In� +( +EVP_CIPHER_CTX + * +�x +,cڡ +EVP_CIPHER + * +c�h� +, + +584 cڡ * +key +, cڡ * +iv +); + +585 +EVP_En�y�In�_ex +( +EVP_CIPHER_CTX + * +�x +,cڡ +EVP_CIPHER + * +c�h� +, +ENGINE + * +im� +, + +586 cڡ * +key +, cڡ * +iv +); + +587 +EVP_En�y�Upd�e +( +EVP_CIPHER_CTX + * +�x +, * +out +, + +588 * +ou� +, cڡ * +� +, +�l +); + +589 +EVP_En�y�F��_ex +( +EVP_CIPHER_CTX + * +�x +, * +out +, * +ou� +); + +590 +EVP_En�y�F�� +( +EVP_CIPHER_CTX + * +�x +, * +out +, * +ou� +); + +592 +EVP_De�y�In� +( +EVP_CIPHER_CTX + * +�x +,cڡ +EVP_CIPHER + * +c�h� +, + +593 cڡ * +key +, cڡ * +iv +); + +594 +EVP_De�y�In�_ex +( +EVP_CIPHER_CTX + * +�x +,cڡ +EVP_CIPHER + * +c�h� +, +ENGINE + * +im� +, + +595 cڡ * +key +, cڡ * +iv +); + +596 +EVP_De�y�Upd�e +( +EVP_CIPHER_CTX + * +�x +, * +out +, + +597 * +ou� +, cڡ * +� +, +�l +); + +598 +EVP_De�y�F�� +( +EVP_CIPHER_CTX + * +�x +, * +outm +, * +ou� +); + +599 +EVP_De�y�F��_ex +( +EVP_CIPHER_CTX + * +�x +, * +outm +, * +ou� +); + +601 +EVP_C�h�In� +( +EVP_CIPHER_CTX + * +�x +,cڡ +EVP_CIPHER + * +c�h� +, + +602 cڡ * +key +,cڡ * +iv +, + +603 +�c +); + +604 +EVP_C�h�In�_ex +( +EVP_CIPHER_CTX + * +�x +,cڡ +EVP_CIPHER + * +c�h� +, +ENGINE + * +im� +, + +605 cڡ * +key +,cڡ * +iv +, + +606 +�c +); + +607 +EVP_C�h�Upd�e +( +EVP_CIPHER_CTX + * +�x +, * +out +, + +608 * +ou� +, cڡ * +� +, +�l +); + +609 +EVP_C�h�F�� +( +EVP_CIPHER_CTX + * +�x +, * +outm +, * +ou� +); + +610 +EVP_C�h�F��_ex +( +EVP_CIPHER_CTX + * +�x +, * +outm +, * +ou� +); + +612 +EVP_SignF�� +( +EVP_MD_CTX + * +�x +,* +md +,* +s +, + +613 +EVP_PKEY + * +pkey +); + +615 +EVP_V�ifyF�� +( +EVP_MD_CTX + * +�x +,cڡ * +sigbuf +, + +616 +sig�n +, +EVP_PKEY + * +pkey +); + +618 +EVP_Dige�SignIn� +( +EVP_MD_CTX + * +�x +, +EVP_PKEY_CTX + ** +p�x +, + +619 cڡ +EVP_MD + * +ty� +, +ENGINE + * +e +, +EVP_PKEY + * +pkey +); + +620 +EVP_Dige�SignF�� +( +EVP_MD_CTX + * +�x +, + +621 * +sig�t +, +size_t + * +sig�n +); + +623 +EVP_Dige�V�ifyIn� +( +EVP_MD_CTX + * +�x +, +EVP_PKEY_CTX + ** +p�x +, + +624 cڡ +EVP_MD + * +ty� +, +ENGINE + * +e +, +EVP_PKEY + * +pkey +); + +625 +EVP_Dige�V�ifyF�� +( +EVP_MD_CTX + * +�x +, + +626 * +sig +, +size_t + +sig�n +); + +628 +EVP_O�nIn� +( +EVP_CIPHER_CTX + * +�x +,cڡ +EVP_CIPHER + * +ty� +, + +629 cڡ * +ek +, +ekl +, cڡ * +iv +, + +630 +EVP_PKEY + * +�iv +); + +631 +EVP_O�nF�� +( +EVP_CIPHER_CTX + * +�x +, * +out +, * +ou� +); + +633 +EVP_S�lIn� +( +EVP_CIPHER_CTX + * +�x +, cڡ +EVP_CIPHER + * +ty� +, + +634 ** +ek +, * +ekl +, * +iv +, + +635 +EVP_PKEY + ** +pubk +, +�ubk +); + +636 +EVP_S�lF�� +( +EVP_CIPHER_CTX + * +�x +,* +out +,* +ou� +); + +638 +EVP_EncodeIn� +( +EVP_ENCODE_CTX + * +�x +); + +639 +EVP_EncodeUpd�e +( +EVP_ENCODE_CTX + * +�x +,* +out +,* +ou� +, + +640 cڡ * +� +, +�l +); + +641 +EVP_EncodeF�� +( +EVP_ENCODE_CTX + * +�x +,* +out +,* +ou� +); + +642 +EVP_EncodeBlock +(* +t +, cڡ * +f +, +n +); + +644 +EVP_DecodeIn� +( +EVP_ENCODE_CTX + * +�x +); + +645 +EVP_DecodeUpd�e +( +EVP_ENCODE_CTX + * +�x +,* +out +,* +ou� +, + +646 cڡ * +� +, +�l +); + +647 +EVP_DecodeF�� +( +EVP_ENCODE_CTX + * +�x +, + +648 * +out +, * +ou� +); + +649 +EVP_DecodeBlock +(* +t +, cڡ * +f +, +n +); + +651 +EVP_CIPHER_CTX_�� +( +EVP_CIPHER_CTX + * +a +); + +652 +EVP_CIPHER_CTX_��nup +( +EVP_CIPHER_CTX + * +a +); + +653 +EVP_CIPHER_CTX + * +EVP_CIPHER_CTX_�w +(); + +654 +EVP_CIPHER_CTX_� +( +EVP_CIPHER_CTX + * +a +); + +655 +EVP_CIPHER_CTX_�t_key_�ngth +( +EVP_CIPHER_CTX + * +x +, +key�n +); + +656 +EVP_CIPHER_CTX_�t_�dd�g +( +EVP_CIPHER_CTX + * +c +, +�d +); + +657 +EVP_CIPHER_CTX_�� +( +EVP_CIPHER_CTX + * +�x +, +ty� +, +�g +, * +�r +); + +658 +EVP_CIPHER_CTX_�nd_key +( +EVP_CIPHER_CTX + * +�x +, * +key +); + +660 #i�de� +OPENSSL_NO_BIO + + +661 +BIO_METHOD + * +BIO_f_md +(); + +662 +BIO_METHOD + * +BIO_f_ba�64 +(); + +663 +BIO_METHOD + * +BIO_f_c�h� +(); + +664 +BIO_METHOD + * +BIO_f_�l�b� +(); + +665 +BIO_�t_c�h� +( +BIO + * +b +,cڡ +EVP_CIPHER + * +c +,cڡ * +k +, + +666 cڡ * +i +, +�c +); + +669 cڡ +EVP_MD + * +EVP_md_nu� +(); + +670 #i�de� +OPENSSL_NO_MD2 + + +671 cڡ +EVP_MD + * +EVP_md2 +(); + +673 #i�de� +OPENSSL_NO_MD4 + + +674 cڡ +EVP_MD + * +EVP_md4 +(); + +676 #i�de� +OPENSSL_NO_MD5 + + +677 cڡ +EVP_MD + * +EVP_md5 +(); + +679 #i�de� +OPENSSL_NO_SHA + + +680 cڡ +EVP_MD + * +EVP_sha +(); + +681 cڡ +EVP_MD + * +EVP_sha1 +(); + +682 cڡ +EVP_MD + * +EVP_dss +(); + +683 cڡ +EVP_MD + * +EVP_dss1 +(); + +684 cڡ +EVP_MD + * +EVP_ecd� +(); + +686 #i�de� +OPENSSL_NO_SHA256 + + +687 cڡ +EVP_MD + * +EVP_sha224 +(); + +688 cڡ +EVP_MD + * +EVP_sha256 +(); + +690 #i�de� +OPENSSL_NO_SHA512 + + +691 cڡ +EVP_MD + * +EVP_sha384 +(); + +692 cڡ +EVP_MD + * +EVP_sha512 +(); + +694 #i�de� +OPENSSL_NO_MDC2 + + +695 cڡ +EVP_MD + * +EVP_mdc2 +(); + +697 #i�de� +OPENSSL_NO_RIPEMD + + +698 cڡ +EVP_MD + * +EVP_r�emd160 +(); + +700 #i�de� +OPENSSL_NO_WHIRLPOOL + + +701 cڡ +EVP_MD + * +EVP_wh��o� +(); + +703 cڡ +EVP_CIPHER + * +EVP_�c_nu� +(); + +704 #i�de� +OPENSSL_NO_DES + + +705 cڡ +EVP_CIPHER + * +EVP_des_ecb +(); + +706 cڡ +EVP_CIPHER + * +EVP_des_ede +(); + +707 cڡ +EVP_CIPHER + * +EVP_des_ede3 +(); + +708 cڡ +EVP_CIPHER + * +EVP_des_ede_ecb +(); + +709 cڡ +EVP_CIPHER + * +EVP_des_ede3_ecb +(); + +710 cڡ +EVP_CIPHER + * +EVP_des_cfb64 +(); + +711 + #EVP_des_cfb + +EVP_des_cfb64 + + + ) + +712 cڡ +EVP_CIPHER + * +EVP_des_cfb1 +(); + +713 cڡ +EVP_CIPHER + * +EVP_des_cfb8 +(); + +714 cڡ +EVP_CIPHER + * +EVP_des_ede_cfb64 +(); + +715 + #EVP_des_ede_cfb + +EVP_des_ede_cfb64 + + + ) + +717 cڡ +EVP_CIPHER + * +EVP_des_ede_cfb1 +(); + +718 cڡ +EVP_CIPHER + * +EVP_des_ede_cfb8 +(); + +720 cڡ +EVP_CIPHER + * +EVP_des_ede3_cfb64 +(); + +721 + #EVP_des_ede3_cfb + +EVP_des_ede3_cfb64 + + + ) + +722 cڡ +EVP_CIPHER + * +EVP_des_ede3_cfb1 +(); + +723 cڡ +EVP_CIPHER + * +EVP_des_ede3_cfb8 +(); + +724 cڡ +EVP_CIPHER + * +EVP_des_ofb +(); + +725 cڡ +EVP_CIPHER + * +EVP_des_ede_ofb +(); + +726 cڡ +EVP_CIPHER + * +EVP_des_ede3_ofb +(); + +727 cڡ +EVP_CIPHER + * +EVP_des_cbc +(); + +728 cڡ +EVP_CIPHER + * +EVP_des_ede_cbc +(); + +729 cڡ +EVP_CIPHER + * +EVP_des_ede3_cbc +(); + +730 cڡ +EVP_CIPHER + * +EVP_desx_cbc +(); + +734 #ifde� +OPENSSL_OPENBSD_DEV_CRYPTO + + +735 cڡ +EVP_CIPHER + * +EVP_dev_�y�o_des_ede3_cbc +(); + +736 cڡ +EVP_CIPHER + * +EVP_dev_�y�o_rc4 +(); + +737 cڡ +EVP_MD + * +EVP_dev_�y�o_md5 +(); + +741 #i�de� +OPENSSL_NO_RC4 + + +742 cڡ +EVP_CIPHER + * +EVP_rc4 +(); + +743 cڡ +EVP_CIPHER + * +EVP_rc4_40 +(); + +744 #i�de� +OPENSSL_NO_MD5 + + +745 cڡ +EVP_CIPHER + * +EVP_rc4_hmac_md5 +(); + +748 #i�de� +OPENSSL_NO_IDEA + + +749 cڡ +EVP_CIPHER + * +EVP_id�_ecb +(); + +750 cڡ +EVP_CIPHER + * +EVP_id�_cfb64 +(); + +751 + #EVP_id�_cfb + +EVP_id�_cfb64 + + + ) + +752 cڡ +EVP_CIPHER + * +EVP_id�_ofb +(); + +753 cڡ +EVP_CIPHER + * +EVP_id�_cbc +(); + +755 #i�de� +OPENSSL_NO_RC2 + + +756 cڡ +EVP_CIPHER + * +EVP_rc2_ecb +(); + +757 cڡ +EVP_CIPHER + * +EVP_rc2_cbc +(); + +758 cڡ +EVP_CIPHER + * +EVP_rc2_40_cbc +(); + +759 cڡ +EVP_CIPHER + * +EVP_rc2_64_cbc +(); + +760 cڡ +EVP_CIPHER + * +EVP_rc2_cfb64 +(); + +761 + #EVP_rc2_cfb + +EVP_rc2_cfb64 + + + ) + +762 cڡ +EVP_CIPHER + * +EVP_rc2_ofb +(); + +764 #i�de� +OPENSSL_NO_BF + + +765 cڡ +EVP_CIPHER + * +EVP_bf_ecb +(); + +766 cڡ +EVP_CIPHER + * +EVP_bf_cbc +(); + +767 cڡ +EVP_CIPHER + * +EVP_bf_cfb64 +(); + +768 + #EVP_bf_cfb + +EVP_bf_cfb64 + + + ) + +769 cڡ +EVP_CIPHER + * +EVP_bf_ofb +(); + +771 #i�de� +OPENSSL_NO_CAST + + +772 cڡ +EVP_CIPHER + * +EVP_��5_ecb +(); + +773 cڡ +EVP_CIPHER + * +EVP_��5_cbc +(); + +774 cڡ +EVP_CIPHER + * +EVP_��5_cfb64 +(); + +775 + #EVP_��5_cfb + +EVP_��5_cfb64 + + + ) + +776 cڡ +EVP_CIPHER + * +EVP_��5_ofb +(); + +778 #i�de� +OPENSSL_NO_RC5 + + +779 cڡ +EVP_CIPHER + * +EVP_rc5_32_12_16_cbc +(); + +780 cڡ +EVP_CIPHER + * +EVP_rc5_32_12_16_ecb +(); + +781 cڡ +EVP_CIPHER + * +EVP_rc5_32_12_16_cfb64 +(); + +782 + #EVP_rc5_32_12_16_cfb + +EVP_rc5_32_12_16_cfb64 + + + ) + +783 cڡ +EVP_CIPHER + * +EVP_rc5_32_12_16_ofb +(); + +785 #i�de� +OPENSSL_NO_AES + + +786 cڡ +EVP_CIPHER + * +EVP_�s_128_ecb +(); + +787 cڡ +EVP_CIPHER + * +EVP_�s_128_cbc +(); + +788 cڡ +EVP_CIPHER + * +EVP_�s_128_cfb1 +(); + +789 cڡ +EVP_CIPHER + * +EVP_�s_128_cfb8 +(); + +790 cڡ +EVP_CIPHER + * +EVP_�s_128_cfb128 +(); + +791 + #EVP_�s_128_cfb + +EVP_�s_128_cfb128 + + + ) + +792 cڡ +EVP_CIPHER + * +EVP_�s_128_ofb +(); + +793 cڡ +EVP_CIPHER + * +EVP_�s_128_�r +(); + +794 cڡ +EVP_CIPHER + * +EVP_�s_128_ccm +(); + +795 cڡ +EVP_CIPHER + * +EVP_�s_128_gcm +(); + +796 cڡ +EVP_CIPHER + * +EVP_�s_128_xts +(); + +797 cڡ +EVP_CIPHER + * +EVP_�s_192_ecb +(); + +798 cڡ +EVP_CIPHER + * +EVP_�s_192_cbc +(); + +799 cڡ +EVP_CIPHER + * +EVP_�s_192_cfb1 +(); + +800 cڡ +EVP_CIPHER + * +EVP_�s_192_cfb8 +(); + +801 cڡ +EVP_CIPHER + * +EVP_�s_192_cfb128 +(); + +802 + #EVP_�s_192_cfb + +EVP_�s_192_cfb128 + + + ) + +803 cڡ +EVP_CIPHER + * +EVP_�s_192_ofb +(); + +804 cڡ +EVP_CIPHER + * +EVP_�s_192_�r +(); + +805 cڡ +EVP_CIPHER + * +EVP_�s_192_ccm +(); + +806 cڡ +EVP_CIPHER + * +EVP_�s_192_gcm +(); + +807 cڡ +EVP_CIPHER + * +EVP_�s_256_ecb +(); + +808 cڡ +EVP_CIPHER + * +EVP_�s_256_cbc +(); + +809 cڡ +EVP_CIPHER + * +EVP_�s_256_cfb1 +(); + +810 cڡ +EVP_CIPHER + * +EVP_�s_256_cfb8 +(); + +811 cڡ +EVP_CIPHER + * +EVP_�s_256_cfb128 +(); + +812 + #EVP_�s_256_cfb + +EVP_�s_256_cfb128 + + + ) + +813 cڡ +EVP_CIPHER + * +EVP_�s_256_ofb +(); + +814 cڡ +EVP_CIPHER + * +EVP_�s_256_�r +(); + +815 cڡ +EVP_CIPHER + * +EVP_�s_256_ccm +(); + +816 cڡ +EVP_CIPHER + * +EVP_�s_256_gcm +(); + +817 cڡ +EVP_CIPHER + * +EVP_�s_256_xts +(); + +818 #i�! +def�ed +( +OPENSSL_NO_SHA +�&& !def�ed( +OPENSSL_NO_SHA1 +) + +819 cڡ +EVP_CIPHER + * +EVP_�s_128_cbc_hmac_sha1 +(); + +820 cڡ +EVP_CIPHER + * +EVP_�s_256_cbc_hmac_sha1 +(); + +823 #i�de� +OPENSSL_NO_CAMELLIA + + +824 cڡ +EVP_CIPHER + * +EVP_�m�l�_128_ecb +(); + +825 cڡ +EVP_CIPHER + * +EVP_�m�l�_128_cbc +(); + +826 cڡ +EVP_CIPHER + * +EVP_�m�l�_128_cfb1 +(); + +827 cڡ +EVP_CIPHER + * +EVP_�m�l�_128_cfb8 +(); + +828 cڡ +EVP_CIPHER + * +EVP_�m�l�_128_cfb128 +(); + +829 + #EVP_�m�l�_128_cfb + +EVP_�m�l�_128_cfb128 + + + ) + +830 cڡ +EVP_CIPHER + * +EVP_�m�l�_128_ofb +(); + +831 cڡ +EVP_CIPHER + * +EVP_�m�l�_192_ecb +(); + +832 cڡ +EVP_CIPHER + * +EVP_�m�l�_192_cbc +(); + +833 cڡ +EVP_CIPHER + * +EVP_�m�l�_192_cfb1 +(); + +834 cڡ +EVP_CIPHER + * +EVP_�m�l�_192_cfb8 +(); + +835 cڡ +EVP_CIPHER + * +EVP_�m�l�_192_cfb128 +(); + +836 + #EVP_�m�l�_192_cfb + +EVP_�m�l�_192_cfb128 + + + ) + +837 cڡ +EVP_CIPHER + * +EVP_�m�l�_192_ofb +(); + +838 cڡ +EVP_CIPHER + * +EVP_�m�l�_256_ecb +(); + +839 cڡ +EVP_CIPHER + * +EVP_�m�l�_256_cbc +(); + +840 cڡ +EVP_CIPHER + * +EVP_�m�l�_256_cfb1 +(); + +841 cڡ +EVP_CIPHER + * +EVP_�m�l�_256_cfb8 +(); + +842 cڡ +EVP_CIPHER + * +EVP_�m�l�_256_cfb128 +(); + +843 + #EVP_�m�l�_256_cfb + +EVP_�m�l�_256_cfb128 + + + ) + +844 cڡ +EVP_CIPHER + * +EVP_�m�l�_256_ofb +(); + +847 #i�de� +OPENSSL_NO_SEED + + +848 cڡ +EVP_CIPHER + * +EVP_�ed_ecb +(); + +849 cڡ +EVP_CIPHER + * +EVP_�ed_cbc +(); + +850 cڡ +EVP_CIPHER + * +EVP_�ed_cfb128 +(); + +851 + #EVP_�ed_cfb + +EVP_�ed_cfb128 + + + ) + +852 cڡ +EVP_CIPHER + * +EVP_�ed_ofb +(); + +855 +OPENSSL_add_�l_�gܙhms_noc�f +(); + +856 +OPENSSL_add_�l_�gܙhms_c�f +(); + +858 #ifde� +OPENSSL_LOAD_CONF + + +859 + #O�nSSL_add_�l_�gܙhms +() \ + +860 + `OPENSSL_add_�l_�gܙhms_c�f +() + + ) + +862 + #O�nSSL_add_�l_�gܙhms +() \ + +863 + `OPENSSL_add_�l_�gܙhms_noc�f +() + + ) + +866 +O�nSSL_add_�l_c�h�s +(); + +867 +O�nSSL_add_�l_dige�s +(); + +868 + #SSL�y_add_�l_�gܙhms +(� + `O�nSSL_add_�l_�gܙhms +() + + ) + +869 + #SSL�y_add_�l_c�h�s +(� + `O�nSSL_add_�l_c�h�s +() + + ) + +870 + #SSL�y_add_�l_dige�s +(� + `O�nSSL_add_�l_dige�s +() + + ) + +872 +EVP_add_c�h� +(cڡ +EVP_CIPHER + * +c�h� +); + +873 +EVP_add_dige� +(cڡ +EVP_MD + * +dige� +); + +875 cڡ +EVP_CIPHER + * +EVP_g�_c�h�by�me +(cڡ * +�me +); + +876 cڡ +EVP_MD + * +EVP_g�_dige�by�me +(cڡ * +�me +); + +877 +EVP_��nup +(); + +879 +EVP_CIPHER_do_�l +((* +� +)(cڡ +EVP_CIPHER + * +c�h +, + +880 cڡ * +�om +, cڡ * +to +, * +x +), * +�g +); + +881 +EVP_CIPHER_do_�l_s܋d +((* +� +)(cڡ +EVP_CIPHER + * +c�h +, + +882 cڡ * +�om +, cڡ * +to +, * +x +), * +�g +); + +884 +EVP_MD_do_�l +((* +� +)(cڡ +EVP_MD + * +c�h +, + +885 cڡ * +�om +, cڡ * +to +, * +x +), * +�g +); + +886 +EVP_MD_do_�l_s܋d +((* +� +)(cڡ +EVP_MD + * +c�h +, + +887 cڡ * +�om +, cڡ * +to +, * +x +), * +�g +); + +889 +EVP_PKEY_de�y�_�d +(* +dec_key +, + +890 cڡ * +�c_key +, +�c_key_�n +, + +891 +EVP_PKEY + * +�iv�e_key +); + +892 +EVP_PKEY_��y�_�d +(* +�c_key +, + +893 cڡ * +key +, +key_�n +, + +894 +EVP_PKEY + * +pub_key +); + +895 +EVP_PKEY_ty� +( +ty� +); + +896 +EVP_PKEY_id +(cڡ +EVP_PKEY + * +pkey +); + +897 +EVP_PKEY_ba�_id +(cڡ +EVP_PKEY + * +pkey +); + +898 +EVP_PKEY_b�s +( +EVP_PKEY + * +pkey +); + +899 +EVP_PKEY_size +( +EVP_PKEY + * +pkey +); + +900 +EVP_PKEY_�t_ty� +( +EVP_PKEY + * +pkey +, +ty� +); + +901 +EVP_PKEY_�t_ty�_�r +( +EVP_PKEY + * +pkey +, cڡ * +�r +, +�n +); + +902 +EVP_PKEY_assign +( +EVP_PKEY + * +pkey +, +ty� +,* +key +); + +903 * +EVP_PKEY_g�0 +( +EVP_PKEY + * +pkey +); + +905 #i�de� +OPENSSL_NO_RSA + + +906 +r�_� +; + +907 +EVP_PKEY_�t1_RSA +( +EVP_PKEY + * +pkey +, +r�_� + * +key +); + +908 +r�_� + * +EVP_PKEY_g�1_RSA +( +EVP_PKEY + * +pkey +); + +910 #i�de� +OPENSSL_NO_DSA + + +911 +d�_� +; + +912 +EVP_PKEY_�t1_DSA +( +EVP_PKEY + * +pkey +, +d�_� + * +key +); + +913 +d�_� + * +EVP_PKEY_g�1_DSA +( +EVP_PKEY + * +pkey +); + +915 #i�de� +OPENSSL_NO_DH + + +916 +dh_� +; + +917 +EVP_PKEY_�t1_DH +( +EVP_PKEY + * +pkey +, +dh_� + * +key +); + +918 +dh_� + * +EVP_PKEY_g�1_DH +( +EVP_PKEY + * +pkey +); + +920 #i�de� +OPENSSL_NO_EC + + +921 +ec_key_� +; + +922 +EVP_PKEY_�t1_EC_KEY +( +EVP_PKEY + * +pkey +, +ec_key_� + * +key +); + +923 +ec_key_� + * +EVP_PKEY_g�1_EC_KEY +( +EVP_PKEY + * +pkey +); + +926 +EVP_PKEY + * +EVP_PKEY_�w +(); + +927 +EVP_PKEY_� +( +EVP_PKEY + * +pkey +); + +929 +EVP_PKEY + * +d2i_PublicKey +( +ty� +,EVP_PKEY ** +a +, cڡ ** +� +, + +930 +�ngth +); + +931 +i2d_PublicKey +( +EVP_PKEY + * +a +, ** +� +); + +933 +EVP_PKEY + * +d2i_Priv�eKey +( +ty� +,EVP_PKEY ** +a +, cڡ ** +� +, + +934 +�ngth +); + +935 +EVP_PKEY + * +d2i_AutoPriv�eKey +(EVP_PKEY ** +a +, cڡ ** +� +, + +936 +�ngth +); + +937 +i2d_Priv�eKey +( +EVP_PKEY + * +a +, ** +� +); + +939 +EVP_PKEY_c�y_��m��s +( +EVP_PKEY + * +to +, cڡ EVP_PKEY * +�om +); + +940 +EVP_PKEY_miss�g_��m��s +(cڡ +EVP_PKEY + * +pkey +); + +941 +EVP_PKEY_�ve_��m��s +( +EVP_PKEY + * +pkey +, +mode +); + +942 +EVP_PKEY_cmp_��m��s +(cڡ +EVP_PKEY + * +a +, cڡ EVP_PKEY * +b +); + +944 +EVP_PKEY_cmp +(cڡ +EVP_PKEY + * +a +, cڡ EVP_PKEY * +b +); + +946 +EVP_PKEY_��t_public +( +BIO + * +out +, cڡ +EVP_PKEY + * +pkey +, + +947 +�d�t +, +ASN1_PCTX + * +p�x +); + +948 +EVP_PKEY_��t_�iv�e +( +BIO + * +out +, cڡ +EVP_PKEY + * +pkey +, + +949 +�d�t +, +ASN1_PCTX + * +p�x +); + +950 +EVP_PKEY_��t_��ms +( +BIO + * +out +, cڡ +EVP_PKEY + * +pkey +, + +951 +�d�t +, +ASN1_PCTX + * +p�x +); + +953 +EVP_PKEY_g�_de�u�_dige�_nid +( +EVP_PKEY + * +pkey +, * +�id +); + +955 +EVP_CIPHER_ty� +(cڡ +EVP_CIPHER + * +�x +); + +958 +EVP_CIPHER_��m_to_a�1 +( +EVP_CIPHER_CTX + * +c +, +ASN1_TYPE + * +ty� +); + +959 +EVP_CIPHER_a�1_to_��m +( +EVP_CIPHER_CTX + * +c +, +ASN1_TYPE + * +ty� +); + +962 +EVP_CIPHER_�t_a�1_iv +( +EVP_CIPHER_CTX + * +c +, +ASN1_TYPE + * +ty� +); + +963 +EVP_CIPHER_g�_a�1_iv +( +EVP_CIPHER_CTX + * +c +, +ASN1_TYPE + * +ty� +); + +966 +PKCS5_PBE_keyivg� +( +EVP_CIPHER_CTX + * +�x +, cڡ * +�ss +, +�s�� +, + +967 +ASN1_TYPE + * +��m +, cڡ +EVP_CIPHER + * +c�h� +, cڡ +EVP_MD + * +md +, + +968 +�_de +); + +969 +PKCS5_PBKDF2_HMAC_SHA1 +(cڡ * +�ss +, +�s�� +, + +970 cڡ * +�� +, +���n +, +�� +, + +971 +key�n +, * +out +); + +972 +PKCS5_PBKDF2_HMAC +(cڡ * +�ss +, +�s�� +, + +973 cڡ * +�� +, +���n +, +�� +, + +974 cڡ +EVP_MD + * +dige� +, + +975 +key�n +, * +out +); + +976 +PKCS5_v2_PBE_keyivg� +( +EVP_CIPHER_CTX + * +�x +, cڡ * +�ss +, +�s�� +, + +977 +ASN1_TYPE + * +��m +, cڡ +EVP_CIPHER + * +c�h� +, cڡ +EVP_MD + * +md +, + +978 +�_de +); + +980 +PKCS5_PBE_add +(); + +982 +EVP_PBE_C�h�In� + ( +ASN1_OBJECT + * +pbe_obj +, cڡ * +�ss +, +�s�� +, + +983 +ASN1_TYPE + * +��m +, +EVP_CIPHER_CTX + * +�x +, +�_de +); + +988 + #EVP_PBE_TYPE_OUTER + 0x0 + + ) + +990 + #EVP_PBE_TYPE_PRF + 0x1 + + ) + +992 +EVP_PBE_�g_add_ty� +( +pbe_ty� +, +pbe_nid +, +c�h�_nid +, +md_nid +, + +993 +EVP_PBE_KEYGEN + * +keyg� +); + +994 +EVP_PBE_�g_add +( +nid +, cڡ +EVP_CIPHER + * +c�h� +, cڡ +EVP_MD + * +md +, + +995 +EVP_PBE_KEYGEN + * +keyg� +); + +996 +EVP_PBE_f�d +( +ty� +, +pbe_nid +, + +997 * +p�id +, * +pmnid +, +EVP_PBE_KEYGEN + ** +pkeyg� +); + +998 +EVP_PBE_��nup +(); + +1000 + #ASN1_PKEY_ALIAS + 0x1 + + ) + +1001 + #ASN1_PKEY_DYNAMIC + 0x2 + + ) + +1002 + #ASN1_PKEY_SIGPARAM_NULL + 0x4 + + ) + +1004 + #ASN1_PKEY_CTRL_PKCS7_SIGN + 0x1 + + ) + +1005 + #ASN1_PKEY_CTRL_PKCS7_ENCRYPT + 0x2 + + ) + +1006 + #ASN1_PKEY_CTRL_DEFAULT_MD_NID + 0x3 + + ) + +1007 + #ASN1_PKEY_CTRL_CMS_SIGN + 0x5 + + ) + +1008 + #ASN1_PKEY_CTRL_CMS_ENVELOPE + 0x7 + + ) + +1010 +EVP_PKEY_a�1_g�_cou� +(); + +1011 cڡ +EVP_PKEY_ASN1_METHOD + * +EVP_PKEY_a�1_g�0 +( +idx +); + +1012 cڡ +EVP_PKEY_ASN1_METHOD + * +EVP_PKEY_a�1_f�d +( +ENGINE + ** +� +, +ty� +); + +1013 cڡ +EVP_PKEY_ASN1_METHOD + * +EVP_PKEY_a�1_f�d_�r +( +ENGINE + ** +� +, + +1014 cڡ * +�r +, +�n +); + +1015 +EVP_PKEY_a�1_add0 +(cڡ +EVP_PKEY_ASN1_METHOD + * +am�h +); + +1016 +EVP_PKEY_a�1_add_��s +( +to +, +�om +); + +1017 +EVP_PKEY_a�1_g�0_�fo +(* +�key_id +, * +pkey_ba�_id +, * +�key_�ags +, + +1018 cڡ ** +p�fo +, cڡ ** +�em_�r +, + +1019 cڡ +EVP_PKEY_ASN1_METHOD + * +am�h +); + +1021 cڡ +EVP_PKEY_ASN1_METHOD +* +EVP_PKEY_g�0_a�1 +( +EVP_PKEY + * +pkey +); + +1022 +EVP_PKEY_ASN1_METHOD +* +EVP_PKEY_a�1_�w +( +id +, +�ags +, + +1023 cڡ * +�m_�r +, cڡ * +�fo +); + +1024 +EVP_PKEY_a�1_c�y +( +EVP_PKEY_ASN1_METHOD + * +d� +, + +1025 cڡ +EVP_PKEY_ASN1_METHOD + * +�c +); + +1026 +EVP_PKEY_a�1_� +( +EVP_PKEY_ASN1_METHOD + * +am�h +); + +1027 +EVP_PKEY_a�1_�t_public +( +EVP_PKEY_ASN1_METHOD + * +am�h +, + +1028 (* +pub_decode +)( +EVP_PKEY + * +pk +, +X509_PUBKEY + * +pub +), + +1029 (* +pub_�code +)( +X509_PUBKEY + * +pub +, cڡ +EVP_PKEY + * +pk +), + +1030 (* +pub_cmp +)(cڡ +EVP_PKEY + * +a +, cڡ EVP_PKEY * +b +), + +1031 (* +pub_��t +)( +BIO + * +out +, cڡ +EVP_PKEY + * +pkey +, +�d�t +, + +1032 +ASN1_PCTX + * +p�x +), + +1033 (* +pkey_size +)(cڡ +EVP_PKEY + * +pk +), + +1034 (* +pkey_b�s +)(cڡ +EVP_PKEY + * +pk +)); + +1035 +EVP_PKEY_a�1_�t_�iv�e +( +EVP_PKEY_ASN1_METHOD + * +am�h +, + +1036 (* +�iv_decode +)( +EVP_PKEY + * +pk +, +PKCS8_PRIV_KEY_INFO + * +p8�f +), + +1037 (* +�iv_�code +)( +PKCS8_PRIV_KEY_INFO + * +p8 +, cڡ +EVP_PKEY + * +pk +), + +1038 (* +�iv_��t +)( +BIO + * +out +, cڡ +EVP_PKEY + * +pkey +, +�d�t +, + +1039 +ASN1_PCTX + * +p�x +)); + +1040 +EVP_PKEY_a�1_�t_��m +( +EVP_PKEY_ASN1_METHOD + * +am�h +, + +1041 (* +��m_decode +)( +EVP_PKEY + * +pkey +, + +1042 cڡ ** +pd� +, +d��n +), + +1043 (* +��m_�code +)(cڡ +EVP_PKEY + * +pkey +, ** +pd� +), + +1044 (* +��m_miss�g +)(cڡ +EVP_PKEY + * +pk +), + +1045 (* +��m_c�y +)( +EVP_PKEY + * +to +, cڡ EVP_PKEY * +�om +), + +1046 (* +��m_cmp +)(cڡ +EVP_PKEY + * +a +, cڡ EVP_PKEY * +b +), + +1047 (* +��m_��t +)( +BIO + * +out +, cڡ +EVP_PKEY + * +pkey +, +�d�t +, + +1048 +ASN1_PCTX + * +p�x +)); + +1050 +EVP_PKEY_a�1_�t_� +( +EVP_PKEY_ASN1_METHOD + * +am�h +, + +1051 (* +pkey_� +)( +EVP_PKEY + * +pkey +)); + +1052 +EVP_PKEY_a�1_�t_�� +( +EVP_PKEY_ASN1_METHOD + * +am�h +, + +1053 (* +pkey_�� +)( +EVP_PKEY + * +pkey +, +� +, + +1054 +�g1 +, * +�g2 +)); + +1057 + #EVP_PKEY_OP_UNDEFINED + 0 + + ) + +1058 + #EVP_PKEY_OP_PARAMGEN + (1<<1) + + ) + +1059 + #EVP_PKEY_OP_KEYGEN + (1<<2) + + ) + +1060 + #EVP_PKEY_OP_SIGN + (1<<3) + + ) + +1061 + #EVP_PKEY_OP_VERIFY + (1<<4) + + ) + +1062 + #EVP_PKEY_OP_VERIFYRECOVER + (1<<5) + + ) + +1063 + #EVP_PKEY_OP_SIGNCTX + (1<<6) + + ) + +1064 + #EVP_PKEY_OP_VERIFYCTX + (1<<7) + + ) + +1065 + #EVP_PKEY_OP_ENCRYPT + (1<<8) + + ) + +1066 + #EVP_PKEY_OP_DECRYPT + (1<<9) + + ) + +1067 + #EVP_PKEY_OP_DERIVE + (1<<10) + + ) + +1069 + #EVP_PKEY_OP_TYPE_SIG + \ + +1070 ( +EVP_PKEY_OP_SIGN + | +EVP_PKEY_OP_VERIFY + | +EVP_PKEY_OP_VERIFYRECOVER + \ + +1071 | +EVP_PKEY_OP_SIGNCTX + | +EVP_PKEY_OP_VERIFYCTX +) + + ) + +1073 + #EVP_PKEY_OP_TYPE_CRYPT + \ + +1074 ( +EVP_PKEY_OP_ENCRYPT + | +EVP_PKEY_OP_DECRYPT +) + + ) + +1076 + #EVP_PKEY_OP_TYPE_NOGEN + \ + +1077 ( +EVP_PKEY_OP_SIG + | +EVP_PKEY_OP_CRYPT + | +EVP_PKEY_OP_DERIVE +) + + ) + +1079 + #EVP_PKEY_OP_TYPE_GEN + \ + +1080 ( +EVP_PKEY_OP_PARAMGEN + | +EVP_PKEY_OP_KEYGEN +) + + ) + +1082 + #EVP_PKEY_CTX_�t_sig�tu�_md +( +�x +, +md +) \ + +1083 + `EVP_PKEY_CTX_�� +( +�x +, -1, +EVP_PKEY_OP_TYPE_SIG +, \ + +1084 +EVP_PKEY_CTRL_MD +, 0, (*) +md +) + + ) + +1086 + #EVP_PKEY_CTRL_MD + 1 + + ) + +1087 + #EVP_PKEY_CTRL_PEER_KEY + 2 + + ) + +1089 + #EVP_PKEY_CTRL_PKCS7_ENCRYPT + 3 + + ) + +1090 + #EVP_PKEY_CTRL_PKCS7_DECRYPT + 4 + + ) + +1092 + #EVP_PKEY_CTRL_PKCS7_SIGN + 5 + + ) + +1094 + #EVP_PKEY_CTRL_SET_MAC_KEY + 6 + + ) + +1096 + #EVP_PKEY_CTRL_DIGESTINIT + 7 + + ) + +1099 + #EVP_PKEY_CTRL_SET_IV + 8 + + ) + +1101 + #EVP_PKEY_CTRL_CMS_ENCRYPT + 9 + + ) + +1102 + #EVP_PKEY_CTRL_CMS_DECRYPT + 10 + + ) + +1103 + #EVP_PKEY_CTRL_CMS_SIGN + 11 + + ) + +1105 + #EVP_PKEY_CTRL_CIPHER + 12 + + ) + +1107 + #EVP_PKEY_ALG_CTRL + 0x1000 + + ) + +1110 + #EVP_PKEY_FLAG_AUTOARGLEN + 2 + + ) + +1114 + #EVP_PKEY_FLAG_SIGCTX_CUSTOM + 4 + + ) + +1116 cڡ +EVP_PKEY_METHOD + * +EVP_PKEY_m�h_f�d +( +ty� +); + +1117 +EVP_PKEY_METHOD +* +EVP_PKEY_m�h_�w +( +id +, +�ags +); + +1118 +EVP_PKEY_m�h_g�0_�fo +(* +�key_id +, * +p�ags +, + +1119 cڡ +EVP_PKEY_METHOD + * +m�h +); + +1120 +EVP_PKEY_m�h_c�y +( +EVP_PKEY_METHOD + * +d� +, cڡ EVP_PKEY_METHOD * +�c +); + +1121 +EVP_PKEY_m�h_� +( +EVP_PKEY_METHOD + * +pm�h +); + +1122 +EVP_PKEY_m�h_add0 +(cڡ +EVP_PKEY_METHOD + * +pm�h +); + +1124 +EVP_PKEY_CTX + * +EVP_PKEY_CTX_�w +( +EVP_PKEY + * +pkey +, +ENGINE + * +e +); + +1125 +EVP_PKEY_CTX + * +EVP_PKEY_CTX_�w_id +( +id +, +ENGINE + * +e +); + +1126 +EVP_PKEY_CTX + * +EVP_PKEY_CTX_dup +(EVP_PKEY_CTX * +�x +); + +1127 +EVP_PKEY_CTX_� +( +EVP_PKEY_CTX + * +�x +); + +1129 +EVP_PKEY_CTX_�� +( +EVP_PKEY_CTX + * +�x +, +keyty� +, +�ty� +, + +1130 +cmd +, +p1 +, * +p2 +); + +1131 +EVP_PKEY_CTX_��_�r +( +EVP_PKEY_CTX + * +�x +, cڡ * +ty� +, + +1132 cڡ * +v�ue +); + +1134 +EVP_PKEY_CTX_g�_ݔ�i� +( +EVP_PKEY_CTX + * +�x +); + +1135 +EVP_PKEY_CTX_�t0_keyg�_�fo +( +EVP_PKEY_CTX + * +�x +, * +d� +, +d��n +); + +1137 +EVP_PKEY + * +EVP_PKEY_�w_mac_key +( +ty� +, +ENGINE + * +e +, + +1138 cڡ * +key +, +key�n +); + +1140 +EVP_PKEY_CTX_�t_d�a +( +EVP_PKEY_CTX + * +�x +, * +d�a +); + +1141 * +EVP_PKEY_CTX_g�_d�a +( +EVP_PKEY_CTX + * +�x +); + +1142 +EVP_PKEY + * +EVP_PKEY_CTX_g�0_pkey +( +EVP_PKEY_CTX + * +�x +); + +1144 +EVP_PKEY + * +EVP_PKEY_CTX_g�0_��key +( +EVP_PKEY_CTX + * +�x +); + +1146 +EVP_PKEY_CTX_�t_�p_d�a +( +EVP_PKEY_CTX + * +�x +, * +d�a +); + +1147 * +EVP_PKEY_CTX_g�_�p_d�a +( +EVP_PKEY_CTX + * +�x +); + +1149 +EVP_PKEY_sign_�� +( +EVP_PKEY_CTX + * +�x +); + +1150 +EVP_PKEY_sign +( +EVP_PKEY_CTX + * +�x +, + +1151 * +sig +, +size_t + * +sig�n +, + +1152 cڡ * +tbs +, +size_t + +tb�� +); + +1153 +EVP_PKEY_v�ify_�� +( +EVP_PKEY_CTX + * +�x +); + +1154 +EVP_PKEY_v�ify +( +EVP_PKEY_CTX + * +�x +, + +1155 cڡ * +sig +, +size_t + +sig�n +, + +1156 cڡ * +tbs +, +size_t + +tb�� +); + +1157 +EVP_PKEY_v�ify_�cov�_�� +( +EVP_PKEY_CTX + * +�x +); + +1158 +EVP_PKEY_v�ify_�cov� +( +EVP_PKEY_CTX + * +�x +, + +1159 * +rout +, +size_t + * +rou�� +, + +1160 cڡ * +sig +, +size_t + +sig�n +); + +1161 +EVP_PKEY_��y�_�� +( +EVP_PKEY_CTX + * +�x +); + +1162 +EVP_PKEY_��y� +( +EVP_PKEY_CTX + * +�x +, + +1163 * +out +, +size_t + * +ou�� +, + +1164 cڡ * +� +, +size_t + +��n +); + +1165 +EVP_PKEY_de�y�_�� +( +EVP_PKEY_CTX + * +�x +); + +1166 +EVP_PKEY_de�y� +( +EVP_PKEY_CTX + * +�x +, + +1167 * +out +, +size_t + * +ou�� +, + +1168 cڡ * +� +, +size_t + +��n +); + +1170 +EVP_PKEY_d�ive_�� +( +EVP_PKEY_CTX + * +�x +); + +1171 +EVP_PKEY_d�ive_�t_�� +( +EVP_PKEY_CTX + * +�x +, +EVP_PKEY + * +�� +); + +1172 +EVP_PKEY_d�ive +( +EVP_PKEY_CTX + * +�x +, * +key +, +size_t + * +key�n +); + +1174 + tEVP_PKEY_g�_cb +( + tEVP_PKEY_CTX + * + t�x +); + +1176 +EVP_PKEY_��mg�_�� +( +EVP_PKEY_CTX + * +�x +); + +1177 +EVP_PKEY_��mg� +( +EVP_PKEY_CTX + * +�x +, +EVP_PKEY + ** +�key +); + +1178 +EVP_PKEY_keyg�_�� +( +EVP_PKEY_CTX + * +�x +); + +1179 +EVP_PKEY_keyg� +( +EVP_PKEY_CTX + * +�x +, +EVP_PKEY + ** +�key +); + +1181 +EVP_PKEY_CTX_�t_cb +( +EVP_PKEY_CTX + * +�x +, +EVP_PKEY_g�_cb + * +cb +); + +1182 +EVP_PKEY_g�_cb + * +EVP_PKEY_CTX_g�_cb +( +EVP_PKEY_CTX + * +�x +); + +1184 +EVP_PKEY_CTX_g�_keyg�_�fo +( +EVP_PKEY_CTX + * +�x +, +idx +); + +1186 +EVP_PKEY_m�h_�t_�� +( +EVP_PKEY_METHOD + * +pm�h +, + +1187 (* +�� +)( +EVP_PKEY_CTX + * +�x +)); + +1189 +EVP_PKEY_m�h_�t_c�y +( +EVP_PKEY_METHOD + * +pm�h +, + +1190 (* +c�y +)( +EVP_PKEY_CTX + * +d� +, EVP_PKEY_CTX * +�c +)); + +1192 +EVP_PKEY_m�h_�t_��nup +( +EVP_PKEY_METHOD + * +pm�h +, + +1193 (* +��nup +)( +EVP_PKEY_CTX + * +�x +)); + +1195 +EVP_PKEY_m�h_�t_��mg� +( +EVP_PKEY_METHOD + * +pm�h +, + +1196 (* +��mg�_�� +)( +EVP_PKEY_CTX + * +�x +), + +1197 (* +��mg� +)( +EVP_PKEY_CTX + * +�x +, +EVP_PKEY + * +pkey +)); + +1199 +EVP_PKEY_m�h_�t_keyg� +( +EVP_PKEY_METHOD + * +pm�h +, + +1200 (* +keyg�_�� +)( +EVP_PKEY_CTX + * +�x +), + +1201 (* +keyg� +)( +EVP_PKEY_CTX + * +�x +, +EVP_PKEY + * +pkey +)); + +1203 +EVP_PKEY_m�h_�t_sign +( +EVP_PKEY_METHOD + * +pm�h +, + +1204 (* +sign_�� +)( +EVP_PKEY_CTX + * +�x +), + +1205 (* +sign +)( +EVP_PKEY_CTX + * +�x +, * +sig +, +size_t + * +sig�n +, + +1206 cڡ * +tbs +, +size_t + +tb�� +)); + +1208 +EVP_PKEY_m�h_�t_v�ify +( +EVP_PKEY_METHOD + * +pm�h +, + +1209 (* +v�ify_�� +)( +EVP_PKEY_CTX + * +�x +), + +1210 (* +v�ify +)( +EVP_PKEY_CTX + * +�x +, cڡ * +sig +, +size_t + +sig�n +, + +1211 cڡ * +tbs +, +size_t + +tb�� +)); + +1213 +EVP_PKEY_m�h_�t_v�ify_�cov� +( +EVP_PKEY_METHOD + * +pm�h +, + +1214 (* +v�ify_�cov�_�� +)( +EVP_PKEY_CTX + * +�x +), + +1215 (* +v�ify_�cov� +)( +EVP_PKEY_CTX + * +�x +, + +1216 * +sig +, +size_t + * +sig�n +, + +1217 cڡ * +tbs +, +size_t + +tb�� +)); + +1219 +EVP_PKEY_m�h_�t_sign�x +( +EVP_PKEY_METHOD + * +pm�h +, + +1220 (* +sign�x_�� +)( +EVP_PKEY_CTX + * +�x +, +EVP_MD_CTX + * +m�x +), + +1221 (* +sign�x +)( +EVP_PKEY_CTX + * +�x +, * +sig +, +size_t + * +sig�n +, + +1222 +EVP_MD_CTX + * +m�x +)); + +1224 +EVP_PKEY_m�h_�t_v�ify�x +( +EVP_PKEY_METHOD + * +pm�h +, + +1225 (* +v�ify�x_�� +)( +EVP_PKEY_CTX + * +�x +, +EVP_MD_CTX + * +m�x +), + +1226 (* +v�ify�x +)( +EVP_PKEY_CTX + * +�x +, cڡ * +sig +, +sig�n +, + +1227 +EVP_MD_CTX + * +m�x +)); + +1229 +EVP_PKEY_m�h_�t_��y� +( +EVP_PKEY_METHOD + * +pm�h +, + +1230 (* +��y�_�� +)( +EVP_PKEY_CTX + * +�x +), + +1231 (* +��y�� +)( +EVP_PKEY_CTX + * +�x +, * +out +, +size_t + * +ou�� +, + +1232 cڡ * +� +, +size_t + +��n +)); + +1234 +EVP_PKEY_m�h_�t_de�y� +( +EVP_PKEY_METHOD + * +pm�h +, + +1235 (* +de�y�_�� +)( +EVP_PKEY_CTX + * +�x +), + +1236 (* +de�y� +)( +EVP_PKEY_CTX + * +�x +, * +out +, +size_t + * +ou�� +, + +1237 cڡ * +� +, +size_t + +��n +)); + +1239 +EVP_PKEY_m�h_�t_d�ive +( +EVP_PKEY_METHOD + * +pm�h +, + +1240 (* +d�ive_�� +)( +EVP_PKEY_CTX + * +�x +), + +1241 (* +d�ive +)( +EVP_PKEY_CTX + * +�x +, * +key +, +size_t + * +key�n +)); + +1243 +EVP_PKEY_m�h_�t_�� +( +EVP_PKEY_METHOD + * +pm�h +, + +1244 (* +�� +)( +EVP_PKEY_CTX + * +�x +, +ty� +, +p1 +, * +p2 +), + +1245 (* +��_�r +)( +EVP_PKEY_CTX + * +�x +, + +1246 cڡ * +ty� +, cڡ * +v�ue +)); + +1248 +EVP_add_�g_modu� +(); + +1254 +ERR_l�d_EVP_�r�gs +(); + +1259 + #EVP_F_AESNI_INIT_KEY + 165 + + ) + +1260 + #EVP_F_AESNI_XTS_CIPHER + 176 + + ) + +1261 + #EVP_F_AES_INIT_KEY + 133 + + ) + +1262 + #EVP_F_AES_XTS + 172 + + ) + +1263 + #EVP_F_AES_XTS_CIPHER + 175 + + ) + +1264 + #EVP_F_ALG_MODULE_INIT + 177 + + ) + +1265 + #EVP_F_CAMELLIA_INIT_KEY + 159 + + ) + +1266 + #EVP_F_CMAC_INIT + 173 + + ) + +1267 + #EVP_F_D2I_PKEY + 100 + + ) + +1268 + #EVP_F_DO_SIGVER_INIT + 161 + + ) + +1269 + #EVP_F_DSAPKEY2PKCS8 + 134 + + ) + +1270 + #EVP_F_DSA_PKEY2PKCS8 + 135 + + ) + +1271 + #EVP_F_ECDSA_PKEY2PKCS8 + 129 + + ) + +1272 + #EVP_F_ECKEY_PKEY2PKCS8 + 132 + + ) + +1273 + #EVP_F_EVP_CIPHERINIT_EX + 123 + + ) + +1274 + #EVP_F_EVP_CIPHER_CTX_COPY + 163 + + ) + +1275 + #EVP_F_EVP_CIPHER_CTX_CTRL + 124 + + ) + +1276 + #EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH + 122 + + ) + +1277 + #EVP_F_EVP_DECRYPTFINAL_EX + 101 + + ) + +1278 + #EVP_F_EVP_DIGESTINIT_EX + 128 + + ) + +1279 + #EVP_F_EVP_ENCRYPTFINAL_EX + 127 + + ) + +1280 + #EVP_F_EVP_MD_CTX_COPY_EX + 110 + + ) + +1281 + #EVP_F_EVP_MD_SIZE + 162 + + ) + +1282 + #EVP_F_EVP_OPENINIT + 102 + + ) + +1283 + #EVP_F_EVP_PBE_ALG_ADD + 115 + + ) + +1284 + #EVP_F_EVP_PBE_ALG_ADD_TYPE + 160 + + ) + +1285 + #EVP_F_EVP_PBE_CIPHERINIT + 116 + + ) + +1286 + #EVP_F_EVP_PKCS82PKEY + 111 + + ) + +1287 + #EVP_F_EVP_PKCS82PKEY_BROKEN + 136 + + ) + +1288 + #EVP_F_EVP_PKEY2PKCS8_BROKEN + 113 + + ) + +1289 + #EVP_F_EVP_PKEY_COPY_PARAMETERS + 103 + + ) + +1290 + #EVP_F_EVP_PKEY_CTX_CTRL + 137 + + ) + +1291 + #EVP_F_EVP_PKEY_CTX_CTRL_STR + 150 + + ) + +1292 + #EVP_F_EVP_PKEY_CTX_DUP + 156 + + ) + +1293 + #EVP_F_EVP_PKEY_DECRYPT + 104 + + ) + +1294 + #EVP_F_EVP_PKEY_DECRYPT_INIT + 138 + + ) + +1295 + #EVP_F_EVP_PKEY_DECRYPT_OLD + 151 + + ) + +1296 + #EVP_F_EVP_PKEY_DERIVE + 153 + + ) + +1297 + #EVP_F_EVP_PKEY_DERIVE_INIT + 154 + + ) + +1298 + #EVP_F_EVP_PKEY_DERIVE_SET_PEER + 155 + + ) + +1299 + #EVP_F_EVP_PKEY_ENCRYPT + 105 + + ) + +1300 + #EVP_F_EVP_PKEY_ENCRYPT_INIT + 139 + + ) + +1301 + #EVP_F_EVP_PKEY_ENCRYPT_OLD + 152 + + ) + +1302 + #EVP_F_EVP_PKEY_GET1_DH + 119 + + ) + +1303 + #EVP_F_EVP_PKEY_GET1_DSA + 120 + + ) + +1304 + #EVP_F_EVP_PKEY_GET1_ECDSA + 130 + + ) + +1305 + #EVP_F_EVP_PKEY_GET1_EC_KEY + 131 + + ) + +1306 + #EVP_F_EVP_PKEY_GET1_RSA + 121 + + ) + +1307 + #EVP_F_EVP_PKEY_KEYGEN + 146 + + ) + +1308 + #EVP_F_EVP_PKEY_KEYGEN_INIT + 147 + + ) + +1309 + #EVP_F_EVP_PKEY_NEW + 106 + + ) + +1310 + #EVP_F_EVP_PKEY_PARAMGEN + 148 + + ) + +1311 + #EVP_F_EVP_PKEY_PARAMGEN_INIT + 149 + + ) + +1312 + #EVP_F_EVP_PKEY_SIGN + 140 + + ) + +1313 + #EVP_F_EVP_PKEY_SIGN_INIT + 141 + + ) + +1314 + #EVP_F_EVP_PKEY_VERIFY + 142 + + ) + +1315 + #EVP_F_EVP_PKEY_VERIFY_INIT + 143 + + ) + +1316 + #EVP_F_EVP_PKEY_VERIFY_RECOVER + 144 + + ) + +1317 + #EVP_F_EVP_PKEY_VERIFY_RECOVER_INIT + 145 + + ) + +1318 + #EVP_F_EVP_RIJNDAEL + 126 + + ) + +1319 + #EVP_F_EVP_SIGNFINAL + 107 + + ) + +1320 + #EVP_F_EVP_VERIFYFINAL + 108 + + ) + +1321 + #EVP_F_FIPS_CIPHERINIT + 166 + + ) + +1322 + #EVP_F_FIPS_CIPHER_CTX_COPY + 170 + + ) + +1323 + #EVP_F_FIPS_CIPHER_CTX_CTRL + 167 + + ) + +1324 + #EVP_F_FIPS_CIPHER_CTX_SET_KEY_LENGTH + 171 + + ) + +1325 + #EVP_F_FIPS_DIGESTINIT + 168 + + ) + +1326 + #EVP_F_FIPS_MD_CTX_COPY + 169 + + ) + +1327 + #EVP_F_HMAC_INIT_EX + 174 + + ) + +1328 + #EVP_F_INT_CTX_NEW + 157 + + ) + +1329 + #EVP_F_PKCS5_PBE_KEYIVGEN + 117 + + ) + +1330 + #EVP_F_PKCS5_V2_PBE_KEYIVGEN + 118 + + ) + +1331 + #EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN + 164 + + ) + +1332 + #EVP_F_PKCS8_SET_BROKEN + 112 + + ) + +1333 + #EVP_F_PKEY_SET_TYPE + 158 + + ) + +1334 + #EVP_F_RC2_MAGIC_TO_METH + 109 + + ) + +1335 + #EVP_F_RC5_CTRL + 125 + + ) + +1338 + #EVP_R_AES_IV_SETUP_FAILED + 162 + + ) + +1339 + #EVP_R_AES_KEY_SETUP_FAILED + 143 + + ) + +1340 + #EVP_R_ASN1_LIB + 140 + + ) + +1341 + #EVP_R_BAD_BLOCK_LENGTH + 136 + + ) + +1342 + #EVP_R_BAD_DECRYPT + 100 + + ) + +1343 + #EVP_R_BAD_KEY_LENGTH + 137 + + ) + +1344 + #EVP_R_BN_DECODE_ERROR + 112 + + ) + +1345 + #EVP_R_BN_PUBKEY_ERROR + 113 + + ) + +1346 + #EVP_R_BUFFER_TOO_SMALL + 155 + + ) + +1347 + #EVP_R_CAMELLIA_KEY_SETUP_FAILED + 157 + + ) + +1348 + #EVP_R_CIPHER_PARAMETER_ERROR + 122 + + ) + +1349 + #EVP_R_COMMAND_NOT_SUPPORTED + 147 + + ) + +1350 + #EVP_R_CTRL_NOT_IMPLEMENTED + 132 + + ) + +1351 + #EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED + 133 + + ) + +1352 + #EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH + 138 + + ) + +1353 + #EVP_R_DECODE_ERROR + 114 + + ) + +1354 + #EVP_R_DIFFERENT_KEY_TYPES + 101 + + ) + +1355 + #EVP_R_DIFFERENT_PARAMETERS + 153 + + ) + +1356 + #EVP_R_DISABLED_FOR_FIPS + 163 + + ) + +1357 + #EVP_R_ENCODE_ERROR + 115 + + ) + +1358 + #EVP_R_ERROR_LOADING_SECTION + 165 + + ) + +1359 + #EVP_R_ERROR_SETTING_FIPS_MODE + 166 + + ) + +1360 + #EVP_R_EVP_PBE_CIPHERINIT_ERROR + 119 + + ) + +1361 + #EVP_R_EXPECTING_AN_RSA_KEY + 127 + + ) + +1362 + #EVP_R_EXPECTING_A_DH_KEY + 128 + + ) + +1363 + #EVP_R_EXPECTING_A_DSA_KEY + 129 + + ) + +1364 + #EVP_R_EXPECTING_A_ECDSA_KEY + 141 + + ) + +1365 + #EVP_R_EXPECTING_A_EC_KEY + 142 + + ) + +1366 + #EVP_R_FIPS_MODE_NOT_SUPPORTED + 167 + + ) + +1367 + #EVP_R_INITIALIZATION_ERROR + 134 + + ) + +1368 + #EVP_R_INPUT_NOT_INITIALIZED + 111 + + ) + +1369 + #EVP_R_INVALID_DIGEST + 152 + + ) + +1370 + #EVP_R_INVALID_FIPS_MODE + 168 + + ) + +1371 + #EVP_R_INVALID_KEY_LENGTH + 130 + + ) + +1372 + #EVP_R_INVALID_OPERATION + 148 + + ) + +1373 + #EVP_R_IV_TOO_LARGE + 102 + + ) + +1374 + #EVP_R_KEYGEN_FAILURE + 120 + + ) + +1375 + #EVP_R_MESSAGE_DIGEST_IS_NULL + 159 + + ) + +1376 + #EVP_R_METHOD_NOT_SUPPORTED + 144 + + ) + +1377 + #EVP_R_MISSING_PARAMETERS + 103 + + ) + +1378 + #EVP_R_NO_CIPHER_SET + 131 + + ) + +1379 + #EVP_R_NO_DEFAULT_DIGEST + 158 + + ) + +1380 + #EVP_R_NO_DIGEST_SET + 139 + + ) + +1381 + #EVP_R_NO_DSA_PARAMETERS + 116 + + ) + +1382 + #EVP_R_NO_KEY_SET + 154 + + ) + +1383 + #EVP_R_NO_OPERATION_SET + 149 + + ) + +1384 + #EVP_R_NO_SIGN_FUNCTION_CONFIGURED + 104 + + ) + +1385 + #EVP_R_NO_VERIFY_FUNCTION_CONFIGURED + 105 + + ) + +1386 + #EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE + 150 + + ) + +1387 + #EVP_R_OPERATON_NOT_INITIALIZED + 151 + + ) + +1388 + #EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE + 117 + + ) + +1389 + #EVP_R_PRIVATE_KEY_DECODE_ERROR + 145 + + ) + +1390 + #EVP_R_PRIVATE_KEY_ENCODE_ERROR + 146 + + ) + +1391 + #EVP_R_PUBLIC_KEY_NOT_RSA + 106 + + ) + +1392 + #EVP_R_TOO_LARGE + 164 + + ) + +1393 + #EVP_R_UNKNOWN_CIPHER + 160 + + ) + +1394 + #EVP_R_UNKNOWN_DIGEST + 161 + + ) + +1395 + #EVP_R_UNKNOWN_OPTION + 169 + + ) + +1396 + #EVP_R_UNKNOWN_PBE_ALGORITHM + 121 + + ) + +1397 + #EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS + 135 + + ) + +1398 + #EVP_R_UNSUPPORTED_ALGORITHM + 156 + + ) + +1399 + #EVP_R_UNSUPPORTED_CIPHER + 107 + + ) + +1400 + #EVP_R_UNSUPPORTED_KEYLENGTH + 123 + + ) + +1401 + #EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION + 124 + + ) + +1402 + #EVP_R_UNSUPPORTED_KEY_SIZE + 108 + + ) + +1403 + #EVP_R_UNSUPPORTED_PRF + 125 + + ) + +1404 + #EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM + 118 + + ) + +1405 + #EVP_R_UNSUPPORTED_SALT_TYPE + 126 + + ) + +1406 + #EVP_R_WRONG_FINAL_BLOCK_LENGTH + 109 + + ) + +1407 + #EVP_R_WRONG_PUBLIC_KEY_TYPE + 110 + + ) + +1409 #ifde� +__�lu�lus + + + @/usr/include/openssl/ocsp.h + +64 #i�de� +HEADER_OCSP_H + + +65 + #HEADER_OCSP_H + + + ) + +67 + ~<ݒs�/os�_typ.h +> + +68 + ~<ݒs�/x509.h +> + +69 + ~<ݒs�/x509v3.h +> + +70 + ~<ݒs�/��ack.h +> + +72 #ifde� +__�lu�lus + + +78 + #OCSP_DEFAULT_NONCE_LENGTH + 16 + + ) + +80 + #OCSP_NOCERTS + 0x1 + + ) + +81 + #OCSP_NOINTERN + 0x2 + + ) + +82 + #OCSP_NOSIGS + 0x4 + + ) + +83 + #OCSP_NOCHAIN + 0x8 + + ) + +84 + #OCSP_NOVERIFY + 0x10 + + ) + +85 + #OCSP_NOEXPLICIT + 0x20 + + ) + +86 + #OCSP_NOCASIGN + 0x40 + + ) + +87 + #OCSP_NODELEGATED + 0x80 + + ) + +88 + #OCSP_NOCHECKS + 0x100 + + ) + +89 + #OCSP_TRUSTOTHER + 0x200 + + ) + +90 + #OCSP_RESPID_KEY + 0x400 + + ) + +91 + #OCSP_NOTIME + 0x800 + + ) + +99 + soc�_��_id_� + + +101 +X509_ALGOR + * +hashAlgܙhm +; + +102 +ASN1_OCTET_STRING + * +issu�NameHash +; + +103 +ASN1_OCTET_STRING + * +issu�KeyHash +; + +104 +ASN1_INTEGER + * +�r�lNumb� +; + +105 } + tOCSP_CERTID +; + +107 +DECLARE_STACK_OF +( +OCSP_CERTID +) + +113 + soc�_�e_�que�_� + + +115 +OCSP_CERTID + * +�qC�t +; + +116 +STACK_OF +( +X509_EXTENSION +�* +s�g�Reque�Ex�nsi�s +; + +117 } + tOCSP_ONEREQ +; + +119 +DECLARE_STACK_OF +( +OCSP_ONEREQ +) + +120 +DECLARE_ASN1_SET_OF +( +OCSP_ONEREQ +) + +129 + soc�_�q_�fo_� + + +131 +ASN1_INTEGER + * +v�si� +; + +132 +GENERAL_NAME + * +�que��Name +; + +133 +STACK_OF +( +OCSP_ONEREQ +�* +�que�Li� +; + +134 +STACK_OF +( +X509_EXTENSION +�* +�que�Ex�nsi�s +; + +135 } + tOCSP_REQINFO +; + +142 + soc�_sig�tu�_� + + +144 +X509_ALGOR + * +sig�tu�Algܙhm +; + +145 +ASN1_BIT_STRING + * +sig�tu� +; + +146 +STACK_OF +( +X509 +�* +��s +; + +147 } + tOCSP_SIGNATURE +; + +153 + soc�_�que�_� + + +155 +OCSP_REQINFO + * +tbsReque� +; + +156 +OCSP_SIGNATURE + * +�tiڮSig�tu� +; + +157 } + tOCSP_REQUEST +; + +169 + #OCSP_RESPONSE_STATUS_SUCCESSFUL + 0 + + ) + +170 + #OCSP_RESPONSE_STATUS_MALFORMEDREQUEST + 1 + + ) + +171 + #OCSP_RESPONSE_STATUS_INTERNALERROR + 2 + + ) + +172 + #OCSP_RESPONSE_STATUS_TRYLATER + 3 + + ) + +173 + #OCSP_RESPONSE_STATUS_SIGREQUIRED + 5 + + ) + +174 + #OCSP_RESPONSE_STATUS_UNAUTHORIZED + 6 + + ) + +180 + soc�_��_by�s_� + + +182 +ASN1_OBJECT + * +��ڣTy� +; + +183 +ASN1_OCTET_STRING + * +��ڣ +; + +184 } + tOCSP_RESPBYTES +; + +190 + soc�_��ڣ_� + + +192 +ASN1_ENUMERATED + * +��ڣS�tus +; + +193 +OCSP_RESPBYTES + * +��ڣBy�s +; + +200 + #V_OCSP_RESPID_NAME + 0 + + ) + +201 + #V_OCSP_RESPID_KEY + 1 + + ) + +202 + soc�_���d�_id_� + + +204 +ty� +; + +206 +X509_NAME +* +byName +; + +207 +ASN1_OCTET_STRING + * +byKey +; + +208 } +v�ue +; + +211 +DECLARE_STACK_OF +( +OCSP_RESPID +) + +212 +DECLARE_ASN1_FUNCTIONS +( +OCSP_RESPID +) + +222 + soc�_�voked_�fo_� + + +224 +ASN1_GENERALIZEDTIME + * +�vo�ti�Time +; + +225 +ASN1_ENUMERATED + * +�vo�ti�R�s� +; + +226 } + tOCSP_REVOKEDINFO +; + +233 + #V_OCSP_CERTSTATUS_GOOD + 0 + + ) + +234 + #V_OCSP_CERTSTATUS_REVOKED + 1 + + ) + +235 + #V_OCSP_CERTSTATUS_UNKNOWN + 2 + + ) + +236 + soc�_��_��us_� + + +238 +ty� +; + +240 +ASN1_NULL + * +good +; + +241 +OCSP_REVOKEDINFO + * +�voked +; + +242 +ASN1_NULL + * +unknown +; + +243 } +v�ue +; + +244 } + tOCSP_CERTSTATUS +; + +253 + soc�_s�g�_��ڣ_� + + +255 +OCSP_CERTID + * +��Id +; + +256 +OCSP_CERTSTATUS + * +��S�tus +; + +257 +ASN1_GENERALIZEDTIME + * +thisUpd�e +; + +258 +ASN1_GENERALIZEDTIME + * +�xtUpd�e +; + +259 +STACK_OF +( +X509_EXTENSION +�* +s�g�Ex�nsi�s +; + +260 } + tOCSP_SINGLERESP +; + +262 +DECLARE_STACK_OF +( +OCSP_SINGLERESP +) + +263 +DECLARE_ASN1_SET_OF +( +OCSP_SINGLERESP +) + +272 + soc�_��ڣ_d�a_� + + +274 +ASN1_INTEGER + * +v�si� +; + +275 +OCSP_RESPID + * +���d�Id +; + +276 +ASN1_GENERALIZEDTIME + * +�odu�dAt +; + +277 +STACK_OF +( +OCSP_SINGLERESP +�* +��ڣs +; + +278 +STACK_OF +( +X509_EXTENSION +�* +��ڣEx�nsi�s +; + +279 } + tOCSP_RESPDATA +; + +303 + soc�_basic_��ڣ_� + + +305 +OCSP_RESPDATA + * +tbsRe�ڣD�a +; + +306 +X509_ALGOR + * +sig�tu�Algܙhm +; + +307 +ASN1_BIT_STRING + * +sig�tu� +; + +308 +STACK_OF +( +X509 +�* +��s +; + +309 } + tOCSP_BASICRESP +; + +322 + #OCSP_REVOKED_STATUS_NOSTATUS + -1 + + ) + +323 + #OCSP_REVOKED_STATUS_UNSPECIFIED + 0 + + ) + +324 + #OCSP_REVOKED_STATUS_KEYCOMPROMISE + 1 + + ) + +325 + #OCSP_REVOKED_STATUS_CACOMPROMISE + 2 + + ) + +326 + #OCSP_REVOKED_STATUS_AFFILIATIONCHANGED + 3 + + ) + +327 + #OCSP_REVOKED_STATUS_SUPERSEDED + 4 + + ) + +328 + #OCSP_REVOKED_STATUS_CESSATIONOFOPERATION + 5 + + ) + +329 + #OCSP_REVOKED_STATUS_CERTIFICATEHOLD + 6 + + ) + +330 + #OCSP_REVOKED_STATUS_REMOVEFROMCRL + 8 + + ) + +337 + soc�_�l_id_� + + +339 +ASN1_IA5STRING + * +�lU� +; + +340 +ASN1_INTEGER + * +�lNum +; + +341 +ASN1_GENERALIZEDTIME + * +�lTime +; + +342 } + tOCSP_CRLID +; + +348 + soc�_�rvi�_lo�t�_� + + +350 +X509_NAME +* +issu� +; + +351 +STACK_OF +( +ACCESS_DESCRIPTION +�* +lo�t� +; + +352 } + tOCSP_SERVICELOC +; + +354 + #PEM_STRING_OCSP_REQUEST + "OCSP REQUEST" + + ) + +355 + #PEM_STRING_OCSP_RESPONSE + "OCSP RESPONSE" + + ) + +357 + #d2i_OCSP_REQUEST_bio +( +bp +, +p +� + `ASN1_d2i_bio_of +( +OCSP_REQUEST +, +OCSP_REQUEST_�w +, +d2i_OCSP_REQUEST +,bp,p) + + ) + +359 + #d2i_OCSP_RESPONSE_bio +( +bp +, +p +� + `ASN1_d2i_bio_of +( +OCSP_RESPONSE +, +OCSP_RESPONSE_�w +, +d2i_OCSP_RESPONSE +,bp,p) + + ) + +361 + #PEM_�ad_bio_OCSP_REQUEST +( +bp +, +x +, +cb +�( +OCSP_REQUEST + *) + `PEM_ASN1_�ad_bio +( \ + +362 (*(*)()) +d2i_OCSP_REQUEST +, +PEM_STRING_OCSP_REQUEST +, +bp +,(**) +x +, +cb +, +NULL +) + + ) + +364 + #PEM_�ad_bio_OCSP_RESPONSE +( +bp +, +x +, +cb +)( +OCSP_RESPONSE + *) + `PEM_ASN1_�ad_bio +(\ + +365 (*(*)()) +d2i_OCSP_RESPONSE +, +PEM_STRING_OCSP_RESPONSE +, +bp +,(**) +x +, +cb +, +NULL +) + + ) + +367 + #PEM_wr�e_bio_OCSP_REQUEST +( +bp +, +o +) \ + +368 + `PEM_ASN1_wr�e_bio +(((*)()) +i2d_OCSP_REQUEST +, +PEM_STRING_OCSP_REQUEST +,\ + +369 +bp +,(*) +o +, +NULL +,NULL,0,NULL,NULL) + + ) + +371 + #PEM_wr�e_bio_OCSP_RESPONSE +( +bp +, +o +) \ + +372 + `PEM_ASN1_wr�e_bio +(((*)()) +i2d_OCSP_RESPONSE +, +PEM_STRING_OCSP_RESPONSE +,\ + +373 +bp +,(*) +o +, +NULL +,NULL,0,NULL,NULL) + + ) + +375 + #i2d_OCSP_RESPONSE_bio +( +bp +, +o +� + `ASN1_i2d_bio_of +( +OCSP_RESPONSE +, +i2d_OCSP_RESPONSE +,bp,o) + + ) + +377 + #i2d_OCSP_REQUEST_bio +( +bp +, +o +� + `ASN1_i2d_bio_of +( +OCSP_REQUEST +, +i2d_OCSP_REQUEST +,bp,o) + + ) + +379 + #OCSP_REQUEST_sign +( +o +, +pkey +, +md +) \ + +380 + `ASN1_�em_sign +( + `ASN1_ITEM_�� +( +OCSP_REQINFO +),\ + +381 +o +-> +�tiڮSig�tu� +-> +sig�tu�Algܙhm +, +NULL +,\ + +382 +o +-> +�tiڮSig�tu� +-> +sig�tu� +,o-> +tbsReque� +, +pkey +, +md +) + + ) + +384 + #OCSP_BASICRESP_sign +( +o +, +pkey +, +md +, +d +) \ + +385 + `ASN1_�em_sign +( + `ASN1_ITEM_�� +( +OCSP_RESPDATA +), +o +-> +sig�tu�Algܙhm +, +NULL +,\ + +386 +o +-> +sig�tu� +,o-> +tbsRe�ڣD�a +, +pkey +, +md +) + + ) + +388 + #OCSP_REQUEST_v�ify +( +a +, +r +� + `ASN1_�em_v�ify +( + `ASN1_ITEM_�� +( +OCSP_REQINFO +),\ + +389 +a +-> +�tiڮSig�tu� +-> +sig�tu�Algܙhm +,\ + +390 +a +-> +�tiڮSig�tu� +-> +sig�tu� +,a-> +tbsReque� +, +r +) + + ) + +392 + #OCSP_BASICRESP_v�ify +( +a +, +r +, +d +� + `ASN1_�em_v�ify +( + `ASN1_ITEM_�� +( +OCSP_RESPDATA +),\ + +393 +a +-> +sig�tu�Algܙhm +,a-> +sig�tu� +,a-> +tbsRe�ڣD�a +, +r +) + + ) + +395 + #ASN1_BIT_STRING_dige� +( +d�a +, +ty� +, +md +, +�n +) \ + +396 + `ASN1_�em_dige� +( + `ASN1_ITEM_�� +( +ASN1_BIT_STRING +), +ty� +, +d�a +, +md +, +�n +) + + ) + +398 + #OCSP_CERTSTATUS_dup +( +cs +)\ + +399 ( +OCSP_CERTSTATUS +*) + `ASN1_dup +(((*)()) +i2d_OCSP_CERTSTATUS +,\ + +400 (*(*)()) +d2i_OCSP_CERTSTATUS +,(*)( +cs +)) + + ) + +402 +OCSP_CERTID + * +OCSP_CERTID_dup +(OCSP_CERTID * +id +); + +404 +OCSP_RESPONSE + * +OCSP_�nd�q_bio +( +BIO + * +b +, * +�th +, +OCSP_REQUEST + * +�q +); + +405 +OCSP_REQ_CTX + * +OCSP_�nd�q_�w +( +BIO + * +io +, * +�th +, +OCSP_REQUEST + * +�q +, + +406 +maxl�e +); + +407 +OCSP_�nd�q_nbio +( +OCSP_RESPONSE + ** +�e� +, +OCSP_REQ_CTX + * +r�x +); + +408 +OCSP_REQ_CTX_� +( +OCSP_REQ_CTX + * +r�x +); + +409 +OCSP_REQ_CTX_�t1_�q +( +OCSP_REQ_CTX + * +r�x +, +OCSP_REQUEST + * +�q +); + +410 +OCSP_REQ_CTX_add1_h�d� +( +OCSP_REQ_CTX + * +r�x +, + +411 cڡ * +�me +, cڡ * +v�ue +); + +413 +OCSP_CERTID + * +OCSP_��_to_id +(cڡ +EVP_MD + * +dg� +, +X509 + * +subje� +, X509 * +issu� +); + +415 +OCSP_CERTID + * +OCSP_��_id_�w +(cڡ +EVP_MD + * +dg� +, + +416 +X509_NAME + * +issu�Name +, + +417 +ASN1_BIT_STRING +* +issu�Key +, + +418 +ASN1_INTEGER + * +�r�lNumb� +); + +420 +OCSP_ONEREQ + * +OCSP_�que�_add0_id +( +OCSP_REQUEST + * +�q +, +OCSP_CERTID + * +cid +); + +422 +OCSP_�que�_add1_n�� +( +OCSP_REQUEST + * +�q +, * +v� +, +�n +); + +423 +OCSP_basic_add1_n�� +( +OCSP_BASICRESP + * +�� +, * +v� +, +�n +); + +424 +OCSP_check_n�� +( +OCSP_REQUEST + * +�q +, +OCSP_BASICRESP + * +bs +); + +425 +OCSP_c�y_n�� +( +OCSP_BASICRESP + * +�� +, +OCSP_REQUEST + * +�q +); + +427 +OCSP_�que�_�t1_�me +( +OCSP_REQUEST + * +�q +, +X509_NAME + * +nm +); + +428 +OCSP_�que�_add1_�� +( +OCSP_REQUEST + * +�q +, +X509 + * +�� +); + +430 +OCSP_�que�_sign +( +OCSP_REQUEST + * +�q +, + +431 +X509 + * +sig�r +, + +432 +EVP_PKEY + * +key +, + +433 cڡ +EVP_MD + * +dg� +, + +434 +STACK_OF +( +X509 +�* +��s +, + +435 +�ags +); + +437 +OCSP_��ڣ_��us +( +OCSP_RESPONSE + * +�� +); + +438 +OCSP_BASICRESP + * +OCSP_��ڣ_g�1_basic +( +OCSP_RESPONSE + * +�� +); + +440 +OCSP_��_cou� +( +OCSP_BASICRESP + * +bs +); + +441 +OCSP_SINGLERESP + * +OCSP_��_g�0 +( +OCSP_BASICRESP + * +bs +, +idx +); + +442 +OCSP_��_f�d +( +OCSP_BASICRESP + * +bs +, +OCSP_CERTID + * +id +, +ϡ +); + +443 +OCSP_s�g�_g�0_��us +( +OCSP_SINGLERESP + * +s�g� +, * +�as� +, + +444 +ASN1_GENERALIZEDTIME + ** +�vtime +, + +445 +ASN1_GENERALIZEDTIME + ** +thisupd +, + +446 +ASN1_GENERALIZEDTIME + ** +�xtupd +); + +447 +OCSP_��_f�d_��us +( +OCSP_BASICRESP + * +bs +, +OCSP_CERTID + * +id +, * +��us +, + +448 * +�as� +, + +449 +ASN1_GENERALIZEDTIME + ** +�vtime +, + +450 +ASN1_GENERALIZEDTIME + ** +thisupd +, + +451 +ASN1_GENERALIZEDTIME + ** +�xtupd +); + +452 +OCSP_check_v�id�y +( +ASN1_GENERALIZEDTIME + * +thisupd +, + +453 +ASN1_GENERALIZEDTIME + * +�xtupd +, + +454 +�c +, +max�c +); + +456 +OCSP_�que�_v�ify +( +OCSP_REQUEST + * +�q +, +STACK_OF +( +X509 +�* +��s +, +X509_STORE + * +��e +, +�ags +); + +458 +OCSP_�r�_u� +(* +u� +, ** +pho� +, ** +��t +, ** +��h +, * +ps� +); + +460 +OCSP_id_issu�_cmp +( +OCSP_CERTID + * +a +, OCSP_CERTID * +b +); + +461 +OCSP_id_cmp +( +OCSP_CERTID + * +a +, OCSP_CERTID * +b +); + +463 +OCSP_�que�_ڔeq_cou� +( +OCSP_REQUEST + * +�q +); + +464 +OCSP_ONEREQ + * +OCSP_�que�_ڔeq_g�0 +( +OCSP_REQUEST + * +�q +, +i +); + +465 +OCSP_CERTID + * +OCSP_ڔeq_g�0_id +( +OCSP_ONEREQ + * +�e +); + +466 +OCSP_id_g�0_�fo +( +ASN1_OCTET_STRING + ** +piNameHash +, +ASN1_OBJECT + ** +pmd +, + +467 +ASN1_OCTET_STRING + ** +pikeyHash +, + +468 +ASN1_INTEGER + ** +p�r�l +, +OCSP_CERTID + * +cid +); + +469 +OCSP_�que�_is_sig�d +( +OCSP_REQUEST + * +�q +); + +470 +OCSP_RESPONSE + * +OCSP_��ڣ_��� +( +��us +, +OCSP_BASICRESP + * +bs +); + +471 +OCSP_SINGLERESP + * +OCSP_basic_add1_��us +( +OCSP_BASICRESP + * +r� +, + +472 +OCSP_CERTID + * +cid +, + +473 +��us +, +�as� +, + +474 +ASN1_TIME + * +�vtime +, + +475 +ASN1_TIME + * +thisupd +, ASN1_TIME * +�xtupd +); + +476 +OCSP_basic_add1_�� +( +OCSP_BASICRESP + * +�� +, +X509 + * +�� +); + +477 +OCSP_basic_sign +( +OCSP_BASICRESP + * +br� +, + +478 +X509 + * +sig�r +, +EVP_PKEY + * +key +, cڡ +EVP_MD + * +dg� +, + +479 +STACK_OF +( +X509 +�* +��s +, +�ags +); + +481 +X509_EXTENSION + * +OCSP_�lID_�w +(* +u� +, * +n +, * +tim +); + +483 +X509_EXTENSION + * +OCSP_ac��_��ڣs_�w +(** +oids +); + +485 +X509_EXTENSION + * +OCSP_�chive_cutoff_�w +(* +tim +); + +487 +X509_EXTENSION + * +OCSP_u�_sv�oc_�w +( +X509_NAME +* +issu� +, ** +u�s +); + +489 +OCSP_REQUEST_g�_ext_cou� +( +OCSP_REQUEST + * +x +); + +490 +OCSP_REQUEST_g�_ext_by_NID +( +OCSP_REQUEST + * +x +, +nid +, +ϡpos +); + +491 +OCSP_REQUEST_g�_ext_by_OBJ +( +OCSP_REQUEST + * +x +, +ASN1_OBJECT + * +obj +, +ϡpos +); + +492 +OCSP_REQUEST_g�_ext_by_��i�l +( +OCSP_REQUEST + * +x +, +�� +, +ϡpos +); + +493 +X509_EXTENSION + * +OCSP_REQUEST_g�_ext +( +OCSP_REQUEST + * +x +, +loc +); + +494 +X509_EXTENSION + * +OCSP_REQUEST_d��e_ext +( +OCSP_REQUEST + * +x +, +loc +); + +495 * +OCSP_REQUEST_g�1_ext_d2i +( +OCSP_REQUEST + * +x +, +nid +, * +�� +, * +idx +); + +496 +OCSP_REQUEST_add1_ext_i2d +( +OCSP_REQUEST + * +x +, +nid +, * +v�ue +, +�� +, + +497 +�ags +); + +498 +OCSP_REQUEST_add_ext +( +OCSP_REQUEST + * +x +, +X509_EXTENSION + * +ex +, +loc +); + +500 +OCSP_ONEREQ_g�_ext_cou� +( +OCSP_ONEREQ + * +x +); + +501 +OCSP_ONEREQ_g�_ext_by_NID +( +OCSP_ONEREQ + * +x +, +nid +, +ϡpos +); + +502 +OCSP_ONEREQ_g�_ext_by_OBJ +( +OCSP_ONEREQ + * +x +, +ASN1_OBJECT + * +obj +, +ϡpos +); + +503 +OCSP_ONEREQ_g�_ext_by_��i�l +( +OCSP_ONEREQ + * +x +, +�� +, +ϡpos +); + +504 +X509_EXTENSION + * +OCSP_ONEREQ_g�_ext +( +OCSP_ONEREQ + * +x +, +loc +); + +505 +X509_EXTENSION + * +OCSP_ONEREQ_d��e_ext +( +OCSP_ONEREQ + * +x +, +loc +); + +506 * +OCSP_ONEREQ_g�1_ext_d2i +( +OCSP_ONEREQ + * +x +, +nid +, * +�� +, * +idx +); + +507 +OCSP_ONEREQ_add1_ext_i2d +( +OCSP_ONEREQ + * +x +, +nid +, * +v�ue +, +�� +, + +508 +�ags +); + +509 +OCSP_ONEREQ_add_ext +( +OCSP_ONEREQ + * +x +, +X509_EXTENSION + * +ex +, +loc +); + +511 +OCSP_BASICRESP_g�_ext_cou� +( +OCSP_BASICRESP + * +x +); + +512 +OCSP_BASICRESP_g�_ext_by_NID +( +OCSP_BASICRESP + * +x +, +nid +, +ϡpos +); + +513 +OCSP_BASICRESP_g�_ext_by_OBJ +( +OCSP_BASICRESP + * +x +, +ASN1_OBJECT + * +obj +, +ϡpos +); + +514 +OCSP_BASICRESP_g�_ext_by_��i�l +( +OCSP_BASICRESP + * +x +, +�� +, +ϡpos +); + +515 +X509_EXTENSION + * +OCSP_BASICRESP_g�_ext +( +OCSP_BASICRESP + * +x +, +loc +); + +516 +X509_EXTENSION + * +OCSP_BASICRESP_d��e_ext +( +OCSP_BASICRESP + * +x +, +loc +); + +517 * +OCSP_BASICRESP_g�1_ext_d2i +( +OCSP_BASICRESP + * +x +, +nid +, * +�� +, * +idx +); + +518 +OCSP_BASICRESP_add1_ext_i2d +( +OCSP_BASICRESP + * +x +, +nid +, * +v�ue +, +�� +, + +519 +�ags +); + +520 +OCSP_BASICRESP_add_ext +( +OCSP_BASICRESP + * +x +, +X509_EXTENSION + * +ex +, +loc +); + +522 +OCSP_SINGLERESP_g�_ext_cou� +( +OCSP_SINGLERESP + * +x +); + +523 +OCSP_SINGLERESP_g�_ext_by_NID +( +OCSP_SINGLERESP + * +x +, +nid +, +ϡpos +); + +524 +OCSP_SINGLERESP_g�_ext_by_OBJ +( +OCSP_SINGLERESP + * +x +, +ASN1_OBJECT + * +obj +, +ϡpos +); + +525 +OCSP_SINGLERESP_g�_ext_by_��i�l +( +OCSP_SINGLERESP + * +x +, +�� +, +ϡpos +); + +526 +X509_EXTENSION + * +OCSP_SINGLERESP_g�_ext +( +OCSP_SINGLERESP + * +x +, +loc +); + +527 +X509_EXTENSION + * +OCSP_SINGLERESP_d��e_ext +( +OCSP_SINGLERESP + * +x +, +loc +); + +528 * +OCSP_SINGLERESP_g�1_ext_d2i +( +OCSP_SINGLERESP + * +x +, +nid +, * +�� +, * +idx +); + +529 +OCSP_SINGLERESP_add1_ext_i2d +( +OCSP_SINGLERESP + * +x +, +nid +, * +v�ue +, +�� +, + +530 +�ags +); + +531 +OCSP_SINGLERESP_add_ext +( +OCSP_SINGLERESP + * +x +, +X509_EXTENSION + * +ex +, +loc +); + +533 +DECLARE_ASN1_FUNCTIONS +( +OCSP_SINGLERESP +) + +534 +DECLARE_ASN1_FUNCTIONS +( +OCSP_CERTSTATUS +) + +535 +DECLARE_ASN1_FUNCTIONS +( +OCSP_REVOKEDINFO +) + +536 +DECLARE_ASN1_FUNCTIONS +( +OCSP_BASICRESP +) + +537 +DECLARE_ASN1_FUNCTIONS +( +OCSP_RESPDATA +) + +538 +DECLARE_ASN1_FUNCTIONS +( +OCSP_RESPID +) + +539 +DECLARE_ASN1_FUNCTIONS +( +OCSP_RESPONSE +) + +540 +DECLARE_ASN1_FUNCTIONS +( +OCSP_RESPBYTES +) + +541 +DECLARE_ASN1_FUNCTIONS +( +OCSP_ONEREQ +) + +542 +DECLARE_ASN1_FUNCTIONS +( +OCSP_CERTID +) + +543 +DECLARE_ASN1_FUNCTIONS +( +OCSP_REQUEST +) + +544 +DECLARE_ASN1_FUNCTIONS +( +OCSP_SIGNATURE +) + +545 +DECLARE_ASN1_FUNCTIONS +( +OCSP_REQINFO +) + +546 +DECLARE_ASN1_FUNCTIONS +( +OCSP_CRLID +) + +547 +DECLARE_ASN1_FUNCTIONS +( +OCSP_SERVICELOC +) + +549 cڡ * +OCSP_��ڣ_��us_�r +( +s +); + +550 cڡ * +OCSP_��_��us_�r +( +s +); + +551 cڡ * +OCSP_�l_�as�_�r +( +s +); + +553 +OCSP_REQUEST_��t +( +BIO + * +bp +, +OCSP_REQUEST +* +a +, +�ags +); + +554 +OCSP_RESPONSE_��t +( +BIO + * +bp +, +OCSP_RESPONSE +* +o +, +�ags +); + +556 +OCSP_basic_v�ify +( +OCSP_BASICRESP + * +bs +, +STACK_OF +( +X509 +�* +��s +, + +557 +X509_STORE + * +� +, +�ags +); + +563 +ERR_l�d_OCSP_�r�gs +(); + +568 + #OCSP_F_ASN1_STRING_ENCODE + 100 + + ) + +569 + #OCSP_F_D2I_OCSP_NONCE + 102 + + ) + +570 + #OCSP_F_OCSP_BASIC_ADD1_STATUS + 103 + + ) + +571 + #OCSP_F_OCSP_BASIC_SIGN + 104 + + ) + +572 + #OCSP_F_OCSP_BASIC_VERIFY + 105 + + ) + +573 + #OCSP_F_OCSP_CERT_ID_NEW + 101 + + ) + +574 + #OCSP_F_OCSP_CHECK_DELEGATED + 106 + + ) + +575 + #OCSP_F_OCSP_CHECK_IDS + 107 + + ) + +576 + #OCSP_F_OCSP_CHECK_ISSUER + 108 + + ) + +577 + #OCSP_F_OCSP_CHECK_VALIDITY + 115 + + ) + +578 + #OCSP_F_OCSP_MATCH_ISSUERID + 109 + + ) + +579 + #OCSP_F_OCSP_PARSE_URL + 114 + + ) + +580 + #OCSP_F_OCSP_REQUEST_SIGN + 110 + + ) + +581 + #OCSP_F_OCSP_REQUEST_VERIFY + 116 + + ) + +582 + #OCSP_F_OCSP_RESPONSE_GET1_BASIC + 111 + + ) + +583 + #OCSP_F_OCSP_SENDREQ_BIO + 112 + + ) + +584 + #OCSP_F_OCSP_SENDREQ_NBIO + 117 + + ) + +585 + #OCSP_F_PARSE_HTTP_LINE1 + 118 + + ) + +586 + #OCSP_F_REQUEST_VERIFY + 113 + + ) + +589 + #OCSP_R_BAD_DATA + 100 + + ) + +590 + #OCSP_R_CERTIFICATE_VERIFY_ERROR + 101 + + ) + +591 + #OCSP_R_DIGEST_ERR + 102 + + ) + +592 + #OCSP_R_ERROR_IN_NEXTUPDATE_FIELD + 122 + + ) + +593 + #OCSP_R_ERROR_IN_THISUPDATE_FIELD + 123 + + ) + +594 + #OCSP_R_ERROR_PARSING_URL + 121 + + ) + +595 + #OCSP_R_MISSING_OCSPSIGNING_USAGE + 103 + + ) + +596 + #OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE + 124 + + ) + +597 + #OCSP_R_NOT_BASIC_RESPONSE + 104 + + ) + +598 + #OCSP_R_NO_CERTIFICATES_IN_CHAIN + 105 + + ) + +599 + #OCSP_R_NO_CONTENT + 106 + + ) + +600 + #OCSP_R_NO_PUBLIC_KEY + 107 + + ) + +601 + #OCSP_R_NO_RESPONSE_DATA + 108 + + ) + +602 + #OCSP_R_NO_REVOKED_TIME + 109 + + ) + +603 + #OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE + 110 + + ) + +604 + #OCSP_R_REQUEST_NOT_SIGNED + 128 + + ) + +605 + #OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA + 111 + + ) + +606 + #OCSP_R_ROOT_CA_NOT_TRUSTED + 112 + + ) + +607 + #OCSP_R_SERVER_READ_ERROR + 113 + + ) + +608 + #OCSP_R_SERVER_RESPONSE_ERROR + 114 + + ) + +609 + #OCSP_R_SERVER_RESPONSE_PARSE_ERROR + 115 + + ) + +610 + #OCSP_R_SERVER_WRITE_ERROR + 116 + + ) + +611 + #OCSP_R_SIGNATURE_FAILURE + 117 + + ) + +612 + #OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND + 118 + + ) + +613 + #OCSP_R_STATUS_EXPIRED + 125 + + ) + +614 + #OCSP_R_STATUS_NOT_YET_VALID + 126 + + ) + +615 + #OCSP_R_STATUS_TOO_OLD + 127 + + ) + +616 + #OCSP_R_UNKNOWN_MESSAGE_DIGEST + 119 + + ) + +617 + #OCSP_R_UNKNOWN_NID + 120 + + ) + +618 + #OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE + 129 + + ) + +620 #ifde� +__�lu�lus + + + @/usr/include/openssl/opensslv.h + +1 #i�de� +HEADER_OPENSSLV_H + + +2 + #HEADER_OPENSSLV_H + + + ) + +28 + #OPENSSL_VERSION_NUMBER + 0x1000106fL + + ) + +29 #ifde� +OPENSSL_FIPS + + +30 + #OPENSSL_VERSION_TEXT + "O�nSSL 1.0.1f-f��6 J� 2014" + + ) + +32 + #OPENSSL_VERSION_TEXT + "O�nSSL 1.0.1�6 J� 2014" + + ) + +34 + #OPENSSL_VERSION_PTEXT + "���o�" +OPENSSL_VERSION_TEXT + + + ) + +85 + #SHLIB_VERSION_HISTORY + "" + + ) + +86 + #SHLIB_VERSION_NUMBER + "1.0.0" + + ) + + @/usr/include/openssl/rand.h + +59 #i�de� +HEADER_RAND_H + + +60 + #HEADER_RAND_H + + + ) + +62 + ~<�dlib.h +> + +63 + ~<ݒs�/os�_typ.h +> + +64 + ~<ݒs�/e_os2.h +> + +66 #i� +def�ed +( +OPENSSL_SYS_WINDOWS +) + +67 + ~<w�dows.h +> + +70 #ifde� +__�lu�lus + + +74 #i� +def�ed +( +OPENSSL_FIPS +) + +75 + #FIPS_RAND_SIZE_T + +size_t + + + ) + +81 + s�nd_m�h_� + + +83 (* +�ed +)(cڡ * +buf +, +num +); + +84 (* +by�s +)(* +buf +, +num +); + +85 (* +��nup +)(); + +86 (* +add +)(cڡ * +buf +, +num +, +���y +); + +87 (* +p�udܪd +)(* +buf +, +num +); + +88 (* +��us +)(); + +91 #ifde� +BN_DEBUG + + +92 +�nd_�edi�ab� +; + +95 +RAND_�t_�nd_m�hod +(cڡ +RAND_METHOD + * +m�h +); + +96 cڡ +RAND_METHOD + * +RAND_g�_�nd_m�hod +(); + +97 #i�de� +OPENSSL_NO_ENGINE + + +98 +RAND_�t_�nd_�g�e +( +ENGINE + * +�g�e +); + +100 +RAND_METHOD + * +RAND_SSL�y +(); + +101 +RAND_��nup +(); + +102 +RAND_by�s +(* +buf +, +num +); + +103 +RAND_p�udo_by�s +(* +buf +, +num +); + +104 +RAND_�ed +(cڡ * +buf +, +num +); + +105 +RAND_add +(cڡ * +buf +, +num +, +���y +); + +106 +RAND_l�d_f�e +(cڡ * +f�e +, +max_by�s +); + +107 +RAND_wr�e_f�e +(cڡ * +f�e +); + +108 cڡ * +RAND_f�e_�me +(* +f�e +, +size_t + +num +); + +109 +RAND_��us +(); + +110 +RAND_qu�y_egd_by�s +(cڡ * +�th +, * +buf +, +by�s +); + +111 +RAND_egd +(cڡ * +�th +); + +112 +RAND_egd_by�s +(cڡ * +�th +, +by�s +); + +113 +RAND_p�l +(); + +115 #i� +def�ed +( +OPENSSL_SYS_WINDOWS +�|| def�ed( +OPENSSL_SYS_WIN32 +) + +117 +RAND_s��n +(); + +118 +RAND_ev�t +( +UINT +, +WPARAM +, +LPARAM +); + +122 #ifde� +OPENSSL_FIPS + + +123 +RAND_�t_f�s_drbg_ty� +( +ty� +, +�ags +); + +124 +RAND_��_f�s +(); + +131 +ERR_l�d_RAND_�r�gs +(); + +136 + #RAND_F_RAND_GET_RAND_METHOD + 101 + + ) + +137 + #RAND_F_RAND_INIT_FIPS + 102 + + ) + +138 + #RAND_F_SSLEAY_RAND_BYTES + 100 + + ) + +141 + #RAND_R_DUAL_EC_DRBG_DISABLED + 104 + + ) + +142 + #RAND_R_ERROR_INITIALISING_DRBG + 102 + + ) + +143 + #RAND_R_ERROR_INSTANTIATING_DRBG + 103 + + ) + +144 + #RAND_R_NO_FIPS_RANDOM_METHOD_SET + 101 + + ) + +145 + #RAND_R_PRNG_NOT_SEEDED + 100 + + ) + +147 #ifde� +__�lu�lus + + + @/usr/include/openssl/safestack.h + +55 #i�de� +HEADER_SAFESTACK_H + + +56 + #HEADER_SAFESTACK_H + + + ) + +58 + ~<ݒs�/�ack.h +> + +60 #i�de� +CHECKED_PTR_OF + + +61 + #CHECKED_PTR_OF +( +ty� +, +p +) \ + +62 ((*�(1 ? +p + : ( +ty� +*)0)) + + ) + +70 + #CHECKED_STACK_OF +( +ty� +, +p +) \ + +71 (( +_STACK +*�(1 ? +p + : ( + `STACK_OF +( +ty� +)*)0)) + + ) + +73 + #CHECKED_SK_FREE_FUNC +( +ty� +, +p +) \ + +74 (((*)(*)�((1 ? +p + : ((*)( +ty� + *))0))) + + ) + +76 + #CHECKED_SK_FREE_FUNC2 +( +ty� +, +p +) \ + +77 (((*)(*)�((1 ? +p + : ((*)( +ty� +))0))) + + ) + +79 + #CHECKED_SK_CMP_FUNC +( +ty� +, +p +) \ + +81 ((1 ? +p + : ((*)(cڡ +ty� + * cڡ *, cڡ�y� * cڡ *))0))) + + ) + +83 + #STACK_OF +( +ty� +� +�ack_�_ +## + ) +type + +84 + #PREDECLARE_STACK_OF +( +ty� +� + `STACK_OF +�y�); + + ) + +86 + #DECLARE_STACK_OF +( +ty� +) \ + +87 + `STACK_OF +( +ty� +) \ + +89 +_STACK + +�ack +; \ + +90 }; + + ) + +91 + #DECLARE_SPECIAL_STACK_OF +( +ty� +, +ty�2 +) \ + +92 + `STACK_OF +( +ty� +) \ + +94 +_STACK + +�ack +; \ + +95 }; + + ) + +97 + #IMPLEMENT_STACK_OF +( +ty� +� + + ) + +113 * + tOPENSSL_STRING +; + +115 cڡ * + tOPENSSL_CSTRING +; + +125 + $DECLARE_SPECIAL_STACK_OF +( +OPENSSL_STRING +, ) + +131 * + tOPENSSL_BLOCK +; + +132 + $DECLARE_SPECIAL_STACK_OF +( +OPENSSL_BLOCK +, ) + +136 + #SKM_sk_�w +( +ty� +, +cmp +) \ + +137 (( + `STACK_OF +( +ty� +�*) + `sk_�w +( + `CHECKED_SK_CMP_FUNC +�y�, +cmp +))) + + ) + +138 + #SKM_sk_�w_nu� +( +ty� +) \ + +139 (( + `STACK_OF +( +ty� +�*) + `sk_�w_nu� +()) + + ) + +140 + #SKM_sk_� +( +ty� +, +� +) \ + +141 + `sk_� +( + `CHECKED_STACK_OF +( +ty� +, +� +)) + + ) + +142 + #SKM_sk_num +( +ty� +, +� +) \ + +143 + `sk_num +( + `CHECKED_STACK_OF +( +ty� +, +� +)) + + ) + +144 + #SKM_sk_v�ue +( +ty� +, +� +, +i +) \ + +145 (( +ty� + *) + `sk_v�ue +( + `CHECKED_STACK_OF +�y�, +� +), +i +)) + + ) + +146 + #SKM_sk_�t +( +ty� +, +� +, +i +, +v� +) \ + +147 + `sk_�t +( + `CHECKED_STACK_OF +( +ty� +, +� +), +i +, + `CHECKED_PTR_OF +�y�, +v� +)) + + ) + +148 + #SKM_sk_z�o +( +ty� +, +� +) \ + +149 + `sk_z�o +( + `CHECKED_STACK_OF +( +ty� +, +� +)) + + ) + +150 + #SKM_sk_push +( +ty� +, +� +, +v� +) \ + +151 + `sk_push +( + `CHECKED_STACK_OF +( +ty� +, +� +), + `CHECKED_PTR_OF +�y�, +v� +)) + + ) + +152 + #SKM_sk_unshi� +( +ty� +, +� +, +v� +) \ + +153 + `sk_unshi� +( + `CHECKED_STACK_OF +( +ty� +, +� +), + `CHECKED_PTR_OF +�y�, +v� +)) + + ) + +154 + #SKM_sk_f�d +( +ty� +, +� +, +v� +) \ + +155 + `sk_f�d +( + `CHECKED_STACK_OF +( +ty� +, +� +), + `CHECKED_PTR_OF +�y�, +v� +)) + + ) + +156 + #SKM_sk_f�d_ex +( +ty� +, +� +, +v� +) \ + +157 + `sk_f�d_ex +( + `CHECKED_STACK_OF +( +ty� +, +� +), \ + +158 + `CHECKED_PTR_OF +( +ty� +, +v� +)) + + ) + +159 + #SKM_sk_d��e +( +ty� +, +� +, +i +) \ + +160 ( +ty� + *) + `sk_d��e +( + `CHECKED_STACK_OF +�y�, +� +), +i +) + + ) + +161 + #SKM_sk_d��e_�r +( +ty� +, +� +, +�r +) \ + +162 ( +ty� + *) + `sk_d��e_�r +( + `CHECKED_STACK_OF +�y�, +� +), + `CHECKED_PTR_OF +�y�, +�r +)) + + ) + +163 + #SKM_sk_��� +( +ty� +, +� +, +v� +, +i +) \ + +164 + `sk_��� +( + `CHECKED_STACK_OF +( +ty� +, +� +), + `CHECKED_PTR_OF +�y�, +v� +), +i +) + + ) + +165 + #SKM_sk_�t_cmp_func +( +ty� +, +� +, +cmp +) \ + +166 (((*)(cڡ +ty� + * const *,const�ype * const *)) \ + +167 + `sk_�t_cmp_func +( + `CHECKED_STACK_OF +( +ty� +, +� +), + `CHECKED_SK_CMP_FUNC +�y�, +cmp +))) + + ) + +168 + #SKM_sk_dup +( +ty� +, +� +) \ + +169 ( + `STACK_OF +( +ty� +�*) + `sk_dup +( + `CHECKED_STACK_OF +�y�, +� +)) + + ) + +170 + #SKM_sk_p�_� +( +ty� +, +� +, +�_func +) \ + +171 + `sk_p�_� +( + `CHECKED_STACK_OF +( +ty� +, +� +), + `CHECKED_SK_FREE_FUNC +�y�, +�_func +)) + + ) + +172 + #SKM_sk_shi� +( +ty� +, +� +) \ + +173 ( +ty� + *) + `sk_shi� +( + `CHECKED_STACK_OF +�y�, +� +)) + + ) + +174 + #SKM_sk_p� +( +ty� +, +� +) \ + +175 ( +ty� + *) + `sk_p� +( + `CHECKED_STACK_OF +�y�, +� +)) + + ) + +176 + #SKM_sk_s�t +( +ty� +, +� +) \ + +177 + `sk_s�t +( + `CHECKED_STACK_OF +( +ty� +, +� +)) + + ) + +178 + #SKM_sk_is_s܋d +( +ty� +, +� +) \ + +179 + `sk_is_s܋d +( + `CHECKED_STACK_OF +( +ty� +, +� +)) + + ) + +181 + #SKM_ASN1_SET_OF_d2i +( +ty� +, +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +182 ( + `STACK_OF +( +ty� +�*) + `d2i_ASN1_SET +( \ + +183 ( + `STACK_OF +( +OPENSSL_BLOCK +�**) + `CHECKED_PTR_OF +(STACK_OF( +ty� +)*, +� +), \ + +184 +� +, +�ngth +, \ + +185 + `CHECKED_D2I_OF +( +ty� +, +d2i_func +), \ + +186 + `CHECKED_SK_FREE_FUNC +( +ty� +, +�_func +), \ + +187 +ex_�g +, +ex_�ass +) + + ) + +189 + #SKM_ASN1_SET_OF_i2d +( +ty� +, +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +190 + `i2d_ASN1_SET +(( + `STACK_OF +( +OPENSSL_BLOCK +�*) + `CHECKED_STACK_OF +( +ty� +, +� +), +� +, \ + +191 + `CHECKED_I2D_OF +( +ty� +, +i2d_func +), \ + +192 +ex_�g +, +ex_�ass +, +is_�t +) + + ) + +194 + #SKM_ASN1_�q_�ck +( +ty� +, +� +, +i2d_func +, +buf +, +�n +) \ + +195 + `ASN1_�q_�ck +( + `CHECKED_PTR_OF +( + `STACK_OF +( +ty� +), +� +), \ + +196 + `CHECKED_I2D_OF +( +ty� +, +i2d_func +), +buf +, +�n +) + + ) + +198 + #SKM_ASN1_�q_u�ack +( +ty� +, +buf +, +�n +, +d2i_func +, +�_func +) \ + +199 ( + `STACK_OF +( +ty� +�*) + `ASN1_�q_u�ack +( +buf +, +�n +, + `CHECKED_D2I_OF +�y�, +d2i_func +), + `CHECKED_SK_FREE_FUNC +�y�, +�_func +)) + + ) + +201 + #SKM_PKCS12_de�y�_d2i +( +ty� +, +�g� +, +d2i_func +, +�_func +, +�ss +, +�s�� +, +o� +, +�q +) \ + +202 ( + `STACK_OF +( +ty� +�*) + `PKCS12_de�y�_d2i +( +�g� +, \ + +203 + `CHECKED_D2I_OF +( +ty� +, +d2i_func +), \ + +204 + `CHECKED_SK_FREE_FUNC +( +ty� +, +�_func +), \ + +205 +�ss +, +�s�� +, +o� +, +�q +) + + ) + +208 + #sk_ACCESS_DESCRIPTION_�w +( +cmp +� + `SKM_sk_�w +( +ACCESS_DESCRIPTION +, (cmp)) + + ) + +209 + #sk_ACCESS_DESCRIPTION_�w_nu� +(� + `SKM_sk_�w_nu� +( +ACCESS_DESCRIPTION +) + + ) + +210 + #sk_ACCESS_DESCRIPTION_� +( +� +� + `SKM_sk_� +( +ACCESS_DESCRIPTION +, (�)) + + ) + +211 + #sk_ACCESS_DESCRIPTION_num +( +� +� + `SKM_sk_num +( +ACCESS_DESCRIPTION +, (�)) + + ) + +212 + #sk_ACCESS_DESCRIPTION_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +ACCESS_DESCRIPTION +, (�), (i)) + + ) + +213 + #sk_ACCESS_DESCRIPTION_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +ACCESS_DESCRIPTION +, (�), (i), (v�)) + + ) + +214 + #sk_ACCESS_DESCRIPTION_z�o +( +� +� + `SKM_sk_z�o +( +ACCESS_DESCRIPTION +, (�)) + + ) + +215 + #sk_ACCESS_DESCRIPTION_push +( +� +, +v� +� + `SKM_sk_push +( +ACCESS_DESCRIPTION +, (�), (v�)) + + ) + +216 + #sk_ACCESS_DESCRIPTION_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +ACCESS_DESCRIPTION +, (�), (v�)) + + ) + +217 + #sk_ACCESS_DESCRIPTION_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +ACCESS_DESCRIPTION +, (�), (v�)) + + ) + +218 + #sk_ACCESS_DESCRIPTION_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +ACCESS_DESCRIPTION +, (�), (v�)) + + ) + +219 + #sk_ACCESS_DESCRIPTION_d��e +( +� +, +i +� + `SKM_sk_d��e +( +ACCESS_DESCRIPTION +, (�), (i)) + + ) + +220 + #sk_ACCESS_DESCRIPTION_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +ACCESS_DESCRIPTION +, (�), (�r)) + + ) + +221 + #sk_ACCESS_DESCRIPTION_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +ACCESS_DESCRIPTION +, (�), (v�), (i)) + + ) + +222 + #sk_ACCESS_DESCRIPTION_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +ACCESS_DESCRIPTION +, (�), (cmp)) + + ) + +223 + #sk_ACCESS_DESCRIPTION_dup +( +� +� + `SKM_sk_dup +( +ACCESS_DESCRIPTION +, st) + + ) + +224 + #sk_ACCESS_DESCRIPTION_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +ACCESS_DESCRIPTION +, (�), (�_func)) + + ) + +225 + #sk_ACCESS_DESCRIPTION_shi� +( +� +� + `SKM_sk_shi� +( +ACCESS_DESCRIPTION +, (�)) + + ) + +226 + #sk_ACCESS_DESCRIPTION_p� +( +� +� + `SKM_sk_p� +( +ACCESS_DESCRIPTION +, (�)) + + ) + +227 + #sk_ACCESS_DESCRIPTION_s�t +( +� +� + `SKM_sk_s�t +( +ACCESS_DESCRIPTION +, (�)) + + ) + +228 + #sk_ACCESS_DESCRIPTION_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +ACCESS_DESCRIPTION +, (�)) + + ) + +230 + #sk_ASIdOrR�ge_�w +( +cmp +� + `SKM_sk_�w +( +ASIdOrR�ge +, (cmp)) + + ) + +231 + #sk_ASIdOrR�ge_�w_nu� +(� + `SKM_sk_�w_nu� +( +ASIdOrR�ge +) + + ) + +232 + #sk_ASIdOrR�ge_� +( +� +� + `SKM_sk_� +( +ASIdOrR�ge +, (�)) + + ) + +233 + #sk_ASIdOrR�ge_num +( +� +� + `SKM_sk_num +( +ASIdOrR�ge +, (�)) + + ) + +234 + #sk_ASIdOrR�ge_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +ASIdOrR�ge +, (�), (i)) + + ) + +235 + #sk_ASIdOrR�ge_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +ASIdOrR�ge +, (�), (i), (v�)) + + ) + +236 + #sk_ASIdOrR�ge_z�o +( +� +� + `SKM_sk_z�o +( +ASIdOrR�ge +, (�)) + + ) + +237 + #sk_ASIdOrR�ge_push +( +� +, +v� +� + `SKM_sk_push +( +ASIdOrR�ge +, (�), (v�)) + + ) + +238 + #sk_ASIdOrR�ge_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +ASIdOrR�ge +, (�), (v�)) + + ) + +239 + #sk_ASIdOrR�ge_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +ASIdOrR�ge +, (�), (v�)) + + ) + +240 + #sk_ASIdOrR�ge_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +ASIdOrR�ge +, (�), (v�)) + + ) + +241 + #sk_ASIdOrR�ge_d��e +( +� +, +i +� + `SKM_sk_d��e +( +ASIdOrR�ge +, (�), (i)) + + ) + +242 + #sk_ASIdOrR�ge_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +ASIdOrR�ge +, (�), (�r)) + + ) + +243 + #sk_ASIdOrR�ge_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +ASIdOrR�ge +, (�), (v�), (i)) + + ) + +244 + #sk_ASIdOrR�ge_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +ASIdOrR�ge +, (�), (cmp)) + + ) + +245 + #sk_ASIdOrR�ge_dup +( +� +� + `SKM_sk_dup +( +ASIdOrR�ge +, st) + + ) + +246 + #sk_ASIdOrR�ge_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +ASIdOrR�ge +, (�), (�_func)) + + ) + +247 + #sk_ASIdOrR�ge_shi� +( +� +� + `SKM_sk_shi� +( +ASIdOrR�ge +, (�)) + + ) + +248 + #sk_ASIdOrR�ge_p� +( +� +� + `SKM_sk_p� +( +ASIdOrR�ge +, (�)) + + ) + +249 + #sk_ASIdOrR�ge_s�t +( +� +� + `SKM_sk_s�t +( +ASIdOrR�ge +, (�)) + + ) + +250 + #sk_ASIdOrR�ge_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +ASIdOrR�ge +, (�)) + + ) + +252 + #sk_ASN1_GENERALSTRING_�w +( +cmp +� + `SKM_sk_�w +( +ASN1_GENERALSTRING +, (cmp)) + + ) + +253 + #sk_ASN1_GENERALSTRING_�w_nu� +(� + `SKM_sk_�w_nu� +( +ASN1_GENERALSTRING +) + + ) + +254 + #sk_ASN1_GENERALSTRING_� +( +� +� + `SKM_sk_� +( +ASN1_GENERALSTRING +, (�)) + + ) + +255 + #sk_ASN1_GENERALSTRING_num +( +� +� + `SKM_sk_num +( +ASN1_GENERALSTRING +, (�)) + + ) + +256 + #sk_ASN1_GENERALSTRING_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +ASN1_GENERALSTRING +, (�), (i)) + + ) + +257 + #sk_ASN1_GENERALSTRING_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +ASN1_GENERALSTRING +, (�), (i), (v�)) + + ) + +258 + #sk_ASN1_GENERALSTRING_z�o +( +� +� + `SKM_sk_z�o +( +ASN1_GENERALSTRING +, (�)) + + ) + +259 + #sk_ASN1_GENERALSTRING_push +( +� +, +v� +� + `SKM_sk_push +( +ASN1_GENERALSTRING +, (�), (v�)) + + ) + +260 + #sk_ASN1_GENERALSTRING_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +ASN1_GENERALSTRING +, (�), (v�)) + + ) + +261 + #sk_ASN1_GENERALSTRING_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +ASN1_GENERALSTRING +, (�), (v�)) + + ) + +262 + #sk_ASN1_GENERALSTRING_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +ASN1_GENERALSTRING +, (�), (v�)) + + ) + +263 + #sk_ASN1_GENERALSTRING_d��e +( +� +, +i +� + `SKM_sk_d��e +( +ASN1_GENERALSTRING +, (�), (i)) + + ) + +264 + #sk_ASN1_GENERALSTRING_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +ASN1_GENERALSTRING +, (�), (�r)) + + ) + +265 + #sk_ASN1_GENERALSTRING_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +ASN1_GENERALSTRING +, (�), (v�), (i)) + + ) + +266 + #sk_ASN1_GENERALSTRING_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +ASN1_GENERALSTRING +, (�), (cmp)) + + ) + +267 + #sk_ASN1_GENERALSTRING_dup +( +� +� + `SKM_sk_dup +( +ASN1_GENERALSTRING +, st) + + ) + +268 + #sk_ASN1_GENERALSTRING_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +ASN1_GENERALSTRING +, (�), (�_func)) + + ) + +269 + #sk_ASN1_GENERALSTRING_shi� +( +� +� + `SKM_sk_shi� +( +ASN1_GENERALSTRING +, (�)) + + ) + +270 + #sk_ASN1_GENERALSTRING_p� +( +� +� + `SKM_sk_p� +( +ASN1_GENERALSTRING +, (�)) + + ) + +271 + #sk_ASN1_GENERALSTRING_s�t +( +� +� + `SKM_sk_s�t +( +ASN1_GENERALSTRING +, (�)) + + ) + +272 + #sk_ASN1_GENERALSTRING_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +ASN1_GENERALSTRING +, (�)) + + ) + +274 + #sk_ASN1_INTEGER_�w +( +cmp +� + `SKM_sk_�w +( +ASN1_INTEGER +, (cmp)) + + ) + +275 + #sk_ASN1_INTEGER_�w_nu� +(� + `SKM_sk_�w_nu� +( +ASN1_INTEGER +) + + ) + +276 + #sk_ASN1_INTEGER_� +( +� +� + `SKM_sk_� +( +ASN1_INTEGER +, (�)) + + ) + +277 + #sk_ASN1_INTEGER_num +( +� +� + `SKM_sk_num +( +ASN1_INTEGER +, (�)) + + ) + +278 + #sk_ASN1_INTEGER_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +ASN1_INTEGER +, (�), (i)) + + ) + +279 + #sk_ASN1_INTEGER_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +ASN1_INTEGER +, (�), (i), (v�)) + + ) + +280 + #sk_ASN1_INTEGER_z�o +( +� +� + `SKM_sk_z�o +( +ASN1_INTEGER +, (�)) + + ) + +281 + #sk_ASN1_INTEGER_push +( +� +, +v� +� + `SKM_sk_push +( +ASN1_INTEGER +, (�), (v�)) + + ) + +282 + #sk_ASN1_INTEGER_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +ASN1_INTEGER +, (�), (v�)) + + ) + +283 + #sk_ASN1_INTEGER_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +ASN1_INTEGER +, (�), (v�)) + + ) + +284 + #sk_ASN1_INTEGER_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +ASN1_INTEGER +, (�), (v�)) + + ) + +285 + #sk_ASN1_INTEGER_d��e +( +� +, +i +� + `SKM_sk_d��e +( +ASN1_INTEGER +, (�), (i)) + + ) + +286 + #sk_ASN1_INTEGER_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +ASN1_INTEGER +, (�), (�r)) + + ) + +287 + #sk_ASN1_INTEGER_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +ASN1_INTEGER +, (�), (v�), (i)) + + ) + +288 + #sk_ASN1_INTEGER_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +ASN1_INTEGER +, (�), (cmp)) + + ) + +289 + #sk_ASN1_INTEGER_dup +( +� +� + `SKM_sk_dup +( +ASN1_INTEGER +, st) + + ) + +290 + #sk_ASN1_INTEGER_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +ASN1_INTEGER +, (�), (�_func)) + + ) + +291 + #sk_ASN1_INTEGER_shi� +( +� +� + `SKM_sk_shi� +( +ASN1_INTEGER +, (�)) + + ) + +292 + #sk_ASN1_INTEGER_p� +( +� +� + `SKM_sk_p� +( +ASN1_INTEGER +, (�)) + + ) + +293 + #sk_ASN1_INTEGER_s�t +( +� +� + `SKM_sk_s�t +( +ASN1_INTEGER +, (�)) + + ) + +294 + #sk_ASN1_INTEGER_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +ASN1_INTEGER +, (�)) + + ) + +296 + #sk_ASN1_OBJECT_�w +( +cmp +� + `SKM_sk_�w +( +ASN1_OBJECT +, (cmp)) + + ) + +297 + #sk_ASN1_OBJECT_�w_nu� +(� + `SKM_sk_�w_nu� +( +ASN1_OBJECT +) + + ) + +298 + #sk_ASN1_OBJECT_� +( +� +� + `SKM_sk_� +( +ASN1_OBJECT +, (�)) + + ) + +299 + #sk_ASN1_OBJECT_num +( +� +� + `SKM_sk_num +( +ASN1_OBJECT +, (�)) + + ) + +300 + #sk_ASN1_OBJECT_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +ASN1_OBJECT +, (�), (i)) + + ) + +301 + #sk_ASN1_OBJECT_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +ASN1_OBJECT +, (�), (i), (v�)) + + ) + +302 + #sk_ASN1_OBJECT_z�o +( +� +� + `SKM_sk_z�o +( +ASN1_OBJECT +, (�)) + + ) + +303 + #sk_ASN1_OBJECT_push +( +� +, +v� +� + `SKM_sk_push +( +ASN1_OBJECT +, (�), (v�)) + + ) + +304 + #sk_ASN1_OBJECT_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +ASN1_OBJECT +, (�), (v�)) + + ) + +305 + #sk_ASN1_OBJECT_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +ASN1_OBJECT +, (�), (v�)) + + ) + +306 + #sk_ASN1_OBJECT_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +ASN1_OBJECT +, (�), (v�)) + + ) + +307 + #sk_ASN1_OBJECT_d��e +( +� +, +i +� + `SKM_sk_d��e +( +ASN1_OBJECT +, (�), (i)) + + ) + +308 + #sk_ASN1_OBJECT_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +ASN1_OBJECT +, (�), (�r)) + + ) + +309 + #sk_ASN1_OBJECT_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +ASN1_OBJECT +, (�), (v�), (i)) + + ) + +310 + #sk_ASN1_OBJECT_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +ASN1_OBJECT +, (�), (cmp)) + + ) + +311 + #sk_ASN1_OBJECT_dup +( +� +� + `SKM_sk_dup +( +ASN1_OBJECT +, st) + + ) + +312 + #sk_ASN1_OBJECT_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +ASN1_OBJECT +, (�), (�_func)) + + ) + +313 + #sk_ASN1_OBJECT_shi� +( +� +� + `SKM_sk_shi� +( +ASN1_OBJECT +, (�)) + + ) + +314 + #sk_ASN1_OBJECT_p� +( +� +� + `SKM_sk_p� +( +ASN1_OBJECT +, (�)) + + ) + +315 + #sk_ASN1_OBJECT_s�t +( +� +� + `SKM_sk_s�t +( +ASN1_OBJECT +, (�)) + + ) + +316 + #sk_ASN1_OBJECT_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +ASN1_OBJECT +, (�)) + + ) + +318 + #sk_ASN1_STRING_TABLE_�w +( +cmp +� + `SKM_sk_�w +( +ASN1_STRING_TABLE +, (cmp)) + + ) + +319 + #sk_ASN1_STRING_TABLE_�w_nu� +(� + `SKM_sk_�w_nu� +( +ASN1_STRING_TABLE +) + + ) + +320 + #sk_ASN1_STRING_TABLE_� +( +� +� + `SKM_sk_� +( +ASN1_STRING_TABLE +, (�)) + + ) + +321 + #sk_ASN1_STRING_TABLE_num +( +� +� + `SKM_sk_num +( +ASN1_STRING_TABLE +, (�)) + + ) + +322 + #sk_ASN1_STRING_TABLE_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +ASN1_STRING_TABLE +, (�), (i)) + + ) + +323 + #sk_ASN1_STRING_TABLE_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +ASN1_STRING_TABLE +, (�), (i), (v�)) + + ) + +324 + #sk_ASN1_STRING_TABLE_z�o +( +� +� + `SKM_sk_z�o +( +ASN1_STRING_TABLE +, (�)) + + ) + +325 + #sk_ASN1_STRING_TABLE_push +( +� +, +v� +� + `SKM_sk_push +( +ASN1_STRING_TABLE +, (�), (v�)) + + ) + +326 + #sk_ASN1_STRING_TABLE_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +ASN1_STRING_TABLE +, (�), (v�)) + + ) + +327 + #sk_ASN1_STRING_TABLE_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +ASN1_STRING_TABLE +, (�), (v�)) + + ) + +328 + #sk_ASN1_STRING_TABLE_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +ASN1_STRING_TABLE +, (�), (v�)) + + ) + +329 + #sk_ASN1_STRING_TABLE_d��e +( +� +, +i +� + `SKM_sk_d��e +( +ASN1_STRING_TABLE +, (�), (i)) + + ) + +330 + #sk_ASN1_STRING_TABLE_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +ASN1_STRING_TABLE +, (�), (�r)) + + ) + +331 + #sk_ASN1_STRING_TABLE_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +ASN1_STRING_TABLE +, (�), (v�), (i)) + + ) + +332 + #sk_ASN1_STRING_TABLE_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +ASN1_STRING_TABLE +, (�), (cmp)) + + ) + +333 + #sk_ASN1_STRING_TABLE_dup +( +� +� + `SKM_sk_dup +( +ASN1_STRING_TABLE +, st) + + ) + +334 + #sk_ASN1_STRING_TABLE_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +ASN1_STRING_TABLE +, (�), (�_func)) + + ) + +335 + #sk_ASN1_STRING_TABLE_shi� +( +� +� + `SKM_sk_shi� +( +ASN1_STRING_TABLE +, (�)) + + ) + +336 + #sk_ASN1_STRING_TABLE_p� +( +� +� + `SKM_sk_p� +( +ASN1_STRING_TABLE +, (�)) + + ) + +337 + #sk_ASN1_STRING_TABLE_s�t +( +� +� + `SKM_sk_s�t +( +ASN1_STRING_TABLE +, (�)) + + ) + +338 + #sk_ASN1_STRING_TABLE_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +ASN1_STRING_TABLE +, (�)) + + ) + +340 + #sk_ASN1_TYPE_�w +( +cmp +� + `SKM_sk_�w +( +ASN1_TYPE +, (cmp)) + + ) + +341 + #sk_ASN1_TYPE_�w_nu� +(� + `SKM_sk_�w_nu� +( +ASN1_TYPE +) + + ) + +342 + #sk_ASN1_TYPE_� +( +� +� + `SKM_sk_� +( +ASN1_TYPE +, (�)) + + ) + +343 + #sk_ASN1_TYPE_num +( +� +� + `SKM_sk_num +( +ASN1_TYPE +, (�)) + + ) + +344 + #sk_ASN1_TYPE_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +ASN1_TYPE +, (�), (i)) + + ) + +345 + #sk_ASN1_TYPE_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +ASN1_TYPE +, (�), (i), (v�)) + + ) + +346 + #sk_ASN1_TYPE_z�o +( +� +� + `SKM_sk_z�o +( +ASN1_TYPE +, (�)) + + ) + +347 + #sk_ASN1_TYPE_push +( +� +, +v� +� + `SKM_sk_push +( +ASN1_TYPE +, (�), (v�)) + + ) + +348 + #sk_ASN1_TYPE_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +ASN1_TYPE +, (�), (v�)) + + ) + +349 + #sk_ASN1_TYPE_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +ASN1_TYPE +, (�), (v�)) + + ) + +350 + #sk_ASN1_TYPE_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +ASN1_TYPE +, (�), (v�)) + + ) + +351 + #sk_ASN1_TYPE_d��e +( +� +, +i +� + `SKM_sk_d��e +( +ASN1_TYPE +, (�), (i)) + + ) + +352 + #sk_ASN1_TYPE_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +ASN1_TYPE +, (�), (�r)) + + ) + +353 + #sk_ASN1_TYPE_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +ASN1_TYPE +, (�), (v�), (i)) + + ) + +354 + #sk_ASN1_TYPE_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +ASN1_TYPE +, (�), (cmp)) + + ) + +355 + #sk_ASN1_TYPE_dup +( +� +� + `SKM_sk_dup +( +ASN1_TYPE +, st) + + ) + +356 + #sk_ASN1_TYPE_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +ASN1_TYPE +, (�), (�_func)) + + ) + +357 + #sk_ASN1_TYPE_shi� +( +� +� + `SKM_sk_shi� +( +ASN1_TYPE +, (�)) + + ) + +358 + #sk_ASN1_TYPE_p� +( +� +� + `SKM_sk_p� +( +ASN1_TYPE +, (�)) + + ) + +359 + #sk_ASN1_TYPE_s�t +( +� +� + `SKM_sk_s�t +( +ASN1_TYPE +, (�)) + + ) + +360 + #sk_ASN1_TYPE_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +ASN1_TYPE +, (�)) + + ) + +362 + #sk_ASN1_UTF8STRING_�w +( +cmp +� + `SKM_sk_�w +( +ASN1_UTF8STRING +, (cmp)) + + ) + +363 + #sk_ASN1_UTF8STRING_�w_nu� +(� + `SKM_sk_�w_nu� +( +ASN1_UTF8STRING +) + + ) + +364 + #sk_ASN1_UTF8STRING_� +( +� +� + `SKM_sk_� +( +ASN1_UTF8STRING +, (�)) + + ) + +365 + #sk_ASN1_UTF8STRING_num +( +� +� + `SKM_sk_num +( +ASN1_UTF8STRING +, (�)) + + ) + +366 + #sk_ASN1_UTF8STRING_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +ASN1_UTF8STRING +, (�), (i)) + + ) + +367 + #sk_ASN1_UTF8STRING_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +ASN1_UTF8STRING +, (�), (i), (v�)) + + ) + +368 + #sk_ASN1_UTF8STRING_z�o +( +� +� + `SKM_sk_z�o +( +ASN1_UTF8STRING +, (�)) + + ) + +369 + #sk_ASN1_UTF8STRING_push +( +� +, +v� +� + `SKM_sk_push +( +ASN1_UTF8STRING +, (�), (v�)) + + ) + +370 + #sk_ASN1_UTF8STRING_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +ASN1_UTF8STRING +, (�), (v�)) + + ) + +371 + #sk_ASN1_UTF8STRING_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +ASN1_UTF8STRING +, (�), (v�)) + + ) + +372 + #sk_ASN1_UTF8STRING_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +ASN1_UTF8STRING +, (�), (v�)) + + ) + +373 + #sk_ASN1_UTF8STRING_d��e +( +� +, +i +� + `SKM_sk_d��e +( +ASN1_UTF8STRING +, (�), (i)) + + ) + +374 + #sk_ASN1_UTF8STRING_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +ASN1_UTF8STRING +, (�), (�r)) + + ) + +375 + #sk_ASN1_UTF8STRING_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +ASN1_UTF8STRING +, (�), (v�), (i)) + + ) + +376 + #sk_ASN1_UTF8STRING_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +ASN1_UTF8STRING +, (�), (cmp)) + + ) + +377 + #sk_ASN1_UTF8STRING_dup +( +� +� + `SKM_sk_dup +( +ASN1_UTF8STRING +, st) + + ) + +378 + #sk_ASN1_UTF8STRING_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +ASN1_UTF8STRING +, (�), (�_func)) + + ) + +379 + #sk_ASN1_UTF8STRING_shi� +( +� +� + `SKM_sk_shi� +( +ASN1_UTF8STRING +, (�)) + + ) + +380 + #sk_ASN1_UTF8STRING_p� +( +� +� + `SKM_sk_p� +( +ASN1_UTF8STRING +, (�)) + + ) + +381 + #sk_ASN1_UTF8STRING_s�t +( +� +� + `SKM_sk_s�t +( +ASN1_UTF8STRING +, (�)) + + ) + +382 + #sk_ASN1_UTF8STRING_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +ASN1_UTF8STRING +, (�)) + + ) + +384 + #sk_ASN1_VALUE_�w +( +cmp +� + `SKM_sk_�w +( +ASN1_VALUE +, (cmp)) + + ) + +385 + #sk_ASN1_VALUE_�w_nu� +(� + `SKM_sk_�w_nu� +( +ASN1_VALUE +) + + ) + +386 + #sk_ASN1_VALUE_� +( +� +� + `SKM_sk_� +( +ASN1_VALUE +, (�)) + + ) + +387 + #sk_ASN1_VALUE_num +( +� +� + `SKM_sk_num +( +ASN1_VALUE +, (�)) + + ) + +388 + #sk_ASN1_VALUE_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +ASN1_VALUE +, (�), (i)) + + ) + +389 + #sk_ASN1_VALUE_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +ASN1_VALUE +, (�), (i), (v�)) + + ) + +390 + #sk_ASN1_VALUE_z�o +( +� +� + `SKM_sk_z�o +( +ASN1_VALUE +, (�)) + + ) + +391 + #sk_ASN1_VALUE_push +( +� +, +v� +� + `SKM_sk_push +( +ASN1_VALUE +, (�), (v�)) + + ) + +392 + #sk_ASN1_VALUE_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +ASN1_VALUE +, (�), (v�)) + + ) + +393 + #sk_ASN1_VALUE_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +ASN1_VALUE +, (�), (v�)) + + ) + +394 + #sk_ASN1_VALUE_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +ASN1_VALUE +, (�), (v�)) + + ) + +395 + #sk_ASN1_VALUE_d��e +( +� +, +i +� + `SKM_sk_d��e +( +ASN1_VALUE +, (�), (i)) + + ) + +396 + #sk_ASN1_VALUE_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +ASN1_VALUE +, (�), (�r)) + + ) + +397 + #sk_ASN1_VALUE_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +ASN1_VALUE +, (�), (v�), (i)) + + ) + +398 + #sk_ASN1_VALUE_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +ASN1_VALUE +, (�), (cmp)) + + ) + +399 + #sk_ASN1_VALUE_dup +( +� +� + `SKM_sk_dup +( +ASN1_VALUE +, st) + + ) + +400 + #sk_ASN1_VALUE_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +ASN1_VALUE +, (�), (�_func)) + + ) + +401 + #sk_ASN1_VALUE_shi� +( +� +� + `SKM_sk_shi� +( +ASN1_VALUE +, (�)) + + ) + +402 + #sk_ASN1_VALUE_p� +( +� +� + `SKM_sk_p� +( +ASN1_VALUE +, (�)) + + ) + +403 + #sk_ASN1_VALUE_s�t +( +� +� + `SKM_sk_s�t +( +ASN1_VALUE +, (�)) + + ) + +404 + #sk_ASN1_VALUE_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +ASN1_VALUE +, (�)) + + ) + +406 + #sk_BIO_�w +( +cmp +� + `SKM_sk_�w +( +BIO +, (cmp)) + + ) + +407 + #sk_BIO_�w_nu� +(� + `SKM_sk_�w_nu� +( +BIO +) + + ) + +408 + #sk_BIO_� +( +� +� + `SKM_sk_� +( +BIO +, (�)) + + ) + +409 + #sk_BIO_num +( +� +� + `SKM_sk_num +( +BIO +, (�)) + + ) + +410 + #sk_BIO_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +BIO +, (�), (i)) + + ) + +411 + #sk_BIO_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +BIO +, (�), (i), (v�)) + + ) + +412 + #sk_BIO_z�o +( +� +� + `SKM_sk_z�o +( +BIO +, (�)) + + ) + +413 + #sk_BIO_push +( +� +, +v� +� + `SKM_sk_push +( +BIO +, (�), (v�)) + + ) + +414 + #sk_BIO_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +BIO +, (�), (v�)) + + ) + +415 + #sk_BIO_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +BIO +, (�), (v�)) + + ) + +416 + #sk_BIO_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +BIO +, (�), (v�)) + + ) + +417 + #sk_BIO_d��e +( +� +, +i +� + `SKM_sk_d��e +( +BIO +, (�), (i)) + + ) + +418 + #sk_BIO_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +BIO +, (�), (�r)) + + ) + +419 + #sk_BIO_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +BIO +, (�), (v�), (i)) + + ) + +420 + #sk_BIO_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +BIO +, (�), (cmp)) + + ) + +421 + #sk_BIO_dup +( +� +� + `SKM_sk_dup +( +BIO +, st) + + ) + +422 + #sk_BIO_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +BIO +, (�), (�_func)) + + ) + +423 + #sk_BIO_shi� +( +� +� + `SKM_sk_shi� +( +BIO +, (�)) + + ) + +424 + #sk_BIO_p� +( +� +� + `SKM_sk_p� +( +BIO +, (�)) + + ) + +425 + #sk_BIO_s�t +( +� +� + `SKM_sk_s�t +( +BIO +, (�)) + + ) + +426 + #sk_BIO_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +BIO +, (�)) + + ) + +428 + #sk_BY_DIR_ENTRY_�w +( +cmp +� + `SKM_sk_�w +( +BY_DIR_ENTRY +, (cmp)) + + ) + +429 + #sk_BY_DIR_ENTRY_�w_nu� +(� + `SKM_sk_�w_nu� +( +BY_DIR_ENTRY +) + + ) + +430 + #sk_BY_DIR_ENTRY_� +( +� +� + `SKM_sk_� +( +BY_DIR_ENTRY +, (�)) + + ) + +431 + #sk_BY_DIR_ENTRY_num +( +� +� + `SKM_sk_num +( +BY_DIR_ENTRY +, (�)) + + ) + +432 + #sk_BY_DIR_ENTRY_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +BY_DIR_ENTRY +, (�), (i)) + + ) + +433 + #sk_BY_DIR_ENTRY_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +BY_DIR_ENTRY +, (�), (i), (v�)) + + ) + +434 + #sk_BY_DIR_ENTRY_z�o +( +� +� + `SKM_sk_z�o +( +BY_DIR_ENTRY +, (�)) + + ) + +435 + #sk_BY_DIR_ENTRY_push +( +� +, +v� +� + `SKM_sk_push +( +BY_DIR_ENTRY +, (�), (v�)) + + ) + +436 + #sk_BY_DIR_ENTRY_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +BY_DIR_ENTRY +, (�), (v�)) + + ) + +437 + #sk_BY_DIR_ENTRY_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +BY_DIR_ENTRY +, (�), (v�)) + + ) + +438 + #sk_BY_DIR_ENTRY_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +BY_DIR_ENTRY +, (�), (v�)) + + ) + +439 + #sk_BY_DIR_ENTRY_d��e +( +� +, +i +� + `SKM_sk_d��e +( +BY_DIR_ENTRY +, (�), (i)) + + ) + +440 + #sk_BY_DIR_ENTRY_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +BY_DIR_ENTRY +, (�), (�r)) + + ) + +441 + #sk_BY_DIR_ENTRY_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +BY_DIR_ENTRY +, (�), (v�), (i)) + + ) + +442 + #sk_BY_DIR_ENTRY_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +BY_DIR_ENTRY +, (�), (cmp)) + + ) + +443 + #sk_BY_DIR_ENTRY_dup +( +� +� + `SKM_sk_dup +( +BY_DIR_ENTRY +, st) + + ) + +444 + #sk_BY_DIR_ENTRY_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +BY_DIR_ENTRY +, (�), (�_func)) + + ) + +445 + #sk_BY_DIR_ENTRY_shi� +( +� +� + `SKM_sk_shi� +( +BY_DIR_ENTRY +, (�)) + + ) + +446 + #sk_BY_DIR_ENTRY_p� +( +� +� + `SKM_sk_p� +( +BY_DIR_ENTRY +, (�)) + + ) + +447 + #sk_BY_DIR_ENTRY_s�t +( +� +� + `SKM_sk_s�t +( +BY_DIR_ENTRY +, (�)) + + ) + +448 + #sk_BY_DIR_ENTRY_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +BY_DIR_ENTRY +, (�)) + + ) + +450 + #sk_BY_DIR_HASH_�w +( +cmp +� + `SKM_sk_�w +( +BY_DIR_HASH +, (cmp)) + + ) + +451 + #sk_BY_DIR_HASH_�w_nu� +(� + `SKM_sk_�w_nu� +( +BY_DIR_HASH +) + + ) + +452 + #sk_BY_DIR_HASH_� +( +� +� + `SKM_sk_� +( +BY_DIR_HASH +, (�)) + + ) + +453 + #sk_BY_DIR_HASH_num +( +� +� + `SKM_sk_num +( +BY_DIR_HASH +, (�)) + + ) + +454 + #sk_BY_DIR_HASH_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +BY_DIR_HASH +, (�), (i)) + + ) + +455 + #sk_BY_DIR_HASH_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +BY_DIR_HASH +, (�), (i), (v�)) + + ) + +456 + #sk_BY_DIR_HASH_z�o +( +� +� + `SKM_sk_z�o +( +BY_DIR_HASH +, (�)) + + ) + +457 + #sk_BY_DIR_HASH_push +( +� +, +v� +� + `SKM_sk_push +( +BY_DIR_HASH +, (�), (v�)) + + ) + +458 + #sk_BY_DIR_HASH_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +BY_DIR_HASH +, (�), (v�)) + + ) + +459 + #sk_BY_DIR_HASH_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +BY_DIR_HASH +, (�), (v�)) + + ) + +460 + #sk_BY_DIR_HASH_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +BY_DIR_HASH +, (�), (v�)) + + ) + +461 + #sk_BY_DIR_HASH_d��e +( +� +, +i +� + `SKM_sk_d��e +( +BY_DIR_HASH +, (�), (i)) + + ) + +462 + #sk_BY_DIR_HASH_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +BY_DIR_HASH +, (�), (�r)) + + ) + +463 + #sk_BY_DIR_HASH_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +BY_DIR_HASH +, (�), (v�), (i)) + + ) + +464 + #sk_BY_DIR_HASH_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +BY_DIR_HASH +, (�), (cmp)) + + ) + +465 + #sk_BY_DIR_HASH_dup +( +� +� + `SKM_sk_dup +( +BY_DIR_HASH +, st) + + ) + +466 + #sk_BY_DIR_HASH_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +BY_DIR_HASH +, (�), (�_func)) + + ) + +467 + #sk_BY_DIR_HASH_shi� +( +� +� + `SKM_sk_shi� +( +BY_DIR_HASH +, (�)) + + ) + +468 + #sk_BY_DIR_HASH_p� +( +� +� + `SKM_sk_p� +( +BY_DIR_HASH +, (�)) + + ) + +469 + #sk_BY_DIR_HASH_s�t +( +� +� + `SKM_sk_s�t +( +BY_DIR_HASH +, (�)) + + ) + +470 + #sk_BY_DIR_HASH_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +BY_DIR_HASH +, (�)) + + ) + +472 + #sk_CMS_C�tifi��Choi�s_�w +( +cmp +� + `SKM_sk_�w +( +CMS_C�tifi��Choi�s +, (cmp)) + + ) + +473 + #sk_CMS_C�tifi��Choi�s_�w_nu� +(� + `SKM_sk_�w_nu� +( +CMS_C�tifi��Choi�s +) + + ) + +474 + #sk_CMS_C�tifi��Choi�s_� +( +� +� + `SKM_sk_� +( +CMS_C�tifi��Choi�s +, (�)) + + ) + +475 + #sk_CMS_C�tifi��Choi�s_num +( +� +� + `SKM_sk_num +( +CMS_C�tifi��Choi�s +, (�)) + + ) + +476 + #sk_CMS_C�tifi��Choi�s_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +CMS_C�tifi��Choi�s +, (�), (i)) + + ) + +477 + #sk_CMS_C�tifi��Choi�s_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +CMS_C�tifi��Choi�s +, (�), (i), (v�)) + + ) + +478 + #sk_CMS_C�tifi��Choi�s_z�o +( +� +� + `SKM_sk_z�o +( +CMS_C�tifi��Choi�s +, (�)) + + ) + +479 + #sk_CMS_C�tifi��Choi�s_push +( +� +, +v� +� + `SKM_sk_push +( +CMS_C�tifi��Choi�s +, (�), (v�)) + + ) + +480 + #sk_CMS_C�tifi��Choi�s_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +CMS_C�tifi��Choi�s +, (�), (v�)) + + ) + +481 + #sk_CMS_C�tifi��Choi�s_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +CMS_C�tifi��Choi�s +, (�), (v�)) + + ) + +482 + #sk_CMS_C�tifi��Choi�s_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +CMS_C�tifi��Choi�s +, (�), (v�)) + + ) + +483 + #sk_CMS_C�tifi��Choi�s_d��e +( +� +, +i +� + `SKM_sk_d��e +( +CMS_C�tifi��Choi�s +, (�), (i)) + + ) + +484 + #sk_CMS_C�tifi��Choi�s_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +CMS_C�tifi��Choi�s +, (�), (�r)) + + ) + +485 + #sk_CMS_C�tifi��Choi�s_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +CMS_C�tifi��Choi�s +, (�), (v�), (i)) + + ) + +486 + #sk_CMS_C�tifi��Choi�s_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +CMS_C�tifi��Choi�s +, (�), (cmp)) + + ) + +487 + #sk_CMS_C�tifi��Choi�s_dup +( +� +� + `SKM_sk_dup +( +CMS_C�tifi��Choi�s +, st) + + ) + +488 + #sk_CMS_C�tifi��Choi�s_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +CMS_C�tifi��Choi�s +, (�), (�_func)) + + ) + +489 + #sk_CMS_C�tifi��Choi�s_shi� +( +� +� + `SKM_sk_shi� +( +CMS_C�tifi��Choi�s +, (�)) + + ) + +490 + #sk_CMS_C�tifi��Choi�s_p� +( +� +� + `SKM_sk_p� +( +CMS_C�tifi��Choi�s +, (�)) + + ) + +491 + #sk_CMS_C�tifi��Choi�s_s�t +( +� +� + `SKM_sk_s�t +( +CMS_C�tifi��Choi�s +, (�)) + + ) + +492 + #sk_CMS_C�tifi��Choi�s_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +CMS_C�tifi��Choi�s +, (�)) + + ) + +494 + #sk_CMS_Rec���Info_�w +( +cmp +� + `SKM_sk_�w +( +CMS_Rec���Info +, (cmp)) + + ) + +495 + #sk_CMS_Rec���Info_�w_nu� +(� + `SKM_sk_�w_nu� +( +CMS_Rec���Info +) + + ) + +496 + #sk_CMS_Rec���Info_� +( +� +� + `SKM_sk_� +( +CMS_Rec���Info +, (�)) + + ) + +497 + #sk_CMS_Rec���Info_num +( +� +� + `SKM_sk_num +( +CMS_Rec���Info +, (�)) + + ) + +498 + #sk_CMS_Rec���Info_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +CMS_Rec���Info +, (�), (i)) + + ) + +499 + #sk_CMS_Rec���Info_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +CMS_Rec���Info +, (�), (i), (v�)) + + ) + +500 + #sk_CMS_Rec���Info_z�o +( +� +� + `SKM_sk_z�o +( +CMS_Rec���Info +, (�)) + + ) + +501 + #sk_CMS_Rec���Info_push +( +� +, +v� +� + `SKM_sk_push +( +CMS_Rec���Info +, (�), (v�)) + + ) + +502 + #sk_CMS_Rec���Info_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +CMS_Rec���Info +, (�), (v�)) + + ) + +503 + #sk_CMS_Rec���Info_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +CMS_Rec���Info +, (�), (v�)) + + ) + +504 + #sk_CMS_Rec���Info_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +CMS_Rec���Info +, (�), (v�)) + + ) + +505 + #sk_CMS_Rec���Info_d��e +( +� +, +i +� + `SKM_sk_d��e +( +CMS_Rec���Info +, (�), (i)) + + ) + +506 + #sk_CMS_Rec���Info_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +CMS_Rec���Info +, (�), (�r)) + + ) + +507 + #sk_CMS_Rec���Info_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +CMS_Rec���Info +, (�), (v�), (i)) + + ) + +508 + #sk_CMS_Rec���Info_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +CMS_Rec���Info +, (�), (cmp)) + + ) + +509 + #sk_CMS_Rec���Info_dup +( +� +� + `SKM_sk_dup +( +CMS_Rec���Info +, st) + + ) + +510 + #sk_CMS_Rec���Info_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +CMS_Rec���Info +, (�), (�_func)) + + ) + +511 + #sk_CMS_Rec���Info_shi� +( +� +� + `SKM_sk_shi� +( +CMS_Rec���Info +, (�)) + + ) + +512 + #sk_CMS_Rec���Info_p� +( +� +� + `SKM_sk_p� +( +CMS_Rec���Info +, (�)) + + ) + +513 + #sk_CMS_Rec���Info_s�t +( +� +� + `SKM_sk_s�t +( +CMS_Rec���Info +, (�)) + + ) + +514 + #sk_CMS_Rec���Info_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +CMS_Rec���Info +, (�)) + + ) + +516 + #sk_CMS_Revo�ti�InfoChoi�_�w +( +cmp +� + `SKM_sk_�w +( +CMS_Revo�ti�InfoChoi� +, (cmp)) + + ) + +517 + #sk_CMS_Revo�ti�InfoChoi�_�w_nu� +(� + `SKM_sk_�w_nu� +( +CMS_Revo�ti�InfoChoi� +) + + ) + +518 + #sk_CMS_Revo�ti�InfoChoi�_� +( +� +� + `SKM_sk_� +( +CMS_Revo�ti�InfoChoi� +, (�)) + + ) + +519 + #sk_CMS_Revo�ti�InfoChoi�_num +( +� +� + `SKM_sk_num +( +CMS_Revo�ti�InfoChoi� +, (�)) + + ) + +520 + #sk_CMS_Revo�ti�InfoChoi�_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +CMS_Revo�ti�InfoChoi� +, (�), (i)) + + ) + +521 + #sk_CMS_Revo�ti�InfoChoi�_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +CMS_Revo�ti�InfoChoi� +, (�), (i), (v�)) + + ) + +522 + #sk_CMS_Revo�ti�InfoChoi�_z�o +( +� +� + `SKM_sk_z�o +( +CMS_Revo�ti�InfoChoi� +, (�)) + + ) + +523 + #sk_CMS_Revo�ti�InfoChoi�_push +( +� +, +v� +� + `SKM_sk_push +( +CMS_Revo�ti�InfoChoi� +, (�), (v�)) + + ) + +524 + #sk_CMS_Revo�ti�InfoChoi�_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +CMS_Revo�ti�InfoChoi� +, (�), (v�)) + + ) + +525 + #sk_CMS_Revo�ti�InfoChoi�_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +CMS_Revo�ti�InfoChoi� +, (�), (v�)) + + ) + +526 + #sk_CMS_Revo�ti�InfoChoi�_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +CMS_Revo�ti�InfoChoi� +, (�), (v�)) + + ) + +527 + #sk_CMS_Revo�ti�InfoChoi�_d��e +( +� +, +i +� + `SKM_sk_d��e +( +CMS_Revo�ti�InfoChoi� +, (�), (i)) + + ) + +528 + #sk_CMS_Revo�ti�InfoChoi�_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +CMS_Revo�ti�InfoChoi� +, (�), (�r)) + + ) + +529 + #sk_CMS_Revo�ti�InfoChoi�_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +CMS_Revo�ti�InfoChoi� +, (�), (v�), (i)) + + ) + +530 + #sk_CMS_Revo�ti�InfoChoi�_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +CMS_Revo�ti�InfoChoi� +, (�), (cmp)) + + ) + +531 + #sk_CMS_Revo�ti�InfoChoi�_dup +( +� +� + `SKM_sk_dup +( +CMS_Revo�ti�InfoChoi� +, st) + + ) + +532 + #sk_CMS_Revo�ti�InfoChoi�_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +CMS_Revo�ti�InfoChoi� +, (�), (�_func)) + + ) + +533 + #sk_CMS_Revo�ti�InfoChoi�_shi� +( +� +� + `SKM_sk_shi� +( +CMS_Revo�ti�InfoChoi� +, (�)) + + ) + +534 + #sk_CMS_Revo�ti�InfoChoi�_p� +( +� +� + `SKM_sk_p� +( +CMS_Revo�ti�InfoChoi� +, (�)) + + ) + +535 + #sk_CMS_Revo�ti�InfoChoi�_s�t +( +� +� + `SKM_sk_s�t +( +CMS_Revo�ti�InfoChoi� +, (�)) + + ) + +536 + #sk_CMS_Revo�ti�InfoChoi�_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +CMS_Revo�ti�InfoChoi� +, (�)) + + ) + +538 + #sk_CMS_Sig�rInfo_�w +( +cmp +� + `SKM_sk_�w +( +CMS_Sig�rInfo +, (cmp)) + + ) + +539 + #sk_CMS_Sig�rInfo_�w_nu� +(� + `SKM_sk_�w_nu� +( +CMS_Sig�rInfo +) + + ) + +540 + #sk_CMS_Sig�rInfo_� +( +� +� + `SKM_sk_� +( +CMS_Sig�rInfo +, (�)) + + ) + +541 + #sk_CMS_Sig�rInfo_num +( +� +� + `SKM_sk_num +( +CMS_Sig�rInfo +, (�)) + + ) + +542 + #sk_CMS_Sig�rInfo_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +CMS_Sig�rInfo +, (�), (i)) + + ) + +543 + #sk_CMS_Sig�rInfo_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +CMS_Sig�rInfo +, (�), (i), (v�)) + + ) + +544 + #sk_CMS_Sig�rInfo_z�o +( +� +� + `SKM_sk_z�o +( +CMS_Sig�rInfo +, (�)) + + ) + +545 + #sk_CMS_Sig�rInfo_push +( +� +, +v� +� + `SKM_sk_push +( +CMS_Sig�rInfo +, (�), (v�)) + + ) + +546 + #sk_CMS_Sig�rInfo_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +CMS_Sig�rInfo +, (�), (v�)) + + ) + +547 + #sk_CMS_Sig�rInfo_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +CMS_Sig�rInfo +, (�), (v�)) + + ) + +548 + #sk_CMS_Sig�rInfo_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +CMS_Sig�rInfo +, (�), (v�)) + + ) + +549 + #sk_CMS_Sig�rInfo_d��e +( +� +, +i +� + `SKM_sk_d��e +( +CMS_Sig�rInfo +, (�), (i)) + + ) + +550 + #sk_CMS_Sig�rInfo_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +CMS_Sig�rInfo +, (�), (�r)) + + ) + +551 + #sk_CMS_Sig�rInfo_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +CMS_Sig�rInfo +, (�), (v�), (i)) + + ) + +552 + #sk_CMS_Sig�rInfo_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +CMS_Sig�rInfo +, (�), (cmp)) + + ) + +553 + #sk_CMS_Sig�rInfo_dup +( +� +� + `SKM_sk_dup +( +CMS_Sig�rInfo +, st) + + ) + +554 + #sk_CMS_Sig�rInfo_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +CMS_Sig�rInfo +, (�), (�_func)) + + ) + +555 + #sk_CMS_Sig�rInfo_shi� +( +� +� + `SKM_sk_shi� +( +CMS_Sig�rInfo +, (�)) + + ) + +556 + #sk_CMS_Sig�rInfo_p� +( +� +� + `SKM_sk_p� +( +CMS_Sig�rInfo +, (�)) + + ) + +557 + #sk_CMS_Sig�rInfo_s�t +( +� +� + `SKM_sk_s�t +( +CMS_Sig�rInfo +, (�)) + + ) + +558 + #sk_CMS_Sig�rInfo_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +CMS_Sig�rInfo +, (�)) + + ) + +560 + #sk_CONF_IMODULE_�w +( +cmp +� + `SKM_sk_�w +( +CONF_IMODULE +, (cmp)) + + ) + +561 + #sk_CONF_IMODULE_�w_nu� +(� + `SKM_sk_�w_nu� +( +CONF_IMODULE +) + + ) + +562 + #sk_CONF_IMODULE_� +( +� +� + `SKM_sk_� +( +CONF_IMODULE +, (�)) + + ) + +563 + #sk_CONF_IMODULE_num +( +� +� + `SKM_sk_num +( +CONF_IMODULE +, (�)) + + ) + +564 + #sk_CONF_IMODULE_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +CONF_IMODULE +, (�), (i)) + + ) + +565 + #sk_CONF_IMODULE_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +CONF_IMODULE +, (�), (i), (v�)) + + ) + +566 + #sk_CONF_IMODULE_z�o +( +� +� + `SKM_sk_z�o +( +CONF_IMODULE +, (�)) + + ) + +567 + #sk_CONF_IMODULE_push +( +� +, +v� +� + `SKM_sk_push +( +CONF_IMODULE +, (�), (v�)) + + ) + +568 + #sk_CONF_IMODULE_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +CONF_IMODULE +, (�), (v�)) + + ) + +569 + #sk_CONF_IMODULE_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +CONF_IMODULE +, (�), (v�)) + + ) + +570 + #sk_CONF_IMODULE_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +CONF_IMODULE +, (�), (v�)) + + ) + +571 + #sk_CONF_IMODULE_d��e +( +� +, +i +� + `SKM_sk_d��e +( +CONF_IMODULE +, (�), (i)) + + ) + +572 + #sk_CONF_IMODULE_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +CONF_IMODULE +, (�), (�r)) + + ) + +573 + #sk_CONF_IMODULE_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +CONF_IMODULE +, (�), (v�), (i)) + + ) + +574 + #sk_CONF_IMODULE_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +CONF_IMODULE +, (�), (cmp)) + + ) + +575 + #sk_CONF_IMODULE_dup +( +� +� + `SKM_sk_dup +( +CONF_IMODULE +, st) + + ) + +576 + #sk_CONF_IMODULE_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +CONF_IMODULE +, (�), (�_func)) + + ) + +577 + #sk_CONF_IMODULE_shi� +( +� +� + `SKM_sk_shi� +( +CONF_IMODULE +, (�)) + + ) + +578 + #sk_CONF_IMODULE_p� +( +� +� + `SKM_sk_p� +( +CONF_IMODULE +, (�)) + + ) + +579 + #sk_CONF_IMODULE_s�t +( +� +� + `SKM_sk_s�t +( +CONF_IMODULE +, (�)) + + ) + +580 + #sk_CONF_IMODULE_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +CONF_IMODULE +, (�)) + + ) + +582 + #sk_CONF_MODULE_�w +( +cmp +� + `SKM_sk_�w +( +CONF_MODULE +, (cmp)) + + ) + +583 + #sk_CONF_MODULE_�w_nu� +(� + `SKM_sk_�w_nu� +( +CONF_MODULE +) + + ) + +584 + #sk_CONF_MODULE_� +( +� +� + `SKM_sk_� +( +CONF_MODULE +, (�)) + + ) + +585 + #sk_CONF_MODULE_num +( +� +� + `SKM_sk_num +( +CONF_MODULE +, (�)) + + ) + +586 + #sk_CONF_MODULE_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +CONF_MODULE +, (�), (i)) + + ) + +587 + #sk_CONF_MODULE_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +CONF_MODULE +, (�), (i), (v�)) + + ) + +588 + #sk_CONF_MODULE_z�o +( +� +� + `SKM_sk_z�o +( +CONF_MODULE +, (�)) + + ) + +589 + #sk_CONF_MODULE_push +( +� +, +v� +� + `SKM_sk_push +( +CONF_MODULE +, (�), (v�)) + + ) + +590 + #sk_CONF_MODULE_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +CONF_MODULE +, (�), (v�)) + + ) + +591 + #sk_CONF_MODULE_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +CONF_MODULE +, (�), (v�)) + + ) + +592 + #sk_CONF_MODULE_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +CONF_MODULE +, (�), (v�)) + + ) + +593 + #sk_CONF_MODULE_d��e +( +� +, +i +� + `SKM_sk_d��e +( +CONF_MODULE +, (�), (i)) + + ) + +594 + #sk_CONF_MODULE_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +CONF_MODULE +, (�), (�r)) + + ) + +595 + #sk_CONF_MODULE_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +CONF_MODULE +, (�), (v�), (i)) + + ) + +596 + #sk_CONF_MODULE_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +CONF_MODULE +, (�), (cmp)) + + ) + +597 + #sk_CONF_MODULE_dup +( +� +� + `SKM_sk_dup +( +CONF_MODULE +, st) + + ) + +598 + #sk_CONF_MODULE_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +CONF_MODULE +, (�), (�_func)) + + ) + +599 + #sk_CONF_MODULE_shi� +( +� +� + `SKM_sk_shi� +( +CONF_MODULE +, (�)) + + ) + +600 + #sk_CONF_MODULE_p� +( +� +� + `SKM_sk_p� +( +CONF_MODULE +, (�)) + + ) + +601 + #sk_CONF_MODULE_s�t +( +� +� + `SKM_sk_s�t +( +CONF_MODULE +, (�)) + + ) + +602 + #sk_CONF_MODULE_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +CONF_MODULE +, (�)) + + ) + +604 + #sk_CONF_VALUE_�w +( +cmp +� + `SKM_sk_�w +( +CONF_VALUE +, (cmp)) + + ) + +605 + #sk_CONF_VALUE_�w_nu� +(� + `SKM_sk_�w_nu� +( +CONF_VALUE +) + + ) + +606 + #sk_CONF_VALUE_� +( +� +� + `SKM_sk_� +( +CONF_VALUE +, (�)) + + ) + +607 + #sk_CONF_VALUE_num +( +� +� + `SKM_sk_num +( +CONF_VALUE +, (�)) + + ) + +608 + #sk_CONF_VALUE_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +CONF_VALUE +, (�), (i)) + + ) + +609 + #sk_CONF_VALUE_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +CONF_VALUE +, (�), (i), (v�)) + + ) + +610 + #sk_CONF_VALUE_z�o +( +� +� + `SKM_sk_z�o +( +CONF_VALUE +, (�)) + + ) + +611 + #sk_CONF_VALUE_push +( +� +, +v� +� + `SKM_sk_push +( +CONF_VALUE +, (�), (v�)) + + ) + +612 + #sk_CONF_VALUE_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +CONF_VALUE +, (�), (v�)) + + ) + +613 + #sk_CONF_VALUE_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +CONF_VALUE +, (�), (v�)) + + ) + +614 + #sk_CONF_VALUE_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +CONF_VALUE +, (�), (v�)) + + ) + +615 + #sk_CONF_VALUE_d��e +( +� +, +i +� + `SKM_sk_d��e +( +CONF_VALUE +, (�), (i)) + + ) + +616 + #sk_CONF_VALUE_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +CONF_VALUE +, (�), (�r)) + + ) + +617 + #sk_CONF_VALUE_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +CONF_VALUE +, (�), (v�), (i)) + + ) + +618 + #sk_CONF_VALUE_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +CONF_VALUE +, (�), (cmp)) + + ) + +619 + #sk_CONF_VALUE_dup +( +� +� + `SKM_sk_dup +( +CONF_VALUE +, st) + + ) + +620 + #sk_CONF_VALUE_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +CONF_VALUE +, (�), (�_func)) + + ) + +621 + #sk_CONF_VALUE_shi� +( +� +� + `SKM_sk_shi� +( +CONF_VALUE +, (�)) + + ) + +622 + #sk_CONF_VALUE_p� +( +� +� + `SKM_sk_p� +( +CONF_VALUE +, (�)) + + ) + +623 + #sk_CONF_VALUE_s�t +( +� +� + `SKM_sk_s�t +( +CONF_VALUE +, (�)) + + ) + +624 + #sk_CONF_VALUE_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +CONF_VALUE +, (�)) + + ) + +626 + #sk_CRYPTO_EX_DATA_FUNCS_�w +( +cmp +� + `SKM_sk_�w +( +CRYPTO_EX_DATA_FUNCS +, (cmp)) + + ) + +627 + #sk_CRYPTO_EX_DATA_FUNCS_�w_nu� +(� + `SKM_sk_�w_nu� +( +CRYPTO_EX_DATA_FUNCS +) + + ) + +628 + #sk_CRYPTO_EX_DATA_FUNCS_� +( +� +� + `SKM_sk_� +( +CRYPTO_EX_DATA_FUNCS +, (�)) + + ) + +629 + #sk_CRYPTO_EX_DATA_FUNCS_num +( +� +� + `SKM_sk_num +( +CRYPTO_EX_DATA_FUNCS +, (�)) + + ) + +630 + #sk_CRYPTO_EX_DATA_FUNCS_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +CRYPTO_EX_DATA_FUNCS +, (�), (i)) + + ) + +631 + #sk_CRYPTO_EX_DATA_FUNCS_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +CRYPTO_EX_DATA_FUNCS +, (�), (i), (v�)) + + ) + +632 + #sk_CRYPTO_EX_DATA_FUNCS_z�o +( +� +� + `SKM_sk_z�o +( +CRYPTO_EX_DATA_FUNCS +, (�)) + + ) + +633 + #sk_CRYPTO_EX_DATA_FUNCS_push +( +� +, +v� +� + `SKM_sk_push +( +CRYPTO_EX_DATA_FUNCS +, (�), (v�)) + + ) + +634 + #sk_CRYPTO_EX_DATA_FUNCS_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +CRYPTO_EX_DATA_FUNCS +, (�), (v�)) + + ) + +635 + #sk_CRYPTO_EX_DATA_FUNCS_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +CRYPTO_EX_DATA_FUNCS +, (�), (v�)) + + ) + +636 + #sk_CRYPTO_EX_DATA_FUNCS_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +CRYPTO_EX_DATA_FUNCS +, (�), (v�)) + + ) + +637 + #sk_CRYPTO_EX_DATA_FUNCS_d��e +( +� +, +i +� + `SKM_sk_d��e +( +CRYPTO_EX_DATA_FUNCS +, (�), (i)) + + ) + +638 + #sk_CRYPTO_EX_DATA_FUNCS_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +CRYPTO_EX_DATA_FUNCS +, (�), (�r)) + + ) + +639 + #sk_CRYPTO_EX_DATA_FUNCS_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +CRYPTO_EX_DATA_FUNCS +, (�), (v�), (i)) + + ) + +640 + #sk_CRYPTO_EX_DATA_FUNCS_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +CRYPTO_EX_DATA_FUNCS +, (�), (cmp)) + + ) + +641 + #sk_CRYPTO_EX_DATA_FUNCS_dup +( +� +� + `SKM_sk_dup +( +CRYPTO_EX_DATA_FUNCS +, st) + + ) + +642 + #sk_CRYPTO_EX_DATA_FUNCS_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +CRYPTO_EX_DATA_FUNCS +, (�), (�_func)) + + ) + +643 + #sk_CRYPTO_EX_DATA_FUNCS_shi� +( +� +� + `SKM_sk_shi� +( +CRYPTO_EX_DATA_FUNCS +, (�)) + + ) + +644 + #sk_CRYPTO_EX_DATA_FUNCS_p� +( +� +� + `SKM_sk_p� +( +CRYPTO_EX_DATA_FUNCS +, (�)) + + ) + +645 + #sk_CRYPTO_EX_DATA_FUNCS_s�t +( +� +� + `SKM_sk_s�t +( +CRYPTO_EX_DATA_FUNCS +, (�)) + + ) + +646 + #sk_CRYPTO_EX_DATA_FUNCS_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +CRYPTO_EX_DATA_FUNCS +, (�)) + + ) + +648 + #sk_CRYPTO_dy�ock_�w +( +cmp +� + `SKM_sk_�w +( +CRYPTO_dy�ock +, (cmp)) + + ) + +649 + #sk_CRYPTO_dy�ock_�w_nu� +(� + `SKM_sk_�w_nu� +( +CRYPTO_dy�ock +) + + ) + +650 + #sk_CRYPTO_dy�ock_� +( +� +� + `SKM_sk_� +( +CRYPTO_dy�ock +, (�)) + + ) + +651 + #sk_CRYPTO_dy�ock_num +( +� +� + `SKM_sk_num +( +CRYPTO_dy�ock +, (�)) + + ) + +652 + #sk_CRYPTO_dy�ock_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +CRYPTO_dy�ock +, (�), (i)) + + ) + +653 + #sk_CRYPTO_dy�ock_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +CRYPTO_dy�ock +, (�), (i), (v�)) + + ) + +654 + #sk_CRYPTO_dy�ock_z�o +( +� +� + `SKM_sk_z�o +( +CRYPTO_dy�ock +, (�)) + + ) + +655 + #sk_CRYPTO_dy�ock_push +( +� +, +v� +� + `SKM_sk_push +( +CRYPTO_dy�ock +, (�), (v�)) + + ) + +656 + #sk_CRYPTO_dy�ock_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +CRYPTO_dy�ock +, (�), (v�)) + + ) + +657 + #sk_CRYPTO_dy�ock_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +CRYPTO_dy�ock +, (�), (v�)) + + ) + +658 + #sk_CRYPTO_dy�ock_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +CRYPTO_dy�ock +, (�), (v�)) + + ) + +659 + #sk_CRYPTO_dy�ock_d��e +( +� +, +i +� + `SKM_sk_d��e +( +CRYPTO_dy�ock +, (�), (i)) + + ) + +660 + #sk_CRYPTO_dy�ock_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +CRYPTO_dy�ock +, (�), (�r)) + + ) + +661 + #sk_CRYPTO_dy�ock_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +CRYPTO_dy�ock +, (�), (v�), (i)) + + ) + +662 + #sk_CRYPTO_dy�ock_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +CRYPTO_dy�ock +, (�), (cmp)) + + ) + +663 + #sk_CRYPTO_dy�ock_dup +( +� +� + `SKM_sk_dup +( +CRYPTO_dy�ock +, st) + + ) + +664 + #sk_CRYPTO_dy�ock_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +CRYPTO_dy�ock +, (�), (�_func)) + + ) + +665 + #sk_CRYPTO_dy�ock_shi� +( +� +� + `SKM_sk_shi� +( +CRYPTO_dy�ock +, (�)) + + ) + +666 + #sk_CRYPTO_dy�ock_p� +( +� +� + `SKM_sk_p� +( +CRYPTO_dy�ock +, (�)) + + ) + +667 + #sk_CRYPTO_dy�ock_s�t +( +� +� + `SKM_sk_s�t +( +CRYPTO_dy�ock +, (�)) + + ) + +668 + #sk_CRYPTO_dy�ock_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +CRYPTO_dy�ock +, (�)) + + ) + +670 + #sk_DIST_POINT_�w +( +cmp +� + `SKM_sk_�w +( +DIST_POINT +, (cmp)) + + ) + +671 + #sk_DIST_POINT_�w_nu� +(� + `SKM_sk_�w_nu� +( +DIST_POINT +) + + ) + +672 + #sk_DIST_POINT_� +( +� +� + `SKM_sk_� +( +DIST_POINT +, (�)) + + ) + +673 + #sk_DIST_POINT_num +( +� +� + `SKM_sk_num +( +DIST_POINT +, (�)) + + ) + +674 + #sk_DIST_POINT_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +DIST_POINT +, (�), (i)) + + ) + +675 + #sk_DIST_POINT_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +DIST_POINT +, (�), (i), (v�)) + + ) + +676 + #sk_DIST_POINT_z�o +( +� +� + `SKM_sk_z�o +( +DIST_POINT +, (�)) + + ) + +677 + #sk_DIST_POINT_push +( +� +, +v� +� + `SKM_sk_push +( +DIST_POINT +, (�), (v�)) + + ) + +678 + #sk_DIST_POINT_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +DIST_POINT +, (�), (v�)) + + ) + +679 + #sk_DIST_POINT_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +DIST_POINT +, (�), (v�)) + + ) + +680 + #sk_DIST_POINT_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +DIST_POINT +, (�), (v�)) + + ) + +681 + #sk_DIST_POINT_d��e +( +� +, +i +� + `SKM_sk_d��e +( +DIST_POINT +, (�), (i)) + + ) + +682 + #sk_DIST_POINT_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +DIST_POINT +, (�), (�r)) + + ) + +683 + #sk_DIST_POINT_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +DIST_POINT +, (�), (v�), (i)) + + ) + +684 + #sk_DIST_POINT_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +DIST_POINT +, (�), (cmp)) + + ) + +685 + #sk_DIST_POINT_dup +( +� +� + `SKM_sk_dup +( +DIST_POINT +, st) + + ) + +686 + #sk_DIST_POINT_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +DIST_POINT +, (�), (�_func)) + + ) + +687 + #sk_DIST_POINT_shi� +( +� +� + `SKM_sk_shi� +( +DIST_POINT +, (�)) + + ) + +688 + #sk_DIST_POINT_p� +( +� +� + `SKM_sk_p� +( +DIST_POINT +, (�)) + + ) + +689 + #sk_DIST_POINT_s�t +( +� +� + `SKM_sk_s�t +( +DIST_POINT +, (�)) + + ) + +690 + #sk_DIST_POINT_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +DIST_POINT +, (�)) + + ) + +692 + #sk_ENGINE_�w +( +cmp +� + `SKM_sk_�w +( +ENGINE +, (cmp)) + + ) + +693 + #sk_ENGINE_�w_nu� +(� + `SKM_sk_�w_nu� +( +ENGINE +) + + ) + +694 + #sk_ENGINE_� +( +� +� + `SKM_sk_� +( +ENGINE +, (�)) + + ) + +695 + #sk_ENGINE_num +( +� +� + `SKM_sk_num +( +ENGINE +, (�)) + + ) + +696 + #sk_ENGINE_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +ENGINE +, (�), (i)) + + ) + +697 + #sk_ENGINE_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +ENGINE +, (�), (i), (v�)) + + ) + +698 + #sk_ENGINE_z�o +( +� +� + `SKM_sk_z�o +( +ENGINE +, (�)) + + ) + +699 + #sk_ENGINE_push +( +� +, +v� +� + `SKM_sk_push +( +ENGINE +, (�), (v�)) + + ) + +700 + #sk_ENGINE_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +ENGINE +, (�), (v�)) + + ) + +701 + #sk_ENGINE_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +ENGINE +, (�), (v�)) + + ) + +702 + #sk_ENGINE_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +ENGINE +, (�), (v�)) + + ) + +703 + #sk_ENGINE_d��e +( +� +, +i +� + `SKM_sk_d��e +( +ENGINE +, (�), (i)) + + ) + +704 + #sk_ENGINE_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +ENGINE +, (�), (�r)) + + ) + +705 + #sk_ENGINE_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +ENGINE +, (�), (v�), (i)) + + ) + +706 + #sk_ENGINE_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +ENGINE +, (�), (cmp)) + + ) + +707 + #sk_ENGINE_dup +( +� +� + `SKM_sk_dup +( +ENGINE +, st) + + ) + +708 + #sk_ENGINE_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +ENGINE +, (�), (�_func)) + + ) + +709 + #sk_ENGINE_shi� +( +� +� + `SKM_sk_shi� +( +ENGINE +, (�)) + + ) + +710 + #sk_ENGINE_p� +( +� +� + `SKM_sk_p� +( +ENGINE +, (�)) + + ) + +711 + #sk_ENGINE_s�t +( +� +� + `SKM_sk_s�t +( +ENGINE +, (�)) + + ) + +712 + #sk_ENGINE_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +ENGINE +, (�)) + + ) + +714 + #sk_ENGINE_CLEANUP_ITEM_�w +( +cmp +� + `SKM_sk_�w +( +ENGINE_CLEANUP_ITEM +, (cmp)) + + ) + +715 + #sk_ENGINE_CLEANUP_ITEM_�w_nu� +(� + `SKM_sk_�w_nu� +( +ENGINE_CLEANUP_ITEM +) + + ) + +716 + #sk_ENGINE_CLEANUP_ITEM_� +( +� +� + `SKM_sk_� +( +ENGINE_CLEANUP_ITEM +, (�)) + + ) + +717 + #sk_ENGINE_CLEANUP_ITEM_num +( +� +� + `SKM_sk_num +( +ENGINE_CLEANUP_ITEM +, (�)) + + ) + +718 + #sk_ENGINE_CLEANUP_ITEM_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +ENGINE_CLEANUP_ITEM +, (�), (i)) + + ) + +719 + #sk_ENGINE_CLEANUP_ITEM_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +ENGINE_CLEANUP_ITEM +, (�), (i), (v�)) + + ) + +720 + #sk_ENGINE_CLEANUP_ITEM_z�o +( +� +� + `SKM_sk_z�o +( +ENGINE_CLEANUP_ITEM +, (�)) + + ) + +721 + #sk_ENGINE_CLEANUP_ITEM_push +( +� +, +v� +� + `SKM_sk_push +( +ENGINE_CLEANUP_ITEM +, (�), (v�)) + + ) + +722 + #sk_ENGINE_CLEANUP_ITEM_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +ENGINE_CLEANUP_ITEM +, (�), (v�)) + + ) + +723 + #sk_ENGINE_CLEANUP_ITEM_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +ENGINE_CLEANUP_ITEM +, (�), (v�)) + + ) + +724 + #sk_ENGINE_CLEANUP_ITEM_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +ENGINE_CLEANUP_ITEM +, (�), (v�)) + + ) + +725 + #sk_ENGINE_CLEANUP_ITEM_d��e +( +� +, +i +� + `SKM_sk_d��e +( +ENGINE_CLEANUP_ITEM +, (�), (i)) + + ) + +726 + #sk_ENGINE_CLEANUP_ITEM_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +ENGINE_CLEANUP_ITEM +, (�), (�r)) + + ) + +727 + #sk_ENGINE_CLEANUP_ITEM_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +ENGINE_CLEANUP_ITEM +, (�), (v�), (i)) + + ) + +728 + #sk_ENGINE_CLEANUP_ITEM_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +ENGINE_CLEANUP_ITEM +, (�), (cmp)) + + ) + +729 + #sk_ENGINE_CLEANUP_ITEM_dup +( +� +� + `SKM_sk_dup +( +ENGINE_CLEANUP_ITEM +, st) + + ) + +730 + #sk_ENGINE_CLEANUP_ITEM_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +ENGINE_CLEANUP_ITEM +, (�), (�_func)) + + ) + +731 + #sk_ENGINE_CLEANUP_ITEM_shi� +( +� +� + `SKM_sk_shi� +( +ENGINE_CLEANUP_ITEM +, (�)) + + ) + +732 + #sk_ENGINE_CLEANUP_ITEM_p� +( +� +� + `SKM_sk_p� +( +ENGINE_CLEANUP_ITEM +, (�)) + + ) + +733 + #sk_ENGINE_CLEANUP_ITEM_s�t +( +� +� + `SKM_sk_s�t +( +ENGINE_CLEANUP_ITEM +, (�)) + + ) + +734 + #sk_ENGINE_CLEANUP_ITEM_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +ENGINE_CLEANUP_ITEM +, (�)) + + ) + +736 + #sk_ESS_CERT_ID_�w +( +cmp +� + `SKM_sk_�w +( +ESS_CERT_ID +, (cmp)) + + ) + +737 + #sk_ESS_CERT_ID_�w_nu� +(� + `SKM_sk_�w_nu� +( +ESS_CERT_ID +) + + ) + +738 + #sk_ESS_CERT_ID_� +( +� +� + `SKM_sk_� +( +ESS_CERT_ID +, (�)) + + ) + +739 + #sk_ESS_CERT_ID_num +( +� +� + `SKM_sk_num +( +ESS_CERT_ID +, (�)) + + ) + +740 + #sk_ESS_CERT_ID_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +ESS_CERT_ID +, (�), (i)) + + ) + +741 + #sk_ESS_CERT_ID_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +ESS_CERT_ID +, (�), (i), (v�)) + + ) + +742 + #sk_ESS_CERT_ID_z�o +( +� +� + `SKM_sk_z�o +( +ESS_CERT_ID +, (�)) + + ) + +743 + #sk_ESS_CERT_ID_push +( +� +, +v� +� + `SKM_sk_push +( +ESS_CERT_ID +, (�), (v�)) + + ) + +744 + #sk_ESS_CERT_ID_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +ESS_CERT_ID +, (�), (v�)) + + ) + +745 + #sk_ESS_CERT_ID_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +ESS_CERT_ID +, (�), (v�)) + + ) + +746 + #sk_ESS_CERT_ID_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +ESS_CERT_ID +, (�), (v�)) + + ) + +747 + #sk_ESS_CERT_ID_d��e +( +� +, +i +� + `SKM_sk_d��e +( +ESS_CERT_ID +, (�), (i)) + + ) + +748 + #sk_ESS_CERT_ID_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +ESS_CERT_ID +, (�), (�r)) + + ) + +749 + #sk_ESS_CERT_ID_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +ESS_CERT_ID +, (�), (v�), (i)) + + ) + +750 + #sk_ESS_CERT_ID_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +ESS_CERT_ID +, (�), (cmp)) + + ) + +751 + #sk_ESS_CERT_ID_dup +( +� +� + `SKM_sk_dup +( +ESS_CERT_ID +, st) + + ) + +752 + #sk_ESS_CERT_ID_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +ESS_CERT_ID +, (�), (�_func)) + + ) + +753 + #sk_ESS_CERT_ID_shi� +( +� +� + `SKM_sk_shi� +( +ESS_CERT_ID +, (�)) + + ) + +754 + #sk_ESS_CERT_ID_p� +( +� +� + `SKM_sk_p� +( +ESS_CERT_ID +, (�)) + + ) + +755 + #sk_ESS_CERT_ID_s�t +( +� +� + `SKM_sk_s�t +( +ESS_CERT_ID +, (�)) + + ) + +756 + #sk_ESS_CERT_ID_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +ESS_CERT_ID +, (�)) + + ) + +758 + #sk_EVP_MD_�w +( +cmp +� + `SKM_sk_�w +( +EVP_MD +, (cmp)) + + ) + +759 + #sk_EVP_MD_�w_nu� +(� + `SKM_sk_�w_nu� +( +EVP_MD +) + + ) + +760 + #sk_EVP_MD_� +( +� +� + `SKM_sk_� +( +EVP_MD +, (�)) + + ) + +761 + #sk_EVP_MD_num +( +� +� + `SKM_sk_num +( +EVP_MD +, (�)) + + ) + +762 + #sk_EVP_MD_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +EVP_MD +, (�), (i)) + + ) + +763 + #sk_EVP_MD_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +EVP_MD +, (�), (i), (v�)) + + ) + +764 + #sk_EVP_MD_z�o +( +� +� + `SKM_sk_z�o +( +EVP_MD +, (�)) + + ) + +765 + #sk_EVP_MD_push +( +� +, +v� +� + `SKM_sk_push +( +EVP_MD +, (�), (v�)) + + ) + +766 + #sk_EVP_MD_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +EVP_MD +, (�), (v�)) + + ) + +767 + #sk_EVP_MD_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +EVP_MD +, (�), (v�)) + + ) + +768 + #sk_EVP_MD_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +EVP_MD +, (�), (v�)) + + ) + +769 + #sk_EVP_MD_d��e +( +� +, +i +� + `SKM_sk_d��e +( +EVP_MD +, (�), (i)) + + ) + +770 + #sk_EVP_MD_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +EVP_MD +, (�), (�r)) + + ) + +771 + #sk_EVP_MD_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +EVP_MD +, (�), (v�), (i)) + + ) + +772 + #sk_EVP_MD_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +EVP_MD +, (�), (cmp)) + + ) + +773 + #sk_EVP_MD_dup +( +� +� + `SKM_sk_dup +( +EVP_MD +, st) + + ) + +774 + #sk_EVP_MD_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +EVP_MD +, (�), (�_func)) + + ) + +775 + #sk_EVP_MD_shi� +( +� +� + `SKM_sk_shi� +( +EVP_MD +, (�)) + + ) + +776 + #sk_EVP_MD_p� +( +� +� + `SKM_sk_p� +( +EVP_MD +, (�)) + + ) + +777 + #sk_EVP_MD_s�t +( +� +� + `SKM_sk_s�t +( +EVP_MD +, (�)) + + ) + +778 + #sk_EVP_MD_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +EVP_MD +, (�)) + + ) + +780 + #sk_EVP_PBE_CTL_�w +( +cmp +� + `SKM_sk_�w +( +EVP_PBE_CTL +, (cmp)) + + ) + +781 + #sk_EVP_PBE_CTL_�w_nu� +(� + `SKM_sk_�w_nu� +( +EVP_PBE_CTL +) + + ) + +782 + #sk_EVP_PBE_CTL_� +( +� +� + `SKM_sk_� +( +EVP_PBE_CTL +, (�)) + + ) + +783 + #sk_EVP_PBE_CTL_num +( +� +� + `SKM_sk_num +( +EVP_PBE_CTL +, (�)) + + ) + +784 + #sk_EVP_PBE_CTL_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +EVP_PBE_CTL +, (�), (i)) + + ) + +785 + #sk_EVP_PBE_CTL_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +EVP_PBE_CTL +, (�), (i), (v�)) + + ) + +786 + #sk_EVP_PBE_CTL_z�o +( +� +� + `SKM_sk_z�o +( +EVP_PBE_CTL +, (�)) + + ) + +787 + #sk_EVP_PBE_CTL_push +( +� +, +v� +� + `SKM_sk_push +( +EVP_PBE_CTL +, (�), (v�)) + + ) + +788 + #sk_EVP_PBE_CTL_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +EVP_PBE_CTL +, (�), (v�)) + + ) + +789 + #sk_EVP_PBE_CTL_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +EVP_PBE_CTL +, (�), (v�)) + + ) + +790 + #sk_EVP_PBE_CTL_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +EVP_PBE_CTL +, (�), (v�)) + + ) + +791 + #sk_EVP_PBE_CTL_d��e +( +� +, +i +� + `SKM_sk_d��e +( +EVP_PBE_CTL +, (�), (i)) + + ) + +792 + #sk_EVP_PBE_CTL_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +EVP_PBE_CTL +, (�), (�r)) + + ) + +793 + #sk_EVP_PBE_CTL_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +EVP_PBE_CTL +, (�), (v�), (i)) + + ) + +794 + #sk_EVP_PBE_CTL_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +EVP_PBE_CTL +, (�), (cmp)) + + ) + +795 + #sk_EVP_PBE_CTL_dup +( +� +� + `SKM_sk_dup +( +EVP_PBE_CTL +, st) + + ) + +796 + #sk_EVP_PBE_CTL_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +EVP_PBE_CTL +, (�), (�_func)) + + ) + +797 + #sk_EVP_PBE_CTL_shi� +( +� +� + `SKM_sk_shi� +( +EVP_PBE_CTL +, (�)) + + ) + +798 + #sk_EVP_PBE_CTL_p� +( +� +� + `SKM_sk_p� +( +EVP_PBE_CTL +, (�)) + + ) + +799 + #sk_EVP_PBE_CTL_s�t +( +� +� + `SKM_sk_s�t +( +EVP_PBE_CTL +, (�)) + + ) + +800 + #sk_EVP_PBE_CTL_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +EVP_PBE_CTL +, (�)) + + ) + +802 + #sk_EVP_PKEY_ASN1_METHOD_�w +( +cmp +� + `SKM_sk_�w +( +EVP_PKEY_ASN1_METHOD +, (cmp)) + + ) + +803 + #sk_EVP_PKEY_ASN1_METHOD_�w_nu� +(� + `SKM_sk_�w_nu� +( +EVP_PKEY_ASN1_METHOD +) + + ) + +804 + #sk_EVP_PKEY_ASN1_METHOD_� +( +� +� + `SKM_sk_� +( +EVP_PKEY_ASN1_METHOD +, (�)) + + ) + +805 + #sk_EVP_PKEY_ASN1_METHOD_num +( +� +� + `SKM_sk_num +( +EVP_PKEY_ASN1_METHOD +, (�)) + + ) + +806 + #sk_EVP_PKEY_ASN1_METHOD_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +EVP_PKEY_ASN1_METHOD +, (�), (i)) + + ) + +807 + #sk_EVP_PKEY_ASN1_METHOD_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +EVP_PKEY_ASN1_METHOD +, (�), (i), (v�)) + + ) + +808 + #sk_EVP_PKEY_ASN1_METHOD_z�o +( +� +� + `SKM_sk_z�o +( +EVP_PKEY_ASN1_METHOD +, (�)) + + ) + +809 + #sk_EVP_PKEY_ASN1_METHOD_push +( +� +, +v� +� + `SKM_sk_push +( +EVP_PKEY_ASN1_METHOD +, (�), (v�)) + + ) + +810 + #sk_EVP_PKEY_ASN1_METHOD_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +EVP_PKEY_ASN1_METHOD +, (�), (v�)) + + ) + +811 + #sk_EVP_PKEY_ASN1_METHOD_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +EVP_PKEY_ASN1_METHOD +, (�), (v�)) + + ) + +812 + #sk_EVP_PKEY_ASN1_METHOD_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +EVP_PKEY_ASN1_METHOD +, (�), (v�)) + + ) + +813 + #sk_EVP_PKEY_ASN1_METHOD_d��e +( +� +, +i +� + `SKM_sk_d��e +( +EVP_PKEY_ASN1_METHOD +, (�), (i)) + + ) + +814 + #sk_EVP_PKEY_ASN1_METHOD_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +EVP_PKEY_ASN1_METHOD +, (�), (�r)) + + ) + +815 + #sk_EVP_PKEY_ASN1_METHOD_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +EVP_PKEY_ASN1_METHOD +, (�), (v�), (i)) + + ) + +816 + #sk_EVP_PKEY_ASN1_METHOD_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +EVP_PKEY_ASN1_METHOD +, (�), (cmp)) + + ) + +817 + #sk_EVP_PKEY_ASN1_METHOD_dup +( +� +� + `SKM_sk_dup +( +EVP_PKEY_ASN1_METHOD +, st) + + ) + +818 + #sk_EVP_PKEY_ASN1_METHOD_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +EVP_PKEY_ASN1_METHOD +, (�), (�_func)) + + ) + +819 + #sk_EVP_PKEY_ASN1_METHOD_shi� +( +� +� + `SKM_sk_shi� +( +EVP_PKEY_ASN1_METHOD +, (�)) + + ) + +820 + #sk_EVP_PKEY_ASN1_METHOD_p� +( +� +� + `SKM_sk_p� +( +EVP_PKEY_ASN1_METHOD +, (�)) + + ) + +821 + #sk_EVP_PKEY_ASN1_METHOD_s�t +( +� +� + `SKM_sk_s�t +( +EVP_PKEY_ASN1_METHOD +, (�)) + + ) + +822 + #sk_EVP_PKEY_ASN1_METHOD_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +EVP_PKEY_ASN1_METHOD +, (�)) + + ) + +824 + #sk_EVP_PKEY_METHOD_�w +( +cmp +� + `SKM_sk_�w +( +EVP_PKEY_METHOD +, (cmp)) + + ) + +825 + #sk_EVP_PKEY_METHOD_�w_nu� +(� + `SKM_sk_�w_nu� +( +EVP_PKEY_METHOD +) + + ) + +826 + #sk_EVP_PKEY_METHOD_� +( +� +� + `SKM_sk_� +( +EVP_PKEY_METHOD +, (�)) + + ) + +827 + #sk_EVP_PKEY_METHOD_num +( +� +� + `SKM_sk_num +( +EVP_PKEY_METHOD +, (�)) + + ) + +828 + #sk_EVP_PKEY_METHOD_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +EVP_PKEY_METHOD +, (�), (i)) + + ) + +829 + #sk_EVP_PKEY_METHOD_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +EVP_PKEY_METHOD +, (�), (i), (v�)) + + ) + +830 + #sk_EVP_PKEY_METHOD_z�o +( +� +� + `SKM_sk_z�o +( +EVP_PKEY_METHOD +, (�)) + + ) + +831 + #sk_EVP_PKEY_METHOD_push +( +� +, +v� +� + `SKM_sk_push +( +EVP_PKEY_METHOD +, (�), (v�)) + + ) + +832 + #sk_EVP_PKEY_METHOD_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +EVP_PKEY_METHOD +, (�), (v�)) + + ) + +833 + #sk_EVP_PKEY_METHOD_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +EVP_PKEY_METHOD +, (�), (v�)) + + ) + +834 + #sk_EVP_PKEY_METHOD_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +EVP_PKEY_METHOD +, (�), (v�)) + + ) + +835 + #sk_EVP_PKEY_METHOD_d��e +( +� +, +i +� + `SKM_sk_d��e +( +EVP_PKEY_METHOD +, (�), (i)) + + ) + +836 + #sk_EVP_PKEY_METHOD_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +EVP_PKEY_METHOD +, (�), (�r)) + + ) + +837 + #sk_EVP_PKEY_METHOD_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +EVP_PKEY_METHOD +, (�), (v�), (i)) + + ) + +838 + #sk_EVP_PKEY_METHOD_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +EVP_PKEY_METHOD +, (�), (cmp)) + + ) + +839 + #sk_EVP_PKEY_METHOD_dup +( +� +� + `SKM_sk_dup +( +EVP_PKEY_METHOD +, st) + + ) + +840 + #sk_EVP_PKEY_METHOD_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +EVP_PKEY_METHOD +, (�), (�_func)) + + ) + +841 + #sk_EVP_PKEY_METHOD_shi� +( +� +� + `SKM_sk_shi� +( +EVP_PKEY_METHOD +, (�)) + + ) + +842 + #sk_EVP_PKEY_METHOD_p� +( +� +� + `SKM_sk_p� +( +EVP_PKEY_METHOD +, (�)) + + ) + +843 + #sk_EVP_PKEY_METHOD_s�t +( +� +� + `SKM_sk_s�t +( +EVP_PKEY_METHOD +, (�)) + + ) + +844 + #sk_EVP_PKEY_METHOD_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +EVP_PKEY_METHOD +, (�)) + + ) + +846 + #sk_GENERAL_NAME_�w +( +cmp +� + `SKM_sk_�w +( +GENERAL_NAME +, (cmp)) + + ) + +847 + #sk_GENERAL_NAME_�w_nu� +(� + `SKM_sk_�w_nu� +( +GENERAL_NAME +) + + ) + +848 + #sk_GENERAL_NAME_� +( +� +� + `SKM_sk_� +( +GENERAL_NAME +, (�)) + + ) + +849 + #sk_GENERAL_NAME_num +( +� +� + `SKM_sk_num +( +GENERAL_NAME +, (�)) + + ) + +850 + #sk_GENERAL_NAME_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +GENERAL_NAME +, (�), (i)) + + ) + +851 + #sk_GENERAL_NAME_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +GENERAL_NAME +, (�), (i), (v�)) + + ) + +852 + #sk_GENERAL_NAME_z�o +( +� +� + `SKM_sk_z�o +( +GENERAL_NAME +, (�)) + + ) + +853 + #sk_GENERAL_NAME_push +( +� +, +v� +� + `SKM_sk_push +( +GENERAL_NAME +, (�), (v�)) + + ) + +854 + #sk_GENERAL_NAME_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +GENERAL_NAME +, (�), (v�)) + + ) + +855 + #sk_GENERAL_NAME_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +GENERAL_NAME +, (�), (v�)) + + ) + +856 + #sk_GENERAL_NAME_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +GENERAL_NAME +, (�), (v�)) + + ) + +857 + #sk_GENERAL_NAME_d��e +( +� +, +i +� + `SKM_sk_d��e +( +GENERAL_NAME +, (�), (i)) + + ) + +858 + #sk_GENERAL_NAME_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +GENERAL_NAME +, (�), (�r)) + + ) + +859 + #sk_GENERAL_NAME_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +GENERAL_NAME +, (�), (v�), (i)) + + ) + +860 + #sk_GENERAL_NAME_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +GENERAL_NAME +, (�), (cmp)) + + ) + +861 + #sk_GENERAL_NAME_dup +( +� +� + `SKM_sk_dup +( +GENERAL_NAME +, st) + + ) + +862 + #sk_GENERAL_NAME_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +GENERAL_NAME +, (�), (�_func)) + + ) + +863 + #sk_GENERAL_NAME_shi� +( +� +� + `SKM_sk_shi� +( +GENERAL_NAME +, (�)) + + ) + +864 + #sk_GENERAL_NAME_p� +( +� +� + `SKM_sk_p� +( +GENERAL_NAME +, (�)) + + ) + +865 + #sk_GENERAL_NAME_s�t +( +� +� + `SKM_sk_s�t +( +GENERAL_NAME +, (�)) + + ) + +866 + #sk_GENERAL_NAME_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +GENERAL_NAME +, (�)) + + ) + +868 + #sk_GENERAL_NAMES_�w +( +cmp +� + `SKM_sk_�w +( +GENERAL_NAMES +, (cmp)) + + ) + +869 + #sk_GENERAL_NAMES_�w_nu� +(� + `SKM_sk_�w_nu� +( +GENERAL_NAMES +) + + ) + +870 + #sk_GENERAL_NAMES_� +( +� +� + `SKM_sk_� +( +GENERAL_NAMES +, (�)) + + ) + +871 + #sk_GENERAL_NAMES_num +( +� +� + `SKM_sk_num +( +GENERAL_NAMES +, (�)) + + ) + +872 + #sk_GENERAL_NAMES_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +GENERAL_NAMES +, (�), (i)) + + ) + +873 + #sk_GENERAL_NAMES_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +GENERAL_NAMES +, (�), (i), (v�)) + + ) + +874 + #sk_GENERAL_NAMES_z�o +( +� +� + `SKM_sk_z�o +( +GENERAL_NAMES +, (�)) + + ) + +875 + #sk_GENERAL_NAMES_push +( +� +, +v� +� + `SKM_sk_push +( +GENERAL_NAMES +, (�), (v�)) + + ) + +876 + #sk_GENERAL_NAMES_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +GENERAL_NAMES +, (�), (v�)) + + ) + +877 + #sk_GENERAL_NAMES_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +GENERAL_NAMES +, (�), (v�)) + + ) + +878 + #sk_GENERAL_NAMES_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +GENERAL_NAMES +, (�), (v�)) + + ) + +879 + #sk_GENERAL_NAMES_d��e +( +� +, +i +� + `SKM_sk_d��e +( +GENERAL_NAMES +, (�), (i)) + + ) + +880 + #sk_GENERAL_NAMES_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +GENERAL_NAMES +, (�), (�r)) + + ) + +881 + #sk_GENERAL_NAMES_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +GENERAL_NAMES +, (�), (v�), (i)) + + ) + +882 + #sk_GENERAL_NAMES_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +GENERAL_NAMES +, (�), (cmp)) + + ) + +883 + #sk_GENERAL_NAMES_dup +( +� +� + `SKM_sk_dup +( +GENERAL_NAMES +, st) + + ) + +884 + #sk_GENERAL_NAMES_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +GENERAL_NAMES +, (�), (�_func)) + + ) + +885 + #sk_GENERAL_NAMES_shi� +( +� +� + `SKM_sk_shi� +( +GENERAL_NAMES +, (�)) + + ) + +886 + #sk_GENERAL_NAMES_p� +( +� +� + `SKM_sk_p� +( +GENERAL_NAMES +, (�)) + + ) + +887 + #sk_GENERAL_NAMES_s�t +( +� +� + `SKM_sk_s�t +( +GENERAL_NAMES +, (�)) + + ) + +888 + #sk_GENERAL_NAMES_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +GENERAL_NAMES +, (�)) + + ) + +890 + #sk_GENERAL_SUBTREE_�w +( +cmp +� + `SKM_sk_�w +( +GENERAL_SUBTREE +, (cmp)) + + ) + +891 + #sk_GENERAL_SUBTREE_�w_nu� +(� + `SKM_sk_�w_nu� +( +GENERAL_SUBTREE +) + + ) + +892 + #sk_GENERAL_SUBTREE_� +( +� +� + `SKM_sk_� +( +GENERAL_SUBTREE +, (�)) + + ) + +893 + #sk_GENERAL_SUBTREE_num +( +� +� + `SKM_sk_num +( +GENERAL_SUBTREE +, (�)) + + ) + +894 + #sk_GENERAL_SUBTREE_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +GENERAL_SUBTREE +, (�), (i)) + + ) + +895 + #sk_GENERAL_SUBTREE_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +GENERAL_SUBTREE +, (�), (i), (v�)) + + ) + +896 + #sk_GENERAL_SUBTREE_z�o +( +� +� + `SKM_sk_z�o +( +GENERAL_SUBTREE +, (�)) + + ) + +897 + #sk_GENERAL_SUBTREE_push +( +� +, +v� +� + `SKM_sk_push +( +GENERAL_SUBTREE +, (�), (v�)) + + ) + +898 + #sk_GENERAL_SUBTREE_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +GENERAL_SUBTREE +, (�), (v�)) + + ) + +899 + #sk_GENERAL_SUBTREE_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +GENERAL_SUBTREE +, (�), (v�)) + + ) + +900 + #sk_GENERAL_SUBTREE_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +GENERAL_SUBTREE +, (�), (v�)) + + ) + +901 + #sk_GENERAL_SUBTREE_d��e +( +� +, +i +� + `SKM_sk_d��e +( +GENERAL_SUBTREE +, (�), (i)) + + ) + +902 + #sk_GENERAL_SUBTREE_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +GENERAL_SUBTREE +, (�), (�r)) + + ) + +903 + #sk_GENERAL_SUBTREE_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +GENERAL_SUBTREE +, (�), (v�), (i)) + + ) + +904 + #sk_GENERAL_SUBTREE_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +GENERAL_SUBTREE +, (�), (cmp)) + + ) + +905 + #sk_GENERAL_SUBTREE_dup +( +� +� + `SKM_sk_dup +( +GENERAL_SUBTREE +, st) + + ) + +906 + #sk_GENERAL_SUBTREE_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +GENERAL_SUBTREE +, (�), (�_func)) + + ) + +907 + #sk_GENERAL_SUBTREE_shi� +( +� +� + `SKM_sk_shi� +( +GENERAL_SUBTREE +, (�)) + + ) + +908 + #sk_GENERAL_SUBTREE_p� +( +� +� + `SKM_sk_p� +( +GENERAL_SUBTREE +, (�)) + + ) + +909 + #sk_GENERAL_SUBTREE_s�t +( +� +� + `SKM_sk_s�t +( +GENERAL_SUBTREE +, (�)) + + ) + +910 + #sk_GENERAL_SUBTREE_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +GENERAL_SUBTREE +, (�)) + + ) + +912 + #sk_IPAdd�ssFam�y_�w +( +cmp +� + `SKM_sk_�w +( +IPAdd�ssFam�y +, (cmp)) + + ) + +913 + #sk_IPAdd�ssFam�y_�w_nu� +(� + `SKM_sk_�w_nu� +( +IPAdd�ssFam�y +) + + ) + +914 + #sk_IPAdd�ssFam�y_� +( +� +� + `SKM_sk_� +( +IPAdd�ssFam�y +, (�)) + + ) + +915 + #sk_IPAdd�ssFam�y_num +( +� +� + `SKM_sk_num +( +IPAdd�ssFam�y +, (�)) + + ) + +916 + #sk_IPAdd�ssFam�y_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +IPAdd�ssFam�y +, (�), (i)) + + ) + +917 + #sk_IPAdd�ssFam�y_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +IPAdd�ssFam�y +, (�), (i), (v�)) + + ) + +918 + #sk_IPAdd�ssFam�y_z�o +( +� +� + `SKM_sk_z�o +( +IPAdd�ssFam�y +, (�)) + + ) + +919 + #sk_IPAdd�ssFam�y_push +( +� +, +v� +� + `SKM_sk_push +( +IPAdd�ssFam�y +, (�), (v�)) + + ) + +920 + #sk_IPAdd�ssFam�y_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +IPAdd�ssFam�y +, (�), (v�)) + + ) + +921 + #sk_IPAdd�ssFam�y_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +IPAdd�ssFam�y +, (�), (v�)) + + ) + +922 + #sk_IPAdd�ssFam�y_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +IPAdd�ssFam�y +, (�), (v�)) + + ) + +923 + #sk_IPAdd�ssFam�y_d��e +( +� +, +i +� + `SKM_sk_d��e +( +IPAdd�ssFam�y +, (�), (i)) + + ) + +924 + #sk_IPAdd�ssFam�y_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +IPAdd�ssFam�y +, (�), (�r)) + + ) + +925 + #sk_IPAdd�ssFam�y_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +IPAdd�ssFam�y +, (�), (v�), (i)) + + ) + +926 + #sk_IPAdd�ssFam�y_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +IPAdd�ssFam�y +, (�), (cmp)) + + ) + +927 + #sk_IPAdd�ssFam�y_dup +( +� +� + `SKM_sk_dup +( +IPAdd�ssFam�y +, st) + + ) + +928 + #sk_IPAdd�ssFam�y_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +IPAdd�ssFam�y +, (�), (�_func)) + + ) + +929 + #sk_IPAdd�ssFam�y_shi� +( +� +� + `SKM_sk_shi� +( +IPAdd�ssFam�y +, (�)) + + ) + +930 + #sk_IPAdd�ssFam�y_p� +( +� +� + `SKM_sk_p� +( +IPAdd�ssFam�y +, (�)) + + ) + +931 + #sk_IPAdd�ssFam�y_s�t +( +� +� + `SKM_sk_s�t +( +IPAdd�ssFam�y +, (�)) + + ) + +932 + #sk_IPAdd�ssFam�y_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +IPAdd�ssFam�y +, (�)) + + ) + +934 + #sk_IPAdd�ssOrR�ge_�w +( +cmp +� + `SKM_sk_�w +( +IPAdd�ssOrR�ge +, (cmp)) + + ) + +935 + #sk_IPAdd�ssOrR�ge_�w_nu� +(� + `SKM_sk_�w_nu� +( +IPAdd�ssOrR�ge +) + + ) + +936 + #sk_IPAdd�ssOrR�ge_� +( +� +� + `SKM_sk_� +( +IPAdd�ssOrR�ge +, (�)) + + ) + +937 + #sk_IPAdd�ssOrR�ge_num +( +� +� + `SKM_sk_num +( +IPAdd�ssOrR�ge +, (�)) + + ) + +938 + #sk_IPAdd�ssOrR�ge_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +IPAdd�ssOrR�ge +, (�), (i)) + + ) + +939 + #sk_IPAdd�ssOrR�ge_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +IPAdd�ssOrR�ge +, (�), (i), (v�)) + + ) + +940 + #sk_IPAdd�ssOrR�ge_z�o +( +� +� + `SKM_sk_z�o +( +IPAdd�ssOrR�ge +, (�)) + + ) + +941 + #sk_IPAdd�ssOrR�ge_push +( +� +, +v� +� + `SKM_sk_push +( +IPAdd�ssOrR�ge +, (�), (v�)) + + ) + +942 + #sk_IPAdd�ssOrR�ge_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +IPAdd�ssOrR�ge +, (�), (v�)) + + ) + +943 + #sk_IPAdd�ssOrR�ge_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +IPAdd�ssOrR�ge +, (�), (v�)) + + ) + +944 + #sk_IPAdd�ssOrR�ge_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +IPAdd�ssOrR�ge +, (�), (v�)) + + ) + +945 + #sk_IPAdd�ssOrR�ge_d��e +( +� +, +i +� + `SKM_sk_d��e +( +IPAdd�ssOrR�ge +, (�), (i)) + + ) + +946 + #sk_IPAdd�ssOrR�ge_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +IPAdd�ssOrR�ge +, (�), (�r)) + + ) + +947 + #sk_IPAdd�ssOrR�ge_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +IPAdd�ssOrR�ge +, (�), (v�), (i)) + + ) + +948 + #sk_IPAdd�ssOrR�ge_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +IPAdd�ssOrR�ge +, (�), (cmp)) + + ) + +949 + #sk_IPAdd�ssOrR�ge_dup +( +� +� + `SKM_sk_dup +( +IPAdd�ssOrR�ge +, st) + + ) + +950 + #sk_IPAdd�ssOrR�ge_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +IPAdd�ssOrR�ge +, (�), (�_func)) + + ) + +951 + #sk_IPAdd�ssOrR�ge_shi� +( +� +� + `SKM_sk_shi� +( +IPAdd�ssOrR�ge +, (�)) + + ) + +952 + #sk_IPAdd�ssOrR�ge_p� +( +� +� + `SKM_sk_p� +( +IPAdd�ssOrR�ge +, (�)) + + ) + +953 + #sk_IPAdd�ssOrR�ge_s�t +( +� +� + `SKM_sk_s�t +( +IPAdd�ssOrR�ge +, (�)) + + ) + +954 + #sk_IPAdd�ssOrR�ge_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +IPAdd�ssOrR�ge +, (�)) + + ) + +956 + #sk_KRB5_APREQBODY_�w +( +cmp +� + `SKM_sk_�w +( +KRB5_APREQBODY +, (cmp)) + + ) + +957 + #sk_KRB5_APREQBODY_�w_nu� +(� + `SKM_sk_�w_nu� +( +KRB5_APREQBODY +) + + ) + +958 + #sk_KRB5_APREQBODY_� +( +� +� + `SKM_sk_� +( +KRB5_APREQBODY +, (�)) + + ) + +959 + #sk_KRB5_APREQBODY_num +( +� +� + `SKM_sk_num +( +KRB5_APREQBODY +, (�)) + + ) + +960 + #sk_KRB5_APREQBODY_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +KRB5_APREQBODY +, (�), (i)) + + ) + +961 + #sk_KRB5_APREQBODY_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +KRB5_APREQBODY +, (�), (i), (v�)) + + ) + +962 + #sk_KRB5_APREQBODY_z�o +( +� +� + `SKM_sk_z�o +( +KRB5_APREQBODY +, (�)) + + ) + +963 + #sk_KRB5_APREQBODY_push +( +� +, +v� +� + `SKM_sk_push +( +KRB5_APREQBODY +, (�), (v�)) + + ) + +964 + #sk_KRB5_APREQBODY_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +KRB5_APREQBODY +, (�), (v�)) + + ) + +965 + #sk_KRB5_APREQBODY_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +KRB5_APREQBODY +, (�), (v�)) + + ) + +966 + #sk_KRB5_APREQBODY_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +KRB5_APREQBODY +, (�), (v�)) + + ) + +967 + #sk_KRB5_APREQBODY_d��e +( +� +, +i +� + `SKM_sk_d��e +( +KRB5_APREQBODY +, (�), (i)) + + ) + +968 + #sk_KRB5_APREQBODY_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +KRB5_APREQBODY +, (�), (�r)) + + ) + +969 + #sk_KRB5_APREQBODY_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +KRB5_APREQBODY +, (�), (v�), (i)) + + ) + +970 + #sk_KRB5_APREQBODY_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +KRB5_APREQBODY +, (�), (cmp)) + + ) + +971 + #sk_KRB5_APREQBODY_dup +( +� +� + `SKM_sk_dup +( +KRB5_APREQBODY +, st) + + ) + +972 + #sk_KRB5_APREQBODY_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +KRB5_APREQBODY +, (�), (�_func)) + + ) + +973 + #sk_KRB5_APREQBODY_shi� +( +� +� + `SKM_sk_shi� +( +KRB5_APREQBODY +, (�)) + + ) + +974 + #sk_KRB5_APREQBODY_p� +( +� +� + `SKM_sk_p� +( +KRB5_APREQBODY +, (�)) + + ) + +975 + #sk_KRB5_APREQBODY_s�t +( +� +� + `SKM_sk_s�t +( +KRB5_APREQBODY +, (�)) + + ) + +976 + #sk_KRB5_APREQBODY_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +KRB5_APREQBODY +, (�)) + + ) + +978 + #sk_KRB5_AUTHDATA_�w +( +cmp +� + `SKM_sk_�w +( +KRB5_AUTHDATA +, (cmp)) + + ) + +979 + #sk_KRB5_AUTHDATA_�w_nu� +(� + `SKM_sk_�w_nu� +( +KRB5_AUTHDATA +) + + ) + +980 + #sk_KRB5_AUTHDATA_� +( +� +� + `SKM_sk_� +( +KRB5_AUTHDATA +, (�)) + + ) + +981 + #sk_KRB5_AUTHDATA_num +( +� +� + `SKM_sk_num +( +KRB5_AUTHDATA +, (�)) + + ) + +982 + #sk_KRB5_AUTHDATA_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +KRB5_AUTHDATA +, (�), (i)) + + ) + +983 + #sk_KRB5_AUTHDATA_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +KRB5_AUTHDATA +, (�), (i), (v�)) + + ) + +984 + #sk_KRB5_AUTHDATA_z�o +( +� +� + `SKM_sk_z�o +( +KRB5_AUTHDATA +, (�)) + + ) + +985 + #sk_KRB5_AUTHDATA_push +( +� +, +v� +� + `SKM_sk_push +( +KRB5_AUTHDATA +, (�), (v�)) + + ) + +986 + #sk_KRB5_AUTHDATA_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +KRB5_AUTHDATA +, (�), (v�)) + + ) + +987 + #sk_KRB5_AUTHDATA_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +KRB5_AUTHDATA +, (�), (v�)) + + ) + +988 + #sk_KRB5_AUTHDATA_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +KRB5_AUTHDATA +, (�), (v�)) + + ) + +989 + #sk_KRB5_AUTHDATA_d��e +( +� +, +i +� + `SKM_sk_d��e +( +KRB5_AUTHDATA +, (�), (i)) + + ) + +990 + #sk_KRB5_AUTHDATA_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +KRB5_AUTHDATA +, (�), (�r)) + + ) + +991 + #sk_KRB5_AUTHDATA_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +KRB5_AUTHDATA +, (�), (v�), (i)) + + ) + +992 + #sk_KRB5_AUTHDATA_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +KRB5_AUTHDATA +, (�), (cmp)) + + ) + +993 + #sk_KRB5_AUTHDATA_dup +( +� +� + `SKM_sk_dup +( +KRB5_AUTHDATA +, st) + + ) + +994 + #sk_KRB5_AUTHDATA_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +KRB5_AUTHDATA +, (�), (�_func)) + + ) + +995 + #sk_KRB5_AUTHDATA_shi� +( +� +� + `SKM_sk_shi� +( +KRB5_AUTHDATA +, (�)) + + ) + +996 + #sk_KRB5_AUTHDATA_p� +( +� +� + `SKM_sk_p� +( +KRB5_AUTHDATA +, (�)) + + ) + +997 + #sk_KRB5_AUTHDATA_s�t +( +� +� + `SKM_sk_s�t +( +KRB5_AUTHDATA +, (�)) + + ) + +998 + #sk_KRB5_AUTHDATA_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +KRB5_AUTHDATA +, (�)) + + ) + +1000 + #sk_KRB5_AUTHENTBODY_�w +( +cmp +� + `SKM_sk_�w +( +KRB5_AUTHENTBODY +, (cmp)) + + ) + +1001 + #sk_KRB5_AUTHENTBODY_�w_nu� +(� + `SKM_sk_�w_nu� +( +KRB5_AUTHENTBODY +) + + ) + +1002 + #sk_KRB5_AUTHENTBODY_� +( +� +� + `SKM_sk_� +( +KRB5_AUTHENTBODY +, (�)) + + ) + +1003 + #sk_KRB5_AUTHENTBODY_num +( +� +� + `SKM_sk_num +( +KRB5_AUTHENTBODY +, (�)) + + ) + +1004 + #sk_KRB5_AUTHENTBODY_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +KRB5_AUTHENTBODY +, (�), (i)) + + ) + +1005 + #sk_KRB5_AUTHENTBODY_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +KRB5_AUTHENTBODY +, (�), (i), (v�)) + + ) + +1006 + #sk_KRB5_AUTHENTBODY_z�o +( +� +� + `SKM_sk_z�o +( +KRB5_AUTHENTBODY +, (�)) + + ) + +1007 + #sk_KRB5_AUTHENTBODY_push +( +� +, +v� +� + `SKM_sk_push +( +KRB5_AUTHENTBODY +, (�), (v�)) + + ) + +1008 + #sk_KRB5_AUTHENTBODY_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +KRB5_AUTHENTBODY +, (�), (v�)) + + ) + +1009 + #sk_KRB5_AUTHENTBODY_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +KRB5_AUTHENTBODY +, (�), (v�)) + + ) + +1010 + #sk_KRB5_AUTHENTBODY_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +KRB5_AUTHENTBODY +, (�), (v�)) + + ) + +1011 + #sk_KRB5_AUTHENTBODY_d��e +( +� +, +i +� + `SKM_sk_d��e +( +KRB5_AUTHENTBODY +, (�), (i)) + + ) + +1012 + #sk_KRB5_AUTHENTBODY_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +KRB5_AUTHENTBODY +, (�), (�r)) + + ) + +1013 + #sk_KRB5_AUTHENTBODY_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +KRB5_AUTHENTBODY +, (�), (v�), (i)) + + ) + +1014 + #sk_KRB5_AUTHENTBODY_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +KRB5_AUTHENTBODY +, (�), (cmp)) + + ) + +1015 + #sk_KRB5_AUTHENTBODY_dup +( +� +� + `SKM_sk_dup +( +KRB5_AUTHENTBODY +, st) + + ) + +1016 + #sk_KRB5_AUTHENTBODY_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +KRB5_AUTHENTBODY +, (�), (�_func)) + + ) + +1017 + #sk_KRB5_AUTHENTBODY_shi� +( +� +� + `SKM_sk_shi� +( +KRB5_AUTHENTBODY +, (�)) + + ) + +1018 + #sk_KRB5_AUTHENTBODY_p� +( +� +� + `SKM_sk_p� +( +KRB5_AUTHENTBODY +, (�)) + + ) + +1019 + #sk_KRB5_AUTHENTBODY_s�t +( +� +� + `SKM_sk_s�t +( +KRB5_AUTHENTBODY +, (�)) + + ) + +1020 + #sk_KRB5_AUTHENTBODY_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +KRB5_AUTHENTBODY +, (�)) + + ) + +1022 + #sk_KRB5_CHECKSUM_�w +( +cmp +� + `SKM_sk_�w +( +KRB5_CHECKSUM +, (cmp)) + + ) + +1023 + #sk_KRB5_CHECKSUM_�w_nu� +(� + `SKM_sk_�w_nu� +( +KRB5_CHECKSUM +) + + ) + +1024 + #sk_KRB5_CHECKSUM_� +( +� +� + `SKM_sk_� +( +KRB5_CHECKSUM +, (�)) + + ) + +1025 + #sk_KRB5_CHECKSUM_num +( +� +� + `SKM_sk_num +( +KRB5_CHECKSUM +, (�)) + + ) + +1026 + #sk_KRB5_CHECKSUM_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +KRB5_CHECKSUM +, (�), (i)) + + ) + +1027 + #sk_KRB5_CHECKSUM_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +KRB5_CHECKSUM +, (�), (i), (v�)) + + ) + +1028 + #sk_KRB5_CHECKSUM_z�o +( +� +� + `SKM_sk_z�o +( +KRB5_CHECKSUM +, (�)) + + ) + +1029 + #sk_KRB5_CHECKSUM_push +( +� +, +v� +� + `SKM_sk_push +( +KRB5_CHECKSUM +, (�), (v�)) + + ) + +1030 + #sk_KRB5_CHECKSUM_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +KRB5_CHECKSUM +, (�), (v�)) + + ) + +1031 + #sk_KRB5_CHECKSUM_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +KRB5_CHECKSUM +, (�), (v�)) + + ) + +1032 + #sk_KRB5_CHECKSUM_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +KRB5_CHECKSUM +, (�), (v�)) + + ) + +1033 + #sk_KRB5_CHECKSUM_d��e +( +� +, +i +� + `SKM_sk_d��e +( +KRB5_CHECKSUM +, (�), (i)) + + ) + +1034 + #sk_KRB5_CHECKSUM_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +KRB5_CHECKSUM +, (�), (�r)) + + ) + +1035 + #sk_KRB5_CHECKSUM_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +KRB5_CHECKSUM +, (�), (v�), (i)) + + ) + +1036 + #sk_KRB5_CHECKSUM_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +KRB5_CHECKSUM +, (�), (cmp)) + + ) + +1037 + #sk_KRB5_CHECKSUM_dup +( +� +� + `SKM_sk_dup +( +KRB5_CHECKSUM +, st) + + ) + +1038 + #sk_KRB5_CHECKSUM_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +KRB5_CHECKSUM +, (�), (�_func)) + + ) + +1039 + #sk_KRB5_CHECKSUM_shi� +( +� +� + `SKM_sk_shi� +( +KRB5_CHECKSUM +, (�)) + + ) + +1040 + #sk_KRB5_CHECKSUM_p� +( +� +� + `SKM_sk_p� +( +KRB5_CHECKSUM +, (�)) + + ) + +1041 + #sk_KRB5_CHECKSUM_s�t +( +� +� + `SKM_sk_s�t +( +KRB5_CHECKSUM +, (�)) + + ) + +1042 + #sk_KRB5_CHECKSUM_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +KRB5_CHECKSUM +, (�)) + + ) + +1044 + #sk_KRB5_ENCDATA_�w +( +cmp +� + `SKM_sk_�w +( +KRB5_ENCDATA +, (cmp)) + + ) + +1045 + #sk_KRB5_ENCDATA_�w_nu� +(� + `SKM_sk_�w_nu� +( +KRB5_ENCDATA +) + + ) + +1046 + #sk_KRB5_ENCDATA_� +( +� +� + `SKM_sk_� +( +KRB5_ENCDATA +, (�)) + + ) + +1047 + #sk_KRB5_ENCDATA_num +( +� +� + `SKM_sk_num +( +KRB5_ENCDATA +, (�)) + + ) + +1048 + #sk_KRB5_ENCDATA_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +KRB5_ENCDATA +, (�), (i)) + + ) + +1049 + #sk_KRB5_ENCDATA_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +KRB5_ENCDATA +, (�), (i), (v�)) + + ) + +1050 + #sk_KRB5_ENCDATA_z�o +( +� +� + `SKM_sk_z�o +( +KRB5_ENCDATA +, (�)) + + ) + +1051 + #sk_KRB5_ENCDATA_push +( +� +, +v� +� + `SKM_sk_push +( +KRB5_ENCDATA +, (�), (v�)) + + ) + +1052 + #sk_KRB5_ENCDATA_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +KRB5_ENCDATA +, (�), (v�)) + + ) + +1053 + #sk_KRB5_ENCDATA_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +KRB5_ENCDATA +, (�), (v�)) + + ) + +1054 + #sk_KRB5_ENCDATA_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +KRB5_ENCDATA +, (�), (v�)) + + ) + +1055 + #sk_KRB5_ENCDATA_d��e +( +� +, +i +� + `SKM_sk_d��e +( +KRB5_ENCDATA +, (�), (i)) + + ) + +1056 + #sk_KRB5_ENCDATA_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +KRB5_ENCDATA +, (�), (�r)) + + ) + +1057 + #sk_KRB5_ENCDATA_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +KRB5_ENCDATA +, (�), (v�), (i)) + + ) + +1058 + #sk_KRB5_ENCDATA_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +KRB5_ENCDATA +, (�), (cmp)) + + ) + +1059 + #sk_KRB5_ENCDATA_dup +( +� +� + `SKM_sk_dup +( +KRB5_ENCDATA +, st) + + ) + +1060 + #sk_KRB5_ENCDATA_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +KRB5_ENCDATA +, (�), (�_func)) + + ) + +1061 + #sk_KRB5_ENCDATA_shi� +( +� +� + `SKM_sk_shi� +( +KRB5_ENCDATA +, (�)) + + ) + +1062 + #sk_KRB5_ENCDATA_p� +( +� +� + `SKM_sk_p� +( +KRB5_ENCDATA +, (�)) + + ) + +1063 + #sk_KRB5_ENCDATA_s�t +( +� +� + `SKM_sk_s�t +( +KRB5_ENCDATA +, (�)) + + ) + +1064 + #sk_KRB5_ENCDATA_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +KRB5_ENCDATA +, (�)) + + ) + +1066 + #sk_KRB5_ENCKEY_�w +( +cmp +� + `SKM_sk_�w +( +KRB5_ENCKEY +, (cmp)) + + ) + +1067 + #sk_KRB5_ENCKEY_�w_nu� +(� + `SKM_sk_�w_nu� +( +KRB5_ENCKEY +) + + ) + +1068 + #sk_KRB5_ENCKEY_� +( +� +� + `SKM_sk_� +( +KRB5_ENCKEY +, (�)) + + ) + +1069 + #sk_KRB5_ENCKEY_num +( +� +� + `SKM_sk_num +( +KRB5_ENCKEY +, (�)) + + ) + +1070 + #sk_KRB5_ENCKEY_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +KRB5_ENCKEY +, (�), (i)) + + ) + +1071 + #sk_KRB5_ENCKEY_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +KRB5_ENCKEY +, (�), (i), (v�)) + + ) + +1072 + #sk_KRB5_ENCKEY_z�o +( +� +� + `SKM_sk_z�o +( +KRB5_ENCKEY +, (�)) + + ) + +1073 + #sk_KRB5_ENCKEY_push +( +� +, +v� +� + `SKM_sk_push +( +KRB5_ENCKEY +, (�), (v�)) + + ) + +1074 + #sk_KRB5_ENCKEY_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +KRB5_ENCKEY +, (�), (v�)) + + ) + +1075 + #sk_KRB5_ENCKEY_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +KRB5_ENCKEY +, (�), (v�)) + + ) + +1076 + #sk_KRB5_ENCKEY_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +KRB5_ENCKEY +, (�), (v�)) + + ) + +1077 + #sk_KRB5_ENCKEY_d��e +( +� +, +i +� + `SKM_sk_d��e +( +KRB5_ENCKEY +, (�), (i)) + + ) + +1078 + #sk_KRB5_ENCKEY_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +KRB5_ENCKEY +, (�), (�r)) + + ) + +1079 + #sk_KRB5_ENCKEY_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +KRB5_ENCKEY +, (�), (v�), (i)) + + ) + +1080 + #sk_KRB5_ENCKEY_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +KRB5_ENCKEY +, (�), (cmp)) + + ) + +1081 + #sk_KRB5_ENCKEY_dup +( +� +� + `SKM_sk_dup +( +KRB5_ENCKEY +, st) + + ) + +1082 + #sk_KRB5_ENCKEY_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +KRB5_ENCKEY +, (�), (�_func)) + + ) + +1083 + #sk_KRB5_ENCKEY_shi� +( +� +� + `SKM_sk_shi� +( +KRB5_ENCKEY +, (�)) + + ) + +1084 + #sk_KRB5_ENCKEY_p� +( +� +� + `SKM_sk_p� +( +KRB5_ENCKEY +, (�)) + + ) + +1085 + #sk_KRB5_ENCKEY_s�t +( +� +� + `SKM_sk_s�t +( +KRB5_ENCKEY +, (�)) + + ) + +1086 + #sk_KRB5_ENCKEY_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +KRB5_ENCKEY +, (�)) + + ) + +1088 + #sk_KRB5_PRINCNAME_�w +( +cmp +� + `SKM_sk_�w +( +KRB5_PRINCNAME +, (cmp)) + + ) + +1089 + #sk_KRB5_PRINCNAME_�w_nu� +(� + `SKM_sk_�w_nu� +( +KRB5_PRINCNAME +) + + ) + +1090 + #sk_KRB5_PRINCNAME_� +( +� +� + `SKM_sk_� +( +KRB5_PRINCNAME +, (�)) + + ) + +1091 + #sk_KRB5_PRINCNAME_num +( +� +� + `SKM_sk_num +( +KRB5_PRINCNAME +, (�)) + + ) + +1092 + #sk_KRB5_PRINCNAME_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +KRB5_PRINCNAME +, (�), (i)) + + ) + +1093 + #sk_KRB5_PRINCNAME_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +KRB5_PRINCNAME +, (�), (i), (v�)) + + ) + +1094 + #sk_KRB5_PRINCNAME_z�o +( +� +� + `SKM_sk_z�o +( +KRB5_PRINCNAME +, (�)) + + ) + +1095 + #sk_KRB5_PRINCNAME_push +( +� +, +v� +� + `SKM_sk_push +( +KRB5_PRINCNAME +, (�), (v�)) + + ) + +1096 + #sk_KRB5_PRINCNAME_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +KRB5_PRINCNAME +, (�), (v�)) + + ) + +1097 + #sk_KRB5_PRINCNAME_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +KRB5_PRINCNAME +, (�), (v�)) + + ) + +1098 + #sk_KRB5_PRINCNAME_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +KRB5_PRINCNAME +, (�), (v�)) + + ) + +1099 + #sk_KRB5_PRINCNAME_d��e +( +� +, +i +� + `SKM_sk_d��e +( +KRB5_PRINCNAME +, (�), (i)) + + ) + +1100 + #sk_KRB5_PRINCNAME_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +KRB5_PRINCNAME +, (�), (�r)) + + ) + +1101 + #sk_KRB5_PRINCNAME_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +KRB5_PRINCNAME +, (�), (v�), (i)) + + ) + +1102 + #sk_KRB5_PRINCNAME_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +KRB5_PRINCNAME +, (�), (cmp)) + + ) + +1103 + #sk_KRB5_PRINCNAME_dup +( +� +� + `SKM_sk_dup +( +KRB5_PRINCNAME +, st) + + ) + +1104 + #sk_KRB5_PRINCNAME_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +KRB5_PRINCNAME +, (�), (�_func)) + + ) + +1105 + #sk_KRB5_PRINCNAME_shi� +( +� +� + `SKM_sk_shi� +( +KRB5_PRINCNAME +, (�)) + + ) + +1106 + #sk_KRB5_PRINCNAME_p� +( +� +� + `SKM_sk_p� +( +KRB5_PRINCNAME +, (�)) + + ) + +1107 + #sk_KRB5_PRINCNAME_s�t +( +� +� + `SKM_sk_s�t +( +KRB5_PRINCNAME +, (�)) + + ) + +1108 + #sk_KRB5_PRINCNAME_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +KRB5_PRINCNAME +, (�)) + + ) + +1110 + #sk_KRB5_TKTBODY_�w +( +cmp +� + `SKM_sk_�w +( +KRB5_TKTBODY +, (cmp)) + + ) + +1111 + #sk_KRB5_TKTBODY_�w_nu� +(� + `SKM_sk_�w_nu� +( +KRB5_TKTBODY +) + + ) + +1112 + #sk_KRB5_TKTBODY_� +( +� +� + `SKM_sk_� +( +KRB5_TKTBODY +, (�)) + + ) + +1113 + #sk_KRB5_TKTBODY_num +( +� +� + `SKM_sk_num +( +KRB5_TKTBODY +, (�)) + + ) + +1114 + #sk_KRB5_TKTBODY_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +KRB5_TKTBODY +, (�), (i)) + + ) + +1115 + #sk_KRB5_TKTBODY_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +KRB5_TKTBODY +, (�), (i), (v�)) + + ) + +1116 + #sk_KRB5_TKTBODY_z�o +( +� +� + `SKM_sk_z�o +( +KRB5_TKTBODY +, (�)) + + ) + +1117 + #sk_KRB5_TKTBODY_push +( +� +, +v� +� + `SKM_sk_push +( +KRB5_TKTBODY +, (�), (v�)) + + ) + +1118 + #sk_KRB5_TKTBODY_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +KRB5_TKTBODY +, (�), (v�)) + + ) + +1119 + #sk_KRB5_TKTBODY_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +KRB5_TKTBODY +, (�), (v�)) + + ) + +1120 + #sk_KRB5_TKTBODY_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +KRB5_TKTBODY +, (�), (v�)) + + ) + +1121 + #sk_KRB5_TKTBODY_d��e +( +� +, +i +� + `SKM_sk_d��e +( +KRB5_TKTBODY +, (�), (i)) + + ) + +1122 + #sk_KRB5_TKTBODY_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +KRB5_TKTBODY +, (�), (�r)) + + ) + +1123 + #sk_KRB5_TKTBODY_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +KRB5_TKTBODY +, (�), (v�), (i)) + + ) + +1124 + #sk_KRB5_TKTBODY_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +KRB5_TKTBODY +, (�), (cmp)) + + ) + +1125 + #sk_KRB5_TKTBODY_dup +( +� +� + `SKM_sk_dup +( +KRB5_TKTBODY +, st) + + ) + +1126 + #sk_KRB5_TKTBODY_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +KRB5_TKTBODY +, (�), (�_func)) + + ) + +1127 + #sk_KRB5_TKTBODY_shi� +( +� +� + `SKM_sk_shi� +( +KRB5_TKTBODY +, (�)) + + ) + +1128 + #sk_KRB5_TKTBODY_p� +( +� +� + `SKM_sk_p� +( +KRB5_TKTBODY +, (�)) + + ) + +1129 + #sk_KRB5_TKTBODY_s�t +( +� +� + `SKM_sk_s�t +( +KRB5_TKTBODY +, (�)) + + ) + +1130 + #sk_KRB5_TKTBODY_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +KRB5_TKTBODY +, (�)) + + ) + +1132 + #sk_MEM_OBJECT_DATA_�w +( +cmp +� + `SKM_sk_�w +( +MEM_OBJECT_DATA +, (cmp)) + + ) + +1133 + #sk_MEM_OBJECT_DATA_�w_nu� +(� + `SKM_sk_�w_nu� +( +MEM_OBJECT_DATA +) + + ) + +1134 + #sk_MEM_OBJECT_DATA_� +( +� +� + `SKM_sk_� +( +MEM_OBJECT_DATA +, (�)) + + ) + +1135 + #sk_MEM_OBJECT_DATA_num +( +� +� + `SKM_sk_num +( +MEM_OBJECT_DATA +, (�)) + + ) + +1136 + #sk_MEM_OBJECT_DATA_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +MEM_OBJECT_DATA +, (�), (i)) + + ) + +1137 + #sk_MEM_OBJECT_DATA_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +MEM_OBJECT_DATA +, (�), (i), (v�)) + + ) + +1138 + #sk_MEM_OBJECT_DATA_z�o +( +� +� + `SKM_sk_z�o +( +MEM_OBJECT_DATA +, (�)) + + ) + +1139 + #sk_MEM_OBJECT_DATA_push +( +� +, +v� +� + `SKM_sk_push +( +MEM_OBJECT_DATA +, (�), (v�)) + + ) + +1140 + #sk_MEM_OBJECT_DATA_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +MEM_OBJECT_DATA +, (�), (v�)) + + ) + +1141 + #sk_MEM_OBJECT_DATA_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +MEM_OBJECT_DATA +, (�), (v�)) + + ) + +1142 + #sk_MEM_OBJECT_DATA_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +MEM_OBJECT_DATA +, (�), (v�)) + + ) + +1143 + #sk_MEM_OBJECT_DATA_d��e +( +� +, +i +� + `SKM_sk_d��e +( +MEM_OBJECT_DATA +, (�), (i)) + + ) + +1144 + #sk_MEM_OBJECT_DATA_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +MEM_OBJECT_DATA +, (�), (�r)) + + ) + +1145 + #sk_MEM_OBJECT_DATA_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +MEM_OBJECT_DATA +, (�), (v�), (i)) + + ) + +1146 + #sk_MEM_OBJECT_DATA_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +MEM_OBJECT_DATA +, (�), (cmp)) + + ) + +1147 + #sk_MEM_OBJECT_DATA_dup +( +� +� + `SKM_sk_dup +( +MEM_OBJECT_DATA +, st) + + ) + +1148 + #sk_MEM_OBJECT_DATA_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +MEM_OBJECT_DATA +, (�), (�_func)) + + ) + +1149 + #sk_MEM_OBJECT_DATA_shi� +( +� +� + `SKM_sk_shi� +( +MEM_OBJECT_DATA +, (�)) + + ) + +1150 + #sk_MEM_OBJECT_DATA_p� +( +� +� + `SKM_sk_p� +( +MEM_OBJECT_DATA +, (�)) + + ) + +1151 + #sk_MEM_OBJECT_DATA_s�t +( +� +� + `SKM_sk_s�t +( +MEM_OBJECT_DATA +, (�)) + + ) + +1152 + #sk_MEM_OBJECT_DATA_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +MEM_OBJECT_DATA +, (�)) + + ) + +1154 + #sk_MIME_HEADER_�w +( +cmp +� + `SKM_sk_�w +( +MIME_HEADER +, (cmp)) + + ) + +1155 + #sk_MIME_HEADER_�w_nu� +(� + `SKM_sk_�w_nu� +( +MIME_HEADER +) + + ) + +1156 + #sk_MIME_HEADER_� +( +� +� + `SKM_sk_� +( +MIME_HEADER +, (�)) + + ) + +1157 + #sk_MIME_HEADER_num +( +� +� + `SKM_sk_num +( +MIME_HEADER +, (�)) + + ) + +1158 + #sk_MIME_HEADER_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +MIME_HEADER +, (�), (i)) + + ) + +1159 + #sk_MIME_HEADER_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +MIME_HEADER +, (�), (i), (v�)) + + ) + +1160 + #sk_MIME_HEADER_z�o +( +� +� + `SKM_sk_z�o +( +MIME_HEADER +, (�)) + + ) + +1161 + #sk_MIME_HEADER_push +( +� +, +v� +� + `SKM_sk_push +( +MIME_HEADER +, (�), (v�)) + + ) + +1162 + #sk_MIME_HEADER_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +MIME_HEADER +, (�), (v�)) + + ) + +1163 + #sk_MIME_HEADER_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +MIME_HEADER +, (�), (v�)) + + ) + +1164 + #sk_MIME_HEADER_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +MIME_HEADER +, (�), (v�)) + + ) + +1165 + #sk_MIME_HEADER_d��e +( +� +, +i +� + `SKM_sk_d��e +( +MIME_HEADER +, (�), (i)) + + ) + +1166 + #sk_MIME_HEADER_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +MIME_HEADER +, (�), (�r)) + + ) + +1167 + #sk_MIME_HEADER_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +MIME_HEADER +, (�), (v�), (i)) + + ) + +1168 + #sk_MIME_HEADER_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +MIME_HEADER +, (�), (cmp)) + + ) + +1169 + #sk_MIME_HEADER_dup +( +� +� + `SKM_sk_dup +( +MIME_HEADER +, st) + + ) + +1170 + #sk_MIME_HEADER_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +MIME_HEADER +, (�), (�_func)) + + ) + +1171 + #sk_MIME_HEADER_shi� +( +� +� + `SKM_sk_shi� +( +MIME_HEADER +, (�)) + + ) + +1172 + #sk_MIME_HEADER_p� +( +� +� + `SKM_sk_p� +( +MIME_HEADER +, (�)) + + ) + +1173 + #sk_MIME_HEADER_s�t +( +� +� + `SKM_sk_s�t +( +MIME_HEADER +, (�)) + + ) + +1174 + #sk_MIME_HEADER_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +MIME_HEADER +, (�)) + + ) + +1176 + #sk_MIME_PARAM_�w +( +cmp +� + `SKM_sk_�w +( +MIME_PARAM +, (cmp)) + + ) + +1177 + #sk_MIME_PARAM_�w_nu� +(� + `SKM_sk_�w_nu� +( +MIME_PARAM +) + + ) + +1178 + #sk_MIME_PARAM_� +( +� +� + `SKM_sk_� +( +MIME_PARAM +, (�)) + + ) + +1179 + #sk_MIME_PARAM_num +( +� +� + `SKM_sk_num +( +MIME_PARAM +, (�)) + + ) + +1180 + #sk_MIME_PARAM_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +MIME_PARAM +, (�), (i)) + + ) + +1181 + #sk_MIME_PARAM_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +MIME_PARAM +, (�), (i), (v�)) + + ) + +1182 + #sk_MIME_PARAM_z�o +( +� +� + `SKM_sk_z�o +( +MIME_PARAM +, (�)) + + ) + +1183 + #sk_MIME_PARAM_push +( +� +, +v� +� + `SKM_sk_push +( +MIME_PARAM +, (�), (v�)) + + ) + +1184 + #sk_MIME_PARAM_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +MIME_PARAM +, (�), (v�)) + + ) + +1185 + #sk_MIME_PARAM_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +MIME_PARAM +, (�), (v�)) + + ) + +1186 + #sk_MIME_PARAM_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +MIME_PARAM +, (�), (v�)) + + ) + +1187 + #sk_MIME_PARAM_d��e +( +� +, +i +� + `SKM_sk_d��e +( +MIME_PARAM +, (�), (i)) + + ) + +1188 + #sk_MIME_PARAM_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +MIME_PARAM +, (�), (�r)) + + ) + +1189 + #sk_MIME_PARAM_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +MIME_PARAM +, (�), (v�), (i)) + + ) + +1190 + #sk_MIME_PARAM_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +MIME_PARAM +, (�), (cmp)) + + ) + +1191 + #sk_MIME_PARAM_dup +( +� +� + `SKM_sk_dup +( +MIME_PARAM +, st) + + ) + +1192 + #sk_MIME_PARAM_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +MIME_PARAM +, (�), (�_func)) + + ) + +1193 + #sk_MIME_PARAM_shi� +( +� +� + `SKM_sk_shi� +( +MIME_PARAM +, (�)) + + ) + +1194 + #sk_MIME_PARAM_p� +( +� +� + `SKM_sk_p� +( +MIME_PARAM +, (�)) + + ) + +1195 + #sk_MIME_PARAM_s�t +( +� +� + `SKM_sk_s�t +( +MIME_PARAM +, (�)) + + ) + +1196 + #sk_MIME_PARAM_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +MIME_PARAM +, (�)) + + ) + +1198 + #sk_NAME_FUNCS_�w +( +cmp +� + `SKM_sk_�w +( +NAME_FUNCS +, (cmp)) + + ) + +1199 + #sk_NAME_FUNCS_�w_nu� +(� + `SKM_sk_�w_nu� +( +NAME_FUNCS +) + + ) + +1200 + #sk_NAME_FUNCS_� +( +� +� + `SKM_sk_� +( +NAME_FUNCS +, (�)) + + ) + +1201 + #sk_NAME_FUNCS_num +( +� +� + `SKM_sk_num +( +NAME_FUNCS +, (�)) + + ) + +1202 + #sk_NAME_FUNCS_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +NAME_FUNCS +, (�), (i)) + + ) + +1203 + #sk_NAME_FUNCS_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +NAME_FUNCS +, (�), (i), (v�)) + + ) + +1204 + #sk_NAME_FUNCS_z�o +( +� +� + `SKM_sk_z�o +( +NAME_FUNCS +, (�)) + + ) + +1205 + #sk_NAME_FUNCS_push +( +� +, +v� +� + `SKM_sk_push +( +NAME_FUNCS +, (�), (v�)) + + ) + +1206 + #sk_NAME_FUNCS_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +NAME_FUNCS +, (�), (v�)) + + ) + +1207 + #sk_NAME_FUNCS_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +NAME_FUNCS +, (�), (v�)) + + ) + +1208 + #sk_NAME_FUNCS_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +NAME_FUNCS +, (�), (v�)) + + ) + +1209 + #sk_NAME_FUNCS_d��e +( +� +, +i +� + `SKM_sk_d��e +( +NAME_FUNCS +, (�), (i)) + + ) + +1210 + #sk_NAME_FUNCS_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +NAME_FUNCS +, (�), (�r)) + + ) + +1211 + #sk_NAME_FUNCS_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +NAME_FUNCS +, (�), (v�), (i)) + + ) + +1212 + #sk_NAME_FUNCS_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +NAME_FUNCS +, (�), (cmp)) + + ) + +1213 + #sk_NAME_FUNCS_dup +( +� +� + `SKM_sk_dup +( +NAME_FUNCS +, st) + + ) + +1214 + #sk_NAME_FUNCS_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +NAME_FUNCS +, (�), (�_func)) + + ) + +1215 + #sk_NAME_FUNCS_shi� +( +� +� + `SKM_sk_shi� +( +NAME_FUNCS +, (�)) + + ) + +1216 + #sk_NAME_FUNCS_p� +( +� +� + `SKM_sk_p� +( +NAME_FUNCS +, (�)) + + ) + +1217 + #sk_NAME_FUNCS_s�t +( +� +� + `SKM_sk_s�t +( +NAME_FUNCS +, (�)) + + ) + +1218 + #sk_NAME_FUNCS_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +NAME_FUNCS +, (�)) + + ) + +1220 + #sk_OCSP_CERTID_�w +( +cmp +� + `SKM_sk_�w +( +OCSP_CERTID +, (cmp)) + + ) + +1221 + #sk_OCSP_CERTID_�w_nu� +(� + `SKM_sk_�w_nu� +( +OCSP_CERTID +) + + ) + +1222 + #sk_OCSP_CERTID_� +( +� +� + `SKM_sk_� +( +OCSP_CERTID +, (�)) + + ) + +1223 + #sk_OCSP_CERTID_num +( +� +� + `SKM_sk_num +( +OCSP_CERTID +, (�)) + + ) + +1224 + #sk_OCSP_CERTID_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +OCSP_CERTID +, (�), (i)) + + ) + +1225 + #sk_OCSP_CERTID_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +OCSP_CERTID +, (�), (i), (v�)) + + ) + +1226 + #sk_OCSP_CERTID_z�o +( +� +� + `SKM_sk_z�o +( +OCSP_CERTID +, (�)) + + ) + +1227 + #sk_OCSP_CERTID_push +( +� +, +v� +� + `SKM_sk_push +( +OCSP_CERTID +, (�), (v�)) + + ) + +1228 + #sk_OCSP_CERTID_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +OCSP_CERTID +, (�), (v�)) + + ) + +1229 + #sk_OCSP_CERTID_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +OCSP_CERTID +, (�), (v�)) + + ) + +1230 + #sk_OCSP_CERTID_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +OCSP_CERTID +, (�), (v�)) + + ) + +1231 + #sk_OCSP_CERTID_d��e +( +� +, +i +� + `SKM_sk_d��e +( +OCSP_CERTID +, (�), (i)) + + ) + +1232 + #sk_OCSP_CERTID_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +OCSP_CERTID +, (�), (�r)) + + ) + +1233 + #sk_OCSP_CERTID_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +OCSP_CERTID +, (�), (v�), (i)) + + ) + +1234 + #sk_OCSP_CERTID_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +OCSP_CERTID +, (�), (cmp)) + + ) + +1235 + #sk_OCSP_CERTID_dup +( +� +� + `SKM_sk_dup +( +OCSP_CERTID +, st) + + ) + +1236 + #sk_OCSP_CERTID_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +OCSP_CERTID +, (�), (�_func)) + + ) + +1237 + #sk_OCSP_CERTID_shi� +( +� +� + `SKM_sk_shi� +( +OCSP_CERTID +, (�)) + + ) + +1238 + #sk_OCSP_CERTID_p� +( +� +� + `SKM_sk_p� +( +OCSP_CERTID +, (�)) + + ) + +1239 + #sk_OCSP_CERTID_s�t +( +� +� + `SKM_sk_s�t +( +OCSP_CERTID +, (�)) + + ) + +1240 + #sk_OCSP_CERTID_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +OCSP_CERTID +, (�)) + + ) + +1242 + #sk_OCSP_ONEREQ_�w +( +cmp +� + `SKM_sk_�w +( +OCSP_ONEREQ +, (cmp)) + + ) + +1243 + #sk_OCSP_ONEREQ_�w_nu� +(� + `SKM_sk_�w_nu� +( +OCSP_ONEREQ +) + + ) + +1244 + #sk_OCSP_ONEREQ_� +( +� +� + `SKM_sk_� +( +OCSP_ONEREQ +, (�)) + + ) + +1245 + #sk_OCSP_ONEREQ_num +( +� +� + `SKM_sk_num +( +OCSP_ONEREQ +, (�)) + + ) + +1246 + #sk_OCSP_ONEREQ_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +OCSP_ONEREQ +, (�), (i)) + + ) + +1247 + #sk_OCSP_ONEREQ_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +OCSP_ONEREQ +, (�), (i), (v�)) + + ) + +1248 + #sk_OCSP_ONEREQ_z�o +( +� +� + `SKM_sk_z�o +( +OCSP_ONEREQ +, (�)) + + ) + +1249 + #sk_OCSP_ONEREQ_push +( +� +, +v� +� + `SKM_sk_push +( +OCSP_ONEREQ +, (�), (v�)) + + ) + +1250 + #sk_OCSP_ONEREQ_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +OCSP_ONEREQ +, (�), (v�)) + + ) + +1251 + #sk_OCSP_ONEREQ_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +OCSP_ONEREQ +, (�), (v�)) + + ) + +1252 + #sk_OCSP_ONEREQ_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +OCSP_ONEREQ +, (�), (v�)) + + ) + +1253 + #sk_OCSP_ONEREQ_d��e +( +� +, +i +� + `SKM_sk_d��e +( +OCSP_ONEREQ +, (�), (i)) + + ) + +1254 + #sk_OCSP_ONEREQ_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +OCSP_ONEREQ +, (�), (�r)) + + ) + +1255 + #sk_OCSP_ONEREQ_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +OCSP_ONEREQ +, (�), (v�), (i)) + + ) + +1256 + #sk_OCSP_ONEREQ_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +OCSP_ONEREQ +, (�), (cmp)) + + ) + +1257 + #sk_OCSP_ONEREQ_dup +( +� +� + `SKM_sk_dup +( +OCSP_ONEREQ +, st) + + ) + +1258 + #sk_OCSP_ONEREQ_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +OCSP_ONEREQ +, (�), (�_func)) + + ) + +1259 + #sk_OCSP_ONEREQ_shi� +( +� +� + `SKM_sk_shi� +( +OCSP_ONEREQ +, (�)) + + ) + +1260 + #sk_OCSP_ONEREQ_p� +( +� +� + `SKM_sk_p� +( +OCSP_ONEREQ +, (�)) + + ) + +1261 + #sk_OCSP_ONEREQ_s�t +( +� +� + `SKM_sk_s�t +( +OCSP_ONEREQ +, (�)) + + ) + +1262 + #sk_OCSP_ONEREQ_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +OCSP_ONEREQ +, (�)) + + ) + +1264 + #sk_OCSP_RESPID_�w +( +cmp +� + `SKM_sk_�w +( +OCSP_RESPID +, (cmp)) + + ) + +1265 + #sk_OCSP_RESPID_�w_nu� +(� + `SKM_sk_�w_nu� +( +OCSP_RESPID +) + + ) + +1266 + #sk_OCSP_RESPID_� +( +� +� + `SKM_sk_� +( +OCSP_RESPID +, (�)) + + ) + +1267 + #sk_OCSP_RESPID_num +( +� +� + `SKM_sk_num +( +OCSP_RESPID +, (�)) + + ) + +1268 + #sk_OCSP_RESPID_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +OCSP_RESPID +, (�), (i)) + + ) + +1269 + #sk_OCSP_RESPID_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +OCSP_RESPID +, (�), (i), (v�)) + + ) + +1270 + #sk_OCSP_RESPID_z�o +( +� +� + `SKM_sk_z�o +( +OCSP_RESPID +, (�)) + + ) + +1271 + #sk_OCSP_RESPID_push +( +� +, +v� +� + `SKM_sk_push +( +OCSP_RESPID +, (�), (v�)) + + ) + +1272 + #sk_OCSP_RESPID_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +OCSP_RESPID +, (�), (v�)) + + ) + +1273 + #sk_OCSP_RESPID_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +OCSP_RESPID +, (�), (v�)) + + ) + +1274 + #sk_OCSP_RESPID_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +OCSP_RESPID +, (�), (v�)) + + ) + +1275 + #sk_OCSP_RESPID_d��e +( +� +, +i +� + `SKM_sk_d��e +( +OCSP_RESPID +, (�), (i)) + + ) + +1276 + #sk_OCSP_RESPID_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +OCSP_RESPID +, (�), (�r)) + + ) + +1277 + #sk_OCSP_RESPID_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +OCSP_RESPID +, (�), (v�), (i)) + + ) + +1278 + #sk_OCSP_RESPID_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +OCSP_RESPID +, (�), (cmp)) + + ) + +1279 + #sk_OCSP_RESPID_dup +( +� +� + `SKM_sk_dup +( +OCSP_RESPID +, st) + + ) + +1280 + #sk_OCSP_RESPID_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +OCSP_RESPID +, (�), (�_func)) + + ) + +1281 + #sk_OCSP_RESPID_shi� +( +� +� + `SKM_sk_shi� +( +OCSP_RESPID +, (�)) + + ) + +1282 + #sk_OCSP_RESPID_p� +( +� +� + `SKM_sk_p� +( +OCSP_RESPID +, (�)) + + ) + +1283 + #sk_OCSP_RESPID_s�t +( +� +� + `SKM_sk_s�t +( +OCSP_RESPID +, (�)) + + ) + +1284 + #sk_OCSP_RESPID_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +OCSP_RESPID +, (�)) + + ) + +1286 + #sk_OCSP_SINGLERESP_�w +( +cmp +� + `SKM_sk_�w +( +OCSP_SINGLERESP +, (cmp)) + + ) + +1287 + #sk_OCSP_SINGLERESP_�w_nu� +(� + `SKM_sk_�w_nu� +( +OCSP_SINGLERESP +) + + ) + +1288 + #sk_OCSP_SINGLERESP_� +( +� +� + `SKM_sk_� +( +OCSP_SINGLERESP +, (�)) + + ) + +1289 + #sk_OCSP_SINGLERESP_num +( +� +� + `SKM_sk_num +( +OCSP_SINGLERESP +, (�)) + + ) + +1290 + #sk_OCSP_SINGLERESP_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +OCSP_SINGLERESP +, (�), (i)) + + ) + +1291 + #sk_OCSP_SINGLERESP_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +OCSP_SINGLERESP +, (�), (i), (v�)) + + ) + +1292 + #sk_OCSP_SINGLERESP_z�o +( +� +� + `SKM_sk_z�o +( +OCSP_SINGLERESP +, (�)) + + ) + +1293 + #sk_OCSP_SINGLERESP_push +( +� +, +v� +� + `SKM_sk_push +( +OCSP_SINGLERESP +, (�), (v�)) + + ) + +1294 + #sk_OCSP_SINGLERESP_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +OCSP_SINGLERESP +, (�), (v�)) + + ) + +1295 + #sk_OCSP_SINGLERESP_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +OCSP_SINGLERESP +, (�), (v�)) + + ) + +1296 + #sk_OCSP_SINGLERESP_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +OCSP_SINGLERESP +, (�), (v�)) + + ) + +1297 + #sk_OCSP_SINGLERESP_d��e +( +� +, +i +� + `SKM_sk_d��e +( +OCSP_SINGLERESP +, (�), (i)) + + ) + +1298 + #sk_OCSP_SINGLERESP_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +OCSP_SINGLERESP +, (�), (�r)) + + ) + +1299 + #sk_OCSP_SINGLERESP_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +OCSP_SINGLERESP +, (�), (v�), (i)) + + ) + +1300 + #sk_OCSP_SINGLERESP_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +OCSP_SINGLERESP +, (�), (cmp)) + + ) + +1301 + #sk_OCSP_SINGLERESP_dup +( +� +� + `SKM_sk_dup +( +OCSP_SINGLERESP +, st) + + ) + +1302 + #sk_OCSP_SINGLERESP_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +OCSP_SINGLERESP +, (�), (�_func)) + + ) + +1303 + #sk_OCSP_SINGLERESP_shi� +( +� +� + `SKM_sk_shi� +( +OCSP_SINGLERESP +, (�)) + + ) + +1304 + #sk_OCSP_SINGLERESP_p� +( +� +� + `SKM_sk_p� +( +OCSP_SINGLERESP +, (�)) + + ) + +1305 + #sk_OCSP_SINGLERESP_s�t +( +� +� + `SKM_sk_s�t +( +OCSP_SINGLERESP +, (�)) + + ) + +1306 + #sk_OCSP_SINGLERESP_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +OCSP_SINGLERESP +, (�)) + + ) + +1308 + #sk_PKCS12_SAFEBAG_�w +( +cmp +� + `SKM_sk_�w +( +PKCS12_SAFEBAG +, (cmp)) + + ) + +1309 + #sk_PKCS12_SAFEBAG_�w_nu� +(� + `SKM_sk_�w_nu� +( +PKCS12_SAFEBAG +) + + ) + +1310 + #sk_PKCS12_SAFEBAG_� +( +� +� + `SKM_sk_� +( +PKCS12_SAFEBAG +, (�)) + + ) + +1311 + #sk_PKCS12_SAFEBAG_num +( +� +� + `SKM_sk_num +( +PKCS12_SAFEBAG +, (�)) + + ) + +1312 + #sk_PKCS12_SAFEBAG_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +PKCS12_SAFEBAG +, (�), (i)) + + ) + +1313 + #sk_PKCS12_SAFEBAG_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +PKCS12_SAFEBAG +, (�), (i), (v�)) + + ) + +1314 + #sk_PKCS12_SAFEBAG_z�o +( +� +� + `SKM_sk_z�o +( +PKCS12_SAFEBAG +, (�)) + + ) + +1315 + #sk_PKCS12_SAFEBAG_push +( +� +, +v� +� + `SKM_sk_push +( +PKCS12_SAFEBAG +, (�), (v�)) + + ) + +1316 + #sk_PKCS12_SAFEBAG_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +PKCS12_SAFEBAG +, (�), (v�)) + + ) + +1317 + #sk_PKCS12_SAFEBAG_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +PKCS12_SAFEBAG +, (�), (v�)) + + ) + +1318 + #sk_PKCS12_SAFEBAG_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +PKCS12_SAFEBAG +, (�), (v�)) + + ) + +1319 + #sk_PKCS12_SAFEBAG_d��e +( +� +, +i +� + `SKM_sk_d��e +( +PKCS12_SAFEBAG +, (�), (i)) + + ) + +1320 + #sk_PKCS12_SAFEBAG_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +PKCS12_SAFEBAG +, (�), (�r)) + + ) + +1321 + #sk_PKCS12_SAFEBAG_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +PKCS12_SAFEBAG +, (�), (v�), (i)) + + ) + +1322 + #sk_PKCS12_SAFEBAG_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +PKCS12_SAFEBAG +, (�), (cmp)) + + ) + +1323 + #sk_PKCS12_SAFEBAG_dup +( +� +� + `SKM_sk_dup +( +PKCS12_SAFEBAG +, st) + + ) + +1324 + #sk_PKCS12_SAFEBAG_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +PKCS12_SAFEBAG +, (�), (�_func)) + + ) + +1325 + #sk_PKCS12_SAFEBAG_shi� +( +� +� + `SKM_sk_shi� +( +PKCS12_SAFEBAG +, (�)) + + ) + +1326 + #sk_PKCS12_SAFEBAG_p� +( +� +� + `SKM_sk_p� +( +PKCS12_SAFEBAG +, (�)) + + ) + +1327 + #sk_PKCS12_SAFEBAG_s�t +( +� +� + `SKM_sk_s�t +( +PKCS12_SAFEBAG +, (�)) + + ) + +1328 + #sk_PKCS12_SAFEBAG_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +PKCS12_SAFEBAG +, (�)) + + ) + +1330 + #sk_PKCS7_�w +( +cmp +� + `SKM_sk_�w +( +PKCS7 +, (cmp)) + + ) + +1331 + #sk_PKCS7_�w_nu� +(� + `SKM_sk_�w_nu� +( +PKCS7 +) + + ) + +1332 + #sk_PKCS7_� +( +� +� + `SKM_sk_� +( +PKCS7 +, (�)) + + ) + +1333 + #sk_PKCS7_num +( +� +� + `SKM_sk_num +( +PKCS7 +, (�)) + + ) + +1334 + #sk_PKCS7_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +PKCS7 +, (�), (i)) + + ) + +1335 + #sk_PKCS7_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +PKCS7 +, (�), (i), (v�)) + + ) + +1336 + #sk_PKCS7_z�o +( +� +� + `SKM_sk_z�o +( +PKCS7 +, (�)) + + ) + +1337 + #sk_PKCS7_push +( +� +, +v� +� + `SKM_sk_push +( +PKCS7 +, (�), (v�)) + + ) + +1338 + #sk_PKCS7_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +PKCS7 +, (�), (v�)) + + ) + +1339 + #sk_PKCS7_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +PKCS7 +, (�), (v�)) + + ) + +1340 + #sk_PKCS7_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +PKCS7 +, (�), (v�)) + + ) + +1341 + #sk_PKCS7_d��e +( +� +, +i +� + `SKM_sk_d��e +( +PKCS7 +, (�), (i)) + + ) + +1342 + #sk_PKCS7_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +PKCS7 +, (�), (�r)) + + ) + +1343 + #sk_PKCS7_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +PKCS7 +, (�), (v�), (i)) + + ) + +1344 + #sk_PKCS7_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +PKCS7 +, (�), (cmp)) + + ) + +1345 + #sk_PKCS7_dup +( +� +� + `SKM_sk_dup +( +PKCS7 +, st) + + ) + +1346 + #sk_PKCS7_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +PKCS7 +, (�), (�_func)) + + ) + +1347 + #sk_PKCS7_shi� +( +� +� + `SKM_sk_shi� +( +PKCS7 +, (�)) + + ) + +1348 + #sk_PKCS7_p� +( +� +� + `SKM_sk_p� +( +PKCS7 +, (�)) + + ) + +1349 + #sk_PKCS7_s�t +( +� +� + `SKM_sk_s�t +( +PKCS7 +, (�)) + + ) + +1350 + #sk_PKCS7_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +PKCS7 +, (�)) + + ) + +1352 + #sk_PKCS7_RECIP_INFO_�w +( +cmp +� + `SKM_sk_�w +( +PKCS7_RECIP_INFO +, (cmp)) + + ) + +1353 + #sk_PKCS7_RECIP_INFO_�w_nu� +(� + `SKM_sk_�w_nu� +( +PKCS7_RECIP_INFO +) + + ) + +1354 + #sk_PKCS7_RECIP_INFO_� +( +� +� + `SKM_sk_� +( +PKCS7_RECIP_INFO +, (�)) + + ) + +1355 + #sk_PKCS7_RECIP_INFO_num +( +� +� + `SKM_sk_num +( +PKCS7_RECIP_INFO +, (�)) + + ) + +1356 + #sk_PKCS7_RECIP_INFO_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +PKCS7_RECIP_INFO +, (�), (i)) + + ) + +1357 + #sk_PKCS7_RECIP_INFO_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +PKCS7_RECIP_INFO +, (�), (i), (v�)) + + ) + +1358 + #sk_PKCS7_RECIP_INFO_z�o +( +� +� + `SKM_sk_z�o +( +PKCS7_RECIP_INFO +, (�)) + + ) + +1359 + #sk_PKCS7_RECIP_INFO_push +( +� +, +v� +� + `SKM_sk_push +( +PKCS7_RECIP_INFO +, (�), (v�)) + + ) + +1360 + #sk_PKCS7_RECIP_INFO_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +PKCS7_RECIP_INFO +, (�), (v�)) + + ) + +1361 + #sk_PKCS7_RECIP_INFO_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +PKCS7_RECIP_INFO +, (�), (v�)) + + ) + +1362 + #sk_PKCS7_RECIP_INFO_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +PKCS7_RECIP_INFO +, (�), (v�)) + + ) + +1363 + #sk_PKCS7_RECIP_INFO_d��e +( +� +, +i +� + `SKM_sk_d��e +( +PKCS7_RECIP_INFO +, (�), (i)) + + ) + +1364 + #sk_PKCS7_RECIP_INFO_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +PKCS7_RECIP_INFO +, (�), (�r)) + + ) + +1365 + #sk_PKCS7_RECIP_INFO_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +PKCS7_RECIP_INFO +, (�), (v�), (i)) + + ) + +1366 + #sk_PKCS7_RECIP_INFO_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +PKCS7_RECIP_INFO +, (�), (cmp)) + + ) + +1367 + #sk_PKCS7_RECIP_INFO_dup +( +� +� + `SKM_sk_dup +( +PKCS7_RECIP_INFO +, st) + + ) + +1368 + #sk_PKCS7_RECIP_INFO_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +PKCS7_RECIP_INFO +, (�), (�_func)) + + ) + +1369 + #sk_PKCS7_RECIP_INFO_shi� +( +� +� + `SKM_sk_shi� +( +PKCS7_RECIP_INFO +, (�)) + + ) + +1370 + #sk_PKCS7_RECIP_INFO_p� +( +� +� + `SKM_sk_p� +( +PKCS7_RECIP_INFO +, (�)) + + ) + +1371 + #sk_PKCS7_RECIP_INFO_s�t +( +� +� + `SKM_sk_s�t +( +PKCS7_RECIP_INFO +, (�)) + + ) + +1372 + #sk_PKCS7_RECIP_INFO_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +PKCS7_RECIP_INFO +, (�)) + + ) + +1374 + #sk_PKCS7_SIGNER_INFO_�w +( +cmp +� + `SKM_sk_�w +( +PKCS7_SIGNER_INFO +, (cmp)) + + ) + +1375 + #sk_PKCS7_SIGNER_INFO_�w_nu� +(� + `SKM_sk_�w_nu� +( +PKCS7_SIGNER_INFO +) + + ) + +1376 + #sk_PKCS7_SIGNER_INFO_� +( +� +� + `SKM_sk_� +( +PKCS7_SIGNER_INFO +, (�)) + + ) + +1377 + #sk_PKCS7_SIGNER_INFO_num +( +� +� + `SKM_sk_num +( +PKCS7_SIGNER_INFO +, (�)) + + ) + +1378 + #sk_PKCS7_SIGNER_INFO_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +PKCS7_SIGNER_INFO +, (�), (i)) + + ) + +1379 + #sk_PKCS7_SIGNER_INFO_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +PKCS7_SIGNER_INFO +, (�), (i), (v�)) + + ) + +1380 + #sk_PKCS7_SIGNER_INFO_z�o +( +� +� + `SKM_sk_z�o +( +PKCS7_SIGNER_INFO +, (�)) + + ) + +1381 + #sk_PKCS7_SIGNER_INFO_push +( +� +, +v� +� + `SKM_sk_push +( +PKCS7_SIGNER_INFO +, (�), (v�)) + + ) + +1382 + #sk_PKCS7_SIGNER_INFO_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +PKCS7_SIGNER_INFO +, (�), (v�)) + + ) + +1383 + #sk_PKCS7_SIGNER_INFO_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +PKCS7_SIGNER_INFO +, (�), (v�)) + + ) + +1384 + #sk_PKCS7_SIGNER_INFO_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +PKCS7_SIGNER_INFO +, (�), (v�)) + + ) + +1385 + #sk_PKCS7_SIGNER_INFO_d��e +( +� +, +i +� + `SKM_sk_d��e +( +PKCS7_SIGNER_INFO +, (�), (i)) + + ) + +1386 + #sk_PKCS7_SIGNER_INFO_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +PKCS7_SIGNER_INFO +, (�), (�r)) + + ) + +1387 + #sk_PKCS7_SIGNER_INFO_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +PKCS7_SIGNER_INFO +, (�), (v�), (i)) + + ) + +1388 + #sk_PKCS7_SIGNER_INFO_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +PKCS7_SIGNER_INFO +, (�), (cmp)) + + ) + +1389 + #sk_PKCS7_SIGNER_INFO_dup +( +� +� + `SKM_sk_dup +( +PKCS7_SIGNER_INFO +, st) + + ) + +1390 + #sk_PKCS7_SIGNER_INFO_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +PKCS7_SIGNER_INFO +, (�), (�_func)) + + ) + +1391 + #sk_PKCS7_SIGNER_INFO_shi� +( +� +� + `SKM_sk_shi� +( +PKCS7_SIGNER_INFO +, (�)) + + ) + +1392 + #sk_PKCS7_SIGNER_INFO_p� +( +� +� + `SKM_sk_p� +( +PKCS7_SIGNER_INFO +, (�)) + + ) + +1393 + #sk_PKCS7_SIGNER_INFO_s�t +( +� +� + `SKM_sk_s�t +( +PKCS7_SIGNER_INFO +, (�)) + + ) + +1394 + #sk_PKCS7_SIGNER_INFO_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +PKCS7_SIGNER_INFO +, (�)) + + ) + +1396 + #sk_POLICYINFO_�w +( +cmp +� + `SKM_sk_�w +( +POLICYINFO +, (cmp)) + + ) + +1397 + #sk_POLICYINFO_�w_nu� +(� + `SKM_sk_�w_nu� +( +POLICYINFO +) + + ) + +1398 + #sk_POLICYINFO_� +( +� +� + `SKM_sk_� +( +POLICYINFO +, (�)) + + ) + +1399 + #sk_POLICYINFO_num +( +� +� + `SKM_sk_num +( +POLICYINFO +, (�)) + + ) + +1400 + #sk_POLICYINFO_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +POLICYINFO +, (�), (i)) + + ) + +1401 + #sk_POLICYINFO_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +POLICYINFO +, (�), (i), (v�)) + + ) + +1402 + #sk_POLICYINFO_z�o +( +� +� + `SKM_sk_z�o +( +POLICYINFO +, (�)) + + ) + +1403 + #sk_POLICYINFO_push +( +� +, +v� +� + `SKM_sk_push +( +POLICYINFO +, (�), (v�)) + + ) + +1404 + #sk_POLICYINFO_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +POLICYINFO +, (�), (v�)) + + ) + +1405 + #sk_POLICYINFO_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +POLICYINFO +, (�), (v�)) + + ) + +1406 + #sk_POLICYINFO_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +POLICYINFO +, (�), (v�)) + + ) + +1407 + #sk_POLICYINFO_d��e +( +� +, +i +� + `SKM_sk_d��e +( +POLICYINFO +, (�), (i)) + + ) + +1408 + #sk_POLICYINFO_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +POLICYINFO +, (�), (�r)) + + ) + +1409 + #sk_POLICYINFO_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +POLICYINFO +, (�), (v�), (i)) + + ) + +1410 + #sk_POLICYINFO_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +POLICYINFO +, (�), (cmp)) + + ) + +1411 + #sk_POLICYINFO_dup +( +� +� + `SKM_sk_dup +( +POLICYINFO +, st) + + ) + +1412 + #sk_POLICYINFO_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +POLICYINFO +, (�), (�_func)) + + ) + +1413 + #sk_POLICYINFO_shi� +( +� +� + `SKM_sk_shi� +( +POLICYINFO +, (�)) + + ) + +1414 + #sk_POLICYINFO_p� +( +� +� + `SKM_sk_p� +( +POLICYINFO +, (�)) + + ) + +1415 + #sk_POLICYINFO_s�t +( +� +� + `SKM_sk_s�t +( +POLICYINFO +, (�)) + + ) + +1416 + #sk_POLICYINFO_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +POLICYINFO +, (�)) + + ) + +1418 + #sk_POLICYQUALINFO_�w +( +cmp +� + `SKM_sk_�w +( +POLICYQUALINFO +, (cmp)) + + ) + +1419 + #sk_POLICYQUALINFO_�w_nu� +(� + `SKM_sk_�w_nu� +( +POLICYQUALINFO +) + + ) + +1420 + #sk_POLICYQUALINFO_� +( +� +� + `SKM_sk_� +( +POLICYQUALINFO +, (�)) + + ) + +1421 + #sk_POLICYQUALINFO_num +( +� +� + `SKM_sk_num +( +POLICYQUALINFO +, (�)) + + ) + +1422 + #sk_POLICYQUALINFO_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +POLICYQUALINFO +, (�), (i)) + + ) + +1423 + #sk_POLICYQUALINFO_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +POLICYQUALINFO +, (�), (i), (v�)) + + ) + +1424 + #sk_POLICYQUALINFO_z�o +( +� +� + `SKM_sk_z�o +( +POLICYQUALINFO +, (�)) + + ) + +1425 + #sk_POLICYQUALINFO_push +( +� +, +v� +� + `SKM_sk_push +( +POLICYQUALINFO +, (�), (v�)) + + ) + +1426 + #sk_POLICYQUALINFO_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +POLICYQUALINFO +, (�), (v�)) + + ) + +1427 + #sk_POLICYQUALINFO_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +POLICYQUALINFO +, (�), (v�)) + + ) + +1428 + #sk_POLICYQUALINFO_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +POLICYQUALINFO +, (�), (v�)) + + ) + +1429 + #sk_POLICYQUALINFO_d��e +( +� +, +i +� + `SKM_sk_d��e +( +POLICYQUALINFO +, (�), (i)) + + ) + +1430 + #sk_POLICYQUALINFO_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +POLICYQUALINFO +, (�), (�r)) + + ) + +1431 + #sk_POLICYQUALINFO_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +POLICYQUALINFO +, (�), (v�), (i)) + + ) + +1432 + #sk_POLICYQUALINFO_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +POLICYQUALINFO +, (�), (cmp)) + + ) + +1433 + #sk_POLICYQUALINFO_dup +( +� +� + `SKM_sk_dup +( +POLICYQUALINFO +, st) + + ) + +1434 + #sk_POLICYQUALINFO_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +POLICYQUALINFO +, (�), (�_func)) + + ) + +1435 + #sk_POLICYQUALINFO_shi� +( +� +� + `SKM_sk_shi� +( +POLICYQUALINFO +, (�)) + + ) + +1436 + #sk_POLICYQUALINFO_p� +( +� +� + `SKM_sk_p� +( +POLICYQUALINFO +, (�)) + + ) + +1437 + #sk_POLICYQUALINFO_s�t +( +� +� + `SKM_sk_s�t +( +POLICYQUALINFO +, (�)) + + ) + +1438 + #sk_POLICYQUALINFO_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +POLICYQUALINFO +, (�)) + + ) + +1440 + #sk_POLICY_MAPPING_�w +( +cmp +� + `SKM_sk_�w +( +POLICY_MAPPING +, (cmp)) + + ) + +1441 + #sk_POLICY_MAPPING_�w_nu� +(� + `SKM_sk_�w_nu� +( +POLICY_MAPPING +) + + ) + +1442 + #sk_POLICY_MAPPING_� +( +� +� + `SKM_sk_� +( +POLICY_MAPPING +, (�)) + + ) + +1443 + #sk_POLICY_MAPPING_num +( +� +� + `SKM_sk_num +( +POLICY_MAPPING +, (�)) + + ) + +1444 + #sk_POLICY_MAPPING_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +POLICY_MAPPING +, (�), (i)) + + ) + +1445 + #sk_POLICY_MAPPING_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +POLICY_MAPPING +, (�), (i), (v�)) + + ) + +1446 + #sk_POLICY_MAPPING_z�o +( +� +� + `SKM_sk_z�o +( +POLICY_MAPPING +, (�)) + + ) + +1447 + #sk_POLICY_MAPPING_push +( +� +, +v� +� + `SKM_sk_push +( +POLICY_MAPPING +, (�), (v�)) + + ) + +1448 + #sk_POLICY_MAPPING_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +POLICY_MAPPING +, (�), (v�)) + + ) + +1449 + #sk_POLICY_MAPPING_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +POLICY_MAPPING +, (�), (v�)) + + ) + +1450 + #sk_POLICY_MAPPING_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +POLICY_MAPPING +, (�), (v�)) + + ) + +1451 + #sk_POLICY_MAPPING_d��e +( +� +, +i +� + `SKM_sk_d��e +( +POLICY_MAPPING +, (�), (i)) + + ) + +1452 + #sk_POLICY_MAPPING_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +POLICY_MAPPING +, (�), (�r)) + + ) + +1453 + #sk_POLICY_MAPPING_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +POLICY_MAPPING +, (�), (v�), (i)) + + ) + +1454 + #sk_POLICY_MAPPING_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +POLICY_MAPPING +, (�), (cmp)) + + ) + +1455 + #sk_POLICY_MAPPING_dup +( +� +� + `SKM_sk_dup +( +POLICY_MAPPING +, st) + + ) + +1456 + #sk_POLICY_MAPPING_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +POLICY_MAPPING +, (�), (�_func)) + + ) + +1457 + #sk_POLICY_MAPPING_shi� +( +� +� + `SKM_sk_shi� +( +POLICY_MAPPING +, (�)) + + ) + +1458 + #sk_POLICY_MAPPING_p� +( +� +� + `SKM_sk_p� +( +POLICY_MAPPING +, (�)) + + ) + +1459 + #sk_POLICY_MAPPING_s�t +( +� +� + `SKM_sk_s�t +( +POLICY_MAPPING +, (�)) + + ) + +1460 + #sk_POLICY_MAPPING_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +POLICY_MAPPING +, (�)) + + ) + +1462 + #sk_SRP_gN_�w +( +cmp +� + `SKM_sk_�w +( +SRP_gN +, (cmp)) + + ) + +1463 + #sk_SRP_gN_�w_nu� +(� + `SKM_sk_�w_nu� +( +SRP_gN +) + + ) + +1464 + #sk_SRP_gN_� +( +� +� + `SKM_sk_� +( +SRP_gN +, (�)) + + ) + +1465 + #sk_SRP_gN_num +( +� +� + `SKM_sk_num +( +SRP_gN +, (�)) + + ) + +1466 + #sk_SRP_gN_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +SRP_gN +, (�), (i)) + + ) + +1467 + #sk_SRP_gN_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +SRP_gN +, (�), (i), (v�)) + + ) + +1468 + #sk_SRP_gN_z�o +( +� +� + `SKM_sk_z�o +( +SRP_gN +, (�)) + + ) + +1469 + #sk_SRP_gN_push +( +� +, +v� +� + `SKM_sk_push +( +SRP_gN +, (�), (v�)) + + ) + +1470 + #sk_SRP_gN_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +SRP_gN +, (�), (v�)) + + ) + +1471 + #sk_SRP_gN_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +SRP_gN +, (�), (v�)) + + ) + +1472 + #sk_SRP_gN_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +SRP_gN +, (�), (v�)) + + ) + +1473 + #sk_SRP_gN_d��e +( +� +, +i +� + `SKM_sk_d��e +( +SRP_gN +, (�), (i)) + + ) + +1474 + #sk_SRP_gN_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +SRP_gN +, (�), (�r)) + + ) + +1475 + #sk_SRP_gN_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +SRP_gN +, (�), (v�), (i)) + + ) + +1476 + #sk_SRP_gN_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +SRP_gN +, (�), (cmp)) + + ) + +1477 + #sk_SRP_gN_dup +( +� +� + `SKM_sk_dup +( +SRP_gN +, st) + + ) + +1478 + #sk_SRP_gN_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +SRP_gN +, (�), (�_func)) + + ) + +1479 + #sk_SRP_gN_shi� +( +� +� + `SKM_sk_shi� +( +SRP_gN +, (�)) + + ) + +1480 + #sk_SRP_gN_p� +( +� +� + `SKM_sk_p� +( +SRP_gN +, (�)) + + ) + +1481 + #sk_SRP_gN_s�t +( +� +� + `SKM_sk_s�t +( +SRP_gN +, (�)) + + ) + +1482 + #sk_SRP_gN_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +SRP_gN +, (�)) + + ) + +1484 + #sk_SRP_gN_�che_�w +( +cmp +� + `SKM_sk_�w +( +SRP_gN_�che +, (cmp)) + + ) + +1485 + #sk_SRP_gN_�che_�w_nu� +(� + `SKM_sk_�w_nu� +( +SRP_gN_�che +) + + ) + +1486 + #sk_SRP_gN_�che_� +( +� +� + `SKM_sk_� +( +SRP_gN_�che +, (�)) + + ) + +1487 + #sk_SRP_gN_�che_num +( +� +� + `SKM_sk_num +( +SRP_gN_�che +, (�)) + + ) + +1488 + #sk_SRP_gN_�che_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +SRP_gN_�che +, (�), (i)) + + ) + +1489 + #sk_SRP_gN_�che_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +SRP_gN_�che +, (�), (i), (v�)) + + ) + +1490 + #sk_SRP_gN_�che_z�o +( +� +� + `SKM_sk_z�o +( +SRP_gN_�che +, (�)) + + ) + +1491 + #sk_SRP_gN_�che_push +( +� +, +v� +� + `SKM_sk_push +( +SRP_gN_�che +, (�), (v�)) + + ) + +1492 + #sk_SRP_gN_�che_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +SRP_gN_�che +, (�), (v�)) + + ) + +1493 + #sk_SRP_gN_�che_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +SRP_gN_�che +, (�), (v�)) + + ) + +1494 + #sk_SRP_gN_�che_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +SRP_gN_�che +, (�), (v�)) + + ) + +1495 + #sk_SRP_gN_�che_d��e +( +� +, +i +� + `SKM_sk_d��e +( +SRP_gN_�che +, (�), (i)) + + ) + +1496 + #sk_SRP_gN_�che_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +SRP_gN_�che +, (�), (�r)) + + ) + +1497 + #sk_SRP_gN_�che_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +SRP_gN_�che +, (�), (v�), (i)) + + ) + +1498 + #sk_SRP_gN_�che_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +SRP_gN_�che +, (�), (cmp)) + + ) + +1499 + #sk_SRP_gN_�che_dup +( +� +� + `SKM_sk_dup +( +SRP_gN_�che +, st) + + ) + +1500 + #sk_SRP_gN_�che_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +SRP_gN_�che +, (�), (�_func)) + + ) + +1501 + #sk_SRP_gN_�che_shi� +( +� +� + `SKM_sk_shi� +( +SRP_gN_�che +, (�)) + + ) + +1502 + #sk_SRP_gN_�che_p� +( +� +� + `SKM_sk_p� +( +SRP_gN_�che +, (�)) + + ) + +1503 + #sk_SRP_gN_�che_s�t +( +� +� + `SKM_sk_s�t +( +SRP_gN_�che +, (�)) + + ) + +1504 + #sk_SRP_gN_�che_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +SRP_gN_�che +, (�)) + + ) + +1506 + #sk_SRP_u�r_pwd_�w +( +cmp +� + `SKM_sk_�w +( +SRP_u�r_pwd +, (cmp)) + + ) + +1507 + #sk_SRP_u�r_pwd_�w_nu� +(� + `SKM_sk_�w_nu� +( +SRP_u�r_pwd +) + + ) + +1508 + #sk_SRP_u�r_pwd_� +( +� +� + `SKM_sk_� +( +SRP_u�r_pwd +, (�)) + + ) + +1509 + #sk_SRP_u�r_pwd_num +( +� +� + `SKM_sk_num +( +SRP_u�r_pwd +, (�)) + + ) + +1510 + #sk_SRP_u�r_pwd_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +SRP_u�r_pwd +, (�), (i)) + + ) + +1511 + #sk_SRP_u�r_pwd_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +SRP_u�r_pwd +, (�), (i), (v�)) + + ) + +1512 + #sk_SRP_u�r_pwd_z�o +( +� +� + `SKM_sk_z�o +( +SRP_u�r_pwd +, (�)) + + ) + +1513 + #sk_SRP_u�r_pwd_push +( +� +, +v� +� + `SKM_sk_push +( +SRP_u�r_pwd +, (�), (v�)) + + ) + +1514 + #sk_SRP_u�r_pwd_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +SRP_u�r_pwd +, (�), (v�)) + + ) + +1515 + #sk_SRP_u�r_pwd_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +SRP_u�r_pwd +, (�), (v�)) + + ) + +1516 + #sk_SRP_u�r_pwd_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +SRP_u�r_pwd +, (�), (v�)) + + ) + +1517 + #sk_SRP_u�r_pwd_d��e +( +� +, +i +� + `SKM_sk_d��e +( +SRP_u�r_pwd +, (�), (i)) + + ) + +1518 + #sk_SRP_u�r_pwd_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +SRP_u�r_pwd +, (�), (�r)) + + ) + +1519 + #sk_SRP_u�r_pwd_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +SRP_u�r_pwd +, (�), (v�), (i)) + + ) + +1520 + #sk_SRP_u�r_pwd_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +SRP_u�r_pwd +, (�), (cmp)) + + ) + +1521 + #sk_SRP_u�r_pwd_dup +( +� +� + `SKM_sk_dup +( +SRP_u�r_pwd +, st) + + ) + +1522 + #sk_SRP_u�r_pwd_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +SRP_u�r_pwd +, (�), (�_func)) + + ) + +1523 + #sk_SRP_u�r_pwd_shi� +( +� +� + `SKM_sk_shi� +( +SRP_u�r_pwd +, (�)) + + ) + +1524 + #sk_SRP_u�r_pwd_p� +( +� +� + `SKM_sk_p� +( +SRP_u�r_pwd +, (�)) + + ) + +1525 + #sk_SRP_u�r_pwd_s�t +( +� +� + `SKM_sk_s�t +( +SRP_u�r_pwd +, (�)) + + ) + +1526 + #sk_SRP_u�r_pwd_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +SRP_u�r_pwd +, (�)) + + ) + +1528 + #sk_SRTP_PROTECTION_PROFILE_�w +( +cmp +� + `SKM_sk_�w +( +SRTP_PROTECTION_PROFILE +, (cmp)) + + ) + +1529 + #sk_SRTP_PROTECTION_PROFILE_�w_nu� +(� + `SKM_sk_�w_nu� +( +SRTP_PROTECTION_PROFILE +) + + ) + +1530 + #sk_SRTP_PROTECTION_PROFILE_� +( +� +� + `SKM_sk_� +( +SRTP_PROTECTION_PROFILE +, (�)) + + ) + +1531 + #sk_SRTP_PROTECTION_PROFILE_num +( +� +� + `SKM_sk_num +( +SRTP_PROTECTION_PROFILE +, (�)) + + ) + +1532 + #sk_SRTP_PROTECTION_PROFILE_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +SRTP_PROTECTION_PROFILE +, (�), (i)) + + ) + +1533 + #sk_SRTP_PROTECTION_PROFILE_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +SRTP_PROTECTION_PROFILE +, (�), (i), (v�)) + + ) + +1534 + #sk_SRTP_PROTECTION_PROFILE_z�o +( +� +� + `SKM_sk_z�o +( +SRTP_PROTECTION_PROFILE +, (�)) + + ) + +1535 + #sk_SRTP_PROTECTION_PROFILE_push +( +� +, +v� +� + `SKM_sk_push +( +SRTP_PROTECTION_PROFILE +, (�), (v�)) + + ) + +1536 + #sk_SRTP_PROTECTION_PROFILE_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +SRTP_PROTECTION_PROFILE +, (�), (v�)) + + ) + +1537 + #sk_SRTP_PROTECTION_PROFILE_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +SRTP_PROTECTION_PROFILE +, (�), (v�)) + + ) + +1538 + #sk_SRTP_PROTECTION_PROFILE_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +SRTP_PROTECTION_PROFILE +, (�), (v�)) + + ) + +1539 + #sk_SRTP_PROTECTION_PROFILE_d��e +( +� +, +i +� + `SKM_sk_d��e +( +SRTP_PROTECTION_PROFILE +, (�), (i)) + + ) + +1540 + #sk_SRTP_PROTECTION_PROFILE_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +SRTP_PROTECTION_PROFILE +, (�), (�r)) + + ) + +1541 + #sk_SRTP_PROTECTION_PROFILE_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +SRTP_PROTECTION_PROFILE +, (�), (v�), (i)) + + ) + +1542 + #sk_SRTP_PROTECTION_PROFILE_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +SRTP_PROTECTION_PROFILE +, (�), (cmp)) + + ) + +1543 + #sk_SRTP_PROTECTION_PROFILE_dup +( +� +� + `SKM_sk_dup +( +SRTP_PROTECTION_PROFILE +, st) + + ) + +1544 + #sk_SRTP_PROTECTION_PROFILE_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +SRTP_PROTECTION_PROFILE +, (�), (�_func)) + + ) + +1545 + #sk_SRTP_PROTECTION_PROFILE_shi� +( +� +� + `SKM_sk_shi� +( +SRTP_PROTECTION_PROFILE +, (�)) + + ) + +1546 + #sk_SRTP_PROTECTION_PROFILE_p� +( +� +� + `SKM_sk_p� +( +SRTP_PROTECTION_PROFILE +, (�)) + + ) + +1547 + #sk_SRTP_PROTECTION_PROFILE_s�t +( +� +� + `SKM_sk_s�t +( +SRTP_PROTECTION_PROFILE +, (�)) + + ) + +1548 + #sk_SRTP_PROTECTION_PROFILE_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +SRTP_PROTECTION_PROFILE +, (�)) + + ) + +1550 + #sk_SSL_CIPHER_�w +( +cmp +� + `SKM_sk_�w +( +SSL_CIPHER +, (cmp)) + + ) + +1551 + #sk_SSL_CIPHER_�w_nu� +(� + `SKM_sk_�w_nu� +( +SSL_CIPHER +) + + ) + +1552 + #sk_SSL_CIPHER_� +( +� +� + `SKM_sk_� +( +SSL_CIPHER +, (�)) + + ) + +1553 + #sk_SSL_CIPHER_num +( +� +� + `SKM_sk_num +( +SSL_CIPHER +, (�)) + + ) + +1554 + #sk_SSL_CIPHER_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +SSL_CIPHER +, (�), (i)) + + ) + +1555 + #sk_SSL_CIPHER_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +SSL_CIPHER +, (�), (i), (v�)) + + ) + +1556 + #sk_SSL_CIPHER_z�o +( +� +� + `SKM_sk_z�o +( +SSL_CIPHER +, (�)) + + ) + +1557 + #sk_SSL_CIPHER_push +( +� +, +v� +� + `SKM_sk_push +( +SSL_CIPHER +, (�), (v�)) + + ) + +1558 + #sk_SSL_CIPHER_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +SSL_CIPHER +, (�), (v�)) + + ) + +1559 + #sk_SSL_CIPHER_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +SSL_CIPHER +, (�), (v�)) + + ) + +1560 + #sk_SSL_CIPHER_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +SSL_CIPHER +, (�), (v�)) + + ) + +1561 + #sk_SSL_CIPHER_d��e +( +� +, +i +� + `SKM_sk_d��e +( +SSL_CIPHER +, (�), (i)) + + ) + +1562 + #sk_SSL_CIPHER_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +SSL_CIPHER +, (�), (�r)) + + ) + +1563 + #sk_SSL_CIPHER_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +SSL_CIPHER +, (�), (v�), (i)) + + ) + +1564 + #sk_SSL_CIPHER_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +SSL_CIPHER +, (�), (cmp)) + + ) + +1565 + #sk_SSL_CIPHER_dup +( +� +� + `SKM_sk_dup +( +SSL_CIPHER +, st) + + ) + +1566 + #sk_SSL_CIPHER_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +SSL_CIPHER +, (�), (�_func)) + + ) + +1567 + #sk_SSL_CIPHER_shi� +( +� +� + `SKM_sk_shi� +( +SSL_CIPHER +, (�)) + + ) + +1568 + #sk_SSL_CIPHER_p� +( +� +� + `SKM_sk_p� +( +SSL_CIPHER +, (�)) + + ) + +1569 + #sk_SSL_CIPHER_s�t +( +� +� + `SKM_sk_s�t +( +SSL_CIPHER +, (�)) + + ) + +1570 + #sk_SSL_CIPHER_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +SSL_CIPHER +, (�)) + + ) + +1572 + #sk_SSL_COMP_�w +( +cmp +� + `SKM_sk_�w +( +SSL_COMP +, (cmp)) + + ) + +1573 + #sk_SSL_COMP_�w_nu� +(� + `SKM_sk_�w_nu� +( +SSL_COMP +) + + ) + +1574 + #sk_SSL_COMP_� +( +� +� + `SKM_sk_� +( +SSL_COMP +, (�)) + + ) + +1575 + #sk_SSL_COMP_num +( +� +� + `SKM_sk_num +( +SSL_COMP +, (�)) + + ) + +1576 + #sk_SSL_COMP_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +SSL_COMP +, (�), (i)) + + ) + +1577 + #sk_SSL_COMP_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +SSL_COMP +, (�), (i), (v�)) + + ) + +1578 + #sk_SSL_COMP_z�o +( +� +� + `SKM_sk_z�o +( +SSL_COMP +, (�)) + + ) + +1579 + #sk_SSL_COMP_push +( +� +, +v� +� + `SKM_sk_push +( +SSL_COMP +, (�), (v�)) + + ) + +1580 + #sk_SSL_COMP_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +SSL_COMP +, (�), (v�)) + + ) + +1581 + #sk_SSL_COMP_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +SSL_COMP +, (�), (v�)) + + ) + +1582 + #sk_SSL_COMP_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +SSL_COMP +, (�), (v�)) + + ) + +1583 + #sk_SSL_COMP_d��e +( +� +, +i +� + `SKM_sk_d��e +( +SSL_COMP +, (�), (i)) + + ) + +1584 + #sk_SSL_COMP_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +SSL_COMP +, (�), (�r)) + + ) + +1585 + #sk_SSL_COMP_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +SSL_COMP +, (�), (v�), (i)) + + ) + +1586 + #sk_SSL_COMP_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +SSL_COMP +, (�), (cmp)) + + ) + +1587 + #sk_SSL_COMP_dup +( +� +� + `SKM_sk_dup +( +SSL_COMP +, st) + + ) + +1588 + #sk_SSL_COMP_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +SSL_COMP +, (�), (�_func)) + + ) + +1589 + #sk_SSL_COMP_shi� +( +� +� + `SKM_sk_shi� +( +SSL_COMP +, (�)) + + ) + +1590 + #sk_SSL_COMP_p� +( +� +� + `SKM_sk_p� +( +SSL_COMP +, (�)) + + ) + +1591 + #sk_SSL_COMP_s�t +( +� +� + `SKM_sk_s�t +( +SSL_COMP +, (�)) + + ) + +1592 + #sk_SSL_COMP_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +SSL_COMP +, (�)) + + ) + +1594 + #sk_STACK_OF_X509_NAME_ENTRY_�w +( +cmp +� + `SKM_sk_�w +( +STACK_OF_X509_NAME_ENTRY +, (cmp)) + + ) + +1595 + #sk_STACK_OF_X509_NAME_ENTRY_�w_nu� +(� + `SKM_sk_�w_nu� +( +STACK_OF_X509_NAME_ENTRY +) + + ) + +1596 + #sk_STACK_OF_X509_NAME_ENTRY_� +( +� +� + `SKM_sk_� +( +STACK_OF_X509_NAME_ENTRY +, (�)) + + ) + +1597 + #sk_STACK_OF_X509_NAME_ENTRY_num +( +� +� + `SKM_sk_num +( +STACK_OF_X509_NAME_ENTRY +, (�)) + + ) + +1598 + #sk_STACK_OF_X509_NAME_ENTRY_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +STACK_OF_X509_NAME_ENTRY +, (�), (i)) + + ) + +1599 + #sk_STACK_OF_X509_NAME_ENTRY_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +STACK_OF_X509_NAME_ENTRY +, (�), (i), (v�)) + + ) + +1600 + #sk_STACK_OF_X509_NAME_ENTRY_z�o +( +� +� + `SKM_sk_z�o +( +STACK_OF_X509_NAME_ENTRY +, (�)) + + ) + +1601 + #sk_STACK_OF_X509_NAME_ENTRY_push +( +� +, +v� +� + `SKM_sk_push +( +STACK_OF_X509_NAME_ENTRY +, (�), (v�)) + + ) + +1602 + #sk_STACK_OF_X509_NAME_ENTRY_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +STACK_OF_X509_NAME_ENTRY +, (�), (v�)) + + ) + +1603 + #sk_STACK_OF_X509_NAME_ENTRY_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +STACK_OF_X509_NAME_ENTRY +, (�), (v�)) + + ) + +1604 + #sk_STACK_OF_X509_NAME_ENTRY_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +STACK_OF_X509_NAME_ENTRY +, (�), (v�)) + + ) + +1605 + #sk_STACK_OF_X509_NAME_ENTRY_d��e +( +� +, +i +� + `SKM_sk_d��e +( +STACK_OF_X509_NAME_ENTRY +, (�), (i)) + + ) + +1606 + #sk_STACK_OF_X509_NAME_ENTRY_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +STACK_OF_X509_NAME_ENTRY +, (�), (�r)) + + ) + +1607 + #sk_STACK_OF_X509_NAME_ENTRY_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +STACK_OF_X509_NAME_ENTRY +, (�), (v�), (i)) + + ) + +1608 + #sk_STACK_OF_X509_NAME_ENTRY_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +STACK_OF_X509_NAME_ENTRY +, (�), (cmp)) + + ) + +1609 + #sk_STACK_OF_X509_NAME_ENTRY_dup +( +� +� + `SKM_sk_dup +( +STACK_OF_X509_NAME_ENTRY +, st) + + ) + +1610 + #sk_STACK_OF_X509_NAME_ENTRY_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +STACK_OF_X509_NAME_ENTRY +, (�), (�_func)) + + ) + +1611 + #sk_STACK_OF_X509_NAME_ENTRY_shi� +( +� +� + `SKM_sk_shi� +( +STACK_OF_X509_NAME_ENTRY +, (�)) + + ) + +1612 + #sk_STACK_OF_X509_NAME_ENTRY_p� +( +� +� + `SKM_sk_p� +( +STACK_OF_X509_NAME_ENTRY +, (�)) + + ) + +1613 + #sk_STACK_OF_X509_NAME_ENTRY_s�t +( +� +� + `SKM_sk_s�t +( +STACK_OF_X509_NAME_ENTRY +, (�)) + + ) + +1614 + #sk_STACK_OF_X509_NAME_ENTRY_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +STACK_OF_X509_NAME_ENTRY +, (�)) + + ) + +1616 + #sk_STORE_ATTR_INFO_�w +( +cmp +� + `SKM_sk_�w +( +STORE_ATTR_INFO +, (cmp)) + + ) + +1617 + #sk_STORE_ATTR_INFO_�w_nu� +(� + `SKM_sk_�w_nu� +( +STORE_ATTR_INFO +) + + ) + +1618 + #sk_STORE_ATTR_INFO_� +( +� +� + `SKM_sk_� +( +STORE_ATTR_INFO +, (�)) + + ) + +1619 + #sk_STORE_ATTR_INFO_num +( +� +� + `SKM_sk_num +( +STORE_ATTR_INFO +, (�)) + + ) + +1620 + #sk_STORE_ATTR_INFO_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +STORE_ATTR_INFO +, (�), (i)) + + ) + +1621 + #sk_STORE_ATTR_INFO_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +STORE_ATTR_INFO +, (�), (i), (v�)) + + ) + +1622 + #sk_STORE_ATTR_INFO_z�o +( +� +� + `SKM_sk_z�o +( +STORE_ATTR_INFO +, (�)) + + ) + +1623 + #sk_STORE_ATTR_INFO_push +( +� +, +v� +� + `SKM_sk_push +( +STORE_ATTR_INFO +, (�), (v�)) + + ) + +1624 + #sk_STORE_ATTR_INFO_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +STORE_ATTR_INFO +, (�), (v�)) + + ) + +1625 + #sk_STORE_ATTR_INFO_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +STORE_ATTR_INFO +, (�), (v�)) + + ) + +1626 + #sk_STORE_ATTR_INFO_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +STORE_ATTR_INFO +, (�), (v�)) + + ) + +1627 + #sk_STORE_ATTR_INFO_d��e +( +� +, +i +� + `SKM_sk_d��e +( +STORE_ATTR_INFO +, (�), (i)) + + ) + +1628 + #sk_STORE_ATTR_INFO_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +STORE_ATTR_INFO +, (�), (�r)) + + ) + +1629 + #sk_STORE_ATTR_INFO_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +STORE_ATTR_INFO +, (�), (v�), (i)) + + ) + +1630 + #sk_STORE_ATTR_INFO_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +STORE_ATTR_INFO +, (�), (cmp)) + + ) + +1631 + #sk_STORE_ATTR_INFO_dup +( +� +� + `SKM_sk_dup +( +STORE_ATTR_INFO +, st) + + ) + +1632 + #sk_STORE_ATTR_INFO_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +STORE_ATTR_INFO +, (�), (�_func)) + + ) + +1633 + #sk_STORE_ATTR_INFO_shi� +( +� +� + `SKM_sk_shi� +( +STORE_ATTR_INFO +, (�)) + + ) + +1634 + #sk_STORE_ATTR_INFO_p� +( +� +� + `SKM_sk_p� +( +STORE_ATTR_INFO +, (�)) + + ) + +1635 + #sk_STORE_ATTR_INFO_s�t +( +� +� + `SKM_sk_s�t +( +STORE_ATTR_INFO +, (�)) + + ) + +1636 + #sk_STORE_ATTR_INFO_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +STORE_ATTR_INFO +, (�)) + + ) + +1638 + #sk_STORE_OBJECT_�w +( +cmp +� + `SKM_sk_�w +( +STORE_OBJECT +, (cmp)) + + ) + +1639 + #sk_STORE_OBJECT_�w_nu� +(� + `SKM_sk_�w_nu� +( +STORE_OBJECT +) + + ) + +1640 + #sk_STORE_OBJECT_� +( +� +� + `SKM_sk_� +( +STORE_OBJECT +, (�)) + + ) + +1641 + #sk_STORE_OBJECT_num +( +� +� + `SKM_sk_num +( +STORE_OBJECT +, (�)) + + ) + +1642 + #sk_STORE_OBJECT_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +STORE_OBJECT +, (�), (i)) + + ) + +1643 + #sk_STORE_OBJECT_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +STORE_OBJECT +, (�), (i), (v�)) + + ) + +1644 + #sk_STORE_OBJECT_z�o +( +� +� + `SKM_sk_z�o +( +STORE_OBJECT +, (�)) + + ) + +1645 + #sk_STORE_OBJECT_push +( +� +, +v� +� + `SKM_sk_push +( +STORE_OBJECT +, (�), (v�)) + + ) + +1646 + #sk_STORE_OBJECT_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +STORE_OBJECT +, (�), (v�)) + + ) + +1647 + #sk_STORE_OBJECT_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +STORE_OBJECT +, (�), (v�)) + + ) + +1648 + #sk_STORE_OBJECT_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +STORE_OBJECT +, (�), (v�)) + + ) + +1649 + #sk_STORE_OBJECT_d��e +( +� +, +i +� + `SKM_sk_d��e +( +STORE_OBJECT +, (�), (i)) + + ) + +1650 + #sk_STORE_OBJECT_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +STORE_OBJECT +, (�), (�r)) + + ) + +1651 + #sk_STORE_OBJECT_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +STORE_OBJECT +, (�), (v�), (i)) + + ) + +1652 + #sk_STORE_OBJECT_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +STORE_OBJECT +, (�), (cmp)) + + ) + +1653 + #sk_STORE_OBJECT_dup +( +� +� + `SKM_sk_dup +( +STORE_OBJECT +, st) + + ) + +1654 + #sk_STORE_OBJECT_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +STORE_OBJECT +, (�), (�_func)) + + ) + +1655 + #sk_STORE_OBJECT_shi� +( +� +� + `SKM_sk_shi� +( +STORE_OBJECT +, (�)) + + ) + +1656 + #sk_STORE_OBJECT_p� +( +� +� + `SKM_sk_p� +( +STORE_OBJECT +, (�)) + + ) + +1657 + #sk_STORE_OBJECT_s�t +( +� +� + `SKM_sk_s�t +( +STORE_OBJECT +, (�)) + + ) + +1658 + #sk_STORE_OBJECT_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +STORE_OBJECT +, (�)) + + ) + +1660 + #sk_SXNETID_�w +( +cmp +� + `SKM_sk_�w +( +SXNETID +, (cmp)) + + ) + +1661 + #sk_SXNETID_�w_nu� +(� + `SKM_sk_�w_nu� +( +SXNETID +) + + ) + +1662 + #sk_SXNETID_� +( +� +� + `SKM_sk_� +( +SXNETID +, (�)) + + ) + +1663 + #sk_SXNETID_num +( +� +� + `SKM_sk_num +( +SXNETID +, (�)) + + ) + +1664 + #sk_SXNETID_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +SXNETID +, (�), (i)) + + ) + +1665 + #sk_SXNETID_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +SXNETID +, (�), (i), (v�)) + + ) + +1666 + #sk_SXNETID_z�o +( +� +� + `SKM_sk_z�o +( +SXNETID +, (�)) + + ) + +1667 + #sk_SXNETID_push +( +� +, +v� +� + `SKM_sk_push +( +SXNETID +, (�), (v�)) + + ) + +1668 + #sk_SXNETID_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +SXNETID +, (�), (v�)) + + ) + +1669 + #sk_SXNETID_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +SXNETID +, (�), (v�)) + + ) + +1670 + #sk_SXNETID_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +SXNETID +, (�), (v�)) + + ) + +1671 + #sk_SXNETID_d��e +( +� +, +i +� + `SKM_sk_d��e +( +SXNETID +, (�), (i)) + + ) + +1672 + #sk_SXNETID_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +SXNETID +, (�), (�r)) + + ) + +1673 + #sk_SXNETID_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +SXNETID +, (�), (v�), (i)) + + ) + +1674 + #sk_SXNETID_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +SXNETID +, (�), (cmp)) + + ) + +1675 + #sk_SXNETID_dup +( +� +� + `SKM_sk_dup +( +SXNETID +, st) + + ) + +1676 + #sk_SXNETID_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +SXNETID +, (�), (�_func)) + + ) + +1677 + #sk_SXNETID_shi� +( +� +� + `SKM_sk_shi� +( +SXNETID +, (�)) + + ) + +1678 + #sk_SXNETID_p� +( +� +� + `SKM_sk_p� +( +SXNETID +, (�)) + + ) + +1679 + #sk_SXNETID_s�t +( +� +� + `SKM_sk_s�t +( +SXNETID +, (�)) + + ) + +1680 + #sk_SXNETID_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +SXNETID +, (�)) + + ) + +1682 + #sk_UI_STRING_�w +( +cmp +� + `SKM_sk_�w +( +UI_STRING +, (cmp)) + + ) + +1683 + #sk_UI_STRING_�w_nu� +(� + `SKM_sk_�w_nu� +( +UI_STRING +) + + ) + +1684 + #sk_UI_STRING_� +( +� +� + `SKM_sk_� +( +UI_STRING +, (�)) + + ) + +1685 + #sk_UI_STRING_num +( +� +� + `SKM_sk_num +( +UI_STRING +, (�)) + + ) + +1686 + #sk_UI_STRING_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +UI_STRING +, (�), (i)) + + ) + +1687 + #sk_UI_STRING_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +UI_STRING +, (�), (i), (v�)) + + ) + +1688 + #sk_UI_STRING_z�o +( +� +� + `SKM_sk_z�o +( +UI_STRING +, (�)) + + ) + +1689 + #sk_UI_STRING_push +( +� +, +v� +� + `SKM_sk_push +( +UI_STRING +, (�), (v�)) + + ) + +1690 + #sk_UI_STRING_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +UI_STRING +, (�), (v�)) + + ) + +1691 + #sk_UI_STRING_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +UI_STRING +, (�), (v�)) + + ) + +1692 + #sk_UI_STRING_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +UI_STRING +, (�), (v�)) + + ) + +1693 + #sk_UI_STRING_d��e +( +� +, +i +� + `SKM_sk_d��e +( +UI_STRING +, (�), (i)) + + ) + +1694 + #sk_UI_STRING_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +UI_STRING +, (�), (�r)) + + ) + +1695 + #sk_UI_STRING_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +UI_STRING +, (�), (v�), (i)) + + ) + +1696 + #sk_UI_STRING_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +UI_STRING +, (�), (cmp)) + + ) + +1697 + #sk_UI_STRING_dup +( +� +� + `SKM_sk_dup +( +UI_STRING +, st) + + ) + +1698 + #sk_UI_STRING_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +UI_STRING +, (�), (�_func)) + + ) + +1699 + #sk_UI_STRING_shi� +( +� +� + `SKM_sk_shi� +( +UI_STRING +, (�)) + + ) + +1700 + #sk_UI_STRING_p� +( +� +� + `SKM_sk_p� +( +UI_STRING +, (�)) + + ) + +1701 + #sk_UI_STRING_s�t +( +� +� + `SKM_sk_s�t +( +UI_STRING +, (�)) + + ) + +1702 + #sk_UI_STRING_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +UI_STRING +, (�)) + + ) + +1704 + #sk_X509_�w +( +cmp +� + `SKM_sk_�w +( +X509 +, (cmp)) + + ) + +1705 + #sk_X509_�w_nu� +(� + `SKM_sk_�w_nu� +( +X509 +) + + ) + +1706 + #sk_X509_� +( +� +� + `SKM_sk_� +( +X509 +, (�)) + + ) + +1707 + #sk_X509_num +( +� +� + `SKM_sk_num +( +X509 +, (�)) + + ) + +1708 + #sk_X509_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +X509 +, (�), (i)) + + ) + +1709 + #sk_X509_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +X509 +, (�), (i), (v�)) + + ) + +1710 + #sk_X509_z�o +( +� +� + `SKM_sk_z�o +( +X509 +, (�)) + + ) + +1711 + #sk_X509_push +( +� +, +v� +� + `SKM_sk_push +( +X509 +, (�), (v�)) + + ) + +1712 + #sk_X509_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +X509 +, (�), (v�)) + + ) + +1713 + #sk_X509_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +X509 +, (�), (v�)) + + ) + +1714 + #sk_X509_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +X509 +, (�), (v�)) + + ) + +1715 + #sk_X509_d��e +( +� +, +i +� + `SKM_sk_d��e +( +X509 +, (�), (i)) + + ) + +1716 + #sk_X509_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +X509 +, (�), (�r)) + + ) + +1717 + #sk_X509_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +X509 +, (�), (v�), (i)) + + ) + +1718 + #sk_X509_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +X509 +, (�), (cmp)) + + ) + +1719 + #sk_X509_dup +( +� +� + `SKM_sk_dup +( +X509 +, st) + + ) + +1720 + #sk_X509_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +X509 +, (�), (�_func)) + + ) + +1721 + #sk_X509_shi� +( +� +� + `SKM_sk_shi� +( +X509 +, (�)) + + ) + +1722 + #sk_X509_p� +( +� +� + `SKM_sk_p� +( +X509 +, (�)) + + ) + +1723 + #sk_X509_s�t +( +� +� + `SKM_sk_s�t +( +X509 +, (�)) + + ) + +1724 + #sk_X509_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +X509 +, (�)) + + ) + +1726 + #sk_X509V3_EXT_METHOD_�w +( +cmp +� + `SKM_sk_�w +( +X509V3_EXT_METHOD +, (cmp)) + + ) + +1727 + #sk_X509V3_EXT_METHOD_�w_nu� +(� + `SKM_sk_�w_nu� +( +X509V3_EXT_METHOD +) + + ) + +1728 + #sk_X509V3_EXT_METHOD_� +( +� +� + `SKM_sk_� +( +X509V3_EXT_METHOD +, (�)) + + ) + +1729 + #sk_X509V3_EXT_METHOD_num +( +� +� + `SKM_sk_num +( +X509V3_EXT_METHOD +, (�)) + + ) + +1730 + #sk_X509V3_EXT_METHOD_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +X509V3_EXT_METHOD +, (�), (i)) + + ) + +1731 + #sk_X509V3_EXT_METHOD_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +X509V3_EXT_METHOD +, (�), (i), (v�)) + + ) + +1732 + #sk_X509V3_EXT_METHOD_z�o +( +� +� + `SKM_sk_z�o +( +X509V3_EXT_METHOD +, (�)) + + ) + +1733 + #sk_X509V3_EXT_METHOD_push +( +� +, +v� +� + `SKM_sk_push +( +X509V3_EXT_METHOD +, (�), (v�)) + + ) + +1734 + #sk_X509V3_EXT_METHOD_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +X509V3_EXT_METHOD +, (�), (v�)) + + ) + +1735 + #sk_X509V3_EXT_METHOD_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +X509V3_EXT_METHOD +, (�), (v�)) + + ) + +1736 + #sk_X509V3_EXT_METHOD_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +X509V3_EXT_METHOD +, (�), (v�)) + + ) + +1737 + #sk_X509V3_EXT_METHOD_d��e +( +� +, +i +� + `SKM_sk_d��e +( +X509V3_EXT_METHOD +, (�), (i)) + + ) + +1738 + #sk_X509V3_EXT_METHOD_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +X509V3_EXT_METHOD +, (�), (�r)) + + ) + +1739 + #sk_X509V3_EXT_METHOD_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +X509V3_EXT_METHOD +, (�), (v�), (i)) + + ) + +1740 + #sk_X509V3_EXT_METHOD_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +X509V3_EXT_METHOD +, (�), (cmp)) + + ) + +1741 + #sk_X509V3_EXT_METHOD_dup +( +� +� + `SKM_sk_dup +( +X509V3_EXT_METHOD +, st) + + ) + +1742 + #sk_X509V3_EXT_METHOD_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +X509V3_EXT_METHOD +, (�), (�_func)) + + ) + +1743 + #sk_X509V3_EXT_METHOD_shi� +( +� +� + `SKM_sk_shi� +( +X509V3_EXT_METHOD +, (�)) + + ) + +1744 + #sk_X509V3_EXT_METHOD_p� +( +� +� + `SKM_sk_p� +( +X509V3_EXT_METHOD +, (�)) + + ) + +1745 + #sk_X509V3_EXT_METHOD_s�t +( +� +� + `SKM_sk_s�t +( +X509V3_EXT_METHOD +, (�)) + + ) + +1746 + #sk_X509V3_EXT_METHOD_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +X509V3_EXT_METHOD +, (�)) + + ) + +1748 + #sk_X509_ALGOR_�w +( +cmp +� + `SKM_sk_�w +( +X509_ALGOR +, (cmp)) + + ) + +1749 + #sk_X509_ALGOR_�w_nu� +(� + `SKM_sk_�w_nu� +( +X509_ALGOR +) + + ) + +1750 + #sk_X509_ALGOR_� +( +� +� + `SKM_sk_� +( +X509_ALGOR +, (�)) + + ) + +1751 + #sk_X509_ALGOR_num +( +� +� + `SKM_sk_num +( +X509_ALGOR +, (�)) + + ) + +1752 + #sk_X509_ALGOR_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +X509_ALGOR +, (�), (i)) + + ) + +1753 + #sk_X509_ALGOR_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +X509_ALGOR +, (�), (i), (v�)) + + ) + +1754 + #sk_X509_ALGOR_z�o +( +� +� + `SKM_sk_z�o +( +X509_ALGOR +, (�)) + + ) + +1755 + #sk_X509_ALGOR_push +( +� +, +v� +� + `SKM_sk_push +( +X509_ALGOR +, (�), (v�)) + + ) + +1756 + #sk_X509_ALGOR_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +X509_ALGOR +, (�), (v�)) + + ) + +1757 + #sk_X509_ALGOR_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +X509_ALGOR +, (�), (v�)) + + ) + +1758 + #sk_X509_ALGOR_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +X509_ALGOR +, (�), (v�)) + + ) + +1759 + #sk_X509_ALGOR_d��e +( +� +, +i +� + `SKM_sk_d��e +( +X509_ALGOR +, (�), (i)) + + ) + +1760 + #sk_X509_ALGOR_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +X509_ALGOR +, (�), (�r)) + + ) + +1761 + #sk_X509_ALGOR_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +X509_ALGOR +, (�), (v�), (i)) + + ) + +1762 + #sk_X509_ALGOR_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +X509_ALGOR +, (�), (cmp)) + + ) + +1763 + #sk_X509_ALGOR_dup +( +� +� + `SKM_sk_dup +( +X509_ALGOR +, st) + + ) + +1764 + #sk_X509_ALGOR_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +X509_ALGOR +, (�), (�_func)) + + ) + +1765 + #sk_X509_ALGOR_shi� +( +� +� + `SKM_sk_shi� +( +X509_ALGOR +, (�)) + + ) + +1766 + #sk_X509_ALGOR_p� +( +� +� + `SKM_sk_p� +( +X509_ALGOR +, (�)) + + ) + +1767 + #sk_X509_ALGOR_s�t +( +� +� + `SKM_sk_s�t +( +X509_ALGOR +, (�)) + + ) + +1768 + #sk_X509_ALGOR_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +X509_ALGOR +, (�)) + + ) + +1770 + #sk_X509_ATTRIBUTE_�w +( +cmp +� + `SKM_sk_�w +( +X509_ATTRIBUTE +, (cmp)) + + ) + +1771 + #sk_X509_ATTRIBUTE_�w_nu� +(� + `SKM_sk_�w_nu� +( +X509_ATTRIBUTE +) + + ) + +1772 + #sk_X509_ATTRIBUTE_� +( +� +� + `SKM_sk_� +( +X509_ATTRIBUTE +, (�)) + + ) + +1773 + #sk_X509_ATTRIBUTE_num +( +� +� + `SKM_sk_num +( +X509_ATTRIBUTE +, (�)) + + ) + +1774 + #sk_X509_ATTRIBUTE_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +X509_ATTRIBUTE +, (�), (i)) + + ) + +1775 + #sk_X509_ATTRIBUTE_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +X509_ATTRIBUTE +, (�), (i), (v�)) + + ) + +1776 + #sk_X509_ATTRIBUTE_z�o +( +� +� + `SKM_sk_z�o +( +X509_ATTRIBUTE +, (�)) + + ) + +1777 + #sk_X509_ATTRIBUTE_push +( +� +, +v� +� + `SKM_sk_push +( +X509_ATTRIBUTE +, (�), (v�)) + + ) + +1778 + #sk_X509_ATTRIBUTE_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +X509_ATTRIBUTE +, (�), (v�)) + + ) + +1779 + #sk_X509_ATTRIBUTE_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +X509_ATTRIBUTE +, (�), (v�)) + + ) + +1780 + #sk_X509_ATTRIBUTE_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +X509_ATTRIBUTE +, (�), (v�)) + + ) + +1781 + #sk_X509_ATTRIBUTE_d��e +( +� +, +i +� + `SKM_sk_d��e +( +X509_ATTRIBUTE +, (�), (i)) + + ) + +1782 + #sk_X509_ATTRIBUTE_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +X509_ATTRIBUTE +, (�), (�r)) + + ) + +1783 + #sk_X509_ATTRIBUTE_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +X509_ATTRIBUTE +, (�), (v�), (i)) + + ) + +1784 + #sk_X509_ATTRIBUTE_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +X509_ATTRIBUTE +, (�), (cmp)) + + ) + +1785 + #sk_X509_ATTRIBUTE_dup +( +� +� + `SKM_sk_dup +( +X509_ATTRIBUTE +, st) + + ) + +1786 + #sk_X509_ATTRIBUTE_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +X509_ATTRIBUTE +, (�), (�_func)) + + ) + +1787 + #sk_X509_ATTRIBUTE_shi� +( +� +� + `SKM_sk_shi� +( +X509_ATTRIBUTE +, (�)) + + ) + +1788 + #sk_X509_ATTRIBUTE_p� +( +� +� + `SKM_sk_p� +( +X509_ATTRIBUTE +, (�)) + + ) + +1789 + #sk_X509_ATTRIBUTE_s�t +( +� +� + `SKM_sk_s�t +( +X509_ATTRIBUTE +, (�)) + + ) + +1790 + #sk_X509_ATTRIBUTE_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +X509_ATTRIBUTE +, (�)) + + ) + +1792 + #sk_X509_CRL_�w +( +cmp +� + `SKM_sk_�w +( +X509_CRL +, (cmp)) + + ) + +1793 + #sk_X509_CRL_�w_nu� +(� + `SKM_sk_�w_nu� +( +X509_CRL +) + + ) + +1794 + #sk_X509_CRL_� +( +� +� + `SKM_sk_� +( +X509_CRL +, (�)) + + ) + +1795 + #sk_X509_CRL_num +( +� +� + `SKM_sk_num +( +X509_CRL +, (�)) + + ) + +1796 + #sk_X509_CRL_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +X509_CRL +, (�), (i)) + + ) + +1797 + #sk_X509_CRL_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +X509_CRL +, (�), (i), (v�)) + + ) + +1798 + #sk_X509_CRL_z�o +( +� +� + `SKM_sk_z�o +( +X509_CRL +, (�)) + + ) + +1799 + #sk_X509_CRL_push +( +� +, +v� +� + `SKM_sk_push +( +X509_CRL +, (�), (v�)) + + ) + +1800 + #sk_X509_CRL_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +X509_CRL +, (�), (v�)) + + ) + +1801 + #sk_X509_CRL_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +X509_CRL +, (�), (v�)) + + ) + +1802 + #sk_X509_CRL_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +X509_CRL +, (�), (v�)) + + ) + +1803 + #sk_X509_CRL_d��e +( +� +, +i +� + `SKM_sk_d��e +( +X509_CRL +, (�), (i)) + + ) + +1804 + #sk_X509_CRL_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +X509_CRL +, (�), (�r)) + + ) + +1805 + #sk_X509_CRL_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +X509_CRL +, (�), (v�), (i)) + + ) + +1806 + #sk_X509_CRL_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +X509_CRL +, (�), (cmp)) + + ) + +1807 + #sk_X509_CRL_dup +( +� +� + `SKM_sk_dup +( +X509_CRL +, st) + + ) + +1808 + #sk_X509_CRL_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +X509_CRL +, (�), (�_func)) + + ) + +1809 + #sk_X509_CRL_shi� +( +� +� + `SKM_sk_shi� +( +X509_CRL +, (�)) + + ) + +1810 + #sk_X509_CRL_p� +( +� +� + `SKM_sk_p� +( +X509_CRL +, (�)) + + ) + +1811 + #sk_X509_CRL_s�t +( +� +� + `SKM_sk_s�t +( +X509_CRL +, (�)) + + ) + +1812 + #sk_X509_CRL_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +X509_CRL +, (�)) + + ) + +1814 + #sk_X509_EXTENSION_�w +( +cmp +� + `SKM_sk_�w +( +X509_EXTENSION +, (cmp)) + + ) + +1815 + #sk_X509_EXTENSION_�w_nu� +(� + `SKM_sk_�w_nu� +( +X509_EXTENSION +) + + ) + +1816 + #sk_X509_EXTENSION_� +( +� +� + `SKM_sk_� +( +X509_EXTENSION +, (�)) + + ) + +1817 + #sk_X509_EXTENSION_num +( +� +� + `SKM_sk_num +( +X509_EXTENSION +, (�)) + + ) + +1818 + #sk_X509_EXTENSION_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +X509_EXTENSION +, (�), (i)) + + ) + +1819 + #sk_X509_EXTENSION_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +X509_EXTENSION +, (�), (i), (v�)) + + ) + +1820 + #sk_X509_EXTENSION_z�o +( +� +� + `SKM_sk_z�o +( +X509_EXTENSION +, (�)) + + ) + +1821 + #sk_X509_EXTENSION_push +( +� +, +v� +� + `SKM_sk_push +( +X509_EXTENSION +, (�), (v�)) + + ) + +1822 + #sk_X509_EXTENSION_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +X509_EXTENSION +, (�), (v�)) + + ) + +1823 + #sk_X509_EXTENSION_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +X509_EXTENSION +, (�), (v�)) + + ) + +1824 + #sk_X509_EXTENSION_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +X509_EXTENSION +, (�), (v�)) + + ) + +1825 + #sk_X509_EXTENSION_d��e +( +� +, +i +� + `SKM_sk_d��e +( +X509_EXTENSION +, (�), (i)) + + ) + +1826 + #sk_X509_EXTENSION_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +X509_EXTENSION +, (�), (�r)) + + ) + +1827 + #sk_X509_EXTENSION_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +X509_EXTENSION +, (�), (v�), (i)) + + ) + +1828 + #sk_X509_EXTENSION_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +X509_EXTENSION +, (�), (cmp)) + + ) + +1829 + #sk_X509_EXTENSION_dup +( +� +� + `SKM_sk_dup +( +X509_EXTENSION +, st) + + ) + +1830 + #sk_X509_EXTENSION_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +X509_EXTENSION +, (�), (�_func)) + + ) + +1831 + #sk_X509_EXTENSION_shi� +( +� +� + `SKM_sk_shi� +( +X509_EXTENSION +, (�)) + + ) + +1832 + #sk_X509_EXTENSION_p� +( +� +� + `SKM_sk_p� +( +X509_EXTENSION +, (�)) + + ) + +1833 + #sk_X509_EXTENSION_s�t +( +� +� + `SKM_sk_s�t +( +X509_EXTENSION +, (�)) + + ) + +1834 + #sk_X509_EXTENSION_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +X509_EXTENSION +, (�)) + + ) + +1836 + #sk_X509_INFO_�w +( +cmp +� + `SKM_sk_�w +( +X509_INFO +, (cmp)) + + ) + +1837 + #sk_X509_INFO_�w_nu� +(� + `SKM_sk_�w_nu� +( +X509_INFO +) + + ) + +1838 + #sk_X509_INFO_� +( +� +� + `SKM_sk_� +( +X509_INFO +, (�)) + + ) + +1839 + #sk_X509_INFO_num +( +� +� + `SKM_sk_num +( +X509_INFO +, (�)) + + ) + +1840 + #sk_X509_INFO_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +X509_INFO +, (�), (i)) + + ) + +1841 + #sk_X509_INFO_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +X509_INFO +, (�), (i), (v�)) + + ) + +1842 + #sk_X509_INFO_z�o +( +� +� + `SKM_sk_z�o +( +X509_INFO +, (�)) + + ) + +1843 + #sk_X509_INFO_push +( +� +, +v� +� + `SKM_sk_push +( +X509_INFO +, (�), (v�)) + + ) + +1844 + #sk_X509_INFO_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +X509_INFO +, (�), (v�)) + + ) + +1845 + #sk_X509_INFO_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +X509_INFO +, (�), (v�)) + + ) + +1846 + #sk_X509_INFO_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +X509_INFO +, (�), (v�)) + + ) + +1847 + #sk_X509_INFO_d��e +( +� +, +i +� + `SKM_sk_d��e +( +X509_INFO +, (�), (i)) + + ) + +1848 + #sk_X509_INFO_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +X509_INFO +, (�), (�r)) + + ) + +1849 + #sk_X509_INFO_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +X509_INFO +, (�), (v�), (i)) + + ) + +1850 + #sk_X509_INFO_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +X509_INFO +, (�), (cmp)) + + ) + +1851 + #sk_X509_INFO_dup +( +� +� + `SKM_sk_dup +( +X509_INFO +, st) + + ) + +1852 + #sk_X509_INFO_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +X509_INFO +, (�), (�_func)) + + ) + +1853 + #sk_X509_INFO_shi� +( +� +� + `SKM_sk_shi� +( +X509_INFO +, (�)) + + ) + +1854 + #sk_X509_INFO_p� +( +� +� + `SKM_sk_p� +( +X509_INFO +, (�)) + + ) + +1855 + #sk_X509_INFO_s�t +( +� +� + `SKM_sk_s�t +( +X509_INFO +, (�)) + + ) + +1856 + #sk_X509_INFO_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +X509_INFO +, (�)) + + ) + +1858 + #sk_X509_LOOKUP_�w +( +cmp +� + `SKM_sk_�w +( +X509_LOOKUP +, (cmp)) + + ) + +1859 + #sk_X509_LOOKUP_�w_nu� +(� + `SKM_sk_�w_nu� +( +X509_LOOKUP +) + + ) + +1860 + #sk_X509_LOOKUP_� +( +� +� + `SKM_sk_� +( +X509_LOOKUP +, (�)) + + ) + +1861 + #sk_X509_LOOKUP_num +( +� +� + `SKM_sk_num +( +X509_LOOKUP +, (�)) + + ) + +1862 + #sk_X509_LOOKUP_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +X509_LOOKUP +, (�), (i)) + + ) + +1863 + #sk_X509_LOOKUP_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +X509_LOOKUP +, (�), (i), (v�)) + + ) + +1864 + #sk_X509_LOOKUP_z�o +( +� +� + `SKM_sk_z�o +( +X509_LOOKUP +, (�)) + + ) + +1865 + #sk_X509_LOOKUP_push +( +� +, +v� +� + `SKM_sk_push +( +X509_LOOKUP +, (�), (v�)) + + ) + +1866 + #sk_X509_LOOKUP_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +X509_LOOKUP +, (�), (v�)) + + ) + +1867 + #sk_X509_LOOKUP_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +X509_LOOKUP +, (�), (v�)) + + ) + +1868 + #sk_X509_LOOKUP_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +X509_LOOKUP +, (�), (v�)) + + ) + +1869 + #sk_X509_LOOKUP_d��e +( +� +, +i +� + `SKM_sk_d��e +( +X509_LOOKUP +, (�), (i)) + + ) + +1870 + #sk_X509_LOOKUP_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +X509_LOOKUP +, (�), (�r)) + + ) + +1871 + #sk_X509_LOOKUP_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +X509_LOOKUP +, (�), (v�), (i)) + + ) + +1872 + #sk_X509_LOOKUP_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +X509_LOOKUP +, (�), (cmp)) + + ) + +1873 + #sk_X509_LOOKUP_dup +( +� +� + `SKM_sk_dup +( +X509_LOOKUP +, st) + + ) + +1874 + #sk_X509_LOOKUP_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +X509_LOOKUP +, (�), (�_func)) + + ) + +1875 + #sk_X509_LOOKUP_shi� +( +� +� + `SKM_sk_shi� +( +X509_LOOKUP +, (�)) + + ) + +1876 + #sk_X509_LOOKUP_p� +( +� +� + `SKM_sk_p� +( +X509_LOOKUP +, (�)) + + ) + +1877 + #sk_X509_LOOKUP_s�t +( +� +� + `SKM_sk_s�t +( +X509_LOOKUP +, (�)) + + ) + +1878 + #sk_X509_LOOKUP_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +X509_LOOKUP +, (�)) + + ) + +1880 + #sk_X509_NAME_�w +( +cmp +� + `SKM_sk_�w +( +X509_NAME +, (cmp)) + + ) + +1881 + #sk_X509_NAME_�w_nu� +(� + `SKM_sk_�w_nu� +( +X509_NAME +) + + ) + +1882 + #sk_X509_NAME_� +( +� +� + `SKM_sk_� +( +X509_NAME +, (�)) + + ) + +1883 + #sk_X509_NAME_num +( +� +� + `SKM_sk_num +( +X509_NAME +, (�)) + + ) + +1884 + #sk_X509_NAME_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +X509_NAME +, (�), (i)) + + ) + +1885 + #sk_X509_NAME_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +X509_NAME +, (�), (i), (v�)) + + ) + +1886 + #sk_X509_NAME_z�o +( +� +� + `SKM_sk_z�o +( +X509_NAME +, (�)) + + ) + +1887 + #sk_X509_NAME_push +( +� +, +v� +� + `SKM_sk_push +( +X509_NAME +, (�), (v�)) + + ) + +1888 + #sk_X509_NAME_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +X509_NAME +, (�), (v�)) + + ) + +1889 + #sk_X509_NAME_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +X509_NAME +, (�), (v�)) + + ) + +1890 + #sk_X509_NAME_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +X509_NAME +, (�), (v�)) + + ) + +1891 + #sk_X509_NAME_d��e +( +� +, +i +� + `SKM_sk_d��e +( +X509_NAME +, (�), (i)) + + ) + +1892 + #sk_X509_NAME_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +X509_NAME +, (�), (�r)) + + ) + +1893 + #sk_X509_NAME_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +X509_NAME +, (�), (v�), (i)) + + ) + +1894 + #sk_X509_NAME_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +X509_NAME +, (�), (cmp)) + + ) + +1895 + #sk_X509_NAME_dup +( +� +� + `SKM_sk_dup +( +X509_NAME +, st) + + ) + +1896 + #sk_X509_NAME_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +X509_NAME +, (�), (�_func)) + + ) + +1897 + #sk_X509_NAME_shi� +( +� +� + `SKM_sk_shi� +( +X509_NAME +, (�)) + + ) + +1898 + #sk_X509_NAME_p� +( +� +� + `SKM_sk_p� +( +X509_NAME +, (�)) + + ) + +1899 + #sk_X509_NAME_s�t +( +� +� + `SKM_sk_s�t +( +X509_NAME +, (�)) + + ) + +1900 + #sk_X509_NAME_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +X509_NAME +, (�)) + + ) + +1902 + #sk_X509_NAME_ENTRY_�w +( +cmp +� + `SKM_sk_�w +( +X509_NAME_ENTRY +, (cmp)) + + ) + +1903 + #sk_X509_NAME_ENTRY_�w_nu� +(� + `SKM_sk_�w_nu� +( +X509_NAME_ENTRY +) + + ) + +1904 + #sk_X509_NAME_ENTRY_� +( +� +� + `SKM_sk_� +( +X509_NAME_ENTRY +, (�)) + + ) + +1905 + #sk_X509_NAME_ENTRY_num +( +� +� + `SKM_sk_num +( +X509_NAME_ENTRY +, (�)) + + ) + +1906 + #sk_X509_NAME_ENTRY_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +X509_NAME_ENTRY +, (�), (i)) + + ) + +1907 + #sk_X509_NAME_ENTRY_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +X509_NAME_ENTRY +, (�), (i), (v�)) + + ) + +1908 + #sk_X509_NAME_ENTRY_z�o +( +� +� + `SKM_sk_z�o +( +X509_NAME_ENTRY +, (�)) + + ) + +1909 + #sk_X509_NAME_ENTRY_push +( +� +, +v� +� + `SKM_sk_push +( +X509_NAME_ENTRY +, (�), (v�)) + + ) + +1910 + #sk_X509_NAME_ENTRY_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +X509_NAME_ENTRY +, (�), (v�)) + + ) + +1911 + #sk_X509_NAME_ENTRY_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +X509_NAME_ENTRY +, (�), (v�)) + + ) + +1912 + #sk_X509_NAME_ENTRY_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +X509_NAME_ENTRY +, (�), (v�)) + + ) + +1913 + #sk_X509_NAME_ENTRY_d��e +( +� +, +i +� + `SKM_sk_d��e +( +X509_NAME_ENTRY +, (�), (i)) + + ) + +1914 + #sk_X509_NAME_ENTRY_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +X509_NAME_ENTRY +, (�), (�r)) + + ) + +1915 + #sk_X509_NAME_ENTRY_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +X509_NAME_ENTRY +, (�), (v�), (i)) + + ) + +1916 + #sk_X509_NAME_ENTRY_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +X509_NAME_ENTRY +, (�), (cmp)) + + ) + +1917 + #sk_X509_NAME_ENTRY_dup +( +� +� + `SKM_sk_dup +( +X509_NAME_ENTRY +, st) + + ) + +1918 + #sk_X509_NAME_ENTRY_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +X509_NAME_ENTRY +, (�), (�_func)) + + ) + +1919 + #sk_X509_NAME_ENTRY_shi� +( +� +� + `SKM_sk_shi� +( +X509_NAME_ENTRY +, (�)) + + ) + +1920 + #sk_X509_NAME_ENTRY_p� +( +� +� + `SKM_sk_p� +( +X509_NAME_ENTRY +, (�)) + + ) + +1921 + #sk_X509_NAME_ENTRY_s�t +( +� +� + `SKM_sk_s�t +( +X509_NAME_ENTRY +, (�)) + + ) + +1922 + #sk_X509_NAME_ENTRY_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +X509_NAME_ENTRY +, (�)) + + ) + +1924 + #sk_X509_OBJECT_�w +( +cmp +� + `SKM_sk_�w +( +X509_OBJECT +, (cmp)) + + ) + +1925 + #sk_X509_OBJECT_�w_nu� +(� + `SKM_sk_�w_nu� +( +X509_OBJECT +) + + ) + +1926 + #sk_X509_OBJECT_� +( +� +� + `SKM_sk_� +( +X509_OBJECT +, (�)) + + ) + +1927 + #sk_X509_OBJECT_num +( +� +� + `SKM_sk_num +( +X509_OBJECT +, (�)) + + ) + +1928 + #sk_X509_OBJECT_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +X509_OBJECT +, (�), (i)) + + ) + +1929 + #sk_X509_OBJECT_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +X509_OBJECT +, (�), (i), (v�)) + + ) + +1930 + #sk_X509_OBJECT_z�o +( +� +� + `SKM_sk_z�o +( +X509_OBJECT +, (�)) + + ) + +1931 + #sk_X509_OBJECT_push +( +� +, +v� +� + `SKM_sk_push +( +X509_OBJECT +, (�), (v�)) + + ) + +1932 + #sk_X509_OBJECT_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +X509_OBJECT +, (�), (v�)) + + ) + +1933 + #sk_X509_OBJECT_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +X509_OBJECT +, (�), (v�)) + + ) + +1934 + #sk_X509_OBJECT_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +X509_OBJECT +, (�), (v�)) + + ) + +1935 + #sk_X509_OBJECT_d��e +( +� +, +i +� + `SKM_sk_d��e +( +X509_OBJECT +, (�), (i)) + + ) + +1936 + #sk_X509_OBJECT_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +X509_OBJECT +, (�), (�r)) + + ) + +1937 + #sk_X509_OBJECT_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +X509_OBJECT +, (�), (v�), (i)) + + ) + +1938 + #sk_X509_OBJECT_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +X509_OBJECT +, (�), (cmp)) + + ) + +1939 + #sk_X509_OBJECT_dup +( +� +� + `SKM_sk_dup +( +X509_OBJECT +, st) + + ) + +1940 + #sk_X509_OBJECT_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +X509_OBJECT +, (�), (�_func)) + + ) + +1941 + #sk_X509_OBJECT_shi� +( +� +� + `SKM_sk_shi� +( +X509_OBJECT +, (�)) + + ) + +1942 + #sk_X509_OBJECT_p� +( +� +� + `SKM_sk_p� +( +X509_OBJECT +, (�)) + + ) + +1943 + #sk_X509_OBJECT_s�t +( +� +� + `SKM_sk_s�t +( +X509_OBJECT +, (�)) + + ) + +1944 + #sk_X509_OBJECT_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +X509_OBJECT +, (�)) + + ) + +1946 + #sk_X509_POLICY_DATA_�w +( +cmp +� + `SKM_sk_�w +( +X509_POLICY_DATA +, (cmp)) + + ) + +1947 + #sk_X509_POLICY_DATA_�w_nu� +(� + `SKM_sk_�w_nu� +( +X509_POLICY_DATA +) + + ) + +1948 + #sk_X509_POLICY_DATA_� +( +� +� + `SKM_sk_� +( +X509_POLICY_DATA +, (�)) + + ) + +1949 + #sk_X509_POLICY_DATA_num +( +� +� + `SKM_sk_num +( +X509_POLICY_DATA +, (�)) + + ) + +1950 + #sk_X509_POLICY_DATA_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +X509_POLICY_DATA +, (�), (i)) + + ) + +1951 + #sk_X509_POLICY_DATA_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +X509_POLICY_DATA +, (�), (i), (v�)) + + ) + +1952 + #sk_X509_POLICY_DATA_z�o +( +� +� + `SKM_sk_z�o +( +X509_POLICY_DATA +, (�)) + + ) + +1953 + #sk_X509_POLICY_DATA_push +( +� +, +v� +� + `SKM_sk_push +( +X509_POLICY_DATA +, (�), (v�)) + + ) + +1954 + #sk_X509_POLICY_DATA_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +X509_POLICY_DATA +, (�), (v�)) + + ) + +1955 + #sk_X509_POLICY_DATA_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +X509_POLICY_DATA +, (�), (v�)) + + ) + +1956 + #sk_X509_POLICY_DATA_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +X509_POLICY_DATA +, (�), (v�)) + + ) + +1957 + #sk_X509_POLICY_DATA_d��e +( +� +, +i +� + `SKM_sk_d��e +( +X509_POLICY_DATA +, (�), (i)) + + ) + +1958 + #sk_X509_POLICY_DATA_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +X509_POLICY_DATA +, (�), (�r)) + + ) + +1959 + #sk_X509_POLICY_DATA_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +X509_POLICY_DATA +, (�), (v�), (i)) + + ) + +1960 + #sk_X509_POLICY_DATA_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +X509_POLICY_DATA +, (�), (cmp)) + + ) + +1961 + #sk_X509_POLICY_DATA_dup +( +� +� + `SKM_sk_dup +( +X509_POLICY_DATA +, st) + + ) + +1962 + #sk_X509_POLICY_DATA_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +X509_POLICY_DATA +, (�), (�_func)) + + ) + +1963 + #sk_X509_POLICY_DATA_shi� +( +� +� + `SKM_sk_shi� +( +X509_POLICY_DATA +, (�)) + + ) + +1964 + #sk_X509_POLICY_DATA_p� +( +� +� + `SKM_sk_p� +( +X509_POLICY_DATA +, (�)) + + ) + +1965 + #sk_X509_POLICY_DATA_s�t +( +� +� + `SKM_sk_s�t +( +X509_POLICY_DATA +, (�)) + + ) + +1966 + #sk_X509_POLICY_DATA_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +X509_POLICY_DATA +, (�)) + + ) + +1968 + #sk_X509_POLICY_NODE_�w +( +cmp +� + `SKM_sk_�w +( +X509_POLICY_NODE +, (cmp)) + + ) + +1969 + #sk_X509_POLICY_NODE_�w_nu� +(� + `SKM_sk_�w_nu� +( +X509_POLICY_NODE +) + + ) + +1970 + #sk_X509_POLICY_NODE_� +( +� +� + `SKM_sk_� +( +X509_POLICY_NODE +, (�)) + + ) + +1971 + #sk_X509_POLICY_NODE_num +( +� +� + `SKM_sk_num +( +X509_POLICY_NODE +, (�)) + + ) + +1972 + #sk_X509_POLICY_NODE_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +X509_POLICY_NODE +, (�), (i)) + + ) + +1973 + #sk_X509_POLICY_NODE_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +X509_POLICY_NODE +, (�), (i), (v�)) + + ) + +1974 + #sk_X509_POLICY_NODE_z�o +( +� +� + `SKM_sk_z�o +( +X509_POLICY_NODE +, (�)) + + ) + +1975 + #sk_X509_POLICY_NODE_push +( +� +, +v� +� + `SKM_sk_push +( +X509_POLICY_NODE +, (�), (v�)) + + ) + +1976 + #sk_X509_POLICY_NODE_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +X509_POLICY_NODE +, (�), (v�)) + + ) + +1977 + #sk_X509_POLICY_NODE_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +X509_POLICY_NODE +, (�), (v�)) + + ) + +1978 + #sk_X509_POLICY_NODE_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +X509_POLICY_NODE +, (�), (v�)) + + ) + +1979 + #sk_X509_POLICY_NODE_d��e +( +� +, +i +� + `SKM_sk_d��e +( +X509_POLICY_NODE +, (�), (i)) + + ) + +1980 + #sk_X509_POLICY_NODE_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +X509_POLICY_NODE +, (�), (�r)) + + ) + +1981 + #sk_X509_POLICY_NODE_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +X509_POLICY_NODE +, (�), (v�), (i)) + + ) + +1982 + #sk_X509_POLICY_NODE_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +X509_POLICY_NODE +, (�), (cmp)) + + ) + +1983 + #sk_X509_POLICY_NODE_dup +( +� +� + `SKM_sk_dup +( +X509_POLICY_NODE +, st) + + ) + +1984 + #sk_X509_POLICY_NODE_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +X509_POLICY_NODE +, (�), (�_func)) + + ) + +1985 + #sk_X509_POLICY_NODE_shi� +( +� +� + `SKM_sk_shi� +( +X509_POLICY_NODE +, (�)) + + ) + +1986 + #sk_X509_POLICY_NODE_p� +( +� +� + `SKM_sk_p� +( +X509_POLICY_NODE +, (�)) + + ) + +1987 + #sk_X509_POLICY_NODE_s�t +( +� +� + `SKM_sk_s�t +( +X509_POLICY_NODE +, (�)) + + ) + +1988 + #sk_X509_POLICY_NODE_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +X509_POLICY_NODE +, (�)) + + ) + +1990 + #sk_X509_PURPOSE_�w +( +cmp +� + `SKM_sk_�w +( +X509_PURPOSE +, (cmp)) + + ) + +1991 + #sk_X509_PURPOSE_�w_nu� +(� + `SKM_sk_�w_nu� +( +X509_PURPOSE +) + + ) + +1992 + #sk_X509_PURPOSE_� +( +� +� + `SKM_sk_� +( +X509_PURPOSE +, (�)) + + ) + +1993 + #sk_X509_PURPOSE_num +( +� +� + `SKM_sk_num +( +X509_PURPOSE +, (�)) + + ) + +1994 + #sk_X509_PURPOSE_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +X509_PURPOSE +, (�), (i)) + + ) + +1995 + #sk_X509_PURPOSE_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +X509_PURPOSE +, (�), (i), (v�)) + + ) + +1996 + #sk_X509_PURPOSE_z�o +( +� +� + `SKM_sk_z�o +( +X509_PURPOSE +, (�)) + + ) + +1997 + #sk_X509_PURPOSE_push +( +� +, +v� +� + `SKM_sk_push +( +X509_PURPOSE +, (�), (v�)) + + ) + +1998 + #sk_X509_PURPOSE_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +X509_PURPOSE +, (�), (v�)) + + ) + +1999 + #sk_X509_PURPOSE_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +X509_PURPOSE +, (�), (v�)) + + ) + +2000 + #sk_X509_PURPOSE_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +X509_PURPOSE +, (�), (v�)) + + ) + +2001 + #sk_X509_PURPOSE_d��e +( +� +, +i +� + `SKM_sk_d��e +( +X509_PURPOSE +, (�), (i)) + + ) + +2002 + #sk_X509_PURPOSE_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +X509_PURPOSE +, (�), (�r)) + + ) + +2003 + #sk_X509_PURPOSE_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +X509_PURPOSE +, (�), (v�), (i)) + + ) + +2004 + #sk_X509_PURPOSE_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +X509_PURPOSE +, (�), (cmp)) + + ) + +2005 + #sk_X509_PURPOSE_dup +( +� +� + `SKM_sk_dup +( +X509_PURPOSE +, st) + + ) + +2006 + #sk_X509_PURPOSE_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +X509_PURPOSE +, (�), (�_func)) + + ) + +2007 + #sk_X509_PURPOSE_shi� +( +� +� + `SKM_sk_shi� +( +X509_PURPOSE +, (�)) + + ) + +2008 + #sk_X509_PURPOSE_p� +( +� +� + `SKM_sk_p� +( +X509_PURPOSE +, (�)) + + ) + +2009 + #sk_X509_PURPOSE_s�t +( +� +� + `SKM_sk_s�t +( +X509_PURPOSE +, (�)) + + ) + +2010 + #sk_X509_PURPOSE_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +X509_PURPOSE +, (�)) + + ) + +2012 + #sk_X509_REVOKED_�w +( +cmp +� + `SKM_sk_�w +( +X509_REVOKED +, (cmp)) + + ) + +2013 + #sk_X509_REVOKED_�w_nu� +(� + `SKM_sk_�w_nu� +( +X509_REVOKED +) + + ) + +2014 + #sk_X509_REVOKED_� +( +� +� + `SKM_sk_� +( +X509_REVOKED +, (�)) + + ) + +2015 + #sk_X509_REVOKED_num +( +� +� + `SKM_sk_num +( +X509_REVOKED +, (�)) + + ) + +2016 + #sk_X509_REVOKED_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +X509_REVOKED +, (�), (i)) + + ) + +2017 + #sk_X509_REVOKED_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +X509_REVOKED +, (�), (i), (v�)) + + ) + +2018 + #sk_X509_REVOKED_z�o +( +� +� + `SKM_sk_z�o +( +X509_REVOKED +, (�)) + + ) + +2019 + #sk_X509_REVOKED_push +( +� +, +v� +� + `SKM_sk_push +( +X509_REVOKED +, (�), (v�)) + + ) + +2020 + #sk_X509_REVOKED_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +X509_REVOKED +, (�), (v�)) + + ) + +2021 + #sk_X509_REVOKED_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +X509_REVOKED +, (�), (v�)) + + ) + +2022 + #sk_X509_REVOKED_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +X509_REVOKED +, (�), (v�)) + + ) + +2023 + #sk_X509_REVOKED_d��e +( +� +, +i +� + `SKM_sk_d��e +( +X509_REVOKED +, (�), (i)) + + ) + +2024 + #sk_X509_REVOKED_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +X509_REVOKED +, (�), (�r)) + + ) + +2025 + #sk_X509_REVOKED_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +X509_REVOKED +, (�), (v�), (i)) + + ) + +2026 + #sk_X509_REVOKED_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +X509_REVOKED +, (�), (cmp)) + + ) + +2027 + #sk_X509_REVOKED_dup +( +� +� + `SKM_sk_dup +( +X509_REVOKED +, st) + + ) + +2028 + #sk_X509_REVOKED_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +X509_REVOKED +, (�), (�_func)) + + ) + +2029 + #sk_X509_REVOKED_shi� +( +� +� + `SKM_sk_shi� +( +X509_REVOKED +, (�)) + + ) + +2030 + #sk_X509_REVOKED_p� +( +� +� + `SKM_sk_p� +( +X509_REVOKED +, (�)) + + ) + +2031 + #sk_X509_REVOKED_s�t +( +� +� + `SKM_sk_s�t +( +X509_REVOKED +, (�)) + + ) + +2032 + #sk_X509_REVOKED_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +X509_REVOKED +, (�)) + + ) + +2034 + #sk_X509_TRUST_�w +( +cmp +� + `SKM_sk_�w +( +X509_TRUST +, (cmp)) + + ) + +2035 + #sk_X509_TRUST_�w_nu� +(� + `SKM_sk_�w_nu� +( +X509_TRUST +) + + ) + +2036 + #sk_X509_TRUST_� +( +� +� + `SKM_sk_� +( +X509_TRUST +, (�)) + + ) + +2037 + #sk_X509_TRUST_num +( +� +� + `SKM_sk_num +( +X509_TRUST +, (�)) + + ) + +2038 + #sk_X509_TRUST_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +X509_TRUST +, (�), (i)) + + ) + +2039 + #sk_X509_TRUST_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +X509_TRUST +, (�), (i), (v�)) + + ) + +2040 + #sk_X509_TRUST_z�o +( +� +� + `SKM_sk_z�o +( +X509_TRUST +, (�)) + + ) + +2041 + #sk_X509_TRUST_push +( +� +, +v� +� + `SKM_sk_push +( +X509_TRUST +, (�), (v�)) + + ) + +2042 + #sk_X509_TRUST_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +X509_TRUST +, (�), (v�)) + + ) + +2043 + #sk_X509_TRUST_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +X509_TRUST +, (�), (v�)) + + ) + +2044 + #sk_X509_TRUST_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +X509_TRUST +, (�), (v�)) + + ) + +2045 + #sk_X509_TRUST_d��e +( +� +, +i +� + `SKM_sk_d��e +( +X509_TRUST +, (�), (i)) + + ) + +2046 + #sk_X509_TRUST_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +X509_TRUST +, (�), (�r)) + + ) + +2047 + #sk_X509_TRUST_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +X509_TRUST +, (�), (v�), (i)) + + ) + +2048 + #sk_X509_TRUST_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +X509_TRUST +, (�), (cmp)) + + ) + +2049 + #sk_X509_TRUST_dup +( +� +� + `SKM_sk_dup +( +X509_TRUST +, st) + + ) + +2050 + #sk_X509_TRUST_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +X509_TRUST +, (�), (�_func)) + + ) + +2051 + #sk_X509_TRUST_shi� +( +� +� + `SKM_sk_shi� +( +X509_TRUST +, (�)) + + ) + +2052 + #sk_X509_TRUST_p� +( +� +� + `SKM_sk_p� +( +X509_TRUST +, (�)) + + ) + +2053 + #sk_X509_TRUST_s�t +( +� +� + `SKM_sk_s�t +( +X509_TRUST +, (�)) + + ) + +2054 + #sk_X509_TRUST_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +X509_TRUST +, (�)) + + ) + +2056 + #sk_X509_VERIFY_PARAM_�w +( +cmp +� + `SKM_sk_�w +( +X509_VERIFY_PARAM +, (cmp)) + + ) + +2057 + #sk_X509_VERIFY_PARAM_�w_nu� +(� + `SKM_sk_�w_nu� +( +X509_VERIFY_PARAM +) + + ) + +2058 + #sk_X509_VERIFY_PARAM_� +( +� +� + `SKM_sk_� +( +X509_VERIFY_PARAM +, (�)) + + ) + +2059 + #sk_X509_VERIFY_PARAM_num +( +� +� + `SKM_sk_num +( +X509_VERIFY_PARAM +, (�)) + + ) + +2060 + #sk_X509_VERIFY_PARAM_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +X509_VERIFY_PARAM +, (�), (i)) + + ) + +2061 + #sk_X509_VERIFY_PARAM_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +X509_VERIFY_PARAM +, (�), (i), (v�)) + + ) + +2062 + #sk_X509_VERIFY_PARAM_z�o +( +� +� + `SKM_sk_z�o +( +X509_VERIFY_PARAM +, (�)) + + ) + +2063 + #sk_X509_VERIFY_PARAM_push +( +� +, +v� +� + `SKM_sk_push +( +X509_VERIFY_PARAM +, (�), (v�)) + + ) + +2064 + #sk_X509_VERIFY_PARAM_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +X509_VERIFY_PARAM +, (�), (v�)) + + ) + +2065 + #sk_X509_VERIFY_PARAM_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +X509_VERIFY_PARAM +, (�), (v�)) + + ) + +2066 + #sk_X509_VERIFY_PARAM_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +X509_VERIFY_PARAM +, (�), (v�)) + + ) + +2067 + #sk_X509_VERIFY_PARAM_d��e +( +� +, +i +� + `SKM_sk_d��e +( +X509_VERIFY_PARAM +, (�), (i)) + + ) + +2068 + #sk_X509_VERIFY_PARAM_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +X509_VERIFY_PARAM +, (�), (�r)) + + ) + +2069 + #sk_X509_VERIFY_PARAM_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +X509_VERIFY_PARAM +, (�), (v�), (i)) + + ) + +2070 + #sk_X509_VERIFY_PARAM_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +X509_VERIFY_PARAM +, (�), (cmp)) + + ) + +2071 + #sk_X509_VERIFY_PARAM_dup +( +� +� + `SKM_sk_dup +( +X509_VERIFY_PARAM +, st) + + ) + +2072 + #sk_X509_VERIFY_PARAM_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +X509_VERIFY_PARAM +, (�), (�_func)) + + ) + +2073 + #sk_X509_VERIFY_PARAM_shi� +( +� +� + `SKM_sk_shi� +( +X509_VERIFY_PARAM +, (�)) + + ) + +2074 + #sk_X509_VERIFY_PARAM_p� +( +� +� + `SKM_sk_p� +( +X509_VERIFY_PARAM +, (�)) + + ) + +2075 + #sk_X509_VERIFY_PARAM_s�t +( +� +� + `SKM_sk_s�t +( +X509_VERIFY_PARAM +, (�)) + + ) + +2076 + #sk_X509_VERIFY_PARAM_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +X509_VERIFY_PARAM +, (�)) + + ) + +2078 + #sk_nid_���_�w +( +cmp +� + `SKM_sk_�w +( +nid_��� +, (cmp)) + + ) + +2079 + #sk_nid_���_�w_nu� +(� + `SKM_sk_�w_nu� +( +nid_��� +) + + ) + +2080 + #sk_nid_���_� +( +� +� + `SKM_sk_� +( +nid_��� +, (�)) + + ) + +2081 + #sk_nid_���_num +( +� +� + `SKM_sk_num +( +nid_��� +, (�)) + + ) + +2082 + #sk_nid_���_v�ue +( +� +, +i +� + `SKM_sk_v�ue +( +nid_��� +, (�), (i)) + + ) + +2083 + #sk_nid_���_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +( +nid_��� +, (�), (i), (v�)) + + ) + +2084 + #sk_nid_���_z�o +( +� +� + `SKM_sk_z�o +( +nid_��� +, (�)) + + ) + +2085 + #sk_nid_���_push +( +� +, +v� +� + `SKM_sk_push +( +nid_��� +, (�), (v�)) + + ) + +2086 + #sk_nid_���_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +( +nid_��� +, (�), (v�)) + + ) + +2087 + #sk_nid_���_f�d +( +� +, +v� +� + `SKM_sk_f�d +( +nid_��� +, (�), (v�)) + + ) + +2088 + #sk_nid_���_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +( +nid_��� +, (�), (v�)) + + ) + +2089 + #sk_nid_���_d��e +( +� +, +i +� + `SKM_sk_d��e +( +nid_��� +, (�), (i)) + + ) + +2090 + #sk_nid_���_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +( +nid_��� +, (�), (�r)) + + ) + +2091 + #sk_nid_���_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +( +nid_��� +, (�), (v�), (i)) + + ) + +2092 + #sk_nid_���_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +( +nid_��� +, (�), (cmp)) + + ) + +2093 + #sk_nid_���_dup +( +� +� + `SKM_sk_dup +( +nid_��� +, st) + + ) + +2094 + #sk_nid_���_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +( +nid_��� +, (�), (�_func)) + + ) + +2095 + #sk_nid_���_shi� +( +� +� + `SKM_sk_shi� +( +nid_��� +, (�)) + + ) + +2096 + #sk_nid_���_p� +( +� +� + `SKM_sk_p� +( +nid_��� +, (�)) + + ) + +2097 + #sk_nid_���_s�t +( +� +� + `SKM_sk_s�t +( +nid_��� +, (�)) + + ) + +2098 + #sk_nid_���_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +nid_��� +, (�)) + + ) + +2100 + #sk_void_�w +( +cmp +� + `SKM_sk_�w +(, (cmp)) + + ) + +2101 + #sk_void_�w_nu� +(� + `SKM_sk_�w_nu� +() + + ) + +2102 + #sk_void_� +( +� +� + `SKM_sk_� +(, (�)) + + ) + +2103 + #sk_void_num +( +� +� + `SKM_sk_num +(, (�)) + + ) + +2104 + #sk_void_v�ue +( +� +, +i +� + `SKM_sk_v�ue +(, (�), (i)) + + ) + +2105 + #sk_void_�t +( +� +, +i +, +v� +� + `SKM_sk_�t +(, (�), (i), (v�)) + + ) + +2106 + #sk_void_z�o +( +� +� + `SKM_sk_z�o +(, (�)) + + ) + +2107 + #sk_void_push +( +� +, +v� +� + `SKM_sk_push +(, (�), (v�)) + + ) + +2108 + #sk_void_unshi� +( +� +, +v� +� + `SKM_sk_unshi� +(, (�), (v�)) + + ) + +2109 + #sk_void_f�d +( +� +, +v� +� + `SKM_sk_f�d +(, (�), (v�)) + + ) + +2110 + #sk_void_f�d_ex +( +� +, +v� +� + `SKM_sk_f�d_ex +(, (�), (v�)) + + ) + +2111 + #sk_void_d��e +( +� +, +i +� + `SKM_sk_d��e +(, (�), (i)) + + ) + +2112 + #sk_void_d��e_�r +( +� +, +�r +� + `SKM_sk_d��e_�r +(, (�), (�r)) + + ) + +2113 + #sk_void_��� +( +� +, +v� +, +i +� + `SKM_sk_��� +(, (�), (v�), (i)) + + ) + +2114 + #sk_void_�t_cmp_func +( +� +, +cmp +� + `SKM_sk_�t_cmp_func +(, (�), (cmp)) + + ) + +2115 + #sk_void_dup +( +� +� + `SKM_sk_dup +(, st) + + ) + +2116 + #sk_void_p�_� +( +� +, +�_func +� + `SKM_sk_p�_� +(, (�), (�_func)) + + ) + +2117 + #sk_void_shi� +( +� +� + `SKM_sk_shi� +(, (�)) + + ) + +2118 + #sk_void_p� +( +� +� + `SKM_sk_p� +(, (�)) + + ) + +2119 + #sk_void_s�t +( +� +� + `SKM_sk_s�t +(, (�)) + + ) + +2120 + #sk_void_is_s܋d +( +� +� + `SKM_sk_is_s܋d +(, (�)) + + ) + +2122 + #sk_OPENSSL_STRING_�w +( +cmp +�(( + `STACK_OF +( +OPENSSL_STRING +�*) + `sk_�w +( + `CHECKED_SK_CMP_FUNC +(, cmp))) + + ) + +2123 + #sk_OPENSSL_STRING_�w_nu� +(�(( + `STACK_OF +( +OPENSSL_STRING +�*) + `sk_�w_nu� +()) + + ) + +2124 + #sk_OPENSSL_STRING_push +( +� +, +v� +� + `sk_push +( + `CHECKED_STACK_OF +( +OPENSSL_STRING +, st), + `CHECKED_PTR_OF +(, v�)) + + ) + +2125 + #sk_OPENSSL_STRING_f�d +( +� +, +v� +� + `sk_f�d +( + `CHECKED_STACK_OF +( +OPENSSL_STRING +, st), + `CHECKED_PTR_OF +(, v�)) + + ) + +2126 + #sk_OPENSSL_STRING_v�ue +( +� +, +i +�(( +OPENSSL_STRING +) + `sk_v�ue +( + `CHECKED_STACK_OF +(OPENSSL_STRING, st), i)) + + ) + +2127 + #sk_OPENSSL_STRING_num +( +� +� + `SKM_sk_num +( +OPENSSL_STRING +, st) + + ) + +2128 + #sk_OPENSSL_STRING_p�_� +( +� +, +�_func +� + `sk_p�_� +( + `CHECKED_STACK_OF +( +OPENSSL_STRING +, st), + `CHECKED_SK_FREE_FUNC2 +(OPENSSL_STRING, f�e_func)) + + ) + +2129 + #sk_OPENSSL_STRING_��� +( +� +, +v� +, +i +� + `sk_��� +( + `CHECKED_STACK_OF +( +OPENSSL_STRING +, st), + `CHECKED_PTR_OF +(, v�), i) + + ) + +2130 + #sk_OPENSSL_STRING_� +( +� +� + `SKM_sk_� +( +OPENSSL_STRING +, st) + + ) + +2131 + #sk_OPENSSL_STRING_�t +( +� +, +i +, +v� +� + `sk_�t +( + `CHECKED_STACK_OF +( +OPENSSL_STRING +, st), i, + `CHECKED_PTR_OF +(, v�)) + + ) + +2132 + #sk_OPENSSL_STRING_z�o +( +� +� + `SKM_sk_z�o +( +OPENSSL_STRING +, (�)) + + ) + +2133 + #sk_OPENSSL_STRING_unshi� +( +� +, +v� +� + `sk_unshi� +( + `CHECKED_STACK_OF +( +OPENSSL_STRING +, st), + `CHECKED_PTR_OF +(, v�)) + + ) + +2134 + #sk_OPENSSL_STRING_f�d_ex +( +� +, +v� +� + `sk_f�d_ex +(( +_STACK + *) + `CHECKED_CONST_PTR_OF +( + `STACK_OF +( +OPENSSL_STRING +), st), CHECKED_CONST_PTR_OF(, v�)) + + ) + +2135 + #sk_OPENSSL_STRING_d��e +( +� +, +i +� + `SKM_sk_d��e +( +OPENSSL_STRING +, (�), (i)) + + ) + +2136 + #sk_OPENSSL_STRING_d��e_�r +( +� +, +�r +�( +OPENSSL_STRING + *) + `sk_d��e_�r +( + `CHECKED_STACK_OF +(OPENSSL_STRING, st), + `CHECKED_PTR_OF +(,��)) + + ) + +2137 + #sk_OPENSSL_STRING_�t_cmp_func +( +� +, +cmp +) \ + +2139 + `sk_�t_cmp_func +( + `CHECKED_STACK_OF +( +OPENSSL_STRING +, +� +), + `CHECKED_SK_CMP_FUNC +(, +cmp +))) + + ) + +2140 + #sk_OPENSSL_STRING_dup +( +� +� + `SKM_sk_dup +( +OPENSSL_STRING +, st) + + ) + +2141 + #sk_OPENSSL_STRING_shi� +( +� +� + `SKM_sk_shi� +( +OPENSSL_STRING +, (�)) + + ) + +2142 + #sk_OPENSSL_STRING_p� +( +� +�(*) + `sk_p� +( + `CHECKED_STACK_OF +( +OPENSSL_STRING +, st)) + + ) + +2143 + #sk_OPENSSL_STRING_s�t +( +� +� + `SKM_sk_s�t +( +OPENSSL_STRING +, (�)) + + ) + +2144 + #sk_OPENSSL_STRING_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +OPENSSL_STRING +, (�)) + + ) + +2147 + #sk_OPENSSL_BLOCK_�w +( +cmp +�(( + `STACK_OF +( +OPENSSL_BLOCK +�*) + `sk_�w +( + `CHECKED_SK_CMP_FUNC +(, cmp))) + + ) + +2148 + #sk_OPENSSL_BLOCK_�w_nu� +(�(( + `STACK_OF +( +OPENSSL_BLOCK +�*) + `sk_�w_nu� +()) + + ) + +2149 + #sk_OPENSSL_BLOCK_push +( +� +, +v� +� + `sk_push +( + `CHECKED_STACK_OF +( +OPENSSL_BLOCK +, st), + `CHECKED_PTR_OF +(, v�)) + + ) + +2150 + #sk_OPENSSL_BLOCK_f�d +( +� +, +v� +� + `sk_f�d +( + `CHECKED_STACK_OF +( +OPENSSL_BLOCK +, st), + `CHECKED_PTR_OF +(, v�)) + + ) + +2151 + #sk_OPENSSL_BLOCK_v�ue +( +� +, +i +�(( +OPENSSL_BLOCK +) + `sk_v�ue +( + `CHECKED_STACK_OF +(OPENSSL_BLOCK, st), i)) + + ) + +2152 + #sk_OPENSSL_BLOCK_num +( +� +� + `SKM_sk_num +( +OPENSSL_BLOCK +, st) + + ) + +2153 + #sk_OPENSSL_BLOCK_p�_� +( +� +, +�_func +� + `sk_p�_� +( + `CHECKED_STACK_OF +( +OPENSSL_BLOCK +, st), + `CHECKED_SK_FREE_FUNC2 +(OPENSSL_BLOCK, f�e_func)) + + ) + +2154 + #sk_OPENSSL_BLOCK_��� +( +� +, +v� +, +i +� + `sk_��� +( + `CHECKED_STACK_OF +( +OPENSSL_BLOCK +, st), + `CHECKED_PTR_OF +(, v�), i) + + ) + +2155 + #sk_OPENSSL_BLOCK_� +( +� +� + `SKM_sk_� +( +OPENSSL_BLOCK +, st) + + ) + +2156 + #sk_OPENSSL_BLOCK_�t +( +� +, +i +, +v� +� + `sk_�t +( + `CHECKED_STACK_OF +( +OPENSSL_BLOCK +, st), i, + `CHECKED_PTR_OF +(, v�)) + + ) + +2157 + #sk_OPENSSL_BLOCK_z�o +( +� +� + `SKM_sk_z�o +( +OPENSSL_BLOCK +, (�)) + + ) + +2158 + #sk_OPENSSL_BLOCK_unshi� +( +� +, +v� +� + `sk_unshi� +( + `CHECKED_STACK_OF +( +OPENSSL_BLOCK +, st), + `CHECKED_PTR_OF +(, v�)) + + ) + +2159 + #sk_OPENSSL_BLOCK_f�d_ex +( +� +, +v� +� + `sk_f�d_ex +(( +_STACK + *) + `CHECKED_CONST_PTR_OF +( + `STACK_OF +( +OPENSSL_BLOCK +), st), CHECKED_CONST_PTR_OF(, v�)) + + ) + +2160 + #sk_OPENSSL_BLOCK_d��e +( +� +, +i +� + `SKM_sk_d��e +( +OPENSSL_BLOCK +, (�), (i)) + + ) + +2161 + #sk_OPENSSL_BLOCK_d��e_�r +( +� +, +�r +�( +OPENSSL_BLOCK + *) + `sk_d��e_�r +( + `CHECKED_STACK_OF +(OPENSSL_BLOCK, st), + `CHECKED_PTR_OF +(,��)) + + ) + +2162 + #sk_OPENSSL_BLOCK_�t_cmp_func +( +� +, +cmp +) \ + +2164 + `sk_�t_cmp_func +( + `CHECKED_STACK_OF +( +OPENSSL_BLOCK +, +� +), + `CHECKED_SK_CMP_FUNC +(, +cmp +))) + + ) + +2165 + #sk_OPENSSL_BLOCK_dup +( +� +� + `SKM_sk_dup +( +OPENSSL_BLOCK +, st) + + ) + +2166 + #sk_OPENSSL_BLOCK_shi� +( +� +� + `SKM_sk_shi� +( +OPENSSL_BLOCK +, (�)) + + ) + +2167 + #sk_OPENSSL_BLOCK_p� +( +� +�(*) + `sk_p� +( + `CHECKED_STACK_OF +( +OPENSSL_BLOCK +, st)) + + ) + +2168 + #sk_OPENSSL_BLOCK_s�t +( +� +� + `SKM_sk_s�t +( +OPENSSL_BLOCK +, (�)) + + ) + +2169 + #sk_OPENSSL_BLOCK_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +OPENSSL_BLOCK +, (�)) + + ) + +2172 + #sk_OPENSSL_PSTRING_�w +( +cmp +�(( + `STACK_OF +( +OPENSSL_PSTRING +�*) + `sk_�w +( + `CHECKED_SK_CMP_FUNC +( +OPENSSL_STRING +, cmp))) + + ) + +2173 + #sk_OPENSSL_PSTRING_�w_nu� +(�(( + `STACK_OF +( +OPENSSL_PSTRING +�*) + `sk_�w_nu� +()) + + ) + +2174 + #sk_OPENSSL_PSTRING_push +( +� +, +v� +� + `sk_push +( + `CHECKED_STACK_OF +( +OPENSSL_PSTRING +, st), + `CHECKED_PTR_OF +( +OPENSSL_STRING +, v�)) + + ) + +2175 + #sk_OPENSSL_PSTRING_f�d +( +� +, +v� +� + `sk_f�d +( + `CHECKED_STACK_OF +( +OPENSSL_PSTRING +, st), + `CHECKED_PTR_OF +( +OPENSSL_STRING +, v�)) + + ) + +2176 + #sk_OPENSSL_PSTRING_v�ue +( +� +, +i +�(( +OPENSSL_PSTRING +) + `sk_v�ue +( + `CHECKED_STACK_OF +(OPENSSL_PSTRING, st), i)) + + ) + +2177 + #sk_OPENSSL_PSTRING_num +( +� +� + `SKM_sk_num +( +OPENSSL_PSTRING +, st) + + ) + +2178 + #sk_OPENSSL_PSTRING_p�_� +( +� +, +�_func +� + `sk_p�_� +( + `CHECKED_STACK_OF +( +OPENSSL_PSTRING +, st), + `CHECKED_SK_FREE_FUNC2 +(OPENSSL_PSTRING, f�e_func)) + + ) + +2179 + #sk_OPENSSL_PSTRING_��� +( +� +, +v� +, +i +� + `sk_��� +( + `CHECKED_STACK_OF +( +OPENSSL_PSTRING +, st), + `CHECKED_PTR_OF +( +OPENSSL_STRING +, v�), i) + + ) + +2180 + #sk_OPENSSL_PSTRING_� +( +� +� + `SKM_sk_� +( +OPENSSL_PSTRING +, st) + + ) + +2181 + #sk_OPENSSL_PSTRING_�t +( +� +, +i +, +v� +� + `sk_�t +( + `CHECKED_STACK_OF +( +OPENSSL_PSTRING +, st), i, + `CHECKED_PTR_OF +( +OPENSSL_STRING +, v�)) + + ) + +2182 + #sk_OPENSSL_PSTRING_z�o +( +� +� + `SKM_sk_z�o +( +OPENSSL_PSTRING +, (�)) + + ) + +2183 + #sk_OPENSSL_PSTRING_unshi� +( +� +, +v� +� + `sk_unshi� +( + `CHECKED_STACK_OF +( +OPENSSL_PSTRING +, st), + `CHECKED_PTR_OF +( +OPENSSL_STRING +, v�)) + + ) + +2184 + #sk_OPENSSL_PSTRING_f�d_ex +( +� +, +v� +� + `sk_f�d_ex +(( +_STACK + *) + `CHECKED_CONST_PTR_OF +( + `STACK_OF +( +OPENSSL_PSTRING +), st), CHECKED_CONST_PTR_OF( +OPENSSL_STRING +, v�)) + + ) + +2185 + #sk_OPENSSL_PSTRING_d��e +( +� +, +i +� + `SKM_sk_d��e +( +OPENSSL_PSTRING +, (�), (i)) + + ) + +2186 + #sk_OPENSSL_PSTRING_d��e_�r +( +� +, +�r +�( +OPENSSL_PSTRING + *) + `sk_d��e_�r +( + `CHECKED_STACK_OF +(OPENSSL_PSTRING, st), + `CHECKED_PTR_OF +( +OPENSSL_STRING +,��)) + + ) + +2187 + #sk_OPENSSL_PSTRING_�t_cmp_func +( +� +, +cmp +) \ + +2188 (((*)(cڡ +OPENSSL_STRING + * const *,const OPENSSL_STRING * const *)) \ + +2189 + `sk_�t_cmp_func +( + `CHECKED_STACK_OF +( +OPENSSL_PSTRING +, +� +), + `CHECKED_SK_CMP_FUNC +( +OPENSSL_STRING +, +cmp +))) + + ) + +2190 + #sk_OPENSSL_PSTRING_dup +( +� +� + `SKM_sk_dup +( +OPENSSL_PSTRING +, st) + + ) + +2191 + #sk_OPENSSL_PSTRING_shi� +( +� +� + `SKM_sk_shi� +( +OPENSSL_PSTRING +, (�)) + + ) + +2192 + #sk_OPENSSL_PSTRING_p� +( +� +�( +OPENSSL_STRING + *) + `sk_p� +( + `CHECKED_STACK_OF +( +OPENSSL_PSTRING +, st)) + + ) + +2193 + #sk_OPENSSL_PSTRING_s�t +( +� +� + `SKM_sk_s�t +( +OPENSSL_PSTRING +, (�)) + + ) + +2194 + #sk_OPENSSL_PSTRING_is_s܋d +( +� +� + `SKM_sk_is_s܋d +( +OPENSSL_PSTRING +, (�)) + + ) + +2197 + #d2i_ASN1_SET_OF_ACCESS_DESCRIPTION +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2198 + `SKM_ASN1_SET_OF_d2i +( +ACCESS_DESCRIPTION +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2199 + #i2d_ASN1_SET_OF_ACCESS_DESCRIPTION +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2200 + `SKM_ASN1_SET_OF_i2d +( +ACCESS_DESCRIPTION +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2201 + #ASN1_�q_�ck_ACCESS_DESCRIPTION +( +� +, +i2d_func +, +buf +, +�n +) \ + +2202 + `SKM_ASN1_�q_�ck +( +ACCESS_DESCRIPTION +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2203 + #ASN1_�q_u�ack_ACCESS_DESCRIPTION +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2204 + `SKM_ASN1_�q_u�ack +( +ACCESS_DESCRIPTION +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2206 + #d2i_ASN1_SET_OF_ASN1_INTEGER +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2207 + `SKM_ASN1_SET_OF_d2i +( +ASN1_INTEGER +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2208 + #i2d_ASN1_SET_OF_ASN1_INTEGER +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2209 + `SKM_ASN1_SET_OF_i2d +( +ASN1_INTEGER +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2210 + #ASN1_�q_�ck_ASN1_INTEGER +( +� +, +i2d_func +, +buf +, +�n +) \ + +2211 + `SKM_ASN1_�q_�ck +( +ASN1_INTEGER +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2212 + #ASN1_�q_u�ack_ASN1_INTEGER +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2213 + `SKM_ASN1_�q_u�ack +( +ASN1_INTEGER +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2215 + #d2i_ASN1_SET_OF_ASN1_OBJECT +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2216 + `SKM_ASN1_SET_OF_d2i +( +ASN1_OBJECT +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2217 + #i2d_ASN1_SET_OF_ASN1_OBJECT +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2218 + `SKM_ASN1_SET_OF_i2d +( +ASN1_OBJECT +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2219 + #ASN1_�q_�ck_ASN1_OBJECT +( +� +, +i2d_func +, +buf +, +�n +) \ + +2220 + `SKM_ASN1_�q_�ck +( +ASN1_OBJECT +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2221 + #ASN1_�q_u�ack_ASN1_OBJECT +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2222 + `SKM_ASN1_�q_u�ack +( +ASN1_OBJECT +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2224 + #d2i_ASN1_SET_OF_ASN1_TYPE +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2225 + `SKM_ASN1_SET_OF_d2i +( +ASN1_TYPE +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2226 + #i2d_ASN1_SET_OF_ASN1_TYPE +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2227 + `SKM_ASN1_SET_OF_i2d +( +ASN1_TYPE +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2228 + #ASN1_�q_�ck_ASN1_TYPE +( +� +, +i2d_func +, +buf +, +�n +) \ + +2229 + `SKM_ASN1_�q_�ck +( +ASN1_TYPE +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2230 + #ASN1_�q_u�ack_ASN1_TYPE +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2231 + `SKM_ASN1_�q_u�ack +( +ASN1_TYPE +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2233 + #d2i_ASN1_SET_OF_ASN1_UTF8STRING +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2234 + `SKM_ASN1_SET_OF_d2i +( +ASN1_UTF8STRING +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2235 + #i2d_ASN1_SET_OF_ASN1_UTF8STRING +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2236 + `SKM_ASN1_SET_OF_i2d +( +ASN1_UTF8STRING +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2237 + #ASN1_�q_�ck_ASN1_UTF8STRING +( +� +, +i2d_func +, +buf +, +�n +) \ + +2238 + `SKM_ASN1_�q_�ck +( +ASN1_UTF8STRING +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2239 + #ASN1_�q_u�ack_ASN1_UTF8STRING +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2240 + `SKM_ASN1_�q_u�ack +( +ASN1_UTF8STRING +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2242 + #d2i_ASN1_SET_OF_DIST_POINT +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2243 + `SKM_ASN1_SET_OF_d2i +( +DIST_POINT +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2244 + #i2d_ASN1_SET_OF_DIST_POINT +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2245 + `SKM_ASN1_SET_OF_i2d +( +DIST_POINT +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2246 + #ASN1_�q_�ck_DIST_POINT +( +� +, +i2d_func +, +buf +, +�n +) \ + +2247 + `SKM_ASN1_�q_�ck +( +DIST_POINT +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2248 + #ASN1_�q_u�ack_DIST_POINT +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2249 + `SKM_ASN1_�q_u�ack +( +DIST_POINT +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2251 + #d2i_ASN1_SET_OF_ESS_CERT_ID +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2252 + `SKM_ASN1_SET_OF_d2i +( +ESS_CERT_ID +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2253 + #i2d_ASN1_SET_OF_ESS_CERT_ID +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2254 + `SKM_ASN1_SET_OF_i2d +( +ESS_CERT_ID +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2255 + #ASN1_�q_�ck_ESS_CERT_ID +( +� +, +i2d_func +, +buf +, +�n +) \ + +2256 + `SKM_ASN1_�q_�ck +( +ESS_CERT_ID +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2257 + #ASN1_�q_u�ack_ESS_CERT_ID +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2258 + `SKM_ASN1_�q_u�ack +( +ESS_CERT_ID +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2260 + #d2i_ASN1_SET_OF_EVP_MD +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2261 + `SKM_ASN1_SET_OF_d2i +( +EVP_MD +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2262 + #i2d_ASN1_SET_OF_EVP_MD +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2263 + `SKM_ASN1_SET_OF_i2d +( +EVP_MD +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2264 + #ASN1_�q_�ck_EVP_MD +( +� +, +i2d_func +, +buf +, +�n +) \ + +2265 + `SKM_ASN1_�q_�ck +( +EVP_MD +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2266 + #ASN1_�q_u�ack_EVP_MD +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2267 + `SKM_ASN1_�q_u�ack +( +EVP_MD +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2269 + #d2i_ASN1_SET_OF_GENERAL_NAME +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2270 + `SKM_ASN1_SET_OF_d2i +( +GENERAL_NAME +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2271 + #i2d_ASN1_SET_OF_GENERAL_NAME +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2272 + `SKM_ASN1_SET_OF_i2d +( +GENERAL_NAME +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2273 + #ASN1_�q_�ck_GENERAL_NAME +( +� +, +i2d_func +, +buf +, +�n +) \ + +2274 + `SKM_ASN1_�q_�ck +( +GENERAL_NAME +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2275 + #ASN1_�q_u�ack_GENERAL_NAME +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2276 + `SKM_ASN1_�q_u�ack +( +GENERAL_NAME +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2278 + #d2i_ASN1_SET_OF_OCSP_ONEREQ +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2279 + `SKM_ASN1_SET_OF_d2i +( +OCSP_ONEREQ +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2280 + #i2d_ASN1_SET_OF_OCSP_ONEREQ +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2281 + `SKM_ASN1_SET_OF_i2d +( +OCSP_ONEREQ +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2282 + #ASN1_�q_�ck_OCSP_ONEREQ +( +� +, +i2d_func +, +buf +, +�n +) \ + +2283 + `SKM_ASN1_�q_�ck +( +OCSP_ONEREQ +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2284 + #ASN1_�q_u�ack_OCSP_ONEREQ +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2285 + `SKM_ASN1_�q_u�ack +( +OCSP_ONEREQ +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2287 + #d2i_ASN1_SET_OF_OCSP_SINGLERESP +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2288 + `SKM_ASN1_SET_OF_d2i +( +OCSP_SINGLERESP +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2289 + #i2d_ASN1_SET_OF_OCSP_SINGLERESP +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2290 + `SKM_ASN1_SET_OF_i2d +( +OCSP_SINGLERESP +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2291 + #ASN1_�q_�ck_OCSP_SINGLERESP +( +� +, +i2d_func +, +buf +, +�n +) \ + +2292 + `SKM_ASN1_�q_�ck +( +OCSP_SINGLERESP +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2293 + #ASN1_�q_u�ack_OCSP_SINGLERESP +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2294 + `SKM_ASN1_�q_u�ack +( +OCSP_SINGLERESP +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2296 + #d2i_ASN1_SET_OF_PKCS12_SAFEBAG +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2297 + `SKM_ASN1_SET_OF_d2i +( +PKCS12_SAFEBAG +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2298 + #i2d_ASN1_SET_OF_PKCS12_SAFEBAG +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2299 + `SKM_ASN1_SET_OF_i2d +( +PKCS12_SAFEBAG +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2300 + #ASN1_�q_�ck_PKCS12_SAFEBAG +( +� +, +i2d_func +, +buf +, +�n +) \ + +2301 + `SKM_ASN1_�q_�ck +( +PKCS12_SAFEBAG +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2302 + #ASN1_�q_u�ack_PKCS12_SAFEBAG +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2303 + `SKM_ASN1_�q_u�ack +( +PKCS12_SAFEBAG +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2305 + #d2i_ASN1_SET_OF_PKCS7 +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2306 + `SKM_ASN1_SET_OF_d2i +( +PKCS7 +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2307 + #i2d_ASN1_SET_OF_PKCS7 +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2308 + `SKM_ASN1_SET_OF_i2d +( +PKCS7 +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2309 + #ASN1_�q_�ck_PKCS7 +( +� +, +i2d_func +, +buf +, +�n +) \ + +2310 + `SKM_ASN1_�q_�ck +( +PKCS7 +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2311 + #ASN1_�q_u�ack_PKCS7 +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2312 + `SKM_ASN1_�q_u�ack +( +PKCS7 +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2314 + #d2i_ASN1_SET_OF_PKCS7_RECIP_INFO +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2315 + `SKM_ASN1_SET_OF_d2i +( +PKCS7_RECIP_INFO +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2316 + #i2d_ASN1_SET_OF_PKCS7_RECIP_INFO +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2317 + `SKM_ASN1_SET_OF_i2d +( +PKCS7_RECIP_INFO +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2318 + #ASN1_�q_�ck_PKCS7_RECIP_INFO +( +� +, +i2d_func +, +buf +, +�n +) \ + +2319 + `SKM_ASN1_�q_�ck +( +PKCS7_RECIP_INFO +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2320 + #ASN1_�q_u�ack_PKCS7_RECIP_INFO +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2321 + `SKM_ASN1_�q_u�ack +( +PKCS7_RECIP_INFO +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2323 + #d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2324 + `SKM_ASN1_SET_OF_d2i +( +PKCS7_SIGNER_INFO +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2325 + #i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2326 + `SKM_ASN1_SET_OF_i2d +( +PKCS7_SIGNER_INFO +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2327 + #ASN1_�q_�ck_PKCS7_SIGNER_INFO +( +� +, +i2d_func +, +buf +, +�n +) \ + +2328 + `SKM_ASN1_�q_�ck +( +PKCS7_SIGNER_INFO +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2329 + #ASN1_�q_u�ack_PKCS7_SIGNER_INFO +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2330 + `SKM_ASN1_�q_u�ack +( +PKCS7_SIGNER_INFO +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2332 + #d2i_ASN1_SET_OF_POLICYINFO +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2333 + `SKM_ASN1_SET_OF_d2i +( +POLICYINFO +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2334 + #i2d_ASN1_SET_OF_POLICYINFO +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2335 + `SKM_ASN1_SET_OF_i2d +( +POLICYINFO +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2336 + #ASN1_�q_�ck_POLICYINFO +( +� +, +i2d_func +, +buf +, +�n +) \ + +2337 + `SKM_ASN1_�q_�ck +( +POLICYINFO +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2338 + #ASN1_�q_u�ack_POLICYINFO +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2339 + `SKM_ASN1_�q_u�ack +( +POLICYINFO +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2341 + #d2i_ASN1_SET_OF_POLICYQUALINFO +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2342 + `SKM_ASN1_SET_OF_d2i +( +POLICYQUALINFO +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2343 + #i2d_ASN1_SET_OF_POLICYQUALINFO +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2344 + `SKM_ASN1_SET_OF_i2d +( +POLICYQUALINFO +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2345 + #ASN1_�q_�ck_POLICYQUALINFO +( +� +, +i2d_func +, +buf +, +�n +) \ + +2346 + `SKM_ASN1_�q_�ck +( +POLICYQUALINFO +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2347 + #ASN1_�q_u�ack_POLICYQUALINFO +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2348 + `SKM_ASN1_�q_u�ack +( +POLICYQUALINFO +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2350 + #d2i_ASN1_SET_OF_SXNETID +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2351 + `SKM_ASN1_SET_OF_d2i +( +SXNETID +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2352 + #i2d_ASN1_SET_OF_SXNETID +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2353 + `SKM_ASN1_SET_OF_i2d +( +SXNETID +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2354 + #ASN1_�q_�ck_SXNETID +( +� +, +i2d_func +, +buf +, +�n +) \ + +2355 + `SKM_ASN1_�q_�ck +( +SXNETID +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2356 + #ASN1_�q_u�ack_SXNETID +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2357 + `SKM_ASN1_�q_u�ack +( +SXNETID +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2359 + #d2i_ASN1_SET_OF_X509 +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2360 + `SKM_ASN1_SET_OF_d2i +( +X509 +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2361 + #i2d_ASN1_SET_OF_X509 +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2362 + `SKM_ASN1_SET_OF_i2d +( +X509 +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2363 + #ASN1_�q_�ck_X509 +( +� +, +i2d_func +, +buf +, +�n +) \ + +2364 + `SKM_ASN1_�q_�ck +( +X509 +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2365 + #ASN1_�q_u�ack_X509 +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2366 + `SKM_ASN1_�q_u�ack +( +X509 +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2368 + #d2i_ASN1_SET_OF_X509_ALGOR +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2369 + `SKM_ASN1_SET_OF_d2i +( +X509_ALGOR +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2370 + #i2d_ASN1_SET_OF_X509_ALGOR +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2371 + `SKM_ASN1_SET_OF_i2d +( +X509_ALGOR +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2372 + #ASN1_�q_�ck_X509_ALGOR +( +� +, +i2d_func +, +buf +, +�n +) \ + +2373 + `SKM_ASN1_�q_�ck +( +X509_ALGOR +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2374 + #ASN1_�q_u�ack_X509_ALGOR +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2375 + `SKM_ASN1_�q_u�ack +( +X509_ALGOR +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2377 + #d2i_ASN1_SET_OF_X509_ATTRIBUTE +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2378 + `SKM_ASN1_SET_OF_d2i +( +X509_ATTRIBUTE +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2379 + #i2d_ASN1_SET_OF_X509_ATTRIBUTE +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2380 + `SKM_ASN1_SET_OF_i2d +( +X509_ATTRIBUTE +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2381 + #ASN1_�q_�ck_X509_ATTRIBUTE +( +� +, +i2d_func +, +buf +, +�n +) \ + +2382 + `SKM_ASN1_�q_�ck +( +X509_ATTRIBUTE +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2383 + #ASN1_�q_u�ack_X509_ATTRIBUTE +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2384 + `SKM_ASN1_�q_u�ack +( +X509_ATTRIBUTE +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2386 + #d2i_ASN1_SET_OF_X509_CRL +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2387 + `SKM_ASN1_SET_OF_d2i +( +X509_CRL +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2388 + #i2d_ASN1_SET_OF_X509_CRL +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2389 + `SKM_ASN1_SET_OF_i2d +( +X509_CRL +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2390 + #ASN1_�q_�ck_X509_CRL +( +� +, +i2d_func +, +buf +, +�n +) \ + +2391 + `SKM_ASN1_�q_�ck +( +X509_CRL +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2392 + #ASN1_�q_u�ack_X509_CRL +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2393 + `SKM_ASN1_�q_u�ack +( +X509_CRL +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2395 + #d2i_ASN1_SET_OF_X509_EXTENSION +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2396 + `SKM_ASN1_SET_OF_d2i +( +X509_EXTENSION +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2397 + #i2d_ASN1_SET_OF_X509_EXTENSION +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2398 + `SKM_ASN1_SET_OF_i2d +( +X509_EXTENSION +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2399 + #ASN1_�q_�ck_X509_EXTENSION +( +� +, +i2d_func +, +buf +, +�n +) \ + +2400 + `SKM_ASN1_�q_�ck +( +X509_EXTENSION +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2401 + #ASN1_�q_u�ack_X509_EXTENSION +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2402 + `SKM_ASN1_�q_u�ack +( +X509_EXTENSION +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2404 + #d2i_ASN1_SET_OF_X509_NAME_ENTRY +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2405 + `SKM_ASN1_SET_OF_d2i +( +X509_NAME_ENTRY +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2406 + #i2d_ASN1_SET_OF_X509_NAME_ENTRY +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2407 + `SKM_ASN1_SET_OF_i2d +( +X509_NAME_ENTRY +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2408 + #ASN1_�q_�ck_X509_NAME_ENTRY +( +� +, +i2d_func +, +buf +, +�n +) \ + +2409 + `SKM_ASN1_�q_�ck +( +X509_NAME_ENTRY +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2410 + #ASN1_�q_u�ack_X509_NAME_ENTRY +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2411 + `SKM_ASN1_�q_u�ack +( +X509_NAME_ENTRY +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2413 + #d2i_ASN1_SET_OF_X509_REVOKED +( +� +, +� +, +�ngth +, +d2i_func +, +�_func +, +ex_�g +, +ex_�ass +) \ + +2414 + `SKM_ASN1_SET_OF_d2i +( +X509_REVOKED +, ( +� +), ( +� +), ( +�ngth +), ( +d2i_func +), ( +�_func +), ( +ex_�g +), ( +ex_�ass +)) + + ) + +2415 + #i2d_ASN1_SET_OF_X509_REVOKED +( +� +, +� +, +i2d_func +, +ex_�g +, +ex_�ass +, +is_�t +) \ + +2416 + `SKM_ASN1_SET_OF_i2d +( +X509_REVOKED +, ( +� +), ( +� +), ( +i2d_func +), ( +ex_�g +), ( +ex_�ass +), ( +is_�t +)) + + ) + +2417 + #ASN1_�q_�ck_X509_REVOKED +( +� +, +i2d_func +, +buf +, +�n +) \ + +2418 + `SKM_ASN1_�q_�ck +( +X509_REVOKED +, ( +� +), ( +i2d_func +), ( +buf +), ( +�n +)) + + ) + +2419 + #ASN1_�q_u�ack_X509_REVOKED +( +buf +, +�n +, +d2i_func +, +�_func +) \ + +2420 + `SKM_ASN1_�q_u�ack +( +X509_REVOKED +, ( +buf +), ( +�n +), ( +d2i_func +), ( +�_func +)) + + ) + +2422 + #PKCS12_de�y�_d2i_PKCS12_SAFEBAG +( +�g� +, +d2i_func +, +�_func +, +�ss +, +�s�� +, +o� +, +�q +) \ + +2423 + `SKM_PKCS12_de�y�_d2i +( +PKCS12_SAFEBAG +, ( +�g� +), ( +d2i_func +), ( +�_func +), ( +�ss +), ( +�s�� +), ( +o� +), ( +�q +)) + + ) + +2425 + #PKCS12_de�y�_d2i_PKCS7 +( +�g� +, +d2i_func +, +�_func +, +�ss +, +�s�� +, +o� +, +�q +) \ + +2426 + `SKM_PKCS12_de�y�_d2i +( +PKCS7 +, ( +�g� +), ( +d2i_func +), ( +�_func +), ( +�ss +), ( +�s�� +), ( +o� +), ( +�q +)) + + ) + +2428 + #lh_ADDED_OBJ_�w +(� + `LHM_lh_�w +( +ADDED_OBJ +, +added_obj +) + + ) + +2429 + #lh_ADDED_OBJ_��� +( +lh +, +�� +� + `LHM_lh_��� +( +ADDED_OBJ +,lh,��) + + ) + +2430 + #lh_ADDED_OBJ_���ve +( +lh +, +�� +� + `LHM_lh_���ve +( +ADDED_OBJ +,lh,��) + + ) + +2431 + #lh_ADDED_OBJ_d��e +( +lh +, +�� +� + `LHM_lh_d��e +( +ADDED_OBJ +,lh,��) + + ) + +2432 + #lh_ADDED_OBJ_d�� +( +lh +, +� +� + `LHM_lh_d�� +( +ADDED_OBJ +,lh,�) + + ) + +2433 + #lh_ADDED_OBJ_d��_�g +( +lh +, +� +, +�g_ty� +, +�g +) \ + +2434 + `LHM_lh_d��_�g +( +ADDED_OBJ +, +lh +, +� +, +�g_ty� +, +�g +) + + ) + +2435 + #lh_ADDED_OBJ_�r� +( +lh +� + `LHM_lh_�r� +( +ADDED_OBJ +,lh) + + ) + +2436 + #lh_ADDED_OBJ_num_�ems +( +lh +� + `LHM_lh_num_�ems +( +ADDED_OBJ +,lh) + + ) + +2437 + #lh_ADDED_OBJ_down_l�d +( +lh +� + `LHM_lh_down_l�d +( +ADDED_OBJ +,lh) + + ) + +2438 + #lh_ADDED_OBJ_node_��s_bio +( +lh +, +out +) \ + +2439 + `LHM_lh_node_��s_bio +( +ADDED_OBJ +, +lh +, +out +) + + ) + +2440 + #lh_ADDED_OBJ_node_u�ge_��s_bio +( +lh +, +out +) \ + +2441 + `LHM_lh_node_u�ge_��s_bio +( +ADDED_OBJ +, +lh +, +out +) + + ) + +2442 + #lh_ADDED_OBJ_��s_bio +( +lh +, +out +) \ + +2443 + `LHM_lh_��s_bio +( +ADDED_OBJ +, +lh +, +out +) + + ) + +2444 + #lh_ADDED_OBJ_� +( +lh +� + `LHM_lh_� +( +ADDED_OBJ +,lh) + + ) + +2446 + #lh_APP_INFO_�w +(� + `LHM_lh_�w +( +APP_INFO +, +�p_�fo +) + + ) + +2447 + #lh_APP_INFO_��� +( +lh +, +�� +� + `LHM_lh_��� +( +APP_INFO +,lh,��) + + ) + +2448 + #lh_APP_INFO_���ve +( +lh +, +�� +� + `LHM_lh_���ve +( +APP_INFO +,lh,��) + + ) + +2449 + #lh_APP_INFO_d��e +( +lh +, +�� +� + `LHM_lh_d��e +( +APP_INFO +,lh,��) + + ) + +2450 + #lh_APP_INFO_d�� +( +lh +, +� +� + `LHM_lh_d�� +( +APP_INFO +,lh,�) + + ) + +2451 + #lh_APP_INFO_d��_�g +( +lh +, +� +, +�g_ty� +, +�g +) \ + +2452 + `LHM_lh_d��_�g +( +APP_INFO +, +lh +, +� +, +�g_ty� +, +�g +) + + ) + +2453 + #lh_APP_INFO_�r� +( +lh +� + `LHM_lh_�r� +( +APP_INFO +,lh) + + ) + +2454 + #lh_APP_INFO_num_�ems +( +lh +� + `LHM_lh_num_�ems +( +APP_INFO +,lh) + + ) + +2455 + #lh_APP_INFO_down_l�d +( +lh +� + `LHM_lh_down_l�d +( +APP_INFO +,lh) + + ) + +2456 + #lh_APP_INFO_node_��s_bio +( +lh +, +out +) \ + +2457 + `LHM_lh_node_��s_bio +( +APP_INFO +, +lh +, +out +) + + ) + +2458 + #lh_APP_INFO_node_u�ge_��s_bio +( +lh +, +out +) \ + +2459 + `LHM_lh_node_u�ge_��s_bio +( +APP_INFO +, +lh +, +out +) + + ) + +2460 + #lh_APP_INFO_��s_bio +( +lh +, +out +) \ + +2461 + `LHM_lh_��s_bio +( +APP_INFO +, +lh +, +out +) + + ) + +2462 + #lh_APP_INFO_� +( +lh +� + `LHM_lh_� +( +APP_INFO +,lh) + + ) + +2464 + #lh_CONF_VALUE_�w +(� + `LHM_lh_�w +( +CONF_VALUE +, +c�f_v�ue +) + + ) + +2465 + #lh_CONF_VALUE_��� +( +lh +, +�� +� + `LHM_lh_��� +( +CONF_VALUE +,lh,��) + + ) + +2466 + #lh_CONF_VALUE_���ve +( +lh +, +�� +� + `LHM_lh_���ve +( +CONF_VALUE +,lh,��) + + ) + +2467 + #lh_CONF_VALUE_d��e +( +lh +, +�� +� + `LHM_lh_d��e +( +CONF_VALUE +,lh,��) + + ) + +2468 + #lh_CONF_VALUE_d�� +( +lh +, +� +� + `LHM_lh_d�� +( +CONF_VALUE +,lh,�) + + ) + +2469 + #lh_CONF_VALUE_d��_�g +( +lh +, +� +, +�g_ty� +, +�g +) \ + +2470 + `LHM_lh_d��_�g +( +CONF_VALUE +, +lh +, +� +, +�g_ty� +, +�g +) + + ) + +2471 + #lh_CONF_VALUE_�r� +( +lh +� + `LHM_lh_�r� +( +CONF_VALUE +,lh) + + ) + +2472 + #lh_CONF_VALUE_num_�ems +( +lh +� + `LHM_lh_num_�ems +( +CONF_VALUE +,lh) + + ) + +2473 + #lh_CONF_VALUE_down_l�d +( +lh +� + `LHM_lh_down_l�d +( +CONF_VALUE +,lh) + + ) + +2474 + #lh_CONF_VALUE_node_��s_bio +( +lh +, +out +) \ + +2475 + `LHM_lh_node_��s_bio +( +CONF_VALUE +, +lh +, +out +) + + ) + +2476 + #lh_CONF_VALUE_node_u�ge_��s_bio +( +lh +, +out +) \ + +2477 + `LHM_lh_node_u�ge_��s_bio +( +CONF_VALUE +, +lh +, +out +) + + ) + +2478 + #lh_CONF_VALUE_��s_bio +( +lh +, +out +) \ + +2479 + `LHM_lh_��s_bio +( +CONF_VALUE +, +lh +, +out +) + + ) + +2480 + #lh_CONF_VALUE_� +( +lh +� + `LHM_lh_� +( +CONF_VALUE +,lh) + + ) + +2482 + #lh_ENGINE_PILE_�w +(� + `LHM_lh_�w +( +ENGINE_PILE +, +�g�e_p�e +) + + ) + +2483 + #lh_ENGINE_PILE_��� +( +lh +, +�� +� + `LHM_lh_��� +( +ENGINE_PILE +,lh,��) + + ) + +2484 + #lh_ENGINE_PILE_���ve +( +lh +, +�� +� + `LHM_lh_���ve +( +ENGINE_PILE +,lh,��) + + ) + +2485 + #lh_ENGINE_PILE_d��e +( +lh +, +�� +� + `LHM_lh_d��e +( +ENGINE_PILE +,lh,��) + + ) + +2486 + #lh_ENGINE_PILE_d�� +( +lh +, +� +� + `LHM_lh_d�� +( +ENGINE_PILE +,lh,�) + + ) + +2487 + #lh_ENGINE_PILE_d��_�g +( +lh +, +� +, +�g_ty� +, +�g +) \ + +2488 + `LHM_lh_d��_�g +( +ENGINE_PILE +, +lh +, +� +, +�g_ty� +, +�g +) + + ) + +2489 + #lh_ENGINE_PILE_�r� +( +lh +� + `LHM_lh_�r� +( +ENGINE_PILE +,lh) + + ) + +2490 + #lh_ENGINE_PILE_num_�ems +( +lh +� + `LHM_lh_num_�ems +( +ENGINE_PILE +,lh) + + ) + +2491 + #lh_ENGINE_PILE_down_l�d +( +lh +� + `LHM_lh_down_l�d +( +ENGINE_PILE +,lh) + + ) + +2492 + #lh_ENGINE_PILE_node_��s_bio +( +lh +, +out +) \ + +2493 + `LHM_lh_node_��s_bio +( +ENGINE_PILE +, +lh +, +out +) + + ) + +2494 + #lh_ENGINE_PILE_node_u�ge_��s_bio +( +lh +, +out +) \ + +2495 + `LHM_lh_node_u�ge_��s_bio +( +ENGINE_PILE +, +lh +, +out +) + + ) + +2496 + #lh_ENGINE_PILE_��s_bio +( +lh +, +out +) \ + +2497 + `LHM_lh_��s_bio +( +ENGINE_PILE +, +lh +, +out +) + + ) + +2498 + #lh_ENGINE_PILE_� +( +lh +� + `LHM_lh_� +( +ENGINE_PILE +,lh) + + ) + +2500 + #lh_ERR_STATE_�w +(� + `LHM_lh_�w +( +ERR_STATE +, +�r_��e +) + + ) + +2501 + #lh_ERR_STATE_��� +( +lh +, +�� +� + `LHM_lh_��� +( +ERR_STATE +,lh,��) + + ) + +2502 + #lh_ERR_STATE_���ve +( +lh +, +�� +� + `LHM_lh_���ve +( +ERR_STATE +,lh,��) + + ) + +2503 + #lh_ERR_STATE_d��e +( +lh +, +�� +� + `LHM_lh_d��e +( +ERR_STATE +,lh,��) + + ) + +2504 + #lh_ERR_STATE_d�� +( +lh +, +� +� + `LHM_lh_d�� +( +ERR_STATE +,lh,�) + + ) + +2505 + #lh_ERR_STATE_d��_�g +( +lh +, +� +, +�g_ty� +, +�g +) \ + +2506 + `LHM_lh_d��_�g +( +ERR_STATE +, +lh +, +� +, +�g_ty� +, +�g +) + + ) + +2507 + #lh_ERR_STATE_�r� +( +lh +� + `LHM_lh_�r� +( +ERR_STATE +,lh) + + ) + +2508 + #lh_ERR_STATE_num_�ems +( +lh +� + `LHM_lh_num_�ems +( +ERR_STATE +,lh) + + ) + +2509 + #lh_ERR_STATE_down_l�d +( +lh +� + `LHM_lh_down_l�d +( +ERR_STATE +,lh) + + ) + +2510 + #lh_ERR_STATE_node_��s_bio +( +lh +, +out +) \ + +2511 + `LHM_lh_node_��s_bio +( +ERR_STATE +, +lh +, +out +) + + ) + +2512 + #lh_ERR_STATE_node_u�ge_��s_bio +( +lh +, +out +) \ + +2513 + `LHM_lh_node_u�ge_��s_bio +( +ERR_STATE +, +lh +, +out +) + + ) + +2514 + #lh_ERR_STATE_��s_bio +( +lh +, +out +) \ + +2515 + `LHM_lh_��s_bio +( +ERR_STATE +, +lh +, +out +) + + ) + +2516 + #lh_ERR_STATE_� +( +lh +� + `LHM_lh_� +( +ERR_STATE +,lh) + + ) + +2518 + #lh_ERR_STRING_DATA_�w +(� + `LHM_lh_�w +( +ERR_STRING_DATA +, +�r_�r�g_d�a +) + + ) + +2519 + #lh_ERR_STRING_DATA_��� +( +lh +, +�� +� + `LHM_lh_��� +( +ERR_STRING_DATA +,lh,��) + + ) + +2520 + #lh_ERR_STRING_DATA_���ve +( +lh +, +�� +� + `LHM_lh_���ve +( +ERR_STRING_DATA +,lh,��) + + ) + +2521 + #lh_ERR_STRING_DATA_d��e +( +lh +, +�� +� + `LHM_lh_d��e +( +ERR_STRING_DATA +,lh,��) + + ) + +2522 + #lh_ERR_STRING_DATA_d�� +( +lh +, +� +� + `LHM_lh_d�� +( +ERR_STRING_DATA +,lh,�) + + ) + +2523 + #lh_ERR_STRING_DATA_d��_�g +( +lh +, +� +, +�g_ty� +, +�g +) \ + +2524 + `LHM_lh_d��_�g +( +ERR_STRING_DATA +, +lh +, +� +, +�g_ty� +, +�g +) + + ) + +2525 + #lh_ERR_STRING_DATA_�r� +( +lh +� + `LHM_lh_�r� +( +ERR_STRING_DATA +,lh) + + ) + +2526 + #lh_ERR_STRING_DATA_num_�ems +( +lh +� + `LHM_lh_num_�ems +( +ERR_STRING_DATA +,lh) + + ) + +2527 + #lh_ERR_STRING_DATA_down_l�d +( +lh +� + `LHM_lh_down_l�d +( +ERR_STRING_DATA +,lh) + + ) + +2528 + #lh_ERR_STRING_DATA_node_��s_bio +( +lh +, +out +) \ + +2529 + `LHM_lh_node_��s_bio +( +ERR_STRING_DATA +, +lh +, +out +) + + ) + +2530 + #lh_ERR_STRING_DATA_node_u�ge_��s_bio +( +lh +, +out +) \ + +2531 + `LHM_lh_node_u�ge_��s_bio +( +ERR_STRING_DATA +, +lh +, +out +) + + ) + +2532 + #lh_ERR_STRING_DATA_��s_bio +( +lh +, +out +) \ + +2533 + `LHM_lh_��s_bio +( +ERR_STRING_DATA +, +lh +, +out +) + + ) + +2534 + #lh_ERR_STRING_DATA_� +( +lh +� + `LHM_lh_� +( +ERR_STRING_DATA +,lh) + + ) + +2536 + #lh_EX_CLASS_ITEM_�w +(� + `LHM_lh_�w +( +EX_CLASS_ITEM +, +ex_�ass_�em +) + + ) + +2537 + #lh_EX_CLASS_ITEM_��� +( +lh +, +�� +� + `LHM_lh_��� +( +EX_CLASS_ITEM +,lh,��) + + ) + +2538 + #lh_EX_CLASS_ITEM_���ve +( +lh +, +�� +� + `LHM_lh_���ve +( +EX_CLASS_ITEM +,lh,��) + + ) + +2539 + #lh_EX_CLASS_ITEM_d��e +( +lh +, +�� +� + `LHM_lh_d��e +( +EX_CLASS_ITEM +,lh,��) + + ) + +2540 + #lh_EX_CLASS_ITEM_d�� +( +lh +, +� +� + `LHM_lh_d�� +( +EX_CLASS_ITEM +,lh,�) + + ) + +2541 + #lh_EX_CLASS_ITEM_d��_�g +( +lh +, +� +, +�g_ty� +, +�g +) \ + +2542 + `LHM_lh_d��_�g +( +EX_CLASS_ITEM +, +lh +, +� +, +�g_ty� +, +�g +) + + ) + +2543 + #lh_EX_CLASS_ITEM_�r� +( +lh +� + `LHM_lh_�r� +( +EX_CLASS_ITEM +,lh) + + ) + +2544 + #lh_EX_CLASS_ITEM_num_�ems +( +lh +� + `LHM_lh_num_�ems +( +EX_CLASS_ITEM +,lh) + + ) + +2545 + #lh_EX_CLASS_ITEM_down_l�d +( +lh +� + `LHM_lh_down_l�d +( +EX_CLASS_ITEM +,lh) + + ) + +2546 + #lh_EX_CLASS_ITEM_node_��s_bio +( +lh +, +out +) \ + +2547 + `LHM_lh_node_��s_bio +( +EX_CLASS_ITEM +, +lh +, +out +) + + ) + +2548 + #lh_EX_CLASS_ITEM_node_u�ge_��s_bio +( +lh +, +out +) \ + +2549 + `LHM_lh_node_u�ge_��s_bio +( +EX_CLASS_ITEM +, +lh +, +out +) + + ) + +2550 + #lh_EX_CLASS_ITEM_��s_bio +( +lh +, +out +) \ + +2551 + `LHM_lh_��s_bio +( +EX_CLASS_ITEM +, +lh +, +out +) + + ) + +2552 + #lh_EX_CLASS_ITEM_� +( +lh +� + `LHM_lh_� +( +EX_CLASS_ITEM +,lh) + + ) + +2554 + #lh_FUNCTION_�w +(� + `LHM_lh_�w +( +FUNCTION +, +fun�i� +) + + ) + +2555 + #lh_FUNCTION_��� +( +lh +, +�� +� + `LHM_lh_��� +( +FUNCTION +,lh,��) + + ) + +2556 + #lh_FUNCTION_���ve +( +lh +, +�� +� + `LHM_lh_���ve +( +FUNCTION +,lh,��) + + ) + +2557 + #lh_FUNCTION_d��e +( +lh +, +�� +� + `LHM_lh_d��e +( +FUNCTION +,lh,��) + + ) + +2558 + #lh_FUNCTION_d�� +( +lh +, +� +� + `LHM_lh_d�� +( +FUNCTION +,lh,�) + + ) + +2559 + #lh_FUNCTION_d��_�g +( +lh +, +� +, +�g_ty� +, +�g +) \ + +2560 + `LHM_lh_d��_�g +( +FUNCTION +, +lh +, +� +, +�g_ty� +, +�g +) + + ) + +2561 + #lh_FUNCTION_�r� +( +lh +� + `LHM_lh_�r� +( +FUNCTION +,lh) + + ) + +2562 + #lh_FUNCTION_num_�ems +( +lh +� + `LHM_lh_num_�ems +( +FUNCTION +,lh) + + ) + +2563 + #lh_FUNCTION_down_l�d +( +lh +� + `LHM_lh_down_l�d +( +FUNCTION +,lh) + + ) + +2564 + #lh_FUNCTION_node_��s_bio +( +lh +, +out +) \ + +2565 + `LHM_lh_node_��s_bio +( +FUNCTION +, +lh +, +out +) + + ) + +2566 + #lh_FUNCTION_node_u�ge_��s_bio +( +lh +, +out +) \ + +2567 + `LHM_lh_node_u�ge_��s_bio +( +FUNCTION +, +lh +, +out +) + + ) + +2568 + #lh_FUNCTION_��s_bio +( +lh +, +out +) \ + +2569 + `LHM_lh_��s_bio +( +FUNCTION +, +lh +, +out +) + + ) + +2570 + #lh_FUNCTION_� +( +lh +� + `LHM_lh_� +( +FUNCTION +,lh) + + ) + +2572 + #lh_MEM_�w +(� + `LHM_lh_�w +( +MEM +, +mem +) + + ) + +2573 + #lh_MEM_��� +( +lh +, +�� +� + `LHM_lh_��� +( +MEM +,lh,��) + + ) + +2574 + #lh_MEM_���ve +( +lh +, +�� +� + `LHM_lh_���ve +( +MEM +,lh,��) + + ) + +2575 + #lh_MEM_d��e +( +lh +, +�� +� + `LHM_lh_d��e +( +MEM +,lh,��) + + ) + +2576 + #lh_MEM_d�� +( +lh +, +� +� + `LHM_lh_d�� +( +MEM +,lh,�) + + ) + +2577 + #lh_MEM_d��_�g +( +lh +, +� +, +�g_ty� +, +�g +) \ + +2578 + `LHM_lh_d��_�g +( +MEM +, +lh +, +� +, +�g_ty� +, +�g +) + + ) + +2579 + #lh_MEM_�r� +( +lh +� + `LHM_lh_�r� +( +MEM +,lh) + + ) + +2580 + #lh_MEM_num_�ems +( +lh +� + `LHM_lh_num_�ems +( +MEM +,lh) + + ) + +2581 + #lh_MEM_down_l�d +( +lh +� + `LHM_lh_down_l�d +( +MEM +,lh) + + ) + +2582 + #lh_MEM_node_��s_bio +( +lh +, +out +) \ + +2583 + `LHM_lh_node_��s_bio +( +MEM +, +lh +, +out +) + + ) + +2584 + #lh_MEM_node_u�ge_��s_bio +( +lh +, +out +) \ + +2585 + `LHM_lh_node_u�ge_��s_bio +( +MEM +, +lh +, +out +) + + ) + +2586 + #lh_MEM_��s_bio +( +lh +, +out +) \ + +2587 + `LHM_lh_��s_bio +( +MEM +, +lh +, +out +) + + ) + +2588 + #lh_MEM_� +( +lh +� + `LHM_lh_� +( +MEM +,lh) + + ) + +2590 + #lh_OBJ_NAME_�w +(� + `LHM_lh_�w +( +OBJ_NAME +, +obj_�me +) + + ) + +2591 + #lh_OBJ_NAME_��� +( +lh +, +�� +� + `LHM_lh_��� +( +OBJ_NAME +,lh,��) + + ) + +2592 + #lh_OBJ_NAME_���ve +( +lh +, +�� +� + `LHM_lh_���ve +( +OBJ_NAME +,lh,��) + + ) + +2593 + #lh_OBJ_NAME_d��e +( +lh +, +�� +� + `LHM_lh_d��e +( +OBJ_NAME +,lh,��) + + ) + +2594 + #lh_OBJ_NAME_d�� +( +lh +, +� +� + `LHM_lh_d�� +( +OBJ_NAME +,lh,�) + + ) + +2595 + #lh_OBJ_NAME_d��_�g +( +lh +, +� +, +�g_ty� +, +�g +) \ + +2596 + `LHM_lh_d��_�g +( +OBJ_NAME +, +lh +, +� +, +�g_ty� +, +�g +) + + ) + +2597 + #lh_OBJ_NAME_�r� +( +lh +� + `LHM_lh_�r� +( +OBJ_NAME +,lh) + + ) + +2598 + #lh_OBJ_NAME_num_�ems +( +lh +� + `LHM_lh_num_�ems +( +OBJ_NAME +,lh) + + ) + +2599 + #lh_OBJ_NAME_down_l�d +( +lh +� + `LHM_lh_down_l�d +( +OBJ_NAME +,lh) + + ) + +2600 + #lh_OBJ_NAME_node_��s_bio +( +lh +, +out +) \ + +2601 + `LHM_lh_node_��s_bio +( +OBJ_NAME +, +lh +, +out +) + + ) + +2602 + #lh_OBJ_NAME_node_u�ge_��s_bio +( +lh +, +out +) \ + +2603 + `LHM_lh_node_u�ge_��s_bio +( +OBJ_NAME +, +lh +, +out +) + + ) + +2604 + #lh_OBJ_NAME_��s_bio +( +lh +, +out +) \ + +2605 + `LHM_lh_��s_bio +( +OBJ_NAME +, +lh +, +out +) + + ) + +2606 + #lh_OBJ_NAME_� +( +lh +� + `LHM_lh_� +( +OBJ_NAME +,lh) + + ) + +2608 + #lh_OPENSSL_CSTRING_�w +(� + `LHM_lh_�w +( +OPENSSL_CSTRING +, +ݒs�_c�r�g +) + + ) + +2609 + #lh_OPENSSL_CSTRING_��� +( +lh +, +�� +� + `LHM_lh_��� +( +OPENSSL_CSTRING +,lh,��) + + ) + +2610 + #lh_OPENSSL_CSTRING_���ve +( +lh +, +�� +� + `LHM_lh_���ve +( +OPENSSL_CSTRING +,lh,��) + + ) + +2611 + #lh_OPENSSL_CSTRING_d��e +( +lh +, +�� +� + `LHM_lh_d��e +( +OPENSSL_CSTRING +,lh,��) + + ) + +2612 + #lh_OPENSSL_CSTRING_d�� +( +lh +, +� +� + `LHM_lh_d�� +( +OPENSSL_CSTRING +,lh,�) + + ) + +2613 + #lh_OPENSSL_CSTRING_d��_�g +( +lh +, +� +, +�g_ty� +, +�g +) \ + +2614 + `LHM_lh_d��_�g +( +OPENSSL_CSTRING +, +lh +, +� +, +�g_ty� +, +�g +) + + ) + +2615 + #lh_OPENSSL_CSTRING_�r� +( +lh +� + `LHM_lh_�r� +( +OPENSSL_CSTRING +,lh) + + ) + +2616 + #lh_OPENSSL_CSTRING_num_�ems +( +lh +� + `LHM_lh_num_�ems +( +OPENSSL_CSTRING +,lh) + + ) + +2617 + #lh_OPENSSL_CSTRING_down_l�d +( +lh +� + `LHM_lh_down_l�d +( +OPENSSL_CSTRING +,lh) + + ) + +2618 + #lh_OPENSSL_CSTRING_node_��s_bio +( +lh +, +out +) \ + +2619 + `LHM_lh_node_��s_bio +( +OPENSSL_CSTRING +, +lh +, +out +) + + ) + +2620 + #lh_OPENSSL_CSTRING_node_u�ge_��s_bio +( +lh +, +out +) \ + +2621 + `LHM_lh_node_u�ge_��s_bio +( +OPENSSL_CSTRING +, +lh +, +out +) + + ) + +2622 + #lh_OPENSSL_CSTRING_��s_bio +( +lh +, +out +) \ + +2623 + `LHM_lh_��s_bio +( +OPENSSL_CSTRING +, +lh +, +out +) + + ) + +2624 + #lh_OPENSSL_CSTRING_� +( +lh +� + `LHM_lh_� +( +OPENSSL_CSTRING +,lh) + + ) + +2626 + #lh_OPENSSL_STRING_�w +(� + `LHM_lh_�w +( +OPENSSL_STRING +, +ݒs�_�r�g +) + + ) + +2627 + #lh_OPENSSL_STRING_��� +( +lh +, +�� +� + `LHM_lh_��� +( +OPENSSL_STRING +,lh,��) + + ) + +2628 + #lh_OPENSSL_STRING_���ve +( +lh +, +�� +� + `LHM_lh_���ve +( +OPENSSL_STRING +,lh,��) + + ) + +2629 + #lh_OPENSSL_STRING_d��e +( +lh +, +�� +� + `LHM_lh_d��e +( +OPENSSL_STRING +,lh,��) + + ) + +2630 + #lh_OPENSSL_STRING_d�� +( +lh +, +� +� + `LHM_lh_d�� +( +OPENSSL_STRING +,lh,�) + + ) + +2631 + #lh_OPENSSL_STRING_d��_�g +( +lh +, +� +, +�g_ty� +, +�g +) \ + +2632 + `LHM_lh_d��_�g +( +OPENSSL_STRING +, +lh +, +� +, +�g_ty� +, +�g +) + + ) + +2633 + #lh_OPENSSL_STRING_�r� +( +lh +� + `LHM_lh_�r� +( +OPENSSL_STRING +,lh) + + ) + +2634 + #lh_OPENSSL_STRING_num_�ems +( +lh +� + `LHM_lh_num_�ems +( +OPENSSL_STRING +,lh) + + ) + +2635 + #lh_OPENSSL_STRING_down_l�d +( +lh +� + `LHM_lh_down_l�d +( +OPENSSL_STRING +,lh) + + ) + +2636 + #lh_OPENSSL_STRING_node_��s_bio +( +lh +, +out +) \ + +2637 + `LHM_lh_node_��s_bio +( +OPENSSL_STRING +, +lh +, +out +) + + ) + +2638 + #lh_OPENSSL_STRING_node_u�ge_��s_bio +( +lh +, +out +) \ + +2639 + `LHM_lh_node_u�ge_��s_bio +( +OPENSSL_STRING +, +lh +, +out +) + + ) + +2640 + #lh_OPENSSL_STRING_��s_bio +( +lh +, +out +) \ + +2641 + `LHM_lh_��s_bio +( +OPENSSL_STRING +, +lh +, +out +) + + ) + +2642 + #lh_OPENSSL_STRING_� +( +lh +� + `LHM_lh_� +( +OPENSSL_STRING +,lh) + + ) + +2644 + #lh_SSL_SESSION_�w +(� + `LHM_lh_�w +( +SSL_SESSION +, +s�_�ssi� +) + + ) + +2645 + #lh_SSL_SESSION_��� +( +lh +, +�� +� + `LHM_lh_��� +( +SSL_SESSION +,lh,��) + + ) + +2646 + #lh_SSL_SESSION_���ve +( +lh +, +�� +� + `LHM_lh_���ve +( +SSL_SESSION +,lh,��) + + ) + +2647 + #lh_SSL_SESSION_d��e +( +lh +, +�� +� + `LHM_lh_d��e +( +SSL_SESSION +,lh,��) + + ) + +2648 + #lh_SSL_SESSION_d�� +( +lh +, +� +� + `LHM_lh_d�� +( +SSL_SESSION +,lh,�) + + ) + +2649 + #lh_SSL_SESSION_d��_�g +( +lh +, +� +, +�g_ty� +, +�g +) \ + +2650 + `LHM_lh_d��_�g +( +SSL_SESSION +, +lh +, +� +, +�g_ty� +, +�g +) + + ) + +2651 + #lh_SSL_SESSION_�r� +( +lh +� + `LHM_lh_�r� +( +SSL_SESSION +,lh) + + ) + +2652 + #lh_SSL_SESSION_num_�ems +( +lh +� + `LHM_lh_num_�ems +( +SSL_SESSION +,lh) + + ) + +2653 + #lh_SSL_SESSION_down_l�d +( +lh +� + `LHM_lh_down_l�d +( +SSL_SESSION +,lh) + + ) + +2654 + #lh_SSL_SESSION_node_��s_bio +( +lh +, +out +) \ + +2655 + `LHM_lh_node_��s_bio +( +SSL_SESSION +, +lh +, +out +) + + ) + +2656 + #lh_SSL_SESSION_node_u�ge_��s_bio +( +lh +, +out +) \ + +2657 + `LHM_lh_node_u�ge_��s_bio +( +SSL_SESSION +, +lh +, +out +) + + ) + +2658 + #lh_SSL_SESSION_��s_bio +( +lh +, +out +) \ + +2659 + `LHM_lh_��s_bio +( +SSL_SESSION +, +lh +, +out +) + + ) + +2660 + #lh_SSL_SESSION_� +( +lh +� + `LHM_lh_� +( +SSL_SESSION +,lh) + + ) + + @/usr/include/openssl/ssl.h + +143 #i�de� +HEADER_SSL_H + + +144 + #HEADER_SSL_H + + + ) + +146 + ~<ݒs�/e_os2.h +> + +148 #i�de� +OPENSSL_NO_COMP + + +149 + ~<ݒs�/comp.h +> + +151 #i�de� +OPENSSL_NO_BIO + + +152 + ~<ݒs�/bio.h +> + +154 #i�de� +OPENSSL_NO_DEPRECATED + + +155 #i�de� +OPENSSL_NO_X509 + + +156 + ~<ݒs�/x509.h +> + +158 + ~<ݒs�/�y�o.h +> + +159 + ~<ݒs�/lhash.h +> + +160 + ~<ݒs�/buf�r.h +> + +162 + ~<ݒs�/�m.h +> + +163 + ~<ݒs�/hmac.h +> + +165 + ~<ݒs�/ks�.h +> + +166 + ~<ݒs�/��ack.h +> + +167 + ~<ݒs�/symhacks.h +> + +169 #ifde� +__�lu�lus + + +177 + #SSL_SESSION_ASN1_VERSION + 0x0001 + + ) + +180 + #SSL_TXT_NULL_WITH_MD5 + +SSL2_TXT_NULL_WITH_MD5 + + + ) + +181 + #SSL_TXT_RC4_128_WITH_MD5 + +SSL2_TXT_RC4_128_WITH_MD5 + + + ) + +182 + #SSL_TXT_RC4_128_EXPORT40_WITH_MD5 + +SSL2_TXT_RC4_128_EXPORT40_WITH_MD5 + + + ) + +183 + #SSL_TXT_RC2_128_CBC_WITH_MD5 + +SSL2_TXT_RC2_128_CBC_WITH_MD5 + + + ) + +184 + #SSL_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 + +SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 + + + ) + +185 + #SSL_TXT_IDEA_128_CBC_WITH_MD5 + +SSL2_TXT_IDEA_128_CBC_WITH_MD5 + + + ) + +186 + #SSL_TXT_DES_64_CBC_WITH_MD5 + +SSL2_TXT_DES_64_CBC_WITH_MD5 + + + ) + +187 + #SSL_TXT_DES_64_CBC_WITH_SHA + +SSL2_TXT_DES_64_CBC_WITH_SHA + + + ) + +188 + #SSL_TXT_DES_192_EDE3_CBC_WITH_MD5 + +SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5 + + + ) + +189 + #SSL_TXT_DES_192_EDE3_CBC_WITH_SHA + +SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA + + + ) + +193 + #SSL_TXT_KRB5_DES_64_CBC_SHA + +SSL3_TXT_KRB5_DES_64_CBC_SHA + + + ) + +194 + #SSL_TXT_KRB5_DES_192_CBC3_SHA + +SSL3_TXT_KRB5_DES_192_CBC3_SHA + + + ) + +195 + #SSL_TXT_KRB5_RC4_128_SHA + +SSL3_TXT_KRB5_RC4_128_SHA + + + ) + +196 + #SSL_TXT_KRB5_IDEA_128_CBC_SHA + +SSL3_TXT_KRB5_IDEA_128_CBC_SHA + + + ) + +197 + #SSL_TXT_KRB5_DES_64_CBC_MD5 + +SSL3_TXT_KRB5_DES_64_CBC_MD5 + + + ) + +198 + #SSL_TXT_KRB5_DES_192_CBC3_MD5 + +SSL3_TXT_KRB5_DES_192_CBC3_MD5 + + + ) + +199 + #SSL_TXT_KRB5_RC4_128_MD5 + +SSL3_TXT_KRB5_RC4_128_MD5 + + + ) + +200 + #SSL_TXT_KRB5_IDEA_128_CBC_MD5 + +SSL3_TXT_KRB5_IDEA_128_CBC_MD5 + + + ) + +202 + #SSL_TXT_KRB5_DES_40_CBC_SHA + +SSL3_TXT_KRB5_DES_40_CBC_SHA + + + ) + +203 + #SSL_TXT_KRB5_RC2_40_CBC_SHA + +SSL3_TXT_KRB5_RC2_40_CBC_SHA + + + ) + +204 + #SSL_TXT_KRB5_RC4_40_SHA + +SSL3_TXT_KRB5_RC4_40_SHA + + + ) + +205 + #SSL_TXT_KRB5_DES_40_CBC_MD5 + +SSL3_TXT_KRB5_DES_40_CBC_MD5 + + + ) + +206 + #SSL_TXT_KRB5_RC2_40_CBC_MD5 + +SSL3_TXT_KRB5_RC2_40_CBC_MD5 + + + ) + +207 + #SSL_TXT_KRB5_RC4_40_MD5 + +SSL3_TXT_KRB5_RC4_40_MD5 + + + ) + +209 + #SSL_TXT_KRB5_DES_40_CBC_SHA + +SSL3_TXT_KRB5_DES_40_CBC_SHA + + + ) + +210 + #SSL_TXT_KRB5_DES_40_CBC_MD5 + +SSL3_TXT_KRB5_DES_40_CBC_MD5 + + + ) + +211 + #SSL_TXT_KRB5_DES_64_CBC_SHA + +SSL3_TXT_KRB5_DES_64_CBC_SHA + + + ) + +212 + #SSL_TXT_KRB5_DES_64_CBC_MD5 + +SSL3_TXT_KRB5_DES_64_CBC_MD5 + + + ) + +213 + #SSL_TXT_KRB5_DES_192_CBC3_SHA + +SSL3_TXT_KRB5_DES_192_CBC3_SHA + + + ) + +214 + #SSL_TXT_KRB5_DES_192_CBC3_MD5 + +SSL3_TXT_KRB5_DES_192_CBC3_MD5 + + + ) + +215 + #SSL_MAX_KRB5_PRINCIPAL_LENGTH + 256 + + ) + +217 + #SSL_MAX_SSL_SESSION_ID_LENGTH + 32 + + ) + +218 + #SSL_MAX_SID_CTX_LENGTH + 32 + + ) + +220 + #SSL_MIN_RSA_MODULUS_LENGTH_IN_BYTES + (512/8) + + ) + +221 + #SSL_MAX_KEY_ARG_LENGTH + 8 + + ) + +222 + #SSL_MAX_MASTER_KEY_LENGTH + 48 + + ) + +227 + #SSL_TXT_EXP40 + "EXPORT40" + + ) + +228 + #SSL_TXT_EXP56 + "EXPORT56" + + ) + +229 + #SSL_TXT_LOW + "LOW" + + ) + +230 + #SSL_TXT_MEDIUM + "MEDIUM" + + ) + +231 + #SSL_TXT_HIGH + "HIGH" + + ) + +232 + #SSL_TXT_FIPS + "FIPS" + + ) + +234 + #SSL_TXT_kFZA + "kFZA" + + ) + +235 + #SSL_TXT_aFZA + "aFZA" + + ) + +236 + #SSL_TXT_eFZA + "eFZA" + + ) + +237 + #SSL_TXT_FZA + "FZA" + + ) + +239 + #SSL_TXT_aNULL + "aNULL" + + ) + +240 + #SSL_TXT_eNULL + "eNULL" + + ) + +241 + #SSL_TXT_NULL + "NULL" + + ) + +243 + #SSL_TXT_kRSA + "kRSA" + + ) + +244 + #SSL_TXT_kDHr + "kDHr" + + ) + +245 + #SSL_TXT_kDHd + "kDHd" + + ) + +246 + #SSL_TXT_kDH + "kDH" + + ) + +247 + #SSL_TXT_kEDH + "kEDH" + + ) + +248 + #SSL_TXT_kKRB5 + "kKRB5" + + ) + +249 + #SSL_TXT_kECDHr + "kECDHr" + + ) + +250 + #SSL_TXT_kECDHe + "kECDHe" + + ) + +251 + #SSL_TXT_kECDH + "kECDH" + + ) + +252 + #SSL_TXT_kEECDH + "kEECDH" + + ) + +253 + #SSL_TXT_kPSK + "kPSK" + + ) + +254 + #SSL_TXT_kGOST + "kGOST" + + ) + +255 + #SSL_TXT_kSRP + "kSRP" + + ) + +257 + #SSL_TXT_aRSA + "aRSA" + + ) + +258 + #SSL_TXT_aDSS + "aDSS" + + ) + +259 + #SSL_TXT_aDH + "aDH" + + ) + +260 + #SSL_TXT_aECDH + "aECDH" + + ) + +261 + #SSL_TXT_aKRB5 + "aKRB5" + + ) + +262 + #SSL_TXT_aECDSA + "aECDSA" + + ) + +263 + #SSL_TXT_aPSK + "aPSK" + + ) + +264 + #SSL_TXT_aGOST94 + "aGOST94" + + ) + +265 + #SSL_TXT_aGOST01 + "aGOST01" + + ) + +266 + #SSL_TXT_aGOST + "aGOST" + + ) + +267 + #SSL_TXT_aSRP + "aSRP" + + ) + +269 + #SSL_TXT_DSS + "DSS" + + ) + +270 + #SSL_TXT_DH + "DH" + + ) + +271 + #SSL_TXT_EDH + "EDH" + + ) + +272 + #SSL_TXT_ADH + "ADH" + + ) + +273 + #SSL_TXT_RSA + "RSA" + + ) + +274 + #SSL_TXT_ECDH + "ECDH" + + ) + +275 + #SSL_TXT_EECDH + "EECDH" + + ) + +276 + #SSL_TXT_AECDH + "AECDH" + + ) + +277 + #SSL_TXT_ECDSA + "ECDSA" + + ) + +278 + #SSL_TXT_KRB5 + "KRB5" + + ) + +279 + #SSL_TXT_PSK + "PSK" + + ) + +280 + #SSL_TXT_SRP + "SRP" + + ) + +282 + #SSL_TXT_DES + "DES" + + ) + +283 + #SSL_TXT_3DES + "3DES" + + ) + +284 + #SSL_TXT_RC4 + "RC4" + + ) + +285 + #SSL_TXT_RC2 + "RC2" + + ) + +286 + #SSL_TXT_IDEA + "IDEA" + + ) + +287 + #SSL_TXT_SEED + "SEED" + + ) + +288 + #SSL_TXT_AES128 + "AES128" + + ) + +289 + #SSL_TXT_AES256 + "AES256" + + ) + +290 + #SSL_TXT_AES + "AES" + + ) + +291 + #SSL_TXT_AES_GCM + "AESGCM" + + ) + +292 + #SSL_TXT_CAMELLIA128 + "CAMELLIA128" + + ) + +293 + #SSL_TXT_CAMELLIA256 + "CAMELLIA256" + + ) + +294 + #SSL_TXT_CAMELLIA + "CAMELLIA" + + ) + +296 + #SSL_TXT_MD5 + "MD5" + + ) + +297 + #SSL_TXT_SHA1 + "SHA1" + + ) + +298 + #SSL_TXT_SHA + "SHA" + + ) + +299 + #SSL_TXT_GOST94 + "GOST94" + + ) + +300 + #SSL_TXT_GOST89MAC + "GOST89MAC" + + ) + +301 + #SSL_TXT_SHA256 + "SHA256" + + ) + +302 + #SSL_TXT_SHA384 + "SHA384" + + ) + +304 + #SSL_TXT_SSLV2 + "SSLv2" + + ) + +305 + #SSL_TXT_SSLV3 + "SSLv3" + + ) + +306 + #SSL_TXT_TLSV1 + "TLSv1" + + ) + +307 + #SSL_TXT_TLSV1_1 + "TLSv1.1" + + ) + +308 + #SSL_TXT_TLSV1_2 + "TLSv1.2" + + ) + +310 + #SSL_TXT_EXP + "EXP" + + ) + +311 + #SSL_TXT_EXPORT + "EXPORT" + + ) + +313 + #SSL_TXT_ALL + "ALL" + + ) + +329 + #SSL_TXT_CMPALL + "COMPLEMENTOFALL" + + ) + +330 + #SSL_TXT_CMPDEF + "COMPLEMENTOFDEFAULT" + + ) + +335 + #SSL_DEFAULT_CIPHER_LIST + "ALL:!EXPORT:!aNULL:!eNULL:!SSLv2" + + ) + +344 + #SSL_SENT_SHUTDOWN + 1 + + ) + +345 + #SSL_RECEIVED_SHUTDOWN + 2 + + ) + +347 #ifde� +__�lu�lus + + +351 #ifde� +__�lu�lus + + +355 #i�( +def�ed +( +OPENSSL_NO_RSA +�|| def�ed( +OPENSSL_NO_MD5 +)�&& !def�ed( +OPENSSL_NO_SSL2 +) + +356 + #OPENSSL_NO_SSL2 + + + ) + +359 + #SSL_FILETYPE_ASN1 + +X509_FILETYPE_ASN1 + + + ) + +360 + #SSL_FILETYPE_PEM + +X509_FILETYPE_PEM + + + ) + +365 +s�_� + * + ts�_�ock_� +; + +366 +�s_�ssi�_tick�_ext_� + + tTLS_SESSION_TICKET_EXT +; + +367 +s�_m�hod_� + + tSSL_METHOD +; + +368 +s�_c�h�_� + + tSSL_CIPHER +; + +369 +s�_�ssi�_� + + tSSL_SESSION +; + +371 +DECLARE_STACK_OF +( +SSL_CIPHER +) + +374 + s��_��e�i�_�of�e_� + + +376 cڡ * +�me +; + +377 +id +; + +378 } + tSRTP_PROTECTION_PROFILE +; + +380 +DECLARE_STACK_OF +( +SRTP_PROTECTION_PROFILE +) + +382 (* +�s_�ssi�_tick�_ext_cb_� +)( + tSSL + * + ts +, cڡ * + td�a +, + t�n +, * + t�g +); + +383 (* +�s_�ssi�_���_cb_� +)( + tSSL + * + ts +, * + t��� +, * + t���_�n +, + tSTACK_OF +( + tSSL_CIPHER +�* + t��_c�h�s +, SSL_CIPHER ** + tc�h� +, * + t�g +); + +386 #i�de� +OPENSSL_NO_SSL_INTERN + + +389 + ss�_c�h�_� + + +391 +v�id +; + +392 cڡ * +�me +; + +393 +id +; + +396 +�gܙhm_mkey +; + +397 +�gܙhm_auth +; + +398 +�gܙhm_�c +; + +399 +�gܙhm_mac +; + +400 +�gܙhm_s� +; + +402 +�go_��ngth +; + +403 +�gܙhm2 +; + +404 +��ngth_b�s +; + +405 +�g_b�s +; + +410 + ss�_m�hod_� + + +412 +v�si� +; + +413 (* +s�_�w +)( +SSL + * +s +); + +414 (* +s�_��r +)( +SSL + * +s +); + +415 (* +s�_� +)( +SSL + * +s +); + +416 (* +s�_ac�� +)( +SSL + * +s +); + +417 (* +s�_c��� +)( +SSL + * +s +); + +418 (* +s�_�ad +)( +SSL + * +s +,* +buf +, +�n +); + +419 (* +s�_�ek +)( +SSL + * +s +,* +buf +, +�n +); + +420 (* +s�_wr�e +)( +SSL + * +s +,cڡ * +buf +, +�n +); + +421 (* +s�_shutdown +)( +SSL + * +s +); + +422 (* +s�_��gٟ� +)( +SSL + * +s +); + +423 (* +s�_��gٟ�_check +)( +SSL + * +s +); + +424 (* +s�_g�_mes�ge +)( +SSL + * +s +, +�1 +, +�n +, +mt +, + +425 +max +, * +ok +); + +426 (* +s�_�ad_by�s +)( +SSL + * +s +, +ty� +, * +buf +, +�n +, + +427 +�ek +); + +428 (* +s�_wr�e_by�s +)( +SSL + * +s +, +ty� +, cڡ * +buf_ +, +�n +); + +429 (* +s�_di��ch_��t +)( +SSL + * +s +); + +430 (* +s�_�� +)( +SSL + * +s +, +cmd +, +�rg +,* +�rg +); + +431 (* +s�_�x_�� +)( +SSL_CTX + * +�x +, +cmd +, +�rg +,* +�rg +); + +432 cڡ +SSL_CIPHER + *(* +g�_c�h�_by_ch� +)(cڡ * +�r +); + +433 (* +put_c�h�_by_ch� +)(cڡ +SSL_CIPHER + * +c�h� +,* +�r +); + +434 (* +s�_�nd�g +)(cڡ +SSL + * +s +); + +435 (* +num_c�h�s +)(); + +436 cڡ +SSL_CIPHER + *(* +g�_c�h� +)( +nc�h� +); + +437 cڡ +s�_m�hod_� + *(* +g�_s�_m�hod +)( +v�si� +); + +438 (* +g�_timeout +)(); + +439 +s�3_�c_m�hod + * +s�3_�c +; + +440 (* +s�_v�si� +)(); + +441 (* +s�_��back_�� +)( +SSL + * +s +, +cb_id +, (* +� +)()); + +442 (* +s�_�x_��back_�� +)( +SSL_CTX + * +s +, +cb_id +, (* +� +)()); + +470 + ss�_�ssi�_� + + +472 +s�_v�si� +; + +476 +key_�g_�ngth +; + +477 +key_�g +[ +SSL_MAX_KEY_ARG_LENGTH +]; + +478 +ma��_key_�ngth +; + +479 +ma��_key +[ +SSL_MAX_MASTER_KEY_LENGTH +]; + +481 +�ssi�_id_�ngth +; + +482 +�ssi�_id +[ +SSL_MAX_SSL_SESSION_ID_LENGTH +]; + +486 +sid_�x_�ngth +; + +487 +sid_�x +[ +SSL_MAX_SID_CTX_LENGTH +]; + +489 #i�de� +OPENSSL_NO_KRB5 + + +490 +krb5_���_��c_�n +; + +491 +krb5_���_��c +[ +SSL_MAX_KRB5_PRINCIPAL_LENGTH +]; + +493 #i�de� +OPENSSL_NO_PSK + + +494 * +psk_id�t�y_h�t +; + +495 * +psk_id�t�y +; + +500 +n�_�sumab� +; + +503 +�ss_��_� + * +�ss_�� +; + +509 +X509 + * +�� +; + +512 +v�ify_�su� +; + +514 +��n�s +; + +515 +timeout +; + +516 +time +; + +518 +com�ess_m�h +; + +520 cڡ +SSL_CIPHER + * +c�h� +; + +521 +c�h�_id +; + +525 +STACK_OF +( +SSL_CIPHER +�* +c�h�s +; + +527 +CRYPTO_EX_DATA + +ex_d�a +; + +531 +s�_�ssi�_� + * +�ev +,* +�xt +; + +532 #i�de� +OPENSSL_NO_TLSEXT + + +533 * +��xt_ho��me +; + +534 #i�de� +OPENSSL_NO_EC + + +535 +size_t + +��xt_e�o�tf�m�li�_�ngth +; + +536 * +��xt_e�o�tf�m�li� +; + +537 +size_t + +��xt_�l�ticcurv�i�_�ngth +; + +538 * +��xt_�l�ticcurv�i� +; + +541 * +��xt_tick +; + +542 +size_t + +��xt_tick�n +; + +543 +��xt_tick_li�time_h�t +; + +545 #i�de� +OPENSSL_NO_SRP + + +546 * +�p_u��ame +; + +552 + #SSL_OP_MICROSOFT_SESS_ID_BUG + 0x00000001L + + ) + +553 + #SSL_OP_NETSCAPE_CHALLENGE_BUG + 0x00000002L + + ) + +555 + #SSL_OP_LEGACY_SERVER_CONNECT + 0x00000004L + + ) + +556 + #SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG + 0x00000008L + + ) + +557 + #SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG + 0x00000010L + + ) + +558 + #SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER + 0x00000020L + + ) + +559 + #SSL_OP_SAFARI_ECDHE_ECDSA_BUG + 0x00000040L + + ) + +560 + #SSL_OP_SSLEAY_080_CLIENT_DH_BUG + 0x00000080L + + ) + +561 + #SSL_OP_TLS_D5_BUG + 0x00000100L + + ) + +562 + #SSL_OP_TLS_BLOCK_PADDING_BUG + 0x00000200L + + ) + +565 + #SSL_OP_MSIE_SSLV2_RSA_PADDING + 0x0 + + ) + +572 + #SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS + 0x00000800L + + ) + +576 + #SSL_OP_ALL + 0x80000BFFL + + ) + +579 + #SSL_OP_NO_QUERY_MTU + 0x00001000L + + ) + +581 + #SSL_OP_COOKIE_EXCHANGE + 0x00002000L + + ) + +583 + #SSL_OP_NO_TICKET + 0x00004000L + + ) + +585 + #SSL_OP_CISCO_ANYCONNECT + 0x00008000L + + ) + +588 + #SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION + 0x00010000L + + ) + +590 + #SSL_OP_NO_COMPRESSION + 0x00020000L + + ) + +592 + #SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION + 0x00040000L + + ) + +594 + #SSL_OP_SINGLE_ECDH_USE + 0x00080000L + + ) + +596 + #SSL_OP_SINGLE_DH_USE + 0x00100000L + + ) + +598 + #SSL_OP_EPHEMERAL_RSA + 0x0 + + ) + +601 + #SSL_OP_CIPHER_SERVER_PREFERENCE + 0x00400000L + + ) + +606 + #SSL_OP_TLS_ROLLBACK_BUG + 0x00800000L + + ) + +608 + #SSL_OP_NO_SSLv2 + 0x01000000L + + ) + +609 + #SSL_OP_NO_SSLv3 + 0x02000000L + + ) + +610 + #SSL_OP_NO_TLSv1 + 0x04000000L + + ) + +611 + #SSL_OP_NO_TLSv1_2 + 0x08000000L + + ) + +612 + #SSL_OP_NO_TLSv1_1 + 0x10000000L + + ) + +619 + #SSL_OP_PKCS1_CHECK_1 + 0x0 + + ) + +620 + #SSL_OP_PKCS1_CHECK_2 + 0x0 + + ) + +622 + #SSL_OP_NETSCAPE_CA_DN_BUG + 0x20000000L + + ) + +623 + #SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG + 0x40000000L + + ) + +628 + #SSL_OP_CRYPTOPRO_TLSEXT_BUG + 0x80000000L + + ) + +632 + #SSL_MODE_ENABLE_PARTIAL_WRITE + 0x00000001L + + ) + +637 + #SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER + 0x00000002L + + ) + +640 + #SSL_MODE_AUTO_RETRY + 0x00000004L + + ) + +642 + #SSL_MODE_NO_AUTO_CHAIN + 0x00000008L + + ) + +646 + #SSL_MODE_RELEASE_BUFFERS + 0x00000010L + + ) + +651 + #SSL_MODE_SEND_CLIENTHELLO_TIME + 0x00000020L + + ) + +652 + #SSL_MODE_SEND_SERVERHELLO_TIME + 0x00000040L + + ) + +656 + #SSL_MODE_SEND_FALLBACK_SCSV + 0x00000080L + + ) + +661 + #SSL_CTX_�t_�ti�s +( +�x +, +� +) \ + +662 + `SSL_CTX_�� +(( +�x +), +SSL_CTRL_OPTIONS +,( +� +), +NULL +) + + ) + +663 + #SSL_CTX_��r_�ti�s +( +�x +, +� +) \ + +664 + `SSL_CTX_�� +(( +�x +), +SSL_CTRL_CLEAR_OPTIONS +,( +� +), +NULL +) + + ) + +665 + #SSL_CTX_g�_�ti�s +( +�x +) \ + +666 + `SSL_CTX_�� +(( +�x +), +SSL_CTRL_OPTIONS +,0, +NULL +) + + ) + +667 + #SSL_�t_�ti�s +( +s� +, +� +) \ + +668 + `SSL_�� +(( +s� +), +SSL_CTRL_OPTIONS +,( +� +), +NULL +) + + ) + +669 + #SSL_��r_�ti�s +( +s� +, +� +) \ + +670 + `SSL_�� +(( +s� +), +SSL_CTRL_CLEAR_OPTIONS +,( +� +), +NULL +) + + ) + +671 + #SSL_g�_�ti�s +( +s� +) \ + +672 + `SSL_�� +(( +s� +), +SSL_CTRL_OPTIONS +,0, +NULL +) + + ) + +674 + #SSL_CTX_�t_mode +( +�x +, +� +) \ + +675 + `SSL_CTX_�� +(( +�x +), +SSL_CTRL_MODE +,( +� +), +NULL +) + + ) + +676 + #SSL_CTX_��r_mode +( +�x +, +� +) \ + +677 + `SSL_CTX_�� +(( +�x +), +SSL_CTRL_CLEAR_MODE +,( +� +), +NULL +) + + ) + +678 + #SSL_CTX_g�_mode +( +�x +) \ + +679 + `SSL_CTX_�� +(( +�x +), +SSL_CTRL_MODE +,0, +NULL +) + + ) + +680 + #SSL_��r_mode +( +s� +, +� +) \ + +681 + `SSL_�� +(( +s� +), +SSL_CTRL_CLEAR_MODE +,( +� +), +NULL +) + + ) + +682 + #SSL_�t_mode +( +s� +, +� +) \ + +683 + `SSL_�� +(( +s� +), +SSL_CTRL_MODE +,( +� +), +NULL +) + + ) + +684 + #SSL_g�_mode +( +s� +) \ + +685 + `SSL_�� +(( +s� +), +SSL_CTRL_MODE +,0, +NULL +) + + ) + +686 + #SSL_�t_mtu +( +s� +, +mtu +) \ + +687 + `SSL_�� +(( +s� +), +SSL_CTRL_SET_MTU +,( +mtu +), +NULL +) + + ) + +689 + #SSL_g�_�cu�_��gٟti�_su��t +( +s� +) \ + +690 + `SSL_�� +(( +s� +), +SSL_CTRL_GET_RI_SUPPORT +, 0, +NULL +) + + ) + +692 #i�de� +OPENSSL_NO_HEARTBEATS + + +693 + #SSL_h��b�t +( +s� +) \ + +694 + `SSL_�� +(( +s� +), +SSL_CTRL_TLS_EXT_SEND_HEARTBEAT +,0, +NULL +) + + ) + +697 +SSL_CTX_�t_msg_��back +( +SSL_CTX + * +�x +, (* +cb +)( +wr�e_p +, +v�si� +, +cڋ�_ty� +, cڡ * +buf +, +size_t + +�n +, +SSL + * +s� +, * +�g +)); + +698 +SSL_�t_msg_��back +( +SSL + * +s� +, (* +cb +)( +wr�e_p +, +v�si� +, +cڋ�_ty� +, cڡ * +buf +, +size_t + +�n +, SSL *s�, * +�g +)); + +699 + #SSL_CTX_�t_msg_��back_�g +( +�x +, +�g +� + `SSL_CTX_�� +((�x), +SSL_CTRL_SET_MSG_CALLBACK_ARG +, 0, (�g)) + + ) + +700 + #SSL_�t_msg_��back_�g +( +s� +, +�g +� + `SSL_�� +((s�), +SSL_CTRL_SET_MSG_CALLBACK_ARG +, 0, (�g)) + + ) + +702 #i�de� +OPENSSL_NO_SRP + + +704 #i�de� +OPENSSL_NO_SSL_INTERN + + +706 + s�p_�x_� + + +709 * +SRP_cb_�g +; + +711 (* +TLS_ext_�p_u��ame_��back +)( +SSL + *, *, *); + +713 (* +SRP_v�ify_��m_��back +)( +SSL + *, *); + +715 *(* +SRP_give_�p_���_pwd_��back +)( +SSL + *, *); + +717 * +log� +; + +718 +BIGNUM + * +N +,* +g +,* +s +,* +B +,* +A +; + +719 +BIGNUM + * +a +,* +b +,* +v +; + +720 * +�fo +; + +721 +��ngth +; + +723 +�p_Mask +; + +724 } + tSRP_CTX +; + +729 +SSL_SRP_CTX_�� +( +SSL + * +s +); + +730 +SSL_CTX_SRP_CTX_�� +( +SSL_CTX + * +�x +); + +731 +SSL_SRP_CTX_� +( +SSL + * +�x +); + +732 +SSL_CTX_SRP_CTX_� +( +SSL_CTX + * +�x +); + +733 +SSL_�p_�rv�_��m_w�h_u��ame +( +SSL + * +s +, * +ad +); + +734 +SRP_g���e_�rv�_ma��_��� +( +SSL + * +s +,* +ma��_key +); + +735 +SRP_C�c_A_��m +( +SSL + * +s +); + +736 +SRP_g���e_���_ma��_��� +( +SSL + * +s +,* +ma��_key +); + +740 #i� +def�ed +( +OPENSSL_SYS_MSDOS +�&& !def�ed( +OPENSSL_SYS_WIN32 +) + +741 + #SSL_MAX_CERT_LIST_DEFAULT + 1024*30 + + ) + +743 + #SSL_MAX_CERT_LIST_DEFAULT + 1024*100 + + ) + +746 + #SSL_SESSION_CACHE_MAX_SIZE_DEFAULT + (1024*20) + + ) + +761 (* +GEN_SESSION_CB +)(cڡ + tSSL + * + ts� +, * + tid +, + +762 * + tid_�n +); + +764 +s�_comp_� + + tSSL_COMP +; + +766 #i�de� +OPENSSL_NO_SSL_INTERN + + +768 + ss�_comp_� + + +770 +id +; + +771 cڡ * +�me +; + +772 #i�de� +OPENSSL_NO_COMP + + +773 +COMP_METHOD + * +m�hod +; + +775 * +m�hod +; + +779 +DECLARE_STACK_OF +( +SSL_COMP +) + +780 +DECLARE_LHASH_OF +( +SSL_SESSION +); + +782 + ss�_�x_� + + +784 cڡ +SSL_METHOD + * +m�hod +; + +786 +STACK_OF +( +SSL_CIPHER +�* +c�h�_li� +; + +788 +STACK_OF +( +SSL_CIPHER +�* +c�h�_li�_by_id +; + +790 +x509_��e_� + * +��_��e +; + +791 +LHASH_OF +( +SSL_SESSION +�* +�ssi�s +; + +794 +�ssi�_�che_size +; + +795 +s�_�ssi�_� + * +�ssi�_�che_h�d +; + +796 +s�_�ssi�_� + * +�ssi�_�che_�� +; + +803 +�ssi�_�che_mode +; + +808 +�ssi�_timeout +; + +818 (* +�w_�ssi�_cb +)( +s�_� + * +s� +, +SSL_SESSION + * +�ss +); + +819 (* +�move_�ssi�_cb +)( +s�_�x_� + * +�x +, +SSL_SESSION + * +�ss +); + +820 +SSL_SESSION + *(* +g�_�ssi�_cb +)( +s�_� + * +s� +, + +821 * +d�a +, +�n +,* +c�y +); + +825 +�ss_c��� +; + +826 +�ss_c���_��gٟ� +; + +827 +�ss_c���_good +; + +828 +�ss_ac�� +; + +829 +�ss_ac��_��gٟ� +; + +830 +�ss_ac��_good +; + +831 +�ss_miss +; + +832 +�ss_timeout +; + +833 +�ss_�che_fu� +; + +834 +�ss_h� +; + +835 +�ss_cb_h� +; + +841 } +��s +; + +843 +��n�s +; + +846 (* +�p_v�ify_��back +)( +X509_STORE_CTX + *, *); + +847 * +�p_v�ify_�g +; + +852 +�m_�ssw�d_cb + * +de�u�_�sswd_��back +; + +855 * +de�u�_�sswd_��back_u�rd�a +; + +858 (* +���_��_cb +)( +SSL + * +s� +, +X509 + ** +x509 +, +EVP_PKEY + ** +pkey +); + +861 (* +�p_g�_cook�_cb +)( +SSL + * +s� +, * +cook� +, + +862 * +cook�_�n +); + +865 (* +�p_v�ify_cook�_cb +)( +SSL + * +s� +, * +cook� +, + +866 +cook�_�n +); + +868 +CRYPTO_EX_DATA + +ex_d�a +; + +870 cڡ +EVP_MD + * +r�_md5 +; + +871 cڡ +EVP_MD + * +md5 +; + +872 cڡ +EVP_MD + * +sha1 +; + +874 +STACK_OF +( +X509 +�* +ex�a_��s +; + +875 +STACK_OF +( +SSL_COMP +�* +comp_m�hods +; + +880 (* +�fo_��back +)(cڡ +SSL + * +s� +, +ty� +, +v� +); + +883 +STACK_OF +( +X509_NAME +�* +���_CA +; + +888 +�ti�s +; + +889 +mode +; + +890 +max_��_li� +; + +892 +��_� + * +�� +; + +893 +�ad_ah�d +; + +896 (* +msg_��back +)( +wr�e_p +, +v�si� +, +cڋ�_ty� +, cڡ * +buf +, +size_t + +�n +, +SSL + * +s� +, * +�g +); + +897 * +msg_��back_�g +; + +899 +v�ify_mode +; + +900 +sid_�x_�ngth +; + +901 +sid_�x +[ +SSL_MAX_SID_CTX_LENGTH +]; + +902 (* +de�u�_v�ify_��back +)( +ok +, +X509_STORE_CTX + * +�x +); + +905 +GEN_SESSION_CB + +g���e_�ssi�_id +; + +907 +X509_VERIFY_PARAM + * +��m +; + +910 +pu�o� +; + +911 +�u� +; + +914 +qu�t_shutdown +; + +920 +max_�nd_�agm�t +; + +922 #i�de� +OPENSSL_ENGINE + + +925 +ENGINE + * +���_��_�g�e +; + +928 #i�de� +OPENSSL_NO_TLSEXT + + +930 (* +��xt_�rv��me_��back +)( +SSL +*, *, *); + +931 * +��xt_�rv��me_�g +; + +933 +��xt_tick_key_�me +[16]; + +934 +��xt_tick_hmac_key +[16]; + +935 +��xt_tick_�s_key +[16]; + +937 (* +��xt_tick�_key_cb +)( +SSL + * +s� +, + +938 * +�me +, * +iv +, + +939 +EVP_CIPHER_CTX + * +e�x +, + +940 +HMAC_CTX + * +h�x +, +�c +); + +944 (* +��xt_��us_cb +)( +SSL + * +s� +, * +�g +); + +945 * +��xt_��us_�g +; + +948 (* +��xt_�aque_�f_�put_��back +)( +SSL + *, * +���put +, +size_t + +�n +, * +�g +); + +949 * +��xt_�aque_�f_�put_��back_�g +; + +952 #i�de� +OPENSSL_NO_PSK + + +953 * +psk_id�t�y_h�t +; + +954 (* +psk_���_��back +)( +SSL + * +s� +, cڡ * +h�t +, * +id�t�y +, + +955 +max_id�t�y_�n +, * +psk +, + +956 +max_psk_�n +); + +957 (* +psk_�rv�_��back +)( +SSL + * +s� +, cڡ * +id�t�y +, + +958 * +psk +, +max_psk_�n +); + +961 #i�de� +OPENSSL_NO_BUF_FREELISTS + + +962 + #SSL_MAX_BUF_FREELIST_LEN_DEFAULT + 32 + + ) + +963 +�li�_max_�n +; + +964 +s�3_buf_�li�_� + * +wbuf_�li� +; + +965 +s�3_buf_�li�_� + * +rbuf_�li� +; + +967 #i�de� +OPENSSL_NO_SRP + + +968 +SRP_CTX + +�p_�x +; + +971 #i�de� +OPENSSL_NO_TLSEXT + + +973 #i�de� +OPENSSL_NO_NEXTPROTONEG + + +979 (* +�xt_��os_adv�ti�d_cb +)( +SSL + * +s +, cڡ ** +buf +, + +980 * +�n +, * +�g +); + +981 * +�xt_��os_adv�ti�d_cb_�g +; + +984 (* +�xt_��o_���_cb +)( +SSL + * +s +, ** +out +, + +985 * +ou�� +, + +986 cڡ * +� +, + +987 +��n +, + +988 * +�g +); + +989 * +�xt_��o_���_cb_�g +; + +992 +STACK_OF +( +SRTP_PROTECTION_PROFILE +�* +��_�of�es +; + +998 + #SSL_SESS_CACHE_OFF + 0x0000 + + ) + +999 + #SSL_SESS_CACHE_CLIENT + 0x0001 + + ) + +1000 + #SSL_SESS_CACHE_SERVER + 0x0002 + + ) + +1001 + #SSL_SESS_CACHE_BOTH + ( +SSL_SESS_CACHE_CLIENT +| +SSL_SESS_CACHE_SERVER +) + + ) + +1002 + #SSL_SESS_CACHE_NO_AUTO_CLEAR + 0x0080 + + ) + +1004 + #SSL_SESS_CACHE_NO_INTERNAL_LOOKUP + 0x0100 + + ) + +1005 + #SSL_SESS_CACHE_NO_INTERNAL_STORE + 0x0200 + + ) + +1006 + #SSL_SESS_CACHE_NO_INTERNAL + \ + +1007 ( +SSL_SESS_CACHE_NO_INTERNAL_LOOKUP +| +SSL_SESS_CACHE_NO_INTERNAL_STORE +) + + ) + +1009 +LHASH_OF +( +SSL_SESSION +�* +SSL_CTX_�ssi�s +( +SSL_CTX + * +�x +); + +1010 + #SSL_CTX_�ss_numb� +( +�x +) \ + +1011 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SESS_NUMBER +,0, +NULL +) + + ) + +1012 + #SSL_CTX_�ss_c��� +( +�x +) \ + +1013 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SESS_CONNECT +,0, +NULL +) + + ) + +1014 + #SSL_CTX_�ss_c���_good +( +�x +) \ + +1015 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SESS_CONNECT_GOOD +,0, +NULL +) + + ) + +1016 + #SSL_CTX_�ss_c���_��gٟ� +( +�x +) \ + +1017 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SESS_CONNECT_RENEGOTIATE +,0, +NULL +) + + ) + +1018 + #SSL_CTX_�ss_ac�� +( +�x +) \ + +1019 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SESS_ACCEPT +,0, +NULL +) + + ) + +1020 + #SSL_CTX_�ss_ac��_��gٟ� +( +�x +) \ + +1021 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SESS_ACCEPT_RENEGOTIATE +,0, +NULL +) + + ) + +1022 + #SSL_CTX_�ss_ac��_good +( +�x +) \ + +1023 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SESS_ACCEPT_GOOD +,0, +NULL +) + + ) + +1024 + #SSL_CTX_�ss_h�s +( +�x +) \ + +1025 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SESS_HIT +,0, +NULL +) + + ) + +1026 + #SSL_CTX_�ss_cb_h�s +( +�x +) \ + +1027 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SESS_CB_HIT +,0, +NULL +) + + ) + +1028 + #SSL_CTX_�ss_mis�s +( +�x +) \ + +1029 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SESS_MISSES +,0, +NULL +) + + ) + +1030 + #SSL_CTX_�ss_timeouts +( +�x +) \ + +1031 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SESS_TIMEOUTS +,0, +NULL +) + + ) + +1032 + #SSL_CTX_�ss_�che_fu� +( +�x +) \ + +1033 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SESS_CACHE_FULL +,0, +NULL +) + + ) + +1035 +SSL_CTX_�ss_�t_�w_cb +( +SSL_CTX + * +�x +, (* +�w_�ssi�_cb +)( +s�_� + * +s� +, +SSL_SESSION + * +�ss +)); + +1036 (* +SSL_CTX_�ss_g�_�w_cb +( +SSL_CTX + * +�x +))( +s�_� + * +s� +, +SSL_SESSION + * +�ss +); + +1037 +SSL_CTX_�ss_�t_�move_cb +( +SSL_CTX + * +�x +, (* +�move_�ssi�_cb +)( +s�_�x_� + *�x, +SSL_SESSION + * +�ss +)); + +1038 (* +SSL_CTX_�ss_g�_�move_cb +( +SSL_CTX + * +�x +))( +s�_�x_� + *�x, +SSL_SESSION + * +�ss +); + +1039 +SSL_CTX_�ss_�t_g�_cb +( +SSL_CTX + * +�x +, +SSL_SESSION + *(* +g�_�ssi�_cb +)( +s�_� + * +s� +, * +d�a +, +�n +,* +c�y +)); + +1040 +SSL_SESSION + *(* +SSL_CTX_�ss_g�_g�_cb +( +SSL_CTX + * +�x +))( +s�_� + * +s� +, * +D�a +, +�n +, * +c�y +); + +1041 +SSL_CTX_�t_�fo_��back +( +SSL_CTX + * +�x +, (* +cb +)(cڡ +SSL + * +s� +, +ty� +, +v� +)); + +1042 (* +SSL_CTX_g�_�fo_��back +( +SSL_CTX + * +�x +))(cڡ +SSL + * +s� +, +ty� +, +v� +); + +1043 +SSL_CTX_�t_���_��_cb +( +SSL_CTX + * +�x +, (* +���_��_cb +)( +SSL + * +s� +, +X509 + ** +x509 +, +EVP_PKEY + ** +pkey +)); + +1044 (* +SSL_CTX_g�_���_��_cb +( +SSL_CTX + * +�x +))( +SSL + * +s� +, +X509 + ** +x509 +, +EVP_PKEY + ** +pkey +); + +1045 #i�de� +OPENSSL_NO_ENGINE + + +1046 +SSL_CTX_�t_���_��_�g�e +( +SSL_CTX + * +�x +, +ENGINE + * +e +); + +1048 +SSL_CTX_�t_cook�_g���e_cb +( +SSL_CTX + * +�x +, (* +�p_g�_cook�_cb +)( +SSL + * +s� +, * +cook� +, * +cook�_�n +)); + +1049 +SSL_CTX_�t_cook�_v�ify_cb +( +SSL_CTX + * +�x +, (* +�p_v�ify_cook�_cb +)( +SSL + * +s� +, * +cook� +, +cook�_�n +)); + +1050 #i�de� +OPENSSL_NO_NEXTPROTONEG + + +1051 +SSL_CTX_�t_�xt_��os_adv�ti�d_cb +( +SSL_CTX + * +s +, + +1052 (* +cb +�( +SSL + * +s� +, + +1053 cڡ ** +out +, + +1054 * +ou�� +, + +1055 * +�g +), + +1056 * +�g +); + +1057 +SSL_CTX_�t_�xt_��o_���_cb +( +SSL_CTX + * +s +, + +1058 (* +cb +�( +SSL + * +s� +, + +1059 ** +out +, + +1060 * +ou�� +, + +1061 cڡ * +� +, + +1062 +��n +, + +1063 * +�g +), + +1064 * +�g +); + +1066 +SSL_���_�xt_��o +(** +out +, * +ou�� +, + +1067 cڡ * +� +, +��n +, + +1068 cڡ * +��� +, +���_�n +); + +1069 +SSL_g�0_�xt_��o_�gٟ�d +(cڡ +SSL + * +s +, + +1070 cڡ ** +d�a +, * +�n +); + +1072 + #OPENSSL_NPN_UNSUPPORTED + 0 + + ) + +1073 + #OPENSSL_NPN_NEGOTIATED + 1 + + ) + +1074 + #OPENSSL_NPN_NO_OVERLAP + 2 + + ) + +1077 #i�de� +OPENSSL_NO_PSK + + +1080 + #PSK_MAX_IDENTITY_LEN + 128 + + ) + +1081 + #PSK_MAX_PSK_LEN + 256 + + ) + +1082 +SSL_CTX_�t_psk_���_��back +( +SSL_CTX + * +�x +, + +1083 (* +psk_���_��back +)( +SSL + * +s� +, cڡ * +h�t +, + +1084 * +id�t�y +, +max_id�t�y_�n +, * +psk +, + +1085 +max_psk_�n +)); + +1086 +SSL_�t_psk_���_��back +( +SSL + * +s� +, + +1087 (* +psk_���_��back +)( +SSL + * +s� +, cڡ * +h�t +, + +1088 * +id�t�y +, +max_id�t�y_�n +, * +psk +, + +1089 +max_psk_�n +)); + +1090 +SSL_CTX_�t_psk_�rv�_��back +( +SSL_CTX + * +�x +, + +1091 (* +psk_�rv�_��back +)( +SSL + * +s� +, cڡ * +id�t�y +, + +1092 * +psk +, +max_psk_�n +)); + +1093 +SSL_�t_psk_�rv�_��back +( +SSL + * +s� +, + +1094 (* +psk_�rv�_��back +)( +SSL + * +s� +, cڡ * +id�t�y +, + +1095 * +psk +, +max_psk_�n +)); + +1096 +SSL_CTX_u�_psk_id�t�y_h�t +( +SSL_CTX + * +�x +, cڡ * +id�t�y_h�t +); + +1097 +SSL_u�_psk_id�t�y_h�t +( +SSL + * +s +, cڡ * +id�t�y_h�t +); + +1098 cڡ * +SSL_g�_psk_id�t�y_h�t +(cڡ +SSL + * +s +); + +1099 cڡ * +SSL_g�_psk_id�t�y +(cڡ +SSL + * +s +); + +1102 + #SSL_NOTHING + 1 + + ) + +1103 + #SSL_WRITING + 2 + + ) + +1104 + #SSL_READING + 3 + + ) + +1105 + #SSL_X509_LOOKUP + 4 + + ) + +1108 + #SSL_w�t_n�h�g +( +s +�( + `SSL_w�t +(s�=� +SSL_NOTHING +) + + ) + +1109 + #SSL_w�t_�ad +( +s +�( + `SSL_w�t +(s�=� +SSL_READING +) + + ) + +1110 + #SSL_w�t_wr�e +( +s +�( + `SSL_w�t +(s�=� +SSL_WRITING +) + + ) + +1111 + #SSL_w�t_x509_lookup +( +s +�( + `SSL_w�t +(s�=� +SSL_X509_LOOKUP +) + + ) + +1113 + #SSL_MAC_FLAG_READ_MAC_STREAM + 1 + + ) + +1114 + #SSL_MAC_FLAG_WRITE_MAC_STREAM + 2 + + ) + +1116 #i�de� +OPENSSL_NO_SSL_INTERN + + +1118 + ss�_� + + +1123 +v�si� +; + +1124 +ty� +; + +1126 cڡ +SSL_METHOD + * +m�hod +; + +1132 #i�de� +OPENSSL_NO_BIO + + +1133 +BIO + * +rbio +; + +1134 +BIO + * +wbio +; + +1135 +BIO + * +bbio +; + +1138 * +rbio +; + +1139 * +wbio +; + +1140 * +bbio +; + +1146 +rw��e +; + +1149 +�_h�dshake +; + +1150 (* +h�dshake_func +)( +SSL + *); + +1160 +�rv� +; + +1162 +�w_�ssi� +; + +1166 +qu�t_shutdown +; + +1167 +shutdown +; + +1169 +��e +; + +1170 +r��e +; + +1172 +BUF_MEM + * +��_buf +; + +1173 * +��_msg +; + +1174 +��_num +; + +1175 +��_off +; + +1178 * +�ck� +; + +1179 +�ck�_�ngth +; + +1181 +s�2_��e_� + * +s2 +; + +1182 +s�3_��e_� + * +s3 +; + +1183 +d�s1_��e_� + * +d1 +; + +1185 +�ad_ah�d +; + +1189 (* +msg_��back +)( +wr�e_p +, +v�si� +, +cڋ�_ty� +, cڡ * +buf +, +size_t + +�n +, +SSL + * +s� +, * +�g +); + +1190 * +msg_��back_�g +; + +1192 +h� +; + +1194 +X509_VERIFY_PARAM + * +��m +; + +1197 +pu�o� +; + +1198 +�u� +; + +1202 +STACK_OF +( +SSL_CIPHER +�* +c�h�_li� +; + +1203 +STACK_OF +( +SSL_CIPHER +�* +c�h�_li�_by_id +; + +1207 +mac_�ags +; + +1208 +EVP_CIPHER_CTX + * +�c_�ad_�x +; + +1209 +EVP_MD_CTX + * +�ad_hash +; + +1210 #i�de� +OPENSSL_NO_COMP + + +1211 +COMP_CTX + * +ex�nd +; + +1213 * +ex�nd +; + +1216 +EVP_CIPHER_CTX + * +�c_wr�e_�x +; + +1217 +EVP_MD_CTX + * +wr�e_hash +; + +1218 #i�de� +OPENSSL_NO_COMP + + +1219 +COMP_CTX + * +com�ess +; + +1221 * +com�ess +; + +1228 +��_� + * +�� +; + +1232 +sid_�x_�ngth +; + +1233 +sid_�x +[ +SSL_MAX_SID_CTX_LENGTH +]; + +1236 +SSL_SESSION + * +�ssi� +; + +1239 +GEN_SESSION_CB + +g���e_�ssi�_id +; + +1242 +v�ify_mode +; + +1244 (* +v�ify_��back +)( +ok +, +X509_STORE_CTX + * +�x +); + +1246 (* +�fo_��back +)(cڡ +SSL + * +s� +, +ty� +, +v� +); + +1248 +�r� +; + +1249 +�r�_code +; + +1251 #i�de� +OPENSSL_NO_KRB5 + + +1252 +KSSL_CTX + * +ks�_�x +; + +1255 #i�de� +OPENSSL_NO_PSK + + +1256 (* +psk_���_��back +)( +SSL + * +s� +, cڡ * +h�t +, * +id�t�y +, + +1257 +max_id�t�y_�n +, * +psk +, + +1258 +max_psk_�n +); + +1259 (* +psk_�rv�_��back +)( +SSL + * +s� +, cڡ * +id�t�y +, + +1260 * +psk +, +max_psk_�n +); + +1263 +SSL_CTX + * +�x +; + +1266 +debug +; + +1269 +v�ify_�su� +; + +1270 +CRYPTO_EX_DATA + +ex_d�a +; + +1273 +STACK_OF +( +X509_NAME +�* +���_CA +; + +1275 +��n�s +; + +1276 +�ti�s +; + +1277 +mode +; + +1278 +max_��_li� +; + +1279 +f��_�ck� +; + +1280 +���_v�si� +; + +1282 +max_�nd_�agm�t +; + +1283 #i�de� +OPENSSL_NO_TLSEXT + + +1285 (* +��xt_debug_cb +)( +SSL + * +s +, +���_�rv� +, +ty� +, + +1286 * +d�a +, +�n +, + +1287 * +�g +); + +1288 * +��xt_debug_�g +; + +1289 * +��xt_ho��me +; + +1290 +�rv��me_d�e +; + +1297 +��xt_��us_ty� +; + +1299 +��xt_��us_ex��ed +; + +1301 +STACK_OF +( +OCSP_RESPID +�* +��xt_oc�_ids +; + +1302 +X509_EXTENSIONS + * +��xt_oc�_exts +; + +1304 * +��xt_oc�_�� +; + +1305 +��xt_oc�_���n +; + +1308 +��xt_tick�_ex��ed +; + +1309 #i�de� +OPENSSL_NO_EC + + +1310 +size_t + +��xt_e�o�tf�m�li�_�ngth +; + +1311 * +��xt_e�o�tf�m�li� +; + +1312 +size_t + +��xt_�l�ticcurv�i�_�ngth +; + +1313 * +��xt_�l�ticcurv�i� +; + +1317 * +��xt_�aque_�f_�put +; + +1318 +size_t + +��xt_�aque_�f_�put_�n +; + +1321 +TLS_SESSION_TICKET_EXT + * +��xt_�ssi�_tick� +; + +1324 +�s_�ssi�_tick�_ext_cb_� + +�s_�ssi�_tick�_ext_cb +; + +1325 * +�s_�ssi�_tick�_ext_cb_�g +; + +1328 +�s_�ssi�_���_cb_� + +�s_�ssi�_���_cb +; + +1329 * +�s_�ssi�_���_cb_�g +; + +1331 +SSL_CTX + * +���l_�x +; + +1333 #i�de� +OPENSSL_NO_NEXTPROTONEG + + +1341 * +�xt_��o_�gٟ�d +; + +1342 +�xt_��o_�gٟ�d_�n +; + +1345 + #�ssi�_�x + +���l_�x + + + ) + +1347 +STACK_OF +( +SRTP_PROTECTION_PROFILE +�* +��_�of�es +; + +1348 +SRTP_PROTECTION_PROFILE + * +��_�of�e +; + +1350 +��xt_h��b�t +; + +1355 +��xt_hb_�nd�g +; + +1356 +��xt_hb_�q +; + +1358 + #�ssi�_�x + +�x + + + ) + +1361 +��gٟ� +; + +1365 #i�de� +OPENSSL_NO_SRP + + +1366 +SRP_CTX + +�p_�x +; + +1372 #ifde� +__�lu�lus + + +1376 + ~<ݒs�/s�2.h +> + +1377 + ~<ݒs�/s�3.h +> + +1378 + ~<ݒs�/�s1.h +> + +1379 + ~<ݒs�/d�s1.h +> + +1380 + ~<ݒs�/s�23.h +> + +1381 + ~<ݒs�/��.h +> + +1383 #ifde� +__�lu�lus + + +1388 + #SSL_�t_�p_d�a +( +s +, +�g +�( + `SSL_�t_ex_d�a +(s,0,(*�rg)) + + ) + +1389 + #SSL_g�_�p_d�a +( +s +�( + `SSL_g�_ex_d�a +(s,0)) + + ) + +1390 + #SSL_SESSION_�t_�p_d�a +( +s +, +a +�( + `SSL_SESSION_�t_ex_d�a +(s,0,(*�)) + + ) + +1391 + #SSL_SESSION_g�_�p_d�a +( +s +�( + `SSL_SESSION_g�_ex_d�a +(s,0)) + + ) + +1392 + #SSL_CTX_g�_�p_d�a +( +�x +�( + `SSL_CTX_g�_ex_d�a +(�x,0)) + + ) + +1393 + #SSL_CTX_�t_�p_d�a +( +�x +, +�g +�( + `SSL_CTX_�t_ex_d�a +(�x,0,(*�rg)) + + ) + +1402 + #SSL_ST_CONNECT + 0x1000 + + ) + +1403 + #SSL_ST_ACCEPT + 0x2000 + + ) + +1404 + #SSL_ST_MASK + 0x0FFF + + ) + +1405 + #SSL_ST_INIT + ( +SSL_ST_CONNECT +| +SSL_ST_ACCEPT +) + + ) + +1406 + #SSL_ST_BEFORE + 0x4000 + + ) + +1407 + #SSL_ST_OK + 0x03 + + ) + +1408 + #SSL_ST_RENEGOTIATE + (0x04| +SSL_ST_INIT +) + + ) + +1410 + #SSL_CB_LOOP + 0x01 + + ) + +1411 + #SSL_CB_EXIT + 0x02 + + ) + +1412 + #SSL_CB_READ + 0x04 + + ) + +1413 + #SSL_CB_WRITE + 0x08 + + ) + +1414 + #SSL_CB_ALERT + 0x4000 + + ) + +1415 + #SSL_CB_READ_ALERT + ( +SSL_CB_ALERT +| +SSL_CB_READ +) + + ) + +1416 + #SSL_CB_WRITE_ALERT + ( +SSL_CB_ALERT +| +SSL_CB_WRITE +) + + ) + +1417 + #SSL_CB_ACCEPT_LOOP + ( +SSL_ST_ACCEPT +| +SSL_CB_LOOP +) + + ) + +1418 + #SSL_CB_ACCEPT_EXIT + ( +SSL_ST_ACCEPT +| +SSL_CB_EXIT +) + + ) + +1419 + #SSL_CB_CONNECT_LOOP + ( +SSL_ST_CONNECT +| +SSL_CB_LOOP +) + + ) + +1420 + #SSL_CB_CONNECT_EXIT + ( +SSL_ST_CONNECT +| +SSL_CB_EXIT +) + + ) + +1421 + #SSL_CB_HANDSHAKE_START + 0x10 + + ) + +1422 + #SSL_CB_HANDSHAKE_DONE + 0x20 + + ) + +1425 + #SSL_g�_��e +( +a +� + `SSL_��e +�) + + ) + +1426 + #SSL_is_��_f�ished +( +a +�( + `SSL_��e +��=� +SSL_ST_OK +) + + ) + +1427 + #SSL_�_�� +( +a +�( + `SSL_��e +�)& +SSL_ST_INIT +) + + ) + +1428 + #SSL_�_bef�e +( +a +�( + `SSL_��e +�)& +SSL_ST_BEFORE +) + + ) + +1429 + #SSL_�_c���_�� +( +a +�( + `SSL_��e +�)& +SSL_ST_CONNECT +) + + ) + +1430 + #SSL_�_ac��_�� +( +a +�( + `SSL_��e +�)& +SSL_ST_ACCEPT +) + + ) + +1434 + #SSL_ST_READ_HEADER + 0xF0 + + ) + +1435 + #SSL_ST_READ_BODY + 0xF1 + + ) + +1436 + #SSL_ST_READ_DONE + 0xF2 + + ) + +1442 +size_t + +SSL_g�_f�ished +(cڡ +SSL + * +s +, * +buf +, size_� +cou� +); + +1443 +size_t + +SSL_g�_��_f�ished +(cڡ +SSL + * +s +, * +buf +, size_� +cou� +); + +1447 + #SSL_VERIFY_NONE + 0x00 + + ) + +1448 + #SSL_VERIFY_PEER + 0x01 + + ) + +1449 + #SSL_VERIFY_FAIL_IF_NO_PEER_CERT + 0x02 + + ) + +1450 + #SSL_VERIFY_CLIENT_ONCE + 0x04 + + ) + +1452 + #O�nSSL_add_s�_�gܙhms +(� + `SSL_lib�ry_�� +() + + ) + +1453 + #SSL�y_add_s�_�gܙhms +(� + `SSL_lib�ry_�� +() + + ) + +1457 + #SSL_CTX_�t_de�u�_v�ify +( +a +, +b +, +c +� + `SSL_CTX_�t_v�ify +�,b,c) + + ) + +1458 + #SSL_�t_�ef_c�h� +( +c +, +n +� + `SSL_�t_c�h�_li� +(c,n) + + ) + +1459 + #SSL_add_�ssi� +( +a +, +b +� + `SSL_CTX_add_�ssi� +(�),(b)) + + ) + +1460 + #SSL_�move_�ssi� +( +a +, +b +� + `SSL_CTX_�move_�ssi� +(�),(b)) + + ) + +1461 + #SSL_�ush_�ssi�s +( +a +, +b +� + `SSL_CTX_�ush_�ssi�s +(�),(b)) + + ) + +1464 + #SSL_g�_c�h� +( +s +) \ + +1465 + `SSL_CIPHER_g�_�me +( + `SSL_g�_cu��t_c�h� +( +s +)) + + ) + +1466 + #SSL_g�_c�h�_b�s +( +s +, +� +) \ + +1467 + `SSL_CIPHER_g�_b�s +( + `SSL_g�_cu��t_c�h� +( +s +), +� +) + + ) + +1468 + #SSL_g�_c�h�_v�si� +( +s +) \ + +1469 + `SSL_CIPHER_g�_v�si� +( + `SSL_g�_cu��t_c�h� +( +s +)) + + ) + +1470 + #SSL_g�_c�h�_�me +( +s +) \ + +1471 + `SSL_CIPHER_g�_�me +( + `SSL_g�_cu��t_c�h� +( +s +)) + + ) + +1472 + #SSL_g�_time +( +a +� + `SSL_SESSION_g�_time +�) + + ) + +1473 + #SSL_�t_time +( +a +, +b +� + `SSL_SESSION_�t_time +(�),(b)) + + ) + +1474 + #SSL_g�_timeout +( +a +� + `SSL_SESSION_g�_timeout +�) + + ) + +1475 + #SSL_�t_timeout +( +a +, +b +� + `SSL_SESSION_�t_timeout +(�),(b)) + + ) + +1477 + #d2i_SSL_SESSION_bio +( +bp +, +s_id +� + `ASN1_d2i_bio_of +( +SSL_SESSION +, +SSL_SESSION_�w +, +d2i_SSL_SESSION +,bp,s_id) + + ) + +1478 + #i2d_SSL_SESSION_bio +( +bp +, +s_id +� + `ASN1_i2d_bio_of +( +SSL_SESSION +, +i2d_SSL_SESSION +,bp,s_id) + + ) + +1480 +DECLARE_PEM_rw +( +SSL_SESSION +, SSL_SESSION) + +1482 + #SSL_AD_REASON_OFFSET + 1000 + + ) + +1485 + #SSL_AD_CLOSE_NOTIFY + +SSL3_AD_CLOSE_NOTIFY + + + ) + +1486 + #SSL_AD_UNEXPECTED_MESSAGE + +SSL3_AD_UNEXPECTED_MESSAGE + + + ) + +1487 + #SSL_AD_BAD_RECORD_MAC + +SSL3_AD_BAD_RECORD_MAC + + + ) + +1488 + #SSL_AD_DECRYPTION_FAILED + +TLS1_AD_DECRYPTION_FAILED + + + ) + +1489 + #SSL_AD_RECORD_OVERFLOW + +TLS1_AD_RECORD_OVERFLOW + + + ) + +1490 + #SSL_AD_DECOMPRESSION_FAILURE + +SSL3_AD_DECOMPRESSION_FAILURE + + + ) + +1491 + #SSL_AD_HANDSHAKE_FAILURE + +SSL3_AD_HANDSHAKE_FAILURE + + + ) + +1492 + #SSL_AD_NO_CERTIFICATE + +SSL3_AD_NO_CERTIFICATE + + + ) + +1493 + #SSL_AD_BAD_CERTIFICATE + +SSL3_AD_BAD_CERTIFICATE + + + ) + +1494 + #SSL_AD_UNSUPPORTED_CERTIFICATE + +SSL3_AD_UNSUPPORTED_CERTIFICATE + + + ) + +1495 + #SSL_AD_CERTIFICATE_REVOKED + +SSL3_AD_CERTIFICATE_REVOKED + + + ) + +1496 + #SSL_AD_CERTIFICATE_EXPIRED + +SSL3_AD_CERTIFICATE_EXPIRED + + + ) + +1497 + #SSL_AD_CERTIFICATE_UNKNOWN + +SSL3_AD_CERTIFICATE_UNKNOWN + + + ) + +1498 + #SSL_AD_ILLEGAL_PARAMETER + +SSL3_AD_ILLEGAL_PARAMETER + + + ) + +1499 + #SSL_AD_UNKNOWN_CA + +TLS1_AD_UNKNOWN_CA + + + ) + +1500 + #SSL_AD_ACCESS_DENIED + +TLS1_AD_ACCESS_DENIED + + + ) + +1501 + #SSL_AD_DECODE_ERROR + +TLS1_AD_DECODE_ERROR + + + ) + +1502 + #SSL_AD_DECRYPT_ERROR + +TLS1_AD_DECRYPT_ERROR + + + ) + +1503 + #SSL_AD_EXPORT_RESTRICTION + +TLS1_AD_EXPORT_RESTRICTION + + + ) + +1504 + #SSL_AD_PROTOCOL_VERSION + +TLS1_AD_PROTOCOL_VERSION + + + ) + +1505 + #SSL_AD_INSUFFICIENT_SECURITY + +TLS1_AD_INSUFFICIENT_SECURITY + + + ) + +1506 + #SSL_AD_INTERNAL_ERROR + +TLS1_AD_INTERNAL_ERROR + + + ) + +1507 + #SSL_AD_USER_CANCELLED + +TLS1_AD_USER_CANCELLED + + + ) + +1508 + #SSL_AD_NO_RENEGOTIATION + +TLS1_AD_NO_RENEGOTIATION + + + ) + +1509 + #SSL_AD_UNSUPPORTED_EXTENSION + +TLS1_AD_UNSUPPORTED_EXTENSION + + + ) + +1510 + #SSL_AD_CERTIFICATE_UNOBTAINABLE + +TLS1_AD_CERTIFICATE_UNOBTAINABLE + + + ) + +1511 + #SSL_AD_UNRECOGNIZED_NAME + +TLS1_AD_UNRECOGNIZED_NAME + + + ) + +1512 + #SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE + +TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE + + + ) + +1513 + #SSL_AD_BAD_CERTIFICATE_HASH_VALUE + +TLS1_AD_BAD_CERTIFICATE_HASH_VALUE + + + ) + +1514 + #SSL_AD_UNKNOWN_PSK_IDENTITY + +TLS1_AD_UNKNOWN_PSK_IDENTITY + + + ) + +1515 + #SSL_AD_INAPPROPRIATE_FALLBACK + +TLS1_AD_INAPPROPRIATE_FALLBACK + + + ) + +1517 + #SSL_ERROR_NONE + 0 + + ) + +1518 + #SSL_ERROR_SSL + 1 + + ) + +1519 + #SSL_ERROR_WANT_READ + 2 + + ) + +1520 + #SSL_ERROR_WANT_WRITE + 3 + + ) + +1521 + #SSL_ERROR_WANT_X509_LOOKUP + 4 + + ) + +1522 + #SSL_ERROR_SYSCALL + 5 + + ) + +1523 + #SSL_ERROR_ZERO_RETURN + 6 + + ) + +1524 + #SSL_ERROR_WANT_CONNECT + 7 + + ) + +1525 + #SSL_ERROR_WANT_ACCEPT + 8 + + ) + +1527 + #SSL_CTRL_NEED_TMP_RSA + 1 + + ) + +1528 + #SSL_CTRL_SET_TMP_RSA + 2 + + ) + +1529 + #SSL_CTRL_SET_TMP_DH + 3 + + ) + +1530 + #SSL_CTRL_SET_TMP_ECDH + 4 + + ) + +1531 + #SSL_CTRL_SET_TMP_RSA_CB + 5 + + ) + +1532 + #SSL_CTRL_SET_TMP_DH_CB + 6 + + ) + +1533 + #SSL_CTRL_SET_TMP_ECDH_CB + 7 + + ) + +1535 + #SSL_CTRL_GET_SESSION_REUSED + 8 + + ) + +1536 + #SSL_CTRL_GET_CLIENT_CERT_REQUEST + 9 + + ) + +1537 + #SSL_CTRL_GET_NUM_RENEGOTIATIONS + 10 + + ) + +1538 + #SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS + 11 + + ) + +1539 + #SSL_CTRL_GET_TOTAL_RENEGOTIATIONS + 12 + + ) + +1540 + #SSL_CTRL_GET_FLAGS + 13 + + ) + +1541 + #SSL_CTRL_EXTRA_CHAIN_CERT + 14 + + ) + +1543 + #SSL_CTRL_SET_MSG_CALLBACK + 15 + + ) + +1544 + #SSL_CTRL_SET_MSG_CALLBACK_ARG + 16 + + ) + +1547 + #SSL_CTRL_SET_MTU + 17 + + ) + +1549 + #SSL_CTRL_SESS_NUMBER + 20 + + ) + +1550 + #SSL_CTRL_SESS_CONNECT + 21 + + ) + +1551 + #SSL_CTRL_SESS_CONNECT_GOOD + 22 + + ) + +1552 + #SSL_CTRL_SESS_CONNECT_RENEGOTIATE + 23 + + ) + +1553 + #SSL_CTRL_SESS_ACCEPT + 24 + + ) + +1554 + #SSL_CTRL_SESS_ACCEPT_GOOD + 25 + + ) + +1555 + #SSL_CTRL_SESS_ACCEPT_RENEGOTIATE + 26 + + ) + +1556 + #SSL_CTRL_SESS_HIT + 27 + + ) + +1557 + #SSL_CTRL_SESS_CB_HIT + 28 + + ) + +1558 + #SSL_CTRL_SESS_MISSES + 29 + + ) + +1559 + #SSL_CTRL_SESS_TIMEOUTS + 30 + + ) + +1560 + #SSL_CTRL_SESS_CACHE_FULL + 31 + + ) + +1561 + #SSL_CTRL_OPTIONS + 32 + + ) + +1562 + #SSL_CTRL_MODE + 33 + + ) + +1564 + #SSL_CTRL_GET_READ_AHEAD + 40 + + ) + +1565 + #SSL_CTRL_SET_READ_AHEAD + 41 + + ) + +1566 + #SSL_CTRL_SET_SESS_CACHE_SIZE + 42 + + ) + +1567 + #SSL_CTRL_GET_SESS_CACHE_SIZE + 43 + + ) + +1568 + #SSL_CTRL_SET_SESS_CACHE_MODE + 44 + + ) + +1569 + #SSL_CTRL_GET_SESS_CACHE_MODE + 45 + + ) + +1571 + #SSL_CTRL_GET_MAX_CERT_LIST + 50 + + ) + +1572 + #SSL_CTRL_SET_MAX_CERT_LIST + 51 + + ) + +1574 + #SSL_CTRL_SET_MAX_SEND_FRAGMENT + 52 + + ) + +1577 #i�de� +OPENSSL_NO_TLSEXT + + +1578 + #SSL_CTRL_SET_TLSEXT_SERVERNAME_CB + 53 + + ) + +1579 + #SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG + 54 + + ) + +1580 + #SSL_CTRL_SET_TLSEXT_HOSTNAME + 55 + + ) + +1581 + #SSL_CTRL_SET_TLSEXT_DEBUG_CB + 56 + + ) + +1582 + #SSL_CTRL_SET_TLSEXT_DEBUG_ARG + 57 + + ) + +1583 + #SSL_CTRL_GET_TLSEXT_TICKET_KEYS + 58 + + ) + +1584 + #SSL_CTRL_SET_TLSEXT_TICKET_KEYS + 59 + + ) + +1585 + #SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT + 60 + + ) + +1586 + #SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB + 61 + + ) + +1587 + #SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG + 62 + + ) + +1588 + #SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB + 63 + + ) + +1589 + #SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG + 64 + + ) + +1590 + #SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE + 65 + + ) + +1591 + #SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS + 66 + + ) + +1592 + #SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS + 67 + + ) + +1593 + #SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS + 68 + + ) + +1594 + #SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS + 69 + + ) + +1595 + #SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP + 70 + + ) + +1596 + #SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP + 71 + + ) + +1598 + #SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB + 72 + + ) + +1600 + #SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB + 75 + + ) + +1601 + #SSL_CTRL_SET_SRP_VERIFY_PARAM_CB + 76 + + ) + +1602 + #SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB + 77 + + ) + +1604 + #SSL_CTRL_SET_SRP_ARG + 78 + + ) + +1605 + #SSL_CTRL_SET_TLS_EXT_SRP_USERNAME + 79 + + ) + +1606 + #SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH + 80 + + ) + +1607 + #SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD + 81 + + ) + +1608 #i�de� +OPENSSL_NO_HEARTBEATS + + +1609 + #SSL_CTRL_TLS_EXT_SEND_HEARTBEAT + 85 + + ) + +1610 + #SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING + 86 + + ) + +1611 + #SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS + 87 + + ) + +1615 + #DTLS_CTRL_GET_TIMEOUT + 73 + + ) + +1616 + #DTLS_CTRL_HANDLE_TIMEOUT + 74 + + ) + +1617 + #DTLS_CTRL_LISTEN + 75 + + ) + +1619 + #SSL_CTRL_GET_RI_SUPPORT + 76 + + ) + +1620 + #SSL_CTRL_CLEAR_OPTIONS + 77 + + ) + +1621 + #SSL_CTRL_CLEAR_MODE + 78 + + ) + +1623 + #SSL_CTRL_GET_EXTRA_CHAIN_CERTS + 82 + + ) + +1624 + #SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS + 83 + + ) + +1626 + #SSL_CTRL_CHECK_PROTO_VERSION + 119 + + ) + +1628 + #DTLSv1_g�_timeout +( +s� +, +�g +) \ + +1629 + `SSL_�� +( +s� +, +DTLS_CTRL_GET_TIMEOUT +,0, (*) +�g +) + + ) + +1630 + #DTLSv1_h�d�_timeout +( +s� +) \ + +1631 + `SSL_�� +( +s� +, +DTLS_CTRL_HANDLE_TIMEOUT +,0, +NULL +) + + ) + +1632 + #DTLSv1_li�� +( +s� +, +�� +) \ + +1633 + `SSL_�� +( +s� +, +DTLS_CTRL_LISTEN +,0, (*) +�� +) + + ) + +1635 + #SSL_�ssi�_�u�d +( +s� +) \ + +1636 + `SSL_�� +(( +s� +), +SSL_CTRL_GET_SESSION_REUSED +,0, +NULL +) + + ) + +1637 + #SSL_num_��gٟti�s +( +s� +) \ + +1638 + `SSL_�� +(( +s� +), +SSL_CTRL_GET_NUM_RENEGOTIATIONS +,0, +NULL +) + + ) + +1639 + #SSL_��r_num_��gٟti�s +( +s� +) \ + +1640 + `SSL_�� +(( +s� +), +SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS +,0, +NULL +) + + ) + +1641 + #SSL_tٮ_��gٟti�s +( +s� +) \ + +1642 + `SSL_�� +(( +s� +), +SSL_CTRL_GET_TOTAL_RENEGOTIATIONS +,0, +NULL +) + + ) + +1644 + #SSL_CTX_�ed_tmp_RSA +( +�x +) \ + +1645 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_NEED_TMP_RSA +,0, +NULL +) + + ) + +1646 + #SSL_CTX_�t_tmp_r� +( +�x +, +r� +) \ + +1647 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SET_TMP_RSA +,0,(*) +r� +) + + ) + +1648 + #SSL_CTX_�t_tmp_dh +( +�x +, +dh +) \ + +1649 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SET_TMP_DH +,0,(*) +dh +) + + ) + +1650 + #SSL_CTX_�t_tmp_ecdh +( +�x +, +ecdh +) \ + +1651 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SET_TMP_ECDH +,0,(*) +ecdh +) + + ) + +1653 + #SSL_�ed_tmp_RSA +( +s� +) \ + +1654 + `SSL_�� +( +s� +, +SSL_CTRL_NEED_TMP_RSA +,0, +NULL +) + + ) + +1655 + #SSL_�t_tmp_r� +( +s� +, +r� +) \ + +1656 + `SSL_�� +( +s� +, +SSL_CTRL_SET_TMP_RSA +,0,(*) +r� +) + + ) + +1657 + #SSL_�t_tmp_dh +( +s� +, +dh +) \ + +1658 + `SSL_�� +( +s� +, +SSL_CTRL_SET_TMP_DH +,0,(*) +dh +) + + ) + +1659 + #SSL_�t_tmp_ecdh +( +s� +, +ecdh +) \ + +1660 + `SSL_�� +( +s� +, +SSL_CTRL_SET_TMP_ECDH +,0,(*) +ecdh +) + + ) + +1662 + #SSL_CTX_add_ex�a_cha�_�� +( +�x +, +x509 +) \ + +1663 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_EXTRA_CHAIN_CERT +,0,(*) +x509 +) + + ) + +1664 + #SSL_CTX_g�_ex�a_cha�_��s +( +�x +, +px509 +) \ + +1665 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_GET_EXTRA_CHAIN_CERTS +,0, +px509 +) + + ) + +1666 + #SSL_CTX_��r_ex�a_cha�_��s +( +�x +) \ + +1667 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS +,0, +NULL +) + + ) + +1669 #i�de� +OPENSSL_NO_BIO + + +1670 +BIO_METHOD + * +BIO_f_s� +(); + +1671 +BIO + * +BIO_�w_s� +( +SSL_CTX + * +�x +, +��� +); + +1672 +BIO + * +BIO_�w_s�_c��� +( +SSL_CTX + * +�x +); + +1673 +BIO + * +BIO_�w_buf�r_s�_c��� +( +SSL_CTX + * +�x +); + +1674 +BIO_s�_c�y_�ssi�_id +( +BIO + * +to +,BIO * +�om +); + +1675 +BIO_s�_shutdown +( +BIO + * +s�_bio +); + +1679 +SSL_CTX_�t_c�h�_li� +( +SSL_CTX + *,cڡ * +�r +); + +1680 +SSL_CTX + * +SSL_CTX_�w +(cڡ +SSL_METHOD + * +m�h +); + +1681 +SSL_CTX_� +( +SSL_CTX + *); + +1682 +SSL_CTX_�t_timeout +( +SSL_CTX + * +�x +, +t +); + +1683 +SSL_CTX_g�_timeout +(cڡ +SSL_CTX + * +�x +); + +1684 +X509_STORE + * +SSL_CTX_g�_��_��e +(cڡ +SSL_CTX + *); + +1685 +SSL_CTX_�t_��_��e +( +SSL_CTX + *, +X509_STORE + *); + +1686 +SSL_w�t +(cڡ +SSL + * +s +); + +1687 +SSL_��r +( +SSL + * +s +); + +1689 +SSL_CTX_�ush_�ssi�s +( +SSL_CTX + * +�x +, +tm +); + +1691 cڡ +SSL_CIPHER + * +SSL_g�_cu��t_c�h� +(cڡ +SSL + * +s +); + +1692 +SSL_CIPHER_g�_b�s +(cڡ +SSL_CIPHER + * +c +,* +�g_b�s +); + +1693 * +SSL_CIPHER_g�_v�si� +(cڡ +SSL_CIPHER + * +c +); + +1694 cڡ * +SSL_CIPHER_g�_�me +(cڡ +SSL_CIPHER + * +c +); + +1695 +SSL_CIPHER_g�_id +(cڡ +SSL_CIPHER + * +c +); + +1697 +SSL_g�_fd +(cڡ +SSL + * +s +); + +1698 +SSL_g�_rfd +(cڡ +SSL + * +s +); + +1699 +SSL_g�_wfd +(cڡ +SSL + * +s +); + +1700 cڡ * +SSL_g�_c�h�_li� +(cڡ +SSL + * +s +, +n +); + +1701 * +SSL_g�_sh�ed_c�h�s +(cڡ +SSL + * +s +, * +buf +, +�n +); + +1702 +SSL_g�_�ad_ah�d +(cڡ +SSL + * +s +); + +1703 +SSL_�nd�g +(cڡ +SSL + * +s +); + +1704 #i�de� +OPENSSL_NO_SOCK + + +1705 +SSL_�t_fd +( +SSL + * +s +, +fd +); + +1706 +SSL_�t_rfd +( +SSL + * +s +, +fd +); + +1707 +SSL_�t_wfd +( +SSL + * +s +, +fd +); + +1709 #i�de� +OPENSSL_NO_BIO + + +1710 +SSL_�t_bio +( +SSL + * +s +, +BIO + * +rbio +,BIO * +wbio +); + +1711 +BIO + * +SSL_g�_rbio +(cڡ +SSL + * +s +); + +1712 +BIO + * +SSL_g�_wbio +(cڡ +SSL + * +s +); + +1714 +SSL_�t_c�h�_li� +( +SSL + * +s +, cڡ * +�r +); + +1715 +SSL_�t_�ad_ah�d +( +SSL + * +s +, +yes +); + +1716 +SSL_g�_v�ify_mode +(cڡ +SSL + * +s +); + +1717 +SSL_g�_v�ify_d�th +(cڡ +SSL + * +s +); + +1718 (* +SSL_g�_v�ify_��back +(cڡ +SSL + * +s +))(, +X509_STORE_CTX + *); + +1719 +SSL_�t_v�ify +( +SSL + * +s +, +mode +, + +1720 (* +��back +)( +ok +, +X509_STORE_CTX + * +�x +)); + +1721 +SSL_�t_v�ify_d�th +( +SSL + * +s +, +d�th +); + +1722 #i�de� +OPENSSL_NO_RSA + + +1723 +SSL_u�_RSAPriv�eKey +( +SSL + * +s� +, +RSA + * +r� +); + +1725 +SSL_u�_RSAPriv�eKey_ASN1 +( +SSL + * +s� +, * +d +, +�n +); + +1726 +SSL_u�_Priv�eKey +( +SSL + * +s� +, +EVP_PKEY + * +pkey +); + +1727 +SSL_u�_Priv�eKey_ASN1 +( +pk +, +SSL + * +s� +, cڡ * +d +, +�n +); + +1728 +SSL_u�_��ifi�� +( +SSL + * +s� +, +X509 + * +x +); + +1729 +SSL_u�_��ifi��_ASN1 +( +SSL + * +s� +, cڡ * +d +, +�n +); + +1731 #i�de� +OPENSSL_NO_STDIO + + +1732 +SSL_u�_RSAPriv�eKey_f�e +( +SSL + * +s� +, cڡ * +f�e +, +ty� +); + +1733 +SSL_u�_Priv�eKey_f�e +( +SSL + * +s� +, cڡ * +f�e +, +ty� +); + +1734 +SSL_u�_��ifi��_f�e +( +SSL + * +s� +, cڡ * +f�e +, +ty� +); + +1735 +SSL_CTX_u�_RSAPriv�eKey_f�e +( +SSL_CTX + * +�x +, cڡ * +f�e +, +ty� +); + +1736 +SSL_CTX_u�_Priv�eKey_f�e +( +SSL_CTX + * +�x +, cڡ * +f�e +, +ty� +); + +1737 +SSL_CTX_u�_��ifi��_f�e +( +SSL_CTX + * +�x +, cڡ * +f�e +, +ty� +); + +1738 +SSL_CTX_u�_��ifi��_cha�_f�e +( +SSL_CTX + * +�x +, cڡ * +f�e +); + +1739 +STACK_OF +( +X509_NAME +�* +SSL_l�d_���_CA_f�e +(cڡ * +f�e +); + +1740 +SSL_add_f�e_��_subje�s_to_�ack +( +STACK_OF +( +X509_NAME +�* +�ackCAs +, + +1741 cڡ * +f�e +); + +1742 #i�de� +OPENSSL_SYS_VMS + + +1743 #i�de� +OPENSSL_SYS_MACINTOSH_CLASSIC + + +1744 +SSL_add_d�_��_subje�s_to_�ack +( +STACK_OF +( +X509_NAME +�* +�ackCAs +, + +1745 cڡ * +d� +); + +1751 +SSL_l�d_�r�_�r�gs +(); + +1752 cڡ * +SSL_��e_�r�g +(cڡ +SSL + * +s +); + +1753 cڡ * +SSL_r��e_�r�g +(cڡ +SSL + * +s +); + +1754 cڡ * +SSL_��e_�r�g_l�g +(cڡ +SSL + * +s +); + +1755 cڡ * +SSL_r��e_�r�g_l�g +(cڡ +SSL + * +s +); + +1756 +SSL_SESSION_g�_time +(cڡ +SSL_SESSION + * +s +); + +1757 +SSL_SESSION_�t_time +( +SSL_SESSION + * +s +, +t +); + +1758 +SSL_SESSION_g�_timeout +(cڡ +SSL_SESSION + * +s +); + +1759 +SSL_SESSION_�t_timeout +( +SSL_SESSION + * +s +, +t +); + +1760 +SSL_c�y_�ssi�_id +( +SSL + * +to +,cڡ SSL * +�om +); + +1761 +X509 + * +SSL_SESSION_g�0_�� +( +SSL_SESSION + * +s +); + +1762 +SSL_SESSION_�t1_id_cڋxt +( +SSL_SESSION + * +s +,cڡ * +sid_�x +, + +1763 +sid_�x_�n +); + +1765 +SSL_SESSION + * +SSL_SESSION_�w +(); + +1766 cڡ * +SSL_SESSION_g�_id +(cڡ +SSL_SESSION + * +s +, + +1767 * +�n +); + +1768 +SSL_SESSION_g�_com�ess_id +(cڡ +SSL_SESSION + * +s +); + +1769 #i�de� +OPENSSL_NO_FP_API + + +1770 +SSL_SESSION_��t_� +( +FILE + * +� +,cڡ +SSL_SESSION + * +�s +); + +1772 #i�de� +OPENSSL_NO_BIO + + +1773 +SSL_SESSION_��t +( +BIO + * +� +,cڡ +SSL_SESSION + * +�s +); + +1775 +SSL_SESSION_� +( +SSL_SESSION + * +�s +); + +1776 +i2d_SSL_SESSION +( +SSL_SESSION + * +� +,** +� +); + +1777 +SSL_�t_�ssi� +( +SSL + * +to +, +SSL_SESSION + * +�ssi� +); + +1778 +SSL_CTX_add_�ssi� +( +SSL_CTX + * +s +, +SSL_SESSION + * +c +); + +1779 +SSL_CTX_�move_�ssi� +( +SSL_CTX + *, +SSL_SESSION + * +c +); + +1780 +SSL_CTX_�t_g���e_�ssi�_id +( +SSL_CTX + *, +GEN_SESSION_CB +); + +1781 +SSL_�t_g���e_�ssi�_id +( +SSL + *, +GEN_SESSION_CB +); + +1782 +SSL_has_m�ch�g_�ssi�_id +(cڡ +SSL + * +s� +, cڡ * +id +, + +1783 +id_�n +); + +1784 +SSL_SESSION + * +d2i_SSL_SESSION +(SSL_SESSION ** +a +,cڡ ** +� +, + +1785 +�ngth +); + +1787 #ifde� +HEADER_X509_H + + +1788 +X509 + * +SSL_g�_��_��ifi�� +(cڡ +SSL + * +s +); + +1791 +STACK_OF +( +X509 +�* +SSL_g�_��_��_cha� +(cڡ +SSL + * +s +); + +1793 +SSL_CTX_g�_v�ify_mode +(cڡ +SSL_CTX + * +�x +); + +1794 +SSL_CTX_g�_v�ify_d�th +(cڡ +SSL_CTX + * +�x +); + +1795 (* +SSL_CTX_g�_v�ify_��back +(cڡ +SSL_CTX + * +�x +))(, +X509_STORE_CTX + *); + +1796 +SSL_CTX_�t_v�ify +( +SSL_CTX + * +�x +, +mode +, + +1797 (* +��back +)(, +X509_STORE_CTX + *)); + +1798 +SSL_CTX_�t_v�ify_d�th +( +SSL_CTX + * +�x +, +d�th +); + +1799 +SSL_CTX_�t_��_v�ify_��back +( +SSL_CTX + * +�x +, (* +cb +)( +X509_STORE_CTX + *,*), * +�g +); + +1800 #i�de� +OPENSSL_NO_RSA + + +1801 +SSL_CTX_u�_RSAPriv�eKey +( +SSL_CTX + * +�x +, +RSA + * +r� +); + +1803 +SSL_CTX_u�_RSAPriv�eKey_ASN1 +( +SSL_CTX + * +�x +, cڡ * +d +, +�n +); + +1804 +SSL_CTX_u�_Priv�eKey +( +SSL_CTX + * +�x +, +EVP_PKEY + * +pkey +); + +1805 +SSL_CTX_u�_Priv�eKey_ASN1 +( +pk +, +SSL_CTX + * +�x +, + +1806 cڡ * +d +, +�n +); + +1807 +SSL_CTX_u�_��ifi�� +( +SSL_CTX + * +�x +, +X509 + * +x +); + +1808 +SSL_CTX_u�_��ifi��_ASN1 +( +SSL_CTX + * +�x +, +�n +, cڡ * +d +); + +1810 +SSL_CTX_�t_de�u�_�sswd_cb +( +SSL_CTX + * +�x +, +�m_�ssw�d_cb + * +cb +); + +1811 +SSL_CTX_�t_de�u�_�sswd_cb_u�rd�a +( +SSL_CTX + * +�x +, * +u +); + +1813 +SSL_CTX_check_�iv�e_key +(cڡ +SSL_CTX + * +�x +); + +1814 +SSL_check_�iv�e_key +(cڡ +SSL + * +�x +); + +1816 +SSL_CTX_�t_�ssi�_id_cڋxt +( +SSL_CTX + * +�x +,cڡ * +sid_�x +, + +1817 +sid_�x_�n +); + +1819 +SSL + * +SSL_�w +( +SSL_CTX + * +�x +); + +1820 +SSL_�t_�ssi�_id_cڋxt +( +SSL + * +s� +,cڡ * +sid_�x +, + +1821 +sid_�x_�n +); + +1823 +SSL_CTX_�t_pu�o� +( +SSL_CTX + * +s +, +pu�o� +); + +1824 +SSL_�t_pu�o� +( +SSL + * +s +, +pu�o� +); + +1825 +SSL_CTX_�t_�u� +( +SSL_CTX + * +s +, +�u� +); + +1826 +SSL_�t_�u� +( +SSL + * +s +, +�u� +); + +1828 +SSL_CTX_�t1_��m +( +SSL_CTX + * +�x +, +X509_VERIFY_PARAM + * +vpm +); + +1829 +SSL_�t1_��m +( +SSL + * +s� +, +X509_VERIFY_PARAM + * +vpm +); + +1831 #i�de� +OPENSSL_NO_SRP + + +1832 +SSL_CTX_�t_�p_u��ame +( +SSL_CTX + * +�x +,* +�me +); + +1833 +SSL_CTX_�t_�p_�ssw�d +( +SSL_CTX + * +�x +,* +�ssw�d +); + +1834 +SSL_CTX_�t_�p_��ngth +( +SSL_CTX + * +�x +, +��ngth +); + +1835 +SSL_CTX_�t_�p_���_pwd_��back +( +SSL_CTX + * +�x +, + +1836 *(* +cb +)( +SSL + *,*)); + +1837 +SSL_CTX_�t_�p_v�ify_��m_��back +( +SSL_CTX + * +�x +, + +1838 (* +cb +)( +SSL + *,*)); + +1839 +SSL_CTX_�t_�p_u��ame_��back +( +SSL_CTX + * +�x +, + +1840 (* +cb +)( +SSL + *,*,*)); + +1841 +SSL_CTX_�t_�p_cb_�g +( +SSL_CTX + * +�x +, * +�g +); + +1843 +SSL_�t_�p_�rv�_��m +( +SSL + * +s +, cڡ +BIGNUM + * +N +, cڡ BIGNUM * +g +, + +1844 +BIGNUM + * +� +, BIGNUM * +v +, * +�fo +); + +1845 +SSL_�t_�p_�rv�_��m_pw +( +SSL + * +s +, cڡ * +u�r +, cڡ * +�ss +, + +1846 cڡ * +g� +); + +1848 +BIGNUM + * +SSL_g�_�p_g +( +SSL + * +s +); + +1849 +BIGNUM + * +SSL_g�_�p_N +( +SSL + * +s +); + +1851 * +SSL_g�_�p_u��ame +( +SSL + * +s +); + +1852 * +SSL_g�_�p_u�r�fo +( +SSL + * +s +); + +1855 +SSL_� +( +SSL + * +s� +); + +1856 +SSL_ac�� +( +SSL + * +s� +); + +1857 +SSL_c��� +( +SSL + * +s� +); + +1858 +SSL_�ad +( +SSL + * +s� +,* +buf +, +num +); + +1859 +SSL_�ek +( +SSL + * +s� +,* +buf +, +num +); + +1860 +SSL_wr�e +( +SSL + * +s� +,cڡ * +buf +, +num +); + +1861 +SSL_�� +( +SSL + * +s� +, +cmd +, +�rg +, * +�rg +); + +1862 +SSL_��back_�� +( +SSL + *, , (*)()); + +1863 +SSL_CTX_�� +( +SSL_CTX + * +�x +, +cmd +, +�rg +, * +�rg +); + +1864 +SSL_CTX_��back_�� +( +SSL_CTX + *, , (*)()); + +1866 +SSL_g�_�r� +(cڡ +SSL + * +s +, +�t_code +); + +1867 cڡ * +SSL_g�_v�si� +(cڡ +SSL + * +s +); + +1870 +SSL_CTX_�t_s�_v�si� +( +SSL_CTX + * +�x +, cڡ +SSL_METHOD + * +m�h +); + +1872 #i�de� +OPENSSL_NO_SSL2 + + +1873 cڡ +SSL_METHOD + * +SSLv2_m�hod +(); + +1874 cڡ +SSL_METHOD + * +SSLv2_�rv�_m�hod +(); + +1875 cڡ +SSL_METHOD + * +SSLv2_���_m�hod +(); + +1878 cڡ +SSL_METHOD + * +SSLv3_m�hod +(); + +1879 cڡ +SSL_METHOD + * +SSLv3_�rv�_m�hod +(); + +1880 cڡ +SSL_METHOD + * +SSLv3_���_m�hod +(); + +1882 cڡ +SSL_METHOD + * +SSLv23_m�hod +(); + +1883 cڡ +SSL_METHOD + * +SSLv23_�rv�_m�hod +(); + +1884 cڡ +SSL_METHOD + * +SSLv23_���_m�hod +(); + +1886 cڡ +SSL_METHOD + * +TLSv1_m�hod +(); + +1887 cڡ +SSL_METHOD + * +TLSv1_�rv�_m�hod +(); + +1888 cڡ +SSL_METHOD + * +TLSv1_���_m�hod +(); + +1890 cڡ +SSL_METHOD + * +TLSv1_1_m�hod +(); + +1891 cڡ +SSL_METHOD + * +TLSv1_1_�rv�_m�hod +(); + +1892 cڡ +SSL_METHOD + * +TLSv1_1_���_m�hod +(); + +1894 cڡ +SSL_METHOD + * +TLSv1_2_m�hod +(); + +1895 cڡ +SSL_METHOD + * +TLSv1_2_�rv�_m�hod +(); + +1896 cڡ +SSL_METHOD + * +TLSv1_2_���_m�hod +(); + +1899 cڡ +SSL_METHOD + * +DTLSv1_m�hod +(); + +1900 cڡ +SSL_METHOD + * +DTLSv1_�rv�_m�hod +(); + +1901 cڡ +SSL_METHOD + * +DTLSv1_���_m�hod +(); + +1903 +STACK_OF +( +SSL_CIPHER +�* +SSL_g�_c�h�s +(cڡ +SSL + * +s +); + +1905 +SSL_do_h�dshake +( +SSL + * +s +); + +1906 +SSL_��gٟ� +( +SSL + * +s +); + +1907 +SSL_��gٟ�_abb�v��d +( +SSL + * +s +); + +1908 +SSL_��gٟ�_�nd�g +( +SSL + * +s +); + +1909 +SSL_shutdown +( +SSL + * +s +); + +1911 cڡ +SSL_METHOD + * +SSL_g�_s�_m�hod +( +SSL + * +s +); + +1912 +SSL_�t_s�_m�hod +( +SSL + * +s +, cڡ +SSL_METHOD + * +m�hod +); + +1913 cڡ * +SSL_��t_ty�_�r�g_l�g +( +v�ue +); + +1914 cڡ * +SSL_��t_ty�_�r�g +( +v�ue +); + +1915 cڡ * +SSL_��t_desc_�r�g_l�g +( +v�ue +); + +1916 cڡ * +SSL_��t_desc_�r�g +( +v�ue +); + +1918 +SSL_�t_���_CA_li� +( +SSL + * +s +, +STACK_OF +( +X509_NAME +�* +�me_li� +); + +1919 +SSL_CTX_�t_���_CA_li� +( +SSL_CTX + * +�x +, +STACK_OF +( +X509_NAME +�* +�me_li� +); + +1920 +STACK_OF +( +X509_NAME +�* +SSL_g�_���_CA_li� +(cڡ +SSL + * +s +); + +1921 +STACK_OF +( +X509_NAME +�* +SSL_CTX_g�_���_CA_li� +(cڡ +SSL_CTX + * +s +); + +1922 +SSL_add_���_CA +( +SSL + * +s� +, +X509 + * +x +); + +1923 +SSL_CTX_add_���_CA +( +SSL_CTX + * +�x +, +X509 + * +x +); + +1925 +SSL_�t_c���_��e +( +SSL + * +s +); + +1926 +SSL_�t_ac��_��e +( +SSL + * +s +); + +1928 +SSL_g�_de�u�_timeout +(cڡ +SSL + * +s +); + +1930 +SSL_lib�ry_�� +(); + +1932 * +SSL_CIPHER_des��ti� +(cڡ +SSL_CIPHER + *,* +buf +, +size +); + +1933 +STACK_OF +( +X509_NAME +�* +SSL_dup_CA_li� +(STACK_OF(X509_NAME�* +sk +); + +1935 +SSL + * +SSL_dup +(SSL * +s� +); + +1937 +X509 + * +SSL_g�_��ifi�� +(cڡ +SSL + * +s� +); + +1938 +evp_pkey_� + * +SSL_g�_�iv�ekey +( +SSL + * +s� +); + +1940 +SSL_CTX_�t_qu�t_shutdown +( +SSL_CTX + * +�x +, +mode +); + +1941 +SSL_CTX_g�_qu�t_shutdown +(cڡ +SSL_CTX + * +�x +); + +1942 +SSL_�t_qu�t_shutdown +( +SSL + * +s� +, +mode +); + +1943 +SSL_g�_qu�t_shutdown +(cڡ +SSL + * +s� +); + +1944 +SSL_�t_shutdown +( +SSL + * +s� +, +mode +); + +1945 +SSL_g�_shutdown +(cڡ +SSL + * +s� +); + +1946 +SSL_v�si� +(cڡ +SSL + * +s� +); + +1947 +SSL_CTX_�t_de�u�_v�ify_�ths +( +SSL_CTX + * +�x +); + +1948 +SSL_CTX_l�d_v�ify_lo�ti�s +( +SSL_CTX + * +�x +, cڡ * +CAf�e +, + +1949 cڡ * +CA�th +); + +1950 + #SSL_g�0_�ssi� + +SSL_g�_�ssi� + + + ) + +1951 +SSL_SESSION + * +SSL_g�_�ssi� +(cڡ +SSL + * +s� +); + +1952 +SSL_SESSION + * +SSL_g�1_�ssi� +( +SSL + * +s� +); + +1953 +SSL_CTX + * +SSL_g�_SSL_CTX +(cڡ +SSL + * +s� +); + +1954 +SSL_CTX + * +SSL_�t_SSL_CTX +( +SSL + * +s� +, SSL_CTX* +�x +); + +1955 +SSL_�t_�fo_��back +( +SSL + * +s� +, + +1956 (* +cb +)(cڡ +SSL + * +s� +, +ty� +, +v� +)); + +1957 (* +SSL_g�_�fo_��back +(cڡ +SSL + * +s� +))(cڡ SSL *s�, +ty� +, +v� +); + +1958 +SSL_��e +(cڡ +SSL + * +s� +); + +1959 +SSL_�t_��e +( +SSL + * +s� +, +��e +); + +1961 +SSL_�t_v�ify_�su� +( +SSL + * +s� +, +v +); + +1962 +SSL_g�_v�ify_�su� +(cڡ +SSL + * +s� +); + +1964 +SSL_�t_ex_d�a +( +SSL + * +s� +, +idx +,* +d�a +); + +1965 * +SSL_g�_ex_d�a +(cڡ +SSL + * +s� +, +idx +); + +1966 +SSL_g�_ex_�w_�dex +( +�gl +, * +�gp +, +CRYPTO_EX_�w + * +�w_func +, + +1967 +CRYPTO_EX_dup + * +dup_func +, +CRYPTO_EX_� + * +�_func +); + +1969 +SSL_SESSION_�t_ex_d�a +( +SSL_SESSION + * +ss +, +idx +,* +d�a +); + +1970 * +SSL_SESSION_g�_ex_d�a +(cڡ +SSL_SESSION + * +ss +, +idx +); + +1971 +SSL_SESSION_g�_ex_�w_�dex +( +�gl +, * +�gp +, +CRYPTO_EX_�w + * +�w_func +, + +1972 +CRYPTO_EX_dup + * +dup_func +, +CRYPTO_EX_� + * +�_func +); + +1974 +SSL_CTX_�t_ex_d�a +( +SSL_CTX + * +s� +, +idx +,* +d�a +); + +1975 * +SSL_CTX_g�_ex_d�a +(cڡ +SSL_CTX + * +s� +, +idx +); + +1976 +SSL_CTX_g�_ex_�w_�dex +( +�gl +, * +�gp +, +CRYPTO_EX_�w + * +�w_func +, + +1977 +CRYPTO_EX_dup + * +dup_func +, +CRYPTO_EX_� + * +�_func +); + +1979 +SSL_g�_ex_d�a_X509_STORE_CTX_idx +(); + +1981 + #SSL_CTX_�ss_�t_�che_size +( +�x +, +t +) \ + +1982 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SET_SESS_CACHE_SIZE +, +t +, +NULL +) + + ) + +1983 + #SSL_CTX_�ss_g�_�che_size +( +�x +) \ + +1984 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_GET_SESS_CACHE_SIZE +,0, +NULL +) + + ) + +1985 + #SSL_CTX_�t_�ssi�_�che_mode +( +�x +, +m +) \ + +1986 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SET_SESS_CACHE_MODE +, +m +, +NULL +) + + ) + +1987 + #SSL_CTX_g�_�ssi�_�che_mode +( +�x +) \ + +1988 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_GET_SESS_CACHE_MODE +,0, +NULL +) + + ) + +1990 + #SSL_CTX_g�_de�u�_�ad_ah�d +( +�x +� + `SSL_CTX_g�_�ad_ah�d +(�x) + + ) + +1991 + #SSL_CTX_�t_de�u�_�ad_ah�d +( +�x +, +m +� + `SSL_CTX_�t_�ad_ah�d +(�x,m) + + ) + +1992 + #SSL_CTX_g�_�ad_ah�d +( +�x +) \ + +1993 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_GET_READ_AHEAD +,0, +NULL +) + + ) + +1994 + #SSL_CTX_�t_�ad_ah�d +( +�x +, +m +) \ + +1995 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SET_READ_AHEAD +, +m +, +NULL +) + + ) + +1996 + #SSL_CTX_g�_max_��_li� +( +�x +) \ + +1997 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_GET_MAX_CERT_LIST +,0, +NULL +) + + ) + +1998 + #SSL_CTX_�t_max_��_li� +( +�x +, +m +) \ + +1999 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SET_MAX_CERT_LIST +, +m +, +NULL +) + + ) + +2000 + #SSL_g�_max_��_li� +( +s� +) \ + +2001 + `SSL_�� +( +s� +, +SSL_CTRL_GET_MAX_CERT_LIST +,0, +NULL +) + + ) + +2002 + #SSL_�t_max_��_li� +( +s� +, +m +) \ + +2003 + `SSL_�� +( +s� +, +SSL_CTRL_SET_MAX_CERT_LIST +, +m +, +NULL +) + + ) + +2005 + #SSL_CTX_�t_max_�nd_�agm�t +( +�x +, +m +) \ + +2006 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SET_MAX_SEND_FRAGMENT +, +m +, +NULL +) + + ) + +2007 + #SSL_�t_max_�nd_�agm�t +( +s� +, +m +) \ + +2008 + `SSL_�� +( +s� +, +SSL_CTRL_SET_MAX_SEND_FRAGMENT +, +m +, +NULL +) + + ) + +2011 #i�de� +OPENSSL_NO_RSA + + +2012 +SSL_CTX_�t_tmp_r�_��back +( +SSL_CTX + * +�x +, + +2013 +RSA + *(* +cb +)( +SSL + * +s� +, +is_exp�t +, + +2014 +key�ngth +)); + +2016 +SSL_�t_tmp_r�_��back +( +SSL + * +s� +, + +2017 +RSA + *(* +cb +)( +SSL + * +s� +, +is_exp�t +, + +2018 +key�ngth +)); + +2020 #i�de� +OPENSSL_NO_DH + + +2021 +SSL_CTX_�t_tmp_dh_��back +( +SSL_CTX + * +�x +, + +2022 +DH + *(* +dh +)( +SSL + * +s� +, +is_exp�t +, + +2023 +key�ngth +)); + +2024 +SSL_�t_tmp_dh_��back +( +SSL + * +s� +, + +2025 +DH + *(* +dh +)( +SSL + * +s� +, +is_exp�t +, + +2026 +key�ngth +)); + +2028 #i�de� +OPENSSL_NO_ECDH + + +2029 +SSL_CTX_�t_tmp_ecdh_��back +( +SSL_CTX + * +�x +, + +2030 +EC_KEY + *(* +ecdh +)( +SSL + * +s� +, +is_exp�t +, + +2031 +key�ngth +)); + +2032 +SSL_�t_tmp_ecdh_��back +( +SSL + * +s� +, + +2033 +EC_KEY + *(* +ecdh +)( +SSL + * +s� +, +is_exp�t +, + +2034 +key�ngth +)); + +2037 #i�de� +OPENSSL_NO_COMP + + +2038 cڡ +COMP_METHOD + * +SSL_g�_cu��t_com�essi� +( +SSL + * +s +); + +2039 cڡ +COMP_METHOD + * +SSL_g�_cu��t_ex�nsi� +( +SSL + * +s +); + +2040 cڡ * +SSL_COMP_g�_�me +(cڡ +COMP_METHOD + * +comp +); + +2041 +STACK_OF +( +SSL_COMP +�* +SSL_COMP_g�_com�essi�_m�hods +(); + +2042 +SSL_COMP_add_com�essi�_m�hod +( +id +, +COMP_METHOD + * +cm +); + +2044 cڡ * +SSL_g�_cu��t_com�essi� +( +SSL + * +s +); + +2045 cڡ * +SSL_g�_cu��t_ex�nsi� +( +SSL + * +s +); + +2046 cڡ * +SSL_COMP_g�_�me +(cڡ * +comp +); + +2047 * +SSL_COMP_g�_com�essi�_m�hods +(); + +2048 +SSL_COMP_add_com�essi�_m�hod +( +id +,* +cm +); + +2052 +SSL_�t_�ssi�_tick�_ext +( +SSL + * +s +, * +ext_d�a +, +ext_�n +); + +2054 +SSL_�t_�ssi�_tick�_ext_cb +( +SSL + * +s +, +�s_�ssi�_tick�_ext_cb_� + +cb +, + +2055 * +�g +); + +2058 +SSL_�t_�ssi�_���_cb +( +SSL + * +s +, +�s_�ssi�_���_cb_� + +�s_�ssi�_���_cb +, * +�g +); + +2060 +SSL_�t_debug +( +SSL + * +s +, +debug +); + +2061 +SSL_�che_h� +( +SSL + * +s +); + +2067 +ERR_l�d_SSL_�r�gs +(); + +2072 + #SSL_F_CLIENT_CERTIFICATE + 100 + + ) + +2073 + #SSL_F_CLIENT_FINISHED + 167 + + ) + +2074 + #SSL_F_CLIENT_HELLO + 101 + + ) + +2075 + #SSL_F_CLIENT_MASTER_KEY + 102 + + ) + +2076 + #SSL_F_D2I_SSL_SESSION + 103 + + ) + +2077 + #SSL_F_DO_DTLS1_WRITE + 245 + + ) + +2078 + #SSL_F_DO_SSL3_WRITE + 104 + + ) + +2079 + #SSL_F_DTLS1_ACCEPT + 246 + + ) + +2080 + #SSL_F_DTLS1_ADD_CERT_TO_BUF + 295 + + ) + +2081 + #SSL_F_DTLS1_BUFFER_RECORD + 247 + + ) + +2082 + #SSL_F_DTLS1_CHECK_TIMEOUT_NUM + 316 + + ) + +2083 + #SSL_F_DTLS1_CLIENT_HELLO + 248 + + ) + +2084 + #SSL_F_DTLS1_CONNECT + 249 + + ) + +2085 + #SSL_F_DTLS1_ENC + 250 + + ) + +2086 + #SSL_F_DTLS1_GET_HELLO_VERIFY + 251 + + ) + +2087 + #SSL_F_DTLS1_GET_MESSAGE + 252 + + ) + +2088 + #SSL_F_DTLS1_GET_MESSAGE_FRAGMENT + 253 + + ) + +2089 + #SSL_F_DTLS1_GET_RECORD + 254 + + ) + +2090 + #SSL_F_DTLS1_HANDLE_TIMEOUT + 297 + + ) + +2091 + #SSL_F_DTLS1_HEARTBEAT + 305 + + ) + +2092 + #SSL_F_DTLS1_OUTPUT_CERT_CHAIN + 255 + + ) + +2093 + #SSL_F_DTLS1_PREPROCESS_FRAGMENT + 288 + + ) + +2094 + #SSL_F_DTLS1_PROCESS_BUFFERED_RECORDS + 424 + + ) + +2095 + #SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE + 256 + + ) + +2096 + #SSL_F_DTLS1_PROCESS_RECORD + 257 + + ) + +2097 + #SSL_F_DTLS1_READ_BYTES + 258 + + ) + +2098 + #SSL_F_DTLS1_READ_FAILED + 259 + + ) + +2099 + #SSL_F_DTLS1_SEND_CERTIFICATE_REQUEST + 260 + + ) + +2100 + #SSL_F_DTLS1_SEND_CLIENT_CERTIFICATE + 261 + + ) + +2101 + #SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE + 262 + + ) + +2102 + #SSL_F_DTLS1_SEND_CLIENT_VERIFY + 263 + + ) + +2103 + #SSL_F_DTLS1_SEND_HELLO_VERIFY_REQUEST + 264 + + ) + +2104 + #SSL_F_DTLS1_SEND_SERVER_CERTIFICATE + 265 + + ) + +2105 + #SSL_F_DTLS1_SEND_SERVER_HELLO + 266 + + ) + +2106 + #SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE + 267 + + ) + +2107 + #SSL_F_DTLS1_WRITE_APP_DATA_BYTES + 268 + + ) + +2108 + #SSL_F_GET_CLIENT_FINISHED + 105 + + ) + +2109 + #SSL_F_GET_CLIENT_HELLO + 106 + + ) + +2110 + #SSL_F_GET_CLIENT_MASTER_KEY + 107 + + ) + +2111 + #SSL_F_GET_SERVER_FINISHED + 108 + + ) + +2112 + #SSL_F_GET_SERVER_HELLO + 109 + + ) + +2113 + #SSL_F_GET_SERVER_VERIFY + 110 + + ) + +2114 + #SSL_F_I2D_SSL_SESSION + 111 + + ) + +2115 + #SSL_F_READ_N + 112 + + ) + +2116 + #SSL_F_REQUEST_CERTIFICATE + 113 + + ) + +2117 + #SSL_F_SERVER_FINISH + 239 + + ) + +2118 + #SSL_F_SERVER_HELLO + 114 + + ) + +2119 + #SSL_F_SERVER_VERIFY + 240 + + ) + +2120 + #SSL_F_SSL23_ACCEPT + 115 + + ) + +2121 + #SSL_F_SSL23_CLIENT_HELLO + 116 + + ) + +2122 + #SSL_F_SSL23_CONNECT + 117 + + ) + +2123 + #SSL_F_SSL23_GET_CLIENT_HELLO + 118 + + ) + +2124 + #SSL_F_SSL23_GET_SERVER_HELLO + 119 + + ) + +2125 + #SSL_F_SSL23_PEEK + 237 + + ) + +2126 + #SSL_F_SSL23_READ + 120 + + ) + +2127 + #SSL_F_SSL23_WRITE + 121 + + ) + +2128 + #SSL_F_SSL2_ACCEPT + 122 + + ) + +2129 + #SSL_F_SSL2_CONNECT + 123 + + ) + +2130 + #SSL_F_SSL2_ENC_INIT + 124 + + ) + +2131 + #SSL_F_SSL2_GENERATE_KEY_MATERIAL + 241 + + ) + +2132 + #SSL_F_SSL2_PEEK + 234 + + ) + +2133 + #SSL_F_SSL2_READ + 125 + + ) + +2134 + #SSL_F_SSL2_READ_INTERNAL + 236 + + ) + +2135 + #SSL_F_SSL2_SET_CERTIFICATE + 126 + + ) + +2136 + #SSL_F_SSL2_WRITE + 127 + + ) + +2137 + #SSL_F_SSL3_ACCEPT + 128 + + ) + +2138 + #SSL_F_SSL3_ADD_CERT_TO_BUF + 296 + + ) + +2139 + #SSL_F_SSL3_CALLBACK_CTRL + 233 + + ) + +2140 + #SSL_F_SSL3_CHANGE_CIPHER_STATE + 129 + + ) + +2141 + #SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM + 130 + + ) + +2142 + #SSL_F_SSL3_CHECK_CLIENT_HELLO + 304 + + ) + +2143 + #SSL_F_SSL3_CLIENT_HELLO + 131 + + ) + +2144 + #SSL_F_SSL3_CONNECT + 132 + + ) + +2145 + #SSL_F_SSL3_CTRL + 213 + + ) + +2146 + #SSL_F_SSL3_CTX_CTRL + 133 + + ) + +2147 + #SSL_F_SSL3_DIGEST_CACHED_RECORDS + 293 + + ) + +2148 + #SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC + 292 + + ) + +2149 + #SSL_F_SSL3_ENC + 134 + + ) + +2150 + #SSL_F_SSL3_GENERATE_KEY_BLOCK + 238 + + ) + +2151 + #SSL_F_SSL3_GET_CERTIFICATE_REQUEST + 135 + + ) + +2152 + #SSL_F_SSL3_GET_CERT_STATUS + 289 + + ) + +2153 + #SSL_F_SSL3_GET_CERT_VERIFY + 136 + + ) + +2154 + #SSL_F_SSL3_GET_CLIENT_CERTIFICATE + 137 + + ) + +2155 + #SSL_F_SSL3_GET_CLIENT_HELLO + 138 + + ) + +2156 + #SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE + 139 + + ) + +2157 + #SSL_F_SSL3_GET_FINISHED + 140 + + ) + +2158 + #SSL_F_SSL3_GET_KEY_EXCHANGE + 141 + + ) + +2159 + #SSL_F_SSL3_GET_MESSAGE + 142 + + ) + +2160 + #SSL_F_SSL3_GET_NEW_SESSION_TICKET + 283 + + ) + +2161 + #SSL_F_SSL3_GET_NEXT_PROTO + 306 + + ) + +2162 + #SSL_F_SSL3_GET_RECORD + 143 + + ) + +2163 + #SSL_F_SSL3_GET_SERVER_CERTIFICATE + 144 + + ) + +2164 + #SSL_F_SSL3_GET_SERVER_DONE + 145 + + ) + +2165 + #SSL_F_SSL3_GET_SERVER_HELLO + 146 + + ) + +2166 + #SSL_F_SSL3_HANDSHAKE_MAC + 285 + + ) + +2167 + #SSL_F_SSL3_NEW_SESSION_TICKET + 287 + + ) + +2168 + #SSL_F_SSL3_OUTPUT_CERT_CHAIN + 147 + + ) + +2169 + #SSL_F_SSL3_PEEK + 235 + + ) + +2170 + #SSL_F_SSL3_READ_BYTES + 148 + + ) + +2171 + #SSL_F_SSL3_READ_N + 149 + + ) + +2172 + #SSL_F_SSL3_SEND_CERTIFICATE_REQUEST + 150 + + ) + +2173 + #SSL_F_SSL3_SEND_CLIENT_CERTIFICATE + 151 + + ) + +2174 + #SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE + 152 + + ) + +2175 + #SSL_F_SSL3_SEND_CLIENT_VERIFY + 153 + + ) + +2176 + #SSL_F_SSL3_SEND_SERVER_CERTIFICATE + 154 + + ) + +2177 + #SSL_F_SSL3_SEND_SERVER_HELLO + 242 + + ) + +2178 + #SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE + 155 + + ) + +2179 + #SSL_F_SSL3_SETUP_KEY_BLOCK + 157 + + ) + +2180 + #SSL_F_SSL3_SETUP_READ_BUFFER + 156 + + ) + +2181 + #SSL_F_SSL3_SETUP_WRITE_BUFFER + 291 + + ) + +2182 + #SSL_F_SSL3_WRITE_BYTES + 158 + + ) + +2183 + #SSL_F_SSL3_WRITE_PENDING + 159 + + ) + +2184 + #SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT + 298 + + ) + +2185 + #SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT + 277 + + ) + +2186 + #SSL_F_SSL_ADD_CLIENTHELLO_USE_SRTP_EXT + 307 + + ) + +2187 + #SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK + 215 + + ) + +2188 + #SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK + 216 + + ) + +2189 + #SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT + 299 + + ) + +2190 + #SSL_F_SSL_ADD_SERVERHELLO_TLSEXT + 278 + + ) + +2191 + #SSL_F_SSL_ADD_SERVERHELLO_USE_SRTP_EXT + 308 + + ) + +2192 + #SSL_F_SSL_BAD_METHOD + 160 + + ) + +2193 + #SSL_F_SSL_BYTES_TO_CIPHER_LIST + 161 + + ) + +2194 + #SSL_F_SSL_CERT_DUP + 221 + + ) + +2195 + #SSL_F_SSL_CERT_INST + 222 + + ) + +2196 + #SSL_F_SSL_CERT_INSTANTIATE + 214 + + ) + +2197 + #SSL_F_SSL_CERT_NEW + 162 + + ) + +2198 + #SSL_F_SSL_CHECK_PRIVATE_KEY + 163 + + ) + +2199 + #SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT + 280 + + ) + +2200 + #SSL_F_SSL_CHECK_SRVR_ECC_CERT_AND_ALG + 279 + + ) + +2201 + #SSL_F_SSL_CIPHER_PROCESS_RULESTR + 230 + + ) + +2202 + #SSL_F_SSL_CIPHER_STRENGTH_SORT + 231 + + ) + +2203 + #SSL_F_SSL_CLEAR + 164 + + ) + +2204 + #SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD + 165 + + ) + +2205 + #SSL_F_SSL_CREATE_CIPHER_LIST + 166 + + ) + +2206 + #SSL_F_SSL_CTRL + 232 + + ) + +2207 + #SSL_F_SSL_CTX_CHECK_PRIVATE_KEY + 168 + + ) + +2208 + #SSL_F_SSL_CTX_MAKE_PROFILES + 309 + + ) + +2209 + #SSL_F_SSL_CTX_NEW + 169 + + ) + +2210 + #SSL_F_SSL_CTX_SET_CIPHER_LIST + 269 + + ) + +2211 + #SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE + 290 + + ) + +2212 + #SSL_F_SSL_CTX_SET_PURPOSE + 226 + + ) + +2213 + #SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT + 219 + + ) + +2214 + #SSL_F_SSL_CTX_SET_SSL_VERSION + 170 + + ) + +2215 + #SSL_F_SSL_CTX_SET_TRUST + 229 + + ) + +2216 + #SSL_F_SSL_CTX_USE_CERTIFICATE + 171 + + ) + +2217 + #SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1 + 172 + + ) + +2218 + #SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE + 220 + + ) + +2219 + #SSL_F_SSL_CTX_USE_CERTIFICATE_FILE + 173 + + ) + +2220 + #SSL_F_SSL_CTX_USE_PRIVATEKEY + 174 + + ) + +2221 + #SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1 + 175 + + ) + +2222 + #SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE + 176 + + ) + +2223 + #SSL_F_SSL_CTX_USE_PSK_IDENTITY_HINT + 272 + + ) + +2224 + #SSL_F_SSL_CTX_USE_RSAPRIVATEKEY + 177 + + ) + +2225 + #SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1 + 178 + + ) + +2226 + #SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE + 179 + + ) + +2227 + #SSL_F_SSL_DO_HANDSHAKE + 180 + + ) + +2228 + #SSL_F_SSL_GET_NEW_SESSION + 181 + + ) + +2229 + #SSL_F_SSL_GET_PREV_SESSION + 217 + + ) + +2230 + #SSL_F_SSL_GET_SERVER_SEND_CERT + 182 + + ) + +2231 + #SSL_F_SSL_GET_SERVER_SEND_PKEY + 317 + + ) + +2232 + #SSL_F_SSL_GET_SIGN_PKEY + 183 + + ) + +2233 + #SSL_F_SSL_INIT_WBIO_BUFFER + 184 + + ) + +2234 + #SSL_F_SSL_LOAD_CLIENT_CA_FILE + 185 + + ) + +2235 + #SSL_F_SSL_NEW + 186 + + ) + +2236 + #SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT + 300 + + ) + +2237 + #SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT + 302 + + ) + +2238 + #SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT + 310 + + ) + +2239 + #SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT + 301 + + ) + +2240 + #SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT + 303 + + ) + +2241 + #SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT + 311 + + ) + +2242 + #SSL_F_SSL_PEEK + 270 + + ) + +2243 + #SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT + 281 + + ) + +2244 + #SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT + 282 + + ) + +2245 + #SSL_F_SSL_READ + 223 + + ) + +2246 + #SSL_F_SSL_RSA_PRIVATE_DECRYPT + 187 + + ) + +2247 + #SSL_F_SSL_RSA_PUBLIC_ENCRYPT + 188 + + ) + +2248 + #SSL_F_SSL_SESSION_DUP + 348 + + ) + +2249 + #SSL_F_SSL_SESSION_NEW + 189 + + ) + +2250 + #SSL_F_SSL_SESSION_PRINT_FP + 190 + + ) + +2251 + #SSL_F_SSL_SESSION_SET1_ID_CONTEXT + 312 + + ) + +2252 + #SSL_F_SSL_SESS_CERT_NEW + 225 + + ) + +2253 + #SSL_F_SSL_SET_CERT + 191 + + ) + +2254 + #SSL_F_SSL_SET_CIPHER_LIST + 271 + + ) + +2255 + #SSL_F_SSL_SET_FD + 192 + + ) + +2256 + #SSL_F_SSL_SET_PKEY + 193 + + ) + +2257 + #SSL_F_SSL_SET_PURPOSE + 227 + + ) + +2258 + #SSL_F_SSL_SET_RFD + 194 + + ) + +2259 + #SSL_F_SSL_SET_SESSION + 195 + + ) + +2260 + #SSL_F_SSL_SET_SESSION_ID_CONTEXT + 218 + + ) + +2261 + #SSL_F_SSL_SET_SESSION_TICKET_EXT + 294 + + ) + +2262 + #SSL_F_SSL_SET_TRUST + 228 + + ) + +2263 + #SSL_F_SSL_SET_WFD + 196 + + ) + +2264 + #SSL_F_SSL_SHUTDOWN + 224 + + ) + +2265 + #SSL_F_SSL_SRP_CTX_INIT + 313 + + ) + +2266 + #SSL_F_SSL_UNDEFINED_CONST_FUNCTION + 243 + + ) + +2267 + #SSL_F_SSL_UNDEFINED_FUNCTION + 197 + + ) + +2268 + #SSL_F_SSL_UNDEFINED_VOID_FUNCTION + 244 + + ) + +2269 + #SSL_F_SSL_USE_CERTIFICATE + 198 + + ) + +2270 + #SSL_F_SSL_USE_CERTIFICATE_ASN1 + 199 + + ) + +2271 + #SSL_F_SSL_USE_CERTIFICATE_FILE + 200 + + ) + +2272 + #SSL_F_SSL_USE_PRIVATEKEY + 201 + + ) + +2273 + #SSL_F_SSL_USE_PRIVATEKEY_ASN1 + 202 + + ) + +2274 + #SSL_F_SSL_USE_PRIVATEKEY_FILE + 203 + + ) + +2275 + #SSL_F_SSL_USE_PSK_IDENTITY_HINT + 273 + + ) + +2276 + #SSL_F_SSL_USE_RSAPRIVATEKEY + 204 + + ) + +2277 + #SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1 + 205 + + ) + +2278 + #SSL_F_SSL_USE_RSAPRIVATEKEY_FILE + 206 + + ) + +2279 + #SSL_F_SSL_VERIFY_CERT_CHAIN + 207 + + ) + +2280 + #SSL_F_SSL_WRITE + 208 + + ) + +2281 + #SSL_F_TLS1_CERT_VERIFY_MAC + 286 + + ) + +2282 + #SSL_F_TLS1_CHANGE_CIPHER_STATE + 209 + + ) + +2283 + #SSL_F_TLS1_CHECK_SERVERHELLO_TLSEXT + 274 + + ) + +2284 + #SSL_F_TLS1_ENC + 210 + + ) + +2285 + #SSL_F_TLS1_EXPORT_KEYING_MATERIAL + 314 + + ) + +2286 + #SSL_F_TLS1_HEARTBEAT + 315 + + ) + +2287 + #SSL_F_TLS1_PREPARE_CLIENTHELLO_TLSEXT + 275 + + ) + +2288 + #SSL_F_TLS1_PREPARE_SERVERHELLO_TLSEXT + 276 + + ) + +2289 + #SSL_F_TLS1_PRF + 284 + + ) + +2290 + #SSL_F_TLS1_SETUP_KEY_BLOCK + 211 + + ) + +2291 + #SSL_F_WRITE_PENDING + 212 + + ) + +2294 + #SSL_R_APP_DATA_IN_HANDSHAKE + 100 + + ) + +2295 + #SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT + 272 + + ) + +2296 + #SSL_R_BAD_ALERT_RECORD + 101 + + ) + +2297 + #SSL_R_BAD_AUTHENTICATION_TYPE + 102 + + ) + +2298 + #SSL_R_BAD_CHANGE_CIPHER_SPEC + 103 + + ) + +2299 + #SSL_R_BAD_CHECKSUM + 104 + + ) + +2300 + #SSL_R_BAD_DATA_RETURNED_BY_CALLBACK + 106 + + ) + +2301 + #SSL_R_BAD_DECOMPRESSION + 107 + + ) + +2302 + #SSL_R_BAD_DH_G_LENGTH + 108 + + ) + +2303 + #SSL_R_BAD_DH_PUB_KEY_LENGTH + 109 + + ) + +2304 + #SSL_R_BAD_DH_P_LENGTH + 110 + + ) + +2305 + #SSL_R_BAD_DIGEST_LENGTH + 111 + + ) + +2306 + #SSL_R_BAD_DSA_SIGNATURE + 112 + + ) + +2307 + #SSL_R_BAD_ECC_CERT + 304 + + ) + +2308 + #SSL_R_BAD_ECDSA_SIGNATURE + 305 + + ) + +2309 + #SSL_R_BAD_ECPOINT + 306 + + ) + +2310 + #SSL_R_BAD_HANDSHAKE_LENGTH + 332 + + ) + +2311 + #SSL_R_BAD_HELLO_REQUEST + 105 + + ) + +2312 + #SSL_R_BAD_LENGTH + 271 + + ) + +2313 + #SSL_R_BAD_MAC_DECODE + 113 + + ) + +2314 + #SSL_R_BAD_MAC_LENGTH + 333 + + ) + +2315 + #SSL_R_BAD_MESSAGE_TYPE + 114 + + ) + +2316 + #SSL_R_BAD_PACKET_LENGTH + 115 + + ) + +2317 + #SSL_R_BAD_PROTOCOL_VERSION_NUMBER + 116 + + ) + +2318 + #SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH + 316 + + ) + +2319 + #SSL_R_BAD_RESPONSE_ARGUMENT + 117 + + ) + +2320 + #SSL_R_BAD_RSA_DECRYPT + 118 + + ) + +2321 + #SSL_R_BAD_RSA_ENCRYPT + 119 + + ) + +2322 + #SSL_R_BAD_RSA_E_LENGTH + 120 + + ) + +2323 + #SSL_R_BAD_RSA_MODULUS_LENGTH + 121 + + ) + +2324 + #SSL_R_BAD_RSA_SIGNATURE + 122 + + ) + +2325 + #SSL_R_BAD_SIGNATURE + 123 + + ) + +2326 + #SSL_R_BAD_SRP_A_LENGTH + 347 + + ) + +2327 + #SSL_R_BAD_SRP_B_LENGTH + 348 + + ) + +2328 + #SSL_R_BAD_SRP_G_LENGTH + 349 + + ) + +2329 + #SSL_R_BAD_SRP_N_LENGTH + 350 + + ) + +2330 + #SSL_R_BAD_SRP_S_LENGTH + 351 + + ) + +2331 + #SSL_R_BAD_SRTP_MKI_VALUE + 352 + + ) + +2332 + #SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST + 353 + + ) + +2333 + #SSL_R_BAD_SSL_FILETYPE + 124 + + ) + +2334 + #SSL_R_BAD_SSL_SESSION_ID_LENGTH + 125 + + ) + +2335 + #SSL_R_BAD_STATE + 126 + + ) + +2336 + #SSL_R_BAD_WRITE_RETRY + 127 + + ) + +2337 + #SSL_R_BIO_NOT_SET + 128 + + ) + +2338 + #SSL_R_BLOCK_CIPHER_PAD_IS_WRONG + 129 + + ) + +2339 + #SSL_R_BN_LIB + 130 + + ) + +2340 + #SSL_R_CA_DN_LENGTH_MISMATCH + 131 + + ) + +2341 + #SSL_R_CA_DN_TOO_LONG + 132 + + ) + +2342 + #SSL_R_CCS_RECEIVED_EARLY + 133 + + ) + +2343 + #SSL_R_CERTIFICATE_VERIFY_FAILED + 134 + + ) + +2344 + #SSL_R_CERT_LENGTH_MISMATCH + 135 + + ) + +2345 + #SSL_R_CHALLENGE_IS_DIFFERENT + 136 + + ) + +2346 + #SSL_R_CIPHER_CODE_WRONG_LENGTH + 137 + + ) + +2347 + #SSL_R_CIPHER_OR_HASH_UNAVAILABLE + 138 + + ) + +2348 + #SSL_R_CIPHER_TABLE_SRC_ERROR + 139 + + ) + +2349 + #SSL_R_CLIENTHELLO_TLSEXT + 226 + + ) + +2350 + #SSL_R_COMPRESSED_LENGTH_TOO_LONG + 140 + + ) + +2351 + #SSL_R_COMPRESSION_DISABLED + 343 + + ) + +2352 + #SSL_R_COMPRESSION_FAILURE + 141 + + ) + +2353 + #SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE + 307 + + ) + +2354 + #SSL_R_COMPRESSION_LIBRARY_ERROR + 142 + + ) + +2355 + #SSL_R_CONNECTION_ID_IS_DIFFERENT + 143 + + ) + +2356 + #SSL_R_CONNECTION_TYPE_NOT_SET + 144 + + ) + +2357 + #SSL_R_COOKIE_MISMATCH + 308 + + ) + +2358 + #SSL_R_DATA_BETWEEN_CCS_AND_FINISHED + 145 + + ) + +2359 + #SSL_R_DATA_LENGTH_TOO_LONG + 146 + + ) + +2360 + #SSL_R_DECRYPTION_FAILED + 147 + + ) + +2361 + #SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC + 281 + + ) + +2362 + #SSL_R_DH_KEY_TOO_SMALL + 372 + + ) + +2363 + #SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG + 148 + + ) + +2364 + #SSL_R_DIGEST_CHECK_FAILED + 149 + + ) + +2365 + #SSL_R_DTLS_MESSAGE_TOO_BIG + 334 + + ) + +2366 + #SSL_R_DUPLICATE_COMPRESSION_ID + 309 + + ) + +2367 + #SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT + 317 + + ) + +2368 + #SSL_R_ECC_CERT_NOT_FOR_SIGNING + 318 + + ) + +2369 + #SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE + 322 + + ) + +2370 + #SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE + 323 + + ) + +2371 + #SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER + 310 + + ) + +2372 + #SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST + 354 + + ) + +2373 + #SSL_R_ENCRYPTED_LENGTH_TOO_LONG + 150 + + ) + +2374 + #SSL_R_ERROR_GENERATING_TMP_RSA_KEY + 282 + + ) + +2375 + #SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST + 151 + + ) + +2376 + #SSL_R_EXCESSIVE_MESSAGE_SIZE + 152 + + ) + +2377 + #SSL_R_EXTRA_DATA_IN_MESSAGE + 153 + + ) + +2378 + #SSL_R_GOT_A_FIN_BEFORE_A_CCS + 154 + + ) + +2379 + #SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS + 355 + + ) + +2380 + #SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION + 356 + + ) + +2381 + #SSL_R_HTTPS_PROXY_REQUEST + 155 + + ) + +2382 + #SSL_R_HTTP_REQUEST + 156 + + ) + +2383 + #SSL_R_ILLEGAL_PADDING + 283 + + ) + +2384 + #SSL_R_INAPPROPRIATE_FALLBACK + 373 + + ) + +2385 + #SSL_R_INCONSISTENT_COMPRESSION + 340 + + ) + +2386 + #SSL_R_INVALID_CHALLENGE_LENGTH + 158 + + ) + +2387 + #SSL_R_INVALID_COMMAND + 280 + + ) + +2388 + #SSL_R_INVALID_COMPRESSION_ALGORITHM + 341 + + ) + +2389 + #SSL_R_INVALID_PURPOSE + 278 + + ) + +2390 + #SSL_R_INVALID_SRP_USERNAME + 357 + + ) + +2391 + #SSL_R_INVALID_STATUS_RESPONSE + 328 + + ) + +2392 + #SSL_R_INVALID_TICKET_KEYS_LENGTH + 325 + + ) + +2393 + #SSL_R_INVALID_TRUST + 279 + + ) + +2394 + #SSL_R_KEY_ARG_TOO_LONG + 284 + + ) + +2395 + #SSL_R_KRB5 + 285 + + ) + +2396 + #SSL_R_KRB5_C_CC_PRINC + 286 + + ) + +2397 + #SSL_R_KRB5_C_GET_CRED + 287 + + ) + +2398 + #SSL_R_KRB5_C_INIT + 288 + + ) + +2399 + #SSL_R_KRB5_C_MK_REQ + 289 + + ) + +2400 + #SSL_R_KRB5_S_BAD_TICKET + 290 + + ) + +2401 + #SSL_R_KRB5_S_INIT + 291 + + ) + +2402 + #SSL_R_KRB5_S_RD_REQ + 292 + + ) + +2403 + #SSL_R_KRB5_S_TKT_EXPIRED + 293 + + ) + +2404 + #SSL_R_KRB5_S_TKT_NYV + 294 + + ) + +2405 + #SSL_R_KRB5_S_TKT_SKEW + 295 + + ) + +2406 + #SSL_R_LENGTH_MISMATCH + 159 + + ) + +2407 + #SSL_R_LENGTH_TOO_SHORT + 160 + + ) + +2408 + #SSL_R_LIBRARY_BUG + 274 + + ) + +2409 + #SSL_R_LIBRARY_HAS_NO_CIPHERS + 161 + + ) + +2410 + #SSL_R_MESSAGE_TOO_LONG + 296 + + ) + +2411 + #SSL_R_MISSING_DH_DSA_CERT + 162 + + ) + +2412 + #SSL_R_MISSING_DH_KEY + 163 + + ) + +2413 + #SSL_R_MISSING_DH_RSA_CERT + 164 + + ) + +2414 + #SSL_R_MISSING_DSA_SIGNING_CERT + 165 + + ) + +2415 + #SSL_R_MISSING_EXPORT_TMP_DH_KEY + 166 + + ) + +2416 + #SSL_R_MISSING_EXPORT_TMP_RSA_KEY + 167 + + ) + +2417 + #SSL_R_MISSING_RSA_CERTIFICATE + 168 + + ) + +2418 + #SSL_R_MISSING_RSA_ENCRYPTING_CERT + 169 + + ) + +2419 + #SSL_R_MISSING_RSA_SIGNING_CERT + 170 + + ) + +2420 + #SSL_R_MISSING_SRP_PARAM + 358 + + ) + +2421 + #SSL_R_MISSING_TMP_DH_KEY + 171 + + ) + +2422 + #SSL_R_MISSING_TMP_ECDH_KEY + 311 + + ) + +2423 + #SSL_R_MISSING_TMP_RSA_KEY + 172 + + ) + +2424 + #SSL_R_MISSING_TMP_RSA_PKEY + 173 + + ) + +2425 + #SSL_R_MISSING_VERIFY_MESSAGE + 174 + + ) + +2426 + #SSL_R_MULTIPLE_SGC_RESTARTS + 346 + + ) + +2427 + #SSL_R_NON_SSLV2_INITIAL_PACKET + 175 + + ) + +2428 + #SSL_R_NO_CERTIFICATES_RETURNED + 176 + + ) + +2429 + #SSL_R_NO_CERTIFICATE_ASSIGNED + 177 + + ) + +2430 + #SSL_R_NO_CERTIFICATE_RETURNED + 178 + + ) + +2431 + #SSL_R_NO_CERTIFICATE_SET + 179 + + ) + +2432 + #SSL_R_NO_CERTIFICATE_SPECIFIED + 180 + + ) + +2433 + #SSL_R_NO_CIPHERS_AVAILABLE + 181 + + ) + +2434 + #SSL_R_NO_CIPHERS_PASSED + 182 + + ) + +2435 + #SSL_R_NO_CIPHERS_SPECIFIED + 183 + + ) + +2436 + #SSL_R_NO_CIPHER_LIST + 184 + + ) + +2437 + #SSL_R_NO_CIPHER_MATCH + 185 + + ) + +2438 + #SSL_R_NO_CLIENT_CERT_METHOD + 331 + + ) + +2439 + #SSL_R_NO_CLIENT_CERT_RECEIVED + 186 + + ) + +2440 + #SSL_R_NO_COMPRESSION_SPECIFIED + 187 + + ) + +2441 + #SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER + 330 + + ) + +2442 + #SSL_R_NO_METHOD_SPECIFIED + 188 + + ) + +2443 + #SSL_R_NO_PRIVATEKEY + 189 + + ) + +2444 + #SSL_R_NO_PRIVATE_KEY_ASSIGNED + 190 + + ) + +2445 + #SSL_R_NO_PROTOCOLS_AVAILABLE + 191 + + ) + +2446 + #SSL_R_NO_PUBLICKEY + 192 + + ) + +2447 + #SSL_R_NO_RENEGOTIATION + 339 + + ) + +2448 + #SSL_R_NO_REQUIRED_DIGEST + 324 + + ) + +2449 + #SSL_R_NO_SHARED_CIPHER + 193 + + ) + +2450 + #SSL_R_NO_SRTP_PROFILES + 359 + + ) + +2451 + #SSL_R_NO_VERIFY_CALLBACK + 194 + + ) + +2452 + #SSL_R_NULL_SSL_CTX + 195 + + ) + +2453 + #SSL_R_NULL_SSL_METHOD_PASSED + 196 + + ) + +2454 + #SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED + 197 + + ) + +2455 + #SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED + 344 + + ) + +2456 + #SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE + 297 + + ) + +2457 + #SSL_R_OPAQUE_PRF_INPUT_TOO_LONG + 327 + + ) + +2458 + #SSL_R_PACKET_LENGTH_TOO_LONG + 198 + + ) + +2459 + #SSL_R_PARSE_TLSEXT + 227 + + ) + +2460 + #SSL_R_PATH_TOO_LONG + 270 + + ) + +2461 + #SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE + 199 + + ) + +2462 + #SSL_R_PEER_ERROR + 200 + + ) + +2463 + #SSL_R_PEER_ERROR_CERTIFICATE + 201 + + ) + +2464 + #SSL_R_PEER_ERROR_NO_CERTIFICATE + 202 + + ) + +2465 + #SSL_R_PEER_ERROR_NO_CIPHER + 203 + + ) + +2466 + #SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE + 204 + + ) + +2467 + #SSL_R_PRE_MAC_LENGTH_TOO_LONG + 205 + + ) + +2468 + #SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS + 206 + + ) + +2469 + #SSL_R_PROTOCOL_IS_SHUTDOWN + 207 + + ) + +2470 + #SSL_R_PSK_IDENTITY_NOT_FOUND + 223 + + ) + +2471 + #SSL_R_PSK_NO_CLIENT_CB + 224 + + ) + +2472 + #SSL_R_PSK_NO_SERVER_CB + 225 + + ) + +2473 + #SSL_R_PUBLIC_KEY_ENCRYPT_ERROR + 208 + + ) + +2474 + #SSL_R_PUBLIC_KEY_IS_NOT_RSA + 209 + + ) + +2475 + #SSL_R_PUBLIC_KEY_NOT_RSA + 210 + + ) + +2476 + #SSL_R_READ_BIO_NOT_SET + 211 + + ) + +2477 + #SSL_R_READ_TIMEOUT_EXPIRED + 312 + + ) + +2478 + #SSL_R_READ_WRONG_PACKET_TYPE + 212 + + ) + +2479 + #SSL_R_RECORD_LENGTH_MISMATCH + 213 + + ) + +2480 + #SSL_R_RECORD_TOO_LARGE + 214 + + ) + +2481 + #SSL_R_RECORD_TOO_SMALL + 298 + + ) + +2482 + #SSL_R_RENEGOTIATE_EXT_TOO_LONG + 335 + + ) + +2483 + #SSL_R_RENEGOTIATION_ENCODING_ERR + 336 + + ) + +2484 + #SSL_R_RENEGOTIATION_MISMATCH + 337 + + ) + +2485 + #SSL_R_REQUIRED_CIPHER_MISSING + 215 + + ) + +2486 + #SSL_R_REQUIRED_COMPRESSSION_ALGORITHM_MISSING + 342 + + ) + +2487 + #SSL_R_REUSE_CERT_LENGTH_NOT_ZERO + 216 + + ) + +2488 + #SSL_R_REUSE_CERT_TYPE_NOT_ZERO + 217 + + ) + +2489 + #SSL_R_REUSE_CIPHER_LIST_NOT_ZERO + 218 + + ) + +2490 + #SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING + 345 + + ) + +2491 + #SSL_R_SERVERHELLO_TLSEXT + 275 + + ) + +2492 + #SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED + 277 + + ) + +2493 + #SSL_R_SHORT_READ + 219 + + ) + +2494 + #SSL_R_SIGNATURE_ALGORITHMS_ERROR + 360 + + ) + +2495 + #SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE + 220 + + ) + +2496 + #SSL_R_SRP_A_CALC + 361 + + ) + +2497 + #SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES + 362 + + ) + +2498 + #SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG + 363 + + ) + +2499 + #SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE + 364 + + ) + +2500 + #SSL_R_SSL23_DOING_SESSION_ID_REUSE + 221 + + ) + +2501 + #SSL_R_SSL2_CONNECTION_ID_TOO_LONG + 299 + + ) + +2502 + #SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT + 321 + + ) + +2503 + #SSL_R_SSL3_EXT_INVALID_SERVERNAME + 319 + + ) + +2504 + #SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE + 320 + + ) + +2505 + #SSL_R_SSL3_SESSION_ID_TOO_LONG + 300 + + ) + +2506 + #SSL_R_SSL3_SESSION_ID_TOO_SHORT + 222 + + ) + +2507 + #SSL_R_SSLV3_ALERT_BAD_CERTIFICATE + 1042 + + ) + +2508 + #SSL_R_SSLV3_ALERT_BAD_RECORD_MAC + 1020 + + ) + +2509 + #SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED + 1045 + + ) + +2510 + #SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED + 1044 + + ) + +2511 + #SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN + 1046 + + ) + +2512 + #SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE + 1030 + + ) + +2513 + #SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE + 1040 + + ) + +2514 + #SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER + 1047 + + ) + +2515 + #SSL_R_SSLV3_ALERT_NO_CERTIFICATE + 1041 + + ) + +2516 + #SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE + 1010 + + ) + +2517 + #SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE + 1043 + + ) + +2518 + #SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION + 228 + + ) + +2519 + #SSL_R_SSL_HANDSHAKE_FAILURE + 229 + + ) + +2520 + #SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS + 230 + + ) + +2521 + #SSL_R_SSL_SESSION_ID_CALLBACK_FAILED + 301 + + ) + +2522 + #SSL_R_SSL_SESSION_ID_CONFLICT + 302 + + ) + +2523 + #SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG + 273 + + ) + +2524 + #SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH + 303 + + ) + +2525 + #SSL_R_SSL_SESSION_ID_IS_DIFFERENT + 231 + + ) + +2526 + #SSL_R_TLSV1_ALERT_ACCESS_DENIED + 1049 + + ) + +2527 + #SSL_R_TLSV1_ALERT_DECODE_ERROR + 1050 + + ) + +2528 + #SSL_R_TLSV1_ALERT_DECRYPTION_FAILED + 1021 + + ) + +2529 + #SSL_R_TLSV1_ALERT_DECRYPT_ERROR + 1051 + + ) + +2530 + #SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION + 1060 + + ) + +2531 + #SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK + 1086 + + ) + +2532 + #SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY + 1071 + + ) + +2533 + #SSL_R_TLSV1_ALERT_INTERNAL_ERROR + 1080 + + ) + +2534 + #SSL_R_TLSV1_ALERT_NO_RENEGOTIATION + 1100 + + ) + +2535 + #SSL_R_TLSV1_ALERT_PROTOCOL_VERSION + 1070 + + ) + +2536 + #SSL_R_TLSV1_ALERT_RECORD_OVERFLOW + 1022 + + ) + +2537 + #SSL_R_TLSV1_ALERT_UNKNOWN_CA + 1048 + + ) + +2538 + #SSL_R_TLSV1_ALERT_USER_CANCELLED + 1090 + + ) + +2539 + #SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE + 1114 + + ) + +2540 + #SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE + 1113 + + ) + +2541 + #SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE + 1111 + + ) + +2542 + #SSL_R_TLSV1_UNRECOGNIZED_NAME + 1112 + + ) + +2543 + #SSL_R_TLSV1_UNSUPPORTED_EXTENSION + 1110 + + ) + +2544 + #SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER + 232 + + ) + +2545 + #SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT + 365 + + ) + +2546 + #SSL_R_TLS_HEARTBEAT_PENDING + 366 + + ) + +2547 + #SSL_R_TLS_ILLEGAL_EXPORTER_LABEL + 367 + + ) + +2548 + #SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST + 157 + + ) + +2549 + #SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST + 233 + + ) + +2550 + #SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG + 234 + + ) + +2551 + #SSL_R_TOO_MANY_WARN_ALERTS + 409 + + ) + +2552 + #SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER + 235 + + ) + +2553 + #SSL_R_UNABLE_TO_DECODE_DH_CERTS + 236 + + ) + +2554 + #SSL_R_UNABLE_TO_DECODE_ECDH_CERTS + 313 + + ) + +2555 + #SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY + 237 + + ) + +2556 + #SSL_R_UNABLE_TO_FIND_DH_PARAMETERS + 238 + + ) + +2557 + #SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS + 314 + + ) + +2558 + #SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS + 239 + + ) + +2559 + #SSL_R_UNABLE_TO_FIND_SSL_METHOD + 240 + + ) + +2560 + #SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES + 241 + + ) + +2561 + #SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES + 242 + + ) + +2562 + #SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES + 243 + + ) + +2563 + #SSL_R_UNEXPECTED_MESSAGE + 244 + + ) + +2564 + #SSL_R_UNEXPECTED_RECORD + 245 + + ) + +2565 + #SSL_R_UNINITIALIZED + 276 + + ) + +2566 + #SSL_R_UNKNOWN_ALERT_TYPE + 246 + + ) + +2567 + #SSL_R_UNKNOWN_CERTIFICATE_TYPE + 247 + + ) + +2568 + #SSL_R_UNKNOWN_CIPHER_RETURNED + 248 + + ) + +2569 + #SSL_R_UNKNOWN_CIPHER_TYPE + 249 + + ) + +2570 + #SSL_R_UNKNOWN_DIGEST + 368 + + ) + +2571 + #SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE + 250 + + ) + +2572 + #SSL_R_UNKNOWN_PKEY_TYPE + 251 + + ) + +2573 + #SSL_R_UNKNOWN_PROTOCOL + 252 + + ) + +2574 + #SSL_R_UNKNOWN_REMOTE_ERROR_TYPE + 253 + + ) + +2575 + #SSL_R_UNKNOWN_SSL_VERSION + 254 + + ) + +2576 + #SSL_R_UNKNOWN_STATE + 255 + + ) + +2577 + #SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED + 338 + + ) + +2578 + #SSL_R_UNSUPPORTED_CIPHER + 256 + + ) + +2579 + #SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM + 257 + + ) + +2580 + #SSL_R_UNSUPPORTED_DIGEST_TYPE + 326 + + ) + +2581 + #SSL_R_UNSUPPORTED_ELLIPTIC_CURVE + 315 + + ) + +2582 + #SSL_R_UNSUPPORTED_PROTOCOL + 258 + + ) + +2583 + #SSL_R_UNSUPPORTED_SSL_VERSION + 259 + + ) + +2584 + #SSL_R_UNSUPPORTED_STATUS_TYPE + 329 + + ) + +2585 + #SSL_R_USE_SRTP_NOT_NEGOTIATED + 369 + + ) + +2586 + #SSL_R_WRITE_BIO_NOT_SET + 260 + + ) + +2587 + #SSL_R_WRONG_CIPHER_RETURNED + 261 + + ) + +2588 + #SSL_R_WRONG_MESSAGE_TYPE + 262 + + ) + +2589 + #SSL_R_WRONG_NUMBER_OF_KEY_BITS + 263 + + ) + +2590 + #SSL_R_WRONG_SIGNATURE_LENGTH + 264 + + ) + +2591 + #SSL_R_WRONG_SIGNATURE_SIZE + 265 + + ) + +2592 + #SSL_R_WRONG_SIGNATURE_TYPE + 370 + + ) + +2593 + #SSL_R_WRONG_SSL_VERSION + 266 + + ) + +2594 + #SSL_R_WRONG_VERSION_NUMBER + 267 + + ) + +2595 + #SSL_R_X509_LIB + 268 + + ) + +2596 + #SSL_R_X509_VERIFICATION_SETUP_PROBLEMS + 269 + + ) + +2598 #ifde� +__�lu�lus + + + @/usr/include/openssl/tls1.h + +151 #i�de� +HEADER_TLS1_H + + +152 + #HEADER_TLS1_H + + + ) + +154 + ~<ݒs�/buf�r.h +> + +156 #ifde� +__�lu�lus + + +160 + #TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES + 0 + + ) + +162 + #TLS1_VERSION + 0x0301 + + ) + +163 + #TLS1_1_VERSION + 0x0302 + + ) + +164 + #TLS1_2_VERSION + 0x0303 + + ) + +165 + #TLS_MAX_VERSION + +TLS1_2_VERSION + + + ) + +167 + #TLS1_VERSION_MAJOR + 0x03 + + ) + +168 + #TLS1_VERSION_MINOR + 0x01 + + ) + +170 + #TLS1_1_VERSION_MAJOR + 0x03 + + ) + +171 + #TLS1_1_VERSION_MINOR + 0x02 + + ) + +173 + #TLS1_2_VERSION_MAJOR + 0x03 + + ) + +174 + #TLS1_2_VERSION_MINOR + 0x03 + + ) + +176 + #TLS1_g�_v�si� +( +s +) \ + +177 (( +s +-> +v�si� + >> 8�=� +TLS1_VERSION_MAJOR + ? s->v�si� : 0) + + ) + +179 + #TLS1_g�_���_v�si� +( +s +) \ + +180 (( +s +-> +���_v�si� + >> 8�=� +TLS1_VERSION_MAJOR + ? s->���_v�si� : 0) + + ) + +182 + #TLS1_AD_DECRYPTION_FAILED + 21 + + ) + +183 + #TLS1_AD_RECORD_OVERFLOW + 22 + + ) + +184 + #TLS1_AD_UNKNOWN_CA + 48 + + ) + +185 + #TLS1_AD_ACCESS_DENIED + 49 + + ) + +186 + #TLS1_AD_DECODE_ERROR + 50 + + ) + +187 + #TLS1_AD_DECRYPT_ERROR + 51 + + ) + +188 + #TLS1_AD_EXPORT_RESTRICTION + 60 + + ) + +189 + #TLS1_AD_PROTOCOL_VERSION + 70 + + ) + +190 + #TLS1_AD_INSUFFICIENT_SECURITY + 71 + + ) + +191 + #TLS1_AD_INTERNAL_ERROR + 80 + + ) + +192 + #TLS1_AD_INAPPROPRIATE_FALLBACK + 86 + + ) + +193 + #TLS1_AD_USER_CANCELLED + 90 + + ) + +194 + #TLS1_AD_NO_RENEGOTIATION + 100 + + ) + +196 + #TLS1_AD_UNSUPPORTED_EXTENSION + 110 + + ) + +197 + #TLS1_AD_CERTIFICATE_UNOBTAINABLE + 111 + + ) + +198 + #TLS1_AD_UNRECOGNIZED_NAME + 112 + + ) + +199 + #TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE + 113 + + ) + +200 + #TLS1_AD_BAD_CERTIFICATE_HASH_VALUE + 114 + + ) + +201 + #TLS1_AD_UNKNOWN_PSK_IDENTITY + 115 + + ) + +204 + #TLSEXT_TYPE_�rv�_�me + 0 + + ) + +205 + #TLSEXT_TYPE_max_�agm�t_�ngth + 1 + + ) + +206 + #TLSEXT_TYPE_���_��ifi��_u� + 2 + + ) + +207 + #TLSEXT_TYPE_�u�ed_�_keys + 3 + + ) + +208 + #TLSEXT_TYPE_�un��d_hmac + 4 + + ) + +209 + #TLSEXT_TYPE_��us_�que� + 5 + + ) + +211 + #TLSEXT_TYPE_u�r_m�p�g + 6 + + ) + +214 + #TLSEXT_TYPE_���_authz + 7 + + ) + +215 + #TLSEXT_TYPE_�rv�_authz + 8 + + ) + +218 + #TLSEXT_TYPE_��_ty� + 9 + + ) + +221 + #TLSEXT_TYPE_�l�tic_curves + 10 + + ) + +222 + #TLSEXT_TYPE_ec_po�t_f�m�s + 11 + + ) + +225 + #TLSEXT_TYPE_�p + 12 + + ) + +228 + #TLSEXT_TYPE_sig�tu�_�gܙhms + 13 + + ) + +231 + #TLSEXT_TYPE_u�_�� + 14 + + ) + +234 + #TLSEXT_TYPE_h��b�t + 15 + + ) + +237 + #TLSEXT_TYPE_�ssi�_tick� + 35 + + ) + +243 + #TLSEXT_TYPE_�aque_�f_�put + ?? */ + + ) + +247 + #TLSEXT_TYPE_��gٟ� + 0xff01 + + ) + +249 #i�de� +OPENSSL_NO_NEXTPROTONEG + + +251 + #TLSEXT_TYPE_�xt_��o_�g + 13172 + + ) + +255 + #TLSEXT_NAMETYPE_ho�_�me + 0 + + ) + +257 + #TLSEXT_STATUSTYPE_oc� + 1 + + ) + +260 + #TLSEXT_ECPOINTFORMAT_f�� + 0 + + ) + +261 + #TLSEXT_ECPOINTFORMAT_uncom�es�d + 0 + + ) + +262 + #TLSEXT_ECPOINTFORMAT_�siX962_com�es�d_�ime + 1 + + ) + +263 + #TLSEXT_ECPOINTFORMAT_�siX962_com�es�d_ch�2 + 2 + + ) + +264 + #TLSEXT_ECPOINTFORMAT_ϡ + 2 + + ) + +268 + #TLSEXT_sig�tu�_��ymous + 0 + + ) + +269 + #TLSEXT_sig�tu�_r� + 1 + + ) + +270 + #TLSEXT_sig�tu�_d� + 2 + + ) + +271 + #TLSEXT_sig�tu�_ecd� + 3 + + ) + +273 + #TLSEXT_hash_n�e + 0 + + ) + +274 + #TLSEXT_hash_md5 + 1 + + ) + +275 + #TLSEXT_hash_sha1 + 2 + + ) + +276 + #TLSEXT_hash_sha224 + 3 + + ) + +277 + #TLSEXT_hash_sha256 + 4 + + ) + +278 + #TLSEXT_hash_sha384 + 5 + + ) + +279 + #TLSEXT_hash_sha512 + 6 + + ) + +281 #i�de� +OPENSSL_NO_TLSEXT + + +283 + #TLSEXT_MAXLEN_ho�_�me + 255 + + ) + +285 cڡ * +SSL_g�_�rv��me +(cڡ +SSL + * +s +, cڡ +ty� +); + +286 +SSL_g�_�rv��me_ty� +(cڡ +SSL + * +s +); + +294 +SSL_exp�t_key�g_m���l +( +SSL + * +s +, * +out +, +size_t + +ޒ +, + +295 cڡ * +�b� +, +size_t + +Β +, cڡ * +p +, size_� +�� +, + +296 +u�_cڋxt +); + +298 + #SSL_�t_��xt_ho�_�me +( +s +, +�me +) \ + +299 + `SSL_�� +( +s +, +SSL_CTRL_SET_TLSEXT_HOSTNAME +, +TLSEXT_NAMETYPE_ho�_�me +,(*) +�me +) + + ) + +301 + #SSL_�t_��xt_debug_��back +( +s� +, +cb +) \ + +302 + `SSL_��back_�� +( +s� +, +SSL_CTRL_SET_TLSEXT_DEBUG_CB +,((*)()) +cb +) + + ) + +304 + #SSL_�t_��xt_debug_�g +( +s� +, +�g +) \ + +305 + `SSL_�� +( +s� +, +SSL_CTRL_SET_TLSEXT_DEBUG_ARG +,0, (*) +�g +) + + ) + +307 + #SSL_�t_��xt_��us_ty� +( +s� +, +ty� +) \ + +308 + `SSL_�� +( +s� +, +SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE +, +ty� +, +NULL +) + + ) + +310 + #SSL_g�_��xt_��us_exts +( +s� +, +�g +) \ + +311 + `SSL_�� +( +s� +, +SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS +,0, (*) +�g +) + + ) + +313 + #SSL_�t_��xt_��us_exts +( +s� +, +�g +) \ + +314 + `SSL_�� +( +s� +, +SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS +,0, (*) +�g +) + + ) + +316 + #SSL_g�_��xt_��us_ids +( +s� +, +�g +) \ + +317 + `SSL_�� +( +s� +, +SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS +,0, (*) +�g +) + + ) + +319 + #SSL_�t_��xt_��us_ids +( +s� +, +�g +) \ + +320 + `SSL_�� +( +s� +, +SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS +,0, (*) +�g +) + + ) + +322 + #SSL_g�_��xt_��us_oc�_�� +( +s� +, +�g +) \ + +323 + `SSL_�� +( +s� +, +SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP +,0, (*) +�g +) + + ) + +325 + #SSL_�t_��xt_��us_oc�_�� +( +s� +, +�g +, +�g�n +) \ + +326 + `SSL_�� +( +s� +, +SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP +, +�g�n +, (*) +�g +) + + ) + +328 + #SSL_CTX_�t_��xt_�rv��me_��back +( +�x +, +cb +) \ + +329 + `SSL_CTX_��back_�� +( +�x +, +SSL_CTRL_SET_TLSEXT_SERVERNAME_CB +,((*)()) +cb +) + + ) + +331 + #SSL_TLSEXT_ERR_OK + 0 + + ) + +332 + #SSL_TLSEXT_ERR_ALERT_WARNING + 1 + + ) + +333 + #SSL_TLSEXT_ERR_ALERT_FATAL + 2 + + ) + +334 + #SSL_TLSEXT_ERR_NOACK + 3 + + ) + +336 + #SSL_CTX_�t_��xt_�rv��me_�g +( +�x +, +�g +) \ + +337 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG +,0, (*) +�g +) + + ) + +339 + #SSL_CTX_g�_��xt_tick�_keys +( +�x +, +keys +, +key�n +) \ + +340 + `SSL_CTX_�� +(( +�x +), +SSL_CTRL_GET_TLSEXT_TICKET_KEYS +,( +key�n +),( +keys +)) + + ) + +341 + #SSL_CTX_�t_��xt_tick�_keys +( +�x +, +keys +, +key�n +) \ + +342 + `SSL_CTX_�� +(( +�x +), +SSL_CTRL_SET_TLSEXT_TICKET_KEYS +,( +key�n +),( +keys +)) + + ) + +344 + #SSL_CTX_�t_��xt_��us_cb +( +s� +, +cb +) \ + +345 + `SSL_CTX_��back_�� +( +s� +, +SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB +,((*)()) +cb +) + + ) + +347 + #SSL_CTX_�t_��xt_��us_�g +( +s� +, +�g +) \ + +348 + `SSL_CTX_�� +( +s� +, +SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG +,0, (*) +�g +) + + ) + +350 + #SSL_�t_��xt_�aque_�f_�put +( +s +, +�c +, +�n +) \ + +351 + `SSL_�� +( +s +, +SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT +, +�n +, +�c +) + + ) + +352 + #SSL_CTX_�t_��xt_�aque_�f_�put_��back +( +�x +, +cb +) \ + +353 + `SSL_CTX_��back_�� +( +�x +, +SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB +, ((*)()) +cb +) + + ) + +354 + #SSL_CTX_�t_��xt_�aque_�f_�put_��back_�g +( +�x +, +�g +) \ + +355 + `SSL_CTX_�� +( +�x +, +SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG +, 0, +�g +) + + ) + +357 + #SSL_CTX_�t_��xt_tick�_key_cb +( +s� +, +cb +) \ + +358 + `SSL_CTX_��back_�� +( +s� +, +SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB +,((*)()) +cb +) + + ) + +360 #i�de� +OPENSSL_NO_HEARTBEATS + + +361 + #SSL_TLSEXT_HB_ENABLED + 0x01 + + ) + +362 + #SSL_TLSEXT_HB_DONT_SEND_REQUESTS + 0x02 + + ) + +363 + #SSL_TLSEXT_HB_DONT_RECV_REQUESTS + 0x04 + + ) + +365 + #SSL_g�_��xt_h��b�t_�nd�g +( +s� +) \ + +366 + `SSL_�� +(( +s� +), +SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING +,0, +NULL +) + + ) + +367 + #SSL_�t_��xt_h��b�t_no_�que�s +( +s� +, +�g +) \ + +368 + `SSL_�� +(( +s� +), +SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS +, +�g +, +NULL +) + + ) + +373 + #TLS1_CK_PSK_WITH_RC4_128_SHA + 0x0300008A + + ) + +374 + #TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA + 0x0300008B + + ) + +375 + #TLS1_CK_PSK_WITH_AES_128_CBC_SHA + 0x0300008C + + ) + +376 + #TLS1_CK_PSK_WITH_AES_256_CBC_SHA + 0x0300008D + + ) + +383 + #TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_MD5 + 0x03000060 + + ) + +384 + #TLS1_CK_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 + 0x03000061 + + ) + +385 + #TLS1_CK_RSA_EXPORT1024_WITH_DES_CBC_SHA + 0x03000062 + + ) + +386 + #TLS1_CK_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA + 0x03000063 + + ) + +387 + #TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_SHA + 0x03000064 + + ) + +388 + #TLS1_CK_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA + 0x03000065 + + ) + +389 + #TLS1_CK_DHE_DSS_WITH_RC4_128_SHA + 0x03000066 + + ) + +393 + #TLS1_CK_RSA_WITH_AES_128_SHA + 0x0300002F + + ) + +394 + #TLS1_CK_DH_DSS_WITH_AES_128_SHA + 0x03000030 + + ) + +395 + #TLS1_CK_DH_RSA_WITH_AES_128_SHA + 0x03000031 + + ) + +396 + #TLS1_CK_DHE_DSS_WITH_AES_128_SHA + 0x03000032 + + ) + +397 + #TLS1_CK_DHE_RSA_WITH_AES_128_SHA + 0x03000033 + + ) + +398 + #TLS1_CK_ADH_WITH_AES_128_SHA + 0x03000034 + + ) + +400 + #TLS1_CK_RSA_WITH_AES_256_SHA + 0x03000035 + + ) + +401 + #TLS1_CK_DH_DSS_WITH_AES_256_SHA + 0x03000036 + + ) + +402 + #TLS1_CK_DH_RSA_WITH_AES_256_SHA + 0x03000037 + + ) + +403 + #TLS1_CK_DHE_DSS_WITH_AES_256_SHA + 0x03000038 + + ) + +404 + #TLS1_CK_DHE_RSA_WITH_AES_256_SHA + 0x03000039 + + ) + +405 + #TLS1_CK_ADH_WITH_AES_256_SHA + 0x0300003A + + ) + +408 + #TLS1_CK_RSA_WITH_NULL_SHA256 + 0x0300003B + + ) + +409 + #TLS1_CK_RSA_WITH_AES_128_SHA256 + 0x0300003C + + ) + +410 + #TLS1_CK_RSA_WITH_AES_256_SHA256 + 0x0300003D + + ) + +411 + #TLS1_CK_DH_DSS_WITH_AES_128_SHA256 + 0x0300003E + + ) + +412 + #TLS1_CK_DH_RSA_WITH_AES_128_SHA256 + 0x0300003F + + ) + +413 + #TLS1_CK_DHE_DSS_WITH_AES_128_SHA256 + 0x03000040 + + ) + +416 + #TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA + 0x03000041 + + ) + +417 + #TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA + 0x03000042 + + ) + +418 + #TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA + 0x03000043 + + ) + +419 + #TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA + 0x03000044 + + ) + +420 + #TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA + 0x03000045 + + ) + +421 + #TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA + 0x03000046 + + ) + +424 + #TLS1_CK_DHE_RSA_WITH_AES_128_SHA256 + 0x03000067 + + ) + +425 + #TLS1_CK_DH_DSS_WITH_AES_256_SHA256 + 0x03000068 + + ) + +426 + #TLS1_CK_DH_RSA_WITH_AES_256_SHA256 + 0x03000069 + + ) + +427 + #TLS1_CK_DHE_DSS_WITH_AES_256_SHA256 + 0x0300006A + + ) + +428 + #TLS1_CK_DHE_RSA_WITH_AES_256_SHA256 + 0x0300006B + + ) + +429 + #TLS1_CK_ADH_WITH_AES_128_SHA256 + 0x0300006C + + ) + +430 + #TLS1_CK_ADH_WITH_AES_256_SHA256 + 0x0300006D + + ) + +433 + #TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA + 0x03000084 + + ) + +434 + #TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA + 0x03000085 + + ) + +435 + #TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA + 0x03000086 + + ) + +436 + #TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA + 0x03000087 + + ) + +437 + #TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA + 0x03000088 + + ) + +438 + #TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA + 0x03000089 + + ) + +441 + #TLS1_CK_RSA_WITH_SEED_SHA + 0x03000096 + + ) + +442 + #TLS1_CK_DH_DSS_WITH_SEED_SHA + 0x03000097 + + ) + +443 + #TLS1_CK_DH_RSA_WITH_SEED_SHA + 0x03000098 + + ) + +444 + #TLS1_CK_DHE_DSS_WITH_SEED_SHA + 0x03000099 + + ) + +445 + #TLS1_CK_DHE_RSA_WITH_SEED_SHA + 0x0300009A + + ) + +446 + #TLS1_CK_ADH_WITH_SEED_SHA + 0x0300009B + + ) + +449 + #TLS1_CK_RSA_WITH_AES_128_GCM_SHA256 + 0x0300009C + + ) + +450 + #TLS1_CK_RSA_WITH_AES_256_GCM_SHA384 + 0x0300009D + + ) + +451 + #TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256 + 0x0300009E + + ) + +452 + #TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384 + 0x0300009F + + ) + +453 + #TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256 + 0x030000A0 + + ) + +454 + #TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384 + 0x030000A1 + + ) + +455 + #TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256 + 0x030000A2 + + ) + +456 + #TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384 + 0x030000A3 + + ) + +457 + #TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256 + 0x030000A4 + + ) + +458 + #TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384 + 0x030000A5 + + ) + +459 + #TLS1_CK_ADH_WITH_AES_128_GCM_SHA256 + 0x030000A6 + + ) + +460 + #TLS1_CK_ADH_WITH_AES_256_GCM_SHA384 + 0x030000A7 + + ) + +463 + #TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA + 0x0300C001 + + ) + +464 + #TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA + 0x0300C002 + + ) + +465 + #TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA + 0x0300C003 + + ) + +466 + #TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA + 0x0300C004 + + ) + +467 + #TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA + 0x0300C005 + + ) + +469 + #TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA + 0x0300C006 + + ) + +470 + #TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA + 0x0300C007 + + ) + +471 + #TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA + 0x0300C008 + + ) + +472 + #TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA + 0x0300C009 + + ) + +473 + #TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA + 0x0300C00A + + ) + +475 + #TLS1_CK_ECDH_RSA_WITH_NULL_SHA + 0x0300C00B + + ) + +476 + #TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA + 0x0300C00C + + ) + +477 + #TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA + 0x0300C00D + + ) + +478 + #TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA + 0x0300C00E + + ) + +479 + #TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA + 0x0300C00F + + ) + +481 + #TLS1_CK_ECDHE_RSA_WITH_NULL_SHA + 0x0300C010 + + ) + +482 + #TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA + 0x0300C011 + + ) + +483 + #TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA + 0x0300C012 + + ) + +484 + #TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA + 0x0300C013 + + ) + +485 + #TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA + 0x0300C014 + + ) + +487 + #TLS1_CK_ECDH_��_WITH_NULL_SHA + 0x0300C015 + + ) + +488 + #TLS1_CK_ECDH_��_WITH_RC4_128_SHA + 0x0300C016 + + ) + +489 + #TLS1_CK_ECDH_��_WITH_DES_192_CBC3_SHA + 0x0300C017 + + ) + +490 + #TLS1_CK_ECDH_��_WITH_AES_128_CBC_SHA + 0x0300C018 + + ) + +491 + #TLS1_CK_ECDH_��_WITH_AES_256_CBC_SHA + 0x0300C019 + + ) + +494 + #TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA + 0x0300C01A + + ) + +495 + #TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA + 0x0300C01B + + ) + +496 + #TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA + 0x0300C01C + + ) + +497 + #TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA + 0x0300C01D + + ) + +498 + #TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA + 0x0300C01E + + ) + +499 + #TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA + 0x0300C01F + + ) + +500 + #TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA + 0x0300C020 + + ) + +501 + #TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA + 0x0300C021 + + ) + +502 + #TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA + 0x0300C022 + + ) + +506 + #TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256 + 0x0300C023 + + ) + +507 + #TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384 + 0x0300C024 + + ) + +508 + #TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256 + 0x0300C025 + + ) + +509 + #TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384 + 0x0300C026 + + ) + +510 + #TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256 + 0x0300C027 + + ) + +511 + #TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384 + 0x0300C028 + + ) + +512 + #TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256 + 0x0300C029 + + ) + +513 + #TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384 + 0x0300C02A + + ) + +516 + #TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 + 0x0300C02B + + ) + +517 + #TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + 0x0300C02C + + ) + +518 + #TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 + 0x0300C02D + + ) + +519 + #TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 + 0x0300C02E + + ) + +520 + #TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256 + 0x0300C02F + + ) + +521 + #TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + 0x0300C030 + + ) + +522 + #TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256 + 0x0300C031 + + ) + +523 + #TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384 + 0x0300C032 + + ) + +532 + #TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_MD5 + "EXP1024-RC4-MD5" + + ) + +533 + #TLS1_TXT_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 + "EXP1024-RC2-CBC-MD5" + + ) + +534 + #TLS1_TXT_RSA_EXPORT1024_WITH_DES_CBC_SHA + "EXP1024-DES-CBC-SHA" + + ) + +535 + #TLS1_TXT_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA + "EXP1024-DHE-DSS-DES-CBC-SHA" + + ) + +536 + #TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_SHA + "EXP1024-RC4-SHA" + + ) + +537 + #TLS1_TXT_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA + "EXP1024-DHE-DSS-RC4-SHA" + + ) + +538 + #TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA + "DHE-DSS-RC4-SHA" + + ) + +541 + #TLS1_TXT_RSA_WITH_AES_128_SHA + "AES128-SHA" + + ) + +542 + #TLS1_TXT_DH_DSS_WITH_AES_128_SHA + "DH-DSS-AES128-SHA" + + ) + +543 + #TLS1_TXT_DH_RSA_WITH_AES_128_SHA + "DH-RSA-AES128-SHA" + + ) + +544 + #TLS1_TXT_DHE_DSS_WITH_AES_128_SHA + "DHE-DSS-AES128-SHA" + + ) + +545 + #TLS1_TXT_DHE_RSA_WITH_AES_128_SHA + "DHE-RSA-AES128-SHA" + + ) + +546 + #TLS1_TXT_ADH_WITH_AES_128_SHA + "ADH-AES128-SHA" + + ) + +548 + #TLS1_TXT_RSA_WITH_AES_256_SHA + "AES256-SHA" + + ) + +549 + #TLS1_TXT_DH_DSS_WITH_AES_256_SHA + "DH-DSS-AES256-SHA" + + ) + +550 + #TLS1_TXT_DH_RSA_WITH_AES_256_SHA + "DH-RSA-AES256-SHA" + + ) + +551 + #TLS1_TXT_DHE_DSS_WITH_AES_256_SHA + "DHE-DSS-AES256-SHA" + + ) + +552 + #TLS1_TXT_DHE_RSA_WITH_AES_256_SHA + "DHE-RSA-AES256-SHA" + + ) + +553 + #TLS1_TXT_ADH_WITH_AES_256_SHA + "ADH-AES256-SHA" + + ) + +556 + #TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA + "ECDH-ECDSA-NULL-SHA" + + ) + +557 + #TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA + "ECDH-ECDSA-RC4-SHA" + + ) + +558 + #TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA + "ECDH-ECDSA-DES-CBC3-SHA" + + ) + +559 + #TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA + "ECDH-ECDSA-AES128-SHA" + + ) + +560 + #TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA + "ECDH-ECDSA-AES256-SHA" + + ) + +562 + #TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA + "ECDHE-ECDSA-NULL-SHA" + + ) + +563 + #TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA + "ECDHE-ECDSA-RC4-SHA" + + ) + +564 + #TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA + "ECDHE-ECDSA-DES-CBC3-SHA" + + ) + +565 + #TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA + "ECDHE-ECDSA-AES128-SHA" + + ) + +566 + #TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA + "ECDHE-ECDSA-AES256-SHA" + + ) + +568 + #TLS1_TXT_ECDH_RSA_WITH_NULL_SHA + "ECDH-RSA-NULL-SHA" + + ) + +569 + #TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA + "ECDH-RSA-RC4-SHA" + + ) + +570 + #TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA + "ECDH-RSA-DES-CBC3-SHA" + + ) + +571 + #TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA + "ECDH-RSA-AES128-SHA" + + ) + +572 + #TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA + "ECDH-RSA-AES256-SHA" + + ) + +574 + #TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA + "ECDHE-RSA-NULL-SHA" + + ) + +575 + #TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA + "ECDHE-RSA-RC4-SHA" + + ) + +576 + #TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA + "ECDHE-RSA-DES-CBC3-SHA" + + ) + +577 + #TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA + "ECDHE-RSA-AES128-SHA" + + ) + +578 + #TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA + "ECDHE-RSA-AES256-SHA" + + ) + +580 + #TLS1_TXT_ECDH_��_WITH_NULL_SHA + "AECDH-NULL-SHA" + + ) + +581 + #TLS1_TXT_ECDH_��_WITH_RC4_128_SHA + "AECDH-RC4-SHA" + + ) + +582 + #TLS1_TXT_ECDH_��_WITH_DES_192_CBC3_SHA + "AECDH-DES-CBC3-SHA" + + ) + +583 + #TLS1_TXT_ECDH_��_WITH_AES_128_CBC_SHA + "AECDH-AES128-SHA" + + ) + +584 + #TLS1_TXT_ECDH_��_WITH_AES_256_CBC_SHA + "AECDH-AES256-SHA" + + ) + +587 + #TLS1_TXT_PSK_WITH_RC4_128_SHA + "PSK-RC4-SHA" + + ) + +588 + #TLS1_TXT_PSK_WITH_3DES_EDE_CBC_SHA + "PSK-3DES-EDE-CBC-SHA" + + ) + +589 + #TLS1_TXT_PSK_WITH_AES_128_CBC_SHA + "PSK-AES128-CBC-SHA" + + ) + +590 + #TLS1_TXT_PSK_WITH_AES_256_CBC_SHA + "PSK-AES256-CBC-SHA" + + ) + +593 + #TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA + "SRP-3DES-EDE-CBC-SHA" + + ) + +594 + #TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA + "SRP-RSA-3DES-EDE-CBC-SHA" + + ) + +595 + #TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA + "SRP-DSS-3DES-EDE-CBC-SHA" + + ) + +596 + #TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA + "SRP-AES-128-CBC-SHA" + + ) + +597 + #TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA + "SRP-RSA-AES-128-CBC-SHA" + + ) + +598 + #TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA + "SRP-DSS-AES-128-CBC-SHA" + + ) + +599 + #TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA + "SRP-AES-256-CBC-SHA" + + ) + +600 + #TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA + "SRP-RSA-AES-256-CBC-SHA" + + ) + +601 + #TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA + "SRP-DSS-AES-256-CBC-SHA" + + ) + +604 + #TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA + "CAMELLIA128-SHA" + + ) + +605 + #TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA + "DH-DSS-CAMELLIA128-SHA" + + ) + +606 + #TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA + "DH-RSA-CAMELLIA128-SHA" + + ) + +607 + #TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA + "DHE-DSS-CAMELLIA128-SHA" + + ) + +608 + #TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA + "DHE-RSA-CAMELLIA128-SHA" + + ) + +609 + #TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA + "ADH-CAMELLIA128-SHA" + + ) + +611 + #TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA + "CAMELLIA256-SHA" + + ) + +612 + #TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA + "DH-DSS-CAMELLIA256-SHA" + + ) + +613 + #TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA + "DH-RSA-CAMELLIA256-SHA" + + ) + +614 + #TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA + "DHE-DSS-CAMELLIA256-SHA" + + ) + +615 + #TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA + "DHE-RSA-CAMELLIA256-SHA" + + ) + +616 + #TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA + "ADH-CAMELLIA256-SHA" + + ) + +619 + #TLS1_TXT_RSA_WITH_SEED_SHA + "SEED-SHA" + + ) + +620 + #TLS1_TXT_DH_DSS_WITH_SEED_SHA + "DH-DSS-SEED-SHA" + + ) + +621 + #TLS1_TXT_DH_RSA_WITH_SEED_SHA + "DH-RSA-SEED-SHA" + + ) + +622 + #TLS1_TXT_DHE_DSS_WITH_SEED_SHA + "DHE-DSS-SEED-SHA" + + ) + +623 + #TLS1_TXT_DHE_RSA_WITH_SEED_SHA + "DHE-RSA-SEED-SHA" + + ) + +624 + #TLS1_TXT_ADH_WITH_SEED_SHA + "ADH-SEED-SHA" + + ) + +627 + #TLS1_TXT_RSA_WITH_NULL_SHA256 + "NULL-SHA256" + + ) + +628 + #TLS1_TXT_RSA_WITH_AES_128_SHA256 + "AES128-SHA256" + + ) + +629 + #TLS1_TXT_RSA_WITH_AES_256_SHA256 + "AES256-SHA256" + + ) + +630 + #TLS1_TXT_DH_DSS_WITH_AES_128_SHA256 + "DH-DSS-AES128-SHA256" + + ) + +631 + #TLS1_TXT_DH_RSA_WITH_AES_128_SHA256 + "DH-RSA-AES128-SHA256" + + ) + +632 + #TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256 + "DHE-DSS-AES128-SHA256" + + ) + +633 + #TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256 + "DHE-RSA-AES128-SHA256" + + ) + +634 + #TLS1_TXT_DH_DSS_WITH_AES_256_SHA256 + "DH-DSS-AES256-SHA256" + + ) + +635 + #TLS1_TXT_DH_RSA_WITH_AES_256_SHA256 + "DH-RSA-AES256-SHA256" + + ) + +636 + #TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256 + "DHE-DSS-AES256-SHA256" + + ) + +637 + #TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256 + "DHE-RSA-AES256-SHA256" + + ) + +638 + #TLS1_TXT_ADH_WITH_AES_128_SHA256 + "ADH-AES128-SHA256" + + ) + +639 + #TLS1_TXT_ADH_WITH_AES_256_SHA256 + "ADH-AES256-SHA256" + + ) + +642 + #TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256 + "AES128-GCM-SHA256" + + ) + +643 + #TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384 + "AES256-GCM-SHA384" + + ) + +644 + #TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256 + "DHE-RSA-AES128-GCM-SHA256" + + ) + +645 + #TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384 + "DHE-RSA-AES256-GCM-SHA384" + + ) + +646 + #TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256 + "DH-RSA-AES128-GCM-SHA256" + + ) + +647 + #TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384 + "DH-RSA-AES256-GCM-SHA384" + + ) + +648 + #TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256 + "DHE-DSS-AES128-GCM-SHA256" + + ) + +649 + #TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384 + "DHE-DSS-AES256-GCM-SHA384" + + ) + +650 + #TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256 + "DH-DSS-AES128-GCM-SHA256" + + ) + +651 + #TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384 + "DH-DSS-AES256-GCM-SHA384" + + ) + +652 + #TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256 + "ADH-AES128-GCM-SHA256" + + ) + +653 + #TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384 + "ADH-AES256-GCM-SHA384" + + ) + +657 + #TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256 + "ECDHE-ECDSA-AES128-SHA256" + + ) + +658 + #TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384 + "ECDHE-ECDSA-AES256-SHA384" + + ) + +659 + #TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256 + "ECDH-ECDSA-AES128-SHA256" + + ) + +660 + #TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384 + "ECDH-ECDSA-AES256-SHA384" + + ) + +661 + #TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256 + "ECDHE-RSA-AES128-SHA256" + + ) + +662 + #TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384 + "ECDHE-RSA-AES256-SHA384" + + ) + +663 + #TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256 + "ECDH-RSA-AES128-SHA256" + + ) + +664 + #TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384 + "ECDH-RSA-AES256-SHA384" + + ) + +667 + #TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 + "ECDHE-ECDSA-AES128-GCM-SHA256" + + ) + +668 + #TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + "ECDHE-ECDSA-AES256-GCM-SHA384" + + ) + +669 + #TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 + "ECDH-ECDSA-AES128-GCM-SHA256" + + ) + +670 + #TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 + "ECDH-ECDSA-AES256-GCM-SHA384" + + ) + +671 + #TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256 + "ECDHE-RSA-AES128-GCM-SHA256" + + ) + +672 + #TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + "ECDHE-RSA-AES256-GCM-SHA384" + + ) + +673 + #TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256 + "ECDH-RSA-AES128-GCM-SHA256" + + ) + +674 + #TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384 + "ECDH-RSA-AES256-GCM-SHA384" + + ) + +676 + #TLS_CT_RSA_SIGN + 1 + + ) + +677 + #TLS_CT_DSS_SIGN + 2 + + ) + +678 + #TLS_CT_RSA_FIXED_DH + 3 + + ) + +679 + #TLS_CT_DSS_FIXED_DH + 4 + + ) + +680 + #TLS_CT_ECDSA_SIGN + 64 + + ) + +681 + #TLS_CT_RSA_FIXED_ECDH + 65 + + ) + +682 + #TLS_CT_ECDSA_FIXED_ECDH + 66 + + ) + +683 + #TLS_CT_GOST94_SIGN + 21 + + ) + +684 + #TLS_CT_GOST01_SIGN + 22 + + ) + +687 + #TLS_CT_NUMBER + 9 + + ) + +689 + #TLS1_FINISH_MAC_LENGTH + 12 + + ) + +691 + #TLS_MD_MAX_CONST_SIZE + 20 + + ) + +692 + #TLS_MD_CLIENT_FINISH_CONST + "��� f�ished" + + ) + +693 + #TLS_MD_CLIENT_FINISH_CONST_SIZE + 15 + + ) + +694 + #TLS_MD_SERVER_FINISH_CONST + "�rv� f�ished" + + ) + +695 + #TLS_MD_SERVER_FINISH_CONST_SIZE + 15 + + ) + +696 + #TLS_MD_SERVER_WRITE_KEY_CONST + "�rv� wr��key" + + ) + +697 + #TLS_MD_SERVER_WRITE_KEY_CONST_SIZE + 16 + + ) + +698 + #TLS_MD_KEY_EXPANSION_CONST + "key�x�nsi�" + + ) + +699 + #TLS_MD_KEY_EXPANSION_CONST_SIZE + 13 + + ) + +700 + #TLS_MD_CLIENT_WRITE_KEY_CONST + "��� wr��key" + + ) + +701 + #TLS_MD_CLIENT_WRITE_KEY_CONST_SIZE + 16 + + ) + +702 + #TLS_MD_SERVER_WRITE_KEY_CONST + "�rv� wr��key" + + ) + +703 + #TLS_MD_SERVER_WRITE_KEY_CONST_SIZE + 16 + + ) + +704 + #TLS_MD_IV_BLOCK_CONST + "IV block" + + ) + +705 + #TLS_MD_IV_BLOCK_CONST_SIZE + 8 + + ) + +706 + #TLS_MD_MASTER_SECRET_CONST + "ma�� se��" + + ) + +707 + #TLS_MD_MASTER_SECRET_CONST_SIZE + 13 + + ) + +709 #ifde� +CHARSET_EBCDIC + + +710 #unde� +TLS_MD_CLIENT_FINISH_CONST + + +711 + #TLS_MD_CLIENT_FINISH_CONST + "\x63\x6c\x69\x65\x6e\x74\x20\x66\x69\x6e\x69\x73\x68\x65\x64" + + ) + +712 #unde� +TLS_MD_SERVER_FINISH_CONST + + +713 + #TLS_MD_SERVER_FINISH_CONST + "\x73\x65\x72\x76\x65\x72\x20\x66\x69\x6e\x69\x73\x68\x65\x64" + + ) + +714 #unde� +TLS_MD_SERVER_WRITE_KEY_CONST + + +715 + #TLS_MD_SERVER_WRITE_KEY_CONST + "\x73\x65\x72\x76\x65\x72\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79" + + ) + +716 #unde� +TLS_MD_KEY_EXPANSION_CONST + + +717 + #TLS_MD_KEY_EXPANSION_CONST + "\x6b\x65\x79\x20\x65\x78\x70\x61\x6e\x73\x69\x6f\x6e" + + ) + +718 #unde� +TLS_MD_CLIENT_WRITE_KEY_CONST + + +719 + #TLS_MD_CLIENT_WRITE_KEY_CONST + "\x63\x6c\x69\x65\x6e\x74\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79" + + ) + +720 #unde� +TLS_MD_SERVER_WRITE_KEY_CONST + + +721 + #TLS_MD_SERVER_WRITE_KEY_CONST + "\x73\x65\x72\x76\x65\x72\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79" + + ) + +722 #unde� +TLS_MD_IV_BLOCK_CONST + + +723 + #TLS_MD_IV_BLOCK_CONST + "\x49\x56\x20\x62\x6c\x6f\x63\x6b" + + ) + +724 #unde� +TLS_MD_MASTER_SECRET_CONST + + +725 + #TLS_MD_MASTER_SECRET_CONST + "\x6d\x61\x73\x74\x65\x72\x20\x73\x65\x63\x72\x65\x74" + + ) + +729 + s�s_�ssi�_tick�_ext_� + + +731 +�ngth +; + +732 * +d�a +; + +735 #ifde� +__�lu�lus + + + @/usr/include/openssl/ui.h + +59 #i�de� +HEADER_UI_H + + +60 + #HEADER_UI_H + + + ) + +62 #i�de� +OPENSSL_NO_DEPRECATED + + +63 + ~<ݒs�/�y�o.h +> + +65 + ~<ݒs�/��ack.h +> + +66 + ~<ݒs�/os�_typ.h +> + +68 #ifde� +__�lu�lus + + +83 +UI + * +UI_�w +(); + +84 +UI + * +UI_�w_m�hod +(cڡ +UI_METHOD + * +m�hod +); + +85 +UI_� +( +UI + * +ui +); + +130 +UI_add_�put_�r�g +( +UI + * +ui +, cڡ * +�om� +, +�ags +, + +131 * +�su�_buf +, +m�size +, +maxsize +); + +132 +UI_dup_�put_�r�g +( +UI + * +ui +, cڡ * +�om� +, +�ags +, + +133 * +�su�_buf +, +m�size +, +maxsize +); + +134 +UI_add_v�ify_�r�g +( +UI + * +ui +, cڡ * +�om� +, +�ags +, + +135 * +�su�_buf +, +m�size +, +maxsize +, cڡ * +��_buf +); + +136 +UI_dup_v�ify_�r�g +( +UI + * +ui +, cڡ * +�om� +, +�ags +, + +137 * +�su�_buf +, +m�size +, +maxsize +, cڡ * +��_buf +); + +138 +UI_add_�put_boޗn +( +UI + * +ui +, cڡ * +�om� +, cڡ * +a�i�_desc +, + +139 cڡ * +ok_ch�s +, cڡ * +�n�l_ch�s +, + +140 +�ags +, * +�su�_buf +); + +141 +UI_dup_�put_boޗn +( +UI + * +ui +, cڡ * +�om� +, cڡ * +a�i�_desc +, + +142 cڡ * +ok_ch�s +, cڡ * +�n�l_ch�s +, + +143 +�ags +, * +�su�_buf +); + +144 +UI_add_�fo_�r�g +( +UI + * +ui +, cڡ * +�xt +); + +145 +UI_dup_�fo_�r�g +( +UI + * +ui +, cڡ * +�xt +); + +146 +UI_add_�r�_�r�g +( +UI + * +ui +, cڡ * +�xt +); + +147 +UI_dup_�r�_�r�g +( +UI + * +ui +, cڡ * +�xt +); + +151 + #UI_INPUT_FLAG_ECHO + 0x01 + + ) + +157 + #UI_INPUT_FLAG_DEFAULT_PWD + 0x02 + + ) + +168 + #UI_INPUT_FLAG_USER_BASE + 16 + + ) + +188 * +UI_cڡru�_�om� +( +UI + * +ui_m�hod +, + +189 cڡ * +obje�_desc +, cڡ * +obje�_�me +); + +201 * +UI_add_u�r_d�a +( +UI + * +ui +, * +u�r_d�a +); + +203 * +UI_g�0_u�r_d�a +( +UI + * +ui +); + +206 cڡ * +UI_g�0_�su� +( +UI + * +ui +, +i +); + +209 +UI_�o�ss +( +UI + * +ui +); + +214 +UI_�� +( +UI + * +ui +, +cmd +, +i +, * +p +, (* +f +)()); + +220 + #UI_CTRL_PRINT_ERRORS + 1 + + ) + +224 + #UI_CTRL_IS_REDOABLE + 2 + + ) + +228 + #UI_�t_�p_d�a +( +s +, +�g +� + `UI_�t_ex_d�a +(s,0,�g) + + ) + +229 + #UI_g�_�p_d�a +( +s +� + `UI_g�_ex_d�a +(s,0) + + ) + +230 +UI_g�_ex_�w_�dex +( +�gl +, * +�gp +, +CRYPTO_EX_�w + * +�w_func +, + +231 +CRYPTO_EX_dup + * +dup_func +, +CRYPTO_EX_� + * +�_func +); + +232 +UI_�t_ex_d�a +( +UI + * +r +, +idx +,* +�g +); + +233 * +UI_g�_ex_d�a +( +UI + * +r +, +idx +); + +236 +UI_�t_de�u�_m�hod +(cڡ +UI_METHOD + * +m�h +); + +237 cڡ +UI_METHOD + * +UI_g�_de�u�_m�hod +(); + +238 cڡ +UI_METHOD + * +UI_g�_m�hod +( +UI + * +ui +); + +239 cڡ +UI_METHOD + * +UI_�t_m�hod +( +UI + * +ui +, cڡ UI_METHOD * +m�h +); + +242 +UI_METHOD + * +UI_O�nSSL +(); + +290 +ui_�r�g_� + + tUI_STRING +; + +291 +DECLARE_STACK_OF +( +UI_STRING +) + +295 + eUI_�r�g_ty�s + + +297 +UIT_NONE +=0, + +298 +UIT_PROMPT +, + +299 +UIT_VERIFY +, + +300 +UIT_BOOLEAN +, + +301 +UIT_INFO +, + +302 +UIT_ERROR + + +306 +UI_METHOD + * +UI_���_m�hod +(* +�me +); + +307 +UI_de�roy_m�hod +( +UI_METHOD + * +ui_m�hod +); + +308 +UI_m�hod_�t_ݒ� +( +UI_METHOD + * +m�hod +, (* +ݒ� +)( +UI + * +ui +)); + +309 +UI_m�hod_�t_wr�� +( +UI_METHOD + * +m�hod +, (* +wr�� +)( +UI + * +ui +, +UI_STRING + * +uis +)); + +310 +UI_m�hod_�t_�ush� +( +UI_METHOD + * +m�hod +, (* +�ush� +)( +UI + * +ui +)); + +311 +UI_m�hod_�t_�ad� +( +UI_METHOD + * +m�hod +, (* +�ad� +)( +UI + * +ui +, +UI_STRING + * +uis +)); + +312 +UI_m�hod_�t_�o�r +( +UI_METHOD + * +m�hod +, (* +�o�r +)( +UI + * +ui +)); + +313 +UI_m�hod_�t_�om�_cڡru�� +( +UI_METHOD + * +m�hod +, *(* +�om�_cڡru�� +)( +UI +* +ui +, cڡ * +obje�_desc +, cڡ * +obje�_�me +)); + +314 (* +UI_m�hod_g�_ݒ� +( +UI_METHOD + * +m�hod +))( +UI +*); + +315 (* +UI_m�hod_g�_wr�� +( +UI_METHOD + * +m�hod +))( +UI +*, +UI_STRING +*); + +316 (* +UI_m�hod_g�_�ush� +( +UI_METHOD + * +m�hod +))( +UI +*); + +317 (* +UI_m�hod_g�_�ad� +( +UI_METHOD + * +m�hod +))( +UI +*, +UI_STRING +*); + +318 (* +UI_m�hod_g�_�o�r +( +UI_METHOD + * +m�hod +))( +UI +*); + +319 * (* +UI_m�hod_g�_�om�_cڡru�� +( +UI_METHOD + * +m�hod +))( +UI +*, const *, const *); + +325 +UI_�r�g_ty�s + +UI_g�_�r�g_ty� +( +UI_STRING + * +uis +); + +327 +UI_g�_�put_�ags +( +UI_STRING + * +uis +); + +329 cڡ * +UI_g�0_ou�ut_�r�g +( +UI_STRING + * +uis +); + +331 cڡ * +UI_g�0_a�i�_�r�g +( +UI_STRING + * +uis +); + +333 cڡ * +UI_g�0_�su�_�r�g +( +UI_STRING + * +uis +); + +335 cڡ * +UI_g�0_��_�r�g +( +UI_STRING + * +uis +); + +337 +UI_g�_�su�_m�size +( +UI_STRING + * +uis +); + +339 +UI_g�_�su�_maxsize +( +UI_STRING + * +uis +); + +341 +UI_�t_�su� +( +UI + * +ui +, +UI_STRING + * +uis +, cڡ * +�su� +); + +345 +UI_UTIL_�ad_pw_�r�g +(* +buf +, +�ngth +,cڡ * +�om� +, +v�ify +); + +346 +UI_UTIL_�ad_pw +(* +buf +,* +buff +, +size +,cڡ * +�om� +, +v�ify +); + +353 +ERR_l�d_UI_�r�gs +(); + +358 + #UI_F_GENERAL_ALLOCATE_BOOLEAN + 108 + + ) + +359 + #UI_F_GENERAL_ALLOCATE_PROMPT + 109 + + ) + +360 + #UI_F_GENERAL_ALLOCATE_STRING + 100 + + ) + +361 + #UI_F_UI_CTRL + 111 + + ) + +362 + #UI_F_UI_DUP_ERROR_STRING + 101 + + ) + +363 + #UI_F_UI_DUP_INFO_STRING + 102 + + ) + +364 + #UI_F_UI_DUP_INPUT_BOOLEAN + 110 + + ) + +365 + #UI_F_UI_DUP_INPUT_STRING + 103 + + ) + +366 + #UI_F_UI_DUP_VERIFY_STRING + 106 + + ) + +367 + #UI_F_UI_GET0_RESULT + 107 + + ) + +368 + #UI_F_UI_NEW_METHOD + 104 + + ) + +369 + #UI_F_UI_SET_RESULT + 105 + + ) + +372 + #UI_R_COMMON_OK_AND_CANCEL_CHARACTERS + 104 + + ) + +373 + #UI_R_INDEX_TOO_LARGE + 102 + + ) + +374 + #UI_R_INDEX_TOO_SMALL + 103 + + ) + +375 + #UI_R_NO_RESULT_BUFFER + 105 + + ) + +376 + #UI_R_RESULT_TOO_LARGE + 100 + + ) + +377 + #UI_R_RESULT_TOO_SMALL + 101 + + ) + +378 + #UI_R_UNKNOWN_CONTROL_COMMAND + 106 + + ) + +380 #ifde� +__�lu�lus + + + @/usr/include/openssl/x509v3.h + +58 #i�de� +HEADER_X509V3_H + + +59 + #HEADER_X509V3_H + + + ) + +61 + ~<ݒs�/bio.h +> + +62 + ~<ݒs�/x509.h +> + +63 + ~<ݒs�/c�f.h +> + +65 #ifde� +__�lu�lus + + +70 +v3_ext_m�hod +; + +71 +v3_ext_�x +; + +75 * (* + tX509V3_EXT_NEW +)(); + +76 (* +X509V3_EXT_FREE +)(*); + +77 * (* + tX509V3_EXT_D2I +)(*, const ** , ); + +78 (* +X509V3_EXT_I2D +)(*, **); + +79 +STACK_OF +( + tCONF_VALUE +) * + +80 (* + tX509V3_EXT_I2V +)(cڡ + tv3_ext_m�hod + * + tm�hod +, * + text +, + +81 + tSTACK_OF +( + tCONF_VALUE +�* + tex�i� +); + +82 * (* + tX509V3_EXT_V2I +)(cڡ + tv3_ext_m�hod + * + tm�hod +, + +83 + tv3_ext_�x + * + t�x +, + +84 + tSTACK_OF +( + tCONF_VALUE +�* + tv�ues +); + +85 * (* + tX509V3_EXT_I2S +)(cڡ + tv3_ext_m�hod + * + tm�hod +, * + text +); + +86 * (* + tX509V3_EXT_S2I +)(cڡ + tv3_ext_m�hod + * + tm�hod +, + +87 + tv3_ext_�x + * + t�x +, cڡ * + t�r +); + +88 (* +X509V3_EXT_I2R +)(cڡ + tv3_ext_m�hod + * + tm�hod +, * + text +, + +89 + tBIO + * + tout +, + t�d�t +); + +90 * (* + tX509V3_EXT_R2I +)(cڡ + tv3_ext_m�hod + * + tm�hod +, + +91 + tv3_ext_�x + * + t�x +, cڡ * + t�r +); + +95 + sv3_ext_m�hod + { + +96 +ext_nid +; + +97 +ext_�ags +; + +99 +ASN1_ITEM_EXP + * +� +; + +101 +X509V3_EXT_NEW + +ext_�w +; + +102 +X509V3_EXT_FREE + +ext_� +; + +103 +X509V3_EXT_D2I + +d2i +; + +104 +X509V3_EXT_I2D + +i2d +; + +107 +X509V3_EXT_I2S + +i2s +; + +108 +X509V3_EXT_S2I + +s2i +; + +111 +X509V3_EXT_I2V + +i2v +; + +112 +X509V3_EXT_V2I + +v2i +; + +115 +X509V3_EXT_I2R + +i2r +; + +116 +X509V3_EXT_R2I + +r2i +; + +118 * +u�_d�a +; + +121 + sX509V3_CONF_METHOD_� + { + +122 * (* +g�_�r�g +)(* +db +, * +��i� +, * +v�ue +); + +123 +STACK_OF +( +CONF_VALUE +�* (* +g�_��i� +)(* +db +, * +��i� +); + +124 (* +�_�r�g +)(* +db +, * +�r�g +); + +125 (* +�_��i� +)(* +db +, +STACK_OF +( +CONF_VALUE +�* +��i� +); + +126 } + tX509V3_CONF_METHOD +; + +129 + sv3_ext_�x + { + +130 + #CTX_TEST + 0x1 + + ) + +131 +�ags +; + +132 +X509 + * +issu�_�� +; + +133 +X509 + * +subje�_�� +; + +134 +X509_REQ + * +subje�_�q +; + +135 +X509_CRL + * +�l +; + +136 +X509V3_CONF_METHOD + * +db_m�h +; + +137 * +db +; + +141 +v3_ext_m�hod + + tX509V3_EXT_METHOD +; + +143 +DECLARE_STACK_OF +( +X509V3_EXT_METHOD +) + +146 + #X509V3_EXT_DYNAMIC + 0x1 + + ) + +147 + #X509V3_EXT_CTX_DEP + 0x2 + + ) + +148 + #X509V3_EXT_MULTILINE + 0x4 + + ) + +150 +BIT_STRING_BITNAME + + tENUMERATED_NAMES +; + +152 + sBASIC_CONSTRAINTS_� + { + +153 +� +; + +154 +ASN1_INTEGER + * +�th�n +; + +155 } + tBASIC_CONSTRAINTS +; + +158 + sPKEY_USAGE_PERIOD_� + { + +159 +ASN1_GENERALIZEDTIME + * +n�Bef�e +; + +160 +ASN1_GENERALIZEDTIME + * +n�A� +; + +161 } + tPKEY_USAGE_PERIOD +; + +163 + s�h�Name_� + { + +164 +ASN1_OBJECT + * +ty�_id +; + +165 +ASN1_TYPE + * +v�ue +; + +166 } + tOTHERNAME +; + +168 + sEDIP�tyName_� + { + +169 +ASN1_STRING + * +�meAssig�r +; + +170 +ASN1_STRING + * +��yName +; + +171 } + tEDIPARTYNAME +; + +173 + sGENERAL_NAME_� + { + +175 + #GEN_OTHERNAME + 0 + + ) + +176 + #GEN_EMAIL + 1 + + ) + +177 + #GEN_DNS + 2 + + ) + +178 + #GEN_X400 + 3 + + ) + +179 + #GEN_DIRNAME + 4 + + ) + +180 + #GEN_EDIPARTY + 5 + + ) + +181 + #GEN_URI + 6 + + ) + +182 + #GEN_IPADD + 7 + + ) + +183 + #GEN_RID + 8 + + ) + +185 +ty� +; + +187 * +�r +; + +188 +OTHERNAME + * +�h�Name +; + +189 +ASN1_IA5STRING + * +rfc822Name +; + +190 +ASN1_IA5STRING + * +dNSName +; + +191 +ASN1_TYPE + * +x400Add�ss +; + +192 +X509_NAME + * +d�e��yName +; + +193 +EDIPARTYNAME + * +ediP�tyName +; + +194 +ASN1_IA5STRING + * +unif�mResour�Id�tif�r +; + +195 +ASN1_OCTET_STRING + * +iPAdd�ss +; + +196 +ASN1_OBJECT + * +�gi��edID +; + +199 +ASN1_OCTET_STRING + * +� +; + +200 +X509_NAME + * +d�n +; + +201 +ASN1_IA5STRING + * +�5 +; + +202 +ASN1_OBJECT + * +rid +; + +203 +ASN1_TYPE + * +�h� +; + +204 } +d +; + +205 } + tGENERAL_NAME +; + +207 +STACK_OF +( + tGENERAL_NAME +� + tGENERAL_NAMES +; + +209 + sACCESS_DESCRIPTION_� + { + +210 +ASN1_OBJECT + * +m�hod +; + +211 +GENERAL_NAME + * +lo�ti� +; + +212 } + tACCESS_DESCRIPTION +; + +214 +STACK_OF +( + tACCESS_DESCRIPTION +� + tAUTHORITY_INFO_ACCESS +; + +216 +STACK_OF +( + tASN1_OBJECT +� + tEXTENDED_KEY_USAGE +; + +218 +DECLARE_STACK_OF +( +GENERAL_NAME +) + +219 +DECLARE_ASN1_SET_OF +( +GENERAL_NAME +) + +221 +DECLARE_STACK_OF +( +ACCESS_DESCRIPTION +) + +222 +DECLARE_ASN1_SET_OF +( +ACCESS_DESCRIPTION +) + +224 + sDIST_POINT_NAME_� + { + +225 +ty� +; + +227 +GENERAL_NAMES + * +fu��me +; + +228 +STACK_OF +( +X509_NAME_ENTRY +�* +��tiv�ame +; + +229 } +�me +; + +231 +X509_NAME + * +d�ame +; + +232 } + tDIST_POINT_NAME +; + +234 + #CRLDP_ALL_REASONS + 0x807f + + ) + +236 + #CRL_REASON_NONE + -1 + + ) + +237 + #CRL_REASON_UNSPECIFIED + 0 + + ) + +238 + #CRL_REASON_KEY_COMPROMISE + 1 + + ) + +239 + #CRL_REASON_CA_COMPROMISE + 2 + + ) + +240 + #CRL_REASON_AFFILIATION_CHANGED + 3 + + ) + +241 + #CRL_REASON_SUPERSEDED + 4 + + ) + +242 + #CRL_REASON_CESSATION_OF_OPERATION + 5 + + ) + +243 + #CRL_REASON_CERTIFICATE_HOLD + 6 + + ) + +244 + #CRL_REASON_REMOVE_FROM_CRL + 8 + + ) + +245 + #CRL_REASON_PRIVILEGE_WITHDRAWN + 9 + + ) + +246 + #CRL_REASON_AA_COMPROMISE + 10 + + ) + +248 + sDIST_POINT_� + { + +249 +DIST_POINT_NAME + * +di�po�t +; + +250 +ASN1_BIT_STRING + * +�as�s +; + +251 +GENERAL_NAMES + * +CRLissu� +; + +252 +dp_�as�s +; + +255 +STACK_OF +( + tDIST_POINT +� + tCRL_DIST_POINTS +; + +257 +DECLARE_STACK_OF +( +DIST_POINT +) + +258 +DECLARE_ASN1_SET_OF +( +DIST_POINT +) + +260 + sAUTHORITY_KEYID_� + { + +261 +ASN1_OCTET_STRING + * +keyid +; + +262 +GENERAL_NAMES + * +issu� +; + +263 +ASN1_INTEGER + * +�r�l +; + +268 + sSXNET_ID_� + { + +269 +ASN1_INTEGER + * +z�e +; + +270 +ASN1_OCTET_STRING + * +u�r +; + +271 } + tSXNETID +; + +273 +DECLARE_STACK_OF +( +SXNETID +) + +274 +DECLARE_ASN1_SET_OF +( +SXNETID +) + +276 + sSXNET_� + { + +277 +ASN1_INTEGER + * +v�si� +; + +278 +STACK_OF +( +SXNETID +�* +ids +; + +279 } + tSXNET +; + +281 + sNOTICEREF_� + { + +282 +ASN1_STRING + * +�g�iz�i� +; + +283 +STACK_OF +( +ASN1_INTEGER +�* +n�i�nos +; + +284 } + tNOTICEREF +; + +286 + sUSERNOTICE_� + { + +287 +NOTICEREF + * +n�i��f +; + +288 +ASN1_STRING + * +ex�ext +; + +289 } + tUSERNOTICE +; + +291 + sPOLICYQUALINFO_� + { + +292 +ASN1_OBJECT + * +pqu�id +; + +294 +ASN1_IA5STRING + * +�suri +; + +295 +USERNOTICE + * +u���i� +; + +296 +ASN1_TYPE + * +�h� +; + +297 } +d +; + +298 } + tPOLICYQUALINFO +; + +300 +DECLARE_STACK_OF +( +POLICYQUALINFO +) + +301 +DECLARE_ASN1_SET_OF +( +POLICYQUALINFO +) + +303 + sPOLICYINFO_� + { + +304 +ASN1_OBJECT + * +p�icyid +; + +305 +STACK_OF +( +POLICYQUALINFO +�* +qu�if�rs +; + +306 } + tPOLICYINFO +; + +308 +STACK_OF +( + tPOLICYINFO +� + tCERTIFICATEPOLICIES +; + +310 +DECLARE_STACK_OF +( +POLICYINFO +) + +311 +DECLARE_ASN1_SET_OF +( +POLICYINFO +) + +313 + sPOLICY_MAPPING_� + { + +314 +ASN1_OBJECT + * +issu�Doma�P�icy +; + +315 +ASN1_OBJECT + * +subje�Doma�P�icy +; + +316 } + tPOLICY_MAPPING +; + +318 +DECLARE_STACK_OF +( +POLICY_MAPPING +) + +320 +STACK_OF +( + tPOLICY_MAPPING +� + tPOLICY_MAPPINGS +; + +322 + sGENERAL_SUBTREE_� + { + +323 +GENERAL_NAME + * +ba� +; + +324 +ASN1_INTEGER + * +m�imum +; + +325 +ASN1_INTEGER + * +maximum +; + +326 } + tGENERAL_SUBTREE +; + +328 +DECLARE_STACK_OF +( +GENERAL_SUBTREE +) + +330 + sNAME_CONSTRAINTS_� + { + +331 +STACK_OF +( +GENERAL_SUBTREE +�* +�rm��dSub��s +; + +332 +STACK_OF +( +GENERAL_SUBTREE +�* +ex�udedSub��s +; + +335 + sPOLICY_CONSTRAINTS_� + { + +336 +ASN1_INTEGER + * +�qu�eEx�ic�P�icy +; + +337 +ASN1_INTEGER + * +�hib�P�icyM�p�g +; + +338 } + tPOLICY_CONSTRAINTS +; + +341 + sPROXY_POLICY_� + + +343 +ASN1_OBJECT + * +p�icyL�guage +; + +344 +ASN1_OCTET_STRING + * +p�icy +; + +345 } + tPROXY_POLICY +; + +347 + sPROXY_CERT_INFO_EXTENSION_� + + +349 +ASN1_INTEGER + * +pcP�hL�gthCڡ��t +; + +350 +PROXY_POLICY + * +�oxyP�icy +; + +351 } + tPROXY_CERT_INFO_EXTENSION +; + +353 +DECLARE_ASN1_FUNCTIONS +( +PROXY_POLICY +) + +354 +DECLARE_ASN1_FUNCTIONS +( +PROXY_CERT_INFO_EXTENSION +) + +356 + sISSUING_DIST_POINT_� + + +358 +DIST_POINT_NAME + * +di�po�t +; + +359 +�lyu�r +; + +360 +�lyCA +; + +361 +ASN1_BIT_STRING + * +�lysom��s�s +; + +362 +�d�e�CRL +; + +363 +�ly�� +; + +368 + #IDP_PRESENT + 0x1 + + ) + +370 + #IDP_INVALID + 0x2 + + ) + +372 + #IDP_ONLYUSER + 0x4 + + ) + +374 + #IDP_ONLYCA + 0x8 + + ) + +376 + #IDP_ONLYATTR + 0x10 + + ) + +378 + #IDP_INDIRECT + 0x20 + + ) + +380 + #IDP_REASONS + 0x40 + + ) + +382 + #X509V3_c�f_�r +( +v� +� + `ERR_add_�r�_d�a +(6, "��i�:", v�-> +��i� +, \ + +383 ",�me:", +v� +-> +�me +, ",v�ue:", v�-> +v�ue +); + + ) + +385 + #X509V3_�t_�x_�� +( +�x +) \ + +386 + `X509V3_�t_�x +( +�x +, +NULL +, NULL, NULL, NULL, +CTX_TEST +) + + ) + +387 + #X509V3_�t_�x_nodb +( +�x +�(�x)-> +db + = +NULL +; + + ) + +389 + #EXT_BITSTRING +( +nid +, +�b� +�{�id, 0, + `ASN1_ITEM_�f +( +ASN1_BIT_STRING +), \ + +392 ( +X509V3_EXT_I2V +) +i2v_ASN1_BIT_STRING +, \ + +393 ( +X509V3_EXT_V2I +) +v2i_ASN1_BIT_STRING +, \ + +394 +NULL +, NULL, \ + +395 +�b� +} + + ) + +397 + #EXT_IA5STRING +( +nid +�{�id, 0, + `ASN1_ITEM_�f +( +ASN1_IA5STRING +), \ + +399 ( +X509V3_EXT_I2S +) +i2s_ASN1_IA5STRING +, \ + +400 ( +X509V3_EXT_S2I +) +s2i_ASN1_IA5STRING +, \ + +402 +NULL +} + + ) + +404 + #EXT_END + { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + + ) + +409 + #EXFLAG_BCONS + 0x1 + + ) + +410 + #EXFLAG_KUSAGE + 0x2 + + ) + +411 + #EXFLAG_XKUSAGE + 0x4 + + ) + +412 + #EXFLAG_NSCERT + 0x8 + + ) + +414 + #EXFLAG_CA + 0x10 + + ) + +416 + #EXFLAG_SI + 0x20 + + ) + +417 + #EXFLAG_SS + 0x20 + + ) + +418 + #EXFLAG_V1 + 0x40 + + ) + +419 + #EXFLAG_INVALID + 0x80 + + ) + +420 + #EXFLAG_SET + 0x100 + + ) + +421 + #EXFLAG_CRITICAL + 0x200 + + ) + +422 + #EXFLAG_PROXY + 0x400 + + ) + +424 + #EXFLAG_INVALID_POLICY + 0x800 + + ) + +425 + #EXFLAG_FRESHEST + 0x1000 + + ) + +427 + #KU_DIGITAL_SIGNATURE + 0x0080 + + ) + +428 + #KU_NON_REPUDIATION + 0x0040 + + ) + +429 + #KU_KEY_ENCIPHERMENT + 0x0020 + + ) + +430 + #KU_DATA_ENCIPHERMENT + 0x0010 + + ) + +431 + #KU_KEY_AGREEMENT + 0x0008 + + ) + +432 + #KU_KEY_CERT_SIGN + 0x0004 + + ) + +433 + #KU_CRL_SIGN + 0x0002 + + ) + +434 + #KU_ENCIPHER_ONLY + 0x0001 + + ) + +435 + #KU_DECIPHER_ONLY + 0x8000 + + ) + +437 + #NS_SSL_CLIENT + 0x80 + + ) + +438 + #NS_SSL_SERVER + 0x40 + + ) + +439 + #NS_SMIME + 0x20 + + ) + +440 + #NS_OBJSIGN + 0x10 + + ) + +441 + #NS_SSL_CA + 0x04 + + ) + +442 + #NS_SMIME_CA + 0x02 + + ) + +443 + #NS_OBJSIGN_CA + 0x01 + + ) + +444 + #NS_ANY_CA + ( +NS_SSL_CA +| +NS_SMIME_CA +| +NS_OBJSIGN_CA +) + + ) + +446 + #XKU_SSL_SERVER + 0x1 + + ) + +447 + #XKU_SSL_CLIENT + 0x2 + + ) + +448 + #XKU_SMIME + 0x4 + + ) + +449 + #XKU_CODE_SIGN + 0x8 + + ) + +450 + #XKU_SGC + 0x10 + + ) + +451 + #XKU_OCSP_SIGN + 0x20 + + ) + +452 + #XKU_TIMESTAMP + 0x40 + + ) + +453 + #XKU_DVCS + 0x80 + + ) + +455 + #X509_PURPOSE_DYNAMIC + 0x1 + + ) + +456 + #X509_PURPOSE_DYNAMIC_NAME + 0x2 + + ) + +458 + sx509_pu�o�_� + { + +459 +pu�o� +; + +460 +�u� +; + +461 +�ags +; + +462 (* +check_pu�o� +)(cڡ +x509_pu�o�_� + *, + +463 cڡ +X509 + *, ); + +464 * +�me +; + +465 * +�ame +; + +466 * +u�_d�a +; + +467 } + tX509_PURPOSE +; + +469 + #X509_PURPOSE_SSL_CLIENT + 1 + + ) + +470 + #X509_PURPOSE_SSL_SERVER + 2 + + ) + +471 + #X509_PURPOSE_NS_SSL_SERVER + 3 + + ) + +472 + #X509_PURPOSE_SMIME_SIGN + 4 + + ) + +473 + #X509_PURPOSE_SMIME_ENCRYPT + 5 + + ) + +474 + #X509_PURPOSE_CRL_SIGN + 6 + + ) + +475 + #X509_PURPOSE_ANY + 7 + + ) + +476 + #X509_PURPOSE_OCSP_HELPER + 8 + + ) + +477 + #X509_PURPOSE_TIMESTAMP_SIGN + 9 + + ) + +479 + #X509_PURPOSE_MIN + 1 + + ) + +480 + #X509_PURPOSE_MAX + 9 + + ) + +484 + #X509V3_EXT_UNKNOWN_MASK + (0xfL << 16) + + ) + +486 + #X509V3_EXT_DEFAULT + 0 + + ) + +488 + #X509V3_EXT_ERROR_UNKNOWN + (1L << 16) + + ) + +490 + #X509V3_EXT_PARSE_UNKNOWN + (2L << 16) + + ) + +492 + #X509V3_EXT_DUMP_UNKNOWN + (3L << 16) + + ) + +496 + #X509V3_ADD_OP_MASK + 0xfL + + ) + +497 + #X509V3_ADD_DEFAULT + 0L + + ) + +498 + #X509V3_ADD_APPEND + 1L + + ) + +499 + #X509V3_ADD_REPLACE + 2L + + ) + +500 + #X509V3_ADD_REPLACE_EXISTING + 3L + + ) + +501 + #X509V3_ADD_KEEP_EXISTING + 4L + + ) + +502 + #X509V3_ADD_DELETE + 5L + + ) + +503 + #X509V3_ADD_SILENT + 0x10 + + ) + +505 +DECLARE_STACK_OF +( +X509_PURPOSE +) + +507 +DECLARE_ASN1_FUNCTIONS +( +BASIC_CONSTRAINTS +) + +509 +DECLARE_ASN1_FUNCTIONS +( +SXNET +) + +510 +DECLARE_ASN1_FUNCTIONS +( +SXNETID +) + +512 +SXNET_add_id_asc +( +SXNET + ** +psx +, * +z�e +, * +u�r +, +u��� +); + +513 +SXNET_add_id_ul�g +( +SXNET + ** +psx +, +lz�e +, * +u�r +, +u��� +); + +514 +SXNET_add_id_INTEGER +( +SXNET + ** +psx +, +ASN1_INTEGER + * +iz�e +, * +u�r +, +u��� +); + +516 +ASN1_OCTET_STRING + * +SXNET_g�_id_asc +( +SXNET + * +sx +, * +z�e +); + +517 +ASN1_OCTET_STRING + * +SXNET_g�_id_ul�g +( +SXNET + * +sx +, +lz�e +); + +518 +ASN1_OCTET_STRING + * +SXNET_g�_id_INTEGER +( +SXNET + * +sx +, +ASN1_INTEGER + * +z�e +); + +520 +DECLARE_ASN1_FUNCTIONS +( +AUTHORITY_KEYID +) + +522 +DECLARE_ASN1_FUNCTIONS +( +PKEY_USAGE_PERIOD +) + +524 +DECLARE_ASN1_FUNCTIONS +( +GENERAL_NAME +) + +525 +GENERAL_NAME + * +GENERAL_NAME_dup +(GENERAL_NAME * +a +); + +526 +GENERAL_NAME_cmp +( +GENERAL_NAME + * +a +, GENERAL_NAME * +b +); + +530 +ASN1_BIT_STRING + * +v2i_ASN1_BIT_STRING +( +X509V3_EXT_METHOD + * +m�hod +, + +531 +X509V3_CTX + * +�x +, +STACK_OF +( +CONF_VALUE +�* +nv� +); + +532 +STACK_OF +( +CONF_VALUE +�* +i2v_ASN1_BIT_STRING +( +X509V3_EXT_METHOD + * +m�hod +, + +533 +ASN1_BIT_STRING + * +b�s +, + +534 +STACK_OF +( +CONF_VALUE +�* +ex�i� +); + +536 +STACK_OF +( +CONF_VALUE +�* +i2v_GENERAL_NAME +( +X509V3_EXT_METHOD + * +m�hod +, +GENERAL_NAME + * +g� +, STACK_OF(CONF_VALUE�* +�t +); + +537 +GENERAL_NAME_��t +( +BIO + * +out +, +GENERAL_NAME + * +g� +); + +539 +DECLARE_ASN1_FUNCTIONS +( +GENERAL_NAMES +) + +541 +STACK_OF +( +CONF_VALUE +�* +i2v_GENERAL_NAMES +( +X509V3_EXT_METHOD + * +m�hod +, + +542 +GENERAL_NAMES + * +g� +, +STACK_OF +( +CONF_VALUE +�* +ex�i� +); + +543 +GENERAL_NAMES + * +v2i_GENERAL_NAMES +(cڡ +X509V3_EXT_METHOD + * +m�hod +, + +544 +X509V3_CTX + * +�x +, +STACK_OF +( +CONF_VALUE +�* +nv� +); + +546 +DECLARE_ASN1_FUNCTIONS +( +OTHERNAME +) + +547 +DECLARE_ASN1_FUNCTIONS +( +EDIPARTYNAME +) + +548 +OTHERNAME_cmp +( +OTHERNAME + * +a +, OTHERNAME * +b +); + +549 +GENERAL_NAME_�t0_v�ue +( +GENERAL_NAME + * +a +, +ty� +, * +v�ue +); + +550 * +GENERAL_NAME_g�0_v�ue +( +GENERAL_NAME + * +a +, * +�y� +); + +551 +GENERAL_NAME_�t0_�h��me +( +GENERAL_NAME + * +g� +, + +552 +ASN1_OBJECT + * +oid +, +ASN1_TYPE + * +v�ue +); + +553 +GENERAL_NAME_g�0_�h�Name +( +GENERAL_NAME + * +g� +, + +554 +ASN1_OBJECT + ** +poid +, +ASN1_TYPE + ** +pv�ue +); + +556 * +i2s_ASN1_OCTET_STRING +( +X509V3_EXT_METHOD + * +m�hod +, +ASN1_OCTET_STRING + * +�5 +); + +557 +ASN1_OCTET_STRING + * +s2i_ASN1_OCTET_STRING +( +X509V3_EXT_METHOD + * +m�hod +, +X509V3_CTX + * +�x +, * +�r +); + +559 +DECLARE_ASN1_FUNCTIONS +( +EXTENDED_KEY_USAGE +) + +560 +i2a_ACCESS_DESCRIPTION +( +BIO + * +bp +, +ACCESS_DESCRIPTION +* +a +); + +562 +DECLARE_ASN1_FUNCTIONS +( +CERTIFICATEPOLICIES +) + +563 +DECLARE_ASN1_FUNCTIONS +( +POLICYINFO +) + +564 +DECLARE_ASN1_FUNCTIONS +( +POLICYQUALINFO +) + +565 +DECLARE_ASN1_FUNCTIONS +( +USERNOTICE +) + +566 +DECLARE_ASN1_FUNCTIONS +( +NOTICEREF +) + +568 +DECLARE_ASN1_FUNCTIONS +( +CRL_DIST_POINTS +) + +569 +DECLARE_ASN1_FUNCTIONS +( +DIST_POINT +) + +570 +DECLARE_ASN1_FUNCTIONS +( +DIST_POINT_NAME +) + +571 +DECLARE_ASN1_FUNCTIONS +( +ISSUING_DIST_POINT +) + +573 +DIST_POINT_�t_d�ame +( +DIST_POINT_NAME + * +d� +, +X509_NAME + * +�ame +); + +575 +NAME_CONSTRAINTS_check +( +X509 + * +x +, +NAME_CONSTRAINTS + * +nc +); + +577 +DECLARE_ASN1_FUNCTIONS +( +ACCESS_DESCRIPTION +) + +578 +DECLARE_ASN1_FUNCTIONS +( +AUTHORITY_INFO_ACCESS +) + +580 +DECLARE_ASN1_ITEM +( +POLICY_MAPPING +) + +581 +DECLARE_ASN1_ALLOC_FUNCTIONS +( +POLICY_MAPPING +) + +582 +DECLARE_ASN1_ITEM +( +POLICY_MAPPINGS +) + +584 +DECLARE_ASN1_ITEM +( +GENERAL_SUBTREE +) + +585 +DECLARE_ASN1_ALLOC_FUNCTIONS +( +GENERAL_SUBTREE +) + +587 +DECLARE_ASN1_ITEM +( +NAME_CONSTRAINTS +) + +588 +DECLARE_ASN1_ALLOC_FUNCTIONS +( +NAME_CONSTRAINTS +) + +590 +DECLARE_ASN1_ALLOC_FUNCTIONS +( +POLICY_CONSTRAINTS +) + +591 +DECLARE_ASN1_ITEM +( +POLICY_CONSTRAINTS +) + +593 +GENERAL_NAME + * +a2i_GENERAL_NAME +(GENERAL_NAME * +out +, + +594 cڡ +X509V3_EXT_METHOD + * +m�hod +, +X509V3_CTX + * +�x +, + +595 +g�_ty� +, * +v�ue +, +is_nc +); + +597 #ifde� +HEADER_CONF_H + + +598 +GENERAL_NAME + * +v2i_GENERAL_NAME +(cڡ +X509V3_EXT_METHOD + * +m�hod +, +X509V3_CTX + * +�x +, + +599 +CONF_VALUE + * +�f +); + +600 +GENERAL_NAME + * +v2i_GENERAL_NAME_ex +(GENERAL_NAME * +out +, + +601 cڡ +X509V3_EXT_METHOD + * +m�hod +, + +602 +X509V3_CTX + * +�x +, +CONF_VALUE + * +�f +, +is_nc +); + +603 +X509V3_c�f_� +( +CONF_VALUE + * +v� +); + +605 +X509_EXTENSION + * +X509V3_EXT_nc�f_nid +( +CONF + * +c�f +, +X509V3_CTX + * +�x +, +ext_nid +, * +v�ue +); + +606 +X509_EXTENSION + * +X509V3_EXT_nc�f +( +CONF + * +c�f +, +X509V3_CTX + * +�x +, * +�me +, * +v�ue +); + +607 +X509V3_EXT_add_nc�f_sk +( +CONF + * +c�f +, +X509V3_CTX + * +�x +, * +��i� +, +STACK_OF +( +X509_EXTENSION +�** +sk +); + +608 +X509V3_EXT_add_nc�f +( +CONF + * +c�f +, +X509V3_CTX + * +�x +, * +��i� +, +X509 + * +�� +); + +609 +X509V3_EXT_REQ_add_nc�f +( +CONF + * +c�f +, +X509V3_CTX + * +�x +, * +��i� +, +X509_REQ + * +�q +); + +610 +X509V3_EXT_CRL_add_nc�f +( +CONF + * +c�f +, +X509V3_CTX + * +�x +, * +��i� +, +X509_CRL + * +�l +); + +612 +X509_EXTENSION + * +X509V3_EXT_c�f_nid +( +LHASH_OF +( +CONF_VALUE +�* +c�f +, +X509V3_CTX + * +�x +, + +613 +ext_nid +, * +v�ue +); + +614 +X509_EXTENSION + * +X509V3_EXT_c�f +( +LHASH_OF +( +CONF_VALUE +�* +c�f +, +X509V3_CTX + * +�x +, + +615 * +�me +, * +v�ue +); + +616 +X509V3_EXT_add_c�f +( +LHASH_OF +( +CONF_VALUE +�* +c�f +, +X509V3_CTX + * +�x +, + +617 * +��i� +, +X509 + * +�� +); + +618 +X509V3_EXT_REQ_add_c�f +( +LHASH_OF +( +CONF_VALUE +�* +c�f +, +X509V3_CTX + * +�x +, + +619 * +��i� +, +X509_REQ + * +�q +); + +620 +X509V3_EXT_CRL_add_c�f +( +LHASH_OF +( +CONF_VALUE +�* +c�f +, +X509V3_CTX + * +�x +, + +621 * +��i� +, +X509_CRL + * +�l +); + +623 +X509V3_add_v�ue_bo�_nf +(* +�me +, +a�1_bo� +, + +624 +STACK_OF +( +CONF_VALUE +�** +ex�i� +); + +625 +X509V3_g�_v�ue_bo� +( +CONF_VALUE + * +v�ue +, * +a�1_bo� +); + +626 +X509V3_g�_v�ue_�t +( +CONF_VALUE + * +v�ue +, +ASN1_INTEGER + ** +a�t +); + +627 +X509V3_�t_nc�f +( +X509V3_CTX + * +�x +, +CONF + * +c�f +); + +628 +X509V3_�t_c�f_lhash +( +X509V3_CTX + * +�x +, +LHASH_OF +( +CONF_VALUE +�* +lhash +); + +631 * +X509V3_g�_�r�g +( +X509V3_CTX + * +�x +, * +�me +, * +��i� +); + +632 +STACK_OF +( +CONF_VALUE +�* +X509V3_g�_��i� +( +X509V3_CTX + * +�x +, * +��i� +); + +633 +X509V3_�r�g_� +( +X509V3_CTX + * +�x +, * +�r +); + +634 +X509V3_��i�_� +� +X509V3_CTX + * +�x +, +STACK_OF +( +CONF_VALUE +�* +��i� +); + +635 +X509V3_�t_�x +( +X509V3_CTX + * +�x +, +X509 + * +issu� +, X509 * +subje� +, + +636 +X509_REQ + * +�q +, +X509_CRL + * +�l +, +�ags +); + +638 +X509V3_add_v�ue +(cڡ * +�me +, cڡ * +v�ue +, + +639 +STACK_OF +( +CONF_VALUE +�** +ex�i� +); + +640 +X509V3_add_v�ue_uch� +(cڡ * +�me +, cڡ * +v�ue +, + +641 +STACK_OF +( +CONF_VALUE +�** +ex�i� +); + +642 +X509V3_add_v�ue_bo� +(cڡ * +�me +, +a�1_bo� +, + +643 +STACK_OF +( +CONF_VALUE +�** +ex�i� +); + +644 +X509V3_add_v�ue_�t +(cڡ * +�me +, +ASN1_INTEGER + * +a�t +, + +645 +STACK_OF +( +CONF_VALUE +�** +ex�i� +); + +646 * +i2s_ASN1_INTEGER +( +X509V3_EXT_METHOD + * +m�h +, +ASN1_INTEGER + * +a�t +); + +647 +ASN1_INTEGER + * +s2i_ASN1_INTEGER +( +X509V3_EXT_METHOD + * +m�h +, * +v�ue +); + +648 * +i2s_ASN1_ENUMERATED +( +X509V3_EXT_METHOD + * +m�h +, +ASN1_ENUMERATED + * +a�t +); + +649 * +i2s_ASN1_ENUMERATED_TABLE +( +X509V3_EXT_METHOD + * +m�h +, +ASN1_ENUMERATED + * +a�t +); + +650 +X509V3_EXT_add +( +X509V3_EXT_METHOD + * +ext +); + +651 +X509V3_EXT_add_li� +( +X509V3_EXT_METHOD + * +ex�i� +); + +652 +X509V3_EXT_add_��s +( +nid_to +, +nid_�om +); + +653 +X509V3_EXT_��nup +(); + +655 cڡ +X509V3_EXT_METHOD + * +X509V3_EXT_g� +( +X509_EXTENSION + * +ext +); + +656 cڡ +X509V3_EXT_METHOD + * +X509V3_EXT_g�_nid +( +nid +); + +657 +X509V3_add_��d�d_ex�nsi�s +(); + +658 +STACK_OF +( +CONF_VALUE +�* +X509V3_�r�_li� +(cڡ * +l�e +); + +659 * +X509V3_EXT_d2i +( +X509_EXTENSION + * +ext +); + +660 * +X509V3_g�_d2i +( +STACK_OF +( +X509_EXTENSION +�* +x +, +nid +, * +�� +, * +idx +); + +663 +X509_EXTENSION + * +X509V3_EXT_i2d +( +ext_nid +, +�� +, * +ext_�ruc +); + +664 +X509V3_add1_i2d +( +STACK_OF +( +X509_EXTENSION +�** +x +, +nid +, * +v�ue +, +�� +, +�ags +); + +666 * +hex_to_�r�g +(cڡ * +buf�r +, +�n +); + +667 * +�r�g_to_hex +(cڡ * +�r +, * +�n +); + +668 +�me_cmp +(cڡ * +�me +, cڡ * +cmp +); + +670 +X509V3_EXT_v�_�n +( +BIO + * +out +, +STACK_OF +( +CONF_VALUE +�* +v� +, +�d�t +, + +671 +ml +); + +672 +X509V3_EXT_��t +( +BIO + * +out +, +X509_EXTENSION + * +ext +, +�ag +, +�d�t +); + +673 +X509V3_EXT_��t_� +( +FILE + * +out +, +X509_EXTENSION + * +ext +, +�ag +, +�d�t +); + +675 +X509V3_ex�nsi�s_��t +( +BIO + * +out +, * +t�� +, +STACK_OF +( +X509_EXTENSION +�* +exts +, +�ag +, +�d�t +); + +677 +X509_check_� +( +X509 + * +x +); + +678 +X509_check_pu�o� +( +X509 + * +x +, +id +, +� +); + +679 +X509_su�܋d_ex�nsi� +( +X509_EXTENSION + * +ex +); + +680 +X509_PURPOSE_�t +(* +p +, +pu�o� +); + +681 +X509_check_issued +( +X509 + * +issu� +, X509 * +subje� +); + +682 +X509_check_akid +( +X509 + * +issu� +, +AUTHORITY_KEYID + * +akid +); + +683 +X509_PURPOSE_g�_cou� +(); + +684 +X509_PURPOSE + * +X509_PURPOSE_g�0 +( +idx +); + +685 +X509_PURPOSE_g�_by_�ame +(* +�ame +); + +686 +X509_PURPOSE_g�_by_id +( +id +); + +687 +X509_PURPOSE_add +( +id +, +�u� +, +�ags +, + +688 (* +ck +)(cڡ +X509_PURPOSE + *, cڡ +X509 + *, ), + +689 * +�me +, * +�ame +, * +�g +); + +690 * +X509_PURPOSE_g�0_�me +( +X509_PURPOSE + * +xp +); + +691 * +X509_PURPOSE_g�0_�ame +( +X509_PURPOSE + * +xp +); + +692 +X509_PURPOSE_g�_�u� +( +X509_PURPOSE + * +xp +); + +693 +X509_PURPOSE_��nup +(); + +694 +X509_PURPOSE_g�_id +( +X509_PURPOSE + *); + +696 +STACK_OF +( +OPENSSL_STRING +�* +X509_g�1_ema� +( +X509 + * +x +); + +697 +STACK_OF +( +OPENSSL_STRING +�* +X509_REQ_g�1_ema� +( +X509_REQ + * +x +); + +698 +X509_ema�_� +( +STACK_OF +( +OPENSSL_STRING +�* +sk +); + +699 +STACK_OF +( +OPENSSL_STRING +�* +X509_g�1_oc� +( +X509 + * +x +); + +701 +ASN1_OCTET_STRING + * +a2i_IPADDRESS +(cڡ * +�asc +); + +702 +ASN1_OCTET_STRING + * +a2i_IPADDRESS_NC +(cڡ * +�asc +); + +703 +a2i_�add +(* +�out +, cڡ * +�asc +); + +704 +X509V3_NAME_�om_��i� +( +X509_NAME + * +nm +, +STACK_OF +( +CONF_VALUE +)* +dn_sk +, + +705 +chty� +); + +707 +X509_POLICY_NODE_��t +( +BIO + * +out +, +X509_POLICY_NODE + * +node +, +�d�t +); + +708 +DECLARE_STACK_OF +( +X509_POLICY_NODE +) + +710 #i�de� +OPENSSL_NO_RFC3779 + + +712 + sASR�ge_� + { + +713 +ASN1_INTEGER + * +m� +, * +max +; + +714 } + tASR�ge +; + +716 + #ASIdOrR�ge_id + 0 + + ) + +717 + #ASIdOrR�ge_�nge + 1 + + ) + +719 + sASIdOrR�ge_� + { + +720 +ty� +; + +722 +ASN1_INTEGER + * +id +; + +723 +ASR�ge + * +�nge +; + +724 } +u +; + +725 } + tASIdOrR�ge +; + +727 +STACK_OF +( + tASIdOrR�ge +� + tASIdOrR�ges +; + +728 +DECLARE_STACK_OF +( +ASIdOrR�ge +) + +730 + #ASId�tif�rChoi�_�h�� + 0 + + ) + +731 + #ASId�tif�rChoi�_asIdsOrR�ges + 1 + + ) + +733 + sASId�tif�rChoi�_� + { + +734 +ty� +; + +736 +ASN1_NULL + * +�h�� +; + +737 +ASIdOrR�ges + * +asIdsOrR�ges +; + +738 } +u +; + +739 } + tASId�tif�rChoi� +; + +741 + sASId�tif�rs_� + { + +742 +ASId�tif�rChoi� + * +a�um +, * +rdi +; + +743 } + tASId�tif�rs +; + +745 +DECLARE_ASN1_FUNCTIONS +( +ASR�ge +) + +746 +DECLARE_ASN1_FUNCTIONS +( +ASIdOrR�ge +) + +747 +DECLARE_ASN1_FUNCTIONS +( +ASId�tif�rChoi� +) + +748 +DECLARE_ASN1_FUNCTIONS +( +ASId�tif�rs +) + +751 + sIPAdd�ssR�ge_� + { + +752 +ASN1_BIT_STRING + * +m� +, * +max +; + +753 } + tIPAdd�ssR�ge +; + +755 + #IPAdd�ssOrR�ge_add�ssP�fix + 0 + + ) + +756 + #IPAdd�ssOrR�ge_add�ssR�ge + 1 + + ) + +758 + sIPAdd�ssOrR�ge_� + { + +759 +ty� +; + +761 +ASN1_BIT_STRING + * +add�ssP�fix +; + +762 +IPAdd�ssR�ge + * +add�ssR�ge +; + +763 } +u +; + +764 } + tIPAdd�ssOrR�ge +; + +766 +STACK_OF +( + tIPAdd�ssOrR�ge +� + tIPAdd�ssOrR�ges +; + +767 +DECLARE_STACK_OF +( +IPAdd�ssOrR�ge +) + +769 + #IPAdd�ssChoi�_�h�� + 0 + + ) + +770 + #IPAdd�ssChoi�_add�s�sOrR�ges + 1 + + ) + +772 + sIPAdd�ssChoi�_� + { + +773 +ty� +; + +775 +ASN1_NULL + * +�h�� +; + +776 +IPAdd�ssOrR�ges + * +add�s�sOrR�ges +; + +777 } +u +; + +778 } + tIPAdd�ssChoi� +; + +780 + sIPAdd�ssFam�y_� + { + +781 +ASN1_OCTET_STRING + * +add�ssFam�y +; + +782 +IPAdd�ssChoi� + * +�Add�ssChoi� +; + +783 } + tIPAdd�ssFam�y +; + +785 +STACK_OF +( + tIPAdd�ssFam�y +� + tIPAddrBlocks +; + +786 +DECLARE_STACK_OF +( +IPAdd�ssFam�y +) + +788 +DECLARE_ASN1_FUNCTIONS +( +IPAdd�ssR�ge +) + +789 +DECLARE_ASN1_FUNCTIONS +( +IPAdd�ssOrR�ge +) + +790 +DECLARE_ASN1_FUNCTIONS +( +IPAdd�ssChoi� +) + +791 +DECLARE_ASN1_FUNCTIONS +( +IPAdd�ssFam�y +) + +796 + #V3_ASID_ASNUM + 0 + + ) + +797 + #V3_ASID_RDI + 1 + + ) + +805 + #IANA_AFI_IPV4 + 1 + + ) + +806 + #IANA_AFI_IPV6 + 2 + + ) + +813 +v3_asid_add_�h�� +( +ASId�tif�rs + * +asid +, +which +); + +814 +v3_asid_add_id_�_�nge +( +ASId�tif�rs + * +asid +, +which +, + +815 +ASN1_INTEGER + * +m� +, ASN1_INTEGER * +max +); + +816 +v3_addr_add_�h�� +( +IPAddrBlocks + * +addr +, + +817 cڡ +afi +, cڡ * +�fi +); + +818 +v3_addr_add_�efix +( +IPAddrBlocks + * +addr +, + +819 cڡ +afi +, cڡ * +�fi +, + +820 * +a +, cڡ +�efix�n +); + +821 +v3_addr_add_�nge +( +IPAddrBlocks + * +addr +, + +822 cڡ +afi +, cڡ * +�fi +, + +823 * +m� +, * +max +); + +824 +v3_addr_g�_afi +(cڡ +IPAdd�ssFam�y + * +f +); + +825 +v3_addr_g�_�nge +( +IPAdd�ssOrR�ge + * +a� +, cڡ +afi +, + +826 * +m� +, * +max +, + +827 cڡ +�ngth +); + +832 +v3_asid_is_�n�i�l +( +ASId�tif�rs + * +asid +); + +833 +v3_addr_is_�n�i�l +( +IPAddrBlocks + * +addr +); + +834 +v3_asid_�n�ize +( +ASId�tif�rs + * +asid +); + +835 +v3_addr_�n�ize +( +IPAddrBlocks + * +addr +); + +840 +v3_asid_�h��s +( +ASId�tif�rs + * +asid +); + +841 +v3_addr_�h��s +( +IPAddrBlocks + * +addr +); + +842 +v3_asid_sub�t +( +ASId�tif�rs + * +a +, ASId�tif�r�* +b +); + +843 +v3_addr_sub�t +( +IPAddrBlocks + * +a +, IPAddrBlock�* +b +); + +848 +v3_asid_v�id�e_�th +( +X509_STORE_CTX + *); + +849 +v3_addr_v�id�e_�th +( +X509_STORE_CTX + *); + +850 +v3_asid_v�id�e_�sour�_�t +( +STACK_OF +( +X509 +�* +cha� +, + +851 +ASId�tif�rs + * +ext +, + +852 +�low_�h���� +); + +853 +v3_addr_v�id�e_�sour�_�t +( +STACK_OF +( +X509 +�* +cha� +, + +854 +IPAddrBlocks + * +ext +, + +855 +�low_�h���� +); + +863 +ERR_l�d_X509V3_�r�gs +(); + +868 + #X509V3_F_A2I_GENERAL_NAME + 164 + + ) + +869 + #X509V3_F_ASIDENTIFIERCHOICE_CANONIZE + 161 + + ) + +870 + #X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL + 162 + + ) + +871 + #X509V3_F_COPY_EMAIL + 122 + + ) + +872 + #X509V3_F_COPY_ISSUER + 123 + + ) + +873 + #X509V3_F_DO_DIRNAME + 144 + + ) + +874 + #X509V3_F_DO_EXT_CONF + 124 + + ) + +875 + #X509V3_F_DO_EXT_I2D + 135 + + ) + +876 + #X509V3_F_DO_EXT_NCONF + 151 + + ) + +877 + #X509V3_F_DO_I2V_NAME_CONSTRAINTS + 148 + + ) + +878 + #X509V3_F_GNAMES_FROM_SECTNAME + 156 + + ) + +879 + #X509V3_F_HEX_TO_STRING + 111 + + ) + +880 + #X509V3_F_I2S_ASN1_ENUMERATED + 121 + + ) + +881 + #X509V3_F_I2S_ASN1_IA5STRING + 149 + + ) + +882 + #X509V3_F_I2S_ASN1_INTEGER + 120 + + ) + +883 + #X509V3_F_I2V_AUTHORITY_INFO_ACCESS + 138 + + ) + +884 + #X509V3_F_NOTICE_SECTION + 132 + + ) + +885 + #X509V3_F_NREF_NOS + 133 + + ) + +886 + #X509V3_F_POLICY_SECTION + 131 + + ) + +887 + #X509V3_F_PROCESS_PCI_VALUE + 150 + + ) + +888 + #X509V3_F_R2I_CERTPOL + 130 + + ) + +889 + #X509V3_F_R2I_PCI + 155 + + ) + +890 + #X509V3_F_S2I_ASN1_IA5STRING + 100 + + ) + +891 + #X509V3_F_S2I_ASN1_INTEGER + 108 + + ) + +892 + #X509V3_F_S2I_ASN1_OCTET_STRING + 112 + + ) + +893 + #X509V3_F_S2I_ASN1_SKEY_ID + 114 + + ) + +894 + #X509V3_F_S2I_SKEY_ID + 115 + + ) + +895 + #X509V3_F_SET_DIST_POINT_NAME + 158 + + ) + +896 + #X509V3_F_STRING_TO_HEX + 113 + + ) + +897 + #X509V3_F_SXNET_ADD_ID_ASC + 125 + + ) + +898 + #X509V3_F_SXNET_ADD_ID_INTEGER + 126 + + ) + +899 + #X509V3_F_SXNET_ADD_ID_ULONG + 127 + + ) + +900 + #X509V3_F_SXNET_GET_ID_ASC + 128 + + ) + +901 + #X509V3_F_SXNET_GET_ID_ULONG + 129 + + ) + +902 + #X509V3_F_V2I_ASIDENTIFIERS + 163 + + ) + +903 + #X509V3_F_V2I_ASN1_BIT_STRING + 101 + + ) + +904 + #X509V3_F_V2I_AUTHORITY_INFO_ACCESS + 139 + + ) + +905 + #X509V3_F_V2I_AUTHORITY_KEYID + 119 + + ) + +906 + #X509V3_F_V2I_BASIC_CONSTRAINTS + 102 + + ) + +907 + #X509V3_F_V2I_CRLD + 134 + + ) + +908 + #X509V3_F_V2I_EXTENDED_KEY_USAGE + 103 + + ) + +909 + #X509V3_F_V2I_GENERAL_NAMES + 118 + + ) + +910 + #X509V3_F_V2I_GENERAL_NAME_EX + 117 + + ) + +911 + #X509V3_F_V2I_IDP + 157 + + ) + +912 + #X509V3_F_V2I_IPADDRBLOCKS + 159 + + ) + +913 + #X509V3_F_V2I_ISSUER_ALT + 153 + + ) + +914 + #X509V3_F_V2I_NAME_CONSTRAINTS + 147 + + ) + +915 + #X509V3_F_V2I_POLICY_CONSTRAINTS + 146 + + ) + +916 + #X509V3_F_V2I_POLICY_MAPPINGS + 145 + + ) + +917 + #X509V3_F_V2I_SUBJECT_ALT + 154 + + ) + +918 + #X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL + 160 + + ) + +919 + #X509V3_F_V3_GENERIC_EXTENSION + 116 + + ) + +920 + #X509V3_F_X509V3_ADD1_I2D + 140 + + ) + +921 + #X509V3_F_X509V3_ADD_VALUE + 105 + + ) + +922 + #X509V3_F_X509V3_EXT_ADD + 104 + + ) + +923 + #X509V3_F_X509V3_EXT_ADD_ALIAS + 106 + + ) + +924 + #X509V3_F_X509V3_EXT_CONF + 107 + + ) + +925 + #X509V3_F_X509V3_EXT_I2D + 136 + + ) + +926 + #X509V3_F_X509V3_EXT_NCONF + 152 + + ) + +927 + #X509V3_F_X509V3_GET_SECTION + 142 + + ) + +928 + #X509V3_F_X509V3_GET_STRING + 143 + + ) + +929 + #X509V3_F_X509V3_GET_VALUE_BOOL + 110 + + ) + +930 + #X509V3_F_X509V3_PARSE_LIST + 109 + + ) + +931 + #X509V3_F_X509_PURPOSE_ADD + 137 + + ) + +932 + #X509V3_F_X509_PURPOSE_SET + 141 + + ) + +935 + #X509V3_R_BAD_IP_ADDRESS + 118 + + ) + +936 + #X509V3_R_BAD_OBJECT + 119 + + ) + +937 + #X509V3_R_BN_DEC2BN_ERROR + 100 + + ) + +938 + #X509V3_R_BN_TO_ASN1_INTEGER_ERROR + 101 + + ) + +939 + #X509V3_R_DIRNAME_ERROR + 149 + + ) + +940 + #X509V3_R_DISTPOINT_ALREADY_SET + 160 + + ) + +941 + #X509V3_R_DUPLICATE_ZONE_ID + 133 + + ) + +942 + #X509V3_R_ERROR_CONVERTING_ZONE + 131 + + ) + +943 + #X509V3_R_ERROR_CREATING_EXTENSION + 144 + + ) + +944 + #X509V3_R_ERROR_IN_EXTENSION + 128 + + ) + +945 + #X509V3_R_EXPECTED_A_SECTION_NAME + 137 + + ) + +946 + #X509V3_R_EXTENSION_EXISTS + 145 + + ) + +947 + #X509V3_R_EXTENSION_NAME_ERROR + 115 + + ) + +948 + #X509V3_R_EXTENSION_NOT_FOUND + 102 + + ) + +949 + #X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED + 103 + + ) + +950 + #X509V3_R_EXTENSION_VALUE_ERROR + 116 + + ) + +951 + #X509V3_R_ILLEGAL_EMPTY_EXTENSION + 151 + + ) + +952 + #X509V3_R_ILLEGAL_HEX_DIGIT + 113 + + ) + +953 + #X509V3_R_INCORRECT_POLICY_SYNTAX_TAG + 152 + + ) + +954 + #X509V3_R_INVALID_MULTIPLE_RDNS + 161 + + ) + +955 + #X509V3_R_INVALID_ASNUMBER + 162 + + ) + +956 + #X509V3_R_INVALID_ASRANGE + 163 + + ) + +957 + #X509V3_R_INVALID_BOOLEAN_STRING + 104 + + ) + +958 + #X509V3_R_INVALID_EXTENSION_STRING + 105 + + ) + +959 + #X509V3_R_INVALID_INHERITANCE + 165 + + ) + +960 + #X509V3_R_INVALID_IPADDRESS + 166 + + ) + +961 + #X509V3_R_INVALID_NAME + 106 + + ) + +962 + #X509V3_R_INVALID_NULL_ARGUMENT + 107 + + ) + +963 + #X509V3_R_INVALID_NULL_NAME + 108 + + ) + +964 + #X509V3_R_INVALID_NULL_VALUE + 109 + + ) + +965 + #X509V3_R_INVALID_NUMBER + 140 + + ) + +966 + #X509V3_R_INVALID_NUMBERS + 141 + + ) + +967 + #X509V3_R_INVALID_OBJECT_IDENTIFIER + 110 + + ) + +968 + #X509V3_R_INVALID_OPTION + 138 + + ) + +969 + #X509V3_R_INVALID_POLICY_IDENTIFIER + 134 + + ) + +970 + #X509V3_R_INVALID_PROXY_POLICY_SETTING + 153 + + ) + +971 + #X509V3_R_INVALID_PURPOSE + 146 + + ) + +972 + #X509V3_R_INVALID_SAFI + 164 + + ) + +973 + #X509V3_R_INVALID_SECTION + 135 + + ) + +974 + #X509V3_R_INVALID_SYNTAX + 143 + + ) + +975 + #X509V3_R_ISSUER_DECODE_ERROR + 126 + + ) + +976 + #X509V3_R_MISSING_VALUE + 124 + + ) + +977 + #X509V3_R_NEED_ORGANIZATION_AND_NUMBERS + 142 + + ) + +978 + #X509V3_R_NO_CONFIG_DATABASE + 136 + + ) + +979 + #X509V3_R_NO_ISSUER_CERTIFICATE + 121 + + ) + +980 + #X509V3_R_NO_ISSUER_DETAILS + 127 + + ) + +981 + #X509V3_R_NO_POLICY_IDENTIFIER + 139 + + ) + +982 + #X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED + 154 + + ) + +983 + #X509V3_R_NO_PUBLIC_KEY + 114 + + ) + +984 + #X509V3_R_NO_SUBJECT_DETAILS + 125 + + ) + +985 + #X509V3_R_ODD_NUMBER_OF_DIGITS + 112 + + ) + +986 + #X509V3_R_OPERATION_NOT_DEFINED + 148 + + ) + +987 + #X509V3_R_OTHERNAME_ERROR + 147 + + ) + +988 + #X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED + 155 + + ) + +989 + #X509V3_R_POLICY_PATH_LENGTH + 156 + + ) + +990 + #X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED + 157 + + ) + +991 + #X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED + 158 + + ) + +992 + #X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY + 159 + + ) + +993 + #X509V3_R_SECTION_NOT_FOUND + 150 + + ) + +994 + #X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS + 122 + + ) + +995 + #X509V3_R_UNABLE_TO_GET_ISSUER_KEYID + 123 + + ) + +996 + #X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT + 111 + + ) + +997 + #X509V3_R_UNKNOWN_EXTENSION + 129 + + ) + +998 + #X509V3_R_UNKNOWN_EXTENSION_NAME + 130 + + ) + +999 + #X509V3_R_UNKNOWN_OPTION + 120 + + ) + +1000 + #X509V3_R_UNSUPPORTED_OPTION + 117 + + ) + +1001 + #X509V3_R_UNSUPPORTED_TYPE + 167 + + ) + +1002 + #X509V3_R_USER_TOO_LONG + 132 + + ) + +1004 #ifde� +__�lu�lus + + + @/usr/include/poll.h + +1 + ~<sys/p�l.h +> + + @/usr/include/pthread.h + +18 #i�de� +_PTHREAD_H + + +19 + #_PTHREAD_H + 1 + + ) + +21 + ~<�u�s.h +> + +22 + ~<�d�n.h +> + +23 + ~<sched.h +> + +24 + ~<time.h +> + +26 + ~<b�s/�h�adty�s.h +> + +27 + ~<b�s/�tjmp.h +> + +28 + ~<b�s/w�dsize.h +> + +34 + mPTHREAD_CREATE_JOINABLE +, + +35 + #PTHREAD_CREATE_JOINABLE + +PTHREAD_CREATE_JOINABLE + + + ) + +36 + mPTHREAD_CREATE_DETACHED + + +37 + #PTHREAD_CREATE_DETACHED + +PTHREAD_CREATE_DETACHED + + + ) + +44 + mPTHREAD_MUTEX_TIMED_NP +, + +45 + mPTHREAD_MUTEX_RECURSIVE_NP +, + +46 + mPTHREAD_MUTEX_ERRORCHECK_NP +, + +47 + mPTHREAD_MUTEX_ADAPTIVE_NP + + +48 #i� +def�ed + +__USE_UNIX98 + || def�ed +__USE_XOPEN2K8 + + +50 + mPTHREAD_MUTEX_NORMAL + = +PTHREAD_MUTEX_TIMED_NP +, + +51 + mPTHREAD_MUTEX_RECURSIVE + = +PTHREAD_MUTEX_RECURSIVE_NP +, + +52 + mPTHREAD_MUTEX_ERRORCHECK + = +PTHREAD_MUTEX_ERRORCHECK_NP +, + +53 + mPTHREAD_MUTEX_DEFAULT + = +PTHREAD_MUTEX_NORMAL + + +55 #ifde� +__USE_GNU + + +57 , + mPTHREAD_MUTEX_FAST_NP + = +PTHREAD_MUTEX_TIMED_NP + + +62 #ifde� +__USE_XOPEN2K + + +66 + mPTHREAD_MUTEX_STALLED +, + +67 + mPTHREAD_MUTEX_STALLED_NP + = +PTHREAD_MUTEX_STALLED +, + +68 + mPTHREAD_MUTEX_ROBUST +, + +69 + mPTHREAD_MUTEX_ROBUST_NP + = +PTHREAD_MUTEX_ROBUST + + +74 #i� +def�ed + +__USE_POSIX199506 + || def�ed +__USE_UNIX98 + + +78 + mPTHREAD_PRIO_NONE +, + +79 + mPTHREAD_PRIO_INHERIT +, + +80 + mPTHREAD_PRIO_PROTECT + + +86 #i� +__PTHREAD_MUTEX_HAVE_ELISION + == 1 + +87 + #__PTHREAD_SPINS + 0, 0 + + ) + +88 #�i� +__PTHREAD_MUTEX_HAVE_ELISION + == 2 + +89 + #__PTHREAD_SPINS + { 0, 0 } + + ) + +91 + #__PTHREAD_SPINS + 0 + + ) + +94 #ifde� +__PTHREAD_MUTEX_HAVE_PREV + + +95 + #PTHREAD_MUTEX_INITIALIZER + \ + +96 { { 0, 0, 0, 0, 0, +__PTHREAD_SPINS +, { 0, 0 } } } + + ) + +97 #ifde� +__USE_GNU + + +98 + #PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP + \ + +99 { { 0, 0, 0, 0, +PTHREAD_MUTEX_RECURSIVE_NP +, +__PTHREAD_SPINS +, { 0, 0 } } } + + ) + +100 + #PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP + \ + +101 { { 0, 0, 0, 0, +PTHREAD_MUTEX_ERRORCHECK_NP +, +__PTHREAD_SPINS +, { 0, 0 } } } + + ) + +102 + #PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP + \ + +103 { { 0, 0, 0, 0, +PTHREAD_MUTEX_ADAPTIVE_NP +, +__PTHREAD_SPINS +, { 0, 0 } } } + + ) + +104 + #PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP + \ + +105 { { 0, 0, 0, 0, +PTHREAD_MUTEX_ADAPTIVE_NP +, +__PTHREAD_SPINS +, { 0, 0 } } } + + ) + +109 + #PTHREAD_MUTEX_INITIALIZER + \ + +110 { { 0, 0, 0, 0, 0, { +__PTHREAD_SPINS + } } } + + ) + +111 #ifde� +__USE_GNU + + +112 + #PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP + \ + +113 { { 0, 0, 0, +PTHREAD_MUTEX_RECURSIVE_NP +, 0, { +__PTHREAD_SPINS + } } } + + ) + +114 + #PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP + \ + +115 { { 0, 0, 0, +PTHREAD_MUTEX_ERRORCHECK_NP +, 0, { +__PTHREAD_SPINS + } } } + + ) + +116 + #PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP + \ + +117 { { 0, 0, 0, +PTHREAD_MUTEX_ADAPTIVE_NP +, 0, { +__PTHREAD_SPINS + } } } + + ) + +124 #i� +def�ed + +__USE_UNIX98 + || def�ed +__USE_XOPEN2K + + +127 + mPTHREAD_RWLOCK_PREFER_READER_NP +, + +128 + mPTHREAD_RWLOCK_PREFER_WRITER_NP +, + +129 + mPTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP +, + +130 + mPTHREAD_RWLOCK_DEFAULT_NP + = +PTHREAD_RWLOCK_PREFER_READER_NP + + +136 #i�de� +__PTHREAD_RWLOCK_INT_FLAGS_SHARED + + +137 #i� +__WORDSIZE + == 64 + +138 + #__PTHREAD_RWLOCK_INT_FLAGS_SHARED + 1 + + ) + +143 + #PTHREAD_RWLOCK_INITIALIZER + \ + +144 { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } + + ) + +145 #ifde� +__USE_GNU + + +146 #ifde� +__PTHREAD_RWLOCK_INT_FLAGS_SHARED + + +147 + #PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP + \ + +149 +PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP + } } + + ) + +151 #i� +__BYTE_ORDER + =� +__LITTLE_ENDIAN + + +152 + #PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP + \ + +153 { { 0, 0, 0, 0, 0, 0, +PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP +, \ + +154 0, 0, 0, 0 } } + + ) + +156 + #PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP + \ + +157 { { 0, 0, 0, 0, 0, 0, 0, 0, 0, +PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP +,\ + +158 0 } } + + ) + +168 + mPTHREAD_INHERIT_SCHED +, + +169 + #PTHREAD_INHERIT_SCHED + +PTHREAD_INHERIT_SCHED + + + ) + +170 + mPTHREAD_EXPLICIT_SCHED + + +171 + #PTHREAD_EXPLICIT_SCHED + +PTHREAD_EXPLICIT_SCHED + + + ) + +178 + mPTHREAD_SCOPE_SYSTEM +, + +179 + #PTHREAD_SCOPE_SYSTEM + +PTHREAD_SCOPE_SYSTEM + + + ) + +180 + mPTHREAD_SCOPE_PROCESS + + +181 + #PTHREAD_SCOPE_PROCESS + +PTHREAD_SCOPE_PROCESS + + + ) + +188 + mPTHREAD_PROCESS_PRIVATE +, + +189 + #PTHREAD_PROCESS_PRIVATE + +PTHREAD_PROCESS_PRIVATE + + + ) + +190 + mPTHREAD_PROCESS_SHARED + + +191 + #PTHREAD_PROCESS_SHARED + +PTHREAD_PROCESS_SHARED + + + ) + +197 + #PTHREAD_COND_INITIALIZER + { { 0, 0, 0, 0, 0, (*�0, 0, 0 } } + + ) + +201 + s_�h�ad_��nup_buf�r + + +203 (* + m__rout�e +) (*); + +204 * + m__�g +; + +205 + m__�n��y� +; + +206 +_�h�ad_��nup_buf�r + * + m__�ev +; + +212 + mPTHREAD_CANCEL_ENABLE +, + +213 + #PTHREAD_CANCEL_ENABLE + +PTHREAD_CANCEL_ENABLE + + + ) + +214 + mPTHREAD_CANCEL_DISABLE + + +215 + #PTHREAD_CANCEL_DISABLE + +PTHREAD_CANCEL_DISABLE + + + ) + +219 + mPTHREAD_CANCEL_DEFERRED +, + +220 + #PTHREAD_CANCEL_DEFERRED + +PTHREAD_CANCEL_DEFERRED + + + ) + +221 + mPTHREAD_CANCEL_ASYNCHRONOUS + + +222 + #PTHREAD_CANCEL_ASYNCHRONOUS + +PTHREAD_CANCEL_ASYNCHRONOUS + + + ) + +224 + #PTHREAD_CANCELED + ((*�-1) + + ) + +228 + #PTHREAD_ONCE_INIT + 0 + + ) + +231 #ifde� +__USE_XOPEN2K + + +235 + #PTHREAD_BARRIER_SERIAL_THREAD + -1 + + ) + +239 +__BEGIN_DECLS + + +244 +�h�ad_��� + ( +�h�ad_t + * +__��ri� + +__�wth�ad +, + +245 cڡ +�h�ad_��_t + * +__��ri� + +__�� +, + +246 *(* +__��t_rout�e +) (*), + +247 * +__��ri� + +__�g +� +__THROWNL + +__n�nu� + ((1, 3)); + +253 + $�h�ad_ex� + (* +__�tv� +� + `__��ibu�__ + (( +__nܑu�__ +)); + +261 + `�h�ad_jo� + ( +�h�ad_t + +__th +, ** +__th�ad_�tu� +); + +263 #ifde� +__USE_GNU + + +266 + $�h�ad_�yjo�_� + ( +�h�ad_t + +__th +, ** +__th�ad_�tu� +� +__THROW +; + +274 + `�h�ad_timedjo�_� + ( +�h�ad_t + +__th +, ** +__th�ad_�tu� +, + +275 cڡ +time�ec + * +__ab�ime +); + +282 + $�h�ad_d�ach + ( +�h�ad_t + +__th +� +__THROW +; + +286 +�h�ad_t + + $�h�ad_�lf + (� +__THROW + + `__��ibu�__ + (( +__cڡ__ +)); + +289 + $�h�ad_equ� + ( +�h�ad_t + +__th�ad1 +,�th�ad_� +__th�ad2 +) + +290 +__THROW + + `__��ibu�__ + (( +__cڡ__ +)); + +298 + $�h�ad_��_�� + ( +�h�ad_��_t + * +__�� +� +__THROW + + `__n�nu� + ((1)); + +301 + $�h�ad_��_de�roy + ( +�h�ad_��_t + * +__�� +) + +302 +__THROW + + `__n�nu� + ((1)); + +305 + $�h�ad_��_g�d�ach��e + (cڡ +�h�ad_��_t + * +__�� +, + +306 * +__d�ach��e +) + +307 +__THROW + + `__n�nu� + ((1, 2)); + +310 + $�h�ad_��_�td�ach��e + ( +�h�ad_��_t + * +__�� +, + +311 +__d�ach��e +) + +312 +__THROW + + `__n�nu� + ((1)); + +316 + $�h�ad_��_g�gu�dsize + (cڡ +�h�ad_��_t + * +__�� +, + +317 +size_t + * +__gu�dsize +) + +318 +__THROW + + `__n�nu� + ((1, 2)); + +321 + $�h�ad_��_�tgu�dsize + ( +�h�ad_��_t + * +__�� +, + +322 +size_t + +__gu�dsize +) + +323 +__THROW + + `__n�nu� + ((1)); + +327 + $�h�ad_��_g�sched��m + (cڡ +�h�ad_��_t + * +__��ri� + +__�� +, + +328 +sched_��m + * +__��ri� + +__��m +) + +329 +__THROW + + `__n�nu� + ((1, 2)); + +332 + $�h�ad_��_�tsched��m + ( +�h�ad_��_t + * +__��ri� + +__�� +, + +333 cڡ +sched_��m + * +__��ri� + + +334 +__��m +� +__THROW + + `__n�nu� + ((1, 2)); + +337 + $�h�ad_��_g�schedp�icy + (cڡ +�h�ad_��_t + * +__��ri� + + +338 +__�� +, * +__��ri� + +__p�icy +) + +339 +__THROW + + `__n�nu� + ((1, 2)); + +342 + $�h�ad_��_�tschedp�icy + ( +�h�ad_��_t + * +__�� +, +__p�icy +) + +343 +__THROW + + `__n�nu� + ((1)); + +346 + $�h�ad_��_g��h��sched + (cڡ +�h�ad_��_t + * +__��ri� + + +347 +__�� +, * +__��ri� + +__�h�� +) + +348 +__THROW + + `__n�nu� + ((1, 2)); + +351 + $�h�ad_��_�t�h��sched + ( +�h�ad_��_t + * +__�� +, + +352 +__�h�� +) + +353 +__THROW + + `__n�nu� + ((1)); + +357 + $�h�ad_��_g�sc�e + (cڡ +�h�ad_��_t + * +__��ri� + +__�� +, + +358 * +__��ri� + +__sc�e +) + +359 +__THROW + + `__n�nu� + ((1, 2)); + +362 + $�h�ad_��_�tsc�e + ( +�h�ad_��_t + * +__�� +, +__sc�e +) + +363 +__THROW + + `__n�nu� + ((1)); + +366 + $�h�ad_��_g��ackaddr + (cڡ +�h�ad_��_t + * +__��ri� + + +367 +__�� +, ** +__��ri� + +__�ackaddr +) + +368 +__THROW + + `__n�nu� + ((1, 2)� +__��ibu�_d����d__ +; + +374 + $�h�ad_��_�t�ackaddr + ( +�h�ad_��_t + * +__�� +, + +375 * +__�ackaddr +) + +376 +__THROW + + `__n�nu� + ((1)� +__��ibu�_d����d__ +; + +379 + $�h�ad_��_g��acksize + (cڡ +�h�ad_��_t + * +__��ri� + + +380 +__�� +, +size_t + * +__��ri� + +__�acksize +) + +381 +__THROW + + `__n�nu� + ((1, 2)); + +386 + $�h�ad_��_�t�acksize + ( +�h�ad_��_t + * +__�� +, + +387 +size_t + +__�acksize +) + +388 +__THROW + + `__n�nu� + ((1)); + +390 #ifde� +__USE_XOPEN2K + + +392 + $�h�ad_��_g��ack + (cڡ +�h�ad_��_t + * +__��ri� + +__�� +, + +393 ** +__��ri� + +__�ackaddr +, + +394 +size_t + * +__��ri� + +__�acksize +) + +395 +__THROW + + `__n�nu� + ((1, 2, 3)); + +400 + $�h�ad_��_�t�ack + ( +�h�ad_��_t + * +__�� +, * +__�ackaddr +, + +401 +size_t + +__�acksize +� +__THROW + + `__n�nu� + ((1)); + +404 #ifde� +__USE_GNU + + +407 + $�h�ad_��_��ff��y_� + ( +�h�ad_��_t + * +__�� +, + +408 +size_t + +__�u�tsize +, + +409 cڡ +�u_�t_t + * +__�u�t +) + +410 +__THROW + + `__n�nu� + ((1, 3)); + +414 + $�h�ad_��_g�aff��y_� + (cڡ +�h�ad_��_t + * +__�� +, + +415 +size_t + +__�u�tsize +, + +416 +�u_�t_t + * +__�u�t +) + +417 +__THROW + + `__n�nu� + ((1, 3)); + +420 + $�h�ad_g���_de�u�_� + ( +�h�ad_��_t + * +__�� +) + +421 +__THROW + + `__n�nu� + ((1)); + +425 + $�h�ad_���r_de�u�_� + (cڡ +�h�ad_��_t + * +__�� +) + +426 +__THROW + + `__n�nu� + ((1)); + +431 + $�h�ad_g���_� + ( +�h�ad_t + +__th +, +�h�ad_��_t + * +__�� +) + +432 +__THROW + + `__n�nu� + ((2)); + +440 + $�h�ad_�tsched��m + ( +�h�ad_t + +__�rg�_th�ad +, +__p�icy +, + +441 cڡ +sched_��m + * +__��m +) + +442 +__THROW + + `__n�nu� + ((3)); + +445 + $�h�ad_g�sched��m + ( +�h�ad_t + +__�rg�_th�ad +, + +446 * +__��ri� + +__p�icy +, + +447 +sched_��m + * +__��ri� + +__��m +) + +448 +__THROW + + `__n�nu� + ((2, 3)); + +451 + $�h�ad_�tsched�io + ( +�h�ad_t + +__�rg�_th�ad +, +__�io +) + +452 +__THROW +; + +455 #ifde� +__USE_GNU + + +457 + $�h�ad_g��me_� + ( +�h�ad_t + +__�rg�_th�ad +, * +__buf +, + +458 +size_t + +__bu� +) + +459 +__THROW + + `__n�nu� + ((2)); + +462 + $�h�ad_��ame_� + ( +�h�ad_t + +__�rg�_th�ad +, cڡ * +__�me +) + +463 +__THROW + + `__n�nu� + ((2)); + +467 #ifde� +__USE_UNIX98 + + +469 + $�h�ad_g�c�cu��cy + (� +__THROW +; + +472 + $�h�ad_�tc�cu��cy + ( +__�v� +� +__THROW +; + +475 #ifde� +__USE_GNU + + +480 + $�h�ad_y�ld + (� +__THROW +; + +485 + $�h�ad_��ff��y_� + ( +�h�ad_t + +__th +, +size_t + +__�u�tsize +, + +486 cڡ +�u_�t_t + * +__�u�t +) + +487 +__THROW + + `__n�nu� + ((3)); + +490 + $�h�ad_g�aff��y_� + ( +�h�ad_t + +__th +, +size_t + +__�u�tsize +, + +491 +�u_�t_t + * +__�u�t +) + +492 +__THROW + + `__n�nu� + ((3)); + +505 + `�h�ad_�� + ( +�h�ad_��_t + * +__��_cڌ� +, + +506 (* +__��_rout�e +�()� + `__n�nu� + ((1, 2)); + +517 + `�h�ad_�t�n�l��e + ( +__��e +, * +__�d��e +); + +521 + `�h�ad_�t�n��y� + ( +__ty� +, * +__�dty� +); + +524 + `�h�ad_�n�l + ( +�h�ad_t + +__th +); + +529 + `�h�ad_���n�l + (); + +538 +__jmp_buf + +__�n�l_jmp_buf +; + +539 +__mask_was_�ved +; + +540 } +__�n�l_jmp_buf +[1]; + +541 * +__�d +[4]; + +542 } + t__�h�ad_unw�d_buf_t + + t__��ibu�__ + (( + t__�ig�d__ +)); + +545 #i�de� +__��nup_f�_��ibu� + + +546 + #__��nup_f�_��ibu� + + + ) + +551 + s__�h�ad_��nup_�ame + + +553 (* +__�n�l_rout�e +) (*); + +554 * +__�n�l_�g +; + +555 +__do_� +; + +556 +__�n�l_ty� +; + +559 #i� +def�ed + +__GNUC__ + && def�ed +__EXCEPTIONS + + +560 #ifde� +__�lu�lus + + +562 �as� + c__�h�ad_��nup_�ass + + +564 (* +__�n�l_rout�e +) (*); + +565 * +__�n�l_�g +; + +566 +__do_� +; + +567 +__�n�l_ty� +; + +569 +public +: + +570 + `__�h�ad_��nup_�ass + ((* +__f� +�(*), * +__�g +) + +571 : + `__�n�l_rout�e + ( +__f� +), + `__�n�l_�g + ( +__�g +), + $__do_� + (1) { } + +572 ~ + $__�h�ad_��nup_�ass + (�{ i�( +__do_� +� + `__�n�l_rout�e + ( +__�n�l_�g +); + } +} + +573 + $__�tdo� + ( +__�wv� +�{ +__do_� + = __�wv�; + } +} + +574 + $__de�r + (�{ + `�h�ad_�t�n��y� + ( +PTHREAD_CANCEL_DEFERRED +, + +575 & +__�n�l_ty� +); + } +} + +576 + $__���e + (�cڡ { + `�h�ad_�t�n��y� + ( +__�n�l_ty� +, 0); + } +} + +586 + #�h�ad_��nup_push +( +rout�e +, +�g +) \ + +588 +__�h�ad_��nup_�ass + + `__��ame + ( +rout�e +, +�g +) + + ) + +592 + #�h�ad_��nup_p� +( +execu� +) \ + +593 +__��ame +. + `__�tdo� + ( +execu� +); \ + +594 } 0) + + ) + +596 #ifde� +__USE_GNU + + +600 + #�h�ad_��nup_push_de�r_� +( +rout�e +, +�g +) \ + +602 +__�h�ad_��nup_�ass + + `__��ame + ( +rout�e +, +�g +); \ + +603 +__��ame +. + `__de�r + () + + ) + +608 + #�h�ad_��nup_p�_���e_� +( +execu� +) \ + +609 +__��ame +. + `__���e + (); \ + +610 +__��ame +. + `__�tdo� + ( +execu� +); \ + +611 } 0) + + ) + +618 +__ex��_�l�e + + +619 + $__�h�ad_��nup_rout�e + ( +__�h�ad_��nup_�ame + * +__�ame +) + +621 i�( +__�ame +-> +__do_� +) + +622 +__�ame +-> + `__�n�l_rout�e + (__�ame-> +__�n�l_�g +); + +623 + } +} + +632 + #�h�ad_��nup_push +( +rout�e +, +�g +) \ + +634 +__�h�ad_��nup_�ame + +__��ame + \ + +635 + `__��ibu�__ + (( + `__��nup__ + ( +__�h�ad_��nup_rout�e +))) \ + +636 �{ . +__�n�l_rout�e + = ( +rout�e +), . +__�n�l_�g + = ( +�g +), \ + +637 . +__do_� + = 1 }; + + ) + +641 + #�h�ad_��nup_p� +( +execu� +) \ + +642 +__��ame +. +__do_� + = ( +execu� +); \ + +643 } 0) + + ) + +645 #ifde� +__USE_GNU + + +649 + #�h�ad_��nup_push_de�r_� +( +rout�e +, +�g +) \ + +651 +__�h�ad_��nup_�ame + +__��ame + \ + +652 + `__��ibu�__ + (( + `__��nup__ + ( +__�h�ad_��nup_rout�e +))) \ + +653 �{ . +__�n�l_rout�e + = ( +rout�e +), . +__�n�l_�g + = ( +�g +), \ + +654 . +__do_� + = 1 }; \ + +655 (� + `�h�ad_�t�n��y� + ( +PTHREAD_CANCEL_DEFERRED +, \ + +656 & +__��ame +. +__�n�l_ty� +) + + ) + +661 + #�h�ad_��nup_p�_���e_� +( +execu� +) \ + +662 (� + `�h�ad_�t�n��y� + ( +__��ame +. +__�n�l_ty� +, +NULL +); \ + +663 +__��ame +. +__do_� + = ( +execu� +); \ + +664 } 0) + + ) + +675 + #�h�ad_��nup_push +( +rout�e +, +�g +) \ + +677 +__�h�ad_unw�d_buf_t + +__�n�l_buf +; \ + +678 (* +__�n�l_rout�e +�(*��( +rout�e +); \ + +679 * +__�n�l_�g + = ( +�g +); \ + +680 +__n�_f��_�� + = + `__sig�tjmp + (( +__jmp_buf_�g + *) (*) \ + +681 +__�n�l_buf +. +__�n�l_jmp_buf +, 0); \ + +682 i�( + `__glibc_u�ik�y + ( +__n�_f��_�� +)) \ + +684 + `__�n�l_rout�e + ( +__�n�l_�g +); \ + +685 + `__�h�ad_unw�d_�xt + (& +__�n�l_buf +); \ + +689 + `__�h�ad_�gi��_�n�l + (& +__�n�l_buf +); \ + +690 d�{ + + ) + +691 +__�h�ad_�gi��_�n�l + ( +__�h�ad_unw�d_buf_t + * +__buf +) + +692 +__��nup_f�_��ibu� +; + +696 + #�h�ad_��nup_p� +( +execu� +) \ + +699 + `__�h�ad_u�egi��_�n�l + (& +__�n�l_buf +); \ + +700 i�( +execu� +) \ + +701 + `__�n�l_rout�e + ( +__�n�l_�g +); \ + +702 } 0) + + ) + +703 + $__�h�ad_u�egi��_�n�l + ( +__�h�ad_unw�d_buf_t + * +__buf +) + +704 +__��nup_f�_��ibu� +; + +706 #ifde� +__USE_GNU + + +710 + #�h�ad_��nup_push_de�r_� +( +rout�e +, +�g +) \ + +712 +__�h�ad_unw�d_buf_t + +__�n�l_buf +; \ + +713 (* +__�n�l_rout�e +�(*��( +rout�e +); \ + +714 * +__�n�l_�g + = ( +�g +); \ + +715 +__n�_f��_�� + = + `__sig�tjmp + (( +__jmp_buf_�g + *) (*) \ + +716 +__�n�l_buf +. +__�n�l_jmp_buf +, 0); \ + +717 i�( + `__glibc_u�ik�y + ( +__n�_f��_�� +)) \ + +719 + `__�n�l_rout�e + ( +__�n�l_�g +); \ + +720 + `__�h�ad_unw�d_�xt + (& +__�n�l_buf +); \ + +724 + `__�h�ad_�gi��_�n�l_de�r + (& +__�n�l_buf +); \ + +725 d�{ + + ) + +726 + `__�h�ad_�gi��_�n�l_de�r + ( +__�h�ad_unw�d_buf_t + * +__buf +) + +727 +__��nup_f�_��ibu� +; + +732 + #�h�ad_��nup_p�_���e_� +( +execu� +) \ + +735 + `__�h�ad_u�egi��_�n�l_���e + (& +__�n�l_buf +); \ + +736 i�( +execu� +) \ + +737 + `__�n�l_rout�e + ( +__�n�l_�g +); \ + +738 + } +} 0) + + ) + +739 + $__�h�ad_u�egi��_�n�l_���e + ( +__�h�ad_unw�d_buf_t + * +__buf +) + +740 +__��nup_f�_��ibu� +; + +744 + $__�h�ad_unw�d_�xt + ( +__�h�ad_unw�d_buf_t + * +__buf +) + +745 +__��nup_f�_��ibu� + + `__��ibu�__ + (( +__nܑu�__ +)) + +746 #i�de� +SHARED + + +747 + `__��ibu�__ + (( +__w�k__ +)) + +753 +__jmp_buf_�g +; + +754 + $__sig�tjmp + ( +__jmp_buf_�g + * +__�v +, +__�vemask +� +__THROWNL +; + +760 + $�h�ad_mu�x_�� + ( +�h�ad_mu�x_t + * +__mu�x +, + +761 cڡ +�h�ad_mu�x��_t + * +__mu�x�� +) + +762 +__THROW + + `__n�nu� + ((1)); + +765 + $�h�ad_mu�x_de�roy + ( +�h�ad_mu�x_t + * +__mu�x +) + +766 +__THROW + + `__n�nu� + ((1)); + +769 + $�h�ad_mu�x_�ylock + ( +�h�ad_mu�x_t + * +__mu�x +) + +770 +__THROWNL + + `__n�nu� + ((1)); + +773 + $�h�ad_mu�x_lock + ( +�h�ad_mu�x_t + * +__mu�x +) + +774 +__THROWNL + + `__n�nu� + ((1)); + +776 #ifde� +__USE_XOPEN2K + + +778 + $�h�ad_mu�x_timedlock + ( +�h�ad_mu�x_t + * +__��ri� + +__mu�x +, + +779 cڡ +time�ec + * +__��ri� + + +780 +__ab�ime +� +__THROWNL + + `__n�nu� + ((1, 2)); + +784 + $�h�ad_mu�x_u�ock + ( +�h�ad_mu�x_t + * +__mu�x +) + +785 +__THROWNL + + `__n�nu� + ((1)); + +789 + $�h�ad_mu�x_g��io���g + (cڡ +�h�ad_mu�x_t + * + +790 +__��ri� + +__mu�x +, + +791 * +__��ri� + +__�io���g +) + +792 +__THROW + + `__n�nu� + ((1, 2)); + +796 + $�h�ad_mu�x_��rio���g + ( +�h�ad_mu�x_t + * +__��ri� + +__mu�x +, + +797 +__�io���g +, + +798 * +__��ri� + +__�d_���g +) + +799 +__THROW + + `__n�nu� + ((1, 3)); + +802 #ifde� +__USE_XOPEN2K8 + + +804 + $�h�ad_mu�x_c�si��t + ( +�h�ad_mu�x_t + * +__mu�x +) + +805 +__THROW + + `__n�nu� + ((1)); + +806 #ifde� +__USE_GNU + + +807 + $�h�ad_mu�x_c�si��t_� + ( +�h�ad_mu�x_t + * +__mu�x +) + +808 +__THROW + + `__n�nu� + ((1)); + +817 + $�h�ad_mu�x��_�� + ( +�h�ad_mu�x��_t + * +__�� +) + +818 +__THROW + + `__n�nu� + ((1)); + +821 + $�h�ad_mu�x��_de�roy + ( +�h�ad_mu�x��_t + * +__�� +) + +822 +__THROW + + `__n�nu� + ((1)); + +825 + $�h�ad_mu�x��_g�psh�ed + (cڡ +�h�ad_mu�x��_t + * + +826 +__��ri� + +__�� +, + +827 * +__��ri� + +__psh�ed +) + +828 +__THROW + + `__n�nu� + ((1, 2)); + +831 + $�h�ad_mu�x��_��sh�ed + ( +�h�ad_mu�x��_t + * +__�� +, + +832 +__psh�ed +) + +833 +__THROW + + `__n�nu� + ((1)); + +835 #i� +def�ed + +__USE_UNIX98 + || def�ed +__USE_XOPEN2K8 + + +837 + $�h�ad_mu�x��_g�ty� + (cڡ +�h�ad_mu�x��_t + * +__��ri� + + +838 +__�� +, * +__��ri� + +__k�d +) + +839 +__THROW + + `__n�nu� + ((1, 2)); + +844 + $�h�ad_mu�x��_��y� + ( +�h�ad_mu�x��_t + * +__�� +, +__k�d +) + +845 +__THROW + + `__n�nu� + ((1)); + +849 + $�h�ad_mu�x��_g���oc� + (cڡ +�h�ad_mu�x��_t + * + +850 +__��ri� + +__�� +, + +851 * +__��ri� + +__��oc� +) + +852 +__THROW + + `__n�nu� + ((1, 2)); + +856 + $�h�ad_mu�x��_��r�oc� + ( +�h�ad_mu�x��_t + * +__�� +, + +857 +__��oc� +) + +858 +__THROW + + `__n�nu� + ((1)); + +861 + $�h�ad_mu�x��_g��io���g + (cڡ +�h�ad_mu�x��_t + * + +862 +__��ri� + +__�� +, + +863 * +__��ri� + +__�io���g +) + +864 +__THROW + + `__n�nu� + ((1, 2)); + +867 + $�h�ad_mu�x��_��rio���g + ( +�h�ad_mu�x��_t + * +__�� +, + +868 +__�io���g +) + +869 +__THROW + + `__n�nu� + ((1)); + +871 #ifde� +__USE_XOPEN2K + + +873 + $�h�ad_mu�x��_g�robu� + (cڡ +�h�ad_mu�x��_t + * +__�� +, + +874 * +__robu��ss +) + +875 +__THROW + + `__n�nu� + ((1, 2)); + +876 #ifde� +__USE_GNU + + +877 + $�h�ad_mu�x��_g�robu�_� + (cڡ +�h�ad_mu�x��_t + * +__�� +, + +878 * +__robu��ss +) + +879 +__THROW + + `__n�nu� + ((1, 2)); + +883 + $�h�ad_mu�x��_��obu� + ( +�h�ad_mu�x��_t + * +__�� +, + +884 +__robu��ss +) + +885 +__THROW + + `__n�nu� + ((1)); + +886 #ifde� +__USE_GNU + + +887 + $�h�ad_mu�x��_��obu�_� + ( +�h�ad_mu�x��_t + * +__�� +, + +888 +__robu��ss +) + +889 +__THROW + + `__n�nu� + ((1)); + +894 #i� +def�ed + +__USE_UNIX98 + || def�ed +__USE_XOPEN2K + + +899 + $�h�ad_rwlock_�� + ( +�h�ad_rwlock_t + * +__��ri� + +__rwlock +, + +900 cڡ +�h�ad_rwlock��_t + * +__��ri� + + +901 +__�� +� +__THROW + + `__n�nu� + ((1)); + +904 + $�h�ad_rwlock_de�roy + ( +�h�ad_rwlock_t + * +__rwlock +) + +905 +__THROW + + `__n�nu� + ((1)); + +908 + $�h�ad_rwlock_rdlock + ( +�h�ad_rwlock_t + * +__rwlock +) + +909 +__THROWNL + + `__n�nu� + ((1)); + +912 + $�h�ad_rwlock_�yrdlock + ( +�h�ad_rwlock_t + * +__rwlock +) + +913 +__THROWNL + + `__n�nu� + ((1)); + +915 #ifde� +__USE_XOPEN2K + + +917 + $�h�ad_rwlock_timedrdlock + ( +�h�ad_rwlock_t + * +__��ri� + +__rwlock +, + +918 cڡ +time�ec + * +__��ri� + + +919 +__ab�ime +� +__THROWNL + + `__n�nu� + ((1, 2)); + +923 + $�h�ad_rwlock_w�ock + ( +�h�ad_rwlock_t + * +__rwlock +) + +924 +__THROWNL + + `__n�nu� + ((1)); + +927 + $�h�ad_rwlock_�yw�ock + ( +�h�ad_rwlock_t + * +__rwlock +) + +928 +__THROWNL + + `__n�nu� + ((1)); + +930 #ifde� +__USE_XOPEN2K + + +932 + $�h�ad_rwlock_timedw�ock + ( +�h�ad_rwlock_t + * +__��ri� + +__rwlock +, + +933 cڡ +time�ec + * +__��ri� + + +934 +__ab�ime +� +__THROWNL + + `__n�nu� + ((1, 2)); + +938 + $�h�ad_rwlock_u�ock + ( +�h�ad_rwlock_t + * +__rwlock +) + +939 +__THROWNL + + `__n�nu� + ((1)); + +945 + $�h�ad_rwlock��_�� + ( +�h�ad_rwlock��_t + * +__�� +) + +946 +__THROW + + `__n�nu� + ((1)); + +949 + $�h�ad_rwlock��_de�roy + ( +�h�ad_rwlock��_t + * +__�� +) + +950 +__THROW + + `__n�nu� + ((1)); + +953 + $�h�ad_rwlock��_g�psh�ed + (cڡ +�h�ad_rwlock��_t + * + +954 +__��ri� + +__�� +, + +955 * +__��ri� + +__psh�ed +) + +956 +__THROW + + `__n�nu� + ((1, 2)); + +959 + $�h�ad_rwlock��_��sh�ed + ( +�h�ad_rwlock��_t + * +__�� +, + +960 +__psh�ed +) + +961 +__THROW + + `__n�nu� + ((1)); + +964 + $�h�ad_rwlock��_g�k�d_� + (cڡ +�h�ad_rwlock��_t + * + +965 +__��ri� + +__�� +, + +966 * +__��ri� + +__�ef +) + +967 +__THROW + + `__n�nu� + ((1, 2)); + +970 + $�h�ad_rwlock��_�tk�d_� + ( +�h�ad_rwlock��_t + * +__�� +, + +971 +__�ef +� +__THROW + + `__n�nu� + ((1)); + +979 + $�h�ad_c�d_�� + ( +�h�ad_c�d_t + * +__��ri� + +__c�d +, + +980 cڡ +�h�ad_c�d��_t + * +__��ri� + +__c�d_�� +) + +981 +__THROW + + `__n�nu� + ((1)); + +984 + $�h�ad_c�d_de�roy + ( +�h�ad_c�d_t + * +__c�d +) + +985 +__THROW + + `__n�nu� + ((1)); + +988 + $�h�ad_c�d_sig�l + ( +�h�ad_c�d_t + * +__c�d +) + +989 +__THROWNL + + `__n�nu� + ((1)); + +992 + $�h�ad_c�d_br�d�� + ( +�h�ad_c�d_t + * +__c�d +) + +993 +__THROWNL + + `__n�nu� + ((1)); + +1000 + $�h�ad_c�d_wa� + ( +�h�ad_c�d_t + * +__��ri� + +__c�d +, + +1001 +�h�ad_mu�x_t + * +__��ri� + +__mu�x +) + +1002 + `__n�nu� + ((1, 2)); + +1011 + $�h�ad_c�d_timedwa� + ( +�h�ad_c�d_t + * +__��ri� + +__c�d +, + +1012 +�h�ad_mu�x_t + * +__��ri� + +__mu�x +, + +1013 cڡ +time�ec + * +__��ri� + +__ab�ime +) + +1014 + `__n�nu� + ((1, 2, 3)); + +1019 + $�h�ad_c�d��_�� + ( +�h�ad_c�d��_t + * +__�� +) + +1020 +__THROW + + `__n�nu� + ((1)); + +1023 + $�h�ad_c�d��_de�roy + ( +�h�ad_c�d��_t + * +__�� +) + +1024 +__THROW + + `__n�nu� + ((1)); + +1027 + $�h�ad_c�d��_g�psh�ed + (cڡ +�h�ad_c�d��_t + * + +1028 +__��ri� + +__�� +, + +1029 * +__��ri� + +__psh�ed +) + +1030 +__THROW + + `__n�nu� + ((1, 2)); + +1033 + $�h�ad_c�d��_��sh�ed + ( +�h�ad_c�d��_t + * +__�� +, + +1034 +__psh�ed +� +__THROW + + `__n�nu� + ((1)); + +1036 #ifde� +__USE_XOPEN2K + + +1038 + $�h�ad_c�d��_g��ock + (cڡ +�h�ad_c�d��_t + * + +1039 +__��ri� + +__�� +, + +1040 +__�ockid_t + * +__��ri� + +__�ock_id +) + +1041 +__THROW + + `__n�nu� + ((1, 2)); + +1044 + $�h�ad_c�d��_�t�ock + ( +�h�ad_c�d��_t + * +__�� +, + +1045 +__�ockid_t + +__�ock_id +) + +1046 +__THROW + + `__n�nu� + ((1)); + +1050 #ifde� +__USE_XOPEN2K + + +1055 + $�h�ad_��_�� + ( +�h�ad_��lock_t + * +__lock +, +__psh�ed +) + +1056 +__THROW + + `__n�nu� + ((1)); + +1059 + $�h�ad_��_de�roy + ( +�h�ad_��lock_t + * +__lock +) + +1060 +__THROW + + `__n�nu� + ((1)); + +1063 + $�h�ad_��_lock + ( +�h�ad_��lock_t + * +__lock +) + +1064 +__THROWNL + + `__n�nu� + ((1)); + +1067 + $�h�ad_��_�ylock + ( +�h�ad_��lock_t + * +__lock +) + +1068 +__THROWNL + + `__n�nu� + ((1)); + +1071 + $�h�ad_��_u�ock + ( +�h�ad_��lock_t + * +__lock +) + +1072 +__THROWNL + + `__n�nu� + ((1)); + +1079 + $�h�ad_b�r�r_�� + ( +�h�ad_b�r�r_t + * +__��ri� + +__b�r�r +, + +1080 cڡ +�h�ad_b�r���r_t + * +__��ri� + + +1081 +__�� +, +__cou� +) + +1082 +__THROW + + `__n�nu� + ((1)); + +1085 + $�h�ad_b�r�r_de�roy + ( +�h�ad_b�r�r_t + * +__b�r�r +) + +1086 +__THROW + + `__n�nu� + ((1)); + +1089 + $�h�ad_b�r�r_wa� + ( +�h�ad_b�r�r_t + * +__b�r�r +) + +1090 +__THROWNL + + `__n�nu� + ((1)); + +1094 + $�h�ad_b�r���r_�� + ( +�h�ad_b�r���r_t + * +__�� +) + +1095 +__THROW + + `__n�nu� + ((1)); + +1098 + $�h�ad_b�r���r_de�roy + ( +�h�ad_b�r���r_t + * +__�� +) + +1099 +__THROW + + `__n�nu� + ((1)); + +1102 + $�h�ad_b�r���r_g�psh�ed + (cڡ +�h�ad_b�r���r_t + * + +1103 +__��ri� + +__�� +, + +1104 * +__��ri� + +__psh�ed +) + +1105 +__THROW + + `__n�nu� + ((1, 2)); + +1108 + $�h�ad_b�r���r_��sh�ed + ( +�h�ad_b�r���r_t + * +__�� +, + +1109 +__psh�ed +) + +1110 +__THROW + + `__n�nu� + ((1)); + +1122 + `�h�ad_key_��� + ( +�h�ad_key_t + * +__key +, + +1123 (* +__de�r_fun�i� +) (*)) + +1124 +__THROW + + `__n�nu� + ((1)); + +1127 + $�h�ad_key_d��e + ( +�h�ad_key_t + +__key +� +__THROW +; + +1130 * + $�h�ad_g��ecific + ( +�h�ad_key_t + +__key +� +__THROW +; + +1133 + $�h�ad_�t�ecific + ( +�h�ad_key_t + +__key +, + +1134 cڡ * +__po��r +� +__THROW + ; + +1137 #ifde� +__USE_XOPEN2K + + +1139 + $�h�ad_g��u�ockid + ( +�h�ad_t + +__th�ad_id +, + +1140 +__�ockid_t + * +__�ock_id +) + +1141 +__THROW + + `__n�nu� + ((2)); + +1156 + `�h�ad_�f�k + ((* +__���e +) (), + +1157 (* +__��� +) (), + +1158 (* +__ch�d +�()� +__THROW +; + +1161 #ifde� +__USE_EXTERN_INLINES + + +1163 +__ex��_�l�e + + +1164 + `__NTH + ( + $�h�ad_equ� + ( +�h�ad_t + +__th�ad1 +,�th�ad_� +__th�ad2 +)) + +1166 +__th�ad1 + =� +__th�ad2 +; + +1167 + } +} + +1170 + g__END_DECLS + + + @/usr/include/pwd.h + +22 #i�def +_PWD_H + + +23 + #_PWD_H + 1 + + ) + +25 + ~<�u�s.h +> + +27 + g__BEGIN_DECLS + + +29 + ~<b�s/ty�s.h +> + +31 + #__�ed_size_t + + + ) + +32 + ~<�ddef.h +> + +34 #i� +def�ed + +__USE_XOPEN + || def�ed +__USE_XOPEN2K + + +37 #i�de� +__gid_t_def�ed + + +38 +__gid_t + + tgid_t +; + +39 + #__gid_t_def�ed + + + ) + +42 #i�de� +__uid_t_def�ed + + +43 +__uid_t + + tuid_t +; + +44 + #__uid_t_def�ed + + + ) + +49 + s�sswd + + +51 * + mpw_�me +; + +52 * + mpw_�sswd +; + +53 +__uid_t + + mpw_uid +; + +54 +__gid_t + + mpw_gid +; + +55 * + mpw_gecos +; + +56 * + mpw_d� +; + +57 * + mpw_sh�l +; + +61 #i� +def�ed + +__USE_SVID + || def�ed +__USE_GNU + + +62 + #__�ed_FILE + + + ) + +63 + ~<�dio.h +> + +67 #i� +def�ed + +__USE_SVID + || def�ed +__USE_MISC + || def�ed +__USE_XOPEN_EXTENDED + + +72 +��w�t + (); + +78 +�dpw�t + (); + +84 +�sswd + * +g�pw�t + (); + +87 #ifdef +__USE_SVID + + +94 +�sswd + * +fg�pw�t + ( +FILE + * +__��am +); + +102 +pu�w�t + (cڡ +�sswd + * +__��ri� + +__p +, + +103 +FILE + * +__��ri� + +__f +); + +110 +�sswd + * +g�pwuid + ( +__uid_t + +__uid +); + +116 +�sswd + * +g�pw�m + (cڡ * +__�me +); + +118 #i� +def�ed + +__USE_POSIX + || def�ed +__USE_MISC + + +120 #ifde� +__USE_MISC + + +123 + #NSS_BUFLEN_PASSWD + 1024 + + ) + +134 #i� +def�ed + +__USE_SVID + || def�ed +__USE_MISC + + +139 +g�pw�t_r + ( +�sswd + * +__��ri� + +__�su�buf +, + +140 * +__��ri� + +__buf�r +, +size_t + +__bu� +, + +141 +�sswd + ** +__��ri� + +__�su� +); + +144 +g�pwuid_r + ( +__uid_t + +__uid +, + +145 +�sswd + * +__��ri� + +__�su�buf +, + +146 * +__��ri� + +__buf�r +, +size_t + +__bu� +, + +147 +�sswd + ** +__��ri� + +__�su� +); + +149 +g�pw�m_r + (cڡ * +__��ri� + +__�me +, + +150 +�sswd + * +__��ri� + +__�su�buf +, + +151 * +__��ri� + +__buf�r +, +size_t + +__bu� +, + +152 +�sswd + ** +__��ri� + +__�su� +); + +155 #ifdef +__USE_SVID + + +163 +fg�pw�t_r + ( +FILE + * +__��ri� + +__��am +, + +164 +�sswd + * +__��ri� + +__�su�buf +, + +165 * +__��ri� + +__buf�r +, +size_t + +__bu� +, + +166 +�sswd + ** +__��ri� + +__�su� +); + +171 #ifde� +__USE_GNU + + +180 +g�pw + ( +__uid_t + +__uid +, * +__buf�r +); + +183 + g__END_DECLS + + + @/usr/include/signal.h + +22 #i�def +_SIGNAL_H + + +24 #i�! +def�ed + +__�ed_sig_�omic_t + && !def�ed +__�ed_sig�t_t + + +25 + #_SIGNAL_H + + + ) + +28 + ~<�u�s.h +> + +30 + g__BEGIN_DECLS + + +32 + ~<b�s/sig�t.h +> + +36 #i� +def�ed + +__�ed_sig_�omic_t + || def�ed +_SIGNAL_H + + +37 #i�de� +__sig_�omic_t_def�ed + + +38 + #__sig_�omic_t_def�ed + + + ) + +39 +__BEGIN_NAMESPACE_STD + + +40 +__sig_�omic_t + + tsig_�omic_t +; + +41 + g__END_NAMESPACE_STD + + +43 #unde� +__�ed_sig_�omic_t + + +46 #i� +def�ed + +__�ed_sig�t_t + || (def�ed +_SIGNAL_H + && def�ed +__USE_POSIX +) + +47 #i�de� +__sig�t_t_def�ed + + +48 + #__sig�t_t_def�ed + + + ) + +49 +__sig�t_t + + tsig�t_t +; + +51 #unde� +__�ed_sig�t_t + + +54 #ifde� +_SIGNAL_H + + +56 + ~<b�s/ty�s.h +> + +57 + ~<b�s/signum.h +> + +59 #i� +def�ed + +__USE_XOPEN + || def�ed +__USE_XOPEN2K + + +60 #i�de� +__pid_t_def�ed + + +61 +__pid_t + + tpid_t +; + +62 + #__pid_t_def�ed + + + ) + +64 #ifde� +__USE_XOPEN + + +66 #i�de� +__uid_t_def�ed + + +67 +__uid_t + + tuid_t +; + +68 + #__uid_t_def�ed + + + ) + +72 #ifde� +__USE_POSIX199309 + + +74 + #__�ed_time�ec + + + ) + +75 + ~<time.h +> + +78 #i� +def�ed + +__USE_POSIX199309 + || def�ed +__USE_XOPEN_EXTENDED + + +80 + ~<b�s/sig�fo.h +> + +85 (* + t__sigh�d�r_t +) (); + +90 +__sigh�d�r_t + + $__sysv_sig�l + ( +__sig +, +__sigh�d�r_t + +__h�d�r +) + +91 +__THROW +; + +92 #ifde� +__USE_GNU + + +93 +__sigh�d�r_t + + $sysv_sig�l + ( +__sig +, +__sigh�d�r_t + +__h�d�r +) + +94 +__THROW +; + +100 +__BEGIN_NAMESPACE_STD + + +101 #ifde� +__USE_BSD + + +102 +__sigh�d�r_t + + $sig�l + ( +__sig +, +__sigh�d�r_t + +__h�d�r +) + +103 +__THROW +; + +106 #ifde� +__REDIRECT_NTH + + +107 +__sigh�d�r_t + + `__REDIRECT_NTH + ( +sig�l +, + +108 ( +__sig +, +__sigh�d�r_t + +__h�d�r +), + +109 +__sysv_sig�l +); + +111 + #sig�l + +__sysv_sig�l + + + ) + +114 +__END_NAMESPACE_STD + + +116 #ifde� +__USE_XOPEN + + +119 +__sigh�d�r_t + + $bsd_sig�l + ( +__sig +, +__sigh�d�r_t + +__h�d�r +) + +120 +__THROW +; + +126 #ifde� +__USE_POSIX + + +127 + $k�l + ( +__pid_t + +__pid +, +__sig +� +__THROW +; + +130 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + + +134 + $k��g + ( +__pid_t + +__pg� +, +__sig +� +__THROW +; + +137 +__BEGIN_NAMESPACE_STD + + +139 + $�i� + ( +__sig +� +__THROW +; + +140 +__END_NAMESPACE_STD + + +142 #ifde� +__USE_SVID + + +144 +__sigh�d�r_t + + $ssig�l + ( +__sig +, +__sigh�d�r_t + +__h�d�r +) + +145 +__THROW +; + +146 + $gsig�l + ( +__sig +� +__THROW +; + +149 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN2K + + +151 + `psig�l + ( +__sig +, cڡ * +__s +); + +154 #ifde� +__USE_XOPEN2K + + +156 + `psig�fo + (cڡ +sig�fo_t + * +__p�fo +, cڡ * +__s +); + +167 + `__sig�u� + ( +__sig_�_mask +, +__is_sig +); + +169 #ifde� +__USE_XOPEN + + +170 #ifde� +__GNUC__ + + +171 + $sig�u� + ( +__sig +� + `__asm__ + ("__xpg_sigpause"); + +174 + #sig�u� +( +sig +� + `__sig�u� + ((sig), 1) + + ) + +179 #ifde� +__USE_BSD + + +186 + #sigmask +( +sig +� + `__sigmask +(sig) + + ) + +189 + $sigblock + ( +__mask +� +__THROW + +__��ibu�_d����d__ +; + +192 + $sig�tmask + ( +__mask +� +__THROW + +__��ibu�_d����d__ +; + +195 + $sigg�mask + (� +__THROW + +__��ibu�_d����d__ +; + +199 #ifde� +__USE_MISC + + +200 + #NSIG + +_NSIG + + + ) + +203 #ifde� +__USE_GNU + + +204 +__sigh�d�r_t + + tsigh�d�r_t +; + +208 #ifde� +__USE_BSD + + +209 +__sigh�d�r_t + + tsig_t +; + +212 #ifde� +__USE_POSIX + + +215 + $sigem�y�t + ( +sig�t_t + * +__�t +� +__THROW + + `__n�nu� + ((1)); + +218 + $sigf�l�t + ( +sig�t_t + * +__�t +� +__THROW + + `__n�nu� + ((1)); + +221 + $sigadd�t + ( +sig�t_t + * +__�t +, +__signo +� +__THROW + + `__n�nu� + ((1)); + +224 + $sigd��t + ( +sig�t_t + * +__�t +, +__signo +� +__THROW + + `__n�nu� + ((1)); + +227 + $sigismemb� + (cڡ +sig�t_t + * +__�t +, +__signo +) + +228 +__THROW + + `__n�nu� + ((1)); + +230 #ifde� +__USE_GNU + + +232 + $sigi�m�y�t + (cڡ +sig�t_t + * +__�t +� +__THROW + + `__n�nu� + ((1)); + +235 + $sig�d�t + ( +sig�t_t + * +__�t +, cڡ sig�t_�* +__�� +, + +236 cڡ +sig�t_t + * +__right +� +__THROW + + `__n�nu� + ((1, 2, 3)); + +239 + $sigܣt + ( +sig�t_t + * +__�t +, cڡ sig�t_�* +__�� +, + +240 cڡ +sig�t_t + * +__right +� +__THROW + + `__n�nu� + ((1, 2, 3)); + +245 + ~<b�s/siga�i�.h +> + +248 + $sig�ocmask + ( +__how +, cڡ +sig�t_t + * +__��ri� + +__�t +, + +249 +sig�t_t + * +__��ri� + +__o�t +� +__THROW +; + +256 + $sigsu��d + (cڡ +sig�t_t + * +__�t +� + `__n�nu� + ((1)); + +259 + $siga�i� + ( +__sig +, cڡ +siga�i� + * +__��ri� + +__a� +, + +260 +siga�i� + * +__��ri� + +__�� +� +__THROW +; + +263 + $sig�nd�g + ( +sig�t_t + * +__�t +� +__THROW + + `__n�nu� + ((1)); + +270 + $sigwa� + (cڡ +sig�t_t + * +__��ri� + +__�t +, *__��ri� +__sig +) + +271 + `__n�nu� + ((1, 2)); + +273 #ifde� +__USE_POSIX199309 + + +278 + $sigwa��fo + (cڡ +sig�t_t + * +__��ri� + +__�t +, + +279 +sig�fo_t + * +__��ri� + +__�fo +� + `__n�nu� + ((1)); + +286 + $sigtimedwa� + (cڡ +sig�t_t + * +__��ri� + +__�t +, + +287 +sig�fo_t + * +__��ri� + +__�fo +, + +288 cڡ +time�ec + * +__��ri� + +__timeout +) + +289 + `__n�nu� + ((1)); + +293 + $sigqueue + ( +__pid_t + +__pid +, +__sig +, cڡ +sigv� + +__v� +) + +294 +__THROW +; + +299 #ifde� +__USE_BSD + + +303 cڡ *cڡ +_sys_sigli� +[ +_NSIG +]; + +304 cڡ *cڡ +sys_sigli� +[ +_NSIG +]; + +307 + ssigvec + + +309 +__sigh�d�r_t + +sv_h�d�r +; + +310 +sv_mask +; + +312 +sv_�ags +; + +313 + #sv_ڡack + +sv_�ags + + + ) + +317 + #SV_ONSTACK + (1 << 0) + + ) + +318 + #SV_INTERRUPT + (1 << 1) + + ) + +319 + #SV_RESETHAND + (1 << 2) + + ) + +327 + $sigvec + ( +__sig +, cڡ +sigvec + * +__vec +, + +328 +sigvec + * +__ovec +� +__THROW +; + +332 + ~<b�s/sigcڋxt.h +> + +335 + $sig�tu� + ( +sigcڋxt + * +__s� +� +__THROW +; + +340 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + || def�ed +__USE_XOPEN2K8 + + +341 + #__�ed_size_t + + + ) + +342 + ~<�ddef.h +> + +347 + $sig���u� + ( +__sig +, +__���u� +� +__THROW +; + +349 + ~<b�s/sig�ack.h +> + +350 #i� +def�ed + +__USE_XOPEN + || def�ed +__USE_XOPEN2K8 + + +352 + ~<sys/ucڋxt.h +> + +358 + $sig�ack + ( +sig�ack + * +__ss +, sig�ack * +__oss +) + +359 +__THROW + +__��ibu�_d����d__ +; + +363 + $sig�t�ack + (cڡ +sig�t�ack + * +__��ri� + +__ss +, + +364 +sig�t�ack + * +__��ri� + +__oss +� +__THROW +; + +368 #ifde� +__USE_XOPEN_EXTENDED + + +372 + $sigh�d + ( +__sig +� +__THROW +; + +375 + $sig�l� + ( +__sig +� +__THROW +; + +378 + $sigign�e + ( +__sig +� +__THROW +; + +381 +__sigh�d�r_t + + $sig�t + ( +__sig +, +__sigh�d�r_t + +__di� +� +__THROW +; + +384 #i� +def�ed + +__USE_POSIX199506 + || def�ed +__USE_UNIX98 + + +387 + ~<b�s/�h�adty�s.h +> + +388 + ~<b�s/sigth�ad.h +> + +395 + $__libc_cu��t_sig�m� + (� +__THROW +; + +397 + $__libc_cu��t_sig�max + (� +__THROW +; + +401 +__END_DECLS + + + @/usr/include/stdint.h + +22 #i�de� +_STDINT_H + + +23 + #_STDINT_H + 1 + + ) + +25 + ~<�u�s.h +> + +26 + ~<b�s/wch�.h +> + +27 + ~<b�s/w�dsize.h +> + +34 #i�de� +__�t8_t_def�ed + + +35 + #__�t8_t_def�ed + + + ) + +36 sig�d + t�t8_t +; + +37 + t�t16_t +; + +38 + t�t32_t +; + +39 #i� +__WORDSIZE + == 64 + +40 + t�t64_t +; + +42 +__ex�nsi�__ + + +43 + t�t64_t +; + +48 + tu�t8_t +; + +49 + tu�t16_t +; + +50 #i�de� +__u�t32_t_def�ed + + +51 + tu�t32_t +; + +52 + #__u�t32_t_def�ed + + + ) + +54 #i� +__WORDSIZE + == 64 + +55 + tu�t64_t +; + +57 +__ex�nsi�__ + + +58 + tu�t64_t +; + +65 sig�d + t�t_�a�8_t +; + +66 + t�t_�a�16_t +; + +67 + t�t_�a�32_t +; + +68 #i� +__WORDSIZE + == 64 + +69 + t�t_�a�64_t +; + +71 +__ex�nsi�__ + + +72 + t�t_�a�64_t +; + +76 + tu�t_�a�8_t +; + +77 + tu�t_�a�16_t +; + +78 + tu�t_�a�32_t +; + +79 #i� +__WORDSIZE + == 64 + +80 + tu�t_�a�64_t +; + +82 +__ex�nsi�__ + + +83 + tu�t_�a�64_t +; + +90 sig�d + t�t_�8_t +; + +91 #i� +__WORDSIZE + == 64 + +92 + t�t_�16_t +; + +93 + t�t_�32_t +; + +94 + t�t_�64_t +; + +96 + t�t_�16_t +; + +97 + t�t_�32_t +; + +98 +__ex�nsi�__ + + +99 + t�t_�64_t +; + +103 + tu�t_�8_t +; + +104 #i� +__WORDSIZE + == 64 + +105 + tu�t_�16_t +; + +106 + tu�t_�32_t +; + +107 + tu�t_�64_t +; + +109 + tu�t_�16_t +; + +110 + tu�t_�32_t +; + +111 +__ex�nsi�__ + + +112 + tu�t_�64_t +; + +117 #i� +__WORDSIZE + == 64 + +118 #i�de� +__���_t_def�ed + + +119 + t���_t +; + +120 + #__���_t_def�ed + + + ) + +122 + tu���_t +; + +124 #i�de� +__���_t_def�ed + + +125 + t���_t +; + +126 + #__���_t_def�ed + + + ) + +128 + tu���_t +; + +133 #i� +__WORDSIZE + == 64 + +134 + t�tmax_t +; + +135 + tu�tmax_t +; + +137 +__ex�nsi�__ + + +138 + t�tmax_t +; + +139 +__ex�nsi�__ + + +140 + tu�tmax_t +; + +144 #i� +__WORDSIZE + == 64 + +145 + #__INT64_C +( +c +��## +L + + + ) + +146 + #__UINT64_C +( +c +��## +UL + + + ) + +148 + #__INT64_C +( +c +��## +LL + + + ) + +149 + #__UINT64_C +( +c +��## +ULL + + + ) + +155 + #INT8_MIN + (-128) + + ) + +156 + #INT16_MIN + (-32767-1) + + ) + +157 + #INT32_MIN + (-2147483647-1) + + ) + +158 + #INT64_MIN + (- + `__INT64_C +(9223372036854775807)-1) + + ) + +160 + #INT8_MAX + (127) + + ) + +161 + #INT16_MAX + (32767) + + ) + +162 + #INT32_MAX + (2147483647) + + ) + +163 + #INT64_MAX + ( + `__INT64_C +(9223372036854775807)) + + ) + +166 + #UINT8_MAX + (255) + + ) + +167 + #UINT16_MAX + (65535) + + ) + +168 + #UINT32_MAX + (4294967295U) + + ) + +169 + #UINT64_MAX + ( + `__UINT64_C +(18446744073709551615)) + + ) + +173 + #INT_LEAST8_MIN + (-128) + + ) + +174 + #INT_LEAST16_MIN + (-32767-1) + + ) + +175 + #INT_LEAST32_MIN + (-2147483647-1) + + ) + +176 + #INT_LEAST64_MIN + (- + `__INT64_C +(9223372036854775807)-1) + + ) + +178 + #INT_LEAST8_MAX + (127) + + ) + +179 + #INT_LEAST16_MAX + (32767) + + ) + +180 + #INT_LEAST32_MAX + (2147483647) + + ) + +181 + #INT_LEAST64_MAX + ( + `__INT64_C +(9223372036854775807)) + + ) + +184 + #UINT_LEAST8_MAX + (255) + + ) + +185 + #UINT_LEAST16_MAX + (65535) + + ) + +186 + #UINT_LEAST32_MAX + (4294967295U) + + ) + +187 + #UINT_LEAST64_MAX + ( + `__UINT64_C +(18446744073709551615)) + + ) + +191 + #INT_FAST8_MIN + (-128) + + ) + +192 #i� +__WORDSIZE + == 64 + +193 + #INT_FAST16_MIN + (-9223372036854775807L-1) + + ) + +194 + #INT_FAST32_MIN + (-9223372036854775807L-1) + + ) + +196 + #INT_FAST16_MIN + (-2147483647-1) + + ) + +197 + #INT_FAST32_MIN + (-2147483647-1) + + ) + +199 + #INT_FAST64_MIN + (- + `__INT64_C +(9223372036854775807)-1) + + ) + +201 + #INT_FAST8_MAX + (127) + + ) + +202 #i� +__WORDSIZE + == 64 + +203 + #INT_FAST16_MAX + (9223372036854775807L) + + ) + +204 + #INT_FAST32_MAX + (9223372036854775807L) + + ) + +206 + #INT_FAST16_MAX + (2147483647) + + ) + +207 + #INT_FAST32_MAX + (2147483647) + + ) + +209 + #INT_FAST64_MAX + ( + `__INT64_C +(9223372036854775807)) + + ) + +212 + #UINT_FAST8_MAX + (255) + + ) + +213 #i� +__WORDSIZE + == 64 + +214 + #UINT_FAST16_MAX + (18446744073709551615UL) + + ) + +215 + #UINT_FAST32_MAX + (18446744073709551615UL) + + ) + +217 + #UINT_FAST16_MAX + (4294967295U) + + ) + +218 + #UINT_FAST32_MAX + (4294967295U) + + ) + +220 + #UINT_FAST64_MAX + ( + `__UINT64_C +(18446744073709551615)) + + ) + +224 #i� +__WORDSIZE + == 64 + +225 + #INTPTR_MIN + (-9223372036854775807L-1) + + ) + +226 + #INTPTR_MAX + (9223372036854775807L) + + ) + +227 + #UINTPTR_MAX + (18446744073709551615UL) + + ) + +229 + #INTPTR_MIN + (-2147483647-1) + + ) + +230 + #INTPTR_MAX + (2147483647) + + ) + +231 + #UINTPTR_MAX + (4294967295U) + + ) + +236 + #INTMAX_MIN + (- + `__INT64_C +(9223372036854775807)-1) + + ) + +238 + #INTMAX_MAX + ( + `__INT64_C +(9223372036854775807)) + + ) + +241 + #UINTMAX_MAX + ( + `__UINT64_C +(18446744073709551615)) + + ) + +247 #i� +__WORDSIZE + == 64 + +248 + #PTRDIFF_MIN + (-9223372036854775807L-1) + + ) + +249 + #PTRDIFF_MAX + (9223372036854775807L) + + ) + +251 + #PTRDIFF_MIN + (-2147483647-1) + + ) + +252 + #PTRDIFF_MAX + (2147483647) + + ) + +256 + #SIG_ATOMIC_MIN + (-2147483647-1) + + ) + +257 + #SIG_ATOMIC_MAX + (2147483647) + + ) + +260 #i� +__WORDSIZE + == 64 + +261 + #SIZE_MAX + (18446744073709551615UL) + + ) + +263 + #SIZE_MAX + (4294967295U) + + ) + +267 #i�de� +WCHAR_MIN + + +269 + #WCHAR_MIN + +__WCHAR_MIN + + + ) + +270 + #WCHAR_MAX + +__WCHAR_MAX + + + ) + +274 + #WINT_MIN + (0u) + + ) + +275 + #WINT_MAX + (4294967295u) + + ) + +278 + #INT8_C +( +c +� + ) +c + +279 + #INT16_C +( +c +� + ) +c + +280 + #INT32_C +( +c +� + ) +c + +281 #i� +__WORDSIZE + == 64 + +282 + #INT64_C +( +c +��## +L + + + ) + +284 + #INT64_C +( +c +��## +LL + + + ) + +288 + #UINT8_C +( +c +� + ) +c + +289 + #UINT16_C +( +c +� + ) +c + +290 + #UINT32_C +( +c +��## +U + + + ) + +291 #i� +__WORDSIZE + == 64 + +292 + #UINT64_C +( +c +��## +UL + + + ) + +294 + #UINT64_C +( +c +��## +ULL + + + ) + +298 #i� +__WORDSIZE + == 64 + +299 + #INTMAX_C +( +c +��## +L + + + ) + +300 + #UINTMAX_C +( +c +��## +UL + + + ) + +302 + #INTMAX_C +( +c +��## +LL + + + ) + +303 + #UINTMAX_C +( +c +��## +ULL + + + ) + + @/usr/include/stdio.h + +23 #i�de� +_STDIO_H + + +25 #i�! +def�ed + +__�ed_FILE + && !def�ed +__�ed___FILE + + +26 + #_STDIO_H + 1 + + ) + +27 + ~<�u�s.h +> + +29 + g__BEGIN_DECLS + + +31 + #__�ed_size_t + + + ) + +32 + #__�ed_NULL + + + ) + +33 + ~<�ddef.h +> + +35 + ~<b�s/ty�s.h +> + +36 + #__�ed_FILE + + + ) + +37 + #__�ed___FILE + + + ) + +41 #i�! +def�ed + +__FILE_def�ed + && def�ed +__�ed_FILE + + +44 + g_IO_FILE +; + +46 +__BEGIN_NAMESPACE_STD + + +48 +_IO_FILE + + tFILE +; + +49 + g__END_NAMESPACE_STD + + +50 #i� +def�ed + +__USE_LARGEFILE64 + || def�ed +__USE_SVID + || def�ed +__USE_POSIX + \ + +51 || +def�ed + + g__USE_BSD + || def�ed + g__USE_ISOC99 + || def�ed + g__USE_XOPEN + \ + +52 || +def�ed + +__USE_POSIX2 + + +53 + $__USING_NAMESPACE_STD +( +FILE +) + +56 + #__FILE_def�ed + 1 + + ) + +58 #unde� +__�ed_FILE + + +61 #i�! +def�ed + +____FILE_def�ed + && def�ed +__�ed___FILE + + +64 +_IO_FILE + + t__FILE +; + +66 + #____FILE_def�ed + 1 + + ) + +68 #unde� +__�ed___FILE + + +71 #ifdef +_STDIO_H + + +72 + #_STDIO_USES_IOSTREAM + + + ) + +74 + ~<libio.h +> + +76 #i� +def�ed + +__USE_XOPEN + || def�ed +__USE_XOPEN2K8 + + +77 #ifde� +__GNUC__ + + +78 #i�de� +_VA_LIST_DEFINED + + +79 +_G_va_li� + + tva_li� +; + +80 + #_VA_LIST_DEFINED + + + ) + +83 + ~<�d�g.h +> + +87 #ifde� +__USE_XOPEN2K8 + + +88 #i�de� +__off_t_def�ed + + +89 #i�de� +__USE_FILE_OFFSET64 + + +90 +__off_t + + toff_t +; + +92 +__off64_t + + toff_t +; + +94 + #__off_t_def�ed + + + ) + +96 #i� +def�ed + +__USE_LARGEFILE64 + && !def�ed +__off64_t_def�ed + + +97 +__off64_t + + toff64_t +; + +98 + #__off64_t_def�ed + + + ) + +101 #i�de� +__ssize_t_def�ed + + +102 +__ssize_t + + tssize_t +; + +103 + #__ssize_t_def�ed + + + ) + +108 +__BEGIN_NAMESPACE_STD + + +109 #i�de� +__USE_FILE_OFFSET64 + + +110 +_G_�os_t + + t�os_t +; + +112 +_G_�os64_t + + t�os_t +; + +114 +__END_NAMESPACE_STD + + +115 #ifde� +__USE_LARGEFILE64 + + +116 +_G_�os64_t + + t�os64_t +; + +120 + #_IOFBF + 0 + + ) + +121 + #_IOLBF + 1 + + ) + +122 + #_IONBF + 2 + + ) + +126 #i�de� +BUFSIZ + + +127 + #BUFSIZ + +_IO_BUFSIZ + + + ) + +133 #i�de� +EOF + + +134 + #EOF + (-1) + + ) + +140 + #SEEK_SET + 0 + + ) + +141 + #SEEK_CUR + 1 + + ) + +142 + #SEEK_END + 2 + + ) + +143 #ifde� +__USE_GNU + + +144 + #SEEK_DATA + 3 + + ) + +145 + #SEEK_HOLE + 4 + + ) + +149 #i� +def�ed + +__USE_SVID + || def�ed +__USE_XOPEN + + +151 + #P_tmpd� + "/tmp" + + ) + +164 + ~<b�s/�dio_lim.h +> + +168 +_IO_FILE + * +�d� +; + +169 +_IO_FILE + * +�dout +; + +170 +_IO_FILE + * +�d�r +; + +172 + #�d� + +�d� + + + ) + +173 + #�dout + +�dout + + + ) + +174 + #�d�r + +�d�r + + + ) + +176 +__BEGIN_NAMESPACE_STD + + +178 + $�move + (cڡ * +__f��ame +� +__THROW +; + +180 + $��me + (cڡ * +__�d +, cڡ * +__�w +� +__THROW +; + +181 +__END_NAMESPACE_STD + + +183 #ifde� +__USE_ATFILE + + +185 + $��m�t + ( +__�dfd +, cڡ * +__�d +, +__�wfd +, + +186 cڡ * +__�w +� +__THROW +; + +189 +__BEGIN_NAMESPACE_STD + + +194 #i�de� +__USE_FILE_OFFSET64 + + +195 +FILE + * + $tmpf�e + (� +__wur +; + +197 #ifde� +__REDIRECT + + +198 +FILE + * + `__REDIRECT + ( +tmpf�e +, (), +tmpf�e64 +� +__wur +; + +200 + #tmpf�e + +tmpf�e64 + + + ) + +204 #ifde� +__USE_LARGEFILE64 + + +205 +FILE + * + $tmpf�e64 + (� +__wur +; + +209 * + $tm�am + (* +__s +� +__THROW + +__wur +; + +210 +__END_NAMESPACE_STD + + +212 #ifde� +__USE_MISC + + +215 * + $tm�am_r + (* +__s +� +__THROW + +__wur +; + +219 #i� +def�ed + +__USE_SVID + || def�ed +__USE_XOPEN + + +227 * + $�m�am + (cڡ * +__d� +, cڡ * +__pfx +) + +228 +__THROW + +__��ibu�_m�loc__ + +__wur +; + +232 +__BEGIN_NAMESPACE_STD + + +237 + `f�o� + ( +FILE + * +__��am +); + +242 + `f�ush + ( +FILE + * +__��am +); + +243 +__END_NAMESPACE_STD + + +245 #ifde� +__USE_MISC + + +252 + `f�ush_u�ocked + ( +FILE + * +__��am +); + +255 #ifde� +__USE_GNU + + +262 + `f�o��l + (); + +266 +__BEGIN_NAMESPACE_STD + + +267 #i�de� +__USE_FILE_OFFSET64 + + +272 +FILE + * + $fݒ + (cڡ * +__��ri� + +__f��ame +, + +273 cڡ * +__��ri� + +__modes +� +__wur +; + +278 +FILE + * + $�eݒ + (cڡ * +__��ri� + +__f��ame +, + +279 cڡ * +__��ri� + +__modes +, + +280 +FILE + * +__��ri� + +__��am +� +__wur +; + +282 #ifde� +__REDIRECT + + +283 +FILE + * + `__REDIRECT + ( +fݒ +, (cڡ * +__��ri� + +__f��ame +, + +284 cڡ * +__��ri� + +__modes +), +fݒ64 +) + +285 +__wur +; + +286 +FILE + * + `__REDIRECT + ( +�eݒ +, (cڡ * +__��ri� + +__f��ame +, + +287 cڡ * +__��ri� + +__modes +, + +288 +FILE + * +__��ri� + +__��am +), +�eݒ64 +) + +289 +__wur +; + +291 + #fݒ + +fݒ64 + + + ) + +292 + #�eݒ + +�eݒ64 + + + ) + +295 +__END_NAMESPACE_STD + + +296 #ifde� +__USE_LARGEFILE64 + + +297 +FILE + * + $fݒ64 + (cڡ * +__��ri� + +__f��ame +, + +298 cڡ * +__��ri� + +__modes +� +__wur +; + +299 +FILE + * + $�eݒ64 + (cڡ * +__��ri� + +__f��ame +, + +300 cڡ * +__��ri� + +__modes +, + +301 +FILE + * +__��ri� + +__��am +� +__wur +; + +304 #ifdef +__USE_POSIX + + +306 +FILE + * + $fdݒ + ( +__fd +, cڡ * +__modes +� +__THROW + +__wur +; + +309 #ifdef +__USE_GNU + + +312 +FILE + * + $fݒcook� + (* +__��ri� + +__magic_cook� +, + +313 cڡ * +__��ri� + +__modes +, + +314 +_IO_cook�_io_fun�i�s_t + +__io_funcs +� +__THROW + +__wur +; + +317 #ifde� +__USE_XOPEN2K8 + + +319 +FILE + * + $fmemݒ + (* +__s +, +size_t + +__�n +, cڡ * +__modes +) + +320 +__THROW + +__wur +; + +325 +FILE + * + $ݒ_mem��am + (** +__bu�oc +, +size_t + * +__siz�oc +� +__THROW + +__wur +; + +329 +__BEGIN_NAMESPACE_STD + + +332 + $�tbuf + ( +FILE + * +__��ri� + +__��am +, *__��ri� +__buf +� +__THROW +; + +336 + $�tvbuf + ( +FILE + * +__��ri� + +__��am +, *__��ri� +__buf +, + +337 +__modes +, +size_t + +__n +� +__THROW +; + +338 +__END_NAMESPACE_STD + + +340 #ifdef +__USE_BSD + + +343 + $�tbuf�r + ( +FILE + * +__��ri� + +__��am +, *__��ri� +__buf +, + +344 +size_t + +__size +� +__THROW +; + +347 + $���ebuf + ( +FILE + * +__��am +� +__THROW +; + +351 +__BEGIN_NAMESPACE_STD + + +356 + `�r�tf + ( +FILE + * +__��ri� + +__��am +, + +357 cڡ * +__��ri� + +__f�m� +, ...); + +362 + `��tf + (cڡ * +__��ri� + +__f�m� +, ...); + +364 + $�r�tf + (* +__��ri� + +__s +, + +365 cڡ * +__��ri� + +__f�m� +, ...� +__THROWNL +; + +371 + `v�r�tf + ( +FILE + * +__��ri� + +__s +, cڡ *__��ri� +__f�m� +, + +372 +_G_va_li� + +__�g +); + +377 + `v��tf + (cڡ * +__��ri� + +__f�m� +, +_G_va_li� + +__�g +); + +379 + $v�r�tf + (* +__��ri� + +__s +, cڡ *__��ri� +__f�m� +, + +380 +_G_va_li� + +__�g +� +__THROWNL +; + +381 +__END_NAMESPACE_STD + + +383 #i� +def�ed + +__USE_BSD + || def�ed +__USE_ISOC99 + || def�ed +__USE_UNIX98 + + +384 +__BEGIN_NAMESPACE_C99 + + +386 + $���tf + (* +__��ri� + +__s +, +size_t + +__max�n +, + +387 cڡ * +__��ri� + +__f�m� +, ...) + +388 +__THROWNL + + `__��ibu�__ + (( + `__f�m�__ + ( +__��tf__ +, 3, 4))); + +390 + $v���tf + (* +__��ri� + +__s +, +size_t + +__max�n +, + +391 cڡ * +__��ri� + +__f�m� +, +_G_va_li� + +__�g +) + +392 +__THROWNL + + `__��ibu�__ + (( + `__f�m�__ + ( +__��tf__ +, 3, 0))); + +393 +__END_NAMESPACE_C99 + + +396 #ifde� +__USE_GNU + + +399 + $va�r�tf + (** +__��ri� + +__�r +, cڡ *__��ri� +__f +, + +400 +_G_va_li� + +__�g +) + +401 +__THROWNL + + `__��ibu�__ + (( + $__f�m�__ + ( +__��tf__ +, 2, 0))� +__wur +; + +402 + $__a�r�tf + (** +__��ri� + +__�r +, + +403 cڡ * +__��ri� + +__fmt +, ...) + +404 +__THROWNL + + `__��ibu�__ + (( + $__f�m�__ + ( +__��tf__ +, 2, 3))� +__wur +; + +405 + $a�r�tf + (** +__��ri� + +__�r +, + +406 cڡ * +__��ri� + +__fmt +, ...) + +407 +__THROWNL + + `__��ibu�__ + (( + $__f�m�__ + ( +__��tf__ +, 2, 3))� +__wur +; + +410 #ifde� +__USE_XOPEN2K8 + + +412 + $vd��tf + ( +__fd +, cڡ * +__��ri� + +__fmt +, + +413 +_G_va_li� + +__�g +) + +414 + `__��ibu�__ + (( + `__f�m�__ + ( +__��tf__ +, 2, 0))); + +415 + $d��tf + ( +__fd +, cڡ * +__��ri� + +__fmt +, ...) + +416 + `__��ibu�__ + (( + `__f�m�__ + ( +__��tf__ +, 2, 3))); + +420 +__BEGIN_NAMESPACE_STD + + +425 + $fs�nf + ( +FILE + * +__��ri� + +__��am +, + +426 cڡ * +__��ri� + +__f�m� +, ...� +__wur +; + +431 + $s�nf + (cڡ * +__��ri� + +__f�m� +, ...� +__wur +; + +433 + $ss�nf + (cڡ * +__��ri� + +__s +, + +434 cڡ * +__��ri� + +__f�m� +, ...� +__THROW +; + +436 #i� +def�ed + +__USE_ISOC99 + && !def�ed +__USE_GNU + \ + +437 && (! +def�ed + +__LDBL_COMPAT + || !def�ed +__REDIRECT +) \ + +438 && ( +def�ed + +__STRICT_ANSI__ + || def�ed +__USE_XOPEN2K +) + +439 #ifde� +__REDIRECT + + +443 + `__REDIRECT + ( +fs�nf +, ( +FILE + * +__��ri� + +__��am +, + +444 cڡ * +__��ri� + +__f�m� +, ...), + +445 +__isoc99_fs�nf +� +__wur +; + +446 + `__REDIRECT + ( +s�nf +, (cڡ * +__��ri� + +__f�m� +, ...), + +447 +__isoc99_s�nf +� +__wur +; + +448 + `__REDIRECT_NTH + ( +ss�nf +, (cڡ * +__��ri� + +__s +, + +449 cڡ * +__��ri� + +__f�m� +, ...), + +450 +__isoc99_ss�nf +); + +452 + $__isoc99_fs�nf + ( +FILE + * +__��ri� + +__��am +, + +453 cڡ * +__��ri� + +__f�m� +, ...� +__wur +; + +454 + $__isoc99_s�nf + (cڡ * +__��ri� + +__f�m� +, ...� +__wur +; + +455 + $__isoc99_ss�nf + (cڡ * +__��ri� + +__s +, + +456 cڡ * +__��ri� + +__f�m� +, ...� +__THROW +; + +457 + #fs�nf + +__isoc99_fs�nf + + + ) + +458 + #s�nf + +__isoc99_s�nf + + + ) + +459 + #ss�nf + +__isoc99_ss�nf + + + ) + +463 +__END_NAMESPACE_STD + + +465 #ifdef +__USE_ISOC99 + + +466 +__BEGIN_NAMESPACE_C99 + + +471 + $vfs�nf + ( +FILE + * +__��ri� + +__s +, cڡ *__��ri� +__f�m� +, + +472 +_G_va_li� + +__�g +) + +473 + `__��ibu�__ + (( + $__f�m�__ + ( +__s�nf__ +, 2, 0))� +__wur +; + +479 + $vs�nf + (cڡ * +__��ri� + +__f�m� +, +_G_va_li� + +__�g +) + +480 + `__��ibu�__ + (( + $__f�m�__ + ( +__s�nf__ +, 1, 0))� +__wur +; + +483 + $vss�nf + (cڡ * +__��ri� + +__s +, + +484 cڡ * +__��ri� + +__f�m� +, +_G_va_li� + +__�g +) + +485 +__THROW + + `__��ibu�__ + (( + `__f�m�__ + ( +__s�nf__ +, 2, 0))); + +487 #i�! +def�ed + +__USE_GNU + \ + +488 && (! +def�ed + +__LDBL_COMPAT + || !def�ed +__REDIRECT +) \ + +489 && ( +def�ed + +__STRICT_ANSI__ + || def�ed +__USE_XOPEN2K +) + +490 #ifde� +__REDIRECT + + +494 + `__REDIRECT + ( +vfs�nf +, + +495 ( +FILE + * +__��ri� + +__s +, + +496 cڡ * +__��ri� + +__f�m� +, +_G_va_li� + +__�g +), + +497 +__isoc99_vfs�nf +) + +498 + `__��ibu�__ + (( + $__f�m�__ + ( +__s�nf__ +, 2, 0))� +__wur +; + +499 + `__REDIRECT + ( +vs�nf +, (cڡ * +__��ri� + +__f�m� +, + +500 +_G_va_li� + +__�g +), +__isoc99_vs�nf +) + +501 + `__��ibu�__ + (( + $__f�m�__ + ( +__s�nf__ +, 1, 0))� +__wur +; + +502 + `__REDIRECT_NTH + ( +vss�nf +, + +503 (cڡ * +__��ri� + +__s +, + +504 cڡ * +__��ri� + +__f�m� +, + +505 +_G_va_li� + +__�g +), +__isoc99_vss�nf +) + +506 + `__��ibu�__ + (( + `__f�m�__ + ( +__s�nf__ +, 2, 0))); + +508 + $__isoc99_vfs�nf + ( +FILE + * +__��ri� + +__s +, + +509 cڡ * +__��ri� + +__f�m� +, + +510 +_G_va_li� + +__�g +� +__wur +; + +511 + $__isoc99_vs�nf + (cڡ * +__��ri� + +__f�m� +, + +512 +_G_va_li� + +__�g +� +__wur +; + +513 + $__isoc99_vss�nf + (cڡ * +__��ri� + +__s +, + +514 cڡ * +__��ri� + +__f�m� +, + +515 +_G_va_li� + +__�g +� +__THROW +; + +516 + #vfs�nf + +__isoc99_vfs�nf + + + ) + +517 + #vs�nf + +__isoc99_vs�nf + + + ) + +518 + #vss�nf + +__isoc99_vss�nf + + + ) + +522 +__END_NAMESPACE_C99 + + +526 +__BEGIN_NAMESPACE_STD + + +531 + `fg�c + ( +FILE + * +__��am +); + +532 + `g�c + ( +FILE + * +__��am +); + +538 + `g�ch� + (); + +539 +__END_NAMESPACE_STD + + +543 + #g�c +( +_� +� + `_IO_g�c + (_�) + + ) + +545 #i� +def�ed + +__USE_POSIX + || def�ed +__USE_MISC + + +550 + `g�c_u�ocked + ( +FILE + * +__��am +); + +551 + `g�ch�_u�ocked + (); + +554 #ifde� +__USE_MISC + + +561 + `fg�c_u�ocked + ( +FILE + * +__��am +); + +565 +__BEGIN_NAMESPACE_STD + + +573 + `�utc + ( +__c +, +FILE + * +__��am +); + +574 + `putc + ( +__c +, +FILE + * +__��am +); + +580 + `putch� + ( +__c +); + +581 +__END_NAMESPACE_STD + + +585 + #putc +( +_ch +, +_� +� + `_IO_putc + (_ch, _�) + + ) + +587 #ifde� +__USE_MISC + + +594 + `�utc_u�ocked + ( +__c +, +FILE + * +__��am +); + +597 #i� +def�ed + +__USE_POSIX + || def�ed +__USE_MISC + + +602 + `putc_u�ocked + ( +__c +, +FILE + * +__��am +); + +603 + `putch�_u�ocked + ( +__c +); + +607 #i� +def�ed + +__USE_SVID + || def�ed +__USE_MISC + \ + +608 || ( +def�ed + +__USE_XOPEN + && !def�ed +__USE_XOPEN2K +) + +610 + `g�w + ( +FILE + * +__��am +); + +613 + `putw + ( +__w +, +FILE + * +__��am +); + +617 +__BEGIN_NAMESPACE_STD + + +622 * + $fg�s + (* +__��ri� + +__s +, +__n +, +FILE + *__��ri� +__��am +) + +623 +__wur +; + +625 #i�! +def�ed + +__USE_ISOC11 + \ + +626 || ( +def�ed + +__�lu�lus + && __cplusplus <= 201103L) + +638 * + $g�s + (* +__s +� +__wur + +__��ibu�_d����d__ +; + +640 +__END_NAMESPACE_STD + + +642 #ifde� +__USE_GNU + + +649 * + $fg�s_u�ocked + (* +__��ri� + +__s +, +__n +, + +650 +FILE + * +__��ri� + +__��am +� +__wur +; + +654 #ifdef +__USE_XOPEN2K8 + + +665 +_IO_ssize_t + + $__g�d�im + (** +__��ri� + +__l��� +, + +666 +size_t + * +__��ri� + +__n +, +__d�im�� +, + +667 +FILE + * +__��ri� + +__��am +� +__wur +; + +668 +_IO_ssize_t + + $g�d�im + (** +__��ri� + +__l��� +, + +669 +size_t + * +__��ri� + +__n +, +__d�im�� +, + +670 +FILE + * +__��ri� + +__��am +� +__wur +; + +678 +_IO_ssize_t + + $g�l�e + (** +__��ri� + +__l��� +, + +679 +size_t + * +__��ri� + +__n +, + +680 +FILE + * +__��ri� + +__��am +� +__wur +; + +684 +__BEGIN_NAMESPACE_STD + + +689 + `�uts + (cڡ * +__��ri� + +__s +, +FILE + *__��ri� +__��am +); + +695 + `puts + (cڡ * +__s +); + +702 + `ung�c + ( +__c +, +FILE + * +__��am +); + +709 +size_t + + $�d + (* +__��ri� + +__�r +, +size_t + +__size +, + +710 +size_t + +__n +, +FILE + * +__��ri� + +__��am +� +__wur +; + +715 +size_t + + `fwr�e + (cڡ * +__��ri� + +__�r +, size_� +__size +, + +716 +size_t + +__n +, +FILE + * +__��ri� + +__s +); + +717 +__END_NAMESPACE_STD + + +719 #ifde� +__USE_GNU + + +726 + `�uts_u�ocked + (cڡ * +__��ri� + +__s +, + +727 +FILE + * +__��ri� + +__��am +); + +730 #ifde� +__USE_MISC + + +737 +size_t + + $�d_u�ocked + (* +__��ri� + +__�r +, +size_t + +__size +, + +738 +size_t + +__n +, +FILE + * +__��ri� + +__��am +� +__wur +; + +739 +size_t + + `fwr�e_u�ocked + (cڡ * +__��ri� + +__�r +, size_� +__size +, + +740 +size_t + +__n +, +FILE + * +__��ri� + +__��am +); + +744 +__BEGIN_NAMESPACE_STD + + +749 + `f�ek + ( +FILE + * +__��am +, +__off +, +__wh�� +); + +754 + $�l + ( +FILE + * +__��am +� +__wur +; + +759 + `�w�d + ( +FILE + * +__��am +); + +760 +__END_NAMESPACE_STD + + +767 #i� +def�ed + +__USE_LARGEFILE + || def�ed +__USE_XOPEN2K + + +768 #i�de� +__USE_FILE_OFFSET64 + + +773 + `f�eko + ( +FILE + * +__��am +, +__off_t + +__off +, +__wh�� +); + +778 +__off_t + + $�lo + ( +FILE + * +__��am +� +__wur +; + +780 #ifde� +__REDIRECT + + +781 + `__REDIRECT + ( +f�eko +, + +782 ( +FILE + * +__��am +, +__off64_t + +__off +, +__wh�� +), + +783 +f�eko64 +); + +784 +__off64_t + + `__REDIRECT + ( +�lo +, ( +FILE + * +__��am +), +�lo64 +); + +786 + #f�eko + +f�eko64 + + + ) + +787 + #�lo + +�lo64 + + + ) + +792 +__BEGIN_NAMESPACE_STD + + +793 #i�de� +__USE_FILE_OFFSET64 + + +798 + `fg�pos + ( +FILE + * +__��ri� + +__��am +, +�os_t + *__��ri� +__pos +); + +803 + `f��os + ( +FILE + * +__��am +, cڡ +�os_t + * +__pos +); + +805 #ifde� +__REDIRECT + + +806 + `__REDIRECT + ( +fg�pos +, ( +FILE + * +__��ri� + +__��am +, + +807 +�os_t + * +__��ri� + +__pos +), +fg�pos64 +); + +808 + `__REDIRECT + ( +f��os +, + +809 ( +FILE + * +__��am +, cڡ +�os_t + * +__pos +), +f��os64 +); + +811 + #fg�pos + +fg�pos64 + + + ) + +812 + #f��os + +f��os64 + + + ) + +815 +__END_NAMESPACE_STD + + +817 #ifde� +__USE_LARGEFILE64 + + +818 + `f�eko64 + ( +FILE + * +__��am +, +__off64_t + +__off +, +__wh�� +); + +819 +__off64_t + + $�lo64 + ( +FILE + * +__��am +� +__wur +; + +820 + `fg�pos64 + ( +FILE + * +__��ri� + +__��am +, +�os64_t + *__��ri� +__pos +); + +821 + `f��os64 + ( +FILE + * +__��am +, cڡ +�os64_t + * +__pos +); + +824 +__BEGIN_NAMESPACE_STD + + +826 + $���� + ( +FILE + * +__��am +� +__THROW +; + +828 + $�of + ( +FILE + * +__��am +� +__THROW + +__wur +; + +830 + $�� + ( +FILE + * +__��am +� +__THROW + +__wur +; + +831 +__END_NAMESPACE_STD + + +833 #ifde� +__USE_MISC + + +835 + $����_u�ocked + ( +FILE + * +__��am +� +__THROW +; + +836 + $�of_u�ocked + ( +FILE + * +__��am +� +__THROW + +__wur +; + +837 + $��_u�ocked + ( +FILE + * +__��am +� +__THROW + +__wur +; + +841 +__BEGIN_NAMESPACE_STD + + +846 + `��� + (cڡ * +__s +); + +847 +__END_NAMESPACE_STD + + +853 + ~<b�s/sys_��i�.h +> + +856 #ifdef +__USE_POSIX + + +858 + $f��o + ( +FILE + * +__��am +� +__THROW + +__wur +; + +861 #ifde� +__USE_MISC + + +863 + $f��o_u�ocked + ( +FILE + * +__��am +� +__THROW + +__wur +; + +867 #i�( +def�ed + +__USE_POSIX2 + || def�ed +__USE_SVID + || def�ed +__USE_BSD + || \ + +868 +def�ed + +__USE_MISC +) + +873 +FILE + * + $pݒ + (cڡ * +__comm�d +, cڡ * +__modes +� +__wur +; + +879 + `p�o� + ( +FILE + * +__��am +); + +883 #ifdef +__USE_POSIX + + +885 * + $��mid + (* +__s +� +__THROW +; + +889 #ifde� +__USE_XOPEN + + +891 * + `cu�rid + (* +__s +); + +895 #ifdef +__USE_GNU + + +896 +ob�ack +; + +899 + $ob�ack_��tf + ( +ob�ack + * +__��ri� + +__ob�ack +, + +900 cڡ * +__��ri� + +__f�m� +, ...) + +901 +__THROWNL + + `__��ibu�__ + (( + `__f�m�__ + ( +__��tf__ +, 2, 3))); + +902 + $ob�ack_v��tf + ( +ob�ack + * +__��ri� + +__ob�ack +, + +903 cڡ * +__��ri� + +__f�m� +, + +904 +_G_va_li� + +__�gs +) + +905 +__THROWNL + + `__��ibu�__ + (( + `__f�m�__ + ( +__��tf__ +, 2, 0))); + +909 #i� +def�ed + +__USE_POSIX + || def�ed +__USE_MISC + + +913 + $�ockf�e + ( +FILE + * +__��am +� +__THROW +; + +917 + $�rylockf�e + ( +FILE + * +__��am +� +__THROW + +__wur +; + +920 + $fu�ockf�e + ( +FILE + * +__��am +� +__THROW +; + +923 #i� +def�ed + +__USE_XOPEN + && !def�ed +__USE_XOPEN2K + && !def�ed +__USE_GNU + + +927 + #__�ed_g��t + + + ) + +928 + ~<g��t.h +> + +933 #ifde� +__USE_EXTERN_INLINES + + +934 + ~<b�s/�dio.h +> + +936 #i� +__USE_FORTIFY_LEVEL + > 0 && +def�ed + +__ex��_�ways_�l�e + + +937 + ~<b�s/�dio2.h +> + +939 #ifde� +__LDBL_COMPAT + + +940 + ~<b�s/�dio-ldbl.h +> + +943 +__END_DECLS + + + @/usr/include/stdlib.h + +22 #i�def +_STDLIB_H + + +24 + ~<�u�s.h +> + +27 + #__�ed_size_t + + + ) + +28 #i�de� +__�ed_m�loc_�d_��oc + + +29 + #__�ed_wch�_t + + + ) + +30 + #__�ed_NULL + + + ) + +32 + ~<�ddef.h +> + +34 + g__BEGIN_DECLS + + +36 #i�de� +__�ed_m�loc_�d_��oc + + +37 + #_STDLIB_H + 1 + + ) + +39 #i�( +def�ed + +__USE_XOPEN + || def�ed +__USE_XOPEN2K8 +�&& !def�ed +_SYS_WAIT_H + + +41 + ~<b�s/wa��ags.h +> + +42 + ~<b�s/wa���us.h +> + +44 #ifde� +__USE_BSD + + +49 #i� +def�ed + +__GNUC__ + && !def�ed +__�lu�lus + + +50 + #__WAIT_INT +( +��us +) \ + +51 ( + `__ex�nsi�__ + (((uni� { + `__ty�of +( +��us +� +__� +; +__i +; }) \ + +52 { . +__� + = ( +��us +�}). +__i +)) + + ) + +54 + #__WAIT_INT +( +��us +�(*(*�&(��us)) + + ) + +62 #i�! +def�ed + +__GNUC__ + || __GNUC__ < 2 || def�ed +__�lu�lus + + +63 + #__WAIT_STATUS + * + + ) + +64 + #__WAIT_STATUS_DEFN + * + + ) + +69 +wa� + * + m__u�r +; + +70 * + m__�� +; + +71 } + t__WAIT_STATUS + + t__��ibu�__ + (( + t__�����t_uni�__ +)); + +72 + #__WAIT_STATUS_DEFN + * + + ) + +77 + #__WAIT_INT +( +��us +�(��us) + + ) + +78 + #__WAIT_STATUS + * + + ) + +79 + #__WAIT_STATUS_DEFN + * + + ) + +84 + #WEXITSTATUS +( +��us +� + `__WEXITSTATUS + ( + `__WAIT_INT + (��us)) + + ) + +85 + #WTERMSIG +( +��us +� + `__WTERMSIG + ( + `__WAIT_INT + (��us)) + + ) + +86 + #WSTOPSIG +( +��us +� + `__WSTOPSIG + ( + `__WAIT_INT + (��us)) + + ) + +87 + #WIFEXITED +( +��us +� + `__WIFEXITED + ( + `__WAIT_INT + (��us)) + + ) + +88 + #WIFSIGNALED +( +��us +� + `__WIFSIGNALED + ( + `__WAIT_INT + (��us)) + + ) + +89 + #WIFSTOPPED +( +��us +� + `__WIFSTOPPED + ( + `__WAIT_INT + (��us)) + + ) + +90 #ifde� +__WIFCONTINUED + + +91 + #WIFCONTINUED +( +��us +� + `__WIFCONTINUED + ( + `__WAIT_INT + (��us)) + + ) + +95 +__BEGIN_NAMESPACE_STD + + +99 + mqu� +; + +100 + m�m +; + +101 } + tdiv_t +; + +104 #i�de� +__ldiv_t_def�ed + + +107 + mqu� +; + +108 + m�m +; + +109 } + tldiv_t +; + +110 + #__ldiv_t_def�ed + 1 + + ) + +112 + g__END_NAMESPACE_STD + + +114 #i� +def�ed + +__USE_ISOC99 + && !def�ed +__�div_t_def�ed + + +115 +__BEGIN_NAMESPACE_C99 + + +117 +__ex�nsi�__ + struct + +119 + mqu� +; + +120 + m�m +; + +121 } + t�div_t +; + +122 + #__�div_t_def�ed + 1 + + ) + +123 + g__END_NAMESPACE_C99 + + +128 + #RAND_MAX + 2147483647 + + ) + +133 + #EXIT_FAILURE + 1 + + ) + +134 + #EXIT_SUCCESS + 0 + + ) + +138 + #MB_CUR_MAX + ( + `__�y�_g�_mb_cur_max + ()) + + ) + +139 +size_t + + $__�y�_g�_mb_cur_max + (� +__THROW + +__wur +; + +142 +__BEGIN_NAMESPACE_STD + + +144 + $�of + (cڡ * +__Ō +) + +145 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1)� +__wur +; + +147 + $�oi + (cڡ * +__Ō +) + +148 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1)� +__wur +; + +150 + $�� + (cڡ * +__Ō +) + +151 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1)� +__wur +; + +152 +__END_NAMESPACE_STD + + +154 #i� +def�ed + +__USE_ISOC99 + || def�ed +__USE_MISC + + +155 +__BEGIN_NAMESPACE_C99 + + +157 +__ex�nsi�__ + + $��l + (cڡ * +__Ō +) + +158 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1)� +__wur +; + +159 +__END_NAMESPACE_C99 + + +162 +__BEGIN_NAMESPACE_STD + + +164 + $��od + (cڡ * +__��ri� + +__Ō +, + +165 ** +__��ri� + +__�d�r +) + +166 +__THROW + + `__n�nu� + ((1)); + +167 +__END_NAMESPACE_STD + + +169 #ifdef +__USE_ISOC99 + + +170 +__BEGIN_NAMESPACE_C99 + + +172 + $��of + (cڡ * +__��ri� + +__Ō +, + +173 ** +__��ri� + +__�d�r +� +__THROW + + `__n�nu� + ((1)); + +175 + $���d + (cڡ * +__��ri� + +__Ō +, + +176 ** +__��ri� + +__�d�r +) + +177 +__THROW + + `__n�nu� + ((1)); + +178 +__END_NAMESPACE_C99 + + +181 +__BEGIN_NAMESPACE_STD + + +183 + $��� + (cڡ * +__��ri� + +__Ō +, + +184 ** +__��ri� + +__�d�r +, +__ba� +) + +185 +__THROW + + `__n�nu� + ((1)); + +187 + $��oul + (cڡ * +__��ri� + +__Ō +, + +188 ** +__��ri� + +__�d�r +, +__ba� +) + +189 +__THROW + + `__n�nu� + ((1)); + +190 +__END_NAMESPACE_STD + + +192 #ifde� +__USE_BSD + + +194 +__ex�nsi�__ + + +195 + $��oq + (cڡ * +__��ri� + +__Ō +, + +196 ** +__��ri� + +__�d�r +, +__ba� +) + +197 +__THROW + + `__n�nu� + ((1)); + +199 +__ex�nsi�__ + + +200 + $��ouq + (cڡ * +__��ri� + +__Ō +, + +201 ** +__��ri� + +__�d�r +, +__ba� +) + +202 +__THROW + + `__n�nu� + ((1)); + +205 #i� +def�ed + +__USE_ISOC99 + || def�ed +__USE_MISC + + +206 +__BEGIN_NAMESPACE_C99 + + +208 +__ex�nsi�__ + + +209 + $���l + (cڡ * +__��ri� + +__Ō +, + +210 ** +__��ri� + +__�d�r +, +__ba� +) + +211 +__THROW + + `__n�nu� + ((1)); + +213 +__ex�nsi�__ + + +214 + $��ou� + (cڡ * +__��ri� + +__Ō +, + +215 ** +__��ri� + +__�d�r +, +__ba� +) + +216 +__THROW + + `__n�nu� + ((1)); + +217 +__END_NAMESPACE_C99 + + +221 #ifde� +__USE_GNU + + +235 + ~<xlo��.h +> + +239 + $���_l + (cڡ * +__��ri� + +__Ō +, + +240 ** +__��ri� + +__�d�r +, +__ba� +, + +241 +__lo��_t + +__loc +� +__THROW + + `__n�nu� + ((1, 4)); + +243 + $��oul_l + (cڡ * +__��ri� + +__Ō +, + +244 ** +__��ri� + +__�d�r +, + +245 +__ba� +, +__lo��_t + +__loc +) + +246 +__THROW + + `__n�nu� + ((1, 4)); + +248 +__ex�nsi�__ + + +249 + $���l_l + (cڡ * +__��ri� + +__Ō +, + +250 ** +__��ri� + +__�d�r +, +__ba� +, + +251 +__lo��_t + +__loc +) + +252 +__THROW + + `__n�nu� + ((1, 4)); + +254 +__ex�nsi�__ + + +255 + $��ou�_l + (cڡ * +__��ri� + +__Ō +, + +256 ** +__��ri� + +__�d�r +, + +257 +__ba� +, +__lo��_t + +__loc +) + +258 +__THROW + + `__n�nu� + ((1, 4)); + +260 + $��od_l + (cڡ * +__��ri� + +__Ō +, + +261 ** +__��ri� + +__�d�r +, +__lo��_t + +__loc +) + +262 +__THROW + + `__n�nu� + ((1, 3)); + +264 + $��of_l + (cڡ * +__��ri� + +__Ō +, + +265 ** +__��ri� + +__�d�r +, +__lo��_t + +__loc +) + +266 +__THROW + + `__n�nu� + ((1, 3)); + +268 + $���d_l + (cڡ * +__��ri� + +__Ō +, + +269 ** +__��ri� + +__�d�r +, + +270 +__lo��_t + +__loc +) + +271 +__THROW + + `__n�nu� + ((1, 3)); + +275 #ifde� +__USE_EXTERN_INLINES + + +276 +__BEGIN_NAMESPACE_STD + + +277 +__ex��_�l�e + + +278 + `__NTH + ( + $�oi + (cڡ * +__Ō +)) + +280 (� + `��� + ( +__Ō +, (**� +NULL +, 10); + +281 + } +} + +282 +__ex��_�l�e + + +283 +__NTH + ( + $�� + (cڡ * +__Ō +)) + +285 + `��� + ( +__Ō +, (**� +NULL +, 10); + +286 + } +} + +287 + g__END_NAMESPACE_STD + + +289 #i� +def�ed + +__USE_MISC + || def�ed +__USE_ISOC99 + + +290 +__BEGIN_NAMESPACE_C99 + + +291 +__ex�nsi�__ + +__ex��_�l�e + + +292 +__NTH + ( + $��l + (cڡ * +__Ō +)) + +294 + `���l + ( +__Ō +, (**� +NULL +, 10); + +295 + } +} + +296 + g__END_NAMESPACE_C99 + + +301 #i� +def�ed + +__USE_SVID + || def�ed +__USE_XOPEN_EXTENDED + + +305 * + $l64a + ( +__n +� +__THROW + +__wur +; + +308 + $a64l + (cڡ * +__s +) + +309 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1)� +__wur +; + +313 #i� +def�ed + +__USE_SVID + || def�ed +__USE_XOPEN_EXTENDED + || def�ed +__USE_BSD + + +314 + ~<sys/ty�s.h +> + +321 + $�ndom + (� +__THROW +; + +324 + $��dom + ( +__�ed +� +__THROW +; + +330 * + $����e + ( +__�ed +, * +__��ebuf +, + +331 +size_t + +__���� +� +__THROW + + `__n�nu� + ((2)); + +335 * + $�t��e + (* +__��ebuf +� +__THROW + + `__n�nu� + ((1)); + +338 #ifde� +__USE_MISC + + +343 + s�ndom_d�a + + +345 +�t32_t + * +� +; + +346 +�t32_t + * +�� +; + +347 +�t32_t + * +��e +; + +348 +�nd_ty� +; + +349 +�nd_deg +; + +350 +�nd_�p +; + +351 +�t32_t + * +�d_�r +; + +354 + $�ndom_r + ( +�ndom_d�a + * +__��ri� + +__buf +, + +355 +�t32_t + * +__��ri� + +__�su� +� +__THROW + + `__n�nu� + ((1, 2)); + +357 + $��dom_r + ( +__�ed +, +�ndom_d�a + * +__buf +) + +358 +__THROW + + `__n�nu� + ((2)); + +360 + $����e_r + ( +__�ed +, * +__��ri� + +__��ebuf +, + +361 +size_t + +__���� +, + +362 +�ndom_d�a + * +__��ri� + +__buf +) + +363 +__THROW + + `__n�nu� + ((2, 4)); + +365 + $�t��e_r + (* +__��ri� + +__��ebuf +, + +366 +�ndom_d�a + * +__��ri� + +__buf +) + +367 +__THROW + + `__n�nu� + ((1, 2)); + +372 +__BEGIN_NAMESPACE_STD + + +374 + $�nd + (� +__THROW +; + +376 + $��d + ( +__�ed +� +__THROW +; + +377 +__END_NAMESPACE_STD + + +379 #ifde� +__USE_POSIX + + +381 + $�nd_r + (* +__�ed +� +__THROW +; + +385 #i� +def�ed + +__USE_SVID + || def�ed +__USE_XOPEN + + +389 + $d�nd48 + (� +__THROW +; + +390 + $��d48 + ( +__xsubi +[3]� +__THROW + + `__n�nu� + ((1)); + +393 + $̪d48 + (� +__THROW +; + +394 + $Īd48 + ( +__xsubi +[3]) + +395 +__THROW + + `__n�nu� + ((1)); + +398 + $m�nd48 + (� +__THROW +; + +399 + $j�nd48 + ( +__xsubi +[3]) + +400 +__THROW + + `__n�nu� + ((1)); + +403 + $��d48 + ( +__�edv� +� +__THROW +; + +404 * + $�ed48 + ( +__�ed16v +[3]) + +405 +__THROW + + `__n�nu� + ((1)); + +406 + $lc�g48 + ( +__��m +[7]� +__THROW + + `__n�nu� + ((1)); + +408 #ifde� +__USE_MISC + + +412 + sd�nd48_d�a + + +414 +__x +[3]; + +415 +__�d_x +[3]; + +416 +__c +; + +417 +__�� +; + +418 +__ex�nsi�__ + +__a +; + +423 + $d�nd48_r + ( +d�nd48_d�a + * +__��ri� + +__buf�r +, + +424 * +__��ri� + +__�su� +� +__THROW + + `__n�nu� + ((1, 2)); + +425 + $��d48_r + ( +__xsubi +[3], + +426 +d�nd48_d�a + * +__��ri� + +__buf�r +, + +427 * +__��ri� + +__�su� +� +__THROW + + `__n�nu� + ((1, 2)); + +430 + $̪d48_r + ( +d�nd48_d�a + * +__��ri� + +__buf�r +, + +431 * +__��ri� + +__�su� +) + +432 +__THROW + + `__n�nu� + ((1, 2)); + +433 + $Īd48_r + ( +__xsubi +[3], + +434 +d�nd48_d�a + * +__��ri� + +__buf�r +, + +435 * +__��ri� + +__�su� +) + +436 +__THROW + + `__n�nu� + ((1, 2)); + +439 + $m�nd48_r + ( +d�nd48_d�a + * +__��ri� + +__buf�r +, + +440 * +__��ri� + +__�su� +) + +441 +__THROW + + `__n�nu� + ((1, 2)); + +442 + $j�nd48_r + ( +__xsubi +[3], + +443 +d�nd48_d�a + * +__��ri� + +__buf�r +, + +444 * +__��ri� + +__�su� +) + +445 +__THROW + + `__n�nu� + ((1, 2)); + +448 + $��d48_r + ( +__�edv� +, +d�nd48_d�a + * +__buf�r +) + +449 +__THROW + + `__n�nu� + ((2)); + +451 + $�ed48_r + ( +__�ed16v +[3], + +452 +d�nd48_d�a + * +__buf�r +� +__THROW + + `__n�nu� + ((1, 2)); + +454 + $lc�g48_r + ( +__��m +[7], + +455 +d�nd48_d�a + * +__buf�r +) + +456 +__THROW + + `__n�nu� + ((1, 2)); + +462 #i�de� +__m�loc_�d_��oc_def�ed + + +463 + #__m�loc_�d_��oc_def�ed + + + ) + +464 +__BEGIN_NAMESPACE_STD + + +466 * + $m�loc + ( +size_t + +__size +� +__THROW + +__��ibu�_m�loc__ + +__wur +; + +468 * + $��oc + ( +size_t + +__nmemb +, size_� +__size +) + +469 +__THROW + +__��ibu�_m�loc__ + +__wur +; + +470 +__END_NAMESPACE_STD + + +473 #i�de� +__�ed_m�loc_�d_��oc + + +474 +__BEGIN_NAMESPACE_STD + + +480 * + $��loc + (* +__�r +, +size_t + +__size +) + +481 +__THROW + +__��ibu�_w�n_unu�d_�su�__ +; + +483 + $� + (* +__�r +� +__THROW +; + +484 +__END_NAMESPACE_STD + + +486 #ifdef +__USE_MISC + + +488 + $c� + (* +__�r +� +__THROW +; + +491 #i� +def�ed + +__USE_GNU + || def�ed +__USE_BSD + || def�ed +__USE_MISC + + +492 + ~<�lo�.h +> + +495 #i�( +def�ed + +__USE_XOPEN_EXTENDED + && !def�ed +__USE_XOPEN2K +) \ + +496 || +def�ed + +__USE_BSD + + +498 * + $v�loc + ( +size_t + +__size +� +__THROW + +__��ibu�_m�loc__ + +__wur +; + +501 #ifde� +__USE_XOPEN2K + + +503 + $posix_mem�ign + (** +__mem�r +, +size_t + +__�ignm�t +, size_� +__size +) + +504 +__THROW + + `__n�nu� + ((1)� +__wur +; + +507 #ifde� +__USE_ISOC11 + + +509 * + $�ig�d_�loc + ( +size_t + +__�ignm�t +, size_� +__size +) + +510 +__THROW + +__��ibu�_m�loc__ + + `__��ibu�_�loc_size__ + ((2)� +__wur +; + +513 +__BEGIN_NAMESPACE_STD + + +515 + $ab�t + (� +__THROW + + `__��ibu�__ + (( +__nܑu�__ +)); + +519 + `�ex� + ((* +__func +�()� +__THROW + + `__n�nu� + ((1)); + +521 #i� +def�ed + +__USE_ISOC11 + || def�ed +__USE_ISOCXX11 + + +523 #ifde� +__�lu�lus + + +524 "C++" + `�_quick_ex� + ((* +__func +) ()) + +525 +__THROW + + `__asm + ("�_quick_ex�"� + `__n�nu� + ((1)); + +527 + `�_quick_ex� + ((* +__func +�()� +__THROW + + `__n�nu� + ((1)); + +530 +__END_NAMESPACE_STD + + +532 #ifdef +__USE_MISC + + +535 + `�_ex� + ((* +__func +�( +__��us +, * +__�g +), *__arg) + +536 +__THROW + + `__n�nu� + ((1)); + +539 +__BEGIN_NAMESPACE_STD + + +543 + $ex� + ( +__��us +� +__THROW + + `__��ibu�__ + (( +__nܑu�__ +)); + +545 #i� +def�ed + +__USE_ISOC11 + || def�ed +__USE_ISOCXX11 + + +549 + $quick_ex� + ( +__��us +� +__THROW + + `__��ibu�__ + (( +__nܑu�__ +)); + +551 +__END_NAMESPACE_STD + + +553 #ifde� +__USE_ISOC99 + + +554 +__BEGIN_NAMESPACE_C99 + + +557 + $_Ex� + ( +__��us +� +__THROW + + `__��ibu�__ + (( +__nܑu�__ +)); + +558 +__END_NAMESPACE_C99 + + +562 +__BEGIN_NAMESPACE_STD + + +564 * + $g��v + (cڡ * +__�me +� +__THROW + + `__n�nu� + ((1)� +__wur +; + +565 +__END_NAMESPACE_STD + + +567 #ifde� +__USE_GNU + + +570 * + $�cu�_g��v + (cڡ * +__�me +) + +571 +__THROW + + `__n�nu� + ((1)� +__wur +; + +574 #i� +def�ed + +__USE_SVID + || def�ed +__USE_XOPEN + + +578 + $pu�nv + (* +__�r�g +� +__THROW + + `__n�nu� + ((1)); + +581 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN2K + + +584 + $��nv + (cڡ * +__�me +, cڡ * +__v�ue +, +__��a� +) + +585 +__THROW + + `__n�nu� + ((2)); + +588 + $un��nv + (cڡ * +__�me +� +__THROW + + `__n�nu� + ((1)); + +591 #ifdef +__USE_MISC + + +595 + $���nv + (� +__THROW +; + +599 #i� +def�ed + +__USE_MISC + \ + +600 || ( +def�ed + +__USE_XOPEN_EXTENDED + && !def�ed +__USE_XOPEN2K8 +) + +606 * + $mk�mp + (* +__�m��e +� +__THROW + + `__n�nu� + ((1)); + +609 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN_EXTENDED + \ + +610 || +def�ed + +__USE_XOPEN2K8 + + +619 #i�de� +__USE_FILE_OFFSET64 + + +620 + $mk�emp + (* +__�m��e +� + `__n�nu� + ((1)� +__wur +; + +622 #ifde� +__REDIRECT + + +623 + `__REDIRECT + ( +mk�emp +, (* +__�m��e +), +mk�emp64 +) + +624 + `__n�nu� + ((1)� +__wur +; + +626 + #mk�emp + +mk�emp64 + + + ) + +629 #ifde� +__USE_LARGEFILE64 + + +630 + $mk�emp64 + (* +__�m��e +� + `__n�nu� + ((1)� +__wur +; + +634 #ifde� +__USE_MISC + + +641 #i�de� +__USE_FILE_OFFSET64 + + +642 + $mk�emps + (* +__�m��e +, +__suffix�n +� + `__n�nu� + ((1)� +__wur +; + +644 #ifde� +__REDIRECT + + +645 + `__REDIRECT + ( +mk�emps +, (* +__�m��e +, +__suffix�n +), + +646 +mk�emps64 +� + `__n�nu� + ((1)� +__wur +; + +648 + #mk�emps + +mk�emps64 + + + ) + +651 #ifde� +__USE_LARGEFILE64 + + +652 + $mk�emps64 + (* +__�m��e +, +__suffix�n +) + +653 + `__n�nu� + ((1)� +__wur +; + +657 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN2K8 + + +663 * + $mkd�mp + (* +__�m��e +� +__THROW + + `__n�nu� + ((1)� +__wur +; + +666 #ifde� +__USE_GNU + + +673 #i�de� +__USE_FILE_OFFSET64 + + +674 + $mko�emp + (* +__�m��e +, +__�ags +� + `__n�nu� + ((1)� +__wur +; + +676 #ifde� +__REDIRECT + + +677 + `__REDIRECT + ( +mko�emp +, (* +__�m��e +, +__�ags +), +mko�emp64 +) + +678 + `__n�nu� + ((1)� +__wur +; + +680 + #mko�emp + +mko�emp64 + + + ) + +683 #ifde� +__USE_LARGEFILE64 + + +684 + $mko�emp64 + (* +__�m��e +, +__�ags +� + `__n�nu� + ((1)� +__wur +; + +693 #i�de� +__USE_FILE_OFFSET64 + + +694 + $mko�emps + (* +__�m��e +, +__suffix�n +, +__�ags +) + +695 + `__n�nu� + ((1)� +__wur +; + +697 #ifde� +__REDIRECT + + +698 + `__REDIRECT + ( +mko�emps +, (* +__�m��e +, +__suffix�n +, + +699 +__�ags +), +mko�emps64 +) + +700 + `__n�nu� + ((1)� +__wur +; + +702 + #mko�emps + +mko�emps64 + + + ) + +705 #ifde� +__USE_LARGEFILE64 + + +706 + $mko�emps64 + (* +__�m��e +, +__suffix�n +, +__�ags +) + +707 + `__n�nu� + ((1)� +__wur +; + +712 +__BEGIN_NAMESPACE_STD + + +717 + $sy�em + (cڡ * +__comm�d +� +__wur +; + +718 +__END_NAMESPACE_STD + + +721 #ifdef +__USE_GNU + + +724 * + $�n�i�lize_f�e_�me + (cڡ * +__�me +) + +725 +__THROW + + `__n�nu� + ((1)� +__wur +; + +728 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + + +734 * + $���th + (cڡ * +__��ri� + +__�me +, + +735 * +__��ri� + +__�s�ved +� +__THROW + +__wur +; + +740 #i�de� +__COMPAR_FN_T + + +741 + #__COMPAR_FN_T + + + ) + +742 (* + t__com�r_�_t +) (const *, const *); + +744 #ifdef +__USE_GNU + + +745 +__com�r_�_t + + tcom�ris�_�_t +; + +748 #ifde� +__USE_GNU + + +749 (* + t__com�r_d_�_t +) (const *, const *, *); + +752 +__BEGIN_NAMESPACE_STD + + +755 * + $b��ch + (cڡ * +__key +, cڡ * +__ba� +, + +756 +size_t + +__nmemb +, size_� +__size +, +__com�r_�_t + +__com�r +) + +757 + `__n�nu� + ((1, 2, 5)� +__wur +; + +759 #ifde� +__USE_EXTERN_INLINES + + +760 + ~<b�s/�dlib-b��ch.h +> + +765 + $qs�t + (* +__ba� +, +size_t + +__nmemb +, size_� +__size +, + +766 +__com�r_�_t + +__com�r +� + `__n�nu� + ((1, 4)); + +767 #ifde� +__USE_GNU + + +768 + $qs�t_r + (* +__ba� +, +size_t + +__nmemb +, size_� +__size +, + +769 +__com�r_d_�_t + +__com�r +, * +__�g +) + +770 + `__n�nu� + ((1, 4)); + +775 + $abs + ( +__x +� +__THROW + + `__��ibu�__ + (( +__cڡ__ +)� +__wur +; + +776 + $�bs + ( +__x +� +__THROW + + `__��ibu�__ + (( +__cڡ__ +)� +__wur +; + +777 +__END_NAMESPACE_STD + + +779 #ifde� +__USE_ISOC99 + + +780 +__ex�nsi�__ + + $�abs + ( +__x +) + +781 +__THROW + + `__��ibu�__ + (( +__cڡ__ +)� +__wur +; + +785 +__BEGIN_NAMESPACE_STD + + +789 +div_t + + $div + ( +__num� +, +__d�om +) + +790 +__THROW + + `__��ibu�__ + (( +__cڡ__ +)� +__wur +; + +791 +ldiv_t + + $ldiv + ( +__num� +, +__d�om +) + +792 +__THROW + + `__��ibu�__ + (( +__cڡ__ +)� +__wur +; + +793 +__END_NAMESPACE_STD + + +795 #ifde� +__USE_ISOC99 + + +796 +__BEGIN_NAMESPACE_C99 + + +797 +__ex�nsi�__ + +�div_t + + $�div + ( +__num� +, + +798 +__d�om +) + +799 +__THROW + + `__��ibu�__ + (( +__cڡ__ +)� +__wur +; + +800 +__END_NAMESPACE_C99 + + +804 #i�( +def�ed + +__USE_XOPEN_EXTENDED + && !def�ed +__USE_XOPEN2K8 +) \ + +805 || +def�ed + +__USE_SVID + + +812 * + $ecvt + ( +__v�ue +, +__ndig� +, * +__��ri� + +__de�t +, + +813 * +__��ri� + +__sign +� +__THROW + + `__n�nu� + ((3, 4)� +__wur +; + +818 * + $fcvt + ( +__v�ue +, +__ndig� +, * +__��ri� + +__de�t +, + +819 * +__��ri� + +__sign +� +__THROW + + `__n�nu� + ((3, 4)� +__wur +; + +824 * + $gcvt + ( +__v�ue +, +__ndig� +, * +__buf +) + +825 +__THROW + + `__n�nu� + ((3)� +__wur +; + +828 #ifde� +__USE_MISC + + +830 * + $qecvt + ( +__v�ue +, +__ndig� +, + +831 * +__��ri� + +__de�t +, *__��ri� +__sign +) + +832 +__THROW + + `__n�nu� + ((3, 4)� +__wur +; + +833 * + $qfcvt + ( +__v�ue +, +__ndig� +, + +834 * +__��ri� + +__de�t +, *__��ri� +__sign +) + +835 +__THROW + + `__n�nu� + ((3, 4)� +__wur +; + +836 * + $qgcvt + ( +__v�ue +, +__ndig� +, * +__buf +) + +837 +__THROW + + `__n�nu� + ((3)� +__wur +; + +842 + $ecvt_r + ( +__v�ue +, +__ndig� +, * +__��ri� + +__de�t +, + +843 * +__��ri� + +__sign +, *__��ri� +__buf +, + +844 +size_t + +__�n +� +__THROW + + `__n�nu� + ((3, 4, 5)); + +845 + $fcvt_r + ( +__v�ue +, +__ndig� +, * +__��ri� + +__de�t +, + +846 * +__��ri� + +__sign +, *__��ri� +__buf +, + +847 +size_t + +__�n +� +__THROW + + `__n�nu� + ((3, 4, 5)); + +849 + $qecvt_r + ( +__v�ue +, +__ndig� +, + +850 * +__��ri� + +__de�t +, *__��ri� +__sign +, + +851 * +__��ri� + +__buf +, +size_t + +__�n +) + +852 +__THROW + + `__n�nu� + ((3, 4, 5)); + +853 + $qfcvt_r + ( +__v�ue +, +__ndig� +, + +854 * +__��ri� + +__de�t +, *__��ri� +__sign +, + +855 * +__��ri� + +__buf +, +size_t + +__�n +) + +856 +__THROW + + `__n�nu� + ((3, 4, 5)); + +860 +__BEGIN_NAMESPACE_STD + + +863 + $mb�n + (cڡ * +__s +, +size_t + +__n +� +__THROW +; + +866 + $mbtowc + ( +wch�_t + * +__��ri� + +__pwc +, + +867 cڡ * +__��ri� + +__s +, +size_t + +__n +� +__THROW +; + +870 + $w�omb + (* +__s +, +wch�_t + +__wch� +� +__THROW +; + +874 +size_t + + $mb�owcs + ( +wch�_t + * +__��ri� + +__pwcs +, + +875 cڡ * +__��ri� + +__s +, +size_t + +__n +� +__THROW +; + +877 +size_t + + $wc�ombs + (* +__��ri� + +__s +, + +878 cڡ +wch�_t + * +__��ri� + +__pwcs +, +size_t + +__n +) + +879 +__THROW +; + +880 +__END_NAMESPACE_STD + + +883 #ifde� +__USE_SVID + + +888 + $�m�ch + (cڡ * +__��ڣ +� +__THROW + + `__n�nu� + ((1)� +__wur +; + +892 #i� +def�ed + +__USE_XOPEN_EXTENDED + || def�ed +__USE_XOPEN2K8 + + +899 + $g�sub�t + (** +__��ri� + +__�ti�p +, + +900 *cڡ * +__��ri� + +__tok�s +, + +901 ** +__��ri� + +__v�u� +) + +902 +__THROW + + `__n�nu� + ((1, 2, 3)� +__wur +; + +906 #ifde� +__USE_XOPEN + + +908 + $�tkey + (cڡ * +__key +� +__THROW + + `__n�nu� + ((1)); + +914 #ifde� +__USE_XOPEN2KXSI + + +916 + $posix_ݒ� + ( +__o�ag +� +__wur +; + +919 #ifde� +__USE_XOPEN + + +924 + $g��� + ( +__fd +� +__THROW +; + +928 + $u�ock� + ( +__fd +� +__THROW +; + +933 * + $��ame + ( +__fd +� +__THROW + +__wur +; + +936 #ifde� +__USE_GNU + + +940 + $��ame_r + ( +__fd +, * +__buf +, +size_t + +__bu� +) + +941 +__THROW + + `__n�nu� + ((2)); + +944 + `g�� + (); + +947 #ifde� +__USE_BSD + + +951 + $g�l�davg + ( +__l�davg +[], +__��m +) + +952 +__THROW + + `__n�nu� + ((1)); + +955 + ~<b�s/�dlib-��t.h +> + +958 #i� +__USE_FORTIFY_LEVEL + > 0 && +def�ed + +__f�tify_fun�i� + + +959 + ~<b�s/�dlib.h +> + +961 #ifde� +__LDBL_COMPAT + + +962 + ~<b�s/�dlib-ldbl.h +> + +966 #unde� +__�ed_m�loc_�d_��oc + + +968 +__END_DECLS + + + @/usr/include/string.h + +22 #i�def +_STRING_H + + +23 + #_STRING_H + 1 + + ) + +25 + ~<�u�s.h +> + +27 + g__BEGIN_DECLS + + +30 + #__�ed_size_t + + + ) + +31 + #__�ed_NULL + + + ) + +32 + ~<�ddef.h +> + +39 #i� +def�ed + +__�lu�lus + && (__�lu�lu�>�199711L || +__GNUC_PREREQ + (4, 4)) + +40 + #__CORRECT_ISO_CPP_STRING_H_PROTO + + + ) + +44 +__BEGIN_NAMESPACE_STD + + +46 * + $mem�y + (* +__��ri� + +__de� +, cڡ *__��ri� +__�c +, + +47 +size_t + +__n +� +__THROW + + `__n�nu� + ((1, 2)); + +50 * + $memmove + (* +__de� +, cڡ * +__�c +, +size_t + +__n +) + +51 +__THROW + + `__n�nu� + ((1, 2)); + +52 +__END_NAMESPACE_STD + + +57 #i� +def�ed + +__USE_SVID + || def�ed +__USE_BSD + || def�ed +__USE_XOPEN + + +58 * + $memc�y + (* +__��ri� + +__de� +, cڡ *__��ri� +__�c +, + +59 +__c +, +size_t + +__n +) + +60 +__THROW + + `__n�nu� + ((1, 2)); + +64 +__BEGIN_NAMESPACE_STD + + +66 * + $mem�t + (* +__s +, +__c +, +size_t + +__n +� +__THROW + + `__n�nu� + ((1)); + +69 + $memcmp + (cڡ * +__s1 +, cڡ * +__s2 +, +size_t + +__n +) + +70 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +73 #ifde� +__CORRECT_ISO_CPP_STRING_H_PROTO + + +76 * + `memchr + (* +__s +, +__c +, +size_t + +__n +) + +77 +__THROW + + `__asm + ("memchr"� +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +78 cڡ * + `memchr + (cڡ * +__s +, +__c +, +size_t + +__n +) + +79 +__THROW + + `__asm + ("memchr"� +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +81 #ifde� +__OPTIMIZE__ + + +82 +__ex��_�ways_�l�e + * + +83 + `memchr + (* +__s +, +__c +, +size_t + +__n +� +__THROW + + +85 + `__bu�t�_memchr + ( +__s +, +__c +, +__n +); + +88 +__ex��_�ways_�l�e + const * + +89 + `memchr + (cڡ * +__s +, +__c +, +size_t + +__n +� +__THROW + + +91 + `__bu�t�_memchr + ( +__s +, +__c +, +__n +); + +94 + } +} + +96 * + $memchr + (cڡ * +__s +, +__c +, +size_t + +__n +) + +97 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +99 +__END_NAMESPACE_STD + + +101 #ifde� +__USE_GNU + + +104 #ifde� +__CORRECT_ISO_CPP_STRING_H_PROTO + + +105 "C++" * + $�wmemchr + (* +__s +, +__c +) + +106 +__THROW + + `__asm + ("�wmemchr"� +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +107 "C++" cڡ * + $�wmemchr + (cڡ * +__s +, +__c +) + +108 +__THROW + + `__asm + ("�wmemchr"� +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +110 * + $�wmemchr + (cڡ * +__s +, +__c +) + +111 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +115 #ifde� +__CORRECT_ISO_CPP_STRING_H_PROTO + + +116 "C++" * + $memrchr + (* +__s +, +__c +, +size_t + +__n +) + +117 +__THROW + + `__asm + ("memrchr"� +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +118 "C++" cڡ * + $memrchr + (cڡ * +__s +, +__c +, +size_t + +__n +) + +119 +__THROW + + `__asm + ("memrchr"� +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +121 * + $memrchr + (cڡ * +__s +, +__c +, +size_t + +__n +) + +122 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +127 +__BEGIN_NAMESPACE_STD + + +129 * + $�r�y + (* +__��ri� + +__de� +, cڡ *__��ri� +__�c +) + +130 +__THROW + + `__n�nu� + ((1, 2)); + +132 * + $���y + (* +__��ri� + +__de� +, + +133 cڡ * +__��ri� + +__�c +, +size_t + +__n +) + +134 +__THROW + + `__n�nu� + ((1, 2)); + +137 * + $�r�t + (* +__��ri� + +__de� +, cڡ *__��ri� +__�c +) + +138 +__THROW + + `__n�nu� + ((1, 2)); + +140 * + $���t + (* +__��ri� + +__de� +, cڡ *__��ri� +__�c +, + +141 +size_t + +__n +� +__THROW + + `__n�nu� + ((1, 2)); + +144 + $�rcmp + (cڡ * +__s1 +, cڡ * +__s2 +) + +145 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +147 + $��cmp + (cڡ * +__s1 +, cڡ * +__s2 +, +size_t + +__n +) + +148 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +151 + $�rc�l + (cڡ * +__s1 +, cڡ * +__s2 +) + +152 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +154 +size_t + + $�rx�m + (* +__��ri� + +__de� +, + +155 cڡ * +__��ri� + +__�c +, +size_t + +__n +) + +156 +__THROW + + `__n�nu� + ((2)); + +157 +__END_NAMESPACE_STD + + +159 #ifde� +__USE_XOPEN2K8 + + +163 + ~<xlo��.h +> + +166 + $�rc�l_l + (cڡ * +__s1 +, cڡ * +__s2 +, +__lo��_t + +__l +) + +167 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2, 3)); + +169 +size_t + + $�rx�m_l + (* +__de� +, cڡ * +__�c +, +size_t + +__n +, + +170 +__lo��_t + +__l +� +__THROW + + `__n�nu� + ((2, 4)); + +173 #i� +def�ed + +__USE_SVID + || def�ed +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + \ + +174 || +def�ed + +__USE_XOPEN2K8 + + +176 * + $�rdup + (cڡ * +__s +) + +177 +__THROW + +__��ibu�_m�loc__ + + `__n�nu� + ((1)); + +183 #i� +def�ed + +__USE_XOPEN2K8 + + +184 * + $��dup + (cڡ * +__�r�g +, +size_t + +__n +) + +185 +__THROW + +__��ibu�_m�loc__ + + `__n�nu� + ((1)); + +188 #i� +def�ed + +__USE_GNU + && def�ed +__GNUC__ + + +190 + #�rdu� +( +s +) \ + +191 ( +__ex�nsi�__ + \ + +193 cڡ * +__�d + = ( +s +); \ + +194 +size_t + +__�n + = + `��� + ( +__�d +) + 1; \ + +195 * +__�w + = (*� + `__bu�t�_�lo� + ( +__�n +); \ + +196 (*� + `mem�y + ( +__�w +, +__�d +, +__�n +); \ + +197 + } +})) + + ) + +200 + #��du� +( +s +, +n +) \ + +201 ( +__ex�nsi�__ + \ + +203 cڡ * +__�d + = ( +s +); \ + +204 +size_t + +__�n + = + `���n + ( +__�d +, ( +n +)); \ + +205 * +__�w + = (*� + `__bu�t�_�lo� + ( +__�n + + 1); \ + +206 +__�w +[ +__�n +] = '\0'; \ + +207 (*� + `mem�y + ( +__�w +, +__�d +, +__�n +); \ + +208 })) + + ) + +211 + g__BEGIN_NAMESPACE_STD + + +213 #ifde� +__CORRECT_ISO_CPP_STRING_H_PROTO + + +216 * +�rchr + (* +__s +, +__c +) + +217 +__THROW + +__asm + ("�rchr"� +__��ibu�_pu�__ + +__n�nu� + ((1)); + +218 cڡ * +�rchr + (cڡ * +__s +, +__c +) + +219 +__THROW + +__asm + ("�rchr"� +__��ibu�_pu�__ + +__n�nu� + ((1)); + +221 #ifde� +__OPTIMIZE__ + + +222 +__ex��_�ways_�l�e + * + +223 +�rchr + (* +__s +, +__c +� + g__THROW + + +225 +__bu�t�_�rchr + ( +__s +, +__c +); + +228 +__ex��_�ways_�l�e + const * + +229 +�rchr + (cڡ * +__s +, +__c +� + g__THROW + + +231 +__bu�t�_�rchr + ( +__s +, +__c +); + +236 * + $�rchr + (cڡ * +__s +, +__c +) + +237 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +240 #ifde� +__CORRECT_ISO_CPP_STRING_H_PROTO + + +243 * + `��chr + (* +__s +, +__c +) + +244 +__THROW + + `__asm + ("��chr"� +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +245 cڡ * + `��chr + (cڡ * +__s +, +__c +) + +246 +__THROW + + `__asm + ("��chr"� +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +248 #ifde� +__OPTIMIZE__ + + +249 +__ex��_�ways_�l�e + * + +250 + `��chr + (* +__s +, +__c +� +__THROW + + +252 + `__bu�t�_��chr + ( +__s +, +__c +); + +255 +__ex��_�ways_�l�e + const * + +256 + `��chr + (cڡ * +__s +, +__c +� +__THROW + + +258 + `__bu�t�_��chr + ( +__s +, +__c +); + +261 + } +} + +263 * + $��chr + (cڡ * +__s +, +__c +) + +264 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +266 +__END_NAMESPACE_STD + + +268 #ifde� +__USE_GNU + + +271 #ifde� +__CORRECT_ISO_CPP_STRING_H_PROTO + + +272 "C++" * + $�rch�ul + (* +__s +, +__c +) + +273 +__THROW + + `__asm + ("�rch�ul"� +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +274 "C++" cڡ * + $�rch�ul + (cڡ * +__s +, +__c +) + +275 +__THROW + + `__asm + ("�rch�ul"� +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +277 * + $�rch�ul + (cڡ * +__s +, +__c +) + +278 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +282 +__BEGIN_NAMESPACE_STD + + +285 +size_t + + $�rc�n + (cڡ * +__s +, cڡ * +__�je� +) + +286 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +289 +size_t + + $�r�n + (cڡ * +__s +, cڡ * +__ac�� +) + +290 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +292 #ifde� +__CORRECT_ISO_CPP_STRING_H_PROTO + + +295 * + `��brk + (* +__s +, cڡ * +__ac�� +) + +296 +__THROW + + `__asm + ("��brk"� +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +297 cڡ * + `��brk + (cڡ * +__s +, cڡ * +__ac�� +) + +298 +__THROW + + `__asm + ("��brk"� +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +300 #ifde� +__OPTIMIZE__ + + +301 +__ex��_�ways_�l�e + * + +302 + `��brk + (* +__s +, cڡ * +__ac�� +� +__THROW + + +304 + `__bu�t�_��brk + ( +__s +, +__ac�� +); + +307 +__ex��_�ways_�l�e + const * + +308 + `��brk + (cڡ * +__s +, cڡ * +__ac�� +� +__THROW + + +310 + `__bu�t�_��brk + ( +__s +, +__ac�� +); + +313 + } +} + +315 * + $��brk + (cڡ * +__s +, cڡ * +__ac�� +) + +316 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +319 #ifde� +__CORRECT_ISO_CPP_STRING_H_PROTO + + +322 * + `�r�r + (* +__hay�ack +, cڡ * +__�ed� +) + +323 +__THROW + + `__asm + ("�r�r"� +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +324 cڡ * + `�r�r + (cڡ * +__hay�ack +, cڡ * +__�ed� +) + +325 +__THROW + + `__asm + ("�r�r"� +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +327 #ifde� +__OPTIMIZE__ + + +328 +__ex��_�ways_�l�e + * + +329 + `�r�r + (* +__hay�ack +, cڡ * +__�ed� +� +__THROW + + +331 + `__bu�t�_�r�r + ( +__hay�ack +, +__�ed� +); + +334 +__ex��_�ways_�l�e + const * + +335 + `�r�r + (cڡ * +__hay�ack +, cڡ * +__�ed� +� +__THROW + + +337 + `__bu�t�_�r�r + ( +__hay�ack +, +__�ed� +); + +340 + } +} + +342 * + $�r�r + (cڡ * +__hay�ack +, cڡ * +__�ed� +) + +343 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +348 * + $��ok + (* +__��ri� + +__s +, cڡ *__��ri� +__d�im +) + +349 +__THROW + + `__n�nu� + ((2)); + +350 +__END_NAMESPACE_STD + + +354 * + $__��ok_r + (* +__��ri� + +__s +, + +355 cڡ * +__��ri� + +__d�im +, + +356 ** +__��ri� + +__�ve_�r +) + +357 +__THROW + + `__n�nu� + ((2, 3)); + +358 #i� +def�ed + +__USE_POSIX + || def�ed +__USE_MISC + + +359 * + $��ok_r + (* +__��ri� + +__s +, cڡ *__��ri� +__d�im +, + +360 ** +__��ri� + +__�ve_�r +) + +361 +__THROW + + `__n�nu� + ((2, 3)); + +364 #ifde� +__USE_GNU + + +366 #ifde� +__CORRECT_ISO_CPP_STRING_H_PROTO + + +367 "C++" * + $�r���r + (* +__hay�ack +, cڡ * +__�ed� +) + +368 +__THROW + + `__asm + ("�r���r"� +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +369 "C++" cڡ * + $�r���r + (cڡ * +__hay�ack +, + +370 cڡ * +__�ed� +) + +371 +__THROW + + `__asm + ("�r���r"� +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +373 * + $�r���r + (cڡ * +__hay�ack +, cڡ * +__�ed� +) + +374 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +378 #ifde� +__USE_GNU + + +382 * + $memmem + (cڡ * +__hay�ack +, +size_t + +__hay�ack�n +, + +383 cڡ * +__�ed� +, +size_t + +__�ed��n +) + +384 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 3)); + +388 * + $__memp�y + (* +__��ri� + +__de� +, + +389 cڡ * +__��ri� + +__�c +, +size_t + +__n +) + +390 +__THROW + + `__n�nu� + ((1, 2)); + +391 * + $memp�y + (* +__��ri� + +__de� +, + +392 cڡ * +__��ri� + +__�c +, +size_t + +__n +) + +393 +__THROW + + `__n�nu� + ((1, 2)); + +397 +__BEGIN_NAMESPACE_STD + + +399 +size_t + + $��� + (cڡ * +__s +) + +400 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +401 +__END_NAMESPACE_STD + + +403 #ifdef +__USE_XOPEN2K8 + + +406 +size_t + + $���n + (cڡ * +__�r�g +, +size_t + +__max�n +) + +407 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +411 +__BEGIN_NAMESPACE_STD + + +413 * + $���� + ( +__��um +� +__THROW +; + +414 +__END_NAMESPACE_STD + + +415 #i� +def�ed + +__USE_XOPEN2K + || def�ed +__USE_MISC + + +423 #i� +def�ed + +__USE_XOPEN2K + && !def�ed +__USE_GNU + + +426 #ifde� +__REDIRECT_NTH + + +427 + `__REDIRECT_NTH + ( +����_r +, + +428 ( +__��um +, * +__buf +, +size_t + +__bu� +), + +429 +__xpg_����_r +� + `__n�nu� + ((2)); + +431 + $__xpg_����_r + ( +__��um +, * +__buf +, +size_t + +__bu� +) + +432 +__THROW + + `__n�nu� + ((2)); + +433 + #����_r + +__xpg_����_r + + + ) + +438 * + $����_r + ( +__��um +, * +__buf +, +size_t + +__bu� +) + +439 +__THROW + + `__n�nu� + ((2)� +__wur +; + +443 #ifde� +__USE_XOPEN2K8 + + +445 * + $����_l + ( +__��um +, +__lo��_t + +__l +� +__THROW +; + +451 + $__bz�o + (* +__s +, +size_t + +__n +� +__THROW + + `__n�nu� + ((1)); + +453 #ifde� +__USE_BSD + + +455 + $bc�y + (cڡ * +__�c +, * +__de� +, +size_t + +__n +) + +456 +__THROW + + `__n�nu� + ((1, 2)); + +459 + $bz�o + (* +__s +, +size_t + +__n +� +__THROW + + `__n�nu� + ((1)); + +462 + $bcmp + (cڡ * +__s1 +, cڡ * +__s2 +, +size_t + +__n +) + +463 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +466 #ifde� +__CORRECT_ISO_CPP_STRING_H_PROTO + + +469 * + `�dex + (* +__s +, +__c +) + +470 +__THROW + + `__asm + ("�dex"� +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +471 cڡ * + `�dex + (cڡ * +__s +, +__c +) + +472 +__THROW + + `__asm + ("�dex"� +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +474 #i� +def�ed + +__OPTIMIZE__ + && !def�ed +__CORRECT_ISO_CPP_STRINGS_H_PROTO + + +475 +__ex��_�ways_�l�e + * + +476 + `�dex + (* +__s +, +__c +� +__THROW + + +478 + `__bu�t�_�dex + ( +__s +, +__c +); + +481 +__ex��_�ways_�l�e + const * + +482 + `�dex + (cڡ * +__s +, +__c +� +__THROW + + +484 + `__bu�t�_�dex + ( +__s +, +__c +); + +487 + } +} + +489 * + $�dex + (cڡ * +__s +, +__c +) + +490 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +494 #ifde� +__CORRECT_ISO_CPP_STRING_H_PROTO + + +497 * + `r�dex + (* +__s +, +__c +) + +498 +__THROW + + `__asm + ("r�dex"� +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +499 cڡ * + `r�dex + (cڡ * +__s +, +__c +) + +500 +__THROW + + `__asm + ("r�dex"� +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +502 #i� +def�ed + +__OPTIMIZE__ + && !def�ed +__CORRECT_ISO_CPP_STRINGS_H_PROTO + + +503 +__ex��_�ways_�l�e + * + +504 + `r�dex + (* +__s +, +__c +� +__THROW + + +506 + `__bu�t�_r�dex + ( +__s +, +__c +); + +509 +__ex��_�ways_�l�e + const * + +510 + `r�dex + (cڡ * +__s +, +__c +� +__THROW + + +512 + `__bu�t�_r�dex + ( +__s +, +__c +); + +515 + } +} + +517 * + $r�dex + (cڡ * +__s +, +__c +) + +518 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +523 + $ffs + ( +__i +� +__THROW + + `__��ibu�__ + (( +__cڡ__ +)); + +527 #ifdef +__USE_GNU + + +528 + $ff� + ( +__l +� +__THROW + + `__��ibu�__ + (( +__cڡ__ +)); + +529 +__ex�nsi�__ + + $ff�l + ( +__� +) + +530 +__THROW + + `__��ibu�__ + (( +__cڡ__ +)); + +534 + $�r��cmp + (cڡ * +__s1 +, cڡ * +__s2 +) + +535 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +538 + $����cmp + (cڡ * +__s1 +, cڡ * +__s2 +, +size_t + +__n +) + +539 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +542 #ifdef +__USE_GNU + + +545 + $�r��cmp_l + (cڡ * +__s1 +, cڡ * +__s2 +, + +546 +__lo��_t + +__loc +) + +547 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2, 3)); + +549 + $����cmp_l + (cڡ * +__s1 +, cڡ * +__s2 +, + +550 +size_t + +__n +, +__lo��_t + +__loc +) + +551 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2, 4)); + +554 #ifdef +__USE_BSD + + +557 * + $�r�p + (** +__��ri� + +__�r�gp +, + +558 cڡ * +__��ri� + +__d�im +) + +559 +__THROW + + `__n�nu� + ((1, 2)); + +562 #ifdef +__USE_XOPEN2K8 + + +564 * + $�rsig�l + ( +__sig +� +__THROW +; + +567 * + $__�p�y + (* +__��ri� + +__de� +, cڡ *__��ri� +__�c +) + +568 +__THROW + + `__n�nu� + ((1, 2)); + +569 * + $�p�y + (* +__��ri� + +__de� +, cڡ *__��ri� +__�c +) + +570 +__THROW + + `__n�nu� + ((1, 2)); + +574 * + $__���y + (* +__��ri� + +__de� +, + +575 cڡ * +__��ri� + +__�c +, +size_t + +__n +) + +576 +__THROW + + `__n�nu� + ((1, 2)); + +577 * + $���y + (* +__��ri� + +__de� +, + +578 cڡ * +__��ri� + +__�c +, +size_t + +__n +) + +579 +__THROW + + `__n�nu� + ((1, 2)); + +582 #ifdef +__USE_GNU + + +584 + $�rv�scmp + (cڡ * +__s1 +, cڡ * +__s2 +) + +585 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2)); + +588 * + $�r�y + (* +__�r�g +� +__THROW + + `__n�nu� + ((1)); + +591 * + $mem�ob + (* +__s +, +size_t + +__n +� +__THROW + + `__n�nu� + ((1)); + +593 #i�de� +ba��me + + +598 #ifde� +__CORRECT_ISO_CPP_STRING_H_PROTO + + +599 "C++" * + $ba��me + (* +__f��ame +) + +600 +__THROW + + `__asm + ("ba��me"� + `__n�nu� + ((1)); + +601 "C++" cڡ * + $ba��me + (cڡ * +__f��ame +) + +602 +__THROW + + `__asm + ("ba��me"� + `__n�nu� + ((1)); + +604 * + $ba��me + (cڡ * +__f��ame +� +__THROW + + `__n�nu� + ((1)); + +610 #i� +def�ed + +__GNUC__ + && __GNUC__ >= 2 + +611 #i� +def�ed + +__OPTIMIZE__ + && !def�ed +__OPTIMIZE_SIZE__ + \ + +612 && ! +def�ed + +__NO_INLINE__ + && !def�ed +__�lu�lus + + +632 + ~<b�s/�r�g.h +> + +635 + ~<b�s/�r�g2.h +> + +638 #i� +__USE_FORTIFY_LEVEL + > 0 && +def�ed + +__f�tify_fun�i� + + +640 + ~<b�s/�r�g3.h +> + +644 +__END_DECLS + + + @/usr/include/strings.h + +18 #i�def +_STRINGS_H + + +19 + #_STRINGS_H + 1 + + ) + +24 #i�! +def�ed + +_STRING_H + || !def�ed +__USE_BSD + + +26 + ~<�u�s.h +> + +27 + #__�ed_size_t + + + ) + +28 + ~<�ddef.h +> + +35 #i� +def�ed + +__�lu�lus + && (__�lu�lu�>�199711L || +__GNUC_PREREQ + (4, 4)) + +36 + #__CORRECT_ISO_CPP_STRINGS_H_PROTO + + + ) + +39 + g__BEGIN_DECLS + + +41 #i� +def�ed + +__USE_MISC + || !def�ed +__USE_XOPEN2K8 + + +43 + $bcmp + (cڡ * +__s1 +, cڡ * +__s2 +, +size_t + +__n +) + +44 +__THROW + +__��ibu�_pu�__ +; + +47 + $bc�y + (cڡ * +__�c +, * +__de� +, +size_t + +__n +� +__THROW +; + +50 + $bz�o + (* +__s +, +size_t + +__n +� +__THROW +; + +53 #ifde� +__CORRECT_ISO_CPP_STRINGS_H_PROTO + + +56 * + `�dex + (* +__s +, +__c +) + +57 +__THROW + + `__asm + ("�dex"� +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +58 cڡ * + `�dex + (cڡ * +__s +, +__c +) + +59 +__THROW + + `__asm + ("�dex"� +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +61 #i� +def�ed + +__OPTIMIZE__ + && !def�ed +__CORRECT_ISO_CPP_STRING_H_PROTO + + +62 +__ex��_�ways_�l�e + * + +63 + `�dex + (* +__s +, +__c +� +__THROW + + +65 + `__bu�t�_�dex + ( +__s +, +__c +); + +68 +__ex��_�ways_�l�e + const * + +69 + `�dex + (cڡ * +__s +, +__c +� +__THROW + + +71 + `__bu�t�_�dex + ( +__s +, +__c +); + +74 + } +} + +76 * + $�dex + (cڡ * +__s +, +__c +) + +77 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +81 #ifde� +__CORRECT_ISO_CPP_STRINGS_H_PROTO + + +84 * + `r�dex + (* +__s +, +__c +) + +85 +__THROW + + `__asm + ("r�dex"� +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +86 cڡ * + `r�dex + (cڡ * +__s +, +__c +) + +87 +__THROW + + `__asm + ("r�dex"� +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +89 #i� +def�ed + +__OPTIMIZE__ + && !def�ed +__CORRECT_ISO_CPP_STRING_H_PROTO + + +90 +__ex��_�ways_�l�e + * + +91 + `r�dex + (* +__s +, +__c +� +__THROW + + +93 + `__bu�t�_r�dex + ( +__s +, +__c +); + +96 +__ex��_�ways_�l�e + const * + +97 + `r�dex + (cڡ * +__s +, +__c +� +__THROW + + +99 + `__bu�t�_r�dex + ( +__s +, +__c +); + +102 + } +} + +104 * + $r�dex + (cڡ * +__s +, +__c +) + +105 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1)); + +109 #i� +def�ed + +__USE_MISC + || !def�ed +__USE_XOPEN2K8 + || def�ed +__USE_XOPEN2K8XSI + + +112 + $ffs + ( +__i +� +__THROW + + `__��ibu�__ + ((const)); + +116 + $�r��cmp + (cڡ * +__s1 +, cڡ * +__s2 +) + +117 +__THROW + +__��ibu�_pu�__ +; + +120 + $����cmp + (cڡ * +__s1 +, cڡ * +__s2 +, +size_t + +__n +) + +121 +__THROW + +__��ibu�_pu�__ +; + +123 #ifdef +__USE_XOPEN2K8 + + +127 + ~<xlo��.h +> + +131 + $�r��cmp_l + (cڡ * +__s1 +, cڡ * +__s2 +, +__lo��_t + +__loc +) + +132 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2, 3)); + +134 + $����cmp_l + (cڡ * +__s1 +, cڡ * +__s2 +, + +135 +size_t + +__n +, +__lo��_t + +__loc +) + +136 +__THROW + +__��ibu�_pu�__ + + `__n�nu� + ((1, 2, 4)); + +139 +__END_DECLS + + + @/usr/include/sys/epoll.h + +18 #i�def +_SYS_EPOLL_H + + +19 + #_SYS_EPOLL_H + 1 + + ) + +21 + ~<�d�t.h +> + +22 + ~<sys/ty�s.h +> + +25 + ~<b�s/sig�t.h +> + +27 #i�de� +__sig�t_t_def�ed + + +28 + #__sig�t_t_def�ed + + + ) + +29 +__sig�t_t + + tsig�t_t +; + +33 + ~<b�s/��l.h +> + +35 #i�de� +__EPOLL_PACKED + + +36 + #__EPOLL_PACKED + + + ) + +40 + eEPOLL_EVENTS + + +42 + mEPOLLIN + = 0x001, + +43 + #EPOLLIN + +EPOLLIN + + + ) + +44 + mEPOLLPRI + = 0x002, + +45 + #EPOLLPRI + +EPOLLPRI + + + ) + +46 + mEPOLLOUT + = 0x004, + +47 + #EPOLLOUT + +EPOLLOUT + + + ) + +48 + mEPOLLRDNORM + = 0x040, + +49 + #EPOLLRDNORM + +EPOLLRDNORM + + + ) + +50 + mEPOLLRDBAND + = 0x080, + +51 + #EPOLLRDBAND + +EPOLLRDBAND + + + ) + +52 + mEPOLLWRNORM + = 0x100, + +53 + #EPOLLWRNORM + +EPOLLWRNORM + + + ) + +54 + mEPOLLWRBAND + = 0x200, + +55 + #EPOLLWRBAND + +EPOLLWRBAND + + + ) + +56 + mEPOLLMSG + = 0x400, + +57 + #EPOLLMSG + +EPOLLMSG + + + ) + +58 + mEPOLLERR + = 0x008, + +59 + #EPOLLERR + +EPOLLERR + + + ) + +60 + mEPOLLHUP + = 0x010, + +61 + #EPOLLHUP + +EPOLLHUP + + + ) + +62 + mEPOLLRDHUP + = 0x2000, + +63 + #EPOLLRDHUP + +EPOLLRDHUP + + + ) + +64 + mEPOLLWAKEUP + = 1u << 29, + +65 + #EPOLLWAKEUP + +EPOLLWAKEUP + + + ) + +66 + mEPOLLONESHOT + = 1u << 30, + +67 + #EPOLLONESHOT + +EPOLLONESHOT + + + ) + +68 + mEPOLLET + = 1u << 31 + +69 + #EPOLLET + +EPOLLET + + + ) + +74 + #EPOLL_CTL_ADD + 1 + + ) + +75 + #EPOLL_CTL_DEL + 2 + + ) + +76 + #EPOLL_CTL_MOD + 3 + + ) + +79 + u��l_d�a + + +81 * + m�r +; + +82 + mfd +; + +83 +u�t32_t + + mu32 +; + +84 +u�t64_t + + mu64 +; + +85 } + t��l_d�a_t +; + +87 + s��l_ev�t + + +89 +u�t32_t + + mev�ts +; + +90 +��l_d�a_t + + md�a +; + +91 } + g__EPOLL_PACKED +; + +94 +__BEGIN_DECLS + + +100 + $��l_��� + ( +__size +� +__THROW +; + +104 + $��l_���1 + ( +__�ags +� +__THROW +; + +113 + $��l_�l + ( +__�fd +, +__� +, +__fd +, + +114 +��l_ev�t + * +__ev�t +� +__THROW +; + +127 + `��l_wa� + ( +__�fd +, +��l_ev�t + * +__ev�ts +, + +128 +__maxev�ts +, +__timeout +); + +136 + `��l_pwa� + ( +__�fd +, +��l_ev�t + * +__ev�ts +, + +137 +__maxev�ts +, +__timeout +, + +138 cڡ +__sig�t_t + * +__ss +); + +140 +__END_DECLS + + + @/usr/include/sys/select.h + +21 #i�de� +_SYS_SELECT_H + + +22 + #_SYS_SELECT_H + 1 + + ) + +24 + ~<�u�s.h +> + +27 + ~<b�s/ty�s.h +> + +30 + ~<b�s/���.h +> + +33 + ~<b�s/sig�t.h +> + +35 #i�de� +__sig�t_t_def�ed + + +36 + #__sig�t_t_def�ed + + + ) + +37 +__sig�t_t + + tsig�t_t +; + +41 + #__�ed_time_t + + + ) + +42 + #__�ed_time�ec + + + ) + +43 + ~<time.h +> + +44 + #__�ed_timev� + + + ) + +45 + ~<b�s/time.h +> + +47 #i�de� +__su�c�ds_t_def�ed + + +48 +__su�c�ds_t + + tsu�c�ds_t +; + +49 + #__su�c�ds_t_def�ed + + + ) + +54 + t__fd_mask +; + +57 #unde� +__NFDBITS + + +59 + #__NFDBITS + (8 * (� ( +__fd_mask +)) + + ) + +60 + #__FD_ELT +( +d +�((d�/ +__NFDBITS +) + + ) + +61 + #__FD_MASK +( +d +�(( +__fd_mask +�1 << ((d�% +__NFDBITS +)) + + ) + +68 #ifde� +__USE_XOPEN + + +69 +__fd_mask + + mfds_b�s +[ +__FD_SETSIZE + / +__NFDBITS +]; + +70 + #__FDS_BITS +( +�t +�((�t)-> +fds_b�s +) + + ) + +72 +__fd_mask + + m__fds_b�s +[ +__FD_SETSIZE + / +__NFDBITS +]; + +73 + #__FDS_BITS +( +�t +�((�t)-> +__fds_b�s +) + + ) + +75 } + tfd_�t +; + +78 + #FD_SETSIZE + +__FD_SETSIZE + + + ) + +80 #ifde� +__USE_MISC + + +82 +__fd_mask + + tfd_mask +; + +85 + #NFDBITS + +__NFDBITS + + + ) + +90 + #FD_SET +( +fd +, +fd�� +� + `__FD_SET + (fd, fd��) + + ) + +91 + #FD_CLR +( +fd +, +fd�� +� + `__FD_CLR + (fd, fd��) + + ) + +92 + #FD_ISSET +( +fd +, +fd�� +� + `__FD_ISSET + (fd, fd��) + + ) + +93 + #FD_ZERO +( +fd�� +� + `__FD_ZERO + (fd��) + + ) + +96 +__BEGIN_DECLS + + +106 +��� + ( +__nfds +, +fd_�t + * +__��ri� + +__�adfds +, + +107 +fd_�t + * +__��ri� + +__wr�efds +, + +108 +fd_�t + * +__��ri� + +__ex��fds +, + +109 +timev� + * +__��ri� + +__timeout +); + +111 #ifde� +__USE_XOPEN2K + + +118 +p��� + ( +__nfds +, +fd_�t + * +__��ri� + +__�adfds +, + +119 +fd_�t + * +__��ri� + +__wr�efds +, + +120 +fd_�t + * +__��ri� + +__ex��fds +, + +121 cڡ +time�ec + * +__��ri� + +__timeout +, + +122 cڡ +__sig�t_t + * +__��ri� + +__sigmask +); + +127 #i� +__USE_FORTIFY_LEVEL + > 0 && +def�ed + +__GNUC__ + + +128 + ~<b�s/���2.h +> + +131 + g__END_DECLS + + + @/usr/include/sys/socket.h + +19 #i�def +_SYS_SOCKET_H + + +20 + #_SYS_SOCKET_H + 1 + + ) + +22 + ~<�u�s.h +> + +24 + g__BEGIN_DECLS + + +26 + ~<sys/uio.h +> + +27 + #__�ed_size_t + + + ) + +28 + ~<�ddef.h +> + +29 #ifde� +__USE_GNU + + +31 + ~<b�s/sig�t.h +> + +38 + ~<b�s/sock�.h +> + +40 #ifde� +__USE_BSD + + +43 + sosockaddr + + +45 + m�_�m�y +; + +46 + m�_d�a +[14]; + +54 + mSHUT_RD + = 0, + +55 + #SHUT_RD + +SHUT_RD + + + ) + +56 + mSHUT_WR +, + +57 + #SHUT_WR + +SHUT_WR + + + ) + +58 + mSHUT_RDWR + + +59 + #SHUT_RDWR + +SHUT_RDWR + + + ) + +68 #i� +def�ed + +__�lu�lus + || ! +__GNUC_PREREQ + (2, 7�|| !def�ed +__USE_GNU + + +69 + #__SOCKADDR_ARG + +sockaddr + * +__��ri� + + + ) + +70 + #__CONST_SOCKADDR_ARG + cڡ +sockaddr + * + + ) + +74 + #__SOCKADDR_ALLTYPES + \ + +75 + `__SOCKADDR_ONETYPE + ( +sockaddr +) \ + +76 + `__SOCKADDR_ONETYPE + ( +sockaddr_� +) \ + +77 + `__SOCKADDR_ONETYPE + ( +sockaddr_ax25 +) \ + +78 + `__SOCKADDR_ONETYPE + ( +sockaddr_dl +) \ + +79 + `__SOCKADDR_ONETYPE + ( +sockaddr_e� +) \ + +80 + `__SOCKADDR_ONETYPE + ( +sockaddr_� +) \ + +81 + `__SOCKADDR_ONETYPE + ( +sockaddr_�6 +) \ + +82 + `__SOCKADDR_ONETYPE + ( +sockaddr_��p +) \ + +83 + `__SOCKADDR_ONETYPE + ( +sockaddr_�x +) \ + +84 + `__SOCKADDR_ONETYPE + ( +sockaddr_iso +) \ + +85 + `__SOCKADDR_ONETYPE + ( +sockaddr_ns +) \ + +86 + `__SOCKADDR_ONETYPE + ( +sockaddr_un +) \ + +87 + `__SOCKADDR_ONETYPE + ( +sockaddr_x25 +) + + ) + +89 + #__SOCKADDR_ONETYPE +( +ty� +�ty� * +__��ri� + +__ +##ty�##__; + + ) + +90 uni� { + m__SOCKADDR_ALLTYPES + + +91 } + t__SOCKADDR_ARG + + t__��ibu�__ + (( + t__�����t_uni�__ +)); + +92 #unde� +__SOCKADDR_ONETYPE + + +93 + #__SOCKADDR_ONETYPE +( +ty� +�cڡ ty� * +__��ri� + +__ +##ty�##__; + + ) + +94 uni� { + m__SOCKADDR_ALLTYPES + + +95 } + t__CONST_SOCKADDR_ARG + + t__��ibu�__ + (( + t__�����t_uni�__ +)); + +96 #unde� +__SOCKADDR_ONETYPE + + +99 #ifde� +__USE_GNU + + +101 + smmsghdr + + +103 +msghdr + + mmsg_hdr +; + +104 + mmsg_�n +; + +113 + $sock� + ( +__doma� +, +__ty� +, +__��oc� +� +__THROW +; + +119 + $sock��� + ( +__doma� +, +__ty� +, +__��oc� +, + +120 +__fds +[2]� +__THROW +; + +123 + $b�d + ( +__fd +, +__CONST_SOCKADDR_ARG + +__addr +, +sock�n_t + +__�n +) + +124 +__THROW +; + +127 + $g�sock�me + ( +__fd +, +__SOCKADDR_ARG + +__addr +, + +128 +sock�n_t + * +__��ri� + +__�n +� +__THROW +; + +137 + `c��� + ( +__fd +, +__CONST_SOCKADDR_ARG + +__addr +, +sock�n_t + +__�n +); + +141 + $g����me + ( +__fd +, +__SOCKADDR_ARG + +__addr +, + +142 +sock�n_t + * +__��ri� + +__�n +� +__THROW +; + +149 +ssize_t + + `�nd + ( +__fd +, cڡ * +__buf +, +size_t + +__n +, +__�ags +); + +156 +ssize_t + + `�cv + ( +__fd +, * +__buf +, +size_t + +__n +, +__�ags +); + +163 +ssize_t + + `�ndto + ( +__fd +, cڡ * +__buf +, +size_t + +__n +, + +164 +__�ags +, +__CONST_SOCKADDR_ARG + +__addr +, + +165 +sock�n_t + +__addr_�n +); + +174 +ssize_t + + `�cv�om + ( +__fd +, * +__��ri� + +__buf +, +size_t + +__n +, + +175 +__�ags +, +__SOCKADDR_ARG + +__addr +, + +176 +sock�n_t + * +__��ri� + +__addr_�n +); + +184 +ssize_t + + `�ndmsg + ( +__fd +, cڡ +msghdr + * +__mes�ge +, + +185 +__�ags +); + +187 #ifde� +__USE_GNU + + +193 + `�ndmmsg + ( +__fd +, +mmsghdr + * +__vmes�ges +, + +194 +__v�n +, +__�ags +); + +202 +ssize_t + + `�cvmsg + ( +__fd +, +msghdr + * +__mes�ge +, +__�ags +); + +204 #ifde� +__USE_GNU + + +210 + `�cvmmsg + ( +__fd +, +mmsghdr + * +__vmes�ges +, + +211 +__v�n +, +__�ags +, + +212 cڡ +time�ec + * +__tmo +); + +219 + $g�sock�t + ( +__fd +, +__�v� +, +__݊ame +, + +220 * +__��ri� + +__�tv� +, + +221 +sock�n_t + * +__��ri� + +__ݎ� +� +__THROW +; + +226 + $�tsock�t + ( +__fd +, +__�v� +, +__݊ame +, + +227 cڡ * +__�tv� +, +sock�n_t + +__ݎ� +� +__THROW +; + +233 + $li�� + ( +__fd +, +__n +� +__THROW +; + +243 + `ac�� + ( +__fd +, +__SOCKADDR_ARG + +__addr +, + +244 +sock�n_t + * +__��ri� + +__addr_�n +); + +246 #ifde� +__USE_GNU + + +251 + `ac��4 + ( +__fd +, +__SOCKADDR_ARG + +__addr +, + +252 +sock�n_t + * +__��ri� + +__addr_�n +, +__�ags +); + +261 + $shutdown + ( +__fd +, +__how +� +__THROW +; + +264 #ifde� +__USE_XOPEN2K + + +266 + $sock�m�k + ( +__fd +� +__THROW +; + +270 #ifde� +__USE_MISC + + +274 + $isfdty� + ( +__fd +, +__fdty� +� +__THROW +; + +279 #i� +__USE_FORTIFY_LEVEL + > 0 && +def�ed + +__f�tify_fun�i� + + +280 + ~<b�s/sock�2.h +> + +283 +__END_DECLS + + + @/usr/include/sys/stat.h + +22 #i�def +_SYS_STAT_H + + +23 + #_SYS_STAT_H + 1 + + ) + +25 + ~<�u�s.h +> + +27 + ~<b�s/ty�s.h +> + +29 #i� +def�ed + +__USE_XOPEN + || def�ed +__USE_XOPEN2K + || def�ed +__USE_MISC + \ + +30 || +def�ed + + g__USE_ATFILE + + +31 #i� +def�ed + +__USE_XOPEN + || def�ed +__USE_XOPEN2K + + +32 + #__�ed_time_t + + + ) + +34 #i� +def�ed + +__USE_MISC + || def�ed +__USE_ATFILE + + +35 + #__�ed_time�ec + + + ) + +37 + ~<time.h +> + +40 #i� +def�ed + +__USE_XOPEN + || def�ed +__USE_XOPEN2K + + +43 #i�de� +__dev_t_def�ed + + +44 +__dev_t + + tdev_t +; + +45 + #__dev_t_def�ed + + + ) + +48 #i�de� +__gid_t_def�ed + + +49 +__gid_t + + tgid_t +; + +50 + #__gid_t_def�ed + + + ) + +53 #i�de� +__�o_t_def�ed + + +54 #i�de� +__USE_FILE_OFFSET64 + + +55 +__�o_t + + t�o_t +; + +57 +__�o64_t + + t�o_t +; + +59 + #__�o_t_def�ed + + + ) + +62 #i�de� +__mode_t_def�ed + + +63 +__mode_t + + tmode_t +; + +64 + #__mode_t_def�ed + + + ) + +67 #i�de� +__ƚk_t_def�ed + + +68 +__ƚk_t + + tƚk_t +; + +69 + #__ƚk_t_def�ed + + + ) + +72 #i�de� +__off_t_def�ed + + +73 #i�de� +__USE_FILE_OFFSET64 + + +74 +__off_t + + toff_t +; + +76 +__off64_t + + toff_t +; + +78 + #__off_t_def�ed + + + ) + +81 #i�de� +__uid_t_def�ed + + +82 +__uid_t + + tuid_t +; + +83 + #__uid_t_def�ed + + + ) + +87 #ifde� +__USE_UNIX98 + + +88 #i�de� +__blk�t_t_def�ed + + +89 #i�de� +__USE_FILE_OFFSET64 + + +90 +__blk�t_t + + tblk�t_t +; + +92 +__blk�t64_t + + tblk�t_t +; + +94 + #__blk�t_t_def�ed + + + ) + +97 #i�de� +__blksize_t_def�ed + + +98 +__blksize_t + + tblksize_t +; + +99 + #__blksize_t_def�ed + + + ) + +103 + g__BEGIN_DECLS + + +105 + ~<b�s/��.h +> + +107 #i� +def�ed + +__USE_BSD + || def�ed +__USE_MISC + || def�ed +__USE_XOPEN + + +108 + #S_IFMT + +__S_IFMT + + + ) + +109 + #S_IFDIR + +__S_IFDIR + + + ) + +110 + #S_IFCHR + +__S_IFCHR + + + ) + +111 + #S_IFBLK + +__S_IFBLK + + + ) + +112 + #S_IFREG + +__S_IFREG + + + ) + +113 #ifde� +__S_IFIFO + + +114 + #S_IFIFO + +__S_IFIFO + + + ) + +116 #ifde� +__S_IFLNK + + +117 + #S_IFLNK + +__S_IFLNK + + + ) + +119 #i�( +def�ed + +__USE_BSD + || def�ed +__USE_MISC + || def�ed +__USE_UNIX98 +) \ + +120 && +def�ed + + g__S_IFSOCK + + +121 + #S_IFSOCK + +__S_IFSOCK + + + ) + +127 + #__S_ISTYPE +( +mode +, +mask +�(((mode�& +__S_IFMT +�=�(mask)) + + ) + +129 + #S_ISDIR +( +mode +� + `__S_ISTYPE +((mode), +__S_IFDIR +) + + ) + +130 + #S_ISCHR +( +mode +� + `__S_ISTYPE +((mode), +__S_IFCHR +) + + ) + +131 + #S_ISBLK +( +mode +� + `__S_ISTYPE +((mode), +__S_IFBLK +) + + ) + +132 + #S_ISREG +( +mode +� + `__S_ISTYPE +((mode), +__S_IFREG +) + + ) + +133 #ifde� +__S_IFIFO + + +134 + #S_ISFIFO +( +mode +� + `__S_ISTYPE +((mode), +__S_IFIFO +) + + ) + +136 #ifde� +__S_IFLNK + + +137 + #S_ISLNK +( +mode +� + `__S_ISTYPE +((mode), +__S_IFLNK +) + + ) + +140 #i� +def�ed + +__USE_BSD + && !def�ed +__S_IFLNK + + +141 + #S_ISLNK +( +mode +�0 + + ) + +144 #i�( +def�ed + +__USE_BSD + || def�ed +__USE_UNIX98 + || def�ed +__USE_XOPEN2K +) \ + +145 && +def�ed + + g__S_IFSOCK + + +146 + #S_ISSOCK +( +mode +� + `__S_ISTYPE +((mode), +__S_IFSOCK +) + + ) + +147 #�i� +def�ed + +__USE_XOPEN2K + + +148 + #S_ISSOCK +( +mode +�0 + + ) + +155 #ifdef +__USE_POSIX199309 + + +156 + #S_TYPEISMQ +( +buf +� + `__S_TYPEISMQ +(buf) + + ) + +157 + #S_TYPEISSEM +( +buf +� + `__S_TYPEISSEM +(buf) + + ) + +158 + #S_TYPEISSHM +( +buf +� + `__S_TYPEISSHM +(buf) + + ) + +164 + #S_ISUID + +__S_ISUID + + + ) + +165 + #S_ISGID + +__S_ISGID + + + ) + +167 #i� +def�ed + +__USE_BSD + || def�ed +__USE_MISC + || def�ed +__USE_XOPEN + + +169 + #S_ISVTX + +__S_ISVTX + + + ) + +172 + #S_IRUSR + +__S_IREAD + + + ) + +173 + #S_IWUSR + +__S_IWRITE + + + ) + +174 + #S_IXUSR + +__S_IEXEC + + + ) + +176 + #S_IRWXU + ( +__S_IREAD +| +__S_IWRITE +| +__S_IEXEC +) + + ) + +178 #i� +def�ed + +__USE_MISC + && def�ed +__USE_BSD + + +179 + #S_IREAD + +S_IRUSR + + + ) + +180 + #S_IWRITE + +S_IWUSR + + + ) + +181 + #S_IEXEC + +S_IXUSR + + + ) + +184 + #S_IRGRP + ( +S_IRUSR + >> 3� + + ) + +185 + #S_IWGRP + ( +S_IWUSR + >> 3� + + ) + +186 + #S_IXGRP + ( +S_IXUSR + >> 3� + + ) + +188 + #S_IRWXG + ( +S_IRWXU + >> 3) + + ) + +190 + #S_IROTH + ( +S_IRGRP + >> 3� + + ) + +191 + #S_IWOTH + ( +S_IWGRP + >> 3� + + ) + +192 + #S_IXOTH + ( +S_IXGRP + >> 3� + + ) + +194 + #S_IRWXO + ( +S_IRWXG + >> 3) + + ) + +197 #ifdef +__USE_BSD + + +199 + #ACCESSPERMS + ( +S_IRWXU +| +S_IRWXG +| +S_IRWXO +� + + ) + +200 + #ALLPERMS + ( +S_ISUID +| +S_ISGID +| +S_ISVTX +| +S_IRWXU +| +S_IRWXG +| +S_IRWXO +) + + ) + +201 + #DEFFILEMODE + ( +S_IRUSR +| +S_IWUSR +| +S_IRGRP +| +S_IWGRP +| +S_IROTH +| +S_IWOTH +) + + ) + +203 + #S_BLKSIZE + 512 + + ) + +207 #i�de� +__USE_FILE_OFFSET64 + + +209 + $�� + (cڡ * +__��ri� + +__f�e +, + +210 +�� + * +__��ri� + +__buf +� +__THROW + + `__n�nu� + ((1, 2)); + +214 + $f�� + ( +__fd +, +�� + * +__buf +� +__THROW + + `__n�nu� + ((2)); + +216 #ifde� +__REDIRECT_NTH + + +217 + `__REDIRECT_NTH + ( +�� +, (cڡ * +__��ri� + +__f�e +, + +218 +�� + * +__��ri� + +__buf +), +��64 +) + +219 + `__n�nu� + ((1, 2)); + +220 + `__REDIRECT_NTH + ( +f�� +, ( +__fd +, +�� + * +__buf +), +f��64 +) + +221 + `__n�nu� + ((2)); + +223 + #�� + +��64 + + + ) + +224 + #f�� + +f��64 + + + ) + +227 #ifde� +__USE_LARGEFILE64 + + +228 + $��64 + (cڡ * +__��ri� + +__f�e +, + +229 +��64 + * +__��ri� + +__buf +� +__THROW + + `__n�nu� + ((1, 2)); + +230 + $f��64 + ( +__fd +, +��64 + * +__buf +� +__THROW + + `__n�nu� + ((2)); + +233 #ifde� +__USE_ATFILE + + +237 #i�de� +__USE_FILE_OFFSET64 + + +238 + $f��� + ( +__fd +, cڡ * +__��ri� + +__f�e +, + +239 +�� + * +__��ri� + +__buf +, +__�ag +) + +240 +__THROW + + `__n�nu� + ((2, 3)); + +242 #ifde� +__REDIRECT_NTH + + +243 + `__REDIRECT_NTH + ( +f��� +, ( +__fd +, cڡ * +__��ri� + +__f�e +, + +244 +�� + * +__��ri� + +__buf +, + +245 +__�ag +), + +246 +f���64 +� + `__n�nu� + ((2, 3)); + +248 + #f��� + +f���64 + + + ) + +252 #ifde� +__USE_LARGEFILE64 + + +253 + $f���64 + ( +__fd +, cڡ * +__��ri� + +__f�e +, + +254 +��64 + * +__��ri� + +__buf +, +__�ag +) + +255 +__THROW + + `__n�nu� + ((2, 3)); + +259 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + || def�ed +__USE_XOPEN2K + + +260 #i�de� +__USE_FILE_OFFSET64 + + +263 + $l�� + (cڡ * +__��ri� + +__f�e +, + +264 +�� + * +__��ri� + +__buf +� +__THROW + + `__n�nu� + ((1, 2)); + +266 #ifde� +__REDIRECT_NTH + + +267 + `__REDIRECT_NTH + ( +l�� +, + +268 (cڡ * +__��ri� + +__f�e +, + +269 +�� + * +__��ri� + +__buf +), +l��64 +) + +270 + `__n�nu� + ((1, 2)); + +272 + #l�� + +l��64 + + + ) + +275 #ifde� +__USE_LARGEFILE64 + + +276 + $l��64 + (cڡ * +__��ri� + +__f�e +, + +277 +��64 + * +__��ri� + +__buf +) + +278 +__THROW + + `__n�nu� + ((1, 2)); + +284 + $chmod + (cڡ * +__f�e +, +__mode_t + +__mode +) + +285 +__THROW + + `__n�nu� + ((1)); + +287 #ifde� +__USE_BSD + + +291 + $lchmod + (cڡ * +__f�e +, +__mode_t + +__mode +) + +292 +__THROW + + `__n�nu� + ((1)); + +296 #i� +def�ed + +__USE_BSD + || def�ed +__USE_POSIX + + +297 + $fchmod + ( +__fd +, +__mode_t + +__mode +� +__THROW +; + +300 #ifde� +__USE_ATFILE + + +303 + $fchmod� + ( +__fd +, cڡ * +__f�e +, +__mode_t + +__mode +, + +304 +__�ag +) + +305 +__THROW + + `__n�nu� + ((2)� +__wur +; + +312 +__mode_t + + $umask + ( +__mode_t + +__mask +� +__THROW +; + +314 #ifdef +__USE_GNU + + +317 +__mode_t + + $g�umask + (� +__THROW +; + +321 + $mkd� + (cڡ * +__�th +, +__mode_t + +__mode +) + +322 +__THROW + + `__n�nu� + ((1)); + +324 #ifde� +__USE_ATFILE + + +328 + $mkd�� + ( +__fd +, cڡ * +__�th +, +__mode_t + +__mode +) + +329 +__THROW + + `__n�nu� + ((2)); + +335 #i� +def�ed + +__USE_MISC + || def�ed +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + + +336 + $mknod + (cڡ * +__�th +, +__mode_t + +__mode +, +__dev_t + +__dev +) + +337 +__THROW + + `__n�nu� + ((1)); + +339 #ifde� +__USE_ATFILE + + +343 + $mknod� + ( +__fd +, cڡ * +__�th +, +__mode_t + +__mode +, + +344 +__dev_t + +__dev +� +__THROW + + `__n�nu� + ((2)); + +350 + $mkfifo + (cڡ * +__�th +, +__mode_t + +__mode +) + +351 +__THROW + + `__n�nu� + ((1)); + +353 #ifde� +__USE_ATFILE + + +357 + $mkfif�t + ( +__fd +, cڡ * +__�th +, +__mode_t + +__mode +) + +358 +__THROW + + `__n�nu� + ((2)); + +361 #ifde� +__USE_ATFILE + + +364 + $utim��t + ( +__fd +, cڡ * +__�th +, + +365 cڡ +time�ec + +__times +[2], + +366 +__�ags +) + +367 +__THROW + + `__n�nu� + ((2)); + +370 #ifde� +__USE_XOPEN2K8 + + +372 + $futim�s + ( +__fd +, cڡ +time�ec + +__times +[2]� +__THROW +; + +390 #i�de� +_STAT_VER + + +391 + #_STAT_VER + 0 + + ) + +393 #i�de� +_MKNOD_VER + + +394 + #_MKNOD_VER + 0 + + ) + +398 #i�de� +__USE_FILE_OFFSET64 + + +399 + $__fx�� + ( +__v� +, +__f�des +, +�� + * +__��_buf +) + +400 +__THROW + + `__n�nu� + ((3)); + +401 + $__x�� + ( +__v� +, cڡ * +__f��ame +, + +402 +�� + * +__��_buf +� +__THROW + + `__n�nu� + ((2, 3)); + +403 + $__lx�� + ( +__v� +, cڡ * +__f��ame +, + +404 +�� + * +__��_buf +� +__THROW + + `__n�nu� + ((2, 3)); + +405 + $__fx��� + ( +__v� +, +__f�des +, cڡ * +__f��ame +, + +406 +�� + * +__��_buf +, +__�ag +) + +407 +__THROW + + `__n�nu� + ((3, 4)); + +409 #ifde� +__REDIRECT_NTH + + +410 + `__REDIRECT_NTH + ( +__fx�� +, ( +__v� +, +__f�des +, + +411 +�� + * +__��_buf +), +__fx��64 +) + +412 + `__n�nu� + ((3)); + +413 + `__REDIRECT_NTH + ( +__x�� +, ( +__v� +, cڡ * +__f��ame +, + +414 +�� + * +__��_buf +), +__x��64 +) + +415 + `__n�nu� + ((2, 3)); + +416 + `__REDIRECT_NTH + ( +__lx�� +, ( +__v� +, cڡ * +__f��ame +, + +417 +�� + * +__��_buf +), +__lx��64 +) + +418 + `__n�nu� + ((2, 3)); + +419 + `__REDIRECT_NTH + ( +__fx��� +, ( +__v� +, +__f�des +, + +420 cڡ * +__f��ame +, + +421 +�� + * +__��_buf +, +__�ag +), + +422 +__fx���64 +� + `__n�nu� + ((3, 4)); + +425 + #__fx�� + +__fx��64 + + + ) + +426 + #__x�� + +__x��64 + + + ) + +427 + #__lx�� + +__lx��64 + + + ) + +431 #ifde� +__USE_LARGEFILE64 + + +432 + $__fx��64 + ( +__v� +, +__f�des +, +��64 + * +__��_buf +) + +433 +__THROW + + `__n�nu� + ((3)); + +434 + $__x��64 + ( +__v� +, cڡ * +__f��ame +, + +435 +��64 + * +__��_buf +� +__THROW + + `__n�nu� + ((2, 3)); + +436 + $__lx��64 + ( +__v� +, cڡ * +__f��ame +, + +437 +��64 + * +__��_buf +� +__THROW + + `__n�nu� + ((2, 3)); + +438 + $__fx���64 + ( +__v� +, +__f�des +, cڡ * +__f��ame +, + +439 +��64 + * +__��_buf +, +__�ag +) + +440 +__THROW + + `__n�nu� + ((3, 4)); + +442 + $__xmknod + ( +__v� +, cڡ * +__�th +, +__mode_t + +__mode +, + +443 +__dev_t + * +__dev +� +__THROW + + `__n�nu� + ((2, 4)); + +445 + $__xmknod� + ( +__v� +, +__fd +, cڡ * +__�th +, + +446 +__mode_t + +__mode +, +__dev_t + * +__dev +) + +447 +__THROW + + `__n�nu� + ((3, 5)); + +449 #ifde� +__USE_EXTERN_INLINES + + +452 +__ex��_�l�e + + +453 + `__NTH + ( + $�� + (cڡ * +__�th +, +�� + * +__��buf +)) + +455 + `__x�� + ( +_STAT_VER +, +__�th +, +__��buf +); + +456 + } +} + +458 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + + +459 +__ex��_�l�e + + +460 +__NTH + ( + $l�� + (cڡ * +__�th +, +�� + * +__��buf +)) + +462 + `__lx�� + ( +_STAT_VER +, +__�th +, +__��buf +); + +463 + } +} + +466 +__ex��_�l�e + + +467 +__NTH + ( + $f�� + ( +__fd +, +�� + * +__��buf +)) + +469 + `__fx�� + ( +_STAT_VER +, +__fd +, +__��buf +); + +470 + } +} + +472 #ifde� +__USE_ATFILE + + +473 +__ex��_�l�e + + +474 +__NTH + ( + $f��� + ( +__fd +, cڡ * +__f��ame +, +�� + * +__��buf +, + +475 +__�ag +)) + +477 + `__fx��� + ( +_STAT_VER +, +__fd +, +__f��ame +, +__��buf +, +__�ag +); + +478 + } +} + +481 #i� +def�ed + +__USE_MISC + || def�ed +__USE_BSD + + +482 +__ex��_�l�e + + +483 +__NTH + ( + $mknod + (cڡ * +__�th +, +__mode_t + +__mode +, +__dev_t + +__dev +)) + +485 + `__xmknod + ( +_MKNOD_VER +, +__�th +, +__mode +, & +__dev +); + +486 + } +} + +489 #ifde� +__USE_ATFILE + + +490 +__ex��_�l�e + + +491 +__NTH + ( + $mknod� + ( +__fd +, cڡ * +__�th +, +__mode_t + +__mode +, + +492 +__dev_t + +__dev +)) + +494 + `__xmknod� + ( +_MKNOD_VER +, +__fd +, +__�th +, +__mode +, & +__dev +); + +495 + } +} + +498 #i� +def�ed + +__USE_LARGEFILE64 + \ + +499 && (! +def�ed + + g__USE_FILE_OFFSET64 + \ + +500 || ( +def�ed + + g__REDIRECT_NTH + && def�ed + g__OPTIMIZE__ +)) + +501 +__ex��_�l�e + + +502 +__NTH + ( + $��64 + (cڡ * +__�th +, +��64 + * +__��buf +)) + +504 + `__x��64 + ( +_STAT_VER +, +__�th +, +__��buf +); + +505 + } +} + +507 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + + +508 +__ex��_�l�e + + +509 +__NTH + ( + $l��64 + (cڡ * +__�th +, +��64 + * +__��buf +)) + +511 + `__lx��64 + ( +_STAT_VER +, +__�th +, +__��buf +); + +512 + } +} + +515 +__ex��_�l�e + + +516 +__NTH + ( + $f��64 + ( +__fd +, +��64 + * +__��buf +)) + +518 + `__fx��64 + ( +_STAT_VER +, +__fd +, +__��buf +); + +519 + } +} + +521 #ifde� +__USE_ATFILE + + +522 +__ex��_�l�e + + +523 +__NTH + ( + $f���64 + ( +__fd +, cڡ * +__f��ame +, +��64 + * +__��buf +, + +524 +__�ag +)) + +526 + `__fx���64 + ( +_STAT_VER +, +__fd +, +__f��ame +, +__��buf +, +__�ag +); + +527 + } +} + +534 + g__END_DECLS + + + @/usr/include/sys/syslog.h + +32 #i�de� +_SYS_SYSLOG_H + + +33 + #_SYS_SYSLOG_H + 1 + + ) + +35 + ~<�u�s.h +> + +36 + #__�ed___va_li� + + + ) + +37 + ~<�d�g.h +> + +40 + ~<b�s/sy�og-�th.h +> + +51 + #LOG_EMERG + 0 + + ) + +52 + #LOG_ALERT + 1 + + ) + +53 + #LOG_CRIT + 2 + + ) + +54 + #LOG_ERR + 3 + + ) + +55 + #LOG_WARNING + 4 + + ) + +56 + #LOG_NOTICE + 5 + + ) + +57 + #LOG_INFO + 6 + + ) + +58 + #LOG_DEBUG + 7 + + ) + +60 + #LOG_PRIMASK + 0x07 + + ) + +62 + #LOG_PRI +( +p +�(��& +LOG_PRIMASK +) + + ) + +63 + #LOG_MAKEPRI +( +�c +, +�i +�((�c�| (�i)) + + ) + +65 #ifde� +SYSLOG_NAMES + + +66 + #INTERNAL_NOPRI + 0x10 + + ) + +68 + #INTERNAL_MARK + + `LOG_MAKEPRI +( +LOG_NFACILITIES + << 3, 0) + + ) + +69 + s_code + { + +70 * + mc_�me +; + +71 + mc_v� +; + +72 } + tCODE +; + +74 +CODE + + g�iܙy�mes +[] = + +76 { "��t", +LOG_ALERT + }, + +77 { "��", +LOG_CRIT + }, + +78 { "debug", +LOG_DEBUG + }, + +79 { "em�g", +LOG_EMERG + }, + +80 { "�r", +LOG_ERR + }, + +81 { "�r�", +LOG_ERR + }, + +82 { "�fo", +LOG_INFO + }, + +83 { "n�e", +INTERNAL_NOPRI + }, + +84 { "n�i�", +LOG_NOTICE + }, + +85 { "�nic", +LOG_EMERG + }, + +86 { "w�n", +LOG_WARNING + }, + +87 { "w�n�g", +LOG_WARNING + }, + +88 { +NULL +, -1 } + +93 + #LOG_KERN + (0<<3� + + ) + +94 + #LOG_USER + (1<<3� + + ) + +95 + #LOG_MAIL + (2<<3� + + ) + +96 + #LOG_DAEMON + (3<<3� + + ) + +97 + #LOG_AUTH + (4<<3� + + ) + +98 + #LOG_SYSLOG + (5<<3� + + ) + +99 + #LOG_LPR + (6<<3� + + ) + +100 + #LOG_NEWS + (7<<3� + + ) + +101 + #LOG_UUCP + (8<<3� + + ) + +102 + #LOG_CRON + (9<<3� + + ) + +103 + #LOG_AUTHPRIV + (10<<3� + + ) + +104 + #LOG_FTP + (11<<3� + + ) + +107 + #LOG_LOCAL0 + (16<<3� + + ) + +108 + #LOG_LOCAL1 + (17<<3� + + ) + +109 + #LOG_LOCAL2 + (18<<3� + + ) + +110 + #LOG_LOCAL3 + (19<<3� + + ) + +111 + #LOG_LOCAL4 + (20<<3� + + ) + +112 + #LOG_LOCAL5 + (21<<3� + + ) + +113 + #LOG_LOCAL6 + (22<<3� + + ) + +114 + #LOG_LOCAL7 + (23<<3� + + ) + +116 + #LOG_NFACILITIES + 24 + + ) + +117 + #LOG_FACMASK + 0x03f8 + + ) + +119 + #LOG_FAC +( +p +�((��& +LOG_FACMASK +�>> 3) + + ) + +121 #ifde� +SYSLOG_NAMES + + +122 +CODE + + g�c��y�mes +[] = + +124 { "auth", +LOG_AUTH + }, + +125 { "auth�iv", +LOG_AUTHPRIV + }, + +126 { "��", +LOG_CRON + }, + +127 { "d�m�", +LOG_DAEMON + }, + +128 { "�p", +LOG_FTP + }, + +129 { "k�n", +LOG_KERN + }, + +130 { "�r", +LOG_LPR + }, + +131 { "ma�", +LOG_MAIL + }, + +132 { "m�k", +INTERNAL_MARK + }, + +133 { "�ws", +LOG_NEWS + }, + +134 { "�cur�y", +LOG_AUTH + }, + +135 { "sy�og", +LOG_SYSLOG + }, + +136 { "u�r", +LOG_USER + }, + +137 { "uu�", +LOG_UUCP + }, + +138 { "lo�l0", +LOG_LOCAL0 + }, + +139 { "lo�l1", +LOG_LOCAL1 + }, + +140 { "lo�l2", +LOG_LOCAL2 + }, + +141 { "lo�l3", +LOG_LOCAL3 + }, + +142 { "lo�l4", +LOG_LOCAL4 + }, + +143 { "lo�l5", +LOG_LOCAL5 + }, + +144 { "lo�l6", +LOG_LOCAL6 + }, + +145 { "lo�l7", +LOG_LOCAL7 + }, + +146 { +NULL +, -1 } + +153 + #LOG_MASK +( +�i +�(1 << (�i)� + + ) + +154 + #LOG_UPTO +( +�i +�((1 << (�ri)+1)�- 1� + + ) + +162 + #LOG_PID + 0x01 + + ) + +163 + #LOG_CONS + 0x02 + + ) + +164 + #LOG_ODELAY + 0x04 + + ) + +165 + #LOG_NDELAY + 0x08 + + ) + +166 + #LOG_NOWAIT + 0x10 + + ) + +167 + #LOG_PERROR + 0x20 + + ) + +169 +__BEGIN_DECLS + + +175 +�o�log + (); + +181 +ݒlog + (cڡ * +__id�t +, +__�ti� +, +__�c��y +); + +184 + $��ogmask + ( +__mask +� +__THROW +; + +190 + $sy�og + ( +__�i +, cڡ * +__fmt +, ...) + +191 + `__��ibu�__ + (( + `__f�m�__ + ( +__��tf__ +, 2, 3))); + +193 #ifde� +__USE_BSD + + +200 + $vsy�og + ( +__�i +, cڡ * +__fmt +, +__gnuc_va_li� + +__� +) + +201 + `__��ibu�__ + (( + `__f�m�__ + ( +__��tf__ +, 2, 0))); + +206 #i� +__USE_FORTIFY_LEVEL + > 0 && +def�ed + +__f�tify_fun�i� + + +207 + ~<b�s/sy�og.h +> + +209 #ifde� +__LDBL_COMPAT + + +210 + ~<b�s/sy�og-ldbl.h +> + +213 +__END_DECLS + + + @/usr/include/sys/time.h + +18 #i�de� +_SYS_TIME_H + + +19 + #_SYS_TIME_H + 1 + + ) + +21 + ~<�u�s.h +> + +23 + ~<b�s/ty�s.h +> + +24 + #__�ed_time_t + + + ) + +25 + ~<time.h +> + +26 + #__�ed_timev� + + + ) + +27 + ~<b�s/time.h +> + +29 + ~<sys/���.h +> + +31 #i�de� +__su�c�ds_t_def�ed + + +32 +__su�c�ds_t + + tsu�c�ds_t +; + +33 + #__su�c�ds_t_def�ed + + + ) + +37 + g__BEGIN_DECLS + + +39 #ifde� +__USE_GNU + + +41 + #TIMEVAL_TO_TIMESPEC +( +tv +, +ts +) { \ + +42 ( +ts +)-> +tv_�c + = ( +tv +)->tv_sec; \ + +43 ( +ts +)-> +tv_n�c + = ( +tv +)-> +tv_u�c + * 1000; \ + +44 } + + ) + +45 + #TIMESPEC_TO_TIMEVAL +( +tv +, +ts +) { \ + +46 ( +tv +)-> +tv_�c + = ( +ts +)->tv_sec; \ + +47 ( +tv +)-> +tv_u�c + = ( +ts +)-> +tv_n�c + / 1000; \ + +48 } + + ) + +52 #ifde� +__USE_BSD + + +55 + stimez�e + + +57 + mtz_m�u�swe� +; + +58 + mtz_d�time +; + +61 +timez�e + * + t__��ri� + + t__timez�e_�r_t +; + +63 * + t__��ri� + + t__timez�e_�r_t +; + +71 + $g�timeofday + ( +timev� + * +__��ri� + +__tv +, + +72 +__timez�e_�r_t + +__tz +� +__THROW + + `__n�nu� + ((1)); + +74 #ifde� +__USE_BSD + + +77 + $��imeofday + (cڡ +timev� + * +__tv +, + +78 cڡ +timez�e + * +__tz +) + +79 +__THROW +; + +85 + $adjtime + (cڡ +timev� + * +__d�� +, + +86 +timev� + * +__�dd�� +� +__THROW +; + +91 + e__�im�_which + + +94 +ITIMER_REAL + = 0, + +95 + #ITIMER_REAL + +ITIMER_REAL + + + ) + +97 +ITIMER_VIRTUAL + = 1, + +98 + #ITIMER_VIRTUAL + +ITIMER_VIRTUAL + + + ) + +101 +ITIMER_PROF + = 2 + +102 + #ITIMER_PROF + +ITIMER_PROF + + + ) + +107 + s�im�v� + + +110 +timev� + +�_��rv� +; + +112 +timev� + +�_v�ue +; + +115 #i� +def�ed + +__USE_GNU + && !def�ed +__�lu�lus + + +118 +__�im�_which + + t__�im�_which_t +; + +120 + t__�im�_which_t +; + +125 + $g��im� + ( +__�im�_which_t + +__which +, + +126 +�im�v� + * +__v�ue +� +__THROW +; + +131 + $�t�im� + ( +__�im�_which_t + +__which +, + +132 cڡ +�im�v� + * +__��ri� + +__�w +, + +133 +�im�v� + * +__��ri� + +__�d +� +__THROW +; + +138 + $utimes + (cڡ * +__f�e +, cڡ +timev� + +__tvp +[2]) + +139 +__THROW + + `__n�nu� + ((1)); + +141 #ifde� +__USE_BSD + + +143 + $lutimes + (cڡ * +__f�e +, cڡ +timev� + +__tvp +[2]) + +144 +__THROW + + `__n�nu� + ((1)); + +147 + $futimes + ( +__fd +, cڡ +timev� + +__tvp +[2]� +__THROW +; + +150 #ifde� +__USE_GNU + + +154 + $futime�t + ( +__fd +, cڡ * +__f�e +, + +155 cڡ +timev� + +__tvp +[2]� +__THROW +; + +159 #ifde� +__USE_BSD + + +162 + #tim�is�t +( +tvp +�(�vp)-> +tv_�c + || (tvp)-> +tv_u�c +) + + ) + +163 + #tim���r +( +tvp +�(�vp)-> +tv_�c + = (tvp)-> +tv_u�c + = 0) + + ) + +164 + #tim�cmp +( +a +, +b +, +CMP +) \ + +165 ((( +a +)-> +tv_�c + =�( +b +)->tv_sec) ? \ + +166 (( +a +)-> +tv_u�c + + `CMP + ( +b +)->tv_usec) : \ + +167 (( +a +)-> +tv_�c + + `CMP + ( +b +)->tv_�c)) + + ) + +168 + #tim�add +( +a +, +b +, +�su� +) \ + +170 ( +�su� +)-> +tv_�c + = ( +a +)->tv_��+ ( +b +)->tv_sec; \ + +171 ( +�su� +)-> +tv_u�c + = ( +a +)->tv_u��+ ( +b +)->tv_usec; \ + +172 i�(( +�su� +)-> +tv_u�c + >= 1000000) \ + +174 ++( +�su� +)-> +tv_�c +; \ + +175 ( +�su� +)-> +tv_u�c + -= 1000000; \ + +177 + } +} 0) + + ) + +178 + #tim�sub +( +a +, +b +, +�su� +) \ + +180 ( +�su� +)-> +tv_�c + = ( +a +)->tv_��- ( +b +)->tv_sec; \ + +181 ( +�su� +)-> +tv_u�c + = ( +a +)->tv_u��- ( +b +)->tv_usec; \ + +182 i�(( +�su� +)-> +tv_u�c + < 0) { \ + +183 --( +�su� +)-> +tv_�c +; \ + +184 ( +�su� +)-> +tv_u�c + += 1000000; \ + +186 } 0) + + ) + +189 + g__END_DECLS + + + @/usr/include/sys/types.h + +22 #i�def +_SYS_TYPES_H + + +23 + #_SYS_TYPES_H + 1 + + ) + +25 + ~<�u�s.h +> + +27 + g__BEGIN_DECLS + + +29 + ~<b�s/ty�s.h +> + +31 #ifdef +__USE_BSD + + +32 #i�de� +__u_ch�_def�ed + + +33 +__u_ch� + + tu_ch� +; + +34 +__u_sh�t + + tu_sh�t +; + +35 +__u_�t + + tu_�t +; + +36 +__u_l�g + + tu_l�g +; + +37 +__quad_t + + tquad_t +; + +38 +__u_quad_t + + tu_quad_t +; + +39 +__fsid_t + + tfsid_t +; + +40 + #__u_ch�_def�ed + + + ) + +44 +__loff_t + + tloff_t +; + +46 #i�de� +__�o_t_def�ed + + +47 #i�de� +__USE_FILE_OFFSET64 + + +48 +__�o_t + + t�o_t +; + +50 +__�o64_t + + t�o_t +; + +52 + #__�o_t_def�ed + + + ) + +54 #i� +def�ed + +__USE_LARGEFILE64 + && !def�ed +__�o64_t_def�ed + + +55 +__�o64_t + + t�o64_t +; + +56 + #__�o64_t_def�ed + + + ) + +59 #i�de� +__dev_t_def�ed + + +60 +__dev_t + + tdev_t +; + +61 + #__dev_t_def�ed + + + ) + +64 #i�de� +__gid_t_def�ed + + +65 +__gid_t + + tgid_t +; + +66 + #__gid_t_def�ed + + + ) + +69 #i�de� +__mode_t_def�ed + + +70 +__mode_t + + tmode_t +; + +71 + #__mode_t_def�ed + + + ) + +74 #i�de� +__ƚk_t_def�ed + + +75 +__ƚk_t + + tƚk_t +; + +76 + #__ƚk_t_def�ed + + + ) + +79 #i�de� +__uid_t_def�ed + + +80 +__uid_t + + tuid_t +; + +81 + #__uid_t_def�ed + + + ) + +84 #i�de� +__off_t_def�ed + + +85 #i�de� +__USE_FILE_OFFSET64 + + +86 +__off_t + + toff_t +; + +88 +__off64_t + + toff_t +; + +90 + #__off_t_def�ed + + + ) + +92 #i� +def�ed + +__USE_LARGEFILE64 + && !def�ed +__off64_t_def�ed + + +93 +__off64_t + + toff64_t +; + +94 + #__off64_t_def�ed + + + ) + +97 #i�de� +__pid_t_def�ed + + +98 +__pid_t + + tpid_t +; + +99 + #__pid_t_def�ed + + + ) + +102 #i�( +def�ed + +__USE_SVID + || def�ed +__USE_XOPEN + || def�ed +__USE_XOPEN2K8 +) \ + +103 && ! +def�ed + +__id_t_def�ed + + +104 +__id_t + + tid_t +; + +105 + #__id_t_def�ed + + + ) + +108 #i�de� +__ssize_t_def�ed + + +109 +__ssize_t + + tssize_t +; + +110 + #__ssize_t_def�ed + + + ) + +113 #ifdef +__USE_BSD + + +114 #i�de� +__daddr_t_def�ed + + +115 +__daddr_t + + tdaddr_t +; + +116 +__�ddr_t + + t�ddr_t +; + +117 + #__daddr_t_def�ed + + + ) + +121 #i�( +def�ed + +__USE_SVID + || def�ed +__USE_XOPEN +�&& !def�ed +__key_t_def�ed + + +122 +__key_t + + tkey_t +; + +123 + #__key_t_def�ed + + + ) + +126 #i� +def�ed + +__USE_XOPEN + || def�ed +__USE_XOPEN2K8 + + +127 + #__�ed_�ock_t + + + ) + +129 + #__�ed_time_t + + + ) + +130 + #__�ed_tim�_t + + + ) + +131 + #__�ed_�ockid_t + + + ) + +132 + ~<time.h +> + +134 #ifde� +__USE_XOPEN + + +135 #i�de� +__u�c�ds_t_def�ed + + +136 +__u�c�ds_t + + tu�c�ds_t +; + +137 + #__u�c�ds_t_def�ed + + + ) + +139 #i�de� +__su�c�ds_t_def�ed + + +140 +__su�c�ds_t + + tsu�c�ds_t +; + +141 + #__su�c�ds_t_def�ed + + + ) + +145 + #__�ed_size_t + + + ) + +146 + ~<�ddef.h +> + +148 #ifde� +__USE_MISC + + +150 + tul�g +; + +151 + tush�t +; + +152 + tu�t +; + +157 #i�! +__GNUC_PREREQ + (2, 7) + +160 #i�de� +__�t8_t_def�ed + + +161 + #__�t8_t_def�ed + + + ) + +162 + t�t8_t +; + +163 + t�t16_t +; + +164 + t�t32_t +; + +165 #i� +__WORDSIZE + == 64 + +166 + t�t64_t +; + +168 +__ex�nsi�__ + + t�t64_t +; + +173 + tu_�t8_t +; + +174 + tu_�t16_t +; + +175 + tu_�t32_t +; + +176 #i� +__WORDSIZE + == 64 + +177 + tu_�t64_t +; + +179 +__ex�nsi�__ + + tu_�t64_t +; + +182 + t�gi��_t +; + +187 + #__�tN_t +( +N +, +MODE +) \ + +188 ## + tN +## + t_t + + t__��ibu�__ + (( + t__mode__ + ( + tMODE +))) + + ) + +189 + t__u_�tN_t +( + tN +, + tMODE +) \ + +190 + tu_�t +## + tN +## + t_t + + t__��ibu�__ + (( + t__mode__ + ( + tMODE +))) + + ) + +192 #i�de� + t__�t8_t_def�ed + + +193 + t__�t8_t_def�ed + + + ) + +194 + t__�tN_t + (8, + t__QI__ +); + +195 +__�tN_t + (16, +__HI__ +); + +196 +__�tN_t + (32, +__SI__ +); + +197 +__�tN_t + (64, +__DI__ +); + +200 +__u_�tN_t + (8, +__QI__ +); + +201 +__u_�tN_t + (16, +__HI__ +); + +202 +__u_�tN_t + (32, +__SI__ +); + +203 +__u_�tN_t + (64, +__DI__ +); + +205 + t�gi��_t + + t__��ibu�__ + (( + t__mode__ + ( + t__w�d__ +))); + +211 + #__BIT_TYPES_DEFINED__ + 1 + + ) + +214 #ifdef +__USE_BSD + + +216 + ~<�d�n.h +> + +219 + ~<sys/���.h +> + +222 + ~<sys/sysma�os.h +> + +226 #i�( +def�ed + +__USE_UNIX98 + || def�ed +__USE_XOPEN2K8 +) \ + +227 && ! +def�ed + +__blksize_t_def�ed + + +228 +__blksize_t + + tblksize_t +; + +229 + #__blksize_t_def�ed + + + ) + +233 #i�de� +__USE_FILE_OFFSET64 + + +234 #i�de� +__blk�t_t_def�ed + + +235 +__blk�t_t + + tblk�t_t +; + +236 + #__blk�t_t_def�ed + + + ) + +238 #i�de� +__fsblk�t_t_def�ed + + +239 +__fsblk�t_t + + tfsblk�t_t +; + +240 + #__fsblk�t_t_def�ed + + + ) + +242 #i�de� +__fsf��t_t_def�ed + + +243 +__fsf��t_t + + tfsf��t_t +; + +244 + #__fsf��t_t_def�ed + + + ) + +247 #i�de� +__blk�t_t_def�ed + + +248 +__blk�t64_t + + tblk�t_t +; + +249 + #__blk�t_t_def�ed + + + ) + +251 #i�de� +__fsblk�t_t_def�ed + + +252 +__fsblk�t64_t + + tfsblk�t_t +; + +253 + #__fsblk�t_t_def�ed + + + ) + +255 #i�de� +__fsf��t_t_def�ed + + +256 +__fsf��t64_t + + tfsf��t_t +; + +257 + #__fsf��t_t_def�ed + + + ) + +261 #ifde� +__USE_LARGEFILE64 + + +262 +__blk�t64_t + + tblk�t64_t +; + +263 +__fsblk�t64_t + + tfsblk�t64_t +; + +264 +__fsf��t64_t + + tfsf��t64_t +; + +269 #i� +def�ed + +__USE_POSIX199506 + || def�ed +__USE_UNIX98 + + +270 + ~<b�s/�h�adty�s.h +> + +273 + g__END_DECLS + + + @/usr/include/syslog.h + +1 + ~<sys/sy�og.h +> + + @/usr/include/termios.h + +22 #i�def +_TERMIOS_H + + +23 + #_TERMIOS_H + 1 + + ) + +25 + ~<�u�s.h +> + +26 #i� +def�ed + +__USE_UNIX98 + || def�ed +__USE_XOPEN2K8 + + +28 + ~<b�s/ty�s.h +> + +29 #i�de� +__pid_t_def�ed + + +30 +__pid_t + + tpid_t +; + +31 + #__pid_t_def�ed + + + ) + +35 + g__BEGIN_DECLS + + +39 + ~<b�s/�rmios.h +> + +41 #ifde� +__USE_BSD + + +44 + #CCEQ +( +v� +, +c +�((c�=�(v��&& (v��!� +_POSIX_VDISABLE +) + + ) + +48 +��d_t + + $cfg�o��d + (cڡ +�rmios + * +__�rmios_p +� +__THROW +; + +51 +��d_t + + $cfg�i��d + (cڡ +�rmios + * +__�rmios_p +� +__THROW +; + +54 + $cf�to��d + ( +�rmios + * +__�rmios_p +, +��d_t + +__��d +� +__THROW +; + +57 + $cf�ti��d + ( +�rmios + * +__�rmios_p +, +��d_t + +__��d +� +__THROW +; + +59 #ifdef +__USE_BSD + + +61 + $cf�t��d + ( +�rmios + * +__�rmios_p +, +��d_t + +__��d +� +__THROW +; + +66 + $tcg��� + ( +__fd +, +�rmios + * +__�rmios_p +� +__THROW +; + +70 + $tc���r + ( +__fd +, +__�tiڮ_a�i�s +, + +71 cڡ +�rmios + * +__�rmios_p +� +__THROW +; + +74 #ifdef +__USE_BSD + + +76 + $cfmak�aw + ( +�rmios + * +__�rmios_p +� +__THROW +; + +80 + $tc�ndb�ak + ( +__fd +, +__du�ti� +� +__THROW +; + +86 + `tcd�� + ( +__fd +); + +90 + $tc�ush + ( +__fd +, +__queue_���� +� +__THROW +; + +94 + $tc�ow + ( +__fd +, +__a�i� +� +__THROW +; + +97 #i� +def�ed + +__USE_UNIX98 + || def�ed +__USE_XOPEN2K8 + + +99 +__pid_t + + $tcg�sid + ( +__fd +� +__THROW +; + +103 #ifde� +__USE_BSD + + +104 + ~<sys/�yde�u�s.h +> + +107 +__END_DECLS + + + @/usr/include/time.h + +22 #i�def +_TIME_H + + +24 #i�(! +def�ed + +__�ed_time_t + && !def�ed +__�ed_�ock_t + && \ + +25 ! +def�ed + + g__�ed_time�ec +) + +26 + #_TIME_H + 1 + + ) + +27 + ~<�u�s.h +> + +29 + g__BEGIN_DECLS + + +33 #ifdef +_TIME_H + + +35 + #__�ed_size_t + + + ) + +36 + #__�ed_NULL + + + ) + +37 + ~<�ddef.h +> + +41 + ~<b�s/time.h +> + +44 #i�! +def�ed + +__STRICT_ANSI__ + && !def�ed +__USE_XOPEN2K + + +45 #i�de� +CLK_TCK + + +46 + #CLK_TCK + +CLOCKS_PER_SEC + + + ) + +52 #i�! +def�ed + +__�ock_t_def�ed + && (def�ed +_TIME_H + || def�ed +__�ed_�ock_t +) + +53 + #__�ock_t_def�ed + 1 + + ) + +55 + ~<b�s/ty�s.h +> + +57 +__BEGIN_NAMESPACE_STD + + +59 +__�ock_t + + t�ock_t +; + +60 + g__END_NAMESPACE_STD + + +61 #i� +def�ed + +__USE_XOPEN + || def�ed +__USE_POSIX + || def�ed +__USE_MISC + + +62 + $__USING_NAMESPACE_STD +( +�ock_t +) + +66 #unde� +__�ed_�ock_t + + +68 #i�! +def�ed + +__time_t_def�ed + && (def�ed +_TIME_H + || def�ed +__�ed_time_t +) + +69 + #__time_t_def�ed + 1 + + ) + +71 + ~<b�s/ty�s.h +> + +73 +__BEGIN_NAMESPACE_STD + + +75 +__time_t + + ttime_t +; + +76 +__END_NAMESPACE_STD + + +77 #i� +def�ed + +__USE_POSIX + || def�ed +__USE_MISC + || def�ed +__USE_SVID + + +78 + $__USING_NAMESPACE_STD +( +time_t +) + +82 #unde� +__�ed_time_t + + +84 #i�! +def�ed + +__�ockid_t_def�ed + && \ + +85 (( +def�ed + +_TIME_H + && def�ed +__USE_POSIX199309 +�|| def�ed +__�ed_�ockid_t +) + +86 + #__�ockid_t_def�ed + 1 + + ) + +88 + ~<b�s/ty�s.h +> + +91 +__�ockid_t + + t�ockid_t +; + +94 #unde� +__�ockid_time_t + + +96 #i�! +def�ed + +__tim�_t_def�ed + && \ + +97 (( +def�ed + +_TIME_H + && def�ed +__USE_POSIX199309 +�|| def�ed +__�ed_tim�_t +) + +98 + #__tim�_t_def�ed + 1 + + ) + +100 + ~<b�s/ty�s.h +> + +103 +__tim�_t + + ttim�_t +; + +106 #unde� +__�ed_tim�_t + + +109 #i�(! +def�ed + +__time�ec_def�ed + \ + +110 && (( +def�ed + +_TIME_H + \ + +111 && ( +def�ed + +__USE_POSIX199309 + || def�ed +__USE_MISC + \ + +112 || +def�ed + +__USE_ISOC11 +)) \ + +113 || +def�ed + +__�ed_time�ec +)) + +114 + #__time�ec_def�ed + 1 + + ) + +116 + ~<b�s/ty�s.h +> + +120 + stime�ec + + +122 +__time_t + +tv_�c +; + +123 +__sys��_��g_t + +tv_n�c +; + +127 #unde� +__�ed_time�ec + + +130 #ifdef +_TIME_H + + +131 +__BEGIN_NAMESPACE_STD + + +133 + stm + + +135 +tm_�c +; + +136 +tm_m� +; + +137 +tm_hour +; + +138 +tm_mday +; + +139 +tm_m� +; + +140 +tm_y�r +; + +141 +tm_wday +; + +142 +tm_yday +; + +143 +tm_isd� +; + +145 #ifdef +__USE_BSD + + +146 +tm_gmtoff +; + +147 cڡ * +tm_z�e +; + +149 +__tm_gmtoff +; + +150 cڡ * +__tm_z�e +; + +153 +__END_NAMESPACE_STD + + +154 #i� +def�ed + +__USE_XOPEN + || def�ed +__USE_POSIX + || def�ed +__USE_MISC + + +155 + $__USING_NAMESPACE_STD +( +tm +) + +159 #ifde� +__USE_POSIX199309 + + +161 + s�im��ec + + +163 +time�ec + +�_��rv� +; + +164 +time�ec + +�_v�ue +; + +168 +sigev�t +; + +172 #ifde� +__USE_XOPEN2K + + +173 #i�de� +__pid_t_def�ed + + +174 +__pid_t + + tpid_t +; + +175 + #__pid_t_def�ed + + + ) + +180 #ifde� +__USE_ISOC11 + + +182 + #TIME_UTC + 1 + + ) + +186 +__BEGIN_NAMESPACE_STD + + +189 +�ock_t + + $�ock + (� +__THROW +; + +192 +time_t + + $time + ( +time_t + * +__tim� +� +__THROW +; + +195 + $dif�ime + ( +time_t + +__time1 +,�ime_� +__time0 +) + +196 +__THROW + + `__��ibu�__ + (( +__cڡ__ +)); + +199 +time_t + + $mktime + ( +tm + * +__� +� +__THROW +; + +205 +size_t + + $�r�ime + (* +__��ri� + +__s +, +size_t + +__maxsize +, + +206 cڡ * +__��ri� + +__f�m� +, + +207 cڡ +tm + * +__��ri� + +__� +� +__THROW +; + +208 +__END_NAMESPACE_STD + + +210 #ifde� +__USE_XOPEN + + +213 * + $��time + (cڡ * +__��ri� + +__s +, + +214 cڡ * +__��ri� + +__fmt +, +tm + * +__� +) + +215 +__THROW +; + +218 #ifde� +__USE_XOPEN2K8 + + +221 + ~<xlo��.h +> + +223 +size_t + + $�r�ime_l + (* +__��ri� + +__s +, +size_t + +__maxsize +, + +224 cڡ * +__��ri� + +__f�m� +, + +225 cڡ +tm + * +__��ri� + +__� +, + +226 +__lo��_t + +__loc +� +__THROW +; + +229 #ifde� +__USE_GNU + + +230 * + $��time_l + (cڡ * +__��ri� + +__s +, + +231 cڡ * +__��ri� + +__fmt +, +tm + * +__� +, + +232 +__lo��_t + +__loc +� +__THROW +; + +236 +__BEGIN_NAMESPACE_STD + + +239 +tm + * + $gmtime + (cڡ +time_t + * +__tim� +� +__THROW +; + +243 +tm + * + $lo��ime + (cڡ +time_t + * +__tim� +� +__THROW +; + +244 +__END_NAMESPACE_STD + + +246 #i� +def�ed + +__USE_POSIX + || def�ed +__USE_MISC + + +249 +tm + * + $gmtime_r + (cڡ +time_t + * +__��ri� + +__tim� +, + +250 +tm + * +__��ri� + +__� +� +__THROW +; + +254 +tm + * + $lo��ime_r + (cڡ +time_t + * +__��ri� + +__tim� +, + +255 +tm + * +__��ri� + +__� +� +__THROW +; + +258 +__BEGIN_NAMESPACE_STD + + +261 * + $as�ime + (cڡ +tm + * +__� +� +__THROW +; + +264 * + $�ime + (cڡ +time_t + * +__tim� +� +__THROW +; + +265 +__END_NAMESPACE_STD + + +267 #i� +def�ed + +__USE_POSIX + || def�ed +__USE_MISC + + +272 * + $as�ime_r + (cڡ +tm + * +__��ri� + +__� +, + +273 * +__��ri� + +__buf +� +__THROW +; + +276 * + $�ime_r + (cڡ +time_t + * +__��ri� + +__tim� +, + +277 * +__��ri� + +__buf +� +__THROW +; + +282 * +__tz�me +[2]; + +283 +__daylight +; + +284 +__timez�e +; + +287 #ifdef +__USE_POSIX + + +289 * +tz�me +[2]; + +293 + $tz�t + (� +__THROW +; + +296 #i� +def�ed + +__USE_SVID + || def�ed +__USE_XOPEN + + +297 +daylight +; + +298 +timez�e +; + +301 #ifde� +__USE_SVID + + +304 + $�ime + (cڡ +time_t + * +__wh� +� +__THROW +; + +310 + #__i��p +( +y�r +) \ + +311 (( +y�r +�% 4 =�0 && ((y�r�% 100 !�0 || (y�r�% 400 =�0)) + + ) + +314 #ifde� +__USE_MISC + + +319 +time_t + + $timegm + ( +tm + * +__� +� +__THROW +; + +322 +time_t + + $tim�o�l + ( +tm + * +__� +� +__THROW +; + +325 + $dysize + ( +__y�r +� +__THROW + + `__��ibu�__ + (( +__cڡ__ +)); + +329 #ifde� +__USE_POSIX199309 + + +334 + `�no��p + (cڡ +time�ec + * +__�que�ed_time +, + +335 +time�ec + * +__�ma��g +); + +339 + $�ock_g��s + ( +�ockid_t + +__�ock_id +, +time�ec + * +__�s +� +__THROW +; + +342 + $�ock_g�time + ( +�ockid_t + +__�ock_id +, +time�ec + * +__� +� +__THROW +; + +345 + $�ock_��ime + ( +�ockid_t + +__�ock_id +, cڡ +time�ec + * +__� +) + +346 +__THROW +; + +348 #ifde� +__USE_XOPEN2K + + +353 + `�ock_�no��p + ( +�ockid_t + +__�ock_id +, +__�ags +, + +354 cڡ +time�ec + * +__�q +, + +355 +time�ec + * +__�m +); + +358 + $�ock_g��u�ockid + ( +pid_t + +__pid +, +�ockid_t + * +__�ock_id +� +__THROW +; + +363 + $tim�_��� + ( +�ockid_t + +__�ock_id +, + +364 +sigev�t + * +__��ri� + +__evp +, + +365 +tim�_t + * +__��ri� + +__tim�id +� +__THROW +; + +368 + $tim�_d��e + ( +tim�_t + +__tim�id +� +__THROW +; + +371 + $tim�_��ime + ( +tim�_t + +__tim�id +, +__�ags +, + +372 cڡ +�im��ec + * +__��ri� + +__v�ue +, + +373 +�im��ec + * +__��ri� + +__ov�ue +� +__THROW +; + +376 + $tim�_g�time + ( +tim�_t + +__tim�id +, +�im��ec + * +__v�ue +) + +377 +__THROW +; + +380 + $tim�_g�ov�run + ( +tim�_t + +__tim�id +� +__THROW +; + +384 #ifde� +__USE_ISOC11 + + +386 + $time�ec_g� + ( +time�ec + * +__ts +, +__ba� +) + +387 +__THROW + + `__n�nu� + ((1)); + +391 #ifde� +__USE_XOPEN_EXTENDED + + +403 +g�d�e_�r +; + +412 +tm + * + `g�d�e + (cڡ * +__�r�g +); + +415 #ifde� +__USE_GNU + + +426 + `g�d�e_r + (cڡ * +__��ri� + +__�r�g +, + +427 +tm + * +__��ri� + +__�sbu� +); + +430 +__END_DECLS + + + @/usr/include/unistd.h + +22 #i�def +_UNISTD_H + + +23 + #_UNISTD_H + 1 + + ) + +25 + ~<�u�s.h +> + +27 + g__BEGIN_DECLS + + +32 #ifde� +__USE_XOPEN2K8 + + +34 + #_POSIX_VERSION + 200809L + + ) + +35 #�i� +def�ed + +__USE_XOPEN2K + + +37 + #_POSIX_VERSION + 200112L + + ) + +38 #�i� +def�ed + +__USE_POSIX199506 + + +40 + #_POSIX_VERSION + 199506L + + ) + +41 #�i� +def�ed + +__USE_POSIX199309 + + +43 + #_POSIX_VERSION + 199309L + + ) + +46 + #_POSIX_VERSION + 199009L + + ) + +52 #ifde� +__USE_XOPEN2K8 + + +53 + #__POSIX2_THIS_VERSION + 200809L + + ) + +55 #�i� +def�ed + +__USE_XOPEN2K + + +57 + #__POSIX2_THIS_VERSION + 200112L + + ) + +58 #�i� +def�ed + +__USE_POSIX199506 + + +60 + #__POSIX2_THIS_VERSION + 199506L + + ) + +63 + #__POSIX2_THIS_VERSION + 199209L + + ) + +67 + #_POSIX2_VERSION + +__POSIX2_THIS_VERSION + + + ) + +71 + #_POSIX2_C_BIND + +__POSIX2_THIS_VERSION + + + ) + +75 + #_POSIX2_C_DEV + +__POSIX2_THIS_VERSION + + + ) + +79 + #_POSIX2_SW_DEV + +__POSIX2_THIS_VERSION + + + ) + +83 + #_POSIX2_LOCALEDEF + +__POSIX2_THIS_VERSION + + + ) + +86 #ifde� +__USE_XOPEN2K8 + + +87 + #_XOPEN_VERSION + 700 + + ) + +88 #�i� +def�ed + +__USE_XOPEN2K + + +89 + #_XOPEN_VERSION + 600 + + ) + +90 #�i� +def�ed + +__USE_UNIX98 + + +91 + #_XOPEN_VERSION + 500 + + ) + +93 + #_XOPEN_VERSION + 4 + + ) + +97 + #_XOPEN_XCU_VERSION + 4 + + ) + +100 + #_XOPEN_XPG2 + 1 + + ) + +101 + #_XOPEN_XPG3 + 1 + + ) + +102 + #_XOPEN_XPG4 + 1 + + ) + +105 + #_XOPEN_UNIX + 1 + + ) + +108 + #_XOPEN_CRYPT + 1 + + ) + +112 + #_XOPEN_ENH_I18N + 1 + + ) + +115 + #_XOPEN_LEGACY + 1 + + ) + +202 + ~<b�s/posix_�t.h +> + +205 #i� +def�ed + +__USE_UNIX98 + || def�ed +__USE_XOPEN2K + + +206 + ~<b�s/�v��m�ts.h +> + +210 + #STDIN_FILENO + 0 + + ) + +211 + #STDOUT_FILENO + 1 + + ) + +212 + #STDERR_FILENO + 2 + + ) + +217 + ~<b�s/ty�s.h +> + +219 #i�def +__ssize_t_def�ed + + +220 +__ssize_t + + tssize_t +; + +221 + #__ssize_t_def�ed + + + ) + +224 + #__�ed_size_t + + + ) + +225 + #__�ed_NULL + + + ) + +226 + ~<�ddef.h +> + +228 #i� +def�ed + +__USE_XOPEN + || def�ed +__USE_XOPEN2K + + +231 #i�de� +__gid_t_def�ed + + +232 +__gid_t + + tgid_t +; + +233 + #__gid_t_def�ed + + + ) + +236 #i�de� +__uid_t_def�ed + + +237 +__uid_t + + tuid_t +; + +238 + #__uid_t_def�ed + + + ) + +241 #i�de� +__off_t_def�ed + + +242 #i�de� +__USE_FILE_OFFSET64 + + +243 +__off_t + + toff_t +; + +245 +__off64_t + + toff_t +; + +247 + #__off_t_def�ed + + + ) + +249 #i� +def�ed + +__USE_LARGEFILE64 + && !def�ed +__off64_t_def�ed + + +250 +__off64_t + + toff64_t +; + +251 + #__off64_t_def�ed + + + ) + +254 #i�de� +__u�c�ds_t_def�ed + + +255 +__u�c�ds_t + + tu�c�ds_t +; + +256 + #__u�c�ds_t_def�ed + + + ) + +259 #i�de� +__pid_t_def�ed + + +260 +__pid_t + + tpid_t +; + +261 + #__pid_t_def�ed + + + ) + +265 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN_EXTENDED + || def�ed +__USE_XOPEN2K + + +266 #i�de� +__���_t_def�ed + + +267 +__���_t + + t���_t +; + +268 + #__���_t_def�ed + + + ) + +272 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN + + +273 #i�de� +__sock�n_t_def�ed + + +274 +__sock�n_t + + tsock�n_t +; + +275 + #__sock�n_t_def�ed + + + ) + +281 + #R_OK + 4 + + ) + +282 + #W_OK + 2 + + ) + +283 + #X_OK + 1 + + ) + +284 + #F_OK + 0 + + ) + +287 + $ac�ss + (cڡ * +__�me +, +__ty� +� +__THROW + + `__n�nu� + ((1)); + +289 #ifde� +__USE_GNU + + +292 + $euidac�ss + (cڡ * +__�me +, +__ty� +) + +293 +__THROW + + `__n�nu� + ((1)); + +296 + $�c�ss + (cڡ * +__�me +, +__ty� +) + +297 +__THROW + + `__n�nu� + ((1)); + +300 #ifde� +__USE_ATFILE + + +304 + $�c�s�t + ( +__fd +, cڡ * +__f�e +, +__ty� +, +__�ag +) + +305 +__THROW + + `__n�nu� + ((2)� +__wur +; + +310 #i�def +_STDIO_H + + +311 + #SEEK_SET + 0 + + ) + +312 + #SEEK_CUR + 1 + + ) + +313 + #SEEK_END + 2 + + ) + +314 #ifde� +__USE_GNU + + +315 + #SEEK_DATA + 3 + + ) + +316 + #SEEK_HOLE + 4 + + ) + +320 #i� +def�ed + +__USE_BSD + && !def�ed +L_SET + + +322 + #L_SET + +SEEK_SET + + + ) + +323 + #L_INCR + +SEEK_CUR + + + ) + +324 + #L_XTND + +SEEK_END + + + ) + +333 #i�de� +__USE_FILE_OFFSET64 + + +334 +__off_t + + $l�ek + ( +__fd +, +__off_t + +__off�t +, +__wh�� +� +__THROW +; + +336 #ifde� +__REDIRECT_NTH + + +337 +__off64_t + + `__REDIRECT_NTH + ( +l�ek +, + +338 ( +__fd +, +__off64_t + +__off�t +, +__wh�� +), + +339 +l�ek64 +); + +341 + #l�ek + +l�ek64 + + + ) + +344 #ifde� +__USE_LARGEFILE64 + + +345 +__off64_t + + $l�ek64 + ( +__fd +, +__off64_t + +__off�t +, +__wh�� +) + +346 +__THROW +; + +353 + `�o� + ( +__fd +); + +360 +ssize_t + + $�ad + ( +__fd +, * +__buf +, +size_t + +__nby�s +� +__wur +; + +366 +ssize_t + + $wr�e + ( +__fd +, cڡ * +__buf +, +size_t + +__n +� +__wur +; + +368 #i� +def�ed + +__USE_UNIX98 + || def�ed +__USE_XOPEN2K8 + + +369 #i�de� +__USE_FILE_OFFSET64 + + +376 +ssize_t + + $��d + ( +__fd +, * +__buf +, +size_t + +__nby�s +, + +377 +__off_t + +__off�t +� +__wur +; + +384 +ssize_t + + $pwr�e + ( +__fd +, cڡ * +__buf +, +size_t + +__n +, + +385 +__off_t + +__off�t +� +__wur +; + +387 #ifde� +__REDIRECT + + +388 +ssize_t + + `__REDIRECT + ( +��d +, ( +__fd +, * +__buf +, +size_t + +__nby�s +, + +389 +__off64_t + +__off�t +), + +390 +��d64 +� +__wur +; + +391 +ssize_t + + `__REDIRECT + ( +pwr�e +, ( +__fd +, cڡ * +__buf +, + +392 +size_t + +__nby�s +, +__off64_t + +__off�t +), + +393 +pwr�e64 +� +__wur +; + +395 + #��d + +��d64 + + + ) + +396 + #pwr�e + +pwr�e64 + + + ) + +400 #ifde� +__USE_LARGEFILE64 + + +404 +ssize_t + + $��d64 + ( +__fd +, * +__buf +, +size_t + +__nby�s +, + +405 +__off64_t + +__off�t +� +__wur +; + +408 +ssize_t + + $pwr�e64 + ( +__fd +, cڡ * +__buf +, +size_t + +__n +, + +409 +__off64_t + +__off�t +� +__wur +; + +417 + $p�e + ( +__p�edes +[2]� +__THROW + +__wur +; + +419 #ifde� +__USE_GNU + + +422 + $p�e2 + ( +__p�edes +[2], +__�ags +� +__THROW + +__wur +; + +432 + $��m + ( +__�c�ds +� +__THROW +; + +444 + `��p + ( +__�c�ds +); + +446 #i�( +def�ed + +__USE_XOPEN_EXTENDED + && !def�ed +__USE_XOPEN2K8 +) \ + +447 || +def�ed + +__USE_BSD + + +452 +__u�c�ds_t + + $u��m + ( +__u�c�ds_t + +__v�ue +, __u�c�ds_� +__��rv� +) + +453 +__THROW +; + +460 + `u��p + ( +__u�c�ds_t + +__u�c�ds +); + +469 + `�u� + (); + +473 + $chown + (cڡ * +__f�e +, +__uid_t + +__ow�r +, +__gid_t + +__group +) + +474 +__THROW + + `__n�nu� + ((1)� +__wur +; + +476 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + || def�ed +__USE_XOPEN2K8 + + +478 + $fchown + ( +__fd +, +__uid_t + +__ow�r +, +__gid_t + +__group +� +__THROW + +__wur +; + +483 + $lchown + (cڡ * +__f�e +, +__uid_t + +__ow�r +, +__gid_t + +__group +) + +484 +__THROW + + `__n�nu� + ((1)� +__wur +; + +488 #ifde� +__USE_ATFILE + + +491 + $fchow�t + ( +__fd +, cڡ * +__f�e +, +__uid_t + +__ow�r +, + +492 +__gid_t + +__group +, +__�ag +) + +493 +__THROW + + `__n�nu� + ((2)� +__wur +; + +497 + $chd� + (cڡ * +__�th +� +__THROW + + `__n�nu� + ((1)� +__wur +; + +499 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + || def�ed +__USE_XOPEN2K8 + + +501 + $fchd� + ( +__fd +� +__THROW + +__wur +; + +511 * + $g�cwd + (* +__buf +, +size_t + +__size +� +__THROW + +__wur +; + +513 #ifdef +__USE_GNU + + +517 * + $g�_cu��t_d�_�me + (� +__THROW +; + +520 #i�( +def�ed + +__USE_XOPEN_EXTENDED + && !def�ed +__USE_XOPEN2K8 +) \ + +521 || +def�ed + +__USE_BSD + + +525 * + $g�wd + (* +__buf +) + +526 +__THROW + + `__n�nu� + ((1)� +__��ibu�_d����d__ + +__wur +; + +531 + $dup + ( +__fd +� +__THROW + +__wur +; + +534 + $dup2 + ( +__fd +, +__fd2 +� +__THROW +; + +536 #ifde� +__USE_GNU + + +539 + $dup3 + ( +__fd +, +__fd2 +, +__�ags +� +__THROW +; + +543 ** +__�v�� +; + +544 #ifde� +__USE_GNU + + +545 ** +�v�� +; + +551 + $execve + (cڡ * +__�th +, *cڡ +__�gv +[], + +552 *cڡ +__�vp +[]� +__THROW + + `__n�nu� + ((1, 2)); + +554 #ifde� +__USE_XOPEN2K8 + + +557 + $�xecve + ( +__fd +, *cڡ +__�gv +[], *cڡ +__�vp +[]) + +558 +__THROW + + `__n�nu� + ((2)); + +563 + $execv + (cڡ * +__�th +, *cڡ +__�gv +[]) + +564 +__THROW + + `__n�nu� + ((1, 2)); + +568 + $exe�e + (cڡ * +__�th +, cڡ * +__�g +, ...) + +569 +__THROW + + `__n�nu� + ((1, 2)); + +573 + $exe� + (cڡ * +__�th +, cڡ * +__�g +, ...) + +574 +__THROW + + `__n�nu� + ((1, 2)); + +578 + $execvp + (cڡ * +__f�e +, *cڡ +__�gv +[]) + +579 +__THROW + + `__n�nu� + ((1, 2)); + +584 + $exe�p + (cڡ * +__f�e +, cڡ * +__�g +, ...) + +585 +__THROW + + `__n�nu� + ((1, 2)); + +587 #ifde� +__USE_GNU + + +590 + $execv� + (cڡ * +__f�e +, *cڡ +__�gv +[], + +591 *cڡ +__�vp +[]) + +592 +__THROW + + `__n�nu� + ((1, 2)); + +596 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN + + +598 + $ni� + ( +__�c +� +__THROW + +__wur +; + +603 + $_ex� + ( +__��us +� + `__��ibu�__ + (( +__nܑu�__ +)); + +609 + ~<b�s/c��ame.h +> + +612 + $�thc�f + (cڡ * +__�th +, +__�me +) + +613 +__THROW + + `__n�nu� + ((1)); + +616 + $�hc�f + ( +__fd +, +__�me +� +__THROW +; + +619 + $sysc�f + ( +__�me +� +__THROW +; + +621 #ifdef +__USE_POSIX2 + + +623 +size_t + + $c�f�r + ( +__�me +, * +__buf +, +size_t + +__�n +� +__THROW +; + +628 +__pid_t + + $g�pid + (� +__THROW +; + +631 +__pid_t + + $g��id + (� +__THROW +; + +634 +__pid_t + + $g�pg� + (� +__THROW +; + +637 +__pid_t + + $__g�pgid + ( +__pid_t + +__pid +� +__THROW +; + +638 #i� +def�ed + +__USE_XOPEN_EXTENDED + || def�ed +__USE_XOPEN2K8 + + +639 +__pid_t + + $g�pgid + ( +__pid_t + +__pid +� +__THROW +; + +646 + $��gid + ( +__pid_t + +__pid +, __pid_� +__pgid +� +__THROW +; + +648 #i� +def�ed + +__USE_SVID + || def�ed +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + + +660 + $��g� + (� +__THROW +; + +667 +__pid_t + + $�tsid + (� +__THROW +; + +669 #i� +def�ed + +__USE_XOPEN_EXTENDED + || def�ed +__USE_XOPEN2K8 + + +671 +__pid_t + + $g�sid + ( +__pid_t + +__pid +� +__THROW +; + +675 +__uid_t + + $g�uid + (� +__THROW +; + +678 +__uid_t + + $g�euid + (� +__THROW +; + +681 +__gid_t + + $g�gid + (� +__THROW +; + +684 +__gid_t + + $g�egid + (� +__THROW +; + +689 + $g�groups + ( +__size +, +__gid_t + +__li� +[]� +__THROW + +__wur +; + +691 #ifdef +__USE_GNU + + +693 + $group_memb� + ( +__gid_t + +__gid +� +__THROW +; + +700 + $�tuid + ( +__uid_t + +__uid +� +__THROW + +__wur +; + +702 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + + +705 + $��euid + ( +__uid_t + +__ruid +, __uid_� +__euid +� +__THROW + +__wur +; + +708 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN2K + + +710 + $��uid + ( +__uid_t + +__uid +� +__THROW + +__wur +; + +717 + $�tgid + ( +__gid_t + +__gid +� +__THROW + +__wur +; + +719 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + + +722 + $��egid + ( +__gid_t + +__rgid +, __gid_� +__egid +� +__THROW + +__wur +; + +725 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN2K + + +727 + $��gid + ( +__gid_t + +__gid +� +__THROW + +__wur +; + +730 #ifde� +__USE_GNU + + +733 + $g��suid + ( +__uid_t + * +__ruid +, __uid_�* +__euid +, __uid_�* +__suid +) + +734 +__THROW +; + +738 + $g��sgid + ( +__gid_t + * +__rgid +, __gid_�* +__egid +, __gid_�* +__sgid +) + +739 +__THROW +; + +743 + $��esuid + ( +__uid_t + +__ruid +, __uid_� +__euid +, __uid_� +__suid +) + +744 +__THROW + +__wur +; + +748 + $��esgid + ( +__gid_t + +__rgid +, __gid_� +__egid +, __gid_� +__sgid +) + +749 +__THROW + +__wur +; + +756 +__pid_t + + $f�k + (� +__THROWNL +; + +758 #i�( +def�ed + +__USE_XOPEN_EXTENDED + && !def�ed +__USE_XOPEN2K8 +) \ + +759 || +def�ed + +__USE_BSD + + +764 +__pid_t + + $vf�k + (� +__THROW +; + +770 * + $�y�me + ( +__fd +� +__THROW +; + +774 + $�y�me_r + ( +__fd +, * +__buf +, +size_t + +__bu� +) + +775 +__THROW + + `__n�nu� + ((2)� +__wur +; + +779 + $i��y + ( +__fd +� +__THROW +; + +781 #i� +def�ed + +__USE_BSD + \ + +782 || ( +def�ed + +__USE_XOPEN_EXTENDED + && !def�ed +__USE_UNIX98 +) + +785 + $�y�� + (� +__THROW +; + +790 + $l�k + (cڡ * +__�om +, cڡ * +__to +) + +791 +__THROW + + `__n�nu� + ((1, 2)� +__wur +; + +793 #ifde� +__USE_ATFILE + + +796 + $l�k� + ( +__�omfd +, cڡ * +__�om +, +__tofd +, + +797 cڡ * +__to +, +__�ags +) + +798 +__THROW + + `__n�nu� + ((2, 4)� +__wur +; + +801 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + || def�ed +__USE_XOPEN2K + + +803 + $syml�k + (cڡ * +__�om +, cڡ * +__to +) + +804 +__THROW + + `__n�nu� + ((1, 2)� +__wur +; + +809 +ssize_t + + $�adl�k + (cڡ * +__��ri� + +__�th +, + +810 * +__��ri� + +__buf +, +size_t + +__�n +) + +811 +__THROW + + `__n�nu� + ((1, 2)� +__wur +; + +814 #ifde� +__USE_ATFILE + + +816 + $syml�k� + (cڡ * +__�om +, +__tofd +, + +817 cڡ * +__to +� +__THROW + + `__n�nu� + ((1, 3)� +__wur +; + +820 +ssize_t + + $�adl�k� + ( +__fd +, cڡ * +__��ri� + +__�th +, + +821 * +__��ri� + +__buf +, +size_t + +__�n +) + +822 +__THROW + + `__n�nu� + ((2, 3)� +__wur +; + +826 + $uƚk + (cڡ * +__�me +� +__THROW + + `__n�nu� + ((1)); + +828 #ifde� +__USE_ATFILE + + +830 + $uƚk� + ( +__fd +, cڡ * +__�me +, +__�ag +) + +831 +__THROW + + `__n�nu� + ((2)); + +835 + $rmd� + (cڡ * +__�th +� +__THROW + + `__n�nu� + ((1)); + +839 +__pid_t + + $tcg�pg� + ( +__fd +� +__THROW +; + +842 + $tc��g� + ( +__fd +, +__pid_t + +__pg�_id +� +__THROW +; + +849 * + `g�log� + (); + +850 #i� +def�ed + +__USE_REENTRANT + || def�ed +__USE_POSIX199506 + + +857 + $g�log�_r + (* +__�me +, +size_t + +__�me_�n +� + `__n�nu� + ((1)); + +860 #ifdef +__USE_BSD + + +862 + $��og� + (cڡ * +__�me +� +__THROW + + `__n�nu� + ((1)); + +866 #ifdef +__USE_POSIX2 + + +870 + #__�ed_g��t + + + ) + +871 + ~<g��t.h +> + +875 #i� +def�ed + +__USE_BSD + || def�ed +__USE_UNIX98 + || def�ed +__USE_XOPEN2K + + +879 + $g�ho��me + (* +__�me +, +size_t + +__�n +� +__THROW + + `__n�nu� + ((1)); + +883 #i� +def�ed + +__USE_BSD + || (def�ed +__USE_XOPEN + && !def�ed +__USE_UNIX98 +) + +886 + $�tho��me + (cڡ * +__�me +, +size_t + +__�n +) + +887 +__THROW + + `__n�nu� + ((1)� +__wur +; + +891 + $�tho�id + ( +__id +� +__THROW + +__wur +; + +897 + $g�doma��me + (* +__�me +, +size_t + +__�n +) + +898 +__THROW + + `__n�nu� + ((1)� +__wur +; + +899 + $�tdoma��me + (cڡ * +__�me +, +size_t + +__�n +) + +900 +__THROW + + `__n�nu� + ((1)� +__wur +; + +906 + $vh�gup + (� +__THROW +; + +909 + $�voke + (cڡ * +__f�e +� +__THROW + + `__n�nu� + ((1)� +__wur +; + +917 + $�of� + (* +__�m�e_buf�r +, +size_t + +__size +, + +918 +size_t + +__off�t +, +__s�� +) + +919 +__THROW + + `__n�nu� + ((1)); + +925 + $ac� + (cڡ * +__�me +� +__THROW +; + +929 * + $g�u�rsh�l + (� +__THROW +; + +930 + $�du�rsh�l + (� +__THROW +; + +931 + $�tu�rsh�l + (� +__THROW +; + +937 + $d�m� + ( +__nochd� +, +__no�o� +� +__THROW + +__wur +; + +941 #i� +def�ed + +__USE_BSD + || (def�ed +__USE_XOPEN + && !def�ed +__USE_XOPEN2K +) + +944 + $chro� + (cڡ * +__�th +� +__THROW + + `__n�nu� + ((1)� +__wur +; + +948 * + $g��ss + (cڡ * +__�om� +� + `__n�nu� + ((1)); + +956 + `fsync + ( +__fd +); + +959 #ifde� +__USE_GNU + + +962 + $syncfs + ( +__fd +� +__THROW +; + +966 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + + +969 + `g�ho�id + (); + +972 + $sync + (� +__THROW +; + +975 #i� +def�ed + +__USE_BSD + || !def�ed +__USE_XOPEN2K + + +978 + $g��gesize + (� +__THROW + + `__��ibu�__ + (( +__cڡ__ +)); + +983 + $g�d�b�size + (� +__THROW +; + +989 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + || def�ed +__USE_XOPEN2K8 + + +992 #i�de� +__USE_FILE_OFFSET64 + + +993 + $�un�� + (cڡ * +__f�e +, +__off_t + +__�ngth +) + +994 +__THROW + + `__n�nu� + ((1)� +__wur +; + +996 #ifde� +__REDIRECT_NTH + + +997 + `__REDIRECT_NTH + ( +�un�� +, + +998 (cڡ * +__f�e +, +__off64_t + +__�ngth +), + +999 +�un��64 +� + `__n�nu� + ((1)� +__wur +; + +1001 + #�un�� + +�un��64 + + + ) + +1004 #ifde� +__USE_LARGEFILE64 + + +1005 + $�un��64 + (cڡ * +__f�e +, +__off64_t + +__�ngth +) + +1006 +__THROW + + `__n�nu� + ((1)� +__wur +; + +1011 #i� +def�ed + +__USE_BSD + || def�ed +__USE_POSIX199309 + \ + +1012 || +def�ed + +__USE_XOPEN_EXTENDED + || def�ed +__USE_XOPEN2K + + +1015 #i�de� +__USE_FILE_OFFSET64 + + +1016 + $�run�� + ( +__fd +, +__off_t + +__�ngth +� +__THROW + +__wur +; + +1018 #ifde� +__REDIRECT_NTH + + +1019 + `__REDIRECT_NTH + ( +�run�� +, ( +__fd +, +__off64_t + +__�ngth +), + +1020 +�run��64 +� +__wur +; + +1022 + #�run�� + +�run��64 + + + ) + +1025 #ifde� +__USE_LARGEFILE64 + + +1026 + $�run��64 + ( +__fd +, +__off64_t + +__�ngth +� +__THROW + +__wur +; + +1032 #i�( +def�ed + +__USE_XOPEN_EXTENDED + && !def�ed +__USE_XOPEN2K +) \ + +1033 || +def�ed + +__USE_MISC + + +1037 + $brk + (* +__addr +� +__THROW + +__wur +; + +1043 * + $sbrk + ( +���_t + +__d�� +� +__THROW +; + +1047 #ifde� +__USE_MISC + + +1058 + $sys�� + ( +__sy�o +, ...� +__THROW +; + +1063 #i�( +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN_EXTENDED +�&& !def�ed +F_LOCK + + +1075 + #F_ULOCK + 0 + + ) + +1076 + #F_LOCK + 1 + + ) + +1077 + #F_TLOCK + 2 + + ) + +1078 + #F_TEST + 3 + + ) + +1080 #i�de� +__USE_FILE_OFFSET64 + + +1081 + $lockf + ( +__fd +, +__cmd +, +__off_t + +__�n +� +__wur +; + +1083 #ifde� +__REDIRECT + + +1084 + `__REDIRECT + ( +lockf +, ( +__fd +, +__cmd +, +__off64_t + +__�n +), + +1085 +lockf64 +� +__wur +; + +1087 + #lockf + +lockf64 + + + ) + +1090 #ifde� +__USE_LARGEFILE64 + + +1091 + $lockf64 + ( +__fd +, +__cmd +, +__off64_t + +__�n +� +__wur +; + +1096 #ifde� +__USE_GNU + + +1101 + #TEMP_FAILURE_RETRY +( +ex�essi� +) \ + +1102 ( +__ex�nsi�__ + \ + +1103 ({ +__�su� +; \ + +1104 d� +__�su� + = (�( +ex�essi� +); \ + +1105 +__�su� + =�-1L && +��o + =� +EINTR +); \ + +1106 +__�su� +; + } +})) + + ) + +1109 #i� +def�ed + +__USE_POSIX199309 + || def�ed +__USE_UNIX98 + + +1112 +fd�async + ( +__f�des +); + +1118 #ifdef +__USE_XOPEN + + +1120 * + $�y� + (cڡ * +__key +, cڡ * +__�� +) + +1121 +__THROW + + `__n�nu� + ((1, 2)); + +1125 + $��y� + (* +__glibc_block +, +__ed�ag +) + +1126 +__THROW + + `__n�nu� + ((1)); + +1133 + $swab + (cڡ * +__��ri� + +__�om +, *__��ri� +__to +, + +1134 +ssize_t + +__n +� +__THROW + + `__n�nu� + ((1, 2)); + +1140 #i� +def�ed + +__USE_XOPEN + && !def�ed +__USE_XOPEN2K + + +1142 * + $��mid + (* +__s +� +__THROW +; + +1147 #i� +__USE_FORTIFY_LEVEL + > 0 && +def�ed + +__f�tify_fun�i� + + +1148 + ~<b�s/uni�d.h +> + +1151 +__END_DECLS + + + @/usr/include/alloca.h + +18 #i�def +_ALLOCA_H + + +19 + #_ALLOCA_H + 1 + + ) + +21 + ~<�u�s.h +> + +23 + #__�ed_size_t + + + ) + +24 + ~<�ddef.h +> + +26 + g__BEGIN_DECLS + + +29 #unde� +�lo� + + +32 * + $�lo� + ( +size_t + +__size +� +__THROW +; + +34 #ifdef +__GNUC__ + + +35 + #�lo� +( +size +� + `__bu�t�_�lo� + (size) + + ) + +38 +__END_DECLS + + + @/usr/include/ares_rules.h + +1 #i�de� +__CARES_RULES_H + + +2 + #__CARES_RULES_H + + + ) + +71 #i�de� +CARES_SIZEOF_LONG + + +73 +E�� + + gComp��i�_ab܋d_CARES_SIZEOF_LONG_is_miss�g + + +76 #i�de� +CARES_TYPEOF_ARES_SOCKLEN_T + + +78 +E�� + + gComp��i�_ab܋d_CARES_TYPEOF_ARES_SOCKLEN_T_is_miss�g + + +81 #i�de� +CARES_SIZEOF_ARES_SOCKLEN_T + + +83 +E�� + + gComp��i�_ab܋d_CARES_SIZEOF_ARES_SOCKLEN_T_is_miss�g + + +90 + #C�eschkszEQ +( +t +, +s +���=�? 1 : -1 + + ) + +92 + #C�eschkszGE +( +t1 +, +t2 +��1�>��2�? 1 : -1 + + ) + +100 + t__��s_ru�_01__ + + +101 [ +C�eschkszEQ +(, +CARES_SIZEOF_LONG +)]; + +110 + t__��s_ru�_02__ + + +111 [ +C�eschkszEQ +( +�es_sock�n_t +, +CARES_SIZEOF_ARES_SOCKLEN_T +)]; + +120 + t__��s_ru�_03__ + + +121 [ +C�eschkszGE +( +�es_sock�n_t +, )]; + +131 #unde� +C�eschkszEQ + + +132 #unde� +C�eschkszGE + + +138 #unde� +CARES_PULL_WS2TCPIP_H + + +139 #unde� +CARES_PULL_SYS_TYPES_H + + +140 #unde� +CARES_PULL_SYS_SOCKET_H + + +142 #unde� +CARES_TYPEOF_ARES_SOCKLEN_T + + + @/usr/include/ares_version.h + +2 #i�de� +ARES__VERSION_H + + +3 + #ARES__VERSION_H + + + ) + +6 + #ARES_COPYRIGHT + "2004 - 2013 D���S�nb�g, <d��l@haxx.�>." + + ) + +8 + #ARES_VERSION_MAJOR + 1 + + ) + +9 + #ARES_VERSION_MINOR + 10 + + ) + +10 + #ARES_VERSION_PATCH + 0 + + ) + +11 + #ARES_VERSION + (( +ARES_VERSION_MAJOR +<<16)|\ + +12 ( +ARES_VERSION_MINOR +<<8)|\ + +13 ( +ARES_VERSION_PATCH +)) + + ) + +14 + #ARES_VERSION_STR + "1.10.0" + + ) + +16 #i�( +ARES_VERSION + >= 0x010700) + +17 + #CARES_HAVE_ARES_LIBRARY_INIT + 1 + + ) + +18 + #CARES_HAVE_ARES_LIBRARY_CLEANUP + 1 + + ) + +20 #unde� +CARES_HAVE_ARES_LIBRARY_INIT + + +21 #unde� +CARES_HAVE_ARES_LIBRARY_CLEANUP + + + @/usr/include/arpa/nameser_compat.h + +34 #i�de� +_ARPA_NAMESER_COMPAT_ + + +35 + #_ARPA_NAMESER_COMPAT_ + + + ) + +37 + #__BIND + 19950621 + + ) + +39 + ~<�d�n.h +> + +49 + mid + :16; + +50 #i� +BYTE_ORDER + =� +BIG_ENDIAN + + +52 + mqr +: 1; + +53 + m�code +: 4; + +54 + m� +: 1; + +55 + mtc +: 1; + +56 + mrd +: 1; + +58 + m� +: 1; + +59 + munu�d + :1; + +60 + mad +: 1; + +61 + mcd +: 1; + +62 + mrcode + :4; + +64 #i� +BYTE_ORDER + =� +LITTLE_ENDIAN + || BYTE_ORDER =� +PDP_ENDIAN + + +66 + mrd + :1; + +67 + mtc + :1; + +68 + m� + :1; + +69 + m�code + :4; + +70 + mqr + :1; + +72 + mrcode + :4; + +73 + mcd +: 1; + +74 + mad +: 1; + +75 + munu�d + :1; + +76 + m� + :1; + +79 + mqdcou� + :16; + +80 + m�cou� + :16; + +81 + mnscou� + :16; + +82 + m�cou� + :16; + +83 } + tHEADER +; + +85 + #PACKETSZ + +NS_PACKETSZ + + + ) + +86 + #MAXDNAME + +NS_MAXDNAME + + + ) + +87 + #MAXCDNAME + +NS_MAXCDNAME + + + ) + +88 + #MAXLABEL + +NS_MAXLABEL + + + ) + +89 + #HFIXEDSZ + +NS_HFIXEDSZ + + + ) + +90 + #QFIXEDSZ + +NS_QFIXEDSZ + + + ) + +91 + #RRFIXEDSZ + +NS_RRFIXEDSZ + + + ) + +92 + #INT32SZ + +NS_INT32SZ + + + ) + +93 + #INT16SZ + +NS_INT16SZ + + + ) + +94 + #INT8SZ + +NS_INT8SZ + + + ) + +95 + #INADDRSZ + +NS_INADDRSZ + + + ) + +96 + #IN6ADDRSZ + +NS_IN6ADDRSZ + + + ) + +97 + #INDIR_MASK + +NS_CMPRSFLGS + + + ) + +98 + #NAMESERVER_PORT + +NS_DEFAULTPORT + + + ) + +100 + #S_ZONE + +ns_s_zn + + + ) + +101 + #S_PREREQ + +ns_s_� + + + ) + +102 + #S_UPDATE + +ns_s_ud + + + ) + +103 + #S_ADDT + +ns_s_� + + + ) + +105 + #QUERY + +ns_o_qu�y + + + ) + +106 + #IQUERY + +ns_o_iqu�y + + + ) + +107 + #STATUS + +ns_o_��us + + + ) + +108 + #NS_NOTIFY_OP + +ns_o_n�ify + + + ) + +109 + #NS_UPDATE_OP + +ns_o_upd�e + + + ) + +111 + #NOERROR + +ns_r_nۼ� + + + ) + +112 + #FORMERR + +ns_r_f�m�r + + + ) + +113 + #SERVFAIL + +ns_r_�rv� + + + ) + +114 + #NXDOMAIN + +ns_r_nxdoma� + + + ) + +115 + #NOTIMP + +ns_r_n�im� + + + ) + +116 + #REFUSED + +ns_r_�fu�d + + + ) + +117 + #YXDOMAIN + +ns_r_yxdoma� + + + ) + +118 + #YXRRSET + +ns_r_yx��t + + + ) + +119 + #NXRRSET + +ns_r_nx��t + + + ) + +120 + #NOTAUTH + +ns_r_n�auth + + + ) + +121 + #NOTZONE + +ns_r_n�z�e + + + ) + +127 + #DELETE + +ns_u�_d��e + + + ) + +128 + #ADD + +ns_u�_add + + + ) + +130 + #T_A + +ns_t_a + + + ) + +131 + #T_NS + +ns_t_ns + + + ) + +132 + #T_MD + +ns_t_md + + + ) + +133 + #T_MF + +ns_t_mf + + + ) + +134 + #T_CNAME + +ns_t_�ame + + + ) + +135 + #T_SOA + +ns_t_s� + + + ) + +136 + #T_MB + +ns_t_mb + + + ) + +137 + #T_MG + +ns_t_mg + + + ) + +138 + #T_MR + +ns_t_mr + + + ) + +139 + #T_NULL + +ns_t_nu� + + + ) + +140 + #T_WKS + +ns_t_wks + + + ) + +141 + #T_PTR + +ns_t_�r + + + ) + +142 + #T_HINFO + +ns_t_h�fo + + + ) + +143 + #T_MINFO + +ns_t_m�fo + + + ) + +144 + #T_MX + +ns_t_mx + + + ) + +145 + #T_TXT + +ns_t_txt + + + ) + +146 + #T_RP + +ns_t_� + + + ) + +147 + #T_AFSDB + +ns_t_afsdb + + + ) + +148 + #T_X25 + +ns_t_x25 + + + ) + +149 + #T_ISDN + +ns_t_isdn + + + ) + +150 + #T_RT + +ns_t_� + + + ) + +151 + #T_NSAP + +ns_t_n�p + + + ) + +152 + #T_NSAP_PTR + +ns_t_n�p_�r + + + ) + +153 + #T_SIG + +ns_t_sig + + + ) + +154 + #T_KEY + +ns_t_key + + + ) + +155 + #T_PX + +ns_t_px + + + ) + +156 + #T_GPOS + +ns_t_gpos + + + ) + +157 + #T_AAAA + +ns_t_�� + + + ) + +158 + #T_LOC + +ns_t_loc + + + ) + +159 + #T_NXT + +ns_t_nxt + + + ) + +160 + #T_EID + +ns_t_eid + + + ) + +161 + #T_NIMLOC + +ns_t_nimloc + + + ) + +162 + #T_SRV + +ns_t_�v + + + ) + +163 + #T_ATMA + +ns_t_�ma + + + ) + +164 + #T_NAPTR + +ns_t_DZr + + + ) + +165 + #T_A6 + +ns_t_a6 + + + ) + +166 + #T_DNAME + +ns_t_d�me + + + ) + +167 + #T_TSIG + +ns_t_tsig + + + ) + +168 + #T_IXFR + +ns_t_ix� + + + ) + +169 + #T_AXFR + +ns_t_ax� + + + ) + +170 + #T_MAILB + +ns_t_ma�b + + + ) + +171 + #T_MAILA + +ns_t_ma�a + + + ) + +172 + #T_ANY + +ns_t_�y + + + ) + +174 + #C_IN + +ns_c_� + + + ) + +175 + #C_CHAOS + +ns_c_chaos + + + ) + +176 + #C_HS + +ns_c_hs + + + ) + +178 + #C_NONE + +ns_c_n�e + + + ) + +179 + #C_ANY + +ns_c_�y + + + ) + +181 + #GETSHORT + +NS_GET16 + + + ) + +182 + #GETLONG + +NS_GET32 + + + ) + +183 + #PUTSHORT + +NS_PUT16 + + + ) + +184 + #PUTLONG + +NS_PUT32 + + + ) + + @/usr/include/asm/byteorder.h + +1 #i�de� +_ASM_X86_BYTEORDER_H + + +2 + #_ASM_X86_BYTEORDER_H + + + ) + +4 + ~<l�ux/by��d�/l��e_�d�n.h +> + + @/usr/include/bits/byteswap.h + +19 #i�! +def�ed + +_BYTESWAP_H + && !def�ed +_NETINET_IN_H + && !def�ed +_ENDIAN_H + + +23 #i�de� +_BITS_BYTESWAP_H + + +24 + #_BITS_BYTESWAP_H + 1 + + ) + +26 + ~<�u�s.h +> + +27 + ~<b�s/ty�s.h +> + +28 + ~<b�s/w�dsize.h +> + +31 + #__bsw�_cڡ�t_16 +( +x +) \ + +32 ((�(((( +x +�>> 8�& 0xff�| (((x�& 0xff�<< 8))) + + ) + +35 + ~<b�s/by�sw�-16.h +> + +38 + #__bsw�_cڡ�t_32 +( +x +) \ + +39 (((( +x +) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \ + +40 ((( +x +�& 0x0000ff00�<< 8�| (((x�& 0x000000ff�<< 24)) + + ) + +42 #ifde� +__GNUC__ + + +43 #i� +__GNUC_PREREQ + (4, 3) + +44 +__�l�e + + +45 + $__bsw�_32 + ( +__bsx +) + +47 + `__bu�t�_bsw�32 + ( +__bsx +); + +48 + } +} + +49 #�i� +__GNUC__ + >= 2 + +50 #i� +__WORDSIZE + =�64 || ( +def�ed + +__i486__ + || def�ed +__��ium__ + \ + +51 || +def�ed + + g__��ium�o__ + || def�ed + g__��ium4__ + \ + +52 || +def�ed + + g__k8__ + || def�ed + g__�hl�__ + \ + +53 || +def�ed + + g__k6__ + || def�ed + g__noc�a__ + \ + +54 || +def�ed + + g__c�e2__ + || def�ed + g__geode__ + \ + +55 || +def�ed + + g__amd�m10__ +) + +58 + #__bsw�_32 +( +x +) \ + +59 ( +__ex�nsi�__ + \ + +60 ({ +__v +, +__x + = ( +x +); \ + +61 i�( + `__bu�t�_cڡ�t_p + ( +__x +)) \ + +62 +__v + = + `__bsw�_cڡ�t_32 + ( +__x +); \ + +64 + `__asm__ + ("bsw� %0" : "�" ( +__v +�: "0" ( +__x +)); \ + +65 +__v +; })) + + ) + +67 + #__bsw�_32 +( +x +) \ + +68 ( +__ex�nsi�__ + \ + +69 ({ +__v +, +__x + = ( +x +); \ + +70 i�( + `__bu�t�_cڡ�t_p + ( +__x +)) \ + +71 +__v + = + `__bsw�_cڡ�t_32 + ( +__x +); \ + +73 + `__asm__ + ("rorw $8, %w0;" \ + +76 : "�" ( +__v +) \ + +77 : "0" ( +__x +) \ + +79 +__v +; })) + + ) + +82 + #__bsw�_32 +( +x +) \ + +83 ( +__ex�nsi�__ + \ + +84 ({ +__x + = ( +x +); + `__bsw�_cڡ�t_32 + (__x); })) + + ) + +87 +__�l�e + + +88 + $__bsw�_32 + ( +__bsx +) + +90 + `__bsw�_cڡ�t_32 + ( +__bsx +); + +91 + } +} + +95 #i� +__GNUC_PREREQ + (2, 0) + +97 + #__bsw�_cڡ�t_64 +( +x +) \ + +98 ( + `__ex�nsi�__ + (((( +x +) & 0xff00000000000000ull) >> 56) \ + +99 | ((( +x +) & 0x00ff000000000000ull) >> 40) \ + +100 | ((( +x +) & 0x0000ff0000000000ull) >> 24) \ + +101 | ((( +x +) & 0x000000ff00000000ull) >> 8) \ + +102 | ((( +x +) & 0x00000000ff000000ull) << 8) \ + +103 | ((( +x +) & 0x0000000000ff0000ull) << 24) \ + +104 | ((( +x +) & 0x000000000000ff00ull) << 40) \ + +105 | ((( +x +�& 0x00000000000000ffu��<< 56))) + + ) + +107 #i� +__GNUC_PREREQ + (4, 3) + +108 +__�l�e + +__u�t64_t + + +109 + $__bsw�_64 + ( +__u�t64_t + +__bsx +) + +111 + `__bu�t�_bsw�64 + ( +__bsx +); + +112 + } +} + +113 #�i� +__WORDSIZE + == 64 + +114 + #__bsw�_64 +( +x +) \ + +115 ( +__ex�nsi�__ + \ + +116 ({ +__u�t64_t + +__v +, +__x + = ( +x +); \ + +117 i�( + `__bu�t�_cڡ�t_p + ( +__x +)) \ + +118 +__v + = + `__bsw�_cڡ�t_64 + ( +__x +); \ + +120 + `__asm__ + ("bsw� %q0" : "�" ( +__v +�: "0" ( +__x +)); \ + +121 +__v +; })) + + ) + +123 + #__bsw�_64 +( +x +) \ + +124 ( +__ex�nsi�__ + \ + +125 ({ uni� { +__ex�nsi�__ + +__u�t64_t + +__� +; \ + +126 +__l +[2]; } +__w +, +__r +; \ + +127 i�( + `__bu�t�_cڡ�t_p + ( +x +)) \ + +128 +__r +. +__� + = + `__bsw�_cڡ�t_64 + ( +x +); \ + +131 +__w +. +__� + = ( +x +); \ + +132 +__r +. +__l +[0] = + `__bsw�_32 + ( +__w +.__l[1]); \ + +133 +__r +. +__l +[1] = + `__bsw�_32 + ( +__w +.__l[0]); \ + +135 +__r +. +__� +; })) + + ) + +138 + #__bsw�_cڡ�t_64 +( +x +) \ + +139 (((( +x +) & 0xff00000000000000ull) >> 56) \ + +140 | ((( +x +) & 0x00ff000000000000ull) >> 40) \ + +141 | ((( +x +) & 0x0000ff0000000000ull) >> 24) \ + +142 | ((( +x +) & 0x000000ff00000000ull) >> 8) \ + +143 | ((( +x +) & 0x00000000ff000000ull) << 8) \ + +144 | ((( +x +) & 0x0000000000ff0000ull) << 24) \ + +145 | ((( +x +) & 0x000000000000ff00ull) << 40) \ + +146 | ((( +x +�& 0x00000000000000ffu��<< 56)) + + ) + +148 +__�l�e + +__u�t64_t + + +149 + $__bsw�_64 + ( +__u�t64_t + +__bsx +) + +151 + `__bsw�_cڡ�t_64 + ( +__bsx +); + +152 + } +} + + @/usr/include/bits/confname.h + +19 #i�de� +_UNISTD_H + + +26 + m_PC_LINK_MAX +, + +27 + #_PC_LINK_MAX + +_PC_LINK_MAX + + + ) + +28 + m_PC_MAX_CANON +, + +29 + #_PC_MAX_CANON + +_PC_MAX_CANON + + + ) + +30 + m_PC_MAX_INPUT +, + +31 + #_PC_MAX_INPUT + +_PC_MAX_INPUT + + + ) + +32 + m_PC_NAME_MAX +, + +33 + #_PC_NAME_MAX + +_PC_NAME_MAX + + + ) + +34 + m_PC_PATH_MAX +, + +35 + #_PC_PATH_MAX + +_PC_PATH_MAX + + + ) + +36 + m_PC_PIPE_BUF +, + +37 + #_PC_PIPE_BUF + +_PC_PIPE_BUF + + + ) + +38 + m_PC_CHOWN_RESTRICTED +, + +39 + #_PC_CHOWN_RESTRICTED + +_PC_CHOWN_RESTRICTED + + + ) + +40 + m_PC_NO_TRUNC +, + +41 + #_PC_NO_TRUNC + +_PC_NO_TRUNC + + + ) + +42 + m_PC_VDISABLE +, + +43 + #_PC_VDISABLE + +_PC_VDISABLE + + + ) + +44 + m_PC_SYNC_IO +, + +45 + #_PC_SYNC_IO + +_PC_SYNC_IO + + + ) + +46 + m_PC_ASYNC_IO +, + +47 + #_PC_ASYNC_IO + +_PC_ASYNC_IO + + + ) + +48 + m_PC_PRIO_IO +, + +49 + #_PC_PRIO_IO + +_PC_PRIO_IO + + + ) + +50 + m_PC_SOCK_MAXBUF +, + +51 + #_PC_SOCK_MAXBUF + +_PC_SOCK_MAXBUF + + + ) + +52 + m_PC_FILESIZEBITS +, + +53 + #_PC_FILESIZEBITS + +_PC_FILESIZEBITS + + + ) + +54 + m_PC_REC_INCR_XFER_SIZE +, + +55 + #_PC_REC_INCR_XFER_SIZE + +_PC_REC_INCR_XFER_SIZE + + + ) + +56 + m_PC_REC_MAX_XFER_SIZE +, + +57 + #_PC_REC_MAX_XFER_SIZE + +_PC_REC_MAX_XFER_SIZE + + + ) + +58 + m_PC_REC_MIN_XFER_SIZE +, + +59 + #_PC_REC_MIN_XFER_SIZE + +_PC_REC_MIN_XFER_SIZE + + + ) + +60 + m_PC_REC_XFER_ALIGN +, + +61 + #_PC_REC_XFER_ALIGN + +_PC_REC_XFER_ALIGN + + + ) + +62 + m_PC_ALLOC_SIZE_MIN +, + +63 + #_PC_ALLOC_SIZE_MIN + +_PC_ALLOC_SIZE_MIN + + + ) + +64 + m_PC_SYMLINK_MAX +, + +65 + #_PC_SYMLINK_MAX + +_PC_SYMLINK_MAX + + + ) + +66 + m_PC_2_SYMLINKS + + +67 + #_PC_2_SYMLINKS + +_PC_2_SYMLINKS + + + ) + +73 + m_SC_ARG_MAX +, + +74 + #_SC_ARG_MAX + +_SC_ARG_MAX + + + ) + +75 + m_SC_CHILD_MAX +, + +76 + #_SC_CHILD_MAX + +_SC_CHILD_MAX + + + ) + +77 + m_SC_CLK_TCK +, + +78 + #_SC_CLK_TCK + +_SC_CLK_TCK + + + ) + +79 + m_SC_NGROUPS_MAX +, + +80 + #_SC_NGROUPS_MAX + +_SC_NGROUPS_MAX + + + ) + +81 + m_SC_OPEN_MAX +, + +82 + #_SC_OPEN_MAX + +_SC_OPEN_MAX + + + ) + +83 + m_SC_STREAM_MAX +, + +84 + #_SC_STREAM_MAX + +_SC_STREAM_MAX + + + ) + +85 + m_SC_TZNAME_MAX +, + +86 + #_SC_TZNAME_MAX + +_SC_TZNAME_MAX + + + ) + +87 + m_SC_JOB_CONTROL +, + +88 + #_SC_JOB_CONTROL + +_SC_JOB_CONTROL + + + ) + +89 + m_SC_SAVED_IDS +, + +90 + #_SC_SAVED_IDS + +_SC_SAVED_IDS + + + ) + +91 + m_SC_REALTIME_SIGNALS +, + +92 + #_SC_REALTIME_SIGNALS + +_SC_REALTIME_SIGNALS + + + ) + +93 + m_SC_PRIORITY_SCHEDULING +, + +94 + #_SC_PRIORITY_SCHEDULING + +_SC_PRIORITY_SCHEDULING + + + ) + +95 + m_SC_TIMERS +, + +96 + #_SC_TIMERS + +_SC_TIMERS + + + ) + +97 + m_SC_ASYNCHRONOUS_IO +, + +98 + #_SC_ASYNCHRONOUS_IO + +_SC_ASYNCHRONOUS_IO + + + ) + +99 + m_SC_PRIORITIZED_IO +, + +100 + #_SC_PRIORITIZED_IO + +_SC_PRIORITIZED_IO + + + ) + +101 + m_SC_SYNCHRONIZED_IO +, + +102 + #_SC_SYNCHRONIZED_IO + +_SC_SYNCHRONIZED_IO + + + ) + +103 + m_SC_FSYNC +, + +104 + #_SC_FSYNC + +_SC_FSYNC + + + ) + +105 + m_SC_MAPPED_FILES +, + +106 + #_SC_MAPPED_FILES + +_SC_MAPPED_FILES + + + ) + +107 + m_SC_MEMLOCK +, + +108 + #_SC_MEMLOCK + +_SC_MEMLOCK + + + ) + +109 + m_SC_MEMLOCK_RANGE +, + +110 + #_SC_MEMLOCK_RANGE + +_SC_MEMLOCK_RANGE + + + ) + +111 + m_SC_MEMORY_PROTECTION +, + +112 + #_SC_MEMORY_PROTECTION + +_SC_MEMORY_PROTECTION + + + ) + +113 + m_SC_MESSAGE_PASSING +, + +114 + #_SC_MESSAGE_PASSING + +_SC_MESSAGE_PASSING + + + ) + +115 + m_SC_SEMAPHORES +, + +116 + #_SC_SEMAPHORES + +_SC_SEMAPHORES + + + ) + +117 + m_SC_SHARED_MEMORY_OBJECTS +, + +118 + #_SC_SHARED_MEMORY_OBJECTS + +_SC_SHARED_MEMORY_OBJECTS + + + ) + +119 + m_SC_AIO_LISTIO_MAX +, + +120 + #_SC_AIO_LISTIO_MAX + +_SC_AIO_LISTIO_MAX + + + ) + +121 + m_SC_AIO_MAX +, + +122 + #_SC_AIO_MAX + +_SC_AIO_MAX + + + ) + +123 + m_SC_AIO_PRIO_DELTA_MAX +, + +124 + #_SC_AIO_PRIO_DELTA_MAX + +_SC_AIO_PRIO_DELTA_MAX + + + ) + +125 + m_SC_DELAYTIMER_MAX +, + +126 + #_SC_DELAYTIMER_MAX + +_SC_DELAYTIMER_MAX + + + ) + +127 + m_SC_MQ_OPEN_MAX +, + +128 + #_SC_MQ_OPEN_MAX + +_SC_MQ_OPEN_MAX + + + ) + +129 + m_SC_MQ_PRIO_MAX +, + +130 + #_SC_MQ_PRIO_MAX + +_SC_MQ_PRIO_MAX + + + ) + +131 + m_SC_VERSION +, + +132 + #_SC_VERSION + +_SC_VERSION + + + ) + +133 + m_SC_PAGESIZE +, + +134 + #_SC_PAGESIZE + +_SC_PAGESIZE + + + ) + +135 + #_SC_PAGE_SIZE + +_SC_PAGESIZE + + + ) + +136 + m_SC_RTSIG_MAX +, + +137 + #_SC_RTSIG_MAX + +_SC_RTSIG_MAX + + + ) + +138 + m_SC_SEM_NSEMS_MAX +, + +139 + #_SC_SEM_NSEMS_MAX + +_SC_SEM_NSEMS_MAX + + + ) + +140 + m_SC_SEM_VALUE_MAX +, + +141 + #_SC_SEM_VALUE_MAX + +_SC_SEM_VALUE_MAX + + + ) + +142 + m_SC_SIGQUEUE_MAX +, + +143 + #_SC_SIGQUEUE_MAX + +_SC_SIGQUEUE_MAX + + + ) + +144 + m_SC_TIMER_MAX +, + +145 + #_SC_TIMER_MAX + +_SC_TIMER_MAX + + + ) + +149 + m_SC_BC_BASE_MAX +, + +150 + #_SC_BC_BASE_MAX + +_SC_BC_BASE_MAX + + + ) + +151 + m_SC_BC_DIM_MAX +, + +152 + #_SC_BC_DIM_MAX + +_SC_BC_DIM_MAX + + + ) + +153 + m_SC_BC_SCALE_MAX +, + +154 + #_SC_BC_SCALE_MAX + +_SC_BC_SCALE_MAX + + + ) + +155 + m_SC_BC_STRING_MAX +, + +156 + #_SC_BC_STRING_MAX + +_SC_BC_STRING_MAX + + + ) + +157 + m_SC_COLL_WEIGHTS_MAX +, + +158 + #_SC_COLL_WEIGHTS_MAX + +_SC_COLL_WEIGHTS_MAX + + + ) + +159 + m_SC_EQUIV_CLASS_MAX +, + +160 + #_SC_EQUIV_CLASS_MAX + +_SC_EQUIV_CLASS_MAX + + + ) + +161 + m_SC_EXPR_NEST_MAX +, + +162 + #_SC_EXPR_NEST_MAX + +_SC_EXPR_NEST_MAX + + + ) + +163 + m_SC_LINE_MAX +, + +164 + #_SC_LINE_MAX + +_SC_LINE_MAX + + + ) + +165 + m_SC_RE_DUP_MAX +, + +166 + #_SC_RE_DUP_MAX + +_SC_RE_DUP_MAX + + + ) + +167 + m_SC_CHARCLASS_NAME_MAX +, + +168 + #_SC_CHARCLASS_NAME_MAX + +_SC_CHARCLASS_NAME_MAX + + + ) + +170 + m_SC_2_VERSION +, + +171 + #_SC_2_VERSION + +_SC_2_VERSION + + + ) + +172 + m_SC_2_C_BIND +, + +173 + #_SC_2_C_BIND + +_SC_2_C_BIND + + + ) + +174 + m_SC_2_C_DEV +, + +175 + #_SC_2_C_DEV + +_SC_2_C_DEV + + + ) + +176 + m_SC_2_FORT_DEV +, + +177 + #_SC_2_FORT_DEV + +_SC_2_FORT_DEV + + + ) + +178 + m_SC_2_FORT_RUN +, + +179 + #_SC_2_FORT_RUN + +_SC_2_FORT_RUN + + + ) + +180 + m_SC_2_SW_DEV +, + +181 + #_SC_2_SW_DEV + +_SC_2_SW_DEV + + + ) + +182 + m_SC_2_LOCALEDEF +, + +183 + #_SC_2_LOCALEDEF + +_SC_2_LOCALEDEF + + + ) + +185 + m_SC_PII +, + +186 + #_SC_PII + +_SC_PII + + + ) + +187 + m_SC_PII_XTI +, + +188 + #_SC_PII_XTI + +_SC_PII_XTI + + + ) + +189 + m_SC_PII_SOCKET +, + +190 + #_SC_PII_SOCKET + +_SC_PII_SOCKET + + + ) + +191 + m_SC_PII_INTERNET +, + +192 + #_SC_PII_INTERNET + +_SC_PII_INTERNET + + + ) + +193 + m_SC_PII_OSI +, + +194 + #_SC_PII_OSI + +_SC_PII_OSI + + + ) + +195 + m_SC_POLL +, + +196 + #_SC_POLL + +_SC_POLL + + + ) + +197 + m_SC_SELECT +, + +198 + #_SC_SELECT + +_SC_SELECT + + + ) + +199 + m_SC_UIO_MAXIOV +, + +200 + #_SC_UIO_MAXIOV + +_SC_UIO_MAXIOV + + + ) + +201 + m_SC_IOV_MAX + = +_SC_UIO_MAXIOV +, + +202 + #_SC_IOV_MAX + +_SC_IOV_MAX + + + ) + +203 + m_SC_PII_INTERNET_STREAM +, + +204 + #_SC_PII_INTERNET_STREAM + +_SC_PII_INTERNET_STREAM + + + ) + +205 + m_SC_PII_INTERNET_DGRAM +, + +206 + #_SC_PII_INTERNET_DGRAM + +_SC_PII_INTERNET_DGRAM + + + ) + +207 + m_SC_PII_OSI_COTS +, + +208 + #_SC_PII_OSI_COTS + +_SC_PII_OSI_COTS + + + ) + +209 + m_SC_PII_OSI_CLTS +, + +210 + #_SC_PII_OSI_CLTS + +_SC_PII_OSI_CLTS + + + ) + +211 + m_SC_PII_OSI_M +, + +212 + #_SC_PII_OSI_M + +_SC_PII_OSI_M + + + ) + +213 + m_SC_T_IOV_MAX +, + +214 + #_SC_T_IOV_MAX + +_SC_T_IOV_MAX + + + ) + +217 + m_SC_THREADS +, + +218 + #_SC_THREADS + +_SC_THREADS + + + ) + +219 + m_SC_THREAD_SAFE_FUNCTIONS +, + +220 + #_SC_THREAD_SAFE_FUNCTIONS + +_SC_THREAD_SAFE_FUNCTIONS + + + ) + +221 + m_SC_GETGR_R_SIZE_MAX +, + +222 + #_SC_GETGR_R_SIZE_MAX + +_SC_GETGR_R_SIZE_MAX + + + ) + +223 + m_SC_GETPW_R_SIZE_MAX +, + +224 + #_SC_GETPW_R_SIZE_MAX + +_SC_GETPW_R_SIZE_MAX + + + ) + +225 + m_SC_LOGIN_NAME_MAX +, + +226 + #_SC_LOGIN_NAME_MAX + +_SC_LOGIN_NAME_MAX + + + ) + +227 + m_SC_TTY_NAME_MAX +, + +228 + #_SC_TTY_NAME_MAX + +_SC_TTY_NAME_MAX + + + ) + +229 + m_SC_THREAD_DESTRUCTOR_ITERATIONS +, + +230 + #_SC_THREAD_DESTRUCTOR_ITERATIONS + +_SC_THREAD_DESTRUCTOR_ITERATIONS + + + ) + +231 + m_SC_THREAD_KEYS_MAX +, + +232 + #_SC_THREAD_KEYS_MAX + +_SC_THREAD_KEYS_MAX + + + ) + +233 + m_SC_THREAD_STACK_MIN +, + +234 + #_SC_THREAD_STACK_MIN + +_SC_THREAD_STACK_MIN + + + ) + +235 + m_SC_THREAD_THREADS_MAX +, + +236 + #_SC_THREAD_THREADS_MAX + +_SC_THREAD_THREADS_MAX + + + ) + +237 + m_SC_THREAD_ATTR_STACKADDR +, + +238 + #_SC_THREAD_ATTR_STACKADDR + +_SC_THREAD_ATTR_STACKADDR + + + ) + +239 + m_SC_THREAD_ATTR_STACKSIZE +, + +240 + #_SC_THREAD_ATTR_STACKSIZE + +_SC_THREAD_ATTR_STACKSIZE + + + ) + +241 + m_SC_THREAD_PRIORITY_SCHEDULING +, + +242 + #_SC_THREAD_PRIORITY_SCHEDULING + +_SC_THREAD_PRIORITY_SCHEDULING + + + ) + +243 + m_SC_THREAD_PRIO_INHERIT +, + +244 + #_SC_THREAD_PRIO_INHERIT + +_SC_THREAD_PRIO_INHERIT + + + ) + +245 + m_SC_THREAD_PRIO_PROTECT +, + +246 + #_SC_THREAD_PRIO_PROTECT + +_SC_THREAD_PRIO_PROTECT + + + ) + +247 + m_SC_THREAD_PROCESS_SHARED +, + +248 + #_SC_THREAD_PROCESS_SHARED + +_SC_THREAD_PROCESS_SHARED + + + ) + +250 + m_SC_NPROCESSORS_CONF +, + +251 + #_SC_NPROCESSORS_CONF + +_SC_NPROCESSORS_CONF + + + ) + +252 + m_SC_NPROCESSORS_ONLN +, + +253 + #_SC_NPROCESSORS_ONLN + +_SC_NPROCESSORS_ONLN + + + ) + +254 + m_SC_PHYS_PAGES +, + +255 + #_SC_PHYS_PAGES + +_SC_PHYS_PAGES + + + ) + +256 + m_SC_AVPHYS_PAGES +, + +257 + #_SC_AVPHYS_PAGES + +_SC_AVPHYS_PAGES + + + ) + +258 + m_SC_ATEXIT_MAX +, + +259 + #_SC_ATEXIT_MAX + +_SC_ATEXIT_MAX + + + ) + +260 + m_SC_PASS_MAX +, + +261 + #_SC_PASS_MAX + +_SC_PASS_MAX + + + ) + +263 + m_SC_XOPEN_VERSION +, + +264 + #_SC_XOPEN_VERSION + +_SC_XOPEN_VERSION + + + ) + +265 + m_SC_XOPEN_XCU_VERSION +, + +266 + #_SC_XOPEN_XCU_VERSION + +_SC_XOPEN_XCU_VERSION + + + ) + +267 + m_SC_XOPEN_UNIX +, + +268 + #_SC_XOPEN_UNIX + +_SC_XOPEN_UNIX + + + ) + +269 + m_SC_XOPEN_CRYPT +, + +270 + #_SC_XOPEN_CRYPT + +_SC_XOPEN_CRYPT + + + ) + +271 + m_SC_XOPEN_ENH_I18N +, + +272 + #_SC_XOPEN_ENH_I18N + +_SC_XOPEN_ENH_I18N + + + ) + +273 + m_SC_XOPEN_SHM +, + +274 + #_SC_XOPEN_SHM + +_SC_XOPEN_SHM + + + ) + +276 + m_SC_2_CHAR_TERM +, + +277 + #_SC_2_CHAR_TERM + +_SC_2_CHAR_TERM + + + ) + +278 + m_SC_2_C_VERSION +, + +279 + #_SC_2_C_VERSION + +_SC_2_C_VERSION + + + ) + +280 + m_SC_2_UPE +, + +281 + #_SC_2_UPE + +_SC_2_UPE + + + ) + +283 + m_SC_XOPEN_XPG2 +, + +284 + #_SC_XOPEN_XPG2 + +_SC_XOPEN_XPG2 + + + ) + +285 + m_SC_XOPEN_XPG3 +, + +286 + #_SC_XOPEN_XPG3 + +_SC_XOPEN_XPG3 + + + ) + +287 + m_SC_XOPEN_XPG4 +, + +288 + #_SC_XOPEN_XPG4 + +_SC_XOPEN_XPG4 + + + ) + +290 + m_SC_CHAR_BIT +, + +291 + #_SC_CHAR_BIT + +_SC_CHAR_BIT + + + ) + +292 + m_SC_CHAR_MAX +, + +293 + #_SC_CHAR_MAX + +_SC_CHAR_MAX + + + ) + +294 + m_SC_CHAR_MIN +, + +295 + #_SC_CHAR_MIN + +_SC_CHAR_MIN + + + ) + +296 + m_SC_INT_MAX +, + +297 + #_SC_INT_MAX + +_SC_INT_MAX + + + ) + +298 + m_SC_INT_MIN +, + +299 + #_SC_INT_MIN + +_SC_INT_MIN + + + ) + +300 + m_SC_LONG_BIT +, + +301 + #_SC_LONG_BIT + +_SC_LONG_BIT + + + ) + +302 + m_SC_WORD_BIT +, + +303 + #_SC_WORD_BIT + +_SC_WORD_BIT + + + ) + +304 + m_SC_MB_LEN_MAX +, + +305 + #_SC_MB_LEN_MAX + +_SC_MB_LEN_MAX + + + ) + +306 + m_SC_NZERO +, + +307 + #_SC_NZERO + +_SC_NZERO + + + ) + +308 + m_SC_SSIZE_MAX +, + +309 + #_SC_SSIZE_MAX + +_SC_SSIZE_MAX + + + ) + +310 + m_SC_SCHAR_MAX +, + +311 + #_SC_SCHAR_MAX + +_SC_SCHAR_MAX + + + ) + +312 + m_SC_SCHAR_MIN +, + +313 + #_SC_SCHAR_MIN + +_SC_SCHAR_MIN + + + ) + +314 + m_SC_SHRT_MAX +, + +315 + #_SC_SHRT_MAX + +_SC_SHRT_MAX + + + ) + +316 + m_SC_SHRT_MIN +, + +317 + #_SC_SHRT_MIN + +_SC_SHRT_MIN + + + ) + +318 + m_SC_UCHAR_MAX +, + +319 + #_SC_UCHAR_MAX + +_SC_UCHAR_MAX + + + ) + +320 + m_SC_UINT_MAX +, + +321 + #_SC_UINT_MAX + +_SC_UINT_MAX + + + ) + +322 + m_SC_ULONG_MAX +, + +323 + #_SC_ULONG_MAX + +_SC_ULONG_MAX + + + ) + +324 + m_SC_USHRT_MAX +, + +325 + #_SC_USHRT_MAX + +_SC_USHRT_MAX + + + ) + +327 + m_SC_NL_ARGMAX +, + +328 + #_SC_NL_ARGMAX + +_SC_NL_ARGMAX + + + ) + +329 + m_SC_NL_LANGMAX +, + +330 + #_SC_NL_LANGMAX + +_SC_NL_LANGMAX + + + ) + +331 + m_SC_NL_MSGMAX +, + +332 + #_SC_NL_MSGMAX + +_SC_NL_MSGMAX + + + ) + +333 + m_SC_NL_NMAX +, + +334 + #_SC_NL_NMAX + +_SC_NL_NMAX + + + ) + +335 + m_SC_NL_SETMAX +, + +336 + #_SC_NL_SETMAX + +_SC_NL_SETMAX + + + ) + +337 + m_SC_NL_TEXTMAX +, + +338 + #_SC_NL_TEXTMAX + +_SC_NL_TEXTMAX + + + ) + +340 + m_SC_XBS5_ILP32_OFF32 +, + +341 + #_SC_XBS5_ILP32_OFF32 + +_SC_XBS5_ILP32_OFF32 + + + ) + +342 + m_SC_XBS5_ILP32_OFFBIG +, + +343 + #_SC_XBS5_ILP32_OFFBIG + +_SC_XBS5_ILP32_OFFBIG + + + ) + +344 + m_SC_XBS5_LP64_OFF64 +, + +345 + #_SC_XBS5_LP64_OFF64 + +_SC_XBS5_LP64_OFF64 + + + ) + +346 + m_SC_XBS5_LPBIG_OFFBIG +, + +347 + #_SC_XBS5_LPBIG_OFFBIG + +_SC_XBS5_LPBIG_OFFBIG + + + ) + +349 + m_SC_XOPEN_LEGACY +, + +350 + #_SC_XOPEN_LEGACY + +_SC_XOPEN_LEGACY + + + ) + +351 + m_SC_XOPEN_REALTIME +, + +352 + #_SC_XOPEN_REALTIME + +_SC_XOPEN_REALTIME + + + ) + +353 + m_SC_XOPEN_REALTIME_THREADS +, + +354 + #_SC_XOPEN_REALTIME_THREADS + +_SC_XOPEN_REALTIME_THREADS + + + ) + +356 + m_SC_ADVISORY_INFO +, + +357 + #_SC_ADVISORY_INFO + +_SC_ADVISORY_INFO + + + ) + +358 + m_SC_BARRIERS +, + +359 + #_SC_BARRIERS + +_SC_BARRIERS + + + ) + +360 + m_SC_BASE +, + +361 + #_SC_BASE + +_SC_BASE + + + ) + +362 + m_SC_C_LANG_SUPPORT +, + +363 + #_SC_C_LANG_SUPPORT + +_SC_C_LANG_SUPPORT + + + ) + +364 + m_SC_C_LANG_SUPPORT_R +, + +365 + #_SC_C_LANG_SUPPORT_R + +_SC_C_LANG_SUPPORT_R + + + ) + +366 + m_SC_CLOCK_SELECTION +, + +367 + #_SC_CLOCK_SELECTION + +_SC_CLOCK_SELECTION + + + ) + +368 + m_SC_CPUTIME +, + +369 + #_SC_CPUTIME + +_SC_CPUTIME + + + ) + +370 + m_SC_THREAD_CPUTIME +, + +371 + #_SC_THREAD_CPUTIME + +_SC_THREAD_CPUTIME + + + ) + +372 + m_SC_DEVICE_IO +, + +373 + #_SC_DEVICE_IO + +_SC_DEVICE_IO + + + ) + +374 + m_SC_DEVICE_SPECIFIC +, + +375 + #_SC_DEVICE_SPECIFIC + +_SC_DEVICE_SPECIFIC + + + ) + +376 + m_SC_DEVICE_SPECIFIC_R +, + +377 + #_SC_DEVICE_SPECIFIC_R + +_SC_DEVICE_SPECIFIC_R + + + ) + +378 + m_SC_FD_MGMT +, + +379 + #_SC_FD_MGMT + +_SC_FD_MGMT + + + ) + +380 + m_SC_FIFO +, + +381 + #_SC_FIFO + +_SC_FIFO + + + ) + +382 + m_SC_PIPE +, + +383 + #_SC_PIPE + +_SC_PIPE + + + ) + +384 + m_SC_FILE_ATTRIBUTES +, + +385 + #_SC_FILE_ATTRIBUTES + +_SC_FILE_ATTRIBUTES + + + ) + +386 + m_SC_FILE_LOCKING +, + +387 + #_SC_FILE_LOCKING + +_SC_FILE_LOCKING + + + ) + +388 + m_SC_FILE_SYSTEM +, + +389 + #_SC_FILE_SYSTEM + +_SC_FILE_SYSTEM + + + ) + +390 + m_SC_MONOTONIC_CLOCK +, + +391 + #_SC_MONOTONIC_CLOCK + +_SC_MONOTONIC_CLOCK + + + ) + +392 + m_SC_MULTI_PROCESS +, + +393 + #_SC_MULTI_PROCESS + +_SC_MULTI_PROCESS + + + ) + +394 + m_SC_SINGLE_PROCESS +, + +395 + #_SC_SINGLE_PROCESS + +_SC_SINGLE_PROCESS + + + ) + +396 + m_SC_NETWORKING +, + +397 + #_SC_NETWORKING + +_SC_NETWORKING + + + ) + +398 + m_SC_READER_WRITER_LOCKS +, + +399 + #_SC_READER_WRITER_LOCKS + +_SC_READER_WRITER_LOCKS + + + ) + +400 + m_SC_SPIN_LOCKS +, + +401 + #_SC_SPIN_LOCKS + +_SC_SPIN_LOCKS + + + ) + +402 + m_SC_REGEXP +, + +403 + #_SC_REGEXP + +_SC_REGEXP + + + ) + +404 + m_SC_REGEX_VERSION +, + +405 + #_SC_REGEX_VERSION + +_SC_REGEX_VERSION + + + ) + +406 + m_SC_SHELL +, + +407 + #_SC_SHELL + +_SC_SHELL + + + ) + +408 + m_SC_SIGNALS +, + +409 + #_SC_SIGNALS + +_SC_SIGNALS + + + ) + +410 + m_SC_SPAWN +, + +411 + #_SC_SPAWN + +_SC_SPAWN + + + ) + +412 + m_SC_SPORADIC_SERVER +, + +413 + #_SC_SPORADIC_SERVER + +_SC_SPORADIC_SERVER + + + ) + +414 + m_SC_THREAD_SPORADIC_SERVER +, + +415 + #_SC_THREAD_SPORADIC_SERVER + +_SC_THREAD_SPORADIC_SERVER + + + ) + +416 + m_SC_SYSTEM_DATABASE +, + +417 + #_SC_SYSTEM_DATABASE + +_SC_SYSTEM_DATABASE + + + ) + +418 + m_SC_SYSTEM_DATABASE_R +, + +419 + #_SC_SYSTEM_DATABASE_R + +_SC_SYSTEM_DATABASE_R + + + ) + +420 + m_SC_TIMEOUTS +, + +421 + #_SC_TIMEOUTS + +_SC_TIMEOUTS + + + ) + +422 + m_SC_TYPED_MEMORY_OBJECTS +, + +423 + #_SC_TYPED_MEMORY_OBJECTS + +_SC_TYPED_MEMORY_OBJECTS + + + ) + +424 + m_SC_USER_GROUPS +, + +425 + #_SC_USER_GROUPS + +_SC_USER_GROUPS + + + ) + +426 + m_SC_USER_GROUPS_R +, + +427 + #_SC_USER_GROUPS_R + +_SC_USER_GROUPS_R + + + ) + +428 + m_SC_2_PBS +, + +429 + #_SC_2_PBS + +_SC_2_PBS + + + ) + +430 + m_SC_2_PBS_ACCOUNTING +, + +431 + #_SC_2_PBS_ACCOUNTING + +_SC_2_PBS_ACCOUNTING + + + ) + +432 + m_SC_2_PBS_LOCATE +, + +433 + #_SC_2_PBS_LOCATE + +_SC_2_PBS_LOCATE + + + ) + +434 + m_SC_2_PBS_MESSAGE +, + +435 + #_SC_2_PBS_MESSAGE + +_SC_2_PBS_MESSAGE + + + ) + +436 + m_SC_2_PBS_TRACK +, + +437 + #_SC_2_PBS_TRACK + +_SC_2_PBS_TRACK + + + ) + +438 + m_SC_SYMLOOP_MAX +, + +439 + #_SC_SYMLOOP_MAX + +_SC_SYMLOOP_MAX + + + ) + +440 + m_SC_STREAMS +, + +441 + #_SC_STREAMS + +_SC_STREAMS + + + ) + +442 + m_SC_2_PBS_CHECKPOINT +, + +443 + #_SC_2_PBS_CHECKPOINT + +_SC_2_PBS_CHECKPOINT + + + ) + +445 + m_SC_V6_ILP32_OFF32 +, + +446 + #_SC_V6_ILP32_OFF32 + +_SC_V6_ILP32_OFF32 + + + ) + +447 + m_SC_V6_ILP32_OFFBIG +, + +448 + #_SC_V6_ILP32_OFFBIG + +_SC_V6_ILP32_OFFBIG + + + ) + +449 + m_SC_V6_LP64_OFF64 +, + +450 + #_SC_V6_LP64_OFF64 + +_SC_V6_LP64_OFF64 + + + ) + +451 + m_SC_V6_LPBIG_OFFBIG +, + +452 + #_SC_V6_LPBIG_OFFBIG + +_SC_V6_LPBIG_OFFBIG + + + ) + +454 + m_SC_HOST_NAME_MAX +, + +455 + #_SC_HOST_NAME_MAX + +_SC_HOST_NAME_MAX + + + ) + +456 + m_SC_TRACE +, + +457 + #_SC_TRACE + +_SC_TRACE + + + ) + +458 + m_SC_TRACE_EVENT_FILTER +, + +459 + #_SC_TRACE_EVENT_FILTER + +_SC_TRACE_EVENT_FILTER + + + ) + +460 + m_SC_TRACE_INHERIT +, + +461 + #_SC_TRACE_INHERIT + +_SC_TRACE_INHERIT + + + ) + +462 + m_SC_TRACE_LOG +, + +463 + #_SC_TRACE_LOG + +_SC_TRACE_LOG + + + ) + +465 + m_SC_LEVEL1_ICACHE_SIZE +, + +466 + #_SC_LEVEL1_ICACHE_SIZE + +_SC_LEVEL1_ICACHE_SIZE + + + ) + +467 + m_SC_LEVEL1_ICACHE_ASSOC +, + +468 + #_SC_LEVEL1_ICACHE_ASSOC + +_SC_LEVEL1_ICACHE_ASSOC + + + ) + +469 + m_SC_LEVEL1_ICACHE_LINESIZE +, + +470 + #_SC_LEVEL1_ICACHE_LINESIZE + +_SC_LEVEL1_ICACHE_LINESIZE + + + ) + +471 + m_SC_LEVEL1_DCACHE_SIZE +, + +472 + #_SC_LEVEL1_DCACHE_SIZE + +_SC_LEVEL1_DCACHE_SIZE + + + ) + +473 + m_SC_LEVEL1_DCACHE_ASSOC +, + +474 + #_SC_LEVEL1_DCACHE_ASSOC + +_SC_LEVEL1_DCACHE_ASSOC + + + ) + +475 + m_SC_LEVEL1_DCACHE_LINESIZE +, + +476 + #_SC_LEVEL1_DCACHE_LINESIZE + +_SC_LEVEL1_DCACHE_LINESIZE + + + ) + +477 + m_SC_LEVEL2_CACHE_SIZE +, + +478 + #_SC_LEVEL2_CACHE_SIZE + +_SC_LEVEL2_CACHE_SIZE + + + ) + +479 + m_SC_LEVEL2_CACHE_ASSOC +, + +480 + #_SC_LEVEL2_CACHE_ASSOC + +_SC_LEVEL2_CACHE_ASSOC + + + ) + +481 + m_SC_LEVEL2_CACHE_LINESIZE +, + +482 + #_SC_LEVEL2_CACHE_LINESIZE + +_SC_LEVEL2_CACHE_LINESIZE + + + ) + +483 + m_SC_LEVEL3_CACHE_SIZE +, + +484 + #_SC_LEVEL3_CACHE_SIZE + +_SC_LEVEL3_CACHE_SIZE + + + ) + +485 + m_SC_LEVEL3_CACHE_ASSOC +, + +486 + #_SC_LEVEL3_CACHE_ASSOC + +_SC_LEVEL3_CACHE_ASSOC + + + ) + +487 + m_SC_LEVEL3_CACHE_LINESIZE +, + +488 + #_SC_LEVEL3_CACHE_LINESIZE + +_SC_LEVEL3_CACHE_LINESIZE + + + ) + +489 + m_SC_LEVEL4_CACHE_SIZE +, + +490 + #_SC_LEVEL4_CACHE_SIZE + +_SC_LEVEL4_CACHE_SIZE + + + ) + +491 + m_SC_LEVEL4_CACHE_ASSOC +, + +492 + #_SC_LEVEL4_CACHE_ASSOC + +_SC_LEVEL4_CACHE_ASSOC + + + ) + +493 + m_SC_LEVEL4_CACHE_LINESIZE +, + +494 + #_SC_LEVEL4_CACHE_LINESIZE + +_SC_LEVEL4_CACHE_LINESIZE + + + ) + +497 + m_SC_IPV6 + = +_SC_LEVEL1_ICACHE_SIZE + + 50, + +498 + #_SC_IPV6 + +_SC_IPV6 + + + ) + +499 + m_SC_RAW_SOCKETS +, + +500 + #_SC_RAW_SOCKETS + +_SC_RAW_SOCKETS + + + ) + +502 + m_SC_V7_ILP32_OFF32 +, + +503 + #_SC_V7_ILP32_OFF32 + +_SC_V7_ILP32_OFF32 + + + ) + +504 + m_SC_V7_ILP32_OFFBIG +, + +505 + #_SC_V7_ILP32_OFFBIG + +_SC_V7_ILP32_OFFBIG + + + ) + +506 + m_SC_V7_LP64_OFF64 +, + +507 + #_SC_V7_LP64_OFF64 + +_SC_V7_LP64_OFF64 + + + ) + +508 + m_SC_V7_LPBIG_OFFBIG +, + +509 + #_SC_V7_LPBIG_OFFBIG + +_SC_V7_LPBIG_OFFBIG + + + ) + +511 + m_SC_SS_REPL_MAX +, + +512 + #_SC_SS_REPL_MAX + +_SC_SS_REPL_MAX + + + ) + +514 + m_SC_TRACE_EVENT_NAME_MAX +, + +515 + #_SC_TRACE_EVENT_NAME_MAX + +_SC_TRACE_EVENT_NAME_MAX + + + ) + +516 + m_SC_TRACE_NAME_MAX +, + +517 + #_SC_TRACE_NAME_MAX + +_SC_TRACE_NAME_MAX + + + ) + +518 + m_SC_TRACE_SYS_MAX +, + +519 + #_SC_TRACE_SYS_MAX + +_SC_TRACE_SYS_MAX + + + ) + +520 + m_SC_TRACE_USER_EVENT_MAX +, + +521 + #_SC_TRACE_USER_EVENT_MAX + +_SC_TRACE_USER_EVENT_MAX + + + ) + +523 + m_SC_XOPEN_STREAMS +, + +524 + #_SC_XOPEN_STREAMS + +_SC_XOPEN_STREAMS + + + ) + +526 + m_SC_THREAD_ROBUST_PRIO_INHERIT +, + +527 + #_SC_THREAD_ROBUST_PRIO_INHERIT + +_SC_THREAD_ROBUST_PRIO_INHERIT + + + ) + +528 + m_SC_THREAD_ROBUST_PRIO_PROTECT + + +529 + #_SC_THREAD_ROBUST_PRIO_PROTECT + +_SC_THREAD_ROBUST_PRIO_PROTECT + + + ) + +535 + m_CS_PATH +, + +536 + #_CS_PATH + +_CS_PATH + + + ) + +538 + m_CS_V6_WIDTH_RESTRICTED_ENVS +, + +539 + #_CS_V6_WIDTH_RESTRICTED_ENVS + +_CS_V6_WIDTH_RESTRICTED_ENVS + + + ) + +540 + #_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS + +_CS_V6_WIDTH_RESTRICTED_ENVS + + + ) + +542 + m_CS_GNU_LIBC_VERSION +, + +543 + #_CS_GNU_LIBC_VERSION + +_CS_GNU_LIBC_VERSION + + + ) + +544 + m_CS_GNU_LIBPTHREAD_VERSION +, + +545 + #_CS_GNU_LIBPTHREAD_VERSION + +_CS_GNU_LIBPTHREAD_VERSION + + + ) + +547 + m_CS_V5_WIDTH_RESTRICTED_ENVS +, + +548 + #_CS_V5_WIDTH_RESTRICTED_ENVS + +_CS_V5_WIDTH_RESTRICTED_ENVS + + + ) + +549 + #_CS_POSIX_V5_WIDTH_RESTRICTED_ENVS + +_CS_V5_WIDTH_RESTRICTED_ENVS + + + ) + +551 + m_CS_V7_WIDTH_RESTRICTED_ENVS +, + +552 + #_CS_V7_WIDTH_RESTRICTED_ENVS + +_CS_V7_WIDTH_RESTRICTED_ENVS + + + ) + +553 + #_CS_POSIX_V7_WIDTH_RESTRICTED_ENVS + +_CS_V7_WIDTH_RESTRICTED_ENVS + + + ) + +555 + m_CS_LFS_CFLAGS + = 1000, + +556 + #_CS_LFS_CFLAGS + +_CS_LFS_CFLAGS + + + ) + +557 + m_CS_LFS_LDFLAGS +, + +558 + #_CS_LFS_LDFLAGS + +_CS_LFS_LDFLAGS + + + ) + +559 + m_CS_LFS_LIBS +, + +560 + #_CS_LFS_LIBS + +_CS_LFS_LIBS + + + ) + +561 + m_CS_LFS_LINTFLAGS +, + +562 + #_CS_LFS_LINTFLAGS + +_CS_LFS_LINTFLAGS + + + ) + +563 + m_CS_LFS64_CFLAGS +, + +564 + #_CS_LFS64_CFLAGS + +_CS_LFS64_CFLAGS + + + ) + +565 + m_CS_LFS64_LDFLAGS +, + +566 + #_CS_LFS64_LDFLAGS + +_CS_LFS64_LDFLAGS + + + ) + +567 + m_CS_LFS64_LIBS +, + +568 + #_CS_LFS64_LIBS + +_CS_LFS64_LIBS + + + ) + +569 + m_CS_LFS64_LINTFLAGS +, + +570 + #_CS_LFS64_LINTFLAGS + +_CS_LFS64_LINTFLAGS + + + ) + +572 + m_CS_XBS5_ILP32_OFF32_CFLAGS + = 1100, + +573 + #_CS_XBS5_ILP32_OFF32_CFLAGS + +_CS_XBS5_ILP32_OFF32_CFLAGS + + + ) + +574 + m_CS_XBS5_ILP32_OFF32_LDFLAGS +, + +575 + #_CS_XBS5_ILP32_OFF32_LDFLAGS + +_CS_XBS5_ILP32_OFF32_LDFLAGS + + + ) + +576 + m_CS_XBS5_ILP32_OFF32_LIBS +, + +577 + #_CS_XBS5_ILP32_OFF32_LIBS + +_CS_XBS5_ILP32_OFF32_LIBS + + + ) + +578 + m_CS_XBS5_ILP32_OFF32_LINTFLAGS +, + +579 + #_CS_XBS5_ILP32_OFF32_LINTFLAGS + +_CS_XBS5_ILP32_OFF32_LINTFLAGS + + + ) + +580 + m_CS_XBS5_ILP32_OFFBIG_CFLAGS +, + +581 + #_CS_XBS5_ILP32_OFFBIG_CFLAGS + +_CS_XBS5_ILP32_OFFBIG_CFLAGS + + + ) + +582 + m_CS_XBS5_ILP32_OFFBIG_LDFLAGS +, + +583 + #_CS_XBS5_ILP32_OFFBIG_LDFLAGS + +_CS_XBS5_ILP32_OFFBIG_LDFLAGS + + + ) + +584 + m_CS_XBS5_ILP32_OFFBIG_LIBS +, + +585 + #_CS_XBS5_ILP32_OFFBIG_LIBS + +_CS_XBS5_ILP32_OFFBIG_LIBS + + + ) + +586 + m_CS_XBS5_ILP32_OFFBIG_LINTFLAGS +, + +587 + #_CS_XBS5_ILP32_OFFBIG_LINTFLAGS + +_CS_XBS5_ILP32_OFFBIG_LINTFLAGS + + + ) + +588 + m_CS_XBS5_LP64_OFF64_CFLAGS +, + +589 + #_CS_XBS5_LP64_OFF64_CFLAGS + +_CS_XBS5_LP64_OFF64_CFLAGS + + + ) + +590 + m_CS_XBS5_LP64_OFF64_LDFLAGS +, + +591 + #_CS_XBS5_LP64_OFF64_LDFLAGS + +_CS_XBS5_LP64_OFF64_LDFLAGS + + + ) + +592 + m_CS_XBS5_LP64_OFF64_LIBS +, + +593 + #_CS_XBS5_LP64_OFF64_LIBS + +_CS_XBS5_LP64_OFF64_LIBS + + + ) + +594 + m_CS_XBS5_LP64_OFF64_LINTFLAGS +, + +595 + #_CS_XBS5_LP64_OFF64_LINTFLAGS + +_CS_XBS5_LP64_OFF64_LINTFLAGS + + + ) + +596 + m_CS_XBS5_LPBIG_OFFBIG_CFLAGS +, + +597 + #_CS_XBS5_LPBIG_OFFBIG_CFLAGS + +_CS_XBS5_LPBIG_OFFBIG_CFLAGS + + + ) + +598 + m_CS_XBS5_LPBIG_OFFBIG_LDFLAGS +, + +599 + #_CS_XBS5_LPBIG_OFFBIG_LDFLAGS + +_CS_XBS5_LPBIG_OFFBIG_LDFLAGS + + + ) + +600 + m_CS_XBS5_LPBIG_OFFBIG_LIBS +, + +601 + #_CS_XBS5_LPBIG_OFFBIG_LIBS + +_CS_XBS5_LPBIG_OFFBIG_LIBS + + + ) + +602 + m_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS +, + +603 + #_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS + +_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS + + + ) + +605 + m_CS_POSIX_V6_ILP32_OFF32_CFLAGS +, + +606 + #_CS_POSIX_V6_ILP32_OFF32_CFLAGS + +_CS_POSIX_V6_ILP32_OFF32_CFLAGS + + + ) + +607 + m_CS_POSIX_V6_ILP32_OFF32_LDFLAGS +, + +608 + #_CS_POSIX_V6_ILP32_OFF32_LDFLAGS + +_CS_POSIX_V6_ILP32_OFF32_LDFLAGS + + + ) + +609 + m_CS_POSIX_V6_ILP32_OFF32_LIBS +, + +610 + #_CS_POSIX_V6_ILP32_OFF32_LIBS + +_CS_POSIX_V6_ILP32_OFF32_LIBS + + + ) + +611 + m_CS_POSIX_V6_ILP32_OFF32_LINTFLAGS +, + +612 + #_CS_POSIX_V6_ILP32_OFF32_LINTFLAGS + +_CS_POSIX_V6_ILP32_OFF32_LINTFLAGS + + + ) + +613 + m_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS +, + +614 + #_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS + +_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS + + + ) + +615 + m_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS +, + +616 + #_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS + +_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS + + + ) + +617 + m_CS_POSIX_V6_ILP32_OFFBIG_LIBS +, + +618 + #_CS_POSIX_V6_ILP32_OFFBIG_LIBS + +_CS_POSIX_V6_ILP32_OFFBIG_LIBS + + + ) + +619 + m_CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS +, + +620 + #_CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS + +_CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS + + + ) + +621 + m_CS_POSIX_V6_LP64_OFF64_CFLAGS +, + +622 + #_CS_POSIX_V6_LP64_OFF64_CFLAGS + +_CS_POSIX_V6_LP64_OFF64_CFLAGS + + + ) + +623 + m_CS_POSIX_V6_LP64_OFF64_LDFLAGS +, + +624 + #_CS_POSIX_V6_LP64_OFF64_LDFLAGS + +_CS_POSIX_V6_LP64_OFF64_LDFLAGS + + + ) + +625 + m_CS_POSIX_V6_LP64_OFF64_LIBS +, + +626 + #_CS_POSIX_V6_LP64_OFF64_LIBS + +_CS_POSIX_V6_LP64_OFF64_LIBS + + + ) + +627 + m_CS_POSIX_V6_LP64_OFF64_LINTFLAGS +, + +628 + #_CS_POSIX_V6_LP64_OFF64_LINTFLAGS + +_CS_POSIX_V6_LP64_OFF64_LINTFLAGS + + + ) + +629 + m_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS +, + +630 + #_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS + +_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS + + + ) + +631 + m_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS +, + +632 + #_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS + +_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS + + + ) + +633 + m_CS_POSIX_V6_LPBIG_OFFBIG_LIBS +, + +634 + #_CS_POSIX_V6_LPBIG_OFFBIG_LIBS + +_CS_POSIX_V6_LPBIG_OFFBIG_LIBS + + + ) + +635 + m_CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS +, + +636 + #_CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS + +_CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS + + + ) + +638 + m_CS_POSIX_V7_ILP32_OFF32_CFLAGS +, + +639 + #_CS_POSIX_V7_ILP32_OFF32_CFLAGS + +_CS_POSIX_V7_ILP32_OFF32_CFLAGS + + + ) + +640 + m_CS_POSIX_V7_ILP32_OFF32_LDFLAGS +, + +641 + #_CS_POSIX_V7_ILP32_OFF32_LDFLAGS + +_CS_POSIX_V7_ILP32_OFF32_LDFLAGS + + + ) + +642 + m_CS_POSIX_V7_ILP32_OFF32_LIBS +, + +643 + #_CS_POSIX_V7_ILP32_OFF32_LIBS + +_CS_POSIX_V7_ILP32_OFF32_LIBS + + + ) + +644 + m_CS_POSIX_V7_ILP32_OFF32_LINTFLAGS +, + +645 + #_CS_POSIX_V7_ILP32_OFF32_LINTFLAGS + +_CS_POSIX_V7_ILP32_OFF32_LINTFLAGS + + + ) + +646 + m_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS +, + +647 + #_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS + +_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS + + + ) + +648 + m_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS +, + +649 + #_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS + +_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS + + + ) + +650 + m_CS_POSIX_V7_ILP32_OFFBIG_LIBS +, + +651 + #_CS_POSIX_V7_ILP32_OFFBIG_LIBS + +_CS_POSIX_V7_ILP32_OFFBIG_LIBS + + + ) + +652 + m_CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS +, + +653 + #_CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS + +_CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS + + + ) + +654 + m_CS_POSIX_V7_LP64_OFF64_CFLAGS +, + +655 + #_CS_POSIX_V7_LP64_OFF64_CFLAGS + +_CS_POSIX_V7_LP64_OFF64_CFLAGS + + + ) + +656 + m_CS_POSIX_V7_LP64_OFF64_LDFLAGS +, + +657 + #_CS_POSIX_V7_LP64_OFF64_LDFLAGS + +_CS_POSIX_V7_LP64_OFF64_LDFLAGS + + + ) + +658 + m_CS_POSIX_V7_LP64_OFF64_LIBS +, + +659 + #_CS_POSIX_V7_LP64_OFF64_LIBS + +_CS_POSIX_V7_LP64_OFF64_LIBS + + + ) + +660 + m_CS_POSIX_V7_LP64_OFF64_LINTFLAGS +, + +661 + #_CS_POSIX_V7_LP64_OFF64_LINTFLAGS + +_CS_POSIX_V7_LP64_OFF64_LINTFLAGS + + + ) + +662 + m_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS +, + +663 + #_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS + +_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS + + + ) + +664 + m_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS +, + +665 + #_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS + +_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS + + + ) + +666 + m_CS_POSIX_V7_LPBIG_OFFBIG_LIBS +, + +667 + #_CS_POSIX_V7_LPBIG_OFFBIG_LIBS + +_CS_POSIX_V7_LPBIG_OFFBIG_LIBS + + + ) + +668 + m_CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS +, + +669 + #_CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS + +_CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS + + + ) + +671 + m_CS_V6_ENV +, + +672 + #_CS_V6_ENV + +_CS_V6_ENV + + + ) + +673 + m_CS_V7_ENV + + +674 + #_CS_V7_ENV + +_CS_V7_ENV + + + ) + + @/usr/include/bits/dirent.h + +18 #i�de� +_DIRENT_H + + +22 + sd��t + + +24 #i�de� +__USE_FILE_OFFSET64 + + +25 +__�o_t + + md_�o +; + +26 +__off_t + + md_off +; + +28 +__�o64_t + + md_�o +; + +29 +__off64_t + + md_off +; + +31 + md_��� +; + +32 + md_ty� +; + +33 + md_�me +[256]; + +36 #ifde� +__USE_LARGEFILE64 + + +37 + sd��t64 + + +39 +__�o64_t + + md_�o +; + +40 +__off64_t + + md_off +; + +41 + md_��� +; + +42 + md_ty� +; + +43 + md_�me +[256]; + +47 + #d_f��o + +d_�o + + + ) + +49 #unde� +_DIRENT_HAVE_D_NAMLEN + + +50 + #_DIRENT_HAVE_D_RECLEN + + + ) + +51 + #_DIRENT_HAVE_D_OFF + + + ) + +52 + #_DIRENT_HAVE_D_TYPE + + + ) + +54 #i� +def�ed + +__OFF_T_MATCHES_OFF64_T + && def�ed +__INO_T_MATCHES_INO64_T + + +56 + #_DIRENT_MATCHES_DIRENT64 + 1 + + ) + + @/usr/include/bits/dlfcn.h + +19 #i�de� +_DLFCN_H + + +24 + #RTLD_LAZY + 0x00001 + + ) + +25 + #RTLD_NOW + 0x00002 + + ) + +26 + #RTLD_BINDING_MASK + 0x3 + + ) + +27 + #RTLD_NOLOAD + 0x00004 + + ) + +28 + #RTLD_DEEPBIND + 0x00008 + + ) + +33 + #RTLD_GLOBAL + 0x00100 + + ) + +38 + #RTLD_LOCAL + 0 + + ) + +41 + #RTLD_NODELETE + 0x01000 + + ) + +43 #ifde� +__USE_GNU + + +54 + #DL_CALL_FCT +( +f�p +, +�gs +) \ + +55 ( + `_dl_mcou�_w���_check + ((*�( +f�p +)), (*(f�p)� +�gs +) + + ) + +57 +__BEGIN_DECLS + + +60 + $_dl_mcou�_w���_check + (* +__�l�c +� +__THROW +; + +62 +__END_DECLS + + + @/usr/include/bits/environments.h + +18 #i�de� +_UNISTD_H + + +22 + ~<b�s/w�dsize.h +> + +42 #i� +__WORDSIZE + == 64 + +56 + #_POSIX_V7_LPBIG_OFFBIG + -1 + + ) + +57 + #_POSIX_V6_LPBIG_OFFBIG + -1 + + ) + +58 + #_XBS5_LPBIG_OFFBIG + -1 + + ) + +61 + #_POSIX_V7_LP64_OFF64 + 1 + + ) + +62 + #_POSIX_V6_LP64_OFF64 + 1 + + ) + +63 + #_XBS5_LP64_OFF64 + 1 + + ) + +69 + #_POSIX_V7_ILP32_OFFBIG + 1 + + ) + +70 + #_POSIX_V6_ILP32_OFFBIG + 1 + + ) + +71 + #_XBS5_ILP32_OFFBIG + 1 + + ) + +73 #i�de� +__x86_64__ + + +75 + #_POSIX_V7_ILP32_OFF32 + 1 + + ) + +76 + #_POSIX_V6_ILP32_OFF32 + 1 + + ) + +77 + #_XBS5_ILP32_OFF32 + 1 + + ) + +95 + #__ILP32_OFF32_CFLAGS + "-m32" + + ) + +96 + #__ILP32_OFF32_LDFLAGS + "-m32" + + ) + +97 #i� +def�ed + +__x86_64__ + && def�ed +__ILP32__ + + +98 + #__ILP32_OFFBIG_CFLAGS + "-mx32" + + ) + +99 + #__ILP32_OFFBIG_LDFLAGS + "-mx32" + + ) + +101 + #__ILP32_OFFBIG_CFLAGS + "-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" + + ) + +102 + #__ILP32_OFFBIG_LDFLAGS + "-m32" + + ) + +104 + #__LP64_OFF64_CFLAGS + "-m64" + + ) + +105 + #__LP64_OFF64_LDFLAGS + "-m64" + + ) + + @/usr/include/bits/epoll.h + +18 #i�def +_SYS_EPOLL_H + + +25 + mEPOLL_CLOEXEC + = 02000000 + +26 + #EPOLL_CLOEXEC + +EPOLL_CLOEXEC + + + ) + +29 + #__EPOLL_PACKED + + `__��ibu�__ + (( +__�cked__ +)) + + ) + + @/usr/include/bits/errno.h + +19 #ifde� +_ERRNO_H + + +21 #unde� +EDOM + + +22 #unde� +EILSEQ + + +23 #unde� +ERANGE + + +24 + ~<l�ux/��o.h +> + +27 + #ENOTSUP + +EOPNOTSUPP + + + ) + +30 #i�de� +ECANCELED + + +31 + #ECANCELED + 125 + + ) + +35 #i�de� +EOWNERDEAD + + +36 + #EOWNERDEAD + 130 + + ) + +37 + #ENOTRECOVERABLE + 131 + + ) + +40 #i�de� +ERFKILL + + +41 + #ERFKILL + 132 + + ) + +44 #i�de� +EHWPOISON + + +45 + #EHWPOISON + 133 + + ) + +48 #i�de� +__ASSEMBLER__ + + +50 * + $__��o_lo�ti� + (� +__THROW + + `__��ibu�__ + (( +__cڡ__ +)); + +52 #i�! +def�ed + +_LIBC + || def�ed +_LIBC_REENTRANT + + +54 + #��o + (* + `__��o_lo�ti� + ()) + + ) + +59 #i�! +def�ed + +_ERRNO_H + && def�ed +__�ed_Em�h + + +63 + #EDOM + 33 + + ) + +64 + #EILSEQ + 84 + + ) + +65 + #ERANGE + 34 + + ) + + @/usr/include/bits/fcntl.h + +19 #i�de� +_FCNTL_H + + +23 #ifde� +__x86_64__ + + +24 + #__O_LARGEFILE + 0 + + ) + +27 #ifde� +__x86_64__ + + +29 + #F_GETLK64 + 5 + + ) + +30 + #F_SETLK64 + 6 + + ) + +31 + #F_SETLKW64 + 7 + + ) + +35 + s�ock + + +37 + ml_ty� +; + +38 + ml_wh�� +; + +39 #i�de� +__USE_FILE_OFFSET64 + + +40 +__off_t + + ml_��t +; + +41 +__off_t + + ml_�n +; + +43 +__off64_t + + ml_��t +; + +44 +__off64_t + + ml_�n +; + +46 +__pid_t + + ml_pid +; + +49 #ifde� +__USE_LARGEFILE64 + + +50 + s�ock64 + + +52 + ml_ty� +; + +53 + ml_wh�� +; + +54 +__off64_t + + ml_��t +; + +55 +__off64_t + + ml_�n +; + +56 +__pid_t + + ml_pid +; + +61 + ~<b�s/f��-l�ux.h +> + + @/usr/include/bits/fcntl2.h + +19 #i�def +_FCNTL_H + + +25 #i�de� +__USE_FILE_OFFSET64 + + +26 + $__ݒ_2 + (cڡ * +__�th +, +__o�ag +� + `__n�nu� + ((1)); + +27 + `__REDIRECT + ( +__ݒ_��s +, (cڡ * +__�th +, +__o�ag +, ...), + +28 +ݒ +� + `__n�nu� + ((1)); + +30 + `__REDIRECT + ( +__ݒ_2 +, (cڡ * +__�th +, +__o�ag +), + +31 +__ݒ64_2 +� + `__n�nu� + ((1)); + +32 + `__REDIRECT + ( +__ݒ_��s +, (cڡ * +__�th +, +__o�ag +, ...), + +33 +ݒ64 +� + `__n�nu� + ((1)); + +35 + `__�r�de� + ( +__ݒ_too_m�y_�gs +, + +37 + `__�r�de� + ( +__ݒ_miss�g_mode +, + +40 +__f�tify_fun�i� + + +41 + $ݒ + (cڡ * +__�th +, +__o�ag +, ...) + +43 i�( + `__va_�g_�ck_�n + () > 1) + +44 + `__ݒ_too_m�y_�gs + (); + +46 i�( + `__bu�t�_cڡ�t_p + ( +__o�ag +)) + +48 i�(( +__o�ag + & +O_CREAT +�!�0 && + `__va_�g_�ck_�n + () < 1) + +50 + `__ݒ_miss�g_mode + (); + +51 + `__ݒ_2 + ( +__�th +, +__o�ag +); + +53 + `__ݒ_��s + ( +__�th +, +__o�ag +, + `__va_�g_�ck + ()); + +56 i�( + `__va_�g_�ck_�n + () < 1) + +57 + `__ݒ_2 + ( +__�th +, +__o�ag +); + +59 + `__ݒ_��s + ( +__�th +, +__o�ag +, + `__va_�g_�ck + ()); + +60 + } +} + +63 #ifde� +__USE_LARGEFILE64 + + +64 + $__ݒ64_2 + (cڡ * +__�th +, +__o�ag +� + `__n�nu� + ((1)); + +65 + `__REDIRECT + ( +__ݒ64_��s +, (cڡ * +__�th +, +__o�ag +, + +66 ...), +ݒ64 +� + `__n�nu� + ((1)); + +67 + `__�r�de� + ( +__ݒ64_too_m�y_�gs +, + +69 + `__�r�de� + ( +__ݒ64_miss�g_mode +, + +72 +__f�tify_fun�i� + + +73 + $ݒ64 + (cڡ * +__�th +, +__o�ag +, ...) + +75 i�( + `__va_�g_�ck_�n + () > 1) + +76 + `__ݒ64_too_m�y_�gs + (); + +78 i�( + `__bu�t�_cڡ�t_p + ( +__o�ag +)) + +80 i�(( +__o�ag + & +O_CREAT +�!�0 && + `__va_�g_�ck_�n + () < 1) + +82 + `__ݒ64_miss�g_mode + (); + +83 + `__ݒ64_2 + ( +__�th +, +__o�ag +); + +85 + `__ݒ64_��s + ( +__�th +, +__o�ag +, + `__va_�g_�ck + ()); + +88 i�( + `__va_�g_�ck_�n + () < 1) + +89 + `__ݒ64_2 + ( +__�th +, +__o�ag +); + +91 + `__ݒ64_��s + ( +__�th +, +__o�ag +, + `__va_�g_�ck + ()); + +92 + } +} + +96 #ifde� +__USE_ATFILE + + +97 #i�de� +__USE_FILE_OFFSET64 + + +98 + $__ݒ�_2 + ( +__fd +, cڡ * +__�th +, +__o�ag +) + +99 + `__n�nu� + ((2)); + +100 + `__REDIRECT + ( +__ݒ�_��s +, ( +__fd +, cڡ * +__�th +, + +101 +__o�ag +, ...), +ݒ� +) + +102 + `__n�nu� + ((2)); + +104 + `__REDIRECT + ( +__ݒ�_2 +, ( +__fd +, cڡ * +__�th +, + +105 +__o�ag +), +__ݒ�64_2 +) + +106 + `__n�nu� + ((2)); + +107 + `__REDIRECT + ( +__ݒ�_��s +, ( +__fd +, cڡ * +__�th +, + +108 +__o�ag +, ...), +ݒ�64 +) + +109 + `__n�nu� + ((2)); + +111 + `__�r�de� + ( +__ݒ�_too_m�y_�gs +, + +113 + `__�r�de� + ( +__ݒ�_miss�g_mode +, + +116 +__f�tify_fun�i� + + +117 + $ݒ� + ( +__fd +, cڡ * +__�th +, +__o�ag +, ...) + +119 i�( + `__va_�g_�ck_�n + () > 1) + +120 + `__ݒ�_too_m�y_�gs + (); + +122 i�( + `__bu�t�_cڡ�t_p + ( +__o�ag +)) + +124 i�(( +__o�ag + & +O_CREAT +�!�0 && + `__va_�g_�ck_�n + () < 1) + +126 + `__ݒ�_miss�g_mode + (); + +127 + `__ݒ�_2 + ( +__fd +, +__�th +, +__o�ag +); + +129 + `__ݒ�_��s + ( +__fd +, +__�th +, +__o�ag +, + `__va_�g_�ck + ()); + +132 i�( + `__va_�g_�ck_�n + () < 1) + +133 + `__ݒ�_2 + ( +__fd +, +__�th +, +__o�ag +); + +135 + `__ݒ�_��s + ( +__fd +, +__�th +, +__o�ag +, + `__va_�g_�ck + ()); + +136 + } +} + +139 #ifde� +__USE_LARGEFILE64 + + +140 + $__ݒ�64_2 + ( +__fd +, cڡ * +__�th +, +__o�ag +) + +141 + `__n�nu� + ((2)); + +142 + `__REDIRECT + ( +__ݒ�64_��s +, ( +__fd +, cڡ * +__�th +, + +143 +__o�ag +, ...), +ݒ�64 +) + +144 + `__n�nu� + ((2)); + +145 + `__�r�de� + ( +__ݒ�64_too_m�y_�gs +, + +147 + `__�r�de� + ( +__ݒ�64_miss�g_mode +, + +150 +__f�tify_fun�i� + + +151 + $ݒ�64 + ( +__fd +, cڡ * +__�th +, +__o�ag +, ...) + +153 i�( + `__va_�g_�ck_�n + () > 1) + +154 + `__ݒ�64_too_m�y_�gs + (); + +156 i�( + `__bu�t�_cڡ�t_p + ( +__o�ag +)) + +158 i�(( +__o�ag + & +O_CREAT +�!�0 && + `__va_�g_�ck_�n + () < 1) + +160 + `__ݒ�64_miss�g_mode + (); + +161 + `__ݒ�64_2 + ( +__fd +, +__�th +, +__o�ag +); + +163 + `__ݒ�64_��s + ( +__fd +, +__�th +, +__o�ag +, + `__va_�g_�ck + ()); + +166 i�( + `__va_�g_�ck_�n + () < 1) + +167 + `__ݒ�64_2 + ( +__fd +, +__�th +, +__o�ag +); + +169 + `__ݒ�64_��s + ( +__fd +, +__�th +, +__o�ag +, + `__va_�g_�ck + ()); + +170 + } +} + + @/usr/include/bits/huge_val.h + +20 #i�de� +_MATH_H + + +26 #i� +__GNUC_PREREQ +(3,3) + +27 + #HUGE_VAL + ( + `__bu�t�_huge_v� +()) + + ) + +28 #�i� +__GNUC_PREREQ +(2,96) + +29 + #HUGE_VAL + ( +__ex�nsi�__ + 0x1.0 +p2047 +) + + ) + +30 #�i� +def�ed + +__GNUC__ + + +32 + #HUGE_VAL + \ + +33 ( +__ex�nsi�__ + \ + +34 ((uni� { +__l + + `__��ibu�__ +(( + `__mode__ +( +__DI__ +))); +__d +; }) \ + +35 { +__l +: 0x7ff0000000000000ULL }). +__d +) + + ) + +39 + ~<�d�n.h +> + +41 uni� { + m__c +[8]; + m__d +; } + t__huge_v�_t +; + +43 #i� +__BYTE_ORDER + =� +__BIG_ENDIAN + + +44 + #__HUGE_VAL_by�s + { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } + + ) + +46 #i� +__BYTE_ORDER + =� +__LITTLE_ENDIAN + + +47 + #__HUGE_VAL_by�s + { 0, 0, 0, 0, 0, 0, 0xf0, 0x7�} + + ) + +50 +__huge_v�_t + + g__huge_v� + = { +__HUGE_VAL_by�s + }; + +51 + #HUGE_VAL + ( +__huge_v� +. +__d +) + + ) + + @/usr/include/bits/huge_valf.h + +20 #i�de� +_MATH_H + + +26 #i� +__GNUC_PREREQ +(3,3) + +27 + #HUGE_VALF + ( + `__bu�t�_huge_v�f +()) + + ) + +28 #�i� +__GNUC_PREREQ +(2,96) + +29 + #HUGE_VALF + ( +__ex�nsi�__ + 0x1.0 +p255f +) + + ) + +30 #�i� +def�ed + +__GNUC__ + + +32 + #HUGE_VALF + \ + +33 ( +__ex�nsi�__ + \ + +34 ((uni� { +__l + + `__��ibu�__ +(( + `__mode__ +( +__SI__ +))); +__d +; }) \ + +35 { +__l +: 0x7f800000UL }). +__d +) + + ) + +39 uni� { + m__c +[4]; + m__f +; } + t__huge_v�f_t +; + +41 #i� +__BYTE_ORDER + =� +__BIG_ENDIAN + + +42 + #__HUGE_VALF_by�s + { 0x7f, 0x80, 0, 0 } + + ) + +44 #i� +__BYTE_ORDER + =� +__LITTLE_ENDIAN + + +45 + #__HUGE_VALF_by�s + { 0, 0, 0x80, 0x7�} + + ) + +48 +__huge_v�f_t + + g__huge_v�f + = { +__HUGE_VALF_by�s + }; + +49 + #HUGE_VALF + ( +__huge_v�f +. +__f +) + + ) + + @/usr/include/bits/huge_vall.h + +20 #i�de� +_MATH_H + + +24 #i� +__GNUC_PREREQ +(3,3) + +25 + #HUGE_VALL + ( + `__bu�t�_huge_v�l +()) + + ) + +26 #�i� +__GNUC_PREREQ +(2,96) + +27 + #HUGE_VALL + ( +__ex�nsi�__ + 0x1.0 +p32767L +) + + ) + +30 + #__HUGE_VALL_by�s + { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0x7f, 0, 0 } + + ) + +32 + #__huge_v�l_t + uni� { +__c +[12]; +__ld +; } + + ) + +33 #ifde� +__GNUC__ + + +34 + #HUGE_VALL + ( +__ex�nsi�__ + \ + +35 (( +__huge_v�l_t +�{ +__c +: +__HUGE_VALL_by�s + }). +__ld +) + + ) + +37 +__huge_v�l_t + + g__huge_v�l + = { +__HUGE_VALL_by�s + }; + +38 + #HUGE_VALL + ( +__huge_v�l +. +__ld +) + + ) + + @/usr/include/bits/in.h + +20 #i�de� +_NETINET_IN_H + + +29 #ifde� +_UAPI_LINUX_IN6_H + + +33 + #__USE_KERNEL_IPV6_DEFS + + + ) + +39 + #IP_OPTIONS + 4 + + ) + +40 + #IP_HDRINCL + 3 + + ) + +41 + #IP_TOS + 1 + + ) + +42 + #IP_TTL + 2 + + ) + +43 + #IP_RECVOPTS + 6 + + ) + +45 + #IP_RECVRETOPTS + +IP_RETOPTS + + + ) + +46 + #IP_RETOPTS + 7 + + ) + +47 + #IP_MULTICAST_IF + 32 + + ) + +48 + #IP_MULTICAST_TTL + 33 + + ) + +49 + #IP_MULTICAST_LOOP + 34 + + ) + +50 + #IP_ADD_MEMBERSHIP + 35 + + ) + +51 + #IP_DROP_MEMBERSHIP + 36 + + ) + +52 + #IP_UNBLOCK_SOURCE + 37 + + ) + +53 + #IP_BLOCK_SOURCE + 38 + + ) + +54 + #IP_ADD_SOURCE_MEMBERSHIP + 39 + + ) + +55 + #IP_DROP_SOURCE_MEMBERSHIP + 40 + + ) + +56 + #IP_MSFILTER + 41 + + ) + +57 #i� +def�ed + +__USE_MISC + || def�ed +__USE_GNU + + +58 + #MCAST_JOIN_GROUP + 42 + + ) + +59 + #MCAST_BLOCK_SOURCE + 43 + + ) + +60 + #MCAST_UNBLOCK_SOURCE + 44 + + ) + +61 + #MCAST_LEAVE_GROUP + 45 + + ) + +62 + #MCAST_JOIN_SOURCE_GROUP + 46 + + ) + +63 + #MCAST_LEAVE_SOURCE_GROUP + 47 + + ) + +64 + #MCAST_MSFILTER + 48 + + ) + +65 + #IP_MULTICAST_ALL + 49 + + ) + +66 + #IP_UNICAST_IF + 50 + + ) + +68 + #MCAST_EXCLUDE + 0 + + ) + +69 + #MCAST_INCLUDE + 1 + + ) + +72 + #IP_ROUTER_ALERT + 5 + + ) + +73 + #IP_PKTINFO + 8 + + ) + +74 + #IP_PKTOPTIONS + 9 + + ) + +75 + #IP_PMTUDISC + 10 + + ) + +76 + #IP_MTU_DISCOVER + 10 + + ) + +77 + #IP_RECVERR + 11 + + ) + +78 + #IP_RECVTTL + 12 + + ) + +79 + #IP_RECVTOS + 13 + + ) + +80 + #IP_MTU + 14 + + ) + +81 + #IP_FREEBIND + 15 + + ) + +82 + #IP_IPSEC_POLICY + 16 + + ) + +83 + #IP_XFRM_POLICY + 17 + + ) + +84 + #IP_PASSSEC + 18 + + ) + +85 + #IP_TRANSPARENT + 19 + + ) + +86 + #IP_MULTICAST_ALL + 49 + + ) + +89 + #IP_ORIGDSTADDR + 20 + + ) + +90 + #IP_RECVORIGDSTADDR + +IP_ORIGDSTADDR + + + ) + +92 + #IP_MINTTL + 21 + + ) + +96 + #IP_PMTUDISC_DONT + 0 + + ) + +97 + #IP_PMTUDISC_WANT + 1 + + ) + +98 + #IP_PMTUDISC_DO + 2 + + ) + +99 + #IP_PMTUDISC_PROBE + 3 + + ) + +102 + #SOL_IP + 0 + + ) + +104 + #IP_DEFAULT_MULTICAST_TTL + 1 + + ) + +105 + #IP_DEFAULT_MULTICAST_LOOP + 1 + + ) + +106 + #IP_MAX_MEMBERSHIPS + 20 + + ) + +108 #i� +def�ed + +__USE_MISC + || def�ed +__USE_GNU + + +112 + s�_�ts + + +114 +�_addr + + m�_d� +; + +115 + m�_�ts +[40]; + +119 + s�_m�qn + + +121 +�_addr + + mimr_muɟddr +; + +122 +�_addr + + mimr_add�ss +; + +123 + mimr_if�dex +; + +127 + s�_pkt�fo + + +129 + m�i_if�dex +; + +130 +�_addr + + m�i_�ec_d� +; + +131 +�_addr + + m�i_addr +; + +138 + #IPV6_ADDRFORM + 1 + + ) + +139 + #IPV6_2292PKTINFO + 2 + + ) + +140 + #IPV6_2292HOPOPTS + 3 + + ) + +141 + #IPV6_2292DSTOPTS + 4 + + ) + +142 + #IPV6_2292RTHDR + 5 + + ) + +143 + #IPV6_2292PKTOPTIONS + 6 + + ) + +144 + #IPV6_CHECKSUM + 7 + + ) + +145 + #IPV6_2292HOPLIMIT + 8 + + ) + +147 + #SCM_SRCRT + +IPV6_RXSRCRT + + + ) + +149 + #IPV6_NEXTHOP + 9 + + ) + +150 + #IPV6_AUTHHDR + 10 + + ) + +151 + #IPV6_UNICAST_HOPS + 16 + + ) + +152 + #IPV6_MULTICAST_IF + 17 + + ) + +153 + #IPV6_MULTICAST_HOPS + 18 + + ) + +154 + #IPV6_MULTICAST_LOOP + 19 + + ) + +155 + #IPV6_JOIN_GROUP + 20 + + ) + +156 + #IPV6_LEAVE_GROUP + 21 + + ) + +157 + #IPV6_ROUTER_ALERT + 22 + + ) + +158 + #IPV6_MTU_DISCOVER + 23 + + ) + +159 + #IPV6_MTU + 24 + + ) + +160 + #IPV6_RECVERR + 25 + + ) + +161 + #IPV6_V6ONLY + 26 + + ) + +162 + #IPV6_JOIN_ANYCAST + 27 + + ) + +163 + #IPV6_LEAVE_ANYCAST + 28 + + ) + +164 + #IPV6_IPSEC_POLICY + 34 + + ) + +165 + #IPV6_XFRM_POLICY + 35 + + ) + +167 + #IPV6_RECVPKTINFO + 49 + + ) + +168 + #IPV6_PKTINFO + 50 + + ) + +169 + #IPV6_RECVHOPLIMIT + 51 + + ) + +170 + #IPV6_HOPLIMIT + 52 + + ) + +171 + #IPV6_RECVHOPOPTS + 53 + + ) + +172 + #IPV6_HOPOPTS + 54 + + ) + +173 + #IPV6_RTHDRDSTOPTS + 55 + + ) + +174 + #IPV6_RECVRTHDR + 56 + + ) + +175 + #IPV6_RTHDR + 57 + + ) + +176 + #IPV6_RECVDSTOPTS + 58 + + ) + +177 + #IPV6_DSTOPTS + 59 + + ) + +179 + #IPV6_RECVTCLASS + 66 + + ) + +180 + #IPV6_TCLASS + 67 + + ) + +183 + #IPV6_ADD_MEMBERSHIP + +IPV6_JOIN_GROUP + + + ) + +184 + #IPV6_DROP_MEMBERSHIP + +IPV6_LEAVE_GROUP + + + ) + +185 + #IPV6_RXHOPOPTS + +IPV6_HOPOPTS + + + ) + +186 + #IPV6_RXDSTOPTS + +IPV6_DSTOPTS + + + ) + +189 + #IPV6_PMTUDISC_DONT + 0 + + ) + +190 + #IPV6_PMTUDISC_WANT + 1 + + ) + +191 + #IPV6_PMTUDISC_DO + 2 + + ) + +192 + #IPV6_PMTUDISC_PROBE + 3 + + ) + +195 + #SOL_IPV6 + 41 + + ) + +196 + #SOL_ICMPV6 + 58 + + ) + +199 + #IPV6_RTHDR_LOOSE + 0 + + ) + +200 + #IPV6_RTHDR_STRICT + 1 + + ) + +202 + #IPV6_RTHDR_TYPE_0 + 0 + + ) + + @/usr/include/bits/inf.h + +19 #i�de� +_MATH_H + + +25 #i� +__GNUC_PREREQ +(3,3) + +26 + #INFINITY + ( + `__bu�t�_�ff +()) + + ) + +28 + #INFINITY + +HUGE_VALF + + + ) + + @/usr/include/bits/math-finite.h + +19 #i�de� +_MATH_H + + +24 +__REDIRECT_NTH + ( +acos +, (), +__acos_f��e +); + +25 +__REDIRECT_NTH + ( +acosf +, (), +__acosf_f��e +); + +26 #ifde� +__MATH_DECLARE_LDOUBLE + + +27 #ifde� +__NO_LONG_DOUBLE_MATH + + +28 +__REDIRECT_NTH + ( +aco� +, (), +__acos_f��e +); + +30 +__REDIRECT_NTH + ( +aco� +, (), +__aco�_f��e +); + +34 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN_EXTENDED + || def�ed +__USE_ISOC99 + + +36 +__REDIRECT_NTH + ( +acosh +, (), +__acosh_f��e +); + +37 +__REDIRECT_NTH + ( +acoshf +, (), +__acoshf_f��e +); + +38 #ifde� +__MATH_DECLARE_LDOUBLE + + +39 #ifde� +__NO_LONG_DOUBLE_MATH + + +40 +__REDIRECT_NTH + ( +acoshl +, (), +__acosh_f��e +); + +42 +__REDIRECT_NTH + ( +acoshl +, (), +__acoshl_f��e +); + +48 +__REDIRECT_NTH + ( +as� +, (), +__as�_f��e +); + +49 +__REDIRECT_NTH + ( +as�f +, (), +__as�f_f��e +); + +50 #ifde� +__MATH_DECLARE_LDOUBLE + + +51 #ifde� +__NO_LONG_DOUBLE_MATH + + +52 +__REDIRECT_NTH + ( +as�l +, (), +__as�_f��e +); + +54 +__REDIRECT_NTH + ( +as�l +, (), +__as�l_f��e +); + +59 +__REDIRECT_NTH + ( +��2 +, (, ), +__��2_f��e +); + +60 +__REDIRECT_NTH + ( +��2f +, (, ), +__��2f_f��e +); + +61 #ifde� +__MATH_DECLARE_LDOUBLE + + +62 #ifde� +__NO_LONG_DOUBLE_MATH + + +63 +__REDIRECT_NTH + ( +��2l +, (, ), + +64 +__��2_f��e +); + +66 +__REDIRECT_NTH + ( +��2l +, (, ), + +67 +__��2l_f��e +); + +71 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN_EXTENDED + || def�ed +__USE_ISOC99 + + +73 +__REDIRECT_NTH + ( +��h +, (), +__��h_f��e +); + +74 +__REDIRECT_NTH + ( +��hf +, (), +__��hf_f��e +); + +75 #ifde� +__MATH_DECLARE_LDOUBLE + + +76 #ifde� +__NO_LONG_DOUBLE_MATH + + +77 +__REDIRECT_NTH + ( +��hl +, (), +__��h_f��e +); + +79 +__REDIRECT_NTH + ( +��hl +, (), +__��hl_f��e +); + +85 +__REDIRECT_NTH + ( +cosh +, (), +__cosh_f��e +); + +86 +__REDIRECT_NTH + ( +coshf +, (), +__coshf_f��e +); + +87 #ifde� +__MATH_DECLARE_LDOUBLE + + +88 #ifde� +__NO_LONG_DOUBLE_MATH + + +89 +__REDIRECT_NTH + ( +coshl +, (), +__cosh_f��e +); + +91 +__REDIRECT_NTH + ( +coshl +, (), +__coshl_f��e +); + +96 +__REDIRECT_NTH + ( +exp +, (), +__exp_f��e +); + +97 +__REDIRECT_NTH + ( +expf +, (), +__expf_f��e +); + +98 #ifde� +__MATH_DECLARE_LDOUBLE + + +99 #ifde� +__NO_LONG_DOUBLE_MATH + + +100 +__REDIRECT_NTH + ( +ex� +, (), +__exp_f��e +); + +102 +__REDIRECT_NTH + ( +ex� +, (), +__ex�_f��e +); + +106 #ifde� +__USE_GNU + + +108 +__REDIRECT_NTH + ( +exp10 +, (), +__exp10_f��e +); + +109 +__REDIRECT_NTH + ( +exp10f +, (), +__exp10f_f��e +); + +110 #ifde� +__MATH_DECLARE_LDOUBLE + + +111 #ifde� +__NO_LONG_DOUBLE_MATH + + +112 +__REDIRECT_NTH + ( +exp10l +, (), +__exp10_f��e +); + +114 +__REDIRECT_NTH + ( +exp10l +, (), +__exp10l_f��e +); + +119 +__REDIRECT_NTH + ( +pow10 +, (), +__exp10_f��e +); + +120 +__REDIRECT_NTH + ( +pow10f +, (), +__exp10f_f��e +); + +121 #ifde� +__MATH_DECLARE_LDOUBLE + + +122 #ifde� +__NO_LONG_DOUBLE_MATH + + +123 +__REDIRECT_NTH + ( +pow10l +, (), +__exp10_f��e +); + +125 +__REDIRECT_NTH + ( +pow10l +, (), +__exp10l_f��e +); + +130 #ifde� +__USE_ISOC99 + + +132 +__REDIRECT_NTH + ( +exp2 +, (), +__exp2_f��e +); + +133 +__REDIRECT_NTH + ( +exp2f +, (), +__exp2f_f��e +); + +134 #ifde� +__MATH_DECLARE_LDOUBLE + + +135 #ifde� +__NO_LONG_DOUBLE_MATH + + +136 +__REDIRECT_NTH + ( +exp2l +, (), +__exp2_f��e +); + +138 +__REDIRECT_NTH + ( +exp2l +, (), +__exp2l_f��e +); + +144 +__REDIRECT_NTH + ( +fmod +, (, ), +__fmod_f��e +); + +145 +__REDIRECT_NTH + ( +fmodf +, (, ), +__fmodf_f��e +); + +146 #ifde� +__MATH_DECLARE_LDOUBLE + + +147 #ifde� +__NO_LONG_DOUBLE_MATH + + +148 +__REDIRECT_NTH + ( +fmodl +, (, ), + +149 +__fmod_f��e +); + +151 +__REDIRECT_NTH + ( +fmodl +, (, ), + +152 +__fmodl_f��e +); + +156 #ifde� +__USE_ISOC99 + + +158 +__REDIRECT_NTH + ( +hyp� +, (, ), +__hyp�_f��e +); + +159 +__REDIRECT_NTH + ( +hyp�f +, (, ), +__hyp�f_f��e +); + +160 #ifde� +__MATH_DECLARE_LDOUBLE + + +161 #ifde� +__NO_LONG_DOUBLE_MATH + + +162 +__REDIRECT_NTH + ( +hyp�l +, (, ), + +163 +__hyp�_f��e +); + +165 +__REDIRECT_NTH + ( +hyp�l +, (, ), + +166 +__hyp�l_f��e +); + +171 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN + + +173 +__REDIRECT_NTH + ( +j0 +, (), +__j0_f��e +); + +174 +__REDIRECT_NTH + ( +j0f +, (), +__j0f_f��e +); + +175 #ifde� +__MATH_DECLARE_LDOUBLE + + +176 #ifde� +__NO_LONG_DOUBLE_MATH + + +177 +__REDIRECT_NTH + ( +j0l +, (), +__j0_f��e +); + +179 +__REDIRECT_NTH + ( +j0l +, (), +__j0l_f��e +); + +184 +__REDIRECT_NTH + ( +y0 +, (), +__y0_f��e +); + +185 +__REDIRECT_NTH + ( +y0f +, (), +__y0f_f��e +); + +186 #ifde� +__MATH_DECLARE_LDOUBLE + + +187 #ifde� +__NO_LONG_DOUBLE_MATH + + +188 +__REDIRECT_NTH + ( +y0l +, (), +__y0_f��e +); + +190 +__REDIRECT_NTH + ( +y0l +, (), +__y0l_f��e +); + +195 +__REDIRECT_NTH + ( +j1 +, (), +__j1_f��e +); + +196 +__REDIRECT_NTH + ( +j1f +, (), +__j1f_f��e +); + +197 #ifde� +__MATH_DECLARE_LDOUBLE + + +198 #ifde� +__NO_LONG_DOUBLE_MATH + + +199 +__REDIRECT_NTH + ( +j1l +, (), +__j1_f��e +); + +201 +__REDIRECT_NTH + ( +j1l +, (), +__j1l_f��e +); + +206 +__REDIRECT_NTH + ( +y1 +, (), +__y1_f��e +); + +207 +__REDIRECT_NTH + ( +y1f +, (), +__y1f_f��e +); + +208 #ifde� +__MATH_DECLARE_LDOUBLE + + +209 #ifde� +__NO_LONG_DOUBLE_MATH + + +210 +__REDIRECT_NTH + ( +y1l +, (), +__y1_f��e +); + +212 +__REDIRECT_NTH + ( +y1l +, (), +__y1l_f��e +); + +217 +__REDIRECT_NTH + ( +jn +, (, ), +__jn_f��e +); + +218 +__REDIRECT_NTH + ( +jnf +, (, ), +__jnf_f��e +); + +219 #ifde� +__MATH_DECLARE_LDOUBLE + + +220 #ifde� +__NO_LONG_DOUBLE_MATH + + +221 +__REDIRECT_NTH + ( +j� +, (, ), +__jn_f��e +); + +223 +__REDIRECT_NTH + ( +j� +, (, ), +__j�_f��e +); + +228 +__REDIRECT_NTH + ( +yn +, (, ), +__yn_f��e +); + +229 +__REDIRECT_NTH + ( +ynf +, (, ), +__ynf_f��e +); + +230 #ifde� +__MATH_DECLARE_LDOUBLE + + +231 #ifde� +__NO_LONG_DOUBLE_MATH + + +232 +__REDIRECT_NTH + ( +y� +, (, ), +__yn_f��e +); + +234 +__REDIRECT_NTH + ( +y� +, (, ), +__y�_f��e +); + +239 #ifde� +__USE_MISC + + +241 +__REDIRECT_NTH + ( +lgamma_r +, (, *), +__lgamma_r_f��e +); + +242 +__REDIRECT_NTH + ( +lgammaf_r +, (, *), +__lgammaf_r_f��e +); + +243 #ifde� +__MATH_DECLARE_LDOUBLE + + +244 #ifde� +__NO_LONG_DOUBLE_MATH + + +245 +__REDIRECT_NTH + ( +lgamm�_r +, (, *), + +246 +__lgamma_r_f��e +); + +248 +__REDIRECT_NTH + ( +lgamm�_r +, (, *), + +249 +__lgamm�_r_f��e +); + +254 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN + || def�ed +__USE_ISOC99 + + +256 +__ex��_�ways_�l�e + +__NTH + ( + $lgamma + ( +__d +)) + +258 #ifde� +__USE_ISOC99 + + +259 +__lo�l_signgam + = 0; + +260 + `lgamma_r + ( +__d +, & +__lo�l_signgam +); + +262 + `lgamma_r + ( +__d +, & +signgam +); + +264 + } +} + +265 +__ex��_�ways_�l�e + +__NTH + ( + $lgammaf + ( +__d +)) + +267 #ifde� +__USE_ISOC99 + + +268 +__lo�l_signgam + = 0; + +269 + `lgammaf_r + ( +__d +, & +__lo�l_signgam +); + +271 + `lgammaf_r + ( +__d +, & +signgam +); + +273 + } +} + +274 #ifde� +__MATH_DECLARE_LDOUBLE + + +275 +__ex��_�ways_�l�e + +__NTH + ( + $lgamm� + ( +__d +)) + +277 #ifde� +__USE_ISOC99 + + +278 +__lo�l_signgam + = 0; + +279 + `lgamm�_r + ( +__d +, & +__lo�l_signgam +); + +281 + `lgamm�_r + ( +__d +, & +signgam +); + +283 + } +} + +287 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN + + +289 +__ex��_�ways_�l�e + +__NTH + ( + $gamma + ( +__d +)) + +291 #ifde� +__USE_ISOC99 + + +292 +__lo�l_signgam + = 0; + +293 + `lgamma_r + ( +__d +, & +__lo�l_signgam +); + +295 + `lgamma_r + ( +__d +, & +signgam +); + +297 + } +} + +298 +__ex��_�ways_�l�e + +__NTH + ( + $gammaf + ( +__d +)) + +300 #ifde� +__USE_ISOC99 + + +301 +__lo�l_signgam + = 0; + +302 + `lgammaf_r + ( +__d +, & +__lo�l_signgam +); + +304 + `lgammaf_r + ( +__d +, & +signgam +); + +306 + } +} + +307 #ifde� +__MATH_DECLARE_LDOUBLE + + +308 +__ex��_�ways_�l�e + +__NTH + ( + $gamm� + ( +__d +)) + +310 #ifde� +__USE_ISOC99 + + +311 +__lo�l_signgam + = 0; + +312 + `lgamm�_r + ( +__d +, & +__lo�l_signgam +); + +314 + `lgamm�_r + ( +__d +, & +signgam +); + +316 + } +} + +321 +__REDIRECT_NTH + ( +log +, (), +__log_f��e +); + +322 +__REDIRECT_NTH + ( +logf +, (), +__logf_f��e +); + +323 #ifde� +__MATH_DECLARE_LDOUBLE + + +324 #ifde� +__NO_LONG_DOUBLE_MATH + + +325 +__REDIRECT_NTH + ( +logl +, (), +__log_f��e +); + +327 +__REDIRECT_NTH + ( +logl +, (), +__logl_f��e +); + +332 +__REDIRECT_NTH + ( +log10 +, (), +__log10_f��e +); + +333 +__REDIRECT_NTH + ( +log10f +, (), +__log10f_f��e +); + +334 #ifde� +__MATH_DECLARE_LDOUBLE + + +335 #ifde� +__NO_LONG_DOUBLE_MATH + + +336 +__REDIRECT_NTH + ( +log10l +, (), +__log10_f��e +); + +338 +__REDIRECT_NTH + ( +log10l +, (), +__log10l_f��e +); + +342 #ifde� +__USE_ISOC99 + + +344 +__REDIRECT_NTH + ( +log2 +, (), +__log2_f��e +); + +345 +__REDIRECT_NTH + ( +log2f +, (), +__log2f_f��e +); + +346 #ifde� +__MATH_DECLARE_LDOUBLE + + +347 #ifde� +__NO_LONG_DOUBLE_MATH + + +348 +__REDIRECT_NTH + ( +log2l +, (), +__log2_f��e +); + +350 +__REDIRECT_NTH + ( +log2l +, (), +__log2l_f��e +); + +356 +__REDIRECT_NTH + ( +ldexp +, (, ), +s�lbn +); + +357 +__REDIRECT_NTH + ( +ldexpf +, (, ), +s�lbnf +); + +358 #ifde� +__MATH_DECLARE_LDOUBLE + + +359 +__REDIRECT_NTH + ( +ldex� +, (, ), +s�lb� +); + +363 +__REDIRECT_NTH + ( +pow +, (, ), +__pow_f��e +); + +364 +__REDIRECT_NTH + ( +powf +, (, ), +__powf_f��e +); + +365 #ifde� +__MATH_DECLARE_LDOUBLE + + +366 #ifde� +__NO_LONG_DOUBLE_MATH + + +367 +__REDIRECT_NTH + ( +powl +, (, ), + +368 +__pow_f��e +); + +370 +__REDIRECT_NTH + ( +powl +, (, ), + +371 +__powl_f��e +); + +376 +__REDIRECT_NTH + ( +�ma�d� +, (, ), +__�ma�d�_f��e +); + +377 +__REDIRECT_NTH + ( +�ma�d�f +, (, ), +__�ma�d�f_f��e +); + +378 #ifde� +__MATH_DECLARE_LDOUBLE + + +379 #ifde� +__NO_LONG_DOUBLE_MATH + + +380 +__REDIRECT_NTH + ( +�ma�d�l +, (, ), + +381 +__�ma�d�_f��e +); + +383 +__REDIRECT_NTH + ( +�ma�d�l +, (, ), + +384 +__�ma�d�l_f��e +); + +388 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN_EXTENDED + + +390 +__REDIRECT_NTH + ( +s�lb +, (, ), +__s�lb_f��e +); + +391 +__REDIRECT_NTH + ( +s�lbf +, (, ), +__s�lbf_f��e +); + +392 #ifde� +__MATH_DECLARE_LDOUBLE + + +393 #ifde� +__NO_LONG_DOUBLE_MATH + + +394 +__REDIRECT_NTH + ( +s�lbl +, (, ), + +395 +__s�lb_f��e +); + +397 +__REDIRECT_NTH + ( +s�lbl +, (, ), + +398 +__s�lbl_f��e +); + +404 +__REDIRECT_NTH + ( +s�h +, (), +__s�h_f��e +); + +405 +__REDIRECT_NTH + ( +s�hf +, (), +__s�hf_f��e +); + +406 #ifde� +__MATH_DECLARE_LDOUBLE + + +407 #ifde� +__NO_LONG_DOUBLE_MATH + + +408 +__REDIRECT_NTH + ( +s�hl +, (), +__s�h_f��e +); + +410 +__REDIRECT_NTH + ( +s�hl +, (), +__s�hl_f��e +); + +415 +__REDIRECT_NTH + ( +sq� +, (), +__sq�_f��e +); + +416 +__REDIRECT_NTH + ( +sq�f +, (), +__sq�f_f��e +); + +417 #ifde� +__MATH_DECLARE_LDOUBLE + + +418 #ifde� +__NO_LONG_DOUBLE_MATH + + +419 +__REDIRECT_NTH + ( +sq�l +, (), +__sq�_f��e +); + +421 +__REDIRECT_NTH + ( +sq�l +, (), +__sq�l_f��e +); + +425 #ifde� +__USE_ISOC99 + + +427 +__gamma_r_f��e + (, *); + +428 +__ex��_�ways_�l�e + +__NTH + ( + $tgamma + ( +__d +)) + +430 +__lo�l_signgam + = 0; + +431 +__�s + = + `__gamma_r_f��e + ( +__d +, & +__lo�l_signgam +); + +432 +__lo�l_signgam + < 0 ? - +__�s + : __res; + +433 + } +} + +434 +__gammaf_r_f��e + (, *); + +435 +__ex��_�ways_�l�e + +__NTH + ( + $tgammaf + ( +__d +)) + +437 +__lo�l_signgam + = 0; + +438 +__�s + = + `__gammaf_r_f��e + ( +__d +, & +__lo�l_signgam +); + +439 +__lo�l_signgam + < 0 ? - +__�s + : __res; + +440 + } +} + +441 #ifde� +__MATH_DECLARE_LDOUBLE + + +442 +__gamm�_r_f��e + (, *); + +443 +__ex��_�ways_�l�e + +__NTH + ( + $tgamm� + ( +__d +)) + +445 +__lo�l_signgam + = 0; + +446 #ifde� +__NO_LONG_DOUBLE_MATH + + +447 +__�s + = + `__gamma_r_f��e + ( +__d +, & +__lo�l_signgam +); + +449 +__�s + = + `__gamm�_r_f��e + ( +__d +, & +__lo�l_signgam +); + +451 +__lo�l_signgam + < 0 ? - +__�s + : __res; + +452 + } +} + + @/usr/include/bits/mathcalls.h + +45 #i�de� +_MATH_H + + +52 +_Mdoub�_BEGIN_NAMESPACE + + +54 +__MATHCALL + ( +acos +,, ( +_Mdoub�_ + +__x +)); + +56 +__MATHCALL + ( +as� +,, ( +_Mdoub�_ + +__x +)); + +58 +__MATHCALL + ( +�� +,, ( +_Mdoub�_ + +__x +)); + +60 +__MATHCALL + ( +��2 +,, ( +_Mdoub�_ + +__y +, _Mdoub�_ +__x +)); + +63 +__MATHCALL + ( +cos +,, ( +_Mdoub�_ + +__x +)); + +65 +__MATHCALL + ( +s� +,, ( +_Mdoub�_ + +__x +)); + +67 +__MATHCALL + ( +�n +,, ( +_Mdoub�_ + +__x +)); + +72 +__MATHCALL + ( +cosh +,, ( +_Mdoub�_ + +__x +)); + +74 +__MATHCALL + ( +s�h +,, ( +_Mdoub�_ + +__x +)); + +76 +__MATHCALL + ( +�nh +,, ( +_Mdoub�_ + +__x +)); + +77 + g_Mdoub�_END_NAMESPACE + + +79 #ifde� +__USE_GNU + + +81 +__MATHDECL + (, +s�cos +,, + +82 ( +_Mdoub�_ + +__x +, _Mdoub�_ * +__s�x +, _Mdoub�_ * +__cosx +)); + +85 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN_EXTENDED + || def�ed +__USE_ISOC99 + + +86 +__BEGIN_NAMESPACE_C99 + + +88 +__MATHCALL + ( +acosh +,, ( +_Mdoub�_ + +__x +)); + +90 +__MATHCALL + ( +as�h +,, ( +_Mdoub�_ + +__x +)); + +92 +__MATHCALL + ( +��h +,, ( +_Mdoub�_ + +__x +)); + +93 + g__END_NAMESPACE_C99 + + +98 +_Mdoub�_BEGIN_NAMESPACE + + +100 +__MATHCALL + ( +exp +,, ( +_Mdoub�_ + +__x +)); + +103 +__MATHCALL + ( +�exp +,, ( +_Mdoub�_ + +__x +, * +__expڒt +)); + +106 +__MATHCALL + ( +ldexp +,, ( +_Mdoub�_ + +__x +, +__expڒt +)); + +109 +__MATHCALL + ( +log +,, ( +_Mdoub�_ + +__x +)); + +112 +__MATHCALL + ( +log10 +,, ( +_Mdoub�_ + +__x +)); + +115 +__MATHCALL + ( +modf +,, ( +_Mdoub�_ + +__x +, _Mdoub�_ * +__�� +)� +__n�nu� + ((2)); + +116 + g_Mdoub�_END_NAMESPACE + + +118 #ifde� +__USE_GNU + + +120 +__MATHCALL + ( +exp10 +,, ( +_Mdoub�_ + +__x +)); + +122 +__MATHCALL + ( +pow10 +,, ( +_Mdoub�_ + +__x +)); + +125 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN_EXTENDED + || def�ed +__USE_ISOC99 + + +126 +__BEGIN_NAMESPACE_C99 + + +128 +__MATHCALL + ( +expm1 +,, ( +_Mdoub�_ + +__x +)); + +131 +__MATHCALL + ( +log1p +,, ( +_Mdoub�_ + +__x +)); + +134 +__MATHCALL + ( +logb +,, ( +_Mdoub�_ + +__x +)); + +135 + g__END_NAMESPACE_C99 + + +138 #ifde� +__USE_ISOC99 + + +139 +__BEGIN_NAMESPACE_C99 + + +141 +__MATHCALL + ( +exp2 +,, ( +_Mdoub�_ + +__x +)); + +144 +__MATHCALL + ( +log2 +,, ( +_Mdoub�_ + +__x +)); + +145 + g__END_NAMESPACE_C99 + + +151 +_Mdoub�_BEGIN_NAMESPACE + + +153 +__MATHCALL + ( +pow +,, ( +_Mdoub�_ + +__x +, _Mdoub�_ +__y +)); + +156 +__MATHCALL + ( +sq� +,, ( +_Mdoub�_ + +__x +)); + +157 + g_Mdoub�_END_NAMESPACE + + +159 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN + || def�ed +__USE_ISOC99 + + +160 +__BEGIN_NAMESPACE_C99 + + +162 +__MATHCALL + ( +hyp� +,, ( +_Mdoub�_ + +__x +, _Mdoub�_ +__y +)); + +163 + g__END_NAMESPACE_C99 + + +166 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN_EXTENDED + || def�ed +__USE_ISOC99 + + +167 +__BEGIN_NAMESPACE_C99 + + +169 +__MATHCALL + ( +cb� +,, ( +_Mdoub�_ + +__x +)); + +170 + g__END_NAMESPACE_C99 + + +176 +_Mdoub�_BEGIN_NAMESPACE + + +178 +__MATHCALLX + ( +�� +,, ( +_Mdoub�_ + +__x +), ( +__cڡ__ +)); + +181 +__MATHCALLX + ( +�bs +,, ( +_Mdoub�_ + +__x +), ( +__cڡ__ +)); + +184 +__MATHCALLX + ( +�o� +,, ( +_Mdoub�_ + +__x +), ( +__cڡ__ +)); + +187 +__MATHCALL + ( +fmod +,, ( +_Mdoub�_ + +__x +, _Mdoub�_ +__y +)); + +192 +__MATHDECL_1 + (, +__is�f +,, ( +_Mdoub�_ + +__v�ue +)� +__��ibu�__ + (( +__cڡ__ +)); + +195 +__MATHDECL_1 + (, +__f��e +,, ( +_Mdoub�_ + +__v�ue +)� +__��ibu�__ + (( +__cڡ__ +)); + +196 + g_Mdoub�_END_NAMESPACE + + +198 #ifde� +__USE_MISC + + +201 +__MATHDECL_1 + (, +is�f +,, ( +_Mdoub�_ + +__v�ue +)� +__��ibu�__ + (( +__cڡ__ +)); + +204 +__MATHDECL_1 + (, +f��e +,, ( +_Mdoub�_ + +__v�ue +)� +__��ibu�__ + (( +__cڡ__ +)); + +207 +__MATHCALL + ( +d�m +,, ( +_Mdoub�_ + +__x +, _Mdoub�_ +__y +)); + +211 +__MATHCALL + ( +signifi�nd +,, ( +_Mdoub�_ + +__x +)); + +214 #i� +def�ed + +__USE_MISC + || def�ed +__USE_ISOC99 + + +215 +__BEGIN_NAMESPACE_C99 + + +217 +__MATHCALLX + ( +c�ysign +,, ( +_Mdoub�_ + +__x +, _Mdoub�_ +__y +), ( +__cڡ__ +)); + +218 + g__END_NAMESPACE_C99 + + +221 #ifde� +__USE_ISOC99 + + +222 +__BEGIN_NAMESPACE_C99 + + +224 +__MATHCALLX + ( +�n +,, (cڡ * +__�gb +), ( +__cڡ__ +)); + +225 + g__END_NAMESPACE_C99 + + +230 +__MATHDECL_1 + (, +__i�� +,, ( +_Mdoub�_ + +__v�ue +)� +__��ibu�__ + (( +__cڡ__ +)); + +232 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN + + +234 +__MATHDECL_1 + (, +i�� +,, ( +_Mdoub�_ + +__v�ue +)� +__��ibu�__ + (( +__cڡ__ +)); + +237 +__MATHCALL + ( +j0 +,, ( +_Mdoub�_ +)); + +238 +__MATHCALL + ( +j1 +,, ( +_Mdoub�_ +)); + +239 +__MATHCALL + ( +jn +,, (, +_Mdoub�_ +)); + +240 +__MATHCALL + ( +y0 +,, ( +_Mdoub�_ +)); + +241 +__MATHCALL + ( +y1 +,, ( +_Mdoub�_ +)); + +242 +__MATHCALL + ( +yn +,, (, +_Mdoub�_ +)); + +246 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN + || def�ed +__USE_ISOC99 + + +247 +__BEGIN_NAMESPACE_C99 + + +249 +__MATHCALL + ( +�f +,, ( +_Mdoub�_ +)); + +250 +__MATHCALL + ( +�fc +,, ( +_Mdoub�_ +)); + +251 +__MATHCALL + ( +lgamma +,, ( +_Mdoub�_ +)); + +252 + g__END_NAMESPACE_C99 + + +255 #ifde� +__USE_ISOC99 + + +256 +__BEGIN_NAMESPACE_C99 + + +258 +__MATHCALL + ( +tgamma +,, ( +_Mdoub�_ +)); + +259 + g__END_NAMESPACE_C99 + + +262 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN + + +264 +__MATHCALL + ( +gamma +,, ( +_Mdoub�_ +)); + +267 #ifde� +__USE_MISC + + +271 +__MATHCALL + ( +lgamma +, +_r +, ( +_Mdoub�_ +, * +__signgamp +)); + +275 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN_EXTENDED + || def�ed +__USE_ISOC99 + + +276 +__BEGIN_NAMESPACE_C99 + + +279 +__MATHCALL + ( +r�t +,, ( +_Mdoub�_ + +__x +)); + +282 +__MATHCALLX + ( +�x�� +,, ( +_Mdoub�_ + +__x +, _Mdoub�_ +__y +), ( +__cڡ__ +)); + +283 #i� +def�ed + +__USE_ISOC99 + && !def�ed +__LDBL_COMPAT + + +284 +__MATHCALLX + ( +�x�ow�d +,, ( +_Mdoub�_ + +__x +, +__y +), ( +__cڡ__ +)); + +288 +__MATHCALL + ( +�ma�d� +,, ( +_Mdoub�_ + +__x +, _Mdoub�_ +__y +)); + +290 #i� +def�ed + +__USE_MISC + || def�ed +__USE_ISOC99 + + +292 +__MATHCALL + ( +s�lbn +,, ( +_Mdoub�_ + +__x +, +__n +)); + +296 +__MATHDECL + (, +�ogb +,, ( +_Mdoub�_ + +__x +)); + +299 #ifde� +__USE_ISOC99 + + +301 +__MATHCALL + ( +s�lb� +,, ( +_Mdoub�_ + +__x +, +__n +)); + +305 +__MATHCALL + ( +ìby�t +,, ( +_Mdoub�_ + +__x +)); + +309 +__MATHCALLX + ( +round +,, ( +_Mdoub�_ + +__x +), ( +__cڡ__ +)); + +313 +__MATHCALLX + ( +�unc +,, ( +_Mdoub�_ + +__x +), ( +__cڡ__ +)); + +318 +__MATHCALL + ( +�mquo +,, ( +_Mdoub�_ + +__x +, _Mdoub�_ +__y +, * +__quo +)); + +325 +__MATHDECL + (, +̚t +,, ( +_Mdoub�_ + +__x +)); + +326 +__ex�nsi�__ + + +327 +__MATHDECL + (, +�r�t +,, ( +_Mdoub�_ + +__x +)); + +331 +__MATHDECL + (, +�ound +,, ( +_Mdoub�_ + +__x +)); + +332 +__ex�nsi�__ + + +333 +__MATHDECL + (, +�round +,, ( +_Mdoub�_ + +__x +)); + +337 +__MATHCALL + ( +fdim +,, ( +_Mdoub�_ + +__x +, _Mdoub�_ +__y +)); + +340 +__MATHCALLX + ( +fmax +,, ( +_Mdoub�_ + +__x +, _Mdoub�_ +__y +), ( +__cڡ__ +)); + +343 +__MATHCALLX + ( +fm� +,, ( +_Mdoub�_ + +__x +, _Mdoub�_ +__y +), ( +__cڡ__ +)); + +347 +__MATHDECL_1 + (, +__��assify +,, ( +_Mdoub�_ + +__v�ue +)) + +348 +__��ibu�__ + (( +__cڡ__ +)); + +351 +__MATHDECL_1 + (, +__signb� +,, ( +_Mdoub�_ + +__v�ue +)) + +352 +__��ibu�__ + (( +__cڡ__ +)); + +356 +__MATHCALL + ( +fma +,, ( +_Mdoub�_ + +__x +, _Mdoub�_ +__y +, _Mdoub�_ +__z +)); + +359 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN_EXTENDED + || def�ed +__USE_ISOC99 + + +360 + g__END_NAMESPACE_C99 + + +363 #ifde� +__USE_GNU + + +365 +__MATHDECL_1 + (, +__issig�l�g +,, ( +_Mdoub�_ + +__v�ue +)) + +366 +__��ibu�__ + (( +__cڡ__ +)); + +369 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN_EXTENDED + + +371 +__MATHCALL + ( +s�lb +,, ( +_Mdoub�_ + +__x +, _Mdoub�_ +__n +)); + + @/usr/include/bits/mathdef.h + +18 #i�! +def�ed + +_MATH_H + && !def�ed +_COMPLEX_H + + +22 #i� +def�ed + +__USE_ISOC99 + && def�ed +_MATH_H + && !def�ed +_MATH_H_MATHDEF + + +23 + #_MATH_H_MATHDEF + 1 + + ) + +25 #i� +def�ed + +__x86_64__ + || (def�ed +__FLT_EVAL_METHOD__ + && __FLT_EVAL_METHOD__ == 0) + +28 + t��t_t +; + +29 + tdoub�_t +; + +35 + t��t_t +; + +37 + tdoub�_t +; + +42 + #FP_ILOGB0 + (-2147483647 - 1) + + ) + +43 + #FP_ILOGBNAN + (-2147483647 - 1) + + ) + +47 #i� +__FP_FAST_FMA + + +48 + #FP_FAST_FMA + 1 + + ) + +51 #i� +__FP_FAST_FMAF + + +52 + #FP_FAST_FMAF + 1 + + ) + +55 #i� +__FP_FAST_FMAL + + +56 + #FP_FAST_FMAL + 1 + + ) + + @/usr/include/bits/mathinline.h + +19 #i�de� +_MATH_H + + +23 #i�de� +__ex��_�ways_�l�e + + +24 + #__MATH_INLINE + +__�l�e + + + ) + +26 + #__MATH_INLINE + +__ex��_�ways_�l�e + + + ) + +30 #i� +def�ed + +__USE_ISOC99 + && def�ed +__GNUC__ + && __GNUC__ >= 2 + +32 #i�! +__GNUC_PREREQ + (2,97) + +37 #unde� +isg��� + + +38 #unde� +isg���equ� + + +39 #unde� +i�ess + + +40 #unde� +i�es�qu� + + +41 #unde� +i�essg��� + + +42 #unde� +isun�d�ed + + +43 #ifde� +__i686__ + + +46 + #isg��� +( +x +, +y +) \ + +47 ({ +__�su� +; \ + +48 + `__asm__ + ("fucomip %%st(1), %%st; seta %%al" \ + +49 : "�" ( +__�su� +�: "u" ( +y +), "t" ( +x +) : "cc", "st"); \ + +50 +__�su� +; }) + + ) + +51 + #isg���equ� +( +x +, +y +) \ + +52 ({ +__�su� +; \ + +53 + `__asm__ + ("fucomip %%st(1), %%st; setae %%al" \ + +54 : "�" ( +__�su� +�: "u" ( +y +), "t" ( +x +) : "cc", "st"); \ + +55 +__�su� +; }) + + ) + +57 + #i�ess +( +x +, +y +) \ + +58 ({ +__�su� +; \ + +59 + `__asm__ + ("fucomip %%st(1), %%st; seta %%al" \ + +60 : "�" ( +__�su� +�: "u" ( +x +), "t" ( +y +) : "cc", "st"); \ + +61 +__�su� +; }) + + ) + +63 + #i�es�qu� +( +x +, +y +) \ + +64 ({ +__�su� +; \ + +65 + `__asm__ + ("fucomip %%st(1), %%st; setae %%al" \ + +66 : "�" ( +__�su� +�: "u" ( +x +), "t" ( +y +) : "cc", "st"); \ + +67 +__�su� +; }) + + ) + +69 + #i�essg��� +( +x +, +y +) \ + +70 ({ +__�su� +; \ + +71 + `__asm__ + ("fucomip %%st(1), %%st; setne %%al" \ + +72 : "�" ( +__�su� +�: "u" ( +y +), "t" ( +x +) : "cc", "st"); \ + +73 +__�su� +; }) + + ) + +75 + #isun�d�ed +( +x +, +y +) \ + +76 ({ +__�su� +; \ + +77 + `__asm__ + ("fucomip %%st(1), %%st; setp %%al" \ + +78 : "�" ( +__�su� +�: "u" ( +y +), "t" ( +x +) : "cc", "st"); \ + +79 +__�su� +; }) + + ) + +82 + #isg��� +( +x +, +y +) \ + +83 ({ +__�su� +; \ + +84 + `__asm__ + ("fucompp; fnstsw;�estb $0x45, %%ah; setz %%al" \ + +85 : "�" ( +__�su� +�: "u" ( +y +), "t" ( +x +) : "cc", "st", "st(1)"); \ + +86 +__�su� +; }) + + ) + +88 + #isg���equ� +( +x +, +y +) \ + +89 ({ +__�su� +; \ + +90 + `__asm__ + ("fucompp; fnstsw;�estb $0x05, %%ah; setz %%al" \ + +91 : "�" ( +__�su� +�: "u" ( +y +), "t" ( +x +) : "cc", "st", "st(1)"); \ + +92 +__�su� +; }) + + ) + +94 + #i�ess +( +x +, +y +) \ + +95 ({ +__�su� +; \ + +96 + `__asm__ + ("fucompp; fnstsw;�estb $0x45, %%ah; setz %%al" \ + +97 : "�" ( +__�su� +�: "u" ( +x +), "t" ( +y +) : "cc", "st", "st(1)"); \ + +98 +__�su� +; }) + + ) + +100 + #i�es�qu� +( +x +, +y +) \ + +101 ({ +__�su� +; \ + +102 + `__asm__ + ("fucompp; fnstsw;�estb $0x05, %%ah; setz %%al" \ + +103 : "�" ( +__�su� +�: "u" ( +x +), "t" ( +y +) : "cc", "st", "st(1)"); \ + +104 +__�su� +; }) + + ) + +106 + #i�essg��� +( +x +, +y +) \ + +107 ({ +__�su� +; \ + +108 + `__asm__ + ("fucompp; fnstsw;�estb $0x44, %%ah; setz %%al" \ + +109 : "�" ( +__�su� +�: "u" ( +y +), "t" ( +x +) : "cc", "st", "st(1)"); \ + +110 +__�su� +; }) + + ) + +112 + #isun�d�ed +( +x +, +y +) \ + +113 ({ +__�su� +; \ + +114 + `__asm__ + ("fucompp; fnstsw; sahf; setp %%al" \ + +115 : "�" ( +__�su� +�: "u" ( +y +), "t" ( +x +) : "cc", "st", "st(1)"); \ + +116 +__�su� +; }) + + ) + +122 #i� +__GNUC_PREREQ + (2, 8) + +123 +__BEGIN_NAMESPACE_C99 + + +126 +__MATH_INLINE + + +127 +__NTH + ( + $__signb�f + ( +__x +)) + +129 #ifde� +__SSE2_MATH__ + + +130 +__m +; + +131 + `__asm + ("pmovmskb %1, %0" : "�" ( +__m +�: "x" ( +__x +)); + +132 ( +__m + & 0x8) != 0; + +134 +__ex�nsi�__ + uni� { +__f +; +__i +; } +__u + = { __f: +__x + }; + +135 +__u +. +__i + < 0; + +137 + } +} + +138 +__MATH_INLINE + + +139 +__NTH + ( + $__signb� + ( +__x +)) + +141 #ifde� +__SSE2_MATH__ + + +142 +__m +; + +143 + `__asm + ("pmovmskb %1, %0" : "�" ( +__m +�: "x" ( +__x +)); + +144 ( +__m + & 0x80) != 0; + +146 +__ex�nsi�__ + uni� { +__d +; +__i +[2]; } +__u + = { __d: +__x + }; + +147 +__u +. +__i +[1] < 0; + +149 + } +} + +150 +__MATH_INLINE + + +151 +__NTH + ( + $__signb�l + ( +__x +)) + +153 +__ex�nsi�__ + uni� { +__l +; +__i +[3]; } +__u + = { __l: +__x + }; + +154 ( +__u +. +__i +[2] & 0x8000) != 0; + +155 + } +} + +157 + g__END_NAMESPACE_C99 + + +164 #i� +__GNUC_PREREQ + (2, 8) + +165 #i�! +__GNUC_PREREQ + (3, 4�&& ! +def�ed + +__NO_MATH_INLINES + \ + +166 && +def�ed + + g__OPTIMIZE__ + + +170 #ifde� +__USE_ISOC99 + + +171 + g__BEGIN_NAMESPACE_C99 + + +174 #ifde� +__SSE_MATH__ + + +175 +__MATH_INLINE + + +176 +__NTH + ( + $̚tf + ( +__x +)) + +178 +__�s +; + +183 +__asm + + `__vީ�e__ + ("cvtss2s�%1, %0" : "�" ( +__�s +�: "xm" ( +__x +)); + +184 +__�s +; + +185 + } +} + +187 #ifde� +__SSE2_MATH__ + + +188 +__MATH_INLINE + + +189 +__NTH + ( + $̚t + ( +__x +)) + +191 +__�s +; + +196 +__asm + + `__vީ�e__ + ("cvtsd2s�%1, %0" : "�" ( +__�s +�: "xm" ( +__x +)); + +197 +__�s +; + +198 + } +} + +200 #ifde� +__x86_64__ + + +201 +__ex�nsi�__ + + +202 +__MATH_INLINE + + +203 +__NTH + ( + $�r�tf + ( +__x +)) + +205 +__�s +; + +210 +__asm + + `__vީ�e__ + ("cvtss2s�%1, %0" : "�" ( +__�s +�: "xm" ( +__x +)); + +211 +__�s +; + +212 + } +} + +213 +__ex�nsi�__ + + +214 +__MATH_INLINE + + +215 +__NTH + ( + $�r�t + ( +__x +)) + +217 +__�s +; + +222 +__asm + + `__vީ�e__ + ("cvtsd2s�%1, %0" : "�" ( +__�s +�: "xm" ( +__x +)); + +223 +__�s +; + +224 + } +} + +227 #i� +def�ed + +__FINITE_MATH_ONLY__ + && __FINITE_MATH_ONLY__ > 0 \ + +228 && +def�ed + +__SSE2_MATH__ + + +230 +__MATH_INLINE + + +231 +__NTH + ( + $fmaxf + ( +__x +, +__y +)) + +233 #ifde� +__AVX__ + + +234 +__�s +; + +235 + `__asm + ("vmaxs�%2, %1, %0" : "=x" ( +__�s +�: "x" ( +x +), "xm" ( +__y +)); + +236 +__�s +; + +238 + `__asm + ("maxs�%1, %0" : "+x" ( +__x +�: "xm" ( +__y +)); + +239 +__x +; + +241 + } +} + +242 +__MATH_INLINE + + +243 +__NTH + ( + $fmax + ( +__x +, +__y +)) + +245 #ifde� +__AVX__ + + +246 +__�s +; + +247 + `__asm + ("vmaxsd %2, %1, %0" : "=x" ( +__�s +�: "x" ( +x +), "xm" ( +__y +)); + +248 +__�s +; + +250 + `__asm + ("maxsd %1, %0" : "+x" ( +__x +�: "xm" ( +__y +)); + +251 +__x +; + +253 + } +} + +256 +__MATH_INLINE + + +257 +__NTH + ( + $fm�f + ( +__x +, +__y +)) + +259 #ifde� +__AVX__ + + +260 +__�s +; + +261 + `__asm + ("vm�s�%2, %1, %0" : "=x" ( +__�s +�: "x" ( +x +), "xm" ( +__y +)); + +262 +__�s +; + +264 + `__asm + ("m�s�%1, %0" : "+x" ( +__x +�: "xm" ( +__y +)); + +265 +__x +; + +267 + } +} + +268 +__MATH_INLINE + + +269 +__NTH + ( + $fm� + ( +__x +, +__y +)) + +271 #ifde� +__AVX__ + + +272 +__�s +; + +273 + `__asm + ("vm�sd %2, %1, %0" : "=x" ( +__�s +�: "x" ( +x +), "xm" ( +__y +)); + +274 +__�s +; + +276 + `__asm + ("m�sd %1, %0" : "+x" ( +__x +�: "xm" ( +__y +)); + +277 +__x +; + +279 + } +} + +282 + g__END_NAMESPACE_C99 + + +285 #i� +def�ed + +__SSE4_1__ + && def�ed +__SSE2_MATH__ + + +286 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN_EXTENDED + || def�ed +__USE_ISOC99 + + +287 +__BEGIN_NAMESPACE_C99 + + +290 +__MATH_INLINE + + +291 +__NTH + ( + $r�t + ( +__x +)) + +293 +__�s +; + +298 +__asm + + `__vީ�e__ + ("roundsd $4, %1, %0" : "=x" ( +__�s +�: "xm" ( +__x +)); + +299 +__�s +; + +300 + } +} + +301 +__MATH_INLINE + + +302 +__NTH + ( + $r�tf + ( +__x +)) + +304 +__�s +; + +309 +__asm + + `__vީ�e__ + ("rounds�$4, %1, %0" : "=x" ( +__�s +�: "xm" ( +__x +)); + +310 +__�s +; + +311 + } +} + +313 #ifde� +__USE_ISOC99 + + +315 +__MATH_INLINE + + +316 +__NTH + ( + $ìby�t + ( +__x +)) + +318 +__�s +; + +323 +__asm + + `__vީ�e__ + ("roundsd $0xc, %1, %0" : "=x" ( +__�s +�: "xm" ( +__x +)); + +324 +__�s +; + +325 + } +} + +326 +__MATH_INLINE + + +327 +__NTH + ( + $ìby�tf + ( +__x +)) + +329 +__�s +; + +334 +__asm + + `__vީ�e__ + ("rounds�$0xc, %1, %0" : "=x" ( +__�s +�: "xm" ( +__x +)); + +335 +__�s +; + +336 + } +} + +339 + g__END_NAMESPACE_C99 + + +342 +__BEGIN_NAMESPACE_STD + + +344 +__MATH_INLINE + + +345 +__NTH + ( + $�� + ( +__x +)) + +347 +__�s +; + +348 + `__asm + ("roundsd $2, %1, %0" : "=x" ( +__�s +�: "xm" ( +__x +)); + +349 +__�s +; + +350 + } +} + +351 +__END_NAMESPACE_STD + + +353 +__BEGIN_NAMESPACE_C99 + + +354 +__MATH_INLINE + + +355 +__NTH + ( + $��f + ( +__x +)) + +357 +__�s +; + +358 + `__asm + ("rounds�$2, %1, %0" : "=x" ( +__�s +�: "xm" ( +__x +)); + +359 +__�s +; + +360 + } +} + +361 +__END_NAMESPACE_C99 + + +363 +__BEGIN_NAMESPACE_STD + + +365 +__MATH_INLINE + + +366 +__NTH + ( + $�o� + ( +__x +)) + +368 +__�s +; + +369 + `__asm + ("roundsd $1, %1, %0" : "=x" ( +__�s +�: "xm" ( +__x +)); + +370 +__�s +; + +371 + } +} + +372 +__END_NAMESPACE_STD + + +374 +__BEGIN_NAMESPACE_C99 + + +375 +__MATH_INLINE + + +376 +__NTH + ( + $�o�f + ( +__x +)) + +378 +__�s +; + +379 + `__asm + ("rounds�$1, %1, %0" : "=x" ( +__�s +�: "xm" ( +__x +)); + +380 +__�s +; + +381 + } +} + +382 + g__END_NAMESPACE_C99 + + +387 #i�de� +__SSE2_MATH__ + + +388 #i�((! +def�ed + +__NO_MATH_INLINES + || def�ed +__LIBC_INTERNAL_MATH_INLINES +) \ + +389 && +def�ed + + g__OPTIMIZE__ +) + +393 #unde� +m�h_�rh�dl�g + + +402 #i� +def�ed + +__USE_MISC + || def�ed +__USE_ISOC99 + + +403 + #__�l�e_m�h� +( +func +, +� +) \ + +404 + `__�l�e_m�h�_ + (, +func +, +� +) \ + +405 + `__�l�e_m�h�_ + (, + `__CONCAT +( +func +, +f +), +� +) \ + +406 + `__�l�e_m�h�_ + (, + `__CONCAT +( +func +, +l +), +� +) + + ) + +407 + #__�l�e_m�h�NP +( +func +, +� +) \ + +408 + `__�l�e_m�h�NP_ + (, +func +, +� +) \ + +409 + `__�l�e_m�h�NP_ + (, + `__CONCAT +( +func +, +f +), +� +) \ + +410 + `__�l�e_m�h�NP_ + (, + `__CONCAT +( +func +, +l +), +� +) + + ) + +412 + #__�l�e_m�h� +( +func +, +� +) \ + +413 + `__�l�e_m�h�_ + (, +func +, +� +) + + ) + +414 + #__�l�e_m�h�NP +( +func +, +� +) \ + +415 + `__�l�e_m�h�NP_ + (, +func +, +� +) + + ) + +418 + #__�l�e_m�h�_ +( +��t_ty� +, +func +, +� +) \ + +419 + `__�l�e_m�h�_de�_ + ( +��t_ty� +, +func +, +� +, "0" ( +__x +)) + + ) + +420 + #__�l�e_m�h�NP_ +( +��t_ty� +, +func +, +� +) \ + +421 + `__�l�e_m�h�_de�NP_ + ( +��t_ty� +, +func +, +� +, "0" ( +__x +)) + + ) + +424 #i� +def�ed + +__USE_MISC + || def�ed +__USE_ISOC99 + + +425 + #__�l�e_m�h�_de� +( +func +, +� +, +��ms +...) \ + +426 + `__�l�e_m�h�_de�_ + (, +func +, +� +, +��ms +) \ + +427 + `__�l�e_m�h�_de�_ + (, + `__CONCAT +( +func +, +f +), +� +, +��ms +) \ + +428 + `__�l�e_m�h�_de�_ + (, + `__CONCAT +( +func +, +l +), +� +, +��ms +) + + ) + +429 + #__�l�e_m�h�_de�NP +( +func +, +� +, +��ms +...) \ + +430 + `__�l�e_m�h�_de�NP_ + (, +func +, +� +, +��ms +) \ + +431 + `__�l�e_m�h�_de�NP_ + (, + `__CONCAT +( +func +, +f +), +� +, +��ms +) \ + +432 + `__�l�e_m�h�_de�NP_ + (, + `__CONCAT +( +func +, +l +), +� +, +��ms +) + + ) + +434 + #__�l�e_m�h�_de� +( +func +, +� +, +��ms +...) \ + +435 + `__�l�e_m�h�_de�_ + (, +func +, +� +, +��ms +) + + ) + +436 + #__�l�e_m�h�_de�NP +( +func +, +� +, +��ms +...) \ + +437 + `__�l�e_m�h�_de�NP_ + (, +func +, +� +, +��ms +) + + ) + +440 + #__�l�e_m�h�_de�_ +( +��t_ty� +, +func +, +� +, +��ms +...) \ + +441 +__MATH_INLINE + +��t_ty� + + `func + (��t_ty�� +__THROW +; \ + +442 + `__�l�e_m�h�_de�NP_ + ( +��t_ty� +, +func +, +� +, +��ms +) + + ) + +444 + #__�l�e_m�h�_de�NP_ +( +��t_ty� +, +func +, +� +, +��ms +...) \ + +445 +__MATH_INLINE + +��t_ty� + + `__NTH + ( + `func + (��t_ty� +__x +)) \ + +447 +��t_ty� + +__�su� +; \ + +448 +__asm + + `__vީ�e__ + ( +� + : "�" ( +__�su� +�: +��ms +); \ + +449 +__�su� +; \ + +450 } + + ) + +453 #i� +def�ed + +__USE_MISC + || def�ed +__USE_ISOC99 + + +454 + #__�l�e_m�hcode +( +func +, +�g +, +code +) \ + +455 + `__�l�e_m�hcode_ + (, +func +, +�g +, +code +) \ + +456 + `__�l�e_m�hcode_ + (, + `__CONCAT +( +func +, +f +), +�g +, +code +) \ + +457 + `__�l�e_m�hcode_ + (, + `__CONCAT +( +func +, +l +), +�g +, +code +) + + ) + +458 + #__�l�e_m�hcodeNP +( +func +, +�g +, +code +) \ + +459 + `__�l�e_m�hcodeNP_ + (, +func +, +�g +, +code +) \ + +460 + `__�l�e_m�hcodeNP_ + (, + `__CONCAT +( +func +, +f +), +�g +, +code +) \ + +461 + `__�l�e_m�hcodeNP_ + (, + `__CONCAT +( +func +, +l +), +�g +, +code +) + + ) + +462 + #__�l�e_m�hcode2 +( +func +, +�g1 +, +�g2 +, +code +) \ + +463 + `__�l�e_m�hcode2_ + (, +func +, +�g1 +, +�g2 +, +code +) \ + +464 + `__�l�e_m�hcode2_ + (, + `__CONCAT +( +func +, +f +), +�g1 +, +�g2 +, +code +) \ + +465 + `__�l�e_m�hcode2_ + (, + `__CONCAT +( +func +, +l +), +�g1 +, +�g2 +, +code +) + + ) + +466 + #__�l�e_m�hcodeNP2 +( +func +, +�g1 +, +�g2 +, +code +) \ + +467 + `__�l�e_m�hcodeNP2_ + (, +func +, +�g1 +, +�g2 +, +code +) \ + +468 + `__�l�e_m�hcodeNP2_ + (, + `__CONCAT +( +func +, +f +), +�g1 +, +�g2 +, +code +) \ + +469 + `__�l�e_m�hcodeNP2_ + (, + `__CONCAT +( +func +, +l +), +�g1 +, +�g2 +, +code +) + + ) + +470 + #__�l�e_m�hcode3 +( +func +, +�g1 +, +�g2 +, +�g3 +, +code +) \ + +471 + `__�l�e_m�hcode3_ + (, +func +, +�g1 +, +�g2 +, +�g3 +, +code +) \ + +472 + `__�l�e_m�hcode3_ + (, + `__CONCAT +( +func +, +f +), +�g1 +, +�g2 +, +�g3 +, +code +) \ + +473 + `__�l�e_m�hcode3_ + (, + `__CONCAT +( +func +, +l +), +�g1 +, +�g2 +, +�g3 +, +code +) + + ) + +474 + #__�l�e_m�hcodeNP3 +( +func +, +�g1 +, +�g2 +, +�g3 +, +code +) \ + +475 + `__�l�e_m�hcodeNP3_ + (, +func +, +�g1 +, +�g2 +, +�g3 +, +code +) \ + +476 + `__�l�e_m�hcodeNP3_ + (, + `__CONCAT +( +func +, +f +), +�g1 +, +�g2 +, +�g3 +, +code +) \ + +477 + `__�l�e_m�hcodeNP3_ + (, + `__CONCAT +( +func +, +l +), +�g1 +, +�g2 +, +�g3 +, +code +) + + ) + +479 + #__�l�e_m�hcode +( +func +, +�g +, +code +) \ + +480 + `__�l�e_m�hcode_ + (, +func +, ( +�g +), +code +) + + ) + +481 + #__�l�e_m�hcodeNP +( +func +, +�g +, +code +) \ + +482 + `__�l�e_m�hcodeNP_ + (, +func +, ( +�g +), +code +) + + ) + +483 + #__�l�e_m�hcode2 +( +func +, +�g1 +, +�g2 +, +code +) \ + +484 + `__�l�e_m�hcode2_ + (, +func +, +�g1 +, +�g2 +, +code +) + + ) + +485 + #__�l�e_m�hcodeNP2 +( +func +, +�g1 +, +�g2 +, +code +) \ + +486 + `__�l�e_m�hcodeNP2_ + (, +func +, +�g1 +, +�g2 +, +code +) + + ) + +487 + #__�l�e_m�hcode3 +( +func +, +�g1 +, +�g2 +, +�g3 +, +code +) \ + +488 + `__�l�e_m�hcode3_ + (, +func +, +�g1 +, +�g2 +, +�g3 +, +code +) + + ) + +489 + #__�l�e_m�hcodeNP3 +( +func +, +�g1 +, +�g2 +, +�g3 +, +code +) \ + +490 + `__�l�e_m�hcodeNP3_ + (, +func +, +�g1 +, +�g2 +, +�g3 +, +code +) + + ) + +493 + #__�l�e_m�hcode_ +( +��t_ty� +, +func +, +�g +, +code +) \ + +494 +__MATH_INLINE + +��t_ty� + + `func + (��t_ty�� +__THROW +; \ + +495 + `__�l�e_m�hcodeNP_ +( +��t_ty� +, +func +, +�g +, +code +) + + ) + +497 + #__�l�e_m�hcodeNP_ +( +��t_ty� +, +func +, +�g +, +code +) \ + +498 +__MATH_INLINE + +��t_ty� + + `__NTH + ( + `func + (��t_ty� +�g +)) \ + +500 +code +; \ + +501 } + + ) + +504 + #__�l�e_m�hcode2_ +( +��t_ty� +, +func +, +�g1 +, +�g2 +, +code +) \ + +505 +__MATH_INLINE + +��t_ty� + + `func + (��t_ty�, fl�t_ty�� +__THROW +; \ + +506 + `__�l�e_m�hcodeNP2_ + ( +��t_ty� +, +func +, +�g1 +, +�g2 +, +code +) + + ) + +508 + #__�l�e_m�hcodeNP2_ +( +��t_ty� +, +func +, +�g1 +, +�g2 +, +code +) \ + +509 +__MATH_INLINE + +��t_ty� + + `__NTH + ( + `func + (��t_ty� +�g1 +, fl�t_ty� +�g2 +)) \ + +511 +code +; \ + +512 } + + ) + +514 + #__�l�e_m�hcode3_ +( +��t_ty� +, +func +, +�g1 +, +�g2 +, +�g3 +, +code +) \ + +515 +__MATH_INLINE + +��t_ty� + + `func + (��t_ty�, fl�t_ty�, fl�t_ty�� +__THROW +; \ + +516 + `__�l�e_m�hcodeNP3_ +( +��t_ty� +, +func +, +�g1 +, +�g2 +, +�g3 +, +code +) + + ) + +518 + #__�l�e_m�hcodeNP3_ +( +��t_ty� +, +func +, +�g1 +, +�g2 +, +�g3 +, +code +) \ + +519 +__MATH_INLINE + +��t_ty� + + `__NTH + ( + `func + (��t_ty� +�g1 +, fl�t_ty� +�g2 +, \ + +520 +��t_ty� + +�g3 +)) \ + +522 +code +; \ + +523 } + + ) + +527 #i�! +def�ed + +__NO_MATH_INLINES + && def�ed +__OPTIMIZE__ + + +531 #ifde� +__FAST_MATH__ + + +532 #ifde� +__USE_GNU + + +533 + #__s�cos_code + \ + +534 +__co� +; \ + +535 +__s�r +; \ + +536 +__swtmp +; \ + +537 +__asm + +__vީ�e__ + \ + +552 : "�" ( +__co� +), "=u" ( +__s�r +), "�" ( +__swtmp +�: "0" ( +__x +)); \ + +553 * +__s�x + = +__s�r +; \ + +554 * +__cosx + = +__co� + + + ) + +556 +__MATH_INLINE + + +557 +__NTH + ( + $__s�cos + ( +__x +, * +__s�x +, * +__cosx +)) + +559 +__s�cos_code +; + +560 + } +} + +562 +__MATH_INLINE + + +563 +__NTH + ( + $__s�cosf + ( +__x +, * +__s�x +, * +__cosx +)) + +565 +__s�cos_code +; + +566 + } +} + +568 +__MATH_INLINE + + +569 +__NTH + ( + $__s�co� + ( +__x +, * +__s�x +, * +__cosx +)) + +571 +__s�cos_code +; + +572 + } +} + +579 #i� +__GNUC_PREREQ + (3, 5) + +580 + #__expm1_code + \ + +581 +__�mp +; \ + +582 +__�mp + = + `__bu�t�_expm1l + ( +__x +); \ + +583 +__�mp + ? __�m�: +__x + + + ) + +585 + #__expm1_code + \ + +586 +__v�ue +; \ + +587 +__expڒt +; \ + +588 +__�mp +; \ + +589 +__asm + +__vީ�e__ + \ + +598 : "�" ( +__v�ue +), "=u" ( +__expڒt +�: "0" ( +__x +)); \ + +599 +__asm + +__vީ�e__ + \ + +601 : "�" ( +__�mp +�: "0" (1.0), "u" ( +__expڒt +)); \ + +602 +__�mp + -= 1.0; \ + +603 +__�mp + +� +__v�ue +; \ + +604 +__�mp + ? __�m�: +__x + + + ) + +606 + $__�l�e_m�hcodeNP_ + (, +__expm1l +, +__x +, +__expm1_code +) + +608 #i� + `__GNUC_PREREQ + (3, 4) + +609 + `__�l�e_m�hcodeNP_ + (, +__ex� +, +__x +, + $__bu�t�_ex� + ( +__x +)) + +611 + #__exp_code + \ + +612 +__v�ue +; \ + +613 +__expڒt +; \ + +614 +__asm + +__vީ�e__ + \ + +622 : "�" ( +__v�ue +), "=u" ( +__expڒt +�: "0" ( +__x +)); \ + +623 +__v�ue + += 1.0; \ + +624 +__asm + +__vީ�e__ + \ + +626 : "�" ( +__v�ue +�: "0" (__v�ue), "u" ( +__expڒt +)); \ + +627 +__v�ue + + + ) + +628 + $__�l�e_m�hcodeNP + ( +exp +, +__x +, +__exp_code +) + +629 + $__�l�e_m�hcodeNP_ + (, +__ex� +, +__x +, +__exp_code +) + +633 #i�! + `__GNUC_PREREQ + (3, 5) + +634 + `__�l�e_m�hcodeNP + ( +�n +, +__x +, \ + +635 +__v�ue +; \ + +636 +__v�ue2 + + `__��ibu�__ + (( +__unu�d__ +)); \ + +637 +__asm + +__vީ�e__ + \ + +639 : "�" ( +__v�ue2 +), "=u" ( +__v�ue +�: "0" ( +__x +)); \ + +640 +__v�ue +) + +645 #i� + `__GNUC_PREREQ + (3, 4) + +646 + `__�l�e_m�hcodeNP2_ + (, +__��2l +, +__y +, +__x +, + +647 + $__bu�t�_��2l + ( +__y +, +__x +)) + +649 + #__��2_code + \ + +650 +__v�ue +; \ + +651 +__asm + +__vީ�e__ + \ + +653 : "�" ( +__v�ue +�: "0" ( +__x +), "u" ( +__y +) : "st(1)"); \ + +654 +__v�ue + + + ) + +655 #ifde� +__FAST_MATH__ + + +656 + $__�l�e_m�hcodeNP2 + ( +��2 +, +__y +, +__x +, +__��2_code +) + +658 + $__�l�e_m�hcodeNP2_ + (, +__��2l +, +__y +, +__x +, +__��2_code +) + +662 #i� +def�ed + +__FAST_MATH__ + && ! + `__GNUC_PREREQ + (3, 5) + +663 + `__�l�e_m�hcodeNP2 + ( +fmod +, +__x +, +__y +, \ + +664 +__v�ue +; \ + +665 +__asm + +__vީ�e__ + \ + +670 : "�" ( +__v�ue +�: "0" ( +__x +), "u" ( +__y +) : "ax", "cc"); \ + +671 +__v�ue +) + +675 #ifde� +__FAST_MATH__ + + +676 #i�! + `__GNUC_PREREQ + (3,3) + +677 + `__�l�e_m�h�NP + ( +sq� +, "fsqrt") + +678 + `__�l�e_m�h�NP_ + (, +__sq�l +, "fsqrt") + +679 + #__libc_sq�l +( +n +� + `__sq�l + (n) + + ) + +681 + #__libc_sq�l +( +n +� + `__bu�t�_sq�l + (n) + + ) + +685 #i� + `__GNUC_PREREQ + (2, 8) + +686 + `__�l�e_m�hcodeNP_ + (, +�bs +, +__x +, + $__bu�t�_�bs + ( +__x +)) + +687 #i� +def�ed + +__USE_MISC + || def�ed +__USE_ISOC99 + + +688 + `__�l�e_m�hcodeNP_ + (, +�bsf +, +__x +, + $__bu�t�_�bsf + ( +__x +)) + +689 + `__�l�e_m�hcodeNP_ + (, +�b� +, +__x +, + $__bu�t�_�b� + ( +__x +)) + +691 + `__�l�e_m�hcodeNP_ + (, +__�b� +, +__x +, + $__bu�t�_�b� + ( +__x +)) + +693 + `__�l�e_m�h� + ( +�bs +, "fabs") + +694 + `__�l�e_m�h�_ + (, +__�b� +, "fabs") + +697 #ifde� +__FAST_MATH__ + + +698 #i�! + `__GNUC_PREREQ + (3, 4) + +700 + `__�l�e_m�h�NP + ( +s� +, "fsin") + +702 + `__�l�e_m�h�NP + ( +cos +, "fcos") + +704 + `__�l�e_m�h�_de�NP + ( +log +, "�d�2; fxch; fyl2x", "0" ( +__x +) : "st(1)") + +707 #i�! + `__GNUC_PREREQ + (3, 5) + +708 + `__�l�e_m�h�_de�NP + ( +log10 +, "�dlg2; fxch; fyl2x", "0" ( +__x +) : "st(1)") + +710 + `__�l�e_m�hcodeNP + ( +as� +, +__x +, + `__��2l + (__x, + `__libc_sq�l + (1.0 - __x * __x))) + +711 + `__�l�e_m�hcodeNP + ( +acos +, +__x +, + `__��2l + ( + `__libc_sq�l + (1.0 - __x * __x), __x)) + +714 #i�! + `__GNUC_PREREQ + (3, 4) + +715 + `__�l�e_m�h�_de�NP + ( +�� +, "�d1; f��n", "0" ( +__x +) : "st(1)") + +719 + `__�l�e_m�hcode_ + (, +__sgn1l +, +__x +, \ + +720 +__ex�nsi�__ + uni� { +__xld +; +__xi +[3]; } +__n + = \ + +721 { +__xld +: +__x + + } +}; \ + +722 + g__n +. + g__xi +[2] = ( +__n +. +__xi +[2] & 0x8000) | 0x3fff; \ + +723 + g__n +. + g__xi +[1] = 0x80000000; \ + +724 + g__n +. + g__xi +[0] = 0; \ + +725 + g__n +. + g__xld +) + +728 #ifde� +__FAST_MATH__ + + +730 +__�l�e_m�hcodeNP + ( +s�h +, +__x +, \ + +731 +__exm1 + = +__expm1l + ( +__�b� + ( +__x +)); \ + +732 0.5 * ( +__exm1 + / (__exm1 + 1.0�+ __exm1�* + $__sgn1l + ( +__x +)) + +734 + `__�l�e_m�hcodeNP + ( +cosh +, +__x +, \ + +735 +__ex + = + `__ex� + ( +__x +); \ + +736 0.5 * ( +__ex + + 1.0 / __ex)) + +738 + `__�l�e_m�hcodeNP + ( +�nh +, +__x +, \ + +739 +__exm1 + = + `__expm1l + (- + `__�b� + ( +__x + + __x)); \ + +740 +__exm1 + / (__exm1 + 2.0�* + `__sgn1l + (- +__x +)) + +743 + `__�l�e_m�hcodeNP + ( +�o� +, +__x +, \ + +744 +__v�ue +; \ + +745 +__ign�e +; \ + +746 +__cw +; \ + +747 +__cwtmp +; \ + +748 +__asm + + `__vީ�e + ("fnstcw %3\n\t" \ + +756 : "�" ( +__v�ue +), "=&q" ( +__ign�e +), "=m" ( +__cwtmp +), \ + +757 "=m" ( +__cw +) \ + +758 : "0" ( +__x +)); \ + +759 +__v�ue +) + +761 + `__�l�e_m�hcodeNP + ( +�� +, +__x +, \ + +762 +__v�ue +; \ + +763 +__ign�e +; \ + +764 +__cw +; \ + +765 +__cwtmp +; \ + +766 +__asm + + `__vީ�e + ("fnstcw %3\n\t" \ + +774 : "�" ( +__v�ue +), "=&q" ( +__ign�e +), "=m" ( +__cwtmp +), \ + +775 "=m" ( +__cw +) \ + +776 : "0" ( +__x +)); \ + +777 +__v�ue +) + +779 #ifde� +__FAST_MATH__ + + +780 + #__ldexp_code + \ + +781 +__v�ue +; \ + +782 +__asm + +__vީ�e__ + \ + +784 : "�" ( +__v�ue +�: "0" ( +__x +), "u" ((� +__y +)); \ + +785 +__v�ue + + + ) + +787 +__MATH_INLINE + + +788 + `__NTH + ( + $ldexp + ( +__x +, +__y +)) + +790 +__ldexp_code +; + +791 + } +} + +796 #i� +def�ed + +__USE_ISOC99 + || def�ed +__USE_MISC + + +798 #ifde� +__FAST_MATH__ + + +799 + $__�l�e_m�hcodeNP + ( +expm1 +, +__x +, +__expm1_code +) + +803 + #__M_SQRT2 + 1.41421356237309504880L + + ) + +805 #i�! + `__GNUC_PREREQ + (3, 5) + +806 + `__�l�e_m�hcodeNP + ( +log1p +, +__x +, \ + +807 +__v�ue +; \ + +808 i�( + `__�b� + ( +__x +�>�1.0 - 0.5 * +__M_SQRT2 +) \ + +809 +__v�ue + = + `logl + (1.0 + +__x +); \ + +811 +__asm + +__vީ�e__ + \ + +815 : "�" ( +__v�ue +�: "0" ( +__x +) : "st(1)"); \ + +816 +__v�ue +) + +821 + `__�l�e_m�hcodeNP + ( +as�h +, +__x +, \ + +822 +__y + = + `__�b� + ( +__x +); \ + +823 ( + `log1� + ( +__y + * __y / ( + `__libc_sq�l + (__y * __y + 1.0) + 1.0) + __y) \ + +824 * + $__sgn1l + ( +__x +))) + +826 + `__�l�e_m�hcodeNP + ( +acosh +, +__x +, \ + +827 + `logl + ( +__x + + + `__libc_sq�l + (__x - 1.0) * __libc_sqrtl (__x + 1.0))) + +829 + `__�l�e_m�hcodeNP + ( +��h +, +__x +, \ + +830 +__y + = + `__�b� + ( +__x +); \ + +831 -0.5 * + `log1� + (-( +__y + + __y�/ (1.0 + __y)�* + $__sgn1l + ( +__x +)) + +834 + `__�l�e_m�hcodeNP2 + ( +hyp� +, +__x +, +__y +, + +835 + `__libc_sq�l + ( +__x + * __x + +__y + * __y)) + +837 #i�! + `__GNUC_PREREQ + (3, 5) + +838 + `__�l�e_m�hcodeNP +( +logb +, +__x +, \ + +839 +__v�ue +; \ + +840 +__junk +; \ + +841 +__asm + +__vީ�e__ + \ + +843 : "�" ( +__junk +), "=u" ( +__v�ue +�: "0" ( +__x +)); \ + +844 +__v�ue +) + +850 #ifde� +__USE_ISOC99 + + +851 #ifde� +__FAST_MATH__ + + +853 #i�! + `__GNUC_PREREQ + (3, 5) + +854 + `__�l�e_m�h�_de�NP + ( +log2 +, "�d1; fxch; fyl2x", "0" ( +__x +) : "st(1)") + +857 +__MATH_INLINE + + +858 + `__NTH + ( + $ldexpf + ( +__x +, +__y +)) + +860 +__ldexp_code +; + +861 + } +} + +863 +__MATH_INLINE + + +864 +__NTH + ( + $ldex� + ( +__x +, +__y +)) + +866 +__ldexp_code +; + +867 + } +} + +869 +__�l�e_m�h�NP + ( +r�t +, "frndint") + +872 + #__̚t_code + \ + +873 +__̚�es +; \ + +874 +__asm__ + +__vީ�e__ + \ + +876 : "=m" ( +__̚�es +�: "t" ( +__x +) : "st"); \ + +877 +__̚�es + + + ) + +878 +__MATH_INLINE + + +879 +__NTH + ( + $̚tf + ( +__x +)) + +881 +__̚t_code +; + +882 + } +} + +883 +__MATH_INLINE + + +884 +__NTH + ( + $̚t + ( +__x +)) + +886 +__̚t_code +; + +887 + } +} + +888 +__MATH_INLINE + + +889 +__NTH + ( + $̚� + ( +__x +)) + +891 +__̚t_code +; + +892 + } +} + +893 #unde� +__̚t_code + + +895 + #__�r�t_code + \ + +896 +__�r��es +; \ + +897 +__asm__ + +__vީ�e__ + \ + +899 : "=m" ( +__�r��es +�: "t" ( +__x +) : "st"); \ + +900 +__�r��es + + + ) + +901 +__ex�nsi�__ + + +902 +__MATH_INLINE + + +903 +__NTH + ( + $�r�tf + ( +__x +)) + +905 +__�r�t_code +; + +906 + } +} + +907 +__ex�nsi�__ + + +908 +__MATH_INLINE + + +909 +__NTH + ( + $�r�t + ( +__x +)) + +911 +__�r�t_code +; + +912 + } +} + +913 +__ex�nsi�__ + + +914 +__MATH_INLINE + + +915 +__NTH + ( + $�r�� + ( +__x +)) + +917 +__�r�t_code +; + +918 + } +} + +919 #unde� +__�r�t_code + + +924 #ifde� +__USE_MISC + + +926 #i� +def�ed + +__FAST_MATH__ + && ! +__GNUC_PREREQ + (3, 5) + +927 +__�l�e_m�hcodeNP2 + ( +d�m +, +__x +, +__y +, \ + +928 +__v�ue +; \ + +929 +__�obb�ed +; \ + +930 +__asm + +__vީ�e__ + \ + +935 : "�" ( +__v�ue +), "=&a" ( +__�obb�ed +�: "0" ( +__x +), "u" ( +__y +) : "cc"); \ + +936 +__v�ue +) + +941 +__MATH_INLINE + + +942 +__NTH + ( + $__f��e + ( +__x +)) + +944 ( +__ex�nsi�__ + + +945 (((((uni� { +__d +; +__i +[2]; }�{__d: +__x +}).__i[1] + +947 + } +} + +952 #unde� +__��2_code + + +953 #ifde� +__FAST_MATH__ + + +954 #unde� +__expm1_code + + +955 #unde� +__exp_code + + +956 #unde� +__s�cos_code + + +963 #ifde� +__LIBC_INTERNAL_MATH_INLINES + + +964 +__�l�e_m�h� + ( +__��754_sq� +, "fsqrt") + +965 +__�l�e_m�hcode2 + ( +__��754_��2 +, +__y +, +__x +, + +966 +__v�ue +; + +967 +__asm + +__vީ�e__ + ("fpatan\n\t" + +968 : "�" ( +__v�ue +) + +969 : "0" ( +__x +), "u" ( +__y +) : "st(1)"); + +970 +__v�ue +;) + + @/usr/include/bits/nan.h + +19 #i�de� +_MATH_H + + +26 #i� +__GNUC_PREREQ +(3,3) + +28 + #NAN + ( + `__bu�t�_�nf + ("")) + + ) + +30 #�i� +def�ed + +__GNUC__ + + +32 + #NAN + \ + +33 ( +__ex�nsi�__ + \ + +34 ((uni� { +__l + + `__��ibu�__ + (( + `__mode__ + ( +__SI__ +))); +__d +; }) \ + +35 { +__l +: 0x7fc00000UL }). +__d +) + + ) + +39 + ~<�d�n.h +> + +41 #i� +__BYTE_ORDER + =� +__BIG_ENDIAN + + +42 + #__q�n_by�s + { 0x7f, 0xc0, 0, 0 } + + ) + +44 #i� +__BYTE_ORDER + =� +__LITTLE_ENDIAN + + +45 + #__q�n_by�s + { 0, 0, 0xc0, 0x7�} + + ) + +48 uni� { + m__c +[4]; + m__d +; } +__q�n_uni� + + +49 +__��ibu�__ + (( +__unu�d__ +)��{ +__q�n_by�s + }; + +50 + #NAN + ( +__q�n_uni� +. +__d +) + + ) + + @/usr/include/bits/netdb.h + +18 #i�de� +_NETDB_H + + +26 + sË� + + +28 * + mn_�me +; + +29 ** + mn_���s +; + +30 + mn_add�y� +; + +31 +u�t32_t + + mn_�t +; + + @/usr/include/bits/posix1_lim.h + +24 #i�def +_BITS_POSIX1_LIM_H + + +25 + #_BITS_POSIX1_LIM_H + 1 + + ) + +31 + #_POSIX_AIO_LISTIO_MAX + 2 + + ) + +34 + #_POSIX_AIO_MAX + 1 + + ) + +37 + #_POSIX_ARG_MAX + 4096 + + ) + +40 #ifde� +__USE_XOPEN2K + + +41 + #_POSIX_CHILD_MAX + 25 + + ) + +43 + #_POSIX_CHILD_MAX + 6 + + ) + +47 + #_POSIX_DELAYTIMER_MAX + 32 + + ) + +51 + #_POSIX_HOST_NAME_MAX + 255 + + ) + +54 + #_POSIX_LINK_MAX + 8 + + ) + +57 + #_POSIX_LOGIN_NAME_MAX + 9 + + ) + +60 + #_POSIX_MAX_CANON + 255 + + ) + +64 + #_POSIX_MAX_INPUT + 255 + + ) + +67 + #_POSIX_MQ_OPEN_MAX + 8 + + ) + +70 + #_POSIX_MQ_PRIO_MAX + 32 + + ) + +73 + #_POSIX_NAME_MAX + 14 + + ) + +76 #ifde� +__USE_XOPEN2K + + +77 + #_POSIX_NGROUPS_MAX + 8 + + ) + +79 + #_POSIX_NGROUPS_MAX + 0 + + ) + +83 #ifde� +__USE_XOPEN2K + + +84 + #_POSIX_OPEN_MAX + 20 + + ) + +86 + #_POSIX_OPEN_MAX + 16 + + ) + +89 #i�! +def�ed + +__USE_XOPEN2K + || def�ed +__USE_GNU + + +92 + #_POSIX_FD_SETSIZE + +_POSIX_OPEN_MAX + + + ) + +96 + #_POSIX_PATH_MAX + 256 + + ) + +99 + #_POSIX_PIPE_BUF + 512 + + ) + +103 + #_POSIX_RE_DUP_MAX + 255 + + ) + +106 + #_POSIX_RTSIG_MAX + 8 + + ) + +109 + #_POSIX_SEM_NSEMS_MAX + 256 + + ) + +112 + #_POSIX_SEM_VALUE_MAX + 32767 + + ) + +115 + #_POSIX_SIGQUEUE_MAX + 32 + + ) + +118 + #_POSIX_SSIZE_MAX + 32767 + + ) + +121 + #_POSIX_STREAM_MAX + 8 + + ) + +124 + #_POSIX_SYMLINK_MAX + 255 + + ) + +128 + #_POSIX_SYMLOOP_MAX + 8 + + ) + +131 + #_POSIX_TIMER_MAX + 32 + + ) + +134 + #_POSIX_TTY_NAME_MAX + 9 + + ) + +137 #ifde� +__USE_XOPEN2K + + +138 + #_POSIX_TZNAME_MAX + 6 + + ) + +140 + #_POSIX_TZNAME_MAX + 3 + + ) + +143 #i�! +def�ed + +__USE_XOPEN2K + || def�ed +__USE_GNU + + +145 + #_POSIX_QLIMIT + 1 + + ) + +149 + #_POSIX_HIWAT + +_POSIX_PIPE_BUF + + + ) + +152 + #_POSIX_UIO_MAXIOV + 16 + + ) + +156 + #_POSIX_CLOCKRES_MIN + 20000000 + + ) + +160 + ~<b�s/lo�l_lim.h +> + +163 #i�def +SSIZE_MAX + + +164 + #SSIZE_MAX + +LONG_MAX + + + ) + +171 #i�def +NGROUPS_MAX + + +172 + #NGROUPS_MAX + 8 + + ) + + @/usr/include/bits/posix2_lim.h + +22 #i�def +_BITS_POSIX2_LIM_H + + +23 + #_BITS_POSIX2_LIM_H + 1 + + ) + +27 + #_POSIX2_BC_BASE_MAX + 99 + + ) + +30 + #_POSIX2_BC_DIM_MAX + 2048 + + ) + +33 + #_POSIX2_BC_SCALE_MAX + 99 + + ) + +36 + #_POSIX2_BC_STRING_MAX + 1000 + + ) + +40 + #_POSIX2_COLL_WEIGHTS_MAX + 2 + + ) + +44 + #_POSIX2_EXPR_NEST_MAX + 32 + + ) + +47 + #_POSIX2_LINE_MAX + 2048 + + ) + +51 + #_POSIX2_RE_DUP_MAX + 255 + + ) + +55 + #_POSIX2_CHARCLASS_NAME_MAX + 14 + + ) + +62 #i�def +BC_BASE_MAX + + +63 + #BC_BASE_MAX + +_POSIX2_BC_BASE_MAX + + + ) + +65 #i�def +BC_DIM_MAX + + +66 + #BC_DIM_MAX + +_POSIX2_BC_DIM_MAX + + + ) + +68 #i�def +BC_SCALE_MAX + + +69 + #BC_SCALE_MAX + +_POSIX2_BC_SCALE_MAX + + + ) + +71 #i�def +BC_STRING_MAX + + +72 + #BC_STRING_MAX + +_POSIX2_BC_STRING_MAX + + + ) + +74 #i�def +COLL_WEIGHTS_MAX + + +75 + #COLL_WEIGHTS_MAX + 255 + + ) + +77 #i�def +EXPR_NEST_MAX + + +78 + #EXPR_NEST_MAX + +_POSIX2_EXPR_NEST_MAX + + + ) + +80 #i�def +LINE_MAX + + +81 + #LINE_MAX + +_POSIX2_LINE_MAX + + + ) + +83 #i�def +CHARCLASS_NAME_MAX + + +84 + #CHARCLASS_NAME_MAX + 2048 + + ) + +88 + #RE_DUP_MAX + (0x7fff) + + ) + + @/usr/include/bits/posix_opt.h + +19 #i�def +_BITS_POSIX_OPT_H + + +20 + #_BITS_POSIX_OPT_H + 1 + + ) + +23 + #_POSIX_JOB_CONTROL + 1 + + ) + +26 + #_POSIX_SAVED_IDS + 1 + + ) + +29 + #_POSIX_PRIORITY_SCHEDULING + 200809L + + ) + +32 + #_POSIX_SYNCHRONIZED_IO + 200809L + + ) + +35 + #_POSIX_FSYNC + 200809L + + ) + +38 + #_POSIX_MAPPED_FILES + 200809L + + ) + +41 + #_POSIX_MEMLOCK + 200809L + + ) + +44 + #_POSIX_MEMLOCK_RANGE + 200809L + + ) + +47 + #_POSIX_MEMORY_PROTECTION + 200809L + + ) + +50 + #_POSIX_CHOWN_RESTRICTED + 0 + + ) + +54 + #_POSIX_VDISABLE + '\0' + + ) + +57 + #_POSIX_NO_TRUNC + 1 + + ) + +60 + #_XOPEN_REALTIME + 1 + + ) + +63 + #_XOPEN_REALTIME_THREADS + 1 + + ) + +66 + #_XOPEN_SHM + 1 + + ) + +69 + #_POSIX_THREADS + 200809L + + ) + +72 + #_POSIX_REENTRANT_FUNCTIONS + 1 + + ) + +73 + #_POSIX_THREAD_SAFE_FUNCTIONS + 200809L + + ) + +76 + #_POSIX_THREAD_PRIORITY_SCHEDULING + 200809L + + ) + +79 + #_POSIX_THREAD_ATTR_STACKSIZE + 200809L + + ) + +82 + #_POSIX_THREAD_ATTR_STACKADDR + 200809L + + ) + +85 + #_POSIX_THREAD_PRIO_INHERIT + 200809L + + ) + +89 + #_POSIX_THREAD_PRIO_PROTECT + 200809L + + ) + +91 #ifde� +__USE_XOPEN2K8 + + +93 + #_POSIX_THREAD_ROBUST_PRIO_INHERIT + 200809L + + ) + +96 + #_POSIX_THREAD_ROBUST_PRIO_PROTECT + -1 + + ) + +100 + #_POSIX_SEMAPHORES + 200809L + + ) + +103 + #_POSIX_REALTIME_SIGNALS + 200809L + + ) + +106 + #_POSIX_ASYNCHRONOUS_IO + 200809L + + ) + +107 + #_POSIX_ASYNC_IO + 1 + + ) + +109 + #_LFS_ASYNCHRONOUS_IO + 1 + + ) + +111 + #_POSIX_PRIORITIZED_IO + 200809L + + ) + +114 + #_LFS64_ASYNCHRONOUS_IO + 1 + + ) + +117 + #_LFS_LARGEFILE + 1 + + ) + +118 + #_LFS64_LARGEFILE + 1 + + ) + +119 + #_LFS64_STDIO + 1 + + ) + +122 + #_POSIX_SHARED_MEMORY_OBJECTS + 200809L + + ) + +125 + #_POSIX_CPUTIME + 0 + + ) + +128 + #_POSIX_THREAD_CPUTIME + 0 + + ) + +131 + #_POSIX_REGEXP + 1 + + ) + +134 + #_POSIX_READER_WRITER_LOCKS + 200809L + + ) + +137 + #_POSIX_SHELL + 1 + + ) + +140 + #_POSIX_TIMEOUTS + 200809L + + ) + +143 + #_POSIX_SPIN_LOCKS + 200809L + + ) + +146 + #_POSIX_SPAWN + 200809L + + ) + +149 + #_POSIX_TIMERS + 200809L + + ) + +152 + #_POSIX_BARRIERS + 200809L + + ) + +155 + #_POSIX_MESSAGE_PASSING + 200809L + + ) + +158 + #_POSIX_THREAD_PROCESS_SHARED + 200809L + + ) + +161 + #_POSIX_MONOTONIC_CLOCK + 0 + + ) + +164 + #_POSIX_CLOCK_SELECTION + 200809L + + ) + +167 + #_POSIX_ADVISORY_INFO + 200809L + + ) + +170 + #_POSIX_IPV6 + 200809L + + ) + +173 + #_POSIX_RAW_SOCKETS + 200809L + + ) + +176 + #_POSIX2_CHAR_TERM + 200809L + + ) + +179 + #_POSIX_SPORADIC_SERVER + -1 + + ) + +180 + #_POSIX_THREAD_SPORADIC_SERVER + -1 + + ) + +183 + #_POSIX_TRACE + -1 + + ) + +184 + #_POSIX_TRACE_EVENT_FILTER + -1 + + ) + +185 + #_POSIX_TRACE_INHERIT + -1 + + ) + +186 + #_POSIX_TRACE_LOG + -1 + + ) + +189 + #_POSIX_TYPED_MEMORY_OBJECTS + -1 + + ) + + @/usr/include/bits/pthreadtypes.h + +18 #i�de� +_BITS_PTHREADTYPES_H + + +19 + #_BITS_PTHREADTYPES_H + 1 + + ) + +21 + ~<b�s/w�dsize.h +> + +23 #ifde� +__x86_64__ + + +24 #i� +__WORDSIZE + == 64 + +25 + #__SIZEOF_PTHREAD_ATTR_T + 56 + + ) + +26 + #__SIZEOF_PTHREAD_MUTEX_T + 40 + + ) + +27 + #__SIZEOF_PTHREAD_MUTEXATTR_T + 4 + + ) + +28 + #__SIZEOF_PTHREAD_COND_T + 48 + + ) + +29 + #__SIZEOF_PTHREAD_CONDATTR_T + 4 + + ) + +30 + #__SIZEOF_PTHREAD_RWLOCK_T + 56 + + ) + +31 + #__SIZEOF_PTHREAD_RWLOCKATTR_T + 8 + + ) + +32 + #__SIZEOF_PTHREAD_BARRIER_T + 32 + + ) + +33 + #__SIZEOF_PTHREAD_BARRIERATTR_T + 4 + + ) + +35 + #__SIZEOF_PTHREAD_ATTR_T + 32 + + ) + +36 + #__SIZEOF_PTHREAD_MUTEX_T + 32 + + ) + +37 + #__SIZEOF_PTHREAD_MUTEXATTR_T + 4 + + ) + +38 + #__SIZEOF_PTHREAD_COND_T + 48 + + ) + +39 + #__SIZEOF_PTHREAD_CONDATTR_T + 4 + + ) + +40 + #__SIZEOF_PTHREAD_RWLOCK_T + 44 + + ) + +41 + #__SIZEOF_PTHREAD_RWLOCKATTR_T + 8 + + ) + +42 + #__SIZEOF_PTHREAD_BARRIER_T + 20 + + ) + +43 + #__SIZEOF_PTHREAD_BARRIERATTR_T + 4 + + ) + +46 + #__SIZEOF_PTHREAD_ATTR_T + 36 + + ) + +47 + #__SIZEOF_PTHREAD_MUTEX_T + 24 + + ) + +48 + #__SIZEOF_PTHREAD_MUTEXATTR_T + 4 + + ) + +49 + #__SIZEOF_PTHREAD_COND_T + 48 + + ) + +50 + #__SIZEOF_PTHREAD_CONDATTR_T + 4 + + ) + +51 + #__SIZEOF_PTHREAD_RWLOCK_T + 32 + + ) + +52 + #__SIZEOF_PTHREAD_RWLOCKATTR_T + 8 + + ) + +53 + #__SIZEOF_PTHREAD_BARRIER_T + 20 + + ) + +54 + #__SIZEOF_PTHREAD_BARRIERATTR_T + 4 + + ) + +60 + t�h�ad_t +; + +63 + u�h�ad_��_t + + +65 + m__size +[ +__SIZEOF_PTHREAD_ATTR_T +]; + +66 + m__�ign +; + +68 #i�de� +__have_�h�ad_��_t + + +69 +�h�ad_��_t + + t�h�ad_��_t +; + +70 + #__have_�h�ad_��_t + 1 + + ) + +74 #ifde� +__x86_64__ + + +75 + s__�h�ad_����_li� + + +77 +__�h�ad_����_li� + * + m__�ev +; + +78 +__�h�ad_����_li� + * + m__�xt +; + +79 } + t__�h�ad_li�_t +; + +81 + s__�h�ad_����_�i� + + +83 +__�h�ad_����_�i� + * + m__�xt +; + +84 } + t__�h�ad_�i�_t +; + +92 + s__�h�ad_mu�x_s + + +94 + m__lock +; + +95 + m__cou� +; + +96 + m__ow�r +; + +97 #ifde� +__x86_64__ + + +98 + m__nu�rs +; + +102 + m__k�d +; + +103 #ifde� +__x86_64__ + + +104 + m__��s +; + +105 + m__�isi� +; + +106 +__�h�ad_li�_t + + m__li� +; + +107 + #__PTHREAD_MUTEX_HAVE_PREV + 1 + + ) + +108 + #__PTHREAD_MUTEX_HAVE_ELISION + 1 + + ) + +110 + m__nu�rs +; + +111 +__ex�nsi�__ + union + +115 + m__e��s +; + +116 + m__�isi� +; + +117 + #__��s + +d +. +__e��s + + + ) + +118 + #__�isi� + +d +. +__�isi� + + + ) + +119 + #__PTHREAD_MUTEX_HAVE_ELISION + 2 + + ) + +120 } + md +; + +121 +__�h�ad_�i�_t + + m__li� +; + +124 } + m__d�a +; + +125 + m__size +[ +__SIZEOF_PTHREAD_MUTEX_T +]; + +126 + m__�ign +; + +127 } + t�h�ad_mu�x_t +; + +131 + m__size +[ +__SIZEOF_PTHREAD_MUTEXATTR_T +]; + +132 + m__�ign +; + +133 } + t�h�ad_mu�x��_t +; + +142 + m__lock +; + +143 + m__fu�x +; + +144 +__ex�nsi�__ + + m__tٮ_�q +; + +145 +__ex�nsi�__ + + m__wakeup_�q +; + +146 +__ex�nsi�__ + + m__wok�_�q +; + +147 * + m__mu�x +; + +148 + m__nwa��s +; + +149 + m__br�d��_�q +; + +150 } + m__d�a +; + +151 + m__size +[ +__SIZEOF_PTHREAD_COND_T +]; + +152 +__ex�nsi�__ + + m__�ign +; + +153 } + t�h�ad_c�d_t +; + +157 + m__size +[ +__SIZEOF_PTHREAD_CONDATTR_T +]; + +158 + m__�ign +; + +159 } + t�h�ad_c�d��_t +; + +163 + t�h�ad_key_t +; + +167 + t�h�ad_��_t +; + +170 #i� +def�ed + +__USE_UNIX98 + || def�ed +__USE_XOPEN2K + + +175 #ifde� +__x86_64__ + + +178 + m__lock +; + +179 + m__�_�ad�s +; + +180 + m__�ad�s_wakeup +; + +181 + m__wr��_wakeup +; + +182 + m__�_�ad�s_queued +; + +183 + m__�_wr��s_queued +; + +184 + m__wr�� +; + +185 + m__sh�ed +; + +186 + m__�d1 +; + +187 + m__�d2 +; + +190 + m__�ags +; + +191 + #__PTHREAD_RWLOCK_INT_FLAGS_SHARED + 1 + + ) + +192 } + m__d�a +; + +196 + m__lock +; + +197 + m__�_�ad�s +; + +198 + m__�ad�s_wakeup +; + +199 + m__wr��_wakeup +; + +200 + m__�_�ad�s_queued +; + +201 + m__�_wr��s_queued +; + +204 + m__�ags +; + +205 + m__sh�ed +; + +206 + m__�d1 +; + +207 + m__�d2 +; + +208 + m__wr�� +; + +209 } + m__d�a +; + +211 + m__size +[ +__SIZEOF_PTHREAD_RWLOCK_T +]; + +212 + m__�ign +; + +213 } + t�h�ad_rwlock_t +; + +217 + m__size +[ +__SIZEOF_PTHREAD_RWLOCKATTR_T +]; + +218 + m__�ign +; + +219 } + t�h�ad_rwlock��_t +; + +223 #ifde� +__USE_XOPEN2K + + +225 vީ�� + t�h�ad_��lock_t +; + +232 + m__size +[ +__SIZEOF_PTHREAD_BARRIER_T +]; + +233 + m__�ign +; + +234 } + t�h�ad_b�r�r_t +; + +238 + m__size +[ +__SIZEOF_PTHREAD_BARRIERATTR_T +]; + +239 + m__�ign +; + +240 } + t�h�ad_b�r���r_t +; + +244 #i�de� +__x86_64__ + + +246 + #__��nup_f�_��ibu� + + `__��ibu�__ + (( + `__�g�rm__ + (1))) + + ) + + @/usr/include/bits/select.h + +18 #i�de� +_SYS_SELECT_H + + +22 + ~<b�s/w�dsize.h +> + +25 #i� +def�ed + +__GNUC__ + && __GNUC__ >= 2 + +27 #i� +__WORDSIZE + == 64 + +28 + #__FD_ZERO_STOS + "�osq" + + ) + +30 + #__FD_ZERO_STOS + "�o�" + + ) + +33 + #__FD_ZERO +( +fd� +) \ + +35 +__d0 +, +__d1 +; \ + +36 +__asm__ + + `__vީ�e__ + ("�d;��; " +__FD_ZERO_STOS + \ + +37 : "=c" ( +__d0 +), "=D" ( +__d1 +) \ + +38 : "a" (0), "0" ( ( +fd_�t +) \ + +39 / ( +__fd_mask +)), \ + +40 "1" (& + `__FDS_BITS + ( +fd� +)[0]) \ + +42 } 0) + + ) + +48 + #__FD_ZERO +( +�t +) \ + +50 +__i +; \ + +51 +fd_�t + * +__�r + = ( +�t +); \ + +52 +__i + = 0; __�< ( +fd_�t +�/ ( +__fd_mask +); ++__i) \ + +53 + `__FDS_BITS + ( +__�r +)[ +__i +] = 0; \ + +54 } 0) + + ) + +58 + #__FD_SET +( +d +, +�t +) \ + +59 ((�( + `__FDS_BITS + ( +�t +)[ + `__FD_ELT + ( +d +)] |� + `__FD_MASK + (d))) + + ) + +60 + #__FD_CLR +( +d +, +�t +) \ + +61 ((�( + `__FDS_BITS + ( +�t +)[ + `__FD_ELT + ( +d +)] &�~ + `__FD_MASK + (d))) + + ) + +62 + #__FD_ISSET +( +d +, +�t +) \ + +63 (( + `__FDS_BITS + ( +�t +)[ + `__FD_ELT + ( +d +)] & + `__FD_MASK + (d)�!�0) + + ) + + @/usr/include/bits/select2.h + +19 #i�de� +_SYS_SELECT_H + + +24 +__fd�t_chk + ( +__d +); + +25 + $__fd�t_w�n + ( +__d +) + +26 + `__w�ljr + ("bit outside of fd_set selected"); + +27 #unde� +__FD_ELT + + +28 + #__FD_ELT +( +d +) \ + +29 +__ex�nsi�__ + \ + +30 ({ +__d + = ( +d +); \ + +31 ( + `__bu�t�_cڡ�t_p + ( +__d +) \ + +32 ? (0 <� +__d + && __d < +__FD_SETSIZE + \ + +33 ? ( +__d + / +__NFDBITS +) \ + +34 : + `__fd�t_w�n + ( +__d +)) \ + +35 : + `__fd�t_chk + ( +__d +)); + } +}) + + ) + + @/usr/include/bits/setjmp.h + +19 #i�de� +_BITS_SETJMP_H + + +20 + #_BITS_SETJMP_H + 1 + + ) + +22 #i�! +def�ed + +_SETJMP_H + && !def�ed +_PTHREAD_H + + +26 + ~<b�s/w�dsize.h +> + +28 #i�de� +_ASM + + +30 #i� +__WORDSIZE + == 64 + +31 + t__jmp_buf +[8]; + +32 #�i� +def�ed + +__x86_64__ + + +33 +__ex�nsi�__ + + t__jmp_buf +[8]; + +35 + t__jmp_buf +[6]; + + @/usr/include/bits/sigaction.h + +19 #i�de� +_SIGNAL_H + + +24 + ssiga�i� + + +27 #ifde� +__USE_POSIX199309 + + +31 +__sigh�d�r_t + + m�_h�d�r +; + +33 (* + m�_siga�i� +�(, + msig�fo_t + *, *); + +35 + m__siga�i�_h�d�r +; + +36 + #�_h�d�r + +__siga�i�_h�d�r +. +�_h�d�r + + + ) + +37 + #�_siga�i� + +__siga�i�_h�d�r +. +�_siga�i� + + + ) + +39 +__sigh�d�r_t + + m�_h�d�r +; + +43 +__sig�t_t + + m�_mask +; + +46 + m�_�ags +; + +49 (* + m�_��ܔ +) (); + +53 + #SA_NOCLDSTOP + 1 + + ) + +54 + #SA_NOCLDWAIT + 2 + + ) + +55 + #SA_SIGINFO + 4 + + ) + +57 #i� +def�ed + +__USE_UNIX98 + || def�ed +__USE_MISC + + +58 + #SA_ONSTACK + 0x08000000 + + ) + +60 #i� +def�ed + +__USE_UNIX98 + || def�ed +__USE_MISC + || def�ed +__USE_XOPEN2K8 + + +61 + #SA_RESTART + 0x10000000 + + ) + +62 + #SA_NODEFER + 0x40000000 + + ) + +64 + #SA_RESETHAND + 0x80000000 + + ) + +66 #ifde� +__USE_MISC + + +67 + #SA_INTERRUPT + 0x20000000 + + ) + +70 + #SA_NOMASK + +SA_NODEFER + + + ) + +71 + #SA_ONESHOT + +SA_RESETHAND + + + ) + +72 + #SA_STACK + +SA_ONSTACK + + + ) + +76 + #SIG_BLOCK + 0 + + ) + +77 + #SIG_UNBLOCK + 1 + + ) + +78 + #SIG_SETMASK + 2 + + ) + + @/usr/include/bits/sigcontext.h + +18 #i�de� +_BITS_SIGCONTEXT_H + + +19 + #_BITS_SIGCONTEXT_H + 1 + + ) + +21 #i�! +def�ed + +_SIGNAL_H + && !def�ed +_SYS_UCONTEXT_H + + +25 + #FP_XSTATE_MAGIC1 + 0x46505853U + + ) + +26 + #FP_XSTATE_MAGIC2 + 0x46505845U + + ) + +27 + #FP_XSTATE_MAGIC2_SIZE + ( +FP_XSTATE_MAGIC2 +) + + ) + +29 + s_�x_sw_by�s + + +31 +__u�t32_t + + mmagic1 +; + +32 +__u�t32_t + + mex�nded_size +; + +33 +__u�t64_t + + mx��e_bv +; + +34 +__u�t32_t + + mx��e_size +; + +35 +__u�t32_t + + m�dd�g +[7]; + +38 + s_�g + + +40 + msignifi�nd +[4]; + +41 + mexpڒt +; + +44 + s_�x�g + + +46 + msignifi�nd +[4]; + +47 + mexpڒt +; + +48 + m�dd�g +[3]; + +51 + s_xmm�g + + +53 +__u�t32_t + + m�em�t +[4]; + +58 #i�de� +__x86_64__ + + +60 + s_塩e + + +63 +__u�t32_t + + mcw +; + +64 +__u�t32_t + + msw +; + +65 +__u�t32_t + + m�g +; + +66 +__u�t32_t + + m�off +; + +67 +__u�t32_t + + mcs�l +; + +68 +__u�t32_t + + md�aoff +; + +69 +__u�t32_t + + md�a�l +; + +70 +_�g + + m_� +[8]; + +71 + m��us +; + +72 + mmagic +; + +75 +__u�t32_t + + m_fx�_�v +[6]; + +76 +__u�t32_t + + mmxc� +; + +77 +__u�t32_t + + m��rved +; + +78 +_�x�g + + m_fx�_� +[8]; + +79 +_xmm�g + + m_xmm +[8]; + +80 +__u�t32_t + + m�dd�g +[56]; + +83 #i�de� +sigcڋxt_�ru� + + +88 + #sigcڋxt_�ru� + +sigcڋxt + + + ) + +91 + #X86_FXSR_MAGIC + 0x0000 + + ) + +93 + ssigcڋxt + + +95 + mgs +, + m__gsh +; + +96 + mfs +, + m__fsh +; + +97 + mes +, + m__esh +; + +98 + mds +, + m__dsh +; + +99 + medi +; + +100 + mesi +; + +101 + mebp +; + +102 + me� +; + +103 + mebx +; + +104 + medx +; + +105 + mecx +; + +106 + m�x +; + +107 + m��no +; + +108 + m�r +; + +109 + me� +; + +110 + mcs +, + m__csh +; + +111 + me�ags +; + +112 + me�_�_sig�l +; + +113 + mss +, + m__ssh +; + +114 +_塩e + * + m塩e +; + +115 + m�dmask +; + +116 + m�2 +; + +121 + s_塩e + + +124 +__u�t16_t + + mcwd +; + +125 +__u�t16_t + + mswd +; + +126 +__u�t16_t + + m�w +; + +127 +__u�t16_t + + mf� +; + +128 +__u�t64_t + + mr� +; + +129 +__u�t64_t + + mrdp +; + +130 +__u�t32_t + + mmxc� +; + +131 +__u�t32_t + + mmx�_mask +; + +132 +_�x�g + + m_� +[8]; + +133 +_xmm�g + + m_xmm +[16]; + +134 +__u�t32_t + + m�dd�g +[24]; + +137 + ssigcڋxt + + +139 +__u�t64_t + + mr8 +; + +140 +__u�t64_t + + mr9 +; + +141 +__u�t64_t + + mr10 +; + +142 +__u�t64_t + + mr11 +; + +143 +__u�t64_t + + mr12 +; + +144 +__u�t64_t + + mr13 +; + +145 +__u�t64_t + + mr14 +; + +146 +__u�t64_t + + mr15 +; + +147 +__u�t64_t + + mrdi +; + +148 +__u�t64_t + + mrsi +; + +149 +__u�t64_t + + mrbp +; + +150 +__u�t64_t + + mrbx +; + +151 +__u�t64_t + + mrdx +; + +152 +__u�t64_t + + m�x +; + +153 +__u�t64_t + + mrcx +; + +154 +__u�t64_t + + mr� +; + +155 +__u�t64_t + + mr� +; + +156 +__u�t64_t + + me�ags +; + +157 + mcs +; + +158 + mgs +; + +159 + mfs +; + +160 + m__�d0 +; + +161 +__u�t64_t + + m�r +; + +162 +__u�t64_t + + m��no +; + +163 +__u�t64_t + + m�dmask +; + +164 +__u�t64_t + + m�2 +; + +165 +__ex�nsi�__ + union + +167 +_塩e + * + m塩e +; + +168 +__u�t64_t + + m__塩e_w�d +; + +170 +__u�t64_t + + m__��rved1 + [8]; + +175 + s_x�ve_hdr + + +177 +__u�t64_t + + mx��e_bv +; + +178 +__u�t64_t + + m��rved1 +[2]; + +179 +__u�t64_t + + m��rved2 +[5]; + +182 + s_ymmh_��e + + +184 +__u�t32_t + + mymmh_�a� +[64]; + +187 + s_x��e + + +189 +_塩e + + m塩e +; + +190 +_x�ve_hdr + + mx��e_hdr +; + +191 +_ymmh_��e + + mymmh +; + + @/usr/include/bits/siginfo.h + +19 #i�! +def�ed + +_SIGNAL_H + && !def�ed +__�ed_sig�fo_t + \ + +20 && ! +def�ed + + g__�ed_sigev�t_t + + +24 + ~<b�s/w�dsize.h +> + +26 #i�(! +def�ed + +__have_sigv�_t + \ + +27 && ( +def�ed + + g_SIGNAL_H + || def�ed + g__�ed_sig�fo_t + \ + +28 || +def�ed + + g__�ed_sigev�t_t +)) + +29 + #__have_sigv�_t + 1 + + ) + +32 + usigv� + + +34 + msiv�_�t +; + +35 * + msiv�_�r +; + +36 } + tsigv�_t +; + +39 #i�(! +def�ed + +__have_sig�fo_t + \ + +40 && ( +def�ed + + g_SIGNAL_H + || def�ed + g__�ed_sig�fo_t +)) + +41 + #__have_sig�fo_t + 1 + + ) + +43 + #__SI_MAX_SIZE + 128 + + ) + +44 #i� +__WORDSIZE + == 64 + +45 + #__SI_PAD_SIZE + (( +__SI_MAX_SIZE + / ()�- 4) + + ) + +47 + #__SI_PAD_SIZE + (( +__SI_MAX_SIZE + / ()�- 3) + + ) + +50 #i� +def�ed + +__x86_64__ + && +__WORDSIZE + == 32 + +55 +__�ock_t + + t__��ibu�__ + (( + t__�ig�d__ + (4))� + t__sigchld_�ock_t +; + +56 + #__SI_ALIGNMENT + + `__��ibu�__ + (( + `__�ig�d__ + (8))) + + ) + +58 +__�ock_t + + t__sigchld_�ock_t +; + +59 + #__SI_ALIGNMENT + + + ) + +64 +si_signo +; + +65 +si_��o +; + +67 +si_code +; + +71 +_�d +[ +__SI_PAD_SIZE +]; + +76 +__pid_t + +si_pid +; + +77 +__uid_t + +si_uid +; + +78 } +_k�l +; + +83 +si_tid +; + +84 +si_ov�run +; + +85 +sigv�_t + +si_sigv� +; + +86 } +_tim� +; + +91 +__pid_t + +si_pid +; + +92 +__uid_t + +si_uid +; + +93 +sigv�_t + +si_sigv� +; + +94 } +_� +; + +99 +__pid_t + +si_pid +; + +100 +__uid_t + +si_uid +; + +101 +si_��us +; + +102 +__sigchld_�ock_t + +si_utime +; + +103 +__sigchld_�ock_t + +si_�ime +; + +104 } +_sigchld +; + +109 * +si_addr +; + +110 +si_addr_lsb +; + +111 } +_sig�u� +; + +116 +si_b�d +; + +117 +si_fd +; + +118 } +_sigp�l +; + +123 * +_��_addr +; + +124 +_sys�� +; + +125 +_�ch +; + +126 } +_sigsys +; + +127 } +_sif�lds +; + +128 } + tsig�fo_t + + t__SI_ALIGNMENT +; + +132 + #si_pid + +_sif�lds +. +_k�l +. +si_pid + + + ) + +133 + #si_uid + +_sif�lds +. +_k�l +. +si_uid + + + ) + +134 + #si_tim�id + +_sif�lds +. +_tim� +. +si_tid + + + ) + +135 + #si_ov�run + +_sif�lds +. +_tim� +. +si_ov�run + + + ) + +136 + #si_��us + +_sif�lds +. +_sigchld +. +si_��us + + + ) + +137 + #si_utime + +_sif�lds +. +_sigchld +. +si_utime + + + ) + +138 + #si_�ime + +_sif�lds +. +_sigchld +. +si_�ime + + + ) + +139 + #si_v�ue + +_sif�lds +. +_� +. +si_sigv� + + + ) + +140 + #si_�t + +_sif�lds +. +_� +. +si_sigv� +. +siv�_�t + + + ) + +141 + #si_�r + +_sif�lds +. +_� +. +si_sigv� +. +siv�_�r + + + ) + +142 + #si_addr + +_sif�lds +. +_sig�u� +. +si_addr + + + ) + +143 + #si_addr_lsb + +_sif�lds +. +_sig�u� +. +si_addr_lsb + + + ) + +144 + #si_b�d + +_sif�lds +. +_sigp�l +. +si_b�d + + + ) + +145 + #si_fd + +_sif�lds +. +_sigp�l +. +si_fd + + + ) + +146 + #si_��_addr + +_sif�lds +. +_sigsys +. +_��_addr + + + ) + +147 + #si_sys�� + +_sif�lds +. +_sigsys +. +_sys�� + + + ) + +148 + #si_�ch + +_sif�lds +. +_sigsys +. +_�ch + + + ) + +155 +SI_ASYNCNL + = -60, + +156 + #SI_ASYNCNL + +SI_ASYNCNL + + + ) + +157 +SI_TKILL + = -6, + +158 + #SI_TKILL + +SI_TKILL + + + ) + +159 +SI_SIGIO +, + +160 + #SI_SIGIO + +SI_SIGIO + + + ) + +161 +SI_ASYNCIO +, + +162 + #SI_ASYNCIO + +SI_ASYNCIO + + + ) + +163 +SI_MESGQ +, + +164 + #SI_MESGQ + +SI_MESGQ + + + ) + +165 +SI_TIMER +, + +166 + #SI_TIMER + +SI_TIMER + + + ) + +167 +SI_QUEUE +, + +168 + #SI_QUEUE + +SI_QUEUE + + + ) + +169 +SI_USER +, + +170 + #SI_USER + +SI_USER + + + ) + +171 +SI_KERNEL + = 0x80 + +172 + #SI_KERNEL + +SI_KERNEL + + + ) + +179 +ILL_ILLOPC + = 1, + +180 + #ILL_ILLOPC + +ILL_ILLOPC + + + ) + +181 +ILL_ILLOPN +, + +182 + #ILL_ILLOPN + +ILL_ILLOPN + + + ) + +183 +ILL_ILLADR +, + +184 + #ILL_ILLADR + +ILL_ILLADR + + + ) + +185 +ILL_ILLTRP +, + +186 + #ILL_ILLTRP + +ILL_ILLTRP + + + ) + +187 +ILL_PRVOPC +, + +188 + #ILL_PRVOPC + +ILL_PRVOPC + + + ) + +189 +ILL_PRVREG +, + +190 + #ILL_PRVREG + +ILL_PRVREG + + + ) + +191 +ILL_COPROC +, + +192 + #ILL_COPROC + +ILL_COPROC + + + ) + +193 +ILL_BADSTK + + +194 + #ILL_BADSTK + +ILL_BADSTK + + + ) + +200 +FPE_INTDIV + = 1, + +201 + #FPE_INTDIV + +FPE_INTDIV + + + ) + +202 +FPE_INTOVF +, + +203 + #FPE_INTOVF + +FPE_INTOVF + + + ) + +204 +FPE_FLTDIV +, + +205 + #FPE_FLTDIV + +FPE_FLTDIV + + + ) + +206 +FPE_FLTOVF +, + +207 + #FPE_FLTOVF + +FPE_FLTOVF + + + ) + +208 +FPE_FLTUND +, + +209 + #FPE_FLTUND + +FPE_FLTUND + + + ) + +210 +FPE_FLTRES +, + +211 + #FPE_FLTRES + +FPE_FLTRES + + + ) + +212 +FPE_FLTINV +, + +213 + #FPE_FLTINV + +FPE_FLTINV + + + ) + +214 +FPE_FLTSUB + + +215 + #FPE_FLTSUB + +FPE_FLTSUB + + + ) + +221 +SEGV_MAPERR + = 1, + +222 + #SEGV_MAPERR + +SEGV_MAPERR + + + ) + +223 +SEGV_ACCERR + + +224 + #SEGV_ACCERR + +SEGV_ACCERR + + + ) + +230 +BUS_ADRALN + = 1, + +231 + #BUS_ADRALN + +BUS_ADRALN + + + ) + +232 +BUS_ADRERR +, + +233 + #BUS_ADRERR + +BUS_ADRERR + + + ) + +234 +BUS_OBJERR +, + +235 + #BUS_OBJERR + +BUS_OBJERR + + + ) + +236 +BUS_MCEERR_AR +, + +237 + #BUS_MCEERR_AR + +BUS_MCEERR_AR + + + ) + +238 +BUS_MCEERR_AO + + +239 + #BUS_MCEERR_AO + +BUS_MCEERR_AO + + + ) + +245 +TRAP_BRKPT + = 1, + +246 + #TRAP_BRKPT + +TRAP_BRKPT + + + ) + +247 +TRAP_TRACE + + +248 + #TRAP_TRACE + +TRAP_TRACE + + + ) + +254 +CLD_EXITED + = 1, + +255 + #CLD_EXITED + +CLD_EXITED + + + ) + +256 +CLD_KILLED +, + +257 + #CLD_KILLED + +CLD_KILLED + + + ) + +258 +CLD_DUMPED +, + +259 + #CLD_DUMPED + +CLD_DUMPED + + + ) + +260 +CLD_TRAPPED +, + +261 + #CLD_TRAPPED + +CLD_TRAPPED + + + ) + +262 +CLD_STOPPED +, + +263 + #CLD_STOPPED + +CLD_STOPPED + + + ) + +264 +CLD_CONTINUED + + +265 + #CLD_CONTINUED + +CLD_CONTINUED + + + ) + +271 +POLL_IN + = 1, + +272 + #POLL_IN + +POLL_IN + + + ) + +273 +POLL_OUT +, + +274 + #POLL_OUT + +POLL_OUT + + + ) + +275 +POLL_MSG +, + +276 + #POLL_MSG + +POLL_MSG + + + ) + +277 +POLL_ERR +, + +278 + #POLL_ERR + +POLL_ERR + + + ) + +279 +POLL_PRI +, + +280 + #POLL_PRI + +POLL_PRI + + + ) + +281 +POLL_HUP + + +282 + #POLL_HUP + +POLL_HUP + + + ) + +285 #unde� +__�ed_sig�fo_t + + +289 #i�( +def�ed + +_SIGNAL_H + || def�ed +__�ed_sigev�t_t +) \ + +290 && ! +def�ed + +__have_sigev�t_t + + +291 + #__have_sigev�t_t + 1 + + ) + +294 + #__SIGEV_MAX_SIZE + 64 + + ) + +295 #i� +__WORDSIZE + == 64 + +296 + #__SIGEV_PAD_SIZE + (( +__SIGEV_MAX_SIZE + / ()�- 4) + + ) + +298 + #__SIGEV_PAD_SIZE + (( +__SIGEV_MAX_SIZE + / ()�- 3) + + ) + +302 #i�de� +__have_�h�ad_��_t + + +303 +�h�ad_��_t + + t�h�ad_��_t +; + +304 + #__have_�h�ad_��_t + 1 + + ) + +307 + ssigev�t + + +309 +sigv�_t + +sigev_v�ue +; + +310 +sigev_signo +; + +311 +sigev_n�ify +; + +315 +_�d +[ +__SIGEV_PAD_SIZE +]; + +319 +__pid_t + +_tid +; + +323 (* +_fun�i� +�( +sigv�_t +); + +324 +�h�ad_��_t + * +_��ibu� +; + +325 } +_sigev_th�ad +; + +326 } +_sigev_un +; + +327 } + tsigev�t_t +; + +330 + #sigev_n�ify_fun�i� + +_sigev_un +. +_sigev_th�ad +. +_fun�i� + + + ) + +331 + #sigev_n�ify_��ibu�s + +_sigev_un +. +_sigev_th�ad +. +_��ibu� + + + ) + +336 +SIGEV_SIGNAL + = 0, + +337 + #SIGEV_SIGNAL + +SIGEV_SIGNAL + + + ) + +338 +SIGEV_NONE +, + +339 + #SIGEV_NONE + +SIGEV_NONE + + + ) + +340 +SIGEV_THREAD +, + +341 + #SIGEV_THREAD + +SIGEV_THREAD + + + ) + +343 +SIGEV_THREAD_ID + = 4 + +344 + #SIGEV_THREAD_ID + +SIGEV_THREAD_ID + + + ) + + @/usr/include/bits/signum.h + +19 #ifdef +_SIGNAL_H + + +22 + #SIG_ERR + (( +__sigh�d�r_t +�-1� + + ) + +23 + #SIG_DFL + (( +__sigh�d�r_t +�0� + + ) + +24 + #SIG_IGN + (( +__sigh�d�r_t +�1� + + ) + +26 #ifde� +__USE_UNIX98 + + +27 + #SIG_HOLD + (( +__sigh�d�r_t +�2� + + ) + +32 + #SIGHUP + 1 + + ) + +33 + #SIGINT + 2 + + ) + +34 + #SIGQUIT + 3 + + ) + +35 + #SIGILL + 4 + + ) + +36 + #SIGTRAP + 5 + + ) + +37 + #SIGABRT + 6 + + ) + +38 + #SIGIOT + 6 + + ) + +39 + #SIGBUS + 7 + + ) + +40 + #SIGFPE + 8 + + ) + +41 + #SIGKILL + 9 + + ) + +42 + #SIGUSR1 + 10 + + ) + +43 + #SIGSEGV + 11 + + ) + +44 + #SIGUSR2 + 12 + + ) + +45 + #SIGPIPE + 13 + + ) + +46 + #SIGALRM + 14 + + ) + +47 + #SIGTERM + 15 + + ) + +48 + #SIGSTKFLT + 16 + + ) + +49 + #SIGCLD + +SIGCHLD + + + ) + +50 + #SIGCHLD + 17 + + ) + +51 + #SIGCONT + 18 + + ) + +52 + #SIGSTOP + 19 + + ) + +53 + #SIGTSTP + 20 + + ) + +54 + #SIGTTIN + 21 + + ) + +55 + #SIGTTOU + 22 + + ) + +56 + #SIGURG + 23 + + ) + +57 + #SIGXCPU + 24 + + ) + +58 + #SIGXFSZ + 25 + + ) + +59 + #SIGVTALRM + 26 + + ) + +60 + #SIGPROF + 27 + + ) + +61 + #SIGWINCH + 28 + + ) + +62 + #SIGPOLL + +SIGIO + + + ) + +63 + #SIGIO + 29 + + ) + +64 + #SIGPWR + 30 + + ) + +65 + #SIGSYS + 31 + + ) + +66 + #SIGUNUSED + 31 + + ) + +68 + #_NSIG + 65 + + ) + +71 + #SIGRTMIN + ( + `__libc_cu��t_sig�m� + ()) + + ) + +72 + #SIGRTMAX + ( + `__libc_cu��t_sig�max + ()) + + ) + +76 + #__SIGRTMIN + 32 + + ) + +77 + #__SIGRTMAX + ( +_NSIG + - 1) + + ) + + @/usr/include/bits/sigset.h + +19 #i�def +_SIGSET_H_ty�s + + +20 + #_SIGSET_H_ty�s + 1 + + ) + +22 + t__sig_�omic_t +; + +26 + #_SIGSET_NWORDS + (1024 / (8 * ())) + + ) + +29 + m__v� +[ +_SIGSET_NWORDS +]; + +30 } + t__sig�t_t +; + +41 #i�! +def�ed + +_SIGSET_H_�s + && def�ed +_SIGNAL_H + + +42 + #_SIGSET_H_�s + 1 + + ) + +44 #i�de� +_EXTERN_INLINE + + +45 + #_EXTERN_INLINE + +__ex��_�l�e + + + ) + +49 + #__sigmask +( +sig +) \ + +50 (((�1�<< ((( +sig +�- 1�% (8 * ()))) + + ) + +53 + #__sigw�d +( +sig +�(((sig�- 1�/ (8 * ())) + + ) + +55 #i� +def�ed + +__GNUC__ + && __GNUC__ >= 2 + +56 + #__sigem�y�t +( +�t +) \ + +57 ( + `__ex�nsi�__ + ({ +__�t + = +_SIGSET_NWORDS +; \ + +58 +sig�t_t + * +__�t + = ( +�t +); \ + +59 -- +__�t + >�0� +__�t +-> +__v� +[__cnt] = 0; \ + +60 0; })) + + ) + +61 + #__sigf�l�t +( +�t +) \ + +62 ( + `__ex�nsi�__ + ({ +__�t + = +_SIGSET_NWORDS +; \ + +63 +sig�t_t + * +__�t + = ( +�t +); \ + +64 -- +__�t + >�0� +__�t +-> +__v� +[__cnt] = ~0UL; \ + +65 0; })) + + ) + +67 #ifde� +__USE_GNU + + +71 + #__sigi�m�y�t +( +�t +) \ + +72 ( + `__ex�nsi�__ + ({ +__�t + = +_SIGSET_NWORDS +; \ + +73 cڡ +sig�t_t + * +__�t + = ( +�t +); \ + +74 +__�t + = +__�t +-> +__v� +[-- +__�t +]; \ + +75 ! +__�t + && -- +__�t + >= 0) \ + +76 +__�t + = +__�t +-> +__v� +[ +__�t +]; \ + +77 +__�t + =�0; })) + + ) + +78 + #__sig�d�t +( +de� +, +�� +, +right +) \ + +79 ( + `__ex�nsi�__ + ({ +__�t + = +_SIGSET_NWORDS +; \ + +80 +sig�t_t + * +__de� + = ( +de� +); \ + +81 cڡ +sig�t_t + * +__�� + = ( +�� +); \ + +82 cڡ +sig�t_t + * +__right + = ( +right +); \ + +83 -- +__�t + >= 0) \ + +84 +__de� +-> +__v� +[ +__�t +] = ( +__�� +->__val[__cnt] \ + +85 & +__right +-> +__v� +[ +__�t +]); \ + +86 0; })) + + ) + +87 + #__sigܣt +( +de� +, +�� +, +right +) \ + +88 ( + `__ex�nsi�__ + ({ +__�t + = +_SIGSET_NWORDS +; \ + +89 +sig�t_t + * +__de� + = ( +de� +); \ + +90 cڡ +sig�t_t + * +__�� + = ( +�� +); \ + +91 cڡ +sig�t_t + * +__right + = ( +right +); \ + +92 -- +__�t + >= 0) \ + +93 +__de� +-> +__v� +[ +__�t +] = ( +__�� +->__val[__cnt] \ + +94 | +__right +-> +__v� +[ +__�t +]); \ + +95 0; })) + + ) + +102 +__sigismemb� + (cڡ +__sig�t_t + *, ); + +103 +__sigadd�t + ( +__sig�t_t + *, ); + +104 +__sigd��t + ( +__sig�t_t + *, ); + +106 #ifde� +__USE_EXTERN_INLINES + + +107 + #__SIGSETFN +( +NAME +, +BODY +, +CONST +) \ + +108 +_EXTERN_INLINE + \ + +109 + `NAME + ( +CONST + +__sig�t_t + * +__�t +, +__sig +) \ + +111 +__mask + = + `__sigmask + ( +__sig +); \ + +112 +__w�d + = + `__sigw�d + ( +__sig +); \ + +113 +BODY +; \ + +114 } + + ) + +116 +__SIGSETFN + ( +__sigismemb� +, ( +__�t +-> +__v� +[ +__w�d +] & +__mask +) ? 1 : 0, const) + +117 +__SIGSETFN + ( +__sigadd�t +, (( +__�t +-> +__v� +[ +__w�d +] |� +__mask +), 0), ) + +118 +__SIGSETFN + ( +__sigd��t +, (( +__�t +-> +__v� +[ +__w�d +] &�~ +__mask +), 0), ) + +120 #unde� +__SIGSETFN + + + @/usr/include/bits/sigstack.h + +19 #i�de� +_SIGNAL_H + + +25 + ssig�ack + + +27 * + mss_� +; + +28 + mss_ڡack +; + +35 + mSS_ONSTACK + = 1, + +36 + #SS_ONSTACK + +SS_ONSTACK + + + ) + +37 + mSS_DISABLE + + +38 + #SS_DISABLE + +SS_DISABLE + + + ) + +42 + #MINSIGSTKSZ + 2048 + + ) + +45 + #SIGSTKSZ + 8192 + + ) + +49 + ssig�t�ack + + +51 * + mss_� +; + +52 + mss_�ags +; + +53 +size_t + + mss_size +; + +54 } + t�ack_t +; + + @/usr/include/bits/sigthread.h + +19 #i�de� +_BITS_SIGTHREAD_H + + +20 + #_BITS_SIGTHREAD_H + 1 + + ) + +22 #i�! +def�ed + +_SIGNAL_H + && !def�ed +_PTHREAD_H + + +30 + $�h�ad_sigmask + ( +__how +, + +31 cڡ +__sig�t_t + * +__��ri� + +__�wmask +, + +32 +__sig�t_t + * +__��ri� + +__�dmask +) +__THROW +; + +35 + $�h�ad_k�l + ( +�h�ad_t + +__th�adid +, +__signo +� +__THROW +; + +37 #ifde� +__USE_GNU + + +39 + $�h�ad_sigqueue + ( +�h�ad_t + +__th�adid +, +__signo +, + +40 cڡ +sigv� + +__v�ue +� +__THROW +; + + @/usr/include/bits/socket.h + +19 #i�de� +__BITS_SOCKET_H + + +20 + #__BITS_SOCKET_H + + + ) + +22 #i�de� +_SYS_SOCKET_H + + +26 + #__�ed_size_t + + + ) + +27 + ~<�ddef.h +> + +29 + ~<sys/ty�s.h +> + +32 #i�de� +__sock�n_t_def�ed + + +33 +__sock�n_t + + tsock�n_t +; + +34 + #__sock�n_t_def�ed + + + ) + +38 + ~<b�s/sock�_ty�.h +> + +41 + #PF_UNSPEC + 0 + + ) + +42 + #PF_LOCAL + 1 + + ) + +43 + #PF_UNIX + +PF_LOCAL + + + ) + +44 + #PF_FILE + +PF_LOCAL + + + ) + +45 + #PF_INET + 2 + + ) + +46 + #PF_AX25 + 3 + + ) + +47 + #PF_IPX + 4 + + ) + +48 + #PF_APPLETALK + 5 + + ) + +49 + #PF_NETROM + 6 + + ) + +50 + #PF_BRIDGE + 7 + + ) + +51 + #PF_ATMPVC + 8 + + ) + +52 + #PF_X25 + 9 + + ) + +53 + #PF_INET6 + 10 + + ) + +54 + #PF_ROSE + 11 + + ) + +55 + #PF_DEC�t + 12 + + ) + +56 + #PF_NETBEUI + 13 + + ) + +57 + #PF_SECURITY + 14 + + ) + +58 + #PF_KEY + 15 + + ) + +59 + #PF_NETLINK + 16 + + ) + +60 + #PF_ROUTE + +PF_NETLINK + + + ) + +61 + #PF_PACKET + 17 + + ) + +62 + #PF_ASH + 18 + + ) + +63 + #PF_ECONET + 19 + + ) + +64 + #PF_ATMSVC + 20 + + ) + +65 + #PF_RDS + 21 + + ) + +66 + #PF_SNA + 22 + + ) + +67 + #PF_IRDA + 23 + + ) + +68 + #PF_PPPOX + 24 + + ) + +69 + #PF_WANPIPE + 25 + + ) + +70 + #PF_LLC + 26 + + ) + +71 + #PF_CAN + 29 + + ) + +72 + #PF_TIPC + 30 + + ) + +73 + #PF_BLUETOOTH + 31 + + ) + +74 + #PF_IUCV + 32 + + ) + +75 + #PF_RXRPC + 33 + + ) + +76 + #PF_ISDN + 34 + + ) + +77 + #PF_PHONET + 35 + + ) + +78 + #PF_IEEE802154 + 36 + + ) + +79 + #PF_CAIF + 37 + + ) + +80 + #PF_ALG + 38 + + ) + +81 + #PF_NFC + 39 + + ) + +82 + #PF_VSOCK + 40 + + ) + +83 + #PF_MAX + 41 + + ) + +86 + #AF_UNSPEC + +PF_UNSPEC + + + ) + +87 + #AF_LOCAL + +PF_LOCAL + + + ) + +88 + #AF_UNIX + +PF_UNIX + + + ) + +89 + #AF_FILE + +PF_FILE + + + ) + +90 + #AF_INET + +PF_INET + + + ) + +91 + #AF_AX25 + +PF_AX25 + + + ) + +92 + #AF_IPX + +PF_IPX + + + ) + +93 + #AF_APPLETALK + +PF_APPLETALK + + + ) + +94 + #AF_NETROM + +PF_NETROM + + + ) + +95 + #AF_BRIDGE + +PF_BRIDGE + + + ) + +96 + #AF_ATMPVC + +PF_ATMPVC + + + ) + +97 + #AF_X25 + +PF_X25 + + + ) + +98 + #AF_INET6 + +PF_INET6 + + + ) + +99 + #AF_ROSE + +PF_ROSE + + + ) + +100 + #AF_DEC�t + +PF_DEC�t + + + ) + +101 + #AF_NETBEUI + +PF_NETBEUI + + + ) + +102 + #AF_SECURITY + +PF_SECURITY + + + ) + +103 + #AF_KEY + +PF_KEY + + + ) + +104 + #AF_NETLINK + +PF_NETLINK + + + ) + +105 + #AF_ROUTE + +PF_ROUTE + + + ) + +106 + #AF_PACKET + +PF_PACKET + + + ) + +107 + #AF_ASH + +PF_ASH + + + ) + +108 + #AF_ECONET + +PF_ECONET + + + ) + +109 + #AF_ATMSVC + +PF_ATMSVC + + + ) + +110 + #AF_RDS + +PF_RDS + + + ) + +111 + #AF_SNA + +PF_SNA + + + ) + +112 + #AF_IRDA + +PF_IRDA + + + ) + +113 + #AF_PPPOX + +PF_PPPOX + + + ) + +114 + #AF_WANPIPE + +PF_WANPIPE + + + ) + +115 + #AF_LLC + +PF_LLC + + + ) + +116 + #AF_CAN + +PF_CAN + + + ) + +117 + #AF_TIPC + +PF_TIPC + + + ) + +118 + #AF_BLUETOOTH + +PF_BLUETOOTH + + + ) + +119 + #AF_IUCV + +PF_IUCV + + + ) + +120 + #AF_RXRPC + +PF_RXRPC + + + ) + +121 + #AF_ISDN + +PF_ISDN + + + ) + +122 + #AF_PHONET + +PF_PHONET + + + ) + +123 + #AF_IEEE802154 + +PF_IEEE802154 + + + ) + +124 + #AF_CAIF + +PF_CAIF + + + ) + +125 + #AF_ALG + +PF_ALG + + + ) + +126 + #AF_NFC + +PF_NFC + + + ) + +127 + #AF_VSOCK + +PF_VSOCK + + + ) + +128 + #AF_MAX + +PF_MAX + + + ) + +134 + #SOL_RAW + 255 + + ) + +135 + #SOL_DECNET + 261 + + ) + +136 + #SOL_X25 + 262 + + ) + +137 + #SOL_PACKET + 263 + + ) + +138 + #SOL_ATM + 264 + + ) + +139 + #SOL_AAL + 265 + + ) + +140 + #SOL_IRDA + 266 + + ) + +143 + #SOMAXCONN + 128 + + ) + +146 + ~<b�s/sockaddr.h +> + +149 + ssockaddr + + +151 +__SOCKADDR_COMMON + ( +�_ +); + +152 + m�_d�a +[14]; + +158 + #__ss_�ig�y� + + + ) + +159 + #_SS_SIZE + 128 + + ) + +160 + #_SS_PADSIZE + ( +_SS_SIZE + - (2 * ( +__ss_�ig�y� +))) + + ) + +162 + ssockaddr_��age + + +164 +__SOCKADDR_COMMON + ( +ss_ +); + +165 +__ss_�ig�y� + + m__ss_�ign +; + +166 + m__ss_�dd�g +[ +_SS_PADSIZE +]; + +173 + mMSG_OOB + = 0x01, + +174 + #MSG_OOB + +MSG_OOB + + + ) + +175 + mMSG_PEEK + = 0x02, + +176 + #MSG_PEEK + +MSG_PEEK + + + ) + +177 + mMSG_DONTROUTE + = 0x04, + +178 + #MSG_DONTROUTE + +MSG_DONTROUTE + + + ) + +179 #ifde� +__USE_GNU + + +181 + mMSG_TRYHARD + = +MSG_DONTROUTE +, + +182 + #MSG_TRYHARD + +MSG_DONTROUTE + + + ) + +184 + mMSG_CTRUNC + = 0x08, + +185 + #MSG_CTRUNC + +MSG_CTRUNC + + + ) + +186 + mMSG_PROXY + = 0x10, + +187 + #MSG_PROXY + +MSG_PROXY + + + ) + +188 + mMSG_TRUNC + = 0x20, + +189 + #MSG_TRUNC + +MSG_TRUNC + + + ) + +190 + mMSG_DONTWAIT + = 0x40, + +191 + #MSG_DONTWAIT + +MSG_DONTWAIT + + + ) + +192 + mMSG_EOR + = 0x80, + +193 + #MSG_EOR + +MSG_EOR + + + ) + +194 + mMSG_WAITALL + = 0x100, + +195 + #MSG_WAITALL + +MSG_WAITALL + + + ) + +196 + mMSG_FIN + = 0x200, + +197 + #MSG_FIN + +MSG_FIN + + + ) + +198 + mMSG_SYN + = 0x400, + +199 + #MSG_SYN + +MSG_SYN + + + ) + +200 + mMSG_CONFIRM + = 0x800, + +201 + #MSG_CONFIRM + +MSG_CONFIRM + + + ) + +202 + mMSG_RST + = 0x1000, + +203 + #MSG_RST + +MSG_RST + + + ) + +204 + mMSG_ERRQUEUE + = 0x2000, + +205 + #MSG_ERRQUEUE + +MSG_ERRQUEUE + + + ) + +206 + mMSG_NOSIGNAL + = 0x4000, + +207 + #MSG_NOSIGNAL + +MSG_NOSIGNAL + + + ) + +208 + mMSG_MORE + = 0x8000, + +209 + #MSG_MORE + +MSG_MORE + + + ) + +210 + mMSG_WAITFORONE + = 0x10000, + +211 + #MSG_WAITFORONE + +MSG_WAITFORONE + + + ) + +212 + mMSG_FASTOPEN + = 0x20000000, + +213 + #MSG_FASTOPEN + +MSG_FASTOPEN + + + ) + +215 + mMSG_CMSG_CLOEXEC + = 0x40000000 + +218 + #MSG_CMSG_CLOEXEC + +MSG_CMSG_CLOEXEC + + + ) + +224 + smsghdr + + +226 * + mmsg_�me +; + +227 +sock�n_t + + mmsg_�m�� +; + +229 +iovec + * + mmsg_iov +; + +230 +size_t + + mmsg_iov�n +; + +232 * + mmsg_cڌ� +; + +233 +size_t + + mmsg_cڌ��n +; + +238 + mmsg_�ags +; + +242 + scmsghdr + + +244 +size_t + + mcmsg_�n +; + +249 + mcmsg_�v� +; + +250 + mcmsg_ty� +; + +251 #i�(! +def�ed + +__STRICT_ANSI__ + && +__GNUC__ + >�2�|| +__STDC_VERSION__ + >= 199901L + +252 +__ex�nsi�__ + +__cmsg_d�a + + m__�ex�r +; + +257 #i�(! +def�ed + +__STRICT_ANSI__ + && +__GNUC__ + >�2�|| +__STDC_VERSION__ + >= 199901L + +258 + #CMSG_DATA +( +cmsg +�((cmsg)-> +__cmsg_d�a +) + + ) + +260 + #CMSG_DATA +( +cmsg +�((*�(( +cmsghdr + *�(cmsg�+ 1)) + + ) + +262 + #CMSG_NXTHDR +( +mhdr +, +cmsg +� + `__cmsg_nxthdr + (mhdr, cmsg) + + ) + +263 + #CMSG_FIRSTHDR +( +mhdr +) \ + +264 (( +size_t +�( +mhdr +)-> +msg_cڌ��n + >� ( +cmsghdr +) \ + +265 ? ( +cmsghdr + *�( +mhdr +)-> +msg_cڌ� + : (cmsghd�*�0) + + ) + +266 + #CMSG_ALIGN +( +�n +�((֒�+ ( +size_t +) - 1) \ + +267 & ( +size_t +�~( (size_t�- 1)) + + ) + +268 + #CMSG_SPACE +( +�n +�( + `CMSG_ALIGN + (len) \ + +269 + + `CMSG_ALIGN + ( ( +cmsghdr +))) + + ) + +270 + #CMSG_LEN +( +�n +�( + `CMSG_ALIGN + ( ( +cmsghdr +)�+ (�n)) + + ) + +272 +cmsghdr + * + $__cmsg_nxthdr + ( +msghdr + * +__mhdr +, + +273 +cmsghdr + * +__cmsg +� +__THROW +; + +274 #ifde� +__USE_EXTERN_INLINES + + +275 #i�de� +_EXTERN_INLINE + + +276 + #_EXTERN_INLINE + +__ex��_�l�e + + + ) + +278 +_EXTERN_INLINE + +cmsghdr + * + +279 + `__NTH + ( + $__cmsg_nxthdr + ( +msghdr + * +__mhdr +, +cmsghdr + * +__cmsg +)) + +281 i�(( +size_t +� +__cmsg +-> +cmsg_�n + < ( +cmsghdr +)) + +283 ( +cmsghdr + *) 0; + +285 +__cmsg + = ( +cmsghdr + *) ((*) __cmsg + +286 + + `CMSG_ALIGN + ( +__cmsg +-> +cmsg_�n +)); + +287 i�((*�( +__cmsg + + 1�> ((*� +__mhdr +-> +msg_cڌ� + + +288 + +__mhdr +-> +msg_cڌ��n +) + +289 || ((*� +__cmsg + + + `CMSG_ALIGN + (__cmsg-> +cmsg_�n +) + +290 > ((*� +__mhdr +-> +msg_cڌ� + + __mhdr-> +msg_cڌ��n +))) + +292 ( +cmsghdr + *) 0; + +293 +__cmsg +; + +294 + } +} + +301 + mSCM_RIGHTS + = 0x01 + +302 + #SCM_RIGHTS + +SCM_RIGHTS + + + ) + +303 #ifde� +__USE_GNU + + +304 , + mSCM_CREDENTIALS + = 0x02 + +305 + #SCM_CREDENTIALS + +SCM_CREDENTIALS + + + ) + +309 #ifde� +__USE_GNU + + +311 + su�ed + + +313 +pid_t + + mpid +; + +314 +uid_t + + muid +; + +315 +gid_t + + mgid +; + +320 #i�! +def�ed + +__USE_MISC + && !def�ed +__USE_GNU + + +321 #i�de� +FIOGETOWN + + +322 + #__SYS_SOCKET_H_undef_FIOGETOWN + + + ) + +324 #i�de� +FIOSETOWN + + +325 + #__SYS_SOCKET_H_undef_FIOSETOWN + + + ) + +327 #i�de� +SIOCATMARK + + +328 + #__SYS_SOCKET_H_undef_SIOCATMARK + + + ) + +330 #i�de� +SIOCGPGRP + + +331 + #__SYS_SOCKET_H_undef_SIOCGPGRP + + + ) + +333 #i�de� +SIOCGSTAMP + + +334 + #__SYS_SOCKET_H_undef_SIOCGSTAMP + + + ) + +336 #i�de� +SIOCGSTAMPNS + + +337 + #__SYS_SOCKET_H_undef_SIOCGSTAMPNS + + + ) + +339 #i�de� +SIOCSPGRP + + +340 + #__SYS_SOCKET_H_undef_SIOCSPGRP + + + ) + +345 + ~<asm/sock�.h +> + +347 #i�! +def�ed + +__USE_MISC + && !def�ed +__USE_GNU + + +348 #ifde� +__SYS_SOCKET_H_undef_FIOGETOWN + + +349 #unde� +__SYS_SOCKET_H_undef_FIOGETOWN + + +350 #unde� +FIOGETOWN + + +352 #ifde� +__SYS_SOCKET_H_undef_FIOSETOWN + + +353 #unde� +__SYS_SOCKET_H_undef_FIOSETOWN + + +354 #unde� +FIOSETOWN + + +356 #ifde� +__SYS_SOCKET_H_undef_SIOCATMARK + + +357 #unde� +__SYS_SOCKET_H_undef_SIOCATMARK + + +358 #unde� +SIOCATMARK + + +360 #ifde� +__SYS_SOCKET_H_undef_SIOCGPGRP + + +361 #unde� +__SYS_SOCKET_H_undef_SIOCGPGRP + + +362 #unde� +SIOCGPGRP + + +364 #ifde� +__SYS_SOCKET_H_undef_SIOCGSTAMP + + +365 #unde� +__SYS_SOCKET_H_undef_SIOCGSTAMP + + +366 #unde� +SIOCGSTAMP + + +368 #ifde� +__SYS_SOCKET_H_undef_SIOCGSTAMPNS + + +369 #unde� +__SYS_SOCKET_H_undef_SIOCGSTAMPNS + + +370 #unde� +SIOCGSTAMPNS + + +372 #ifde� +__SYS_SOCKET_H_undef_SIOCSPGRP + + +373 #unde� +__SYS_SOCKET_H_undef_SIOCSPGRP + + +374 #unde� +SIOCSPGRP + + +379 + sl�g� + + +381 + ml_�off +; + +382 + ml_l�g� +; + + @/usr/include/bits/socket2.h + +19 #i�de� +_SYS_SOCKET_H + + +23 +ssize_t + +__�cv_chk + ( +__fd +, * +__buf +, +size_t + +__n +, size_� +__bu� +, + +24 +__�ags +); + +25 +ssize_t + +__REDIRECT + ( +__�cv_��s +, ( +__fd +, * +__buf +, +size_t + +__n +, + +26 +__�ags +), +�cv +); + +27 +ssize_t + +__REDIRECT + ( +__�cv_chk_w�n +, + +28 ( +__fd +, * +__buf +, +size_t + +__n +, size_� +__bu� +, + +29 +__�ags +), +__�cv_chk +) + +30 +__w�ljr + ("recv called with bigger�ength�han size of destination " + +33 +__f�tify_fun�i� + +ssize_t + + +34 + $�cv + ( +__fd +, * +__buf +, +size_t + +__n +, +__�ags +) + +36 i�( + `__bos0 + ( +__buf +�!�( +size_t +) -1) + +38 i�(! + `__bu�t�_cڡ�t_p + ( +__n +)) + +39 + `__�cv_chk + ( +__fd +, +__buf +, +__n +, + `__bos0 + (__buf), +__�ags +); + +41 i�( +__n + > + `__bos0 + ( +__buf +)) + +42 + `__�cv_chk_w�n + ( +__fd +, +__buf +, +__n +, + `__bos0 + (__buf), +__�ags +); + +44 + `__�cv_��s + ( +__fd +, +__buf +, +__n +, +__�ags +); + +45 + } +} + +47 +ssize_t + +__�cv�om_chk + ( +__fd +, * +__��ri� + +__buf +, +size_t + +__n +, + +48 +size_t + +__bu� +, +__�ags +, + +49 +__SOCKADDR_ARG + +__addr +, + +50 +sock�n_t + * +__��ri� + +__addr_�n +); + +51 +ssize_t + +__REDIRECT + ( +__�cv�om_��s +, + +52 ( +__fd +, * +__��ri� + +__buf +, +size_t + +__n +, + +53 +__�ags +, +__SOCKADDR_ARG + +__addr +, + +54 +sock�n_t + * +__��ri� + +__addr_�n +), +�cv�om +); + +55 +ssize_t + +__REDIRECT + ( +__�cv�om_chk_w�n +, + +56 ( +__fd +, * +__��ri� + +__buf +, +size_t + +__n +, + +57 +size_t + +__bu� +, +__�ags +, + +58 +__SOCKADDR_ARG + +__addr +, + +59 +sock�n_t + * +__��ri� + +__addr_�n +), +__�cv�om_chk +) + +60 +__w�ljr + ("recvfrom called with bigger�ength�han size of " + +63 +__f�tify_fun�i� + +ssize_t + + +64 + $�cv�om + ( +__fd +, * +__��ri� + +__buf +, +size_t + +__n +, +__�ags +, + +65 +__SOCKADDR_ARG + +__addr +, +sock�n_t + * +__��ri� + +__addr_�n +) + +67 i�( + `__bos0 + ( +__buf +�!�( +size_t +) -1) + +69 i�(! + `__bu�t�_cڡ�t_p + ( +__n +)) + +70 + `__�cv�om_chk + ( +__fd +, +__buf +, +__n +, + `__bos0 + (__buf), +__�ags +, + +71 +__addr +, +__addr_�n +); + +72 i�( +__n + > + `__bos0 + ( +__buf +)) + +73 + `__�cv�om_chk_w�n + ( +__fd +, +__buf +, +__n +, + `__bos0 + (__buf), +__�ags +, + +74 +__addr +, +__addr_�n +); + +76 + `__�cv�om_��s + ( +__fd +, +__buf +, +__n +, +__�ags +, +__addr +, +__addr_�n +); + +77 + } +} + + @/usr/include/bits/stat.h + +18 #i�! +def�ed + +_SYS_STAT_H + && !def�ed +_FCNTL_H + + +22 #i�de� +_BITS_STAT_H + + +23 + #_BITS_STAT_H + 1 + + ) + +26 #i�de� +__x86_64__ + + +27 + #_STAT_VER_LINUX_OLD + 1 + + ) + +28 + #_STAT_VER_KERNEL + 1 + + ) + +29 + #_STAT_VER_SVR4 + 2 + + ) + +30 + #_STAT_VER_LINUX + 3 + + ) + +33 + #_MKNOD_VER_LINUX + 1 + + ) + +34 + #_MKNOD_VER_SVR4 + 2 + + ) + +35 + #_MKNOD_VER + +_MKNOD_VER_LINUX + + + ) + +37 + #_STAT_VER_KERNEL + 0 + + ) + +38 + #_STAT_VER_LINUX + 1 + + ) + +41 + #_MKNOD_VER_LINUX + 0 + + ) + +44 + #_STAT_VER + +_STAT_VER_LINUX + + + ) + +46 + s�� + + +48 +__dev_t + + m�_dev +; + +49 #i�de� +__x86_64__ + + +50 + m__�d1 +; + +52 #i� +def�ed + +__x86_64__ + || !def�ed +__USE_FILE_OFFSET64 + + +53 +__�o_t + + m�_�o +; + +55 +__�o_t + + m__�_�o +; + +57 #i�de� +__x86_64__ + + +58 +__mode_t + + m�_mode +; + +59 +__ƚk_t + + m�_ƚk +; + +61 +__ƚk_t + + m�_ƚk +; + +62 +__mode_t + + m�_mode +; + +64 +__uid_t + + m�_uid +; + +65 +__gid_t + + m�_gid +; + +66 #ifde� +__x86_64__ + + +67 + m__�d0 +; + +69 +__dev_t + + m�_rdev +; + +70 #i�de� +__x86_64__ + + +71 + m__�d2 +; + +73 #i� +def�ed + +__x86_64__ + || !def�ed +__USE_FILE_OFFSET64 + + +74 +__off_t + + m�_size +; + +76 +__off64_t + + m�_size +; + +78 +__blksize_t + + m�_blksize +; + +79 #i� +def�ed + +__x86_64__ + || !def�ed +__USE_FILE_OFFSET64 + + +80 +__blk�t_t + + m�_blocks +; + +82 +__blk�t64_t + + m�_blocks +; + +84 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN2K8 + + +91 +time�ec + + m�_�im +; + +92 +time�ec + + m�_mtim +; + +93 +time�ec + + m�_�im +; + +94 + #�_�ime + +�_�im +. +tv_�c + + + ) + +95 + #�_mtime + +�_mtim +. +tv_�c + + + ) + +96 + #�_�ime + +�_�im +. +tv_�c + + + ) + +98 +__time_t + + m�_�ime +; + +99 +__sys��_ul�g_t + + m�_�im��c +; + +100 +__time_t + + m�_mtime +; + +101 +__sys��_ul�g_t + + m�_mtim��c +; + +102 +__time_t + + m�_�ime +; + +103 +__sys��_ul�g_t + + m�_�im��c +; + +105 #ifde� +__x86_64__ + + +106 +__sys��_��g_t + + m__glibc_��rved +[3]; + +108 #i�de� +__USE_FILE_OFFSET64 + + +109 + m__glibc_��rved4 +; + +110 + m__glibc_��rved5 +; + +112 +__�o64_t + + m�_�o +; + +117 #ifde� +__USE_LARGEFILE64 + + +119 + s��64 + + +121 +__dev_t + + m�_dev +; + +122 #ifde� +__x86_64__ + + +123 +__�o64_t + + m�_�o +; + +124 +__ƚk_t + + m�_ƚk +; + +125 +__mode_t + + m�_mode +; + +127 + m__�d1 +; + +128 +__�o_t + + m__�_�o +; + +129 +__mode_t + + m�_mode +; + +130 +__ƚk_t + + m�_ƚk +; + +132 +__uid_t + + m�_uid +; + +133 +__gid_t + + m�_gid +; + +134 #ifde� +__x86_64__ + + +135 + m__�d0 +; + +136 +__dev_t + + m�_rdev +; + +137 +__off_t + + m�_size +; + +139 +__dev_t + + m�_rdev +; + +140 + m__�d2 +; + +141 +__off64_t + + m�_size +; + +143 +__blksize_t + + m�_blksize +; + +144 +__blk�t64_t + + m�_blocks +; + +145 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN2K8 + + +152 +time�ec + + m�_�im +; + +153 +time�ec + + m�_mtim +; + +154 +time�ec + + m�_�im +; + +156 +__time_t + + m�_�ime +; + +157 +__sys��_ul�g_t + + m�_�im��c +; + +158 +__time_t + + m�_mtime +; + +159 +__sys��_ul�g_t + + m�_mtim��c +; + +160 +__time_t + + m�_�ime +; + +161 +__sys��_ul�g_t + + m�_�im��c +; + +163 #ifde� +__x86_64__ + + +164 +__sys��_��g_t + + m__glibc_��rved +[3]; + +166 +__�o64_t + + m�_�o +; + +172 + #_STATBUF_ST_BLKSIZE + + + ) + +173 + #_STATBUF_ST_RDEV + + + ) + +175 + #_STATBUF_ST_NSEC + + + ) + +179 + #__S_IFMT + 0170000 + + ) + +182 + #__S_IFDIR + 0040000 + + ) + +183 + #__S_IFCHR + 0020000 + + ) + +184 + #__S_IFBLK + 0060000 + + ) + +185 + #__S_IFREG + 0100000 + + ) + +186 + #__S_IFIFO + 0010000 + + ) + +187 + #__S_IFLNK + 0120000 + + ) + +188 + #__S_IFSOCK + 0140000 + + ) + +192 + #__S_TYPEISMQ +( +buf +�((buf)-> +�_mode + - (buf)->�_mode) + + ) + +193 + #__S_TYPEISSEM +( +buf +�((buf)-> +�_mode + - (buf)->�_mode) + + ) + +194 + #__S_TYPEISSHM +( +buf +�((buf)-> +�_mode + - (buf)->�_mode) + + ) + +198 + #__S_ISUID + 04000 + + ) + +199 + #__S_ISGID + 02000 + + ) + +200 + #__S_ISVTX + 01000 + + ) + +201 + #__S_IREAD + 0400 + + ) + +202 + #__S_IWRITE + 0200 + + ) + +203 + #__S_IEXEC + 0100 + + ) + +205 #ifde� +__USE_ATFILE + + +206 + #UTIME_NOW + ((1�<< 30�- 1l) + + ) + +207 + #UTIME_OMIT + ((1�<< 30�- 2l) + + ) + + @/usr/include/bits/stdio-ldbl.h + +19 #i�de� +_STDIO_H + + +23 +__BEGIN_NAMESPACE_STD + + +24 + $__LDBL_REDIR_DECL + ( +�r�tf +) + +25 + $__LDBL_REDIR_DECL + ( +��tf +) + +26 + $__LDBL_REDIR_DECL + ( +�r�tf +) + +27 + $__LDBL_REDIR_DECL + ( +v�r�tf +) + +28 + $__LDBL_REDIR_DECL + ( +v��tf +) + +29 + $__LDBL_REDIR_DECL + ( +v�r�tf +) + +30 #i� +def�ed + +__USE_ISOC99 + && !def�ed +__USE_GNU + \ + +31 && ! +def�ed + +__REDIRECT + \ + +32 && ( +def�ed + +__STRICT_ANSI__ + || def�ed +__USE_XOPEN2K +) + +33 + $__LDBL_REDIR1_DECL + ( +fs�nf +, +__�dbl___isoc99_fs�nf +) + +34 + $__LDBL_REDIR1_DECL + ( +s�nf +, +__�dbl___isoc99_s�nf +) + +35 + $__LDBL_REDIR1_DECL + ( +ss�nf +, +__�dbl___isoc99_ss�nf +) + +37 + $__LDBL_REDIR_DECL + ( +fs�nf +) + +38 + $__LDBL_REDIR_DECL + ( +s�nf +) + +39 + $__LDBL_REDIR_DECL + ( +ss�nf +) + +41 +__END_NAMESPACE_STD + + +43 #i� +def�ed + +__USE_BSD + || def�ed +__USE_ISOC99 + || def�ed +__USE_UNIX98 + + +44 +__BEGIN_NAMESPACE_C99 + + +45 + $__LDBL_REDIR_DECL + ( +���tf +) + +46 + $__LDBL_REDIR_DECL + ( +v���tf +) + +47 +__END_NAMESPACE_C99 + + +50 #ifdef +__USE_ISOC99 + + +51 +__BEGIN_NAMESPACE_C99 + + +52 #i�! +def�ed + +__USE_GNU + && !def�ed +__REDIRECT + \ + +53 && ( +def�ed + +__STRICT_ANSI__ + || def�ed +__USE_XOPEN2K +) + +54 + $__LDBL_REDIR1_DECL + ( +vfs�nf +, +__�dbl___isoc99_vfs�nf +) + +55 + $__LDBL_REDIR1_DECL + ( +vs�nf +, +__�dbl___isoc99_vs�nf +) + +56 + $__LDBL_REDIR1_DECL + ( +vss�nf +, +__�dbl___isoc99_vss�nf +) + +58 + $__LDBL_REDIR_DECL + ( +vfs�nf +) + +59 + $__LDBL_REDIR_DECL + ( +vss�nf +) + +60 + $__LDBL_REDIR_DECL + ( +vs�nf +) + +62 +__END_NAMESPACE_C99 + + +65 #ifde� +__USE_XOPEN2K8 + + +66 + $__LDBL_REDIR_DECL + ( +vd��tf +) + +67 + $__LDBL_REDIR_DECL + ( +d��tf +) + +70 #ifde� +__USE_GNU + + +71 + $__LDBL_REDIR_DECL + ( +va�r�tf +) + +72 + $__LDBL_REDIR_DECL + ( +__a�r�tf +) + +73 + $__LDBL_REDIR_DECL + ( +a�r�tf +) + +74 + $__LDBL_REDIR_DECL + ( +ob�ack_��tf +) + +75 + $__LDBL_REDIR_DECL + ( +ob�ack_v��tf +) + +78 #i� +__USE_FORTIFY_LEVEL + > 0 && +def�ed + +__f�tify_fun�i� + + +79 + $__LDBL_REDIR_DECL + ( +__�r�tf_chk +) + +80 + $__LDBL_REDIR_DECL + ( +__v�r�tf_chk +) + +81 #i� +def�ed + +__USE_BSD + || def�ed +__USE_ISOC99 + || def�ed +__USE_UNIX98 + + +82 + $__LDBL_REDIR_DECL + ( +__���tf_chk +) + +83 + $__LDBL_REDIR_DECL + ( +__v���tf_chk +) + +85 #i� +__USE_FORTIFY_LEVEL + > 1 + +86 + $__LDBL_REDIR_DECL + ( +__�r�tf_chk +) + +87 + $__LDBL_REDIR_DECL + ( +__��tf_chk +) + +88 + $__LDBL_REDIR_DECL + ( +__v�r�tf_chk +) + +89 + $__LDBL_REDIR_DECL + ( +__v��tf_chk +) + +90 #ifde� +__USE_XOPEN2K8 + + +91 + $__LDBL_REDIR_DECL + ( +__d��tf_chk +) + +92 + $__LDBL_REDIR_DECL + ( +__vd��tf_chk +) + +94 #ifde� +__USE_GNU + + +95 + $__LDBL_REDIR_DECL + ( +__a�r�tf_chk +) + +96 + $__LDBL_REDIR_DECL + ( +__va�r�tf_chk +) + +97 + $__LDBL_REDIR_DECL + ( +__ob�ack_��tf_chk +) + +98 + $__LDBL_REDIR_DECL + ( +__ob�ack_v��tf_chk +) + + @/usr/include/bits/stdio.h + +19 #i�de� +_STDIO_H + + +23 #i�de� +__ex��_�l�e + + +24 + #__STDIO_INLINE + +�l�e + + + ) + +26 + #__STDIO_INLINE + +__ex��_�l�e + + + ) + +30 #ifde� +__USE_EXTERN_INLINES + + +33 #i�!( +__USE_FORTIFY_LEVEL + > 0 && +def�ed + +__f�tify_fun�i� +) + +35 +__STDIO_INLINE + + +36 + $v��tf + (cڡ * +__��ri� + +__fmt +, +_G_va_li� + +__�g +) + +38 + `v�r�tf + ( +�dout +, +__fmt +, +__�g +); + +39 + } +} + +43 +__STDIO_INLINE + + +44 + $g�ch� + () + +46 + `_IO_g�c + ( +�d� +); + +47 + } +} + +50 #ifde� +__USE_MISC + + +52 +__STDIO_INLINE + + +53 + $fg�c_u�ocked + ( +FILE + * +__� +) + +55 + `_IO_g�c_u�ocked + ( +__� +); + +56 + } +} + +60 #i� +def�ed + +__USE_POSIX + || def�ed +__USE_MISC + + +62 +__STDIO_INLINE + + +63 + $g�c_u�ocked + ( +FILE + * +__� +) + +65 + `_IO_g�c_u�ocked + ( +__� +); + +66 + } +} + +69 +__STDIO_INLINE + + +70 + $g�ch�_u�ocked + () + +72 + `_IO_g�c_u�ocked + ( +�d� +); + +73 + } +} + +78 +__STDIO_INLINE + + +79 + $putch� + ( +__c +) + +81 + `_IO_putc + ( +__c +, +�dout +); + +82 + } +} + +85 #ifde� +__USE_MISC + + +87 +__STDIO_INLINE + + +88 + $�utc_u�ocked + ( +__c +, +FILE + * +__��am +) + +90 + `_IO_putc_u�ocked + ( +__c +, +__��am +); + +91 + } +} + +95 #i� +def�ed + +__USE_POSIX + || def�ed +__USE_MISC + + +97 +__STDIO_INLINE + + +98 + $putc_u�ocked + ( +__c +, +FILE + * +__��am +) + +100 + `_IO_putc_u�ocked + ( +__c +, +__��am +); + +101 + } +} + +104 +__STDIO_INLINE + + +105 + $putch�_u�ocked + ( +__c +) + +107 + `_IO_putc_u�ocked + ( +__c +, +�dout +); + +108 + } +} + +112 #ifdef +__USE_GNU + + +114 +__STDIO_INLINE + +_IO_ssize_t + + +115 + $g�l�e + (** +__l��� +, +size_t + * +__n +, +FILE + * +__��am +) + +117 + `__g�d�im + ( +__l��� +, +__n +, '\n', +__��am +); + +118 + } +} + +122 #ifde� +__USE_MISC + + +124 +__STDIO_INLINE + + +125 +__NTH + ( + $�of_u�ocked + ( +FILE + * +__��am +)) + +127 + `_IO_�of_u�ocked + ( +__��am +); + +128 + } +} + +131 +__STDIO_INLINE + + +132 +__NTH + ( + $��_u�ocked + ( +FILE + * +__��am +)) + +134 + `_IO_��_u�ocked + ( +__��am +); + +135 + } +} + +141 #i� +def�ed + +__USE_MISC + && def�ed +__GNUC__ + && def�ed +__OPTIMIZE__ + \ + +142 && ! +def�ed + + g__�lu�lus + + +144 + #�d_u�ocked +( +�r +, +size +, +n +, +��am +) \ + +145 ( + `__ex�nsi�__ + (( + `__bu�t�_cڡ�t_p + ( +size +�&& __bu�t�_cڡ�t_�( +n +) \ + +146 && ( +size_t +�( +size +�* (size_t�( +n +) <= 8 \ + +147 && ( +size_t +�( +size +) != 0) \ + +148 ? ({ * +__�r + = (*�( +�r +); \ + +149 +FILE + * +__��am + = ( +��am +); \ + +150 +size_t + +__�t +; \ + +151 +__�t + = ( +size_t +�( +size +�* (size_t�( +n +); \ + +152 +__�t + > 0; --__cnt) \ + +154 +__c + = + `_IO_g�c_u�ocked + ( +__��am +); \ + +155 i�( +__c + =� +EOF +) \ + +157 * +__�r +++ = +__c +; \ + +159 (( +size_t +�( +size +�* (size_t�( +n +�- +__�t +) \ + +160 / ( +size_t +�( +size +); }) \ + +161 : ((( + `__bu�t�_cڡ�t_p + ( +size +�&& ( +size_t +) (size) == 0) \ + +162 || ( + `__bu�t�_cڡ�t_p + ( +n +�&& ( +size_t +) (n) == 0)) \ + +164 ? ((�( +�r +), (�( +��am +), (�( +size +), \ + +165 (�( +n +), ( +size_t +) 0) \ + +166 : + `�d_u�ocked + ( +�r +, +size +, +n +, +��am +)))) + + ) + +168 + #fwr�e_u�ocked +( +�r +, +size +, +n +, +��am +) \ + +169 ( + `__ex�nsi�__ + (( + `__bu�t�_cڡ�t_p + ( +size +�&& __bu�t�_cڡ�t_�( +n +) \ + +170 && ( +size_t +�( +size +�* (size_t�( +n +) <= 8 \ + +171 && ( +size_t +�( +size +) != 0) \ + +172 ? ({ cڡ * +__�r + = (cڡ *�( +�r +); \ + +173 +FILE + * +__��am + = ( +��am +); \ + +174 +size_t + +__�t +; \ + +175 +__�t + = ( +size_t +�( +size +�* (size_t�( +n +); \ + +176 +__�t + > 0; --__cnt) \ + +177 i�( + `_IO_putc_u�ocked + (* +__�r +++, +__��am +�=� +EOF +) \ + +179 (( +size_t +�( +size +�* (size_t�( +n +�- +__�t +) \ + +180 / ( +size_t +�( +size +); }) \ + +181 : ((( + `__bu�t�_cڡ�t_p + ( +size +�&& ( +size_t +) (size) == 0) \ + +182 || ( + `__bu�t�_cڡ�t_p + ( +n +�&& ( +size_t +) (n) == 0)) \ + +184 ? ((�( +�r +), (�( +��am +), (�( +size +), \ + +185 (�( +n +), ( +size_t +) 0) \ + +186 : + `fwr�e_u�ocked + ( +�r +, +size +, +n +, +��am +)))) + + ) + +190 #unde� +__STDIO_INLINE + + + @/usr/include/bits/stdio2.h + +19 #i�de� +_STDIO_H + + +23 + $__�r�tf_chk + (* +__��ri� + +__s +, +__�ag +, +size_t + +__�� +, + +24 cڡ * +__��ri� + +__f�m� +, ...� +__THROW +; + +25 + $__v�r�tf_chk + (* +__��ri� + +__s +, +__�ag +, +size_t + +__�� +, + +26 cڡ * +__��ri� + +__f�m� +, + +27 +_G_va_li� + +__� +� +__THROW +; + +29 #ifde� +__va_�g_�ck + + +30 +__f�tify_fun�i� + + +31 + `__NTH + ( + $�r�tf + (* +__��ri� + +__s +, cڡ *__��ri� +__fmt +, ...)) + +33 + `__bu�t�___�r�tf_chk + ( +__s +, +__USE_FORTIFY_LEVEL + - 1, + +34 + `__bos + ( +__s +), +__fmt +, + `__va_�g_�ck + ()); + +35 + } +} + +36 #�i�! +def�ed + +__�lu�lus + + +37 + #�r�tf +( +�r +, ...) \ + +38 + `__bu�t�___�r�tf_chk + ( +�r +, +__USE_FORTIFY_LEVEL + - 1, + `__bos + (str), \ + +39 +__VA_ARGS__ +) + + ) + +42 +__f�tify_fun�i� + + +43 +__NTH + ( + $v�r�tf + (* +__��ri� + +__s +, cڡ *__��ri� +__fmt +, + +44 +_G_va_li� + +__� +)) + +46 + `__bu�t�___v�r�tf_chk + ( +__s +, +__USE_FORTIFY_LEVEL + - 1, + +47 + `__bos + ( +__s +), +__fmt +, +__� +); + +48 + } +} + +50 #i� +def�ed + +__USE_BSD + || def�ed +__USE_ISOC99 + || def�ed +__USE_UNIX98 + + +52 + $__���tf_chk + (* +__��ri� + +__s +, +size_t + +__n +, +__�ag +, + +53 +size_t + +__�� +, cڡ * +__��ri� + +__f�m� +, + +54 ...� +__THROW +; + +55 + $__v���tf_chk + (* +__��ri� + +__s +, +size_t + +__n +, +__�ag +, + +56 +size_t + +__�� +, cڡ * +__��ri� + +__f�m� +, + +57 +_G_va_li� + +__� +� +__THROW +; + +59 #ifde� +__va_�g_�ck + + +60 +__f�tify_fun�i� + + +61 + `__NTH + ( + $���tf + (* +__��ri� + +__s +, +size_t + +__n +, + +62 cڡ * +__��ri� + +__fmt +, ...)) + +64 + `__bu�t�___���tf_chk + ( +__s +, +__n +, +__USE_FORTIFY_LEVEL + - 1, + +65 + `__bos + ( +__s +), +__fmt +, + `__va_�g_�ck + ()); + +66 + } +} + +67 #�i�! +def�ed + +__�lu�lus + + +68 + #���tf +( +�r +, +�n +, ...) \ + +69 + `__bu�t�___���tf_chk + ( +�r +, +�n +, +__USE_FORTIFY_LEVEL + - 1, + `__bos + (str), \ + +70 +__VA_ARGS__ +) + + ) + +73 +__f�tify_fun�i� + + +74 +__NTH + ( + $v���tf + (* +__��ri� + +__s +, +size_t + +__n +, + +75 cڡ * +__��ri� + +__fmt +, +_G_va_li� + +__� +)) + +77 + `__bu�t�___v���tf_chk + ( +__s +, +__n +, +__USE_FORTIFY_LEVEL + - 1, + +78 + `__bos + ( +__s +), +__fmt +, +__� +); + +79 + } +} + +83 #i� +__USE_FORTIFY_LEVEL + > 1 + +85 +__�r�tf_chk + ( +FILE + * +__��ri� + +__��am +, +__�ag +, + +86 cڡ * +__��ri� + +__f�m� +, ...); + +87 +__��tf_chk + ( +__�ag +, cڡ * +__��ri� + +__f�m� +, ...); + +88 +__v�r�tf_chk + ( +FILE + * +__��ri� + +__��am +, +__�ag +, + +89 cڡ * +__��ri� + +__f�m� +, +_G_va_li� + +__� +); + +90 +__v��tf_chk + ( +__�ag +, cڡ * +__��ri� + +__f�m� +, + +91 +_G_va_li� + +__� +); + +93 #ifde� +__va_�g_�ck + + +94 +__f�tify_fun�i� + + +95 + $�r�tf + ( +FILE + * +__��ri� + +__��am +, cڡ *__��ri� +__fmt +, ...) + +97 + `__�r�tf_chk + ( +__��am +, +__USE_FORTIFY_LEVEL + - 1, +__fmt +, + +98 + `__va_�g_�ck + ()); + +99 + } +} + +101 +__f�tify_fun�i� + + +102 + $��tf + (cڡ * +__��ri� + +__fmt +, ...) + +104 + `__��tf_chk + ( +__USE_FORTIFY_LEVEL + - 1, +__fmt +, + `__va_�g_�ck + ()); + +105 + } +} + +106 #�i�! +def�ed + +__�lu�lus + + +107 + #��tf +(...) \ + +108 + `__��tf_chk + ( +__USE_FORTIFY_LEVEL + - 1, +__VA_ARGS__ +) + + ) + +109 + #�r�tf +( +��am +, ...) \ + +110 + `__�r�tf_chk + ( +��am +, +__USE_FORTIFY_LEVEL + - 1, +__VA_ARGS__ +) + + ) + +113 +__f�tify_fun�i� + + +114 + $v��tf + (cڡ * +__��ri� + +__fmt +, +_G_va_li� + +__� +) + +116 #ifde� +__USE_EXTERN_INLINES + + +117 + `__v�r�tf_chk + ( +�dout +, +__USE_FORTIFY_LEVEL + - 1, +__fmt +, +__� +); + +119 + `__v��tf_chk + ( +__USE_FORTIFY_LEVEL + - 1, +__fmt +, +__� +); + +121 + } +} + +123 +__f�tify_fun�i� + + +124 + $v�r�tf + ( +FILE + * +__��ri� + +__��am +, + +125 cڡ * +__��ri� + +__fmt +, +_G_va_li� + +__� +) + +127 + `__v�r�tf_chk + ( +__��am +, +__USE_FORTIFY_LEVEL + - 1, +__fmt +, +__� +); + +128 + } +} + +130 #ifde� +__USE_XOPEN2K8 + + +131 + $__d��tf_chk + ( +__fd +, +__�ag +, cڡ * +__��ri� + +__fmt +, + +132 ...� + `__��ibu�__ + (( + `__f�m�__ + ( +__��tf__ +, 3, 4))); + +133 + $__vd��tf_chk + ( +__fd +, +__�ag +, + +134 cڡ * +__��ri� + +__fmt +, +_G_va_li� + +__�g +) + +135 + `__��ibu�__ + (( + `__f�m�__ + ( +__��tf__ +, 3, 0))); + +137 #ifde� +__va_�g_�ck + + +138 +__f�tify_fun�i� + + +139 + $d��tf + ( +__fd +, cڡ * +__��ri� + +__fmt +, ...) + +141 + `__d��tf_chk + ( +__fd +, +__USE_FORTIFY_LEVEL + - 1, +__fmt +, + +142 + `__va_�g_�ck + ()); + +143 + } +} + +144 #�i�! +def�ed + +__�lu�lus + + +145 + #d��tf +( +fd +, ...) \ + +146 + `__d��tf_chk + ( +fd +, +__USE_FORTIFY_LEVEL + - 1, +__VA_ARGS__ +) + + ) + +149 +__f�tify_fun�i� + + +150 + $vd��tf + ( +__fd +, cڡ * +__��ri� + +__fmt +, +_G_va_li� + +__� +) + +152 + `__vd��tf_chk + ( +__fd +, +__USE_FORTIFY_LEVEL + - 1, +__fmt +, +__� +); + +153 + } +} + +156 #ifde� +__USE_GNU + + +158 + $__a�r�tf_chk + (** +__��ri� + +__�r +, +__�ag +, + +159 cڡ * +__��ri� + +__fmt +, ...) + +160 +__THROW + + `__��ibu�__ + (( + $__f�m�__ + ( +__��tf__ +, 3, 4))� +__wur +; + +161 + $__va�r�tf_chk + (** +__��ri� + +__�r +, +__�ag +, + +162 cڡ * +__��ri� + +__fmt +, +_G_va_li� + +__�g +) + +163 +__THROW + + `__��ibu�__ + (( + $__f�m�__ + ( +__��tf__ +, 3, 0))� +__wur +; + +164 + $__ob�ack_��tf_chk + ( +ob�ack + * +__��ri� + +__ob�ack +, + +165 +__�ag +, cڡ * +__��ri� + +__f�m� +, + +167 +__THROW + + `__��ibu�__ + (( + `__f�m�__ + ( +__��tf__ +, 3, 4))); + +168 + $__ob�ack_v��tf_chk + ( +ob�ack + * +__��ri� + +__ob�ack +, + +169 +__�ag +, + +170 cڡ * +__��ri� + +__f�m� +, + +171 +_G_va_li� + +__�gs +) + +172 +__THROW + + `__��ibu�__ + (( + `__f�m�__ + ( +__��tf__ +, 3, 0))); + +174 #ifde� +__va_�g_�ck + + +175 +__f�tify_fun�i� + + +176 + `__NTH + ( + $a�r�tf + (** +__��ri� + +__�r +, cڡ *__��ri� +__fmt +, ...)) + +178 + `__a�r�tf_chk + ( +__�r +, +__USE_FORTIFY_LEVEL + - 1, +__fmt +, + +179 + `__va_�g_�ck + ()); + +180 + } +} + +182 +__f�tify_fun�i� + + +183 +__NTH + ( + $__a�r�tf + (** +__��ri� + +__�r +, cڡ *__��ri� +__fmt +, + +186 + `__a�r�tf_chk + ( +__�r +, +__USE_FORTIFY_LEVEL + - 1, +__fmt +, + +187 + `__va_�g_�ck + ()); + +188 + } +} + +190 +__f�tify_fun�i� + + +191 +__NTH + ( + $ob�ack_��tf + ( +ob�ack + * +__��ri� + +__ob�ack +, + +192 cڡ * +__��ri� + +__fmt +, ...)) + +194 + `__ob�ack_��tf_chk + ( +__ob�ack +, +__USE_FORTIFY_LEVEL + - 1, +__fmt +, + +195 + `__va_�g_�ck + ()); + +196 + } +} + +197 #�i�! +def�ed + +__�lu�lus + + +198 + #a�r�tf +( +�r +, ...) \ + +199 + `__a�r�tf_chk + ( +�r +, +__USE_FORTIFY_LEVEL + - 1, +__VA_ARGS__ +) + + ) + +200 + #__a�r�tf +( +�r +, ...) \ + +201 + `__a�r�tf_chk + ( +�r +, +__USE_FORTIFY_LEVEL + - 1, +__VA_ARGS__ +) + + ) + +202 + #ob�ack_��tf +( +ob�ack +, ...) \ + +203 + `__ob�ack_��tf_chk + ( +ob�ack +, +__USE_FORTIFY_LEVEL + - 1, +__VA_ARGS__ +) + + ) + +206 +__f�tify_fun�i� + + +207 +__NTH + ( + $va�r�tf + (** +__��ri� + +__�r +, cڡ *__��ri� +__fmt +, + +208 +_G_va_li� + +__� +)) + +210 + `__va�r�tf_chk + ( +__�r +, +__USE_FORTIFY_LEVEL + - 1, +__fmt +, +__� +); + +211 + } +} + +213 +__f�tify_fun�i� + + +214 +__NTH + ( + $ob�ack_v��tf + ( +ob�ack + * +__��ri� + +__ob�ack +, + +215 cڡ * +__��ri� + +__fmt +, +_G_va_li� + +__� +)) + +217 + `__ob�ack_v��tf_chk + ( +__ob�ack +, +__USE_FORTIFY_LEVEL + - 1, +__fmt +, + +218 +__� +); + +219 + } +} + +225 #i�! +def�ed + +__USE_ISOC11 + \ + +226 || ( +def�ed + + g__�lu�lus + && __�lu�lu�<�201103L && !def�ed +__USE_GNU +) + +227 * + $__g�s_chk + (* +__�r +, +size_t +� +__wur +; + +228 * + `__REDIRECT + ( +__g�s_w�n +, (* +__�r +), +g�s +) + +229 +__wur + + `__w�ljr + ("please use fgets or getline instead, gets can't " + +232 +__f�tify_fun�i� + +__wur + * + +233 + $g�s + (* +__�r +) + +235 i�( + `__bos + ( +__�r +�!�( +size_t +) -1) + +236 + `__g�s_chk + ( +__�r +, + `__bos + (__str)); + +237 + `__g�s_w�n + ( +__�r +); + +238 + } +} + +241 * + $__fg�s_chk + (* +__��ri� + +__s +, +size_t + +__size +, +__n +, + +242 +FILE + * +__��ri� + +__��am +� +__wur +; + +243 * + `__REDIRECT + ( +__fg�s_��s +, + +244 (* +__��ri� + +__s +, +__n +, + +245 +FILE + * +__��ri� + +__��am +), +fg�s +� +__wur +; + +246 * + `__REDIRECT + ( +__fg�s_chk_w�n +, + +247 (* +__��ri� + +__s +, +size_t + +__size +, +__n +, + +248 +FILE + * +__��ri� + +__��am +), +__fg�s_chk +) + +249 +__wur + + `__w�ljr + ("fgets called with bigger size�han�ength " + +252 +__f�tify_fun�i� + +__wur + * + +253 + $fg�s + (* +__��ri� + +__s +, +__n +, +FILE + *__��ri� +__��am +) + +255 i�( + `__bos + ( +__s +�!�( +size_t +) -1) + +257 i�(! + `__bu�t�_cڡ�t_p + ( +__n +) || __n <= 0) + +258 + `__fg�s_chk + ( +__s +, + `__bos + (__s), +__n +, +__��am +); + +260 i�(( +size_t +� +__n + > + `__bos + ( +__s +)) + +261 + `__fg�s_chk_w�n + ( +__s +, + `__bos + (__s), +__n +, +__��am +); + +263 + `__fg�s_��s + ( +__s +, +__n +, +__��am +); + +264 + } +} + +266 +size_t + + $__�d_chk + (* +__��ri� + +__�r +, +size_t + +__��� +, + +267 +size_t + +__size +, size_� +__n +, + +268 +FILE + * +__��ri� + +__��am +� +__wur +; + +269 +size_t + + `__REDIRECT + ( +__�d_��s +, + +270 (* +__��ri� + +__�r +, +size_t + +__size +, + +271 +size_t + +__n +, +FILE + * +__��ri� + +__��am +), + +272 +�d +� +__wur +; + +273 +size_t + + `__REDIRECT + ( +__�d_chk_w�n +, + +274 (* +__��ri� + +__�r +, +size_t + +__��� +, + +275 +size_t + +__size +, size_� +__n +, + +276 +FILE + * +__��ri� + +__��am +), + +277 +__�d_chk +) + +278 +__wur + + `__w�ljr + ("fread called with bigger size *�memb�han�ength " + +281 +__f�tify_fun�i� + +__wur + +size_t + + +282 + $�d + (* +__��ri� + +__�r +, +size_t + +__size +, size_� +__n +, + +283 +FILE + * +__��ri� + +__��am +) + +285 i�( + `__bos0 + ( +__�r +�!�( +size_t +) -1) + +287 i�(! + `__bu�t�_cڡ�t_p + ( +__size +) + +288 || ! + `__bu�t�_cڡ�t_p + ( +__n +) + +289 || ( +__size + | +__n +�>�((( +size_t +) 1) << (8 * (size_t) / 2))) + +290 + `__�d_chk + ( +__�r +, + `__bos0 + (__�r), +__size +, +__n +, +__��am +); + +292 i�( +__size + * +__n + > + `__bos0 + ( +__�r +)) + +293 + `__�d_chk_w�n + ( +__�r +, + `__bos0 + (__�r), +__size +, +__n +, +__��am +); + +295 + `__�d_��s + ( +__�r +, +__size +, +__n +, +__��am +); + +296 + } +} + +298 #ifde� +__USE_GNU + + +299 * + $__fg�s_u�ocked_chk + (* +__��ri� + +__s +, +size_t + +__size +, + +300 +__n +, +FILE + * +__��ri� + +__��am +� +__wur +; + +301 * + `__REDIRECT + ( +__fg�s_u�ocked_��s +, + +302 (* +__��ri� + +__s +, +__n +, + +303 +FILE + * +__��ri� + +__��am +), +fg�s_u�ocked +� +__wur +; + +304 * + `__REDIRECT + ( +__fg�s_u�ocked_chk_w�n +, + +305 (* +__��ri� + +__s +, +size_t + +__size +, +__n +, + +306 +FILE + * +__��ri� + +__��am +), +__fg�s_u�ocked_chk +) + +307 +__wur + + `__w�ljr + ("fgets_unlocked called with bigger size�han�ength " + +310 +__f�tify_fun�i� + +__wur + * + +311 + $fg�s_u�ocked + (* +__��ri� + +__s +, +__n +, +FILE + *__��ri� +__��am +) + +313 i�( + `__bos + ( +__s +�!�( +size_t +) -1) + +315 i�(! + `__bu�t�_cڡ�t_p + ( +__n +) || __n <= 0) + +316 + `__fg�s_u�ocked_chk + ( +__s +, + `__bos + (__s), +__n +, +__��am +); + +318 i�(( +size_t +� +__n + > + `__bos + ( +__s +)) + +319 + `__fg�s_u�ocked_chk_w�n + ( +__s +, + `__bos + (__s), +__n +, +__��am +); + +321 + `__fg�s_u�ocked_��s + ( +__s +, +__n +, +__��am +); + +322 + } +} + +325 #ifde� +__USE_MISC + + +326 #unde� +�d_u�ocked + + +327 +size_t + + $__�d_u�ocked_chk + (* +__��ri� + +__�r +, +size_t + +__��� +, + +328 +size_t + +__size +, size_� +__n +, + +329 +FILE + * +__��ri� + +__��am +� +__wur +; + +330 +size_t + + `__REDIRECT + ( +__�d_u�ocked_��s +, + +331 (* +__��ri� + +__�r +, +size_t + +__size +, + +332 +size_t + +__n +, +FILE + * +__��ri� + +__��am +), + +333 +�d_u�ocked +� +__wur +; + +334 +size_t + + `__REDIRECT + ( +__�d_u�ocked_chk_w�n +, + +335 (* +__��ri� + +__�r +, +size_t + +__��� +, + +336 +size_t + +__size +, size_� +__n +, + +337 +FILE + * +__��ri� + +__��am +), + +338 +__�d_u�ocked_chk +) + +339 +__wur + + `__w�ljr + ("fread_unlocked called with bigger size *�memb�han " + +342 +__f�tify_fun�i� + +__wur + +size_t + + +343 + $�d_u�ocked + (* +__��ri� + +__�r +, +size_t + +__size +, size_� +__n +, + +344 +FILE + * +__��ri� + +__��am +) + +346 i�( + `__bos0 + ( +__�r +�!�( +size_t +) -1) + +348 i�(! + `__bu�t�_cڡ�t_p + ( +__size +) + +349 || ! + `__bu�t�_cڡ�t_p + ( +__n +) + +350 || ( +__size + | +__n +�>�((( +size_t +) 1) << (8 * (size_t) / 2))) + +351 + `__�d_u�ocked_chk + ( +__�r +, + `__bos0 + (__�r), +__size +, +__n +, + +352 +__��am +); + +354 i�( +__size + * +__n + > + `__bos0 + ( +__�r +)) + +355 + `__�d_u�ocked_chk_w�n + ( +__�r +, + `__bos0 + (__�r), +__size +, +__n +, + +356 +__��am +); + +359 #ifde� +__USE_EXTERN_INLINES + + +360 i�( + `__bu�t�_cڡ�t_p + ( +__size +) + +361 && + `__bu�t�_cڡ�t_p + ( +__n +) + +362 && ( +__size + | +__n +�< ((( +size_t +) 1) << (8 * (size_t) / 2)) + +363 && +__size + * +__n + <= 8) + +365 +size_t + +__�t + = +__size + * +__n +; + +366 * +__�� + = (*� +__�r +; + +367 i�( +__�t + == 0) + +370 ; +__�t + > 0; --__cnt) + +372 +__c + = + `_IO_g�c_u�ocked + ( +__��am +); + +373 i�( +__c + =� +EOF +) + +375 * +__�� +++ = +__c +; + +377 ( +__�� + - (*� +__�r +�/ +__size +; + +380 + `__�d_u�ocked_��s + ( +__�r +, +__size +, +__n +, +__��am +); + +381 + } +} + + @/usr/include/bits/stdio_lim.h + +18 #i�! +def�ed + +_STDIO_H + && !def�ed +__�ed_FOPEN_MAX + && !def�ed +__�ed_IOV_MAX + + +22 #ifde� +_STDIO_H + + +23 + #L_tm�am + 20 + + ) + +24 + #TMP_MAX + 238328 + + ) + +25 + #FILENAME_MAX + 4096 + + ) + +27 #ifde� +__USE_POSIX + + +28 + #L_��mid + 9 + + ) + +29 #i�! +def�ed + +__USE_XOPEN2K + || def�ed +__USE_GNU + + +30 + #L_cu�rid + 9 + + ) + +35 #i� +def�ed + +__�ed_FOPEN_MAX + || def�ed +_STDIO_H + + +36 #unde� +FOPEN_MAX + + +37 + #FOPEN_MAX + 16 + + ) + +40 #i� +def�ed + +__�ed_IOV_MAX + && !def�ed +IOV_MAX + + +41 + #IOV_MAX + 1024 + + ) + + @/usr/include/bits/stdlib-bsearch.h + +19 +__ex��_�l�e + * + +20 + $b��ch + (cڡ * +__key +, cڡ * +__ba� +, +size_t + +__nmemb +, size_� +__size +, + +21 +__com�r_�_t + +__com�r +) + +23 +size_t + +__l +, +__u +, +__idx +; + +24 cڡ * +__p +; + +25 +__com�ris� +; + +27 +__l + = 0; + +28 +__u + = +__nmemb +; + +29 +__l + < +__u +) + +31 +__idx + = ( +__l + + +__u +) / 2; + +32 +__p + = (*�(((cڡ *� +__ba� +�+ ( +__idx + * +__size +)); + +33 +__com�ris� + = (* +__com�r +�( +__key +, +__p +); + +34 i�( +__com�ris� + < 0) + +35 +__u + = +__idx +; + +36 i�( +__com�ris� + > 0) + +37 +__l + = +__idx + + 1; + +39 (*� +__p +; + +42 +NULL +; + +43 + } +} + + @/usr/include/bits/stdlib-float.h + +19 #i�de� +_STDLIB_H + + +23 #ifde� +__USE_EXTERN_INLINES + + +24 +__BEGIN_NAMESPACE_STD + + +25 +__ex��_�l�e + + +26 +__NTH + ( + $�of + (cڡ * +__Ō +)) + +28 + `��od + ( +__Ō +, (**� +NULL +); + +29 + } +} + +30 + g__END_NAMESPACE_STD + + + @/usr/include/bits/stdlib-ldbl.h + +19 #i�de� +_STDLIB_H + + +23 #ifdef +__USE_ISOC99 + + +24 +__BEGIN_NAMESPACE_C99 + + +25 + $__LDBL_REDIR1_DECL + ( +���d +, +��od +) + +26 +__END_NAMESPACE_C99 + + +29 #ifde� +__USE_GNU + + +30 + $__LDBL_REDIR1_DECL + ( +���d_l +, +��od_l +) + +33 #ifde� +__USE_MISC + + +34 + $__LDBL_REDIR1_DECL + ( +qecvt +, +ecvt +) + +35 + $__LDBL_REDIR1_DECL + ( +qfcvt +, +fcvt +) + +36 + $__LDBL_REDIR1_DECL + ( +qgcvt +, +gcvt +) + +37 + $__LDBL_REDIR1_DECL + ( +qecvt_r +, +ecvt_r +) + +38 + $__LDBL_REDIR1_DECL + ( +qfcvt_r +, +fcvt_r +) + + @/usr/include/bits/stdlib.h + +19 #i�de� +_STDLIB_H + + +23 * + $__���th_chk + (cڡ * +__��ri� + +__�me +, + +24 * +__��ri� + +__�s�ved +, + +25 +size_t + +__�s�ved�n +� +__THROW + +__wur +; + +26 * + `__REDIRECT_NTH + ( +__���th_��s +, + +27 (cڡ * +__��ri� + +__�me +, + +28 * +__��ri� + +__�s�ved +), +���th +� +__wur +; + +29 * + `__REDIRECT_NTH + ( +__���th_chk_w�n +, + +30 (cڡ * +__��ri� + +__�me +, + +31 * +__��ri� + +__�s�ved +, + +32 +size_t + +__�s�ved�n +), +__���th_chk +� +__wur + + +33 + `__w�ljr + ("second�rgument of�ealpath must be�ither NULL or�t " + +36 +__f�tify_fun�i� + +__wur + * + +37 + `__NTH + ( + $���th + (cڡ * +__��ri� + +__�me +, *__��ri� +__�s�ved +)) + +39 i�( + `__bos + ( +__�s�ved +�!�( +size_t +) -1) + +41 #i� +def�ed + +_LIBC_LIMITS_H_ + && def�ed +PATH_MAX + + +42 i�( + `__bos + ( +__�s�ved +�< +PATH_MAX +) + +43 + `__���th_chk_w�n + ( +__�me +, +__�s�ved +, + `__bos + (__resolved)); + +45 + `__���th_chk + ( +__�me +, +__�s�ved +, + `__bos + (__resolved)); + +48 + `__���th_��s + ( +__�me +, +__�s�ved +); + +49 + } +} + +52 + $__��ame_r_chk + ( +__fd +, * +__buf +, +size_t + +__bu� +, + +53 +size_t + +__ėl +� +__THROW + + `__n�nu� + ((2)); + +54 + `__REDIRECT_NTH + ( +__��ame_r_��s +, ( +__fd +, * +__buf +, + +55 +size_t + +__bu� +), +��ame_r +) + +56 + `__n�nu� + ((2)); + +57 + `__REDIRECT_NTH + ( +__��ame_r_chk_w�n +, + +58 ( +__fd +, * +__buf +, +size_t + +__bu� +, + +59 +size_t + +__ėl +), +__��ame_r_chk +) + +60 + `__n�nu� + ((2)� + `__w�ljr + ("ptsname_r called with buflen bigger�han " + +63 +__f�tify_fun�i� + + +64 + `__NTH + ( + $��ame_r + ( +__fd +, * +__buf +, +size_t + +__bu� +)) + +66 i�( + `__bos + ( +__buf +�!�( +size_t +) -1) + +68 i�(! + `__bu�t�_cڡ�t_p + ( +__bu� +)) + +69 + `__��ame_r_chk + ( +__fd +, +__buf +, +__bu� +, + `__bos + (__buf)); + +70 i�( +__bu� + > + `__bos + ( +__buf +)) + +71 + `__��ame_r_chk_w�n + ( +__fd +, +__buf +, +__bu� +, + `__bos + (__buf)); + +73 + `__��ame_r_��s + ( +__fd +, +__buf +, +__bu� +); + +74 + } +} + +77 + $__w�omb_chk + (* +__s +, +wch�_t + +__wch� +, +size_t + +__bu� +) + +78 +__THROW + +__wur +; + +79 + `__REDIRECT_NTH + ( +__w�omb_��s +, (* +__s +, +wch�_t + +__wch� +), + +80 +w�omb +� +__wur +; + +82 +__f�tify_fun�i� + +__wur + + +83 + `__NTH + ( + $w�omb + (* +__s +, +wch�_t + +__wch� +)) + +88 + #__STDLIB_MB_LEN_MAX + 16 + + ) + +89 #i� +def�ed + +MB_LEN_MAX + && MB_LEN_MAX !� +__STDLIB_MB_LEN_MAX + + +92 i�( + `__bos + ( +__s +�!�( +size_t +�-1 && +__STDLIB_MB_LEN_MAX + > __bos (__s)) + +93 + `__w�omb_chk + ( +__s +, +__wch� +, + `__bos + (__s)); + +94 + `__w�omb_��s + ( +__s +, +__wch� +); + +95 + } +} + +98 +size_t + + $__mb�owcs_chk + ( +wch�_t + * +__��ri� + +__d� +, + +99 cڡ * +__��ri� + +__�c +, + +100 +size_t + +__�n +, size_� +__d��n +� +__THROW +; + +101 +size_t + + `__REDIRECT_NTH + ( +__mb�owcs_��s +, + +102 ( +wch�_t + * +__��ri� + +__d� +, + +103 cڡ * +__��ri� + +__�c +, + +104 +size_t + +__�n +), +mb�owcs +); + +105 +size_t + + `__REDIRECT_NTH + ( +__mb�owcs_chk_w�n +, + +106 ( +wch�_t + * +__��ri� + +__d� +, + +107 cڡ * +__��ri� + +__�c +, + +108 +size_t + +__�n +, size_� +__d��n +), +__mb�owcs_chk +) + +109 + `__w�ljr + ("mbstowcs called with dst buffer smaller�han�en " + +112 +__f�tify_fun�i� + +size_t + + +113 + `__NTH + ( + $mb�owcs + ( +wch�_t + * +__��ri� + +__d� +, cڡ *__��ri� +__�c +, + +114 +size_t + +__�n +)) + +116 i�( + `__bos + ( +__d� +�!�( +size_t +) -1) + +118 i�(! + `__bu�t�_cڡ�t_p + ( +__�n +)) + +119 + `__mb�owcs_chk + ( +__d� +, +__�c +, +__�n +, + +120 + `__bos + ( +__d� +�/ ( +wch�_t +)); + +122 i�( +__�n + > + `__bos + ( +__d� +�/ ( +wch�_t +)) + +123 + `__mb�owcs_chk_w�n + ( +__d� +, +__�c +, +__�n +, + +124 + `__bos + ( +__d� +�/ ( +wch�_t +)); + +126 + `__mb�owcs_��s + ( +__d� +, +__�c +, +__�n +); + +127 + } +} + +130 +size_t + + $__wc�ombs_chk + (* +__��ri� + +__d� +, + +131 cڡ +wch�_t + * +__��ri� + +__�c +, + +132 +size_t + +__�n +, size_� +__d��n +� +__THROW +; + +133 +size_t + + `__REDIRECT_NTH + ( +__wc�ombs_��s +, + +134 (* +__��ri� + +__d� +, + +135 cڡ +wch�_t + * +__��ri� + +__�c +, + +136 +size_t + +__�n +), +wc�ombs +); + +137 +size_t + + `__REDIRECT_NTH + ( +__wc�ombs_chk_w�n +, + +138 (* +__��ri� + +__d� +, + +139 cڡ +wch�_t + * +__��ri� + +__�c +, + +140 +size_t + +__�n +, size_� +__d��n +), +__wc�ombs_chk +) + +141 + `__w�ljr + ("wcstombs called with dst buffer smaller�han�en"); + +143 +__f�tify_fun�i� + +size_t + + +144 + `__NTH + ( + $wc�ombs + (* +__��ri� + +__d� +, cڡ +wch�_t + *__��ri� +__�c +, + +145 +size_t + +__�n +)) + +147 i�( + `__bos + ( +__d� +�!�( +size_t +) -1) + +149 i�(! + `__bu�t�_cڡ�t_p + ( +__�n +)) + +150 + `__wc�ombs_chk + ( +__d� +, +__�c +, +__�n +, + `__bos + (__dst)); + +151 i�( +__�n + > + `__bos + ( +__d� +)) + +152 + `__wc�ombs_chk_w�n + ( +__d� +, +__�c +, +__�n +, + `__bos + (__dst)); + +154 + `__wc�ombs_��s + ( +__d� +, +__�c +, +__�n +); + +155 + } +} + + @/usr/include/bits/string.h + +19 #i�de� +_STRING_H + + +24 + #_STRING_ARCH_u�lig�d + 1 + + ) + +28 #i�! +def�ed + +__x86_64__ + && (def�ed +__i486__ + || def�ed +__��ium__ + \ + +29 || +def�ed + + g__��ium�o__ + || def�ed + g__��ium4__ + \ + +30 || +def�ed + + g__noc�a__ + || def�ed + g__�om__ + \ + +31 || +def�ed + + g__c�e2__ + || def�ed + g__c�ei7__ + \ + +32 || +def�ed + + g__k6__ + || def�ed + g__geode__ + \ + +33 || +def�ed + + g__k8__ + || def�ed + g__�hl�__ + \ + +34 || +def�ed + + g__amd�m10__ +) + +38 #i�! +def�ed + +__NO_STRING_INLINES + && def�ed +__USE_STRING_INLINES + \ + +39 && +def�ed + + g__GNUC__ + && __GNUC__ >= 2 + +41 #i�de� +__STRING_INLINE + + +42 #i�de� +__ex��_�l�e + + +43 + #__STRING_INLINE + +�l�e + + + ) + +45 + #__STRING_INLINE + +__ex��_�l�e + + + ) + +50 + #__STRING_SMALL_GET16 +( +�c +, +idx +) \ + +51 ((((cڡ *�( +�c +))[ +idx + + 1] << 8) \ + +52 | ((cڡ *�( +�c +))[ +idx +]) + + ) + +53 + #__STRING_SMALL_GET32 +( +�c +, +idx +) \ + +54 (((((cڡ *�( +�c +))[ +idx + + 3] << 8 \ + +55 | ((cڡ *�( +�c +))[ +idx + + 2]) << 8 \ + +56 | ((cڡ *�( +�c +))[ +idx + + 1]) << 8 \ + +57 | ((cڡ *�( +�c +))[ +idx +]) + + ) + +61 + #_HAVE_STRING_ARCH_mem�y + 1 + + ) + +62 + #mem�y +( +de� +, +�c +, +n +) \ + +63 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +n +) \ + +64 ? + `__mem�y_c + (( +de� +), ( +�c +), ( +n +)) \ + +65 : + `__mem�y_g + (( +de� +), ( +�c +), ( +n +)))) + + ) + +66 + #__mem�y_c +( +de� +, +�c +, +n +) \ + +67 (( +n +) == 0 \ + +68 ? ( +de� +) \ + +69 : ((( +n +) % 4 == 0) \ + +70 ? + `__mem�y_by4 + ( +de� +, +�c +, +n +) \ + +71 : ((( +n +) % 2 == 0) \ + +72 ? + `__mem�y_by2 + ( +de� +, +�c +, +n +) \ + +73 : + `__mem�y_g + ( +de� +, +�c +, +n +)))) + + ) + +75 +__STRING_INLINE + * +__mem�y_by4 + (* +__de� +, cڡ * +__�c +, + +76 +size_t + +__n +); + +78 +__STRING_INLINE + * + +79 + $__mem�y_by4 + (* +__de� +, cڡ * +__�c +, +size_t + +__n +) + +81 +__d0 +, +__d1 +; + +82 * +__tmp + = +__de� +; + +83 +__asm__ + +__vީ�e__ + + +91 : "=&r" ( +__d0 +), "=&r" ( +__tmp +), "=&r" ( +__�c +), "=&r" ( +__d1 +) + +92 : "1" ( +__tmp +), "2" ( +__�c +), "3" ( +__n + / 4) + +94 +__de� +; + +95 + } +} + +97 +__STRING_INLINE + * +__mem�y_by2 + (* +__de� +, cڡ * +__�c +, + +98 +size_t + +__n +); + +100 +__STRING_INLINE + * + +101 + $__mem�y_by2 + (* +__de� +, cڡ * +__�c +, +size_t + +__n +) + +103 +__d0 +, +__d1 +; + +104 * +__tmp + = +__de� +; + +105 +__asm__ + +__vީ�e__ + + +118 : "=&q" ( +__d0 +), "=&r" ( +__tmp +), "=&r" ( +__�c +), "=&r" ( +__d1 +) + +119 : "1" ( +__tmp +), "2" ( +__�c +), "3" ( +__n + / 2) + +121 +__de� +; + +122 + } +} + +124 +__STRING_INLINE + * +__mem�y_g + (* +__de� +, cڡ * +__�c +, +size_t + +__n +); + +126 +__STRING_INLINE + * + +127 + $__mem�y_g + (* +__de� +, cڡ * +__�c +, +size_t + +__n +) + +129 +__d0 +, +__d1 +, +__d2 +; + +130 * +__tmp + = +__de� +; + +131 +__asm__ + +__vީ�e__ + + +142 : "=&c" ( +__d0 +), "=&D" ( +__d1 +), "=&S" ( +__d2 +), + +143 "=m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__n +]; } *) +__de� +) + +144 : "0" ( +__n +), "1" ( +__tmp +), "2" ( +__�c +), + +145 "m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__n +]; } *) +__�c +) + +147 +__de� +; + +148 + } +} + +150 + #_HAVE_STRING_ARCH_memmove + 1 + + ) + +151 #i�de� +_FORCE_INLINES + + +154 + #memmove +( +de� +, +�c +, +n +� + `__memmove_g + (de�, src,�) + + ) + +156 +__STRING_INLINE + * + $__memmove_g + (*, cڡ *, +size_t +) + +157 + `__asm__ + ("memmove"); + +159 +__STRING_INLINE + * + +160 + $__memmove_g + (* +__de� +, cڡ * +__�c +, +size_t + +__n +) + +162 +__d0 +, +__d1 +, +__d2 +; + +163 * +__tmp + = +__de� +; + +164 i�( +__de� + < +__�c +) + +165 +__asm__ + +__vީ�e__ + + +168 : "=&c" ( +__d0 +), "=&S" ( +__d1 +), "=&D" ( +__d2 +), + +169 "=m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__n +]; } *) +__de� +) + +170 : "0" ( +__n +), "1" ( +__�c +), "2" ( +__tmp +), + +171 "m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__n +]; } *) +__�c +)); + +173 +__asm__ + +__vީ�e__ + + +177 : "=&c" ( +__d0 +), "=&S" ( +__d1 +), "=&D" ( +__d2 +), + +178 "=m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__n +]; } *) +__de� +) + +179 : "0" ( +__n +), "1" (__�- 1 + (cڡ *� +__�c +), + +180 "2" ( +__n + - 1 + (*� +__tmp +), + +181 "m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__n +]; } *) +__�c +)); + +182 +__de� +; + +183 + } +} + +187 + #_HAVE_STRING_ARCH_memcmp + 1 + + ) + +188 #i�de� +_FORCE_INLINES + + +189 #i�de� +__PIC__ + + +191 +__STRING_INLINE + + +192 + $memcmp + (cڡ * +__s1 +, cڡ * +__s2 +, +size_t + +__n +) + +194 +__d0 +, +__d1 +, +__d2 +; + +195 +__�s +; + +196 +__asm__ + +__vީ�e__ + + +204 : "=&a" ( +__�s +), "=&S" ( +__d0 +), "=&D" ( +__d1 +), "=&c" ( +__d2 +) + +205 : "0" (0), "1" ( +__s1 +), "2" ( +__s2 +), "3" ( +__n +), + +206 "m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__n +]; } *) +__s1 +), + +207 "m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__n +]; } *) +__s2 +) + +209 +__�s +; + +210 + } +} + +215 + #_HAVE_STRING_ARCH_mem�t + 1 + + ) + +216 + #_USE_STRING_ARCH_mem�t + 1 + + ) + +217 + #mem�t +( +s +, +c +, +n +) \ + +218 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +n +) && (n) <= 16 \ + +219 ? (( +n +) == 1 \ + +220 ? + `__mem�t_c1 + (( +s +), ( +c +)) \ + +221 : + `__mem�t_gc + (( +s +), ( +c +), ( +n +))) \ + +222 : ( + `__bu�t�_cڡ�t_p + ( +c +) \ + +223 ? ( + `__bu�t�_cڡ�t_p + ( +n +) \ + +224 ? + `__mem�t_c� + (( +s +), ( +c +), ( +n +)) \ + +225 : + `mem�t + (( +s +), ( +c +), ( +n +))) \ + +226 : ( + `__bu�t�_cڡ�t_p + ( +n +) \ + +227 ? + `__mem�t_g� + (( +s +), ( +c +), ( +n +)) \ + +228 : + `mem�t + (( +s +), ( +c +), ( +n +)))))) + + ) + +230 + #__mem�t_c1 +( +s +, +c +�({ * +__s + = (s); \ + +231 *((*� +__s +��(�( +c +); \ + +232 +__s +; }) + + ) + +234 + #__mem�t_gc +( +s +, +c +, +n +) \ + +235 ({ * +__s + = ( +s +); \ + +237 +__ui +; \ + +238 +__usi +; \ + +239 +__uc +; \ + +240 } * +__u + = +__s +; \ + +241 +__c + = ((�((�( +c +))) * 0x01010101; \ + +247 i�(( +n +) == 3 || (n) >= 5) \ + +248 +__asm__ + + `__vީ�e__ + ("" : "�" ( +__c +) : "0" (__c)); \ + +251 +n +) \ + +254 +__u +-> +__ui + = +__c +; \ + +255 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +257 +__u +-> +__ui + = +__c +; \ + +258 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +260 +__u +-> +__ui + = +__c +; \ + +261 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +263 +__u +-> +__usi + = (� +__c +; \ + +264 +__u + = + `__ex�nsi�__ + ((*) __u + 2); \ + +265 +__u +-> +__uc + = (� +__c +; \ + +269 +__u +-> +__ui + = +__c +; \ + +270 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +272 +__u +-> +__ui + = +__c +; \ + +273 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +275 +__u +-> +__ui + = +__c +; \ + +276 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +278 +__u +-> +__usi + = (� +__c +; \ + +282 +__u +-> +__ui + = +__c +; \ + +283 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +285 +__u +-> +__ui + = +__c +; \ + +286 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +288 +__u +-> +__ui + = +__c +; \ + +289 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +291 +__u +-> +__uc + = (� +__c +; \ + +295 +__u +-> +__ui + = +__c +; \ + +296 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +298 +__u +-> +__ui + = +__c +; \ + +299 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +301 +__u +-> +__ui + = +__c +; \ + +302 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +304 +__u +-> +__ui + = +__c +; \ + +309 +__s +; }) + + ) + +311 + #__mem�t_c� +( +s +, +c +, +n +) \ + +312 ((( +n +) % 4 == 0) \ + +313 ? + `__mem�t_c�_by4 + ( +s +, ((�((�( +c +))) * 0x01010101,\ + +314 +n +) \ + +315 : ((( +n +) % 2 == 0) \ + +316 ? + `__mem�t_c�_by2 + ( +s +, \ + +317 ((�((�( +c +))) * 0x01010101,\ + +318 +n +) \ + +319 : + `mem�t + ( +s +, +c +, +n +))) + + ) + +321 +__STRING_INLINE + * +__mem�t_c�_by4 + (* +__s +, +__c +, + +322 +size_t + +__n +); + +324 +__STRING_INLINE + * + +325 + $__mem�t_c�_by4 + (* +__s +, +__c +, +size_t + +__n +) + +327 * +__tmp + = +__s +; + +328 +__d0 +; + +329 #ifde� +__i686__ + + +330 +__asm__ + +__vީ�e__ + + +333 : "=&a" ( +__c +), "=&D" ( +__tmp +), "=&c" ( +__d0 +), + +334 "=m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__n +]; } *) +__s +) + +335 : "0" ((� +__c +), "1" ( +__tmp +), "2" ( +__n + / 4) + +338 +__asm__ + +__vީ�e__ + + +344 : "=&r" ( +__c +), "=&r" ( +__tmp +), "=&r" ( +__d0 +), + +345 "=m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__n +]; } *) +__s +) + +346 : "0" ((� +__c +), "1" ( +__tmp +), "2" ( +__n + / 4) + +349 +__s +; + +350 + } +} + +352 +__STRING_INLINE + * +__mem�t_c�_by2 + (* +__s +, +__c +, + +353 +size_t + +__n +); + +355 +__STRING_INLINE + * + +356 + $__mem�t_c�_by2 + (* +__s +, +__c +, +size_t + +__n +) + +358 +__d0 +, +__d1 +; + +359 * +__tmp + = +__s +; + +360 #ifde� +__i686__ + + +361 +__asm__ + +__vީ�e__ + + +365 : "=&a" ( +__d0 +), "=&D" ( +__tmp +), "=&c" ( +__d1 +), + +366 "=m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__n +]; } *) +__s +) + +367 : "0" ((� +__c +), "1" ( +__tmp +), "2" ( +__n + / 4) + +370 +__asm__ + +__vީ�e__ + + +376 : "=&q" ( +__d0 +), "=&r" ( +__tmp +), "=&r" ( +__d1 +), + +377 "=m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__n +]; } *) +__s +) + +378 : "0" ((� +__c +), "1" ( +__tmp +), "2" ( +__n + / 4) + +381 +__s +; + +382 + } +} + +384 + #__mem�t_g� +( +s +, +c +, +n +) \ + +385 ((( +n +) % 4 == 0) \ + +386 ? + `__mem�t_g�_by4 + ( +s +, +c +, +n +) \ + +387 : ((( +n +) % 2 == 0) \ + +388 ? + `__mem�t_g�_by2 + ( +s +, +c +, +n +) \ + +389 : + `mem�t + ( +s +, +c +, +n +))) + + ) + +391 +__STRING_INLINE + * +__mem�t_g�_by4 + (* +__s +, +__c +, +size_t + +__n +); + +393 +__STRING_INLINE + * + +394 + $__mem�t_g�_by4 + (* +__s +, +__c +, +size_t + +__n +) + +396 * +__tmp + = +__s +; + +397 +__d0 +; + +398 +__asm__ + +__vީ�e__ + + +408 : "=&q" ( +__c +), "=&r" ( +__tmp +), "=&r" ( +__d0 +), + +409 "=m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__n +]; } *) +__s +) + +410 : "0" ((� +__c +), "1" ( +__tmp +), "2" ( +__n + / 4) + +412 +__s +; + +413 + } +} + +415 +__STRING_INLINE + * +__mem�t_g�_by2 + (* +__s +, +__c +, +size_t + +__n +); + +417 +__STRING_INLINE + * + +418 + $__mem�t_g�_by2 + (* +__s +, +__c +, +size_t + +__n +) + +420 +__d0 +, +__d1 +; + +421 * +__tmp + = +__s +; + +422 +__asm__ + +__vީ�e__ + + +433 : "=&q" ( +__d0 +), "=&r" ( +__tmp +), "=&r" ( +__d1 +), + +434 "=m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__n +]; } *) +__s +) + +435 : "0" ((� +__c +), "1" ( +__tmp +), "2" ( +__n + / 4) + +437 +__s +; + +438 + } +} + +442 + #_HAVE_STRING_ARCH_memchr + 1 + + ) + +443 #i�de� +_FORCE_INLINES + + +444 +__STRING_INLINE + * + +445 + $memchr + (cڡ * +__s +, +__c +, +size_t + +__n +) + +447 +__d0 +; + +448 #ifde� +__i686__ + + +449 +__d1 +; + +451 * +__�s +; + +452 i�( +__n + == 0) + +453 +NULL +; + +454 #ifde� +__i686__ + + +455 +__asm__ + +__vީ�e__ + + +459 : "=D" ( +__�s +), "=&c" ( +__d0 +), "=&r" ( +__d1 +) + +460 : "a" ( +__c +), "0" ( +__s +), "1" ( +__n +), "2" (1), + +461 "m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__n +]; } *) +__s +) + +464 +__asm__ + +__vީ�e__ + + +470 : "=D" ( +__�s +), "=&c" ( +__d0 +) + +471 : "a" ( +__c +), "0" ( +__s +), "1" ( +__n +), + +472 "m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__n +]; } *) +__s +) + +475 +__�s + - 1; + +476 + } +} + +479 + #_HAVE_STRING_ARCH_memrchr + 1 + + ) + +480 #i�de� +_FORCE_INLINES + + +481 +__STRING_INLINE + * +__memrchr + (cڡ * +__s +, +__c +, +size_t + +__n +); + +483 +__STRING_INLINE + * + +484 + $__memrchr + (cڡ * +__s +, +__c +, +size_t + +__n +) + +486 +__d0 +; + +487 #ifde� +__i686__ + + +488 +__d1 +; + +490 * +__�s +; + +491 i�( +__n + == 0) + +492 +NULL +; + +493 #ifde� +__i686__ + + +494 +__asm__ + +__vީ�e__ + + +500 : "=D" ( +__�s +), "=&c" ( +__d0 +), "=&r" ( +__d1 +) + +501 : "a" ( +__c +), "0" ( +__s + + +__n + - 1), "1" (__n), "2" (-1), + +502 "m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__n +]; } *) +__s +) + +505 +__asm__ + +__vީ�e__ + + +512 : "=D" ( +__�s +), "=&c" ( +__d0 +) + +513 : "a" ( +__c +), "0" ( +__s + + +__n + - 1), "1" (__n), + +514 "m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__n +]; } *) +__s +) + +517 +__�s +; + +518 + } +} + +519 #ifde� +__USE_GNU + + +520 + #memrchr +( +s +, +c +, +n +� + `__memrchr + ((s), (c), (n)) + + ) + +525 + #_HAVE_STRING_ARCH_�wmemchr + 1 + + ) + +526 +__STRING_INLINE + * +__�wmemchr + (cڡ * +__s +, +__c +); + +528 #i�de� +_FORCE_INLINES + + +529 +__STRING_INLINE + * + +530 + $__�wmemchr + (cڡ * +__s +, +__c +) + +532 +__d0 +; + +533 * +__�s +; + +534 +__asm__ + +__vީ�e__ + + +537 : "=D" ( +__�s +), "=&c" ( +__d0 +) + +538 : "a" ( +__c +), "0" ( +__s +), "1" (0xffffffff), + +539 "m" ( *(�ru� { +__x +[0xfffffff]; } *) +__s +) + +541 +__�s + - 1; + +542 + } +} + +543 #ifde� +__USE_GNU + + +544 +__STRING_INLINE + * + +545 + $�wmemchr + (cڡ * +__s +, +__c +) + +547 + `__�wmemchr + ( +__s +, +__c +); + +548 + } +} + +554 + #_HAVE_STRING_ARCH_��� + 1 + + ) + +555 + #��� +( +�r +) \ + +556 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +�r +) \ + +557 ? + `__bu�t�_��� + ( +�r +) \ + +558 : + `__���_g + ( +�r +))) + + ) + +559 +__STRING_INLINE + +size_t + +__���_g + (cڡ * +__�r +); + +561 +__STRING_INLINE + +size_t + + +562 + $__���_g + (cڡ * +__�r +) + +564 +__dummy +; + +565 cڡ * +__tmp + = +__�r +; + +566 +__asm__ + +__vީ�e__ + + +572 : "�" ( +__tmp +), "=&q" ( +__dummy +) + +573 : "0" ( +__�r +), + +574 "m" ( *(�ru� { +__x +[0xfffffff]; } *) +__�r +) + +576 +__tmp + - +__�r + - 1; + +577 + } +} + +581 + #_HAVE_STRING_ARCH_�r�y + 1 + + ) + +582 + #�r�y +( +de� +, +�c +) \ + +583 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +�c +) \ + +584 ? ( (( +�c +)[0]�=�1 && + `��� + (src) + 1 <= 8 \ + +585 ? + `__�r�y_a_sm�l + (( +de� +), ( +�c +), + `��� + (src) + 1) \ + +586 : (*� + `mem�y + ((*�( +de� +), \ + +587 (cڡ *�( +�c +), \ + +588 + `��� + ( +�c +) + 1)) \ + +589 : + `__�r�y_g + (( +de� +), ( +�c +)))) + + ) + +591 + #__�r�y_a_sm�l +( +de� +, +�c +, +��� +) \ + +592 ( + `__ex�nsi�__ + ({ * +__de� + = ( +de� +); \ + +594 +__ui +; \ + +595 +__usi +; \ + +596 +__uc +; \ + +597 +__c +; \ + +598 } * +__u + = (*� +__de� +; \ + +599 +��� +) \ + +602 +__u +-> +__uc + = '\0'; \ + +605 +__u +-> +__usi + = + `__STRING_SMALL_GET16 + ( +�c +, 0); \ + +608 +__u +-> +__usi + = + `__STRING_SMALL_GET16 + ( +�c +, 0); \ + +609 +__u + = + `__ex�nsi�__ + ((*) __u + 2); \ + +610 +__u +-> +__uc + = '\0'; \ + +613 +__u +-> +__ui + = + `__STRING_SMALL_GET32 + ( +�c +, 0); \ + +616 +__u +-> +__ui + = + `__STRING_SMALL_GET32 + ( +�c +, 0); \ + +617 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +618 +__u +-> +__uc + = '\0'; \ + +621 +__u +-> +__ui + = + `__STRING_SMALL_GET32 + ( +�c +, 0); \ + +622 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +623 +__u +-> +__usi + = + `__STRING_SMALL_GET16 + ( +�c +, 4); \ + +626 +__u +-> +__ui + = + `__STRING_SMALL_GET32 + ( +�c +, 0); \ + +627 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +628 +__u +-> +__usi + = + `__STRING_SMALL_GET16 + ( +�c +, 4); \ + +629 +__u + = + `__ex�nsi�__ + ((*) __u + 2); \ + +630 +__u +-> +__uc + = '\0'; \ + +633 +__u +-> +__ui + = + `__STRING_SMALL_GET32 + ( +�c +, 0); \ + +634 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +635 +__u +-> +__ui + = + `__STRING_SMALL_GET32 + ( +�c +, 4); \ + +638 (*� +__de� +; })) + + ) + +640 +__STRING_INLINE + * +__�r�y_g + (* +__de� +, cڡ * +__�c +); + +642 +__STRING_INLINE + * + +643 + $__�r�y_g + (* +__de� +, cڡ * +__�c +) + +645 * +__tmp + = +__de� +; + +646 +__dummy +; + +647 +__asm__ + +__vީ�e__ + + +656 : "=&r" ( +__�c +), "=&r" ( +__tmp +), "=&q" ( +__dummy +), + +657 "=m" ( *(�ru� { +__x +[0xfffffff]; } *) +__de� +) + +658 : "0" ( +__�c +), "1" ( +__tmp +), + +659 "m" ( *(�ru� { +__x +[0xfffffff]; } *) +__�c +) + +661 +__de� +; + +662 + } +} + +665 #ifde� +__USE_GNU + + +666 + #_HAVE_STRING_ARCH_�p�y + 1 + + ) + +668 + #__�p�y +( +de� +, +�c +) \ + +669 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +�c +) \ + +670 ? ( + `��� + ( +�c +) + 1 <= 8 \ + +671 ? + `__�p�y_a_sm�l + (( +de� +), ( +�c +), + `��� + (src) + 1) \ + +672 : + `__�p�y_c + (( +de� +), ( +�c +), + `��� + (src) + 1)) \ + +673 : + `__�p�y_g + (( +de� +), ( +�c +)))) + + ) + +674 + #__�p�y_c +( +de� +, +�c +, +��� +) \ + +675 (( +��� +) % 4 == 0 \ + +676 ? + `__memp�y_by4 + ( +de� +, +�c +, +��� +) - 1 \ + +677 : (( +��� +) % 2 == 0 \ + +678 ? + `__memp�y_by2 + ( +de� +, +�c +, +��� +) - 1 \ + +679 : + `__memp�y_byn + ( +de� +, +�c +, +��� +�- 1)) + + ) + +682 + #�p�y +( +de� +, +�c +� + `__�p�y + ((de�), (�c)) + + ) + +684 + #__�p�y_a_sm�l +( +de� +, +�c +, +��� +) \ + +685 ( + `__ex�nsi�__ + ({ union { \ + +686 +__ui +; \ + +687 +__usi +; \ + +688 +__uc +; \ + +689 +__c +; \ + +690 } * +__u + = (*�( +de� +); \ + +691 +��� +) \ + +694 +__u +-> +__uc + = '\0'; \ + +697 +__u +-> +__usi + = + `__STRING_SMALL_GET16 + ( +�c +, 0); \ + +698 +__u + = + `__ex�nsi�__ + ((*) __u + 1); \ + +701 +__u +-> +__usi + = + `__STRING_SMALL_GET16 + ( +�c +, 0); \ + +702 +__u + = + `__ex�nsi�__ + ((*) __u + 2); \ + +703 +__u +-> +__uc + = '\0'; \ + +706 +__u +-> +__ui + = + `__STRING_SMALL_GET32 + ( +�c +, 0); \ + +707 +__u + = + `__ex�nsi�__ + ((*) __u + 3); \ + +710 +__u +-> +__ui + = + `__STRING_SMALL_GET32 + ( +�c +, 0); \ + +711 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +712 +__u +-> +__uc + = '\0'; \ + +715 +__u +-> +__ui + = + `__STRING_SMALL_GET32 + ( +�c +, 0); \ + +716 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +717 +__u +-> +__usi + = + `__STRING_SMALL_GET16 + ( +�c +, 4); \ + +718 +__u + = + `__ex�nsi�__ + ((*) __u + 1); \ + +721 +__u +-> +__ui + = + `__STRING_SMALL_GET32 + ( +�c +, 0); \ + +722 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +723 +__u +-> +__usi + = + `__STRING_SMALL_GET16 + ( +�c +, 4); \ + +724 +__u + = + `__ex�nsi�__ + ((*) __u + 2); \ + +725 +__u +-> +__uc + = '\0'; \ + +728 +__u +-> +__ui + = + `__STRING_SMALL_GET32 + ( +�c +, 0); \ + +729 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +730 +__u +-> +__ui + = + `__STRING_SMALL_GET32 + ( +�c +, 4); \ + +731 +__u + = + `__ex�nsi�__ + ((*) __u + 3); \ + +734 (*� +__u +; })) + + ) + +736 +__STRING_INLINE + * +__memp�y_by4 + (* +__de� +, cڡ * +__�c +, + +737 +size_t + +__��� +); + +739 +__STRING_INLINE + * + +740 + $__memp�y_by4 + (* +__de� +, cڡ * +__�c +, +size_t + +__��� +) + +742 * +__tmp + = +__de� +; + +743 +__d0 +, +__d1 +; + +744 +__asm__ + +__vީ�e__ + + +752 : "=&r" ( +__d0 +), "�" ( +__tmp +), "=&r" ( +__�c +), "=&r" ( +__d1 +) + +753 : "1" ( +__tmp +), "2" ( +__�c +), "3" ( +__��� + / 4) + +755 +__tmp +; + +756 + } +} + +758 +__STRING_INLINE + * +__memp�y_by2 + (* +__de� +, cڡ * +__�c +, + +759 +size_t + +__��� +); + +761 +__STRING_INLINE + * + +762 + $__memp�y_by2 + (* +__de� +, cڡ * +__�c +, +size_t + +__��� +) + +764 * +__tmp + = +__de� +; + +765 +__d0 +, +__d1 +; + +766 +__asm__ + +__vީ�e__ + + +779 : "=&q" ( +__d0 +), "�" ( +__tmp +), "=&r" ( +__�c +), "=&r" ( +__d1 +), + +780 "=m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__��� +]; } *) +__de� +) + +781 : "1" ( +__tmp +), "2" ( +__�c +), "3" ( +__��� + / 2), + +782 "m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__��� +]; } *) +__�c +) + +784 +__tmp + + 2; + +785 + } +} + +787 +__STRING_INLINE + * +__memp�y_byn + (* +__de� +, cڡ * +__�c +, + +788 +size_t + +__��� +); + +790 +__STRING_INLINE + * + +791 + $__memp�y_byn + (* +__de� +, cڡ * +__�c +, +size_t + +__��� +) + +793 +__d0 +, +__d1 +; + +794 * +__tmp + = +__de� +; + +795 +__asm__ + +__vީ�e__ + + +806 : "=D" ( +__tmp +), "=&c" ( +__d0 +), "=&S" ( +__d1 +), + +807 "=m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__��� +]; } *) +__de� +) + +808 : "0" ( +__tmp +), "1" ( +__��� +), "2" ( +__�c +), + +809 "m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__��� +]; } *) +__�c +) + +811 +__tmp +; + +812 + } +} + +814 +__STRING_INLINE + * +__�p�y_g + (* +__de� +, cڡ * +__�c +); + +816 +__STRING_INLINE + * + +817 + $__�p�y_g + (* +__de� +, cڡ * +__�c +) + +819 * +__tmp + = +__de� +; + +820 +__dummy +; + +821 +__asm__ + +__vީ�e__ + + +830 : "=&r" ( +__�c +), "�" ( +__tmp +), "=&q" ( +__dummy +), + +831 "=m" ( *(�ru� { +__x +[0xfffffff]; } *) +__de� +) + +832 : "0" ( +__�c +), "1" ( +__tmp +), + +833 "m" ( *(�ru� { +__x +[0xfffffff]; } *) +__�c +) + +835 +__tmp + - 1; + +836 + } +} + +841 + #_HAVE_STRING_ARCH_���y + 1 + + ) + +842 + #���y +( +de� +, +�c +, +n +) \ + +843 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +�c +) \ + +844 ? (( + `��� + ( +�c +�+ 1 >�(( +size_t +�( +n +)) \ + +845 ? (*� + `mem�y + ((*�( +de� +), \ + +846 (cڡ *�( +�c +), +n +) \ + +847 : + `__���y_cg + (( +de� +), ( +�c +), + `��� + (�c�+ 1, +n +))) \ + +848 : + `__���y_gg + (( +de� +), ( +�c +), +n +))) + + ) + +849 + #__���y_cg +( +de� +, +�c +, +��� +, +n +) \ + +850 ((( +��� +) % 4 == 0) \ + +851 ? + `__���y_by4 + ( +de� +, +�c +, +��� +, +n +) \ + +852 : ((( +��� +) % 2 == 0) \ + +853 ? + `__���y_by2 + ( +de� +, +�c +, +��� +, +n +) \ + +854 : + `__���y_byn + ( +de� +, +�c +, +��� +, +n +))) + + ) + +856 +__STRING_INLINE + * +__���y_by4 + (* +__de� +, cڡ +__�c +[], + +857 +size_t + +__��� +, size_� +__n +); + +859 +__STRING_INLINE + * + +860 + $__���y_by4 + (* +__de� +, cڡ +__�c +[], +size_t + +__��� +, size_� +__n +) + +862 * +__tmp + = +__de� +; + +863 +__dummy1 +, +__dummy2 +; + +864 +__asm__ + +__vީ�e__ + + +872 : "=&r" ( +__dummy1 +), "�" ( +__tmp +), "=&r" ( +__�c +), "=&r" ( +__dummy2 +), + +873 "=m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__��� +]; } *) +__de� +) + +874 : "1" ( +__tmp +), "2" ( +__�c +), "3" ( +__��� + / 4), + +875 "m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__��� +]; } *) +__�c +) + +877 (� + `mem�t + ( +__tmp +, '\0', +__n + - +__��� +); + +878 +__de� +; + +879 + } +} + +881 +__STRING_INLINE + * +__���y_by2 + (* +__de� +, cڡ +__�c +[], + +882 +size_t + +__��� +, size_� +__n +); + +884 +__STRING_INLINE + * + +885 + $__���y_by2 + (* +__de� +, cڡ +__�c +[], +size_t + +__��� +, size_� +__n +) + +887 * +__tmp + = +__de� +; + +888 +__dummy1 +, +__dummy2 +; + +889 +__asm__ + +__vީ�e__ + + +902 : "=&q" ( +__dummy1 +), "�" ( +__tmp +), "=&r" ( +__�c +), "=&r" ( +__dummy2 +), + +903 "=m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__��� +]; } *) +__de� +) + +904 : "1" ( +__tmp +), "2" ( +__�c +), "3" ( +__��� + / 2), + +905 "m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__��� +]; } *) +__�c +) + +907 (� + `mem�t + ( +__tmp + + 2, '\0', +__n + - +__��� +); + +908 +__de� +; + +909 + } +} + +911 +__STRING_INLINE + * +__���y_byn + (* +__de� +, cڡ +__�c +[], + +912 +size_t + +__��� +, size_� +__n +); + +914 +__STRING_INLINE + * + +915 + $__���y_byn + (* +__de� +, cڡ +__�c +[], +size_t + +__��� +, size_� +__n +) + +917 +__d0 +, +__d1 +; + +918 * +__tmp + = +__de� +; + +919 +__asm__ + +__vީ�e__ + + +930 : "=D" ( +__tmp +), "=&c" ( +__d0 +), "=&S" ( +__d1 +), + +931 "=m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__��� +]; } *) +__de� +) + +932 : "1" ( +__��� +), "0" ( +__tmp +),"2" ( +__�c +), + +933 "m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__��� +]; } *) +__�c +) + +935 (� + `mem�t + ( +__tmp +, '\0', +__n + - +__��� +); + +936 +__de� +; + +937 + } +} + +939 +__STRING_INLINE + * +__���y_gg + (* +__de� +, cڡ * +__�c +, + +940 +size_t + +__n +); + +942 +__STRING_INLINE + * + +943 + $__���y_gg + (* +__de� +, cڡ * +__�c +, +size_t + +__n +) + +945 * +__tmp + = +__de� +; + +946 +__dummy +; + +947 i�( +__n + > 0) + +948 +__asm__ + +__vީ�e__ + + +964 : "=&r" ( +__�c +), "=&r" ( +__tmp +), "=&q" ( +__dummy +), "=&r" ( +__n +) + +965 : "0" ( +__�c +), "1" ( +__tmp +), "3" ( +__n +) + +968 +__de� +; + +969 + } +} + +973 + #_HAVE_STRING_ARCH_�r�t + 1 + + ) + +974 + #�r�t +( +de� +, +�c +) \ + +975 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +�c +) \ + +976 ? + `__�r�t_c + (( +de� +), ( +�c +), + `��� + (src) + 1) \ + +977 : + `__�r�t_g + (( +de� +), ( +�c +)))) + + ) + +979 +__STRING_INLINE + * +__�r�t_c + (* +__de� +, cڡ +__�c +[], + +980 +size_t + +__��� +); + +982 +__STRING_INLINE + * + +983 + $__�r�t_c + (* +__de� +, cڡ +__�c +[], +size_t + +__��� +) + +985 #ifde� +__i686__ + + +986 +__d0 +; + +987 * +__tmp +; + +988 +__asm__ + +__vީ�e__ + + +990 : "=D" ( +__tmp +), "=&c" ( +__d0 +), + +991 "=m" ( *(�ru� { +__x +[0xfffffff]; } *) +__de� +) + +992 : "0" ( +__de� +), "1" (0xffffffff), "a" (0), + +993 "m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__��� +]; } *) +__�c +) + +995 -- +__tmp +; + +997 * +__tmp + = +__de� + - 1; + +998 +__asm__ + +__vީ�e__ + + +1003 : "�" ( +__tmp +), + +1004 "=m" ( *(�ru� { +__x +[0xfffffff]; } *) +__de� +) + +1005 : "0" ( +__tmp +), + +1006 "m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__��� +]; } *) +__�c +) + +1009 (� + `mem�y + ( +__tmp +, +__�c +, +__��� +); + +1010 +__de� +; + +1011 + } +} + +1013 +__STRING_INLINE + * +__�r�t_g + (* +__de� +, cڡ * +__�c +); + +1015 +__STRING_INLINE + * + +1016 + $__�r�t_g + (* +__de� +, cڡ * +__�c +) + +1018 * +__tmp + = +__de� + - 1; + +1019 +__dummy +; + +1020 +__asm__ + +__vީ�e__ + + +1032 : "=&q" ( +__dummy +), "=&r" ( +__tmp +), "=&r" ( +__�c +), + +1033 "=m" ( *(�ru� { +__x +[0xfffffff]; } *) +__de� +) + +1034 : "1" ( +__tmp +), "2" ( +__�c +), + +1035 "m" ( *(�ru� { +__x +[0xfffffff]; } *) +__�c +) + +1037 +__de� +; + +1038 + } +} + +1042 + #_HAVE_STRING_ARCH_���t + 1 + + ) + +1043 + #���t +( +de� +, +�c +, +n +) \ + +1044 ( + `__ex�nsi�__ + ({ * +__de� + = ( +de� +); \ + +1045 + `__bu�t�_cڡ�t_p + ( +�c +�&& __bu�t�_cڡ�t_�( +n +) \ + +1046 ? ( + `��� + ( +�c +�< (( +size_t +�( +n +)) \ + +1047 ? + `�r�t + ( +__de� +, ( +�c +)) \ + +1048 : (*(*) + `__memp�y + ( + `�rchr + ( +__de� +, '\0'), \ + +1049 (cڡ *�( +�c +), \ + +1050 ( +n +)��0, +__de� +)) \ + +1051 : + `__���t_g + ( +__de� +, ( +�c +), ( +n +)); })) + + ) + +1053 +__STRING_INLINE + * +__���t_g + (* +__de� +, cڡ +__�c +[], + +1054 +size_t + +__n +); + +1056 +__STRING_INLINE + * + +1057 + $__���t_g + (* +__de� +, cڡ +__�c +[], +size_t + +__n +) + +1059 * +__tmp + = +__de� +; + +1060 +__dummy +; + +1061 #ifde� +__i686__ + + +1062 +__asm__ + +__vީ�e__ + + +1076 : "=&a" ( +__dummy +), "=&D" ( +__tmp +), "=&S" ( +__�c +), "=&c" ( +__n +) + +1077 : "g" ( +__n +), "0" (0), "1" ( +__tmp +), "2" ( +__�c +), "3" (0xffffffff) + +1080 -- +__tmp +; + +1081 +__asm__ + +__vީ�e__ + + +1098 : "=&q" ( +__dummy +), "=&r" ( +__tmp +), "=&r" ( +__�c +), "=&r" ( +__n +) + +1099 : "1" ( +__tmp +), "2" ( +__�c +), "3" ( +__n +) + +1102 +__de� +; + +1103 + } +} + +1107 + #_HAVE_STRING_ARCH_�rcmp + 1 + + ) + +1108 + #�rcmp +( +s1 +, +s2 +) \ + +1109 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +s1 +�&& __bu�t�_cڡ�t_�( +s2 +) \ + +1110 && ( (( +s1 +)[0]�!�1 || + `��� + (s1) >= 4) \ + +1111 && ( (( +s2 +)[0]�!�1 || + `��� + (s2) >= 4) \ + +1112 ? + `memcmp + ((cڡ *�( +s1 +), (cڡ *�( +s2 +), \ + +1113 ( + `��� + ( +s1 +�< s���( +s2 +) \ + +1114 ? + `��� + ( +s1 +�: s���( +s2 +)) + 1) \ + +1115 : ( + `__bu�t�_cڡ�t_p + ( +s1 +) && ((s1)[0]) == 1 \ + +1116 && (( +s2 +)[0]�=�1 && + `��� + ( +s1 +) < 4 \ + +1117 ? ( + `__bu�t�_cڡ�t_p + ( +s2 +) && ((s2)[0]) == 1 \ + +1118 ? + `__�rcmp_cc + ((cڡ *�( +s1 +), \ + +1119 (cڡ *�( +s2 +), \ + +1120 + `��� + ( +s1 +)) \ + +1121 : + `__�rcmp_cg + ((cڡ *�( +s1 +), \ + +1122 (cڡ *�( +s2 +), \ + +1123 + `��� + ( +s1 +))) \ + +1124 : ( + `__bu�t�_cڡ�t_p + ( +s2 +�&& (( +s1 +)[0]) == 1 \ + +1125 && (( +s2 +)[0]�=�1 && + `��� + (s2) < 4 \ + +1126 ? ( + `__bu�t�_cڡ�t_p + ( +s1 +) \ + +1127 ? + `__�rcmp_cc + ((cڡ *�( +s1 +), \ + +1128 (cڡ *�( +s2 +), \ + +1129 + `��� + ( +s2 +)) \ + +1130 : + `__�rcmp_gc + ((cڡ *�( +s1 +), \ + +1131 (cڡ *�( +s2 +), \ + +1132 + `��� + ( +s2 +))) \ + +1133 : + `__�rcmp_gg + (( +s1 +), ( +s2 +)))))) + + ) + +1135 + #__�rcmp_cc +( +s1 +, +s2 +, +l +) \ + +1136 ( + `__ex�nsi�__ + ({ +__�su� + = ( +s1 +)[0] - ( +s2 +)[0]; \ + +1137 i�( +l + > 0 && +__�su� + == 0) \ + +1139 +__�su� + = ( +s1 +)[1] - ( +s2 +)[1]; \ + +1140 i�( +l + > 1 && +__�su� + == 0) \ + +1142 +__�su� + = ( +s1 +)[2] - ( +s2 +)[2]; \ + +1143 i�( +l + > 2 && +__�su� + == 0) \ + +1144 +__�su� + = ( +s1 +)[3] - ( +s2 +)[3]; \ + +1147 +__�su� +; })) + + ) + +1149 + #__�rcmp_cg +( +s1 +, +s2 +, +l1 +) \ + +1150 ( + `__ex�nsi�__ + ({ cڡ * +__s2 + = ( +s2 +); \ + +1151 +__�su� + = ( +s1 +)[0] - +__s2 +[0]; \ + +1152 i�( +l1 + > 0 && +__�su� + == 0) \ + +1154 +__�su� + = ( +s1 +)[1] - +__s2 +[1]; \ + +1155 i�( +l1 + > 1 && +__�su� + == 0) \ + +1157 +__�su� + = ( +s1 +)[2] - +__s2 +[2]; \ + +1158 i�( +l1 + > 2 && +__�su� + == 0) \ + +1159 +__�su� + = ( +s1 +)[3] - +__s2 +[3]; \ + +1162 +__�su� +; })) + + ) + +1164 + #__�rcmp_gc +( +s1 +, +s2 +, +l2 +) \ + +1165 ( + `__ex�nsi�__ + ({ cڡ * +__s1 + = ( +s1 +); \ + +1166 +__�su� + = +__s1 +[0] - ( +s2 +)[0]; \ + +1167 i�( +l2 + > 0 && +__�su� + == 0) \ + +1169 +__�su� + = +__s1 +[1] - ( +s2 +)[1]; \ + +1170 i�( +l2 + > 1 && +__�su� + == 0) \ + +1172 +__�su� + = +__s1 +[2] - ( +s2 +)[2]; \ + +1173 i�( +l2 + > 2 && +__�su� + == 0) \ + +1174 +__�su� + = +__s1 +[3] - ( +s2 +)[3]; \ + +1177 +__�su� +; })) + + ) + +1179 +__STRING_INLINE + +__�rcmp_gg + (cڡ * +__s1 +, cڡ * +__s2 +); + +1181 +__STRING_INLINE + + +1182 + $__�rcmp_gg + (cڡ * +__s1 +, cڡ * +__s2 +) + +1184 +__�s +; + +1185 +__asm__ + +__vީ�e__ + + +1201 : "=q" ( +__�s +), "=&r" ( +__s1 +), "=&r" ( +__s2 +) + +1202 : "1" ( +__s1 +), "2" ( +__s2 +), + +1203 "m" ( *(�ru� { +__x +[0xfffffff]; } *) +__s1 +), + +1204 "m" ( *(�ru� { +__x +[0xfffffff]; } *) +__s2 +) + +1206 +__�s +; + +1207 + } +} + +1211 + #_HAVE_STRING_ARCH_��cmp + 1 + + ) + +1212 + #��cmp +( +s1 +, +s2 +, +n +) \ + +1213 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +s1 +�&& + `��� + (s1�< (( +size_t +�( +n +)) \ + +1214 ? + `�rcmp + (( +s1 +), ( +s2 +)) \ + +1215 : ( + `__bu�t�_cڡ�t_p + ( +s2 +�&& + `��� + (s2�< (( +size_t +�( +n +))\ + +1216 ? + `�rcmp + (( +s1 +), ( +s2 +)) \ + +1217 : + `__��cmp_g + (( +s1 +), ( +s2 +), ( +n +))))) + + ) + +1219 +__STRING_INLINE + +__��cmp_g + (cڡ * +__s1 +, cڡ * +__s2 +, + +1220 +size_t + +__n +); + +1222 +__STRING_INLINE + + +1223 + $__��cmp_g + (cڡ * +__s1 +, cڡ * +__s2 +, +size_t + +__n +) + +1225 +__�s +; + +1226 +__asm__ + +__vީ�e__ + + +1245 : "=q" ( +__�s +), "=&r" ( +__s1 +), "=&r" ( +__s2 +), "=&r" ( +__n +) + +1246 : "1" ( +__s1 +), "2" ( +__s2 +), "3" ( +__n +), + +1247 "m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__n +]; } *) +__s1 +), + +1248 "m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__n +]; } *) +__s2 +) + +1250 +__�s +; + +1251 + } +} + +1255 + #_HAVE_STRING_ARCH_�rchr + 1 + + ) + +1256 + #_USE_STRING_ARCH_�rchr + 1 + + ) + +1257 + #�rchr +( +s +, +c +) \ + +1258 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +c +) \ + +1259 ? (( +c +) == '\0' \ + +1260 ? (*� + `__�wmemchr + (( +s +), ( +c +)) \ + +1261 : + `__�rchr_c + (( +s +), (( +c +) & 0xff) << 8)) \ + +1262 : + `__�rchr_g + (( +s +), ( +c +)))) + + ) + +1264 +__STRING_INLINE + * +__�rchr_c + (cڡ * +__s +, +__c +); + +1266 +__STRING_INLINE + * + +1267 + $__�rchr_c + (cڡ * +__s +, +__c +) + +1269 +__d0 +; + +1270 * +__�s +; + +1271 +__asm__ + +__vީ�e__ + + +1281 : "�" ( +__�s +), "=&a" ( +__d0 +) + +1282 : "0" ( +__s +), "1" ( +__c +), + +1283 "m" ( *(�ru� { +__x +[0xfffffff]; } *) +__s +) + +1285 +__�s +; + +1286 + } +} + +1288 +__STRING_INLINE + * +__�rchr_g + (cڡ * +__s +, +__c +); + +1290 +__STRING_INLINE + * + +1291 + $__�rchr_g + (cڡ * +__s +, +__c +) + +1293 +__d0 +; + +1294 * +__�s +; + +1295 +__asm__ + +__vީ�e__ + + +1306 : "�" ( +__�s +), "=&a" ( +__d0 +) + +1307 : "0" ( +__s +), "1" ( +__c +), + +1308 "m" ( *(�ru� { +__x +[0xfffffff]; } *) +__s +) + +1310 +__�s +; + +1311 + } +} + +1315 + #_HAVE_STRING_ARCH_�rch�ul + 1 + + ) + +1316 + #__�rch�ul +( +s +, +c +) \ + +1317 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +c +) \ + +1318 ? (( +c +) == '\0' \ + +1319 ? (*� + `__�wmemchr + (( +s +), +c +) \ + +1320 : + `__�rch�ul_c + (( +s +), (( +c +) & 0xff) << 8)) \ + +1321 : + `__�rch�ul_g + (( +s +), +c +))) + + ) + +1323 +__STRING_INLINE + * +__�rch�ul_c + (cڡ * +__s +, +__c +); + +1325 +__STRING_INLINE + * + +1326 + $__�rch�ul_c + (cڡ * +__s +, +__c +) + +1328 +__d0 +; + +1329 * +__�s +; + +1330 +__asm__ + +__vީ�e__ + + +1340 : "�" ( +__�s +), "=&a" ( +__d0 +) + +1341 : "0" ( +__s +), "1" ( +__c +), + +1342 "m" ( *(�ru� { +__x +[0xfffffff]; } *) +__s +) + +1344 +__�s +; + +1345 + } +} + +1347 +__STRING_INLINE + * +__�rch�ul_g + (cڡ * +__s +, +__c +); + +1349 +__STRING_INLINE + * + +1350 + $__�rch�ul_g + (cڡ * +__s +, +__c +) + +1352 +__d0 +; + +1353 * +__�s +; + +1354 +__asm__ + +__vީ�e__ + + +1365 : "�" ( +__�s +), "=&a" ( +__d0 +) + +1366 : "0" ( +__s +), "1" ( +__c +), + +1367 "m" ( *(�ru� { +__x +[0xfffffff]; } *) +__s +) + +1369 +__�s +; + +1370 + } +} + +1371 #ifde� +__USE_GNU + + +1372 + #�rch�ul +( +s +, +c +� + `__�rch�ul + ((s), (c)) + + ) + +1376 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + + +1378 + #_HAVE_STRING_ARCH_�dex + 1 + + ) + +1379 + #�dex +( +s +, +c +) \ + +1380 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +c +) \ + +1381 ? + `__�rchr_c + (( +s +), (( +c +) & 0xff) << 8) \ + +1382 : + `__�rchr_g + (( +s +), ( +c +)))) + + ) + +1387 + #_HAVE_STRING_ARCH_��chr + 1 + + ) + +1388 + #��chr +( +s +, +c +) \ + +1389 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +c +) \ + +1390 ? + `__��chr_c + (( +s +), (( +c +) & 0xff) << 8) \ + +1391 : + `__��chr_g + (( +s +), ( +c +)))) + + ) + +1393 #ifde� +__i686__ + + +1394 +__STRING_INLINE + * +__��chr_c + (cڡ * +__s +, +__c +); + +1396 +__STRING_INLINE + * + +1397 + $__��chr_c + (cڡ * +__s +, +__c +) + +1399 +__d0 +, +__d1 +; + +1400 * +__�s +; + +1401 +__asm__ + +__vީ�e__ + + +1409 : "=d" ( +__�s +), "=&S" ( +__d0 +), "=&a" ( +__d1 +) + +1410 : "0" (1), "1" ( +__s +), "2" ( +__c +), + +1411 "m" ( *(�ru� { +__x +[0xfffffff]; } *) +__s +) + +1413 +__�s + - 1; + +1414 + } +} + +1416 +__STRING_INLINE + * +__��chr_g + (cڡ * +__s +, +__c +); + +1418 +__STRING_INLINE + * + +1419 + $__��chr_g + (cڡ * +__s +, +__c +) + +1421 +__d0 +, +__d1 +; + +1422 * +__�s +; + +1423 +__asm__ + +__vީ�e__ + + +1432 : "=d" ( +__�s +), "=&S" ( +__d0 +), "=&a" ( +__d1 +) + +1433 : "0" (1), "1" ( +__s +), "2" ( +__c +), + +1434 "m" ( *(�ru� { +__x +[0xfffffff]; } *) +__s +) + +1436 +__�s + - 1; + +1437 + } +} + +1439 +__STRING_INLINE + * +__��chr_c + (cڡ * +__s +, +__c +); + +1441 +__STRING_INLINE + * + +1442 + $__��chr_c + (cڡ * +__s +, +__c +) + +1444 +__d0 +, +__d1 +; + +1445 * +__�s +; + +1446 +__asm__ + +__vީ�e__ + + +1456 : "=d" ( +__�s +), "=&S" ( +__d0 +), "=&a" ( +__d1 +) + +1457 : "0" (0), "1" ( +__s +), "2" ( +__c +), + +1458 "m" ( *(�ru� { +__x +[0xfffffff]; } *) +__s +) + +1460 +__�s +; + +1461 + } +} + +1463 +__STRING_INLINE + * +__��chr_g + (cڡ * +__s +, +__c +); + +1465 +__STRING_INLINE + * + +1466 + $__��chr_g + (cڡ * +__s +, +__c +) + +1468 +__d0 +, +__d1 +; + +1469 * +__�s +; + +1470 +__asm__ + +__vީ�e__ + + +1481 : "�" ( +__�s +), "=&S" ( +__d0 +), "=&a" ( +__d1 +) + +1482 : "0" (0), "1" ( +__s +), "2" ( +__c +), + +1483 "m" ( *(�ru� { +__x +[0xfffffff]; } *) +__s +) + +1485 +__�s +; + +1486 + } +} + +1490 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + + +1492 + #_HAVE_STRING_ARCH_r�dex + 1 + + ) + +1493 + #r�dex +( +s +, +c +) \ + +1494 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +c +) \ + +1495 ? + `__��chr_c + (( +s +), (( +c +) & 0xff) << 8) \ + +1496 : + `__��chr_g + (( +s +), ( +c +)))) + + ) + +1502 + #_HAVE_STRING_ARCH_�rc�n + 1 + + ) + +1503 + #�rc�n +( +s +, +�je� +) \ + +1504 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +�je� +) && ((reject)[0]) == 1 \ + +1505 ? (( +�je� +)[0] == '\0' \ + +1506 ? + `��� + ( +s +) \ + +1507 : (( +�je� +)[1] == '\0' \ + +1508 ? + `__�rc�n_c1 + (( +s +), ((( +�je� +)[0] << 8) & 0xff00)) \ + +1509 : + `__�rc�n_cg + (( +s +), ( +�je� +), + `��� + (reject)))) \ + +1510 : + `__�rc�n_g + (( +s +), ( +�je� +)))) + + ) + +1512 +__STRING_INLINE + +size_t + +__�rc�n_c1 + (cڡ * +__s +, +__�je� +); + +1514 #i�de� +_FORCE_INLINES + + +1515 +__STRING_INLINE + +size_t + + +1516 + $__�rc�n_c1 + (cڡ * +__s +, +__�je� +) + +1518 +__d0 +; + +1519 * +__�s +; + +1520 +__asm__ + +__vީ�e__ + + +1529 : "�" ( +__�s +), "=&a" ( +__d0 +) + +1530 : "0" ( +__s +), "1" ( +__�je� +), + +1531 "m" ( *(�ru� { +__x +[0xfffffff]; } *) +__s +) + +1533 ( +__�s + - 1�- +__s +; + +1534 + } +} + +1537 +__STRING_INLINE + +size_t + +__�rc�n_cg + (cڡ * +__s +, cڡ +__�je� +[], + +1538 +size_t + +__�je�_�n +); + +1540 +__STRING_INLINE + +size_t + + +1541 + $__�rc�n_cg + (cڡ * +__s +, cڡ +__�je� +[], +size_t + +__�je�_�n +) + +1543 +__d0 +, +__d1 +, +__d2 +; + +1544 cڡ * +__�s +; + +1545 +__asm__ + +__vީ�e__ + + +1556 : "=S" ( +__�s +), "=&a" ( +__d0 +), "=&c" ( +__d1 +), "=&D" ( +__d2 +) + +1557 : "0" ( +__s +), "d" ( +__�je� +), "g" ( +__�je�_�n +) + +1559 ( +__�s + - 1�- +__s +; + +1560 + } +} + +1562 +__STRING_INLINE + +size_t + +__�rc�n_g + (cڡ * +__s +, cڡ * +__�je� +); + +1563 #ifde� +__PIC__ + + +1565 +__STRING_INLINE + +size_t + + +1566 + $__�rc�n_g + (cڡ * +__s +, cڡ * +__�je� +) + +1568 +__d0 +, +__d1 +, +__d2 +; + +1569 cڡ * +__�s +; + +1570 +__asm__ + +__vީ�e__ + + +1587 : "=S" ( +__�s +), "=&a" ( +__d0 +), "=&c" ( +__d1 +), "=&D" ( +__d2 +) + +1588 : "r" ( +__�je� +), "0" ( +__s +), "1" (0), "2" (0xffffffff) + +1590 ( +__�s + - 1�- +__s +; + +1591 + } +} + +1593 +__STRING_INLINE + +size_t + + +1594 + $__�rc�n_g + (cڡ * +__s +, cڡ * +__�je� +) + +1596 +__d0 +, +__d1 +, +__d2 +, +__d3 +; + +1597 cڡ * +__�s +; + +1598 +__asm__ + +__vީ�e__ + + +1612 : "=S" ( +__�s +), "=&a" ( +__d0 +), "=&c" ( +__d1 +), "=&D" ( +__d2 +), "=&d" ( +__d3 +) + +1613 : "0" ( +__s +), "1" (0), "2" (0xffffffff), "3" ( +__�je� +), "b" (__reject) + +1616 ( +__�s + - 1�- +__s +; + +1617 + } +} + +1623 + #_HAVE_STRING_ARCH_�r�n + 1 + + ) + +1624 + #�r�n +( +s +, +ac�� +) \ + +1625 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +ac�� +) && ((accept)[0]) == 1 \ + +1626 ? (( +ac�� +)[0] == '\0' \ + +1627 ? ((�( +s +), 0) \ + +1628 : (( +ac�� +)[1] == '\0' \ + +1629 ? + `__�r�n_c1 + (( +s +), ((( +ac�� +)[0] << 8 ) & 0xff00)) \ + +1630 : + `__�r�n_cg + (( +s +), ( +ac�� +), + `��� + (accept)))) \ + +1631 : + `__�r�n_g + (( +s +), ( +ac�� +)))) + + ) + +1633 #i�de� +_FORCE_INLINES + + +1634 +__STRING_INLINE + +size_t + +__�r�n_c1 + (cڡ * +__s +, +__ac�� +); + +1636 +__STRING_INLINE + +size_t + + +1637 + $__�r�n_c1 + (cڡ * +__s +, +__ac�� +) + +1639 +__d0 +; + +1640 * +__�s +; + +1642 +__asm__ + +__vީ�e__ + + +1648 : "�" ( +__�s +), "=&q" ( +__d0 +) + +1649 : "0" ( +__s +), "1" ( +__ac�� +), + +1650 "m" ( *(�ru� { +__x +[0xfffffff]; } *) +__s +) + +1652 ( +__�s + - 1�- +__s +; + +1653 + } +} + +1656 +__STRING_INLINE + +size_t + +__�r�n_cg + (cڡ * +__s +, cڡ +__ac�� +[], + +1657 +size_t + +__ac��_�n +); + +1659 +__STRING_INLINE + +size_t + + +1660 + $__�r�n_cg + (cڡ * +__s +, cڡ +__ac�� +[], +size_t + +__ac��_�n +) + +1662 +__d0 +, +__d1 +, +__d2 +; + +1663 cڡ * +__�s +; + +1664 +__asm__ + +__vީ�e__ + + +1675 : "=S" ( +__�s +), "=&a" ( +__d0 +), "=&c" ( +__d1 +), "=&D" ( +__d2 +) + +1676 : "0" ( +__s +), "g" ( +__ac�� +), "g" ( +__ac��_�n +), + +1679 "m" ( *(�ru� { +__x +[0xfffffff]; } *) +__s +), + +1680 "m" ( *(�ru� { +__ex�nsi�__ + +__x +[ +__ac��_�n +]; } *) +__ac�� +) + +1682 ( +__�s + - 1�- +__s +; + +1683 + } +} + +1685 +__STRING_INLINE + +size_t + +__�r�n_g + (cڡ * +__s +, cڡ * +__ac�� +); + +1686 #ifde� +__PIC__ + + +1688 +__STRING_INLINE + +size_t + + +1689 + $__�r�n_g + (cڡ * +__s +, cڡ * +__ac�� +) + +1691 +__d0 +, +__d1 +, +__d2 +; + +1692 cڡ * +__�s +; + +1693 +__asm__ + +__vީ�e__ + + +1709 : "=S" ( +__�s +), "=&a" ( +__d0 +), "=&c" ( +__d1 +), "=&D" ( +__d2 +) + +1710 : "d" ( +__ac�� +), "0" ( +__s +), "1" (0), "2" (0xffffffff), "3" (__accept) + +1712 ( +__�s + - 1�- +__s +; + +1713 + } +} + +1715 +__STRING_INLINE + +size_t + + +1716 + $__�r�n_g + (cڡ * +__s +, cڡ * +__ac�� +) + +1718 +__d0 +, +__d1 +, +__d2 +, +__d3 +; + +1719 cڡ * +__�s +; + +1720 +__asm__ + +__vީ�e__ + + +1734 : "=S" ( +__�s +), "=&a" ( +__d0 +), "=&c" ( +__d1 +), "=&D" ( +__d2 +), "=&d" ( +__d3 +) + +1735 : "0" ( +__s +), "1" (0), "2" (0xffffffff), "3" ( +__ac�� +), "b" (__accept) + +1737 ( +__�s + - 1�- +__s +; + +1738 + } +} + +1743 + #_HAVE_STRING_ARCH_��brk + 1 + + ) + +1744 + #��brk +( +s +, +ac�� +) \ + +1745 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +ac�� +) && ((accept)[0]) == 1 \ + +1746 ? (( +ac�� +)[0] == '\0' \ + +1747 ? ((�( +s +), (*) 0) \ + +1748 : (( +ac�� +)[1] == '\0' \ + +1749 ? + `�rchr + (( +s +), ( +ac�� +)[0]) \ + +1750 : + `__��brk_cg + (( +s +), ( +ac�� +), + `��� + (accept)))) \ + +1751 : + `__��brk_g + (( +s +), ( +ac�� +)))) + + ) + +1753 +__STRING_INLINE + * +__��brk_cg + (cڡ * +__s +, cڡ +__ac�� +[], + +1754 +size_t + +__ac��_�n +); + +1756 +__STRING_INLINE + * + +1757 + $__��brk_cg + (cڡ * +__s +, cڡ +__ac�� +[], +size_t + +__ac��_�n +) + +1759 +__d0 +, +__d1 +, +__d2 +; + +1760 * +__�s +; + +1761 +__asm__ + +__vީ�e__ + + +1776 : "=S" ( +__�s +), "=&a" ( +__d0 +), "=&c" ( +__d1 +), "=&D" ( +__d2 +) + +1777 : "0" ( +__s +), "d" ( +__ac�� +), "g" ( +__ac��_�n +) + +1779 +__�s +; + +1780 + } +} + +1782 +__STRING_INLINE + * +__��brk_g + (cڡ * +__s +, cڡ * +__ac�� +); + +1783 #ifde� +__PIC__ + + +1785 +__STRING_INLINE + * + +1786 + $__��brk_g + (cڡ * +__s +, cڡ * +__ac�� +) + +1788 +__d0 +, +__d1 +, +__d2 +; + +1789 * +__�s +; + +1790 +__asm__ + +__vީ�e__ + + +1811 : "=S" ( +__�s +), "=&a" ( +__d0 +), "=&c" ( +__d1 +), "=&D" ( +__d2 +) + +1812 : "d" ( +__ac�� +), "0" ( +__s +), "1" (0), "2" (0xffffffff) + +1814 +__�s +; + +1815 + } +} + +1817 +__STRING_INLINE + * + +1818 + $__��brk_g + (cڡ * +__s +, cڡ * +__ac�� +) + +1820 +__d0 +, +__d1 +, +__d2 +, +__d3 +; + +1821 * +__�s +; + +1822 +__asm__ + +__vީ�e__ + + +1841 : "=S" ( +__�s +), "=&a" ( +__d0 +), "=&c" ( +__d1 +), "=&d" ( +__d2 +), "=&D" ( +__d3 +) + +1842 : "0" ( +__s +), "1" (0), "2" (0xffffffff), "b" ( +__ac�� +) + +1844 +__�s +; + +1845 + } +} + +1850 + #_HAVE_STRING_ARCH_�r�r + 1 + + ) + +1851 + #�r�r +( +hay�ack +, +�ed� +) \ + +1852 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +�ed� +) && ((needle)[0]) == 1 \ + +1853 ? (( +�ed� +)[0] == '\0' \ + +1854 ? ( +hay�ack +) \ + +1855 : (( +�ed� +)[1] == '\0' \ + +1856 ? + `�rchr + (( +hay�ack +), ( +�ed� +)[0]) \ + +1857 : + `__�r�r_cg + (( +hay�ack +), ( +�ed� +), \ + +1858 + `��� + ( +�ed� +)))) \ + +1859 : + `__�r�r_g + (( +hay�ack +), ( +�ed� +)))) + + ) + +1863 +__STRING_INLINE + * +__�r�r_cg + (cڡ * +__hay�ack +, + +1864 cڡ +__�ed� +[], + +1865 +size_t + +__�ed�_�n +); + +1867 +__STRING_INLINE + * + +1868 + $__�r�r_cg + (cڡ * +__hay�ack +, cڡ +__�ed� +[], + +1869 +size_t + +__�ed�_�n +) + +1871 +__d0 +, +__d1 +, +__d2 +; + +1872 * +__�s +; + +1873 +__asm__ + +__vީ�e__ + + +1886 : "=&a" ( +__�s +), "=&S" ( +__d0 +), "=&D" ( +__d1 +), "=&c" ( +__d2 +) + +1887 : "g" ( +__�ed�_�n +), "1" ( +__hay�ack +), "d" ( +__�ed� +) + +1889 +__�s +; + +1890 + } +} + +1892 +__STRING_INLINE + * +__�r�r_g + (cڡ * +__hay�ack +, + +1893 cڡ * +__�ed� +); + +1894 #ifde� +__PIC__ + + +1896 +__STRING_INLINE + * + +1897 + $__�r�r_g + (cڡ * +__hay�ack +, cڡ * +__�ed� +) + +1899 +__d0 +, +__d1 +, +__d2 +; + +1900 * +__�s +; + +1901 +__asm__ + +__vީ�e__ + + +1920 : "=&a" ( +__�s +), "=&c" ( +__d0 +), "=&S" ( +__d1 +), "=&D" ( +__d2 +) + +1921 : "0" (0), "1" (0xffffffff), "2" ( +__hay�ack +), "3" ( +__�ed� +), + +1922 "d" ( +__�ed� +) + +1924 +__�s +; + +1925 + } +} + +1927 +__STRING_INLINE + * + +1928 + $__�r�r_g + (cڡ * +__hay�ack +, cڡ * +__�ed� +) + +1930 +__d0 +, +__d1 +, +__d2 +, +__d3 +; + +1931 * +__�s +; + +1932 +__asm__ + +__vީ�e__ + + +1949 : "=&a" ( +__�s +), "=&c" ( +__d0 +), "=&S" ( +__d1 +), "=&D" ( +__d2 +), "=&d" ( +__d3 +) + +1950 : "0" (0), "1" (0xffffffff), "2" ( +__hay�ack +), "3" ( +__�ed� +), + +1951 "b" ( +__�ed� +) + +1953 +__�s +; + +1954 + } +} + +1960 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + + +1961 #ifde� +__i686__ + + +1962 + #_HAVE_STRING_ARCH_ffs + 1 + + ) + +1963 + #ffs +( +w�d +�( + `__bu�t�_cڡ�t_p + (word) \ + +1964 ? + `__bu�t�_ffs + ( +w�d +) \ + +1965 : ({ +__�t +, +__tmp +; \ + +1966 +__asm__ + +__vީ�e__ + \ + +1969 : "=&r" ( +__�t +), "�" ( +__tmp +) \ + +1970 : "rm" ( +w�d +), "1" (-1)); \ + +1971 +__�t + + 1; })) + + ) + +1973 #i�de� +ff� + + +1974 + #ff� +( +w�d +� + `ffs +(w�d) + + ) + +1979 #i�de� +_FORCE_INLINES + + +1980 #unde� +__STRING_INLINE + + + @/usr/include/bits/string2.h + +20 #i�de� +_STRING_H + + +24 #i�de� +__NO_STRING_INLINES + + +41 #i�de� +__STRING_INLINE + + +42 #ifde� +__�lu�lus + + +43 + #__STRING_INLINE + +�l�e + + + ) + +45 + #__STRING_INLINE + +__ex��_�l�e + + + ) + +49 #i� +_STRING_ARCH_u�lig�d + + +51 + ~<�d�n.h +> + +52 + ~<b�s/ty�s.h +> + +54 #i� +__BYTE_ORDER + =� +__LITTLE_ENDIAN + + +55 + #__STRING2_SMALL_GET16 +( +�c +, +idx +) \ + +56 (((cڡ *�(cڡ *�( +�c +))[ +idx + + 1] << 8 \ + +57 | ((cڡ *�(cڡ *�( +�c +))[ +idx +]) + + ) + +58 + #__STRING2_SMALL_GET32 +( +�c +, +idx +) \ + +59 (((((cڡ *�(cڡ *�( +�c +))[ +idx + + 3] << 8 \ + +60 | ((cڡ *�(cڡ *�( +�c +))[ +idx + + 2]) << 8 \ + +61 | ((cڡ *�(cڡ *�( +�c +))[ +idx + + 1]) << 8 \ + +62 | ((cڡ *�(cڡ *�( +�c +))[ +idx +]) + + ) + +64 + #__STRING2_SMALL_GET16 +( +�c +, +idx +) \ + +65 (((cڡ *�(cڡ *�( +�c +))[ +idx +] << 8 \ + +66 | ((cڡ *�(cڡ *�( +�c +))[ +idx + + 1]) + + ) + +67 + #__STRING2_SMALL_GET32 +( +�c +, +idx +) \ + +68 (((((cڡ *�(cڡ *�( +�c +))[ +idx +] << 8 \ + +69 | ((cڡ *�(cڡ *�( +�c +))[ +idx + + 1]) << 8 \ + +70 | ((cڡ *�(cڡ *�( +�c +))[ +idx + + 2]) << 8 \ + +71 | ((cڡ *�(cڡ *�( +�c +))[ +idx + + 3]) + + ) + +76 + #__STRING2_COPY_TYPE +( +N +) \ + +77 �ru� { +__�r +[ +N +]; } \ + +78 + t__��ibu�__ + (( + t__�cked__ +)� + t__STRING2_COPY_ARR +## + tN + + + ) + +79 + t__STRING2_COPY_TYPE + (2); + +80 +__STRING2_COPY_TYPE + (3); + +81 +__STRING2_COPY_TYPE + (4); + +82 +__STRING2_COPY_TYPE + (5); + +83 +__STRING2_COPY_TYPE + (6); + +84 +__STRING2_COPY_TYPE + (7); + +85 +__STRING2_COPY_TYPE + (8); + +86 #unde� +__STRING2_COPY_TYPE + + +92 + #__�r�g2_1b�r_p +( +__x +) \ + +93 (( +size_t +)(cڡ *)(( +__x +�+ 1�- (size_t)(cڡ *)(__x�=�1) + + ) + +96 #i�! +def�ed + +_HAVE_STRING_ARCH_mem�t + + +97 #i�! +__GNUC_PREREQ + (3, 0) + +98 #i� +_STRING_ARCH_u�lig�d + + +99 + #mem�t +( +s +, +c +, +n +) \ + +100 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +n +) && (n) <= 16 \ + +101 ? (( +n +) == 1 \ + +102 ? + `__mem�t_1 + ( +s +, +c +) \ + +103 : + `__mem�t_gc + ( +s +, +c +, +n +)) \ + +104 : ( + `__bu�t�_cڡ�t_p + ( +c +) && (c) == '\0' \ + +105 ? ({ * +__s + = ( +s +); + `__bz�o + (__s, +n +); __s; }) \ + +106 : + `mem�t + ( +s +, +c +, +n +)))) + + ) + +108 + #__mem�t_1 +( +s +, +c +�({ * +__s + = (s); \ + +109 *(( +__u�t8_t + *� +__s +��(__u�t8_t� +c +; __s; }) + + ) + +111 + #__mem�t_gc +( +s +, +c +, +n +) \ + +112 ({ * +__s + = ( +s +); \ + +114 +__ui +; \ + +115 +__usi +; \ + +116 +__uc +; \ + +117 } * +__u + = +__s +; \ + +118 +__u�t8_t + +__c + = (__u�t8_t�( +c +); \ + +121 (�( +n +)) \ + +124 +__u +-> +__ui + = +__c + * 0x01010101; \ + +125 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +127 +__u +-> +__ui + = +__c + * 0x01010101; \ + +128 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +130 +__u +-> +__ui + = +__c + * 0x01010101; \ + +131 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +133 +__u +-> +__usi + = (� +__c + * 0x0101; \ + +134 +__u + = + `__ex�nsi�__ + ((*) __u + 2); \ + +135 +__u +-> +__uc + = (� +__c +; \ + +139 +__u +-> +__ui + = +__c + * 0x01010101; \ + +140 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +142 +__u +-> +__ui + = +__c + * 0x01010101; \ + +143 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +145 +__u +-> +__ui + = +__c + * 0x01010101; \ + +146 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +148 +__u +-> +__usi + = (� +__c + * 0x0101; \ + +152 +__u +-> +__ui + = +__c + * 0x01010101; \ + +153 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +155 +__u +-> +__ui + = +__c + * 0x01010101; \ + +156 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +158 +__u +-> +__ui + = +__c + * 0x01010101; \ + +159 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +161 +__u +-> +__uc + = (� +__c +; \ + +165 +__u +-> +__ui + = +__c + * 0x01010101; \ + +166 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +168 +__u +-> +__ui + = +__c + * 0x01010101; \ + +169 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +171 +__u +-> +__ui + = +__c + * 0x01010101; \ + +172 +__u + = + `__ex�nsi�__ + ((*) __u + 4); \ + +174 +__u +-> +__ui + = +__c + * 0x01010101; \ + +179 +__s +; }) + + ) + +181 + #mem�t +( +s +, +c +, +n +) \ + +182 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +c +) && (c) == '\0' \ + +183 ? ({ * +__s + = ( +s +); + `__bz�o + (__s, +n +); __s; }) \ + +184 : + `mem�t + ( +s +, +c +, +n +))) + + ) + +193 #i� +__GNUC_PREREQ + (2, 91) + +194 + #__bz�o +( +s +, +n +� + `__bu�t�_mem�t + (s, '\0',�) + + ) + +202 #ifde� +__USE_GNU + + +203 #i�! +def�ed + +_HAVE_STRING_ARCH_memp�y + || def�ed +_FORCE_INLINES + + +204 #i�de� +_HAVE_STRING_ARCH_memp�y + + +205 #i� +__GNUC_PREREQ + (3, 4) + +206 + #__memp�y +( +de� +, +�c +, +n +� + `__bu�t�_memp�y + (de�, src,�) + + ) + +207 #�i� +__GNUC_PREREQ + (3, 0) + +208 + #__memp�y +( +de� +, +�c +, +n +) \ + +209 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +�c +�&& __bu�t�_cڡ�t_�( +n +) \ + +210 && + `__�r�g2_1b�r_p + ( +�c +�&& +n + <= 8 \ + +211 ? + `__bu�t�_mem�y + ( +de� +, +�c +, +n +) + (n) \ + +212 : + `__memp�y + ( +de� +, +�c +, +n +))) + + ) + +214 + #__memp�y +( +de� +, +�c +, +n +) \ + +215 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +�c +�&& __bu�t�_cڡ�t_�( +n +) \ + +216 && + `__�r�g2_1b�r_p + ( +�c +�&& +n + <= 8 \ + +217 ? + `__memp�y_sm�l + ( +de� +, + `__memp�y_�gs + ( +�c +), +n +) \ + +218 : + `__memp�y + ( +de� +, +�c +, +n +))) + + ) + +222 + #memp�y +( +de� +, +�c +, +n +� + `__memp�y + (de�, src,�) + + ) + +225 #i�! +__GNUC_PREREQ + (3, 0�|| +def�ed + +_FORCE_INLINES + + +226 #i� +_STRING_ARCH_u�lig�d + + +227 #i�de� +_FORCE_INLINES + + +228 + #__memp�y_�gs +( +�c +) \ + +229 ((cڡ *�( +�c +))[0], ((const *) (src))[2], \ + +230 ((cڡ *�( +�c +))[4], ((const *) (src))[6], \ + +231 +__ex�nsi�__ + + `__STRING2_SMALL_GET16 + ( +�c +, 0), \ + +232 +__ex�nsi�__ + + `__STRING2_SMALL_GET16 + ( +�c +, 4), \ + +233 +__ex�nsi�__ + + `__STRING2_SMALL_GET32 + ( +�c +, 0), \ + +234 +__ex�nsi�__ + + `__STRING2_SMALL_GET32 + ( +�c +, 4) + + ) + +236 +__STRING_INLINE + * +__memp�y_sm�l + (*, , , , , + +237 +__u�t16_t +, __u�t16_t, +__u�t32_t +, + +238 +__u�t32_t +, +size_t +); + +239 +__STRING_INLINE + * + +240 + $__memp�y_sm�l + (* +__de�1 +, + +241 +__�c0_1 +, +__�c2_1 +, +__�c4_1 +, +__�c6_1 +, + +242 +__u�t16_t + +__�c0_2 +, __u�t16_� +__�c4_2 +, + +243 +__u�t32_t + +__�c0_4 +, __u�t32_� +__�c4_4 +, + +244 +size_t + +__��� +) + +247 +__u�t32_t + +__ui +; + +248 +__u�t16_t + +__usi +; + +249 +__uc +; + +250 +__c +; + +251 } * +__u + = +__de�1 +; + +252 (� +__��� +) + +255 +__u +-> +__c + = +__�c0_1 +; + +256 +__u + = + `__ex�nsi�__ + ((*) __u + 1); + +259 +__u +-> +__usi + = +__�c0_2 +; + +260 +__u + = + `__ex�nsi�__ + ((*) __u + 2); + +263 +__u +-> +__usi + = +__�c0_2 +; + +264 +__u + = + `__ex�nsi�__ + ((*) __u + 2); + +265 +__u +-> +__c + = +__�c2_1 +; + +266 +__u + = + `__ex�nsi�__ + ((*) __u + 1); + +269 +__u +-> +__ui + = +__�c0_4 +; + +270 +__u + = + `__ex�nsi�__ + ((*) __u + 4); + +273 +__u +-> +__ui + = +__�c0_4 +; + +274 +__u + = + `__ex�nsi�__ + ((*) __u + 4); + +275 +__u +-> +__c + = +__�c4_1 +; + +276 +__u + = + `__ex�nsi�__ + ((*) __u + 1); + +279 +__u +-> +__ui + = +__�c0_4 +; + +280 +__u + = + `__ex�nsi�__ + ((*) __u + 4); + +281 +__u +-> +__usi + = +__�c4_2 +; + +282 +__u + = + `__ex�nsi�__ + ((*) __u + 2); + +285 +__u +-> +__ui + = +__�c0_4 +; + +286 +__u + = + `__ex�nsi�__ + ((*) __u + 4); + +287 +__u +-> +__usi + = +__�c4_2 +; + +288 +__u + = + `__ex�nsi�__ + ((*) __u + 2); + +289 +__u +-> +__c + = +__�c6_1 +; + +290 +__u + = + `__ex�nsi�__ + ((*) __u + 1); + +293 +__u +-> +__ui + = +__�c0_4 +; + +294 +__u + = + `__ex�nsi�__ + ((*) __u + 4); + +295 +__u +-> +__ui + = +__�c4_4 +; + +296 +__u + = + `__ex�nsi�__ + ((*) __u + 4); + +299 (*� +__u +; + +300 + } +} + +302 #i�de� +_FORCE_INLINES + + +303 + #__memp�y_�gs +( +�c +) \ + +304 ((cڡ *�( +�c +))[0], \ + +305 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR2 +) \ + +306 { { ((cڡ *�( +�c +))[0], ((const *) (src))[1] } }), \ + +307 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR3 +) \ + +308 { { ((cڡ *�( +�c +))[0], ((const *) (src))[1], \ + +309 ((cڡ *�( +�c +))[2] } }), \ + +310 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR4 +) \ + +311 { { ((cڡ *�( +�c +))[0], ((const *) (src))[1], \ + +312 ((cڡ *�( +�c +))[2], ((const *) (src))[3] } }), \ + +313 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR5 +) \ + +314 { { ((cڡ *�( +�c +))[0], ((const *) (src))[1], \ + +315 ((cڡ *�( +�c +))[2], ((const *) (src))[3], \ + +316 ((cڡ *�( +�c +))[4] } }), \ + +317 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR6 +) \ + +318 { { ((cڡ *�( +�c +))[0], ((const *) (src))[1], \ + +319 ((cڡ *�( +�c +))[2], ((const *) (src))[3], \ + +320 ((cڡ *�( +�c +))[4], ((const *) (src))[5] } }), \ + +321 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR7 +) \ + +322 { { ((cڡ *�( +�c +))[0], ((const *) (src))[1], \ + +323 ((cڡ *�( +�c +))[2], ((const *) (src))[3], \ + +324 ((cڡ *�( +�c +))[4], ((const *) (src))[5], \ + +325 ((cڡ *�( +�c +))[6] } }), \ + +326 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR8 +) \ + +327 { { ((cڡ *�( +�c +))[0], ((const *) (src))[1], \ + +328 ((cڡ *�( +�c +))[2], ((const *) (src))[3], \ + +329 ((cڡ *�( +�c +))[4], ((const *) (src))[5], \ + +330 ((cڡ *�( +�c +))[6], ((cڡ *�(�c))[7] } }) + + ) + +332 +__STRING_INLINE + * +__memp�y_sm�l + (*, , +__STRING2_COPY_ARR2 +, + +333 +__STRING2_COPY_ARR3 +, + +334 +__STRING2_COPY_ARR4 +, + +335 +__STRING2_COPY_ARR5 +, + +336 +__STRING2_COPY_ARR6 +, + +337 +__STRING2_COPY_ARR7 +, + +338 +__STRING2_COPY_ARR8 +, +size_t +); + +339 +__STRING_INLINE + * + +340 + $__memp�y_sm�l + (* +__de� +, +__�c1 +, + +341 +__STRING2_COPY_ARR2 + +__�c2 +, +__STRING2_COPY_ARR3 + +__�c3 +, + +342 +__STRING2_COPY_ARR4 + +__�c4 +, +__STRING2_COPY_ARR5 + +__�c5 +, + +343 +__STRING2_COPY_ARR6 + +__�c6 +, +__STRING2_COPY_ARR7 + +__�c7 +, + +344 +__STRING2_COPY_ARR8 + +__�c8 +, +size_t + +__��� +) + +347 +__c +; + +348 +__STRING2_COPY_ARR2 + +__s�2 +; + +349 +__STRING2_COPY_ARR3 + +__s�3 +; + +350 +__STRING2_COPY_ARR4 + +__s�4 +; + +351 +__STRING2_COPY_ARR5 + +__s�5 +; + +352 +__STRING2_COPY_ARR6 + +__s�6 +; + +353 +__STRING2_COPY_ARR7 + +__s�7 +; + +354 +__STRING2_COPY_ARR8 + +__s�8 +; + +355 } * +__u + = +__de� +; + +356 (� +__��� +) + +359 +__u +-> +__c + = +__�c1 +; + +362 +__ex�nsi�__ + +__u +-> +__s�2 + = +__�c2 +; + +365 +__ex�nsi�__ + +__u +-> +__s�3 + = +__�c3 +; + +368 +__ex�nsi�__ + +__u +-> +__s�4 + = +__�c4 +; + +371 +__ex�nsi�__ + +__u +-> +__s�5 + = +__�c5 +; + +374 +__ex�nsi�__ + +__u +-> +__s�6 + = +__�c6 +; + +377 +__ex�nsi�__ + +__u +-> +__s�7 + = +__�c7 +; + +380 +__ex�nsi�__ + +__u +-> +__s�8 + = +__�c8 +; + +383 + `__ex�nsi�__ + ((*� +__u + + +__��� +); + +384 + } +} + +392 #i�de� +_HAVE_STRING_ARCH_�rchr + + +393 * +__�wmemchr + (cڡ * +__s +, +__c +); + +394 #i� +__GNUC_PREREQ + (3, 2) + +395 + #�rchr +( +s +, +c +) \ + +396 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +c +�&& !__bu�t�_cڡ�t_�( +s +) \ + +397 && ( +c +) == '\0' \ + +398 ? (*� + `__�wmemchr + ( +s +, +c +) \ + +399 : + `__bu�t�_�rchr + ( +s +, +c +))) + + ) + +401 + #�rchr +( +s +, +c +) \ + +402 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +c +) && (c) == '\0' \ + +403 ? (*� + `__�wmemchr + ( +s +, +c +) \ + +404 : + `�rchr + ( +s +, +c +))) + + ) + +410 #i�(! +def�ed + +_HAVE_STRING_ARCH_�r�y + && ! +__GNUC_PREREQ + (3, 0)) \ + +411 || +def�ed + + g_FORCE_INLINES + + +412 #i�! +def�ed + +_HAVE_STRING_ARCH_�r�y + && ! +__GNUC_PREREQ + (3, 0) + +413 + #�r�y +( +de� +, +�c +) \ + +414 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +�c +) \ + +415 ? ( + `__�r�g2_1b�r_p + ( +�c +�&& + `��� + (src) + 1 <= 8 \ + +416 ? + `__�r�y_sm�l + ( +de� +, + `__�r�y_�gs + ( +�c +), \ + +417 + `��� + ( +�c +) + 1) \ + +418 : (*� + `mem�y + ( +de� +, +�c +, + `��� + (src) + 1)) \ + +419 : + `�r�y + ( +de� +, +�c +))) + + ) + +422 #i� +_STRING_ARCH_u�lig�d + + +423 #i�de� +_FORCE_INLINES + + +424 + #__�r�y_�gs +( +�c +) \ + +425 +__ex�nsi�__ + + `__STRING2_SMALL_GET16 + ( +�c +, 0), \ + +426 +__ex�nsi�__ + + `__STRING2_SMALL_GET16 + ( +�c +, 4), \ + +427 +__ex�nsi�__ + + `__STRING2_SMALL_GET32 + ( +�c +, 0), \ + +428 +__ex�nsi�__ + + `__STRING2_SMALL_GET32 + ( +�c +, 4) + + ) + +430 +__STRING_INLINE + * +__�r�y_sm�l + (*, +__u�t16_t +, __uint16_t, + +431 +__u�t32_t +, __u�t32_t, +size_t +); + +432 +__STRING_INLINE + * + +433 + $__�r�y_sm�l + (* +__de� +, + +434 +__u�t16_t + +__�c0_2 +, __u�t16_� +__�c4_2 +, + +435 +__u�t32_t + +__�c0_4 +, __u�t32_� +__�c4_4 +, + +436 +size_t + +__��� +) + +439 +__u�t32_t + +__ui +; + +440 +__u�t16_t + +__usi +; + +441 +__uc +; + +442 } * +__u + = (*� +__de� +; + +443 (� +__��� +) + +446 +__u +-> +__uc + = '\0'; + +449 +__u +-> +__usi + = +__�c0_2 +; + +452 +__u +-> +__usi + = +__�c0_2 +; + +453 +__u + = + `__ex�nsi�__ + ((*) __u + 2); + +454 +__u +-> +__uc + = '\0'; + +457 +__u +-> +__ui + = +__�c0_4 +; + +460 +__u +-> +__ui + = +__�c0_4 +; + +461 +__u + = + `__ex�nsi�__ + ((*) __u + 4); + +462 +__u +-> +__uc + = '\0'; + +465 +__u +-> +__ui + = +__�c0_4 +; + +466 +__u + = + `__ex�nsi�__ + ((*) __u + 4); + +467 +__u +-> +__usi + = +__�c4_2 +; + +470 +__u +-> +__ui + = +__�c0_4 +; + +471 +__u + = + `__ex�nsi�__ + ((*) __u + 4); + +472 +__u +-> +__usi + = +__�c4_2 +; + +473 +__u + = + `__ex�nsi�__ + ((*) __u + 2); + +474 +__u +-> +__uc + = '\0'; + +477 +__u +-> +__ui + = +__�c0_4 +; + +478 +__u + = + `__ex�nsi�__ + ((*) __u + 4); + +479 +__u +-> +__ui + = +__�c4_4 +; + +482 +__de� +; + +483 + } +} + +485 #i�de� +_FORCE_INLINES + + +486 + #__�r�y_�gs +( +�c +) \ + +487 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR2 +) \ + +488 { { ((cڡ *�( +�c +))[0], '\0' } }), \ + +489 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR3 +) \ + +490 { { ((cڡ *�( +�c +))[0], ((const *) (src))[1], \ + +492 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR4 +) \ + +493 { { ((cڡ *�( +�c +))[0], ((const *) (src))[1], \ + +494 ((cڡ *�( +�c +))[2], '\0' } }), \ + +495 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR5 +) \ + +496 { { ((cڡ *�( +�c +))[0], ((const *) (src))[1], \ + +497 ((cڡ *�( +�c +))[2], ((const *) (src))[3], \ + +499 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR6 +) \ + +500 { { ((cڡ *�( +�c +))[0], ((const *) (src))[1], \ + +501 ((cڡ *�( +�c +))[2], ((const *) (src))[3], \ + +502 ((cڡ *�( +�c +))[4], '\0' } }), \ + +503 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR7 +) \ + +504 { { ((cڡ *�( +�c +))[0], ((const *) (src))[1], \ + +505 ((cڡ *�( +�c +))[2], ((const *) (src))[3], \ + +506 ((cڡ *�( +�c +))[4], ((const *) (src))[5], \ + +508 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR8 +) \ + +509 { { ((cڡ *�( +�c +))[0], ((const *) (src))[1], \ + +510 ((cڡ *�( +�c +))[2], ((const *) (src))[3], \ + +511 ((cڡ *�( +�c +))[4], ((const *) (src))[5], \ + +512 ((cڡ *�( +�c +))[6], '\0' } }) + + ) + +514 +__STRING_INLINE + * +__�r�y_sm�l + (*, +__STRING2_COPY_ARR2 +, + +515 +__STRING2_COPY_ARR3 +, + +516 +__STRING2_COPY_ARR4 +, + +517 +__STRING2_COPY_ARR5 +, + +518 +__STRING2_COPY_ARR6 +, + +519 +__STRING2_COPY_ARR7 +, + +520 +__STRING2_COPY_ARR8 +, +size_t +); + +521 +__STRING_INLINE + * + +522 + $__�r�y_sm�l + (* +__de� +, + +523 +__STRING2_COPY_ARR2 + +__�c2 +, +__STRING2_COPY_ARR3 + +__�c3 +, + +524 +__STRING2_COPY_ARR4 + +__�c4 +, +__STRING2_COPY_ARR5 + +__�c5 +, + +525 +__STRING2_COPY_ARR6 + +__�c6 +, +__STRING2_COPY_ARR7 + +__�c7 +, + +526 +__STRING2_COPY_ARR8 + +__�c8 +, +size_t + +__��� +) + +529 +__c +; + +530 +__STRING2_COPY_ARR2 + +__s�2 +; + +531 +__STRING2_COPY_ARR3 + +__s�3 +; + +532 +__STRING2_COPY_ARR4 + +__s�4 +; + +533 +__STRING2_COPY_ARR5 + +__s�5 +; + +534 +__STRING2_COPY_ARR6 + +__s�6 +; + +535 +__STRING2_COPY_ARR7 + +__s�7 +; + +536 +__STRING2_COPY_ARR8 + +__s�8 +; + +537 } * +__u + = (*� +__de� +; + +538 (� +__��� +) + +541 +__u +-> +__c + = '\0'; + +544 +__ex�nsi�__ + +__u +-> +__s�2 + = +__�c2 +; + +547 +__ex�nsi�__ + +__u +-> +__s�3 + = +__�c3 +; + +550 +__ex�nsi�__ + +__u +-> +__s�4 + = +__�c4 +; + +553 +__ex�nsi�__ + +__u +-> +__s�5 + = +__�c5 +; + +556 +__ex�nsi�__ + +__u +-> +__s�6 + = +__�c6 +; + +559 +__ex�nsi�__ + +__u +-> +__s�7 + = +__�c7 +; + +562 +__ex�nsi�__ + +__u +-> +__s�8 + = +__�c8 +; + +565 +__de� +; + +566 + } +} + +572 #ifde� +__USE_GNU + + +573 #i�! +def�ed + +_HAVE_STRING_ARCH_�p�y + || def�ed +_FORCE_INLINES + + +574 #i�de� +_HAVE_STRING_ARCH_�p�y + + +575 #i� +__GNUC_PREREQ + (3, 4) + +576 + #__�p�y +( +de� +, +�c +� + `__bu�t�_�p�y + (de�, src) + + ) + +577 #�i� +__GNUC_PREREQ + (3, 0) + +578 + #__�p�y +( +de� +, +�c +) \ + +579 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +�c +) \ + +580 ? ( + `__�r�g2_1b�r_p + ( +�c +�&& + `��� + (src) + 1 <= 8 \ + +581 ? + `__bu�t�_�r�y + ( +de� +, +�c +�+ + `��� + (src) \ + +582 : ((*�( +__memp�y +�( +de� +, +�c +, + `��� + (src) + 1) \ + +584 : + `__�p�y + ( +de� +, +�c +))) + + ) + +586 + #__�p�y +( +de� +, +�c +) \ + +587 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +�c +) \ + +588 ? ( + `__�r�g2_1b�r_p + ( +�c +�&& + `��� + (src) + 1 <= 8 \ + +589 ? + `__�p�y_sm�l + ( +de� +, + `__�p�y_�gs + ( +�c +), \ + +590 + `��� + ( +�c +) + 1) \ + +591 : ((*�( +__memp�y +�( +de� +, +�c +, + `��� + (src) + 1) \ + +593 : + `__�p�y + ( +de� +, +�c +))) + + ) + +597 + #�p�y +( +de� +, +�c +� + `__�p�y + (de�, src) + + ) + +600 #i�! +__GNUC_PREREQ + (3, 0�|| +def�ed + +_FORCE_INLINES + + +601 #i� +_STRING_ARCH_u�lig�d + + +602 #i�de� +_FORCE_INLINES + + +603 + #__�p�y_�gs +( +�c +) \ + +604 +__ex�nsi�__ + + `__STRING2_SMALL_GET16 + ( +�c +, 0), \ + +605 +__ex�nsi�__ + + `__STRING2_SMALL_GET16 + ( +�c +, 4), \ + +606 +__ex�nsi�__ + + `__STRING2_SMALL_GET32 + ( +�c +, 0), \ + +607 +__ex�nsi�__ + + `__STRING2_SMALL_GET32 + ( +�c +, 4) + + ) + +609 +__STRING_INLINE + * +__�p�y_sm�l + (*, +__u�t16_t +, __uint16_t, + +610 +__u�t32_t +, __u�t32_t, +size_t +); + +611 +__STRING_INLINE + * + +612 + $__�p�y_sm�l + (* +__de� +, + +613 +__u�t16_t + +__�c0_2 +, __u�t16_� +__�c4_2 +, + +614 +__u�t32_t + +__�c0_4 +, __u�t32_� +__�c4_4 +, + +615 +size_t + +__��� +) + +618 +__ui +; + +619 +__usi +; + +620 +__uc +; + +621 +__c +; + +622 } * +__u + = (*� +__de� +; + +623 (� +__��� +) + +626 +__u +-> +__uc + = '\0'; + +629 +__u +-> +__usi + = +__�c0_2 +; + +630 +__u + = + `__ex�nsi�__ + ((*) __u + 1); + +633 +__u +-> +__usi + = +__�c0_2 +; + +634 +__u + = + `__ex�nsi�__ + ((*) __u + 2); + +635 +__u +-> +__uc + = '\0'; + +638 +__u +-> +__ui + = +__�c0_4 +; + +639 +__u + = + `__ex�nsi�__ + ((*) __u + 3); + +642 +__u +-> +__ui + = +__�c0_4 +; + +643 +__u + = + `__ex�nsi�__ + ((*) __u + 4); + +644 +__u +-> +__uc + = '\0'; + +647 +__u +-> +__ui + = +__�c0_4 +; + +648 +__u + = + `__ex�nsi�__ + ((*) __u + 4); + +649 +__u +-> +__usi + = +__�c4_2 +; + +650 +__u + = + `__ex�nsi�__ + ((*) __u + 1); + +653 +__u +-> +__ui + = +__�c0_4 +; + +654 +__u + = + `__ex�nsi�__ + ((*) __u + 4); + +655 +__u +-> +__usi + = +__�c4_2 +; + +656 +__u + = + `__ex�nsi�__ + ((*) __u + 2); + +657 +__u +-> +__uc + = '\0'; + +660 +__u +-> +__ui + = +__�c0_4 +; + +661 +__u + = + `__ex�nsi�__ + ((*) __u + 4); + +662 +__u +-> +__ui + = +__�c4_4 +; + +663 +__u + = + `__ex�nsi�__ + ((*) __u + 3); + +666 & +__u +-> +__c +; + +667 + } +} + +669 #i�de� +_FORCE_INLINES + + +670 + #__�p�y_�gs +( +�c +) \ + +671 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR2 +) \ + +672 { { ((cڡ *�( +�c +))[0], '\0' } }), \ + +673 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR3 +) \ + +674 { { ((cڡ *�( +�c +))[0], ((const *) (src))[1], \ + +676 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR4 +) \ + +677 { { ((cڡ *�( +�c +))[0], ((const *) (src))[1], \ + +678 ((cڡ *�( +�c +))[2], '\0' } }), \ + +679 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR5 +) \ + +680 { { ((cڡ *�( +�c +))[0], ((const *) (src))[1], \ + +681 ((cڡ *�( +�c +))[2], ((const *) (src))[3], \ + +683 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR6 +) \ + +684 { { ((cڡ *�( +�c +))[0], ((const *) (src))[1], \ + +685 ((cڡ *�( +�c +))[2], ((const *) (src))[3], \ + +686 ((cڡ *�( +�c +))[4], '\0' } }), \ + +687 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR7 +) \ + +688 { { ((cڡ *�( +�c +))[0], ((const *) (src))[1], \ + +689 ((cڡ *�( +�c +))[2], ((const *) (src))[3], \ + +690 ((cڡ *�( +�c +))[4], ((const *) (src))[5], \ + +692 + `__ex�nsi�__ + (( +__STRING2_COPY_ARR8 +) \ + +693 { { ((cڡ *�( +�c +))[0], ((const *) (src))[1], \ + +694 ((cڡ *�( +�c +))[2], ((const *) (src))[3], \ + +695 ((cڡ *�( +�c +))[4], ((const *) (src))[5], \ + +696 ((cڡ *�( +�c +))[6], '\0' } }) + + ) + +698 +__STRING_INLINE + * +__�p�y_sm�l + (*, +__STRING2_COPY_ARR2 +, + +699 +__STRING2_COPY_ARR3 +, + +700 +__STRING2_COPY_ARR4 +, + +701 +__STRING2_COPY_ARR5 +, + +702 +__STRING2_COPY_ARR6 +, + +703 +__STRING2_COPY_ARR7 +, + +704 +__STRING2_COPY_ARR8 +, +size_t +); + +705 +__STRING_INLINE + * + +706 + $__�p�y_sm�l + (* +__de� +, + +707 +__STRING2_COPY_ARR2 + +__�c2 +, +__STRING2_COPY_ARR3 + +__�c3 +, + +708 +__STRING2_COPY_ARR4 + +__�c4 +, +__STRING2_COPY_ARR5 + +__�c5 +, + +709 +__STRING2_COPY_ARR6 + +__�c6 +, +__STRING2_COPY_ARR7 + +__�c7 +, + +710 +__STRING2_COPY_ARR8 + +__�c8 +, +size_t + +__��� +) + +713 +__c +; + +714 +__STRING2_COPY_ARR2 + +__s�2 +; + +715 +__STRING2_COPY_ARR3 + +__s�3 +; + +716 +__STRING2_COPY_ARR4 + +__s�4 +; + +717 +__STRING2_COPY_ARR5 + +__s�5 +; + +718 +__STRING2_COPY_ARR6 + +__s�6 +; + +719 +__STRING2_COPY_ARR7 + +__s�7 +; + +720 +__STRING2_COPY_ARR8 + +__s�8 +; + +721 } * +__u + = (*� +__de� +; + +722 (� +__��� +) + +725 +__u +-> +__c + = '\0'; + +728 +__ex�nsi�__ + +__u +-> +__s�2 + = +__�c2 +; + +731 +__ex�nsi�__ + +__u +-> +__s�3 + = +__�c3 +; + +734 +__ex�nsi�__ + +__u +-> +__s�4 + = +__�c4 +; + +737 +__ex�nsi�__ + +__u +-> +__s�5 + = +__�c5 +; + +740 +__ex�nsi�__ + +__u +-> +__s�6 + = +__�c6 +; + +743 +__ex�nsi�__ + +__u +-> +__s�7 + = +__�c7 +; + +746 +__ex�nsi�__ + +__u +-> +__s�8 + = +__�c8 +; + +749 +__de� + + +__��� + - 1; + +750 + } +} + +758 #i�de� +_HAVE_STRING_ARCH_���y + + +759 #i� +__GNUC_PREREQ + (3, 2) + +760 + #���y +( +de� +, +�c +, +n +� + `__bu�t�_���y + (de�, src,�) + + ) + +762 + #���y +( +de� +, +�c +, +n +) \ + +763 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +�c +�&& __bu�t�_cڡ�t_�( +n +) \ + +764 ? ( + `��� + ( +�c +�+ 1 >�(( +size_t +�( +n +)) \ + +765 ? (*� + `mem�y + ( +de� +, +�c +, +n +) \ + +766 : + `���y + ( +de� +, +�c +, +n +)) \ + +767 : + `���y + ( +de� +, +�c +, +n +))) + + ) + +773 #i�de� +_HAVE_STRING_ARCH_���t + + +774 #ifde� +_USE_STRING_ARCH_�rchr + + +775 + #���t +( +de� +, +�c +, +n +) \ + +776 ( + `__ex�nsi�__ + ({ * +__de� + = ( +de� +); \ + +777 + `__bu�t�_cڡ�t_p + ( +�c +�&& __bu�t�_cڡ�t_�( +n +) \ + +778 ? ( + `��� + ( +�c +�< (( +size_t +�( +n +)) \ + +779 ? + `�r�t + ( +__de� +, +�c +) \ + +780 : (*((*� + `__memp�y + ( + `�rchr + ( +__de� +, '\0'), \ + +781 +�c +, +n +)��'\0', +__de� +)) \ + +782 : + `���t + ( +de� +, +�c +, +n +); })) + + ) + +783 #�i� +__GNUC_PREREQ + (3, 2) + +784 + #���t +( +de� +, +�c +, +n +� + `__bu�t�_���t + (de�, src,�) + + ) + +786 + #���t +( +de� +, +�c +, +n +) \ + +787 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +�c +�&& __bu�t�_cڡ�t_�( +n +) \ + +788 ? ( + `��� + ( +�c +�< (( +size_t +�( +n +)) \ + +789 ? + `�r�t + ( +de� +, +�c +) \ + +790 : + `���t + ( +de� +, +�c +, +n +)) \ + +791 : + `���t + ( +de� +, +�c +, +n +))) + + ) + +797 #i�de� +_HAVE_STRING_ARCH_�rcmp + + +798 #i� +__GNUC_PREREQ + (3, 2) + +799 + #�rcmp +( +s1 +, +s2 +) \ + +800 +__ex�nsi�__ + \ + +801 ({ +size_t + +__s1_�n +, +__s2_�n +; \ + +802 ( + `__bu�t�_cڡ�t_p + ( +s1 +�&& __bu�t�_cڡ�t_�( +s2 +) \ + +803 && ( +__s1_�n + = + `__bu�t�_��� + ( +s1 +), +__s2_�n + = __bu�t�_��� ( +s2 +), \ + +804 (! + `__�r�g2_1b�r_p + ( +s1 +�|| +__s1_�n + >= 4) \ + +805 && (! + `__�r�g2_1b�r_p + ( +s2 +�|| +__s2_�n + >= 4)) \ + +806 ? + `__bu�t�_�rcmp + ( +s1 +, +s2 +) \ + +807 : ( + `__bu�t�_cڡ�t_p + ( +s1 +�&& + `__�r�g2_1b�r_p + (s1) \ + +808 && ( +__s1_�n + = + `__bu�t�_��� + ( +s1 +), __s1_len < 4) \ + +809 ? ( + `__bu�t�_cڡ�t_p + ( +s2 +�&& + `__�r�g2_1b�r_p + (s2) \ + +810 ? + `__bu�t�_�rcmp + ( +s1 +, +s2 +) \ + +811 : + `__�rcmp_cg + ( +s1 +, +s2 +, +__s1_�n +)) \ + +812 : ( + `__bu�t�_cڡ�t_p + ( +s2 +�&& + `__�r�g2_1b�r_p + (s2) \ + +813 && ( +__s2_�n + = + `__bu�t�_��� + ( +s2 +), __s2_len < 4) \ + +814 ? ( + `__bu�t�_cڡ�t_p + ( +s1 +�&& + `__�r�g2_1b�r_p + (s1) \ + +815 ? + `__bu�t�_�rcmp + ( +s1 +, +s2 +) \ + +816 : + `__�rcmp_gc + ( +s1 +, +s2 +, +__s2_�n +)) \ + +817 : + `__bu�t�_�rcmp + ( +s1 +, +s2 +)))); }) + + ) + +819 + #�rcmp +( +s1 +, +s2 +) \ + +820 +__ex�nsi�__ + \ + +821 ({ +size_t + +__s1_�n +, +__s2_�n +; \ + +822 ( + `__bu�t�_cڡ�t_p + ( +s1 +�&& __bu�t�_cڡ�t_�( +s2 +) \ + +823 && ( +__s1_�n + = + `��� + ( +s1 +), +__s2_�n + = s���( +s2 +), \ + +824 (! + `__�r�g2_1b�r_p + ( +s1 +�|| +__s1_�n + >= 4) \ + +825 && (! + `__�r�g2_1b�r_p + ( +s2 +�|| +__s2_�n + >= 4)) \ + +826 ? + `memcmp + ((cڡ *�( +s1 +), (cڡ *�( +s2 +), \ + +827 ( +__s1_�n + < +__s2_�n + ? __s1_len : __s2_len) + 1) \ + +828 : ( + `__bu�t�_cڡ�t_p + ( +s1 +�&& + `__�r�g2_1b�r_p + (s1) \ + +829 && ( +__s1_�n + = + `��� + ( +s1 +), __s1_len < 4) \ + +830 ? ( + `__bu�t�_cڡ�t_p + ( +s2 +�&& + `__�r�g2_1b�r_p + (s2) \ + +831 ? + `__�rcmp_cc + ( +s1 +, +s2 +, +__s1_�n +) \ + +832 : + `__�rcmp_cg + ( +s1 +, +s2 +, +__s1_�n +)) \ + +833 : ( + `__bu�t�_cڡ�t_p + ( +s2 +�&& + `__�r�g2_1b�r_p + (s2) \ + +834 && ( +__s2_�n + = + `��� + ( +s2 +), __s2_len < 4) \ + +835 ? ( + `__bu�t�_cڡ�t_p + ( +s1 +�&& + `__�r�g2_1b�r_p + (s1) \ + +836 ? + `__�rcmp_cc + ( +s1 +, +s2 +, +__s2_�n +) \ + +837 : + `__�rcmp_gc + ( +s1 +, +s2 +, +__s2_�n +)) \ + +838 : + `�rcmp + ( +s1 +, +s2 +)))); }) + + ) + +841 + #__�rcmp_cc +( +s1 +, +s2 +, +l +) \ + +842 ( + `__ex�nsi�__ + ({ +__�su� + = \ + +843 (((cڡ *�(cڡ *�( +s1 +))[0] \ + +844 - ((cڡ *�(cڡ *)( +s2 +))[0]); \ + +845 i�( +l + > 0 && +__�su� + == 0) \ + +847 +__�su� + = (((const *) \ + +848 (cڡ *�( +s1 +))[1] \ + +850 (cڡ *�( +s2 +))[1]); \ + +851 i�( +l + > 1 && +__�su� + == 0) \ + +853 +__�su� + = \ + +855 (cڡ *�( +s1 +))[2] \ + +857 (cڡ *�( +s2 +))[2]); \ + +858 i�( +l + > 2 && +__�su� + == 0) \ + +859 +__�su� + = \ + +861 (cڡ *�( +s1 +))[3] \ + +863 (cڡ *�( +s2 +))[3]); \ + +866 +__�su� +; })) + + ) + +868 + #__�rcmp_cg +( +s1 +, +s2 +, +l1 +) \ + +869 ( + `__ex�nsi�__ + ({ cڡ * +__s2 + = \ + +870 (cڡ *�(cڡ *�( +s2 +); \ + +871 +__�su� + = \ + +872 (((cڡ *�(cڡ *�( +s1 +))[0] \ + +873 - +__s2 +[0]); \ + +874 i�( +l1 + > 0 && +__�su� + == 0) \ + +876 +__�su� + = (((const *) \ + +877 (cڡ *�( +s1 +))[1] - +__s2 +[1]); \ + +878 i�( +l1 + > 1 && +__�su� + == 0) \ + +880 +__�su� + = (((const *) \ + +881 (cڡ *�( +s1 +))[2] - +__s2 +[2]); \ + +882 i�( +l1 + > 2 && +__�su� + == 0) \ + +883 +__�su� + = (((const *) \ + +884 (cڡ *�( +s1 +))[3] \ + +885 - +__s2 +[3]); \ + +888 +__�su� +; })) + + ) + +890 + #__�rcmp_gc +( +s1 +, +s2 +, +l2 +�(- + `__�rcmp_cg + (s2, s1,�2)) + + ) + +895 #i�de� +_HAVE_STRING_ARCH_��cmp + + +896 + #��cmp +( +s1 +, +s2 +, +n +) \ + +897 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +n +) \ + +898 && (( + `__bu�t�_cڡ�t_p + ( +s1 +) \ + +899 && + `��� + ( +s1 +�< (( +size_t +�( +n +))) \ + +900 || ( + `__bu�t�_cڡ�t_p + ( +s2 +) \ + +901 && + `��� + ( +s2 +�< (( +size_t +�( +n +)))) \ + +902 ? + `�rcmp + ( +s1 +, +s2 +�: + `��cmp + (s1, s2, +n +))) + + ) + +908 #i�! +def�ed + +_HAVE_STRING_ARCH_�rc�n + || def�ed +_FORCE_INLINES + + +909 #i�de� +_HAVE_STRING_ARCH_�rc�n + + +910 #i� +__GNUC_PREREQ + (3, 2) + +911 + #�rc�n +( +s +, +�je� +) \ + +912 +__ex�nsi�__ + \ + +913 ({ +__r0 +, +__r1 +, +__r2 +; \ + +914 ( + `__bu�t�_cڡ�t_p + ( +�je� +�&& + `__�r�g2_1b�r_p + (reject) \ + +915 ? (( + `__bu�t�_cڡ�t_p + ( +s +�&& + `__�r�g2_1b�r_p + (s)) \ + +916 ? + `__bu�t�_�rc�n + ( +s +, +�je� +) \ + +917 : (( +__r0 + = ((cڡ *�( +�je� +))[0], __r0 == '\0') \ + +918 ? + `��� + ( +s +) \ + +919 : (( +__r1 + = ((cڡ *�( +�je� +))[1], __r1 == '\0') \ + +920 ? + `__�rc�n_c1 + ( +s +, +__r0 +) \ + +921 : (( +__r2 + = ((cڡ *�( +�je� +))[2], __r2 == '\0') \ + +922 ? + `__�rc�n_c2 + ( +s +, +__r0 +, +__r1 +) \ + +923 : (((cڡ *�( +�je� +))[3] == '\0' \ + +924 ? + `__�rc�n_c3 + ( +s +, +__r0 +, +__r1 +, +__r2 +) \ + +925 : + `__bu�t�_�rc�n + ( +s +, +�je� +)))))) \ + +926 : + `__bu�t�_�rc�n + ( +s +, +�je� +)); }) + + ) + +928 + #�rc�n +( +s +, +�je� +) \ + +929 +__ex�nsi�__ + \ + +930 ({ +__r0 +, +__r1 +, +__r2 +; \ + +931 ( + `__bu�t�_cڡ�t_p + ( +�je� +�&& + `__�r�g2_1b�r_p + (reject) \ + +932 ? (( +__r0 + = ((cڡ *�( +�je� +))[0], __r0 == '\0') \ + +933 ? + `��� + ( +s +) \ + +934 : (( +__r1 + = ((cڡ *�( +�je� +))[1], __r1 == '\0') \ + +935 ? + `__�rc�n_c1 + ( +s +, +__r0 +) \ + +936 : (( +__r2 + = ((cڡ *�( +�je� +))[2], __r2 == '\0') \ + +937 ? + `__�rc�n_c2 + ( +s +, +__r0 +, +__r1 +) \ + +938 : (((cڡ *�( +�je� +))[3] == '\0' \ + +939 ? + `__�rc�n_c3 + ( +s +, +__r0 +, +__r1 +, +__r2 +) \ + +940 : + `�rc�n + ( +s +, +�je� +))))) \ + +941 : + `�rc�n + ( +s +, +�je� +)); }) + + ) + +945 +__STRING_INLINE + +size_t + +__�rc�n_c1 + (cڡ * +__s +, +__�je� +); + +946 +__STRING_INLINE + +size_t + + +947 + $__�rc�n_c1 + (cڡ * +__s +, +__�je� +) + +949 +size_t + +__�su� + = 0; + +950 +__s +[ +__�su� +] !�'\0' && __s[__�su�] !� +__�je� +) + +951 ++ +__�su� +; + +952 +__�su� +; + +953 + } +} + +955 +__STRING_INLINE + +size_t + +__�rc�n_c2 + (cڡ * +__s +, +__�je�1 +, + +956 +__�je�2 +); + +957 +__STRING_INLINE + +size_t + + +958 + $__�rc�n_c2 + (cڡ * +__s +, +__�je�1 +, +__�je�2 +) + +960 +size_t + +__�su� + = 0; + +961 +__s +[ +__�su� +] !�'\0' && __s[__�su�] !� +__�je�1 + + +962 && +__s +[ +__�su� +] !� +__�je�2 +) + +963 ++ +__�su� +; + +964 +__�su� +; + +965 + } +} + +967 +__STRING_INLINE + +size_t + +__�rc�n_c3 + (cڡ * +__s +, +__�je�1 +, + +968 +__�je�2 +, +__�je�3 +); + +969 +__STRING_INLINE + +size_t + + +970 + $__�rc�n_c3 + (cڡ * +__s +, +__�je�1 +, +__�je�2 +, + +971 +__�je�3 +) + +973 +size_t + +__�su� + = 0; + +974 +__s +[ +__�su� +] !�'\0' && __s[__�su�] !� +__�je�1 + + +975 && +__s +[ +__�su� +] !� +__�je�2 + && __s[__�su�] !� +__�je�3 +) + +976 ++ +__�su� +; + +977 +__�su� +; + +978 + } +} + +984 #i�! +def�ed + +_HAVE_STRING_ARCH_�r�n + || def�ed +_FORCE_INLINES + + +985 #i�de� +_HAVE_STRING_ARCH_�r�n + + +986 #i� +__GNUC_PREREQ + (3, 2) + +987 + #�r�n +( +s +, +ac�� +) \ + +988 +__ex�nsi�__ + \ + +989 ({ +__a0 +, +__a1 +, +__a2 +; \ + +990 ( + `__bu�t�_cڡ�t_p + ( +ac�� +�&& + `__�r�g2_1b�r_p + (accept) \ + +991 ? (( + `__bu�t�_cڡ�t_p + ( +s +�&& + `__�r�g2_1b�r_p + (s)) \ + +992 ? + `__bu�t�_�r�n + ( +s +, +ac�� +) \ + +993 : (( +__a0 + = ((cڡ *�( +ac�� +))[0], __a0 == '\0') \ + +994 ? ((�( +s +), ( +size_t +) 0) \ + +995 : (( +__a1 + = ((cڡ *�( +ac�� +))[1], __a1 == '\0') \ + +996 ? + `__�r�n_c1 + ( +s +, +__a0 +) \ + +997 : (( +__a2 + = ((cڡ *�( +ac�� +))[2], __a2 == '\0') \ + +998 ? + `__�r�n_c2 + ( +s +, +__a0 +, +__a1 +) \ + +999 : (((cڡ *�( +ac�� +))[3] == '\0' \ + +1000 ? + `__�r�n_c3 + ( +s +, +__a0 +, +__a1 +, +__a2 +) \ + +1001 : + `__bu�t�_�r�n + ( +s +, +ac�� +)))))) \ + +1002 : + `__bu�t�_�r�n + ( +s +, +ac�� +)); }) + + ) + +1004 + #�r�n +( +s +, +ac�� +) \ + +1005 +__ex�nsi�__ + \ + +1006 ({ +__a0 +, +__a1 +, +__a2 +; \ + +1007 ( + `__bu�t�_cڡ�t_p + ( +ac�� +�&& + `__�r�g2_1b�r_p + (accept) \ + +1008 ? (( +__a0 + = ((cڡ *�( +ac�� +))[0], __a0 == '\0') \ + +1009 ? ((�( +s +), ( +size_t +) 0) \ + +1010 : (( +__a1 + = ((cڡ *�( +ac�� +))[1], __a1 == '\0') \ + +1011 ? + `__�r�n_c1 + ( +s +, +__a0 +) \ + +1012 : (( +__a2 + = ((cڡ *�( +ac�� +))[2], __a2 == '\0') \ + +1013 ? + `__�r�n_c2 + ( +s +, +__a0 +, +__a1 +) \ + +1014 : (((cڡ *�( +ac�� +))[3] == '\0' \ + +1015 ? + `__�r�n_c3 + ( +s +, +__a0 +, +__a1 +, +__a2 +) \ + +1016 : + `�r�n + ( +s +, +ac�� +))))) \ + +1017 : + `�r�n + ( +s +, +ac�� +)); }) + + ) + +1021 +__STRING_INLINE + +size_t + +__�r�n_c1 + (cڡ * +__s +, +__ac�� +); + +1022 +__STRING_INLINE + +size_t + + +1023 + $__�r�n_c1 + (cڡ * +__s +, +__ac�� +) + +1025 +size_t + +__�su� + = 0; + +1027 +__s +[ +__�su� +] =� +__ac�� +) + +1028 ++ +__�su� +; + +1029 +__�su� +; + +1030 + } +} + +1032 +__STRING_INLINE + +size_t + +__�r�n_c2 + (cڡ * +__s +, +__ac��1 +, + +1033 +__ac��2 +); + +1034 +__STRING_INLINE + +size_t + + +1035 + $__�r�n_c2 + (cڡ * +__s +, +__ac��1 +, +__ac��2 +) + +1037 +size_t + +__�su� + = 0; + +1039 +__s +[ +__�su� +] =� +__ac��1 + || __s[__�su�] =� +__ac��2 +) + +1040 ++ +__�su� +; + +1041 +__�su� +; + +1042 + } +} + +1044 +__STRING_INLINE + +size_t + +__�r�n_c3 + (cڡ * +__s +, +__ac��1 +, + +1045 +__ac��2 +, +__ac��3 +); + +1046 +__STRING_INLINE + +size_t + + +1047 + $__�r�n_c3 + (cڡ * +__s +, +__ac��1 +, +__ac��2 +, +__ac��3 +) + +1049 +size_t + +__�su� + = 0; + +1051 +__s +[ +__�su� +] =� +__ac��1 + || __s[__�su�] =� +__ac��2 + + +1052 || +__s +[ +__�su� +] =� +__ac��3 +) + +1053 ++ +__�su� +; + +1054 +__�su� +; + +1055 + } +} + +1060 #i�! +def�ed + +_HAVE_STRING_ARCH_��brk + || def�ed +_FORCE_INLINES + + +1061 #i�de� +_HAVE_STRING_ARCH_��brk + + +1062 #i� +__GNUC_PREREQ + (3, 2) + +1063 + #��brk +( +s +, +ac�� +) \ + +1064 +__ex�nsi�__ + \ + +1065 ({ +__a0 +, +__a1 +, +__a2 +; \ + +1066 ( + `__bu�t�_cڡ�t_p + ( +ac�� +�&& + `__�r�g2_1b�r_p + (accept) \ + +1067 ? (( + `__bu�t�_cڡ�t_p + ( +s +�&& + `__�r�g2_1b�r_p + (s)) \ + +1068 ? + `__bu�t�_��brk + ( +s +, +ac�� +) \ + +1069 : (( +__a0 + = ((cڡ *�( +ac�� +))[0], __a0 == '\0') \ + +1070 ? ((�( +s +), (*� +NULL +) \ + +1071 : (( +__a1 + = ((cڡ *�( +ac�� +))[1], __a1 == '\0') \ + +1072 ? + `__bu�t�_�rchr + ( +s +, +__a0 +) \ + +1073 : (( +__a2 + = ((cڡ *�( +ac�� +))[2], __a2 == '\0') \ + +1074 ? + `__��brk_c2 + ( +s +, +__a0 +, +__a1 +) \ + +1075 : (((cڡ *�( +ac�� +))[3] == '\0' \ + +1076 ? + `__��brk_c3 + ( +s +, +__a0 +, +__a1 +, +__a2 +) \ + +1077 : + `__bu�t�_��brk + ( +s +, +ac�� +)))))) \ + +1078 : + `__bu�t�_��brk + ( +s +, +ac�� +)); }) + + ) + +1080 + #��brk +( +s +, +ac�� +) \ + +1081 +__ex�nsi�__ + \ + +1082 ({ +__a0 +, +__a1 +, +__a2 +; \ + +1083 ( + `__bu�t�_cڡ�t_p + ( +ac�� +�&& + `__�r�g2_1b�r_p + (accept) \ + +1084 ? (( +__a0 + = ((cڡ *�( +ac�� +))[0], __a0 == '\0') \ + +1085 ? ((�( +s +), (*� +NULL +) \ + +1086 : (( +__a1 + = ((cڡ *�( +ac�� +))[1], __a1 == '\0') \ + +1087 ? + `�rchr + ( +s +, +__a0 +) \ + +1088 : (( +__a2 + = ((cڡ *�( +ac�� +))[2], __a2 == '\0') \ + +1089 ? + `__��brk_c2 + ( +s +, +__a0 +, +__a1 +) \ + +1090 : (((cڡ *�( +ac�� +))[3] == '\0' \ + +1091 ? + `__��brk_c3 + ( +s +, +__a0 +, +__a1 +, +__a2 +) \ + +1092 : + `��brk + ( +s +, +ac�� +))))) \ + +1093 : + `��brk + ( +s +, +ac�� +)); }) + + ) + +1097 +__STRING_INLINE + * +__��brk_c2 + (cڡ * +__s +, +__ac��1 +, + +1098 +__ac��2 +); + +1099 +__STRING_INLINE + * + +1100 + $__��brk_c2 + (cڡ * +__s +, +__ac��1 +, +__ac��2 +) + +1103 * +__s + !�'\0' && *__�!� +__ac��1 + && *__�!� +__ac��2 +) + +1104 ++ +__s +; + +1105 * +__s + =�'\0' ? +NULL + : (*�( +size_t +) __s; + +1106 + } +} + +1108 +__STRING_INLINE + * +__��brk_c3 + (cڡ * +__s +, +__ac��1 +, + +1109 +__ac��2 +, +__ac��3 +); + +1110 +__STRING_INLINE + * + +1111 + $__��brk_c3 + (cڡ * +__s +, +__ac��1 +, +__ac��2 +, +__ac��3 +) + +1114 * +__s + !�'\0' && *__�!� +__ac��1 + && *__�!� +__ac��2 + + +1115 && * +__s + !� +__ac��3 +) + +1116 ++ +__s +; + +1117 * +__s + =�'\0' ? +NULL + : (*�( +size_t +) __s; + +1118 + } +} + +1124 #i�! +def�ed + +_HAVE_STRING_ARCH_�r�r + && ! +__GNUC_PREREQ + (2, 97) + +1125 + #�r�r +( +hay�ack +, +�ed� +) \ + +1126 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +�ed� +�&& + `__�r�g2_1b�r_p + (needle) \ + +1127 ? (((cڡ *�( +�ed� +))[0] == '\0' \ + +1128 ? (*�( +size_t +�( +hay�ack +) \ + +1129 : (((cڡ *�( +�ed� +))[1] == '\0' \ + +1130 ? + `�rchr + ( +hay�ack +, \ + +1131 ((cڡ *�( +�ed� +))[0]) \ + +1132 : + `�r�r + ( +hay�ack +, +�ed� +))) \ + +1133 : + `�r�r + ( +hay�ack +, +�ed� +))) + + ) + +1137 #i�! +def�ed + +_HAVE_STRING_ARCH_��ok_r + || def�ed +_FORCE_INLINES + + +1138 #i�de� +_HAVE_STRING_ARCH_��ok_r + + +1139 + #__��ok_r +( +s +, +�p +, +�x� +) \ + +1140 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +�p +�&& + `__�r�g2_1b�r_p + (sep) \ + +1141 && ((cڡ *�( +�p +))[0] != '\0' \ + +1142 && ((cڡ *�( +�p +))[1] == '\0' \ + +1143 ? + `__��ok_r_1c + ( +s +, ((cڡ *�( +�p +))[0], +�x� +) \ + +1144 : + `__��ok_r + ( +s +, +�p +, +�x� +))) + + ) + +1147 +__STRING_INLINE + * +__��ok_r_1c + (* +__s +, +__�p +, ** +__�x� +); + +1148 +__STRING_INLINE + * + +1149 + $__��ok_r_1c + (* +__s +, +__�p +, ** +__�x� +) + +1151 * +__�su� +; + +1152 i�( +__s + =� +NULL +) + +1153 +__s + = * +__�x� +; + +1154 * +__s + =� +__�p +) + +1155 ++ +__s +; + +1156 +__�su� + = +NULL +; + +1157 i�(* +__s + != '\0') + +1159 +__�su� + = +__s +++; + +1160 * +__s + != '\0') + +1161 i�(* +__s +++ =� +__�p +) + +1163 +__s +[-1] = '\0'; + +1167 * +__�x� + = +__s +; + +1168 +__�su� +; + +1169 + } +} + +1170 #i� +def�ed + +__USE_POSIX + || def�ed +__USE_MISC + + +1171 + #��ok_r +( +s +, +�p +, +�x� +� + `__��ok_r + (s, s�,�ex�) + + ) + +1176 #i�! +def�ed + +_HAVE_STRING_ARCH_�r�p + || def�ed +_FORCE_INLINES + + +1177 #i�de� +_HAVE_STRING_ARCH_�r�p + + +1179 * +__�r�p_g + (** +__�r�gp +, cڡ * +__d�im +); + +1180 + #__�r�p +( +s +, +�je� +) \ + +1181 +__ex�nsi�__ + \ + +1182 ({ +__r0 +, +__r1 +, +__r2 +; \ + +1183 ( + `__bu�t�_cڡ�t_p + ( +�je� +�&& + `__�r�g2_1b�r_p + (reject) \ + +1184 && ( +__r0 + = ((cڡ *�( +�je� +))[0], \ + +1185 ((cڡ *�( +�je� +))[0] != '\0') \ + +1186 ? (( +__r1 + = ((cڡ *�( +�je� +))[1], \ + +1187 ((cڡ *�( +�je� +))[1] == '\0') \ + +1188 ? + `__�r�p_1c + ( +s +, +__r0 +) \ + +1189 : (( +__r2 + = ((cڡ *�( +�je� +))[2], __r2 == '\0') \ + +1190 ? + `__�r�p_2c + ( +s +, +__r0 +, +__r1 +) \ + +1191 : (((cڡ *�( +�je� +))[3] == '\0' \ + +1192 ? + `__�r�p_3c + ( +s +, +__r0 +, +__r1 +, +__r2 +) \ + +1193 : + `__�r�p_g + ( +s +, +�je� +)))) \ + +1194 : + `__�r�p_g + ( +s +, +�je� +)); }) + + ) + +1197 +__STRING_INLINE + * +__�r�p_1c + (** +__s +, +__�je� +); + +1198 +__STRING_INLINE + * + +1199 + $__�r�p_1c + (** +__s +, +__�je� +) + +1201 * +__�tv� + = * +__s +; + +1202 i�( +__�tv� + !� +NULL + && (* +__s + = + `�rchr + (__�tv�, +__�je� +)) != NULL) + +1203 *(* +__s +)++ = '\0'; + +1204 +__�tv� +; + +1205 + } +} + +1207 +__STRING_INLINE + * +__�r�p_2c + (** +__s +, +__�je�1 +, +__�je�2 +); + +1208 +__STRING_INLINE + * + +1209 + $__�r�p_2c + (** +__s +, +__�je�1 +, +__�je�2 +) + +1211 * +__�tv� + = * +__s +; + +1212 i�( +__�tv� + !� +NULL +) + +1214 * +__� + = +__�tv� +; + +1217 i�(* +__� + == '\0') + +1219 +__� + = +NULL +; + +1222 i�(* +__� + =� +__�je�1 + || *__� =� +__�je�2 +) + +1224 * +__� +++ = '\0'; + +1227 ++ +__� +; + +1229 * +__s + = +__� +; + +1231 +__�tv� +; + +1232 + } +} + +1234 +__STRING_INLINE + * +__�r�p_3c + (** +__s +, +__�je�1 +, +__�je�2 +, + +1235 +__�je�3 +); + +1236 +__STRING_INLINE + * + +1237 + $__�r�p_3c + (** +__s +, +__�je�1 +, +__�je�2 +, +__�je�3 +) + +1239 * +__�tv� + = * +__s +; + +1240 i�( +__�tv� + !� +NULL +) + +1242 * +__� + = +__�tv� +; + +1245 i�(* +__� + == '\0') + +1247 +__� + = +NULL +; + +1250 i�(* +__� + =� +__�je�1 + || *__� =� +__�je�2 + || *__� =� +__�je�3 +) + +1252 * +__� +++ = '\0'; + +1255 ++ +__� +; + +1257 * +__s + = +__� +; + +1259 +__�tv� +; + +1260 + } +} + +1261 #ifde� +__USE_BSD + + +1262 + #�r�p +( +s +, +�je� +� + `__�r�p + (s,�eje�) + + ) + +1269 #ifde� +__USE_MISC + + +1271 #i�! +def�ed + +_HAVE_STRING_ARCH_�rdup + || !def�ed +_HAVE_STRING_ARCH_��dup + + +1272 + #__�ed_m�loc_�d_��oc + + + ) + +1273 + ~<�dlib.h +> + +1276 #i�de� +_HAVE_STRING_ARCH_�rdup + + +1278 * + $__�rdup + (cڡ * +__�r�g +� +__THROW + +__��ibu�_m�loc__ +; + +1279 + #__�rdup +( +s +) \ + +1280 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +s +�&& + `__�r�g2_1b�r_p + (s) \ + +1281 ? (((cڡ *�( +s +))[0] == '\0' \ + +1282 ? (*� + `��oc + (( +size_t +) 1, (size_t) 1) \ + +1283 : ({ +size_t + +__�n + = + `��� + ( +s +) + 1; \ + +1284 * +__�tv� + = (*� + `m�loc + ( +__�n +); \ + +1285 i�( +__�tv� + !� +NULL +) \ + +1286 +__�tv� + = (*� + `mem�y + (__�tv�, +s +, +__�n +); \ + +1287 +__�tv� +; + } +})) \ + +1288 : + `__�rdup + ( +s +))) + + ) + +1290 #i� +def�ed + +__USE_SVID + || def�ed +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + + +1291 + #�rdup +( +s +� + `__�rdup + (s) + + ) + +1295 #i�de� +_HAVE_STRING_ARCH_��dup + + +1297 * + $__��dup + (cڡ * +__�r�g +, +size_t + +__n +) + +1298 +__THROW + +__��ibu�_m�loc__ +; + +1299 + #__��dup +( +s +, +n +) \ + +1300 ( + `__ex�nsi�__ + ( + `__bu�t�_cڡ�t_p + ( +s +�&& + `__�r�g2_1b�r_p + (s) \ + +1301 ? (((cڡ *�( +s +))[0] == '\0' \ + +1302 ? (*� + `��oc + (( +size_t +) 1, (size_t) 1) \ + +1303 : ({ +size_t + +__�n + = + `��� + ( +s +) + 1; \ + +1304 +size_t + +__n + = ( +n +); \ + +1305 * +__�tv� +; \ + +1306 i�( +__n + < +__�n +) \ + +1307 +__�n + = +__n + + 1; \ + +1308 +__�tv� + = (*� + `m�loc + ( +__�n +); \ + +1309 i�( +__�tv� + !� +NULL +) \ + +1311 +__�tv� +[ +__�n + - 1] = '\0'; \ + +1312 +__�tv� + = (*� + `mem�y + (__�tv�, +s +, \ + +1313 +__�n + - 1); \ + +1315 +__�tv� +; + } +})) \ + +1316 : + `__��dup + ( +s +, +n +))) + + ) + +1318 #ifde� +__USE_GNU + + +1319 + #��dup +( +s +, +n +� + `__��dup + (s,�) + + ) + +1325 #i�de� +_FORCE_INLINES + + +1326 #unde� +__STRING_INLINE + + + @/usr/include/bits/string3.h + +18 #i�de� +_STRING_H + + +22 +__w�nde� + ( +__w�n_mem�t_z�o_�n +, + +25 #i�de� +__�lu�lus + + +29 #unde� +mem�y + + +30 #unde� +memmove + + +31 #unde� +mem�t + + +32 #unde� +�r�t + + +33 #unde� +�r�y + + +34 #unde� +���t + + +35 #unde� +���y + + +36 #ifde� +__USE_GNU + + +37 #unde� +memp�y + + +38 #unde� +�p�y + + +40 #ifde� +__USE_BSD + + +41 #unde� +bc�y + + +42 #unde� +bz�o + + +47 +__f�tify_fun�i� + * + +48 +__NTH + ( + $mem�y + (* +__��ri� + +__de� +, cڡ *__��ri� +__�c +, + +49 +size_t + +__�n +)) + +51 + `__bu�t�___mem�y_chk + ( +__de� +, +__�c +, +__�n +, + `__bos0 + (__dest)); + +52 + } +} + +54 +__f�tify_fun�i� + * + +55 +__NTH + ( + $memmove + (* +__de� +, cڡ * +__�c +, +size_t + +__�n +)) + +57 + `__bu�t�___memmove_chk + ( +__de� +, +__�c +, +__�n +, + `__bos0 + (__dest)); + +58 + } +} + +60 #ifde� +__USE_GNU + + +61 +__f�tify_fun�i� + * + +62 +__NTH + ( + $memp�y + (* +__��ri� + +__de� +, cڡ *__��ri� +__�c +, + +63 +size_t + +__�n +)) + +65 + `__bu�t�___memp�y_chk + ( +__de� +, +__�c +, +__�n +, + `__bos0 + (__dest)); + +66 + } +} + +75 +__f�tify_fun�i� + * + +76 +__NTH + ( + $mem�t + (* +__de� +, +__ch +, +size_t + +__�n +)) + +78 i�( + `__bu�t�_cڡ�t_p + ( +__�n +) && __len == 0 + +79 && (! + `__bu�t�_cڡ�t_p + ( +__ch +) || __ch != 0)) + +81 + `__w�n_mem�t_z�o_�n + (); + +82 +__de� +; + +84 + `__bu�t�___mem�t_chk + ( +__de� +, +__ch +, +__�n +, + `__bos0 + (__dest)); + +85 + } +} + +87 #ifde� +__USE_BSD + + +88 +__f�tify_fun�i� + + +89 +__NTH + ( + $bc�y + (cڡ * +__�c +, * +__de� +, +size_t + +__�n +)) + +91 (� + `__bu�t�___memmove_chk + ( +__de� +, +__�c +, +__�n +, + `__bos0 + (__dest)); + +92 + } +} + +94 +__f�tify_fun�i� + + +95 +__NTH + ( + $bz�o + (* +__de� +, +size_t + +__�n +)) + +97 (� + `__bu�t�___mem�t_chk + ( +__de� +, '\0', +__�n +, + `__bos0 + (__dest)); + +98 + } +} + +101 +__f�tify_fun�i� + * + +102 +__NTH + ( + $�r�y + (* +__��ri� + +__de� +, cڡ *__��ri� +__�c +)) + +104 + `__bu�t�___�r�y_chk + ( +__de� +, +__�c +, + `__bos + (__dest)); + +105 + } +} + +107 #ifde� +__USE_GNU + + +108 +__f�tify_fun�i� + * + +109 +__NTH + ( + $�p�y + (* +__��ri� + +__de� +, cڡ *__��ri� +__�c +)) + +111 + `__bu�t�___�p�y_chk + ( +__de� +, +__�c +, + `__bos + (__dest)); + +112 + } +} + +116 +__f�tify_fun�i� + * + +117 +__NTH + ( + $���y + (* +__��ri� + +__de� +, cڡ *__��ri� +__�c +, + +118 +size_t + +__�n +)) + +120 + `__bu�t�___���y_chk + ( +__de� +, +__�c +, +__�n +, + `__bos + (__dest)); + +121 + } +} + +124 * + $__���y_chk + (* +__de� +, cڡ * +__�c +, +size_t + +__n +, + +125 +size_t + +__de��n +� +__THROW +; + +126 * + `__REDIRECT_NTH + ( +__���y_��s +, (* +__de� +, cڡ * +__�c +, + +127 +size_t + +__n +), +���y +); + +129 +__f�tify_fun�i� + * + +130 + `__NTH + ( + $���y + (* +__de� +, cڡ * +__�c +, +size_t + +__n +)) + +132 i�( + `__bos + ( +__de� +�!�( +size_t +) -1 + +133 && (! + `__bu�t�_cڡ�t_p + ( +__n +�|| __�<� + `__bos + ( +__de� +))) + +134 + `__���y_chk + ( +__de� +, +__�c +, +__n +, + `__bos + (__dest)); + +135 + `__���y_��s + ( +__de� +, +__�c +, +__n +); + +136 + } +} + +139 +__f�tify_fun�i� + * + +140 +__NTH + ( + $�r�t + (* +__��ri� + +__de� +, cڡ *__��ri� +__�c +)) + +142 + `__bu�t�___�r�t_chk + ( +__de� +, +__�c +, + `__bos + (__dest)); + +143 + } +} + +146 +__f�tify_fun�i� + * + +147 +__NTH + ( + $���t + (* +__��ri� + +__de� +, cڡ *__��ri� +__�c +, + +148 +size_t + +__�n +)) + +150 + `__bu�t�___���t_chk + ( +__de� +, +__�c +, +__�n +, + `__bos + (__dest)); + +151 + } +} + + @/usr/include/bits/sys_errlist.h + +19 #i�de� +_STDIO_H + + +25 #ifde� +__USE_BSD + + +26 +sys_ü +; + +27 cڡ *cڡ +sys_��i� +[]; + +29 #ifde� +__USE_GNU + + +30 +_sys_ü +; + +31 cڡ *cڡ +_sys_��i� +[]; + + @/usr/include/bits/syslog-ldbl.h + +19 #i�de� +_SYS_SYSLOG_H + + +23 + $__LDBL_REDIR_DECL + ( +sy�og +) + +25 #ifde� +__USE_BSD + + +26 + $__LDBL_REDIR_DECL + ( +vsy�og +) + +29 #i� +__USE_FORTIFY_LEVEL + > 0 && +def�ed + +__f�tify_fun�i� + + +30 + $__LDBL_REDIR_DECL + ( +__sy�og_chk +) + +32 #ifde� +__USE_BSD + + +33 + $__LDBL_REDIR_DECL + ( +__vsy�og_chk +) + + @/usr/include/bits/syslog-path.h + +19 #i�de� +_SYS_SYSLOG_H + + +23 #i�de� +_BITS_SYSLOG_PATH_H + + +24 + #_BITS_SYSLOG_PATH_H + 1 + + ) + +26 + #_PATH_LOG + "/dev/log" + + ) + + @/usr/include/bits/syslog.h + +19 #i�de� +_SYS_SYSLOG_H + + +24 + $__sy�og_chk + ( +__�i +, +__�ag +, cڡ * +__fmt +, ...) + +25 + `__��ibu�__ + (( + `__f�m�__ + ( +__��tf__ +, 3, 4))); + +27 #ifde� +__va_�g_�ck + + +28 +__f�tify_fun�i� + + +29 + $sy�og + ( +__�i +, cڡ * +__fmt +, ...) + +31 + `__sy�og_chk + ( +__�i +, +__USE_FORTIFY_LEVEL + - 1, +__fmt +, + `__va_�g_�ck + ()); + +32 + } +} + +33 #�i�! +def�ed + +__�lu�lus + + +34 + #sy�og +( +�i +, ...) \ + +35 + `__sy�og_chk + ( +�i +, +__USE_FORTIFY_LEVEL + - 1, +__VA_ARGS__ +) + + ) + +39 #ifde� +__USE_BSD + + +40 + $__vsy�og_chk + ( +__�i +, +__�ag +, cڡ * +__fmt +, + +41 +__gnuc_va_li� + +__� +) + +42 + `__��ibu�__ + (( + `__f�m�__ + ( +__��tf__ +, 3, 0))); + +44 +__f�tify_fun�i� + + +45 + $vsy�og + ( +__�i +, cڡ * +__fmt +, +__gnuc_va_li� + +__� +) + +47 + `__vsy�og_chk + ( +__�i +, +__USE_FORTIFY_LEVEL + - 1, +__fmt +, +__� +); + +48 + } +} + + @/usr/include/bits/termios.h + +19 #i�de� +_TERMIOS_H + + +23 + tcc_t +; + +24 + t��d_t +; + +25 + ttc�ag_t +; + +27 + #NCCS + 32 + + ) + +28 + s�rmios + + +30 +tc�ag_t + + mc_i�ag +; + +31 +tc�ag_t + + mc_o�ag +; + +32 +tc�ag_t + + mc_c�ag +; + +33 +tc�ag_t + + mc_l�ag +; + +34 +cc_t + + mc_l�e +; + +35 +cc_t + + mc_cc +[ +NCCS +]; + +36 +��d_t + + mc_i��d +; + +37 +��d_t + + mc_o��d +; + +38 + #_HAVE_STRUCT_TERMIOS_C_ISPEED + 1 + + ) + +39 + #_HAVE_STRUCT_TERMIOS_C_OSPEED + 1 + + ) + +43 + #VINTR + 0 + + ) + +44 + #VQUIT + 1 + + ) + +45 + #VERASE + 2 + + ) + +46 + #VKILL + 3 + + ) + +47 + #VEOF + 4 + + ) + +48 + #VTIME + 5 + + ) + +49 + #VMIN + 6 + + ) + +50 + #VSWTC + 7 + + ) + +51 + #VSTART + 8 + + ) + +52 + #VSTOP + 9 + + ) + +53 + #VSUSP + 10 + + ) + +54 + #VEOL + 11 + + ) + +55 + #VREPRINT + 12 + + ) + +56 + #VDISCARD + 13 + + ) + +57 + #VWERASE + 14 + + ) + +58 + #VLNEXT + 15 + + ) + +59 + #VEOL2 + 16 + + ) + +62 + #IGNBRK + 0000001 + + ) + +63 + #BRKINT + 0000002 + + ) + +64 + #IGNPAR + 0000004 + + ) + +65 + #PARMRK + 0000010 + + ) + +66 + #INPCK + 0000020 + + ) + +67 + #ISTRIP + 0000040 + + ) + +68 + #INLCR + 0000100 + + ) + +69 + #IGNCR + 0000200 + + ) + +70 + #ICRNL + 0000400 + + ) + +71 + #IUCLC + 0001000 + + ) + +72 + #IXON + 0002000 + + ) + +73 + #IXANY + 0004000 + + ) + +74 + #IXOFF + 0010000 + + ) + +75 + #IMAXBEL + 0020000 + + ) + +76 + #IUTF8 + 0040000 + + ) + +79 + #OPOST + 0000001 + + ) + +80 + #OLCUC + 0000002 + + ) + +81 + #ONLCR + 0000004 + + ) + +82 + #OCRNL + 0000010 + + ) + +83 + #ONOCR + 0000020 + + ) + +84 + #ONLRET + 0000040 + + ) + +85 + #OFILL + 0000100 + + ) + +86 + #OFDEL + 0000200 + + ) + +87 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN + + +88 + #NLDLY + 0000400 + + ) + +89 + #NL0 + 0000000 + + ) + +90 + #NL1 + 0000400 + + ) + +91 + #CRDLY + 0003000 + + ) + +92 + #CR0 + 0000000 + + ) + +93 + #CR1 + 0001000 + + ) + +94 + #CR2 + 0002000 + + ) + +95 + #CR3 + 0003000 + + ) + +96 + #TABDLY + 0014000 + + ) + +97 + #TAB0 + 0000000 + + ) + +98 + #TAB1 + 0004000 + + ) + +99 + #TAB2 + 0010000 + + ) + +100 + #TAB3 + 0014000 + + ) + +101 + #BSDLY + 0020000 + + ) + +102 + #BS0 + 0000000 + + ) + +103 + #BS1 + 0020000 + + ) + +104 + #FFDLY + 0100000 + + ) + +105 + #FF0 + 0000000 + + ) + +106 + #FF1 + 0100000 + + ) + +109 + #VTDLY + 0040000 + + ) + +110 + #VT0 + 0000000 + + ) + +111 + #VT1 + 0040000 + + ) + +113 #ifde� +__USE_MISC + + +114 + #XTABS + 0014000 + + ) + +118 #ifde� +__USE_MISC + + +119 + #CBAUD + 0010017 + + ) + +121 + #B0 + 0000000 + + ) + +122 + #B50 + 0000001 + + ) + +123 + #B75 + 0000002 + + ) + +124 + #B110 + 0000003 + + ) + +125 + #B134 + 0000004 + + ) + +126 + #B150 + 0000005 + + ) + +127 + #B200 + 0000006 + + ) + +128 + #B300 + 0000007 + + ) + +129 + #B600 + 0000010 + + ) + +130 + #B1200 + 0000011 + + ) + +131 + #B1800 + 0000012 + + ) + +132 + #B2400 + 0000013 + + ) + +133 + #B4800 + 0000014 + + ) + +134 + #B9600 + 0000015 + + ) + +135 + #B19200 + 0000016 + + ) + +136 + #B38400 + 0000017 + + ) + +137 #ifde� +__USE_MISC + + +138 + #EXTA + +B19200 + + + ) + +139 + #EXTB + +B38400 + + + ) + +141 + #CSIZE + 0000060 + + ) + +142 + #CS5 + 0000000 + + ) + +143 + #CS6 + 0000020 + + ) + +144 + #CS7 + 0000040 + + ) + +145 + #CS8 + 0000060 + + ) + +146 + #CSTOPB + 0000100 + + ) + +147 + #CREAD + 0000200 + + ) + +148 + #PARENB + 0000400 + + ) + +149 + #PARODD + 0001000 + + ) + +150 + #HUPCL + 0002000 + + ) + +151 + #CLOCAL + 0004000 + + ) + +152 #ifde� +__USE_MISC + + +153 + #CBAUDEX + 0010000 + + ) + +155 + #B57600 + 0010001 + + ) + +156 + #B115200 + 0010002 + + ) + +157 + #B230400 + 0010003 + + ) + +158 + #B460800 + 0010004 + + ) + +159 + #B500000 + 0010005 + + ) + +160 + #B576000 + 0010006 + + ) + +161 + #B921600 + 0010007 + + ) + +162 + #B1000000 + 0010010 + + ) + +163 + #B1152000 + 0010011 + + ) + +164 + #B1500000 + 0010012 + + ) + +165 + #B2000000 + 0010013 + + ) + +166 + #B2500000 + 0010014 + + ) + +167 + #B3000000 + 0010015 + + ) + +168 + #B3500000 + 0010016 + + ) + +169 + #B4000000 + 0010017 + + ) + +170 + #__MAX_BAUD + +B4000000 + + + ) + +171 #ifde� +__USE_MISC + + +172 + #CIBAUD + 002003600000 + + ) + +173 + #CMSPAR + 010000000000 + + ) + +174 + #CRTSCTS + 020000000000 + + ) + +178 + #ISIG + 0000001 + + ) + +179 + #ICANON + 0000002 + + ) + +180 #i� +def�ed + +__USE_MISC + || def�ed +__USE_XOPEN + + +181 + #XCASE + 0000004 + + ) + +183 + #ECHO + 0000010 + + ) + +184 + #ECHOE + 0000020 + + ) + +185 + #ECHOK + 0000040 + + ) + +186 + #ECHONL + 0000100 + + ) + +187 + #NOFLSH + 0000200 + + ) + +188 + #TOSTOP + 0000400 + + ) + +189 #ifde� +__USE_MISC + + +190 + #ECHOCTL + 0001000 + + ) + +191 + #ECHOPRT + 0002000 + + ) + +192 + #ECHOKE + 0004000 + + ) + +193 + #FLUSHO + 0010000 + + ) + +194 + #PENDIN + 0040000 + + ) + +196 + #IEXTEN + 0100000 + + ) + +197 #ifde� +__USE_BSD + + +198 + #EXTPROC + 0200000 + + ) + +202 + #TCOOFF + 0 + + ) + +203 + #TCOON + 1 + + ) + +204 + #TCIOFF + 2 + + ) + +205 + #TCION + 3 + + ) + +208 + #TCIFLUSH + 0 + + ) + +209 + #TCOFLUSH + 1 + + ) + +210 + #TCIOFLUSH + 2 + + ) + +213 + #TCSANOW + 0 + + ) + +214 + #TCSADRAIN + 1 + + ) + +215 + #TCSAFLUSH + 2 + + ) + +218 + #_IOT_�rmios + \ + +219 + `_IOT + ( + `_IOTS + ( +c�ag_t +), 4, _IOTS ( +cc_t +), +NCCS +, _IOTS ( +��d_t +), 2) + + ) + + @/usr/include/bits/time.h + +23 #i� +def�ed + +__�ed_timev� + || def�ed +__USE_GNU + + +24 #i�de� +_STRUCT_TIMEVAL + + +25 + #_STRUCT_TIMEVAL + 1 + + ) + +26 + ~<b�s/ty�s.h +> + +30 + stimev� + + +32 +__time_t + + mtv_�c +; + +33 +__su�c�ds_t + + mtv_u�c +; + +38 #i�de� +__�ed_timev� + + +39 #i�de� +_BITS_TIME_H + + +40 + #_BITS_TIME_H + 1 + + ) + +48 + #CLOCKS_PER_SEC + 1000000l + + ) + +50 #i�(! +def�ed + +__STRICT_ANSI__ + || def�ed +__USE_POSIX +) \ + +51 && ! +def�ed + + g__USE_XOPEN2K + + +54 + ~<b�s/ty�s.h +> + +55 +__sysc�f + (); + +56 + #CLK_TCK + (( +__�ock_t +� + `__sysc�f + (2)� + + ) + +59 #ifde� +__USE_POSIX199309 + + +61 + #CLOCK_REALTIME + 0 + + ) + +63 + #CLOCK_MONOTONIC + 1 + + ) + +65 + #CLOCK_PROCESS_CPUTIME_ID + 2 + + ) + +67 + #CLOCK_THREAD_CPUTIME_ID + 3 + + ) + +69 + #CLOCK_MONOTONIC_RAW + 4 + + ) + +71 + #CLOCK_REALTIME_COARSE + 5 + + ) + +73 + #CLOCK_MONOTONIC_COARSE + 6 + + ) + +75 + #CLOCK_BOOTTIME + 7 + + ) + +77 + #CLOCK_REALTIME_ALARM + 8 + + ) + +79 + #CLOCK_BOOTTIME_ALARM + 9 + + ) + +82 + #TIMER_ABSTIME + 1 + + ) + +85 #ifde� +__USE_GNU + + +86 + ~<b�s/timex.h +> + +88 +__BEGIN_DECLS + + +91 + $�ock_adjtime + ( +__�ockid_t + +__�ock_id +, +timex + * +__utx +� +__THROW +; + +93 +__END_DECLS + + +99 #unde� +__�ed_timev� + + + @/usr/include/bits/types.h + +23 #i�def +_BITS_TYPES_H + + +24 + #_BITS_TYPES_H + 1 + + ) + +26 + ~<�u�s.h +> + +27 + ~<b�s/w�dsize.h +> + +30 + t__u_ch� +; + +31 + t__u_sh�t +; + +32 + t__u_�t +; + +33 + t__u_l�g +; + +36 sig�d + t__�t8_t +; + +37 + t__u�t8_t +; + +38 sig�d + t__�t16_t +; + +39 + t__u�t16_t +; + +40 sig�d + t__�t32_t +; + +41 + t__u�t32_t +; + +42 #i� +__WORDSIZE + == 64 + +43 sig�d + t__�t64_t +; + +44 + t__u�t64_t +; + +46 +__ex�nsi�__ + sig�d + t__�t64_t +; + +47 +__ex�nsi�__ + + t__u�t64_t +; + +51 #i� +__WORDSIZE + == 64 + +52 + t__quad_t +; + +53 + t__u_quad_t +; + +55 +__ex�nsi�__ + + t__quad_t +; + +56 +__ex�nsi�__ + + t__u_quad_t +; + +89 + #__S16_TYPE + + + ) + +90 + #__U16_TYPE + + + ) + +91 + #__S32_TYPE + + + ) + +92 + #__U32_TYPE + + + ) + +93 + #__SLONGWORD_TYPE + + + ) + +94 + #__ULONGWORD_TYPE + + + ) + +95 #i� +__WORDSIZE + == 32 + +96 + #__SQUAD_TYPE + +__quad_t + + + ) + +97 + #__UQUAD_TYPE + +__u_quad_t + + + ) + +98 + #__SWORD_TYPE + + + ) + +99 + #__UWORD_TYPE + + + ) + +100 + #__SLONG32_TYPE + + + ) + +101 + #__ULONG32_TYPE + + + ) + +102 + #__S64_TYPE + +__quad_t + + + ) + +103 + #__U64_TYPE + +__u_quad_t + + + ) + +106 + #__STD_TYPE + +__ex�nsi�__ + + + ) + +107 #�i� +__WORDSIZE + == 64 + +108 + t__SQUAD_TYPE + + + ) + +109 + t__UQUAD_TYPE + + + ) + +110 + t__SWORD_TYPE + + + ) + +111 + t__UWORD_TYPE + + + ) + +112 + t__SLONG32_TYPE + + + ) + +113 + t__ULONG32_TYPE + + + ) + +114 + t__S64_TYPE + + + ) + +115 + t__U64_TYPE + + + ) + +117 + t__STD_TYPE + + + ) + +121 + ~<b�s/ty�sizes.h +> + +124 +__STD_TYPE + + t__DEV_T_TYPE + + t__dev_t +; + +125 +__STD_TYPE + +__UID_T_TYPE + + g__uid_t +; + +126 +__STD_TYPE + +__GID_T_TYPE + + g__gid_t +; + +127 +__STD_TYPE + +__INO_T_TYPE + + g__�o_t +; + +128 +__STD_TYPE + +__INO64_T_TYPE + + g__�o64_t +; + +129 +__STD_TYPE + +__MODE_T_TYPE + + g__mode_t +; + +130 +__STD_TYPE + +__NLINK_T_TYPE + + g__ƚk_t +; + +131 +__STD_TYPE + +__OFF_T_TYPE + + g__off_t +; + +132 +__STD_TYPE + +__OFF64_T_TYPE + + g__off64_t +; + +133 +__STD_TYPE + +__PID_T_TYPE + + g__pid_t +; + +134 +__STD_TYPE + +__FSID_T_TYPE + + g__fsid_t +; + +135 +__STD_TYPE + +__CLOCK_T_TYPE + + g__�ock_t +; + +136 +__STD_TYPE + +__RLIM_T_TYPE + + g__�im_t +; + +137 +__STD_TYPE + +__RLIM64_T_TYPE + + g__�im64_t +; + +138 +__STD_TYPE + +__ID_T_TYPE + + g__id_t +; + +139 +__STD_TYPE + +__TIME_T_TYPE + + g__time_t +; + +140 +__STD_TYPE + +__USECONDS_T_TYPE + + g__u�c�ds_t +; + +141 +__STD_TYPE + +__SUSECONDS_T_TYPE + + g__su�c�ds_t +; + +143 +__STD_TYPE + +__DADDR_T_TYPE + + g__daddr_t +; + +144 +__STD_TYPE + +__KEY_T_TYPE + + g__key_t +; + +147 +__STD_TYPE + +__CLOCKID_T_TYPE + + g__�ockid_t +; + +150 +__STD_TYPE + +__TIMER_T_TYPE + + g__tim�_t +; + +153 +__STD_TYPE + +__BLKSIZE_T_TYPE + + g__blksize_t +; + +158 +__STD_TYPE + +__BLKCNT_T_TYPE + + g__blk�t_t +; + +159 +__STD_TYPE + +__BLKCNT64_T_TYPE + + g__blk�t64_t +; + +162 +__STD_TYPE + +__FSBLKCNT_T_TYPE + + g__fsblk�t_t +; + +163 +__STD_TYPE + +__FSBLKCNT64_T_TYPE + + g__fsblk�t64_t +; + +166 +__STD_TYPE + +__FSFILCNT_T_TYPE + + g__fsf��t_t +; + +167 +__STD_TYPE + +__FSFILCNT64_T_TYPE + + g__fsf��t64_t +; + +170 +__STD_TYPE + +__FSWORD_T_TYPE + + g__fsw�d_t +; + +172 +__STD_TYPE + +__SSIZE_T_TYPE + + g__ssize_t +; + +175 +__STD_TYPE + +__SYSCALL_SLONG_TYPE + + g__sys��_��g_t +; + +177 +__STD_TYPE + +__SYSCALL_ULONG_TYPE + + g__sys��_ul�g_t +; + +181 +__off64_t + + t__loff_t +; + +182 +__quad_t + * + t__qaddr_t +; + +183 * + t__�ddr_t +; + +186 +__STD_TYPE + +__SWORD_TYPE + + g__���_t +; + +189 +__STD_TYPE + +__U32_TYPE + + g__sock�n_t +; + +192 #unde� +__STD_TYPE + + + @/usr/include/bits/unistd.h + +19 #i�de� +_UNISTD_H + + +23 +ssize_t + + $__�ad_chk + ( +__fd +, * +__buf +, +size_t + +__nby�s +, + +24 +size_t + +__bu� +� +__wur +; + +25 +ssize_t + + `__REDIRECT + ( +__�ad_��s +, ( +__fd +, * +__buf +, + +26 +size_t + +__nby�s +), +�ad +� +__wur +; + +27 +ssize_t + + `__REDIRECT + ( +__�ad_chk_w�n +, + +28 ( +__fd +, * +__buf +, +size_t + +__nby�s +, + +29 +size_t + +__bu� +), +__�ad_chk +) + +30 +__wur + + `__w�ljr + ("read called with bigger�ength�han size of " + +33 +__f�tify_fun�i� + +__wur + +ssize_t + + +34 + $�ad + ( +__fd +, * +__buf +, +size_t + +__nby�s +) + +36 i�( + `__bos0 + ( +__buf +�!�( +size_t +) -1) + +38 i�(! + `__bu�t�_cڡ�t_p + ( +__nby�s +)) + +39 + `__�ad_chk + ( +__fd +, +__buf +, +__nby�s +, + `__bos0 + (__buf)); + +41 i�( +__nby�s + > + `__bos0 + ( +__buf +)) + +42 + `__�ad_chk_w�n + ( +__fd +, +__buf +, +__nby�s +, + `__bos0 + (__buf)); + +44 + `__�ad_��s + ( +__fd +, +__buf +, +__nby�s +); + +45 + } +} + +47 #ifde� +__USE_UNIX98 + + +48 +ssize_t + + $__��d_chk + ( +__fd +, * +__buf +, +size_t + +__nby�s +, + +49 +__off_t + +__off�t +, +size_t + +__bufsize +� +__wur +; + +50 +ssize_t + + $__��d64_chk + ( +__fd +, * +__buf +, +size_t + +__nby�s +, + +51 +__off64_t + +__off�t +, +size_t + +__bufsize +� +__wur +; + +52 +ssize_t + + `__REDIRECT + ( +__��d_��s +, + +53 ( +__fd +, * +__buf +, +size_t + +__nby�s +, + +54 +__off_t + +__off�t +), +��d +� +__wur +; + +55 +ssize_t + + `__REDIRECT + ( +__��d64_��s +, + +56 ( +__fd +, * +__buf +, +size_t + +__nby�s +, + +57 +__off64_t + +__off�t +), +��d64 +� +__wur +; + +58 +ssize_t + + `__REDIRECT + ( +__��d_chk_w�n +, + +59 ( +__fd +, * +__buf +, +size_t + +__nby�s +, + +60 +__off_t + +__off�t +, +size_t + +__bufsize +), +__��d_chk +) + +61 +__wur + + `__w�ljr + ("pread called with bigger�ength�han size of " + +63 +ssize_t + + `__REDIRECT + ( +__��d64_chk_w�n +, + +64 ( +__fd +, * +__buf +, +size_t + +__nby�s +, + +65 +__off64_t + +__off�t +, +size_t + +__bufsize +), + +66 +__��d64_chk +) + +67 +__wur + + `__w�ljr + ("pread64 called with bigger�ength�han size of " + +70 #i�de� +__USE_FILE_OFFSET64 + + +71 +__f�tify_fun�i� + +__wur + +ssize_t + + +72 + $��d + ( +__fd +, * +__buf +, +size_t + +__nby�s +, +__off_t + +__off�t +) + +74 i�( + `__bos0 + ( +__buf +�!�( +size_t +) -1) + +76 i�(! + `__bu�t�_cڡ�t_p + ( +__nby�s +)) + +77 + `__��d_chk + ( +__fd +, +__buf +, +__nby�s +, +__off�t +, + `__bos0 + (__buf)); + +79 i�� +__nby�s + > + `__bos0 + ( +__buf +)) + +80 + `__��d_chk_w�n + ( +__fd +, +__buf +, +__nby�s +, +__off�t +, + +81 + `__bos0 + ( +__buf +)); + +83 + `__��d_��s + ( +__fd +, +__buf +, +__nby�s +, +__off�t +); + +84 + } +} + +86 +__f�tify_fun�i� + +__wur + +ssize_t + + +87 + $��d + ( +__fd +, * +__buf +, +size_t + +__nby�s +, +__off64_t + +__off�t +) + +89 i�( + `__bos0 + ( +__buf +�!�( +size_t +) -1) + +91 i�(! + `__bu�t�_cڡ�t_p + ( +__nby�s +)) + +92 + `__��d64_chk + ( +__fd +, +__buf +, +__nby�s +, +__off�t +, + `__bos0 + (__buf)); + +94 i�� +__nby�s + > + `__bos0 + ( +__buf +)) + +95 + `__��d64_chk_w�n + ( +__fd +, +__buf +, +__nby�s +, +__off�t +, + +96 + `__bos0 + ( +__buf +)); + +99 + `__��d64_��s + ( +__fd +, +__buf +, +__nby�s +, +__off�t +); + +100 + } +} + +103 #ifde� +__USE_LARGEFILE64 + + +104 +__f�tify_fun�i� + +__wur + +ssize_t + + +105 + $��d64 + ( +__fd +, * +__buf +, +size_t + +__nby�s +, +__off64_t + +__off�t +) + +107 i�( + `__bos0 + ( +__buf +�!�( +size_t +) -1) + +109 i�(! + `__bu�t�_cڡ�t_p + ( +__nby�s +)) + +110 + `__��d64_chk + ( +__fd +, +__buf +, +__nby�s +, +__off�t +, + `__bos0 + (__buf)); + +112 i�� +__nby�s + > + `__bos0 + ( +__buf +)) + +113 + `__��d64_chk_w�n + ( +__fd +, +__buf +, +__nby�s +, +__off�t +, + +114 + `__bos0 + ( +__buf +)); + +117 + `__��d64_��s + ( +__fd +, +__buf +, +__nby�s +, +__off�t +); + +118 + } +} + +122 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + || def�ed +__USE_XOPEN2K + + +123 +ssize_t + + $__�adl�k_chk + (cڡ * +__��ri� + +__�th +, + +124 * +__��ri� + +__buf +, +size_t + +__�n +, + +125 +size_t + +__bu� +) + +126 +__THROW + + `__n�nu� + ((1, 2)� +__wur +; + +127 +ssize_t + + `__REDIRECT_NTH + ( +__�adl�k_��s +, + +128 (cڡ * +__��ri� + +__�th +, + +129 * +__��ri� + +__buf +, +size_t + +__�n +), +�adl�k +) + +130 + `__n�nu� + ((1, 2)� +__wur +; + +131 +ssize_t + + `__REDIRECT_NTH + ( +__�adl�k_chk_w�n +, + +132 (cڡ * +__��ri� + +__�th +, + +133 * +__��ri� + +__buf +, +size_t + +__�n +, + +134 +size_t + +__bu� +), +__�adl�k_chk +) + +135 + `__n�nu� + ((1, 2)� +__wur + + `__w�ljr + ("readlink called with bigger�ength " + +138 +__f�tify_fun�i� + + `__n�nu� + ((1, 2)� +__wur + +ssize_t + + +139 + `__NTH + ( + $�adl�k + (cڡ * +__��ri� + +__�th +, *__��ri� +__buf +, + +140 +size_t + +__�n +)) + +142 i�( + `__bos + ( +__buf +�!�( +size_t +) -1) + +144 i�(! + `__bu�t�_cڡ�t_p + ( +__�n +)) + +145 + `__�adl�k_chk + ( +__�th +, +__buf +, +__�n +, + `__bos + (__buf)); + +147 i�� +__�n + > + `__bos + ( +__buf +)) + +148 + `__�adl�k_chk_w�n + ( +__�th +, +__buf +, +__�n +, + `__bos + (__buf)); + +150 + `__�adl�k_��s + ( +__�th +, +__buf +, +__�n +); + +151 + } +} + +154 #ifde� +__USE_ATFILE + + +155 +ssize_t + + $__�adl�k�_chk + ( +__fd +, cڡ * +__��ri� + +__�th +, + +156 * +__��ri� + +__buf +, +size_t + +__�n +, + +157 +size_t + +__bu� +) + +158 +__THROW + + `__n�nu� + ((2, 3)� +__wur +; + +159 +ssize_t + + `__REDIRECT_NTH + ( +__�adl�k�_��s +, + +160 ( +__fd +, cڡ * +__��ri� + +__�th +, + +161 * +__��ri� + +__buf +, +size_t + +__�n +), + +162 +�adl�k� +) + +163 + `__n�nu� + ((2, 3)� +__wur +; + +164 +ssize_t + + `__REDIRECT_NTH + ( +__�adl�k�_chk_w�n +, + +165 ( +__fd +, cڡ * +__��ri� + +__�th +, + +166 * +__��ri� + +__buf +, +size_t + +__�n +, + +167 +size_t + +__bu� +), +__�adl�k�_chk +) + +168 + `__n�nu� + ((2, 3)� +__wur + + `__w�ljr + ("readlinkat called with bigger " + +172 +__f�tify_fun�i� + + `__n�nu� + ((2, 3)� +__wur + +ssize_t + + +173 + `__NTH + ( + $�adl�k� + ( +__fd +, cڡ * +__��ri� + +__�th +, + +174 * +__��ri� + +__buf +, +size_t + +__�n +)) + +176 i�( + `__bos + ( +__buf +�!�( +size_t +) -1) + +178 i�(! + `__bu�t�_cڡ�t_p + ( +__�n +)) + +179 + `__�adl�k�_chk + ( +__fd +, +__�th +, +__buf +, +__�n +, + `__bos + (__buf)); + +181 i�( +__�n + > + `__bos + ( +__buf +)) + +182 + `__�adl�k�_chk_w�n + ( +__fd +, +__�th +, +__buf +, +__�n +, + +183 + `__bos + ( +__buf +)); + +185 + `__�adl�k�_��s + ( +__fd +, +__�th +, +__buf +, +__�n +); + +186 + } +} + +189 * + $__g�cwd_chk + (* +__buf +, +size_t + +__size +, size_� +__bu� +) + +190 +__THROW + +__wur +; + +191 * + `__REDIRECT_NTH + ( +__g�cwd_��s +, + +192 (* +__buf +, +size_t + +__size +), +g�cwd +� +__wur +; + +193 * + `__REDIRECT_NTH + ( +__g�cwd_chk_w�n +, + +194 (* +__buf +, +size_t + +__size +, size_� +__bu� +), + +195 +__g�cwd_chk +) + +196 +__wur + + `__w�ljr + ("getcwd caller with bigger�ength�han size of " + +199 +__f�tify_fun�i� + +__wur + * + +200 + `__NTH + ( + $g�cwd + (* +__buf +, +size_t + +__size +)) + +202 i�( + `__bos + ( +__buf +�!�( +size_t +) -1) + +204 i�(! + `__bu�t�_cڡ�t_p + ( +__size +)) + +205 + `__g�cwd_chk + ( +__buf +, +__size +, + `__bos + (__buf)); + +207 i�( +__size + > + `__bos + ( +__buf +)) + +208 + `__g�cwd_chk_w�n + ( +__buf +, +__size +, + `__bos + (__buf)); + +210 + `__g�cwd_��s + ( +__buf +, +__size +); + +211 + } +} + +213 #i� +def�ed + +__USE_BSD + || def�ed +__USE_XOPEN_EXTENDED + + +214 * + $__g�wd_chk + (* +__buf +, +size_t + +bu� +) + +215 +__THROW + + `__n�nu� + ((1)� +__wur +; + +216 * + `__REDIRECT_NTH + ( +__g�wd_w�n +, (* +__buf +), +g�wd +) + +217 + `__n�nu� + ((1)� +__wur + + `__w�ljr + ("please use getcwd instead,�s getwd " + +220 +__f�tify_fun�i� + + `__n�nu� + ((1)� +__��ibu�_d����d__ + +__wur + * + +221 + `__NTH + ( + $g�wd + (* +__buf +)) + +223 i�( + `__bos + ( +__buf +�!�( +size_t +) -1) + +224 + `__g�wd_chk + ( +__buf +, + `__bos + (__buf)); + +225 + `__g�wd_w�n + ( +__buf +); + +226 + } +} + +229 +size_t + + $__c�f�r_chk + ( +__�me +, * +__buf +, +size_t + +__�n +, + +230 +size_t + +__bu� +� +__THROW +; + +231 +size_t + + `__REDIRECT_NTH + ( +__c�f�r_��s +, ( +__�me +, * +__buf +, + +232 +size_t + +__�n +), +c�f�r +); + +233 +size_t + + `__REDIRECT_NTH + ( +__c�f�r_chk_w�n +, + +234 ( +__�me +, * +__buf +, +size_t + +__�n +, + +235 +size_t + +__bu� +), +__c�f�r_chk +) + +236 + `__w�ljr + ("confstr called with bigger�ength�han size of destination " + +239 +__f�tify_fun�i� + +size_t + + +240 + `__NTH + ( + $c�f�r + ( +__�me +, * +__buf +, +size_t + +__�n +)) + +242 i�( + `__bos + ( +__buf +�!�( +size_t +) -1) + +244 i�(! + `__bu�t�_cڡ�t_p + ( +__�n +)) + +245 + `__c�f�r_chk + ( +__�me +, +__buf +, +__�n +, + `__bos + (__buf)); + +247 i�( + `__bos + ( +__buf +�< +__�n +) + +248 + `__c�f�r_chk_w�n + ( +__�me +, +__buf +, +__�n +, + `__bos + (__buf)); + +250 + `__c�f�r_��s + ( +__�me +, +__buf +, +__�n +); + +251 + } +} + +254 + $__g�groups_chk + ( +__size +, +__gid_t + +__li� +[], +size_t + +__li��n +) + +255 +__THROW + +__wur +; + +256 + `__REDIRECT_NTH + ( +__g�groups_��s +, ( +__size +, +__gid_t + +__li� +[]), + +257 +g�groups +� +__wur +; + +258 + `__REDIRECT_NTH + ( +__g�groups_chk_w�n +, + +259 ( +__size +, +__gid_t + +__li� +[], +size_t + +__li��n +), + +260 +__g�groups_chk +) + +261 +__wur + + `__w�ljr + ("getgroups called with bigger group count�han what " + +264 +__f�tify_fun�i� + + +265 + `__NTH + ( + $g�groups + ( +__size +, +__gid_t + +__li� +[])) + +267 i�( + `__bos + ( +__li� +�!�( +size_t +) -1) + +269 i�(! + `__bu�t�_cڡ�t_p + ( +__size +) || __size < 0) + +270 + `__g�groups_chk + ( +__size +, +__li� +, + `__bos + (__list)); + +272 i�( +__size + * ( +__gid_t +�> + `__bos + ( +__li� +)) + +273 + `__g�groups_chk_w�n + ( +__size +, +__li� +, + `__bos + (__list)); + +275 + `__g�groups_��s + ( +__size +, +__li� +); + +276 + } +} + +279 + $__�y�me_r_chk + ( +__fd +, * +__buf +, +size_t + +__bu� +, + +280 +size_t + +__ėl +� +__THROW + + `__n�nu� + ((2)); + +281 + `__REDIRECT_NTH + ( +__�y�me_r_��s +, ( +__fd +, * +__buf +, + +282 +size_t + +__bu� +), +�y�me_r +) + +283 + `__n�nu� + ((2)); + +284 + `__REDIRECT_NTH + ( +__�y�me_r_chk_w�n +, + +285 ( +__fd +, * +__buf +, +size_t + +__bu� +, + +286 +size_t + +__ėl +), +__�y�me_r_chk +) + +287 + `__n�nu� + ((2)� + `__w�ljr + ("ttyname_r called with bigger buflen�han " + +290 +__f�tify_fun�i� + + +291 + `__NTH + ( + $�y�me_r + ( +__fd +, * +__buf +, +size_t + +__bu� +)) + +293 i�( + `__bos + ( +__buf +�!�( +size_t +) -1) + +295 i�(! + `__bu�t�_cڡ�t_p + ( +__bu� +)) + +296 + `__�y�me_r_chk + ( +__fd +, +__buf +, +__bu� +, + `__bos + (__buf)); + +298 i�( +__bu� + > + `__bos + ( +__buf +)) + +299 + `__�y�me_r_chk_w�n + ( +__fd +, +__buf +, +__bu� +, + `__bos + (__buf)); + +301 + `__�y�me_r_��s + ( +__fd +, +__buf +, +__bu� +); + +302 + } +} + +305 #i� +def�ed + +__USE_REENTRANT + || def�ed +__USE_POSIX199506 + + +306 + $__g�log�_r_chk + (* +__buf +, +size_t + +__bu� +, size_� +__ėl +) + +307 + `__n�nu� + ((1)); + +308 + `__REDIRECT + ( +__g�log�_r_��s +, (* +__buf +, +size_t + +__bu� +), + +309 +g�log�_r +� + `__n�nu� + ((1)); + +310 + `__REDIRECT + ( +__g�log�_r_chk_w�n +, + +311 (* +__buf +, +size_t + +__bu� +, size_� +__ėl +), + +312 +__g�log�_r_chk +) + +313 + `__n�nu� + ((1)� + `__w�ljr + ("getlogin_r called with bigger buflen�han " + +316 +__f�tify_fun�i� + + +317 + $g�log�_r + (* +__buf +, +size_t + +__bu� +) + +319 i�( + `__bos + ( +__buf +�!�( +size_t +) -1) + +321 i�(! + `__bu�t�_cڡ�t_p + ( +__bu� +)) + +322 + `__g�log�_r_chk + ( +__buf +, +__bu� +, + `__bos + (__buf)); + +324 i�( +__bu� + > + `__bos + ( +__buf +)) + +325 + `__g�log�_r_chk_w�n + ( +__buf +, +__bu� +, + `__bos + (__buf)); + +327 + `__g�log�_r_��s + ( +__buf +, +__bu� +); + +328 + } +} + +332 #i� +def�ed + +__USE_BSD + || def�ed +__USE_UNIX98 + + +333 + $__g�ho��me_chk + (* +__buf +, +size_t + +__bu� +, size_� +__ėl +) + +334 +__THROW + + `__n�nu� + ((1)); + +335 + `__REDIRECT_NTH + ( +__g�ho��me_��s +, (* +__buf +, +size_t + +__bu� +), + +336 +g�ho��me +� + `__n�nu� + ((1)); + +337 + `__REDIRECT_NTH + ( +__g�ho��me_chk_w�n +, + +338 (* +__buf +, +size_t + +__bu� +, size_� +__ėl +), + +339 +__g�ho��me_chk +) + +340 + `__n�nu� + ((1)� + `__w�ljr + ("gethostname called with bigger buflen�han " + +343 +__f�tify_fun�i� + + +344 + `__NTH + ( + $g�ho��me + (* +__buf +, +size_t + +__bu� +)) + +346 i�( + `__bos + ( +__buf +�!�( +size_t +) -1) + +348 i�(! + `__bu�t�_cڡ�t_p + ( +__bu� +)) + +349 + `__g�ho��me_chk + ( +__buf +, +__bu� +, + `__bos + (__buf)); + +351 i�( +__bu� + > + `__bos + ( +__buf +)) + +352 + `__g�ho��me_chk_w�n + ( +__buf +, +__bu� +, + `__bos + (__buf)); + +354 + `__g�ho��me_��s + ( +__buf +, +__bu� +); + +355 + } +} + +359 #i� +def�ed + +__USE_BSD + || (def�ed +__USE_XOPEN + && !def�ed +__USE_UNIX98 +) + +360 + $__g�doma��me_chk + (* +__buf +, +size_t + +__bu� +, size_� +__ėl +) + +361 +__THROW + + `__n�nu� + ((1)� +__wur +; + +362 + `__REDIRECT_NTH + ( +__g�doma��me_��s +, (* +__buf +, + +363 +size_t + +__bu� +), + +364 +g�doma��me +� + `__n�nu� + ((1)� +__wur +; + +365 + `__REDIRECT_NTH + ( +__g�doma��me_chk_w�n +, + +366 (* +__buf +, +size_t + +__bu� +, size_� +__ėl +), + +367 +__g�doma��me_chk +) + +368 + `__n�nu� + ((1)� +__wur + + `__w�ljr + ("getdomainname called with bigger " + +372 +__f�tify_fun�i� + + +373 + `__NTH + ( + $g�doma��me + (* +__buf +, +size_t + +__bu� +)) + +375 i�( + `__bos + ( +__buf +�!�( +size_t +) -1) + +377 i�(! + `__bu�t�_cڡ�t_p + ( +__bu� +)) + +378 + `__g�doma��me_chk + ( +__buf +, +__bu� +, + `__bos + (__buf)); + +380 i�( +__bu� + > + `__bos + ( +__buf +)) + +381 + `__g�doma��me_chk_w�n + ( +__buf +, +__bu� +, + `__bos + (__buf)); + +383 + `__g�doma��me_��s + ( +__buf +, +__bu� +); + +384 + } +} + + @/usr/include/bits/waitflags.h + +19 #i�! +def�ed + +_SYS_WAIT_H + && !def�ed +_STDLIB_H + + +25 + #WNOHANG + 1 + + ) + +26 + #WUNTRACED + 2 + + ) + +29 + #WSTOPPED + 2 + + ) + +30 + #WEXITED + 4 + + ) + +31 + #WCONTINUED + 8 + + ) + +32 + #WNOWAIT + 0x01000000 + + ) + +34 + #__WNOTHREAD + 0x20000000 + + ) + +36 + #__WALL + 0x40000000 + + ) + +37 + #__WCLONE + 0x80000000 + + ) + +40 #i� +def�ed + +__USE_SVID + || def�ed +__USE_XOPEN + || def�ed +__USE_XOPEN2K8 + + +41 #i�de� +__ENUM_IDTYPE_T + + +42 + #__ENUM_IDTYPE_T + 1 + + ) + +46 #unde� +P_ALL + + +47 #unde� +P_PID + + +48 #unde� +P_PGID + + +52 + mP_ALL +, + +53 + mP_PID +, + +54 + mP_PGID + + +55 } + tidty�_t +; + + @/usr/include/bits/waitstatus.h + +19 #i�! +def�ed + +_SYS_WAIT_H + && !def�ed +_STDLIB_H + + +28 + #__WEXITSTATUS +( +��us +�(((��us�& 0xff00�>> 8) + + ) + +31 + #__WTERMSIG +( +��us +�((��us�& 0x7f) + + ) + +34 + #__WSTOPSIG +( +��us +� + `__WEXITSTATUS +(��us) + + ) + +37 + #__WIFEXITED +( +��us +�( + `__WTERMSIG +(��us�=�0) + + ) + +40 + #__WIFSIGNALED +( +��us +) \ + +41 (((sig�d �((( +��us +�& 0x7f�+ 1�>> 1�> 0) + + ) + +44 + #__WIFSTOPPED +( +��us +�(((��us�& 0xff�=�0x7f) + + ) + +48 #ifde� +WCONTINUED + + +49 + #__WIFCONTINUED +( +��us +�((��us�=� +__W_CONTINUED +) + + ) + +53 + #__WCOREDUMP +( +��us +�((��us�& +__WCOREFLAG +) + + ) + +56 + #__W_EXITCODE +( +�t +, +sig +�(ԑ�<< 8 | (sig)) + + ) + +57 + #__W_STOPCODE +( +sig +�((sig�<< 8 | 0x7f) + + ) + +58 + #__W_CONTINUED + 0xffff + + ) + +59 + #__WCOREFLAG + 0x80 + + ) + +62 #ifdef +__USE_BSD + + +64 + ~<�d�n.h +> + +66 + uwa� + + +68 + mw_��us +; + +71 #if +__BYTE_ORDER + =� +__LITTLE_ENDIAN + + +72 + m__w_�rmsig +:7; + +73 + m__w_c�edump +:1; + +74 + m__w_�tcode +:8; + +77 #if +__BYTE_ORDER + =� +__BIG_ENDIAN + + +79 + m__w_�tcode +:8; + +80 + m__w_c�edump +:1; + +81 + m__w_�rmsig +:7; + +83 } + m__wa�_�rm��ed +; + +86 #if +__BYTE_ORDER + =� +__LITTLE_ENDIAN + + +87 + m__w_��v� +:8; + +88 + m__w_��sig +:8; + +91 #if +__BYTE_ORDER + =� +__BIG_ENDIAN + + +93 + m__w_��sig +:8; + +94 + m__w_��v� +:8; + +96 } + m__wa�_�ݳd +; + +99 + #w_�rmsig + +__wa�_�rm��ed +. +__w_�rmsig + + + ) + +100 + #w_c�edump + +__wa�_�rm��ed +. +__w_c�edump + + + ) + +101 + #w_�tcode + +__wa�_�rm��ed +. +__w_�tcode + + + ) + +102 + #w_��sig + +__wa�_�ݳd +. +__w_��sig + + + ) + +103 + #w_��v� + +__wa�_�ݳd +. +__w_��v� + + + ) + + @/usr/include/bits/wchar.h + +19 #i�de� +_BITS_WCHAR_H + + +20 + #_BITS_WCHAR_H + 1 + + ) + +33 #ifde� +__WCHAR_MAX__ + + +34 + #__WCHAR_MAX + +__WCHAR_MAX__ + + + ) + +35 #�i� +L +'\0' - 1 > 0 + +36 + #__WCHAR_MAX + (0xffffffffu + +L +'\0') + + ) + +38 + #__WCHAR_MAX + (0x7ffffff�+ +L +'\0') + + ) + +41 #ifde� +__WCHAR_MIN__ + + +42 + #__WCHAR_MIN + +__WCHAR_MIN__ + + + ) + +43 #�i� +L +'\0' - 1 > 0 + +44 + #__WCHAR_MIN + ( +L +'\0' + 0) + + ) + +46 + #__WCHAR_MIN + (- +__WCHAR_MAX + - 1) + + ) + + @/usr/include/bits/wordsize.h + +3 #i� +def�ed + +__x86_64__ + && !def�ed +__ILP32__ + + +4 + #__WORDSIZE + 64 + + ) + +6 + #__WORDSIZE + 32 + + ) + +9 #ifde� +__x86_64__ + + +10 + #__WORDSIZE_TIME64_COMPAT32 + 1 + + ) + +12 + #__SYSCALL_WORDSIZE + 64 + + ) + + @/usr/include/bits/xopen_lim.h + +29 #i�de� +_XOPEN_LIM_H + + +30 + #_XOPEN_LIM_H + 1 + + ) + +32 + #__�ed_IOV_MAX + + + ) + +33 + ~<b�s/�dio_lim.h +> + +65 + #_XOPEN_IOV_MAX + +_POSIX_UIO_MAXIOV + + + ) + +70 + #NL_ARGMAX + +_POSIX_ARG_MAX + + + ) + +73 + #NL_LANGMAX + +_POSIX2_LINE_MAX + + + ) + +76 + #NL_MSGMAX + +INT_MAX + + + ) + +80 + #NL_NMAX + +INT_MAX + + + ) + +83 + #NL_SETMAX + +INT_MAX + + + ) + +86 + #NL_TEXTMAX + +INT_MAX + + + ) + +89 + #NZERO + 20 + + ) + +93 #ifde� +INT_MAX + + +94 #i� +INT_MAX + == 32767 + +95 + #WORD_BIT + 16 + + ) + +97 #i� +INT_MAX + == 2147483647 + +98 + #WORD_BIT + 32 + + ) + +101 + #WORD_BIT + 64 + + ) + +104 #�i� +def�ed + +__INT_MAX__ + + +105 #i� +__INT_MAX__ + == 32767 + +106 + #WORD_BIT + 16 + + ) + +108 #i� +__INT_MAX__ + == 2147483647 + +109 + #WORD_BIT + 32 + + ) + +112 + #WORD_BIT + 64 + + ) + +116 + #WORD_BIT + 32 + + ) + +120 #ifde� +LONG_MAX + + +121 #i� +LONG_MAX + == 2147483647 + +122 + #LONG_BIT + 32 + + ) + +125 + #LONG_BIT + 64 + + ) + +127 #�i� +def�ed + +__LONG_MAX__ + + +128 #i� +__LONG_MAX__ + == 2147483647 + +129 + #LONG_BIT + 32 + + ) + +132 + #LONG_BIT + 64 + + ) + +135 + ~<b�s/w�dsize.h +> + +136 #i� +__WORDSIZE + == 64 + +137 + #LONG_BIT + 64 + + ) + +139 + #LONG_BIT + 32 + + ) + + @/usr/include/endian.h + +18 #i�def +_ENDIAN_H + + +19 + #_ENDIAN_H + 1 + + ) + +21 + ~<�u�s.h +> + +31 + #__LITTLE_ENDIAN + 1234 + + ) + +32 + #__BIG_ENDIAN + 4321 + + ) + +33 + #__PDP_ENDIAN + 3412 + + ) + +36 + ~<b�s/�d�n.h +> + +40 #i�de� +__FLOAT_WORD_ORDER + + +41 + #__FLOAT_WORD_ORDER + +__BYTE_ORDER + + + ) + +44 #ifdef +__USE_BSD + + +45 + #LITTLE_ENDIAN + +__LITTLE_ENDIAN + + + ) + +46 + #BIG_ENDIAN + +__BIG_ENDIAN + + + ) + +47 + #PDP_ENDIAN + +__PDP_ENDIAN + + + ) + +48 + #BYTE_ORDER + +__BYTE_ORDER + + + ) + +51 #i� +__BYTE_ORDER + =� +__LITTLE_ENDIAN + + +52 + #__LONG_LONG_PAIR +( +HI +, +LO +�LO, + ) +HI + +53 #�i� +__BYTE_ORDER + =� +__BIG_ENDIAN + + +54 + #__LONG_LONG_PAIR +( +HI +, +LO +�HI, + ) +LO + +58 #i� +def�ed + +__USE_BSD + && !def�ed +__ASSEMBLER__ + + +60 + ~<b�s/by�sw�.h +> + +62 #i� +__BYTE_ORDER + =� +__LITTLE_ENDIAN + + +63 + #htobe16 +( +x +� + `__bsw�_16 + (x) + + ) + +64 + #ht�e16 +( +x +�(x) + + ) + +65 + #be16toh +( +x +� + `__bsw�_16 + (x) + + ) + +66 + #�16toh +( +x +�(x) + + ) + +68 + #htobe32 +( +x +� + `__bsw�_32 + (x) + + ) + +69 + #ht�e32 +( +x +�(x) + + ) + +70 + #be32toh +( +x +� + `__bsw�_32 + (x) + + ) + +71 + #�32toh +( +x +�(x) + + ) + +73 + #htobe64 +( +x +� + `__bsw�_64 + (x) + + ) + +74 + #ht�e64 +( +x +�(x) + + ) + +75 + #be64toh +( +x +� + `__bsw�_64 + (x) + + ) + +76 + #�64toh +( +x +�(x) + + ) + +79 + #htobe16 +( +x +�(x) + + ) + +80 + #ht�e16 +( +x +� + `__bsw�_16 + (x) + + ) + +81 + #be16toh +( +x +�(x) + + ) + +82 + #�16toh +( +x +� + `__bsw�_16 + (x) + + ) + +84 + #htobe32 +( +x +�(x) + + ) + +85 + #ht�e32 +( +x +� + `__bsw�_32 + (x) + + ) + +86 + #be32toh +( +x +�(x) + + ) + +87 + #�32toh +( +x +� + `__bsw�_32 + (x) + + ) + +89 + #htobe64 +( +x +�(x) + + ) + +90 + #ht�e64 +( +x +� + `__bsw�_64 + (x) + + ) + +91 + #be64toh +( +x +�(x) + + ) + +92 + #�64toh +( +x +� + `__bsw�_64 + (x) + + ) + + @/usr/include/features.h + +18 #i�def +_FEATURES_H + + +19 + #_FEATURES_H + 1 + + ) + +101 #unde� +__USE_ISOC11 + + +102 #unde� +__USE_ISOC99 + + +103 #unde� +__USE_ISOC95 + + +104 #unde� +__USE_ISOCXX11 + + +105 #unde� +__USE_POSIX + + +106 #unde� +__USE_POSIX2 + + +107 #unde� +__USE_POSIX199309 + + +108 #unde� +__USE_POSIX199506 + + +109 #unde� +__USE_XOPEN + + +110 #unde� +__USE_XOPEN_EXTENDED + + +111 #unde� +__USE_UNIX98 + + +112 #unde� +__USE_XOPEN2K + + +113 #unde� +__USE_XOPEN2KXSI + + +114 #unde� +__USE_XOPEN2K8 + + +115 #unde� +__USE_XOPEN2K8XSI + + +116 #unde� +__USE_LARGEFILE + + +117 #unde� +__USE_LARGEFILE64 + + +118 #unde� +__USE_FILE_OFFSET64 + + +119 #unde� +__USE_BSD + + +120 #unde� +__USE_SVID + + +121 #unde� +__USE_MISC + + +122 #unde� +__USE_ATFILE + + +123 #unde� +__USE_GNU + + +124 #unde� +__USE_REENTRANT + + +125 #unde� +__USE_FORTIFY_LEVEL + + +126 #unde� +__KERNEL_STRICT_NAMES + + +130 #i�de� +_LOOSE_KERNEL_NAMES + + +131 + #__KERNEL_STRICT_NAMES + + + ) + +141 #i� +def�ed + +__GNUC__ + && def�ed +__GNUC_MINOR__ + + +142 + #__GNUC_PREREQ +( +maj +, +m� +) \ + +143 (( +__GNUC__ + << 16�+ +__GNUC_MINOR__ + >�(( +maj +�<< 16�+ ( +m� +)) + + ) + +145 + #__GNUC_PREREQ +( +maj +, +m� +�0 + + ) + +150 #ifde� +_GNU_SOURCE + + +151 #unde� +_ISOC95_SOURCE + + +152 + #_ISOC95_SOURCE + 1 + + ) + +153 #unde� +_ISOC99_SOURCE + + +154 + #_ISOC99_SOURCE + 1 + + ) + +155 #unde� +_ISOC11_SOURCE + + +156 + #_ISOC11_SOURCE + 1 + + ) + +157 #unde� +_POSIX_SOURCE + + +158 + #_POSIX_SOURCE + 1 + + ) + +159 #unde� +_POSIX_C_SOURCE + + +160 + #_POSIX_C_SOURCE + 200809L + + ) + +161 #unde� +_XOPEN_SOURCE + + +162 + #_XOPEN_SOURCE + 700 + + ) + +163 #unde� +_XOPEN_SOURCE_EXTENDED + + +164 + #_XOPEN_SOURCE_EXTENDED + 1 + + ) + +165 #unde� +_LARGEFILE64_SOURCE + + +166 + #_LARGEFILE64_SOURCE + 1 + + ) + +167 #unde� +_DEFAULT_SOURCE + + +168 + #_DEFAULT_SOURCE + 1 + + ) + +169 #unde� +_BSD_SOURCE + + +170 + #_BSD_SOURCE + 1 + + ) + +171 #unde� +_SVID_SOURCE + + +172 + #_SVID_SOURCE + 1 + + ) + +173 #unde� +_ATFILE_SOURCE + + +174 + #_ATFILE_SOURCE + 1 + + ) + +179 #i�( +def�ed + +_DEFAULT_SOURCE + \ + +180 || (! +def�ed + + g__STRICT_ANSI__ + \ + +181 && ! +def�ed + + g_ISOC99_SOURCE + \ + +182 && ! +def�ed + + g_POSIX_SOURCE + && !def�ed + g_POSIX_C_SOURCE + \ + +183 && ! +def�ed + + g_XOPEN_SOURCE + \ + +184 && ! +def�ed + + g_BSD_SOURCE + && !def�ed + g_SVID_SOURCE +)) + +185 #unde� +_DEFAULT_SOURCE + + +186 + #_DEFAULT_SOURCE + 1 + + ) + +187 #unde� +_BSD_SOURCE + + +188 + #_BSD_SOURCE + 1 + + ) + +189 #unde� +_SVID_SOURCE + + +190 + #_SVID_SOURCE + 1 + + ) + +194 #i�( +def�ed + +_ISOC11_SOURCE + \ + +195 || ( +def�ed + + g__STDC_VERSION__ + && __STDC_VERSION__ >= 201112L)) + +196 + #__USE_ISOC11 + 1 + + ) + +200 #i�( +def�ed + +_ISOC99_SOURCE + || def�ed +_ISOC11_SOURCE + \ + +201 || ( +def�ed + +__STDC_VERSION__ + && __STDC_VERSION__ >= 199901L)) + +202 + #__USE_ISOC99 + 1 + + ) + +206 #i�( +def�ed + +_ISOC99_SOURCE + || def�ed +_ISOC11_SOURCE + \ + +207 || ( +def�ed + +__STDC_VERSION__ + && __STDC_VERSION__ >= 199409L)) + +208 + #__USE_ISOC95 + 1 + + ) + +215 #i�(( +def�ed + +__�lu�lus + && __cplusplus >= 201103L) \ + +216 || +def�ed + +__GXX_EXPERIMENTAL_CXX0X__ +) + +217 + #__USE_ISOCXX11 + 1 + + ) + +223 #ifde� +_DEFAULT_SOURCE + + +224 #i�! +def�ed + +_POSIX_SOURCE + && !def�ed +_POSIX_C_SOURCE + + +225 + #__USE_POSIX_IMPLICITLY + 1 + + ) + +227 #unde� +_POSIX_SOURCE + + +228 + #_POSIX_SOURCE + 1 + + ) + +229 #unde� +_POSIX_C_SOURCE + + +230 + #_POSIX_C_SOURCE + 200809L + + ) + +232 #i�((! +def�ed + +__STRICT_ANSI__ + || ( +_XOPEN_SOURCE + - 0) >= 500) && \ + +233 ! +def�ed + +_POSIX_SOURCE + && !def�ed +_POSIX_C_SOURCE +) + +234 + #_POSIX_SOURCE + 1 + + ) + +235 #i� +def�ed + +_XOPEN_SOURCE + && (_XOPEN_SOURCE - 0) < 500 + +236 + #_POSIX_C_SOURCE + 2 + + ) + +237 #�i� +def�ed + +_XOPEN_SOURCE + && (_XOPEN_SOURCE - 0) < 600 + +238 + #_POSIX_C_SOURCE + 199506L + + ) + +239 #�i� +def�ed + +_XOPEN_SOURCE + && (_XOPEN_SOURCE - 0) < 700 + +240 + #_POSIX_C_SOURCE + 200112L + + ) + +242 + #_POSIX_C_SOURCE + 200809L + + ) + +244 + #__USE_POSIX_IMPLICITLY + 1 + + ) + +247 #i� +def�ed + +_POSIX_SOURCE + || +_POSIX_C_SOURCE + >�1 || def�ed +_XOPEN_SOURCE + + +248 + #__USE_POSIX + 1 + + ) + +251 #i� +def�ed + +_POSIX_C_SOURCE + && _POSIX_C_SOURCE >�2 || def�ed +_XOPEN_SOURCE + + +252 + #__USE_POSIX2 + 1 + + ) + +255 #i�( +_POSIX_C_SOURCE + - 0) >= 199309L + +256 + #__USE_POSIX199309 + 1 + + ) + +259 #i�( +_POSIX_C_SOURCE + - 0) >= 199506L + +260 + #__USE_POSIX199506 + 1 + + ) + +263 #i�( +_POSIX_C_SOURCE + - 0) >= 200112L + +264 + #__USE_XOPEN2K + 1 + + ) + +265 #unde� +__USE_ISOC95 + + +266 + #__USE_ISOC95 + 1 + + ) + +267 #unde� +__USE_ISOC99 + + +268 + #__USE_ISOC99 + 1 + + ) + +271 #i�( +_POSIX_C_SOURCE + - 0) >= 200809L + +272 + #__USE_XOPEN2K8 + 1 + + ) + +273 #unde� +_ATFILE_SOURCE + + +274 + #_ATFILE_SOURCE + 1 + + ) + +277 #ifdef +_XOPEN_SOURCE + + +278 + #__USE_XOPEN + 1 + + ) + +279 #i�( +_XOPEN_SOURCE + - 0) >= 500 + +280 + #__USE_XOPEN_EXTENDED + 1 + + ) + +281 + #__USE_UNIX98 + 1 + + ) + +282 #unde� +_LARGEFILE_SOURCE + + +283 + #_LARGEFILE_SOURCE + 1 + + ) + +284 #i�( +_XOPEN_SOURCE + - 0) >= 600 + +285 #i�( +_XOPEN_SOURCE + - 0) >= 700 + +286 + #__USE_XOPEN2K8 + 1 + + ) + +287 + #__USE_XOPEN2K8XSI + 1 + + ) + +289 + #__USE_XOPEN2K + 1 + + ) + +290 + #__USE_XOPEN2KXSI + 1 + + ) + +291 #unde� +__USE_ISOC95 + + +292 + #__USE_ISOC95 + 1 + + ) + +293 #unde� +__USE_ISOC99 + + +294 + #__USE_ISOC99 + 1 + + ) + +297 #ifde� +_XOPEN_SOURCE_EXTENDED + + +298 + #__USE_XOPEN_EXTENDED + 1 + + ) + +303 #ifde� +_LARGEFILE_SOURCE + + +304 + #__USE_LARGEFILE + 1 + + ) + +307 #ifde� +_LARGEFILE64_SOURCE + + +308 + #__USE_LARGEFILE64 + 1 + + ) + +311 #i� +def�ed + +_FILE_OFFSET_BITS + && _FILE_OFFSET_BITS == 64 + +312 + #__USE_FILE_OFFSET64 + 1 + + ) + +315 #i� +def�ed + +_BSD_SOURCE + || def�ed +_SVID_SOURCE + + +316 + #__USE_MISC + 1 + + ) + +319 #ifdef +_BSD_SOURCE + + +320 + #__USE_BSD + 1 + + ) + +323 #ifdef +_SVID_SOURCE + + +324 + #__USE_SVID + 1 + + ) + +327 #ifdef +_ATFILE_SOURCE + + +328 + #__USE_ATFILE + 1 + + ) + +331 #ifdef +_GNU_SOURCE + + +332 + #__USE_GNU + 1 + + ) + +335 #i� +def�ed + +_REENTRANT + || def�ed +_THREAD_SAFE + + +336 + #__USE_REENTRANT + 1 + + ) + +339 #i� +def�ed + +_FORTIFY_SOURCE + && _FORTIFY_SOURCE > 0 \ + +340 && +__GNUC_PREREQ + (4, 1�&& +def�ed + + g__OPTIMIZE__ + && __OPTIMIZE__ > 0 + +341 #i� +_FORTIFY_SOURCE + > 1 + +342 + #__USE_FORTIFY_LEVEL + 2 + + ) + +344 + #__USE_FORTIFY_LEVEL + 1 + + ) + +347 + #__USE_FORTIFY_LEVEL + 0 + + ) + +352 + ~<�dc-�edef.h +> + +360 #unde� +__GNU_LIBRARY__ + + +361 + #__GNU_LIBRARY__ + 6 + + ) + +365 + #__GLIBC__ + 2 + + ) + +366 + #__GLIBC_MINOR__ + 19 + + ) + +368 + #__GLIBC_PREREQ +( +maj +, +m� +) \ + +369 (( +__GLIBC__ + << 16�+ +__GLIBC_MINOR__ + >�(( +maj +�<< 16�+ ( +m� +)) + + ) + +372 #i�de� +__ASSEMBLER__ + + +373 #i�de� +_SYS_CDEFS_H + + +374 + ~<sys/cdefs.h +> + +379 #i� +def�ed + +__USE_FILE_OFFSET64 + && !def�ed +__REDIRECT + + +380 + #__USE_LARGEFILE + 1 + + ) + +381 + #__USE_LARGEFILE64 + 1 + + ) + +387 #i� +__GNUC_PREREQ + (2, 7�&& +def�ed + +__OPTIMIZE__ + \ + +388 && ! +def�ed + + g__OPTIMIZE_SIZE__ + && !def�ed + g__NO_INLINE__ + \ + +389 && +def�ed + + g__ex��_�l�e + + +390 + #__USE_EXTERN_INLINES + 1 + + ) + +398 + ~<gnu/�ubs.h +> + + @/usr/include/getopt.h + +19 #i�de� +_GETOPT_H + + +21 #i�de� +__�ed_g��t + + +22 + #_GETOPT_H + 1 + + ) + +32 #i�! +def�ed + +__GNU_LIBRARY__ + + +33 + ~<�y�.h +> + +36 #i�de� +__THROW + + +37 #i�de� +__GNUC_PREREQ + + +38 + #__GNUC_PREREQ +( +maj +, +m� +�(0) + + ) + +40 #i� +def�ed + +__�lu�lus + && +__GNUC_PREREQ + (2,8) + +41 + #__THROW + + `throw + () + + ) + +43 + #__THROW + + + ) + +47 #ifdef +__�lu�lus + + +57 * +ݏrg +; + +71 +�t�d +; + +76 +� +; + +80 +�t�t +; + +82 #i�de� +__�ed_g��t + + +104 + s�ti� + + +106 cڡ * + g�me +; + +109 + ghas_�g +; + +110 * + g�ag +; + +111 + gv� +; + +116 + #no_�gum�t + 0 + + ) + +117 + #�qu�ed_�gum�t + 1 + + ) + +118 + #�tiڮ_�gum�t + 2 + + ) + +146 #ifde� +__GNU_LIBRARY__ + + +150 +g��t + ( +___�gc +, *cڡ * +___�gv +, cڡ * +__sh�t�ts +) + +151 +__THROW +; + +153 #i� +def�ed + +__�ed_g��t + && def�ed +__USE_POSIX2 + \ + +154 && ! +def�ed + + g__USE_POSIX_IMPLICITLY + && !def�ed + g__USE_GNU + + +158 #ifde� +__REDIRECT + + +159 +__REDIRECT_NTH + ( +g��t +, ( +___�gc +, *cڡ * +___�gv +, + +160 cڡ * +__sh�t�ts +), + +161 +__posix_g��t +); + +163 +__posix_g��t + ( +___�gc +, *cڡ * +___�gv +, + +164 cڡ * +__sh�t�ts +� +__THROW +; + +165 + #g��t + +__posix_g��t + + + ) + +169 +g��t + (); + +172 #i�de� +__�ed_g��t + + +173 +g��t_l�g + ( +___�gc +, *cڡ * +___�gv +, + +174 cڡ * +__sh�t�ts +, + +175 cڡ +�ti� + * +__l�g�ts +, * +__l�g�d +) + +176 +__THROW +; + +177 +g��t_l�g_�ly + ( +___�gc +, *cڡ * +___�gv +, + +178 cڡ * +__sh�t�ts +, + +179 cڡ +�ti� + * +__l�g�ts +, * +__l�g�d +) + +180 +__THROW +; + +184 #ifdef +__�lu�lus + + +189 #unde� +__�ed_g��t + + + @/usr/include/libio.h + +28 #i�de� +_IO_STDIO_H + + +29 + #_IO_STDIO_H + + + ) + +31 + ~<_G_c�fig.h +> + +33 + #_IO_�os_t + +_G_�os_t + + + ) + +34 + #_IO_�os64_t + +_G_�os64_t + + + ) + +35 + #_IO_size_t + +size_t + + + ) + +36 + #_IO_ssize_t + +__ssize_t + + + ) + +37 + #_IO_off_t + +__off_t + + + ) + +38 + #_IO_off64_t + +__off64_t + + + ) + +39 + #_IO_pid_t + +__pid_t + + + ) + +40 + #_IO_uid_t + +__uid_t + + + ) + +41 + #_IO_ic�v_t + +_G_ic�v_t + + + ) + +42 + #_IO_HAVE_ST_BLKSIZE + +_G_HAVE_ST_BLKSIZE + + + ) + +43 + #_IO_BUFSIZ + +_G_BUFSIZ + + + ) + +44 + #_IO_va_li� + +_G_va_li� + + + ) + +45 + #_IO_w�t_t + +w�t_t + + + ) + +48 + #__�ed___va_li� + + + ) + +49 + ~<�d�g.h +> + +50 #ifde� +__GNUC_VA_LIST + + +51 #unde� +_IO_va_li� + + +52 + #_IO_va_li� + +__gnuc_va_li� + + + ) + +55 #i�de� +__P + + +56 + ~<sys/cdefs.h +> + +59 + #_IO_UNIFIED_JUMPTABLES + 1 + + ) + +61 #i�de� +EOF + + +62 + #EOF + (-1) + + ) + +64 #i�de� +NULL + + +65 #i� +def�ed + +__GNUG__ + && \ + +66 ( + g__GNUC__ + > 2 || (__GNUC__ =�2 && +__GNUC_MINOR__ + >= 8)) + +67 + #NULL + ( +__nu� +) + + ) + +69 #i�! +def�ed +( +__�lu�lus +) + +70 + #NULL + ((*)0) + + ) + +72 + #NULL + (0) + + ) + +77 + #_IOS_INPUT + 1 + + ) + +78 + #_IOS_OUTPUT + 2 + + ) + +79 + #_IOS_ATEND + 4 + + ) + +80 + #_IOS_APPEND + 8 + + ) + +81 + #_IOS_TRUNC + 16 + + ) + +82 + #_IOS_NOCREATE + 32 + + ) + +83 + #_IOS_NOREPLACE + 64 + + ) + +84 + #_IOS_BIN + 128 + + ) + +92 + #_IO_MAGIC + 0xFBAD0000 + + ) + +93 + #_OLD_STDIO_MAGIC + 0xFABC0000 + + ) + +94 + #_IO_MAGIC_MASK + 0xFFFF0000 + + ) + +95 + #_IO_USER_BUF + 1 + + ) + +96 + #_IO_UNBUFFERED + 2 + + ) + +97 + #_IO_NO_READS + 4 + + ) + +98 + #_IO_NO_WRITES + 8 + + ) + +99 + #_IO_EOF_SEEN + 0x10 + + ) + +100 + #_IO_ERR_SEEN + 0x20 + + ) + +101 + #_IO_DELETE_DONT_CLOSE + 0x40 + + ) + +102 + #_IO_LINKED + 0x80 + + ) + +103 + #_IO_IN_BACKUP + 0x100 + + ) + +104 + #_IO_LINE_BUF + 0x200 + + ) + +105 + #_IO_TIED_PUT_GET + 0x400 + + ) + +106 + #_IO_CURRENTLY_PUTTING + 0x800 + + ) + +107 + #_IO_IS_APPENDING + 0x1000 + + ) + +108 + #_IO_IS_FILEBUF + 0x2000 + + ) + +109 + #_IO_BAD_SEEN + 0x4000 + + ) + +110 + #_IO_USER_LOCK + 0x8000 + + ) + +112 + #_IO_FLAGS2_MMAP + 1 + + ) + +113 + #_IO_FLAGS2_NOTCANCEL + 2 + + ) + +114 #ifde� +_LIBC + + +115 + #_IO_FLAGS2_FORTIFY + 4 + + ) + +117 + #_IO_FLAGS2_USER_WBUF + 8 + + ) + +118 #ifde� +_LIBC + + +119 + #_IO_FLAGS2_SCANF_STD + 16 + + ) + +120 + #_IO_FLAGS2_NOCLOSE + 32 + + ) + +121 + #_IO_FLAGS2_CLOEXEC + 64 + + ) + +125 + #_IO_SKIPWS + 01 + + ) + +126 + #_IO_LEFT + 02 + + ) + +127 + #_IO_RIGHT + 04 + + ) + +128 + #_IO_INTERNAL + 010 + + ) + +129 + #_IO_DEC + 020 + + ) + +130 + #_IO_OCT + 040 + + ) + +131 + #_IO_HEX + 0100 + + ) + +132 + #_IO_SHOWBASE + 0200 + + ) + +133 + #_IO_SHOWPOINT + 0400 + + ) + +134 + #_IO_UPPERCASE + 01000 + + ) + +135 + #_IO_SHOWPOS + 02000 + + ) + +136 + #_IO_SCIENTIFIC + 04000 + + ) + +137 + #_IO_FIXED + 010000 + + ) + +138 + #_IO_UNITBUF + 020000 + + ) + +139 + #_IO_STDIO + 040000 + + ) + +140 + #_IO_DONT_CLOSE + 0100000 + + ) + +141 + #_IO_BOOLALPHA + 0200000 + + ) + +144 +_IO_jump_t +; + g_IO_FILE +; + +147 #ifde� +_IO_MTSAFE_IO + + +148 #i� +def�ed + +__GLIBC__ + && __GLIBC__ >= 2 + +149 + ~<b�s/�dio-lock.h +> + +154 + t_IO_lock_t +; + +160 + s_IO_m�k� + { + +161 +_IO_m�k� + * + m_�xt +; + +162 +_IO_FILE + * + m_sbuf +; + +166 + m_pos +; + +168 +�t_��ampos +( +��ampos + +� +�{ + m_�os + = sp; } + +169 +�t_off�t +( +off�t +�{ + m_pos + = off�t; + m_�os + = ( +��ampos +)(-2); } + +170 + mpublic +: + +171 +��amm�k� +( +��ambuf + * +sb +); + +172 ~ +��amm�k� +(); + +173 +�v�g +(�{ + m_�os + == -2; } + +174 +d�� +( +��amm�k� +&); + +175 +d�� +(); + +180 + e__codecvt_�su� + + +182 + m__codecvt_ok +, + +183 + m__codecvt_���l +, + +184 + m__codecvt_�r� +, + +185 + m__codecvt_noc�v + + +188 #i� +def�ed + +_LIBC + || def�ed +_GLIBCPP_USE_WCHAR_T + + +191 + s_IO_codecvt + + +193 (* + m__codecvt_de�r +�( + m_IO_codecvt + *); + +194 +__codecvt_�su� + (* +__codecvt_do_out +�( + m_IO_codecvt + *, + +195 + m__mb��e_t + *, + +196 cڡ + mwch�_t + *, + +197 cڡ + mwch�_t + *, + +198 cڡ + mwch�_t + **, *, + +200 +__codecvt_�su� + (* +__codecvt_do_unshi� +�( + m_IO_codecvt + *, + +201 + m__mb��e_t + *, *, + +203 +__codecvt_�su� + (* +__codecvt_do_� +�( + m_IO_codecvt + *, + +204 + m__mb��e_t + *, + +206 cڡ **, + mwch�_t + *, + +207 + mwch�_t + *, wchar_t **); + +208 (* + m__codecvt_do_�cod�g +�( + m_IO_codecvt + *); + +209 (* + m__codecvt_do_�ways_noc�v +�( + m_IO_codecvt + *); + +210 (* + m__codecvt_do_�ngth +�( + m_IO_codecvt + *, + m__mb��e_t + *, + +211 cڡ *, cڡ *, + m_IO_size_t +); + +212 (* + m__codecvt_do_max_�ngth +�( + m_IO_codecvt + *); + +214 +_IO_ic�v_t + + m__cd_� +; + +215 +_IO_ic�v_t + + m__cd_out +; + +219 + s_IO_wide_d�a + + +221 +wch�_t + * + m_IO_�ad_�r +; + +222 +wch�_t + * + m_IO_�ad_�d +; + +223 +wch�_t + * + m_IO_�ad_ba� +; + +224 +wch�_t + * + m_IO_wr�e_ba� +; + +225 +wch�_t + * + m_IO_wr�e_�r +; + +226 +wch�_t + * + m_IO_wr�e_�d +; + +227 +wch�_t + * + m_IO_buf_ba� +; + +228 +wch�_t + * + m_IO_buf_�d +; + +230 +wch�_t + * + m_IO_�ve_ba� +; + +231 +wch�_t + * + m_IO_backup_ba� +; + +233 +wch�_t + * + m_IO_�ve_�d +; + +235 +__mb��e_t + + m_IO_��e +; + +236 +__mb��e_t + + m_IO_ϡ_��e +; + +237 +_IO_codecvt + + m_codecvt +; + +239 +wch�_t + + m_sh�tbuf +[1]; + +241 cڡ +_IO_jump_t + * + m_wide_v�b� +; + +245 + s_IO_FILE + { + +246 + m_�ags +; + +247 + #_IO_f�e_�ags + +_�ags + + + ) + +251 * + m_IO_�ad_�r +; + +252 * + m_IO_�ad_�d +; + +253 * + m_IO_�ad_ba� +; + +254 * + m_IO_wr�e_ba� +; + +255 * + m_IO_wr�e_�r +; + +256 * + m_IO_wr�e_�d +; + +257 * + m_IO_buf_ba� +; + +258 * + m_IO_buf_�d +; + +260 * + m_IO_�ve_ba� +; + +261 * + m_IO_backup_ba� +; + +262 * + m_IO_�ve_�d +; + +264 +_IO_m�k� + * + m_m�k�s +; + +266 +_IO_FILE + * + m_cha� +; + +268 + m_f��o +; + +270 + m_blksize +; + +272 + m_�ags2 +; + +274 +_IO_off_t + + m_�d_off�t +; + +276 + #__HAVE_COLUMN + + + ) + +278 + m_cur_c�umn +; + +279 sig�d + m_v�b�_off�t +; + +280 + m_sh�tbuf +[1]; + +284 +_IO_lock_t + * + m_lock +; + +285 #ifde� +_IO_USE_OLD_IO_FILE + + +288 + s_IO_FILE_com��e + + +290 +_IO_FILE + + m_f�e +; + +292 #i� +def�ed + +_G_IO_IO_FILE_VERSION + && _G_IO_IO_FILE_VERSION == 0x20001 + +293 +_IO_off64_t + + m_off�t +; + +294 #i� +def�ed + +_LIBC + || def�ed +_GLIBCPP_USE_WCHAR_T + + +296 +_IO_codecvt + * + m_codecvt +; + +297 +_IO_wide_d�a + * + m_wide_d�a +; + +298 +_IO_FILE + * + m_䓻s_li� +; + +299 * + m_䓻s_buf +; + +300 +size_t + + m_䓻s_size +; + +302 * + m__�d1 +; + +303 * + m__�d2 +; + +304 * + m__�d3 +; + +305 * + m__�d4 +; + +306 +size_t + + m__�d5 +; + +308 + m_mode +; + +310 + m_unu�d2 +[15 * (�- 4 * (*�- ( +size_t +)]; + +314 #i�de� +__�lu�lus + + +315 +_IO_FILE + + t_IO_FILE +; + +318 + g_IO_FILE_�us +; + +320 +_IO_FILE_�us + +_IO_2_1_�d�_ +; + +321 +_IO_FILE_�us + +_IO_2_1_�dout_ +; + +322 +_IO_FILE_�us + +_IO_2_1_�d�r_ +; + +323 #i�de� +_LIBC + + +324 + #_IO_�d� + (( +_IO_FILE +*)(& +_IO_2_1_�d�_ +)) + + ) + +325 + #_IO_�dout + (( +_IO_FILE +*)(& +_IO_2_1_�dout_ +)) + + ) + +326 + #_IO_�d�r + (( +_IO_FILE +*)(& +_IO_2_1_�d�r_ +)) + + ) + +328 +_IO_FILE + * +_IO_�d� + +��ibu�_hidd� +; + +329 +_IO_FILE + * +_IO_�dout + +��ibu�_hidd� +; + +330 +_IO_FILE + * +_IO_�d�r + +��ibu�_hidd� +; + +338 +__ssize_t + + t__io_�ad_� + (* + t__cook� +, * + t__buf +, + tsize_t + + t__nby�s +); + +346 +__ssize_t + + t__io_wr�e_� + (* + t__cook� +, cڡ * + t__buf +, + +347 + tsize_t + + t__n +); + +355 + t__io_�ek_� + (* + t__cook� +, + t_IO_off64_t + * + t__pos +, + t__w +); + +358 + t__io_�o�_� + (* + t__cook� +); + +361 #ifde� +_GNU_SOURCE + + +363 +__io_�ad_� + + tcook�_�ad_fun�i�_t +; + +364 +__io_wr�e_� + + tcook�_wr�e_fun�i�_t +; + +365 +__io_�ek_� + + tcook�_�ek_fun�i�_t +; + +366 +__io_�o�_� + + tcook�_�o�_fun�i�_t +; + +371 +__io_�ad_� + * + m�ad +; + +372 +__io_wr�e_� + * + mwr�e +; + +373 +__io_�ek_� + * + m�ek +; + +374 +__io_�o�_� + * + m�o� +; + +375 } + t_IO_cook�_io_fun�i�s_t +; + +376 +_IO_cook�_io_fun�i�s_t + + tcook�_io_fun�i�s_t +; + +378 + g_IO_cook�_f�e +; + +381 +_IO_cook�_�� + ( +_IO_cook�_f�e + * +__cf�e +, +__�ad_wr�e +, + +382 * +__cook� +, +_IO_cook�_io_fun�i�s_t + +__�s +); + +386 #ifde� +__�lu�lus + + +390 +__und��ow + ( +_IO_FILE + *); + +391 +__u�ow + ( +_IO_FILE + *); + +392 +__ov��ow + ( +_IO_FILE + *, ); + +393 #i� +def�ed + +_LIBC + || def�ed +_GLIBCPP_USE_WCHAR_T + + +394 +_IO_w�t_t + +__wund��ow + ( +_IO_FILE + *); + +395 +_IO_w�t_t + +__wu�ow + ( +_IO_FILE + *); + +396 +_IO_w�t_t + +__wov��ow + ( +_IO_FILE + *, _IO_wint_t); + +399 #i� +__GNUC__ + >= 3 + +400 + #_IO_BE +( +ex� +, +�s +� + `__bu�t�_ex�� + (�x�),�es) + + ) + +402 + #_IO_BE +( +ex� +, +�s +��x�) + + ) + +405 + #_IO_g�c_u�ocked +( +_� +) \ + +406 ( + `_IO_BE + (( +_� +)-> +_IO_�ad_�r + >�(_�)-> +_IO_�ad_�d +, 0) \ + +407 ? + `__u�ow + ( +_� +�: *(*�(_�)-> +_IO_�ad_�r +++) + + ) + +408 + #_IO_�ekc_u�ocked +( +_� +) \ + +409 ( + `_IO_BE + (( +_� +)-> +_IO_�ad_�r + >�(_�)-> +_IO_�ad_�d +, 0) \ + +410 && + `__und��ow + ( +_� +�=� +EOF + ? EOF \ + +411 : *(*�( +_� +)-> +_IO_�ad_�r +) + + ) + +412 + #_IO_putc_u�ocked +( +_ch +, +_� +) \ + +413 ( + `_IO_BE + (( +_� +)-> +_IO_wr�e_�r + >�(_�)-> +_IO_wr�e_�d +, 0) \ + +414 ? + `__ov��ow + ( +_� +, (�( +_ch +)) \ + +415 : (�(*( +_� +)-> +_IO_wr�e_�r +++ = ( +_ch +))) + + ) + +417 #i� +def�ed + +_LIBC + || def�ed +_GLIBCPP_USE_WCHAR_T + + +418 + #_IO_g�wc_u�ocked +( +_� +) \ + +419 ( + `_IO_BE + (( +_� +)-> +_wide_d�a + =� +NULL + \ + +420 || (( +_� +)-> +_wide_d�a +-> +_IO_�ad_�r + \ + +421 >�( +_� +)-> +_wide_d�a +-> +_IO_�ad_�d +), 0) \ + +422 ? + `__wu�ow + ( +_� +�: ( +_IO_w�t_t +�*(_�)-> +_wide_d�a +-> +_IO_�ad_�r +++) + + ) + +423 + #_IO_putwc_u�ocked +( +_wch +, +_� +) \ + +424 ( + `_IO_BE + (( +_� +)-> +_wide_d�a + =� +NULL + \ + +425 || (( +_� +)-> +_wide_d�a +-> +_IO_wr�e_�r + \ + +426 >�( +_� +)-> +_wide_d�a +-> +_IO_wr�e_�d +), 0) \ + +427 ? + `__wov��ow + ( +_� +, +_wch +) \ + +428 : ( +_IO_w�t_t +�(*( +_� +)-> +_wide_d�a +-> +_IO_wr�e_�r +++ = ( +_wch +))) + + ) + +431 + #_IO_�of_u�ocked +( +__� +�(((__�)-> +_�ags + & +_IO_EOF_SEEN +�!�0) + + ) + +432 + #_IO_��_u�ocked +( +__� +�(((__�)-> +_�ags + & +_IO_ERR_SEEN +�!�0) + + ) + +434 +_IO_g�c + ( +_IO_FILE + * +__� +); + +435 +_IO_putc + ( +__c +, +_IO_FILE + * +__� +); + +436 +_IO_�of + ( +_IO_FILE + * +__� +� +__THROW +; + +437 +_IO_�� + ( +_IO_FILE + * +__� +� +__THROW +; + +439 +_IO_�ekc_locked + ( +_IO_FILE + * +__� +); + +442 + #_IO_PENDING_OUTPUT_COUNT +( +_� +) \ + +443 (( +_� +)-> +_IO_wr�e_�r + - (_�)-> +_IO_wr�e_ba� +) + + ) + +445 +_IO_�ockf�e + ( +_IO_FILE + *� +__THROW +; + +446 +_IO_fu�ockf�e + ( +_IO_FILE + *� +__THROW +; + +447 +_IO_�rylockf�e + ( +_IO_FILE + *� +__THROW +; + +449 #ifde� +_IO_MTSAFE_IO + + +450 + #_IO_�ekc +( +_� +� + `_IO_�ekc_locked + (_�) + + ) + +451 + #_IO_�ockf�e +( +_� +) \ + +452 i�((( +_� +)-> +_�ags + & +_IO_USER_LOCK +�=�0� + `_IO_�ockf�e + (_�) + + ) + +453 + #_IO_fu�ockf�e +( +_� +) \ + +454 i�((( +_� +)-> +_�ags + & +_IO_USER_LOCK +�=�0� + `_IO_fu�ockf�e + (_�) + + ) + +456 + #_IO_�ekc +( +_� +� + `_IO_�ekc_u�ocked + (_�) + + ) + +457 + #_IO_�ockf�e +( +_� +� + + ) + +458 + #_IO_fu�ockf�e +( +_� +� + + ) + +459 + #_IO_�rylockf�e +( +_� +� + + ) + +460 + #_IO_��nup_�gi�_��t +( +_f� +, +_� +� + + ) + +461 + #_IO_��nup_�gi�_�d +( +_Do� +� + + ) + +464 +_IO_vfs�nf + ( +_IO_FILE + * +__��ri� +, const * __restrict, + +465 +_IO_va_li� +, * +__��ri� +); + +466 +_IO_v�r�tf + ( +_IO_FILE + * +__��ri� +, const *__restrict, + +467 +_IO_va_li� +); + +468 +_IO_ssize_t + +_IO_�dn + ( +_IO_FILE + *, , _IO_ssize_t); + +469 +_IO_size_t + +_IO_sg�n + ( +_IO_FILE + *, *, _IO_size_t); + +471 +_IO_off64_t + +_IO_�ekoff + ( +_IO_FILE + *, _IO_off64_t, , ); + +472 +_IO_off64_t + +_IO_�ekpos + ( +_IO_FILE + *, _IO_off64_t, ); + +474 +_IO_�_backup_�� + ( +_IO_FILE + *� +__THROW +; + +476 #i� +def�ed + +_LIBC + || def�ed +_GLIBCPP_USE_WCHAR_T + + +477 +_IO_w�t_t + +_IO_g�wc + ( +_IO_FILE + * +__� +); + +478 +_IO_w�t_t + +_IO_putwc + ( +wch�_t + +__wc +, +_IO_FILE + * +__� +); + +479 +_IO_fwide + ( +_IO_FILE + * +__� +, +__mode +� +__THROW +; + +480 #i� +__GNUC__ + >= 2 + +483 #i� +def�ed + +_LIBC + && def�ed +SHARED + + +484 + ~<shlib-com�t.h +> + +485 #i� +SHLIB_COMPAT + ( +libc +, +GLIBC_2_0 +, +GLIBC_2_1 +) + +486 + #_IO_fwide_maybe_�com�tib� + \ + +487 ( + `__bu�t�_ex�� + (& +_IO_�d�_u�d + =� +NULL +, 0)) + + ) + +488 cڡ +_IO_�d�_u�d +; + +489 +w�k_ex�� + ( +_IO_�d�_u�d +); + +492 #i�de� +_IO_fwide_maybe_�com�tib� + + +493 + #_IO_fwide_maybe_�com�tib� + (0) + + ) + +497 + #_IO_fwide +( +__� +, +__mode +) \ + +498 ({ +__�su� + = ( +__mode +); \ + +499 i�( +__�su� + < 0 && ! +_IO_fwide_maybe_�com�tib� +) \ + +501 i�(( +__� +)-> +_mode + == 0) \ + +503 ( +__� +)-> +_mode + = -1; \ + +504 +__�su� + = ( +__� +)-> +_mode +; \ + +506 i�( + `__bu�t�_cڡ�t_p + ( +__mode +) && (__mode) == 0) \ + +507 +__�su� + = +_IO_fwide_maybe_�com�tib� + ? -1 : ( +__� +)-> +_mode +; \ + +509 +__�su� + = + `_IO_fwide + ( +__� +, __result); \ + +510 +__�su� +; }) + + ) + +513 +_IO_vfws�nf + ( +_IO_FILE + * +__��ri� +, cڡ +wch�_t + * __restrict, + +514 +_IO_va_li� +, * +__��ri� +); + +515 +_IO_vfw��tf + ( +_IO_FILE + * +__��ri� +, cڡ +wch�_t + *__restrict, + +516 +_IO_va_li� +); + +517 +_IO_ssize_t + +_IO_w�dn + ( +_IO_FILE + *, +w�t_t +, _IO_ssize_t); + +518 +_IO_�_wbackup_�� + ( +_IO_FILE + *� +__THROW +; + +521 #ifde� +__LDBL_COMPAT + + +522 + ~<b�s/libio-ldbl.h +> + +525 #ifde� +__�lu�lus + + + @/usr/include/linux/libc-compat.h + +48 #i�de� +_LIBC_COMPAT_H + + +49 + #_LIBC_COMPAT_H + + + ) + +52 #i� +def�ed +( +__GLIBC__ +) + +55 #i� +def�ed +( +_NETINET_IN_H +) + +59 + #__UAPI_DEF_IN6_ADDR + 0 + + ) + +64 #i� +def�ed +( +__USE_MISC +�|| def�ed ( +__USE_GNU +) + +65 + #__UAPI_DEF_IN6_ADDR_ALT + 0 + + ) + +67 + #__UAPI_DEF_IN6_ADDR_ALT + 1 + + ) + +69 + #__UAPI_DEF_SOCKADDR_IN6 + 0 + + ) + +70 + #__UAPI_DEF_IPV6_MREQ + 0 + + ) + +71 + #__UAPI_DEF_IPPROTO_V6 + 0 + + ) + +72 + #__UAPI_DEF_IPV6_OPTIONS + 0 + + ) + +79 + #__UAPI_DEF_IN6_ADDR + 1 + + ) + +82 + #__UAPI_DEF_IN6_ADDR_ALT + 1 + + ) + +83 + #__UAPI_DEF_SOCKADDR_IN6 + 1 + + ) + +84 + #__UAPI_DEF_IPV6_MREQ + 1 + + ) + +85 + #__UAPI_DEF_IPPROTO_V6 + 1 + + ) + +86 + #__UAPI_DEF_IPV6_OPTIONS + 1 + + ) + +91 #i� +def�ed +( +_SYS_XATTR_H +) + +92 + #__UAPI_DEF_XATTR + 0 + + ) + +94 + #__UAPI_DEF_XATTR + 1 + + ) + +103 + #__UAPI_DEF_IN6_ADDR + 1 + + ) + +104 + #__UAPI_DEF_IN6_ADDR_ALT + 1 + + ) + +105 + #__UAPI_DEF_SOCKADDR_IN6 + 1 + + ) + +106 + #__UAPI_DEF_IPV6_MREQ + 1 + + ) + +107 + #__UAPI_DEF_IPPROTO_V6 + 1 + + ) + +108 + #__UAPI_DEF_IPV6_OPTIONS + 1 + + ) + +111 + #__UAPI_DEF_XATTR + 1 + + ) + + @/usr/include/linux/socket.h + +1 #i�de� +_LINUX_SOCKET_H + + +2 + #_LINUX_SOCKET_H + + + ) + +7 + #_K_SS_MAXSIZE + 128 + + ) + +8 + #_K_SS_ALIGNSIZE + ( + `__�ignof__ + ( +sockaddr + *)) + + ) + +11 + t__k��l_�_�m�y_t +; + +13 + s__k��l_sockaddr_��age + { + +14 +__k��l_�_�m�y_t + + mss_�m�y +; + +16 + m__d�a +[ +_K_SS_MAXSIZE + - ()]; + +19 } +__��ibu�__ + (( +�ig�d +( +_K_SS_ALIGNSIZE +))); + + @/usr/include/linux/types.h + +1 #i�de� +_LINUX_TYPES_H + + +2 + #_LINUX_TYPES_H + + + ) + +4 + ~<asm/ty�s.h +> + +6 #i�de� +__ASSEMBLY__ + + +8 + ~<l�ux/posix_ty�s.h +> + +16 #ifde� +__CHECKER__ + + +17 + #__b�wi�__ + + `__��ibu�__ +(( +b�wi� +)) + + ) + +19 + #__b�wi�__ + + + ) + +21 #ifde� +__CHECK_ENDIAN__ + + +22 + #__b�wi� + +__b�wi�__ + + + ) + +24 + #__b�wi� + + + ) + +27 +__u16 + + t__b�wi� + + t__�16 +; + +28 +__u16 + + t__b�wi� + + t__be16 +; + +29 +__u32 + + t__b�wi� + + t__�32 +; + +30 +__u32 + + t__b�wi� + + t__be32 +; + +31 +__u64 + + t__b�wi� + + t__�64 +; + +32 +__u64 + + t__b�wi� + + t__be64 +; + +34 +__u16 + + t__b�wi� + + t__sum16 +; + +35 +__u32 + + t__b�wi� + + t__wsum +; + +46 + #__�ig�d_u64 + +__u64 + + `__��ibu�__ +(( + `�ig�d +(8))) + + ) + +47 + #__�ig�d_be64 + +__be64 + + `__��ibu�__ +(( + `�ig�d +(8))) + + ) + +48 + #__�ig�d_�64 + +__�64 + + `__��ibu�__ +(( + `�ig�d +(8))) + + ) + + @/usr/include/openssl/bio.h + +59 #i�de� +HEADER_BIO_H + + +60 + #HEADER_BIO_H + + + ) + +62 + ~<ݒs�/e_os2.h +> + +64 #i�de� +OPENSSL_NO_FP_API + + +65 + ~<�dio.h +> + +67 + ~<�d�g.h +> + +69 + ~<ݒs�/�y�o.h +> + +71 #i�de� +OPENSSL_NO_SCTP + + +72 #i�de� +OPENSSL_SYS_VMS + + +73 + ~<�d�t.h +> + +75 + ~<��y�s.h +> + +79 #ifde� +__�lu�lus + + +84 + #BIO_TYPE_NONE + 0 + + ) + +85 + #BIO_TYPE_MEM + (1|0x0400) + + ) + +86 + #BIO_TYPE_FILE + (2|0x0400) + + ) + +88 + #BIO_TYPE_FD + (4|0x0400|0x0100) + + ) + +89 + #BIO_TYPE_SOCKET + (5|0x0400|0x0100) + + ) + +90 + #BIO_TYPE_NULL + (6|0x0400) + + ) + +91 + #BIO_TYPE_SSL + (7|0x0200) + + ) + +92 + #BIO_TYPE_MD + (8|0x0200� + + ) + +93 + #BIO_TYPE_BUFFER + (9|0x0200� + + ) + +94 + #BIO_TYPE_CIPHER + (10|0x0200� + + ) + +95 + #BIO_TYPE_BASE64 + (11|0x0200� + + ) + +96 + #BIO_TYPE_CONNECT + (12|0x0400|0x0100� + + ) + +97 + #BIO_TYPE_ACCEPT + (13|0x0400|0x0100� + + ) + +98 + #BIO_TYPE_PROXY_CLIENT + (14|0x0200� + + ) + +99 + #BIO_TYPE_PROXY_SERVER + (15|0x0200� + + ) + +100 + #BIO_TYPE_NBIO_TEST + (16|0x0200� + + ) + +101 + #BIO_TYPE_NULL_FILTER + (17|0x0200) + + ) + +102 + #BIO_TYPE_BER + (18|0x0200� + + ) + +103 + #BIO_TYPE_BIO + (19|0x0400� + + ) + +104 + #BIO_TYPE_LINEBUFFER + (20|0x0200� + + ) + +105 + #BIO_TYPE_DGRAM + (21|0x0400|0x0100) + + ) + +106 #i�de� +OPENSSL_NO_SCTP + + +107 + #BIO_TYPE_DGRAM_SCTP + (24|0x0400|0x0100) + + ) + +109 + #BIO_TYPE_ASN1 + (22|0x0200� + + ) + +110 + #BIO_TYPE_COMP + (23|0x0200� + + ) + +112 + #BIO_TYPE_DESCRIPTOR + 0x0100 + + ) + +113 + #BIO_TYPE_FILTER + 0x0200 + + ) + +114 + #BIO_TYPE_SOURCE_SINK + 0x0400 + + ) + +118 + #BIO_NOCLOSE + 0x00 + + ) + +119 + #BIO_CLOSE + 0x01 + + ) + +123 + #BIO_CTRL_RESET + 1 + + ) + +124 + #BIO_CTRL_EOF + 2 + + ) + +125 + #BIO_CTRL_INFO + 3 + + ) + +126 + #BIO_CTRL_SET + 4 + + ) + +127 + #BIO_CTRL_GET + 5 + + ) + +128 + #BIO_CTRL_PUSH + 6 + + ) + +129 + #BIO_CTRL_POP + 7 + + ) + +130 + #BIO_CTRL_GET_CLOSE + 8 + + ) + +131 + #BIO_CTRL_SET_CLOSE + 9 + + ) + +132 + #BIO_CTRL_PENDING + 10 + + ) + +133 + #BIO_CTRL_FLUSH + 11 + + ) + +134 + #BIO_CTRL_DUP + 12 + + ) + +135 + #BIO_CTRL_WPENDING + 13 + + ) + +137 + #BIO_CTRL_SET_CALLBACK + 14 + + ) + +138 + #BIO_CTRL_GET_CALLBACK + 15 + + ) + +140 + #BIO_CTRL_SET_FILENAME + 30 + + ) + +143 + #BIO_CTRL_DGRAM_CONNECT + 31 + + ) + +144 + #BIO_CTRL_DGRAM_SET_CONNECTED + 32 + + ) + +147 + #BIO_CTRL_DGRAM_SET_RECV_TIMEOUT + 33 + + ) + +148 + #BIO_CTRL_DGRAM_GET_RECV_TIMEOUT + 34 + + ) + +149 + #BIO_CTRL_DGRAM_SET_SEND_TIMEOUT + 35 + + ) + +150 + #BIO_CTRL_DGRAM_GET_SEND_TIMEOUT + 36 + + ) + +152 + #BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP + 37 + + ) + +153 + #BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP + 38 + + ) + +156 + #BIO_CTRL_DGRAM_MTU_DISCOVER + 39 + + ) + +159 + #BIO_CTRL_DGRAM_QUERY_MTU + 40 + + ) + +160 + #BIO_CTRL_DGRAM_GET_FALLBACK_MTU + 47 + + ) + +161 + #BIO_CTRL_DGRAM_GET_MTU + 41 + + ) + +162 + #BIO_CTRL_DGRAM_SET_MTU + 42 + + ) + +167 + #BIO_CTRL_DGRAM_MTU_EXCEEDED + 43 + + ) + +172 + #BIO_CTRL_DGRAM_GET_PEER + 46 + + ) + +173 + #BIO_CTRL_DGRAM_SET_PEER + 44 + + ) + +175 + #BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT + 45 + + ) + +178 #i�de� +OPENSSL_NO_SCTP + + +180 + #BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE + 50 + + ) + +181 + #BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY + 51 + + ) + +182 + #BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY + 52 + + ) + +183 + #BIO_CTRL_DGRAM_SCTP_AUTH_CCS_RCVD + 53 + + ) + +184 + #BIO_CTRL_DGRAM_SCTP_GET_SNDINFO + 60 + + ) + +185 + #BIO_CTRL_DGRAM_SCTP_SET_SNDINFO + 61 + + ) + +186 + #BIO_CTRL_DGRAM_SCTP_GET_RCVINFO + 62 + + ) + +187 + #BIO_CTRL_DGRAM_SCTP_SET_RCVINFO + 63 + + ) + +188 + #BIO_CTRL_DGRAM_SCTP_GET_PRINFO + 64 + + ) + +189 + #BIO_CTRL_DGRAM_SCTP_SET_PRINFO + 65 + + ) + +190 + #BIO_CTRL_DGRAM_SCTP_SAVE_SHUTDOWN + 70 + + ) + +194 + #BIO_FP_READ + 0x02 + + ) + +195 + #BIO_FP_WRITE + 0x04 + + ) + +196 + #BIO_FP_APPEND + 0x08 + + ) + +197 + #BIO_FP_TEXT + 0x10 + + ) + +199 + #BIO_FLAGS_READ + 0x01 + + ) + +200 + #BIO_FLAGS_WRITE + 0x02 + + ) + +201 + #BIO_FLAGS_IO_SPECIAL + 0x04 + + ) + +202 + #BIO_FLAGS_RWS + ( +BIO_FLAGS_READ +| +BIO_FLAGS_WRITE +| +BIO_FLAGS_IO_SPECIAL +) + + ) + +203 + #BIO_FLAGS_SHOULD_RETRY + 0x08 + + ) + +204 #i�def +BIO_FLAGS_UPLINK + + +207 + #BIO_FLAGS_UPLINK + 0 + + ) + +211 + #BIO_GHBN_CTRL_HITS + 1 + + ) + +212 + #BIO_GHBN_CTRL_MISSES + 2 + + ) + +213 + #BIO_GHBN_CTRL_CACHE_SIZE + 3 + + ) + +214 + #BIO_GHBN_CTRL_GET_ENTRY + 4 + + ) + +215 + #BIO_GHBN_CTRL_FLUSH + 5 + + ) + +224 + #BIO_FLAGS_BASE64_NO_NL + 0x100 + + ) + +229 + #BIO_FLAGS_MEM_RDONLY + 0x200 + + ) + +231 +bio_� + + tBIO +; + +233 +BIO_�t_�ags +( +BIO + * +b +, +�ags +); + +234 +BIO_��_�ags +(cڡ +BIO + * +b +, +�ags +); + +235 +BIO_��r_�ags +( +BIO + * +b +, +�ags +); + +237 + #BIO_g�_�ags +( +b +� + `BIO_��_�ags +(b, ~(0x0)) + + ) + +238 + #BIO_�t_��y_�ec�l +( +b +) \ + +239 + `BIO_�t_�ags +( +b +, ( +BIO_FLAGS_IO_SPECIAL +| +BIO_FLAGS_SHOULD_RETRY +)) + + ) + +240 + #BIO_�t_��y_�ad +( +b +) \ + +241 + `BIO_�t_�ags +( +b +, ( +BIO_FLAGS_READ +| +BIO_FLAGS_SHOULD_RETRY +)) + + ) + +242 + #BIO_�t_��y_wr�e +( +b +) \ + +243 + `BIO_�t_�ags +( +b +, ( +BIO_FLAGS_WRITE +| +BIO_FLAGS_SHOULD_RETRY +)) + + ) + +246 + #BIO_��r_��y_�ags +( +b +) \ + +247 + `BIO_��r_�ags +( +b +, ( +BIO_FLAGS_RWS +| +BIO_FLAGS_SHOULD_RETRY +)) + + ) + +248 + #BIO_g�_��y_�ags +( +b +) \ + +249 + `BIO_��_�ags +( +b +, ( +BIO_FLAGS_RWS +| +BIO_FLAGS_SHOULD_RETRY +)) + + ) + +252 + #BIO_should_�ad +( +a +� + `BIO_��_�ags +�, +BIO_FLAGS_READ +) + + ) + +253 + #BIO_should_wr�e +( +a +� + `BIO_��_�ags +�, +BIO_FLAGS_WRITE +) + + ) + +254 + #BIO_should_io_�ec�l +( +a +� + `BIO_��_�ags +�, +BIO_FLAGS_IO_SPECIAL +) + + ) + +255 + #BIO_��y_ty� +( +a +� + `BIO_��_�ags +�, +BIO_FLAGS_RWS +) + + ) + +256 + #BIO_should_��y +( +a +� + `BIO_��_�ags +�, +BIO_FLAGS_SHOULD_RETRY +) + + ) + +264 + #BIO_RR_SSL_X509_LOOKUP + 0x01 + + ) + +266 + #BIO_RR_CONNECT + 0x02 + + ) + +268 + #BIO_RR_ACCEPT + 0x03 + + ) + +271 + #BIO_CB_FREE + 0x01 + + ) + +272 + #BIO_CB_READ + 0x02 + + ) + +273 + #BIO_CB_WRITE + 0x03 + + ) + +274 + #BIO_CB_PUTS + 0x04 + + ) + +275 + #BIO_CB_GETS + 0x05 + + ) + +276 + #BIO_CB_CTRL + 0x06 + + ) + +280 + #BIO_CB_RETURN + 0x80 + + ) + +281 + #BIO_CB_�tu� +( +a +�(�)| +BIO_CB_RETURN +)) + + ) + +282 + #BIO_cb_�e +( +a +�(!(�)& +BIO_CB_RETURN +)) + + ) + +283 + #BIO_cb_po� +( +a +�(�)& +BIO_CB_RETURN +) + + ) + +285 (* +BIO_g�_��back +(cڡ +BIO + * +b +)�( +bio_� + *,,const *,, ,); + +286 +BIO_�t_��back +( +BIO + * +b +, + +287 (* +��back +)( +bio_� + *,,const *,, ,)); + +288 * +BIO_g�_��back_�g +(cڡ +BIO + * +b +); + +289 +BIO_�t_��back_�g +( +BIO + * +b +, * +�g +); + +291 cڡ * +BIO_m�hod_�me +(cڡ +BIO + * +b +); + +292 +BIO_m�hod_ty� +(cڡ +BIO + * +b +); + +294 + tbio_�fo_cb +( + tbio_� + *, , const *, , , ); + +296 + sbio_m�hod_� + + +298 +ty� +; + +299 cڡ * +�me +; + +300 (* +bwr�e +)( +BIO + *, const *, ); + +301 (* +b�ad +)( +BIO + *, *, ); + +302 (* +bputs +)( +BIO + *, const *); + +303 (* +bg�s +)( +BIO + *, *, ); + +304 (* +�� +)( +BIO + *, , , *); + +305 (* +��� +)( +BIO + *); + +306 (* +de�roy +)( +BIO + *); + +307 (* +��back_�� +)( +BIO + *, , +bio_�fo_cb + *); + +308 } + tBIO_METHOD +; + +310 + sbio_� + + +312 +BIO_METHOD + * +m�hod +; + +314 (* +��back +)( +bio_� + *,,const *,, ,); + +315 * +cb_�g +; + +317 +�� +; + +318 +shutdown +; + +319 +�ags +; + +320 +��y_�as� +; + +321 +num +; + +322 * +�r +; + +323 +bio_� + * +�xt_bio +; + +324 +bio_� + * +�ev_bio +; + +325 +��n�s +; + +326 +num_�ad +; + +327 +num_wr�e +; + +329 +CRYPTO_EX_DATA + +ex_d�a +; + +332 +DECLARE_STACK_OF +( +BIO +) + +334 + sbio_f_buf�r_�x_�ru� + + +346 +ibuf_size +; + +347 +obuf_size +; + +349 * +ibuf +; + +350 +ibuf_�n +; + +351 +ibuf_off +; + +353 * +obuf +; + +354 +obuf_�n +; + +355 +obuf_off +; + +356 } + tBIO_F_BUFFER_CTX +; + +359 + ta�1_ps_func +( + tBIO + * + tb +, ** + tpbuf +, * + t�� +, * + t�rg +); + +361 #i�de� +OPENSSL_NO_SCTP + + +363 + sbio_dg�m_s�p_�d�fo + + +365 +u�t16_t + +�d_sid +; + +366 +u�t16_t + +�d_�ags +; + +367 +u�t32_t + +�d_�id +; + +368 +u�t32_t + +�d_cڋxt +; + +371 + sbio_dg�m_s�p_rcv�fo + + +373 +u�t16_t + +rcv_sid +; + +374 +u�t16_t + +rcv_s� +; + +375 +u�t16_t + +rcv_�ags +; + +376 +u�t32_t + +rcv_�id +; + +377 +u�t32_t + +rcv_t� +; + +378 +u�t32_t + +rcv_cumt� +; + +379 +u�t32_t + +rcv_cڋxt +; + +382 + sbio_dg�m_s�p_��fo + + +384 +u�t16_t + +�_p�icy +; + +385 +u�t32_t + +�_v�ue +; + +390 + #BIO_CONN_S_BEFORE + 1 + + ) + +391 + #BIO_CONN_S_GET_IP + 2 + + ) + +392 + #BIO_CONN_S_GET_PORT + 3 + + ) + +393 + #BIO_CONN_S_CREATE_SOCKET + 4 + + ) + +394 + #BIO_CONN_S_CONNECT + 5 + + ) + +395 + #BIO_CONN_S_OK + 6 + + ) + +396 + #BIO_CONN_S_BLOCKED_CONNECT + 7 + + ) + +397 + #BIO_CONN_S_NBIO + 8 + + ) + +400 + #BIO_C_SET_CONNECT + 100 + + ) + +401 + #BIO_C_DO_STATE_MACHINE + 101 + + ) + +402 + #BIO_C_SET_NBIO + 102 + + ) + +403 + #BIO_C_SET_PROXY_PARAM + 103 + + ) + +404 + #BIO_C_SET_FD + 104 + + ) + +405 + #BIO_C_GET_FD + 105 + + ) + +406 + #BIO_C_SET_FILE_PTR + 106 + + ) + +407 + #BIO_C_GET_FILE_PTR + 107 + + ) + +408 + #BIO_C_SET_FILENAME + 108 + + ) + +409 + #BIO_C_SET_SSL + 109 + + ) + +410 + #BIO_C_GET_SSL + 110 + + ) + +411 + #BIO_C_SET_MD + 111 + + ) + +412 + #BIO_C_GET_MD + 112 + + ) + +413 + #BIO_C_GET_CIPHER_STATUS + 113 + + ) + +414 + #BIO_C_SET_BUF_MEM + 114 + + ) + +415 + #BIO_C_GET_BUF_MEM_PTR + 115 + + ) + +416 + #BIO_C_GET_BUFF_NUM_LINES + 116 + + ) + +417 + #BIO_C_SET_BUFF_SIZE + 117 + + ) + +418 + #BIO_C_SET_ACCEPT + 118 + + ) + +419 + #BIO_C_SSL_MODE + 119 + + ) + +420 + #BIO_C_GET_MD_CTX + 120 + + ) + +421 + #BIO_C_GET_PROXY_PARAM + 121 + + ) + +422 + #BIO_C_SET_BUFF_READ_DATA + 122 + + ) + +423 + #BIO_C_GET_CONNECT + 123 + + ) + +424 + #BIO_C_GET_ACCEPT + 124 + + ) + +425 + #BIO_C_SET_SSL_RENEGOTIATE_BYTES + 125 + + ) + +426 + #BIO_C_GET_SSL_NUM_RENEGOTIATES + 126 + + ) + +427 + #BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT + 127 + + ) + +428 + #BIO_C_FILE_SEEK + 128 + + ) + +429 + #BIO_C_GET_CIPHER_CTX + 129 + + ) + +430 + #BIO_C_SET_BUF_MEM_EOF_RETURN + 130 + + ) + +431 + #BIO_C_SET_BIND_MODE + 131 + + ) + +432 + #BIO_C_GET_BIND_MODE + 132 + + ) + +433 + #BIO_C_FILE_TELL + 133 + + ) + +434 + #BIO_C_GET_SOCKS + 134 + + ) + +435 + #BIO_C_SET_SOCKS + 135 + + ) + +437 + #BIO_C_SET_WRITE_BUF_SIZE + 136 + + ) + +438 + #BIO_C_GET_WRITE_BUF_SIZE + 137 + + ) + +439 + #BIO_C_MAKE_BIO_PAIR + 138 + + ) + +440 + #BIO_C_DESTROY_BIO_PAIR + 139 + + ) + +441 + #BIO_C_GET_WRITE_GUARANTEE + 140 + + ) + +442 + #BIO_C_GET_READ_REQUEST + 141 + + ) + +443 + #BIO_C_SHUTDOWN_WR + 142 + + ) + +444 + #BIO_C_NREAD0 + 143 + + ) + +445 + #BIO_C_NREAD + 144 + + ) + +446 + #BIO_C_NWRITE0 + 145 + + ) + +447 + #BIO_C_NWRITE + 146 + + ) + +448 + #BIO_C_RESET_READ_REQUEST + 147 + + ) + +449 + #BIO_C_SET_MD_CTX + 148 + + ) + +451 + #BIO_C_SET_PREFIX + 149 + + ) + +452 + #BIO_C_GET_PREFIX + 150 + + ) + +453 + #BIO_C_SET_SUFFIX + 151 + + ) + +454 + #BIO_C_GET_SUFFIX + 152 + + ) + +456 + #BIO_C_SET_EX_ARG + 153 + + ) + +457 + #BIO_C_GET_EX_ARG + 154 + + ) + +459 + #BIO_�t_�p_d�a +( +s +, +�g +� + `BIO_�t_ex_d�a +(s,0,�g) + + ) + +460 + #BIO_g�_�p_d�a +( +s +� + `BIO_g�_ex_d�a +(s,0) + + ) + +463 + #BIO_�t_c�n_ho��me +( +b +, +�me +� + `BIO_�� +(b, +BIO_C_SET_CONNECT +,0,(*�ame) + + ) + +464 + #BIO_�t_c�n_p�t +( +b +, +p�t +� + `BIO_�� +(b, +BIO_C_SET_CONNECT +,1,(*��t) + + ) + +465 + #BIO_�t_c�n_� +( +b +, +� +� + `BIO_�� +(b, +BIO_C_SET_CONNECT +,2,(*)�) + + ) + +466 + #BIO_�t_c�n_�t_p�t +( +b +, +p�t +� + `BIO_�� +(b, +BIO_C_SET_CONNECT +,3,(*��t) + + ) + +467 + #BIO_g�_c�n_ho��me +( +b +� + `BIO_�r_�� +(b, +BIO_C_GET_CONNECT +,0) + + ) + +468 + #BIO_g�_c�n_p�t +( +b +� + `BIO_�r_�� +(b, +BIO_C_GET_CONNECT +,1) + + ) + +469 + #BIO_g�_c�n_� +( +b +� + `BIO_�r_�� +(b, +BIO_C_GET_CONNECT +,2) + + ) + +470 + #BIO_g�_c�n_�t_p�t +( +b +� + `BIO_�t_�� +(b, +BIO_C_GET_CONNECT +,3,0) + + ) + +473 + #BIO_�t_nbio +( +b +, +n +� + `BIO_�� +(b, +BIO_C_SET_NBIO +,�), +NULL +) + + ) + +476 + #BIO_�t_ac��_p�t +( +b +, +�me +� + `BIO_�� +(b, +BIO_C_SET_ACCEPT +,0,(*�ame) + + ) + +477 + #BIO_g�_ac��_p�t +( +b +� + `BIO_�r_�� +(b, +BIO_C_GET_ACCEPT +,0) + + ) + +479 + #BIO_�t_nbio_ac�� +( +b +, +n +� + `BIO_�� +(b, +BIO_C_SET_ACCEPT +,1,�)?(*)"a": +NULL +) + + ) + +480 + #BIO_�t_ac��_bios +( +b +, +bio +� + `BIO_�� +(b, +BIO_C_SET_ACCEPT +,2,(*)bio) + + ) + +482 + #BIO_BIND_NORMAL + 0 + + ) + +483 + #BIO_BIND_REUSEADDR_IF_UNUSED + 1 + + ) + +484 + #BIO_BIND_REUSEADDR + 2 + + ) + +485 + #BIO_�t_b�d_mode +( +b +, +mode +� + `BIO_�� +(b, +BIO_C_SET_BIND_MODE +,mode, +NULL +) + + ) + +486 + #BIO_g�_b�d_mode +( +b +, +mode +� + `BIO_�� +(b, +BIO_C_GET_BIND_MODE +,0, +NULL +) + + ) + +488 + #BIO_do_c��� +( +b +� + `BIO_do_h�dshake +(b) + + ) + +489 + #BIO_do_ac�� +( +b +� + `BIO_do_h�dshake +(b) + + ) + +490 + #BIO_do_h�dshake +( +b +� + `BIO_�� +(b, +BIO_C_DO_STATE_MACHINE +,0, +NULL +) + + ) + +493 + #BIO_�t_u� +( +b +, +u� +� + `BIO_�� +(b, +BIO_C_SET_PROXY_PARAM +,0,(*)(u�)) + + ) + +494 + #BIO_�t_�ox�s +( +b +, +p +� + `BIO_�� +(b, +BIO_C_SET_PROXY_PARAM +,1,(*)�)) + + ) + +496 + #BIO_�t_f��r_bio +( +b +, +s +� + `BIO_�� +(b, +BIO_C_SET_PROXY_PARAM +,2,(*)(s)) + + ) + +498 + #BIO_�t_�oxy_cb +( +b +, +cb +� + `BIO_��back_�� +(b, +BIO_C_SET_PROXY_PARAM +,3,(*(*cb)())) + + ) + +499 + #BIO_�t_�oxy_h�d� +( +b +, +sk +� + `BIO_�� +(b, +BIO_C_SET_PROXY_PARAM +,4,(*)sk) + + ) + +500 + #BIO_�t_no_c���_�tu� +( +b +, +bo� +� + `BIO_�t_�� +(b, +BIO_C_SET_PROXY_PARAM +,5,bo�) + + ) + +502 + #BIO_g�_�oxy_h�d� +( +b +, +skp +� + `BIO_�� +(b, +BIO_C_GET_PROXY_PARAM +,0,(*)skp) + + ) + +503 + #BIO_g�_�ox�s +( +b +, +pxy_p +� + `BIO_�� +(b, +BIO_C_GET_PROXY_PARAM +,1,(*)�xy_p)) + + ) + +504 + #BIO_g�_u� +( +b +, +u� +� + `BIO_�� +(b, +BIO_C_GET_PROXY_PARAM +,2,(*)(u�)) + + ) + +505 + #BIO_g�_no_c���_�tu� +( +b +� + `BIO_�� +(b, +BIO_C_GET_PROXY_PARAM +,5, +NULL +) + + ) + +507 + #BIO_�t_fd +( +b +, +fd +, +c +� + `BIO_�t_�� +(b, +BIO_C_SET_FD +,c,fd) + + ) + +508 + #BIO_g�_fd +( +b +, +c +� + `BIO_�� +(b, +BIO_C_GET_FD +,0,(*)c) + + ) + +510 + #BIO_�t_� +( +b +, +� +, +c +� + `BIO_�� +(b, +BIO_C_SET_FILE_PTR +,c,(*)�) + + ) + +511 + #BIO_g�_� +( +b +, +�p +� + `BIO_�� +(b, +BIO_C_GET_FILE_PTR +,0,(*)�p) + + ) + +513 + #BIO_�ek +( +b +, +ofs +�() + `BIO_�� +(b, +BIO_C_FILE_SEEK +,ofs, +NULL +) + + ) + +514 + #BIO_�� +( +b +�() + `BIO_�� +(b, +BIO_C_FILE_TELL +,0, +NULL +) + + ) + +518 #ifde� +CONST_STRICT + + +522 +BIO_�ad_f��ame +( +BIO + * +b +,cڡ * +�me +); + +524 + #BIO_�ad_f��ame +( +b +, +�me +� + `BIO_�� +(b, +BIO_C_SET_FILENAME +, \ + +525 +BIO_CLOSE +| +BIO_FP_READ +,(*) +�me +) + + ) + +527 + #BIO_wr�e_f��ame +( +b +, +�me +� + `BIO_�� +(b, +BIO_C_SET_FILENAME +, \ + +528 +BIO_CLOSE +| +BIO_FP_WRITE +, +�me +) + + ) + +529 + #BIO_��nd_f��ame +( +b +, +�me +� + `BIO_�� +(b, +BIO_C_SET_FILENAME +, \ + +530 +BIO_CLOSE +| +BIO_FP_APPEND +, +�me +) + + ) + +531 + #BIO_rw_f��ame +( +b +, +�me +� + `BIO_�� +(b, +BIO_C_SET_FILENAME +, \ + +532 +BIO_CLOSE +| +BIO_FP_READ +| +BIO_FP_WRITE +, +�me +) + + ) + +538 + #BIO_�t_s� +( +b +, +s� +, +c +� + `BIO_�� +(b, +BIO_C_SET_SSL +,c,(*)s�) + + ) + +539 + #BIO_g�_s� +( +b +, +s�p +� + `BIO_�� +(b, +BIO_C_GET_SSL +,0,(*)s�p) + + ) + +540 + #BIO_�t_s�_mode +( +b +, +��� +� + `BIO_�� +(b, +BIO_C_SSL_MODE +,���, +NULL +) + + ) + +541 + #BIO_�t_s�_��gٟ�_by�s +( +b +, +num +) \ + +542 + `BIO_�� +( +b +, +BIO_C_SET_SSL_RENEGOTIATE_BYTES +, +num +, +NULL +); + + ) + +543 + #BIO_g�_num_��gٟ�s +( +b +) \ + +544 + `BIO_�� +( +b +, +BIO_C_GET_SSL_NUM_RENEGOTIATES +,0, +NULL +); + + ) + +545 + #BIO_�t_s�_��gٟ�_timeout +( +b +, +�c�ds +) \ + +546 + `BIO_�� +( +b +, +BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT +, +�c�ds +, +NULL +); + + ) + +551 + #BIO_g�_mem_d�a +( +b +, +� +� + `BIO_�� +(b, +BIO_CTRL_INFO +,0,(*�p) + + ) + +552 + #BIO_�t_mem_buf +( +b +, +bm +, +c +� + `BIO_�� +(b, +BIO_C_SET_BUF_MEM +,c,(*)bm) + + ) + +553 + #BIO_g�_mem_�r +( +b +, +� +� + `BIO_�� +(b, +BIO_C_GET_BUF_MEM_PTR +,0,(*�p) + + ) + +554 + #BIO_�t_mem_eof_�tu� +( +b +, +v +) \ + +555 + `BIO_�� +( +b +, +BIO_C_SET_BUF_MEM_EOF_RETURN +, +v +, +NULL +) + + ) + +558 + #BIO_g�_buf�r_num_l�es +( +b +� + `BIO_�� +(b, +BIO_C_GET_BUFF_NUM_LINES +,0, +NULL +) + + ) + +559 + #BIO_�t_buf�r_size +( +b +, +size +� + `BIO_�� +(b, +BIO_C_SET_BUFF_SIZE +,size, +NULL +) + + ) + +560 + #BIO_�t_�ad_buf�r_size +( +b +, +size +� + `BIO_�t_�� +(b, +BIO_C_SET_BUFF_SIZE +,size,0) + + ) + +561 + #BIO_�t_wr�e_buf�r_size +( +b +, +size +� + `BIO_�t_�� +(b, +BIO_C_SET_BUFF_SIZE +,size,1) + + ) + +562 + #BIO_�t_buf�r_�ad_d�a +( +b +, +buf +, +num +� + `BIO_�� +(b, +BIO_C_SET_BUFF_READ_DATA +,num,buf) + + ) + +565 + #BIO_dup_��e +( +b +, +�t +� + `BIO_�� +(b, +BIO_CTRL_DUP +,0,(*)ԑ)) + + ) + +567 + #BIO_��t +( +b +�() + `BIO_�� +(b, +BIO_CTRL_RESET +,0, +NULL +) + + ) + +568 + #BIO_eof +( +b +�() + `BIO_�� +(b, +BIO_CTRL_EOF +,0, +NULL +) + + ) + +569 + #BIO_�t_�o� +( +b +, +c +�() + `BIO_�� +(b, +BIO_CTRL_SET_CLOSE +,(c), +NULL +) + + ) + +570 + #BIO_g�_�o� +( +b +�() + `BIO_�� +(b, +BIO_CTRL_GET_CLOSE +,0, +NULL +) + + ) + +571 + #BIO_�nd�g +( +b +�() + `BIO_�� +(b, +BIO_CTRL_PENDING +,0, +NULL +) + + ) + +572 + #BIO_w�nd�g +( +b +�() + `BIO_�� +(b, +BIO_CTRL_WPENDING +,0, +NULL +) + + ) + +574 +size_t + +BIO_��_�nd�g +( +BIO + * +b +); + +575 +size_t + +BIO_��_w�nd�g +( +BIO + * +b +); + +576 + #BIO_�ush +( +b +�() + `BIO_�� +(b, +BIO_CTRL_FLUSH +,0, +NULL +) + + ) + +577 + #BIO_g�_�fo_��back +( +b +, +cbp +�() + `BIO_�� +(b, +BIO_CTRL_GET_CALLBACK +,0, \ + +578 +cbp +) + + ) + +579 + #BIO_�t_�fo_��back +( +b +, +cb +�() + `BIO_��back_�� +(b, +BIO_CTRL_SET_CALLBACK +,cb) + + ) + +582 + #BIO_buf�r_g�_num_l�es +( +b +� + `BIO_�� +(b, +BIO_CTRL_GET +,0, +NULL +) + + ) + +585 + #BIO_�t_wr�e_buf_size +( +b +, +size +�() + `BIO_�� +(b, +BIO_C_SET_WRITE_BUF_SIZE +,size, +NULL +) + + ) + +586 + #BIO_g�_wr�e_buf_size +( +b +, +size +�( +size_t +) + `BIO_�� +(b, +BIO_C_GET_WRITE_BUF_SIZE +,size, +NULL +) + + ) + +587 + #BIO_make_bio_�� +( +b1 +, +b2 +�() + `BIO_�� +(b1, +BIO_C_MAKE_BIO_PAIR +,0,b2) + + ) + +588 + #BIO_de�roy_bio_�� +( +b +�() + `BIO_�� +(b, +BIO_C_DESTROY_BIO_PAIR +,0, +NULL +) + + ) + +589 + #BIO_shutdown_wr +( +b +�() + `BIO_�� +(b, +BIO_C_SHUTDOWN_WR +, 0, +NULL +) + + ) + +591 + #BIO_g�_wr�e_gu���e +( +b +�() + `BIO_�� +(b, +BIO_C_GET_WRITE_GUARANTEE +,0, +NULL +) + + ) + +592 + #BIO_g�_�ad_�que� +( +b +�() + `BIO_�� +(b, +BIO_C_GET_READ_REQUEST +,0, +NULL +) + + ) + +593 +size_t + +BIO_��_g�_wr�e_gu���e +( +BIO + * +b +); + +594 +size_t + +BIO_��_g�_�ad_�que� +( +BIO + * +b +); + +595 +BIO_��_��t_�ad_�que� +( +BIO + * +b +); + +598 + #BIO_��_dg�m_c��� +( +b +, +�� +) \ + +599 () + `BIO_�� +( +b +, +BIO_CTRL_DGRAM_CONNECT +,0, (*) +�� +) + + ) + +600 + #BIO_��_�t_c���ed +( +b +, +��e +, +�� +) \ + +601 () + `BIO_�� +( +b +, +BIO_CTRL_DGRAM_SET_CONNECTED +, +��e +, (*) +�� +) + + ) + +602 + #BIO_dg�m_�cv_timedout +( +b +) \ + +603 () + `BIO_�� +( +b +, +BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP +, 0, +NULL +) + + ) + +604 + #BIO_dg�m_�nd_timedout +( +b +) \ + +605 () + `BIO_�� +( +b +, +BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP +, 0, +NULL +) + + ) + +606 + #BIO_dg�m_g�_�� +( +b +, +�� +) \ + +607 () + `BIO_�� +( +b +, +BIO_CTRL_DGRAM_GET_PEER +, 0, (*) +�� +) + + ) + +608 + #BIO_dg�m_�t_�� +( +b +, +�� +) \ + +609 () + `BIO_�� +( +b +, +BIO_CTRL_DGRAM_SET_PEER +, 0, (*) +�� +) + + ) + +614 +BIO_�t_ex_d�a +( +BIO + * +bio +, +idx +,* +d�a +); + +615 * +BIO_g�_ex_d�a +( +BIO + * +bio +, +idx +); + +616 +BIO_g�_ex_�w_�dex +( +�gl +, * +�gp +, +CRYPTO_EX_�w + * +�w_func +, + +617 +CRYPTO_EX_dup + * +dup_func +, +CRYPTO_EX_� + * +�_func +); + +618 +BIO_numb�_�ad +( +BIO + * +bio +); + +619 +BIO_numb�_wr��n +( +BIO + * +bio +); + +622 +BIO_a�1_�t_�efix +( +BIO + * +b +, +a�1_ps_func + * +�efix +, + +623 +a�1_ps_func + * +�efix_� +); + +624 +BIO_a�1_g�_�efix +( +BIO + * +b +, +a�1_ps_func + ** +��fix +, + +625 +a�1_ps_func + ** +��fix_� +); + +626 +BIO_a�1_�t_suffix +( +BIO + * +b +, +a�1_ps_func + * +suffix +, + +627 +a�1_ps_func + * +suffix_� +); + +628 +BIO_a�1_g�_suffix +( +BIO + * +b +, +a�1_ps_func + ** +psuffix +, + +629 +a�1_ps_func + ** +psuffix_� +); + +631 #i�de� +OPENSSL_NO_FP_API + + +632 +BIO_METHOD + * +BIO_s_f�e +(); + +633 +BIO + * +BIO_�w_f�e +(cڡ * +f��ame +, cڡ * +mode +); + +634 +BIO + * +BIO_�w_� +( +FILE + * +��am +, +�o�_�ag +); + +635 + #BIO_s_f�e_���� + +BIO_s_f�e + + + ) + +637 +BIO + * +BIO_�w +( +BIO_METHOD + * +ty� +); + +638 +BIO_�t +( +BIO + * +a +, +BIO_METHOD + * +ty� +); + +639 +BIO_� +( +BIO + * +a +); + +640 +BIO_v� +( +BIO + * +a +); + +641 +BIO_�ad +( +BIO + * +b +, * +d�a +, +�n +); + +642 +BIO_g�s +( +BIO + * +bp +,* +buf +, +size +); + +643 +BIO_wr�e +( +BIO + * +b +, cڡ * +d�a +, +�n +); + +644 +BIO_puts +( +BIO + * +bp +,cڡ * +buf +); + +645 +BIO_�d�t +( +BIO + * +b +, +�d�t +, +max +); + +646 +BIO_�� +( +BIO + * +bp +, +cmd +, +�rg +,* +�rg +); + +647 +BIO_��back_�� +( +BIO + * +b +, +cmd +, (* +� +)( +bio_� + *, , const *, , , )); + +648 * +BIO_�r_�� +( +BIO + * +bp +, +cmd +, +�rg +); + +649 +BIO_�t_�� +( +BIO + * +bp +, +cmd +, +�rg +, +�rg +); + +650 +BIO + * +BIO_push +(BIO * +b +,BIO * +��nd +); + +651 +BIO + * +BIO_p� +(BIO * +b +); + +652 +BIO_�_�l +( +BIO + * +a +); + +653 +BIO + * +BIO_f�d_ty� +(BIO * +b +, +bio_ty� +); + +654 +BIO + * +BIO_�xt +(BIO * +b +); + +655 +BIO + * +BIO_g�_��y_BIO +(BIO * +bio +, * +�as� +); + +656 +BIO_g�_��y_�as� +( +BIO + * +bio +); + +657 +BIO + * +BIO_dup_cha� +(BIO * +� +); + +659 +BIO_ėd0 +( +BIO + * +bio +, ** +buf +); + +660 +BIO_ėd +( +BIO + * +bio +, ** +buf +, +num +); + +661 +BIO_nwr�e0 +( +BIO + * +bio +, ** +buf +); + +662 +BIO_nwr�e +( +BIO + * +bio +, ** +buf +, +num +); + +664 +BIO_debug_��back +( +BIO + * +bio +, +cmd +,cڡ * +�gp +, +�gi +, + +665 +�gl +, +�t +); + +667 +BIO_METHOD + * +BIO_s_mem +(); + +668 +BIO + * +BIO_�w_mem_buf +(* +buf +, +�n +); + +669 +BIO_METHOD + * +BIO_s_sock� +(); + +670 +BIO_METHOD + * +BIO_s_c��� +(); + +671 +BIO_METHOD + * +BIO_s_ac�� +(); + +672 +BIO_METHOD + * +BIO_s_fd +(); + +673 #i�de� +OPENSSL_SYS_OS2 + + +674 +BIO_METHOD + * +BIO_s_log +(); + +676 +BIO_METHOD + * +BIO_s_bio +(); + +677 +BIO_METHOD + * +BIO_s_nu� +(); + +678 +BIO_METHOD + * +BIO_f_nu� +(); + +679 +BIO_METHOD + * +BIO_f_buf�r +(); + +680 #ifde� +OPENSSL_SYS_VMS + + +681 +BIO_METHOD + * +BIO_f_l�ebuf�r +(); + +683 +BIO_METHOD + * +BIO_f_nbio_�� +(); + +684 #i�de� +OPENSSL_NO_DGRAM + + +685 +BIO_METHOD + * +BIO_s_d�ag�m +(); + +686 #i�de� +OPENSSL_NO_SCTP + + +687 +BIO_METHOD + * +BIO_s_d�ag�m_s�p +(); + +693 +BIO_sock_should_��y +( +i +); + +694 +BIO_sock_n�_�l_�r� +( +�r� +); + +695 +BIO_dg�m_n�_�l_�r� +( +�r� +); + +697 +BIO_fd_should_��y +( +i +); + +698 +BIO_fd_n�_�l_�r� +( +�r� +); + +699 +BIO_dump_cb +((* +cb +)(cڡ * +d�a +, +size_t + +�n +, * +u +), + +700 * +u +, cڡ * +s +, +�n +); + +701 +BIO_dump_�d�t_cb +((* +cb +)(cڡ * +d�a +, +size_t + +�n +, * +u +), + +702 * +u +, cڡ * +s +, +�n +, +�d�t +); + +703 +BIO_dump +( +BIO + * +b +,cڡ * +by�s +, +�n +); + +704 +BIO_dump_�d�t +( +BIO + * +b +,cڡ * +by�s +, +�n +, +�d�t +); + +705 #i�de� +OPENSSL_NO_FP_API + + +706 +BIO_dump_� +( +FILE + * +� +, cڡ * +s +, +�n +); + +707 +BIO_dump_�d�t_� +( +FILE + * +� +, cڡ * +s +, +�n +, +�d�t +); + +709 +ho��t + * +BIO_g�ho�by�me +(cڡ * +�me +); + +718 +BIO_sock_�r� +( +sock +); + +719 +BIO_sock�_io�l +( +fd +, +ty� +, * +�g +); + +720 +BIO_sock�_nbio +( +fd +, +mode +); + +721 +BIO_g�_p�t +(cڡ * +�r +, * +p�t_�r +); + +722 +BIO_g�_ho�_� +(cڡ * +�r +, * +� +); + +723 +BIO_g�_ac��_sock� +(* +ho�_p�t +, +mode +); + +724 +BIO_ac�� +( +sock +,** +�_p�t +); + +725 +BIO_sock_�� +(); + +726 +BIO_sock_��nup +(); + +727 +BIO_�t_t�_nd�ay +( +sock +, +tu�_� +); + +729 +BIO + * +BIO_�w_sock� +( +sock +, +�o�_�ag +); + +730 +BIO + * +BIO_�w_dg�m +( +fd +, +�o�_�ag +); + +731 #i�de� +OPENSSL_NO_SCTP + + +732 +BIO + * +BIO_�w_dg�m_s�p +( +fd +, +�o�_�ag +); + +733 +BIO_dg�m_is_s�p +( +BIO + * +bio +); + +734 +BIO_dg�m_s�p_n�ifi�ti�_cb +( +BIO + * +b +, + +735 (* +h�d�_n�ifi�ti�s +)( +BIO + * +bio +, * +cڋxt +, * +buf +), + +736 * +cڋxt +); + +737 +BIO_dg�m_s�p_wa�_f�_dry +( +BIO + * +b +); + +738 +BIO_dg�m_s�p_msg_wa��g +( +BIO + * +b +); + +740 +BIO + * +BIO_�w_fd +( +fd +, +�o�_�ag +); + +741 +BIO + * +BIO_�w_c��� +(* +ho�_p�t +); + +742 +BIO + * +BIO_�w_ac�� +(* +ho�_p�t +); + +744 +BIO_�w_bio_�� +( +BIO + ** +bio1 +, +size_t + +wr�ebuf1 +, + +745 +BIO + ** +bio2 +, +size_t + +wr�ebuf2 +); + +751 +BIO_c�y_�xt_��y +( +BIO + * +b +); + +755 #ifde� +__GNUC__ + + +756 + #__bio_h__��__ + +__��ibu�__ + + + ) + +758 + #__bio_h__��__ +( +x +) + + ) + +760 +BIO_��tf +( +BIO + * +bio +, cڡ * +f�m� +, ...) + +761 +__bio_h__��__ +(( +__f�m�__ +( +__��tf__ +,2,3))); + +762 +BIO_v��tf +( +BIO + * +bio +, cڡ * +f�m� +, +va_li� + +�gs +) + +763 +__bio_h__��__ +(( +__f�m�__ +( +__��tf__ +,2,0))); + +764 +BIO_���tf +(* +buf +, +size_t + +n +, cڡ * +f�m� +, ...) + +765 +__bio_h__��__ +(( +__f�m�__ +( +__��tf__ +,3,4))); + +766 +BIO_v���tf +(* +buf +, +size_t + +n +, cڡ * +f�m� +, +va_li� + +�gs +) + +767 +__bio_h__��__ +(( +__f�m�__ +( +__��tf__ +,3,0))); + +768 #unde� +__bio_h__��__ + + +774 +ERR_l�d_BIO_�r�gs +(); + +779 + #BIO_F_ACPT_STATE + 100 + + ) + +780 + #BIO_F_BIO_ACCEPT + 101 + + ) + +781 + #BIO_F_BIO_BER_GET_HEADER + 102 + + ) + +782 + #BIO_F_BIO_CALLBACK_CTRL + 131 + + ) + +783 + #BIO_F_BIO_CTRL + 103 + + ) + +784 + #BIO_F_BIO_GETHOSTBYNAME + 120 + + ) + +785 + #BIO_F_BIO_GETS + 104 + + ) + +786 + #BIO_F_BIO_GET_ACCEPT_SOCKET + 105 + + ) + +787 + #BIO_F_BIO_GET_HOST_IP + 106 + + ) + +788 + #BIO_F_BIO_GET_PORT + 107 + + ) + +789 + #BIO_F_BIO_MAKE_PAIR + 121 + + ) + +790 + #BIO_F_BIO_NEW + 108 + + ) + +791 + #BIO_F_BIO_NEW_FILE + 109 + + ) + +792 + #BIO_F_BIO_NEW_MEM_BUF + 126 + + ) + +793 + #BIO_F_BIO_NREAD + 123 + + ) + +794 + #BIO_F_BIO_NREAD0 + 124 + + ) + +795 + #BIO_F_BIO_NWRITE + 125 + + ) + +796 + #BIO_F_BIO_NWRITE0 + 122 + + ) + +797 + #BIO_F_BIO_PUTS + 110 + + ) + +798 + #BIO_F_BIO_READ + 111 + + ) + +799 + #BIO_F_BIO_SOCK_INIT + 112 + + ) + +800 + #BIO_F_BIO_WRITE + 113 + + ) + +801 + #BIO_F_BUFFER_CTRL + 114 + + ) + +802 + #BIO_F_CONN_CTRL + 127 + + ) + +803 + #BIO_F_CONN_STATE + 115 + + ) + +804 + #BIO_F_DGRAM_SCTP_READ + 132 + + ) + +805 + #BIO_F_FILE_CTRL + 116 + + ) + +806 + #BIO_F_FILE_READ + 130 + + ) + +807 + #BIO_F_LINEBUFFER_CTRL + 129 + + ) + +808 + #BIO_F_MEM_READ + 128 + + ) + +809 + #BIO_F_MEM_WRITE + 117 + + ) + +810 + #BIO_F_SSL_NEW + 118 + + ) + +811 + #BIO_F_WSASTARTUP + 119 + + ) + +814 + #BIO_R_ACCEPT_ERROR + 100 + + ) + +815 + #BIO_R_BAD_FOPEN_MODE + 101 + + ) + +816 + #BIO_R_BAD_HOSTNAME_LOOKUP + 102 + + ) + +817 + #BIO_R_BROKEN_PIPE + 124 + + ) + +818 + #BIO_R_CONNECT_ERROR + 103 + + ) + +819 + #BIO_R_EOF_ON_MEMORY_BIO + 127 + + ) + +820 + #BIO_R_ERROR_SETTING_NBIO + 104 + + ) + +821 + #BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET + 105 + + ) + +822 + #BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET + 106 + + ) + +823 + #BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET + 107 + + ) + +824 + #BIO_R_INVALID_ARGUMENT + 125 + + ) + +825 + #BIO_R_INVALID_IP_ADDRESS + 108 + + ) + +826 + #BIO_R_IN_USE + 123 + + ) + +827 + #BIO_R_KEEPALIVE + 109 + + ) + +828 + #BIO_R_NBIO_CONNECT_ERROR + 110 + + ) + +829 + #BIO_R_NO_ACCEPT_PORT_SPECIFIED + 111 + + ) + +830 + #BIO_R_NO_HOSTNAME_SPECIFIED + 112 + + ) + +831 + #BIO_R_NO_PORT_DEFINED + 113 + + ) + +832 + #BIO_R_NO_PORT_SPECIFIED + 114 + + ) + +833 + #BIO_R_NO_SUCH_FILE + 128 + + ) + +834 + #BIO_R_NULL_PARAMETER + 115 + + ) + +835 + #BIO_R_TAG_MISMATCH + 116 + + ) + +836 + #BIO_R_UNABLE_TO_BIND_SOCKET + 117 + + ) + +837 + #BIO_R_UNABLE_TO_CREATE_SOCKET + 118 + + ) + +838 + #BIO_R_UNABLE_TO_LISTEN_SOCKET + 119 + + ) + +839 + #BIO_R_UNINITIALIZED + 120 + + ) + +840 + #BIO_R_UNSUPPORTED_METHOD + 121 + + ) + +841 + #BIO_R_WRITE_TO_READ_ONLY_BIO + 126 + + ) + +842 + #BIO_R_WSASTARTUP + 122 + + ) + +844 #ifde� +__�lu�lus + + + @/usr/include/openssl/comp.h + +2 #i�de� +HEADER_COMP_H + + +3 + #HEADER_COMP_H + + + ) + +5 + ~<ݒs�/�y�o.h +> + +7 #ifde� +__�lu�lus + + +11 +comp_�x_� + + tCOMP_CTX +; + +13 + scomp_m�hod_� + + +15 +ty� +; + +16 cڡ * +�me +; + +17 (* +�� +)( +COMP_CTX + * +�x +); + +18 (* +f�ish +)( +COMP_CTX + * +�x +); + +19 (* +com�ess +)( +COMP_CTX + * +�x +, + +20 * +out +, +ޒ +, + +21 * +� +, +�� +); + +22 (* +ex�nd +)( +COMP_CTX + * +�x +, + +23 * +out +, +ޒ +, + +24 * +� +, +�� +); + +26 (* +�� +)(); + +27 (* +��back_�� +)(); + +28 } + tCOMP_METHOD +; + +30 + scomp_�x_� + + +32 +COMP_METHOD + * +m�h +; + +33 +com�ess_� +; + +34 +com�ess_out +; + +35 +ex�nd_� +; + +36 +ex�nd_out +; + +38 +CRYPTO_EX_DATA + +ex_d�a +; + +42 +COMP_CTX + * +COMP_CTX_�w +( +COMP_METHOD + * +m�h +); + +43 +COMP_CTX_� +( +COMP_CTX + * +�x +); + +44 +COMP_com�ess_block +( +COMP_CTX + * +�x +, * +out +, +ޒ +, + +45 * +� +, +�� +); + +46 +COMP_ex�nd_block +( +COMP_CTX + * +�x +, * +out +, +ޒ +, + +47 * +� +, +�� +); + +48 +COMP_METHOD + * +COMP_�e +(); + +49 +COMP_METHOD + * +COMP_zlib +(); + +50 +COMP_zlib_��nup +(); + +52 #ifde� +HEADER_BIO_H + + +53 #ifde� +ZLIB + + +54 +BIO_METHOD + * +BIO_f_zlib +(); + +62 +ERR_l�d_COMP_�r�gs +(); + +67 + #COMP_F_BIO_ZLIB_FLUSH + 99 + + ) + +68 + #COMP_F_BIO_ZLIB_NEW + 100 + + ) + +69 + #COMP_F_BIO_ZLIB_READ + 101 + + ) + +70 + #COMP_F_BIO_ZLIB_WRITE + 102 + + ) + +73 + #COMP_R_ZLIB_DEFLATE_ERROR + 99 + + ) + +74 + #COMP_R_ZLIB_INFLATE_ERROR + 100 + + ) + +75 + #COMP_R_ZLIB_NOT_SUPPORTED + 101 + + ) + +77 #ifde� +__�lu�lus + + + @/usr/include/openssl/crypto.h + +117 #i�de� +HEADER_CRYPTO_H + + +118 + #HEADER_CRYPTO_H + + + ) + +120 + ~<�dlib.h +> + +122 + ~<ݒs�/e_os2.h +> + +124 #i�de� +OPENSSL_NO_FP_API + + +125 + ~<�dio.h +> + +128 + ~<ݒs�/�ack.h +> + +129 + ~<ݒs�/��ack.h +> + +130 + ~<ݒs�/ݒs�v.h +> + +131 + ~<ݒs�/os�_typ.h +> + +133 #ifde� +CHARSET_EBCDIC + + +134 + ~<ݒs�/ebcdic.h +> + +139 + ~<ݒs�/symhacks.h +> + +141 #ifde� +__�lu�lus + + +148 + #SSLEAY_VERSION_NUMBER + +OPENSSL_VERSION_NUMBER + + + ) + +149 + #SSLEAY_VERSION + 0 + + ) + +151 + #SSLEAY_CFLAGS + 2 + + ) + +152 + #SSLEAY_BUILT_ON + 3 + + ) + +153 + #SSLEAY_PLATFORM + 4 + + ) + +154 + #SSLEAY_DIR + 5 + + ) + +158 +�y�o_ex_d�a_� + + tCRYPTO_EX_DATA +; + +160 + tCRYPTO_EX_�w +(* + t��� +, * + t�r +, + tCRYPTO_EX_DATA + * + tad +, + +161 + tidx +, + t�gl +, * + t�gp +); + +163 + tCRYPTO_EX_� +(* + t��� +, * + t�r +, + tCRYPTO_EX_DATA + * + tad +, + +164 + tidx +, + t�gl +, * + t�gp +); + +166 + tCRYPTO_EX_dup +( + tCRYPTO_EX_DATA + * + tto +, CRYPTO_EX_DATA * + t�om +, * + t�om_d +, + +167 + tidx +, + t�gl +, * + t�gp +); + +171 + sݒs�_�em_� + + +173 +code +; + +174 * +v�ue +; + +175 +size_t + +v�ue_size +; + +176 +size_t + * +v�ue_�ngth +; + +177 } + tOPENSSL_ITEM +; + +184 + #CRYPTO_LOCK_ERR + 1 + + ) + +185 + #CRYPTO_LOCK_EX_DATA + 2 + + ) + +186 + #CRYPTO_LOCK_X509 + 3 + + ) + +187 + #CRYPTO_LOCK_X509_INFO + 4 + + ) + +188 + #CRYPTO_LOCK_X509_PKEY + 5 + + ) + +189 + #CRYPTO_LOCK_X509_CRL + 6 + + ) + +190 + #CRYPTO_LOCK_X509_REQ + 7 + + ) + +191 + #CRYPTO_LOCK_DSA + 8 + + ) + +192 + #CRYPTO_LOCK_RSA + 9 + + ) + +193 + #CRYPTO_LOCK_EVP_PKEY + 10 + + ) + +194 + #CRYPTO_LOCK_X509_STORE + 11 + + ) + +195 + #CRYPTO_LOCK_SSL_CTX + 12 + + ) + +196 + #CRYPTO_LOCK_SSL_CERT + 13 + + ) + +197 + #CRYPTO_LOCK_SSL_SESSION + 14 + + ) + +198 + #CRYPTO_LOCK_SSL_SESS_CERT + 15 + + ) + +199 + #CRYPTO_LOCK_SSL + 16 + + ) + +200 + #CRYPTO_LOCK_SSL_METHOD + 17 + + ) + +201 + #CRYPTO_LOCK_RAND + 18 + + ) + +202 + #CRYPTO_LOCK_RAND2 + 19 + + ) + +203 + #CRYPTO_LOCK_MALLOC + 20 + + ) + +204 + #CRYPTO_LOCK_BIO + 21 + + ) + +205 + #CRYPTO_LOCK_GETHOSTBYNAME + 22 + + ) + +206 + #CRYPTO_LOCK_GETSERVBYNAME + 23 + + ) + +207 + #CRYPTO_LOCK_READDIR + 24 + + ) + +208 + #CRYPTO_LOCK_RSA_BLINDING + 25 + + ) + +209 + #CRYPTO_LOCK_DH + 26 + + ) + +210 + #CRYPTO_LOCK_MALLOC2 + 27 + + ) + +211 + #CRYPTO_LOCK_DSO + 28 + + ) + +212 + #CRYPTO_LOCK_DYNLOCK + 29 + + ) + +213 + #CRYPTO_LOCK_ENGINE + 30 + + ) + +214 + #CRYPTO_LOCK_UI + 31 + + ) + +215 + #CRYPTO_LOCK_ECDSA + 32 + + ) + +216 + #CRYPTO_LOCK_EC + 33 + + ) + +217 + #CRYPTO_LOCK_ECDH + 34 + + ) + +218 + #CRYPTO_LOCK_BN + 35 + + ) + +219 + #CRYPTO_LOCK_EC_PRE_COMP + 36 + + ) + +220 + #CRYPTO_LOCK_STORE + 37 + + ) + +221 + #CRYPTO_LOCK_COMP + 38 + + ) + +222 + #CRYPTO_LOCK_FIPS + 39 + + ) + +223 + #CRYPTO_LOCK_FIPS2 + 40 + + ) + +224 + #CRYPTO_NUM_LOCKS + 41 + + ) + +226 + #CRYPTO_LOCK + 1 + + ) + +227 + #CRYPTO_UNLOCK + 2 + + ) + +228 + #CRYPTO_READ + 4 + + ) + +229 + #CRYPTO_WRITE + 8 + + ) + +231 #i�de� +OPENSSL_NO_LOCKING + + +232 #i�de� +CRYPTO_w_lock + + +233 + #CRYPTO_w_lock +( +ty� +) \ + +234 + `CRYPTO_lock +( +CRYPTO_LOCK +| +CRYPTO_WRITE +, +ty� +, +__FILE__ +, +__LINE__ +) + + ) + +235 + #CRYPTO_w_u�ock +( +ty� +) \ + +236 + `CRYPTO_lock +( +CRYPTO_UNLOCK +| +CRYPTO_WRITE +, +ty� +, +__FILE__ +, +__LINE__ +) + + ) + +237 + #CRYPTO_r_lock +( +ty� +) \ + +238 + `CRYPTO_lock +( +CRYPTO_LOCK +| +CRYPTO_READ +, +ty� +, +__FILE__ +, +__LINE__ +) + + ) + +239 + #CRYPTO_r_u�ock +( +ty� +) \ + +240 + `CRYPTO_lock +( +CRYPTO_UNLOCK +| +CRYPTO_READ +, +ty� +, +__FILE__ +, +__LINE__ +) + + ) + +241 + #CRYPTO_add +( +addr +, +amou� +, +ty� +) \ + +242 + `CRYPTO_add_lock +( +addr +, +amou� +, +ty� +, +__FILE__ +, +__LINE__ +) + + ) + +245 + #CRYPTO_w_lock +( +a +) + + ) + +246 + #CRYPTO_w_u�ock +( +a +) + + ) + +247 + #CRYPTO_r_lock +( +a +) + + ) + +248 + #CRYPTO_r_u�ock +( +a +) + + ) + +249 + #CRYPTO_add +( +a +, +b +, +c +�((*�))+=(b)) + + ) + +258 +��n�s +; + +259 +CRYPTO_dy�ock_v�ue + * +d�a +; + +260 } + tCRYPTO_dy�ock +; + +266 + #CRYPTO_MEM_CHECK_OFF + 0x0 + + ) + +267 + #CRYPTO_MEM_CHECK_ON + 0x1 + + ) + +268 + #CRYPTO_MEM_CHECK_ENABLE + 0x2 + + ) + +269 + #CRYPTO_MEM_CHECK_DISABLE + 0x3 + + ) + +275 + #V_CRYPTO_MDEBUG_TIME + 0x1 + + ) + +277 + #V_CRYPTO_MDEBUG_THREAD + 0x2 + + ) + +279 + #V_CRYPTO_MDEBUG_ALL + ( +V_CRYPTO_MDEBUG_TIME + | +V_CRYPTO_MDEBUG_THREAD +) + + ) + +283 +bio_� + + tBIO_dummy +; + +285 + s�y�o_ex_d�a_� + + +287 +STACK_OF +(�* +sk +; + +288 +dummy +; + +290 +DECLARE_STACK_OF +() + +295 + s�y�o_ex_d�a_func_� + + +297 +�gl +; + +298 * +�gp +; + +299 +CRYPTO_EX_�w + * +�w_func +; + +300 +CRYPTO_EX_� + * +�_func +; + +301 +CRYPTO_EX_dup + * +dup_func +; + +302 } + tCRYPTO_EX_DATA_FUNCS +; + +304 +DECLARE_STACK_OF +( +CRYPTO_EX_DATA_FUNCS +) + +310 + #CRYPTO_EX_INDEX_BIO + 0 + + ) + +311 + #CRYPTO_EX_INDEX_SSL + 1 + + ) + +312 + #CRYPTO_EX_INDEX_SSL_CTX + 2 + + ) + +313 + #CRYPTO_EX_INDEX_SSL_SESSION + 3 + + ) + +314 + #CRYPTO_EX_INDEX_X509_STORE + 4 + + ) + +315 + #CRYPTO_EX_INDEX_X509_STORE_CTX + 5 + + ) + +316 + #CRYPTO_EX_INDEX_RSA + 6 + + ) + +317 + #CRYPTO_EX_INDEX_DSA + 7 + + ) + +318 + #CRYPTO_EX_INDEX_DH + 8 + + ) + +319 + #CRYPTO_EX_INDEX_ENGINE + 9 + + ) + +320 + #CRYPTO_EX_INDEX_X509 + 10 + + ) + +321 + #CRYPTO_EX_INDEX_UI + 11 + + ) + +322 + #CRYPTO_EX_INDEX_ECDSA + 12 + + ) + +323 + #CRYPTO_EX_INDEX_ECDH + 13 + + ) + +324 + #CRYPTO_EX_INDEX_COMP + 14 + + ) + +325 + #CRYPTO_EX_INDEX_STORE + 15 + + ) + +329 + #CRYPTO_EX_INDEX_USER + 100 + + ) + +336 + #CRYPTO_m�loc_�� +(� + `CRYPTO_�t_mem_fun�i�s +(\ + +337 +m�loc +, +��loc +, +� +) + + ) + +339 #i� +def�ed + +CRYPTO_MDEBUG_ALL + || def�ed +CRYPTO_MDEBUG_TIME + || def�ed +CRYPTO_MDEBUG_THREAD + + +340 #i�de� +CRYPTO_MDEBUG + + +341 + #CRYPTO_MDEBUG + + + ) + +347 + #CRYPTO_m�loc_debug_�� +() do {\ + +348 + `CRYPTO_�t_mem_debug_fun�i�s +(\ + +349 +CRYPTO_dbg_m�loc +,\ + +350 +CRYPTO_dbg_��loc +,\ + +351 +CRYPTO_dbg_� +,\ + +352 +CRYPTO_dbg_�t_�ti�s +,\ + +353 +CRYPTO_dbg_g�_�ti�s +);\ + +354 } 0) + + ) + +356 +CRYPTO_mem_�� +( +mode +); + +357 +CRYPTO_is_mem_check_� +(); + +360 + #MemCheck_��t +(� + `CRYPTO_mem_�� +( +CRYPTO_MEM_CHECK_ON +) + + ) + +361 + #MemCheck_�� +(� + `CRYPTO_mem_�� +( +CRYPTO_MEM_CHECK_OFF +) + + ) + +364 + #MemCheck_� +(� + `CRYPTO_mem_�� +( +CRYPTO_MEM_CHECK_ENABLE +) + + ) + +365 + #MemCheck_off +(� + `CRYPTO_mem_�� +( +CRYPTO_MEM_CHECK_DISABLE +) + + ) + +366 + #is_MemCheck_� +(� + `CRYPTO_is_mem_check_� +() + + ) + +368 + #OPENSSL_m�loc +( +num +� + `CRYPTO_m�loc +((�um, +__FILE__ +, +__LINE__ +) + + ) + +369 + #OPENSSL_�rdup +( +�r +� + `CRYPTO_�rdup +((�r), +__FILE__ +, +__LINE__ +) + + ) + +370 + #OPENSSL_��loc +( +addr +, +num +) \ + +371 + `CRYPTO_��loc +((*) +addr +,() +num +, +__FILE__ +, +__LINE__ +) + + ) + +372 + #OPENSSL_��loc_��n +( +addr +, +�d_num +, +num +) \ + +373 + `CRYPTO_��loc_��n +( +addr +, +�d_num +, +num +, +__FILE__ +, +__LINE__ +) + + ) + +374 + #OPENSSL_�m�loc +( +addr +, +num +) \ + +375 + `CRYPTO_�m�loc +((**) +addr +,() +num +, +__FILE__ +, +__LINE__ +) + + ) + +376 + #OPENSSL_�Func + +CRYPTO_� + + + ) + +377 + #OPENSSL_� +( +addr +� + `CRYPTO_� +�ddr) + + ) + +379 + #OPENSSL_m�loc_locked +( +num +) \ + +380 + `CRYPTO_m�loc_locked +(() +num +, +__FILE__ +, +__LINE__ +) + + ) + +381 + #OPENSSL_�_locked +( +addr +� + `CRYPTO_�_locked +�ddr) + + ) + +384 cڡ * +SSL�y_v�si� +( +ty� +); + +385 +SSL�y +(); + +387 +OPENSSL_is�tugid +(); + +390 +�_CRYPTO_EX_DATA_IMPL + + tCRYPTO_EX_DATA_IMPL +; + +392 cڡ +CRYPTO_EX_DATA_IMPL + * +CRYPTO_g�_ex_d�a_im�em��ti� +(); + +394 +CRYPTO_�t_ex_d�a_im�em��ti� +(cڡ +CRYPTO_EX_DATA_IMPL + * +i +); + +396 +CRYPTO_ex_d�a_�w_�ass +(); + +398 +CRYPTO_g�_ex_�w_�dex +( +�ass_�dex +, +�gl +, * +�gp +, + +399 +CRYPTO_EX_�w + * +�w_func +, +CRYPTO_EX_dup + * +dup_func +, + +400 +CRYPTO_EX_� + * +�_func +); + +403 +CRYPTO_�w_ex_d�a +( +�ass_�dex +, * +obj +, +CRYPTO_EX_DATA + * +ad +); + +404 +CRYPTO_dup_ex_d�a +( +�ass_�dex +, +CRYPTO_EX_DATA + * +to +, + +405 +CRYPTO_EX_DATA + * +�om +); + +406 +CRYPTO_�_ex_d�a +( +�ass_�dex +, * +obj +, +CRYPTO_EX_DATA + * +ad +); + +409 +CRYPTO_�t_ex_d�a +( +CRYPTO_EX_DATA + * +ad +, +idx +, * +v� +); + +410 * +CRYPTO_g�_ex_d�a +(cڡ +CRYPTO_EX_DATA + * +ad +, +idx +); + +413 +CRYPTO_��nup_�l_ex_d�a +(); + +415 +CRYPTO_g�_�w_lockid +(* +�me +); + +417 +CRYPTO_num_locks +(); + +418 +CRYPTO_lock +( +mode +, +ty� +,cڡ * +f�e +, +l�e +); + +419 +CRYPTO_�t_lock�g_��back +((* +func +)( +mode +, +ty� +, + +420 cڡ * +f�e +, +l�e +)); + +421 (* +CRYPTO_g�_lock�g_��back +())( +mode +, +ty� +,cڡ * +f�e +, + +422 +l�e +); + +423 +CRYPTO_�t_add_lock_��back +((* +func +)(* +num +, +mou� +, +ty� +, + +424 cڡ * +f�e +, +l�e +)); + +425 (* +CRYPTO_g�_add_lock_��back +())(* +num +, +mou� +, +ty� +, + +426 cڡ * +f�e +, +l�e +); + +429 + s�y�o_th�adid_� + + +431 * +�r +; + +432 +v� +; + +433 } + tCRYPTO_THREADID +; + +435 +CRYPTO_THREADID_�t_num�ic +( +CRYPTO_THREADID + * +id +, +v� +); + +436 +CRYPTO_THREADID_�t_po��r +( +CRYPTO_THREADID + * +id +, * +�r +); + +437 +CRYPTO_THREADID_�t_��back +((* +th�adid_func +)( +CRYPTO_THREADID + *)); + +438 (* +CRYPTO_THREADID_g�_��back +())( +CRYPTO_THREADID + *); + +439 +CRYPTO_THREADID_cu��t +( +CRYPTO_THREADID + * +id +); + +440 +CRYPTO_THREADID_cmp +(cڡ +CRYPTO_THREADID + * +a +, cڡ CRYPTO_THREADID * +b +); + +441 +CRYPTO_THREADID_�y +( +CRYPTO_THREADID + * +de� +, cڡ CRYPTO_THREADID * +�c +); + +442 +CRYPTO_THREADID_hash +(cڡ +CRYPTO_THREADID + * +id +); + +443 #i�de� +OPENSSL_NO_DEPRECATED + + +444 +CRYPTO_�t_id_��back +((* +func +)()); + +445 (* +CRYPTO_g�_id_��back +())(); + +446 +CRYPTO_th�ad_id +(); + +449 cڡ * +CRYPTO_g�_lock_�me +( +ty� +); + +450 +CRYPTO_add_lock +(* +po��r +, +amou� +, +ty� +, cڡ * +f�e +, + +451 +l�e +); + +453 +CRYPTO_g�_�w_dy�ockid +(); + +454 +CRYPTO_de�roy_dy�ockid +( +i +); + +455 +CRYPTO_dy�ock_v�ue + * +CRYPTO_g�_dy�ock_v�ue +( +i +); + +456 +CRYPTO_�t_dy�ock_���_��back +( +CRYPTO_dy�ock_v�ue + *(* +dyn_���_fun�i� +)(cڡ * +f�e +, +l�e +)); + +457 +CRYPTO_�t_dy�ock_lock_��back +((* +dyn_lock_fun�i� +)( +mode +, +CRYPTO_dy�ock_v�ue + * +l +, cڡ * +f�e +, +l�e +)); + +458 +CRYPTO_�t_dy�ock_de�roy_��back +((* +dyn_de�roy_fun�i� +)( +CRYPTO_dy�ock_v�ue + * +l +, cڡ * +f�e +, +l�e +)); + +459 +CRYPTO_dy�ock_v�ue + *(* +CRYPTO_g�_dy�ock_���_��back +())(cڡ * +f�e +, +l�e +); + +460 (* +CRYPTO_g�_dy�ock_lock_��back +())( +mode +, +CRYPTO_dy�ock_v�ue + * +l +, cڡ * +f�e +, +l�e +); + +461 (* +CRYPTO_g�_dy�ock_de�roy_��back +())( +CRYPTO_dy�ock_v�ue + * +l +, cڡ * +f�e +, +l�e +); + +465 +CRYPTO_�t_mem_fun�i�s +(*(* +m +)( +size_t +),*(* +r +)(*,size_t), (* +f +)(*)); + +466 +CRYPTO_�t_locked_mem_fun�i�s +(*(* +m +)( +size_t +), (* +�_func +)(*)); + +467 +CRYPTO_�t_mem_ex_fun�i�s +(*(* +m +)( +size_t +,const *,), + +468 *(* +r +)(*, +size_t +,const *,), + +469 (* +f +)(*)); + +470 +CRYPTO_�t_locked_mem_ex_fun�i�s +(*(* +m +)( +size_t +,const *,), + +471 (* +�_func +)(*)); + +472 +CRYPTO_�t_mem_debug_fun�i�s +((* +m +)(*,,const *,,), + +473 (* +r +)(*,*,,const *,,), + +474 (* +f +)(*,), + +475 (* +so +)(), + +476 (* +go +)()); + +477 +CRYPTO_g�_mem_fun�i�s +(*(** +m +)( +size_t +),*(** +r +)(*, size_t), (** +f +)(*)); + +478 +CRYPTO_g�_locked_mem_fun�i�s +(*(** +m +)( +size_t +), (** +f +)(*)); + +479 +CRYPTO_g�_mem_ex_fun�i�s +(*(** +m +)( +size_t +,const *,), + +480 *(** +r +)(*, +size_t +,const *,), + +481 (** +f +)(*)); + +482 +CRYPTO_g�_locked_mem_ex_fun�i�s +(*(** +m +)( +size_t +,const *,), + +483 (** +f +)(*)); + +484 +CRYPTO_g�_mem_debug_fun�i�s +((** +m +)(*,,const *,,), + +485 (** +r +)(*,*,,const *,,), + +486 (** +f +)(*,), + +487 (** +so +)(), + +488 (** +go +)()); + +490 * +CRYPTO_m�loc_locked +( +num +, cڡ * +f�e +, +l�e +); + +491 +CRYPTO_�_locked +(* +�r +); + +492 * +CRYPTO_m�loc +( +num +, cڡ * +f�e +, +l�e +); + +493 * +CRYPTO_�rdup +(cڡ * +�r +, cڡ * +f�e +, +l�e +); + +494 +CRYPTO_� +(* +�r +); + +495 * +CRYPTO_��loc +(* +addr +, +num +, cڡ * +f�e +, +l�e +); + +496 * +CRYPTO_��loc_��n +(* +addr +, +�d_num +, +num +,cڡ * +f�e +, + +497 +l�e +); + +498 * +CRYPTO_�m�loc +(* +addr +, +num +, cڡ * +f�e +, +l�e +); + +500 +OPENSSL_��n� +(* +�r +, +size_t + +�n +); + +502 +CRYPTO_�t_mem_debug_�ti�s +( +b�s +); + +503 +CRYPTO_g�_mem_debug_�ti�s +(); + +505 + #CRYPTO_push_�fo +( +�fo +) \ + +506 + `CRYPTO_push_�fo_ +( +�fo +, +__FILE__ +, +__LINE__ +); + + ) + +507 +CRYPTO_push_�fo_ +(cڡ * +�fo +, cڡ * +f�e +, +l�e +); + +508 +CRYPTO_p�_�fo +(); + +509 +CRYPTO_�move_�l_�fo +(); + +519 +CRYPTO_dbg_m�loc +(* +addr +, +num +,cڡ * +f�e +, +l�e +, +bef�e_p +); + +520 +CRYPTO_dbg_��loc +(* +addr1 +,* +addr2 +, +num +,cڡ * +f�e +, +l�e +, +bef�e_p +); + +521 +CRYPTO_dbg_� +(* +addr +, +bef�e_p +); + +530 +CRYPTO_dbg_�t_�ti�s +( +b�s +); + +531 +CRYPTO_dbg_g�_�ti�s +(); + +534 #i�de� +OPENSSL_NO_FP_API + + +535 +CRYPTO_mem_�aks_� +( +FILE + *); + +537 +CRYPTO_mem_�aks +( +bio_� + * +bio +); + +539 * + tCRYPTO_MEM_LEAK_CB +(, const *, , , *); + +540 +CRYPTO_mem_�aks_cb +( +CRYPTO_MEM_LEAK_CB + * +cb +); + +543 +O�nSSLD� +(cڡ * +f�e +, +l�e +,cڡ * +as��i� +); + +544 + #OPENSSL_as�� +( +e +�()(��? 0 : ( + `O�nSSLD� +( +__FILE__ +, +__LINE__ +, #e),1)) + + ) + +546 * +OPENSSL_�32�p_loc +(); + +547 + #OPENSSL_�32�p + (*( + `OPENSSL_�32�p_loc +())) + + ) + +548 +OPENSSL_is�rvi� +(); + +550 +FIPS_mode +(); + +551 +FIPS_mode_�t +( +r +); + +553 +OPENSSL_�� +(); + +555 + #f�s_md_�� +( +�g +� + `f�s_md_��_�x +�lg,�lg) + + ) + +557 #ifde� +OPENSSL_FIPS + + +558 + #f�s_md_��_�x +( +�g +, +cx +) \ + +559 +�g +## + `_In� +( +cx +## +_CTX + * +c +) \ + +561 i�( + `FIPS_mode +()� + `O�nSSLD� +( +__FILE__ +, +__LINE__ +, \ + +563 +�iv�e_ +## +�g +## + `_In� +( +c +); \ + +565 +�iv�e_ +## +�g +## + `_In� +( +cx +## +_CTX + * +c +) + + ) + +567 + #f�s_c�h�_ab�t +( +�g +) \ + +568 i�( + `FIPS_mode +()� + `O�nSSLD� +( +__FILE__ +, +__LINE__ +, \ + +569 "Low�ev� API c��t�c�h� " #�g " f�bidd� i�FIPS mode!") + + ) + +572 + #f�s_md_��_�x +( +�g +, +cx +) \ + +573 +�g +## + `_In� +( +cx +## +_CTX + * +c +) + + ) + +574 + #f�s_c�h�_ab�t +( +�g +�0) + + ) + +582 +CRYPTO_memcmp +(cڡ * +a +, cڡ * +b +, +size_t + +�n +); + +588 +ERR_l�d_CRYPTO_�r�gs +(); + +593 + #CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX + 100 + + ) + +594 + #CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID + 103 + + ) + +595 + #CRYPTO_F_CRYPTO_GET_NEW_LOCKID + 101 + + ) + +596 + #CRYPTO_F_CRYPTO_SET_EX_DATA + 102 + + ) + +597 + #CRYPTO_F_DEF_ADD_INDEX + 104 + + ) + +598 + #CRYPTO_F_DEF_GET_CLASS + 105 + + ) + +599 + #CRYPTO_F_FIPS_MODE_SET + 109 + + ) + +600 + #CRYPTO_F_INT_DUP_EX_DATA + 106 + + ) + +601 + #CRYPTO_F_INT_FREE_EX_DATA + 107 + + ) + +602 + #CRYPTO_F_INT_NEW_EX_DATA + 108 + + ) + +605 + #CRYPTO_R_FIPS_MODE_NOT_SUPPORTED + 101 + + ) + +606 + #CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK + 100 + + ) + +608 #ifde� +__�lu�lus + + + @/usr/include/openssl/dh.h + +59 #i�de� +HEADER_DH_H + + +60 + #HEADER_DH_H + + + ) + +62 + ~<ݒs�/e_os2.h +> + +64 #ifde� +OPENSSL_NO_DH + + +65 #�r� +DH + +is + +di�b�d +. + +68 #i�de� +OPENSSL_NO_BIO + + +69 + ~<ݒs�/bio.h +> + +71 + ~<ݒs�/os�_typ.h +> + +72 #i�de� +OPENSSL_NO_DEPRECATED + + +73 + ~<ݒs�/bn.h +> + +76 #i�de� +OPENSSL_DH_MAX_MODULUS_BITS + + +77 + #OPENSSL_DH_MAX_MODULUS_BITS + 10000 + + ) + +80 + #DH_FLAG_CACHE_MONT_P + 0x01 + + ) + +81 + #DH_FLAG_NO_EXP_CONSTTIME + 0x02 + + ) + +95 + #DH_FLAG_FIPS_METHOD + 0x0400 + + ) + +102 + #DH_FLAG_NON_FIPS_ALLOW + 0x0400 + + ) + +104 #ifde� +__�lu�lus + + +112 + sdh_m�hod + + +114 cڡ * +�me +; + +116 (* +g���e_key +)( +DH + * +dh +); + +117 (* +compu�_key +)(* +key +,cڡ +BIGNUM + * +pub_key +, +DH + * +dh +); + +118 (* +bn_mod_exp +)(cڡ +DH + * +dh +, +BIGNUM + * +r +, cڡ BIGNUM * +a +, + +119 cڡ +BIGNUM + * +p +, cڡ BIGNUM * +m +, +BN_CTX + * +�x +, + +120 +BN_MONT_CTX + * +m_�x +); + +122 (* +�� +)( +DH + * +dh +); + +123 (* +f�ish +)( +DH + * +dh +); + +124 +�ags +; + +125 * +�p_d�a +; + +127 (* +g���e_��ms +)( +DH + * +dh +, +�ime_�n +, +g���� +, +BN_GENCB + * +cb +); + +130 + sdh_� + + +134 +�d +; + +135 +v�si� +; + +136 +BIGNUM + * +p +; + +137 +BIGNUM + * +g +; + +138 +�ngth +; + +139 +BIGNUM + * +pub_key +; + +140 +BIGNUM + * +�iv_key +; + +142 +�ags +; + +143 +BN_MONT_CTX + * +m�hod_m�t_p +; + +145 +BIGNUM + * +q +; + +146 +BIGNUM + * +j +; + +147 * +�ed +; + +148 +�ed�n +; + +149 +BIGNUM + * +cou�� +; + +151 +��n�s +; + +152 +CRYPTO_EX_DATA + +ex_d�a +; + +153 cڡ +DH_METHOD + * +m�h +; + +154 +ENGINE + * +�g�e +; + +157 + #DH_GENERATOR_2 + 2 + + ) + +159 + #DH_GENERATOR_5 + 5 + + ) + +162 + #DH_CHECK_P_NOT_PRIME + 0x01 + + ) + +163 + #DH_CHECK_P_NOT_SAFE_PRIME + 0x02 + + ) + +164 + #DH_UNABLE_TO_CHECK_GENERATOR + 0x04 + + ) + +165 + #DH_NOT_SUITABLE_GENERATOR + 0x08 + + ) + +168 + #DH_CHECK_PUBKEY_TOO_SMALL + 0x01 + + ) + +169 + #DH_CHECK_PUBKEY_TOO_LARGE + 0x02 + + ) + +173 + #DH_CHECK_P_NOT_STRONG_PRIME + +DH_CHECK_P_NOT_SAFE_PRIME + + + ) + +175 + #d2i_DH��ms_� +( +� +, +x +�( +DH + *) + `ASN1_d2i_� +((*(*)()) +DH_�w +, \ + +176 (*(*)()) +d2i_DH��ms +,( +� +),(**)( +x +)) + + ) + +177 + #i2d_DH��ms_� +( +� +, +x +� + `ASN1_i2d_� +( +i2d_DH��ms +,(fp), \ + +178 (*)( +x +)) + + ) + +179 + #d2i_DH��ms_bio +( +bp +, +x +� + `ASN1_d2i_bio_of +( +DH +, +DH_�w +, +d2i_DH��ms +,bp,x) + + ) + +180 + #i2d_DH��ms_bio +( +bp +, +x +� + `ASN1_i2d_bio_of_cڡ +( +DH +, +i2d_DH��ms +,bp,x) + + ) + +182 +DH + * +DH��ms_dup +(DH *); + +184 cڡ +DH_METHOD + * +DH_O�nSSL +(); + +186 +DH_�t_de�u�_m�hod +(cڡ +DH_METHOD + * +m�h +); + +187 cڡ +DH_METHOD + * +DH_g�_de�u�_m�hod +(); + +188 +DH_�t_m�hod +( +DH + * +dh +, cڡ +DH_METHOD + * +m�h +); + +189 +DH + * +DH_�w_m�hod +( +ENGINE + * +�g�e +); + +191 +DH + * +DH_�w +(); + +192 +DH_� +( +DH + * +dh +); + +193 +DH_up_�f +( +DH + * +dh +); + +194 +DH_size +(cڡ +DH + * +dh +); + +195 +DH_g�_ex_�w_�dex +( +�gl +, * +�gp +, +CRYPTO_EX_�w + * +�w_func +, + +196 +CRYPTO_EX_dup + * +dup_func +, +CRYPTO_EX_� + * +�_func +); + +197 +DH_�t_ex_d�a +( +DH + * +d +, +idx +, * +�g +); + +198 * +DH_g�_ex_d�a +( +DH + * +d +, +idx +); + +201 #i�de� +OPENSSL_NO_DEPRECATED + + +202 +DH + * +DH_g���e_��m��s +( +�ime_�n +, +g���� +, + +203 (* +��back +)(,,*),* +cb_�g +); + +207 +DH_g���e_��m��s_ex +( +DH + * +dh +, +�ime_�n +, +g���� +, +BN_GENCB + * +cb +); + +209 +DH_check +(cڡ +DH + * +dh +,* +codes +); + +210 +DH_check_pub_key +(cڡ +DH + * +dh +,cڡ +BIGNUM + * +pub_key +, * +codes +); + +211 +DH_g���e_key +( +DH + * +dh +); + +212 +DH_compu�_key +(* +key +,cڡ +BIGNUM + * +pub_key +, +DH + * +dh +); + +213 +DH + * +d2i_DH��ms +(DH ** +a +,cڡ ** +� +, +�ngth +); + +214 +i2d_DH��ms +(cڡ +DH + * +a +,** +� +); + +215 #i�de� +OPENSSL_NO_FP_API + + +216 +DH��ms_��t_� +( +FILE + * +� +, cڡ +DH + * +x +); + +218 #i�de� +OPENSSL_NO_BIO + + +219 +DH��ms_��t +( +BIO + * +bp +, cڡ +DH + * +x +); + +221 +DH��ms_��t +(* +bp +, cڡ +DH + * +x +); + +224 + #EVP_PKEY_CTX_�t_dh_��mg�_�ime_�n +( +�x +, +�n +) \ + +225 + `EVP_PKEY_CTX_�� +( +�x +, +EVP_PKEY_DH +, +EVP_PKEY_OP_PARAMGEN +, \ + +226 +EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN +, +�n +, +NULL +) + + ) + +228 + #EVP_PKEY_CTX_�t_dh_��mg�_g���� +( +�x +, +g� +) \ + +229 + `EVP_PKEY_CTX_�� +( +�x +, +EVP_PKEY_DH +, +EVP_PKEY_OP_PARAMGEN +, \ + +230 +EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR +, +g� +, +NULL +) + + ) + +232 + #EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN + ( +EVP_PKEY_ALG_CTRL + + 1) + + ) + +233 + #EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR + ( +EVP_PKEY_ALG_CTRL + + 2) + + ) + +240 +ERR_l�d_DH_�r�gs +(); + +245 + #DH_F_COMPUTE_KEY + 102 + + ) + +246 + #DH_F_DHPARAMS_PRINT_FP + 101 + + ) + +247 + #DH_F_DH_BUILTIN_GENPARAMS + 106 + + ) + +248 + #DH_F_DH_COMPUTE_KEY + 114 + + ) + +249 + #DH_F_DH_GENERATE_KEY + 115 + + ) + +250 + #DH_F_DH_GENERATE_PARAMETERS_EX + 116 + + ) + +251 + #DH_F_DH_NEW_METHOD + 105 + + ) + +252 + #DH_F_DH_PARAM_DECODE + 107 + + ) + +253 + #DH_F_DH_PRIV_DECODE + 110 + + ) + +254 + #DH_F_DH_PRIV_ENCODE + 111 + + ) + +255 + #DH_F_DH_PUB_DECODE + 108 + + ) + +256 + #DH_F_DH_PUB_ENCODE + 109 + + ) + +257 + #DH_F_DO_DH_PRINT + 100 + + ) + +258 + #DH_F_GENERATE_KEY + 103 + + ) + +259 + #DH_F_GENERATE_PARAMETERS + 104 + + ) + +260 + #DH_F_PKEY_DH_DERIVE + 112 + + ) + +261 + #DH_F_PKEY_DH_KEYGEN + 113 + + ) + +264 + #DH_R_BAD_GENERATOR + 101 + + ) + +265 + #DH_R_BN_DECODE_ERROR + 109 + + ) + +266 + #DH_R_BN_ERROR + 106 + + ) + +267 + #DH_R_DECODE_ERROR + 104 + + ) + +268 + #DH_R_INVALID_PUBKEY + 102 + + ) + +269 + #DH_R_KEYS_NOT_SET + 108 + + ) + +270 + #DH_R_KEY_SIZE_TOO_SMALL + 110 + + ) + +271 + #DH_R_MODULUS_TOO_LARGE + 103 + + ) + +272 + #DH_R_NON_FIPS_METHOD + 111 + + ) + +273 + #DH_R_NO_PARAMETERS_SET + 107 + + ) + +274 + #DH_R_NO_PRIVATE_VALUE + 100 + + ) + +275 + #DH_R_PARAMETER_ENCODING_ERROR + 105 + + ) + +277 #ifde� +__�lu�lus + + + @/usr/include/openssl/dsa.h + +65 #i�de� +HEADER_DSA_H + + +66 + #HEADER_DSA_H + + + ) + +68 + ~<ݒs�/e_os2.h +> + +70 #ifde� +OPENSSL_NO_DSA + + +71 #�r� +DSA + +is + +di�b�d +. + +74 #i�de� +OPENSSL_NO_BIO + + +75 + ~<ݒs�/bio.h +> + +77 + ~<ݒs�/�y�o.h +> + +78 + ~<ݒs�/os�_typ.h +> + +80 #i�de� +OPENSSL_NO_DEPRECATED + + +81 + ~<ݒs�/bn.h +> + +82 #i�de� +OPENSSL_NO_DH + + +83 + ~<ݒs�/dh.h +> + +87 #i�de� +OPENSSL_DSA_MAX_MODULUS_BITS + + +88 + #OPENSSL_DSA_MAX_MODULUS_BITS + 10000 + + ) + +91 + #DSA_FLAG_CACHE_MONT_P + 0x01 + + ) + +92 + #DSA_FLAG_NO_EXP_CONSTTIME + 0x02 + + ) + +106 + #DSA_FLAG_FIPS_METHOD + 0x0400 + + ) + +113 + #DSA_FLAG_NON_FIPS_ALLOW + 0x0400 + + ) + +115 #ifde� +__�lu�lus + + +123 + sDSA_SIG_� + + +125 +BIGNUM + * +r +; + +126 +BIGNUM + * +s +; + +127 } + tDSA_SIG +; + +129 + sd�_m�hod + + +131 cڡ * +�me +; + +132 +DSA_SIG + * (* +d�_do_sign +)(cڡ * +dg� +, +d�n +, +DSA + * +d� +); + +133 (* +d�_sign_�tup +)( +DSA + * +d� +, +BN_CTX + * +�x_� +, +BIGNUM + ** +k�vp +, + +134 +BIGNUM + ** +� +); + +135 (* +d�_do_v�ify +)(cڡ * +dg� +, +dg�_�n +, + +136 +DSA_SIG + * +sig +, +DSA + * +d� +); + +137 (* +d�_mod_exp +)( +DSA + * +d� +, +BIGNUM + * +� +, BIGNUM * +a1 +, BIGNUM * +p1 +, + +138 +BIGNUM + * +a2 +, BIGNUM * +p2 +, BIGNUM * +m +, +BN_CTX + * +�x +, + +139 +BN_MONT_CTX + * +�_m�t +); + +140 (* +bn_mod_exp +)( +DSA + * +d� +, +BIGNUM + * +r +, BIGNUM * +a +, cڡ BIGNUM * +p +, + +141 cڡ +BIGNUM + * +m +, +BN_CTX + * +�x +, + +142 +BN_MONT_CTX + * +m_�x +); + +143 (* +�� +)( +DSA + * +d� +); + +144 (* +f�ish +)( +DSA + * +d� +); + +145 +�ags +; + +146 * +�p_d�a +; + +148 (* +d�_��mg� +)( +DSA + * +d� +, +b�s +, + +149 cڡ * +�ed +, +�ed_�n +, + +150 * +cou��_�t +, * +h_�t +, + +151 +BN_GENCB + * +cb +); + +153 (* +d�_keyg� +)( +DSA + * +d� +); + +156 + sd�_� + + +160 +�d +; + +161 +v�si� +; + +162 +wr�e_��ms +; + +163 +BIGNUM + * +p +; + +164 +BIGNUM + * +q +; + +165 +BIGNUM + * +g +; + +167 +BIGNUM + * +pub_key +; + +168 +BIGNUM + * +�iv_key +; + +170 +BIGNUM + * +k�v +; + +171 +BIGNUM + * +r +; + +173 +�ags +; + +175 +BN_MONT_CTX + * +m�hod_m�t_p +; + +176 +��n�s +; + +177 +CRYPTO_EX_DATA + +ex_d�a +; + +178 cڡ +DSA_METHOD + * +m�h +; + +180 +ENGINE + * +�g�e +; + +183 + #d2i_DSA��ms_� +( +� +, +x +�( +DSA + *) + `ASN1_d2i_� +((*(*)()) +DSA_�w +, \ + +184 (*(*)()) +d2i_DSA��ms +,( +� +),(**)( +x +)) + + ) + +185 + #i2d_DSA��ms_� +( +� +, +x +� + `ASN1_i2d_� +( +i2d_DSA��ms +,(fp), \ + +186 (*)( +x +)) + + ) + +187 + #d2i_DSA��ms_bio +( +bp +, +x +� + `ASN1_d2i_bio_of +( +DSA +, +DSA_�w +, +d2i_DSA��ms +,bp,x) + + ) + +188 + #i2d_DSA��ms_bio +( +bp +, +x +� + `ASN1_i2d_bio_of_cڡ +( +DSA +, +i2d_DSA��ms +,bp,x) + + ) + +191 +DSA + * +DSA��ms_dup +(DSA * +x +); + +192 +DSA_SIG + * +DSA_SIG_�w +(); + +193 +DSA_SIG_� +( +DSA_SIG + * +a +); + +194 +i2d_DSA_SIG +(cڡ +DSA_SIG + * +a +, ** +� +); + +195 +DSA_SIG + * +d2i_DSA_SIG +(DSA_SIG ** +v +, cڡ ** +� +, +�ngth +); + +197 +DSA_SIG + * +DSA_do_sign +(cڡ * +dg� +, +d�n +, +DSA + * +d� +); + +198 +DSA_do_v�ify +(cڡ * +dg� +, +dg�_�n +, + +199 +DSA_SIG + * +sig +, +DSA + * +d� +); + +201 cڡ +DSA_METHOD + * +DSA_O�nSSL +(); + +203 +DSA_�t_de�u�_m�hod +(cڡ +DSA_METHOD + *); + +204 cڡ +DSA_METHOD + * +DSA_g�_de�u�_m�hod +(); + +205 +DSA_�t_m�hod +( +DSA + * +d� +, cڡ +DSA_METHOD + *); + +207 +DSA + * +DSA_�w +(); + +208 +DSA + * +DSA_�w_m�hod +( +ENGINE + * +�g�e +); + +209 +DSA_� + ( +DSA + * +r +); + +211 +DSA_up_�f +( +DSA + * +r +); + +212 +DSA_size +(cڡ +DSA + *); + +214 +DSA_sign_�tup +� +DSA + * +d� +, +BN_CTX + * +�x_� +, +BIGNUM + ** +k�vp +,BIGNUM ** +� +); + +215 +DSA_sign +( +ty� +,cڡ * +dg� +, +d�n +, + +216 * +sig +, * +sig�n +, +DSA + * +d� +); + +217 +DSA_v�ify +( +ty� +,cڡ * +dg� +, +dg�_�n +, + +218 cڡ * +sigbuf +, +sig�n +, +DSA + * +d� +); + +219 +DSA_g�_ex_�w_�dex +( +�gl +, * +�gp +, +CRYPTO_EX_�w + * +�w_func +, + +220 +CRYPTO_EX_dup + * +dup_func +, +CRYPTO_EX_� + * +�_func +); + +221 +DSA_�t_ex_d�a +( +DSA + * +d +, +idx +, * +�g +); + +222 * +DSA_g�_ex_d�a +( +DSA + * +d +, +idx +); + +224 +DSA + * +d2i_DSAPublicKey +(DSA ** +a +, cڡ ** +� +, +�ngth +); + +225 +DSA + * +d2i_DSAPriv�eKey +(DSA ** +a +, cڡ ** +� +, +�ngth +); + +226 +DSA + * +d2i_DSA��ms +(DSA ** +a +, cڡ ** +� +, +�ngth +); + +229 #i�de� +OPENSSL_NO_DEPRECATED + + +230 +DSA + * +DSA_g���e_��m��s +( +b�s +, + +231 * +�ed +, +�ed_�n +, + +232 * +cou��_�t +, * +h_�t +, + +233 (* +��back +)(, , *),* +cb_�g +); + +237 +DSA_g���e_��m��s_ex +( +DSA + * +d� +, +b�s +, + +238 cڡ * +�ed +, +�ed_�n +, + +239 * +cou��_�t +, * +h_�t +, +BN_GENCB + * +cb +); + +241 +DSA_g���e_key +( +DSA + * +a +); + +242 +i2d_DSAPublicKey +(cڡ +DSA + * +a +, ** +� +); + +243 +i2d_DSAPriv�eKey +(cڡ +DSA + * +a +, ** +� +); + +244 +i2d_DSA��ms +(cڡ +DSA + * +a +,** +� +); + +246 #i�de� +OPENSSL_NO_BIO + + +247 +DSA��ms_��t +( +BIO + * +bp +, cڡ +DSA + * +x +); + +248 +DSA_��t +( +BIO + * +bp +, cڡ +DSA + * +x +, +off +); + +250 #i�de� +OPENSSL_NO_FP_API + + +251 +DSA��ms_��t_� +( +FILE + * +� +, cڡ +DSA + * +x +); + +252 +DSA_��t_� +( +FILE + * +bp +, cڡ +DSA + * +x +, +off +); + +255 + #DSS_�ime_checks + 50 + + ) + +258 + #DSA_is_�ime +( +n +, +��back +, +cb_�g +) \ + +259 + `BN_is_�ime +( +n +, +DSS_�ime_checks +, +��back +, +NULL +, +cb_�g +) + + ) + +261 #i�de� +OPENSSL_NO_DH + + +264 +DH + * +DSA_dup_DH +(cڡ +DSA + * +r +); + +267 + #EVP_PKEY_CTX_�t_d�_��mg�_b�s +( +�x +, +nb�s +) \ + +268 + `EVP_PKEY_CTX_�� +( +�x +, +EVP_PKEY_DSA +, +EVP_PKEY_OP_PARAMGEN +, \ + +269 +EVP_PKEY_CTRL_DSA_PARAMGEN_BITS +, +nb�s +, +NULL +) + + ) + +271 + #EVP_PKEY_CTRL_DSA_PARAMGEN_BITS + ( +EVP_PKEY_ALG_CTRL + + 1) + + ) + +272 + #EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS + ( +EVP_PKEY_ALG_CTRL + + 2) + + ) + +273 + #EVP_PKEY_CTRL_DSA_PARAMGEN_MD + ( +EVP_PKEY_ALG_CTRL + + 3) + + ) + +279 +ERR_l�d_DSA_�r�gs +(); + +284 + #DSA_F_D2I_DSA_SIG + 110 + + ) + +285 + #DSA_F_DO_DSA_PRINT + 104 + + ) + +286 + #DSA_F_DSAPARAMS_PRINT + 100 + + ) + +287 + #DSA_F_DSAPARAMS_PRINT_FP + 101 + + ) + +288 + #DSA_F_DSA_DO_SIGN + 112 + + ) + +289 + #DSA_F_DSA_DO_VERIFY + 113 + + ) + +290 + #DSA_F_DSA_GENERATE_KEY + 124 + + ) + +291 + #DSA_F_DSA_GENERATE_PARAMETERS_EX + 123 + + ) + +292 + #DSA_F_DSA_NEW_METHOD + 103 + + ) + +293 + #DSA_F_DSA_PARAM_DECODE + 119 + + ) + +294 + #DSA_F_DSA_PRINT_FP + 105 + + ) + +295 + #DSA_F_DSA_PRIV_DECODE + 115 + + ) + +296 + #DSA_F_DSA_PRIV_ENCODE + 116 + + ) + +297 + #DSA_F_DSA_PUB_DECODE + 117 + + ) + +298 + #DSA_F_DSA_PUB_ENCODE + 118 + + ) + +299 + #DSA_F_DSA_SIGN + 106 + + ) + +300 + #DSA_F_DSA_SIGN_SETUP + 107 + + ) + +301 + #DSA_F_DSA_SIG_NEW + 109 + + ) + +302 + #DSA_F_DSA_SIG_PRINT + 125 + + ) + +303 + #DSA_F_DSA_VERIFY + 108 + + ) + +304 + #DSA_F_I2D_DSA_SIG + 111 + + ) + +305 + #DSA_F_OLD_DSA_PRIV_DECODE + 122 + + ) + +306 + #DSA_F_PKEY_DSA_CTRL + 120 + + ) + +307 + #DSA_F_PKEY_DSA_KEYGEN + 121 + + ) + +308 + #DSA_F_SIG_CB + 114 + + ) + +311 + #DSA_R_BAD_Q_VALUE + 102 + + ) + +312 + #DSA_R_BN_DECODE_ERROR + 108 + + ) + +313 + #DSA_R_BN_ERROR + 109 + + ) + +314 + #DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE + 100 + + ) + +315 + #DSA_R_DECODE_ERROR + 104 + + ) + +316 + #DSA_R_INVALID_DIGEST_TYPE + 106 + + ) + +317 + #DSA_R_MISSING_PARAMETERS + 101 + + ) + +318 + #DSA_R_MODULUS_TOO_LARGE + 103 + + ) + +319 + #DSA_R_NEED_NEW_SETUP_VALUES + 110 + + ) + +320 + #DSA_R_NON_FIPS_DSA_METHOD + 111 + + ) + +321 + #DSA_R_NO_PARAMETERS_SET + 107 + + ) + +322 + #DSA_R_PARAMETER_ENCODING_ERROR + 105 + + ) + +324 #ifde� +__�lu�lus + + + @/usr/include/openssl/dtls1.h + +60 #i�de� +HEADER_DTLS1_H + + +61 + #HEADER_DTLS1_H + + + ) + +63 + ~<ݒs�/buf�r.h +> + +64 + ~<ݒs�/pqueue.h +> + +65 #ifde� +OPENSSL_SYS_VMS + + +66 + ~<�sour�.h +> + +67 + ~<sys/timeb.h +> + +69 #ifde� +OPENSSL_SYS_WIN32 + + +71 + ~<w�sock.h +> + +72 #�i� +def�ed +( +OPENSSL_SYS_NETWARE +�&& !def�ed( +_WINSOCK2API_ +) + +73 + ~<sys/timev�.h +> + +75 #i� +def�ed +( +OPENSSL_SYS_VXWORKS +) + +76 + ~<sys/times.h +> + +78 + ~<sys/time.h +> + +82 #ifde� +__�lu�lus + + +86 + #DTLS1_VERSION + 0xFEFF + + ) + +87 + #DTLS_MAX_VERSION + +DTLS1_VERSION + + + ) + +89 + #DTLS1_BAD_VER + 0x0100 + + ) + +93 + #DTLS1_AD_MISSING_HANDSHAKE_MESSAGE + 110 + + ) + +97 + #DTLS1_COOKIE_LENGTH + 256 + + ) + +99 + #DTLS1_RT_HEADER_LENGTH + 13 + + ) + +101 + #DTLS1_HM_HEADER_LENGTH + 12 + + ) + +103 + #DTLS1_HM_BAD_FRAGMENT + -2 + + ) + +104 + #DTLS1_HM_FRAGMENT_RETRY + -3 + + ) + +106 + #DTLS1_CCS_HEADER_LENGTH + 1 + + ) + +108 #ifde� +DTLS1_AD_MISSING_HANDSHAKE_MESSAGE + + +109 + #DTLS1_AL_HEADER_LENGTH + 7 + + ) + +111 + #DTLS1_AL_HEADER_LENGTH + 2 + + ) + +114 #i�de� +OPENSSL_NO_SSL_INTERN + + +116 #i�de� +OPENSSL_NO_SCTP + + +117 + #DTLS1_SCTP_AUTH_LABEL + "EXPORTER_DTLS_OVER_SCTP" + + ) + +120 + sd�s1_b�m�_� + + +122 +m� +; + +124 +max_�q_num +[8]; + +127 } + tDTLS1_BITMAP +; + +129 + sd�s1_���sm�_��e + + +131 +EVP_CIPHER_CTX + * +�c_wr�e_�x +; + +132 +EVP_MD_CTX + * +wr�e_hash +; + +133 #i�de� +OPENSSL_NO_COMP + + +134 +COMP_CTX + * +com�ess +; + +136 * +com�ess +; + +138 +SSL_SESSION + * +�ssi� +; + +139 +�och +; + +142 + shm_h�d�_� + + +144 +ty� +; + +145 +msg_�n +; + +146 +�q +; + +147 +�ag_off +; + +148 +�ag_�n +; + +149 +is_ccs +; + +150 +d�s1_���sm�_��e + +�ved_���sm�_��e +; + +153 + sccs_h�d�_� + + +155 +ty� +; + +156 +�q +; + +159 + sd�s1_timeout_� + + +162 +�ad_timeouts +; + +165 +wr�e_timeouts +; + +168 +num_��ts +; + +171 + s�c�d_pqueue_� + + +173 +�och +; + +174 +pqueue + +q +; + +175 } + t�c�d_pqueue +; + +177 + shm_�agm�t_� + + +179 +hm_h�d�_� + +msg_h�d� +; + +180 * +�agm�t +; + +181 * +�as�mbly +; + +182 } + thm_�agm�t +; + +184 + sd�s1_��e_� + + +186 +�nd_cook� +; + +187 +cook� +[ +DTLS1_COOKIE_LENGTH +]; + +188 +rcvd_cook� +[ +DTLS1_COOKIE_LENGTH +]; + +189 +cook�_�n +; + +196 +r_�och +; + +197 +w_�och +; + +200 +DTLS1_BITMAP + +b�m� +; + +203 +DTLS1_BITMAP + +�xt_b�m� +; + +206 +h�dshake_wr�e_�q +; + +207 +�xt_h�dshake_wr�e_�q +; + +209 +h�dshake_�ad_�q +; + +212 +ϡ_wr�e_�qu�� +[8]; + +215 +�c�d_pqueue + +u�ro�s�d_rcds +; + +216 +�c�d_pqueue + +�o�s�d_rcds +; + +219 +pqueue + +buf�d_mes�ges +; + +222 +pqueue + +��_mes�ges +; + +229 +�c�d_pqueue + +buf�d_�p_d�a +; + +232 +li�� +; + +234 +mtu +; + +236 +hm_h�d�_� + +w_msg_hdr +; + +237 +hm_h�d�_� + +r_msg_hdr +; + +239 +d�s1_timeout_� + +timeout +; + +242 +timev� + +�xt_timeout +; + +245 +timeout_du�ti� +; + +249 +��t_�agm�t +[ +DTLS1_AL_HEADER_LENGTH +]; + +250 +��t_�agm�t_�n +; + +251 +h�dshake_�agm�t +[ +DTLS1_HM_HEADER_LENGTH +]; + +252 +h�dshake_�agm�t_�n +; + +254 +���sm�t�g +; + +255 +ch�ge_c�h�_�ec_ok +; + +257 #i�de� +OPENSSL_NO_SCTP + + +259 +�xt_��e +; + +261 +shutdown_��ived +; + +264 } + tDTLS1_STATE +; + +266 + sd�s1_�c�d_d�a_� + + +268 * +�ck� +; + +269 +�ck�_�ngth +; + +270 +SSL3_BUFFER + +rbuf +; + +271 +SSL3_RECORD + +�ec +; + +272 #i�de� +OPENSSL_NO_SCTP + + +273 +bio_dg�m_s�p_rcv�fo + +�c�d�fo +; + +275 } + tDTLS1_RECORD_DATA +; + +280 + #DTLS1_TMO_READ_COUNT + 2 + + ) + +281 + #DTLS1_TMO_WRITE_COUNT + 2 + + ) + +283 + #DTLS1_TMO_ALERT_COUNT + 12 + + ) + +285 #ifde� +__�lu�lus + + + @/usr/include/openssl/e_os2.h + +56 + ~<ݒs�/ݒs�c�f.h +> + +58 #i�de� +HEADER_E_OS2_H + + +59 + #HEADER_E_OS2_H + + + ) + +61 #ifde� +__�lu�lus + + +71 + #OPENSSL_SYS_UNIX + + + ) + +74 #i� +def�ed +( +__MWERKS__ +�&& def�ed( +mac�tosh +�|| def�ed( +OPENSSL_SYSNAME_MAC +) + +75 #unde� +OPENSSL_SYS_UNIX + + +76 + #OPENSSL_SYS_MACINTOSH_CLASSIC + + + ) + +80 #i� +def�ed +( +NETWARE +�|| def�ed( +OPENSSL_SYSNAME_NETWARE +) + +81 #unde� +OPENSSL_SYS_UNIX + + +82 + #OPENSSL_SYS_NETWARE + + + ) + +89 #i� +def�ed +( +OPENSSL_SYSNAME_MSDOS +) + +90 #unde� +OPENSSL_SYS_UNIX + + +91 + #OPENSSL_SYS_MSDOS + + + ) + +96 #i� +def�ed +( +OPENSSL_SYSNAME_UWIN +) + +97 #unde� +OPENSSL_SYS_UNIX + + +98 + #OPENSSL_SYS_WIN32_UWIN + + + ) + +100 #i� +def�ed +( +__CYGWIN32__ +�|| def�ed( +OPENSSL_SYSNAME_CYGWIN32 +) + +101 #unde� +OPENSSL_SYS_UNIX + + +102 + #OPENSSL_SYS_WIN32_CYGWIN + + + ) + +104 #i� +def�ed +( +_WIN32 +�|| def�ed( +OPENSSL_SYSNAME_WIN32 +) + +105 #unde� +OPENSSL_SYS_UNIX + + +106 + #OPENSSL_SYS_WIN32 + + + ) + +108 #i� +def�ed +( +OPENSSL_SYSNAME_WINNT +) + +109 #unde� +OPENSSL_SYS_UNIX + + +110 + #OPENSSL_SYS_WINNT + + + ) + +112 #i� +def�ed +( +OPENSSL_SYSNAME_WINCE +) + +113 #unde� +OPENSSL_SYS_UNIX + + +114 + #OPENSSL_SYS_WINCE + + + ) + +120 #i� +def�ed +( +OPENSSL_SYS_WIN32 +�|| def�ed( +OPENSSL_SYS_WINNT +�|| def�ed( +OPENSSL_SYS_WINCE +) + +121 #unde� +OPENSSL_SYS_UNIX + + +122 + #OPENSSL_SYS_WINDOWS + + + ) + +123 #i�de� +OPENSSL_SYS_MSDOS + + +124 + #OPENSSL_SYS_MSDOS + + + ) + +131 #ifde� +OPENSSL_SYS_WINDOWS + + +132 #i�de� +OPENSSL_OPT_WINDLL + + +133 #i� +def�ed +( +_WINDLL +) + +135 + #OPENSSL_OPT_WINDLL + + + ) + +141 #i� +def�ed +( +__VMS +�|| def�ed( +VMS +�|| def�ed( +OPENSSL_SYSNAME_VMS +) + +142 #unde� +OPENSSL_SYS_UNIX + + +143 + #OPENSSL_SYS_VMS + + + ) + +144 #i� +def�ed +( +__DECC +) + +145 + #OPENSSL_SYS_VMS_DECC + + + ) + +146 #�i� +def�ed +( +__DECCXX +) + +147 + #OPENSSL_SYS_VMS_DECC + + + ) + +148 + #OPENSSL_SYS_VMS_DECCXX + + + ) + +150 + #OPENSSL_SYS_VMS_NODECC + + + ) + +155 #i� +def�ed +( +__EMX__ +�|| def�ed( +__OS2__ +) + +156 #unde� +OPENSSL_SYS_UNIX + + +157 + #OPENSSL_SYS_OS2 + + + ) + +161 #ifde� +OPENSSL_SYS_UNIX + + +162 #i� +def�ed +( +l�ux +�|| def�ed( +__l�ux__ +�|| def�ed( +OPENSSL_SYSNAME_LINUX +) + +163 + #OPENSSL_SYS_LINUX + + + ) + +165 #ifde� +OPENSSL_SYSNAME_MPE + + +166 + #OPENSSL_SYS_MPE + + + ) + +168 #ifde� +OPENSSL_SYSNAME_SNI + + +169 + #OPENSSL_SYS_SNI + + + ) + +171 #ifde� +OPENSSL_SYSNAME_ULTRASPARC + + +172 + #OPENSSL_SYS_ULTRASPARC + + + ) + +174 #ifde� +OPENSSL_SYSNAME_NEWS4 + + +175 + #OPENSSL_SYS_NEWS4 + + + ) + +177 #ifde� +OPENSSL_SYSNAME_MACOSX + + +178 + #OPENSSL_SYS_MACOSX + + + ) + +180 #ifde� +OPENSSL_SYSNAME_MACOSX_RHAPSODY + + +181 + #OPENSSL_SYS_MACOSX_RHAPSODY + + + ) + +182 + #OPENSSL_SYS_MACOSX + + + ) + +184 #ifde� +OPENSSL_SYSNAME_SUNOS + + +185 + #OPENSSL_SYS_SUNOS + + + ) + +187 #i� +def�ed +( +_CRAY +�|| def�ed( +OPENSSL_SYSNAME_CRAY +) + +188 + #OPENSSL_SYS_CRAY + + + ) + +190 #i� +def�ed +( +_AIX +�|| def�ed( +OPENSSL_SYSNAME_AIX +) + +191 + #OPENSSL_SYS_AIX + + + ) + +196 #i� +def�ed +( +__VOS__ +�|| def�ed( +OPENSSL_SYSNAME_VOS +) + +197 + #OPENSSL_SYS_VOS + + + ) + +198 #ifde� +__HPPA__ + + +199 + #OPENSSL_SYS_VOS_HPPA + + + ) + +201 #ifde� +__IA32__ + + +202 + #OPENSSL_SYS_VOS_IA32 + + + ) + +207 #ifde� +OPENSSL_SYSNAME_VXWORKS + + +208 + #OPENSSL_SYS_VXWORKS + + + ) + +212 #i� +def�ed +( +__BEOS__ +) + +213 + #OPENSSL_SYS_BEOS + + + ) + +214 + ~<sys/sock�.h +> + +215 #i� +def�ed +( +BONE_VERSION +) + +216 + #OPENSSL_SYS_BEOS_BONE + + + ) + +218 + #OPENSSL_SYS_BEOS_R5 + + + ) + +228 #ifde� +OPENSSL_SYS_MSDOS + + +229 + #OPENSSL_UNISTD_IO + < +io +. +h +> + + ) + +230 + #OPENSSL_DECLARE_EXIT + + `ex� +(); + + ) + +232 + #OPENSSL_UNISTD_IO + +OPENSSL_UNISTD + + + ) + +233 + #OPENSSL_DECLARE_EXIT + + + ) + +255 #i� +def�ed +( +OPENSSL_SYS_VMS_NODECC +) + +256 + #OPENSSL_EXPORT + +glob��f + + + ) + +257 + #OPENSSL_IMPORT + +glob��f + + + ) + +258 + #OPENSSL_GLOBAL + +glob�def + + + ) + +259 #�i� +def�ed +( +OPENSSL_SYS_WINDOWS +�&& def�ed( +OPENSSL_OPT_WINDLL +) + +260 + #OPENSSL_EXPORT + + `__de��ec +( +d�exp�t +) + + ) + +261 + #OPENSSL_IMPORT + + `__de��ec +( +d�imp�t +) + + ) + +262 + #OPENSSL_GLOBAL + + + ) + +264 + #OPENSSL_EXPORT + + + ) + +265 + #OPENSSL_IMPORT + + + ) + +266 + #OPENSSL_GLOBAL + + + ) + +268 + #OPENSSL_EXTERN + +OPENSSL_IMPORT + + + ) + +280 #ifde� +OPENSSL_EXPORT_VAR_AS_FUNCTION + + +281 + #OPENSSL_IMPLEMENT_GLOBAL +( +ty� +, +�me +, +v�ue +) \ + +282 +ty� + * +_shadow_ +## + `�me +() \ + +283 { +ty� + +_hide_ +## +�me += +v�ue +; &_hide_##�me; } + + ) + +284 + #OPENSSL_DECLARE_GLOBAL +( +ty� +, +�me +�ty� * +_shadow_ +## + `�me +() + + ) + +285 + #OPENSSL_GLOBAL_REF +( +�me +�(*( +_shadow_ +## + `�me +())) + + ) + +287 + #OPENSSL_IMPLEMENT_GLOBAL +( +ty� +, +�me +, +v�ue +� +OPENSSL_GLOBAL +�y� +_shadow_ +##�me=v�ue; + + ) + +288 + #OPENSSL_DECLARE_GLOBAL +( +ty� +, +�me +� +OPENSSL_EXPORT +�y� +_shadow_ +## + ) +name + +289 + #OPENSSL_GLOBAL_REF +( +�me +� +_shadow_ +## + ) +name + +292 #i� +def�ed +( +OPENSSL_SYS_MACINTOSH_CLASSIC +�&& +mac�tosh +==1 && !def�ed( +MAC_OS_GUSI_SOURCE +) + +293 + #os�_ssize_t + + + ) + +296 #ifde� +OPENSSL_SYS_MSDOS + + +297 + #os�_ssize_t + + + ) + +300 #i� +def�ed +( +NeXT +�|| def�ed( +OPENSSL_SYS_NEWS4 +�|| def�ed( +OPENSSL_SYS_SUNOS +) + +301 + #ssize_t + + + ) + +304 #i� +def�ed +( +__u�rix +�&& !def�ed( +ssize_t +) + +305 + #os�_ssize_t + + + ) + +308 #i�de� +os�_ssize_t + + +309 + #os�_ssize_t + +ssize_t + + + ) + +312 #ifde� +__�lu�lus + + + @/usr/include/openssl/ecdh.h + +69 #i�de� +HEADER_ECDH_H + + +70 + #HEADER_ECDH_H + + + ) + +72 + ~<ݒs�/ݒs�c�f.h +> + +74 #ifde� +OPENSSL_NO_ECDH + + +75 #�r� +ECDH + +is + +di�b�d +. + +78 + ~<ݒs�/ec.h +> + +79 + ~<ݒs�/os�_typ.h +> + +80 #i�de� +OPENSSL_NO_DEPRECATED + + +81 + ~<ݒs�/bn.h +> + +84 #ifde� +__�lu�lus + + +88 cڡ +ECDH_METHOD + * +ECDH_O�nSSL +(); + +90 +ECDH_�t_de�u�_m�hod +(cڡ +ECDH_METHOD + *); + +91 cڡ +ECDH_METHOD + * +ECDH_g�_de�u�_m�hod +(); + +92 +ECDH_�t_m�hod +( +EC_KEY + *, cڡ +ECDH_METHOD + *); + +94 +ECDH_compu�_key +(* +out +, +size_t + +ou�� +, cڡ +EC_POINT + * +pub_key +, +EC_KEY + * +ecdh +, + +95 *(* +KDF +)(cڡ * +� +, +size_t + +��n +, * +out +, size_�* +ou�� +)); + +97 +ECDH_g�_ex_�w_�dex +( +�gl +, * +�gp +, +CRYPTO_EX_�w + + +98 * +�w_func +, +CRYPTO_EX_dup + * +dup_func +, +CRYPTO_EX_� + * +�_func +); + +99 +ECDH_�t_ex_d�a +( +EC_KEY + * +d +, +idx +, * +�g +); + +100 * +ECDH_g�_ex_d�a +( +EC_KEY + * +d +, +idx +); + +107 +ERR_l�d_ECDH_�r�gs +(); + +112 + #ECDH_F_ECDH_CHECK + 102 + + ) + +113 + #ECDH_F_ECDH_COMPUTE_KEY + 100 + + ) + +114 + #ECDH_F_ECDH_DATA_NEW_METHOD + 101 + + ) + +117 + #ECDH_R_KDF_FAILED + 102 + + ) + +118 + #ECDH_R_NON_FIPS_METHOD + 103 + + ) + +119 + #ECDH_R_NO_PRIVATE_VALUE + 100 + + ) + +120 + #ECDH_R_POINT_ARITHMETIC_FAILURE + 101 + + ) + +122 #ifde� +__�lu�lus + + + @/usr/include/openssl/ecdsa.h + +59 #i�de� +HEADER_ECDSA_H + + +60 + #HEADER_ECDSA_H + + + ) + +62 + ~<ݒs�/ݒs�c�f.h +> + +64 #ifde� +OPENSSL_NO_ECDSA + + +65 #�r� +ECDSA + +is + +di�b�d +. + +68 + ~<ݒs�/ec.h +> + +69 + ~<ݒs�/os�_typ.h +> + +70 #i�de� +OPENSSL_NO_DEPRECATED + + +71 + ~<ݒs�/bn.h +> + +74 #ifde� +__�lu�lus + + +78 + sECDSA_SIG_� + + +80 +BIGNUM + * +r +; + +81 +BIGNUM + * +s +; + +82 } + tECDSA_SIG +; + +87 +ECDSA_SIG + * +ECDSA_SIG_�w +(); + +92 +ECDSA_SIG_� +( +ECDSA_SIG + * +sig +); + +100 +i2d_ECDSA_SIG +(cڡ +ECDSA_SIG + * +sig +, ** +� +); + +109 +ECDSA_SIG + * +d2i_ECDSA_SIG +(ECDSA_SIG ** +sig +, cڡ ** +� +, +�n +); + +118 +ECDSA_SIG + * +ECDSA_do_sign +(cڡ * +dg� +, +dg�_�n +, +EC_KEY + * +eckey +); + +130 +ECDSA_SIG + * +ECDSA_do_sign_ex +(cڡ * +dg� +, +dg��n +, + +131 cڡ +BIGNUM + * +k�v +, cڡ BIGNUM * +� +, +EC_KEY + * +eckey +); + +142 +ECDSA_do_v�ify +(cڡ * +dg� +, +dg�_�n +, + +143 cڡ +ECDSA_SIG + * +sig +, +EC_KEY +* +eckey +); + +145 cڡ +ECDSA_METHOD + * +ECDSA_O�nSSL +(); + +150 +ECDSA_�t_de�u�_m�hod +(cڡ +ECDSA_METHOD + * +m�h +); + +155 cڡ +ECDSA_METHOD + * +ECDSA_g�_de�u�_m�hod +(); + +162 +ECDSA_�t_m�hod +( +EC_KEY + * +eckey +, cڡ +ECDSA_METHOD + * +m�h +); + +168 +ECDSA_size +(cڡ +EC_KEY + * +eckey +); + +177 +ECDSA_sign_�tup +( +EC_KEY + * +eckey +, +BN_CTX + * +�x +, +BIGNUM + ** +k�v +, + +178 +BIGNUM + ** +� +); + +190 +ECDSA_sign +( +ty� +, cڡ * +dg� +, +dg��n +, + +191 * +sig +, * +sig�n +, +EC_KEY + * +eckey +); + +207 +ECDSA_sign_ex +( +ty� +, cڡ * +dg� +, +dg��n +, + +208 * +sig +, * +sig�n +, cڡ +BIGNUM + * +k�v +, + +209 cڡ +BIGNUM + * +� +, +EC_KEY + * +eckey +); + +222 +ECDSA_v�ify +( +ty� +, cڡ * +dg� +, +dg��n +, + +223 cڡ * +sig +, +sig�n +, +EC_KEY + * +eckey +); + +226 +ECDSA_g�_ex_�w_�dex +( +�gl +, * +�gp +, +CRYPTO_EX_�w + + +227 * +�w_func +, +CRYPTO_EX_dup + * +dup_func +, +CRYPTO_EX_� + * +�_func +); + +228 +ECDSA_�t_ex_d�a +( +EC_KEY + * +d +, +idx +, * +�g +); + +229 * +ECDSA_g�_ex_d�a +( +EC_KEY + * +d +, +idx +); + +236 +ERR_l�d_ECDSA_�r�gs +(); + +241 + #ECDSA_F_ECDSA_CHECK + 104 + + ) + +242 + #ECDSA_F_ECDSA_DATA_NEW_METHOD + 100 + + ) + +243 + #ECDSA_F_ECDSA_DO_SIGN + 101 + + ) + +244 + #ECDSA_F_ECDSA_DO_VERIFY + 102 + + ) + +245 + #ECDSA_F_ECDSA_SIGN_SETUP + 103 + + ) + +248 + #ECDSA_R_BAD_SIGNATURE + 100 + + ) + +249 + #ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE + 101 + + ) + +250 + #ECDSA_R_ERR_EC_LIB + 102 + + ) + +251 + #ECDSA_R_MISSING_PARAMETERS + 103 + + ) + +252 + #ECDSA_R_NEED_NEW_SETUP_VALUES + 106 + + ) + +253 + #ECDSA_R_NON_FIPS_METHOD + 107 + + ) + +254 + #ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED + 104 + + ) + +255 + #ECDSA_R_SIGNATURE_MALLOC_FAILED + 105 + + ) + +257 #ifde� +__�lu�lus + + + @/usr/include/openssl/hmac.h + +58 #i�de� +HEADER_HMAC_H + + +59 + #HEADER_HMAC_H + + + ) + +61 + ~<ݒs�/ݒs�c�f.h +> + +63 #ifde� +OPENSSL_NO_HMAC + + +64 #�r� +HMAC + +is + +di�b�d +. + +67 + ~<ݒs�/evp.h +> + +69 + #HMAC_MAX_MD_CBLOCK + 128 + + ) + +71 #ifde� +__�lu�lus + + +75 + shmac_�x_� + + +77 cڡ +EVP_MD + * +md +; + +78 +EVP_MD_CTX + +md_�x +; + +79 +EVP_MD_CTX + +i_�x +; + +80 +EVP_MD_CTX + +o_�x +; + +81 +key_�ngth +; + +82 +key +[ +HMAC_MAX_MD_CBLOCK +]; + +83 } + tHMAC_CTX +; + +85 + #HMAC_size +( +e +�( + `EVP_MD_size +(�)-> +md +)) + + ) + +88 +HMAC_CTX_�� +( +HMAC_CTX + * +�x +); + +89 +HMAC_CTX_��nup +( +HMAC_CTX + * +�x +); + +91 + #HMAC_��nup +( +�x +� + `HMAC_CTX_��nup +(�x� + + ) + +93 +HMAC_In� +( +HMAC_CTX + * +�x +, cڡ * +key +, +�n +, + +94 cڡ +EVP_MD + * +md +); + +95 +HMAC_In�_ex +( +HMAC_CTX + * +�x +, cڡ * +key +, +�n +, + +96 cڡ +EVP_MD + * +md +, +ENGINE + * +im� +); + +97 +HMAC_Upd�e +( +HMAC_CTX + * +�x +, cڡ * +d�a +, +size_t + +�n +); + +98 +HMAC_F�� +( +HMAC_CTX + * +�x +, * +md +, * +�n +); + +99 * +HMAC +(cڡ +EVP_MD + * +evp_md +, cڡ * +key +, +key_�n +, + +100 cڡ * +d +, +size_t + +n +, * +md +, + +101 * +md_�n +); + +102 +HMAC_CTX_c�y +( +HMAC_CTX + * +d�x +, HMAC_CTX * +s�x +); + +104 +HMAC_CTX_�t_�ags +( +HMAC_CTX + * +�x +, +�ags +); + +106 #ifde� +__�lu�lus + + + @/usr/include/openssl/kssl.h + +63 #i�def +KSSL_H + + +64 + #KSSL_H + + + ) + +66 + ~<ݒs�/ݒs�c�f.h +> + +68 #i�de� +OPENSSL_NO_KRB5 + + +70 + ~<�dio.h +> + +71 + ~<�y�.h +> + +72 + ~<krb5.h +> + +74 #ifde� +__�lu�lus + + +82 #ifde� +KRB5_HEIMDAL + + +83 + tkrb5_o�� +; + +84 + #FAR + + + ) + +87 #i�de� +FAR + + +88 + #FAR + + + ) + +99 #i�def +KRB5SVC + + +100 + #KRB5SVC + "ho�" + + ) + +103 #i�def +KRB5KEYTAB + + +104 + #KRB5KEYTAB + "/�c/krb5.key�b" + + ) + +107 #i�de� +KRB5SENDAUTH + + +108 + #KRB5SENDAUTH + 1 + + ) + +111 #i�de� +KRB5CHECKAUTH + + +112 + #KRB5CHECKAUTH + 1 + + ) + +115 #i�de� +KSSL_CLOCKSKEW + + +116 + #KSSL_CLOCKSKEW + 300; + + ) + +119 + #KSSL_ERR_MAX + 255 + + ) + +120 + sks�_�r_� + { + +121 + g�as� +; + +122 + g�xt +[ +KSSL_ERR_MAX ++1]; + +123 } + tKSSL_ERR +; + +130 + sks�_�x_� + + +133 * + g�rvi�_�me +; + +134 * + g�rvi�_ho� +; + +135 * + g���_��c +; + +136 * + gkey�b_f�e +; + +137 * + g�ed_�che +; + +138 +krb5_��y� + + g��y� +; + +139 + g�ngth +; + +140 +krb5_o�� + +FAR + * + gkey +; + +141 } + tKSSL_CTX +; + +143 + #KSSL_CLIENT + 1 + + ) + +144 + #KSSL_SERVER + 2 + + ) + +145 + #KSSL_SERVICE + 3 + + ) + +146 + #KSSL_KEYTAB + 4 + + ) + +148 + #KSSL_CTX_OK + 0 + + ) + +149 + #KSSL_CTX_ERR + 1 + + ) + +150 + #KSSL_NOMEM + 2 + + ) + +153 +krb5_�r�_code + +ks�_�x_�t�r�g +( +KSSL_CTX + * +ks�_�x +, +which +, * +�xt +); + +154 +KSSL_CTX + * +ks�_�x_�w +(); + +155 +KSSL_CTX + * +ks�_�x_� +(KSSL_CTX * +ks�_�x +); + +156 +ks�_�x_show +( +KSSL_CTX + * +ks�_�x +); + +157 +krb5_�r�_code + +ks�_�x_��r�c +( +KSSL_CTX + * +ks�_�x +, +which +, + +158 +krb5_d�a + * +��m +, krb5_d��* +�t�y +, +����s +); + +159 +krb5_�r�_code + +ks�_cg�_tkt +( +KSSL_CTX + * +ks�_�x +, +krb5_d�a + ** +�c_tk� +, + +160 +krb5_d�a + * +auth�p +, +KSSL_ERR + * +ks�_�r +); + +161 +krb5_�r�_code + +ks�_sg�_tkt +( +KSSL_CTX + * +ks�_�x +, +krb5_d�a + * +�d�a +, + +162 +krb5_tick�_times + * +�imes +, +KSSL_ERR + * +ks�_�r +); + +163 +krb5_�r�_code + +ks�_�x_�tkey +( +KSSL_CTX + * +ks�_�x +, +krb5_keyblock + * +�ssi� +); + +164 +ks�_�r_�t +( +KSSL_ERR + * +ks�_�r +, +�as� +, * +�xt +); + +165 +ks�_krb5_�_d�a_cڋ�s +( +krb5_cڋxt + +cڋxt +, +krb5_d�a + * +d�a +); + +166 +krb5_�r�_code + +ks�_bu�d_��c��_2 +( +krb5_cڋxt + +cڋxt +, + +167 +krb5_��c�� + * +��c +, +�� +, cڡ * +��m +, + +168 +�� +, cڡ * +svc +, +h�n +, cڡ * +ho� +); + +169 +krb5_�r�_code + +ks�_v�id�e_times +( +krb5_time�amp + +�ime +, + +170 +krb5_tick�_times + * +�imes +); + +171 +krb5_�r�_code + +ks�_check_auth�t +( +KSSL_CTX + * +ks�_�x +, +krb5_d�a + * +auth�� +, + +172 +krb5_time�amp + * +�im� +, +KSSL_ERR + * +ks�_�r +); + +173 * +ks�_sk�_c�found +( +krb5_��y� + +��y� +, * +authn +); + +175 +SSL_�t0_ks�_�x +( +SSL + * +s +, +KSSL_CTX + * +k�x +); + +176 +KSSL_CTX + * +SSL_g�0_ks�_�x +( +SSL + * +s +); + +177 * +ks�_�x_g�0_���_��c +( +KSSL_CTX + * +k�x +); + +179 #ifde� +__�lu�lus + + + @/usr/include/openssl/lhash.h + +63 #i�de� +HEADER_LHASH_H + + +64 + #HEADER_LHASH_H + + + ) + +66 + ~<ݒs�/e_os2.h +> + +67 #i�de� +OPENSSL_NO_FP_API + + +68 + ~<�dio.h +> + +71 #i�de� +OPENSSL_NO_BIO + + +72 + ~<ݒs�/bio.h +> + +75 #ifde� +__�lu�lus + + +79 + slhash_node_� + + +81 * +d�a +; + +82 +lhash_node_� + * +�xt +; + +83 #i�de� +OPENSSL_NO_HASH_COMP + + +84 +hash +; + +86 } + tLHASH_NODE +; + +88 (* +LHASH_COMP_FN_TYPE +)(const *, const *); + +89 (* + tLHASH_HASH_FN_TYPE +)(const *); + +90 (* +LHASH_DOALL_FN_TYPE +)(*); + +91 (* +LHASH_DOALL_ARG_FN_TYPE +)(*, *); + +101 + #DECLARE_LHASH_HASH_FN +( +�me +, +o_ty� +) \ + +102 +�me +## + `_LHASH_HASH +(cڡ *); + + ) + +103 + #IMPLEMENT_LHASH_HASH_FN +( +�me +, +o_ty� +) \ + +104 +�me +## + `_LHASH_HASH +(cڡ * +�g +) { \ + +105 cڡ +o_ty� + * +a + = +�g +; \ + +106 +�me +## + `_hash +( +a +); } + + ) + +107 + #LHASH_HASH_FN +( +�me +��me## +_LHASH_HASH + + + ) + +110 + #DECLARE_LHASH_COMP_FN +( +�me +, +o_ty� +) \ + +111 +�me +## + `_LHASH_COMP +(cڡ *, cڡ *); + + ) + +112 + #IMPLEMENT_LHASH_COMP_FN +( +�me +, +o_ty� +) \ + +113 +�me +## + `_LHASH_COMP +(cڡ * +�g1 +, cڡ * +�g2 +) { \ + +114 cڡ +o_ty� + * +a + = +�g1 +; \ + +115 cڡ +o_ty� + * +b + = +�g2 +; \ + +116 +�me +## + `_cmp +( +a +, +b +); } + + ) + +117 + #LHASH_COMP_FN +( +�me +��me## +_LHASH_COMP + + + ) + +120 + #DECLARE_LHASH_DOALL_FN +( +�me +, +o_ty� +) \ + +121 +�me +## + `_LHASH_DOALL +(*); + + ) + +122 + #IMPLEMENT_LHASH_DOALL_FN +( +�me +, +o_ty� +) \ + +123 +�me +## + `_LHASH_DOALL +(* +�g +) { \ + +124 +o_ty� + * +a + = +�g +; \ + +125 +�me +## + `_d�� +( +a +); } + + ) + +126 + #LHASH_DOALL_FN +( +�me +��me## +_LHASH_DOALL + + + ) + +129 + #DECLARE_LHASH_DOALL_ARG_FN +( +�me +, +o_ty� +, +a_ty� +) \ + +130 +�me +## + `_LHASH_DOALL_ARG +(*, *); + + ) + +131 + #IMPLEMENT_LHASH_DOALL_ARG_FN +( +�me +, +o_ty� +, +a_ty� +) \ + +132 +�me +## + `_LHASH_DOALL_ARG +(* +�g1 +, * +�g2 +) { \ + +133 +o_ty� + * +a + = +�g1 +; \ + +134 +a_ty� + * +b + = +�g2 +; \ + +135 +�me +## + `_d��_�g +( +a +, +b +); } + + ) + +136 + #LHASH_DOALL_ARG_FN +( +�me +��me## +_LHASH_DOALL_ARG + + + ) + +138 + slhash_� + + +140 +LHASH_NODE + ** +b +; + +141 +LHASH_COMP_FN_TYPE + +comp +; + +142 +LHASH_HASH_FN_TYPE + +hash +; + +143 +num_nodes +; + +144 +num_�loc_nodes +; + +145 +p +; + +146 +pmax +; + +147 +up_l�d +; + +148 +down_l�d +; + +149 +num_�ems +; + +151 +num_ex�nds +; + +152 +num_ex�nd_��locs +; + +153 +num_cڌa�s +; + +154 +num_cڌa�_��locs +; + +155 +num_hash_��s +; + +156 +num_comp_��s +; + +157 +num_��� +; + +158 +num_��a� +; + +159 +num_d��e +; + +160 +num_no_d��e +; + +161 +num_���ve +; + +162 +num_���ve_miss +; + +163 +num_hash_comps +; + +165 +�r� +; + +166 } + t_LHASH +; + +169 + #LH_LOAD_MULT + 256 + + ) + +173 + #lh_�r� +( +lh +�(�h)-> +�r� +) + + ) + +175 +_LHASH + * +lh_�w +( +LHASH_HASH_FN_TYPE + +h +, +LHASH_COMP_FN_TYPE + +c +); + +176 +lh_� +( +_LHASH + * +lh +); + +177 * +lh_��� +( +_LHASH + * +lh +, * +d�a +); + +178 * +lh_d��e +( +_LHASH + * +lh +, cڡ * +d�a +); + +179 * +lh_���ve +( +_LHASH + * +lh +, cڡ * +d�a +); + +180 +lh_d�� +( +_LHASH + * +lh +, +LHASH_DOALL_FN_TYPE + +func +); + +181 +lh_d��_�g +( +_LHASH + * +lh +, +LHASH_DOALL_ARG_FN_TYPE + +func +, * +�g +); + +182 +lh_�rhash +(cڡ * +c +); + +183 +lh_num_�ems +(cڡ +_LHASH + * +lh +); + +185 #i�de� +OPENSSL_NO_FP_API + + +186 +lh_��s +(cڡ +_LHASH + * +lh +, +FILE + * +out +); + +187 +lh_node_��s +(cڡ +_LHASH + * +lh +, +FILE + * +out +); + +188 +lh_node_u�ge_��s +(cڡ +_LHASH + * +lh +, +FILE + * +out +); + +191 #i�de� +OPENSSL_NO_BIO + + +192 +lh_��s_bio +(cڡ +_LHASH + * +lh +, +BIO + * +out +); + +193 +lh_node_��s_bio +(cڡ +_LHASH + * +lh +, +BIO + * +out +); + +194 +lh_node_u�ge_��s_bio +(cڡ +_LHASH + * +lh +, +BIO + * +out +); + +199 + #LHASH_OF +( +ty� +� +lhash_�_ +## + ) +type + +201 + #DECLARE_LHASH_OF +( +ty� +� + `LHASH_OF +�y��{ +dummy +; } + + ) + +203 + #CHECKED_LHASH_OF +( +ty� +, +lh +) \ + +204 (( +_LHASH + *) + `CHECKED_PTR_OF +( + `LHASH_OF +( +ty� +), +lh +)) + + ) + +207 + #LHM_lh_�w +( +ty� +, +�me +) \ + +208 (( + `LHASH_OF +( +ty� +�*) + `lh_�w +( + `LHASH_HASH_FN +( +�me +), + `LHASH_COMP_FN +�ame))) + + ) + +209 + #LHM_lh_�r� +( +ty� +, +lh +) \ + +210 + `lh_�r� +( + `CHECKED_LHASH_OF +( +ty� +, +lh +)) + + ) + +211 + #LHM_lh_��� +( +ty� +, +lh +, +�� +) \ + +212 (( +ty� + *) + `lh_��� +( + `CHECKED_LHASH_OF +�y�, +lh +), \ + +213 + `CHECKED_PTR_OF +( +ty� +, +�� +))) + + ) + +214 + #LHM_lh_���ve +( +ty� +, +lh +, +�� +) \ + +215 (( +ty� + *) + `lh_���ve +( + `CHECKED_LHASH_OF +�y�, +lh +), \ + +216 + `CHECKED_PTR_OF +( +ty� +, +�� +))) + + ) + +217 + #LHM_lh_d��e +( +ty� +, +lh +, +�� +) \ + +218 (( +ty� + *) + `lh_d��e +( + `CHECKED_LHASH_OF +�y�, +lh +), \ + +219 + `CHECKED_PTR_OF +( +ty� +, +�� +))) + + ) + +220 + #LHM_lh_d�� +( +ty� +, +lh +, +� +� + `lh_d�� +( + `CHECKED_LHASH_OF +�y�,�h), fn) + + ) + +221 + #LHM_lh_d��_�g +( +ty� +, +lh +, +� +, +�g_ty� +, +�g +) \ + +222 + `lh_d��_�g +( + `CHECKED_LHASH_OF +( +ty� +, +lh +), +� +, + `CHECKED_PTR_OF +( +�g_ty� +, +�g +)) + + ) + +223 + #LHM_lh_num_�ems +( +ty� +, +lh +� + `lh_num_�ems +( + `CHECKED_LHASH_OF +�y�,�h)) + + ) + +224 + #LHM_lh_down_l�d +( +ty� +, +lh +�( + `CHECKED_LHASH_OF +�y�,�h)-> +down_l�d +) + + ) + +225 + #LHM_lh_node_��s_bio +( +ty� +, +lh +, +out +) \ + +226 + `lh_node_��s_bio +( + `CHECKED_LHASH_OF +( +ty� +, +lh +), +out +) + + ) + +227 + #LHM_lh_node_u�ge_��s_bio +( +ty� +, +lh +, +out +) \ + +228 + `lh_node_u�ge_��s_bio +( + `CHECKED_LHASH_OF +( +ty� +, +lh +), +out +) + + ) + +229 + #LHM_lh_��s_bio +( +ty� +, +lh +, +out +) \ + +230 + `lh_��s_bio +( + `CHECKED_LHASH_OF +( +ty� +, +lh +), +out +) + + ) + +231 + #LHM_lh_� +( +ty� +, +lh +� + `lh_� +( + `CHECKED_LHASH_OF +�y�,�h)) + + ) + +233 +DECLARE_LHASH_OF +( +OPENSSL_STRING +); + +234 +DECLARE_LHASH_OF +( +OPENSSL_CSTRING +); + +236 #ifde� +__�lu�lus + + + @/usr/include/openssl/objects.h + +59 #i�de� +HEADER_OBJECTS_H + + +60 + #HEADER_OBJECTS_H + + + ) + +62 + #USE_OBJ_MAC + + + ) + +64 #ifde� +USE_OBJ_MAC + + +65 + ~<ݒs�/obj_mac.h +> + +67 + #SN_undef + "UNDEF" + + ) + +68 + #LN_undef + "undef�ed" + + ) + +69 + #NID_undef + 0 + + ) + +70 + #OBJ_undef + 0L + + ) + +72 + #SN_Algܙhm + "Algܙhm" + + ) + +73 + #LN_�gܙhm + "�gܙhm" + + ) + +74 + #NID_�gܙhm + 38 + + ) + +75 + #OBJ_�gܙhm + 1L,3L,14L,3L,2L + + ) + +77 + #LN_r�dsi + "r�dsi" + + ) + +78 + #NID_r�dsi + 1 + + ) + +79 + #OBJ_r�dsi + 1L,2L,840L,113549L + + ) + +81 + #LN_pkcs + "pkcs" + + ) + +82 + #NID_pkcs + 2 + + ) + +83 + #OBJ_pkcs + +OBJ_r�dsi +,1L + + ) + +85 + #SN_md2 + "MD2" + + ) + +86 + #LN_md2 + "md2" + + ) + +87 + #NID_md2 + 3 + + ) + +88 + #OBJ_md2 + +OBJ_r�dsi +,2L,2L + + ) + +90 + #SN_md5 + "MD5" + + ) + +91 + #LN_md5 + "md5" + + ) + +92 + #NID_md5 + 4 + + ) + +93 + #OBJ_md5 + +OBJ_r�dsi +,2L,5L + + ) + +95 + #SN_rc4 + "RC4" + + ) + +96 + #LN_rc4 + "rc4" + + ) + +97 + #NID_rc4 + 5 + + ) + +98 + #OBJ_rc4 + +OBJ_r�dsi +,3L,4L + + ) + +100 + #LN_r�En�y�i� + "r�En�y�i�" + + ) + +101 + #NID_r�En�y�i� + 6 + + ) + +102 + #OBJ_r�En�y�i� + +OBJ_pkcs +,1L,1L + + ) + +104 + #SN_md2W�hRSAEn�y�i� + "RSA-MD2" + + ) + +105 + #LN_md2W�hRSAEn�y�i� + "md2W�hRSAEn�y�i�" + + ) + +106 + #NID_md2W�hRSAEn�y�i� + 7 + + ) + +107 + #OBJ_md2W�hRSAEn�y�i� + +OBJ_pkcs +,1L,2L + + ) + +109 + #SN_md5W�hRSAEn�y�i� + "RSA-MD5" + + ) + +110 + #LN_md5W�hRSAEn�y�i� + "md5W�hRSAEn�y�i�" + + ) + +111 + #NID_md5W�hRSAEn�y�i� + 8 + + ) + +112 + #OBJ_md5W�hRSAEn�y�i� + +OBJ_pkcs +,1L,4L + + ) + +114 + #SN_pbeW�hMD2AndDES_CBC + "PBE-MD2-DES" + + ) + +115 + #LN_pbeW�hMD2AndDES_CBC + "pbeW�hMD2AndDES-CBC" + + ) + +116 + #NID_pbeW�hMD2AndDES_CBC + 9 + + ) + +117 + #OBJ_pbeW�hMD2AndDES_CBC + +OBJ_pkcs +,5L,1L + + ) + +119 + #SN_pbeW�hMD5AndDES_CBC + "PBE-MD5-DES" + + ) + +120 + #LN_pbeW�hMD5AndDES_CBC + "pbeW�hMD5AndDES-CBC" + + ) + +121 + #NID_pbeW�hMD5AndDES_CBC + 10 + + ) + +122 + #OBJ_pbeW�hMD5AndDES_CBC + +OBJ_pkcs +,5L,3L + + ) + +124 + #LN_X500 + "X500" + + ) + +125 + #NID_X500 + 11 + + ) + +126 + #OBJ_X500 + 2L,5L + + ) + +128 + #LN_X509 + "X509" + + ) + +129 + #NID_X509 + 12 + + ) + +130 + #OBJ_X509 + +OBJ_X500 +,4L + + ) + +132 + #SN_comm�Name + "CN" + + ) + +133 + #LN_comm�Name + "comm�Name" + + ) + +134 + #NID_comm�Name + 13 + + ) + +135 + #OBJ_comm�Name + +OBJ_X509 +,3L + + ) + +137 + #SN_cou�ryName + "C" + + ) + +138 + #LN_cou�ryName + "cou�ryName" + + ) + +139 + #NID_cou�ryName + 14 + + ) + +140 + #OBJ_cou�ryName + +OBJ_X509 +,6L + + ) + +142 + #SN_lo�l�yName + "L" + + ) + +143 + #LN_lo�l�yName + "lo�l�yName" + + ) + +144 + #NID_lo�l�yName + 15 + + ) + +145 + #OBJ_lo�l�yName + +OBJ_X509 +,7L + + ) + +150 + #SN_��eOrProv��Name + "ST" + + ) + +151 + #LN_��eOrProv��Name + "��eOrProv��Name" + + ) + +152 + #NID_��eOrProv��Name + 16 + + ) + +153 + #OBJ_��eOrProv��Name + +OBJ_X509 +,8L + + ) + +155 + #SN_�g�iz�i�Name + "O" + + ) + +156 + #LN_�g�iz�i�Name + "�g�iz�i�Name" + + ) + +157 + #NID_�g�iz�i�Name + 17 + + ) + +158 + #OBJ_�g�iz�i�Name + +OBJ_X509 +,10L + + ) + +160 + #SN_�g�iz�iڮUn�Name + "OU" + + ) + +161 + #LN_�g�iz�iڮUn�Name + "�g�iz�iڮUn�Name" + + ) + +162 + #NID_�g�iz�iڮUn�Name + 18 + + ) + +163 + #OBJ_�g�iz�iڮUn�Name + +OBJ_X509 +,11L + + ) + +165 + #SN_r� + "RSA" + + ) + +166 + #LN_r� + "r�" + + ) + +167 + #NID_r� + 19 + + ) + +168 + #OBJ_r� + +OBJ_X500 +,8L,1L,1L + + ) + +170 + #LN_pkcs7 + "pkcs7" + + ) + +171 + #NID_pkcs7 + 20 + + ) + +172 + #OBJ_pkcs7 + +OBJ_pkcs +,7L + + ) + +174 + #LN_pkcs7_d�a + "pkcs7-d�a" + + ) + +175 + #NID_pkcs7_d�a + 21 + + ) + +176 + #OBJ_pkcs7_d�a + +OBJ_pkcs7 +,1L + + ) + +178 + #LN_pkcs7_sig�d + "pkcs7-sig�dD�a" + + ) + +179 + #NID_pkcs7_sig�d + 22 + + ) + +180 + #OBJ_pkcs7_sig�d + +OBJ_pkcs7 +,2L + + ) + +182 + #LN_pkcs7_�v��ed + "pkcs7-�v��edD�a" + + ) + +183 + #NID_pkcs7_�v��ed + 23 + + ) + +184 + #OBJ_pkcs7_�v��ed + +OBJ_pkcs7 +,3L + + ) + +186 + #LN_pkcs7_sig�dAndEnv��ed + "pkcs7-sig�dAndEnv��edD�a" + + ) + +187 + #NID_pkcs7_sig�dAndEnv��ed + 24 + + ) + +188 + #OBJ_pkcs7_sig�dAndEnv��ed + +OBJ_pkcs7 +,4L + + ) + +190 + #LN_pkcs7_dige� + "pkcs7-dige�D�a" + + ) + +191 + #NID_pkcs7_dige� + 25 + + ) + +192 + #OBJ_pkcs7_dige� + +OBJ_pkcs7 +,5L + + ) + +194 + #LN_pkcs7_��y�ed + "pkcs7-��y�edD�a" + + ) + +195 + #NID_pkcs7_��y�ed + 26 + + ) + +196 + #OBJ_pkcs7_��y�ed + +OBJ_pkcs7 +,6L + + ) + +198 + #LN_pkcs3 + "pkcs3" + + ) + +199 + #NID_pkcs3 + 27 + + ) + +200 + #OBJ_pkcs3 + +OBJ_pkcs +,3L + + ) + +202 + #LN_dhKeyAg�em�t + "dhKeyAg�em�t" + + ) + +203 + #NID_dhKeyAg�em�t + 28 + + ) + +204 + #OBJ_dhKeyAg�em�t + +OBJ_pkcs3 +,1L + + ) + +206 + #SN_des_ecb + "DES-ECB" + + ) + +207 + #LN_des_ecb + "des-ecb" + + ) + +208 + #NID_des_ecb + 29 + + ) + +209 + #OBJ_des_ecb + +OBJ_�gܙhm +,6L + + ) + +211 + #SN_des_cfb64 + "DES-CFB" + + ) + +212 + #LN_des_cfb64 + "des-cfb" + + ) + +213 + #NID_des_cfb64 + 30 + + ) + +215 + #OBJ_des_cfb64 + +OBJ_�gܙhm +,9L + + ) + +217 + #SN_des_cbc + "DES-CBC" + + ) + +218 + #LN_des_cbc + "des-cbc" + + ) + +219 + #NID_des_cbc + 31 + + ) + +221 + #OBJ_des_cbc + +OBJ_�gܙhm +,7L + + ) + +223 + #SN_des_ede + "DES-EDE" + + ) + +224 + #LN_des_ede + "des-ede" + + ) + +225 + #NID_des_ede + 32 + + ) + +227 + #OBJ_des_ede + +OBJ_�gܙhm +,17L + + ) + +229 + #SN_des_ede3 + "DES-EDE3" + + ) + +230 + #LN_des_ede3 + "des-ede3" + + ) + +231 + #NID_des_ede3 + 33 + + ) + +233 + #SN_id�_cbc + "IDEA-CBC" + + ) + +234 + #LN_id�_cbc + "id�-cbc" + + ) + +235 + #NID_id�_cbc + 34 + + ) + +236 + #OBJ_id�_cbc + 1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L + + ) + +238 + #SN_id�_cfb64 + "IDEA-CFB" + + ) + +239 + #LN_id�_cfb64 + "id�-cfb" + + ) + +240 + #NID_id�_cfb64 + 35 + + ) + +242 + #SN_id�_ecb + "IDEA-ECB" + + ) + +243 + #LN_id�_ecb + "id�-ecb" + + ) + +244 + #NID_id�_ecb + 36 + + ) + +246 + #SN_rc2_cbc + "RC2-CBC" + + ) + +247 + #LN_rc2_cbc + "rc2-cbc" + + ) + +248 + #NID_rc2_cbc + 37 + + ) + +249 + #OBJ_rc2_cbc + +OBJ_r�dsi +,3L,2L + + ) + +251 + #SN_rc2_ecb + "RC2-ECB" + + ) + +252 + #LN_rc2_ecb + "rc2-ecb" + + ) + +253 + #NID_rc2_ecb + 38 + + ) + +255 + #SN_rc2_cfb64 + "RC2-CFB" + + ) + +256 + #LN_rc2_cfb64 + "rc2-cfb" + + ) + +257 + #NID_rc2_cfb64 + 39 + + ) + +259 + #SN_rc2_ofb64 + "RC2-OFB" + + ) + +260 + #LN_rc2_ofb64 + "rc2-ofb" + + ) + +261 + #NID_rc2_ofb64 + 40 + + ) + +263 + #SN_sha + "SHA" + + ) + +264 + #LN_sha + "sha" + + ) + +265 + #NID_sha + 41 + + ) + +266 + #OBJ_sha + +OBJ_�gܙhm +,18L + + ) + +268 + #SN_shaW�hRSAEn�y�i� + "RSA-SHA" + + ) + +269 + #LN_shaW�hRSAEn�y�i� + "shaW�hRSAEn�y�i�" + + ) + +270 + #NID_shaW�hRSAEn�y�i� + 42 + + ) + +271 + #OBJ_shaW�hRSAEn�y�i� + +OBJ_�gܙhm +,15L + + ) + +273 + #SN_des_ede_cbc + "DES-EDE-CBC" + + ) + +274 + #LN_des_ede_cbc + "des-ede-cbc" + + ) + +275 + #NID_des_ede_cbc + 43 + + ) + +277 + #SN_des_ede3_cbc + "DES-EDE3-CBC" + + ) + +278 + #LN_des_ede3_cbc + "des-ede3-cbc" + + ) + +279 + #NID_des_ede3_cbc + 44 + + ) + +280 + #OBJ_des_ede3_cbc + +OBJ_r�dsi +,3L,7L + + ) + +282 + #SN_des_ofb64 + "DES-OFB" + + ) + +283 + #LN_des_ofb64 + "des-ofb" + + ) + +284 + #NID_des_ofb64 + 45 + + ) + +285 + #OBJ_des_ofb64 + +OBJ_�gܙhm +,8L + + ) + +287 + #SN_id�_ofb64 + "IDEA-OFB" + + ) + +288 + #LN_id�_ofb64 + "id�-ofb" + + ) + +289 + #NID_id�_ofb64 + 46 + + ) + +291 + #LN_pkcs9 + "pkcs9" + + ) + +292 + #NID_pkcs9 + 47 + + ) + +293 + #OBJ_pkcs9 + +OBJ_pkcs +,9L + + ) + +295 + #SN_pkcs9_ema�Add�ss + "Ema�" + + ) + +296 + #LN_pkcs9_ema�Add�ss + "ema�Add�ss" + + ) + +297 + #NID_pkcs9_ema�Add�ss + 48 + + ) + +298 + #OBJ_pkcs9_ema�Add�ss + +OBJ_pkcs9 +,1L + + ) + +300 + #LN_pkcs9_un�ru�u�dName + "un�ru�u�dName" + + ) + +301 + #NID_pkcs9_un�ru�u�dName + 49 + + ) + +302 + #OBJ_pkcs9_un�ru�u�dName + +OBJ_pkcs9 +,2L + + ) + +304 + #LN_pkcs9_cڋ�Ty� + "cڋ�Ty�" + + ) + +305 + #NID_pkcs9_cڋ�Ty� + 50 + + ) + +306 + #OBJ_pkcs9_cڋ�Ty� + +OBJ_pkcs9 +,3L + + ) + +308 + #LN_pkcs9_mes�geDige� + "mes�geDige�" + + ) + +309 + #NID_pkcs9_mes�geDige� + 51 + + ) + +310 + #OBJ_pkcs9_mes�geDige� + +OBJ_pkcs9 +,4L + + ) + +312 + #LN_pkcs9_sign�gTime + "sign�gTime" + + ) + +313 + #NID_pkcs9_sign�gTime + 52 + + ) + +314 + #OBJ_pkcs9_sign�gTime + +OBJ_pkcs9 +,5L + + ) + +316 + #LN_pkcs9_cou��sig�tu� + "cou��sig�tu�" + + ) + +317 + #NID_pkcs9_cou��sig�tu� + 53 + + ) + +318 + #OBJ_pkcs9_cou��sig�tu� + +OBJ_pkcs9 +,6L + + ) + +320 + #LN_pkcs9_ch��ngePassw�d + "ch��ngePassw�d" + + ) + +321 + #NID_pkcs9_ch��ngePassw�d + 54 + + ) + +322 + #OBJ_pkcs9_ch��ngePassw�d + +OBJ_pkcs9 +,7L + + ) + +324 + #LN_pkcs9_un�ru�u�dAdd�ss + "un�ru�u�dAdd�ss" + + ) + +325 + #NID_pkcs9_un�ru�u�dAdd�ss + 55 + + ) + +326 + #OBJ_pkcs9_un�ru�u�dAdd�ss + +OBJ_pkcs9 +,8L + + ) + +328 + #LN_pkcs9_extC�tA�ribu�s + "ex�ndedC�tifi��A�ribu�s" + + ) + +329 + #NID_pkcs9_extC�tA�ribu�s + 56 + + ) + +330 + #OBJ_pkcs9_extC�tA�ribu�s + +OBJ_pkcs9 +,9L + + ) + +332 + #SN_�ts�� + "N�s��" + + ) + +333 + #LN_�ts�� + "N�s�� Communi�tiڠC�p." + + ) + +334 + #NID_�ts�� + 57 + + ) + +335 + #OBJ_�ts�� + 2L,16L,840L,1L,113730L + + ) + +337 + #SN_�ts��_��_ex�nsi� + "nsC�tExt" + + ) + +338 + #LN_�ts��_��_ex�nsi� + "N�s�� C�tifi�� Ex�nsi�" + + ) + +339 + #NID_�ts��_��_ex�nsi� + 58 + + ) + +340 + #OBJ_�ts��_��_ex�nsi� + +OBJ_�ts�� +,1L + + ) + +342 + #SN_�ts��_d�a_ty� + "nsD�aTy�" + + ) + +343 + #LN_�ts��_d�a_ty� + "N�s�� D��Ty�" + + ) + +344 + #NID_�ts��_d�a_ty� + 59 + + ) + +345 + #OBJ_�ts��_d�a_ty� + +OBJ_�ts�� +,2L + + ) + +347 + #SN_des_ede_cfb64 + "DES-EDE-CFB" + + ) + +348 + #LN_des_ede_cfb64 + "des-ede-cfb" + + ) + +349 + #NID_des_ede_cfb64 + 60 + + ) + +351 + #SN_des_ede3_cfb64 + "DES-EDE3-CFB" + + ) + +352 + #LN_des_ede3_cfb64 + "des-ede3-cfb" + + ) + +353 + #NID_des_ede3_cfb64 + 61 + + ) + +355 + #SN_des_ede_ofb64 + "DES-EDE-OFB" + + ) + +356 + #LN_des_ede_ofb64 + "des-ede-ofb" + + ) + +357 + #NID_des_ede_ofb64 + 62 + + ) + +359 + #SN_des_ede3_ofb64 + "DES-EDE3-OFB" + + ) + +360 + #LN_des_ede3_ofb64 + "des-ede3-ofb" + + ) + +361 + #NID_des_ede3_ofb64 + 63 + + ) + +364 + #SN_sha1 + "SHA1" + + ) + +365 + #LN_sha1 + "sha1" + + ) + +366 + #NID_sha1 + 64 + + ) + +367 + #OBJ_sha1 + +OBJ_�gܙhm +,26L + + ) + +371 + #SN_sha1W�hRSAEn�y�i� + "RSA-SHA1" + + ) + +372 + #LN_sha1W�hRSAEn�y�i� + "sha1W�hRSAEn�y�i�" + + ) + +373 + #NID_sha1W�hRSAEn�y�i� + 65 + + ) + +374 + #OBJ_sha1W�hRSAEn�y�i� + +OBJ_pkcs +,1L,5L + + ) + +376 + #SN_d�W�hSHA + "DSA-SHA" + + ) + +377 + #LN_d�W�hSHA + "d�W�hSHA" + + ) + +378 + #NID_d�W�hSHA + 66 + + ) + +379 + #OBJ_d�W�hSHA + +OBJ_�gܙhm +,13L + + ) + +381 + #SN_d�_2 + "DSA-�d" + + ) + +382 + #LN_d�_2 + "d�En�y�i�-�d" + + ) + +383 + #NID_d�_2 + 67 + + ) + +384 + #OBJ_d�_2 + +OBJ_�gܙhm +,12L + + ) + +387 + #SN_pbeW�hSHA1AndRC2_CBC + "PBE-SHA1-RC2-64" + + ) + +388 + #LN_pbeW�hSHA1AndRC2_CBC + "pbeW�hSHA1AndRC2-CBC" + + ) + +389 + #NID_pbeW�hSHA1AndRC2_CBC + 68 + + ) + +390 + #OBJ_pbeW�hSHA1AndRC2_CBC + +OBJ_pkcs +,5L,11L + + ) + +396 + #LN_id_pbkdf2 + "PBKDF2" + + ) + +397 + #NID_id_pbkdf2 + 69 + + ) + +398 + #OBJ_id_pbkdf2 + +OBJ_pkcs +,5L,12L + + ) + +400 + #SN_d�W�hSHA1_2 + "DSA-SHA1-�d" + + ) + +401 + #LN_d�W�hSHA1_2 + "d�W�hSHA1-�d" + + ) + +402 + #NID_d�W�hSHA1_2 + 70 + + ) + +404 + #OBJ_d�W�hSHA1_2 + +OBJ_�gܙhm +,27L + + ) + +406 + #SN_�ts��_��_ty� + "nsC�tTy�" + + ) + +407 + #LN_�ts��_��_ty� + "N�s�� C��Ty�" + + ) + +408 + #NID_�ts��_��_ty� + 71 + + ) + +409 + #OBJ_�ts��_��_ty� + +OBJ_�ts��_��_ex�nsi� +,1L + + ) + +411 + #SN_�ts��_ba�_u� + "nsBa�U�" + + ) + +412 + #LN_�ts��_ba�_u� + "N�s�� Ba� U�" + + ) + +413 + #NID_�ts��_ba�_u� + 72 + + ) + +414 + #OBJ_�ts��_ba�_u� + +OBJ_�ts��_��_ex�nsi� +,2L + + ) + +416 + #SN_�ts��_�vo�ti�_u� + "nsRevo�ti�U�" + + ) + +417 + #LN_�ts��_�vo�ti�_u� + "N�s�� Revo�ti� U�" + + ) + +418 + #NID_�ts��_�vo�ti�_u� + 73 + + ) + +419 + #OBJ_�ts��_�vo�ti�_u� + +OBJ_�ts��_��_ex�nsi� +,3L + + ) + +421 + #SN_�ts��_�_�vo�ti�_u� + "nsCaRevo�ti�U�" + + ) + +422 + #LN_�ts��_�_�vo�ti�_u� + "N�s�� CA Revo�ti� U�" + + ) + +423 + #NID_�ts��_�_�vo�ti�_u� + 74 + + ) + +424 + #OBJ_�ts��_�_�vo�ti�_u� + +OBJ_�ts��_��_ex�nsi� +,4L + + ) + +426 + #SN_�ts��_��w�_u� + "nsR�ew�U�" + + ) + +427 + #LN_�ts��_��w�_u� + "N�s�� R�ew� U�" + + ) + +428 + #NID_�ts��_��w�_u� + 75 + + ) + +429 + #OBJ_�ts��_��w�_u� + +OBJ_�ts��_��_ex�nsi� +,7L + + ) + +431 + #SN_�ts��_�_p�icy_u� + "nsCaP�icyU�" + + ) + +432 + #LN_�ts��_�_p�icy_u� + "N�s�� CA P�icy U�" + + ) + +433 + #NID_�ts��_�_p�icy_u� + 76 + + ) + +434 + #OBJ_�ts��_�_p�icy_u� + +OBJ_�ts��_��_ex�nsi� +,8L + + ) + +436 + #SN_�ts��_s�_�rv�_�me + "nsS�S�v�Name" + + ) + +437 + #LN_�ts��_s�_�rv�_�me + "N�s�� SSL S�v� Name" + + ) + +438 + #NID_�ts��_s�_�rv�_�me + 77 + + ) + +439 + #OBJ_�ts��_s�_�rv�_�me + +OBJ_�ts��_��_ex�nsi� +,12L + + ) + +441 + #SN_�ts��_comm�t + "nsComm�t" + + ) + +442 + #LN_�ts��_comm�t + "N�s�� Comm�t" + + ) + +443 + #NID_�ts��_comm�t + 78 + + ) + +444 + #OBJ_�ts��_comm�t + +OBJ_�ts��_��_ex�nsi� +,13L + + ) + +446 + #SN_�ts��_��_�qu�� + "nsC�tSequ��" + + ) + +447 + #LN_�ts��_��_�qu�� + "N�s�� C�tifi�� Sequ��" + + ) + +448 + #NID_�ts��_��_�qu�� + 79 + + ) + +449 + #OBJ_�ts��_��_�qu�� + +OBJ_�ts��_d�a_ty� +,5L + + ) + +451 + #SN_desx_cbc + "DESX-CBC" + + ) + +452 + #LN_desx_cbc + "desx-cbc" + + ) + +453 + #NID_desx_cbc + 80 + + ) + +455 + #SN_id_� + "id-�" + + ) + +456 + #NID_id_� + 81 + + ) + +457 + #OBJ_id_� + 2L,5L,29L + + ) + +459 + #SN_subje�_key_id�tif�r + "subje�KeyId�tif�r" + + ) + +460 + #LN_subje�_key_id�tif�r + "X509v3 Subje� Key Id�tif�r" + + ) + +461 + #NID_subje�_key_id�tif�r + 82 + + ) + +462 + #OBJ_subje�_key_id�tif�r + +OBJ_id_� +,14L + + ) + +464 + #SN_key_u�ge + "keyU�ge" + + ) + +465 + #LN_key_u�ge + "X509v3 Key U�ge" + + ) + +466 + #NID_key_u�ge + 83 + + ) + +467 + #OBJ_key_u�ge + +OBJ_id_� +,15L + + ) + +469 + #SN_�iv�e_key_u�ge_�riod + "�iv�eKeyU�geP�iod" + + ) + +470 + #LN_�iv�e_key_u�ge_�riod + "X509v3 Priv��Key U�g�P�iod" + + ) + +471 + #NID_�iv�e_key_u�ge_�riod + 84 + + ) + +472 + #OBJ_�iv�e_key_u�ge_�riod + +OBJ_id_� +,16L + + ) + +474 + #SN_subje�_�t_�me + "subje�A�Name" + + ) + +475 + #LN_subje�_�t_�me + "X509v3 Subje� Aɔ�tiv�Name" + + ) + +476 + #NID_subje�_�t_�me + 85 + + ) + +477 + #OBJ_subje�_�t_�me + +OBJ_id_� +,17L + + ) + +479 + #SN_issu�_�t_�me + "issu�A�Name" + + ) + +480 + #LN_issu�_�t_�me + "X509v3 Issu� Aɔ�tiv�Name" + + ) + +481 + #NID_issu�_�t_�me + 86 + + ) + +482 + #OBJ_issu�_�t_�me + +OBJ_id_� +,18L + + ) + +484 + #SN_basic_cڡ��ts + "basicCڡ��ts" + + ) + +485 + #LN_basic_cڡ��ts + "X509v3 Basi�Cڡ��ts" + + ) + +486 + #NID_basic_cڡ��ts + 87 + + ) + +487 + #OBJ_basic_cڡ��ts + +OBJ_id_� +,19L + + ) + +489 + #SN_�l_numb� + "�lNumb�" + + ) + +490 + #LN_�l_numb� + "X509v3 CRL Numb�" + + ) + +491 + #NID_�l_numb� + 88 + + ) + +492 + #OBJ_�l_numb� + +OBJ_id_� +,20L + + ) + +494 + #SN_��ifi��_p�ic�s + "��ifi��P�ic�s" + + ) + +495 + #LN_��ifi��_p�ic�s + "X509v3 C�tifi�� P�ic�s" + + ) + +496 + #NID_��ifi��_p�ic�s + 89 + + ) + +497 + #OBJ_��ifi��_p�ic�s + +OBJ_id_� +,32L + + ) + +499 + #SN_authܙy_key_id�tif�r + "authܙyKeyId�tif�r" + + ) + +500 + #LN_authܙy_key_id�tif�r + "X509v3 Authܙy Key Id�tif�r" + + ) + +501 + #NID_authܙy_key_id�tif�r + 90 + + ) + +502 + #OBJ_authܙy_key_id�tif�r + +OBJ_id_� +,35L + + ) + +504 + #SN_bf_cbc + "BF-CBC" + + ) + +505 + #LN_bf_cbc + "bf-cbc" + + ) + +506 + #NID_bf_cbc + 91 + + ) + +507 + #OBJ_bf_cbc + 1L,3L,6L,1L,4L,1L,3029L,1L,2L + + ) + +509 + #SN_bf_ecb + "BF-ECB" + + ) + +510 + #LN_bf_ecb + "bf-ecb" + + ) + +511 + #NID_bf_ecb + 92 + + ) + +513 + #SN_bf_cfb64 + "BF-CFB" + + ) + +514 + #LN_bf_cfb64 + "bf-cfb" + + ) + +515 + #NID_bf_cfb64 + 93 + + ) + +517 + #SN_bf_ofb64 + "BF-OFB" + + ) + +518 + #LN_bf_ofb64 + "bf-ofb" + + ) + +519 + #NID_bf_ofb64 + 94 + + ) + +521 + #SN_mdc2 + "MDC2" + + ) + +522 + #LN_mdc2 + "mdc2" + + ) + +523 + #NID_mdc2 + 95 + + ) + +524 + #OBJ_mdc2 + 2L,5L,8L,3L,101L + + ) + +527 + #SN_mdc2W�hRSA + "RSA-MDC2" + + ) + +528 + #LN_mdc2W�hRSA + "mdc2w�hRSA" + + ) + +529 + #NID_mdc2W�hRSA + 96 + + ) + +530 + #OBJ_mdc2W�hRSA + 2L,5L,8L,3L,100L + + ) + +532 + #SN_rc4_40 + "RC4-40" + + ) + +533 + #LN_rc4_40 + "rc4-40" + + ) + +534 + #NID_rc4_40 + 97 + + ) + +536 + #SN_rc2_40_cbc + "RC2-40-CBC" + + ) + +537 + #LN_rc2_40_cbc + "rc2-40-cbc" + + ) + +538 + #NID_rc2_40_cbc + 98 + + ) + +540 + #SN_giv�Name + "G" + + ) + +541 + #LN_giv�Name + "giv�Name" + + ) + +542 + #NID_giv�Name + 99 + + ) + +543 + #OBJ_giv�Name + +OBJ_X509 +,42L + + ) + +545 + #SN_su�ame + "S" + + ) + +546 + #LN_su�ame + "su�ame" + + ) + +547 + #NID_su�ame + 100 + + ) + +548 + #OBJ_su�ame + +OBJ_X509 +,4L + + ) + +550 + #SN_���ls + "I" + + ) + +551 + #LN_���ls + "���ls" + + ) + +552 + #NID_���ls + 101 + + ) + +553 + #OBJ_���ls + +OBJ_X509 +,43L + + ) + +555 + #SN_uniqueId�tif�r + "UID" + + ) + +556 + #LN_uniqueId�tif�r + "uniqueId�tif�r" + + ) + +557 + #NID_uniqueId�tif�r + 102 + + ) + +558 + #OBJ_uniqueId�tif�r + +OBJ_X509 +,45L + + ) + +560 + #SN_�l_di�ributi�_po�ts + "�lDi�ributi�Po�ts" + + ) + +561 + #LN_�l_di�ributi�_po�ts + "X509v3 CRL Di�ributi� Po�ts" + + ) + +562 + #NID_�l_di�ributi�_po�ts + 103 + + ) + +563 + #OBJ_�l_di�ributi�_po�ts + +OBJ_id_� +,31L + + ) + +565 + #SN_md5W�hRSA + "RSA-NP-MD5" + + ) + +566 + #LN_md5W�hRSA + "md5W�hRSA" + + ) + +567 + #NID_md5W�hRSA + 104 + + ) + +568 + #OBJ_md5W�hRSA + +OBJ_�gܙhm +,3L + + ) + +570 + #SN_�r�lNumb� + "SN" + + ) + +571 + #LN_�r�lNumb� + "�r�lNumb�" + + ) + +572 + #NID_�r�lNumb� + 105 + + ) + +573 + #OBJ_�r�lNumb� + +OBJ_X509 +,5L + + ) + +575 + #SN_t�� + "T" + + ) + +576 + #LN_t�� + "t��" + + ) + +577 + #NID_t�� + 106 + + ) + +578 + #OBJ_t�� + +OBJ_X509 +,12L + + ) + +580 + #SN_des��ti� + "D" + + ) + +581 + #LN_des��ti� + "des��ti�" + + ) + +582 + #NID_des��ti� + 107 + + ) + +583 + #OBJ_des��ti� + +OBJ_X509 +,13L + + ) + +586 + #SN_��5_cbc + "CAST5-CBC" + + ) + +587 + #LN_��5_cbc + "��5-cbc" + + ) + +588 + #NID_��5_cbc + 108 + + ) + +589 + #OBJ_��5_cbc + 1L,2L,840L,113533L,7L,66L,10L + + ) + +591 + #SN_��5_ecb + "CAST5-ECB" + + ) + +592 + #LN_��5_ecb + "��5-ecb" + + ) + +593 + #NID_��5_ecb + 109 + + ) + +595 + #SN_��5_cfb64 + "CAST5-CFB" + + ) + +596 + #LN_��5_cfb64 + "��5-cfb" + + ) + +597 + #NID_��5_cfb64 + 110 + + ) + +599 + #SN_��5_ofb64 + "CAST5-OFB" + + ) + +600 + #LN_��5_ofb64 + "��5-ofb" + + ) + +601 + #NID_��5_ofb64 + 111 + + ) + +603 + #LN_pbeW�hMD5AndCa�5_CBC + "pbeW�hMD5AndCa�5CBC" + + ) + +604 + #NID_pbeW�hMD5AndCa�5_CBC + 112 + + ) + +605 + #OBJ_pbeW�hMD5AndCa�5_CBC + 1L,2L,840L,113533L,7L,66L,12L + + ) + +611 + #SN_d�W�hSHA1 + "DSA-SHA1" + + ) + +612 + #LN_d�W�hSHA1 + "d�W�hSHA1" + + ) + +613 + #NID_d�W�hSHA1 + 113 + + ) + +614 + #OBJ_d�W�hSHA1 + 1L,2L,840L,10040L,4L,3L + + ) + +616 + #NID_md5_sha1 + 114 + + ) + +617 + #SN_md5_sha1 + "MD5-SHA1" + + ) + +618 + #LN_md5_sha1 + "md5-sha1" + + ) + +620 + #SN_sha1W�hRSA + "RSA-SHA1-2" + + ) + +621 + #LN_sha1W�hRSA + "sha1W�hRSA" + + ) + +622 + #NID_sha1W�hRSA + 115 + + ) + +623 + #OBJ_sha1W�hRSA + +OBJ_�gܙhm +,29L + + ) + +625 + #SN_d� + "DSA" + + ) + +626 + #LN_d� + "d�En�y�i�" + + ) + +627 + #NID_d� + 116 + + ) + +628 + #OBJ_d� + 1L,2L,840L,10040L,4L,1L + + ) + +630 + #SN_r�emd160 + "RIPEMD160" + + ) + +631 + #LN_r�emd160 + "r�emd160" + + ) + +632 + #NID_r�emd160 + 117 + + ) + +633 + #OBJ_r�emd160 + 1L,3L,36L,3L,2L,1L + + ) + +637 + #SN_r�emd160W�hRSA + "RSA-RIPEMD160" + + ) + +638 + #LN_r�emd160W�hRSA + "r�emd160W�hRSA" + + ) + +639 + #NID_r�emd160W�hRSA + 119 + + ) + +640 + #OBJ_r�emd160W�hRSA + 1L,3L,36L,3L,3L,1L,2L + + ) + +650 + #SN_rc5_cbc + "RC5-CBC" + + ) + +651 + #LN_rc5_cbc + "rc5-cbc" + + ) + +652 + #NID_rc5_cbc + 120 + + ) + +653 + #OBJ_rc5_cbc + +OBJ_r�dsi +,3L,8L + + ) + +655 + #SN_rc5_ecb + "RC5-ECB" + + ) + +656 + #LN_rc5_ecb + "rc5-ecb" + + ) + +657 + #NID_rc5_ecb + 121 + + ) + +659 + #SN_rc5_cfb64 + "RC5-CFB" + + ) + +660 + #LN_rc5_cfb64 + "rc5-cfb" + + ) + +661 + #NID_rc5_cfb64 + 122 + + ) + +663 + #SN_rc5_ofb64 + "RC5-OFB" + + ) + +664 + #LN_rc5_ofb64 + "rc5-ofb" + + ) + +665 + #NID_rc5_ofb64 + 123 + + ) + +667 + #SN_�e_com�essi� + "RLE" + + ) + +668 + #LN_�e_com�essi� + "ru��ngth com�essi�" + + ) + +669 + #NID_�e_com�essi� + 124 + + ) + +670 + #OBJ_�e_com�essi� + 1L,1L,1L,1L,666L,1L + + ) + +672 + #SN_zlib_com�essi� + "ZLIB" + + ) + +673 + #LN_zlib_com�essi� + "zlib com�essi�" + + ) + +674 + #NID_zlib_com�essi� + 125 + + ) + +675 + #OBJ_zlib_com�essi� + 1L,1L,1L,1L,666L,2L + + ) + +677 + #SN_ext_key_u�ge + "ex�ndedKeyU�ge" + + ) + +678 + #LN_ext_key_u�ge + "X509v3 Ex�nded Key U�ge" + + ) + +679 + #NID_ext_key_u�ge + 126 + + ) + +680 + #OBJ_ext_key_u�ge + +OBJ_id_� +,37 + + ) + +682 + #SN_id_pkix + "PKIX" + + ) + +683 + #NID_id_pkix + 127 + + ) + +684 + #OBJ_id_pkix + 1L,3L,6L,1L,5L,5L,7L + + ) + +686 + #SN_id_kp + "id-kp" + + ) + +687 + #NID_id_kp + 128 + + ) + +688 + #OBJ_id_kp + +OBJ_id_pkix +,3L + + ) + +692 + #SN_�rv�_auth + "�rv�Auth" + + ) + +693 + #LN_�rv�_auth + "TLS Web S�v� Auth�ti�ti�" + + ) + +694 + #NID_�rv�_auth + 129 + + ) + +695 + #OBJ_�rv�_auth + +OBJ_id_kp +,1L + + ) + +697 + #SN_���_auth + "���Auth" + + ) + +698 + #LN_���_auth + "TLS Web Cl�� Auth�ti�ti�" + + ) + +699 + #NID_���_auth + 130 + + ) + +700 + #OBJ_���_auth + +OBJ_id_kp +,2L + + ) + +702 + #SN_code_sign + "codeSign�g" + + ) + +703 + #LN_code_sign + "Cod�Sign�g" + + ) + +704 + #NID_code_sign + 131 + + ) + +705 + #OBJ_code_sign + +OBJ_id_kp +,3L + + ) + +707 + #SN_ema�_��e� + "ema�Pr�e�i�" + + ) + +708 + #LN_ema�_��e� + "E-ma� Pr�e�i�" + + ) + +709 + #NID_ema�_��e� + 132 + + ) + +710 + #OBJ_ema�_��e� + +OBJ_id_kp +,4L + + ) + +712 + #SN_time_�amp + "timeS�mp�g" + + ) + +713 + #LN_time_�amp + "Tim�S�mp�g" + + ) + +714 + #NID_time_�amp + 133 + + ) + +715 + #OBJ_time_�amp + +OBJ_id_kp +,8L + + ) + +719 + #SN_ms_code_�d + "msCodeInd" + + ) + +720 + #LN_ms_code_�d + "Mi�oso� Individu� Cod�Sign�g" + + ) + +721 + #NID_ms_code_�d + 134 + + ) + +722 + #OBJ_ms_code_�d + 1L,3L,6L,1L,4L,1L,311L,2L,1L,21L + + ) + +724 + #SN_ms_code_com + "msCodeCom" + + ) + +725 + #LN_ms_code_com + "Mi�oso� Comm�c��Cod�Sign�g" + + ) + +726 + #NID_ms_code_com + 135 + + ) + +727 + #OBJ_ms_code_com + 1L,3L,6L,1L,4L,1L,311L,2L,1L,22L + + ) + +729 + #SN_ms_�l_sign + "msCTLSign" + + ) + +730 + #LN_ms_�l_sign + "Mi�oso� Tru� Li� Sign�g" + + ) + +731 + #NID_ms_�l_sign + 136 + + ) + +732 + #OBJ_ms_�l_sign + 1L,3L,6L,1L,4L,1L,311L,10L,3L,1L + + ) + +734 + #SN_ms_sgc + "msSGC" + + ) + +735 + #LN_ms_sgc + "Mi�oso� S�v� G�ed Cry�o" + + ) + +736 + #NID_ms_sgc + 137 + + ) + +737 + #OBJ_ms_sgc + 1L,3L,6L,1L,4L,1L,311L,10L,3L,3L + + ) + +739 + #SN_ms_efs + "msEFS" + + ) + +740 + #LN_ms_efs + "Mi�oso� En�y�ed F��Sy�em" + + ) + +741 + #NID_ms_efs + 138 + + ) + +742 + #OBJ_ms_efs + 1L,3L,6L,1L,4L,1L,311L,10L,3L,4L + + ) + +746 + #SN_ns_sgc + "nsSGC" + + ) + +747 + #LN_ns_sgc + "N�s�� S�v� G�ed Cry�o" + + ) + +748 + #NID_ns_sgc + 139 + + ) + +749 + #OBJ_ns_sgc + +OBJ_�ts�� +,4L,1L + + ) + +751 + #SN_d��_�l + "d��CRL" + + ) + +752 + #LN_d��_�l + "X509v3 D�� CRL Indi�t�" + + ) + +753 + #NID_d��_�l + 140 + + ) + +754 + #OBJ_d��_�l + +OBJ_id_� +,27L + + ) + +756 + #SN_�l_�as� + "CRLR�s�" + + ) + +757 + #LN_�l_�as� + "CRL R�s� Code" + + ) + +758 + #NID_�l_�as� + 141 + + ) + +759 + #OBJ_�l_�as� + +OBJ_id_� +,21L + + ) + +761 + #SN_�v�id�y_d�e + "�v�id�yD�e" + + ) + +762 + #LN_�v�id�y_d�e + "Inv�id�y D�e" + + ) + +763 + #NID_�v�id�y_d�e + 142 + + ) + +764 + #OBJ_�v�id�y_d�e + +OBJ_id_� +,24L + + ) + +766 + #SN_sx�t + "SXN�ID" + + ) + +767 + #LN_sx�t + "S��g Ex��� ID" + + ) + +768 + #NID_sx�t + 143 + + ) + +769 + #OBJ_sx�t + 1L,3L,101L,1L,4L,1L + + ) + +773 + #OBJ_pkcs12 + +OBJ_pkcs +,12L + + ) + +774 + #OBJ_pkcs12_pbeids + +OBJ_pkcs12 +, 1 + + ) + +776 + #SN_pbe_W�hSHA1And128B�RC4 + "PBE-SHA1-RC4-128" + + ) + +777 + #LN_pbe_W�hSHA1And128B�RC4 + "pbeW�hSHA1And128B�RC4" + + ) + +778 + #NID_pbe_W�hSHA1And128B�RC4 + 144 + + ) + +779 + #OBJ_pbe_W�hSHA1And128B�RC4 + +OBJ_pkcs12_pbeids +, 1L + + ) + +781 + #SN_pbe_W�hSHA1And40B�RC4 + "PBE-SHA1-RC4-40" + + ) + +782 + #LN_pbe_W�hSHA1And40B�RC4 + "pbeW�hSHA1And40B�RC4" + + ) + +783 + #NID_pbe_W�hSHA1And40B�RC4 + 145 + + ) + +784 + #OBJ_pbe_W�hSHA1And40B�RC4 + +OBJ_pkcs12_pbeids +, 2L + + ) + +786 + #SN_pbe_W�hSHA1And3_Key_Tr��DES_CBC + "PBE-SHA1-3DES" + + ) + +787 + #LN_pbe_W�hSHA1And3_Key_Tr��DES_CBC + "pbeW�hSHA1And3-KeyTr��DES-CBC" + + ) + +788 + #NID_pbe_W�hSHA1And3_Key_Tr��DES_CBC + 146 + + ) + +789 + #OBJ_pbe_W�hSHA1And3_Key_Tr��DES_CBC + +OBJ_pkcs12_pbeids +, 3L + + ) + +791 + #SN_pbe_W�hSHA1And2_Key_Tr��DES_CBC + "PBE-SHA1-2DES" + + ) + +792 + #LN_pbe_W�hSHA1And2_Key_Tr��DES_CBC + "pbeW�hSHA1And2-KeyTr��DES-CBC" + + ) + +793 + #NID_pbe_W�hSHA1And2_Key_Tr��DES_CBC + 147 + + ) + +794 + #OBJ_pbe_W�hSHA1And2_Key_Tr��DES_CBC + +OBJ_pkcs12_pbeids +, 4L + + ) + +796 + #SN_pbe_W�hSHA1And128B�RC2_CBC + "PBE-SHA1-RC2-128" + + ) + +797 + #LN_pbe_W�hSHA1And128B�RC2_CBC + "pbeW�hSHA1And128B�RC2-CBC" + + ) + +798 + #NID_pbe_W�hSHA1And128B�RC2_CBC + 148 + + ) + +799 + #OBJ_pbe_W�hSHA1And128B�RC2_CBC + +OBJ_pkcs12_pbeids +, 5L + + ) + +801 + #SN_pbe_W�hSHA1And40B�RC2_CBC + "PBE-SHA1-RC2-40" + + ) + +802 + #LN_pbe_W�hSHA1And40B�RC2_CBC + "pbeW�hSHA1And40B�RC2-CBC" + + ) + +803 + #NID_pbe_W�hSHA1And40B�RC2_CBC + 149 + + ) + +804 + #OBJ_pbe_W�hSHA1And40B�RC2_CBC + +OBJ_pkcs12_pbeids +, 6L + + ) + +806 + #OBJ_pkcs12_V�si�1 + +OBJ_pkcs12 +, 10L + + ) + +808 + #OBJ_pkcs12_BagIds + +OBJ_pkcs12_V�si�1 +, 1L + + ) + +810 + #LN_keyBag + "keyBag" + + ) + +811 + #NID_keyBag + 150 + + ) + +812 + #OBJ_keyBag + +OBJ_pkcs12_BagIds +, 1L + + ) + +814 + #LN_pkcs8ShroudedKeyBag + "pkcs8ShroudedKeyBag" + + ) + +815 + #NID_pkcs8ShroudedKeyBag + 151 + + ) + +816 + #OBJ_pkcs8ShroudedKeyBag + +OBJ_pkcs12_BagIds +, 2L + + ) + +818 + #LN_��Bag + "��Bag" + + ) + +819 + #NID_��Bag + 152 + + ) + +820 + #OBJ_��Bag + +OBJ_pkcs12_BagIds +, 3L + + ) + +822 + #LN_�lBag + "�lBag" + + ) + +823 + #NID_�lBag + 153 + + ) + +824 + #OBJ_�lBag + +OBJ_pkcs12_BagIds +, 4L + + ) + +826 + #LN_���Bag + "���Bag" + + ) + +827 + #NID_���Bag + 154 + + ) + +828 + #OBJ_���Bag + +OBJ_pkcs12_BagIds +, 5L + + ) + +830 + #LN_��Cڋ�sBag + "��Cڋ�sBag" + + ) + +831 + #NID_��Cڋ�sBag + 155 + + ) + +832 + #OBJ_��Cڋ�sBag + +OBJ_pkcs12_BagIds +, 6L + + ) + +834 + #LN_�ndlyName + "�ndlyName" + + ) + +835 + #NID_�ndlyName + 156 + + ) + +836 + #OBJ_�ndlyName + +OBJ_pkcs9 +, 20L + + ) + +838 + #LN_lo�lKeyID + "lo�lKeyID" + + ) + +839 + #NID_lo�lKeyID + 157 + + ) + +840 + #OBJ_lo�lKeyID + +OBJ_pkcs9 +, 21L + + ) + +842 + #OBJ_��Ty�s + +OBJ_pkcs9 +, 22L + + ) + +844 + #LN_x509C�tifi�� + "x509C�tifi��" + + ) + +845 + #NID_x509C�tifi�� + 158 + + ) + +846 + #OBJ_x509C�tifi�� + +OBJ_��Ty�s +, 1L + + ) + +848 + #LN_sdsiC�tifi�� + "sdsiC�tifi��" + + ) + +849 + #NID_sdsiC�tifi�� + 159 + + ) + +850 + #OBJ_sdsiC�tifi�� + +OBJ_��Ty�s +, 2L + + ) + +852 + #OBJ_�lTy�s + +OBJ_pkcs9 +, 23L + + ) + +854 + #LN_x509C� + "x509C�" + + ) + +855 + #NID_x509C� + 160 + + ) + +856 + #OBJ_x509C� + +OBJ_�lTy�s +, 1L + + ) + +860 + #LN_pbes2 + "PBES2" + + ) + +861 + #NID_pbes2 + 161 + + ) + +862 + #OBJ_pbes2 + +OBJ_pkcs +,5L,13L + + ) + +864 + #LN_pbmac1 + "PBMAC1" + + ) + +865 + #NID_pbmac1 + 162 + + ) + +866 + #OBJ_pbmac1 + +OBJ_pkcs +,5L,14L + + ) + +868 + #LN_hmacW�hSHA1 + "hmacW�hSHA1" + + ) + +869 + #NID_hmacW�hSHA1 + 163 + + ) + +870 + #OBJ_hmacW�hSHA1 + +OBJ_r�dsi +,2L,7L + + ) + +874 + #LN_id_qt_�s + "P�icy Qu�if��CPS" + + ) + +875 + #SN_id_qt_�s + "id-qt-�s" + + ) + +876 + #NID_id_qt_�s + 164 + + ) + +877 + #OBJ_id_qt_�s + +OBJ_id_pkix +,2L,1L + + ) + +879 + #LN_id_qt_un�i� + "P�icy Qu�if��U��N�i�" + + ) + +880 + #SN_id_qt_un�i� + "id-qt-un�i�" + + ) + +881 + #NID_id_qt_un�i� + 165 + + ) + +882 + #OBJ_id_qt_un�i� + +OBJ_id_pkix +,2L,2L + + ) + +884 + #SN_rc2_64_cbc + "RC2-64-CBC" + + ) + +885 + #LN_rc2_64_cbc + "rc2-64-cbc" + + ) + +886 + #NID_rc2_64_cbc + 166 + + ) + +888 + #SN_SMIMEC�ab���s + "SMIME-CAPS" + + ) + +889 + #LN_SMIMEC�ab���s + "S/MIME C�ab���s" + + ) + +890 + #NID_SMIMEC�ab���s + 167 + + ) + +891 + #OBJ_SMIMEC�ab���s + +OBJ_pkcs9 +,15L + + ) + +893 + #SN_pbeW�hMD2AndRC2_CBC + "PBE-MD2-RC2-64" + + ) + +894 + #LN_pbeW�hMD2AndRC2_CBC + "pbeW�hMD2AndRC2-CBC" + + ) + +895 + #NID_pbeW�hMD2AndRC2_CBC + 168 + + ) + +896 + #OBJ_pbeW�hMD2AndRC2_CBC + +OBJ_pkcs +,5L,4L + + ) + +898 + #SN_pbeW�hMD5AndRC2_CBC + "PBE-MD5-RC2-64" + + ) + +899 + #LN_pbeW�hMD5AndRC2_CBC + "pbeW�hMD5AndRC2-CBC" + + ) + +900 + #NID_pbeW�hMD5AndRC2_CBC + 169 + + ) + +901 + #OBJ_pbeW�hMD5AndRC2_CBC + +OBJ_pkcs +,5L,6L + + ) + +903 + #SN_pbeW�hSHA1AndDES_CBC + "PBE-SHA1-DES" + + ) + +904 + #LN_pbeW�hSHA1AndDES_CBC + "pbeW�hSHA1AndDES-CBC" + + ) + +905 + #NID_pbeW�hSHA1AndDES_CBC + 170 + + ) + +906 + #OBJ_pbeW�hSHA1AndDES_CBC + +OBJ_pkcs +,5L,10L + + ) + +910 + #LN_ms_ext_�q + "Mi�oso� Ex�nsi� Reque�" + + ) + +911 + #SN_ms_ext_�q + "msExtReq" + + ) + +912 + #NID_ms_ext_�q + 171 + + ) + +913 + #OBJ_ms_ext_�q + 1L,3L,6L,1L,4L,1L,311L,2L,1L,14L + + ) + +915 + #LN_ext_�q + "Ex�nsi� Reque�" + + ) + +916 + #SN_ext_�q + "extReq" + + ) + +917 + #NID_ext_�q + 172 + + ) + +918 + #OBJ_ext_�q + +OBJ_pkcs9 +,14L + + ) + +920 + #SN_�me + "�me" + + ) + +921 + #LN_�me + "�me" + + ) + +922 + #NID_�me + 173 + + ) + +923 + #OBJ_�me + +OBJ_X509 +,41L + + ) + +925 + #SN_dnQu�if�r + "dnQu�if�r" + + ) + +926 + #LN_dnQu�if�r + "dnQu�if�r" + + ) + +927 + #NID_dnQu�if�r + 174 + + ) + +928 + #OBJ_dnQu�if�r + +OBJ_X509 +,46L + + ) + +930 + #SN_id_� + "id-�" + + ) + +931 + #NID_id_� + 175 + + ) + +932 + #OBJ_id_� + +OBJ_id_pkix +,1L + + ) + +934 + #SN_id_ad + "id-ad" + + ) + +935 + #NID_id_ad + 176 + + ) + +936 + #OBJ_id_ad + +OBJ_id_pkix +,48L + + ) + +938 + #SN_�fo_ac�ss + "authܙyInfoAc�ss" + + ) + +939 + #LN_�fo_ac�ss + "Authܙy Inf�m�i� Ac�ss" + + ) + +940 + #NID_�fo_ac�ss + 177 + + ) + +941 + #OBJ_�fo_ac�ss + +OBJ_id_� +,1L + + ) + +943 + #SN_ad_OCSP + "OCSP" + + ) + +944 + #LN_ad_OCSP + "OCSP" + + ) + +945 + #NID_ad_OCSP + 178 + + ) + +946 + #OBJ_ad_OCSP + +OBJ_id_ad +,1L + + ) + +948 + #SN_ad_�_issu�s + "�Issu�s" + + ) + +949 + #LN_ad_�_issu�s + "CA Issu�s" + + ) + +950 + #NID_ad_�_issu�s + 179 + + ) + +951 + #OBJ_ad_�_issu�s + +OBJ_id_ad +,2L + + ) + +953 + #SN_OCSP_sign + "OCSPSign�g" + + ) + +954 + #LN_OCSP_sign + "OCSP Sign�g" + + ) + +955 + #NID_OCSP_sign + 180 + + ) + +956 + #OBJ_OCSP_sign + +OBJ_id_kp +,9L + + ) + +959 + ~<ݒs�/bio.h +> + +960 + ~<ݒs�/a�1.h +> + +962 + #OBJ_NAME_TYPE_UNDEF + 0x00 + + ) + +963 + #OBJ_NAME_TYPE_MD_METH + 0x01 + + ) + +964 + #OBJ_NAME_TYPE_CIPHER_METH + 0x02 + + ) + +965 + #OBJ_NAME_TYPE_PKEY_METH + 0x03 + + ) + +966 + #OBJ_NAME_TYPE_COMP_METH + 0x04 + + ) + +967 + #OBJ_NAME_TYPE_NUM + 0x05 + + ) + +969 + #OBJ_NAME_ALIAS + 0x8000 + + ) + +971 + #OBJ_BSEARCH_VALUE_ON_NOMATCH + 0x01 + + ) + +972 + #OBJ_BSEARCH_FIRST_VALUE_ON_MATCH + 0x02 + + ) + +975 #ifde� +__�lu�lus + + +979 + sobj_�me_� + + +981 +ty� +; + +982 +��s +; + +983 cڡ * +�me +; + +984 cڡ * +d�a +; + +985 } + tOBJ_NAME +; + +987 + #OBJ_���_�d_add_obje� +( +a +, +b +, +c +� + `OBJ_��� +�,b,c) + + ) + +990 +OBJ_NAME_�� +(); + +991 +OBJ_NAME_�w_�dex +((* +hash_func +)(const *), + +992 (* +cmp_func +)(const *, const *), + +993 (* +�_func +)(const *, , const *)); + +994 cڡ * +OBJ_NAME_g� +(cڡ * +�me +, +ty� +); + +995 +OBJ_NAME_add +(cڡ * +�me +, +ty� +,cڡ * +d�a +); + +996 +OBJ_NAME_�move +(cڡ * +�me +, +ty� +); + +997 +OBJ_NAME_��nup +( +ty� +); + +998 +OBJ_NAME_do_�l +( +ty� +,(* +� +)(cڡ +OBJ_NAME + *,* +�g +), + +999 * +�g +); + +1000 +OBJ_NAME_do_�l_s܋d +( +ty� +,(* +� +)(cڡ +OBJ_NAME + *,* +�g +), + +1001 * +�g +); + +1003 +ASN1_OBJECT + * +OBJ_dup +(cڡ ASN1_OBJECT * +o +); + +1004 +ASN1_OBJECT + * +OBJ_nid2obj +( +n +); + +1005 cڡ * +OBJ_nid2� +( +n +); + +1006 cڡ * +OBJ_nid2� +( +n +); + +1007 +OBJ_obj2nid +(cڡ +ASN1_OBJECT + * +o +); + +1008 +ASN1_OBJECT + * +OBJ_txt2obj +(cڡ * +s +, +no_�me +); + +1009 +OBJ_obj2txt +(* +buf +, +buf_�n +, cڡ +ASN1_OBJECT + * +a +, +no_�me +); + +1010 +OBJ_txt2nid +(cڡ * +s +); + +1011 +OBJ_�2nid +(cڡ * +s +); + +1012 +OBJ_�2nid +(cڡ * +s +); + +1013 +OBJ_cmp +(cڡ +ASN1_OBJECT + * +a +,cڡ ASN1_OBJECT * +b +); + +1014 cڡ * +OBJ_b��ch_ +(cڡ * +key +,cڡ * +ba� +, +num +, +size +, + +1015 (* +cmp +)(const *, const *)); + +1016 cڡ * +OBJ_b��ch_ex_ +(cڡ * +key +,cڡ * +ba� +, +num +, + +1017 +size +, + +1018 (* +cmp +)(const *, const *), + +1019 +�ags +); + +1021 + #_DECLARE_OBJ_BSEARCH_CMP_FN +( +sc�e +, +ty�1 +, +ty�2 +, +nm +) \ + +1022 +nm +## + `_cmp_BSEARCH_CMP_FN +(const *, const *); \ + +1023 +nm +## + `_cmp +( +ty�1 + cڡ *, +ty�2 + const *); \ + +1024 +sc�e + +ty�2 + * +OBJ_b��ch_ +## + `nm +( +ty�1 + * +key +,�y�2 cڡ * +ba� +, +num +) + + ) + +1026 + #DECLARE_OBJ_BSEARCH_CMP_FN +( +ty�1 +, +ty�2 +, +cmp +) \ + +1027 + `_DECLARE_OBJ_BSEARCH_CMP_FN +(, +ty�1 +, +ty�2 +, +cmp +) + + ) + +1028 + #DECLARE_OBJ_BSEARCH_GLOBAL_CMP_FN +( +ty�1 +, +ty�2 +, +nm +) \ + +1029 +ty�2 + * +OBJ_b��ch_ +## + `nm +( +ty�1 + * +key +,�y�2 cڡ * +ba� +, +num +) + + ) + +1058 + #IMPLEMENT_OBJ_BSEARCH_CMP_FN +( +ty�1 +, +ty�2 +, +nm +) \ + +1059 +nm +## + `_cmp_BSEARCH_CMP_FN +(cڡ * +a_ +, cڡ * +b_ +) \ + +1061 +ty�1 + cڡ * +a + = +a_ +; \ + +1062 +ty�2 + cڡ * +b + = +b_ +; \ + +1063 +nm +## + `_cmp +( +a +, +b +); \ + +1065 +ty�2 + * +OBJ_b��ch_ +## + `nm +( +ty�1 + * +key +,�y�2 cڡ * +ba� +, +num +) \ + +1067 ( +ty�2 + *) + `OBJ_b��ch_ +( +key +, +ba� +, +num +, (type2), \ + +1068 +nm +## +_cmp_BSEARCH_CMP_FN +); \ + +1070 + `dummy_���y� +() + + ) + +1072 + #IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN +( +ty�1 +, +ty�2 +, +nm +) \ + +1073 +nm +## + `_cmp_BSEARCH_CMP_FN +(cڡ * +a_ +, cڡ * +b_ +) \ + +1075 +ty�1 + cڡ * +a + = +a_ +; \ + +1076 +ty�2 + cڡ * +b + = +b_ +; \ + +1077 +nm +## + `_cmp +( +a +, +b +); \ + +1079 +ty�2 + * +OBJ_b��ch_ +## + `nm +( +ty�1 + * +key +,�y�2 cڡ * +ba� +, +num +) \ + +1081 ( +ty�2 + *) + `OBJ_b��ch_ +( +key +, +ba� +, +num +, (type2), \ + +1082 +nm +## +_cmp_BSEARCH_CMP_FN +); \ + +1084 + `dummy_���y� +() + + ) + +1086 + #OBJ_b��ch +( +ty�1 +, +key +, +ty�2 +, +ba� +, +num +, +cmp +) \ + +1087 (( +ty�2 + *) + `OBJ_b��ch_ +( + `CHECKED_PTR_OF +( +ty�1 +, +key +),CHECKED_PTR_OF�y�2, +ba� +), \ + +1088 +num +,( +ty�2 +), \ + +1089 (() + `CHECKED_PTR_OF +( +ty�1 +, +cmp +## +_ty�_1 +), \ + +1090 () + `CHECKED_PTR_OF +( +ty�2 +, +cmp +## +_ty�_2 +), \ + +1091 +cmp +## +_BSEARCH_CMP_FN +))) + + ) + +1093 + #OBJ_b��ch_ex +( +ty�1 +, +key +, +ty�2 +, +ba� +, +num +, +cmp +, +�ags +) \ + +1094 (( +ty�2 + *) + `OBJ_b��ch_ex_ +( + `CHECKED_PTR_OF +( +ty�1 +, +key +),CHECKED_PTR_OF�y�2, +ba� +), \ + +1095 +num +,( +ty�2 +), \ + +1096 (() + `CHECKED_PTR_OF +( +ty�1 +, +cmp +## +_ty�_1 +), \ + +1097 () +ty�_2 += + `CHECKED_PTR_OF +( +ty�2 +, +cmp +## +_ty�_2 +), \ + +1098 +cmp +## +_BSEARCH_CMP_FN +)), +�ags +) + + ) + +1100 +OBJ_�w_nid +( +num +); + +1101 +OBJ_add_obje� +(cڡ +ASN1_OBJECT + * +obj +); + +1102 +OBJ_��� +(cڡ * +oid +,cڡ * +� +,cڡ * +� +); + +1103 +OBJ_��nup +(); + +1104 +OBJ_���_obje�s +( +BIO + * +� +); + +1106 +OBJ_f�d_sigid_�gs +( +signid +, * +pdig_nid +, * +�key_nid +); + +1107 +OBJ_f�d_sigid_by_�gs +(* +psignid +, +dig_nid +, +pkey_nid +); + +1108 +OBJ_add_sigid +( +signid +, +dig_id +, +pkey_id +); + +1109 +OBJ_sigid_� +(); + +1111 +obj_��nup_de�r +; + +1112 +check_de�r +( +nid +); + +1118 +ERR_l�d_OBJ_�r�gs +(); + +1123 + #OBJ_F_OBJ_ADD_OBJECT + 105 + + ) + +1124 + #OBJ_F_OBJ_CREATE + 100 + + ) + +1125 + #OBJ_F_OBJ_DUP + 101 + + ) + +1126 + #OBJ_F_OBJ_NAME_NEW_INDEX + 106 + + ) + +1127 + #OBJ_F_OBJ_NID2LN + 102 + + ) + +1128 + #OBJ_F_OBJ_NID2OBJ + 103 + + ) + +1129 + #OBJ_F_OBJ_NID2SN + 104 + + ) + +1132 + #OBJ_R_MALLOC_FAILURE + 100 + + ) + +1133 + #OBJ_R_UNKNOWN_NID + 101 + + ) + +1135 #ifde� +__�lu�lus + + + @/usr/include/openssl/ossl_typ.h + +55 #i�de� +HEADER_OPENSSL_TYPES_H + + +56 + #HEADER_OPENSSL_TYPES_H + + + ) + +58 + ~<ݒs�/e_os2.h +> + +60 #ifde� +NO_ASN1_TYPEDEFS + + +61 + #ASN1_INTEGER + +ASN1_STRING + + + ) + +62 + #ASN1_ENUMERATED + +ASN1_STRING + + + ) + +63 + #ASN1_BIT_STRING + +ASN1_STRING + + + ) + +64 + #ASN1_OCTET_STRING + +ASN1_STRING + + + ) + +65 + #ASN1_PRINTABLESTRING + +ASN1_STRING + + + ) + +66 + #ASN1_T61STRING + +ASN1_STRING + + + ) + +67 + #ASN1_IA5STRING + +ASN1_STRING + + + ) + +68 + #ASN1_UTCTIME + +ASN1_STRING + + + ) + +69 + #ASN1_GENERALIZEDTIME + +ASN1_STRING + + + ) + +70 + #ASN1_TIME + +ASN1_STRING + + + ) + +71 + #ASN1_GENERALSTRING + +ASN1_STRING + + + ) + +72 + #ASN1_UNIVERSALSTRING + +ASN1_STRING + + + ) + +73 + #ASN1_BMPSTRING + +ASN1_STRING + + + ) + +74 + #ASN1_VISIBLESTRING + +ASN1_STRING + + + ) + +75 + #ASN1_UTF8STRING + +ASN1_STRING + + + ) + +76 + #ASN1_BOOLEAN + + + ) + +77 + #ASN1_NULL + + + ) + +79 +a�1_�r�g_� + + tASN1_INTEGER +; + +80 +a�1_�r�g_� + + tASN1_ENUMERATED +; + +81 +a�1_�r�g_� + + tASN1_BIT_STRING +; + +82 +a�1_�r�g_� + + tASN1_OCTET_STRING +; + +83 +a�1_�r�g_� + + tASN1_PRINTABLESTRING +; + +84 +a�1_�r�g_� + + tASN1_T61STRING +; + +85 +a�1_�r�g_� + + tASN1_IA5STRING +; + +86 +a�1_�r�g_� + + tASN1_GENERALSTRING +; + +87 +a�1_�r�g_� + + tASN1_UNIVERSALSTRING +; + +88 +a�1_�r�g_� + + tASN1_BMPSTRING +; + +89 +a�1_�r�g_� + + tASN1_UTCTIME +; + +90 +a�1_�r�g_� + + tASN1_TIME +; + +91 +a�1_�r�g_� + + tASN1_GENERALIZEDTIME +; + +92 +a�1_�r�g_� + + tASN1_VISIBLESTRING +; + +93 +a�1_�r�g_� + + tASN1_UTF8STRING +; + +94 +a�1_�r�g_� + + tASN1_STRING +; + +95 + tASN1_BOOLEAN +; + +96 + tASN1_NULL +; + +99 +ASN1_ITEM_� + + tASN1_ITEM +; + +100 +a�1_p�x_� + + tASN1_PCTX +; + +102 #ifde� +OPENSSL_SYS_WIN32 + + +103 #unde� +X509_NAME + + +104 #unde� +X509_EXTENSIONS + + +105 #unde� +X509_CERT_PAIR + + +106 #unde� +PKCS7_ISSUER_AND_SERIAL + + +107 #unde� +OCSP_REQUEST + + +108 #unde� +OCSP_RESPONSE + + +111 #ifde� +BIGNUM + + +112 #unde� +BIGNUM + + +114 +bignum_� + + tBIGNUM +; + +115 +bignum_�x + + tBN_CTX +; + +116 +bn_bl�d�g_� + + tBN_BLINDING +; + +117 +bn_m�t_�x_� + + tBN_MONT_CTX +; + +118 +bn_��_�x_� + + tBN_RECP_CTX +; + +119 +bn_g�cb_� + + tBN_GENCB +; + +121 +buf_mem_� + + tBUF_MEM +; + +123 +evp_c�h�_� + + tEVP_CIPHER +; + +124 +evp_c�h�_�x_� + + tEVP_CIPHER_CTX +; + +125 +�v_md_� + + tEVP_MD +; + +126 +�v_md_�x_� + + tEVP_MD_CTX +; + +127 +evp_pkey_� + + tEVP_PKEY +; + +129 +evp_pkey_a�1_m�hod_� + + tEVP_PKEY_ASN1_METHOD +; + +131 +evp_pkey_m�hod_� + + tEVP_PKEY_METHOD +; + +132 +evp_pkey_�x_� + + tEVP_PKEY_CTX +; + +134 +dh_� + + tDH +; + +135 +dh_m�hod + + tDH_METHOD +; + +137 +d�_� + + tDSA +; + +138 +d�_m�hod + + tDSA_METHOD +; + +140 +r�_� + + tRSA +; + +141 +r�_m�h_� + + tRSA_METHOD +; + +143 +�nd_m�h_� + + tRAND_METHOD +; + +145 +ecdh_m�hod + + tECDH_METHOD +; + +146 +ecd�_m�hod + + tECDSA_METHOD +; + +148 +x509_� + + tX509 +; + +149 +X509_�g�_� + + tX509_ALGOR +; + +150 +X509_�l_� + + tX509_CRL +; + +151 +x509_�l_m�hod_� + + tX509_CRL_METHOD +; + +152 +x509_�voked_� + + tX509_REVOKED +; + +153 +X509_�me_� + + tX509_NAME +; + +154 +X509_pubkey_� + + tX509_PUBKEY +; + +155 +x509_��e_� + + tX509_STORE +; + +156 +x509_��e_�x_� + + tX509_STORE_CTX +; + +158 +pkcs8_�iv_key_�fo_� + + tPKCS8_PRIV_KEY_INFO +; + +160 +v3_ext_�x + + tX509V3_CTX +; + +161 +c�f_� + + tCONF +; + +163 +��e_� + + tSTORE +; + +164 +��e_m�hod_� + + tSTORE_METHOD +; + +166 +ui_� + + tUI +; + +167 +ui_m�hod_� + + tUI_METHOD +; + +169 +�_ERR_FNS + + tERR_FNS +; + +171 +�g�e_� + + tENGINE +; + +172 +s�_� + + tSSL +; + +173 +s�_�x_� + + tSSL_CTX +; + +175 +X509_POLICY_NODE_� + + tX509_POLICY_NODE +; + +176 +X509_POLICY_LEVEL_� + + tX509_POLICY_LEVEL +; + +177 +X509_POLICY_TREE_� + + tX509_POLICY_TREE +; + +178 +X509_POLICY_CACHE_� + + tX509_POLICY_CACHE +; + +180 +AUTHORITY_KEYID_� + + tAUTHORITY_KEYID +; + +181 +DIST_POINT_� + + tDIST_POINT +; + +182 +ISSUING_DIST_POINT_� + + tISSUING_DIST_POINT +; + +183 +NAME_CONSTRAINTS_� + + tNAME_CONSTRAINTS +; + +186 + #DECLARE_PKCS12_STACK_OF +( +ty� +� + + ) + +187 + #IMPLEMENT_PKCS12_STACK_OF +( +ty� +� + + ) + +189 +�y�o_ex_d�a_� + + tCRYPTO_EX_DATA +; + +191 + tCRYPTO_EX_�w +(* + t��� +, * + t�r +, + tCRYPTO_EX_DATA + * + tad +, + +192 + tidx +, + t�gl +, * + t�gp +); + +193 + tCRYPTO_EX_� +(* + t��� +, * + t�r +, + tCRYPTO_EX_DATA + * + tad +, + +194 + tidx +, + t�gl +, * + t�gp +); + +195 + tCRYPTO_EX_dup +( + tCRYPTO_EX_DATA + * + tto +, CRYPTO_EX_DATA * + t�om +, * + t�om_d +, + +196 + tidx +, + t�gl +, * + t�gp +); + +198 +oc�_�q_�x_� + + tOCSP_REQ_CTX +; + +199 +oc�_��ڣ_� + + tOCSP_RESPONSE +; + +200 +oc�_���d�_id_� + + tOCSP_RESPID +; + + @/usr/include/openssl/pem.h + +59 #i�de� +HEADER_PEM_H + + +60 + #HEADER_PEM_H + + + ) + +62 + ~<ݒs�/e_os2.h +> + +63 #i�de� +OPENSSL_NO_BIO + + +64 + ~<ݒs�/bio.h +> + +66 #i�de� +OPENSSL_NO_STACK + + +67 + ~<ݒs�/�ack.h +> + +69 + ~<ݒs�/evp.h +> + +70 + ~<ݒs�/x509.h +> + +71 + ~<ݒs�/�m2.h +> + +73 #ifde� +__�lu�lus + + +77 + #PEM_BUFSIZE + 1024 + + ) + +79 + #PEM_OBJ_UNDEF + 0 + + ) + +80 + #PEM_OBJ_X509 + 1 + + ) + +81 + #PEM_OBJ_X509_REQ + 2 + + ) + +82 + #PEM_OBJ_CRL + 3 + + ) + +83 + #PEM_OBJ_SSL_SESSION + 4 + + ) + +84 + #PEM_OBJ_PRIV_KEY + 10 + + ) + +85 + #PEM_OBJ_PRIV_RSA + 11 + + ) + +86 + #PEM_OBJ_PRIV_DSA + 12 + + ) + +87 + #PEM_OBJ_PRIV_DH + 13 + + ) + +88 + #PEM_OBJ_PUB_RSA + 14 + + ) + +89 + #PEM_OBJ_PUB_DSA + 15 + + ) + +90 + #PEM_OBJ_PUB_DH + 16 + + ) + +91 + #PEM_OBJ_DHPARAMS + 17 + + ) + +92 + #PEM_OBJ_DSAPARAMS + 18 + + ) + +93 + #PEM_OBJ_PRIV_RSA_PUBLIC + 19 + + ) + +94 + #PEM_OBJ_PRIV_ECDSA + 20 + + ) + +95 + #PEM_OBJ_PUB_ECDSA + 21 + + ) + +96 + #PEM_OBJ_ECPARAMETERS + 22 + + ) + +98 + #PEM_ERROR + 30 + + ) + +99 + #PEM_DEK_DES_CBC + 40 + + ) + +100 + #PEM_DEK_IDEA_CBC + 45 + + ) + +101 + #PEM_DEK_DES_EDE + 50 + + ) + +102 + #PEM_DEK_DES_ECB + 60 + + ) + +103 + #PEM_DEK_RSA + 70 + + ) + +104 + #PEM_DEK_RSA_MD2 + 80 + + ) + +105 + #PEM_DEK_RSA_MD5 + 90 + + ) + +107 + #PEM_MD_MD2 + +NID_md2 + + + ) + +108 + #PEM_MD_MD5 + +NID_md5 + + + ) + +109 + #PEM_MD_SHA + +NID_sha + + + ) + +110 + #PEM_MD_MD2_RSA + +NID_md2W�hRSAEn�y�i� + + + ) + +111 + #PEM_MD_MD5_RSA + +NID_md5W�hRSAEn�y�i� + + + ) + +112 + #PEM_MD_SHA_RSA + +NID_sha1W�hRSAEn�y�i� + + + ) + +114 + #PEM_STRING_X509_OLD + "X509 CERTIFICATE" + + ) + +115 + #PEM_STRING_X509 + "CERTIFICATE" + + ) + +116 + #PEM_STRING_X509_PAIR + "CERTIFICATE PAIR" + + ) + +117 + #PEM_STRING_X509_TRUSTED + "TRUSTED CERTIFICATE" + + ) + +118 + #PEM_STRING_X509_REQ_OLD + "NEW CERTIFICATE REQUEST" + + ) + +119 + #PEM_STRING_X509_REQ + "CERTIFICATE REQUEST" + + ) + +120 + #PEM_STRING_X509_CRL + "X509 CRL" + + ) + +121 + #PEM_STRING_EVP_PKEY + "ANY PRIVATE KEY" + + ) + +122 + #PEM_STRING_PUBLIC + "PUBLIC KEY" + + ) + +123 + #PEM_STRING_RSA + "RSA PRIVATE KEY" + + ) + +124 + #PEM_STRING_RSA_PUBLIC + "RSA PUBLIC KEY" + + ) + +125 + #PEM_STRING_DSA + "DSA PRIVATE KEY" + + ) + +126 + #PEM_STRING_DSA_PUBLIC + "DSA PUBLIC KEY" + + ) + +127 + #PEM_STRING_PKCS7 + "PKCS7" + + ) + +128 + #PEM_STRING_PKCS7_SIGNED + "PKCS #7 SIGNED DATA" + + ) + +129 + #PEM_STRING_PKCS8 + "ENCRYPTED PRIVATE KEY" + + ) + +130 + #PEM_STRING_PKCS8INF + "PRIVATE KEY" + + ) + +131 + #PEM_STRING_DHPARAMS + "DH PARAMETERS" + + ) + +132 + #PEM_STRING_SSL_SESSION + "SSL SESSION PARAMETERS" + + ) + +133 + #PEM_STRING_DSAPARAMS + "DSA PARAMETERS" + + ) + +134 + #PEM_STRING_ECDSA_PUBLIC + "ECDSA PUBLIC KEY" + + ) + +135 + #PEM_STRING_ECPARAMETERS + "EC PARAMETERS" + + ) + +136 + #PEM_STRING_ECPRIVATEKEY + "EC PRIVATE KEY" + + ) + +137 + #PEM_STRING_PARAMETERS + "PARAMETERS" + + ) + +138 + #PEM_STRING_CMS + "CMS" + + ) + +142 + sPEM_Encode_S�l_� + + +144 +EVP_ENCODE_CTX + +�code +; + +145 +EVP_MD_CTX + +md +; + +146 +EVP_CIPHER_CTX + +c�h� +; + +147 } + tPEM_ENCODE_SEAL_CTX +; + +150 + #PEM_TYPE_ENCRYPTED + 10 + + ) + +151 + #PEM_TYPE_MIC_ONLY + 20 + + ) + +152 + #PEM_TYPE_MIC_CLEAR + 30 + + ) + +153 + #PEM_TYPE_CLEAR + 40 + + ) + +155 + s�m_�c�_� + + +157 * +�me +; + +158 +X509_NAME + * +dn +; + +160 +c�h� +; + +161 +key_�c +; + +163 } + tPEM_USER +; + +165 + s�m_�x_� + + +167 +ty� +; + +170 +v�si� +; + +171 +mode +; + +172 } +�oc_ty� +; + +174 * +doma� +; + +177 +c�h� +; + +180 } +DEK_�fo +; + +182 +PEM_USER + * +�ig��� +; + +184 +num_�c��� +; + +185 +PEM_USER + ** +�c��� +; + +189 +EVP_MD + * +md +; + +191 +md_�c +; + +192 +md_�n +; + +193 * +md_d�a +; + +195 +EVP_CIPHER + * +dec +; + +196 +key_�n +; + +197 * +key +; + +202 +d�a_�c +; + +203 +d�a_�n +; + +204 * +d�a +; + +205 } + tPEM_CTX +; + +212 #ifde� +OPENSSL_NO_FP_API + + +214 + #IMPLEMENT_PEM_�ad_� +( +�me +, +ty� +, +�r +, +a�1 +� + + ) + +215 + #IMPLEMENT_PEM_wr�e_� +( +�me +, +ty� +, +�r +, +a�1 +� + + ) + +216 + #IMPLEMENT_PEM_wr�e_�_cڡ +( +�me +, +ty� +, +�r +, +a�1 +� + + ) + +217 + #IMPLEMENT_PEM_wr�e_cb_� +( +�me +, +ty� +, +�r +, +a�1 +� + + ) + +218 + #IMPLEMENT_PEM_wr�e_cb_�_cڡ +( +�me +, +ty� +, +�r +, +a�1 +� + + ) + +222 + #IMPLEMENT_PEM_�ad_� +( +�me +, +ty� +, +�r +, +a�1 +) \ + +223 +ty� + * +PEM_�ad_ +## + `�me +( +FILE + * +� +,�y� ** +x +, +�m_�ssw�d_cb + * +cb +, * +u +)\ + +225 + `PEM_ASN1_�ad +(( +d2i_of_void + *) +d2i_ +## +a�1 +, +�r +, +� +,(**) +x +, +cb +, +u +); \ + +226 } + + ) + +228 + #IMPLEMENT_PEM_wr�e_� +( +�me +, +ty� +, +�r +, +a�1 +) \ + +229 +PEM_wr�e_ +## + `�me +( +FILE + * +� +, +ty� + * +x +) \ + +231 + `PEM_ASN1_wr�e +(( +i2d_of_void + *) +i2d_ +## +a�1 +, +�r +, +� +, +x +, +NULL +,NULL,0,NULL,NULL); \ + +232 } + + ) + +234 + #IMPLEMENT_PEM_wr�e_�_cڡ +( +�me +, +ty� +, +�r +, +a�1 +) \ + +235 +PEM_wr�e_ +## + `�me +( +FILE + * +� +, cڡ +ty� + * +x +) \ + +237 + `PEM_ASN1_wr�e +(( +i2d_of_void + *) +i2d_ +## +a�1 +, +�r +, +� +,(*) +x +, +NULL +,NULL,0,NULL,NULL); \ + +238 } + + ) + +240 + #IMPLEMENT_PEM_wr�e_cb_� +( +�me +, +ty� +, +�r +, +a�1 +) \ + +241 +PEM_wr�e_ +## + `�me +( +FILE + * +� +, +ty� + * +x +, cڡ +EVP_CIPHER + * +�c +, \ + +242 * +k�r +, +k�n +, +�m_�ssw�d_cb + * +cb +, \ + +243 * +u +) \ + +245 + `PEM_ASN1_wr�e +(( +i2d_of_void + *) +i2d_ +## +a�1 +, +�r +, +� +, +x +, +�c +, +k�r +, +k�n +, +cb +, +u +); \ + +246 } + + ) + +248 + #IMPLEMENT_PEM_wr�e_cb_�_cڡ +( +�me +, +ty� +, +�r +, +a�1 +) \ + +249 +PEM_wr�e_ +## + `�me +( +FILE + * +� +, +ty� + * +x +, cڡ +EVP_CIPHER + * +�c +, \ + +250 * +k�r +, +k�n +, +�m_�ssw�d_cb + * +cb +, \ + +251 * +u +) \ + +253 + `PEM_ASN1_wr�e +(( +i2d_of_void + *) +i2d_ +## +a�1 +, +�r +, +� +, +x +, +�c +, +k�r +, +k�n +, +cb +, +u +); \ + +254 } + + ) + +258 + #IMPLEMENT_PEM_�ad_bio +( +�me +, +ty� +, +�r +, +a�1 +) \ + +259 +ty� + * +PEM_�ad_bio_ +## + `�me +( +BIO + * +bp +,�y� ** +x +, +�m_�ssw�d_cb + * +cb +, * +u +)\ + +261 + `PEM_ASN1_�ad_bio +(( +d2i_of_void + *) +d2i_ +## +a�1 +, +�r +, +bp +,(**) +x +, +cb +, +u +); \ + +262 } + + ) + +264 + #IMPLEMENT_PEM_wr�e_bio +( +�me +, +ty� +, +�r +, +a�1 +) \ + +265 +PEM_wr�e_bio_ +## + `�me +( +BIO + * +bp +, +ty� + * +x +) \ + +267 + `PEM_ASN1_wr�e_bio +(( +i2d_of_void + *) +i2d_ +## +a�1 +, +�r +, +bp +, +x +, +NULL +,NULL,0,NULL,NULL); \ + +268 } + + ) + +270 + #IMPLEMENT_PEM_wr�e_bio_cڡ +( +�me +, +ty� +, +�r +, +a�1 +) \ + +271 +PEM_wr�e_bio_ +## + `�me +( +BIO + * +bp +, cڡ +ty� + * +x +) \ + +273 + `PEM_ASN1_wr�e_bio +(( +i2d_of_void + *) +i2d_ +## +a�1 +, +�r +, +bp +,(*) +x +, +NULL +,NULL,0,NULL,NULL); \ + +274 } + + ) + +276 + #IMPLEMENT_PEM_wr�e_cb_bio +( +�me +, +ty� +, +�r +, +a�1 +) \ + +277 +PEM_wr�e_bio_ +## + `�me +( +BIO + * +bp +, +ty� + * +x +, cڡ +EVP_CIPHER + * +�c +, \ + +278 * +k�r +, +k�n +, +�m_�ssw�d_cb + * +cb +, * +u +) \ + +280 + `PEM_ASN1_wr�e_bio +(( +i2d_of_void + *) +i2d_ +## +a�1 +, +�r +, +bp +, +x +, +�c +, +k�r +, +k�n +, +cb +, +u +); \ + +281 } + + ) + +283 + #IMPLEMENT_PEM_wr�e_cb_bio_cڡ +( +�me +, +ty� +, +�r +, +a�1 +) \ + +284 +PEM_wr�e_bio_ +## + `�me +( +BIO + * +bp +, +ty� + * +x +, cڡ +EVP_CIPHER + * +�c +, \ + +285 * +k�r +, +k�n +, +�m_�ssw�d_cb + * +cb +, * +u +) \ + +287 + `PEM_ASN1_wr�e_bio +(( +i2d_of_void + *) +i2d_ +## +a�1 +, +�r +, +bp +,(*) +x +, +�c +, +k�r +, +k�n +, +cb +, +u +); \ + +288 } + + ) + +290 + #IMPLEMENT_PEM_wr�e +( +�me +, +ty� +, +�r +, +a�1 +) \ + +291 + `IMPLEMENT_PEM_wr�e_bio +( +�me +, +ty� +, +�r +, +a�1 +) \ + +292 + `IMPLEMENT_PEM_wr�e_� +( +�me +, +ty� +, +�r +, +a�1 +) + + ) + +294 + #IMPLEMENT_PEM_wr�e_cڡ +( +�me +, +ty� +, +�r +, +a�1 +) \ + +295 + `IMPLEMENT_PEM_wr�e_bio_cڡ +( +�me +, +ty� +, +�r +, +a�1 +) \ + +296 + `IMPLEMENT_PEM_wr�e_�_cڡ +( +�me +, +ty� +, +�r +, +a�1 +) + + ) + +298 + #IMPLEMENT_PEM_wr�e_cb +( +�me +, +ty� +, +�r +, +a�1 +) \ + +299 + `IMPLEMENT_PEM_wr�e_cb_bio +( +�me +, +ty� +, +�r +, +a�1 +) \ + +300 + `IMPLEMENT_PEM_wr�e_cb_� +( +�me +, +ty� +, +�r +, +a�1 +) + + ) + +302 + #IMPLEMENT_PEM_wr�e_cb_cڡ +( +�me +, +ty� +, +�r +, +a�1 +) \ + +303 + `IMPLEMENT_PEM_wr�e_cb_bio_cڡ +( +�me +, +ty� +, +�r +, +a�1 +) \ + +304 + `IMPLEMENT_PEM_wr�e_cb_�_cڡ +( +�me +, +ty� +, +�r +, +a�1 +) + + ) + +306 + #IMPLEMENT_PEM_�ad +( +�me +, +ty� +, +�r +, +a�1 +) \ + +307 + `IMPLEMENT_PEM_�ad_bio +( +�me +, +ty� +, +�r +, +a�1 +) \ + +308 + `IMPLEMENT_PEM_�ad_� +( +�me +, +ty� +, +�r +, +a�1 +) + + ) + +310 + #IMPLEMENT_PEM_rw +( +�me +, +ty� +, +�r +, +a�1 +) \ + +311 + `IMPLEMENT_PEM_�ad +( +�me +, +ty� +, +�r +, +a�1 +) \ + +312 + `IMPLEMENT_PEM_wr�e +( +�me +, +ty� +, +�r +, +a�1 +) + + ) + +314 + #IMPLEMENT_PEM_rw_cڡ +( +�me +, +ty� +, +�r +, +a�1 +) \ + +315 + `IMPLEMENT_PEM_�ad +( +�me +, +ty� +, +�r +, +a�1 +) \ + +316 + `IMPLEMENT_PEM_wr�e_cڡ +( +�me +, +ty� +, +�r +, +a�1 +) + + ) + +318 + #IMPLEMENT_PEM_rw_cb +( +�me +, +ty� +, +�r +, +a�1 +) \ + +319 + `IMPLEMENT_PEM_�ad +( +�me +, +ty� +, +�r +, +a�1 +) \ + +320 + `IMPLEMENT_PEM_wr�e_cb +( +�me +, +ty� +, +�r +, +a�1 +) + + ) + +324 #i� +def�ed +( +OPENSSL_NO_FP_API +) + +326 + #DECLARE_PEM_�ad_� +( +�me +, +ty� +� + + ) + +327 + #DECLARE_PEM_wr�e_� +( +�me +, +ty� +� + + ) + +328 + #DECLARE_PEM_wr�e_cb_� +( +�me +, +ty� +� + + ) + +332 + #DECLARE_PEM_�ad_� +( +�me +, +ty� +) \ + +333 +ty� + * +PEM_�ad_ +## + `�me +( +FILE + * +� +,�y� ** +x +, +�m_�ssw�d_cb + * +cb +, * +u +); + + ) + +335 + #DECLARE_PEM_wr�e_� +( +�me +, +ty� +) \ + +336 +PEM_wr�e_ +## + `�me +( +FILE + * +� +, +ty� + * +x +); + + ) + +338 + #DECLARE_PEM_wr�e_�_cڡ +( +�me +, +ty� +) \ + +339 +PEM_wr�e_ +## + `�me +( +FILE + * +� +, cڡ +ty� + * +x +); + + ) + +341 + #DECLARE_PEM_wr�e_cb_� +( +�me +, +ty� +) \ + +342 +PEM_wr�e_ +## + `�me +( +FILE + * +� +, +ty� + * +x +, cڡ +EVP_CIPHER + * +�c +, \ + +343 * +k�r +, +k�n +, +�m_�ssw�d_cb + * +cb +, * +u +); + + ) + +347 #i�de� +OPENSSL_NO_BIO + + +348 + #DECLARE_PEM_�ad_bio +( +�me +, +ty� +) \ + +349 +ty� + * +PEM_�ad_bio_ +## + `�me +( +BIO + * +bp +,�y� ** +x +, +�m_�ssw�d_cb + * +cb +, * +u +); + + ) + +351 + #DECLARE_PEM_wr�e_bio +( +�me +, +ty� +) \ + +352 +PEM_wr�e_bio_ +## + `�me +( +BIO + * +bp +, +ty� + * +x +); + + ) + +354 + #DECLARE_PEM_wr�e_bio_cڡ +( +�me +, +ty� +) \ + +355 +PEM_wr�e_bio_ +## + `�me +( +BIO + * +bp +, cڡ +ty� + * +x +); + + ) + +357 + #DECLARE_PEM_wr�e_cb_bio +( +�me +, +ty� +) \ + +358 +PEM_wr�e_bio_ +## + `�me +( +BIO + * +bp +, +ty� + * +x +, cڡ +EVP_CIPHER + * +�c +, \ + +359 * +k�r +, +k�n +, +�m_�ssw�d_cb + * +cb +, * +u +); + + ) + +363 + #DECLARE_PEM_�ad_bio +( +�me +, +ty� +� + + ) + +364 + #DECLARE_PEM_wr�e_bio +( +�me +, +ty� +� + + ) + +365 + #DECLARE_PEM_wr�e_bio_cڡ +( +�me +, +ty� +� + + ) + +366 + #DECLARE_PEM_wr�e_cb_bio +( +�me +, +ty� +� + + ) + +370 + #DECLARE_PEM_wr�e +( +�me +, +ty� +) \ + +371 + `DECLARE_PEM_wr�e_bio +( +�me +, +ty� +) \ + +372 + `DECLARE_PEM_wr�e_� +( +�me +, +ty� +) + + ) + +374 + #DECLARE_PEM_wr�e_cڡ +( +�me +, +ty� +) \ + +375 + `DECLARE_PEM_wr�e_bio_cڡ +( +�me +, +ty� +) \ + +376 + `DECLARE_PEM_wr�e_�_cڡ +( +�me +, +ty� +) + + ) + +378 + #DECLARE_PEM_wr�e_cb +( +�me +, +ty� +) \ + +379 + `DECLARE_PEM_wr�e_cb_bio +( +�me +, +ty� +) \ + +380 + `DECLARE_PEM_wr�e_cb_� +( +�me +, +ty� +) + + ) + +382 + #DECLARE_PEM_�ad +( +�me +, +ty� +) \ + +383 + `DECLARE_PEM_�ad_bio +( +�me +, +ty� +) \ + +384 + `DECLARE_PEM_�ad_� +( +�me +, +ty� +) + + ) + +386 + #DECLARE_PEM_rw +( +�me +, +ty� +) \ + +387 + `DECLARE_PEM_�ad +( +�me +, +ty� +) \ + +388 + `DECLARE_PEM_wr�e +( +�me +, +ty� +) + + ) + +390 + #DECLARE_PEM_rw_cڡ +( +�me +, +ty� +) \ + +391 + `DECLARE_PEM_�ad +( +�me +, +ty� +) \ + +392 + `DECLARE_PEM_wr�e_cڡ +( +�me +, +ty� +) + + ) + +394 + #DECLARE_PEM_rw_cb +( +�me +, +ty� +) \ + +395 + `DECLARE_PEM_�ad +( +�me +, +ty� +) \ + +396 + `DECLARE_PEM_wr�e_cb +( +�me +, +ty� +) + + ) + +400 + t�m_�ssw�d_cb +(* + tbuf +, + tsize +, + trw�ag +, * + tu�rd�a +); + +403 + t�m_�ssw�d_cb +(* + tbuf +, + tsize +, + trw�ag +); + +406 +PEM_g�_EVP_CIPHER_INFO +(* +h�d� +, +EVP_CIPHER_INFO + * +c�h� +); + +407 +PEM_do_h�d� + ( +EVP_CIPHER_INFO + * +c�h� +, * +d�a +,* +�n +, + +408 +�m_�ssw�d_cb + * +��back +,* +u +); + +410 #i�de� +OPENSSL_NO_BIO + + +411 +PEM_�ad_bio +( +BIO + * +bp +, ** +�me +, ** +h�d� +, + +412 ** +d�a +,* +�n +); + +413 +PEM_wr�e_bio +( +BIO + * +bp +,cڡ * +�me +,* +hdr +,* +d�a +, + +414 +�n +); + +415 +PEM_by�s_�ad_bio +(** +pd�a +, * +�� +, ** +�m +, cڡ * +�me +, +BIO + * +bp +, + +416 +�m_�ssw�d_cb + * +cb +, * +u +); + +417 * +PEM_ASN1_�ad_bio +( +d2i_of_void + * +d2i +, cڡ * +�me +, +BIO + * +bp +, + +418 ** +x +, +�m_�ssw�d_cb + * +cb +, * +u +); + +419 +PEM_ASN1_wr�e_bio +( +i2d_of_void + * +i2d +,cڡ * +�me +, +BIO + * +bp +, * +x +, + +420 cڡ +EVP_CIPHER + * +�c +,* +k�r +, +k�n +, + +421 +�m_�ssw�d_cb + * +cb +, * +u +); + +423 +STACK_OF +( +X509_INFO +�* +PEM_X509_INFO_�ad_bio +( +BIO + * +bp +, STACK_OF(X509_INFO�* +sk +, +�m_�ssw�d_cb + * +cb +, * +u +); + +424 +PEM_X509_INFO_wr�e_bio +( +BIO + * +bp +, +X509_INFO + * +xi +, +EVP_CIPHER + * +�c +, + +425 * +k�r +, +k�n +, +�m_�ssw�d_cb + * +cd +, * +u +); + +428 +PEM_�ad +( +FILE + * +� +, ** +�me +, ** +h�d� +, + +429 ** +d�a +,* +�n +); + +430 +PEM_wr�e +( +FILE + * +� +,* +�me +,* +hdr +,* +d�a +, +�n +); + +431 * +PEM_ASN1_�ad +( +d2i_of_void + * +d2i +, cڡ * +�me +, +FILE + * +� +, ** +x +, + +432 +�m_�ssw�d_cb + * +cb +, * +u +); + +433 +PEM_ASN1_wr�e +( +i2d_of_void + * +i2d +,cڡ * +�me +, +FILE + * +� +, + +434 * +x +,cڡ +EVP_CIPHER + * +�c +,* +k�r +, + +435 +k�n +, +�m_�ssw�d_cb + * +��back +, * +u +); + +436 +STACK_OF +( +X509_INFO +�* +PEM_X509_INFO_�ad +( +FILE + * +� +, STACK_OF(X509_INFO�* +sk +, + +437 +�m_�ssw�d_cb + * +cb +, * +u +); + +439 +PEM_S�lIn� +( +PEM_ENCODE_SEAL_CTX + * +�x +, +EVP_CIPHER + * +ty� +, + +440 +EVP_MD + * +md_ty� +, ** +ek +, * +ekl +, + +441 * +iv +, +EVP_PKEY + ** +pubk +, +�ubk +); + +442 +PEM_S�lUpd�e +( +PEM_ENCODE_SEAL_CTX + * +�x +, * +out +, * +ou� +, + +443 * +� +, +�l +); + +444 +PEM_S�lF�� +( +PEM_ENCODE_SEAL_CTX + * +�x +, * +sig +,* +sigl +, + +445 * +out +, * +ou� +, +EVP_PKEY + * +�iv +); + +447 +PEM_SignIn� +( +EVP_MD_CTX + * +�x +, +EVP_MD + * +ty� +); + +448 +PEM_SignUpd�e +( +EVP_MD_CTX + * +�x +,* +d +, +�t +); + +449 +PEM_SignF�� +( +EVP_MD_CTX + * +�x +, * +sig�t +, + +450 * +sig�n +, +EVP_PKEY + * +pkey +); + +452 +PEM_def_��back +(* +buf +, +num +, +w +, * +key +); + +453 +PEM_�oc_ty� +(* +buf +, +ty� +); + +454 +PEM_dek_�fo +(* +buf +, cڡ * +ty� +, +�n +, * +�r +); + +457 + ~<ݒs�/symhacks.h +> + +459 +DECLARE_PEM_rw +( +X509 +, X509) + +461 +DECLARE_PEM_rw +( +X509_AUX +, +X509 +) + +463 +DECLARE_PEM_rw +( +X509_CERT_PAIR +, X509_CERT_PAIR) + +465 +DECLARE_PEM_rw +( +X509_REQ +, X509_REQ) + +466 +DECLARE_PEM_wr�e +( +X509_REQ_NEW +, +X509_REQ +) + +468 +DECLARE_PEM_rw +( +X509_CRL +, X509_CRL) + +470 +DECLARE_PEM_rw +( +PKCS7 +, PKCS7) + +472 +DECLARE_PEM_rw +( +NETSCAPE_CERT_SEQUENCE +, NETSCAPE_CERT_SEQUENCE) + +474 +DECLARE_PEM_rw +( +PKCS8 +, +X509_SIG +) + +476 +DECLARE_PEM_rw +( +PKCS8_PRIV_KEY_INFO +, PKCS8_PRIV_KEY_INFO) + +478 #i�de� +OPENSSL_NO_RSA + + +480 +DECLARE_PEM_rw_cb +( +RSAPriv�eKey +, +RSA +) + +482 +DECLARE_PEM_rw_cڡ +( +RSAPublicKey +, +RSA +) + +483 +DECLARE_PEM_rw +( +RSA_PUBKEY +, +RSA +) + +487 #i�de� +OPENSSL_NO_DSA + + +489 +DECLARE_PEM_rw_cb +( +DSAPriv�eKey +, +DSA +) + +491 +DECLARE_PEM_rw +( +DSA_PUBKEY +, +DSA +) + +493 +DECLARE_PEM_rw_cڡ +( +DSA��ms +, +DSA +) + +497 #i�de� +OPENSSL_NO_EC + + +498 +DECLARE_PEM_rw_cڡ +( +ECPKP�am��s +, +EC_GROUP +) + +499 +DECLARE_PEM_rw_cb +( +ECPriv�eKey +, +EC_KEY +) + +500 +DECLARE_PEM_rw +( +EC_PUBKEY +, +EC_KEY +) + +503 #i�de� +OPENSSL_NO_DH + + +505 +DECLARE_PEM_rw_cڡ +( +DH��ms +, +DH +) + +509 +DECLARE_PEM_rw_cb +( +Priv�eKey +, +EVP_PKEY +) + +511 +DECLARE_PEM_rw +( +PUBKEY +, +EVP_PKEY +) + +513 +PEM_wr�e_bio_PKCS8Priv�eKey_nid +( +BIO + * +bp +, +EVP_PKEY + * +x +, +nid +, + +514 * +k�r +, +k�n +, + +515 +�m_�ssw�d_cb + * +cb +, * +u +); + +516 +PEM_wr�e_bio_PKCS8Priv�eKey +( +BIO + *, +EVP_PKEY + *, cڡ +EVP_CIPHER + *, + +517 *, , +�m_�ssw�d_cb + *, *); + +518 +i2d_PKCS8Priv�eKey_bio +( +BIO + * +bp +, +EVP_PKEY + * +x +, cڡ +EVP_CIPHER + * +�c +, + +519 * +k�r +, +k�n +, + +520 +�m_�ssw�d_cb + * +cb +, * +u +); + +521 +i2d_PKCS8Priv�eKey_nid_bio +( +BIO + * +bp +, +EVP_PKEY + * +x +, +nid +, + +522 * +k�r +, +k�n +, + +523 +�m_�ssw�d_cb + * +cb +, * +u +); + +524 +EVP_PKEY + * +d2i_PKCS8Priv�eKey_bio +( +BIO + * +bp +, EVP_PKEY ** +x +, +�m_�ssw�d_cb + * +cb +, * +u +); + +526 +i2d_PKCS8Priv�eKey_� +( +FILE + * +� +, +EVP_PKEY + * +x +, cڡ +EVP_CIPHER + * +�c +, + +527 * +k�r +, +k�n +, + +528 +�m_�ssw�d_cb + * +cb +, * +u +); + +529 +i2d_PKCS8Priv�eKey_nid_� +( +FILE + * +� +, +EVP_PKEY + * +x +, +nid +, + +530 * +k�r +, +k�n +, + +531 +�m_�ssw�d_cb + * +cb +, * +u +); + +532 +PEM_wr�e_PKCS8Priv�eKey_nid +( +FILE + * +� +, +EVP_PKEY + * +x +, +nid +, + +533 * +k�r +, +k�n +, + +534 +�m_�ssw�d_cb + * +cb +, * +u +); + +536 +EVP_PKEY + * +d2i_PKCS8Priv�eKey_� +( +FILE + * +� +, EVP_PKEY ** +x +, +�m_�ssw�d_cb + * +cb +, * +u +); + +538 +PEM_wr�e_PKCS8Priv�eKey +( +FILE + * +� +, +EVP_PKEY + * +x +,cڡ +EVP_CIPHER + * +�c +, + +539 * +k�r +, +k�n +, +�m_�ssw�d_cb + * +cd +, * +u +); + +541 +EVP_PKEY + * +PEM_�ad_bio_P�am��s +( +BIO + * +bp +, EVP_PKEY ** +x +); + +542 +PEM_wr�e_bio_P�am��s +( +BIO + * +bp +, +EVP_PKEY + * +x +); + +545 +EVP_PKEY + * +b2i_Priv�eKey +(cڡ ** +� +, +�ngth +); + +546 +EVP_PKEY + * +b2i_PublicKey +(cڡ ** +� +, +�ngth +); + +547 +EVP_PKEY + * +b2i_Priv�eKey_bio +( +BIO + * +� +); + +548 +EVP_PKEY + * +b2i_PublicKey_bio +( +BIO + * +� +); + +549 +i2b_Priv�eKey_bio +( +BIO + * +out +, +EVP_PKEY + * +pk +); + +550 +i2b_PublicKey_bio +( +BIO + * +out +, +EVP_PKEY + * +pk +); + +551 #i�de� +OPENSSL_NO_RC4 + + +552 +EVP_PKEY + * +b2i_PVK_bio +( +BIO + * +� +, +�m_�ssw�d_cb + * +cb +, * +u +); + +553 +i2b_PVK_bio +( +BIO + * +out +, +EVP_PKEY + * +pk +, +��ev� +, + +554 +�m_�ssw�d_cb + * +cb +, * +u +); + +562 +ERR_l�d_PEM_�r�gs +(); + +567 + #PEM_F_B2I_DSS + 127 + + ) + +568 + #PEM_F_B2I_PVK_BIO + 128 + + ) + +569 + #PEM_F_B2I_RSA + 129 + + ) + +570 + #PEM_F_CHECK_BITLEN_DSA + 130 + + ) + +571 + #PEM_F_CHECK_BITLEN_RSA + 131 + + ) + +572 + #PEM_F_D2I_PKCS8PRIVATEKEY_BIO + 120 + + ) + +573 + #PEM_F_D2I_PKCS8PRIVATEKEY_FP + 121 + + ) + +574 + #PEM_F_DO_B2I + 132 + + ) + +575 + #PEM_F_DO_B2I_BIO + 133 + + ) + +576 + #PEM_F_DO_BLOB_HEADER + 134 + + ) + +577 + #PEM_F_DO_PK8PKEY + 126 + + ) + +578 + #PEM_F_DO_PK8PKEY_FP + 125 + + ) + +579 + #PEM_F_DO_PVK_BODY + 135 + + ) + +580 + #PEM_F_DO_PVK_HEADER + 136 + + ) + +581 + #PEM_F_I2B_PVK + 137 + + ) + +582 + #PEM_F_I2B_PVK_BIO + 138 + + ) + +583 + #PEM_F_LOAD_IV + 101 + + ) + +584 + #PEM_F_PEM_ASN1_READ + 102 + + ) + +585 + #PEM_F_PEM_ASN1_READ_BIO + 103 + + ) + +586 + #PEM_F_PEM_ASN1_WRITE + 104 + + ) + +587 + #PEM_F_PEM_ASN1_WRITE_BIO + 105 + + ) + +588 + #PEM_F_PEM_DEF_CALLBACK + 100 + + ) + +589 + #PEM_F_PEM_DO_HEADER + 106 + + ) + +590 + #PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY + 118 + + ) + +591 + #PEM_F_PEM_GET_EVP_CIPHER_INFO + 107 + + ) + +592 + #PEM_F_PEM_PK8PKEY + 119 + + ) + +593 + #PEM_F_PEM_READ + 108 + + ) + +594 + #PEM_F_PEM_READ_BIO + 109 + + ) + +595 + #PEM_F_PEM_READ_BIO_PARAMETERS + 140 + + ) + +596 + #PEM_F_PEM_READ_BIO_PRIVATEKEY + 123 + + ) + +597 + #PEM_F_PEM_READ_PRIVATEKEY + 124 + + ) + +598 + #PEM_F_PEM_SEALFINAL + 110 + + ) + +599 + #PEM_F_PEM_SEALINIT + 111 + + ) + +600 + #PEM_F_PEM_SIGNFINAL + 112 + + ) + +601 + #PEM_F_PEM_WRITE + 113 + + ) + +602 + #PEM_F_PEM_WRITE_BIO + 114 + + ) + +603 + #PEM_F_PEM_WRITE_PRIVATEKEY + 139 + + ) + +604 + #PEM_F_PEM_X509_INFO_READ + 115 + + ) + +605 + #PEM_F_PEM_X509_INFO_READ_BIO + 116 + + ) + +606 + #PEM_F_PEM_X509_INFO_WRITE_BIO + 117 + + ) + +609 + #PEM_R_BAD_BASE64_DECODE + 100 + + ) + +610 + #PEM_R_BAD_DECRYPT + 101 + + ) + +611 + #PEM_R_BAD_END_LINE + 102 + + ) + +612 + #PEM_R_BAD_IV_CHARS + 103 + + ) + +613 + #PEM_R_BAD_MAGIC_NUMBER + 116 + + ) + +614 + #PEM_R_BAD_PASSWORD_READ + 104 + + ) + +615 + #PEM_R_BAD_VERSION_NUMBER + 117 + + ) + +616 + #PEM_R_BIO_WRITE_FAILURE + 118 + + ) + +617 + #PEM_R_CIPHER_IS_NULL + 127 + + ) + +618 + #PEM_R_ERROR_CONVERTING_PRIVATE_KEY + 115 + + ) + +619 + #PEM_R_EXPECTING_PRIVATE_KEY_BLOB + 119 + + ) + +620 + #PEM_R_EXPECTING_PUBLIC_KEY_BLOB + 120 + + ) + +621 + #PEM_R_INCONSISTENT_HEADER + 121 + + ) + +622 + #PEM_R_KEYBLOB_HEADER_PARSE_ERROR + 122 + + ) + +623 + #PEM_R_KEYBLOB_TOO_SHORT + 123 + + ) + +624 + #PEM_R_NOT_DEK_INFO + 105 + + ) + +625 + #PEM_R_NOT_ENCRYPTED + 106 + + ) + +626 + #PEM_R_NOT_PROC_TYPE + 107 + + ) + +627 + #PEM_R_NO_START_LINE + 108 + + ) + +628 + #PEM_R_PROBLEMS_GETTING_PASSWORD + 109 + + ) + +629 + #PEM_R_PUBLIC_KEY_NO_RSA + 110 + + ) + +630 + #PEM_R_PVK_DATA_TOO_SHORT + 124 + + ) + +631 + #PEM_R_PVK_TOO_SHORT + 125 + + ) + +632 + #PEM_R_READ_KEY + 111 + + ) + +633 + #PEM_R_SHORT_HEADER + 112 + + ) + +634 + #PEM_R_UNSUPPORTED_CIPHER + 113 + + ) + +635 + #PEM_R_UNSUPPORTED_ENCRYPTION + 114 + + ) + +636 + #PEM_R_UNSUPPORTED_KEY_COMPONENTS + 126 + + ) + +638 #ifde� +__�lu�lus + + + @/usr/include/openssl/rsa.h + +59 #i�de� +HEADER_RSA_H + + +60 + #HEADER_RSA_H + + + ) + +62 + ~<ݒs�/a�1.h +> + +64 #i�de� +OPENSSL_NO_BIO + + +65 + ~<ݒs�/bio.h +> + +67 + ~<ݒs�/�y�o.h +> + +68 + ~<ݒs�/os�_typ.h +> + +69 #i�de� +OPENSSL_NO_DEPRECATED + + +70 + ~<ݒs�/bn.h +> + +73 #ifde� +OPENSSL_NO_RSA + + +74 #�r� +RSA + +is + +di�b�d +. + +77 #ifde� +__�lu�lus + + +85 + sr�_m�h_� + + +87 cڡ * +�me +; + +88 (* +r�_pub_�c +)( +� +,cڡ * +�om +, + +89 * +to +, + +90 +RSA + * +r� +, +�dd�g +); + +91 (* +r�_pub_dec +)( +� +,cڡ * +�om +, + +92 * +to +, + +93 +RSA + * +r� +, +�dd�g +); + +94 (* +r�_�iv_�c +)( +� +,cڡ * +�om +, + +95 * +to +, + +96 +RSA + * +r� +, +�dd�g +); + +97 (* +r�_�iv_dec +)( +� +,cڡ * +�om +, + +98 * +to +, + +99 +RSA + * +r� +, +�dd�g +); + +100 (* +r�_mod_exp +)( +BIGNUM + * +r0 +,cڡ BIGNUM * +I +, +RSA + * +r� +, +BN_CTX + * +�x +); + +101 (* +bn_mod_exp +)( +BIGNUM + * +r +, cڡ BIGNUM * +a +, cڡ BIGNUM * +p +, + +102 cڡ +BIGNUM + * +m +, +BN_CTX + * +�x +, + +103 +BN_MONT_CTX + * +m_�x +); + +104 (* +�� +)( +RSA + * +r� +); + +105 (* +f�ish +)( +RSA + * +r� +); + +106 +�ags +; + +107 * +�p_d�a +; + +115 (* +r�_sign +)( +ty� +, + +116 cڡ * +m +, +m_�ngth +, + +117 * +sig�t +, * +sig�n +, cڡ +RSA + * +r� +); + +118 (* +r�_v�ify +)( +dty� +, + +119 cڡ * +m +, +m_�ngth +, + +120 cڡ * +sigbuf +, +sig�n +, + +121 cڡ +RSA + * +r� +); + +126 (* +r�_keyg� +)( +RSA + * +r� +, +b�s +, +BIGNUM + * +e +, +BN_GENCB + * +cb +); + +129 + sr�_� + + +133 +�d +; + +134 +v�si� +; + +135 cڡ +RSA_METHOD + * +m�h +; + +137 +ENGINE + * +�g�e +; + +138 +BIGNUM + * +n +; + +139 +BIGNUM + * +e +; + +140 +BIGNUM + * +d +; + +141 +BIGNUM + * +p +; + +142 +BIGNUM + * +q +; + +143 +BIGNUM + * +dmp1 +; + +144 +BIGNUM + * +dmq1 +; + +145 +BIGNUM + * +iqmp +; + +147 +CRYPTO_EX_DATA + +ex_d�a +; + +148 +��n�s +; + +149 +�ags +; + +152 +BN_MONT_CTX + * +_m�hod_mod_n +; + +153 +BN_MONT_CTX + * +_m�hod_mod_p +; + +154 +BN_MONT_CTX + * +_m�hod_mod_q +; + +158 * +bignum_d�a +; + +159 +BN_BLINDING + * +bl�d�g +; + +160 +BN_BLINDING + * +mt_bl�d�g +; + +163 #i�de� +OPENSSL_RSA_MAX_MODULUS_BITS + + +164 + #OPENSSL_RSA_MAX_MODULUS_BITS + 16384 + + ) + +167 #i�de� +OPENSSL_RSA_SMALL_MODULUS_BITS + + +168 + #OPENSSL_RSA_SMALL_MODULUS_BITS + 3072 + + ) + +170 #i�de� +OPENSSL_RSA_MAX_PUBEXP_BITS + + +171 + #OPENSSL_RSA_MAX_PUBEXP_BITS + 64 + + ) + +174 + #RSA_3 + 0x3L + + ) + +175 + #RSA_F4 + 0x10001L + + ) + +177 + #RSA_METHOD_FLAG_NO_CHECK + 0x0001 + + ) + +179 + #RSA_FLAG_CACHE_PUBLIC + 0x0002 + + ) + +180 + #RSA_FLAG_CACHE_PRIVATE + 0x0004 + + ) + +181 + #RSA_FLAG_BLINDING + 0x0008 + + ) + +182 + #RSA_FLAG_THREAD_SAFE + 0x0010 + + ) + +188 + #RSA_FLAG_EXT_PKEY + 0x0020 + + ) + +192 + #RSA_FLAG_SIGN_VER + 0x0040 + + ) + +194 + #RSA_FLAG_NO_BLINDING + 0x0080 + + ) + +199 + #RSA_FLAG_NO_CONSTTIME + 0x0100 + + ) + +209 #i�de� +OPENSSL_NO_DEPRECATED + + +210 + #RSA_FLAG_NO_EXP_CONSTTIME + +RSA_FLAG_NO_CONSTTIME + + + ) + +221 + #EVP_PKEY_CTX_�t_r�_�dd�g +( +�x +, +�d +) \ + +222 + `EVP_PKEY_CTX_�� +( +�x +, +EVP_PKEY_RSA +, -1, +EVP_PKEY_CTRL_RSA_PADDING +, \ + +223 +�d +, +NULL +) + + ) + +225 + #EVP_PKEY_CTX_g�_r�_�dd�g +( +�x +, +�ad +) \ + +226 + `EVP_PKEY_CTX_�� +( +�x +, +EVP_PKEY_RSA +, -1, \ + +227 +EVP_PKEY_CTRL_GET_RSA_PADDING +, 0, +�ad +) + + ) + +229 + #EVP_PKEY_CTX_�t_r�_pss_���n +( +�x +, +�n +) \ + +230 + `EVP_PKEY_CTX_�� +( +�x +, +EVP_PKEY_RSA +, \ + +231 ( +EVP_PKEY_OP_SIGN +| +EVP_PKEY_OP_VERIFY +), \ + +232 +EVP_PKEY_CTRL_RSA_PSS_SALTLEN +, \ + +233 +�n +, +NULL +) + + ) + +235 + #EVP_PKEY_CTX_g�_r�_pss_���n +( +�x +, +�� +) \ + +236 + `EVP_PKEY_CTX_�� +( +�x +, +EVP_PKEY_RSA +, \ + +237 ( +EVP_PKEY_OP_SIGN +| +EVP_PKEY_OP_VERIFY +), \ + +238 +EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN +, \ + +239 0, +�� +) + + ) + +241 + #EVP_PKEY_CTX_�t_r�_keyg�_b�s +( +�x +, +b�s +) \ + +242 + `EVP_PKEY_CTX_�� +( +�x +, +EVP_PKEY_RSA +, +EVP_PKEY_OP_KEYGEN +, \ + +243 +EVP_PKEY_CTRL_RSA_KEYGEN_BITS +, +b�s +, +NULL +) + + ) + +245 + #EVP_PKEY_CTX_�t_r�_keyg�_pubexp +( +�x +, +pubexp +) \ + +246 + `EVP_PKEY_CTX_�� +( +�x +, +EVP_PKEY_RSA +, +EVP_PKEY_OP_KEYGEN +, \ + +247 +EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP +, 0, +pubexp +) + + ) + +249 + #EVP_PKEY_CTX_�t_r�_mgf1_md +( +�x +, +md +) \ + +250 + `EVP_PKEY_CTX_�� +( +�x +, +EVP_PKEY_RSA +, +EVP_PKEY_OP_TYPE_SIG +, \ + +251 +EVP_PKEY_CTRL_RSA_MGF1_MD +, 0, (*) +md +) + + ) + +253 + #EVP_PKEY_CTX_g�_r�_mgf1_md +( +�x +, +pmd +) \ + +254 + `EVP_PKEY_CTX_�� +( +�x +, +EVP_PKEY_RSA +, +EVP_PKEY_OP_TYPE_SIG +, \ + +255 +EVP_PKEY_CTRL_GET_RSA_MGF1_MD +, 0, (*) +pmd +) + + ) + +257 + #EVP_PKEY_CTRL_RSA_PADDING + ( +EVP_PKEY_ALG_CTRL + + 1) + + ) + +258 + #EVP_PKEY_CTRL_RSA_PSS_SALTLEN + ( +EVP_PKEY_ALG_CTRL + + 2) + + ) + +260 + #EVP_PKEY_CTRL_RSA_KEYGEN_BITS + ( +EVP_PKEY_ALG_CTRL + + 3) + + ) + +261 + #EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP + ( +EVP_PKEY_ALG_CTRL + + 4) + + ) + +262 + #EVP_PKEY_CTRL_RSA_MGF1_MD + ( +EVP_PKEY_ALG_CTRL + + 5) + + ) + +264 + #EVP_PKEY_CTRL_GET_RSA_PADDING + ( +EVP_PKEY_ALG_CTRL + + 6) + + ) + +265 + #EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN + ( +EVP_PKEY_ALG_CTRL + + 7) + + ) + +266 + #EVP_PKEY_CTRL_GET_RSA_MGF1_MD + ( +EVP_PKEY_ALG_CTRL + + 8) + + ) + +268 + #RSA_PKCS1_PADDING + 1 + + ) + +269 + #RSA_SSLV23_PADDING + 2 + + ) + +270 + #RSA_NO_PADDING + 3 + + ) + +271 + #RSA_PKCS1_OAEP_PADDING + 4 + + ) + +272 + #RSA_X931_PADDING + 5 + + ) + +274 + #RSA_PKCS1_PSS_PADDING + 6 + + ) + +276 + #RSA_PKCS1_PADDING_SIZE + 11 + + ) + +278 + #RSA_�t_�p_d�a +( +s +, +�g +� + `RSA_�t_ex_d�a +(s,0,�g) + + ) + +279 + #RSA_g�_�p_d�a +( +s +� + `RSA_g�_ex_d�a +(s,0) + + ) + +281 +RSA + * +RSA_�w +(); + +282 +RSA + * +RSA_�w_m�hod +( +ENGINE + * +�g�e +); + +283 +RSA_size +(cڡ +RSA + * +r� +); + +286 #i�de� +OPENSSL_NO_DEPRECATED + + +287 +RSA + * +RSA_g���e_key +( +b�s +, +e +, + +288 (* +��back +)(,,*),* +cb_�g +); + +292 +RSA_g���e_key_ex +( +RSA + * +r� +, +b�s +, +BIGNUM + * +e +, +BN_GENCB + * +cb +); + +294 +RSA_check_key +(cڡ +RSA + *); + +296 +RSA_public_��y� +( +� +, cڡ * +�om +, + +297 * +to +, +RSA + * +r� +, +�dd�g +); + +298 +RSA_�iv�e_��y� +( +� +, cڡ * +�om +, + +299 * +to +, +RSA + * +r� +, +�dd�g +); + +300 +RSA_public_de�y� +( +� +, cڡ * +�om +, + +301 * +to +, +RSA + * +r� +, +�dd�g +); + +302 +RSA_�iv�e_de�y� +( +� +, cڡ * +�om +, + +303 * +to +, +RSA + * +r� +, +�dd�g +); + +304 +RSA_� + ( +RSA + * +r +); + +306 +RSA_up_�f +( +RSA + * +r +); + +308 +RSA_�ags +(cڡ +RSA + * +r +); + +310 +RSA_�t_de�u�_m�hod +(cڡ +RSA_METHOD + * +m�h +); + +311 cڡ +RSA_METHOD + * +RSA_g�_de�u�_m�hod +(); + +312 cڡ +RSA_METHOD + * +RSA_g�_m�hod +(cڡ +RSA + * +r� +); + +313 +RSA_�t_m�hod +( +RSA + * +r� +, cڡ +RSA_METHOD + * +m�h +); + +316 +RSA_mem�y_lock +( +RSA + * +r +); + +319 cڡ +RSA_METHOD + * +RSA_PKCS1_SSL�y +(); + +321 cڡ +RSA_METHOD + * +RSA_nu�_m�hod +(); + +323 +DECLARE_ASN1_ENCODE_FUNCTIONS_cڡ +( +RSA +, +RSAPublicKey +) + +324 +DECLARE_ASN1_ENCODE_FUNCTIONS_cڡ +( +RSA +, +RSAPriv�eKey +) + +326 + sr�_pss_��ms_� + + +328 +X509_ALGOR + * +hashAlgܙhm +; + +329 +X509_ALGOR + * +maskG�Algܙhm +; + +330 +ASN1_INTEGER + * +��L�gth +; + +331 +ASN1_INTEGER + * +�a��F�ld +; + +332 } + tRSA_PSS_PARAMS +; + +334 +DECLARE_ASN1_FUNCTIONS +( +RSA_PSS_PARAMS +) + +336 #i�de� +OPENSSL_NO_FP_API + + +337 +RSA_��t_� +( +FILE + * +� +, cڡ +RSA + * +r +, +off�t +); + +340 #i�de� +OPENSSL_NO_BIO + + +341 +RSA_��t +( +BIO + * +bp +, cڡ +RSA + * +r +, +off�t +); + +344 #i�de� +OPENSSL_NO_RC4 + + +345 +i2d_RSA_NET +(cڡ +RSA + * +a +, ** +� +, + +346 (* +cb +)(* +buf +, +�n +, cڡ * +�om� +, +v�ify +), + +347 +sgckey +); + +348 +RSA + * +d2i_RSA_NET +(RSA ** +a +, cڡ ** +� +, +�ngth +, + +349 (* +cb +)(* +buf +, +�n +, cڡ * +�om� +, +v�ify +), + +350 +sgckey +); + +352 +i2d_N�s��_RSA +(cڡ +RSA + * +a +, ** +� +, + +353 (* +cb +)(* +buf +, +�n +, cڡ * +�om� +, + +354 +v�ify +)); + +355 +RSA + * +d2i_N�s��_RSA +(RSA ** +a +, cڡ ** +� +, +�ngth +, + +356 (* +cb +)(* +buf +, +�n +, cڡ * +�om� +, + +357 +v�ify +)); + +362 +RSA_sign +( +ty� +, cڡ * +m +, +m_�ngth +, + +363 * +sig�t +, * +sig�n +, +RSA + * +r� +); + +364 +RSA_v�ify +( +ty� +, cڡ * +m +, +m_�ngth +, + +365 cڡ * +sigbuf +, +sig�n +, +RSA + * +r� +); + +369 +RSA_sign_ASN1_OCTET_STRING +( +ty� +, + +370 cڡ * +m +, +m_�ngth +, + +371 * +sig�t +, * +sig�n +, +RSA + * +r� +); + +372 +RSA_v�ify_ASN1_OCTET_STRING +( +ty� +, + +373 cڡ * +m +, +m_�ngth +, + +374 * +sigbuf +, +sig�n +, +RSA + * +r� +); + +376 +RSA_bl�d�g_� +( +RSA + * +r� +, +BN_CTX + * +�x +); + +377 +RSA_bl�d�g_off +( +RSA + * +r� +); + +378 +BN_BLINDING + * +RSA_�tup_bl�d�g +( +RSA + * +r� +, +BN_CTX + * +�x +); + +380 +RSA_�dd�g_add_PKCS1_ty�_1 +(* +to +, +�� +, + +381 cڡ * +f +, +� +); + +382 +RSA_�dd�g_check_PKCS1_ty�_1 +(* +to +, +�� +, + +383 cڡ * +f +, +� +, +r�_�n +); + +384 +RSA_�dd�g_add_PKCS1_ty�_2 +(* +to +, +�� +, + +385 cڡ * +f +, +� +); + +386 +RSA_�dd�g_check_PKCS1_ty�_2 +(* +to +, +�� +, + +387 cڡ * +f +, +� +, +r�_�n +); + +388 +PKCS1_MGF1 +(* +mask +, +�n +, + +389 cڡ * +�ed +, +�ed�n +, cڡ +EVP_MD + * +dg� +); + +390 +RSA_�dd�g_add_PKCS1_OAEP +(* +to +, +�� +, + +391 cڡ * +f +, +� +, + +392 cڡ * +p +, +� +); + +393 +RSA_�dd�g_check_PKCS1_OAEP +(* +to +, +�� +, + +394 cڡ * +f +, +� +, +r�_�n +, + +395 cڡ * +p +, +� +); + +396 +RSA_�dd�g_add_SSLv23 +(* +to +, +�� +, + +397 cڡ * +f +, +� +); + +398 +RSA_�dd�g_check_SSLv23 +(* +to +, +�� +, + +399 cڡ * +f +, +� +, +r�_�n +); + +400 +RSA_�dd�g_add_n�e +(* +to +, +�� +, + +401 cڡ * +f +, +� +); + +402 +RSA_�dd�g_check_n�e +(* +to +, +�� +, + +403 cڡ * +f +, +� +, +r�_�n +); + +404 +RSA_�dd�g_add_X931 +(* +to +, +�� +, + +405 cڡ * +f +, +� +); + +406 +RSA_�dd�g_check_X931 +(* +to +, +�� +, + +407 cڡ * +f +, +� +, +r�_�n +); + +408 +RSA_X931_hash_id +( +nid +); + +410 +RSA_v�ify_PKCS1_PSS +( +RSA + * +r� +, cڡ * +mHash +, + +411 cڡ +EVP_MD + * +Hash +, cڡ * +EM +, +sL� +); + +412 +RSA_�dd�g_add_PKCS1_PSS +( +RSA + * +r� +, * +EM +, + +413 cڡ * +mHash +, + +414 cڡ +EVP_MD + * +Hash +, +sL� +); + +416 +RSA_v�ify_PKCS1_PSS_mgf1 +( +RSA + * +r� +, cڡ * +mHash +, + +417 cڡ +EVP_MD + * +Hash +, cڡ EVP_MD * +mgf1Hash +, + +418 cڡ * +EM +, +sL� +); + +420 +RSA_�dd�g_add_PKCS1_PSS_mgf1 +( +RSA + * +r� +, * +EM +, + +421 cڡ * +mHash +, + +422 cڡ +EVP_MD + * +Hash +, cڡ EVP_MD * +mgf1Hash +, +sL� +); + +424 +RSA_g�_ex_�w_�dex +( +�gl +, * +�gp +, +CRYPTO_EX_�w + * +�w_func +, + +425 +CRYPTO_EX_dup + * +dup_func +, +CRYPTO_EX_� + * +�_func +); + +426 +RSA_�t_ex_d�a +( +RSA + * +r +, +idx +,* +�g +); + +427 * +RSA_g�_ex_d�a +(cڡ +RSA + * +r +, +idx +); + +429 +RSA + * +RSAPublicKey_dup +(RSA * +r� +); + +430 +RSA + * +RSAPriv�eKey_dup +(RSA * +r� +); + +438 + #RSA_FLAG_FIPS_METHOD + 0x0400 + + ) + +445 + #RSA_FLAG_NON_FIPS_ALLOW + 0x0400 + + ) + +449 + #RSA_FLAG_CHECKED + 0x0800 + + ) + +455 +ERR_l�d_RSA_�r�gs +(); + +460 + #RSA_F_CHECK_PADDING_MD + 140 + + ) + +461 + #RSA_F_DO_RSA_PRINT + 146 + + ) + +462 + #RSA_F_INT_RSA_VERIFY + 145 + + ) + +463 + #RSA_F_MEMORY_LOCK + 100 + + ) + +464 + #RSA_F_OLD_RSA_PRIV_DECODE + 147 + + ) + +465 + #RSA_F_PKEY_RSA_CTRL + 143 + + ) + +466 + #RSA_F_PKEY_RSA_CTRL_STR + 144 + + ) + +467 + #RSA_F_PKEY_RSA_SIGN + 142 + + ) + +468 + #RSA_F_PKEY_RSA_VERIFY + 154 + + ) + +469 + #RSA_F_PKEY_RSA_VERIFYRECOVER + 141 + + ) + +470 + #RSA_F_RSA_BUILTIN_KEYGEN + 129 + + ) + +471 + #RSA_F_RSA_CHECK_KEY + 123 + + ) + +472 + #RSA_F_RSA_EAY_PRIVATE_DECRYPT + 101 + + ) + +473 + #RSA_F_RSA_EAY_PRIVATE_ENCRYPT + 102 + + ) + +474 + #RSA_F_RSA_EAY_PUBLIC_DECRYPT + 103 + + ) + +475 + #RSA_F_RSA_EAY_PUBLIC_ENCRYPT + 104 + + ) + +476 + #RSA_F_RSA_GENERATE_KEY + 105 + + ) + +477 + #RSA_F_RSA_GENERATE_KEY_EX + 155 + + ) + +478 + #RSA_F_RSA_ITEM_VERIFY + 156 + + ) + +479 + #RSA_F_RSA_MEMORY_LOCK + 130 + + ) + +480 + #RSA_F_RSA_NEW_METHOD + 106 + + ) + +481 + #RSA_F_RSA_NULL + 124 + + ) + +482 + #RSA_F_RSA_NULL_MOD_EXP + 131 + + ) + +483 + #RSA_F_RSA_NULL_PRIVATE_DECRYPT + 132 + + ) + +484 + #RSA_F_RSA_NULL_PRIVATE_ENCRYPT + 133 + + ) + +485 + #RSA_F_RSA_NULL_PUBLIC_DECRYPT + 134 + + ) + +486 + #RSA_F_RSA_NULL_PUBLIC_ENCRYPT + 135 + + ) + +487 + #RSA_F_RSA_PADDING_ADD_NONE + 107 + + ) + +488 + #RSA_F_RSA_PADDING_ADD_PKCS1_OAEP + 121 + + ) + +489 + #RSA_F_RSA_PADDING_ADD_PKCS1_PSS + 125 + + ) + +490 + #RSA_F_RSA_PADDING_ADD_PKCS1_PSS_MGF1 + 148 + + ) + +491 + #RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 + 108 + + ) + +492 + #RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 + 109 + + ) + +493 + #RSA_F_RSA_PADDING_ADD_SSLV23 + 110 + + ) + +494 + #RSA_F_RSA_PADDING_ADD_X931 + 127 + + ) + +495 + #RSA_F_RSA_PADDING_CHECK_NONE + 111 + + ) + +496 + #RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP + 122 + + ) + +497 + #RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 + 112 + + ) + +498 + #RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 + 113 + + ) + +499 + #RSA_F_RSA_PADDING_CHECK_SSLV23 + 114 + + ) + +500 + #RSA_F_RSA_PADDING_CHECK_X931 + 128 + + ) + +501 + #RSA_F_RSA_PRINT + 115 + + ) + +502 + #RSA_F_RSA_PRINT_FP + 116 + + ) + +503 + #RSA_F_RSA_PRIVATE_DECRYPT + 150 + + ) + +504 + #RSA_F_RSA_PRIVATE_ENCRYPT + 151 + + ) + +505 + #RSA_F_RSA_PRIV_DECODE + 137 + + ) + +506 + #RSA_F_RSA_PRIV_ENCODE + 138 + + ) + +507 + #RSA_F_RSA_PUBLIC_DECRYPT + 152 + + ) + +508 + #RSA_F_RSA_PUBLIC_ENCRYPT + 153 + + ) + +509 + #RSA_F_RSA_PUB_DECODE + 139 + + ) + +510 + #RSA_F_RSA_SETUP_BLINDING + 136 + + ) + +511 + #RSA_F_RSA_SIGN + 117 + + ) + +512 + #RSA_F_RSA_SIGN_ASN1_OCTET_STRING + 118 + + ) + +513 + #RSA_F_RSA_VERIFY + 119 + + ) + +514 + #RSA_F_RSA_VERIFY_ASN1_OCTET_STRING + 120 + + ) + +515 + #RSA_F_RSA_VERIFY_PKCS1_PSS + 126 + + ) + +516 + #RSA_F_RSA_VERIFY_PKCS1_PSS_MGF1 + 149 + + ) + +519 + #RSA_R_ALGORITHM_MISMATCH + 100 + + ) + +520 + #RSA_R_BAD_E_VALUE + 101 + + ) + +521 + #RSA_R_BAD_FIXED_HEADER_DECRYPT + 102 + + ) + +522 + #RSA_R_BAD_PAD_BYTE_COUNT + 103 + + ) + +523 + #RSA_R_BAD_SIGNATURE + 104 + + ) + +524 + #RSA_R_BLOCK_TYPE_IS_NOT_01 + 106 + + ) + +525 + #RSA_R_BLOCK_TYPE_IS_NOT_02 + 107 + + ) + +526 + #RSA_R_DATA_GREATER_THAN_MOD_LEN + 108 + + ) + +527 + #RSA_R_DATA_TOO_LARGE + 109 + + ) + +528 + #RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE + 110 + + ) + +529 + #RSA_R_DATA_TOO_LARGE_FOR_MODULUS + 132 + + ) + +530 + #RSA_R_DATA_TOO_SMALL + 111 + + ) + +531 + #RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE + 122 + + ) + +532 + #RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY + 112 + + ) + +533 + #RSA_R_DMP1_NOT_CONGRUENT_TO_D + 124 + + ) + +534 + #RSA_R_DMQ1_NOT_CONGRUENT_TO_D + 125 + + ) + +535 + #RSA_R_D_E_NOT_CONGRUENT_TO_1 + 123 + + ) + +536 + #RSA_R_FIRST_OCTET_INVALID + 133 + + ) + +537 + #RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE + 144 + + ) + +538 + #RSA_R_INVALID_DIGEST_LENGTH + 143 + + ) + +539 + #RSA_R_INVALID_HEADER + 137 + + ) + +540 + #RSA_R_INVALID_KEYBITS + 145 + + ) + +541 + #RSA_R_INVALID_MESSAGE_LENGTH + 131 + + ) + +542 + #RSA_R_INVALID_MGF1_MD + 156 + + ) + +543 + #RSA_R_INVALID_PADDING + 138 + + ) + +544 + #RSA_R_INVALID_PADDING_MODE + 141 + + ) + +545 + #RSA_R_INVALID_PSS_PARAMETERS + 149 + + ) + +546 + #RSA_R_INVALID_PSS_SALTLEN + 146 + + ) + +547 + #RSA_R_INVALID_SALT_LENGTH + 150 + + ) + +548 + #RSA_R_INVALID_TRAILER + 139 + + ) + +549 + #RSA_R_INVALID_X931_DIGEST + 142 + + ) + +550 + #RSA_R_IQMP_NOT_INVERSE_OF_Q + 126 + + ) + +551 + #RSA_R_KEY_SIZE_TOO_SMALL + 120 + + ) + +552 + #RSA_R_LAST_OCTET_INVALID + 134 + + ) + +553 + #RSA_R_MODULUS_TOO_LARGE + 105 + + ) + +554 + #RSA_R_NON_FIPS_RSA_METHOD + 157 + + ) + +555 + #RSA_R_NO_PUBLIC_EXPONENT + 140 + + ) + +556 + #RSA_R_NULL_BEFORE_BLOCK_MISSING + 113 + + ) + +557 + #RSA_R_N_DOES_NOT_EQUAL_P_Q + 127 + + ) + +558 + #RSA_R_OAEP_DECODING_ERROR + 121 + + ) + +559 + #RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE + 158 + + ) + +560 + #RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE + 148 + + ) + +561 + #RSA_R_PADDING_CHECK_FAILED + 114 + + ) + +562 + #RSA_R_P_NOT_PRIME + 128 + + ) + +563 + #RSA_R_Q_NOT_PRIME + 129 + + ) + +564 + #RSA_R_RSA_OPERATIONS_NOT_SUPPORTED + 130 + + ) + +565 + #RSA_R_SLEN_CHECK_FAILED + 136 + + ) + +566 + #RSA_R_SLEN_RECOVERY_FAILED + 135 + + ) + +567 + #RSA_R_SSLV3_ROLLBACK_ATTACK + 115 + + ) + +568 + #RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD + 116 + + ) + +569 + #RSA_R_UNKNOWN_ALGORITHM_TYPE + 117 + + ) + +570 + #RSA_R_UNKNOWN_MASK_DIGEST + 151 + + ) + +571 + #RSA_R_UNKNOWN_PADDING_TYPE + 118 + + ) + +572 + #RSA_R_UNKNOWN_PSS_DIGEST + 152 + + ) + +573 + #RSA_R_UNSUPPORTED_MASK_ALGORITHM + 153 + + ) + +574 + #RSA_R_UNSUPPORTED_MASK_PARAMETER + 154 + + ) + +575 + #RSA_R_UNSUPPORTED_SIGNATURE_TYPE + 155 + + ) + +576 + #RSA_R_VALUE_MISSING + 147 + + ) + +577 + #RSA_R_WRONG_SIGNATURE_LENGTH + 119 + + ) + +579 #ifde� +__�lu�lus + + + @/usr/include/openssl/srtp.h + +118 #i�de� +HEADER_D1_SRTP_H + + +119 + #HEADER_D1_SRTP_H + + + ) + +121 #ifde� +__�lu�lus + + +126 + #SRTP_AES128_CM_SHA1_80 + 0x0001 + + ) + +127 + #SRTP_AES128_CM_SHA1_32 + 0x0002 + + ) + +128 + #SRTP_AES128_F8_SHA1_80 + 0x0003 + + ) + +129 + #SRTP_AES128_F8_SHA1_32 + 0x0004 + + ) + +130 + #SRTP_NULL_SHA1_80 + 0x0005 + + ) + +131 + #SRTP_NULL_SHA1_32 + 0x0006 + + ) + +133 #i�de� +OPENSSL_NO_SRTP + + +135 +SSL_CTX_�t_��xt_u�_�� +( +SSL_CTX + * +�x +, cڡ * +�of�es +); + +136 +SSL_�t_��xt_u�_�� +( +SSL + * +�x +, cڡ * +�of�es +); + +137 +SRTP_PROTECTION_PROFILE + * +SSL_g�_���ed_��_�of�e +( +SSL + * +s +); + +139 +STACK_OF +( +SRTP_PROTECTION_PROFILE +�* +SSL_g�_��_�of�es +( +SSL + * +s� +); + +140 +SRTP_PROTECTION_PROFILE + * +SSL_g�_���ed_��_�of�e +( +SSL + * +s +); + +144 #ifde� +__�lu�lus + + + @/usr/include/openssl/ssl2.h + +59 #i�de� +HEADER_SSL2_H + + +60 + #HEADER_SSL2_H + + + ) + +62 #ifde� +__�lu�lus + + +67 + #SSL2_VERSION + 0x0002 + + ) + +68 + #SSL2_VERSION_MAJOR + 0x00 + + ) + +69 + #SSL2_VERSION_MINOR + 0x02 + + ) + +74 + #SSL2_MT_ERROR + 0 + + ) + +75 + #SSL2_MT_CLIENT_HELLO + 1 + + ) + +76 + #SSL2_MT_CLIENT_MASTER_KEY + 2 + + ) + +77 + #SSL2_MT_CLIENT_FINISHED + 3 + + ) + +78 + #SSL2_MT_SERVER_HELLO + 4 + + ) + +79 + #SSL2_MT_SERVER_VERIFY + 5 + + ) + +80 + #SSL2_MT_SERVER_FINISHED + 6 + + ) + +81 + #SSL2_MT_REQUEST_CERTIFICATE + 7 + + ) + +82 + #SSL2_MT_CLIENT_CERTIFICATE + 8 + + ) + +85 + #SSL2_PE_UNDEFINED_ERROR + 0x0000 + + ) + +86 + #SSL2_PE_NO_CIPHER + 0x0001 + + ) + +87 + #SSL2_PE_NO_CERTIFICATE + 0x0002 + + ) + +88 + #SSL2_PE_BAD_CERTIFICATE + 0x0004 + + ) + +89 + #SSL2_PE_UNSUPPORTED_CERTIFICATE_TYPE + 0x0006 + + ) + +92 + #SSL2_CK_NULL_WITH_MD5 + 0x02000000 + + ) + +93 + #SSL2_CK_RC4_128_WITH_MD5 + 0x02010080 + + ) + +94 + #SSL2_CK_RC4_128_EXPORT40_WITH_MD5 + 0x02020080 + + ) + +95 + #SSL2_CK_RC2_128_CBC_WITH_MD5 + 0x02030080 + + ) + +96 + #SSL2_CK_RC2_128_CBC_EXPORT40_WITH_MD5 + 0x02040080 + + ) + +97 + #SSL2_CK_IDEA_128_CBC_WITH_MD5 + 0x02050080 + + ) + +98 + #SSL2_CK_DES_64_CBC_WITH_MD5 + 0x02060040 + + ) + +99 + #SSL2_CK_DES_64_CBC_WITH_SHA + 0x02060140 + + ) + +100 + #SSL2_CK_DES_192_EDE3_CBC_WITH_MD5 + 0x020700c0 + + ) + +101 + #SSL2_CK_DES_192_EDE3_CBC_WITH_SHA + 0x020701c0 + + ) + +102 + #SSL2_CK_RC4_64_WITH_MD5 + 0x02080080 + + ) + +104 + #SSL2_CK_DES_64_CFB64_WITH_MD5_1 + 0x02ff0800 + + ) + +105 + #SSL2_CK_NULL + 0x02ff0810 + + ) + +107 + #SSL2_TXT_DES_64_CFB64_WITH_MD5_1 + "DES-CFB-M1" + + ) + +108 + #SSL2_TXT_NULL_WITH_MD5 + "NULL-MD5" + + ) + +109 + #SSL2_TXT_RC4_128_WITH_MD5 + "RC4-MD5" + + ) + +110 + #SSL2_TXT_RC4_128_EXPORT40_WITH_MD5 + "EXP-RC4-MD5" + + ) + +111 + #SSL2_TXT_RC2_128_CBC_WITH_MD5 + "RC2-CBC-MD5" + + ) + +112 + #SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 + "EXP-RC2-CBC-MD5" + + ) + +113 + #SSL2_TXT_IDEA_128_CBC_WITH_MD5 + "IDEA-CBC-MD5" + + ) + +114 + #SSL2_TXT_DES_64_CBC_WITH_MD5 + "DES-CBC-MD5" + + ) + +115 + #SSL2_TXT_DES_64_CBC_WITH_SHA + "DES-CBC-SHA" + + ) + +116 + #SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5 + "DES-CBC3-MD5" + + ) + +117 + #SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA + "DES-CBC3-SHA" + + ) + +118 + #SSL2_TXT_RC4_64_WITH_MD5 + "RC4-64-MD5" + + ) + +120 + #SSL2_TXT_NULL + "NULL" + + ) + +123 + #SSL2_CF_5_BYTE_ENC + 0x01 + + ) + +124 + #SSL2_CF_8_BYTE_ENC + 0x02 + + ) + +127 + #SSL2_CT_X509_CERTIFICATE + 0x01 + + ) + +130 + #SSL2_AT_MD5_WITH_RSA_ENCRYPTION + 0x01 + + ) + +132 + #SSL2_MAX_SSL_SESSION_ID_LENGTH + 32 + + ) + +135 + #SSL2_MAX_MASTER_KEY_LENGTH_IN_BITS + 256 + + ) + +136 #ifde� +OPENSSL_SYS_MPE + + +137 + #SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER + 29998u + + ) + +139 + #SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER + 32767u + + ) + +141 + #SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER + 16383 + + ) + +143 + #SSL2_CHALLENGE_LENGTH + 16 + + ) + +145 + #SSL2_MIN_CHALLENGE_LENGTH + 16 + + ) + +146 + #SSL2_MAX_CHALLENGE_LENGTH + 32 + + ) + +147 + #SSL2_CONNECTION_ID_LENGTH + 16 + + ) + +148 + #SSL2_MAX_CONNECTION_ID_LENGTH + 16 + + ) + +149 + #SSL2_SSL_SESSION_ID_LENGTH + 16 + + ) + +150 + #SSL2_MAX_CERT_CHALLENGE_LENGTH + 32 + + ) + +151 + #SSL2_MIN_CERT_CHALLENGE_LENGTH + 16 + + ) + +152 + #SSL2_MAX_KEY_MATERIAL_LENGTH + 24 + + ) + +154 #i�de� +HEADER_SSL_LOCL_H + + +155 + #CERT + + + ) + +158 #i�de� +OPENSSL_NO_SSL_INTERN + + +160 + ss�2_��e_� + + +162 +th�e_by�_h�d� +; + +163 +��r_�xt +; + +164 +es�� +; + +165 +s�2_r�lback +; + +169 +wnum +; + +170 +w�nd_t� +; + +171 cڡ * +w�nd_buf +; + +173 +w�nd_off +; + +174 +w�nd_�n +; + +175 +w�nd_�t +; + +178 +rbuf_�� +; + +179 +rbuf_offs +; + +180 * +rbuf +; + +181 * +wbuf +; + +183 * +wr�e_�r +; + +186 +�dd�g +; + +187 +��gth +; + +188 +��_d�a_�ngth +; + +189 +w�ngth +; + +190 +wa�_d�a_�ngth +; + +191 * +��_d�a +; + +192 * +wa�_d�a +; + +193 * +mac_d�a +; + +195 * +�ad_key +; + +196 * +wr�e_key +; + +199 +ch��nge_�ngth +; + +200 +ch��nge +[ +SSL2_MAX_CHALLENGE_LENGTH +]; + +201 +c�n_id_�ngth +; + +202 +c�n_id +[ +SSL2_MAX_CONNECTION_ID_LENGTH +]; + +203 +key_m���l_�ngth +; + +204 +key_m���l +[ +SSL2_MAX_KEY_MATERIAL_LENGTH +*2]; + +206 +�ad_�qu�� +; + +207 +wr�e_�qu�� +; + +210 +c�n_id_�ngth +; + +211 +��_ty� +; + +212 +��_�ngth +; + +213 +c� +; + +214 +��r +; + +215 +�c +; + +216 +c� +[ +SSL2_MAX_CERT_CHALLENGE_LENGTH +]; + +217 +c�h�_�ec_�ngth +; + +218 +�ssi�_id_�ngth +; + +219 +�� +; + +220 +�� +; + +221 } +tmp +; + +222 } + tSSL2_STATE +; + +228 + #SSL2_ST_SEND_CLIENT_HELLO_A + (0x10| +SSL_ST_CONNECT +) + + ) + +229 + #SSL2_ST_SEND_CLIENT_HELLO_B + (0x11| +SSL_ST_CONNECT +) + + ) + +230 + #SSL2_ST_GET_SERVER_HELLO_A + (0x20| +SSL_ST_CONNECT +) + + ) + +231 + #SSL2_ST_GET_SERVER_HELLO_B + (0x21| +SSL_ST_CONNECT +) + + ) + +232 + #SSL2_ST_SEND_CLIENT_MASTER_KEY_A + (0x30| +SSL_ST_CONNECT +) + + ) + +233 + #SSL2_ST_SEND_CLIENT_MASTER_KEY_B + (0x31| +SSL_ST_CONNECT +) + + ) + +234 + #SSL2_ST_SEND_CLIENT_FINISHED_A + (0x40| +SSL_ST_CONNECT +) + + ) + +235 + #SSL2_ST_SEND_CLIENT_FINISHED_B + (0x41| +SSL_ST_CONNECT +) + + ) + +236 + #SSL2_ST_SEND_CLIENT_CERTIFICATE_A + (0x50| +SSL_ST_CONNECT +) + + ) + +237 + #SSL2_ST_SEND_CLIENT_CERTIFICATE_B + (0x51| +SSL_ST_CONNECT +) + + ) + +238 + #SSL2_ST_SEND_CLIENT_CERTIFICATE_C + (0x52| +SSL_ST_CONNECT +) + + ) + +239 + #SSL2_ST_SEND_CLIENT_CERTIFICATE_D + (0x53| +SSL_ST_CONNECT +) + + ) + +240 + #SSL2_ST_GET_SERVER_VERIFY_A + (0x60| +SSL_ST_CONNECT +) + + ) + +241 + #SSL2_ST_GET_SERVER_VERIFY_B + (0x61| +SSL_ST_CONNECT +) + + ) + +242 + #SSL2_ST_GET_SERVER_FINISHED_A + (0x70| +SSL_ST_CONNECT +) + + ) + +243 + #SSL2_ST_GET_SERVER_FINISHED_B + (0x71| +SSL_ST_CONNECT +) + + ) + +244 + #SSL2_ST_CLIENT_START_ENCRYPTION + (0x80| +SSL_ST_CONNECT +) + + ) + +245 + #SSL2_ST_X509_GET_CLIENT_CERTIFICATE + (0x90| +SSL_ST_CONNECT +) + + ) + +247 + #SSL2_ST_GET_CLIENT_HELLO_A + (0x10| +SSL_ST_ACCEPT +) + + ) + +248 + #SSL2_ST_GET_CLIENT_HELLO_B + (0x11| +SSL_ST_ACCEPT +) + + ) + +249 + #SSL2_ST_GET_CLIENT_HELLO_C + (0x12| +SSL_ST_ACCEPT +) + + ) + +250 + #SSL2_ST_SEND_SERVER_HELLO_A + (0x20| +SSL_ST_ACCEPT +) + + ) + +251 + #SSL2_ST_SEND_SERVER_HELLO_B + (0x21| +SSL_ST_ACCEPT +) + + ) + +252 + #SSL2_ST_GET_CLIENT_MASTER_KEY_A + (0x30| +SSL_ST_ACCEPT +) + + ) + +253 + #SSL2_ST_GET_CLIENT_MASTER_KEY_B + (0x31| +SSL_ST_ACCEPT +) + + ) + +254 + #SSL2_ST_SEND_SERVER_VERIFY_A + (0x40| +SSL_ST_ACCEPT +) + + ) + +255 + #SSL2_ST_SEND_SERVER_VERIFY_B + (0x41| +SSL_ST_ACCEPT +) + + ) + +256 + #SSL2_ST_SEND_SERVER_VERIFY_C + (0x42| +SSL_ST_ACCEPT +) + + ) + +257 + #SSL2_ST_GET_CLIENT_FINISHED_A + (0x50| +SSL_ST_ACCEPT +) + + ) + +258 + #SSL2_ST_GET_CLIENT_FINISHED_B + (0x51| +SSL_ST_ACCEPT +) + + ) + +259 + #SSL2_ST_SEND_SERVER_FINISHED_A + (0x60| +SSL_ST_ACCEPT +) + + ) + +260 + #SSL2_ST_SEND_SERVER_FINISHED_B + (0x61| +SSL_ST_ACCEPT +) + + ) + +261 + #SSL2_ST_SEND_REQUEST_CERTIFICATE_A + (0x70| +SSL_ST_ACCEPT +) + + ) + +262 + #SSL2_ST_SEND_REQUEST_CERTIFICATE_B + (0x71| +SSL_ST_ACCEPT +) + + ) + +263 + #SSL2_ST_SEND_REQUEST_CERTIFICATE_C + (0x72| +SSL_ST_ACCEPT +) + + ) + +264 + #SSL2_ST_SEND_REQUEST_CERTIFICATE_D + (0x73| +SSL_ST_ACCEPT +) + + ) + +265 + #SSL2_ST_SERVER_START_ENCRYPTION + (0x80| +SSL_ST_ACCEPT +) + + ) + +266 + #SSL2_ST_X509_GET_SERVER_CERTIFICATE + (0x90| +SSL_ST_ACCEPT +) + + ) + +268 #ifde� +__�lu�lus + + + @/usr/include/openssl/ssl23.h + +59 #i�de� +HEADER_SSL23_H + + +60 + #HEADER_SSL23_H + + + ) + +62 #ifde� +__�lu�lus + + +68 + #SSL23_ST_CW_CLNT_HELLO_A + (0x210| +SSL_ST_CONNECT +) + + ) + +69 + #SSL23_ST_CW_CLNT_HELLO_B + (0x211| +SSL_ST_CONNECT +) + + ) + +71 + #SSL23_ST_CR_SRVR_HELLO_A + (0x220| +SSL_ST_CONNECT +) + + ) + +72 + #SSL23_ST_CR_SRVR_HELLO_B + (0x221| +SSL_ST_CONNECT +) + + ) + +76 + #SSL23_ST_SR_CLNT_HELLO_A + (0x210| +SSL_ST_ACCEPT +) + + ) + +77 + #SSL23_ST_SR_CLNT_HELLO_B + (0x211| +SSL_ST_ACCEPT +) + + ) + +79 #ifde� +__�lu�lus + + + @/usr/include/openssl/ssl3.h + +117 #i�de� +HEADER_SSL3_H + + +118 + #HEADER_SSL3_H + + + ) + +120 #i�de� +OPENSSL_NO_COMP + + +121 + ~<ݒs�/comp.h +> + +123 + ~<ݒs�/buf�r.h +> + +124 + ~<ݒs�/evp.h +> + +125 + ~<ݒs�/s�.h +> + +127 #ifde� +__�lu�lus + + +133 + #SSL3_CK_SCSV + 0x030000FF + + ) + +137 + #SSL3_CK_FALLBACK_SCSV + 0x03005600 + + ) + +139 + #SSL3_CK_RSA_NULL_MD5 + 0x03000001 + + ) + +140 + #SSL3_CK_RSA_NULL_SHA + 0x03000002 + + ) + +141 + #SSL3_CK_RSA_RC4_40_MD5 + 0x03000003 + + ) + +142 + #SSL3_CK_RSA_RC4_128_MD5 + 0x03000004 + + ) + +143 + #SSL3_CK_RSA_RC4_128_SHA + 0x03000005 + + ) + +144 + #SSL3_CK_RSA_RC2_40_MD5 + 0x03000006 + + ) + +145 + #SSL3_CK_RSA_IDEA_128_SHA + 0x03000007 + + ) + +146 + #SSL3_CK_RSA_DES_40_CBC_SHA + 0x03000008 + + ) + +147 + #SSL3_CK_RSA_DES_64_CBC_SHA + 0x03000009 + + ) + +148 + #SSL3_CK_RSA_DES_192_CBC3_SHA + 0x0300000A + + ) + +150 + #SSL3_CK_DH_DSS_DES_40_CBC_SHA + 0x0300000B + + ) + +151 + #SSL3_CK_DH_DSS_DES_64_CBC_SHA + 0x0300000C + + ) + +152 + #SSL3_CK_DH_DSS_DES_192_CBC3_SHA + 0x0300000D + + ) + +153 + #SSL3_CK_DH_RSA_DES_40_CBC_SHA + 0x0300000E + + ) + +154 + #SSL3_CK_DH_RSA_DES_64_CBC_SHA + 0x0300000F + + ) + +155 + #SSL3_CK_DH_RSA_DES_192_CBC3_SHA + 0x03000010 + + ) + +157 + #SSL3_CK_EDH_DSS_DES_40_CBC_SHA + 0x03000011 + + ) + +158 + #SSL3_CK_EDH_DSS_DES_64_CBC_SHA + 0x03000012 + + ) + +159 + #SSL3_CK_EDH_DSS_DES_192_CBC3_SHA + 0x03000013 + + ) + +160 + #SSL3_CK_EDH_RSA_DES_40_CBC_SHA + 0x03000014 + + ) + +161 + #SSL3_CK_EDH_RSA_DES_64_CBC_SHA + 0x03000015 + + ) + +162 + #SSL3_CK_EDH_RSA_DES_192_CBC3_SHA + 0x03000016 + + ) + +164 + #SSL3_CK_ADH_RC4_40_MD5 + 0x03000017 + + ) + +165 + #SSL3_CK_ADH_RC4_128_MD5 + 0x03000018 + + ) + +166 + #SSL3_CK_ADH_DES_40_CBC_SHA + 0x03000019 + + ) + +167 + #SSL3_CK_ADH_DES_64_CBC_SHA + 0x0300001A + + ) + +168 + #SSL3_CK_ADH_DES_192_CBC_SHA + 0x0300001B + + ) + +171 + #SSL3_CK_FZA_DMS_NULL_SHA + 0x0300001C + + ) + +172 + #SSL3_CK_FZA_DMS_FZA_SHA + 0x0300001D + + ) + +176 + #SSL3_CK_FZA_DMS_RC4_SHA + 0x0300001E + + ) + +182 + #SSL3_CK_KRB5_DES_64_CBC_SHA + 0x0300001E + + ) + +183 + #SSL3_CK_KRB5_DES_192_CBC3_SHA + 0x0300001F + + ) + +184 + #SSL3_CK_KRB5_RC4_128_SHA + 0x03000020 + + ) + +185 + #SSL3_CK_KRB5_IDEA_128_CBC_SHA + 0x03000021 + + ) + +186 + #SSL3_CK_KRB5_DES_64_CBC_MD5 + 0x03000022 + + ) + +187 + #SSL3_CK_KRB5_DES_192_CBC3_MD5 + 0x03000023 + + ) + +188 + #SSL3_CK_KRB5_RC4_128_MD5 + 0x03000024 + + ) + +189 + #SSL3_CK_KRB5_IDEA_128_CBC_MD5 + 0x03000025 + + ) + +191 + #SSL3_CK_KRB5_DES_40_CBC_SHA + 0x03000026 + + ) + +192 + #SSL3_CK_KRB5_RC2_40_CBC_SHA + 0x03000027 + + ) + +193 + #SSL3_CK_KRB5_RC4_40_SHA + 0x03000028 + + ) + +194 + #SSL3_CK_KRB5_DES_40_CBC_MD5 + 0x03000029 + + ) + +195 + #SSL3_CK_KRB5_RC2_40_CBC_MD5 + 0x0300002A + + ) + +196 + #SSL3_CK_KRB5_RC4_40_MD5 + 0x0300002B + + ) + +198 + #SSL3_TXT_RSA_NULL_MD5 + "NULL-MD5" + + ) + +199 + #SSL3_TXT_RSA_NULL_SHA + "NULL-SHA" + + ) + +200 + #SSL3_TXT_RSA_RC4_40_MD5 + "EXP-RC4-MD5" + + ) + +201 + #SSL3_TXT_RSA_RC4_128_MD5 + "RC4-MD5" + + ) + +202 + #SSL3_TXT_RSA_RC4_128_SHA + "RC4-SHA" + + ) + +203 + #SSL3_TXT_RSA_RC2_40_MD5 + "EXP-RC2-CBC-MD5" + + ) + +204 + #SSL3_TXT_RSA_IDEA_128_SHA + "IDEA-CBC-SHA" + + ) + +205 + #SSL3_TXT_RSA_DES_40_CBC_SHA + "EXP-DES-CBC-SHA" + + ) + +206 + #SSL3_TXT_RSA_DES_64_CBC_SHA + "DES-CBC-SHA" + + ) + +207 + #SSL3_TXT_RSA_DES_192_CBC3_SHA + "DES-CBC3-SHA" + + ) + +209 + #SSL3_TXT_DH_DSS_DES_40_CBC_SHA + "EXP-DH-DSS-DES-CBC-SHA" + + ) + +210 + #SSL3_TXT_DH_DSS_DES_64_CBC_SHA + "DH-DSS-DES-CBC-SHA" + + ) + +211 + #SSL3_TXT_DH_DSS_DES_192_CBC3_SHA + "DH-DSS-DES-CBC3-SHA" + + ) + +212 + #SSL3_TXT_DH_RSA_DES_40_CBC_SHA + "EXP-DH-RSA-DES-CBC-SHA" + + ) + +213 + #SSL3_TXT_DH_RSA_DES_64_CBC_SHA + "DH-RSA-DES-CBC-SHA" + + ) + +214 + #SSL3_TXT_DH_RSA_DES_192_CBC3_SHA + "DH-RSA-DES-CBC3-SHA" + + ) + +216 + #SSL3_TXT_EDH_DSS_DES_40_CBC_SHA + "EXP-EDH-DSS-DES-CBC-SHA" + + ) + +217 + #SSL3_TXT_EDH_DSS_DES_64_CBC_SHA + "EDH-DSS-DES-CBC-SHA" + + ) + +218 + #SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA + "EDH-DSS-DES-CBC3-SHA" + + ) + +219 + #SSL3_TXT_EDH_RSA_DES_40_CBC_SHA + "EXP-EDH-RSA-DES-CBC-SHA" + + ) + +220 + #SSL3_TXT_EDH_RSA_DES_64_CBC_SHA + "EDH-RSA-DES-CBC-SHA" + + ) + +221 + #SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA + "EDH-RSA-DES-CBC3-SHA" + + ) + +223 + #SSL3_TXT_ADH_RC4_40_MD5 + "EXP-ADH-RC4-MD5" + + ) + +224 + #SSL3_TXT_ADH_RC4_128_MD5 + "ADH-RC4-MD5" + + ) + +225 + #SSL3_TXT_ADH_DES_40_CBC_SHA + "EXP-ADH-DES-CBC-SHA" + + ) + +226 + #SSL3_TXT_ADH_DES_64_CBC_SHA + "ADH-DES-CBC-SHA" + + ) + +227 + #SSL3_TXT_ADH_DES_192_CBC_SHA + "ADH-DES-CBC3-SHA" + + ) + +230 + #SSL3_TXT_FZA_DMS_NULL_SHA + "FZA-NULL-SHA" + + ) + +231 + #SSL3_TXT_FZA_DMS_FZA_SHA + "FZA-FZA-CBC-SHA" + + ) + +232 + #SSL3_TXT_FZA_DMS_RC4_SHA + "FZA-RC4-SHA" + + ) + +235 + #SSL3_TXT_KRB5_DES_64_CBC_SHA + "KRB5-DES-CBC-SHA" + + ) + +236 + #SSL3_TXT_KRB5_DES_192_CBC3_SHA + "KRB5-DES-CBC3-SHA" + + ) + +237 + #SSL3_TXT_KRB5_RC4_128_SHA + "KRB5-RC4-SHA" + + ) + +238 + #SSL3_TXT_KRB5_IDEA_128_CBC_SHA + "KRB5-IDEA-CBC-SHA" + + ) + +239 + #SSL3_TXT_KRB5_DES_64_CBC_MD5 + "KRB5-DES-CBC-MD5" + + ) + +240 + #SSL3_TXT_KRB5_DES_192_CBC3_MD5 + "KRB5-DES-CBC3-MD5" + + ) + +241 + #SSL3_TXT_KRB5_RC4_128_MD5 + "KRB5-RC4-MD5" + + ) + +242 + #SSL3_TXT_KRB5_IDEA_128_CBC_MD5 + "KRB5-IDEA-CBC-MD5" + + ) + +244 + #SSL3_TXT_KRB5_DES_40_CBC_SHA + "EXP-KRB5-DES-CBC-SHA" + + ) + +245 + #SSL3_TXT_KRB5_RC2_40_CBC_SHA + "EXP-KRB5-RC2-CBC-SHA" + + ) + +246 + #SSL3_TXT_KRB5_RC4_40_SHA + "EXP-KRB5-RC4-SHA" + + ) + +247 + #SSL3_TXT_KRB5_DES_40_CBC_MD5 + "EXP-KRB5-DES-CBC-MD5" + + ) + +248 + #SSL3_TXT_KRB5_RC2_40_CBC_MD5 + "EXP-KRB5-RC2-CBC-MD5" + + ) + +249 + #SSL3_TXT_KRB5_RC4_40_MD5 + "EXP-KRB5-RC4-MD5" + + ) + +251 + #SSL3_SSL_SESSION_ID_LENGTH + 32 + + ) + +252 + #SSL3_MAX_SSL_SESSION_ID_LENGTH + 32 + + ) + +254 + #SSL3_MASTER_SECRET_SIZE + 48 + + ) + +255 + #SSL3_RANDOM_SIZE + 32 + + ) + +256 + #SSL3_SESSION_ID_SIZE + 32 + + ) + +257 + #SSL3_RT_HEADER_LENGTH + 5 + + ) + +259 #i�de� +SSL3_ALIGN_PAYLOAD + + +266 + #SSL3_ALIGN_PAYLOAD + 8 + + ) + +268 #i�( +SSL3_ALIGN_PAYLOAD +&(SSL3_ALIGN_PAYLOAD-1))!=0 + +270 #unde� +SSL3_ALIGN_PAYLOAD + + +279 + #SSL3_RT_MAX_MD_SIZE + 64 + + ) + +284 + #SSL_RT_MAX_CIPHER_BLOCK_SIZE + 16 + + ) + +286 + #SSL3_RT_MAX_EXTRA + (16384) + + ) + +289 + #SSL3_RT_MAX_PLAIN_LENGTH + 16384 + + ) + +291 + #SSL3_RT_MAX_COMPRESSED_OVERHEAD + 1024 + + ) + +297 + #SSL3_RT_MAX_ENCRYPTED_OVERHEAD + (256 + +SSL3_RT_MAX_MD_SIZE +) + + ) + +303 + #SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD + \ + +304 ( +SSL_RT_MAX_CIPHER_BLOCK_SIZE + + +SSL3_RT_MAX_MD_SIZE +) + + ) + +308 #ifde� +OPENSSL_NO_COMP + + +309 + #SSL3_RT_MAX_COMPRESSED_LENGTH + +SSL3_RT_MAX_PLAIN_LENGTH + + + ) + +311 + #SSL3_RT_MAX_COMPRESSED_LENGTH + \ + +312 ( +SSL3_RT_MAX_PLAIN_LENGTH ++ +SSL3_RT_MAX_COMPRESSED_OVERHEAD +) + + ) + +314 + #SSL3_RT_MAX_ENCRYPTED_LENGTH + \ + +315 ( +SSL3_RT_MAX_ENCRYPTED_OVERHEAD ++ +SSL3_RT_MAX_COMPRESSED_LENGTH +) + + ) + +316 + #SSL3_RT_MAX_PACKET_SIZE + \ + +317 ( +SSL3_RT_MAX_ENCRYPTED_LENGTH ++ +SSL3_RT_HEADER_LENGTH +) + + ) + +319 + #SSL3_MD_CLIENT_FINISHED_CONST + "\x43\x4C\x4E\x54" + + ) + +320 + #SSL3_MD_SERVER_FINISHED_CONST + "\x53\x52\x56\x52" + + ) + +322 + #SSL3_VERSION + 0x0300 + + ) + +323 + #SSL3_VERSION_MAJOR + 0x03 + + ) + +324 + #SSL3_VERSION_MINOR + 0x00 + + ) + +326 + #SSL3_RT_CHANGE_CIPHER_SPEC + 20 + + ) + +327 + #SSL3_RT_ALERT + 21 + + ) + +328 + #SSL3_RT_HANDSHAKE + 22 + + ) + +329 + #SSL3_RT_APPLICATION_DATA + 23 + + ) + +330 + #TLS1_RT_HEARTBEAT + 24 + + ) + +332 + #SSL3_AL_WARNING + 1 + + ) + +333 + #SSL3_AL_FATAL + 2 + + ) + +335 + #SSL3_AD_CLOSE_NOTIFY + 0 + + ) + +336 + #SSL3_AD_UNEXPECTED_MESSAGE + 10 + + ) + +337 + #SSL3_AD_BAD_RECORD_MAC + 20 + + ) + +338 + #SSL3_AD_DECOMPRESSION_FAILURE + 30 + + ) + +339 + #SSL3_AD_HANDSHAKE_FAILURE + 40 + + ) + +340 + #SSL3_AD_NO_CERTIFICATE + 41 + + ) + +341 + #SSL3_AD_BAD_CERTIFICATE + 42 + + ) + +342 + #SSL3_AD_UNSUPPORTED_CERTIFICATE + 43 + + ) + +343 + #SSL3_AD_CERTIFICATE_REVOKED + 44 + + ) + +344 + #SSL3_AD_CERTIFICATE_EXPIRED + 45 + + ) + +345 + #SSL3_AD_CERTIFICATE_UNKNOWN + 46 + + ) + +346 + #SSL3_AD_ILLEGAL_PARAMETER + 47 + + ) + +348 + #TLS1_HB_REQUEST + 1 + + ) + +349 + #TLS1_HB_RESPONSE + 2 + + ) + +351 #i�de� +OPENSSL_NO_SSL_INTERN + + +353 + ss�3_�c�d_� + + +355 +ty� +; + +356 +�ngth +; + +357 +off +; + +358 * +d�a +; + +359 * +�put +; + +360 * +comp +; + +361 +�och +; + +362 +�q_num +[8]; + +363 } + tSSL3_RECORD +; + +365 + ss�3_buf�r_� + + +367 * +buf +; + +369 +size_t + +�n +; + +370 +off�t +; + +371 +�� +; + +372 } + tSSL3_BUFFER +; + +376 + #SSL3_CT_RSA_SIGN + 1 + + ) + +377 + #SSL3_CT_DSS_SIGN + 2 + + ) + +378 + #SSL3_CT_RSA_FIXED_DH + 3 + + ) + +379 + #SSL3_CT_DSS_FIXED_DH + 4 + + ) + +380 + #SSL3_CT_RSA_EPHEMERAL_DH + 5 + + ) + +381 + #SSL3_CT_DSS_EPHEMERAL_DH + 6 + + ) + +382 + #SSL3_CT_FORTEZZA_DMS + 20 + + ) + +387 + #SSL3_CT_NUMBER + 9 + + ) + +390 + #SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS + 0x0001 + + ) + +391 + #SSL3_FLAGS_DELAY_CLIENT_FINISHED + 0x0002 + + ) + +392 + #SSL3_FLAGS_POP_BUFFER + 0x0004 + + ) + +393 + #TLS1_FLAGS_TLS_PADDING_BUG + 0x0008 + + ) + +394 + #TLS1_FLAGS_SKIP_CERT_VERIFY + 0x0010 + + ) + +395 + #TLS1_FLAGS_KEEP_HANDSHAKE + 0x0020 + + ) + +396 + #SSL3_FLAGS_CCS_OK + 0x0080 + + ) + +407 + #SSL3_FLAGS_SGC_RESTART_DONE + 0x0040 + + ) + +409 #i�de� +OPENSSL_NO_SSL_INTERN + + +411 + ss�3_��e_� + + +413 +�ags +; + +414 +d�ay_buf_p�_�t +; + +416 +�ad_�qu�� +[8]; + +417 +�ad_mac_���_size +; + +418 +�ad_mac_��� +[ +EVP_MAX_MD_SIZE +]; + +419 +wr�e_�qu�� +[8]; + +420 +wr�e_mac_���_size +; + +421 +wr�e_mac_��� +[ +EVP_MAX_MD_SIZE +]; + +423 +�rv�_�ndom +[ +SSL3_RANDOM_SIZE +]; + +424 +���_�ndom +[ +SSL3_RANDOM_SIZE +]; + +427 +�ed_em�y_�agm�ts +; + +428 +em�y_�agm�t_d�e +; + +431 +��_ex�a +; + +433 +SSL3_BUFFER + +rbuf +; + +434 +SSL3_BUFFER + +wbuf +; + +436 +SSL3_RECORD + +�ec +; + +437 +SSL3_RECORD + +w�c +; + +441 +��t_�agm�t +[2]; + +442 +��t_�agm�t_�n +; + +443 +h�dshake_�agm�t +[4]; + +444 +h�dshake_�agm�t_�n +; + +447 +wnum +; + +448 +w�nd_t� +; + +449 +w�nd_ty� +; + +450 +w�nd_�t +; + +451 cڡ * +w�nd_buf +; + +454 +BIO + * +h�dshake_buf�r +; + +458 +EVP_MD_CTX + ** +h�dshake_dg� +; + +461 +ch�ge_c�h�_�ec +; + +463 +w�n_��t +; + +464 +�l_��t +; + +467 +��t_di��ch +; + +468 +�nd_��t +[2]; + +472 +��gٟ� +; + +473 +tٮ_��gٟti�s +; + +474 +num_��gٟti�s +; + +476 +�_�ad_�p_d�a +; + +481 * +���_�aque_�f_�put +; + +482 +size_t + +���_�aque_�f_�put_�n +; + +483 * +�rv�_�aque_�f_�put +; + +484 +size_t + +�rv�_�aque_�f_�put_�n +; + +488 +��_v�ify_md +[ +EVP_MAX_MD_SIZE +*2]; + +491 +f�ish_md +[ +EVP_MAX_MD_SIZE +*2]; + +492 +f�ish_md_�n +; + +493 +��_f�ish_md +[ +EVP_MAX_MD_SIZE +*2]; + +494 +��_f�ish_md_�n +; + +496 +mes�ge_size +; + +497 +mes�ge_ty� +; + +500 cڡ +SSL_CIPHER + * +�w_c�h� +; + +501 #i�de� +OPENSSL_NO_DH + + +502 +DH + * +dh +; + +505 #i�de� +OPENSSL_NO_ECDH + + +506 +EC_KEY + * +ecdh +; + +510 +�xt_��e +; + +512 +�u�_mes�ge +; + +515 +��_�q +; + +516 +�y�_num +; + +517 +�y� +[ +SSL3_CT_NUMBER +]; + +518 +STACK_OF +( +X509_NAME +�* +�_�mes +; + +520 +u�_r�_tmp +; + +522 +key_block_�ngth +; + +523 * +key_block +; + +525 cڡ +EVP_CIPHER + * +�w_sym_�c +; + +526 cڡ +EVP_MD + * +�w_hash +; + +527 +�w_mac_pkey_ty� +; + +528 +�w_mac_���_size +; + +529 #i�de� +OPENSSL_NO_COMP + + +530 cڡ +SSL_COMP + * +�w_com�essi� +; + +532 * +�w_com�essi� +; + +534 +��_�que� +; + +535 } +tmp +; + +538 +�evious_���_f�ished +[ +EVP_MAX_MD_SIZE +]; + +539 +�evious_���_f�ished_�n +; + +540 +�evious_�rv�_f�ished +[ +EVP_MAX_MD_SIZE +]; + +541 +�evious_�rv�_f�ished_�n +; + +542 +�nd_c���i�_b�d�g +; + +544 #i�de� +OPENSSL_NO_NEXTPROTONEG + + +546 +�xt_��o_�g_�� +; + +549 #i�de� +OPENSSL_NO_TLSEXT + + +550 #i�de� +OPENSSL_NO_EC + + +554 +is_�obably_��ri +; + +557 } + tSSL3_STATE +; + +564 + #SSL3_ST_CW_FLUSH + (0x100| +SSL_ST_CONNECT +) + + ) + +565 #i�de� +OPENSSL_NO_SCTP + + +566 + #DTLS1_SCTP_ST_CW_WRITE_SOCK + (0x310| +SSL_ST_CONNECT +) + + ) + +567 + #DTLS1_SCTP_ST_CR_READ_SOCK + (0x320| +SSL_ST_CONNECT +) + + ) + +570 + #SSL3_ST_CW_CLNT_HELLO_A + (0x110| +SSL_ST_CONNECT +) + + ) + +571 + #SSL3_ST_CW_CLNT_HELLO_B + (0x111| +SSL_ST_CONNECT +) + + ) + +573 + #SSL3_ST_CR_SRVR_HELLO_A + (0x120| +SSL_ST_CONNECT +) + + ) + +574 + #SSL3_ST_CR_SRVR_HELLO_B + (0x121| +SSL_ST_CONNECT +) + + ) + +575 + #DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A + (0x126| +SSL_ST_CONNECT +) + + ) + +576 + #DTLS1_ST_CR_HELLO_VERIFY_REQUEST_B + (0x127| +SSL_ST_CONNECT +) + + ) + +577 + #SSL3_ST_CR_CERT_A + (0x130| +SSL_ST_CONNECT +) + + ) + +578 + #SSL3_ST_CR_CERT_B + (0x131| +SSL_ST_CONNECT +) + + ) + +579 + #SSL3_ST_CR_KEY_EXCH_A + (0x140| +SSL_ST_CONNECT +) + + ) + +580 + #SSL3_ST_CR_KEY_EXCH_B + (0x141| +SSL_ST_CONNECT +) + + ) + +581 + #SSL3_ST_CR_CERT_REQ_A + (0x150| +SSL_ST_CONNECT +) + + ) + +582 + #SSL3_ST_CR_CERT_REQ_B + (0x151| +SSL_ST_CONNECT +) + + ) + +583 + #SSL3_ST_CR_SRVR_DONE_A + (0x160| +SSL_ST_CONNECT +) + + ) + +584 + #SSL3_ST_CR_SRVR_DONE_B + (0x161| +SSL_ST_CONNECT +) + + ) + +586 + #SSL3_ST_CW_CERT_A + (0x170| +SSL_ST_CONNECT +) + + ) + +587 + #SSL3_ST_CW_CERT_B + (0x171| +SSL_ST_CONNECT +) + + ) + +588 + #SSL3_ST_CW_CERT_C + (0x172| +SSL_ST_CONNECT +) + + ) + +589 + #SSL3_ST_CW_CERT_D + (0x173| +SSL_ST_CONNECT +) + + ) + +590 + #SSL3_ST_CW_KEY_EXCH_A + (0x180| +SSL_ST_CONNECT +) + + ) + +591 + #SSL3_ST_CW_KEY_EXCH_B + (0x181| +SSL_ST_CONNECT +) + + ) + +592 + #SSL3_ST_CW_CERT_VRFY_A + (0x190| +SSL_ST_CONNECT +) + + ) + +593 + #SSL3_ST_CW_CERT_VRFY_B + (0x191| +SSL_ST_CONNECT +) + + ) + +594 + #SSL3_ST_CW_CHANGE_A + (0x1A0| +SSL_ST_CONNECT +) + + ) + +595 + #SSL3_ST_CW_CHANGE_B + (0x1A1| +SSL_ST_CONNECT +) + + ) + +596 #i�de� +OPENSSL_NO_NEXTPROTONEG + + +597 + #SSL3_ST_CW_NEXT_PROTO_A + (0x200| +SSL_ST_CONNECT +) + + ) + +598 + #SSL3_ST_CW_NEXT_PROTO_B + (0x201| +SSL_ST_CONNECT +) + + ) + +600 + #SSL3_ST_CW_FINISHED_A + (0x1B0| +SSL_ST_CONNECT +) + + ) + +601 + #SSL3_ST_CW_FINISHED_B + (0x1B1| +SSL_ST_CONNECT +) + + ) + +603 + #SSL3_ST_CR_CHANGE_A + (0x1C0| +SSL_ST_CONNECT +) + + ) + +604 + #SSL3_ST_CR_CHANGE_B + (0x1C1| +SSL_ST_CONNECT +) + + ) + +605 + #SSL3_ST_CR_FINISHED_A + (0x1D0| +SSL_ST_CONNECT +) + + ) + +606 + #SSL3_ST_CR_FINISHED_B + (0x1D1| +SSL_ST_CONNECT +) + + ) + +607 + #SSL3_ST_CR_SESSION_TICKET_A + (0x1E0| +SSL_ST_CONNECT +) + + ) + +608 + #SSL3_ST_CR_SESSION_TICKET_B + (0x1E1| +SSL_ST_CONNECT +) + + ) + +609 + #SSL3_ST_CR_CERT_STATUS_A + (0x1F0| +SSL_ST_CONNECT +) + + ) + +610 + #SSL3_ST_CR_CERT_STATUS_B + (0x1F1| +SSL_ST_CONNECT +) + + ) + +614 + #SSL3_ST_SW_FLUSH + (0x100| +SSL_ST_ACCEPT +) + + ) + +615 #i�de� +OPENSSL_NO_SCTP + + +616 + #DTLS1_SCTP_ST_SW_WRITE_SOCK + (0x310| +SSL_ST_ACCEPT +) + + ) + +617 + #DTLS1_SCTP_ST_SR_READ_SOCK + (0x320| +SSL_ST_ACCEPT +) + + ) + +621 + #SSL3_ST_SR_CLNT_HELLO_A + (0x110| +SSL_ST_ACCEPT +) + + ) + +622 + #SSL3_ST_SR_CLNT_HELLO_B + (0x111| +SSL_ST_ACCEPT +) + + ) + +623 + #SSL3_ST_SR_CLNT_HELLO_C + (0x112| +SSL_ST_ACCEPT +) + + ) + +625 + #DTLS1_ST_SW_HELLO_VERIFY_REQUEST_A + (0x113| +SSL_ST_ACCEPT +) + + ) + +626 + #DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B + (0x114| +SSL_ST_ACCEPT +) + + ) + +627 + #SSL3_ST_SW_HELLO_REQ_A + (0x120| +SSL_ST_ACCEPT +) + + ) + +628 + #SSL3_ST_SW_HELLO_REQ_B + (0x121| +SSL_ST_ACCEPT +) + + ) + +629 + #SSL3_ST_SW_HELLO_REQ_C + (0x122| +SSL_ST_ACCEPT +) + + ) + +630 + #SSL3_ST_SW_SRVR_HELLO_A + (0x130| +SSL_ST_ACCEPT +) + + ) + +631 + #SSL3_ST_SW_SRVR_HELLO_B + (0x131| +SSL_ST_ACCEPT +) + + ) + +632 + #SSL3_ST_SW_CERT_A + (0x140| +SSL_ST_ACCEPT +) + + ) + +633 + #SSL3_ST_SW_CERT_B + (0x141| +SSL_ST_ACCEPT +) + + ) + +634 + #SSL3_ST_SW_KEY_EXCH_A + (0x150| +SSL_ST_ACCEPT +) + + ) + +635 + #SSL3_ST_SW_KEY_EXCH_B + (0x151| +SSL_ST_ACCEPT +) + + ) + +636 + #SSL3_ST_SW_CERT_REQ_A + (0x160| +SSL_ST_ACCEPT +) + + ) + +637 + #SSL3_ST_SW_CERT_REQ_B + (0x161| +SSL_ST_ACCEPT +) + + ) + +638 + #SSL3_ST_SW_SRVR_DONE_A + (0x170| +SSL_ST_ACCEPT +) + + ) + +639 + #SSL3_ST_SW_SRVR_DONE_B + (0x171| +SSL_ST_ACCEPT +) + + ) + +641 + #SSL3_ST_SR_CERT_A + (0x180| +SSL_ST_ACCEPT +) + + ) + +642 + #SSL3_ST_SR_CERT_B + (0x181| +SSL_ST_ACCEPT +) + + ) + +643 + #SSL3_ST_SR_KEY_EXCH_A + (0x190| +SSL_ST_ACCEPT +) + + ) + +644 + #SSL3_ST_SR_KEY_EXCH_B + (0x191| +SSL_ST_ACCEPT +) + + ) + +645 + #SSL3_ST_SR_CERT_VRFY_A + (0x1A0| +SSL_ST_ACCEPT +) + + ) + +646 + #SSL3_ST_SR_CERT_VRFY_B + (0x1A1| +SSL_ST_ACCEPT +) + + ) + +647 + #SSL3_ST_SR_CHANGE_A + (0x1B0| +SSL_ST_ACCEPT +) + + ) + +648 + #SSL3_ST_SR_CHANGE_B + (0x1B1| +SSL_ST_ACCEPT +) + + ) + +649 #i�de� +OPENSSL_NO_NEXTPROTONEG + + +650 + #SSL3_ST_SR_NEXT_PROTO_A + (0x210| +SSL_ST_ACCEPT +) + + ) + +651 + #SSL3_ST_SR_NEXT_PROTO_B + (0x211| +SSL_ST_ACCEPT +) + + ) + +653 + #SSL3_ST_SR_FINISHED_A + (0x1C0| +SSL_ST_ACCEPT +) + + ) + +654 + #SSL3_ST_SR_FINISHED_B + (0x1C1| +SSL_ST_ACCEPT +) + + ) + +656 + #SSL3_ST_SW_CHANGE_A + (0x1D0| +SSL_ST_ACCEPT +) + + ) + +657 + #SSL3_ST_SW_CHANGE_B + (0x1D1| +SSL_ST_ACCEPT +) + + ) + +658 + #SSL3_ST_SW_FINISHED_A + (0x1E0| +SSL_ST_ACCEPT +) + + ) + +659 + #SSL3_ST_SW_FINISHED_B + (0x1E1| +SSL_ST_ACCEPT +) + + ) + +660 + #SSL3_ST_SW_SESSION_TICKET_A + (0x1F0| +SSL_ST_ACCEPT +) + + ) + +661 + #SSL3_ST_SW_SESSION_TICKET_B + (0x1F1| +SSL_ST_ACCEPT +) + + ) + +662 + #SSL3_ST_SW_CERT_STATUS_A + (0x200| +SSL_ST_ACCEPT +) + + ) + +663 + #SSL3_ST_SW_CERT_STATUS_B + (0x201| +SSL_ST_ACCEPT +) + + ) + +665 + #SSL3_MT_HELLO_REQUEST + 0 + + ) + +666 + #SSL3_MT_CLIENT_HELLO + 1 + + ) + +667 + #SSL3_MT_SERVER_HELLO + 2 + + ) + +668 + #SSL3_MT_NEWSESSION_TICKET + 4 + + ) + +669 + #SSL3_MT_CERTIFICATE + 11 + + ) + +670 + #SSL3_MT_SERVER_KEY_EXCHANGE + 12 + + ) + +671 + #SSL3_MT_CERTIFICATE_REQUEST + 13 + + ) + +672 + #SSL3_MT_SERVER_DONE + 14 + + ) + +673 + #SSL3_MT_CERTIFICATE_VERIFY + 15 + + ) + +674 + #SSL3_MT_CLIENT_KEY_EXCHANGE + 16 + + ) + +675 + #SSL3_MT_FINISHED + 20 + + ) + +676 + #SSL3_MT_CERTIFICATE_STATUS + 22 + + ) + +677 #i�de� +OPENSSL_NO_NEXTPROTONEG + + +678 + #SSL3_MT_NEXT_PROTO + 67 + + ) + +680 + #DTLS1_MT_HELLO_VERIFY_REQUEST + 3 + + ) + +683 + #SSL3_MT_CCS + 1 + + ) + +686 + #SSL3_CC_READ + 0x01 + + ) + +687 + #SSL3_CC_WRITE + 0x02 + + ) + +688 + #SSL3_CC_CLIENT + 0x10 + + ) + +689 + #SSL3_CC_SERVER + 0x20 + + ) + +690 + #SSL3_CHANGE_CIPHER_CLIENT_WRITE + ( +SSL3_CC_CLIENT +| +SSL3_CC_WRITE +) + + ) + +691 + #SSL3_CHANGE_CIPHER_SERVER_READ + ( +SSL3_CC_SERVER +| +SSL3_CC_READ +) + + ) + +692 + #SSL3_CHANGE_CIPHER_CLIENT_READ + ( +SSL3_CC_CLIENT +| +SSL3_CC_READ +) + + ) + +693 + #SSL3_CHANGE_CIPHER_SERVER_WRITE + ( +SSL3_CC_SERVER +| +SSL3_CC_WRITE +) + + ) + +695 #ifde� +__�lu�lus + + + @/usr/include/openssl/stack.h + +59 #i�de� +HEADER_STACK_H + + +60 + #HEADER_STACK_H + + + ) + +62 #ifde� +__�lu�lus + + +66 + s�ack_� + + +68 +num +; + +69 ** +d�a +; + +70 +s܋d +; + +72 +num_�loc +; + +73 (* +comp +)(const *, const *); + +74 } + t_STACK +; + +76 + #M_sk_num +( +sk +�((sk�? (sk)-> +num +:-1) + + ) + +77 + #M_sk_v�ue +( +sk +, +n +�((sk�? (sk)-> +d�a +[n] : +NULL +) + + ) + +79 +sk_num +(cڡ +_STACK + *); + +80 * +sk_v�ue +(cڡ +_STACK + *, ); + +82 * +sk_�t +( +_STACK + *, , *); + +84 +_STACK + * +sk_�w +((* +cmp +)(const *, const *)); + +85 +_STACK + * +sk_�w_nu� +(); + +86 +sk_� +( +_STACK + *); + +87 +sk_p�_� +( +_STACK + * +� +, (* +func +)(*)); + +88 +sk_��� +( +_STACK + * +sk +, * +d�a +, +wh�e +); + +89 * +sk_d��e +( +_STACK + * +� +, +loc +); + +90 * +sk_d��e_�r +( +_STACK + * +� +, * +p +); + +91 +sk_f�d +( +_STACK + * +� +, * +d�a +); + +92 +sk_f�d_ex +( +_STACK + * +� +, * +d�a +); + +93 +sk_push +( +_STACK + * +� +, * +d�a +); + +94 +sk_unshi� +( +_STACK + * +� +, * +d�a +); + +95 * +sk_shi� +( +_STACK + * +� +); + +96 * +sk_p� +( +_STACK + * +� +); + +97 +sk_z�o +( +_STACK + * +� +); + +98 (* +sk_�t_cmp_func +( +_STACK + * +sk +, (* +c +)(const *, const *))) + +100 +_STACK + * +sk_dup +(_STACK * +� +); + +101 +sk_s�t +( +_STACK + * +� +); + +102 +sk_is_s܋d +(cڡ +_STACK + * +� +); + +104 #ifde� +__�lu�lus + + + @/usr/include/openssl/symhacks.h + +55 #i�de� +HEADER_SYMHACKS_H + + +56 + #HEADER_SYMHACKS_H + + + ) + +58 + ~<ݒs�/e_os2.h +> + +68 #ifde� +OPENSSL_SYS_VMS + + +71 #unde� +CRYPTO_g�_ex_d�a_im�em��ti� + + +72 + #CRYPTO_g�_ex_d�a_im�em��ti� + +CRYPTO_g�_ex_d�a_im� + + + ) + +73 #unde� +CRYPTO_�t_ex_d�a_im�em��ti� + + +74 + #CRYPTO_�t_ex_d�a_im�em��ti� + +CRYPTO_�t_ex_d�a_im� + + + ) + +77 #unde� +ASN1_STRING_�t_de�u�_mask_asc + + +78 + #ASN1_STRING_�t_de�u�_mask_asc + +ASN1_STRING_�t_def_mask_asc + + + ) + +82 #unde� +i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO + + +83 + #i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO + +i2d_ASN1_SET_OF_PKCS7_SIGINF + + + ) + +84 #unde� +d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO + + +85 + #d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO + +d2i_ASN1_SET_OF_PKCS7_SIGINF + + + ) + +90 #unde� +i2d_ASN1_SET_OF_PKCS7_RECIP_INFO + + +91 + #i2d_ASN1_SET_OF_PKCS7_RECIP_INFO + +i2d_ASN1_SET_OF_PKCS7_RECINF + + + ) + +92 #unde� +d2i_ASN1_SET_OF_PKCS7_RECIP_INFO + + +93 + #d2i_ASN1_SET_OF_PKCS7_RECIP_INFO + +d2i_ASN1_SET_OF_PKCS7_RECINF + + + ) + +98 #unde� +i2d_ASN1_SET_OF_ACCESS_DESCRIPTION + + +99 + #i2d_ASN1_SET_OF_ACCESS_DESCRIPTION + +i2d_ASN1_SET_OF_ACC_DESC + + + ) + +100 #unde� +d2i_ASN1_SET_OF_ACCESS_DESCRIPTION + + +101 + #d2i_ASN1_SET_OF_ACCESS_DESCRIPTION + +d2i_ASN1_SET_OF_ACC_DESC + + + ) + +105 #unde� +PEM_�ad_NETSCAPE_CERT_SEQUENCE + + +106 + #PEM_�ad_NETSCAPE_CERT_SEQUENCE + +PEM_�ad_NS_CERT_SEQ + + + ) + +107 #unde� +PEM_wr�e_NETSCAPE_CERT_SEQUENCE + + +108 + #PEM_wr�e_NETSCAPE_CERT_SEQUENCE + +PEM_wr�e_NS_CERT_SEQ + + + ) + +109 #unde� +PEM_�ad_bio_NETSCAPE_CERT_SEQUENCE + + +110 + #PEM_�ad_bio_NETSCAPE_CERT_SEQUENCE + +PEM_�ad_bio_NS_CERT_SEQ + + + ) + +111 #unde� +PEM_wr�e_bio_NETSCAPE_CERT_SEQUENCE + + +112 + #PEM_wr�e_bio_NETSCAPE_CERT_SEQUENCE + +PEM_wr�e_bio_NS_CERT_SEQ + + + ) + +113 #unde� +PEM_wr�e_cb_bio_NETSCAPE_CERT_SEQUENCE + + +114 + #PEM_wr�e_cb_bio_NETSCAPE_CERT_SEQUENCE + +PEM_wr�e_cb_bio_NS_CERT_SEQ + + + ) + +117 #unde� +PEM_�ad_PKCS8_PRIV_KEY_INFO + + +118 + #PEM_�ad_PKCS8_PRIV_KEY_INFO + +PEM_�ad_P8_PRIV_KEY_INFO + + + ) + +119 #unde� +PEM_wr�e_PKCS8_PRIV_KEY_INFO + + +120 + #PEM_wr�e_PKCS8_PRIV_KEY_INFO + +PEM_wr�e_P8_PRIV_KEY_INFO + + + ) + +121 #unde� +PEM_�ad_bio_PKCS8_PRIV_KEY_INFO + + +122 + #PEM_�ad_bio_PKCS8_PRIV_KEY_INFO + +PEM_�ad_bio_P8_PRIV_KEY_INFO + + + ) + +123 #unde� +PEM_wr�e_bio_PKCS8_PRIV_KEY_INFO + + +124 + #PEM_wr�e_bio_PKCS8_PRIV_KEY_INFO + +PEM_wr�e_bio_P8_PRIV_KEY_INFO + + + ) + +125 #unde� +PEM_wr�e_cb_bio_PKCS8_PRIV_KEY_INFO + + +126 + #PEM_wr�e_cb_bio_PKCS8_PRIV_KEY_INFO + +PEM_w�_cb_bio_P8_PRIV_KEY_INFO + + + ) + +129 #unde� +PEM_wr�e_bio_PKCS8Priv�eKey_nid + + +130 + #PEM_wr�e_bio_PKCS8Priv�eKey_nid + +PEM_wr�e_bio_PKCS8PrivKey_nid + + + ) + +133 #unde� +X509_REVOKED_g�_ext_by_��i�l + + +134 + #X509_REVOKED_g�_ext_by_��i�l + +X509_REVOKED_g�_ext_by_��ic + + + ) + +135 #unde� +X509_p�icy_��_g�0_u�r_p�ic�s + + +136 + #X509_p�icy_��_g�0_u�r_p�ic�s + +X509_pcy_��_g�0_u�_p�ic�s + + + ) + +137 #unde� +X509_p�icy_node_g�0_qu�if�rs + + +138 + #X509_p�icy_node_g�0_qu�if�rs + +X509_pcy_node_g�0_qu�if�rs + + + ) + +139 #unde� +X509_STORE_CTX_g�_ex�ic�_p�icy + + +140 + #X509_STORE_CTX_g�_ex�ic�_p�icy + +X509_STORE_CTX_g�_ex�_p�icy + + + ) + +141 #unde� +X509_STORE_CTX_g�0_cu��t_issu� + + +142 + #X509_STORE_CTX_g�0_cu��t_issu� + +X509_STORE_CTX_g�0_cur_issu� + + + ) + +145 #unde� +CRYPTO_�t_dy�ock_de�roy_��back + + +146 + #CRYPTO_�t_dy�ock_de�roy_��back + +CRYPTO_�t_dy�ock_de�roy_cb + + + ) + +147 #unde� +CRYPTO_�t_dy�ock_���_��back + + +148 + #CRYPTO_�t_dy�ock_���_��back + +CRYPTO_�t_dy�ock_���_cb + + + ) + +149 #unde� +CRYPTO_�t_dy�ock_lock_��back + + +150 + #CRYPTO_�t_dy�ock_lock_��back + +CRYPTO_�t_dy�ock_lock_cb + + + ) + +151 #unde� +CRYPTO_g�_dy�ock_lock_��back + + +152 + #CRYPTO_g�_dy�ock_lock_��back + +CRYPTO_g�_dy�ock_lock_cb + + + ) + +153 #unde� +CRYPTO_g�_dy�ock_de�roy_��back + + +154 + #CRYPTO_g�_dy�ock_de�roy_��back + +CRYPTO_g�_dy�ock_de�roy_cb + + + ) + +155 #unde� +CRYPTO_g�_dy�ock_���_��back + + +156 + #CRYPTO_g�_dy�ock_���_��back + +CRYPTO_g�_dy�ock_���_cb + + + ) + +157 #unde� +CRYPTO_�t_locked_mem_ex_fun�i�s + + +158 + #CRYPTO_�t_locked_mem_ex_fun�i�s + +CRYPTO_�t_locked_mem_ex_funcs + + + ) + +159 #unde� +CRYPTO_g�_locked_mem_ex_fun�i�s + + +160 + #CRYPTO_g�_locked_mem_ex_fun�i�s + +CRYPTO_g�_locked_mem_ex_funcs + + + ) + +163 #unde� +SSL_CTX_�t_de�u�_v�ify_�ths + + +164 + #SSL_CTX_�t_de�u�_v�ify_�ths + +SSL_CTX_�t_def_v�ify_�ths + + + ) + +165 #unde� +SSL_g�_ex_d�a_X509_STORE_CTX_idx + + +166 + #SSL_g�_ex_d�a_X509_STORE_CTX_idx + +SSL_g�_ex_d_X509_STORE_CTX_idx + + + ) + +167 #unde� +SSL_add_f�e_��_subje�s_to_�ack + + +168 + #SSL_add_f�e_��_subje�s_to_�ack + +SSL_add_f�e_��_subjs_to_�k + + + ) + +169 #unde� +SSL_add_d�_��_subje�s_to_�ack + + +170 + #SSL_add_d�_��_subje�s_to_�ack + +SSL_add_d�_��_subjs_to_�k + + + ) + +171 #unde� +SSL_CTX_u�_��ifi��_cha�_f�e + + +172 + #SSL_CTX_u�_��ifi��_cha�_f�e + +SSL_CTX_u�_��_cha�_f�e + + + ) + +173 #unde� +SSL_CTX_�t_��_v�ify_��back + + +174 + #SSL_CTX_�t_��_v�ify_��back + +SSL_CTX_�t_��_v�ify_cb + + + ) + +175 #unde� +SSL_CTX_�t_de�u�_�sswd_cb_u�rd�a + + +176 + #SSL_CTX_�t_de�u�_�sswd_cb_u�rd�a + +SSL_CTX_�t_def_�sswd_cb_ud + + + ) + +177 #unde� +SSL_COMP_g�_com�essi�_m�hods + + +178 + #SSL_COMP_g�_com�essi�_m�hods + +SSL_COMP_g�_com�ess_m�hods + + + ) + +179 #unde� +s�_add_���h�lo_��gٟ�_ext + + +180 + #s�_add_���h�lo_��gٟ�_ext + +s�_add_���h�lo_��g_ext + + + ) + +181 #unde� +s�_add_�rv�h�lo_��gٟ�_ext + + +182 + #s�_add_�rv�h�lo_��gٟ�_ext + +s�_add_�rv�h�lo_��g_ext + + + ) + +183 #unde� +s�_�r�_���h�lo_��gٟ�_ext + + +184 + #s�_�r�_���h�lo_��gٟ�_ext + +s�_�r�_���h�lo_��g_ext + + + ) + +185 #unde� +s�_�r�_�rv�h�lo_��gٟ�_ext + + +186 + #s�_�r�_�rv�h�lo_��gٟ�_ext + +s�_�r�_�rv�h�lo_��g_ext + + + ) + +187 #unde� +SSL_�p_�rv�_��m_w�h_u��ame + + +188 + #SSL_�p_�rv�_��m_w�h_u��ame + +SSL_�p_�rv�_��m_w�h_un + + + ) + +189 #unde� +SSL_CTX_�t_�p_���_pwd_��back + + +190 + #SSL_CTX_�t_�p_���_pwd_��back + +SSL_CTX_�t_�p_���_pwd_cb + + + ) + +191 #unde� +SSL_CTX_�t_�p_v�ify_��m_��back + + +192 + #SSL_CTX_�t_�p_v�ify_��m_��back + +SSL_CTX_�t_�p_vfy_��m_cb + + + ) + +193 #unde� +SSL_CTX_�t_�p_u��ame_��back + + +194 + #SSL_CTX_�t_�p_u��ame_��back + +SSL_CTX_�t_�p_un_cb + + + ) + +195 #unde� +s�_add_���h�lo_u�_��_ext + + +196 + #s�_add_���h�lo_u�_��_ext + +s�_add_�ih�lo_u�_��_ext + + + ) + +197 #unde� +s�_add_�rv�h�lo_u�_��_ext + + +198 + #s�_add_�rv�h�lo_u�_��_ext + +s�_add_�rh�lo_u�_��_ext + + + ) + +199 #unde� +s�_�r�_���h�lo_u�_��_ext + + +200 + #s�_�r�_���h�lo_u�_��_ext + +s�_�r�_�ih�lo_u�_��_ext + + + ) + +201 #unde� +s�_�r�_�rv�h�lo_u�_��_ext + + +202 + #s�_�r�_�rv�h�lo_u�_��_ext + +s�_�r�_�rh�lo_u�_��_ext + + + ) + +203 #unde� +SSL_CTX_�t_�xt_��os_adv�ti�d_cb + + +204 + #SSL_CTX_�t_�xt_��os_adv�ti�d_cb + +SSL_CTX_�t_�xt_��os_adv_cb + + + ) + +205 #unde� +SSL_CTX_�t_�xt_��o_���_cb + + +206 + #SSL_CTX_�t_�xt_��o_���_cb + +SSL_CTX_�t_�xt_��o_�l_cb + + + ) + +209 #unde� +ENGINE_g�_de�u�_BN_mod_exp_�t + + +210 + #ENGINE_g�_de�u�_BN_mod_exp_�t + +ENGINE_g�_def_BN_mod_exp_�t + + + ) + +211 #unde� +ENGINE_�t_de�u�_BN_mod_exp_�t + + +212 + #ENGINE_�t_de�u�_BN_mod_exp_�t + +ENGINE_�t_def_BN_mod_exp_�t + + + ) + +213 #unde� +ENGINE_�t_l�d_�ivkey_fun�i� + + +214 + #ENGINE_�t_l�d_�ivkey_fun�i� + +ENGINE_�t_l�d_�ivkey_� + + + ) + +215 #unde� +ENGINE_g�_l�d_�ivkey_fun�i� + + +216 + #ENGINE_g�_l�d_�ivkey_fun�i� + +ENGINE_g�_l�d_�ivkey_� + + + ) + +217 #unde� +ENGINE_u�egi��_pkey_a�1_m�hs + + +218 + #ENGINE_u�egi��_pkey_a�1_m�hs + +ENGINE_u�eg_pkey_a�1_m�hs + + + ) + +219 #unde� +ENGINE_�gi��_�l_pkey_a�1_m�hs + + +220 + #ENGINE_�gi��_�l_pkey_a�1_m�hs + +ENGINE_�g_�l_pkey_a�1_m�hs + + + ) + +221 #unde� +ENGINE_�t_de�u�_pkey_a�1_m�hs + + +222 + #ENGINE_�t_de�u�_pkey_a�1_m�hs + +ENGINE_�t_def_pkey_a�1_m�hs + + + ) + +223 #unde� +ENGINE_g�_pkey_a�1_m�h_�g�e + + +224 + #ENGINE_g�_pkey_a�1_m�h_�g�e + +ENGINE_g�_pkey_a�1_m�h_�g + + + ) + +225 #unde� +ENGINE_�t_l�d_s�_���_��_fun�i� + + +226 + #ENGINE_�t_l�d_s�_���_��_fun�i� + \ + +227 +ENGINE_�t_ld_s�_��_��_� + + + ) + +228 #unde� +ENGINE_g�_s�_���_��_fun�i� + + +229 + #ENGINE_g�_s�_���_��_fun�i� + +ENGINE_g�_s�_���_��_� + + + ) + +232 #unde� +OCSP_REQUEST_g�_ext_by_��i�l + + +233 + #OCSP_REQUEST_g�_ext_by_��i�l + +OCSP_REQUEST_g�_ext_by_�� + + + ) + +234 #unde� +OCSP_BASICRESP_g�_ext_by_��i�l + + +235 + #OCSP_BASICRESP_g�_ext_by_��i�l + +OCSP_BASICRESP_g�_ext_by_�� + + + ) + +236 #unde� +OCSP_SINGLERESP_g�_ext_by_��i�l + + +237 + #OCSP_SINGLERESP_g�_ext_by_��i�l + +OCSP_SINGLERESP_g�_ext_by_�� + + + ) + +240 #unde� +_os�_�d_des_ede3_cfb64_��y� + + +241 + #_os�_�d_des_ede3_cfb64_��y� + +_os�_odes_ede3_cfb64_��y� + + + ) + +242 #unde� +_os�_�d_des_ede3_ofb64_��y� + + +243 + #_os�_�d_des_ede3_ofb64_��y� + +_os�_odes_ede3_ofb64_��y� + + + ) + +246 #unde� +OPENSSL_add_�l_�gܙhms_noc�f + + +247 + #OPENSSL_add_�l_�gܙhms_noc�f + +OPENSSL_add_�l_�go_noc�f + + + ) + +248 #unde� +OPENSSL_add_�l_�gܙhms_c�f + + +249 + #OPENSSL_add_�l_�gܙhms_c�f + +OPENSSL_add_�l_�go_c�f + + + ) + +250 #unde� +EVP_PKEY_m�h_�t_v�ify_�cov� + + +251 + #EVP_PKEY_m�h_�t_v�ify_�cov� + +EVP_PKEY_m�h_�t_vrfy_�cov� + + + ) + +254 #unde� +EC_GROUP_�t_po�t_c�v�si�_f�m + + +255 + #EC_GROUP_�t_po�t_c�v�si�_f�m + +EC_GROUP_�t_po�t_c�v_f�m + + + ) + +256 #unde� +EC_GROUP_g�_po�t_c�v�si�_f�m + + +257 + #EC_GROUP_g�_po�t_c�v�si�_f�m + +EC_GROUP_g�_po�t_c�v_f�m + + + ) + +258 #unde� +EC_GROUP_��r_�_�l_ex�a_d�a + + +259 + #EC_GROUP_��r_�_�l_ex�a_d�a + +EC_GROUP_�r_�_�l_x�a_d�a + + + ) + +260 #unde� +EC_KEY_�t_public_key_aff�e_co�d��es + + +261 + #EC_KEY_�t_public_key_aff�e_co�d��es + \ + +262 +EC_KEY_�t_pub_key_aff_co�ds + + + ) + +263 #unde� +EC_POINT_�t_J�oje�ive_co�d��es_GFp + + +264 + #EC_POINT_�t_J�oje�ive_co�d��es_GFp + \ + +265 +EC_POINT_�t_J�oj_co�ds_GFp + + + ) + +266 #unde� +EC_POINT_g�_J�oje�ive_co�d��es_GFp + + +267 + #EC_POINT_g�_J�oje�ive_co�d��es_GFp + \ + +268 +EC_POINT_g�_J�oj_co�ds_GFp + + + ) + +269 #unde� +EC_POINT_�t_aff�e_co�d��es_GFp + + +270 + #EC_POINT_�t_aff�e_co�d��es_GFp + +EC_POINT_�t_aff�e_co�ds_GFp + + + ) + +271 #unde� +EC_POINT_g�_aff�e_co�d��es_GFp + + +272 + #EC_POINT_g�_aff�e_co�d��es_GFp + +EC_POINT_g�_aff�e_co�ds_GFp + + + ) + +273 #unde� +EC_POINT_�t_com�es�d_co�d��es_GFp + + +274 + #EC_POINT_�t_com�es�d_co�d��es_GFp + +EC_POINT_�t_com�_co�ds_GFp + + + ) + +275 #unde� +EC_POINT_�t_aff�e_co�d��es_GF2m + + +276 + #EC_POINT_�t_aff�e_co�d��es_GF2m + +EC_POINT_�t_aff�e_co�ds_GF2m + + + ) + +277 #unde� +EC_POINT_g�_aff�e_co�d��es_GF2m + + +278 + #EC_POINT_g�_aff�e_co�d��es_GF2m + +EC_POINT_g�_aff�e_co�ds_GF2m + + + ) + +279 #unde� +EC_POINT_�t_com�es�d_co�d��es_GF2m + + +280 + #EC_POINT_�t_com�es�d_co�d��es_GF2m + \ + +281 +EC_POINT_�t_com�_co�ds_GF2m + + + ) + +282 #unde� +ec_GF2m_sim�e_group_��r_f�ish + + +283 + #ec_GF2m_sim�e_group_��r_f�ish + +ec_GF2m_sim�e_g�_�r_f�ish + + + ) + +284 #unde� +ec_GF2m_sim�e_group_check_dis�im��t + + +285 + #ec_GF2m_sim�e_group_check_dis�im��t + +ec_GF2m_sim�e_g�_chk_dis�im + + + ) + +286 #unde� +ec_GF2m_sim�e_po�t_��r_f�ish + + +287 + #ec_GF2m_sim�e_po�t_��r_f�ish + +ec_GF2m_sim�e_�_�r_f�ish + + + ) + +288 #unde� +ec_GF2m_sim�e_po�t_�t_to_�f��y + + +289 + #ec_GF2m_sim�e_po�t_�t_to_�f��y + +ec_GF2m_sim�e_�_�t_to_�f + + + ) + +290 #unde� +ec_GF2m_sim�e_po�ts_make_aff�e + + +291 + #ec_GF2m_sim�e_po�ts_make_aff�e + +ec_GF2m_sim�e_�s_make_aff�e + + + ) + +292 #unde� +ec_GF2m_sim�e_po�t_�t_aff�e_co�d��es + + +293 + #ec_GF2m_sim�e_po�t_�t_aff�e_co�d��es + \ + +294 +ec_GF2m_smp_�_�t_af_co�ds + + + ) + +295 #unde� +ec_GF2m_sim�e_po�t_g�_aff�e_co�d��es + + +296 + #ec_GF2m_sim�e_po�t_g�_aff�e_co�d��es + \ + +297 +ec_GF2m_smp_�_g�_af_co�ds + + + ) + +298 #unde� +ec_GF2m_sim�e_�t_com�es�d_co�d��es + + +299 + #ec_GF2m_sim�e_�t_com�es�d_co�d��es + \ + +300 +ec_GF2m_smp_�t_com�_co�ds + + + ) + +301 #unde� +ec_GFp_sim�e_group_�t_curve_GFp + + +302 + #ec_GFp_sim�e_group_�t_curve_GFp + +ec_GFp_sim�e_g�_�t_curve_GFp + + + ) + +303 #unde� +ec_GFp_sim�e_group_g�_curve_GFp + + +304 + #ec_GFp_sim�e_group_g�_curve_GFp + +ec_GFp_sim�e_g�_g�_curve_GFp + + + ) + +305 #unde� +ec_GFp_sim�e_group_��r_f�ish + + +306 + #ec_GFp_sim�e_group_��r_f�ish + +ec_GFp_sim�e_g�_��r_f�ish + + + ) + +307 #unde� +ec_GFp_sim�e_group_�t_g���� + + +308 + #ec_GFp_sim�e_group_�t_g���� + +ec_GFp_sim�e_g�_�t_g���� + + + ) + +309 #unde� +ec_GFp_sim�e_group_g�0_g���� + + +310 + #ec_GFp_sim�e_group_g�0_g���� + +ec_GFp_sim�e_g�_gt0_g���� + + + ) + +311 #unde� +ec_GFp_sim�e_group_g�_co��� + + +312 + #ec_GFp_sim�e_group_g�_co��� + +ec_GFp_sim�e_g�_g�_co��� + + + ) + +313 #unde� +ec_GFp_sim�e_po�t_��r_f�ish + + +314 + #ec_GFp_sim�e_po�t_��r_f�ish + +ec_GFp_sim�e_�_��r_f�ish + + + ) + +315 #unde� +ec_GFp_sim�e_po�t_�t_to_�f��y + + +316 + #ec_GFp_sim�e_po�t_�t_to_�f��y + +ec_GFp_sim�e_�_�t_to_�f + + + ) + +317 #unde� +ec_GFp_sim�e_po�ts_make_aff�e + + +318 + #ec_GFp_sim�e_po�ts_make_aff�e + +ec_GFp_sim�e_�s_make_aff�e + + + ) + +319 #unde� +ec_GFp_sim�e_�t_J�oje�ive_co�d��es_GFp + + +320 + #ec_GFp_sim�e_�t_J�oje�ive_co�d��es_GFp + \ + +321 +ec_GFp_smp_�t_J�oj_co�ds_GFp + + + ) + +322 #unde� +ec_GFp_sim�e_g�_J�oje�ive_co�d��es_GFp + + +323 + #ec_GFp_sim�e_g�_J�oje�ive_co�d��es_GFp + \ + +324 +ec_GFp_smp_g�_J�oj_co�ds_GFp + + + ) + +325 #unde� +ec_GFp_sim�e_po�t_�t_aff�e_co�d��es_GFp + + +326 + #ec_GFp_sim�e_po�t_�t_aff�e_co�d��es_GFp + \ + +327 +ec_GFp_smp_�_�t_af_co�ds_GFp + + + ) + +328 #unde� +ec_GFp_sim�e_po�t_g�_aff�e_co�d��es_GFp + + +329 + #ec_GFp_sim�e_po�t_g�_aff�e_co�d��es_GFp + \ + +330 +ec_GFp_smp_�_g�_af_co�ds_GFp + + + ) + +331 #unde� +ec_GFp_sim�e_�t_com�es�d_co�d��es_GFp + + +332 + #ec_GFp_sim�e_�t_com�es�d_co�d��es_GFp + \ + +333 +ec_GFp_smp_�t_com�_co�ds_GFp + + + ) + +334 #unde� +ec_GFp_sim�e_po�t_�t_aff�e_co�d��es + + +335 + #ec_GFp_sim�e_po�t_�t_aff�e_co�d��es + \ + +336 +ec_GFp_smp_�_�t_af_co�ds + + + ) + +337 #unde� +ec_GFp_sim�e_po�t_g�_aff�e_co�d��es + + +338 + #ec_GFp_sim�e_po�t_g�_aff�e_co�d��es + \ + +339 +ec_GFp_smp_�_g�_af_co�ds + + + ) + +340 #unde� +ec_GFp_sim�e_�t_com�es�d_co�d��es + + +341 + #ec_GFp_sim�e_�t_com�es�d_co�d��es + \ + +342 +ec_GFp_smp_�t_com�_co�ds + + + ) + +343 #unde� +ec_GFp_sim�e_group_check_dis�im��t + + +344 + #ec_GFp_sim�e_group_check_dis�im��t + +ec_GFp_sim�e_g�_chk_dis�im + + + ) + +347 #unde� +STORE_m�hod_�t_���li�_fun�i� + + +348 + #STORE_m�hod_�t_���li�_fun�i� + +STORE_m�h_�t_���li�_� + + + ) + +349 #unde� +STORE_m�hod_�t_��nup_fun�i� + + +350 + #STORE_m�hod_�t_��nup_fun�i� + +STORE_m�h_�t_��nup_� + + + ) + +351 #unde� +STORE_m�hod_�t_g���e_fun�i� + + +352 + #STORE_m�hod_�t_g���e_fun�i� + +STORE_m�h_�t_g���e_� + + + ) + +353 #unde� +STORE_m�hod_�t_modify_fun�i� + + +354 + #STORE_m�hod_�t_modify_fun�i� + +STORE_m�h_�t_modify_� + + + ) + +355 #unde� +STORE_m�hod_�t_�voke_fun�i� + + +356 + #STORE_m�hod_�t_�voke_fun�i� + +STORE_m�h_�t_�voke_� + + + ) + +357 #unde� +STORE_m�hod_�t_d��e_fun�i� + + +358 + #STORE_m�hod_�t_d��e_fun�i� + +STORE_m�h_�t_d��e_� + + + ) + +359 #unde� +STORE_m�hod_�t_li�_��t_fun�i� + + +360 + #STORE_m�hod_�t_li�_��t_fun�i� + +STORE_m�h_�t_li�_��t_� + + + ) + +361 #unde� +STORE_m�hod_�t_li�_�xt_fun�i� + + +362 + #STORE_m�hod_�t_li�_�xt_fun�i� + +STORE_m�h_�t_li�_�xt_� + + + ) + +363 #unde� +STORE_m�hod_�t_li�_�d_fun�i� + + +364 + #STORE_m�hod_�t_li�_�d_fun�i� + +STORE_m�h_�t_li�_�d_� + + + ) + +365 #unde� +STORE_m�hod_�t_upd�e_��e_fun�i� + + +366 + #STORE_m�hod_�t_upd�e_��e_fun�i� + +STORE_m�h_�t_upd�e_��e_� + + + ) + +367 #unde� +STORE_m�hod_�t_lock_��e_fun�i� + + +368 + #STORE_m�hod_�t_lock_��e_fun�i� + +STORE_m�h_�t_lock_��e_� + + + ) + +369 #unde� +STORE_m�hod_�t_u�ock_��e_fun�i� + + +370 + #STORE_m�hod_�t_u�ock_��e_fun�i� + +STORE_m�h_�t_u�ock_��e_� + + + ) + +371 #unde� +STORE_m�hod_g�_���li�_fun�i� + + +372 + #STORE_m�hod_g�_���li�_fun�i� + +STORE_m�h_g�_���li�_� + + + ) + +373 #unde� +STORE_m�hod_g�_��nup_fun�i� + + +374 + #STORE_m�hod_g�_��nup_fun�i� + +STORE_m�h_g�_��nup_� + + + ) + +375 #unde� +STORE_m�hod_g�_g���e_fun�i� + + +376 + #STORE_m�hod_g�_g���e_fun�i� + +STORE_m�h_g�_g���e_� + + + ) + +377 #unde� +STORE_m�hod_g�_modify_fun�i� + + +378 + #STORE_m�hod_g�_modify_fun�i� + +STORE_m�h_g�_modify_� + + + ) + +379 #unde� +STORE_m�hod_g�_�voke_fun�i� + + +380 + #STORE_m�hod_g�_�voke_fun�i� + +STORE_m�h_g�_�voke_� + + + ) + +381 #unde� +STORE_m�hod_g�_d��e_fun�i� + + +382 + #STORE_m�hod_g�_d��e_fun�i� + +STORE_m�h_g�_d��e_� + + + ) + +383 #unde� +STORE_m�hod_g�_li�_��t_fun�i� + + +384 + #STORE_m�hod_g�_li�_��t_fun�i� + +STORE_m�h_g�_li�_��t_� + + + ) + +385 #unde� +STORE_m�hod_g�_li�_�xt_fun�i� + + +386 + #STORE_m�hod_g�_li�_�xt_fun�i� + +STORE_m�h_g�_li�_�xt_� + + + ) + +387 #unde� +STORE_m�hod_g�_li�_�d_fun�i� + + +388 + #STORE_m�hod_g�_li�_�d_fun�i� + +STORE_m�h_g�_li�_�d_� + + + ) + +389 #unde� +STORE_m�hod_g�_upd�e_��e_fun�i� + + +390 + #STORE_m�hod_g�_upd�e_��e_fun�i� + +STORE_m�h_g�_upd�e_��e_� + + + ) + +391 #unde� +STORE_m�hod_g�_lock_��e_fun�i� + + +392 + #STORE_m�hod_g�_lock_��e_fun�i� + +STORE_m�h_g�_lock_��e_� + + + ) + +393 #unde� +STORE_m�hod_g�_u�ock_��e_fun�i� + + +394 + #STORE_m�hod_g�_u�ock_��e_fun�i� + +STORE_m�h_g�_u�ock_��e_� + + + ) + +397 #unde� +TS_RESP_CTX_�t_��us_�fo_c�d + + +398 + #TS_RESP_CTX_�t_��us_�fo_c�d + +TS_RESP_CTX_�t_��_�fo_c�d + + + ) + +399 #unde� +TS_RESP_CTX_�t_�ock_�ecisi�_dig�s + + +400 + #TS_RESP_CTX_�t_�ock_�ecisi�_dig�s + +TS_RESP_CTX_�t_�k_�ec_dig�s + + + ) + +401 #unde� +TS_CONF_�t_�ock_�ecisi�_dig�s + + +402 + #TS_CONF_�t_�ock_�ecisi�_dig�s + +TS_CONF_�t_�k_�ec_dig�s + + + ) + +405 #unde� +CMS_Rec���Info_k�i_g�0_�gs + + +406 + #CMS_Rec���Info_k�i_g�0_�gs + +CMS_Rec�Info_k�i_g�0_�gs + + + ) + +407 #unde� +CMS_Rec���Info_k�i_g�0_sig�r_id + + +408 + #CMS_Rec���Info_k�i_g�0_sig�r_id + +CMS_Rec�Info_k�i_g�0_sigr_id + + + ) + +409 #unde� +CMS_Oth�Revo�ti�InfoF�m�_� + + +410 + #CMS_Oth�Revo�ti�InfoF�m�_� + +CMS_Oth�RevocInfoF�m�_� + + + ) + +411 #unde� +CMS_KeyAg�eRec���Id�tif�r_� + + +412 + #CMS_KeyAg�eRec���Id�tif�r_� + +CMS_KeyAg�eRec�Id�tif�r_� + + + ) + +413 #unde� +CMS_Orig���Id�tif�rOrKey_� + + +414 + #CMS_Orig���Id�tif�rOrKey_� + +CMS_Orig���IdOrKey_� + + + ) + +415 #unde� +cms_Sig�rId�tif�r_g�0_sig�r_id + + +416 + #cms_Sig�rId�tif�r_g�0_sig�r_id + +cms_Sig�rId_g�0_sig�r_id + + + ) + +419 #unde� +d�s1_���sm�_buf�d_mes�ges + + +420 + #d�s1_���sm�_buf�d_mes�ges + +d�s1_���sm�_buf�d_msgs + + + ) + +423 #unde� +SRP_g���e_�rv�_ma��_��� + + +424 + #SRP_g���e_�rv�_ma��_��� + +SRP_g�_�rv�_ma��_��� + + + ) + +425 #unde� +SRP_g���e_���_ma��_��� + + +426 + #SRP_g���e_���_ma��_��� + +SRP_g�_���_ma��_��� + + + ) + +429 #unde� +UI_m�hod_g�_�om�_cڡru�� + + +430 + #UI_m�hod_g�_�om�_cڡru�� + +UI_m�hod_g�_�om�_cڡru�r + + + ) + +431 #unde� +UI_m�hod_�t_�om�_cڡru�� + + +432 + #UI_m�hod_�t_�om�_cڡru�� + +UI_m�hod_�t_�om�_cڡru�r + + + ) + +438 #i� +def�ed +( +OPENSSL_SYS_VMS +�|| def�ed( +OPENSSL_SYS_OS2 +) + +439 #unde� +ERR_l�d_CRYPTO_�r�gs + + +440 + #ERR_l�d_CRYPTO_�r�gs + +ERR_l�d_CRYPTOlib_�r�gs + + + ) + +441 #unde� +OCSP_�lID_�w + + +442 + #OCSP_�lID_�w + +OCSP_�lID2_�w + + + ) + +444 #unde� +d2i_ECPARAMETERS + + +445 + #d2i_ECPARAMETERS + +d2i_UC_ECPARAMETERS + + + ) + +446 #unde� +i2d_ECPARAMETERS + + +447 + #i2d_ECPARAMETERS + +i2d_UC_ECPARAMETERS + + + ) + +448 #unde� +d2i_ECPKPARAMETERS + + +449 + #d2i_ECPKPARAMETERS + +d2i_UC_ECPKPARAMETERS + + + ) + +450 #unde� +i2d_ECPKPARAMETERS + + +451 + #i2d_ECPKPARAMETERS + +i2d_UC_ECPKPARAMETERS + + + ) + +459 #unde� +X509v3_��nup_ex�nsi�s + + +460 + #X509v3_��nup_ex�nsi�s + +oX509v3_��nup_ex�nsi�s + + + ) + +461 #unde� +X509v3_add_ex�nsi� + + +462 + #X509v3_add_ex�nsi� + +oX509v3_add_ex�nsi� + + + ) + +463 #unde� +X509v3_add_�ts��_ex�nsi�s + + +464 + #X509v3_add_�ts��_ex�nsi�s + +oX509v3_add_�ts��_ex�nsi�s + + + ) + +465 #unde� +X509v3_add_��d�d_ex�nsi�s + + +466 + #X509v3_add_��d�d_ex�nsi�s + +oX509v3_add_��d�d_ex�nsi�s + + + ) + +469 #unde� +cms_D�a_��� + + +470 + #cms_D�a_��� + +�iv_cms_D�a_��� + + + ) + + @/usr/include/openssl/x509.h + +64 #i�de� +HEADER_X509_H + + +65 + #HEADER_X509_H + + + ) + +67 + ~<ݒs�/e_os2.h +> + +68 + ~<ݒs�/symhacks.h +> + +69 #i�de� +OPENSSL_NO_BUFFER + + +70 + ~<ݒs�/buf�r.h +> + +72 #i�de� +OPENSSL_NO_EVP + + +73 + ~<ݒs�/evp.h +> + +75 #i�de� +OPENSSL_NO_BIO + + +76 + ~<ݒs�/bio.h +> + +78 + ~<ݒs�/�ack.h +> + +79 + ~<ݒs�/a�1.h +> + +80 + ~<ݒs�/��ack.h +> + +82 #i�de� +OPENSSL_NO_EC + + +83 + ~<ݒs�/ec.h +> + +86 #i�de� +OPENSSL_NO_ECDSA + + +87 + ~<ݒs�/ecd�.h +> + +90 #i�de� +OPENSSL_NO_ECDH + + +91 + ~<ݒs�/ecdh.h +> + +94 #i�de� +OPENSSL_NO_DEPRECATED + + +95 #i�de� +OPENSSL_NO_RSA + + +96 + ~<ݒs�/r�.h +> + +98 #i�de� +OPENSSL_NO_DSA + + +99 + ~<ݒs�/d�.h +> + +101 #i�de� +OPENSSL_NO_DH + + +102 + ~<ݒs�/dh.h +> + +106 #i�de� +OPENSSL_NO_SHA + + +107 + ~<ݒs�/sha.h +> + +109 + ~<ݒs�/os�_typ.h +> + +111 #ifde� +__�lu�lus + + +115 #ifde� +OPENSSL_SYS_WIN32 + + +117 #unde� +X509_NAME + + +118 #unde� +X509_CERT_PAIR + + +119 #unde� +X509_EXTENSIONS + + +122 + #X509_FILETYPE_PEM + 1 + + ) + +123 + #X509_FILETYPE_ASN1 + 2 + + ) + +124 + #X509_FILETYPE_DEFAULT + 3 + + ) + +126 + #X509v3_KU_DIGITAL_SIGNATURE + 0x0080 + + ) + +127 + #X509v3_KU_NON_REPUDIATION + 0x0040 + + ) + +128 + #X509v3_KU_KEY_ENCIPHERMENT + 0x0020 + + ) + +129 + #X509v3_KU_DATA_ENCIPHERMENT + 0x0010 + + ) + +130 + #X509v3_KU_KEY_AGREEMENT + 0x0008 + + ) + +131 + #X509v3_KU_KEY_CERT_SIGN + 0x0004 + + ) + +132 + #X509v3_KU_CRL_SIGN + 0x0002 + + ) + +133 + #X509v3_KU_ENCIPHER_ONLY + 0x0001 + + ) + +134 + #X509v3_KU_DECIPHER_ONLY + 0x8000 + + ) + +135 + #X509v3_KU_UNDEF + 0xffff + + ) + +137 + sX509_obje�s_� + + +139 +nid +; + +140 (* +a2i +)(); + +141 (* +i2a +)(); + +142 } + tX509_OBJECTS +; + +144 + sX509_�g�_� + + +146 +ASN1_OBJECT + * +�gܙhm +; + +147 +ASN1_TYPE + * +��m�� +; + +150 +DECLARE_ASN1_SET_OF +( +X509_ALGOR +) + +152 +STACK_OF +( + tX509_ALGOR +� + tX509_ALGORS +; + +154 + sX509_v�_� + + +156 +ASN1_TIME + * +n�Bef�e +; + +157 +ASN1_TIME + * +n�A� +; + +158 } + tX509_VAL +; + +160 + sX509_pubkey_� + + +162 +X509_ALGOR + * +�g� +; + +163 +ASN1_BIT_STRING + * +public_key +; + +164 +EVP_PKEY + * +pkey +; + +167 + sX509_sig_� + + +169 +X509_ALGOR + * +�g� +; + +170 +ASN1_OCTET_STRING + * +dige� +; + +171 } + tX509_SIG +; + +173 + sX509_�me_��y_� + + +175 +ASN1_OBJECT + * +obje� +; + +176 +ASN1_STRING + * +v�ue +; + +177 +�t +; + +178 +size +; + +179 } + tX509_NAME_ENTRY +; + +181 +DECLARE_STACK_OF +( +X509_NAME_ENTRY +) + +182 +DECLARE_ASN1_SET_OF +( +X509_NAME_ENTRY +) + +185 + sX509_�me_� + + +187 +STACK_OF +( +X509_NAME_ENTRY +�* +���s +; + +188 +modif�d +; + +189 #i�de� +OPENSSL_NO_BUFFER + + +190 +BUF_MEM + * +by�s +; + +192 * +by�s +; + +195 * +�n�_�c +; + +196 +�n�_��� +; + +199 +DECLARE_STACK_OF +( +X509_NAME +) + +201 + #X509_EX_V_NETSCAPE_HACK + 0x8000 + + ) + +202 + #X509_EX_V_INIT + 0x0001 + + ) + +203 + sX509_ex�nsi�_� + + +205 +ASN1_OBJECT + * +obje� +; + +206 +ASN1_BOOLEAN + +��i�l +; + +207 +ASN1_OCTET_STRING + * +v�ue +; + +208 } + tX509_EXTENSION +; + +210 +STACK_OF +( + tX509_EXTENSION +� + tX509_EXTENSIONS +; + +212 +DECLARE_STACK_OF +( +X509_EXTENSION +) + +213 +DECLARE_ASN1_SET_OF +( +X509_EXTENSION +) + +216 + sx509_��ibu�s_� + + +218 +ASN1_OBJECT + * +obje� +; + +219 +s�g� +; + +221 * +�r +; + +222 +STACK_OF +( +ASN1_TYPE +�* +�t +; + +223 +ASN1_TYPE + * +s�g� +; + +224 } +v�ue +; + +225 } + tX509_ATTRIBUTE +; + +227 +DECLARE_STACK_OF +( +X509_ATTRIBUTE +) + +228 +DECLARE_ASN1_SET_OF +( +X509_ATTRIBUTE +) + +231 + sX509_�q_�fo_� + + +233 +ASN1_ENCODING + +�c +; + +234 +ASN1_INTEGER + * +v�si� +; + +235 +X509_NAME + * +subje� +; + +236 +X509_PUBKEY + * +pubkey +; + +238 +STACK_OF +( +X509_ATTRIBUTE +�* +��ibu�s +; + +239 } + tX509_REQ_INFO +; + +241 + sX509_�q_� + + +243 +X509_REQ_INFO + * +�q_�fo +; + +244 +X509_ALGOR + * +sig_�g +; + +245 +ASN1_BIT_STRING + * +sig�tu� +; + +246 +��n�s +; + +247 } + tX509_REQ +; + +249 + sx509_c�f_� + + +251 +ASN1_INTEGER + * +v�si� +; + +252 +ASN1_INTEGER + * +�r�lNumb� +; + +253 +X509_ALGOR + * +sig�tu� +; + +254 +X509_NAME + * +issu� +; + +255 +X509_VAL + * +v�id�y +; + +256 +X509_NAME + * +subje� +; + +257 +X509_PUBKEY + * +key +; + +258 +ASN1_BIT_STRING + * +issu�UID +; + +259 +ASN1_BIT_STRING + * +subje�UID +; + +260 +STACK_OF +( +X509_EXTENSION +�* +ex�nsi�s +; + +261 +ASN1_ENCODING + +�c +; + +262 } + tX509_CINF +; + +270 + sx509_��_aux_� + + +272 +STACK_OF +( +ASN1_OBJECT +�* +�u� +; + +273 +STACK_OF +( +ASN1_OBJECT +�* +�je� +; + +274 +ASN1_UTF8STRING + * +��s +; + +275 +ASN1_OCTET_STRING + * +keyid +; + +276 +STACK_OF +( +X509_ALGOR +�* +�h� +; + +277 } + tX509_CERT_AUX +; + +279 + sx509_� + + +281 +X509_CINF + * +��_�fo +; + +282 +X509_ALGOR + * +sig_�g +; + +283 +ASN1_BIT_STRING + * +sig�tu� +; + +284 +v�id +; + +285 +��n�s +; + +286 * +�me +; + +287 +CRYPTO_EX_DATA + +ex_d�a +; + +289 +ex_�th�n +; + +290 +ex_p��h�n +; + +291 +ex_�ags +; + +292 +ex_ku�ge +; + +293 +ex_xku�ge +; + +294 +ex_ns�� +; + +295 +ASN1_OCTET_STRING + * +skid +; + +296 +AUTHORITY_KEYID + * +akid +; + +297 +X509_POLICY_CACHE + * +p�icy_�che +; + +298 +STACK_OF +( +DIST_POINT +�* +�ldp +; + +299 +STACK_OF +( +GENERAL_NAME +�* +��ame +; + +300 +NAME_CONSTRAINTS + * +nc +; + +301 #i�de� +OPENSSL_NO_RFC3779 + + +302 +STACK_OF +( +IPAdd�ssFam�y +�* +rfc3779_addr +; + +303 +ASId�tif�rs_� + * +rfc3779_asid +; + +305 #i�de� +OPENSSL_NO_SHA + + +306 +sha1_hash +[ +SHA_DIGEST_LENGTH +]; + +308 +X509_CERT_AUX + * +aux +; + +311 +DECLARE_STACK_OF +( +X509 +) + +312 +DECLARE_ASN1_SET_OF +( +X509 +) + +316 + sx509_�u�_� + { + +317 +�u� +; + +318 +�ags +; + +319 (* +check_�u� +)( +x509_�u�_� + *, +X509 + *, ); + +320 * +�me +; + +321 +�g1 +; + +322 * +�g2 +; + +323 } + tX509_TRUST +; + +325 +DECLARE_STACK_OF +( +X509_TRUST +) + +327 + sx509_��_��_� + { + +328 +X509 + * +f�w�d +; + +329 +X509 + * +�v�� +; + +330 } + tX509_CERT_PAIR +; + +334 + #X509_TRUST_DEFAULT + -1 + + ) + +336 + #X509_TRUST_COMPAT + 1 + + ) + +337 + #X509_TRUST_SSL_CLIENT + 2 + + ) + +338 + #X509_TRUST_SSL_SERVER + 3 + + ) + +339 + #X509_TRUST_EMAIL + 4 + + ) + +340 + #X509_TRUST_OBJECT_SIGN + 5 + + ) + +341 + #X509_TRUST_OCSP_SIGN + 6 + + ) + +342 + #X509_TRUST_OCSP_REQUEST + 7 + + ) + +343 + #X509_TRUST_TSA + 8 + + ) + +346 + #X509_TRUST_MIN + 1 + + ) + +347 + #X509_TRUST_MAX + 8 + + ) + +351 + #X509_TRUST_DYNAMIC + 1 + + ) + +352 + #X509_TRUST_DYNAMIC_NAME + 2 + + ) + +356 + #X509_TRUST_TRUSTED + 1 + + ) + +357 + #X509_TRUST_REJECTED + 2 + + ) + +358 + #X509_TRUST_UNTRUSTED + 3 + + ) + +362 + #X509_FLAG_COMPAT + 0 + + ) + +363 + #X509_FLAG_NO_HEADER + 1L + + ) + +364 + #X509_FLAG_NO_VERSION + (1L << 1) + + ) + +365 + #X509_FLAG_NO_SERIAL + (1L << 2) + + ) + +366 + #X509_FLAG_NO_SIGNAME + (1L << 3) + + ) + +367 + #X509_FLAG_NO_ISSUER + (1L << 4) + + ) + +368 + #X509_FLAG_NO_VALIDITY + (1L << 5) + + ) + +369 + #X509_FLAG_NO_SUBJECT + (1L << 6) + + ) + +370 + #X509_FLAG_NO_PUBKEY + (1L << 7) + + ) + +371 + #X509_FLAG_NO_EXTENSIONS + (1L << 8) + + ) + +372 + #X509_FLAG_NO_SIGDUMP + (1L << 9) + + ) + +373 + #X509_FLAG_NO_AUX + (1L << 10) + + ) + +374 + #X509_FLAG_NO_ATTRIBUTES + (1L << 11) + + ) + +380 + #XN_FLAG_SEP_MASK + (0x�<< 16) + + ) + +382 + #XN_FLAG_COMPAT + 0 + + ) + +383 + #XN_FLAG_SEP_COMMA_PLUS + (1 << 16� + + ) + +384 + #XN_FLAG_SEP_CPLUS_SPC + (2 << 16� + + ) + +385 + #XN_FLAG_SEP_SPLUS_SPC + (3 << 16� + + ) + +386 + #XN_FLAG_SEP_MULTILINE + (4 << 16� + + ) + +388 + #XN_FLAG_DN_REV + (1 << 20� + + ) + +392 + #XN_FLAG_FN_MASK + (0x3 << 21) + + ) + +394 + #XN_FLAG_FN_SN + 0 + + ) + +395 + #XN_FLAG_FN_LN + (1 << 21� + + ) + +396 + #XN_FLAG_FN_OID + (2 << 21� + + ) + +397 + #XN_FLAG_FN_NONE + (3 << 21� + + ) + +399 + #XN_FLAG_SPC_EQ + (1 << 23� + + ) + +405 + #XN_FLAG_DUMP_UNKNOWN_FIELDS + (1 << 24) + + ) + +407 + #XN_FLAG_FN_ALIGN + (1 << 25� + + ) + +411 + #XN_FLAG_RFC2253 + ( +ASN1_STRFLGS_RFC2253 + | \ + +412 +XN_FLAG_SEP_COMMA_PLUS + | \ + +413 +XN_FLAG_DN_REV + | \ + +414 +XN_FLAG_FN_SN + | \ + +415 +XN_FLAG_DUMP_UNKNOWN_FIELDS +) + + ) + +419 + #XN_FLAG_ONELINE + ( +ASN1_STRFLGS_RFC2253 + | \ + +420 +ASN1_STRFLGS_ESC_QUOTE + | \ + +421 +XN_FLAG_SEP_CPLUS_SPC + | \ + +422 +XN_FLAG_SPC_EQ + | \ + +423 +XN_FLAG_FN_SN +) + + ) + +427 + #XN_FLAG_MULTILINE + ( +ASN1_STRFLGS_ESC_CTRL + | \ + +428 +ASN1_STRFLGS_ESC_MSB + | \ + +429 +XN_FLAG_SEP_MULTILINE + | \ + +430 +XN_FLAG_SPC_EQ + | \ + +431 +XN_FLAG_FN_LN + | \ + +432 +XN_FLAG_FN_ALIGN +) + + ) + +434 + sx509_�voked_� + + +436 +ASN1_INTEGER + * +�r�lNumb� +; + +437 +ASN1_TIME + * +�vo�ti�D�e +; + +438 +STACK_OF +( +X509_EXTENSION +� * +ex�nsi�s +; + +440 +STACK_OF +( +GENERAL_NAME +�* +issu� +; + +442 +�as� +; + +443 +�qu�� +; + +446 +DECLARE_STACK_OF +( +X509_REVOKED +) + +447 +DECLARE_ASN1_SET_OF +( +X509_REVOKED +) + +449 + sX509_�l_�fo_� + + +451 +ASN1_INTEGER + * +v�si� +; + +452 +X509_ALGOR + * +sig_�g +; + +453 +X509_NAME + * +issu� +; + +454 +ASN1_TIME + * +ϡUpd�e +; + +455 +ASN1_TIME + * +�xtUpd�e +; + +456 +STACK_OF +( +X509_REVOKED +�* +�voked +; + +457 +STACK_OF +( +X509_EXTENSION +� * +ex�nsi�s +; + +458 +ASN1_ENCODING + +�c +; + +459 } + tX509_CRL_INFO +; + +461 + sX509_�l_� + + +464 +X509_CRL_INFO + * +�l +; + +465 +X509_ALGOR + * +sig_�g +; + +466 +ASN1_BIT_STRING + * +sig�tu� +; + +467 +��n�s +; + +468 +�ags +; + +470 +AUTHORITY_KEYID + * +akid +; + +471 +ISSUING_DIST_POINT + * +idp +; + +473 +idp_�ags +; + +474 +idp_�as�s +; + +476 +ASN1_INTEGER + * +�l_numb� +; + +477 +ASN1_INTEGER + * +ba�_�l_numb� +; + +478 #i�de� +OPENSSL_NO_SHA + + +479 +sha1_hash +[ +SHA_DIGEST_LENGTH +]; + +481 +STACK_OF +( +GENERAL_NAMES +�* +issu�s +; + +482 cڡ +X509_CRL_METHOD + * +m�h +; + +483 * +m�h_d�a +; + +486 +DECLARE_STACK_OF +( +X509_CRL +) + +487 +DECLARE_ASN1_SET_OF +( +X509_CRL +) + +489 + s�iv�e_key_� + + +491 +v�si� +; + +493 +X509_ALGOR + * +�c_�g� +; + +494 +ASN1_OCTET_STRING + * +�c_pkey +; + +497 +EVP_PKEY + * +dec_pkey +; + +500 +key_�ngth +; + +501 * +key_d�a +; + +502 +key_� +; + +505 +EVP_CIPHER_INFO + +c�h� +; + +507 +��n�s +; + +508 } + tX509_PKEY +; + +510 #i�de� +OPENSSL_NO_EVP + + +511 + sX509_�fo_� + + +513 +X509 + * +x509 +; + +514 +X509_CRL + * +�l +; + +515 +X509_PKEY + * +x_pkey +; + +517 +EVP_CIPHER_INFO + +�c_c�h� +; + +518 +�c_�n +; + +519 * +�c_d�a +; + +521 +��n�s +; + +522 } + tX509_INFO +; + +524 +DECLARE_STACK_OF +( +X509_INFO +) + +531 + sN�s��_�kac_� + + +533 +X509_PUBKEY + * +pubkey +; + +534 +ASN1_IA5STRING + * +ch��nge +; + +535 } + tNETSCAPE_SPKAC +; + +537 + sN�s��_�ki_� + + +539 +NETSCAPE_SPKAC + * +�kac +; + +540 +X509_ALGOR + * +sig_�g� +; + +541 +ASN1_BIT_STRING + * +sig�tu� +; + +542 } + tNETSCAPE_SPKI +; + +545 + sN�s��_��ifi��_�qu�� + + +547 +ASN1_OBJECT + * +ty� +; + +548 +STACK_OF +( +X509 +�* +��s +; + +549 } + tNETSCAPE_CERT_SEQUENCE +; + +560 + sPBEPARAM_� + { + +561 +ASN1_OCTET_STRING + * +�� +; + +562 +ASN1_INTEGER + * +�� +; + +563 } + tPBEPARAM +; + +567 + sPBE2PARAM_� + { + +568 +X509_ALGOR + * +keyfunc +; + +569 +X509_ALGOR + * +��y�i� +; + +570 } + tPBE2PARAM +; + +572 + sPBKDF2PARAM_� + { + +573 +ASN1_TYPE + * +�� +; + +574 +ASN1_INTEGER + * +�� +; + +575 +ASN1_INTEGER + * +key�ngth +; + +576 +X509_ALGOR + * +�f +; + +577 } + tPBKDF2PARAM +; + +582 + spkcs8_�iv_key_�fo_� + + +584 +brok� +; + +585 + #PKCS8_OK + 0 + + ) + +586 + #PKCS8_NO_OCTET + 1 + + ) + +587 + #PKCS8_EMBEDDED_PARAM + 2 + + ) + +588 + #PKCS8_NS_DB + 3 + + ) + +589 + #PKCS8_NEG_PRIVKEY + 4 + + ) + +590 +ASN1_INTEGER + * +v�si� +; + +591 +X509_ALGOR + * +pkey�g +; + +592 +ASN1_TYPE + * +pkey +; + +593 +STACK_OF +( +X509_ATTRIBUTE +�* +��ibu�s +; + +596 #ifde� +__�lu�lus + + +600 + ~<ݒs�/x509_vfy.h +> + +601 + ~<ݒs�/pkcs7.h +> + +603 #ifde� +__�lu�lus + + +607 + #X509_EXT_PACK_UNKNOWN + 1 + + ) + +608 + #X509_EXT_PACK_STRING + 2 + + ) + +610 + #X509_g�_v�si� +( +x +� + `ASN1_INTEGER_g� +((x)-> +��_�fo +-> +v�si� +) + + ) + +612 + #X509_g�_n�Bef�e +( +x +�((x)-> +��_�fo +-> +v�id�y +-> +n�Bef�e +) + + ) + +613 + #X509_g�_n�A� +( +x +�((x)-> +��_�fo +-> +v�id�y +-> +n�A� +) + + ) + +614 + #X509_ex�a�_key +( +x +� + `X509_g�_pubkey +(x� + + ) + +615 + #X509_REQ_g�_v�si� +( +x +� + `ASN1_INTEGER_g� +((x)-> +�q_�fo +-> +v�si� +) + + ) + +616 + #X509_REQ_g�_subje�_�me +( +x +�((x)-> +�q_�fo +-> +subje� +) + + ) + +617 + #X509_REQ_ex�a�_key +( +a +� + `X509_REQ_g�_pubkey +�) + + ) + +618 + #X509_�me_cmp +( +a +, +b +� + `X509_NAME_cmp +(�),(b)) + + ) + +619 + #X509_g�_sig�tu�_ty� +( +x +� + `EVP_PKEY_ty� +( + `OBJ_obj2nid +((x)-> +sig_�g +-> +�gܙhm +)) + + ) + +621 + #X509_CRL_g�_v�si� +( +x +� + `ASN1_INTEGER_g� +((x)-> +�l +-> +v�si� +) + + ) + +622 + #X509_CRL_g�_ϡUpd�e +( +x +�((x)-> +�l +-> +ϡUpd�e +) + + ) + +623 + #X509_CRL_g�_�xtUpd�e +( +x +�((x)-> +�l +-> +�xtUpd�e +) + + ) + +624 + #X509_CRL_g�_issu� +( +x +�((x)-> +�l +-> +issu� +) + + ) + +625 + #X509_CRL_g�_REVOKED +( +x +�((x)-> +�l +-> +�voked +) + + ) + +627 +X509_CRL_�t_de�u�_m�hod +(cڡ +X509_CRL_METHOD + * +m�h +); + +628 +X509_CRL_METHOD + * +X509_CRL_METHOD_�w +( + +629 (* +�l_�� +)( +X509_CRL + * +�l +), + +630 (* +�l_� +)( +X509_CRL + * +�l +), + +631 (* +�l_lookup +)( +X509_CRL + * +�l +, +X509_REVOKED + ** +�t +, + +632 +ASN1_INTEGER + * +�r +, +X509_NAME + * +issu� +), + +633 (* +�l_v�ify +)( +X509_CRL + * +�l +, +EVP_PKEY + * +pk +)); + +634 +X509_CRL_METHOD_� +( +X509_CRL_METHOD + * +m +); + +636 +X509_CRL_�t_m�h_d�a +( +X509_CRL + * +�l +, * +d� +); + +637 * +X509_CRL_g�_m�h_d�a +( +X509_CRL + * +�l +); + +641 + #X509_g�_X509_PUBKEY +( +x +�((x)-> +��_�fo +-> +key +) + + ) + +644 cڡ * +X509_v�ify_��_�r�_�r�g +( +n +); + +646 #i�de� +OPENSSL_NO_EVP + + +647 +X509_v�ify +( +X509 + * +a +, +EVP_PKEY + * +r +); + +649 +X509_REQ_v�ify +( +X509_REQ + * +a +, +EVP_PKEY + * +r +); + +650 +X509_CRL_v�ify +( +X509_CRL + * +a +, +EVP_PKEY + * +r +); + +651 +NETSCAPE_SPKI_v�ify +( +NETSCAPE_SPKI + * +a +, +EVP_PKEY + * +r +); + +653 +NETSCAPE_SPKI + * +NETSCAPE_SPKI_b64_decode +(cڡ * +�r +, +�n +); + +654 * +NETSCAPE_SPKI_b64_�code +( +NETSCAPE_SPKI + * +x +); + +655 +EVP_PKEY + * +NETSCAPE_SPKI_g�_pubkey +( +NETSCAPE_SPKI + * +x +); + +656 +NETSCAPE_SPKI_�t_pubkey +( +NETSCAPE_SPKI + * +x +, +EVP_PKEY + * +pkey +); + +658 +NETSCAPE_SPKI_��t +( +BIO + * +out +, +NETSCAPE_SPKI + * +�ki +); + +660 +X509_sig�tu�_dump +( +BIO + * +bp +,cڡ +ASN1_STRING + * +sig +, +�d�t +); + +661 +X509_sig�tu�_��t +( +BIO + * +bp +, +X509_ALGOR + * +�g +, +ASN1_STRING + * +sig +); + +663 +X509_sign +( +X509 + * +x +, +EVP_PKEY + * +pkey +, cڡ +EVP_MD + * +md +); + +664 +X509_sign_�x +( +X509 + * +x +, +EVP_MD_CTX + * +�x +); + +665 +X509_REQ_sign +( +X509_REQ + * +x +, +EVP_PKEY + * +pkey +, cڡ +EVP_MD + * +md +); + +666 +X509_REQ_sign_�x +( +X509_REQ + * +x +, +EVP_MD_CTX + * +�x +); + +667 +X509_CRL_sign +( +X509_CRL + * +x +, +EVP_PKEY + * +pkey +, cڡ +EVP_MD + * +md +); + +668 +X509_CRL_sign_�x +( +X509_CRL + * +x +, +EVP_MD_CTX + * +�x +); + +669 +NETSCAPE_SPKI_sign +( +NETSCAPE_SPKI + * +x +, +EVP_PKEY + * +pkey +, cڡ +EVP_MD + * +md +); + +671 +X509_pubkey_dige� +(cڡ +X509 + * +d�a +,cڡ +EVP_MD + * +ty� +, + +672 * +md +, * +�n +); + +673 +X509_dige� +(cڡ +X509 + * +d�a +,cڡ +EVP_MD + * +ty� +, + +674 * +md +, * +�n +); + +675 +X509_CRL_dige� +(cڡ +X509_CRL + * +d�a +,cڡ +EVP_MD + * +ty� +, + +676 * +md +, * +�n +); + +677 +X509_REQ_dige� +(cڡ +X509_REQ + * +d�a +,cڡ +EVP_MD + * +ty� +, + +678 * +md +, * +�n +); + +679 +X509_NAME_dige� +(cڡ +X509_NAME + * +d�a +,cڡ +EVP_MD + * +ty� +, + +680 * +md +, * +�n +); + +683 #i�de� +OPENSSL_NO_FP_API + + +684 +X509 + * +d2i_X509_� +( +FILE + * +� +, X509 ** +x509 +); + +685 +i2d_X509_� +( +FILE + * +� +, +X509 + * +x509 +); + +686 +X509_CRL + * +d2i_X509_CRL_� +( +FILE + * +� +,X509_CRL ** +�l +); + +687 +i2d_X509_CRL_� +( +FILE + * +� +, +X509_CRL + * +�l +); + +688 +X509_REQ + * +d2i_X509_REQ_� +( +FILE + * +� +,X509_REQ ** +�q +); + +689 +i2d_X509_REQ_� +( +FILE + * +� +, +X509_REQ + * +�q +); + +690 #i�de� +OPENSSL_NO_RSA + + +691 +RSA + * +d2i_RSAPriv�eKey_� +( +FILE + * +� +,RSA ** +r� +); + +692 +i2d_RSAPriv�eKey_� +( +FILE + * +� +, +RSA + * +r� +); + +693 +RSA + * +d2i_RSAPublicKey_� +( +FILE + * +� +,RSA ** +r� +); + +694 +i2d_RSAPublicKey_� +( +FILE + * +� +, +RSA + * +r� +); + +695 +RSA + * +d2i_RSA_PUBKEY_� +( +FILE + * +� +,RSA ** +r� +); + +696 +i2d_RSA_PUBKEY_� +( +FILE + * +� +, +RSA + * +r� +); + +698 #i�de� +OPENSSL_NO_DSA + + +699 +DSA + * +d2i_DSA_PUBKEY_� +( +FILE + * +� +, DSA ** +d� +); + +700 +i2d_DSA_PUBKEY_� +( +FILE + * +� +, +DSA + * +d� +); + +701 +DSA + * +d2i_DSAPriv�eKey_� +( +FILE + * +� +, DSA ** +d� +); + +702 +i2d_DSAPriv�eKey_� +( +FILE + * +� +, +DSA + * +d� +); + +704 #i�de� +OPENSSL_NO_EC + + +705 +EC_KEY + * +d2i_EC_PUBKEY_� +( +FILE + * +� +, EC_KEY ** +eckey +); + +706 +i2d_EC_PUBKEY_� +( +FILE + * +� +, +EC_KEY + * +eckey +); + +707 +EC_KEY + * +d2i_ECPriv�eKey_� +( +FILE + * +� +, EC_KEY ** +eckey +); + +708 +i2d_ECPriv�eKey_� +( +FILE + * +� +, +EC_KEY + * +eckey +); + +710 +X509_SIG + * +d2i_PKCS8_� +( +FILE + * +� +,X509_SIG ** +p8 +); + +711 +i2d_PKCS8_� +( +FILE + * +� +, +X509_SIG + * +p8 +); + +712 +PKCS8_PRIV_KEY_INFO + * +d2i_PKCS8_PRIV_KEY_INFO_� +( +FILE + * +� +, + +713 +PKCS8_PRIV_KEY_INFO + ** +p8�f +); + +714 +i2d_PKCS8_PRIV_KEY_INFO_� +( +FILE + * +� +, +PKCS8_PRIV_KEY_INFO + * +p8�f +); + +715 +i2d_PKCS8Priv�eKeyInfo_� +( +FILE + * +� +, +EVP_PKEY + * +key +); + +716 +i2d_Priv�eKey_� +( +FILE + * +� +, +EVP_PKEY + * +pkey +); + +717 +EVP_PKEY + * +d2i_Priv�eKey_� +( +FILE + * +� +, EVP_PKEY ** +a +); + +718 +i2d_PUBKEY_� +( +FILE + * +� +, +EVP_PKEY + * +pkey +); + +719 +EVP_PKEY + * +d2i_PUBKEY_� +( +FILE + * +� +, EVP_PKEY ** +a +); + +722 #i�de� +OPENSSL_NO_BIO + + +723 +X509 + * +d2i_X509_bio +( +BIO + * +bp +,X509 ** +x509 +); + +724 +i2d_X509_bio +( +BIO + * +bp +, +X509 + * +x509 +); + +725 +X509_CRL + * +d2i_X509_CRL_bio +( +BIO + * +bp +,X509_CRL ** +�l +); + +726 +i2d_X509_CRL_bio +( +BIO + * +bp +, +X509_CRL + * +�l +); + +727 +X509_REQ + * +d2i_X509_REQ_bio +( +BIO + * +bp +,X509_REQ ** +�q +); + +728 +i2d_X509_REQ_bio +( +BIO + * +bp +, +X509_REQ + * +�q +); + +729 #i�de� +OPENSSL_NO_RSA + + +730 +RSA + * +d2i_RSAPriv�eKey_bio +( +BIO + * +bp +,RSA ** +r� +); + +731 +i2d_RSAPriv�eKey_bio +( +BIO + * +bp +, +RSA + * +r� +); + +732 +RSA + * +d2i_RSAPublicKey_bio +( +BIO + * +bp +,RSA ** +r� +); + +733 +i2d_RSAPublicKey_bio +( +BIO + * +bp +, +RSA + * +r� +); + +734 +RSA + * +d2i_RSA_PUBKEY_bio +( +BIO + * +bp +,RSA ** +r� +); + +735 +i2d_RSA_PUBKEY_bio +( +BIO + * +bp +, +RSA + * +r� +); + +737 #i�de� +OPENSSL_NO_DSA + + +738 +DSA + * +d2i_DSA_PUBKEY_bio +( +BIO + * +bp +, DSA ** +d� +); + +739 +i2d_DSA_PUBKEY_bio +( +BIO + * +bp +, +DSA + * +d� +); + +740 +DSA + * +d2i_DSAPriv�eKey_bio +( +BIO + * +bp +, DSA ** +d� +); + +741 +i2d_DSAPriv�eKey_bio +( +BIO + * +bp +, +DSA + * +d� +); + +743 #i�de� +OPENSSL_NO_EC + + +744 +EC_KEY + * +d2i_EC_PUBKEY_bio +( +BIO + * +bp +, EC_KEY ** +eckey +); + +745 +i2d_EC_PUBKEY_bio +( +BIO + * +bp +, +EC_KEY + * +eckey +); + +746 +EC_KEY + * +d2i_ECPriv�eKey_bio +( +BIO + * +bp +, EC_KEY ** +eckey +); + +747 +i2d_ECPriv�eKey_bio +( +BIO + * +bp +, +EC_KEY + * +eckey +); + +749 +X509_SIG + * +d2i_PKCS8_bio +( +BIO + * +bp +,X509_SIG ** +p8 +); + +750 +i2d_PKCS8_bio +( +BIO + * +bp +, +X509_SIG + * +p8 +); + +751 +PKCS8_PRIV_KEY_INFO + * +d2i_PKCS8_PRIV_KEY_INFO_bio +( +BIO + * +bp +, + +752 +PKCS8_PRIV_KEY_INFO + ** +p8�f +); + +753 +i2d_PKCS8_PRIV_KEY_INFO_bio +( +BIO + * +bp +, +PKCS8_PRIV_KEY_INFO + * +p8�f +); + +754 +i2d_PKCS8Priv�eKeyInfo_bio +( +BIO + * +bp +, +EVP_PKEY + * +key +); + +755 +i2d_Priv�eKey_bio +( +BIO + * +bp +, +EVP_PKEY + * +pkey +); + +756 +EVP_PKEY + * +d2i_Priv�eKey_bio +( +BIO + * +bp +, EVP_PKEY ** +a +); + +757 +i2d_PUBKEY_bio +( +BIO + * +bp +, +EVP_PKEY + * +pkey +); + +758 +EVP_PKEY + * +d2i_PUBKEY_bio +( +BIO + * +bp +, EVP_PKEY ** +a +); + +761 +X509 + * +X509_dup +(X509 * +x509 +); + +762 +X509_ATTRIBUTE + * +X509_ATTRIBUTE_dup +(X509_ATTRIBUTE * +xa +); + +763 +X509_EXTENSION + * +X509_EXTENSION_dup +(X509_EXTENSION * +ex +); + +764 +X509_CRL + * +X509_CRL_dup +(X509_CRL * +�l +); + +765 +X509_REQ + * +X509_REQ_dup +(X509_REQ * +�q +); + +766 +X509_ALGOR + * +X509_ALGOR_dup +(X509_ALGOR * +xn +); + +767 +X509_ALGOR_�t0 +( +X509_ALGOR + * +�g +, +ASN1_OBJECT + * +aobj +, +�y� +, * +pv� +); + +768 +X509_ALGOR_g�0 +( +ASN1_OBJECT + ** +�obj +, * +�ty� +, ** +�v� +, + +769 +X509_ALGOR + * +�g� +); + +770 +X509_ALGOR_�t_md +( +X509_ALGOR + * +�g +, cڡ +EVP_MD + * +md +); + +771 +X509_ALGOR_cmp +(cڡ +X509_ALGOR + * +a +, cڡ X509_ALGOR * +b +); + +773 +X509_NAME + * +X509_NAME_dup +(X509_NAME * +xn +); + +774 +X509_NAME_ENTRY + * +X509_NAME_ENTRY_dup +(X509_NAME_ENTRY * +� +); + +776 +X509_cmp_time +(cڡ +ASN1_TIME + * +s +, +time_t + * +t +); + +777 +X509_cmp_cu��t_time +(cڡ +ASN1_TIME + * +s +); + +778 +ASN1_TIME + * +X509_time_adj +(ASN1_TIME * +s +, +adj +, +time_t + * +t +); + +779 +ASN1_TIME + * +X509_time_adj_ex +(ASN1_TIME * +s +, + +780 +off�t_day +, +off�t_�c +, +time_t + * +t +); + +781 +ASN1_TIME + * +X509_gmtime_adj +(ASN1_TIME * +s +, +adj +); + +783 cڡ * +X509_g�_de�u�_��_�� +(); + +784 cڡ * +X509_g�_de�u�_��_d� +(); + +785 cڡ * +X509_g�_de�u�_��_f�e +(); + +786 cڡ * +X509_g�_de�u�_��_d�_�v +(); + +787 cڡ * +X509_g�_de�u�_��_f�e_�v +(); + +788 cڡ * +X509_g�_de�u�_�iv�e_d� +(); + +790 +X509_REQ + * +X509_to_X509_REQ +( +X509 + * +x +, +EVP_PKEY + * +pkey +, cڡ +EVP_MD + * +md +); + +791 +X509 + * +X509_REQ_to_X509 +( +X509_REQ + * +r +, +days +, +EVP_PKEY + * +pkey +); + +793 +DECLARE_ASN1_FUNCTIONS +( +X509_ALGOR +) + +794 +DECLARE_ASN1_ENCODE_FUNCTIONS +( +X509_ALGORS +, X509_ALGORS, X509_ALGORS) + +795 +DECLARE_ASN1_FUNCTIONS +( +X509_VAL +) + +797 +DECLARE_ASN1_FUNCTIONS +( +X509_PUBKEY +) + +799 +X509_PUBKEY_�t +( +X509_PUBKEY + ** +x +, +EVP_PKEY + * +pkey +); + +800 +EVP_PKEY + * +X509_PUBKEY_g� +( +X509_PUBKEY + * +key +); + +801 +X509_g�_pubkey_��m��s +( +EVP_PKEY + * +pkey +, + +802 +STACK_OF +( +X509 +�* +cha� +); + +803 +i2d_PUBKEY +( +EVP_PKEY + * +a +,** +� +); + +804 +EVP_PKEY + * +d2i_PUBKEY +(EVP_PKEY ** +a +,cڡ ** +� +, + +805 +�ngth +); + +806 #i�de� +OPENSSL_NO_RSA + + +807 +i2d_RSA_PUBKEY +( +RSA + * +a +,** +� +); + +808 +RSA + * +d2i_RSA_PUBKEY +(RSA ** +a +,cڡ ** +� +, + +809 +�ngth +); + +811 #i�de� +OPENSSL_NO_DSA + + +812 +i2d_DSA_PUBKEY +( +DSA + * +a +,** +� +); + +813 +DSA + * +d2i_DSA_PUBKEY +(DSA ** +a +,cڡ ** +� +, + +814 +�ngth +); + +816 #i�de� +OPENSSL_NO_EC + + +817 +i2d_EC_PUBKEY +( +EC_KEY + * +a +, ** +� +); + +818 +EC_KEY + * +d2i_EC_PUBKEY +(EC_KEY ** +a +, cڡ ** +� +, + +819 +�ngth +); + +822 +DECLARE_ASN1_FUNCTIONS +( +X509_SIG +) + +823 +DECLARE_ASN1_FUNCTIONS +( +X509_REQ_INFO +) + +824 +DECLARE_ASN1_FUNCTIONS +( +X509_REQ +) + +826 +DECLARE_ASN1_FUNCTIONS +( +X509_ATTRIBUTE +) + +827 +X509_ATTRIBUTE + * +X509_ATTRIBUTE_��� +( +nid +, +��y� +, * +v�ue +); + +829 +DECLARE_ASN1_FUNCTIONS +( +X509_EXTENSION +) + +830 +DECLARE_ASN1_ENCODE_FUNCTIONS +( +X509_EXTENSIONS +, X509_EXTENSIONS, X509_EXTENSIONS) + +832 +DECLARE_ASN1_FUNCTIONS +( +X509_NAME_ENTRY +) + +834 +DECLARE_ASN1_FUNCTIONS +( +X509_NAME +) + +836 +X509_NAME_�t +( +X509_NAME + ** +xn +, X509_NAME * +�me +); + +838 +DECLARE_ASN1_FUNCTIONS +( +X509_CINF +) + +840 +DECLARE_ASN1_FUNCTIONS +( +X509 +) + +841 +DECLARE_ASN1_FUNCTIONS +( +X509_CERT_AUX +) + +843 +DECLARE_ASN1_FUNCTIONS +( +X509_CERT_PAIR +) + +845 +X509_g�_ex_�w_�dex +( +�gl +, * +�gp +, +CRYPTO_EX_�w + * +�w_func +, + +846 +CRYPTO_EX_dup + * +dup_func +, +CRYPTO_EX_� + * +�_func +); + +847 +X509_�t_ex_d�a +( +X509 + * +r +, +idx +, * +�g +); + +848 * +X509_g�_ex_d�a +( +X509 + * +r +, +idx +); + +849 +i2d_X509_AUX +( +X509 + * +a +,** +� +); + +850 +X509 + * +d2i_X509_AUX +(X509 ** +a +,cڡ ** +� +, +�ngth +); + +852 +X509_��s_�t1 +( +X509 + * +x +, * +�me +, +�n +); + +853 +X509_keyid_�t1 +( +X509 + * +x +, * +id +, +�n +); + +854 * +X509_��s_g�0 +( +X509 + * +x +, * +�n +); + +855 * +X509_keyid_g�0 +( +X509 + * +x +, * +�n +); + +856 (* +X509_TRUST_�t_de�u� +((* +�u� +)(, +X509 + *, )))(, X509 *, ); + +857 +X509_TRUST_�t +(* +t +, +�u� +); + +858 +X509_add1_�u�_obje� +( +X509 + * +x +, +ASN1_OBJECT + * +obj +); + +859 +X509_add1_�je�_obje� +( +X509 + * +x +, +ASN1_OBJECT + * +obj +); + +860 +X509_�u�_��r +( +X509 + * +x +); + +861 +X509_�je�_��r +( +X509 + * +x +); + +863 +DECLARE_ASN1_FUNCTIONS +( +X509_REVOKED +) + +864 +DECLARE_ASN1_FUNCTIONS +( +X509_CRL_INFO +) + +865 +DECLARE_ASN1_FUNCTIONS +( +X509_CRL +) + +867 +X509_CRL_add0_�voked +( +X509_CRL + * +�l +, +X509_REVOKED + * +�v +); + +868 +X509_CRL_g�0_by_�r�l +( +X509_CRL + * +�l +, + +869 +X509_REVOKED + ** +�t +, +ASN1_INTEGER + * +�r�l +); + +870 +X509_CRL_g�0_by_�� +( +X509_CRL + * +�l +, +X509_REVOKED + ** +�t +, +X509 + * +x +); + +872 +X509_PKEY + * +X509_PKEY_�w +(); + +873 +X509_PKEY_� +( +X509_PKEY + * +a +); + +874 +i2d_X509_PKEY +( +X509_PKEY + * +a +,** +� +); + +875 +X509_PKEY + * +d2i_X509_PKEY +(X509_PKEY ** +a +,cڡ ** +� +, +�ngth +); + +877 +DECLARE_ASN1_FUNCTIONS +( +NETSCAPE_SPKI +) + +878 +DECLARE_ASN1_FUNCTIONS +( +NETSCAPE_SPKAC +) + +879 +DECLARE_ASN1_FUNCTIONS +( +NETSCAPE_CERT_SEQUENCE +) + +881 #i�de� +OPENSSL_NO_EVP + + +882 +X509_INFO + * +X509_INFO_�w +(); + +883 +X509_INFO_� +( +X509_INFO + * +a +); + +884 * +X509_NAME_ږ�e +( +X509_NAME + * +a +,* +buf +, +size +); + +886 +ASN1_v�ify +( +i2d_of_void + * +i2d +, +X509_ALGOR + * +�g�1 +, + +887 +ASN1_BIT_STRING + * +sig�tu� +,* +d�a +, +EVP_PKEY + * +pkey +); + +889 +ASN1_dige� +( +i2d_of_void + * +i2d +,cڡ +EVP_MD + * +ty� +,* +d�a +, + +890 * +md +,* +�n +); + +892 +ASN1_sign +( +i2d_of_void + * +i2d +, +X509_ALGOR + * +�g�1 +, + +893 +X509_ALGOR + * +�g�2 +, +ASN1_BIT_STRING + * +sig�tu� +, + +894 * +d�a +, +EVP_PKEY + * +pkey +, cڡ +EVP_MD + * +ty� +); + +896 +ASN1_�em_dige� +(cڡ +ASN1_ITEM + * +� +,cڡ +EVP_MD + * +ty� +,* +d�a +, + +897 * +md +,* +�n +); + +899 +ASN1_�em_v�ify +(cڡ +ASN1_ITEM + * +� +, +X509_ALGOR + * +�g�1 +, + +900 +ASN1_BIT_STRING + * +sig�tu� +,* +d�a +, +EVP_PKEY + * +pkey +); + +902 +ASN1_�em_sign +(cڡ +ASN1_ITEM + * +� +, +X509_ALGOR + * +�g�1 +, X509_ALGOR * +�g�2 +, + +903 +ASN1_BIT_STRING + * +sig�tu� +, + +904 * +d�a +, +EVP_PKEY + * +pkey +, cڡ +EVP_MD + * +ty� +); + +905 +ASN1_�em_sign_�x +(cڡ +ASN1_ITEM + * +� +, + +906 +X509_ALGOR + * +�g�1 +, X509_ALGOR * +�g�2 +, + +907 +ASN1_BIT_STRING + * +sig�tu� +, * +a� +, +EVP_MD_CTX + * +�x +); + +910 +X509_�t_v�si� +( +X509 + * +x +, +v�si� +); + +911 +X509_�t_�r�lNumb� +( +X509 + * +x +, +ASN1_INTEGER + * +�r�l +); + +912 +ASN1_INTEGER + * +X509_g�_�r�lNumb� +( +X509 + * +x +); + +913 +X509_�t_issu�_�me +( +X509 + * +x +, +X509_NAME + * +�me +); + +914 +X509_NAME + * +X509_g�_issu�_�me +( +X509 + * +a +); + +915 +X509_�t_subje�_�me +( +X509 + * +x +, +X509_NAME + * +�me +); + +916 +X509_NAME + * +X509_g�_subje�_�me +( +X509 + * +a +); + +917 +X509_�t_n�Bef�e +( +X509 + * +x +, cڡ +ASN1_TIME + * +tm +); + +918 +X509_�t_n�A� +( +X509 + * +x +, cڡ +ASN1_TIME + * +tm +); + +919 +X509_�t_pubkey +( +X509 + * +x +, +EVP_PKEY + * +pkey +); + +920 +EVP_PKEY + * +X509_g�_pubkey +( +X509 + * +x +); + +921 +ASN1_BIT_STRING + * +X509_g�0_pubkey_b��r +(cڡ +X509 + * +x +); + +922 +X509_��ifi��_ty� +( +X509 + * +x +, +EVP_PKEY + * +pubkey + ); + +924 +X509_REQ_�t_v�si� +( +X509_REQ + * +x +, +v�si� +); + +925 +X509_REQ_�t_subje�_�me +( +X509_REQ + * +�q +, +X509_NAME + * +�me +); + +926 +X509_REQ_�t_pubkey +( +X509_REQ + * +x +, +EVP_PKEY + * +pkey +); + +927 +EVP_PKEY + * +X509_REQ_g�_pubkey +( +X509_REQ + * +�q +); + +928 +X509_REQ_ex�nsi�_nid +( +nid +); + +929 * +X509_REQ_g�_ex�nsi�_nids +(); + +930 +X509_REQ_�t_ex�nsi�_nids +(* +nids +); + +931 +STACK_OF +( +X509_EXTENSION +�* +X509_REQ_g�_ex�nsi�s +( +X509_REQ + * +�q +); + +932 +X509_REQ_add_ex�nsi�s_nid +( +X509_REQ + * +�q +, +STACK_OF +( +X509_EXTENSION +�* +exts +, + +933 +nid +); + +934 +X509_REQ_add_ex�nsi�s +( +X509_REQ + * +�q +, +STACK_OF +( +X509_EXTENSION +�* +exts +); + +935 +X509_REQ_g�_��_cou� +(cڡ +X509_REQ + * +�q +); + +936 +X509_REQ_g�_��_by_NID +(cڡ +X509_REQ + * +�q +, +nid +, + +937 +ϡpos +); + +938 +X509_REQ_g�_��_by_OBJ +(cڡ +X509_REQ + * +�q +, +ASN1_OBJECT + * +obj +, + +939 +ϡpos +); + +940 +X509_ATTRIBUTE + * +X509_REQ_g�_�� +(cڡ +X509_REQ + * +�q +, +loc +); + +941 +X509_ATTRIBUTE + * +X509_REQ_d��e_�� +( +X509_REQ + * +�q +, +loc +); + +942 +X509_REQ_add1_�� +( +X509_REQ + * +�q +, +X509_ATTRIBUTE + * +�� +); + +943 +X509_REQ_add1_��_by_OBJ +( +X509_REQ + * +�q +, + +944 cڡ +ASN1_OBJECT + * +obj +, +ty� +, + +945 cڡ * +by�s +, +�n +); + +946 +X509_REQ_add1_��_by_NID +( +X509_REQ + * +�q +, + +947 +nid +, +ty� +, + +948 cڡ * +by�s +, +�n +); + +949 +X509_REQ_add1_��_by_txt +( +X509_REQ + * +�q +, + +950 cڡ * +���me +, +ty� +, + +951 cڡ * +by�s +, +�n +); + +953 +X509_CRL_�t_v�si� +( +X509_CRL + * +x +, +v�si� +); + +954 +X509_CRL_�t_issu�_�me +( +X509_CRL + * +x +, +X509_NAME + * +�me +); + +955 +X509_CRL_�t_ϡUpd�e +( +X509_CRL + * +x +, cڡ +ASN1_TIME + * +tm +); + +956 +X509_CRL_�t_�xtUpd�e +( +X509_CRL + * +x +, cڡ +ASN1_TIME + * +tm +); + +957 +X509_CRL_s�t +( +X509_CRL + * +�l +); + +959 +X509_REVOKED_�t_�r�lNumb� +( +X509_REVOKED + * +x +, +ASN1_INTEGER + * +�r�l +); + +960 +X509_REVOKED_�t_�vo�ti�D�e +( +X509_REVOKED + * +r +, +ASN1_TIME + * +tm +); + +962 +X509_REQ_check_�iv�e_key +( +X509_REQ + * +x509 +, +EVP_PKEY + * +pkey +); + +964 +X509_check_�iv�e_key +( +X509 + * +x509 +, +EVP_PKEY + * +pkey +); + +966 +X509_issu�_�d_�r�l_cmp +(cڡ +X509 + * +a +, cڡ X509 * +b +); + +967 +X509_issu�_�d_�r�l_hash +( +X509 + * +a +); + +969 +X509_issu�_�me_cmp +(cڡ +X509 + * +a +, cڡ X509 * +b +); + +970 +X509_issu�_�me_hash +( +X509 + * +a +); + +972 +X509_subje�_�me_cmp +(cڡ +X509 + * +a +, cڡ X509 * +b +); + +973 +X509_subje�_�me_hash +( +X509 + * +x +); + +975 #i�de� +OPENSSL_NO_MD5 + + +976 +X509_issu�_�me_hash_�d +( +X509 + * +a +); + +977 +X509_subje�_�me_hash_�d +( +X509 + * +x +); + +980 +X509_cmp +(cڡ +X509 + * +a +, cڡ X509 * +b +); + +981 +X509_NAME_cmp +(cڡ +X509_NAME + * +a +, cڡ X509_NAME * +b +); + +982 +X509_NAME_hash +( +X509_NAME + * +x +); + +983 +X509_NAME_hash_�d +( +X509_NAME + * +x +); + +985 +X509_CRL_cmp +(cڡ +X509_CRL + * +a +, cڡ X509_CRL * +b +); + +986 +X509_CRL_m�ch +(cڡ +X509_CRL + * +a +, cڡ X509_CRL * +b +); + +987 #i�de� +OPENSSL_NO_FP_API + + +988 +X509_��t_ex_� +( +FILE + * +bp +, +X509 + * +x +, +nm�ag +, +c�ag +); + +989 +X509_��t_� +( +FILE + * +bp +, +X509 + * +x +); + +990 +X509_CRL_��t_� +( +FILE + * +bp +, +X509_CRL + * +x +); + +991 +X509_REQ_��t_� +( +FILE + * +bp +, +X509_REQ + * +�q +); + +992 +X509_NAME_��t_ex_� +( +FILE + * +� +, +X509_NAME + * +nm +, +�d�t +, +�ags +); + +995 #i�de� +OPENSSL_NO_BIO + + +996 +X509_NAME_��t +( +BIO + * +bp +, +X509_NAME + * +�me +, +oba� +); + +997 +X509_NAME_��t_ex +( +BIO + * +out +, +X509_NAME + * +nm +, +�d�t +, +�ags +); + +998 +X509_��t_ex +( +BIO + * +bp +, +X509 + * +x +, +nm�ag +, +c�ag +); + +999 +X509_��t +( +BIO + * +bp +, +X509 + * +x +); + +1000 +X509_oc�id_��t +( +BIO + * +bp +, +X509 + * +x +); + +1001 +X509_CERT_AUX_��t +( +BIO + * +bp +, +X509_CERT_AUX + * +x +, +�d�t +); + +1002 +X509_CRL_��t +( +BIO + * +bp +, +X509_CRL + * +x +); + +1003 +X509_REQ_��t_ex +( +BIO + * +bp +, +X509_REQ + * +x +, +nm�ag +, +c�ag +); + +1004 +X509_REQ_��t +( +BIO + * +bp +, +X509_REQ + * +�q +); + +1007 +X509_NAME_��y_cou� +( +X509_NAME + * +�me +); + +1008 +X509_NAME_g�_�xt_by_NID +( +X509_NAME + * +�me +, +nid +, + +1009 * +buf +, +�n +); + +1010 +X509_NAME_g�_�xt_by_OBJ +( +X509_NAME + * +�me +, +ASN1_OBJECT + * +obj +, + +1011 * +buf +, +�n +); + +1015 +X509_NAME_g�_�dex_by_NID +( +X509_NAME + * +�me +, +nid +, +ϡpos +); + +1016 +X509_NAME_g�_�dex_by_OBJ +( +X509_NAME + * +�me +, +ASN1_OBJECT + * +obj +, + +1017 +ϡpos +); + +1018 +X509_NAME_ENTRY + * +X509_NAME_g�_��y +( +X509_NAME + * +�me +, +loc +); + +1019 +X509_NAME_ENTRY + * +X509_NAME_d��e_��y +( +X509_NAME + * +�me +, +loc +); + +1020 +X509_NAME_add_��y +( +X509_NAME + * +�me +, +X509_NAME_ENTRY + * +� +, + +1021 +loc +, +�t +); + +1022 +X509_NAME_add_��y_by_OBJ +( +X509_NAME + * +�me +, +ASN1_OBJECT + * +obj +, +ty� +, + +1023 * +by�s +, +�n +, +loc +, +�t +); + +1024 +X509_NAME_add_��y_by_NID +( +X509_NAME + * +�me +, +nid +, +ty� +, + +1025 * +by�s +, +�n +, +loc +, +�t +); + +1026 +X509_NAME_ENTRY + * +X509_NAME_ENTRY_���_by_txt +(X509_NAME_ENTRY ** +� +, + +1027 cڡ * +f�ld +, +ty� +, cڡ * +by�s +, +�n +); + +1028 +X509_NAME_ENTRY + * +X509_NAME_ENTRY_���_by_NID +(X509_NAME_ENTRY ** +� +, +nid +, + +1029 +ty� +,* +by�s +, +�n +); + +1030 +X509_NAME_add_��y_by_txt +( +X509_NAME + * +�me +, cڡ * +f�ld +, +ty� +, + +1031 cڡ * +by�s +, +�n +, +loc +, +�t +); + +1032 +X509_NAME_ENTRY + * +X509_NAME_ENTRY_���_by_OBJ +(X509_NAME_ENTRY ** +� +, + +1033 +ASN1_OBJECT + * +obj +, +ty� +,cڡ * +by�s +, + +1034 +�n +); + +1035 +X509_NAME_ENTRY_�t_obje� +( +X509_NAME_ENTRY + * +� +, + +1036 +ASN1_OBJECT + * +obj +); + +1037 +X509_NAME_ENTRY_�t_d�a +( +X509_NAME_ENTRY + * +� +, +ty� +, + +1038 cڡ * +by�s +, +�n +); + +1039 +ASN1_OBJECT + * +X509_NAME_ENTRY_g�_obje� +( +X509_NAME_ENTRY + * +� +); + +1040 +ASN1_STRING + * +X509_NAME_ENTRY_g�_d�a +( +X509_NAME_ENTRY + * +� +); + +1042 +X509v3_g�_ext_cou� +(cڡ +STACK_OF +( +X509_EXTENSION +�* +x +); + +1043 +X509v3_g�_ext_by_NID +(cڡ +STACK_OF +( +X509_EXTENSION +�* +x +, + +1044 +nid +, +ϡpos +); + +1045 +X509v3_g�_ext_by_OBJ +(cڡ +STACK_OF +( +X509_EXTENSION +�* +x +, + +1046 +ASN1_OBJECT + * +obj +, +ϡpos +); + +1047 +X509v3_g�_ext_by_��i�l +(cڡ +STACK_OF +( +X509_EXTENSION +�* +x +, + +1048 +�� +, +ϡpos +); + +1049 +X509_EXTENSION + * +X509v3_g�_ext +(cڡ +STACK_OF +(X509_EXTENSION�* +x +, +loc +); + +1050 +X509_EXTENSION + * +X509v3_d��e_ext +( +STACK_OF +(X509_EXTENSION�* +x +, +loc +); + +1051 +STACK_OF +( +X509_EXTENSION +�* +X509v3_add_ext +(STACK_OF(X509_EXTENSION�** +x +, + +1052 +X509_EXTENSION + * +ex +, +loc +); + +1054 +X509_g�_ext_cou� +( +X509 + * +x +); + +1055 +X509_g�_ext_by_NID +( +X509 + * +x +, +nid +, +ϡpos +); + +1056 +X509_g�_ext_by_OBJ +( +X509 + * +x +, +ASN1_OBJECT + * +obj +, +ϡpos +); + +1057 +X509_g�_ext_by_��i�l +( +X509 + * +x +, +�� +, +ϡpos +); + +1058 +X509_EXTENSION + * +X509_g�_ext +( +X509 + * +x +, +loc +); + +1059 +X509_EXTENSION + * +X509_d��e_ext +( +X509 + * +x +, +loc +); + +1060 +X509_add_ext +( +X509 + * +x +, +X509_EXTENSION + * +ex +, +loc +); + +1061 * +X509_g�_ext_d2i +( +X509 + * +x +, +nid +, * +�� +, * +idx +); + +1062 +X509_add1_ext_i2d +( +X509 + * +x +, +nid +, * +v�ue +, +�� +, + +1063 +�ags +); + +1065 +X509_CRL_g�_ext_cou� +( +X509_CRL + * +x +); + +1066 +X509_CRL_g�_ext_by_NID +( +X509_CRL + * +x +, +nid +, +ϡpos +); + +1067 +X509_CRL_g�_ext_by_OBJ +( +X509_CRL + * +x +, +ASN1_OBJECT + * +obj +, +ϡpos +); + +1068 +X509_CRL_g�_ext_by_��i�l +( +X509_CRL + * +x +, +�� +, +ϡpos +); + +1069 +X509_EXTENSION + * +X509_CRL_g�_ext +( +X509_CRL + * +x +, +loc +); + +1070 +X509_EXTENSION + * +X509_CRL_d��e_ext +( +X509_CRL + * +x +, +loc +); + +1071 +X509_CRL_add_ext +( +X509_CRL + * +x +, +X509_EXTENSION + * +ex +, +loc +); + +1072 * +X509_CRL_g�_ext_d2i +( +X509_CRL + * +x +, +nid +, * +�� +, * +idx +); + +1073 +X509_CRL_add1_ext_i2d +( +X509_CRL + * +x +, +nid +, * +v�ue +, +�� +, + +1074 +�ags +); + +1076 +X509_REVOKED_g�_ext_cou� +( +X509_REVOKED + * +x +); + +1077 +X509_REVOKED_g�_ext_by_NID +( +X509_REVOKED + * +x +, +nid +, +ϡpos +); + +1078 +X509_REVOKED_g�_ext_by_OBJ +( +X509_REVOKED + * +x +, +ASN1_OBJECT + * +obj +, +ϡpos +); + +1079 +X509_REVOKED_g�_ext_by_��i�l +( +X509_REVOKED + * +x +, +�� +, +ϡpos +); + +1080 +X509_EXTENSION + * +X509_REVOKED_g�_ext +( +X509_REVOKED + * +x +, +loc +); + +1081 +X509_EXTENSION + * +X509_REVOKED_d��e_ext +( +X509_REVOKED + * +x +, +loc +); + +1082 +X509_REVOKED_add_ext +( +X509_REVOKED + * +x +, +X509_EXTENSION + * +ex +, +loc +); + +1083 * +X509_REVOKED_g�_ext_d2i +( +X509_REVOKED + * +x +, +nid +, * +�� +, * +idx +); + +1084 +X509_REVOKED_add1_ext_i2d +( +X509_REVOKED + * +x +, +nid +, * +v�ue +, +�� +, + +1085 +�ags +); + +1087 +X509_EXTENSION + * +X509_EXTENSION_���_by_NID +(X509_EXTENSION ** +ex +, + +1088 +nid +, +�� +, +ASN1_OCTET_STRING + * +d�a +); + +1089 +X509_EXTENSION + * +X509_EXTENSION_���_by_OBJ +(X509_EXTENSION ** +ex +, + +1090 +ASN1_OBJECT + * +obj +, +�� +, +ASN1_OCTET_STRING + * +d�a +); + +1091 +X509_EXTENSION_�t_obje� +( +X509_EXTENSION + * +ex +, +ASN1_OBJECT + * +obj +); + +1092 +X509_EXTENSION_�t_��i�l +( +X509_EXTENSION + * +ex +, +�� +); + +1093 +X509_EXTENSION_�t_d�a +( +X509_EXTENSION + * +ex +, + +1094 +ASN1_OCTET_STRING + * +d�a +); + +1095 +ASN1_OBJECT + * +X509_EXTENSION_g�_obje� +( +X509_EXTENSION + * +ex +); + +1096 +ASN1_OCTET_STRING + * +X509_EXTENSION_g�_d�a +( +X509_EXTENSION + * +� +); + +1097 +X509_EXTENSION_g�_��i�l +( +X509_EXTENSION + * +ex +); + +1099 +X509�_g�_��_cou� +(cڡ +STACK_OF +( +X509_ATTRIBUTE +�* +x +); + +1100 +X509�_g�_��_by_NID +(cڡ +STACK_OF +( +X509_ATTRIBUTE +�* +x +, +nid +, + +1101 +ϡpos +); + +1102 +X509�_g�_��_by_OBJ +(cڡ +STACK_OF +( +X509_ATTRIBUTE +�* +sk +, +ASN1_OBJECT + * +obj +, + +1103 +ϡpos +); + +1104 +X509_ATTRIBUTE + * +X509�_g�_�� +(cڡ +STACK_OF +(X509_ATTRIBUTE�* +x +, +loc +); + +1105 +X509_ATTRIBUTE + * +X509�_d��e_�� +( +STACK_OF +(X509_ATTRIBUTE�* +x +, +loc +); + +1106 +STACK_OF +( +X509_ATTRIBUTE +�* +X509�_add1_�� +(STACK_OF(X509_ATTRIBUTE�** +x +, + +1107 +X509_ATTRIBUTE + * +�� +); + +1108 +STACK_OF +( +X509_ATTRIBUTE +�* +X509�_add1_��_by_OBJ +(STACK_OF(X509_ATTRIBUTE�** +x +, + +1109 cڡ +ASN1_OBJECT + * +obj +, +ty� +, + +1110 cڡ * +by�s +, +�n +); + +1111 +STACK_OF +( +X509_ATTRIBUTE +�* +X509�_add1_��_by_NID +(STACK_OF(X509_ATTRIBUTE�** +x +, + +1112 +nid +, +ty� +, + +1113 cڡ * +by�s +, +�n +); + +1114 +STACK_OF +( +X509_ATTRIBUTE +�* +X509�_add1_��_by_txt +(STACK_OF(X509_ATTRIBUTE�** +x +, + +1115 cڡ * +���me +, +ty� +, + +1116 cڡ * +by�s +, +�n +); + +1117 * +X509�_g�0_d�a_by_OBJ +( +STACK_OF +( +X509_ATTRIBUTE +�* +x +, + +1118 +ASN1_OBJECT + * +obj +, +ϡpos +, +ty� +); + +1119 +X509_ATTRIBUTE + * +X509_ATTRIBUTE_���_by_NID +(X509_ATTRIBUTE ** +�� +, +nid +, + +1120 +��y� +, cڡ * +d�a +, +�n +); + +1121 +X509_ATTRIBUTE + * +X509_ATTRIBUTE_���_by_OBJ +(X509_ATTRIBUTE ** +�� +, + +1122 cڡ +ASN1_OBJECT + * +obj +, +��y� +, cڡ * +d�a +, +�n +); + +1123 +X509_ATTRIBUTE + * +X509_ATTRIBUTE_���_by_txt +(X509_ATTRIBUTE ** +�� +, + +1124 cڡ * +��ame +, +ty� +, cڡ * +by�s +, +�n +); + +1125 +X509_ATTRIBUTE_�t1_obje� +( +X509_ATTRIBUTE + * +�� +, cڡ +ASN1_OBJECT + * +obj +); + +1126 +X509_ATTRIBUTE_�t1_d�a +( +X509_ATTRIBUTE + * +�� +, +��ty� +, cڡ * +d�a +, +�n +); + +1127 * +X509_ATTRIBUTE_g�0_d�a +( +X509_ATTRIBUTE + * +�� +, +idx +, + +1128 +��y� +, * +d�a +); + +1129 +X509_ATTRIBUTE_cou� +( +X509_ATTRIBUTE + * +�� +); + +1130 +ASN1_OBJECT + * +X509_ATTRIBUTE_g�0_obje� +( +X509_ATTRIBUTE + * +�� +); + +1131 +ASN1_TYPE + * +X509_ATTRIBUTE_g�0_ty� +( +X509_ATTRIBUTE + * +�� +, +idx +); + +1133 +EVP_PKEY_g�_��_cou� +(cڡ +EVP_PKEY + * +key +); + +1134 +EVP_PKEY_g�_��_by_NID +(cڡ +EVP_PKEY + * +key +, +nid +, + +1135 +ϡpos +); + +1136 +EVP_PKEY_g�_��_by_OBJ +(cڡ +EVP_PKEY + * +key +, +ASN1_OBJECT + * +obj +, + +1137 +ϡpos +); + +1138 +X509_ATTRIBUTE + * +EVP_PKEY_g�_�� +(cڡ +EVP_PKEY + * +key +, +loc +); + +1139 +X509_ATTRIBUTE + * +EVP_PKEY_d��e_�� +( +EVP_PKEY + * +key +, +loc +); + +1140 +EVP_PKEY_add1_�� +( +EVP_PKEY + * +key +, +X509_ATTRIBUTE + * +�� +); + +1141 +EVP_PKEY_add1_��_by_OBJ +( +EVP_PKEY + * +key +, + +1142 cڡ +ASN1_OBJECT + * +obj +, +ty� +, + +1143 cڡ * +by�s +, +�n +); + +1144 +EVP_PKEY_add1_��_by_NID +( +EVP_PKEY + * +key +, + +1145 +nid +, +ty� +, + +1146 cڡ * +by�s +, +�n +); + +1147 +EVP_PKEY_add1_��_by_txt +( +EVP_PKEY + * +key +, + +1148 cڡ * +���me +, +ty� +, + +1149 cڡ * +by�s +, +�n +); + +1151 +X509_v�ify_�� +( +X509_STORE_CTX + * +�x +); + +1154 +X509 + * +X509_f�d_by_issu�_�d_�r�l +( +STACK_OF +(X509�* +sk +, +X509_NAME + * +�me +, + +1155 +ASN1_INTEGER + * +�r�l +); + +1156 +X509 + * +X509_f�d_by_subje� +( +STACK_OF +(X509�* +sk +, +X509_NAME + * +�me +); + +1158 +DECLARE_ASN1_FUNCTIONS +( +PBEPARAM +) + +1159 +DECLARE_ASN1_FUNCTIONS +( +PBE2PARAM +) + +1160 +DECLARE_ASN1_FUNCTIONS +( +PBKDF2PARAM +) + +1162 +PKCS5_pbe_�t0_�g� +( +X509_ALGOR + * +�g� +, +�g +, +�� +, + +1163 cڡ * +�� +, +���n +); + +1165 +X509_ALGOR + * +PKCS5_pbe_�t +( +�g +, +�� +, + +1166 cڡ * +�� +, +���n +); + +1167 +X509_ALGOR + * +PKCS5_pbe2_�t +(cڡ +EVP_CIPHER + * +c�h� +, +�� +, + +1168 * +�� +, +���n +); + +1169 +X509_ALGOR + * +PKCS5_pbe2_�t_iv +(cڡ +EVP_CIPHER + * +c�h� +, +�� +, + +1170 * +�� +, +���n +, + +1171 * +aiv +, +�f_nid +); + +1173 +X509_ALGOR + * +PKCS5_pbkdf2_�t +( +�� +, * +�� +, +���n +, + +1174 +�f_nid +, +key�n +); + +1178 +DECLARE_ASN1_FUNCTIONS +( +PKCS8_PRIV_KEY_INFO +) + +1180 +EVP_PKEY + * +EVP_PKCS82PKEY +( +PKCS8_PRIV_KEY_INFO + * +p8 +); + +1181 +PKCS8_PRIV_KEY_INFO + * +EVP_PKEY2PKCS8 +( +EVP_PKEY + * +pkey +); + +1182 +PKCS8_PRIV_KEY_INFO + * +EVP_PKEY2PKCS8_brok� +( +EVP_PKEY + * +pkey +, +brok� +); + +1183 +PKCS8_PRIV_KEY_INFO + * +PKCS8_�t_brok� +(PKCS8_PRIV_KEY_INFO * +p8 +, +brok� +); + +1185 +PKCS8_pkey_�t0 +( +PKCS8_PRIV_KEY_INFO + * +�iv +, +ASN1_OBJECT + * +aobj +, + +1186 +v�si� +, +�y� +, * +pv� +, + +1187 * +�nc +, +�n�� +); + +1188 +PKCS8_pkey_g�0 +( +ASN1_OBJECT + ** +�k�g +, + +1189 cڡ ** +pk +, * +�k�n +, + +1190 +X509_ALGOR + ** +� +, + +1191 +PKCS8_PRIV_KEY_INFO + * +p8 +); + +1193 +X509_PUBKEY_�t0_��m +( +X509_PUBKEY + * +pub +, +ASN1_OBJECT + * +aobj +, + +1194 +�y� +, * +pv� +, + +1195 * +�nc +, +�n�� +); + +1196 +X509_PUBKEY_g�0_��m +( +ASN1_OBJECT + ** +�k�g +, + +1197 cڡ ** +pk +, * +�k�n +, + +1198 +X509_ALGOR + ** +� +, + +1199 +X509_PUBKEY + * +pub +); + +1201 +X509_check_�u� +( +X509 + * +x +, +id +, +�ags +); + +1202 +X509_TRUST_g�_cou� +(); + +1203 +X509_TRUST + * +X509_TRUST_g�0 +( +idx +); + +1204 +X509_TRUST_g�_by_id +( +id +); + +1205 +X509_TRUST_add +( +id +, +�ags +, (* +ck +)( +X509_TRUST + *, +X509 + *, ), + +1206 * +�me +, +�g1 +, * +�g2 +); + +1207 +X509_TRUST_��nup +(); + +1208 +X509_TRUST_g�_�ags +( +X509_TRUST + * +xp +); + +1209 * +X509_TRUST_g�0_�me +( +X509_TRUST + * +xp +); + +1210 +X509_TRUST_g�_�u� +( +X509_TRUST + * +xp +); + +1216 +ERR_l�d_X509_�r�gs +(); + +1221 + #X509_F_ADD_CERT_DIR + 100 + + ) + +1222 + #X509_F_BY_FILE_CTRL + 101 + + ) + +1223 + #X509_F_CHECK_POLICY + 145 + + ) + +1224 + #X509_F_DIR_CTRL + 102 + + ) + +1225 + #X509_F_GET_CERT_BY_SUBJECT + 103 + + ) + +1226 + #X509_F_NETSCAPE_SPKI_B64_DECODE + 129 + + ) + +1227 + #X509_F_NETSCAPE_SPKI_B64_ENCODE + 130 + + ) + +1228 + #X509_F_X509AT_ADD1_ATTR + 135 + + ) + +1229 + #X509_F_X509V3_ADD_EXT + 104 + + ) + +1230 + #X509_F_X509_ATTRIBUTE_CREATE_BY_NID + 136 + + ) + +1231 + #X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ + 137 + + ) + +1232 + #X509_F_X509_ATTRIBUTE_CREATE_BY_TXT + 140 + + ) + +1233 + #X509_F_X509_ATTRIBUTE_GET0_DATA + 139 + + ) + +1234 + #X509_F_X509_ATTRIBUTE_SET1_DATA + 138 + + ) + +1235 + #X509_F_X509_CHECK_PRIVATE_KEY + 128 + + ) + +1236 + #X509_F_X509_CRL_PRINT_FP + 147 + + ) + +1237 + #X509_F_X509_EXTENSION_CREATE_BY_NID + 108 + + ) + +1238 + #X509_F_X509_EXTENSION_CREATE_BY_OBJ + 109 + + ) + +1239 + #X509_F_X509_GET_PUBKEY_PARAMETERS + 110 + + ) + +1240 + #X509_F_X509_LOAD_CERT_CRL_FILE + 132 + + ) + +1241 + #X509_F_X509_LOAD_CERT_FILE + 111 + + ) + +1242 + #X509_F_X509_LOAD_CRL_FILE + 112 + + ) + +1243 + #X509_F_X509_NAME_ADD_ENTRY + 113 + + ) + +1244 + #X509_F_X509_NAME_ENTRY_CREATE_BY_NID + 114 + + ) + +1245 + #X509_F_X509_NAME_ENTRY_CREATE_BY_TXT + 131 + + ) + +1246 + #X509_F_X509_NAME_ENTRY_SET_OBJECT + 115 + + ) + +1247 + #X509_F_X509_NAME_ONELINE + 116 + + ) + +1248 + #X509_F_X509_NAME_PRINT + 117 + + ) + +1249 + #X509_F_X509_PRINT_EX_FP + 118 + + ) + +1250 + #X509_F_X509_PUBKEY_GET + 119 + + ) + +1251 + #X509_F_X509_PUBKEY_SET + 120 + + ) + +1252 + #X509_F_X509_REQ_CHECK_PRIVATE_KEY + 144 + + ) + +1253 + #X509_F_X509_REQ_PRINT_EX + 121 + + ) + +1254 + #X509_F_X509_REQ_PRINT_FP + 122 + + ) + +1255 + #X509_F_X509_REQ_TO_X509 + 123 + + ) + +1256 + #X509_F_X509_STORE_ADD_CERT + 124 + + ) + +1257 + #X509_F_X509_STORE_ADD_CRL + 125 + + ) + +1258 + #X509_F_X509_STORE_CTX_GET1_ISSUER + 146 + + ) + +1259 + #X509_F_X509_STORE_CTX_INIT + 143 + + ) + +1260 + #X509_F_X509_STORE_CTX_NEW + 142 + + ) + +1261 + #X509_F_X509_STORE_CTX_PURPOSE_INHERIT + 134 + + ) + +1262 + #X509_F_X509_TO_X509_REQ + 126 + + ) + +1263 + #X509_F_X509_TRUST_ADD + 133 + + ) + +1264 + #X509_F_X509_TRUST_SET + 141 + + ) + +1265 + #X509_F_X509_VERIFY_CERT + 127 + + ) + +1268 + #X509_R_BAD_X509_FILETYPE + 100 + + ) + +1269 + #X509_R_BASE64_DECODE_ERROR + 118 + + ) + +1270 + #X509_R_CANT_CHECK_DH_KEY + 114 + + ) + +1271 + #X509_R_CERT_ALREADY_IN_HASH_TABLE + 101 + + ) + +1272 + #X509_R_ERR_ASN1_LIB + 102 + + ) + +1273 + #X509_R_INVALID_DIRECTORY + 113 + + ) + +1274 + #X509_R_INVALID_FIELD_NAME + 119 + + ) + +1275 + #X509_R_INVALID_TRUST + 123 + + ) + +1276 + #X509_R_KEY_TYPE_MISMATCH + 115 + + ) + +1277 + #X509_R_KEY_VALUES_MISMATCH + 116 + + ) + +1278 + #X509_R_LOADING_CERT_DIR + 103 + + ) + +1279 + #X509_R_LOADING_DEFAULTS + 104 + + ) + +1280 + #X509_R_METHOD_NOT_SUPPORTED + 124 + + ) + +1281 + #X509_R_NO_CERT_SET_FOR_US_TO_VERIFY + 105 + + ) + +1282 + #X509_R_PUBLIC_KEY_DECODE_ERROR + 125 + + ) + +1283 + #X509_R_PUBLIC_KEY_ENCODE_ERROR + 126 + + ) + +1284 + #X509_R_SHOULD_RETRY + 106 + + ) + +1285 + #X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN + 107 + + ) + +1286 + #X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY + 108 + + ) + +1287 + #X509_R_UNKNOWN_KEY_TYPE + 117 + + ) + +1288 + #X509_R_UNKNOWN_NID + 109 + + ) + +1289 + #X509_R_UNKNOWN_PURPOSE_ID + 121 + + ) + +1290 + #X509_R_UNKNOWN_TRUST_ID + 120 + + ) + +1291 + #X509_R_UNSUPPORTED_ALGORITHM + 111 + + ) + +1292 + #X509_R_WRONG_LOOKUP_TYPE + 112 + + ) + +1293 + #X509_R_WRONG_TYPE + 122 + + ) + +1295 #ifde� +__�lu�lus + + + @/usr/include/rpc/netdb.h + +36 #i�de� +_RPC_NETDB_H + + +37 + #_RPC_NETDB_H + 1 + + ) + +39 + ~<�u�s.h +> + +41 + #__�ed_size_t + + + ) + +42 + ~<�ddef.h +> + +44 +__BEGIN_DECLS + + +46 + s��� + + +48 * + mr_�me +; + +49 ** + mr_���s +; + +50 + mr_numb� +; + +53 + $��p�� + ( +__�ayݒ +� +__THROW +; + +54 + $�d��� + (� +__THROW +; + +55 +��� + * + $g��cby�me + (cڡ * +__�me +� +__THROW +; + +56 +��� + * + $g��cbynumb� + ( +__numb� +� +__THROW +; + +57 +��� + * + $g���� + (� +__THROW +; + +59 #ifde� +__USE_MISC + + +60 + $g��cby�me_r + (cڡ * +__�me +, +��� + * +__�su�_buf +, + +61 * +__buf�r +, +size_t + +__bu� +, + +62 +��� + ** +__�su� +� +__THROW +; + +64 + $g��cbynumb�_r + ( +__numb� +, +��� + * +__�su�_buf +, + +65 * +__buf�r +, +size_t + +__bu� +, + +66 +��� + ** +__�su� +� +__THROW +; + +68 + $g����_r + ( +��� + * +__�su�_buf +, * +__buf�r +, + +69 +size_t + +__bu� +, +��� + ** +__�su� +� +__THROW +; + +72 +__END_DECLS + + + @/usr/include/sched.h + +19 #i�def +_SCHED_H + + +20 + #_SCHED_H + 1 + + ) + +22 + ~<�u�s.h +> + +25 + ~<b�s/ty�s.h +> + +27 + #__�ed_size_t + + + ) + +28 + ~<�ddef.h +> + +30 + #__�ed_time_t + + + ) + +31 + #__�ed_time�ec + + + ) + +32 + ~<time.h +> + +34 #i�de� +__pid_t_def�ed + + +35 +__pid_t + + tpid_t +; + +36 + #__pid_t_def�ed + + + ) + +41 + ~<b�s/sched.h +> + +43 + #sched_�iܙy + +__sched_�iܙy + + + ) + +46 +__BEGIN_DECLS + + +49 + $sched_���am + ( +__pid_t + +__pid +, cڡ +sched_��m + * +__��m +) + +50 +__THROW +; + +53 + $sched_g���m + ( +__pid_t + +__pid +, +sched_��m + * +__��m +� +__THROW +; + +56 + $sched_�tschedu�r + ( +__pid_t + +__pid +, +__p�icy +, + +57 cڡ +sched_��m + * +__��m +� +__THROW +; + +60 + $sched_g�schedu�r + ( +__pid_t + +__pid +� +__THROW +; + +63 + $sched_y�ld + (� +__THROW +; + +66 + $sched_g�_�iܙy_max + ( +__�gܙhm +� +__THROW +; + +69 + $sched_g�_�iܙy_m� + ( +__�gܙhm +� +__THROW +; + +72 + $sched_�_g�_��rv� + ( +__pid_t + +__pid +, +time�ec + * +__t +� +__THROW +; + +75 #ifde� +__USE_GNU + + +77 + #CPU_SETSIZE + +__CPU_SETSIZE + + + ) + +78 + #CPU_SET +( +�u +, +�u�� +� + `__CPU_SET_S + (�u, ( +�u_�t_t +), cpu��) + + ) + +79 + #CPU_CLR +( +�u +, +�u�� +� + `__CPU_CLR_S + (�u, ( +�u_�t_t +), cpu��) + + ) + +80 + #CPU_ISSET +( +�u +, +�u�� +� + `__CPU_ISSET_S + (�u, ( +�u_�t_t +), \ + +81 +�u�� +) + + ) + +82 + #CPU_ZERO +( +�u�� +� + `__CPU_ZERO_S + ( ( +�u_�t_t +), cpu��) + + ) + +83 + #CPU_COUNT +( +�u�� +� + `__CPU_COUNT_S + ( ( +�u_�t_t +), cpu��) + + ) + +85 + #CPU_SET_S +( +�u +, +�tsize +, +�u�� +� + `__CPU_SET_S + (�u, s�size, cpu��) + + ) + +86 + #CPU_CLR_S +( +�u +, +�tsize +, +�u�� +� + `__CPU_CLR_S + (�u, s�size, cpu��) + + ) + +87 + #CPU_ISSET_S +( +�u +, +�tsize +, +�u�� +� + `__CPU_ISSET_S + (cpu, setsize, \ + +88 +�u�� +) + + ) + +89 + #CPU_ZERO_S +( +�tsize +, +�u�� +� + `__CPU_ZERO_S + (�tsize, cpu��) + + ) + +90 + #CPU_COUNT_S +( +�tsize +, +�u�� +� + `__CPU_COUNT_S + (�tsize, cpu��) + + ) + +92 + #CPU_EQUAL +( +�u��1 +, +�u��2 +) \ + +93 + `__CPU_EQUAL_S + ( ( +�u_�t_t +), +�u��1 +, +�u��2 +) + + ) + +94 + #CPU_EQUAL_S +( +�tsize +, +�u��1 +, +�u��2 +) \ + +95 + `__CPU_EQUAL_S + ( +�tsize +, +�u��1 +, +�u��2 +) + + ) + +97 + #CPU_AND +( +de��t +, +�c�t1 +, +�c�t2 +) \ + +98 + `__CPU_OP_S + ( ( +�u_�t_t +), +de��t +, +�c�t1 +, +�c�t2 +, &) + + ) + +99 + #CPU_OR +( +de��t +, +�c�t1 +, +�c�t2 +) \ + +100 + `__CPU_OP_S + ( ( +�u_�t_t +), +de��t +, +�c�t1 +, +�c�t2 +, |) + + ) + +101 + #CPU_XOR +( +de��t +, +�c�t1 +, +�c�t2 +) \ + +102 + `__CPU_OP_S + ( ( +�u_�t_t +), +de��t +, +�c�t1 +, +�c�t2 +, ^) + + ) + +103 + #CPU_AND_S +( +�tsize +, +de��t +, +�c�t1 +, +�c�t2 +) \ + +104 + `__CPU_OP_S + ( +�tsize +, +de��t +, +�c�t1 +, +�c�t2 +, &) + + ) + +105 + #CPU_OR_S +( +�tsize +, +de��t +, +�c�t1 +, +�c�t2 +) \ + +106 + `__CPU_OP_S + ( +�tsize +, +de��t +, +�c�t1 +, +�c�t2 +, |) + + ) + +107 + #CPU_XOR_S +( +�tsize +, +de��t +, +�c�t1 +, +�c�t2 +) \ + +108 + `__CPU_OP_S + ( +�tsize +, +de��t +, +�c�t1 +, +�c�t2 +, ^) + + ) + +110 + #CPU_ALLOC_SIZE +( +cou� +� + `__CPU_ALLOC_SIZE + (cou�) + + ) + +111 + #CPU_ALLOC +( +cou� +� + `__CPU_ALLOC + (cou�) + + ) + +112 + #CPU_FREE +( +�u�t +� + `__CPU_FREE + (�u�t) + + ) + +116 + $sched_��ff��y + ( +__pid_t + +__pid +, +size_t + +__�u�tsize +, + +117 cڡ +�u_�t_t + * +__�u�t +� +__THROW +; + +120 + $sched_g�aff��y + ( +__pid_t + +__pid +, +size_t + +__�u�tsize +, + +121 +�u_�t_t + * +__�u�t +� +__THROW +; + +124 +__END_DECLS + + + @/usr/include/sys/bitypes.h + +3 + ~<sys/ty�s.h +> + + @/usr/include/sys/cdefs.h + +18 #i�def +_SYS_CDEFS_H + + +19 + #_SYS_CDEFS_H + 1 + + ) + +22 #i�de� +_FEATURES_H + + +23 + ~<�u�s.h +> + +29 #i� +def�ed + +__GNUC__ + && !def�ed +__STDC__ + + +34 #unde� +__P + + +35 #unde� +__PMT + + +37 #ifde� +__GNUC__ + + +41 #i� +__GNUC_PREREQ + (4, 6�&& ! +def�ed + +_LIBC + + +42 + #__LEAF + , +__�af__ + + + ) + +43 + #__LEAF_ATTR + + `__��ibu�__ + (( +__�af__ +)) + + ) + +45 + #__LEAF + + + ) + +46 + #__LEAF_ATTR + + + ) + +54 #i�! +def�ed + +__�lu�lus + && +__GNUC_PREREQ + (3, 3) + +55 + #__THROW + + `__��ibu�__ + (( +__n�hrow__ + +__LEAF +)) + + ) + +56 + #__THROWNL + + `__��ibu�__ + (( +__n�hrow__ +)) + + ) + +57 + #__NTH +( +f� +� + `__��ibu�__ + (( +__n�hrow__ + +__LEAF +)� + ) +fct + +59 #i� +def�ed + +__�lu�lus + && +__GNUC_PREREQ + (2,8) + +60 + #__THROW + + `throw + () + + ) + +61 + #__THROWNL + + `throw + () + + ) + +62 + #__NTH +( +f� +� +__LEAF_ATTR + f� + `throw + () + + ) + +64 + #__THROW + + + ) + +65 + #__THROWNL + + + ) + +66 + #__NTH +( +f� +� + ) +fct + +72 + #__�l�e + + + ) + +74 + #__THROW + + + ) + +75 + #__THROWNL + + + ) + +76 + #__NTH +( +f� +� + ) +fct + +82 + #__P +( +�gs +� + ) +args + +83 + #__PMT +( +�gs +� + ) +args + +88 + #__CONCAT +( +x +, +y +�x ## + ) +y + +89 + #__STRING +( +x +�#x + + ) + +92 + #__�r_t + * + + ) + +93 + #__l�g_doub�_t + + + ) + +97 #ifdef +__�lu�lus + + +98 + #__BEGIN_DECLS + "C" { + + ) + +99 + #__END_DECLS + } + + ) + +101 + #__BEGIN_DECLS + + + ) + +102 + #__END_DECLS + + + ) + +111 #i� +def�ed + +__�lu�lus + && def�ed +_GLIBCPP_USE_NAMESPACES + + +112 + #__BEGIN_NAMESPACE_STD + +�me�a� + +�d + { + + ) + +113 + #__END_NAMESPACE_STD + } + + ) + +114 + #__USING_NAMESPACE_STD +( +�me +� +us�g + +�d +::�me; + + ) + +115 + #__BEGIN_NAMESPACE_C99 + +�me�a� + +__c99 + { + + ) + +116 + #__END_NAMESPACE_C99 + } + + ) + +117 + #__USING_NAMESPACE_C99 +( +�me +� +us�g + +__c99 +::�me; + + ) + +122 + #__BEGIN_NAMESPACE_STD + + + ) + +123 + #__END_NAMESPACE_STD + + + ) + +124 + #__USING_NAMESPACE_STD +( +�me +) + + ) + +125 + #__BEGIN_NAMESPACE_C99 + + + ) + +126 + #__END_NAMESPACE_C99 + + + ) + +127 + #__USING_NAMESPACE_C99 +( +�me +) + + ) + +132 + #__bos +( +�r +� + `__bu�t�_obje�_size + (�r, +__USE_FORTIFY_LEVEL + > 1) + + ) + +133 + #__bos0 +( +�r +� + `__bu�t�_obje�_size + (�r, 0) + + ) + +134 + #__f�tify_fun�i� + +__ex��_�ways_�l�e + +__��ibu�_�tific�l__ + + + ) + +136 #i� +__GNUC_PREREQ + (4,3) + +137 + #__w�nde� +( +�me +, +msg +) \ + +138 + `�me + (� + `__��ibu�__ +(( + `__w�n�g__ + ( +msg +))) + + ) + +139 + #__w�ljr +( +msg +� + `__��ibu�__ +(( + `__w�n�g__ + (msg))) + + ) + +140 + #__�r�de� +( +�me +, +msg +) \ + +141 + `�me + (� + `__��ibu�__ +(( + `__�r�__ + ( +msg +))) + + ) + +143 + #__w�nde� +( +�me +, +msg +� + `�me + () + + ) + +144 + #__w�ljr +( +msg +) + + ) + +145 + #__�r�de� +( +�me +, +msg +� + `�me + () + + ) + +149 #i� +__GNUC_PREREQ + (2,97) + +151 + #__�ex�r + [] + + ) + +153 #ifde� +__GNUC__ + + +154 + #__�ex�r + [0] + + ) + +156 #i� +def�ed + +__STDC_VERSION__ + && __STDC_VERSION__ >= 199901L + +157 + #__�ex�r + [] + + ) + +160 + #__�ex�r + [1] + + ) + +176 #i� +def�ed + +__GNUC__ + && __GNUC__ >= 2 + +178 + #__REDIRECT +( +�me +, +��o +, +��s +��m���� + `__asm__ + ( + `__ASMNAME + (#��s)) + + ) + +179 #ifde� +__�lu�lus + + +180 + #__REDIRECT_NTH +( +�me +, +��o +, +��s +) \ + +181 +�me + +��o + +__THROW + + `__asm__ + ( + `__ASMNAME + (#��s)) + + ) + +182 + #__REDIRECT_NTHNL +( +�me +, +��o +, +��s +) \ + +183 +�me + +��o + +__THROWNL + + `__asm__ + ( + `__ASMNAME + (#��s)) + + ) + +185 + #__REDIRECT_NTH +( +�me +, +��o +, +��s +) \ + +186 +�me + +��o + + `__asm__ + ( + `__ASMNAME + (#��s)� +__THROW + + + ) + +187 + #__REDIRECT_NTHNL +( +�me +, +��o +, +��s +) \ + +188 +�me + +��o + + `__asm__ + ( + `__ASMNAME + (#��s)� +__THROWNL + + + ) + +190 + #__ASMNAME +( +�ame +� + `__ASMNAME2 + ( +__USER_LABEL_PREFIX__ +, c�me) + + ) + +191 + #__ASMNAME2 +( +�efix +, +�ame +� + `__STRING + (�efix� + ) +cname + +204 #i�! +def�ed + +__GNUC__ + || __GNUC__ < 2 + +205 + #__��ibu�__ +( +xyz +� + + ) + +211 #i� +__GNUC_PREREQ + (2,96) + +212 + #__��ibu�_m�loc__ + + `__��ibu�__ + (( +__m�loc__ +)) + + ) + +214 + #__��ibu�_m�loc__ + + + ) + +219 #i� +__GNUC_PREREQ + (4, 3) + +220 + #__��ibu�_�loc_size__ +( +��ms +) \ + +221 + `__��ibu�__ + (( +__�loc_size__ + +��ms +)) + + ) + +223 + #__��ibu�_�loc_size__ +( +��ms +� + + ) + +229 #i� +__GNUC_PREREQ + (2,96) + +230 + #__��ibu�_pu�__ + + `__��ibu�__ + (( +__pu�__ +)) + + ) + +232 + #__��ibu�_pu�__ + + + ) + +236 #i� +__GNUC_PREREQ + (2,5) + +237 + #__��ibu�_cڡ__ + + `__��ibu�__ + (( +__cڡ__ +)) + + ) + +239 + #__��ibu�_cڡ__ + + + ) + +245 #i� +__GNUC_PREREQ + (3,1) + +246 + #__��ibu�_u�d__ + + `__��ibu�__ + (( +__u�d__ +)) + + ) + +247 + #__��ibu�_no�l�e__ + + `__��ibu�__ + (( +__no�l�e__ +)) + + ) + +249 + #__��ibu�_u�d__ + + `__��ibu�__ + (( +__unu�d__ +)) + + ) + +250 + #__��ibu�_no�l�e__ + + + ) + +254 #i� +__GNUC_PREREQ + (3,2) + +255 + #__��ibu�_d����d__ + + `__��ibu�__ + (( +__d����d__ +)) + + ) + +257 + #__��ibu�_d����d__ + + + ) + +266 #i� +__GNUC_PREREQ + (2,8) + +267 + #__��ibu�_f�m�_�g__ +( +x +� + `__��ibu�__ + (( + `__f�m�_�g__ + (x))) + + ) + +269 + #__��ibu�_f�m�_�g__ +( +x +� + + ) + +276 #i� +__GNUC_PREREQ + (2,97) + +277 + #__��ibu�_f�m�_�rfm�__ +( +a +, +b +) \ + +278 + `__��ibu�__ + (( + `__f�m�__ + ( +__�rfm�__ +, +a +, +b +))) + + ) + +280 + #__��ibu�_f�m�_�rfm�__ +( +a +, +b +� + + ) + +285 #i� +__GNUC_PREREQ + (3,3) + +286 + #__n�nu� +( +��ms +� + `__��ibu�__ + (( +__n�nu�__ +��ams)) + + ) + +288 + #__n�nu� +( +��ms +) + + ) + +293 #i� +__GNUC_PREREQ + (3,4) + +294 + #__��ibu�_w�n_unu�d_�su�__ + \ + +295 + `__��ibu�__ + (( +__w�n_unu�d_�su�__ +)) + + ) + +296 #i� +__USE_FORTIFY_LEVEL + > 0 + +297 + #__wur + +__��ibu�_w�n_unu�d_�su�__ + + + ) + +300 + #__��ibu�_w�n_unu�d_�su�__ + + + ) + +302 #i�de� +__wur + + +303 + #__wur + + + ) + +307 #i� +__GNUC_PREREQ + (3,2) + +308 + #__�ways_�l�e + +__�l�e + + `__��ibu�__ + (( +__�ways_�l�e__ +)) + + ) + +310 + #__�ways_�l�e + +__�l�e + + + ) + +315 #i� +__GNUC_PREREQ + (4,3) + +316 + #__��ibu�_�tific�l__ + + `__��ibu�__ + (( +__�tific�l__ +)) + + ) + +318 + #__��ibu�_�tific�l__ + + + ) + +321 #ifde� +__GNUC__ + + +326 #i� +def�ed + +__GNUC_STDC_INLINE__ + || def�ed +__GNUC_GNU_INLINE__ + + +327 + #__ex��_�l�e + +__�l�e + + `__��ibu�__ + (( +__gnu_�l�e__ +)) + + ) + +328 + #__ex��_�ways_�l�e + \ + +329 +__�ways_�l�e + + `__��ibu�__ + (( +__gnu_�l�e__ +)) + + ) + +331 + #__ex��_�l�e + +__�l�e + + + ) + +332 + #__ex��_�ways_�l�e + +__�ways_�l�e + + + ) + +335 + #__ex��_�l�e + + + ) + +336 + #__ex��_�ways_�l�e + + + ) + +341 #i� +__GNUC_PREREQ + (4,3) + +342 + #__va_�g_�ck +(� + `__bu�t�_va_�g_�ck + () + + ) + +343 + #__va_�g_�ck_�n +(� + `__bu�t�_va_�g_�ck_�n + () + + ) + +350 #i�! +__GNUC_PREREQ + (2,8) + +351 + #__ex�nsi�__ + + + ) + +355 #i�! +__GNUC_PREREQ + (2,92) + +356 + #__��ri� + + + ) + +362 #i� +__GNUC_PREREQ + (3,1�&& ! +def�ed + +__GNUG__ + + +363 + #__��ri�_�r + +__��ri� + + + ) + +365 #ifde� +__GNUC__ + + +366 + #__��ri�_�r + + + ) + +368 #i� +def�ed + +__STDC_VERSION__ + && __STDC_VERSION__ >= 199901L + +369 + #__��ri�_�r + +��ri� + + + ) + +372 + #__��ri�_�r + + + ) + +377 #i� +__GNUC__ + >= 3 + +378 + #__glibc_u�ik�y +( +c�d +� + `__bu�t�_ex�� + ((c�d), 0) + + ) + +379 + #__glibc_lik�y +( +c�d +� + `__bu�t�_ex�� + ((c�d), 1) + + ) + +381 + #__glibc_u�ik�y +( +c�d +�(c�d) + + ) + +382 + #__glibc_lik�y +( +c�d +�(c�d) + + ) + +385 + ~<b�s/w�dsize.h +> + +387 #i� +def�ed + +__LONG_DOUBLE_MATH_OPTIONAL + && def�ed +__NO_LONG_DOUBLE_MATH + + +388 + #__LDBL_COMPAT + 1 + + ) + +389 #ifde� +__REDIRECT + + +390 + #__LDBL_REDIR1 +( +�me +, +��o +, +��s +� + `__REDIRECT + (�me,�r�o,�l�s) + + ) + +391 + #__LDBL_REDIR +( +�me +, +��o +) \ + +392 + `__LDBL_REDIR1 + ( +�me +, +��o +, +__�dbl_ +##�me) + + ) + +393 + #__LDBL_REDIR1_NTH +( +�me +, +��o +, +��s +� + `__REDIRECT_NTH + (�me,�r�o,�l�s) + + ) + +394 + #__LDBL_REDIR_NTH +( +�me +, +��o +) \ + +395 + `__LDBL_REDIR1_NTH + ( +�me +, +��o +, +__�dbl_ +##�me) + + ) + +396 + #__LDBL_REDIR1_DECL +( +�me +, +��s +) \ + +397 + `__ty�of + ( +�me +��m� + `__asm + ( + `__ASMNAME + (#��s)); + + ) + +398 + #__LDBL_REDIR_DECL +( +�me +) \ + +399 + `__ty�of + ( +�me +��m� + `__asm + ( + `__ASMNAME + ("__�dbl_" #�me)); + + ) + +400 + #__REDIRECT_LDBL +( +�me +, +��o +, +��s +) \ + +401 + `__LDBL_REDIR1 + ( +�me +, +��o +, +__�dbl_ +## +��s +) + + ) + +402 + #__REDIRECT_NTH_LDBL +( +�me +, +��o +, +��s +) \ + +403 + `__LDBL_REDIR1_NTH + ( +�me +, +��o +, +__�dbl_ +## +��s +) + + ) + +406 #i�! +def�ed + +__LDBL_COMPAT + || !def�ed +__REDIRECT + + +407 + #__LDBL_REDIR1 +( +�me +, +��o +, +��s +��m� + ) +proto + +408 + #__LDBL_REDIR +( +�me +, +��o +��m� + ) +proto + +409 + #__LDBL_REDIR1_NTH +( +�me +, +��o +, +��s +��m���� +__THROW + + + ) + +410 + #__LDBL_REDIR_NTH +( +�me +, +��o +��m���� +__THROW + + + ) + +411 + #__LDBL_REDIR_DECL +( +�me +) + + ) + +412 #ifde� +__REDIRECT + + +413 + #__REDIRECT_LDBL +( +�me +, +��o +, +��s +� + `__REDIRECT + (�me,�r�o,�l�s) + + ) + +414 + #__REDIRECT_NTH_LDBL +( +�me +, +��o +, +��s +) \ + +415 + `__REDIRECT_NTH + ( +�me +, +��o +, +��s +) + + ) + + @/usr/include/sys/param.h + +19 #i�de� +_SYS_PARAM_H + + +20 + #_SYS_PARAM_H + 1 + + ) + +22 + #__�ed_NULL + + + ) + +23 + ~<�ddef.h +> + +25 + ~<sys/ty�s.h +> + +26 + ~<lim�s.h +> + +27 + ~<�d�n.h +> + +28 + ~<sig�l.h +> + +31 + ~<b�s/��m.h +> + +36 + #NBBY + +CHAR_BIT + + + ) + +38 #i�! +def�ed + +NGROUPS + && def�ed +NGROUPS_MAX + + +39 + #NGROUPS + +NGROUPS_MAX + + + ) + +41 #i�! +def�ed + +MAXSYMLINKS + && def�ed +SYMLOOP_MAX + + +42 + #MAXSYMLINKS + +SYMLOOP_MAX + + + ) + +44 #i�! +def�ed + +CANBSIZ + && def�ed +MAX_CANON + + +45 + #CANBSIZ + +MAX_CANON + + + ) + +47 #i�! +def�ed + +MAXPATHLEN + && def�ed +PATH_MAX + + +48 + #MAXPATHLEN + +PATH_MAX + + + ) + +50 #i�! +def�ed + +NOFILE + && def�ed +OPEN_MAX + + +51 + #NOFILE + +OPEN_MAX + + + ) + +53 #i�de� +NCARGS + + +54 #ifde� +ARG_MAX + + +55 + #NCARGS + +ARG_MAX + + + ) + +59 + #NCARGS + +INT_MAX + + + ) + +65 #i�de� +NOGROUP + + +66 + #NOGROUP + 65535 + + ) + +68 #i�de� +NODEV + + +69 + #NODEV + (( +dev_t +�-1� + + ) + +74 #i�de� +DEV_BSIZE + + +75 + #DEV_BSIZE + 512 + + ) + +80 + #�tb� +( +a +, +i +�(�)[(i)/ +NBBY +] |�1<<((i)%NBBY)) + + ) + +81 + #�rb� +( +a +, +i +�(�)[(i)/ +NBBY +] &�~(1<<((i)%NBBY))) + + ) + +82 + #is�t +( +a +, +i +�(�)[(i)/ +NBBY +] & (1<<((i)%NBBY))) + + ) + +83 + #is�r +( +a +, +i +�((�)[(i)/ +NBBY +] & (1<<((i)%NBBY))�=�0) + + ) + +86 #i�de� +howm�y + + +87 + #howm�y +( +x +, +y +�(((x�+ ((y�- 1)�/ (y)) + + ) + +89 #ifde� +__GNUC__ + + +90 + #roundup +( +x +, +y +�( + `__bu�t�_cڡ�t_p + (y�&& + `pow�of2 + (y) \ + +91 ? ((( +x +�+ ( +y +) - 1) & ~((y) - 1)) \ + +92 : (((( +x +�+ (( +y +�- 1)�/ (y)�* (y))) + + ) + +94 + #roundup +( +x +, +y +�((((x�+ ((y�- 1)�/ (y)�* (y)) + + ) + +96 + #pow�of2 +( +x +�((((x�- 1�& (x)�=�0) + + ) + +99 + #MIN +( +a +, +b +�((�)<(b))?�):(b)) + + ) + +100 + #MAX +( +a +, +b +�((�)>(b))?�):(b)) + + ) + + @/usr/include/sys/poll.h + +19 #i�def +_SYS_POLL_H + + +20 + #_SYS_POLL_H + 1 + + ) + +22 + ~<�u�s.h +> + +25 + ~<b�s/p�l.h +> + +26 #ifde� +__USE_GNU + + +28 + ~<b�s/sig�t.h +> + +30 + #__�ed_time�ec + + + ) + +31 + ~<time.h +> + +36 + tnfds_t +; + +39 + sp�lfd + + +41 + mfd +; + +42 + mev�ts +; + +43 + m�v�ts +; + +47 +__BEGIN_DECLS + + +57 +p�l + ( +p�lfd + * +__fds +, +nfds_t + +__nfds +, +__timeout +); + +59 #ifde� +__USE_GNU + + +66 +��l + ( +p�lfd + * +__fds +, +nfds_t + +__nfds +, + +67 cڡ +time�ec + * +__timeout +, + +68 cڡ +__sig�t_t + * +__ss +); + +71 + g__END_DECLS + + +75 #i� +__USE_FORTIFY_LEVEL + > 0 && +def�ed + +__f�tify_fun�i� + + +76 + ~<b�s/p�l2.h +> + + @/usr/include/sys/sysmacros.h + +19 #i�de� +_SYS_SYSMACROS_H + + +20 + #_SYS_SYSMACROS_H + 1 + + ) + +22 + ~<�u�s.h +> + +24 +__BEGIN_DECLS + + +26 +__ex�nsi�__ + + +27 + $gnu_dev_maj� + ( +__dev +) + +28 +__THROW + +__��ibu�_cڡ__ +; + +29 +__ex�nsi�__ + + +30 + $gnu_dev_m�� + ( +__dev +) + +31 +__THROW + +__��ibu�_cڡ__ +; + +32 +__ex�nsi�__ + + +33 + $gnu_dev_makedev + ( +__maj� +, + +34 +__m�� +) + +35 +__THROW + +__��ibu�_cڡ__ +; + +37 #ifde� +__USE_EXTERN_INLINES + + +38 +__ex�nsi�__ + +__ex��_�l�e + +__��ibu�_cڡ__ + + +39 + `__NTH + ( + $gnu_dev_maj� + ( +__dev +)) + +41 (( +__dev + >> 8) & 0xfff) | (() (__dev >> 32) & ~0xfff); + +42 + } +} + +44 +__ex�nsi�__ + +__ex��_�l�e + +__��ibu�_cڡ__ + + +45 +__NTH + ( + $gnu_dev_m�� + ( +__dev +)) + +47 ( +__dev + & 0xff) | (() (__dev >> 12) & ~0xff); + +48 + } +} + +50 +__ex�nsi�__ + +__ex��_�l�e + +__��ibu�_cڡ__ + + +51 +__NTH + ( + $gnu_dev_makedev + ( +__maj� +, +__m�� +)) + +53 (( +__m�� + & 0xff�| (( +__maj� + & 0xfff) << 8) + +54 | (((�( +__m�� + & ~0xff)) << 12) + +55 | (((�( +__maj� + & ~0xfff)) << 32)); + +56 + } +} + +58 + g__END_DECLS + + +61 + #maj� +( +dev +� + `gnu_dev_maj� + (dev) + + ) + +62 + #m�� +( +dev +� + `gnu_dev_m�� + (dev) + + ) + +63 + #makedev +( +maj +, +m� +� + `gnu_dev_makedev + (maj, m�) + + ) + + @/usr/include/sys/ttydefaults.h + +40 #i�de� +_SYS_TTYDEFAULTS_H_ + + +41 + #_SYS_TTYDEFAULTS_H_ + + + ) + +46 + #TTYDEF_IFLAG + ( +BRKINT + | +ISTRIP + | +ICRNL + | +IMAXBEL + | +IXON + | +IXANY +) + + ) + +47 + #TTYDEF_OFLAG + ( +OPOST + | +ONLCR + | +XTABS +) + + ) + +48 + #TTYDEF_LFLAG + ( +ECHO + | +ICANON + | +ISIG + | +IEXTEN + | +ECHOE +| +ECHOKE +| +ECHOCTL +) + + ) + +49 + #TTYDEF_CFLAG + ( +CREAD + | +CS7 + | +PARENB + | +HUPCL +) + + ) + +50 + #TTYDEF_SPEED + ( +B9600 +) + + ) + +55 + #CTRL +( +x +�(x&037) + + ) + +56 + #CEOF + + `CTRL +('d') + + ) + +57 #ifde� +_POSIX_VDISABLE + + +58 + #CEOL + +_POSIX_VDISABLE + + + ) + +60 + #CEOL + '\0' + + ) + +62 + #CERASE + 0177 + + ) + +63 + #CINTR + + `CTRL +('c') + + ) + +64 #ifde� +_POSIX_VDISABLE + + +65 + #CSTATUS + +_POSIX_VDISABLE + + + ) + +67 + #CSTATUS + '\0' + + ) + +69 + #CKILL + + `CTRL +('u') + + ) + +70 + #CMIN + 1 + + ) + +71 + #CQUIT + 034 + + ) + +72 + #CSUSP + + `CTRL +('z') + + ) + +73 + #CTIME + 0 + + ) + +74 + #CDSUSP + + `CTRL +('y') + + ) + +75 + #CSTART + + `CTRL +('q') + + ) + +76 + #CSTOP + + `CTRL +('s') + + ) + +77 + #CLNEXT + + `CTRL +('v') + + ) + +78 + #CDISCARD + + `CTRL +('o') + + ) + +79 + #CWERASE + + `CTRL +('w') + + ) + +80 + #CREPRINT + + `CTRL +('r') + + ) + +81 + #CEOT + +CEOF + + + ) + +83 + #CBRK + +CEOL + + + ) + +84 + #CRPRNT + +CREPRINT + + + ) + +85 + #CFLUSH + +CDISCARD + + + ) + +93 #ifde� +TTYDEFCHARS + + +94 +cc_t + + g�ydefch�s +[ +NCCS +] = { + +95 +CEOF +, +CEOL +, CEOL, +CERASE +, +CWERASE +, +CKILL +, +CREPRINT +, + +96 +_POSIX_VDISABLE +, +CINTR +, +CQUIT +, +CSUSP +, +CDSUSP +, +CSTART +, +CSTOP +, +CLNEXT +, + +97 +CDISCARD +, +CMIN +, +CTIME +, +CSTATUS +, +_POSIX_VDISABLE + + +99 #unde� +TTYDEFCHARS + + + @/usr/include/sys/ucontext.h + +18 #i�de� +_SYS_UCONTEXT_H + + +19 + #_SYS_UCONTEXT_H + 1 + + ) + +21 + ~<�u�s.h +> + +22 + ~<sig�l.h +> + +26 + ~<b�s/sigcڋxt.h +> + +28 #ifde� +__x86_64__ + + +31 +__ex�nsi�__ + + tg�g_t +; + +34 + #NGREG + 23 + + ) + +37 +g�g_t + + tg�g�t_t +[ +NGREG +]; + +39 #ifde� +__USE_GNU + + +43 + mREG_R8 + = 0, + +44 + #REG_R8 + +REG_R8 + + + ) + +45 + mREG_R9 +, + +46 + #REG_R9 + +REG_R9 + + + ) + +47 + mREG_R10 +, + +48 + #REG_R10 + +REG_R10 + + + ) + +49 + mREG_R11 +, + +50 + #REG_R11 + +REG_R11 + + + ) + +51 + mREG_R12 +, + +52 + #REG_R12 + +REG_R12 + + + ) + +53 + mREG_R13 +, + +54 + #REG_R13 + +REG_R13 + + + ) + +55 + mREG_R14 +, + +56 + #REG_R14 + +REG_R14 + + + ) + +57 + mREG_R15 +, + +58 + #REG_R15 + +REG_R15 + + + ) + +59 + mREG_RDI +, + +60 + #REG_RDI + +REG_RDI + + + ) + +61 + mREG_RSI +, + +62 + #REG_RSI + +REG_RSI + + + ) + +63 + mREG_RBP +, + +64 + #REG_RBP + +REG_RBP + + + ) + +65 + mREG_RBX +, + +66 + #REG_RBX + +REG_RBX + + + ) + +67 + mREG_RDX +, + +68 + #REG_RDX + +REG_RDX + + + ) + +69 + mREG_RAX +, + +70 + #REG_RAX + +REG_RAX + + + ) + +71 + mREG_RCX +, + +72 + #REG_RCX + +REG_RCX + + + ) + +73 + mREG_RSP +, + +74 + #REG_RSP + +REG_RSP + + + ) + +75 + mREG_RIP +, + +76 + #REG_RIP + +REG_RIP + + + ) + +77 + mREG_EFL +, + +78 + #REG_EFL + +REG_EFL + + + ) + +79 + mREG_CSGSFS +, + +80 + #REG_CSGSFS + +REG_CSGSFS + + + ) + +81 + mREG_ERR +, + +82 + #REG_ERR + +REG_ERR + + + ) + +83 + mREG_TRAPNO +, + +84 + #REG_TRAPNO + +REG_TRAPNO + + + ) + +85 + mREG_OLDMASK +, + +86 + #REG_OLDMASK + +REG_OLDMASK + + + ) + +87 + mREG_CR2 + + +88 + #REG_CR2 + +REG_CR2 + + + ) + +92 + s_libc_�x�g + + +94 + msignifi�nd +[4]; + +95 + mexpڒt +; + +96 + m�dd�g +[3]; + +99 + s_libc_xmm�g + + +101 +__u�t32_t + + m�em�t +[4]; + +104 + s_libc_塩e + + +107 +__u�t16_t + + mcwd +; + +108 +__u�t16_t + + mswd +; + +109 +__u�t16_t + + m�w +; + +110 +__u�t16_t + + mf� +; + +111 +__u�t64_t + + mr� +; + +112 +__u�t64_t + + mrdp +; + +113 +__u�t32_t + + mmxc� +; + +114 +__u�t32_t + + mmx�_mask +; + +115 +_libc_�x�g + + m_� +[8]; + +116 +_libc_xmm�g + + m_xmm +[16]; + +117 +__u�t32_t + + m�dd�g +[24]; + +121 +_libc_塩e + * + t�g�t_t +; + +126 +g�g�t_t + + mg�gs +; + +128 +�g�t_t + + m�gs +; + +129 +__ex�nsi�__ + + m__��rved1 + [8]; + +130 } + tmcڋxt_t +; + +133 + sucڋxt + + +135 + muc_�ags +; + +136 +ucڋxt + * + muc_l�k +; + +137 +�ack_t + + muc_�ack +; + +138 +mcڋxt_t + + muc_mcڋxt +; + +139 +__sig�t_t + + muc_sigmask +; + +140 +_libc_塩e + + m__�gs_mem +; + +141 } + tucڋxt_t +; + +146 + tg�g_t +; + +149 + #NGREG + 19 + + ) + +152 +g�g_t + + tg�g�t_t +[ +NGREG +]; + +154 #ifde� +__USE_GNU + + +158 + mREG_GS + = 0, + +159 + #REG_GS + +REG_GS + + + ) + +160 + mREG_FS +, + +161 + #REG_FS + +REG_FS + + + ) + +162 + mREG_ES +, + +163 + #REG_ES + +REG_ES + + + ) + +164 + mREG_DS +, + +165 + #REG_DS + +REG_DS + + + ) + +166 + mREG_EDI +, + +167 + #REG_EDI + +REG_EDI + + + ) + +168 + mREG_ESI +, + +169 + #REG_ESI + +REG_ESI + + + ) + +170 + mREG_EBP +, + +171 + #REG_EBP + +REG_EBP + + + ) + +172 + mREG_ESP +, + +173 + #REG_ESP + +REG_ESP + + + ) + +174 + mREG_EBX +, + +175 + #REG_EBX + +REG_EBX + + + ) + +176 + mREG_EDX +, + +177 + #REG_EDX + +REG_EDX + + + ) + +178 + mREG_ECX +, + +179 + #REG_ECX + +REG_ECX + + + ) + +180 + mREG_EAX +, + +181 + #REG_EAX + +REG_EAX + + + ) + +182 + mREG_TRAPNO +, + +183 + #REG_TRAPNO + +REG_TRAPNO + + + ) + +184 + mREG_ERR +, + +185 + #REG_ERR + +REG_ERR + + + ) + +186 + mREG_EIP +, + +187 + #REG_EIP + +REG_EIP + + + ) + +188 + mREG_CS +, + +189 + #REG_CS + +REG_CS + + + ) + +190 + mREG_EFL +, + +191 + #REG_EFL + +REG_EFL + + + ) + +192 + mREG_UESP +, + +193 + #REG_UESP + +REG_UESP + + + ) + +194 + mREG_SS + + +195 + #REG_SS + +REG_SS + + + ) + +200 + s_libc_�g + + +202 + msignifi�nd +[4]; + +203 + mexpڒt +; + +206 + s_libc_塩e + + +208 + mcw +; + +209 + msw +; + +210 + m�g +; + +211 + m�off +; + +212 + mcs�l +; + +213 + md�aoff +; + +214 + md�a�l +; + +215 +_libc_�g + + m_� +[8]; + +216 + m��us +; + +220 +_libc_塩e + * + t�g�t_t +; + +225 +g�g�t_t + + mg�gs +; + +228 +�g�t_t + + m�gs +; + +229 + m�dmask +; + +230 + m�2 +; + +231 } + tmcڋxt_t +; + +234 + sucڋxt + + +236 + muc_�ags +; + +237 +ucڋxt + * + muc_l�k +; + +238 +�ack_t + + muc_�ack +; + +239 +mcڋxt_t + + muc_mcڋxt +; + +240 +__sig�t_t + + muc_sigmask +; + +241 +_libc_塩e + + m__�gs_mem +; + +242 } + tucڋxt_t +; + + @/usr/include/sys/uio.h + +18 #i�de� +_SYS_UIO_H + + +19 + #_SYS_UIO_H + 1 + + ) + +21 + ~<�u�s.h +> + +23 + ~<sys/ty�s.h +> + +25 + g__BEGIN_DECLS + + +28 + ~<b�s/uio.h +> + +39 +ssize_t + + $�adv + ( +__fd +, cڡ +iovec + * +__iovec +, +__cou� +) + +40 +__wur +; + +50 +ssize_t + + $wr�ev + ( +__fd +, cڡ +iovec + * +__iovec +, +__cou� +) + +51 +__wur +; + +54 #ifde� +__USE_BSD + + +55 #i�de� +__USE_FILE_OFFSET64 + + +65 +ssize_t + + $��dv + ( +__fd +, cڡ +iovec + * +__iovec +, +__cou� +, + +66 +__off_t + +__off�t +� +__wur +; + +77 +ssize_t + + $pwr�ev + ( +__fd +, cڡ +iovec + * +__iovec +, +__cou� +, + +78 +__off_t + +__off�t +� +__wur +; + +80 #ifde� +__REDIRECT + + +81 +ssize_t + + `__REDIRECT + ( +��dv +, ( +__fd +, cڡ +iovec + * +__iovec +, + +82 +__cou� +, +__off64_t + +__off�t +), + +83 +��dv64 +� +__wur +; + +84 +ssize_t + + `__REDIRECT + ( +pwr�ev +, ( +__fd +, cڡ +iovec + * +__iovec +, + +85 +__cou� +, +__off64_t + +__off�t +), + +86 +pwr�ev64 +� +__wur +; + +88 + #��dv + +��dv64 + + + ) + +89 + #pwr�ev + +pwr�ev64 + + + ) + +93 #ifde� +__USE_LARGEFILE64 + + +103 +ssize_t + + $��dv64 + ( +__fd +, cڡ +iovec + * +__iovec +, +__cou� +, + +104 +__off64_t + +__off�t +� +__wur +; + +115 +ssize_t + + $pwr�ev64 + ( +__fd +, cڡ +iovec + * +__iovec +, +__cou� +, + +116 +__off64_t + +__off�t +� +__wur +; + +120 +__END_DECLS + + + @/usr/include/xlocale.h + +20 #i�de� +_XLOCALE_H + + +21 + #_XLOCALE_H + 1 + + ) + +27 + s__lo��_�ru� + + +30 +__lo��_d�a + * + m__lo��s +[13]; + +33 cڡ * + m__�y�_b +; + +34 cڡ * + m__�y�_t�ow� +; + +35 cڡ * + m__�y�_tou�� +; + +38 cڡ * + m__�mes +[13]; + +39 } * + t__lo��_t +; + +42 +__lo��_t + + tlo��_t +; + + @/usr/include/_G_config.h + +4 #i�de� +_G_c�fig_h + + +5 + #_G_c�fig_h + 1 + + ) + +9 + ~<b�s/ty�s.h +> + +10 + #__�ed_size_t + + + ) + +11 #i� +def�ed + +_LIBC + || def�ed +_GLIBCPP_USE_WCHAR_T + + +12 + #__�ed_wch�_t + + + ) + +14 + #__�ed_NULL + + + ) + +15 + ~<�ddef.h +> + +16 + #__�ed_mb��e_t + + + ) + +17 #i� +def�ed + +_LIBC + || def�ed +_GLIBCPP_USE_WCHAR_T + + +18 + #__�ed_w�t_t + + + ) + +20 + ~<wch�.h +> + +23 +__off_t + + m__pos +; + +24 +__mb��e_t + + m__��e +; + +25 } + t_G_�os_t +; + +28 +__off64_t + + m__pos +; + +29 +__mb��e_t + + m__��e +; + +30 } + t_G_�os64_t +; + +31 #i� +def�ed + +_LIBC + || def�ed +_GLIBCPP_USE_WCHAR_T + + +32 + ~<gc�v.h +> + +35 +__gc�v_�fo + + m__cd +; + +38 +__gc�v_�fo + + m__cd +; + +39 +__gc�v_��_d�a + + m__d�a +; + +40 } + m__comb�ed +; + +41 } + t_G_ic�v_t +; + +46 + #_G_va_li� + +__gnuc_va_li� + + + ) + +48 + #_G_HAVE_MMAP + 1 + + ) + +49 + #_G_HAVE_MREMAP + 1 + + ) + +51 + #_G_IO_IO_FILE_VERSION + 0x20001 + + ) + +54 + #_G_HAVE_ST_BLKSIZE + + `def�ed + ( +_STATBUF_ST_BLKSIZE +) + + ) + +56 + #_G_BUFSIZ + 8192 + + ) + + @/usr/include/asm/socket.h + +1 + ~<asm-g��ic/sock�.h +> + + @/usr/include/asm/types.h + +1 #i�de� +_ASM_X86_TYPES_H + + +2 + #_ASM_X86_TYPES_H + + + ) + +4 + ~<asm-g��ic/ty�s.h +> + + @/usr/include/bits/byteswap-16.h + +19 #i�de� +_BITS_BYTESWAP_H + + +23 #ifde� +__GNUC__ + + +24 #i� +__GNUC__ + >= 2 + +25 + #__bsw�_16 +( +x +) \ + +26 ( +__ex�nsi�__ + \ + +27 ({ +__v +, +__x + = (�( +x +); \ + +28 i�( + `__bu�t�_cڡ�t_p + ( +__x +)) \ + +29 +__v + = + `__bsw�_cڡ�t_16 + ( +__x +); \ + +31 + `__asm__ + ("rorw $8, %w0" \ + +32 : "�" ( +__v +) \ + +33 : "0" ( +__x +) \ + +35 +__v +; })) + + ) + +38 + #__bsw�_16 +( +x +) \ + +39 ( +__ex�nsi�__ + \ + +40 ({ +__x + = (�( +x +); \ + +41 + `__bsw�_cڡ�t_16 + ( +__x +); })) + + ) + +44 +__�l�e + + +45 + $__bsw�_16 + ( +__bsx +) + +47 + `__bsw�_cڡ�t_16 + ( +__bsx +); + +48 + } +} + + @/usr/include/bits/endian.h + +3 #i�de� +_ENDIAN_H + + +7 + #__BYTE_ORDER + +__LITTLE_ENDIAN + + + ) + + @/usr/include/bits/fcntl-linux.h + +19 #i�def +_FCNTL_H + + +37 #ifde� +__USE_GNU + + +38 + ~<b�s/uio.h +> + +42 + #O_ACCMODE + 0003 + + ) + +43 + #O_RDONLY + 00 + + ) + +44 + #O_WRONLY + 01 + + ) + +45 + #O_RDWR + 02 + + ) + +46 #i�de� +O_CREAT + + +47 + #O_CREAT + 0100 + + ) + +49 #i�de� +O_EXCL + + +50 + #O_EXCL + 0200 + + ) + +52 #i�de� +O_NOCTTY + + +53 + #O_NOCTTY + 0400 + + ) + +55 #i�de� +O_TRUNC + + +56 + #O_TRUNC + 01000 + + ) + +58 #i�de� +O_APPEND + + +59 + #O_APPEND + 02000 + + ) + +61 #i�de� +O_NONBLOCK + + +62 + #O_NONBLOCK + 04000 + + ) + +64 #i�de� +O_NDELAY + + +65 + #O_NDELAY + +O_NONBLOCK + + + ) + +67 #i�de� +O_SYNC + + +68 + #O_SYNC + 04010000 + + ) + +70 + #O_FSYNC + +O_SYNC + + + ) + +71 #i�de� +O_ASYNC + + +72 + #O_ASYNC + 020000 + + ) + +74 #i�de� +__O_LARGEFILE + + +75 + #__O_LARGEFILE + 0100000 + + ) + +78 #i�de� +__O_DIRECTORY + + +79 + #__O_DIRECTORY + 0200000 + + ) + +81 #i�de� +__O_NOFOLLOW + + +82 + #__O_NOFOLLOW + 0400000 + + ) + +84 #i�de� +__O_CLOEXEC + + +85 + #__O_CLOEXEC + 02000000 + + ) + +87 #i�de� +__O_DIRECT + + +88 + #__O_DIRECT + 040000 + + ) + +90 #i�de� +__O_NOATIME + + +91 + #__O_NOATIME + 01000000 + + ) + +93 #i�de� +__O_PATH + + +94 + #__O_PATH + 010000000 + + ) + +96 #i�de� +__O_DSYNC + + +97 + #__O_DSYNC + 010000 + + ) + +99 #i�de� +__O_TMPFILE + + +100 + #__O_TMPFILE + 020200000 + + ) + +103 #i�de� +F_GETLK + + +104 #i�de� +__USE_FILE_OFFSET64 + + +105 + #F_GETLK + 5 + + ) + +106 + #F_SETLK + 6 + + ) + +107 + #F_SETLKW + 7 + + ) + +109 + #F_GETLK + +F_GETLK64 + + + ) + +110 + #F_SETLK + +F_SETLK64 + + + ) + +111 + #F_SETLKW + +F_SETLKW64 + + + ) + +114 #i�de� +F_GETLK64 + + +115 + #F_GETLK64 + 12 + + ) + +116 + #F_SETLK64 + 13 + + ) + +117 + #F_SETLKW64 + 14 + + ) + +120 #ifde� +__USE_LARGEFILE64 + + +121 + #O_LARGEFILE + +__O_LARGEFILE + + + ) + +124 #ifde� +__USE_XOPEN2K8 + + +125 + #O_DIRECTORY + +__O_DIRECTORY + + + ) + +126 + #O_NOFOLLOW + +__O_NOFOLLOW + + + ) + +127 + #O_CLOEXEC + +__O_CLOEXEC + + + ) + +130 #ifde� +__USE_GNU + + +131 + #O_DIRECT + +__O_DIRECT + + + ) + +132 + #O_NOATIME + +__O_NOATIME + + + ) + +133 + #O_PATH + +__O_PATH + + + ) + +134 + #O_TMPFILE + +__O_TMPFILE + + + ) + +140 #i� +def�ed + +__USE_POSIX199309 + || def�ed +__USE_UNIX98 + + +141 + #O_DSYNC + +__O_DSYNC + + + ) + +142 #i� +def�ed + +__O_RSYNC + + +143 + #O_RSYNC + +__O_RSYNC + + + ) + +145 + #O_RSYNC + +O_SYNC + + + ) + +150 + #F_DUPFD + 0 + + ) + +151 + #F_GETFD + 1 + + ) + +152 + #F_SETFD + 2 + + ) + +153 + #F_GETFL + 3 + + ) + +154 + #F_SETFL + 4 + + ) + +156 #i�de� +__F_SETOWN + + +157 + #__F_SETOWN + 8 + + ) + +158 + #__F_GETOWN + 9 + + ) + +161 #i� +def�ed + +__USE_BSD + || def�ed +__USE_UNIX98 + || def�ed +__USE_XOPEN2K8 + + +162 + #F_SETOWN + +__F_SETOWN + + + ) + +163 + #F_GETOWN + +__F_GETOWN + + + ) + +166 #i�de� +__F_SETSIG + + +167 + #__F_SETSIG + 10 + + ) + +168 + #__F_GETSIG + 11 + + ) + +170 #i�de� +__F_SETOWN_EX + + +171 + #__F_SETOWN_EX + 15 + + ) + +172 + #__F_GETOWN_EX + 16 + + ) + +175 #ifde� +__USE_GNU + + +176 + #F_SETSIG + +__F_SETSIG + + + ) + +177 + #F_GETSIG + +__F_GETSIG + + + ) + +178 + #F_SETOWN_EX + +__F_SETOWN_EX + + + ) + +179 + #F_GETOWN_EX + +__F_GETOWN_EX + + + ) + +182 #ifde� +__USE_GNU + + +183 + #F_SETLEASE + 1024 + + ) + +184 + #F_GETLEASE + 1025 + + ) + +185 + #F_NOTIFY + 1026 + + ) + +186 + #F_SETPIPE_SZ + 1031 + + ) + +187 + #F_GETPIPE_SZ + 1032 + + ) + +189 #ifde� +__USE_XOPEN2K8 + + +190 + #F_DUPFD_CLOEXEC + 1030 + + ) + +195 + #FD_CLOEXEC + 1 + + ) + +197 #i�de� +F_RDLCK + + +199 + #F_RDLCK + 0 + + ) + +200 + #F_WRLCK + 1 + + ) + +201 + #F_UNLCK + 2 + + ) + +206 #i�de� +F_EXLCK + + +207 + #F_EXLCK + 4 + + ) + +208 + #F_SHLCK + 8 + + ) + +211 #ifde� +__USE_BSD + + +213 + #LOCK_SH + 1 + + ) + +214 + #LOCK_EX + 2 + + ) + +215 + #LOCK_NB + 4 + + ) + +217 + #LOCK_UN + 8 + + ) + +220 #ifde� +__USE_GNU + + +221 + #LOCK_MAND + 32 + + ) + +222 + #LOCK_READ + 64 + + ) + +223 + #LOCK_WRITE + 128 + + ) + +224 + #LOCK_RW + 192 + + ) + +227 #ifde� +__USE_GNU + + +229 + #DN_ACCESS + 0x00000001 + + ) + +230 + #DN_MODIFY + 0x00000002 + + ) + +231 + #DN_CREATE + 0x00000004 + + ) + +232 + #DN_DELETE + 0x00000008 + + ) + +233 + #DN_RENAME + 0x00000010 + + ) + +234 + #DN_ATTRIB + 0x00000020 + + ) + +235 + #DN_MULTISHOT + 0x80000000 + + ) + +239 #ifde� +__USE_GNU + + +241 + e__pid_ty� + + +243 + mF_OWNER_TID + = 0, + +244 + mF_OWNER_PID +, + +245 + mF_OWNER_PGRP +, + +246 + mF_OWNER_GID + = +F_OWNER_PGRP + + +250 + sf_ow�r_ex + + +252 +__pid_ty� + + mty� +; + +253 +__pid_t + + mpid +; + +259 #ifdef +__USE_BSD + + +260 + #FAPPEND + +O_APPEND + + + ) + +261 + #FFSYNC + +O_FSYNC + + + ) + +262 + #FASYNC + +O_ASYNC + + + ) + +263 + #FNONBLOCK + +O_NONBLOCK + + + ) + +264 + #FNDELAY + +O_NDELAY + + + ) + +267 #i�de� +__POSIX_FADV_DONTNEED + + +268 + #__POSIX_FADV_DONTNEED + 4 + + ) + +269 + #__POSIX_FADV_NOREUSE + 5 + + ) + +272 #ifde� +__USE_XOPEN2K + + +273 + #POSIX_FADV_NORMAL + 0 + + ) + +274 + #POSIX_FADV_RANDOM + 1 + + ) + +275 + #POSIX_FADV_SEQUENTIAL + 2 + + ) + +276 + #POSIX_FADV_WILLNEED + 3 + + ) + +277 + #POSIX_FADV_DONTNEED + +__POSIX_FADV_DONTNEED + + + ) + +278 + #POSIX_FADV_NOREUSE + +__POSIX_FADV_NOREUSE + + + ) + +282 #ifde� +__USE_GNU + + +284 + #SYNC_FILE_RANGE_WAIT_BEFORE + 1 + + ) + +287 + #SYNC_FILE_RANGE_WRITE + 2 + + ) + +290 + #SYNC_FILE_RANGE_WAIT_AFTER + 4 + + ) + +295 + #SPLICE_F_MOVE + 1 + + ) + +296 + #SPLICE_F_NONBLOCK + 2 + + ) + +299 + #SPLICE_F_MORE + 4 + + ) + +300 + #SPLICE_F_GIFT + 8 + + ) + +304 + #FALLOC_FL_KEEP_SIZE + 1 + + ) + +307 + #FALLOC_FL_PUNCH_HOLE + 2 + + ) + +311 + sf�e_h�d� + + +313 + mh�d�_by�s +; + +314 + mh�d�_ty� +; + +316 + mf_h�d� +[0]; + +320 + #MAX_HANDLE_SZ + 128 + + ) + +324 #ifde� +__USE_ATFILE + + +325 + #AT_FDCWD + -100 + + ) + +328 + #AT_SYMLINK_NOFOLLOW + 0x100 + + ) + +329 + #AT_REMOVEDIR + 0x200 + + ) + +331 + #AT_SYMLINK_FOLLOW + 0x400 + + ) + +332 #ifde� +__USE_GNU + + +333 + #AT_NO_AUTOMOUNT + 0x800 + + ) + +335 + #AT_EMPTY_PATH + 0x1000 + + ) + +337 + #AT_EACCESS + 0x200 + + ) + +341 + g__BEGIN_DECLS + + +343 #ifde� +__USE_GNU + + +346 +ssize_t + + $�adah�d + ( +__fd +, +__off64_t + +__off�t +, +size_t + +__cou� +) + +347 +__THROW +; + +354 + `sync_f�e_�nge + ( +__fd +, +__off64_t + +__off�t +, __off64_� +__cou� +, + +355 +__�ags +); + +362 +ssize_t + + `vm�li� + ( +__fdout +, cڡ +iovec + * +__iov +, + +363 +size_t + +__cou� +, +__�ags +); + +369 +ssize_t + + `�li� + ( +__fd� +, +__off64_t + * +__off� +, +__fdout +, + +370 +__off64_t + * +__offout +, +size_t + +__�n +, + +371 +__�ags +); + +377 +ssize_t + + `�e + ( +__fd� +, +__fdout +, +size_t + +__�n +, + +378 +__�ags +); + +384 #i�de� +__USE_FILE_OFFSET64 + + +385 + `��o�� + ( +__fd +, +__mode +, +__off_t + +__off�t +, __off_� +__�n +); + +387 #ifde� +__REDIRECT + + +388 + `__REDIRECT + ( +��o�� +, ( +__fd +, +__mode +, +__off64_t + +__off�t +, + +389 +__off64_t + +__�n +), + +390 +��o��64 +); + +392 + #��o�� + +��o��64 + + + ) + +395 #ifde� +__USE_LARGEFILE64 + + +396 + `��o��64 + ( +__fd +, +__mode +, +__off64_t + +__off�t +, + +397 +__off64_t + +__�n +); + +402 + $�me_to_h�d�_� + ( +__dfd +, cڡ * +__�me +, + +403 +f�e_h�d� + * +__h�d� +, * +__m�_id +, + +404 +__�ags +� +__THROW +; + +410 + `ݒ_by_h�d�_� + ( +__mou�d�fd +, +f�e_h�d� + * +__h�d� +, + +411 +__�ags +); + +415 +__END_DECLS + + + @/usr/include/bits/libio-ldbl.h + +19 #i�de� +_IO_STDIO_H + + +23 + $__LDBL_REDIR_DECL + ( +_IO_vfs�nf +) + +24 + `__LDBL_REDIR_DECL + ( +_IO_v�r�tf +) + + @/usr/include/bits/local_lim.h + +24 #i�de� +NR_OPEN + + +25 + #__undef_NR_OPEN + + + ) + +27 #i�de� +LINK_MAX + + +28 + #__undef_LINK_MAX + + + ) + +30 #i�de� +OPEN_MAX + + +31 + #__undef_OPEN_MAX + + + ) + +33 #i�de� +ARG_MAX + + +34 + #__undef_ARG_MAX + + + ) + +38 + ~<l�ux/lim�s.h +> + +41 #ifde� +__undef_NR_OPEN + + +42 #unde� +NR_OPEN + + +43 #unde� +__undef_NR_OPEN + + +46 #ifde� +__undef_LINK_MAX + + +47 #unde� +LINK_MAX + + +48 #unde� +__undef_LINK_MAX + + +51 #ifde� +__undef_OPEN_MAX + + +52 #unde� +OPEN_MAX + + +53 #unde� +__undef_OPEN_MAX + + +56 #ifde� +__undef_ARG_MAX + + +57 #unde� +ARG_MAX + + +58 #unde� +__undef_ARG_MAX + + +62 + #_POSIX_THREAD_KEYS_MAX + 128 + + ) + +64 + #PTHREAD_KEYS_MAX + 1024 + + ) + +67 + #_POSIX_THREAD_DESTRUCTOR_ITERATIONS + 4 + + ) + +69 + #PTHREAD_DESTRUCTOR_ITERATIONS + +_POSIX_THREAD_DESTRUCTOR_ITERATIONS + + + ) + +72 + #_POSIX_THREAD_THREADS_MAX + 64 + + ) + +74 #unde� +PTHREAD_THREADS_MAX + + +78 + #AIO_PRIO_DELTA_MAX + 20 + + ) + +81 + #PTHREAD_STACK_MIN + 16384 + + ) + +84 + #DELAYTIMER_MAX + 2147483647 + + ) + +87 + #TTY_NAME_MAX + 32 + + ) + +90 + #LOGIN_NAME_MAX + 256 + + ) + +93 + #HOST_NAME_MAX + 64 + + ) + +96 + #MQ_PRIO_MAX + 32768 + + ) + +99 + #SEM_VALUE_MAX + (2147483647) + + ) + + @/usr/include/bits/param.h + +19 #i�de� +_SYS_PARAM_H + + +23 #i�de� +ARG_MAX + + +24 + #__undef_ARG_MAX + + + ) + +27 + ~<l�ux/lim�s.h +> + +28 + ~<l�ux/��m.h +> + +31 #ifde� +__undef_ARG_MAX + + +32 #unde� +ARG_MAX + + +33 #unde� +__undef_ARG_MAX + + +36 + #MAXSYMLINKS + 20 + + ) + +41 + #NOFILE + 256 + + ) + +42 + #NCARGS + 131072 + + ) + + @/usr/include/bits/poll.h + +18 #i�de� +_SYS_POLL_H + + +25 + #POLLIN + 0x001 + + ) + +26 + #POLLPRI + 0x002 + + ) + +27 + #POLLOUT + 0x004 + + ) + +29 #i� +def�ed + +__USE_XOPEN + || def�ed +__USE_XOPEN2K8 + + +31 + #POLLRDNORM + 0x040 + + ) + +32 + #POLLRDBAND + 0x080 + + ) + +33 + #POLLWRNORM + 0x100 + + ) + +34 + #POLLWRBAND + 0x200 + + ) + +37 #ifde� +__USE_GNU + + +39 + #POLLMSG + 0x400 + + ) + +40 + #POLLREMOVE + 0x1000 + + ) + +41 + #POLLRDHUP + 0x2000 + + ) + +47 + #POLLERR + 0x008 + + ) + +48 + #POLLHUP + 0x010 + + ) + +49 + #POLLNVAL + 0x020 + + ) + + @/usr/include/bits/poll2.h + +19 #i�de� +_SYS_POLL_H + + +24 +__BEGIN_DECLS + + +26 +__REDIRECT + ( +__p�l_��s +, ( +p�lfd + * +__fds +, +nfds_t + +__nfds +, + +27 +__timeout +), +p�l +); + +28 +__p�l_chk + ( +p�lfd + * +__fds +, +nfds_t + +__nfds +, +__timeout +, + +29 +__SIZE_TYPE__ + +__fd�� +); + +30 +__REDIRECT + ( +__p�l_chk_w�n +, ( +p�lfd + * +__fds +, +nfds_t + +__nfds +, + +31 +__timeout +, +__SIZE_TYPE__ + +__fd�� +), + +32 +__p�l_chk +) + +33 +__w�ljr + ("poll called with fds buffer�oo small file�fds�ntries"); + +35 +__f�tify_fun�i� + + +36 + $p�l + ( +p�lfd + * +__fds +, +nfds_t + +__nfds +, +__timeout +) + +38 i�( + `__bos + ( +__fds +�!�( +__SIZE_TYPE__ +) -1) + +40 i�(! + `__bu�t�_cڡ�t_p + ( +__nfds +)) + +41 + `__p�l_chk + ( +__fds +, +__nfds +, +__timeout +, + `__bos + (__fds)); + +42 i�( + `__bos + ( +__fds +�/ (*__fds�< +__nfds +) + +43 + `__p�l_chk_w�n + ( +__fds +, +__nfds +, +__timeout +, + `__bos + (__fds)); + +46 + `__p�l_��s + ( +__fds +, +__nfds +, +__timeout +); + +47 + } +} + +50 #ifde� +__USE_GNU + + +51 +__REDIRECT + ( +__��l_��s +, ( +p�lfd + * +__fds +, +nfds_t + +__nfds +, + +52 cڡ +time�ec + * +__timeout +, + +53 cڡ +__sig�t_t + * +__ss +), +��l +); + +54 +__��l_chk + ( +p�lfd + * +__fds +, +nfds_t + +__nfds +, + +55 cڡ +time�ec + * +__timeout +, + +56 cڡ +__sig�t_t + * +__ss +, +__SIZE_TYPE__ + +__fd�� +); + +57 +__REDIRECT + ( +__��l_chk_w�n +, ( +p�lfd + * +__fds +, +nfds_t + +__nfds +, + +58 cڡ +time�ec + * +__timeout +, + +59 cڡ +__sig�t_t + * +__ss +, + +60 +__SIZE_TYPE__ + +__fd�� +), + +61 +__��l_chk +) + +62 +__w�ljr + ("ppoll called with fds buffer�oo small file�fds�ntries"); + +64 +__f�tify_fun�i� + + +65 + $��l + ( +p�lfd + * +__fds +, +nfds_t + +__nfds +, cڡ +time�ec + * +__timeout +, + +66 cڡ +__sig�t_t + * +__ss +) + +68 i�( + `__bos + ( +__fds +�!�( +__SIZE_TYPE__ +) -1) + +70 i�(! + `__bu�t�_cڡ�t_p + ( +__nfds +)) + +71 + `__��l_chk + ( +__fds +, +__nfds +, +__timeout +, +__ss +, + `__bos + (__fds)); + +72 i�( + `__bos + ( +__fds +�/ (*__fds�< +__nfds +) + +73 + `__��l_chk_w�n + ( +__fds +, +__nfds +, +__timeout +, +__ss +, + +74 + `__bos + ( +__fds +)); + +77 + `__��l_��s + ( +__fds +, +__nfds +, +__timeout +, +__ss +); + +78 + } +} + +81 + g__END_DECLS + + + @/usr/include/bits/sched.h + +20 #i�de� +__�ed_sched��m + + +22 #i�de� +_SCHED_H + + +28 + #SCHED_OTHER + 0 + + ) + +29 + #SCHED_FIFO + 1 + + ) + +30 + #SCHED_RR + 2 + + ) + +31 #ifde� +__USE_GNU + + +32 + #SCHED_BATCH + 3 + + ) + +33 + #SCHED_IDLE + 5 + + ) + +35 + #SCHED_RESET_ON_FORK + 0x40000000 + + ) + +38 #ifde� +__USE_GNU + + +40 + #CSIGNAL + 0x000000f� + + ) + +41 + #CLONE_VM + 0x00000100 + + ) + +42 + #CLONE_FS + 0x00000200 + + ) + +43 + #CLONE_FILES + 0x00000400 + + ) + +44 + #CLONE_SIGHAND + 0x00000800 + + ) + +45 + #CLONE_PTRACE + 0x00002000 + + ) + +46 + #CLONE_VFORK + 0x00004000 + + ) + +48 + #CLONE_PARENT + 0x00008000 + + ) + +50 + #CLONE_THREAD + 0x00010000 + + ) + +51 + #CLONE_NEWNS + 0x00020000 + + ) + +52 + #CLONE_SYSVSEM + 0x00040000 + + ) + +53 + #CLONE_SETTLS + 0x00080000 + + ) + +54 + #CLONE_PARENT_SETTID + 0x00100000 + + ) + +56 + #CLONE_CHILD_CLEARTID + 0x00200000 + + ) + +58 + #CLONE_DETACHED + 0x00400000 + + ) + +59 + #CLONE_UNTRACED + 0x00800000 + + ) + +61 + #CLONE_CHILD_SETTID + 0x01000000 + + ) + +63 + #CLONE_NEWUTS + 0x04000000 + + ) + +64 + #CLONE_NEWIPC + 0x08000000 + + ) + +65 + #CLONE_NEWUSER + 0x10000000 + + ) + +66 + #CLONE_NEWPID + 0x20000000 + + ) + +67 + #CLONE_NEWNET + 0x40000000 + + ) + +68 + #CLONE_IO + 0x80000000 + + ) + +72 + ssched_��m + + +74 + m__sched_�iܙy +; + +77 + g__BEGIN_DECLS + + +79 #ifde� +__USE_GNU + + +81 +��e + ((* +__� +�(* +__�g +), * +__ch�d_�ack +, + +82 +__�ags +, * +__�g +, ...� +__THROW +; + +85 + $unsh�e + ( +__�ags +� +__THROW +; + +88 + $sched_g��u + (� +__THROW +; + +91 + $��s + ( +__fd +, +__n�y� +� +__THROW +; + +95 +__END_DECLS + + +99 #i�! +def�ed + +__def�ed_sched��m + \ + +100 && ( +def�ed + +__�ed_sched��m + || def�ed +_SCHED_H +) + +101 + #__def�ed_sched��m + 1 + + ) + +103 + s__sched_��m + + +105 +__sched_�iܙy +; + +107 #unde� +__�ed_sched��m + + +111 #i� +def�ed + +_SCHED_H + && !def�ed +__�u_�t_t_def�ed + + +112 + #__�u_�t_t_def�ed + + + ) + +114 + #__CPU_SETSIZE + 1024 + + ) + +115 + #__NCPUBITS + (8 * ( +__�u_mask +)) + + ) + +118 + t__�u_mask +; + +121 + #__CPUELT +( +�u +�((�u�/ +__NCPUBITS +) + + ) + +122 + #__CPUMASK +( +�u +�(( +__�u_mask +�1 << ((�u�% +__NCPUBITS +)) + + ) + +127 +__�u_mask + +__b�s +[ +__CPU_SETSIZE + / +__NCPUBITS +]; + +128 } + t�u_�t_t +; + +131 #i� + `__GNUC_PREREQ + (2, 91) + +132 + #__CPU_ZERO_S +( +�tsize +, +�u�� +) \ + +133 d� + `__bu�t�_mem�t + ( +�u�� +, '\0', +�tsize +); 0) + + ) + +135 + #__CPU_ZERO_S +( +�tsize +, +�u�� +) \ + +137 +size_t + +__i +; \ + +138 +size_t + +__imax + = ( +�tsize +�/ ( +__�u_mask +); \ + +139 +__�u_mask + * +__b�s + = ( +�u�� +)->__bits; \ + +140 +__i + = 0; __�< +__imax +; ++__i) \ + +141 +__b�s +[ +__i +] = 0; \ + +142 + } +} 0) + + ) + +144 + #__CPU_SET_S +( +�u +, +�tsize +, +�u�� +) \ + +145 ( +__ex�nsi�__ + \ + +146 ({ +size_t + +__�u + = ( +�u +); \ + +147 +__�u + / 8 < ( +�tsize +) \ + +148 ? ((( +__�u_mask + *�(( +�u�� +)-> +__b�s +))[ + `__CPUELT + ( +__�u +)] \ + +149 |� + `__CPUMASK + ( +__�u +)) \ + +150 : 0; })) + + ) + +151 + #__CPU_CLR_S +( +�u +, +�tsize +, +�u�� +) \ + +152 ( +__ex�nsi�__ + \ + +153 ({ +size_t + +__�u + = ( +�u +); \ + +154 +__�u + / 8 < ( +�tsize +) \ + +155 ? ((( +__�u_mask + *�(( +�u�� +)-> +__b�s +))[ + `__CPUELT + ( +__�u +)] \ + +156 &�~ + `__CPUMASK + ( +__�u +)) \ + +157 : 0; })) + + ) + +158 + #__CPU_ISSET_S +( +�u +, +�tsize +, +�u�� +) \ + +159 ( +__ex�nsi�__ + \ + +160 ({ +size_t + +__�u + = ( +�u +); \ + +161 +__�u + / 8 < ( +�tsize +) \ + +162 ? ((((cڡ +__�u_mask + *�(( +�u�� +)-> +__b�s +))[ + `__CPUELT + ( +__�u +)] \ + +163 & + `__CPUMASK + ( +__�u +))) != 0 \ + +164 : 0; })) + + ) + +166 + #__CPU_COUNT_S +( +�tsize +, +�u�� +) \ + +167 + `__sched_�ucou� + ( +�tsize +, +�u�� +) + + ) + +169 #i� +__GNUC_PREREQ + (2, 91) + +170 + #__CPU_EQUAL_S +( +�tsize +, +�u��1 +, +�u��2 +) \ + +171 ( + `__bu�t�_memcmp + ( +�u��1 +, +�u��2 +, +�tsize +�=�0) + + ) + +173 + #__CPU_EQUAL_S +( +�tsize +, +�u��1 +, +�u��2 +) \ + +174 ( +__ex�nsi�__ + \ + +175 ({ cڡ +__�u_mask + * +__�r1 + = ( +�u��1 +)-> +__b�s +; \ + +176 cڡ +__�u_mask + * +__�r2 + = ( +�u��2 +)-> +__b�s +; \ + +177 +size_t + +__imax + = ( +�tsize +�/ ( +__�u_mask +); \ + +178 +size_t + +__i +; \ + +179 +__i + = 0; __�< +__imax +; ++__i) \ + +180 i�( +__�r1 +[ +__i +] !� +__�r2 +[__i]) \ + +182 +__i + =� +__imax +; })) + + ) + +185 + #__CPU_OP_S +( +�tsize +, +de��t +, +�c�t1 +, +�c�t2 +, +� +) \ + +186 ( +__ex�nsi�__ + \ + +187 ({ +�u_�t_t + * +__de� + = ( +de��t +); \ + +188 cڡ +__�u_mask + * +__�r1 + = ( +�c�t1 +)-> +__b�s +; \ + +189 cڡ +__�u_mask + * +__�r2 + = ( +�c�t2 +)-> +__b�s +; \ + +190 +size_t + +__imax + = ( +�tsize +�/ ( +__�u_mask +); \ + +191 +size_t + +__i +; \ + +192 +__i + = 0; __�< +__imax +; ++__i) \ + +193 (( +__�u_mask + *� +__de� +-> +__b�s +)[ +__i +] = +__�r1 +[__i] +� + +__�r2 +[__i]; \ + +194 +__de� +; })) + + ) + +196 + #__CPU_ALLOC_SIZE +( +cou� +) \ + +197 (((( +cou� +�+ +__NCPUBITS + - 1�/ __NCPUBITS�* ( +__�u_mask +)) + + ) + +198 + #__CPU_ALLOC +( +cou� +� + `__sched_�u�loc + (cou�) + + ) + +199 + #__CPU_FREE +( +�u�t +� + `__sched_�u� + (�u�t) + + ) + +201 +__BEGIN_DECLS + + +203 + $__sched_�ucou� + ( +size_t + +__�tsize +, cڡ +�u_�t_t + * +__�� +) + +204 +__THROW +; + +205 +�u_�t_t + * + $__sched_�u�loc + ( +size_t + +__cou� +� +__THROW + +__wur +; + +206 + $__sched_�u� + ( +�u_�t_t + * +__�t +� +__THROW +; + +208 +__END_DECLS + + + @/usr/include/bits/sockaddr.h + +23 #i�de� +_BITS_SOCKADDR_H + + +24 + #_BITS_SOCKADDR_H + 1 + + ) + +28 + t�_�m�y_t +; + +34 + #__SOCKADDR_COMMON +( +�_�efix +) \ + +35 +�_�m�y_t + +�_�efix +## +�m�y + + + ) + +37 + #__SOCKADDR_COMMON_SIZE + ( ()) + + ) + + @/usr/include/bits/socket_type.h + +19 #i�de� +_SYS_SOCKET_H + + +24 + e__sock�_ty� + + +26 + mSOCK_STREAM + = 1, + +28 + #SOCK_STREAM + +SOCK_STREAM + + + ) + +29 + mSOCK_DGRAM + = 2, + +31 + #SOCK_DGRAM + +SOCK_DGRAM + + + ) + +32 + mSOCK_RAW + = 3, + +33 + #SOCK_RAW + +SOCK_RAW + + + ) + +34 + mSOCK_RDM + = 4, + +35 + #SOCK_RDM + +SOCK_RDM + + + ) + +36 + mSOCK_SEQPACKET + = 5, + +38 + #SOCK_SEQPACKET + +SOCK_SEQPACKET + + + ) + +39 + mSOCK_DCCP + = 6, + +40 + #SOCK_DCCP + +SOCK_DCCP + + + ) + +41 + mSOCK_PACKET + = 10, + +44 + #SOCK_PACKET + +SOCK_PACKET + + + ) + +49 + mSOCK_CLOEXEC + = 02000000, + +51 + #SOCK_CLOEXEC + +SOCK_CLOEXEC + + + ) + +52 + mSOCK_NONBLOCK + = 00004000 + +54 + #SOCK_NONBLOCK + +SOCK_NONBLOCK + + + ) + + @/usr/include/bits/stdio-lock.h + +19 #i�de� +_BITS_STDIO_LOCK_H + + +20 + #_BITS_STDIO_LOCK_H + 1 + + ) + +22 + ~<b�s/libc-lock.h +> + +23 + ~<low�v�lock.h +> + +27 + #_IO_lock_�ex�nsive + 1 + + ) + +29 �ru� { + mlock +; + m�t +; * + mow�r +; } + t_IO_lock_t +; + +31 + #_IO_lock_���liz� + { +LLL_LOCK_INITIALIZER +, 0, +NULL + } + + ) + +33 + #_IO_lock_�� +( +_�me +) \ + +34 (( +_�me +��( +_IO_lock_t +� +_IO_lock_���liz� + , 0) + + ) + +36 + #_IO_lock_f�i +( +_�me +) \ + +37 ((�0) + + ) + +39 + #_IO_lock_lock +( +_�me +) \ + +41 * +__�lf + = +THREAD_SELF +; \ + +42 i�(( +_�me +). +ow�r + !� +__�lf +) \ + +44 + `�l_lock + (( +_�me +). +lock +, +LLL_PRIVATE +); \ + +45 ( +_�me +). +ow�r + = +__�lf +; \ + +47 ++( +_�me +). +�t +; \ + +48 } 0) + + ) + +50 + #_IO_lock_�ylock +( +_�me +) \ + +52 +__�su� + = 0; \ + +53 * +__�lf + = +THREAD_SELF +; \ + +54 i�(( +_�me +). +ow�r + !� +__�lf +) \ + +56 i�( + `�l_�ylock + (( +_�me +). +lock +) == 0) \ + +58 ( +_�me +). +ow�r + = +__�lf +; \ + +59 ( +_�me +). +�t + = 1; \ + +62 +__�su� + = +EBUSY +; \ + +65 ++( +_�me +). +�t +; \ + +66 +__�su� +; \ + +67 }) + + ) + +69 + #_IO_lock_u�ock +( +_�me +) \ + +71 i�(--( +_�me +). +�t + == 0) \ + +73 ( +_�me +). +ow�r + = +NULL +; \ + +74 + `�l_u�ock + (( +_�me +). +lock +, +LLL_PRIVATE +); \ + +76 } 0) + + ) + +80 + #_IO_��nup_�gi�_��t +( +_f� +, +_� +) \ + +81 + `__libc_��nup_�gi�_��t + ((( +_� +)-> +_�ags + & +_IO_USER_LOCK +�=�0, +_f� +, _�) + + ) + +82 + #_IO_��nup_�gi�_��t_n�rg +( +_f� +) \ + +83 + `__libc_��nup_�gi�_��t + (1, +_f� +, +NULL +) + + ) + +84 + #_IO_��nup_�gi�_�d +( +_do� +) \ + +85 + `__libc_��nup_�gi�_�d + ( +_do� +) + + ) + +87 #i� +def�ed + +_LIBC + && !def�ed +NOT_IN_libc + + +89 #ifde� +__EXCEPTIONS + + +90 + #_IO_acqu�e_lock +( +_� +) \ + +92 +_IO_FILE + * +_IO_acqu�e_lock_f�e + \ + +93 + `__��ibu�__ +(( + `��nup + ( +_IO_acqu�e_lock_f� +))) \ + +94 �( +_� +); \ + +95 + `_IO_�ockf�e + ( +_IO_acqu�e_lock_f�e +); + + ) + +96 + #_IO_acqu�e_lock_��r_�ags2 +( +_� +) \ + +98 +_IO_FILE + * +_IO_acqu�e_lock_f�e + \ + +99 + `__��ibu�__ +(( + `��nup + ( +_IO_acqu�e_lock_��r_�ags2_f� +))) \ + +100 �( +_� +); \ + +101 + `_IO_�ockf�e + ( +_IO_acqu�e_lock_f�e +); + + ) + +103 + #_IO_acqu�e_lock +( +_� +� +_IO_acqu�e_lock_�eds_ex��i�s_�ab�d + + + ) + +104 + #_IO_acqu�e_lock_��r_�ags2 +( +_� +� + `_IO_acqu�e_lock + (_�) + + ) + +106 + #_IO_��a�_lock +( +_� +�; } 0) + + ) + + @/usr/include/bits/timex.h + +18 #i�def +_BITS_TIMEX_H + + +19 + #_BITS_TIMEX_H + 1 + + ) + +21 + ~<b�s/ty�s.h +> + +25 + stimex + + +27 + mmodes +; + +28 +__sys��_��g_t + + moff�t +; + +29 +__sys��_��g_t + + m�eq +; + +30 +__sys��_��g_t + + mmax�r� +; + +31 +__sys��_��g_t + + me��r� +; + +32 + m��us +; + +33 +__sys��_��g_t + + mcڡ�t +; + +34 +__sys��_��g_t + + m�ecisi� +; + +35 +__sys��_��g_t + + mtޔ�� +; + +36 +timev� + + mtime +; + +37 +__sys��_��g_t + + mtick +; + +38 +__sys��_��g_t + + m�s�eq +; + +39 +__sys��_��g_t + + mj��r +; + +40 + mshi� +; + +41 +__sys��_��g_t + + m�ab� +; + +42 +__sys��_��g_t + + mj��t +; + +43 +__sys��_��g_t + + m�l�t +; + +44 +__sys��_��g_t + + m�r�t +; + +45 +__sys��_��g_t + + m�b�t +; + +47 + m�i +; + +56 + #ADJ_OFFSET + 0x0001 + + ) + +57 + #ADJ_FREQUENCY + 0x0002 + + ) + +58 + #ADJ_MAXERROR + 0x0004 + + ) + +59 + #ADJ_ESTERROR + 0x0008 + + ) + +60 + #ADJ_STATUS + 0x0010 + + ) + +61 + #ADJ_TIMECONST + 0x0020 + + ) + +62 + #ADJ_TAI + 0x0080 + + ) + +63 + #ADJ_MICRO + 0x1000 + + ) + +64 + #ADJ_NANO + 0x2000 + + ) + +65 + #ADJ_TICK + 0x4000 + + ) + +66 + #ADJ_OFFSET_SINGLESHOT + 0x8001 + + ) + +67 + #ADJ_OFFSET_SS_READ + 0xa001 + + ) + +70 + #MOD_OFFSET + +ADJ_OFFSET + + + ) + +71 + #MOD_FREQUENCY + +ADJ_FREQUENCY + + + ) + +72 + #MOD_MAXERROR + +ADJ_MAXERROR + + + ) + +73 + #MOD_ESTERROR + +ADJ_ESTERROR + + + ) + +74 + #MOD_STATUS + +ADJ_STATUS + + + ) + +75 + #MOD_TIMECONST + +ADJ_TIMECONST + + + ) + +76 + #MOD_CLKB + +ADJ_TICK + + + ) + +77 + #MOD_CLKA + +ADJ_OFFSET_SINGLESHOT + + + ) + +78 + #MOD_TAI + +ADJ_TAI + + + ) + +79 + #MOD_MICRO + +ADJ_MICRO + + + ) + +80 + #MOD_NANO + +ADJ_NANO + + + ) + +84 + #STA_PLL + 0x0001 + + ) + +85 + #STA_PPSFREQ + 0x0002 + + ) + +86 + #STA_PPSTIME + 0x0004 + + ) + +87 + #STA_FLL + 0x0008 + + ) + +89 + #STA_INS + 0x0010 + + ) + +90 + #STA_DEL + 0x0020 + + ) + +91 + #STA_UNSYNC + 0x0040 + + ) + +92 + #STA_FREQHOLD + 0x0080 + + ) + +94 + #STA_PPSSIGNAL + 0x0100 + + ) + +95 + #STA_PPSJITTER + 0x0200 + + ) + +96 + #STA_PPSWANDER + 0x0400 + + ) + +97 + #STA_PPSERROR + 0x0800 + + ) + +99 + #STA_CLOCKERR + 0x1000 + + ) + +100 + #STA_NANO + 0x2000 + + ) + +101 + #STA_MODE + 0x4000 + + ) + +102 + #STA_CLK + 0x8000 + + ) + +105 + #STA_RONLY + ( +STA_PPSSIGNAL + | +STA_PPSJITTER + | +STA_PPSWANDER + | \ + +106 +STA_PPSERROR + | +STA_CLOCKERR + | +STA_NANO + | +STA_MODE + | +STA_CLK +) + + ) + + @/usr/include/bits/typesizes.h + +19 #i�de� +_BITS_TYPES_H + + +23 #i�def +_BITS_TYPESIZES_H + + +24 + #_BITS_TYPESIZES_H + 1 + + ) + +30 #i� +def�ed + +__x86_64__ + && def�ed +__ILP32__ + + +31 + #__SYSCALL_SLONG_TYPE + +__SQUAD_TYPE + + + ) + +32 + #__SYSCALL_ULONG_TYPE + +__UQUAD_TYPE + + + ) + +34 + #__SYSCALL_SLONG_TYPE + +__SLONGWORD_TYPE + + + ) + +35 + #__SYSCALL_ULONG_TYPE + +__ULONGWORD_TYPE + + + ) + +38 + #__DEV_T_TYPE + +__UQUAD_TYPE + + + ) + +39 + #__UID_T_TYPE + +__U32_TYPE + + + ) + +40 + #__GID_T_TYPE + +__U32_TYPE + + + ) + +41 + #__INO_T_TYPE + +__SYSCALL_ULONG_TYPE + + + ) + +42 + #__INO64_T_TYPE + +__UQUAD_TYPE + + + ) + +43 + #__MODE_T_TYPE + +__U32_TYPE + + + ) + +44 #ifde� +__x86_64__ + + +45 + #__NLINK_T_TYPE + +__SYSCALL_ULONG_TYPE + + + ) + +46 + #__FSWORD_T_TYPE + +__SYSCALL_SLONG_TYPE + + + ) + +48 + #__NLINK_T_TYPE + +__UWORD_TYPE + + + ) + +49 + #__FSWORD_T_TYPE + +__SWORD_TYPE + + + ) + +51 + #__OFF_T_TYPE + +__SYSCALL_SLONG_TYPE + + + ) + +52 + #__OFF64_T_TYPE + +__SQUAD_TYPE + + + ) + +53 + #__PID_T_TYPE + +__S32_TYPE + + + ) + +54 + #__RLIM_T_TYPE + +__SYSCALL_ULONG_TYPE + + + ) + +55 + #__RLIM64_T_TYPE + +__UQUAD_TYPE + + + ) + +56 + #__BLKCNT_T_TYPE + +__SYSCALL_SLONG_TYPE + + + ) + +57 + #__BLKCNT64_T_TYPE + +__SQUAD_TYPE + + + ) + +58 + #__FSBLKCNT_T_TYPE + +__SYSCALL_ULONG_TYPE + + + ) + +59 + #__FSBLKCNT64_T_TYPE + +__UQUAD_TYPE + + + ) + +60 + #__FSFILCNT_T_TYPE + +__SYSCALL_ULONG_TYPE + + + ) + +61 + #__FSFILCNT64_T_TYPE + +__UQUAD_TYPE + + + ) + +62 + #__ID_T_TYPE + +__U32_TYPE + + + ) + +63 + #__CLOCK_T_TYPE + +__SYSCALL_SLONG_TYPE + + + ) + +64 + #__TIME_T_TYPE + +__SYSCALL_SLONG_TYPE + + + ) + +65 + #__USECONDS_T_TYPE + +__U32_TYPE + + + ) + +66 + #__SUSECONDS_T_TYPE + +__SYSCALL_SLONG_TYPE + + + ) + +67 + #__DADDR_T_TYPE + +__S32_TYPE + + + ) + +68 + #__KEY_T_TYPE + +__S32_TYPE + + + ) + +69 + #__CLOCKID_T_TYPE + +__S32_TYPE + + + ) + +70 + #__TIMER_T_TYPE + * + + ) + +71 + #__BLKSIZE_T_TYPE + +__SYSCALL_SLONG_TYPE + + + ) + +72 + #__FSID_T_TYPE + s�u� { +__v� +[2]; } + + ) + +73 + #__SSIZE_T_TYPE + +__SWORD_TYPE + + + ) + +75 #ifde� +__x86_64__ + + +79 + #__OFF_T_MATCHES_OFF64_T + 1 + + ) + +82 + #__INO_T_MATCHES_INO64_T + 1 + + ) + +86 + #__FD_SETSIZE + 1024 + + ) + + @/usr/include/bits/uio.h + +18 #i�! +def�ed + +_SYS_UIO_H + && !def�ed +_FCNTL_H + + +22 #i�de� +_BITS_UIO_H + + +23 + #_BITS_UIO_H + 1 + + ) + +25 + ~<sys/ty�s.h +> + +39 + #UIO_MAXIOV + 1024 + + ) + +43 + siovec + + +45 * + miov_ba� +; + +46 +size_t + + miov_�n +; + +52 #ifde� +__USE_GNU + + +53 #i� +def�ed + +_SYS_UIO_H + && !def�ed +_BITS_UIO_H_FOR_SYS_UIO_H + + +54 + #_BITS_UIO_H_FOR_SYS_UIO_H + 1 + + ) + +56 +__BEGIN_DECLS + + +59 +ssize_t + + $�o�ss_vm_�adv + ( +pid_t + +__pid +, cڡ +iovec + * +__lvec +, + +60 +__liov�t +, + +61 cڡ +iovec + * +__rvec +, + +62 +__riov�t +, + +63 +__�ags +) + +64 +__THROW +; + +67 +ssize_t + + $�o�ss_vm_wr�ev + ( +pid_t + +__pid +, cڡ +iovec + * +__lvec +, + +68 +__liov�t +, + +69 cڡ +iovec + * +__rvec +, + +70 +__riov�t +, + +71 +__�ags +) + +72 +__THROW +; + +74 +__END_DECLS + + + @/usr/include/gnu/stubs.h + +6 #i�! +def�ed + +__x86_64__ + + +7 + ~<gnu/�ubs-32.h +> + +9 #i� +def�ed + +__x86_64__ + && def�ed +__LP64__ + + +10 + ~<gnu/�ubs-64.h +> + +12 #i� +def�ed + +__x86_64__ + && def�ed +__ILP32__ + + +13 + ~<gnu/�ubs-x32.h +> + + @/usr/include/krb5.h + +8 + ~<krb5/krb5.h +> + + @/usr/include/linux/byteorder/little_endian.h + +1 #i�de� +_LINUX_BYTEORDER_LITTLE_ENDIAN_H + + +2 + #_LINUX_BYTEORDER_LITTLE_ENDIAN_H + + + ) + +4 #i�de� +__LITTLE_ENDIAN + + +5 + #__LITTLE_ENDIAN + 1234 + + ) + +7 #i�de� +__LITTLE_ENDIAN_BITFIELD + + +8 + #__LITTLE_ENDIAN_BITFIELD + + + ) + +11 + ~<l�ux/ty�s.h +> + +12 + ~<l�ux/swab.h +> + +14 + #__cڡ�t_ht�l +( +x +�(( +__be32 +) + `___cڡ�t_swab32 +((x))) + + ) + +15 + #__cڡ�t_�ohl +( +x +� + `___cڡ�t_swab32 +(( +__be32 +)(x)) + + ) + +16 + #__cڡ�t_ht�s +( +x +�(( +__be16 +) + `___cڡ�t_swab16 +((x))) + + ) + +17 + #__cڡ�t_�ohs +( +x +� + `___cڡ�t_swab16 +(( +__be16 +)(x)) + + ) + +18 + #__cڡ�t_�u_to_�64 +( +x +�(( +__�64 +)( +__u64 +)(x)) + + ) + +19 + #__cڡ�t_�64_to_�u +( +x +�(( +__u64 +)( +__�64 +)(x)) + + ) + +20 + #__cڡ�t_�u_to_�32 +( +x +�(( +__�32 +)( +__u32 +)(x)) + + ) + +21 + #__cڡ�t_�32_to_�u +( +x +�(( +__u32 +)( +__�32 +)(x)) + + ) + +22 + #__cڡ�t_�u_to_�16 +( +x +�(( +__�16 +)( +__u16 +)(x)) + + ) + +23 + #__cڡ�t_�16_to_�u +( +x +�(( +__u16 +)( +__�16 +)(x)) + + ) + +24 + #__cڡ�t_�u_to_be64 +( +x +�(( +__be64 +) + `___cڡ�t_swab64 +((x))) + + ) + +25 + #__cڡ�t_be64_to_�u +( +x +� + `___cڡ�t_swab64 +(( +__u64 +)( +__be64 +)(x)) + + ) + +26 + #__cڡ�t_�u_to_be32 +( +x +�(( +__be32 +) + `___cڡ�t_swab32 +((x))) + + ) + +27 + #__cڡ�t_be32_to_�u +( +x +� + `___cڡ�t_swab32 +(( +__u32 +)( +__be32 +)(x)) + + ) + +28 + #__cڡ�t_�u_to_be16 +( +x +�(( +__be16 +) + `___cڡ�t_swab16 +((x))) + + ) + +29 + #__cڡ�t_be16_to_�u +( +x +� + `___cڡ�t_swab16 +(( +__u16 +)( +__be16 +)(x)) + + ) + +30 + #__�u_to_�64 +( +x +�(( +__�64 +)( +__u64 +)(x)) + + ) + +31 + #__�64_to_�u +( +x +�(( +__u64 +)( +__�64 +)(x)) + + ) + +32 + #__�u_to_�32 +( +x +�(( +__�32 +)( +__u32 +)(x)) + + ) + +33 + #__�32_to_�u +( +x +�(( +__u32 +)( +__�32 +)(x)) + + ) + +34 + #__�u_to_�16 +( +x +�(( +__�16 +)( +__u16 +)(x)) + + ) + +35 + #__�16_to_�u +( +x +�(( +__u16 +)( +__�16 +)(x)) + + ) + +36 + #__�u_to_be64 +( +x +�(( +__be64 +) + `__swab64 +((x))) + + ) + +37 + #__be64_to_�u +( +x +� + `__swab64 +(( +__u64 +)( +__be64 +)(x)) + + ) + +38 + #__�u_to_be32 +( +x +�(( +__be32 +) + `__swab32 +((x))) + + ) + +39 + #__be32_to_�u +( +x +� + `__swab32 +(( +__u32 +)( +__be32 +)(x)) + + ) + +40 + #__�u_to_be16 +( +x +�(( +__be16 +) + `__swab16 +((x))) + + ) + +41 + #__be16_to_�u +( +x +� + `__swab16 +(( +__u16 +)( +__be16 +)(x)) + + ) + +43 +__�l�e__ + +__�64 + + $__�u_to_�64p +(cڡ +__u64 + * +p +) + +45 ( +__�64 +)* +p +; + +46 + } +} + +47 +__�l�e__ + +__u64 + + $__�64_to_�up +(cڡ +__�64 + * +p +) + +49 ( +__u64 +)* +p +; + +50 + } +} + +51 +__�l�e__ + +__�32 + + $__�u_to_�32p +(cڡ +__u32 + * +p +) + +53 ( +__�32 +)* +p +; + +54 + } +} + +55 +__�l�e__ + +__u32 + + $__�32_to_�up +(cڡ +__�32 + * +p +) + +57 ( +__u32 +)* +p +; + +58 + } +} + +59 +__�l�e__ + +__�16 + + $__�u_to_�16p +(cڡ +__u16 + * +p +) + +61 ( +__�16 +)* +p +; + +62 + } +} + +63 +__�l�e__ + +__u16 + + $__�16_to_�up +(cڡ +__�16 + * +p +) + +65 ( +__u16 +)* +p +; + +66 + } +} + +67 +__�l�e__ + +__be64 + + $__�u_to_be64p +(cڡ +__u64 + * +p +) + +69 ( +__be64 +) + `__swab64p +( +p +); + +70 + } +} + +71 +__�l�e__ + +__u64 + + $__be64_to_�up +(cڡ +__be64 + * +p +) + +73 + `__swab64p +(( +__u64 + *) +p +); + +74 + } +} + +75 +__�l�e__ + +__be32 + + $__�u_to_be32p +(cڡ +__u32 + * +p +) + +77 ( +__be32 +) + `__swab32p +( +p +); + +78 + } +} + +79 +__�l�e__ + +__u32 + + $__be32_to_�up +(cڡ +__be32 + * +p +) + +81 + `__swab32p +(( +__u32 + *) +p +); + +82 + } +} + +83 +__�l�e__ + +__be16 + + $__�u_to_be16p +(cڡ +__u16 + * +p +) + +85 ( +__be16 +) + `__swab16p +( +p +); + +86 + } +} + +87 +__�l�e__ + +__u16 + + $__be16_to_�up +(cڡ +__be16 + * +p +) + +89 + `__swab16p +(( +__u16 + *) +p +); + +90 + } +} + +91 + #__�u_to_�64s +( +x +�d�{ ()(x); } 0) + + ) + +92 + #__�64_to_�us +( +x +�d�{ ()(x); } 0) + + ) + +93 + #__�u_to_�32s +( +x +�d�{ ()(x); } 0) + + ) + +94 + #__�32_to_�us +( +x +�d�{ ()(x); } 0) + + ) + +95 + #__�u_to_�16s +( +x +�d�{ ()(x); } 0) + + ) + +96 + #__�16_to_�us +( +x +�d�{ ()(x); } 0) + + ) + +97 + #__�u_to_be64s +( +x +� + `__swab64s +((x)) + + ) + +98 + #__be64_to_�us +( +x +� + `__swab64s +((x)) + + ) + +99 + #__�u_to_be32s +( +x +� + `__swab32s +((x)) + + ) + +100 + #__be32_to_�us +( +x +� + `__swab32s +((x)) + + ) + +101 + #__�u_to_be16s +( +x +� + `__swab16s +((x)) + + ) + +102 + #__be16_to_�us +( +x +� + `__swab16s +((x)) + + ) + + @/usr/include/linux/errno.h + +1 + ~<asm/��o.h +> + + @/usr/include/linux/posix_types.h + +1 #i�de� +_LINUX_POSIX_TYPES_H + + +2 + #_LINUX_POSIX_TYPES_H + + + ) + +4 + ~<l�ux/�ddef.h +> + +21 #unde� +__FD_SETSIZE + + +22 + #__FD_SETSIZE + 1024 + + ) + +25 + mfds_b�s +[ +__FD_SETSIZE + / (8 * ())]; + +26 } + t__k��l_fd_�t +; + +29 (* + t__k��l_sigh�d�r_t +)(); + +32 + t__k��l_key_t +; + +33 + t__k��l_mqd_t +; + +35 + ~<asm/posix_ty�s.h +> + + @/usr/include/openssl/asn1.h + +59 #i�de� +HEADER_ASN1_H + + +60 + #HEADER_ASN1_H + + + ) + +62 + ~<time.h +> + +63 + ~<ݒs�/e_os2.h +> + +64 #i�de� +OPENSSL_NO_BIO + + +65 + ~<ݒs�/bio.h +> + +67 + ~<ݒs�/�ack.h +> + +68 + ~<ݒs�/��ack.h +> + +70 + ~<ݒs�/symhacks.h +> + +72 + ~<ݒs�/os�_typ.h +> + +73 #i�de� +OPENSSL_NO_DEPRECATED + + +74 + ~<ݒs�/bn.h +> + +77 #ifde� +OPENSSL_BUILD_SHLIBCRYPTO + + +78 #unde� +OPENSSL_EXTERN + + +79 + #OPENSSL_EXTERN + +OPENSSL_EXPORT + + + ) + +82 #ifde� +__�lu�lus + + +86 + #V_ASN1_UNIVERSAL + 0x00 + + ) + +87 + #V_ASN1_APPLICATION + 0x40 + + ) + +88 + #V_ASN1_CONTEXT_SPECIFIC + 0x80 + + ) + +89 + #V_ASN1_PRIVATE + 0xc0 + + ) + +91 + #V_ASN1_CONSTRUCTED + 0x20 + + ) + +92 + #V_ASN1_PRIMITIVE_TAG + 0x1f + + ) + +93 + #V_ASN1_PRIMATIVE_TAG + 0x1f + + ) + +95 + #V_ASN1_APP_CHOOSE + -2 + + ) + +96 + #V_ASN1_OTHER + -3 + + ) + +97 + #V_ASN1_ANY + -4 + + ) + +99 + #V_ASN1_UNDEF + -1 + + ) + +101 + #V_ASN1_EOC + 0 + + ) + +102 + #V_ASN1_BOOLEAN + 1 + + ) + +103 + #V_ASN1_INTEGER + 2 + + ) + +104 + #V_ASN1_BIT_STRING + 3 + + ) + +105 + #V_ASN1_OCTET_STRING + 4 + + ) + +106 + #V_ASN1_NULL + 5 + + ) + +107 + #V_ASN1_OBJECT + 6 + + ) + +108 + #V_ASN1_OBJECT_DESCRIPTOR + 7 + + ) + +109 + #V_ASN1_EXTERNAL + 8 + + ) + +110 + #V_ASN1_REAL + 9 + + ) + +111 + #V_ASN1_ENUMERATED + 10 + + ) + +112 + #V_ASN1_UTF8STRING + 12 + + ) + +113 + #V_ASN1_SEQUENCE + 16 + + ) + +114 + #V_ASN1_SET + 17 + + ) + +115 + #V_ASN1_NUMERICSTRING + 18 + + ) + +116 + #V_ASN1_PRINTABLESTRING + 19 + + ) + +117 + #V_ASN1_T61STRING + 20 + + ) + +118 + #V_ASN1_TELETEXSTRING + 20 + + ) + +119 + #V_ASN1_VIDEOTEXSTRING + 21 + + ) + +120 + #V_ASN1_IA5STRING + 22 + + ) + +121 + #V_ASN1_UTCTIME + 23 + + ) + +122 + #V_ASN1_GENERALIZEDTIME + 24 + + ) + +123 + #V_ASN1_GRAPHICSTRING + 25 + + ) + +124 + #V_ASN1_ISO64STRING + 26 + + ) + +125 + #V_ASN1_VISIBLESTRING + 26 + + ) + +126 + #V_ASN1_GENERALSTRING + 27 + + ) + +127 + #V_ASN1_UNIVERSALSTRING + 28 + + ) + +128 + #V_ASN1_BMPSTRING + 30 + + ) + +136 + #V_ASN1_NEG + 0x100 + + ) + +137 + #V_ASN1_NEG_INTEGER + (2 | +V_ASN1_NEG +) + + ) + +138 + #V_ASN1_NEG_ENUMERATED + (10 | +V_ASN1_NEG +) + + ) + +141 + #B_ASN1_NUMERICSTRING + 0x0001 + + ) + +142 + #B_ASN1_PRINTABLESTRING + 0x0002 + + ) + +143 + #B_ASN1_T61STRING + 0x0004 + + ) + +144 + #B_ASN1_TELETEXSTRING + 0x0004 + + ) + +145 + #B_ASN1_VIDEOTEXSTRING + 0x0008 + + ) + +146 + #B_ASN1_IA5STRING + 0x0010 + + ) + +147 + #B_ASN1_GRAPHICSTRING + 0x0020 + + ) + +148 + #B_ASN1_ISO64STRING + 0x0040 + + ) + +149 + #B_ASN1_VISIBLESTRING + 0x0040 + + ) + +150 + #B_ASN1_GENERALSTRING + 0x0080 + + ) + +151 + #B_ASN1_UNIVERSALSTRING + 0x0100 + + ) + +152 + #B_ASN1_OCTET_STRING + 0x0200 + + ) + +153 + #B_ASN1_BIT_STRING + 0x0400 + + ) + +154 + #B_ASN1_BMPSTRING + 0x0800 + + ) + +155 + #B_ASN1_UNKNOWN + 0x1000 + + ) + +156 + #B_ASN1_UTF8STRING + 0x2000 + + ) + +157 + #B_ASN1_UTCTIME + 0x4000 + + ) + +158 + #B_ASN1_GENERALIZEDTIME + 0x8000 + + ) + +159 + #B_ASN1_SEQUENCE + 0x10000 + + ) + +162 + #MBSTRING_FLAG + 0x1000 + + ) + +163 + #MBSTRING_UTF8 + ( +MBSTRING_FLAG +) + + ) + +164 + #MBSTRING_ASC + ( +MBSTRING_FLAG +|1) + + ) + +165 + #MBSTRING_BMP + ( +MBSTRING_FLAG +|2) + + ) + +166 + #MBSTRING_UNIV + ( +MBSTRING_FLAG +|4) + + ) + +168 + #SMIME_OLDMIME + 0x400 + + ) + +169 + #SMIME_CRLFEOL + 0x800 + + ) + +170 + #SMIME_STREAM + 0x1000 + + ) + +172 +X509_�g�_� +; + +173 +DECLARE_STACK_OF +( +X509_ALGOR +) + +175 + #DECLARE_ASN1_SET_OF +( +ty� +� + + ) + +176 + #IMPLEMENT_ASN1_SET_OF +( +ty� +� + + ) + +182 + sa�1_�x_� + + +184 * +p +; + +185 +eos +; + +186 +�r� +; + +187 +�f +; + +188 +�g +; + +189 +x�ass +; + +190 +�� +; + +191 * +max +; + +192 * +q +; + +193 ** +� +; + +194 +l�e +; + +195 } + tASN1_CTX +; + +197 + sa�1_cڡ_�x_� + + +199 cڡ * +p +; + +200 +eos +; + +201 +�r� +; + +202 +�f +; + +203 +�g +; + +204 +x�ass +; + +205 +�� +; + +206 cڡ * +max +; + +207 cڡ * +q +; + +208 cڡ ** +� +; + +209 +l�e +; + +210 } + tASN1_cڡ_CTX +; + +214 + #ASN1_OBJECT_FLAG_DYNAMIC + 0x01 + + ) + +215 + #ASN1_OBJECT_FLAG_CRITICAL + 0x02 + + ) + +216 + #ASN1_OBJECT_FLAG_DYNAMIC_STRINGS + 0x04 + + ) + +217 + #ASN1_OBJECT_FLAG_DYNAMIC_DATA + 0x08 + + ) + +218 + sa�1_obje�_� + + +220 cڡ * +� +,* +� +; + +221 +nid +; + +222 +�ngth +; + +223 cڡ * +d�a +; + +224 +�ags +; + +225 } + tASN1_OBJECT +; + +227 + #ASN1_STRING_FLAG_BITS_LEFT + 0x08 + + ) + +232 + #ASN1_STRING_FLAG_NDEF + 0x010 + + ) + +239 + #ASN1_STRING_FLAG_CONT + 0x020 + + ) + +243 + #ASN1_STRING_FLAG_MSTRING + 0x040 + + ) + +245 + sa�1_�r�g_� + + +247 +�ngth +; + +248 +ty� +; + +249 * +d�a +; + +254 +�ags +; + +262 + sASN1_ENCODING_� + + +264 * +�c +; + +265 +�n +; + +266 +modif�d +; + +267 } + tASN1_ENCODING +; + +270 + #ASN1_LONG_UNDEF + 0x7fffffffL + + ) + +272 + #STABLE_FLAGS_MALLOC + 0x01 + + ) + +273 + #STABLE_NO_MASK + 0x02 + + ) + +274 + #DIRSTRING_TYPE + \ + +275 ( +B_ASN1_PRINTABLESTRING +| +B_ASN1_T61STRING +| +B_ASN1_BMPSTRING +| +B_ASN1_UTF8STRING +) + + ) + +276 + #PKCS9STRING_TYPE + ( +DIRSTRING_TYPE +| +B_ASN1_IA5STRING +) + + ) + +278 + sa�1_�r�g_�b�_� + { + +279 +nid +; + +280 +m�size +; + +281 +maxsize +; + +282 +mask +; + +283 +�ags +; + +284 } + tASN1_STRING_TABLE +; + +286 +DECLARE_STACK_OF +( +ASN1_STRING_TABLE +) + +290 + #ub_�me + 32768 + + ) + +291 + #ub_comm�_�me + 64 + + ) + +292 + #ub_lo�l�y_�me + 128 + + ) + +293 + #ub_��e_�me + 128 + + ) + +294 + #ub_�g�iz�i�_�me + 64 + + ) + +295 + #ub_�g�iz�i�_un�_�me + 64 + + ) + +296 + #ub_t�� + 64 + + ) + +297 + #ub_ema�_add�ss + 128 + + ) + +302 +ASN1_TEMPLATE_� + + tASN1_TEMPLATE +; + +303 +ASN1_TLC_� + + tASN1_TLC +; + +305 +ASN1_VALUE_� + + tASN1_VALUE +; + +309 + #DECLARE_ASN1_FUNCTIONS +( +ty� +� + `DECLARE_ASN1_FUNCTIONS_�me +�y�,�y�) + + ) + +311 + #DECLARE_ASN1_ALLOC_FUNCTIONS +( +ty� +) \ + +312 + `DECLARE_ASN1_ALLOC_FUNCTIONS_�me +( +ty� +,�y�) + + ) + +314 + #DECLARE_ASN1_FUNCTIONS_�me +( +ty� +, +�me +) \ + +315 + `DECLARE_ASN1_ALLOC_FUNCTIONS_�me +( +ty� +, +�me +) \ + +316 + `DECLARE_ASN1_ENCODE_FUNCTIONS +( +ty� +, +�me +,�ame) + + ) + +318 + #DECLARE_ASN1_FUNCTIONS_�ame +( +ty� +, +��me +, +�me +) \ + +319 + `DECLARE_ASN1_ALLOC_FUNCTIONS_�me +( +ty� +, +�me +) \ + +320 + `DECLARE_ASN1_ENCODE_FUNCTIONS +( +ty� +, +��me +, +�me +) + + ) + +322 + #DECLARE_ASN1_ENCODE_FUNCTIONS +( +ty� +, +��me +, +�me +) \ + +323 +ty� + * +d2i_ +## + `�me +�y� ** +a +, cڡ ** +� +, +�n +); \ + +324 +i2d_ +## + `�me +( +ty� + * +a +, ** +out +); \ + +325 + `DECLARE_ASN1_ITEM +( +��me +) + + ) + +327 + #DECLARE_ASN1_ENCODE_FUNCTIONS_cڡ +( +ty� +, +�me +) \ + +328 +ty� + * +d2i_ +## + `�me +�y� ** +a +, cڡ ** +� +, +�n +); \ + +329 +i2d_ +## + `�me +(cڡ +ty� + * +a +, ** +out +); \ + +330 + `DECLARE_ASN1_ITEM +( +�me +) + + ) + +332 + #DECLARE_ASN1_NDEF_FUNCTION +( +�me +) \ + +333 +i2d_ +## +�me +## + `_NDEF +�am�* +a +, ** +out +); + + ) + +335 + #DECLARE_ASN1_FUNCTIONS_cڡ +( +�me +) \ + +336 + `DECLARE_ASN1_ALLOC_FUNCTIONS +( +�me +) \ + +337 + `DECLARE_ASN1_ENCODE_FUNCTIONS_cڡ +( +�me +,�ame) + + ) + +339 + #DECLARE_ASN1_ALLOC_FUNCTIONS_�me +( +ty� +, +�me +) \ + +340 +ty� + * +�me +## + `_�w +(); \ + +341 +�me +## + `_� +( +ty� + * +a +); + + ) + +343 + #DECLARE_ASN1_PRINT_FUNCTION +( +��me +) \ + +344 + `DECLARE_ASN1_PRINT_FUNCTION_�ame +( +��me +, s�ame) + + ) + +346 + #DECLARE_ASN1_PRINT_FUNCTION_�ame +( +��me +, +�ame +) \ + +347 +�ame +## + `_��t_�x +( +BIO + * +out +, +��me + * +x +, +�d�t +, \ + +348 cڡ +ASN1_PCTX + * +p�x +); + + ) + +350 + #D2I_OF +( +ty� +�ty� *(*)�y� **,cڡ **,) + + ) + +351 + #I2D_OF +( +ty� +�(*)�y� *,**) + + ) + +352 + #I2D_OF_cڡ +( +ty� +�(*)(cڡ�y� *,**) + + ) + +354 + #CHECKED_D2I_OF +( +ty� +, +d2i +) \ + +355 (( +d2i_of_void +*�(1 ? +d2i + : (( + `D2I_OF +( +ty� +))0))) + + ) + +356 + #CHECKED_I2D_OF +( +ty� +, +i2d +) \ + +357 (( +i2d_of_void +*�(1 ? +i2d + : (( + `I2D_OF +( +ty� +))0))) + + ) + +358 + #CHECKED_NEW_OF +( +ty� +, +x�w +) \ + +359 ((*(*)()�(1 ? +x�w + : (( +ty� + *(*)())0))) + + ) + +360 + #CHECKED_PTR_OF +( +ty� +, +p +) \ + +361 ((*�(1 ? +p + : ( +ty� +*)0)) + + ) + +362 + #CHECKED_PPTR_OF +( +ty� +, +p +) \ + +363 ((**�(1 ? +p + : ( +ty� +**)0)) + + ) + +365 + #TYPEDEF_D2I_OF +( +ty� +�ty� * + td2i_of_ +## + tty� +�y� **,cڡ **,) + + ) + +366 + tTYPEDEF_I2D_OF +( + tty� +� + ti2d_of_ +##ty��y� *,**) + + ) + +367 + tTYPEDEF_D2I2D_OF +( + tty� +� + tTYPEDEF_D2I_OF +�y�); + `TYPEDEF_I2D_OF +( +ty� +) + + ) + +369 +TYPEDEF_D2I2D_OF +(); + +406 #i�de� +OPENSSL_EXPORT_VAR_AS_FUNCTION + + +409 cڡ + tASN1_ITEM + + tASN1_ITEM_EXP +; + +412 + #ASN1_ITEM_�r +( +�� +�(��) + + ) + +415 + #ASN1_ITEM_�f +( +�� +�(&(��## +_� +)) + + ) + +417 + #ASN1_ITEM_�� +( +�f +�(&�ef## +_� +)) + + ) + +419 + #DECLARE_ASN1_ITEM +( +�me +) \ + +420 +OPENSSL_EXTERN + cڡ +ASN1_ITEM + +�me +## +_� +; + + ) + +429 cڡ + tASN1_ITEM + * + tASN1_ITEM_EXP +(); + +432 + #ASN1_ITEM_�r +( +�� +�( + `�� +()) + + ) + +435 + #ASN1_ITEM_�f +( +�� +�(��## +_� +) + + ) + +437 + #ASN1_ITEM_�� +( +�f +��ef## + `_� +()) + + ) + +439 + #DECLARE_ASN1_ITEM +( +�me +) \ + +440 cڡ +ASN1_ITEM + * +�me +## + `_� +(); + + ) + +451 + #ASN1_STRFLGS_ESC_2253 + 1 + + ) + +452 + #ASN1_STRFLGS_ESC_CTRL + 2 + + ) + +453 + #ASN1_STRFLGS_ESC_MSB + 4 + + ) + +461 + #ASN1_STRFLGS_ESC_QUOTE + 8 + + ) + +467 + #CHARTYPE_PRINTABLESTRING + 0x10 + + ) + +469 + #CHARTYPE_FIRST_ESC_2253 + 0x20 + + ) + +471 + #CHARTYPE_LAST_ESC_2253 + 0x40 + + ) + +481 + #ASN1_STRFLGS_UTF8_CONVERT + 0x10 + + ) + +488 + #ASN1_STRFLGS_IGNORE_TYPE + 0x20 + + ) + +491 + #ASN1_STRFLGS_SHOW_TYPE + 0x40 + + ) + +501 + #ASN1_STRFLGS_DUMP_ALL + 0x80 + + ) + +502 + #ASN1_STRFLGS_DUMP_UNKNOWN + 0x100 + + ) + +509 + #ASN1_STRFLGS_DUMP_DER + 0x200 + + ) + +516 + #ASN1_STRFLGS_RFC2253 + ( +ASN1_STRFLGS_ESC_2253 + | \ + +517 +ASN1_STRFLGS_ESC_CTRL + | \ + +518 +ASN1_STRFLGS_ESC_MSB + | \ + +519 +ASN1_STRFLGS_UTF8_CONVERT + | \ + +520 +ASN1_STRFLGS_DUMP_UNKNOWN + | \ + +521 +ASN1_STRFLGS_DUMP_DER +) + + ) + +523 +DECLARE_STACK_OF +( +ASN1_INTEGER +) + +524 +DECLARE_ASN1_SET_OF +( +ASN1_INTEGER +) + +526 +DECLARE_STACK_OF +( +ASN1_GENERALSTRING +) + +528 + sa�1_ty�_� + + +530 +ty� +; + +532 * +�r +; + +533 +ASN1_BOOLEAN + +boޗn +; + +534 +ASN1_STRING + * +a�1_�r�g +; + +535 +ASN1_OBJECT + * +obje� +; + +536 +ASN1_INTEGER + * +��g� +; + +537 +ASN1_ENUMERATED + * +�um��ed +; + +538 +ASN1_BIT_STRING + * +b�_�r�g +; + +539 +ASN1_OCTET_STRING + * +o��_�r�g +; + +540 +ASN1_PRINTABLESTRING + * +���bˡr�g +; + +541 +ASN1_T61STRING + * +t61�r�g +; + +542 +ASN1_IA5STRING + * +�5�r�g +; + +543 +ASN1_GENERALSTRING + * +g����r�g +; + +544 +ASN1_BMPSTRING + * +bmp�r�g +; + +545 +ASN1_UNIVERSALSTRING + * +univ��l�r�g +; + +546 +ASN1_UTCTIME + * +ut�ime +; + +547 +ASN1_GENERALIZEDTIME + * +g���izedtime +; + +548 +ASN1_VISIBLESTRING + * +visibˡr�g +; + +549 +ASN1_UTF8STRING + * +utf8�r�g +; + +552 +ASN1_STRING + * +�t +; + +553 +ASN1_STRING + * +�qu�� +; + +554 +ASN1_VALUE + * +a�1_v�ue +; + +555 } +v�ue +; + +556 } + tASN1_TYPE +; + +558 +DECLARE_STACK_OF +( +ASN1_TYPE +) + +559 +DECLARE_ASN1_SET_OF +( +ASN1_TYPE +) + +561 +STACK_OF +( + tASN1_TYPE +� + tASN1_SEQUENCE_ANY +; + +563 +DECLARE_ASN1_ENCODE_FUNCTIONS_cڡ +( +ASN1_SEQUENCE_ANY +, ASN1_SEQUENCE_ANY) + +564 +DECLARE_ASN1_ENCODE_FUNCTIONS_cڡ +( +ASN1_SEQUENCE_ANY +, +ASN1_SET_ANY +) + +566 + sNETSCAPE_X509_� + + +568 +ASN1_OCTET_STRING + * +h�d� +; + +569 +X509 + * +�� +; + +570 } + tNETSCAPE_X509 +; + +573 + sBIT_STRING_BITNAME_� + { + +574 +b�num +; + +575 cڡ * +�ame +; + +576 cڡ * +�ame +; + +577 } + tBIT_STRING_BITNAME +; + +580 + #M_ASN1_STRING_�ngth +( +x +�((x)-> +�ngth +) + + ) + +581 + #M_ASN1_STRING_�ngth_�t +( +x +, +n +�((x)-> +�ngth + = (n)) + + ) + +582 + #M_ASN1_STRING_ty� +( +x +�((x)-> +ty� +) + + ) + +583 + #M_ASN1_STRING_d�a +( +x +�((x)-> +d�a +) + + ) + +586 + #M_ASN1_BIT_STRING_�w +(�( +ASN1_BIT_STRING + *)\ + +587 + `ASN1_STRING_ty�_�w +( +V_ASN1_BIT_STRING +) + + ) + +588 + #M_ASN1_BIT_STRING_� +( +a +� + `ASN1_STRING_� +(( +ASN1_STRING + *�) + + ) + +589 + #M_ASN1_BIT_STRING_dup +( +a +�( +ASN1_BIT_STRING + *)\ + +590 + `ASN1_STRING_dup +((cڡ +ASN1_STRING + *) +a +) + + ) + +591 + #M_ASN1_BIT_STRING_cmp +( +a +, +b +� + `ASN1_STRING_cmp +(\ + +592 (cڡ +ASN1_STRING + *) +a +,(cڡ ASN1_STRING *) +b +) + + ) + +593 + #M_ASN1_BIT_STRING_�t +( +a +, +b +, +c +� + `ASN1_STRING_�t +(( +ASN1_STRING + *�,b,c) + + ) + +595 + #M_ASN1_INTEGER_�w +(�( +ASN1_INTEGER + *)\ + +596 + `ASN1_STRING_ty�_�w +( +V_ASN1_INTEGER +) + + ) + +597 + #M_ASN1_INTEGER_� +( +a +� + `ASN1_STRING_� +(( +ASN1_STRING + *�) + + ) + +598 + #M_ASN1_INTEGER_dup +( +a +�( +ASN1_INTEGER + *)\ + +599 + `ASN1_STRING_dup +((cڡ +ASN1_STRING + *) +a +) + + ) + +600 + #M_ASN1_INTEGER_cmp +( +a +, +b +� + `ASN1_STRING_cmp +(\ + +601 (cڡ +ASN1_STRING + *) +a +,(cڡ ASN1_STRING *) +b +) + + ) + +603 + #M_ASN1_ENUMERATED_�w +(�( +ASN1_ENUMERATED + *)\ + +604 + `ASN1_STRING_ty�_�w +( +V_ASN1_ENUMERATED +) + + ) + +605 + #M_ASN1_ENUMERATED_� +( +a +� + `ASN1_STRING_� +(( +ASN1_STRING + *�) + + ) + +606 + #M_ASN1_ENUMERATED_dup +( +a +�( +ASN1_ENUMERATED + *)\ + +607 + `ASN1_STRING_dup +((cڡ +ASN1_STRING + *) +a +) + + ) + +608 + #M_ASN1_ENUMERATED_cmp +( +a +, +b +� + `ASN1_STRING_cmp +(\ + +609 (cڡ +ASN1_STRING + *) +a +,(cڡ ASN1_STRING *) +b +) + + ) + +611 + #M_ASN1_OCTET_STRING_�w +(�( +ASN1_OCTET_STRING + *)\ + +612 + `ASN1_STRING_ty�_�w +( +V_ASN1_OCTET_STRING +) + + ) + +613 + #M_ASN1_OCTET_STRING_� +( +a +� + `ASN1_STRING_� +(( +ASN1_STRING + *�) + + ) + +614 + #M_ASN1_OCTET_STRING_dup +( +a +�( +ASN1_OCTET_STRING + *)\ + +615 + `ASN1_STRING_dup +((cڡ +ASN1_STRING + *) +a +) + + ) + +616 + #M_ASN1_OCTET_STRING_cmp +( +a +, +b +� + `ASN1_STRING_cmp +(\ + +617 (cڡ +ASN1_STRING + *) +a +,(cڡ ASN1_STRING *) +b +) + + ) + +618 + #M_ASN1_OCTET_STRING_�t +( +a +, +b +, +c +� + `ASN1_STRING_�t +(( +ASN1_STRING + *�,b,c) + + ) + +619 + #M_ASN1_OCTET_STRING_��t +( +a +, +b +� + `ASN1_STRING_��t +�,( +ASN1_STRING + *)b) + + ) + +620 + #M_i2d_ASN1_OCTET_STRING +( +a +, +� +) \ + +621 + `i2d_ASN1_by�s +(( +ASN1_STRING + *) +a +, +� +, +V_ASN1_OCTET_STRING +,\ + +622 +V_ASN1_UNIVERSAL +) + + ) + +624 + #B_ASN1_TIME + \ + +625 +B_ASN1_UTCTIME + | \ + +626 +B_ASN1_GENERALIZEDTIME + + + ) + +628 + #B_ASN1_PRINTABLE + \ + +629 +B_ASN1_NUMERICSTRING +| \ + +630 +B_ASN1_PRINTABLESTRING +| \ + +631 +B_ASN1_T61STRING +| \ + +632 +B_ASN1_IA5STRING +| \ + +633 +B_ASN1_BIT_STRING +| \ + +634 +B_ASN1_UNIVERSALSTRING +|\ + +635 +B_ASN1_BMPSTRING +|\ + +636 +B_ASN1_UTF8STRING +|\ + +637 +B_ASN1_SEQUENCE +|\ + +638 +B_ASN1_UNKNOWN + + + ) + +640 + #B_ASN1_DIRECTORYSTRING + \ + +641 +B_ASN1_PRINTABLESTRING +| \ + +642 +B_ASN1_TELETEXSTRING +|\ + +643 +B_ASN1_BMPSTRING +|\ + +644 +B_ASN1_UNIVERSALSTRING +|\ + +645 +B_ASN1_UTF8STRING + + + ) + +647 + #B_ASN1_DISPLAYTEXT + \ + +648 +B_ASN1_IA5STRING +| \ + +649 +B_ASN1_VISIBLESTRING +| \ + +650 +B_ASN1_BMPSTRING +|\ + +651 +B_ASN1_UTF8STRING + + + ) + +653 + #M_ASN1_PRINTABLE_�w +(� + `ASN1_STRING_ty�_�w +( +V_ASN1_T61STRING +) + + ) + +654 + #M_ASN1_PRINTABLE_� +( +a +� + `ASN1_STRING_� +(( +ASN1_STRING + *�) + + ) + +655 + #M_i2d_ASN1_PRINTABLE +( +a +, +� +� + `i2d_ASN1_by�s +(( +ASN1_STRING + *)a,\ + +656 +� +, +a +-> +ty� +, +V_ASN1_UNIVERSAL +) + + ) + +657 + #M_d2i_ASN1_PRINTABLE +( +a +, +� +, +l +) \ + +658 + `d2i_ASN1_ty�_by�s +(( +ASN1_STRING + **) +a +, +� +, +l +, \ + +659 +B_ASN1_PRINTABLE +) + + ) + +661 + #M_DIRECTORYSTRING_�w +(� + `ASN1_STRING_ty�_�w +( +V_ASN1_PRINTABLESTRING +) + + ) + +662 + #M_DIRECTORYSTRING_� +( +a +� + `ASN1_STRING_� +(( +ASN1_STRING + *�) + + ) + +663 + #M_i2d_DIRECTORYSTRING +( +a +, +� +� + `i2d_ASN1_by�s +(( +ASN1_STRING + *)a,\ + +664 +� +, +a +-> +ty� +, +V_ASN1_UNIVERSAL +) + + ) + +665 + #M_d2i_DIRECTORYSTRING +( +a +, +� +, +l +) \ + +666 + `d2i_ASN1_ty�_by�s +(( +ASN1_STRING + **) +a +, +� +, +l +, \ + +667 +B_ASN1_DIRECTORYSTRING +) + + ) + +669 + #M_DISPLAYTEXT_�w +(� + `ASN1_STRING_ty�_�w +( +V_ASN1_VISIBLESTRING +) + + ) + +670 + #M_DISPLAYTEXT_� +( +a +� + `ASN1_STRING_� +(( +ASN1_STRING + *�) + + ) + +671 + #M_i2d_DISPLAYTEXT +( +a +, +� +� + `i2d_ASN1_by�s +(( +ASN1_STRING + *)a,\ + +672 +� +, +a +-> +ty� +, +V_ASN1_UNIVERSAL +) + + ) + +673 + #M_d2i_DISPLAYTEXT +( +a +, +� +, +l +) \ + +674 + `d2i_ASN1_ty�_by�s +(( +ASN1_STRING + **) +a +, +� +, +l +, \ + +675 +B_ASN1_DISPLAYTEXT +) + + ) + +677 + #M_ASN1_PRINTABLESTRING_�w +(�( +ASN1_PRINTABLESTRING + *)\ + +678 + `ASN1_STRING_ty�_�w +( +V_ASN1_PRINTABLESTRING +) + + ) + +679 + #M_ASN1_PRINTABLESTRING_� +( +a +� + `ASN1_STRING_� +(( +ASN1_STRING + *�) + + ) + +680 + #M_i2d_ASN1_PRINTABLESTRING +( +a +, +� +) \ + +681 + `i2d_ASN1_by�s +(( +ASN1_STRING + *) +a +, +� +, +V_ASN1_PRINTABLESTRING +,\ + +682 +V_ASN1_UNIVERSAL +) + + ) + +683 + #M_d2i_ASN1_PRINTABLESTRING +( +a +, +� +, +l +) \ + +684 ( +ASN1_PRINTABLESTRING + *) +d2i_ASN1_ty�_by�s +\ + +685 (( +ASN1_STRING + **) +a +, +� +, +l +, +B_ASN1_PRINTABLESTRING +) + + ) + +687 + #M_ASN1_T61STRING_�w +(�( +ASN1_T61STRING + *)\ + +688 + `ASN1_STRING_ty�_�w +( +V_ASN1_T61STRING +) + + ) + +689 + #M_ASN1_T61STRING_� +( +a +� + `ASN1_STRING_� +(( +ASN1_STRING + *�) + + ) + +690 + #M_i2d_ASN1_T61STRING +( +a +, +� +) \ + +691 + `i2d_ASN1_by�s +(( +ASN1_STRING + *) +a +, +� +, +V_ASN1_T61STRING +,\ + +692 +V_ASN1_UNIVERSAL +) + + ) + +693 + #M_d2i_ASN1_T61STRING +( +a +, +� +, +l +) \ + +694 ( +ASN1_T61STRING + *) +d2i_ASN1_ty�_by�s +\ + +695 (( +ASN1_STRING + **) +a +, +� +, +l +, +B_ASN1_T61STRING +) + + ) + +697 + #M_ASN1_IA5STRING_�w +(�( +ASN1_IA5STRING + *)\ + +698 + `ASN1_STRING_ty�_�w +( +V_ASN1_IA5STRING +) + + ) + +699 + #M_ASN1_IA5STRING_� +( +a +� + `ASN1_STRING_� +(( +ASN1_STRING + *�) + + ) + +700 + #M_ASN1_IA5STRING_dup +( +a +) \ + +701 ( +ASN1_IA5STRING + *) + `ASN1_STRING_dup +((cڡ +ASN1_STRING + *) +a +) + + ) + +702 + #M_i2d_ASN1_IA5STRING +( +a +, +� +) \ + +703 + `i2d_ASN1_by�s +(( +ASN1_STRING + *) +a +, +� +, +V_ASN1_IA5STRING +,\ + +704 +V_ASN1_UNIVERSAL +) + + ) + +705 + #M_d2i_ASN1_IA5STRING +( +a +, +� +, +l +) \ + +706 ( +ASN1_IA5STRING + *) + `d2i_ASN1_ty�_by�s +(( +ASN1_STRING + **) +a +, +� +, +l +,\ + +707 +B_ASN1_IA5STRING +) + + ) + +709 + #M_ASN1_UTCTIME_�w +(�( +ASN1_UTCTIME + *)\ + +710 + `ASN1_STRING_ty�_�w +( +V_ASN1_UTCTIME +) + + ) + +711 + #M_ASN1_UTCTIME_� +( +a +� + `ASN1_STRING_� +(( +ASN1_STRING + *�) + + ) + +712 + #M_ASN1_UTCTIME_dup +( +a +�( +ASN1_UTCTIME + *)\ + +713 + `ASN1_STRING_dup +((cڡ +ASN1_STRING + *) +a +) + + ) + +715 + #M_ASN1_GENERALIZEDTIME_�w +(�( +ASN1_GENERALIZEDTIME + *)\ + +716 + `ASN1_STRING_ty�_�w +( +V_ASN1_GENERALIZEDTIME +) + + ) + +717 + #M_ASN1_GENERALIZEDTIME_� +( +a +� + `ASN1_STRING_� +(( +ASN1_STRING + *�) + + ) + +718 + #M_ASN1_GENERALIZEDTIME_dup +( +a +�( +ASN1_GENERALIZEDTIME + *) + `ASN1_STRING_dup +(\ + +719 (cڡ +ASN1_STRING + *) +a +) + + ) + +721 + #M_ASN1_TIME_�w +(�( +ASN1_TIME + *)\ + +722 + `ASN1_STRING_ty�_�w +( +V_ASN1_UTCTIME +) + + ) + +723 + #M_ASN1_TIME_� +( +a +� + `ASN1_STRING_� +(( +ASN1_STRING + *�) + + ) + +724 + #M_ASN1_TIME_dup +( +a +�( +ASN1_TIME + *)\ + +725 + `ASN1_STRING_dup +((cڡ +ASN1_STRING + *) +a +) + + ) + +727 + #M_ASN1_GENERALSTRING_�w +(�( +ASN1_GENERALSTRING + *)\ + +728 + `ASN1_STRING_ty�_�w +( +V_ASN1_GENERALSTRING +) + + ) + +729 + #M_ASN1_GENERALSTRING_� +( +a +� + `ASN1_STRING_� +(( +ASN1_STRING + *�) + + ) + +730 + #M_i2d_ASN1_GENERALSTRING +( +a +, +� +) \ + +731 + `i2d_ASN1_by�s +(( +ASN1_STRING + *) +a +, +� +, +V_ASN1_GENERALSTRING +,\ + +732 +V_ASN1_UNIVERSAL +) + + ) + +733 + #M_d2i_ASN1_GENERALSTRING +( +a +, +� +, +l +) \ + +734 ( +ASN1_GENERALSTRING + *) +d2i_ASN1_ty�_by�s +\ + +735 (( +ASN1_STRING + **) +a +, +� +, +l +, +B_ASN1_GENERALSTRING +) + + ) + +737 + #M_ASN1_UNIVERSALSTRING_�w +(�( +ASN1_UNIVERSALSTRING + *)\ + +738 + `ASN1_STRING_ty�_�w +( +V_ASN1_UNIVERSALSTRING +) + + ) + +739 + #M_ASN1_UNIVERSALSTRING_� +( +a +� + `ASN1_STRING_� +(( +ASN1_STRING + *�) + + ) + +740 + #M_i2d_ASN1_UNIVERSALSTRING +( +a +, +� +) \ + +741 + `i2d_ASN1_by�s +(( +ASN1_STRING + *) +a +, +� +, +V_ASN1_UNIVERSALSTRING +,\ + +742 +V_ASN1_UNIVERSAL +) + + ) + +743 + #M_d2i_ASN1_UNIVERSALSTRING +( +a +, +� +, +l +) \ + +744 ( +ASN1_UNIVERSALSTRING + *) +d2i_ASN1_ty�_by�s +\ + +745 (( +ASN1_STRING + **) +a +, +� +, +l +, +B_ASN1_UNIVERSALSTRING +) + + ) + +747 + #M_ASN1_BMPSTRING_�w +(�( +ASN1_BMPSTRING + *)\ + +748 + `ASN1_STRING_ty�_�w +( +V_ASN1_BMPSTRING +) + + ) + +749 + #M_ASN1_BMPSTRING_� +( +a +� + `ASN1_STRING_� +(( +ASN1_STRING + *�) + + ) + +750 + #M_i2d_ASN1_BMPSTRING +( +a +, +� +) \ + +751 + `i2d_ASN1_by�s +(( +ASN1_STRING + *) +a +, +� +, +V_ASN1_BMPSTRING +,\ + +752 +V_ASN1_UNIVERSAL +) + + ) + +753 + #M_d2i_ASN1_BMPSTRING +( +a +, +� +, +l +) \ + +754 ( +ASN1_BMPSTRING + *) +d2i_ASN1_ty�_by�s +\ + +755 (( +ASN1_STRING + **) +a +, +� +, +l +, +B_ASN1_BMPSTRING +) + + ) + +757 + #M_ASN1_VISIBLESTRING_�w +(�( +ASN1_VISIBLESTRING + *)\ + +758 + `ASN1_STRING_ty�_�w +( +V_ASN1_VISIBLESTRING +) + + ) + +759 + #M_ASN1_VISIBLESTRING_� +( +a +� + `ASN1_STRING_� +(( +ASN1_STRING + *�) + + ) + +760 + #M_i2d_ASN1_VISIBLESTRING +( +a +, +� +) \ + +761 + `i2d_ASN1_by�s +(( +ASN1_STRING + *) +a +, +� +, +V_ASN1_VISIBLESTRING +,\ + +762 +V_ASN1_UNIVERSAL +) + + ) + +763 + #M_d2i_ASN1_VISIBLESTRING +( +a +, +� +, +l +) \ + +764 ( +ASN1_VISIBLESTRING + *) +d2i_ASN1_ty�_by�s +\ + +765 (( +ASN1_STRING + **) +a +, +� +, +l +, +B_ASN1_VISIBLESTRING +) + + ) + +767 + #M_ASN1_UTF8STRING_�w +(�( +ASN1_UTF8STRING + *)\ + +768 + `ASN1_STRING_ty�_�w +( +V_ASN1_UTF8STRING +) + + ) + +769 + #M_ASN1_UTF8STRING_� +( +a +� + `ASN1_STRING_� +(( +ASN1_STRING + *�) + + ) + +770 + #M_i2d_ASN1_UTF8STRING +( +a +, +� +) \ + +771 + `i2d_ASN1_by�s +(( +ASN1_STRING + *) +a +, +� +, +V_ASN1_UTF8STRING +,\ + +772 +V_ASN1_UNIVERSAL +) + + ) + +773 + #M_d2i_ASN1_UTF8STRING +( +a +, +� +, +l +) \ + +774 ( +ASN1_UTF8STRING + *) +d2i_ASN1_ty�_by�s +\ + +775 (( +ASN1_STRING + **) +a +, +� +, +l +, +B_ASN1_UTF8STRING +) + + ) + +778 + #IS_SEQUENCE + 0 + + ) + +779 + #IS_SET + 1 + + ) + +781 +DECLARE_ASN1_FUNCTIONS_�ame +( +ASN1_TYPE +, +ASN1_ANY +, ASN1_TYPE) + +783 +ASN1_TYPE_g� +( +ASN1_TYPE + * +a +); + +784 +ASN1_TYPE_�t +( +ASN1_TYPE + * +a +, +ty� +, * +v�ue +); + +785 +ASN1_TYPE_�t1 +( +ASN1_TYPE + * +a +, +ty� +, cڡ * +v�ue +); + +786 +ASN1_TYPE_cmp +(cڡ +ASN1_TYPE + * +a +, cڡ ASN1_TYPE * +b +); + +788 +ASN1_OBJECT + * +ASN1_OBJECT_�w +(); + +789 +ASN1_OBJECT_� +( +ASN1_OBJECT + * +a +); + +790 +i2d_ASN1_OBJECT +( +ASN1_OBJECT + * +a +,** +� +); + +791 +ASN1_OBJECT + * +c2i_ASN1_OBJECT +(ASN1_OBJECT ** +a +,cڡ ** +� +, + +792 +�ngth +); + +793 +ASN1_OBJECT + * +d2i_ASN1_OBJECT +(ASN1_OBJECT ** +a +,cڡ ** +� +, + +794 +�ngth +); + +796 +DECLARE_ASN1_ITEM +( +ASN1_OBJECT +) + +798 +DECLARE_STACK_OF +( +ASN1_OBJECT +) + +799 +DECLARE_ASN1_SET_OF +( +ASN1_OBJECT +) + +801 +ASN1_STRING + * +ASN1_STRING_�w +(); + +802 +ASN1_STRING_� +( +ASN1_STRING + * +a +); + +803 +ASN1_STRING_c�y +( +ASN1_STRING + * +d� +, cڡ ASN1_STRING * +�r +); + +804 +ASN1_STRING + * +ASN1_STRING_dup +(cڡ ASN1_STRING * +a +); + +805 +ASN1_STRING + * +ASN1_STRING_ty�_�w +( +ty� + ); + +806 +ASN1_STRING_cmp +(cڡ +ASN1_STRING + * +a +, cڡ ASN1_STRING * +b +); + +809 +ASN1_STRING_�t +( +ASN1_STRING + * +�r +, cڡ * +d�a +, +�n +); + +810 +ASN1_STRING_�t0 +( +ASN1_STRING + * +�r +, * +d�a +, +�n +); + +811 +ASN1_STRING_�ngth +(cڡ +ASN1_STRING + * +x +); + +812 +ASN1_STRING_�ngth_�t +( +ASN1_STRING + * +x +, +n +); + +813 +ASN1_STRING_ty� +( +ASN1_STRING + * +x +); + +814 * +ASN1_STRING_d�a +( +ASN1_STRING + * +x +); + +816 +DECLARE_ASN1_FUNCTIONS +( +ASN1_BIT_STRING +) + +817 +i2c_ASN1_BIT_STRING +( +ASN1_BIT_STRING + * +a +,** +� +); + +818 +ASN1_BIT_STRING + * +c2i_ASN1_BIT_STRING +(ASN1_BIT_STRING ** +a +,cڡ ** +� +, + +819 +�ngth +); + +820 +ASN1_BIT_STRING_�t +( +ASN1_BIT_STRING + * +a +, * +d +, + +821 +�ngth + ); + +822 +ASN1_BIT_STRING_�t_b� +( +ASN1_BIT_STRING + * +a +, +n +, +v�ue +); + +823 +ASN1_BIT_STRING_g�_b� +( +ASN1_BIT_STRING + * +a +, +n +); + +824 +ASN1_BIT_STRING_check +( +ASN1_BIT_STRING + * +a +, + +825 * +�ags +, +�ags_�n +); + +827 #i�de� +OPENSSL_NO_BIO + + +828 +ASN1_BIT_STRING_�me_��t +( +BIO + * +out +, +ASN1_BIT_STRING + * +bs +, + +829 +BIT_STRING_BITNAME + * +tbl +, +�d�t +); + +831 +ASN1_BIT_STRING_num_asc +(* +�me +, +BIT_STRING_BITNAME + * +tbl +); + +832 +ASN1_BIT_STRING_�t_asc +( +ASN1_BIT_STRING + * +bs +, * +�me +, +v�ue +, + +833 +BIT_STRING_BITNAME + * +tbl +); + +835 +i2d_ASN1_BOOLEAN +( +a +,** +� +); + +836 +d2i_ASN1_BOOLEAN +(* +a +,cڡ ** +� +, +�ngth +); + +838 +DECLARE_ASN1_FUNCTIONS +( +ASN1_INTEGER +) + +839 +i2c_ASN1_INTEGER +( +ASN1_INTEGER + * +a +,** +� +); + +840 +ASN1_INTEGER + * +c2i_ASN1_INTEGER +(ASN1_INTEGER ** +a +,cڡ ** +� +, + +841 +�ngth +); + +842 +ASN1_INTEGER + * +d2i_ASN1_UINTEGER +(ASN1_INTEGER ** +a +,cڡ ** +� +, + +843 +�ngth +); + +844 +ASN1_INTEGER + * +ASN1_INTEGER_dup +(cڡ ASN1_INTEGER * +x +); + +845 +ASN1_INTEGER_cmp +(cڡ +ASN1_INTEGER + * +x +, cڡ ASN1_INTEGER * +y +); + +847 +DECLARE_ASN1_FUNCTIONS +( +ASN1_ENUMERATED +) + +849 +ASN1_UTCTIME_check +( +ASN1_UTCTIME + * +a +); + +850 +ASN1_UTCTIME + * +ASN1_UTCTIME_�t +(ASN1_UTCTIME * +s +, +time_t + +t +); + +851 +ASN1_UTCTIME + * +ASN1_UTCTIME_adj +(ASN1_UTCTIME * +s +, +time_t + +t +, + +852 +off�t_day +, +off�t_�c +); + +853 +ASN1_UTCTIME_�t_�r�g +( +ASN1_UTCTIME + * +s +, cڡ * +�r +); + +854 +ASN1_UTCTIME_cmp_time_t +(cڡ +ASN1_UTCTIME + * +s +, +time_t + +t +); + +856 +time_t + +ASN1_UTCTIME_g� +(cڡ +ASN1_UTCTIME + * +s +); + +859 +ASN1_GENERALIZEDTIME_check +( +ASN1_GENERALIZEDTIME + * +a +); + +860 +ASN1_GENERALIZEDTIME + * +ASN1_GENERALIZEDTIME_�t +(ASN1_GENERALIZEDTIME * +s +, +time_t + +t +); + +861 +ASN1_GENERALIZEDTIME + * +ASN1_GENERALIZEDTIME_adj +(ASN1_GENERALIZEDTIME * +s +, + +862 +time_t + +t +, +off�t_day +, +off�t_�c +); + +863 +ASN1_GENERALIZEDTIME_�t_�r�g +( +ASN1_GENERALIZEDTIME + * +s +, cڡ * +�r +); + +865 +DECLARE_ASN1_FUNCTIONS +( +ASN1_OCTET_STRING +) + +866 +ASN1_OCTET_STRING + * +ASN1_OCTET_STRING_dup +(cڡ ASN1_OCTET_STRING * +a +); + +867 +ASN1_OCTET_STRING_cmp +(cڡ +ASN1_OCTET_STRING + * +a +, cڡ ASN1_OCTET_STRING * +b +); + +868 +ASN1_OCTET_STRING_�t +( +ASN1_OCTET_STRING + * +�r +, cڡ * +d�a +, +�n +); + +870 +DECLARE_ASN1_FUNCTIONS +( +ASN1_VISIBLESTRING +) + +871 +DECLARE_ASN1_FUNCTIONS +( +ASN1_UNIVERSALSTRING +) + +872 +DECLARE_ASN1_FUNCTIONS +( +ASN1_UTF8STRING +) + +873 +DECLARE_ASN1_FUNCTIONS +( +ASN1_NULL +) + +874 +DECLARE_ASN1_FUNCTIONS +( +ASN1_BMPSTRING +) + +876 +UTF8_g�c +(cڡ * +�r +, +�n +, * +v� +); + +877 +UTF8_putc +(* +�r +, +�n +, +v�ue +); + +879 +DECLARE_ASN1_FUNCTIONS_�me +( +ASN1_STRING +, +ASN1_PRINTABLE +) + +881 +DECLARE_ASN1_FUNCTIONS_�me +( +ASN1_STRING +, +DIRECTORYSTRING +) + +882 +DECLARE_ASN1_FUNCTIONS_�me +( +ASN1_STRING +, +DISPLAYTEXT +) + +883 +DECLARE_ASN1_FUNCTIONS +( +ASN1_PRINTABLESTRING +) + +884 +DECLARE_ASN1_FUNCTIONS +( +ASN1_T61STRING +) + +885 +DECLARE_ASN1_FUNCTIONS +( +ASN1_IA5STRING +) + +886 +DECLARE_ASN1_FUNCTIONS +( +ASN1_GENERALSTRING +) + +887 +DECLARE_ASN1_FUNCTIONS +( +ASN1_UTCTIME +) + +888 +DECLARE_ASN1_FUNCTIONS +( +ASN1_GENERALIZEDTIME +) + +889 +DECLARE_ASN1_FUNCTIONS +( +ASN1_TIME +) + +891 +DECLARE_ASN1_ITEM +( +ASN1_OCTET_STRING_NDEF +) + +893 +ASN1_TIME + * +ASN1_TIME_�t +(ASN1_TIME * +s +, +time_t + +t +); + +894 +ASN1_TIME + * +ASN1_TIME_adj +(ASN1_TIME * +s +, +time_t + +t +, + +895 +off�t_day +, +off�t_�c +); + +896 +ASN1_TIME_check +( +ASN1_TIME + * +t +); + +897 +ASN1_GENERALIZEDTIME + * +ASN1_TIME_to_g���izedtime +( +ASN1_TIME + * +t +, ASN1_GENERALIZEDTIME ** +out +); + +898 +ASN1_TIME_�t_�r�g +( +ASN1_TIME + * +s +, cڡ * +�r +); + +900 +i2d_ASN1_SET +( +STACK_OF +( +OPENSSL_BLOCK +�* +a +, ** +� +, + +901 +i2d_of_void + * +i2d +, +ex_�g +, +ex_�ass +, + +902 +is_�t +); + +903 +STACK_OF +( +OPENSSL_BLOCK +�* +d2i_ASN1_SET +(STACK_OF(OPENSSL_BLOCK�** +a +, + +904 cڡ ** +� +, + +905 +�ngth +, +d2i_of_void + * +d2i +, + +906 (* +�_func +)( +OPENSSL_BLOCK +), +ex_�g +, + +907 +ex_�ass +); + +909 #i�de� +OPENSSL_NO_BIO + + +910 +i2a_ASN1_INTEGER +( +BIO + * +bp +, +ASN1_INTEGER + * +a +); + +911 +a2i_ASN1_INTEGER +( +BIO + * +bp +, +ASN1_INTEGER + * +bs +,* +buf +, +size +); + +912 +i2a_ASN1_ENUMERATED +( +BIO + * +bp +, +ASN1_ENUMERATED + * +a +); + +913 +a2i_ASN1_ENUMERATED +( +BIO + * +bp +, +ASN1_ENUMERATED + * +bs +,* +buf +, +size +); + +914 +i2a_ASN1_OBJECT +( +BIO + * +bp +, +ASN1_OBJECT + * +a +); + +915 +a2i_ASN1_STRING +( +BIO + * +bp +, +ASN1_STRING + * +bs +,* +buf +, +size +); + +916 +i2a_ASN1_STRING +( +BIO + * +bp +, +ASN1_STRING + * +a +, +ty� +); + +918 +i2t_ASN1_OBJECT +(* +buf +, +buf_�n +, +ASN1_OBJECT + * +a +); + +920 +a2d_ASN1_OBJECT +(* +out +, +ޒ +, cڡ * +buf +, +num +); + +921 +ASN1_OBJECT + * +ASN1_OBJECT_��� +( +nid +, * +d�a +, +�n +, + +922 cڡ * +� +, cڡ * +� +); + +924 +ASN1_INTEGER_�t +( +ASN1_INTEGER + * +a +, +v +); + +925 +ASN1_INTEGER_g� +(cڡ +ASN1_INTEGER + * +a +); + +926 +ASN1_INTEGER + * +BN_to_ASN1_INTEGER +(cڡ +BIGNUM + * +bn +, ASN1_INTEGER * +ai +); + +927 +BIGNUM + * +ASN1_INTEGER_to_BN +(cڡ +ASN1_INTEGER + * +ai +,BIGNUM * +bn +); + +929 +ASN1_ENUMERATED_�t +( +ASN1_ENUMERATED + * +a +, +v +); + +930 +ASN1_ENUMERATED_g� +( +ASN1_ENUMERATED + * +a +); + +931 +ASN1_ENUMERATED + * +BN_to_ASN1_ENUMERATED +( +BIGNUM + * +bn +, ASN1_ENUMERATED * +ai +); + +932 +BIGNUM + * +ASN1_ENUMERATED_to_BN +( +ASN1_ENUMERATED + * +ai +,BIGNUM * +bn +); + +936 +ASN1_PRINTABLE_ty� +(cڡ * +s +, +max +); + +938 +i2d_ASN1_by�s +( +ASN1_STRING + * +a +, ** +� +, +�g +, +x�ass +); + +939 +ASN1_STRING + * +d2i_ASN1_by�s +(ASN1_STRING ** +a +, cڡ ** +� +, + +940 +�ngth +, +P�g +, +P�ass +); + +941 +ASN1_�g2b� +( +�g +); + +943 +ASN1_STRING + * +d2i_ASN1_ty�_by�s +(ASN1_STRING ** +a +,cڡ ** +� +, + +944 +�ngth +, +ty� +); + +947 +a�1_F�ish +( +ASN1_CTX + * +c +); + +948 +a�1_cڡ_F�ish +( +ASN1_cڡ_CTX + * +c +); + +951 +ASN1_g�_obje� +(cڡ ** +� +, * +��gth +, * +�ag +, + +952 * +p�ass +, +omax +); + +953 +ASN1_check_�f��e_�d +(** +p +, +�n +); + +954 +ASN1_cڡ_check_�f��e_�d +(cڡ ** +p +, +�n +); + +955 +ASN1_put_obje� +(** +� +, +cڡru�ed +, +�ngth +, + +956 +�g +, +x�ass +); + +957 +ASN1_put_eoc +(** +� +); + +958 +ASN1_obje�_size +( +cڡru�ed +, +�ngth +, +�g +); + +961 * +ASN1_dup +( +i2d_of_void + * +i2d +, +d2i_of_void + * +d2i +, * +x +); + +963 + #ASN1_dup_of +( +ty� +, +i2d +, +d2i +, +x +) \ + +964 (( +ty� +*) + `ASN1_dup +( + `CHECKED_I2D_OF +�y�, +i2d +), \ + +965 + `CHECKED_D2I_OF +( +ty� +, +d2i +), \ + +966 + `CHECKED_PTR_OF +( +ty� +, +x +))) + + ) + +968 + #ASN1_dup_of_cڡ +( +ty� +, +i2d +, +d2i +, +x +) \ + +969 (( +ty� +*) + `ASN1_dup +( + `CHECKED_I2D_OF +(cڡ�y�, +i2d +), \ + +970 + `CHECKED_D2I_OF +( +ty� +, +d2i +), \ + +971 + `CHECKED_PTR_OF +(cڡ +ty� +, +x +))) + + ) + +973 * +ASN1_�em_dup +(cڡ +ASN1_ITEM + * +� +, * +x +); + +977 + #M_ASN1_�w_of +( +ty� +��y� *) + `ASN1_�em_�w +( + `ASN1_ITEM_�� +�y�)) + + ) + +978 + #M_ASN1_�_of +( +x +, +ty� +) \ + +979 + `ASN1_�em_� +( + `CHECKED_PTR_OF +( +ty� +, +x +), + `ASN1_ITEM_�� +�y�)) + + ) + +981 #i�de� +OPENSSL_NO_FP_API + + +982 * +ASN1_d2i_� +(*(* +x�w +)(), +d2i_of_void + * +d2i +, +FILE + * +� +, ** +x +); + +984 + #ASN1_d2i_�_of +( +ty� +, +x�w +, +d2i +, +� +, +x +) \ + +985 (( +ty� +*) + `ASN1_d2i_� +( + `CHECKED_NEW_OF +�y�, +x�w +), \ + +986 + `CHECKED_D2I_OF +( +ty� +, +d2i +), \ + +987 +� +, \ + +988 + `CHECKED_PPTR_OF +( +ty� +, +x +))) + + ) + +990 * +ASN1_�em_d2i_� +(cڡ +ASN1_ITEM + * +� +, +FILE + * +� +, * +x +); + +991 +ASN1_i2d_� +( +i2d_of_void + * +i2d +, +FILE + * +out +,* +x +); + +993 + #ASN1_i2d_�_of +( +ty� +, +i2d +, +out +, +x +) \ + +994 ( + `ASN1_i2d_� +( + `CHECKED_I2D_OF +( +ty� +, +i2d +), \ + +995 +out +, \ + +996 + `CHECKED_PTR_OF +( +ty� +, +x +))) + + ) + +998 + #ASN1_i2d_�_of_cڡ +( +ty� +, +i2d +, +out +, +x +) \ + +999 ( + `ASN1_i2d_� +( + `CHECKED_I2D_OF +(cڡ +ty� +, +i2d +), \ + +1000 +out +, \ + +1001 + `CHECKED_PTR_OF +(cڡ +ty� +, +x +))) + + ) + +1003 +ASN1_�em_i2d_� +(cڡ +ASN1_ITEM + * +� +, +FILE + * +out +, * +x +); + +1004 +ASN1_STRING_��t_ex_� +( +FILE + * +� +, +ASN1_STRING + * +�r +, +�ags +); + +1007 +ASN1_STRING_to_UTF8 +(** +out +, +ASN1_STRING + * +� +); + +1009 #i�de� +OPENSSL_NO_BIO + + +1010 * +ASN1_d2i_bio +(*(* +x�w +)(), +d2i_of_void + * +d2i +, +BIO + * +� +, ** +x +); + +1012 + #ASN1_d2i_bio_of +( +ty� +, +x�w +, +d2i +, +� +, +x +) \ + +1013 (( +ty� +*) + `ASN1_d2i_bio +� + `CHECKED_NEW_OF +�y�, +x�w +), \ + +1014 + `CHECKED_D2I_OF +( +ty� +, +d2i +), \ + +1015 +� +, \ + +1016 + `CHECKED_PPTR_OF +( +ty� +, +x +))) + + ) + +1018 * +ASN1_�em_d2i_bio +(cڡ +ASN1_ITEM + * +� +, +BIO + * +� +, * +x +); + +1019 +ASN1_i2d_bio +( +i2d_of_void + * +i2d +, +BIO + * +out +, * +x +); + +1021 + #ASN1_i2d_bio_of +( +ty� +, +i2d +, +out +, +x +) \ + +1022 ( + `ASN1_i2d_bio +( + `CHECKED_I2D_OF +( +ty� +, +i2d +), \ + +1023 +out +, \ + +1024 + `CHECKED_PTR_OF +( +ty� +, +x +))) + + ) + +1026 + #ASN1_i2d_bio_of_cڡ +( +ty� +, +i2d +, +out +, +x +) \ + +1027 ( + `ASN1_i2d_bio +( + `CHECKED_I2D_OF +(cڡ +ty� +, +i2d +), \ + +1028 +out +, \ + +1029 + `CHECKED_PTR_OF +(cڡ +ty� +, +x +))) + + ) + +1031 +ASN1_�em_i2d_bio +(cڡ +ASN1_ITEM + * +� +, +BIO + * +out +, * +x +); + +1032 +ASN1_UTCTIME_��t +( +BIO + * +� +, cڡ +ASN1_UTCTIME + * +a +); + +1033 +ASN1_GENERALIZEDTIME_��t +( +BIO + * +� +, cڡ +ASN1_GENERALIZEDTIME + * +a +); + +1034 +ASN1_TIME_��t +( +BIO + * +� +, cڡ +ASN1_TIME + * +a +); + +1035 +ASN1_STRING_��t +( +BIO + * +bp +, cڡ +ASN1_STRING + * +v +); + +1036 +ASN1_STRING_��t_ex +( +BIO + * +out +, +ASN1_STRING + * +�r +, +�ags +); + +1037 +ASN1_bn_��t +( +BIO + * +bp +, cڡ * +numb� +, cڡ +BIGNUM + * +num +, + +1038 * +buf +, +off +); + +1039 +ASN1_�r� +( +BIO + * +bp +,cڡ * +� +, +�n +, +�d�t +); + +1040 +ASN1_�r�_dump +( +BIO + * +bp +,cڡ * +� +, +�n +, +�d�t +, +dump +); + +1042 cڡ * +ASN1_�g2�r +( +�g +); + +1046 +DECLARE_ASN1_FUNCTIONS +( +NETSCAPE_X509 +) + +1048 +ASN1_UNIVERSALSTRING_to_�r�g +( +ASN1_UNIVERSALSTRING + * +s +); + +1050 +ASN1_TYPE_�t_o���r�g +( +ASN1_TYPE + * +a +, + +1051 * +d�a +, +�n +); + +1052 +ASN1_TYPE_g�_o���r�g +( +ASN1_TYPE + * +a +, + +1053 * +d�a +, +max_�n +); + +1054 +ASN1_TYPE_�t_�t_o���r�g +( +ASN1_TYPE + * +a +, +num +, + +1055 * +d�a +, +�n +); + +1056 +ASN1_TYPE_g�_�t_o���r�g +( +ASN1_TYPE + * +a +,* +num +, + +1057 * +d�a +, +max_�n +); + +1059 +STACK_OF +( +OPENSSL_BLOCK +�* +ASN1_�q_u�ack +(cڡ * +buf +, +�n +, + +1060 +d2i_of_void + * +d2i +, (* +�_func +)( +OPENSSL_BLOCK +)); + +1061 * +ASN1_�q_�ck +( +STACK_OF +( +OPENSSL_BLOCK +�* +��s +, +i2d_of_void + * +i2d +, + +1062 ** +buf +, * +�n + ); + +1063 * +ASN1_u�ack_�r�g +( +ASN1_STRING + * +o� +, +d2i_of_void + * +d2i +); + +1064 * +ASN1_�em_u�ack +( +ASN1_STRING + * +o� +, cڡ +ASN1_ITEM + * +� +); + +1065 +ASN1_STRING + * +ASN1_�ck_�r�g +(* +obj +, +i2d_of_void + * +i2d +, + +1066 +ASN1_OCTET_STRING + ** +o� +); + +1068 + #ASN1_�ck_�r�g_of +( +ty� +, +obj +, +i2d +, +o� +) \ + +1069 ( + `ASN1_�ck_�r�g +( + `CHECKED_PTR_OF +( +ty� +, +obj +), \ + +1070 + `CHECKED_I2D_OF +( +ty� +, +i2d +), \ + +1071 +o� +)) + + ) + +1073 +ASN1_STRING + * +ASN1_�em_�ck +(* +obj +, cڡ +ASN1_ITEM + * +� +, +ASN1_OCTET_STRING + ** +o� +); + +1075 +ASN1_STRING_�t_de�u�_mask +( +mask +); + +1076 +ASN1_STRING_�t_de�u�_mask_asc +(cڡ * +p +); + +1077 +ASN1_STRING_g�_de�u�_mask +(); + +1078 +ASN1_mb�r�g_c�y +( +ASN1_STRING + ** +out +, cڡ * +� +, +�n +, + +1079 +�f�m +, +mask +); + +1080 +ASN1_mb�r�g_nc�y +( +ASN1_STRING + ** +out +, cڡ * +� +, +�n +, + +1081 +�f�m +, +mask +, + +1082 +m�size +, +maxsize +); + +1084 +ASN1_STRING + * +ASN1_STRING_�t_by_NID +(ASN1_STRING ** +out +, + +1085 cڡ * +� +, +��n +, +�f�m +, +nid +); + +1086 +ASN1_STRING_TABLE + * +ASN1_STRING_TABLE_g� +( +nid +); + +1087 +ASN1_STRING_TABLE_add +(, , , , ); + +1088 +ASN1_STRING_TABLE_��nup +(); + +1093 +ASN1_VALUE + * +ASN1_�em_�w +(cڡ +ASN1_ITEM + * +� +); + +1094 +ASN1_�em_� +( +ASN1_VALUE + * +v� +, cڡ +ASN1_ITEM + * +� +); + +1095 +ASN1_VALUE + * +ASN1_�em_d2i +(ASN1_VALUE ** +v� +, cڡ ** +� +, +�n +, cڡ +ASN1_ITEM + * +� +); + +1096 +ASN1_�em_i2d +( +ASN1_VALUE + * +v� +, ** +out +, cڡ +ASN1_ITEM + * +� +); + +1097 +ASN1_�em_ndef_i2d +( +ASN1_VALUE + * +v� +, ** +out +, cڡ +ASN1_ITEM + * +� +); + +1099 +ASN1_add_oid_modu� +(); + +1101 +ASN1_TYPE + * +ASN1_g���e_nc�f +(* +�r +, +CONF + * +nc�f +); + +1102 +ASN1_TYPE + * +ASN1_g���e_v3 +(* +�r +, +X509V3_CTX + * +�f +); + +1107 + #ASN1_PCTX_FLAGS_SHOW_ABSENT + 0x001 + + ) + +1109 + #ASN1_PCTX_FLAGS_SHOW_SEQUENCE + 0x002 + + ) + +1111 + #ASN1_PCTX_FLAGS_SHOW_SSOF + 0x004 + + ) + +1113 + #ASN1_PCTX_FLAGS_SHOW_TYPE + 0x008 + + ) + +1115 + #ASN1_PCTX_FLAGS_NO_ANY_TYPE + 0x010 + + ) + +1117 + #ASN1_PCTX_FLAGS_NO_MSTRING_TYPE + 0x020 + + ) + +1119 + #ASN1_PCTX_FLAGS_NO_FIELD_NAME + 0x040 + + ) + +1121 + #ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME + 0x080 + + ) + +1123 + #ASN1_PCTX_FLAGS_NO_STRUCT_NAME + 0x100 + + ) + +1125 +ASN1_�em_��t +( +BIO + * +out +, +ASN1_VALUE + * +i�d +, +�d�t +, + +1126 cڡ +ASN1_ITEM + * +� +, cڡ +ASN1_PCTX + * +p�x +); + +1127 +ASN1_PCTX + * +ASN1_PCTX_�w +(); + +1128 +ASN1_PCTX_� +( +ASN1_PCTX + * +p +); + +1129 +ASN1_PCTX_g�_�ags +( +ASN1_PCTX + * +p +); + +1130 +ASN1_PCTX_�t_�ags +( +ASN1_PCTX + * +p +, +�ags +); + +1131 +ASN1_PCTX_g�_nm_�ags +( +ASN1_PCTX + * +p +); + +1132 +ASN1_PCTX_�t_nm_�ags +( +ASN1_PCTX + * +p +, +�ags +); + +1133 +ASN1_PCTX_g�_��_�ags +( +ASN1_PCTX + * +p +); + +1134 +ASN1_PCTX_�t_��_�ags +( +ASN1_PCTX + * +p +, +�ags +); + +1135 +ASN1_PCTX_g�_oid_�ags +( +ASN1_PCTX + * +p +); + +1136 +ASN1_PCTX_�t_oid_�ags +( +ASN1_PCTX + * +p +, +�ags +); + +1137 +ASN1_PCTX_g�_�r_�ags +( +ASN1_PCTX + * +p +); + +1138 +ASN1_PCTX_�t_�r_�ags +( +ASN1_PCTX + * +p +, +�ags +); + +1140 +BIO_METHOD + * +BIO_f_a�1 +(); + +1142 +BIO + * +BIO_�w_NDEF +(BIO * +out +, +ASN1_VALUE + * +v� +, cڡ +ASN1_ITEM + * +� +); + +1144 +i2d_ASN1_bio_��am +( +BIO + * +out +, +ASN1_VALUE + * +v� +, BIO * +� +, +�ags +, + +1145 cڡ +ASN1_ITEM + * +� +); + +1146 +PEM_wr�e_bio_ASN1_��am +( +BIO + * +out +, +ASN1_VALUE + * +v� +, BIO * +� +, +�ags +, + +1147 cڡ * +hdr +, + +1148 cڡ +ASN1_ITEM + * +� +); + +1149 +SMIME_wr�e_ASN1 +( +BIO + * +bio +, +ASN1_VALUE + * +v� +, BIO * +d�a +, +�ags +, + +1150 +�y�_nid +, +ec�t_nid +, + +1151 +STACK_OF +( +X509_ALGOR +�* +md�gs +, + +1152 cڡ +ASN1_ITEM + * +� +); + +1153 +ASN1_VALUE + * +SMIME_�ad_ASN1 +( +BIO + * +bio +, BIO ** +bc�t +, cڡ +ASN1_ITEM + * +� +); + +1154 +SMIME_�lf_c�y +( +BIO + * +� +, BIO * +out +, +�ags +); + +1155 +SMIME_�xt +( +BIO + * +� +, BIO * +out +); + +1161 +ERR_l�d_ASN1_�r�gs +(); + +1166 + #ASN1_F_A2D_ASN1_OBJECT + 100 + + ) + +1167 + #ASN1_F_A2I_ASN1_ENUMERATED + 101 + + ) + +1168 + #ASN1_F_A2I_ASN1_INTEGER + 102 + + ) + +1169 + #ASN1_F_A2I_ASN1_STRING + 103 + + ) + +1170 + #ASN1_F_APPEND_EXP + 176 + + ) + +1171 + #ASN1_F_ASN1_BIT_STRING_SET_BIT + 183 + + ) + +1172 + #ASN1_F_ASN1_CB + 177 + + ) + +1173 + #ASN1_F_ASN1_CHECK_TLEN + 104 + + ) + +1174 + #ASN1_F_ASN1_COLLATE_PRIMITIVE + 105 + + ) + +1175 + #ASN1_F_ASN1_COLLECT + 106 + + ) + +1176 + #ASN1_F_ASN1_D2I_EX_PRIMITIVE + 108 + + ) + +1177 + #ASN1_F_ASN1_D2I_FP + 109 + + ) + +1178 + #ASN1_F_ASN1_D2I_READ_BIO + 107 + + ) + +1179 + #ASN1_F_ASN1_DIGEST + 184 + + ) + +1180 + #ASN1_F_ASN1_DO_ADB + 110 + + ) + +1181 + #ASN1_F_ASN1_DUP + 111 + + ) + +1182 + #ASN1_F_ASN1_ENUMERATED_SET + 112 + + ) + +1183 + #ASN1_F_ASN1_ENUMERATED_TO_BN + 113 + + ) + +1184 + #ASN1_F_ASN1_EX_C2I + 204 + + ) + +1185 + #ASN1_F_ASN1_FIND_END + 190 + + ) + +1186 + #ASN1_F_ASN1_GENERALIZEDTIME_ADJ + 216 + + ) + +1187 + #ASN1_F_ASN1_GENERALIZEDTIME_SET + 185 + + ) + +1188 + #ASN1_F_ASN1_GENERATE_V3 + 178 + + ) + +1189 + #ASN1_F_ASN1_GET_OBJECT + 114 + + ) + +1190 + #ASN1_F_ASN1_HEADER_NEW + 115 + + ) + +1191 + #ASN1_F_ASN1_I2D_BIO + 116 + + ) + +1192 + #ASN1_F_ASN1_I2D_FP + 117 + + ) + +1193 + #ASN1_F_ASN1_INTEGER_SET + 118 + + ) + +1194 + #ASN1_F_ASN1_INTEGER_TO_BN + 119 + + ) + +1195 + #ASN1_F_ASN1_ITEM_D2I_FP + 206 + + ) + +1196 + #ASN1_F_ASN1_ITEM_DUP + 191 + + ) + +1197 + #ASN1_F_ASN1_ITEM_EX_COMBINE_NEW + 121 + + ) + +1198 + #ASN1_F_ASN1_ITEM_EX_D2I + 120 + + ) + +1199 + #ASN1_F_ASN1_ITEM_I2D_BIO + 192 + + ) + +1200 + #ASN1_F_ASN1_ITEM_I2D_FP + 193 + + ) + +1201 + #ASN1_F_ASN1_ITEM_PACK + 198 + + ) + +1202 + #ASN1_F_ASN1_ITEM_SIGN + 195 + + ) + +1203 + #ASN1_F_ASN1_ITEM_SIGN_CTX + 220 + + ) + +1204 + #ASN1_F_ASN1_ITEM_UNPACK + 199 + + ) + +1205 + #ASN1_F_ASN1_ITEM_VERIFY + 197 + + ) + +1206 + #ASN1_F_ASN1_MBSTRING_NCOPY + 122 + + ) + +1207 + #ASN1_F_ASN1_OBJECT_NEW + 123 + + ) + +1208 + #ASN1_F_ASN1_OUTPUT_DATA + 214 + + ) + +1209 + #ASN1_F_ASN1_PACK_STRING + 124 + + ) + +1210 + #ASN1_F_ASN1_PCTX_NEW + 205 + + ) + +1211 + #ASN1_F_ASN1_PKCS5_PBE_SET + 125 + + ) + +1212 + #ASN1_F_ASN1_SEQ_PACK + 126 + + ) + +1213 + #ASN1_F_ASN1_SEQ_UNPACK + 127 + + ) + +1214 + #ASN1_F_ASN1_SIGN + 128 + + ) + +1215 + #ASN1_F_ASN1_STR2TYPE + 179 + + ) + +1216 + #ASN1_F_ASN1_STRING_SET + 186 + + ) + +1217 + #ASN1_F_ASN1_STRING_TABLE_ADD + 129 + + ) + +1218 + #ASN1_F_ASN1_STRING_TYPE_NEW + 130 + + ) + +1219 + #ASN1_F_ASN1_TEMPLATE_EX_D2I + 132 + + ) + +1220 + #ASN1_F_ASN1_TEMPLATE_NEW + 133 + + ) + +1221 + #ASN1_F_ASN1_TEMPLATE_NOEXP_D2I + 131 + + ) + +1222 + #ASN1_F_ASN1_TIME_ADJ + 217 + + ) + +1223 + #ASN1_F_ASN1_TIME_SET + 175 + + ) + +1224 + #ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING + 134 + + ) + +1225 + #ASN1_F_ASN1_TYPE_GET_OCTETSTRING + 135 + + ) + +1226 + #ASN1_F_ASN1_UNPACK_STRING + 136 + + ) + +1227 + #ASN1_F_ASN1_UTCTIME_ADJ + 218 + + ) + +1228 + #ASN1_F_ASN1_UTCTIME_SET + 187 + + ) + +1229 + #ASN1_F_ASN1_VERIFY + 137 + + ) + +1230 + #ASN1_F_B64_READ_ASN1 + 209 + + ) + +1231 + #ASN1_F_B64_WRITE_ASN1 + 210 + + ) + +1232 + #ASN1_F_BIO_NEW_NDEF + 208 + + ) + +1233 + #ASN1_F_BITSTR_CB + 180 + + ) + +1234 + #ASN1_F_BN_TO_ASN1_ENUMERATED + 138 + + ) + +1235 + #ASN1_F_BN_TO_ASN1_INTEGER + 139 + + ) + +1236 + #ASN1_F_C2I_ASN1_BIT_STRING + 189 + + ) + +1237 + #ASN1_F_C2I_ASN1_INTEGER + 194 + + ) + +1238 + #ASN1_F_C2I_ASN1_OBJECT + 196 + + ) + +1239 + #ASN1_F_COLLECT_DATA + 140 + + ) + +1240 + #ASN1_F_D2I_ASN1_BIT_STRING + 141 + + ) + +1241 + #ASN1_F_D2I_ASN1_BOOLEAN + 142 + + ) + +1242 + #ASN1_F_D2I_ASN1_BYTES + 143 + + ) + +1243 + #ASN1_F_D2I_ASN1_GENERALIZEDTIME + 144 + + ) + +1244 + #ASN1_F_D2I_ASN1_HEADER + 145 + + ) + +1245 + #ASN1_F_D2I_ASN1_INTEGER + 146 + + ) + +1246 + #ASN1_F_D2I_ASN1_OBJECT + 147 + + ) + +1247 + #ASN1_F_D2I_ASN1_SET + 148 + + ) + +1248 + #ASN1_F_D2I_ASN1_TYPE_BYTES + 149 + + ) + +1249 + #ASN1_F_D2I_ASN1_UINTEGER + 150 + + ) + +1250 + #ASN1_F_D2I_ASN1_UTCTIME + 151 + + ) + +1251 + #ASN1_F_D2I_AUTOPRIVATEKEY + 207 + + ) + +1252 + #ASN1_F_D2I_NETSCAPE_RSA + 152 + + ) + +1253 + #ASN1_F_D2I_NETSCAPE_RSA_2 + 153 + + ) + +1254 + #ASN1_F_D2I_PRIVATEKEY + 154 + + ) + +1255 + #ASN1_F_D2I_PUBLICKEY + 155 + + ) + +1256 + #ASN1_F_D2I_RSA_NET + 200 + + ) + +1257 + #ASN1_F_D2I_RSA_NET_2 + 201 + + ) + +1258 + #ASN1_F_D2I_X509 + 156 + + ) + +1259 + #ASN1_F_D2I_X509_CINF + 157 + + ) + +1260 + #ASN1_F_D2I_X509_PKEY + 159 + + ) + +1261 + #ASN1_F_I2D_ASN1_BIO_STREAM + 211 + + ) + +1262 + #ASN1_F_I2D_ASN1_SET + 188 + + ) + +1263 + #ASN1_F_I2D_ASN1_TIME + 160 + + ) + +1264 + #ASN1_F_I2D_DSA_PUBKEY + 161 + + ) + +1265 + #ASN1_F_I2D_EC_PUBKEY + 181 + + ) + +1266 + #ASN1_F_I2D_PRIVATEKEY + 163 + + ) + +1267 + #ASN1_F_I2D_PUBLICKEY + 164 + + ) + +1268 + #ASN1_F_I2D_RSA_NET + 162 + + ) + +1269 + #ASN1_F_I2D_RSA_PUBKEY + 165 + + ) + +1270 + #ASN1_F_LONG_C2I + 166 + + ) + +1271 + #ASN1_F_OID_MODULE_INIT + 174 + + ) + +1272 + #ASN1_F_PARSE_TAGGING + 182 + + ) + +1273 + #ASN1_F_PKCS5_PBE2_SET_IV + 167 + + ) + +1274 + #ASN1_F_PKCS5_PBE_SET + 202 + + ) + +1275 + #ASN1_F_PKCS5_PBE_SET0_ALGOR + 215 + + ) + +1276 + #ASN1_F_PKCS5_PBKDF2_SET + 219 + + ) + +1277 + #ASN1_F_SMIME_READ_ASN1 + 212 + + ) + +1278 + #ASN1_F_SMIME_TEXT + 213 + + ) + +1279 + #ASN1_F_X509_CINF_NEW + 168 + + ) + +1280 + #ASN1_F_X509_CRL_ADD0_REVOKED + 169 + + ) + +1281 + #ASN1_F_X509_INFO_NEW + 170 + + ) + +1282 + #ASN1_F_X509_NAME_ENCODE + 203 + + ) + +1283 + #ASN1_F_X509_NAME_EX_D2I + 158 + + ) + +1284 + #ASN1_F_X509_NAME_EX_NEW + 171 + + ) + +1285 + #ASN1_F_X509_NEW + 172 + + ) + +1286 + #ASN1_F_X509_PKEY_NEW + 173 + + ) + +1289 + #ASN1_R_ADDING_OBJECT + 171 + + ) + +1290 + #ASN1_R_ASN1_PARSE_ERROR + 203 + + ) + +1291 + #ASN1_R_ASN1_SIG_PARSE_ERROR + 204 + + ) + +1292 + #ASN1_R_AUX_ERROR + 100 + + ) + +1293 + #ASN1_R_BAD_CLASS + 101 + + ) + +1294 + #ASN1_R_BAD_OBJECT_HEADER + 102 + + ) + +1295 + #ASN1_R_BAD_PASSWORD_READ + 103 + + ) + +1296 + #ASN1_R_BAD_TAG + 104 + + ) + +1297 + #ASN1_R_BMPSTRING_IS_WRONG_LENGTH + 214 + + ) + +1298 + #ASN1_R_BN_LIB + 105 + + ) + +1299 + #ASN1_R_BOOLEAN_IS_WRONG_LENGTH + 106 + + ) + +1300 + #ASN1_R_BUFFER_TOO_SMALL + 107 + + ) + +1301 + #ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER + 108 + + ) + +1302 + #ASN1_R_CONTEXT_NOT_INITIALISED + 217 + + ) + +1303 + #ASN1_R_DATA_IS_WRONG + 109 + + ) + +1304 + #ASN1_R_DECODE_ERROR + 110 + + ) + +1305 + #ASN1_R_DECODING_ERROR + 111 + + ) + +1306 + #ASN1_R_DEPTH_EXCEEDED + 174 + + ) + +1307 + #ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED + 198 + + ) + +1308 + #ASN1_R_ENCODE_ERROR + 112 + + ) + +1309 + #ASN1_R_ERROR_GETTING_TIME + 173 + + ) + +1310 + #ASN1_R_ERROR_LOADING_SECTION + 172 + + ) + +1311 + #ASN1_R_ERROR_PARSING_SET_ELEMENT + 113 + + ) + +1312 + #ASN1_R_ERROR_SETTING_CIPHER_PARAMS + 114 + + ) + +1313 + #ASN1_R_EXPECTING_AN_INTEGER + 115 + + ) + +1314 + #ASN1_R_EXPECTING_AN_OBJECT + 116 + + ) + +1315 + #ASN1_R_EXPECTING_A_BOOLEAN + 117 + + ) + +1316 + #ASN1_R_EXPECTING_A_TIME + 118 + + ) + +1317 + #ASN1_R_EXPLICIT_LENGTH_MISMATCH + 119 + + ) + +1318 + #ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED + 120 + + ) + +1319 + #ASN1_R_FIELD_MISSING + 121 + + ) + +1320 + #ASN1_R_FIRST_NUM_TOO_LARGE + 122 + + ) + +1321 + #ASN1_R_HEADER_TOO_LONG + 123 + + ) + +1322 + #ASN1_R_ILLEGAL_BITSTRING_FORMAT + 175 + + ) + +1323 + #ASN1_R_ILLEGAL_BOOLEAN + 176 + + ) + +1324 + #ASN1_R_ILLEGAL_CHARACTERS + 124 + + ) + +1325 + #ASN1_R_ILLEGAL_FORMAT + 177 + + ) + +1326 + #ASN1_R_ILLEGAL_HEX + 178 + + ) + +1327 + #ASN1_R_ILLEGAL_IMPLICIT_TAG + 179 + + ) + +1328 + #ASN1_R_ILLEGAL_INTEGER + 180 + + ) + +1329 + #ASN1_R_ILLEGAL_NESTED_TAGGING + 181 + + ) + +1330 + #ASN1_R_ILLEGAL_NULL + 125 + + ) + +1331 + #ASN1_R_ILLEGAL_NULL_VALUE + 182 + + ) + +1332 + #ASN1_R_ILLEGAL_OBJECT + 183 + + ) + +1333 + #ASN1_R_ILLEGAL_OPTIONAL_ANY + 126 + + ) + +1334 + #ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE + 170 + + ) + +1335 + #ASN1_R_ILLEGAL_TAGGED_ANY + 127 + + ) + +1336 + #ASN1_R_ILLEGAL_TIME_VALUE + 184 + + ) + +1337 + #ASN1_R_INTEGER_NOT_ASCII_FORMAT + 185 + + ) + +1338 + #ASN1_R_INTEGER_TOO_LARGE_FOR_LONG + 128 + + ) + +1339 + #ASN1_R_INVALID_BIT_STRING_BITS_LEFT + 220 + + ) + +1340 + #ASN1_R_INVALID_BMPSTRING_LENGTH + 129 + + ) + +1341 + #ASN1_R_INVALID_DIGIT + 130 + + ) + +1342 + #ASN1_R_INVALID_MIME_TYPE + 205 + + ) + +1343 + #ASN1_R_INVALID_MODIFIER + 186 + + ) + +1344 + #ASN1_R_INVALID_NUMBER + 187 + + ) + +1345 + #ASN1_R_INVALID_OBJECT_ENCODING + 216 + + ) + +1346 + #ASN1_R_INVALID_SEPARATOR + 131 + + ) + +1347 + #ASN1_R_INVALID_TIME_FORMAT + 132 + + ) + +1348 + #ASN1_R_INVALID_UNIVERSALSTRING_LENGTH + 133 + + ) + +1349 + #ASN1_R_INVALID_UTF8STRING + 134 + + ) + +1350 + #ASN1_R_IV_TOO_LARGE + 135 + + ) + +1351 + #ASN1_R_LENGTH_ERROR + 136 + + ) + +1352 + #ASN1_R_LIST_ERROR + 188 + + ) + +1353 + #ASN1_R_MIME_NO_CONTENT_TYPE + 206 + + ) + +1354 + #ASN1_R_MIME_PARSE_ERROR + 207 + + ) + +1355 + #ASN1_R_MIME_SIG_PARSE_ERROR + 208 + + ) + +1356 + #ASN1_R_MISSING_EOC + 137 + + ) + +1357 + #ASN1_R_MISSING_SECOND_NUMBER + 138 + + ) + +1358 + #ASN1_R_MISSING_VALUE + 189 + + ) + +1359 + #ASN1_R_MSTRING_NOT_UNIVERSAL + 139 + + ) + +1360 + #ASN1_R_MSTRING_WRONG_TAG + 140 + + ) + +1361 + #ASN1_R_NESTED_ASN1_STRING + 197 + + ) + +1362 + #ASN1_R_NESTED_TOO_DEEP + 219 + + ) + +1363 + #ASN1_R_NON_HEX_CHARACTERS + 141 + + ) + +1364 + #ASN1_R_NOT_ASCII_FORMAT + 190 + + ) + +1365 + #ASN1_R_NOT_ENOUGH_DATA + 142 + + ) + +1366 + #ASN1_R_NO_CONTENT_TYPE + 209 + + ) + +1367 + #ASN1_R_NO_DEFAULT_DIGEST + 201 + + ) + +1368 + #ASN1_R_NO_MATCHING_CHOICE_TYPE + 143 + + ) + +1369 + #ASN1_R_NO_MULTIPART_BODY_FAILURE + 210 + + ) + +1370 + #ASN1_R_NO_MULTIPART_BOUNDARY + 211 + + ) + +1371 + #ASN1_R_NO_SIG_CONTENT_TYPE + 212 + + ) + +1372 + #ASN1_R_NULL_IS_WRONG_LENGTH + 144 + + ) + +1373 + #ASN1_R_OBJECT_NOT_ASCII_FORMAT + 191 + + ) + +1374 + #ASN1_R_ODD_NUMBER_OF_CHARS + 145 + + ) + +1375 + #ASN1_R_PRIVATE_KEY_HEADER_MISSING + 146 + + ) + +1376 + #ASN1_R_SECOND_NUMBER_TOO_LARGE + 147 + + ) + +1377 + #ASN1_R_SEQUENCE_LENGTH_MISMATCH + 148 + + ) + +1378 + #ASN1_R_SEQUENCE_NOT_CONSTRUCTED + 149 + + ) + +1379 + #ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG + 192 + + ) + +1380 + #ASN1_R_SHORT_LINE + 150 + + ) + +1381 + #ASN1_R_SIG_INVALID_MIME_TYPE + 213 + + ) + +1382 + #ASN1_R_STREAMING_NOT_SUPPORTED + 202 + + ) + +1383 + #ASN1_R_STRING_TOO_LONG + 151 + + ) + +1384 + #ASN1_R_STRING_TOO_SHORT + 152 + + ) + +1385 + #ASN1_R_TAG_VALUE_TOO_HIGH + 153 + + ) + +1386 + #ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD + 154 + + ) + +1387 + #ASN1_R_TIME_NOT_ASCII_FORMAT + 193 + + ) + +1388 + #ASN1_R_TOO_LONG + 155 + + ) + +1389 + #ASN1_R_TYPE_NOT_CONSTRUCTED + 156 + + ) + +1390 + #ASN1_R_UNABLE_TO_DECODE_RSA_KEY + 157 + + ) + +1391 + #ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY + 158 + + ) + +1392 + #ASN1_R_UNEXPECTED_EOC + 159 + + ) + +1393 + #ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH + 215 + + ) + +1394 + #ASN1_R_UNKNOWN_FORMAT + 160 + + ) + +1395 + #ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM + 161 + + ) + +1396 + #ASN1_R_UNKNOWN_OBJECT_TYPE + 162 + + ) + +1397 + #ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE + 163 + + ) + +1398 + #ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM + 199 + + ) + +1399 + #ASN1_R_UNKNOWN_TAG + 194 + + ) + +1400 + #ASN1_R_UNKOWN_FORMAT + 195 + + ) + +1401 + #ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE + 164 + + ) + +1402 + #ASN1_R_UNSUPPORTED_CIPHER + 165 + + ) + +1403 + #ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM + 166 + + ) + +1404 + #ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE + 167 + + ) + +1405 + #ASN1_R_UNSUPPORTED_TYPE + 196 + + ) + +1406 + #ASN1_R_WRONG_PUBLIC_KEY_TYPE + 200 + + ) + +1407 + #ASN1_R_WRONG_TAG + 168 + + ) + +1408 + #ASN1_R_WRONG_TYPE + 169 + + ) + +1410 #ifde� +__�lu�lus + + + @/usr/include/openssl/ebcdic.h + +3 #i�de� +HEADER_EBCDIC_H + + +4 + #HEADER_EBCDIC_H + + + ) + +6 + ~<sys/ty�s.h +> + +9 + #os_t�scii + +_ݒs�_os_t�scii + + + ) + +10 + #os_t�bcdic + +_ݒs�_os_t�bcdic + + + ) + +11 + #ebcdic2ascii + +_ݒs�_ebcdic2ascii + + + ) + +12 + #ascii2ebcdic + +_ݒs�_ascii2ebcdic + + + ) + +14 cڡ +os_t�scii +[256]; + +15 cڡ +os_t�bcdic +[256]; + +16 * +ebcdic2ascii +(* +de� +, cڡ * +�� +, +size_t + +cou� +); + +17 * +ascii2ebcdic +(* +de� +, cڡ * +�� +, +size_t + +cou� +); + + @/usr/include/openssl/ec.h + +76 #i�de� +HEADER_EC_H + + +77 + #HEADER_EC_H + + + ) + +79 + ~<ݒs�/ݒs�c�f.h +> + +81 #ifde� +OPENSSL_NO_EC + + +82 #�r� +EC + +is + +di�b�d +. + +85 + ~<ݒs�/a�1.h +> + +86 + ~<ݒs�/symhacks.h +> + +87 #i�de� +OPENSSL_NO_DEPRECATED + + +88 + ~<ݒs�/bn.h +> + +91 #ifde� +__�lu�lus + + +93 #�i� +def�ed +( +__SUNPRO_C +) + +94 #i� +__SUNPRO_C + >= 0x520 + +95 #�agm� +�r�_mes�ges + ( +off +, +E_ARRAY_OF_INCOMPLETE_NONAME +, +E_ARRAY_OF_INCOMPLETE +) + +100 #i�de� +OPENSSL_ECC_MAX_FIELD_BITS + + +101 + #OPENSSL_ECC_MAX_FIELD_BITS + 661 + + ) + +109 +POINT_CONVERSION_COMPRESSED + = 2, + +111 +POINT_CONVERSION_UNCOMPRESSED + = 4, + +114 +POINT_CONVERSION_HYBRID + = 6 + +115 } + tpo�t_c�v�si�_f�m_t +; + +118 +ec_m�hod_� + + tEC_METHOD +; + +120 +ec_group_� + + +129 + tEC_GROUP +; + +131 +ec_po�t_� + + tEC_POINT +; + +142 cڡ +EC_METHOD + * +EC_GFp_sim�e_m�hod +(); + +147 cڡ +EC_METHOD + * +EC_GFp_m�t_m�hod +(); + +152 cڡ +EC_METHOD + * +EC_GFp_ni�_m�hod +(); + +154 #i�de� +OPENSSL_NO_EC_NISTP_64_GCC_128 + + +158 cڡ +EC_METHOD + * +EC_GFp_ni�p224_m�hod +(); + +163 cڡ +EC_METHOD + * +EC_GFp_ni�p256_m�hod +(); + +168 cڡ +EC_METHOD + * +EC_GFp_ni�p521_m�hod +(); + +171 #i�de� +OPENSSL_NO_EC2M + + +179 cڡ +EC_METHOD + * +EC_GF2m_sim�e_m�hod +(); + +192 +EC_GROUP + * +EC_GROUP_�w +(cڡ +EC_METHOD + * +m�h +); + +197 +EC_GROUP_� +( +EC_GROUP + * +group +); + +202 +EC_GROUP_��r_� +( +EC_GROUP + * +group +); + +209 +EC_GROUP_c�y +( +EC_GROUP + * +d� +, cڡ EC_GROUP * +�c +); + +216 +EC_GROUP + * +EC_GROUP_dup +(cڡ EC_GROUP * +�c +); + +222 cڡ +EC_METHOD + * +EC_GROUP_m�hod_of +(cڡ +EC_GROUP + * +group +); + +228 +EC_METHOD_g�_f�ld_ty� +(cڡ +EC_METHOD + * +m�h +); + +238 +EC_GROUP_�t_g���� +( +EC_GROUP + * +group +, cڡ +EC_POINT + * +g���� +, cڡ +BIGNUM + * +�d� +, cڡ BIGNUM * +co��� +); + +244 cڡ +EC_POINT + * +EC_GROUP_g�0_g���� +(cڡ +EC_GROUP + * +group +); + +250 +BN_MONT_CTX + * +EC_GROUP_g�_m�t_d�a +(cڡ +EC_GROUP + * +group +); + +258 +EC_GROUP_g�_�d� +(cڡ +EC_GROUP + * +group +, +BIGNUM + * +�d� +, +BN_CTX + * +�x +); + +266 +EC_GROUP_g�_co��� +(cڡ +EC_GROUP + * +group +, +BIGNUM + * +co��� +, +BN_CTX + * +�x +); + +272 +EC_GROUP_�t_curve_�me +( +EC_GROUP + * +group +, +nid +); + +278 +EC_GROUP_g�_curve_�me +(cڡ +EC_GROUP + * +group +); + +280 +EC_GROUP_�t_a�1_�ag +( +EC_GROUP + * +group +, +�ag +); + +281 +EC_GROUP_g�_a�1_�ag +(cڡ +EC_GROUP + * +group +); + +283 +EC_GROUP_�t_po�t_c�v�si�_f�m +( +EC_GROUP + * +group +, +po�t_c�v�si�_f�m_t + +f�m +); + +284 +po�t_c�v�si�_f�m_t + +EC_GROUP_g�_po�t_c�v�si�_f�m +(cڡ +EC_GROUP + *); + +286 * +EC_GROUP_g�0_�ed +(cڡ +EC_GROUP + * +x +); + +287 +size_t + +EC_GROUP_g�_�ed_�n +(cڡ +EC_GROUP + *); + +288 +size_t + +EC_GROUP_�t_�ed +( +EC_GROUP + *, cڡ *, size_� +�n +); + +298 +EC_GROUP_�t_curve_GFp +( +EC_GROUP + * +group +, cڡ +BIGNUM + * +p +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +, +BN_CTX + * +�x +); + +308 +EC_GROUP_g�_curve_GFp +(cڡ +EC_GROUP + * +group +, +BIGNUM + * +p +, BIGNUM * +a +, BIGNUM * +b +, +BN_CTX + * +�x +); + +310 #i�de� +OPENSSL_NO_EC2M + + +319 +EC_GROUP_�t_curve_GF2m +( +EC_GROUP + * +group +, cڡ +BIGNUM + * +p +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +, +BN_CTX + * +�x +); + +329 +EC_GROUP_g�_curve_GF2m +(cڡ +EC_GROUP + * +group +, +BIGNUM + * +p +, BIGNUM * +a +, BIGNUM * +b +, +BN_CTX + * +�x +); + +335 +EC_GROUP_g�_deg�e +(cڡ +EC_GROUP + * +group +); + +342 +EC_GROUP_check +(cڡ +EC_GROUP + * +group +, +BN_CTX + * +�x +); + +349 +EC_GROUP_check_dis�im��t +(cڡ +EC_GROUP + * +group +, +BN_CTX + * +�x +); + +357 +EC_GROUP_cmp +(cڡ +EC_GROUP + * +a +, cڡ EC_GROUP * +b +, +BN_CTX + * +�x +); + +370 +EC_GROUP + * +EC_GROUP_�w_curve_GFp +(cڡ +BIGNUM + * +p +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +, +BN_CTX + * +�x +); + +371 #i�de� +OPENSSL_NO_EC2M + + +380 +EC_GROUP + * +EC_GROUP_�w_curve_GF2m +(cڡ +BIGNUM + * +p +, cڡ BIGNUM * +a +, cڡ BIGNUM * +b +, +BN_CTX + * +�x +); + +387 +EC_GROUP + * +EC_GROUP_�w_by_curve_�me +( +nid +); + +395 +nid +; + +396 cڡ * +comm�t +; + +397 } + tEC_bu�t�_curve +; + +403 +size_t + +EC_g�_bu�t�_curves +( +EC_bu�t�_curve + * +r +, size_� +n�ems +); + +414 +EC_POINT + * +EC_POINT_�w +(cڡ +EC_GROUP + * +group +); + +419 +EC_POINT_� +( +EC_POINT + * +po�t +); + +424 +EC_POINT_��r_� +( +EC_POINT + * +po�t +); + +431 +EC_POINT_c�y +( +EC_POINT + * +d� +, cڡ EC_POINT * +�c +); + +439 +EC_POINT + * +EC_POINT_dup +(cڡ EC_POINT * +�c +, cڡ +EC_GROUP + * +group +); + +445 cڡ +EC_METHOD + * +EC_POINT_m�hod_of +(cڡ +EC_POINT + * +po�t +); + +452 +EC_POINT_�t_to_�f��y +(cڡ +EC_GROUP + * +group +, +EC_POINT + * +po�t +); + +463 +EC_POINT_�t_J�oje�ive_co�d��es_GFp +(cڡ +EC_GROUP + * +group +, +EC_POINT + * +p +, + +464 cڡ +BIGNUM + * +x +, cڡ BIGNUM * +y +, cڡ BIGNUM * +z +, +BN_CTX + * +�x +); + +475 +EC_POINT_g�_J�oje�ive_co�d��es_GFp +(cڡ +EC_GROUP + * +group +, + +476 cڡ +EC_POINT + * +p +, +BIGNUM + * +x +, BIGNUM * +y +, BIGNUM * +z +, +BN_CTX + * +�x +); + +486 +EC_POINT_�t_aff�e_co�d��es_GFp +(cڡ +EC_GROUP + * +group +, +EC_POINT + * +p +, + +487 cڡ +BIGNUM + * +x +, cڡ BIGNUM * +y +, +BN_CTX + * +�x +); + +497 +EC_POINT_g�_aff�e_co�d��es_GFp +(cڡ +EC_GROUP + * +group +, + +498 cڡ +EC_POINT + * +p +, +BIGNUM + * +x +, BIGNUM * +y +, +BN_CTX + * +�x +); + +508 +EC_POINT_�t_com�es�d_co�d��es_GFp +(cڡ +EC_GROUP + * +group +, +EC_POINT + * +p +, + +509 cڡ +BIGNUM + * +x +, +y_b� +, +BN_CTX + * +�x +); + +510 #i�de� +OPENSSL_NO_EC2M + + +519 +EC_POINT_�t_aff�e_co�d��es_GF2m +(cڡ +EC_GROUP + * +group +, +EC_POINT + * +p +, + +520 cڡ +BIGNUM + * +x +, cڡ BIGNUM * +y +, +BN_CTX + * +�x +); + +530 +EC_POINT_g�_aff�e_co�d��es_GF2m +(cڡ +EC_GROUP + * +group +, + +531 cڡ +EC_POINT + * +p +, +BIGNUM + * +x +, BIGNUM * +y +, +BN_CTX + * +�x +); + +541 +EC_POINT_�t_com�es�d_co�d��es_GF2m +(cڡ +EC_GROUP + * +group +, +EC_POINT + * +p +, + +542 cڡ +BIGNUM + * +x +, +y_b� +, +BN_CTX + * +�x +); + +554 +size_t + +EC_POINT_po�t2o� +(cڡ +EC_GROUP + * +group +, cڡ +EC_POINT + * +p +, + +555 +po�t_c�v�si�_f�m_t + +f�m +, + +556 * +buf +, +size_t + +�n +, +BN_CTX + * +�x +); + +566 +EC_POINT_o�2po�t +(cڡ +EC_GROUP + * +group +, +EC_POINT + * +p +, + +567 cڡ * +buf +, +size_t + +�n +, +BN_CTX + * +�x +); + +570 +BIGNUM + * +EC_POINT_po�t2bn +(cڡ +EC_GROUP + *, cڡ +EC_POINT + *, + +571 +po�t_c�v�si�_f�m_t + +f�m +, +BIGNUM + *, +BN_CTX + *); + +572 +EC_POINT + * +EC_POINT_bn2po�t +(cڡ +EC_GROUP + *, cڡ +BIGNUM + *, + +573 +EC_POINT + *, +BN_CTX + *); + +574 * +EC_POINT_po�t2hex +(cڡ +EC_GROUP + *, cڡ +EC_POINT + *, + +575 +po�t_c�v�si�_f�m_t + +f�m +, +BN_CTX + *); + +576 +EC_POINT + * +EC_POINT_hex2po�t +(cڡ +EC_GROUP + *, const *, + +577 +EC_POINT + *, +BN_CTX + *); + +592 +EC_POINT_add +(cڡ +EC_GROUP + * +group +, +EC_POINT + * +r +, cڡ EC_POINT * +a +, cڡ EC_POINT * +b +, +BN_CTX + * +�x +); + +601 +EC_POINT_dbl +(cڡ +EC_GROUP + * +group +, +EC_POINT + * +r +, cڡ EC_POINT * +a +, +BN_CTX + * +�x +); + +609 +EC_POINT_�v�t +(cڡ +EC_GROUP + * +group +, +EC_POINT + * +a +, +BN_CTX + * +�x +); + +616 +EC_POINT_is_�_�f��y +(cڡ +EC_GROUP + * +group +, cڡ +EC_POINT + * +p +); + +624 +EC_POINT_is_�_curve +(cڡ +EC_GROUP + * +group +, cڡ +EC_POINT + * +po�t +, +BN_CTX + * +�x +); + +633 +EC_POINT_cmp +(cڡ +EC_GROUP + * +group +, cڡ +EC_POINT + * +a +, cڡ EC_POINT * +b +, +BN_CTX + * +�x +); + +635 +EC_POINT_make_aff�e +(cڡ +EC_GROUP + * +group +, +EC_POINT + * +po�t +, +BN_CTX + * +�x +); + +636 +EC_POINTs_make_aff�e +(cڡ +EC_GROUP + * +group +, +size_t + +num +, +EC_POINT + * +po�ts +[], +BN_CTX + * +�x +); + +648 +EC_POINTs_mul +(cڡ +EC_GROUP + * +group +, +EC_POINT + * +r +, cڡ +BIGNUM + * +n +, +size_t + +num +, cڡ EC_POINT * +p +[], cڡ BIGNUM * +m +[], +BN_CTX + * +�x +); + +659 +EC_POINT_mul +(cڡ +EC_GROUP + * +group +, +EC_POINT + * +r +, cڡ +BIGNUM + * +n +, cڡ EC_POINT * +q +, cڡ BIGNUM * +m +, +BN_CTX + * +�x +); + +666 +EC_GROUP_�ecompu�_mu� +( +EC_GROUP + * +group +, +BN_CTX + * +�x +); + +672 +EC_GROUP_have_�ecompu�_mu� +(cڡ +EC_GROUP + * +group +); + +681 +EC_GROUP_g�_basis_ty� +(cڡ +EC_GROUP + *); + +682 #i�de� +OPENSSL_NO_EC2M + + +683 +EC_GROUP_g�_��om�l_basis +(cڡ +EC_GROUP + *, * +k +); + +684 +EC_GROUP_g�_���om�l_basis +(cڡ +EC_GROUP + *, * +k1 +, + +685 * +k2 +, * +k3 +); + +688 + #OPENSSL_EC_NAMED_CURVE + 0x001 + + ) + +690 +e�k_��m��s_� + + tECPKPARAMETERS +; + +692 +EC_GROUP + * +d2i_ECPKP�am��s +(EC_GROUP **, cڡ ** +� +, +�n +); + +693 +i2d_ECPKP�am��s +(cڡ +EC_GROUP + *, ** +out +); + +695 + #d2i_ECPKP�am��s_bio +( +bp +, +x +� + `ASN1_d2i_bio_of +( +EC_GROUP +, +NULL +, +d2i_ECPKP�am��s +,bp,x) + + ) + +696 + #i2d_ECPKP�am��s_bio +( +bp +, +x +� + `ASN1_i2d_bio_of_cڡ +( +EC_GROUP +, +i2d_ECPKP�am��s +,bp,x) + + ) + +697 + #d2i_ECPKP�am��s_� +( +� +, +x +�( +EC_GROUP + *) + `ASN1_d2i_� +( +NULL +, \ + +698 (*(*)()) +d2i_ECPKP�am��s +,( +� +),(**)( +x +)) + + ) + +699 + #i2d_ECPKP�am��s_� +( +� +, +x +� + `ASN1_i2d_� +( +i2d_ECPKP�am��s +,(fp), \ + +700 (*)( +x +)) + + ) + +702 #i�de� +OPENSSL_NO_BIO + + +703 +ECPKP�am��s_��t +( +BIO + * +bp +, cڡ +EC_GROUP + * +x +, +off +); + +705 #i�de� +OPENSSL_NO_FP_API + + +706 +ECPKP�am��s_��t_� +( +FILE + * +� +, cڡ +EC_GROUP + * +x +, +off +); + +714 +ec_key_� + + tEC_KEY +; + +717 + #EC_PKEY_NO_PARAMETERS + 0x001 + + ) + +718 + #EC_PKEY_NO_PUBKEY + 0x002 + + ) + +721 + #EC_FLAG_NON_FIPS_ALLOW + 0x1 + + ) + +722 + #EC_FLAG_FIPS_CHECKED + 0x2 + + ) + +727 +EC_KEY + * +EC_KEY_�w +(); + +729 +EC_KEY_g�_�ags +(cڡ +EC_KEY + * +key +); + +731 +EC_KEY_�t_�ags +( +EC_KEY + * +key +, +�ags +); + +733 +EC_KEY_��r_�ags +( +EC_KEY + * +key +, +�ags +); + +740 +EC_KEY + * +EC_KEY_�w_by_curve_�me +( +nid +); + +745 +EC_KEY_� +( +EC_KEY + * +key +); + +752 +EC_KEY + * +EC_KEY_c�y +(EC_KEY * +d� +, cڡ EC_KEY * +�c +); + +758 +EC_KEY + * +EC_KEY_dup +(cڡ EC_KEY * +�c +); + +764 +EC_KEY_up_�f +( +EC_KEY + * +key +); + +770 cڡ +EC_GROUP + * +EC_KEY_g�0_group +(cڡ +EC_KEY + * +key +); + +778 +EC_KEY_�t_group +( +EC_KEY + * +key +, cڡ +EC_GROUP + * +group +); + +784 cڡ +BIGNUM + * +EC_KEY_g�0_�iv�e_key +(cڡ +EC_KEY + * +key +); + +792 +EC_KEY_�t_�iv�e_key +( +EC_KEY + * +key +, cڡ +BIGNUM + * +�v +); + +798 cڡ +EC_POINT + * +EC_KEY_g�0_public_key +(cڡ +EC_KEY + * +key +); + +806 +EC_KEY_�t_public_key +( +EC_KEY + * +key +, cڡ +EC_POINT + * +pub +); + +808 +EC_KEY_g�_�c_�ags +(cڡ +EC_KEY + * +key +); + +809 +EC_KEY_�t_�c_�ags +( +EC_KEY + * +eckey +, +�ags +); + +810 +po�t_c�v�si�_f�m_t + +EC_KEY_g�_c�v_f�m +(cڡ +EC_KEY + * +key +); + +811 +EC_KEY_�t_c�v_f�m +( +EC_KEY + * +eckey +, +po�t_c�v�si�_f�m_t + +cf�m +); + +813 * +EC_KEY_g�_key_m�hod_d�a +( +EC_KEY + * +key +, + +814 *(* +dup_func +)(*), (* +�_func +)(*), (* +��r_�_func +)(*)); + +823 * +EC_KEY_���_key_m�hod_d�a +( +EC_KEY + * +key +, * +d�a +, + +824 *(* +dup_func +)(*), (* +�_func +)(*), (* +��r_�_func +)(*)); + +826 +EC_KEY_�t_a�1_�ag +( +EC_KEY + * +eckey +, +a�1_�ag +); + +834 +EC_KEY_�ecompu�_mu� +( +EC_KEY + * +key +, +BN_CTX + * +�x +); + +840 +EC_KEY_g���e_key +( +EC_KEY + * +key +); + +846 +EC_KEY_check_key +(cڡ +EC_KEY + * +key +); + +855 +EC_KEY_�t_public_key_aff�e_co�d��es +( +EC_KEY + * +key +, +BIGNUM + * +x +, BIGNUM * +y +); + +868 +EC_KEY + * +d2i_ECPriv�eKey +(EC_KEY ** +key +, cڡ ** +� +, +�n +); + +876 +i2d_ECPriv�eKey +( +EC_KEY + * +key +, ** +out +); + +890 +EC_KEY + * +d2i_ECP�am��s +(EC_KEY ** +key +, cڡ ** +� +, +�n +); + +898 +i2d_ECP�am��s +( +EC_KEY + * +key +, ** +out +); + +913 +EC_KEY + * +o2i_ECPublicKey +(EC_KEY ** +key +, cڡ ** +� +, +�n +); + +921 +i2o_ECPublicKey +( +EC_KEY + * +key +, ** +out +); + +923 #i�de� +OPENSSL_NO_BIO + + +929 +ECP�am��s_��t +( +BIO + * +bp +, cڡ +EC_KEY + * +key +); + +937 +EC_KEY_��t +( +BIO + * +bp +, cڡ +EC_KEY + * +key +, +off +); + +940 #i�de� +OPENSSL_NO_FP_API + + +946 +ECP�am��s_��t_� +( +FILE + * +� +, cڡ +EC_KEY + * +key +); + +954 +EC_KEY_��t_� +( +FILE + * +� +, cڡ +EC_KEY + * +key +, +off +); + +958 + #ECP�am��s_dup +( +x +� + `ASN1_dup_of +( +EC_KEY +, +i2d_ECP�am��s +, +d2i_ECP�am��s +,x) + + ) + +960 #i�de� +__�lu�lus + + +961 #i� +def�ed +( +__SUNPRO_C +) + +962 #i� +__SUNPRO_C + >= 0x520 + +963 #�agm� +�r�_mes�ges + (, +E_ARRAY_OF_INCOMPLETE_NONAME +, +E_ARRAY_OF_INCOMPLETE +) + +968 + #EVP_PKEY_CTX_�t_ec_��mg�_curve_nid +( +�x +, +nid +) \ + +969 + `EVP_PKEY_CTX_�� +( +�x +, +EVP_PKEY_EC +, +EVP_PKEY_OP_PARAMGEN +, \ + +970 +EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID +, +nid +, +NULL +) + + ) + +973 + #EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID + ( +EVP_PKEY_ALG_CTRL + + 1) + + ) + +979 +ERR_l�d_EC_�r�gs +(); + +984 + #EC_F_BN_TO_FELEM + 224 + + ) + +985 + #EC_F_COMPUTE_WNAF + 143 + + ) + +986 + #EC_F_D2I_ECPARAMETERS + 144 + + ) + +987 + #EC_F_D2I_ECPKPARAMETERS + 145 + + ) + +988 + #EC_F_D2I_ECPRIVATEKEY + 146 + + ) + +989 + #EC_F_DO_EC_KEY_PRINT + 221 + + ) + +990 + #EC_F_ECKEY_PARAM2TYPE + 223 + + ) + +991 + #EC_F_ECKEY_PARAM_DECODE + 212 + + ) + +992 + #EC_F_ECKEY_PRIV_DECODE + 213 + + ) + +993 + #EC_F_ECKEY_PRIV_ENCODE + 214 + + ) + +994 + #EC_F_ECKEY_PUB_DECODE + 215 + + ) + +995 + #EC_F_ECKEY_PUB_ENCODE + 216 + + ) + +996 + #EC_F_ECKEY_TYPE2PARAM + 220 + + ) + +997 + #EC_F_ECPARAMETERS_PRINT + 147 + + ) + +998 + #EC_F_ECPARAMETERS_PRINT_FP + 148 + + ) + +999 + #EC_F_ECPKPARAMETERS_PRINT + 149 + + ) + +1000 + #EC_F_ECPKPARAMETERS_PRINT_FP + 150 + + ) + +1001 + #EC_F_ECP_NIST_MOD_192 + 203 + + ) + +1002 + #EC_F_ECP_NIST_MOD_224 + 204 + + ) + +1003 + #EC_F_ECP_NIST_MOD_256 + 205 + + ) + +1004 + #EC_F_ECP_NIST_MOD_521 + 206 + + ) + +1005 + #EC_F_EC_ASN1_GROUP2CURVE + 153 + + ) + +1006 + #EC_F_EC_ASN1_GROUP2FIELDID + 154 + + ) + +1007 + #EC_F_EC_ASN1_GROUP2PARAMETERS + 155 + + ) + +1008 + #EC_F_EC_ASN1_GROUP2PKPARAMETERS + 156 + + ) + +1009 + #EC_F_EC_ASN1_PARAMETERS2GROUP + 157 + + ) + +1010 + #EC_F_EC_ASN1_PKPARAMETERS2GROUP + 158 + + ) + +1011 + #EC_F_EC_EX_DATA_SET_DATA + 211 + + ) + +1012 + #EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY + 208 + + ) + +1013 + #EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT + 159 + + ) + +1014 + #EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE + 195 + + ) + +1015 + #EC_F_EC_GF2M_SIMPLE_OCT2POINT + 160 + + ) + +1016 + #EC_F_EC_GF2M_SIMPLE_POINT2OCT + 161 + + ) + +1017 + #EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES + 162 + + ) + +1018 + #EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES + 163 + + ) + +1019 + #EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES + 164 + + ) + +1020 + #EC_F_EC_GFP_MONT_FIELD_DECODE + 133 + + ) + +1021 + #EC_F_EC_GFP_MONT_FIELD_ENCODE + 134 + + ) + +1022 + #EC_F_EC_GFP_MONT_FIELD_MUL + 131 + + ) + +1023 + #EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE + 209 + + ) + +1024 + #EC_F_EC_GFP_MONT_FIELD_SQR + 132 + + ) + +1025 + #EC_F_EC_GFP_MONT_GROUP_SET_CURVE + 189 + + ) + +1026 + #EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP + 135 + + ) + +1027 + #EC_F_EC_GFP_NISTP224_GROUP_SET_CURVE + 225 + + ) + +1028 + #EC_F_EC_GFP_NISTP224_POINTS_MUL + 228 + + ) + +1029 + #EC_F_EC_GFP_NISTP224_POINT_GET_AFFINE_COORDINATES + 226 + + ) + +1030 + #EC_F_EC_GFP_NISTP256_GROUP_SET_CURVE + 230 + + ) + +1031 + #EC_F_EC_GFP_NISTP256_POINTS_MUL + 231 + + ) + +1032 + #EC_F_EC_GFP_NISTP256_POINT_GET_AFFINE_COORDINATES + 232 + + ) + +1033 + #EC_F_EC_GFP_NISTP521_GROUP_SET_CURVE + 233 + + ) + +1034 + #EC_F_EC_GFP_NISTP521_POINTS_MUL + 234 + + ) + +1035 + #EC_F_EC_GFP_NISTP521_POINT_GET_AFFINE_COORDINATES + 235 + + ) + +1036 + #EC_F_EC_GFP_NIST_FIELD_MUL + 200 + + ) + +1037 + #EC_F_EC_GFP_NIST_FIELD_SQR + 201 + + ) + +1038 + #EC_F_EC_GFP_NIST_GROUP_SET_CURVE + 202 + + ) + +1039 + #EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT + 165 + + ) + +1040 + #EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE + 166 + + ) + +1041 + #EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP + 100 + + ) + +1042 + #EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR + 101 + + ) + +1043 + #EC_F_EC_GFP_SIMPLE_MAKE_AFFINE + 102 + + ) + +1044 + #EC_F_EC_GFP_SIMPLE_OCT2POINT + 103 + + ) + +1045 + #EC_F_EC_GFP_SIMPLE_POINT2OCT + 104 + + ) + +1046 + #EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE + 137 + + ) + +1047 + #EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES + 167 + + ) + +1048 + #EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP + 105 + + ) + +1049 + #EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES + 168 + + ) + +1050 + #EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP + 128 + + ) + +1051 + #EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES + 169 + + ) + +1052 + #EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP + 129 + + ) + +1053 + #EC_F_EC_GROUP_CHECK + 170 + + ) + +1054 + #EC_F_EC_GROUP_CHECK_DISCRIMINANT + 171 + + ) + +1055 + #EC_F_EC_GROUP_COPY + 106 + + ) + +1056 + #EC_F_EC_GROUP_GET0_GENERATOR + 139 + + ) + +1057 + #EC_F_EC_GROUP_GET_COFACTOR + 140 + + ) + +1058 + #EC_F_EC_GROUP_GET_CURVE_GF2M + 172 + + ) + +1059 + #EC_F_EC_GROUP_GET_CURVE_GFP + 130 + + ) + +1060 + #EC_F_EC_GROUP_GET_DEGREE + 173 + + ) + +1061 + #EC_F_EC_GROUP_GET_ORDER + 141 + + ) + +1062 + #EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS + 193 + + ) + +1063 + #EC_F_EC_GROUP_GET_TRINOMIAL_BASIS + 194 + + ) + +1064 + #EC_F_EC_GROUP_NEW + 108 + + ) + +1065 + #EC_F_EC_GROUP_NEW_BY_CURVE_NAME + 174 + + ) + +1066 + #EC_F_EC_GROUP_NEW_FROM_DATA + 175 + + ) + +1067 + #EC_F_EC_GROUP_PRECOMPUTE_MULT + 142 + + ) + +1068 + #EC_F_EC_GROUP_SET_CURVE_GF2M + 176 + + ) + +1069 + #EC_F_EC_GROUP_SET_CURVE_GFP + 109 + + ) + +1070 + #EC_F_EC_GROUP_SET_EXTRA_DATA + 110 + + ) + +1071 + #EC_F_EC_GROUP_SET_GENERATOR + 111 + + ) + +1072 + #EC_F_EC_KEY_CHECK_KEY + 177 + + ) + +1073 + #EC_F_EC_KEY_COPY + 178 + + ) + +1074 + #EC_F_EC_KEY_GENERATE_KEY + 179 + + ) + +1075 + #EC_F_EC_KEY_NEW + 182 + + ) + +1076 + #EC_F_EC_KEY_PRINT + 180 + + ) + +1077 + #EC_F_EC_KEY_PRINT_FP + 181 + + ) + +1078 + #EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES + 229 + + ) + +1079 + #EC_F_EC_POINTS_MAKE_AFFINE + 136 + + ) + +1080 + #EC_F_EC_POINT_ADD + 112 + + ) + +1081 + #EC_F_EC_POINT_CMP + 113 + + ) + +1082 + #EC_F_EC_POINT_COPY + 114 + + ) + +1083 + #EC_F_EC_POINT_DBL + 115 + + ) + +1084 + #EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M + 183 + + ) + +1085 + #EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP + 116 + + ) + +1086 + #EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP + 117 + + ) + +1087 + #EC_F_EC_POINT_INVERT + 210 + + ) + +1088 + #EC_F_EC_POINT_IS_AT_INFINITY + 118 + + ) + +1089 + #EC_F_EC_POINT_IS_ON_CURVE + 119 + + ) + +1090 + #EC_F_EC_POINT_MAKE_AFFINE + 120 + + ) + +1091 + #EC_F_EC_POINT_MUL + 184 + + ) + +1092 + #EC_F_EC_POINT_NEW + 121 + + ) + +1093 + #EC_F_EC_POINT_OCT2POINT + 122 + + ) + +1094 + #EC_F_EC_POINT_POINT2OCT + 123 + + ) + +1095 + #EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M + 185 + + ) + +1096 + #EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP + 124 + + ) + +1097 + #EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M + 186 + + ) + +1098 + #EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP + 125 + + ) + +1099 + #EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP + 126 + + ) + +1100 + #EC_F_EC_POINT_SET_TO_INFINITY + 127 + + ) + +1101 + #EC_F_EC_PRE_COMP_DUP + 207 + + ) + +1102 + #EC_F_EC_PRE_COMP_NEW + 196 + + ) + +1103 + #EC_F_EC_WNAF_MUL + 187 + + ) + +1104 + #EC_F_EC_WNAF_PRECOMPUTE_MULT + 188 + + ) + +1105 + #EC_F_I2D_ECPARAMETERS + 190 + + ) + +1106 + #EC_F_I2D_ECPKPARAMETERS + 191 + + ) + +1107 + #EC_F_I2D_ECPRIVATEKEY + 192 + + ) + +1108 + #EC_F_I2O_ECPUBLICKEY + 151 + + ) + +1109 + #EC_F_NISTP224_PRE_COMP_NEW + 227 + + ) + +1110 + #EC_F_NISTP256_PRE_COMP_NEW + 236 + + ) + +1111 + #EC_F_NISTP521_PRE_COMP_NEW + 237 + + ) + +1112 + #EC_F_O2I_ECPUBLICKEY + 152 + + ) + +1113 + #EC_F_OLD_EC_PRIV_DECODE + 222 + + ) + +1114 + #EC_F_PKEY_EC_CTRL + 197 + + ) + +1115 + #EC_F_PKEY_EC_CTRL_STR + 198 + + ) + +1116 + #EC_F_PKEY_EC_DERIVE + 217 + + ) + +1117 + #EC_F_PKEY_EC_KEYGEN + 199 + + ) + +1118 + #EC_F_PKEY_EC_PARAMGEN + 219 + + ) + +1119 + #EC_F_PKEY_EC_SIGN + 218 + + ) + +1122 + #EC_R_ASN1_ERROR + 115 + + ) + +1123 + #EC_R_ASN1_UNKNOWN_FIELD + 116 + + ) + +1124 + #EC_R_BIGNUM_OUT_OF_RANGE + 144 + + ) + +1125 + #EC_R_BUFFER_TOO_SMALL + 100 + + ) + +1126 + #EC_R_COORDINATES_OUT_OF_RANGE + 146 + + ) + +1127 + #EC_R_D2I_ECPKPARAMETERS_FAILURE + 117 + + ) + +1128 + #EC_R_DECODE_ERROR + 142 + + ) + +1129 + #EC_R_DISCRIMINANT_IS_ZERO + 118 + + ) + +1130 + #EC_R_EC_GROUP_NEW_BY_NAME_FAILURE + 119 + + ) + +1131 + #EC_R_FIELD_TOO_LARGE + 143 + + ) + +1132 + #EC_R_GF2M_NOT_SUPPORTED + 147 + + ) + +1133 + #EC_R_GROUP2PKPARAMETERS_FAILURE + 120 + + ) + +1134 + #EC_R_I2D_ECPKPARAMETERS_FAILURE + 121 + + ) + +1135 + #EC_R_INCOMPATIBLE_OBJECTS + 101 + + ) + +1136 + #EC_R_INVALID_ARGUMENT + 112 + + ) + +1137 + #EC_R_INVALID_COMPRESSED_POINT + 110 + + ) + +1138 + #EC_R_INVALID_COMPRESSION_BIT + 109 + + ) + +1139 + #EC_R_INVALID_CURVE + 141 + + ) + +1140 + #EC_R_INVALID_DIGEST_TYPE + 138 + + ) + +1141 + #EC_R_INVALID_ENCODING + 102 + + ) + +1142 + #EC_R_INVALID_FIELD + 103 + + ) + +1143 + #EC_R_INVALID_FORM + 104 + + ) + +1144 + #EC_R_INVALID_GROUP_ORDER + 122 + + ) + +1145 + #EC_R_INVALID_PENTANOMIAL_BASIS + 132 + + ) + +1146 + #EC_R_INVALID_PRIVATE_KEY + 123 + + ) + +1147 + #EC_R_INVALID_TRINOMIAL_BASIS + 137 + + ) + +1148 + #EC_R_KEYS_NOT_SET + 140 + + ) + +1149 + #EC_R_MISSING_PARAMETERS + 124 + + ) + +1150 + #EC_R_MISSING_PRIVATE_KEY + 125 + + ) + +1151 + #EC_R_NOT_A_NIST_PRIME + 135 + + ) + +1152 + #EC_R_NOT_A_SUPPORTED_NIST_PRIME + 136 + + ) + +1153 + #EC_R_NOT_IMPLEMENTED + 126 + + ) + +1154 + #EC_R_NOT_INITIALIZED + 111 + + ) + +1155 + #EC_R_NO_FIELD_MOD + 133 + + ) + +1156 + #EC_R_NO_PARAMETERS_SET + 139 + + ) + +1157 + #EC_R_PASSED_NULL_PARAMETER + 134 + + ) + +1158 + #EC_R_PKPARAMETERS2GROUP_FAILURE + 127 + + ) + +1159 + #EC_R_POINT_AT_INFINITY + 106 + + ) + +1160 + #EC_R_POINT_IS_NOT_ON_CURVE + 107 + + ) + +1161 + #EC_R_SLOT_FULL + 108 + + ) + +1162 + #EC_R_UNDEFINED_GENERATOR + 113 + + ) + +1163 + #EC_R_UNDEFINED_ORDER + 128 + + ) + +1164 + #EC_R_UNKNOWN_GROUP + 129 + + ) + +1165 + #EC_R_UNKNOWN_ORDER + 114 + + ) + +1166 + #EC_R_UNSUPPORTED_FIELD + 131 + + ) + +1167 + #EC_R_WRONG_CURVE_PARAMETERS + 145 + + ) + +1168 + #EC_R_WRONG_ORDER + 130 + + ) + +1170 #ifde� +__�lu�lus + + + @/usr/include/openssl/obj_mac.h + +65 + #SN_undef + "UNDEF" + + ) + +66 + #LN_undef + "undef�ed" + + ) + +67 + #NID_undef + 0 + + ) + +68 + #OBJ_undef + 0L + + ) + +70 + #SN_�u_t + "ITU-T" + + ) + +71 + #LN_�u_t + "�u-t" + + ) + +72 + #NID_�u_t + 645 + + ) + +73 + #OBJ_�u_t + 0L + + ) + +75 + #NID_cc�t + 404 + + ) + +76 + #OBJ_cc�t + +OBJ_�u_t + + + ) + +78 + #SN_iso + "ISO" + + ) + +79 + #LN_iso + "iso" + + ) + +80 + #NID_iso + 181 + + ) + +81 + #OBJ_iso + 1L + + ) + +83 + #SN_jo�t_iso_�u_t + "JOINT-ISO-ITU-T" + + ) + +84 + #LN_jo�t_iso_�u_t + "jo�t-iso-�u-t" + + ) + +85 + #NID_jo�t_iso_�u_t + 646 + + ) + +86 + #OBJ_jo�t_iso_�u_t + 2L + + ) + +88 + #NID_jo�t_iso_cc�t + 393 + + ) + +89 + #OBJ_jo�t_iso_cc�t + +OBJ_jo�t_iso_�u_t + + + ) + +91 + #SN_memb�_body + "memb�-body" + + ) + +92 + #LN_memb�_body + "ISO Memb� Body" + + ) + +93 + #NID_memb�_body + 182 + + ) + +94 + #OBJ_memb�_body + +OBJ_iso +,2L + + ) + +96 + #SN_id�tif�d_�g�iz�i� + "id�tif�d-�g�iz�i�" + + ) + +97 + #NID_id�tif�d_�g�iz�i� + 676 + + ) + +98 + #OBJ_id�tif�d_�g�iz�i� + +OBJ_iso +,3L + + ) + +100 + #SN_hmac_md5 + "HMAC-MD5" + + ) + +101 + #LN_hmac_md5 + "hmac-md5" + + ) + +102 + #NID_hmac_md5 + 780 + + ) + +103 + #OBJ_hmac_md5 + +OBJ_id�tif�d_�g�iz�i� +,6L,1L,5L,5L,8L,1L,1L + + ) + +105 + #SN_hmac_sha1 + "HMAC-SHA1" + + ) + +106 + #LN_hmac_sha1 + "hmac-sha1" + + ) + +107 + #NID_hmac_sha1 + 781 + + ) + +108 + #OBJ_hmac_sha1 + +OBJ_id�tif�d_�g�iz�i� +,6L,1L,5L,5L,8L,1L,2L + + ) + +110 + #SN_��icom_�c + "��icom-�c" + + ) + +111 + #NID_��icom_�c + 677 + + ) + +112 + #OBJ_��icom_�c + +OBJ_id�tif�d_�g�iz�i� +,132L + + ) + +114 + #SN_����iڮ_�g�iz�i�s + "����iڮ-�g�iz�i�s" + + ) + +115 + #LN_����iڮ_�g�iz�i�s + "I���tiڮ Org�iz�i�s" + + ) + +116 + #NID_����iڮ_�g�iz�i�s + 647 + + ) + +117 + #OBJ_����iڮ_�g�iz�i�s + +OBJ_jo�t_iso_�u_t +,23L + + ) + +119 + #SN_w� + "w�" + + ) + +120 + #NID_w� + 678 + + ) + +121 + #OBJ_w� + +OBJ_����iڮ_�g�iz�i�s +,43L + + ) + +123 + #SN_w�_wsg + "w�-wsg" + + ) + +124 + #NID_w�_wsg + 679 + + ) + +125 + #OBJ_w�_wsg + +OBJ_w� +,1L + + ) + +127 + #SN_���ed_��ibu�_ty�s + "���ed-��ibu�-ty�s" + + ) + +128 + #LN_���ed_��ibu�_ty�s + "S�e�ed A�ribu� Ty�s" + + ) + +129 + #NID_���ed_��ibu�_ty�s + 394 + + ) + +130 + #OBJ_���ed_��ibu�_ty�s + +OBJ_jo�t_iso_�u_t +,5L,1L,5L + + ) + +132 + #SN_���n� + "���n�" + + ) + +133 + #NID_���n� + 395 + + ) + +134 + #OBJ_���n� + +OBJ_���ed_��ibu�_ty�s +,55L + + ) + +136 + #SN_ISO_US + "ISO-US" + + ) + +137 + #LN_ISO_US + "ISO US Memb� Body" + + ) + +138 + #NID_ISO_US + 183 + + ) + +139 + #OBJ_ISO_US + +OBJ_memb�_body +,840L + + ) + +141 + #SN_X9_57 + "X9-57" + + ) + +142 + #LN_X9_57 + "X9.57" + + ) + +143 + #NID_X9_57 + 184 + + ) + +144 + #OBJ_X9_57 + +OBJ_ISO_US +,10040L + + ) + +146 + #SN_X9cm + "X9cm" + + ) + +147 + #LN_X9cm + "X9.57 CM ?" + + ) + +148 + #NID_X9cm + 185 + + ) + +149 + #OBJ_X9cm + +OBJ_X9_57 +,4L + + ) + +151 + #SN_d� + "DSA" + + ) + +152 + #LN_d� + "d�En�y�i�" + + ) + +153 + #NID_d� + 116 + + ) + +154 + #OBJ_d� + +OBJ_X9cm +,1L + + ) + +156 + #SN_d�W�hSHA1 + "DSA-SHA1" + + ) + +157 + #LN_d�W�hSHA1 + "d�W�hSHA1" + + ) + +158 + #NID_d�W�hSHA1 + 113 + + ) + +159 + #OBJ_d�W�hSHA1 + +OBJ_X9cm +,3L + + ) + +161 + #SN_�si_X9_62 + "�si-X9-62" + + ) + +162 + #LN_�si_X9_62 + "ANSI X9.62" + + ) + +163 + #NID_�si_X9_62 + 405 + + ) + +164 + #OBJ_�si_X9_62 + +OBJ_ISO_US +,10045L + + ) + +166 + #OBJ_X9_62_id_f�ldTy� + +OBJ_�si_X9_62 +,1L + + ) + +168 + #SN_X9_62_�ime_f�ld + "�ime-f�ld" + + ) + +169 + #NID_X9_62_�ime_f�ld + 406 + + ) + +170 + #OBJ_X9_62_�ime_f�ld + +OBJ_X9_62_id_f�ldTy� +,1L + + ) + +172 + #SN_X9_62_ch�a��i�ic_two_f�ld + "ch�a��i�ic-two-f�ld" + + ) + +173 + #NID_X9_62_ch�a��i�ic_two_f�ld + 407 + + ) + +174 + #OBJ_X9_62_ch�a��i�ic_two_f�ld + +OBJ_X9_62_id_f�ldTy� +,2L + + ) + +176 + #SN_X9_62_id_ch�a��i�ic_two_basis + "id-ch�a��i�ic-two-basis" + + ) + +177 + #NID_X9_62_id_ch�a��i�ic_two_basis + 680 + + ) + +178 + #OBJ_X9_62_id_ch�a��i�ic_two_basis + +OBJ_X9_62_ch�a��i�ic_two_f�ld +,3L + + ) + +180 + #SN_X9_62_�Basis + "�Basis" + + ) + +181 + #NID_X9_62_�Basis + 681 + + ) + +182 + #OBJ_X9_62_�Basis + +OBJ_X9_62_id_ch�a��i�ic_two_basis +,1L + + ) + +184 + #SN_X9_62_�Basis + "�Basis" + + ) + +185 + #NID_X9_62_�Basis + 682 + + ) + +186 + #OBJ_X9_62_�Basis + +OBJ_X9_62_id_ch�a��i�ic_two_basis +,2L + + ) + +188 + #SN_X9_62_�Basis + "�Basis" + + ) + +189 + #NID_X9_62_�Basis + 683 + + ) + +190 + #OBJ_X9_62_�Basis + +OBJ_X9_62_id_ch�a��i�ic_two_basis +,3L + + ) + +192 + #OBJ_X9_62_id_publicKeyTy� + +OBJ_�si_X9_62 +,2L + + ) + +194 + #SN_X9_62_id_ecPublicKey + "id-ecPublicKey" + + ) + +195 + #NID_X9_62_id_ecPublicKey + 408 + + ) + +196 + #OBJ_X9_62_id_ecPublicKey + +OBJ_X9_62_id_publicKeyTy� +,1L + + ) + +198 + #OBJ_X9_62_�l�ticCurve + +OBJ_�si_X9_62 +,3L + + ) + +200 + #OBJ_X9_62_c_TwoCurve + +OBJ_X9_62_�l�ticCurve +,0L + + ) + +202 + #SN_X9_62_c2�b163v1 + "c2�b163v1" + + ) + +203 + #NID_X9_62_c2�b163v1 + 684 + + ) + +204 + #OBJ_X9_62_c2�b163v1 + +OBJ_X9_62_c_TwoCurve +,1L + + ) + +206 + #SN_X9_62_c2�b163v2 + "c2�b163v2" + + ) + +207 + #NID_X9_62_c2�b163v2 + 685 + + ) + +208 + #OBJ_X9_62_c2�b163v2 + +OBJ_X9_62_c_TwoCurve +,2L + + ) + +210 + #SN_X9_62_c2�b163v3 + "c2�b163v3" + + ) + +211 + #NID_X9_62_c2�b163v3 + 686 + + ) + +212 + #OBJ_X9_62_c2�b163v3 + +OBJ_X9_62_c_TwoCurve +,3L + + ) + +214 + #SN_X9_62_c2�b176v1 + "c2�b176v1" + + ) + +215 + #NID_X9_62_c2�b176v1 + 687 + + ) + +216 + #OBJ_X9_62_c2�b176v1 + +OBJ_X9_62_c_TwoCurve +,4L + + ) + +218 + #SN_X9_62_c2�b191v1 + "c2�b191v1" + + ) + +219 + #NID_X9_62_c2�b191v1 + 688 + + ) + +220 + #OBJ_X9_62_c2�b191v1 + +OBJ_X9_62_c_TwoCurve +,5L + + ) + +222 + #SN_X9_62_c2�b191v2 + "c2�b191v2" + + ) + +223 + #NID_X9_62_c2�b191v2 + 689 + + ) + +224 + #OBJ_X9_62_c2�b191v2 + +OBJ_X9_62_c_TwoCurve +,6L + + ) + +226 + #SN_X9_62_c2�b191v3 + "c2�b191v3" + + ) + +227 + #NID_X9_62_c2�b191v3 + 690 + + ) + +228 + #OBJ_X9_62_c2�b191v3 + +OBJ_X9_62_c_TwoCurve +,7L + + ) + +230 + #SN_X9_62_c2�b191v4 + "c2�b191v4" + + ) + +231 + #NID_X9_62_c2�b191v4 + 691 + + ) + +232 + #OBJ_X9_62_c2�b191v4 + +OBJ_X9_62_c_TwoCurve +,8L + + ) + +234 + #SN_X9_62_c2�b191v5 + "c2�b191v5" + + ) + +235 + #NID_X9_62_c2�b191v5 + 692 + + ) + +236 + #OBJ_X9_62_c2�b191v5 + +OBJ_X9_62_c_TwoCurve +,9L + + ) + +238 + #SN_X9_62_c2�b208w1 + "c2�b208w1" + + ) + +239 + #NID_X9_62_c2�b208w1 + 693 + + ) + +240 + #OBJ_X9_62_c2�b208w1 + +OBJ_X9_62_c_TwoCurve +,10L + + ) + +242 + #SN_X9_62_c2�b239v1 + "c2�b239v1" + + ) + +243 + #NID_X9_62_c2�b239v1 + 694 + + ) + +244 + #OBJ_X9_62_c2�b239v1 + +OBJ_X9_62_c_TwoCurve +,11L + + ) + +246 + #SN_X9_62_c2�b239v2 + "c2�b239v2" + + ) + +247 + #NID_X9_62_c2�b239v2 + 695 + + ) + +248 + #OBJ_X9_62_c2�b239v2 + +OBJ_X9_62_c_TwoCurve +,12L + + ) + +250 + #SN_X9_62_c2�b239v3 + "c2�b239v3" + + ) + +251 + #NID_X9_62_c2�b239v3 + 696 + + ) + +252 + #OBJ_X9_62_c2�b239v3 + +OBJ_X9_62_c_TwoCurve +,13L + + ) + +254 + #SN_X9_62_c2�b239v4 + "c2�b239v4" + + ) + +255 + #NID_X9_62_c2�b239v4 + 697 + + ) + +256 + #OBJ_X9_62_c2�b239v4 + +OBJ_X9_62_c_TwoCurve +,14L + + ) + +258 + #SN_X9_62_c2�b239v5 + "c2�b239v5" + + ) + +259 + #NID_X9_62_c2�b239v5 + 698 + + ) + +260 + #OBJ_X9_62_c2�b239v5 + +OBJ_X9_62_c_TwoCurve +,15L + + ) + +262 + #SN_X9_62_c2�b272w1 + "c2�b272w1" + + ) + +263 + #NID_X9_62_c2�b272w1 + 699 + + ) + +264 + #OBJ_X9_62_c2�b272w1 + +OBJ_X9_62_c_TwoCurve +,16L + + ) + +266 + #SN_X9_62_c2�b304w1 + "c2�b304w1" + + ) + +267 + #NID_X9_62_c2�b304w1 + 700 + + ) + +268 + #OBJ_X9_62_c2�b304w1 + +OBJ_X9_62_c_TwoCurve +,17L + + ) + +270 + #SN_X9_62_c2�b359v1 + "c2�b359v1" + + ) + +271 + #NID_X9_62_c2�b359v1 + 701 + + ) + +272 + #OBJ_X9_62_c2�b359v1 + +OBJ_X9_62_c_TwoCurve +,18L + + ) + +274 + #SN_X9_62_c2�b368w1 + "c2�b368w1" + + ) + +275 + #NID_X9_62_c2�b368w1 + 702 + + ) + +276 + #OBJ_X9_62_c2�b368w1 + +OBJ_X9_62_c_TwoCurve +,19L + + ) + +278 + #SN_X9_62_c2�b431r1 + "c2�b431r1" + + ) + +279 + #NID_X9_62_c2�b431r1 + 703 + + ) + +280 + #OBJ_X9_62_c2�b431r1 + +OBJ_X9_62_c_TwoCurve +,20L + + ) + +282 + #OBJ_X9_62_�imeCurve + +OBJ_X9_62_�l�ticCurve +,1L + + ) + +284 + #SN_X9_62_�ime192v1 + "�ime192v1" + + ) + +285 + #NID_X9_62_�ime192v1 + 409 + + ) + +286 + #OBJ_X9_62_�ime192v1 + +OBJ_X9_62_�imeCurve +,1L + + ) + +288 + #SN_X9_62_�ime192v2 + "�ime192v2" + + ) + +289 + #NID_X9_62_�ime192v2 + 410 + + ) + +290 + #OBJ_X9_62_�ime192v2 + +OBJ_X9_62_�imeCurve +,2L + + ) + +292 + #SN_X9_62_�ime192v3 + "�ime192v3" + + ) + +293 + #NID_X9_62_�ime192v3 + 411 + + ) + +294 + #OBJ_X9_62_�ime192v3 + +OBJ_X9_62_�imeCurve +,3L + + ) + +296 + #SN_X9_62_�ime239v1 + "�ime239v1" + + ) + +297 + #NID_X9_62_�ime239v1 + 412 + + ) + +298 + #OBJ_X9_62_�ime239v1 + +OBJ_X9_62_�imeCurve +,4L + + ) + +300 + #SN_X9_62_�ime239v2 + "�ime239v2" + + ) + +301 + #NID_X9_62_�ime239v2 + 413 + + ) + +302 + #OBJ_X9_62_�ime239v2 + +OBJ_X9_62_�imeCurve +,5L + + ) + +304 + #SN_X9_62_�ime239v3 + "�ime239v3" + + ) + +305 + #NID_X9_62_�ime239v3 + 414 + + ) + +306 + #OBJ_X9_62_�ime239v3 + +OBJ_X9_62_�imeCurve +,6L + + ) + +308 + #SN_X9_62_�ime256v1 + "�ime256v1" + + ) + +309 + #NID_X9_62_�ime256v1 + 415 + + ) + +310 + #OBJ_X9_62_�ime256v1 + +OBJ_X9_62_�imeCurve +,7L + + ) + +312 + #OBJ_X9_62_id_ecSigTy� + +OBJ_�si_X9_62 +,4L + + ) + +314 + #SN_ecd�_w�h_SHA1 + "ecd�-w�h-SHA1" + + ) + +315 + #NID_ecd�_w�h_SHA1 + 416 + + ) + +316 + #OBJ_ecd�_w�h_SHA1 + +OBJ_X9_62_id_ecSigTy� +,1L + + ) + +318 + #SN_ecd�_w�h_Recomm�ded + "ecd�-w�h-Recomm�ded" + + ) + +319 + #NID_ecd�_w�h_Recomm�ded + 791 + + ) + +320 + #OBJ_ecd�_w�h_Recomm�ded + +OBJ_X9_62_id_ecSigTy� +,2L + + ) + +322 + #SN_ecd�_w�h_S�cif�d + "ecd�-w�h-S�cif�d" + + ) + +323 + #NID_ecd�_w�h_S�cif�d + 792 + + ) + +324 + #OBJ_ecd�_w�h_S�cif�d + +OBJ_X9_62_id_ecSigTy� +,3L + + ) + +326 + #SN_ecd�_w�h_SHA224 + "ecd�-w�h-SHA224" + + ) + +327 + #NID_ecd�_w�h_SHA224 + 793 + + ) + +328 + #OBJ_ecd�_w�h_SHA224 + +OBJ_ecd�_w�h_S�cif�d +,1L + + ) + +330 + #SN_ecd�_w�h_SHA256 + "ecd�-w�h-SHA256" + + ) + +331 + #NID_ecd�_w�h_SHA256 + 794 + + ) + +332 + #OBJ_ecd�_w�h_SHA256 + +OBJ_ecd�_w�h_S�cif�d +,2L + + ) + +334 + #SN_ecd�_w�h_SHA384 + "ecd�-w�h-SHA384" + + ) + +335 + #NID_ecd�_w�h_SHA384 + 795 + + ) + +336 + #OBJ_ecd�_w�h_SHA384 + +OBJ_ecd�_w�h_S�cif�d +,3L + + ) + +338 + #SN_ecd�_w�h_SHA512 + "ecd�-w�h-SHA512" + + ) + +339 + #NID_ecd�_w�h_SHA512 + 796 + + ) + +340 + #OBJ_ecd�_w�h_SHA512 + +OBJ_ecd�_w�h_S�cif�d +,4L + + ) + +342 + #OBJ_�cg_�l�ticCurve + +OBJ_��icom_�c +,0L + + ) + +344 + #SN_��112r1 + "��112r1" + + ) + +345 + #NID_��112r1 + 704 + + ) + +346 + #OBJ_��112r1 + +OBJ_�cg_�l�ticCurve +,6L + + ) + +348 + #SN_��112r2 + "��112r2" + + ) + +349 + #NID_��112r2 + 705 + + ) + +350 + #OBJ_��112r2 + +OBJ_�cg_�l�ticCurve +,7L + + ) + +352 + #SN_��128r1 + "��128r1" + + ) + +353 + #NID_��128r1 + 706 + + ) + +354 + #OBJ_��128r1 + +OBJ_�cg_�l�ticCurve +,28L + + ) + +356 + #SN_��128r2 + "��128r2" + + ) + +357 + #NID_��128r2 + 707 + + ) + +358 + #OBJ_��128r2 + +OBJ_�cg_�l�ticCurve +,29L + + ) + +360 + #SN_��160k1 + "��160k1" + + ) + +361 + #NID_��160k1 + 708 + + ) + +362 + #OBJ_��160k1 + +OBJ_�cg_�l�ticCurve +,9L + + ) + +364 + #SN_��160r1 + "��160r1" + + ) + +365 + #NID_��160r1 + 709 + + ) + +366 + #OBJ_��160r1 + +OBJ_�cg_�l�ticCurve +,8L + + ) + +368 + #SN_��160r2 + "��160r2" + + ) + +369 + #NID_��160r2 + 710 + + ) + +370 + #OBJ_��160r2 + +OBJ_�cg_�l�ticCurve +,30L + + ) + +372 + #SN_��192k1 + "��192k1" + + ) + +373 + #NID_��192k1 + 711 + + ) + +374 + #OBJ_��192k1 + +OBJ_�cg_�l�ticCurve +,31L + + ) + +376 + #SN_��224k1 + "��224k1" + + ) + +377 + #NID_��224k1 + 712 + + ) + +378 + #OBJ_��224k1 + +OBJ_�cg_�l�ticCurve +,32L + + ) + +380 + #SN_��224r1 + "��224r1" + + ) + +381 + #NID_��224r1 + 713 + + ) + +382 + #OBJ_��224r1 + +OBJ_�cg_�l�ticCurve +,33L + + ) + +384 + #SN_��256k1 + "��256k1" + + ) + +385 + #NID_��256k1 + 714 + + ) + +386 + #OBJ_��256k1 + +OBJ_�cg_�l�ticCurve +,10L + + ) + +388 + #SN_��384r1 + "��384r1" + + ) + +389 + #NID_��384r1 + 715 + + ) + +390 + #OBJ_��384r1 + +OBJ_�cg_�l�ticCurve +,34L + + ) + +392 + #SN_��521r1 + "��521r1" + + ) + +393 + #NID_��521r1 + 716 + + ) + +394 + #OBJ_��521r1 + +OBJ_�cg_�l�ticCurve +,35L + + ) + +396 + #SN_��113r1 + "��113r1" + + ) + +397 + #NID_��113r1 + 717 + + ) + +398 + #OBJ_��113r1 + +OBJ_�cg_�l�ticCurve +,4L + + ) + +400 + #SN_��113r2 + "��113r2" + + ) + +401 + #NID_��113r2 + 718 + + ) + +402 + #OBJ_��113r2 + +OBJ_�cg_�l�ticCurve +,5L + + ) + +404 + #SN_��131r1 + "��131r1" + + ) + +405 + #NID_��131r1 + 719 + + ) + +406 + #OBJ_��131r1 + +OBJ_�cg_�l�ticCurve +,22L + + ) + +408 + #SN_��131r2 + "��131r2" + + ) + +409 + #NID_��131r2 + 720 + + ) + +410 + #OBJ_��131r2 + +OBJ_�cg_�l�ticCurve +,23L + + ) + +412 + #SN_��163k1 + "��163k1" + + ) + +413 + #NID_��163k1 + 721 + + ) + +414 + #OBJ_��163k1 + +OBJ_�cg_�l�ticCurve +,1L + + ) + +416 + #SN_��163r1 + "��163r1" + + ) + +417 + #NID_��163r1 + 722 + + ) + +418 + #OBJ_��163r1 + +OBJ_�cg_�l�ticCurve +,2L + + ) + +420 + #SN_��163r2 + "��163r2" + + ) + +421 + #NID_��163r2 + 723 + + ) + +422 + #OBJ_��163r2 + +OBJ_�cg_�l�ticCurve +,15L + + ) + +424 + #SN_��193r1 + "��193r1" + + ) + +425 + #NID_��193r1 + 724 + + ) + +426 + #OBJ_��193r1 + +OBJ_�cg_�l�ticCurve +,24L + + ) + +428 + #SN_��193r2 + "��193r2" + + ) + +429 + #NID_��193r2 + 725 + + ) + +430 + #OBJ_��193r2 + +OBJ_�cg_�l�ticCurve +,25L + + ) + +432 + #SN_��233k1 + "��233k1" + + ) + +433 + #NID_��233k1 + 726 + + ) + +434 + #OBJ_��233k1 + +OBJ_�cg_�l�ticCurve +,26L + + ) + +436 + #SN_��233r1 + "��233r1" + + ) + +437 + #NID_��233r1 + 727 + + ) + +438 + #OBJ_��233r1 + +OBJ_�cg_�l�ticCurve +,27L + + ) + +440 + #SN_��239k1 + "��239k1" + + ) + +441 + #NID_��239k1 + 728 + + ) + +442 + #OBJ_��239k1 + +OBJ_�cg_�l�ticCurve +,3L + + ) + +444 + #SN_��283k1 + "��283k1" + + ) + +445 + #NID_��283k1 + 729 + + ) + +446 + #OBJ_��283k1 + +OBJ_�cg_�l�ticCurve +,16L + + ) + +448 + #SN_��283r1 + "��283r1" + + ) + +449 + #NID_��283r1 + 730 + + ) + +450 + #OBJ_��283r1 + +OBJ_�cg_�l�ticCurve +,17L + + ) + +452 + #SN_��409k1 + "��409k1" + + ) + +453 + #NID_��409k1 + 731 + + ) + +454 + #OBJ_��409k1 + +OBJ_�cg_�l�ticCurve +,36L + + ) + +456 + #SN_��409r1 + "��409r1" + + ) + +457 + #NID_��409r1 + 732 + + ) + +458 + #OBJ_��409r1 + +OBJ_�cg_�l�ticCurve +,37L + + ) + +460 + #SN_��571k1 + "��571k1" + + ) + +461 + #NID_��571k1 + 733 + + ) + +462 + #OBJ_��571k1 + +OBJ_�cg_�l�ticCurve +,38L + + ) + +464 + #SN_��571r1 + "��571r1" + + ) + +465 + #NID_��571r1 + 734 + + ) + +466 + #OBJ_��571r1 + +OBJ_�cg_�l�ticCurve +,39L + + ) + +468 + #OBJ_w�_wsg_idm_ecid + +OBJ_w�_wsg +,4L + + ) + +470 + #SN_w�_wsg_idm_ecid_w�s1 + "w�-wsg-idm-ecid-w�s1" + + ) + +471 + #NID_w�_wsg_idm_ecid_w�s1 + 735 + + ) + +472 + #OBJ_w�_wsg_idm_ecid_w�s1 + +OBJ_w�_wsg_idm_ecid +,1L + + ) + +474 + #SN_w�_wsg_idm_ecid_w�s3 + "w�-wsg-idm-ecid-w�s3" + + ) + +475 + #NID_w�_wsg_idm_ecid_w�s3 + 736 + + ) + +476 + #OBJ_w�_wsg_idm_ecid_w�s3 + +OBJ_w�_wsg_idm_ecid +,3L + + ) + +478 + #SN_w�_wsg_idm_ecid_w�s4 + "w�-wsg-idm-ecid-w�s4" + + ) + +479 + #NID_w�_wsg_idm_ecid_w�s4 + 737 + + ) + +480 + #OBJ_w�_wsg_idm_ecid_w�s4 + +OBJ_w�_wsg_idm_ecid +,4L + + ) + +482 + #SN_w�_wsg_idm_ecid_w�s5 + "w�-wsg-idm-ecid-w�s5" + + ) + +483 + #NID_w�_wsg_idm_ecid_w�s5 + 738 + + ) + +484 + #OBJ_w�_wsg_idm_ecid_w�s5 + +OBJ_w�_wsg_idm_ecid +,5L + + ) + +486 + #SN_w�_wsg_idm_ecid_w�s6 + "w�-wsg-idm-ecid-w�s6" + + ) + +487 + #NID_w�_wsg_idm_ecid_w�s6 + 739 + + ) + +488 + #OBJ_w�_wsg_idm_ecid_w�s6 + +OBJ_w�_wsg_idm_ecid +,6L + + ) + +490 + #SN_w�_wsg_idm_ecid_w�s7 + "w�-wsg-idm-ecid-w�s7" + + ) + +491 + #NID_w�_wsg_idm_ecid_w�s7 + 740 + + ) + +492 + #OBJ_w�_wsg_idm_ecid_w�s7 + +OBJ_w�_wsg_idm_ecid +,7L + + ) + +494 + #SN_w�_wsg_idm_ecid_w�s8 + "w�-wsg-idm-ecid-w�s8" + + ) + +495 + #NID_w�_wsg_idm_ecid_w�s8 + 741 + + ) + +496 + #OBJ_w�_wsg_idm_ecid_w�s8 + +OBJ_w�_wsg_idm_ecid +,8L + + ) + +498 + #SN_w�_wsg_idm_ecid_w�s9 + "w�-wsg-idm-ecid-w�s9" + + ) + +499 + #NID_w�_wsg_idm_ecid_w�s9 + 742 + + ) + +500 + #OBJ_w�_wsg_idm_ecid_w�s9 + +OBJ_w�_wsg_idm_ecid +,9L + + ) + +502 + #SN_w�_wsg_idm_ecid_w�s10 + "w�-wsg-idm-ecid-w�s10" + + ) + +503 + #NID_w�_wsg_idm_ecid_w�s10 + 743 + + ) + +504 + #OBJ_w�_wsg_idm_ecid_w�s10 + +OBJ_w�_wsg_idm_ecid +,10L + + ) + +506 + #SN_w�_wsg_idm_ecid_w�s11 + "w�-wsg-idm-ecid-w�s11" + + ) + +507 + #NID_w�_wsg_idm_ecid_w�s11 + 744 + + ) + +508 + #OBJ_w�_wsg_idm_ecid_w�s11 + +OBJ_w�_wsg_idm_ecid +,11L + + ) + +510 + #SN_w�_wsg_idm_ecid_w�s12 + "w�-wsg-idm-ecid-w�s12" + + ) + +511 + #NID_w�_wsg_idm_ecid_w�s12 + 745 + + ) + +512 + #OBJ_w�_wsg_idm_ecid_w�s12 + +OBJ_w�_wsg_idm_ecid +,12L + + ) + +514 + #SN_��5_cbc + "CAST5-CBC" + + ) + +515 + #LN_��5_cbc + "��5-cbc" + + ) + +516 + #NID_��5_cbc + 108 + + ) + +517 + #OBJ_��5_cbc + +OBJ_ISO_US +,113533L,7L,66L,10L + + ) + +519 + #SN_��5_ecb + "CAST5-ECB" + + ) + +520 + #LN_��5_ecb + "��5-ecb" + + ) + +521 + #NID_��5_ecb + 109 + + ) + +523 + #SN_��5_cfb64 + "CAST5-CFB" + + ) + +524 + #LN_��5_cfb64 + "��5-cfb" + + ) + +525 + #NID_��5_cfb64 + 110 + + ) + +527 + #SN_��5_ofb64 + "CAST5-OFB" + + ) + +528 + #LN_��5_ofb64 + "��5-ofb" + + ) + +529 + #NID_��5_ofb64 + 111 + + ) + +531 + #LN_pbeW�hMD5AndCa�5_CBC + "pbeW�hMD5AndCa�5CBC" + + ) + +532 + #NID_pbeW�hMD5AndCa�5_CBC + 112 + + ) + +533 + #OBJ_pbeW�hMD5AndCa�5_CBC + +OBJ_ISO_US +,113533L,7L,66L,12L + + ) + +535 + #SN_id_Passw�dBa�dMAC + "id-Passw�dBa�dMAC" + + ) + +536 + #LN_id_Passw�dBa�dMAC + "�ssw�d ba�d MAC" + + ) + +537 + #NID_id_Passw�dBa�dMAC + 782 + + ) + +538 + #OBJ_id_Passw�dBa�dMAC + +OBJ_ISO_US +,113533L,7L,66L,13L + + ) + +540 + #SN_id_DHBa�dMac + "id-DHBa�dMac" + + ) + +541 + #LN_id_DHBa�dMac + "Diff�-H�lm� ba�d MAC" + + ) + +542 + #NID_id_DHBa�dMac + 783 + + ) + +543 + #OBJ_id_DHBa�dMac + +OBJ_ISO_US +,113533L,7L,66L,30L + + ) + +545 + #SN_r�dsi + "r�dsi" + + ) + +546 + #LN_r�dsi + "RSA D��Secur�y, Inc." + + ) + +547 + #NID_r�dsi + 1 + + ) + +548 + #OBJ_r�dsi + +OBJ_ISO_US +,113549L + + ) + +550 + #SN_pkcs + "pkcs" + + ) + +551 + #LN_pkcs + "RSA D��Secur�y, Inc. PKCS" + + ) + +552 + #NID_pkcs + 2 + + ) + +553 + #OBJ_pkcs + +OBJ_r�dsi +,1L + + ) + +555 + #SN_pkcs1 + "pkcs1" + + ) + +556 + #NID_pkcs1 + 186 + + ) + +557 + #OBJ_pkcs1 + +OBJ_pkcs +,1L + + ) + +559 + #LN_r�En�y�i� + "r�En�y�i�" + + ) + +560 + #NID_r�En�y�i� + 6 + + ) + +561 + #OBJ_r�En�y�i� + +OBJ_pkcs1 +,1L + + ) + +563 + #SN_md2W�hRSAEn�y�i� + "RSA-MD2" + + ) + +564 + #LN_md2W�hRSAEn�y�i� + "md2W�hRSAEn�y�i�" + + ) + +565 + #NID_md2W�hRSAEn�y�i� + 7 + + ) + +566 + #OBJ_md2W�hRSAEn�y�i� + +OBJ_pkcs1 +,2L + + ) + +568 + #SN_md4W�hRSAEn�y�i� + "RSA-MD4" + + ) + +569 + #LN_md4W�hRSAEn�y�i� + "md4W�hRSAEn�y�i�" + + ) + +570 + #NID_md4W�hRSAEn�y�i� + 396 + + ) + +571 + #OBJ_md4W�hRSAEn�y�i� + +OBJ_pkcs1 +,3L + + ) + +573 + #SN_md5W�hRSAEn�y�i� + "RSA-MD5" + + ) + +574 + #LN_md5W�hRSAEn�y�i� + "md5W�hRSAEn�y�i�" + + ) + +575 + #NID_md5W�hRSAEn�y�i� + 8 + + ) + +576 + #OBJ_md5W�hRSAEn�y�i� + +OBJ_pkcs1 +,4L + + ) + +578 + #SN_sha1W�hRSAEn�y�i� + "RSA-SHA1" + + ) + +579 + #LN_sha1W�hRSAEn�y�i� + "sha1W�hRSAEn�y�i�" + + ) + +580 + #NID_sha1W�hRSAEn�y�i� + 65 + + ) + +581 + #OBJ_sha1W�hRSAEn�y�i� + +OBJ_pkcs1 +,5L + + ) + +583 + #SN_r�esO�p + "RSAES-OAEP" + + ) + +584 + #LN_r�esO�p + "r�esO�p" + + ) + +585 + #NID_r�esO�p + 919 + + ) + +586 + #OBJ_r�esO�p + +OBJ_pkcs1 +,7L + + ) + +588 + #SN_mgf1 + "MGF1" + + ) + +589 + #LN_mgf1 + "mgf1" + + ) + +590 + #NID_mgf1 + 911 + + ) + +591 + #OBJ_mgf1 + +OBJ_pkcs1 +,8L + + ) + +593 + #SN_r�s�Pss + "RSASSA-PSS" + + ) + +594 + #LN_r�s�Pss + "r�s�Pss" + + ) + +595 + #NID_r�s�Pss + 912 + + ) + +596 + #OBJ_r�s�Pss + +OBJ_pkcs1 +,10L + + ) + +598 + #SN_sha256W�hRSAEn�y�i� + "RSA-SHA256" + + ) + +599 + #LN_sha256W�hRSAEn�y�i� + "sha256W�hRSAEn�y�i�" + + ) + +600 + #NID_sha256W�hRSAEn�y�i� + 668 + + ) + +601 + #OBJ_sha256W�hRSAEn�y�i� + +OBJ_pkcs1 +,11L + + ) + +603 + #SN_sha384W�hRSAEn�y�i� + "RSA-SHA384" + + ) + +604 + #LN_sha384W�hRSAEn�y�i� + "sha384W�hRSAEn�y�i�" + + ) + +605 + #NID_sha384W�hRSAEn�y�i� + 669 + + ) + +606 + #OBJ_sha384W�hRSAEn�y�i� + +OBJ_pkcs1 +,12L + + ) + +608 + #SN_sha512W�hRSAEn�y�i� + "RSA-SHA512" + + ) + +609 + #LN_sha512W�hRSAEn�y�i� + "sha512W�hRSAEn�y�i�" + + ) + +610 + #NID_sha512W�hRSAEn�y�i� + 670 + + ) + +611 + #OBJ_sha512W�hRSAEn�y�i� + +OBJ_pkcs1 +,13L + + ) + +613 + #SN_sha224W�hRSAEn�y�i� + "RSA-SHA224" + + ) + +614 + #LN_sha224W�hRSAEn�y�i� + "sha224W�hRSAEn�y�i�" + + ) + +615 + #NID_sha224W�hRSAEn�y�i� + 671 + + ) + +616 + #OBJ_sha224W�hRSAEn�y�i� + +OBJ_pkcs1 +,14L + + ) + +618 + #SN_pkcs3 + "pkcs3" + + ) + +619 + #NID_pkcs3 + 27 + + ) + +620 + #OBJ_pkcs3 + +OBJ_pkcs +,3L + + ) + +622 + #LN_dhKeyAg�em�t + "dhKeyAg�em�t" + + ) + +623 + #NID_dhKeyAg�em�t + 28 + + ) + +624 + #OBJ_dhKeyAg�em�t + +OBJ_pkcs3 +,1L + + ) + +626 + #SN_pkcs5 + "pkcs5" + + ) + +627 + #NID_pkcs5 + 187 + + ) + +628 + #OBJ_pkcs5 + +OBJ_pkcs +,5L + + ) + +630 + #SN_pbeW�hMD2AndDES_CBC + "PBE-MD2-DES" + + ) + +631 + #LN_pbeW�hMD2AndDES_CBC + "pbeW�hMD2AndDES-CBC" + + ) + +632 + #NID_pbeW�hMD2AndDES_CBC + 9 + + ) + +633 + #OBJ_pbeW�hMD2AndDES_CBC + +OBJ_pkcs5 +,1L + + ) + +635 + #SN_pbeW�hMD5AndDES_CBC + "PBE-MD5-DES" + + ) + +636 + #LN_pbeW�hMD5AndDES_CBC + "pbeW�hMD5AndDES-CBC" + + ) + +637 + #NID_pbeW�hMD5AndDES_CBC + 10 + + ) + +638 + #OBJ_pbeW�hMD5AndDES_CBC + +OBJ_pkcs5 +,3L + + ) + +640 + #SN_pbeW�hMD2AndRC2_CBC + "PBE-MD2-RC2-64" + + ) + +641 + #LN_pbeW�hMD2AndRC2_CBC + "pbeW�hMD2AndRC2-CBC" + + ) + +642 + #NID_pbeW�hMD2AndRC2_CBC + 168 + + ) + +643 + #OBJ_pbeW�hMD2AndRC2_CBC + +OBJ_pkcs5 +,4L + + ) + +645 + #SN_pbeW�hMD5AndRC2_CBC + "PBE-MD5-RC2-64" + + ) + +646 + #LN_pbeW�hMD5AndRC2_CBC + "pbeW�hMD5AndRC2-CBC" + + ) + +647 + #NID_pbeW�hMD5AndRC2_CBC + 169 + + ) + +648 + #OBJ_pbeW�hMD5AndRC2_CBC + +OBJ_pkcs5 +,6L + + ) + +650 + #SN_pbeW�hSHA1AndDES_CBC + "PBE-SHA1-DES" + + ) + +651 + #LN_pbeW�hSHA1AndDES_CBC + "pbeW�hSHA1AndDES-CBC" + + ) + +652 + #NID_pbeW�hSHA1AndDES_CBC + 170 + + ) + +653 + #OBJ_pbeW�hSHA1AndDES_CBC + +OBJ_pkcs5 +,10L + + ) + +655 + #SN_pbeW�hSHA1AndRC2_CBC + "PBE-SHA1-RC2-64" + + ) + +656 + #LN_pbeW�hSHA1AndRC2_CBC + "pbeW�hSHA1AndRC2-CBC" + + ) + +657 + #NID_pbeW�hSHA1AndRC2_CBC + 68 + + ) + +658 + #OBJ_pbeW�hSHA1AndRC2_CBC + +OBJ_pkcs5 +,11L + + ) + +660 + #LN_id_pbkdf2 + "PBKDF2" + + ) + +661 + #NID_id_pbkdf2 + 69 + + ) + +662 + #OBJ_id_pbkdf2 + +OBJ_pkcs5 +,12L + + ) + +664 + #LN_pbes2 + "PBES2" + + ) + +665 + #NID_pbes2 + 161 + + ) + +666 + #OBJ_pbes2 + +OBJ_pkcs5 +,13L + + ) + +668 + #LN_pbmac1 + "PBMAC1" + + ) + +669 + #NID_pbmac1 + 162 + + ) + +670 + #OBJ_pbmac1 + +OBJ_pkcs5 +,14L + + ) + +672 + #SN_pkcs7 + "pkcs7" + + ) + +673 + #NID_pkcs7 + 20 + + ) + +674 + #OBJ_pkcs7 + +OBJ_pkcs +,7L + + ) + +676 + #LN_pkcs7_d�a + "pkcs7-d�a" + + ) + +677 + #NID_pkcs7_d�a + 21 + + ) + +678 + #OBJ_pkcs7_d�a + +OBJ_pkcs7 +,1L + + ) + +680 + #LN_pkcs7_sig�d + "pkcs7-sig�dD�a" + + ) + +681 + #NID_pkcs7_sig�d + 22 + + ) + +682 + #OBJ_pkcs7_sig�d + +OBJ_pkcs7 +,2L + + ) + +684 + #LN_pkcs7_�v��ed + "pkcs7-�v��edD�a" + + ) + +685 + #NID_pkcs7_�v��ed + 23 + + ) + +686 + #OBJ_pkcs7_�v��ed + +OBJ_pkcs7 +,3L + + ) + +688 + #LN_pkcs7_sig�dAndEnv��ed + "pkcs7-sig�dAndEnv��edD�a" + + ) + +689 + #NID_pkcs7_sig�dAndEnv��ed + 24 + + ) + +690 + #OBJ_pkcs7_sig�dAndEnv��ed + +OBJ_pkcs7 +,4L + + ) + +692 + #LN_pkcs7_dige� + "pkcs7-dige�D�a" + + ) + +693 + #NID_pkcs7_dige� + 25 + + ) + +694 + #OBJ_pkcs7_dige� + +OBJ_pkcs7 +,5L + + ) + +696 + #LN_pkcs7_��y�ed + "pkcs7-��y�edD�a" + + ) + +697 + #NID_pkcs7_��y�ed + 26 + + ) + +698 + #OBJ_pkcs7_��y�ed + +OBJ_pkcs7 +,6L + + ) + +700 + #SN_pkcs9 + "pkcs9" + + ) + +701 + #NID_pkcs9 + 47 + + ) + +702 + #OBJ_pkcs9 + +OBJ_pkcs +,9L + + ) + +704 + #LN_pkcs9_ema�Add�ss + "ema�Add�ss" + + ) + +705 + #NID_pkcs9_ema�Add�ss + 48 + + ) + +706 + #OBJ_pkcs9_ema�Add�ss + +OBJ_pkcs9 +,1L + + ) + +708 + #LN_pkcs9_un�ru�u�dName + "un�ru�u�dName" + + ) + +709 + #NID_pkcs9_un�ru�u�dName + 49 + + ) + +710 + #OBJ_pkcs9_un�ru�u�dName + +OBJ_pkcs9 +,2L + + ) + +712 + #LN_pkcs9_cڋ�Ty� + "cڋ�Ty�" + + ) + +713 + #NID_pkcs9_cڋ�Ty� + 50 + + ) + +714 + #OBJ_pkcs9_cڋ�Ty� + +OBJ_pkcs9 +,3L + + ) + +716 + #LN_pkcs9_mes�geDige� + "mes�geDige�" + + ) + +717 + #NID_pkcs9_mes�geDige� + 51 + + ) + +718 + #OBJ_pkcs9_mes�geDige� + +OBJ_pkcs9 +,4L + + ) + +720 + #LN_pkcs9_sign�gTime + "sign�gTime" + + ) + +721 + #NID_pkcs9_sign�gTime + 52 + + ) + +722 + #OBJ_pkcs9_sign�gTime + +OBJ_pkcs9 +,5L + + ) + +724 + #LN_pkcs9_cou��sig�tu� + "cou��sig�tu�" + + ) + +725 + #NID_pkcs9_cou��sig�tu� + 53 + + ) + +726 + #OBJ_pkcs9_cou��sig�tu� + +OBJ_pkcs9 +,6L + + ) + +728 + #LN_pkcs9_ch��ngePassw�d + "ch��ngePassw�d" + + ) + +729 + #NID_pkcs9_ch��ngePassw�d + 54 + + ) + +730 + #OBJ_pkcs9_ch��ngePassw�d + +OBJ_pkcs9 +,7L + + ) + +732 + #LN_pkcs9_un�ru�u�dAdd�ss + "un�ru�u�dAdd�ss" + + ) + +733 + #NID_pkcs9_un�ru�u�dAdd�ss + 55 + + ) + +734 + #OBJ_pkcs9_un�ru�u�dAdd�ss + +OBJ_pkcs9 +,8L + + ) + +736 + #LN_pkcs9_extC�tA�ribu�s + "ex�ndedC�tifi��A�ribu�s" + + ) + +737 + #NID_pkcs9_extC�tA�ribu�s + 56 + + ) + +738 + #OBJ_pkcs9_extC�tA�ribu�s + +OBJ_pkcs9 +,9L + + ) + +740 + #SN_ext_�q + "extReq" + + ) + +741 + #LN_ext_�q + "Ex�nsi� Reque�" + + ) + +742 + #NID_ext_�q + 172 + + ) + +743 + #OBJ_ext_�q + +OBJ_pkcs9 +,14L + + ) + +745 + #SN_SMIMEC�ab���s + "SMIME-CAPS" + + ) + +746 + #LN_SMIMEC�ab���s + "S/MIME C�ab���s" + + ) + +747 + #NID_SMIMEC�ab���s + 167 + + ) + +748 + #OBJ_SMIMEC�ab���s + +OBJ_pkcs9 +,15L + + ) + +750 + #SN_SMIME + "SMIME" + + ) + +751 + #LN_SMIME + "S/MIME" + + ) + +752 + #NID_SMIME + 188 + + ) + +753 + #OBJ_SMIME + +OBJ_pkcs9 +,16L + + ) + +755 + #SN_id_smime_mod + "id-smime-mod" + + ) + +756 + #NID_id_smime_mod + 189 + + ) + +757 + #OBJ_id_smime_mod + +OBJ_SMIME +,0L + + ) + +759 + #SN_id_smime_� + "id-smime-�" + + ) + +760 + #NID_id_smime_� + 190 + + ) + +761 + #OBJ_id_smime_� + +OBJ_SMIME +,1L + + ) + +763 + #SN_id_smime_� + "id-smime-�" + + ) + +764 + #NID_id_smime_� + 191 + + ) + +765 + #OBJ_id_smime_� + +OBJ_SMIME +,2L + + ) + +767 + #SN_id_smime_�g + "id-smime-�g" + + ) + +768 + #NID_id_smime_�g + 192 + + ) + +769 + #OBJ_id_smime_�g + +OBJ_SMIME +,3L + + ) + +771 + #SN_id_smime_cd + "id-smime-cd" + + ) + +772 + #NID_id_smime_cd + 193 + + ) + +773 + #OBJ_id_smime_cd + +OBJ_SMIME +,4L + + ) + +775 + #SN_id_smime_�q + "id-smime-�q" + + ) + +776 + #NID_id_smime_�q + 194 + + ) + +777 + #OBJ_id_smime_�q + +OBJ_SMIME +,5L + + ) + +779 + #SN_id_smime_�i + "id-smime-�i" + + ) + +780 + #NID_id_smime_�i + 195 + + ) + +781 + #OBJ_id_smime_�i + +OBJ_SMIME +,6L + + ) + +783 + #SN_id_smime_mod_cms + "id-smime-mod-cms" + + ) + +784 + #NID_id_smime_mod_cms + 196 + + ) + +785 + #OBJ_id_smime_mod_cms + +OBJ_id_smime_mod +,1L + + ) + +787 + #SN_id_smime_mod_ess + "id-smime-mod-ess" + + ) + +788 + #NID_id_smime_mod_ess + 197 + + ) + +789 + #OBJ_id_smime_mod_ess + +OBJ_id_smime_mod +,2L + + ) + +791 + #SN_id_smime_mod_oid + "id-smime-mod-oid" + + ) + +792 + #NID_id_smime_mod_oid + 198 + + ) + +793 + #OBJ_id_smime_mod_oid + +OBJ_id_smime_mod +,3L + + ) + +795 + #SN_id_smime_mod_msg_v3 + "id-smime-mod-msg-v3" + + ) + +796 + #NID_id_smime_mod_msg_v3 + 199 + + ) + +797 + #OBJ_id_smime_mod_msg_v3 + +OBJ_id_smime_mod +,4L + + ) + +799 + #SN_id_smime_mod_�s_eSig�tu�_88 + "id-smime-mod-�s-eSig�tu�-88" + + ) + +800 + #NID_id_smime_mod_�s_eSig�tu�_88 + 200 + + ) + +801 + #OBJ_id_smime_mod_�s_eSig�tu�_88 + +OBJ_id_smime_mod +,5L + + ) + +803 + #SN_id_smime_mod_�s_eSig�tu�_97 + "id-smime-mod-�s-eSig�tu�-97" + + ) + +804 + #NID_id_smime_mod_�s_eSig�tu�_97 + 201 + + ) + +805 + #OBJ_id_smime_mod_�s_eSig�tu�_97 + +OBJ_id_smime_mod +,6L + + ) + +807 + #SN_id_smime_mod_�s_eSigP�icy_88 + "id-smime-mod-�s-eSigP�icy-88" + + ) + +808 + #NID_id_smime_mod_�s_eSigP�icy_88 + 202 + + ) + +809 + #OBJ_id_smime_mod_�s_eSigP�icy_88 + +OBJ_id_smime_mod +,7L + + ) + +811 + #SN_id_smime_mod_�s_eSigP�icy_97 + "id-smime-mod-�s-eSigP�icy-97" + + ) + +812 + #NID_id_smime_mod_�s_eSigP�icy_97 + 203 + + ) + +813 + #OBJ_id_smime_mod_�s_eSigP�icy_97 + +OBJ_id_smime_mod +,8L + + ) + +815 + #SN_id_smime_�_���t + "id-smime-�-���t" + + ) + +816 + #NID_id_smime_�_���t + 204 + + ) + +817 + #OBJ_id_smime_�_���t + +OBJ_id_smime_� +,1L + + ) + +819 + #SN_id_smime_�_authD�a + "id-smime-�-authD�a" + + ) + +820 + #NID_id_smime_�_authD�a + 205 + + ) + +821 + #OBJ_id_smime_�_authD�a + +OBJ_id_smime_� +,2L + + ) + +823 + #SN_id_smime_�_publishC�t + "id-smime-�-publishC�t" + + ) + +824 + #NID_id_smime_�_publishC�t + 206 + + ) + +825 + #OBJ_id_smime_�_publishC�t + +OBJ_id_smime_� +,3L + + ) + +827 + #SN_id_smime_�_TSTInfo + "id-smime-�-TSTInfo" + + ) + +828 + #NID_id_smime_�_TSTInfo + 207 + + ) + +829 + #OBJ_id_smime_�_TSTInfo + +OBJ_id_smime_� +,4L + + ) + +831 + #SN_id_smime_�_TDTInfo + "id-smime-�-TDTInfo" + + ) + +832 + #NID_id_smime_�_TDTInfo + 208 + + ) + +833 + #OBJ_id_smime_�_TDTInfo + +OBJ_id_smime_� +,5L + + ) + +835 + #SN_id_smime_�_cڋ�Info + "id-smime-�-cڋ�Info" + + ) + +836 + #NID_id_smime_�_cڋ�Info + 209 + + ) + +837 + #OBJ_id_smime_�_cڋ�Info + +OBJ_id_smime_� +,6L + + ) + +839 + #SN_id_smime_�_DVCSReque�D�a + "id-smime-�-DVCSReque�D�a" + + ) + +840 + #NID_id_smime_�_DVCSReque�D�a + 210 + + ) + +841 + #OBJ_id_smime_�_DVCSReque�D�a + +OBJ_id_smime_� +,7L + + ) + +843 + #SN_id_smime_�_DVCSRe�ڣD�a + "id-smime-�-DVCSRe�ڣD�a" + + ) + +844 + #NID_id_smime_�_DVCSRe�ڣD�a + 211 + + ) + +845 + #OBJ_id_smime_�_DVCSRe�ڣD�a + +OBJ_id_smime_� +,8L + + ) + +847 + #SN_id_smime_�_com�es�dD�a + "id-smime-�-com�es�dD�a" + + ) + +848 + #NID_id_smime_�_com�es�dD�a + 786 + + ) + +849 + #OBJ_id_smime_�_com�es�dD�a + +OBJ_id_smime_� +,9L + + ) + +851 + #SN_id_�_asciiTextW�hCRLF + "id-�-asciiTextW�hCRLF" + + ) + +852 + #NID_id_�_asciiTextW�hCRLF + 787 + + ) + +853 + #OBJ_id_�_asciiTextW�hCRLF + +OBJ_id_smime_� +,27L + + ) + +855 + #SN_id_smime_�_���tReque� + "id-smime-�-���tReque�" + + ) + +856 + #NID_id_smime_�_���tReque� + 212 + + ) + +857 + #OBJ_id_smime_�_���tReque� + +OBJ_id_smime_� +,1L + + ) + +859 + #SN_id_smime_�_�cur�yLab� + "id-smime-�-�cur�yLab�" + + ) + +860 + #NID_id_smime_�_�cur�yLab� + 213 + + ) + +861 + #OBJ_id_smime_�_�cur�yLab� + +OBJ_id_smime_� +,2L + + ) + +863 + #SN_id_smime_�_mlEx�ndHi��y + "id-smime-�-mlEx�ndHi��y" + + ) + +864 + #NID_id_smime_�_mlEx�ndHi��y + 214 + + ) + +865 + #OBJ_id_smime_�_mlEx�ndHi��y + +OBJ_id_smime_� +,3L + + ) + +867 + #SN_id_smime_�_cڋ�H�t + "id-smime-�-cڋ�H�t" + + ) + +868 + #NID_id_smime_�_cڋ�H�t + 215 + + ) + +869 + #OBJ_id_smime_�_cڋ�H�t + +OBJ_id_smime_� +,4L + + ) + +871 + #SN_id_smime_�_msgSigDige� + "id-smime-�-msgSigDige�" + + ) + +872 + #NID_id_smime_�_msgSigDige� + 216 + + ) + +873 + #OBJ_id_smime_�_msgSigDige� + +OBJ_id_smime_� +,5L + + ) + +875 + #SN_id_smime_�_��pCڋ�Ty� + "id-smime-�-��pCڋ�Ty�" + + ) + +876 + #NID_id_smime_�_��pCڋ�Ty� + 217 + + ) + +877 + #OBJ_id_smime_�_��pCڋ�Ty� + +OBJ_id_smime_� +,6L + + ) + +879 + #SN_id_smime_�_cڋ�Id�tif�r + "id-smime-�-cڋ�Id�tif�r" + + ) + +880 + #NID_id_smime_�_cڋ�Id�tif�r + 218 + + ) + +881 + #OBJ_id_smime_�_cڋ�Id�tif�r + +OBJ_id_smime_� +,7L + + ) + +883 + #SN_id_smime_�_macV�ue + "id-smime-�-macV�ue" + + ) + +884 + #NID_id_smime_�_macV�ue + 219 + + ) + +885 + #OBJ_id_smime_�_macV�ue + +OBJ_id_smime_� +,8L + + ) + +887 + #SN_id_smime_�_equiv��tLab�s + "id-smime-�-equiv��tLab�s" + + ) + +888 + #NID_id_smime_�_equiv��tLab�s + 220 + + ) + +889 + #OBJ_id_smime_�_equiv��tLab�s + +OBJ_id_smime_� +,9L + + ) + +891 + #SN_id_smime_�_cڋ�Re�n� + "id-smime-�-cڋ�Re�n�" + + ) + +892 + #NID_id_smime_�_cڋ�Re�n� + 221 + + ) + +893 + #OBJ_id_smime_�_cڋ�Re�n� + +OBJ_id_smime_� +,10L + + ) + +895 + #SN_id_smime_�_��ypKeyP�f + "id-smime-�-��ypKeyP�f" + + ) + +896 + #NID_id_smime_�_��ypKeyP�f + 222 + + ) + +897 + #OBJ_id_smime_�_��ypKeyP�f + +OBJ_id_smime_� +,11L + + ) + +899 + #SN_id_smime_�_sign�gC�tifi�� + "id-smime-�-sign�gC�tifi��" + + ) + +900 + #NID_id_smime_�_sign�gC�tifi�� + 223 + + ) + +901 + #OBJ_id_smime_�_sign�gC�tifi�� + +OBJ_id_smime_� +,12L + + ) + +903 + #SN_id_smime_�_smimeEn�y�C�ts + "id-smime-�-smimeEn�y�C�ts" + + ) + +904 + #NID_id_smime_�_smimeEn�y�C�ts + 224 + + ) + +905 + #OBJ_id_smime_�_smimeEn�y�C�ts + +OBJ_id_smime_� +,13L + + ) + +907 + #SN_id_smime_�_timeS�mpTok� + "id-smime-�-timeS�mpTok�" + + ) + +908 + #NID_id_smime_�_timeS�mpTok� + 225 + + ) + +909 + #OBJ_id_smime_�_timeS�mpTok� + +OBJ_id_smime_� +,14L + + ) + +911 + #SN_id_smime_�_�s_sigP�icyId + "id-smime-�-�s-sigP�icyId" + + ) + +912 + #NID_id_smime_�_�s_sigP�icyId + 226 + + ) + +913 + #OBJ_id_smime_�_�s_sigP�icyId + +OBJ_id_smime_� +,15L + + ) + +915 + #SN_id_smime_�_�s_comm�m�tTy� + "id-smime-�-�s-comm�m�tTy�" + + ) + +916 + #NID_id_smime_�_�s_comm�m�tTy� + 227 + + ) + +917 + #OBJ_id_smime_�_�s_comm�m�tTy� + +OBJ_id_smime_� +,16L + + ) + +919 + #SN_id_smime_�_�s_sig�rLo�ti� + "id-smime-�-�s-sig�rLo�ti�" + + ) + +920 + #NID_id_smime_�_�s_sig�rLo�ti� + 228 + + ) + +921 + #OBJ_id_smime_�_�s_sig�rLo�ti� + +OBJ_id_smime_� +,17L + + ) + +923 + #SN_id_smime_�_�s_sig�rA�r + "id-smime-�-�s-sig�rA�r" + + ) + +924 + #NID_id_smime_�_�s_sig�rA�r + 229 + + ) + +925 + #OBJ_id_smime_�_�s_sig�rA�r + +OBJ_id_smime_� +,18L + + ) + +927 + #SN_id_smime_�_�s_�h�SigC�t + "id-smime-�-�s-�h�SigC�t" + + ) + +928 + #NID_id_smime_�_�s_�h�SigC�t + 230 + + ) + +929 + #OBJ_id_smime_�_�s_�h�SigC�t + +OBJ_id_smime_� +,19L + + ) + +931 + #SN_id_smime_�_�s_cڋ�Time�amp + "id-smime-�-�s-cڋ�Time�amp" + + ) + +932 + #NID_id_smime_�_�s_cڋ�Time�amp + 231 + + ) + +933 + #OBJ_id_smime_�_�s_cڋ�Time�amp + +OBJ_id_smime_� +,20L + + ) + +935 + #SN_id_smime_�_�s_C�tifi��Refs + "id-smime-�-�s-C�tifi��Refs" + + ) + +936 + #NID_id_smime_�_�s_C�tifi��Refs + 232 + + ) + +937 + #OBJ_id_smime_�_�s_C�tifi��Refs + +OBJ_id_smime_� +,21L + + ) + +939 + #SN_id_smime_�_�s_Revo�ti�Refs + "id-smime-�-�s-Revo�ti�Refs" + + ) + +940 + #NID_id_smime_�_�s_Revo�ti�Refs + 233 + + ) + +941 + #OBJ_id_smime_�_�s_Revo�ti�Refs + +OBJ_id_smime_� +,22L + + ) + +943 + #SN_id_smime_�_�s_��V�ues + "id-smime-�-�s-��V�ues" + + ) + +944 + #NID_id_smime_�_�s_��V�ues + 234 + + ) + +945 + #OBJ_id_smime_�_�s_��V�ues + +OBJ_id_smime_� +,23L + + ) + +947 + #SN_id_smime_�_�s_�vo�ti�V�ues + "id-smime-�-�s-�vo�ti�V�ues" + + ) + +948 + #NID_id_smime_�_�s_�vo�ti�V�ues + 235 + + ) + +949 + #OBJ_id_smime_�_�s_�vo�ti�V�ues + +OBJ_id_smime_� +,24L + + ) + +951 + #SN_id_smime_�_�s_escTimeS�mp + "id-smime-�-�s-escTimeS�mp" + + ) + +952 + #NID_id_smime_�_�s_escTimeS�mp + 236 + + ) + +953 + #OBJ_id_smime_�_�s_escTimeS�mp + +OBJ_id_smime_� +,25L + + ) + +955 + #SN_id_smime_�_�s_��CRLTime�amp + "id-smime-�-�s-��CRLTime�amp" + + ) + +956 + #NID_id_smime_�_�s_��CRLTime�amp + 237 + + ) + +957 + #OBJ_id_smime_�_�s_��CRLTime�amp + +OBJ_id_smime_� +,26L + + ) + +959 + #SN_id_smime_�_�s_�chiveTimeS�mp + "id-smime-�-�s-�chiveTimeS�mp" + + ) + +960 + #NID_id_smime_�_�s_�chiveTimeS�mp + 238 + + ) + +961 + #OBJ_id_smime_�_�s_�chiveTimeS�mp + +OBJ_id_smime_� +,27L + + ) + +963 + #SN_id_smime_�_sig�tu�Ty� + "id-smime-�-sig�tu�Ty�" + + ) + +964 + #NID_id_smime_�_sig�tu�Ty� + 239 + + ) + +965 + #OBJ_id_smime_�_sig�tu�Ty� + +OBJ_id_smime_� +,28L + + ) + +967 + #SN_id_smime_�_dvcs_dvc + "id-smime-�-dvcs-dvc" + + ) + +968 + #NID_id_smime_�_dvcs_dvc + 240 + + ) + +969 + #OBJ_id_smime_�_dvcs_dvc + +OBJ_id_smime_� +,29L + + ) + +971 + #SN_id_smime_�g_ESDHw�h3DES + "id-smime-�g-ESDHw�h3DES" + + ) + +972 + #NID_id_smime_�g_ESDHw�h3DES + 241 + + ) + +973 + #OBJ_id_smime_�g_ESDHw�h3DES + +OBJ_id_smime_�g +,1L + + ) + +975 + #SN_id_smime_�g_ESDHw�hRC2 + "id-smime-�g-ESDHw�hRC2" + + ) + +976 + #NID_id_smime_�g_ESDHw�hRC2 + 242 + + ) + +977 + #OBJ_id_smime_�g_ESDHw�hRC2 + +OBJ_id_smime_�g +,2L + + ) + +979 + #SN_id_smime_�g_3DESw�p + "id-smime-�g-3DESw�p" + + ) + +980 + #NID_id_smime_�g_3DESw�p + 243 + + ) + +981 + #OBJ_id_smime_�g_3DESw�p + +OBJ_id_smime_�g +,3L + + ) + +983 + #SN_id_smime_�g_RC2w�p + "id-smime-�g-RC2w�p" + + ) + +984 + #NID_id_smime_�g_RC2w�p + 244 + + ) + +985 + #OBJ_id_smime_�g_RC2w�p + +OBJ_id_smime_�g +,4L + + ) + +987 + #SN_id_smime_�g_ESDH + "id-smime-�g-ESDH" + + ) + +988 + #NID_id_smime_�g_ESDH + 245 + + ) + +989 + #OBJ_id_smime_�g_ESDH + +OBJ_id_smime_�g +,5L + + ) + +991 + #SN_id_smime_�g_CMS3DESw�p + "id-smime-�g-CMS3DESw�p" + + ) + +992 + #NID_id_smime_�g_CMS3DESw�p + 246 + + ) + +993 + #OBJ_id_smime_�g_CMS3DESw�p + +OBJ_id_smime_�g +,6L + + ) + +995 + #SN_id_smime_�g_CMSRC2w�p + "id-smime-�g-CMSRC2w�p" + + ) + +996 + #NID_id_smime_�g_CMSRC2w�p + 247 + + ) + +997 + #OBJ_id_smime_�g_CMSRC2w�p + +OBJ_id_smime_�g +,7L + + ) + +999 + #SN_id_�g_PWRI_KEK + "id-�g-PWRI-KEK" + + ) + +1000 + #NID_id_�g_PWRI_KEK + 893 + + ) + +1001 + #OBJ_id_�g_PWRI_KEK + +OBJ_id_smime_�g +,9L + + ) + +1003 + #SN_id_smime_cd_ld� + "id-smime-cd-ld�" + + ) + +1004 + #NID_id_smime_cd_ld� + 248 + + ) + +1005 + #OBJ_id_smime_cd_ld� + +OBJ_id_smime_cd +,1L + + ) + +1007 + #SN_id_smime_�q_�s_sqt_uri + "id-smime-�q-�s-sqt-uri" + + ) + +1008 + #NID_id_smime_�q_�s_sqt_uri + 249 + + ) + +1009 + #OBJ_id_smime_�q_�s_sqt_uri + +OBJ_id_smime_�q +,1L + + ) + +1011 + #SN_id_smime_�q_�s_sqt_un�i� + "id-smime-�q-�s-sqt-un�i�" + + ) + +1012 + #NID_id_smime_�q_�s_sqt_un�i� + 250 + + ) + +1013 + #OBJ_id_smime_�q_�s_sqt_un�i� + +OBJ_id_smime_�q +,2L + + ) + +1015 + #SN_id_smime_�i_�s_�oofOfOrig� + "id-smime-�i-�s-�oofOfOrig�" + + ) + +1016 + #NID_id_smime_�i_�s_�oofOfOrig� + 251 + + ) + +1017 + #OBJ_id_smime_�i_�s_�oofOfOrig� + +OBJ_id_smime_�i +,1L + + ) + +1019 + #SN_id_smime_�i_�s_�oofOfRe��t + "id-smime-�i-�s-�oofOfRe��t" + + ) + +1020 + #NID_id_smime_�i_�s_�oofOfRe��t + 252 + + ) + +1021 + #OBJ_id_smime_�i_�s_�oofOfRe��t + +OBJ_id_smime_�i +,2L + + ) + +1023 + #SN_id_smime_�i_�s_�oofOfD�iv�y + "id-smime-�i-�s-�oofOfD�iv�y" + + ) + +1024 + #NID_id_smime_�i_�s_�oofOfD�iv�y + 253 + + ) + +1025 + #OBJ_id_smime_�i_�s_�oofOfD�iv�y + +OBJ_id_smime_�i +,3L + + ) + +1027 + #SN_id_smime_�i_�s_�oofOfS�d� + "id-smime-�i-�s-�oofOfS�d�" + + ) + +1028 + #NID_id_smime_�i_�s_�oofOfS�d� + 254 + + ) + +1029 + #OBJ_id_smime_�i_�s_�oofOfS�d� + +OBJ_id_smime_�i +,4L + + ) + +1031 + #SN_id_smime_�i_�s_�oofOfA�rov� + "id-smime-�i-�s-�oofOfA�rov�" + + ) + +1032 + #NID_id_smime_�i_�s_�oofOfA�rov� + 255 + + ) + +1033 + #OBJ_id_smime_�i_�s_�oofOfA�rov� + +OBJ_id_smime_�i +,5L + + ) + +1035 + #SN_id_smime_�i_�s_�oofOfC��i� + "id-smime-�i-�s-�oofOfC��i�" + + ) + +1036 + #NID_id_smime_�i_�s_�oofOfC��i� + 256 + + ) + +1037 + #OBJ_id_smime_�i_�s_�oofOfC��i� + +OBJ_id_smime_�i +,6L + + ) + +1039 + #LN_�ndlyName + "�ndlyName" + + ) + +1040 + #NID_�ndlyName + 156 + + ) + +1041 + #OBJ_�ndlyName + +OBJ_pkcs9 +,20L + + ) + +1043 + #LN_lo�lKeyID + "lo�lKeyID" + + ) + +1044 + #NID_lo�lKeyID + 157 + + ) + +1045 + #OBJ_lo�lKeyID + +OBJ_pkcs9 +,21L + + ) + +1047 + #SN_ms_c�_�me + "CSPName" + + ) + +1048 + #LN_ms_c�_�me + "Mi�oso� CSP Name" + + ) + +1049 + #NID_ms_c�_�me + 417 + + ) + +1050 + #OBJ_ms_c�_�me + 1L,3L,6L,1L,4L,1L,311L,17L,1L + + ) + +1052 + #SN_Lo�lKeyS� + "Lo�lKeyS�" + + ) + +1053 + #LN_Lo�lKeyS� + "Mi�oso� Lo��Key s�" + + ) + +1054 + #NID_Lo�lKeyS� + 856 + + ) + +1055 + #OBJ_Lo�lKeyS� + 1L,3L,6L,1L,4L,1L,311L,17L,2L + + ) + +1057 + #OBJ_��Ty�s + +OBJ_pkcs9 +,22L + + ) + +1059 + #LN_x509C�tifi�� + "x509C�tifi��" + + ) + +1060 + #NID_x509C�tifi�� + 158 + + ) + +1061 + #OBJ_x509C�tifi�� + +OBJ_��Ty�s +,1L + + ) + +1063 + #LN_sdsiC�tifi�� + "sdsiC�tifi��" + + ) + +1064 + #NID_sdsiC�tifi�� + 159 + + ) + +1065 + #OBJ_sdsiC�tifi�� + +OBJ_��Ty�s +,2L + + ) + +1067 + #OBJ_�lTy�s + +OBJ_pkcs9 +,23L + + ) + +1069 + #LN_x509C� + "x509C�" + + ) + +1070 + #NID_x509C� + 160 + + ) + +1071 + #OBJ_x509C� + +OBJ_�lTy�s +,1L + + ) + +1073 + #OBJ_pkcs12 + +OBJ_pkcs +,12L + + ) + +1075 + #OBJ_pkcs12_pbeids + +OBJ_pkcs12 +,1L + + ) + +1077 + #SN_pbe_W�hSHA1And128B�RC4 + "PBE-SHA1-RC4-128" + + ) + +1078 + #LN_pbe_W�hSHA1And128B�RC4 + "pbeW�hSHA1And128B�RC4" + + ) + +1079 + #NID_pbe_W�hSHA1And128B�RC4 + 144 + + ) + +1080 + #OBJ_pbe_W�hSHA1And128B�RC4 + +OBJ_pkcs12_pbeids +,1L + + ) + +1082 + #SN_pbe_W�hSHA1And40B�RC4 + "PBE-SHA1-RC4-40" + + ) + +1083 + #LN_pbe_W�hSHA1And40B�RC4 + "pbeW�hSHA1And40B�RC4" + + ) + +1084 + #NID_pbe_W�hSHA1And40B�RC4 + 145 + + ) + +1085 + #OBJ_pbe_W�hSHA1And40B�RC4 + +OBJ_pkcs12_pbeids +,2L + + ) + +1087 + #SN_pbe_W�hSHA1And3_Key_Tr��DES_CBC + "PBE-SHA1-3DES" + + ) + +1088 + #LN_pbe_W�hSHA1And3_Key_Tr��DES_CBC + "pbeW�hSHA1And3-KeyTr��DES-CBC" + + ) + +1089 + #NID_pbe_W�hSHA1And3_Key_Tr��DES_CBC + 146 + + ) + +1090 + #OBJ_pbe_W�hSHA1And3_Key_Tr��DES_CBC + +OBJ_pkcs12_pbeids +,3L + + ) + +1092 + #SN_pbe_W�hSHA1And2_Key_Tr��DES_CBC + "PBE-SHA1-2DES" + + ) + +1093 + #LN_pbe_W�hSHA1And2_Key_Tr��DES_CBC + "pbeW�hSHA1And2-KeyTr��DES-CBC" + + ) + +1094 + #NID_pbe_W�hSHA1And2_Key_Tr��DES_CBC + 147 + + ) + +1095 + #OBJ_pbe_W�hSHA1And2_Key_Tr��DES_CBC + +OBJ_pkcs12_pbeids +,4L + + ) + +1097 + #SN_pbe_W�hSHA1And128B�RC2_CBC + "PBE-SHA1-RC2-128" + + ) + +1098 + #LN_pbe_W�hSHA1And128B�RC2_CBC + "pbeW�hSHA1And128B�RC2-CBC" + + ) + +1099 + #NID_pbe_W�hSHA1And128B�RC2_CBC + 148 + + ) + +1100 + #OBJ_pbe_W�hSHA1And128B�RC2_CBC + +OBJ_pkcs12_pbeids +,5L + + ) + +1102 + #SN_pbe_W�hSHA1And40B�RC2_CBC + "PBE-SHA1-RC2-40" + + ) + +1103 + #LN_pbe_W�hSHA1And40B�RC2_CBC + "pbeW�hSHA1And40B�RC2-CBC" + + ) + +1104 + #NID_pbe_W�hSHA1And40B�RC2_CBC + 149 + + ) + +1105 + #OBJ_pbe_W�hSHA1And40B�RC2_CBC + +OBJ_pkcs12_pbeids +,6L + + ) + +1107 + #OBJ_pkcs12_V�si�1 + +OBJ_pkcs12 +,10L + + ) + +1109 + #OBJ_pkcs12_BagIds + +OBJ_pkcs12_V�si�1 +,1L + + ) + +1111 + #LN_keyBag + "keyBag" + + ) + +1112 + #NID_keyBag + 150 + + ) + +1113 + #OBJ_keyBag + +OBJ_pkcs12_BagIds +,1L + + ) + +1115 + #LN_pkcs8ShroudedKeyBag + "pkcs8ShroudedKeyBag" + + ) + +1116 + #NID_pkcs8ShroudedKeyBag + 151 + + ) + +1117 + #OBJ_pkcs8ShroudedKeyBag + +OBJ_pkcs12_BagIds +,2L + + ) + +1119 + #LN_��Bag + "��Bag" + + ) + +1120 + #NID_��Bag + 152 + + ) + +1121 + #OBJ_��Bag + +OBJ_pkcs12_BagIds +,3L + + ) + +1123 + #LN_�lBag + "�lBag" + + ) + +1124 + #NID_�lBag + 153 + + ) + +1125 + #OBJ_�lBag + +OBJ_pkcs12_BagIds +,4L + + ) + +1127 + #LN_���Bag + "���Bag" + + ) + +1128 + #NID_���Bag + 154 + + ) + +1129 + #OBJ_���Bag + +OBJ_pkcs12_BagIds +,5L + + ) + +1131 + #LN_��Cڋ�sBag + "��Cڋ�sBag" + + ) + +1132 + #NID_��Cڋ�sBag + 155 + + ) + +1133 + #OBJ_��Cڋ�sBag + +OBJ_pkcs12_BagIds +,6L + + ) + +1135 + #SN_md2 + "MD2" + + ) + +1136 + #LN_md2 + "md2" + + ) + +1137 + #NID_md2 + 3 + + ) + +1138 + #OBJ_md2 + +OBJ_r�dsi +,2L,2L + + ) + +1140 + #SN_md4 + "MD4" + + ) + +1141 + #LN_md4 + "md4" + + ) + +1142 + #NID_md4 + 257 + + ) + +1143 + #OBJ_md4 + +OBJ_r�dsi +,2L,4L + + ) + +1145 + #SN_md5 + "MD5" + + ) + +1146 + #LN_md5 + "md5" + + ) + +1147 + #NID_md5 + 4 + + ) + +1148 + #OBJ_md5 + +OBJ_r�dsi +,2L,5L + + ) + +1150 + #SN_md5_sha1 + "MD5-SHA1" + + ) + +1151 + #LN_md5_sha1 + "md5-sha1" + + ) + +1152 + #NID_md5_sha1 + 114 + + ) + +1154 + #LN_hmacW�hMD5 + "hmacW�hMD5" + + ) + +1155 + #NID_hmacW�hMD5 + 797 + + ) + +1156 + #OBJ_hmacW�hMD5 + +OBJ_r�dsi +,2L,6L + + ) + +1158 + #LN_hmacW�hSHA1 + "hmacW�hSHA1" + + ) + +1159 + #NID_hmacW�hSHA1 + 163 + + ) + +1160 + #OBJ_hmacW�hSHA1 + +OBJ_r�dsi +,2L,7L + + ) + +1162 + #LN_hmacW�hSHA224 + "hmacW�hSHA224" + + ) + +1163 + #NID_hmacW�hSHA224 + 798 + + ) + +1164 + #OBJ_hmacW�hSHA224 + +OBJ_r�dsi +,2L,8L + + ) + +1166 + #LN_hmacW�hSHA256 + "hmacW�hSHA256" + + ) + +1167 + #NID_hmacW�hSHA256 + 799 + + ) + +1168 + #OBJ_hmacW�hSHA256 + +OBJ_r�dsi +,2L,9L + + ) + +1170 + #LN_hmacW�hSHA384 + "hmacW�hSHA384" + + ) + +1171 + #NID_hmacW�hSHA384 + 800 + + ) + +1172 + #OBJ_hmacW�hSHA384 + +OBJ_r�dsi +,2L,10L + + ) + +1174 + #LN_hmacW�hSHA512 + "hmacW�hSHA512" + + ) + +1175 + #NID_hmacW�hSHA512 + 801 + + ) + +1176 + #OBJ_hmacW�hSHA512 + +OBJ_r�dsi +,2L,11L + + ) + +1178 + #SN_rc2_cbc + "RC2-CBC" + + ) + +1179 + #LN_rc2_cbc + "rc2-cbc" + + ) + +1180 + #NID_rc2_cbc + 37 + + ) + +1181 + #OBJ_rc2_cbc + +OBJ_r�dsi +,3L,2L + + ) + +1183 + #SN_rc2_ecb + "RC2-ECB" + + ) + +1184 + #LN_rc2_ecb + "rc2-ecb" + + ) + +1185 + #NID_rc2_ecb + 38 + + ) + +1187 + #SN_rc2_cfb64 + "RC2-CFB" + + ) + +1188 + #LN_rc2_cfb64 + "rc2-cfb" + + ) + +1189 + #NID_rc2_cfb64 + 39 + + ) + +1191 + #SN_rc2_ofb64 + "RC2-OFB" + + ) + +1192 + #LN_rc2_ofb64 + "rc2-ofb" + + ) + +1193 + #NID_rc2_ofb64 + 40 + + ) + +1195 + #SN_rc2_40_cbc + "RC2-40-CBC" + + ) + +1196 + #LN_rc2_40_cbc + "rc2-40-cbc" + + ) + +1197 + #NID_rc2_40_cbc + 98 + + ) + +1199 + #SN_rc2_64_cbc + "RC2-64-CBC" + + ) + +1200 + #LN_rc2_64_cbc + "rc2-64-cbc" + + ) + +1201 + #NID_rc2_64_cbc + 166 + + ) + +1203 + #SN_rc4 + "RC4" + + ) + +1204 + #LN_rc4 + "rc4" + + ) + +1205 + #NID_rc4 + 5 + + ) + +1206 + #OBJ_rc4 + +OBJ_r�dsi +,3L,4L + + ) + +1208 + #SN_rc4_40 + "RC4-40" + + ) + +1209 + #LN_rc4_40 + "rc4-40" + + ) + +1210 + #NID_rc4_40 + 97 + + ) + +1212 + #SN_des_ede3_cbc + "DES-EDE3-CBC" + + ) + +1213 + #LN_des_ede3_cbc + "des-ede3-cbc" + + ) + +1214 + #NID_des_ede3_cbc + 44 + + ) + +1215 + #OBJ_des_ede3_cbc + +OBJ_r�dsi +,3L,7L + + ) + +1217 + #SN_rc5_cbc + "RC5-CBC" + + ) + +1218 + #LN_rc5_cbc + "rc5-cbc" + + ) + +1219 + #NID_rc5_cbc + 120 + + ) + +1220 + #OBJ_rc5_cbc + +OBJ_r�dsi +,3L,8L + + ) + +1222 + #SN_rc5_ecb + "RC5-ECB" + + ) + +1223 + #LN_rc5_ecb + "rc5-ecb" + + ) + +1224 + #NID_rc5_ecb + 121 + + ) + +1226 + #SN_rc5_cfb64 + "RC5-CFB" + + ) + +1227 + #LN_rc5_cfb64 + "rc5-cfb" + + ) + +1228 + #NID_rc5_cfb64 + 122 + + ) + +1230 + #SN_rc5_ofb64 + "RC5-OFB" + + ) + +1231 + #LN_rc5_ofb64 + "rc5-ofb" + + ) + +1232 + #NID_rc5_ofb64 + 123 + + ) + +1234 + #SN_ms_ext_�q + "msExtReq" + + ) + +1235 + #LN_ms_ext_�q + "Mi�oso� Ex�nsi� Reque�" + + ) + +1236 + #NID_ms_ext_�q + 171 + + ) + +1237 + #OBJ_ms_ext_�q + 1L,3L,6L,1L,4L,1L,311L,2L,1L,14L + + ) + +1239 + #SN_ms_code_�d + "msCodeInd" + + ) + +1240 + #LN_ms_code_�d + "Mi�oso� Individu� Cod�Sign�g" + + ) + +1241 + #NID_ms_code_�d + 134 + + ) + +1242 + #OBJ_ms_code_�d + 1L,3L,6L,1L,4L,1L,311L,2L,1L,21L + + ) + +1244 + #SN_ms_code_com + "msCodeCom" + + ) + +1245 + #LN_ms_code_com + "Mi�oso� Comm�c��Cod�Sign�g" + + ) + +1246 + #NID_ms_code_com + 135 + + ) + +1247 + #OBJ_ms_code_com + 1L,3L,6L,1L,4L,1L,311L,2L,1L,22L + + ) + +1249 + #SN_ms_�l_sign + "msCTLSign" + + ) + +1250 + #LN_ms_�l_sign + "Mi�oso� Tru� Li� Sign�g" + + ) + +1251 + #NID_ms_�l_sign + 136 + + ) + +1252 + #OBJ_ms_�l_sign + 1L,3L,6L,1L,4L,1L,311L,10L,3L,1L + + ) + +1254 + #SN_ms_sgc + "msSGC" + + ) + +1255 + #LN_ms_sgc + "Mi�oso� S�v� G�ed Cry�o" + + ) + +1256 + #NID_ms_sgc + 137 + + ) + +1257 + #OBJ_ms_sgc + 1L,3L,6L,1L,4L,1L,311L,10L,3L,3L + + ) + +1259 + #SN_ms_efs + "msEFS" + + ) + +1260 + #LN_ms_efs + "Mi�oso� En�y�ed F��Sy�em" + + ) + +1261 + #NID_ms_efs + 138 + + ) + +1262 + #OBJ_ms_efs + 1L,3L,6L,1L,4L,1L,311L,10L,3L,4L + + ) + +1264 + #SN_ms_sm�t�rd_log� + "msSm�t�rdLog�" + + ) + +1265 + #LN_ms_sm�t�rd_log� + "Mi�oso� Sm�t�rdlog�" + + ) + +1266 + #NID_ms_sm�t�rd_log� + 648 + + ) + +1267 + #OBJ_ms_sm�t�rd_log� + 1L,3L,6L,1L,4L,1L,311L,20L,2L,2L + + ) + +1269 + #SN_ms_u� + "msUPN" + + ) + +1270 + #LN_ms_u� + "Mi�oso� Univ���Pr�c�� Name" + + ) + +1271 + #NID_ms_u� + 649 + + ) + +1272 + #OBJ_ms_u� + 1L,3L,6L,1L,4L,1L,311L,20L,2L,3L + + ) + +1274 + #SN_id�_cbc + "IDEA-CBC" + + ) + +1275 + #LN_id�_cbc + "id�-cbc" + + ) + +1276 + #NID_id�_cbc + 34 + + ) + +1277 + #OBJ_id�_cbc + 1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L + + ) + +1279 + #SN_id�_ecb + "IDEA-ECB" + + ) + +1280 + #LN_id�_ecb + "id�-ecb" + + ) + +1281 + #NID_id�_ecb + 36 + + ) + +1283 + #SN_id�_cfb64 + "IDEA-CFB" + + ) + +1284 + #LN_id�_cfb64 + "id�-cfb" + + ) + +1285 + #NID_id�_cfb64 + 35 + + ) + +1287 + #SN_id�_ofb64 + "IDEA-OFB" + + ) + +1288 + #LN_id�_ofb64 + "id�-ofb" + + ) + +1289 + #NID_id�_ofb64 + 46 + + ) + +1291 + #SN_bf_cbc + "BF-CBC" + + ) + +1292 + #LN_bf_cbc + "bf-cbc" + + ) + +1293 + #NID_bf_cbc + 91 + + ) + +1294 + #OBJ_bf_cbc + 1L,3L,6L,1L,4L,1L,3029L,1L,2L + + ) + +1296 + #SN_bf_ecb + "BF-ECB" + + ) + +1297 + #LN_bf_ecb + "bf-ecb" + + ) + +1298 + #NID_bf_ecb + 92 + + ) + +1300 + #SN_bf_cfb64 + "BF-CFB" + + ) + +1301 + #LN_bf_cfb64 + "bf-cfb" + + ) + +1302 + #NID_bf_cfb64 + 93 + + ) + +1304 + #SN_bf_ofb64 + "BF-OFB" + + ) + +1305 + #LN_bf_ofb64 + "bf-ofb" + + ) + +1306 + #NID_bf_ofb64 + 94 + + ) + +1308 + #SN_id_pkix + "PKIX" + + ) + +1309 + #NID_id_pkix + 127 + + ) + +1310 + #OBJ_id_pkix + 1L,3L,6L,1L,5L,5L,7L + + ) + +1312 + #SN_id_pkix_mod + "id-pkix-mod" + + ) + +1313 + #NID_id_pkix_mod + 258 + + ) + +1314 + #OBJ_id_pkix_mod + +OBJ_id_pkix +,0L + + ) + +1316 + #SN_id_� + "id-�" + + ) + +1317 + #NID_id_� + 175 + + ) + +1318 + #OBJ_id_� + +OBJ_id_pkix +,1L + + ) + +1320 + #SN_id_qt + "id-qt" + + ) + +1321 + #NID_id_qt + 259 + + ) + +1322 + #OBJ_id_qt + +OBJ_id_pkix +,2L + + ) + +1324 + #SN_id_kp + "id-kp" + + ) + +1325 + #NID_id_kp + 128 + + ) + +1326 + #OBJ_id_kp + +OBJ_id_pkix +,3L + + ) + +1328 + #SN_id_� + "id-�" + + ) + +1329 + #NID_id_� + 260 + + ) + +1330 + #OBJ_id_� + +OBJ_id_pkix +,4L + + ) + +1332 + #SN_id_pk� + "id-pk�" + + ) + +1333 + #NID_id_pk� + 261 + + ) + +1334 + #OBJ_id_pk� + +OBJ_id_pkix +,5L + + ) + +1336 + #SN_id_�g + "id-�g" + + ) + +1337 + #NID_id_�g + 262 + + ) + +1338 + #OBJ_id_�g + +OBJ_id_pkix +,6L + + ) + +1340 + #SN_id_cmc + "id-cmc" + + ) + +1341 + #NID_id_cmc + 263 + + ) + +1342 + #OBJ_id_cmc + +OBJ_id_pkix +,7L + + ) + +1344 + #SN_id_� + "id-�" + + ) + +1345 + #NID_id_� + 264 + + ) + +1346 + #OBJ_id_� + +OBJ_id_pkix +,8L + + ) + +1348 + #SN_id_pda + "id-pda" + + ) + +1349 + #NID_id_pda + 265 + + ) + +1350 + #OBJ_id_pda + +OBJ_id_pkix +,9L + + ) + +1352 + #SN_id_a� + "id-a�" + + ) + +1353 + #NID_id_a� + 266 + + ) + +1354 + #OBJ_id_a� + +OBJ_id_pkix +,10L + + ) + +1356 + #SN_id_qcs + "id-qcs" + + ) + +1357 + #NID_id_qcs + 267 + + ) + +1358 + #OBJ_id_qcs + +OBJ_id_pkix +,11L + + ) + +1360 + #SN_id_c� + "id-c�" + + ) + +1361 + #NID_id_c� + 268 + + ) + +1362 + #OBJ_id_c� + +OBJ_id_pkix +,12L + + ) + +1364 + #SN_id_�l + "id-�l" + + ) + +1365 + #NID_id_�l + 662 + + ) + +1366 + #OBJ_id_�l + +OBJ_id_pkix +,21L + + ) + +1368 + #SN_id_ad + "id-ad" + + ) + +1369 + #NID_id_ad + 176 + + ) + +1370 + #OBJ_id_ad + +OBJ_id_pkix +,48L + + ) + +1372 + #SN_id_pkix1_ex�ic�_88 + "id-pkix1-ex�ic�-88" + + ) + +1373 + #NID_id_pkix1_ex�ic�_88 + 269 + + ) + +1374 + #OBJ_id_pkix1_ex�ic�_88 + +OBJ_id_pkix_mod +,1L + + ) + +1376 + #SN_id_pkix1_im�ic�_88 + "id-pkix1-im�ic�-88" + + ) + +1377 + #NID_id_pkix1_im�ic�_88 + 270 + + ) + +1378 + #OBJ_id_pkix1_im�ic�_88 + +OBJ_id_pkix_mod +,2L + + ) + +1380 + #SN_id_pkix1_ex�ic�_93 + "id-pkix1-ex�ic�-93" + + ) + +1381 + #NID_id_pkix1_ex�ic�_93 + 271 + + ) + +1382 + #OBJ_id_pkix1_ex�ic�_93 + +OBJ_id_pkix_mod +,3L + + ) + +1384 + #SN_id_pkix1_im�ic�_93 + "id-pkix1-im�ic�-93" + + ) + +1385 + #NID_id_pkix1_im�ic�_93 + 272 + + ) + +1386 + #OBJ_id_pkix1_im�ic�_93 + +OBJ_id_pkix_mod +,4L + + ) + +1388 + #SN_id_mod_�mf + "id-mod-�mf" + + ) + +1389 + #NID_id_mod_�mf + 273 + + ) + +1390 + #OBJ_id_mod_�mf + +OBJ_id_pkix_mod +,5L + + ) + +1392 + #SN_id_mod_cmc + "id-mod-cmc" + + ) + +1393 + #NID_id_mod_cmc + 274 + + ) + +1394 + #OBJ_id_mod_cmc + +OBJ_id_pkix_mod +,6L + + ) + +1396 + #SN_id_mod_k�_�of�e_88 + "id-mod-k�-�of�e-88" + + ) + +1397 + #NID_id_mod_k�_�of�e_88 + 275 + + ) + +1398 + #OBJ_id_mod_k�_�of�e_88 + +OBJ_id_pkix_mod +,7L + + ) + +1400 + #SN_id_mod_k�_�of�e_93 + "id-mod-k�-�of�e-93" + + ) + +1401 + #NID_id_mod_k�_�of�e_93 + 276 + + ) + +1402 + #OBJ_id_mod_k�_�of�e_93 + +OBJ_id_pkix_mod +,8L + + ) + +1404 + #SN_id_mod_cmp + "id-mod-cmp" + + ) + +1405 + #NID_id_mod_cmp + 277 + + ) + +1406 + #OBJ_id_mod_cmp + +OBJ_id_pkix_mod +,9L + + ) + +1408 + #SN_id_mod_qu�if�d_��_88 + "id-mod-qu�if�d-��-88" + + ) + +1409 + #NID_id_mod_qu�if�d_��_88 + 278 + + ) + +1410 + #OBJ_id_mod_qu�if�d_��_88 + +OBJ_id_pkix_mod +,10L + + ) + +1412 + #SN_id_mod_qu�if�d_��_93 + "id-mod-qu�if�d-��-93" + + ) + +1413 + #NID_id_mod_qu�if�d_��_93 + 279 + + ) + +1414 + #OBJ_id_mod_qu�if�d_��_93 + +OBJ_id_pkix_mod +,11L + + ) + +1416 + #SN_id_mod_��ibu�_�� + "id-mod-��ibu�-��" + + ) + +1417 + #NID_id_mod_��ibu�_�� + 280 + + ) + +1418 + #OBJ_id_mod_��ibu�_�� + +OBJ_id_pkix_mod +,12L + + ) + +1420 + #SN_id_mod_time�amp_��oc� + "id-mod-time�amp-��oc�" + + ) + +1421 + #NID_id_mod_time�amp_��oc� + 281 + + ) + +1422 + #OBJ_id_mod_time�amp_��oc� + +OBJ_id_pkix_mod +,13L + + ) + +1424 + #SN_id_mod_oc� + "id-mod-oc�" + + ) + +1425 + #NID_id_mod_oc� + 282 + + ) + +1426 + #OBJ_id_mod_oc� + +OBJ_id_pkix_mod +,14L + + ) + +1428 + #SN_id_mod_dvcs + "id-mod-dvcs" + + ) + +1429 + #NID_id_mod_dvcs + 283 + + ) + +1430 + #OBJ_id_mod_dvcs + +OBJ_id_pkix_mod +,15L + + ) + +1432 + #SN_id_mod_cmp2000 + "id-mod-cmp2000" + + ) + +1433 + #NID_id_mod_cmp2000 + 284 + + ) + +1434 + #OBJ_id_mod_cmp2000 + +OBJ_id_pkix_mod +,16L + + ) + +1436 + #SN_�fo_ac�ss + "authܙyInfoAc�ss" + + ) + +1437 + #LN_�fo_ac�ss + "Authܙy Inf�m�i� Ac�ss" + + ) + +1438 + #NID_�fo_ac�ss + 177 + + ) + +1439 + #OBJ_�fo_ac�ss + +OBJ_id_� +,1L + + ) + +1441 + #SN_biom�ricInfo + "biom�ricInfo" + + ) + +1442 + #LN_biom�ricInfo + "Biom�ri�Info" + + ) + +1443 + #NID_biom�ricInfo + 285 + + ) + +1444 + #OBJ_biom�ricInfo + +OBJ_id_� +,2L + + ) + +1446 + #SN_qcS��m�ts + "qcS��m�ts" + + ) + +1447 + #NID_qcS��m�ts + 286 + + ) + +1448 + #OBJ_qcS��m�ts + +OBJ_id_� +,3L + + ) + +1450 + #SN_ac_aud�E��y + "ac-aud�E��y" + + ) + +1451 + #NID_ac_aud�E��y + 287 + + ) + +1452 + #OBJ_ac_aud�E��y + +OBJ_id_� +,4L + + ) + +1454 + #SN_ac_�rg��g + "ac-�rg��g" + + ) + +1455 + #NID_ac_�rg��g + 288 + + ) + +1456 + #OBJ_ac_�rg��g + +OBJ_id_� +,5L + + ) + +1458 + #SN_�Cڌ�s + "�Cڌ�s" + + ) + +1459 + #NID_�Cڌ�s + 289 + + ) + +1460 + #OBJ_�Cڌ�s + +OBJ_id_� +,6L + + ) + +1462 + #SN_sbgp_�AddrBlock + "sbgp-�AddrBlock" + + ) + +1463 + #NID_sbgp_�AddrBlock + 290 + + ) + +1464 + #OBJ_sbgp_�AddrBlock + +OBJ_id_� +,7L + + ) + +1466 + #SN_sbgp_aut�omousSysNum + "sbgp-aut�omousSysNum" + + ) + +1467 + #NID_sbgp_aut�omousSysNum + 291 + + ) + +1468 + #OBJ_sbgp_aut�omousSysNum + +OBJ_id_� +,8L + + ) + +1470 + #SN_sbgp_rou�rId�tif�r + "sbgp-rou�rId�tif�r" + + ) + +1471 + #NID_sbgp_rou�rId�tif�r + 292 + + ) + +1472 + #OBJ_sbgp_rou�rId�tif�r + +OBJ_id_� +,9L + + ) + +1474 + #SN_ac_�oxy�g + "ac-�oxy�g" + + ) + +1475 + #NID_ac_�oxy�g + 397 + + ) + +1476 + #OBJ_ac_�oxy�g + +OBJ_id_� +,10L + + ) + +1478 + #SN_s�fo_ac�ss + "subje�InfoAc�ss" + + ) + +1479 + #LN_s�fo_ac�ss + "Subje� Inf�m�i� Ac�ss" + + ) + +1480 + #NID_s�fo_ac�ss + 398 + + ) + +1481 + #OBJ_s�fo_ac�ss + +OBJ_id_� +,11L + + ) + +1483 + #SN_�oxyC�tInfo + "�oxyC�tInfo" + + ) + +1484 + #LN_�oxyC�tInfo + "Proxy C�tifi�� Inf�m�i�" + + ) + +1485 + #NID_�oxyC�tInfo + 663 + + ) + +1486 + #OBJ_�oxyC�tInfo + +OBJ_id_� +,14L + + ) + +1488 + #SN_id_qt_�s + "id-qt-�s" + + ) + +1489 + #LN_id_qt_�s + "P�icy Qu�if��CPS" + + ) + +1490 + #NID_id_qt_�s + 164 + + ) + +1491 + #OBJ_id_qt_�s + +OBJ_id_qt +,1L + + ) + +1493 + #SN_id_qt_un�i� + "id-qt-un�i�" + + ) + +1494 + #LN_id_qt_un�i� + "P�icy Qu�if��U��N�i�" + + ) + +1495 + #NID_id_qt_un�i� + 165 + + ) + +1496 + #OBJ_id_qt_un�i� + +OBJ_id_qt +,2L + + ) + +1498 + #SN_�xtN�i� + "�xtN�i�" + + ) + +1499 + #NID_�xtN�i� + 293 + + ) + +1500 + #OBJ_�xtN�i� + +OBJ_id_qt +,3L + + ) + +1502 + #SN_�rv�_auth + "�rv�Auth" + + ) + +1503 + #LN_�rv�_auth + "TLS Web S�v� Auth�ti�ti�" + + ) + +1504 + #NID_�rv�_auth + 129 + + ) + +1505 + #OBJ_�rv�_auth + +OBJ_id_kp +,1L + + ) + +1507 + #SN_���_auth + "���Auth" + + ) + +1508 + #LN_���_auth + "TLS Web Cl�� Auth�ti�ti�" + + ) + +1509 + #NID_���_auth + 130 + + ) + +1510 + #OBJ_���_auth + +OBJ_id_kp +,2L + + ) + +1512 + #SN_code_sign + "codeSign�g" + + ) + +1513 + #LN_code_sign + "Cod�Sign�g" + + ) + +1514 + #NID_code_sign + 131 + + ) + +1515 + #OBJ_code_sign + +OBJ_id_kp +,3L + + ) + +1517 + #SN_ema�_��e� + "ema�Pr�e�i�" + + ) + +1518 + #LN_ema�_��e� + "E-ma� Pr�e�i�" + + ) + +1519 + #NID_ema�_��e� + 132 + + ) + +1520 + #OBJ_ema�_��e� + +OBJ_id_kp +,4L + + ) + +1522 + #SN_��cEndSy�em + "��cEndSy�em" + + ) + +1523 + #LN_��cEndSy�em + "IPSe�End Sy�em" + + ) + +1524 + #NID_��cEndSy�em + 294 + + ) + +1525 + #OBJ_��cEndSy�em + +OBJ_id_kp +,5L + + ) + +1527 + #SN_��cTu + "��cTu" + + ) + +1528 + #LN_��cTu + "IPSe�Tu" + + ) + +1529 + #NID_��cTu + 295 + + ) + +1530 + #OBJ_��cTu + +OBJ_id_kp +,6L + + ) + +1532 + #SN_��cU�r + "��cU�r" + + ) + +1533 + #LN_��cU�r + "IPSe�U�r" + + ) + +1534 + #NID_��cU�r + 296 + + ) + +1535 + #OBJ_��cU�r + +OBJ_id_kp +,7L + + ) + +1537 + #SN_time_�amp + "timeS�mp�g" + + ) + +1538 + #LN_time_�amp + "Tim�S�mp�g" + + ) + +1539 + #NID_time_�amp + 133 + + ) + +1540 + #OBJ_time_�amp + +OBJ_id_kp +,8L + + ) + +1542 + #SN_OCSP_sign + "OCSPSign�g" + + ) + +1543 + #LN_OCSP_sign + "OCSP Sign�g" + + ) + +1544 + #NID_OCSP_sign + 180 + + ) + +1545 + #OBJ_OCSP_sign + +OBJ_id_kp +,9L + + ) + +1547 + #SN_dvcs + "DVCS" + + ) + +1548 + #LN_dvcs + "dvcs" + + ) + +1549 + #NID_dvcs + 297 + + ) + +1550 + #OBJ_dvcs + +OBJ_id_kp +,10L + + ) + +1552 + #SN_id_�_�Pr�EncC�t + "id-�-�Pr�EncC�t" + + ) + +1553 + #NID_id_�_�Pr�EncC�t + 298 + + ) + +1554 + #OBJ_id_�_�Pr�EncC�t + +OBJ_id_� +,1L + + ) + +1556 + #SN_id_�_signKeyPa�Ty�s + "id-�-signKeyPa�Ty�s" + + ) + +1557 + #NID_id_�_signKeyPa�Ty�s + 299 + + ) + +1558 + #OBJ_id_�_signKeyPa�Ty�s + +OBJ_id_� +,2L + + ) + +1560 + #SN_id_�_�cKeyPa�Ty�s + "id-�-�cKeyPa�Ty�s" + + ) + +1561 + #NID_id_�_�cKeyPa�Ty�s + 300 + + ) + +1562 + #OBJ_id_�_�cKeyPa�Ty�s + +OBJ_id_� +,3L + + ) + +1564 + #SN_id_�_�e�edSymmAlg + "id-�-�e�edSymmAlg" + + ) + +1565 + #NID_id_�_�e�edSymmAlg + 301 + + ) + +1566 + #OBJ_id_�_�e�edSymmAlg + +OBJ_id_� +,4L + + ) + +1568 + #SN_id_�_�KeyUpd�eInfo + "id-�-�KeyUpd�eInfo" + + ) + +1569 + #NID_id_�_�KeyUpd�eInfo + 302 + + ) + +1570 + #OBJ_id_�_�KeyUpd�eInfo + +OBJ_id_� +,5L + + ) + +1572 + #SN_id_�_cu��tCRL + "id-�-cu��tCRL" + + ) + +1573 + #NID_id_�_cu��tCRL + 303 + + ) + +1574 + #OBJ_id_�_cu��tCRL + +OBJ_id_� +,6L + + ) + +1576 + #SN_id_�_unsu�܋dOIDs + "id-�-unsu�܋dOIDs" + + ) + +1577 + #NID_id_�_unsu�܋dOIDs + 304 + + ) + +1578 + #OBJ_id_�_unsu�܋dOIDs + +OBJ_id_� +,7L + + ) + +1580 + #SN_id_�_subs��ti�Reque� + "id-�-subs��ti�Reque�" + + ) + +1581 + #NID_id_�_subs��ti�Reque� + 305 + + ) + +1582 + #OBJ_id_�_subs��ti�Reque� + +OBJ_id_� +,8L + + ) + +1584 + #SN_id_�_subs��ti�Re�ڣ + "id-�-subs��ti�Re�ڣ" + + ) + +1585 + #NID_id_�_subs��ti�Re�ڣ + 306 + + ) + +1586 + #OBJ_id_�_subs��ti�Re�ڣ + +OBJ_id_� +,9L + + ) + +1588 + #SN_id_�_keyPa�P�amReq + "id-�-keyPa�P�amReq" + + ) + +1589 + #NID_id_�_keyPa�P�amReq + 307 + + ) + +1590 + #OBJ_id_�_keyPa�P�amReq + +OBJ_id_� +,10L + + ) + +1592 + #SN_id_�_keyPa�P�amR� + "id-�-keyPa�P�amR�" + + ) + +1593 + #NID_id_�_keyPa�P�amR� + 308 + + ) + +1594 + #OBJ_id_�_keyPa�P�amR� + +OBJ_id_� +,11L + + ) + +1596 + #SN_id_�_�vPas�h�� + "id-�-�vPas�h��" + + ) + +1597 + #NID_id_�_�vPas�h�� + 309 + + ) + +1598 + #OBJ_id_�_�vPas�h�� + +OBJ_id_� +,12L + + ) + +1600 + #SN_id_�_im�ic�C�f�m + "id-�-im�ic�C�f�m" + + ) + +1601 + #NID_id_�_im�ic�C�f�m + 310 + + ) + +1602 + #OBJ_id_�_im�ic�C�f�m + +OBJ_id_� +,13L + + ) + +1604 + #SN_id_�_c�f�mWa�Time + "id-�-c�f�mWa�Time" + + ) + +1605 + #NID_id_�_c�f�mWa�Time + 311 + + ) + +1606 + #OBJ_id_�_c�f�mWa�Time + +OBJ_id_� +,14L + + ) + +1608 + #SN_id_�_�igPKIMes�ge + "id-�-�igPKIMes�ge" + + ) + +1609 + #NID_id_�_�igPKIMes�ge + 312 + + ) + +1610 + #OBJ_id_�_�igPKIMes�ge + +OBJ_id_� +,15L + + ) + +1612 + #SN_id_�_su�L�gTags + "id-�-su�L�gTags" + + ) + +1613 + #NID_id_�_su�L�gTags + 784 + + ) + +1614 + #OBJ_id_�_su�L�gTags + +OBJ_id_� +,16L + + ) + +1616 + #SN_id_�gC�l + "id-�gC�l" + + ) + +1617 + #NID_id_�gC�l + 313 + + ) + +1618 + #OBJ_id_�gC�l + +OBJ_id_pk� +,1L + + ) + +1620 + #SN_id_�gInfo + "id-�gInfo" + + ) + +1621 + #NID_id_�gInfo + 314 + + ) + +1622 + #OBJ_id_�gInfo + +OBJ_id_pk� +,2L + + ) + +1624 + #SN_id_�gC�l_�gTok� + "id-�gC�l-�gTok�" + + ) + +1625 + #NID_id_�gC�l_�gTok� + 315 + + ) + +1626 + #OBJ_id_�gC�l_�gTok� + +OBJ_id_�gC�l +,1L + + ) + +1628 + #SN_id_�gC�l_auth�ti�t� + "id-�gC�l-auth�ti�t�" + + ) + +1629 + #NID_id_�gC�l_auth�ti�t� + 316 + + ) + +1630 + #OBJ_id_�gC�l_auth�ti�t� + +OBJ_id_�gC�l +,2L + + ) + +1632 + #SN_id_�gC�l_pkiPubli�ti�Info + "id-�gC�l-pkiPubli�ti�Info" + + ) + +1633 + #NID_id_�gC�l_pkiPubli�ti�Info + 317 + + ) + +1634 + #OBJ_id_�gC�l_pkiPubli�ti�Info + +OBJ_id_�gC�l +,3L + + ) + +1636 + #SN_id_�gC�l_pkiArchiveO�i�s + "id-�gC�l-pkiArchiveO�i�s" + + ) + +1637 + #NID_id_�gC�l_pkiArchiveO�i�s + 318 + + ) + +1638 + #OBJ_id_�gC�l_pkiArchiveO�i�s + +OBJ_id_�gC�l +,4L + + ) + +1640 + #SN_id_�gC�l_�dC�tID + "id-�gC�l-�dC�tID" + + ) + +1641 + #NID_id_�gC�l_�dC�tID + 319 + + ) + +1642 + #OBJ_id_�gC�l_�dC�tID + +OBJ_id_�gC�l +,5L + + ) + +1644 + #SN_id_�gC�l_��oc�En�Key + "id-�gC�l-��oc�En�Key" + + ) + +1645 + #NID_id_�gC�l_��oc�En�Key + 320 + + ) + +1646 + #OBJ_id_�gC�l_��oc�En�Key + +OBJ_id_�gC�l +,6L + + ) + +1648 + #SN_id_�gInfo_utf8Pa�s + "id-�gInfo-utf8Pa�s" + + ) + +1649 + #NID_id_�gInfo_utf8Pa�s + 321 + + ) + +1650 + #OBJ_id_�gInfo_utf8Pa�s + +OBJ_id_�gInfo +,1L + + ) + +1652 + #SN_id_�gInfo_��Req + "id-�gInfo-��Req" + + ) + +1653 + #NID_id_�gInfo_��Req + 322 + + ) + +1654 + #OBJ_id_�gInfo_��Req + +OBJ_id_�gInfo +,2L + + ) + +1656 + #SN_id_�g_des40 + "id-�g-des40" + + ) + +1657 + #NID_id_�g_des40 + 323 + + ) + +1658 + #OBJ_id_�g_des40 + +OBJ_id_�g +,1L + + ) + +1660 + #SN_id_�g_noSig�tu� + "id-�g-noSig�tu�" + + ) + +1661 + #NID_id_�g_noSig�tu� + 324 + + ) + +1662 + #OBJ_id_�g_noSig�tu� + +OBJ_id_�g +,2L + + ) + +1664 + #SN_id_�g_dh_sig_hmac_sha1 + "id-�g-dh-sig-hmac-sha1" + + ) + +1665 + #NID_id_�g_dh_sig_hmac_sha1 + 325 + + ) + +1666 + #OBJ_id_�g_dh_sig_hmac_sha1 + +OBJ_id_�g +,3L + + ) + +1668 + #SN_id_�g_dh_p� + "id-�g-dh-p�" + + ) + +1669 + #NID_id_�g_dh_p� + 326 + + ) + +1670 + #OBJ_id_�g_dh_p� + +OBJ_id_�g +,4L + + ) + +1672 + #SN_id_cmc_��usInfo + "id-cmc-��usInfo" + + ) + +1673 + #NID_id_cmc_��usInfo + 327 + + ) + +1674 + #OBJ_id_cmc_��usInfo + +OBJ_id_cmc +,1L + + ) + +1676 + #SN_id_cmc_id�tifi�ti� + "id-cmc-id�tifi�ti�" + + ) + +1677 + #NID_id_cmc_id�tifi�ti� + 328 + + ) + +1678 + #OBJ_id_cmc_id�tifi�ti� + +OBJ_id_cmc +,2L + + ) + +1680 + #SN_id_cmc_id�t�yProof + "id-cmc-id�t�yProof" + + ) + +1681 + #NID_id_cmc_id�t�yProof + 329 + + ) + +1682 + #OBJ_id_cmc_id�t�yProof + +OBJ_id_cmc +,3L + + ) + +1684 + #SN_id_cmc_d�aR�u� + "id-cmc-d�aR�u�" + + ) + +1685 + #NID_id_cmc_d�aR�u� + 330 + + ) + +1686 + #OBJ_id_cmc_d�aR�u� + +OBJ_id_cmc +,4L + + ) + +1688 + #SN_id_cmc_����i�Id + "id-cmc-����i�Id" + + ) + +1689 + #NID_id_cmc_����i�Id + 331 + + ) + +1690 + #OBJ_id_cmc_����i�Id + +OBJ_id_cmc +,5L + + ) + +1692 + #SN_id_cmc_�nd�N�� + "id-cmc-�nd�N��" + + ) + +1693 + #NID_id_cmc_�nd�N�� + 332 + + ) + +1694 + #OBJ_id_cmc_�nd�N�� + +OBJ_id_cmc +,6L + + ) + +1696 + #SN_id_cmc_�c���N�� + "id-cmc-�c���N��" + + ) + +1697 + #NID_id_cmc_�c���N�� + 333 + + ) + +1698 + #OBJ_id_cmc_�c���N�� + +OBJ_id_cmc +,7L + + ) + +1700 + #SN_id_cmc_addEx�nsi�s + "id-cmc-addEx�nsi�s" + + ) + +1701 + #NID_id_cmc_addEx�nsi�s + 334 + + ) + +1702 + #OBJ_id_cmc_addEx�nsi�s + +OBJ_id_cmc +,8L + + ) + +1704 + #SN_id_cmc_��y�edPOP + "id-cmc-��y�edPOP" + + ) + +1705 + #NID_id_cmc_��y�edPOP + 335 + + ) + +1706 + #OBJ_id_cmc_��y�edPOP + +OBJ_id_cmc +,9L + + ) + +1708 + #SN_id_cmc_de�y�edPOP + "id-cmc-de�y�edPOP" + + ) + +1709 + #NID_id_cmc_de�y�edPOP + 336 + + ) + +1710 + #OBJ_id_cmc_de�y�edPOP + +OBJ_id_cmc +,10L + + ) + +1712 + #SN_id_cmc_�aPOPW��ss + "id-cmc-�aPOPW��ss" + + ) + +1713 + #NID_id_cmc_�aPOPW��ss + 337 + + ) + +1714 + #OBJ_id_cmc_�aPOPW��ss + +OBJ_id_cmc +,11L + + ) + +1716 + #SN_id_cmc_g�C�t + "id-cmc-g�C�t" + + ) + +1717 + #NID_id_cmc_g�C�t + 338 + + ) + +1718 + #OBJ_id_cmc_g�C�t + +OBJ_id_cmc +,15L + + ) + +1720 + #SN_id_cmc_g�CRL + "id-cmc-g�CRL" + + ) + +1721 + #NID_id_cmc_g�CRL + 339 + + ) + +1722 + #OBJ_id_cmc_g�CRL + +OBJ_id_cmc +,16L + + ) + +1724 + #SN_id_cmc_�vokeReque� + "id-cmc-�vokeReque�" + + ) + +1725 + #NID_id_cmc_�vokeReque� + 340 + + ) + +1726 + #OBJ_id_cmc_�vokeReque� + +OBJ_id_cmc +,17L + + ) + +1728 + #SN_id_cmc_�gInfo + "id-cmc-�gInfo" + + ) + +1729 + #NID_id_cmc_�gInfo + 341 + + ) + +1730 + #OBJ_id_cmc_�gInfo + +OBJ_id_cmc +,18L + + ) + +1732 + #SN_id_cmc_��ڣInfo + "id-cmc-��ڣInfo" + + ) + +1733 + #NID_id_cmc_��ڣInfo + 342 + + ) + +1734 + #OBJ_id_cmc_��ڣInfo + +OBJ_id_cmc +,19L + + ) + +1736 + #SN_id_cmc_qu�yP�d�g + "id-cmc-qu�yP�d�g" + + ) + +1737 + #NID_id_cmc_qu�yP�d�g + 343 + + ) + +1738 + #OBJ_id_cmc_qu�yP�d�g + +OBJ_id_cmc +,21L + + ) + +1740 + #SN_id_cmc_p�L�kR�dom + "id-cmc-p�L�kR�dom" + + ) + +1741 + #NID_id_cmc_p�L�kR�dom + 344 + + ) + +1742 + #OBJ_id_cmc_p�L�kR�dom + +OBJ_id_cmc +,22L + + ) + +1744 + #SN_id_cmc_p�L�kW��ss + "id-cmc-p�L�kW��ss" + + ) + +1745 + #NID_id_cmc_p�L�kW��ss + 345 + + ) + +1746 + #OBJ_id_cmc_p�L�kW��ss + +OBJ_id_cmc +,23L + + ) + +1748 + #SN_id_cmc_c�f�mC�tAc���� + "id-cmc-c�f�mC�tAc����" + + ) + +1749 + #NID_id_cmc_c�f�mC�tAc���� + 346 + + ) + +1750 + #OBJ_id_cmc_c�f�mC�tAc���� + +OBJ_id_cmc +,24L + + ) + +1752 + #SN_id_�_�rsڮD�a + "id-�-�rsڮD�a" + + ) + +1753 + #NID_id_�_�rsڮD�a + 347 + + ) + +1754 + #OBJ_id_�_�rsڮD�a + +OBJ_id_� +,1L + + ) + +1756 + #SN_id_�_�rm��tId�tif�r + "id-�-�rm��tId�tif�r" + + ) + +1757 + #LN_id_�_�rm��tId�tif�r + "P�m���Id�tif�r" + + ) + +1758 + #NID_id_�_�rm��tId�tif�r + 858 + + ) + +1759 + #OBJ_id_�_�rm��tId�tif�r + +OBJ_id_� +,3L + + ) + +1761 + #SN_id_pda_d�eOfB�th + "id-pda-d�eOfB�th" + + ) + +1762 + #NID_id_pda_d�eOfB�th + 348 + + ) + +1763 + #OBJ_id_pda_d�eOfB�th + +OBJ_id_pda +,1L + + ) + +1765 + #SN_id_pda_�a�OfB�th + "id-pda-�a�OfB�th" + + ) + +1766 + #NID_id_pda_�a�OfB�th + 349 + + ) + +1767 + #OBJ_id_pda_�a�OfB�th + +OBJ_id_pda +,2L + + ) + +1769 + #SN_id_pda_g�d� + "id-pda-g�d�" + + ) + +1770 + #NID_id_pda_g�d� + 351 + + ) + +1771 + #OBJ_id_pda_g�d� + +OBJ_id_pda +,3L + + ) + +1773 + #SN_id_pda_cou�ryOfC�iz�sh� + "id-pda-cou�ryOfC�iz�sh�" + + ) + +1774 + #NID_id_pda_cou�ryOfC�iz�sh� + 352 + + ) + +1775 + #OBJ_id_pda_cou�ryOfC�iz�sh� + +OBJ_id_pda +,4L + + ) + +1777 + #SN_id_pda_cou�ryOfResid�� + "id-pda-cou�ryOfResid��" + + ) + +1778 + #NID_id_pda_cou�ryOfResid�� + 353 + + ) + +1779 + #OBJ_id_pda_cou�ryOfResid�� + +OBJ_id_pda +,5L + + ) + +1781 + #SN_id_a�_auth�ti�ti�Info + "id-a�-auth�ti�ti�Info" + + ) + +1782 + #NID_id_a�_auth�ti�ti�Info + 354 + + ) + +1783 + #OBJ_id_a�_auth�ti�ti�Info + +OBJ_id_a� +,1L + + ) + +1785 + #SN_id_a�_ac�ssId�t�y + "id-a�-ac�ssId�t�y" + + ) + +1786 + #NID_id_a�_ac�ssId�t�y + 355 + + ) + +1787 + #OBJ_id_a�_ac�ssId�t�y + +OBJ_id_a� +,2L + + ) + +1789 + #SN_id_a�_ch�g�gId�t�y + "id-a�-ch�g�gId�t�y" + + ) + +1790 + #NID_id_a�_ch�g�gId�t�y + 356 + + ) + +1791 + #OBJ_id_a�_ch�g�gId�t�y + +OBJ_id_a� +,3L + + ) + +1793 + #SN_id_a�_group + "id-a�-group" + + ) + +1794 + #NID_id_a�_group + 357 + + ) + +1795 + #OBJ_id_a�_group + +OBJ_id_a� +,4L + + ) + +1797 + #SN_id_a�_r�e + "id-a�-r�e" + + ) + +1798 + #NID_id_a�_r�e + 358 + + ) + +1799 + #OBJ_id_a�_r�e + +OBJ_id_a� +,5L + + ) + +1801 + #SN_id_a�_�cA�rs + "id-a�-�cA�rs" + + ) + +1802 + #NID_id_a�_�cA�rs + 399 + + ) + +1803 + #OBJ_id_a�_�cA�rs + +OBJ_id_a� +,6L + + ) + +1805 + #SN_id_qcs_pkixQCSy�ax_v1 + "id-qcs-pkixQCSy�ax-v1" + + ) + +1806 + #NID_id_qcs_pkixQCSy�ax_v1 + 359 + + ) + +1807 + #OBJ_id_qcs_pkixQCSy�ax_v1 + +OBJ_id_qcs +,1L + + ) + +1809 + #SN_id_c�_�s + "id-c�-�s" + + ) + +1810 + #NID_id_c�_�s + 360 + + ) + +1811 + #OBJ_id_c�_�s + +OBJ_id_c� +,1L + + ) + +1813 + #SN_id_c�_PKID�a + "id-c�-PKID�a" + + ) + +1814 + #NID_id_c�_PKID�a + 361 + + ) + +1815 + #OBJ_id_c�_PKID�a + +OBJ_id_c� +,2L + + ) + +1817 + #SN_id_c�_PKIRe�ڣ + "id-c�-PKIRe�ڣ" + + ) + +1818 + #NID_id_c�_PKIRe�ڣ + 362 + + ) + +1819 + #OBJ_id_c�_PKIRe�ڣ + +OBJ_id_c� +,3L + + ) + +1821 + #SN_id_�l_�yL�guage + "id-�l-�yL�guage" + + ) + +1822 + #LN_id_�l_�yL�guage + "Any��guage" + + ) + +1823 + #NID_id_�l_�yL�guage + 664 + + ) + +1824 + #OBJ_id_�l_�yL�guage + +OBJ_id_�l +,0L + + ) + +1826 + #SN_id_�l_�h��A� + "id-�l-�h��A�" + + ) + +1827 + #LN_id_�l_�h��A� + "Inh����" + + ) + +1828 + #NID_id_�l_�h��A� + 665 + + ) + +1829 + #OBJ_id_�l_�h��A� + +OBJ_id_�l +,1L + + ) + +1831 + #SN_Ind��d�t + "id-�l-�d��d�t" + + ) + +1832 + #LN_Ind��d�t + "Ind��d�t" + + ) + +1833 + #NID_Ind��d�t + 667 + + ) + +1834 + #OBJ_Ind��d�t + +OBJ_id_�l +,2L + + ) + +1836 + #SN_ad_OCSP + "OCSP" + + ) + +1837 + #LN_ad_OCSP + "OCSP" + + ) + +1838 + #NID_ad_OCSP + 178 + + ) + +1839 + #OBJ_ad_OCSP + +OBJ_id_ad +,1L + + ) + +1841 + #SN_ad_�_issu�s + "�Issu�s" + + ) + +1842 + #LN_ad_�_issu�s + "CA Issu�s" + + ) + +1843 + #NID_ad_�_issu�s + 179 + + ) + +1844 + #OBJ_ad_�_issu�s + +OBJ_id_ad +,2L + + ) + +1846 + #SN_ad_timeS�mp�g + "ad_time�amp�g" + + ) + +1847 + #LN_ad_timeS�mp�g + "AD Tim�S�mp�g" + + ) + +1848 + #NID_ad_timeS�mp�g + 363 + + ) + +1849 + #OBJ_ad_timeS�mp�g + +OBJ_id_ad +,3L + + ) + +1851 + #SN_ad_dvcs + "AD_DVCS" + + ) + +1852 + #LN_ad_dvcs + "ad dvcs" + + ) + +1853 + #NID_ad_dvcs + 364 + + ) + +1854 + #OBJ_ad_dvcs + +OBJ_id_ad +,4L + + ) + +1856 + #SN_�R�os��y + "�R�os��y" + + ) + +1857 + #LN_�R�os��y + "CA R�os��y" + + ) + +1858 + #NID_�R�os��y + 785 + + ) + +1859 + #OBJ_�R�os��y + +OBJ_id_ad +,5L + + ) + +1861 + #OBJ_id_pkix_OCSP + +OBJ_ad_OCSP + + + ) + +1863 + #SN_id_pkix_OCSP_basic + "basicOCSPRe�ڣ" + + ) + +1864 + #LN_id_pkix_OCSP_basic + "Basi�OCSP Re�ڣ" + + ) + +1865 + #NID_id_pkix_OCSP_basic + 365 + + ) + +1866 + #OBJ_id_pkix_OCSP_basic + +OBJ_id_pkix_OCSP +,1L + + ) + +1868 + #SN_id_pkix_OCSP_N�� + "N��" + + ) + +1869 + #LN_id_pkix_OCSP_N�� + "OCSP N��" + + ) + +1870 + #NID_id_pkix_OCSP_N�� + 366 + + ) + +1871 + #OBJ_id_pkix_OCSP_N�� + +OBJ_id_pkix_OCSP +,2L + + ) + +1873 + #SN_id_pkix_OCSP_C�ID + "C�ID" + + ) + +1874 + #LN_id_pkix_OCSP_C�ID + "OCSP CRL ID" + + ) + +1875 + #NID_id_pkix_OCSP_C�ID + 367 + + ) + +1876 + #OBJ_id_pkix_OCSP_C�ID + +OBJ_id_pkix_OCSP +,3L + + ) + +1878 + #SN_id_pkix_OCSP_ac��ab�Re�ڣs + "ac��ab�Re�ڣs" + + ) + +1879 + #LN_id_pkix_OCSP_ac��ab�Re�ڣs + "Ac��ab� OCSP Re�ڣs" + + ) + +1880 + #NID_id_pkix_OCSP_ac��ab�Re�ڣs + 368 + + ) + +1881 + #OBJ_id_pkix_OCSP_ac��ab�Re�ڣs + +OBJ_id_pkix_OCSP +,4L + + ) + +1883 + #SN_id_pkix_OCSP_noCheck + "noCheck" + + ) + +1884 + #LN_id_pkix_OCSP_noCheck + "OCSP N�Check" + + ) + +1885 + #NID_id_pkix_OCSP_noCheck + 369 + + ) + +1886 + #OBJ_id_pkix_OCSP_noCheck + +OBJ_id_pkix_OCSP +,5L + + ) + +1888 + #SN_id_pkix_OCSP_�chiveCutoff + "�chiveCutoff" + + ) + +1889 + #LN_id_pkix_OCSP_�chiveCutoff + "OCSP Archiv�Cutoff" + + ) + +1890 + #NID_id_pkix_OCSP_�chiveCutoff + 370 + + ) + +1891 + #OBJ_id_pkix_OCSP_�chiveCutoff + +OBJ_id_pkix_OCSP +,6L + + ) + +1893 + #SN_id_pkix_OCSP_�rvi�Lo�t� + "�rvi�Lo�t�" + + ) + +1894 + #LN_id_pkix_OCSP_�rvi�Lo�t� + "OCSP S�vi� Lo�t�" + + ) + +1895 + #NID_id_pkix_OCSP_�rvi�Lo�t� + 371 + + ) + +1896 + #OBJ_id_pkix_OCSP_�rvi�Lo�t� + +OBJ_id_pkix_OCSP +,7L + + ) + +1898 + #SN_id_pkix_OCSP_ex�ndedS�tus + "ex�ndedS�tus" + + ) + +1899 + #LN_id_pkix_OCSP_ex�ndedS�tus + "Ex�nded OCSP S�tus" + + ) + +1900 + #NID_id_pkix_OCSP_ex�ndedS�tus + 372 + + ) + +1901 + #OBJ_id_pkix_OCSP_ex�ndedS�tus + +OBJ_id_pkix_OCSP +,8L + + ) + +1903 + #SN_id_pkix_OCSP_v�id + "v�id" + + ) + +1904 + #NID_id_pkix_OCSP_v�id + 373 + + ) + +1905 + #OBJ_id_pkix_OCSP_v�id + +OBJ_id_pkix_OCSP +,9L + + ) + +1907 + #SN_id_pkix_OCSP_�th + "�th" + + ) + +1908 + #NID_id_pkix_OCSP_�th + 374 + + ) + +1909 + #OBJ_id_pkix_OCSP_�th + +OBJ_id_pkix_OCSP +,10L + + ) + +1911 + #SN_id_pkix_OCSP_�u�Ro� + "�u�Ro�" + + ) + +1912 + #LN_id_pkix_OCSP_�u�Ro� + "Tru� Ro�" + + ) + +1913 + #NID_id_pkix_OCSP_�u�Ro� + 375 + + ) + +1914 + #OBJ_id_pkix_OCSP_�u�Ro� + +OBJ_id_pkix_OCSP +,11L + + ) + +1916 + #SN_�gܙhm + "�gܙhm" + + ) + +1917 + #LN_�gܙhm + "�gܙhm" + + ) + +1918 + #NID_�gܙhm + 376 + + ) + +1919 + #OBJ_�gܙhm + 1L,3L,14L,3L,2L + + ) + +1921 + #SN_md5W�hRSA + "RSA-NP-MD5" + + ) + +1922 + #LN_md5W�hRSA + "md5W�hRSA" + + ) + +1923 + #NID_md5W�hRSA + 104 + + ) + +1924 + #OBJ_md5W�hRSA + +OBJ_�gܙhm +,3L + + ) + +1926 + #SN_des_ecb + "DES-ECB" + + ) + +1927 + #LN_des_ecb + "des-ecb" + + ) + +1928 + #NID_des_ecb + 29 + + ) + +1929 + #OBJ_des_ecb + +OBJ_�gܙhm +,6L + + ) + +1931 + #SN_des_cbc + "DES-CBC" + + ) + +1932 + #LN_des_cbc + "des-cbc" + + ) + +1933 + #NID_des_cbc + 31 + + ) + +1934 + #OBJ_des_cbc + +OBJ_�gܙhm +,7L + + ) + +1936 + #SN_des_ofb64 + "DES-OFB" + + ) + +1937 + #LN_des_ofb64 + "des-ofb" + + ) + +1938 + #NID_des_ofb64 + 45 + + ) + +1939 + #OBJ_des_ofb64 + +OBJ_�gܙhm +,8L + + ) + +1941 + #SN_des_cfb64 + "DES-CFB" + + ) + +1942 + #LN_des_cfb64 + "des-cfb" + + ) + +1943 + #NID_des_cfb64 + 30 + + ) + +1944 + #OBJ_des_cfb64 + +OBJ_�gܙhm +,9L + + ) + +1946 + #SN_r�Sig�tu� + "r�Sig�tu�" + + ) + +1947 + #NID_r�Sig�tu� + 377 + + ) + +1948 + #OBJ_r�Sig�tu� + +OBJ_�gܙhm +,11L + + ) + +1950 + #SN_d�_2 + "DSA-�d" + + ) + +1951 + #LN_d�_2 + "d�En�y�i�-�d" + + ) + +1952 + #NID_d�_2 + 67 + + ) + +1953 + #OBJ_d�_2 + +OBJ_�gܙhm +,12L + + ) + +1955 + #SN_d�W�hSHA + "DSA-SHA" + + ) + +1956 + #LN_d�W�hSHA + "d�W�hSHA" + + ) + +1957 + #NID_d�W�hSHA + 66 + + ) + +1958 + #OBJ_d�W�hSHA + +OBJ_�gܙhm +,13L + + ) + +1960 + #SN_shaW�hRSAEn�y�i� + "RSA-SHA" + + ) + +1961 + #LN_shaW�hRSAEn�y�i� + "shaW�hRSAEn�y�i�" + + ) + +1962 + #NID_shaW�hRSAEn�y�i� + 42 + + ) + +1963 + #OBJ_shaW�hRSAEn�y�i� + +OBJ_�gܙhm +,15L + + ) + +1965 + #SN_des_ede_ecb + "DES-EDE" + + ) + +1966 + #LN_des_ede_ecb + "des-ede" + + ) + +1967 + #NID_des_ede_ecb + 32 + + ) + +1968 + #OBJ_des_ede_ecb + +OBJ_�gܙhm +,17L + + ) + +1970 + #SN_des_ede3_ecb + "DES-EDE3" + + ) + +1971 + #LN_des_ede3_ecb + "des-ede3" + + ) + +1972 + #NID_des_ede3_ecb + 33 + + ) + +1974 + #SN_des_ede_cbc + "DES-EDE-CBC" + + ) + +1975 + #LN_des_ede_cbc + "des-ede-cbc" + + ) + +1976 + #NID_des_ede_cbc + 43 + + ) + +1978 + #SN_des_ede_cfb64 + "DES-EDE-CFB" + + ) + +1979 + #LN_des_ede_cfb64 + "des-ede-cfb" + + ) + +1980 + #NID_des_ede_cfb64 + 60 + + ) + +1982 + #SN_des_ede3_cfb64 + "DES-EDE3-CFB" + + ) + +1983 + #LN_des_ede3_cfb64 + "des-ede3-cfb" + + ) + +1984 + #NID_des_ede3_cfb64 + 61 + + ) + +1986 + #SN_des_ede_ofb64 + "DES-EDE-OFB" + + ) + +1987 + #LN_des_ede_ofb64 + "des-ede-ofb" + + ) + +1988 + #NID_des_ede_ofb64 + 62 + + ) + +1990 + #SN_des_ede3_ofb64 + "DES-EDE3-OFB" + + ) + +1991 + #LN_des_ede3_ofb64 + "des-ede3-ofb" + + ) + +1992 + #NID_des_ede3_ofb64 + 63 + + ) + +1994 + #SN_desx_cbc + "DESX-CBC" + + ) + +1995 + #LN_desx_cbc + "desx-cbc" + + ) + +1996 + #NID_desx_cbc + 80 + + ) + +1998 + #SN_sha + "SHA" + + ) + +1999 + #LN_sha + "sha" + + ) + +2000 + #NID_sha + 41 + + ) + +2001 + #OBJ_sha + +OBJ_�gܙhm +,18L + + ) + +2003 + #SN_sha1 + "SHA1" + + ) + +2004 + #LN_sha1 + "sha1" + + ) + +2005 + #NID_sha1 + 64 + + ) + +2006 + #OBJ_sha1 + +OBJ_�gܙhm +,26L + + ) + +2008 + #SN_d�W�hSHA1_2 + "DSA-SHA1-�d" + + ) + +2009 + #LN_d�W�hSHA1_2 + "d�W�hSHA1-�d" + + ) + +2010 + #NID_d�W�hSHA1_2 + 70 + + ) + +2011 + #OBJ_d�W�hSHA1_2 + +OBJ_�gܙhm +,27L + + ) + +2013 + #SN_sha1W�hRSA + "RSA-SHA1-2" + + ) + +2014 + #LN_sha1W�hRSA + "sha1W�hRSA" + + ) + +2015 + #NID_sha1W�hRSA + 115 + + ) + +2016 + #OBJ_sha1W�hRSA + +OBJ_�gܙhm +,29L + + ) + +2018 + #SN_r�emd160 + "RIPEMD160" + + ) + +2019 + #LN_r�emd160 + "r�emd160" + + ) + +2020 + #NID_r�emd160 + 117 + + ) + +2021 + #OBJ_r�emd160 + 1L,3L,36L,3L,2L,1L + + ) + +2023 + #SN_r�emd160W�hRSA + "RSA-RIPEMD160" + + ) + +2024 + #LN_r�emd160W�hRSA + "r�emd160W�hRSA" + + ) + +2025 + #NID_r�emd160W�hRSA + 119 + + ) + +2026 + #OBJ_r�emd160W�hRSA + 1L,3L,36L,3L,3L,1L,2L + + ) + +2028 + #SN_sx�t + "SXN�ID" + + ) + +2029 + #LN_sx�t + "S��g Ex��� ID" + + ) + +2030 + #NID_sx�t + 143 + + ) + +2031 + #OBJ_sx�t + 1L,3L,101L,1L,4L,1L + + ) + +2033 + #SN_X500 + "X500" + + ) + +2034 + #LN_X500 + "d�e��y s�vi��(X.500)" + + ) + +2035 + #NID_X500 + 11 + + ) + +2036 + #OBJ_X500 + 2L,5L + + ) + +2038 + #SN_X509 + "X509" + + ) + +2039 + #NID_X509 + 12 + + ) + +2040 + #OBJ_X509 + +OBJ_X500 +,4L + + ) + +2042 + #SN_comm�Name + "CN" + + ) + +2043 + #LN_comm�Name + "comm�Name" + + ) + +2044 + #NID_comm�Name + 13 + + ) + +2045 + #OBJ_comm�Name + +OBJ_X509 +,3L + + ) + +2047 + #SN_su�ame + "SN" + + ) + +2048 + #LN_su�ame + "su�ame" + + ) + +2049 + #NID_su�ame + 100 + + ) + +2050 + #OBJ_su�ame + +OBJ_X509 +,4L + + ) + +2052 + #LN_�r�lNumb� + "�r�lNumb�" + + ) + +2053 + #NID_�r�lNumb� + 105 + + ) + +2054 + #OBJ_�r�lNumb� + +OBJ_X509 +,5L + + ) + +2056 + #SN_cou�ryName + "C" + + ) + +2057 + #LN_cou�ryName + "cou�ryName" + + ) + +2058 + #NID_cou�ryName + 14 + + ) + +2059 + #OBJ_cou�ryName + +OBJ_X509 +,6L + + ) + +2061 + #SN_lo�l�yName + "L" + + ) + +2062 + #LN_lo�l�yName + "lo�l�yName" + + ) + +2063 + #NID_lo�l�yName + 15 + + ) + +2064 + #OBJ_lo�l�yName + +OBJ_X509 +,7L + + ) + +2066 + #SN_��eOrProv��Name + "ST" + + ) + +2067 + #LN_��eOrProv��Name + "��eOrProv��Name" + + ) + +2068 + #NID_��eOrProv��Name + 16 + + ) + +2069 + #OBJ_��eOrProv��Name + +OBJ_X509 +,8L + + ) + +2071 + #SN_���Add�ss + "���" + + ) + +2072 + #LN_���Add�ss + "���Add�ss" + + ) + +2073 + #NID_���Add�ss + 660 + + ) + +2074 + #OBJ_���Add�ss + +OBJ_X509 +,9L + + ) + +2076 + #SN_�g�iz�i�Name + "O" + + ) + +2077 + #LN_�g�iz�i�Name + "�g�iz�i�Name" + + ) + +2078 + #NID_�g�iz�i�Name + 17 + + ) + +2079 + #OBJ_�g�iz�i�Name + +OBJ_X509 +,10L + + ) + +2081 + #SN_�g�iz�iڮUn�Name + "OU" + + ) + +2082 + #LN_�g�iz�iڮUn�Name + "�g�iz�iڮUn�Name" + + ) + +2083 + #NID_�g�iz�iڮUn�Name + 18 + + ) + +2084 + #OBJ_�g�iz�iڮUn�Name + +OBJ_X509 +,11L + + ) + +2086 + #SN_t�� + "t��" + + ) + +2087 + #LN_t�� + "t��" + + ) + +2088 + #NID_t�� + 106 + + ) + +2089 + #OBJ_t�� + +OBJ_X509 +,12L + + ) + +2091 + #LN_des��ti� + "des��ti�" + + ) + +2092 + #NID_des��ti� + 107 + + ) + +2093 + #OBJ_des��ti� + +OBJ_X509 +,13L + + ) + +2095 + #LN_��chGuide + "��chGuide" + + ) + +2096 + #NID_��chGuide + 859 + + ) + +2097 + #OBJ_��chGuide + +OBJ_X509 +,14L + + ) + +2099 + #LN_bus�essC�eg�y + "bus�essC�eg�y" + + ) + +2100 + #NID_bus�essC�eg�y + 860 + + ) + +2101 + #OBJ_bus�essC�eg�y + +OBJ_X509 +,15L + + ) + +2103 + #LN_po��Add�ss + "po��Add�ss" + + ) + +2104 + #NID_po��Add�ss + 861 + + ) + +2105 + #OBJ_po��Add�ss + +OBJ_X509 +,16L + + ) + +2107 + #LN_po��Code + "po��Code" + + ) + +2108 + #NID_po��Code + 661 + + ) + +2109 + #OBJ_po��Code + +OBJ_X509 +,17L + + ) + +2111 + #LN_po�Offi�Box + "po�Offi�Box" + + ) + +2112 + #NID_po�Offi�Box + 862 + + ) + +2113 + #OBJ_po�Offi�Box + +OBJ_X509 +,18L + + ) + +2115 + #LN_physi�lD�iv�yOffi�Name + "physi�lD�iv�yOffi�Name" + + ) + +2116 + #NID_physi�lD�iv�yOffi�Name + 863 + + ) + +2117 + #OBJ_physi�lD�iv�yOffi�Name + +OBJ_X509 +,19L + + ) + +2119 + #LN_��ph�eNumb� + "��ph�eNumb�" + + ) + +2120 + #NID_��ph�eNumb� + 864 + + ) + +2121 + #OBJ_��ph�eNumb� + +OBJ_X509 +,20L + + ) + +2123 + #LN_��xNumb� + "��xNumb�" + + ) + +2124 + #NID_��xNumb� + 865 + + ) + +2125 + #OBJ_��xNumb� + +OBJ_X509 +,21L + + ) + +2127 + #LN_�ˋxT�m��Id�tif�r + "�ˋxT�m��Id�tif�r" + + ) + +2128 + #NID_�ˋxT�m��Id�tif�r + 866 + + ) + +2129 + #OBJ_�ˋxT�m��Id�tif�r + +OBJ_X509 +,22L + + ) + +2131 + #LN_�csim�eT��h�eNumb� + "�csim�eT��h�eNumb�" + + ) + +2132 + #NID_�csim�eT��h�eNumb� + 867 + + ) + +2133 + #OBJ_�csim�eT��h�eNumb� + +OBJ_X509 +,23L + + ) + +2135 + #LN_x121Add�ss + "x121Add�ss" + + ) + +2136 + #NID_x121Add�ss + 868 + + ) + +2137 + #OBJ_x121Add�ss + +OBJ_X509 +,24L + + ) + +2139 + #LN_����iڮiSDNNumb� + "����iڮiSDNNumb�" + + ) + +2140 + #NID_����iڮiSDNNumb� + 869 + + ) + +2141 + #OBJ_����iڮiSDNNumb� + +OBJ_X509 +,25L + + ) + +2143 + #LN_�gi��edAdd�ss + "�gi��edAdd�ss" + + ) + +2144 + #NID_�gi��edAdd�ss + 870 + + ) + +2145 + #OBJ_�gi��edAdd�ss + +OBJ_X509 +,26L + + ) + +2147 + #LN_de���i�Indi�t� + "de���i�Indi�t�" + + ) + +2148 + #NID_de���i�Indi�t� + 871 + + ) + +2149 + #OBJ_de���i�Indi�t� + +OBJ_X509 +,27L + + ) + +2151 + #LN_�e�edD�iv�yM�hod + "�e�edD�iv�yM�hod" + + ) + +2152 + #NID_�e�edD�iv�yM�hod + 872 + + ) + +2153 + #OBJ_�e�edD�iv�yM�hod + +OBJ_X509 +,28L + + ) + +2155 + #LN_�e���i�Add�ss + "�e���i�Add�ss" + + ) + +2156 + #NID_�e���i�Add�ss + 873 + + ) + +2157 + #OBJ_�e���i�Add�ss + +OBJ_X509 +,29L + + ) + +2159 + #LN_su�܋dA�li�ti�Cڋxt + "su�܋dA�li�ti�Cڋxt" + + ) + +2160 + #NID_su�܋dA�li�ti�Cڋxt + 874 + + ) + +2161 + #OBJ_su�܋dA�li�ti�Cڋxt + +OBJ_X509 +,30L + + ) + +2163 + #SN_memb� + "memb�" + + ) + +2164 + #NID_memb� + 875 + + ) + +2165 + #OBJ_memb� + +OBJ_X509 +,31L + + ) + +2167 + #SN_ow�r + "ow�r" + + ) + +2168 + #NID_ow�r + 876 + + ) + +2169 + #OBJ_ow�r + +OBJ_X509 +,32L + + ) + +2171 + #LN_r�eOccu�� + "r�eOccu��" + + ) + +2172 + #NID_r�eOccu�� + 877 + + ) + +2173 + #OBJ_r�eOccu�� + +OBJ_X509 +,33L + + ) + +2175 + #SN_�eAlso + "�eAlso" + + ) + +2176 + #NID_�eAlso + 878 + + ) + +2177 + #OBJ_�eAlso + +OBJ_X509 +,34L + + ) + +2179 + #LN_u�rPassw�d + "u�rPassw�d" + + ) + +2180 + #NID_u�rPassw�d + 879 + + ) + +2181 + #OBJ_u�rPassw�d + +OBJ_X509 +,35L + + ) + +2183 + #LN_u�rC�tifi�� + "u�rC�tifi��" + + ) + +2184 + #NID_u�rC�tifi�� + 880 + + ) + +2185 + #OBJ_u�rC�tifi�� + +OBJ_X509 +,36L + + ) + +2187 + #LN_cAC�tifi�� + "cAC�tifi��" + + ) + +2188 + #NID_cAC�tifi�� + 881 + + ) + +2189 + #OBJ_cAC�tifi�� + +OBJ_X509 +,37L + + ) + +2191 + #LN_authܙyRevo�ti�Li� + "authܙyRevo�ti�Li�" + + ) + +2192 + #NID_authܙyRevo�ti�Li� + 882 + + ) + +2193 + #OBJ_authܙyRevo�ti�Li� + +OBJ_X509 +,38L + + ) + +2195 + #LN_��ifi��Revo�ti�Li� + "��ifi��Revo�ti�Li�" + + ) + +2196 + #NID_��ifi��Revo�ti�Li� + 883 + + ) + +2197 + #OBJ_��ifi��Revo�ti�Li� + +OBJ_X509 +,39L + + ) + +2199 + #LN_�ossC�tifi��Pa� + "�ossC�tifi��Pa�" + + ) + +2200 + #NID_�ossC�tifi��Pa� + 884 + + ) + +2201 + #OBJ_�ossC�tifi��Pa� + +OBJ_X509 +,40L + + ) + +2203 + #SN_�me + "�me" + + ) + +2204 + #LN_�me + "�me" + + ) + +2205 + #NID_�me + 173 + + ) + +2206 + #OBJ_�me + +OBJ_X509 +,41L + + ) + +2208 + #SN_giv�Name + "GN" + + ) + +2209 + #LN_giv�Name + "giv�Name" + + ) + +2210 + #NID_giv�Name + 99 + + ) + +2211 + #OBJ_giv�Name + +OBJ_X509 +,42L + + ) + +2213 + #SN_���ls + "���ls" + + ) + +2214 + #LN_���ls + "���ls" + + ) + +2215 + #NID_���ls + 101 + + ) + +2216 + #OBJ_���ls + +OBJ_X509 +,43L + + ) + +2218 + #LN_g���i�Qu�if�r + "g���i�Qu�if�r" + + ) + +2219 + #NID_g���i�Qu�if�r + 509 + + ) + +2220 + #OBJ_g���i�Qu�if�r + +OBJ_X509 +,44L + + ) + +2222 + #LN_x500UniqueId�tif�r + "x500UniqueId�tif�r" + + ) + +2223 + #NID_x500UniqueId�tif�r + 503 + + ) + +2224 + #OBJ_x500UniqueId�tif�r + +OBJ_X509 +,45L + + ) + +2226 + #SN_dnQu�if�r + "dnQu�if�r" + + ) + +2227 + #LN_dnQu�if�r + "dnQu�if�r" + + ) + +2228 + #NID_dnQu�if�r + 174 + + ) + +2229 + #OBJ_dnQu�if�r + +OBJ_X509 +,46L + + ) + +2231 + #LN_�h��dS�rchGuide + "�h��dS�rchGuide" + + ) + +2232 + #NID_�h��dS�rchGuide + 885 + + ) + +2233 + #OBJ_�h��dS�rchGuide + +OBJ_X509 +,47L + + ) + +2235 + #LN_��oc�Inf�m�i� + "��oc�Inf�m�i�" + + ) + +2236 + #NID_��oc�Inf�m�i� + 886 + + ) + +2237 + #OBJ_��oc�Inf�m�i� + +OBJ_X509 +,48L + + ) + +2239 + #LN_di��guishedName + "di��guishedName" + + ) + +2240 + #NID_di��guishedName + 887 + + ) + +2241 + #OBJ_di��guishedName + +OBJ_X509 +,49L + + ) + +2243 + #LN_uniqueMemb� + "uniqueMemb�" + + ) + +2244 + #NID_uniqueMemb� + 888 + + ) + +2245 + #OBJ_uniqueMemb� + +OBJ_X509 +,50L + + ) + +2247 + #LN_hou�Id�tif�r + "hou�Id�tif�r" + + ) + +2248 + #NID_hou�Id�tif�r + 889 + + ) + +2249 + #OBJ_hou�Id�tif�r + +OBJ_X509 +,51L + + ) + +2251 + #LN_su�܋dAlgܙhms + "su�܋dAlgܙhms" + + ) + +2252 + #NID_su�܋dAlgܙhms + 890 + + ) + +2253 + #OBJ_su�܋dAlgܙhms + +OBJ_X509 +,52L + + ) + +2255 + #LN_d��Revo�ti�Li� + "d��Revo�ti�Li�" + + ) + +2256 + #NID_d��Revo�ti�Li� + 891 + + ) + +2257 + #OBJ_d��Revo�ti�Li� + +OBJ_X509 +,53L + + ) + +2259 + #SN_dmdName + "dmdName" + + ) + +2260 + #NID_dmdName + 892 + + ) + +2261 + #OBJ_dmdName + +OBJ_X509 +,54L + + ) + +2263 + #LN_p�ud�ym + "p�ud�ym" + + ) + +2264 + #NID_p�ud�ym + 510 + + ) + +2265 + #OBJ_p�ud�ym + +OBJ_X509 +,65L + + ) + +2267 + #SN_r�e + "r�e" + + ) + +2268 + #LN_r�e + "r�e" + + ) + +2269 + #NID_r�e + 400 + + ) + +2270 + #OBJ_r�e + +OBJ_X509 +,72L + + ) + +2272 + #SN_X500�gܙhms + "X500�gܙhms" + + ) + +2273 + #LN_X500�gܙhms + "d�e��y s�vi��-�lgܙhms" + + ) + +2274 + #NID_X500�gܙhms + 378 + + ) + +2275 + #OBJ_X500�gܙhms + +OBJ_X500 +,8L + + ) + +2277 + #SN_r� + "RSA" + + ) + +2278 + #LN_r� + "r�" + + ) + +2279 + #NID_r� + 19 + + ) + +2280 + #OBJ_r� + +OBJ_X500�gܙhms +,1L,1L + + ) + +2282 + #SN_mdc2W�hRSA + "RSA-MDC2" + + ) + +2283 + #LN_mdc2W�hRSA + "mdc2W�hRSA" + + ) + +2284 + #NID_mdc2W�hRSA + 96 + + ) + +2285 + #OBJ_mdc2W�hRSA + +OBJ_X500�gܙhms +,3L,100L + + ) + +2287 + #SN_mdc2 + "MDC2" + + ) + +2288 + #LN_mdc2 + "mdc2" + + ) + +2289 + #NID_mdc2 + 95 + + ) + +2290 + #OBJ_mdc2 + +OBJ_X500�gܙhms +,3L,101L + + ) + +2292 + #SN_id_� + "id-�" + + ) + +2293 + #NID_id_� + 81 + + ) + +2294 + #OBJ_id_� + +OBJ_X500 +,29L + + ) + +2296 + #SN_subje�_d�e��y_��ibu�s + "subje�D�e��yA�ribu�s" + + ) + +2297 + #LN_subje�_d�e��y_��ibu�s + "X509v3 Subje� D�e��y A�ribu�s" + + ) + +2298 + #NID_subje�_d�e��y_��ibu�s + 769 + + ) + +2299 + #OBJ_subje�_d�e��y_��ibu�s + +OBJ_id_� +,9L + + ) + +2301 + #SN_subje�_key_id�tif�r + "subje�KeyId�tif�r" + + ) + +2302 + #LN_subje�_key_id�tif�r + "X509v3 Subje� Key Id�tif�r" + + ) + +2303 + #NID_subje�_key_id�tif�r + 82 + + ) + +2304 + #OBJ_subje�_key_id�tif�r + +OBJ_id_� +,14L + + ) + +2306 + #SN_key_u�ge + "keyU�ge" + + ) + +2307 + #LN_key_u�ge + "X509v3 Key U�ge" + + ) + +2308 + #NID_key_u�ge + 83 + + ) + +2309 + #OBJ_key_u�ge + +OBJ_id_� +,15L + + ) + +2311 + #SN_�iv�e_key_u�ge_�riod + "�iv�eKeyU�geP�iod" + + ) + +2312 + #LN_�iv�e_key_u�ge_�riod + "X509v3 Priv��Key U�g�P�iod" + + ) + +2313 + #NID_�iv�e_key_u�ge_�riod + 84 + + ) + +2314 + #OBJ_�iv�e_key_u�ge_�riod + +OBJ_id_� +,16L + + ) + +2316 + #SN_subje�_�t_�me + "subje�A�Name" + + ) + +2317 + #LN_subje�_�t_�me + "X509v3 Subje� Aɔ�tiv�Name" + + ) + +2318 + #NID_subje�_�t_�me + 85 + + ) + +2319 + #OBJ_subje�_�t_�me + +OBJ_id_� +,17L + + ) + +2321 + #SN_issu�_�t_�me + "issu�A�Name" + + ) + +2322 + #LN_issu�_�t_�me + "X509v3 Issu� Aɔ�tiv�Name" + + ) + +2323 + #NID_issu�_�t_�me + 86 + + ) + +2324 + #OBJ_issu�_�t_�me + +OBJ_id_� +,18L + + ) + +2326 + #SN_basic_cڡ��ts + "basicCڡ��ts" + + ) + +2327 + #LN_basic_cڡ��ts + "X509v3 Basi�Cڡ��ts" + + ) + +2328 + #NID_basic_cڡ��ts + 87 + + ) + +2329 + #OBJ_basic_cڡ��ts + +OBJ_id_� +,19L + + ) + +2331 + #SN_�l_numb� + "�lNumb�" + + ) + +2332 + #LN_�l_numb� + "X509v3 CRL Numb�" + + ) + +2333 + #NID_�l_numb� + 88 + + ) + +2334 + #OBJ_�l_numb� + +OBJ_id_� +,20L + + ) + +2336 + #SN_�l_�as� + "CRLR�s�" + + ) + +2337 + #LN_�l_�as� + "X509v3 CRL R�s� Code" + + ) + +2338 + #NID_�l_�as� + 141 + + ) + +2339 + #OBJ_�l_�as� + +OBJ_id_� +,21L + + ) + +2341 + #SN_�v�id�y_d�e + "�v�id�yD�e" + + ) + +2342 + #LN_�v�id�y_d�e + "Inv�id�y D�e" + + ) + +2343 + #NID_�v�id�y_d�e + 142 + + ) + +2344 + #OBJ_�v�id�y_d�e + +OBJ_id_� +,24L + + ) + +2346 + #SN_d��_�l + "d��CRL" + + ) + +2347 + #LN_d��_�l + "X509v3 D�� CRL Indi�t�" + + ) + +2348 + #NID_d��_�l + 140 + + ) + +2349 + #OBJ_d��_�l + +OBJ_id_� +,27L + + ) + +2351 + #SN_issu�g_di�ributi�_po�t + "issu�gDi�ributi�Po�t" + + ) + +2352 + #LN_issu�g_di�ributi�_po�t + "X509v3 Issu�g Di�rubuti� Po�t" + + ) + +2353 + #NID_issu�g_di�ributi�_po�t + 770 + + ) + +2354 + #OBJ_issu�g_di�ributi�_po�t + +OBJ_id_� +,28L + + ) + +2356 + #SN_��ifi��_issu� + "��ifi��Issu�" + + ) + +2357 + #LN_��ifi��_issu� + "X509v3 C�tifi�� Issu�" + + ) + +2358 + #NID_��ifi��_issu� + 771 + + ) + +2359 + #OBJ_��ifi��_issu� + +OBJ_id_� +,29L + + ) + +2361 + #SN_�me_cڡ��ts + "�meCڡ��ts" + + ) + +2362 + #LN_�me_cڡ��ts + "X509v3 Nam�Cڡ��ts" + + ) + +2363 + #NID_�me_cڡ��ts + 666 + + ) + +2364 + #OBJ_�me_cڡ��ts + +OBJ_id_� +,30L + + ) + +2366 + #SN_�l_di�ributi�_po�ts + "�lDi�ributi�Po�ts" + + ) + +2367 + #LN_�l_di�ributi�_po�ts + "X509v3 CRL Di�ributi� Po�ts" + + ) + +2368 + #NID_�l_di�ributi�_po�ts + 103 + + ) + +2369 + #OBJ_�l_di�ributi�_po�ts + +OBJ_id_� +,31L + + ) + +2371 + #SN_��ifi��_p�ic�s + "��ifi��P�ic�s" + + ) + +2372 + #LN_��ifi��_p�ic�s + "X509v3 C�tifi�� P�ic�s" + + ) + +2373 + #NID_��ifi��_p�ic�s + 89 + + ) + +2374 + #OBJ_��ifi��_p�ic�s + +OBJ_id_� +,32L + + ) + +2376 + #SN_�y_p�icy + "�yP�icy" + + ) + +2377 + #LN_�y_p�icy + "X509v3 Any P�icy" + + ) + +2378 + #NID_�y_p�icy + 746 + + ) + +2379 + #OBJ_�y_p�icy + +OBJ_��ifi��_p�ic�s +,0L + + ) + +2381 + #SN_p�icy_m�p�gs + "p�icyM�p�gs" + + ) + +2382 + #LN_p�icy_m�p�gs + "X509v3 P�icy M�p�gs" + + ) + +2383 + #NID_p�icy_m�p�gs + 747 + + ) + +2384 + #OBJ_p�icy_m�p�gs + +OBJ_id_� +,33L + + ) + +2386 + #SN_authܙy_key_id�tif�r + "authܙyKeyId�tif�r" + + ) + +2387 + #LN_authܙy_key_id�tif�r + "X509v3 Authܙy Key Id�tif�r" + + ) + +2388 + #NID_authܙy_key_id�tif�r + 90 + + ) + +2389 + #OBJ_authܙy_key_id�tif�r + +OBJ_id_� +,35L + + ) + +2391 + #SN_p�icy_cڡ��ts + "p�icyCڡ��ts" + + ) + +2392 + #LN_p�icy_cڡ��ts + "X509v3 P�icy Cڡ��ts" + + ) + +2393 + #NID_p�icy_cڡ��ts + 401 + + ) + +2394 + #OBJ_p�icy_cڡ��ts + +OBJ_id_� +,36L + + ) + +2396 + #SN_ext_key_u�ge + "ex�ndedKeyU�ge" + + ) + +2397 + #LN_ext_key_u�ge + "X509v3 Ex�nded Key U�ge" + + ) + +2398 + #NID_ext_key_u�ge + 126 + + ) + +2399 + #OBJ_ext_key_u�ge + +OBJ_id_� +,37L + + ) + +2401 + #SN_�eshe�_�l + "�eshe�CRL" + + ) + +2402 + #LN_�eshe�_�l + "X509v3 F�she� CRL" + + ) + +2403 + #NID_�eshe�_�l + 857 + + ) + +2404 + #OBJ_�eshe�_�l + +OBJ_id_� +,46L + + ) + +2406 + #SN_�hib�_�y_p�icy + "�hib�AnyP�icy" + + ) + +2407 + #LN_�hib�_�y_p�icy + "X509v3 Inhib� Any P�icy" + + ) + +2408 + #NID_�hib�_�y_p�icy + 748 + + ) + +2409 + #OBJ_�hib�_�y_p�icy + +OBJ_id_� +,54L + + ) + +2411 + #SN_�rg�_�f�m�i� + "�rg�Inf�m�i�" + + ) + +2412 + #LN_�rg�_�f�m�i� + "X509v3 AC T�g��g" + + ) + +2413 + #NID_�rg�_�f�m�i� + 402 + + ) + +2414 + #OBJ_�rg�_�f�m�i� + +OBJ_id_� +,55L + + ) + +2416 + #SN_no_�v_ava� + "noRevAva�" + + ) + +2417 + #LN_no_�v_ava� + "X509v3 N�Revo�ti� Ava�ab�" + + ) + +2418 + #NID_no_�v_ava� + 403 + + ) + +2419 + #OBJ_no_�v_ava� + +OBJ_id_� +,56L + + ) + +2421 + #SN_�yEx�ndedKeyU�ge + "�yEx�ndedKeyU�ge" + + ) + +2422 + #LN_�yEx�ndedKeyU�ge + "Any Ex�nded Key U�ge" + + ) + +2423 + #NID_�yEx�ndedKeyU�ge + 910 + + ) + +2424 + #OBJ_�yEx�ndedKeyU�ge + +OBJ_ext_key_u�ge +,0L + + ) + +2426 + #SN_�ts�� + "N�s��" + + ) + +2427 + #LN_�ts�� + "N�s�� Communi�tiڠC�p." + + ) + +2428 + #NID_�ts�� + 57 + + ) + +2429 + #OBJ_�ts�� + 2L,16L,840L,1L,113730L + + ) + +2431 + #SN_�ts��_��_ex�nsi� + "nsC�tExt" + + ) + +2432 + #LN_�ts��_��_ex�nsi� + "N�s�� C�tifi�� Ex�nsi�" + + ) + +2433 + #NID_�ts��_��_ex�nsi� + 58 + + ) + +2434 + #OBJ_�ts��_��_ex�nsi� + +OBJ_�ts�� +,1L + + ) + +2436 + #SN_�ts��_d�a_ty� + "nsD�aTy�" + + ) + +2437 + #LN_�ts��_d�a_ty� + "N�s�� D��Ty�" + + ) + +2438 + #NID_�ts��_d�a_ty� + 59 + + ) + +2439 + #OBJ_�ts��_d�a_ty� + +OBJ_�ts�� +,2L + + ) + +2441 + #SN_�ts��_��_ty� + "nsC�tTy�" + + ) + +2442 + #LN_�ts��_��_ty� + "N�s�� C��Ty�" + + ) + +2443 + #NID_�ts��_��_ty� + 71 + + ) + +2444 + #OBJ_�ts��_��_ty� + +OBJ_�ts��_��_ex�nsi� +,1L + + ) + +2446 + #SN_�ts��_ba�_u� + "nsBa�U�" + + ) + +2447 + #LN_�ts��_ba�_u� + "N�s�� Ba� U�" + + ) + +2448 + #NID_�ts��_ba�_u� + 72 + + ) + +2449 + #OBJ_�ts��_ba�_u� + +OBJ_�ts��_��_ex�nsi� +,2L + + ) + +2451 + #SN_�ts��_�vo�ti�_u� + "nsRevo�ti�U�" + + ) + +2452 + #LN_�ts��_�vo�ti�_u� + "N�s�� Revo�ti� U�" + + ) + +2453 + #NID_�ts��_�vo�ti�_u� + 73 + + ) + +2454 + #OBJ_�ts��_�vo�ti�_u� + +OBJ_�ts��_��_ex�nsi� +,3L + + ) + +2456 + #SN_�ts��_�_�vo�ti�_u� + "nsCaRevo�ti�U�" + + ) + +2457 + #LN_�ts��_�_�vo�ti�_u� + "N�s�� CA Revo�ti� U�" + + ) + +2458 + #NID_�ts��_�_�vo�ti�_u� + 74 + + ) + +2459 + #OBJ_�ts��_�_�vo�ti�_u� + +OBJ_�ts��_��_ex�nsi� +,4L + + ) + +2461 + #SN_�ts��_��w�_u� + "nsR�ew�U�" + + ) + +2462 + #LN_�ts��_��w�_u� + "N�s�� R�ew� U�" + + ) + +2463 + #NID_�ts��_��w�_u� + 75 + + ) + +2464 + #OBJ_�ts��_��w�_u� + +OBJ_�ts��_��_ex�nsi� +,7L + + ) + +2466 + #SN_�ts��_�_p�icy_u� + "nsCaP�icyU�" + + ) + +2467 + #LN_�ts��_�_p�icy_u� + "N�s�� CA P�icy U�" + + ) + +2468 + #NID_�ts��_�_p�icy_u� + 76 + + ) + +2469 + #OBJ_�ts��_�_p�icy_u� + +OBJ_�ts��_��_ex�nsi� +,8L + + ) + +2471 + #SN_�ts��_s�_�rv�_�me + "nsS�S�v�Name" + + ) + +2472 + #LN_�ts��_s�_�rv�_�me + "N�s�� SSL S�v� Name" + + ) + +2473 + #NID_�ts��_s�_�rv�_�me + 77 + + ) + +2474 + #OBJ_�ts��_s�_�rv�_�me + +OBJ_�ts��_��_ex�nsi� +,12L + + ) + +2476 + #SN_�ts��_comm�t + "nsComm�t" + + ) + +2477 + #LN_�ts��_comm�t + "N�s�� Comm�t" + + ) + +2478 + #NID_�ts��_comm�t + 78 + + ) + +2479 + #OBJ_�ts��_comm�t + +OBJ_�ts��_��_ex�nsi� +,13L + + ) + +2481 + #SN_�ts��_��_�qu�� + "nsC�tSequ��" + + ) + +2482 + #LN_�ts��_��_�qu�� + "N�s�� C�tifi�� Sequ��" + + ) + +2483 + #NID_�ts��_��_�qu�� + 79 + + ) + +2484 + #OBJ_�ts��_��_�qu�� + +OBJ_�ts��_d�a_ty� +,5L + + ) + +2486 + #SN_ns_sgc + "nsSGC" + + ) + +2487 + #LN_ns_sgc + "N�s�� S�v� G�ed Cry�o" + + ) + +2488 + #NID_ns_sgc + 139 + + ) + +2489 + #OBJ_ns_sgc + +OBJ_�ts�� +,4L,1L + + ) + +2491 + #SN_�g + "ORG" + + ) + +2492 + #LN_�g + "�g" + + ) + +2493 + #NID_�g + 379 + + ) + +2494 + #OBJ_�g + +OBJ_iso +,3L + + ) + +2496 + #SN_dod + "DOD" + + ) + +2497 + #LN_dod + "dod" + + ) + +2498 + #NID_dod + 380 + + ) + +2499 + #OBJ_dod + +OBJ_�g +,6L + + ) + +2501 + #SN_�� + "IANA" + + ) + +2502 + #LN_�� + "��" + + ) + +2503 + #NID_�� + 381 + + ) + +2504 + #OBJ_�� + +OBJ_dod +,1L + + ) + +2506 + #OBJ_���� + +OBJ_�� + + + ) + +2508 + #SN_D�e��y + "d�e��y" + + ) + +2509 + #LN_D�e��y + "D�e��y" + + ) + +2510 + #NID_D�e��y + 382 + + ) + +2511 + #OBJ_D�e��y + +OBJ_���� +,1L + + ) + +2513 + #SN_M�agem�t + "mgmt" + + ) + +2514 + #LN_M�agem�t + "M�agem�t" + + ) + +2515 + #NID_M�agem�t + 383 + + ) + +2516 + #OBJ_M�agem�t + +OBJ_���� +,2L + + ) + +2518 + #SN_Ex�rim��l + "ex�rim��l" + + ) + +2519 + #LN_Ex�rim��l + "Ex�rim��l" + + ) + +2520 + #NID_Ex�rim��l + 384 + + ) + +2521 + #OBJ_Ex�rim��l + +OBJ_���� +,3L + + ) + +2523 + #SN_Priv�e + "�iv�e" + + ) + +2524 + #LN_Priv�e + "Priv�e" + + ) + +2525 + #NID_Priv�e + 385 + + ) + +2526 + #OBJ_Priv�e + +OBJ_���� +,4L + + ) + +2528 + #SN_Secur�y + "�cur�y" + + ) + +2529 + #LN_Secur�y + "Secur�y" + + ) + +2530 + #NID_Secur�y + 386 + + ) + +2531 + #OBJ_Secur�y + +OBJ_���� +,5L + + ) + +2533 + #SN_SNMPv2 + "�mpv2" + + ) + +2534 + #LN_SNMPv2 + "SNMPv2" + + ) + +2535 + #NID_SNMPv2 + 387 + + ) + +2536 + #OBJ_SNMPv2 + +OBJ_���� +,6L + + ) + +2538 + #LN_Ma� + "Ma�" + + ) + +2539 + #NID_Ma� + 388 + + ) + +2540 + #OBJ_Ma� + +OBJ_���� +,7L + + ) + +2542 + #SN_E���i�s + "���ri�s" + + ) + +2543 + #LN_E���i�s + "E���i�s" + + ) + +2544 + #NID_E���i�s + 389 + + ) + +2545 + #OBJ_E���i�s + +OBJ_Priv�e +,1L + + ) + +2547 + #SN_dcObje� + "dcobje�" + + ) + +2548 + #LN_dcObje� + "dcObje�" + + ) + +2549 + #NID_dcObje� + 390 + + ) + +2550 + #OBJ_dcObje� + +OBJ_E���i�s +,1466L,344L + + ) + +2552 + #SN_mime_mhs + "mime-mhs" + + ) + +2553 + #LN_mime_mhs + "MIME MHS" + + ) + +2554 + #NID_mime_mhs + 504 + + ) + +2555 + #OBJ_mime_mhs + +OBJ_Ma� +,1L + + ) + +2557 + #SN_mime_mhs_h�d�gs + "mime-mhs-h�d�gs" + + ) + +2558 + #LN_mime_mhs_h�d�gs + "mime-mhs-h�d�gs" + + ) + +2559 + #NID_mime_mhs_h�d�gs + 505 + + ) + +2560 + #OBJ_mime_mhs_h�d�gs + +OBJ_mime_mhs +,1L + + ) + +2562 + #SN_mime_mhs_bod�s + "mime-mhs-bod�s" + + ) + +2563 + #LN_mime_mhs_bod�s + "mime-mhs-bod�s" + + ) + +2564 + #NID_mime_mhs_bod�s + 506 + + ) + +2565 + #OBJ_mime_mhs_bod�s + +OBJ_mime_mhs +,2L + + ) + +2567 + #SN_id_hex_���l_mes�ge + "id-hex-���l-mes�ge" + + ) + +2568 + #LN_id_hex_���l_mes�ge + "id-hex-���l-mes�ge" + + ) + +2569 + #NID_id_hex_���l_mes�ge + 507 + + ) + +2570 + #OBJ_id_hex_���l_mes�ge + +OBJ_mime_mhs_h�d�gs +,1L + + ) + +2572 + #SN_id_hex_muɝ�t_mes�ge + "id-hex-muɝ�t-mes�ge" + + ) + +2573 + #LN_id_hex_muɝ�t_mes�ge + "id-hex-muɝ�t-mes�ge" + + ) + +2574 + #NID_id_hex_muɝ�t_mes�ge + 508 + + ) + +2575 + #OBJ_id_hex_muɝ�t_mes�ge + +OBJ_mime_mhs_h�d�gs +,2L + + ) + +2577 + #SN_�e_com�essi� + "RLE" + + ) + +2578 + #LN_�e_com�essi� + "ru��ngth com�essi�" + + ) + +2579 + #NID_�e_com�essi� + 124 + + ) + +2580 + #OBJ_�e_com�essi� + 1L,1L,1L,1L,666L,1L + + ) + +2582 + #SN_zlib_com�essi� + "ZLIB" + + ) + +2583 + #LN_zlib_com�essi� + "zlib com�essi�" + + ) + +2584 + #NID_zlib_com�essi� + 125 + + ) + +2585 + #OBJ_zlib_com�essi� + +OBJ_id_smime_�g +,8L + + ) + +2587 + #OBJ_cs� + 2L,16L,840L,1L,101L,3L + + ) + +2589 + #OBJ_ni�Algܙhms + +OBJ_cs� +,4L + + ) + +2591 + #OBJ_�s + +OBJ_ni�Algܙhms +,1L + + ) + +2593 + #SN_�s_128_ecb + "AES-128-ECB" + + ) + +2594 + #LN_�s_128_ecb + "�s-128-ecb" + + ) + +2595 + #NID_�s_128_ecb + 418 + + ) + +2596 + #OBJ_�s_128_ecb + +OBJ_�s +,1L + + ) + +2598 + #SN_�s_128_cbc + "AES-128-CBC" + + ) + +2599 + #LN_�s_128_cbc + "�s-128-cbc" + + ) + +2600 + #NID_�s_128_cbc + 419 + + ) + +2601 + #OBJ_�s_128_cbc + +OBJ_�s +,2L + + ) + +2603 + #SN_�s_128_ofb128 + "AES-128-OFB" + + ) + +2604 + #LN_�s_128_ofb128 + "�s-128-ofb" + + ) + +2605 + #NID_�s_128_ofb128 + 420 + + ) + +2606 + #OBJ_�s_128_ofb128 + +OBJ_�s +,3L + + ) + +2608 + #SN_�s_128_cfb128 + "AES-128-CFB" + + ) + +2609 + #LN_�s_128_cfb128 + "�s-128-cfb" + + ) + +2610 + #NID_�s_128_cfb128 + 421 + + ) + +2611 + #OBJ_�s_128_cfb128 + +OBJ_�s +,4L + + ) + +2613 + #SN_id_�s128_w�p + "id-�s128-w�p" + + ) + +2614 + #NID_id_�s128_w�p + 788 + + ) + +2615 + #OBJ_id_�s128_w�p + +OBJ_�s +,5L + + ) + +2617 + #SN_�s_128_gcm + "id-�s128-GCM" + + ) + +2618 + #LN_�s_128_gcm + "�s-128-gcm" + + ) + +2619 + #NID_�s_128_gcm + 895 + + ) + +2620 + #OBJ_�s_128_gcm + +OBJ_�s +,6L + + ) + +2622 + #SN_�s_128_ccm + "id-�s128-CCM" + + ) + +2623 + #LN_�s_128_ccm + "�s-128-ccm" + + ) + +2624 + #NID_�s_128_ccm + 896 + + ) + +2625 + #OBJ_�s_128_ccm + +OBJ_�s +,7L + + ) + +2627 + #SN_id_�s128_w�p_�d + "id-�s128-w�p-�d" + + ) + +2628 + #NID_id_�s128_w�p_�d + 897 + + ) + +2629 + #OBJ_id_�s128_w�p_�d + +OBJ_�s +,8L + + ) + +2631 + #SN_�s_192_ecb + "AES-192-ECB" + + ) + +2632 + #LN_�s_192_ecb + "�s-192-ecb" + + ) + +2633 + #NID_�s_192_ecb + 422 + + ) + +2634 + #OBJ_�s_192_ecb + +OBJ_�s +,21L + + ) + +2636 + #SN_�s_192_cbc + "AES-192-CBC" + + ) + +2637 + #LN_�s_192_cbc + "�s-192-cbc" + + ) + +2638 + #NID_�s_192_cbc + 423 + + ) + +2639 + #OBJ_�s_192_cbc + +OBJ_�s +,22L + + ) + +2641 + #SN_�s_192_ofb128 + "AES-192-OFB" + + ) + +2642 + #LN_�s_192_ofb128 + "�s-192-ofb" + + ) + +2643 + #NID_�s_192_ofb128 + 424 + + ) + +2644 + #OBJ_�s_192_ofb128 + +OBJ_�s +,23L + + ) + +2646 + #SN_�s_192_cfb128 + "AES-192-CFB" + + ) + +2647 + #LN_�s_192_cfb128 + "�s-192-cfb" + + ) + +2648 + #NID_�s_192_cfb128 + 425 + + ) + +2649 + #OBJ_�s_192_cfb128 + +OBJ_�s +,24L + + ) + +2651 + #SN_id_�s192_w�p + "id-�s192-w�p" + + ) + +2652 + #NID_id_�s192_w�p + 789 + + ) + +2653 + #OBJ_id_�s192_w�p + +OBJ_�s +,25L + + ) + +2655 + #SN_�s_192_gcm + "id-�s192-GCM" + + ) + +2656 + #LN_�s_192_gcm + "�s-192-gcm" + + ) + +2657 + #NID_�s_192_gcm + 898 + + ) + +2658 + #OBJ_�s_192_gcm + +OBJ_�s +,26L + + ) + +2660 + #SN_�s_192_ccm + "id-�s192-CCM" + + ) + +2661 + #LN_�s_192_ccm + "�s-192-ccm" + + ) + +2662 + #NID_�s_192_ccm + 899 + + ) + +2663 + #OBJ_�s_192_ccm + +OBJ_�s +,27L + + ) + +2665 + #SN_id_�s192_w�p_�d + "id-�s192-w�p-�d" + + ) + +2666 + #NID_id_�s192_w�p_�d + 900 + + ) + +2667 + #OBJ_id_�s192_w�p_�d + +OBJ_�s +,28L + + ) + +2669 + #SN_�s_256_ecb + "AES-256-ECB" + + ) + +2670 + #LN_�s_256_ecb + "�s-256-ecb" + + ) + +2671 + #NID_�s_256_ecb + 426 + + ) + +2672 + #OBJ_�s_256_ecb + +OBJ_�s +,41L + + ) + +2674 + #SN_�s_256_cbc + "AES-256-CBC" + + ) + +2675 + #LN_�s_256_cbc + "�s-256-cbc" + + ) + +2676 + #NID_�s_256_cbc + 427 + + ) + +2677 + #OBJ_�s_256_cbc + +OBJ_�s +,42L + + ) + +2679 + #SN_�s_256_ofb128 + "AES-256-OFB" + + ) + +2680 + #LN_�s_256_ofb128 + "�s-256-ofb" + + ) + +2681 + #NID_�s_256_ofb128 + 428 + + ) + +2682 + #OBJ_�s_256_ofb128 + +OBJ_�s +,43L + + ) + +2684 + #SN_�s_256_cfb128 + "AES-256-CFB" + + ) + +2685 + #LN_�s_256_cfb128 + "�s-256-cfb" + + ) + +2686 + #NID_�s_256_cfb128 + 429 + + ) + +2687 + #OBJ_�s_256_cfb128 + +OBJ_�s +,44L + + ) + +2689 + #SN_id_�s256_w�p + "id-�s256-w�p" + + ) + +2690 + #NID_id_�s256_w�p + 790 + + ) + +2691 + #OBJ_id_�s256_w�p + +OBJ_�s +,45L + + ) + +2693 + #SN_�s_256_gcm + "id-�s256-GCM" + + ) + +2694 + #LN_�s_256_gcm + "�s-256-gcm" + + ) + +2695 + #NID_�s_256_gcm + 901 + + ) + +2696 + #OBJ_�s_256_gcm + +OBJ_�s +,46L + + ) + +2698 + #SN_�s_256_ccm + "id-�s256-CCM" + + ) + +2699 + #LN_�s_256_ccm + "�s-256-ccm" + + ) + +2700 + #NID_�s_256_ccm + 902 + + ) + +2701 + #OBJ_�s_256_ccm + +OBJ_�s +,47L + + ) + +2703 + #SN_id_�s256_w�p_�d + "id-�s256-w�p-�d" + + ) + +2704 + #NID_id_�s256_w�p_�d + 903 + + ) + +2705 + #OBJ_id_�s256_w�p_�d + +OBJ_�s +,48L + + ) + +2707 + #SN_�s_128_cfb1 + "AES-128-CFB1" + + ) + +2708 + #LN_�s_128_cfb1 + "�s-128-cfb1" + + ) + +2709 + #NID_�s_128_cfb1 + 650 + + ) + +2711 + #SN_�s_192_cfb1 + "AES-192-CFB1" + + ) + +2712 + #LN_�s_192_cfb1 + "�s-192-cfb1" + + ) + +2713 + #NID_�s_192_cfb1 + 651 + + ) + +2715 + #SN_�s_256_cfb1 + "AES-256-CFB1" + + ) + +2716 + #LN_�s_256_cfb1 + "�s-256-cfb1" + + ) + +2717 + #NID_�s_256_cfb1 + 652 + + ) + +2719 + #SN_�s_128_cfb8 + "AES-128-CFB8" + + ) + +2720 + #LN_�s_128_cfb8 + "�s-128-cfb8" + + ) + +2721 + #NID_�s_128_cfb8 + 653 + + ) + +2723 + #SN_�s_192_cfb8 + "AES-192-CFB8" + + ) + +2724 + #LN_�s_192_cfb8 + "�s-192-cfb8" + + ) + +2725 + #NID_�s_192_cfb8 + 654 + + ) + +2727 + #SN_�s_256_cfb8 + "AES-256-CFB8" + + ) + +2728 + #LN_�s_256_cfb8 + "�s-256-cfb8" + + ) + +2729 + #NID_�s_256_cfb8 + 655 + + ) + +2731 + #SN_�s_128_�r + "AES-128-CTR" + + ) + +2732 + #LN_�s_128_�r + "�s-128-�r" + + ) + +2733 + #NID_�s_128_�r + 904 + + ) + +2735 + #SN_�s_192_�r + "AES-192-CTR" + + ) + +2736 + #LN_�s_192_�r + "�s-192-�r" + + ) + +2737 + #NID_�s_192_�r + 905 + + ) + +2739 + #SN_�s_256_�r + "AES-256-CTR" + + ) + +2740 + #LN_�s_256_�r + "�s-256-�r" + + ) + +2741 + #NID_�s_256_�r + 906 + + ) + +2743 + #SN_�s_128_xts + "AES-128-XTS" + + ) + +2744 + #LN_�s_128_xts + "�s-128-xts" + + ) + +2745 + #NID_�s_128_xts + 913 + + ) + +2747 + #SN_�s_256_xts + "AES-256-XTS" + + ) + +2748 + #LN_�s_256_xts + "�s-256-xts" + + ) + +2749 + #NID_�s_256_xts + 914 + + ) + +2751 + #SN_des_cfb1 + "DES-CFB1" + + ) + +2752 + #LN_des_cfb1 + "des-cfb1" + + ) + +2753 + #NID_des_cfb1 + 656 + + ) + +2755 + #SN_des_cfb8 + "DES-CFB8" + + ) + +2756 + #LN_des_cfb8 + "des-cfb8" + + ) + +2757 + #NID_des_cfb8 + 657 + + ) + +2759 + #SN_des_ede3_cfb1 + "DES-EDE3-CFB1" + + ) + +2760 + #LN_des_ede3_cfb1 + "des-ede3-cfb1" + + ) + +2761 + #NID_des_ede3_cfb1 + 658 + + ) + +2763 + #SN_des_ede3_cfb8 + "DES-EDE3-CFB8" + + ) + +2764 + #LN_des_ede3_cfb8 + "des-ede3-cfb8" + + ) + +2765 + #NID_des_ede3_cfb8 + 659 + + ) + +2767 + #OBJ_ni�_hash�gs + +OBJ_ni�Algܙhms +,2L + + ) + +2769 + #SN_sha256 + "SHA256" + + ) + +2770 + #LN_sha256 + "sha256" + + ) + +2771 + #NID_sha256 + 672 + + ) + +2772 + #OBJ_sha256 + +OBJ_ni�_hash�gs +,1L + + ) + +2774 + #SN_sha384 + "SHA384" + + ) + +2775 + #LN_sha384 + "sha384" + + ) + +2776 + #NID_sha384 + 673 + + ) + +2777 + #OBJ_sha384 + +OBJ_ni�_hash�gs +,2L + + ) + +2779 + #SN_sha512 + "SHA512" + + ) + +2780 + #LN_sha512 + "sha512" + + ) + +2781 + #NID_sha512 + 674 + + ) + +2782 + #OBJ_sha512 + +OBJ_ni�_hash�gs +,3L + + ) + +2784 + #SN_sha224 + "SHA224" + + ) + +2785 + #LN_sha224 + "sha224" + + ) + +2786 + #NID_sha224 + 675 + + ) + +2787 + #OBJ_sha224 + +OBJ_ni�_hash�gs +,4L + + ) + +2789 + #OBJ_d�_w�h_sha2 + +OBJ_ni�Algܙhms +,3L + + ) + +2791 + #SN_d�_w�h_SHA224 + "d�_w�h_SHA224" + + ) + +2792 + #NID_d�_w�h_SHA224 + 802 + + ) + +2793 + #OBJ_d�_w�h_SHA224 + +OBJ_d�_w�h_sha2 +,1L + + ) + +2795 + #SN_d�_w�h_SHA256 + "d�_w�h_SHA256" + + ) + +2796 + #NID_d�_w�h_SHA256 + 803 + + ) + +2797 + #OBJ_d�_w�h_SHA256 + +OBJ_d�_w�h_sha2 +,2L + + ) + +2799 + #SN_h�d_��ru�i�_code + "h�dIn�ru�i�Code" + + ) + +2800 + #LN_h�d_��ru�i�_code + "H�d In�ru�i� Code" + + ) + +2801 + #NID_h�d_��ru�i�_code + 430 + + ) + +2802 + #OBJ_h�d_��ru�i�_code + +OBJ_id_� +,23L + + ) + +2804 + #OBJ_h�dIn�ru�i� + +OBJ_X9_57 +,2L + + ) + +2806 + #SN_h�d_��ru�i�_n�e + "h�dIn�ru�i�N�e" + + ) + +2807 + #LN_h�d_��ru�i�_n�e + "H�d In�ru�i� N�e" + + ) + +2808 + #NID_h�d_��ru�i�_n�e + 431 + + ) + +2809 + #OBJ_h�d_��ru�i�_n�e + +OBJ_h�dIn�ru�i� +,1L + + ) + +2811 + #SN_h�d_��ru�i�_��_issu� + "h�dIn�ru�i�C�lIssu�" + + ) + +2812 + #LN_h�d_��ru�i�_��_issu� + "H�d In�ru�i� C��Issu�" + + ) + +2813 + #NID_h�d_��ru�i�_��_issu� + 432 + + ) + +2814 + #OBJ_h�d_��ru�i�_��_issu� + +OBJ_h�dIn�ru�i� +,2L + + ) + +2816 + #SN_h�d_��ru�i�_�je� + "h�dIn�ru�i�Reje�" + + ) + +2817 + #LN_h�d_��ru�i�_�je� + "H�d In�ru�i� Reje�" + + ) + +2818 + #NID_h�d_��ru�i�_�je� + 433 + + ) + +2819 + #OBJ_h�d_��ru�i�_�je� + +OBJ_h�dIn�ru�i� +,3L + + ) + +2821 + #SN_d�a + "d�a" + + ) + +2822 + #NID_d�a + 434 + + ) + +2823 + #OBJ_d�a + +OBJ_�u_t +,9L + + ) + +2825 + #SN_pss + "pss" + + ) + +2826 + #NID_pss + 435 + + ) + +2827 + #OBJ_pss + +OBJ_d�a +,2342L + + ) + +2829 + #SN_u� + "u�" + + ) + +2830 + #NID_u� + 436 + + ) + +2831 + #OBJ_u� + +OBJ_pss +,19200300L + + ) + +2833 + #SN_p�� + "p��" + + ) + +2834 + #NID_p�� + 437 + + ) + +2835 + #OBJ_p�� + +OBJ_u� +,100L + + ) + +2837 + #LN_p��A�ribu�Ty� + "p��A�ribu�Ty�" + + ) + +2838 + #NID_p��A�ribu�Ty� + 438 + + ) + +2839 + #OBJ_p��A�ribu�Ty� + +OBJ_p�� +,1L + + ) + +2841 + #LN_p��A�ribu�Sy�ax + "p��A�ribu�Sy�ax" + + ) + +2842 + #NID_p��A�ribu�Sy�ax + 439 + + ) + +2843 + #OBJ_p��A�ribu�Sy�ax + +OBJ_p�� +,3L + + ) + +2845 + #LN_p��Obje�C�ss + "p��Obje�C�ss" + + ) + +2846 + #NID_p��Obje�C�ss + 440 + + ) + +2847 + #OBJ_p��Obje�C�ss + +OBJ_p�� +,4L + + ) + +2849 + #LN_p��Groups + "p��Groups" + + ) + +2850 + #NID_p��Groups + 441 + + ) + +2851 + #OBJ_p��Groups + +OBJ_p�� +,10L + + ) + +2853 + #LN_iA5S��gSy�ax + "iA5S��gSy�ax" + + ) + +2854 + #NID_iA5S��gSy�ax + 442 + + ) + +2855 + #OBJ_iA5S��gSy�ax + +OBJ_p��A�ribu�Sy�ax +,4L + + ) + +2857 + #LN_��Ign�eIA5S��gSy�ax + "��Ign�eIA5S��gSy�ax" + + ) + +2858 + #NID_��Ign�eIA5S��gSy�ax + 443 + + ) + +2859 + #OBJ_��Ign�eIA5S��gSy�ax + +OBJ_p��A�ribu�Sy�ax +,5L + + ) + +2861 + #LN_p��Obje� + "p��Obje�" + + ) + +2862 + #NID_p��Obje� + 444 + + ) + +2863 + #OBJ_p��Obje� + +OBJ_p��Obje�C�ss +,3L + + ) + +2865 + #LN_p��P�s� + "p��P�s�" + + ) + +2866 + #NID_p��P�s� + 445 + + ) + +2867 + #OBJ_p��P�s� + +OBJ_p��Obje�C�ss +,4L + + ) + +2869 + #SN_accou� + "accou�" + + ) + +2870 + #NID_accou� + 446 + + ) + +2871 + #OBJ_accou� + +OBJ_p��Obje�C�ss +,5L + + ) + +2873 + #SN_docum�t + "docum�t" + + ) + +2874 + #NID_docum�t + 447 + + ) + +2875 + #OBJ_docum�t + +OBJ_p��Obje�C�ss +,6L + + ) + +2877 + #SN_room + "room" + + ) + +2878 + #NID_room + 448 + + ) + +2879 + #OBJ_room + +OBJ_p��Obje�C�ss +,7L + + ) + +2881 + #LN_docum�tS��s + "docum�tS��s" + + ) + +2882 + #NID_docum�tS��s + 449 + + ) + +2883 + #OBJ_docum�tS��s + +OBJ_p��Obje�C�ss +,9L + + ) + +2885 + #SN_Doma� + "doma�" + + ) + +2886 + #LN_Doma� + "Doma�" + + ) + +2887 + #NID_Doma� + 392 + + ) + +2888 + #OBJ_Doma� + +OBJ_p��Obje�C�ss +,13L + + ) + +2890 + #LN_rFC822lo�lP�t + "rFC822lo�lP�t" + + ) + +2891 + #NID_rFC822lo�lP�t + 450 + + ) + +2892 + #OBJ_rFC822lo�lP�t + +OBJ_p��Obje�C�ss +,14L + + ) + +2894 + #LN_dNSDoma� + "dNSDoma�" + + ) + +2895 + #NID_dNSDoma� + 451 + + ) + +2896 + #OBJ_dNSDoma� + +OBJ_p��Obje�C�ss +,15L + + ) + +2898 + #LN_doma�R��edObje� + "doma�R��edObje�" + + ) + +2899 + #NID_doma�R��edObje� + 452 + + ) + +2900 + #OBJ_doma�R��edObje� + +OBJ_p��Obje�C�ss +,17L + + ) + +2902 + #LN_�ndlyCou�ry + "�ndlyCou�ry" + + ) + +2903 + #NID_�ndlyCou�ry + 453 + + ) + +2904 + #OBJ_�ndlyCou�ry + +OBJ_p��Obje�C�ss +,18L + + ) + +2906 + #LN_sim�eSecur�yObje� + "sim�eSecur�yObje�" + + ) + +2907 + #NID_sim�eSecur�yObje� + 454 + + ) + +2908 + #OBJ_sim�eSecur�yObje� + +OBJ_p��Obje�C�ss +,19L + + ) + +2910 + #LN_p��Org�iz�i� + "p��Org�iz�i�" + + ) + +2911 + #NID_p��Org�iz�i� + 455 + + ) + +2912 + #OBJ_p��Org�iz�i� + +OBJ_p��Obje�C�ss +,20L + + ) + +2914 + #LN_p��DSA + "p��DSA" + + ) + +2915 + #NID_p��DSA + 456 + + ) + +2916 + #OBJ_p��DSA + +OBJ_p��Obje�C�ss +,21L + + ) + +2918 + #LN_qu��yLab��dD�a + "qu��yLab��dD�a" + + ) + +2919 + #NID_qu��yLab��dD�a + 457 + + ) + +2920 + #OBJ_qu��yLab��dD�a + +OBJ_p��Obje�C�ss +,22L + + ) + +2922 + #SN_u�rId + "UID" + + ) + +2923 + #LN_u�rId + "u�rId" + + ) + +2924 + #NID_u�rId + 458 + + ) + +2925 + #OBJ_u�rId + +OBJ_p��A�ribu�Ty� +,1L + + ) + +2927 + #LN_�xtEncodedORAdd�ss + "�xtEncodedORAdd�ss" + + ) + +2928 + #NID_�xtEncodedORAdd�ss + 459 + + ) + +2929 + #OBJ_�xtEncodedORAdd�ss + +OBJ_p��A�ribu�Ty� +,2L + + ) + +2931 + #SN_rfc822Ma�box + "ma�" + + ) + +2932 + #LN_rfc822Ma�box + "rfc822Ma�box" + + ) + +2933 + #NID_rfc822Ma�box + 460 + + ) + +2934 + #OBJ_rfc822Ma�box + +OBJ_p��A�ribu�Ty� +,3L + + ) + +2936 + #SN_�fo + "�fo" + + ) + +2937 + #NID_�fo + 461 + + ) + +2938 + #OBJ_�fo + +OBJ_p��A�ribu�Ty� +,4L + + ) + +2940 + #LN_�vour�eDr�k + "�vour�eDr�k" + + ) + +2941 + #NID_�vour�eDr�k + 462 + + ) + +2942 + #OBJ_�vour�eDr�k + +OBJ_p��A�ribu�Ty� +,5L + + ) + +2944 + #LN_roomNumb� + "roomNumb�" + + ) + +2945 + #NID_roomNumb� + 463 + + ) + +2946 + #OBJ_roomNumb� + +OBJ_p��A�ribu�Ty� +,6L + + ) + +2948 + #SN_ph�o + "ph�o" + + ) + +2949 + #NID_ph�o + 464 + + ) + +2950 + #OBJ_ph�o + +OBJ_p��A�ribu�Ty� +,7L + + ) + +2952 + #LN_u�rC�ss + "u�rC�ss" + + ) + +2953 + #NID_u�rC�ss + 465 + + ) + +2954 + #OBJ_u�rC�ss + +OBJ_p��A�ribu�Ty� +,8L + + ) + +2956 + #SN_ho� + "ho�" + + ) + +2957 + #NID_ho� + 466 + + ) + +2958 + #OBJ_ho� + +OBJ_p��A�ribu�Ty� +,9L + + ) + +2960 + #SN_m�ag� + "m�ag�" + + ) + +2961 + #NID_m�ag� + 467 + + ) + +2962 + #OBJ_m�ag� + +OBJ_p��A�ribu�Ty� +,10L + + ) + +2964 + #LN_docum�tId�tif�r + "docum�tId�tif�r" + + ) + +2965 + #NID_docum�tId�tif�r + 468 + + ) + +2966 + #OBJ_docum�tId�tif�r + +OBJ_p��A�ribu�Ty� +,11L + + ) + +2968 + #LN_docum�tT�� + "docum�tT��" + + ) + +2969 + #NID_docum�tT�� + 469 + + ) + +2970 + #OBJ_docum�tT�� + +OBJ_p��A�ribu�Ty� +,12L + + ) + +2972 + #LN_docum�tV�si� + "docum�tV�si�" + + ) + +2973 + #NID_docum�tV�si� + 470 + + ) + +2974 + #OBJ_docum�tV�si� + +OBJ_p��A�ribu�Ty� +,13L + + ) + +2976 + #LN_docum�tAuth� + "docum�tAuth�" + + ) + +2977 + #NID_docum�tAuth� + 471 + + ) + +2978 + #OBJ_docum�tAuth� + +OBJ_p��A�ribu�Ty� +,14L + + ) + +2980 + #LN_docum�tLo�ti� + "docum�tLo�ti�" + + ) + +2981 + #NID_docum�tLo�ti� + 472 + + ) + +2982 + #OBJ_docum�tLo�ti� + +OBJ_p��A�ribu�Ty� +,15L + + ) + +2984 + #LN_homeT��h�eNumb� + "homeT��h�eNumb�" + + ) + +2985 + #NID_homeT��h�eNumb� + 473 + + ) + +2986 + #OBJ_homeT��h�eNumb� + +OBJ_p��A�ribu�Ty� +,20L + + ) + +2988 + #SN_����y + "����y" + + ) + +2989 + #NID_����y + 474 + + ) + +2990 + #OBJ_����y + +OBJ_p��A�ribu�Ty� +,21L + + ) + +2992 + #LN_�h�Ma�box + "�h�Ma�box" + + ) + +2993 + #NID_�h�Ma�box + 475 + + ) + +2994 + #OBJ_�h�Ma�box + +OBJ_p��A�ribu�Ty� +,22L + + ) + +2996 + #LN_ϡModif�dTime + "ϡModif�dTime" + + ) + +2997 + #NID_ϡModif�dTime + 476 + + ) + +2998 + #OBJ_ϡModif�dTime + +OBJ_p��A�ribu�Ty� +,23L + + ) + +3000 + #LN_ϡModif�dBy + "ϡModif�dBy" + + ) + +3001 + #NID_ϡModif�dBy + 477 + + ) + +3002 + #OBJ_ϡModif�dBy + +OBJ_p��A�ribu�Ty� +,24L + + ) + +3004 + #SN_doma�Compڒt + "DC" + + ) + +3005 + #LN_doma�Compڒt + "doma�Compڒt" + + ) + +3006 + #NID_doma�Compڒt + 391 + + ) + +3007 + #OBJ_doma�Compڒt + +OBJ_p��A�ribu�Ty� +,25L + + ) + +3009 + #LN_aRec�d + "aRec�d" + + ) + +3010 + #NID_aRec�d + 478 + + ) + +3011 + #OBJ_aRec�d + +OBJ_p��A�ribu�Ty� +,26L + + ) + +3013 + #LN_p��A�ribu�Ty�27 + "p��A�ribu�Ty�27" + + ) + +3014 + #NID_p��A�ribu�Ty�27 + 479 + + ) + +3015 + #OBJ_p��A�ribu�Ty�27 + +OBJ_p��A�ribu�Ty� +,27L + + ) + +3017 + #LN_mXRec�d + "mXRec�d" + + ) + +3018 + #NID_mXRec�d + 480 + + ) + +3019 + #OBJ_mXRec�d + +OBJ_p��A�ribu�Ty� +,28L + + ) + +3021 + #LN_nSRec�d + "nSRec�d" + + ) + +3022 + #NID_nSRec�d + 481 + + ) + +3023 + #OBJ_nSRec�d + +OBJ_p��A�ribu�Ty� +,29L + + ) + +3025 + #LN_sOARec�d + "sOARec�d" + + ) + +3026 + #NID_sOARec�d + 482 + + ) + +3027 + #OBJ_sOARec�d + +OBJ_p��A�ribu�Ty� +,30L + + ) + +3029 + #LN_cNAMERec�d + "cNAMERec�d" + + ) + +3030 + #NID_cNAMERec�d + 483 + + ) + +3031 + #OBJ_cNAMERec�d + +OBJ_p��A�ribu�Ty� +,31L + + ) + +3033 + #LN_assoc��dDoma� + "assoc��dDoma�" + + ) + +3034 + #NID_assoc��dDoma� + 484 + + ) + +3035 + #OBJ_assoc��dDoma� + +OBJ_p��A�ribu�Ty� +,37L + + ) + +3037 + #LN_assoc��dName + "assoc��dName" + + ) + +3038 + #NID_assoc��dName + 485 + + ) + +3039 + #OBJ_assoc��dName + +OBJ_p��A�ribu�Ty� +,38L + + ) + +3041 + #LN_homePo��Add�ss + "homePo��Add�ss" + + ) + +3042 + #NID_homePo��Add�ss + 486 + + ) + +3043 + #OBJ_homePo��Add�ss + +OBJ_p��A�ribu�Ty� +,39L + + ) + +3045 + #LN_�rsڮT�� + "�rsڮT��" + + ) + +3046 + #NID_�rsڮT�� + 487 + + ) + +3047 + #OBJ_�rsڮT�� + +OBJ_p��A�ribu�Ty� +,40L + + ) + +3049 + #LN_mob�eT��h�eNumb� + "mob�eT��h�eNumb�" + + ) + +3050 + #NID_mob�eT��h�eNumb� + 488 + + ) + +3051 + #OBJ_mob�eT��h�eNumb� + +OBJ_p��A�ribu�Ty� +,41L + + ) + +3053 + #LN_�g�T��h�eNumb� + "�g�T��h�eNumb�" + + ) + +3054 + #NID_�g�T��h�eNumb� + 489 + + ) + +3055 + #OBJ_�g�T��h�eNumb� + +OBJ_p��A�ribu�Ty� +,42L + + ) + +3057 + #LN_�ndlyCou�ryName + "�ndlyCou�ryName" + + ) + +3058 + #NID_�ndlyCou�ryName + 490 + + ) + +3059 + #OBJ_�ndlyCou�ryName + +OBJ_p��A�ribu�Ty� +,43L + + ) + +3061 + #LN_�g�iz�iڮS�tus + "�g�iz�iڮS�tus" + + ) + +3062 + #NID_�g�iz�iڮS�tus + 491 + + ) + +3063 + #OBJ_�g�iz�iڮS�tus + +OBJ_p��A�ribu�Ty� +,45L + + ) + +3065 + #LN_j��Ma�box + "j��Ma�box" + + ) + +3066 + #NID_j��Ma�box + 492 + + ) + +3067 + #OBJ_j��Ma�box + +OBJ_p��A�ribu�Ty� +,46L + + ) + +3069 + #LN_ma�P��n�O�i� + "ma�P��n�O�i�" + + ) + +3070 + #NID_ma�P��n�O�i� + 493 + + ) + +3071 + #OBJ_ma�P��n�O�i� + +OBJ_p��A�ribu�Ty� +,47L + + ) + +3073 + #LN_bu�d�gName + "bu�d�gName" + + ) + +3074 + #NID_bu�d�gName + 494 + + ) + +3075 + #OBJ_bu�d�gName + +OBJ_p��A�ribu�Ty� +,48L + + ) + +3077 + #LN_dSAQu��y + "dSAQu��y" + + ) + +3078 + #NID_dSAQu��y + 495 + + ) + +3079 + #OBJ_dSAQu��y + +OBJ_p��A�ribu�Ty� +,49L + + ) + +3081 + #LN_s�g�Lev�Qu��y + "s�g�Lev�Qu��y" + + ) + +3082 + #NID_s�g�Lev�Qu��y + 496 + + ) + +3083 + #OBJ_s�g�Lev�Qu��y + +OBJ_p��A�ribu�Ty� +,50L + + ) + +3085 + #LN_sub��M�imumQu��y + "sub��M�imumQu��y" + + ) + +3086 + #NID_sub��M�imumQu��y + 497 + + ) + +3087 + #OBJ_sub��M�imumQu��y + +OBJ_p��A�ribu�Ty� +,51L + + ) + +3089 + #LN_sub��MaximumQu��y + "sub��MaximumQu��y" + + ) + +3090 + #NID_sub��MaximumQu��y + 498 + + ) + +3091 + #OBJ_sub��MaximumQu��y + +OBJ_p��A�ribu�Ty� +,52L + + ) + +3093 + #LN_�rsڮSig�tu� + "�rsڮSig�tu�" + + ) + +3094 + #NID_�rsڮSig�tu� + 499 + + ) + +3095 + #OBJ_�rsڮSig�tu� + +OBJ_p��A�ribu�Ty� +,53L + + ) + +3097 + #LN_dITRed�e� + "dITRed�e�" + + ) + +3098 + #NID_dITRed�e� + 500 + + ) + +3099 + #OBJ_dITRed�e� + +OBJ_p��A�ribu�Ty� +,54L + + ) + +3101 + #SN_audio + "audio" + + ) + +3102 + #NID_audio + 501 + + ) + +3103 + #OBJ_audio + +OBJ_p��A�ribu�Ty� +,55L + + ) + +3105 + #LN_docum�tPublish� + "docum�tPublish�" + + ) + +3106 + #NID_docum�tPublish� + 502 + + ) + +3107 + #OBJ_docum�tPublish� + +OBJ_p��A�ribu�Ty� +,56L + + ) + +3109 + #SN_id_�t + "id-�t" + + ) + +3110 + #LN_id_�t + "Secu� E��r�i�T�n��i�s" + + ) + +3111 + #NID_id_�t + 512 + + ) + +3112 + #OBJ_id_�t + +OBJ_����iڮ_�g�iz�i�s +,42L + + ) + +3114 + #SN_�t_�y� + "�t-�y�" + + ) + +3115 + #LN_�t_�y� + "cڋ��y�s" + + ) + +3116 + #NID_�t_�y� + 513 + + ) + +3117 + #OBJ_�t_�y� + +OBJ_id_�t +,0L + + ) + +3119 + #SN_�t_msgExt + "�t-msgExt" + + ) + +3120 + #LN_�t_msgExt + "mes�g�ex�nsi�s" + + ) + +3121 + #NID_�t_msgExt + 514 + + ) + +3122 + #OBJ_�t_msgExt + +OBJ_id_�t +,1L + + ) + +3124 + #SN_�t_�� + "�t-��" + + ) + +3125 + #NID_�t_�� + 515 + + ) + +3126 + #OBJ_�t_�� + +OBJ_id_�t +,3L + + ) + +3128 + #SN_�t_p�icy + "�t-p�icy" + + ) + +3129 + #NID_�t_p�icy + 516 + + ) + +3130 + #OBJ_�t_p�icy + +OBJ_id_�t +,5L + + ) + +3132 + #SN_�t_��Ext + "�t-��Ext" + + ) + +3133 + #LN_�t_��Ext + "��ifi���x�nsi�s" + + ) + +3134 + #NID_�t_��Ext + 517 + + ) + +3135 + #OBJ_�t_��Ext + +OBJ_id_�t +,7L + + ) + +3137 + #SN_�t_b�nd + "�t-b�nd" + + ) + +3138 + #NID_�t_b�nd + 518 + + ) + +3139 + #OBJ_�t_b�nd + +OBJ_id_�t +,8L + + ) + +3141 + #SN_�t�_PAND�a + "�t�-PAND�a" + + ) + +3142 + #NID_�t�_PAND�a + 519 + + ) + +3143 + #OBJ_�t�_PAND�a + +OBJ_�t_�y� +,0L + + ) + +3145 + #SN_�t�_PANTok� + "�t�-PANTok�" + + ) + +3146 + #NID_�t�_PANTok� + 520 + + ) + +3147 + #OBJ_�t�_PANTok� + +OBJ_�t_�y� +,1L + + ) + +3149 + #SN_�t�_PANO�y + "�t�-PANO�y" + + ) + +3150 + #NID_�t�_PANO�y + 521 + + ) + +3151 + #OBJ_�t�_PANO�y + +OBJ_�t_�y� +,2L + + ) + +3153 + #SN_�t�_OID�a + "�t�-OID�a" + + ) + +3154 + #NID_�t�_OID�a + 522 + + ) + +3155 + #OBJ_�t�_OID�a + +OBJ_�t_�y� +,3L + + ) + +3157 + #SN_�t�_PI + "�t�-PI" + + ) + +3158 + #NID_�t�_PI + 523 + + ) + +3159 + #OBJ_�t�_PI + +OBJ_�t_�y� +,4L + + ) + +3161 + #SN_�t�_PID�a + "�t�-PID�a" + + ) + +3162 + #NID_�t�_PID�a + 524 + + ) + +3163 + #OBJ_�t�_PID�a + +OBJ_�t_�y� +,5L + + ) + +3165 + #SN_�t�_PID�aUnsig�d + "�t�-PID�aUnsig�d" + + ) + +3166 + #NID_�t�_PID�aUnsig�d + 525 + + ) + +3167 + #OBJ_�t�_PID�aUnsig�d + +OBJ_�t_�y� +,6L + + ) + +3169 + #SN_�t�_HODI�ut + "�t�-HODI�ut" + + ) + +3170 + #NID_�t�_HODI�ut + 526 + + ) + +3171 + #OBJ_�t�_HODI�ut + +OBJ_�t_�y� +,7L + + ) + +3173 + #SN_�t�_AuthResBaggage + "�t�-AuthResBaggage" + + ) + +3174 + #NID_�t�_AuthResBaggage + 527 + + ) + +3175 + #OBJ_�t�_AuthResBaggage + +OBJ_�t_�y� +,8L + + ) + +3177 + #SN_�t�_AuthRevReqBaggage + "�t�-AuthRevReqBaggage" + + ) + +3178 + #NID_�t�_AuthRevReqBaggage + 528 + + ) + +3179 + #OBJ_�t�_AuthRevReqBaggage + +OBJ_�t_�y� +,9L + + ) + +3181 + #SN_�t�_AuthRevResBaggage + "�t�-AuthRevResBaggage" + + ) + +3182 + #NID_�t�_AuthRevResBaggage + 529 + + ) + +3183 + #OBJ_�t�_AuthRevResBaggage + +OBJ_�t_�y� +,10L + + ) + +3185 + #SN_�t�_C�Tok�Seq + "�t�-C�Tok�Seq" + + ) + +3186 + #NID_�t�_C�Tok�Seq + 530 + + ) + +3187 + #OBJ_�t�_C�Tok�Seq + +OBJ_�t_�y� +,11L + + ) + +3189 + #SN_�t�_PIn�ResD�a + "�t�-PIn�ResD�a" + + ) + +3190 + #NID_�t�_PIn�ResD�a + 531 + + ) + +3191 + #OBJ_�t�_PIn�ResD�a + +OBJ_�t_�y� +,12L + + ) + +3193 + #SN_�t�_PI_TBS + "�t�-PI-TBS" + + ) + +3194 + #NID_�t�_PI_TBS + 532 + + ) + +3195 + #OBJ_�t�_PI_TBS + +OBJ_�t_�y� +,13L + + ) + +3197 + #SN_�t�_PResD�a + "�t�-PResD�a" + + ) + +3198 + #NID_�t�_PResD�a + 533 + + ) + +3199 + #OBJ_�t�_PResD�a + +OBJ_�t_�y� +,14L + + ) + +3201 + #SN_�t�_AuthReqTBS + "�t�-AuthReqTBS" + + ) + +3202 + #NID_�t�_AuthReqTBS + 534 + + ) + +3203 + #OBJ_�t�_AuthReqTBS + +OBJ_�t_�y� +,16L + + ) + +3205 + #SN_�t�_AuthResTBS + "�t�-AuthResTBS" + + ) + +3206 + #NID_�t�_AuthResTBS + 535 + + ) + +3207 + #OBJ_�t�_AuthResTBS + +OBJ_�t_�y� +,17L + + ) + +3209 + #SN_�t�_AuthResTBSX + "�t�-AuthResTBSX" + + ) + +3210 + #NID_�t�_AuthResTBSX + 536 + + ) + +3211 + #OBJ_�t�_AuthResTBSX + +OBJ_�t_�y� +,18L + + ) + +3213 + #SN_�t�_AuthTok�TBS + "�t�-AuthTok�TBS" + + ) + +3214 + #NID_�t�_AuthTok�TBS + 537 + + ) + +3215 + #OBJ_�t�_AuthTok�TBS + +OBJ_�t_�y� +,19L + + ) + +3217 + #SN_�t�_C�Tok�D�a + "�t�-C�Tok�D�a" + + ) + +3218 + #NID_�t�_C�Tok�D�a + 538 + + ) + +3219 + #OBJ_�t�_C�Tok�D�a + +OBJ_�t_�y� +,20L + + ) + +3221 + #SN_�t�_C�Tok�TBS + "�t�-C�Tok�TBS" + + ) + +3222 + #NID_�t�_C�Tok�TBS + 539 + + ) + +3223 + #OBJ_�t�_C�Tok�TBS + +OBJ_�t_�y� +,21L + + ) + +3225 + #SN_�t�_AcqC�dCodeMsg + "�t�-AcqC�dCodeMsg" + + ) + +3226 + #NID_�t�_AcqC�dCodeMsg + 540 + + ) + +3227 + #OBJ_�t�_AcqC�dCodeMsg + +OBJ_�t_�y� +,22L + + ) + +3229 + #SN_�t�_AuthRevReqTBS + "�t�-AuthRevReqTBS" + + ) + +3230 + #NID_�t�_AuthRevReqTBS + 541 + + ) + +3231 + #OBJ_�t�_AuthRevReqTBS + +OBJ_�t_�y� +,23L + + ) + +3233 + #SN_�t�_AuthRevResD�a + "�t�-AuthRevResD�a" + + ) + +3234 + #NID_�t�_AuthRevResD�a + 542 + + ) + +3235 + #OBJ_�t�_AuthRevResD�a + +OBJ_�t_�y� +,24L + + ) + +3237 + #SN_�t�_AuthRevResTBS + "�t�-AuthRevResTBS" + + ) + +3238 + #NID_�t�_AuthRevResTBS + 543 + + ) + +3239 + #OBJ_�t�_AuthRevResTBS + +OBJ_�t_�y� +,25L + + ) + +3241 + #SN_�t�_C�ReqTBS + "�t�-C�ReqTBS" + + ) + +3242 + #NID_�t�_C�ReqTBS + 544 + + ) + +3243 + #OBJ_�t�_C�ReqTBS + +OBJ_�t_�y� +,26L + + ) + +3245 + #SN_�t�_C�ReqTBSX + "�t�-C�ReqTBSX" + + ) + +3246 + #NID_�t�_C�ReqTBSX + 545 + + ) + +3247 + #OBJ_�t�_C�ReqTBSX + +OBJ_�t_�y� +,27L + + ) + +3249 + #SN_�t�_C�ResD�a + "�t�-C�ResD�a" + + ) + +3250 + #NID_�t�_C�ResD�a + 546 + + ) + +3251 + #OBJ_�t�_C�ResD�a + +OBJ_�t_�y� +,28L + + ) + +3253 + #SN_�t�_C�RevReqTBS + "�t�-C�RevReqTBS" + + ) + +3254 + #NID_�t�_C�RevReqTBS + 547 + + ) + +3255 + #OBJ_�t�_C�RevReqTBS + +OBJ_�t_�y� +,29L + + ) + +3257 + #SN_�t�_C�RevReqTBSX + "�t�-C�RevReqTBSX" + + ) + +3258 + #NID_�t�_C�RevReqTBSX + 548 + + ) + +3259 + #OBJ_�t�_C�RevReqTBSX + +OBJ_�t_�y� +,30L + + ) + +3261 + #SN_�t�_C�RevResD�a + "�t�-C�RevResD�a" + + ) + +3262 + #NID_�t�_C�RevResD�a + 549 + + ) + +3263 + #OBJ_�t�_C�RevResD�a + +OBJ_�t_�y� +,31L + + ) + +3265 + #SN_�t�_C�dReqTBS + "�t�-C�dReqTBS" + + ) + +3266 + #NID_�t�_C�dReqTBS + 550 + + ) + +3267 + #OBJ_�t�_C�dReqTBS + +OBJ_�t_�y� +,32L + + ) + +3269 + #SN_�t�_C�dReqTBSX + "�t�-C�dReqTBSX" + + ) + +3270 + #NID_�t�_C�dReqTBSX + 551 + + ) + +3271 + #OBJ_�t�_C�dReqTBSX + +OBJ_�t_�y� +,33L + + ) + +3273 + #SN_�t�_C�dResD�a + "�t�-C�dResD�a" + + ) + +3274 + #NID_�t�_C�dResD�a + 552 + + ) + +3275 + #OBJ_�t�_C�dResD�a + +OBJ_�t_�y� +,34L + + ) + +3277 + #SN_�t�_C�dRevReqTBS + "�t�-C�dRevReqTBS" + + ) + +3278 + #NID_�t�_C�dRevReqTBS + 553 + + ) + +3279 + #OBJ_�t�_C�dRevReqTBS + +OBJ_�t_�y� +,35L + + ) + +3281 + #SN_�t�_C�dRevReqTBSX + "�t�-C�dRevReqTBSX" + + ) + +3282 + #NID_�t�_C�dRevReqTBSX + 554 + + ) + +3283 + #OBJ_�t�_C�dRevReqTBSX + +OBJ_�t_�y� +,36L + + ) + +3285 + #SN_�t�_C�dRevResD�a + "�t�-C�dRevResD�a" + + ) + +3286 + #NID_�t�_C�dRevResD�a + 555 + + ) + +3287 + #OBJ_�t�_C�dRevResD�a + +OBJ_�t_�y� +,37L + + ) + +3289 + #SN_�t�_PC�tReqD�a + "�t�-PC�tReqD�a" + + ) + +3290 + #NID_�t�_PC�tReqD�a + 556 + + ) + +3291 + #OBJ_�t�_PC�tReqD�a + +OBJ_�t_�y� +,38L + + ) + +3293 + #SN_�t�_PC�tResTBS + "�t�-PC�tResTBS" + + ) + +3294 + #NID_�t�_PC�tResTBS + 557 + + ) + +3295 + #OBJ_�t�_PC�tResTBS + +OBJ_�t_�y� +,39L + + ) + +3297 + #SN_�t�_B�chAdm�ReqD�a + "�t�-B�chAdm�ReqD�a" + + ) + +3298 + #NID_�t�_B�chAdm�ReqD�a + 558 + + ) + +3299 + #OBJ_�t�_B�chAdm�ReqD�a + +OBJ_�t_�y� +,40L + + ) + +3301 + #SN_�t�_B�chAdm�ResD�a + "�t�-B�chAdm�ResD�a" + + ) + +3302 + #NID_�t�_B�chAdm�ResD�a + 559 + + ) + +3303 + #OBJ_�t�_B�chAdm�ResD�a + +OBJ_�t_�y� +,41L + + ) + +3305 + #SN_�t�_C�dCIn�ResTBS + "�t�-C�dCIn�ResTBS" + + ) + +3306 + #NID_�t�_C�dCIn�ResTBS + 560 + + ) + +3307 + #OBJ_�t�_C�dCIn�ResTBS + +OBJ_�t_�y� +,42L + + ) + +3309 + #SN_�t�_MeAqCIn�ResTBS + "�t�-MeAqCIn�ResTBS" + + ) + +3310 + #NID_�t�_MeAqCIn�ResTBS + 561 + + ) + +3311 + #OBJ_�t�_MeAqCIn�ResTBS + +OBJ_�t_�y� +,43L + + ) + +3313 + #SN_�t�_RegF�mResTBS + "�t�-RegF�mResTBS" + + ) + +3314 + #NID_�t�_RegF�mResTBS + 562 + + ) + +3315 + #OBJ_�t�_RegF�mResTBS + +OBJ_�t_�y� +,44L + + ) + +3317 + #SN_�t�_C�tReqD�a + "�t�-C�tReqD�a" + + ) + +3318 + #NID_�t�_C�tReqD�a + 563 + + ) + +3319 + #OBJ_�t�_C�tReqD�a + +OBJ_�t_�y� +,45L + + ) + +3321 + #SN_�t�_C�tReqTBS + "�t�-C�tReqTBS" + + ) + +3322 + #NID_�t�_C�tReqTBS + 564 + + ) + +3323 + #OBJ_�t�_C�tReqTBS + +OBJ_�t_�y� +,46L + + ) + +3325 + #SN_�t�_C�tResD�a + "�t�-C�tResD�a" + + ) + +3326 + #NID_�t�_C�tResD�a + 565 + + ) + +3327 + #OBJ_�t�_C�tResD�a + +OBJ_�t_�y� +,47L + + ) + +3329 + #SN_�t�_C�tInqReqTBS + "�t�-C�tInqReqTBS" + + ) + +3330 + #NID_�t�_C�tInqReqTBS + 566 + + ) + +3331 + #OBJ_�t�_C�tInqReqTBS + +OBJ_�t_�y� +,48L + + ) + +3333 + #SN_�t�_E��TBS + "�t�-E��TBS" + + ) + +3334 + #NID_�t�_E��TBS + 567 + + ) + +3335 + #OBJ_�t�_E��TBS + +OBJ_�t_�y� +,49L + + ) + +3337 + #SN_�t�_PIDu�Sig�dTBE + "�t�-PIDu�Sig�dTBE" + + ) + +3338 + #NID_�t�_PIDu�Sig�dTBE + 568 + + ) + +3339 + #OBJ_�t�_PIDu�Sig�dTBE + +OBJ_�t_�y� +,50L + + ) + +3341 + #SN_�t�_PIUnsig�dTBE + "�t�-PIUnsig�dTBE" + + ) + +3342 + #NID_�t�_PIUnsig�dTBE + 569 + + ) + +3343 + #OBJ_�t�_PIUnsig�dTBE + +OBJ_�t_�y� +,51L + + ) + +3345 + #SN_�t�_AuthReqTBE + "�t�-AuthReqTBE" + + ) + +3346 + #NID_�t�_AuthReqTBE + 570 + + ) + +3347 + #OBJ_�t�_AuthReqTBE + +OBJ_�t_�y� +,52L + + ) + +3349 + #SN_�t�_AuthResTBE + "�t�-AuthResTBE" + + ) + +3350 + #NID_�t�_AuthResTBE + 571 + + ) + +3351 + #OBJ_�t�_AuthResTBE + +OBJ_�t_�y� +,53L + + ) + +3353 + #SN_�t�_AuthResTBEX + "�t�-AuthResTBEX" + + ) + +3354 + #NID_�t�_AuthResTBEX + 572 + + ) + +3355 + #OBJ_�t�_AuthResTBEX + +OBJ_�t_�y� +,54L + + ) + +3357 + #SN_�t�_AuthTok�TBE + "�t�-AuthTok�TBE" + + ) + +3358 + #NID_�t�_AuthTok�TBE + 573 + + ) + +3359 + #OBJ_�t�_AuthTok�TBE + +OBJ_�t_�y� +,55L + + ) + +3361 + #SN_�t�_C�Tok�TBE + "�t�-C�Tok�TBE" + + ) + +3362 + #NID_�t�_C�Tok�TBE + 574 + + ) + +3363 + #OBJ_�t�_C�Tok�TBE + +OBJ_�t_�y� +,56L + + ) + +3365 + #SN_�t�_C�Tok�TBEX + "�t�-C�Tok�TBEX" + + ) + +3366 + #NID_�t�_C�Tok�TBEX + 575 + + ) + +3367 + #OBJ_�t�_C�Tok�TBEX + +OBJ_�t_�y� +,57L + + ) + +3369 + #SN_�t�_AcqC�dCodeMsgTBE + "�t�-AcqC�dCodeMsgTBE" + + ) + +3370 + #NID_�t�_AcqC�dCodeMsgTBE + 576 + + ) + +3371 + #OBJ_�t�_AcqC�dCodeMsgTBE + +OBJ_�t_�y� +,58L + + ) + +3373 + #SN_�t�_AuthRevReqTBE + "�t�-AuthRevReqTBE" + + ) + +3374 + #NID_�t�_AuthRevReqTBE + 577 + + ) + +3375 + #OBJ_�t�_AuthRevReqTBE + +OBJ_�t_�y� +,59L + + ) + +3377 + #SN_�t�_AuthRevResTBE + "�t�-AuthRevResTBE" + + ) + +3378 + #NID_�t�_AuthRevResTBE + 578 + + ) + +3379 + #OBJ_�t�_AuthRevResTBE + +OBJ_�t_�y� +,60L + + ) + +3381 + #SN_�t�_AuthRevResTBEB + "�t�-AuthRevResTBEB" + + ) + +3382 + #NID_�t�_AuthRevResTBEB + 579 + + ) + +3383 + #OBJ_�t�_AuthRevResTBEB + +OBJ_�t_�y� +,61L + + ) + +3385 + #SN_�t�_C�ReqTBE + "�t�-C�ReqTBE" + + ) + +3386 + #NID_�t�_C�ReqTBE + 580 + + ) + +3387 + #OBJ_�t�_C�ReqTBE + +OBJ_�t_�y� +,62L + + ) + +3389 + #SN_�t�_C�ReqTBEX + "�t�-C�ReqTBEX" + + ) + +3390 + #NID_�t�_C�ReqTBEX + 581 + + ) + +3391 + #OBJ_�t�_C�ReqTBEX + +OBJ_�t_�y� +,63L + + ) + +3393 + #SN_�t�_C�ResTBE + "�t�-C�ResTBE" + + ) + +3394 + #NID_�t�_C�ResTBE + 582 + + ) + +3395 + #OBJ_�t�_C�ResTBE + +OBJ_�t_�y� +,64L + + ) + +3397 + #SN_�t�_C�RevReqTBE + "�t�-C�RevReqTBE" + + ) + +3398 + #NID_�t�_C�RevReqTBE + 583 + + ) + +3399 + #OBJ_�t�_C�RevReqTBE + +OBJ_�t_�y� +,65L + + ) + +3401 + #SN_�t�_C�RevReqTBEX + "�t�-C�RevReqTBEX" + + ) + +3402 + #NID_�t�_C�RevReqTBEX + 584 + + ) + +3403 + #OBJ_�t�_C�RevReqTBEX + +OBJ_�t_�y� +,66L + + ) + +3405 + #SN_�t�_C�RevResTBE + "�t�-C�RevResTBE" + + ) + +3406 + #NID_�t�_C�RevResTBE + 585 + + ) + +3407 + #OBJ_�t�_C�RevResTBE + +OBJ_�t_�y� +,67L + + ) + +3409 + #SN_�t�_C�dReqTBE + "�t�-C�dReqTBE" + + ) + +3410 + #NID_�t�_C�dReqTBE + 586 + + ) + +3411 + #OBJ_�t�_C�dReqTBE + +OBJ_�t_�y� +,68L + + ) + +3413 + #SN_�t�_C�dReqTBEX + "�t�-C�dReqTBEX" + + ) + +3414 + #NID_�t�_C�dReqTBEX + 587 + + ) + +3415 + #OBJ_�t�_C�dReqTBEX + +OBJ_�t_�y� +,69L + + ) + +3417 + #SN_�t�_C�dResTBE + "�t�-C�dResTBE" + + ) + +3418 + #NID_�t�_C�dResTBE + 588 + + ) + +3419 + #OBJ_�t�_C�dResTBE + +OBJ_�t_�y� +,70L + + ) + +3421 + #SN_�t�_C�dRevReqTBE + "�t�-C�dRevReqTBE" + + ) + +3422 + #NID_�t�_C�dRevReqTBE + 589 + + ) + +3423 + #OBJ_�t�_C�dRevReqTBE + +OBJ_�t_�y� +,71L + + ) + +3425 + #SN_�t�_C�dRevReqTBEX + "�t�-C�dRevReqTBEX" + + ) + +3426 + #NID_�t�_C�dRevReqTBEX + 590 + + ) + +3427 + #OBJ_�t�_C�dRevReqTBEX + +OBJ_�t_�y� +,72L + + ) + +3429 + #SN_�t�_C�dRevResTBE + "�t�-C�dRevResTBE" + + ) + +3430 + #NID_�t�_C�dRevResTBE + 591 + + ) + +3431 + #OBJ_�t�_C�dRevResTBE + +OBJ_�t_�y� +,73L + + ) + +3433 + #SN_�t�_B�chAdm�ReqTBE + "�t�-B�chAdm�ReqTBE" + + ) + +3434 + #NID_�t�_B�chAdm�ReqTBE + 592 + + ) + +3435 + #OBJ_�t�_B�chAdm�ReqTBE + +OBJ_�t_�y� +,74L + + ) + +3437 + #SN_�t�_B�chAdm�ResTBE + "�t�-B�chAdm�ResTBE" + + ) + +3438 + #NID_�t�_B�chAdm�ResTBE + 593 + + ) + +3439 + #OBJ_�t�_B�chAdm�ResTBE + +OBJ_�t_�y� +,75L + + ) + +3441 + #SN_�t�_RegF�mReqTBE + "�t�-RegF�mReqTBE" + + ) + +3442 + #NID_�t�_RegF�mReqTBE + 594 + + ) + +3443 + #OBJ_�t�_RegF�mReqTBE + +OBJ_�t_�y� +,76L + + ) + +3445 + #SN_�t�_C�tReqTBE + "�t�-C�tReqTBE" + + ) + +3446 + #NID_�t�_C�tReqTBE + 595 + + ) + +3447 + #OBJ_�t�_C�tReqTBE + +OBJ_�t_�y� +,77L + + ) + +3449 + #SN_�t�_C�tReqTBEX + "�t�-C�tReqTBEX" + + ) + +3450 + #NID_�t�_C�tReqTBEX + 596 + + ) + +3451 + #OBJ_�t�_C�tReqTBEX + +OBJ_�t_�y� +,78L + + ) + +3453 + #SN_�t�_C�tResTBE + "�t�-C�tResTBE" + + ) + +3454 + #NID_�t�_C�tResTBE + 597 + + ) + +3455 + #OBJ_�t�_C�tResTBE + +OBJ_�t_�y� +,79L + + ) + +3457 + #SN_�t�_CRLN�ifi�ti�TBS + "�t�-CRLN�ifi�ti�TBS" + + ) + +3458 + #NID_�t�_CRLN�ifi�ti�TBS + 598 + + ) + +3459 + #OBJ_�t�_CRLN�ifi�ti�TBS + +OBJ_�t_�y� +,80L + + ) + +3461 + #SN_�t�_CRLN�ifi�ti�ResTBS + "�t�-CRLN�ifi�ti�ResTBS" + + ) + +3462 + #NID_�t�_CRLN�ifi�ti�ResTBS + 599 + + ) + +3463 + #OBJ_�t�_CRLN�ifi�ti�ResTBS + +OBJ_�t_�y� +,81L + + ) + +3465 + #SN_�t�_BCIDi�ributi�TBS + "�t�-BCIDi�ributi�TBS" + + ) + +3466 + #NID_�t�_BCIDi�ributi�TBS + 600 + + ) + +3467 + #OBJ_�t�_BCIDi�ributi�TBS + +OBJ_�t_�y� +,82L + + ) + +3469 + #SN_��xt_g�Cry� + "��xt-g�Cry�" + + ) + +3470 + #LN_��xt_g�Cry� + "g��i��y�og�m" + + ) + +3471 + #NID_��xt_g�Cry� + 601 + + ) + +3472 + #OBJ_��xt_g�Cry� + +OBJ_�t_msgExt +,1L + + ) + +3474 + #SN_��xt_miAuth + "��xt-miAuth" + + ) + +3475 + #LN_��xt_miAuth + "m�ch������d�uth" + + ) + +3476 + #NID_��xt_miAuth + 602 + + ) + +3477 + #OBJ_��xt_miAuth + +OBJ_�t_msgExt +,3L + + ) + +3479 + #SN_��xt_p�Secu� + "��xt-p�Secu�" + + ) + +3480 + #NID_��xt_p�Secu� + 603 + + ) + +3481 + #OBJ_��xt_p�Secu� + +OBJ_�t_msgExt +,4L + + ) + +3483 + #SN_��xt_p�Any + "��xt-p�Any" + + ) + +3484 + #NID_��xt_p�Any + 604 + + ) + +3485 + #OBJ_��xt_p�Any + +OBJ_�t_msgExt +,5L + + ) + +3487 + #SN_��xt_�ack2 + "��xt-�ack2" + + ) + +3488 + #NID_��xt_�ack2 + 605 + + ) + +3489 + #OBJ_��xt_�ack2 + +OBJ_�t_msgExt +,7L + + ) + +3491 + #SN_��xt_cv + "��xt-cv" + + ) + +3492 + #LN_��xt_cv + "add�iڮ v�ifi�ti�" + + ) + +3493 + #NID_��xt_cv + 606 + + ) + +3494 + #OBJ_��xt_cv + +OBJ_�t_msgExt +,8L + + ) + +3496 + #SN_�t_p�icy_ro� + "�t-p�icy-ro�" + + ) + +3497 + #NID_�t_p�icy_ro� + 607 + + ) + +3498 + #OBJ_�t_p�icy_ro� + +OBJ_�t_p�icy +,0L + + ) + +3500 + #SN_�tCext_hashedRo� + "�tCext-hashedRo�" + + ) + +3501 + #NID_�tCext_hashedRo� + 608 + + ) + +3502 + #OBJ_�tCext_hashedRo� + +OBJ_�t_��Ext +,0L + + ) + +3504 + #SN_�tCext_��Ty� + "�tCext-��Ty�" + + ) + +3505 + #NID_�tCext_��Ty� + 609 + + ) + +3506 + #OBJ_�tCext_��Ty� + +OBJ_�t_��Ext +,1L + + ) + +3508 + #SN_�tCext_m�chD�a + "�tCext-m�chD�a" + + ) + +3509 + #NID_�tCext_m�chD�a + 610 + + ) + +3510 + #OBJ_�tCext_m�chD�a + +OBJ_�t_��Ext +,2L + + ) + +3512 + #SN_�tCext_cC�tRequ�ed + "�tCext-cC�tRequ�ed" + + ) + +3513 + #NID_�tCext_cC�tRequ�ed + 611 + + ) + +3514 + #OBJ_�tCext_cC�tRequ�ed + +OBJ_�t_��Ext +,3L + + ) + +3516 + #SN_�tCext_tu�g + "�tCext-tu�g" + + ) + +3517 + #NID_�tCext_tu�g + 612 + + ) + +3518 + #OBJ_�tCext_tu�g + +OBJ_�t_��Ext +,4L + + ) + +3520 + #SN_�tCext_�tExt + "�tCext-�tExt" + + ) + +3521 + #NID_�tCext_�tExt + 613 + + ) + +3522 + #OBJ_�tCext_�tExt + +OBJ_�t_��Ext +,5L + + ) + +3524 + #SN_�tCext_�tQu�f + "�tCext-�tQu�f" + + ) + +3525 + #NID_�tCext_�tQu�f + 614 + + ) + +3526 + #OBJ_�tCext_�tQu�f + +OBJ_�t_��Ext +,6L + + ) + +3528 + #SN_�tCext_PGWY��b���s + "�tCext-PGWY��b���s" + + ) + +3529 + #NID_�tCext_PGWY��b���s + 615 + + ) + +3530 + #OBJ_�tCext_PGWY��b���s + +OBJ_�t_��Ext +,7L + + ) + +3532 + #SN_�tCext_Tok�Id�tif�r + "�tCext-Tok�Id�tif�r" + + ) + +3533 + #NID_�tCext_Tok�Id�tif�r + 616 + + ) + +3534 + #OBJ_�tCext_Tok�Id�tif�r + +OBJ_�t_��Ext +,8L + + ) + +3536 + #SN_�tCext_T�ck2D�a + "�tCext-T�ck2D�a" + + ) + +3537 + #NID_�tCext_T�ck2D�a + 617 + + ) + +3538 + #OBJ_�tCext_T�ck2D�a + +OBJ_�t_��Ext +,9L + + ) + +3540 + #SN_�tCext_Tok�Ty� + "�tCext-Tok�Ty�" + + ) + +3541 + #NID_�tCext_Tok�Ty� + 618 + + ) + +3542 + #OBJ_�tCext_Tok�Ty� + +OBJ_�t_��Ext +,10L + + ) + +3544 + #SN_�tCext_Issu�C�ab���s + "�tCext-Issu�C�ab���s" + + ) + +3545 + #NID_�tCext_Issu�C�ab���s + 619 + + ) + +3546 + #OBJ_�tCext_Issu�C�ab���s + +OBJ_�t_��Ext +,11L + + ) + +3548 + #SN_�tA�r_C�t + "�tA�r-C�t" + + ) + +3549 + #NID_�tA�r_C�t + 620 + + ) + +3550 + #OBJ_�tA�r_C�t + +OBJ_�t_�� +,0L + + ) + +3552 + #SN_�tA�r_PGWY�p + "�tA�r-PGWY�p" + + ) + +3553 + #LN_�tA�r_PGWY�p + "�ym��g�eway c�ab���s" + + ) + +3554 + #NID_�tA�r_PGWY�p + 621 + + ) + +3555 + #OBJ_�tA�r_PGWY�p + +OBJ_�t_�� +,1L + + ) + +3557 + #SN_�tA�r_Tok�Ty� + "�tA�r-Tok�Ty�" + + ) + +3558 + #NID_�tA�r_Tok�Ty� + 622 + + ) + +3559 + #OBJ_�tA�r_Tok�Ty� + +OBJ_�t_�� +,2L + + ) + +3561 + #SN_�tA�r_IssC� + "�tA�r-IssC�" + + ) + +3562 + #LN_�tA�r_IssC� + "issu� c�ab���s" + + ) + +3563 + #NID_�tA�r_IssC� + 623 + + ) + +3564 + #OBJ_�tA�r_IssC� + +OBJ_�t_�� +,3L + + ) + +3566 + #SN_�t_ro�KeyThumb + "�t-ro�KeyThumb" + + ) + +3567 + #NID_�t_ro�KeyThumb + 624 + + ) + +3568 + #OBJ_�t_ro�KeyThumb + +OBJ_�tA�r_C�t +,0L + + ) + +3570 + #SN_�t_addP�icy + "�t-addP�icy" + + ) + +3571 + #NID_�t_addP�icy + 625 + + ) + +3572 + #OBJ_�t_addP�icy + +OBJ_�tA�r_C�t +,1L + + ) + +3574 + #SN_�tA�r_Tok�_EMV + "�tA�r-Tok�-EMV" + + ) + +3575 + #NID_�tA�r_Tok�_EMV + 626 + + ) + +3576 + #OBJ_�tA�r_Tok�_EMV + +OBJ_�tA�r_Tok�Ty� +,1L + + ) + +3578 + #SN_�tA�r_Tok�_B0Prime + "�tA�r-Tok�-B0Prime" + + ) + +3579 + #NID_�tA�r_Tok�_B0Prime + 627 + + ) + +3580 + #OBJ_�tA�r_Tok�_B0Prime + +OBJ_�tA�r_Tok�Ty� +,2L + + ) + +3582 + #SN_�tA�r_IssC�_CVM + "�tA�r-IssC�-CVM" + + ) + +3583 + #NID_�tA�r_IssC�_CVM + 628 + + ) + +3584 + #OBJ_�tA�r_IssC�_CVM + +OBJ_�tA�r_IssC� +,3L + + ) + +3586 + #SN_�tA�r_IssC�_T2 + "�tA�r-IssC�-T2" + + ) + +3587 + #NID_�tA�r_IssC�_T2 + 629 + + ) + +3588 + #OBJ_�tA�r_IssC�_T2 + +OBJ_�tA�r_IssC� +,4L + + ) + +3590 + #SN_�tA�r_IssC�_Sig + "�tA�r-IssC�-Sig" + + ) + +3591 + #NID_�tA�r_IssC�_Sig + 630 + + ) + +3592 + #OBJ_�tA�r_IssC�_Sig + +OBJ_�tA�r_IssC� +,5L + + ) + +3594 + #SN_�tA�r_G�Cry�grm + "�tA�r-G�Cry�grm" + + ) + +3595 + #LN_�tA�r_G�Cry�grm + "g�����y�og�m" + + ) + +3596 + #NID_�tA�r_G�Cry�grm + 631 + + ) + +3597 + #OBJ_�tA�r_G�Cry�grm + +OBJ_�tA�r_IssC�_CVM +,1L + + ) + +3599 + #SN_�tA�r_T2Enc + "�tA�r-T2Enc" + + ) + +3600 + #LN_�tA�r_T2Enc + "��y�ed��ck 2" + + ) + +3601 + #NID_�tA�r_T2Enc + 632 + + ) + +3602 + #OBJ_�tA�r_T2Enc + +OBJ_�tA�r_IssC�_T2 +,1L + + ) + +3604 + #SN_�tA�r_T2���xt + "�tA�r-T2���xt" + + ) + +3605 + #LN_�tA�r_T2���xt + "���ex��ack 2" + + ) + +3606 + #NID_�tA�r_T2���xt + 633 + + ) + +3607 + #OBJ_�tA�r_T2���xt + +OBJ_�tA�r_IssC�_T2 +,2L + + ) + +3609 + #SN_�tA�r_TokICCsig + "�tA�r-TokICCsig" + + ) + +3610 + #LN_�tA�r_TokICCsig + "ICC o�tok� sig�tu�" + + ) + +3611 + #NID_�tA�r_TokICCsig + 634 + + ) + +3612 + #OBJ_�tA�r_TokICCsig + +OBJ_�tA�r_IssC�_Sig +,1L + + ) + +3614 + #SN_�tA�r_SecDevSig + "�tA�r-SecDevSig" + + ) + +3615 + #LN_�tA�r_SecDevSig + "�cu� devi� sig�tu�" + + ) + +3616 + #NID_�tA�r_SecDevSig + 635 + + ) + +3617 + #OBJ_�tA�r_SecDevSig + +OBJ_�tA�r_IssC�_Sig +,2L + + ) + +3619 + #SN_�t_b�nd_IATA_ATA + "�t-b�nd-IATA-ATA" + + ) + +3620 + #NID_�t_b�nd_IATA_ATA + 636 + + ) + +3621 + #OBJ_�t_b�nd_IATA_ATA + +OBJ_�t_b�nd +,1L + + ) + +3623 + #SN_�t_b�nd_D��s + "�t-b�nd-D��s" + + ) + +3624 + #NID_�t_b�nd_D��s + 637 + + ) + +3625 + #OBJ_�t_b�nd_D��s + +OBJ_�t_b�nd +,30L + + ) + +3627 + #SN_�t_b�nd_Am�i�nEx�ess + "�t-b�nd-Am�i�nEx�ess" + + ) + +3628 + #NID_�t_b�nd_Am�i�nEx�ess + 638 + + ) + +3629 + #OBJ_�t_b�nd_Am�i�nEx�ess + +OBJ_�t_b�nd +,34L + + ) + +3631 + #SN_�t_b�nd_JCB + "�t-b�nd-JCB" + + ) + +3632 + #NID_�t_b�nd_JCB + 639 + + ) + +3633 + #OBJ_�t_b�nd_JCB + +OBJ_�t_b�nd +,35L + + ) + +3635 + #SN_�t_b�nd_Vi� + "�t-b�nd-Vi�" + + ) + +3636 + #NID_�t_b�nd_Vi� + 640 + + ) + +3637 + #OBJ_�t_b�nd_Vi� + +OBJ_�t_b�nd +,4L + + ) + +3639 + #SN_�t_b�nd_Ma��C�d + "�t-b�nd-Ma��C�d" + + ) + +3640 + #NID_�t_b�nd_Ma��C�d + 641 + + ) + +3641 + #OBJ_�t_b�nd_Ma��C�d + +OBJ_�t_b�nd +,5L + + ) + +3643 + #SN_�t_b�nd_Novus + "�t-b�nd-Novus" + + ) + +3644 + #NID_�t_b�nd_Novus + 642 + + ) + +3645 + #OBJ_�t_b�nd_Novus + +OBJ_�t_b�nd +,6011L + + ) + +3647 + #SN_des_cdmf + "DES-CDMF" + + ) + +3648 + #LN_des_cdmf + "des-cdmf" + + ) + +3649 + #NID_des_cdmf + 643 + + ) + +3650 + #OBJ_des_cdmf + +OBJ_r�dsi +,3L,10L + + ) + +3652 + #SN_r�OAEPEn�y�i�SET + "r�OAEPEn�y�i�SET" + + ) + +3653 + #NID_r�OAEPEn�y�i�SET + 644 + + ) + +3654 + #OBJ_r�OAEPEn�y�i�SET + +OBJ_r�dsi +,1L,1L,6L + + ) + +3656 + #SN_��c3 + "Oak�y-EC2N-3" + + ) + +3657 + #LN_��c3 + "��c3" + + ) + +3658 + #NID_��c3 + 749 + + ) + +3660 + #SN_��c4 + "Oak�y-EC2N-4" + + ) + +3661 + #LN_��c4 + "��c4" + + ) + +3662 + #NID_��c4 + 750 + + ) + +3664 + #SN_wh��o� + "wh��o�" + + ) + +3665 + #NID_wh��o� + 804 + + ) + +3666 + #OBJ_wh��o� + +OBJ_iso +,0L,10118L,3L,0L,55L + + ) + +3668 + #SN_�y��ro + "�y��ro" + + ) + +3669 + #NID_�y��ro + 805 + + ) + +3670 + #OBJ_�y��ro + +OBJ_memb�_body +,643L,2L,2L + + ) + +3672 + #SN_�y�ocom + "�y�ocom" + + ) + +3673 + #NID_�y�ocom + 806 + + ) + +3674 + #OBJ_�y�ocom + +OBJ_memb�_body +,643L,2L,9L + + ) + +3676 + #SN_id_Go�R3411_94_w�h_Go�R3410_2001 + "id-Go�R3411-94-w�h-Go�R3410-2001" + + ) + +3677 + #LN_id_Go�R3411_94_w�h_Go�R3410_2001 + "GOST R 34.11-94 w�h GOST R 34.10-2001" + + ) + +3678 + #NID_id_Go�R3411_94_w�h_Go�R3410_2001 + 807 + + ) + +3679 + #OBJ_id_Go�R3411_94_w�h_Go�R3410_2001 + +OBJ_�y��ro +,3L + + ) + +3681 + #SN_id_Go�R3411_94_w�h_Go�R3410_94 + "id-Go�R3411-94-w�h-Go�R3410-94" + + ) + +3682 + #LN_id_Go�R3411_94_w�h_Go�R3410_94 + "GOST R 34.11-94 w�h GOST R 34.10-94" + + ) + +3683 + #NID_id_Go�R3411_94_w�h_Go�R3410_94 + 808 + + ) + +3684 + #OBJ_id_Go�R3411_94_w�h_Go�R3410_94 + +OBJ_�y��ro +,4L + + ) + +3686 + #SN_id_Go�R3411_94 + "md_go�94" + + ) + +3687 + #LN_id_Go�R3411_94 + "GOST R 34.11-94" + + ) + +3688 + #NID_id_Go�R3411_94 + 809 + + ) + +3689 + #OBJ_id_Go�R3411_94 + +OBJ_�y��ro +,9L + + ) + +3691 + #SN_id_HMACGo�R3411_94 + "id-HMACGo�R3411-94" + + ) + +3692 + #LN_id_HMACGo�R3411_94 + "HMAC GOST 34.11-94" + + ) + +3693 + #NID_id_HMACGo�R3411_94 + 810 + + ) + +3694 + #OBJ_id_HMACGo�R3411_94 + +OBJ_�y��ro +,10L + + ) + +3696 + #SN_id_Go�R3410_2001 + "go�2001" + + ) + +3697 + #LN_id_Go�R3410_2001 + "GOST R 34.10-2001" + + ) + +3698 + #NID_id_Go�R3410_2001 + 811 + + ) + +3699 + #OBJ_id_Go�R3410_2001 + +OBJ_�y��ro +,19L + + ) + +3701 + #SN_id_Go�R3410_94 + "go�94" + + ) + +3702 + #LN_id_Go�R3410_94 + "GOST R 34.10-94" + + ) + +3703 + #NID_id_Go�R3410_94 + 812 + + ) + +3704 + #OBJ_id_Go�R3410_94 + +OBJ_�y��ro +,20L + + ) + +3706 + #SN_id_Go�28147_89 + "go�89" + + ) + +3707 + #LN_id_Go�28147_89 + "GOST 28147-89" + + ) + +3708 + #NID_id_Go�28147_89 + 813 + + ) + +3709 + #OBJ_id_Go�28147_89 + +OBJ_�y��ro +,21L + + ) + +3711 + #SN_go�89_�t + "go�89-�t" + + ) + +3712 + #NID_go�89_�t + 814 + + ) + +3714 + #SN_id_Go�28147_89_MAC + "go�-mac" + + ) + +3715 + #LN_id_Go�28147_89_MAC + "GOST 28147-89 MAC" + + ) + +3716 + #NID_id_Go�28147_89_MAC + 815 + + ) + +3717 + #OBJ_id_Go�28147_89_MAC + +OBJ_�y��ro +,22L + + ) + +3719 + #SN_id_Go�R3411_94_�f + "�f-go�r3411-94" + + ) + +3720 + #LN_id_Go�R3411_94_�f + "GOST R 34.11-94 PRF" + + ) + +3721 + #NID_id_Go�R3411_94_�f + 816 + + ) + +3722 + #OBJ_id_Go�R3411_94_�f + +OBJ_�y��ro +,23L + + ) + +3724 + #SN_id_Go�R3410_2001DH + "id-Go�R3410-2001DH" + + ) + +3725 + #LN_id_Go�R3410_2001DH + "GOST R 34.10-2001 DH" + + ) + +3726 + #NID_id_Go�R3410_2001DH + 817 + + ) + +3727 + #OBJ_id_Go�R3410_2001DH + +OBJ_�y��ro +,98L + + ) + +3729 + #SN_id_Go�R3410_94DH + "id-Go�R3410-94DH" + + ) + +3730 + #LN_id_Go�R3410_94DH + "GOST R 34.10-94 DH" + + ) + +3731 + #NID_id_Go�R3410_94DH + 818 + + ) + +3732 + #OBJ_id_Go�R3410_94DH + +OBJ_�y��ro +,99L + + ) + +3734 + #SN_id_Go�28147_89_Cry�oPro_KeyMesh�g + "id-Go�28147-89-Cry�oPro-KeyMesh�g" + + ) + +3735 + #NID_id_Go�28147_89_Cry�oPro_KeyMesh�g + 819 + + ) + +3736 + #OBJ_id_Go�28147_89_Cry�oPro_KeyMesh�g + +OBJ_�y��ro +,14L,1L + + ) + +3738 + #SN_id_Go�28147_89_N�e_KeyMesh�g + "id-Go�28147-89-N�e-KeyMesh�g" + + ) + +3739 + #NID_id_Go�28147_89_N�e_KeyMesh�g + 820 + + ) + +3740 + #OBJ_id_Go�28147_89_N�e_KeyMesh�g + +OBJ_�y��ro +,14L,0L + + ) + +3742 + #SN_id_Go�R3411_94_Te�P�amS� + "id-Go�R3411-94-Te�P�amS�" + + ) + +3743 + #NID_id_Go�R3411_94_Te�P�amS� + 821 + + ) + +3744 + #OBJ_id_Go�R3411_94_Te�P�amS� + +OBJ_�y��ro +,30L,0L + + ) + +3746 + #SN_id_Go�R3411_94_Cry�oProP�amS� + "id-Go�R3411-94-Cry�oProP�amS�" + + ) + +3747 + #NID_id_Go�R3411_94_Cry�oProP�amS� + 822 + + ) + +3748 + #OBJ_id_Go�R3411_94_Cry�oProP�amS� + +OBJ_�y��ro +,30L,1L + + ) + +3750 + #SN_id_Go�28147_89_Te�P�amS� + "id-Go�28147-89-Te�P�amS�" + + ) + +3751 + #NID_id_Go�28147_89_Te�P�amS� + 823 + + ) + +3752 + #OBJ_id_Go�28147_89_Te�P�amS� + +OBJ_�y��ro +,31L,0L + + ) + +3754 + #SN_id_Go�28147_89_Cry�oPro_A_P�amS� + "id-Go�28147-89-Cry�oPro-A-P�amS�" + + ) + +3755 + #NID_id_Go�28147_89_Cry�oPro_A_P�amS� + 824 + + ) + +3756 + #OBJ_id_Go�28147_89_Cry�oPro_A_P�amS� + +OBJ_�y��ro +,31L,1L + + ) + +3758 + #SN_id_Go�28147_89_Cry�oPro_B_P�amS� + "id-Go�28147-89-Cry�oPro-B-P�amS�" + + ) + +3759 + #NID_id_Go�28147_89_Cry�oPro_B_P�amS� + 825 + + ) + +3760 + #OBJ_id_Go�28147_89_Cry�oPro_B_P�amS� + +OBJ_�y��ro +,31L,2L + + ) + +3762 + #SN_id_Go�28147_89_Cry�oPro_C_P�amS� + "id-Go�28147-89-Cry�oPro-C-P�amS�" + + ) + +3763 + #NID_id_Go�28147_89_Cry�oPro_C_P�amS� + 826 + + ) + +3764 + #OBJ_id_Go�28147_89_Cry�oPro_C_P�amS� + +OBJ_�y��ro +,31L,3L + + ) + +3766 + #SN_id_Go�28147_89_Cry�oPro_D_P�amS� + "id-Go�28147-89-Cry�oPro-D-P�amS�" + + ) + +3767 + #NID_id_Go�28147_89_Cry�oPro_D_P�amS� + 827 + + ) + +3768 + #OBJ_id_Go�28147_89_Cry�oPro_D_P�amS� + +OBJ_�y��ro +,31L,4L + + ) + +3770 + #SN_id_Go�28147_89_Cry�oPro_Os�r_1_1_P�amS� + "id-Go�28147-89-Cry�oPro-Os�r-1-1-P�amS�" + + ) + +3771 + #NID_id_Go�28147_89_Cry�oPro_Os�r_1_1_P�amS� + 828 + + ) + +3772 + #OBJ_id_Go�28147_89_Cry�oPro_Os�r_1_1_P�amS� + +OBJ_�y��ro +,31L,5L + + ) + +3774 + #SN_id_Go�28147_89_Cry�oPro_Os�r_1_0_P�amS� + "id-Go�28147-89-Cry�oPro-Os�r-1-0-P�amS�" + + ) + +3775 + #NID_id_Go�28147_89_Cry�oPro_Os�r_1_0_P�amS� + 829 + + ) + +3776 + #OBJ_id_Go�28147_89_Cry�oPro_Os�r_1_0_P�amS� + +OBJ_�y��ro +,31L,6L + + ) + +3778 + #SN_id_Go�28147_89_Cry�oPro_RIC_1_P�amS� + "id-Go�28147-89-Cry�oPro-RIC-1-P�amS�" + + ) + +3779 + #NID_id_Go�28147_89_Cry�oPro_RIC_1_P�amS� + 830 + + ) + +3780 + #OBJ_id_Go�28147_89_Cry�oPro_RIC_1_P�amS� + +OBJ_�y��ro +,31L,7L + + ) + +3782 + #SN_id_Go�R3410_94_Te�P�amS� + "id-Go�R3410-94-Te�P�amS�" + + ) + +3783 + #NID_id_Go�R3410_94_Te�P�amS� + 831 + + ) + +3784 + #OBJ_id_Go�R3410_94_Te�P�amS� + +OBJ_�y��ro +,32L,0L + + ) + +3786 + #SN_id_Go�R3410_94_Cry�oPro_A_P�amS� + "id-Go�R3410-94-Cry�oPro-A-P�amS�" + + ) + +3787 + #NID_id_Go�R3410_94_Cry�oPro_A_P�amS� + 832 + + ) + +3788 + #OBJ_id_Go�R3410_94_Cry�oPro_A_P�amS� + +OBJ_�y��ro +,32L,2L + + ) + +3790 + #SN_id_Go�R3410_94_Cry�oPro_B_P�amS� + "id-Go�R3410-94-Cry�oPro-B-P�amS�" + + ) + +3791 + #NID_id_Go�R3410_94_Cry�oPro_B_P�amS� + 833 + + ) + +3792 + #OBJ_id_Go�R3410_94_Cry�oPro_B_P�amS� + +OBJ_�y��ro +,32L,3L + + ) + +3794 + #SN_id_Go�R3410_94_Cry�oPro_C_P�amS� + "id-Go�R3410-94-Cry�oPro-C-P�amS�" + + ) + +3795 + #NID_id_Go�R3410_94_Cry�oPro_C_P�amS� + 834 + + ) + +3796 + #OBJ_id_Go�R3410_94_Cry�oPro_C_P�amS� + +OBJ_�y��ro +,32L,4L + + ) + +3798 + #SN_id_Go�R3410_94_Cry�oPro_D_P�amS� + "id-Go�R3410-94-Cry�oPro-D-P�amS�" + + ) + +3799 + #NID_id_Go�R3410_94_Cry�oPro_D_P�amS� + 835 + + ) + +3800 + #OBJ_id_Go�R3410_94_Cry�oPro_D_P�amS� + +OBJ_�y��ro +,32L,5L + + ) + +3802 + #SN_id_Go�R3410_94_Cry�oPro_XchA_P�amS� + "id-Go�R3410-94-Cry�oPro-XchA-P�amS�" + + ) + +3803 + #NID_id_Go�R3410_94_Cry�oPro_XchA_P�amS� + 836 + + ) + +3804 + #OBJ_id_Go�R3410_94_Cry�oPro_XchA_P�amS� + +OBJ_�y��ro +,33L,1L + + ) + +3806 + #SN_id_Go�R3410_94_Cry�oPro_XchB_P�amS� + "id-Go�R3410-94-Cry�oPro-XchB-P�amS�" + + ) + +3807 + #NID_id_Go�R3410_94_Cry�oPro_XchB_P�amS� + 837 + + ) + +3808 + #OBJ_id_Go�R3410_94_Cry�oPro_XchB_P�amS� + +OBJ_�y��ro +,33L,2L + + ) + +3810 + #SN_id_Go�R3410_94_Cry�oPro_XchC_P�amS� + "id-Go�R3410-94-Cry�oPro-XchC-P�amS�" + + ) + +3811 + #NID_id_Go�R3410_94_Cry�oPro_XchC_P�amS� + 838 + + ) + +3812 + #OBJ_id_Go�R3410_94_Cry�oPro_XchC_P�amS� + +OBJ_�y��ro +,33L,3L + + ) + +3814 + #SN_id_Go�R3410_2001_Te�P�amS� + "id-Go�R3410-2001-Te�P�amS�" + + ) + +3815 + #NID_id_Go�R3410_2001_Te�P�amS� + 839 + + ) + +3816 + #OBJ_id_Go�R3410_2001_Te�P�amS� + +OBJ_�y��ro +,35L,0L + + ) + +3818 + #SN_id_Go�R3410_2001_Cry�oPro_A_P�amS� + "id-Go�R3410-2001-Cry�oPro-A-P�amS�" + + ) + +3819 + #NID_id_Go�R3410_2001_Cry�oPro_A_P�amS� + 840 + + ) + +3820 + #OBJ_id_Go�R3410_2001_Cry�oPro_A_P�amS� + +OBJ_�y��ro +,35L,1L + + ) + +3822 + #SN_id_Go�R3410_2001_Cry�oPro_B_P�amS� + "id-Go�R3410-2001-Cry�oPro-B-P�amS�" + + ) + +3823 + #NID_id_Go�R3410_2001_Cry�oPro_B_P�amS� + 841 + + ) + +3824 + #OBJ_id_Go�R3410_2001_Cry�oPro_B_P�amS� + +OBJ_�y��ro +,35L,2L + + ) + +3826 + #SN_id_Go�R3410_2001_Cry�oPro_C_P�amS� + "id-Go�R3410-2001-Cry�oPro-C-P�amS�" + + ) + +3827 + #NID_id_Go�R3410_2001_Cry�oPro_C_P�amS� + 842 + + ) + +3828 + #OBJ_id_Go�R3410_2001_Cry�oPro_C_P�amS� + +OBJ_�y��ro +,35L,3L + + ) + +3830 + #SN_id_Go�R3410_2001_Cry�oPro_XchA_P�amS� + "id-Go�R3410-2001-Cry�oPro-XchA-P�amS�" + + ) + +3831 + #NID_id_Go�R3410_2001_Cry�oPro_XchA_P�amS� + 843 + + ) + +3832 + #OBJ_id_Go�R3410_2001_Cry�oPro_XchA_P�amS� + +OBJ_�y��ro +,36L,0L + + ) + +3834 + #SN_id_Go�R3410_2001_Cry�oPro_XchB_P�amS� + "id-Go�R3410-2001-Cry�oPro-XchB-P�amS�" + + ) + +3835 + #NID_id_Go�R3410_2001_Cry�oPro_XchB_P�amS� + 844 + + ) + +3836 + #OBJ_id_Go�R3410_2001_Cry�oPro_XchB_P�amS� + +OBJ_�y��ro +,36L,1L + + ) + +3838 + #SN_id_Go�R3410_94_a + "id-Go�R3410-94-a" + + ) + +3839 + #NID_id_Go�R3410_94_a + 845 + + ) + +3840 + #OBJ_id_Go�R3410_94_a + +OBJ_id_Go�R3410_94 +,1L + + ) + +3842 + #SN_id_Go�R3410_94_aBis + "id-Go�R3410-94-aBis" + + ) + +3843 + #NID_id_Go�R3410_94_aBis + 846 + + ) + +3844 + #OBJ_id_Go�R3410_94_aBis + +OBJ_id_Go�R3410_94 +,2L + + ) + +3846 + #SN_id_Go�R3410_94_b + "id-Go�R3410-94-b" + + ) + +3847 + #NID_id_Go�R3410_94_b + 847 + + ) + +3848 + #OBJ_id_Go�R3410_94_b + +OBJ_id_Go�R3410_94 +,3L + + ) + +3850 + #SN_id_Go�R3410_94_bBis + "id-Go�R3410-94-bBis" + + ) + +3851 + #NID_id_Go�R3410_94_bBis + 848 + + ) + +3852 + #OBJ_id_Go�R3410_94_bBis + +OBJ_id_Go�R3410_94 +,4L + + ) + +3854 + #SN_id_Go�28147_89_cc + "id-Go�28147-89-cc" + + ) + +3855 + #LN_id_Go�28147_89_cc + "GOST 28147-89 Cry�ocom P�amS�" + + ) + +3856 + #NID_id_Go�28147_89_cc + 849 + + ) + +3857 + #OBJ_id_Go�28147_89_cc + +OBJ_�y�ocom +,1L,6L,1L + + ) + +3859 + #SN_id_Go�R3410_94_cc + "go�94cc" + + ) + +3860 + #LN_id_Go�R3410_94_cc + "GOST 34.10-94 Cry�ocom" + + ) + +3861 + #NID_id_Go�R3410_94_cc + 850 + + ) + +3862 + #OBJ_id_Go�R3410_94_cc + +OBJ_�y�ocom +,1L,5L,3L + + ) + +3864 + #SN_id_Go�R3410_2001_cc + "go�2001cc" + + ) + +3865 + #LN_id_Go�R3410_2001_cc + "GOST 34.10-2001 Cry�ocom" + + ) + +3866 + #NID_id_Go�R3410_2001_cc + 851 + + ) + +3867 + #OBJ_id_Go�R3410_2001_cc + +OBJ_�y�ocom +,1L,5L,4L + + ) + +3869 + #SN_id_Go�R3411_94_w�h_Go�R3410_94_cc + "id-Go�R3411-94-w�h-Go�R3410-94-cc" + + ) + +3870 + #LN_id_Go�R3411_94_w�h_Go�R3410_94_cc + "GOST R 34.11-94 w�h GOST R 34.10-94 Cry�ocom" + + ) + +3871 + #NID_id_Go�R3411_94_w�h_Go�R3410_94_cc + 852 + + ) + +3872 + #OBJ_id_Go�R3411_94_w�h_Go�R3410_94_cc + +OBJ_�y�ocom +,1L,3L,3L + + ) + +3874 + #SN_id_Go�R3411_94_w�h_Go�R3410_2001_cc + "id-Go�R3411-94-w�h-Go�R3410-2001-cc" + + ) + +3875 + #LN_id_Go�R3411_94_w�h_Go�R3410_2001_cc + "GOST R 34.11-94 w�h GOST R 34.10-2001 Cry�ocom" + + ) + +3876 + #NID_id_Go�R3411_94_w�h_Go�R3410_2001_cc + 853 + + ) + +3877 + #OBJ_id_Go�R3411_94_w�h_Go�R3410_2001_cc + +OBJ_�y�ocom +,1L,3L,4L + + ) + +3879 + #SN_id_Go�R3410_2001_P�amS�_cc + "id-Go�R3410-2001-P�amS�-cc" + + ) + +3880 + #LN_id_Go�R3410_2001_P�amS�_cc + "GOST R 3410-2001 P�am�� S� Cry�ocom" + + ) + +3881 + #NID_id_Go�R3410_2001_P�amS�_cc + 854 + + ) + +3882 + #OBJ_id_Go�R3410_2001_P�amS�_cc + +OBJ_�y�ocom +,1L,8L,1L + + ) + +3884 + #SN_�m�l�_128_cbc + "CAMELLIA-128-CBC" + + ) + +3885 + #LN_�m�l�_128_cbc + "�m�l�-128-cbc" + + ) + +3886 + #NID_�m�l�_128_cbc + 751 + + ) + +3887 + #OBJ_�m�l�_128_cbc + 1L,2L,392L,200011L,61L,1L,1L,1L,2L + + ) + +3889 + #SN_�m�l�_192_cbc + "CAMELLIA-192-CBC" + + ) + +3890 + #LN_�m�l�_192_cbc + "�m�l�-192-cbc" + + ) + +3891 + #NID_�m�l�_192_cbc + 752 + + ) + +3892 + #OBJ_�m�l�_192_cbc + 1L,2L,392L,200011L,61L,1L,1L,1L,3L + + ) + +3894 + #SN_�m�l�_256_cbc + "CAMELLIA-256-CBC" + + ) + +3895 + #LN_�m�l�_256_cbc + "�m�l�-256-cbc" + + ) + +3896 + #NID_�m�l�_256_cbc + 753 + + ) + +3897 + #OBJ_�m�l�_256_cbc + 1L,2L,392L,200011L,61L,1L,1L,1L,4L + + ) + +3899 + #SN_id_�m�l�128_w�p + "id-�m�l�128-w�p" + + ) + +3900 + #NID_id_�m�l�128_w�p + 907 + + ) + +3901 + #OBJ_id_�m�l�128_w�p + 1L,2L,392L,200011L,61L,1L,1L,3L,2L + + ) + +3903 + #SN_id_�m�l�192_w�p + "id-�m�l�192-w�p" + + ) + +3904 + #NID_id_�m�l�192_w�p + 908 + + ) + +3905 + #OBJ_id_�m�l�192_w�p + 1L,2L,392L,200011L,61L,1L,1L,3L,3L + + ) + +3907 + #SN_id_�m�l�256_w�p + "id-�m�l�256-w�p" + + ) + +3908 + #NID_id_�m�l�256_w�p + 909 + + ) + +3909 + #OBJ_id_�m�l�256_w�p + 1L,2L,392L,200011L,61L,1L,1L,3L,4L + + ) + +3911 + #OBJ_�t_ds + 0L,3L,4401L,5L + + ) + +3913 + #OBJ_�m�l� + +OBJ_�t_ds +,3L,1L,9L + + ) + +3915 + #SN_�m�l�_128_ecb + "CAMELLIA-128-ECB" + + ) + +3916 + #LN_�m�l�_128_ecb + "�m�l�-128-ecb" + + ) + +3917 + #NID_�m�l�_128_ecb + 754 + + ) + +3918 + #OBJ_�m�l�_128_ecb + +OBJ_�m�l� +,1L + + ) + +3920 + #SN_�m�l�_128_ofb128 + "CAMELLIA-128-OFB" + + ) + +3921 + #LN_�m�l�_128_ofb128 + "�m�l�-128-ofb" + + ) + +3922 + #NID_�m�l�_128_ofb128 + 766 + + ) + +3923 + #OBJ_�m�l�_128_ofb128 + +OBJ_�m�l� +,3L + + ) + +3925 + #SN_�m�l�_128_cfb128 + "CAMELLIA-128-CFB" + + ) + +3926 + #LN_�m�l�_128_cfb128 + "�m�l�-128-cfb" + + ) + +3927 + #NID_�m�l�_128_cfb128 + 757 + + ) + +3928 + #OBJ_�m�l�_128_cfb128 + +OBJ_�m�l� +,4L + + ) + +3930 + #SN_�m�l�_192_ecb + "CAMELLIA-192-ECB" + + ) + +3931 + #LN_�m�l�_192_ecb + "�m�l�-192-ecb" + + ) + +3932 + #NID_�m�l�_192_ecb + 755 + + ) + +3933 + #OBJ_�m�l�_192_ecb + +OBJ_�m�l� +,21L + + ) + +3935 + #SN_�m�l�_192_ofb128 + "CAMELLIA-192-OFB" + + ) + +3936 + #LN_�m�l�_192_ofb128 + "�m�l�-192-ofb" + + ) + +3937 + #NID_�m�l�_192_ofb128 + 767 + + ) + +3938 + #OBJ_�m�l�_192_ofb128 + +OBJ_�m�l� +,23L + + ) + +3940 + #SN_�m�l�_192_cfb128 + "CAMELLIA-192-CFB" + + ) + +3941 + #LN_�m�l�_192_cfb128 + "�m�l�-192-cfb" + + ) + +3942 + #NID_�m�l�_192_cfb128 + 758 + + ) + +3943 + #OBJ_�m�l�_192_cfb128 + +OBJ_�m�l� +,24L + + ) + +3945 + #SN_�m�l�_256_ecb + "CAMELLIA-256-ECB" + + ) + +3946 + #LN_�m�l�_256_ecb + "�m�l�-256-ecb" + + ) + +3947 + #NID_�m�l�_256_ecb + 756 + + ) + +3948 + #OBJ_�m�l�_256_ecb + +OBJ_�m�l� +,41L + + ) + +3950 + #SN_�m�l�_256_ofb128 + "CAMELLIA-256-OFB" + + ) + +3951 + #LN_�m�l�_256_ofb128 + "�m�l�-256-ofb" + + ) + +3952 + #NID_�m�l�_256_ofb128 + 768 + + ) + +3953 + #OBJ_�m�l�_256_ofb128 + +OBJ_�m�l� +,43L + + ) + +3955 + #SN_�m�l�_256_cfb128 + "CAMELLIA-256-CFB" + + ) + +3956 + #LN_�m�l�_256_cfb128 + "�m�l�-256-cfb" + + ) + +3957 + #NID_�m�l�_256_cfb128 + 759 + + ) + +3958 + #OBJ_�m�l�_256_cfb128 + +OBJ_�m�l� +,44L + + ) + +3960 + #SN_�m�l�_128_cfb1 + "CAMELLIA-128-CFB1" + + ) + +3961 + #LN_�m�l�_128_cfb1 + "�m�l�-128-cfb1" + + ) + +3962 + #NID_�m�l�_128_cfb1 + 760 + + ) + +3964 + #SN_�m�l�_192_cfb1 + "CAMELLIA-192-CFB1" + + ) + +3965 + #LN_�m�l�_192_cfb1 + "�m�l�-192-cfb1" + + ) + +3966 + #NID_�m�l�_192_cfb1 + 761 + + ) + +3968 + #SN_�m�l�_256_cfb1 + "CAMELLIA-256-CFB1" + + ) + +3969 + #LN_�m�l�_256_cfb1 + "�m�l�-256-cfb1" + + ) + +3970 + #NID_�m�l�_256_cfb1 + 762 + + ) + +3972 + #SN_�m�l�_128_cfb8 + "CAMELLIA-128-CFB8" + + ) + +3973 + #LN_�m�l�_128_cfb8 + "�m�l�-128-cfb8" + + ) + +3974 + #NID_�m�l�_128_cfb8 + 763 + + ) + +3976 + #SN_�m�l�_192_cfb8 + "CAMELLIA-192-CFB8" + + ) + +3977 + #LN_�m�l�_192_cfb8 + "�m�l�-192-cfb8" + + ) + +3978 + #NID_�m�l�_192_cfb8 + 764 + + ) + +3980 + #SN_�m�l�_256_cfb8 + "CAMELLIA-256-CFB8" + + ) + +3981 + #LN_�m�l�_256_cfb8 + "�m�l�-256-cfb8" + + ) + +3982 + #NID_�m�l�_256_cfb8 + 765 + + ) + +3984 + #SN_ki� + "KISA" + + ) + +3985 + #LN_ki� + "ki�" + + ) + +3986 + #NID_ki� + 773 + + ) + +3987 + #OBJ_ki� + +OBJ_memb�_body +,410L,200004L + + ) + +3989 + #SN_�ed_ecb + "SEED-ECB" + + ) + +3990 + #LN_�ed_ecb + "�ed-ecb" + + ) + +3991 + #NID_�ed_ecb + 776 + + ) + +3992 + #OBJ_�ed_ecb + +OBJ_ki� +,1L,3L + + ) + +3994 + #SN_�ed_cbc + "SEED-CBC" + + ) + +3995 + #LN_�ed_cbc + "�ed-cbc" + + ) + +3996 + #NID_�ed_cbc + 777 + + ) + +3997 + #OBJ_�ed_cbc + +OBJ_ki� +,1L,4L + + ) + +3999 + #SN_�ed_cfb128 + "SEED-CFB" + + ) + +4000 + #LN_�ed_cfb128 + "�ed-cfb" + + ) + +4001 + #NID_�ed_cfb128 + 779 + + ) + +4002 + #OBJ_�ed_cfb128 + +OBJ_ki� +,1L,5L + + ) + +4004 + #SN_�ed_ofb128 + "SEED-OFB" + + ) + +4005 + #LN_�ed_ofb128 + "�ed-ofb" + + ) + +4006 + #NID_�ed_ofb128 + 778 + + ) + +4007 + #OBJ_�ed_ofb128 + +OBJ_ki� +,1L,6L + + ) + +4009 + #SN_hmac + "HMAC" + + ) + +4010 + #LN_hmac + "hmac" + + ) + +4011 + #NID_hmac + 855 + + ) + +4013 + #SN_cmac + "CMAC" + + ) + +4014 + #LN_cmac + "cmac" + + ) + +4015 + #NID_cmac + 894 + + ) + +4017 + #SN_rc4_hmac_md5 + "RC4-HMAC-MD5" + + ) + +4018 + #LN_rc4_hmac_md5 + "rc4-hmac-md5" + + ) + +4019 + #NID_rc4_hmac_md5 + 915 + + ) + +4021 + #SN_�s_128_cbc_hmac_sha1 + "AES-128-CBC-HMAC-SHA1" + + ) + +4022 + #LN_�s_128_cbc_hmac_sha1 + "�s-128-cbc-hmac-sha1" + + ) + +4023 + #NID_�s_128_cbc_hmac_sha1 + 916 + + ) + +4025 + #SN_�s_192_cbc_hmac_sha1 + "AES-192-CBC-HMAC-SHA1" + + ) + +4026 + #LN_�s_192_cbc_hmac_sha1 + "�s-192-cbc-hmac-sha1" + + ) + +4027 + #NID_�s_192_cbc_hmac_sha1 + 917 + + ) + +4029 + #SN_�s_256_cbc_hmac_sha1 + "AES-256-CBC-HMAC-SHA1" + + ) + +4030 + #LN_�s_256_cbc_hmac_sha1 + "�s-256-cbc-hmac-sha1" + + ) + +4031 + #NID_�s_256_cbc_hmac_sha1 + 918 + + ) + + @/usr/include/openssl/pem2.h + +60 #ifde� +__�lu�lus + + +64 #i�de� +HEADER_PEM_H + + +65 +ERR_l�d_PEM_�r�gs +(); + +68 #ifde� +__�lu�lus + + + @/usr/include/openssl/pkcs7.h + +59 #i�de� +HEADER_PKCS7_H + + +60 + #HEADER_PKCS7_H + + + ) + +62 + ~<ݒs�/a�1.h +> + +63 + ~<ݒs�/bio.h +> + +64 + ~<ݒs�/e_os2.h +> + +66 + ~<ݒs�/symhacks.h +> + +67 + ~<ݒs�/os�_typ.h +> + +69 #ifde� +__�lu�lus + + +73 #ifde� +OPENSSL_SYS_WIN32 + + +75 #unde� +PKCS7_ISSUER_AND_SERIAL + + +76 #unde� +PKCS7_SIGNER_INFO + + +86 + spkcs7_issu�_�d_�r�l_� + + +88 +X509_NAME + * +issu� +; + +89 +ASN1_INTEGER + * +�r�l +; + +90 } + tPKCS7_ISSUER_AND_SERIAL +; + +92 + spkcs7_sig�r_�fo_� + + +94 +ASN1_INTEGER + * +v�si� +; + +95 +PKCS7_ISSUER_AND_SERIAL + * +issu�_�d_�r�l +; + +96 +X509_ALGOR + * +dige�_�g +; + +97 +STACK_OF +( +X509_ATTRIBUTE +�* +auth_�� +; + +98 +X509_ALGOR + * +dige�_�c_�g +; + +99 +ASN1_OCTET_STRING + * +�c_dige� +; + +100 +STACK_OF +( +X509_ATTRIBUTE +�* +u�uth_�� +; + +103 +EVP_PKEY + * +pkey +; + +104 } + tPKCS7_SIGNER_INFO +; + +106 +DECLARE_STACK_OF +( +PKCS7_SIGNER_INFO +) + +107 +DECLARE_ASN1_SET_OF +( +PKCS7_SIGNER_INFO +) + +109 + spkcs7_�c�_�fo_� + + +111 +ASN1_INTEGER + * +v�si� +; + +112 +PKCS7_ISSUER_AND_SERIAL + * +issu�_�d_�r�l +; + +113 +X509_ALGOR + * +key_�c_�g� +; + +114 +ASN1_OCTET_STRING + * +�c_key +; + +115 +X509 + * +�� +; + +116 } + tPKCS7_RECIP_INFO +; + +118 +DECLARE_STACK_OF +( +PKCS7_RECIP_INFO +) + +119 +DECLARE_ASN1_SET_OF +( +PKCS7_RECIP_INFO +) + +121 + spkcs7_sig�d_� + + +123 +ASN1_INTEGER + * +v�si� +; + +124 +STACK_OF +( +X509_ALGOR +�* +md_�gs +; + +125 +STACK_OF +( +X509 +�* +�� +; + +126 +STACK_OF +( +X509_CRL +�* +�l +; + +127 +STACK_OF +( +PKCS7_SIGNER_INFO +�* +sig�r_�fo +; + +129 +pkcs7_� + * +cڋ�s +; + +130 } + tPKCS7_SIGNED +; + +134 + spkcs7_�c_cڋ�_� + + +136 +ASN1_OBJECT + * +cڋ�_ty� +; + +137 +X509_ALGOR + * +�gܙhm +; + +138 +ASN1_OCTET_STRING + * +�c_d�a +; + +139 cڡ +EVP_CIPHER + * +c�h� +; + +140 } + tPKCS7_ENC_CONTENT +; + +142 + spkcs7_�v��ed_� + + +144 +ASN1_INTEGER + * +v�si� +; + +145 +STACK_OF +( +PKCS7_RECIP_INFO +�* +�c����fo +; + +146 +PKCS7_ENC_CONTENT + * +�c_d�a +; + +147 } + tPKCS7_ENVELOPE +; + +149 + spkcs7_sig�d�d�v��ed_� + + +151 +ASN1_INTEGER + * +v�si� +; + +152 +STACK_OF +( +X509_ALGOR +�* +md_�gs +; + +153 +STACK_OF +( +X509 +�* +�� +; + +154 +STACK_OF +( +X509_CRL +�* +�l +; + +155 +STACK_OF +( +PKCS7_SIGNER_INFO +�* +sig�r_�fo +; + +157 +PKCS7_ENC_CONTENT + * +�c_d�a +; + +158 +STACK_OF +( +PKCS7_RECIP_INFO +�* +�c����fo +; + +159 } + tPKCS7_SIGN_ENVELOPE +; + +161 + spkcs7_dige�_� + + +163 +ASN1_INTEGER + * +v�si� +; + +164 +X509_ALGOR + * +md +; + +165 +pkcs7_� + * +cڋ�s +; + +166 +ASN1_OCTET_STRING + * +dige� +; + +167 } + tPKCS7_DIGEST +; + +169 + spkcs7_��y�ed_� + + +171 +ASN1_INTEGER + * +v�si� +; + +172 +PKCS7_ENC_CONTENT + * +�c_d�a +; + +173 } + tPKCS7_ENCRYPT +; + +175 + spkcs7_� + + +179 * +a�1 +; + +180 +�ngth +; + +182 + #PKCS7_S_HEADER + 0 + + ) + +183 + #PKCS7_S_BODY + 1 + + ) + +184 + #PKCS7_S_TAIL + 2 + + ) + +185 +��e +; + +187 +d�ached +; + +189 +ASN1_OBJECT + * +ty� +; + +194 * +�r +; + +197 +ASN1_OCTET_STRING + * +d�a +; + +200 +PKCS7_SIGNED + * +sign +; + +203 +PKCS7_ENVELOPE + * +�v��ed +; + +206 +PKCS7_SIGN_ENVELOPE + * +sig�d_�d_�v��ed +; + +209 +PKCS7_DIGEST + * +dige� +; + +212 +PKCS7_ENCRYPT + * +��y�ed +; + +215 +ASN1_TYPE + * +�h� +; + +216 } +d +; + +217 } + tPKCS7 +; + +219 +DECLARE_STACK_OF +( +PKCS7 +) + +220 +DECLARE_ASN1_SET_OF +( +PKCS7 +) + +221 +DECLARE_PKCS12_STACK_OF +( +PKCS7 +) + +223 + #PKCS7_OP_SET_DETACHED_SIGNATURE + 1 + + ) + +224 + #PKCS7_OP_GET_DETACHED_SIGNATURE + 2 + + ) + +226 + #PKCS7_g�_sig�d_��ibu�s +( +si +�((si)-> +auth_�� +) + + ) + +227 + #PKCS7_g�_��ibu�s +( +si +�((si)-> +u�uth_�� +) + + ) + +229 + #PKCS7_ty�_is_sig�d +( +a +�( + `OBJ_obj2nid +(�)-> +ty� +�=� +NID_pkcs7_sig�d +) + + ) + +230 + #PKCS7_ty�_is_��y�ed +( +a +�( + `OBJ_obj2nid +(�)-> +ty� +�=� +NID_pkcs7_��y�ed +) + + ) + +231 + #PKCS7_ty�_is_�v��ed +( +a +�( + `OBJ_obj2nid +(�)-> +ty� +�=� +NID_pkcs7_�v��ed +) + + ) + +232 + #PKCS7_ty�_is_sig�dAndEnv��ed +( +a +) \ + +233 ( + `OBJ_obj2nid +(( +a +)-> +ty� +�=� +NID_pkcs7_sig�dAndEnv��ed +) + + ) + +234 + #PKCS7_ty�_is_d�a +( +a +�( + `OBJ_obj2nid +(�)-> +ty� +�=� +NID_pkcs7_d�a +) + + ) + +235 + #PKCS7_ty�_is_dige� +( +a +�( + `OBJ_obj2nid +(�)-> +ty� +�=� +NID_pkcs7_dige� +) + + ) + +236 + #PKCS7_ty�_is_��y�ed +( +a +) \ + +237 ( + `OBJ_obj2nid +(( +a +)-> +ty� +�=� +NID_pkcs7_��y�ed +) + + ) + +239 + #PKCS7_ty�_is_dige� +( +a +�( + `OBJ_obj2nid +(�)-> +ty� +�=� +NID_pkcs7_dige� +) + + ) + +241 + #PKCS7_�t_d�ached +( +p +, +v +) \ + +242 + `PKCS7_�� +( +p +, +PKCS7_OP_SET_DETACHED_SIGNATURE +, +v +, +NULL +) + + ) + +243 + #PKCS7_g�_d�ached +( +p +) \ + +244 + `PKCS7_�� +( +p +, +PKCS7_OP_GET_DETACHED_SIGNATURE +,0, +NULL +) + + ) + +246 + #PKCS7_is_d�ached +( +p7 +�( + `PKCS7_ty�_is_sig�d +�7�&& + `PKCS7_g�_d�ached +�7)) + + ) + +250 + #PKCS7_TEXT + 0x1 + + ) + +251 + #PKCS7_NOCERTS + 0x2 + + ) + +252 + #PKCS7_NOSIGS + 0x4 + + ) + +253 + #PKCS7_NOCHAIN + 0x8 + + ) + +254 + #PKCS7_NOINTERN + 0x10 + + ) + +255 + #PKCS7_NOVERIFY + 0x20 + + ) + +256 + #PKCS7_DETACHED + 0x40 + + ) + +257 + #PKCS7_BINARY + 0x80 + + ) + +258 + #PKCS7_NOATTR + 0x100 + + ) + +259 + #PKCS7_NOSMIMECAP + 0x200 + + ) + +260 + #PKCS7_NOOLDMIMETYPE + 0x400 + + ) + +261 + #PKCS7_CRLFEOL + 0x800 + + ) + +262 + #PKCS7_STREAM + 0x1000 + + ) + +263 + #PKCS7_NOCRL + 0x2000 + + ) + +264 + #PKCS7_PARTIAL + 0x4000 + + ) + +265 + #PKCS7_REUSE_DIGEST + 0x8000 + + ) + +269 + #SMIME_TEXT + +PKCS7_TEXT + + + ) + +270 + #SMIME_NOCERTS + +PKCS7_NOCERTS + + + ) + +271 + #SMIME_NOSIGS + +PKCS7_NOSIGS + + + ) + +272 + #SMIME_NOCHAIN + +PKCS7_NOCHAIN + + + ) + +273 + #SMIME_NOINTERN + +PKCS7_NOINTERN + + + ) + +274 + #SMIME_NOVERIFY + +PKCS7_NOVERIFY + + + ) + +275 + #SMIME_DETACHED + +PKCS7_DETACHED + + + ) + +276 + #SMIME_BINARY + +PKCS7_BINARY + + + ) + +277 + #SMIME_NOATTR + +PKCS7_NOATTR + + + ) + +279 +DECLARE_ASN1_FUNCTIONS +( +PKCS7_ISSUER_AND_SERIAL +) + +281 +PKCS7_ISSUER_AND_SERIAL_dige� +( +PKCS7_ISSUER_AND_SERIAL + * +d�a +,cڡ +EVP_MD + * +ty� +, + +282 * +md +,* +�n +); + +283 #i�de� +OPENSSL_NO_FP_API + + +284 +PKCS7 + * +d2i_PKCS7_� +( +FILE + * +� +,PKCS7 ** +p7 +); + +285 +i2d_PKCS7_� +( +FILE + * +� +, +PKCS7 + * +p7 +); + +287 +PKCS7 + * +PKCS7_dup +(PKCS7 * +p7 +); + +288 +PKCS7 + * +d2i_PKCS7_bio +( +BIO + * +bp +,PKCS7 ** +p7 +); + +289 +i2d_PKCS7_bio +( +BIO + * +bp +, +PKCS7 + * +p7 +); + +290 +i2d_PKCS7_bio_��am +( +BIO + * +out +, +PKCS7 + * +p7 +, BIO * +� +, +�ags +); + +291 +PEM_wr�e_bio_PKCS7_��am +( +BIO + * +out +, +PKCS7 + * +p7 +, BIO * +� +, +�ags +); + +293 +DECLARE_ASN1_FUNCTIONS +( +PKCS7_SIGNER_INFO +) + +294 +DECLARE_ASN1_FUNCTIONS +( +PKCS7_RECIP_INFO +) + +295 +DECLARE_ASN1_FUNCTIONS +( +PKCS7_SIGNED +) + +296 +DECLARE_ASN1_FUNCTIONS +( +PKCS7_ENC_CONTENT +) + +297 +DECLARE_ASN1_FUNCTIONS +( +PKCS7_ENVELOPE +) + +298 +DECLARE_ASN1_FUNCTIONS +( +PKCS7_SIGN_ENVELOPE +) + +299 +DECLARE_ASN1_FUNCTIONS +( +PKCS7_DIGEST +) + +300 +DECLARE_ASN1_FUNCTIONS +( +PKCS7_ENCRYPT +) + +301 +DECLARE_ASN1_FUNCTIONS +( +PKCS7 +) + +303 +DECLARE_ASN1_ITEM +( +PKCS7_ATTR_SIGN +) + +304 +DECLARE_ASN1_ITEM +( +PKCS7_ATTR_VERIFY +) + +306 +DECLARE_ASN1_NDEF_FUNCTION +( +PKCS7 +) + +307 +DECLARE_ASN1_PRINT_FUNCTION +( +PKCS7 +) + +309 +PKCS7_�� +( +PKCS7 + * +p7 +, +cmd +, +�rg +, * +�rg +); + +311 +PKCS7_�t_ty� +( +PKCS7 + * +p7 +, +ty� +); + +312 +PKCS7_�t0_ty�_�h� +( +PKCS7 + * +p7 +, +ty� +, +ASN1_TYPE + * +�h� +); + +313 +PKCS7_�t_cڋ� +( +PKCS7 + * +p7 +, PKCS7 * +p7_d�a +); + +314 +PKCS7_SIGNER_INFO_�t +( +PKCS7_SIGNER_INFO + * +p7i +, +X509 + * +x509 +, +EVP_PKEY + * +pkey +, + +315 cڡ +EVP_MD + * +dg� +); + +316 +PKCS7_SIGNER_INFO_sign +( +PKCS7_SIGNER_INFO + * +si +); + +317 +PKCS7_add_sig�r +( +PKCS7 + * +p7 +, +PKCS7_SIGNER_INFO + * +p7i +); + +318 +PKCS7_add_��ifi�� +( +PKCS7 + * +p7 +, +X509 + * +x509 +); + +319 +PKCS7_add_�l +( +PKCS7 + * +p7 +, +X509_CRL + * +x509 +); + +320 +PKCS7_cڋ�_�w +( +PKCS7 + * +p7 +, +nid +); + +321 +PKCS7_d�aV�ify +( +X509_STORE + * +��_��e +, +X509_STORE_CTX + * +�x +, + +322 +BIO + * +bio +, +PKCS7 + * +p7 +, +PKCS7_SIGNER_INFO + * +si +); + +323 +PKCS7_sig�tu�V�ify +( +BIO + * +bio +, +PKCS7 + * +p7 +, +PKCS7_SIGNER_INFO + * +si +, + +324 +X509 + * +x509 +); + +326 +BIO + * +PKCS7_d�aIn� +( +PKCS7 + * +p7 +, BIO * +bio +); + +327 +PKCS7_d�aF�� +( +PKCS7 + * +p7 +, +BIO + * +bio +); + +328 +BIO + * +PKCS7_d�aDecode +( +PKCS7 + * +p7 +, +EVP_PKEY + * +pkey +, BIO * +�_bio +, +X509 + * +p�� +); + +331 +PKCS7_SIGNER_INFO + * +PKCS7_add_sig�tu� +( +PKCS7 + * +p7 +, +X509 + * +x509 +, + +332 +EVP_PKEY + * +pkey +, cڡ +EVP_MD + * +dg� +); + +333 +X509 + * +PKCS7_��_�om_sig�r_�fo +( +PKCS7 + * +p7 +, +PKCS7_SIGNER_INFO + * +si +); + +334 +PKCS7_�t_dige� +( +PKCS7 + * +p7 +, cڡ +EVP_MD + * +md +); + +335 +STACK_OF +( +PKCS7_SIGNER_INFO +�* +PKCS7_g�_sig�r_�fo +( +PKCS7 + * +p7 +); + +337 +PKCS7_RECIP_INFO + * +PKCS7_add_�c��� +( +PKCS7 + * +p7 +, +X509 + * +x509 +); + +338 +PKCS7_SIGNER_INFO_g�0_�gs +( +PKCS7_SIGNER_INFO + * +si +, +EVP_PKEY + ** +pk +, + +339 +X509_ALGOR + ** +pdig +, X509_ALGOR ** +psig +); + +340 +PKCS7_RECIP_INFO_g�0_�g +( +PKCS7_RECIP_INFO + * +ri +, +X509_ALGOR + ** +�nc +); + +341 +PKCS7_add_�c���_�fo +( +PKCS7 + * +p7 +, +PKCS7_RECIP_INFO + * +ri +); + +342 +PKCS7_RECIP_INFO_�t +( +PKCS7_RECIP_INFO + * +p7i +, +X509 + * +x509 +); + +343 +PKCS7_�t_c�h� +( +PKCS7 + * +p7 +, cڡ +EVP_CIPHER + * +c�h� +); + +344 +PKCS7_��am +(*** +bound�y +, +PKCS7 + * +p7 +); + +346 +PKCS7_ISSUER_AND_SERIAL + * +PKCS7_g�_issu�_�d_�r�l +( +PKCS7 + * +p7 +, +idx +); + +347 +ASN1_OCTET_STRING + * +PKCS7_dige�_�om_��ibu�s +( +STACK_OF +( +X509_ATTRIBUTE +�* +sk +); + +348 +PKCS7_add_sig�d_��ibu� +( +PKCS7_SIGNER_INFO + * +p7si +, +nid +, +ty� +, + +349 * +d�a +); + +350 +PKCS7_add_��ibu� + ( +PKCS7_SIGNER_INFO + * +p7si +, +nid +, +��y� +, + +351 * +v�ue +); + +352 +ASN1_TYPE + * +PKCS7_g�_��ibu� +( +PKCS7_SIGNER_INFO + * +si +, +nid +); + +353 +ASN1_TYPE + * +PKCS7_g�_sig�d_��ibu� +( +PKCS7_SIGNER_INFO + * +si +, +nid +); + +354 +PKCS7_�t_sig�d_��ibu�s +( +PKCS7_SIGNER_INFO + * +p7si +, + +355 +STACK_OF +( +X509_ATTRIBUTE +�* +sk +); + +356 +PKCS7_�t_��ibu�s +( +PKCS7_SIGNER_INFO + * +p7si +, +STACK_OF +( +X509_ATTRIBUTE +�* +sk +); + +359 +PKCS7 + * +PKCS7_sign +( +X509 + * +sign�� +, +EVP_PKEY + * +pkey +, +STACK_OF +(X509�* +��s +, + +360 +BIO + * +d�a +, +�ags +); + +362 +PKCS7_SIGNER_INFO + * +PKCS7_sign_add_sig�r +( +PKCS7 + * +p7 +, + +363 +X509 + * +sign�� +, +EVP_PKEY + * +pkey +, cڡ +EVP_MD + * +md +, + +364 +�ags +); + +366 +PKCS7_f�� +( +PKCS7 + * +p7 +, +BIO + * +d�a +, +�ags +); + +367 +PKCS7_v�ify +( +PKCS7 + * +p7 +, +STACK_OF +( +X509 +�* +��s +, +X509_STORE + * +��e +, + +368 +BIO + * +�d�a +, BIO * +out +, +�ags +); + +369 +STACK_OF +( +X509 +�* +PKCS7_g�0_sig�rs +( +PKCS7 + * +p7 +, STACK_OF(X509�* +��s +, +�ags +); + +370 +PKCS7 + * +PKCS7_��y� +( +STACK_OF +( +X509 +�* +��s +, +BIO + * +� +, cڡ +EVP_CIPHER + * +c�h� +, + +371 +�ags +); + +372 +PKCS7_de�y� +( +PKCS7 + * +p7 +, +EVP_PKEY + * +pkey +, +X509 + * +�� +, +BIO + * +d�a +, +�ags +); + +374 +PKCS7_add_��ib_smime�p +( +PKCS7_SIGNER_INFO + * +si +, + +375 +STACK_OF +( +X509_ALGOR +�* +�p +); + +376 +STACK_OF +( +X509_ALGOR +�* +PKCS7_g�_smime�p +( +PKCS7_SIGNER_INFO + * +si +); + +377 +PKCS7_sim�e_smime�p +( +STACK_OF +( +X509_ALGOR +�* +sk +, +nid +, +�g +); + +379 +PKCS7_add_��ib_cڋ�_ty� +( +PKCS7_SIGNER_INFO + * +si +, +ASN1_OBJECT + * +coid +); + +380 +PKCS7_add0_��ib_sign�g_time +( +PKCS7_SIGNER_INFO + * +si +, +ASN1_TIME + * +t +); + +381 +PKCS7_add1_��ib_dige� +( +PKCS7_SIGNER_INFO + * +si +, + +382 cڡ * +md +, +md�n +); + +384 +SMIME_wr�e_PKCS7 +( +BIO + * +bio +, +PKCS7 + * +p7 +, BIO * +d�a +, +�ags +); + +385 +PKCS7 + * +SMIME_�ad_PKCS7 +( +BIO + * +bio +, BIO ** +bc�t +); + +387 +BIO + * +BIO_�w_PKCS7 +(BIO * +out +, +PKCS7 + * +p7 +); + +394 +ERR_l�d_PKCS7_�r�gs +(); + +399 + #PKCS7_F_B64_READ_PKCS7 + 120 + + ) + +400 + #PKCS7_F_B64_WRITE_PKCS7 + 121 + + ) + +401 + #PKCS7_F_DO_PKCS7_SIGNED_ATTRIB + 136 + + ) + +402 + #PKCS7_F_I2D_PKCS7_BIO_STREAM + 140 + + ) + +403 + #PKCS7_F_PKCS7_ADD0_ATTRIB_SIGNING_TIME + 135 + + ) + +404 + #PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP + 118 + + ) + +405 + #PKCS7_F_PKCS7_ADD_CERTIFICATE + 100 + + ) + +406 + #PKCS7_F_PKCS7_ADD_CRL + 101 + + ) + +407 + #PKCS7_F_PKCS7_ADD_RECIPIENT_INFO + 102 + + ) + +408 + #PKCS7_F_PKCS7_ADD_SIGNATURE + 131 + + ) + +409 + #PKCS7_F_PKCS7_ADD_SIGNER + 103 + + ) + +410 + #PKCS7_F_PKCS7_BIO_ADD_DIGEST + 125 + + ) + +411 + #PKCS7_F_PKCS7_COPY_EXISTING_DIGEST + 138 + + ) + +412 + #PKCS7_F_PKCS7_CTRL + 104 + + ) + +413 + #PKCS7_F_PKCS7_DATADECODE + 112 + + ) + +414 + #PKCS7_F_PKCS7_DATAFINAL + 128 + + ) + +415 + #PKCS7_F_PKCS7_DATAINIT + 105 + + ) + +416 + #PKCS7_F_PKCS7_DATASIGN + 106 + + ) + +417 + #PKCS7_F_PKCS7_DATAVERIFY + 107 + + ) + +418 + #PKCS7_F_PKCS7_DECRYPT + 114 + + ) + +419 + #PKCS7_F_PKCS7_DECRYPT_RINFO + 133 + + ) + +420 + #PKCS7_F_PKCS7_ENCODE_RINFO + 132 + + ) + +421 + #PKCS7_F_PKCS7_ENCRYPT + 115 + + ) + +422 + #PKCS7_F_PKCS7_FINAL + 134 + + ) + +423 + #PKCS7_F_PKCS7_FIND_DIGEST + 127 + + ) + +424 + #PKCS7_F_PKCS7_GET0_SIGNERS + 124 + + ) + +425 + #PKCS7_F_PKCS7_RECIP_INFO_SET + 130 + + ) + +426 + #PKCS7_F_PKCS7_SET_CIPHER + 108 + + ) + +427 + #PKCS7_F_PKCS7_SET_CONTENT + 109 + + ) + +428 + #PKCS7_F_PKCS7_SET_DIGEST + 126 + + ) + +429 + #PKCS7_F_PKCS7_SET_TYPE + 110 + + ) + +430 + #PKCS7_F_PKCS7_SIGN + 116 + + ) + +431 + #PKCS7_F_PKCS7_SIGNATUREVERIFY + 113 + + ) + +432 + #PKCS7_F_PKCS7_SIGNER_INFO_SET + 129 + + ) + +433 + #PKCS7_F_PKCS7_SIGNER_INFO_SIGN + 139 + + ) + +434 + #PKCS7_F_PKCS7_SIGN_ADD_SIGNER + 137 + + ) + +435 + #PKCS7_F_PKCS7_SIMPLE_SMIMECAP + 119 + + ) + +436 + #PKCS7_F_PKCS7_VERIFY + 117 + + ) + +437 + #PKCS7_F_SMIME_READ_PKCS7 + 122 + + ) + +438 + #PKCS7_F_SMIME_TEXT + 123 + + ) + +441 + #PKCS7_R_CERTIFICATE_VERIFY_ERROR + 117 + + ) + +442 + #PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER + 144 + + ) + +443 + #PKCS7_R_CIPHER_NOT_INITIALIZED + 116 + + ) + +444 + #PKCS7_R_CONTENT_AND_DATA_PRESENT + 118 + + ) + +445 + #PKCS7_R_CTRL_ERROR + 152 + + ) + +446 + #PKCS7_R_DECODE_ERROR + 130 + + ) + +447 + #PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH + 100 + + ) + +448 + #PKCS7_R_DECRYPT_ERROR + 119 + + ) + +449 + #PKCS7_R_DIGEST_FAILURE + 101 + + ) + +450 + #PKCS7_R_ENCRYPTION_CTRL_FAILURE + 149 + + ) + +451 + #PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE + 150 + + ) + +452 + #PKCS7_R_ERROR_ADDING_RECIPIENT + 120 + + ) + +453 + #PKCS7_R_ERROR_SETTING_CIPHER + 121 + + ) + +454 + #PKCS7_R_INVALID_MIME_TYPE + 131 + + ) + +455 + #PKCS7_R_INVALID_NULL_POINTER + 143 + + ) + +456 + #PKCS7_R_MIME_NO_CONTENT_TYPE + 132 + + ) + +457 + #PKCS7_R_MIME_PARSE_ERROR + 133 + + ) + +458 + #PKCS7_R_MIME_SIG_PARSE_ERROR + 134 + + ) + +459 + #PKCS7_R_MISSING_CERIPEND_INFO + 103 + + ) + +460 + #PKCS7_R_NO_CONTENT + 122 + + ) + +461 + #PKCS7_R_NO_CONTENT_TYPE + 135 + + ) + +462 + #PKCS7_R_NO_DEFAULT_DIGEST + 151 + + ) + +463 + #PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND + 154 + + ) + +464 + #PKCS7_R_NO_MULTIPART_BODY_FAILURE + 136 + + ) + +465 + #PKCS7_R_NO_MULTIPART_BOUNDARY + 137 + + ) + +466 + #PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE + 115 + + ) + +467 + #PKCS7_R_NO_RECIPIENT_MATCHES_KEY + 146 + + ) + +468 + #PKCS7_R_NO_SIGNATURES_ON_DATA + 123 + + ) + +469 + #PKCS7_R_NO_SIGNERS + 142 + + ) + +470 + #PKCS7_R_NO_SIG_CONTENT_TYPE + 138 + + ) + +471 + #PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE + 104 + + ) + +472 + #PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR + 124 + + ) + +473 + #PKCS7_R_PKCS7_ADD_SIGNER_ERROR + 153 + + ) + +474 + #PKCS7_R_PKCS7_DATAFINAL + 126 + + ) + +475 + #PKCS7_R_PKCS7_DATAFINAL_ERROR + 125 + + ) + +476 + #PKCS7_R_PKCS7_DATASIGN + 145 + + ) + +477 + #PKCS7_R_PKCS7_PARSE_ERROR + 139 + + ) + +478 + #PKCS7_R_PKCS7_SIG_PARSE_ERROR + 140 + + ) + +479 + #PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE + 127 + + ) + +480 + #PKCS7_R_SIGNATURE_FAILURE + 105 + + ) + +481 + #PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND + 128 + + ) + +482 + #PKCS7_R_SIGNING_CTRL_FAILURE + 147 + + ) + +483 + #PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE + 148 + + ) + +484 + #PKCS7_R_SIG_INVALID_MIME_TYPE + 141 + + ) + +485 + #PKCS7_R_SMIME_TEXT_ERROR + 129 + + ) + +486 + #PKCS7_R_UNABLE_TO_FIND_CERTIFICATE + 106 + + ) + +487 + #PKCS7_R_UNABLE_TO_FIND_MEM_BIO + 107 + + ) + +488 + #PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST + 108 + + ) + +489 + #PKCS7_R_UNKNOWN_DIGEST_TYPE + 109 + + ) + +490 + #PKCS7_R_UNKNOWN_OPERATION + 110 + + ) + +491 + #PKCS7_R_UNSUPPORTED_CIPHER_TYPE + 111 + + ) + +492 + #PKCS7_R_UNSUPPORTED_CONTENT_TYPE + 112 + + ) + +493 + #PKCS7_R_WRONG_CONTENT_TYPE + 113 + + ) + +494 + #PKCS7_R_WRONG_PKCS7_TYPE + 114 + + ) + +496 #ifde� +__�lu�lus + + + @/usr/include/openssl/pqueue.h + +60 #i�de� +HEADER_PQUEUE_H + + +61 + #HEADER_PQUEUE_H + + + ) + +63 + ~<�dio.h +> + +64 + ~<�dlib.h +> + +65 + ~<�r�g.h +> + +67 +_pqueue + * + tpqueue +; + +69 + s_p�em + + +71 + m�iܙy +[8]; + +72 * + md�a +; + +73 +_p�em + * + m�xt +; + +74 } + tp�em +; + +76 +_p�em + * + tp���� +; + +78 +p�em + * +p�em_�w +(* +�io64be +, * +d�a +); + +79 +p�em_� +( +p�em + * +�em +); + +81 +pqueue + +pqueue_�w +(); + +82 +pqueue_� +( +pqueue + +pq +); + +84 +p�em + * +pqueue_��� +( +pqueue + +pq +,��em * +�em +); + +85 +p�em + * +pqueue_�ek +( +pqueue + +pq +); + +86 +p�em + * +pqueue_p� +( +pqueue + +pq +); + +87 +p�em + * +pqueue_f�d +( +pqueue + +pq +, * +�io64be +); + +88 +p�em + * +pqueue_���� +( +pqueue + +pq +); + +89 +p�em + * +pqueue_�xt +( +p���� + * +�� +); + +91 +pqueue_��t +( +pqueue + +pq +); + +92 +pqueue_size +( +pqueue + +pq +); + + @/usr/include/openssl/sha.h + +59 #i�de� +HEADER_SHA_H + + +60 + #HEADER_SHA_H + + + ) + +62 + ~<�ddef.h +> + +63 + ~<ݒs�/e_os2.h +> + +64 + ~<�ddef.h +> + +66 #ifde� +__�lu�lus + + +70 #i� +def�ed +( +OPENSSL_NO_SHA +�|| (def�ed( +OPENSSL_NO_SHA0 +�&& def�ed( +OPENSSL_NO_SHA1 +)) + +71 #�r� +SHA + +is + +di�b�d +. + +74 #i� +def�ed +( +OPENSSL_FIPS +) + +75 + #FIPS_SHA_SIZE_T + +size_t + + + ) + +85 #i� +def�ed +( +__LP32__ +) + +86 + #SHA_LONG + + + ) + +87 #�i� +def�ed +( +OPENSSL_SYS_CRAY +�|| def�ed( +__ILP64__ +) + +88 + #SHA_LONG + + + ) + +89 + #SHA_LONG_LOG2 + 3 + + ) + +91 + #SHA_LONG + + + ) + +94 + #SHA_LBLOCK + 16 + + ) + +95 + #SHA_CBLOCK + ( +SHA_LBLOCK +*4� + + ) + +98 + #SHA_LAST_BLOCK + ( +SHA_CBLOCK +-8) + + ) + +99 + #SHA_DIGEST_LENGTH + 20 + + ) + +101 + sSHA��e_� + + +103 +SHA_LONG + +h0 +, +h1 +, +h2 +, +h3 +, +h4 +; + +104 +SHA_LONG + +Nl +, +Nh +; + +105 +SHA_LONG + +d�a +[ +SHA_LBLOCK +]; + +106 +num +; + +107 } + tSHA_CTX +; + +109 #i�de� +OPENSSL_NO_SHA0 + + +110 #ifde� +OPENSSL_FIPS + + +111 +�iv�e_SHA_In� +( +SHA_CTX + * +c +); + +113 +SHA_In� +( +SHA_CTX + * +c +); + +114 +SHA_Upd�e +( +SHA_CTX + * +c +, cڡ * +d�a +, +size_t + +�n +); + +115 +SHA_F�� +(* +md +, +SHA_CTX + * +c +); + +116 * +SHA +(cڡ * +d +, +size_t + +n +, * +md +); + +117 +SHA_T�nsf�m +( +SHA_CTX + * +c +, cڡ * +d�a +); + +119 #i�de� +OPENSSL_NO_SHA1 + + +120 #ifde� +OPENSSL_FIPS + + +121 +�iv�e_SHA1_In� +( +SHA_CTX + * +c +); + +123 +SHA1_In� +( +SHA_CTX + * +c +); + +124 +SHA1_Upd�e +( +SHA_CTX + * +c +, cڡ * +d�a +, +size_t + +�n +); + +125 +SHA1_F�� +(* +md +, +SHA_CTX + * +c +); + +126 * +SHA1 +(cڡ * +d +, +size_t + +n +, * +md +); + +127 +SHA1_T�nsf�m +( +SHA_CTX + * +c +, cڡ * +d�a +); + +130 + #SHA256_CBLOCK + ( +SHA_LBLOCK +*4� + + ) + +133 + #SHA224_DIGEST_LENGTH + 28 + + ) + +134 + #SHA256_DIGEST_LENGTH + 32 + + ) + +136 + sSHA256��e_� + + +138 +SHA_LONG + +h +[8]; + +139 +SHA_LONG + +Nl +, +Nh +; + +140 +SHA_LONG + +d�a +[ +SHA_LBLOCK +]; + +141 +num +, +md_�n +; + +142 } + tSHA256_CTX +; + +144 #i�de� +OPENSSL_NO_SHA256 + + +145 #ifde� +OPENSSL_FIPS + + +146 +�iv�e_SHA224_In� +( +SHA256_CTX + * +c +); + +147 +�iv�e_SHA256_In� +( +SHA256_CTX + * +c +); + +149 +SHA224_In� +( +SHA256_CTX + * +c +); + +150 +SHA224_Upd�e +( +SHA256_CTX + * +c +, cڡ * +d�a +, +size_t + +�n +); + +151 +SHA224_F�� +(* +md +, +SHA256_CTX + * +c +); + +152 * +SHA224 +(cڡ * +d +, +size_t + +n +,* +md +); + +153 +SHA256_In� +( +SHA256_CTX + * +c +); + +154 +SHA256_Upd�e +( +SHA256_CTX + * +c +, cڡ * +d�a +, +size_t + +�n +); + +155 +SHA256_F�� +(* +md +, +SHA256_CTX + * +c +); + +156 * +SHA256 +(cڡ * +d +, +size_t + +n +,* +md +); + +157 +SHA256_T�nsf�m +( +SHA256_CTX + * +c +, cڡ * +d�a +); + +160 + #SHA384_DIGEST_LENGTH + 48 + + ) + +161 + #SHA512_DIGEST_LENGTH + 64 + + ) + +163 #i�de� +OPENSSL_NO_SHA512 + + +169 + #SHA512_CBLOCK + ( +SHA_LBLOCK +*8� + + ) + +172 #i�( +def�ed +( +_WIN32 +�|| def�ed( +_WIN64 +)�&& !def�ed( +__MINGW32__ +) + +173 + #SHA_LONG64 + +__�t64 + + + ) + +174 + #U64 +( +C +�C## +UI64 + + + ) + +175 #�i� +def�ed +( +__�ch64__ +) + +176 + #SHA_LONG64 + + + ) + +177 + #U64 +( +C +�C## +UL + + + ) + +179 + #SHA_LONG64 + + + ) + +180 + #U64 +( +C +�C## +ULL + + + ) + +183 + sSHA512��e_� + + +185 +SHA_LONG64 + +h +[8]; + +186 +SHA_LONG64 + +Nl +, +Nh +; + +188 +SHA_LONG64 + +d +[ +SHA_LBLOCK +]; + +189 +p +[ +SHA512_CBLOCK +]; + +190 } +u +; + +191 +num +, +md_�n +; + +192 } + tSHA512_CTX +; + +195 #i�de� +OPENSSL_NO_SHA512 + + +196 #ifde� +OPENSSL_FIPS + + +197 +�iv�e_SHA384_In� +( +SHA512_CTX + * +c +); + +198 +�iv�e_SHA512_In� +( +SHA512_CTX + * +c +); + +200 +SHA384_In� +( +SHA512_CTX + * +c +); + +201 +SHA384_Upd�e +( +SHA512_CTX + * +c +, cڡ * +d�a +, +size_t + +�n +); + +202 +SHA384_F�� +(* +md +, +SHA512_CTX + * +c +); + +203 * +SHA384 +(cڡ * +d +, +size_t + +n +,* +md +); + +204 +SHA512_In� +( +SHA512_CTX + * +c +); + +205 +SHA512_Upd�e +( +SHA512_CTX + * +c +, cڡ * +d�a +, +size_t + +�n +); + +206 +SHA512_F�� +(* +md +, +SHA512_CTX + * +c +); + +207 * +SHA512 +(cڡ * +d +, +size_t + +n +,* +md +); + +208 +SHA512_T�nsf�m +( +SHA512_CTX + * +c +, cڡ * +d�a +); + +211 #ifde� +__�lu�lus + + + @/usr/include/openssl/x509_vfy.h + +59 #i�de� +HEADER_X509_H + + +60 + ~<ݒs�/x509.h +> + +65 #i�de� +HEADER_X509_VFY_H + + +66 + #HEADER_X509_VFY_H + + + ) + +68 + ~<ݒs�/ݒs�c�f.h +> + +69 #i�de� +OPENSSL_NO_LHASH + + +70 + ~<ݒs�/lhash.h +> + +72 + ~<ݒs�/bio.h +> + +73 + ~<ݒs�/�y�o.h +> + +74 + ~<ݒs�/symhacks.h +> + +76 #ifde� +__�lu�lus + + +82 + sx509_hash_d�_� + + +84 +num_d�s +; + +85 ** +d�s +; + +86 * +d�s_ty� +; + +87 +num_d�s_�lo�d +; + +88 } + tX509_HASH_DIR_CTX +; + +91 + sx509_f�e_� + + +93 + gnum_�ths +; + +94 + gnum_�lo�d +; + +95 ** + g�ths +; + +96 * + g�th_ty� +; + +97 } + tX509_CERT_FILE_CTX +; + +117 + #X509_LU_RETRY + -1 + + ) + +118 + #X509_LU_FAIL + 0 + + ) + +119 + #X509_LU_X509 + 1 + + ) + +120 + #X509_LU_CRL + 2 + + ) + +121 + #X509_LU_PKEY + 3 + + ) + +123 + sx509_obje�_� + + +126 + gty� +; + +128 * + g�r +; + +129 +X509 + * + gx509 +; + +130 +X509_CRL + * + g�l +; + +131 +EVP_PKEY + * + gpkey +; + +132 } + gd�a +; + +133 } + tX509_OBJECT +; + +135 +x509_lookup_� + + tX509_LOOKUP +; + +137 +DECLARE_STACK_OF +( +X509_LOOKUP +) + +138 +DECLARE_STACK_OF +( +X509_OBJECT +) + +141 + sx509_lookup_m�hod_� + + +143 cڡ * + g�me +; + +144 (* + g�w_�em +)( +X509_LOOKUP + * + g�x +); + +145 (* + g� +)( +X509_LOOKUP + * + g�x +); + +146 (* + g�� +)( +X509_LOOKUP + * + g�x +); + +147 (* + gshutdown +)( +X509_LOOKUP + * + g�x +); + +148 (* + g�� +)( +X509_LOOKUP + * + g�x +, + gcmd +,cڡ * + g�gc +, + g�gl +, + +149 ** + g�t +); + +150 (* + gg�_by_subje� +)( +X509_LOOKUP + * + g�x +, + gty� +, +X509_NAME + * + g�me +, + +151 +X509_OBJECT + * + g�t +); + +152 (* + gg�_by_issu�_�r�l +)( +X509_LOOKUP + * + g�x +, + gty� +, +X509_NAME + * + g�me +, + +153 +ASN1_INTEGER + * + g�r�l +, +X509_OBJECT + * + g�t +); + +154 (* + gg�_by_f�g���t +)( +X509_LOOKUP + * + g�x +, + gty� +, + +155 * + gby�s +, + g�n +, + +156 +X509_OBJECT + * + g�t +); + +157 (* + gg�_by_��s +)( +X509_LOOKUP + * + g�x +, + gty� +,* + g�r +, + g�n +, + +158 +X509_OBJECT + * + g�t +); + +159 } + tX509_LOOKUP_METHOD +; + +166 + sX509_VERIFY_PARAM_� + + +168 * + g�me +; + +169 +time_t + + gcheck_time +; + +170 + g�h_�ags +; + +171 + g�ags +; + +172 + gpu�o� +; + +173 + g�u� +; + +174 + gd�th +; + +175 +STACK_OF +( +ASN1_OBJECT +�* + gp�ic�s +; + +176 } + tX509_VERIFY_PARAM +; + +178 +DECLARE_STACK_OF +( +X509_VERIFY_PARAM +) + +183 + sx509_��e_� + + +186 + g�che +; + +187 +STACK_OF +( +X509_OBJECT +�* + gobjs +; + +190 +STACK_OF +( +X509_LOOKUP +�* + gg�_��_m�hods +; + +192 +X509_VERIFY_PARAM + * + g��m +; + +195 (* + gv�ify +)( +X509_STORE_CTX + * + g�x +); + +196 (* + gv�ify_cb +)( + gok +, +X509_STORE_CTX + * + g�x +); + +197 (* + gg�_issu� +)( +X509 + ** + gissu� +, +X509_STORE_CTX + * + g�x +, X509 * + gx +); + +198 (* + gcheck_issued +)( +X509_STORE_CTX + * + g�x +, +X509 + * + gx +, X509 * + gissu� +); + +199 (* + gcheck_�vo�ti� +)( +X509_STORE_CTX + * + g�x +); + +200 (* + gg�_�l +)( +X509_STORE_CTX + * + g�x +, +X509_CRL + ** + g�l +, +X509 + * + gx +); + +201 (* + gcheck_�l +)( +X509_STORE_CTX + * + g�x +, +X509_CRL + * + g�l +); + +202 (* + g��_�l +)( +X509_STORE_CTX + * + g�x +, +X509_CRL + * + g�l +, +X509 + * + gx +); + +203 +STACK_OF +( +X509 +�* (* + glookup_��s +)( +X509_STORE_CTX + * + g�x +, +X509_NAME + * + gnm +); + +204 +STACK_OF +( +X509_CRL +�* (* + glookup_�ls +)( +X509_STORE_CTX + * + g�x +, +X509_NAME + * + gnm +); + +205 (* + g��nup +)( +X509_STORE_CTX + * + g�x +); + +207 +CRYPTO_EX_DATA + + gex_d�a +; + +208 + g��n�s +; + +211 +X509_STORE_�t_d�th +( +X509_STORE + * +��e +, +d�th +); + +213 + #X509_STORE_�t_v�ify_cb_func +( +�x +, +func +�((�x)-> +v�ify_cb +=(func)) + + ) + +214 + #X509_STORE_�t_v�ify_func +( +�x +, +func +�((�x)-> +v�ify +=(func)) + + ) + +217 + sx509_lookup_� + + +219 + g�� +; + +220 + gsk� +; + +221 +X509_LOOKUP_METHOD + * + gm�hod +; + +222 * + gm�hod_d�a +; + +224 +X509_STORE + * + g��e_�x +; + +230 + sx509_��e_�x_� + + +232 +X509_STORE + * + g�x +; + +233 + gcu��t_m�hod +; + +236 +X509 + * + g�� +; + +237 +STACK_OF +( +X509 +�* + gu�ru�ed +; + +238 +STACK_OF +( +X509_CRL +�* + g�ls +; + +240 +X509_VERIFY_PARAM + * + g��m +; + +241 * + g�h�_�x +; + +244 (* + gv�ify +)( +X509_STORE_CTX + * + g�x +); + +245 (* + gv�ify_cb +)( + gok +, +X509_STORE_CTX + * + g�x +); + +246 (* + gg�_issu� +)( +X509 + ** + gissu� +, +X509_STORE_CTX + * + g�x +, X509 * + gx +); + +247 (* + gcheck_issued +)( +X509_STORE_CTX + * + g�x +, +X509 + * + gx +, X509 * + gissu� +); + +248 (* + gcheck_�vo�ti� +)( +X509_STORE_CTX + * + g�x +); + +249 (* + gg�_�l +)( +X509_STORE_CTX + * + g�x +, +X509_CRL + ** + g�l +, +X509 + * + gx +); + +250 (* + gcheck_�l +)( +X509_STORE_CTX + * + g�x +, +X509_CRL + * + g�l +); + +251 (* + g��_�l +)( +X509_STORE_CTX + * + g�x +, +X509_CRL + * + g�l +, +X509 + * + gx +); + +252 (* + gcheck_p�icy +)( +X509_STORE_CTX + * + g�x +); + +253 +STACK_OF +( +X509 +�* (* + glookup_��s +)( +X509_STORE_CTX + * + g�x +, +X509_NAME + * + gnm +); + +254 +STACK_OF +( +X509_CRL +�* (* + glookup_�ls +)( +X509_STORE_CTX + * + g�x +, +X509_NAME + * + gnm +); + +255 (* + g��nup +)( +X509_STORE_CTX + * + g�x +); + +258 + gv�id +; + +259 + gϡ_u�ru�ed +; + +260 +STACK_OF +( +X509 +�* + gcha� +; + +261 +X509_POLICY_TREE + * + g�� +; + +263 + gex�ic�_p�icy +; + +266 + g�r�_d�th +; + +267 + g�r� +; + +268 +X509 + * + gcu��t_�� +; + +269 +X509 + * + gcu��t_issu� +; + +270 +X509_CRL + * + gcu��t_�l +; + +272 + gcu��t_�l_sc�e +; + +273 + gcu��t_�as�s +; + +275 +X509_STORE_CTX + * + g��� +; + +277 +CRYPTO_EX_DATA + + gex_d�a +; + +280 +X509_STORE_CTX_�t_d�th +( +X509_STORE_CTX + * +�x +, +d�th +); + +282 + #X509_STORE_CTX_�t_�p_d�a +( +�x +, +d�a +) \ + +283 + `X509_STORE_CTX_�t_ex_d�a +( +�x +,0, +d�a +) + + ) + +284 + #X509_STORE_CTX_g�_�p_d�a +( +�x +) \ + +285 + `X509_STORE_CTX_g�_ex_d�a +( +�x +,0) + + ) + +287 + #X509_L_FILE_LOAD + 1 + + ) + +288 + #X509_L_ADD_DIR + 2 + + ) + +290 + #X509_LOOKUP_l�d_f�e +( +x +, +�me +, +ty� +) \ + +291 + `X509_LOOKUP_�� +(( +x +), +X509_L_FILE_LOAD +,( +�me +),()( +ty� +), +NULL +) + + ) + +293 + #X509_LOOKUP_add_d� +( +x +, +�me +, +ty� +) \ + +294 + `X509_LOOKUP_�� +(( +x +), +X509_L_ADD_DIR +,( +�me +),()( +ty� +), +NULL +) + + ) + +296 + #X509_V_OK + 0 + + ) + +299 + #X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT + 2 + + ) + +300 + #X509_V_ERR_UNABLE_TO_GET_CRL + 3 + + ) + +301 + #X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE + 4 + + ) + +302 + #X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE + 5 + + ) + +303 + #X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY + 6 + + ) + +304 + #X509_V_ERR_CERT_SIGNATURE_FAILURE + 7 + + ) + +305 + #X509_V_ERR_CRL_SIGNATURE_FAILURE + 8 + + ) + +306 + #X509_V_ERR_CERT_NOT_YET_VALID + 9 + + ) + +307 + #X509_V_ERR_CERT_HAS_EXPIRED + 10 + + ) + +308 + #X509_V_ERR_CRL_NOT_YET_VALID + 11 + + ) + +309 + #X509_V_ERR_CRL_HAS_EXPIRED + 12 + + ) + +310 + #X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD + 13 + + ) + +311 + #X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD + 14 + + ) + +312 + #X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD + 15 + + ) + +313 + #X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD + 16 + + ) + +314 + #X509_V_ERR_OUT_OF_MEM + 17 + + ) + +315 + #X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT + 18 + + ) + +316 + #X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN + 19 + + ) + +317 + #X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY + 20 + + ) + +318 + #X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE + 21 + + ) + +319 + #X509_V_ERR_CERT_CHAIN_TOO_LONG + 22 + + ) + +320 + #X509_V_ERR_CERT_REVOKED + 23 + + ) + +321 + #X509_V_ERR_INVALID_CA + 24 + + ) + +322 + #X509_V_ERR_PATH_LENGTH_EXCEEDED + 25 + + ) + +323 + #X509_V_ERR_INVALID_PURPOSE + 26 + + ) + +324 + #X509_V_ERR_CERT_UNTRUSTED + 27 + + ) + +325 + #X509_V_ERR_CERT_REJECTED + 28 + + ) + +327 + #X509_V_ERR_SUBJECT_ISSUER_MISMATCH + 29 + + ) + +328 + #X509_V_ERR_AKID_SKID_MISMATCH + 30 + + ) + +329 + #X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH + 31 + + ) + +330 + #X509_V_ERR_KEYUSAGE_NO_CERTSIGN + 32 + + ) + +332 + #X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER + 33 + + ) + +333 + #X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION + 34 + + ) + +334 + #X509_V_ERR_KEYUSAGE_NO_CRL_SIGN + 35 + + ) + +335 + #X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION + 36 + + ) + +336 + #X509_V_ERR_INVALID_NON_CA + 37 + + ) + +337 + #X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED + 38 + + ) + +338 + #X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE + 39 + + ) + +339 + #X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED + 40 + + ) + +341 + #X509_V_ERR_INVALID_EXTENSION + 41 + + ) + +342 + #X509_V_ERR_INVALID_POLICY_EXTENSION + 42 + + ) + +343 + #X509_V_ERR_NO_EXPLICIT_POLICY + 43 + + ) + +344 + #X509_V_ERR_DIFFERENT_CRL_SCOPE + 44 + + ) + +345 + #X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE + 45 + + ) + +347 + #X509_V_ERR_UNNESTED_RESOURCE + 46 + + ) + +349 + #X509_V_ERR_PERMITTED_VIOLATION + 47 + + ) + +350 + #X509_V_ERR_EXCLUDED_VIOLATION + 48 + + ) + +351 + #X509_V_ERR_SUBTREE_MINMAX + 49 + + ) + +352 + #X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE + 51 + + ) + +353 + #X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX + 52 + + ) + +354 + #X509_V_ERR_UNSUPPORTED_NAME_SYNTAX + 53 + + ) + +355 + #X509_V_ERR_CRL_PATH_VALIDATION_ERROR + 54 + + ) + +358 + #X509_V_ERR_APPLICATION_VERIFICATION + 50 + + ) + +363 + #X509_V_FLAG_CB_ISSUER_CHECK + 0x1 + + ) + +365 + #X509_V_FLAG_USE_CHECK_TIME + 0x2 + + ) + +367 + #X509_V_FLAG_CRL_CHECK + 0x4 + + ) + +369 + #X509_V_FLAG_CRL_CHECK_ALL + 0x8 + + ) + +371 + #X509_V_FLAG_IGNORE_CRITICAL + 0x10 + + ) + +373 + #X509_V_FLAG_X509_STRICT + 0x20 + + ) + +375 + #X509_V_FLAG_ALLOW_PROXY_CERTS + 0x40 + + ) + +377 + #X509_V_FLAG_POLICY_CHECK + 0x80 + + ) + +379 + #X509_V_FLAG_EXPLICIT_POLICY + 0x100 + + ) + +381 + #X509_V_FLAG_INHIBIT_ANY + 0x200 + + ) + +383 + #X509_V_FLAG_INHIBIT_MAP + 0x400 + + ) + +385 + #X509_V_FLAG_NOTIFY_POLICY + 0x800 + + ) + +387 + #X509_V_FLAG_EXTENDED_CRL_SUPPORT + 0x1000 + + ) + +389 + #X509_V_FLAG_USE_DELTAS + 0x2000 + + ) + +391 + #X509_V_FLAG_CHECK_SS_SIGNATURE + 0x4000 + + ) + +397 + #X509_V_FLAG_NO_ALT_CHAINS + 0x100000 + + ) + +399 + #X509_VP_FLAG_DEFAULT + 0x1 + + ) + +400 + #X509_VP_FLAG_OVERWRITE + 0x2 + + ) + +401 + #X509_VP_FLAG_RESET_FLAGS + 0x4 + + ) + +402 + #X509_VP_FLAG_LOCKED + 0x8 + + ) + +403 + #X509_VP_FLAG_ONCE + 0x10 + + ) + +406 + #X509_V_FLAG_POLICY_MASK + ( +X509_V_FLAG_POLICY_CHECK + \ + +407 | +X509_V_FLAG_EXPLICIT_POLICY + \ + +408 | +X509_V_FLAG_INHIBIT_ANY + \ + +409 | +X509_V_FLAG_INHIBIT_MAP +) + + ) + +411 +X509_OBJECT_idx_by_subje� +( +STACK_OF +( +X509_OBJECT +�* +h +, +ty� +, + +412 +X509_NAME + * +�me +); + +413 +X509_OBJECT + * +X509_OBJECT_���ve_by_subje� +( +STACK_OF +(X509_OBJECT�* +h +, +ty� +, +X509_NAME + * +�me +); + +414 +X509_OBJECT + * +X509_OBJECT_���ve_m�ch +( +STACK_OF +(X509_OBJECT�* +h +, X509_OBJECT * +x +); + +415 +X509_OBJECT_up_�f_cou� +( +X509_OBJECT + * +a +); + +416 +X509_OBJECT_�_cڋ�s +( +X509_OBJECT + * +a +); + +417 +X509_STORE + * +X509_STORE_�w +(); + +418 +X509_STORE_� +( +X509_STORE + * +v +); + +420 +STACK_OF +( +X509 +)* +X509_STORE_g�1_��s +( +X509_STORE_CTX + * +� +, +X509_NAME + * +nm +); + +421 +STACK_OF +( +X509_CRL +)* +X509_STORE_g�1_�ls +( +X509_STORE_CTX + * +� +, +X509_NAME + * +nm +); + +422 +X509_STORE_�t_�ags +( +X509_STORE + * +�x +, +�ags +); + +423 +X509_STORE_�t_pu�o� +( +X509_STORE + * +�x +, +pu�o� +); + +424 +X509_STORE_�t_�u� +( +X509_STORE + * +�x +, +�u� +); + +425 +X509_STORE_�t1_��m +( +X509_STORE + * +�x +, +X509_VERIFY_PARAM + * +pm +); + +427 +X509_STORE_�t_v�ify_cb +( +X509_STORE + * +�x +, + +428 (* +v�ify_cb +)(, +X509_STORE_CTX + *)); + +430 +X509_STORE_CTX + * +X509_STORE_CTX_�w +(); + +432 +X509_STORE_CTX_g�1_issu� +( +X509 + ** +issu� +, +X509_STORE_CTX + * +�x +, X509 * +x +); + +434 +X509_STORE_CTX_� +( +X509_STORE_CTX + * +�x +); + +435 +X509_STORE_CTX_�� +( +X509_STORE_CTX + * +�x +, +X509_STORE + * +��e +, + +436 +X509 + * +x509 +, +STACK_OF +(X509�* +cha� +); + +437 +X509_STORE_CTX_�u�ed_�ack +( +X509_STORE_CTX + * +�x +, +STACK_OF +( +X509 +�* +sk +); + +438 +X509_STORE_CTX_��nup +( +X509_STORE_CTX + * +�x +); + +440 +X509_LOOKUP + * +X509_STORE_add_lookup +( +X509_STORE + * +v +, +X509_LOOKUP_METHOD + * +m +); + +442 +X509_LOOKUP_METHOD + * +X509_LOOKUP_hash_d� +(); + +443 +X509_LOOKUP_METHOD + * +X509_LOOKUP_f�e +(); + +445 +X509_STORE_add_�� +( +X509_STORE + * +�x +, +X509 + * +x +); + +446 +X509_STORE_add_�l +( +X509_STORE + * +�x +, +X509_CRL + * +x +); + +448 +X509_STORE_g�_by_subje� +( +X509_STORE_CTX + * +vs +, +ty� +, +X509_NAME + * +�me +, + +449 +X509_OBJECT + * +�t +); + +451 +X509_LOOKUP_�� +( +X509_LOOKUP + * +�x +, +cmd +, cڡ * +�gc +, + +452 +�gl +, ** +�t +); + +454 #i�de� +OPENSSL_NO_STDIO + + +455 +X509_l�d_��_f�e +( +X509_LOOKUP + * +�x +, cڡ * +f�e +, +ty� +); + +456 +X509_l�d_�l_f�e +( +X509_LOOKUP + * +�x +, cڡ * +f�e +, +ty� +); + +457 +X509_l�d_��_�l_f�e +( +X509_LOOKUP + * +�x +, cڡ * +f�e +, +ty� +); + +461 +X509_LOOKUP + * +X509_LOOKUP_�w +( +X509_LOOKUP_METHOD + * +m�hod +); + +462 +X509_LOOKUP_� +( +X509_LOOKUP + * +�x +); + +463 +X509_LOOKUP_�� +( +X509_LOOKUP + * +�x +); + +464 +X509_LOOKUP_by_subje� +( +X509_LOOKUP + * +�x +, +ty� +, +X509_NAME + * +�me +, + +465 +X509_OBJECT + * +�t +); + +466 +X509_LOOKUP_by_issu�_�r�l +( +X509_LOOKUP + * +�x +, +ty� +, +X509_NAME + * +�me +, + +467 +ASN1_INTEGER + * +�r�l +, +X509_OBJECT + * +�t +); + +468 +X509_LOOKUP_by_f�g���t +( +X509_LOOKUP + * +�x +, +ty� +, + +469 * +by�s +, +�n +, +X509_OBJECT + * +�t +); + +470 +X509_LOOKUP_by_��s +( +X509_LOOKUP + * +�x +, +ty� +, * +�r +, + +471 +�n +, +X509_OBJECT + * +�t +); + +472 +X509_LOOKUP_shutdown +( +X509_LOOKUP + * +�x +); + +474 #i�de� +OPENSSL_NO_STDIO + + +475 +X509_STORE_l�d_lo�ti�s + ( +X509_STORE + * +�x +, + +476 cڡ * +f�e +, cڡ * +d� +); + +477 +X509_STORE_�t_de�u�_�ths +( +X509_STORE + * +�x +); + +480 +X509_STORE_CTX_g�_ex_�w_�dex +( +�gl +, * +�gp +, +CRYPTO_EX_�w + * +�w_func +, + +481 +CRYPTO_EX_dup + * +dup_func +, +CRYPTO_EX_� + * +�_func +); + +482 +X509_STORE_CTX_�t_ex_d�a +( +X509_STORE_CTX + * +�x +, +idx +,* +d�a +); + +483 * +X509_STORE_CTX_g�_ex_d�a +( +X509_STORE_CTX + * +�x +, +idx +); + +484 +X509_STORE_CTX_g�_�r� +( +X509_STORE_CTX + * +�x +); + +485 +X509_STORE_CTX_�t_�r� +( +X509_STORE_CTX + * +�x +, +s +); + +486 +X509_STORE_CTX_g�_�r�_d�th +( +X509_STORE_CTX + * +�x +); + +487 +X509 + * +X509_STORE_CTX_g�_cu��t_�� +( +X509_STORE_CTX + * +�x +); + +488 +X509 + * +X509_STORE_CTX_g�0_cu��t_issu� +( +X509_STORE_CTX + * +�x +); + +489 +X509_CRL + * +X509_STORE_CTX_g�0_cu��t_�l +( +X509_STORE_CTX + * +�x +); + +490 +X509_STORE_CTX + * +X509_STORE_CTX_g�0_���_�x +(X509_STORE_CTX * +�x +); + +491 +STACK_OF +( +X509 +�* +X509_STORE_CTX_g�_cha� +( +X509_STORE_CTX + * +�x +); + +492 +STACK_OF +( +X509 +�* +X509_STORE_CTX_g�1_cha� +( +X509_STORE_CTX + * +�x +); + +493 +X509_STORE_CTX_�t_�� +( +X509_STORE_CTX + * +c +, +X509 + * +x +); + +494 +X509_STORE_CTX_�t_cha� +( +X509_STORE_CTX + * +c +, +STACK_OF +( +X509 +�* +sk +); + +495 +X509_STORE_CTX_�t0_�ls +( +X509_STORE_CTX + * +c +, +STACK_OF +( +X509_CRL +�* +sk +); + +496 +X509_STORE_CTX_�t_pu�o� +( +X509_STORE_CTX + * +�x +, +pu�o� +); + +497 +X509_STORE_CTX_�t_�u� +( +X509_STORE_CTX + * +�x +, +�u� +); + +498 +X509_STORE_CTX_pu�o�_�h�� +( +X509_STORE_CTX + * +�x +, +def_pu�o� +, + +499 +pu�o� +, +�u� +); + +500 +X509_STORE_CTX_�t_�ags +( +X509_STORE_CTX + * +�x +, +�ags +); + +501 +X509_STORE_CTX_�t_time +( +X509_STORE_CTX + * +�x +, +�ags +, + +502 +time_t + +t +); + +503 +X509_STORE_CTX_�t_v�ify_cb +( +X509_STORE_CTX + * +�x +, + +504 (* +v�ify_cb +)(, +X509_STORE_CTX + *)); + +506 +X509_POLICY_TREE + * +X509_STORE_CTX_g�0_p�icy_�� +( +X509_STORE_CTX + * +�x +); + +507 +X509_STORE_CTX_g�_ex�ic�_p�icy +( +X509_STORE_CTX + * +�x +); + +509 +X509_VERIFY_PARAM + * +X509_STORE_CTX_g�0_��m +( +X509_STORE_CTX + * +�x +); + +510 +X509_STORE_CTX_�t0_��m +( +X509_STORE_CTX + * +�x +, +X509_VERIFY_PARAM + * +��m +); + +511 +X509_STORE_CTX_�t_de�u� +( +X509_STORE_CTX + * +�x +, cڡ * +�me +); + +515 +X509_VERIFY_PARAM + * +X509_VERIFY_PARAM_�w +(); + +516 +X509_VERIFY_PARAM_� +( +X509_VERIFY_PARAM + * +��m +); + +517 +X509_VERIFY_PARAM_�h�� +( +X509_VERIFY_PARAM + * +to +, + +518 cڡ +X509_VERIFY_PARAM + * +�om +); + +519 +X509_VERIFY_PARAM_�t1 +( +X509_VERIFY_PARAM + * +to +, + +520 cڡ +X509_VERIFY_PARAM + * +�om +); + +521 +X509_VERIFY_PARAM_�t1_�me +( +X509_VERIFY_PARAM + * +��m +, cڡ * +�me +); + +522 +X509_VERIFY_PARAM_�t_�ags +( +X509_VERIFY_PARAM + * +��m +, +�ags +); + +523 +X509_VERIFY_PARAM_��r_�ags +( +X509_VERIFY_PARAM + * +��m +, + +524 +�ags +); + +525 +X509_VERIFY_PARAM_g�_�ags +( +X509_VERIFY_PARAM + * +��m +); + +526 +X509_VERIFY_PARAM_�t_pu�o� +( +X509_VERIFY_PARAM + * +��m +, +pu�o� +); + +527 +X509_VERIFY_PARAM_�t_�u� +( +X509_VERIFY_PARAM + * +��m +, +�u� +); + +528 +X509_VERIFY_PARAM_�t_d�th +( +X509_VERIFY_PARAM + * +��m +, +d�th +); + +529 +X509_VERIFY_PARAM_�t_time +( +X509_VERIFY_PARAM + * +��m +, +time_t + +t +); + +530 +X509_VERIFY_PARAM_add0_p�icy +( +X509_VERIFY_PARAM + * +��m +, + +531 +ASN1_OBJECT + * +p�icy +); + +532 +X509_VERIFY_PARAM_�t1_p�ic�s +( +X509_VERIFY_PARAM + * +��m +, + +533 +STACK_OF +( +ASN1_OBJECT +�* +p�ic�s +); + +534 +X509_VERIFY_PARAM_g�_d�th +(cڡ +X509_VERIFY_PARAM + * +��m +); + +536 +X509_VERIFY_PARAM_add0_�b� +( +X509_VERIFY_PARAM + * +��m +); + +537 cڡ +X509_VERIFY_PARAM + * +X509_VERIFY_PARAM_lookup +(cڡ * +�me +); + +538 +X509_VERIFY_PARAM_�b�_��nup +(); + +540 +X509_p�icy_check +( +X509_POLICY_TREE + ** +��e +, * +�x�ic�_p�icy +, + +541 +STACK_OF +( +X509 +�* +��s +, + +542 +STACK_OF +( +ASN1_OBJECT +�* +p�icy_oids +, + +543 +�ags +); + +545 +X509_p�icy_��_� +( +X509_POLICY_TREE + * +�� +); + +547 +X509_p�icy_��_�v�_cou� +(cڡ +X509_POLICY_TREE + * +�� +); + +548 +X509_POLICY_LEVEL + * + +549 +X509_p�icy_��_g�0_�v� +(cڡ +X509_POLICY_TREE + * +�� +, +i +); + +551 +STACK_OF +( +X509_POLICY_NODE +) * + +552 +X509_p�icy_��_g�0_p�ic�s +(cڡ +X509_POLICY_TREE + * +�� +); + +554 +STACK_OF +( +X509_POLICY_NODE +) * + +555 +X509_p�icy_��_g�0_u�r_p�ic�s +(cڡ +X509_POLICY_TREE + * +�� +); + +557 +X509_p�icy_�v�_node_cou� +( +X509_POLICY_LEVEL + * +�v� +); + +559 +X509_POLICY_NODE + * +X509_p�icy_�v�_g�0_node +( +X509_POLICY_LEVEL + * +�v� +, +i +); + +561 cڡ +ASN1_OBJECT + * +X509_p�icy_node_g�0_p�icy +(cڡ +X509_POLICY_NODE + * +node +); + +563 +STACK_OF +( +POLICYQUALINFO +) * + +564 +X509_p�icy_node_g�0_qu�if�rs +(cڡ +X509_POLICY_NODE + * +node +); + +565 cڡ +X509_POLICY_NODE + * + +566 +X509_p�icy_node_g�0_��� +(cڡ +X509_POLICY_NODE + * +node +); + +568 #ifde� +__�lu�lus + + + @/usr/include/stdc-predef.h + +18 #i�def +_STDC_PREDEF_H + + +19 + #_STDC_PREDEF_H + 1 + + ) + +36 #ifde� +__GCC_IEC_559 + + +37 #i� +__GCC_IEC_559 + > 0 + +38 + #__STDC_IEC_559__ + 1 + + ) + +41 + #__STDC_IEC_559__ + 1 + + ) + +44 #ifde� +__GCC_IEC_559_COMPLEX + + +45 #i� +__GCC_IEC_559_COMPLEX + > 0 + +46 + #__STDC_IEC_559_COMPLEX__ + 1 + + ) + +49 + #__STDC_IEC_559_COMPLEX__ + 1 + + ) + +54 + #__STDC_ISO_10646__ + 201103L + + ) + +57 + #__STDC_NO_THREADS__ + 1 + + ) + + @/usr/include/sys/timeb.h + +18 #i�de� +_SYS_TIMEB_H + + +19 + #_SYS_TIMEB_H + 1 + + ) + +21 + ~<�u�s.h +> + +23 + #__�ed_time_t + + + ) + +24 + ~<time.h +> + +27 +__BEGIN_DECLS + + +31 + stimeb + + +33 +time_t + + mtime +; + +34 + mm�l�m +; + +35 + mtimez�e +; + +36 + md��ag +; + +41 +�ime + ( +timeb + * +__timebuf +); + +43 + g__END_DECLS + + + @/usr/include/sys/times.h + +22 #i�def +_SYS_TIMES_H + + +23 + #_SYS_TIMES_H + 1 + + ) + +25 + ~<�u�s.h +> + +27 + #__�ed_�ock_t + + + ) + +28 + ~<time.h +> + +31 +__BEGIN_DECLS + + +34 + stms + + +36 +�ock_t + + mtms_utime +; + +37 +�ock_t + + mtms_�ime +; + +39 +�ock_t + + mtms_cutime +; + +40 +�ock_t + + mtms_c�ime +; + +48 +�ock_t + + $times + ( +tms + * +__buf�r +� +__THROW +; + +50 +__END_DECLS + + + @/usr/include/asm-generic/socket.h + +1 #i�de� +__ASM_GENERIC_SOCKET_H + + +2 + #__ASM_GENERIC_SOCKET_H + + + ) + +4 + ~<asm/sockios.h +> + +7 + #SOL_SOCKET + 1 + + ) + +9 + #SO_DEBUG + 1 + + ) + +10 + #SO_REUSEADDR + 2 + + ) + +11 + #SO_TYPE + 3 + + ) + +12 + #SO_ERROR + 4 + + ) + +13 + #SO_DONTROUTE + 5 + + ) + +14 + #SO_BROADCAST + 6 + + ) + +15 + #SO_SNDBUF + 7 + + ) + +16 + #SO_RCVBUF + 8 + + ) + +17 + #SO_SNDBUFFORCE + 32 + + ) + +18 + #SO_RCVBUFFORCE + 33 + + ) + +19 + #SO_KEEPALIVE + 9 + + ) + +20 + #SO_OOBINLINE + 10 + + ) + +21 + #SO_NO_CHECK + 11 + + ) + +22 + #SO_PRIORITY + 12 + + ) + +23 + #SO_LINGER + 13 + + ) + +24 + #SO_BSDCOMPAT + 14 + + ) + +25 + #SO_REUSEPORT + 15 + + ) + +26 #i�de� +SO_PASSCRED + + +27 + #SO_PASSCRED + 16 + + ) + +28 + #SO_PEERCRED + 17 + + ) + +29 + #SO_RCVLOWAT + 18 + + ) + +30 + #SO_SNDLOWAT + 19 + + ) + +31 + #SO_RCVTIMEO + 20 + + ) + +32 + #SO_SNDTIMEO + 21 + + ) + +36 + #SO_SECURITY_AUTHENTICATION + 22 + + ) + +37 + #SO_SECURITY_ENCRYPTION_TRANSPORT + 23 + + ) + +38 + #SO_SECURITY_ENCRYPTION_NETWORK + 24 + + ) + +40 + #SO_BINDTODEVICE + 25 + + ) + +43 + #SO_ATTACH_FILTER + 26 + + ) + +44 + #SO_DETACH_FILTER + 27 + + ) + +45 + #SO_GET_FILTER + +SO_ATTACH_FILTER + + + ) + +47 + #SO_PEERNAME + 28 + + ) + +48 + #SO_TIMESTAMP + 29 + + ) + +49 + #SCM_TIMESTAMP + +SO_TIMESTAMP + + + ) + +51 + #SO_ACCEPTCONN + 30 + + ) + +53 + #SO_PEERSEC + 31 + + ) + +54 + #SO_PASSSEC + 34 + + ) + +55 + #SO_TIMESTAMPNS + 35 + + ) + +56 + #SCM_TIMESTAMPNS + +SO_TIMESTAMPNS + + + ) + +58 + #SO_MARK + 36 + + ) + +60 + #SO_TIMESTAMPING + 37 + + ) + +61 + #SCM_TIMESTAMPING + +SO_TIMESTAMPING + + + ) + +63 + #SO_PROTOCOL + 38 + + ) + +64 + #SO_DOMAIN + 39 + + ) + +66 + #SO_RXQ_OVFL + 40 + + ) + +68 + #SO_WIFI_STATUS + 41 + + ) + +69 + #SCM_WIFI_STATUS + +SO_WIFI_STATUS + + + ) + +70 + #SO_PEEK_OFF + 42 + + ) + +73 + #SO_NOFCS + 43 + + ) + +75 + #SO_LOCK_FILTER + 44 + + ) + +77 + #SO_SELECT_ERR_QUEUE + 45 + + ) + +79 + #SO_BUSY_POLL + 46 + + ) + +81 + #SO_MAX_PACING_RATE + 47 + + ) + + @/usr/include/asm-generic/types.h + +1 #i�de� +_ASM_GENERIC_TYPES_H + + +2 + #_ASM_GENERIC_TYPES_H + + + ) + +7 + ~<asm-g��ic/�t-�64.h +> + + @/usr/include/asm/errno.h + +1 + ~<asm-g��ic/��o.h +> + + @/usr/include/asm/posix_types.h + +1 #ifde� +__i386__ + + +2 + ~<asm/posix_ty�s_32.h +> + +3 #�i� +def�ed +( +__ILP32__ +) + +4 + ~<asm/posix_ty�s_x32.h +> + +6 + ~<asm/posix_ty�s_64.h +> + + @/usr/include/bits/libc-lock.h + +19 #i�de� +_BITS_LIBC_LOCK_H + + +20 + #_BITS_LIBC_LOCK_H + 1 + + ) + +22 + ~<�h�ad.h +> + +23 + #__�ed_NULL + + + ) + +24 + ~<�ddef.h +> + +27 #ifde� +_LIBC + + +28 + ~<low�v�lock.h +> + +29 + ~<�s.h +> + +30 + ~<�h�ad-fun�i�s.h +> + +31 + ~<��o.h +> + +32 + ~<gnu/�ti�-groups.h +> + +36 #i� +def�ed + +_LIBC + || def�ed +_IO_MTSAFE_IO + + +37 #i�( +def�ed + +NOT_IN_libc + && !def�ed +IS_IN_lib�h�ad +�|| !def�ed +_LIBC + + +38 �ru� { +�h�ad_mu�x_t + + mmu�x +; } + t__libc_lock_�cursive_t +; + +40 �ru� { + mlock +; + m�t +; * + mow�r +; } + t__libc_lock_�cursive_t +; + +43 +__libc_lock_�cursive_�aque__ + + t__libc_lock_�cursive_t +; + +53 + #__libc_lock_def�e_�cursive +( +CLASS +, +NAME +) \ + +54 +CLASS + +__libc_lock_�cursive_t + +NAME +; + + ) + +58 #i� +def�ed + +_LIBC + && (!def�ed +NOT_IN_libc + || def�ed +IS_IN_lib�h�ad +) + +59 #i� +LLL_LOCK_INITIALIZER + == 0 + +60 + #__libc_lock_def�e_���lized_�cursive +( +CLASS +, +NAME +) \ + +61 +CLASS + +__libc_lock_�cursive_t + +NAME +; + + ) + +63 + #__libc_lock_def�e_���lized_�cursive +( +CLASS +, +NAME +) \ + +64 +CLASS + +__libc_lock_�cursive_t + +NAME + = +_LIBC_LOCK_RECURSIVE_INITIALIZER +; + + ) + +66 + #_LIBC_LOCK_RECURSIVE_INITIALIZER + \ + +67 { +LLL_LOCK_INITIALIZER +, 0, +NULL + } + + ) + +69 + #__libc_lock_def�e_���lized_�cursive +( +CLASS +, +NAME +) \ + +70 +CLASS + +__libc_lock_�cursive_t + +NAME + = +_LIBC_LOCK_RECURSIVE_INITIALIZER +; + + ) + +71 + #_LIBC_LOCK_RECURSIVE_INITIALIZER + \ + +72 { +PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP +} + + ) + +76 #i� +def�ed + +_LIBC + && (!def�ed +NOT_IN_libc + || def�ed +IS_IN_lib�h�ad +) + +77 + #__libc_lock_��_�cursive +( +NAME +) \ + +78 (( +NAME +��( +__libc_lock_�cursive_t +� +_LIBC_LOCK_RECURSIVE_INITIALIZER +, 0) + + ) + +80 + #__libc_lock_��_�cursive +( +NAME +) \ + +82 i�( +__�h�ad_mu�x_�� + !� +NULL +) \ + +84 +�h�ad_mu�x��_t + +__�� +; \ + +85 + `__�h�ad_mu�x��_�� + (& +__�� +); \ + +86 + `__�h�ad_mu�x��_��y� + (& +__�� +, +PTHREAD_MUTEX_RECURSIVE_NP +); \ + +87 + `__�h�ad_mu�x_�� + (&( +NAME +). +mu�x +, & +__�� +); \ + +88 + `__�h�ad_mu�x��_de�roy + (& +__�� +); \ + +90 } 0) + + ) + +94 #i� +def�ed + +_LIBC + && (!def�ed +NOT_IN_libc + || def�ed +IS_IN_lib�h�ad +) + +95 + #__libc_lock_f�i_�cursive +( +NAME +�((�0) + + ) + +97 + #__libc_lock_f�i_�cursive +( +NAME +) \ + +98 + `__libc_maybe_�� + ( +__�h�ad_mu�x_de�roy +, (&( +NAME +). +mu�x +), 0) + + ) + +102 #i� +def�ed + +_LIBC + && (!def�ed +NOT_IN_libc + || def�ed +IS_IN_lib�h�ad +) + +103 #i� +__OPTION_EGLIBC_BIG_MACROS + != 1 + +107 +__libc_lock_lock_�cursive_� + ( +__libc_lock_�cursive_t + *); + +108 +libc_hidd�_��o + ( +__libc_lock_lock_�cursive_� +); + +110 #i� +__OPTION_EGLIBC_BIG_MACROS + + +111 + #__libc_lock_lock_�cursive +( +NAME +) \ + +113 * +�lf + = +THREAD_SELF +; \ + +114 i�(( +NAME +). +ow�r + !� +�lf +) \ + +116 + `�l_lock + (( +NAME +). +lock +, +LLL_PRIVATE +); \ + +117 ( +NAME +). +ow�r + = +�lf +; \ + +119 ++( +NAME +). +�t +; \ + +120 } 0) + + ) + +122 + #__libc_lock_lock_�cursive +( +NAME +) \ + +123 + `__libc_lock_lock_�cursive_� + (&( +NAME +)) + + ) + +126 + #__libc_lock_lock_�cursive +( +NAME +) \ + +127 + `__libc_maybe_�� + ( +__�h�ad_mu�x_lock +, (&( +NAME +). +mu�x +), 0) + + ) + +131 #i� +def�ed + +_LIBC + && (!def�ed +NOT_IN_libc + || def�ed +IS_IN_lib�h�ad +) + +132 #i� +__OPTION_EGLIBC_BIG_MACROS + != 1 + +136 +__libc_lock_�ylock_�cursive_� + ( +__libc_lock_�cursive_t + *); + +137 +libc_hidd�_��o + ( +__libc_lock_�ylock_�cursive_� +); + +139 #i� +__OPTION_EGLIBC_BIG_MACROS + + +140 + #__libc_lock_�ylock_�cursive +( +NAME +) \ + +142 +�su� + = 0; \ + +143 * +�lf + = +THREAD_SELF +; \ + +144 i�(( +NAME +). +ow�r + !� +�lf +) \ + +146 i�( + `�l_�ylock + (( +NAME +). +lock +) == 0) \ + +148 ( +NAME +). +ow�r + = +�lf +; \ + +149 ( +NAME +). +�t + = 1; \ + +152 +�su� + = +EBUSY +; \ + +155 ++( +NAME +). +�t +; \ + +156 +�su� +; \ + +157 }) + + ) + +159 + #__libc_lock_�ylock_�cursive +( +NAME +) \ + +160 + `__libc_lock_�ylock_�cursive_� + (&( +NAME +)) + + ) + +163 + #__libc_lock_�ylock_�cursive +( +NAME +) \ + +164 + `__libc_maybe_�� + ( +__�h�ad_mu�x_�ylock +, (&( +NAME +). +mu�x +), 0) + + ) + +168 #i� +def�ed + +_LIBC + && (!def�ed +NOT_IN_libc + || def�ed +IS_IN_lib�h�ad +) + +169 #i� +__OPTION_EGLIBC_BIG_MACROS + != 1 + +173 +__libc_lock_u�ock_�cursive_� + ( +__libc_lock_�cursive_t + *); + +174 +libc_hidd�_��o + ( +__libc_lock_u�ock_�cursive_� +); + +176 #i� +__OPTION_EGLIBC_BIG_MACROS + + +178 + #__libc_lock_u�ock_�cursive +( +NAME +) \ + +180 i�(--( +NAME +). +�t + == 0) \ + +182 ( +NAME +). +ow�r + = +NULL +; \ + +183 + `�l_u�ock + (( +NAME +). +lock +, +LLL_PRIVATE +); \ + +185 } 0) + + ) + +187 + #__libc_lock_u�ock_�cursive +( +NAME +) \ + +188 + `__libc_lock_u�ock_�cursive_� + (&( +NAME +)) + + ) + +191 + #__libc_lock_u�ock_�cursive +( +NAME +) \ + +192 + `__libc_maybe_�� + ( +__�h�ad_mu�x_u�ock +, (&( +NAME +). +mu�x +), 0) + + ) + +199 +_�h�ad_��nup_push_de�r + ( +_�h�ad_��nup_buf�r + * +buf�r +, + +200 (* +rout�e +�(*), * +�g +); + +201 + `_�h�ad_��nup_p�_���e + ( +_�h�ad_��nup_buf�r + * +buf�r +, + +202 +execu� +); + +205 + #__libc_��nup_�gi�_��t +( +DOIT +, +FCT +, +ARG +) \ + +206 { +_�h�ad_��nup_buf�r + +_buf�r +; \ + +207 +_ava� +; \ + +208 i�( +DOIT +) { \ + +209 +_ava� + = + `PTFAVAIL + ( +_�h�ad_��nup_push_de�r +); \ + +210 i�( +_ava� +) { \ + +211 + `__libc_�f_��_�ways + ( +_�h�ad_��nup_push_de�r +, (& +_buf�r +, +FCT +, \ + +212 +ARG +)); \ + +214 +_buf�r +. +__rout�e + = ( +FCT +); \ + +215 +_buf�r +. +__�g + = ( +ARG +); \ + +218 +_ava� + = 0; \ + +219 } + + ) + +222 + #__libc_��nup_�gi�_�d +( +DOIT +) \ + +223 i�( +_ava� +) { \ + +224 + `__libc_�f_��_�ways + ( +_�h�ad_��nup_p�_���e +, (& +_buf�r +, +DOIT +));\ + +225 } i�( +DOIT +) \ + +226 +_buf�r +. + `__rout�e + (_buf�r. +__�g +); \ + +227 + } + + ) +} + +232 #ifde� +_LIBC + + +233 + ~"libc-lockP.h +" + + @/usr/include/gconv.h + +22 #i�de� +_GCONV_H + + +23 + #_GCONV_H + 1 + + ) + +25 + ~<�u�s.h +> + +26 + #__�ed_mb��e_t + + + ) + +27 + #__�ed_w�t_t + + + ) + +28 + ~<wch�.h +> + +29 + #__�ed_size_t + + + ) + +30 + #__�ed_wch�_t + + + ) + +31 + ~<�ddef.h +> + +34 + #__UNKNOWN_10646_CHAR + (( +wch�_t +�0xfffd) + + ) + +39 + m__GCONV_OK + = 0, + +40 + m__GCONV_NOCONV +, + +41 + m__GCONV_NODB +, + +42 + m__GCONV_NOMEM +, + +44 + m__GCONV_EMPTY_INPUT +, + +45 + m__GCONV_FULL_OUTPUT +, + +46 + m__GCONV_ILLEGAL_INPUT +, + +47 + m__GCONV_INCOMPLETE_INPUT +, + +49 + m__GCONV_ILLEGAL_DESCRIPTOR +, + +50 + m__GCONV_INTERNAL_ERROR + + +57 + m__GCONV_IS_LAST + = 0x0001, + +58 + m__GCONV_IGNORE_ERRORS + = 0x0002, + +59 + m__GCONV_SWAP + = 0x0004 + +64 + g__gc�v_�� +; + +65 + g__gc�v_��_d�a +; + +66 + g__gc�v_l�ded_obje� +; + +67 + g__gc�v_��s_d�a +; + +71 (* + t__gc�v_f� +�( + t__gc�v_�� + *, + t__gc�v_��_d�a + *, + +73 **, + tsize_t + *, , ); + +76 + $w�t_t + (* + t__gc�v_btowc_f� +�( + t__gc�v_�� + *, ); + +79 (* + t__gc�v_��_f� +�( + t__gc�v_�� + *); + +80 (* + t__gc�v_�d_f� +�( + t__gc�v_�� + *); + +84 (* + t__gc�v_��s_f� +�( + t__gc�v_�� + *, + +85 + t__gc�v_��_d�a + *, *, + +89 + tsize_t + *); + +92 (* + t__gc�v_��s_cڋxt_f� +) (*, const *, + +97 (* + t__gc�v_��s_qu�y_f� +) (const *, const ***, + +98 + tsize_t + *); + +101 (* + t__gc�v_��s_��_f� +) (**, const *); + +102 (* + t__gc�v_��s_�d_f� +) (*); + +104 + s__gc�v_��s_d�a + + +107 +__gc�v_��s_f� + +__��s_f� +; + +108 +__gc�v_��s_cڋxt_f� + +__��s_cڋxt_f� +; + +109 +__gc�v_��s_�d_f� + +__��s_�d_f� +; + +110 * +__d�a +; + +111 +__gc�v_��s_d�a + * +__�xt +; + +116 + s__gc�v_�� + + +118 +__gc�v_l�ded_obje� + * +__shlib_h�d� +; + +119 cڡ * +__mod�me +; + +121 +__cou�� +; + +123 * +__�om_�me +; + +124 * +__to_�me +; + +126 +__gc�v_f� + +__f� +; + +127 +__gc�v_btowc_f� + +__btowc_f� +; + +128 +__gc�v_��_f� + +__��_f� +; + +129 +__gc�v_�d_f� + +__�d_f� +; + +133 +__m�_�eded_�om +; + +134 +__max_�eded_�om +; + +135 +__m�_�eded_to +; + +136 +__max_�eded_to +; + +139 +__��eful +; + +141 * +__d�a +; + +146 + s__gc�v_��_d�a + + +148 * +__outbuf +; + +149 * +__outbu�nd +; + +153 +__�ags +; + +157 +__�vo�ti�_cou�� +; + +161 +__����_u� +; + +163 +__mb��e_t + * +__��� +; + +164 +__mb��e_t + +__��e +; + +168 +__gc�v_��s_d�a + * +__��s +; + +173 + s__gc�v_�fo + + +175 +size_t + +__n��s +; + +176 +__gc�v_�� + * +__��s +; + +177 +__ex�nsi�__ + +__gc�v_��_d�a + +__d�a + +__�ex�r +; + +178 } * + t__gc�v_t +; + + @/usr/include/gnu/stubs-32.h + +6 #ifde� +_LIBC + + +7 #�r� +A�li�ti�s + +may + +n� + +def�e + +the + +ma�o + +_LIBC + + +10 + #__�ub_ch�ags + + + ) + +11 + #__�ub_�ach + + + ) + +12 + #__�ub_fch�ags + + + ) + +13 + #__�ub_fd�ach + + + ) + +14 + #__�ub_g�y + + + ) + +15 + #__�ub_lchmod + + + ) + +16 + #__�ub_�voke + + + ) + +17 + #__�ub_��og� + + + ) + +18 + #__�ub_sig�tu� + + + ) + +19 + #__�ub_s�k + + + ) + +20 + #__�ub_�ty + + + ) + + @/usr/include/gnu/stubs-64.h + +6 #ifde� +_LIBC + + +7 #�r� +A�li�ti�s + +may + +n� + +def�e + +the + +ma�o + +_LIBC + + +10 + #__�ub_bd�ush + + + ) + +11 + #__�ub_ch�ags + + + ) + +12 + #__�ub_�ach + + + ) + +13 + #__�ub_fch�ags + + + ) + +14 + #__�ub_fd�ach + + + ) + +15 + #__�ub_g�msg + + + ) + +16 + #__�ub_g�y + + + ) + +17 + #__�ub_lchmod + + + ) + +18 + #__�ub_putmsg + + + ) + +19 + #__�ub_�voke + + + ) + +20 + #__�ub_��og� + + + ) + +21 + #__�ub_sig�tu� + + + ) + +22 + #__�ub_s�k + + + ) + +23 + #__�ub_�ty + + + ) + + @/usr/include/gnu/stubs-x32.h + +6 #ifde� +_LIBC + + +7 #�r� +A�li�ti�s + +may + +n� + +def�e + +the + +ma�o + +_LIBC + + +10 + #__�ub_bd�ush + + + ) + +11 + #__�ub_ch�ags + + + ) + +12 + #__�ub_���_modu� + + + ) + +13 + #__�ub_�ach + + + ) + +14 + #__�ub_fch�ags + + + ) + +15 + #__�ub_fd�ach + + + ) + +16 + #__�ub_g�_k��l_syms + + + ) + +17 + #__�ub_g�msg + + + ) + +18 + #__�ub_g�y + + + ) + +19 + #__�ub_lchmod + + + ) + +20 + #__�ub_nfs�rv�l + + + ) + +21 + #__�ub_putmsg + + + ) + +22 + #__�ub_qu�y_modu� + + + ) + +23 + #__�ub_�voke + + + ) + +24 + #__�ub_��og� + + + ) + +25 + #__�ub_sig�tu� + + + ) + +26 + #__�ub_s�k + + + ) + +27 + #__�ub_�ty + + + ) + +28 + #__�ub_u�lib + + + ) + + @/usr/include/krb5/krb5.h + +2 #i�de� +KRB5_KRB5_H_INCLUDED + + +3 + #KRB5_KRB5_H_INCLUDED + + + ) + +55 #i�de� +KRB5_GENERAL__ + + +56 + #KRB5_GENERAL__ + + + ) + +63 #i�de� +KRB5_DEPRECATED + + +64 + #KRB5_DEPRECATED + 0 + + ) + +67 #i� +def�ed +( +__MACH__ +�&& def�ed( +__APPLE__ +) + +68 + ~<T�g�C�d�iڮs.h +> + +69 #i� +TARGET_RT_MAC_CFM + + +74 #i� +def�ed +( +_MSDOS +�|| def�ed( +_WIN32 +) + +75 + ~<w�-mac.h +> + +78 #i�de� +KRB5_CONFIG__ + + +79 #i�de� +KRB5_CALLCONV + + +80 + #KRB5_CALLCONV + + + ) + +81 + #KRB5_CALLCONV_C + + + ) + +85 #i�de� +KRB5_CALLCONV_WRONG + + +86 + #KRB5_CALLCONV_WRONG + + + ) + +89 #i�de� +THREEPARAMOPEN + + +90 + #THREEPARAMOPEN +( +x +, +y +, +z +� + `ݒ +(x,y,z) + + ) + +93 + #KRB5_OLD_CRYPTO + + + ) + +95 + ~<�dlib.h +> + +96 + ~<lim�s.h +> + +97 + ~<�d�g.h +> + +99 #i�de� +KRB5INT_BEGIN_DECLS + + +100 #i� +def�ed +( +__�lu�lus +) + +101 + #KRB5INT_BEGIN_DECLS + "C" { + + ) + +102 + #KRB5INT_END_DECLS + } + + ) + +104 + #KRB5INT_BEGIN_DECLS + + + ) + +105 + #KRB5INT_END_DECLS + + + ) + +109 +KRB5INT_BEGIN_DECLS + + +111 #i� +TARGET_OS_MAC + + +112 #�agm� +�ck +( +push +,2) + +115 #i�( +__GNUC__ + * 10000 + +__GNUC_MINOR__ + * 100 + +__GNUC_PATCHLEVEL__ +) >= 30203 + +116 + #KRB5_ATTR_DEPRECATED + + `__��ibu�__ +(( +d����d +)) + + ) + +117 #�i� +def�ed + +_WIN32 + + +118 + #KRB5_ATTR_DEPRECATED + + `__de��ec +( +d����d +) + + ) + +120 + #KRB5_ATTR_DEPRECATED + + + ) + +124 +_�of�e_t +; + +135 + tkrb5_o�� +; + +137 #i� +INT_MAX + == 0x7fff + +138 + tkrb5_�t16 +; + +139 + tkrb5_ui_2 +; + +140 #�i� +SHRT_MAX + == 0x7fff + +141 + tkrb5_�t16 +; + +142 + tkrb5_ui_2 +; + +144 #�r� +undef�ed + 16 +b� + +ty� + + +147 #i� +INT_MAX + == 0x7fffffffL + +148 + tkrb5_�t32 +; + +149 + tkrb5_ui_4 +; + +150 #�i� +LONG_MAX + == 0x7fffffffL + +151 + tkrb5_�t32 +; + +152 + tkrb5_ui_4 +; + +153 #�i� +SHRT_MAX + == 0x7fffffffL + +154 + tkrb5_�t32 +; + +155 + tkrb5_ui_4 +; + +157 #�r�: +undef�ed + 32 +b� + +ty� + + +160 + #VALID_INT_BITS + +INT_MAX + + + ) + +161 + #VALID_UINT_BITS + +UINT_MAX + + + ) + +163 + #KRB5_INT32_MAX + 2147483647 + + ) + +166 + #KRB5_INT32_MIN + (- +KRB5_INT32_MAX +-1) + + ) + +168 + #KRB5_INT16_MAX + 65535 + + ) + +171 + #KRB5_INT16_MIN + (- +KRB5_INT16_MAX +-1) + + ) + +185 #i�de� +FALSE + + +186 + #FALSE + 0 + + ) + +188 #i�de� +TRUE + + +189 + #TRUE + 1 + + ) + +192 + tkrb5_boޗn +; + +193 + tkrb5_msgty� +; + +194 + tkrb5_kvno +; + +196 +krb5_�t32 + + tkrb5_add�y� +; + +197 +krb5_�t32 + + tkrb5_��y� +; + +198 +krb5_�t32 + + tkrb5_cksumty� +; + +199 +krb5_�t32 + + tkrb5_authd��y� +; + +200 +krb5_�t32 + + tkrb5_keyu�ge +; + +201 +krb5_�t32 + + tkrb5_�y��y� +; + +203 +krb5_�t32 + + tkrb5_��uthty� +; + +204 +krb5_�t32 + + tkrb5_�ags +; + +205 +krb5_�t32 + + tkrb5_time�amp +; + +206 +krb5_�t32 + + tkrb5_�r�_code +; + +207 +krb5_�t32 + + tkrb5_d��t +; + +209 +krb5_�r�_code + + tkrb5_magic +; + +211 + s_krb5_d�a + { + +212 +krb5_magic + + mmagic +; + +213 + m�ngth +; + +214 * + md�a +; + +215 } + tkrb5_d�a +; + +218 + s_krb5_o��_d�a + { + +219 +krb5_magic + + mmagic +; + +220 + m�ngth +; + +221 +krb5_o�� + * + md�a +; + +222 } + tkrb5_o��_d�a +; + +225 + #SALT_TYPE_AFS_LENGTH + +UINT_MAX + + + ) + +226 + #SALT_TYPE_NO_LENGTH + +UINT_MAX + + + ) + +228 * + tkrb5_po��r +; + +229 cڡ * + tkrb5_cڡ_po��r +; + +231 + skrb5_��c��_d�a + { + +232 +krb5_magic + + mmagic +; + +233 +krb5_d�a + + m��m +; + +234 +krb5_d�a + * + md�a +; + +235 +krb5_�t32 + + m�ngth +; + +236 +krb5_�t32 + + mty� +; + +237 } + tkrb5_��c��_d�a +; + +239 +krb5_��c��_d�a + * + tkrb5_��c�� +; + +245 + #KRB5_NT_UNKNOWN + 0 + + ) + +246 + #KRB5_NT_PRINCIPAL + 1 + + ) + +248 + #KRB5_NT_SRV_INST + 2 + + ) + +249 + #KRB5_NT_SRV_HST + 3 + + ) + +251 + #KRB5_NT_SRV_XHST + 4 + + ) + +252 + #KRB5_NT_UID + 5 + + ) + +253 + #KRB5_NT_X500_PRINCIPAL + 6 + + ) + +254 + #KRB5_NT_SMTP_NAME + 7 + + ) + +255 + #KRB5_NT_ENTERPRISE_PRINCIPAL + 10 + + ) + +256 + #KRB5_NT_WELLKNOWN + 11 + + ) + +257 + #KRB5_WELLKNOWN_NAMESTR + "WELLKNOWN" + + ) + +259 + #KRB5_NT_MS_PRINCIPAL + -128 + + ) + +260 + #KRB5_NT_MS_PRINCIPAL_AND_ID + -129 + + ) + +261 + #KRB5_NT_ENT_PRINCIPAL_AND_ID + -130 + + ) + +264 cڡ + tkrb5_��c��_d�a + * + tkrb5_cڡ_��c�� +; + +266 + #krb5_��c_��m +( +cڋxt +, +��c +�(&�r�c)-> +��m +) + + ) + +267 + #krb5_��c_�t_��m +( +cڋxt +, +��c +, +v�ue +�(�r�c)-> +��m + = *(v�ue)) + + ) + +268 + #krb5_��c_�t_��m_�ngth +( +cڋxt +, +��c +, +v�ue +��r�c)-> +��m +. +�ngth + = (v�ue) + + ) + +269 + #krb5_��c_�t_��m_d�a +( +cڋxt +, +��c +, +v�ue +��r�c)-> +��m +. +d�a + = (v�ue) + + ) + +270 + #krb5_��c_size +( +cڋxt +, +��c +��r�c)-> +�ngth + + + ) + +271 + #krb5_��c_ty� +( +cڋxt +, +��c +��r�c)-> +ty� + + + ) + +272 + #krb5_��c_�me +( +cڋxt +, +��c +��r�c)-> +d�a + + + ) + +273 + #krb5_��c_compڒt +( +cڋxt +, +��c +, +i +) \ + +274 ((( +i +�< + `krb5_��c_size +( +cڋxt +, +��c +)) \ + +275 ? ( +��c +)-> +d�a + + ( +i +) \ + +276 : +NULL +) + + ) + +279 + #KRB5_REFERRAL_REALM + "" + + ) + +292 +krb5_boޗn + +KRB5_CALLCONV + + +293 +krb5_is_�㼮_��m +(cڡ +krb5_d�a + * +r +); + +302 cڡ +krb5_d�a + * +KRB5_CALLCONV + + +303 +krb5_��ymous_��m +(); + +312 +krb5_cڡ_��c�� + +KRB5_CALLCONV + + +313 +krb5_��ymous_��c�� +(); + +315 + #KRB5_ANONYMOUS_REALMSTR + "WELLKNOWN:ANONYMOUS" + + ) + +316 + #KRB5_ANONYMOUS_PRINCSTR + "ANONYMOUS" + + ) + +326 + s_krb5_add�ss + { + +327 +krb5_magic + + mmagic +; + +328 +krb5_add�y� + + madd�y� +; + +329 + m�ngth +; + +330 +krb5_o�� + * + mcڋ�s +; + +331 } + tkrb5_add�ss +; + +334 + #ADDRTYPE_INET + 0x0002 + + ) + +335 + #ADDRTYPE_CHAOS + 0x0005 + + ) + +336 + #ADDRTYPE_XNS + 0x0006 + + ) + +337 + #ADDRTYPE_ISO + 0x0007 + + ) + +338 + #ADDRTYPE_DDP + 0x0010 + + ) + +339 + #ADDRTYPE_NETBIOS + 0x0014 + + ) + +340 + #ADDRTYPE_INET6 + 0x0018 + + ) + +342 + #ADDRTYPE_ADDRPORT + 0x0100 + + ) + +343 + #ADDRTYPE_IPPORT + 0x0101 + + ) + +346 + #ADDRTYPE_IS_LOCAL +( +add�y� +��dd�y� & 0x8000) + + ) + +353 + g_krb5_cڋxt +; + +354 +_krb5_cڋxt + * + tkrb5_cڋxt +; + +356 + g_krb5_auth_cڋxt +; + +357 +_krb5_auth_cڋxt + * + tkrb5_auth_cڋxt +; + +359 + g_krb5_�y�osy�em_��y +; + +366 + s_krb5_keyblock + { + +367 +krb5_magic + + mmagic +; + +368 +krb5_��y� + + m��y� +; + +369 + m�ngth +; + +370 +krb5_o�� + * + mcڋ�s +; + +371 } + tkrb5_keyblock +; + +373 + gkrb5_key_� +; + +382 +krb5_key_� + * + tkrb5_key +; + +384 #ifde� +KRB5_OLD_CRYPTO + + +385 + s_krb5_��y�_block + { + +386 +krb5_magic + + mmagic +; + +387 +krb5_��y� + + m�y�o_��y +; + +390 +krb5_keyblock + * + mkey +; + +391 } + tkrb5_��y�_block +; + +394 + s_krb5_checksum + { + +395 +krb5_magic + + mmagic +; + +396 +krb5_cksumty� + + mchecksum_ty� +; + +397 + m�ngth +; + +398 +krb5_o�� + * + mcڋ�s +; + +399 } + tkrb5_checksum +; + +401 + s_krb5_�c_d�a + { + +402 +krb5_magic + + mmagic +; + +403 +krb5_��y� + + m��y� +; + +404 +krb5_kvno + + mkvno +; + +405 +krb5_d�a + + mc�h��xt +; + +406 } + tkrb5_�c_d�a +; + +418 + s_krb5_�y�o_iov + { + +419 +krb5_�y��y� + + m�ags +; + +420 +krb5_d�a + + md�a +; + +421 } + tkrb5_�y�o_iov +; + +424 + #ENCTYPE_NULL + 0x0000 + + ) + +425 + #ENCTYPE_DES_CBC_CRC + 0x0001 + + ) + +426 + #ENCTYPE_DES_CBC_MD4 + 0x0002 + + ) + +427 + #ENCTYPE_DES_CBC_MD5 + 0x0003 + + ) + +428 + #ENCTYPE_DES_CBC_RAW + 0x0004 + + ) + +429 + #ENCTYPE_DES3_CBC_SHA + 0x0005 + + ) + +430 + #ENCTYPE_DES3_CBC_RAW + 0x0006 + + ) + +431 + #ENCTYPE_DES_HMAC_SHA1 + 0x0008 + + ) + +433 + #ENCTYPE_DSA_SHA1_CMS + 0x0009 + + ) + +434 + #ENCTYPE_MD5_RSA_CMS + 0x000� + + ) + +435 + #ENCTYPE_SHA1_RSA_CMS + 0x000b + + ) + +436 + #ENCTYPE_RC2_CBC_ENV + 0x000� + + ) + +437 + #ENCTYPE_RSA_ENV + 0x000d + + ) + +438 + #ENCTYPE_RSA_ES_OAEP_ENV + 0x000� + + ) + +439 + #ENCTYPE_DES3_CBC_ENV + 0x000� + + ) + +441 + #ENCTYPE_DES3_CBC_SHA1 + 0x0010 + + ) + +442 + #ENCTYPE_AES128_CTS_HMAC_SHA1_96 + 0x0011 + + ) + +443 + #ENCTYPE_AES256_CTS_HMAC_SHA1_96 + 0x0012 + + ) + +444 + #ENCTYPE_ARCFOUR_HMAC + 0x0017 + + ) + +445 + #ENCTYPE_ARCFOUR_HMAC_EXP + 0x0018 + + ) + +446 + #ENCTYPE_CAMELLIA128_CTS_CMAC + 0x0019 + + ) + +447 + #ENCTYPE_CAMELLIA256_CTS_CMAC + 0x001� + + ) + +448 + #ENCTYPE_UNKNOWN + 0x01ff + + ) + +450 + #CKSUMTYPE_CRC32 + 0x0001 + + ) + +451 + #CKSUMTYPE_RSA_MD4 + 0x0002 + + ) + +452 + #CKSUMTYPE_RSA_MD4_DES + 0x0003 + + ) + +453 + #CKSUMTYPE_DESCBC + 0x0004 + + ) + +456 + #CKSUMTYPE_RSA_MD5 + 0x0007 + + ) + +457 + #CKSUMTYPE_RSA_MD5_DES + 0x0008 + + ) + +458 + #CKSUMTYPE_NIST_SHA + 0x0009 + + ) + +459 + #CKSUMTYPE_HMAC_SHA1_DES3 + 0x000c + + ) + +460 + #CKSUMTYPE_HMAC_SHA1_96_AES128 + 0x000� + + ) + +462 + #CKSUMTYPE_HMAC_SHA1_96_AES256 + 0x0010 + + ) + +464 + #CKSUMTYPE_CMAC_CAMELLIA128 + 0x0011 + + ) + +465 + #CKSUMTYPE_CMAC_CAMELLIA256 + 0x0012 + + ) + +466 + #CKSUMTYPE_MD5_HMAC_ARCFOUR + -137 + + ) + +467 + #CKSUMTYPE_HMAC_MD5_ARCFOUR + -138 + + ) + +479 + mKRB5_C_RANDSOURCE_OLDAPI + = 0, + +480 + mKRB5_C_RANDSOURCE_OSRAND + = 1, + +481 + mKRB5_C_RANDSOURCE_TRUSTEDPARTY + = 2, + +487 + mKRB5_C_RANDSOURCE_TIMING + = 3, + +488 + mKRB5_C_RANDSOURCE_EXTERNAL_PROTOCOL + = 4, + +489 + mKRB5_C_RANDSOURCE_MAX + = 5 + +492 #i�de� +krb5_roundup + + +494 + #krb5_roundup +( +x +, +y +�((((x�+ (y�- 1)/(y))*(y)) + + ) + +500 + #krb5_x +( +�r +, +�gs +�(Ռ)?((*Ռ)�gs):( + `ab�t +(),1)) + + ) + +501 + #krb5_xc +( +�r +, +�gs +�(Ռ)?((*Ռ)�gs):( + `ab�t +(),(*)0)) + + ) + +503 + #krb5_x +( +�r +, +�gs +�((*Ռ)�gs) + + ) + +504 + #krb5_xc +( +�r +, +�gs +�((*Ռ)�gs) + + ) + +530 +krb5_�r�_code + +KRB5_CALLCONV + + +531 +krb5_c_��y� +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_keyblock + * +key +, + +532 +krb5_keyu�ge + +u�ge +, cڡ +krb5_d�a + * +c�h�_��e +, + +533 cڡ +krb5_d�a + * +�put +, +krb5_�c_d�a + * +ou�ut +); + +559 +krb5_�r�_code + +KRB5_CALLCONV + + +560 +krb5_c_de�y� +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_keyblock + * +key +, + +561 +krb5_keyu�ge + +u�ge +, cڡ +krb5_d�a + * +c�h�_��e +, + +562 cڡ +krb5_�c_d�a + * +�put +, +krb5_d�a + * +ou�ut +); + +577 +krb5_�r�_code + +KRB5_CALLCONV + + +578 +krb5_c_��y�_�ngth +( +krb5_cڋxt + +cڋxt +, +krb5_��y� + +��y� +, + +579 +size_t + +�pu�� +, size_�* +�ngth +); + +590 +krb5_�r�_code + +KRB5_CALLCONV + + +591 +krb5_c_block_size +( +krb5_cڋxt + +cڋxt +, +krb5_��y� + +��y� +, + +592 +size_t + * +blocksize +); + +604 +krb5_�r�_code + +KRB5_CALLCONV + + +605 +krb5_c_key�ngths +( +krb5_cڋxt + +cڋxt +, +krb5_��y� + +��y� +, + +606 +size_t + * +keyby�s +, size_�* +key�ngth +); + +618 +krb5_�r�_code + +KRB5_CALLCONV + + +619 +krb5_c_��_��e +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_keyblock + * +key +, + +620 +krb5_keyu�ge + +u�ge +, +krb5_d�a + * +�w_��e +); + +631 +krb5_�r�_code + +KRB5_CALLCONV + + +632 +krb5_c_�_��e +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_keyblock + * +key +, + +633 +krb5_d�a + * +��e +); + +650 +krb5_�r�_code + +KRB5_CALLCONV + + +651 +krb5_c_�f +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_keyblock + * +keyblock +, + +652 +krb5_d�a + * +�put +, krb5_d��* +ou�ut +); + +663 +krb5_�r�_code + +KRB5_CALLCONV + + +664 +krb5_c_�f_�ngth +( +krb5_cڋxt + +cڋxt +, +krb5_��y� + +��y� +, +size_t + * +�n +); + +684 +krb5_�r�_code + +KRB5_CALLCONV + + +685 +krb5_c_fx_cf2_sim�e +( +krb5_cڋxt + +cڋxt +, + +686 +krb5_keyblock + * +k1 +, cڡ * +���1 +, + +687 +krb5_keyblock + * +k2 +, cڡ * +���2 +, + +688 +krb5_keyblock + ** +out +); + +702 +krb5_�r�_code + +KRB5_CALLCONV + + +703 +krb5_c_make_�ndom_key +( +krb5_cڋxt + +cڋxt +, +krb5_��y� + +��y� +, + +704 +krb5_keyblock + * +k5_�ndom_key +); + +724 +krb5_�r�_code + +KRB5_CALLCONV + + +725 +krb5_c_�ndom_to_key +( +krb5_cڋxt + +cڋxt +, +krb5_��y� + +��y� +, + +726 +krb5_d�a + * +�ndom_d�a +, +krb5_keyblock + * +k5_�ndom_key +); + +741 +krb5_�r�_code + +KRB5_CALLCONV + + +742 +krb5_c_�ndom_add_���y +( +krb5_cڋxt + +cڋxt +, +�ndsour� +, + +743 cڡ +krb5_d�a + * +d�a +); + +757 +krb5_�r�_code + +KRB5_CALLCONV + + +758 +krb5_c_�ndom_make_o��s +( +krb5_cڋxt + +cڋxt +, +krb5_d�a + * +d�a +); + +774 +krb5_�r�_code + +KRB5_CALLCONV + + +775 +krb5_c_�ndom_os_���y +( +krb5_cڋxt + +cڋxt +, +�r�g +, * +suc�ss +); + +778 +krb5_�r�_code + +KRB5_CALLCONV + + +779 +krb5_c_�ndom_�ed +( +krb5_cڋxt + +cڋxt +, +krb5_d�a + * +d�a +); + +796 +krb5_�r�_code + +KRB5_CALLCONV + + +797 +krb5_c_�r�g_to_key +( +krb5_cڋxt + +cڋxt +, +krb5_��y� + +��y� +, + +798 cڡ +krb5_d�a + * +�r�g +, cڡ krb5_d��* +�� +, + +799 +krb5_keyblock + * +key +); + +818 +krb5_�r�_code + +KRB5_CALLCONV + + +819 +krb5_c_�r�g_to_key_w�h_��ms +( +krb5_cڋxt + +cڋxt +, + +820 +krb5_��y� + +��y� +, + +821 cڡ +krb5_d�a + * +�r�g +, + +822 cڡ +krb5_d�a + * +�� +, + +823 cڡ +krb5_d�a + * +��ms +, + +824 +krb5_keyblock + * +key +); + +839 +krb5_�r�_code + +KRB5_CALLCONV + + +840 +krb5_c_��y�_com�� +( +krb5_cڋxt + +cڋxt +, +krb5_��y� + +e1 +, krb5_��y� +e2 +, + +841 +krb5_boޗn + * +sim�� +); + +868 +krb5_�r�_code + +KRB5_CALLCONV + + +869 +krb5_c_make_checksum +( +krb5_cڋxt + +cڋxt +, +krb5_cksumty� + +cksumty� +, + +870 cڡ +krb5_keyblock + * +key +, +krb5_keyu�ge + +u�ge +, + +871 cڡ +krb5_d�a + * +�put +, +krb5_checksum + * +cksum +); + +894 +krb5_�r�_code + +KRB5_CALLCONV + + +895 +krb5_c_v�ify_checksum +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_keyblock + * +key +, + +896 +krb5_keyu�ge + +u�ge +, cڡ +krb5_d�a + * +d�a +, + +897 cڡ +krb5_checksum + * +cksum +, +krb5_boޗn + * +v�id +); + +908 +krb5_�r�_code + +KRB5_CALLCONV + + +909 +krb5_c_checksum_�ngth +( +krb5_cڋxt + +cڋxt +, +krb5_cksumty� + +cksumty� +, + +910 +size_t + * +�ngth +); + +925 +krb5_�r�_code + +KRB5_CALLCONV + + +926 +krb5_c_keyed_checksum_ty�s +( +krb5_cڋxt + +cڋxt +, +krb5_��y� + +��y� +, + +927 * +cou� +, +krb5_cksumty� + ** +cksumty�s +); + +932 + #KRB5_KEYUSAGE_AS_REQ_PA_ENC_TS + 1 + + ) + +933 + #KRB5_KEYUSAGE_KDC_REP_TICKET + 2 + + ) + +934 + #KRB5_KEYUSAGE_AS_REP_ENCPART + 3 + + ) + +935 + #KRB5_KEYUSAGE_TGS_REQ_AD_SESSKEY + 4 + + ) + +936 + #KRB5_KEYUSAGE_TGS_REQ_AD_SUBKEY + 5 + + ) + +937 + #KRB5_KEYUSAGE_TGS_REQ_AUTH_CKSUM + 6 + + ) + +938 + #KRB5_KEYUSAGE_TGS_REQ_AUTH + 7 + + ) + +939 + #KRB5_KEYUSAGE_TGS_REP_ENCPART_SESSKEY + 8 + + ) + +940 + #KRB5_KEYUSAGE_TGS_REP_ENCPART_SUBKEY + 9 + + ) + +941 + #KRB5_KEYUSAGE_AP_REQ_AUTH_CKSUM + 10 + + ) + +942 + #KRB5_KEYUSAGE_AP_REQ_AUTH + 11 + + ) + +943 + #KRB5_KEYUSAGE_AP_REP_ENCPART + 12 + + ) + +944 + #KRB5_KEYUSAGE_KRB_PRIV_ENCPART + 13 + + ) + +945 + #KRB5_KEYUSAGE_KRB_CRED_ENCPART + 14 + + ) + +946 + #KRB5_KEYUSAGE_KRB_SAFE_CKSUM + 15 + + ) + +947 + #KRB5_KEYUSAGE_APP_DATA_ENCRYPT + 16 + + ) + +948 + #KRB5_KEYUSAGE_APP_DATA_CKSUM + 17 + + ) + +949 + #KRB5_KEYUSAGE_KRB_ERROR_CKSUM + 18 + + ) + +950 + #KRB5_KEYUSAGE_AD_KDCISSUED_CKSUM + 19 + + ) + +951 + #KRB5_KEYUSAGE_AD_MTE + 20 + + ) + +952 + #KRB5_KEYUSAGE_AD_ITE + 21 + + ) + +956 + #KRB5_KEYUSAGE_GSS_TOK_MIC + 22 + + ) + +957 + #KRB5_KEYUSAGE_GSS_TOK_WRAP_INTEG + 23 + + ) + +958 + #KRB5_KEYUSAGE_GSS_TOK_WRAP_PRIV + 24 + + ) + +961 + #KRB5_KEYUSAGE_PA_SAM_CHALLENGE_CKSUM + 25 + + ) + +963 + #KRB5_KEYUSAGE_PA_SAM_CHALLENGE_TRACKID + 26 + + ) + +965 + #KRB5_KEYUSAGE_PA_SAM_RESPONSE + 27 + + ) + +969 + #KRB5_KEYUSAGE_PA_S4U_X509_USER_REQUEST + 26 + + ) + +971 + #KRB5_KEYUSAGE_PA_S4U_X509_USER_REPLY + 27 + + ) + +974 + #KRB5_KEYUSAGE_PA_REFERRAL + 26 + + ) + +976 + #KRB5_KEYUSAGE_AD_SIGNEDPATH + -21 + + ) + +977 + #KRB5_KEYUSAGE_IAKERB_FINISHED + 42 + + ) + +978 + #KRB5_KEYUSAGE_PA_PKINIT_KX + 44 + + ) + +979 + #KRB5_KEYUSAGE_PA_OTP_REQUEST + 45 + + ) + +981 + #KRB5_KEYUSAGE_FAST_REQ_CHKSUM + 50 + + ) + +982 + #KRB5_KEYUSAGE_FAST_ENC + 51 + + ) + +983 + #KRB5_KEYUSAGE_FAST_REP + 52 + + ) + +984 + #KRB5_KEYUSAGE_FAST_FINISHED + 53 + + ) + +985 + #KRB5_KEYUSAGE_ENC_CHALLENGE_CLIENT + 54 + + ) + +986 + #KRB5_KEYUSAGE_ENC_CHALLENGE_KDC + 55 + + ) + +987 + #KRB5_KEYUSAGE_AS_REQ + 56 + + ) + +997 +krb5_boޗn + +KRB5_CALLCONV + + +998 +krb5_c_v�id_��y� +( +krb5_��y� + +kty� +); + +1007 +krb5_boޗn + +KRB5_CALLCONV + + +1008 +krb5_c_v�id_cksumty� +( +krb5_cksumty� + +�y� +); + +1018 +krb5_boޗn + +KRB5_CALLCONV + + +1019 +krb5_c_is_c�l_�oof_cksum +( +krb5_cksumty� + +�y� +); + +1028 +krb5_boޗn + +KRB5_CALLCONV + + +1029 +krb5_c_is_keyed_cksum +( +krb5_cksumty� + +�y� +); + +1035 + #KRB5_CRYPTO_TYPE_EMPTY + 0 + + ) + +1036 + #KRB5_CRYPTO_TYPE_HEADER + 1 + + ) + +1037 + #KRB5_CRYPTO_TYPE_DATA + 2 + + ) + +1038 + #KRB5_CRYPTO_TYPE_SIGN_ONLY + 3 + + ) + +1039 + #KRB5_CRYPTO_TYPE_PADDING + 4 + + ) + +1040 + #KRB5_CRYPTO_TYPE_TRAILER + 5 + + ) + +1041 + #KRB5_CRYPTO_TYPE_CHECKSUM + 6 + + ) + +1042 + #KRB5_CRYPTO_TYPE_STREAM + 7 + + ) + +1068 +krb5_�r�_code + +KRB5_CALLCONV + + +1069 +krb5_c_make_checksum_iov +( +krb5_cڋxt + +cڋxt +, +krb5_cksumty� + +cksumty� +, + +1070 cڡ +krb5_keyblock + * +key +, +krb5_keyu�ge + +u�ge +, + +1071 +krb5_�y�o_iov + * +d�a +, +size_t + +num_d�a +); + +1095 +krb5_�r�_code + +KRB5_CALLCONV + + +1096 +krb5_c_v�ify_checksum_iov +( +krb5_cڋxt + +cڋxt +, +krb5_cksumty� + +cksumty� +, + +1097 cڡ +krb5_keyblock + * +key +, +krb5_keyu�ge + +u�ge +, + +1098 cڡ +krb5_�y�o_iov + * +d�a +, +size_t + +num_d�a +, + +1099 +krb5_boޗn + * +v�id +); + +1131 +krb5_�r�_code + +KRB5_CALLCONV + + +1132 +krb5_c_��y�_iov +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_keyblock + * +keyblock +, + +1133 +krb5_keyu�ge + +u�ge +, cڡ +krb5_d�a + * +c�h�_��e +, + +1134 +krb5_�y�o_iov + * +d�a +, +size_t + +num_d�a +); + +1166 +krb5_�r�_code + +KRB5_CALLCONV + + +1167 +krb5_c_de�y�_iov +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_keyblock + * +keyblock +, + +1168 +krb5_keyu�ge + +u�ge +, cڡ +krb5_d�a + * +c�h�_��e +, + +1169 +krb5_�y�o_iov + * +d�a +, +size_t + +num_d�a +); + +1181 +krb5_�r�_code + +KRB5_CALLCONV + + +1182 +krb5_c_�y�o_�ngth +( +krb5_cڋxt + +cڋxt +, +krb5_��y� + +��y� +, + +1183 +krb5_�y��y� + +ty� +, * +size +); + +1200 +krb5_�r�_code + +KRB5_CALLCONV + + +1201 +krb5_c_�y�o_�ngth_iov +( +krb5_cڋxt + +cڋxt +, +krb5_��y� + +��y� +, + +1202 +krb5_�y�o_iov + * +d�a +, +size_t + +num_d�a +); + +1217 +krb5_�r�_code + +KRB5_CALLCONV + + +1218 +krb5_c_�dd�g_�ngth +( +krb5_cڋxt + +cڋxt +, +krb5_��y� + +��y� +, + +1219 +size_t + +d�a_�ngth +, * +size +); + +1233 +krb5_�r�_code + +KRB5_CALLCONV + + +1234 +krb5_k_���_key +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_keyblock + * +key_d�a +, + +1235 +krb5_key + * +out +); + +1238 +KRB5_CALLCONV + + +1239 +krb5_k_��n�_key +( +krb5_cڋxt + +cڋxt +, +krb5_key + +key +); + +1242 +KRB5_CALLCONV + + +1243 +krb5_k_�_key +( +krb5_cڋxt + +cڋxt +, +krb5_key + +key +); + +1246 +krb5_�r�_code + +KRB5_CALLCONV + + +1247 +krb5_k_key_keyblock +( +krb5_cڋxt + +cڋxt +, +krb5_key + +key +, + +1248 +krb5_keyblock + ** +key_d�a +); + +1251 +krb5_��y� + +KRB5_CALLCONV + + +1252 +krb5_k_key_��y� +( +krb5_cڋxt + +cڋxt +, +krb5_key + +key +); + +1277 +krb5_�r�_code + +KRB5_CALLCONV + + +1278 +krb5_k_��y� +( +krb5_cڋxt + +cڋxt +, +krb5_key + +key +, +krb5_keyu�ge + +u�ge +, + +1279 cڡ +krb5_d�a + * +c�h�_��e +, cڡ krb5_d��* +�put +, + +1280 +krb5_�c_d�a + * +ou�ut +); + +1312 +krb5_�r�_code + +KRB5_CALLCONV + + +1313 +krb5_k_��y�_iov +( +krb5_cڋxt + +cڋxt +, +krb5_key + +key +, +krb5_keyu�ge + +u�ge +, + +1314 cڡ +krb5_d�a + * +c�h�_��e +, +krb5_�y�o_iov + * +d�a +, + +1315 +size_t + +num_d�a +); + +1341 +krb5_�r�_code + +KRB5_CALLCONV + + +1342 +krb5_k_de�y� +( +krb5_cڋxt + +cڋxt +, +krb5_key + +key +, +krb5_keyu�ge + +u�ge +, + +1343 cڡ +krb5_d�a + * +c�h�_��e +, cڡ +krb5_�c_d�a + * +�put +, + +1344 +krb5_d�a + * +ou�ut +); + +1376 +krb5_�r�_code + +KRB5_CALLCONV + + +1377 +krb5_k_de�y�_iov +( +krb5_cڋxt + +cڋxt +, +krb5_key + +key +, +krb5_keyu�ge + +u�ge +, + +1378 cڡ +krb5_d�a + * +c�h�_��e +, +krb5_�y�o_iov + * +d�a +, + +1379 +size_t + +num_d�a +); + +1405 +krb5_�r�_code + +KRB5_CALLCONV + + +1406 +krb5_k_make_checksum +( +krb5_cڋxt + +cڋxt +, +krb5_cksumty� + +cksumty� +, + +1407 +krb5_key + +key +, +krb5_keyu�ge + +u�ge +, cڡ +krb5_d�a + * +�put +, + +1408 +krb5_checksum + * +cksum +); + +1431 +krb5_�r�_code + +KRB5_CALLCONV + + +1432 +krb5_k_make_checksum_iov +( +krb5_cڋxt + +cڋxt +, +krb5_cksumty� + +cksumty� +, + +1433 +krb5_key + +key +, +krb5_keyu�ge + +u�ge +, + +1434 +krb5_�y�o_iov + * +d�a +, +size_t + +num_d�a +); + +1457 +krb5_�r�_code + +KRB5_CALLCONV + + +1458 +krb5_k_v�ify_checksum +( +krb5_cڋxt + +cڋxt +, +krb5_key + +key +, +krb5_keyu�ge + +u�ge +, + +1459 cڡ +krb5_d�a + * +d�a +, cڡ +krb5_checksum + * +cksum +, + +1460 +krb5_boޗn + * +v�id +); + +1484 +krb5_�r�_code + +KRB5_CALLCONV + + +1485 +krb5_k_v�ify_checksum_iov +( +krb5_cڋxt + +cڋxt +, +krb5_cksumty� + +cksumty� +, + +1486 +krb5_key + +key +, +krb5_keyu�ge + +u�ge +, + +1487 cڡ +krb5_�y�o_iov + * +d�a +, +size_t + +num_d�a +, + +1488 +krb5_boޗn + * +v�id +); + +1508 +krb5_�r�_code + +KRB5_CALLCONV + + +1509 +krb5_k_�f +( +krb5_cڋxt + +cڋxt +, +krb5_key + +key +, +krb5_d�a + * +�put +, krb5_d��* +ou�ut +); + +1511 #ifde� +KRB5_OLD_CRYPTO + + +1517 +krb5_�r�_code + +KRB5_CALLCONV + + +1518 +krb5_��y� +( +krb5_cڋxt + +cڋxt +, +krb5_cڡ_po��r + +��r +, + +1519 +krb5_po��r + +ou�� +, +size_t + +size +, +krb5_��y�_block + * +eblock +, + +1520 +krb5_po��r + +ivec +); + +1523 +krb5_�r�_code + +KRB5_CALLCONV + + +1524 +krb5_de�y� +( +krb5_cڋxt + +cڋxt +, +krb5_cڡ_po��r + +��r +, + +1525 +krb5_po��r + +ou�� +, +size_t + +size +, +krb5_��y�_block + * +eblock +, + +1526 +krb5_po��r + +ivec +); + +1529 +krb5_�r�_code + +KRB5_CALLCONV + + +1530 +krb5_�o�ss_key +( +krb5_cڋxt + +cڋxt +, +krb5_��y�_block + * +eblock +, + +1531 cڡ +krb5_keyblock + * +key +); + +1534 +krb5_�r�_code + +KRB5_CALLCONV + + +1535 +krb5_f�ish_key +( +krb5_cڋxt + +cڋxt +, +krb5_��y�_block + * +eblock +); + +1538 +krb5_�r�_code + +KRB5_CALLCONV + + +1539 +krb5_�r�g_to_key +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_��y�_block + * +eblock +, + +1540 +krb5_keyblock + * +keyblock +, cڡ +krb5_d�a + * +d�a +, + +1541 cڡ +krb5_d�a + * +�� +); + +1544 +krb5_�r�_code + +KRB5_CALLCONV + + +1545 +krb5_��_�ndom_key +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_��y�_block + * +eblock +, + +1546 cڡ +krb5_keyblock + * +keyblock +, +krb5_po��r + * +�r +); + +1549 +krb5_�r�_code + +KRB5_CALLCONV + + +1550 +krb5_f�ish_�ndom_key +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_��y�_block + * +eblock +, + +1551 +krb5_po��r + * +�r +); + +1554 +krb5_�r�_code + +KRB5_CALLCONV + + +1555 +krb5_�ndom_key +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_��y�_block + * +eblock +, + +1556 +krb5_po��r + +�r +, +krb5_keyblock + ** +keyblock +); + +1559 +krb5_��y� + +KRB5_CALLCONV + + +1560 +krb5_eblock_��y� +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_��y�_block + * +eblock +); + +1563 +krb5_�r�_code + +KRB5_CALLCONV + + +1564 +krb5_u�_��y� +( +krb5_cڋxt + +cڋxt +, +krb5_��y�_block + * +eblock +, + +1565 +krb5_��y� + +��y� +); + +1568 +size_t + +KRB5_CALLCONV + + +1569 +krb5_��y�_size +( +size_t + +�ngth +, +krb5_��y� + +�y�o +); + +1572 +size_t + +KRB5_CALLCONV + + +1573 +krb5_checksum_size +( +krb5_cڋxt + +cڋxt +, +krb5_cksumty� + +�y� +); + +1576 +krb5_�r�_code + +KRB5_CALLCONV + + +1577 +krb5_�lcuϋ_checksum +( +krb5_cڋxt + +cڋxt +, +krb5_cksumty� + +�y� +, + +1578 +krb5_cڡ_po��r + +� +, +size_t + +�_�ngth +, + +1579 +krb5_cڡ_po��r + +�ed +, +size_t + +�ed_�ngth +, + +1580 +krb5_checksum + * +outcksum +); + +1583 +krb5_�r�_code + +KRB5_CALLCONV + + +1584 +krb5_v�ify_checksum +( +krb5_cڋxt + +cڋxt +, +krb5_cksumty� + +�y� +, + +1585 cڡ +krb5_checksum + * +cksum +, +krb5_cڡ_po��r + +� +, + +1586 +size_t + +�_�ngth +, +krb5_cڡ_po��r + +�ed +, + +1587 +size_t + +�ed_�ngth +); + +1603 + #KDC_OPT_FORWARDABLE + 0x40000000 + + ) + +1604 + #KDC_OPT_FORWARDED + 0x20000000 + + ) + +1605 + #KDC_OPT_PROXIABLE + 0x10000000 + + ) + +1606 + #KDC_OPT_PROXY + 0x08000000 + + ) + +1607 + #KDC_OPT_ALLOW_POSTDATE + 0x04000000 + + ) + +1608 + #KDC_OPT_POSTDATED + 0x02000000 + + ) + +1610 + #KDC_OPT_RENEWABLE + 0x00800000 + + ) + +1616 + #KDC_OPT_CNAME_IN_ADDL_TKT + 0x00020000 + + ) + +1617 + #KDC_OPT_CANONICALIZE + 0x00010000 + + ) + +1618 + #KDC_OPT_REQUEST_ANONYMOUS + 0x00008000 + + ) + +1628 + #KDC_OPT_DISABLE_TRANSITED_CHECK + 0x00000020 + + ) + +1629 + #KDC_OPT_RENEWABLE_OK + 0x00000010 + + ) + +1630 + #KDC_OPT_ENC_TKT_IN_SKEY + 0x00000008 + + ) + +1632 + #KDC_OPT_RENEW + 0x00000002 + + ) + +1633 + #KDC_OPT_VALIDATE + 0x00000001 + + ) + +1642 + #KDC_TKT_COMMON_MASK + 0x54800000 + + ) + +1652 + #AP_OPTS_RESERVED + 0x80000000 + + ) + +1653 + #AP_OPTS_USE_SESSION_KEY + 0x40000000 + + ) + +1654 + #AP_OPTS_MUTUAL_REQUIRED + 0x20000000 + + ) + +1656 + #AP_OPTS_ETYPE_NEGOTIATION + 0x00000002 + + ) + +1657 + #AP_OPTS_USE_SUBKEY + 0x00000001 + + ) + +1690 + #AP_OPTS_WIRE_MASK + 0xfffffff0 + + ) + +1694 + #AD_TYPE_RESERVED + 0x8000 + + ) + +1695 + #AD_TYPE_EXTERNAL + 0x4000 + + ) + +1696 + #AD_TYPE_REGISTERED + 0x2000 + + ) + +1698 + #AD_TYPE_FIELD_TYPE_MASK + 0x1fff + + ) + +1704 + #TKT_FLG_FORWARDABLE + 0x40000000 + + ) + +1705 + #TKT_FLG_FORWARDED + 0x20000000 + + ) + +1706 + #TKT_FLG_PROXIABLE + 0x10000000 + + ) + +1707 + #TKT_FLG_PROXY + 0x08000000 + + ) + +1708 + #TKT_FLG_MAY_POSTDATE + 0x04000000 + + ) + +1709 + #TKT_FLG_POSTDATED + 0x02000000 + + ) + +1710 + #TKT_FLG_INVALID + 0x01000000 + + ) + +1711 + #TKT_FLG_RENEWABLE + 0x00800000 + + ) + +1712 + #TKT_FLG_INITIAL + 0x00400000 + + ) + +1713 + #TKT_FLG_PRE_AUTH + 0x00200000 + + ) + +1714 + #TKT_FLG_HW_AUTH + 0x00100000 + + ) + +1715 + #TKT_FLG_TRANSIT_POLICY_CHECKED + 0x00080000 + + ) + +1716 + #TKT_FLG_OK_AS_DELEGATE + 0x00040000 + + ) + +1717 + #TKT_FLG_ENC_PA_REP + 0x00010000 + + ) + +1718 + #TKT_FLG_ANONYMOUS + 0x00008000 + + ) + +1736 + #LR_TYPE_THIS_SERVER_ONLY + 0x8000 + + ) + +1738 + #LR_TYPE_INTERPRETATION_MASK + 0x7fff + + ) + +1741 + #MSEC_DIRBIT + 0x8000 + + ) + +1742 + #MSEC_VAL_MASK + 0x7fff + + ) + +1753 + #KRB5_PVNO + 5 + + ) + +1757 + #KRB5_AS_REQ + (( +krb5_msgty� +)10� + + ) + +1758 + #KRB5_AS_REP + (( +krb5_msgty� +)11� + + ) + +1759 + #KRB5_TGS_REQ + (( +krb5_msgty� +)12� + + ) + +1760 + #KRB5_TGS_REP + (( +krb5_msgty� +)13� + + ) + +1761 + #KRB5_AP_REQ + (( +krb5_msgty� +)14� + + ) + +1762 + #KRB5_AP_REP + (( +krb5_msgty� +)15� + + ) + +1763 + #KRB5_SAFE + (( +krb5_msgty� +)20� + + ) + +1764 + #KRB5_PRIV + (( +krb5_msgty� +)21� + + ) + +1765 + #KRB5_CRED + (( +krb5_msgty� +)22� + + ) + +1766 + #KRB5_ERROR + (( +krb5_msgty� +)30� + + ) + +1769 + #KRB5_LRQ_NONE + 0 + + ) + +1770 + #KRB5_LRQ_ALL_LAST_TGT + 1 + + ) + +1771 + #KRB5_LRQ_ONE_LAST_TGT + (-1) + + ) + +1772 + #KRB5_LRQ_ALL_LAST_INITIAL + 2 + + ) + +1773 + #KRB5_LRQ_ONE_LAST_INITIAL + (-2) + + ) + +1774 + #KRB5_LRQ_ALL_LAST_TGT_ISSUED + 3 + + ) + +1775 + #KRB5_LRQ_ONE_LAST_TGT_ISSUED + (-3) + + ) + +1776 + #KRB5_LRQ_ALL_LAST_RENEWAL + 4 + + ) + +1777 + #KRB5_LRQ_ONE_LAST_RENEWAL + (-4) + + ) + +1778 + #KRB5_LRQ_ALL_LAST_REQ + 5 + + ) + +1779 + #KRB5_LRQ_ONE_LAST_REQ + (-5) + + ) + +1780 + #KRB5_LRQ_ALL_PW_EXPTIME + 6 + + ) + +1781 + #KRB5_LRQ_ONE_PW_EXPTIME + (-6) + + ) + +1782 + #KRB5_LRQ_ALL_ACCT_EXPTIME + 7 + + ) + +1783 + #KRB5_LRQ_ONE_ACCT_EXPTIME + (-7) + + ) + +1786 + #KRB5_PADATA_NONE + 0 + + ) + +1787 + #KRB5_PADATA_AP_REQ + 1 + + ) + +1788 + #KRB5_PADATA_TGS_REQ + +KRB5_PADATA_AP_REQ + + + ) + +1789 + #KRB5_PADATA_ENC_TIMESTAMP + 2 + + ) + +1790 + #KRB5_PADATA_PW_SALT + 3 + + ) + +1792 + #KRB5_PADATA_ENC_ENCKEY + 4 + + ) + +1794 + #KRB5_PADATA_ENC_UNIX_TIME + 5 + + ) + +1795 + #KRB5_PADATA_ENC_SANDIA_SECURID + 6 + + ) + +1796 + #KRB5_PADATA_SESAME + 7 + + ) + +1797 + #KRB5_PADATA_OSF_DCE + 8 + + ) + +1798 + #KRB5_CYBERSAFE_SECUREID + 9 + + ) + +1799 + #KRB5_PADATA_AFS3_SALT + 10 + + ) + +1800 + #KRB5_PADATA_ETYPE_INFO + 11 + + ) + +1801 + #KRB5_PADATA_SAM_CHALLENGE + 12 + + ) + +1802 + #KRB5_PADATA_SAM_RESPONSE + 13 + + ) + +1803 + #KRB5_PADATA_PK_AS_REQ_OLD + 14 + + ) + +1804 + #KRB5_PADATA_PK_AS_REP_OLD + 15 + + ) + +1805 + #KRB5_PADATA_PK_AS_REQ + 16 + + ) + +1806 + #KRB5_PADATA_PK_AS_REP + 17 + + ) + +1807 + #KRB5_PADATA_ETYPE_INFO2 + 19 + + ) + +1808 + #KRB5_PADATA_USE_SPECIFIED_KVNO + 20 + + ) + +1809 + #KRB5_PADATA_SVR_REFERRAL_INFO + 20 + + ) + +1810 + #KRB5_PADATA_SAM_REDIRECT + 21 + + ) + +1811 + #KRB5_PADATA_GET_FROM_TYPED_DATA + 22 + + ) + +1812 + #KRB5_PADATA_REFERRAL + 25 + + ) + +1813 + #KRB5_PADATA_SAM_CHALLENGE_2 + 30 + + ) + +1814 + #KRB5_PADATA_SAM_RESPONSE_2 + 31 + + ) + +1816 + #KRB5_PADATA_PAC_REQUEST + 128 + + ) + +1817 + #KRB5_PADATA_FOR_USER + 129 + + ) + +1818 + #KRB5_PADATA_S4U_X509_USER + 130 + + ) + +1819 + #KRB5_PADATA_AS_CHECKSUM + 132 + + ) + +1820 + #KRB5_PADATA_FX_COOKIE + 133 + + ) + +1821 + #KRB5_PADATA_FX_FAST + 136 + + ) + +1822 + #KRB5_PADATA_FX_ERROR + 137 + + ) + +1823 + #KRB5_PADATA_ENCRYPTED_CHALLENGE + 138 + + ) + +1824 + #KRB5_PADATA_OTP_CHALLENGE + 141 + + ) + +1825 + #KRB5_PADATA_OTP_REQUEST + 142 + + ) + +1826 + #KRB5_PADATA_OTP_PIN_CHANGE + 144 + + ) + +1827 + #KRB5_PADATA_PKINIT_KX + 147 + + ) + +1828 + #KRB5_ENCPADATA_REQ_ENC_PA_REP + 149 + + ) + +1830 + #KRB5_SAM_USE_SAD_AS_KEY + 0x80000000 + + ) + +1831 + #KRB5_SAM_SEND_ENCRYPTED_SAD + 0x40000000 + + ) + +1832 + #KRB5_SAM_MUST_PK_ENCRYPT_SAD + 0x20000000 + + ) + +1835 + #KRB5_DOMAIN_X500_COMPRESS + 1 + + ) + +1838 + #KRB5_ALTAUTH_ATT_CHALLENGE_RESPONSE + 64 + + ) + +1845 + #KRB5_AUTHDATA_IF_RELEVANT + 1 + + ) + +1846 + #KRB5_AUTHDATA_KDC_ISSUED + 4 + + ) + +1847 + #KRB5_AUTHDATA_AND_OR + 5 + + ) + +1848 + #KRB5_AUTHDATA_MANDATORY_FOR_KDC + 8 + + ) + +1849 + #KRB5_AUTHDATA_INITIAL_VERIFIED_CAS + 9 + + ) + +1850 + #KRB5_AUTHDATA_OSF_DCE + 64 + + ) + +1851 + #KRB5_AUTHDATA_SESAME + 65 + + ) + +1852 + #KRB5_AUTHDATA_WIN2K_PAC + 128 + + ) + +1853 + #KRB5_AUTHDATA_ETYPE_NEGOTIATION + 129 + + ) + +1854 + #KRB5_AUTHDATA_SIGNTICKET + 512 + + ) + +1855 + #KRB5_AUTHDATA_FX_ARMOR + 71 + + ) + +1859 + #KRB5_KPASSWD_SUCCESS + 0 + + ) + +1860 + #KRB5_KPASSWD_MALFORMED + 1 + + ) + +1861 + #KRB5_KPASSWD_HARDERROR + 2 + + ) + +1862 + #KRB5_KPASSWD_AUTHERROR + 3 + + ) + +1863 + #KRB5_KPASSWD_SOFTERROR + 4 + + ) + +1866 + #KRB5_KPASSWD_ACCESSDENIED + 5 + + ) + +1867 + #KRB5_KPASSWD_BAD_VERSION + 6 + + ) + +1869 + #KRB5_KPASSWD_INITIAL_FLAG_NEEDED + 7 + + ) + +1877 + s_krb5_tick�_times + { + +1878 +krb5_time�amp + + mauthtime +; + +1881 +krb5_time�amp + + m���ime +; + +1882 +krb5_time�amp + + m�dtime +; + +1883 +krb5_time�amp + + m��w_t�l +; + +1884 } + tkrb5_tick�_times +; + +1887 + s_krb5_authd�a + { + +1888 +krb5_magic + + mmagic +; + +1889 +krb5_authd��y� + + mad_ty� +; + +1890 + m�ngth +; + +1891 +krb5_o�� + * + mcڋ�s +; + +1892 } + tkrb5_authd�a +; + +1895 + s_krb5_��s�ed + { + +1896 +krb5_magic + + mmagic +; + +1897 +krb5_o�� + + m�_ty� +; + +1898 +krb5_d�a + + m�_cڋ�s +; + +1899 } + tkrb5_��s�ed +; + +1902 + s_krb5_�c_tkt_�� + { + +1903 +krb5_magic + + mmagic +; + +1905 +krb5_�ags + + m�ags +; + +1906 +krb5_keyblock + * + m�ssi� +; + +1907 +krb5_��c�� + + m��� +; + +1908 +krb5_��s�ed + + m��s�ed +; + +1909 +krb5_tick�_times + + mtimes +; + +1910 +krb5_add�ss + ** + m�ddrs +; + +1911 +krb5_authd�a + ** + mauth�iz�i�_d�a +; + +1912 } + tkrb5_�c_tkt_�� +; + +1920 + s_krb5_tick� + { + +1921 +krb5_magic + + mmagic +; + +1923 +krb5_��c�� + + m�rv� +; + +1924 +krb5_�c_d�a + + m�c_�� +; + +1925 +krb5_�c_tkt_�� + * + m�c_��2 +; + +1926 } + tkrb5_tick� +; + +1934 + s_krb5_auth�ti�t� + { + +1935 +krb5_magic + + mmagic +; + +1936 +krb5_��c�� + + m��� +; + +1937 +krb5_checksum + * + mchecksum +; + +1938 +krb5_�t32 + + mcu�c +; + +1939 +krb5_time�amp + + m�ime +; + +1940 +krb5_keyblock + * + msubkey +; + +1941 +krb5_ui_4 + + m�q_numb� +; + +1942 +krb5_authd�a + ** + mauth�iz�i�_d�a +; + +1943 } + tkrb5_auth�ti�t� +; + +1946 + s_krb5_tkt_auth�t + { + +1947 +krb5_magic + + mmagic +; + +1948 +krb5_tick� + * + mtick� +; + +1949 +krb5_auth�ti�t� + * + mauth�ti�t� +; + +1950 +krb5_�ags + + m�_�ti�s +; + +1951 } + tkrb5_tkt_auth�t +; + +1954 + s_krb5_�eds + { + +1955 +krb5_magic + + mmagic +; + +1956 +krb5_��c�� + + m��� +; + +1957 +krb5_��c�� + + m�rv� +; + +1958 +krb5_keyblock + + mkeyblock +; + +1959 +krb5_tick�_times + + mtimes +; + +1960 +krb5_boޗn + + mis_skey +; + +1962 +krb5_�ags + + mtick�_�ags +; + +1963 +krb5_add�ss + ** + madd�s�s +; + +1964 +krb5_d�a + + mtick� +; + +1965 +krb5_d�a + + m�c�d_tick� +; + +1968 +krb5_authd�a + ** + mauthd�a +; + +1969 } + tkrb5_�eds +; + +1972 + s_krb5_ϡ_�q_��y + { + +1973 +krb5_magic + + mmagic +; + +1974 +krb5_�t32 + + m�_ty� +; + +1975 +krb5_time�amp + + mv�ue +; + +1976 } + tkrb5_ϡ_�q_��y +; + +1979 + s_krb5_�_d�a + { + +1980 +krb5_magic + + mmagic +; + +1981 +krb5_��uthty� + + m�_ty� +; + +1982 + m�ngth +; + +1983 +krb5_o�� + * + mcڋ�s +; + +1984 } + tkrb5_�_d�a +; + +1987 + s_krb5_ty�d_d�a + { + +1988 +krb5_magic + + mmagic +; + +1989 +krb5_�t32 + + mty� +; + +1990 + m�ngth +; + +1991 +krb5_o�� + * + md�a +; + +1992 } + tkrb5_ty�d_d�a +; + +1995 + s_krb5_kdc_�q + { + +1996 +krb5_magic + + mmagic +; + +1997 +krb5_msgty� + + mmsg_ty� +; + +1998 +krb5_�_d�a + ** + m�d�a +; + +2000 +krb5_�ags + + mkdc_�ti�s +; + +2001 +krb5_��c�� + + m��� +; + +2002 +krb5_��c�� + + m�rv� +; + +2003 +krb5_time�amp + + m�om +; + +2004 +krb5_time�amp + + mt�l +; + +2005 +krb5_time�amp + + m�ime +; + +2006 +krb5_�t32 + + mn�� +; + +2007 + mnkty�s +; + +2008 +krb5_��y� + * + mkty� +; + +2009 +krb5_add�ss + ** + madd�s�s +; + +2010 +krb5_�c_d�a + + mauth�iz�i�_d�a +; + +2011 +krb5_authd�a + ** + mu�nc_authd�a +; + +2012 +krb5_tick� + ** + m�c�d_tick� +; + +2013 } + tkrb5_kdc_�q +; + +2020 + s_krb5_�c_kdc_�p_�� + { + +2021 +krb5_magic + + mmagic +; + +2023 +krb5_msgty� + + mmsg_ty� +; + +2024 +krb5_keyblock + * + m�ssi� +; + +2025 +krb5_ϡ_�q_��y + ** + mϡ_�q +; + +2026 +krb5_�t32 + + mn�� +; + +2027 +krb5_time�amp + + mkey_exp +; + +2028 +krb5_�ags + + m�ags +; + +2029 +krb5_tick�_times + + mtimes +; + +2030 +krb5_��c�� + + m�rv� +; + +2031 +krb5_add�ss + ** + m�ddrs +; + +2032 +krb5_�_d�a + ** + m�c_�d�a +; + +2033 } + tkrb5_�c_kdc_�p_�� +; + +2036 + s_krb5_kdc_�p + { + +2037 +krb5_magic + + mmagic +; + +2039 +krb5_msgty� + + mmsg_ty� +; + +2040 +krb5_�_d�a + ** + m�d�a +; + +2041 +krb5_��c�� + + m��� +; + +2042 +krb5_tick� + * + mtick� +; + +2043 +krb5_�c_d�a + + m�c_�� +; + +2044 +krb5_�c_kdc_�p_�� + * + m�c_��2 +; + +2045 } + tkrb5_kdc_�p +; + +2048 + s_krb5_�r� + { + +2049 +krb5_magic + + mmagic +; + +2051 +krb5_time�amp + + m�ime +; + +2052 +krb5_�t32 + + mcu�c +; + +2053 +krb5_�t32 + + msu�c +; + +2054 +krb5_time�amp + + m�ime +; + +2055 +krb5_ui_4 + + m�r� +; + +2056 +krb5_��c�� + + m��� +; + +2057 +krb5_��c�� + + m�rv� +; + +2058 +krb5_d�a + + m�xt +; + +2059 +krb5_d�a + + me_d�a +; + +2060 } + tkrb5_�r� +; + +2063 + s_krb5_�_�q + { + +2064 +krb5_magic + + mmagic +; + +2065 +krb5_�ags + + m�_�ti�s +; + +2066 +krb5_tick� + * + mtick� +; + +2067 +krb5_�c_d�a + + mauth�ti�t� +; + +2068 } + tkrb5_�_�q +; + +2075 + s_krb5_�_�p + { + +2076 +krb5_magic + + mmagic +; + +2077 +krb5_�c_d�a + + m�c_�� +; + +2078 } + tkrb5_�_�p +; + +2081 + s_krb5_�_�p_�c_�� + { + +2082 +krb5_magic + + mmagic +; + +2083 +krb5_time�amp + + m�ime +; + +2084 +krb5_�t32 + + mcu�c +; + +2085 +krb5_keyblock + * + msubkey +; + +2086 +krb5_ui_4 + + m�q_numb� +; + +2087 } + tkrb5_�_�p_�c_�� +; + +2090 + s_krb5_��ڣ + { + +2091 +krb5_magic + + mmagic +; + +2092 +krb5_o�� + + mmes�ge_ty� +; + +2093 +krb5_d�a + + m��ڣ +; + +2094 +krb5_�t32 + + mex��ed_n�� +; + +2095 +krb5_time�amp + + m�que�_time +; + +2096 } + tkrb5_��ڣ +; + +2099 + s_krb5_�ed_�fo + { + +2100 +krb5_magic + + mmagic +; + +2101 +krb5_keyblock + * + m�ssi� +; + +2102 +krb5_��c�� + + m��� +; + +2103 +krb5_��c�� + + m�rv� +; + +2104 +krb5_�ags + + m�ags +; + +2105 +krb5_tick�_times + + mtimes +; + +2106 +krb5_add�ss + ** + m�ddrs +; + +2107 } + tkrb5_�ed_�fo +; + +2110 + s_krb5_�ed_�c_�� + { + +2111 +krb5_magic + + mmagic +; + +2112 +krb5_�t32 + + mn�� +; + +2113 +krb5_time�amp + + mtime�amp +; + +2114 +krb5_�t32 + + mu�c +; + +2115 +krb5_add�ss + * + ms_add�ss +; + +2116 +krb5_add�ss + * + mr_add�ss +; + +2117 +krb5_�ed_�fo + ** + mtick�_�fo +; + +2118 } + tkrb5_�ed_�c_�� +; + +2121 + s_krb5_�ed + { + +2122 +krb5_magic + + mmagic +; + +2123 +krb5_tick� + ** + mtick�s +; + +2124 +krb5_�c_d�a + + m�c_�� +; + +2125 +krb5_�ed_�c_�� + * + m�c_��2 +; + +2126 } + tkrb5_�ed +; + +2129 + s_�sswd_ph��_�em�t + { + +2130 +krb5_magic + + mmagic +; + +2131 +krb5_d�a + * + m�sswd +; + +2132 +krb5_d�a + * + mph�� +; + +2133 } + t�sswd_ph��_�em�t +; + +2136 + s_krb5_pwd_d�a + { + +2137 +krb5_magic + + mmagic +; + +2138 + m�qu��_cou� +; + +2139 +�sswd_ph��_�em�t + ** + m�em�t +; + +2140 } + tkrb5_pwd_d�a +; + +2143 + s_krb5_�_svr_�㼮_d�a + { + +2145 +krb5_��c�� + + m��c�� +; + +2146 } + tkrb5_�_svr_�㼮_d�a +; + +2149 + s_krb5_�_�rv�_�㼮_d�a + { + +2150 +krb5_d�a + * + m��ed_��m +; + +2151 +krb5_��c�� + + m�ue_��c��_�me +; + +2152 +krb5_��c�� + + m�que�ed_��c��_�me +; + +2153 +krb5_time�amp + + m�㼮_v�id_u�� +; + +2154 +krb5_checksum + + m�p_cksum +; + +2155 } + tkrb5_�_�rv�_�㼮_d�a +; + +2157 + s_krb5_�_�c_�q + { + +2159 +krb5_boޗn + + m��ude_�c +; + +2160 } + tkrb5_�_�c_�q +; + +2170 + #KRB5_AUTH_CONTEXT_DO_TIME + 0x00000001 + + ) + +2172 + #KRB5_AUTH_CONTEXT_RET_TIME + 0x00000002 + + ) + +2174 + #KRB5_AUTH_CONTEXT_DO_SEQUENCE + 0x00000004 + + ) + +2176 + #KRB5_AUTH_CONTEXT_RET_SEQUENCE + 0x00000008 + + ) + +2177 + #KRB5_AUTH_CONTEXT_PERMIT_ALL + 0x00000010 + + ) + +2178 + #KRB5_AUTH_CONTEXT_USE_SUBKEY + 0x00000020 + + ) + +2187 + skrb5_��ay_d�a + { + +2188 +krb5_time�amp + + mtime�amp +; + +2189 +krb5_�t32 + + mu�c +; + +2190 +krb5_ui_4 + + m�q +; + +2191 } + tkrb5_��ay_d�a +; + +2196 + #KRB5_AUTH_CONTEXT_GENERATE_LOCAL_ADDR + 0x00000001 + + ) + +2198 + #KRB5_AUTH_CONTEXT_GENERATE_REMOTE_ADDR + 0x00000002 + + ) + +2200 + #KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR + 0x00000004 + + ) + +2202 + #KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR + 0x00000008 + + ) + +2205 + gkrb5_�r�_code + + +2206 ( + tKRB5_CALLCONV + * + tkrb5_mk_�q_checksum_func +)( + tkrb5_cڋxt +, + tkrb5_auth_cڋxt +, + +2207 *, + tkrb5_d�a + **); + +2219 +krb5_po��r + + tkrb5_cc_curs� +; + +2221 + g_krb5_c�che +; + +2222 +_krb5_c�che + * + tkrb5_c�che +; + +2223 + g_krb5_cc_�s +; + +2224 +_krb5_cc_�s + + tkrb5_cc_�s +; + +2226 + g_krb5_ccc�_curs� +; + +2228 +_krb5_ccc�_curs� + * + tkrb5_ccc�_curs� +; + +2232 + #KRB5_TC_MATCH_TIMES + 0x00000001 + + ) + +2234 + #KRB5_TC_MATCH_IS_SKEY + 0x00000002 + + ) + +2236 + #KRB5_TC_MATCH_FLAGS + 0x00000004 + + ) + +2238 + #KRB5_TC_MATCH_TIMES_EXACT + 0x00000008 + + ) + +2240 + #KRB5_TC_MATCH_FLAGS_EXACT + 0x00000010 + + ) + +2242 + #KRB5_TC_MATCH_AUTHDATA + 0x00000020 + + ) + +2244 + #KRB5_TC_MATCH_SRV_NAMEONLY + 0x00000040 + + ) + +2246 + #KRB5_TC_MATCH_2ND_TKT + 0x00000080 + + ) + +2248 + #KRB5_TC_MATCH_KTYPE + 0x00000100 + + ) + +2250 + #KRB5_TC_SUPPORTED_KTYPES + 0x00000200 + + ) + +2254 + #KRB5_TC_OPENCLOSE + 0x00000001 + + ) + +2255 + #KRB5_TC_NOTICKET + 0x00000002 + + ) + +2271 cڡ * +KRB5_CALLCONV + + +2272 +krb5_cc_g�_�me +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +�che +); + +2285 +krb5_�r�_code + +KRB5_CALLCONV + + +2286 +krb5_cc_g�_fu�_�me +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +�che +, + +2287 ** +fu��me_out +); + +2289 #i� +KRB5_DEPRECATED + + +2290 +krb5_�r�_code + +KRB5_CALLCONV + + +2291 +krb5_cc_g�_�w +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + * +�che +); + +2309 +krb5_�r�_code + +KRB5_CALLCONV + + +2310 +krb5_cc_���lize +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +�che +, + +2311 +krb5_��c�� + +��c�� +); + +2327 +krb5_�r�_code + +KRB5_CALLCONV + + +2328 +krb5_cc_de�roy +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +�che +); + +2344 +krb5_�r�_code + +KRB5_CALLCONV + + +2345 +krb5_cc_�o� +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +�che +); + +2362 +krb5_�r�_code + +KRB5_CALLCONV + + +2363 +krb5_cc_��e_�ed +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +�che +, +krb5_�eds + * +�eds +); + +2398 +krb5_�r�_code + +KRB5_CALLCONV + + +2399 +krb5_cc_���ve_�ed +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +�che +, + +2400 +krb5_�ags + +�ags +, +krb5_�eds + * +m�eds +, + +2401 +krb5_�eds + * +�eds +); + +2420 +krb5_�r�_code + +KRB5_CALLCONV + + +2421 +krb5_cc_g�_��c�� +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +�che +, + +2422 +krb5_��c�� + * +��c�� +); + +2438 +krb5_�r�_code + +KRB5_CALLCONV + + +2439 +krb5_cc_��t_�q_g� +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +�che +, + +2440 +krb5_cc_curs� + * +curs� +); + +2459 +krb5_�r�_code + +KRB5_CALLCONV + + +2460 +krb5_cc_�xt_�ed +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +�che +, + +2461 +krb5_cc_curs� + * +curs� +, +krb5_�eds + * +�eds +); + +2477 +krb5_�r�_code + +KRB5_CALLCONV + + +2478 +krb5_cc_�d_�q_g� +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +�che +, + +2479 +krb5_cc_curs� + * +curs� +); + +2496 +krb5_�r�_code + +KRB5_CALLCONV + + +2497 +krb5_cc_�move_�ed +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +�che +, +krb5_�ags + +�ags +, + +2498 +krb5_�eds + * +�eds +); + +2511 +krb5_�r�_code + +KRB5_CALLCONV + + +2512 +krb5_cc_�t_�ags +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +�che +, +krb5_�ags + +�ags +); + +2525 +krb5_�r�_code + +KRB5_CALLCONV + + +2526 +krb5_cc_g�_�ags +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +�che +, +krb5_�ags + * +�ags +); + +2537 cڡ * +KRB5_CALLCONV + + +2538 +krb5_cc_g�_ty� +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +�che +); + +2555 +krb5_�r�_code + +KRB5_CALLCONV + + +2556 +krb5_cc_move +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +�c +, krb5_c�ch� +d� +); + +2567 +krb5_�r�_code + +KRB5_CALLCONV + + +2568 +krb5_cc_ϡ_ch�ge_time +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +c�che +, + +2569 +krb5_time�amp + * +ch�ge_time +); + +2581 +krb5_�r�_code + +KRB5_CALLCONV + + +2582 +krb5_cc_lock +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +c�che +); + +2594 +krb5_�r�_code + +KRB5_CALLCONV + + +2595 +krb5_cc_u�ock +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +c�che +); + +2613 +krb5_�r�_code + +KRB5_CALLCONV + + +2614 +krb5_ccc�_curs�_�w +( +krb5_cڋxt + +cڋxt +, +krb5_ccc�_curs� + * +curs� +); + +2632 +krb5_�r�_code + +KRB5_CALLCONV + + +2633 +krb5_ccc�_curs�_�xt +( +krb5_cڋxt + +cڋxt +, +krb5_ccc�_curs� + +curs� +, + +2634 +krb5_c�che + * +c�che +); + +2646 +krb5_�r�_code + +KRB5_CALLCONV + + +2647 +krb5_ccc�_curs�_� +( +krb5_cڋxt + +cڋxt +, +krb5_ccc�_curs� + * +curs� +); + +2659 +krb5_�r�_code + +KRB5_CALLCONV + + +2660 +krb5_ccc�_have_cڋ� +( +krb5_cڋxt + +cڋxt +); + +2676 +krb5_�r�_code + +KRB5_CALLCONV + + +2677 +krb5_ccc�_ϡ_ch�ge_time +( +krb5_cڋxt + +cڋxt +, +krb5_time�amp + * +ch�ge_time +); + +2693 +krb5_�r�_code + +KRB5_CALLCONV + + +2694 +krb5_ccc�_lock +( +krb5_cڋxt + +cڋxt +); + +2705 +krb5_�r�_code + +KRB5_CALLCONV + + +2706 +krb5_ccc�_u�ock +( +krb5_cڋxt + +cڋxt +); + +2721 +krb5_�r�_code + +KRB5_CALLCONV + + +2722 +krb5_cc_�w_unique +( +krb5_cڋxt + +cڋxt +, cڡ * +ty� +, cڡ * +h�t +, + +2723 +krb5_c�che + * +id +); + +2733 + gkrb5_rc_� +; + +2734 +krb5_rc_� + * + tkrb5_r�che +; + +2746 + #MAX_KEYTAB_NAME_LEN + 1100 + + ) + +2748 +krb5_po��r + + tkrb5_kt_curs� +; + +2751 + skrb5_key�b_��y_� + { + +2752 +krb5_magic + + mmagic +; + +2753 +krb5_��c�� + + m��c�� +; + +2754 +krb5_time�amp + + mtime�amp +; + +2755 +krb5_kvno + + mvno +; + +2756 +krb5_keyblock + + mkey +; + +2757 } + tkrb5_key�b_��y +; + +2759 + g_krb5_kt +; + +2760 +_krb5_kt + * + tkrb5_key�b +; + +2771 cڡ * +KRB5_CALLCONV + + +2772 +krb5_kt_g�_ty� +( +krb5_cڋxt + +cڋxt +, +krb5_key�b + +key�b +); + +2794 +krb5_�r�_code + +KRB5_CALLCONV + + +2795 +krb5_kt_g�_�me +( +krb5_cڋxt + +cڋxt +, +krb5_key�b + +key�b +, * +�me +, + +2796 +�m�� +); + +2806 +krb5_�r�_code + +KRB5_CALLCONV + + +2807 +krb5_kt_�o� +( +krb5_cڋxt + +cڋxt +, +krb5_key�b + +key�b +); + +2835 +krb5_�r�_code + +KRB5_CALLCONV + + +2836 +krb5_kt_g�_��y +( +krb5_cڋxt + +cڋxt +, +krb5_key�b + +key�b +, + +2837 +krb5_cڡ_��c�� + +��c�� +, +krb5_kvno + +vno +, + +2838 +krb5_��y� + +��y� +, +krb5_key�b_��y + * +��y +); + +2857 +krb5_�r�_code + +KRB5_CALLCONV + + +2858 +krb5_kt_��t_�q_g� +( +krb5_cڋxt + +cڋxt +, +krb5_key�b + +key�b +, + +2859 +krb5_kt_curs� + * +curs� +); + +2880 +krb5_�r�_code + +KRB5_CALLCONV + + +2881 +krb5_kt_�xt_��y +( +krb5_cڋxt + +cڋxt +, +krb5_key�b + +key�b +, + +2882 +krb5_key�b_��y + * +��y +, +krb5_kt_curs� + * +curs� +); + +2899 +krb5_�r�_code + +KRB5_CALLCONV + + +2900 +krb5_kt_�d_�q_g� +( +krb5_cڋxt + +cڋxt +, +krb5_key�b + +key�b +, + +2901 +krb5_kt_curs� + * +curs� +); + +2914 +krb5_�r�_code + +KRB5_CALLCONV + + +2915 +krb5_kt_have_cڋ� +( +krb5_cڋxt + +cڋxt +, +krb5_key�b + +key�b +); + +2925 + #KRB5_INIT_CONTEXT_SECURE + 0x1 + + ) + +2926 + #KRB5_INIT_CONTEXT_KDC + 0x2 + + ) + +2945 +krb5_�r�_code + +KRB5_CALLCONV + + +2946 +krb5_��_cڋxt +( +krb5_cڋxt + * +cڋxt +); + +2964 +krb5_�r�_code + +KRB5_CALLCONV + + +2965 +krb5_��_�cu�_cڋxt +( +krb5_cڋxt + * +cڋxt +); + +2983 +krb5_�r�_code + +KRB5_CALLCONV + + +2984 +krb5_��_cڋxt_�of�e +( +_�of�e_t + * +�of�e +, +krb5_�ags + +�ags +, + +2985 +krb5_cڋxt + * +cڋxt +); + +2995 +KRB5_CALLCONV + + +2996 +krb5_�_cڋxt +( +krb5_cڋxt + +cڋxt +); + +3012 +krb5_�r�_code + +KRB5_CALLCONV + + +3013 +krb5_c�y_cڋxt +( +krb5_cڋxt + +�x +, krb5_cڋx�* +n�x_out +); + +3033 +krb5_�r�_code + +KRB5_CALLCONV + + +3034 +krb5_�t_de�u�_tgs_��y�s +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_��y� + * +�y�s +); + +3050 +krb5_�r�_code + +KRB5_CALLCONV + + +3051 +krb5_g�_�rm��d_��y�s +( +krb5_cڋxt + +cڋxt +, +krb5_��y� + ** +kty�s +); + +3059 +krb5_boޗn + +KRB5_CALLCONV + + +3060 +krb5_is_th�ad_�� +(); + +3076 +krb5_�r�_code + +KRB5_CALLCONV + + +3077 +krb5_�rv�_de�y�_tick�_key�b +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_key�b + +kt +, + +3078 +krb5_tick� + * +tick� +); + +3088 +KRB5_CALLCONV + + +3089 +krb5_�_tgt_�eds +( +krb5_cڋxt + +cڋxt +, +krb5_�eds + ** +tgts +); + +3094 + #KRB5_GC_USER_USER + 1 + + ) + +3095 + #KRB5_GC_CACHED + 2 + + ) + +3096 + #KRB5_GC_CANONICALIZE + 4 + + ) + +3097 + #KRB5_GC_NO_STORE + 8 + + ) + +3098 + #KRB5_GC_FORWARDABLE + 16 + + ) + +3099 + #KRB5_GC_NO_TRANSIT_CHECK + 32 + + ) + +3100 + #KRB5_GC_CONSTRAINED_DELEGATION + 64 + + ) + +3142 +krb5_�r�_code + +KRB5_CALLCONV + + +3143 +krb5_g�_�ed�t�ls +( +krb5_cڋxt + +cڋxt +, +krb5_�ags + +�ti�s +, + +3144 +krb5_c�che + +c�che +, +krb5_�eds + * +�_�eds +, + +3145 +krb5_�eds + ** +out_�eds +); + +3148 +krb5_�r�_code + +KRB5_CALLCONV + + +3149 +krb5_g�_�ed�t�ls_v�id�e +( +krb5_cڋxt + +cڋxt +, +krb5_�ags + +�ti�s +, + +3150 +krb5_c�che + +c�che +, +krb5_�eds + * +�_�eds +, + +3151 +krb5_�eds + ** +out_�eds +); + +3154 +krb5_�r�_code + +KRB5_CALLCONV + + +3155 +krb5_g�_�ed�t�ls_��w +( +krb5_cڋxt + +cڋxt +, +krb5_�ags + +�ti�s +, + +3156 +krb5_c�che + +c�che +, +krb5_�eds + * +�_�eds +, + +3157 +krb5_�eds + ** +out_�eds +); + +3181 +krb5_�r�_code + +KRB5_CALLCONV + + +3182 +krb5_mk_�q +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + * +auth_cڋxt +, + +3183 +krb5_�ags + +�_�q_�ti�s +, * +�rvi� +, * +ho��me +, + +3184 +krb5_d�a + * +�_d�a +, +krb5_c�che + +c�che +, krb5_d��* +outbuf +); + +3223 +krb5_�r�_code + +KRB5_CALLCONV + + +3224 +krb5_mk_�q_ex�nded +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + * +auth_cڋxt +, + +3225 +krb5_�ags + +�_�q_�ti�s +, +krb5_d�a + * +�_d�a +, + +3226 +krb5_�eds + * +�_�eds +, +krb5_d�a + * +outbuf +); + +3248 +krb5_�r�_code + +KRB5_CALLCONV + + +3249 +krb5_mk_�p +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, +krb5_d�a + * +outbuf +); + +3262 +krb5_�r�_code + +KRB5_CALLCONV + + +3263 +krb5_mk_�p_d� +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, +krb5_d�a + * +outbuf +); + +3281 +krb5_�r�_code + +KRB5_CALLCONV + + +3282 +krb5_rd_�p +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +3283 cڡ +krb5_d�a + * +�buf +, +krb5_�_�p_�c_�� + ** +�� +); + +3298 +krb5_�r�_code + +KRB5_CALLCONV + + +3299 +krb5_rd_�p_d� +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +3300 cڡ +krb5_d�a + * +�buf +, +krb5_ui_4 + * +n�� +); + +3314 +krb5_�r�_code + +KRB5_CALLCONV + + +3315 +krb5_mk_�r� +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_�r� + * +dec_�r +, + +3316 +krb5_d�a + * +�c_�r +); + +3331 +krb5_�r�_code + +KRB5_CALLCONV + + +3332 +krb5_rd_�r� +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_d�a + * +�c_�rbuf +, + +3333 +krb5_�r� + ** +dec_�r� +); + +3371 +krb5_�r�_code + +KRB5_CALLCONV + + +3372 +krb5_rd_�� +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +3373 cڡ +krb5_d�a + * +�buf +, krb5_d��* +outbuf +, + +3374 +krb5_��ay_d�a + * +outd�a +); + +3411 +krb5_�r�_code + +KRB5_CALLCONV + + +3412 +krb5_rd_�iv +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +3413 cڡ +krb5_d�a + * +�buf +, krb5_d��* +outbuf +, + +3414 +krb5_��ay_d�a + * +outd�a +); + +3448 +krb5_�r�_code + +KRB5_CALLCONV + + +3449 +krb5_�r�_�me +( +krb5_cڋxt + +cڋxt +, cڡ * +�me +, + +3450 +krb5_��c�� + * +��c��_out +); + +3452 + #KRB5_PRINCIPAL_PARSE_NO_REALM + 0x1 + + ) + +3453 + #KRB5_PRINCIPAL_PARSE_REQUIRE_REALM + 0x2 + + ) + +3454 + #KRB5_PRINCIPAL_PARSE_ENTERPRISE + 0x4 + + ) + +3456 + #KRB5_PRINCIPAL_PARSE_IGNORE_REALM + 0x8 + + ) + +3489 +krb5_�r�_code + +KRB5_CALLCONV + + +3490 +krb5_�r�_�me_�ags +( +krb5_cڋxt + +cڋxt +, cڡ * +�me +, + +3491 +�ags +, +krb5_��c�� + * +��c��_out +); + +3510 +krb5_�r�_code + +KRB5_CALLCONV + + +3511 +krb5_uŬ�_�me +( +krb5_cڋxt + +cڋxt +, +krb5_cڡ_��c�� + +��c�� +, + +3512 ** +�me +); + +3537 +krb5_�r�_code + +KRB5_CALLCONV + + +3538 +krb5_uŬ�_�me_ext +( +krb5_cڋxt + +cڋxt +, +krb5_cڡ_��c�� + +��c�� +, + +3539 ** +�me +, * +size +); + +3541 + #KRB5_PRINCIPAL_UNPARSE_SHORT + 0x1 + + ) + +3542 + #KRB5_PRINCIPAL_UNPARSE_NO_REALM + 0x2 + + ) + +3543 + #KRB5_PRINCIPAL_UNPARSE_DISPLAY + 0x4 + + ) + +3568 +krb5_�r�_code + +KRB5_CALLCONV + + +3569 +krb5_uŬ�_�me_�ags +( +krb5_cڋxt + +cڋxt +, +krb5_cڡ_��c�� + +��c�� +, + +3570 +�ags +, ** +�me +); + +3588 +krb5_�r�_code + +KRB5_CALLCONV + + +3589 +krb5_uŬ�_�me_�ags_ext +( +krb5_cڋxt + +cڋxt +, +krb5_cڡ_��c�� + +��c�� +, + +3590 +�ags +, ** +�me +, * +size +); + +3607 +krb5_�r�_code + +KRB5_CALLCONV + + +3608 +krb5_�t_��c��_��m +( +krb5_cڋxt + +cڋxt +, +krb5_��c�� + +��c�� +, + +3609 cڡ * +��m +); + +3625 +krb5_boޗn + +KRB5_CALLCONV_WRONG + + +3626 +krb5_add�ss_��ch +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_add�ss + * +addr +, + +3627 +krb5_add�ss + *cڡ * +add�i� +); + +3639 +krb5_boޗn + +KRB5_CALLCONV + + +3640 +krb5_add�ss_com�� +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_add�ss + * +addr1 +, + +3641 cڡ +krb5_add�ss + * +addr2 +); + +3657 +KRB5_CALLCONV + + +3658 +krb5_add�ss_�d� +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_add�ss + * +addr1 +, + +3659 cڡ +krb5_add�ss + * +addr2 +); + +3671 +krb5_boޗn + +KRB5_CALLCONV + + +3672 +krb5_��m_com�� +( +krb5_cڋxt + +cڋxt +, +krb5_cڡ_��c�� + +��c1 +, + +3673 +krb5_cڡ_��c�� + +��c2 +); + +3685 +krb5_boޗn + +KRB5_CALLCONV + + +3686 +krb5_��c��_com�� +( +krb5_cڋxt + +cڋxt +, + +3687 +krb5_cڡ_��c�� + +��c1 +, + +3688 +krb5_cڡ_��c�� + +��c2 +); + +3703 +krb5_boޗn + +KRB5_CALLCONV + + +3704 +krb5_��c��_com��_�y_��m +( +krb5_cڋxt + +cڋxt +, + +3705 +krb5_cڡ_��c�� + +��c1 +, + +3706 +krb5_cڡ_��c�� + +��c2 +); + +3708 + #KRB5_PRINCIPAL_COMPARE_IGNORE_REALM + 1 + + ) + +3709 + #KRB5_PRINCIPAL_COMPARE_ENTERPRISE + 2 + + ) + +3710 + #KRB5_PRINCIPAL_COMPARE_CASEFOLD + 4 + + ) + +3711 + #KRB5_PRINCIPAL_COMPARE_UTF8 + 8 + + ) + +3732 +krb5_boޗn + +KRB5_CALLCONV + + +3733 +krb5_��c��_com��_�ags +( +krb5_cڋxt + +cڋxt +, + +3734 +krb5_cڡ_��c�� + +��c1 +, + +3735 +krb5_cڡ_��c�� + +��c2 +, + +3736 +�ags +); + +3755 +krb5_�r�_code + +KRB5_CALLCONV + + +3756 +krb5_��_keyblock +( +krb5_cڋxt + +cڋxt +, +krb5_��y� + +��y� +, + +3757 +size_t + +�ngth +, +krb5_keyblock + ** +out +); + +3771 +krb5_�r�_code + +KRB5_CALLCONV + + +3772 +krb5_c�y_keyblock +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_keyblock + * +�om +, + +3773 +krb5_keyblock + ** +to +); + +3787 +krb5_�r�_code + +KRB5_CALLCONV + + +3788 +krb5_c�y_keyblock_cڋ�s +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_keyblock + * +�om +, + +3789 +krb5_keyblock + * +to +); + +3803 +krb5_�r�_code + +KRB5_CALLCONV + + +3804 +krb5_c�y_�eds +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_�eds + * +��ed +, krb5_�ed�** +out�ed +); + +3818 +krb5_�r�_code + +KRB5_CALLCONV + + +3819 +krb5_c�y_d�a +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_d�a + * +�d�a +, krb5_d��** +outd�a +); + +3834 +krb5_�r�_code + +KRB5_CALLCONV + + +3835 +krb5_c�y_��c�� +( +krb5_cڋxt + +cڋxt +, +krb5_cڡ_��c�� + +���c +, + +3836 +krb5_��c�� + * +ou�r�c +); + +3850 +krb5_�r�_code + +KRB5_CALLCONV + + +3851 +krb5_c�y_add�s�s +( +krb5_cڋxt + +cڋxt +, +krb5_add�ss + *cڡ * +�addr +, + +3852 +krb5_add�ss + *** +ou�ddr +); + +3866 +krb5_�r�_code + +KRB5_CALLCONV + + +3867 +krb5_c�y_tick� +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_tick� + * +�om +, krb5_tick� ** +�o +); + +3884 +krb5_�r�_code + +KRB5_CALLCONV + + +3885 +krb5_c�y_authd�a +( +krb5_cڋxt + +cڋxt +, + +3886 +krb5_authd�a + *cڡ * +�_authd� +, krb5_authd��*** +out +); + +3906 +krb5_�r�_code + +KRB5_CALLCONV + + +3907 +krb5_f�d_authd�a +( +krb5_cڋxt + +cڋxt +, +krb5_authd�a + *cڡ * +tick�_authd�a +, + +3908 +krb5_authd�a + *cڡ * +�_�q_authd�a +, + +3909 +krb5_authd��y� + +ad_ty� +, +krb5_authd�a + *** +�su�s +); + +3928 +krb5_�r�_code + +KRB5_CALLCONV + + +3929 +krb5_m�ge_authd�a +( +krb5_cڋxt + +cڋxt +, + +3930 +krb5_authd�a + *cڡ * +�authd�1 +, + +3931 +krb5_authd�a + * cڡ * +�authd�2 +, + +3932 +krb5_authd�a + *** +ou�uthd� +); + +3947 +krb5_�r�_code + +KRB5_CALLCONV + + +3948 +krb5_c�y_auth�ti�t� +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_auth�ti�t� + * +auth�om +, + +3949 +krb5_auth�ti�t� + ** +authto +); + +3964 +krb5_�r�_code + +KRB5_CALLCONV + + +3965 +krb5_c�y_checksum +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_checksum + * +ck�om +, + +3966 +krb5_checksum + ** +ckto +); + +3982 +krb5_�r�_code + +KRB5_CALLCONV + + +3983 +krb5_g�_�rv�_r�che +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_d�a + * +p�� +, + +3984 +krb5_r�che + * +r�� +); + +4015 +krb5_�r�_code + +KRB5_CALLCONV_C + + +4016 +krb5_bu�d_��c��_ext +( +krb5_cڋxt + +cڋxt +, +krb5_��c�� + * +��c +, + +4017 +�� +, cڡ * +��m +, ...); + +4045 +krb5_�r�_code + +KRB5_CALLCONV_C + + +4046 + $krb5_bu�d_��c�� +( +krb5_cڋxt + +cڋxt +, + +4047 +krb5_��c�� + * +��c +, + +4048 +�� +, + +4049 cڡ * +��m +, ...) + +4050 #i� +__GNUC__ + >= 4 + +4051 + `__��ibu�__ + (( +���� +)) + +4054 #i� +KRB5_DEPRECATED + + +4056 +KRB5_ATTR_DEPRECATED + +krb5_�r�_code + +KRB5_CALLCONV + + +4057 + `krb5_bu�d_��c��_va +( +krb5_cڋxt + +cڋxt +, + +4058 +krb5_��c�� + +��c +, + +4059 +�� +, + +4060 cڡ * +��m +, + +4061 +va_li� + +� +); + +4092 +krb5_�r�_code + +KRB5_CALLCONV + + +4093 + `krb5_bu�d_��c��_�loc_va +( +krb5_cڋxt + +cڋxt +, + +4094 +krb5_��c�� + * +��c +, + +4095 +�� +, + +4096 cڡ * +��m +, + +4097 +va_li� + +� +); + +4115 +krb5_�r�_code + +KRB5_CALLCONV + + +4116 + `krb5_425_c�v_��c�� +( +krb5_cڋxt + +cڋxt +, cڡ * +�me +, + +4117 cڡ * +���� +, cڡ * +��m +, + +4118 +krb5_��c�� + * +��c +); + +4141 +krb5_�r�_code + +KRB5_CALLCONV + + +4142 + `krb5_524_c�v_��c�� +( +krb5_cڋxt + +cڋxt +, +krb5_cڡ_��c�� + +��c +, + +4143 * +�me +, * +�� +, * +��m +); + +4147 +�ed�t�ls +; + +4156 +KRB5_CALLCONV + + +4157 + `krb5_524_c�v�t_�eds +( +krb5_cڋxt + +cڋxt +, +krb5_�eds + * +v5�eds +, + +4158 +�ed�t�ls + * +v4�eds +); + +4160 #i� +KRB5_DEPRECATED + + +4161 + #krb524_c�v�t_�eds_kdc + +krb5_524_c�v�t_�eds + + + ) + +4162 + #krb524_��_�s +( +x +�(0) + + ) + +4192 +krb5_�r�_code + +KRB5_CALLCONV + + +4193 + `krb5_kt_�s�ve +( +krb5_cڋxt + +cڋxt +, cڡ * +�me +, +krb5_key�b + * +ktid +); + +4207 +krb5_�r�_code + +KRB5_CALLCONV + + +4208 + `krb5_kt_dup +( +krb5_cڋxt + +cڋxt +, +krb5_key�b + +� +, krb5_key�b * +out +); + +4228 +krb5_�r�_code + +KRB5_CALLCONV + + +4229 + `krb5_kt_de�u�_�me +( +krb5_cڋxt + +cڋxt +, * +�me +, +�me_size +); + +4245 +krb5_�r�_code + +KRB5_CALLCONV + + +4246 + `krb5_kt_de�u� +( +krb5_cڋxt + +cڋxt +, +krb5_key�b + * +id +); + +4263 +krb5_�r�_code + +KRB5_CALLCONV + + +4264 + `krb5_kt_���_de�u� +( +krb5_cڋxt + +cڋxt +, +krb5_key�b + * +key�b_out +); + +4276 +krb5_�r�_code + +KRB5_CALLCONV + + +4277 + `krb5_�_key�b_��y_cڋ�s +( +krb5_cڋxt + +cڋxt +, +krb5_key�b_��y + * +��y +); + +4280 +krb5_�r�_code + +KRB5_CALLCONV + + +4281 + `krb5_kt_�_��y +( +krb5_cڋxt + +cڋxt +, +krb5_key�b_��y + * +��y +); + +4301 +krb5_�r�_code + +KRB5_CALLCONV + + +4302 + `krb5_kt_�move_��y +( +krb5_cڋxt + +cڋxt +, +krb5_key�b + +id +, +krb5_key�b_��y + * +��y +); + +4320 +krb5_�r�_code + +KRB5_CALLCONV + + +4321 + `krb5_kt_add_��y +( +krb5_cڋxt + +cڋxt +, +krb5_key�b + +id +, +krb5_key�b_��y + * +��y +); + +4332 +krb5_�r�_code + +KRB5_CALLCONV_WRONG + + +4333 + `krb5_��c��2�� +( +krb5_cڋxt + +cڋxt +, + +4334 +krb5_cڡ_��c�� + +� +, +krb5_d�a + * +�t +); + +4360 +krb5_�r�_code + +KRB5_CALLCONV + + +4361 + `krb5_cc_�s�ve +( +krb5_cڋxt + +cڋxt +, cڡ * +�me +, +krb5_c�che + * +�che +); + +4373 +krb5_�r�_code + +KRB5_CALLCONV + + +4374 + `krb5_cc_dup +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +� +, krb5_c�ch�* +out +); + +4399 cڡ * +KRB5_CALLCONV + + +4400 + `krb5_cc_de�u�_�me +( +krb5_cڋxt + +cڋxt +); + +4422 +krb5_�r�_code + +KRB5_CALLCONV + + +4423 + `krb5_cc_�t_de�u�_�me +( +krb5_cڋxt + +cڋxt +, cڡ * +�me +); + +4444 +krb5_�r�_code + +KRB5_CALLCONV + + +4445 + `krb5_cc_de�u� +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + * +c�che +); + +4456 +krb5_�r�_code + +KRB5_CALLCONV + + +4457 + `krb5_cc_c�y_�eds +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +�cc +, krb5_c�ch� +outcc +); + +4476 +krb5_�r�_code + +KRB5_CALLCONV + + +4477 + `krb5_cc_g�_c�fig +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +id +, + +4478 +krb5_cڡ_��c�� + +��c�� +, + +4479 cڡ * +key +, +krb5_d�a + * +d�a +); + +4500 +krb5_�r�_code + +KRB5_CALLCONV + + +4501 + `krb5_cc_�t_c�fig +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +id +, + +4502 +krb5_cڡ_��c�� + +��c�� +, + +4503 cڡ * +key +, +krb5_d�a + * +d�a +); + +4515 +krb5_boޗn + +KRB5_CALLCONV + + +4516 + `krb5_is_c�fig_��c�� +( +krb5_cڋxt + +cڋxt +, +krb5_cڡ_��c�� + +��c�� +); + +4532 +krb5_�r�_code + +KRB5_CALLCONV + + +4533 + `krb5_cc_sw�ch +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +�che +); + +4546 +krb5_boޗn + +KRB5_CALLCONV + + +4547 + `krb5_cc_su��t_sw�ch +( +krb5_cڋxt + +cڋxt +, cڡ * +ty� +); + +4566 +krb5_�r�_code + +KRB5_CALLCONV + + +4567 + `krb5_cc_�che_m�ch +( +krb5_cڋxt + +cڋxt +, +krb5_��c�� + +��� +, + +4568 +krb5_c�che + * +�che_out +); + +4604 +krb5_�r�_code + +KRB5_CALLCONV + + +4605 + `krb5_cc_��� +( +krb5_cڋxt + +cڋxt +, +krb5_��c�� + +�rv� +, + +4606 +krb5_c�che + * +�che_out +, +krb5_��c�� + * +��c_out +); + +4615 +KRB5_CALLCONV + + +4616 + `krb5_�_��c�� +( +krb5_cڋxt + +cڋxt +, +krb5_��c�� + +v� +); + +4626 +KRB5_CALLCONV + + +4627 + `krb5_�_auth�ti�t� +( +krb5_cڋxt + +cڋxt +, +krb5_auth�ti�t� + * +v� +); + +4639 +KRB5_CALLCONV + + +4640 + `krb5_�_add�s�s +( +krb5_cڋxt + +cڋxt +, +krb5_add�ss + ** +v� +); + +4652 +KRB5_CALLCONV + + +4653 + `krb5_�_authd�a +( +krb5_cڋxt + +cڋxt +, +krb5_authd�a + ** +v� +); + +4663 +KRB5_CALLCONV + + +4664 + `krb5_�_tick� +( +krb5_cڋxt + +cڋxt +, +krb5_tick� + * +v� +); + +4674 +KRB5_CALLCONV + + +4675 + `krb5_�_�r� +( +krb5_cڋxt + +cڋxt +, +krb5_�r� + * +v� +); + +4685 +KRB5_CALLCONV + + +4686 + `krb5_�_�eds +( +krb5_cڋxt + +cڋxt +, +krb5_�eds + * +v� +); + +4696 +KRB5_CALLCONV + + +4697 + `krb5_�_�ed_cڋ�s +( +krb5_cڋxt + +cڋxt +, +krb5_�eds + * +v� +); + +4707 +KRB5_CALLCONV + + +4708 + `krb5_�_checksum +( +krb5_cڋxt + +cڋxt +, +krb5_checksum + * +v� +); + +4718 +KRB5_CALLCONV + + +4719 + `krb5_�_checksum_cڋ�s +( +krb5_cڋxt + +cڋxt +, +krb5_checksum + * +v� +); + +4729 +KRB5_CALLCONV + + +4730 + `krb5_�_keyblock +( +krb5_cڋxt + +cڋxt +, +krb5_keyblock + * +v� +); + +4740 +KRB5_CALLCONV + + +4741 + `krb5_�_keyblock_cڋ�s +( +krb5_cڋxt + +cڋxt +, +krb5_keyblock + * +key +); + +4751 +KRB5_CALLCONV + + +4752 + `krb5_�_�_�p_�c_�� +( +krb5_cڋxt + +cڋxt +, +krb5_�_�p_�c_�� + * +v� +); + +4762 +KRB5_CALLCONV + + +4763 + `krb5_�_d�a +( +krb5_cڋxt + +cڋxt +, +krb5_d�a + * +v� +); + +4766 +KRB5_CALLCONV + + +4767 + `krb5_�_o��_d�a +( +krb5_cڋxt + +cڋxt +, +krb5_o��_d�a + * +v� +); + +4777 +KRB5_CALLCONV + + +4778 + `krb5_�_d�a_cڋ�s +( +krb5_cڋxt + +cڋxt +, +krb5_d�a + * +v� +); + +4786 +KRB5_CALLCONV + + +4787 + `krb5_�_uŬ�d_�me +( +krb5_cڋxt + +cڋxt +, * +v� +); + +4797 +KRB5_CALLCONV + + +4798 + `krb5_�_�r�g +( +krb5_cڋxt + +cڋxt +, * +v� +); + +4808 +KRB5_CALLCONV + + +4809 + `krb5_�_��y�s +( +krb5_cڋxt + +cڋxt +, +krb5_��y� + * +v� +); + +4817 +KRB5_CALLCONV + + +4818 + `krb5_�_cksumty�s +( +krb5_cڋxt + +cڋxt +, +krb5_cksumty� + * +v� +); + +4838 +krb5_�r�_code + +KRB5_CALLCONV + + +4839 + `krb5_us_timeofday +( +krb5_cڋxt + +cڋxt +, + +4840 +krb5_time�amp + * +�c�ds +, +krb5_�t32 + * +mi�o�c�ds +); + +4856 +krb5_�r�_code + +KRB5_CALLCONV + + +4857 + `krb5_timeofday +( +krb5_cڋxt + +cڋxt +, +krb5_time�amp + * +tim�� +); + +4873 +krb5_�r�_code + +KRB5_CALLCONV + + +4874 + `krb5_check_�ockskew +( +krb5_cڋxt + +cڋxt +, +krb5_time�amp + +d�e +); + +4887 +krb5_�r�_code + +KRB5_CALLCONV + + +4888 + `krb5_os_lo��ddr +( +krb5_cڋxt + +cڋxt +, +krb5_add�ss + *** +addr +); + +4906 +krb5_�r�_code + +KRB5_CALLCONV + + +4907 + `krb5_g�_de�u�_��m +( +krb5_cڋxt + +cڋxt +, ** +̗lm +); + +4922 +krb5_�r�_code + +KRB5_CALLCONV + + +4923 + `krb5_�t_de�u�_��m +( +krb5_cڋxt + +cڋxt +, cڡ * +̗lm +); + +4931 +KRB5_CALLCONV + + +4932 + `krb5_�_de�u�_��m +( +krb5_cڋxt + +cڋxt +, * +̗lm +); + +4963 +krb5_�r�_code + +KRB5_CALLCONV + + +4964 + `krb5_�ame_to_��c�� +( +krb5_cڋxt + +cڋxt +, cڡ * +ho��me +, cڡ * +�ame +, + +4965 +krb5_�t32 + +ty� +, +krb5_��c�� + * +�t_��c +); + +4987 +krb5_boޗn + +KRB5_CALLCONV + + +4988 + `krb5_�ame_m�ch +( +krb5_cڋxt + +cڋxt +, +krb5_cڡ_��c�� + +m�ch�g +, + +4989 +krb5_cڡ_��c�� + +��c +); + +5013 +krb5_�r�_code + +KRB5_CALLCONV + + +5014 + `krb5_ch�ge_�ssw�d +( +krb5_cڋxt + +cڋxt +, +krb5_�eds + * +�eds +, * +�wpw +, + +5015 * +�su�_code +, +krb5_d�a + * +�su�_code_�r�g +, + +5016 +krb5_d�a + * +�su�_�r�g +); + +5048 +krb5_�r�_code + +KRB5_CALLCONV + + +5049 + `krb5_�t_�ssw�d +( +krb5_cڋxt + +cڋxt +, +krb5_�eds + * +�eds +, * +�wpw +, + +5050 +krb5_��c�� + +ch�ge_�ssw�d_f� +, * +�su�_code +, + +5051 +krb5_d�a + * +�su�_code_�r�g +, krb5_d��* +�su�_�r�g +); + +5083 +krb5_�r�_code + +KRB5_CALLCONV + + +5084 + `krb5_�t_�ssw�d_us�g_c�che +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +c�che +, + +5085 * +�wpw +, +krb5_��c�� + +ch�ge_�ssw�d_f� +, + +5086 * +�su�_code +, +krb5_d�a + * +�su�_code_�r�g +, + +5087 +krb5_d�a + * +�su�_�r�g +); + +5111 +krb5_�r�_code + +KRB5_CALLCONV + + +5112 + `krb5_chpw_mes�ge +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_d�a + * +�rv�_�r�g +, + +5113 ** +mes�ge_out +); + +5132 +krb5_�r�_code + +KRB5_CALLCONV + + +5133 + `krb5_g�_�of�e +( +krb5_cڋxt + +cڋxt +, +_�of�e_t + ** +�of�e +); + +5135 #i� +KRB5_DEPRECATED + + +5137 +KRB5_ATTR_DEPRECATED + +krb5_�r�_code + +KRB5_CALLCONV + + +5138 + `krb5_g�_�_tkt_w�h_�ssw�d +( +krb5_cڋxt + +cڋxt +, +krb5_�ags + +�ti�s +, + +5139 +krb5_add�ss + *cڡ * +addrs +, +krb5_��y� + * +kty�s +, + +5140 +krb5_��uthty� + * +�e_auth_ty�s +, + +5141 cڡ * +�ssw�d +, +krb5_c�che + +c�che +, + +5142 +krb5_�eds + * +�eds +, +krb5_kdc_�p + ** +�t_as_��y +); + +5145 +KRB5_ATTR_DEPRECATED + +krb5_�r�_code + +KRB5_CALLCONV + + +5146 + `krb5_g�_�_tkt_w�h_skey +( +krb5_cڋxt + +cڋxt +, +krb5_�ags + +�ti�s +, + +5147 +krb5_add�ss + *cڡ * +addrs +, +krb5_��y� + * +kty�s +, + +5148 +krb5_��uthty� + * +�e_auth_ty�s +, + +5149 cڡ +krb5_keyblock + * +key +, +krb5_c�che + +c�che +, + +5150 +krb5_�eds + * +�eds +, +krb5_kdc_�p + ** +�t_as_��y +); + +5153 +KRB5_ATTR_DEPRECATED + +krb5_�r�_code + +KRB5_CALLCONV + + +5154 + `krb5_g�_�_tkt_w�h_key�b +( +krb5_cڋxt + +cڋxt +, +krb5_�ags + +�ti�s +, + +5155 +krb5_add�ss + *cڡ * +addrs +, +krb5_��y� + * +kty�s +, + +5156 +krb5_��uthty� + * +�e_auth_ty�s +, + +5157 +krb5_key�b + +�g_key�b +, +krb5_c�che + +c�che +, + +5158 +krb5_�eds + * +�eds +, +krb5_kdc_�p + ** +�t_as_��y +); + +5218 +krb5_�r�_code + +KRB5_CALLCONV + + +5219 + `krb5_rd_�q +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + * +auth_cڋxt +, + +5220 cڡ +krb5_d�a + * +�buf +, +krb5_cڡ_��c�� + +�rv� +, + +5221 +krb5_key�b + +key�b +, +krb5_�ags + * +�_�q_�ti�s +, + +5222 +krb5_tick� + ** +tick� +); + +5246 +krb5_�r�_code + +KRB5_CALLCONV + + +5247 + `krb5_kt_�ad_�rvi�_key +( +krb5_cڋxt + +cڋxt +, +krb5_po��r + +key�o�rg +, + +5248 +krb5_��c�� + +��c�� +, +krb5_kvno + +vno +, + +5249 +krb5_��y� + +��y� +, +krb5_keyblock + ** +key +); + +5289 +krb5_�r�_code + +KRB5_CALLCONV + + +5290 + `krb5_mk_�� +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +5291 cڡ +krb5_d�a + * +u�rd�a +, krb5_d��* +outbuf +, + +5292 +krb5_��ay_d�a + * +outd�a +); + +5328 +krb5_�r�_code + +KRB5_CALLCONV + + +5329 + `krb5_mk_�iv +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +5330 cڡ +krb5_d�a + * +u�rd�a +, krb5_d��* +outbuf +, + +5331 +krb5_��ay_d�a + * +outd�a +); + +5382 +krb5_�r�_code + +KRB5_CALLCONV + + +5383 + `krb5_�ndauth +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + * +auth_cڋxt +, + +5384 +krb5_po��r + +fd +, * +��_v�si� +, +krb5_��c�� + +��� +, + +5385 +krb5_��c�� + +�rv� +, +krb5_�ags + +�_�q_�ti�s +, + +5386 +krb5_d�a + * +�_d�a +, +krb5_�eds + * +�_�eds +, +krb5_c�che + +c�che +, + +5387 +krb5_�r� + ** +�r� +, +krb5_�_�p_�c_�� + ** +�p_�su� +, + +5388 +krb5_�eds + ** +out_�eds +); + +5412 +krb5_�r�_code + +KRB5_CALLCONV + + +5413 + `krb5_�cvauth +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + * +auth_cڋxt +, + +5414 +krb5_po��r + +fd +, * +��_v�si� +, +krb5_��c�� + +�rv� +, + +5415 +krb5_�t32 + +�ags +, +krb5_key�b + +key�b +, +krb5_tick� + ** +tick� +); + +5434 +krb5_�r�_code + +KRB5_CALLCONV + + +5435 + `krb5_�cvauth_v�si� +( +krb5_cڋxt + +cڋxt +, + +5436 +krb5_auth_cڋxt + * +auth_cڋxt +, + +5437 +krb5_po��r + +fd +, + +5438 +krb5_��c�� + +�rv� +, + +5439 +krb5_�t32 + +�ags +, + +5440 +krb5_key�b + +key�b +, + +5441 +krb5_tick� + ** +tick� +, + +5442 +krb5_d�a + * +v�si� +); + +5471 +krb5_�r�_code + +KRB5_CALLCONV + + +5472 + `krb5_mk_n�ed +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +5473 +krb5_�eds + ** +��eds +, +krb5_d�a + ** +�d�a +, + +5474 +krb5_��ay_d�a + * +outd�a +); + +5497 +krb5_�r�_code + +KRB5_CALLCONV + + +5498 + `krb5_mk_1�ed +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +5499 +krb5_�eds + * +p�eds +, +krb5_d�a + ** +�d�a +, + +5500 +krb5_��ay_d�a + * +outd�a +); + +5522 +krb5_�r�_code + +KRB5_CALLCONV + + +5523 + `krb5_rd_�ed +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +5524 +krb5_d�a + * +p�edd�a +, +krb5_�eds + *** +�p�eds +, + +5525 +krb5_��ay_d�a + * +outd�a +); + +5556 +krb5_�r�_code + +KRB5_CALLCONV + + +5557 + `krb5_fwd_tgt_�eds +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +5558 * +rho� +, +krb5_��c�� + +��� +, krb5_��c�� +�rv� +, + +5559 +krb5_c�che + +cc +, +f�w�dab� +, +krb5_d�a + * +outbuf +); + +5580 +krb5_�r�_code + +KRB5_CALLCONV + + +5581 + `krb5_auth_c�_�� +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + * +auth_cڋxt +); + +5593 +krb5_�r�_code + +KRB5_CALLCONV + + +5594 + `krb5_auth_c�_� +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +); + +5611 +krb5_�r�_code + +KRB5_CALLCONV + + +5612 + `krb5_auth_c�_�t�ags +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, +krb5_�t32 + +�ags +); + +5629 +krb5_�r�_code + +KRB5_CALLCONV + + +5630 + `krb5_auth_c�_g��ags +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +5631 +krb5_�t32 + * +�ags +); + +5647 +krb5_�r�_code + +KRB5_CALLCONV + + +5648 + `krb5_auth_c�_�t_checksum_func +� +krb5_cڋxt + +cڋxt +, + +5649 +krb5_auth_cڋxt + +auth_cڋxt +, + +5650 +krb5_mk_�q_checksum_func + +func +, + +5651 * +d�a +); + +5663 +krb5_�r�_code + +KRB5_CALLCONV + + +5664 + `krb5_auth_c�_g�_checksum_func +� +krb5_cڋxt + +cڋxt +, + +5665 +krb5_auth_cڋxt + +auth_cڋxt +, + +5666 +krb5_mk_�q_checksum_func + * +func +, + +5667 ** +d�a +); + +5685 +krb5_�r�_code + +KRB5_CALLCONV_WRONG + + +5686 + `krb5_auth_c�_��ddrs +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +5687 +krb5_add�ss + * +lo�l_addr +, krb5_add�s�* +�m�e_addr +); + +5699 +krb5_�r�_code + +KRB5_CALLCONV + + +5700 + `krb5_auth_c�_g�addrs +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +5701 +krb5_add�ss + ** +lo�l_addr +, krb5_add�s�** +�m�e_addr +); + +5719 +krb5_�r�_code + +KRB5_CALLCONV + + +5720 + `krb5_auth_c�_���ts +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +5721 +krb5_add�ss + * +lo�l_p�t +, krb5_add�s�* +�m�e_p�t +); + +5732 +krb5_�r�_code + +KRB5_CALLCONV + + +5733 + `krb5_auth_c�_�tu�ru�rkey +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +5734 +krb5_keyblock + * +keyblock +); + +5749 +krb5_�r�_code + +KRB5_CALLCONV + + +5750 + `krb5_auth_c�_g�key +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +5751 +krb5_keyblock + ** +keyblock +); + +5765 +krb5_�r�_code + +KRB5_CALLCONV + + +5766 + `krb5_auth_c�_g�key_k +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +5767 +krb5_key + * +key +); + +5782 +krb5_�r�_code + +KRB5_CALLCONV + + +5783 + `krb5_auth_c�_g��ndsubkey +( +krb5_cڋxt + +�x +, +krb5_auth_cڋxt + +ac +, +krb5_keyblock + ** +keyblock +); + +5797 +krb5_�r�_code + +KRB5_CALLCONV + + +5798 + `krb5_auth_c�_g��ndsubkey_k +( +krb5_cڋxt + +�x +, +krb5_auth_cڋxt + +ac +, + +5799 +krb5_key + * +key +); + +5814 +krb5_�r�_code + +KRB5_CALLCONV + + +5815 + `krb5_auth_c�_g��cvsubkey +( +krb5_cڋxt + +�x +, +krb5_auth_cڋxt + +ac +, +krb5_keyblock + ** +keyblock +); + +5829 +krb5_�r�_code + +KRB5_CALLCONV + + +5830 + `krb5_auth_c�_g��cvsubkey_k +( +krb5_cڋxt + +�x +, +krb5_auth_cڋxt + +ac +, +krb5_key + * +key +); + +5843 +krb5_�r�_code + +KRB5_CALLCONV + + +5844 + `krb5_auth_c�_�t�ndsubkey +( +krb5_cڋxt + +�x +, +krb5_auth_cڋxt + +ac +, + +5845 +krb5_keyblock + * +keyblock +); + +5861 +krb5_�r�_code + +KRB5_CALLCONV + + +5862 + `krb5_auth_c�_�t�ndsubkey_k +( +krb5_cڋxt + +�x +, +krb5_auth_cڋxt + +ac +, +krb5_key + +key +); + +5875 +krb5_�r�_code + +KRB5_CALLCONV + + +5876 + `krb5_auth_c�_��ecvsubkey +( +krb5_cڋxt + +�x +, +krb5_auth_cڋxt + +ac +, + +5877 +krb5_keyblock + * +keyblock +); + +5893 +krb5_�r�_code + +KRB5_CALLCONV + + +5894 + `krb5_auth_c�_��ecvsubkey_k +( +krb5_cڋxt + +�x +, +krb5_auth_cڋxt + +ac +, + +5895 +krb5_key + +key +); + +5897 #i� +KRB5_DEPRECATED + + +5899 +KRB5_ATTR_DEPRECATED + +krb5_�r�_code + +KRB5_CALLCONV + + +5900 + `krb5_auth_c�_g�lo�lsubkey +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +5901 +krb5_keyblock + ** +keyblock +); + +5904 +KRB5_ATTR_DEPRECATED + +krb5_�r�_code + +KRB5_CALLCONV + + +5905 + `krb5_auth_c�_g��m�esubkey +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +5906 +krb5_keyblock + ** +keyblock +); + +5922 +krb5_�r�_code + +KRB5_CALLCONV + + +5923 + `krb5_auth_c�_g�lo�l�qnumb� +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +5924 +krb5_�t32 + * +�qnumb� +); + +5939 +krb5_�r�_code + +KRB5_CALLCONV + + +5940 + `krb5_auth_c�_g��m�e�qnumb� +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +5941 +krb5_�t32 + * +�qnumb� +); + +5943 #i� +KRB5_DEPRECATED + + +5949 +KRB5_ATTR_DEPRECATED + +krb5_�r�_code + +KRB5_CALLCONV + + +5950 + `krb5_auth_c�_��ive�� +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +); + +5966 +krb5_�r�_code + +KRB5_CALLCONV + + +5967 + `krb5_auth_c�_���che +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +5968 +krb5_r�che + +r�che +); + +5982 +krb5_�r�_code + +KRB5_CALLCONV_WRONG + + +5983 + `krb5_auth_c�_g�r�che +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +5984 +krb5_r�che + * +r�che +); + +5998 +krb5_�r�_code + +KRB5_CALLCONV + + +5999 + `krb5_auth_c�_g�auth�ti�t� +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +6000 +krb5_auth�ti�t� + ** +auth�ti�t� +); + +6014 +krb5_�r�_code + +KRB5_CALLCONV + + +6015 + `krb5_auth_c�_�t_�q_cksumty� +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +6016 +krb5_cksumty� + +cksumty� +); + +6018 + #KRB5_REALM_BRANCH_CHAR + '.' + + ) + +6059 +krb5_�r�_code + +KRB5_CALLCONV + + +6060 + `krb5_�ad_�ssw�d +( +krb5_cڋxt + +cڋxt +, + +6061 cڡ * +�om� +, cڡ * +�om�2 +, + +6062 * +�tu�_pwd +, * +size_�tu� +); + +6087 +krb5_�r�_code + +KRB5_CALLCONV + + +6088 + `krb5_�ame_to_lo��ame +( +krb5_cڋxt + +cڋxt +, +krb5_cڡ_��c�� + +�ame +, + +6089 +�size_� +, * +�ame +); + +6114 +krb5_�r�_code + +KRB5_CALLCONV + + +6115 + `krb5_g�_ho�_��m +( +krb5_cڋxt + +cڋxt +, cڡ * +ho� +, *** +��m� +); + +6132 +krb5_�r�_code + +KRB5_CALLCONV + + +6133 + `krb5_g�_��back_ho�_��m +( +krb5_cڋxt + +cڋxt +, + +6134 +krb5_d�a + * +hd�a +, *** +��m� +); + +6147 +krb5_�r�_code + +KRB5_CALLCONV + + +6148 + `krb5_�_ho�_��m +( +krb5_cڋxt + +cڋxt +, *cڡ * +��mli� +); + +6163 +krb5_boޗn + +KRB5_CALLCONV + + +6164 + `krb5_ku�rok +( +krb5_cڋxt + +cڋxt +, +krb5_��c�� + +��c�� +, cڡ * +lu�r +); + +6185 +krb5_�r�_code + +KRB5_CALLCONV + + +6186 + `krb5_auth_c�_g�addrs +( +krb5_cڋxt + +cڋxt +, +krb5_auth_cڋxt + +auth_cڋxt +, + +6187 +�fd +, +�ags +); + +6202 +krb5_�r�_code + +KRB5_CALLCONV + + +6203 + `krb5_�t_��_time +( +krb5_cڋxt + +cڋxt +, +krb5_time�amp + +�c�ds +, + +6204 +krb5_�t32 + +mi�o�c�ds +); + +6217 +krb5_�r�_code + +KRB5_CALLCONV + + +6218 + `krb5_g�_time_off�ts +( +krb5_cڋxt + +cڋxt +, +krb5_time�amp + * +�c�ds +, +krb5_�t32 + * +mi�o�c�ds +); + +6229 +krb5_�r�_code + +KRB5_CALLCONV + + +6230 + `krb5_�r�g_to_��y� +(* +�r�g +, +krb5_��y� + * +��y�p +); + +6240 +krb5_�r�_code + +KRB5_CALLCONV + + +6241 + `krb5_�r�g_to_��ty� +(* +�r�g +, +krb5_�t32 + * +��ty�p +); + +6251 +krb5_�r�_code + +KRB5_CALLCONV + + +6252 + `krb5_�r�g_to_cksumty� +(* +�r�g +, +krb5_cksumty� + * +cksumty�p +); + +6262 +krb5_�r�_code + +KRB5_CALLCONV + + +6263 + `krb5_�r�g_to_time�amp +(* +�r�g +, +krb5_time�amp + * +time�am� +); + +6273 +krb5_�r�_code + +KRB5_CALLCONV + + +6274 + `krb5_�r�g_to_d��t +(* +�r�g +, +krb5_d��t + * +d��� +); + +6285 +krb5_�r�_code + +KRB5_CALLCONV + + +6286 + `krb5_��y�_to_�r�g +( +krb5_��y� + +��y� +, * +buf�r +, +size_t + +bu� +); + +6304 +krb5_�r�_code + +KRB5_CALLCONV + + +6305 + `krb5_��y�_to_�me +( +krb5_��y� + +��y� +, +krb5_boޗn + +sh܋� +, + +6306 * +buf�r +, +size_t + +bu� +); + +6317 +krb5_�r�_code + +KRB5_CALLCONV + + +6318 + `krb5_��ty�_to_�r�g +( +krb5_�t32 + +��ty� +, * +buf�r +, +size_t + +bu� +); + +6329 +krb5_�r�_code + +KRB5_CALLCONV + + +6330 + `krb5_cksumty�_to_�r�g +( +krb5_cksumty� + +cksumty� +, * +buf�r +, +size_t + +bu� +); + +6344 +krb5_�r�_code + +KRB5_CALLCONV + + +6345 + `krb5_time�amp_to_�r�g +( +krb5_time�amp + +time�amp +, * +buf�r +, +size_t + +bu� +); + +6361 +krb5_�r�_code + +KRB5_CALLCONV + + +6362 + `krb5_time�amp_to_sf�r�g +( +krb5_time�amp + +time�amp +, * +buf�r +, + +6363 +size_t + +bu� +, * +�d +); + +6374 +krb5_�r�_code + +KRB5_CALLCONV + + +6375 + `krb5_d��t_to_�r�g +( +krb5_d��t + +d��t +, * +buf�r +, +size_t + +bu� +); + +6378 + #KRB5_TGS_NAME + "krbtgt" + + ) + +6379 + #KRB5_TGS_NAME_SIZE + 6 + + ) + +6382 + #KRB5_RECVAUTH_SKIP_VERSION + 0x0001 + + ) + +6383 + #KRB5_RECVAUTH_BADAUTHVERS + 0x0002 + + ) + +6387 + s_krb5_�om� + { + +6388 * +�om� +; + +6389 +hidd� +; + +6390 +krb5_d�a + * +��y +; + +6391 } + tkrb5_�om� +; + +6394 +krb5_�r�_code + + +6395 ( + tKRB5_CALLCONV + * + tkrb5_�om��_f� +)( + tkrb5_cڋxt + + tcڋxt +, * + td�a +, + +6396 cڡ * + t�me +, cڡ * + tb��r +, + +6397 + tnum_�om�s +, + tkrb5_�om� + + t�om�s +[]); + +6424 +krb5_�r�_code + +KRB5_CALLCONV + + +6425 + `krb5_�om��_posix +( +krb5_cڋxt + +cڋxt +, * +d�a +, cڡ * +�me +, + +6426 cڡ * +b��r +, +num_�om�s +, + +6427 +krb5_�om� + +�om�s +[]); + +6437 + #KRB5_RESPONDER_QUESTION_PASSWORD + "�ssw�d" + + ) + +6474 + #KRB5_RESPONDER_QUESTION_OTP + "�p" + + ) + +6479 + #KRB5_RESPONDER_OTP_FORMAT_DECIMAL + 0 + + ) + +6480 + #KRB5_RESPONDER_OTP_FORMAT_HEXADECIMAL + 1 + + ) + +6481 + #KRB5_RESPONDER_OTP_FORMAT_ALPHANUMERIC + 2 + + ) + +6486 + #KRB5_RESPONDER_OTP_FLAGS_COLLECT_TOKEN + 0x0001 + + ) + +6491 + #KRB5_RESPONDER_OTP_FLAGS_COLLECT_PIN + 0x0002 + + ) + +6498 + #KRB5_RESPONDER_OTP_FLAGS_NEXTOTP + 0x0004 + + ) + +6507 + #KRB5_RESPONDER_OTP_FLAGS_SEPARATE_PIN + 0x0008 + + ) + +6533 + #KRB5_RESPONDER_QUESTION_PKINIT + "pk��" + + ) + +6539 + #KRB5_RESPONDER_PKINIT_FLAGS_TOKEN_USER_PIN_COUNT_LOW + (1 << 0) + + ) + +6545 + #KRB5_RESPONDER_PKINIT_FLAGS_TOKEN_USER_PIN_FINAL_TRY + (1 << 1) + + ) + +6551 + #KRB5_RESPONDER_PKINIT_FLAGS_TOKEN_USER_PIN_LOCKED + (1 << 2) + + ) + +6566 +krb5_���d�_cڋxt_� + * + tkrb5_���d�_cڋxt +; + +6582 cڡ * cڡ * +KRB5_CALLCONV + + +6583 + `krb5_���d�_li�_que�i�s +( +krb5_cڋxt + +�x +, +krb5_���d�_cڋxt + +r�x +); + +6601 cڡ * +KRB5_CALLCONV + + +6602 + `krb5_���d�_g�_ch��nge +( +krb5_cڋxt + +�x +, +krb5_���d�_cڋxt + +r�x +, + +6603 cڡ * +que�i� +); + +6620 +krb5_�r�_code + +KRB5_CALLCONV + + +6621 + `krb5_���d�_�t_�sw� +( +krb5_cڋxt + +�x +, +krb5_���d�_cڋxt + +r�x +, + +6622 cڡ * +que�i� +, cڡ * +�sw� +); + +6644 +krb5_�r�_code + + +6645 ( + tKRB5_CALLCONV + * + tkrb5_���d�_� +)( + tkrb5_cڋxt + + t�x +, * + td�a +, + +6646 + tkrb5_���d�_cڋxt + + tr�x +); + +6648 + s_krb5_���d�_�p_tok��fo + { + +6649 +krb5_�ags + +�ags +; + +6650 +krb5_�t32 + +f�m� +; + +6651 +krb5_�t32 + +�ngth +; + +6652 * +v�d� +; + +6653 * +ch��nge +; + +6654 * +tok�_id +; + +6655 * +�g_id +; + +6656 } + tkrb5_���d�_�p_tok��fo +; + +6658 + s_krb5_���d�_�p_ch��nge + { + +6659 * +�rvi� +; + +6660 +krb5_���d�_�p_tok��fo + ** +tok��fo +; + +6661 } + tkrb5_���d�_�p_ch��nge +; + +6680 +krb5_�r�_code + +KRB5_CALLCONV + + +6681 + `krb5_���d�_�p_g�_ch��nge +( +krb5_cڋxt + +�x +, + +6682 +krb5_���d�_cڋxt + +r�x +, + +6683 +krb5_���d�_�p_ch��nge + ** +chl +); + +6696 +krb5_�r�_code + +KRB5_CALLCONV + + +6697 + `krb5_���d�_�p_�t_�sw� +( +krb5_cڋxt + +�x +, +krb5_���d�_cڋxt + +r�x +, + +6698 +size_t + +ti +, cڡ * +v�ue +, cڡ * +p� +); + +6709 +KRB5_CALLCONV + + +6710 + `krb5_���d�_�p_ch��nge_� +( +krb5_cڋxt + +�x +, + +6711 +krb5_���d�_cڋxt + +r�x +, + +6712 +krb5_���d�_�p_ch��nge + * +chl +); + +6714 + s_krb5_���d�_pk��_id�t�y + { + +6715 * +id�t�y +; + +6716 +krb5_�t32 + +tok�_�ags +; + +6717 } + tkrb5_���d�_pk��_id�t�y +; + +6719 + s_krb5_���d�_pk��_ch��nge + { + +6720 +krb5_���d�_pk��_id�t�y + ** +id�t��s +; + +6721 } + tkrb5_���d�_pk��_ch��nge +; + +6740 +krb5_�r�_code + +KRB5_CALLCONV + + +6741 + `krb5_���d�_pk��_g�_ch��nge +( +krb5_cڋxt + +�x +, + +6742 +krb5_���d�_cڋxt + +r�x +, + +6743 +krb5_���d�_pk��_ch��nge + ** +chl_out +); + +6755 +krb5_�r�_code + +KRB5_CALLCONV + + +6756 + `krb5_���d�_pk��_�t_�sw� +( +krb5_cڋxt + +�x +, +krb5_���d�_cڋxt + +r�x +, + +6757 cڡ * +id�t�y +, cڡ * +p� +); + +6768 +KRB5_CALLCONV + + +6769 + `krb5_���d�_pk��_ch��nge_� +( +krb5_cڋxt + +�x +, + +6770 +krb5_���d�_cڋxt + +r�x +, + +6771 +krb5_���d�_pk��_ch��nge + * +chl +); + +6774 + s_krb5_g�_��_�eds_�t + { + +6775 +krb5_�ags + +�ags +; + +6776 +krb5_d��t + +tkt_li� +; + +6777 +krb5_d��t + +��w_li� +; + +6778 +f�w�dab� +; + +6779 +�ox�b� +; + +6780 +krb5_��y� + * +�y�_li� +; + +6781 +�y�_li�_�ngth +; + +6782 +krb5_add�ss + ** +add�ss_li� +; + +6783 +krb5_��uthty� + * +��uth_li� +; + +6784 +��uth_li�_�ngth +; + +6785 +krb5_d�a + * +�� +; + +6786 } + tkrb5_g�_��_�eds_�t +; + +6788 + #KRB5_GET_INIT_CREDS_OPT_TKT_LIFE + 0x0001 + + ) + +6789 + #KRB5_GET_INIT_CREDS_OPT_RENEW_LIFE + 0x0002 + + ) + +6790 + #KRB5_GET_INIT_CREDS_OPT_FORWARDABLE + 0x0004 + + ) + +6791 + #KRB5_GET_INIT_CREDS_OPT_PROXIABLE + 0x0008 + + ) + +6792 + #KRB5_GET_INIT_CREDS_OPT_ETYPE_LIST + 0x0010 + + ) + +6793 + #KRB5_GET_INIT_CREDS_OPT_ADDRESS_LIST + 0x0020 + + ) + +6794 + #KRB5_GET_INIT_CREDS_OPT_PREAUTH_LIST + 0x0040 + + ) + +6795 + #KRB5_GET_INIT_CREDS_OPT_SALT + 0x0080 + + ) + +6796 + #KRB5_GET_INIT_CREDS_OPT_CHG_PWD_PRMPT + 0x0100 + + ) + +6797 + #KRB5_GET_INIT_CREDS_OPT_CANONICALIZE + 0x0200 + + ) + +6798 + #KRB5_GET_INIT_CREDS_OPT_ANONYMOUS + 0x0400 + + ) + +6814 +krb5_�r�_code + +KRB5_CALLCONV + + +6815 + `krb5_g�_��_�eds_�t_�loc +( +krb5_cڋxt + +cڋxt +, + +6816 +krb5_g�_��_�eds_�t + ** +�t +); + +6826 +KRB5_CALLCONV + + +6827 + `krb5_g�_��_�eds_�t_� +( +krb5_cڋxt + +cڋxt +, + +6828 +krb5_g�_��_�eds_�t + * +�t +); + +6831 +KRB5_CALLCONV + + +6832 + `krb5_g�_��_�eds_�t_�� +( +krb5_g�_��_�eds_�t + * +�t +); + +6840 +KRB5_CALLCONV + + +6841 + `krb5_g�_��_�eds_�t_�t_tkt_li� +( +krb5_g�_��_�eds_�t + * +�t +, + +6842 +krb5_d��t + +tkt_li� +); + +6850 +KRB5_CALLCONV + + +6851 + `krb5_g�_��_�eds_�t_�t_��w_li� +( +krb5_g�_��_�eds_�t + * +�t +, + +6852 +krb5_d��t + +��w_li� +); + +6860 +KRB5_CALLCONV + + +6861 + `krb5_g�_��_�eds_�t_�t_f�w�dab� +( +krb5_g�_��_�eds_�t + * +�t +, + +6862 +f�w�dab� +); + +6870 +KRB5_CALLCONV + + +6871 + `krb5_g�_��_�eds_�t_�t_�ox�b� +( +krb5_g�_��_�eds_�t + * +�t +, + +6872 +�ox�b� +); + +6880 +KRB5_CALLCONV + + +6881 + `krb5_g�_��_�eds_�t_�t_�n�i�lize +( +krb5_g�_��_�eds_�t + * +�t +, + +6882 +�n�i�lize +); + +6895 +KRB5_CALLCONV + + +6896 + `krb5_g�_��_�eds_�t_�t_��ymous +( +krb5_g�_��_�eds_�t + * +�t +, + +6897 +��ymous +); + +6906 +KRB5_CALLCONV + + +6907 + `krb5_g�_��_�eds_�t_�t_�y�_li� +( +krb5_g�_��_�eds_�t + * +�t +, + +6908 +krb5_��y� + * +�y�_li� +, + +6909 +�y�_li�_�ngth +); + +6917 +KRB5_CALLCONV + + +6918 + `krb5_g�_��_�eds_�t_�t_add�ss_li� +( +krb5_g�_��_�eds_�t + * +�t +, + +6919 +krb5_add�ss + ** +add�s�s +); + +6932 +KRB5_CALLCONV + + +6933 + `krb5_g�_��_�eds_�t_�t_��uth_li� +( +krb5_g�_��_�eds_�t + * +�t +, + +6934 +krb5_��uthty� + * +��uth_li� +, + +6935 +��uth_li�_�ngth +); + +6948 +KRB5_CALLCONV + + +6949 + `krb5_g�_��_�eds_�t_�t_�� +( +krb5_g�_��_�eds_�t + * +�t +, + +6950 +krb5_d�a + * +�� +); + +6962 +KRB5_CALLCONV + + +6963 + `krb5_g�_��_�eds_�t_�t_ch�ge_�ssw�d_�om� +( +krb5_g�_��_�eds_�t + * +�t +, + +6964 +�om� +); + +6967 + s_krb5_gic_�t_�_d�a + { + +6968 * +�� +; + +6969 * +v�ue +; + +6970 } + tkrb5_gic_�t_�_d�a +; + +6984 +krb5_�r�_code + +KRB5_CALLCONV + + +6985 + `krb5_g�_��_�eds_�t_�t_� +( +krb5_cڋxt + +cڋxt +, + +6986 +krb5_g�_��_�eds_�t + * +�t +, cڡ * +�� +, + +6987 cڡ * +v�ue +); + +7004 +krb5_�r�_code + +KRB5_CALLCONV + + +7005 + `krb5_g�_��_�eds_�t_�t_�_c�che_�me +( +krb5_cڋxt + +cڋxt +, + +7006 +krb5_g�_��_�eds_�t + * +�t +, + +7007 cڡ * +�_c�che_�me +); + +7021 +krb5_�r�_code + +KRB5_CALLCONV + + +7022 + `krb5_g�_��_�eds_�t_�t_�_c�che +( +krb5_cڋxt + +cڋxt +, + +7023 +krb5_g�_��_�eds_�t + * +�t +, + +7024 +krb5_c�che + +c�che +); + +7042 +krb5_�r�_code + +KRB5_CALLCONV + + +7043 + `krb5_g�_��_�eds_�t_�t_�_c�che +( +krb5_cڋxt + +cڋxt +, + +7044 +krb5_g�_��_�eds_�t + * +�t +, + +7045 +krb5_c�che + +c�che +); + +7060 +krb5_�r�_code + +KRB5_CALLCONV + + +7061 + `krb5_g�_��_�eds_�t_�t_out_c�che +( +krb5_cڋxt + +cڋxt +, + +7062 +krb5_g�_��_�eds_�t + * +�t +, + +7063 +krb5_c�che + +c�che +); + +7078 +krb5_�r�_code + +KRB5_CALLCONV + + +7079 + `krb5_g�_��_�eds_�t_�t_�_�ags +( +krb5_cڋxt + +cڋxt +, + +7080 +krb5_g�_��_�eds_�t + * +�t +, + +7081 +krb5_�ags + +�ags +); + +7093 +krb5_�r�_code + +KRB5_CALLCONV + + +7094 + `krb5_g�_��_�eds_�t_g�_�_�ags +( +krb5_cڋxt + +cڋxt +, + +7095 +krb5_g�_��_�eds_�t + * +�t +, + +7096 +krb5_�ags + * +out_�ags +); + +7099 + #KRB5_FAST_REQUIRED + 0x0001 + + ) + +7102 ( + tKRB5_CALLCONV + * + tkrb5_exp�e_��back_func +)( + tkrb5_cڋxt + + tcڋxt +, * + td�a +, + +7103 + tkrb5_time�amp + + t�ssw�d_exp��i� +, + +7104 + tkrb5_time�amp + + taccou�_exp��i� +, + +7105 + tkrb5_boޗn + + tis_ϡ_�q +); + +7146 +krb5_�r�_code + +KRB5_CALLCONV + + +7147 + `krb5_g�_��_�eds_�t_�t_exp�e_��back +( +krb5_cڋxt + +cڋxt +, + +7148 +krb5_g�_��_�eds_�t + * +�t +, + +7149 +krb5_exp�e_��back_func + +cb +, + +7150 * +d�a +); + +7162 +krb5_�r�_code + +KRB5_CALLCONV + + +7163 + `krb5_g�_��_�eds_�t_�t_���d� +( +krb5_cڋxt + +cڋxt +, + +7164 +krb5_g�_��_�eds_�t + * +�t +, + +7165 +krb5_���d�_� + +���d� +, * +d�a +); + +7211 +krb5_�r�_code + +KRB5_CALLCONV + + +7212 + `krb5_g�_��_�eds_�ssw�d +( +krb5_cڋxt + +cڋxt +, +krb5_�eds + * +�eds +, + +7213 +krb5_��c�� + +��� +, cڡ * +�ssw�d +, + +7214 +krb5_�om��_f� + +�om�� +, * +d�a +, + +7215 +krb5_d��t + +��t_time +, + +7216 cڡ * +�_tkt_�rvi� +, + +7217 +krb5_g�_��_�eds_�t + * +k5_gic_�ti�s +); + +7219 +_krb5_��_�eds_cڋxt +; + +7220 +_krb5_��_�eds_cڋxt + * + tkrb5_��_�eds_cڋxt +; + +7222 + #KRB5_INIT_CREDS_STEP_FLAG_CONTINUE + 0x1 + + ) + +7230 +KRB5_CALLCONV + + +7231 + `krb5_��_�eds_� +( +krb5_cڋxt + +cڋxt +, +krb5_��_�eds_cڋxt + +�x +); + +7245 +krb5_�r�_code + +KRB5_CALLCONV + + +7246 + `krb5_��_�eds_g� +( +krb5_cڋxt + +cڋxt +, +krb5_��_�eds_cڋxt + +�x +); + +7262 +krb5_�r�_code + +KRB5_CALLCONV + + +7263 + `krb5_��_�eds_g�_�eds +( +krb5_cڋxt + +cڋxt +, +krb5_��_�eds_cڋxt + +�x +, + +7264 +krb5_�eds + * +�eds +); + +7275 +krb5_�r�_code + +KRB5_CALLCONV + + +7276 + `krb5_��_�eds_g�_�r� +( +krb5_cڋxt + +cڋxt +, +krb5_��_�eds_cڋxt + +�x +, + +7277 +krb5_�r� + ** +�r� +); + +7295 +krb5_�r�_code + +KRB5_CALLCONV + + +7296 + `krb5_��_�eds_�� +( +krb5_cڋxt + +cڋxt +, +krb5_��c�� + +��� +, + +7297 +krb5_�om��_f� + +�om�� +, * +d�a +, + +7298 +krb5_d��t + +��t_time +, +krb5_g�_��_�eds_�t + * +�ti�s +, + +7299 +krb5_��_�eds_cڋxt + * +�x +); + +7313 +krb5_�r�_code + +KRB5_CALLCONV + + +7314 + `krb5_��_�eds_�t_key�b +( +krb5_cڋxt + +cڋxt +, +krb5_��_�eds_cڋxt + +�x +, + +7315 +krb5_key�b + +key�b +); + +7344 +krb5_�r�_code + +KRB5_CALLCONV + + +7345 + `krb5_��_�eds_�� +( +krb5_cڋxt + +cڋxt +, +krb5_��_�eds_cڋxt + +�x +, + +7346 +krb5_d�a + * +� +, krb5_d��* +out +, krb5_d��* +��m +, + +7347 * +�ags +); + +7361 +krb5_�r�_code + +KRB5_CALLCONV + + +7362 + `krb5_��_�eds_�t_�ssw�d +( +krb5_cڋxt + +cڋxt +, +krb5_��_�eds_cڋxt + +�x +, + +7363 cڡ * +�ssw�d +); + +7378 +krb5_�r�_code + +KRB5_CALLCONV + + +7379 + `krb5_��_�eds_�t_�rvi� +( +krb5_cڋxt + +cڋxt +, +krb5_��_�eds_cڋxt + +�x +, + +7380 cڡ * +�rvi� +); + +7394 +krb5_�r�_code + +KRB5_CALLCONV + + +7395 + `krb5_��_�eds_g�_times +( +krb5_cڋxt + +cڋxt +, +krb5_��_�eds_cڋxt + +�x +, + +7396 +krb5_tick�_times + * +times +); + +7398 +_krb5_tkt_�eds_cڋxt +; + +7399 +_krb5_tkt_�eds_cڋxt + * + tkrb5_tkt_�eds_cڋxt +; + +7425 +krb5_�r�_code + +KRB5_CALLCONV + + +7426 + `krb5_tkt_�eds_�� +( +krb5_cڋxt + +cڋxt +, +krb5_c�che + +c�che +, + +7427 +krb5_�eds + * +�eds +, +krb5_�ags + +�ti�s +, + +7428 +krb5_tkt_�eds_cڋxt + * +�x +); + +7444 +krb5_�r�_code + +KRB5_CALLCONV + + +7445 + `krb5_tkt_�eds_g� +( +krb5_cڋxt + +cڋxt +, +krb5_tkt_�eds_cڋxt + +�x +); + +7463 +krb5_�r�_code + +KRB5_CALLCONV + + +7464 + `krb5_tkt_�eds_g�_�eds +( +krb5_cڋxt + +cڋxt +, +krb5_tkt_�eds_cڋxt + +�x +, + +7465 +krb5_�eds + * +�eds +); + +7475 +KRB5_CALLCONV + + +7476 + `krb5_tkt_�eds_� +( +krb5_cڋxt + +cڋxt +, +krb5_tkt_�eds_cڋxt + +�x +); + +7478 + #KRB5_TKT_CREDS_STEP_FLAG_CONTINUE + 0x1 + + ) + +7508 +krb5_�r�_code + +KRB5_CALLCONV + + +7509 + `krb5_tkt_�eds_�� +( +krb5_cڋxt + +cڋxt +, +krb5_tkt_�eds_cڋxt + +�x +, + +7510 +krb5_d�a + * +� +, krb5_d��* +out +, krb5_d��* +��m +, + +7511 * +�ags +); + +7527 +krb5_�r�_code + +KRB5_CALLCONV + + +7528 + `krb5_tkt_�eds_g�_times +( +krb5_cڋxt + +cڋxt +, +krb5_tkt_�eds_cڋxt + +�x +, + +7529 +krb5_tick�_times + * +times +); + +7555 +krb5_�r�_code + +KRB5_CALLCONV + + +7556 + `krb5_g�_��_�eds_key�b +( +krb5_cڋxt + +cڋxt +, +krb5_�eds + * +�eds +, + +7557 +krb5_��c�� + +��� +, +krb5_key�b + +�g_key�b +, + +7558 +krb5_d��t + +��t_time +, cڡ * +�_tkt_�rvi� +, + +7559 +krb5_g�_��_�eds_�t + * +k5_gic_�ti�s +); + +7561 + s_krb5_v�ify_��_�eds_�t + { + +7562 +krb5_�ags + +�ags +; + +7563 +�_�q_no� +; + +7564 } + tkrb5_v�ify_��_�eds_�t +; + +7566 + #KRB5_VERIFY_INIT_CREDS_OPT_AP_REQ_NOFAIL + 0x0001 + + ) + +7573 +KRB5_CALLCONV + + +7574 + `krb5_v�ify_��_�eds_�t_�� +( +krb5_v�ify_��_�eds_�t + * +k5_vic_�ti�s +); + +7591 +KRB5_CALLCONV + + +7592 + `krb5_v�ify_��_�eds_�t_�t_�_�q_no� +( +krb5_v�ify_��_�eds_�t + * +k5_vic_�ti�s +, + +7593 +�_�q_no� +); + +7626 +krb5_�r�_code + +KRB5_CALLCONV + + +7627 + `krb5_v�ify_��_�eds +( +krb5_cڋxt + +cڋxt +, +krb5_�eds + * +�eds +, + +7628 +krb5_��c�� + +�rv� +, +krb5_key�b + +key�b +, + +7629 +krb5_c�che + * +c�che +, + +7630 +krb5_v�ify_��_�eds_�t + * +�ti�s +); + +7665 +krb5_�r�_code + +KRB5_CALLCONV + + +7666 + `krb5_g�_v�id�ed_�eds +( +krb5_cڋxt + +cڋxt +, +krb5_�eds + * +�eds +, + +7667 +krb5_��c�� + +��� +, +krb5_c�che + +c�che +, + +7668 cڡ * +�_tkt_�rvi� +); + +7691 +krb5_�r�_code + +KRB5_CALLCONV + + +7692 + `krb5_g�_��wed_�eds +( +krb5_cڋxt + +cڋxt +, +krb5_�eds + * +�eds +, + +7693 +krb5_��c�� + +��� +, +krb5_c�che + +c�che +, + +7694 cڡ * +�_tkt_�rvi� +); + +7704 +krb5_�r�_code + +KRB5_CALLCONV + + +7705 + `krb5_decode_tick� +(cڡ +krb5_d�a + * +code +, +krb5_tick� + ** +�p +); + +7722 +KRB5_CALLCONV + + +7723 + `krb5_�pde�u�_�r�g +( +krb5_cڋxt + +cڋxt +, cڡ * +��ame +, + +7724 cڡ +krb5_d�a + * +��m +, cڡ * +�ti� +, + +7725 cڡ * +de�u�_v�ue +, ** +�t_v�ue +); + +7742 +KRB5_CALLCONV + + +7743 + `krb5_�pde�u�_boޗn +( +krb5_cڋxt + +cڋxt +, cڡ * +��ame +, + +7744 cڡ +krb5_d�a + * +��m +, cڡ * +�ti� +, + +7745 +de�u�_v�ue +, * +�t_v�ue +); + +7751 + #KRB5_PROMPT_TYPE_PASSWORD + 0x1 + + ) + +7753 + #KRB5_PROMPT_TYPE_NEW_PASSWORD + 0x2 + + ) + +7755 + #KRB5_PROMPT_TYPE_NEW_PASSWORD_AGAIN + 0x3 + + ) + +7757 + #KRB5_PROMPT_TYPE_PREAUTH + 0x4 + + ) + +7759 +krb5_�t32 + + tkrb5_�om�_ty� +; + +7774 +krb5_�om�_ty� +* +KRB5_CALLCONV + + +7775 + `krb5_g�_�om�_ty�s +( +krb5_cڋxt + +cڋxt +); + +7786 +KRB5_CALLCONV_C + + +7787 + $krb5_�t_�r�_mes�ge +( +krb5_cڋxt + +�x +, +krb5_�r�_code + +code +, cڡ * +fmt +, ...) + +7788 #i�! + `def�ed +( +__�lu�lus +�&& ( +__GNUC__ + > 2) + +7789 + `__��ibu�__ +(( + $__f�m�__ +( +__��tf__ +, 3, 4))) + +7801 +KRB5_CALLCONV + + +7802 + $krb5_v�t_�r�_mes�ge +( +krb5_cڋxt + +�x +, +krb5_�r�_code + +code +, + +7803 cڡ * +fmt +, +va_li� + +�gs +) + +7804 #i�! + `def�ed +( +__�lu�lus +�&& ( +__GNUC__ + > 2) + +7805 + `__��ibu�__ +(( + $__f�m�__ +( +__��tf__ +, 3, 0))) + +7815 +KRB5_CALLCONV + + +7816 + `krb5_c�y_�r�_mes�ge +( +krb5_cڋxt + +de�_�x +, krb5_cڋx� +�c_�x +); + +7838 cڡ * +KRB5_CALLCONV + + +7839 + `krb5_g�_�r�_mes�ge +( +krb5_cڋxt + +�x +, +krb5_�r�_code + +code +); + +7847 +KRB5_CALLCONV + + +7848 + `krb5_�_�r�_mes�ge +( +krb5_cڋxt + +�x +, cڡ * +msg +); + +7858 +KRB5_CALLCONV + + +7859 + `krb5_��r_�r�_mes�ge +( +krb5_cڋxt + +�x +); + +7873 +krb5_�r�_code + +KRB5_CALLCONV + + +7874 + `krb5_decode_authd�a_cڏ�� +( +krb5_cڋxt + +cڋxt +, + +7875 +krb5_authd��y� + +ty� +, + +7876 cڡ +krb5_authd�a + * +cڏ�� +, + +7877 +krb5_authd�a + *** +authd�a +); + +7892 +krb5_�r�_code + +KRB5_CALLCONV + + +7893 + `krb5_�code_authd�a_cڏ�� +( +krb5_cڋxt + +cڋxt +, + +7894 +krb5_authd��y� + +ty� +, + +7895 +krb5_authd�a + * cڡ* +authd�a +, + +7896 +krb5_authd�a + *** +cڏ�� +); + +7914 +krb5_�r�_code + +KRB5_CALLCONV + + +7915 + `krb5_make_authd�a_kdc_issued +( +krb5_cڋxt + +cڋxt +, + +7916 cڡ +krb5_keyblock + * +key +, + +7917 +krb5_cڡ_��c�� + +issu� +, + +7918 +krb5_authd�a + *cڡ * +authd�a +, + +7919 +krb5_authd�a + *** +ad_kdcissued +); + +7935 +krb5_�r�_code + +KRB5_CALLCONV + + +7936 + `krb5_v�ify_authd�a_kdc_issued +( +krb5_cڋxt + +cڋxt +, + +7937 cڡ +krb5_keyblock + * +key +, + +7938 cڡ +krb5_authd�a + * +ad_kdcissued +, + +7939 +krb5_��c�� + * +issu� +, + +7940 +krb5_authd�a + *** +authd�a +); + +7947 + #KRB5_PAC_LOGON_INFO + 1 + + ) + +7948 + #KRB5_PAC_CREDENTIALS_INFO + 2 + + ) + +7949 + #KRB5_PAC_SERVER_CHECKSUM + 6 + + ) + +7950 + #KRB5_PAC_PRIVSVR_CHECKSUM + 7 + + ) + +7951 + #KRB5_PAC_CLIENT_INFO + 10 + + ) + +7952 + #KRB5_PAC_DELEGATION_INFO + 11 + + ) + +7953 + #KRB5_PAC_UPN_DNS_INFO + 12 + + ) + +7955 +krb5_�c_d�a +; + +7957 +krb5_�c_d�a + * + tkrb5_�c +; + +7981 +krb5_�r�_code + +KRB5_CALLCONV + + +7982 + `krb5_�c_add_buf�r +( +krb5_cڋxt + +cڋxt +, +krb5_�c + +�c +, +krb5_ui_4 + +ty� +, + +7983 cڡ +krb5_d�a + * +d�a +); + +7993 +KRB5_CALLCONV + + +7994 + `krb5_�c_� +( +krb5_cڋxt + +cڋxt +, +krb5_�c + +�c +); + +8008 +krb5_�r�_code + +KRB5_CALLCONV + + +8009 + `krb5_�c_g�_buf�r +( +krb5_cڋxt + +cڋxt +, +krb5_�c + +�c +, +krb5_ui_4 + +ty� +, + +8010 +krb5_d�a + * +d�a +); + +8022 +krb5_�r�_code + +KRB5_CALLCONV + + +8023 + `krb5_�c_g�_ty�s +( +krb5_cڋxt + +cڋxt +, +krb5_�c + +�c +, +size_t + * +�n +, + +8024 +krb5_ui_4 + ** +ty�s +); + +8036 +krb5_�r�_code + +KRB5_CALLCONV + + +8037 + `krb5_�c_�� +( +krb5_cڋxt + +cڋxt +, +krb5_�c + * +�c +); + +8051 +krb5_�r�_code + +KRB5_CALLCONV + + +8052 + `krb5_�c_�r� +( +krb5_cڋxt + +cڋxt +, cڡ * +�r +, +size_t + +�n +, + +8053 +krb5_�c + * +�c +); + +8081 +krb5_�r�_code + +KRB5_CALLCONV + + +8082 + `krb5_�c_v�ify +( +krb5_cڋxt + +cڋxt +, cڡ +krb5_�c + +�c +, + +8083 +krb5_time�amp + +authtime +, +krb5_cڡ_��c�� + +��c�� +, + +8084 cڡ +krb5_keyblock + * +�rv� +, cڡ krb5_keyblock * +�ivsvr +); + +8104 +krb5_�r�_code + +KRB5_CALLCONV + + +8105 + `krb5_�c_sign +( +krb5_cڋxt + +cڋxt +, +krb5_�c + +�c +, +krb5_time�amp + +authtime +, + +8106 +krb5_cڡ_��c�� + +��c�� +, cڡ +krb5_keyblock + * +�rv�_key +, + +8107 cڡ +krb5_keyblock + * +�ivsvr_key +, +krb5_d�a + * +d�a +); + +8120 +krb5_�r�_code + +KRB5_CALLCONV + + +8121 + `krb5_�low_w�k_�y�o +( +krb5_cڋxt + +cڋxt +, +krb5_boޗn + +�ab� +); + +8130 + s_krb5_�a�_�fo + { + +8131 cڡ * +mes�ge +; + +8132 } + tkrb5_�a�_�fo +; + +8135 ( + tKRB5_CALLCONV + * + tkrb5_�a�_��back +)( + tkrb5_cڋxt + + tcڋxt +, + +8136 cڡ + tkrb5_�a�_�fo + * + t�fo +, + +8137 * + tcb_d�a +); + +8162 +krb5_�r�_code + +KRB5_CALLCONV + + +8163 + `krb5_�t_�a�_��back +( +krb5_cڋxt + +cڋxt +, +krb5_�a�_��back + +� +, + +8164 * +cb_d�a +); + +8182 +krb5_�r�_code + +KRB5_CALLCONV + + +8183 + `krb5_�t_�a�_f��ame +( +krb5_cڋxt + +cڋxt +, cڡ * +f��ame +); + +8185 #i� +TARGET_OS_MAC + + +8186 #�agm� + `�ck +( +p� +) + +8189 +KRB5INT_END_DECLS + + +8193 + #krb5_cڡ + cڡ + + ) + +8195 #unde� +KRB5_ATTR_DEPRECATED + + +8205 + ~<�/com_�r.h +> + +8207 + #KRB5KDC_ERR_NONE + (-1765328384L) + + ) + +8208 + #KRB5KDC_ERR_NAME_EXP + (-1765328383L) + + ) + +8209 + #KRB5KDC_ERR_SERVICE_EXP + (-1765328382L) + + ) + +8210 + #KRB5KDC_ERR_BAD_PVNO + (-1765328381L) + + ) + +8211 + #KRB5KDC_ERR_C_OLD_MAST_KVNO + (-1765328380L) + + ) + +8212 + #KRB5KDC_ERR_S_OLD_MAST_KVNO + (-1765328379L) + + ) + +8213 + #KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN + (-1765328378L) + + ) + +8214 + #KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN + (-1765328377L) + + ) + +8215 + #KRB5KDC_ERR_PRINCIPAL_NOT_UNIQUE + (-1765328376L) + + ) + +8216 + #KRB5KDC_ERR_NULL_KEY + (-1765328375L) + + ) + +8217 + #KRB5KDC_ERR_CANNOT_POSTDATE + (-1765328374L) + + ) + +8218 + #KRB5KDC_ERR_NEVER_VALID + (-1765328373L) + + ) + +8219 + #KRB5KDC_ERR_POLICY + (-1765328372L) + + ) + +8220 + #KRB5KDC_ERR_BADOPTION + (-1765328371L) + + ) + +8221 + #KRB5KDC_ERR_ETYPE_NOSUPP + (-1765328370L) + + ) + +8222 + #KRB5KDC_ERR_SUMTYPE_NOSUPP + (-1765328369L) + + ) + +8223 + #KRB5KDC_ERR_PADATA_TYPE_NOSUPP + (-1765328368L) + + ) + +8224 + #KRB5KDC_ERR_TRTYPE_NOSUPP + (-1765328367L) + + ) + +8225 + #KRB5KDC_ERR_CLIENT_REVOKED + (-1765328366L) + + ) + +8226 + #KRB5KDC_ERR_SERVICE_REVOKED + (-1765328365L) + + ) + +8227 + #KRB5KDC_ERR_TGT_REVOKED + (-1765328364L) + + ) + +8228 + #KRB5KDC_ERR_CLIENT_NOTYET + (-1765328363L) + + ) + +8229 + #KRB5KDC_ERR_SERVICE_NOTYET + (-1765328362L) + + ) + +8230 + #KRB5KDC_ERR_KEY_EXP + (-1765328361L) + + ) + +8231 + #KRB5KDC_ERR_PREAUTH_FAILED + (-1765328360L) + + ) + +8232 + #KRB5KDC_ERR_PREAUTH_REQUIRED + (-1765328359L) + + ) + +8233 + #KRB5KDC_ERR_SERVER_NOMATCH + (-1765328358L) + + ) + +8234 + #KRB5KDC_ERR_MUST_USE_USER2USER + (-1765328357L) + + ) + +8235 + #KRB5KDC_ERR_PATH_NOT_ACCEPTED + (-1765328356L) + + ) + +8236 + #KRB5KDC_ERR_SVC_UNAVAILABLE + (-1765328355L) + + ) + +8237 + #KRB5PLACEHOLD_30 + (-1765328354L) + + ) + +8238 + #KRB5KRB_AP_ERR_BAD_INTEGRITY + (-1765328353L) + + ) + +8239 + #KRB5KRB_AP_ERR_TKT_EXPIRED + (-1765328352L) + + ) + +8240 + #KRB5KRB_AP_ERR_TKT_NYV + (-1765328351L) + + ) + +8241 + #KRB5KRB_AP_ERR_REPEAT + (-1765328350L) + + ) + +8242 + #KRB5KRB_AP_ERR_NOT_US + (-1765328349L) + + ) + +8243 + #KRB5KRB_AP_ERR_BADMATCH + (-1765328348L) + + ) + +8244 + #KRB5KRB_AP_ERR_SKEW + (-1765328347L) + + ) + +8245 + #KRB5KRB_AP_ERR_BADADDR + (-1765328346L) + + ) + +8246 + #KRB5KRB_AP_ERR_BADVERSION + (-1765328345L) + + ) + +8247 + #KRB5KRB_AP_ERR_MSG_TYPE + (-1765328344L) + + ) + +8248 + #KRB5KRB_AP_ERR_MODIFIED + (-1765328343L) + + ) + +8249 + #KRB5KRB_AP_ERR_BADORDER + (-1765328342L) + + ) + +8250 + #KRB5KRB_AP_ERR_ILL_CR_TKT + (-1765328341L) + + ) + +8251 + #KRB5KRB_AP_ERR_BADKEYVER + (-1765328340L) + + ) + +8252 + #KRB5KRB_AP_ERR_NOKEY + (-1765328339L) + + ) + +8253 + #KRB5KRB_AP_ERR_MUT_FAIL + (-1765328338L) + + ) + +8254 + #KRB5KRB_AP_ERR_BADDIRECTION + (-1765328337L) + + ) + +8255 + #KRB5KRB_AP_ERR_METHOD + (-1765328336L) + + ) + +8256 + #KRB5KRB_AP_ERR_BADSEQ + (-1765328335L) + + ) + +8257 + #KRB5KRB_AP_ERR_INAPP_CKSUM + (-1765328334L) + + ) + +8258 + #KRB5KRB_AP_PATH_NOT_ACCEPTED + (-1765328333L) + + ) + +8259 + #KRB5KRB_ERR_RESPONSE_TOO_BIG + (-1765328332L) + + ) + +8260 + #KRB5PLACEHOLD_53 + (-1765328331L) + + ) + +8261 + #KRB5PLACEHOLD_54 + (-1765328330L) + + ) + +8262 + #KRB5PLACEHOLD_55 + (-1765328329L) + + ) + +8263 + #KRB5PLACEHOLD_56 + (-1765328328L) + + ) + +8264 + #KRB5PLACEHOLD_57 + (-1765328327L) + + ) + +8265 + #KRB5PLACEHOLD_58 + (-1765328326L) + + ) + +8266 + #KRB5PLACEHOLD_59 + (-1765328325L) + + ) + +8267 + #KRB5KRB_ERR_GENERIC + (-1765328324L) + + ) + +8268 + #KRB5KRB_ERR_FIELD_TOOLONG + (-1765328323L) + + ) + +8269 + #KRB5KDC_ERR_CLIENT_NOT_TRUSTED + (-1765328322L) + + ) + +8270 + #KRB5KDC_ERR_KDC_NOT_TRUSTED + (-1765328321L) + + ) + +8271 + #KRB5KDC_ERR_INVALID_SIG + (-1765328320L) + + ) + +8272 + #KRB5KDC_ERR_DH_KEY_PARAMETERS_NOT_ACCEPTED + (-1765328319L) + + ) + +8273 + #KRB5KDC_ERR_CERTIFICATE_MISMATCH + (-1765328318L) + + ) + +8274 + #KRB5KRB_AP_ERR_NO_TGT + (-1765328317L) + + ) + +8275 + #KRB5KDC_ERR_WRONG_REALM + (-1765328316L) + + ) + +8276 + #KRB5KRB_AP_ERR_USER_TO_USER_REQUIRED + (-1765328315L) + + ) + +8277 + #KRB5KDC_ERR_CANT_VERIFY_CERTIFICATE + (-1765328314L) + + ) + +8278 + #KRB5KDC_ERR_INVALID_CERTIFICATE + (-1765328313L) + + ) + +8279 + #KRB5KDC_ERR_REVOKED_CERTIFICATE + (-1765328312L) + + ) + +8280 + #KRB5KDC_ERR_REVOCATION_STATUS_UNKNOWN + (-1765328311L) + + ) + +8281 + #KRB5KDC_ERR_REVOCATION_STATUS_UNAVAILABLE + (-1765328310L) + + ) + +8282 + #KRB5KDC_ERR_CLIENT_NAME_MISMATCH + (-1765328309L) + + ) + +8283 + #KRB5KDC_ERR_KDC_NAME_MISMATCH + (-1765328308L) + + ) + +8284 + #KRB5KDC_ERR_INCONSISTENT_KEY_PURPOSE + (-1765328307L) + + ) + +8285 + #KRB5KDC_ERR_DIGEST_IN_CERT_NOT_ACCEPTED + (-1765328306L) + + ) + +8286 + #KRB5KDC_ERR_PA_CHECKSUM_MUST_BE_INCLUDED + (-1765328305L) + + ) + +8287 + #KRB5KDC_ERR_DIGEST_IN_SIGNED_DATA_NOT_ACCEPTED + (-1765328304L) + + ) + +8288 + #KRB5KDC_ERR_PUBLIC_KEY_ENCRYPTION_NOT_SUPPORTED + (-1765328303L) + + ) + +8289 + #KRB5PLACEHOLD_82 + (-1765328302L) + + ) + +8290 + #KRB5PLACEHOLD_83 + (-1765328301L) + + ) + +8291 + #KRB5PLACEHOLD_84 + (-1765328300L) + + ) + +8292 + #KRB5KRB_AP_ERR_IAKERB_KDC_NOT_FOUND + (-1765328299L) + + ) + +8293 + #KRB5KRB_AP_ERR_IAKERB_KDC_NO_RESPONSE + (-1765328298L) + + ) + +8294 + #KRB5PLACEHOLD_87 + (-1765328297L) + + ) + +8295 + #KRB5PLACEHOLD_88 + (-1765328296L) + + ) + +8296 + #KRB5PLACEHOLD_89 + (-1765328295L) + + ) + +8297 + #KRB5PLACEHOLD_90 + (-1765328294L) + + ) + +8298 + #KRB5PLACEHOLD_91 + (-1765328293L) + + ) + +8299 + #KRB5PLACEHOLD_92 + (-1765328292L) + + ) + +8300 + #KRB5KDC_ERR_UNKNOWN_CRITICAL_FAST_OPTION + (-1765328291L) + + ) + +8301 + #KRB5PLACEHOLD_94 + (-1765328290L) + + ) + +8302 + #KRB5PLACEHOLD_95 + (-1765328289L) + + ) + +8303 + #KRB5PLACEHOLD_96 + (-1765328288L) + + ) + +8304 + #KRB5PLACEHOLD_97 + (-1765328287L) + + ) + +8305 + #KRB5PLACEHOLD_98 + (-1765328286L) + + ) + +8306 + #KRB5PLACEHOLD_99 + (-1765328285L) + + ) + +8307 + #KRB5KDC_ERR_NO_ACCEPTABLE_KDF + (-1765328284L) + + ) + +8308 + #KRB5PLACEHOLD_101 + (-1765328283L) + + ) + +8309 + #KRB5PLACEHOLD_102 + (-1765328282L) + + ) + +8310 + #KRB5PLACEHOLD_103 + (-1765328281L) + + ) + +8311 + #KRB5PLACEHOLD_104 + (-1765328280L) + + ) + +8312 + #KRB5PLACEHOLD_105 + (-1765328279L) + + ) + +8313 + #KRB5PLACEHOLD_106 + (-1765328278L) + + ) + +8314 + #KRB5PLACEHOLD_107 + (-1765328277L) + + ) + +8315 + #KRB5PLACEHOLD_108 + (-1765328276L) + + ) + +8316 + #KRB5PLACEHOLD_109 + (-1765328275L) + + ) + +8317 + #KRB5PLACEHOLD_110 + (-1765328274L) + + ) + +8318 + #KRB5PLACEHOLD_111 + (-1765328273L) + + ) + +8319 + #KRB5PLACEHOLD_112 + (-1765328272L) + + ) + +8320 + #KRB5PLACEHOLD_113 + (-1765328271L) + + ) + +8321 + #KRB5PLACEHOLD_114 + (-1765328270L) + + ) + +8322 + #KRB5PLACEHOLD_115 + (-1765328269L) + + ) + +8323 + #KRB5PLACEHOLD_116 + (-1765328268L) + + ) + +8324 + #KRB5PLACEHOLD_117 + (-1765328267L) + + ) + +8325 + #KRB5PLACEHOLD_118 + (-1765328266L) + + ) + +8326 + #KRB5PLACEHOLD_119 + (-1765328265L) + + ) + +8327 + #KRB5PLACEHOLD_120 + (-1765328264L) + + ) + +8328 + #KRB5PLACEHOLD_121 + (-1765328263L) + + ) + +8329 + #KRB5PLACEHOLD_122 + (-1765328262L) + + ) + +8330 + #KRB5PLACEHOLD_123 + (-1765328261L) + + ) + +8331 + #KRB5PLACEHOLD_124 + (-1765328260L) + + ) + +8332 + #KRB5PLACEHOLD_125 + (-1765328259L) + + ) + +8333 + #KRB5PLACEHOLD_126 + (-1765328258L) + + ) + +8334 + #KRB5PLACEHOLD_127 + (-1765328257L) + + ) + +8335 + #KRB5_ERR_RCSID + (-1765328256L) + + ) + +8336 + #KRB5_LIBOS_BADLOCKFLAG + (-1765328255L) + + ) + +8337 + #KRB5_LIBOS_CANTREADPWD + (-1765328254L) + + ) + +8338 + #KRB5_LIBOS_BADPWDMATCH + (-1765328253L) + + ) + +8339 + #KRB5_LIBOS_PWDINTR + (-1765328252L) + + ) + +8340 + #KRB5_PARSE_ILLCHAR + (-1765328251L) + + ) + +8341 + #KRB5_PARSE_MALFORMED + (-1765328250L) + + ) + +8342 + #KRB5_CONFIG_CANTOPEN + (-1765328249L) + + ) + +8343 + #KRB5_CONFIG_BADFORMAT + (-1765328248L) + + ) + +8344 + #KRB5_CONFIG_NOTENUFSPACE + (-1765328247L) + + ) + +8345 + #KRB5_BADMSGTYPE + (-1765328246L) + + ) + +8346 + #KRB5_CC_BADNAME + (-1765328245L) + + ) + +8347 + #KRB5_CC_UNKNOWN_TYPE + (-1765328244L) + + ) + +8348 + #KRB5_CC_NOTFOUND + (-1765328243L) + + ) + +8349 + #KRB5_CC_END + (-1765328242L) + + ) + +8350 + #KRB5_NO_TKT_SUPPLIED + (-1765328241L) + + ) + +8351 + #KRB5KRB_AP_WRONG_PRINC + (-1765328240L) + + ) + +8352 + #KRB5KRB_AP_ERR_TKT_INVALID + (-1765328239L) + + ) + +8353 + #KRB5_PRINC_NOMATCH + (-1765328238L) + + ) + +8354 + #KRB5_KDCREP_MODIFIED + (-1765328237L) + + ) + +8355 + #KRB5_KDCREP_SKEW + (-1765328236L) + + ) + +8356 + #KRB5_IN_TKT_REALM_MISMATCH + (-1765328235L) + + ) + +8357 + #KRB5_PROG_ETYPE_NOSUPP + (-1765328234L) + + ) + +8358 + #KRB5_PROG_KEYTYPE_NOSUPP + (-1765328233L) + + ) + +8359 + #KRB5_WRONG_ETYPE + (-1765328232L) + + ) + +8360 + #KRB5_PROG_SUMTYPE_NOSUPP + (-1765328231L) + + ) + +8361 + #KRB5_REALM_UNKNOWN + (-1765328230L) + + ) + +8362 + #KRB5_SERVICE_UNKNOWN + (-1765328229L) + + ) + +8363 + #KRB5_KDC_UNREACH + (-1765328228L) + + ) + +8364 + #KRB5_NO_LOCALNAME + (-1765328227L) + + ) + +8365 + #KRB5_MUTUAL_FAILED + (-1765328226L) + + ) + +8366 + #KRB5_RC_TYPE_EXISTS + (-1765328225L) + + ) + +8367 + #KRB5_RC_MALLOC + (-1765328224L) + + ) + +8368 + #KRB5_RC_TYPE_NOTFOUND + (-1765328223L) + + ) + +8369 + #KRB5_RC_UNKNOWN + (-1765328222L) + + ) + +8370 + #KRB5_RC_REPLAY + (-1765328221L) + + ) + +8371 + #KRB5_RC_IO + (-1765328220L) + + ) + +8372 + #KRB5_RC_NOIO + (-1765328219L) + + ) + +8373 + #KRB5_RC_PARSE + (-1765328218L) + + ) + +8374 + #KRB5_RC_IO_EOF + (-1765328217L) + + ) + +8375 + #KRB5_RC_IO_MALLOC + (-1765328216L) + + ) + +8376 + #KRB5_RC_IO_PERM + (-1765328215L) + + ) + +8377 + #KRB5_RC_IO_IO + (-1765328214L) + + ) + +8378 + #KRB5_RC_IO_UNKNOWN + (-1765328213L) + + ) + +8379 + #KRB5_RC_IO_SPACE + (-1765328212L) + + ) + +8380 + #KRB5_TRANS_CANTOPEN + (-1765328211L) + + ) + +8381 + #KRB5_TRANS_BADFORMAT + (-1765328210L) + + ) + +8382 + #KRB5_LNAME_CANTOPEN + (-1765328209L) + + ) + +8383 + #KRB5_LNAME_NOTRANS + (-1765328208L) + + ) + +8384 + #KRB5_LNAME_BADFORMAT + (-1765328207L) + + ) + +8385 + #KRB5_CRYPTO_INTERNAL + (-1765328206L) + + ) + +8386 + #KRB5_KT_BADNAME + (-1765328205L) + + ) + +8387 + #KRB5_KT_UNKNOWN_TYPE + (-1765328204L) + + ) + +8388 + #KRB5_KT_NOTFOUND + (-1765328203L) + + ) + +8389 + #KRB5_KT_END + (-1765328202L) + + ) + +8390 + #KRB5_KT_NOWRITE + (-1765328201L) + + ) + +8391 + #KRB5_KT_IOERR + (-1765328200L) + + ) + +8392 + #KRB5_NO_TKT_IN_RLM + (-1765328199L) + + ) + +8393 + #KRB5DES_BAD_KEYPAR + (-1765328198L) + + ) + +8394 + #KRB5DES_WEAK_KEY + (-1765328197L) + + ) + +8395 + #KRB5_BAD_ENCTYPE + (-1765328196L) + + ) + +8396 + #KRB5_BAD_KEYSIZE + (-1765328195L) + + ) + +8397 + #KRB5_BAD_MSIZE + (-1765328194L) + + ) + +8398 + #KRB5_CC_TYPE_EXISTS + (-1765328193L) + + ) + +8399 + #KRB5_KT_TYPE_EXISTS + (-1765328192L) + + ) + +8400 + #KRB5_CC_IO + (-1765328191L) + + ) + +8401 + #KRB5_FCC_PERM + (-1765328190L) + + ) + +8402 + #KRB5_FCC_NOFILE + (-1765328189L) + + ) + +8403 + #KRB5_FCC_INTERNAL + (-1765328188L) + + ) + +8404 + #KRB5_CC_WRITE + (-1765328187L) + + ) + +8405 + #KRB5_CC_NOMEM + (-1765328186L) + + ) + +8406 + #KRB5_CC_FORMAT + (-1765328185L) + + ) + +8407 + #KRB5_CC_NOT_KTYPE + (-1765328184L) + + ) + +8408 + #KRB5_INVALID_FLAGS + (-1765328183L) + + ) + +8409 + #KRB5_NO_2ND_TKT + (-1765328182L) + + ) + +8410 + #KRB5_NOCREDS_SUPPLIED + (-1765328181L) + + ) + +8411 + #KRB5_SENDAUTH_BADAUTHVERS + (-1765328180L) + + ) + +8412 + #KRB5_SENDAUTH_BADAPPLVERS + (-1765328179L) + + ) + +8413 + #KRB5_SENDAUTH_BADRESPONSE + (-1765328178L) + + ) + +8414 + #KRB5_SENDAUTH_REJECTED + (-1765328177L) + + ) + +8415 + #KRB5_PREAUTH_BAD_TYPE + (-1765328176L) + + ) + +8416 + #KRB5_PREAUTH_NO_KEY + (-1765328175L) + + ) + +8417 + #KRB5_PREAUTH_FAILED + (-1765328174L) + + ) + +8418 + #KRB5_RCACHE_BADVNO + (-1765328173L) + + ) + +8419 + #KRB5_CCACHE_BADVNO + (-1765328172L) + + ) + +8420 + #KRB5_KEYTAB_BADVNO + (-1765328171L) + + ) + +8421 + #KRB5_PROG_ATYPE_NOSUPP + (-1765328170L) + + ) + +8422 + #KRB5_RC_REQUIRED + (-1765328169L) + + ) + +8423 + #KRB5_ERR_BAD_HOSTNAME + (-1765328168L) + + ) + +8424 + #KRB5_ERR_HOST_REALM_UNKNOWN + (-1765328167L) + + ) + +8425 + #KRB5_SNAME_UNSUPP_NAMETYPE + (-1765328166L) + + ) + +8426 + #KRB5KRB_AP_ERR_V4_REPLY + (-1765328165L) + + ) + +8427 + #KRB5_REALM_CANT_RESOLVE + (-1765328164L) + + ) + +8428 + #KRB5_TKT_NOT_FORWARDABLE + (-1765328163L) + + ) + +8429 + #KRB5_FWD_BAD_PRINCIPAL + (-1765328162L) + + ) + +8430 + #KRB5_GET_IN_TKT_LOOP + (-1765328161L) + + ) + +8431 + #KRB5_CONFIG_NODEFREALM + (-1765328160L) + + ) + +8432 + #KRB5_SAM_UNSUPPORTED + (-1765328159L) + + ) + +8433 + #KRB5_SAM_INVALID_ETYPE + (-1765328158L) + + ) + +8434 + #KRB5_SAM_NO_CHECKSUM + (-1765328157L) + + ) + +8435 + #KRB5_SAM_BAD_CHECKSUM + (-1765328156L) + + ) + +8436 + #KRB5_KT_NAME_TOOLONG + (-1765328155L) + + ) + +8437 + #KRB5_KT_KVNONOTFOUND + (-1765328154L) + + ) + +8438 + #KRB5_APPL_EXPIRED + (-1765328153L) + + ) + +8439 + #KRB5_LIB_EXPIRED + (-1765328152L) + + ) + +8440 + #KRB5_CHPW_PWDNULL + (-1765328151L) + + ) + +8441 + #KRB5_CHPW_FAIL + (-1765328150L) + + ) + +8442 + #KRB5_KT_FORMAT + (-1765328149L) + + ) + +8443 + #KRB5_NOPERM_ETYPE + (-1765328148L) + + ) + +8444 + #KRB5_CONFIG_ETYPE_NOSUPP + (-1765328147L) + + ) + +8445 + #KRB5_OBSOLETE_FN + (-1765328146L) + + ) + +8446 + #KRB5_EAI_FAIL + (-1765328145L) + + ) + +8447 + #KRB5_EAI_NODATA + (-1765328144L) + + ) + +8448 + #KRB5_EAI_NONAME + (-1765328143L) + + ) + +8449 + #KRB5_EAI_SERVICE + (-1765328142L) + + ) + +8450 + #KRB5_ERR_NUMERIC_REALM + (-1765328141L) + + ) + +8451 + #KRB5_ERR_BAD_S2K_PARAMS + (-1765328140L) + + ) + +8452 + #KRB5_ERR_NO_SERVICE + (-1765328139L) + + ) + +8453 + #KRB5_CC_READONLY + (-1765328138L) + + ) + +8454 + #KRB5_CC_NOSUPP + (-1765328137L) + + ) + +8455 + #KRB5_DELTAT_BADFORMAT + (-1765328136L) + + ) + +8456 + #KRB5_PLUGIN_NO_HANDLE + (-1765328135L) + + ) + +8457 + #KRB5_PLUGIN_OP_NOTSUPP + (-1765328134L) + + ) + +8458 + #KRB5_ERR_INVALID_UTF8 + (-1765328133L) + + ) + +8459 + #KRB5_ERR_FAST_REQUIRED + (-1765328132L) + + ) + +8460 + #KRB5_LOCAL_ADDR_REQUIRED + (-1765328131L) + + ) + +8461 + #KRB5_REMOTE_ADDR_REQUIRED + (-1765328130L) + + ) + +8462 + #KRB5_TRACE_NOSUPP + (-1765328129L) + + ) + +8463 cڡ +�r�_�b� + +�_krb5_�r�_�b� +; + +8464 + `���lize_krb5_�r�_�b� +(); + +8467 + `���lize_krb5_�r�_�b�_r +( +�_li� + ** +li� +); + +8469 + #ERROR_TABLE_BASE_krb5 + (-1765328384L) + + ) + +8472 + #��_krb5_�r_tbl + +���lize_krb5_�r�_�b� + + + ) + +8473 + #krb5_�r_ba� + +ERROR_TABLE_BASE_krb5 + + + ) + +8479 + ~<�/com_�r.h +> + +8481 + #KRB5_PLUGIN_VER_NOTSUPP + (-1750600192L) + + ) + +8482 + #KRB5_PLUGIN_BAD_MODULE_SPEC + (-1750600191L) + + ) + +8483 + #KRB5_PLUGIN_NAME_NOTFOUND + (-1750600190L) + + ) + +8484 + #KRB5KDC_ERR_DISCARD + (-1750600189L) + + ) + +8485 + #KRB5_DCC_CANNOT_CREATE + (-1750600188L) + + ) + +8486 + #KRB5_KCC_INVALID_ANCHOR + (-1750600187L) + + ) + +8487 + #KRB5_KCC_UNKNOWN_VERSION + (-1750600186L) + + ) + +8488 + #KRB5_KCC_INVALID_UID + (-1750600185L) + + ) + +8489 cڡ +�r�_�b� + +�_k5e1_�r�_�b� +; + +8490 + `���lize_k5e1_�r�_�b� +(); + +8493 + `���lize_k5e1_�r�_�b�_r +( +�_li� + ** +li� +); + +8495 + #ERROR_TABLE_BASE_k5e1 + (-1750600192L) + + ) + +8498 + #��_k5e1_�r_tbl + +���lize_k5e1_�r�_�b� + + + ) + +8499 + #k5e1_�r_ba� + +ERROR_TABLE_BASE_k5e1 + + + ) + +8505 + ~<�/com_�r.h +> + +8507 + #KRB5_KDB_RCSID + (-1780008448L) + + ) + +8508 + #KRB5_KDB_INUSE + (-1780008447L) + + ) + +8509 + #KRB5_KDB_UK_SERROR + (-1780008446L) + + ) + +8510 + #KRB5_KDB_UK_RERROR + (-1780008445L) + + ) + +8511 + #KRB5_KDB_UNAUTH + (-1780008444L) + + ) + +8512 + #KRB5_KDB_NOENTRY + (-1780008443L) + + ) + +8513 + #KRB5_KDB_ILL_WILDCARD + (-1780008442L) + + ) + +8514 + #KRB5_KDB_DB_INUSE + (-1780008441L) + + ) + +8515 + #KRB5_KDB_DB_CHANGED + (-1780008440L) + + ) + +8516 + #KRB5_KDB_TRUNCATED_RECORD + (-1780008439L) + + ) + +8517 + #KRB5_KDB_RECURSIVELOCK + (-1780008438L) + + ) + +8518 + #KRB5_KDB_NOTLOCKED + (-1780008437L) + + ) + +8519 + #KRB5_KDB_BADLOCKMODE + (-1780008436L) + + ) + +8520 + #KRB5_KDB_DBNOTINITED + (-1780008435L) + + ) + +8521 + #KRB5_KDB_DBINITED + (-1780008434L) + + ) + +8522 + #KRB5_KDB_ILLDIRECTION + (-1780008433L) + + ) + +8523 + #KRB5_KDB_NOMASTERKEY + (-1780008432L) + + ) + +8524 + #KRB5_KDB_BADMASTERKEY + (-1780008431L) + + ) + +8525 + #KRB5_KDB_INVALIDKEYSIZE + (-1780008430L) + + ) + +8526 + #KRB5_KDB_CANTREAD_STORED + (-1780008429L) + + ) + +8527 + #KRB5_KDB_BADSTORED_MKEY + (-1780008428L) + + ) + +8528 + #KRB5_KDB_NOACTMASTERKEY + (-1780008427L) + + ) + +8529 + #KRB5_KDB_KVNONOMATCH + (-1780008426L) + + ) + +8530 + #KRB5_KDB_STORED_MKEY_NOTCURRENT + (-1780008425L) + + ) + +8531 + #KRB5_KDB_CANTLOCK_DB + (-1780008424L) + + ) + +8532 + #KRB5_KDB_DB_CORRUPT + (-1780008423L) + + ) + +8533 + #KRB5_KDB_BAD_VERSION + (-1780008422L) + + ) + +8534 + #KRB5_KDB_BAD_SALTTYPE + (-1780008421L) + + ) + +8535 + #KRB5_KDB_BAD_ENCTYPE + (-1780008420L) + + ) + +8536 + #KRB5_KDB_BAD_CREATEFLAGS + (-1780008419L) + + ) + +8537 + #KRB5_KDB_NO_PERMITTED_KEY + (-1780008418L) + + ) + +8538 + #KRB5_KDB_NO_MATCHING_KEY + (-1780008417L) + + ) + +8539 + #KRB5_KDB_DBTYPE_NOTFOUND + (-1780008416L) + + ) + +8540 + #KRB5_KDB_DBTYPE_NOSUP + (-1780008415L) + + ) + +8541 + #KRB5_KDB_DBTYPE_INIT + (-1780008414L) + + ) + +8542 + #KRB5_KDB_SERVER_INTERNAL_ERR + (-1780008413L) + + ) + +8543 + #KRB5_KDB_ACCESS_ERROR + (-1780008412L) + + ) + +8544 + #KRB5_KDB_INTERNAL_ERROR + (-1780008411L) + + ) + +8545 + #KRB5_KDB_CONSTRAINT_VIOLATION + (-1780008410L) + + ) + +8546 + #KRB5_LOG_CONV + (-1780008409L) + + ) + +8547 + #KRB5_LOG_UNSTABLE + (-1780008408L) + + ) + +8548 + #KRB5_LOG_CORRUPT + (-1780008407L) + + ) + +8549 + #KRB5_LOG_ERROR + (-1780008406L) + + ) + +8550 + #KRB5_KDB_DBTYPE_MISMATCH + (-1780008405L) + + ) + +8551 + #KRB5_KDB_POLICY_REF + (-1780008404L) + + ) + +8552 + #KRB5_KDB_STRINGS_TOOLONG + (-1780008403L) + + ) + +8553 cڡ +�r�_�b� + +�_kdb5_�r�_�b� +; + +8554 + `���lize_kdb5_�r�_�b� +(); + +8557 + `���lize_kdb5_�r�_�b�_r +( +�_li� + ** +li� +); + +8559 + #ERROR_TABLE_BASE_kdb5 + (-1780008448L) + + ) + +8562 + #��_kdb5_�r_tbl + +���lize_kdb5_�r�_�b� + + + ) + +8563 + #kdb5_�r_ba� + +ERROR_TABLE_BASE_kdb5 + + + ) + +8569 + ~<�/com_�r.h +> + +8571 + #KV5M_NONE + (-1760647424L) + + ) + +8572 + #KV5M_PRINCIPAL + (-1760647423L) + + ) + +8573 + #KV5M_DATA + (-1760647422L) + + ) + +8574 + #KV5M_KEYBLOCK + (-1760647421L) + + ) + +8575 + #KV5M_CHECKSUM + (-1760647420L) + + ) + +8576 + #KV5M_ENCRYPT_BLOCK + (-1760647419L) + + ) + +8577 + #KV5M_ENC_DATA + (-1760647418L) + + ) + +8578 + #KV5M_CRYPTOSYSTEM_ENTRY + (-1760647417L) + + ) + +8579 + #KV5M_CS_TABLE_ENTRY + (-1760647416L) + + ) + +8580 + #KV5M_CHECKSUM_ENTRY + (-1760647415L) + + ) + +8581 + #KV5M_AUTHDATA + (-1760647414L) + + ) + +8582 + #KV5M_TRANSITED + (-1760647413L) + + ) + +8583 + #KV5M_ENC_TKT_PART + (-1760647412L) + + ) + +8584 + #KV5M_TICKET + (-1760647411L) + + ) + +8585 + #KV5M_AUTHENTICATOR + (-1760647410L) + + ) + +8586 + #KV5M_TKT_AUTHENT + (-1760647409L) + + ) + +8587 + #KV5M_CREDS + (-1760647408L) + + ) + +8588 + #KV5M_LAST_REQ_ENTRY + (-1760647407L) + + ) + +8589 + #KV5M_PA_DATA + (-1760647406L) + + ) + +8590 + #KV5M_KDC_REQ + (-1760647405L) + + ) + +8591 + #KV5M_ENC_KDC_REP_PART + (-1760647404L) + + ) + +8592 + #KV5M_KDC_REP + (-1760647403L) + + ) + +8593 + #KV5M_ERROR + (-1760647402L) + + ) + +8594 + #KV5M_AP_REQ + (-1760647401L) + + ) + +8595 + #KV5M_AP_REP + (-1760647400L) + + ) + +8596 + #KV5M_AP_REP_ENC_PART + (-1760647399L) + + ) + +8597 + #KV5M_RESPONSE + (-1760647398L) + + ) + +8598 + #KV5M_SAFE + (-1760647397L) + + ) + +8599 + #KV5M_PRIV + (-1760647396L) + + ) + +8600 + #KV5M_PRIV_ENC_PART + (-1760647395L) + + ) + +8601 + #KV5M_CRED + (-1760647394L) + + ) + +8602 + #KV5M_CRED_INFO + (-1760647393L) + + ) + +8603 + #KV5M_CRED_ENC_PART + (-1760647392L) + + ) + +8604 + #KV5M_PWD_DATA + (-1760647391L) + + ) + +8605 + #KV5M_ADDRESS + (-1760647390L) + + ) + +8606 + #KV5M_KEYTAB_ENTRY + (-1760647389L) + + ) + +8607 + #KV5M_CONTEXT + (-1760647388L) + + ) + +8608 + #KV5M_OS_CONTEXT + (-1760647387L) + + ) + +8609 + #KV5M_ALT_METHOD + (-1760647386L) + + ) + +8610 + #KV5M_ETYPE_INFO_ENTRY + (-1760647385L) + + ) + +8611 + #KV5M_DB_CONTEXT + (-1760647384L) + + ) + +8612 + #KV5M_AUTH_CONTEXT + (-1760647383L) + + ) + +8613 + #KV5M_KEYTAB + (-1760647382L) + + ) + +8614 + #KV5M_RCACHE + (-1760647381L) + + ) + +8615 + #KV5M_CCACHE + (-1760647380L) + + ) + +8616 + #KV5M_PREAUTH_OPS + (-1760647379L) + + ) + +8617 + #KV5M_SAM_CHALLENGE + (-1760647378L) + + ) + +8618 + #KV5M_SAM_CHALLENGE_2 + (-1760647377L) + + ) + +8619 + #KV5M_SAM_KEY + (-1760647376L) + + ) + +8620 + #KV5M_ENC_SAM_RESPONSE_ENC + (-1760647375L) + + ) + +8621 + #KV5M_ENC_SAM_RESPONSE_ENC_2 + (-1760647374L) + + ) + +8622 + #KV5M_SAM_RESPONSE + (-1760647373L) + + ) + +8623 + #KV5M_SAM_RESPONSE_2 + (-1760647372L) + + ) + +8624 + #KV5M_PREDICTED_SAM_RESPONSE + (-1760647371L) + + ) + +8625 + #KV5M_PASSWD_PHRASE_ELEMENT + (-1760647370L) + + ) + +8626 + #KV5M_GSS_OID + (-1760647369L) + + ) + +8627 + #KV5M_GSS_QUEUE + (-1760647368L) + + ) + +8628 + #KV5M_FAST_ARMORED_REQ + (-1760647367L) + + ) + +8629 + #KV5M_FAST_REQ + (-1760647366L) + + ) + +8630 + #KV5M_FAST_RESPONSE + (-1760647365L) + + ) + +8631 + #KV5M_AUTHDATA_CONTEXT + (-1760647364L) + + ) + +8632 cڡ +�r�_�b� + +�_kv5m_�r�_�b� +; + +8633 + `���lize_kv5m_�r�_�b� +(); + +8636 + `���lize_kv5m_�r�_�b�_r +( +�_li� + ** +li� +); + +8638 + #ERROR_TABLE_BASE_kv5m + (-1760647424L) + + ) + +8641 + #��_kv5m_�r_tbl + +���lize_kv5m_�r�_�b� + + + ) + +8642 + #kv5m_�r_ba� + +ERROR_TABLE_BASE_kv5m + + + ) + +8648 + ~<�/com_�r.h +> + +8650 + #KRB524_BADKEY + (-1750206208L) + + ) + +8651 + #KRB524_BADADDR + (-1750206207L) + + ) + +8652 + #KRB524_BADPRINC + (-1750206206L) + + ) + +8653 + #KRB524_BADREALM + (-1750206205L) + + ) + +8654 + #KRB524_V4ERR + (-1750206204L) + + ) + +8655 + #KRB524_ENCFULL + (-1750206203L) + + ) + +8656 + #KRB524_DECEMPTY + (-1750206202L) + + ) + +8657 + #KRB524_NOTRESP + (-1750206201L) + + ) + +8658 + #KRB524_KRB4_DISABLED + (-1750206200L) + + ) + +8659 cڡ +�r�_�b� + +�_k524_�r�_�b� +; + +8660 + `���lize_k524_�r�_�b� +(); + +8663 + `���lize_k524_�r�_�b�_r +( +�_li� + ** +li� +); + +8665 + #ERROR_TABLE_BASE_k524 + (-1750206208L) + + ) + +8668 + #��_k524_�r_tbl + +���lize_k524_�r�_�b� + + + ) + +8669 + #k524_�r_ba� + +ERROR_TABLE_BASE_k524 + + + ) + +8675 + ~<�/com_�r.h +> + +8677 + #ASN1_BAD_TIMEFORMAT + (1859794432L) + + ) + +8678 + #ASN1_MISSING_FIELD + (1859794433L) + + ) + +8679 + #ASN1_MISPLACED_FIELD + (1859794434L) + + ) + +8680 + #ASN1_TYPE_MISMATCH + (1859794435L) + + ) + +8681 + #ASN1_OVERFLOW + (1859794436L) + + ) + +8682 + #ASN1_OVERRUN + (1859794437L) + + ) + +8683 + #ASN1_BAD_ID + (1859794438L) + + ) + +8684 + #ASN1_BAD_LENGTH + (1859794439L) + + ) + +8685 + #ASN1_BAD_FORMAT + (1859794440L) + + ) + +8686 + #ASN1_PARSE_ERROR + (1859794441L) + + ) + +8687 + #ASN1_BAD_GMTIME + (1859794442L) + + ) + +8688 + #ASN1_MISMATCH_INDEF + (1859794443L) + + ) + +8689 + #ASN1_MISSING_EOC + (1859794444L) + + ) + +8690 + #ASN1_OMITTED + (1859794445L) + + ) + +8691 cڡ +�r�_�b� + +�_a�1_�r�_�b� +; + +8692 + `���lize_a�1_�r�_�b� +(); + +8695 + `���lize_a�1_�r�_�b�_r +( +�_li� + ** +li� +); + +8697 + #ERROR_TABLE_BASE_a�1 + (1859794432L) + + ) + +8700 + #��_a�1_�r_tbl + +���lize_a�1_�r�_�b� + + + ) + +8701 + #a�1_�r_ba� + +ERROR_TABLE_BASE_a�1 + + + ) + + @/usr/include/linux/limits.h + +1 #i�de� +_LINUX_LIMITS_H + + +2 + #_LINUX_LIMITS_H + + + ) + +4 + #NR_OPEN + 1024 + + ) + +6 + #NGROUPS_MAX + 65536 + + ) + +7 + #ARG_MAX + 131072 + + ) + +8 + #LINK_MAX + 127 + + ) + +9 + #MAX_CANON + 255 + + ) + +10 + #MAX_INPUT + 255 + + ) + +11 + #NAME_MAX + 255 + + ) + +12 + #PATH_MAX + 4096 + + ) + +13 + #PIPE_BUF + 4096 + + ) + +14 + #XATTR_NAME_MAX + 255 + + ) + +15 + #XATTR_SIZE_MAX + 65536 + + ) + +16 + #XATTR_LIST_MAX + 65536 + + ) + +18 + #RTSIG_MAX + 32 + + ) + + @/usr/include/linux/param.h + +1 #i�de� +_LINUX_PARAM_H + + +2 + #_LINUX_PARAM_H + + + ) + +4 + ~<asm/��m.h +> + + @/usr/include/linux/stddef.h + + @/usr/include/linux/swab.h + +1 #i�de� +_LINUX_SWAB_H + + +2 + #_LINUX_SWAB_H + + + ) + +4 + ~<l�ux/ty�s.h +> + +6 + ~<asm/swab.h +> + +12 + #___cڡ�t_swab16 +( +x +�(( +__u16 +)( \ + +13 ((( +__u16 +)( +x +) & (__u16)0x00ffU) << 8) | \ + +14 ((( +__u16 +)( +x +�& (__u16)0xff00U�>> 8))) + + ) + +16 + #___cڡ�t_swab32 +( +x +�(( +__u32 +)( \ + +17 ((( +__u32 +)( +x +) & (__u32)0x000000ffUL) << 24) | \ + +18 ((( +__u32 +)( +x +) & (__u32)0x0000ff00UL) << 8) | \ + +19 ((( +__u32 +)( +x +) & (__u32)0x00ff0000UL) >> 8) | \ + +20 ((( +__u32 +)( +x +�& (__u32)0xff000000UL�>> 24))) + + ) + +22 + #___cڡ�t_swab64 +( +x +�(( +__u64 +)( \ + +23 ((( +__u64 +)( +x +) & (__u64)0x00000000000000ffULL) << 56) | \ + +24 ((( +__u64 +)( +x +) & (__u64)0x000000000000ff00ULL) << 40) | \ + +25 ((( +__u64 +)( +x +) & (__u64)0x0000000000ff0000ULL) << 24) | \ + +26 ((( +__u64 +)( +x +) & (__u64)0x00000000ff000000ULL) << 8) | \ + +27 ((( +__u64 +)( +x +) & (__u64)0x000000ff00000000ULL) >> 8) | \ + +28 ((( +__u64 +)( +x +) & (__u64)0x0000ff0000000000ULL) >> 24) | \ + +29 ((( +__u64 +)( +x +) & (__u64)0x00ff000000000000ULL) >> 40) | \ + +30 ((( +__u64 +)( +x +�& (__u64)0xff00000000000000ULL�>> 56))) + + ) + +32 + #___cڡ�t_swahw32 +( +x +�(( +__u32 +)( \ + +33 ((( +__u32 +)( +x +) & (__u32)0x0000ffffUL) << 16) | \ + +34 ((( +__u32 +)( +x +�& (__u32)0xffff0000UL�>> 16))) + + ) + +36 + #___cڡ�t_swahb32 +( +x +�(( +__u32 +)( \ + +37 ((( +__u32 +)( +x +) & (__u32)0x00ff00ffUL) << 8) | \ + +38 ((( +__u32 +)( +x +�& (__u32)0xff00ff00UL�>> 8))) + + ) + +46 +__�l�e__ + +__u16 + + $__fswab16 +( +__u16 + +v� +) + +48 #ifde� +__HAVE_BUILTIN_BSWAP16__ + + +49 + `__bu�t�_bsw�16 +( +v� +); + +50 #�i� + `def�ed + ( +__�ch_swab16 +) + +51 + `__�ch_swab16 +( +v� +); + +53 + `___cڡ�t_swab16 +( +v� +); + +55 + } +} + +57 +__�l�e__ + +__u32 + + $__fswab32 +( +__u32 + +v� +) + +59 #ifde� +__HAVE_BUILTIN_BSWAP32__ + + +60 + `__bu�t�_bsw�32 +( +v� +); + +61 #�i� + `def�ed +( +__�ch_swab32 +) + +62 + `__�ch_swab32 +( +v� +); + +64 + `___cڡ�t_swab32 +( +v� +); + +66 + } +} + +68 +__�l�e__ + +__u64 + + $__fswab64 +( +__u64 + +v� +) + +70 #ifde� +__HAVE_BUILTIN_BSWAP64__ + + +71 + `__bu�t�_bsw�64 +( +v� +); + +72 #�i� + `def�ed + ( +__�ch_swab64 +) + +73 + `__�ch_swab64 +( +v� +); + +74 #�i� + `def�ed +( +__SWAB_64_THRU_32__ +) + +75 +__u32 + +h + = +v� + >> 32; + +76 +__u32 + +l + = +v� + & ((1ULL << 32) - 1); + +77 ((( +__u64 +) + `__fswab32 +( +l +)�<< 32�| ((__u64)(__fswab32( +h +))); + +79 + `___cڡ�t_swab64 +( +v� +); + +81 + } +} + +83 +__�l�e__ + +__u32 + + $__fswahw32 +( +__u32 + +v� +) + +85 #ifde� +__�ch_swahw32 + + +86 + `__�ch_swahw32 +( +v� +); + +88 + `___cڡ�t_swahw32 +( +v� +); + +90 + } +} + +92 +__�l�e__ + +__u32 + + $__fswahb32 +( +__u32 + +v� +) + +94 #ifde� +__�ch_swahb32 + + +95 + `__�ch_swahb32 +( +v� +); + +97 + `___cڡ�t_swahb32 +( +v� +); + +99 + } +} + +105 + #__swab16 +( +x +) \ + +106 ( + `__bu�t�_cڡ�t_p +(( +__u16 +)( +x +)) ? \ + +107 + `___cڡ�t_swab16 +( +x +) : \ + +108 + `__fswab16 +( +x +)) + + ) + +114 + #__swab32 +( +x +) \ + +115 ( + `__bu�t�_cڡ�t_p +(( +__u32 +)( +x +)) ? \ + +116 + `___cڡ�t_swab32 +( +x +) : \ + +117 + `__fswab32 +( +x +)) + + ) + +123 + #__swab64 +( +x +) \ + +124 ( + `__bu�t�_cڡ�t_p +(( +__u64 +)( +x +)) ? \ + +125 + `___cڡ�t_swab64 +( +x +) : \ + +126 + `__fswab64 +( +x +)) + + ) + +134 + #__swahw32 +( +x +) \ + +135 ( + `__bu�t�_cڡ�t_p +(( +__u32 +)( +x +)) ? \ + +136 + `___cڡ�t_swahw32 +( +x +) : \ + +137 + `__fswahw32 +( +x +)) + + ) + +145 + #__swahb32 +( +x +) \ + +146 ( + `__bu�t�_cڡ�t_p +(( +__u32 +)( +x +)) ? \ + +147 + `___cڡ�t_swahb32 +( +x +) : \ + +148 + `__fswahb32 +( +x +)) + + ) + +154 +__�l�e__ + +__u16 + + $__swab16p +(cڡ +__u16 + * +p +) + +156 #ifde� +__�ch_swab16p + + +157 + `__�ch_swab16p +( +p +); + +159 + `__swab16 +(* +p +); + +161 + } +} + +167 +__�l�e__ + +__u32 + + $__swab32p +(cڡ +__u32 + * +p +) + +169 #ifde� +__�ch_swab32p + + +170 + `__�ch_swab32p +( +p +); + +172 + `__swab32 +(* +p +); + +174 + } +} + +180 +__�l�e__ + +__u64 + + $__swab64p +(cڡ +__u64 + * +p +) + +182 #ifde� +__�ch_swab64p + + +183 + `__�ch_swab64p +( +p +); + +185 + `__swab64 +(* +p +); + +187 + } +} + +195 +__�l�e__ + +__u32 + + $__swahw32p +(cڡ +__u32 + * +p +) + +197 #ifde� +__�ch_swahw32p + + +198 + `__�ch_swahw32p +( +p +); + +200 + `__swahw32 +(* +p +); + +202 + } +} + +210 +__�l�e__ + +__u32 + + $__swahb32p +(cڡ +__u32 + * +p +) + +212 #ifde� +__�ch_swahb32p + + +213 + `__�ch_swahb32p +( +p +); + +215 + `__swahb32 +(* +p +); + +217 + } +} + +223 +__�l�e__ + + $__swab16s +( +__u16 + * +p +) + +225 #ifde� +__�ch_swab16s + + +226 + `__�ch_swab16s +( +p +); + +228 * +p + = + `__swab16p +(p); + +230 + } +} + +235 +__�l�e__ + + $__swab32s +( +__u32 + * +p +) + +237 #ifde� +__�ch_swab32s + + +238 + `__�ch_swab32s +( +p +); + +240 * +p + = + `__swab32p +(p); + +242 + } +} + +248 +__�l�e__ + + $__swab64s +( +__u64 + * +p +) + +250 #ifde� +__�ch_swab64s + + +251 + `__�ch_swab64s +( +p +); + +253 * +p + = + `__swab64p +(p); + +255 + } +} + +263 +__�l�e__ + + $__swahw32s +( +__u32 + * +p +) + +265 #ifde� +__�ch_swahw32s + + +266 + `__�ch_swahw32s +( +p +); + +268 * +p + = + `__swahw32p +(p); + +270 + } +} + +278 +__�l�e__ + + $__swahb32s +( +__u32 + * +p +) + +280 #ifde� +__�ch_swahb32s + + +281 + `__�ch_swahb32s +( +p +); + +283 * +p + = + `__swahb32p +(p); + +285 + } +} + + @/usr/include/wchar.h + +23 #i�de� +_WCHAR_H + + +25 #i�! +def�ed + +__�ed_mb��e_t + && !def�ed +__�ed_w�t_t + + +26 + #_WCHAR_H + 1 + + ) + +27 + ~<�u�s.h +> + +30 #ifde� +_WCHAR_H + + +32 + #__�ed___FILE + + + ) + +33 #i� +def�ed + +__USE_UNIX98 + || def�ed +__USE_XOPEN2K + + +34 + #__�ed_FILE + + + ) + +36 + ~<�dio.h +> + +38 + #__�ed___va_li� + + + ) + +39 + ~<�d�g.h +> + +41 + ~<b�s/wch�.h +> + +44 + #__�ed_size_t + + + ) + +45 + #__�ed_wch�_t + + + ) + +46 + #__�ed_NULL + + + ) + +48 #i� +def�ed + +_WCHAR_H + || def�ed +__�ed_w�t_t + || !def�ed +__WINT_TYPE__ + + +49 #unde� +__�ed_w�t_t + + +50 + #__�ed_w�t_t + + + ) + +51 + ~<�ddef.h +> + +55 #i�de� +_WINT_T + + +60 + #_WINT_T + + + ) + +61 + tw�t_t +; + +65 #i� +def�ed + +__�lu�lus + && def�ed +_GLIBCPP_USE_NAMESPACES + \ + +66 && +def�ed + +__WINT_TYPE__ + + +67 +__BEGIN_NAMESPACE_STD + + +68 +__WINT_TYPE__ + + tw�t_t +; + +69 + g__END_NAMESPACE_STD + + +74 #i� +def�ed + +__�lu�lus + && +__GNUC_PREREQ + (4, 4) + +75 + #__CORRECT_ISO_CPP_WCHAR_H_PROTO + + + ) + +79 #i�( +def�ed + +_WCHAR_H + || def�ed +__�ed_mb��e_t +�&& !def�ed +____mb��e_t_def�ed + + +80 + #____mb��e_t_def�ed + 1 + + ) + +84 + m__cou� +; + +87 #ifde� +__WINT_TYPE__ + + +88 +__WINT_TYPE__ + + m__wch +; + +90 +w�t_t + + m__wch +; + +92 + m__wchb +[4]; + +93 } + m__v�ue +; + +94 } + t__mb��e_t +; + +96 #unde� +__�ed_mb��e_t + + +101 #ifde� +_WCHAR_H + + +103 #i�de� +__mb��e_t_def�ed + + +104 +__BEGIN_NAMESPACE_C99 + + +106 +__mb��e_t + + tmb��e_t +; + +107 + g__END_NAMESPACE_C99 + + +108 + #__mb��e_t_def�ed + 1 + + ) + +111 #ifde� +__USE_GNU + + +112 + $__USING_NAMESPACE_C99 +( +mb��e_t +) + +115 #i�de� +WCHAR_MIN + + +117 + #WCHAR_MIN + +__WCHAR_MIN + + + ) + +118 + #WCHAR_MAX + +__WCHAR_MAX + + + ) + +121 #i�de� +WEOF + + +122 + #WEOF + (0xffffffffu) + + ) + +127 #i� +def�ed + +__USE_XOPEN + && !def�ed +__USE_UNIX98 + + +128 + ~<w�y�.h +> + +132 +__BEGIN_DECLS + + +134 +__BEGIN_NAMESPACE_STD + + +137 +tm +; + +138 +__END_NAMESPACE_STD + + +142 + $__USING_NAMESPACE_STD +( +tm +) + +145 +__BEGIN_NAMESPACE_STD + + +147 +wch�_t + * + $wcs�y + ( +wch�_t + * +__��ri� + +__de� +, + +148 cڡ +wch�_t + * +__��ri� + +__�c +� +__THROW +; + +150 +wch�_t + * + $wc��y + ( +wch�_t + * +__��ri� + +__de� +, + +151 cڡ +wch�_t + * +__��ri� + +__�c +, +size_t + +__n +) + +152 +__THROW +; + +155 +wch�_t + * + $wcs�t + ( +wch�_t + * +__��ri� + +__de� +, + +156 cڡ +wch�_t + * +__��ri� + +__�c +� +__THROW +; + +158 +wch�_t + * + $wc��t + ( +wch�_t + * +__��ri� + +__de� +, + +159 cڡ +wch�_t + * +__��ri� + +__�c +, +size_t + +__n +) + +160 +__THROW +; + +163 + $wcscmp + (cڡ +wch�_t + * +__s1 +, cڡ wch�_�* +__s2 +) + +164 +__THROW + +__��ibu�_pu�__ +; + +166 + $wc�cmp + (cڡ +wch�_t + * +__s1 +, cڡ wch�_�* +__s2 +, +size_t + +__n +) + +167 +__THROW + +__��ibu�_pu�__ +; + +168 +__END_NAMESPACE_STD + + +170 #ifde� +__USE_XOPEN2K8 + + +172 + $wcs��cmp + (cڡ +wch�_t + * +__s1 +, cڡ wch�_�* +__s2 +� +__THROW +; + +175 + $wc���cmp + (cڡ +wch�_t + * +__s1 +, cڡ wch�_�* +__s2 +, + +176 +size_t + +__n +� +__THROW +; + +180 + ~<xlo��.h +> + +182 + $wcs��cmp_l + (cڡ +wch�_t + * +__s1 +, cڡ wch�_�* +__s2 +, + +183 +__lo��_t + +__loc +� +__THROW +; + +185 + $wc���cmp_l + (cڡ +wch�_t + * +__s1 +, cڡ wch�_�* +__s2 +, + +186 +size_t + +__n +, +__lo��_t + +__loc +� +__THROW +; + +189 +__BEGIN_NAMESPACE_STD + + +192 + $wcsc�l + (cڡ +wch�_t + * +__s1 +, cڡ wch�_�* +__s2 +� +__THROW +; + +196 +size_t + + $wcsx�m + ( +wch�_t + * +__��ri� + +__s1 +, + +197 cڡ +wch�_t + * +__��ri� + +__s2 +, +size_t + +__n +� +__THROW +; + +198 +__END_NAMESPACE_STD + + +200 #ifde� +__USE_XOPEN2K8 + + +206 + $wcsc�l_l + (cڡ +wch�_t + * +__s1 +, cڡ wch�_�* +__s2 +, + +207 +__lo��_t + +__loc +� +__THROW +; + +212 +size_t + + $wcsx�m_l + ( +wch�_t + * +__s1 +, cڡ wch�_�* +__s2 +, + +213 +size_t + +__n +, +__lo��_t + +__loc +� +__THROW +; + +216 +wch�_t + * + $wcsdup + (cڡ +wch�_t + * +__s +� +__THROW + +__��ibu�_m�loc__ +; + +219 +__BEGIN_NAMESPACE_STD + + +221 #ifde� +__CORRECT_ISO_CPP_WCHAR_H_PROTO + + +222 "C++" +wch�_t + * + $wcschr + ( +wch�_t + * +__wcs +, wch�_� +__wc +) + +223 +__THROW + + `__asm + ("wcschr"� +__��ibu�_pu�__ +; + +224 "C++" cڡ +wch�_t + * + $wcschr + (cڡ +wch�_t + * +__wcs +, wch�_� +__wc +) + +225 +__THROW + + `__asm + ("wcschr"� +__��ibu�_pu�__ +; + +227 +wch�_t + * + $wcschr + (cڡ +wch�_t + * +__wcs +, wch�_� +__wc +) + +228 +__THROW + +__��ibu�_pu�__ +; + +231 #ifde� +__CORRECT_ISO_CPP_WCHAR_H_PROTO + + +232 "C++" +wch�_t + * + $wc�chr + ( +wch�_t + * +__wcs +, wch�_� +__wc +) + +233 +__THROW + + `__asm + ("wc�chr"� +__��ibu�_pu�__ +; + +234 "C++" cڡ +wch�_t + * + $wc�chr + (cڡ +wch�_t + * +__wcs +, wch�_� +__wc +) + +235 +__THROW + + `__asm + ("wc�chr"� +__��ibu�_pu�__ +; + +237 +wch�_t + * + $wc�chr + (cڡ +wch�_t + * +__wcs +, wch�_� +__wc +) + +238 +__THROW + +__��ibu�_pu�__ +; + +240 +__END_NAMESPACE_STD + + +242 #ifde� +__USE_GNU + + +245 +wch�_t + * + $wcsch�ul + (cڡ +wch�_t + * +__s +, wch�_� +__wc +) + +246 +__THROW + +__��ibu�_pu�__ +; + +249 +__BEGIN_NAMESPACE_STD + + +252 +size_t + + $wcsc�n + (cڡ +wch�_t + * +__wcs +, cڡ wch�_�* +__�je� +) + +253 +__THROW + +__��ibu�_pu�__ +; + +256 +size_t + + $wcs�n + (cڡ +wch�_t + * +__wcs +, cڡ wch�_�* +__ac�� +) + +257 +__THROW + +__��ibu�_pu�__ +; + +259 #ifde� +__CORRECT_ISO_CPP_WCHAR_H_PROTO + + +260 "C++" +wch�_t + * + $wc�brk + ( +wch�_t + * +__wcs +, cڡ wch�_�* +__ac�� +) + +261 +__THROW + + `__asm + ("wc�brk"� +__��ibu�_pu�__ +; + +262 "C++" cڡ +wch�_t + * + $wc�brk + (cڡ +wch�_t + * +__wcs +, + +263 cڡ +wch�_t + * +__ac�� +) + +264 +__THROW + + `__asm + ("wc�brk"� +__��ibu�_pu�__ +; + +266 +wch�_t + * + $wc�brk + (cڡ +wch�_t + * +__wcs +, cڡ wch�_�* +__ac�� +) + +267 +__THROW + +__��ibu�_pu�__ +; + +270 #ifde� +__CORRECT_ISO_CPP_WCHAR_H_PROTO + + +271 "C++" +wch�_t + * + $wcs�r + ( +wch�_t + * +__hay�ack +, cڡ wch�_�* +__�ed� +) + +272 +__THROW + + `__asm + ("wcs�r"� +__��ibu�_pu�__ +; + +273 "C++" cڡ +wch�_t + * + $wcs�r + (cڡ +wch�_t + * +__hay�ack +, + +274 cڡ +wch�_t + * +__�ed� +) + +275 +__THROW + + `__asm + ("wcs�r"� +__��ibu�_pu�__ +; + +277 +wch�_t + * + $wcs�r + (cڡ +wch�_t + * +__hay�ack +, cڡ wch�_�* +__�ed� +) + +278 +__THROW + +__��ibu�_pu�__ +; + +282 +wch�_t + * + $wc�ok + ( +wch�_t + * +__��ri� + +__s +, + +283 cڡ +wch�_t + * +__��ri� + +__d�im +, + +284 +wch�_t + ** +__��ri� + +__�r +� +__THROW +; + +287 +size_t + + $wc�� + (cڡ +wch�_t + * +__s +� +__THROW + +__��ibu�_pu�__ +; + +288 +__END_NAMESPACE_STD + + +290 #ifde� +__USE_XOPEN + + +292 #ifde� +__CORRECT_ISO_CPP_WCHAR_H_PROTO + + +293 "C++" +wch�_t + * + $wcswcs + ( +wch�_t + * +__hay�ack +, cڡ wch�_�* +__�ed� +) + +294 +__THROW + + `__asm + ("wcswcs"� +__��ibu�_pu�__ +; + +295 "C++" cڡ +wch�_t + * + $wcswcs + (cڡ +wch�_t + * +__hay�ack +, + +296 cڡ +wch�_t + * +__�ed� +) + +297 +__THROW + + `__asm + ("wcswcs"� +__��ibu�_pu�__ +; + +299 +wch�_t + * + $wcswcs + (cڡ +wch�_t + * +__hay�ack +, cڡ wch�_�* +__�ed� +) + +300 +__THROW + +__��ibu�_pu�__ +; + +304 #ifde� +__USE_XOPEN2K8 + + +306 +size_t + + $wc��n + (cڡ +wch�_t + * +__s +, +size_t + +__max�n +) + +307 +__THROW + +__��ibu�_pu�__ +; + +311 +__BEGIN_NAMESPACE_STD + + +313 #ifde� +__CORRECT_ISO_CPP_WCHAR_H_PROTO + + +314 "C++" +wch�_t + * + $wmemchr + ( +wch�_t + * +__s +, wch�_� +__c +, +size_t + +__n +) + +315 +__THROW + + `__asm + ("wmemchr"� +__��ibu�_pu�__ +; + +316 "C++" cڡ +wch�_t + * + $wmemchr + (cڡ +wch�_t + * +__s +, wch�_� +__c +, + +317 +size_t + +__n +) + +318 +__THROW + + `__asm + ("wmemchr"� +__��ibu�_pu�__ +; + +320 +wch�_t + * + $wmemchr + (cڡ +wch�_t + * +__s +, wch�_� +__c +, +size_t + +__n +) + +321 +__THROW + +__��ibu�_pu�__ +; + +325 + $wmemcmp + (cڡ +wch�_t + * +__s1 +, cڡ wch�_�* +__s2 +, +size_t + +__n +) + +326 +__THROW + +__��ibu�_pu�__ +; + +329 +wch�_t + * + $wmem�y + ( +wch�_t + * +__��ri� + +__s1 +, + +330 cڡ +wch�_t + * +__��ri� + +__s2 +, +size_t + +__n +� +__THROW +; + +334 +wch�_t + * + $wmemmove + ( +wch�_t + * +__s1 +, cڡ wch�_�* +__s2 +, +size_t + +__n +) + +335 +__THROW +; + +338 +wch�_t + * + $wmem�t + ( +wch�_t + * +__s +, wch�_� +__c +, +size_t + +__n +� +__THROW +; + +339 +__END_NAMESPACE_STD + + +341 #ifde� +__USE_GNU + + +344 +wch�_t + * + $wmemp�y + ( +wch�_t + * +__��ri� + +__s1 +, + +345 cڡ +wch�_t + * +__��ri� + +__s2 +, +size_t + +__n +) + +346 +__THROW +; + +350 +__BEGIN_NAMESPACE_STD + + +353 +w�t_t + + $btowc + ( +__c +� +__THROW +; + +357 + $w�ob + ( +w�t_t + +__c +� +__THROW +; + +361 + $mbs�� + (cڡ +mb��e_t + * +__ps +� +__THROW + +__��ibu�_pu�__ +; + +365 +size_t + + $mb�owc + ( +wch�_t + * +__��ri� + +__pwc +, + +366 cڡ * +__��ri� + +__s +, +size_t + +__n +, + +367 +mb��e_t + * +__��ri� + +__p +� +__THROW +; + +370 +size_t + + $w�tomb + (* +__��ri� + +__s +, +wch�_t + +__wc +, + +371 +mb��e_t + * +__��ri� + +__ps +� +__THROW +; + +374 +size_t + + $__mb�� + (cڡ * +__��ri� + +__s +, +size_t + +__n +, + +375 +mb��e_t + * +__��ri� + +__ps +� +__THROW +; + +376 +size_t + + $mb�� + (cڡ * +__��ri� + +__s +, +size_t + +__n +, + +377 +mb��e_t + * +__��ri� + +__ps +� +__THROW +; + +378 +__END_NAMESPACE_STD + + +380 #ifde� +__USE_EXTERN_INLINES + + +386 +w�t_t + + $__btowc_��s + ( +__c +� + `__asm + ("btowc"); + +387 +__ex��_�l�e + +w�t_t + + +388 + `__NTH + ( + $btowc + ( +__c +)) + +389 { ( + `__bu�t�_cڡ�t_p + ( +__c +) && __c >= '\0' && __c <= '\x7f' + +390 ? ( +w�t_t +� +__c + : + `__btowc_��s + (__c)); + } +} + +392 + $__w�ob_��s + ( +w�t_t + +__c +� + `__asm + ("wctob"); + +393 +__ex��_�l�e + + +394 + `__NTH + ( + $w�ob + ( +w�t_t + +__wc +)) + +395 { ( + `__bu�t�_cڡ�t_p + ( +__wc +�&& __w�>� +L +'\0' && __wc <= L'\x7f' + +396 ? (� +__wc + : + `__w�ob_��s + (__wc)); + } +} + +398 +__ex��_�l�e + +size_t + + +399 +__NTH + ( + $mb�� + (cڡ * +__��ri� + +__s +, +size_t + +__n +, + +400 +mb��e_t + * +__��ri� + +__ps +)) + +401 { ( +__ps + !� +NULL + + +402 ? + `mb�owc + ( +NULL +, +__s +, +__n +, +__ps +�: + `__mb�� + (__s, __n, NULL)); + } +} + +405 +__BEGIN_NAMESPACE_STD + + +408 +size_t + + $mb�towcs + ( +wch�_t + * +__��ri� + +__d� +, + +409 cڡ ** +__��ri� + +__�c +, +size_t + +__�n +, + +410 +mb��e_t + * +__��ri� + +__ps +� +__THROW +; + +414 +size_t + + $wc�tombs + (* +__��ri� + +__d� +, + +415 cڡ +wch�_t + ** +__��ri� + +__�c +, +size_t + +__�n +, + +416 +mb��e_t + * +__��ri� + +__ps +� +__THROW +; + +417 +__END_NAMESPACE_STD + + +420 #ifdef +__USE_XOPEN2K8 + + +423 +size_t + + $mb��owcs + ( +wch�_t + * +__��ri� + +__d� +, + +424 cڡ ** +__��ri� + +__�c +, +size_t + +__nmc +, + +425 +size_t + +__�n +, +mb��e_t + * +__��ri� + +__ps +� +__THROW +; + +429 +size_t + + $wc��ombs + (* +__��ri� + +__d� +, + +430 cڡ +wch�_t + ** +__��ri� + +__�c +, + +431 +size_t + +__nwc +, size_� +__�n +, + +432 +mb��e_t + * +__��ri� + +__ps +� +__THROW +; + +437 #ifde� +__USE_XOPEN + + +439 + $wcwidth + ( +wch�_t + +__c +� +__THROW +; + +443 + $wcswidth + (cڡ +wch�_t + * +__s +, +size_t + +__n +� +__THROW +; + +447 +__BEGIN_NAMESPACE_STD + + +450 + $wc�od + (cڡ +wch�_t + * +__��ri� + +__Ō +, + +451 +wch�_t + ** +__��ri� + +__�d�r +� +__THROW +; + +452 +__END_NAMESPACE_STD + + +454 #ifde� +__USE_ISOC99 + + +455 +__BEGIN_NAMESPACE_C99 + + +457 + $wc�of + (cڡ +wch�_t + * +__��ri� + +__Ō +, + +458 +wch�_t + ** +__��ri� + +__�d�r +� +__THROW +; + +459 + $wc��d + (cڡ +wch�_t + * +__��ri� + +__Ō +, + +460 +wch�_t + ** +__��ri� + +__�d�r +� +__THROW +; + +461 +__END_NAMESPACE_C99 + + +465 +__BEGIN_NAMESPACE_STD + + +468 + $wc�� + (cڡ +wch�_t + * +__��ri� + +__Ō +, + +469 +wch�_t + ** +__��ri� + +__�d�r +, +__ba� +� +__THROW +; + +473 + $wc�oul + (cڡ +wch�_t + * +__��ri� + +__Ō +, + +474 +wch�_t + ** +__��ri� + +__�d�r +, +__ba� +) + +475 +__THROW +; + +476 +__END_NAMESPACE_STD + + +478 #ifde� +__USE_ISOC99 + + +479 +__BEGIN_NAMESPACE_C99 + + +482 +__ex�nsi�__ + + +483 + $wc��l + (cڡ +wch�_t + * +__��ri� + +__Ō +, + +484 +wch�_t + ** +__��ri� + +__�d�r +, +__ba� +) + +485 +__THROW +; + +489 +__ex�nsi�__ + + +490 + $wc�ou� + (cڡ +wch�_t + * +__��ri� + +__Ō +, + +491 +wch�_t + ** +__��ri� + +__�d�r +, + +492 +__ba� +� +__THROW +; + +493 +__END_NAMESPACE_C99 + + +496 #ifde� +__USE_GNU + + +499 +__ex�nsi�__ + + +500 + $wc�oq + (cڡ +wch�_t + * +__��ri� + +__Ō +, + +501 +wch�_t + ** +__��ri� + +__�d�r +, +__ba� +) + +502 +__THROW +; + +506 +__ex�nsi�__ + + +507 + $wc�ouq + (cڡ +wch�_t + * +__��ri� + +__Ō +, + +508 +wch�_t + ** +__��ri� + +__�d�r +, + +509 +__ba� +� +__THROW +; + +512 #ifde� +__USE_GNU + + +526 + ~<xlo��.h +> + +530 + $wc��_l + (cڡ +wch�_t + * +__��ri� + +__Ō +, + +531 +wch�_t + ** +__��ri� + +__�d�r +, +__ba� +, + +532 +__lo��_t + +__loc +� +__THROW +; + +534 + $wc�oul_l + (cڡ +wch�_t + * +__��ri� + +__Ō +, + +535 +wch�_t + ** +__��ri� + +__�d�r +, + +536 +__ba� +, +__lo��_t + +__loc +� +__THROW +; + +538 +__ex�nsi�__ + + +539 + $wc��l_l + (cڡ +wch�_t + * +__��ri� + +__Ō +, + +540 +wch�_t + ** +__��ri� + +__�d�r +, + +541 +__ba� +, +__lo��_t + +__loc +� +__THROW +; + +543 +__ex�nsi�__ + + +544 + $wc�ou�_l + (cڡ +wch�_t + * +__��ri� + +__Ō +, + +545 +wch�_t + ** +__��ri� + +__�d�r +, + +546 +__ba� +, +__lo��_t + +__loc +) + +547 +__THROW +; + +549 + $wc�od_l + (cڡ +wch�_t + * +__��ri� + +__Ō +, + +550 +wch�_t + ** +__��ri� + +__�d�r +, +__lo��_t + +__loc +) + +551 +__THROW +; + +553 + $wc�of_l + (cڡ +wch�_t + * +__��ri� + +__Ō +, + +554 +wch�_t + ** +__��ri� + +__�d�r +, +__lo��_t + +__loc +) + +555 +__THROW +; + +557 + $wc��d_l + (cڡ +wch�_t + * +__��ri� + +__Ō +, + +558 +wch�_t + ** +__��ri� + +__�d�r +, + +559 +__lo��_t + +__loc +� +__THROW +; + +563 #ifde� +__USE_XOPEN2K8 + + +566 +wch�_t + * + $w��y + ( +wch�_t + * +__��ri� + +__de� +, + +567 cڡ +wch�_t + * +__��ri� + +__�c +� +__THROW +; + +571 +wch�_t + * + $w�n�y + ( +wch�_t + * +__��ri� + +__de� +, + +572 cڡ +wch�_t + * +__��ri� + +__�c +, +size_t + +__n +) + +573 +__THROW +; + +580 +__FILE + * + $ݒ_wmem��am + ( +wch�_t + ** +__bu�oc +, +size_t + * +__siz�oc +� +__THROW +; + +583 #i� +def�ed + +__USE_ISOC95 + || def�ed +__USE_UNIX98 + + +584 +__BEGIN_NAMESPACE_STD + + +587 + $fwide + ( +__FILE + * +__� +, +__mode +� +__THROW +; + +594 + `fw��tf + ( +__FILE + * +__��ri� + +__��am +, + +595 cڡ +wch�_t + * +__��ri� + +__f�m� +, ...) + +601 + `w��tf + (cڡ +wch�_t + * +__��ri� + +__f�m� +, ...) + +604 + $sw��tf + ( +wch�_t + * +__��ri� + +__s +, +size_t + +__n +, + +605 cڡ +wch�_t + * +__��ri� + +__f�m� +, ...) + +606 +__THROW + ; + +612 + `vfw��tf + ( +__FILE + * +__��ri� + +__s +, + +613 cڡ +wch�_t + * +__��ri� + +__f�m� +, + +614 +__gnuc_va_li� + +__�g +) + +620 + `vw��tf + (cڡ +wch�_t + * +__��ri� + +__f�m� +, + +621 +__gnuc_va_li� + +__�g +) + +625 + $vsw��tf + ( +wch�_t + * +__��ri� + +__s +, +size_t + +__n +, + +626 cڡ +wch�_t + * +__��ri� + +__f�m� +, + +627 +__gnuc_va_li� + +__�g +) + +628 +__THROW + ; + +635 + `fws�nf + ( +__FILE + * +__��ri� + +__��am +, + +636 cڡ +wch�_t + * +__��ri� + +__f�m� +, ...) + +642 + `ws�nf + (cڡ +wch�_t + * +__��ri� + +__f�m� +, ...) + +645 + $sws�nf + (cڡ +wch�_t + * +__��ri� + +__s +, + +646 cڡ +wch�_t + * +__��ri� + +__f�m� +, ...) + +647 +__THROW + ; + +649 #i� +def�ed + +__USE_ISOC99 + && !def�ed +__USE_GNU + \ + +650 && (! +def�ed + +__LDBL_COMPAT + || !def�ed +__REDIRECT +) \ + +651 && ( +def�ed + +__STRICT_ANSI__ + || def�ed +__USE_XOPEN2K +) + +652 #ifde� +__REDIRECT + + +656 + `__REDIRECT + ( +fws�nf +, ( +__FILE + * +__��ri� + +__��am +, + +657 cڡ +wch�_t + * +__��ri� + +__f�m� +, ...), + +658 +__isoc99_fws�nf +) + +660 + `__REDIRECT + ( +ws�nf +, (cڡ +wch�_t + * +__��ri� + +__f�m� +, ...), + +661 +__isoc99_ws�nf +) + +663 + `__REDIRECT_NTH + ( +sws�nf +, (cڡ +wch�_t + * +__��ri� + +__s +, + +664 cڡ +wch�_t + * +__��ri� + +__f�m� +, + +665 ...), +__isoc99_sws�nf +) + +668 + `__isoc99_fws�nf + ( +__FILE + * +__��ri� + +__��am +, + +669 cڡ +wch�_t + * +__��ri� + +__f�m� +, ...); + +670 + `__isoc99_ws�nf + (cڡ +wch�_t + * +__��ri� + +__f�m� +, ...); + +671 + $__isoc99_sws�nf + (cڡ +wch�_t + * +__��ri� + +__s +, + +672 cڡ +wch�_t + * +__��ri� + +__f�m� +, ...) + +673 +__THROW +; + +674 + #fws�nf + +__isoc99_fws�nf + + + ) + +675 + #ws�nf + +__isoc99_ws�nf + + + ) + +676 + #sws�nf + +__isoc99_sws�nf + + + ) + +680 +__END_NAMESPACE_STD + + +683 #ifde� +__USE_ISOC99 + + +684 +__BEGIN_NAMESPACE_C99 + + +689 + `vfws�nf + ( +__FILE + * +__��ri� + +__s +, + +690 cڡ +wch�_t + * +__��ri� + +__f�m� +, + +691 +__gnuc_va_li� + +__�g +) + +697 + `vws�nf + (cڡ +wch�_t + * +__��ri� + +__f�m� +, + +698 +__gnuc_va_li� + +__�g +) + +701 + $vsws�nf + (cڡ +wch�_t + * +__��ri� + +__s +, + +702 cڡ +wch�_t + * +__��ri� + +__f�m� +, + +703 +__gnuc_va_li� + +__�g +) + +704 +__THROW + ; + +706 #i�! +def�ed + +__USE_GNU + \ + +707 && (! +def�ed + +__LDBL_COMPAT + || !def�ed +__REDIRECT +) \ + +708 && ( +def�ed + +__STRICT_ANSI__ + || def�ed +__USE_XOPEN2K +) + +709 #ifde� +__REDIRECT + + +710 + `__REDIRECT + ( +vfws�nf +, ( +__FILE + * +__��ri� + +__s +, + +711 cڡ +wch�_t + * +__��ri� + +__f�m� +, + +712 +__gnuc_va_li� + +__�g +), +__isoc99_vfws�nf +) + +714 + `__REDIRECT + ( +vws�nf +, (cڡ +wch�_t + * +__��ri� + +__f�m� +, + +715 +__gnuc_va_li� + +__�g +), +__isoc99_vws�nf +) + +717 + `__REDIRECT_NTH + ( +vsws�nf +, (cڡ +wch�_t + * +__��ri� + +__s +, + +718 cڡ +wch�_t + * +__��ri� + +__f�m� +, + +719 +__gnuc_va_li� + +__�g +), +__isoc99_vsws�nf +) + +722 + `__isoc99_vfws�nf + ( +__FILE + * +__��ri� + +__s +, + +723 cڡ +wch�_t + * +__��ri� + +__f�m� +, + +724 +__gnuc_va_li� + +__�g +); + +725 + `__isoc99_vws�nf + (cڡ +wch�_t + * +__��ri� + +__f�m� +, + +726 +__gnuc_va_li� + +__�g +); + +727 + $__isoc99_vsws�nf + (cڡ +wch�_t + * +__��ri� + +__s +, + +728 cڡ +wch�_t + * +__��ri� + +__f�m� +, + +729 +__gnuc_va_li� + +__�g +� +__THROW +; + +730 + #vfws�nf + +__isoc99_vfws�nf + + + ) + +731 + #vws�nf + +__isoc99_vws�nf + + + ) + +732 + #vsws�nf + +__isoc99_vsws�nf + + + ) + +736 +__END_NAMESPACE_C99 + + +740 +__BEGIN_NAMESPACE_STD + + +745 +w�t_t + + `fg�wc + ( +__FILE + * +__��am +); + +746 +w�t_t + + `g�wc + ( +__FILE + * +__��am +); + +752 +w�t_t + + `g�wch� + (); + +759 +w�t_t + + `�utwc + ( +wch�_t + +__wc +, +__FILE + * +__��am +); + +760 +w�t_t + + `putwc + ( +wch�_t + +__wc +, +__FILE + * +__��am +); + +766 +w�t_t + + `putwch� + ( +wch�_t + +__wc +); + +774 +wch�_t + * + `fg�ws + (wch�_�* +__��ri� + +__ws +, +__n +, + +775 +__FILE + * +__��ri� + +__��am +); + +781 + `�utws + (cڡ +wch�_t + * +__��ri� + +__ws +, + +782 +__FILE + * +__��ri� + +__��am +); + +789 +w�t_t + + `ung�wc + (w�t_� +__wc +, +__FILE + * +__��am +); + +790 +__END_NAMESPACE_STD + + +793 #ifde� +__USE_GNU + + +801 +w�t_t + + `g�wc_u�ocked + ( +__FILE + * +__��am +); + +802 +w�t_t + + `g�wch�_u�ocked + (); + +810 +w�t_t + + `fg�wc_u�ocked + ( +__FILE + * +__��am +); + +818 +w�t_t + + `�utwc_u�ocked + ( +wch�_t + +__wc +, +__FILE + * +__��am +); + +827 +w�t_t + + `putwc_u�ocked + ( +wch�_t + +__wc +, +__FILE + * +__��am +); + +828 +w�t_t + + `putwch�_u�ocked + ( +wch�_t + +__wc +); + +837 +wch�_t + * + `fg�ws_u�ocked + (wch�_�* +__��ri� + +__ws +, +__n +, + +838 +__FILE + * +__��ri� + +__��am +); + +846 + `�utws_u�ocked + (cڡ +wch�_t + * +__��ri� + +__ws +, + +847 +__FILE + * +__��ri� + +__��am +); + +851 +__BEGIN_NAMESPACE_C99 + + +855 +size_t + + $wcs�ime + ( +wch�_t + * +__��ri� + +__s +, +size_t + +__maxsize +, + +856 cڡ +wch�_t + * +__��ri� + +__f�m� +, + +857 cڡ +tm + * +__��ri� + +__� +� +__THROW +; + +858 +__END_NAMESPACE_C99 + + +860 #ifde� +__USE_GNU + + +861 + ~<xlo��.h +> + +865 +size_t + + $wcs�ime_l + ( +wch�_t + * +__��ri� + +__s +, +size_t + +__maxsize +, + +866 cڡ +wch�_t + * +__��ri� + +__f�m� +, + +867 cڡ +tm + * +__��ri� + +__� +, + +868 +__lo��_t + +__loc +� +__THROW +; + +877 #i� +def�ed + +__USE_UNIX98 + && !def�ed +__USE_GNU + + +878 + #__�ed_iswxxx + + + ) + +879 + ~<w�y�.h +> + +883 #i� +__USE_FORTIFY_LEVEL + > 0 && +def�ed + +__f�tify_fun�i� + + +884 + ~<b�s/wch�2.h +> + +887 #ifde� +__LDBL_COMPAT + + +888 + ~<b�s/wch�-ldbl.h +> + +891 +__END_DECLS + + +899 #unde� +__�ed_mb��e_t + + +900 #unde� +__�ed_w�t_t + + + @/usr/include/asm-generic/errno.h + +1 #i�de� +_ASM_GENERIC_ERRNO_H + + +2 + #_ASM_GENERIC_ERRNO_H + + + ) + +4 + ~<asm-g��ic/��o-ba�.h +> + +6 + #EDEADLK + 35 + + ) + +7 + #ENAMETOOLONG + 36 + + ) + +8 + #ENOLCK + 37 + + ) + +9 + #ENOSYS + 38 + + ) + +10 + #ENOTEMPTY + 39 + + ) + +11 + #ELOOP + 40 + + ) + +12 + #EWOULDBLOCK + +EAGAIN + + + ) + +13 + #ENOMSG + 42 + + ) + +14 + #EIDRM + 43 + + ) + +15 + #ECHRNG + 44 + + ) + +16 + #EL2NSYNC + 45 + + ) + +17 + #EL3HLT + 46 + + ) + +18 + #EL3RST + 47 + + ) + +19 + #ELNRNG + 48 + + ) + +20 + #EUNATCH + 49 + + ) + +21 + #ENOCSI + 50 + + ) + +22 + #EL2HLT + 51 + + ) + +23 + #EBADE + 52 + + ) + +24 + #EBADR + 53 + + ) + +25 + #EXFULL + 54 + + ) + +26 + #ENOANO + 55 + + ) + +27 + #EBADRQC + 56 + + ) + +28 + #EBADSLT + 57 + + ) + +30 + #EDEADLOCK + +EDEADLK + + + ) + +32 + #EBFONT + 59 + + ) + +33 + #ENOSTR + 60 + + ) + +34 + #ENODATA + 61 + + ) + +35 + #ETIME + 62 + + ) + +36 + #ENOSR + 63 + + ) + +37 + #ENONET + 64 + + ) + +38 + #ENOPKG + 65 + + ) + +39 + #EREMOTE + 66 + + ) + +40 + #ENOLINK + 67 + + ) + +41 + #EADV + 68 + + ) + +42 + #ESRMNT + 69 + + ) + +43 + #ECOMM + 70 + + ) + +44 + #EPROTO + 71 + + ) + +45 + #EMULTIHOP + 72 + + ) + +46 + #EDOTDOT + 73 + + ) + +47 + #EBADMSG + 74 + + ) + +48 + #EOVERFLOW + 75 + + ) + +49 + #ENOTUNIQ + 76 + + ) + +50 + #EBADFD + 77 + + ) + +51 + #EREMCHG + 78 + + ) + +52 + #ELIBACC + 79 + + ) + +53 + #ELIBBAD + 80 + + ) + +54 + #ELIBSCN + 81 + + ) + +55 + #ELIBMAX + 82 + + ) + +56 + #ELIBEXEC + 83 + + ) + +57 + #EILSEQ + 84 + + ) + +58 + #ERESTART + 85 + + ) + +59 + #ESTRPIPE + 86 + + ) + +60 + #EUSERS + 87 + + ) + +61 + #ENOTSOCK + 88 + + ) + +62 + #EDESTADDRREQ + 89 + + ) + +63 + #EMSGSIZE + 90 + + ) + +64 + #EPROTOTYPE + 91 + + ) + +65 + #ENOPROTOOPT + 92 + + ) + +66 + #EPROTONOSUPPORT + 93 + + ) + +67 + #ESOCKTNOSUPPORT + 94 + + ) + +68 + #EOPNOTSUPP + 95 + + ) + +69 + #EPFNOSUPPORT + 96 + + ) + +70 + #EAFNOSUPPORT + 97 + + ) + +71 + #EADDRINUSE + 98 + + ) + +72 + #EADDRNOTAVAIL + 99 + + ) + +73 + #ENETDOWN + 100 + + ) + +74 + #ENETUNREACH + 101 + + ) + +75 + #ENETRESET + 102 + + ) + +76 + #ECONNABORTED + 103 + + ) + +77 + #ECONNRESET + 104 + + ) + +78 + #ENOBUFS + 105 + + ) + +79 + #EISCONN + 106 + + ) + +80 + #ENOTCONN + 107 + + ) + +81 + #ESHUTDOWN + 108 + + ) + +82 + #ETOOMANYREFS + 109 + + ) + +83 + #ETIMEDOUT + 110 + + ) + +84 + #ECONNREFUSED + 111 + + ) + +85 + #EHOSTDOWN + 112 + + ) + +86 + #EHOSTUNREACH + 113 + + ) + +87 + #EALREADY + 114 + + ) + +88 + #EINPROGRESS + 115 + + ) + +89 + #ESTALE + 116 + + ) + +90 + #EUCLEAN + 117 + + ) + +91 + #ENOTNAM + 118 + + ) + +92 + #ENAVAIL + 119 + + ) + +93 + #EISNAM + 120 + + ) + +94 + #EREMOTEIO + 121 + + ) + +95 + #EDQUOT + 122 + + ) + +97 + #ENOMEDIUM + 123 + + ) + +98 + #EMEDIUMTYPE + 124 + + ) + +99 + #ECANCELED + 125 + + ) + +100 + #ENOKEY + 126 + + ) + +101 + #EKEYEXPIRED + 127 + + ) + +102 + #EKEYREVOKED + 128 + + ) + +103 + #EKEYREJECTED + 129 + + ) + +106 + #EOWNERDEAD + 130 + + ) + +107 + #ENOTRECOVERABLE + 131 + + ) + +109 + #ERFKILL + 132 + + ) + +111 + #EHWPOISON + 133 + + ) + + @/usr/include/asm-generic/int-ll64.h + +8 #i�de� +_ASM_GENERIC_INT_LL64_H + + +9 + #_ASM_GENERIC_INT_LL64_H + + + ) + +11 + ~<asm/b���l�g.h +> + +13 #i�de� +__ASSEMBLY__ + + +19 +__sig�d__ + + t__s8 +; + +20 + t__u8 +; + +22 +__sig�d__ + + t__s16 +; + +23 + t__u16 +; + +25 +__sig�d__ + + t__s32 +; + +26 + t__u32 +; + +28 #ifde� +__GNUC__ + + +29 +__ex�nsi�__ + +__sig�d__ + + t__s64 +; + +30 +__ex�nsi�__ + + t__u64 +; + +32 +__sig�d__ + + t__s64 +; + +33 + t__u64 +; + + @/usr/include/asm/param.h + +1 + ~<asm-g��ic/��m.h +> + + @/usr/include/asm/posix_types_32.h + +1 #i�de� +_ASM_X86_POSIX_TYPES_32_H + + +2 + #_ASM_X86_POSIX_TYPES_32_H + + + ) + +10 + t__k��l_mode_t +; + +11 + #__k��l_mode_t + +__k��l_mode_t + + + ) + +13 + t__k��l_�c_pid_t +; + +14 + #__k��l_�c_pid_t + +__k��l_�c_pid_t + + + ) + +16 + t__k��l_uid_t +; + +17 + t__k��l_gid_t +; + +18 + #__k��l_uid_t + +__k��l_uid_t + + + ) + +20 + t__k��l_�d_dev_t +; + +21 + #__k��l_�d_dev_t + +__k��l_�d_dev_t + + + ) + +23 + ~<asm-g��ic/posix_ty�s.h +> + + @/usr/include/asm/posix_types_64.h + +1 #i�de� +_ASM_X86_POSIX_TYPES_64_H + + +2 + #_ASM_X86_POSIX_TYPES_64_H + + + ) + +10 + t__k��l_�d_uid_t +; + +11 + t__k��l_�d_gid_t +; + +12 + #__k��l_�d_uid_t + +__k��l_�d_uid_t + + + ) + +14 + t__k��l_�d_dev_t +; + +15 + #__k��l_�d_dev_t + +__k��l_�d_dev_t + + + ) + +17 + ~<asm-g��ic/posix_ty�s.h +> + + @/usr/include/asm/posix_types_x32.h + +1 #i�de� +_ASM_X86_POSIX_TYPES_X32_H + + +2 + #_ASM_X86_POSIX_TYPES_X32_H + + + ) + +13 + t__k��l_l�g_t +; + +14 + t__k��l_ul�g_t +; + +15 + #__k��l_l�g_t + +__k��l_l�g_t + + + ) + +17 + ~<asm/posix_ty�s_64.h +> + + @/usr/include/asm/sockios.h + +1 + ~<asm-g��ic/sockios.h +> + + @/usr/include/asm/swab.h + +1 #i�de� +_ASM_X86_SWAB_H + + +2 + #_ASM_X86_SWAB_H + + + ) + +4 + ~<l�ux/ty�s.h +> + +7 +__�l�e__ + +__u32 + + $__�ch_swab32 +( +__u32 + +v� +) + +9 + `__asm__ +("bsw��%0" : "�" ( +v� +) : "0" (val)); + +10 +v� +; + +11 + } +} + +12 + #__�ch_swab32 + +__�ch_swab32 + + + ) + +14 +__�l�e__ + +__u64 + + $__�ch_swab64 +( +__u64 + +v� +) + +16 #ifde� +__i386__ + + +19 +__u32 + +a +; + +20 +__u32 + +b +; + +21 } +s +; + +22 +__u64 + +u +; + +23 } +v +; + +24 +v +. +u + = +v� +; + +25 + `__asm__ +("bswapl %0 ; bswapl %1 ; xchgl %0,%1" + +26 : "�" ( +v +. +s +. +a +), "�" (v.s. +b +) + +27 : "0" ( +v +. +s +. +a +), "1" (v.s. +b +)); + +28 +v +. +u +; + +30 + `__asm__ +("bsw�q %0" : "�" ( +v� +) : "0" (val)); + +31 +v� +; + +33 + } +} + +34 + #__�ch_swab64 + +__�ch_swab64 + + + ) + + @/usr/include/bits/wchar-ldbl.h + +19 #i�de� +_WCHAR_H + + +23 #i� +def�ed + +__USE_ISOC95 + || def�ed +__USE_UNIX98 + + +24 +__BEGIN_NAMESPACE_C99 + + +25 +__LDBL_REDIR_DECL + ( +fw��tf +); + +26 +__LDBL_REDIR_DECL + ( +w��tf +); + +27 +__LDBL_REDIR_DECL + ( +sw��tf +); + +28 +__LDBL_REDIR_DECL + ( +vfw��tf +); + +29 +__LDBL_REDIR_DECL + ( +vw��tf +); + +30 +__LDBL_REDIR_DECL + ( +vsw��tf +); + +31 #i� +def�ed + +__USE_ISOC99 + && !def�ed +__USE_GNU + \ + +32 && ! +def�ed + + g__REDIRECT + \ + +33 && ( +def�ed + + g__STRICT_ANSI__ + || def�ed + g__USE_XOPEN2K +) + +34 + $__LDBL_REDIR1_DECL + ( +fws�nf +, +__�dbl___isoc99_fws�nf +) + +35 + $__LDBL_REDIR1_DECL + ( +ws�nf +, +__�dbl___isoc99_ws�nf +) + +36 + $__LDBL_REDIR1_DECL + ( +sws�nf +, +__�dbl___isoc99_sws�nf +) + +38 + `__LDBL_REDIR_DECL + ( +fws�nf +); + +39 + `__LDBL_REDIR_DECL + ( +ws�nf +); + +40 + `__LDBL_REDIR_DECL + ( +sws�nf +); + +42 +__END_NAMESPACE_C99 + + +45 #ifde� +__USE_ISOC99 + + +46 +__BEGIN_NAMESPACE_C99 + + +47 + `__LDBL_REDIR1_DECL + ( +wc��d +, +wc�od +); + +48 #i�! +def�ed + +__USE_GNU + && !def�ed +__REDIRECT + \ + +49 && ( +def�ed + +__STRICT_ANSI__ + || def�ed +__USE_XOPEN2K +) + +50 + $__LDBL_REDIR1_DECL + ( +vfws�nf +, +__�dbl___isoc99_vfws�nf +) + +51 + $__LDBL_REDIR1_DECL + ( +vws�nf +, +__�dbl___isoc99_vws�nf +) + +52 + $__LDBL_REDIR1_DECL + ( +vsws�nf +, +__�dbl___isoc99_vsws�nf +) + +54 + `__LDBL_REDIR_DECL + ( +vfws�nf +); + +55 + `__LDBL_REDIR_DECL + ( +vws�nf +); + +56 + `__LDBL_REDIR_DECL + ( +vsws�nf +); + +58 +__END_NAMESPACE_C99 + + +61 #ifde� +__USE_GNU + + +62 + `__LDBL_REDIR1_DECL + ( +wc��d_l +, +wc�od_l +); + +65 #i� +__USE_FORTIFY_LEVEL + > 0 && +def�ed + +__f�tify_fun�i� + + +66 + $__LDBL_REDIR_DECL + ( +__sw��tf_chk +) + +67 + $__LDBL_REDIR_DECL + ( +__vsw��tf_chk +) + +68 #i� +__USE_FORTIFY_LEVEL + > 1 + +69 + $__LDBL_REDIR_DECL + ( +__fw��tf_chk +) + +70 + $__LDBL_REDIR_DECL + ( +__w��tf_chk +) + +71 + $__LDBL_REDIR_DECL + ( +__vfw��tf_chk +) + +72 + $__LDBL_REDIR_DECL + ( +__vw��tf_chk +) + + @/usr/include/bits/wchar2.h + +19 #i�de� +_WCHAR_H + + +24 +wch�_t + * + $__wmem�y_chk + ( +wch�_t + * +__��ri� + +__s1 +, + +25 cڡ +wch�_t + * +__��ri� + +__s2 +, +size_t + +__n +, + +26 +size_t + +__ns1 +� +__THROW +; + +27 +wch�_t + * + `__REDIRECT_NTH + ( +__wmem�y_��s +, + +28 ( +wch�_t + * +__��ri� + +__s1 +, + +29 cڡ +wch�_t + * +__��ri� + +__s2 +, +size_t + +__n +), + +30 +wmem�y +); + +31 +wch�_t + * + `__REDIRECT_NTH + ( +__wmem�y_chk_w�n +, + +32 ( +wch�_t + * +__��ri� + +__s1 +, + +33 cڡ +wch�_t + * +__��ri� + +__s2 +, +size_t + +__n +, + +34 +size_t + +__ns1 +), +__wmem�y_chk +) + +35 + `__w�ljr + ("wmemcpy called with�ength bigger�han size of destination " + +38 +__f�tify_fun�i� + +wch�_t + * + +39 + `__NTH + ( + $wmem�y + ( +wch�_t + * +__��ri� + +__s1 +, cڡ wch�_�*__��ri� +__s2 +, + +40 +size_t + +__n +)) + +42 i�( + `__bos0 + ( +__s1 +�!�( +size_t +) -1) + +44 i�(! + `__bu�t�_cڡ�t_p + ( +__n +)) + +45 + `__wmem�y_chk + ( +__s1 +, +__s2 +, +__n +, + +46 + `__bos0 + ( +__s1 +�/ ( +wch�_t +)); + +48 i�( +__n + > + `__bos0 + ( +__s1 +�/ ( +wch�_t +)) + +49 + `__wmem�y_chk_w�n + ( +__s1 +, +__s2 +, +__n +, + +50 + `__bos0 + ( +__s1 +�/ ( +wch�_t +)); + +52 + `__wmem�y_��s + ( +__s1 +, +__s2 +, +__n +); + +53 + } +} + +56 +wch�_t + * + $__wmemmove_chk + ( +wch�_t + * +__s1 +, cڡ wch�_�* +__s2 +, + +57 +size_t + +__n +, size_� +__ns1 +� +__THROW +; + +58 +wch�_t + * + `__REDIRECT_NTH + ( +__wmemmove_��s +, (wch�_�* +__s1 +, + +59 cڡ +wch�_t + * +__s2 +, + +60 +size_t + +__n +), +wmemmove +); + +61 +wch�_t + * + `__REDIRECT_NTH + ( +__wmemmove_chk_w�n +, + +62 ( +wch�_t + * +__s1 +, cڡ wch�_�* +__s2 +, + +63 +size_t + +__n +, size_� +__ns1 +), +__wmemmove_chk +) + +64 + `__w�ljr + ("wmemmove called with�ength bigger�han size of destination " + +67 +__f�tify_fun�i� + +wch�_t + * + +68 + `__NTH + ( + $wmemmove + ( +wch�_t + * +__s1 +, cڡ wch�_�* +__s2 +, +size_t + +__n +)) + +70 i�( + `__bos0 + ( +__s1 +�!�( +size_t +) -1) + +72 i�(! + `__bu�t�_cڡ�t_p + ( +__n +)) + +73 + `__wmemmove_chk + ( +__s1 +, +__s2 +, +__n +, + +74 + `__bos0 + ( +__s1 +�/ ( +wch�_t +)); + +76 i�( +__n + > + `__bos0 + ( +__s1 +�/ ( +wch�_t +)) + +77 + `__wmemmove_chk_w�n + ( +__s1 +, +__s2 +, +__n +, + +78 + `__bos0 + ( +__s1 +�/ ( +wch�_t +)); + +80 + `__wmemmove_��s + ( +__s1 +, +__s2 +, +__n +); + +81 + } +} + +84 #ifde� +__USE_GNU + + +85 +wch�_t + * + $__wmemp�y_chk + ( +wch�_t + * +__��ri� + +__s1 +, + +86 cڡ +wch�_t + * +__��ri� + +__s2 +, +size_t + +__n +, + +87 +size_t + +__ns1 +� +__THROW +; + +88 +wch�_t + * + `__REDIRECT_NTH + ( +__wmemp�y_��s +, + +89 ( +wch�_t + * +__��ri� + +__s1 +, + +90 cڡ +wch�_t + * +__��ri� + +__s2 +, + +91 +size_t + +__n +), +wmemp�y +); + +92 +wch�_t + * + `__REDIRECT_NTH + ( +__wmemp�y_chk_w�n +, + +93 ( +wch�_t + * +__��ri� + +__s1 +, + +94 cڡ +wch�_t + * +__��ri� + +__s2 +, +size_t + +__n +, + +95 +size_t + +__ns1 +), +__wmemp�y_chk +) + +96 + `__w�ljr + ("wmempcpy called with�ength bigger�han size of destination " + +99 +__f�tify_fun�i� + +wch�_t + * + +100 + `__NTH + ( + $wmemp�y + ( +wch�_t + * +__��ri� + +__s1 +, cڡ wch�_�*__��ri� +__s2 +, + +101 +size_t + +__n +)) + +103 i�( + `__bos0 + ( +__s1 +�!�( +size_t +) -1) + +105 i�(! + `__bu�t�_cڡ�t_p + ( +__n +)) + +106 + `__wmemp�y_chk + ( +__s1 +, +__s2 +, +__n +, + +107 + `__bos0 + ( +__s1 +�/ ( +wch�_t +)); + +109 i�( +__n + > + `__bos0 + ( +__s1 +�/ ( +wch�_t +)) + +110 + `__wmemp�y_chk_w�n + ( +__s1 +, +__s2 +, +__n +, + +111 + `__bos0 + ( +__s1 +�/ ( +wch�_t +)); + +113 + `__wmemp�y_��s + ( +__s1 +, +__s2 +, +__n +); + +114 + } +} + +118 +wch�_t + * + $__wmem�t_chk + ( +wch�_t + * +__s +, wch�_� +__c +, +size_t + +__n +, + +119 +size_t + +__ns +� +__THROW +; + +120 +wch�_t + * + `__REDIRECT_NTH + ( +__wmem�t_��s +, (wch�_�* +__s +, wch�_� +__c +, + +121 +size_t + +__n +), +wmem�t +); + +122 +wch�_t + * + `__REDIRECT_NTH + ( +__wmem�t_chk_w�n +, + +123 ( +wch�_t + * +__s +, wch�_� +__c +, +size_t + +__n +, + +124 +size_t + +__ns +), +__wmem�t_chk +) + +125 + `__w�ljr + ("wmemset called with�ength bigger�han size of destination " + +128 +__f�tify_fun�i� + +wch�_t + * + +129 + `__NTH + ( + $wmem�t + ( +wch�_t + * +__s +, wch�_� +__c +, +size_t + +__n +)) + +131 i�( + `__bos0 + ( +__s +�!�( +size_t +) -1) + +133 i�(! + `__bu�t�_cڡ�t_p + ( +__n +)) + +134 + `__wmem�t_chk + ( +__s +, +__c +, +__n +, + `__bos0 + (__s�/ ( +wch�_t +)); + +136 i�( +__n + > + `__bos0 + ( +__s +�/ ( +wch�_t +)) + +137 + `__wmem�t_chk_w�n + ( +__s +, +__c +, +__n +, + +138 + `__bos0 + ( +__s +�/ ( +wch�_t +)); + +140 + `__wmem�t_��s + ( +__s +, +__c +, +__n +); + +141 + } +} + +144 +wch�_t + * + $__wcs�y_chk + ( +wch�_t + * +__��ri� + +__de� +, + +145 cڡ +wch�_t + * +__��ri� + +__�c +, + +146 +size_t + +__n +� +__THROW +; + +147 +wch�_t + * + `__REDIRECT_NTH + ( +__wcs�y_��s +, + +148 ( +wch�_t + * +__��ri� + +__de� +, + +149 cڡ +wch�_t + * +__��ri� + +__�c +), +wcs�y +); + +151 +__f�tify_fun�i� + +wch�_t + * + +152 + `__NTH + ( + $wcs�y + ( +wch�_t + * +__��ri� + +__de� +, cڡ wch�_�*__��ri� +__�c +)) + +154 i�( + `__bos + ( +__de� +�!�( +size_t +) -1) + +155 + `__wcs�y_chk + ( +__de� +, +__�c +, + `__bos + (__de��/ ( +wch�_t +)); + +156 + `__wcs�y_��s + ( +__de� +, +__�c +); + +157 + } +} + +160 +wch�_t + * + $__w��y_chk + ( +wch�_t + * +__��ri� + +__de� +, + +161 cڡ +wch�_t + * +__��ri� + +__�c +, + +162 +size_t + +__de��n +� +__THROW +; + +163 +wch�_t + * + `__REDIRECT_NTH + ( +__w��y_��s +, + +164 ( +wch�_t + * +__��ri� + +__de� +, + +165 cڡ +wch�_t + * +__��ri� + +__�c +), +w��y +); + +167 +__f�tify_fun�i� + +wch�_t + * + +168 + `__NTH + ( + $w��y + ( +wch�_t + * +__��ri� + +__de� +, cڡ wch�_�*__��ri� +__�c +)) + +170 i�( + `__bos + ( +__de� +�!�( +size_t +) -1) + +171 + `__w��y_chk + ( +__de� +, +__�c +, + `__bos + (__de��/ ( +wch�_t +)); + +172 + `__w��y_��s + ( +__de� +, +__�c +); + +173 + } +} + +176 +wch�_t + * + $__wc��y_chk + ( +wch�_t + * +__��ri� + +__de� +, + +177 cڡ +wch�_t + * +__��ri� + +__�c +, +size_t + +__n +, + +178 +size_t + +__de��n +� +__THROW +; + +179 +wch�_t + * + `__REDIRECT_NTH + ( +__wc��y_��s +, + +180 ( +wch�_t + * +__��ri� + +__de� +, + +181 cڡ +wch�_t + * +__��ri� + +__�c +, + +182 +size_t + +__n +), +wc��y +); + +183 +wch�_t + * + `__REDIRECT_NTH + ( +__wc��y_chk_w�n +, + +184 ( +wch�_t + * +__��ri� + +__de� +, + +185 cڡ +wch�_t + * +__��ri� + +__�c +, + +186 +size_t + +__n +, size_� +__de��n +), +__wc��y_chk +) + +187 + `__w�ljr + ("wcsncpy called with�ength bigger�han size of destination " + +190 +__f�tify_fun�i� + +wch�_t + * + +191 + `__NTH + ( + $wc��y + ( +wch�_t + * +__��ri� + +__de� +, cڡ wch�_�*__��ri� +__�c +, + +192 +size_t + +__n +)) + +194 i�( + `__bos + ( +__de� +�!�( +size_t +) -1) + +196 i�(! + `__bu�t�_cڡ�t_p + ( +__n +)) + +197 + `__wc��y_chk + ( +__de� +, +__�c +, +__n +, + +198 + `__bos + ( +__de� +�/ ( +wch�_t +)); + +199 i�( +__n + > + `__bos + ( +__de� +�/ ( +wch�_t +)) + +200 + `__wc��y_chk_w�n + ( +__de� +, +__�c +, +__n +, + +201 + `__bos + ( +__de� +�/ ( +wch�_t +)); + +203 + `__wc��y_��s + ( +__de� +, +__�c +, +__n +); + +204 + } +} + +207 +wch�_t + * + $__w�n�y_chk + ( +wch�_t + * +__��ri� + +__de� +, + +208 cڡ +wch�_t + * +__��ri� + +__�c +, +size_t + +__n +, + +209 +size_t + +__de��n +� +__THROW +; + +210 +wch�_t + * + `__REDIRECT_NTH + ( +__w�n�y_��s +, + +211 ( +wch�_t + * +__��ri� + +__de� +, + +212 cڡ +wch�_t + * +__��ri� + +__�c +, + +213 +size_t + +__n +), +w�n�y +); + +214 +wch�_t + * + `__REDIRECT_NTH + ( +__w�n�y_chk_w�n +, + +215 ( +wch�_t + * +__��ri� + +__de� +, + +216 cڡ +wch�_t + * +__��ri� + +__�c +, + +217 +size_t + +__n +, size_� +__de��n +), +__w�n�y_chk +) + +218 + `__w�ljr + ("wcpncpy called with�ength bigger�han size of destination " + +221 +__f�tify_fun�i� + +wch�_t + * + +222 + `__NTH + ( + $w�n�y + ( +wch�_t + * +__��ri� + +__de� +, cڡ wch�_�*__��ri� +__�c +, + +223 +size_t + +__n +)) + +225 i�( + `__bos + ( +__de� +�!�( +size_t +) -1) + +227 i�(! + `__bu�t�_cڡ�t_p + ( +__n +)) + +228 + `__w�n�y_chk + ( +__de� +, +__�c +, +__n +, + +229 + `__bos + ( +__de� +�/ ( +wch�_t +)); + +230 i�( +__n + > + `__bos + ( +__de� +�/ ( +wch�_t +)) + +231 + `__w�n�y_chk_w�n + ( +__de� +, +__�c +, +__n +, + +232 + `__bos + ( +__de� +�/ ( +wch�_t +)); + +234 + `__w�n�y_��s + ( +__de� +, +__�c +, +__n +); + +235 + } +} + +238 +wch�_t + * + $__wcs�t_chk + ( +wch�_t + * +__��ri� + +__de� +, + +239 cڡ +wch�_t + * +__��ri� + +__�c +, + +240 +size_t + +__de��n +� +__THROW +; + +241 +wch�_t + * + `__REDIRECT_NTH + ( +__wcs�t_��s +, + +242 ( +wch�_t + * +__��ri� + +__de� +, + +243 cڡ +wch�_t + * +__��ri� + +__�c +), +wcs�t +); + +245 +__f�tify_fun�i� + +wch�_t + * + +246 + `__NTH + ( + $wcs�t + ( +wch�_t + * +__��ri� + +__de� +, cڡ wch�_�*__��ri� +__�c +)) + +248 i�( + `__bos + ( +__de� +�!�( +size_t +) -1) + +249 + `__wcs�t_chk + ( +__de� +, +__�c +, + `__bos + (__de��/ ( +wch�_t +)); + +250 + `__wcs�t_��s + ( +__de� +, +__�c +); + +251 + } +} + +254 +wch�_t + * + $__wc��t_chk + ( +wch�_t + * +__��ri� + +__de� +, + +255 cڡ +wch�_t + * +__��ri� + +__�c +, + +256 +size_t + +__n +, size_� +__de��n +� +__THROW +; + +257 +wch�_t + * + `__REDIRECT_NTH + ( +__wc��t_��s +, + +258 ( +wch�_t + * +__��ri� + +__de� +, + +259 cڡ +wch�_t + * +__��ri� + +__�c +, + +260 +size_t + +__n +), +wc��t +); + +262 +__f�tify_fun�i� + +wch�_t + * + +263 + `__NTH + ( + $wc��t + ( +wch�_t + * +__��ri� + +__de� +, cڡ wch�_�*__��ri� +__�c +, + +264 +size_t + +__n +)) + +266 i�( + `__bos + ( +__de� +�!�( +size_t +) -1) + +267 + `__wc��t_chk + ( +__de� +, +__�c +, +__n +, + +268 + `__bos + ( +__de� +�/ ( +wch�_t +)); + +269 + `__wc��t_��s + ( +__de� +, +__�c +, +__n +); + +270 + } +} + +273 + $__sw��tf_chk + ( +wch�_t + * +__��ri� + +__s +, +size_t + +__n +, + +274 +__�ag +, +size_t + +__s_�n +, + +275 cڡ +wch�_t + * +__��ri� + +__f�m� +, ...) + +276 +__THROW + ; + +278 + `__REDIRECT_NTH_LDBL + ( +__sw��tf_��s +, + +279 ( +wch�_t + * +__��ri� + +__s +, +size_t + +__n +, + +280 cڡ +wch�_t + * +__��ri� + +__fmt +, ...), + +281 +sw��tf +); + +283 #ifde� +__va_�g_�ck + + +284 +__f�tify_fun�i� + + +285 + `__NTH + ( + $sw��tf + ( +wch�_t + * +__��ri� + +__s +, +size_t + +__n +, + +286 cڡ +wch�_t + * +__��ri� + +__fmt +, ...)) + +288 i�( + `__bos + ( +__s +�!�( +size_t +�-1 || +__USE_FORTIFY_LEVEL + > 1) + +289 + `__sw��tf_chk + ( +__s +, +__n +, +__USE_FORTIFY_LEVEL + - 1, + +290 + `__bos + ( +__s +�/ ( +wch�_t +), + +291 +__fmt +, + `__va_�g_�ck + ()); + +292 + `__sw��tf_��s + ( +__s +, +__n +, +__fmt +, + `__va_�g_�ck + ()); + +293 + } +} + +294 #�i�! +def�ed + +__�lu�lus + + +296 + #sw��tf +( +s +, +n +, ...) \ + +297 ( + `__bos + ( +s +�!�( +size_t +�-1 || +__USE_FORTIFY_LEVEL + > 1 \ + +298 ? + `__sw��tf_chk + ( +s +, +n +, +__USE_FORTIFY_LEVEL + - 1, \ + +299 + `__bos + ( +s +�/ ( +wch�_t +), +__VA_ARGS__ +) \ + +300 : + `sw��tf + ( +s +, +n +, +__VA_ARGS__ +)) + + ) + +303 + $__vsw��tf_chk + ( +wch�_t + * +__��ri� + +__s +, +size_t + +__n +, + +304 +__�ag +, +size_t + +__s_�n +, + +305 cڡ +wch�_t + * +__��ri� + +__f�m� +, + +306 +__gnuc_va_li� + +__�g +) + +307 +__THROW + ; + +309 + `__REDIRECT_NTH_LDBL + ( +__vsw��tf_��s +, + +310 ( +wch�_t + * +__��ri� + +__s +, +size_t + +__n +, + +311 cڡ +wch�_t + * +__��ri� + +__fmt +, + +312 +__gnuc_va_li� + +__� +), +vsw��tf +); + +314 +__f�tify_fun�i� + + +315 + `__NTH + ( + $vsw��tf + ( +wch�_t + * +__��ri� + +__s +, +size_t + +__n +, + +316 cڡ +wch�_t + * +__��ri� + +__fmt +, +__gnuc_va_li� + +__� +)) + +318 i�( + `__bos + ( +__s +�!�( +size_t +�-1 || +__USE_FORTIFY_LEVEL + > 1) + +319 + `__vsw��tf_chk + ( +__s +, +__n +, +__USE_FORTIFY_LEVEL + - 1, + +320 + `__bos + ( +__s +�/ ( +wch�_t +), +__fmt +, +__� +); + +321 + `__vsw��tf_��s + ( +__s +, +__n +, +__fmt +, +__� +); + +322 + } +} + +325 #i� +__USE_FORTIFY_LEVEL + > 1 + +327 +__fw��tf_chk + ( +__FILE + * +__��ri� + +__��am +, +__�ag +, + +328 cڡ +wch�_t + * +__��ri� + +__f�m� +, ...); + +329 +__w��tf_chk + ( +__�ag +, cڡ +wch�_t + * +__��ri� + +__f�m� +, + +331 +__vfw��tf_chk + ( +__FILE + * +__��ri� + +__��am +, +__�ag +, + +332 cڡ +wch�_t + * +__��ri� + +__f�m� +, + +333 +__gnuc_va_li� + +__� +); + +334 +__vw��tf_chk + ( +__�ag +, cڡ +wch�_t + * +__��ri� + +__f�m� +, + +335 +__gnuc_va_li� + +__� +); + +337 #ifde� +__va_�g_�ck + + +338 +__f�tify_fun�i� + + +339 + $w��tf + (cڡ +wch�_t + * +__��ri� + +__fmt +, ...) + +341 + `__w��tf_chk + ( +__USE_FORTIFY_LEVEL + - 1, +__fmt +, + `__va_�g_�ck + ()); + +342 + } +} + +344 +__f�tify_fun�i� + + +345 + $fw��tf + ( +__FILE + * +__��ri� + +__��am +, cڡ +wch�_t + *__��ri� +__fmt +, ...) + +347 + `__fw��tf_chk + ( +__��am +, +__USE_FORTIFY_LEVEL + - 1, +__fmt +, + +348 + `__va_�g_�ck + ()); + +349 + } +} + +350 #�i�! +def�ed + +__�lu�lus + + +351 + #w��tf +(...) \ + +352 + `__w��tf_chk + ( +__USE_FORTIFY_LEVEL + - 1, +__VA_ARGS__ +) + + ) + +353 + #fw��tf +( +��am +, ...) \ + +354 + `__fw��tf_chk + ( +��am +, +__USE_FORTIFY_LEVEL + - 1, +__VA_ARGS__ +) + + ) + +357 +__f�tify_fun�i� + + +358 + $vw��tf + (cڡ +wch�_t + * +__��ri� + +__fmt +, +__gnuc_va_li� + +__� +) + +360 + `__vw��tf_chk + ( +__USE_FORTIFY_LEVEL + - 1, +__fmt +, +__� +); + +361 + } +} + +363 +__f�tify_fun�i� + + +364 + $vfw��tf + ( +__FILE + * +__��ri� + +__��am +, + +365 cڡ +wch�_t + * +__��ri� + +__fmt +, +__gnuc_va_li� + +__� +) + +367 + `__vfw��tf_chk + ( +__��am +, +__USE_FORTIFY_LEVEL + - 1, +__fmt +, +__� +); + +368 + } +} + +372 +wch�_t + * + $__fg�ws_chk + ( +wch�_t + * +__��ri� + +__s +, +size_t + +__size +, +__n +, + +373 +__FILE + * +__��ri� + +__��am +� +__wur +; + +374 +wch�_t + * + `__REDIRECT + ( +__fg�ws_��s +, + +375 ( +wch�_t + * +__��ri� + +__s +, +__n +, + +376 +__FILE + * +__��ri� + +__��am +), +fg�ws +� +__wur +; + +377 +wch�_t + * + `__REDIRECT + ( +__fg�ws_chk_w�n +, + +378 ( +wch�_t + * +__��ri� + +__s +, +size_t + +__size +, +__n +, + +379 +__FILE + * +__��ri� + +__��am +), +__fg�ws_chk +) + +380 +__wur + + `__w�ljr + ("fgetws called with bigger size�han�ength " + +383 +__f�tify_fun�i� + +__wur + +wch�_t + * + +384 + $fg�ws + ( +wch�_t + * +__��ri� + +__s +, +__n +, +__FILE + *__��ri� +__��am +) + +386 i�( + `__bos + ( +__s +�!�( +size_t +) -1) + +388 i�(! + `__bu�t�_cڡ�t_p + ( +__n +) || __n <= 0) + +389 + `__fg�ws_chk + ( +__s +, + `__bos + (__s�/ ( +wch�_t +), + +390 +__n +, +__��am +); + +392 i�(( +size_t +� +__n + > + `__bos + ( +__s +�/ ( +wch�_t +)) + +393 + `__fg�ws_chk_w�n + ( +__s +, + `__bos + (__s�/ ( +wch�_t +), + +394 +__n +, +__��am +); + +396 + `__fg�ws_��s + ( +__s +, +__n +, +__��am +); + +397 + } +} + +399 #ifde� +__USE_GNU + + +400 +wch�_t + * + $__fg�ws_u�ocked_chk + ( +wch�_t + * +__��ri� + +__s +, +size_t + +__size +, + +401 +__n +, +__FILE + * +__��ri� + +__��am +) + +402 +__wur +; + +403 +wch�_t + * + `__REDIRECT + ( +__fg�ws_u�ocked_��s +, + +404 ( +wch�_t + * +__��ri� + +__s +, +__n +, + +405 +__FILE + * +__��ri� + +__��am +), +fg�ws_u�ocked +) + +406 +__wur +; + +407 +wch�_t + * + `__REDIRECT + ( +__fg�ws_u�ocked_chk_w�n +, + +408 ( +wch�_t + * +__��ri� + +__s +, +size_t + +__size +, +__n +, + +409 +__FILE + * +__��ri� + +__��am +), + +410 +__fg�ws_u�ocked_chk +) + +411 +__wur + + `__w�ljr + ("fgetws_unlocked called with bigger size�han�ength " + +414 +__f�tify_fun�i� + +__wur + +wch�_t + * + +415 + $fg�ws_u�ocked + ( +wch�_t + * +__��ri� + +__s +, +__n +, +__FILE + *__��ri� +__��am +) + +417 i�( + `__bos + ( +__s +�!�( +size_t +) -1) + +419 i�(! + `__bu�t�_cڡ�t_p + ( +__n +) || __n <= 0) + +420 + `__fg�ws_u�ocked_chk + ( +__s +, + `__bos + (__s�/ ( +wch�_t +), + +421 +__n +, +__��am +); + +423 i�(( +size_t +� +__n + > + `__bos + ( +__s +�/ ( +wch�_t +)) + +424 + `__fg�ws_u�ocked_chk_w�n + ( +__s +, + `__bos + (__s�/ ( +wch�_t +), + +425 +__n +, +__��am +); + +427 + `__fg�ws_u�ocked_��s + ( +__s +, +__n +, +__��am +); + +428 + } +} + +432 +size_t + + $__w�tomb_chk + (* +__��ri� + +__s +, +wch�_t + +__wch� +, + +433 +mb��e_t + * +__��ri� + +__p +, + +434 +size_t + +__bu� +� +__THROW + +__wur +; + +435 +size_t + + `__REDIRECT_NTH + ( +__w�tomb_��s +, + +436 (* +__��ri� + +__s +, +wch�_t + +__wch� +, + +437 +mb��e_t + * +__��ri� + +__ps +), +w�tomb +� +__wur +; + +439 +__f�tify_fun�i� + +__wur + +size_t + + +440 + `__NTH + ( + $w�tomb + (* +__��ri� + +__s +, +wch�_t + +__wch� +, + +441 +mb��e_t + * +__��ri� + +__ps +)) + +446 + #__WCHAR_MB_LEN_MAX + 16 + + ) + +447 #i� +def�ed + +MB_LEN_MAX + && MB_LEN_MAX !� +__WCHAR_MB_LEN_MAX + + +450 i�( + `__bos + ( +__s +�!�( +size_t +�-1 && +__WCHAR_MB_LEN_MAX + > __bos (__s)) + +451 + `__w�tomb_chk + ( +__s +, +__wch� +, +__ps +, + `__bos + (__s)); + +452 + `__w�tomb_��s + ( +__s +, +__wch� +, +__ps +); + +453 + } +} + +456 +size_t + + $__mb�towcs_chk + ( +wch�_t + * +__��ri� + +__d� +, + +457 cڡ ** +__��ri� + +__�c +, + +458 +size_t + +__�n +, +mb��e_t + * +__��ri� + +__ps +, + +459 +size_t + +__d��n +� +__THROW +; + +460 +size_t + + `__REDIRECT_NTH + ( +__mb�towcs_��s +, + +461 ( +wch�_t + * +__��ri� + +__d� +, + +462 cڡ ** +__��ri� + +__�c +, + +463 +size_t + +__�n +, +mb��e_t + * +__��ri� + +__ps +), + +464 +mb�towcs +); + +465 +size_t + + `__REDIRECT_NTH + ( +__mb�towcs_chk_w�n +, + +466 ( +wch�_t + * +__��ri� + +__d� +, + +467 cڡ ** +__��ri� + +__�c +, + +468 +size_t + +__�n +, +mb��e_t + * +__��ri� + +__ps +, + +469 +size_t + +__d��n +), +__mb�towcs_chk +) + +470 + `__w�ljr + ("mbsrtowcs called with dst buffer smaller�han�en " + +473 +__f�tify_fun�i� + +size_t + + +474 + `__NTH + ( + $mb�towcs + ( +wch�_t + * +__��ri� + +__d� +, cڡ **__��ri� +__�c +, + +475 +size_t + +__�n +, +mb��e_t + * +__��ri� + +__ps +)) + +477 i�( + `__bos + ( +__d� +�!�( +size_t +) -1) + +479 i�(! + `__bu�t�_cڡ�t_p + ( +__�n +)) + +480 + `__mb�towcs_chk + ( +__d� +, +__�c +, +__�n +, +__ps +, + +481 + `__bos + ( +__d� +�/ ( +wch�_t +)); + +483 i�( +__�n + > + `__bos + ( +__d� +�/ ( +wch�_t +)) + +484 + `__mb�towcs_chk_w�n + ( +__d� +, +__�c +, +__�n +, +__ps +, + +485 + `__bos + ( +__d� +�/ ( +wch�_t +)); + +487 + `__mb�towcs_��s + ( +__d� +, +__�c +, +__�n +, +__ps +); + +488 + } +} + +491 +size_t + + $__wc�tombs_chk + (* +__��ri� + +__d� +, + +492 cڡ +wch�_t + ** +__��ri� + +__�c +, + +493 +size_t + +__�n +, +mb��e_t + * +__��ri� + +__ps +, + +494 +size_t + +__d��n +� +__THROW +; + +495 +size_t + + `__REDIRECT_NTH + ( +__wc�tombs_��s +, + +496 (* +__��ri� + +__d� +, + +497 cڡ +wch�_t + ** +__��ri� + +__�c +, + +498 +size_t + +__�n +, +mb��e_t + * +__��ri� + +__ps +), + +499 +wc�tombs +); + +500 +size_t + + `__REDIRECT_NTH + ( +__wc�tombs_chk_w�n +, + +501 (* +__��ri� + +__d� +, + +502 cڡ +wch�_t + ** +__��ri� + +__�c +, + +503 +size_t + +__�n +, +mb��e_t + * +__��ri� + +__ps +, + +504 +size_t + +__d��n +), +__wc�tombs_chk +) + +505 + `__w�ljr + ("wcsrtombs called with dst buffer smaller�han�en"); + +507 +__f�tify_fun�i� + +size_t + + +508 + `__NTH + ( + $wc�tombs + (* +__��ri� + +__d� +, cڡ +wch�_t + **__��ri� +__�c +, + +509 +size_t + +__�n +, +mb��e_t + * +__��ri� + +__ps +)) + +511 i�( + `__bos + ( +__d� +�!�( +size_t +) -1) + +513 i�(! + `__bu�t�_cڡ�t_p + ( +__�n +)) + +514 + `__wc�tombs_chk + ( +__d� +, +__�c +, +__�n +, +__ps +, + `__bos + (__dst)); + +516 i�( +__�n + > + `__bos + ( +__d� +)) + +517 + `__wc�tombs_chk_w�n + ( +__d� +, +__�c +, +__�n +, +__ps +, + `__bos + (__dst)); + +519 + `__wc�tombs_��s + ( +__d� +, +__�c +, +__�n +, +__ps +); + +520 + } +} + +523 #ifde� +__USE_GNU + + +524 +size_t + + $__mb��owcs_chk + ( +wch�_t + * +__��ri� + +__d� +, + +525 cڡ ** +__��ri� + +__�c +, +size_t + +__nmc +, + +526 +size_t + +__�n +, +mb��e_t + * +__��ri� + +__ps +, + +527 +size_t + +__d��n +� +__THROW +; + +528 +size_t + + `__REDIRECT_NTH + ( +__mb��owcs_��s +, + +529 ( +wch�_t + * +__��ri� + +__d� +, + +530 cڡ ** +__��ri� + +__�c +, +size_t + +__nmc +, + +531 +size_t + +__�n +, +mb��e_t + * +__��ri� + +__ps +), + +532 +mb��owcs +); + +533 +size_t + + `__REDIRECT_NTH + ( +__mb��owcs_chk_w�n +, + +534 ( +wch�_t + * +__��ri� + +__d� +, + +535 cڡ ** +__��ri� + +__�c +, +size_t + +__nmc +, + +536 +size_t + +__�n +, +mb��e_t + * +__��ri� + +__ps +, + +537 +size_t + +__d��n +), +__mb��owcs_chk +) + +538 + `__w�ljr + ("mbsnrtowcs called with dst buffer smaller�han�en " + +541 +__f�tify_fun�i� + +size_t + + +542 + `__NTH + ( + $mb��owcs + ( +wch�_t + * +__��ri� + +__d� +, cڡ **__��ri� +__�c +, + +543 +size_t + +__nmc +, size_� +__�n +, +mb��e_t + * +__��ri� + +__ps +)) + +545 i�( + `__bos + ( +__d� +�!�( +size_t +) -1) + +547 i�(! + `__bu�t�_cڡ�t_p + ( +__�n +)) + +548 + `__mb��owcs_chk + ( +__d� +, +__�c +, +__nmc +, +__�n +, +__ps +, + +549 + `__bos + ( +__d� +�/ ( +wch�_t +)); + +551 i�( +__�n + > + `__bos + ( +__d� +�/ ( +wch�_t +)) + +552 + `__mb��owcs_chk_w�n + ( +__d� +, +__�c +, +__nmc +, +__�n +, +__ps +, + +553 + `__bos + ( +__d� +�/ ( +wch�_t +)); + +555 + `__mb��owcs_��s + ( +__d� +, +__�c +, +__nmc +, +__�n +, +__ps +); + +556 + } +} + +559 +size_t + + $__wc��ombs_chk + (* +__��ri� + +__d� +, + +560 cڡ +wch�_t + ** +__��ri� + +__�c +, + +561 +size_t + +__nwc +, size_� +__�n +, + +562 +mb��e_t + * +__��ri� + +__ps +, +size_t + +__d��n +) + +563 +__THROW +; + +564 +size_t + + `__REDIRECT_NTH + ( +__wc��ombs_��s +, + +565 (* +__��ri� + +__d� +, + +566 cڡ +wch�_t + ** +__��ri� + +__�c +, + +567 +size_t + +__nwc +, size_� +__�n +, + +568 +mb��e_t + * +__��ri� + +__ps +), +wc��ombs +); + +569 +size_t + + `__REDIRECT_NTH + ( +__wc��ombs_chk_w�n +, + +570 (* +__��ri� + +__d� +, + +571 cڡ +wch�_t + ** +__��ri� + +__�c +, + +572 +size_t + +__nwc +, size_� +__�n +, + +573 +mb��e_t + * +__��ri� + +__ps +, + +574 +size_t + +__d��n +), +__wc��ombs_chk +) + +575 + `__w�ljr + ("wcsnrtombs called with dst buffer smaller�han�en"); + +577 +__f�tify_fun�i� + +size_t + + +578 + `__NTH + ( + $wc��ombs + (* +__��ri� + +__d� +, cڡ +wch�_t + **__��ri� +__�c +, + +579 +size_t + +__nwc +, size_� +__�n +, +mb��e_t + * +__��ri� + +__ps +)) + +581 i�( + `__bos + ( +__d� +�!�( +size_t +) -1) + +583 i�(! + `__bu�t�_cڡ�t_p + ( +__�n +)) + +584 + `__wc��ombs_chk + ( +__d� +, +__�c +, +__nwc +, +__�n +, +__ps +, + +585 + `__bos + ( +__d� +)); + +587 i�( +__�n + > + `__bos + ( +__d� +)) + +588 + `__wc��ombs_chk_w�n + ( +__d� +, +__�c +, +__nwc +, +__�n +, +__ps +, + +589 + `__bos + ( +__d� +)); + +591 + `__wc��ombs_��s + ( +__d� +, +__�c +, +__nwc +, +__�n +, +__ps +); + +592 + } +} + + @/usr/include/et/com_err.h + +11 #i�! +def�ed +( +__COM_ERR_H +�&& !def�ed( +__COM_ERR_H__ +) + +13 #ifde� +__GNUC__ + + +14 + #COM_ERR_ATTR +( +x +� + `__��ibu�__ +(x) + + ) + +16 + #COM_ERR_ATTR +( +x +) + + ) + +19 + ~<�ddef.h +> + +20 + ~<�d�g.h +> + +22 + t�rcode_t +; + +24 + s�r�_�b� + { + +25 cڡ * cڡ * + mmsgs +; + +26 + mba� +; + +27 + mn_msgs +; + +29 + g�_li� +; + +31 + $com_�r + (const *, , const *, ...) + +32 + `COM_ERR_ATTR +(( + `f�m� +( +��tf +, 3, 4))); + +34 + $com_�r_va + (cڡ * +wh�mi +, +�rcode_t + +code +, cڡ * +fmt +, + +35 +va_li� + +�gs +) + +36 + `COM_ERR_ATTR +(( + `f�m� +( +��tf +, 3, 0))); + +38 cڡ * + `�r�_mes�ge + (); + +39 (* +com_�r_hook +�(cڡ *, , cڡ *, +va_li� +); + +40 (* + `�t_com_�r_hook + ((*) (const *, , + +41 cڡ *, +va_li� +))) + +42 (cڡ *, , cڡ *, +va_li� +); + +43 (* + $��t_com_�r_hook + ()) (const *, , + +44 cڡ *, +va_li� +); + +45 + `��_�r�_�b� +(cڡ * cڡ * +msgs +, +ba� +, +cou� +); + +46 *(* + `�t_com_�r_g��xt + (*(*) (const *))) + +49 +�rcode_t + + `add_�r�_�b� +(cڡ +�r�_�b� + * +� +); + +50 +�rcode_t + + `�move_�r�_�b� +(cڡ +�r�_�b� + * +� +); + +51 + `add_to_�r�_�b� +( +�_li� + * +�w_�b� +); + +54 cڡ * + `com_right +( +�_li� + * +li� +, +code +); + +55 cڡ * + `com_right_r +( +�_li� + * +li� +, +code +, * +�r +, +size_t + +�n +); + +56 + `���lize_�r�_�b�_r +( +�_li� + ** +li� +, + +57 cڡ ** +mes�ges +, + +58 +num_�r�s +, + +59 +ba� +); + +60 + `�_�r�_�b� +( +�_li� + * +� +); + +63 + `�_li�_lock +(); + +64 + `�_li�_u�ock +(); + +66 + #__COM_ERR_H + + + ) + +67 + #__COM_ERR_H__ + + + ) + + @/usr/include/gnu/option-groups.h + +10 #i�de� +__GNU_OPTION_GROUPS_H + + +11 + #__GNU_OPTION_GROUPS_H + + + ) + +13 + #__OPTION_EGLIBC_ADVANCED_INET6 + 1 + + ) + +14 + #__OPTION_EGLIBC_BACKTRACE + 1 + + ) + +15 + #__OPTION_EGLIBC_BIG_MACROS + 1 + + ) + +16 + #__OPTION_EGLIBC_BSD + 1 + + ) + +17 + #__OPTION_EGLIBC_CATGETS + 1 + + ) + +18 + #__OPTION_EGLIBC_CHARSETS + 1 + + ) + +19 + #__OPTION_EGLIBC_CRYPT + 1 + + ) + +20 + #__OPTION_EGLIBC_CRYPT_UFC + 1 + + ) + +21 + #__OPTION_EGLIBC_CXX_TESTS + 1 + + ) + +22 + #__OPTION_EGLIBC_DB_ALIASES + 1 + + ) + +23 + #__OPTION_EGLIBC_ENVZ + 1 + + ) + +24 + #__OPTION_EGLIBC_FCVT + 1 + + ) + +25 + #__OPTION_EGLIBC_FMTMSG + 1 + + ) + +26 + #__OPTION_EGLIBC_FSTAB + 1 + + ) + +27 + #__OPTION_EGLIBC_FTRAVERSE + 1 + + ) + +28 + #__OPTION_EGLIBC_GETLOGIN + 1 + + ) + +29 + #__OPTION_EGLIBC_IDN + 1 + + ) + +30 + #__OPTION_EGLIBC_INET + 1 + + ) + +31 + #__OPTION_EGLIBC_INET_ANL + 1 + + ) + +32 + #__OPTION_EGLIBC_LIBM + 1 + + ) + +33 + #__OPTION_EGLIBC_LOCALES + 1 + + ) + +34 + #__OPTION_EGLIBC_LOCALE_CODE + 1 + + ) + +35 + #__OPTION_EGLIBC_MEMUSAGE + 1 + + ) + +36 + #__OPTION_EGLIBC_NIS + 1 + + ) + +37 + #__OPTION_EGLIBC_NSSWITCH + 1 + + ) + +38 + #__OPTION_EGLIBC_RCMD + 1 + + ) + +39 + #__OPTION_EGLIBC_RTLD_DEBUG + 1 + + ) + +40 + #__OPTION_EGLIBC_SPAWN + 1 + + ) + +41 + #__OPTION_EGLIBC_STREAMS + 1 + + ) + +42 + #__OPTION_EGLIBC_SUNRPC + 1 + + ) + +43 + #__OPTION_EGLIBC_UTMP + 1 + + ) + +44 + #__OPTION_EGLIBC_UTMPX + 1 + + ) + +45 + #__OPTION_EGLIBC_WORDEXP + 1 + + ) + +46 + #__OPTION_POSIX_C_LANG_WIDE_CHAR + 1 + + ) + +47 + #__OPTION_POSIX_REGEXP + 1 + + ) + +48 + #__OPTION_POSIX_REGEXP_GLIBC + 1 + + ) + +49 + #__OPTION_POSIX_WIDE_CHAR_DEVICE_IO + 1 + + ) + + @/usr/include/wctype.h + +23 #i�de� +_WCTYPE_H + + +25 + ~<�u�s.h +> + +26 + ~<b�s/ty�s.h +> + +28 #i�de� +__�ed_iswxxx + + +29 + #_WCTYPE_H + 1 + + ) + +32 + #__�ed_w�t_t + + + ) + +33 + ~<wch�.h +> + +37 #i�de� +WEOF + + +38 + #WEOF + (0xffffffffu) + + ) + +41 #unde� +__�ed_iswxxx + + +46 #i�de� +__iswxxx_def�ed + + +47 + #__iswxxx_def�ed + 1 + + ) + +49 +__BEGIN_NAMESPACE_C99 + + +52 + tw�y�_t +; + +53 + g__END_NAMESPACE_C99 + + +55 #i�de� +_ISwb� + + +60 + ~<�d�n.h +> + +61 #i� +__BYTE_ORDER + =� +__BIG_ENDIAN + + +62 + #_ISwb� +( +b� +�(1 << (b�)) + + ) + +64 + #_ISwb� +( +b� +) \ + +65 (( +b� +) < 8 ? () ((1UL << (bit)) << 24) \ + +66 : (( +b� +) < 16 ? () ((1UL << (bit)) << 8) \ + +67 : (( +b� +) < 24 ? () ((1UL << (bit)) >> 8) \ + +68 : (�((1UL << ( +b� +)�>> 24)))) + + ) + +73 + m__ISwu�� + = 0, + +74 + m__ISwlow� + = 1, + +75 + m__ISw�pha + = 2, + +76 + m__ISwdig� + = 3, + +77 + m__ISwxdig� + = 4, + +78 + m__ISw�a� + = 5, + +79 + m__ISw��t + = 6, + +80 + m__ISwg�ph + = 7, + +81 + m__ISwb�nk + = 8, + +82 + m__ISw��l + = 9, + +83 + m__ISwpun� + = 10, + +84 + m__ISw�num + = 11, + +86 + m_ISwu�� + = +_ISwb� + ( +__ISwu�� +), + +87 + m_ISwlow� + = +_ISwb� + ( +__ISwlow� +), + +88 + m_ISw�pha + = +_ISwb� + ( +__ISw�pha +), + +89 + m_ISwdig� + = +_ISwb� + ( +__ISwdig� +), + +90 + m_ISwxdig� + = +_ISwb� + ( +__ISwxdig� +), + +91 + m_ISw�a� + = +_ISwb� + ( +__ISw�a� +), + +92 + m_ISw��t + = +_ISwb� + ( +__ISw��t +), + +93 + m_ISwg�ph + = +_ISwb� + ( +__ISwg�ph +), + +94 + m_ISwb�nk + = +_ISwb� + ( +__ISwb�nk +), + +95 + m_ISw��l + = +_ISwb� + ( +__ISw��l +), + +96 + m_ISwpun� + = +_ISwb� + ( +__ISwpun� +), + +97 + m_ISw�num + = +_ISwb� + ( +__ISw�num +) + +102 +__BEGIN_DECLS + + +104 +__BEGIN_NAMESPACE_C99 + + +111 + $isw�num + ( +w�t_t + +__wc +� +__THROW +; + +117 + $isw�pha + ( +w�t_t + +__wc +� +__THROW +; + +120 + $isw��l + ( +w�t_t + +__wc +� +__THROW +; + +124 + $iswdig� + ( +w�t_t + +__wc +� +__THROW +; + +128 + $iswg�ph + ( +w�t_t + +__wc +� +__THROW +; + +133 + $iswlow� + ( +w�t_t + +__wc +� +__THROW +; + +136 + $isw��t + ( +w�t_t + +__wc +� +__THROW +; + +141 + $iswpun� + ( +w�t_t + +__wc +� +__THROW +; + +146 + $isw�a� + ( +w�t_t + +__wc +� +__THROW +; + +151 + $iswu�� + ( +w�t_t + +__wc +� +__THROW +; + +156 + $iswxdig� + ( +w�t_t + +__wc +� +__THROW +; + +161 #ifde� +__USE_ISOC99 + + +162 + $iswb�nk + ( +w�t_t + +__wc +� +__THROW +; + +171 +w�y�_t + + $w�y� + (cڡ * +__�ݔty +� +__THROW +; + +175 + $isw�y� + ( +w�t_t + +__wc +, +w�y�_t + +__desc +� +__THROW +; + +176 +__END_NAMESPACE_C99 + + +183 +__BEGIN_NAMESPACE_C99 + + +186 cڡ + t__�t32_t + * + tw��ns_t +; + +187 +__END_NAMESPACE_C99 + + +188 #ifde� +__USE_GNU + + +189 + $__USING_NAMESPACE_C99 +( +w��ns_t +) + +192 +__BEGIN_NAMESPACE_C99 + + +194 +w�t_t + + $towlow� + ( +w�t_t + +__wc +� +__THROW +; + +197 +w�t_t + + $towu�� + ( +w�t_t + +__wc +� +__THROW +; + +198 +__END_NAMESPACE_C99 + + +200 +__END_DECLS + + +207 #ifde� +_WCTYPE_H + + +213 +__BEGIN_DECLS + + +215 +__BEGIN_NAMESPACE_C99 + + +218 +w��ns_t + + $w��ns + (cڡ * +__�ݔty +� +__THROW +; + +221 +w�t_t + + $tow��ns + ( +w�t_t + +__wc +, +w��ns_t + +__desc +� +__THROW +; + +222 +__END_NAMESPACE_C99 + + +224 #ifde� +__USE_XOPEN2K8 + + +226 + ~<xlo��.h +> + +230 + $isw�num_l + ( +w�t_t + +__wc +, +__lo��_t + +__lo�� +� +__THROW +; + +236 + $isw�pha_l + ( +w�t_t + +__wc +, +__lo��_t + +__lo�� +� +__THROW +; + +239 + $isw��l_l + ( +w�t_t + +__wc +, +__lo��_t + +__lo�� +� +__THROW +; + +243 + $iswdig�_l + ( +w�t_t + +__wc +, +__lo��_t + +__lo�� +� +__THROW +; + +247 + $iswg�ph_l + ( +w�t_t + +__wc +, +__lo��_t + +__lo�� +� +__THROW +; + +252 + $iswlow�_l + ( +w�t_t + +__wc +, +__lo��_t + +__lo�� +� +__THROW +; + +255 + $isw��t_l + ( +w�t_t + +__wc +, +__lo��_t + +__lo�� +� +__THROW +; + +260 + $iswpun�_l + ( +w�t_t + +__wc +, +__lo��_t + +__lo�� +� +__THROW +; + +265 + $isw�a�_l + ( +w�t_t + +__wc +, +__lo��_t + +__lo�� +� +__THROW +; + +270 + $iswu��_l + ( +w�t_t + +__wc +, +__lo��_t + +__lo�� +� +__THROW +; + +275 + $iswxdig�_l + ( +w�t_t + +__wc +, +__lo��_t + +__lo�� +� +__THROW +; + +280 + $iswb�nk_l + ( +w�t_t + +__wc +, +__lo��_t + +__lo�� +� +__THROW +; + +284 +w�y�_t + + $w�y�_l + (cڡ * +__�ݔty +, +__lo��_t + +__lo�� +) + +285 +__THROW +; + +289 + $isw�y�_l + ( +w�t_t + +__wc +, +w�y�_t + +__desc +, +__lo��_t + +__lo�� +) + +290 +__THROW +; + +298 +w�t_t + + $towlow�_l + ( +w�t_t + +__wc +, +__lo��_t + +__lo�� +� +__THROW +; + +301 +w�t_t + + $towu��_l + ( +w�t_t + +__wc +, +__lo��_t + +__lo�� +� +__THROW +; + +305 +w��ns_t + + $w��ns_l + (cڡ * +__�ݔty +, +__lo��_t + +__lo�� +) + +306 +__THROW +; + +309 +w�t_t + + $tow��ns_l + ( +w�t_t + +__wc +, +w��ns_t + +__desc +, + +310 +__lo��_t + +__lo�� +� +__THROW +; + +314 +__END_DECLS + + + @/usr/include/asm-generic/errno-base.h + +1 #i�de� +_ASM_GENERIC_ERRNO_BASE_H + + +2 + #_ASM_GENERIC_ERRNO_BASE_H + + + ) + +4 + #EPERM + 1 + + ) + +5 + #ENOENT + 2 + + ) + +6 + #ESRCH + 3 + + ) + +7 + #EINTR + 4 + + ) + +8 + #EIO + 5 + + ) + +9 + #ENXIO + 6 + + ) + +10 + #E2BIG + 7 + + ) + +11 + #ENOEXEC + 8 + + ) + +12 + #EBADF + 9 + + ) + +13 + #ECHILD + 10 + + ) + +14 + #EAGAIN + 11 + + ) + +15 + #ENOMEM + 12 + + ) + +16 + #EACCES + 13 + + ) + +17 + #EFAULT + 14 + + ) + +18 + #ENOTBLK + 15 + + ) + +19 + #EBUSY + 16 + + ) + +20 + #EEXIST + 17 + + ) + +21 + #EXDEV + 18 + + ) + +22 + #ENODEV + 19 + + ) + +23 + #ENOTDIR + 20 + + ) + +24 + #EISDIR + 21 + + ) + +25 + #EINVAL + 22 + + ) + +26 + #ENFILE + 23 + + ) + +27 + #EMFILE + 24 + + ) + +28 + #ENOTTY + 25 + + ) + +29 + #ETXTBSY + 26 + + ) + +30 + #EFBIG + 27 + + ) + +31 + #ENOSPC + 28 + + ) + +32 + #ESPIPE + 29 + + ) + +33 + #EROFS + 30 + + ) + +34 + #EMLINK + 31 + + ) + +35 + #EPIPE + 32 + + ) + +36 + #EDOM + 33 + + ) + +37 + #ERANGE + 34 + + ) + + @/usr/include/asm-generic/param.h + +1 #i�de� +__ASM_GENERIC_PARAM_H + + +2 + #__ASM_GENERIC_PARAM_H + + + ) + +4 #i�de� +HZ + + +5 + #HZ + 100 + + ) + +8 #i�de� +EXEC_PAGESIZE + + +9 + #EXEC_PAGESIZE + 4096 + + ) + +12 #i�de� +NOGROUP + + +13 + #NOGROUP + (-1) + + ) + +16 + #MAXHOSTNAMELEN + 64 + + ) + + @/usr/include/asm-generic/posix_types.h + +1 #i�de� +__ASM_GENERIC_POSIX_TYPES_H + + +2 + #__ASM_GENERIC_POSIX_TYPES_H + + + ) + +4 + ~<asm/b���l�g.h +> + +13 #i�de� +__k��l_l�g_t + + +14 + t__k��l_l�g_t +; + +15 + t__k��l_ul�g_t +; + +18 #i�de� +__k��l_�o_t + + +19 +__k��l_ul�g_t + + t__k��l_�o_t +; + +22 #i�de� +__k��l_mode_t + + +23 + t__k��l_mode_t +; + +26 #i�de� +__k��l_pid_t + + +27 + t__k��l_pid_t +; + +30 #i�de� +__k��l_�c_pid_t + + +31 + t__k��l_�c_pid_t +; + +34 #i�de� +__k��l_uid_t + + +35 + t__k��l_uid_t +; + +36 + t__k��l_gid_t +; + +39 #i�de� +__k��l_su�c�ds_t + + +40 +__k��l_l�g_t + + t__k��l_su�c�ds_t +; + +43 #i�de� +__k��l_daddr_t + + +44 + t__k��l_daddr_t +; + +47 #i�de� +__k��l_uid32_t + + +48 + t__k��l_uid32_t +; + +49 + t__k��l_gid32_t +; + +52 #i�de� +__k��l_�d_uid_t + + +53 +__k��l_uid_t + + t__k��l_�d_uid_t +; + +54 +__k��l_gid_t + + t__k��l_�d_gid_t +; + +57 #i�de� +__k��l_�d_dev_t + + +58 + t__k��l_�d_dev_t +; + +65 #i�de� +__k��l_size_t + + +66 #i� +__BITS_PER_LONG + != 64 + +67 + t__k��l_size_t +; + +68 + t__k��l_ssize_t +; + +69 + t__k��l_�rdiff_t +; + +71 +__k��l_ul�g_t + + t__k��l_size_t +; + +72 +__k��l_l�g_t + + t__k��l_ssize_t +; + +73 +__k��l_l�g_t + + t__k��l_�rdiff_t +; + +77 #i�de� +__k��l_fsid_t + + +79 + mv� +[2]; + +80 } + t__k��l_fsid_t +; + +86 +__k��l_l�g_t + + t__k��l_off_t +; + +87 + t__k��l_loff_t +; + +88 +__k��l_l�g_t + + t__k��l_time_t +; + +89 +__k��l_l�g_t + + t__k��l_�ock_t +; + +90 + t__k��l_tim�_t +; + +91 + t__k��l_�ockid_t +; + +92 * + t__k��l_�ddr_t +; + +93 + t__k��l_uid16_t +; + +94 + t__k��l_gid16_t +; + + @/usr/include/asm-generic/sockios.h + +1 #i�de� +__ASM_GENERIC_SOCKIOS_H + + +2 + #__ASM_GENERIC_SOCKIOS_H + + + ) + +5 + #FIOSETOWN + 0x8901 + + ) + +6 + #SIOCSPGRP + 0x8902 + + ) + +7 + #FIOGETOWN + 0x8903 + + ) + +8 + #SIOCGPGRP + 0x8904 + + ) + +9 + #SIOCATMARK + 0x8905 + + ) + +10 + #SIOCGSTAMP + 0x8906 + + ) + +11 + #SIOCGSTAMPNS + 0x8907 + + ) + + @/usr/include/asm/bitsperlong.h + +1 #i�de� +__ASM_X86_BITSPERLONG_H + + +2 + #__ASM_X86_BITSPERLONG_H + + + ) + +4 #ifde� +__x86_64__ + + +5 + #__BITS_PER_LONG + 64 + + ) + +7 + #__BITS_PER_LONG + 32 + + ) + +10 + ~<asm-g��ic/b���l�g.h +> + + @/usr/include/asm-generic/bitsperlong.h + +1 #i�de� +__ASM_GENERIC_BITS_PER_LONG + + +2 + #__ASM_GENERIC_BITS_PER_LONG + + + ) + +11 #i�de� +__BITS_PER_LONG + + +12 + #__BITS_PER_LONG + 32 + + ) + + @ +1 +. +1 +/usr/include +456 +12259 +client/client_props.c +client/client_shared.c +client/client_shared.h +client/pub_client.c +client/pub_shared.c +client/pub_shared.h +client/rr_client.c +client/sub_client.c +client/sub_client_output.c +config.h +examples/mysql_log/mysql_log.c +examples/subscribe_simple/callback.c +examples/subscribe_simple/multiple.c +examples/subscribe_simple/single.c +examples/temperature_conversion/main.cpp +examples/temperature_conversion/temperature_conversion.cpp +examples/temperature_conversion/temperature_conversion.h +lib/actions.c +lib/alias_mosq.c +lib/alias_mosq.h +lib/callbacks.c +lib/connect.c +lib/cpp/mosquittopp.cpp +lib/cpp/mosquittopp.h +lib/dummypthread.h +lib/handle_auth.c +lib/handle_connack.c +lib/handle_disconnect.c +lib/handle_ping.c +lib/handle_pubackcomp.c +lib/handle_publish.c +lib/handle_pubrec.c +lib/handle_pubrel.c +lib/handle_suback.c +lib/handle_unsuback.c +lib/helpers.c +lib/logging_mosq.c +lib/logging_mosq.h +lib/loop.c +lib/memory_mosq.c +lib/memory_mosq.h +lib/messages_mosq.c +lib/messages_mosq.h +lib/mosquitto.c +lib/mosquitto.h +lib/mosquitto_internal.h +lib/mqtt_protocol.h +lib/net_mosq.c +lib/net_mosq.h +lib/net_mosq_ocsp.c +lib/options.c +lib/packet_datatypes.c +lib/packet_mosq.c +lib/packet_mosq.h +lib/property_mosq.c +lib/property_mosq.h +lib/read_handle.c +lib/read_handle.h +lib/send_connect.c +lib/send_disconnect.c +lib/send_mosq.c +lib/send_mosq.h +lib/send_publish.c +lib/send_subscribe.c +lib/send_unsubscribe.c +lib/socks_mosq.c +lib/socks_mosq.h +lib/srv_mosq.c +lib/thread_mosq.c +lib/time_mosq.c +lib/time_mosq.h +lib/tls_mosq.c +lib/tls_mosq.h +lib/utf8_mosq.c +lib/util_mosq.c +lib/util_mosq.h +lib/util_topic.c +lib/will_mosq.c +lib/will_mosq.h +src/bridge.c +src/conf.c +src/conf_includedir.c +src/context.c +src/database.c +src/db_dump/db_dump.c +src/deps/uthash.h +src/deps/utlist.h +src/handle_auth.c +src/handle_connack.c +src/handle_connect.c +src/handle_disconnect.c +src/handle_publish.c +src/handle_subscribe.c +src/handle_unsubscribe.c +src/lib_load.h +src/logging.c +src/loop.c +src/mosquitto.c +src/mosquitto_broker.h +src/mosquitto_broker_internal.h +src/mosquitto_passwd.c +src/mosquitto_plugin.h +src/net.c +src/persist.h +src/persist_read.c +src/persist_read_v234.c +src/persist_read_v5.c +src/persist_write.c +src/persist_write_v5.c +src/plugin.c +src/plugin_defer.c +src/property_broker.c +src/read_handle.c +src/security.c +src/security_default.c +src/send_auth.c +src/send_connack.c +src/send_suback.c +src/send_unsuback.c +src/service.c +src/session_expiry.c +src/signals.c +src/subs.c +src/sys_tree.c +src/sys_tree.h +src/uhpa.h +src/websockets.c +src/will_delay.c +test/broker/c/08-tls-psk-bridge.c +test/broker/c/08-tls-psk-pub.c +test/broker/c/auth_plugin.c +test/broker/c/auth_plugin_acl.c +test/broker/c/auth_plugin_acl_sub_denied.c +test/broker/c/auth_plugin_context_params.c +test/broker/c/auth_plugin_extended_multiple.c +test/broker/c/auth_plugin_extended_single.c +test/broker/c/auth_plugin_extended_single2.c +test/broker/c/auth_plugin_msg_params.c +test/broker/c/auth_plugin_pwd.c +test/broker/c/auth_plugin_v2.c +test/broker/c/mosquitto_plugin_v2.h +test/lib/c/01-con-discon-success.c +test/lib/c/01-keepalive-pingreq.c +test/lib/c/01-no-clean-session.c +test/lib/c/01-server-keepalive-pingreq.c +test/lib/c/01-unpwd-set.c +test/lib/c/01-will-set.c +test/lib/c/01-will-unpwd-set.c +test/lib/c/02-subscribe-qos0.c +test/lib/c/02-subscribe-qos1.c +test/lib/c/02-subscribe-qos2.c +test/lib/c/02-unsubscribe-multiple-v5.c +test/lib/c/02-unsubscribe-v5.c +test/lib/c/02-unsubscribe.c +test/lib/c/03-publish-b2c-qos1.c +test/lib/c/03-publish-b2c-qos2-len.c +test/lib/c/03-publish-b2c-qos2.c +test/lib/c/03-publish-c2b-qos1-disconnect.c +test/lib/c/03-publish-c2b-qos1-len.c +test/lib/c/03-publish-c2b-qos1-receive-maximum.c +test/lib/c/03-publish-c2b-qos2-disconnect.c +test/lib/c/03-publish-c2b-qos2-len.c +test/lib/c/03-publish-c2b-qos2-maximum-qos-0.c +test/lib/c/03-publish-c2b-qos2-maximum-qos-1.c +test/lib/c/03-publish-c2b-qos2-pubrec-error.c +test/lib/c/03-publish-c2b-qos2-receive-maximum-1.c +test/lib/c/03-publish-c2b-qos2-receive-maximum-2.c +test/lib/c/03-publish-c2b-qos2.c +test/lib/c/03-publish-qos0-no-payload.c +test/lib/c/03-publish-qos0.c +test/lib/c/03-request-response-1.c +test/lib/c/03-request-response-2.c +test/lib/c/03-request-response-correlation-1.c +test/lib/c/04-retain-qos0.c +test/lib/c/08-ssl-bad-cacert.c +test/lib/c/08-ssl-connect-cert-auth-enc.c +test/lib/c/08-ssl-connect-cert-auth.c +test/lib/c/08-ssl-connect-no-auth.c +test/lib/c/08-ssl-fake-cacert.c +test/lib/c/09-util-topic-tokenise.c +test/lib/c/11-prop-oversize-packet.c +test/lib/c/11-prop-send-content-type.c +test/lib/c/11-prop-send-payload-format.c +test/lib/cpp/01-con-discon-success.cpp +test/lib/cpp/01-keepalive-pingreq.cpp +test/lib/cpp/01-no-clean-session.cpp +test/lib/cpp/01-unpwd-set.cpp +test/lib/cpp/01-will-set.cpp +test/lib/cpp/01-will-unpwd-set.cpp +test/lib/cpp/02-subscribe-qos0.cpp +test/lib/cpp/02-subscribe-qos1.cpp +test/lib/cpp/02-subscribe-qos2.cpp +test/lib/cpp/02-unsubscribe.cpp +test/lib/cpp/03-publish-b2c-qos1.cpp +test/lib/cpp/03-publish-b2c-qos2.cpp +test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp +test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp +test/lib/cpp/03-publish-c2b-qos2.cpp +test/lib/cpp/03-publish-qos0-no-payload.cpp +test/lib/cpp/03-publish-qos0.cpp +test/lib/cpp/04-retain-qos0.cpp +test/lib/cpp/08-ssl-bad-cacert.cpp +test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp +test/lib/cpp/08-ssl-connect-cert-auth.cpp +test/lib/cpp/08-ssl-connect-no-auth.cpp +test/lib/cpp/08-ssl-fake-cacert.cpp +test/lib/cpp/09-util-topic-tokenise.cpp +test/old/msgsps_common.h +test/old/msgsps_pub.c +test/old/msgsps_sub.c +test/random/auth_plugin.c +test/unit/datatype_read.c +test/unit/datatype_write.c +test/unit/persist_read_stubs.c +test/unit/persist_read_test.c +test/unit/persist_write_stubs.c +test/unit/persist_write_test.c +test/unit/property_add.c +test/unit/property_read.c +test/unit/property_user_read.c +test/unit/property_write.c +test/unit/publish_test.c +test/unit/stubs.c +test/unit/test.c +test/unit/utf8.c +test/unit/util_topic_test.c +/usr/include/ares.h +/usr/include/arpa/inet.h +/usr/include/arpa/nameser.h +/usr/include/assert.h +/usr/include/ctype.h +/usr/include/dirent.h +/usr/include/dlfcn.h +/usr/include/errno.h +/usr/include/fcntl.h +/usr/include/grp.h +/usr/include/inttypes.h +/usr/include/limits.h +/usr/include/linux/in.h +/usr/include/linux/in6.h +/usr/include/malloc.h +/usr/include/math.h +/usr/include/net/if.h +/usr/include/netdb.h +/usr/include/netinet/in.h +/usr/include/netinet/tcp.h +/usr/include/openssl/bn.h +/usr/include/openssl/buffer.h +/usr/include/openssl/conf.h +/usr/include/openssl/engine.h +/usr/include/openssl/err.h +/usr/include/openssl/evp.h +/usr/include/openssl/ocsp.h +/usr/include/openssl/opensslv.h +/usr/include/openssl/rand.h +/usr/include/openssl/safestack.h +/usr/include/openssl/ssl.h +/usr/include/openssl/tls1.h +/usr/include/openssl/ui.h +/usr/include/openssl/x509v3.h +/usr/include/poll.h +/usr/include/pthread.h +/usr/include/pwd.h +/usr/include/signal.h +/usr/include/stdint.h +/usr/include/stdio.h +/usr/include/stdlib.h +/usr/include/string.h +/usr/include/strings.h +/usr/include/sys/epoll.h +/usr/include/sys/select.h +/usr/include/sys/socket.h +/usr/include/sys/stat.h +/usr/include/sys/syslog.h +/usr/include/sys/time.h +/usr/include/sys/types.h +/usr/include/syslog.h +/usr/include/termios.h +/usr/include/time.h +/usr/include/unistd.h +/usr/include/alloca.h +/usr/include/ares_rules.h +/usr/include/ares_version.h +/usr/include/arpa/nameser_compat.h +/usr/include/asm/byteorder.h +/usr/include/bits/byteswap.h +/usr/include/bits/confname.h +/usr/include/bits/dirent.h +/usr/include/bits/dlfcn.h +/usr/include/bits/environments.h +/usr/include/bits/epoll.h +/usr/include/bits/errno.h +/usr/include/bits/fcntl.h +/usr/include/bits/fcntl2.h +/usr/include/bits/huge_val.h +/usr/include/bits/huge_valf.h +/usr/include/bits/huge_vall.h +/usr/include/bits/in.h +/usr/include/bits/inf.h +/usr/include/bits/math-finite.h +/usr/include/bits/mathcalls.h +/usr/include/bits/mathdef.h +/usr/include/bits/mathinline.h +/usr/include/bits/nan.h +/usr/include/bits/netdb.h +/usr/include/bits/posix1_lim.h +/usr/include/bits/posix2_lim.h +/usr/include/bits/posix_opt.h +/usr/include/bits/pthreadtypes.h +/usr/include/bits/select.h +/usr/include/bits/select2.h +/usr/include/bits/setjmp.h +/usr/include/bits/sigaction.h +/usr/include/bits/sigcontext.h +/usr/include/bits/siginfo.h +/usr/include/bits/signum.h +/usr/include/bits/sigset.h +/usr/include/bits/sigstack.h +/usr/include/bits/sigthread.h +/usr/include/bits/socket.h +/usr/include/bits/socket2.h +/usr/include/bits/stat.h +/usr/include/bits/stdio-ldbl.h +/usr/include/bits/stdio.h +/usr/include/bits/stdio2.h +/usr/include/bits/stdio_lim.h +/usr/include/bits/stdlib-bsearch.h +/usr/include/bits/stdlib-float.h +/usr/include/bits/stdlib-ldbl.h +/usr/include/bits/stdlib.h +/usr/include/bits/string.h +/usr/include/bits/string2.h +/usr/include/bits/string3.h +/usr/include/bits/sys_errlist.h +/usr/include/bits/syslog-ldbl.h +/usr/include/bits/syslog-path.h +/usr/include/bits/syslog.h +/usr/include/bits/termios.h +/usr/include/bits/time.h +/usr/include/bits/types.h +/usr/include/bits/unistd.h +/usr/include/bits/waitflags.h +/usr/include/bits/waitstatus.h +/usr/include/bits/wchar.h +/usr/include/bits/wordsize.h +/usr/include/bits/xopen_lim.h +/usr/include/endian.h +/usr/include/features.h +/usr/include/getopt.h +/usr/include/libio.h +/usr/include/linux/libc-compat.h +/usr/include/linux/socket.h +/usr/include/linux/types.h +/usr/include/openssl/bio.h +/usr/include/openssl/comp.h +/usr/include/openssl/crypto.h +/usr/include/openssl/dh.h +/usr/include/openssl/dsa.h +/usr/include/openssl/dtls1.h +/usr/include/openssl/e_os2.h +/usr/include/openssl/ecdh.h +/usr/include/openssl/ecdsa.h +/usr/include/openssl/hmac.h +/usr/include/openssl/kssl.h +/usr/include/openssl/lhash.h +/usr/include/openssl/objects.h +/usr/include/openssl/ossl_typ.h +/usr/include/openssl/pem.h +/usr/include/openssl/rsa.h +/usr/include/openssl/srtp.h +/usr/include/openssl/ssl2.h +/usr/include/openssl/ssl23.h +/usr/include/openssl/ssl3.h +/usr/include/openssl/stack.h +/usr/include/openssl/symhacks.h +/usr/include/openssl/x509.h +/usr/include/rpc/netdb.h +/usr/include/sched.h +/usr/include/sys/bitypes.h +/usr/include/sys/cdefs.h +/usr/include/sys/param.h +/usr/include/sys/poll.h +/usr/include/sys/sysmacros.h +/usr/include/sys/ttydefaults.h +/usr/include/sys/ucontext.h +/usr/include/sys/uio.h +/usr/include/xlocale.h +/usr/include/_G_config.h +/usr/include/asm/socket.h +/usr/include/asm/types.h +/usr/include/bits/byteswap-16.h +/usr/include/bits/endian.h +/usr/include/bits/fcntl-linux.h +/usr/include/bits/libio-ldbl.h +/usr/include/bits/local_lim.h +/usr/include/bits/param.h +/usr/include/bits/poll.h +/usr/include/bits/poll2.h +/usr/include/bits/sched.h +/usr/include/bits/sockaddr.h +/usr/include/bits/socket_type.h +/usr/include/bits/stdio-lock.h +/usr/include/bits/timex.h +/usr/include/bits/typesizes.h +/usr/include/bits/uio.h +/usr/include/gnu/stubs.h +/usr/include/krb5.h +/usr/include/linux/byteorder/little_endian.h +/usr/include/linux/errno.h +/usr/include/linux/posix_types.h +/usr/include/openssl/asn1.h +/usr/include/openssl/ebcdic.h +/usr/include/openssl/ec.h +/usr/include/openssl/obj_mac.h +/usr/include/openssl/pem2.h +/usr/include/openssl/pkcs7.h +/usr/include/openssl/pqueue.h +/usr/include/openssl/sha.h +/usr/include/openssl/x509_vfy.h +/usr/include/stdc-predef.h +/usr/include/sys/timeb.h +/usr/include/sys/times.h +/usr/include/asm-generic/socket.h +/usr/include/asm-generic/types.h +/usr/include/asm/errno.h +/usr/include/asm/posix_types.h +/usr/include/bits/libc-lock.h +/usr/include/gconv.h +/usr/include/gnu/stubs-32.h +/usr/include/gnu/stubs-64.h +/usr/include/gnu/stubs-x32.h +/usr/include/krb5/krb5.h +/usr/include/linux/limits.h +/usr/include/linux/param.h +/usr/include/linux/stddef.h +/usr/include/linux/swab.h +/usr/include/wchar.h +/usr/include/asm-generic/errno.h +/usr/include/asm-generic/int-ll64.h +/usr/include/asm/param.h +/usr/include/asm/posix_types_32.h +/usr/include/asm/posix_types_64.h +/usr/include/asm/posix_types_x32.h +/usr/include/asm/sockios.h +/usr/include/asm/swab.h +/usr/include/bits/wchar-ldbl.h +/usr/include/bits/wchar2.h +/usr/include/et/com_err.h +/usr/include/gnu/option-groups.h +/usr/include/wctype.h +/usr/include/asm-generic/errno-base.h +/usr/include/asm-generic/param.h +/usr/include/asm-generic/posix_types.h +/usr/include/asm-generic/sockios.h +/usr/include/asm/bitsperlong.h +/usr/include/asm-generic/bitsperlong.h diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/cscope.po.out b/proj1_mqttd/mosquitto/mosquitto-1.6.3/cscope.po.out new file mode 100644 index 0000000..70ec1b3 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/cscope.po.out Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/edl-v10 b/proj1_mqttd/mosquitto/mosquitto-1.6.3/edl-v10 new file mode 100644 index 0000000..0d500b9 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/edl-v10 @@ -0,0 +1,31 @@ +Eclipse Distribution License - v 1.0 + +Copyright (c) 2007, Eclipse Foundation, Inc. and its licensors. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + Neither the name of the Eclipse Foundation, Inc. nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/epl-v10 b/proj1_mqttd/mosquitto/mosquitto-1.6.3/epl-v10 new file mode 100644 index 0000000..190869d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/epl-v10 @@ -0,0 +1,221 @@ +Eclipse Public License - v 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC +LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM +CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + + +1. DEFINITIONS + +"Contribution" means: + a) in the case of the initial Contributor, the initial code and + documentation distributed under this Agreement, and + + b) in the case of each subsequent Contributor: + + i) changes to the Program, and + ii) additions to the Program; + +where such changes and/or additions to the Program originate from and are +distributed by that particular Contributor. A Contribution 'originates' from a +Contributor if it was added to the Program by such Contributor itself or anyone +acting on such Contributor's behalf. Contributions do not include additions to +the Program which: (i) are separate modules of software distributed in +conjunction with the Program under their own license agreement, and (ii) are +not derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor which are +necessarily infringed by the use or sale of its Contribution alone or when +combined with the Program. + +"Program" means the Contributions distributed in accordance with this Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, +including all Contributors. + + +2. GRANT OF RIGHTS + + a) Subject to the terms of this Agreement, each Contributor hereby grants + Recipient a non-exclusive, worldwide, royalty-free copyright license to + reproduce, prepare derivative works of, publicly display, publicly + perform, distribute and sublicense the Contribution of such Contributor, + if any, and such derivative works, in source code and object code form. + + b) Subject to the terms of this Agreement, each Contributor hereby grants + Recipient a non-exclusive, worldwide, royalty-free patent license under + Licensed Patents to make, use, sell, offer to sell, import and otherwise + transfer the Contribution of such Contributor, if any, in source code and + object code form. This patent license shall apply to the combination of the + Contribution and the Program if, at the time the Contribution is added by the + Contributor, such addition of the Contribution causes such combination to be + covered by the Licensed Patents. The patent license shall not apply to any + other combinations which include the Contribution. No hardware per se is + licensed hereunder. + + c) Recipient understands that although each Contributor grants the licenses + to its Contributions set forth herein, no assurances are provided by any + Contributor that the Program does not infringe the patent or other + intellectual property rights of any other entity. Each Contributor disclaims + any liability to Recipient for claims brought by any other entity based on + infringement of intellectual property rights or otherwise. As a condition to + exercising the rights and licenses granted hereunder, each Recipient hereby + assumes sole responsibility to secure any other intellectual property rights + needed, if any. For example, if a third party patent license is required to + allow Recipient to distribute the Program, it is Recipient's responsibility + to acquire that license before distributing the Program. + + d) Each Contributor represents that to its knowledge it has sufficient + copyright rights in its Contribution, if any, to grant the copyright license + set forth in this Agreement. + + +3. REQUIREMENTS + + A Contributor may choose to distribute the Program in object code form under + its own license agreement, provided that: + + a) it complies with the terms and conditions of this Agreement; and + + b) its license agreement: + + i) effectively disclaims on behalf of all Contributors all warranties and + conditions, express and implied, including warranties or conditions of + title and non-infringement, and implied warranties or conditions of + merchantability and fitness for a particular purpose; + + ii) effectively excludes on behalf of all Contributors all liability for + damages, including direct, indirect, special, incidental and consequential + damages, such as lost profits; + + iii) states that any provisions which differ from this Agreement are offered + by that Contributor alone and not by any other party; and + + iv) states that source code for the Program is available from such + Contributor, and informs licensees how to obtain it in a reasonable manner + on or through a medium customarily used for software exchange. + + When the Program is made available in source code form: + + a) it must be made available under this Agreement; and + + b) a copy of this Agreement must be included with each copy of the Program. + + Contributors may not remove or alter any copyright notices contained within + the Program. + + Each Contributor must identify itself as the originator of its Contribution, + if any, in a manner that reasonably allows subsequent Recipients to identify + the originator of the Contribution. + + +4. COMMERCIAL DISTRIBUTION + + Commercial distributors of software may accept certain responsibilities with + respect to end users, business partners and the like. While this license is + intended to facilitate the commercial use of the Program, the Contributor who + includes the Program in a commercial product offering should do so in a + manner which does not create potential liability for other Contributors. + Therefore, if a Contributor includes the Program in a commercial product + offering, such Contributor ("Commercial Contributor") hereby agrees to defend + and indemnify every other Contributor ("Indemnified Contributor") against any + losses, damages and costs (collectively "Losses") arising from claims, + lawsuits and other legal actions brought by a third party against the + Indemnified Contributor to the extent caused by the acts or omissions of such + Commercial Contributor in connection with its distribution of the Program in + a commercial product offering. The obligations in this section do not apply + to any claims or Losses relating to any actual or alleged intellectual + property infringement. In order to qualify, an Indemnified Contributor must: + a) promptly notify the Commercial Contributor in writing of such claim, and + b) allow the Commercial Contributor to control, and cooperate with the + Commercial Contributor in, the defense and any related settlement + negotiations. The Indemnified Contributor may participate in any such claim + at its own expense. + + For example, a Contributor might include the Program in a commercial product + offering, Product X. That Contributor is then a Commercial Contributor. If + that Commercial Contributor then makes performance claims, or offers + warranties related to Product X, those performance claims and warranties are + such Commercial Contributor's responsibility alone. Under this section, the + Commercial Contributor would have to defend claims against the other + Contributors related to those performance claims and warranties, and if a + court requires any other Contributor to pay any damages as a result, the + Commercial Contributor must pay those damages. + + +5. NO WARRANTY + + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON + AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER + EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR + CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A + PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the + appropriateness of using and distributing the Program and assumes all risks + associated with its exercise of rights under this Agreement , including but + not limited to the risks and costs of program errors, compliance with + applicable laws, damage to or loss of data, programs or equipment, and + unavailability or interruption of operations. + + +6. DISCLAIMER OF LIABILITY + + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY + CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION + LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE + EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH DAMAGES. + + +7. GENERAL + + If any provision of this Agreement is invalid or unenforceable under + applicable law, it shall not affect the validity or enforceability of the + remainder of the terms of this Agreement, and without further action by the + parties hereto, such provision shall be reformed to the minimum extent + necessary to make such provision valid and enforceable. + + If Recipient institutes patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Program itself + (excluding combinations of the Program with other software or hardware) + infringes such Recipient's patent(s), then such Recipient's rights granted + under Section 2(b) shall terminate as of the date such litigation is filed. + + All Recipient's rights under this Agreement shall terminate if it fails to + comply with any of the material terms or conditions of this Agreement and + does not cure such failure in a reasonable period of time after becoming + aware of such noncompliance. If all Recipient's rights under this Agreement + terminate, Recipient agrees to cease use and distribution of the Program as + soon as reasonably practicable. However, Recipient's obligations under this + Agreement and any licenses granted by Recipient relating to the Program shall + continue and survive. + + Everyone is permitted to copy and distribute copies of this Agreement, but in + order to avoid inconsistency the Agreement is copyrighted and may only be + modified in the following manner. The Agreement Steward reserves the right to + publish new versions (including revisions) of this Agreement from time to + time. No one other than the Agreement Steward has the right to modify this + Agreement. The Eclipse Foundation is the initial Agreement Steward. The + Eclipse Foundation may assign the responsibility to serve as the Agreement + Steward to a suitable separate entity. Each new version of the Agreement will + be given a distinguishing version number. The Program (including + Contributions) may always be distributed subject to the version of the + Agreement under which it was received. In addition, after a new version of + the Agreement is published, Contributor may elect to distribute the Program + (including its Contributions) under the new version. Except as expressly + stated in Sections 2(a) and 2(b) above, Recipient receives no rights or + licenses to the intellectual property of any Contributor under this + Agreement, whether expressly, by implication, estoppel or otherwise. All + rights in the Program not expressly granted under this Agreement are + reserved. + + This Agreement is governed by the laws of the State of New York and the + intellectual property laws of the United States of America. No party to this + Agreement will bring a legal action under this Agreement more than one year + after the cause of action arose. Each party waives its rights to a jury trial + in any resulting litigation. + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/mysql_log/Makefile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/mysql_log/Makefile new file mode 100644 index 0000000..e8c8b2c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/mysql_log/Makefile @@ -0,0 +1,15 @@ +CFLAGS=-Wall -ggdb +LDFLAGS=../../lib/libmosquitto.so.1 -lmysqlclient + +.PHONY: all clean + +all : mosquitto_mysql_log + +mosquitto_mysql_log : mysql_log.o + ${CC} $^ -o $@ ${LDFLAGS} + +mysql_log.o : mysql_log.c + ${CC} -c $^ -o $@ ${CFLAGS} -I../../lib + +clean : + -rm -f *.o mosquitto_mysql_log diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/mysql_log/mysql_log.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/mysql_log/mysql_log.c new file mode 100644 index 0000000..9e7e8d7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/mysql_log/mysql_log.c @@ -0,0 +1,123 @@ +#include <signal.h> +#include <stdio.h> +#include <string.h> + +#ifndef WIN32 +# include <unistd.h> +#else +# include <process.h> +# define snprintf sprintf_s +#endif + +#include <mosquitto.h> +#include <mysql/mysql.h> + +#define db_host "localhost" +#define db_username "mqtt_log" +#define db_password "password" +#define db_database "mqtt_log" +#define db_port 3306 + +#define db_query "INSERT INTO mqtt_log (topic, payload) VALUES (?,?)" + +#define mqtt_host "localhost" +#define mqtt_port 1883 + +static int run = 1; +static MYSQL_STMT *stmt = NULL; + +void handle_signal(int s) +{ + run = 0; +} + +void connect_callback(struct mosquitto *mosq, void *obj, int result) +{ +} + +void message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message) +{ + MYSQL_BIND bind[2]; + + memset(bind, 0, sizeof(bind)); + + bind[0].buffer_type = MYSQL_TYPE_STRING; + bind[0].buffer = message->topic; + bind[0].buffer_length = strlen(message->topic); + // Note: payload is normally a binary blob and could contains + // NULL byte. This sample does not handle it and assume payload is a + // string. + bind[1].buffer_type = MYSQL_TYPE_STRING; + bind[1].buffer = message->payload; + bind[1].buffer_length = message->payloadlen; + + mysql_stmt_bind_param(stmt, bind); + mysql_stmt_execute(stmt); +} + +int main(int argc, char *argv[]) +{ + MYSQL *connection; + my_bool reconnect = true; + char clientid[24]; + struct mosquitto *mosq; + int rc = 0; + + signal(SIGINT, handle_signal); + signal(SIGTERM, handle_signal); + + mysql_library_init(0, NULL, NULL); + mosquitto_lib_init(); + + connection = mysql_init(NULL); + + if(connection){ + mysql_options(connection, MYSQL_OPT_RECONNECT, &reconnect); + + connection = mysql_real_connect(connection, db_host, db_username, db_password, db_database, db_port, NULL, 0); + + if(connection){ + stmt = mysql_stmt_init(connection); + + mysql_stmt_prepare(stmt, db_query, strlen(db_query)); + + memset(clientid, 0, 24); + snprintf(clientid, 23, "mysql_log_%d", getpid()); + mosq = mosquitto_new(clientid, true, connection); + if(mosq){ + mosquitto_connect_callback_set(mosq, connect_callback); + mosquitto_message_callback_set(mosq, message_callback); + + + rc = mosquitto_connect(mosq, mqtt_host, mqtt_port, 60); + + mosquitto_subscribe(mosq, NULL, "#", 0); + + while(run){ + rc = mosquitto_loop(mosq, -1, 1); + if(run && rc){ + sleep(20); + mosquitto_reconnect(mosq); + } + } + mosquitto_destroy(mosq); + } + mysql_stmt_close(stmt); + + mysql_close(connection); + }else{ + fprintf(stderr, "Error: Unable to connect to database.\n"); + printf("%s\n", mysql_error(connection)); + rc = 1; + } + }else{ + fprintf(stderr, "Error: Unable to start mysql.\n"); + rc = 1; + } + + mysql_library_end(); + mosquitto_lib_cleanup(); + + return rc; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/subscribe_simple/Makefile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/subscribe_simple/Makefile new file mode 100644 index 0000000..f5576c5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/subscribe_simple/Makefile @@ -0,0 +1,29 @@ +include ../../config.mk + +.PHONY: all + +all : sub_callback sub_single sub_multiple + +sub_callback : callback.o + ${CROSS_COMPILE}${CC} $^ -o $@ ../../lib/libmosquitto.so.${SOVERSION} + +sub_single : single.o + ${CROSS_COMPILE}${CC} $^ -o $@ ../../lib/libmosquitto.so.${SOVERSION} + +sub_multiple : multiple.o + ${CROSS_COMPILE}${CC} $^ -o $@ ../../lib/libmosquitto.so.${SOVERSION} + +callback.o : callback.c ../../lib/libmosquitto.so.${SOVERSION} + ${CROSS_COMPILE}${CC} -c $< -o $@ -I../../lib ${CFLAGS} + +single.o : single.c ../../lib/libmosquitto.so.${SOVERSION} + ${CROSS_COMPILE}${CC} -c $< -o $@ -I../../lib ${CFLAGS} + +multiple.o : multiple.c ../../lib/libmosquitto.so.${SOVERSION} + ${CROSS_COMPILE}${CC} -c $< -o $@ -I../../lib ${CFLAGS} + +../../lib/libmosquitto.so.${SOVERSION} : + $(MAKE) -C ../../lib + +clean : + -rm -f *.o sub_single sub_multiple diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/subscribe_simple/callback.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/subscribe_simple/callback.c new file mode 100644 index 0000000..b66afdb --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/subscribe_simple/callback.c @@ -0,0 +1,34 @@ +#include <stdlib.h> +#include <stdio.h> +#include "mosquitto.h" + +int on_message(struct mosquitto *mosq, void *userdata, const struct mosquitto_message *msg) +{ + printf("%s %s (%d)\n", msg->topic, (const char *)msg->payload, msg->payloadlen); + return 0; +} + + +int main(int argc, char *argv[]) +{ + int rc; + + mosquitto_lib_init(); + + rc = mosquitto_subscribe_callback( + on_message, NULL, + "irc/#", 0, + "test.mosquitto.org", 1883, + NULL, 60, true, + NULL, NULL, + NULL, NULL); + + if(rc){ + printf("Error: %s\n", mosquitto_strerror(rc)); + } + + mosquitto_lib_cleanup(); + + return rc; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/subscribe_simple/multiple.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/subscribe_simple/multiple.c new file mode 100644 index 0000000..67dc760 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/subscribe_simple/multiple.c @@ -0,0 +1,39 @@ +#include <stdlib.h> +#include <stdio.h> +#include "mosquitto.h" + +#define COUNT 3 + +int main(int argc, char *argv[]) +{ + int rc; + int i; + struct mosquitto_message *msg; + + mosquitto_lib_init(); + + rc = mosquitto_subscribe_simple( + &msg, COUNT, true, + "irc/#", 0, + "test.mosquitto.org", 1883, + NULL, 60, true, + NULL, NULL, + NULL, NULL); + + if(rc){ + printf("Error: %s\n", mosquitto_strerror(rc)); + mosquitto_lib_cleanup(); + return rc; + } + + for(i=0; i<COUNT; i++){ + printf("%s %s\n", msg[i].topic, (char *)msg[i].payload); + mosquitto_message_free_contents(&msg[i]); + } + free(msg); + + mosquitto_lib_cleanup(); + + return 0; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/subscribe_simple/single.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/subscribe_simple/single.c new file mode 100644 index 0000000..b23ebd3 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/subscribe_simple/single.c @@ -0,0 +1,33 @@ +#include <stdlib.h> +#include <stdio.h> +#include "mosquitto.h" + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto_message *msg; + + mosquitto_lib_init(); + + rc = mosquitto_subscribe_simple( + &msg, 1, true, + "irc/#", 0, + "test.mosquitto.org", 1883, + NULL, 60, true, + NULL, NULL, + NULL, NULL); + + if(rc){ + printf("Error: %s\n", mosquitto_strerror(rc)); + mosquitto_lib_cleanup(); + return rc; + } + + printf("%s %s\n", msg->topic, (char *)msg->payload); + mosquitto_message_free(&msg); + + mosquitto_lib_cleanup(); + + return 0; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/temperature_conversion/Makefile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/temperature_conversion/Makefile new file mode 100644 index 0000000..0f20ac4 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/temperature_conversion/Makefile @@ -0,0 +1,18 @@ +CFLAGS=-Wall -ggdb -I../../lib -I../../lib/cpp +LDFLAGS=-L../../lib ../../lib/cpp/libmosquittopp.so.1 ../../lib/libmosquitto.so.1 + +.PHONY: all clean + +all : mqtt_temperature_conversion + +mqtt_temperature_conversion : main.o temperature_conversion.o + ${CXX} $^ -o $@ ${LDFLAGS} + +main.o : main.cpp + ${CXX} -c $^ -o $@ ${CFLAGS} + +temperature_conversion.o : temperature_conversion.cpp + ${CXX} -c $^ -o $@ ${CFLAGS} + +clean : + -rm -f *.o mqtt_temperature_conversion diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/temperature_conversion/main.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/temperature_conversion/main.cpp new file mode 100644 index 0000000..ee5d962 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/temperature_conversion/main.cpp @@ -0,0 +1,17 @@ +#include "temperature_conversion.h" + +int main(int argc, char *argv[]) +{ + class mqtt_tempconv *tempconv; + int rc; + + mosqpp::lib_init(); + + tempconv = new mqtt_tempconv("tempconv", "localhost", 1883); + tempconv->loop_forever(); + + mosqpp::lib_cleanup(); + + return 0; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/temperature_conversion/readme.txt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/temperature_conversion/readme.txt new file mode 100644 index 0000000..a706a7c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/temperature_conversion/readme.txt @@ -0,0 +1,6 @@ +This is a simple example of the C++ library mosquittopp. + +It is a client that subscribes to the topic temperature/celsius which should +have temperature data in text form being published to it. It reads this data as +a Celsius temperature, converts to Farenheit and republishes on +temperature/farenheit. diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/temperature_conversion/temperature_conversion.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/temperature_conversion/temperature_conversion.cpp new file mode 100644 index 0000000..1fa6f55 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/temperature_conversion/temperature_conversion.cpp @@ -0,0 +1,49 @@ +#include <cstdio> +#include <cstring> + +#include "temperature_conversion.h" +#include <mosquittopp.h> + +mqtt_tempconv::mqtt_tempconv(const char *id, const char *host, int port) : mosquittopp(id) +{ + int keepalive = 60; + + /* Connect immediately. This could also be done by calling + * mqtt_tempconv->connect(). */ + connect(host, port, keepalive); +}; + +mqtt_tempconv::~mqtt_tempconv() +{ +} + +void mqtt_tempconv::on_connect(int rc) +{ + printf("Connected with code %d.\n", rc); + if(rc == 0){ + /* Only attempt to subscribe on a successful connect. */ + subscribe(NULL, "temperature/celsius"); + } +} + +void mqtt_tempconv::on_message(const struct mosquitto_message *message) +{ + double temp_celsius, temp_farenheit; + char buf[51]; + + if(!strcmp(message->topic, "temperature/celsius")){ + memset(buf, 0, 51*sizeof(char)); + /* Copy N-1 bytes to ensure always 0 terminated. */ + memcpy(buf, message->payload, 50*sizeof(char)); + temp_celsius = atof(buf); + temp_farenheit = temp_celsius*9.0/5.0 + 32.0; + snprintf(buf, 50, "%f", temp_farenheit); + publish(NULL, "temperature/farenheit", strlen(buf), buf); + } +} + +void mqtt_tempconv::on_subscribe(int mid, int qos_count, const int *granted_qos) +{ + printf("Subscription succeeded.\n"); +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/temperature_conversion/temperature_conversion.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/temperature_conversion/temperature_conversion.h new file mode 100644 index 0000000..4d9951f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/examples/temperature_conversion/temperature_conversion.h @@ -0,0 +1,17 @@ +#ifndef TEMPERATURE_CONVERSION_H +#define TEMPERATURE_CONVERSION_H + +#include <mosquittopp.h> + +class mqtt_tempconv : public mosqpp::mosquittopp +{ + public: + mqtt_tempconv(const char *id, const char *host, int port); + ~mqtt_tempconv(); + + void on_connect(int rc); + void on_message(const struct mosquitto_message *message); + void on_subscribe(int mid, int qos_count, const int *granted_qos); +}; + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/installer/mosquitto.nsi b/proj1_mqttd/mosquitto/mosquitto-1.6.3/installer/mosquitto.nsi new file mode 100644 index 0000000..15cd507 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/installer/mosquitto.nsi @@ -0,0 +1,128 @@ +; NSIS installer script for mosquitto + +!include "MUI2.nsh" +!include "nsDialogs.nsh" +!include "LogicLib.nsh" + +; For environment variable code +!include "WinMessages.nsh" +!define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' + +Name "Eclipse Mosquitto" +!define VERSION 1.6.3 +OutFile "mosquitto-${VERSION}-install-windows-x86.exe" + +InstallDir "$PROGRAMFILES\mosquitto" + +;-------------------------------- +; Installer pages +!insertmacro MUI_PAGE_WELCOME + +!insertmacro MUI_PAGE_COMPONENTS +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH + + +;-------------------------------- +; Uninstaller pages +!insertmacro MUI_UNPAGE_WELCOME +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_UNPAGE_FINISH + +;-------------------------------- +; Languages +!insertmacro MUI_LANGUAGE "English" + +;-------------------------------- +; Installer sections + +Section "Files" SecInstall + SectionIn RO + SetOutPath "$INSTDIR" + File "..\build\src\Release\mosquitto.exe" + File "..\build\src\Release\mosquitto_passwd.exe" + File "..\build\client\Release\mosquitto_pub.exe" + File "..\build\client\Release\mosquitto_sub.exe" + File "..\build\lib\Release\mosquitto.dll" + File "..\build\lib\cpp\Release\mosquittopp.dll" + File "..\aclfile.example" + File "..\ChangeLog.txt" + File "..\mosquitto.conf" + File "..\pwfile.example" + File "..\readme.md" + File "..\readme-windows.txt" + ;File "C:\pthreads\Pre-built.2\dll\x86\pthreadVC2.dll" + File "C:\OpenSSL-Win32\bin\libssl-1_1.dll" + File "C:\OpenSSL-Win32\bin\libcrypto-1_1.dll" + File "..\edl-v10" + File "..\epl-v10" + + SetOutPath "$INSTDIR\devel" + File "..\lib\mosquitto.h" + File "..\build\lib\Release\mosquitto.lib" + File "..\lib\cpp\mosquittopp.h" + File "..\build\lib\cpp\Release\mosquittopp.lib" + File "..\src\mosquitto_plugin.h" + + WriteUninstaller "$INSTDIR\Uninstall.exe" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "DisplayName" "Eclipse Mosquitto MQTT broker" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\"" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "QuietUninstallString" "$\"$INSTDIR\Uninstall.exe$\" /S" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "HelpLink" "https://mosquitto.org/" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "URLInfoAbout" "https://mosquitto.org/" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "DisplayVersion" "${VERSION}" + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "NoModify" "1" + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "NoRepair" "1" + + WriteRegExpandStr ${env_hklm} MOSQUITTO_DIR $INSTDIR + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 +SectionEnd + +Section "Service" SecService + ExecWait '"$INSTDIR\mosquitto.exe" install' +SectionEnd + +Section "Uninstall" + ExecWait '"$INSTDIR\mosquitto.exe" uninstall' + Delete "$INSTDIR\mosquitto.exe" + Delete "$INSTDIR\mosquitto_passwd.exe" + Delete "$INSTDIR\mosquitto_pub.exe" + Delete "$INSTDIR\mosquitto_sub.exe" + Delete "$INSTDIR\mosquitto.dll" + Delete "$INSTDIR\mosquittopp.dll" + Delete "$INSTDIR\aclfile.example" + Delete "$INSTDIR\ChangeLog.txt" + Delete "$INSTDIR\mosquitto.conf" + Delete "$INSTDIR\pwfile.example" + Delete "$INSTDIR\readme.txt" + Delete "$INSTDIR\readme-windows.txt" + ;Delete "$INSTDIR\pthreadVC2.dll" + Delete "$INSTDIR\libssl-1_1.dll" + Delete "$INSTDIR\libcrypto-1_1.dll" + Delete "$INSTDIR\edl-v10" + Delete "$INSTDIR\epl-v10" + + Delete "$INSTDIR\devel\mosquitto.h" + Delete "$INSTDIR\devel\mosquitto.lib" + Delete "$INSTDIR\devel\mosquittopp.h" + Delete "$INSTDIR\devel\mosquittopp.lib" + Delete "$INSTDIR\devel\mosquitto_plugin.h" + + Delete "$INSTDIR\Uninstall.exe" + RMDir "$INSTDIR" + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" + + DeleteRegValue ${env_hklm} MOSQUITTO_DIR + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 +SectionEnd + +LangString DESC_SecInstall ${LANG_ENGLISH} "The main installation." +LangString DESC_SecService ${LANG_ENGLISH} "Install mosquitto as a Windows service?" + +!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${SecInstall} $(DESC_SecInstall) + !insertmacro MUI_DESCRIPTION_TEXT ${SecService} $(DESC_SecService) +!insertmacro MUI_FUNCTION_DESCRIPTION_END + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/installer/mosquitto64.nsi b/proj1_mqttd/mosquitto/mosquitto-1.6.3/installer/mosquitto64.nsi new file mode 100644 index 0000000..6027fc8 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/installer/mosquitto64.nsi @@ -0,0 +1,129 @@ +; NSIS installer script for mosquitto + +!include "MUI2.nsh" +!include "nsDialogs.nsh" +!include "LogicLib.nsh" + +; For environment variable code +!include "WinMessages.nsh" +!define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' + +Name "Eclipse Mosquitto" +!define VERSION 1.6.3 +OutFile "mosquitto-${VERSION}-install-windows-x64.exe" + +!include "x64.nsh" +InstallDir "$PROGRAMFILES64\mosquitto" + +;-------------------------------- +; Installer pages +!insertmacro MUI_PAGE_WELCOME + +!insertmacro MUI_PAGE_COMPONENTS +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH + + +;-------------------------------- +; Uninstaller pages +!insertmacro MUI_UNPAGE_WELCOME +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_UNPAGE_FINISH + +;-------------------------------- +; Languages +!insertmacro MUI_LANGUAGE "English" + +;-------------------------------- +; Installer sections + +Section "Files" SecInstall + SectionIn RO + SetOutPath "$INSTDIR" + File "..\build64\src\Release\mosquitto.exe" + File "..\build64\src\Release\mosquitto_passwd.exe" + File "..\build64\client\Release\mosquitto_pub.exe" + File "..\build64\client\Release\mosquitto_sub.exe" + File "..\build64\lib\Release\mosquitto.dll" + File "..\build64\lib\cpp\Release\mosquittopp.dll" + File "..\aclfile.example" + File "..\ChangeLog.txt" + File "..\mosquitto.conf" + File "..\pwfile.example" + File "..\readme.md" + File "..\readme-windows.txt" + ;File "C:\pthreads\Pre-built.2\dll\x64\pthreadVC2.dll" + File "C:\OpenSSL-Win64\bin\libssl-1_1-x64.dll" + File "C:\OpenSSL-Win64\bin\libcrypto-1_1-x64.dll" + File "..\edl-v10" + File "..\epl-v10" + + SetOutPath "$INSTDIR\devel" + File "..\lib\mosquitto.h" + File "..\build64\lib\Release\mosquitto.lib" + File "..\lib\cpp\mosquittopp.h" + File "..\build64\lib\cpp\Release\mosquittopp.lib" + File "..\src\mosquitto_plugin.h" + + WriteUninstaller "$INSTDIR\Uninstall.exe" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto64" "DisplayName" "Eclipse Mosquitto MQTT broker (64 bit)" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto64" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\"" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto64" "QuietUninstallString" "$\"$INSTDIR\Uninstall.exe$\" /S" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto64" "HelpLink" "https://mosquitto.org/" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto64" "URLInfoAbout" "https://mosquitto.org/" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto64" "DisplayVersion" "${VERSION}" + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto64" "NoModify" "1" + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto64" "NoRepair" "1" + + WriteRegExpandStr ${env_hklm} MOSQUITTO_DIR $INSTDIR + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 +SectionEnd + +Section "Service" SecService + ExecWait '"$INSTDIR\mosquitto.exe" install' +SectionEnd + +Section "Uninstall" + ExecWait '"$INSTDIR\mosquitto.exe" uninstall' + Delete "$INSTDIR\mosquitto.exe" + Delete "$INSTDIR\mosquitto_passwd.exe" + Delete "$INSTDIR\mosquitto_pub.exe" + Delete "$INSTDIR\mosquitto_sub.exe" + Delete "$INSTDIR\mosquitto.dll" + Delete "$INSTDIR\mosquittopp.dll" + Delete "$INSTDIR\aclfile.example" + Delete "$INSTDIR\ChangeLog.txt" + Delete "$INSTDIR\mosquitto.conf" + Delete "$INSTDIR\pwfile.example" + Delete "$INSTDIR\readme.txt" + Delete "$INSTDIR\readme-windows.txt" + ;Delete "$INSTDIR\pthreadVC2.dll" + Delete "$INSTDIR\libssl-1_1-x64.dll" + Delete "$INSTDIR\libcrypto-1_1-x64.dll" + Delete "$INSTDIR\edl-v10" + Delete "$INSTDIR\epl-v10" + + Delete "$INSTDIR\devel\mosquitto.h" + Delete "$INSTDIR\devel\mosquitto.lib" + Delete "$INSTDIR\devel\mosquittopp.h" + Delete "$INSTDIR\devel\mosquittopp.lib" + Delete "$INSTDIR\devel\mosquitto_plugin.h" + + Delete "$INSTDIR\Uninstall.exe" + RMDir "$INSTDIR" + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto64" + + DeleteRegValue ${env_hklm} MOSQUITTO_DIR + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 +SectionEnd + +LangString DESC_SecInstall ${LANG_ENGLISH} "The main installation." +LangString DESC_SecService ${LANG_ENGLISH} "Install mosquitto as a Windows service?" + +!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${SecInstall} $(DESC_SecInstall) + !insertmacro MUI_DESCRIPTION_TEXT ${SecService} $(DESC_SecService) +!insertmacro MUI_FUNCTION_DESCRIPTION_END + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/CMakeLists.txt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/CMakeLists.txt new file mode 100644 index 0000000..221c230 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/CMakeLists.txt @@ -0,0 +1,113 @@ +option(WITH_STATIC_LIBRARIES "Build static versions of the libmosquitto/pp libraries?" OFF) +option(WITH_PIC "Build the static library with PIC (Position Independent Code) enabled archives?" OFF) +add_subdirectory(cpp) + +include_directories(${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/lib + ${mosquitto_SOURCE_DIR}/src/deps + ${STDBOOL_H_PATH} ${STDINT_H_PATH} + ${OPENSSL_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR}) +link_directories(${mosquitto_SOURCE_DIR}/lib) + +set(C_SRC + actions.c + callbacks.c + connect.c + handle_auth.c + handle_connack.c + handle_disconnect.c + handle_ping.c + handle_pubackcomp.c + handle_publish.c + handle_pubrec.c + handle_pubrel.c + handle_suback.c + handle_unsuback.c + helpers.c + logging_mosq.c logging_mosq.h + loop.c + memory_mosq.c memory_mosq.h + messages_mosq.c messages_mosq.h + mosquitto.c mosquitto.h + mosquitto_internal.h + mqtt_protocol.h + net_mosq_ocsp.c net_mosq.c net_mosq.h + options.c + packet_datatypes.c + packet_mosq.c packet_mosq.h + property_mosq.c property_mosq.h + read_handle.c read_handle.h + send_connect.c + send_disconnect.c + send_mosq.c + send_publish.c + send_subscribe.c + send_unsubscribe.c + send_mosq.c send_mosq.h + socks_mosq.c + srv_mosq.c + thread_mosq.c + time_mosq.c + tls_mosq.c + utf8_mosq.c + util_mosq.c util_topic.c util_mosq.h + will_mosq.c will_mosq.h) + +set (LIBRARIES ${OPENSSL_LIBRARIES} ${PTHREAD_LIBRARIES}) + +if (UNIX AND NOT APPLE) + find_library(LIBRT rt) + if (LIBRT) + set (LIBRARIES ${LIBRARIES} rt) + endif (LIBRT) +endif (UNIX AND NOT APPLE) + +if (WIN32) + set (LIBRARIES ${LIBRARIES} ws2_32) +endif (WIN32) + +if (WITH_SRV) + # Simple detect c-ares + find_path(ARES_HEADER ares.h) + if (ARES_HEADER) + add_definitions("-DWITH_SRV") + set (LIBRARIES ${LIBRARIES} cares) + else (ARES_HEADER) + message(WARNING "c-ares library not found.") + endif (ARES_HEADER) +endif (WITH_SRV) + +add_library(libmosquitto SHARED ${C_SRC}) +set_target_properties(libmosquitto PROPERTIES + POSITION_INDEPENDENT_CODE 1 +) + +target_link_libraries(libmosquitto ${LIBRARIES}) + +set_target_properties(libmosquitto PROPERTIES + OUTPUT_NAME mosquitto + VERSION ${VERSION} + SOVERSION 1 +) + +install(TARGETS libmosquitto RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") + +if (WITH_STATIC_LIBRARIES) + add_library(libmosquitto_static STATIC ${C_SRC}) + if (WITH_PIC) + set_target_properties(libmosquitto_static PROPERTIES + POSITION_INDEPENDENT_CODE 1 + ) + endif (WITH_PIC) + + target_link_libraries(libmosquitto_static ${LIBRARIES}) + + set_target_properties(libmosquitto_static PROPERTIES + OUTPUT_NAME mosquitto + VERSION ${VERSION} + ) + + target_compile_definitions(libmosquitto_static PUBLIC "LIBMOSQUITTO_STATIC") + install(TARGETS libmosquitto_static ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") +endif (WITH_STATIC_LIBRARIES) + +install(FILES mosquitto.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/Makefile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/Makefile new file mode 100644 index 0000000..e3800b2 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/Makefile @@ -0,0 +1,220 @@ +include ../config.mk + +.PHONY : really clean install + +MOSQ_OBJS=mosquitto.o \ + actions.o \ + callbacks.o \ + connect.o \ + handle_auth.o \ + handle_connack.o \ + handle_disconnect.o \ + handle_ping.o \ + handle_pubackcomp.o \ + handle_publish.o \ + handle_pubrec.o \ + handle_pubrel.o \ + handle_suback.o \ + handle_unsuback.o \ + helpers.o \ + logging_mosq.o \ + loop.o \ + memory_mosq.o \ + messages_mosq.o \ + net_mosq_ocsp.o \ + net_mosq.o \ + options.o \ + packet_datatypes.o \ + packet_mosq.o \ + property_mosq.o \ + read_handle.o \ + send_connect.o \ + send_disconnect.o \ + send_mosq.o \ + send_publish.o \ + send_subscribe.o \ + send_unsubscribe.o \ + socks_mosq.o \ + srv_mosq.o \ + thread_mosq.o \ + time_mosq.o \ + tls_mosq.o \ + utf8_mosq.o \ + util_mosq.o \ + util_topic.o \ + will_mosq.o + +ALL_DEPS:= + +ifeq ($(WITH_SHARED_LIBRARIES),yes) + ALL_DEPS+=libmosquitto.so.${SOVERSION} +endif + +ifeq ($(WITH_STATIC_LIBRARIES),yes) + ALL_DEPS+=libmosquitto.a +endif + +all : ${ALL_DEPS} +ifeq ($(WITH_SHARED_LIBRARIES),yes) + $(MAKE) -C cpp +endif + +install : all + $(INSTALL) -d "${DESTDIR}${libdir}/" +ifeq ($(WITH_SHARED_LIBRARIES),yes) + $(INSTALL) ${STRIP_OPTS} libmosquitto.so.${SOVERSION} "${DESTDIR}${libdir}/libmosquitto.so.${SOVERSION}" + ln -sf libmosquitto.so.${SOVERSION} "${DESTDIR}${libdir}/libmosquitto.so" +endif +ifeq ($(WITH_STATIC_LIBRARIES),yes) + $(INSTALL) ${STRIP_OPTS} libmosquitto.a "${DESTDIR}${libdir}/libmosquitto.a" +endif + $(INSTALL) -d "${DESTDIR}${incdir}/" + $(INSTALL) mosquitto.h "${DESTDIR}${incdir}/mosquitto.h" + $(INSTALL) -d "${DESTDIR}${libdir}/pkgconfig" + $(INSTALL) -m644 ../libmosquitto.pc.in "${DESTDIR}${libdir}/pkgconfig/libmosquitto.pc" + sed -i -e "s#@CMAKE_INSTALL_PREFIX@#${prefix}#" -e "s#@VERSION@#${VERSION}#" "${DESTDIR}${libdir}/pkgconfig/libmosquitto.pc" +ifeq ($(WITH_SHARED_LIBRARIES),yes) + $(MAKE) -C cpp install +endif + +uninstall : + -rm -f "${DESTDIR}${libdir}/libmosquitto.so.${SOVERSION}" + -rm -f "${DESTDIR}${libdir}/libmosquitto.so" + -rm -f "${DESTDIR}${libdir}/libmosquitto.a" + -rm -f "${DESTDIR}${incdir}/mosquitto.h" + +reallyclean : clean + +clean : + -rm -f *.o libmosquitto.so.${SOVERSION} libmosquitto.so libmosquitto.a *.gcno *.gcda + $(MAKE) -C cpp clean + +libmosquitto.so.${SOVERSION} : ${MOSQ_OBJS} + ${CROSS_COMPILE}$(CC) -shared $(LIB_LDFLAGS) $^ -o $@ ${LIB_LIBADD} + +libmosquitto.a : ${MOSQ_OBJS} + ${CROSS_COMPILE}$(AR) cr $@ $^ + +mosquitto.o : mosquitto.c mosquitto.h mosquitto_internal.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +actions.o : actions.c mosquitto.h mosquitto_internal.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +callbacks.o : callbacks.c mosquitto.h mosquitto_internal.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +connect.o : connect.c mosquitto.h mosquitto_internal.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +handle_auth.o : handle_auth.c read_handle.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +handle_connack.o : handle_connack.c read_handle.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +handle_disconnect.o : handle_disconnect.c read_handle.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +handle_publish.o : handle_publish.c read_handle.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +handle_ping.o : handle_ping.c read_handle.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +handle_pubackcomp.o : handle_pubackcomp.c read_handle.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +handle_pubrec.o : handle_pubrec.c read_handle.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +handle_pubrel.o : handle_pubrel.c read_handle.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +handle_suback.o : handle_suback.c read_handle.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +handle_unsuback.o : handle_unsuback.c read_handle.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +helpers.o : helpers.c + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +logging_mosq.o : logging_mosq.c logging_mosq.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +loop.o : loop.c mosquitto.h mosquitto_internal.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +messages_mosq.o : messages_mosq.c messages_mosq.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +memory_mosq.o : memory_mosq.c memory_mosq.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +net_mosq_ocsp.o : net_mosq_ocsp.c net_mosq.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +net_mosq.o : net_mosq.c net_mosq.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +options.o : options.c mosquitto.h mosquitto_internal.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +packet_datatypes.o : packet_datatypes.c packet_mosq.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +packet_mosq.o : packet_mosq.c packet_mosq.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +property_mosq.o : property_mosq.c property_mosq.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +read_handle.o : read_handle.c read_handle.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +send_connect.o : send_connect.c send_mosq.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +send_disconnect.o : send_disconnect.c send_mosq.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +send_mosq.o : send_mosq.c send_mosq.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +send_publish.o : send_publish.c send_mosq.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +send_subscribe.o : send_subscribe.c send_mosq.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +send_unsubscribe.o : send_unsubscribe.c send_mosq.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +socks_mosq.o : socks_mosq.c + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +srv_mosq.o : srv_mosq.c + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +thread_mosq.o : thread_mosq.c + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +time_mosq.o : time_mosq.c + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +tls_mosq.o : tls_mosq.c + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +utf8_mosq.o : utf8_mosq.c + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +util_mosq.o : util_mosq.c util_mosq.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +util_topic.o : util_topic.c util_mosq.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + +will_mosq.o : will_mosq.c will_mosq.h + ${CROSS_COMPILE}$(CC) $(LIB_CPPFLAGS) $(LIB_CFLAGS) -c $< -o $@ + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/actions.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/actions.c new file mode 100644 index 0000000..a5bf673 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/actions.c @@ -0,0 +1,260 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <string.h> + +#include "mosquitto.h" +#include "mosquitto_internal.h" +#include "memory_mosq.h" +#include "messages_mosq.h" +#include "mqtt_protocol.h" +#include "net_mosq.h" +#include "packet_mosq.h" +#include "send_mosq.h" +#include "util_mosq.h" + + +int mosquitto_publish(struct mosquitto *mosq, int *mid, const char *topic, int payloadlen, const void *payload, int qos, bool retain) +{ + return mosquitto_publish_v5(mosq, mid, topic, payloadlen, payload, qos, retain, NULL); +} + +int mosquitto_publish_v5(struct mosquitto *mosq, int *mid, const char *topic, int payloadlen, const void *payload, int qos, bool retain, const mosquitto_property *properties) +{ + struct mosquitto_message_all *message; + uint16_t local_mid; + const mosquitto_property *p; + const mosquitto_property *outgoing_properties = NULL; + mosquitto_property local_property; + bool have_topic_alias; + int rc; + int tlen = 0; + uint32_t remaining_length; + + if(!mosq || qos<0 || qos>2) return MOSQ_ERR_INVAL; + if(mosq->protocol != mosq_p_mqtt5 && properties) return MOSQ_ERR_NOT_SUPPORTED; + if(qos > mosq->maximum_qos) return MOSQ_ERR_QOS_NOT_SUPPORTED; + + if(properties){ + if(properties->client_generated){ + outgoing_properties = properties; + }else{ + memcpy(&local_property, properties, sizeof(mosquitto_property)); + local_property.client_generated = true; + local_property.next = NULL; + outgoing_properties = &local_property; + } + rc = mosquitto_property_check_all(CMD_PUBLISH, outgoing_properties); + if(rc) return rc; + } + + if(!topic || STREMPTY(topic)){ + if(topic) topic = NULL; + + if(mosq->protocol == mosq_p_mqtt5){ + p = outgoing_properties; + have_topic_alias = false; + while(p){ + if(p->identifier == MQTT_PROP_TOPIC_ALIAS){ + have_topic_alias = true; + break; + } + p = p->next; + } + if(have_topic_alias == false){ + return MOSQ_ERR_INVAL; + } + }else{ + return MOSQ_ERR_INVAL; + } + }else{ + tlen = strlen(topic); + if(mosquitto_validate_utf8(topic, tlen)) return MOSQ_ERR_MALFORMED_UTF8; + if(payloadlen < 0 || payloadlen > MQTT_MAX_PAYLOAD) return MOSQ_ERR_PAYLOAD_SIZE; + if(mosquitto_pub_topic_check(topic) != MOSQ_ERR_SUCCESS){ + return MOSQ_ERR_INVAL; + } + } + + if(mosq->maximum_packet_size > 0){ + remaining_length = 1 + 2+tlen + payloadlen + property__get_length_all(outgoing_properties); + if(qos > 0){ + remaining_length++; + } + if(packet__check_oversize(mosq, remaining_length)){ + return MOSQ_ERR_OVERSIZE_PACKET; + } + } + + local_mid = mosquitto__mid_generate(mosq); + if(mid){ + *mid = local_mid; + } + + if(qos == 0){ + return send__publish(mosq, local_mid, topic, payloadlen, payload, qos, retain, false, outgoing_properties, NULL, 0); + }else{ + message = mosquitto__calloc(1, sizeof(struct mosquitto_message_all)); + if(!message) return MOSQ_ERR_NOMEM; + + message->next = NULL; + message->timestamp = mosquitto_time(); + message->msg.mid = local_mid; + if(topic){ + message->msg.topic = mosquitto__strdup(topic); + if(!message->msg.topic){ + message__cleanup(&message); + return MOSQ_ERR_NOMEM; + } + } + if(payloadlen){ + message->msg.payloadlen = payloadlen; + message->msg.payload = mosquitto__malloc(payloadlen*sizeof(uint8_t)); + if(!message->msg.payload){ + message__cleanup(&message); + return MOSQ_ERR_NOMEM; + } + memcpy(message->msg.payload, payload, payloadlen*sizeof(uint8_t)); + }else{ + message->msg.payloadlen = 0; + message->msg.payload = NULL; + } + message->msg.qos = qos; + message->msg.retain = retain; + message->dup = false; + + pthread_mutex_lock(&mosq->msgs_out.mutex); + message->state = mosq_ms_invalid; + message__queue(mosq, message, mosq_md_out); + pthread_mutex_unlock(&mosq->msgs_out.mutex); + return MOSQ_ERR_SUCCESS; + } +} + + +int mosquitto_subscribe(struct mosquitto *mosq, int *mid, const char *sub, int qos) +{ + return mosquitto_subscribe_multiple(mosq, mid, 1, (char *const *const)&sub, qos, 0, NULL); +} + + +int mosquitto_subscribe_v5(struct mosquitto *mosq, int *mid, const char *sub, int qos, int options, const mosquitto_property *properties) +{ + return mosquitto_subscribe_multiple(mosq, mid, 1, (char *const *const)&sub, qos, options, properties); +} + + +int mosquitto_subscribe_multiple(struct mosquitto *mosq, int *mid, int sub_count, char *const *const sub, int qos, int options, const mosquitto_property *properties) +{ + const mosquitto_property *outgoing_properties = NULL; + mosquitto_property local_property; + int i; + int rc; + uint32_t remaining_length = 0; + int slen; + + if(!mosq || !sub_count || !sub) return MOSQ_ERR_INVAL; + if(mosq->protocol != mosq_p_mqtt5 && properties) return MOSQ_ERR_NOT_SUPPORTED; + if(qos < 0 || qos > 2) return MOSQ_ERR_INVAL; + if((options & 0x30) == 0x30 || (options & 0xC0) != 0) return MOSQ_ERR_INVAL; + if(mosq->sock == INVALID_SOCKET) return MOSQ_ERR_NO_CONN; + + if(properties){ + if(properties->client_generated){ + outgoing_properties = properties; + }else{ + memcpy(&local_property, properties, sizeof(mosquitto_property)); + local_property.client_generated = true; + local_property.next = NULL; + outgoing_properties = &local_property; + } + rc = mosquitto_property_check_all(CMD_SUBSCRIBE, outgoing_properties); + if(rc) return rc; + } + + for(i=0; i<sub_count; i++){ + if(mosquitto_sub_topic_check(sub[i])) return MOSQ_ERR_INVAL; + slen = strlen(sub[i]); + if(mosquitto_validate_utf8(sub[i], slen)) return MOSQ_ERR_MALFORMED_UTF8; + remaining_length += 2+slen + 1; + } + + if(mosq->maximum_packet_size > 0){ + remaining_length += 2 + property__get_length_all(outgoing_properties); + if(packet__check_oversize(mosq, remaining_length)){ + return MOSQ_ERR_OVERSIZE_PACKET; + } + } + + return send__subscribe(mosq, mid, sub_count, sub, qos|options, outgoing_properties); +} + + +int mosquitto_unsubscribe(struct mosquitto *mosq, int *mid, const char *sub) +{ + return mosquitto_unsubscribe_multiple(mosq, mid, 1, (char *const *const)&sub, NULL); +} + +int mosquitto_unsubscribe_v5(struct mosquitto *mosq, int *mid, const char *sub, const mosquitto_property *properties) +{ + return mosquitto_unsubscribe_multiple(mosq, mid, 1, (char *const *const)&sub, properties); +} + +int mosquitto_unsubscribe_multiple(struct mosquitto *mosq, int *mid, int sub_count, char *const *const sub, const mosquitto_property *properties) +{ + const mosquitto_property *outgoing_properties = NULL; + mosquitto_property local_property; + int rc; + int i; + uint32_t remaining_length = 0; + int slen; + + if(!mosq) return MOSQ_ERR_INVAL; + if(mosq->protocol != mosq_p_mqtt5 && properties) return MOSQ_ERR_NOT_SUPPORTED; + if(mosq->sock == INVALID_SOCKET) return MOSQ_ERR_NO_CONN; + + if(properties){ + if(properties->client_generated){ + outgoing_properties = properties; + }else{ + memcpy(&local_property, properties, sizeof(mosquitto_property)); + local_property.client_generated = true; + local_property.next = NULL; + outgoing_properties = &local_property; + } + rc = mosquitto_property_check_all(CMD_UNSUBSCRIBE, outgoing_properties); + if(rc) return rc; + } + + for(i=0; i<sub_count; i++){ + if(mosquitto_sub_topic_check(sub[i])) return MOSQ_ERR_INVAL; + slen = strlen(sub[i]); + if(mosquitto_validate_utf8(sub[i], slen)) return MOSQ_ERR_MALFORMED_UTF8; + remaining_length += 2+slen; + } + + if(mosq->maximum_packet_size > 0){ + remaining_length += 2 + property__get_length_all(outgoing_properties); + if(packet__check_oversize(mosq, remaining_length)){ + return MOSQ_ERR_OVERSIZE_PACKET; + } + } + + return send__unsubscribe(mosq, mid, sub_count, sub, outgoing_properties); +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/actions.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/actions.o new file mode 100644 index 0000000..52caaeb --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/actions.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/alias_mosq.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/alias_mosq.c new file mode 100644 index 0000000..8057bb9 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/alias_mosq.c @@ -0,0 +1,85 @@ +/* +Copyright (c) 2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include "mosquitto.h" +#include "alias_mosq.h" +#include "memory_mosq.h" + +int alias__add(struct mosquitto *mosq, const char *topic, int alias) +{ + int i; + struct mosquitto__alias *aliases; + + for(i=0; i<mosq->alias_count; i++){ + if(mosq->aliases[i].alias == alias){ + mosquitto__free(mosq->aliases[i].topic); + mosq->aliases[i].topic = mosquitto__strdup(topic); + if(mosq->aliases[i].topic){ + return MOSQ_ERR_SUCCESS; + }else{ + + return MOSQ_ERR_NOMEM; + } + } + } + + /* New alias */ + aliases = mosquitto__realloc(mosq->aliases, sizeof(struct mosquitto__alias)*(mosq->alias_count+1)); + if(!aliases) return MOSQ_ERR_NOMEM; + + mosq->aliases = aliases; + mosq->aliases[mosq->alias_count].alias = alias; + mosq->aliases[mosq->alias_count].topic = mosquitto__strdup(topic); + if(!mosq->aliases[mosq->alias_count].topic){ + return MOSQ_ERR_NOMEM; + } + mosq->alias_count++; + + return MOSQ_ERR_SUCCESS; +} + + +int alias__find(struct mosquitto *mosq, char **topic, int alias) +{ + int i; + + for(i=0; i<mosq->alias_count; i++){ + if(mosq->aliases[i].alias == alias){ + *topic = mosquitto__strdup(mosq->aliases[i].topic); + if(*topic){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_NOMEM; + } + } + } + return MOSQ_ERR_INVAL; +} + + +void alias__free_all(struct mosquitto *mosq) +{ + int i; + + for(i=0; i<mosq->alias_count; i++){ + mosquitto__free(mosq->aliases[i].topic); + } + mosquitto__free(mosq->aliases); + mosq->aliases = NULL; + mosq->alias_count = 0; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/alias_mosq.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/alias_mosq.h new file mode 100644 index 0000000..f892dbf --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/alias_mosq.h @@ -0,0 +1,26 @@ +/* +Copyright (c) 2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef ALIAS_MOSQ_H +#define ALIAS_MOSQ_H + +#include "mosquitto_internal.h" + +int alias__add(struct mosquitto *mosq, const char *topic, int alias); +int alias__find(struct mosquitto *mosq, char **topic, int alias); +void alias__free_all(struct mosquitto *mosq); + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/callbacks.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/callbacks.c new file mode 100644 index 0000000..17f5161 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/callbacks.c @@ -0,0 +1,120 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include "mosquitto.h" +#include "mosquitto_internal.h" + + +void mosquitto_connect_callback_set(struct mosquitto *mosq, void (*on_connect)(struct mosquitto *, void *, int)) +{ + pthread_mutex_lock(&mosq->callback_mutex); + mosq->on_connect = on_connect; + pthread_mutex_unlock(&mosq->callback_mutex); +} + +void mosquitto_connect_with_flags_callback_set(struct mosquitto *mosq, void (*on_connect)(struct mosquitto *, void *, int, int)) +{ + pthread_mutex_lock(&mosq->callback_mutex); + mosq->on_connect_with_flags = on_connect; + pthread_mutex_unlock(&mosq->callback_mutex); +} + +void mosquitto_connect_v5_callback_set(struct mosquitto *mosq, void (*on_connect)(struct mosquitto *, void *, int, int, const mosquitto_property *)) +{ + pthread_mutex_lock(&mosq->callback_mutex); + mosq->on_connect_v5 = on_connect; + pthread_mutex_unlock(&mosq->callback_mutex); +} + +void mosquitto_disconnect_callback_set(struct mosquitto *mosq, void (*on_disconnect)(struct mosquitto *, void *, int)) +{ + pthread_mutex_lock(&mosq->callback_mutex); + mosq->on_disconnect = on_disconnect; + pthread_mutex_unlock(&mosq->callback_mutex); +} + +void mosquitto_disconnect_v5_callback_set(struct mosquitto *mosq, void (*on_disconnect)(struct mosquitto *, void *, int, const mosquitto_property *)) +{ + pthread_mutex_lock(&mosq->callback_mutex); + mosq->on_disconnect_v5 = on_disconnect; + pthread_mutex_unlock(&mosq->callback_mutex); +} + +void mosquitto_publish_callback_set(struct mosquitto *mosq, void (*on_publish)(struct mosquitto *, void *, int)) +{ + pthread_mutex_lock(&mosq->callback_mutex); + mosq->on_publish = on_publish; + pthread_mutex_unlock(&mosq->callback_mutex); +} + +void mosquitto_publish_v5_callback_set(struct mosquitto *mosq, void (*on_publish)(struct mosquitto *, void *, int, int, const mosquitto_property *props)) +{ + pthread_mutex_lock(&mosq->callback_mutex); + mosq->on_publish_v5 = on_publish; + pthread_mutex_unlock(&mosq->callback_mutex); +} + +void mosquitto_message_callback_set(struct mosquitto *mosq, void (*on_message)(struct mosquitto *, void *, const struct mosquitto_message *)) +{ + pthread_mutex_lock(&mosq->callback_mutex); + mosq->on_message = on_message; + pthread_mutex_unlock(&mosq->callback_mutex); +} + +void mosquitto_message_v5_callback_set(struct mosquitto *mosq, void (*on_message)(struct mosquitto *, void *, const struct mosquitto_message *, const mosquitto_property *props)) +{ + pthread_mutex_lock(&mosq->callback_mutex); + mosq->on_message_v5 = on_message; + pthread_mutex_unlock(&mosq->callback_mutex); +} + +void mosquitto_subscribe_callback_set(struct mosquitto *mosq, void (*on_subscribe)(struct mosquitto *, void *, int, int, const int *)) +{ + pthread_mutex_lock(&mosq->callback_mutex); + mosq->on_subscribe = on_subscribe; + pthread_mutex_unlock(&mosq->callback_mutex); +} + +void mosquitto_subscribe_v5_callback_set(struct mosquitto *mosq, void (*on_subscribe)(struct mosquitto *, void *, int, int, const int *, const mosquitto_property *props)) +{ + pthread_mutex_lock(&mosq->callback_mutex); + mosq->on_subscribe_v5 = on_subscribe; + pthread_mutex_unlock(&mosq->callback_mutex); +} + +void mosquitto_unsubscribe_callback_set(struct mosquitto *mosq, void (*on_unsubscribe)(struct mosquitto *, void *, int)) +{ + pthread_mutex_lock(&mosq->callback_mutex); + mosq->on_unsubscribe = on_unsubscribe; + pthread_mutex_unlock(&mosq->callback_mutex); +} + +void mosquitto_unsubscribe_v5_callback_set(struct mosquitto *mosq, void (*on_unsubscribe)(struct mosquitto *, void *, int, const mosquitto_property *props)) +{ + pthread_mutex_lock(&mosq->callback_mutex); + mosq->on_unsubscribe_v5 = on_unsubscribe; + pthread_mutex_unlock(&mosq->callback_mutex); +} + +void mosquitto_log_callback_set(struct mosquitto *mosq, void (*on_log)(struct mosquitto *, void *, int, const char *)) +{ + pthread_mutex_lock(&mosq->log_callback_mutex); + mosq->on_log = on_log; + pthread_mutex_unlock(&mosq->log_callback_mutex); +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/callbacks.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/callbacks.o new file mode 100644 index 0000000..c97d577 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/callbacks.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/connect.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/connect.c new file mode 100644 index 0000000..7543d4a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/connect.c @@ -0,0 +1,330 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <string.h> + +#include "mosquitto.h" +#include "mosquitto_internal.h" +#include "logging_mosq.h" +#include "messages_mosq.h" +#include "memory_mosq.h" +#include "packet_mosq.h" +#include "mqtt_protocol.h" +#include "net_mosq.h" +#include "send_mosq.h" +#include "socks_mosq.h" +#include "util_mosq.h" + +static char alphanum[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + +static int mosquitto__reconnect(struct mosquitto *mosq, bool blocking, const mosquitto_property *properties); +static int mosquitto__connect_init(struct mosquitto *mosq, const char *host, int port, int keepalive, const char *bind_address); + + +static int mosquitto__connect_init(struct mosquitto *mosq, const char *host, int port, int keepalive, const char *bind_address) +{ + int i; + int rc; + + if(!mosq) return MOSQ_ERR_INVAL; + if(!host || port <= 0) return MOSQ_ERR_INVAL; + + if(mosq->id == NULL && (mosq->protocol == mosq_p_mqtt31 || mosq->protocol == mosq_p_mqtt311)){ + mosq->id = (char *)mosquitto__calloc(24, sizeof(char)); + if(!mosq->id){ + return MOSQ_ERR_NOMEM; + } + mosq->id[0] = 'm'; + mosq->id[1] = 'o'; + mosq->id[2] = 's'; + mosq->id[3] = 'q'; + mosq->id[4] = '/'; + + rc = util__random_bytes(&mosq->id[5], 18); + if(rc) return rc; + + for(i=5; i<23; i++){ + mosq->id[i] = alphanum[(mosq->id[i]&0x7F)%(sizeof(alphanum)-1)]; + } + } + + mosquitto__free(mosq->host); + mosq->host = mosquitto__strdup(host); + if(!mosq->host) return MOSQ_ERR_NOMEM; + mosq->port = port; + + mosquitto__free(mosq->bind_address); + if(bind_address){ + mosq->bind_address = mosquitto__strdup(bind_address); + if(!mosq->bind_address) return MOSQ_ERR_NOMEM; + } + + mosq->keepalive = keepalive; + mosq->msgs_in.inflight_quota = mosq->msgs_in.inflight_maximum; + mosq->msgs_out.inflight_quota = mosq->msgs_out.inflight_maximum; + + if(mosq->sockpairR != INVALID_SOCKET){ + COMPAT_CLOSE(mosq->sockpairR); + mosq->sockpairR = INVALID_SOCKET; + } + if(mosq->sockpairW != INVALID_SOCKET){ + COMPAT_CLOSE(mosq->sockpairW); + mosq->sockpairW = INVALID_SOCKET; + } + + if(net__socketpair(&mosq->sockpairR, &mosq->sockpairW)){ + log__printf(mosq, MOSQ_LOG_WARNING, + "Warning: Unable to open socket pair, outgoing publish commands may be delayed."); + } + + return MOSQ_ERR_SUCCESS; +} + + +int mosquitto_connect(struct mosquitto *mosq, const char *host, int port, int keepalive) +{ + return mosquitto_connect_bind(mosq, host, port, keepalive, NULL); +} + + +int mosquitto_connect_bind(struct mosquitto *mosq, const char *host, int port, int keepalive, const char *bind_address) +{ + return mosquitto_connect_bind_v5(mosq, host, port, keepalive, bind_address, NULL); +} + +int mosquitto_connect_bind_v5(struct mosquitto *mosq, const char *host, int port, int keepalive, const char *bind_address, const mosquitto_property *properties) +{ + int rc; + + if(properties){ + rc = mosquitto_property_check_all(CMD_CONNECT, properties); + if(rc) return rc; + } + + rc = mosquitto__connect_init(mosq, host, port, keepalive, bind_address); + if(rc) return rc; + + pthread_mutex_lock(&mosq->state_mutex); + mosq->state = mosq_cs_new; + pthread_mutex_unlock(&mosq->state_mutex); + + return mosquitto__reconnect(mosq, true, properties); +} + + +int mosquitto_connect_async(struct mosquitto *mosq, const char *host, int port, int keepalive) +{ + return mosquitto_connect_bind_async(mosq, host, port, keepalive, NULL); +} + + +int mosquitto_connect_bind_async(struct mosquitto *mosq, const char *host, int port, int keepalive, const char *bind_address) +{ + int rc = mosquitto__connect_init(mosq, host, port, keepalive, bind_address); + if(rc) return rc; + + pthread_mutex_lock(&mosq->state_mutex); + mosq->state = mosq_cs_connect_async; + pthread_mutex_unlock(&mosq->state_mutex); + + return mosquitto__reconnect(mosq, false, NULL); +} + + +int mosquitto_reconnect_async(struct mosquitto *mosq) +{ + return mosquitto__reconnect(mosq, false, NULL); +} + + +int mosquitto_reconnect(struct mosquitto *mosq) +{ + return mosquitto__reconnect(mosq, true, NULL); +} + + +static int mosquitto__reconnect(struct mosquitto *mosq, bool blocking, const mosquitto_property *properties) +{ + const mosquitto_property *outgoing_properties = NULL; + mosquitto_property local_property; + int rc; + struct mosquitto__packet *packet; + if(!mosq) return MOSQ_ERR_INVAL; + if(!mosq->host || mosq->port <= 0) return MOSQ_ERR_INVAL; + if(mosq->protocol != mosq_p_mqtt5 && properties) return MOSQ_ERR_NOT_SUPPORTED; + + if(properties){ + if(properties->client_generated){ + outgoing_properties = properties; + }else{ + memcpy(&local_property, properties, sizeof(mosquitto_property)); + local_property.client_generated = true; + local_property.next = NULL; + outgoing_properties = &local_property; + } + rc = mosquitto_property_check_all(CMD_CONNECT, outgoing_properties); + if(rc) return rc; + } + + pthread_mutex_lock(&mosq->state_mutex); +#ifdef WITH_SOCKS + if(mosq->socks5_host){ + mosq->state = mosq_cs_socks5_new; + }else +#endif + { + mosq->state = mosq_cs_new; + } + pthread_mutex_unlock(&mosq->state_mutex); + + pthread_mutex_lock(&mosq->msgtime_mutex); + mosq->last_msg_in = mosquitto_time(); + mosq->next_msg_out = mosq->last_msg_in + mosq->keepalive; + pthread_mutex_unlock(&mosq->msgtime_mutex); + + mosq->ping_t = 0; + + packet__cleanup(&mosq->in_packet); + + pthread_mutex_lock(&mosq->current_out_packet_mutex); + pthread_mutex_lock(&mosq->out_packet_mutex); + + if(mosq->out_packet && !mosq->current_out_packet){ + mosq->current_out_packet = mosq->out_packet; + mosq->out_packet = mosq->out_packet->next; + } + + while(mosq->current_out_packet){ + packet = mosq->current_out_packet; + /* Free data and reset values */ + mosq->current_out_packet = mosq->out_packet; + if(mosq->out_packet){ + mosq->out_packet = mosq->out_packet->next; + } + + packet__cleanup(packet); + mosquitto__free(packet); + } + pthread_mutex_unlock(&mosq->out_packet_mutex); + pthread_mutex_unlock(&mosq->current_out_packet_mutex); + + message__reconnect_reset(mosq); + + if(mosq->sock != INVALID_SOCKET){ + net__socket_close(mosq); //close socket + } + +#ifdef WITH_SOCKS + if(mosq->socks5_host){ + rc = net__socket_connect(mosq, mosq->socks5_host, mosq->socks5_port, mosq->bind_address, blocking); + }else +#endif + { + pthread_mutex_lock(&mosq->state_mutex); + mosq->state = mosq_cs_connecting; + pthread_mutex_unlock(&mosq->state_mutex); + rc = net__socket_connect(mosq, mosq->host, mosq->port, mosq->bind_address, blocking); + } + if(rc>0){ + return rc; + } + +#ifdef WITH_SOCKS + if(mosq->socks5_host){ + return socks5__send(mosq); + }else +#endif + { + return send__connect(mosq, mosq->keepalive, mosq->clean_start, outgoing_properties); + } +} + + +int mosquitto_disconnect(struct mosquitto *mosq) +{ + return mosquitto_disconnect_v5(mosq, 0, NULL); +} + +int mosquitto_disconnect_v5(struct mosquitto *mosq, int reason_code, const mosquitto_property *properties) +{ + const mosquitto_property *outgoing_properties = NULL; + mosquitto_property local_property; + int rc; + if(!mosq) return MOSQ_ERR_INVAL; + if(mosq->protocol != mosq_p_mqtt5 && properties) return MOSQ_ERR_NOT_SUPPORTED; + + if(properties){ + if(properties->client_generated){ + outgoing_properties = properties; + }else{ + memcpy(&local_property, properties, sizeof(mosquitto_property)); + local_property.client_generated = true; + local_property.next = NULL; + outgoing_properties = &local_property; + } + rc = mosquitto_property_check_all(CMD_DISCONNECT, outgoing_properties); + if(rc) return rc; + } + + pthread_mutex_lock(&mosq->state_mutex); + mosq->state = mosq_cs_disconnecting; + pthread_mutex_unlock(&mosq->state_mutex); + + if(mosq->sock == INVALID_SOCKET) return MOSQ_ERR_NO_CONN; + return send__disconnect(mosq, reason_code, outgoing_properties); +} + + +void do_client_disconnect(struct mosquitto *mosq, int reason_code, const mosquitto_property *properties) +{ + pthread_mutex_lock(&mosq->state_mutex); + mosq->state = mosq_cs_disconnecting; + pthread_mutex_unlock(&mosq->state_mutex); + + net__socket_close(mosq); + + /* Free data and reset values */ + pthread_mutex_lock(&mosq->out_packet_mutex); + mosq->current_out_packet = mosq->out_packet; + if(mosq->out_packet){ + mosq->out_packet = mosq->out_packet->next; + if(!mosq->out_packet){ + mosq->out_packet_last = NULL; + } + } + pthread_mutex_unlock(&mosq->out_packet_mutex); + + pthread_mutex_lock(&mosq->msgtime_mutex); + mosq->next_msg_out = mosquitto_time() + mosq->keepalive; + pthread_mutex_unlock(&mosq->msgtime_mutex); + + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_disconnect){ + mosq->in_callback = true; + mosq->on_disconnect(mosq, mosq->userdata, reason_code); + mosq->in_callback = false; + } + if(mosq->on_disconnect_v5){ + mosq->in_callback = true; + mosq->on_disconnect_v5(mosq, mosq->userdata, reason_code, properties); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + pthread_mutex_unlock(&mosq->current_out_packet_mutex); +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/connect.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/connect.o new file mode 100644 index 0000000..52e6bbf --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/connect.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/CMakeLists.txt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/CMakeLists.txt new file mode 100644 index 0000000..89eb560 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/CMakeLists.txt @@ -0,0 +1,40 @@ +include_directories(${mosquitto_SOURCE_DIR}/lib ${mosquitto_SOURCE_DIR}/lib/cpp + ${STDBOOL_H_PATH} ${STDINT_H_PATH}) +link_directories(${mosquitto_BINARY_DIR}/lib) + +set(CPP_SRC mosquittopp.cpp mosquittopp.h) + +add_library(mosquittopp SHARED ${CPP_SRC}) +set_target_properties(mosquittopp PROPERTIES + POSITION_INDEPENDENT_CODE 1 +) +target_link_libraries(mosquittopp libmosquitto) +set_target_properties(mosquittopp PROPERTIES + VERSION ${VERSION} + SOVERSION 1 +) +install(TARGETS mosquittopp RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") + +if (WITH_STATIC_LIBRARIES) + add_library(mosquittopp_static STATIC + ${C_SRC} + ${CPP_SRC} + ) + if (WITH_PIC) + set_target_properties(mosquittopp_static PROPERTIES + POSITION_INDEPENDENT_CODE 1 + ) + endif (WITH_PIC) + + target_link_libraries(mosquittopp_static ${LIBRARIES}) + + set_target_properties(mosquittopp_static PROPERTIES + OUTPUT_NAME mosquittopp + VERSION ${VERSION} + ) + + target_compile_definitions(mosquittopp_static PUBLIC "LIBMOSQUITTO_STATIC") + install(TARGETS mosquittopp_static ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") +endif (WITH_STATIC_LIBRARIES) + +install(FILES mosquittopp.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/Makefile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/Makefile new file mode 100644 index 0000000..8606da7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/Makefile @@ -0,0 +1,48 @@ +include ../../config.mk + +ifneq ($(UNAME),SunOS) + LIB_LDFLAGS:=$(LDFLAGS) -Wl,-soname,libmosquittopp.so.${SOVERSION} +endif + +.PHONY : clean install + +ALL_DEPS=libmosquittopp.so.${SOVERSION} + +ifeq ($(WITH_STATIC_LIBRARIES),yes) + ALL_DEPS+=libmosquittopp.a +endif + +all : ${ALL_DEPS} + +install : all + $(INSTALL) -d "${DESTDIR}${libdir}/" + $(INSTALL) ${STRIP_OPTS} libmosquittopp.so.${SOVERSION} "${DESTDIR}${libdir}/libmosquittopp.so.${SOVERSION}" + ln -sf libmosquittopp.so.${SOVERSION} "${DESTDIR}${libdir}/libmosquittopp.so" +ifeq ($(WITH_STATIC_LIBRARIES),yes) + $(INSTALL) libmosquittopp.a "${DESTDIR}${libdir}/libmosquittopp.a" + ${CROSS_COMPILE}${STRIP} -g --strip-unneeded "${DESTDIR}${libdir}/libmosquittopp.a" +endif + $(INSTALL) -d "${DESTDIR}${incdir}/" + $(INSTALL) mosquittopp.h "${DESTDIR}${incdir}/mosquittopp.h" + $(INSTALL) -d "${DESTDIR}${libdir}/pkgconfig/" + $(INSTALL) -m644 ../../libmosquittopp.pc.in "${DESTDIR}${libdir}/pkgconfig/libmosquittopp.pc" + sed -i -e "s#@CMAKE_INSTALL_PREFIX@#${prefix}#" -e "s#@VERSION@#${VERSION}#" "${DESTDIR}${libdir}/pkgconfig/libmosquittopp.pc" + +uninstall : + -rm -f "${DESTDIR}${libdir}/libmosquittopp.so.${SOVERSION}" + -rm -f "${DESTDIR}${libdir}/libmosquittopp.so" + -rm -f "${DESTDIR}${libdir}/libmosquittopp.a" + -rm -f "${DESTDIR}${incdir}/mosquittopp.h" + +clean : + -rm -f *.o libmosquittopp.so.${SOVERSION} libmosquittopp.a + +libmosquittopp.so.${SOVERSION} : mosquittopp.o + ${CROSS_COMPILE}$(CXX) -shared $(LIB_LDFLAGS) $< -o $@ ../libmosquitto.so.${SOVERSION} $(LIB_LIDADD) + +libmosquittopp.a : mosquittopp.o + ${CROSS_COMPILE}$(AR) cr $@ $^ + +mosquittopp.o : mosquittopp.cpp mosquittopp.h + ${CROSS_COMPILE}$(CXX) $(LIB_CPPFLAGS) $(LIB_CXXFLAGS) -c $< -o $@ + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/libmosquittopp.so.1 b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/libmosquittopp.so.1 new file mode 100755 index 0000000..49c9fee --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/libmosquittopp.so.1 Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/mosquittopp.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/mosquittopp.cpp new file mode 100644 index 0000000..e1c6cc5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/mosquittopp.cpp @@ -0,0 +1,381 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include <cstdlib> +#include <mosquitto.h> +#include <mosquittopp.h> + +#define UNUSED(A) (void)(A) + +namespace mosqpp { + +static void on_connect_wrapper(struct mosquitto *mosq, void *userdata, int rc) +{ + class mosquittopp *m = (class mosquittopp *)userdata; + + UNUSED(mosq); + + m->on_connect(rc); +} + +static void on_connect_with_flags_wrapper(struct mosquitto *mosq, void *userdata, int rc, int flags) +{ + class mosquittopp *m = (class mosquittopp *)userdata; + UNUSED(mosq); + m->on_connect_with_flags(rc, flags); +} + +static void on_disconnect_wrapper(struct mosquitto *mosq, void *userdata, int rc) +{ + class mosquittopp *m = (class mosquittopp *)userdata; + UNUSED(mosq); + m->on_disconnect(rc); +} + +static void on_publish_wrapper(struct mosquitto *mosq, void *userdata, int mid) +{ + class mosquittopp *m = (class mosquittopp *)userdata; + UNUSED(mosq); + m->on_publish(mid); +} + +static void on_message_wrapper(struct mosquitto *mosq, void *userdata, const struct mosquitto_message *message) +{ + class mosquittopp *m = (class mosquittopp *)userdata; + UNUSED(mosq); + m->on_message(message); +} + +static void on_subscribe_wrapper(struct mosquitto *mosq, void *userdata, int mid, int qos_count, const int *granted_qos) +{ + class mosquittopp *m = (class mosquittopp *)userdata; + UNUSED(mosq); + m->on_subscribe(mid, qos_count, granted_qos); +} + +static void on_unsubscribe_wrapper(struct mosquitto *mosq, void *userdata, int mid) +{ + class mosquittopp *m = (class mosquittopp *)userdata; + UNUSED(mosq); + m->on_unsubscribe(mid); +} + + +static void on_log_wrapper(struct mosquitto *mosq, void *userdata, int level, const char *str) +{ + class mosquittopp *m = (class mosquittopp *)userdata; + UNUSED(mosq); + m->on_log(level, str); +} + +int lib_version(int *major, int *minor, int *revision) +{ + if(major) *major = LIBMOSQUITTO_MAJOR; + if(minor) *minor = LIBMOSQUITTO_MINOR; + if(revision) *revision = LIBMOSQUITTO_REVISION; + return LIBMOSQUITTO_VERSION_NUMBER; +} + +int lib_init() +{ + return mosquitto_lib_init(); +} + +int lib_cleanup() +{ + return mosquitto_lib_cleanup(); +} + +const char* strerror(int mosq_errno) +{ + return mosquitto_strerror(mosq_errno); +} + +const char* connack_string(int connack_code) +{ + return mosquitto_connack_string(connack_code); +} + +int sub_topic_tokenise(const char *subtopic, char ***topics, int *count) +{ + return mosquitto_sub_topic_tokenise(subtopic, topics, count); +} + +int sub_topic_tokens_free(char ***topics, int count) +{ + return mosquitto_sub_topic_tokens_free(topics, count); +} + +int topic_matches_sub(const char *sub, const char *topic, bool *result) +{ + return mosquitto_topic_matches_sub(sub, topic, result); +} + +int validate_utf8(const char *str, int len) +{ + return mosquitto_validate_utf8(str, len); +} + +int subscribe_simple( + struct mosquitto_message **messages, + int msg_count, + bool retained, + const char *topic, + int qos, + const char *host, + int port, + const char *client_id, + int keepalive, + bool clean_session, + const char *username, + const char *password, + const struct libmosquitto_will *will, + const struct libmosquitto_tls *tls) +{ + return mosquitto_subscribe_simple( + messages, msg_count, retained, + topic, qos, + host, port, client_id, keepalive, clean_session, + username, password, + will, tls); +} + +mosqpp_EXPORT int subscribe_callback( + int (*callback)(struct mosquitto *, void *, const struct mosquitto_message *), + void *userdata, + const char *topic, + int qos, + const char *host, + int port, + const char *client_id, + int keepalive, + bool clean_session, + const char *username, + const char *password, + const struct libmosquitto_will *will, + const struct libmosquitto_tls *tls) +{ + return mosquitto_subscribe_callback( + callback, userdata, + topic, qos, + host, port, client_id, keepalive, clean_session, + username, password, + will, tls); +} + + +mosquittopp::mosquittopp(const char *id, bool clean_session) +{ + m_mosq = mosquitto_new(id, clean_session, this); + mosquitto_connect_callback_set(m_mosq, on_connect_wrapper); + mosquitto_connect_with_flags_callback_set(m_mosq, on_connect_with_flags_wrapper); + mosquitto_disconnect_callback_set(m_mosq, on_disconnect_wrapper); + mosquitto_publish_callback_set(m_mosq, on_publish_wrapper); + mosquitto_message_callback_set(m_mosq, on_message_wrapper); + mosquitto_subscribe_callback_set(m_mosq, on_subscribe_wrapper); + mosquitto_unsubscribe_callback_set(m_mosq, on_unsubscribe_wrapper); + mosquitto_log_callback_set(m_mosq, on_log_wrapper); +} + +mosquittopp::~mosquittopp() +{ + mosquitto_destroy(m_mosq); +} + +int mosquittopp::reinitialise(const char *id, bool clean_session) +{ + int rc; + rc = mosquitto_reinitialise(m_mosq, id, clean_session, this); + if(rc == MOSQ_ERR_SUCCESS){ + mosquitto_connect_callback_set(m_mosq, on_connect_wrapper); + mosquitto_connect_with_flags_callback_set(m_mosq, on_connect_with_flags_wrapper); + mosquitto_disconnect_callback_set(m_mosq, on_disconnect_wrapper); + mosquitto_publish_callback_set(m_mosq, on_publish_wrapper); + mosquitto_message_callback_set(m_mosq, on_message_wrapper); + mosquitto_subscribe_callback_set(m_mosq, on_subscribe_wrapper); + mosquitto_unsubscribe_callback_set(m_mosq, on_unsubscribe_wrapper); + mosquitto_log_callback_set(m_mosq, on_log_wrapper); + } + return rc; +} + +int mosquittopp::connect(const char *host, int port, int keepalive) +{ + return mosquitto_connect(m_mosq, host, port, keepalive); +} + +int mosquittopp::connect(const char *host, int port, int keepalive, const char *bind_address) +{ + return mosquitto_connect_bind(m_mosq, host, port, keepalive, bind_address); +} + +int mosquittopp::connect_async(const char *host, int port, int keepalive) +{ + return mosquitto_connect_async(m_mosq, host, port, keepalive); +} + +int mosquittopp::connect_async(const char *host, int port, int keepalive, const char *bind_address) +{ + return mosquitto_connect_bind_async(m_mosq, host, port, keepalive, bind_address); +} + +int mosquittopp::reconnect() +{ + return mosquitto_reconnect(m_mosq); +} + +int mosquittopp::reconnect_async() +{ + return mosquitto_reconnect_async(m_mosq); +} + +int mosquittopp::disconnect() +{ + return mosquitto_disconnect(m_mosq); +} + +int mosquittopp::socket() +{ + return mosquitto_socket(m_mosq); +} + +int mosquittopp::will_set(const char *topic, int payloadlen, const void *payload, int qos, bool retain) +{ + return mosquitto_will_set(m_mosq, topic, payloadlen, payload, qos, retain); +} + +int mosquittopp::will_clear() +{ + return mosquitto_will_clear(m_mosq); +} + +int mosquittopp::username_pw_set(const char *username, const char *password) +{ + return mosquitto_username_pw_set(m_mosq, username, password); +} + +int mosquittopp::publish(int *mid, const char *topic, int payloadlen, const void *payload, int qos, bool retain) +{ + return mosquitto_publish(m_mosq, mid, topic, payloadlen, payload, qos, retain); +} + +void mosquittopp::reconnect_delay_set(unsigned int reconnect_delay, unsigned int reconnect_delay_max, bool reconnect_exponential_backoff) +{ + mosquitto_reconnect_delay_set(m_mosq, reconnect_delay, reconnect_delay_max, reconnect_exponential_backoff); +} + +int mosquittopp::max_inflight_messages_set(unsigned int max_inflight_messages) +{ + return mosquitto_max_inflight_messages_set(m_mosq, max_inflight_messages); +} + +void mosquittopp::message_retry_set(unsigned int message_retry) +{ + mosquitto_message_retry_set(m_mosq, message_retry); +} + +int mosquittopp::subscribe(int *mid, const char *sub, int qos) +{ + return mosquitto_subscribe(m_mosq, mid, sub, qos); +} + +int mosquittopp::unsubscribe(int *mid, const char *sub) +{ + return mosquitto_unsubscribe(m_mosq, mid, sub); +} + +int mosquittopp::loop(int timeout, int max_packets) +{ + return mosquitto_loop(m_mosq, timeout, max_packets); +} + +int mosquittopp::loop_misc() +{ + return mosquitto_loop_misc(m_mosq); +} + +int mosquittopp::loop_read(int max_packets) +{ + return mosquitto_loop_read(m_mosq, max_packets); +} + +int mosquittopp::loop_write(int max_packets) +{ + return mosquitto_loop_write(m_mosq, max_packets); +} + +int mosquittopp::loop_forever(int timeout, int max_packets) +{ + return mosquitto_loop_forever(m_mosq, timeout, max_packets); +} + +int mosquittopp::loop_start() +{ + return mosquitto_loop_start(m_mosq); +} + +int mosquittopp::loop_stop(bool force) +{ + return mosquitto_loop_stop(m_mosq, force); +} + +bool mosquittopp::want_write() +{ + return mosquitto_want_write(m_mosq); +} + +int mosquittopp::opts_set(enum mosq_opt_t option, void *value) +{ + return mosquitto_opts_set(m_mosq, option, value); +} + +int mosquittopp::threaded_set(bool threaded) +{ + return mosquitto_threaded_set(m_mosq, threaded); +} + +void mosquittopp::user_data_set(void *userdata) +{ + mosquitto_user_data_set(m_mosq, userdata); +} + +int mosquittopp::socks5_set(const char *host, int port, const char *username, const char *password) +{ + return mosquitto_socks5_set(m_mosq, host, port, username, password); +} + + +int mosquittopp::tls_set(const char *cafile, const char *capath, const char *certfile, const char *keyfile, int (*pw_callback)(char *buf, int size, int rwflag, void *userdata)) +{ + return mosquitto_tls_set(m_mosq, cafile, capath, certfile, keyfile, pw_callback); +} + +int mosquittopp::tls_opts_set(int cert_reqs, const char *tls_version, const char *ciphers) +{ + return mosquitto_tls_opts_set(m_mosq, cert_reqs, tls_version, ciphers); +} + +int mosquittopp::tls_insecure_set(bool value) +{ + return mosquitto_tls_insecure_set(m_mosq, value); +} + +int mosquittopp::tls_psk_set(const char *psk, const char *identity, const char *ciphers) +{ + return mosquitto_tls_psk_set(m_mosq, psk, identity, ciphers); +} + +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/mosquittopp.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/mosquittopp.h new file mode 100644 index 0000000..8d2e98b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/mosquittopp.h @@ -0,0 +1,146 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef MOSQUITTOPP_H +#define MOSQUITTOPP_H + +#ifdef _WIN32 +# ifdef mosquittopp_EXPORTS +# define mosqpp_EXPORT __declspec(dllexport) +# else +# define mosqpp_EXPORT __declspec(dllimport) +# endif +#else +# define mosqpp_EXPORT +#endif + +#if defined(__GNUC__) || defined(__clang__) +# define DEPRECATED __attribute__ ((deprecated)) +#else +# define DEPRECATED +#endif + +#include <cstdlib> +#include <mosquitto.h> +#include <time.h> + +namespace mosqpp { + + +mosqpp_EXPORT const char * DEPRECATED strerror(int mosq_errno); +mosqpp_EXPORT const char * DEPRECATED connack_string(int connack_code); +mosqpp_EXPORT int DEPRECATED sub_topic_tokenise(const char *subtopic, char ***topics, int *count); +mosqpp_EXPORT int DEPRECATED sub_topic_tokens_free(char ***topics, int count); +mosqpp_EXPORT int DEPRECATED lib_version(int *major, int *minor, int *revision); +mosqpp_EXPORT int DEPRECATED lib_init(); +mosqpp_EXPORT int DEPRECATED lib_cleanup(); +mosqpp_EXPORT int DEPRECATED topic_matches_sub(const char *sub, const char *topic, bool *result); +mosqpp_EXPORT int DEPRECATED validate_utf8(const char *str, int len); +mosqpp_EXPORT int DEPRECATED subscribe_simple( + struct mosquitto_message **messages, + int msg_count, + bool retained, + const char *topic, + int qos=0, + const char *host="localhost", + int port=1883, + const char *client_id=NULL, + int keepalive=60, + bool clean_session=true, + const char *username=NULL, + const char *password=NULL, + const struct libmosquitto_will *will=NULL, + const struct libmosquitto_tls *tls=NULL); + +mosqpp_EXPORT int DEPRECATED subscribe_callback( + int (*callback)(struct mosquitto *, void *, const struct mosquitto_message *), + void *userdata, + const char *topic, + int qos=0, + bool retained=true, + const char *host="localhost", + int port=1883, + const char *client_id=NULL, + int keepalive=60, + bool clean_session=true, + const char *username=NULL, + const char *password=NULL, + const struct libmosquitto_will *will=NULL, + const struct libmosquitto_tls *tls=NULL); + +/* + * Class: mosquittopp + * + * A mosquitto client class. This is a C++ wrapper class for the mosquitto C + * library. Please see mosquitto.h for details of the functions. + */ +class mosqpp_EXPORT DEPRECATED mosquittopp { + private: + struct mosquitto *m_mosq; + public: + DEPRECATED mosquittopp(const char *id=NULL, bool clean_session=true); + virtual ~mosquittopp(); + + int DEPRECATED reinitialise(const char *id, bool clean_session); + int DEPRECATED socket(); + int DEPRECATED will_set(const char *topic, int payloadlen=0, const void *payload=NULL, int qos=0, bool retain=false); + int DEPRECATED will_clear(); + int DEPRECATED username_pw_set(const char *username, const char *password=NULL); + int DEPRECATED connect(const char *host, int port=1883, int keepalive=60); + int DEPRECATED connect_async(const char *host, int port=1883, int keepalive=60); + int DEPRECATED connect(const char *host, int port, int keepalive, const char *bind_address); + int DEPRECATED connect_async(const char *host, int port, int keepalive, const char *bind_address); + int DEPRECATED reconnect(); + int DEPRECATED reconnect_async(); + int DEPRECATED disconnect(); + int DEPRECATED publish(int *mid, const char *topic, int payloadlen=0, const void *payload=NULL, int qos=0, bool retain=false); + int DEPRECATED subscribe(int *mid, const char *sub, int qos=0); + int DEPRECATED unsubscribe(int *mid, const char *sub); + void DEPRECATED reconnect_delay_set(unsigned int reconnect_delay, unsigned int reconnect_delay_max, bool reconnect_exponential_backoff); + int DEPRECATED max_inflight_messages_set(unsigned int max_inflight_messages); + void DEPRECATED message_retry_set(unsigned int message_retry); + void DEPRECATED user_data_set(void *userdata); + int DEPRECATED tls_set(const char *cafile, const char *capath=NULL, const char *certfile=NULL, const char *keyfile=NULL, int (*pw_callback)(char *buf, int size, int rwflag, void *userdata)=NULL); + int DEPRECATED tls_opts_set(int cert_reqs, const char *tls_version=NULL, const char *ciphers=NULL); + int DEPRECATED tls_insecure_set(bool value); + int DEPRECATED tls_psk_set(const char *psk, const char *identity, const char *ciphers=NULL); + int DEPRECATED opts_set(enum mosq_opt_t option, void *value); + + int DEPRECATED loop(int timeout=-1, int max_packets=1); + int DEPRECATED loop_misc(); + int DEPRECATED loop_read(int max_packets=1); + int DEPRECATED loop_write(int max_packets=1); + int DEPRECATED loop_forever(int timeout=-1, int max_packets=1); + int DEPRECATED loop_start(); + int DEPRECATED loop_stop(bool force=false); + bool DEPRECATED want_write(); + int DEPRECATED threaded_set(bool threaded=true); + int DEPRECATED socks5_set(const char *host, int port=1080, const char *username=NULL, const char *password=NULL); + + // names in the functions commented to prevent unused parameter warning + virtual void on_connect(int /*rc*/) {return;} + virtual void on_connect_with_flags(int /*rc*/, int /*flags*/) {return;} + virtual void on_disconnect(int /*rc*/) {return;} + virtual void on_publish(int /*mid*/) {return;} + virtual void on_message(const struct mosquitto_message * /*message*/) {return;} + virtual void on_subscribe(int /*mid*/, int /*qos_count*/, const int * /*granted_qos*/) {return;} + virtual void on_unsubscribe(int /*mid*/) {return;} + virtual void on_log(int /*level*/, const char * /*str*/) {return;} + virtual void on_error() {return;} +}; + +} +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/mosquittopp.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/mosquittopp.o new file mode 100644 index 0000000..e3288a6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/cpp/mosquittopp.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/dummypthread.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/dummypthread.h new file mode 100644 index 0000000..4207f3d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/dummypthread.h @@ -0,0 +1,13 @@ +#ifndef DUMMYPTHREAD_H +#define DUMMYPTHREAD_H + +#define pthread_create(A, B, C, D) +#define pthread_join(A, B) +#define pthread_cancel(A) + +#define pthread_mutex_init(A, B) +#define pthread_mutex_destroy(A) +#define pthread_mutex_lock(A) +#define pthread_mutex_unlock(A) + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_auth.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_auth.c new file mode 100644 index 0000000..5b84d3d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_auth.c @@ -0,0 +1,49 @@ +/* +Copyright (c) 2018 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <stdio.h> +#include <string.h> + +#include "logging_mosq.h" +#include "mosquitto_internal.h" +#include "mqtt_protocol.h" +#include "packet_mosq.h" +#include "property_mosq.h" + + +int handle__auth(struct mosquitto *mosq) +{ + int rc = 0; + uint8_t reason_code; + mosquitto_property *properties = NULL; + + if(!mosq) return MOSQ_ERR_INVAL; + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received AUTH", mosq->id); + + if(mosq->protocol != mosq_p_mqtt5){ + return MOSQ_ERR_PROTOCOL; + } + + if(packet__read_byte(&mosq->in_packet, &reason_code)) return 1; + + rc = property__read_all(CMD_AUTH, &mosq->in_packet, &properties); + if(rc) return rc; + mosquitto_property_free_all(&properties); /* FIXME - TEMPORARY UNTIL PROPERTIES PROCESSED */ + + return MOSQ_ERR_SUCCESS; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_auth.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_auth.o new file mode 100644 index 0000000..b32bb67 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_auth.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_connack.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_connack.c new file mode 100644 index 0000000..19b6a66 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_connack.c @@ -0,0 +1,110 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> + +#include "mosquitto.h" +#include "logging_mosq.h" +#include "memory_mosq.h" +#include "messages_mosq.h" +#include "mqtt_protocol.h" +#include "net_mosq.h" +#include "packet_mosq.h" +#include "property_mosq.h" +#include "read_handle.h" + +int handle__connack(struct mosquitto *mosq) +{ + uint8_t connect_flags; + uint8_t reason_code; + int rc; + mosquitto_property *properties = NULL; + char *clientid = NULL; + + assert(mosq); + rc = packet__read_byte(&mosq->in_packet, &connect_flags); + if(rc) return rc; + rc = packet__read_byte(&mosq->in_packet, &reason_code); + if(rc) return rc; + + if(mosq->protocol == mosq_p_mqtt5){ + rc = property__read_all(CMD_CONNACK, &mosq->in_packet, &properties); + if(rc) return rc; + } + + mosquitto_property_read_string(properties, MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER, &clientid, false); + if(clientid){ + if(mosq->id){ + /* We've been sent a client identifier but already have one. This + * shouldn't happen. */ + free(clientid); + mosquitto_property_free_all(&properties); + return MOSQ_ERR_PROTOCOL; + }else{ + mosq->id = clientid; + clientid = NULL; + } + } + + mosquitto_property_read_byte(properties, MQTT_PROP_MAXIMUM_QOS, &mosq->maximum_qos, false); + mosquitto_property_read_int16(properties, MQTT_PROP_RECEIVE_MAXIMUM, &mosq->msgs_out.inflight_maximum, false); + mosquitto_property_read_int16(properties, MQTT_PROP_SERVER_KEEP_ALIVE, &mosq->keepalive, false); + mosquitto_property_read_int32(properties, MQTT_PROP_MAXIMUM_PACKET_SIZE, &mosq->maximum_packet_size, false); + + mosq->msgs_out.inflight_quota = mosq->msgs_out.inflight_maximum; + + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received CONNACK (%d)", mosq->id, reason_code); + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_connect){ + mosq->in_callback = true; + mosq->on_connect(mosq, mosq->userdata, reason_code); + mosq->in_callback = false; + } + if(mosq->on_connect_with_flags){ + mosq->in_callback = true; + mosq->on_connect_with_flags(mosq, mosq->userdata, reason_code, connect_flags); + mosq->in_callback = false; + } + if(mosq->on_connect_v5){ + mosq->in_callback = true; + mosq->on_connect_v5(mosq, mosq->userdata, reason_code, connect_flags, properties); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + mosquitto_property_free_all(&properties); + + switch(reason_code){ + case 0: + pthread_mutex_lock(&mosq->state_mutex); + if(mosq->state != mosq_cs_disconnecting){ + mosq->state = mosq_cs_connected; + } + pthread_mutex_unlock(&mosq->state_mutex); + message__retry_check(mosq); + return MOSQ_ERR_SUCCESS; + case 1: + case 2: + case 3: + case 4: + case 5: + return MOSQ_ERR_CONN_REFUSED; + default: + return MOSQ_ERR_PROTOCOL; + } +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_connack.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_connack.o new file mode 100644 index 0000000..d2703f7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_connack.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_disconnect.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_disconnect.c new file mode 100644 index 0000000..0ec1c8b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_disconnect.c @@ -0,0 +1,62 @@ +/* +Copyright (c) 2009-2018 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <stdio.h> +#include <string.h> + +#include "logging_mosq.h" +#include "mqtt_protocol.h" +#include "memory_mosq.h" +#include "net_mosq.h" +#include "packet_mosq.h" +#include "property_mosq.h" +#include "send_mosq.h" +#include "util_mosq.h" + +int handle__disconnect(struct mosquitto *mosq) +{ + int rc; + uint8_t reason_code; + mosquitto_property *properties = NULL; + + if(!mosq){ + return MOSQ_ERR_INVAL; + } + + if(mosq->protocol != mosq_p_mqtt5){ + return MOSQ_ERR_PROTOCOL; + } + + rc = packet__read_byte(&mosq->in_packet, &reason_code); + if(rc) return rc; + + if(mosq->in_packet.remaining_length > 2){ + rc = property__read_all(CMD_DISCONNECT, &mosq->in_packet, &properties); + if(rc) return rc; + mosquitto_property_free_all(&properties); + } + + log__printf(mosq, MOSQ_LOG_DEBUG, "Received DISCONNECT (%d)", reason_code); + + do_client_disconnect(mosq, reason_code, properties); + + mosquitto_property_free_all(&properties); + + return MOSQ_ERR_SUCCESS; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_disconnect.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_disconnect.o new file mode 100644 index 0000000..3cbbbd9 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_disconnect.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_ping.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_ping.c new file mode 100644 index 0000000..56d89a3 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_ping.c @@ -0,0 +1,70 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <stdio.h> +#include <string.h> + +#ifdef WITH_BROKER +# include "mosquitto_broker_internal.h" +#endif + +#include "mosquitto.h" +#include "logging_mosq.h" +#include "memory_mosq.h" +#include "messages_mosq.h" +#include "mqtt_protocol.h" +#include "net_mosq.h" +#include "packet_mosq.h" +#include "read_handle.h" +#include "send_mosq.h" +#include "util_mosq.h" + +int handle__pingreq(struct mosquitto *mosq) +{ + assert(mosq); + + if(mosq->state != mosq_cs_connected){ + return MOSQ_ERR_PROTOCOL; + } + +#ifdef WITH_BROKER + log__printf(NULL, MOSQ_LOG_DEBUG, "Received PINGREQ from %s", mosq->id); +#else + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received PINGREQ", mosq->id); +#endif + return send__pingresp(mosq); +} + +int handle__pingresp(struct mosquitto *mosq) +{ + assert(mosq); + + if(mosq->state != mosq_cs_connected){ + return MOSQ_ERR_PROTOCOL; + } + + mosq->ping_t = 0; /* No longer waiting for a PINGRESP. */ +#ifdef WITH_BROKER + log__printf(NULL, MOSQ_LOG_DEBUG, "Received PINGRESP from %s", mosq->id); +#else + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received PINGRESP", mosq->id); +#endif + return MOSQ_ERR_SUCCESS; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_ping.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_ping.o new file mode 100644 index 0000000..a6c20da --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_ping.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubackcomp.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubackcomp.c new file mode 100644 index 0000000..6792149 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubackcomp.c @@ -0,0 +1,118 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <stdio.h> +#include <string.h> + +#ifdef WITH_BROKER +# include "mosquitto_broker_internal.h" +#endif + +#include "mosquitto.h" +#include "logging_mosq.h" +#include "memory_mosq.h" +#include "messages_mosq.h" +#include "mqtt_protocol.h" +#include "net_mosq.h" +#include "packet_mosq.h" +#include "read_handle.h" +#include "send_mosq.h" +#include "util_mosq.h" + + +#ifdef WITH_BROKER +int handle__pubackcomp(struct mosquitto_db *db, struct mosquitto *mosq, const char *type) +#else +int handle__pubackcomp(struct mosquitto *mosq, const char *type) +#endif +{ + uint8_t reason_code = 0; + uint16_t mid; + int rc; + mosquitto_property *properties = NULL; + int qos; + + assert(mosq); + + if(mosq->state != mosq_cs_connected){ + return MOSQ_ERR_PROTOCOL; + } + + pthread_mutex_lock(&mosq->msgs_out.mutex); + util__increment_send_quota(mosq); + pthread_mutex_unlock(&mosq->msgs_out.mutex); + + rc = packet__read_uint16(&mosq->in_packet, &mid); + if(rc) return rc; + qos = type[3] == 'A'?1:2; /* pubAck or pubComp */ + if(mid == 0) return MOSQ_ERR_PROTOCOL; + + if(mosq->protocol == mosq_p_mqtt5 && mosq->in_packet.remaining_length > 2){ + rc = packet__read_byte(&mosq->in_packet, &reason_code); + if(rc) return rc; + + if(mosq->in_packet.remaining_length > 3){ + rc = property__read_all(CMD_PUBACK, &mosq->in_packet, &properties); + if(rc) return rc; + } + } + +#ifdef WITH_BROKER + log__printf(NULL, MOSQ_LOG_DEBUG, "Received %s from %s (Mid: %d, RC:%d)", type, mosq->id, mid, reason_code); + + /* Immediately free, we don't do anything with Reason String or User Property at the moment */ + mosquitto_property_free_all(&properties); + + rc = db__message_delete_outgoing(db, mosq, mid, mosq_ms_wait_for_pubcomp, qos); + if(rc == MOSQ_ERR_NOT_FOUND){ + log__printf(mosq, MOSQ_LOG_WARNING, "Warning: Received %s from %s for an unknown packet identifier %d.", type, mosq->id, mid); + return MOSQ_ERR_SUCCESS; + }else{ + return rc; + } +#else + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received %s (Mid: %d, RC:%d)", mosq->id, type, mid, reason_code); + + rc = message__delete(mosq, mid, mosq_md_out, qos); + if(rc){ + return rc; + }else{ + /* Only inform the client the message has been sent once. */ + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_publish){ + mosq->in_callback = true; + mosq->on_publish(mosq, mosq->userdata, mid); + mosq->in_callback = false; + } + if(mosq->on_publish_v5){ + mosq->in_callback = true; + mosq->on_publish_v5(mosq, mosq->userdata, mid, reason_code, properties); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + mosquitto_property_free_all(&properties); + } + pthread_mutex_lock(&mosq->msgs_out.mutex); + message__release_to_inflight(mosq, mosq_md_out); + pthread_mutex_unlock(&mosq->msgs_out.mutex); + + return MOSQ_ERR_SUCCESS; +#endif +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubackcomp.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubackcomp.o new file mode 100644 index 0000000..548a9b6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubackcomp.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_publish.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_publish.c new file mode 100644 index 0000000..8c93e3c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_publish.c @@ -0,0 +1,167 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <string.h> + +#include "mosquitto.h" +#include "mosquitto_internal.h" +#include "logging_mosq.h" +#include "memory_mosq.h" +#include "mqtt_protocol.h" +#include "messages_mosq.h" +#include "packet_mosq.h" +#include "property_mosq.h" +#include "send_mosq.h" +#include "time_mosq.h" +#include "util_mosq.h" + + +int handle__publish(struct mosquitto *mosq) +{ + uint8_t header; + struct mosquitto_message_all *message; + int rc = 0; + uint16_t mid; + int slen; + mosquitto_property *properties = NULL; + + assert(mosq); + + if(mosq->state != mosq_cs_connected){ + return MOSQ_ERR_PROTOCOL; + } + + message = mosquitto__calloc(1, sizeof(struct mosquitto_message_all)); + if(!message) return MOSQ_ERR_NOMEM; + + header = mosq->in_packet.command; + + message->dup = (header & 0x08)>>3; + message->msg.qos = (header & 0x06)>>1; + message->msg.retain = (header & 0x01); + + rc = packet__read_string(&mosq->in_packet, &message->msg.topic, &slen); + if(rc){ + message__cleanup(&message); + return rc; + } + if(!slen){ + message__cleanup(&message); + return MOSQ_ERR_PROTOCOL; + } + + if(message->msg.qos > 0){ + if(mosq->protocol == mosq_p_mqtt5){ + if(mosq->msgs_in.inflight_quota == 0){ + message__cleanup(&message); + /* FIXME - should send a DISCONNECT here */ + return MOSQ_ERR_PROTOCOL; + } + } + + rc = packet__read_uint16(&mosq->in_packet, &mid); + if(rc){ + message__cleanup(&message); + return rc; + } + if(mid == 0){ + message__cleanup(&message); + return MOSQ_ERR_PROTOCOL; + } + message->msg.mid = (int)mid; + } + + if(mosq->protocol == mosq_p_mqtt5){ + rc = property__read_all(CMD_PUBLISH, &mosq->in_packet, &properties); + if(rc) return rc; + } + + message->msg.payloadlen = mosq->in_packet.remaining_length - mosq->in_packet.pos; + if(message->msg.payloadlen){ + message->msg.payload = mosquitto__calloc(message->msg.payloadlen+1, sizeof(uint8_t)); + if(!message->msg.payload){ + message__cleanup(&message); + mosquitto_property_free_all(&properties); + return MOSQ_ERR_NOMEM; + } + rc = packet__read_bytes(&mosq->in_packet, message->msg.payload, message->msg.payloadlen); + if(rc){ + message__cleanup(&message); + mosquitto_property_free_all(&properties); + return rc; + } + } + log__printf(mosq, MOSQ_LOG_DEBUG, + "Client %s received PUBLISH (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", + mosq->id, message->dup, message->msg.qos, message->msg.retain, + message->msg.mid, message->msg.topic, + (long)message->msg.payloadlen); + + message->timestamp = mosquitto_time(); + switch(message->msg.qos){ + case 0: + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_message){ + mosq->in_callback = true; + mosq->on_message(mosq, mosq->userdata, &message->msg); + mosq->in_callback = false; + } + if(mosq->on_message_v5){ + mosq->in_callback = true; + mosq->on_message_v5(mosq, mosq->userdata, &message->msg, properties); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + message__cleanup(&message); + mosquitto_property_free_all(&properties); + return MOSQ_ERR_SUCCESS; + case 1: + util__decrement_receive_quota(mosq); + rc = send__puback(mosq, message->msg.mid, 0); + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_message){ + mosq->in_callback = true; + mosq->on_message(mosq, mosq->userdata, &message->msg); + mosq->in_callback = false; + } + if(mosq->on_message_v5){ + mosq->in_callback = true; + mosq->on_message_v5(mosq, mosq->userdata, &message->msg, properties); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + message__cleanup(&message); + mosquitto_property_free_all(&properties); + return rc; + case 2: + util__decrement_receive_quota(mosq); + rc = send__pubrec(mosq, message->msg.mid, 0); + pthread_mutex_lock(&mosq->msgs_in.mutex); + message->state = mosq_ms_wait_for_pubrel; + message__queue(mosq, message, mosq_md_in); + pthread_mutex_unlock(&mosq->msgs_in.mutex); + mosquitto_property_free_all(&properties); + return rc; + default: + message__cleanup(&message); + mosquitto_property_free_all(&properties); + return MOSQ_ERR_PROTOCOL; + } +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_publish.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_publish.o new file mode 100644 index 0000000..90b873f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_publish.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubrec.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubrec.c new file mode 100644 index 0000000..81f1b49 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubrec.c @@ -0,0 +1,110 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <stdio.h> +#include <string.h> + +#ifdef WITH_BROKER +# include "mosquitto_broker_internal.h" +#endif + +#include "mosquitto.h" +#include "logging_mosq.h" +#include "memory_mosq.h" +#include "messages_mosq.h" +#include "mqtt_protocol.h" +#include "net_mosq.h" +#include "packet_mosq.h" +#include "read_handle.h" +#include "send_mosq.h" +#include "util_mosq.h" + +int handle__pubrec(struct mosquitto_db *db, struct mosquitto *mosq) +{ + uint8_t reason_code = 0; + uint16_t mid; + int rc; + mosquitto_property *properties = NULL; + + assert(mosq); + + if(mosq->state != mosq_cs_connected){ + return MOSQ_ERR_PROTOCOL; + } + + rc = packet__read_uint16(&mosq->in_packet, &mid); + if(rc) return rc; + if(mid == 0) return MOSQ_ERR_PROTOCOL; + + if(mosq->protocol == mosq_p_mqtt5 && mosq->in_packet.remaining_length > 2){ + rc = packet__read_byte(&mosq->in_packet, &reason_code); + if(rc) return rc; + + if(mosq->in_packet.remaining_length > 3){ + rc = property__read_all(CMD_PUBREC, &mosq->in_packet, &properties); + if(rc) return rc; + /* Immediately free, we don't do anything with Reason String or User Property at the moment */ + mosquitto_property_free_all(&properties); + } + } + +#ifdef WITH_BROKER + log__printf(NULL, MOSQ_LOG_DEBUG, "Received PUBREC from %s (Mid: %d)", mosq->id, mid); + + if(reason_code < 0x80){ + rc = db__message_update_outgoing(mosq, mid, mosq_ms_wait_for_pubcomp, 2); + }else{ + return db__message_delete_outgoing(db, mosq, mid, mosq_ms_wait_for_pubrec, 2); + } +#else + UNUSED(db); + + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received PUBREC (Mid: %d)", mosq->id, mid); + + if(reason_code < 0x80 || mosq->protocol != mosq_p_mqtt5){ + rc = message__out_update(mosq, mid, mosq_ms_wait_for_pubcomp, 2); + }else{ + if(!message__delete(mosq, mid, mosq_md_out, 2)){ + /* Only inform the client the message has been sent once. */ + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_publish_v5){ + mosq->in_callback = true; + mosq->on_publish_v5(mosq, mosq->userdata, mid, reason_code, properties); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + } + util__increment_send_quota(mosq); + pthread_mutex_lock(&mosq->msgs_out.mutex); + message__release_to_inflight(mosq, mosq_md_out); + pthread_mutex_unlock(&mosq->msgs_out.mutex); + return MOSQ_ERR_SUCCESS; + } +#endif + if(rc == MOSQ_ERR_NOT_FOUND){ + log__printf(mosq, MOSQ_LOG_WARNING, "Warning: Received PUBREC from %s for an unknown packet identifier %d.", mosq->id, mid); + }else if(rc != MOSQ_ERR_SUCCESS){ + return rc; + } + rc = send__pubrel(mosq, mid); + if(rc) return rc; + + return MOSQ_ERR_SUCCESS; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubrec.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubrec.o new file mode 100644 index 0000000..966e1d5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubrec.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubrel.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubrel.c new file mode 100644 index 0000000..d4a9065 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubrel.c @@ -0,0 +1,126 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <stdio.h> +#include <string.h> + +#ifdef WITH_BROKER +# include "mosquitto_broker_internal.h" +#endif + +#include "mosquitto.h" +#include "logging_mosq.h" +#include "memory_mosq.h" +#include "messages_mosq.h" +#include "mqtt_protocol.h" +#include "net_mosq.h" +#include "packet_mosq.h" +#include "read_handle.h" +#include "send_mosq.h" +#include "util_mosq.h" + + +int handle__pubrel(struct mosquitto_db *db, struct mosquitto *mosq) +{ + uint8_t reason_code; + uint16_t mid; +#ifndef WITH_BROKER + struct mosquitto_message_all *message = NULL; +#endif + int rc; + mosquitto_property *properties = NULL; + + assert(mosq); + + if(mosq->state != mosq_cs_connected){ + return MOSQ_ERR_PROTOCOL; + } + + if(mosq->protocol != mosq_p_mqtt31){ + if((mosq->in_packet.command&0x0F) != 0x02){ + return MOSQ_ERR_PROTOCOL; + } + } + rc = packet__read_uint16(&mosq->in_packet, &mid); + if(rc) return rc; + if(mid == 0) return MOSQ_ERR_PROTOCOL; + + if(mosq->protocol == mosq_p_mqtt5 && mosq->in_packet.remaining_length > 2){ + rc = packet__read_byte(&mosq->in_packet, &reason_code); + if(rc) return rc; + + if(mosq->in_packet.remaining_length > 3){ + rc = property__read_all(CMD_PUBREL, &mosq->in_packet, &properties); + if(rc) return rc; + } + } + +#ifdef WITH_BROKER + log__printf(NULL, MOSQ_LOG_DEBUG, "Received PUBREL from %s (Mid: %d)", mosq->id, mid); + + /* Immediately free, we don't do anything with Reason String or User Property at the moment */ + mosquitto_property_free_all(&properties); + + rc = db__message_release_incoming(db, mosq, mid); + if(rc == MOSQ_ERR_PROTOCOL){ + return rc; + }else if(rc != MOSQ_ERR_SUCCESS){ + /* Message not found. Still send a PUBCOMP anyway because this could be + * due to a repeated PUBREL after a client has reconnected. */ + } + + rc = send__pubcomp(mosq, mid); + if(rc) return rc; +#else + UNUSED(db); + + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received PUBREL (Mid: %d)", mosq->id, mid); + + rc = send__pubcomp(mosq, mid); + if(rc){ + message__remove(mosq, mid, mosq_md_in, &message, 2); + return rc; + } + + rc = message__remove(mosq, mid, mosq_md_in, &message, 2); + if(rc){ + return rc; + }else{ + /* Only pass the message on if we have removed it from the queue - this + * prevents multiple callbacks for the same message. */ + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_message){ + mosq->in_callback = true; + mosq->on_message(mosq, mosq->userdata, &message->msg); + mosq->in_callback = false; + } + if(mosq->on_message_v5){ + mosq->in_callback = true; + mosq->on_message_v5(mosq, mosq->userdata, &message->msg, properties); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + mosquitto_property_free_all(&properties); + message__cleanup(&message); + } +#endif + + return MOSQ_ERR_SUCCESS; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubrel.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubrel.o new file mode 100644 index 0000000..1fa6f37 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_pubrel.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_suback.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_suback.c new file mode 100644 index 0000000..dadebcd --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_suback.c @@ -0,0 +1,98 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> + +#ifdef WITH_BROKER +# include "mosquitto_broker_internal.h" +#endif + +#include "mosquitto.h" +#include "mosquitto_internal.h" +#include "logging_mosq.h" +#include "memory_mosq.h" +#include "mqtt_protocol.h" +#include "packet_mosq.h" +#include "property_mosq.h" + + +int handle__suback(struct mosquitto *mosq) +{ + uint16_t mid; + uint8_t qos; + int *granted_qos; + int qos_count; + int i = 0; + int rc; + mosquitto_property *properties = NULL; + + assert(mosq); + + if(mosq->state != mosq_cs_connected){ + return MOSQ_ERR_PROTOCOL; + } + +#ifdef WITH_BROKER + log__printf(NULL, MOSQ_LOG_DEBUG, "Received SUBACK from %s", mosq->id); +#else + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received SUBACK", mosq->id); +#endif + rc = packet__read_uint16(&mosq->in_packet, &mid); + if(rc) return rc; + if(mid == 0) return MOSQ_ERR_PROTOCOL; + + if(mosq->protocol == mosq_p_mqtt5){ + rc = property__read_all(CMD_SUBACK, &mosq->in_packet, &properties); + if(rc) return rc; + } + + qos_count = mosq->in_packet.remaining_length - mosq->in_packet.pos; + granted_qos = mosquitto__malloc(qos_count*sizeof(int)); + if(!granted_qos) return MOSQ_ERR_NOMEM; + while(mosq->in_packet.pos < mosq->in_packet.remaining_length){ + rc = packet__read_byte(&mosq->in_packet, &qos); + if(rc){ + mosquitto__free(granted_qos); + return rc; + } + granted_qos[i] = (int)qos; + i++; + } +#ifdef WITH_BROKER + /* Immediately free, we don't do anything with Reason String or User Property at the moment */ + mosquitto_property_free_all(&properties); +#else + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_subscribe){ + mosq->in_callback = true; + mosq->on_subscribe(mosq, mosq->userdata, mid, qos_count, granted_qos); + mosq->in_callback = false; + } + if(mosq->on_subscribe_v5){ + mosq->in_callback = true; + mosq->on_subscribe_v5(mosq, mosq->userdata, mid, qos_count, granted_qos, properties); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + mosquitto_property_free_all(&properties); +#endif + mosquitto__free(granted_qos); + + return MOSQ_ERR_SUCCESS; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_suback.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_suback.o new file mode 100644 index 0000000..169df8c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_suback.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_unsuback.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_unsuback.c new file mode 100644 index 0000000..3ced0e5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_unsuback.c @@ -0,0 +1,87 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <stdio.h> +#include <string.h> + +#ifdef WITH_BROKER +# include "mosquitto_broker_internal.h" +#endif + +#include "mosquitto.h" +#include "logging_mosq.h" +#include "memory_mosq.h" +#include "messages_mosq.h" +#include "mqtt_protocol.h" +#include "net_mosq.h" +#include "packet_mosq.h" +#include "property_mosq.h" +#include "read_handle.h" +#include "send_mosq.h" +#include "util_mosq.h" + + +int handle__unsuback(struct mosquitto *mosq) +{ + uint16_t mid; + int rc; + mosquitto_property *properties = NULL; + + assert(mosq); + + if(mosq->state != mosq_cs_connected){ + return MOSQ_ERR_PROTOCOL; + } + +#ifdef WITH_BROKER + log__printf(NULL, MOSQ_LOG_DEBUG, "Received UNSUBACK from %s", mosq->id); +#else + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received UNSUBACK", mosq->id); +#endif + rc = packet__read_uint16(&mosq->in_packet, &mid); + if(rc) return rc; + if(mid == 0) return MOSQ_ERR_PROTOCOL; + + if(mosq->protocol == mosq_p_mqtt5){ + rc = property__read_all(CMD_UNSUBACK, &mosq->in_packet, &properties); + if(rc) return rc; + } + +#ifdef WITH_BROKER + /* Immediately free, we don't do anything with Reason String or User Property at the moment */ + mosquitto_property_free_all(&properties); +#else + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_unsubscribe){ + mosq->in_callback = true; + mosq->on_unsubscribe(mosq, mosq->userdata, mid); + mosq->in_callback = false; + } + if(mosq->on_unsubscribe_v5){ + mosq->in_callback = true; + mosq->on_unsubscribe_v5(mosq, mosq->userdata, mid, properties); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + mosquitto_property_free_all(&properties); +#endif + + return MOSQ_ERR_SUCCESS; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_unsuback.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_unsuback.o new file mode 100644 index 0000000..34f89c4 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/handle_unsuback.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/helpers.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/helpers.c new file mode 100644 index 0000000..0f60501 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/helpers.c @@ -0,0 +1,227 @@ +/* +Copyright (c) 2016-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <errno.h> +#include <stdbool.h> + +#include "mosquitto.h" +#include "mosquitto_internal.h" + +struct userdata__callback { + const char *topic; + int (*callback)(struct mosquitto *, void *, const struct mosquitto_message *); + void *userdata; + int qos; + int rc; +}; + +struct userdata__simple { + struct mosquitto_message *messages; + int max_msg_count; + int message_count; + bool want_retained; +}; + + +static void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + struct userdata__callback *userdata = obj; + + UNUSED(rc); + + mosquitto_subscribe(mosq, NULL, userdata->topic, userdata->qos); +} + + +static void on_message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message) +{ + int rc; + struct userdata__callback *userdata = obj; + + rc = userdata->callback(mosq, userdata->userdata, message); + if(rc){ + mosquitto_disconnect(mosq); + } +} + +static int on_message_simple(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message) +{ + struct userdata__simple *userdata = obj; + int rc; + + if(userdata->max_msg_count == 0){ + return 0; + } + + /* Don't process stale retained messages if 'want_retained' was false */ + if(!userdata->want_retained && message->retain){ + return 0; + } + + userdata->max_msg_count--; + + rc = mosquitto_message_copy(&userdata->messages[userdata->message_count], message); + if(rc){ + return rc; + } + userdata->message_count++; + if(userdata->max_msg_count == 0){ + mosquitto_disconnect(mosq); + } + return 0; +} + + +libmosq_EXPORT int mosquitto_subscribe_simple( + struct mosquitto_message **messages, + int msg_count, + bool want_retained, + const char *topic, + int qos, + const char *host, + int port, + const char *client_id, + int keepalive, + bool clean_session, + const char *username, + const char *password, + const struct libmosquitto_will *will, + const struct libmosquitto_tls *tls) +{ + struct userdata__simple userdata; + int rc; + int i; + + if(!topic || msg_count < 1 || !messages){ + return MOSQ_ERR_INVAL; + } + + *messages = NULL; + + userdata.messages = calloc(sizeof(struct mosquitto_message), msg_count); + if(!userdata.messages){ + return MOSQ_ERR_NOMEM; + } + userdata.message_count = 0; + userdata.max_msg_count = msg_count; + userdata.want_retained = want_retained; + + rc = mosquitto_subscribe_callback( + on_message_simple, &userdata, + topic, qos, + host, port, + client_id, keepalive, clean_session, + username, password, + will, tls); + + if(!rc && userdata.max_msg_count == 0){ + *messages = userdata.messages; + return MOSQ_ERR_SUCCESS; + }else{ + for(i=0; i<msg_count; i++){ + mosquitto_message_free_contents(&userdata.messages[i]); + } + free(userdata.messages); + userdata.messages = NULL; + return rc; + } +} + + +libmosq_EXPORT int mosquitto_subscribe_callback( + int (*callback)(struct mosquitto *, void *, const struct mosquitto_message *), + void *userdata, + const char *topic, + int qos, + const char *host, + int port, + const char *client_id, + int keepalive, + bool clean_session, + const char *username, + const char *password, + const struct libmosquitto_will *will, + const struct libmosquitto_tls *tls) +{ + struct mosquitto *mosq; + struct userdata__callback cb_userdata; + int rc; + + if(!callback || !topic){ + return MOSQ_ERR_INVAL; + } + + cb_userdata.topic = topic; + cb_userdata.qos = qos; + cb_userdata.rc = 0; + cb_userdata.userdata = userdata; + cb_userdata.callback = callback; + + mosq = mosquitto_new(client_id, clean_session, &cb_userdata); + if(!mosq){ + return MOSQ_ERR_NOMEM; + } + + if(will){ + rc = mosquitto_will_set(mosq, will->topic, will->payloadlen, will->payload, will->qos, will->retain); + if(rc){ + mosquitto_destroy(mosq); + return rc; + } + } + if(username){ + rc = mosquitto_username_pw_set(mosq, username, password); + if(rc){ + mosquitto_destroy(mosq); + return rc; + } + } + if(tls){ + rc = mosquitto_tls_set(mosq, tls->cafile, tls->capath, tls->certfile, tls->keyfile, tls->pw_callback); + if(rc){ + mosquitto_destroy(mosq); + return rc; + } + rc = mosquitto_tls_opts_set(mosq, tls->cert_reqs, tls->tls_version, tls->ciphers); + if(rc){ + mosquitto_destroy(mosq); + return rc; + } + } + + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_message_callback_set(mosq, on_message_callback); + + rc = mosquitto_connect(mosq, host, port, keepalive); + if(rc){ + mosquitto_destroy(mosq); + return rc; + } + rc = mosquitto_loop_forever(mosq, -1, 1); + mosquitto_destroy(mosq); + if(cb_userdata.rc){ + rc = cb_userdata.rc; + } + //if(!rc && cb_userdata.max_msg_count == 0){ + //return MOSQ_ERR_SUCCESS; + //}else{ + //return rc; + //} + return MOSQ_ERR_SUCCESS; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/helpers.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/helpers.o new file mode 100644 index 0000000..b8a57a0 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/helpers.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/libmosquitto.so.1 b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/libmosquitto.so.1 new file mode 100755 index 0000000..fc04714 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/libmosquitto.so.1 Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/linker.version b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/linker.version new file mode 100644 index 0000000..017d5a5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/linker.version @@ -0,0 +1,134 @@ +/* Linker version script - currently used here primarily to control which + * symbols are exported. + */ + +MOSQ_1.0 { + global: + mosquitto_lib_version; + mosquitto_lib_init; + mosquitto_lib_cleanup; + mosquitto_new; + mosquitto_destroy; + mosquitto_reinitialise; + mosquitto_will_set; + mosquitto_will_clear; + mosquitto_username_pw_set; + mosquitto_connect; + mosquitto_connect_async; + mosquitto_reconnect; + mosquitto_disconnect; + mosquitto_publish; + mosquitto_subscribe; + mosquitto_unsubscribe; + mosquitto_message_copy; + mosquitto_message_free; + mosquitto_loop; + mosquitto_socket; + mosquitto_loop_start; + mosquitto_loop_stop; + mosquitto_loop_read; + mosquitto_loop_write; + mosquitto_loop_misc; + mosquitto_connect_callback_set; + mosquitto_disconnect_callback_set; + mosquitto_publish_callback_set; + mosquitto_message_callback_set; + mosquitto_subscribe_callback_set; + mosquitto_unsubscribe_callback_set; + mosquitto_log_callback_set; + mosquitto_message_retry_set; + mosquitto_want_write; + mosquitto_user_data_set; + mosquitto_strerror; + mosquitto_connack_string; + mosquitto_tls_set; + mosquitto_tls_opts_set; + mosquitto_tls_psk_set; + mosquitto_sub_topic_tokenise; + mosquitto_sub_topic_tokens_free; + mosquitto_topic_matches_sub; + local: *; +}; + +MOSQ_1.1 { + global: + mosquitto_loop_forever; +} MOSQ_1.0; + +MOSQ_1.2 { + global: + mosquitto_connect_bind; + mosquitto_connect_bind_async; + mosquitto_max_inflight_messages_set; + mosquitto_reconnect_delay_set; + mosquitto_reconnect_async; + mosquitto_tls_insecure_set; +} MOSQ_1.1; + +MOSQ_1.3 { + global: + mosquitto_connect_srv; +} MOSQ_1.2; + +MOSQ_1.4 { + global: + mosquitto_threaded_set; + mosquitto_opts_set; + mosquitto_pub_topic_check; + mosquitto_sub_topic_check; + mosquitto_socks5_set; +} MOSQ_1.3; + +MOSQ_1.5 { + global: + mosquitto_subscribe_simple; + mosquitto_subscribe_callback; + mosquitto_message_free_contents; + mosquitto_validate_utf8; + mosquitto_userdata; + mosquitto_pub_topic_check2; + mosquitto_sub_topic_check2; + mosquitto_topic_matches_sub2; + mosquitto_connect_with_flags_callback_set; +} MOSQ_1.4; + +MOSQ_1.6 { + global: + mosquitto_connect_bind_v5; + mosquitto_connect_v5_callback_set; + mosquitto_disconnect_v5; + mosquitto_disconnect_v5_callback_set; + mosquitto_int_option; + mosquitto_message_v5_callback_set; + mosquitto_property_add_binary; + mosquitto_property_add_byte; + mosquitto_property_add_int16; + mosquitto_property_add_int32; + mosquitto_property_add_string; + mosquitto_property_add_string_pair; + mosquitto_property_add_varint; + mosquitto_property_check_all; + mosquitto_property_check_command; + mosquitto_property_free_all; + mosquitto_property_read_binary; + mosquitto_property_read_byte; + mosquitto_property_read_int16; + mosquitto_property_read_int32; + mosquitto_property_read_string; + mosquitto_property_read_string_pair; + mosquitto_property_read_varint; + mosquitto_publish_v5; + mosquitto_publish_v5_callback_set; + mosquitto_reason_string; + mosquitto_string_option; + mosquitto_string_to_command; + mosquitto_string_to_property_info; + mosquitto_subscribe_multiple; + mosquitto_subscribe_v5; + mosquitto_subscribe_v5_callback_set; + mosquitto_unsubscribe_multiple; + mosquitto_unsubscribe_v5; + mosquitto_unsubscribe_v5_callback_set; + mosquitto_void_option; + mosquitto_will_set_v5; +} MOSQ_1.5; diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/logging_mosq.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/logging_mosq.c new file mode 100644 index 0000000..eab6356 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/logging_mosq.c @@ -0,0 +1,59 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <stdarg.h> +#include <stdio.h> +#include <string.h> + +#include "mosquitto_internal.h" +#include "mosquitto.h" +#include "memory_mosq.h" + +int log__printf(struct mosquitto *mosq, int priority, const char *fmt, ...) +{ + va_list va; + char *s; + int len; + + assert(mosq); + assert(fmt); + + pthread_mutex_lock(&mosq->log_callback_mutex); + if(mosq->on_log){ + len = strlen(fmt) + 500; + s = mosquitto__malloc(len*sizeof(char)); + if(!s){ + pthread_mutex_unlock(&mosq->log_callback_mutex); + return MOSQ_ERR_NOMEM; + } + + va_start(va, fmt); + vsnprintf(s, len, fmt, va); + va_end(va); + s[len-1] = '\0'; /* Ensure string is null terminated. */ + + mosq->on_log(mosq, mosq->userdata, priority, s); + + mosquitto__free(s); + } + pthread_mutex_unlock(&mosq->log_callback_mutex); + + return MOSQ_ERR_SUCCESS; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/logging_mosq.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/logging_mosq.h new file mode 100644 index 0000000..c3cc29d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/logging_mosq.h @@ -0,0 +1,23 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ +#ifndef LOGGING_MOSQ_H +#define LOGGING_MOSQ_H + +#include "mosquitto.h" + +int log__printf(struct mosquitto *mosq, int priority, const char *fmt, ...); + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/logging_mosq.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/logging_mosq.o new file mode 100644 index 0000000..9d8bc95 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/logging_mosq.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/loop.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/loop.c new file mode 100644 index 0000000..2342c94 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/loop.c @@ -0,0 +1,390 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <errno.h> +#ifndef WIN32 +#include <sys/select.h> +#include <time.h> +#endif + +#include "mosquitto.h" +#include "mosquitto_internal.h" +#include "net_mosq.h" +#include "packet_mosq.h" +#include "socks_mosq.h" +#include "tls_mosq.h" +#include "util_mosq.h" + +#if !defined(WIN32) && !defined(__SYMBIAN32__) +#define HAVE_PSELECT +#endif + +int mosquitto_loop(struct mosquitto *mosq, int timeout, int max_packets) +{ +#ifdef HAVE_PSELECT + struct timespec local_timeout; +#else + struct timeval local_timeout; +#endif + fd_set readfds, writefds; + int fdcount; + int rc; + char pairbuf; + int maxfd = 0; + time_t now; + + if(!mosq || max_packets < 1) return MOSQ_ERR_INVAL; +#ifndef WIN32 + if(mosq->sock >= FD_SETSIZE || mosq->sockpairR >= FD_SETSIZE){ + return MOSQ_ERR_INVAL; + } +#endif + + FD_ZERO(&readfds); + FD_ZERO(&writefds); + if(mosq->sock != INVALID_SOCKET){ + maxfd = mosq->sock; + FD_SET(mosq->sock, &readfds); + pthread_mutex_lock(&mosq->current_out_packet_mutex); + pthread_mutex_lock(&mosq->out_packet_mutex); + if(mosq->out_packet || mosq->current_out_packet){ + FD_SET(mosq->sock, &writefds); + } +#ifdef WITH_TLS + if(mosq->ssl){ + if(mosq->want_write){ + FD_SET(mosq->sock, &writefds); + }else if(mosq->want_connect){ + /* Remove possible FD_SET from above, we don't want to check + * for writing if we are still connecting, unless want_write is + * definitely set. The presence of outgoing packets does not + * matter yet. */ + FD_CLR(mosq->sock, &writefds); + } + } +#endif + pthread_mutex_unlock(&mosq->out_packet_mutex); + pthread_mutex_unlock(&mosq->current_out_packet_mutex); + }else{ +#ifdef WITH_SRV + if(mosq->achan){ + pthread_mutex_lock(&mosq->state_mutex); + if(mosq->state == mosq_cs_connect_srv){ + rc = ares_fds(mosq->achan, &readfds, &writefds); + if(rc > maxfd){ + maxfd = rc; + } + }else{ + pthread_mutex_unlock(&mosq->state_mutex); + return MOSQ_ERR_NO_CONN; + } + pthread_mutex_unlock(&mosq->state_mutex); + } +#else + return MOSQ_ERR_NO_CONN; +#endif + } + if(mosq->sockpairR != INVALID_SOCKET){ + /* sockpairR is used to break out of select() before the timeout, on a + * call to publish() etc. */ + FD_SET(mosq->sockpairR, &readfds); + if(mosq->sockpairR > maxfd){ + maxfd = mosq->sockpairR; + } + } + + if(timeout < 0){ + timeout = 1000; + } + + now = mosquitto_time(); + if(mosq->next_msg_out && now + timeout/1000 > mosq->next_msg_out){ + timeout = (mosq->next_msg_out - now)*1000; + } + + if(timeout < 0){ + /* There has been a delay somewhere which means we should have already + * sent a message. */ + timeout = 0; + } + + local_timeout.tv_sec = timeout/1000; +#ifdef HAVE_PSELECT + local_timeout.tv_nsec = (timeout-local_timeout.tv_sec*1000)*1e6; +#else + local_timeout.tv_usec = (timeout-local_timeout.tv_sec*1000)*1000; +#endif + +#ifdef HAVE_PSELECT + fdcount = pselect(maxfd+1, &readfds, &writefds, NULL, &local_timeout, NULL); +#else + fdcount = select(maxfd+1, &readfds, &writefds, NULL, &local_timeout); +#endif + if(fdcount == -1){ +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(errno == EINTR){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_ERRNO; + } + }else{ + if(mosq->sock != INVALID_SOCKET){ + if(FD_ISSET(mosq->sock, &readfds)){ + rc = mosquitto_loop_read(mosq, max_packets); + if(rc || mosq->sock == INVALID_SOCKET){ + return rc; + } + } + if(mosq->sockpairR != INVALID_SOCKET && FD_ISSET(mosq->sockpairR, &readfds)){ +#ifndef WIN32 + if(read(mosq->sockpairR, &pairbuf, 1) == 0){ + } +#else + recv(mosq->sockpairR, &pairbuf, 1, 0); +#endif + /* Fake write possible, to stimulate output write even though + * we didn't ask for it, because at that point the publish or + * other command wasn't present. */ + if(mosq->sock != INVALID_SOCKET) + FD_SET(mosq->sock, &writefds); + } + if(mosq->sock != INVALID_SOCKET && FD_ISSET(mosq->sock, &writefds)){ +#ifdef WITH_TLS + if(mosq->want_connect){ + rc = net__socket_connect_tls(mosq); + if(rc) return rc; + }else +#endif + { + rc = mosquitto_loop_write(mosq, max_packets); + if(rc || mosq->sock == INVALID_SOCKET){ + return rc; + } + } + } + } +#ifdef WITH_SRV + if(mosq->achan){ + ares_process(mosq->achan, &readfds, &writefds); + } +#endif + } + return mosquitto_loop_misc(mosq); +} + + +int mosquitto_loop_forever(struct mosquitto *mosq, int timeout, int max_packets) +{ + int run = 1; + int rc; + unsigned int reconnects = 0; + unsigned long reconnect_delay; +#ifndef WIN32 + struct timespec req, rem; +#endif + + if(!mosq) return MOSQ_ERR_INVAL; + + if(mosq->state == mosq_cs_connect_async){ + mosquitto_reconnect(mosq); + } + + while(run){ + do{ + rc = mosquitto_loop(mosq, timeout, max_packets); + if (reconnects !=0 && rc == MOSQ_ERR_SUCCESS){ + reconnects = 0; + } + }while(run && rc == MOSQ_ERR_SUCCESS); + /* Quit after fatal errors. */ + switch(rc){ + case MOSQ_ERR_NOMEM: + case MOSQ_ERR_PROTOCOL: + case MOSQ_ERR_INVAL: + case MOSQ_ERR_NOT_FOUND: + case MOSQ_ERR_TLS: + case MOSQ_ERR_PAYLOAD_SIZE: + case MOSQ_ERR_NOT_SUPPORTED: + case MOSQ_ERR_AUTH: + case MOSQ_ERR_ACL_DENIED: + case MOSQ_ERR_UNKNOWN: + case MOSQ_ERR_EAI: + case MOSQ_ERR_PROXY: + return rc; + case MOSQ_ERR_ERRNO: + break; + } + if(errno == EPROTO){ + return rc; + } + do{ + rc = MOSQ_ERR_SUCCESS; + pthread_mutex_lock(&mosq->state_mutex); + if(mosq->state == mosq_cs_disconnecting){ + run = 0; + pthread_mutex_unlock(&mosq->state_mutex); + }else{ + pthread_mutex_unlock(&mosq->state_mutex); + + if(mosq->reconnect_delay_max > mosq->reconnect_delay){ + if(mosq->reconnect_exponential_backoff){ + reconnect_delay = mosq->reconnect_delay*(reconnects+1)*(reconnects+1); + }else{ + reconnect_delay = mosq->reconnect_delay*(reconnects+1); + } + }else{ + reconnect_delay = mosq->reconnect_delay; + } + + if(reconnect_delay > mosq->reconnect_delay_max){ + reconnect_delay = mosq->reconnect_delay_max; + }else{ + reconnects++; + } + +#ifdef WIN32 + Sleep(reconnect_delay*1000); +#else + req.tv_sec = reconnect_delay; + req.tv_nsec = 0; + while(nanosleep(&req, &rem) == -1 && errno == EINTR){ + req = rem; + } +#endif + + pthread_mutex_lock(&mosq->state_mutex); + if(mosq->state == mosq_cs_disconnecting){ + run = 0; + pthread_mutex_unlock(&mosq->state_mutex); + }else{ + pthread_mutex_unlock(&mosq->state_mutex); + rc = mosquitto_reconnect(mosq); + } + } + }while(run && rc != MOSQ_ERR_SUCCESS); + } + return rc; +} + + +int mosquitto_loop_misc(struct mosquitto *mosq) +{ + if(!mosq) return MOSQ_ERR_INVAL; + if(mosq->sock == INVALID_SOCKET) return MOSQ_ERR_NO_CONN; + + return mosquitto__check_keepalive(mosq); +} + + +static int mosquitto__loop_rc_handle(struct mosquitto *mosq, int rc) +{ + if(rc){ + net__socket_close(mosq); + pthread_mutex_lock(&mosq->state_mutex); + if(mosq->state == mosq_cs_disconnecting){ + rc = MOSQ_ERR_SUCCESS; + } + pthread_mutex_unlock(&mosq->state_mutex); + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_disconnect){ + mosq->in_callback = true; + mosq->on_disconnect(mosq, mosq->userdata, rc); + mosq->in_callback = false; + } + if(mosq->on_disconnect_v5){ + mosq->in_callback = true; + mosq->on_disconnect_v5(mosq, mosq->userdata, rc, NULL); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + return rc; + } + return rc; +} + + +int mosquitto_loop_read(struct mosquitto *mosq, int max_packets) +{ + int rc; + int i; + if(max_packets < 1) return MOSQ_ERR_INVAL; + +#ifdef WITH_TLS + if(mosq->want_connect){ + return net__socket_connect_tls(mosq); + } +#endif + + pthread_mutex_lock(&mosq->msgs_out.mutex); + max_packets = mosq->msgs_out.queue_len; + pthread_mutex_unlock(&mosq->msgs_out.mutex); + + pthread_mutex_lock(&mosq->msgs_in.mutex); + max_packets += mosq->msgs_in.queue_len; + pthread_mutex_unlock(&mosq->msgs_in.mutex); + + if(max_packets < 1) max_packets = 1; + /* Queue len here tells us how many messages are awaiting processing and + * have QoS > 0. We should try to deal with that many in this loop in order + * to keep up. */ + for(i=0; i<max_packets || SSL_DATA_PENDING(mosq); i++){ +#ifdef WITH_SOCKS + if(mosq->socks5_host){ + rc = socks5__read(mosq); + }else +#endif + { + rc = packet__read(mosq); + } + if(rc || errno == EAGAIN || errno == COMPAT_EWOULDBLOCK){ + return mosquitto__loop_rc_handle(mosq, rc); + } + } + return rc; +} + + +int mosquitto_loop_write(struct mosquitto *mosq, int max_packets) +{ + int rc; + int i; + if(max_packets < 1) return MOSQ_ERR_INVAL; + + pthread_mutex_lock(&mosq->msgs_out.mutex); + max_packets = mosq->msgs_out.queue_len; + pthread_mutex_unlock(&mosq->msgs_out.mutex); + + pthread_mutex_lock(&mosq->msgs_in.mutex); + max_packets += mosq->msgs_in.queue_len; + pthread_mutex_unlock(&mosq->msgs_in.mutex); + + if(max_packets < 1) max_packets = 1; + /* Queue len here tells us how many messages are awaiting processing and + * have QoS > 0. We should try to deal with that many in this loop in order + * to keep up. */ + for(i=0; i<max_packets; i++){ + rc = packet__write(mosq); + if(rc || errno == EAGAIN || errno == COMPAT_EWOULDBLOCK){ + return mosquitto__loop_rc_handle(mosq, rc); + } + } + return rc; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/loop.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/loop.o new file mode 100644 index 0000000..f018f31 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/loop.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/memory_mosq.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/memory_mosq.c new file mode 100644 index 0000000..a9b01e5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/memory_mosq.c @@ -0,0 +1,160 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <stdlib.h> +#include <string.h> + +#include "memory_mosq.h" + +#ifdef REAL_WITH_MEMORY_TRACKING +# if defined(__APPLE__) +# include <malloc/malloc.h> +# define malloc_usable_size malloc_size +# elif defined(__FreeBSD__) +# include <malloc_np.h> +# else +# include <malloc.h> +# endif +#endif + +#ifdef REAL_WITH_MEMORY_TRACKING +static unsigned long memcount = 0; +static unsigned long max_memcount = 0; +#endif + +#ifdef WITH_BROKER +static size_t mem_limit = 0; +void memory__set_limit(size_t lim) +{ + mem_limit = lim; +} +#endif + +void *mosquitto__calloc(size_t nmemb, size_t size) +{ +#ifdef REAL_WITH_MEMORY_TRACKING + if(mem_limit && memcount + size > mem_limit){ + return NULL; + } +#endif + void *mem = calloc(nmemb, size); + +#ifdef REAL_WITH_MEMORY_TRACKING + if(mem){ + memcount += malloc_usable_size(mem); + if(memcount > max_memcount){ + max_memcount = memcount; + } + } +#endif + + return mem; +} + +void mosquitto__free(void *mem) +{ +#ifdef REAL_WITH_MEMORY_TRACKING + if(!mem){ + return; + } + memcount -= malloc_usable_size(mem); +#endif + free(mem); +} + +void *mosquitto__malloc(size_t size) +{ +#ifdef REAL_WITH_MEMORY_TRACKING + if(mem_limit && memcount + size > mem_limit){ + return NULL; + } +#endif + void *mem = malloc(size); + +#ifdef REAL_WITH_MEMORY_TRACKING + if(mem){ + memcount += malloc_usable_size(mem); + if(memcount > max_memcount){ + max_memcount = memcount; + } + } +#endif + + return mem; +} + +#ifdef REAL_WITH_MEMORY_TRACKING +unsigned long mosquitto__memory_used(void) +{ + return memcount; +} + +unsigned long mosquitto__max_memory_used(void) +{ + return max_memcount; +} +#endif + +void *mosquitto__realloc(void *ptr, size_t size) +{ +#ifdef REAL_WITH_MEMORY_TRACKING + if(mem_limit && memcount + size > mem_limit){ + return NULL; + } +#endif + void *mem; +#ifdef REAL_WITH_MEMORY_TRACKING + if(ptr){ + memcount -= malloc_usable_size(ptr); + } +#endif + mem = realloc(ptr, size); + +#ifdef REAL_WITH_MEMORY_TRACKING + if(mem){ + memcount += malloc_usable_size(mem); + if(memcount > max_memcount){ + max_memcount = memcount; + } + } +#endif + + return mem; +} + +char *mosquitto__strdup(const char *s) +{ +#ifdef REAL_WITH_MEMORY_TRACKING + if(mem_limit && memcount + strlen(s) > mem_limit){ + return NULL; + } +#endif + char *str = strdup(s); + +#ifdef REAL_WITH_MEMORY_TRACKING + if(str){ + memcount += malloc_usable_size(str); + if(memcount > max_memcount){ + max_memcount = memcount; + } + } +#endif + + return str; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/memory_mosq.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/memory_mosq.h new file mode 100644 index 0000000..63386a2 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/memory_mosq.h @@ -0,0 +1,41 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef MEMORY_MOSQ_H +#define MEMORY_MOSQ_H + +#include <stdio.h> +#include <sys/types.h> + +#if defined(WITH_MEMORY_TRACKING) && defined(WITH_BROKER) && defined(__GLIBC__) +#define REAL_WITH_MEMORY_TRACKING +#endif + +void *mosquitto__calloc(size_t nmemb, size_t size); +void mosquitto__free(void *mem); +void *mosquitto__malloc(size_t size); +#ifdef REAL_WITH_MEMORY_TRACKING +unsigned long mosquitto__memory_used(void); +unsigned long mosquitto__max_memory_used(void); +#endif +void *mosquitto__realloc(void *ptr, size_t size); +char *mosquitto__strdup(const char *s); + +#ifdef WITH_BROKER +void memory__set_limit(size_t lim); +#endif + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/memory_mosq.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/memory_mosq.o new file mode 100644 index 0000000..5ff03de --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/memory_mosq.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/messages_mosq.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/messages_mosq.c new file mode 100644 index 0000000..bf77f5e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/messages_mosq.c @@ -0,0 +1,348 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <stdlib.h> +#include <string.h> +#include <utlist.h> + +#include "mosquitto_internal.h" +#include "mosquitto.h" +#include "memory_mosq.h" +#include "messages_mosq.h" +#include "send_mosq.h" +#include "time_mosq.h" +#include "util_mosq.h" + +void message__cleanup(struct mosquitto_message_all **message) +{ + struct mosquitto_message_all *msg; + + if(!message || !*message) return; + + msg = *message; + + mosquitto__free(msg->msg.topic); + mosquitto__free(msg->msg.payload); + mosquitto__free(msg); +} + +void message__cleanup_all(struct mosquitto *mosq) +{ + struct mosquitto_message_all *tail, *tmp; + + assert(mosq); + + DL_FOREACH_SAFE(mosq->msgs_in.inflight, tail, tmp){ + DL_DELETE(mosq->msgs_in.inflight, tail); + message__cleanup(&tail); + } + DL_FOREACH_SAFE(mosq->msgs_out.inflight, tail, tmp){ + DL_DELETE(mosq->msgs_out.inflight, tail); + message__cleanup(&tail); + } +} + +int mosquitto_message_copy(struct mosquitto_message *dst, const struct mosquitto_message *src) +{ + if(!dst || !src) return MOSQ_ERR_INVAL; + + dst->mid = src->mid; + dst->topic = mosquitto__strdup(src->topic); + if(!dst->topic) return MOSQ_ERR_NOMEM; + dst->qos = src->qos; + dst->retain = src->retain; + if(src->payloadlen){ + dst->payload = mosquitto__calloc(src->payloadlen+1, sizeof(uint8_t)); + if(!dst->payload){ + mosquitto__free(dst->topic); + return MOSQ_ERR_NOMEM; + } + memcpy(dst->payload, src->payload, src->payloadlen); + dst->payloadlen = src->payloadlen; + }else{ + dst->payloadlen = 0; + dst->payload = NULL; + } + return MOSQ_ERR_SUCCESS; +} + +int message__delete(struct mosquitto *mosq, uint16_t mid, enum mosquitto_msg_direction dir, int qos) +{ + struct mosquitto_message_all *message; + int rc; + assert(mosq); + + rc = message__remove(mosq, mid, dir, &message, qos); + if(rc == MOSQ_ERR_SUCCESS){ + message__cleanup(&message); + } + return rc; +} + +void mosquitto_message_free(struct mosquitto_message **message) +{ + struct mosquitto_message *msg; + + if(!message || !*message) return; + + msg = *message; + + mosquitto__free(msg->topic); + mosquitto__free(msg->payload); + mosquitto__free(msg); +} + +void mosquitto_message_free_contents(struct mosquitto_message *message) +{ + if(!message) return; + + mosquitto__free(message->topic); + mosquitto__free(message->payload); +} + +int message__queue(struct mosquitto *mosq, struct mosquitto_message_all *message, enum mosquitto_msg_direction dir) +{ + /* mosq->*_message_mutex should be locked before entering this function */ + assert(mosq); + assert(message); + assert(message->msg.qos != 0); + + if(dir == mosq_md_out){ + DL_APPEND(mosq->msgs_out.inflight, message); + mosq->msgs_out.queue_len++; + }else{ + DL_APPEND(mosq->msgs_in.inflight, message); + mosq->msgs_in.queue_len++; + } + + return message__release_to_inflight(mosq, dir); +} + +void message__reconnect_reset(struct mosquitto *mosq) +{ + struct mosquitto_message_all *message, *tmp; + assert(mosq); + + pthread_mutex_lock(&mosq->msgs_in.mutex); + mosq->msgs_in.inflight_quota = mosq->msgs_in.inflight_maximum; + mosq->msgs_in.queue_len = 0; + DL_FOREACH_SAFE(mosq->msgs_in.inflight, message, tmp){ + mosq->msgs_in.queue_len++; + message->timestamp = 0; + if(message->msg.qos != 2){ + DL_DELETE(mosq->msgs_in.inflight, message); + message__cleanup(&message); + }else{ + /* Message state can be preserved here because it should match + * whatever the client has got. */ + util__decrement_receive_quota(mosq); + } + } + pthread_mutex_unlock(&mosq->msgs_in.mutex); + + + pthread_mutex_lock(&mosq->msgs_out.mutex); + mosq->msgs_out.inflight_quota = mosq->msgs_out.inflight_maximum; + mosq->msgs_out.queue_len = 0; + DL_FOREACH_SAFE(mosq->msgs_out.inflight, message, tmp){ + mosq->msgs_out.queue_len++; + + message->timestamp = 0; + if(mosq->msgs_out.inflight_quota != 0){ + util__decrement_send_quota(mosq); + if(message->msg.qos == 1){ + message->state = mosq_ms_publish_qos1; + }else if(message->msg.qos == 2){ + if(message->state == mosq_ms_wait_for_pubrec){ + message->state = mosq_ms_publish_qos2; + }else if(message->state == mosq_ms_wait_for_pubcomp){ + message->state = mosq_ms_resend_pubrel; + } + /* Should be able to preserve state. */ + } + }else{ + message->state = mosq_ms_invalid; + } + } + pthread_mutex_unlock(&mosq->msgs_out.mutex); +} + + +int message__release_to_inflight(struct mosquitto *mosq, enum mosquitto_msg_direction dir) +{ + /* mosq->*_message_mutex should be locked before entering this function */ + struct mosquitto_message_all *cur, *tmp; + int rc = MOSQ_ERR_SUCCESS; + + if(dir == mosq_md_out){ + DL_FOREACH_SAFE(mosq->msgs_out.inflight, cur, tmp){ + if(mosq->msgs_out.inflight_quota > 0){ + if(cur->msg.qos > 0 && cur->state == mosq_ms_invalid){ + if(cur->msg.qos == 1){ + cur->state = mosq_ms_wait_for_puback; + }else if(cur->msg.qos == 2){ + cur->state = mosq_ms_wait_for_pubrec; + } + rc = send__publish(mosq, cur->msg.mid, cur->msg.topic, cur->msg.payloadlen, cur->msg.payload, cur->msg.qos, cur->msg.retain, cur->dup, NULL, NULL, 0); + if(rc){ + return rc; + } + util__decrement_send_quota(mosq); + } + }else{ + return MOSQ_ERR_SUCCESS; + } + } + } + + return rc; +} + + +int message__remove(struct mosquitto *mosq, uint16_t mid, enum mosquitto_msg_direction dir, struct mosquitto_message_all **message, int qos) +{ + struct mosquitto_message_all *cur, *tmp; + bool found = false; + assert(mosq); + assert(message); + + if(dir == mosq_md_out){ + pthread_mutex_lock(&mosq->msgs_out.mutex); + + DL_FOREACH_SAFE(mosq->msgs_out.inflight, cur, tmp){ + if(found == false && cur->msg.mid == mid){ + if(cur->msg.qos != qos){ + pthread_mutex_unlock(&mosq->msgs_out.mutex); + return MOSQ_ERR_PROTOCOL; + } + DL_DELETE(mosq->msgs_out.inflight, cur); + + *message = cur; + mosq->msgs_out.queue_len--; + found = true; + break; + } + } + pthread_mutex_unlock(&mosq->msgs_out.mutex); + if(found){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_NOT_FOUND; + } + }else{ + pthread_mutex_lock(&mosq->msgs_in.mutex); + DL_FOREACH_SAFE(mosq->msgs_in.inflight, cur, tmp){ + if(cur->msg.mid == mid){ + if(cur->msg.qos != qos){ + pthread_mutex_unlock(&mosq->msgs_in.mutex); + return MOSQ_ERR_PROTOCOL; + } + DL_DELETE(mosq->msgs_in.inflight, cur); + *message = cur; + mosq->msgs_in.queue_len--; + found = true; + break; + } + } + + pthread_mutex_unlock(&mosq->msgs_in.mutex); + if(found){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_NOT_FOUND; + } + } +} + +void message__retry_check(struct mosquitto *mosq) +{ + struct mosquitto_message_all *msg; + time_t now = mosquitto_time(); + assert(mosq); + +#ifdef WITH_THREADING + pthread_mutex_lock(&mosq->msgs_out.mutex); +#endif + + DL_FOREACH(mosq->msgs_out.inflight, msg){ + switch(msg->state){ + case mosq_ms_publish_qos1: + case mosq_ms_publish_qos2: + msg->timestamp = now; + msg->dup = true; + send__publish(mosq, msg->msg.mid, msg->msg.topic, msg->msg.payloadlen, msg->msg.payload, msg->msg.qos, msg->msg.retain, msg->dup, NULL, NULL, 0); + break; + case mosq_ms_wait_for_pubrel: + msg->timestamp = now; + msg->dup = true; + send__pubrec(mosq, msg->msg.mid, 0); + break; + case mosq_ms_resend_pubrel: + case mosq_ms_wait_for_pubcomp: + msg->timestamp = now; + msg->dup = true; + send__pubrel(mosq, msg->msg.mid); + break; + default: + break; + } + } +#ifdef WITH_THREADING + pthread_mutex_unlock(&mosq->msgs_out.mutex); +#endif +} + + +void mosquitto_message_retry_set(struct mosquitto *mosq, unsigned int message_retry) +{ + UNUSED(mosq); + UNUSED(message_retry); +} + +int message__out_update(struct mosquitto *mosq, uint16_t mid, enum mosquitto_msg_state state, int qos) +{ + struct mosquitto_message_all *message, *tmp; + assert(mosq); + + pthread_mutex_lock(&mosq->msgs_out.mutex); + DL_FOREACH_SAFE(mosq->msgs_out.inflight, message, tmp){ + if(message->msg.mid == mid){ + if(message->msg.qos != qos){ + pthread_mutex_unlock(&mosq->msgs_out.mutex); + return MOSQ_ERR_PROTOCOL; + } + message->state = state; + message->timestamp = mosquitto_time(); + pthread_mutex_unlock(&mosq->msgs_out.mutex); + return MOSQ_ERR_SUCCESS; + } + } + pthread_mutex_unlock(&mosq->msgs_out.mutex); + return MOSQ_ERR_NOT_FOUND; +} + +int mosquitto_max_inflight_messages_set(struct mosquitto *mosq, unsigned int max_inflight_messages) +{ + if(!mosq) return MOSQ_ERR_INVAL; + + mosq->send_maximum = max_inflight_messages; + + return MOSQ_ERR_SUCCESS; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/messages_mosq.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/messages_mosq.h new file mode 100644 index 0000000..1951bfc --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/messages_mosq.h @@ -0,0 +1,32 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ +#ifndef MESSAGES_MOSQ_H +#define MESSAGES_MOSQ_H + +#include "mosquitto_internal.h" +#include "mosquitto.h" + +void message__cleanup_all(struct mosquitto *mosq); +void message__cleanup(struct mosquitto_message_all **message); +int message__delete(struct mosquitto *mosq, uint16_t mid, enum mosquitto_msg_direction dir, int qos); +int message__queue(struct mosquitto *mosq, struct mosquitto_message_all *message, enum mosquitto_msg_direction dir); +void message__reconnect_reset(struct mosquitto *mosq); +int message__release_to_inflight(struct mosquitto *mosq, enum mosquitto_msg_direction dir); +int message__remove(struct mosquitto *mosq, uint16_t mid, enum mosquitto_msg_direction dir, struct mosquitto_message_all **message, int qos); +void message__retry_check(struct mosquitto *mosq); +int message__out_update(struct mosquitto *mosq, uint16_t mid, enum mosquitto_msg_state state, int qos); + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/messages_mosq.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/messages_mosq.o new file mode 100644 index 0000000..73eb4b7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/messages_mosq.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/mosquitto.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/mosquitto.c new file mode 100644 index 0000000..4b5768f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/mosquitto.c @@ -0,0 +1,612 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <errno.h> +#include <signal.h> +#include <string.h> +#ifndef WIN32 +#include <sys/time.h> +#endif + +#include "mosquitto.h" +#include "mosquitto_internal.h" +#include "memory_mosq.h" +#include "messages_mosq.h" +#include "mqtt_protocol.h" +#include "net_mosq.h" +#include "packet_mosq.h" +#include "will_mosq.h" + + +void mosquitto__destroy(struct mosquitto *mosq); + +int mosquitto_lib_version(int *major, int *minor, int *revision) +{ + if(major) *major = LIBMOSQUITTO_MAJOR; + if(minor) *minor = LIBMOSQUITTO_MINOR; + if(revision) *revision = LIBMOSQUITTO_REVISION; + return LIBMOSQUITTO_VERSION_NUMBER; +} + +int mosquitto_lib_init(void) +{ +#ifdef WIN32 + srand(GetTickCount64()); +#elif _POSIX_TIMERS>0 && defined(_POSIX_MONOTONIC_CLOCK) + struct timespec tp; + + clock_gettime(CLOCK_MONOTONIC, &tp); + srand(tp.tv_nsec); +#elif defined(__APPLE__) + uint64_t ticks; + + ticks = mach_absolute_time(); + srand((unsigned int)ticks); +#else + struct timeval tv; + + gettimeofday(&tv, NULL); + srand(tv.tv_sec*1000 + tv.tv_usec/1000); +#endif + + return net__init(); +} + +int mosquitto_lib_cleanup(void) +{ + net__cleanup(); + + return MOSQ_ERR_SUCCESS; +} + +struct mosquitto *mosquitto_new(const char *id, bool clean_start, void *userdata) +{ + struct mosquitto *mosq = NULL; + int rc; + + if(clean_start == false && id == NULL){ + errno = EINVAL; + return NULL; + } + +#ifndef WIN32 + signal(SIGPIPE, SIG_IGN); +#endif + + mosq = (struct mosquitto *)mosquitto__calloc(1, sizeof(struct mosquitto)); + if(mosq){ + mosq->sock = INVALID_SOCKET; + mosq->sockpairR = INVALID_SOCKET; + mosq->sockpairW = INVALID_SOCKET; +#ifdef WITH_THREADING + mosq->thread_id = pthread_self(); +#endif + rc = mosquitto_reinitialise(mosq, id, clean_start, userdata); + if(rc){ + mosquitto_destroy(mosq); + if(rc == MOSQ_ERR_INVAL){ + errno = EINVAL; + }else if(rc == MOSQ_ERR_NOMEM){ + errno = ENOMEM; + } + return NULL; + } + }else{ + errno = ENOMEM; + } + return mosq; +} + +int mosquitto_reinitialise(struct mosquitto *mosq, const char *id, bool clean_start, void *userdata) +{ + if(!mosq) return MOSQ_ERR_INVAL; + + if(clean_start == false && id == NULL){ + return MOSQ_ERR_INVAL; + } + + mosquitto__destroy(mosq); + memset(mosq, 0, sizeof(struct mosquitto)); + + if(userdata){ + mosq->userdata = userdata; + }else{ + mosq->userdata = mosq; + } + mosq->protocol = mosq_p_mqtt311; + mosq->sock = INVALID_SOCKET; + mosq->sockpairR = INVALID_SOCKET; + mosq->sockpairW = INVALID_SOCKET; + mosq->keepalive = 60; + mosq->clean_start = clean_start; + if(id){ + if(STREMPTY(id)){ + return MOSQ_ERR_INVAL; + } + if(mosquitto_validate_utf8(id, strlen(id))){ + return MOSQ_ERR_MALFORMED_UTF8; + } + mosq->id = mosquitto__strdup(id); + } + mosq->in_packet.payload = NULL; + packet__cleanup(&mosq->in_packet); + mosq->out_packet = NULL; + mosq->current_out_packet = NULL; + mosq->last_msg_in = mosquitto_time(); + mosq->next_msg_out = mosquitto_time() + mosq->keepalive; + mosq->ping_t = 0; + mosq->last_mid = 0; + mosq->state = mosq_cs_new; + mosq->maximum_qos = 2; + mosq->msgs_in.inflight_maximum = 20; + mosq->msgs_out.inflight_maximum = 20; + mosq->msgs_in.inflight_quota = 20; + mosq->msgs_out.inflight_quota = 20; + mosq->will = NULL; + mosq->on_connect = NULL; + mosq->on_publish = NULL; + mosq->on_message = NULL; + mosq->on_subscribe = NULL; + mosq->on_unsubscribe = NULL; + mosq->host = NULL; + mosq->port = 1883; + mosq->in_callback = false; + mosq->reconnect_delay = 1; + mosq->reconnect_delay_max = 1; + mosq->reconnect_exponential_backoff = false; + mosq->threaded = mosq_ts_none; +#ifdef WITH_TLS + mosq->ssl = NULL; + mosq->ssl_ctx = NULL; + mosq->tls_cert_reqs = SSL_VERIFY_PEER; + mosq->tls_insecure = false; + mosq->want_write = false; + mosq->tls_ocsp_required = false; +#endif +#ifdef WITH_THREADING + pthread_mutex_init(&mosq->callback_mutex, NULL); + pthread_mutex_init(&mosq->log_callback_mutex, NULL); + pthread_mutex_init(&mosq->state_mutex, NULL); + pthread_mutex_init(&mosq->out_packet_mutex, NULL); + pthread_mutex_init(&mosq->current_out_packet_mutex, NULL); + pthread_mutex_init(&mosq->msgtime_mutex, NULL); + pthread_mutex_init(&mosq->msgs_in.mutex, NULL); + pthread_mutex_init(&mosq->msgs_out.mutex, NULL); + pthread_mutex_init(&mosq->mid_mutex, NULL); + mosq->thread_id = pthread_self(); +#endif + + return MOSQ_ERR_SUCCESS; +} + + +void mosquitto__destroy(struct mosquitto *mosq) +{ + struct mosquitto__packet *packet; + if(!mosq) return; + +#ifdef WITH_THREADING +# ifdef HAVE_PTHREAD_CANCEL + if(mosq->threaded == mosq_ts_self && !pthread_equal(mosq->thread_id, pthread_self())){ + pthread_cancel(mosq->thread_id); + pthread_join(mosq->thread_id, NULL); + mosq->threaded = mosq_ts_none; + } +# endif + + if(mosq->id){ + /* If mosq->id is not NULL then the client has already been initialised + * and so the mutexes need destroying. If mosq->id is NULL, the mutexes + * haven't been initialised. */ + pthread_mutex_destroy(&mosq->callback_mutex); + pthread_mutex_destroy(&mosq->log_callback_mutex); + pthread_mutex_destroy(&mosq->state_mutex); + pthread_mutex_destroy(&mosq->out_packet_mutex); + pthread_mutex_destroy(&mosq->current_out_packet_mutex); + pthread_mutex_destroy(&mosq->msgtime_mutex); + pthread_mutex_destroy(&mosq->msgs_in.mutex); + pthread_mutex_destroy(&mosq->msgs_out.mutex); + pthread_mutex_destroy(&mosq->mid_mutex); + } +#endif + if(mosq->sock != INVALID_SOCKET){ + net__socket_close(mosq); + } + message__cleanup_all(mosq); + will__clear(mosq); +#ifdef WITH_TLS + if(mosq->ssl){ + SSL_free(mosq->ssl); + } + if(mosq->ssl_ctx){ + SSL_CTX_free(mosq->ssl_ctx); + } + mosquitto__free(mosq->tls_cafile); + mosquitto__free(mosq->tls_capath); + mosquitto__free(mosq->tls_certfile); + mosquitto__free(mosq->tls_keyfile); + if(mosq->tls_pw_callback) mosq->tls_pw_callback = NULL; + mosquitto__free(mosq->tls_version); + mosquitto__free(mosq->tls_ciphers); + mosquitto__free(mosq->tls_psk); + mosquitto__free(mosq->tls_psk_identity); + mosquitto__free(mosq->tls_alpn); +#endif + + mosquitto__free(mosq->address); + mosq->address = NULL; + + mosquitto__free(mosq->id); + mosq->id = NULL; + + mosquitto__free(mosq->username); + mosq->username = NULL; + + mosquitto__free(mosq->password); + mosq->password = NULL; + + mosquitto__free(mosq->host); + mosq->host = NULL; + + mosquitto__free(mosq->bind_address); + mosq->bind_address = NULL; + + /* Out packet cleanup */ + if(mosq->out_packet && !mosq->current_out_packet){ + mosq->current_out_packet = mosq->out_packet; + mosq->out_packet = mosq->out_packet->next; + } + while(mosq->current_out_packet){ + packet = mosq->current_out_packet; + /* Free data and reset values */ + mosq->current_out_packet = mosq->out_packet; + if(mosq->out_packet){ + mosq->out_packet = mosq->out_packet->next; + } + + packet__cleanup(packet); + mosquitto__free(packet); + } + + packet__cleanup(&mosq->in_packet); + if(mosq->sockpairR != INVALID_SOCKET){ + COMPAT_CLOSE(mosq->sockpairR); + mosq->sockpairR = INVALID_SOCKET; + } + if(mosq->sockpairW != INVALID_SOCKET){ + COMPAT_CLOSE(mosq->sockpairW); + mosq->sockpairW = INVALID_SOCKET; + } +} + +void mosquitto_destroy(struct mosquitto *mosq) +{ + if(!mosq) return; + + mosquitto__destroy(mosq); + mosquitto__free(mosq); +} + +int mosquitto_socket(struct mosquitto *mosq) +{ + if(!mosq) return INVALID_SOCKET; + return mosq->sock; +} + + +bool mosquitto_want_write(struct mosquitto *mosq) +{ + bool result = false; + if(mosq->out_packet || mosq->current_out_packet){ + result = true; + } +#ifdef WITH_TLS + if(mosq->ssl){ + if (mosq->want_write) { + result = true; + }else if(mosq->want_connect){ + result = false; + } + } +#endif + return result; +} + + +const char *mosquitto_strerror(int mosq_errno) +{ + switch(mosq_errno){ + case MOSQ_ERR_AUTH_CONTINUE: + return "Continue with authentication."; + case MOSQ_ERR_NO_SUBSCRIBERS: + return "No subscribers."; + case MOSQ_ERR_SUB_EXISTS: + return "Subscription already exists."; + case MOSQ_ERR_CONN_PENDING: + return "Connection pending."; + case MOSQ_ERR_SUCCESS: + return "No error."; + case MOSQ_ERR_NOMEM: + return "Out of memory."; + case MOSQ_ERR_PROTOCOL: + return "A network protocol error occurred when communicating with the broker."; + case MOSQ_ERR_INVAL: + return "Invalid function arguments provided."; + case MOSQ_ERR_NO_CONN: + return "The client is not currently connected."; + case MOSQ_ERR_CONN_REFUSED: + return "The connection was refused."; + case MOSQ_ERR_NOT_FOUND: + return "Message not found (internal error)."; + case MOSQ_ERR_CONN_LOST: + return "The connection was lost."; + case MOSQ_ERR_TLS: + return "A TLS error occurred."; + case MOSQ_ERR_PAYLOAD_SIZE: + return "Payload too large."; + case MOSQ_ERR_NOT_SUPPORTED: + return "This feature is not supported."; + case MOSQ_ERR_AUTH: + return "Authorisation failed."; + case MOSQ_ERR_ACL_DENIED: + return "Access denied by ACL."; + case MOSQ_ERR_UNKNOWN: + return "Unknown error."; + case MOSQ_ERR_ERRNO: + return strerror(errno); + case MOSQ_ERR_EAI: + return "Lookup error."; + case MOSQ_ERR_PROXY: + return "Proxy error."; + case MOSQ_ERR_MALFORMED_UTF8: + return "Malformed UTF-8"; + case MOSQ_ERR_DUPLICATE_PROPERTY: + return "Duplicate property in property list"; + case MOSQ_ERR_TLS_HANDSHAKE: + return "TLS handshake failed."; + case MOSQ_ERR_QOS_NOT_SUPPORTED: + return "Requested QoS not supported on server."; + case MOSQ_ERR_OVERSIZE_PACKET: + return "Packet larger than supported by the server."; + case MOSQ_ERR_OCSP: + return "OCSP error."; + default: + return "Unknown error."; + } +} + +const char *mosquitto_connack_string(int connack_code) +{ + switch(connack_code){ + case 0: + return "Connection Accepted."; + case 1: + return "Connection Refused: unacceptable protocol version."; + case 2: + return "Connection Refused: identifier rejected."; + case 3: + return "Connection Refused: broker unavailable."; + case 4: + return "Connection Refused: bad user name or password."; + case 5: + return "Connection Refused: not authorised."; + default: + return "Connection Refused: unknown reason."; + } +} + +const char *mosquitto_reason_string(int reason_code) +{ + switch(reason_code){ + case MQTT_RC_SUCCESS: + return "Success"; + case MQTT_RC_GRANTED_QOS1: + return "Granted QoS 1"; + case MQTT_RC_GRANTED_QOS2: + return "Granted QoS 2"; + case MQTT_RC_DISCONNECT_WITH_WILL_MSG: + return "Disconnect with Will Message"; + case MQTT_RC_NO_MATCHING_SUBSCRIBERS: + return "No matching subscribers"; + case MQTT_RC_NO_SUBSCRIPTION_EXISTED: + return "No subscription existed"; + case MQTT_RC_CONTINUE_AUTHENTICATION: + return "Continue authentication"; + case MQTT_RC_REAUTHENTICATE: + return "Re-authenticate"; + + case MQTT_RC_UNSPECIFIED: + return "Unspecified error"; + case MQTT_RC_MALFORMED_PACKET: + return "Malformed Packet"; + case MQTT_RC_PROTOCOL_ERROR: + return "Protocol Error"; + case MQTT_RC_IMPLEMENTATION_SPECIFIC: + return "Implementation specific error"; + case MQTT_RC_UNSUPPORTED_PROTOCOL_VERSION: + return "Unsupported Protocol Version"; + case MQTT_RC_CLIENTID_NOT_VALID: + return "Client Identifier not valid"; + case MQTT_RC_BAD_USERNAME_OR_PASSWORD: + return "Bad User Name or Password"; + case MQTT_RC_NOT_AUTHORIZED: + return "Not authorized"; + case MQTT_RC_SERVER_UNAVAILABLE: + return "Server unavailable"; + case MQTT_RC_SERVER_BUSY: + return "Server busy"; + case MQTT_RC_BANNED: + return "Banned"; + case MQTT_RC_SERVER_SHUTTING_DOWN: + return "Server shutting down"; + case MQTT_RC_BAD_AUTHENTICATION_METHOD: + return "Bad authentication method"; + case MQTT_RC_KEEP_ALIVE_TIMEOUT: + return "Keep Alive timeout"; + case MQTT_RC_SESSION_TAKEN_OVER: + return "Session taken over"; + case MQTT_RC_TOPIC_FILTER_INVALID: + return "Topic Filter invalid"; + case MQTT_RC_TOPIC_NAME_INVALID: + return "Topic Name invalid"; + case MQTT_RC_PACKET_ID_IN_USE: + return "Packet Identifier in use"; + case MQTT_RC_PACKET_ID_NOT_FOUND: + return "Packet Identifier not found"; + case MQTT_RC_RECEIVE_MAXIMUM_EXCEEDED: + return "Receive Maximum exceeded"; + case MQTT_RC_TOPIC_ALIAS_INVALID: + return "Topic Alias invalid"; + case MQTT_RC_PACKET_TOO_LARGE: + return "Packet too large"; + case MQTT_RC_MESSAGE_RATE_TOO_HIGH: + return "Message rate too high"; + case MQTT_RC_QUOTA_EXCEEDED: + return "Quota exceeded"; + case MQTT_RC_ADMINISTRATIVE_ACTION: + return "Administrative action"; + case MQTT_RC_PAYLOAD_FORMAT_INVALID: + return "Payload format invalid"; + case MQTT_RC_RETAIN_NOT_SUPPORTED: + return "Retain not supported"; + case MQTT_RC_QOS_NOT_SUPPORTED: + return "QoS not supported"; + case MQTT_RC_USE_ANOTHER_SERVER: + return "Use another server"; + case MQTT_RC_SERVER_MOVED: + return "Server moved"; + case MQTT_RC_SHARED_SUBS_NOT_SUPPORTED: + return "Shared Subscriptions not supported"; + case MQTT_RC_CONNECTION_RATE_EXCEEDED: + return "Connection rate exceeded"; + case MQTT_RC_MAXIMUM_CONNECT_TIME: + return "Maximum connect time"; + case MQTT_RC_SUBSCRIPTION_IDS_NOT_SUPPORTED: + return "Subscription identifiers not supported"; + case MQTT_RC_WILDCARD_SUBS_NOT_SUPPORTED: + return "Wildcard Subscriptions not supported"; + default: + return "Unknown reason"; + } +} + + +int mosquitto_string_to_command(const char *str, int *cmd) +{ + if(!strcasecmp(str, "connect")){ + *cmd = CMD_CONNECT; + }else if(!strcasecmp(str, "connack")){ + *cmd = CMD_CONNACK; + }else if(!strcasecmp(str, "publish")){ + *cmd = CMD_PUBLISH; + }else if(!strcasecmp(str, "puback")){ + *cmd = CMD_PUBACK; + }else if(!strcasecmp(str, "pubrec")){ + *cmd = CMD_PUBREC; + }else if(!strcasecmp(str, "pubrel")){ + *cmd = CMD_PUBREL; + }else if(!strcasecmp(str, "pubcomp")){ + *cmd = CMD_PUBCOMP; + }else if(!strcasecmp(str, "subscribe")){ + *cmd = CMD_SUBSCRIBE; + }else if(!strcasecmp(str, "unsubscribe")){ + *cmd = CMD_UNSUBSCRIBE; + }else if(!strcasecmp(str, "disconnect")){ + *cmd = CMD_DISCONNECT; + }else if(!strcasecmp(str, "auth")){ + *cmd = CMD_AUTH; + }else if(!strcasecmp(str, "will")){ + *cmd = CMD_WILL; + }else{ + return MOSQ_ERR_INVAL; + } + return MOSQ_ERR_SUCCESS; +} + + +int mosquitto_sub_topic_tokenise(const char *subtopic, char ***topics, int *count) +{ + int len; + int hier_count = 1; + int start, stop; + int hier; + int tlen; + int i, j; + + if(!subtopic || !topics || !count) return MOSQ_ERR_INVAL; + + len = strlen(subtopic); + + for(i=0; i<len; i++){ + if(subtopic[i] == '/'){ + if(i > len-1){ + /* Separator at end of line */ + }else{ + hier_count++; + } + } + } + + (*topics) = mosquitto__calloc(hier_count, sizeof(char *)); + if(!(*topics)) return MOSQ_ERR_NOMEM; + + start = 0; + stop = 0; + hier = 0; + + for(i=0; i<len+1; i++){ + if(subtopic[i] == '/' || subtopic[i] == '\0'){ + stop = i; + if(start != stop){ + tlen = stop-start + 1; + (*topics)[hier] = mosquitto__calloc(tlen, sizeof(char)); + if(!(*topics)[hier]){ + for(j=0; j<hier; j++){ + mosquitto__free((*topics)[j]); + } + mosquitto__free((*topics)); + return MOSQ_ERR_NOMEM; + } + for(j=start; j<stop; j++){ + (*topics)[hier][j-start] = subtopic[j]; + } + } + start = i+1; + hier++; + } + } + + *count = hier_count; + + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_sub_topic_tokens_free(char ***topics, int count) +{ + int i; + + if(!topics || !(*topics) || count<1) return MOSQ_ERR_INVAL; + + for(i=0; i<count; i++){ + mosquitto__free((*topics)[i]); + } + mosquitto__free(*topics); + + return MOSQ_ERR_SUCCESS; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/mosquitto.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/mosquitto.h new file mode 100644 index 0000000..09bba66 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/mosquitto.h @@ -0,0 +1,2993 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef MOSQUITTO_H +#define MOSQUITTO_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(WIN32) && !defined(WITH_BROKER) && !defined(LIBMOSQUITTO_STATIC) +# ifdef libmosquitto_EXPORTS +# define libmosq_EXPORT __declspec(dllexport) +# else +# define libmosq_EXPORT __declspec(dllimport) +# endif +#else +# define libmosq_EXPORT +#endif + +#if defined(_MSC_VER) && _MSC_VER < 1900 +# ifndef __cplusplus +# define bool char +# define true 1 +# define false 0 +# endif +#else +# ifndef __cplusplus +# include <stdbool.h> +# endif +#endif + +#include <stddef.h> +#include <stdint.h> + +#define LIBMOSQUITTO_MAJOR 1 +#define LIBMOSQUITTO_MINOR 6 +#define LIBMOSQUITTO_REVISION 3 +/* LIBMOSQUITTO_VERSION_NUMBER looks like 1002001 for e.g. version 1.2.1. */ +#define LIBMOSQUITTO_VERSION_NUMBER (LIBMOSQUITTO_MAJOR*1000000+LIBMOSQUITTO_MINOR*1000+LIBMOSQUITTO_REVISION) + +/* Log types */ +#define MOSQ_LOG_NONE 0 +#define MOSQ_LOG_INFO (1<<0) +#define MOSQ_LOG_NOTICE (1<<1) +#define MOSQ_LOG_WARNING (1<<2) +#define MOSQ_LOG_ERR (1<<3) +#define MOSQ_LOG_DEBUG (1<<4) +#define MOSQ_LOG_SUBSCRIBE (1<<5) +#define MOSQ_LOG_UNSUBSCRIBE (1<<6) +#define MOSQ_LOG_WEBSOCKETS (1<<7) +#define MOSQ_LOG_INTERNAL 0x80000000 +#define MOSQ_LOG_ALL 0x7FFFFFFF + +/* Error values */ +enum mosq_err_t { + MOSQ_ERR_AUTH_CONTINUE = -4, + MOSQ_ERR_NO_SUBSCRIBERS = -3, + MOSQ_ERR_SUB_EXISTS = -2, + MOSQ_ERR_CONN_PENDING = -1, + MOSQ_ERR_SUCCESS = 0, + MOSQ_ERR_NOMEM = 1, + MOSQ_ERR_PROTOCOL = 2, + MOSQ_ERR_INVAL = 3, + MOSQ_ERR_NO_CONN = 4, + MOSQ_ERR_CONN_REFUSED = 5, + MOSQ_ERR_NOT_FOUND = 6, + MOSQ_ERR_CONN_LOST = 7, + MOSQ_ERR_TLS = 8, + MOSQ_ERR_PAYLOAD_SIZE = 9, + MOSQ_ERR_NOT_SUPPORTED = 10, + MOSQ_ERR_AUTH = 11, + MOSQ_ERR_ACL_DENIED = 12, + MOSQ_ERR_UNKNOWN = 13, + MOSQ_ERR_ERRNO = 14, + MOSQ_ERR_EAI = 15, + MOSQ_ERR_PROXY = 16, + MOSQ_ERR_PLUGIN_DEFER = 17, + MOSQ_ERR_MALFORMED_UTF8 = 18, + MOSQ_ERR_KEEPALIVE = 19, + MOSQ_ERR_LOOKUP = 20, + MOSQ_ERR_MALFORMED_PACKET = 21, + MOSQ_ERR_DUPLICATE_PROPERTY = 22, + MOSQ_ERR_TLS_HANDSHAKE = 23, + MOSQ_ERR_QOS_NOT_SUPPORTED = 24, + MOSQ_ERR_OVERSIZE_PACKET = 25, + MOSQ_ERR_OCSP = 26, +}; + +/* Option values */ +enum mosq_opt_t { + MOSQ_OPT_PROTOCOL_VERSION = 1, + MOSQ_OPT_SSL_CTX = 2, + MOSQ_OPT_SSL_CTX_WITH_DEFAULTS = 3, + MOSQ_OPT_RECEIVE_MAXIMUM = 4, + MOSQ_OPT_SEND_MAXIMUM = 5, + MOSQ_OPT_TLS_KEYFORM = 6, + MOSQ_OPT_TLS_ENGINE = 7, + MOSQ_OPT_TLS_ENGINE_KPASS_SHA1 = 8, + MOSQ_OPT_TLS_OCSP_REQUIRED = 9, + MOSQ_OPT_TLS_ALPN = 10, +}; + + +/* MQTT specification restricts client ids to a maximum of 23 characters */ +#define MOSQ_MQTT_ID_MAX_LENGTH 23 + +#define MQTT_PROTOCOL_V31 3 +#define MQTT_PROTOCOL_V311 4 +#define MQTT_PROTOCOL_V5 5 + +struct mosquitto_message{ + int mid; + char *topic; + void *payload; + int payloadlen; + int qos; + bool retain; +}; + +struct mosquitto; +typedef struct mqtt5__property mosquitto_property; + +/* + * Topic: Threads + * libmosquitto provides thread safe operation, with the exception of + * <mosquitto_lib_init> which is not thread safe. + * + * If your application uses threads you must use <mosquitto_threaded_set> to + * tell the library this is the case, otherwise it makes some optimisations + * for the single threaded case that may result in unexpected behaviour for + * the multi threaded case. + */ +/*************************************************** + * Important note + * + * The following functions that deal with network operations will return + * MOSQ_ERR_SUCCESS on success, but this does not mean that the operation has + * taken place. An attempt will be made to write the network data, but if the + * socket is not available for writing at that time then the packet will not be + * sent. To ensure the packet is sent, call mosquitto_loop() (which must also + * be called to process incoming network data). + * This is especially important when disconnecting a client that has a will. If + * the broker does not receive the DISCONNECT command, it will assume that the + * client has disconnected unexpectedly and send the will. + * + * mosquitto_connect() + * mosquitto_disconnect() + * mosquitto_subscribe() + * mosquitto_unsubscribe() + * mosquitto_publish() + ***************************************************/ + + +/* ====================================================================== + * + * Section: Library version, init, and cleanup + * + * ====================================================================== */ +/* + * Function: mosquitto_lib_version + * + * Can be used to obtain version information for the mosquitto library. + * This allows the application to compare the library version against the + * version it was compiled against by using the LIBMOSQUITTO_MAJOR, + * LIBMOSQUITTO_MINOR and LIBMOSQUITTO_REVISION defines. + * + * Parameters: + * major - an integer pointer. If not NULL, the major version of the + * library will be returned in this variable. + * minor - an integer pointer. If not NULL, the minor version of the + * library will be returned in this variable. + * revision - an integer pointer. If not NULL, the revision of the library will + * be returned in this variable. + * + * Returns: + * LIBMOSQUITTO_VERSION_NUMBER, which is a unique number based on the major, + * minor and revision values. + * See Also: + * <mosquitto_lib_cleanup>, <mosquitto_lib_init> + */ +libmosq_EXPORT int mosquitto_lib_version(int *major, int *minor, int *revision); + +/* + * Function: mosquitto_lib_init + * + * Must be called before any other mosquitto functions. + * + * This function is *not* thread safe. + * + * Returns: + * MOSQ_ERR_SUCCESS - always + * + * See Also: + * <mosquitto_lib_cleanup>, <mosquitto_lib_version> + */ +libmosq_EXPORT int mosquitto_lib_init(void); + +/* + * Function: mosquitto_lib_cleanup + * + * Call to free resources associated with the library. + * + * Returns: + * MOSQ_ERR_SUCCESS - always + * + * See Also: + * <mosquitto_lib_init>, <mosquitto_lib_version> + */ +libmosq_EXPORT int mosquitto_lib_cleanup(void); + + +/* ====================================================================== + * + * Section: Client creation, destruction, and reinitialisation + * + * ====================================================================== */ +/* + * Function: mosquitto_new + * + * Create a new mosquitto client instance. + * + * Parameters: + * id - String to use as the client id. If NULL, a random client id + * will be generated. If id is NULL, clean_session must be true. + * clean_session - set to true to instruct the broker to clean all messages + * and subscriptions on disconnect, false to instruct it to + * keep them. See the man page mqtt(7) for more details. + * Note that a client will never discard its own outgoing + * messages on disconnect. Calling <mosquitto_connect> or + * <mosquitto_reconnect> will cause the messages to be resent. + * Use <mosquitto_reinitialise> to reset a client to its + * original state. + * Must be set to true if the id parameter is NULL. + * obj - A user pointer that will be passed as an argument to any + * callbacks that are specified. + * + * Returns: + * Pointer to a struct mosquitto on success. + * NULL on failure. Interrogate errno to determine the cause for the failure: + * - ENOMEM on out of memory. + * - EINVAL on invalid input parameters. + * + * See Also: + * <mosquitto_reinitialise>, <mosquitto_destroy>, <mosquitto_user_data_set> + */ +libmosq_EXPORT struct mosquitto *mosquitto_new(const char *id, bool clean_session, void *obj); + +/* + * Function: mosquitto_destroy + * + * Use to free memory associated with a mosquitto client instance. + * + * Parameters: + * mosq - a struct mosquitto pointer to free. + * + * See Also: + * <mosquitto_new>, <mosquitto_reinitialise> + */ +libmosq_EXPORT void mosquitto_destroy(struct mosquitto *mosq); + +/* + * Function: mosquitto_reinitialise + * + * This function allows an existing mosquitto client to be reused. Call on a + * mosquitto instance to close any open network connections, free memory + * and reinitialise the client with the new parameters. The end result is the + * same as the output of <mosquitto_new>. + * + * Parameters: + * mosq - a valid mosquitto instance. + * id - string to use as the client id. If NULL, a random client id + * will be generated. If id is NULL, clean_session must be true. + * clean_session - set to true to instruct the broker to clean all messages + * and subscriptions on disconnect, false to instruct it to + * keep them. See the man page mqtt(7) for more details. + * Must be set to true if the id parameter is NULL. + * obj - A user pointer that will be passed as an argument to any + * callbacks that are specified. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * + * See Also: + * <mosquitto_new>, <mosquitto_destroy> + */ +libmosq_EXPORT int mosquitto_reinitialise(struct mosquitto *mosq, const char *id, bool clean_session, void *obj); + + +/* ====================================================================== + * + * Section: Will + * + * ====================================================================== */ +/* + * Function: mosquitto_will_set + * + * Configure will information for a mosquitto instance. By default, clients do + * not have a will. This must be called before calling <mosquitto_connect>. + * + * Parameters: + * mosq - a valid mosquitto instance. + * topic - the topic on which to publish the will. + * payloadlen - the size of the payload (bytes). Valid values are between 0 and + * 268,435,455. + * payload - pointer to the data to send. If payloadlen > 0 this must be a + * valid memory location. + * qos - integer value 0, 1 or 2 indicating the Quality of Service to be + * used for the will. + * retain - set to true to make the will a retained message. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_PAYLOAD_SIZE - if payloadlen is too large. + * MOSQ_ERR_MALFORMED_UTF8 - if the topic is not valid UTF-8. + */ +libmosq_EXPORT int mosquitto_will_set(struct mosquitto *mosq, const char *topic, int payloadlen, const void *payload, int qos, bool retain); + +/* + * Function: mosquitto_will_set_v5 + * + * Configure will information for a mosquitto instance, with attached + * properties. By default, clients do not have a will. This must be called + * before calling <mosquitto_connect>. + * + * Parameters: + * mosq - a valid mosquitto instance. + * topic - the topic on which to publish the will. + * payloadlen - the size of the payload (bytes). Valid values are between 0 and + * 268,435,455. + * payload - pointer to the data to send. If payloadlen > 0 this must be a + * valid memory location. + * qos - integer value 0, 1 or 2 indicating the Quality of Service to be + * used for the will. + * retain - set to true to make the will a retained message. + * properties - list of MQTT 5 properties. Can be NULL. On success only, the + * property list becomes the property of libmosquitto once this + * function is called and will be freed by the library. The + * property list must be freed by the application on error. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_PAYLOAD_SIZE - if payloadlen is too large. + * MOSQ_ERR_MALFORMED_UTF8 - if the topic is not valid UTF-8. + * MOSQ_ERR_NOT_SUPPORTED - if properties is not NULL and the client is not + * using MQTT v5 + * MOSQ_ERR_PROTOCOL - if a property is invalid for use with wills. + * MOSQ_ERR_DUPLICATE_PROPERTY - if a property is duplicated where it is forbidden. + */ +libmosq_EXPORT int mosquitto_will_set_v5(struct mosquitto *mosq, const char *topic, int payloadlen, const void *payload, int qos, bool retain, mosquitto_property *properties); + +/* + * Function: mosquitto_will_clear + * + * Remove a previously configured will. This must be called before calling + * <mosquitto_connect>. + * + * Parameters: + * mosq - a valid mosquitto instance. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + */ +libmosq_EXPORT int mosquitto_will_clear(struct mosquitto *mosq); + + +/* ====================================================================== + * + * Section: Username and password + * + * ====================================================================== */ +/* + * Function: mosquitto_username_pw_set + * + * Configure username and password for a mosquitton instance. This is only + * supported by brokers that implement the MQTT spec v3.1. By default, no + * username or password will be sent. + * If username is NULL, the password argument is ignored. + * This must be called before calling mosquitto_connect(). + * + * This is must be called before calling <mosquitto_connect>. + * + * Parameters: + * mosq - a valid mosquitto instance. + * username - the username to send as a string, or NULL to disable + * authentication. + * password - the password to send as a string. Set to NULL when username is + * valid in order to send just a username. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + */ +libmosq_EXPORT int mosquitto_username_pw_set(struct mosquitto *mosq, const char *username, const char *password); + + +/* ====================================================================== + * + * Section: Connecting, reconnecting, disconnecting + * + * ====================================================================== */ +/* + * Function: mosquitto_connect + * + * Connect to an MQTT broker. + * + * Parameters: + * mosq - a valid mosquitto instance. + * host - the hostname or ip address of the broker to connect to. + * port - the network port to connect to. Usually 1883. + * keepalive - the number of seconds after which the broker should send a PING + * message to the client if no other messages have been exchanged + * in that time. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * + * See Also: + * <mosquitto_connect_bind>, <mosquitto_connect_async>, <mosquitto_reconnect>, <mosquitto_disconnect>, <mosquitto_tls_set> + */ +libmosq_EXPORT int mosquitto_connect(struct mosquitto *mosq, const char *host, int port, int keepalive); + +/* + * Function: mosquitto_connect_bind + * + * Connect to an MQTT broker. This extends the functionality of + * <mosquitto_connect> by adding the bind_address parameter. Use this function + * if you need to restrict network communication over a particular interface. + * + * Parameters: + * mosq - a valid mosquitto instance. + * host - the hostname or ip address of the broker to connect to. + * port - the network port to connect to. Usually 1883. + * keepalive - the number of seconds after which the broker should send a PING + * message to the client if no other messages have been exchanged + * in that time. + * bind_address - the hostname or ip address of the local network interface to + * bind to. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * + * See Also: + * <mosquitto_connect>, <mosquitto_connect_async>, <mosquitto_connect_bind_async> + */ +libmosq_EXPORT int mosquitto_connect_bind(struct mosquitto *mosq, const char *host, int port, int keepalive, const char *bind_address); + +/* + * Function: mosquitto_connect_bind_v5 + * + * Connect to an MQTT broker. This extends the functionality of + * <mosquitto_connect> by adding the bind_address parameter. Use this function + * if you need to restrict network communication over a particular interface. + * + * Parameters: + * mosq - a valid mosquitto instance. + * host - the hostname or ip address of the broker to connect to. + * port - the network port to connect to. Usually 1883. + * keepalive - the number of seconds after which the broker should send a PING + * message to the client if no other messages have been exchanged + * in that time. + * bind_address - the hostname or ip address of the local network interface to + * bind to. + * properties - the MQTT 5 properties for the connect (not for the Will). + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * MOSQ_ERR_DUPLICATE_PROPERTY - if a property is duplicated where it is forbidden. + * MOSQ_ERR_PROTOCOL - if any property is invalid for use with CONNECT. + * + * See Also: + * <mosquitto_connect>, <mosquitto_connect_async>, <mosquitto_connect_bind_async> + */ +libmosq_EXPORT int mosquitto_connect_bind_v5(struct mosquitto *mosq, const char *host, int port, int keepalive, const char *bind_address, const mosquitto_property *properties); + +/* + * Function: mosquitto_connect_async + * + * Connect to an MQTT broker. This is a non-blocking call. If you use + * <mosquitto_connect_async> your client must use the threaded interface + * <mosquitto_loop_start>. If you need to use <mosquitto_loop>, you must use + * <mosquitto_connect> to connect the client. + * + * May be called before or after <mosquitto_loop_start>. + * + * Parameters: + * mosq - a valid mosquitto instance. + * host - the hostname or ip address of the broker to connect to. + * port - the network port to connect to. Usually 1883. + * keepalive - the number of seconds after which the broker should send a PING + * message to the client if no other messages have been exchanged + * in that time. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * + * See Also: + * <mosquitto_connect_bind_async>, <mosquitto_connect>, <mosquitto_reconnect>, <mosquitto_disconnect>, <mosquitto_tls_set> + */ +libmosq_EXPORT int mosquitto_connect_async(struct mosquitto *mosq, const char *host, int port, int keepalive); + +/* + * Function: mosquitto_connect_bind_async + * + * Connect to an MQTT broker. This is a non-blocking call. If you use + * <mosquitto_connect_bind_async> your client must use the threaded interface + * <mosquitto_loop_start>. If you need to use <mosquitto_loop>, you must use + * <mosquitto_connect> to connect the client. + * + * This extends the functionality of <mosquitto_connect_async> by adding the + * bind_address parameter. Use this function if you need to restrict network + * communication over a particular interface. + * + * May be called before or after <mosquitto_loop_start>. + * + * Parameters: + * mosq - a valid mosquitto instance. + * host - the hostname or ip address of the broker to connect to. + * port - the network port to connect to. Usually 1883. + * keepalive - the number of seconds after which the broker should send a PING + * message to the client if no other messages have been exchanged + * in that time. + * bind_address - the hostname or ip address of the local network interface to + * bind to. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * + * See Also: + * <mosquitto_connect_async>, <mosquitto_connect>, <mosquitto_connect_bind> + */ +libmosq_EXPORT int mosquitto_connect_bind_async(struct mosquitto *mosq, const char *host, int port, int keepalive, const char *bind_address); + +/* + * Function: mosquitto_connect_srv + * + * Connect to an MQTT broker. This is a non-blocking call. If you use + * <mosquitto_connect_async> your client must use the threaded interface + * <mosquitto_loop_start>. If you need to use <mosquitto_loop>, you must use + * <mosquitto_connect> to connect the client. + * + * This extends the functionality of <mosquitto_connect_async> by adding the + * bind_address parameter. Use this function if you need to restrict network + * communication over a particular interface. + * + * May be called before or after <mosquitto_loop_start>. + * + * Parameters: + * mosq - a valid mosquitto instance. + * host - the hostname or ip address of the broker to connect to. + * keepalive - the number of seconds after which the broker should send a PING + * message to the client if no other messages have been exchanged + * in that time. + * bind_address - the hostname or ip address of the local network interface to + * bind to. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * + * See Also: + * <mosquitto_connect_async>, <mosquitto_connect>, <mosquitto_connect_bind> + */ +libmosq_EXPORT int mosquitto_connect_srv(struct mosquitto *mosq, const char *host, int keepalive, const char *bind_address); + +/* + * Function: mosquitto_reconnect + * + * Reconnect to a broker. + * + * This function provides an easy way of reconnecting to a broker after a + * connection has been lost. It uses the values that were provided in the + * <mosquitto_connect> call. It must not be called before + * <mosquitto_connect>. + * + * Parameters: + * mosq - a valid mosquitto instance. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * + * See Also: + * <mosquitto_connect>, <mosquitto_disconnect>, <mosquitto_reconnect_async> + */ +libmosq_EXPORT int mosquitto_reconnect(struct mosquitto *mosq); + +/* + * Function: mosquitto_reconnect_async + * + * Reconnect to a broker. Non blocking version of <mosquitto_reconnect>. + * + * This function provides an easy way of reconnecting to a broker after a + * connection has been lost. It uses the values that were provided in the + * <mosquitto_connect> or <mosquitto_connect_async> calls. It must not be + * called before <mosquitto_connect>. + * + * Parameters: + * mosq - a valid mosquitto instance. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * + * See Also: + * <mosquitto_connect>, <mosquitto_disconnect> + */ +libmosq_EXPORT int mosquitto_reconnect_async(struct mosquitto *mosq); + +/* + * Function: mosquitto_disconnect + * + * Disconnect from the broker. + * + * Parameters: + * mosq - a valid mosquitto instance. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + */ +libmosq_EXPORT int mosquitto_disconnect(struct mosquitto *mosq); + +/* + * Function: mosquitto_disconnect_v5 + * + * Disconnect from the broker, with attached MQTT properties. + * + * Use <mosquitto_property_add_*> to create a list of properties, then attach + * them to this publish. Properties need freeing with + * <mosquitto_property_free_all>. + * + * Parameters: + * mosq - a valid mosquitto instance. + * reason_code - the disconnect reason code. + * properties - a valid mosquitto_property list, or NULL. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + * MOSQ_ERR_DUPLICATE_PROPERTY - if a property is duplicated where it is forbidden. + * MOSQ_ERR_PROTOCOL - if any property is invalid for use with DISCONNECT. + */ +libmosq_EXPORT int mosquitto_disconnect_v5(struct mosquitto *mosq, int reason_code, const mosquitto_property *properties); + + +/* ====================================================================== + * + * Section: Publishing, subscribing, unsubscribing + * + * ====================================================================== */ +/* + * Function: mosquitto_publish + * + * Publish a message on a given topic. + * + * Parameters: + * mosq - a valid mosquitto instance. + * mid - pointer to an int. If not NULL, the function will set this + * to the message id of this particular message. This can be then + * used with the publish callback to determine when the message + * has been sent. + * Note that although the MQTT protocol doesn't use message ids + * for messages with QoS=0, libmosquitto assigns them message ids + * so they can be tracked with this parameter. + * topic - null terminated string of the topic to publish to. + * payloadlen - the size of the payload (bytes). Valid values are between 0 and + * 268,435,455. + * payload - pointer to the data to send. If payloadlen > 0 this must be a + * valid memory location. + * qos - integer value 0, 1 or 2 indicating the Quality of Service to be + * used for the message. + * retain - set to true to make the message retained. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + * MOSQ_ERR_PROTOCOL - if there is a protocol error communicating with the + * broker. + * MOSQ_ERR_PAYLOAD_SIZE - if payloadlen is too large. + * MOSQ_ERR_MALFORMED_UTF8 - if the topic is not valid UTF-8 + * MOSQ_ERR_QOS_NOT_SUPPORTED - if the QoS is greater than that supported by + * the broker. + * MOSQ_ERR_OVERSIZE_PACKET - if the resulting packet would be larger than + * supported by the broker. + * + * See Also: + * <mosquitto_max_inflight_messages_set> + */ +libmosq_EXPORT int mosquitto_publish(struct mosquitto *mosq, int *mid, const char *topic, int payloadlen, const void *payload, int qos, bool retain); + + +/* + * Function: mosquitto_publish_v5 + * + * Publish a message on a given topic, with attached MQTT properties. + * + * Use <mosquitto_property_add_*> to create a list of properties, then attach + * them to this publish. Properties need freeing with + * <mosquitto_property_free_all>. + * + * Requires the mosquitto instance to be connected with MQTT 5. + * + * Parameters: + * mosq - a valid mosquitto instance. + * mid - pointer to an int. If not NULL, the function will set this + * to the message id of this particular message. This can be then + * used with the publish callback to determine when the message + * has been sent. + * Note that although the MQTT protocol doesn't use message ids + * for messages with QoS=0, libmosquitto assigns them message ids + * so they can be tracked with this parameter. + * topic - null terminated string of the topic to publish to. + * payloadlen - the size of the payload (bytes). Valid values are between 0 and + * 268,435,455. + * payload - pointer to the data to send. If payloadlen > 0 this must be a + * valid memory location. + * qos - integer value 0, 1 or 2 indicating the Quality of Service to be + * used for the message. + * retain - set to true to make the message retained. + * properties - a valid mosquitto_property list, or NULL. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + * MOSQ_ERR_PROTOCOL - if there is a protocol error communicating with the + * broker. + * MOSQ_ERR_PAYLOAD_SIZE - if payloadlen is too large. + * MOSQ_ERR_MALFORMED_UTF8 - if the topic is not valid UTF-8 + * MOSQ_ERR_DUPLICATE_PROPERTY - if a property is duplicated where it is forbidden. + * MOSQ_ERR_PROTOCOL - if any property is invalid for use with PUBLISH. + * MOSQ_ERR_QOS_NOT_SUPPORTED - if the QoS is greater than that supported by + * the broker. + * MOSQ_ERR_OVERSIZE_PACKET - if the resulting packet would be larger than + * supported by the broker. + */ +libmosq_EXPORT int mosquitto_publish_v5( + struct mosquitto *mosq, + int *mid, + const char *topic, + int payloadlen, + const void *payload, + int qos, + bool retain, + const mosquitto_property *properties); + + +/* + * Function: mosquitto_subscribe + * + * Subscribe to a topic. + * + * Parameters: + * mosq - a valid mosquitto instance. + * mid - a pointer to an int. If not NULL, the function will set this to + * the message id of this particular message. This can be then used + * with the subscribe callback to determine when the message has been + * sent. + * sub - the subscription pattern. + * qos - the requested Quality of Service for this subscription. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + * MOSQ_ERR_MALFORMED_UTF8 - if the topic is not valid UTF-8 + * MOSQ_ERR_OVERSIZE_PACKET - if the resulting packet would be larger than + * supported by the broker. + */ +libmosq_EXPORT int mosquitto_subscribe(struct mosquitto *mosq, int *mid, const char *sub, int qos); + +/* + * Function: mosquitto_subscribe_v5 + * + * Subscribe to a topic, with attached MQTT properties. + * + * Use <mosquitto_property_add_*> to create a list of properties, then attach + * them to this subscribe. Properties need freeing with + * <mosquitto_property_free_all>. + * + * Requires the mosquitto instance to be connected with MQTT 5. + * + * + * Parameters: + * mosq - a valid mosquitto instance. + * mid - a pointer to an int. If not NULL, the function will set this to + * the message id of this particular message. This can be then used + * with the subscribe callback to determine when the message has been + * sent. + * sub - the subscription pattern. + * qos - the requested Quality of Service for this subscription. + * options - options to apply to this subscription, OR'd together. Set to 0 to + * use the default options, otherwise choose from the list: + * MQTT_SUB_OPT_NO_LOCAL - with this option set, if this client + * publishes to a topic to which it is subscribed, the + * broker will not publish the message back to the + * client. + * MQTT_SUB_OPT_RETAIN_AS_PUBLISHED - with this option set, messages + * published for this subscription will keep the + * retain flag as was set by the publishing client. + * The default behaviour without this option set has + * the retain flag indicating whether a message is + * fresh/stale. + * MQTT_SUB_OPT_SEND_RETAIN_ALWAYS - with this option set, + * pre-existing retained messages are sent as soon as + * the subscription is made, even if the subscription + * already exists. This is the default behaviour, so + * it is not necessary to set this option. + * MQTT_SUB_OPT_SEND_RETAIN_NEW - with this option set, pre-existing + * retained messages for this subscription will be + * sent when the subscription is made, but only if the + * subscription does not already exist. + * MQTT_SUB_OPT_SEND_RETAIN_NEVER - with this option set, + * pre-existing retained messages will never be sent + * for this subscription. + * properties - a valid mosquitto_property list, or NULL. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + * MOSQ_ERR_MALFORMED_UTF8 - if the topic is not valid UTF-8 + * MOSQ_ERR_DUPLICATE_PROPERTY - if a property is duplicated where it is forbidden. + * MOSQ_ERR_PROTOCOL - if any property is invalid for use with SUBSCRIBE. + * MOSQ_ERR_OVERSIZE_PACKET - if the resulting packet would be larger than + * supported by the broker. + */ +libmosq_EXPORT int mosquitto_subscribe_v5(struct mosquitto *mosq, int *mid, const char *sub, int qos, int options, const mosquitto_property *properties); + +/* + * Function: mosquitto_subscribe_multiple + * + * Subscribe to multiple topics. + * + * Parameters: + * mosq - a valid mosquitto instance. + * mid - a pointer to an int. If not NULL, the function will set this to + * the message id of this particular message. This can be then used + * with the subscribe callback to determine when the message has been + * sent. + * sub_count - the count of subscriptions to be made + * sub - array of sub_count pointers, each pointing to a subscription string. + * The "char *const *const" datatype ensures that neither the array of + * pointers nor the strings that they point to are mutable. If you aren't + * familiar with this, just think of it as a safer "char **", + * equivalent to "const char *" for a simple string pointer. + * qos - the requested Quality of Service for each subscription. + * options - options to apply to this subscription, OR'd together. Set to 0 to + * use the default options, otherwise choose from the list: + * MQTT_SUB_OPT_NO_LOCAL - with this option set, if this client + * publishes to a topic to which it is subscribed, the + * broker will not publish the message back to the + * client. + * MQTT_SUB_OPT_RETAIN_AS_PUBLISHED - with this option set, messages + * published for this subscription will keep the + * retain flag as was set by the publishing client. + * The default behaviour without this option set has + * the retain flag indicating whether a message is + * fresh/stale. + * MQTT_SUB_OPT_SEND_RETAIN_ALWAYS - with this option set, + * pre-existing retained messages are sent as soon as + * the subscription is made, even if the subscription + * already exists. This is the default behaviour, so + * it is not necessary to set this option. + * MQTT_SUB_OPT_SEND_RETAIN_NEW - with this option set, pre-existing + * retained messages for this subscription will be + * sent when the subscription is made, but only if the + * subscription does not already exist. + * MQTT_SUB_OPT_SEND_RETAIN_NEVER - with this option set, + * pre-existing retained messages will never be sent + * for this subscription. + * properties - a valid mosquitto_property list, or NULL. Only used with MQTT + * v5 clients. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + * MOSQ_ERR_MALFORMED_UTF8 - if a topic is not valid UTF-8 + * MOSQ_ERR_OVERSIZE_PACKET - if the resulting packet would be larger than + * supported by the broker. + */ +libmosq_EXPORT int mosquitto_subscribe_multiple(struct mosquitto *mosq, int *mid, int sub_count, char *const *const sub, int qos, int options, const mosquitto_property *properties); + +/* + * Function: mosquitto_unsubscribe + * + * Unsubscribe from a topic. + * + * Parameters: + * mosq - a valid mosquitto instance. + * mid - a pointer to an int. If not NULL, the function will set this to + * the message id of this particular message. This can be then used + * with the unsubscribe callback to determine when the message has been + * sent. + * sub - the unsubscription pattern. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + * MOSQ_ERR_MALFORMED_UTF8 - if the topic is not valid UTF-8 + * MOSQ_ERR_OVERSIZE_PACKET - if the resulting packet would be larger than + * supported by the broker. + */ +libmosq_EXPORT int mosquitto_unsubscribe(struct mosquitto *mosq, int *mid, const char *sub); + +/* + * Function: mosquitto_unsubscribe_v5 + * + * Unsubscribe from a topic, with attached MQTT properties. + * + * Parameters: + * mosq - a valid mosquitto instance. + * mid - a pointer to an int. If not NULL, the function will set this to + * the message id of this particular message. This can be then used + * with the unsubscribe callback to determine when the message has been + * sent. + * sub - the unsubscription pattern. + * properties - a valid mosquitto_property list, or NULL. Only used with MQTT + * v5 clients. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + * MOSQ_ERR_MALFORMED_UTF8 - if the topic is not valid UTF-8 + * MOSQ_ERR_DUPLICATE_PROPERTY - if a property is duplicated where it is forbidden. + * MOSQ_ERR_PROTOCOL - if any property is invalid for use with UNSUBSCRIBE. + * MOSQ_ERR_OVERSIZE_PACKET - if the resulting packet would be larger than + * supported by the broker. + */ +libmosq_EXPORT int mosquitto_unsubscribe_v5(struct mosquitto *mosq, int *mid, const char *sub, const mosquitto_property *properties); + +/* + * Function: mosquitto_unsubscribe_multiple + * + * Unsubscribe from multiple topics. + * + * Parameters: + * mosq - a valid mosquitto instance. + * mid - a pointer to an int. If not NULL, the function will set this to + * the message id of this particular message. This can be then used + * with the subscribe callback to determine when the message has been + * sent. + * sub_count - the count of unsubscriptions to be made + * sub - array of sub_count pointers, each pointing to an unsubscription string. + * The "char *const *const" datatype ensures that neither the array of + * pointers nor the strings that they point to are mutable. If you aren't + * familiar with this, just think of it as a safer "char **", + * equivalent to "const char *" for a simple string pointer. + * properties - a valid mosquitto_property list, or NULL. Only used with MQTT + * v5 clients. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + * MOSQ_ERR_MALFORMED_UTF8 - if a topic is not valid UTF-8 + * MOSQ_ERR_OVERSIZE_PACKET - if the resulting packet would be larger than + * supported by the broker. + */ +libmosq_EXPORT int mosquitto_unsubscribe_multiple(struct mosquitto *mosq, int *mid, int sub_count, char *const *const sub, const mosquitto_property *properties); + + +/* ====================================================================== + * + * Section: Struct mosquitto_message helper functions + * + * ====================================================================== */ +/* + * Function: mosquitto_message_copy + * + * Copy the contents of a mosquitto message to another message. + * Useful for preserving a message received in the on_message() callback. + * + * Parameters: + * dst - a pointer to a valid mosquitto_message struct to copy to. + * src - a pointer to a valid mosquitto_message struct to copy from. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * + * See Also: + * <mosquitto_message_free> + */ +libmosq_EXPORT int mosquitto_message_copy(struct mosquitto_message *dst, const struct mosquitto_message *src); + +/* + * Function: mosquitto_message_free + * + * Completely free a mosquitto_message struct. + * + * Parameters: + * message - pointer to a mosquitto_message pointer to free. + * + * See Also: + * <mosquitto_message_copy>, <mosquitto_message_free_contents> + */ +libmosq_EXPORT void mosquitto_message_free(struct mosquitto_message **message); + +/* + * Function: mosquitto_message_free_contents + * + * Free a mosquitto_message struct contents, leaving the struct unaffected. + * + * Parameters: + * message - pointer to a mosquitto_message struct to free its contents. + * + * See Also: + * <mosquitto_message_copy>, <mosquitto_message_free> + */ +libmosq_EXPORT void mosquitto_message_free_contents(struct mosquitto_message *message); + + +/* ====================================================================== + * + * Section: Network loop (managed by libmosquitto) + * + * ====================================================================== */ +/* + * Function: mosquitto_loop + * + * The main network loop for the client. You must call this frequently in order + * to keep communications between the client and broker working. If incoming + * data is present it will then be processed. Outgoing commands, from e.g. + * <mosquitto_publish>, are normally sent immediately that their function is + * called, but this is not always possible. <mosquitto_loop> will also attempt + * to send any remaining outgoing messages, which also includes commands that + * are part of the flow for messages with QoS>0. + * + * An alternative approach is to use <mosquitto_loop_start> to run the client + * loop in its own thread. + * + * This calls select() to monitor the client network socket. If you want to + * integrate mosquitto client operation with your own select() call, use + * <mosquitto_socket>, <mosquitto_loop_read>, <mosquitto_loop_write> and + * <mosquitto_loop_misc>. + * + * Threads: + * + * Parameters: + * mosq - a valid mosquitto instance. + * timeout - Maximum number of milliseconds to wait for network activity + * in the select() call before timing out. Set to 0 for instant + * return. Set negative to use the default of 1000ms. + * max_packets - this parameter is currently unused and should be set to 1 for + * future compatibility. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + * MOSQ_ERR_CONN_LOST - if the connection to the broker was lost. + * MOSQ_ERR_PROTOCOL - if there is a protocol error communicating with the + * broker. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * See Also: + * <mosquitto_loop_forever>, <mosquitto_loop_start>, <mosquitto_loop_stop> + */ +libmosq_EXPORT int mosquitto_loop(struct mosquitto *mosq, int timeout, int max_packets); + +/* + * Function: mosquitto_loop_forever + * + * This function call loop() for you in an infinite blocking loop. It is useful + * for the case where you only want to run the MQTT client loop in your + * program. + * + * It handles reconnecting in case server connection is lost. If you call + * mosquitto_disconnect() in a callback it will return. + * + * Parameters: + * mosq - a valid mosquitto instance. + * timeout - Maximum number of milliseconds to wait for network activity + * in the select() call before timing out. Set to 0 for instant + * return. Set negative to use the default of 1000ms. + * max_packets - this parameter is currently unused and should be set to 1 for + * future compatibility. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + * MOSQ_ERR_CONN_LOST - if the connection to the broker was lost. + * MOSQ_ERR_PROTOCOL - if there is a protocol error communicating with the + * broker. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * + * See Also: + * <mosquitto_loop>, <mosquitto_loop_start> + */ +libmosq_EXPORT int mosquitto_loop_forever(struct mosquitto *mosq, int timeout, int max_packets); + +/* + * Function: mosquitto_loop_start + * + * This is part of the threaded client interface. Call this once to start a new + * thread to process network traffic. This provides an alternative to + * repeatedly calling <mosquitto_loop> yourself. + * + * Parameters: + * mosq - a valid mosquitto instance. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOT_SUPPORTED - if thread support is not available. + * + * See Also: + * <mosquitto_connect_async>, <mosquitto_loop>, <mosquitto_loop_forever>, <mosquitto_loop_stop> + */ +libmosq_EXPORT int mosquitto_loop_start(struct mosquitto *mosq); + +/* + * Function: mosquitto_loop_stop + * + * This is part of the threaded client interface. Call this once to stop the + * network thread previously created with <mosquitto_loop_start>. This call + * will block until the network thread finishes. For the network thread to end, + * you must have previously called <mosquitto_disconnect> or have set the force + * parameter to true. + * + * Parameters: + * mosq - a valid mosquitto instance. + * force - set to true to force thread cancellation. If false, + * <mosquitto_disconnect> must have already been called. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOT_SUPPORTED - if thread support is not available. + * + * See Also: + * <mosquitto_loop>, <mosquitto_loop_start> + */ +libmosq_EXPORT int mosquitto_loop_stop(struct mosquitto *mosq, bool force); + + +/* ====================================================================== + * + * Section: Network loop (for use in other event loops) + * + * ====================================================================== */ +/* + * Function: mosquitto_loop_read + * + * Carry out network read operations. + * This should only be used if you are not using mosquitto_loop() and are + * monitoring the client network socket for activity yourself. + * + * Parameters: + * mosq - a valid mosquitto instance. + * max_packets - this parameter is currently unused and should be set to 1 for + * future compatibility. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + * MOSQ_ERR_CONN_LOST - if the connection to the broker was lost. + * MOSQ_ERR_PROTOCOL - if there is a protocol error communicating with the + * broker. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * + * See Also: + * <mosquitto_socket>, <mosquitto_loop_write>, <mosquitto_loop_misc> + */ +libmosq_EXPORT int mosquitto_loop_read(struct mosquitto *mosq, int max_packets); + +/* + * Function: mosquitto_loop_write + * + * Carry out network write operations. + * This should only be used if you are not using mosquitto_loop() and are + * monitoring the client network socket for activity yourself. + * + * Parameters: + * mosq - a valid mosquitto instance. + * max_packets - this parameter is currently unused and should be set to 1 for + * future compatibility. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + * MOSQ_ERR_CONN_LOST - if the connection to the broker was lost. + * MOSQ_ERR_PROTOCOL - if there is a protocol error communicating with the + * broker. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * + * See Also: + * <mosquitto_socket>, <mosquitto_loop_read>, <mosquitto_loop_misc>, <mosquitto_want_write> + */ +libmosq_EXPORT int mosquitto_loop_write(struct mosquitto *mosq, int max_packets); + +/* + * Function: mosquitto_loop_misc + * + * Carry out miscellaneous operations required as part of the network loop. + * This should only be used if you are not using mosquitto_loop() and are + * monitoring the client network socket for activity yourself. + * + * This function deals with handling PINGs and checking whether messages need + * to be retried, so should be called fairly frequently. + * + * Parameters: + * mosq - a valid mosquitto instance. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + * + * See Also: + * <mosquitto_socket>, <mosquitto_loop_read>, <mosquitto_loop_write> + */ +libmosq_EXPORT int mosquitto_loop_misc(struct mosquitto *mosq); + + +/* ====================================================================== + * + * Section: Network loop (helper functions) + * + * ====================================================================== */ +/* + * Function: mosquitto_socket + * + * Return the socket handle for a mosquitto instance. Useful if you want to + * include a mosquitto client in your own select() calls. + * + * Parameters: + * mosq - a valid mosquitto instance. + * + * Returns: + * The socket for the mosquitto client or -1 on failure. + */ +libmosq_EXPORT int mosquitto_socket(struct mosquitto *mosq); + +/* + * Function: mosquitto_want_write + * + * Returns true if there is data ready to be written on the socket. + * + * Parameters: + * mosq - a valid mosquitto instance. + * + * See Also: + * <mosquitto_socket>, <mosquitto_loop_read>, <mosquitto_loop_write> + */ +libmosq_EXPORT bool mosquitto_want_write(struct mosquitto *mosq); + +/* + * Function: mosquitto_threaded_set + * + * Used to tell the library that your application is using threads, but not + * using <mosquitto_loop_start>. The library operates slightly differently when + * not in threaded mode in order to simplify its operation. If you are managing + * your own threads and do not use this function you will experience crashes + * due to race conditions. + * + * When using <mosquitto_loop_start>, this is set automatically. + * + * Parameters: + * mosq - a valid mosquitto instance. + * threaded - true if your application is using threads, false otherwise. + */ +libmosq_EXPORT int mosquitto_threaded_set(struct mosquitto *mosq, bool threaded); + + +/* ====================================================================== + * + * Section: Client options + * + * ====================================================================== */ +/* + * Function: mosquitto_opts_set + * + * Used to set options for the client. + * + * This function is deprecated, the replacement <mosquitto_int_option> and + * <mosquitto_void_option> functions should be used instead. + * + * Parameters: + * mosq - a valid mosquitto instance. + * option - the option to set. + * value - the option specific value. + * + * Options: + * MOSQ_OPT_PROTOCOL_VERSION + * Value must be an int, set to either MQTT_PROTOCOL_V31 or + * MQTT_PROTOCOL_V311. Must be set before the client connects. + * Defaults to MQTT_PROTOCOL_V31. + * + * MOSQ_OPT_SSL_CTX + * Pass an openssl SSL_CTX to be used when creating TLS connections + * rather than libmosquitto creating its own. This must be called + * before connecting to have any effect. If you use this option, the + * onus is on you to ensure that you are using secure settings. + * Setting to NULL means that libmosquitto will use its own SSL_CTX + * if TLS is to be used. + * This option is only available for openssl 1.1.0 and higher. + * + * MOSQ_OPT_SSL_CTX_WITH_DEFAULTS + * Value must be an int set to 1 or 0. If set to 1, then the user + * specified SSL_CTX passed in using MOSQ_OPT_SSL_CTX will have the + * default options applied to it. This means that you only need to + * change the values that are relevant to you. If you use this + * option then you must configure the TLS options as normal, i.e. + * you should use <mosquitto_tls_set> to configure the cafile/capath + * as a minimum. + * This option is only available for openssl 1.1.0 and higher. + */ +libmosq_EXPORT int mosquitto_opts_set(struct mosquitto *mosq, enum mosq_opt_t option, void *value); + +/* + * Function: mosquitto_int_option + * + * Used to set integer options for the client. + * + * Parameters: + * mosq - a valid mosquitto instance. + * option - the option to set. + * value - the option specific value. + * + * Options: + * MOSQ_OPT_PROTOCOL_VERSION + * Value must be set to either MQTT_PROTOCOL_V31, + * MQTT_PROTOCOL_V311, or MQTT_PROTOCOL_V5. Must be set before the + * client connects. Defaults to MQTT_PROTOCOL_V311. + * + * MOSQ_OPT_RECEIVE_MAXIMUM + * Value can be set between 1 and 65535 inclusive, and represents + * the maximum number of incoming QoS 1 and QoS 2 messages that this + * client wants to process at once. Defaults to 20. This option is + * not valid for MQTT v3.1 or v3.1.1 clients. + * Note that if the MQTT_PROP_RECEIVE_MAXIMUM property is in the + * proplist passed to mosquitto_connect_v5(), then that property + * will override this option. Using this option is the recommended + * method however. + * + * MOSQ_OPT_SEND_MAXIMUM + * Value can be set between 1 and 65535 inclusive, and represents + * the maximum number of outgoing QoS 1 and QoS 2 messages that this + * client will attempt to have "in flight" at once. Defaults to 20. + * This option is not valid for MQTT v3.1 or v3.1.1 clients. + * Note that if the broker being connected to sends a + * MQTT_PROP_RECEIVE_MAXIMUM property that has a lower value than + * this option, then the broker provided value will be used. + * + * MOSQ_OPT_SSL_CTX_WITH_DEFAULTS + * If value is set to a non zero value, then the user specified + * SSL_CTX passed in using MOSQ_OPT_SSL_CTX will have the default + * options applied to it. This means that you only need to change + * the values that are relevant to you. If you use this option then + * you must configure the TLS options as normal, i.e. you should + * use <mosquitto_tls_set> to configure the cafile/capath as a + * minimum. + * This option is only available for openssl 1.1.0 and higher. + * MOSQ_OPT_TLS_OCSP_REQUIRED + * Set whether OCSP checking on TLS connections is required. Set to + * 1 to enable checking, or 0 (the default) for no checking. + */ +libmosq_EXPORT int mosquitto_int_option(struct mosquitto *mosq, enum mosq_opt_t option, int value); + + +/* + * Function: mosquitto_void_option + * + * Used to set void* options for the client. + * + * Parameters: + * mosq - a valid mosquitto instance. + * option - the option to set. + * value - the option specific value. + * + * Options: + * MOSQ_OPT_SSL_CTX + * Pass an openssl SSL_CTX to be used when creating TLS connections + * rather than libmosquitto creating its own. This must be called + * before connecting to have any effect. If you use this option, the + * onus is on you to ensure that you are using secure settings. + * Setting to NULL means that libmosquitto will use its own SSL_CTX + * if TLS is to be used. + * This option is only available for openssl 1.1.0 and higher. + */ +libmosq_EXPORT int mosquitto_void_option(struct mosquitto *mosq, enum mosq_opt_t option, void *value); + + +/* + * Function: mosquitto_reconnect_delay_set + * + * Control the behaviour of the client when it has unexpectedly disconnected in + * <mosquitto_loop_forever> or after <mosquitto_loop_start>. The default + * behaviour if this function is not used is to repeatedly attempt to reconnect + * with a delay of 1 second until the connection succeeds. + * + * Use reconnect_delay parameter to change the delay between successive + * reconnection attempts. You may also enable exponential backoff of the time + * between reconnections by setting reconnect_exponential_backoff to true and + * set an upper bound on the delay with reconnect_delay_max. + * + * Example 1: + * delay=2, delay_max=10, exponential_backoff=False + * Delays would be: 2, 4, 6, 8, 10, 10, ... + * + * Example 2: + * delay=3, delay_max=30, exponential_backoff=True + * Delays would be: 3, 6, 12, 24, 30, 30, ... + * + * Parameters: + * mosq - a valid mosquitto instance. + * reconnect_delay - the number of seconds to wait between + * reconnects. + * reconnect_delay_max - the maximum number of seconds to wait + * between reconnects. + * reconnect_exponential_backoff - use exponential backoff between + * reconnect attempts. Set to true to enable + * exponential backoff. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + */ +libmosq_EXPORT int mosquitto_reconnect_delay_set(struct mosquitto *mosq, unsigned int reconnect_delay, unsigned int reconnect_delay_max, bool reconnect_exponential_backoff); + +/* + * Function: mosquitto_max_inflight_messages_set + * + * This function is deprected. Use the <mosquitto_int_option> function with the + * MOSQ_OPT_SEND_MAXIMUM option instead. + * + * Set the number of QoS 1 and 2 messages that can be "in flight" at one time. + * An in flight message is part way through its delivery flow. Attempts to send + * further messages with <mosquitto_publish> will result in the messages being + * queued until the number of in flight messages reduces. + * + * A higher number here results in greater message throughput, but if set + * higher than the maximum in flight messages on the broker may lead to + * delays in the messages being acknowledged. + * + * Set to 0 for no maximum. + * + * Parameters: + * mosq - a valid mosquitto instance. + * max_inflight_messages - the maximum number of inflight messages. Defaults + * to 20. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + */ +libmosq_EXPORT int mosquitto_max_inflight_messages_set(struct mosquitto *mosq, unsigned int max_inflight_messages); + +/* + * Function: mosquitto_message_retry_set + * + * This function now has no effect. + */ +libmosq_EXPORT void mosquitto_message_retry_set(struct mosquitto *mosq, unsigned int message_retry); + +/* + * Function: mosquitto_user_data_set + * + * When <mosquitto_new> is called, the pointer given as the "obj" parameter + * will be passed to the callbacks as user data. The <mosquitto_user_data_set> + * function allows this obj parameter to be updated at any time. This function + * will not modify the memory pointed to by the current user data pointer. If + * it is dynamically allocated memory you must free it yourself. + * + * Parameters: + * mosq - a valid mosquitto instance. + * obj - A user pointer that will be passed as an argument to any callbacks + * that are specified. + */ +libmosq_EXPORT void mosquitto_user_data_set(struct mosquitto *mosq, void *obj); + +/* Function: mosquitto_userdata + * + * Retrieve the "userdata" variable for a mosquitto client. + * + * Parameters: + * mosq - a valid mosquitto instance. + * + * Returns: + * A pointer to the userdata member variable. + */ +libmosq_EXPORT void *mosquitto_userdata(struct mosquitto *mosq); + + +/* ====================================================================== + * + * Section: TLS support + * + * ====================================================================== */ +/* + * Function: mosquitto_tls_set + * + * Configure the client for certificate based SSL/TLS support. Must be called + * before <mosquitto_connect>. + * + * Cannot be used in conjunction with <mosquitto_tls_psk_set>. + * + * Define the Certificate Authority certificates to be trusted (ie. the server + * certificate must be signed with one of these certificates) using cafile. + * + * If the server you are connecting to requires clients to provide a + * certificate, define certfile and keyfile with your client certificate and + * private key. If your private key is encrypted, provide a password callback + * function or you will have to enter the password at the command line. + * + * Parameters: + * mosq - a valid mosquitto instance. + * cafile - path to a file containing the PEM encoded trusted CA + * certificate files. Either cafile or capath must not be NULL. + * capath - path to a directory containing the PEM encoded trusted CA + * certificate files. See mosquitto.conf for more details on + * configuring this directory. Either cafile or capath must not + * be NULL. + * certfile - path to a file containing the PEM encoded certificate file + * for this client. If NULL, keyfile must also be NULL and no + * client certificate will be used. + * keyfile - path to a file containing the PEM encoded private key for + * this client. If NULL, certfile must also be NULL and no + * client certificate will be used. + * pw_callback - if keyfile is encrypted, set pw_callback to allow your client + * to pass the correct password for decryption. If set to NULL, + * the password must be entered on the command line. + * Your callback must write the password into "buf", which is + * "size" bytes long. The return value must be the length of the + * password. "userdata" will be set to the calling mosquitto + * instance. The mosquitto userdata member variable can be + * retrieved using <mosquitto_userdata>. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * + * See Also: + * <mosquitto_tls_opts_set>, <mosquitto_tls_psk_set>, + * <mosquitto_tls_insecure_set>, <mosquitto_userdata> + */ +libmosq_EXPORT int mosquitto_tls_set(struct mosquitto *mosq, + const char *cafile, const char *capath, + const char *certfile, const char *keyfile, + int (*pw_callback)(char *buf, int size, int rwflag, void *userdata)); + +/* + * Function: mosquitto_tls_insecure_set + * + * Configure verification of the server hostname in the server certificate. If + * value is set to true, it is impossible to guarantee that the host you are + * connecting to is not impersonating your server. This can be useful in + * initial server testing, but makes it possible for a malicious third party to + * impersonate your server through DNS spoofing, for example. + * Do not use this function in a real system. Setting value to true makes the + * connection encryption pointless. + * Must be called before <mosquitto_connect>. + * + * Parameters: + * mosq - a valid mosquitto instance. + * value - if set to false, the default, certificate hostname checking is + * performed. If set to true, no hostname checking is performed and + * the connection is insecure. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * + * See Also: + * <mosquitto_tls_set> + */ +libmosq_EXPORT int mosquitto_tls_insecure_set(struct mosquitto *mosq, bool value); + +/* + * Function: mosquitto_tls_opts_set + * + * Set advanced SSL/TLS options. Must be called before <mosquitto_connect>. + * + * Parameters: + * mosq - a valid mosquitto instance. + * cert_reqs - an integer defining the verification requirements the client + * will impose on the server. This can be one of: + * * SSL_VERIFY_NONE (0): the server will not be verified in any way. + * * SSL_VERIFY_PEER (1): the server certificate will be verified + * and the connection aborted if the verification fails. + * The default and recommended value is SSL_VERIFY_PEER. Using + * SSL_VERIFY_NONE provides no security. + * tls_version - the version of the SSL/TLS protocol to use as a string. If NULL, + * the default value is used. The default value and the + * available values depend on the version of openssl that the + * library was compiled against. For openssl >= 1.0.1, the + * available options are tlsv1.2, tlsv1.1 and tlsv1, with tlv1.2 + * as the default. For openssl < 1.0.1, only tlsv1 is available. + * ciphers - a string describing the ciphers available for use. See the + * "openssl ciphers" tool for more information. If NULL, the + * default ciphers will be used. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * + * See Also: + * <mosquitto_tls_set> + */ +libmosq_EXPORT int mosquitto_tls_opts_set(struct mosquitto *mosq, int cert_reqs, const char *tls_version, const char *ciphers); + +/* + * Function: mosquitto_tls_psk_set + * + * Configure the client for pre-shared-key based TLS support. Must be called + * before <mosquitto_connect>. + * + * Cannot be used in conjunction with <mosquitto_tls_set>. + * + * Parameters: + * mosq - a valid mosquitto instance. + * psk - the pre-shared-key in hex format with no leading "0x". + * identity - the identity of this client. May be used as the username + * depending on the server settings. + * ciphers - a string describing the PSK ciphers available for use. See the + * "openssl ciphers" tool for more information. If NULL, the + * default ciphers will be used. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * + * See Also: + * <mosquitto_tls_set> + */ +libmosq_EXPORT int mosquitto_tls_psk_set(struct mosquitto *mosq, const char *psk, const char *identity, const char *ciphers); + + +/* ====================================================================== + * + * Section: Callbacks + * + * ====================================================================== */ +/* + * Function: mosquitto_connect_callback_set + * + * Set the connect callback. This is called when the broker sends a CONNACK + * message in response to a connection. + * + * Parameters: + * mosq - a valid mosquitto instance. + * on_connect - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj, int rc) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in <mosquitto_new> + * rc - the return code of the connection response, one of: + * + * * 0 - success + * * 1 - connection refused (unacceptable protocol version) + * * 2 - connection refused (identifier rejected) + * * 3 - connection refused (broker unavailable) + * * 4-255 - reserved for future use + */ +libmosq_EXPORT void mosquitto_connect_callback_set(struct mosquitto *mosq, void (*on_connect)(struct mosquitto *, void *, int)); + +/* + * Function: mosquitto_connect_with_flags_callback_set + * + * Set the connect callback. This is called when the broker sends a CONNACK + * message in response to a connection. + * + * Parameters: + * mosq - a valid mosquitto instance. + * on_connect - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj, int rc) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in <mosquitto_new> + * rc - the return code of the connection response, one of: + * flags - the connect flags. + * + * * 0 - success + * * 1 - connection refused (unacceptable protocol version) + * * 2 - connection refused (identifier rejected) + * * 3 - connection refused (broker unavailable) + * * 4-255 - reserved for future use + */ +libmosq_EXPORT void mosquitto_connect_with_flags_callback_set(struct mosquitto *mosq, void (*on_connect)(struct mosquitto *, void *, int, int)); + +/* + * Function: mosquitto_connect_v5_callback_set + * + * Set the connect callback. This is called when the broker sends a CONNACK + * message in response to a connection. + * + * Parameters: + * mosq - a valid mosquitto instance. + * on_connect - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj, int rc) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in <mosquitto_new> + * rc - the return code of the connection response, one of: + * * 0 - success + * * 1 - connection refused (unacceptable protocol version) + * * 2 - connection refused (identifier rejected) + * * 3 - connection refused (broker unavailable) + * * 4-255 - reserved for future use + * flags - the connect flags. + * props - list of MQTT 5 properties, or NULL + * + */ +libmosq_EXPORT void mosquitto_connect_v5_callback_set(struct mosquitto *mosq, void (*on_connect)(struct mosquitto *, void *, int, int, const mosquitto_property *props)); + +/* + * Function: mosquitto_disconnect_callback_set + * + * Set the disconnect callback. This is called when the broker has received the + * DISCONNECT command and has disconnected the client. + * + * Parameters: + * mosq - a valid mosquitto instance. + * on_disconnect - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in <mosquitto_new> + * rc - integer value indicating the reason for the disconnect. A value of 0 + * means the client has called <mosquitto_disconnect>. Any other value + * indicates that the disconnect is unexpected. + */ +libmosq_EXPORT void mosquitto_disconnect_callback_set(struct mosquitto *mosq, void (*on_disconnect)(struct mosquitto *, void *, int)); + +/* + * Function: mosquitto_disconnect_v5_callback_set + * + * Set the disconnect callback. This is called when the broker has received the + * DISCONNECT command and has disconnected the client. + * + * Parameters: + * mosq - a valid mosquitto instance. + * on_disconnect - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in <mosquitto_new> + * rc - integer value indicating the reason for the disconnect. A value of 0 + * means the client has called <mosquitto_disconnect>. Any other value + * indicates that the disconnect is unexpected. + * props - list of MQTT 5 properties, or NULL + */ +libmosq_EXPORT void mosquitto_disconnect_v5_callback_set(struct mosquitto *mosq, void (*on_disconnect)(struct mosquitto *, void *, int, const mosquitto_property *)); + +/* + * Function: mosquitto_publish_callback_set + * + * Set the publish callback. This is called when a message initiated with + * <mosquitto_publish> has been sent to the broker successfully. + * + * Parameters: + * mosq - a valid mosquitto instance. + * on_publish - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj, int mid) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in <mosquitto_new> + * mid - the message id of the sent message. + */ +libmosq_EXPORT void mosquitto_publish_callback_set(struct mosquitto *mosq, void (*on_publish)(struct mosquitto *, void *, int)); + +/* + * Function: mosquitto_publish_v5_callback_set + * + * Set the publish callback. This is called when a message initiated with + * <mosquitto_publish> has been sent to the broker. This callback will be + * called both if the message is sent successfully, or if the broker responded + * with an error, which will be reflected in the reason_code parameter. + * + * Parameters: + * mosq - a valid mosquitto instance. + * on_publish - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj, int mid) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in <mosquitto_new> + * mid - the message id of the sent message. + * reason_code - the MQTT 5 reason code + * props - list of MQTT 5 properties, or NULL + */ +libmosq_EXPORT void mosquitto_publish_v5_callback_set(struct mosquitto *mosq, void (*on_publish)(struct mosquitto *, void *, int, int, const mosquitto_property *)); + +/* + * Function: mosquitto_message_callback_set + * + * Set the message callback. This is called when a message is received from the + * broker. + * + * Parameters: + * mosq - a valid mosquitto instance. + * on_message - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in <mosquitto_new> + * message - the message data. This variable and associated memory will be + * freed by the library after the callback completes. The client + * should make copies of any of the data it requires. + * + * See Also: + * <mosquitto_message_copy> + */ +libmosq_EXPORT void mosquitto_message_callback_set(struct mosquitto *mosq, void (*on_message)(struct mosquitto *, void *, const struct mosquitto_message *)); + +/* + * Function: mosquitto_message_v5_callback_set + * + * Set the message callback. This is called when a message is received from the + * broker. + * + * Parameters: + * mosq - a valid mosquitto instance. + * on_message - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in <mosquitto_new> + * message - the message data. This variable and associated memory will be + * freed by the library after the callback completes. The client + * should make copies of any of the data it requires. + * props - list of MQTT 5 properties, or NULL + * + * See Also: + * <mosquitto_message_copy> + */ +libmosq_EXPORT void mosquitto_message_v5_callback_set(struct mosquitto *mosq, void (*on_message)(struct mosquitto *, void *, const struct mosquitto_message *, const mosquitto_property *)); + +/* + * Function: mosquitto_subscribe_callback_set + * + * Set the subscribe callback. This is called when the broker responds to a + * subscription request. + * + * Parameters: + * mosq - a valid mosquitto instance. + * on_subscribe - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in <mosquitto_new> + * mid - the message id of the subscribe message. + * qos_count - the number of granted subscriptions (size of granted_qos). + * granted_qos - an array of integers indicating the granted QoS for each of + * the subscriptions. + */ +libmosq_EXPORT void mosquitto_subscribe_callback_set(struct mosquitto *mosq, void (*on_subscribe)(struct mosquitto *, void *, int, int, const int *)); + +/* + * Function: mosquitto_subscribe_v5_callback_set + * + * Set the subscribe callback. This is called when the broker responds to a + * subscription request. + * + * Parameters: + * mosq - a valid mosquitto instance. + * on_subscribe - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in <mosquitto_new> + * mid - the message id of the subscribe message. + * qos_count - the number of granted subscriptions (size of granted_qos). + * granted_qos - an array of integers indicating the granted QoS for each of + * the subscriptions. + * props - list of MQTT 5 properties, or NULL + */ +libmosq_EXPORT void mosquitto_subscribe_v5_callback_set(struct mosquitto *mosq, void (*on_subscribe)(struct mosquitto *, void *, int, int, const int *, const mosquitto_property *)); + +/* + * Function: mosquitto_unsubscribe_callback_set + * + * Set the unsubscribe callback. This is called when the broker responds to a + * unsubscription request. + * + * Parameters: + * mosq - a valid mosquitto instance. + * on_unsubscribe - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj, int mid) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in <mosquitto_new> + * mid - the message id of the unsubscribe message. + */ +libmosq_EXPORT void mosquitto_unsubscribe_callback_set(struct mosquitto *mosq, void (*on_unsubscribe)(struct mosquitto *, void *, int)); + +/* + * Function: mosquitto_unsubscribe_v5_callback_set + * + * Set the unsubscribe callback. This is called when the broker responds to a + * unsubscription request. + * + * Parameters: + * mosq - a valid mosquitto instance. + * on_unsubscribe - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj, int mid) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in <mosquitto_new> + * mid - the message id of the unsubscribe message. + * props - list of MQTT 5 properties, or NULL + */ +libmosq_EXPORT void mosquitto_unsubscribe_v5_callback_set(struct mosquitto *mosq, void (*on_unsubscribe)(struct mosquitto *, void *, int, const mosquitto_property *)); + +/* + * Function: mosquitto_log_callback_set + * + * Set the logging callback. This should be used if you want event logging + * information from the client library. + * + * mosq - a valid mosquitto instance. + * on_log - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj, int level, const char *str) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in <mosquitto_new> + * level - the log message level from the values: + * MOSQ_LOG_INFO + * MOSQ_LOG_NOTICE + * MOSQ_LOG_WARNING + * MOSQ_LOG_ERR + * MOSQ_LOG_DEBUG + * str - the message string. + */ +libmosq_EXPORT void mosquitto_log_callback_set(struct mosquitto *mosq, void (*on_log)(struct mosquitto *, void *, int, const char *)); + +/* + * Function: mosquitto_string_option + * + * Used to set const char* options for the client. + * + * Parameters: + * mosq - a valid mosquitto instance. + * option - the option to set. + * value - the option specific value. + * + * Options: + * MOSQ_OPT_TLS_ENGINE + * Configure the client for TLS Engine support. Pass a TLS Engine ID + * to be used when creating TLS connections. + * Must be set before <mosquitto_connect>. + * MOSQ_OPT_TLS_KEYFORM + * Configure the client to treat the keyfile differently depending + * on its type. Must be set before <mosquitto_connect>. + * Set as either "pem" or "engine", to determine from where the + * private key for a TLS connection will be obtained. Defaults to + * "pem", a normal private key file. + * MOSQ_OPT_TLS_KPASS_SHA1 + * Where the TLS Engine requires the use of a password to be + * accessed, this option allows a hex encoded SHA1 hash of the + * private key password to be passed to the engine directly. + * Must be set before <mosquitto_connect>. + * MOSQ_OPT_TLS_ALPN + * If the broker being connected to has multiple services available + * on a single TLS port, such as both MQTT and WebSockets, use this + * option to configure the ALPN option for the connection. + */ +libmosq_EXPORT int mosquitto_string_option(struct mosquitto *mosq, enum mosq_opt_t option, const char *value); + + +/* + * Function: mosquitto_reconnect_delay_set + * + * Control the behaviour of the client when it has unexpectedly disconnected in + * <mosquitto_loop_forever> or after <mosquitto_loop_start>. The default + * behaviour if this function is not used is to repeatedly attempt to reconnect + * with a delay of 1 second until the connection succeeds. + * + * Use reconnect_delay parameter to change the delay between successive + * reconnection attempts. You may also enable exponential backoff of the time + * between reconnections by setting reconnect_exponential_backoff to true and + * set an upper bound on the delay with reconnect_delay_max. + * + * Example 1: + * delay=2, delay_max=10, exponential_backoff=False + * Delays would be: 2, 4, 6, 8, 10, 10, ... + * + * Example 2: + * delay=3, delay_max=30, exponential_backoff=True + * Delays would be: 3, 6, 12, 24, 30, 30, ... + * + * Parameters: + * mosq - a valid mosquitto instance. + * reconnect_delay - the number of seconds to wait between + * reconnects. + * reconnect_delay_max - the maximum number of seconds to wait + * between reconnects. + * reconnect_exponential_backoff - use exponential backoff between + * reconnect attempts. Set to true to enable + * exponential backoff. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + */ +libmosq_EXPORT int mosquitto_reconnect_delay_set(struct mosquitto *mosq, unsigned int reconnect_delay, unsigned int reconnect_delay_max, bool reconnect_exponential_backoff); + + +/* ============================================================================= + * + * Section: SOCKS5 proxy functions + * + * ============================================================================= + */ + +/* + * Function: mosquitto_socks5_set + * + * Configure the client to use a SOCKS5 proxy when connecting. Must be called + * before connecting. "None" and "username/password" authentication is + * supported. + * + * Parameters: + * mosq - a valid mosquitto instance. + * host - the SOCKS5 proxy host to connect to. + * port - the SOCKS5 proxy port to use. + * username - if not NULL, use this username when authenticating with the proxy. + * password - if not NULL and username is not NULL, use this password when + * authenticating with the proxy. + */ +libmosq_EXPORT int mosquitto_socks5_set(struct mosquitto *mosq, const char *host, int port, const char *username, const char *password); + + +/* ============================================================================= + * + * Section: Utility functions + * + * ============================================================================= + */ + +/* + * Function: mosquitto_strerror + * + * Call to obtain a const string description of a mosquitto error number. + * + * Parameters: + * mosq_errno - a mosquitto error number. + * + * Returns: + * A constant string describing the error. + */ +libmosq_EXPORT const char *mosquitto_strerror(int mosq_errno); + +/* + * Function: mosquitto_connack_string + * + * Call to obtain a const string description of an MQTT connection result. + * + * Parameters: + * connack_code - an MQTT connection result. + * + * Returns: + * A constant string describing the result. + */ +libmosq_EXPORT const char *mosquitto_connack_string(int connack_code); + +/* + * Function: mosquitto_reason_string + * + * Call to obtain a const string description of an MQTT reason code. + * + * Parameters: + * reason_code - an MQTT reason code. + * + * Returns: + * A constant string describing the reason. + */ +libmosq_EXPORT const char *mosquitto_reason_string(int reason_code); + +/* Function: mosquitto_string_to_command + * + * Take a string input representing an MQTT command and convert it to the + * libmosquitto integer representation. + * + * Parameters: + * str - the string to parse. + * cmd - pointer to an int, for the result. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success + * MOSQ_ERR_INVAL - on an invalid input. + * + * Example: + * mosquitto_string_to_command("CONNECT", &cmd); + * // cmd == CMD_CONNECT + */ +libmosq_EXPORT int mosquitto_string_to_command(const char *str, int *cmd); + +/* + * Function: mosquitto_sub_topic_tokenise + * + * Tokenise a topic or subscription string into an array of strings + * representing the topic hierarchy. + * + * For example: + * + * subtopic: "a/deep/topic/hierarchy" + * + * Would result in: + * + * topics[0] = "a" + * topics[1] = "deep" + * topics[2] = "topic" + * topics[3] = "hierarchy" + * + * and: + * + * subtopic: "/a/deep/topic/hierarchy/" + * + * Would result in: + * + * topics[0] = NULL + * topics[1] = "a" + * topics[2] = "deep" + * topics[3] = "topic" + * topics[4] = "hierarchy" + * + * Parameters: + * subtopic - the subscription/topic to tokenise + * topics - a pointer to store the array of strings + * count - an int pointer to store the number of items in the topics array. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_MALFORMED_UTF8 - if the topic is not valid UTF-8 + * + * Example: + * + * > char **topics; + * > int topic_count; + * > int i; + * > + * > mosquitto_sub_topic_tokenise("$SYS/broker/uptime", &topics, &topic_count); + * > + * > for(i=0; i<token_count; i++){ + * > printf("%d: %s\n", i, topics[i]); + * > } + * + * See Also: + * <mosquitto_sub_topic_tokens_free> + */ +libmosq_EXPORT int mosquitto_sub_topic_tokenise(const char *subtopic, char ***topics, int *count); + +/* + * Function: mosquitto_sub_topic_tokens_free + * + * Free memory that was allocated in <mosquitto_sub_topic_tokenise>. + * + * Parameters: + * topics - pointer to string array. + * count - count of items in string array. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * + * See Also: + * <mosquitto_sub_topic_tokenise> + */ +libmosq_EXPORT int mosquitto_sub_topic_tokens_free(char ***topics, int count); + +/* + * Function: mosquitto_topic_matches_sub + * Function: mosquitto_topic_matches_sub2 + * + * Check whether a topic matches a subscription. + * + * For example: + * + * foo/bar would match the subscription foo/# or +/bar + * non/matching would not match the subscription non/+/+ + * + * Parameters: + * sub - subscription string to check topic against. + * sublen - length in bytes of sub string + * topic - topic to check. + * topiclen - length in bytes of topic string + * result - bool pointer to hold result. Will be set to true if the topic + * matches the subscription. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + */ +libmosq_EXPORT int mosquitto_topic_matches_sub(const char *sub, const char *topic, bool *result); +libmosq_EXPORT int mosquitto_topic_matches_sub2(const char *sub, size_t sublen, const char *topic, size_t topiclen, bool *result); + +/* + * Function: mosquitto_pub_topic_check + * + * Check whether a topic to be used for publishing is valid. + * + * This searches for + or # in a topic and checks its length. + * + * This check is already carried out in <mosquitto_publish> and + * <mosquitto_will_set>, there is no need to call it directly before them. It + * may be useful if you wish to check the validity of a topic in advance of + * making a connection for example. + * + * Parameters: + * topic - the topic to check + * topiclen - length of the topic in bytes + * + * Returns: + * MOSQ_ERR_SUCCESS - for a valid topic + * MOSQ_ERR_INVAL - if the topic contains a + or a #, or if it is too long. + * MOSQ_ERR_MALFORMED_UTF8 - if sub or topic is not valid UTF-8 + * + * See Also: + * <mosquitto_sub_topic_check> + */ +libmosq_EXPORT int mosquitto_pub_topic_check(const char *topic); +libmosq_EXPORT int mosquitto_pub_topic_check2(const char *topic, size_t topiclen); + +/* + * Function: mosquitto_sub_topic_check + * + * Check whether a topic to be used for subscribing is valid. + * + * This searches for + or # in a topic and checks that they aren't in invalid + * positions, such as with foo/#/bar, foo/+bar or foo/bar#, and checks its + * length. + * + * This check is already carried out in <mosquitto_subscribe> and + * <mosquitto_unsubscribe>, there is no need to call it directly before them. + * It may be useful if you wish to check the validity of a topic in advance of + * making a connection for example. + * + * Parameters: + * topic - the topic to check + * topiclen - the length in bytes of the topic + * + * Returns: + * MOSQ_ERR_SUCCESS - for a valid topic + * MOSQ_ERR_INVAL - if the topic contains a + or a # that is in an + * invalid position, or if it is too long. + * MOSQ_ERR_MALFORMED_UTF8 - if topic is not valid UTF-8 + * + * See Also: + * <mosquitto_sub_topic_check> + */ +libmosq_EXPORT int mosquitto_sub_topic_check(const char *topic); +libmosq_EXPORT int mosquitto_sub_topic_check2(const char *topic, size_t topiclen); + + +struct libmosquitto_will { + char *topic; + void *payload; + int payloadlen; + int qos; + bool retain; +}; + +struct libmosquitto_auth { + char *username; + char *password; +}; + +struct libmosquitto_tls { + char *cafile; + char *capath; + char *certfile; + char *keyfile; + char *ciphers; + char *tls_version; + int (*pw_callback)(char *buf, int size, int rwflag, void *userdata); + int cert_reqs; +}; + +/* + * Function: mosquitto_subscribe_simple + * + * Helper function to make subscribing to a topic and retrieving some messages + * very straightforward. + * + * This connects to a broker, subscribes to a topic, waits for msg_count + * messages to be received, then returns after disconnecting cleanly. + * + * Parameters: + * messages - pointer to a "struct mosquitto_message *". The received + * messages will be returned here. On error, this will be set to + * NULL. + * msg_count - the number of messages to retrieve. + * want_retained - if set to true, stale retained messages will be treated as + * normal messages with regards to msg_count. If set to + * false, they will be ignored. + * topic - the subscription topic to use (wildcards are allowed). + * qos - the qos to use for the subscription. + * host - the broker to connect to. + * port - the network port the broker is listening on. + * client_id - the client id to use, or NULL if a random client id should be + * generated. + * keepalive - the MQTT keepalive value. + * clean_session - the MQTT clean session flag. + * username - the username string, or NULL for no username authentication. + * password - the password string, or NULL for an empty password. + * will - a libmosquitto_will struct containing will information, or NULL for + * no will. + * tls - a libmosquitto_tls struct containing TLS related parameters, or NULL + * for no use of TLS. + * + * + * Returns: + * MOSQ_ERR_SUCCESS - on success + * >0 - on error. + */ +libmosq_EXPORT int mosquitto_subscribe_simple( + struct mosquitto_message **messages, + int msg_count, + bool want_retained, + const char *topic, + int qos, + const char *host, + int port, + const char *client_id, + int keepalive, + bool clean_session, + const char *username, + const char *password, + const struct libmosquitto_will *will, + const struct libmosquitto_tls *tls); + + +/* + * Function: mosquitto_subscribe_callback + * + * Helper function to make subscribing to a topic and processing some messages + * very straightforward. + * + * This connects to a broker, subscribes to a topic, then passes received + * messages to a user provided callback. If the callback returns a 1, it then + * disconnects cleanly and returns. + * + * Parameters: + * callback - a callback function in the following form: + * int callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message) + * Note that this is the same as the normal on_message callback, + * except that it returns an int. + * userdata - user provided pointer that will be passed to the callback. + * topic - the subscription topic to use (wildcards are allowed). + * qos - the qos to use for the subscription. + * host - the broker to connect to. + * port - the network port the broker is listening on. + * client_id - the client id to use, or NULL if a random client id should be + * generated. + * keepalive - the MQTT keepalive value. + * clean_session - the MQTT clean session flag. + * username - the username string, or NULL for no username authentication. + * password - the password string, or NULL for an empty password. + * will - a libmosquitto_will struct containing will information, or NULL for + * no will. + * tls - a libmosquitto_tls struct containing TLS related parameters, or NULL + * for no use of TLS. + * + * + * Returns: + * MOSQ_ERR_SUCCESS - on success + * >0 - on error. + */ +libmosq_EXPORT int mosquitto_subscribe_callback( + int (*callback)(struct mosquitto *, void *, const struct mosquitto_message *), + void *userdata, + const char *topic, + int qos, + const char *host, + int port, + const char *client_id, + int keepalive, + bool clean_session, + const char *username, + const char *password, + const struct libmosquitto_will *will, + const struct libmosquitto_tls *tls); + + +/* + * Function: mosquitto_validate_utf8 + * + * Helper function to validate whether a UTF-8 string is valid, according to + * the UTF-8 spec and the MQTT additions. + * + * Parameters: + * str - a string to check + * len - the length of the string in bytes + * + * Returns: + * MOSQ_ERR_SUCCESS - on success + * MOSQ_ERR_INVAL - if str is NULL or len<0 or len>65536 + * MOSQ_ERR_MALFORMED_UTF8 - if str is not valid UTF-8 + */ +libmosq_EXPORT int mosquitto_validate_utf8(const char *str, int len); + + +/* ============================================================================= + * + * Section: Properties + * + * ============================================================================= + */ + + +/* + * Function: mosquitto_property_add_byte + * + * Add a new byte property to a property list. + * + * If *proplist == NULL, a new list will be created, otherwise the new property + * will be appended to the list. + * + * Parameters: + * proplist - pointer to mosquitto_property pointer, the list of properties + * identifier - property identifier (e.g. MQTT_PROP_PAYLOAD_FORMAT_INDICATOR) + * value - integer value for the new property + * + * Returns: + * MOSQ_ERR_SUCCESS - on success + * MOSQ_ERR_INVAL - if identifier is invalid, or if proplist is NULL + * MOSQ_ERR_NOMEM - on out of memory + * + * Example: + * mosquitto_property *proplist = NULL; + * mosquitto_property_add_byte(&proplist, MQTT_PROP_PAYLOAD_FORMAT_IDENTIFIER, 1); + */ +libmosq_EXPORT int mosquitto_property_add_byte(mosquitto_property **proplist, int identifier, uint8_t value); + +/* + * Function: mosquitto_property_add_int16 + * + * Add a new int16 property to a property list. + * + * If *proplist == NULL, a new list will be created, otherwise the new property + * will be appended to the list. + * + * Parameters: + * proplist - pointer to mosquitto_property pointer, the list of properties + * identifier - property identifier (e.g. MQTT_PROP_RECEIVE_MAXIMUM) + * value - integer value for the new property + * + * Returns: + * MOSQ_ERR_SUCCESS - on success + * MOSQ_ERR_INVAL - if identifier is invalid, or if proplist is NULL + * MOSQ_ERR_NOMEM - on out of memory + * + * Example: + * mosquitto_property *proplist = NULL; + * mosquitto_property_add_int16(&proplist, MQTT_PROP_RECEIVE_MAXIMUM, 1000); + */ +libmosq_EXPORT int mosquitto_property_add_int16(mosquitto_property **proplist, int identifier, uint16_t value); + +/* + * Function: mosquitto_property_add_int32 + * + * Add a new int32 property to a property list. + * + * If *proplist == NULL, a new list will be created, otherwise the new property + * will be appended to the list. + * + * Parameters: + * proplist - pointer to mosquitto_property pointer, the list of properties + * identifier - property identifier (e.g. MQTT_PROP_MESSAGE_EXPIRY_INTERVAL) + * value - integer value for the new property + * + * Returns: + * MOSQ_ERR_SUCCESS - on success + * MOSQ_ERR_INVAL - if identifier is invalid, or if proplist is NULL + * MOSQ_ERR_NOMEM - on out of memory + * + * Example: + * mosquitto_property *proplist = NULL; + * mosquitto_property_add_int32(&proplist, MQTT_PROP_MESSAGE_EXPIRY_INTERVAL, 86400); + */ +libmosq_EXPORT int mosquitto_property_add_int32(mosquitto_property **proplist, int identifier, uint32_t value); + +/* + * Function: mosquitto_property_add_varint + * + * Add a new varint property to a property list. + * + * If *proplist == NULL, a new list will be created, otherwise the new property + * will be appended to the list. + * + * Parameters: + * proplist - pointer to mosquitto_property pointer, the list of properties + * identifier - property identifier (e.g. MQTT_PROP_SUBSCRIPTION_IDENTIFIER) + * value - integer value for the new property + * + * Returns: + * MOSQ_ERR_SUCCESS - on success + * MOSQ_ERR_INVAL - if identifier is invalid, or if proplist is NULL + * MOSQ_ERR_NOMEM - on out of memory + * + * Example: + * mosquitto_property *proplist = NULL; + * mosquitto_property_add_varint(&proplist, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 1); + */ +libmosq_EXPORT int mosquitto_property_add_varint(mosquitto_property **proplist, int identifier, uint32_t value); + +/* + * Function: mosquitto_property_add_binary + * + * Add a new binary property to a property list. + * + * If *proplist == NULL, a new list will be created, otherwise the new property + * will be appended to the list. + * + * Parameters: + * proplist - pointer to mosquitto_property pointer, the list of properties + * identifier - property identifier (e.g. MQTT_PROP_PAYLOAD_FORMAT_INDICATOR) + * value - pointer to the property data + * len - length of property data in bytes + * + * Returns: + * MOSQ_ERR_SUCCESS - on success + * MOSQ_ERR_INVAL - if identifier is invalid, or if proplist is NULL + * MOSQ_ERR_NOMEM - on out of memory + * + * Example: + * mosquitto_property *proplist = NULL; + * mosquitto_property_add_binary(&proplist, MQTT_PROP_AUTHENTICATION_DATA, auth_data, auth_data_len); + */ +libmosq_EXPORT int mosquitto_property_add_binary(mosquitto_property **proplist, int identifier, const void *value, uint16_t len); + +/* + * Function: mosquitto_property_add_string + * + * Add a new string property to a property list. + * + * If *proplist == NULL, a new list will be created, otherwise the new property + * will be appended to the list. + * + * Parameters: + * proplist - pointer to mosquitto_property pointer, the list of properties + * identifier - property identifier (e.g. MQTT_PROP_CONTENT_TYPE) + * value - string value for the new property, must be UTF-8 and zero terminated + * + * Returns: + * MOSQ_ERR_SUCCESS - on success + * MOSQ_ERR_INVAL - if identifier is invalid, if value is NULL, or if proplist is NULL + * MOSQ_ERR_NOMEM - on out of memory + * MOSQ_ERR_MALFORMED_UTF8 - value is not valid UTF-8. + * + * Example: + * mosquitto_property *proplist = NULL; + * mosquitto_property_add_string(&proplist, MQTT_PROP_CONTENT_TYPE, "application/json"); + */ +libmosq_EXPORT int mosquitto_property_add_string(mosquitto_property **proplist, int identifier, const char *value); + +/* + * Function: mosquitto_property_add_string_pair + * + * Add a new string pair property to a property list. + * + * If *proplist == NULL, a new list will be created, otherwise the new property + * will be appended to the list. + * + * Parameters: + * proplist - pointer to mosquitto_property pointer, the list of properties + * identifier - property identifier (e.g. MQTT_PROP_USER_PROPERTY) + * name - string name for the new property, must be UTF-8 and zero terminated + * value - string value for the new property, must be UTF-8 and zero terminated + * + * Returns: + * MOSQ_ERR_SUCCESS - on success + * MOSQ_ERR_INVAL - if identifier is invalid, if name or value is NULL, or if proplist is NULL + * MOSQ_ERR_NOMEM - on out of memory + * MOSQ_ERR_MALFORMED_UTF8 - if name or value are not valid UTF-8. + * + * Example: + * mosquitto_property *proplist = NULL; + * mosquitto_property_add_string_pair(&proplist, MQTT_PROP_USER_PROPERTY, "client", "mosquitto_pub"); + */ +libmosq_EXPORT int mosquitto_property_add_string_pair(mosquitto_property **proplist, int identifier, const char *name, const char *value); + +/* + * Function: mosquitto_property_read_byte + * + * Attempt to read a byte property matching an identifier, from a property list + * or single property. This function can search for multiple entries of the + * same identifier by using the returned value and skip_first. Note however + * that it is forbidden for most properties to be duplicated. + * + * If the property is not found, *value will not be modified, so it is safe to + * pass a variable with a default value to be potentially overwritten: + * + * uint16_t keepalive = 60; // default value + * // Get value from property list, or keep default if not found. + * mosquitto_property_read_int16(proplist, MQTT_PROP_SERVER_KEEP_ALIVE, &keepalive, false); + * + * Parameters: + * proplist - mosquitto_property pointer, the list of properties or single property + * identifier - property identifier (e.g. MQTT_PROP_PAYLOAD_FORMAT_INDICATOR) + * value - pointer to store the value, or NULL if the value is not required. + * skip_first - boolean that indicates whether the first item in the list + * should be ignored or not. Should usually be set to false. + * + * Returns: + * A valid property pointer if the property is found + * NULL, if the property is not found, or proplist is NULL. + * + * Example: + * // proplist is obtained from a callback + * mosquitto_property *prop; + * prop = mosquitto_property_read_byte(proplist, identifier, &value, false); + * while(prop){ + * printf("value: %s\n", value); + * prop = mosquitto_property_read_byte(prop, identifier, &value); + * } + */ +libmosq_EXPORT const mosquitto_property *mosquitto_property_read_byte( + const mosquitto_property *proplist, + int identifier, + uint8_t *value, + bool skip_first); + +/* + * Function: mosquitto_property_read_int16 + * + * Read an int16 property value from a property. + * + * Parameters: + * property - property to read + * identifier - property identifier (e.g. MQTT_PROP_PAYLOAD_FORMAT_INDICATOR) + * value - pointer to store the value, or NULL if the value is not required. + * skip_first - boolean that indicates whether the first item in the list + * should be ignored or not. Should usually be set to false. + * + * Returns: + * A valid property pointer if the property is found + * NULL, if the property is not found, or proplist is NULL. + * + * Example: + * See <mosquitto_property_read_byte> + */ +libmosq_EXPORT const mosquitto_property *mosquitto_property_read_int16( + const mosquitto_property *proplist, + int identifier, + uint16_t *value, + bool skip_first); + +/* + * Function: mosquitto_property_read_int32 + * + * Read an int32 property value from a property. + * + * Parameters: + * property - pointer to mosquitto_property pointer, the list of properties + * identifier - property identifier (e.g. MQTT_PROP_PAYLOAD_FORMAT_INDICATOR) + * value - pointer to store the value, or NULL if the value is not required. + * skip_first - boolean that indicates whether the first item in the list + * should be ignored or not. Should usually be set to false. + * + * Returns: + * A valid property pointer if the property is found + * NULL, if the property is not found, or proplist is NULL. + * + * Example: + * See <mosquitto_property_read_byte> + */ +libmosq_EXPORT const mosquitto_property *mosquitto_property_read_int32( + const mosquitto_property *proplist, + int identifier, + uint32_t *value, + bool skip_first); + +/* + * Function: mosquitto_property_read_varint + * + * Read a varint property value from a property. + * + * Parameters: + * property - property to read + * identifier - property identifier (e.g. MQTT_PROP_PAYLOAD_FORMAT_INDICATOR) + * value - pointer to store the value, or NULL if the value is not required. + * skip_first - boolean that indicates whether the first item in the list + * should be ignored or not. Should usually be set to false. + * + * Returns: + * A valid property pointer if the property is found + * NULL, if the property is not found, or proplist is NULL. + * + * Example: + * See <mosquitto_property_read_byte> + */ +libmosq_EXPORT const mosquitto_property *mosquitto_property_read_varint( + const mosquitto_property *proplist, + int identifier, + uint32_t *value, + bool skip_first); + +/* + * Function: mosquitto_property_read_binary + * + * Read a binary property value from a property. + * + * On success, value must be free()'d by the application. + * + * Parameters: + * property - property to read + * identifier - property identifier (e.g. MQTT_PROP_PAYLOAD_FORMAT_INDICATOR) + * value - pointer to store the value, or NULL if the value is not required. + * skip_first - boolean that indicates whether the first item in the list + * should be ignored or not. Should usually be set to false. + * + * Returns: + * A valid property pointer if the property is found + * NULL, if the property is not found, or proplist is NULL, or if an out of memory condition occurred. + * + * Example: + * See <mosquitto_property_read_byte> + */ +libmosq_EXPORT const mosquitto_property *mosquitto_property_read_binary( + const mosquitto_property *proplist, + int identifier, + void **value, + uint16_t *len, + bool skip_first); + +/* + * Function: mosquitto_property_read_string + * + * Read a string property value from a property. + * + * On success, value must be free()'d by the application. + * + * Parameters: + * property - property to read + * identifier - property identifier (e.g. MQTT_PROP_PAYLOAD_FORMAT_INDICATOR) + * value - pointer to char*, for the property data to be stored in, or NULL if + * the value is not required. + * skip_first - boolean that indicates whether the first item in the list + * should be ignored or not. Should usually be set to false. + * + * Returns: + * A valid property pointer if the property is found + * NULL, if the property is not found, or proplist is NULL, or if an out of memory condition occurred. + * + * Example: + * See <mosquitto_property_read_byte> + */ +libmosq_EXPORT const mosquitto_property *mosquitto_property_read_string( + const mosquitto_property *proplist, + int identifier, + char **value, + bool skip_first); + +/* + * Function: mosquitto_property_read_string_pair + * + * Read a string pair property value pair from a property. + * + * On success, name and value must be free()'d by the application. + * + * Parameters: + * property - property to read + * identifier - property identifier (e.g. MQTT_PROP_PAYLOAD_FORMAT_INDICATOR) + * name - pointer to char* for the name property data to be stored in, or NULL + * if the name is not required. + * value - pointer to char*, for the property data to be stored in, or NULL if + * the value is not required. + * skip_first - boolean that indicates whether the first item in the list + * should be ignored or not. Should usually be set to false. + * + * Returns: + * A valid property pointer if the property is found + * NULL, if the property is not found, or proplist is NULL, or if an out of memory condition occurred. + * + * Example: + * See <mosquitto_property_read_byte> + */ +libmosq_EXPORT const mosquitto_property *mosquitto_property_read_string_pair( + const mosquitto_property *proplist, + int identifier, + char **name, + char **value, + bool skip_first); + +/* + * Function: mosquitto_property_free_all + * + * Free all properties from a list of properties. Frees the list and sets *properties to NULL. + * + * Parameters: + * properties - list of properties to free + * + * Example: + * mosquitto_properties *properties = NULL; + * // Add properties + * mosquitto_property_free_all(&properties); + */ +libmosq_EXPORT void mosquitto_property_free_all(mosquitto_property **properties); + +/* + * Function: mosquitto_property_copy_all + * + * Parameters: + * dest : pointer for new property list + * src : property list + * + * Returns: + * MOSQ_ERR_SUCCESS - on successful copy + * MOSQ_ERR_INVAL - if dest is NULL + * MOSQ_ERR_NOMEM - on out of memory (dest will be set to NULL) + */ +libmosq_EXPORT int mosquitto_property_copy_all(mosquitto_property **dest, const mosquitto_property *src); + +/* + * Function: mosquitto_property_check_command + * + * Check whether a property identifier is valid for the given command. + * + * Parameters: + * command - MQTT command (e.g. CMD_CONNECT) + * identifier - MQTT property (e.g. MQTT_PROP_USER_PROPERTY) + * + * Returns: + * MOSQ_ERR_SUCCESS - if the identifier is valid for command + * MOSQ_ERR_PROTOCOL - if the identifier is not valid for use with command. + */ +libmosq_EXPORT int mosquitto_property_check_command(int command, int identifier); + + +/* + * Function: mosquitto_property_check_all + * + * Check whether a list of properties are valid for a particular command, + * whether there are duplicates, and whether the values are valid where + * possible. + * + * Note that this function is used internally in the library whenever + * properties are passed to it, so in basic use this is not needed, but should + * be helpful to check property lists *before* the point of using them. + * + * Parameters: + * command - MQTT command (e.g. CMD_CONNECT) + * properties - list of MQTT properties to check. + * + * Returns: + * MOSQ_ERR_SUCCESS - if all properties are valid + * MOSQ_ERR_DUPLICATE_PROPERTY - if a property is duplicated where it is forbidden. + * MOSQ_ERR_PROTOCOL - if any property is invalid + */ +libmosq_EXPORT int mosquitto_property_check_all(int command, const mosquitto_property *properties); + +/* Function: mosquitto_string_to_property_info + * + * Parse a property name string and convert to a property identifier and data type. + * The property name is as defined in the MQTT specification, with - as a + * separator, for example: payload-format-indicator. + * + * Parameters: + * propname - the string to parse + * identifier - pointer to an int to receive the property identifier + * type - pointer to an int to receive the property type + * + * Returns: + * MOSQ_ERR_SUCCESS - on success + * MOSQ_ERR_INVAL - if the string does not match a property + * + * Example: + * mosquitto_string_to_property_info("response-topic", &id, &type); + * // id == MQTT_PROP_RESPONSE_TOPIC + * // type == MQTT_PROP_TYPE_STRING + */ +libmosq_EXPORT int mosquitto_string_to_property_info(const char *propname, int *identifier, int *type); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/mosquitto.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/mosquitto.o new file mode 100644 index 0000000..b88666e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/mosquitto.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/mosquitto_internal.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/mosquitto_internal.h new file mode 100644 index 0000000..ff656a4 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/mosquitto_internal.h @@ -0,0 +1,358 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. + Tatsuzo Osawa - Add epoll. +*/ + +#ifndef MOSQUITTO_INTERNAL_H +#define MOSQUITTO_INTERNAL_H + +#include "config.h" + +#ifdef WIN32 +# include <winsock2.h> +#endif + +#ifdef WITH_TLS +# include <openssl/ssl.h> +#else +# include <time.h> +#endif +#include <stdlib.h> + +#if defined(WITH_THREADING) && !defined(WITH_BROKER) +# include <pthread.h> +#else +# include <dummypthread.h> +#endif + +#ifdef WITH_SRV +# include <ares.h> +#endif + +#ifdef WIN32 +# if _MSC_VER < 1600 + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + typedef unsigned long long uint64_t; +# else +# include <stdint.h> +# endif +#else +# include <stdint.h> +#endif + +#include "mosquitto.h" +#include "time_mosq.h" +#ifdef WITH_BROKER +# ifdef __linux__ +# include <netdb.h> +# endif +# include "uthash.h" +struct mosquitto_client_msg; +#endif + +#ifdef WIN32 +typedef SOCKET mosq_sock_t; +#else +typedef int mosq_sock_t; +#endif + +enum mosquitto_msg_direction { + mosq_md_in = 0, + mosq_md_out = 1 +}; + +enum mosquitto_msg_state { + mosq_ms_invalid = 0, + mosq_ms_publish_qos0 = 1, + mosq_ms_publish_qos1 = 2, + mosq_ms_wait_for_puback = 3, + mosq_ms_publish_qos2 = 4, + mosq_ms_wait_for_pubrec = 5, + mosq_ms_resend_pubrel = 6, + mosq_ms_wait_for_pubrel = 7, + mosq_ms_resend_pubcomp = 8, + mosq_ms_wait_for_pubcomp = 9, + mosq_ms_send_pubrec = 10, + mosq_ms_queued = 11 +}; + +enum mosquitto_client_state { + mosq_cs_new = 0, + mosq_cs_connected = 1, + mosq_cs_disconnecting = 2, + mosq_cs_connect_async = 3, + mosq_cs_connect_pending = 4, + mosq_cs_connect_srv = 5, + mosq_cs_disconnect_ws = 6, + mosq_cs_disconnected = 7, + mosq_cs_socks5_new = 8, + mosq_cs_socks5_start = 9, + mosq_cs_socks5_request = 10, + mosq_cs_socks5_reply = 11, + mosq_cs_socks5_auth_ok = 12, + mosq_cs_socks5_userpass_reply = 13, + mosq_cs_socks5_send_userpass = 14, + mosq_cs_expiring = 15, + mosq_cs_connecting = 16, + mosq_cs_duplicate = 17, /* client that has been taken over by another with the same id */ + mosq_cs_disconnect_with_will = 18, + mosq_cs_disused = 19, /* client that has been added to the disused list to be freed */ + mosq_cs_authenticating = 20, /* Client has sent CONNECT but is still undergoing extended authentication */ + mosq_cs_reauthenticating = 21, /* Client is undergoing reauthentication and shouldn't do anything else until complete */ +}; + +enum mosquitto__protocol { + mosq_p_invalid = 0, + mosq_p_mqtt31 = 1, + mosq_p_mqtt311 = 2, + mosq_p_mqtts = 3, + mosq_p_mqtt5 = 5, +}; + +enum mosquitto__threaded_state { + mosq_ts_none, /* No threads in use */ + mosq_ts_self, /* Threads started by libmosquitto */ + mosq_ts_external /* Threads started by external code */ +}; + +enum mosquitto__transport { + mosq_t_invalid = 0, + mosq_t_tcp = 1, + mosq_t_ws = 2, + mosq_t_sctp = 3 +}; + + +struct mosquitto__alias{ + char *topic; + uint16_t alias; +}; + +struct session_expiry_list { + struct mosquitto *context; + struct session_expiry_list *prev; + struct session_expiry_list *next; +}; + +struct mosquitto__packet{ + uint8_t *payload; + struct mosquitto__packet *next; + uint32_t remaining_mult; + uint32_t remaining_length; + uint32_t packet_length; + uint32_t to_process; + uint32_t pos; + uint16_t mid; + uint8_t command; + int8_t remaining_count; +}; + +struct mosquitto_message_all{ + struct mosquitto_message_all *next; + struct mosquitto_message_all *prev; + mosquitto_property *properties; + time_t timestamp; + //enum mosquitto_msg_direction direction; + enum mosquitto_msg_state state; + bool dup; + struct mosquitto_message msg; + uint32_t expiry_interval; +}; + +#ifdef WITH_TLS +enum mosquitto__keyform { + mosq_k_pem = 0, + mosq_k_engine = 1, +}; +#endif + +struct will_delay_list { + struct mosquitto *context; + struct will_delay_list *prev; + struct will_delay_list *next; +}; + +struct mosquitto_msg_data{ +#ifdef WITH_BROKER + struct mosquitto_client_msg *inflight; + struct mosquitto_client_msg *queued; + unsigned long msg_bytes; + unsigned long msg_bytes12; + int msg_count; + int msg_count12; +#else + struct mosquitto_message_all *inflight; + int queue_len; +# ifdef WITH_THREADING + pthread_mutex_t mutex; +# endif +#endif + int inflight_quota; + uint16_t inflight_maximum; +}; + + +struct mosquitto { + mosq_sock_t sock; +#ifndef WITH_BROKER + mosq_sock_t sockpairR, sockpairW; +#endif +#if defined(__GLIBC__) && defined(WITH_ADNS) + struct gaicb *adns; /* For getaddrinfo_a */ +#endif + enum mosquitto__protocol protocol; + char *address; + char *id; + char *username; + char *password; + uint16_t keepalive; + uint16_t last_mid; + enum mosquitto_client_state state; + time_t last_msg_in; + time_t next_msg_out; + time_t ping_t; + struct mosquitto__packet in_packet; + struct mosquitto__packet *current_out_packet; + struct mosquitto__packet *out_packet; + struct mosquitto_message_all *will; + struct mosquitto__alias *aliases; + struct will_delay_list *will_delay_entry; + uint32_t maximum_packet_size; + int alias_count; + uint32_t will_delay_interval; + time_t will_delay_time; +#ifdef WITH_TLS + SSL *ssl; + SSL_CTX *ssl_ctx; + char *tls_cafile; + char *tls_capath; + char *tls_certfile; + char *tls_keyfile; + int (*tls_pw_callback)(char *buf, int size, int rwflag, void *userdata); + char *tls_version; + char *tls_ciphers; + char *tls_psk; + char *tls_psk_identity; + int tls_cert_reqs; + bool tls_insecure; + bool ssl_ctx_defaults; + bool tls_ocsp_required; + char *tls_engine; + char *tls_engine_kpass_sha1; + enum mosquitto__keyform tls_keyform; + char *tls_alpn; +#endif + bool want_write; + bool want_connect; +#if defined(WITH_THREADING) && !defined(WITH_BROKER) + pthread_mutex_t callback_mutex; + pthread_mutex_t log_callback_mutex; + pthread_mutex_t msgtime_mutex; + pthread_mutex_t out_packet_mutex; + pthread_mutex_t current_out_packet_mutex; + pthread_mutex_t state_mutex; + pthread_mutex_t mid_mutex; + pthread_t thread_id; +#endif + bool clean_start; + uint32_t session_expiry_interval; + time_t session_expiry_time; +#ifdef WITH_BROKER + bool removed_from_by_id; /* True if removed from by_id hash */ + bool is_dropping; + bool is_bridge; + struct mosquitto__bridge *bridge; + struct mosquitto_msg_data msgs_in; + struct mosquitto_msg_data msgs_out; + struct mosquitto__acl_user *acl_list; + struct mosquitto__listener *listener; + struct mosquitto__packet *out_packet_last; + struct mosquitto__subhier **subs; + struct mosquitto__subshared_ref **shared_subs; + char *auth_method; + int sub_count; + int shared_sub_count; + int pollfd_index; +# ifdef WITH_WEBSOCKETS +# if defined(LWS_LIBRARY_VERSION_NUMBER) + struct lws *wsi; +# else + struct libwebsocket_context *ws_context; + struct libwebsocket *wsi; +# endif +# endif + bool ws_want_write; + bool assigned_id; +#else +# ifdef WITH_SOCKS + char *socks5_host; + int socks5_port; + char *socks5_username; + char *socks5_password; +# endif + void *userdata; + bool in_callback; + struct mosquitto_msg_data msgs_in; + struct mosquitto_msg_data msgs_out; + void (*on_connect)(struct mosquitto *, void *userdata, int rc); + void (*on_connect_with_flags)(struct mosquitto *, void *userdata, int rc, int flags); + void (*on_connect_v5)(struct mosquitto *, void *userdata, int rc, int flags, const mosquitto_property *props); + void (*on_disconnect)(struct mosquitto *, void *userdata, int rc); + void (*on_disconnect_v5)(struct mosquitto *, void *userdata, int rc, const mosquitto_property *props); + void (*on_publish)(struct mosquitto *, void *userdata, int mid); + void (*on_publish_v5)(struct mosquitto *, void *userdata, int mid, int reason_code, const mosquitto_property *props); + void (*on_message)(struct mosquitto *, void *userdata, const struct mosquitto_message *message); + void (*on_message_v5)(struct mosquitto *, void *userdata, const struct mosquitto_message *message, const mosquitto_property *props); + void (*on_subscribe)(struct mosquitto *, void *userdata, int mid, int qos_count, const int *granted_qos); + void (*on_subscribe_v5)(struct mosquitto *, void *userdata, int mid, int qos_count, const int *granted_qos, const mosquitto_property *props); + void (*on_unsubscribe)(struct mosquitto *, void *userdata, int mid); + void (*on_unsubscribe_v5)(struct mosquitto *, void *userdata, int mid, const mosquitto_property *props); + void (*on_log)(struct mosquitto *, void *userdata, int level, const char *str); + //void (*on_error)(); + char *host; + int port; + char *bind_address; + unsigned int reconnect_delay; + unsigned int reconnect_delay_max; + bool reconnect_exponential_backoff; + char threaded; + struct mosquitto__packet *out_packet_last; +# ifdef WITH_SRV + ares_channel achan; +# endif + uint16_t send_maximum; + uint16_t receive_maximum; +#endif + uint8_t maximum_qos; + +#ifdef WITH_BROKER + UT_hash_handle hh_id; + UT_hash_handle hh_sock; + struct mosquitto *for_free_next; + struct session_expiry_list *expiry_list_item; +#endif +#ifdef WITH_EPOLL + uint32_t events; +#endif +}; + +#define STREMPTY(str) (str[0] == '\0') + +void do_client_disconnect(struct mosquitto *mosq, int reason_code, const mosquitto_property *properties); + +#endif + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/mqtt_protocol.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/mqtt_protocol.h new file mode 100644 index 0000000..672d50b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/mqtt_protocol.h @@ -0,0 +1,158 @@ +/* +Copyright (c) 2009-2018 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef MQTT_PROTOCOL_H +#define MQTT_PROTOCOL_H + +#define PROTOCOL_NAME_v31 "MQIsdp" +#define PROTOCOL_VERSION_v31 3 + +#define PROTOCOL_NAME "MQTT" + +#define PROTOCOL_VERSION_v311 4 +#define PROTOCOL_VERSION_v5 5 + + +/* Message types */ +#define CMD_CONNECT 0x10 +#define CMD_CONNACK 0x20 +#define CMD_PUBLISH 0x30 +#define CMD_PUBACK 0x40 +#define CMD_PUBREC 0x50 +#define CMD_PUBREL 0x60 +#define CMD_PUBCOMP 0x70 +#define CMD_SUBSCRIBE 0x80 +#define CMD_SUBACK 0x90 +#define CMD_UNSUBSCRIBE 0xA0 +#define CMD_UNSUBACK 0xB0 +#define CMD_PINGREQ 0xC0 +#define CMD_PINGRESP 0xD0 +#define CMD_DISCONNECT 0xE0 +#define CMD_AUTH 0xF0 + +/* Mosquitto only: for distinguishing CONNECT and WILL properties */ +#define CMD_WILL 0x100 + +enum mqtt311_connack_codes { + CONNACK_ACCEPTED = 0, + CONNACK_REFUSED_PROTOCOL_VERSION = 1, + CONNACK_REFUSED_IDENTIFIER_REJECTED = 2, + CONNACK_REFUSED_SERVER_UNAVAILABLE = 3, + CONNACK_REFUSED_BAD_USERNAME_PASSWORD = 4, + CONNACK_REFUSED_NOT_AUTHORIZED = 5, +}; + + +enum mqtt5_return_codes { + MQTT_RC_SUCCESS = 0, /* CONNACK, PUBACK, PUBREC, PUBREL, PUBCOMP, UNSUBACK, AUTH */ + MQTT_RC_NORMAL_DISCONNECTION = 0, /* DISCONNECT */ + MQTT_RC_GRANTED_QOS0 = 0, /* SUBACK */ + MQTT_RC_GRANTED_QOS1 = 1, /* SUBACK */ + MQTT_RC_GRANTED_QOS2 = 2, /* SUBACK */ + MQTT_RC_DISCONNECT_WITH_WILL_MSG = 4, /* DISCONNECT */ + MQTT_RC_NO_MATCHING_SUBSCRIBERS = 16, /* PUBACK, PUBREC */ + MQTT_RC_NO_SUBSCRIPTION_EXISTED = 17, /* UNSUBACK */ + MQTT_RC_CONTINUE_AUTHENTICATION = 24, /* AUTH */ + MQTT_RC_REAUTHENTICATE = 25, /* AUTH */ + + MQTT_RC_UNSPECIFIED = 128, /* CONNACK, PUBACK, PUBREC, SUBACK, UNSUBACK, DISCONNECT */ + MQTT_RC_MALFORMED_PACKET = 129, /* CONNACK, DISCONNECT */ + MQTT_RC_PROTOCOL_ERROR = 130, /* DISCONNECT */ + MQTT_RC_IMPLEMENTATION_SPECIFIC = 131, /* CONNACK, PUBACK, PUBREC, SUBACK, UNSUBACK, DISCONNECT */ + MQTT_RC_UNSUPPORTED_PROTOCOL_VERSION = 132, /* CONNACK */ + MQTT_RC_CLIENTID_NOT_VALID = 133, /* CONNACK */ + MQTT_RC_BAD_USERNAME_OR_PASSWORD = 134, /* CONNACK */ + MQTT_RC_NOT_AUTHORIZED = 135, /* CONNACK, PUBACK, PUBREC, SUBACK, UNSUBACK, DISCONNECT */ + MQTT_RC_SERVER_UNAVAILABLE = 136, /* CONNACK */ + MQTT_RC_SERVER_BUSY = 137, /* CONNACK, DISCONNECT */ + MQTT_RC_BANNED = 138, /* CONNACK */ + MQTT_RC_SERVER_SHUTTING_DOWN = 139, /* DISCONNECT */ + MQTT_RC_BAD_AUTHENTICATION_METHOD = 140, /* CONNACK */ + MQTT_RC_KEEP_ALIVE_TIMEOUT = 141, /* DISCONNECT */ + MQTT_RC_SESSION_TAKEN_OVER = 142, /* DISCONNECT */ + MQTT_RC_TOPIC_FILTER_INVALID = 143, /* SUBACK, UNSUBACK, DISCONNECT */ + MQTT_RC_TOPIC_NAME_INVALID = 144, /* CONNACK, PUBACK, PUBREC, DISCONNECT */ + MQTT_RC_PACKET_ID_IN_USE = 145, /* PUBACK, SUBACK, UNSUBACK */ + MQTT_RC_PACKET_ID_NOT_FOUND = 146, /* PUBREL, PUBCOMP */ + MQTT_RC_RECEIVE_MAXIMUM_EXCEEDED = 147, /* DISCONNECT */ + MQTT_RC_TOPIC_ALIAS_INVALID = 148, /* DISCONNECT */ + MQTT_RC_PACKET_TOO_LARGE = 149, /* CONNACK, PUBACK, PUBREC, DISCONNECT */ + MQTT_RC_MESSAGE_RATE_TOO_HIGH = 150, /* DISCONNECT */ + MQTT_RC_QUOTA_EXCEEDED = 151, /* PUBACK, PUBREC, SUBACK, DISCONNECT */ + MQTT_RC_ADMINISTRATIVE_ACTION = 152, /* DISCONNECT */ + MQTT_RC_PAYLOAD_FORMAT_INVALID = 153, /* CONNACK, DISCONNECT */ + MQTT_RC_RETAIN_NOT_SUPPORTED = 154, /* CONNACK, DISCONNECT */ + MQTT_RC_QOS_NOT_SUPPORTED = 155, /* CONNACK, DISCONNECT */ + MQTT_RC_USE_ANOTHER_SERVER = 156, /* CONNACK, DISCONNECT */ + MQTT_RC_SERVER_MOVED = 157, /* CONNACK, DISCONNECT */ + MQTT_RC_SHARED_SUBS_NOT_SUPPORTED = 158, /* SUBACK, DISCONNECT */ + MQTT_RC_CONNECTION_RATE_EXCEEDED = 159, /* CONNACK, DISCONNECT */ + MQTT_RC_MAXIMUM_CONNECT_TIME = 160, /* DISCONNECT */ + MQTT_RC_SUBSCRIPTION_IDS_NOT_SUPPORTED = 161, /* SUBACK, DISCONNECT */ + MQTT_RC_WILDCARD_SUBS_NOT_SUPPORTED = 162, /* SUBACK, DISCONNECT */ +}; + +enum mqtt5_property { + MQTT_PROP_PAYLOAD_FORMAT_INDICATOR = 1, /* Byte : PUBLISH, Will Properties */ + MQTT_PROP_MESSAGE_EXPIRY_INTERVAL = 2, /* 4 byte int : PUBLISH, Will Properties */ + MQTT_PROP_CONTENT_TYPE = 3, /* UTF-8 string : PUBLISH, Will Properties */ + MQTT_PROP_RESPONSE_TOPIC = 8, /* UTF-8 string : PUBLISH, Will Properties */ + MQTT_PROP_CORRELATION_DATA = 9, /* Binary Data : PUBLISH, Will Properties */ + MQTT_PROP_SUBSCRIPTION_IDENTIFIER = 11, /* Variable byte int : PUBLISH, SUBSCRIBE */ + MQTT_PROP_SESSION_EXPIRY_INTERVAL = 17, /* 4 byte int : CONNECT, CONNACK, DISCONNECT */ + MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER = 18, /* UTF-8 string : CONNACK */ + MQTT_PROP_SERVER_KEEP_ALIVE = 19, /* 2 byte int : CONNACK */ + MQTT_PROP_AUTHENTICATION_METHOD = 21, /* UTF-8 string : CONNECT, CONNACK, AUTH */ + MQTT_PROP_AUTHENTICATION_DATA = 22, /* Binary Data : CONNECT, CONNACK, AUTH */ + MQTT_PROP_REQUEST_PROBLEM_INFORMATION = 23, /* Byte : CONNECT */ + MQTT_PROP_WILL_DELAY_INTERVAL = 24, /* 4 byte int : Will properties */ + MQTT_PROP_REQUEST_RESPONSE_INFORMATION = 25,/* Byte : CONNECT */ + MQTT_PROP_RESPONSE_INFORMATION = 26, /* UTF-8 string : CONNACK */ + MQTT_PROP_SERVER_REFERENCE = 28, /* UTF-8 string : CONNACK, DISCONNECT */ + MQTT_PROP_REASON_STRING = 31, /* UTF-8 string : All except Will properties */ + MQTT_PROP_RECEIVE_MAXIMUM = 33, /* 2 byte int : CONNECT, CONNACK */ + MQTT_PROP_TOPIC_ALIAS_MAXIMUM = 34, /* 2 byte int : CONNECT, CONNACK */ + MQTT_PROP_TOPIC_ALIAS = 35, /* 2 byte int : PUBLISH */ + MQTT_PROP_MAXIMUM_QOS = 36, /* Byte : CONNACK */ + MQTT_PROP_RETAIN_AVAILABLE = 37, /* Byte : CONNACK */ + MQTT_PROP_USER_PROPERTY = 38, /* UTF-8 string pair : All */ + MQTT_PROP_MAXIMUM_PACKET_SIZE = 39, /* 4 byte int : CONNECT, CONNACK */ + MQTT_PROP_WILDCARD_SUB_AVAILABLE = 40, /* Byte : CONNACK */ + MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE = 41, /* Byte : CONNACK */ + MQTT_PROP_SHARED_SUB_AVAILABLE = 42, /* Byte : CONNACK */ +}; + +enum mqtt5_property_type { + MQTT_PROP_TYPE_BYTE = 1, + MQTT_PROP_TYPE_INT16 = 2, + MQTT_PROP_TYPE_INT32 = 3, + MQTT_PROP_TYPE_VARINT = 4, + MQTT_PROP_TYPE_BINARY = 5, + MQTT_PROP_TYPE_STRING = 6, + MQTT_PROP_TYPE_STRING_PAIR = 7 +}; + +enum mqtt5_sub_options { + MQTT_SUB_OPT_NO_LOCAL = 0x04, + MQTT_SUB_OPT_RETAIN_AS_PUBLISHED = 0x08, + MQTT_SUB_OPT_SEND_RETAIN_ALWAYS = 0x00, + MQTT_SUB_OPT_SEND_RETAIN_NEW = 0x10, + MQTT_SUB_OPT_SEND_RETAIN_NEVER = 0x20, +}; + +#define MQTT_MAX_PAYLOAD 268435455 + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/net_mosq.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/net_mosq.c new file mode 100644 index 0000000..f207e32 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/net_mosq.c @@ -0,0 +1,1090 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#define _GNU_SOURCE +#include "config.h" + +#include <assert.h> +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> +#include <string.h> +#ifndef WIN32 +#define _GNU_SOURCE +#include <netdb.h> +#include <sys/socket.h> +#include <unistd.h> +#else +#include <winsock2.h> +#include <ws2tcpip.h> +#endif + +#ifdef __ANDROID__ +#include <linux/in.h> +#include <linux/in6.h> +#include <sys/endian.h> +#endif + +#ifdef HAVE_NETINET_IN_H +# include <netinet/in.h> +#endif + +#ifdef __QNX__ +#include <net/netbyte.h> +#endif + +#ifdef WITH_TLS +#include <openssl/conf.h> +#include <openssl/engine.h> +#include <openssl/err.h> +#include <openssl/ui.h> +#include <tls_mosq.h> +#endif + +#ifdef WITH_BROKER +# include "mosquitto_broker_internal.h" +# ifdef WITH_WEBSOCKETS +# include <libwebsockets.h> +# endif +#else +# include "read_handle.h" +#endif + +#include "logging_mosq.h" +#include "memory_mosq.h" +#include "mqtt_protocol.h" +#include "net_mosq.h" +#include "time_mosq.h" +#include "util_mosq.h" + +#ifdef WITH_TLS +int tls_ex_index_mosq = -1; +UI_METHOD *_ui_method = NULL; + +/* Functions taken from OpenSSL s_server/s_client */ +static int ui_open(UI *ui) +{ + return UI_method_get_opener(UI_OpenSSL())(ui); +} + +static int ui_read(UI *ui, UI_STRING *uis) +{ + return UI_method_get_reader(UI_OpenSSL())(ui, uis); +} + +static int ui_write(UI *ui, UI_STRING *uis) +{ + return UI_method_get_writer(UI_OpenSSL())(ui, uis); +} + +static int ui_close(UI *ui) +{ + return UI_method_get_closer(UI_OpenSSL())(ui); +} + +static void setup_ui_method(void) +{ + _ui_method = UI_create_method("OpenSSL application user interface"); + UI_method_set_opener(_ui_method, ui_open); + UI_method_set_reader(_ui_method, ui_read); + UI_method_set_writer(_ui_method, ui_write); + UI_method_set_closer(_ui_method, ui_close); +} + +static void cleanup_ui_method(void) +{ + if(_ui_method){ + UI_destroy_method(_ui_method); + _ui_method = NULL; + } +} + +UI_METHOD *net__get_ui_method(void) +{ + return _ui_method; +} +#endif + +int net__init(void) +{ +#ifdef WIN32 + WSADATA wsaData; + if(WSAStartup(MAKEWORD(2,2), &wsaData) != 0){ + return MOSQ_ERR_UNKNOWN; + } +#endif + +#ifdef WITH_SRV + ares_library_init(ARES_LIB_INIT_ALL); +#endif + +#ifdef WITH_TLS +# if OPENSSL_VERSION_NUMBER < 0x10100000L + SSL_load_error_strings(); + SSL_library_init(); + OpenSSL_add_all_algorithms(); +# else + OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \ + | OPENSSL_INIT_ADD_ALL_DIGESTS \ + | OPENSSL_INIT_LOAD_CONFIG, NULL); +# endif +#if !defined(OPENSSL_NO_ENGINE) + ENGINE_load_builtin_engines(); +#endif + setup_ui_method(); + if(tls_ex_index_mosq == -1){ + tls_ex_index_mosq = SSL_get_ex_new_index(0, "client context", NULL, NULL, NULL); + } +#endif + return MOSQ_ERR_SUCCESS; +} + +void net__cleanup(void) +{ +#ifdef WITH_TLS +# if OPENSSL_VERSION_NUMBER < 0x10100000L + CRYPTO_cleanup_all_ex_data(); + ERR_free_strings(); + ERR_remove_thread_state(NULL); + EVP_cleanup(); + +# if !defined(OPENSSL_NO_ENGINE) + ENGINE_cleanup(); +# endif +# endif + + CONF_modules_unload(1); + cleanup_ui_method(); +#endif + +#ifdef WITH_SRV + ares_library_cleanup(); +#endif + +#ifdef WIN32 + WSACleanup(); +#endif +} + + +/* Close a socket associated with a context and set it to -1. + * Returns 1 on failure (context is NULL) + * Returns 0 on success. + */ +#ifdef WITH_BROKER +int net__socket_close(struct mosquitto_db *db, struct mosquitto *mosq) +#else +int net__socket_close(struct mosquitto *mosq) +#endif +{ + int rc = 0; + + assert(mosq); +#ifdef WITH_TLS +#ifdef WITH_WEBSOCKETS + if(!mosq->wsi) +#endif + { + if(mosq->ssl){ + SSL_shutdown(mosq->ssl); + SSL_free(mosq->ssl); + mosq->ssl = NULL; + } + } +#endif + +#ifdef WITH_WEBSOCKETS + if(mosq->wsi) + { + if(mosq->state != mosq_cs_disconnecting){ + context__set_state(mosq, mosq_cs_disconnect_ws); + } + libwebsocket_callback_on_writable(mosq->ws_context, mosq->wsi); + }else +#endif + { + if(mosq->sock != INVALID_SOCKET){ +#ifdef WITH_BROKER + HASH_DELETE(hh_sock, db->contexts_by_sock, mosq); +#endif + rc = COMPAT_CLOSE(mosq->sock); + mosq->sock = INVALID_SOCKET; + } + } + +#ifdef WITH_BROKER + if(mosq->listener){ + mosq->listener->client_count--; + } +#endif + + return rc; +} + + +#ifdef FINAL_WITH_TLS_PSK +static unsigned int psk_client_callback(SSL *ssl, const char *hint, + char *identity, unsigned int max_identity_len, + unsigned char *psk, unsigned int max_psk_len) +{ + struct mosquitto *mosq; + int len; + + UNUSED(hint); + + mosq = SSL_get_ex_data(ssl, tls_ex_index_mosq); + if(!mosq) return 0; + + snprintf(identity, max_identity_len, "%s", mosq->tls_psk_identity); + + len = mosquitto__hex2bin(mosq->tls_psk, psk, max_psk_len); + if (len < 0) return 0; + return len; +} +#endif + +#if defined(WITH_BROKER) && defined(__GLIBC__) && defined(WITH_ADNS) +/* Async connect, part 1 (dns lookup) */ +int net__try_connect_step1(struct mosquitto *mosq, const char *host) +{ + int s; + void *sevp = NULL; + struct addrinfo *hints; + + if(mosq->adns){ + gai_cancel(mosq->adns); + mosquitto__free((struct addrinfo *)mosq->adns->ar_request); + mosquitto__free(mosq->adns); + } + mosq->adns = mosquitto__calloc(1, sizeof(struct gaicb)); + if(!mosq->adns){ + return MOSQ_ERR_NOMEM; + } + + hints = mosquitto__calloc(1, sizeof(struct addrinfo)); + if(!hints){ + mosquitto__free(mosq->adns); + mosq->adns = NULL; + return MOSQ_ERR_NOMEM; + } + + hints->ai_family = AF_UNSPEC; + hints->ai_socktype = SOCK_STREAM; + + mosq->adns->ar_name = host; + mosq->adns->ar_request = hints; + + s = getaddrinfo_a(GAI_NOWAIT, &mosq->adns, 1, sevp); + if(s){ + errno = s; + if(mosq->adns){ + mosquitto__free((struct addrinfo *)mosq->adns->ar_request); + mosquitto__free(mosq->adns); + mosq->adns = NULL; + } + return MOSQ_ERR_EAI; + } + + return MOSQ_ERR_SUCCESS; +} + +/* Async connect part 2, the connection. */ +int net__try_connect_step2(struct mosquitto *mosq, uint16_t port, mosq_sock_t *sock) +{ + struct addrinfo *ainfo, *rp; + int rc; + + ainfo = mosq->adns->ar_result; + + for(rp = ainfo; rp != NULL; rp = rp->ai_next){ + *sock = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); + if(*sock == INVALID_SOCKET) continue; + + if(rp->ai_family == AF_INET){ + ((struct sockaddr_in *)rp->ai_addr)->sin_port = htons(port); + }else if(rp->ai_family == AF_INET6){ + ((struct sockaddr_in6 *)rp->ai_addr)->sin6_port = htons(port); + }else{ + COMPAT_CLOSE(*sock); + *sock = INVALID_SOCKET; + continue; + } + + /* Set non-blocking */ + if(net__socket_nonblock(sock)){ + continue; + } + + rc = connect(*sock, rp->ai_addr, rp->ai_addrlen); +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(rc == 0 || errno == EINPROGRESS || errno == COMPAT_EWOULDBLOCK){ + if(rc < 0 && (errno == EINPROGRESS || errno == COMPAT_EWOULDBLOCK)){ + rc = MOSQ_ERR_CONN_PENDING; + } + + /* Set non-blocking */ + if(net__socket_nonblock(sock)){ + continue; + } + break; + } + + COMPAT_CLOSE(*sock); + *sock = INVALID_SOCKET; + } + freeaddrinfo(mosq->adns->ar_result); + mosq->adns->ar_result = NULL; + + mosquitto__free((struct addrinfo *)mosq->adns->ar_request); + mosquitto__free(mosq->adns); + mosq->adns = NULL; + + if(!rp){ + return MOSQ_ERR_ERRNO; + } + + return rc; +} + +#endif + + +int net__try_connect(const char *host, uint16_t port, mosq_sock_t *sock, const char *bind_address, bool blocking) +{ + struct addrinfo hints; + struct addrinfo *ainfo, *rp; + struct addrinfo *ainfo_bind, *rp_bind; + int s; + int rc = MOSQ_ERR_SUCCESS; +#ifdef WIN32 + uint32_t val = 1; +#endif + + *sock = INVALID_SOCKET; + memset(&hints, 0, sizeof(struct addrinfo)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + + s = getaddrinfo(host, NULL, &hints, &ainfo); + if(s){ + errno = s; + return MOSQ_ERR_EAI; + } + + if(bind_address){ + s = getaddrinfo(bind_address, NULL, &hints, &ainfo_bind); + if(s){ + freeaddrinfo(ainfo); + errno = s; + return MOSQ_ERR_EAI; + } + } + + for(rp = ainfo; rp != NULL; rp = rp->ai_next){ + *sock = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); + if(*sock == INVALID_SOCKET) continue; + + if(rp->ai_family == AF_INET){ + ((struct sockaddr_in *)rp->ai_addr)->sin_port = htons(port); + }else if(rp->ai_family == AF_INET6){ + ((struct sockaddr_in6 *)rp->ai_addr)->sin6_port = htons(port); + }else{ + COMPAT_CLOSE(*sock); + *sock = INVALID_SOCKET; + continue; + } + + if(bind_address){ + for(rp_bind = ainfo_bind; rp_bind != NULL; rp_bind = rp_bind->ai_next){ + if(bind(*sock, rp_bind->ai_addr, rp_bind->ai_addrlen) == 0){ + break; + } + } + if(!rp_bind){ + COMPAT_CLOSE(*sock); + *sock = INVALID_SOCKET; + continue; + } + } + + if(!blocking){ + /* Set non-blocking */ + if(net__socket_nonblock(sock)){ + continue; + } + } + + rc = connect(*sock, rp->ai_addr, rp->ai_addrlen); +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(rc == 0 || errno == EINPROGRESS || errno == COMPAT_EWOULDBLOCK){ + if(rc < 0 && (errno == EINPROGRESS || errno == COMPAT_EWOULDBLOCK)){ + rc = MOSQ_ERR_CONN_PENDING; + } + + if(blocking){ + /* Set non-blocking */ + if(net__socket_nonblock(sock)){ + continue; + } + } + break; + } + + COMPAT_CLOSE(*sock); + *sock = INVALID_SOCKET; + } + freeaddrinfo(ainfo); + if(bind_address){ + freeaddrinfo(ainfo_bind); + } + if(!rp){ + return MOSQ_ERR_ERRNO; + } + return rc; +} + + +#ifdef WITH_TLS +void net__print_ssl_error(struct mosquitto *mosq) +{ + char ebuf[256]; + unsigned long e; + + e = ERR_get_error(); + while(e){ + log__printf(mosq, MOSQ_LOG_ERR, "OpenSSL Error: %s", ERR_error_string(e, ebuf)); + e = ERR_get_error(); + } +} + + +int net__socket_connect_tls(struct mosquitto *mosq) +{ + int ret, err; + + ERR_clear_error(); + long res; + if (mosq->tls_ocsp_required) { + // Note: OCSP is available in all currently supported OpenSSL versions. + if ((res=SSL_set_tlsext_status_type(mosq->ssl, TLSEXT_STATUSTYPE_ocsp)) != 1) { + log__printf(mosq, MOSQ_LOG_ERR, "Could not activate OCSP (error: %ld)", res); + return MOSQ_ERR_OCSP; + } + if ((res=SSL_CTX_set_tlsext_status_cb(mosq->ssl_ctx, mosquitto__verify_ocsp_status_cb)) != 1) { + log__printf(mosq, MOSQ_LOG_ERR, "Could not activate OCSP (error: %ld)", res); + return MOSQ_ERR_OCSP; + } + if ((res=SSL_CTX_set_tlsext_status_arg(mosq->ssl_ctx, mosq)) != 1) { + log__printf(mosq, MOSQ_LOG_ERR, "Could not activate OCSP (error: %ld)", res); + return MOSQ_ERR_OCSP; + } + } + + ret = SSL_connect(mosq->ssl); + if(ret != 1) { + err = SSL_get_error(mosq->ssl, ret); + if (err == SSL_ERROR_SYSCALL) { + mosq->want_connect = true; + return MOSQ_ERR_SUCCESS; + } + if(err == SSL_ERROR_WANT_READ){ + mosq->want_connect = true; + /* We always try to read anyway */ + }else if(err == SSL_ERROR_WANT_WRITE){ + mosq->want_write = true; + mosq->want_connect = true; + }else{ + net__print_ssl_error(mosq); + + COMPAT_CLOSE(mosq->sock); + mosq->sock = INVALID_SOCKET; + net__print_ssl_error(mosq); + return MOSQ_ERR_TLS; + } + }else{ + mosq->want_connect = false; + } + return MOSQ_ERR_SUCCESS; +} +#endif + + +#ifdef WITH_TLS +static int net__init_ssl_ctx(struct mosquitto *mosq) +{ + int ret; + ENGINE *engine = NULL; + uint8_t tls_alpn_wire[256]; + uint8_t tls_alpn_len; + + if(mosq->ssl_ctx){ + if(!mosq->ssl_ctx_defaults){ + return MOSQ_ERR_SUCCESS; + }else if(!mosq->tls_cafile && !mosq->tls_capath && !mosq->tls_psk){ + log__printf(mosq, MOSQ_LOG_ERR, "Error: MOSQ_OPT_SSL_CTX_WITH_DEFAULTS used without specifying cafile, capath or psk."); + return MOSQ_ERR_INVAL; + } + } + + /* Apply default SSL_CTX settings. This is only used if MOSQ_OPT_SSL_CTX + * has not been set, or if both of MOSQ_OPT_SSL_CTX and + * MOSQ_OPT_SSL_CTX_WITH_DEFAULTS are set. */ + if(mosq->tls_cafile || mosq->tls_capath || mosq->tls_psk){ + if(!mosq->ssl_ctx){ +#if OPENSSL_VERSION_NUMBER < 0x10100000L + mosq->ssl_ctx = SSL_CTX_new(SSLv23_client_method()); +#else + mosq->ssl_ctx = SSL_CTX_new(TLS_client_method()); +#endif + + if(!mosq->ssl_ctx){ + log__printf(mosq, MOSQ_LOG_ERR, "Error: Unable to create TLS context."); + COMPAT_CLOSE(mosq->sock); + mosq->sock = INVALID_SOCKET; + net__print_ssl_error(mosq); + return MOSQ_ERR_TLS; + } + } + + if(!mosq->tls_version){ + SSL_CTX_set_options(mosq->ssl_ctx, SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1); +#ifdef SSL_OP_NO_TLSv1_3 + }else if(!strcmp(mosq->tls_version, "tlsv1.3")){ + SSL_CTX_set_options(mosq->ssl_ctx, SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2); + }else if(!strcmp(mosq->tls_version, "tlsv1.2")){ + SSL_CTX_set_options(mosq->ssl_ctx, SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_3); + }else if(!strcmp(mosq->tls_version, "tlsv1.1")){ + SSL_CTX_set_options(mosq->ssl_ctx, SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_2 | SSL_OP_NO_TLSv1_3); +#else + }else if(!strcmp(mosq->tls_version, "tlsv1.2")){ + SSL_CTX_set_options(mosq->ssl_ctx, SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1); + }else if(!strcmp(mosq->tls_version, "tlsv1.1")){ + SSL_CTX_set_options(mosq->ssl_ctx, SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_2); +#endif + }else{ + log__printf(mosq, MOSQ_LOG_ERR, "Error: Protocol %s not supported.", mosq->tls_version); + COMPAT_CLOSE(mosq->sock); + mosq->sock = INVALID_SOCKET; + return MOSQ_ERR_INVAL; + } + + /* Disable compression */ + SSL_CTX_set_options(mosq->ssl_ctx, SSL_OP_NO_COMPRESSION); + + /* Set ALPN */ + if(mosq->tls_alpn) { + tls_alpn_len = (uint8_t) strnlen(mosq->tls_alpn, 254); + tls_alpn_wire[0] = tls_alpn_len; // first byte is length of string + memcpy(tls_alpn_wire + 1, mosq->tls_alpn, tls_alpn_len); + SSL_CTX_set_alpn_protos(mosq->ssl_ctx, tls_alpn_wire, tls_alpn_len + 1); + } + +#ifdef SSL_MODE_RELEASE_BUFFERS + /* Use even less memory per SSL connection. */ + SSL_CTX_set_mode(mosq->ssl_ctx, SSL_MODE_RELEASE_BUFFERS); +#endif + +#if !defined(OPENSSL_NO_ENGINE) + if(mosq->tls_engine){ + engine = ENGINE_by_id(mosq->tls_engine); + if(!engine){ + log__printf(mosq, MOSQ_LOG_ERR, "Error loading %s engine\n", mosq->tls_engine); + COMPAT_CLOSE(mosq->sock); + return MOSQ_ERR_TLS; + } + if(!ENGINE_init(engine)){ + log__printf(mosq, MOSQ_LOG_ERR, "Failed engine initialisation\n"); + ENGINE_free(engine); + COMPAT_CLOSE(mosq->sock); + return MOSQ_ERR_TLS; + } + ENGINE_set_default(engine, ENGINE_METHOD_ALL); + ENGINE_free(engine); /* release the structural reference from ENGINE_by_id() */ + } +#endif + + if(mosq->tls_ciphers){ + ret = SSL_CTX_set_cipher_list(mosq->ssl_ctx, mosq->tls_ciphers); + if(ret == 0){ + log__printf(mosq, MOSQ_LOG_ERR, "Error: Unable to set TLS ciphers. Check cipher list \"%s\".", mosq->tls_ciphers); +#if !defined(OPENSSL_NO_ENGINE) + ENGINE_FINISH(engine); +#endif + COMPAT_CLOSE(mosq->sock); + mosq->sock = INVALID_SOCKET; + net__print_ssl_error(mosq); + return MOSQ_ERR_TLS; + } + } + if(mosq->tls_cafile || mosq->tls_capath){ + ret = SSL_CTX_load_verify_locations(mosq->ssl_ctx, mosq->tls_cafile, mosq->tls_capath); + if(ret == 0){ +#ifdef WITH_BROKER + if(mosq->tls_cafile && mosq->tls_capath){ + log__printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load CA certificates, check bridge_cafile \"%s\" and bridge_capath \"%s\".", mosq->tls_cafile, mosq->tls_capath); + }else if(mosq->tls_cafile){ + log__printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load CA certificates, check bridge_cafile \"%s\".", mosq->tls_cafile); + }else{ + log__printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load CA certificates, check bridge_capath \"%s\".", mosq->tls_capath); + } +#else + if(mosq->tls_cafile && mosq->tls_capath){ + log__printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load CA certificates, check cafile \"%s\" and capath \"%s\".", mosq->tls_cafile, mosq->tls_capath); + }else if(mosq->tls_cafile){ + log__printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load CA certificates, check cafile \"%s\".", mosq->tls_cafile); + }else{ + log__printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load CA certificates, check capath \"%s\".", mosq->tls_capath); + } +#endif +#if !defined(OPENSSL_NO_ENGINE) + ENGINE_FINISH(engine); +#endif + COMPAT_CLOSE(mosq->sock); + mosq->sock = INVALID_SOCKET; + net__print_ssl_error(mosq); + return MOSQ_ERR_TLS; + } + if(mosq->tls_cert_reqs == 0){ + SSL_CTX_set_verify(mosq->ssl_ctx, SSL_VERIFY_NONE, NULL); + }else{ + SSL_CTX_set_verify(mosq->ssl_ctx, SSL_VERIFY_PEER, mosquitto__server_certificate_verify); + } + + if(mosq->tls_pw_callback){ + SSL_CTX_set_default_passwd_cb(mosq->ssl_ctx, mosq->tls_pw_callback); + SSL_CTX_set_default_passwd_cb_userdata(mosq->ssl_ctx, mosq); + } + + if(mosq->tls_certfile){ + ret = SSL_CTX_use_certificate_chain_file(mosq->ssl_ctx, mosq->tls_certfile); + if(ret != 1){ +#ifdef WITH_BROKER + log__printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load client certificate, check bridge_certfile \"%s\".", mosq->tls_certfile); +#else + log__printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load client certificate \"%s\".", mosq->tls_certfile); +#endif +#if !defined(OPENSSL_NO_ENGINE) + ENGINE_FINISH(engine); +#endif + COMPAT_CLOSE(mosq->sock); + mosq->sock = INVALID_SOCKET; + net__print_ssl_error(mosq); + return MOSQ_ERR_TLS; + } + } + if(mosq->tls_keyfile){ + if(mosq->tls_keyform == mosq_k_engine){ +#if !defined(OPENSSL_NO_ENGINE) + UI_METHOD *ui_method = net__get_ui_method(); + if(mosq->tls_engine_kpass_sha1){ + if(!ENGINE_ctrl_cmd(engine, ENGINE_SECRET_MODE, ENGINE_SECRET_MODE_SHA, NULL, NULL, 0)){ + log__printf(mosq, MOSQ_LOG_ERR, "Error: Unable to set engine secret mode sha1"); + ENGINE_FINISH(engine); + COMPAT_CLOSE(mosq->sock); + net__print_ssl_error(mosq); + return MOSQ_ERR_TLS; + } + if(!ENGINE_ctrl_cmd(engine, ENGINE_PIN, 0, mosq->tls_engine_kpass_sha1, NULL, 0)){ + log__printf(mosq, MOSQ_LOG_ERR, "Error: Unable to set engine pin"); + ENGINE_FINISH(engine); + COMPAT_CLOSE(mosq->sock); + net__print_ssl_error(mosq); + return MOSQ_ERR_TLS; + } + ui_method = NULL; + } + EVP_PKEY *pkey = ENGINE_load_private_key(engine, mosq->tls_keyfile, ui_method, NULL); + if(!pkey){ + log__printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load engine private key file \"%s\".", mosq->tls_keyfile); + ENGINE_FINISH(engine); + COMPAT_CLOSE(mosq->sock); + net__print_ssl_error(mosq); + return MOSQ_ERR_TLS; + } + if(SSL_CTX_use_PrivateKey(mosq->ssl_ctx, pkey) <= 0){ + log__printf(mosq, MOSQ_LOG_ERR, "Error: Unable to use engine private key file \"%s\".", mosq->tls_keyfile); + ENGINE_FINISH(engine); + COMPAT_CLOSE(mosq->sock); + net__print_ssl_error(mosq); + return MOSQ_ERR_TLS; + } +#endif + }else{ + ret = SSL_CTX_use_PrivateKey_file(mosq->ssl_ctx, mosq->tls_keyfile, SSL_FILETYPE_PEM); + if(ret != 1){ +#ifdef WITH_BROKER + log__printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load client key file, check bridge_keyfile \"%s\".", mosq->tls_keyfile); +#else + log__printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load client key file \"%s\".", mosq->tls_keyfile); +#endif +#if !defined(OPENSSL_NO_ENGINE) + ENGINE_FINISH(engine); +#endif + COMPAT_CLOSE(mosq->sock); + mosq->sock = INVALID_SOCKET; + net__print_ssl_error(mosq); + return MOSQ_ERR_TLS; + } + } + ret = SSL_CTX_check_private_key(mosq->ssl_ctx); + if(ret != 1){ + log__printf(mosq, MOSQ_LOG_ERR, "Error: Client certificate/key are inconsistent."); +#if !defined(OPENSSL_NO_ENGINE) + ENGINE_FINISH(engine); +#endif + COMPAT_CLOSE(mosq->sock); + mosq->sock = INVALID_SOCKET; + net__print_ssl_error(mosq); + return MOSQ_ERR_TLS; + } + } +#ifdef FINAL_WITH_TLS_PSK + }else if(mosq->tls_psk){ + SSL_CTX_set_psk_client_callback(mosq->ssl_ctx, psk_client_callback); +#endif + } + } + + return MOSQ_ERR_SUCCESS; +} +#endif + + +int net__socket_connect_step3(struct mosquitto *mosq, const char *host) +{ +#ifdef WITH_TLS + BIO *bio; + + int rc = net__init_ssl_ctx(mosq); + if(rc) return rc; + + if(mosq->ssl_ctx){ + if(mosq->ssl){ + SSL_free(mosq->ssl); + } + mosq->ssl = SSL_new(mosq->ssl_ctx); + if(!mosq->ssl){ + COMPAT_CLOSE(mosq->sock); + mosq->sock = INVALID_SOCKET; + net__print_ssl_error(mosq); + return MOSQ_ERR_TLS; + } + + SSL_set_ex_data(mosq->ssl, tls_ex_index_mosq, mosq); + bio = BIO_new_socket(mosq->sock, BIO_NOCLOSE); + if(!bio){ + COMPAT_CLOSE(mosq->sock); + mosq->sock = INVALID_SOCKET; + net__print_ssl_error(mosq); + return MOSQ_ERR_TLS; + } + SSL_set_bio(mosq->ssl, bio, bio); + + /* + * required for the SNI resolving + */ + if(SSL_set_tlsext_host_name(mosq->ssl, host) != 1) { + COMPAT_CLOSE(mosq->sock); + mosq->sock = INVALID_SOCKET; + return MOSQ_ERR_TLS; + } + + if(net__socket_connect_tls(mosq)){ + return MOSQ_ERR_TLS; + } + + } +#endif + return MOSQ_ERR_SUCCESS; +} + +/* Create a socket and connect it to 'ip' on port 'port'. */ +int net__socket_connect(struct mosquitto *mosq, const char *host, uint16_t port, const char *bind_address, bool blocking) +{ + mosq_sock_t sock = INVALID_SOCKET; + int rc, rc2; + + if(!mosq || !host || !port) return MOSQ_ERR_INVAL; + + rc = net__try_connect(host, port, &sock, bind_address, blocking); + if(rc > 0) return rc; + + mosq->sock = sock; + +#if defined(WITH_SOCKS) && !defined(WITH_BROKER) + if(!mosq->socks5_host) +#endif + { + rc2 = net__socket_connect_step3(mosq, host); + if(rc2) return rc2; + } + + return MOSQ_ERR_SUCCESS; +} + + +ssize_t net__read(struct mosquitto *mosq, void *buf, size_t count) +{ +#ifdef WITH_TLS + int ret; + int err; +#endif + assert(mosq); + errno = 0; +#ifdef WITH_TLS + if(mosq->ssl){ + ERR_clear_error(); + ret = SSL_read(mosq->ssl, buf, count); + if(ret <= 0){ + err = SSL_get_error(mosq->ssl, ret); + if(err == SSL_ERROR_WANT_READ){ + ret = -1; + errno = EAGAIN; + }else if(err == SSL_ERROR_WANT_WRITE){ + ret = -1; + mosq->want_write = true; + errno = EAGAIN; + }else{ + net__print_ssl_error(mosq); + errno = EPROTO; + } +#ifdef WIN32 + WSASetLastError(errno); +#endif + } + return (ssize_t )ret; + }else{ + /* Call normal read/recv */ + +#endif + +#ifndef WIN32 + return read(mosq->sock, buf, count); +#else + return recv(mosq->sock, buf, count, 0); +#endif + +#ifdef WITH_TLS + } +#endif +} + +ssize_t net__write(struct mosquitto *mosq, void *buf, size_t count) +{ +#ifdef WITH_TLS + int ret; + int err; +#endif + assert(mosq); + + errno = 0; +#ifdef WITH_TLS + if(mosq->ssl){ + mosq->want_write = false; + ERR_clear_error(); + ret = SSL_write(mosq->ssl, buf, count); + if(ret < 0){ + err = SSL_get_error(mosq->ssl, ret); + if(err == SSL_ERROR_WANT_READ){ + ret = -1; + errno = EAGAIN; + }else if(err == SSL_ERROR_WANT_WRITE){ + ret = -1; + mosq->want_write = true; + errno = EAGAIN; + }else{ + net__print_ssl_error(mosq); + errno = EPROTO; + } +#ifdef WIN32 + WSASetLastError(errno); +#endif + } + return (ssize_t )ret; + }else{ + /* Call normal write/send */ +#endif + +#ifndef WIN32 + return write(mosq->sock, buf, count); +#else + return send(mosq->sock, buf, count, 0); +#endif + +#ifdef WITH_TLS + } +#endif +} + + +int net__socket_nonblock(mosq_sock_t *sock) +{ +#ifndef WIN32 + int opt; + /* Set non-blocking */ + opt = fcntl(*sock, F_GETFL, 0); + if(opt == -1){ + COMPAT_CLOSE(*sock); + *sock = INVALID_SOCKET; + return MOSQ_ERR_ERRNO; + } + if(fcntl(*sock, F_SETFL, opt | O_NONBLOCK) == -1){ + /* If either fcntl fails, don't want to allow this client to connect. */ + COMPAT_CLOSE(*sock); + return MOSQ_ERR_ERRNO; + } +#else + unsigned long opt = 1; + if(ioctlsocket(*sock, FIONBIO, &opt)){ + COMPAT_CLOSE(*sock); + return MOSQ_ERR_ERRNO; + } +#endif + return MOSQ_ERR_SUCCESS; +} + + +#ifndef WITH_BROKER +int net__socketpair(mosq_sock_t *pairR, mosq_sock_t *pairW) +{ +#ifdef WIN32 + int family[2] = {AF_INET, AF_INET6}; + int i; + struct sockaddr_storage ss; + struct sockaddr_in *sa = (struct sockaddr_in *)&ss; + struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)&ss; + socklen_t ss_len; + mosq_sock_t spR, spW; + + mosq_sock_t listensock; + + *pairR = INVALID_SOCKET; + *pairW = INVALID_SOCKET; + + for(i=0; i<2; i++){ + memset(&ss, 0, sizeof(ss)); + if(family[i] == AF_INET){ + sa->sin_family = family[i]; + sa->sin_addr.s_addr = htonl(INADDR_LOOPBACK); + sa->sin_port = 0; + ss_len = sizeof(struct sockaddr_in); + }else if(family[i] == AF_INET6){ + sa6->sin6_family = family[i]; + sa6->sin6_addr = in6addr_loopback; + sa6->sin6_port = 0; + ss_len = sizeof(struct sockaddr_in6); + }else{ + return MOSQ_ERR_INVAL; + } + + listensock = socket(family[i], SOCK_STREAM, IPPROTO_TCP); + if(listensock == -1){ + continue; + } + + if(bind(listensock, (struct sockaddr *)&ss, ss_len) == -1){ + COMPAT_CLOSE(listensock); + continue; + } + + if(listen(listensock, 1) == -1){ + COMPAT_CLOSE(listensock); + continue; + } + memset(&ss, 0, sizeof(ss)); + ss_len = sizeof(ss); + if(getsockname(listensock, (struct sockaddr *)&ss, &ss_len) < 0){ + COMPAT_CLOSE(listensock); + continue; + } + + if(family[i] == AF_INET){ + sa->sin_family = family[i]; + sa->sin_addr.s_addr = htonl(INADDR_LOOPBACK); + ss_len = sizeof(struct sockaddr_in); + }else if(family[i] == AF_INET6){ + sa6->sin6_family = family[i]; + sa6->sin6_addr = in6addr_loopback; + ss_len = sizeof(struct sockaddr_in6); + } + + spR = socket(family[i], SOCK_STREAM, IPPROTO_TCP); + if(spR == -1){ + COMPAT_CLOSE(listensock); + continue; + } + if(net__socket_nonblock(&spR)){ + COMPAT_CLOSE(listensock); + continue; + } + if(connect(spR, (struct sockaddr *)&ss, ss_len) < 0){ +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(errno != EINPROGRESS && errno != COMPAT_EWOULDBLOCK){ + COMPAT_CLOSE(spR); + COMPAT_CLOSE(listensock); + continue; + } + } + spW = accept(listensock, NULL, 0); + if(spW == -1){ +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(errno != EINPROGRESS && errno != COMPAT_EWOULDBLOCK){ + COMPAT_CLOSE(spR); + COMPAT_CLOSE(listensock); + continue; + } + } + + if(net__socket_nonblock(&spW)){ + COMPAT_CLOSE(spR); + COMPAT_CLOSE(listensock); + continue; + } + COMPAT_CLOSE(listensock); + + *pairR = spR; + *pairW = spW; + return MOSQ_ERR_SUCCESS; + } + return MOSQ_ERR_UNKNOWN; +#else + int sv[2]; + + if(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == -1){ + return MOSQ_ERR_ERRNO; + } + if(net__socket_nonblock(&sv[0])){ + COMPAT_CLOSE(sv[1]); + return MOSQ_ERR_ERRNO; + } + if(net__socket_nonblock(&sv[1])){ + COMPAT_CLOSE(sv[0]); + return MOSQ_ERR_ERRNO; + } + *pairR = sv[0]; + *pairW = sv[1]; + return MOSQ_ERR_SUCCESS; +#endif +} +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/net_mosq.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/net_mosq.h new file mode 100644 index 0000000..b843ebe --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/net_mosq.h @@ -0,0 +1,82 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ +#ifndef NET_MOSQ_H +#define NET_MOSQ_H + +#ifndef WIN32 +#include <unistd.h> +#else +#include <winsock2.h> +typedef SSIZE_T ssize_t; +#endif + +#include "mosquitto_internal.h" +#include "mosquitto.h" + +#ifdef WITH_BROKER +struct mosquitto_db; +#endif + +#ifdef WIN32 +# define COMPAT_CLOSE(a) closesocket(a) +# define COMPAT_ECONNRESET WSAECONNRESET +# define COMPAT_EWOULDBLOCK WSAEWOULDBLOCK +#else +# define COMPAT_CLOSE(a) close(a) +# define COMPAT_ECONNRESET ECONNRESET +# define COMPAT_EWOULDBLOCK EWOULDBLOCK +#endif + +/* For when not using winsock libraries. */ +#ifndef INVALID_SOCKET +#define INVALID_SOCKET -1 +#endif + +/* Macros for accessing the MSB and LSB of a uint16_t */ +#define MOSQ_MSB(A) (uint8_t)((A & 0xFF00) >> 8) +#define MOSQ_LSB(A) (uint8_t)(A & 0x00FF) + +int net__init(void); +void net__cleanup(void); + +int net__socket_connect(struct mosquitto *mosq, const char *host, uint16_t port, const char *bind_address, bool blocking); +#ifdef WITH_BROKER +int net__socket_close(struct mosquitto_db *db, struct mosquitto *mosq); +#else +int net__socket_close(struct mosquitto *mosq); +#endif +int net__try_connect(const char *host, uint16_t port, mosq_sock_t *sock, const char *bind_address, bool blocking); +int net__try_connect_step1(struct mosquitto *mosq, const char *host); +int net__try_connect_step2(struct mosquitto *mosq, uint16_t port, mosq_sock_t *sock); +int net__socket_connect_step3(struct mosquitto *mosq, const char *host); +int net__socket_nonblock(mosq_sock_t *sock); +int net__socketpair(mosq_sock_t *sp1, mosq_sock_t *sp2); + +ssize_t net__read(struct mosquitto *mosq, void *buf, size_t count); +ssize_t net__write(struct mosquitto *mosq, void *buf, size_t count); + +#ifdef WITH_TLS +int net__socket_apply_tls(struct mosquitto *mosq); +int net__socket_connect_tls(struct mosquitto *mosq); +int mosquitto__verify_ocsp_status_cb(SSL * ssl, void *arg); +UI_METHOD *net__get_ui_method(void); +#define ENGINE_FINISH(e) if(e) ENGINE_finish(e) +#define ENGINE_SECRET_MODE "SECRET_MODE" +#define ENGINE_SECRET_MODE_SHA 0x1000 +#define ENGINE_PIN "PIN" +#endif + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/net_mosq.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/net_mosq.o new file mode 100644 index 0000000..0e29423 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/net_mosq.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/net_mosq_ocsp.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/net_mosq_ocsp.c new file mode 100644 index 0000000..32f2a3e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/net_mosq_ocsp.c @@ -0,0 +1,159 @@ +/* +Copyright (c) 2009-2014 Roger Light <roger@atchoo.org> +Copyright (c) 2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG), Dr. Lars Voelker <lars.voelker@bmw.de> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Dr. Lars Voelker, BMW AG +*/ + +/* +COPYRIGHT AND PERMISSION NOTICE of curl on which the ocsp code is based: + +Copyright (c) 1996 - 2016, Daniel Stenberg, <daniel@haxx.se>, and many +contributors, see the THANKS file. + +All rights reserved. + +Permission to use, copy, modify, and distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright +notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall not +be used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization of the copyright holder. +*/ + +#ifdef WITH_TLS +#include <logging_mosq.h> +#include <mosquitto_internal.h> +#include <net_mosq.h> + +#include <openssl/safestack.h> +#include <openssl/tls1.h> +#include <openssl/ssl.h> +#include <openssl/ocsp.h> + +int mosquitto__verify_ocsp_status_cb(SSL * ssl, void *arg) +{ + struct mosquitto *mosq = (struct mosquitto *)arg; + int ocsp_status, result2, i; + unsigned char *p; + const unsigned char *cp; + OCSP_RESPONSE *rsp = NULL; + OCSP_BASICRESP *br = NULL; + X509_STORE *st = NULL; + STACK_OF(X509) *ch = NULL; + + long len = SSL_get_tlsext_status_ocsp_resp(mosq->ssl, &p); + log__printf(mosq, MOSQ_LOG_DEBUG, "OCSP: SSL_get_tlsext_status_ocsp_resp returned %ld bytes", len); + + // the following functions expect a const pointer + cp = (const unsigned char *)p; + + if (!cp || len <= 0) { + log__printf(mosq, MOSQ_LOG_DEBUG, "OCSP: no response"); + goto end; + } + + + rsp = d2i_OCSP_RESPONSE(NULL, &cp, len); + if (rsp==NULL) { + log__printf(mosq, MOSQ_LOG_DEBUG, "OCSP: invalid response"); + goto end; + } + + ocsp_status = OCSP_response_status(rsp); + if(ocsp_status != OCSP_RESPONSE_STATUS_SUCCESSFUL) { + log__printf(mosq, MOSQ_LOG_DEBUG, "OCSP: invalid status: %s (%d)", + OCSP_response_status_str(ocsp_status), ocsp_status); + goto end; + } + + br = OCSP_response_get1_basic(rsp); + if (!br) { + log__printf(mosq, MOSQ_LOG_DEBUG, "OCSP: invalid response"); + goto end; + } + + ch = SSL_get_peer_cert_chain(mosq->ssl); + if (sk_X509_num(ch) <= 0) { + log__printf(mosq, MOSQ_LOG_ERR, "OCSP: we did not receive certificates of the server (num: %d)", sk_X509_num(ch)); + goto end; + } + + st = SSL_CTX_get_cert_store(mosq->ssl_ctx); + + // Note: + // Other checkers often fix problems in OpenSSL before 1.0.2a (e.g. libcurl). + // For all currently supported versions of the OpenSSL project, this is not needed anymore. + + if ((result2=OCSP_basic_verify(br, ch, st, 0)) <= 0) { + log__printf(mosq, MOSQ_LOG_DEBUG, "OCSP: response verification failed (error: %d)", result2); + goto end; + } + + for(i = 0; i < OCSP_resp_count(br); i++) { + int cert_status, crl_reason; + OCSP_SINGLERESP *single = NULL; + + ASN1_GENERALIZEDTIME *rev, *thisupd, *nextupd; + + single = OCSP_resp_get0(br, i); + if(!single) + continue; + + cert_status = OCSP_single_get0_status(single, &crl_reason, &rev, &thisupd, &nextupd); + + log__printf(mosq, MOSQ_LOG_DEBUG, "OCSP: SSL certificate status: %s (%d)", + OCSP_cert_status_str(cert_status), cert_status); + + switch(cert_status) { + case V_OCSP_CERTSTATUS_GOOD: + // Note: A OCSP stapling result will be accepted up to 5 minutes after it expired! + if(!OCSP_check_validity(thisupd, nextupd, 300L, -1L)) { + log__printf(mosq, MOSQ_LOG_DEBUG, "OCSP: OCSP response has expired"); + goto end; + } + break; + + case V_OCSP_CERTSTATUS_REVOKED: + log__printf(mosq, MOSQ_LOG_DEBUG, "OCSP: SSL certificate revocation reason: %s (%d)", + OCSP_crl_reason_str(crl_reason), crl_reason); + goto end; + + case V_OCSP_CERTSTATUS_UNKNOWN: + goto end; + + default: + log__printf(mosq, MOSQ_LOG_DEBUG, "OCSP: SSL certificate revocation status unknown"); + goto end; + } + } + + if (br!=NULL) OCSP_BASICRESP_free(br); + if (rsp!=NULL) OCSP_RESPONSE_free(rsp); + return 1; // OK + +end: + if (br!=NULL) OCSP_BASICRESP_free(br); + if (rsp!=NULL) OCSP_RESPONSE_free(rsp); + return 0; // Not OK +} +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/net_mosq_ocsp.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/net_mosq_ocsp.o new file mode 100644 index 0000000..710925f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/net_mosq_ocsp.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/options.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/options.c new file mode 100644 index 0000000..7bab736 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/options.c @@ -0,0 +1,486 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#ifndef WIN32 +# include <strings.h> +#endif + +#include <string.h> + +#ifdef WITH_TLS +# ifdef WIN32 +# include <winsock2.h> +# endif +# include <openssl/engine.h> +#endif + +#include "mosquitto.h" +#include "mosquitto_internal.h" +#include "memory_mosq.h" +#include "mqtt_protocol.h" +#include "util_mosq.h" +#include "will_mosq.h" + + +int mosquitto_will_set(struct mosquitto *mosq, const char *topic, int payloadlen, const void *payload, int qos, bool retain) +{ + return mosquitto_will_set_v5(mosq, topic, payloadlen, payload, qos, retain, NULL); +} + + +int mosquitto_will_set_v5(struct mosquitto *mosq, const char *topic, int payloadlen, const void *payload, int qos, bool retain, mosquitto_property *properties) +{ + int rc; + + if(!mosq) return MOSQ_ERR_INVAL; + + if(properties){ + rc = mosquitto_property_check_all(CMD_WILL, properties); + if(rc) return rc; + } + + return will__set(mosq, topic, payloadlen, payload, qos, retain, properties); +} + + +int mosquitto_will_clear(struct mosquitto *mosq) +{ + if(!mosq) return MOSQ_ERR_INVAL; + return will__clear(mosq); +} + + +int mosquitto_username_pw_set(struct mosquitto *mosq, const char *username, const char *password) +{ + if(!mosq) return MOSQ_ERR_INVAL; + + if(mosq->protocol == mosq_p_mqtt311 || mosq->protocol == mosq_p_mqtt31){ + if(password != NULL && username == NULL){ + return MOSQ_ERR_INVAL; + } + } + + mosquitto__free(mosq->username); + mosq->username = NULL; + + mosquitto__free(mosq->password); + mosq->password = NULL; + + if(username){ + if(mosquitto_validate_utf8(username, strlen(username))){ + return MOSQ_ERR_MALFORMED_UTF8; + } + mosq->username = mosquitto__strdup(username); + if(!mosq->username) return MOSQ_ERR_NOMEM; + } + + if(password){ + mosq->password = mosquitto__strdup(password); + if(!mosq->password){ + mosquitto__free(mosq->username); + mosq->username = NULL; + return MOSQ_ERR_NOMEM; + } + } + return MOSQ_ERR_SUCCESS; +} + + +int mosquitto_reconnect_delay_set(struct mosquitto *mosq, unsigned int reconnect_delay, unsigned int reconnect_delay_max, bool reconnect_exponential_backoff) +{ + if(!mosq) return MOSQ_ERR_INVAL; + + if(reconnect_delay == 0) reconnect_delay = 1; + + mosq->reconnect_delay = reconnect_delay; + mosq->reconnect_delay_max = reconnect_delay_max; + mosq->reconnect_exponential_backoff = reconnect_exponential_backoff; + + return MOSQ_ERR_SUCCESS; + +} + + +int mosquitto_tls_set(struct mosquitto *mosq, const char *cafile, const char *capath, const char *certfile, const char *keyfile, int (*pw_callback)(char *buf, int size, int rwflag, void *userdata)) +{ +#ifdef WITH_TLS + FILE *fptr; + + if(!mosq || (!cafile && !capath) || (certfile && !keyfile) || (!certfile && keyfile)) return MOSQ_ERR_INVAL; + + mosquitto__free(mosq->tls_cafile); + mosq->tls_cafile = NULL; + if(cafile){ + fptr = mosquitto__fopen(cafile, "rt", false); + if(fptr){ + fclose(fptr); + }else{ + return MOSQ_ERR_INVAL; + } + mosq->tls_cafile = mosquitto__strdup(cafile); + + if(!mosq->tls_cafile){ + return MOSQ_ERR_NOMEM; + } + } + + mosquitto__free(mosq->tls_capath); + mosq->tls_capath = NULL; + if(capath){ + mosq->tls_capath = mosquitto__strdup(capath); + if(!mosq->tls_capath){ + return MOSQ_ERR_NOMEM; + } + } + + mosquitto__free(mosq->tls_certfile); + mosq->tls_certfile = NULL; + if(certfile){ + fptr = mosquitto__fopen(certfile, "rt", false); + if(fptr){ + fclose(fptr); + }else{ + mosquitto__free(mosq->tls_cafile); + mosq->tls_cafile = NULL; + + mosquitto__free(mosq->tls_capath); + mosq->tls_capath = NULL; + return MOSQ_ERR_INVAL; + } + mosq->tls_certfile = mosquitto__strdup(certfile); + if(!mosq->tls_certfile){ + return MOSQ_ERR_NOMEM; + } + } + + mosquitto__free(mosq->tls_keyfile); + mosq->tls_keyfile = NULL; + if(keyfile){ + fptr = mosquitto__fopen(keyfile, "rt", false); + if(fptr){ + fclose(fptr); + }else{ + mosquitto__free(mosq->tls_cafile); + mosq->tls_cafile = NULL; + + mosquitto__free(mosq->tls_capath); + mosq->tls_capath = NULL; + + mosquitto__free(mosq->tls_certfile); + mosq->tls_certfile = NULL; + return MOSQ_ERR_INVAL; + } + mosq->tls_keyfile = mosquitto__strdup(keyfile); + if(!mosq->tls_keyfile){ + return MOSQ_ERR_NOMEM; + } + } + + mosq->tls_pw_callback = pw_callback; + + + return MOSQ_ERR_SUCCESS; +#else + return MOSQ_ERR_NOT_SUPPORTED; + +#endif +} + + +int mosquitto_tls_opts_set(struct mosquitto *mosq, int cert_reqs, const char *tls_version, const char *ciphers) +{ +#ifdef WITH_TLS + if(!mosq) return MOSQ_ERR_INVAL; + + mosq->tls_cert_reqs = cert_reqs; + if(tls_version){ + if(!strcasecmp(tls_version, "tlsv1.3") + || !strcasecmp(tls_version, "tlsv1.2") + || !strcasecmp(tls_version, "tlsv1.1")){ + + mosq->tls_version = mosquitto__strdup(tls_version); + if(!mosq->tls_version) return MOSQ_ERR_NOMEM; + }else{ + return MOSQ_ERR_INVAL; + } + }else{ + mosq->tls_version = mosquitto__strdup("tlsv1.2"); + if(!mosq->tls_version) return MOSQ_ERR_NOMEM; + } + if(ciphers){ + mosq->tls_ciphers = mosquitto__strdup(ciphers); + if(!mosq->tls_ciphers) return MOSQ_ERR_NOMEM; + }else{ + mosq->tls_ciphers = NULL; + } + + + return MOSQ_ERR_SUCCESS; +#else + return MOSQ_ERR_NOT_SUPPORTED; + +#endif +} + + +int mosquitto_tls_insecure_set(struct mosquitto *mosq, bool value) +{ +#ifdef WITH_TLS + if(!mosq) return MOSQ_ERR_INVAL; + mosq->tls_insecure = value; + return MOSQ_ERR_SUCCESS; +#else + return MOSQ_ERR_NOT_SUPPORTED; +#endif +} + + +int mosquitto_string_option(struct mosquitto *mosq, enum mosq_opt_t option, const char *value) +{ +#ifdef WITH_TLS + ENGINE *eng; + char *str; +#endif + + if(!mosq) return MOSQ_ERR_INVAL; + + switch(option){ + case MOSQ_OPT_TLS_ENGINE: +#ifdef WITH_TLS +# if !defined(OPENSSL_NO_ENGINE) + eng = ENGINE_by_id(value); + if(!eng){ + return MOSQ_ERR_INVAL; + } + ENGINE_free(eng); /* release the structural reference from ENGINE_by_id() */ + mosq->tls_engine = mosquitto__strdup(value); + if(!mosq->tls_engine){ + return MOSQ_ERR_NOMEM; + } + return MOSQ_ERR_SUCCESS; +#endif +#else + return MOSQ_ERR_NOT_SUPPORTED; +#endif + break; + + case MOSQ_OPT_TLS_KEYFORM: +#ifdef WITH_TLS + if(!value) return MOSQ_ERR_INVAL; + if(!strcasecmp(value, "pem")){ + mosq->tls_keyform = mosq_k_pem; + }else if (!strcasecmp(value, "engine")){ + mosq->tls_keyform = mosq_k_engine; + }else{ + return MOSQ_ERR_INVAL; + } +#else + return MOSQ_ERR_NOT_SUPPORTED; +#endif + break; + + + case MOSQ_OPT_TLS_ENGINE_KPASS_SHA1: +#ifdef WITH_TLS + if(mosquitto__hex2bin_sha1(value, (unsigned char**)&str) != MOSQ_ERR_SUCCESS){ + return MOSQ_ERR_INVAL; + } + mosq->tls_engine_kpass_sha1 = str; + return MOSQ_ERR_SUCCESS; +#else + return MOSQ_ERR_NOT_SUPPORTED; +#endif + break; + + case MOSQ_OPT_TLS_ALPN: +#ifdef WITH_TLS + mosq->tls_alpn = mosquitto__strdup(value); + if(!mosq->tls_alpn){ + return MOSQ_ERR_NOMEM; + } + return MOSQ_ERR_SUCCESS; +#else + return MOSQ_ERR_NOT_SUPPORTED; +#endif + break; + + default: + return MOSQ_ERR_INVAL; + } + + return MOSQ_ERR_INVAL; +} + + +int mosquitto_tls_psk_set(struct mosquitto *mosq, const char *psk, const char *identity, const char *ciphers) +{ +#ifdef FINAL_WITH_TLS_PSK + if(!mosq || !psk || !identity) return MOSQ_ERR_INVAL; + + /* Check for hex only digits */ + if(strspn(psk, "0123456789abcdefABCDEF") < strlen(psk)){ + return MOSQ_ERR_INVAL; + } + mosq->tls_psk = mosquitto__strdup(psk); + if(!mosq->tls_psk) return MOSQ_ERR_NOMEM; + + mosq->tls_psk_identity = mosquitto__strdup(identity); + if(!mosq->tls_psk_identity){ + mosquitto__free(mosq->tls_psk); + return MOSQ_ERR_NOMEM; + } + if(ciphers){ + mosq->tls_ciphers = mosquitto__strdup(ciphers); + if(!mosq->tls_ciphers) return MOSQ_ERR_NOMEM; + }else{ + mosq->tls_ciphers = NULL; + } + + return MOSQ_ERR_SUCCESS; +#else + return MOSQ_ERR_NOT_SUPPORTED; +#endif +} + + +int mosquitto_opts_set(struct mosquitto *mosq, enum mosq_opt_t option, void *value) +{ + int ival; + + if(!mosq || !value) return MOSQ_ERR_INVAL; + + switch(option){ + case MOSQ_OPT_PROTOCOL_VERSION: + ival = *((int *)value); + return mosquitto_int_option(mosq, option, ival); + case MOSQ_OPT_SSL_CTX: +#ifdef WITH_TLS + mosq->ssl_ctx = (SSL_CTX *)value; + if(mosq->ssl_ctx){ +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) + SSL_CTX_up_ref(mosq->ssl_ctx); +#else + CRYPTO_add(&(mosq->ssl_ctx)->references, 1, CRYPTO_LOCK_SSL_CTX); +#endif + } + break; +#else + return MOSQ_ERR_NOT_SUPPORTED; +#endif + default: + return MOSQ_ERR_INVAL; + } + return MOSQ_ERR_SUCCESS; +} + + +int mosquitto_int_option(struct mosquitto *mosq, enum mosq_opt_t option, int value) +{ + if(!mosq) return MOSQ_ERR_INVAL; + + switch(option){ + case MOSQ_OPT_PROTOCOL_VERSION: + if(value == MQTT_PROTOCOL_V31){ + mosq->protocol = mosq_p_mqtt31; + }else if(value == MQTT_PROTOCOL_V311){ + mosq->protocol = mosq_p_mqtt311; + }else if(value == MQTT_PROTOCOL_V5){ + mosq->protocol = mosq_p_mqtt5; + }else{ + return MOSQ_ERR_INVAL; + } + break; + + case MOSQ_OPT_RECEIVE_MAXIMUM: + if(value < 0 || value > 65535){ + return MOSQ_ERR_INVAL; + } + mosq->receive_maximum = value; + break; + + case MOSQ_OPT_SEND_MAXIMUM: + if(value < 0 || value > 65535){ + return MOSQ_ERR_INVAL; + } + mosq->send_maximum = value; + break; + + case MOSQ_OPT_SSL_CTX_WITH_DEFAULTS: +#if defined(WITH_TLS) && OPENSSL_VERSION_NUMBER >= 0x10100000L + if(value){ + mosq->ssl_ctx_defaults = true; + }else{ + mosq->ssl_ctx_defaults = false; + } + break; +#else + return MOSQ_ERR_NOT_SUPPORTED; +#endif + + case MOSQ_OPT_TLS_OCSP_REQUIRED: +#ifdef WITH_TLS + mosq->tls_ocsp_required = (bool)value; +#else + return MOSQ_ERR_NOT_SUPPORTED; +#endif + break; + + default: + return MOSQ_ERR_INVAL; + } + return MOSQ_ERR_SUCCESS; +} + + +int mosquitto_void_option(struct mosquitto *mosq, enum mosq_opt_t option, void *value) +{ + if(!mosq || !value) return MOSQ_ERR_INVAL; + + switch(option){ + case MOSQ_OPT_SSL_CTX: +#ifdef WITH_TLS + mosq->ssl_ctx = (SSL_CTX *)value; + if(mosq->ssl_ctx){ +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) + SSL_CTX_up_ref(mosq->ssl_ctx); +#else + CRYPTO_add(&(mosq->ssl_ctx)->references, 1, CRYPTO_LOCK_SSL_CTX); +#endif + } + break; +#else + return MOSQ_ERR_NOT_SUPPORTED; +#endif + default: + return MOSQ_ERR_INVAL; + } + return MOSQ_ERR_SUCCESS; +} + + +void mosquitto_user_data_set(struct mosquitto *mosq, void *userdata) +{ + if(mosq){ + mosq->userdata = userdata; + } +} + +void *mosquitto_userdata(struct mosquitto *mosq) +{ + return mosq->userdata; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/options.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/options.o new file mode 100644 index 0000000..fea68ef --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/options.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/packet_datatypes.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/packet_datatypes.c new file mode 100644 index 0000000..335cb9f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/packet_datatypes.c @@ -0,0 +1,271 @@ +/* +Copyright (c) 2009-2018 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <errno.h> +#include <string.h> + +#ifdef WITH_BROKER +# include "mosquitto_broker_internal.h" +# ifdef WITH_WEBSOCKETS +# include <libwebsockets.h> +# endif +#else +# include "read_handle.h" +#endif + +#include "memory_mosq.h" +#include "mqtt_protocol.h" +#include "net_mosq.h" +#include "packet_mosq.h" +#include "read_handle.h" +#ifdef WITH_BROKER +# include "sys_tree.h" +#else +# define G_BYTES_RECEIVED_INC(A) +# define G_BYTES_SENT_INC(A) +# define G_MSGS_SENT_INC(A) +# define G_PUB_MSGS_SENT_INC(A) +#endif + + +int packet__read_byte(struct mosquitto__packet *packet, uint8_t *byte) +{ + assert(packet); + if(packet->pos+1 > packet->remaining_length) return MOSQ_ERR_PROTOCOL; + + *byte = packet->payload[packet->pos]; + packet->pos++; + + return MOSQ_ERR_SUCCESS; +} + + +void packet__write_byte(struct mosquitto__packet *packet, uint8_t byte) +{ + assert(packet); + assert(packet->pos+1 <= packet->packet_length); + + packet->payload[packet->pos] = byte; + packet->pos++; +} + + +int packet__read_bytes(struct mosquitto__packet *packet, void *bytes, uint32_t count) +{ + assert(packet); + if(packet->pos+count > packet->remaining_length) return MOSQ_ERR_PROTOCOL; + + memcpy(bytes, &(packet->payload[packet->pos]), count); + packet->pos += count; + + return MOSQ_ERR_SUCCESS; +} + + +void packet__write_bytes(struct mosquitto__packet *packet, const void *bytes, uint32_t count) +{ + assert(packet); + assert(packet->pos+count <= packet->packet_length); + + memcpy(&(packet->payload[packet->pos]), bytes, count); + packet->pos += count; +} + + +int packet__read_binary(struct mosquitto__packet *packet, uint8_t **data, int *length) +{ + uint16_t slen; + int rc; + + assert(packet); + rc = packet__read_uint16(packet, &slen); + if(rc) return rc; + + if(slen == 0){ + *data = NULL; + *length = 0; + return MOSQ_ERR_SUCCESS; + } + + if(packet->pos+slen > packet->remaining_length) return MOSQ_ERR_PROTOCOL; + + *data = mosquitto__malloc(slen+1); + if(*data){ + memcpy(*data, &(packet->payload[packet->pos]), slen); + ((uint8_t *)(*data))[slen] = '\0'; + packet->pos += slen; + }else{ + return MOSQ_ERR_NOMEM; + } + + *length = slen; + return MOSQ_ERR_SUCCESS; +} + + +int packet__read_string(struct mosquitto__packet *packet, char **str, int *length) +{ + int rc; + + rc = packet__read_binary(packet, (uint8_t **)str, length); + if(rc) return rc; + if(*length == 0) return MOSQ_ERR_SUCCESS; + + if(mosquitto_validate_utf8(*str, *length)){ + mosquitto__free(*str); + *str = NULL; + *length = -1; + return MOSQ_ERR_MALFORMED_UTF8; + } + + return MOSQ_ERR_SUCCESS; +} + + +void packet__write_string(struct mosquitto__packet *packet, const char *str, uint16_t length) +{ + assert(packet); + packet__write_uint16(packet, length); + packet__write_bytes(packet, str, length); +} + + +int packet__read_uint16(struct mosquitto__packet *packet, uint16_t *word) +{ + uint8_t msb, lsb; + + assert(packet); + if(packet->pos+2 > packet->remaining_length) return MOSQ_ERR_PROTOCOL; + + msb = packet->payload[packet->pos]; + packet->pos++; + lsb = packet->payload[packet->pos]; + packet->pos++; + + *word = (msb<<8) + lsb; + + return MOSQ_ERR_SUCCESS; +} + + +void packet__write_uint16(struct mosquitto__packet *packet, uint16_t word) +{ + packet__write_byte(packet, MOSQ_MSB(word)); + packet__write_byte(packet, MOSQ_LSB(word)); +} + + +int packet__read_uint32(struct mosquitto__packet *packet, uint32_t *word) +{ + uint32_t val = 0; + int i; + + assert(packet); + if(packet->pos+4 > packet->remaining_length) return MOSQ_ERR_PROTOCOL; + + for(i=0; i<4; i++){ + val = (val << 8) + packet->payload[packet->pos]; + packet->pos++; + } + + *word = val; + + return MOSQ_ERR_SUCCESS; +} + + +void packet__write_uint32(struct mosquitto__packet *packet, uint32_t word) +{ + packet__write_byte(packet, (word & 0xFF000000) >> 24); + packet__write_byte(packet, (word & 0x00FF0000) >> 16); + packet__write_byte(packet, (word & 0x0000FF00) >> 8); + packet__write_byte(packet, (word & 0x000000FF)); +} + + +int packet__read_varint(struct mosquitto__packet *packet, int32_t *word, int8_t *bytes) +{ + int i; + uint8_t byte; + int remaining_mult = 1; + int32_t lword = 0; + uint8_t lbytes = 0; + + for(i=0; i<4; i++){ + if(packet->pos < packet->remaining_length){ + lbytes++; + byte = packet->payload[packet->pos]; + lword += (byte & 127) * remaining_mult; + remaining_mult *= 128; + packet->pos++; + if((byte & 128) == 0){ + if(lbytes > 1 && byte == 0){ + /* Catch overlong encodings */ + return MOSQ_ERR_PROTOCOL; + }else{ + *word = lword; + if(bytes) (*bytes) = lbytes; + return MOSQ_ERR_SUCCESS; + } + } + }else{ + return MOSQ_ERR_PROTOCOL; + } + } + return MOSQ_ERR_PROTOCOL; +} + + +int packet__write_varint(struct mosquitto__packet *packet, int32_t word) +{ + uint8_t byte; + int count = 0; + + do{ + byte = word % 128; + word = word / 128; + /* If there are more digits to encode, set the top bit of this digit */ + if(word > 0){ + byte = byte | 0x80; + } + packet__write_byte(packet, byte); + count++; + }while(word > 0 && count < 5); + + if(count == 5){ + return MOSQ_ERR_PROTOCOL; + } + return MOSQ_ERR_SUCCESS; +} + + +int packet__varint_bytes(int32_t word) +{ + if(word < 128){ + return 1; + }else if(word < 16384){ + return 2; + }else if(word < 2097152){ + return 3; + }else if(word < 268435456){ + return 4; + }else{ + return 5; + } +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/packet_datatypes.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/packet_datatypes.o new file mode 100644 index 0000000..43d925b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/packet_datatypes.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/packet_mosq.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/packet_mosq.c new file mode 100644 index 0000000..0f7af74 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/packet_mosq.c @@ -0,0 +1,456 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <errno.h> +#include <string.h> + +#ifdef WITH_BROKER +# include "mosquitto_broker_internal.h" +# ifdef WITH_WEBSOCKETS +# include <libwebsockets.h> +# endif +#else +# include "read_handle.h" +#endif + +#include "memory_mosq.h" +#include "mqtt_protocol.h" +#include "net_mosq.h" +#include "packet_mosq.h" +#include "read_handle.h" +#ifdef WITH_BROKER +# include "sys_tree.h" +# include "send_mosq.h" +#else +# define G_BYTES_RECEIVED_INC(A) +# define G_BYTES_SENT_INC(A) +# define G_MSGS_SENT_INC(A) +# define G_PUB_MSGS_SENT_INC(A) +#endif + +int packet__alloc(struct mosquitto__packet *packet) +{ + uint8_t remaining_bytes[5], byte; + uint32_t remaining_length; + int i; + + assert(packet); + + remaining_length = packet->remaining_length; + packet->payload = NULL; + packet->remaining_count = 0; + do{ + byte = remaining_length % 128; + remaining_length = remaining_length / 128; + /* If there are more digits to encode, set the top bit of this digit */ + if(remaining_length > 0){ + byte = byte | 0x80; + } + remaining_bytes[packet->remaining_count] = byte; + packet->remaining_count++; + }while(remaining_length > 0 && packet->remaining_count < 5); + if(packet->remaining_count == 5) return MOSQ_ERR_PAYLOAD_SIZE; + packet->packet_length = packet->remaining_length + 1 + packet->remaining_count; +#ifdef WITH_WEBSOCKETS + packet->payload = mosquitto__malloc(sizeof(uint8_t)*packet->packet_length + LWS_SEND_BUFFER_PRE_PADDING + LWS_SEND_BUFFER_POST_PADDING); +#else + packet->payload = mosquitto__malloc(sizeof(uint8_t)*packet->packet_length); +#endif + if(!packet->payload) return MOSQ_ERR_NOMEM; + + packet->payload[0] = packet->command; + for(i=0; i<packet->remaining_count; i++){ + packet->payload[i+1] = remaining_bytes[i]; + } + packet->pos = 1 + packet->remaining_count; + + return MOSQ_ERR_SUCCESS; +} + +void packet__cleanup(struct mosquitto__packet *packet) +{ + if(!packet) return; + + /* Free data and reset values */ + packet->command = 0; + packet->remaining_count = 0; + packet->remaining_mult = 1; + packet->remaining_length = 0; + mosquitto__free(packet->payload); + packet->payload = NULL; + packet->to_process = 0; + packet->pos = 0; +} + +int packet__queue(struct mosquitto *mosq, struct mosquitto__packet *packet) +{ +#ifndef WITH_BROKER + char sockpair_data = 0; +#endif + assert(mosq); + assert(packet); + + packet->pos = 0; + packet->to_process = packet->packet_length; + + packet->next = NULL; + pthread_mutex_lock(&mosq->out_packet_mutex); + if(mosq->out_packet){ + mosq->out_packet_last->next = packet; + }else{ + mosq->out_packet = packet; + } + mosq->out_packet_last = packet; + pthread_mutex_unlock(&mosq->out_packet_mutex); +#ifdef WITH_BROKER +# ifdef WITH_WEBSOCKETS + if(mosq->wsi){ + libwebsocket_callback_on_writable(mosq->ws_context, mosq->wsi); + return MOSQ_ERR_SUCCESS; + }else{ + return packet__write(mosq); + } +# else + return packet__write(mosq); +# endif +#else + + /* Write a single byte to sockpairW (connected to sockpairR) to break out + * of select() if in threaded mode. */ + if(mosq->sockpairW != INVALID_SOCKET){ +#ifndef WIN32 + if(write(mosq->sockpairW, &sockpair_data, 1)){ + } +#else + send(mosq->sockpairW, &sockpair_data, 1, 0); +#endif + } + + if(mosq->in_callback == false && mosq->threaded == mosq_ts_none){ + return packet__write(mosq); + }else{ + return MOSQ_ERR_SUCCESS; + } +#endif +} + + +int packet__check_oversize(struct mosquitto *mosq, uint32_t remaining_length) +{ + uint32_t len; + + if(mosq->maximum_packet_size == 0) return MOSQ_ERR_SUCCESS; + + len = remaining_length + packet__varint_bytes(remaining_length); + if(len > mosq->maximum_packet_size){ + return MOSQ_ERR_OVERSIZE_PACKET; + }else{ + return MOSQ_ERR_SUCCESS; + } +} + + +int packet__write(struct mosquitto *mosq) +{ + ssize_t write_length; + struct mosquitto__packet *packet; + + if(!mosq) return MOSQ_ERR_INVAL; + if(mosq->sock == INVALID_SOCKET) return MOSQ_ERR_NO_CONN; + + pthread_mutex_lock(&mosq->current_out_packet_mutex); + pthread_mutex_lock(&mosq->out_packet_mutex); + if(mosq->out_packet && !mosq->current_out_packet){ + mosq->current_out_packet = mosq->out_packet; + mosq->out_packet = mosq->out_packet->next; + if(!mosq->out_packet){ + mosq->out_packet_last = NULL; + } + } + pthread_mutex_unlock(&mosq->out_packet_mutex); + +#if defined(WITH_TLS) && !defined(WITH_BROKER) + if((mosq->state == mosq_cs_connect_pending) || mosq->want_connect){ +#else + if(mosq->state == mosq_cs_connect_pending){ +#endif + pthread_mutex_unlock(&mosq->current_out_packet_mutex); + return MOSQ_ERR_SUCCESS; + } + + while(mosq->current_out_packet){ + packet = mosq->current_out_packet; + + while(packet->to_process > 0){ + write_length = net__write(mosq, &(packet->payload[packet->pos]), packet->to_process); + if(write_length > 0){ + G_BYTES_SENT_INC(write_length); + packet->to_process -= write_length; + packet->pos += write_length; + }else{ +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(errno == EAGAIN || errno == COMPAT_EWOULDBLOCK){ + pthread_mutex_unlock(&mosq->current_out_packet_mutex); + return MOSQ_ERR_SUCCESS; + }else{ + pthread_mutex_unlock(&mosq->current_out_packet_mutex); + switch(errno){ + case COMPAT_ECONNRESET: + return MOSQ_ERR_CONN_LOST; + default: + return MOSQ_ERR_ERRNO; + } + } + } + } + + G_MSGS_SENT_INC(1); + if(((packet->command)&0xF6) == CMD_PUBLISH){ + G_PUB_MSGS_SENT_INC(1); +#ifndef WITH_BROKER + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_publish){ + /* This is a QoS=0 message */ + mosq->in_callback = true; + mosq->on_publish(mosq, mosq->userdata, packet->mid); + mosq->in_callback = false; + } + if(mosq->on_publish_v5){ + /* This is a QoS=0 message */ + mosq->in_callback = true; + mosq->on_publish_v5(mosq, mosq->userdata, packet->mid, 0, NULL); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + }else if(((packet->command)&0xF0) == CMD_DISCONNECT){ + do_client_disconnect(mosq, MOSQ_ERR_SUCCESS, NULL); + packet__cleanup(packet); + mosquitto__free(packet); + return MOSQ_ERR_SUCCESS; +#endif + } + + /* Free data and reset values */ + pthread_mutex_lock(&mosq->out_packet_mutex); + mosq->current_out_packet = mosq->out_packet; + if(mosq->out_packet){ + mosq->out_packet = mosq->out_packet->next; + if(!mosq->out_packet){ + mosq->out_packet_last = NULL; + } + } + pthread_mutex_unlock(&mosq->out_packet_mutex); + + packet__cleanup(packet); + mosquitto__free(packet); + + pthread_mutex_lock(&mosq->msgtime_mutex); + mosq->next_msg_out = mosquitto_time() + mosq->keepalive; + pthread_mutex_unlock(&mosq->msgtime_mutex); + } + pthread_mutex_unlock(&mosq->current_out_packet_mutex); + return MOSQ_ERR_SUCCESS; +} + + +#ifdef WITH_BROKER +int packet__read(struct mosquitto_db *db, struct mosquitto *mosq) +#else +int packet__read(struct mosquitto *mosq) +#endif +{ + uint8_t byte; + ssize_t read_length; + int rc = 0; + + if(!mosq){ + return MOSQ_ERR_INVAL; + } + if(mosq->sock == INVALID_SOCKET){ + return MOSQ_ERR_NO_CONN; + } + if(mosq->state == mosq_cs_connect_pending){ + return MOSQ_ERR_SUCCESS; + } + + /* This gets called if pselect() indicates that there is network data + * available - ie. at least one byte. What we do depends on what data we + * already have. + * If we've not got a command, attempt to read one and save it. This should + * always work because it's only a single byte. + * Then try to read the remaining length. This may fail because it is may + * be more than one byte - will need to save data pending next read if it + * does fail. + * Then try to read the remaining payload, where 'payload' here means the + * combined variable header and actual payload. This is the most likely to + * fail due to longer length, so save current data and current position. + * After all data is read, send to mosquitto__handle_packet() to deal with. + * Finally, free the memory and reset everything to starting conditions. + */ + if(!mosq->in_packet.command){ + read_length = net__read(mosq, &byte, 1); + if(read_length == 1){ + mosq->in_packet.command = byte; +#ifdef WITH_BROKER + G_BYTES_RECEIVED_INC(1); + /* Clients must send CONNECT as their first command. */ + if(!(mosq->bridge) && mosq->state == mosq_cs_new && (byte&0xF0) != CMD_CONNECT){ + return MOSQ_ERR_PROTOCOL; + } +#endif + }else{ + if(read_length == 0){ + return MOSQ_ERR_CONN_LOST; /* EOF */ + } +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(errno == EAGAIN || errno == COMPAT_EWOULDBLOCK){ + return MOSQ_ERR_SUCCESS; + }else{ + switch(errno){ + case COMPAT_ECONNRESET: + return MOSQ_ERR_CONN_LOST; + default: + return MOSQ_ERR_ERRNO; + } + } + } + } + /* remaining_count is the number of bytes that the remaining_length + * parameter occupied in this incoming packet. We don't use it here as such + * (it is used when allocating an outgoing packet), but we must be able to + * determine whether all of the remaining_length parameter has been read. + * remaining_count has three states here: + * 0 means that we haven't read any remaining_length bytes + * <0 means we have read some remaining_length bytes but haven't finished + * >0 means we have finished reading the remaining_length bytes. + */ + if(mosq->in_packet.remaining_count <= 0){ + do{ + read_length = net__read(mosq, &byte, 1); + if(read_length == 1){ + mosq->in_packet.remaining_count--; + /* Max 4 bytes length for remaining length as defined by protocol. + * Anything more likely means a broken/malicious client. + */ + if(mosq->in_packet.remaining_count < -4){ + return MOSQ_ERR_PROTOCOL; + } + + G_BYTES_RECEIVED_INC(1); + mosq->in_packet.remaining_length += (byte & 127) * mosq->in_packet.remaining_mult; + mosq->in_packet.remaining_mult *= 128; + }else{ + if(read_length == 0){ + return MOSQ_ERR_CONN_LOST; /* EOF */ + } +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(errno == EAGAIN || errno == COMPAT_EWOULDBLOCK){ + return MOSQ_ERR_SUCCESS; + }else{ + switch(errno){ + case COMPAT_ECONNRESET: + return MOSQ_ERR_CONN_LOST; + default: + return MOSQ_ERR_ERRNO; + } + } + } + }while((byte & 128) != 0); + /* We have finished reading remaining_length, so make remaining_count + * positive. */ + mosq->in_packet.remaining_count *= -1; + +#ifdef WITH_BROKER + if(db->config->max_packet_size > 0 && mosq->in_packet.remaining_length+1 > db->config->max_packet_size){ + log__printf(NULL, MOSQ_LOG_INFO, "Client %s sent too large packet %d, disconnecting.", mosq->id, mosq->in_packet.remaining_length+1); + if(mosq->protocol == mosq_p_mqtt5){ + send__disconnect(mosq, MQTT_RC_PACKET_TOO_LARGE, NULL); + } + return MOSQ_ERR_OVERSIZE_PACKET; + } +#else + // FIXME - client case for incoming message received from broker too large +#endif + if(mosq->in_packet.remaining_length > 0){ + mosq->in_packet.payload = mosquitto__malloc(mosq->in_packet.remaining_length*sizeof(uint8_t)); + if(!mosq->in_packet.payload){ + return MOSQ_ERR_NOMEM; + } + mosq->in_packet.to_process = mosq->in_packet.remaining_length; + } + } + while(mosq->in_packet.to_process>0){ + read_length = net__read(mosq, &(mosq->in_packet.payload[mosq->in_packet.pos]), mosq->in_packet.to_process); + if(read_length > 0){ + G_BYTES_RECEIVED_INC(read_length); + mosq->in_packet.to_process -= read_length; + mosq->in_packet.pos += read_length; + }else{ +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(errno == EAGAIN || errno == COMPAT_EWOULDBLOCK){ + if(mosq->in_packet.to_process > 1000){ + /* Update last_msg_in time if more than 1000 bytes left to + * receive. Helps when receiving large messages. + * This is an arbitrary limit, but with some consideration. + * If a client can't send 1000 bytes in a second it + * probably shouldn't be using a 1 second keep alive. */ + pthread_mutex_lock(&mosq->msgtime_mutex); + mosq->last_msg_in = mosquitto_time(); + pthread_mutex_unlock(&mosq->msgtime_mutex); + } + return MOSQ_ERR_SUCCESS; + }else{ + switch(errno){ + case COMPAT_ECONNRESET: + return MOSQ_ERR_CONN_LOST; + default: + return MOSQ_ERR_ERRNO; + } + } + } + } + + /* All data for this packet is read. */ + mosq->in_packet.pos = 0; +#ifdef WITH_BROKER + G_MSGS_RECEIVED_INC(1); + if(((mosq->in_packet.command)&0xF5) == CMD_PUBLISH){ + G_PUB_MSGS_RECEIVED_INC(1); + } + rc = handle__packet(db, mosq); +#else + rc = handle__packet(mosq); +#endif + + /* Free data and reset values */ + packet__cleanup(&mosq->in_packet); + + pthread_mutex_lock(&mosq->msgtime_mutex); + mosq->last_msg_in = mosquitto_time(); + pthread_mutex_unlock(&mosq->msgtime_mutex); + return rc; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/packet_mosq.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/packet_mosq.h new file mode 100644 index 0000000..5967f09 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/packet_mosq.h @@ -0,0 +1,56 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ +#ifndef PACKET_MOSQ_H +#define PACKET_MOSQ_H + +#include "mosquitto_internal.h" +#include "mosquitto.h" + +#ifdef WITH_BROKER +struct mosquitto_db; +#endif + +int packet__alloc(struct mosquitto__packet *packet); +void packet__cleanup(struct mosquitto__packet *packet); +int packet__queue(struct mosquitto *mosq, struct mosquitto__packet *packet); + +int packet__check_oversize(struct mosquitto *mosq, uint32_t remaining_length); + +int packet__read_byte(struct mosquitto__packet *packet, uint8_t *byte); +int packet__read_bytes(struct mosquitto__packet *packet, void *bytes, uint32_t count); +int packet__read_binary(struct mosquitto__packet *packet, uint8_t **data, int *length); +int packet__read_string(struct mosquitto__packet *packet, char **str, int *length); +int packet__read_uint16(struct mosquitto__packet *packet, uint16_t *word); +int packet__read_uint32(struct mosquitto__packet *packet, uint32_t *word); +int packet__read_varint(struct mosquitto__packet *packet, int32_t *word, int8_t *bytes); + +void packet__write_byte(struct mosquitto__packet *packet, uint8_t byte); +void packet__write_bytes(struct mosquitto__packet *packet, const void *bytes, uint32_t count); +void packet__write_string(struct mosquitto__packet *packet, const char *str, uint16_t length); +void packet__write_uint16(struct mosquitto__packet *packet, uint16_t word); +void packet__write_uint32(struct mosquitto__packet *packet, uint32_t word); +int packet__write_varint(struct mosquitto__packet *packet, int32_t word); + +int packet__varint_bytes(int32_t word); + +int packet__write(struct mosquitto *mosq); +#ifdef WITH_BROKER +int packet__read(struct mosquitto_db *db, struct mosquitto *mosq); +#else +int packet__read(struct mosquitto *mosq); +#endif + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/packet_mosq.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/packet_mosq.o new file mode 100644 index 0000000..710464f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/packet_mosq.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/property_mosq.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/property_mosq.c new file mode 100644 index 0000000..76158e5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/property_mosq.c @@ -0,0 +1,1181 @@ +/* +Copyright (c) 2018 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <errno.h> +#include <string.h> + +#include "logging_mosq.h" +#include "memory_mosq.h" +#include "mqtt_protocol.h" +#include "packet_mosq.h" +#include "property_mosq.h" + + +int property__read(struct mosquitto__packet *packet, int32_t *len, mosquitto_property *property) +{ + int rc; + int32_t property_identifier; + uint8_t byte; + int8_t byte_count; + uint16_t uint16; + uint32_t uint32; + int32_t varint; + char *str1, *str2; + int slen1, slen2; + + if(!property) return MOSQ_ERR_INVAL; + + rc = packet__read_varint(packet, &property_identifier, NULL); + if(rc) return rc; + *len -= 1; + + memset(property, 0, sizeof(mosquitto_property)); + + property->identifier = property_identifier; + + switch(property_identifier){ + case MQTT_PROP_PAYLOAD_FORMAT_INDICATOR: + case MQTT_PROP_REQUEST_PROBLEM_INFORMATION: + case MQTT_PROP_REQUEST_RESPONSE_INFORMATION: + case MQTT_PROP_MAXIMUM_QOS: + case MQTT_PROP_RETAIN_AVAILABLE: + case MQTT_PROP_WILDCARD_SUB_AVAILABLE: + case MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE: + case MQTT_PROP_SHARED_SUB_AVAILABLE: + rc = packet__read_byte(packet, &byte); + if(rc) return rc; + *len -= 1; /* byte */ + property->value.i8 = byte; + break; + + case MQTT_PROP_SERVER_KEEP_ALIVE: + case MQTT_PROP_RECEIVE_MAXIMUM: + case MQTT_PROP_TOPIC_ALIAS_MAXIMUM: + case MQTT_PROP_TOPIC_ALIAS: + rc = packet__read_uint16(packet, &uint16); + if(rc) return rc; + *len -= 2; /* uint16 */ + property->value.i16 = uint16; + break; + + case MQTT_PROP_MESSAGE_EXPIRY_INTERVAL: + case MQTT_PROP_SESSION_EXPIRY_INTERVAL: + case MQTT_PROP_WILL_DELAY_INTERVAL: + case MQTT_PROP_MAXIMUM_PACKET_SIZE: + rc = packet__read_uint32(packet, &uint32); + if(rc) return rc; + *len -= 4; /* uint32 */ + property->value.i32 = uint32; + break; + + case MQTT_PROP_SUBSCRIPTION_IDENTIFIER: + rc = packet__read_varint(packet, &varint, &byte_count); + if(rc) return rc; + *len -= byte_count; + property->value.varint = varint; + break; + + case MQTT_PROP_CONTENT_TYPE: + case MQTT_PROP_RESPONSE_TOPIC: + case MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER: + case MQTT_PROP_AUTHENTICATION_METHOD: + case MQTT_PROP_RESPONSE_INFORMATION: + case MQTT_PROP_SERVER_REFERENCE: + case MQTT_PROP_REASON_STRING: + rc = packet__read_string(packet, &str1, &slen1); + if(rc) return rc; + *len = (*len) - 2 - slen1; /* uint16, string len */ + property->value.s.v = str1; + property->value.s.len = slen1; + break; + + case MQTT_PROP_AUTHENTICATION_DATA: + case MQTT_PROP_CORRELATION_DATA: + rc = packet__read_binary(packet, (uint8_t **)&str1, &slen1); + if(rc) return rc; + *len = (*len) - 2 - slen1; /* uint16, binary len */ + property->value.bin.v = str1; + property->value.bin.len = slen1; + break; + + case MQTT_PROP_USER_PROPERTY: + rc = packet__read_string(packet, &str1, &slen1); + if(rc) return rc; + *len = (*len) - 2 - slen1; /* uint16, string len */ + + rc = packet__read_string(packet, &str2, &slen2); + if(rc){ + mosquitto__free(str1); + return rc; + } + *len = (*len) - 2 - slen2; /* uint16, string len */ + + property->name.v = str1; + property->name.len = slen1; + property->value.s.v = str2; + property->value.s.len = slen2; + break; + + default: + log__printf(NULL, MOSQ_LOG_DEBUG, "Unsupported property type: %d", property_identifier); + return MOSQ_ERR_MALFORMED_PACKET; + } + + return MOSQ_ERR_SUCCESS; +} + + +int property__read_all(int command, struct mosquitto__packet *packet, mosquitto_property **properties) +{ + int rc; + int32_t proplen; + mosquitto_property *p, *tail = NULL; + + rc = packet__read_varint(packet, &proplen, NULL); + if(rc) return rc; + + *properties = NULL; + + /* The order of properties must be preserved for some types, so keep the + * same order for all */ + while(proplen > 0){ + p = mosquitto__calloc(1, sizeof(mosquitto_property)); + if(!p){ + mosquitto_property_free_all(properties); + return MOSQ_ERR_NOMEM; + } + + rc = property__read(packet, &proplen, p); + if(rc){ + mosquitto__free(p); + mosquitto_property_free_all(properties); + return rc; + } + + if(!(*properties)){ + *properties = p; + }else{ + tail->next = p; + } + tail = p; + + } + + rc = mosquitto_property_check_all(command, *properties); + if(rc){ + mosquitto_property_free_all(properties); + return rc; + } + return MOSQ_ERR_SUCCESS; +} + + +void property__free(mosquitto_property **property) +{ + if(!property || !(*property)) return; + + switch((*property)->identifier){ + case MQTT_PROP_CONTENT_TYPE: + case MQTT_PROP_RESPONSE_TOPIC: + case MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER: + case MQTT_PROP_AUTHENTICATION_METHOD: + case MQTT_PROP_RESPONSE_INFORMATION: + case MQTT_PROP_SERVER_REFERENCE: + case MQTT_PROP_REASON_STRING: + mosquitto__free((*property)->value.s.v); + break; + + case MQTT_PROP_AUTHENTICATION_DATA: + case MQTT_PROP_CORRELATION_DATA: + mosquitto__free((*property)->value.bin.v); + break; + + case MQTT_PROP_USER_PROPERTY: + mosquitto__free((*property)->name.v); + mosquitto__free((*property)->value.s.v); + break; + + case MQTT_PROP_PAYLOAD_FORMAT_INDICATOR: + case MQTT_PROP_MESSAGE_EXPIRY_INTERVAL: + case MQTT_PROP_SUBSCRIPTION_IDENTIFIER: + case MQTT_PROP_SESSION_EXPIRY_INTERVAL: + case MQTT_PROP_SERVER_KEEP_ALIVE: + case MQTT_PROP_REQUEST_PROBLEM_INFORMATION: + case MQTT_PROP_WILL_DELAY_INTERVAL: + case MQTT_PROP_REQUEST_RESPONSE_INFORMATION: + case MQTT_PROP_RECEIVE_MAXIMUM: + case MQTT_PROP_TOPIC_ALIAS_MAXIMUM: + case MQTT_PROP_TOPIC_ALIAS: + case MQTT_PROP_MAXIMUM_QOS: + case MQTT_PROP_RETAIN_AVAILABLE: + case MQTT_PROP_MAXIMUM_PACKET_SIZE: + case MQTT_PROP_WILDCARD_SUB_AVAILABLE: + case MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE: + case MQTT_PROP_SHARED_SUB_AVAILABLE: + /* Nothing to free */ + break; + } + + free(*property); + *property = NULL; +} + + +void mosquitto_property_free_all(mosquitto_property **property) +{ + mosquitto_property *p, *next; + + if(!property) return; + + p = *property; + while(p){ + next = p->next; + property__free(&p); + p = next; + } + *property = NULL; +} + + +int property__get_length(const mosquitto_property *property) +{ + if(!property) return 0; + + switch(property->identifier){ + /* Byte */ + case MQTT_PROP_PAYLOAD_FORMAT_INDICATOR: + case MQTT_PROP_REQUEST_PROBLEM_INFORMATION: + case MQTT_PROP_REQUEST_RESPONSE_INFORMATION: + case MQTT_PROP_MAXIMUM_QOS: + case MQTT_PROP_RETAIN_AVAILABLE: + case MQTT_PROP_WILDCARD_SUB_AVAILABLE: + case MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE: + case MQTT_PROP_SHARED_SUB_AVAILABLE: + return 2; /* 1 (identifier) + 1 byte */ + + /* uint16 */ + case MQTT_PROP_SERVER_KEEP_ALIVE: + case MQTT_PROP_RECEIVE_MAXIMUM: + case MQTT_PROP_TOPIC_ALIAS_MAXIMUM: + case MQTT_PROP_TOPIC_ALIAS: + return 3; /* 1 (identifier) + 2 bytes */ + + /* uint32 */ + case MQTT_PROP_MESSAGE_EXPIRY_INTERVAL: + case MQTT_PROP_WILL_DELAY_INTERVAL: + case MQTT_PROP_MAXIMUM_PACKET_SIZE: + case MQTT_PROP_SESSION_EXPIRY_INTERVAL: + return 5; /* 1 (identifier) + 4 bytes */ + + /* varint */ + case MQTT_PROP_SUBSCRIPTION_IDENTIFIER: + if(property->value.varint < 128){ + return 2; + }else if(property->value.varint < 16384){ + return 3; + }else if(property->value.varint < 2097152){ + return 4; + }else if(property->value.varint < 268435456){ + return 5; + }else{ + return 0; + } + + /* binary */ + case MQTT_PROP_CORRELATION_DATA: + case MQTT_PROP_AUTHENTICATION_DATA: + return 3 + property->value.bin.len; /* 1 + 2 bytes (len) + X bytes (payload) */ + + /* string */ + case MQTT_PROP_CONTENT_TYPE: + case MQTT_PROP_RESPONSE_TOPIC: + case MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER: + case MQTT_PROP_AUTHENTICATION_METHOD: + case MQTT_PROP_RESPONSE_INFORMATION: + case MQTT_PROP_SERVER_REFERENCE: + case MQTT_PROP_REASON_STRING: + return 3 + property->value.s.len; /* 1 + 2 bytes (len) + X bytes (string) */ + + /* string pair */ + case MQTT_PROP_USER_PROPERTY: + return 5 + property->value.s.len + property->name.len; /* 1 + 2*(2 bytes (len) + X bytes (string))*/ + + default: + return 0; + } + return 0; +} + + +int property__get_length_all(const mosquitto_property *property) +{ + const mosquitto_property *p; + int len = 0; + + p = property; + while(p){ + len += property__get_length(p); + p = p->next; + } + return len; +} + + +int property__write(struct mosquitto__packet *packet, const mosquitto_property *property) +{ + int rc; + + rc = packet__write_varint(packet, property->identifier); + if(rc) return rc; + + switch(property->identifier){ + case MQTT_PROP_PAYLOAD_FORMAT_INDICATOR: + case MQTT_PROP_REQUEST_PROBLEM_INFORMATION: + case MQTT_PROP_REQUEST_RESPONSE_INFORMATION: + case MQTT_PROP_MAXIMUM_QOS: + case MQTT_PROP_RETAIN_AVAILABLE: + case MQTT_PROP_WILDCARD_SUB_AVAILABLE: + case MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE: + case MQTT_PROP_SHARED_SUB_AVAILABLE: + packet__write_byte(packet, property->value.i8); + break; + + case MQTT_PROP_SERVER_KEEP_ALIVE: + case MQTT_PROP_RECEIVE_MAXIMUM: + case MQTT_PROP_TOPIC_ALIAS_MAXIMUM: + case MQTT_PROP_TOPIC_ALIAS: + packet__write_uint16(packet, property->value.i16); + break; + + case MQTT_PROP_MESSAGE_EXPIRY_INTERVAL: + case MQTT_PROP_SESSION_EXPIRY_INTERVAL: + case MQTT_PROP_WILL_DELAY_INTERVAL: + case MQTT_PROP_MAXIMUM_PACKET_SIZE: + packet__write_uint32(packet, property->value.i32); + break; + + case MQTT_PROP_SUBSCRIPTION_IDENTIFIER: + return packet__write_varint(packet, property->value.varint); + + case MQTT_PROP_CONTENT_TYPE: + case MQTT_PROP_RESPONSE_TOPIC: + case MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER: + case MQTT_PROP_AUTHENTICATION_METHOD: + case MQTT_PROP_RESPONSE_INFORMATION: + case MQTT_PROP_SERVER_REFERENCE: + case MQTT_PROP_REASON_STRING: + packet__write_string(packet, property->value.s.v, property->value.s.len); + break; + + case MQTT_PROP_AUTHENTICATION_DATA: + case MQTT_PROP_CORRELATION_DATA: + packet__write_uint16(packet, property->value.bin.len); + packet__write_bytes(packet, property->value.bin.v, property->value.bin.len); + break; + + case MQTT_PROP_USER_PROPERTY: + packet__write_string(packet, property->name.v, property->name.len); + packet__write_string(packet, property->value.s.v, property->value.s.len); + break; + + default: + log__printf(NULL, MOSQ_LOG_DEBUG, "Unsupported property type: %d", property->identifier); + return MOSQ_ERR_INVAL; + } + + return MOSQ_ERR_SUCCESS; +} + + +int property__write_all(struct mosquitto__packet *packet, const mosquitto_property *properties, bool write_len) +{ + int rc; + const mosquitto_property *p; + + if(write_len){ + rc = packet__write_varint(packet, property__get_length_all(properties)); + if(rc) return rc; + } + + p = properties; + while(p){ + rc = property__write(packet, p); + if(rc) return rc; + p = p->next; + } + + return MOSQ_ERR_SUCCESS; +} + + +int mosquitto_property_check_command(int command, int identifier) +{ + switch(identifier){ + case MQTT_PROP_PAYLOAD_FORMAT_INDICATOR: + case MQTT_PROP_MESSAGE_EXPIRY_INTERVAL: + case MQTT_PROP_CONTENT_TYPE: + case MQTT_PROP_RESPONSE_TOPIC: + case MQTT_PROP_CORRELATION_DATA: + if(command != CMD_PUBLISH && command != CMD_WILL){ + return MOSQ_ERR_PROTOCOL; + } + break; + + case MQTT_PROP_SUBSCRIPTION_IDENTIFIER: + if(command != CMD_PUBLISH && command != CMD_SUBSCRIBE){ + return MOSQ_ERR_PROTOCOL; + } + break; + + case MQTT_PROP_SESSION_EXPIRY_INTERVAL: + if(command != CMD_CONNECT && command != CMD_CONNACK && command != CMD_DISCONNECT){ + return MOSQ_ERR_PROTOCOL; + } + break; + + case MQTT_PROP_AUTHENTICATION_METHOD: + case MQTT_PROP_AUTHENTICATION_DATA: + if(command != CMD_CONNECT && command != CMD_CONNACK && command != CMD_AUTH){ + return MOSQ_ERR_PROTOCOL; + } + break; + + case MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER: + case MQTT_PROP_SERVER_KEEP_ALIVE: + case MQTT_PROP_RESPONSE_INFORMATION: + case MQTT_PROP_MAXIMUM_QOS: + case MQTT_PROP_RETAIN_AVAILABLE: + case MQTT_PROP_WILDCARD_SUB_AVAILABLE: + case MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE: + case MQTT_PROP_SHARED_SUB_AVAILABLE: + if(command != CMD_CONNACK){ + return MOSQ_ERR_PROTOCOL; + } + break; + + case MQTT_PROP_WILL_DELAY_INTERVAL: + if(command != CMD_WILL){ + return MOSQ_ERR_PROTOCOL; + } + break; + + case MQTT_PROP_REQUEST_PROBLEM_INFORMATION: + case MQTT_PROP_REQUEST_RESPONSE_INFORMATION: + if(command != CMD_CONNECT){ + return MOSQ_ERR_PROTOCOL; + } + break; + + case MQTT_PROP_SERVER_REFERENCE: + if(command != CMD_CONNACK && command != CMD_DISCONNECT){ + return MOSQ_ERR_PROTOCOL; + } + break; + + case MQTT_PROP_REASON_STRING: + if(command == CMD_CONNECT || command == CMD_PUBLISH || command == CMD_SUBSCRIBE || command == CMD_UNSUBSCRIBE){ + return MOSQ_ERR_PROTOCOL; + } + break; + + case MQTT_PROP_RECEIVE_MAXIMUM: + case MQTT_PROP_TOPIC_ALIAS_MAXIMUM: + case MQTT_PROP_MAXIMUM_PACKET_SIZE: + if(command != CMD_CONNECT && command != CMD_CONNACK){ + return MOSQ_ERR_PROTOCOL; + } + break; + + case MQTT_PROP_TOPIC_ALIAS: + if(command != CMD_PUBLISH){ + return MOSQ_ERR_PROTOCOL; + } + break; + + case MQTT_PROP_USER_PROPERTY: + break; + + default: + return MOSQ_ERR_PROTOCOL; + } + return MOSQ_ERR_SUCCESS; +} + + +int mosquitto_string_to_property_info(const char *propname, int *identifier, int *type) +{ + if(!propname) return MOSQ_ERR_INVAL; + + if(!strcasecmp(propname, "payload-format-indicator")){ + *identifier = MQTT_PROP_PAYLOAD_FORMAT_INDICATOR; + *type = MQTT_PROP_TYPE_BYTE; + }else if(!strcasecmp(propname, "message-expiry-interval")){ + *identifier = MQTT_PROP_MESSAGE_EXPIRY_INTERVAL; + *type = MQTT_PROP_TYPE_INT32; + }else if(!strcasecmp(propname, "content-type")){ + *identifier = MQTT_PROP_CONTENT_TYPE; + *type = MQTT_PROP_TYPE_STRING; + }else if(!strcasecmp(propname, "response-topic")){ + *identifier = MQTT_PROP_RESPONSE_TOPIC; + *type = MQTT_PROP_TYPE_STRING; + }else if(!strcasecmp(propname, "correlation-data")){ + *identifier = MQTT_PROP_CORRELATION_DATA; + *type = MQTT_PROP_TYPE_BINARY; + }else if(!strcasecmp(propname, "subscription-identifier")){ + *identifier = MQTT_PROP_SUBSCRIPTION_IDENTIFIER; + *type = MQTT_PROP_TYPE_VARINT; + }else if(!strcasecmp(propname, "session-expiry-interval")){ + *identifier = MQTT_PROP_SESSION_EXPIRY_INTERVAL; + *type = MQTT_PROP_TYPE_INT32; + }else if(!strcasecmp(propname, "assigned-client-identifier")){ + *identifier = MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER; + *type = MQTT_PROP_TYPE_STRING; + }else if(!strcasecmp(propname, "server-keep-alive")){ + *identifier = MQTT_PROP_SERVER_KEEP_ALIVE; + *type = MQTT_PROP_TYPE_INT16; + }else if(!strcasecmp(propname, "authentication-method")){ + *identifier = MQTT_PROP_AUTHENTICATION_METHOD; + *type = MQTT_PROP_TYPE_STRING; + }else if(!strcasecmp(propname, "authentication-data")){ + *identifier = MQTT_PROP_AUTHENTICATION_DATA; + *type = MQTT_PROP_TYPE_BINARY; + }else if(!strcasecmp(propname, "request-problem-information")){ + *identifier = MQTT_PROP_REQUEST_PROBLEM_INFORMATION; + *type = MQTT_PROP_TYPE_BYTE; + }else if(!strcasecmp(propname, "will-delay-interval")){ + *identifier = MQTT_PROP_WILL_DELAY_INTERVAL; + *type = MQTT_PROP_TYPE_INT32; + }else if(!strcasecmp(propname, "request-response-information")){ + *identifier = MQTT_PROP_REQUEST_RESPONSE_INFORMATION; + *type = MQTT_PROP_TYPE_BYTE; + }else if(!strcasecmp(propname, "response-information")){ + *identifier = MQTT_PROP_RESPONSE_INFORMATION; + *type = MQTT_PROP_TYPE_STRING; + }else if(!strcasecmp(propname, "server-reference")){ + *identifier = MQTT_PROP_SERVER_REFERENCE; + *type = MQTT_PROP_TYPE_STRING; + }else if(!strcasecmp(propname, "reason-string")){ + *identifier = MQTT_PROP_REASON_STRING; + *type = MQTT_PROP_TYPE_STRING; + }else if(!strcasecmp(propname, "receive-maximum")){ + *identifier = MQTT_PROP_RECEIVE_MAXIMUM; + *type = MQTT_PROP_TYPE_INT16; + }else if(!strcasecmp(propname, "topic-alias-maximum")){ + *identifier = MQTT_PROP_TOPIC_ALIAS_MAXIMUM; + *type = MQTT_PROP_TYPE_INT16; + }else if(!strcasecmp(propname, "topic-alias")){ + *identifier = MQTT_PROP_TOPIC_ALIAS; + *type = MQTT_PROP_TYPE_INT16; + }else if(!strcasecmp(propname, "maximum-qos")){ + *identifier = MQTT_PROP_MAXIMUM_QOS; + *type = MQTT_PROP_TYPE_BYTE; + }else if(!strcasecmp(propname, "retain-available")){ + *identifier = MQTT_PROP_RETAIN_AVAILABLE; + *type = MQTT_PROP_TYPE_BYTE; + }else if(!strcasecmp(propname, "user-property")){ + *identifier = MQTT_PROP_USER_PROPERTY; + *type = MQTT_PROP_TYPE_STRING_PAIR; + }else if(!strcasecmp(propname, "maximum-packet-size")){ + *identifier = MQTT_PROP_MAXIMUM_PACKET_SIZE; + *type = MQTT_PROP_TYPE_INT32; + }else if(!strcasecmp(propname, "wildcard-subscription-available")){ + *identifier = MQTT_PROP_WILDCARD_SUB_AVAILABLE; + *type = MQTT_PROP_TYPE_BYTE; + }else if(!strcasecmp(propname, "subscription-identifier-available")){ + *identifier = MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE; + *type = MQTT_PROP_TYPE_BYTE; + }else if(!strcasecmp(propname, "shared-subscription-available")){ + *identifier = MQTT_PROP_SHARED_SUB_AVAILABLE; + *type = MQTT_PROP_TYPE_BYTE; + }else{ + return MOSQ_ERR_INVAL; + } + return MOSQ_ERR_SUCCESS; +} + + +static void property__add(mosquitto_property **proplist, struct mqtt5__property *prop) +{ + mosquitto_property *p; + + if(!(*proplist)){ + *proplist = prop; + } + + p = *proplist; + while(p->next){ + p = p->next; + } + p->next = prop; + prop->next = NULL; +} + + +int mosquitto_property_add_byte(mosquitto_property **proplist, int identifier, uint8_t value) +{ + mosquitto_property *prop; + + if(!proplist) return MOSQ_ERR_INVAL; + if(identifier != MQTT_PROP_PAYLOAD_FORMAT_INDICATOR + && identifier != MQTT_PROP_REQUEST_PROBLEM_INFORMATION + && identifier != MQTT_PROP_REQUEST_RESPONSE_INFORMATION + && identifier != MQTT_PROP_MAXIMUM_QOS + && identifier != MQTT_PROP_RETAIN_AVAILABLE + && identifier != MQTT_PROP_WILDCARD_SUB_AVAILABLE + && identifier != MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE + && identifier != MQTT_PROP_SHARED_SUB_AVAILABLE){ + return MOSQ_ERR_INVAL; + } + + prop = mosquitto__calloc(1, sizeof(mosquitto_property)); + if(!prop) return MOSQ_ERR_NOMEM; + + prop->client_generated = true; + prop->identifier = identifier; + prop->value.i8 = value; + + property__add(proplist, prop); + return MOSQ_ERR_SUCCESS; +} + + +int mosquitto_property_add_int16(mosquitto_property **proplist, int identifier, uint16_t value) +{ + mosquitto_property *prop; + + if(!proplist) return MOSQ_ERR_INVAL; + if(identifier != MQTT_PROP_SERVER_KEEP_ALIVE + && identifier != MQTT_PROP_RECEIVE_MAXIMUM + && identifier != MQTT_PROP_TOPIC_ALIAS_MAXIMUM + && identifier != MQTT_PROP_TOPIC_ALIAS){ + return MOSQ_ERR_INVAL; + } + + prop = mosquitto__calloc(1, sizeof(mosquitto_property)); + if(!prop) return MOSQ_ERR_NOMEM; + + prop->client_generated = true; + prop->identifier = identifier; + prop->value.i16 = value; + + property__add(proplist, prop); + return MOSQ_ERR_SUCCESS; +} + + +int mosquitto_property_add_int32(mosquitto_property **proplist, int identifier, uint32_t value) +{ + mosquitto_property *prop; + + if(!proplist) return MOSQ_ERR_INVAL; + if(identifier != MQTT_PROP_MESSAGE_EXPIRY_INTERVAL + && identifier != MQTT_PROP_SESSION_EXPIRY_INTERVAL + && identifier != MQTT_PROP_WILL_DELAY_INTERVAL + && identifier != MQTT_PROP_MAXIMUM_PACKET_SIZE){ + + return MOSQ_ERR_INVAL; + } + + prop = mosquitto__calloc(1, sizeof(mosquitto_property)); + if(!prop) return MOSQ_ERR_NOMEM; + + prop->client_generated = true; + prop->identifier = identifier; + prop->value.i32 = value; + + property__add(proplist, prop); + return MOSQ_ERR_SUCCESS; +} + + +int mosquitto_property_add_varint(mosquitto_property **proplist, int identifier, uint32_t value) +{ + mosquitto_property *prop; + + if(!proplist || value > 268435455) return MOSQ_ERR_INVAL; + if(identifier != MQTT_PROP_SUBSCRIPTION_IDENTIFIER) return MOSQ_ERR_INVAL; + + prop = mosquitto__calloc(1, sizeof(mosquitto_property)); + if(!prop) return MOSQ_ERR_NOMEM; + + prop->client_generated = true; + prop->identifier = identifier; + prop->value.varint = value; + + property__add(proplist, prop); + return MOSQ_ERR_SUCCESS; +} + + +int mosquitto_property_add_binary(mosquitto_property **proplist, int identifier, const void *value, uint16_t len) +{ + mosquitto_property *prop; + + if(!proplist) return MOSQ_ERR_INVAL; + if(identifier != MQTT_PROP_CORRELATION_DATA + && identifier != MQTT_PROP_AUTHENTICATION_DATA){ + + return MOSQ_ERR_INVAL; + } + + prop = mosquitto__calloc(1, sizeof(mosquitto_property)); + if(!prop) return MOSQ_ERR_NOMEM; + + prop->client_generated = true; + prop->identifier = identifier; + + if(len){ + prop->value.bin.v = mosquitto__malloc(len); + if(!prop->value.bin.v){ + mosquitto__free(prop); + return MOSQ_ERR_NOMEM; + } + + memcpy(prop->value.bin.v, value, len); + prop->value.bin.len = len; + } + + property__add(proplist, prop); + return MOSQ_ERR_SUCCESS; +} + + +int mosquitto_property_add_string(mosquitto_property **proplist, int identifier, const char *value) +{ + mosquitto_property *prop; + + if(!proplist) return MOSQ_ERR_INVAL; + if(value){ + if(mosquitto_validate_utf8(value, strlen(value))) return MOSQ_ERR_MALFORMED_UTF8; + } + + if(identifier != MQTT_PROP_CONTENT_TYPE + && identifier != MQTT_PROP_RESPONSE_TOPIC + && identifier != MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER + && identifier != MQTT_PROP_AUTHENTICATION_METHOD + && identifier != MQTT_PROP_RESPONSE_INFORMATION + && identifier != MQTT_PROP_SERVER_REFERENCE + && identifier != MQTT_PROP_REASON_STRING){ + + return MOSQ_ERR_INVAL; + } + + prop = mosquitto__calloc(1, sizeof(mosquitto_property)); + if(!prop) return MOSQ_ERR_NOMEM; + + prop->client_generated = true; + prop->identifier = identifier; + if(value && strlen(value)){ + prop->value.s.v = mosquitto__strdup(value); + if(!prop->value.s.v){ + mosquitto__free(prop); + return MOSQ_ERR_NOMEM; + } + prop->value.s.len = strlen(value); + } + + property__add(proplist, prop); + return MOSQ_ERR_SUCCESS; +} + + +int mosquitto_property_add_string_pair(mosquitto_property **proplist, int identifier, const char *name, const char *value) +{ + mosquitto_property *prop; + + if(!proplist) return MOSQ_ERR_INVAL; + if(identifier != MQTT_PROP_USER_PROPERTY) return MOSQ_ERR_INVAL; + if(name){ + if(mosquitto_validate_utf8(name, strlen(name))) return MOSQ_ERR_MALFORMED_UTF8; + } + if(value){ + if(mosquitto_validate_utf8(value, strlen(value))) return MOSQ_ERR_MALFORMED_UTF8; + } + + prop = mosquitto__calloc(1, sizeof(mosquitto_property)); + if(!prop) return MOSQ_ERR_NOMEM; + + prop->client_generated = true; + prop->identifier = identifier; + + if(name && strlen(name)){ + prop->name.v = mosquitto__strdup(name); + if(!prop->name.v){ + mosquitto__free(prop); + return MOSQ_ERR_NOMEM; + } + prop->name.len = strlen(name); + } + + if(value && strlen(value)){ + prop->value.s.v = mosquitto__strdup(value); + if(!prop->value.s.v){ + mosquitto__free(prop->name.v); + mosquitto__free(prop); + return MOSQ_ERR_NOMEM; + } + prop->value.s.len = strlen(value); + } + + property__add(proplist, prop); + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_property_check_all(int command, const mosquitto_property *properties) +{ + const mosquitto_property *p, *tail; + int rc; + + p = properties; + + while(p){ + /* Validity checks */ + if(p->identifier == MQTT_PROP_REQUEST_PROBLEM_INFORMATION + || p->identifier == MQTT_PROP_REQUEST_RESPONSE_INFORMATION + || p->identifier == MQTT_PROP_MAXIMUM_QOS + || p->identifier == MQTT_PROP_RETAIN_AVAILABLE + || p->identifier == MQTT_PROP_WILDCARD_SUB_AVAILABLE + || p->identifier == MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE + || p->identifier == MQTT_PROP_SHARED_SUB_AVAILABLE){ + + if(p->value.i8 > 1){ + return MOSQ_ERR_PROTOCOL; + } + }else if(p->identifier == MQTT_PROP_MAXIMUM_PACKET_SIZE){ + if( p->value.i32 == 0){ + return MOSQ_ERR_PROTOCOL; + } + }else if(p->identifier == MQTT_PROP_RECEIVE_MAXIMUM + || p->identifier == MQTT_PROP_TOPIC_ALIAS){ + + if(p->value.i16 == 0){ + return MOSQ_ERR_PROTOCOL; + } + } + + /* Check for properties on incorrect commands */ + rc = mosquitto_property_check_command(command, p->identifier); + if(rc) return rc; + + /* Check for duplicates */ + tail = p->next; + while(tail){ + if(p->identifier == tail->identifier + && p->identifier != MQTT_PROP_USER_PROPERTY){ + + return MOSQ_ERR_DUPLICATE_PROPERTY; + } + tail = tail->next; + } + + p = p->next; + } + + return MOSQ_ERR_SUCCESS; +} + +const mosquitto_property *property__get_property(const mosquitto_property *proplist, int identifier, bool skip_first) +{ + const mosquitto_property *p; + bool is_first = true; + + p = proplist; + + while(p){ + if(p->identifier == identifier){ + if(!is_first || !skip_first){ + return p; + } + is_first = false; + } + p = p->next; + } + return NULL; +} + + +const mosquitto_property *mosquitto_property_read_byte(const mosquitto_property *proplist, int identifier, uint8_t *value, bool skip_first) +{ + const mosquitto_property *p; + if(!proplist) return NULL; + + p = property__get_property(proplist, identifier, skip_first); + if(!p) return NULL; + if(p->identifier != MQTT_PROP_PAYLOAD_FORMAT_INDICATOR + && p->identifier != MQTT_PROP_REQUEST_PROBLEM_INFORMATION + && p->identifier != MQTT_PROP_REQUEST_RESPONSE_INFORMATION + && p->identifier != MQTT_PROP_MAXIMUM_QOS + && p->identifier != MQTT_PROP_RETAIN_AVAILABLE + && p->identifier != MQTT_PROP_WILDCARD_SUB_AVAILABLE + && p->identifier != MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE + && p->identifier != MQTT_PROP_SHARED_SUB_AVAILABLE){ + return NULL; + } + + if(value) *value = p->value.i8; + + return p; +} + + +const mosquitto_property *mosquitto_property_read_int16(const mosquitto_property *proplist, int identifier, uint16_t *value, bool skip_first) +{ + const mosquitto_property *p; + if(!proplist) return NULL; + + p = property__get_property(proplist, identifier, skip_first); + if(!p) return NULL; + if(p->identifier != MQTT_PROP_SERVER_KEEP_ALIVE + && p->identifier != MQTT_PROP_RECEIVE_MAXIMUM + && p->identifier != MQTT_PROP_TOPIC_ALIAS_MAXIMUM + && p->identifier != MQTT_PROP_TOPIC_ALIAS){ + return NULL; + } + + if(value) *value = p->value.i16; + + return p; +} + + +const mosquitto_property *mosquitto_property_read_int32(const mosquitto_property *proplist, int identifier, uint32_t *value, bool skip_first) +{ + const mosquitto_property *p; + if(!proplist) return NULL; + + p = property__get_property(proplist, identifier, skip_first); + if(!p) return NULL; + if(p->identifier != MQTT_PROP_MESSAGE_EXPIRY_INTERVAL + && p->identifier != MQTT_PROP_SESSION_EXPIRY_INTERVAL + && p->identifier != MQTT_PROP_WILL_DELAY_INTERVAL + && p->identifier != MQTT_PROP_MAXIMUM_PACKET_SIZE){ + + return NULL; + } + + if(value) *value = p->value.i32; + + return p; +} + + +const mosquitto_property *mosquitto_property_read_varint(const mosquitto_property *proplist, int identifier, uint32_t *value, bool skip_first) +{ + const mosquitto_property *p; + if(!proplist) return NULL; + + p = property__get_property(proplist, identifier, skip_first); + if(!p) return NULL; + if(p->identifier != MQTT_PROP_SUBSCRIPTION_IDENTIFIER){ + return NULL; + } + + if(value) *value = p->value.varint; + + return p; +} + + +const mosquitto_property *mosquitto_property_read_binary(const mosquitto_property *proplist, int identifier, void **value, uint16_t *len, bool skip_first) +{ + const mosquitto_property *p; + if(!proplist || (value && !len) || (!value && len)) return NULL; + + p = property__get_property(proplist, identifier, skip_first); + if(!p) return NULL; + if(p->identifier != MQTT_PROP_CORRELATION_DATA + && p->identifier != MQTT_PROP_AUTHENTICATION_DATA){ + + return NULL; + } + + if(value){ + *len = p->value.bin.len; + *value = malloc(*len); + if(!(*value)) return NULL; + + memcpy(*value, p->value.bin.v, *len); + } + + return p; +} + + +const mosquitto_property *mosquitto_property_read_string(const mosquitto_property *proplist, int identifier, char **value, bool skip_first) +{ + const mosquitto_property *p; + if(!proplist) return NULL; + + p = property__get_property(proplist, identifier, skip_first); + if(!p) return NULL; + if(p->identifier != MQTT_PROP_CONTENT_TYPE + && p->identifier != MQTT_PROP_RESPONSE_TOPIC + && p->identifier != MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER + && p->identifier != MQTT_PROP_AUTHENTICATION_METHOD + && p->identifier != MQTT_PROP_RESPONSE_INFORMATION + && p->identifier != MQTT_PROP_SERVER_REFERENCE + && p->identifier != MQTT_PROP_REASON_STRING){ + + return NULL; + } + + if(value){ + *value = calloc(1, p->value.s.len+1); + if(!(*value)) return NULL; + + memcpy(*value, p->value.s.v, p->value.s.len); + } + + return p; +} + + +const mosquitto_property *mosquitto_property_read_string_pair(const mosquitto_property *proplist, int identifier, char **name, char **value, bool skip_first) +{ + const mosquitto_property *p; + if(!proplist) return NULL; + + p = property__get_property(proplist, identifier, skip_first); + if(!p) return NULL; + if(p->identifier != MQTT_PROP_USER_PROPERTY) return NULL; + + if(name){ + *name = calloc(1, p->name.len+1); + if(!(*name)) return NULL; + memcpy(*name, p->name.v, p->name.len); + } + + if(value){ + *value = calloc(1, p->value.s.len+1); + if(!(*value)){ + if(name) free(*name); + return NULL; + } + memcpy(*value, p->value.s.v, p->value.s.len); + } + + return p; +} + + +int mosquitto_property_copy_all(mosquitto_property **dest, const mosquitto_property *src) +{ + mosquitto_property *pnew, *plast = NULL; + + if(!src) return MOSQ_ERR_SUCCESS; + if(!dest) return MOSQ_ERR_INVAL; + + *dest = NULL; + + while(src){ + pnew = calloc(1, sizeof(mosquitto_property)); + if(!pnew){ + mosquitto_property_free_all(dest); + return MOSQ_ERR_NOMEM; + } + if(plast){ + plast->next = pnew; + }else{ + *dest = pnew; + } + plast = pnew; + + pnew->identifier = src->identifier; + switch(pnew->identifier){ + case MQTT_PROP_PAYLOAD_FORMAT_INDICATOR: + case MQTT_PROP_REQUEST_PROBLEM_INFORMATION: + case MQTT_PROP_REQUEST_RESPONSE_INFORMATION: + case MQTT_PROP_MAXIMUM_QOS: + case MQTT_PROP_RETAIN_AVAILABLE: + case MQTT_PROP_WILDCARD_SUB_AVAILABLE: + case MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE: + case MQTT_PROP_SHARED_SUB_AVAILABLE: + pnew->value.i8 = src->value.i8; + break; + + case MQTT_PROP_SERVER_KEEP_ALIVE: + case MQTT_PROP_RECEIVE_MAXIMUM: + case MQTT_PROP_TOPIC_ALIAS_MAXIMUM: + case MQTT_PROP_TOPIC_ALIAS: + pnew->value.i16 = src->value.i16; + break; + + case MQTT_PROP_MESSAGE_EXPIRY_INTERVAL: + case MQTT_PROP_SESSION_EXPIRY_INTERVAL: + case MQTT_PROP_WILL_DELAY_INTERVAL: + case MQTT_PROP_MAXIMUM_PACKET_SIZE: + pnew->value.i32 = src->value.i32; + break; + + case MQTT_PROP_SUBSCRIPTION_IDENTIFIER: + pnew->value.varint = src->value.varint; + break; + + case MQTT_PROP_CONTENT_TYPE: + case MQTT_PROP_RESPONSE_TOPIC: + case MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER: + case MQTT_PROP_AUTHENTICATION_METHOD: + case MQTT_PROP_RESPONSE_INFORMATION: + case MQTT_PROP_SERVER_REFERENCE: + case MQTT_PROP_REASON_STRING: + pnew->value.s.len = src->value.s.len; + pnew->value.s.v = strdup(src->value.s.v); + if(!pnew->value.s.v){ + mosquitto_property_free_all(dest); + return MOSQ_ERR_NOMEM; + } + break; + + case MQTT_PROP_AUTHENTICATION_DATA: + case MQTT_PROP_CORRELATION_DATA: + pnew->value.bin.len = src->value.bin.len; + pnew->value.bin.v = malloc(pnew->value.bin.len); + if(!pnew->value.bin.v){ + mosquitto_property_free_all(dest); + return MOSQ_ERR_NOMEM; + } + memcpy(pnew->value.bin.v, src->value.bin.v, pnew->value.bin.len); + break; + + case MQTT_PROP_USER_PROPERTY: + pnew->value.s.len = src->value.s.len; + pnew->value.s.v = strdup(src->value.s.v); + if(!pnew->value.s.v){ + mosquitto_property_free_all(dest); + return MOSQ_ERR_NOMEM; + } + + pnew->name.len = src->name.len; + pnew->name.v = strdup(src->name.v); + if(!pnew->name.v){ + mosquitto_property_free_all(dest); + return MOSQ_ERR_NOMEM; + } + break; + + default: + mosquitto_property_free_all(dest); + return MOSQ_ERR_INVAL; + } + + src = src->next; + } + + return MOSQ_ERR_SUCCESS; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/property_mosq.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/property_mosq.h new file mode 100644 index 0000000..d965d8a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/property_mosq.h @@ -0,0 +1,50 @@ +/* +Copyright (c) 2018 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ +#ifndef PROPERTY_MOSQ_H +#define PROPERTY_MOSQ_H + +#include "mosquitto_internal.h" +#include "mosquitto.h" + +struct mqtt__string { + char *v; + int len; +}; + +struct mqtt5__property { + struct mqtt5__property *next; + union { + uint8_t i8; + uint16_t i16; + uint32_t i32; + uint32_t varint; + struct mqtt__string bin; + struct mqtt__string s; + } value; + struct mqtt__string name; + int32_t identifier; + bool client_generated; +}; + + +int property__read_all(int command, struct mosquitto__packet *packet, mosquitto_property **property); +int property__write_all(struct mosquitto__packet *packet, const mosquitto_property *property, bool write_len); +void property__free(mosquitto_property **property); + +int property__get_length(const mosquitto_property *property); +int property__get_length_all(const mosquitto_property *property); + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/property_mosq.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/property_mosq.o new file mode 100644 index 0000000..52b39e7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/property_mosq.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/read_handle.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/read_handle.c new file mode 100644 index 0000000..19c0c35 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/read_handle.c @@ -0,0 +1,70 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <stdio.h> +#include <string.h> + +#include "mosquitto.h" +#include "logging_mosq.h" +#include "memory_mosq.h" +#include "messages_mosq.h" +#include "mqtt_protocol.h" +#include "net_mosq.h" +#include "packet_mosq.h" +#include "read_handle.h" +#include "send_mosq.h" +#include "time_mosq.h" +#include "util_mosq.h" + +int handle__packet(struct mosquitto *mosq) +{ + assert(mosq); + + switch((mosq->in_packet.command)&0xF0){ + case CMD_PINGREQ: + return handle__pingreq(mosq); + case CMD_PINGRESP: + return handle__pingresp(mosq); + case CMD_PUBACK: + return handle__pubackcomp(mosq, "PUBACK"); + case CMD_PUBCOMP: + return handle__pubackcomp(mosq, "PUBCOMP"); + case CMD_PUBLISH: + return handle__publish(mosq); + case CMD_PUBREC: + return handle__pubrec(NULL, mosq); + case CMD_PUBREL: + return handle__pubrel(NULL, mosq); + case CMD_CONNACK: + return handle__connack(mosq); + case CMD_SUBACK: + return handle__suback(mosq); + case CMD_UNSUBACK: + return handle__unsuback(mosq); + case CMD_DISCONNECT: + return handle__disconnect(mosq); + case CMD_AUTH: + return handle__auth(mosq); + default: + /* If we don't recognise the command, return an error straight away. */ + log__printf(mosq, MOSQ_LOG_ERR, "Error: Unrecognised command %d\n", (mosq->in_packet.command)&0xF0); + return MOSQ_ERR_PROTOCOL; + } +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/read_handle.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/read_handle.h new file mode 100644 index 0000000..2a6936d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/read_handle.h @@ -0,0 +1,40 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ +#ifndef READ_HANDLE_H +#define READ_HANDLE_H + +#include "mosquitto.h" +struct mosquitto_db; + +int handle__pingreq(struct mosquitto *mosq); +int handle__pingresp(struct mosquitto *mosq); +#ifdef WITH_BROKER +int handle__pubackcomp(struct mosquitto_db *db, struct mosquitto *mosq, const char *type); +#else +int handle__packet(struct mosquitto *mosq); +int handle__connack(struct mosquitto *mosq); +int handle__disconnect(struct mosquitto *mosq); +int handle__pubackcomp(struct mosquitto *mosq, const char *type); +int handle__publish(struct mosquitto *mosq); +int handle__auth(struct mosquitto *mosq); +#endif +int handle__pubrec(struct mosquitto_db *db, struct mosquitto *mosq); +int handle__pubrel(struct mosquitto_db *db, struct mosquitto *mosq); +int handle__suback(struct mosquitto *mosq); +int handle__unsuback(struct mosquitto *mosq); + + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/read_handle.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/read_handle.o new file mode 100644 index 0000000..29648b1 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/read_handle.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_connect.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_connect.c new file mode 100644 index 0000000..210f125 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_connect.c @@ -0,0 +1,204 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <string.h> + +#ifdef WITH_BROKER +# include "mosquitto_broker_internal.h" +#endif + +#include "logging_mosq.h" +#include "memory_mosq.h" +#include "mosquitto.h" +#include "mosquitto_internal.h" +#include "mqtt_protocol.h" +#include "packet_mosq.h" +#include "property_mosq.h" + +int send__connect(struct mosquitto *mosq, uint16_t keepalive, bool clean_session, const mosquitto_property *properties) +{ + struct mosquitto__packet *packet = NULL; + int payloadlen; + uint8_t will = 0; + uint8_t byte; + int rc; + uint8_t version; + char *clientid, *username, *password; + int headerlen; + int proplen = 0, will_proplen, varbytes; + mosquitto_property *local_props = NULL; + uint16_t receive_maximum; + + assert(mosq); + + if(mosq->protocol == mosq_p_mqtt31 && !mosq->id) return MOSQ_ERR_PROTOCOL; + +#if defined(WITH_BROKER) && defined(WITH_BRIDGE) + if(mosq->bridge){ + clientid = mosq->bridge->remote_clientid; + username = mosq->bridge->remote_username; + password = mosq->bridge->remote_password; + }else{ + clientid = mosq->id; + username = mosq->username; + password = mosq->password; + } +#else + clientid = mosq->id; + username = mosq->username; + password = mosq->password; +#endif + + if(mosq->protocol == mosq_p_mqtt5){ + /* Generate properties from options */ + if(!mosquitto_property_read_int16(properties, MQTT_PROP_RECEIVE_MAXIMUM, &receive_maximum, false)){ + rc = mosquitto_property_add_int16(&local_props, MQTT_PROP_RECEIVE_MAXIMUM, mosq->msgs_in.inflight_maximum); + if(rc) return rc; + }else{ + mosq->msgs_in.inflight_maximum = receive_maximum; + mosq->msgs_in.inflight_quota = receive_maximum; + } + + version = MQTT_PROTOCOL_V5; + headerlen = 10; + proplen = 0; + proplen += property__get_length_all(properties); + proplen += property__get_length_all(local_props); + varbytes = packet__varint_bytes(proplen); + headerlen += proplen + varbytes; + }else if(mosq->protocol == mosq_p_mqtt311){ + version = MQTT_PROTOCOL_V311; + headerlen = 10; + }else if(mosq->protocol == mosq_p_mqtt31){ + version = MQTT_PROTOCOL_V31; + headerlen = 12; + }else{ + return MOSQ_ERR_INVAL; + } + + packet = mosquitto__calloc(1, sizeof(struct mosquitto__packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + if(clientid){ + payloadlen = 2+strlen(clientid); + }else{ + payloadlen = 2; + } + if(mosq->will){ + will = 1; + assert(mosq->will->msg.topic); + + payloadlen += 2+strlen(mosq->will->msg.topic) + 2+mosq->will->msg.payloadlen; + if(mosq->protocol == mosq_p_mqtt5){ + will_proplen = property__get_length_all(mosq->will->properties); + varbytes = packet__varint_bytes(will_proplen); + payloadlen += will_proplen + varbytes; + } + } + + /* After this check we can be sure that the username and password are + * always valid for the current protocol, so there is no need to check + * username before checking password. */ + if(mosq->protocol == mosq_p_mqtt31 || mosq->protocol == mosq_p_mqtt311){ + if(password != NULL && username == NULL){ + return MOSQ_ERR_INVAL; + } + } + + if(username){ + payloadlen += 2+strlen(username); + } + if(password){ + payloadlen += 2+strlen(password); + } + + packet->command = CMD_CONNECT; + packet->remaining_length = headerlen + payloadlen; + rc = packet__alloc(packet); + if(rc){ + mosquitto__free(packet); + return rc; + } + + /* Variable header */ + if(version == MQTT_PROTOCOL_V31){ + packet__write_string(packet, PROTOCOL_NAME_v31, strlen(PROTOCOL_NAME_v31)); + }else{ + packet__write_string(packet, PROTOCOL_NAME, strlen(PROTOCOL_NAME)); + } +#if defined(WITH_BROKER) && defined(WITH_BRIDGE) + if(mosq->bridge && mosq->bridge->try_private && mosq->bridge->try_private_accepted){ + version |= 0x80; + }else{ + } +#endif + packet__write_byte(packet, version); + byte = (clean_session&0x1)<<1; + if(will){ + byte = byte | ((mosq->will->msg.retain&0x1)<<5) | ((mosq->will->msg.qos&0x3)<<3) | ((will&0x1)<<2); + } + if(username){ + byte = byte | 0x1<<7; + } + if(mosq->password){ + byte = byte | 0x1<<6; + } + packet__write_byte(packet, byte); + packet__write_uint16(packet, keepalive); + + if(mosq->protocol == mosq_p_mqtt5){ + /* Write properties */ + packet__write_varint(packet, proplen); + property__write_all(packet, properties, false); + property__write_all(packet, local_props, false); + } + + /* Payload */ + if(clientid){ + packet__write_string(packet, clientid, strlen(clientid)); + }else{ + packet__write_uint16(packet, 0); + } + if(will){ + if(mosq->protocol == mosq_p_mqtt5){ + /* Write will properties */ + property__write_all(packet, mosq->will->properties, true); + } + packet__write_string(packet, mosq->will->msg.topic, strlen(mosq->will->msg.topic)); + packet__write_string(packet, (const char *)mosq->will->msg.payload, mosq->will->msg.payloadlen); + } + + if(username){ + packet__write_string(packet, username, strlen(username)); + } + if(password){ + packet__write_string(packet, password, strlen(password)); + } + + mosq->keepalive = keepalive; +#ifdef WITH_BROKER +# ifdef WITH_BRIDGE + log__printf(mosq, MOSQ_LOG_DEBUG, "Bridge %s sending CONNECT", clientid); +# endif +#else + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending CONNECT", clientid); +#endif + return packet__queue(mosq, packet); +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_connect.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_connect.o new file mode 100644 index 0000000..3250c65 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_connect.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_disconnect.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_disconnect.c new file mode 100644 index 0000000..3598988 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_disconnect.c @@ -0,0 +1,85 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> + +#ifdef WITH_BROKER +# include "mosquitto_broker_internal.h" +#endif + +#include "mosquitto.h" +#include "mosquitto_internal.h" +#include "logging_mosq.h" +#include "memory_mosq.h" +#include "mqtt_protocol.h" +#include "packet_mosq.h" +#include "property_mosq.h" +#include "send_mosq.h" + + +int send__disconnect(struct mosquitto *mosq, uint8_t reason_code, const mosquitto_property *properties) +{ + struct mosquitto__packet *packet = NULL; + int rc; + int proplen, varbytes; + + assert(mosq); +#ifdef WITH_BROKER +# ifdef WITH_BRIDGE + if(mosq->bridge){ + log__printf(mosq, MOSQ_LOG_DEBUG, "Bridge %s sending DISCONNECT", mosq->id); + }else +# else + { + log__printf(mosq, MOSQ_LOG_DEBUG, "Sending DISCONNECT to %s (rc%d)", mosq->id, reason_code); + } +# endif +#else + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending DISCONNECT", mosq->id); +#endif + assert(mosq); + packet = mosquitto__calloc(1, sizeof(struct mosquitto__packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + packet->command = CMD_DISCONNECT; + if(mosq->protocol == mosq_p_mqtt5 && (reason_code != 0 || properties)){ + packet->remaining_length = 1; + if(properties){ + proplen = property__get_length_all(properties); + varbytes = packet__varint_bytes(proplen); + packet->remaining_length += proplen + varbytes; + } + }else{ + packet->remaining_length = 0; + } + + rc = packet__alloc(packet); + if(rc){ + mosquitto__free(packet); + return rc; + } + if(mosq->protocol == mosq_p_mqtt5 && (reason_code != 0 || properties)){ + packet__write_byte(packet, reason_code); + if(properties){ + property__write_all(packet, properties, true); + } + } + + return packet__queue(mosq, packet); +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_disconnect.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_disconnect.o new file mode 100644 index 0000000..be82295 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_disconnect.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_mosq.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_mosq.c new file mode 100644 index 0000000..27bc1fd --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_mosq.c @@ -0,0 +1,188 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <stdio.h> +#include <string.h> + +#ifdef WITH_BROKER +# include "mosquitto_broker_internal.h" +# include "sys_tree.h" +#else +# define G_PUB_BYTES_SENT_INC(A) +#endif + +#include "mosquitto.h" +#include "mosquitto_internal.h" +#include "logging_mosq.h" +#include "mqtt_protocol.h" +#include "memory_mosq.h" +#include "net_mosq.h" +#include "packet_mosq.h" +#include "property_mosq.h" +#include "send_mosq.h" +#include "time_mosq.h" +#include "util_mosq.h" + +int send__pingreq(struct mosquitto *mosq) +{ + int rc; + assert(mosq); +#ifdef WITH_BROKER + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PINGREQ to %s", mosq->id); +#else + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PINGREQ", mosq->id); +#endif + rc = send__simple_command(mosq, CMD_PINGREQ); + if(rc == MOSQ_ERR_SUCCESS){ + mosq->ping_t = mosquitto_time(); + } + return rc; +} + +int send__pingresp(struct mosquitto *mosq) +{ +#ifdef WITH_BROKER + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PINGRESP to %s", mosq->id); +#else + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PINGRESP", mosq->id); +#endif + return send__simple_command(mosq, CMD_PINGRESP); +} + +int send__puback(struct mosquitto *mosq, uint16_t mid, uint8_t reason_code) +{ +#ifdef WITH_BROKER + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBACK to %s (m%d, rc%d)", mosq->id, mid, reason_code); +#else + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBACK (m%d, rc%d)", mosq->id, mid, reason_code); +#endif + util__increment_receive_quota(mosq); + /* We don't use Reason String or User Property yet. */ + return send__command_with_mid(mosq, CMD_PUBACK, mid, false, reason_code, NULL); +} + +int send__pubcomp(struct mosquitto *mosq, uint16_t mid) +{ +#ifdef WITH_BROKER + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBCOMP to %s (m%d)", mosq->id, mid); +#else + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBCOMP (m%d)", mosq->id, mid); +#endif + util__increment_receive_quota(mosq); + /* We don't use Reason String or User Property yet. */ + return send__command_with_mid(mosq, CMD_PUBCOMP, mid, false, 0, NULL); +} + + +int send__pubrec(struct mosquitto *mosq, uint16_t mid, uint8_t reason_code) +{ +#ifdef WITH_BROKER + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBREC to %s (m%d, rc%d)", mosq->id, mid, reason_code); +#else + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBREC (m%d, rc%d)", mosq->id, mid, reason_code); +#endif + if(reason_code >= 0x80 && mosq->protocol == mosq_p_mqtt5){ + util__increment_receive_quota(mosq); + } + /* We don't use Reason String or User Property yet. */ + return send__command_with_mid(mosq, CMD_PUBREC, mid, false, reason_code, NULL); +} + +int send__pubrel(struct mosquitto *mosq, uint16_t mid) +{ +#ifdef WITH_BROKER + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBREL to %s (m%d)", mosq->id, mid); +#else + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBREL (m%d)", mosq->id, mid); +#endif + /* We don't use Reason String or User Property yet. */ + return send__command_with_mid(mosq, CMD_PUBREL|2, mid, false, 0, NULL); +} + +/* For PUBACK, PUBCOMP, PUBREC, and PUBREL */ +int send__command_with_mid(struct mosquitto *mosq, uint8_t command, uint16_t mid, bool dup, uint8_t reason_code, const mosquitto_property *properties) +{ + struct mosquitto__packet *packet = NULL; + int rc; + int proplen, varbytes; + + assert(mosq); + packet = mosquitto__calloc(1, sizeof(struct mosquitto__packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + packet->command = command; + if(dup){ + packet->command |= 8; + } + packet->remaining_length = 2; + + if(mosq->protocol == mosq_p_mqtt5){ + if(reason_code != 0 || properties){ + packet->remaining_length += 1; + } + + if(properties){ + proplen = property__get_length_all(properties); + varbytes = packet__varint_bytes(proplen); + packet->remaining_length += varbytes + proplen; + } + } + + rc = packet__alloc(packet); + if(rc){ + mosquitto__free(packet); + return rc; + } + + packet__write_uint16(packet, mid); + + if(mosq->protocol == mosq_p_mqtt5){ + if(reason_code != 0 || properties){ + packet__write_byte(packet, reason_code); + } + if(properties){ + property__write_all(packet, properties, true); + } + } + + return packet__queue(mosq, packet); +} + +/* For DISCONNECT, PINGREQ and PINGRESP */ +int send__simple_command(struct mosquitto *mosq, uint8_t command) +{ + struct mosquitto__packet *packet = NULL; + int rc; + + assert(mosq); + packet = mosquitto__calloc(1, sizeof(struct mosquitto__packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + packet->command = command; + packet->remaining_length = 0; + + rc = packet__alloc(packet); + if(rc){ + mosquitto__free(packet); + return rc; + } + + return packet__queue(mosq, packet); +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_mosq.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_mosq.h new file mode 100644 index 0000000..4b76f2f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_mosq.h @@ -0,0 +1,38 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ +#ifndef SEND_MOSQ_H +#define SEND_MOSQ_H + +#include "mosquitto.h" +#include "property_mosq.h" + +int send__simple_command(struct mosquitto *mosq, uint8_t command); +int send__command_with_mid(struct mosquitto *mosq, uint8_t command, uint16_t mid, bool dup, uint8_t reason_code, const mosquitto_property *properties); +int send__real_publish(struct mosquitto *mosq, uint16_t mid, const char *topic, uint32_t payloadlen, const void *payload, int qos, bool retain, bool dup, const mosquitto_property *cmsg_props, const mosquitto_property *store_props, uint32_t expiry_interval); + +int send__connect(struct mosquitto *mosq, uint16_t keepalive, bool clean_session, const mosquitto_property *properties); +int send__disconnect(struct mosquitto *mosq, uint8_t reason_code, const mosquitto_property *properties); +int send__pingreq(struct mosquitto *mosq); +int send__pingresp(struct mosquitto *mosq); +int send__puback(struct mosquitto *mosq, uint16_t mid, uint8_t reason_code); +int send__pubcomp(struct mosquitto *mosq, uint16_t mid); +int send__publish(struct mosquitto *mosq, uint16_t mid, const char *topic, uint32_t payloadlen, const void *payload, int qos, bool retain, bool dup, const mosquitto_property *cmsg_props, const mosquitto_property *store_props, uint32_t expiry_interval); +int send__pubrec(struct mosquitto *mosq, uint16_t mid, uint8_t reason_code); +int send__pubrel(struct mosquitto *mosq, uint16_t mid); +int send__subscribe(struct mosquitto *mosq, int *mid, int topic_count, char *const *const topic, int topic_qos, const mosquitto_property *properties); +int send__unsubscribe(struct mosquitto *mosq, int *mid, int topic_count, char *const *const topic, const mosquitto_property *properties); + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_mosq.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_mosq.o new file mode 100644 index 0000000..c90e59e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_mosq.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_publish.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_publish.c new file mode 100644 index 0000000..f07c539 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_publish.c @@ -0,0 +1,215 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <string.h> + +#ifdef WITH_BROKER +# include "mosquitto_broker_internal.h" +# include "sys_tree.h" +#else +# define G_PUB_BYTES_SENT_INC(A) +#endif + +#include "mosquitto.h" +#include "mosquitto_internal.h" +#include "logging_mosq.h" +#include "mqtt_protocol.h" +#include "memory_mosq.h" +#include "net_mosq.h" +#include "packet_mosq.h" +#include "property_mosq.h" +#include "send_mosq.h" + + +int send__publish(struct mosquitto *mosq, uint16_t mid, const char *topic, uint32_t payloadlen, const void *payload, int qos, bool retain, bool dup, const mosquitto_property *cmsg_props, const mosquitto_property *store_props, uint32_t expiry_interval) +{ +#ifdef WITH_BROKER + size_t len; +#ifdef WITH_BRIDGE + int i; + struct mosquitto__bridge_topic *cur_topic; + bool match; + int rc; + char *mapped_topic = NULL; + char *topic_temp = NULL; +#endif +#endif + assert(mosq); + +#if defined(WITH_BROKER) && defined(WITH_WEBSOCKETS) + if(mosq->sock == INVALID_SOCKET && !mosq->wsi) return MOSQ_ERR_NO_CONN; +#else + if(mosq->sock == INVALID_SOCKET) return MOSQ_ERR_NO_CONN; +#endif + +#ifdef WITH_BROKER + if(mosq->listener && mosq->listener->mount_point){ + len = strlen(mosq->listener->mount_point); + if(len < strlen(topic)){ + topic += len; + }else{ + /* Invalid topic string. Should never happen, but silently swallow the message anyway. */ + return MOSQ_ERR_SUCCESS; + } + } +#ifdef WITH_BRIDGE + if(mosq->bridge && mosq->bridge->topics && mosq->bridge->topic_remapping){ + for(i=0; i<mosq->bridge->topic_count; i++){ + cur_topic = &mosq->bridge->topics[i]; + if((cur_topic->direction == bd_both || cur_topic->direction == bd_out) + && (cur_topic->remote_prefix || cur_topic->local_prefix)){ + /* Topic mapping required on this topic if the message matches */ + + rc = mosquitto_topic_matches_sub(cur_topic->local_topic, topic, &match); + if(rc){ + return rc; + } + if(match){ + mapped_topic = mosquitto__strdup(topic); + if(!mapped_topic) return MOSQ_ERR_NOMEM; + if(cur_topic->local_prefix){ + /* This prefix needs removing. */ + if(!strncmp(cur_topic->local_prefix, mapped_topic, strlen(cur_topic->local_prefix))){ + topic_temp = mosquitto__strdup(mapped_topic+strlen(cur_topic->local_prefix)); + mosquitto__free(mapped_topic); + if(!topic_temp){ + return MOSQ_ERR_NOMEM; + } + mapped_topic = topic_temp; + } + } + + if(cur_topic->remote_prefix){ + /* This prefix needs adding. */ + len = strlen(mapped_topic) + strlen(cur_topic->remote_prefix)+1; + topic_temp = mosquitto__malloc(len+1); + if(!topic_temp){ + mosquitto__free(mapped_topic); + return MOSQ_ERR_NOMEM; + } + snprintf(topic_temp, len, "%s%s", cur_topic->remote_prefix, mapped_topic); + topic_temp[len] = '\0'; + mosquitto__free(mapped_topic); + mapped_topic = topic_temp; + } + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBLISH to %s (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", mosq->id, dup, qos, retain, mid, mapped_topic, (long)payloadlen); + G_PUB_BYTES_SENT_INC(payloadlen); + rc = send__real_publish(mosq, mid, mapped_topic, payloadlen, payload, qos, retain, dup, cmsg_props, store_props, expiry_interval); + mosquitto__free(mapped_topic); + return rc; + } + } + } + } +#endif + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBLISH to %s (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", mosq->id, dup, qos, retain, mid, topic, (long)payloadlen); + G_PUB_BYTES_SENT_INC(payloadlen); +#else + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBLISH (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", mosq->id, dup, qos, retain, mid, topic, (long)payloadlen); +#endif + + return send__real_publish(mosq, mid, topic, payloadlen, payload, qos, retain, dup, cmsg_props, store_props, expiry_interval); +} + + +int send__real_publish(struct mosquitto *mosq, uint16_t mid, const char *topic, uint32_t payloadlen, const void *payload, int qos, bool retain, bool dup, const mosquitto_property *cmsg_props, const mosquitto_property *store_props, uint32_t expiry_interval) +{ + struct mosquitto__packet *packet = NULL; + int packetlen; + int proplen = 0, varbytes; + int rc; + mosquitto_property expiry_prop; + + assert(mosq); + + if(topic){ + packetlen = 2+strlen(topic) + payloadlen; + }else{ + packetlen = 2 + payloadlen; + } + if(qos > 0) packetlen += 2; /* For message id */ + if(mosq->protocol == mosq_p_mqtt5){ + proplen = 0; + proplen += property__get_length_all(cmsg_props); + proplen += property__get_length_all(store_props); + if(expiry_interval > 0){ + expiry_prop.next = NULL; + expiry_prop.value.i32 = expiry_interval; + expiry_prop.identifier = MQTT_PROP_MESSAGE_EXPIRY_INTERVAL; + expiry_prop.client_generated = false; + + proplen += property__get_length_all(&expiry_prop); + } + + varbytes = packet__varint_bytes(proplen); + if(varbytes > 4){ + /* FIXME - Properties too big, don't publish any - should remove some first really */ + cmsg_props = NULL; + store_props = NULL; + expiry_interval = 0; + }else{ + packetlen += proplen + varbytes; + } + } + if(packet__check_oversize(mosq, packetlen)){ +#ifdef WITH_BROKER + log__printf(NULL, MOSQ_LOG_NOTICE, "Dropping too large outgoing PUBLISH for %s (%d bytes)", mosq->id, packetlen); +#else + log__printf(NULL, MOSQ_LOG_NOTICE, "Dropping too large outgoing PUBLISH (%d bytes)", packetlen); +#endif + return MOSQ_ERR_OVERSIZE_PACKET; + } + + packet = mosquitto__calloc(1, sizeof(struct mosquitto__packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + packet->mid = mid; + packet->command = CMD_PUBLISH | ((dup&0x1)<<3) | (qos<<1) | retain; + packet->remaining_length = packetlen; + rc = packet__alloc(packet); + if(rc){ + mosquitto__free(packet); + return rc; + } + /* Variable header (topic string) */ + if(topic){ + packet__write_string(packet, topic, strlen(topic)); + }else{ + packet__write_uint16(packet, 0); + } + if(qos > 0){ + packet__write_uint16(packet, mid); + } + + if(mosq->protocol == mosq_p_mqtt5){ + packet__write_varint(packet, proplen); + property__write_all(packet, cmsg_props, false); + property__write_all(packet, store_props, false); + if(expiry_interval > 0){ + property__write_all(packet, &expiry_prop, false); + } + } + + /* Payload */ + if(payloadlen){ + packet__write_bytes(packet, payload, payloadlen); + } + + return packet__queue(mosq, packet); +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_publish.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_publish.o new file mode 100644 index 0000000..86e2e17 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_publish.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_subscribe.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_subscribe.c new file mode 100644 index 0000000..1f2760f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_subscribe.c @@ -0,0 +1,96 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <string.h> + +#ifdef WITH_BROKER +# include "mosquitto_broker_internal.h" +#endif + +#include "mosquitto.h" +#include "mosquitto_internal.h" +#include "logging_mosq.h" +#include "memory_mosq.h" +#include "mqtt_protocol.h" +#include "packet_mosq.h" +#include "property_mosq.h" +#include "util_mosq.h" + + +int send__subscribe(struct mosquitto *mosq, int *mid, int topic_count, const char **topic, int topic_qos, const mosquitto_property *properties) +{ + struct mosquitto__packet *packet = NULL; + uint32_t packetlen; + uint16_t local_mid; + int rc; + int i; + int proplen, varbytes; + + assert(mosq); + assert(topic); + + packet = mosquitto__calloc(1, sizeof(struct mosquitto__packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + packetlen = 2; + if(mosq->protocol == mosq_p_mqtt5){ + proplen = property__get_length_all(properties); + varbytes = packet__varint_bytes(proplen); + packetlen += proplen + varbytes; + } + for(i=0; i<topic_count; i++){ + packetlen += 2+strlen(topic[i]) + 1; + } + + packet->command = CMD_SUBSCRIBE | (1<<1); + packet->remaining_length = packetlen; + rc = packet__alloc(packet); + if(rc){ + mosquitto__free(packet); + return rc; + } + + /* Variable header */ + local_mid = mosquitto__mid_generate(mosq); + if(mid) *mid = (int)local_mid; + packet__write_uint16(packet, local_mid); + + if(mosq->protocol == mosq_p_mqtt5){ + property__write_all(packet, properties, true); + } + + /* Payload */ + for(i=0; i<topic_count; i++){ + packet__write_string(packet, topic[i], strlen(topic[i])); + packet__write_byte(packet, topic_qos); + } + +#ifdef WITH_BROKER +# ifdef WITH_BRIDGE + log__printf(mosq, MOSQ_LOG_DEBUG, "Bridge %s sending SUBSCRIBE (Mid: %d, Topic: %s, QoS: %d, Options: 0x%02x)", mosq->id, local_mid, topic[0], topic_qos&0x03, topic_qos&0xFC); +# endif +#else + for(i=0; i<topic_count; i++){ + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending SUBSCRIBE (Mid: %d, Topic: %s, QoS: %d, Options: 0x%02x)", mosq->id, local_mid, topic[i], topic_qos&0x03, topic_qos&0xFC); + } +#endif + + return packet__queue(mosq, packet); +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_subscribe.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_subscribe.o new file mode 100644 index 0000000..a161540 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_subscribe.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_unsubscribe.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_unsubscribe.c new file mode 100644 index 0000000..e731715 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_unsubscribe.c @@ -0,0 +1,99 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <string.h> + +#ifdef WITH_BROKER +# include "mosquitto_broker_internal.h" +#endif + +#include "mosquitto.h" +#include "logging_mosq.h" +#include "memory_mosq.h" +#include "mqtt_protocol.h" +#include "packet_mosq.h" +#include "property_mosq.h" +#include "send_mosq.h" +#include "util_mosq.h" + + +int send__unsubscribe(struct mosquitto *mosq, int *mid, int topic_count, char *const *const topic, const mosquitto_property *properties) +{ + /* FIXME - only deals with a single topic */ + struct mosquitto__packet *packet = NULL; + uint32_t packetlen; + uint16_t local_mid; + int rc; + int proplen, varbytes; + int i; + + assert(mosq); + assert(topic); + + packet = mosquitto__calloc(1, sizeof(struct mosquitto__packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + packetlen = 2; + + for(i=0; i<topic_count; i++){ + packetlen += 2+strlen(topic[i]); + } + if(mosq->protocol == mosq_p_mqtt5){ + proplen = property__get_length_all(properties); + varbytes = packet__varint_bytes(proplen); + packetlen += proplen + varbytes; + } + + packet->command = CMD_UNSUBSCRIBE | (1<<1); + packet->remaining_length = packetlen; + rc = packet__alloc(packet); + if(rc){ + mosquitto__free(packet); + return rc; + } + + /* Variable header */ + local_mid = mosquitto__mid_generate(mosq); + if(mid) *mid = (int)local_mid; + packet__write_uint16(packet, local_mid); + + if(mosq->protocol == mosq_p_mqtt5){ + /* We don't use User Property yet. */ + property__write_all(packet, properties, true); + } + + /* Payload */ + for(i=0; i<topic_count; i++){ + packet__write_string(packet, topic[i], strlen(topic[i])); + } + +#ifdef WITH_BROKER +# ifdef WITH_BRIDGE + for(i=0; i<topic_count; i++){ + log__printf(mosq, MOSQ_LOG_DEBUG, "Bridge %s sending UNSUBSCRIBE (Mid: %d, Topic: %s)", mosq->id, local_mid, topic[i]); + } +# endif +#else + for(i=0; i<topic_count; i++){ + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending UNSUBSCRIBE (Mid: %d, Topic: %s)", mosq->id, local_mid, topic[i]); + } +#endif + return packet__queue(mosq, packet); +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_unsubscribe.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_unsubscribe.o new file mode 100644 index 0000000..56e4401 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/send_unsubscribe.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/socks_mosq.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/socks_mosq.c new file mode 100644 index 0000000..0df58a4 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/socks_mosq.c @@ -0,0 +1,460 @@ +/* +Copyright (c) 2014-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <errno.h> +#include <string.h> +#include <limits.h> +#ifdef WIN32 +# include <ws2tcpip.h> +#elif __QNX__ +# include <sys/socket.h> +# include <netinet/in.h> +#else +# include <arpa/inet.h> +#endif +#ifdef __FreeBSD__ +# include <sys/socket.h> +# include <netinet/in.h> +#endif + +#include "mosquitto_internal.h" +#include "memory_mosq.h" +#include "net_mosq.h" +#include "packet_mosq.h" +#include "send_mosq.h" + +#define SOCKS_AUTH_NONE 0x00 +#define SOCKS_AUTH_GSS 0x01 +#define SOCKS_AUTH_USERPASS 0x02 +#define SOCKS_AUTH_NO_ACCEPTABLE 0xFF + +#define SOCKS_ATYPE_IP_V4 1 /* four bytes */ +#define SOCKS_ATYPE_DOMAINNAME 3 /* one byte length, followed by fqdn no null, 256 max chars */ +#define SOCKS_ATYPE_IP_V6 4 /* 16 bytes */ + +#define SOCKS_REPLY_SUCCEEDED 0x00 +#define SOCKS_REPLY_GENERAL_FAILURE 0x01 +#define SOCKS_REPLY_CONNECTION_NOT_ALLOWED 0x02 +#define SOCKS_REPLY_NETWORK_UNREACHABLE 0x03 +#define SOCKS_REPLY_HOST_UNREACHABLE 0x04 +#define SOCKS_REPLY_CONNECTION_REFUSED 0x05 +#define SOCKS_REPLY_TTL_EXPIRED 0x06 +#define SOCKS_REPLY_COMMAND_NOT_SUPPORTED 0x07 +#define SOCKS_REPLY_ADDRESS_TYPE_NOT_SUPPORTED 0x08 + +int mosquitto_socks5_set(struct mosquitto *mosq, const char *host, int port, const char *username, const char *password) +{ +#ifdef WITH_SOCKS + if(!mosq) return MOSQ_ERR_INVAL; + if(!host || strlen(host) > 256) return MOSQ_ERR_INVAL; + if(port < 1 || port > 65535) return MOSQ_ERR_INVAL; + + mosquitto__free(mosq->socks5_host); + mosq->socks5_host = NULL; + + mosq->socks5_host = mosquitto__strdup(host); + if(!mosq->socks5_host){ + return MOSQ_ERR_NOMEM; + } + + mosq->socks5_port = port; + + mosquitto__free(mosq->socks5_username); + mosq->socks5_username = NULL; + + mosquitto__free(mosq->socks5_password); + mosq->socks5_password = NULL; + + if(username){ + mosq->socks5_username = mosquitto__strdup(username); + if(!mosq->socks5_username){ + return MOSQ_ERR_NOMEM; + } + + if(password){ + mosq->socks5_password = mosquitto__strdup(password); + if(!mosq->socks5_password){ + mosquitto__free(mosq->socks5_username); + return MOSQ_ERR_NOMEM; + } + } + } + + return MOSQ_ERR_SUCCESS; +#else + return MOSQ_ERR_NOT_SUPPORTED; +#endif +} + +#ifdef WITH_SOCKS +int socks5__send(struct mosquitto *mosq) +{ + struct mosquitto__packet *packet; + int slen; + int ulen, plen; + + struct in_addr addr_ipv4; + struct in6_addr addr_ipv6; + int ipv4_pton_result; + int ipv6_pton_result; + + if(mosq->state == mosq_cs_socks5_new){ + packet = mosquitto__calloc(1, sizeof(struct mosquitto__packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + if(mosq->socks5_username){ + packet->packet_length = 4; + }else{ + packet->packet_length = 3; + } + packet->payload = mosquitto__malloc(sizeof(uint8_t)*packet->packet_length); + + packet->payload[0] = 0x05; + if(mosq->socks5_username){ + packet->payload[1] = 2; + packet->payload[2] = SOCKS_AUTH_NONE; + packet->payload[3] = SOCKS_AUTH_USERPASS; + }else{ + packet->payload[1] = 1; + packet->payload[2] = SOCKS_AUTH_NONE; + } + + pthread_mutex_lock(&mosq->state_mutex); + mosq->state = mosq_cs_socks5_start; + pthread_mutex_unlock(&mosq->state_mutex); + + mosq->in_packet.pos = 0; + mosq->in_packet.packet_length = 2; + mosq->in_packet.to_process = 2; + mosq->in_packet.payload = mosquitto__malloc(sizeof(uint8_t)*2); + if(!mosq->in_packet.payload){ + mosquitto__free(packet->payload); + mosquitto__free(packet); + return MOSQ_ERR_NOMEM; + } + + return packet__queue(mosq, packet); + }else if(mosq->state == mosq_cs_socks5_auth_ok){ + packet = mosquitto__calloc(1, sizeof(struct mosquitto__packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + ipv4_pton_result = inet_pton(AF_INET, mosq->host, &addr_ipv4); + ipv6_pton_result = inet_pton(AF_INET6, mosq->host, &addr_ipv6); + + if(ipv4_pton_result == 1){ + packet->packet_length = 10; + packet->payload = mosquitto__malloc(sizeof(uint8_t)*packet->packet_length); + if(!packet->payload){ + mosquitto__free(packet); + return MOSQ_ERR_NOMEM; + } + packet->payload[3] = SOCKS_ATYPE_IP_V4; + memcpy(&(packet->payload[4]), (const void*)&addr_ipv4, 4); + packet->payload[4+4] = MOSQ_MSB(mosq->port); + packet->payload[4+4+1] = MOSQ_LSB(mosq->port); + + }else if(ipv6_pton_result == 1){ + packet->packet_length = 22; + packet->payload = mosquitto__malloc(sizeof(uint8_t)*packet->packet_length); + if(!packet->payload){ + mosquitto__free(packet); + return MOSQ_ERR_NOMEM; + } + packet->payload[3] = SOCKS_ATYPE_IP_V6; + memcpy(&(packet->payload[4]), (const void*)&addr_ipv6, 16); + packet->payload[4+16] = MOSQ_MSB(mosq->port); + packet->payload[4+16+1] = MOSQ_LSB(mosq->port); + + }else{ + slen = strlen(mosq->host); + if(slen > UCHAR_MAX){ + return MOSQ_ERR_NOMEM; + } + packet->packet_length = 7 + slen; + packet->payload = mosquitto__malloc(sizeof(uint8_t)*packet->packet_length); + if(!packet->payload){ + mosquitto__free(packet); + return MOSQ_ERR_NOMEM; + } + packet->payload[3] = SOCKS_ATYPE_DOMAINNAME; + packet->payload[4] = (uint8_t)slen; + memcpy(&(packet->payload[5]), mosq->host, slen); + packet->payload[5+slen] = MOSQ_MSB(mosq->port); + packet->payload[6+slen] = MOSQ_LSB(mosq->port); + } + packet->payload[0] = 0x05; + packet->payload[1] = 0x01; + packet->payload[2] = 0x00; + + pthread_mutex_lock(&mosq->state_mutex); + mosq->state = mosq_cs_socks5_request; + pthread_mutex_unlock(&mosq->state_mutex); + + mosq->in_packet.pos = 0; + mosq->in_packet.packet_length = 5; + mosq->in_packet.to_process = 5; + mosq->in_packet.payload = mosquitto__malloc(sizeof(uint8_t)*5); + if(!mosq->in_packet.payload){ + mosquitto__free(packet->payload); + mosquitto__free(packet); + return MOSQ_ERR_NOMEM; + } + + return packet__queue(mosq, packet); + }else if(mosq->state == mosq_cs_socks5_send_userpass){ + packet = mosquitto__calloc(1, sizeof(struct mosquitto__packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + ulen = strlen(mosq->socks5_username); + plen = strlen(mosq->socks5_password); + packet->packet_length = 3 + ulen + plen; + packet->payload = mosquitto__malloc(sizeof(uint8_t)*packet->packet_length); + + + packet->payload[0] = 0x01; + packet->payload[1] = ulen; + memcpy(&(packet->payload[2]), mosq->socks5_username, ulen); + packet->payload[2+ulen] = plen; + memcpy(&(packet->payload[3+ulen]), mosq->socks5_password, plen); + + pthread_mutex_lock(&mosq->state_mutex); + mosq->state = mosq_cs_socks5_userpass_reply; + pthread_mutex_unlock(&mosq->state_mutex); + + mosq->in_packet.pos = 0; + mosq->in_packet.packet_length = 2; + mosq->in_packet.to_process = 2; + mosq->in_packet.payload = mosquitto__malloc(sizeof(uint8_t)*2); + if(!mosq->in_packet.payload){ + mosquitto__free(packet->payload); + mosquitto__free(packet); + return MOSQ_ERR_NOMEM; + } + + return packet__queue(mosq, packet); + } + return MOSQ_ERR_SUCCESS; +} + +int socks5__read(struct mosquitto *mosq) +{ + ssize_t len; + uint8_t *payload; + uint8_t i; + + if(mosq->state == mosq_cs_socks5_start){ + while(mosq->in_packet.to_process > 0){ + len = net__read(mosq, &(mosq->in_packet.payload[mosq->in_packet.pos]), mosq->in_packet.to_process); + if(len > 0){ + mosq->in_packet.pos += len; + mosq->in_packet.to_process -= len; + }else{ +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(errno == EAGAIN || errno == COMPAT_EWOULDBLOCK){ + return MOSQ_ERR_SUCCESS; + }else{ + packet__cleanup(&mosq->in_packet); + switch(errno){ + case 0: + return MOSQ_ERR_PROXY; + case COMPAT_ECONNRESET: + return MOSQ_ERR_CONN_LOST; + default: + return MOSQ_ERR_ERRNO; + } + } + } + } + if(mosq->in_packet.payload[0] != 5){ + packet__cleanup(&mosq->in_packet); + return MOSQ_ERR_PROXY; + } + switch(mosq->in_packet.payload[1]){ + case SOCKS_AUTH_NONE: + packet__cleanup(&mosq->in_packet); + mosq->state = mosq_cs_socks5_auth_ok; + return socks5__send(mosq); + case SOCKS_AUTH_USERPASS: + packet__cleanup(&mosq->in_packet); + mosq->state = mosq_cs_socks5_send_userpass; + return socks5__send(mosq); + default: + packet__cleanup(&mosq->in_packet); + return MOSQ_ERR_AUTH; + } + }else if(mosq->state == mosq_cs_socks5_userpass_reply){ + while(mosq->in_packet.to_process > 0){ + len = net__read(mosq, &(mosq->in_packet.payload[mosq->in_packet.pos]), mosq->in_packet.to_process); + if(len > 0){ + mosq->in_packet.pos += len; + mosq->in_packet.to_process -= len; + }else{ +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(errno == EAGAIN || errno == COMPAT_EWOULDBLOCK){ + return MOSQ_ERR_SUCCESS; + }else{ + packet__cleanup(&mosq->in_packet); + switch(errno){ + case 0: + return MOSQ_ERR_PROXY; + case COMPAT_ECONNRESET: + return MOSQ_ERR_CONN_LOST; + default: + return MOSQ_ERR_ERRNO; + } + } + } + } + if(mosq->in_packet.payload[0] != 1){ + packet__cleanup(&mosq->in_packet); + return MOSQ_ERR_PROXY; + } + if(mosq->in_packet.payload[1] == 0){ + packet__cleanup(&mosq->in_packet); + mosq->state = mosq_cs_socks5_auth_ok; + return socks5__send(mosq); + }else{ + i = mosq->in_packet.payload[1]; + packet__cleanup(&mosq->in_packet); + switch(i){ + case SOCKS_REPLY_CONNECTION_NOT_ALLOWED: + return MOSQ_ERR_AUTH; + + case SOCKS_REPLY_NETWORK_UNREACHABLE: + case SOCKS_REPLY_HOST_UNREACHABLE: + case SOCKS_REPLY_CONNECTION_REFUSED: + return MOSQ_ERR_NO_CONN; + + case SOCKS_REPLY_GENERAL_FAILURE: + case SOCKS_REPLY_TTL_EXPIRED: + case SOCKS_REPLY_COMMAND_NOT_SUPPORTED: + case SOCKS_REPLY_ADDRESS_TYPE_NOT_SUPPORTED: + return MOSQ_ERR_PROXY; + + default: + return MOSQ_ERR_INVAL; + } + return MOSQ_ERR_PROXY; + } + }else if(mosq->state == mosq_cs_socks5_request){ + while(mosq->in_packet.to_process > 0){ + len = net__read(mosq, &(mosq->in_packet.payload[mosq->in_packet.pos]), mosq->in_packet.to_process); + if(len > 0){ + mosq->in_packet.pos += len; + mosq->in_packet.to_process -= len; + }else{ +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(errno == EAGAIN || errno == COMPAT_EWOULDBLOCK){ + return MOSQ_ERR_SUCCESS; + }else{ + packet__cleanup(&mosq->in_packet); + switch(errno){ + case 0: + return MOSQ_ERR_PROXY; + case COMPAT_ECONNRESET: + return MOSQ_ERR_CONN_LOST; + default: + return MOSQ_ERR_ERRNO; + } + } + } + } + + if(mosq->in_packet.packet_length == 5){ + /* First part of the packet has been received, we now know what else to expect. */ + if(mosq->in_packet.payload[3] == SOCKS_ATYPE_IP_V4){ + mosq->in_packet.to_process += 4+2-1; /* 4 bytes IPv4, 2 bytes port, -1 byte because we've already read the first byte */ + mosq->in_packet.packet_length += 4+2-1; + }else if(mosq->in_packet.payload[3] == SOCKS_ATYPE_IP_V6){ + mosq->in_packet.to_process += 16+2-1; /* 16 bytes IPv6, 2 bytes port, -1 byte because we've already read the first byte */ + mosq->in_packet.packet_length += 16+2-1; + }else if(mosq->in_packet.payload[3] == SOCKS_ATYPE_DOMAINNAME){ + if(mosq->in_packet.payload[4] > 0){ + mosq->in_packet.to_process += mosq->in_packet.payload[4]; + mosq->in_packet.packet_length += mosq->in_packet.payload[4]; + } + }else{ + packet__cleanup(&mosq->in_packet); + return MOSQ_ERR_PROTOCOL; + } + payload = mosquitto__realloc(mosq->in_packet.payload, mosq->in_packet.packet_length); + if(payload){ + mosq->in_packet.payload = payload; + }else{ + packet__cleanup(&mosq->in_packet); + return MOSQ_ERR_NOMEM; + } + payload = mosquitto__realloc(mosq->in_packet.payload, mosq->in_packet.packet_length); + if(payload){ + mosq->in_packet.payload = payload; + }else{ + packet__cleanup(&mosq->in_packet); + return MOSQ_ERR_NOMEM; + } + return MOSQ_ERR_SUCCESS; + } + + /* Entire packet is now read. */ + if(mosq->in_packet.payload[0] != 5){ + packet__cleanup(&mosq->in_packet); + return MOSQ_ERR_PROXY; + } + if(mosq->in_packet.payload[1] == 0){ + /* Auth passed */ + packet__cleanup(&mosq->in_packet); + mosq->state = mosq_cs_new; + if(mosq->socks5_host){ + int rc = net__socket_connect_step3(mosq, mosq->host); + if(rc) return rc; + } + return send__connect(mosq, mosq->keepalive, mosq->clean_start, NULL); + }else{ + i = mosq->in_packet.payload[1]; + packet__cleanup(&mosq->in_packet); + mosq->state = mosq_cs_socks5_new; + switch(i){ + case SOCKS_REPLY_CONNECTION_NOT_ALLOWED: + return MOSQ_ERR_AUTH; + + case SOCKS_REPLY_NETWORK_UNREACHABLE: + case SOCKS_REPLY_HOST_UNREACHABLE: + case SOCKS_REPLY_CONNECTION_REFUSED: + return MOSQ_ERR_NO_CONN; + + case SOCKS_REPLY_GENERAL_FAILURE: + case SOCKS_REPLY_TTL_EXPIRED: + case SOCKS_REPLY_COMMAND_NOT_SUPPORTED: + case SOCKS_REPLY_ADDRESS_TYPE_NOT_SUPPORTED: + return MOSQ_ERR_PROXY; + + default: + return MOSQ_ERR_INVAL; + } + } + }else{ + return packet__read(mosq); + } + return MOSQ_ERR_SUCCESS; +} +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/socks_mosq.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/socks_mosq.h new file mode 100644 index 0000000..27b3dc3 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/socks_mosq.h @@ -0,0 +1,23 @@ +/* +Copyright (c) 2014-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef SOCKS_MOSQ_H +#define SOCKS_MOSQ_H + +int socks5__send(struct mosquitto *mosq); +int socks5__read(struct mosquitto *mosq); + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/socks_mosq.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/socks_mosq.o new file mode 100644 index 0000000..4125961 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/socks_mosq.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/srv_mosq.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/srv_mosq.c new file mode 100644 index 0000000..d08c2bd --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/srv_mosq.c @@ -0,0 +1,112 @@ +/* +Copyright (c) 2013-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#ifdef WITH_SRV +# include <ares.h> + +# include <arpa/nameser.h> +# include <stdio.h> +# include <string.h> +#endif + +#include "logging_mosq.h" +#include "memory_mosq.h" +#include "mosquitto_internal.h" +#include "mosquitto.h" + +#ifdef WITH_SRV +static void srv_callback(void *arg, int status, int timeouts, unsigned char *abuf, int alen) +{ + struct mosquitto *mosq = arg; + struct ares_srv_reply *reply = NULL; + if(status == ARES_SUCCESS){ + status = ares_parse_srv_reply(abuf, alen, &reply); + if(status == ARES_SUCCESS){ + // FIXME - choose which answer to use based on rfc2782 page 3. */ + mosquitto_connect(mosq, reply->host, reply->port, mosq->keepalive); + } + }else{ + log__printf(mosq, MOSQ_LOG_ERR, "Error: SRV lookup failed (%d).", status); + /* FIXME - calling on_disconnect here isn't correct. */ + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_disconnect){ + mosq->in_callback = true; + mosq->on_disconnect(mosq, mosq->userdata, MOSQ_ERR_LOOKUP); + mosq->in_callback = false; + } + if(mosq->on_disconnect_v5){ + mosq->in_callback = true; + mosq->on_disconnect_v5(mosq, mosq->userdata, MOSQ_ERR_LOOKUP, NULL); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + } +} +#endif + +int mosquitto_connect_srv(struct mosquitto *mosq, const char *host, int keepalive, const char *bind_address) +{ +#ifdef WITH_SRV + char *h; + int rc; + if(!mosq) return MOSQ_ERR_INVAL; + + rc = ares_init(&mosq->achan); + if(rc != ARES_SUCCESS){ + return MOSQ_ERR_UNKNOWN; + } + + if(!host){ + // get local domain + }else{ +#ifdef WITH_TLS + if(mosq->tls_cafile || mosq->tls_capath || mosq->tls_psk){ + h = mosquitto__malloc(strlen(host) + strlen("_secure-mqtt._tcp.") + 1); + if(!h) return MOSQ_ERR_NOMEM; + sprintf(h, "_secure-mqtt._tcp.%s", host); + }else{ +#endif + h = mosquitto__malloc(strlen(host) + strlen("_mqtt._tcp.") + 1); + if(!h) return MOSQ_ERR_NOMEM; + sprintf(h, "_mqtt._tcp.%s", host); +#ifdef WITH_TLS + } +#endif + ares_search(mosq->achan, h, ns_c_in, ns_t_srv, srv_callback, mosq); + mosquitto__free(h); + } + + pthread_mutex_lock(&mosq->state_mutex); + mosq->state = mosq_cs_connect_srv; + pthread_mutex_unlock(&mosq->state_mutex); + + mosq->keepalive = keepalive; + + return MOSQ_ERR_SUCCESS; + +#else + UNUSED(mosq); + UNUSED(host); + UNUSED(keepalive); + UNUSED(bind_address); + + return MOSQ_ERR_NOT_SUPPORTED; +#endif +} + + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/srv_mosq.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/srv_mosq.o new file mode 100644 index 0000000..ab19a95 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/srv_mosq.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/thread_mosq.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/thread_mosq.c new file mode 100644 index 0000000..7bde453 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/thread_mosq.c @@ -0,0 +1,133 @@ +/* +Copyright (c) 2011-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#ifndef WIN32 +#include <time.h> +#endif + +#include "mosquitto_internal.h" +#include "net_mosq.h" + +void *mosquitto__thread_main(void *obj); + +int mosquitto_loop_start(struct mosquitto *mosq) +{ +#if defined(WITH_THREADING) && defined(HAVE_PTHREAD_CANCEL) + if(!mosq || mosq->threaded != mosq_ts_none) return MOSQ_ERR_INVAL; + + mosq->threaded = mosq_ts_self; + if(!pthread_create(&mosq->thread_id, NULL, mosquitto__thread_main, mosq)){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_ERRNO; + } +#else + return MOSQ_ERR_NOT_SUPPORTED; +#endif +} + +int mosquitto_loop_stop(struct mosquitto *mosq, bool force) +{ +#if defined(WITH_THREADING) && defined(HAVE_PTHREAD_CANCEL) +# ifndef WITH_BROKER + char sockpair_data = 0; +# endif + + if(!mosq || mosq->threaded != mosq_ts_self) return MOSQ_ERR_INVAL; + + + /* Write a single byte to sockpairW (connected to sockpairR) to break out + * of select() if in threaded mode. */ + if(mosq->sockpairW != INVALID_SOCKET){ +#ifndef WIN32 + if(write(mosq->sockpairW, &sockpair_data, 1)){ + } +#else + send(mosq->sockpairW, &sockpair_data, 1, 0); +#endif + } + + if(force){ + pthread_cancel(mosq->thread_id); + } + pthread_join(mosq->thread_id, NULL); + mosq->thread_id = pthread_self(); + mosq->threaded = mosq_ts_none; + + return MOSQ_ERR_SUCCESS; +#else + return MOSQ_ERR_NOT_SUPPORTED; +#endif +} + +#ifdef WITH_THREADING +void *mosquitto__thread_main(void *obj) +{ + struct mosquitto *mosq = obj; + int state; +#ifndef WIN32 + struct timespec ts; + ts.tv_sec = 0; + ts.tv_nsec = 10000000; +#endif + + if(!mosq) return NULL; + + do{ + pthread_mutex_lock(&mosq->state_mutex); + state = mosq->state; + pthread_mutex_unlock(&mosq->state_mutex); + if(state == mosq_cs_new){ +#ifdef WIN32 + Sleep(10); +#else + nanosleep(&ts, NULL); +#endif + }else{ + break; + } + }while(1); + + if(state == mosq_cs_connect_async){ + mosquitto_reconnect(mosq); + } + + if(!mosq->keepalive){ + /* Sleep for a day if keepalive disabled. */ + mosquitto_loop_forever(mosq, 1000*86400, 1); + }else{ + /* Sleep for our keepalive value. publish() etc. will wake us up. */ + mosquitto_loop_forever(mosq, mosq->keepalive*1000, 1); + } + + return obj; +} +#endif + +int mosquitto_threaded_set(struct mosquitto *mosq, bool threaded) +{ + if(!mosq) return MOSQ_ERR_INVAL; + + if(threaded){ + mosq->threaded = mosq_ts_external; + }else{ + mosq->threaded = mosq_ts_none; + } + + return MOSQ_ERR_SUCCESS; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/thread_mosq.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/thread_mosq.o new file mode 100644 index 0000000..de9d65e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/thread_mosq.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/time_mosq.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/time_mosq.c new file mode 100644 index 0000000..c66d985 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/time_mosq.c @@ -0,0 +1,61 @@ +/* +Copyright (c) 2013-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#ifdef __APPLE__ +#include <mach/mach.h> +#include <mach/mach_time.h> +#endif + +#ifdef WIN32 +# define _WIN32_WINNT _WIN32_WINNT_VISTA +# include <windows.h> +#else +# include <unistd.h> +#endif +#include <time.h> + +#include "mosquitto.h" +#include "time_mosq.h" + +time_t mosquitto_time(void) +{ +#ifdef WIN32 + return GetTickCount64()/1000; +#elif _POSIX_TIMERS>0 && defined(_POSIX_MONOTONIC_CLOCK) + struct timespec tp; + + clock_gettime(CLOCK_MONOTONIC, &tp); + return tp.tv_sec; +#elif defined(__APPLE__) + static mach_timebase_info_data_t tb; + uint64_t ticks; + uint64_t sec; + + ticks = mach_absolute_time(); + + if(tb.denom == 0){ + mach_timebase_info(&tb); + } + sec = ticks*tb.numer/tb.denom/1000000000; + + return (time_t)sec; +#else + return time(NULL); +#endif +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/time_mosq.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/time_mosq.h new file mode 100644 index 0000000..75758a8 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/time_mosq.h @@ -0,0 +1,22 @@ +/* +Copyright (c) 2013-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef TIME_MOSQ_H +#define TIME_MOSQ_H + +time_t mosquitto_time(void); + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/time_mosq.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/time_mosq.o new file mode 100644 index 0000000..0451e39 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/time_mosq.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/tls_mosq.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/tls_mosq.c new file mode 100644 index 0000000..c2f1204 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/tls_mosq.c @@ -0,0 +1,183 @@ +/* +Copyright (c) 2013-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifdef WITH_TLS + +#include "config.h" + +#ifdef WIN32 +# include <winsock2.h> +# include <ws2tcpip.h> +#else +# include <arpa/inet.h> +# include <sys/socket.h> +# include <strings.h> +#endif + +#include <string.h> +#include <openssl/conf.h> +#include <openssl/x509v3.h> +#include <openssl/ssl.h> + +#ifdef WITH_BROKER +# include "mosquitto_broker_internal.h" +#endif +#include "mosquitto_internal.h" +#include "logging_mosq.h" +#include "tls_mosq.h" + +extern int tls_ex_index_mosq; + +int mosquitto__server_certificate_verify(int preverify_ok, X509_STORE_CTX *ctx) +{ + /* Preverify should have already checked expiry, revocation. + * We need to verify the hostname. */ + struct mosquitto *mosq; + SSL *ssl; + X509 *cert; + + /* Always reject if preverify_ok has failed. */ + if(!preverify_ok) return 0; + + ssl = X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx()); + mosq = SSL_get_ex_data(ssl, tls_ex_index_mosq); + if(!mosq) return 0; + + if(mosq->tls_insecure == false){ + if(X509_STORE_CTX_get_error_depth(ctx) == 0){ + /* FIXME - use X509_check_host() etc. for sufficiently new openssl (>=1.1.x) */ + cert = X509_STORE_CTX_get_current_cert(ctx); + /* This is the peer certificate, all others are upwards in the chain. */ +#if defined(WITH_BROKER) + preverify_ok = mosquitto__verify_certificate_hostname(cert, mosq->bridge->addresses[mosq->bridge->cur_address].address); +#else + preverify_ok = mosquitto__verify_certificate_hostname(cert, mosq->host); +#endif + if (preverify_ok != 1) { + log__printf(mosq, MOSQ_LOG_ERR, "Error: host name verification failed."); + } + return preverify_ok; + }else{ + return preverify_ok; + } + }else{ + return preverify_ok; + } +} + +int mosquitto__cmp_hostname_wildcard(char *certname, const char *hostname) +{ + int i; + int len; + + if(!certname || !hostname){ + return 1; + } + + if(certname[0] == '*'){ + if(certname[1] != '.'){ + return 1; + } + certname += 2; + len = strlen(hostname); + for(i=0; i<len-1; i++){ + if(hostname[i] == '.'){ + hostname += i+1; + break; + } + } + return strcasecmp(certname, hostname); + }else{ + return strcasecmp(certname, hostname); + } +} + +/* This code is based heavily on the example provided in "Secure Programming + * Cookbook for C and C++". + */ +int mosquitto__verify_certificate_hostname(X509 *cert, const char *hostname) +{ + int i; + char name[256]; + X509_NAME *subj; + bool have_san_dns = false; + STACK_OF(GENERAL_NAME) *san; + const GENERAL_NAME *nval; + const unsigned char *data; + unsigned char ipv6_addr[16]; + unsigned char ipv4_addr[4]; + int ipv6_ok; + int ipv4_ok; + +#ifdef WIN32 + ipv6_ok = InetPton(AF_INET6, hostname, &ipv6_addr); + ipv4_ok = InetPton(AF_INET, hostname, &ipv4_addr); +#else + ipv6_ok = inet_pton(AF_INET6, hostname, &ipv6_addr); + ipv4_ok = inet_pton(AF_INET, hostname, &ipv4_addr); +#endif + + san = X509_get_ext_d2i(cert, NID_subject_alt_name, NULL, NULL); + if(san){ + for(i=0; i<sk_GENERAL_NAME_num(san); i++){ + nval = sk_GENERAL_NAME_value(san, i); + if(nval->type == GEN_DNS){ +#if OPENSSL_VERSION_NUMBER < 0x10100000L + data = ASN1_STRING_data(nval->d.dNSName); +#else + data = ASN1_STRING_get0_data(nval->d.dNSName); +#endif + if(data && !mosquitto__cmp_hostname_wildcard((char *)data, hostname)){ + sk_GENERAL_NAME_pop_free(san, GENERAL_NAME_free); + return 1; + } + have_san_dns = true; + }else if(nval->type == GEN_IPADD){ +#if OPENSSL_VERSION_NUMBER < 0x10100000L + data = ASN1_STRING_data(nval->d.iPAddress); +#else + data = ASN1_STRING_get0_data(nval->d.iPAddress); +#endif + if(nval->d.iPAddress->length == 4 && ipv4_ok){ + if(!memcmp(ipv4_addr, data, 4)){ + sk_GENERAL_NAME_pop_free(san, GENERAL_NAME_free); + return 1; + } + }else if(nval->d.iPAddress->length == 16 && ipv6_ok){ + if(!memcmp(ipv6_addr, data, 16)){ + sk_GENERAL_NAME_pop_free(san, GENERAL_NAME_free); + return 1; + } + } + } + } + sk_GENERAL_NAME_pop_free(san, GENERAL_NAME_free); + if(have_san_dns){ + /* Only check CN if subjectAltName DNS entry does not exist. */ + return 0; + } + } + + subj = X509_get_subject_name(cert); + if(X509_NAME_get_text_by_NID(subj, NID_commonName, name, sizeof(name)) > 0){ + name[sizeof(name) - 1] = '\0'; + if (!mosquitto__cmp_hostname_wildcard(name, hostname)) return 1; + } + return 0; +} + +#endif + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/tls_mosq.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/tls_mosq.h new file mode 100644 index 0000000..5a1cda5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/tls_mosq.h @@ -0,0 +1,36 @@ +/* +Copyright (c) 2013-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef TLS_MOSQ_H +#define TLS_MOSQ_H + +#ifdef WITH_TLS +# define SSL_DATA_PENDING(A) ((A)->ssl && SSL_pending((A)->ssl)) +#else +# define SSL_DATA_PENDING(A) 0 +#endif + +#ifdef WITH_TLS + +#include <openssl/ssl.h> +#include <openssl/engine.h> + +int mosquitto__server_certificate_verify(int preverify_ok, X509_STORE_CTX *ctx); +int mosquitto__verify_certificate_hostname(X509 *cert, const char *hostname); + +#endif /* WITH_TLS */ + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/tls_mosq.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/tls_mosq.o new file mode 100644 index 0000000..79c6a96 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/tls_mosq.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/utf8_mosq.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/utf8_mosq.c new file mode 100644 index 0000000..875c1c7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/utf8_mosq.c @@ -0,0 +1,109 @@ +/* +Copyright (c) 2016-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation. +*/ + +#include "config.h" + +#include <stdio.h> +#include "mosquitto.h" + +int mosquitto_validate_utf8(const char *str, int len) +{ + int i; + int j; + int codelen; + int codepoint; + const unsigned char *ustr = (const unsigned char *)str; + + if(!str) return MOSQ_ERR_INVAL; + if(len < 0 || len > 65536) return MOSQ_ERR_INVAL; + + for(i=0; i<len; i++){ + if(ustr[i] == 0){ + return MOSQ_ERR_MALFORMED_UTF8; + }else if(ustr[i] <= 0x7f){ + codelen = 1; + codepoint = ustr[i]; + }else if((ustr[i] & 0xE0) == 0xC0){ + /* 110xxxxx - 2 byte sequence */ + if(ustr[i] == 0xC0 || ustr[i] == 0xC1){ + /* Invalid bytes */ + return MOSQ_ERR_MALFORMED_UTF8; + } + codelen = 2; + codepoint = (ustr[i] & 0x1F); + }else if((ustr[i] & 0xF0) == 0xE0){ + // 1110xxxx - 3 byte sequence + codelen = 3; + codepoint = (ustr[i] & 0x0F); + }else if((ustr[i] & 0xF8) == 0xF0){ + // 11110xxx - 4 byte sequence + if(ustr[i] > 0xF4){ + /* Invalid, this would produce values > 0x10FFFF. */ + return MOSQ_ERR_MALFORMED_UTF8; + } + codelen = 4; + codepoint = (ustr[i] & 0x07); + }else{ + /* Unexpected continuation byte. */ + return MOSQ_ERR_MALFORMED_UTF8; + } + + /* Reconstruct full code point */ + if(i == len-codelen+1){ + /* Not enough data */ + return MOSQ_ERR_MALFORMED_UTF8; + } + for(j=0; j<codelen-1; j++){ + if((ustr[++i] & 0xC0) != 0x80){ + /* Not a continuation byte */ + return MOSQ_ERR_MALFORMED_UTF8; + } + codepoint = (codepoint<<6) | (ustr[i] & 0x3F); + } + + /* Check for UTF-16 high/low surrogates */ + if(codepoint >= 0xD800 && codepoint <= 0xDFFF){ + return MOSQ_ERR_MALFORMED_UTF8; + } + + /* Check for overlong or out of range encodings */ + /* Checking codelen == 2 isn't necessary here, because it is already + * covered above in the C0 and C1 checks. + * if(codelen == 2 && codepoint < 0x0080){ + * return MOSQ_ERR_MALFORMED_UTF8; + * }else + */ + if(codelen == 3 && codepoint < 0x0800){ + return MOSQ_ERR_MALFORMED_UTF8; + }else if(codelen == 4 && (codepoint < 0x10000 || codepoint > 0x10FFFF)){ + return MOSQ_ERR_MALFORMED_UTF8; + } + + /* Check for non-characters */ + if(codepoint >= 0xFDD0 && codepoint <= 0xFDEF){ + return MOSQ_ERR_MALFORMED_UTF8; + } + if((codepoint & 0xFFFF) == 0xFFFE || (codepoint & 0xFFFF) == 0xFFFF){ + return MOSQ_ERR_MALFORMED_UTF8; + } + /* Check for control characters */ + if(codepoint <= 0x001F || (codepoint >= 0x007F && codepoint <= 0x009F)){ + return MOSQ_ERR_MALFORMED_UTF8; + } + } + return MOSQ_ERR_SUCCESS; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/utf8_mosq.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/utf8_mosq.o new file mode 100644 index 0000000..99bd948 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/utf8_mosq.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/util_mosq.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/util_mosq.c new file mode 100644 index 0000000..5e1065e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/util_mosq.c @@ -0,0 +1,354 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <string.h> + +#ifdef WIN32 +# include <winsock2.h> +# include <aclapi.h> +# include <io.h> +# include <lmcons.h> +#else +# include <sys/stat.h> +#endif + +#if !defined(WITH_TLS) && defined(__linux__) && defined(__GLIBC__) +# if __GLIBC_PREREQ(2, 25) +# include <sys/random.h> +# define HAVE_GETRANDOM 1 +# endif +#endif + +#ifdef WITH_TLS +# include <openssl/bn.h> +# include <openssl/rand.h> +#endif + +#ifdef WITH_BROKER +#include "mosquitto_broker_internal.h" +#endif + +#include "mosquitto.h" +#include "memory_mosq.h" +#include "net_mosq.h" +#include "send_mosq.h" +#include "time_mosq.h" +#include "tls_mosq.h" +#include "util_mosq.h" + +#ifdef WITH_WEBSOCKETS +#include <libwebsockets.h> +#endif + +#ifdef WITH_BROKER +int mosquitto__check_keepalive(struct mosquitto_db *db, struct mosquitto *mosq) +#else +int mosquitto__check_keepalive(struct mosquitto *mosq) +#endif +{ + time_t next_msg_out; + time_t last_msg_in; + time_t now = mosquitto_time(); +#ifndef WITH_BROKER + int rc; +#endif + + assert(mosq); +#if defined(WITH_BROKER) && defined(WITH_BRIDGE) + /* Check if a lazy bridge should be timed out due to idle. */ + if(mosq->bridge && mosq->bridge->start_type == bst_lazy + && mosq->sock != INVALID_SOCKET + && now - mosq->next_msg_out - mosq->keepalive >= mosq->bridge->idle_timeout){ + + log__printf(NULL, MOSQ_LOG_NOTICE, "Bridge connection %s has exceeded idle timeout, disconnecting.", mosq->id); + net__socket_close(db, mosq); + return MOSQ_ERR_SUCCESS; + } +#endif + pthread_mutex_lock(&mosq->msgtime_mutex); + next_msg_out = mosq->next_msg_out; + last_msg_in = mosq->last_msg_in; + pthread_mutex_unlock(&mosq->msgtime_mutex); + if(mosq->keepalive && mosq->sock != INVALID_SOCKET && + (now >= next_msg_out || now - last_msg_in >= mosq->keepalive)){ + + if(mosq->state == mosq_cs_connected && mosq->ping_t == 0){ + send__pingreq(mosq); + /* Reset last msg times to give the server time to send a pingresp */ + pthread_mutex_lock(&mosq->msgtime_mutex); + mosq->last_msg_in = now; + mosq->next_msg_out = now + mosq->keepalive; + pthread_mutex_unlock(&mosq->msgtime_mutex); + }else{ +#ifdef WITH_BROKER + net__socket_close(db, mosq); +#else + net__socket_close(mosq); + pthread_mutex_lock(&mosq->state_mutex); + if(mosq->state == mosq_cs_disconnecting){ + rc = MOSQ_ERR_SUCCESS; + }else{ + rc = MOSQ_ERR_KEEPALIVE; + } + pthread_mutex_unlock(&mosq->state_mutex); + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_disconnect){ + mosq->in_callback = true; + mosq->on_disconnect(mosq, mosq->userdata, rc); + mosq->in_callback = false; + } + if(mosq->on_disconnect_v5){ + mosq->in_callback = true; + mosq->on_disconnect_v5(mosq, mosq->userdata, rc, NULL); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + + return rc; +#endif + } + } + return MOSQ_ERR_SUCCESS; +} + +uint16_t mosquitto__mid_generate(struct mosquitto *mosq) +{ + /* FIXME - this would be better with atomic increment, but this is safer + * for now for a bug fix release. + * + * If this is changed to use atomic increment, callers of this function + * will have to be aware that they may receive a 0 result, which may not be + * used as a mid. + */ + uint16_t mid; + assert(mosq); + + pthread_mutex_lock(&mosq->mid_mutex); + mosq->last_mid++; + if(mosq->last_mid == 0) mosq->last_mid++; + mid = mosq->last_mid; + pthread_mutex_unlock(&mosq->mid_mutex); + + return mid; +} + + +#ifdef WITH_TLS +int mosquitto__hex2bin_sha1(const char *hex, unsigned char **bin) +{ + unsigned char *sha, tmp[SHA_DIGEST_LENGTH]; + + if(mosquitto__hex2bin(hex, tmp, SHA_DIGEST_LENGTH) != SHA_DIGEST_LENGTH){ + return MOSQ_ERR_INVAL; + } + + sha = mosquitto__malloc(SHA_DIGEST_LENGTH); + memcpy(sha, tmp, SHA_DIGEST_LENGTH); + *bin = sha; + return MOSQ_ERR_SUCCESS; +} + +int mosquitto__hex2bin(const char *hex, unsigned char *bin, int bin_max_len) +{ + BIGNUM *bn = NULL; + int len; + int leading_zero = 0; + int start = 0; + size_t i = 0; + + /* Count the number of leading zero */ + for(i=0; i<strlen(hex); i=i+2) { + if(strncmp(hex + i, "00", 2) == 0) { + leading_zero++; + /* output leading zero to bin */ + bin[start++] = 0; + }else{ + break; + } + } + + if(BN_hex2bn(&bn, hex) == 0){ + if(bn) BN_free(bn); + return 0; + } + if(BN_num_bytes(bn) + leading_zero > bin_max_len){ + BN_free(bn); + return 0; + } + + len = BN_bn2bin(bn, bin + leading_zero); + BN_free(bn); + return len + leading_zero; +} +#endif + +FILE *mosquitto__fopen(const char *path, const char *mode, bool restrict_read) +{ +#ifdef WIN32 + char buf[4096]; + int rc; + rc = ExpandEnvironmentStrings(path, buf, 4096); + if(rc == 0 || rc > 4096){ + return NULL; + }else{ + if (restrict_read) { + HANDLE hfile; + SECURITY_ATTRIBUTES sec; + EXPLICIT_ACCESS ea; + PACL pacl = NULL; + char username[UNLEN + 1]; + int ulen = UNLEN; + SECURITY_DESCRIPTOR sd; + DWORD dwCreationDisposition; + + switch(mode[0]){ + case 'a': + dwCreationDisposition = OPEN_ALWAYS; + break; + case 'r': + dwCreationDisposition = OPEN_EXISTING; + break; + case 'w': + dwCreationDisposition = CREATE_ALWAYS; + break; + default: + return NULL; + } + + GetUserName(username, &ulen); + if (!InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION)) { + return NULL; + } + BuildExplicitAccessWithName(&ea, username, GENERIC_ALL, SET_ACCESS, NO_INHERITANCE); + if (SetEntriesInAcl(1, &ea, NULL, &pacl) != ERROR_SUCCESS) { + return NULL; + } + if (!SetSecurityDescriptorDacl(&sd, TRUE, pacl, FALSE)) { + LocalFree(pacl); + return NULL; + } + + sec.nLength = sizeof(SECURITY_ATTRIBUTES); + sec.bInheritHandle = FALSE; + sec.lpSecurityDescriptor = &sd; + + hfile = CreateFile(buf, GENERIC_READ | GENERIC_WRITE, 0, + &sec, + dwCreationDisposition, + FILE_ATTRIBUTE_NORMAL, + NULL); + + LocalFree(pacl); + + int fd = _open_osfhandle((intptr_t)hfile, 0); + if (fd < 0) { + return NULL; + } + + FILE *fptr = _fdopen(fd, mode); + if (!fptr) { + _close(fd); + return NULL; + } + return fptr; + + }else { + return fopen(buf, mode); + } + } +#else + if (restrict_read) { + FILE *fptr; + mode_t old_mask; + + old_mask = umask(0077); + fptr = fopen(path, mode); + umask(old_mask); + + return fptr; + }else{ + return fopen(path, mode); + } +#endif +} + +void util__increment_receive_quota(struct mosquitto *mosq) +{ + if(mosq->msgs_in.inflight_quota < mosq->msgs_in.inflight_maximum){ + mosq->msgs_in.inflight_quota++; + } +} + +void util__increment_send_quota(struct mosquitto *mosq) +{ + if(mosq->msgs_out.inflight_quota < mosq->msgs_out.inflight_maximum){ + mosq->msgs_out.inflight_quota++; + } +} + + +void util__decrement_receive_quota(struct mosquitto *mosq) +{ + if(mosq->msgs_in.inflight_quota > 0){ + mosq->msgs_in.inflight_quota--; + } +} + +void util__decrement_send_quota(struct mosquitto *mosq) +{ + if(mosq->msgs_out.inflight_quota > 0){ + mosq->msgs_out.inflight_quota--; + } +} + + +int util__random_bytes(void *bytes, int count) +{ + int rc = MOSQ_ERR_UNKNOWN; + +#ifdef WITH_TLS + if(RAND_bytes(bytes, count) == 1){ + rc = MOSQ_ERR_SUCCESS; + } +#elif defined(HAVE_GETRANDOM) + if(getrandom(bytes, count, 0) == count){ + rc = MOSQ_ERR_SUCCESS; + } +#elif defined(WIN32) + HCRYPTPROV provider; + + if(!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)){ + return MOSQ_ERR_UNKNOWN; + } + + if(CryptGenRandom(provider, count, bytes)){ + rc = MOSQ_ERR_SUCCESS; + } + + CryptReleaseContext(provider, 0); +#else + int i; + + for(i=0; i<count; i++){ + ((uint8_t *)bytes)[i] = (uint8_t )(random()&0xFF); + } + rc = MOSQ_ERR_SUCCESS; +#endif + return rc; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/util_mosq.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/util_mosq.h new file mode 100644 index 0000000..9ee570f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/util_mosq.h @@ -0,0 +1,47 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ +#ifndef UTIL_MOSQ_H +#define UTIL_MOSQ_H + +#include <stdio.h> + +#include "tls_mosq.h" +#include "mosquitto.h" +#include "mosquitto_internal.h" +#ifdef WITH_BROKER +# include "mosquitto_broker_internal.h" +#endif + +#ifdef WITH_BROKER +int mosquitto__check_keepalive(struct mosquitto_db *db, struct mosquitto *mosq); +#else +int mosquitto__check_keepalive(struct mosquitto *mosq); +#endif +uint16_t mosquitto__mid_generate(struct mosquitto *mosq); +FILE *mosquitto__fopen(const char *path, const char *mode, bool restrict_read); + +#ifdef WITH_TLS +int mosquitto__hex2bin_sha1(const char *hex, unsigned char **bin); +int mosquitto__hex2bin(const char *hex, unsigned char *bin, int bin_max_len); +#endif + +int util__random_bytes(void *bytes, int count); + +void util__increment_receive_quota(struct mosquitto *mosq); +void util__increment_send_quota(struct mosquitto *mosq); +void util__decrement_receive_quota(struct mosquitto *mosq); +void util__decrement_send_quota(struct mosquitto *mosq); +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/util_mosq.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/util_mosq.o new file mode 100644 index 0000000..64a82e9 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/util_mosq.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/util_topic.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/util_topic.c new file mode 100644 index 0000000..67b7878 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/util_topic.c @@ -0,0 +1,252 @@ +/* +Copyright (c) 2009-2018 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <string.h> + +#ifdef WIN32 +# include <winsock2.h> +# include <aclapi.h> +# include <io.h> +# include <lmcons.h> +#else +# include <sys/stat.h> +#endif + + +#ifdef WITH_BROKER +#include "mosquitto_broker_internal.h" +#endif + +#include "mosquitto.h" +#include "memory_mosq.h" +#include "net_mosq.h" +#include "send_mosq.h" +#include "time_mosq.h" +#include "tls_mosq.h" +#include "util_mosq.h" + +/* Check that a topic used for publishing is valid. + * Search for + or # in a topic. Return MOSQ_ERR_INVAL if found. + * Also returns MOSQ_ERR_INVAL if the topic string is too long. + * Returns MOSQ_ERR_SUCCESS if everything is fine. + */ +int mosquitto_pub_topic_check(const char *str) +{ + int len = 0; + while(str && str[0]){ + if(str[0] == '+' || str[0] == '#'){ + return MOSQ_ERR_INVAL; + } + len++; + str = &str[1]; + } + if(len > 65535) return MOSQ_ERR_INVAL; + + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_pub_topic_check2(const char *str, size_t len) +{ + size_t i; + + if(len > 65535) return MOSQ_ERR_INVAL; + + for(i=0; i<len; i++){ + if(str[i] == '+' || str[i] == '#'){ + return MOSQ_ERR_INVAL; + } + } + + return MOSQ_ERR_SUCCESS; +} + +/* Check that a topic used for subscriptions is valid. + * Search for + or # in a topic, check they aren't in invalid positions such as + * foo/#/bar, foo/+bar or foo/bar#. + * Return MOSQ_ERR_INVAL if invalid position found. + * Also returns MOSQ_ERR_INVAL if the topic string is too long. + * Returns MOSQ_ERR_SUCCESS if everything is fine. + */ +int mosquitto_sub_topic_check(const char *str) +{ + char c = '\0'; + int len = 0; + while(str && str[0]){ + if(str[0] == '+'){ + if((c != '\0' && c != '/') || (str[1] != '\0' && str[1] != '/')){ + return MOSQ_ERR_INVAL; + } + }else if(str[0] == '#'){ + if((c != '\0' && c != '/') || str[1] != '\0'){ + return MOSQ_ERR_INVAL; + } + } + len++; + c = str[0]; + str = &str[1]; + } + if(len > 65535) return MOSQ_ERR_INVAL; + + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_sub_topic_check2(const char *str, size_t len) +{ + char c = '\0'; + size_t i; + + if(len > 65535) return MOSQ_ERR_INVAL; + + for(i=0; i<len; i++){ + if(str[i] == '+'){ + if((c != '\0' && c != '/') || (i<len-1 && str[i+1] != '/')){ + return MOSQ_ERR_INVAL; + } + }else if(str[i] == '#'){ + if((c != '\0' && c != '/') || i<len-1){ + return MOSQ_ERR_INVAL; + } + } + c = str[i]; + } + + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_topic_matches_sub(const char *sub, const char *topic, bool *result) +{ + return mosquitto_topic_matches_sub2(sub, 0, topic, 0, result); +} + +/* Does a topic match a subscription? */ +int mosquitto_topic_matches_sub2(const char *sub, size_t sublen, const char *topic, size_t topiclen, bool *result) +{ + size_t spos; + + UNUSED(sublen); + UNUSED(topiclen); + + if(!result) return MOSQ_ERR_INVAL; + *result = false; + + if(!sub || !topic || sub[0] == 0 || topic[0] == 0){ + return MOSQ_ERR_INVAL; + } + + if((sub[0] == '$' && topic[0] != '$') + || (topic[0] == '$' && sub[0] != '$')){ + + return MOSQ_ERR_SUCCESS; + } + + spos = 0; + + while(sub[0] != 0){ + if(topic[0] == '+' || topic[0] == '#'){ + return MOSQ_ERR_INVAL; + } + if(sub[0] != topic[0] || topic[0] == 0){ /* Check for wildcard matches */ + if(sub[0] == '+'){ + /* Check for bad "+foo" or "a/+foo" subscription */ + if(spos > 0 && sub[-1] != '/'){ + return MOSQ_ERR_INVAL; + } + /* Check for bad "foo+" or "foo+/a" subscription */ + if(sub[1] != 0 && sub[1] != '/'){ + return MOSQ_ERR_INVAL; + } + spos++; + sub++; + while(topic[0] != 0 && topic[0] != '/'){ + topic++; + } + if(topic[0] == 0 && sub[0] == 0){ + *result = true; + return MOSQ_ERR_SUCCESS; + } + }else if(sub[0] == '#'){ + /* Check for bad "foo#" subscription */ + if(spos > 0 && sub[-1] != '/'){ + return MOSQ_ERR_INVAL; + } + /* Check for # not the final character of the sub, e.g. "#foo" */ + if(sub[1] != 0){ + return MOSQ_ERR_INVAL; + }else{ + *result = true; + return MOSQ_ERR_SUCCESS; + } + }else{ + /* Check for e.g. foo/bar matching foo/+/# */ + if(topic[0] == 0 + && spos > 0 + && sub[-1] == '+' + && sub[0] == '/' + && sub[1] == '#') + { + *result = true; + return MOSQ_ERR_SUCCESS; + } + + /* There is no match at this point, but is the sub invalid? */ + while(sub[0] != 0){ + if(sub[0] == '#' && sub[1] != 0){ + return MOSQ_ERR_INVAL; + } + spos++; + sub++; + } + + /* Valid input, but no match */ + return MOSQ_ERR_SUCCESS; + } + }else{ + /* sub[spos] == topic[tpos] */ + if(topic[1] == 0){ + /* Check for e.g. foo matching foo/# */ + if(sub[1] == '/' + && sub[2] == '#' + && sub[3] == 0){ + *result = true; + return MOSQ_ERR_SUCCESS; + } + } + spos++; + sub++; + topic++; + if(sub[0] == 0 && topic[0] == 0){ + *result = true; + return MOSQ_ERR_SUCCESS; + }else if(topic[0] == 0 && sub[0] == '+' && sub[1] == 0){ + if(spos > 0 && sub[-1] != '/'){ + return MOSQ_ERR_INVAL; + } + spos++; + sub++; + *result = true; + return MOSQ_ERR_SUCCESS; + } + } + } + if((topic[0] != 0 || sub[0] != 0)){ + *result = false; + } + + return MOSQ_ERR_SUCCESS; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/util_topic.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/util_topic.o new file mode 100644 index 0000000..c0e56dd --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/util_topic.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/will_mosq.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/will_mosq.c new file mode 100644 index 0000000..f9f1f32 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/will_mosq.c @@ -0,0 +1,126 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <stdio.h> +#include <string.h> + +#ifdef WITH_BROKER +# include "mosquitto_broker_internal.h" +#endif + +#include "mosquitto.h" +#include "mosquitto_internal.h" +#include "logging_mosq.h" +#include "messages_mosq.h" +#include "memory_mosq.h" +#include "mqtt_protocol.h" +#include "net_mosq.h" +#include "read_handle.h" +#include "send_mosq.h" +#include "util_mosq.h" +#include "will_mosq.h" + +int will__set(struct mosquitto *mosq, const char *topic, int payloadlen, const void *payload, int qos, bool retain, mosquitto_property *properties) +{ + int rc = MOSQ_ERR_SUCCESS; + mosquitto_property *p; + + if(!mosq || !topic) return MOSQ_ERR_INVAL; + if(payloadlen < 0 || payloadlen > MQTT_MAX_PAYLOAD) return MOSQ_ERR_PAYLOAD_SIZE; + if(payloadlen > 0 && !payload) return MOSQ_ERR_INVAL; + + if(mosquitto_pub_topic_check(topic)) return MOSQ_ERR_INVAL; + if(mosquitto_validate_utf8(topic, strlen(topic))) return MOSQ_ERR_MALFORMED_UTF8; + + if(properties){ + if(mosq->protocol != mosq_p_mqtt5){ + return MOSQ_ERR_NOT_SUPPORTED; + } + p = properties; + while(p){ + rc = mosquitto_property_check_command(CMD_WILL, p->identifier); + if(rc) return rc; + p = p->next; + } + } + + if(mosq->will){ + mosquitto__free(mosq->will->msg.topic); + mosquitto__free(mosq->will->msg.payload); + mosquitto_property_free_all(&mosq->will->properties); + mosquitto__free(mosq->will); + } + + mosq->will = mosquitto__calloc(1, sizeof(struct mosquitto_message_all)); + if(!mosq->will) return MOSQ_ERR_NOMEM; + mosq->will->msg.topic = mosquitto__strdup(topic); + if(!mosq->will->msg.topic){ + rc = MOSQ_ERR_NOMEM; + goto cleanup; + } + mosq->will->msg.payloadlen = payloadlen; + if(mosq->will->msg.payloadlen > 0){ + if(!payload){ + rc = MOSQ_ERR_INVAL; + goto cleanup; + } + mosq->will->msg.payload = mosquitto__malloc(sizeof(char)*mosq->will->msg.payloadlen); + if(!mosq->will->msg.payload){ + rc = MOSQ_ERR_NOMEM; + goto cleanup; + } + + memcpy(mosq->will->msg.payload, payload, payloadlen); + } + mosq->will->msg.qos = qos; + mosq->will->msg.retain = retain; + + mosq->will->properties = properties; + + return MOSQ_ERR_SUCCESS; + +cleanup: + if(mosq->will){ + mosquitto__free(mosq->will->msg.topic); + mosquitto__free(mosq->will->msg.payload); + + mosquitto__free(mosq->will); + mosq->will = NULL; + } + + return rc; +} + +int will__clear(struct mosquitto *mosq) +{ + if(!mosq->will) return MOSQ_ERR_SUCCESS; + + mosquitto__free(mosq->will->msg.topic); + mosq->will->msg.topic = NULL; + + mosquitto__free(mosq->will->msg.payload); + mosq->will->msg.payload = NULL; + + mosquitto_property_free_all(&mosq->will->properties); + + mosquitto__free(mosq->will); + mosq->will = NULL; + + return MOSQ_ERR_SUCCESS; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/will_mosq.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/will_mosq.h new file mode 100644 index 0000000..c96dad1 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/will_mosq.h @@ -0,0 +1,26 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef WILL_MOSQ_H +#define WILL_MOSQ_H + +#include "mosquitto.h" +#include "mosquitto_internal.h" + +int will__set(struct mosquitto *mosq, const char *topic, int payloadlen, const void *payload, int qos, bool retain, mosquitto_property *properties); +int will__clear(struct mosquitto *mosq); + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/will_mosq.o b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/will_mosq.o new file mode 100644 index 0000000..adbd487 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/lib/will_mosq.o Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/libmosquitto.pc.in b/proj1_mqttd/mosquitto/mosquitto-1.6.3/libmosquitto.pc.in new file mode 100644 index 0000000..101a125 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/libmosquitto.pc.in @@ -0,0 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +includedir=${prefix}/include +libdir=${exec_prefix}/lib + +Name: mosquitto +Description: mosquitto MQTT library (C bindings) +Version: @VERSION@ +Cflags: -I${includedir} +Libs: -L${libdir} -lmosquitto diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/libmosquittopp.pc.in b/proj1_mqttd/mosquitto/mosquitto-1.6.3/libmosquittopp.pc.in new file mode 100644 index 0000000..6070f44 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/libmosquittopp.pc.in @@ -0,0 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +includedir=${prefix}/include +libdir=${exec_prefix}/lib + +Name: mosquittopp +Description: mosquitto MQTT library (C++ bindings) +Version: @VERSION@ +Cflags: -I${includedir} +Libs: -L${libdir} -lmosquittopp diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/legacy/mosquitto-14x14.png b/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/legacy/mosquitto-14x14.png new file mode 100644 index 0000000..4fcda77 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/legacy/mosquitto-14x14.png Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/legacy/mosquitto-16x16.png b/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/legacy/mosquitto-16x16.png new file mode 100644 index 0000000..3ad5d28 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/legacy/mosquitto-16x16.png Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/legacy/mosquitto.svg b/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/legacy/mosquitto.svg new file mode 100644 index 0000000..7839c1a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/legacy/mosquitto.svg @@ -0,0 +1,182 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="744.09448819" + height="1052.3622047" + id="svg2" + sodipodi:version="0.32" + inkscape:version="0.46" + sodipodi:docname="mosquitto.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + inkscape:export-filename="mosquitto-14x14.png" + inkscape:export-xdpi="4.6700001" + inkscape:export-ydpi="4.6700001"> + <defs + id="defs4"> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="37.857143 : 544.03823 : 1" + inkscape:vp_y="6.1230318e-14 : 1000 : 0" + inkscape:vp_z="213.38019 : 572.60967 : 1" + inkscape:persp3d-origin="372.04724 : 350.78739 : 1" + id="perspective10" /> + <inkscape:perspective + id="perspective3301" + inkscape:persp3d-origin="372.04724 : 350.78739 : 1" + inkscape:vp_z="744.09448 : 526.18109 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_x="0 : 526.18109 : 1" + sodipodi:type="inkscape:persp3d" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + gridtolerance="10000" + guidetolerance="10" + objecttolerance="10" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="1.4" + inkscape:cx="251.61096" + inkscape:cy="634.88337" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + showguides="true" + inkscape:guide-bbox="true" + inkscape:window-width="1272" + inkscape:window-height="753" + inkscape:window-x="0" + inkscape:window-y="197" + inkscape:snap-global="false"> + <inkscape:grid + type="xygrid" + id="grid3203" + visible="true" + enabled="true" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + style="opacity:1;fill:#b4b4b4;fill-rule:evenodd;stroke:#000000;stroke-width:8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1" + d="M 260.86695,304.28645 C 344.54685,263.18666 363.31847,267.21909 373.94821,272.53203 C 384.57796,277.84498 400.64729,294.03063 384.36356,296.59165 C 368.07984,299.1527 261.4914,304.19501 260.86695,304.28645 z" + id="path3615" + inkscape:export-xdpi="5.4099998" + inkscape:export-ydpi="5.4099998" + sodipodi:nodetypes="cssc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 216.51521,335.41733 C 206.51521,350.41733 206.51521,350.41733 206.51521,350.41733" + id="path3333" /> + <path + sodipodi:type="star" + style="fill:#505050;fill-opacity:1;stroke:#000000;stroke-width:0.84779656;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path3317" + sodipodi:sides="5" + sodipodi:cx="170" + sodipodi:cy="187.36218" + sodipodi:r1="26.140701" + sodipodi:r2="22.638512" + sodipodi:arg1="0.29650661" + sodipodi:arg2="0.92482514" + inkscape:flatsided="true" + inkscape:rounded="0.5" + inkscape:randomized="0" + d="M 195,195 C 190.5106,209.69463 185.82415,213.22759 170.46143,213.49881 C 155.0987,213.77003 150.29047,210.4047 145.28518,195.87769 C 140.27989,181.35068 141.99469,175.73783 154.26397,166.48843 C 166.53326,157.23902 172.4013,157.13542 184.98942,165.94598 C 197.57755,174.75655 199.4894,180.30537 195,195 z" + transform="matrix(2.9181354,2.0819086,-0.5735856,0.4947199,-53.062566,-63.281872)" /> + <path + sodipodi:type="star" + style="fill:#505050;fill-opacity:1;stroke:#000000;stroke-width:1.8490361;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path3311" + sodipodi:sides="6" + sodipodi:cx="135" + sodipodi:cy="217.36218" + sodipodi:r1="45.199375" + sodipodi:r2="6.9935298" + sodipodi:arg1="1.2325185" + sodipodi:arg2="1.7561173" + inkscape:flatsided="true" + inkscape:rounded="0.5" + inkscape:randomized="0" + d="M 150,260 C 128.68109,267.5 122.72921,266.38419 105.57457,251.67147 C 88.419922,236.95876 86.410303,231.24637 90.574566,209.03366 C 94.73883,186.82094 98.68109,182.22437 120,174.72436 C 141.31891,167.22436 147.27079,168.34018 164.42543,183.05289 C 181.58008,197.76561 183.5897,203.47799 179.42543,225.69071 C 175.26117,247.90343 171.31891,252.5 150,260 z" + transform="matrix(0.2815869,-0.5987297,0.9000736,0.4233112,18.341889,318.68209)" + inkscape:transform-center-x="-1.6537315" + inkscape:transform-center-y="-28.100021" /> + <path + style="fill:#b4b4b4;fill-rule:evenodd;stroke:#000000;stroke-width:8.14260196999999941;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1" + d="M 270.92519,324.92602 C 386.31832,308.51079 405.06276,321.40568 414.0446,332.49728 C 423.02642,343.58891 427.12695,353.77886 407.60172,350.17225 C 388.0765,346.56566 271.67029,325.07279 270.92519,324.92602 z" + id="path3335" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:6;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 265.35024,357.10581 C 279.69288,380.33932 285.91337,387.36181 292.21826,395.18703 C 298.52314,403.01225 331.37829,432.56303 332.82486,445.99412" + id="path3331" + sodipodi:nodetypes="czz" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:6;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 235.85531,350.03474 C 222.4213,369.32661 223.69512,395.95703 226.41115,404.58043 C 229.17655,413.36058 231.09933,438.2798 229.34008,450.53982" + id="path2397" + sodipodi:nodetypes="czz" /> + <g + id="g2393" + transform="translate(-65.154839,-78.286822)"> + <path + id="path3211" + d="M 244.63358,463.84281 L 221.90526,527.9398 L 255.64196,465.79613 L 244.63358,463.84281" + style="fill:#505050;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + transform="matrix(1.0318345,0.7670587,-0.7670587,1.0318345,311.26509,-19.08815)" + d="M 200,314.86218 A 17.5,17.5 0 1 1 165,314.86218 A 17.5,17.5 0 1 1 200,314.86218 z" + sodipodi:ry="17.5" + sodipodi:rx="17.5" + sodipodi:cy="314.86218" + sodipodi:cx="182.5" + id="path3207" + style="fill:#505050;fill-opacity:1;stroke:#000000;stroke-width:1.16666663;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + sodipodi:type="arc" /> + <path + transform="translate(-5,0)" + d="M 260,447.36218 A 5,5 0 1 1 250,447.36218 A 5,5 0 1 1 260,447.36218 z" + sodipodi:ry="5" + sodipodi:rx="5" + sodipodi:cy="447.36218" + sodipodi:cx="255" + id="path3169" + style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.79999995;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + sodipodi:type="arc" /> + <rect + y="448.10907" + x="249.32576" + height="0.36382446" + width="0.23755538" + id="rect3179" + style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.64632809;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + </g> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:6;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 250.36808,354.60187 C 252.08382,378.84553 262.04352,388.50653 265.11426,398.23893 C 268.22732,408.10542 280.46706,426.82267 279.96198,447.53079" + id="path3170" + sodipodi:nodetypes="czz" /> + </g> +</svg> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/mosquitto-logo-min.svg b/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/mosquitto-logo-min.svg new file mode 100644 index 0000000..5438312 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/mosquitto-logo-min.svg @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + id="svg4136" + version="1.1" + inkscape:version="0.91 r13725" + xml:space="preserve" + width="152.76344" + height="152.76344" + viewBox="0 0 152.76344 152.76344" + sodipodi:docname="mosquitto-logo-min.svg" + inkscape:export-filename="/home/ral/src/mqtt/mosquitto/logo/mosquitto-14x14.png" + inkscape:export-xdpi="8.25" + inkscape:export-ydpi="8.25"><metadata + id="metadata4142"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs + id="defs4140" /><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1280" + inkscape:window-height="995" + id="namedview4138" + showgrid="false" + inkscape:zoom="2.4369022" + inkscape:cx="79.546492" + inkscape:cy="59.284918" + inkscape:window-x="1280" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="g4144" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" /><g + id="g4144" + inkscape:groupmode="layer" + inkscape:label="mosquitto" + transform="matrix(1.25,0,0,-1.25,-458.46439,514.07261)"><g + id="g3366" + transform="translate(-8.0273435e-7,5.3788908)"><path + sodipodi:nodetypes="cccsssccc" + inkscape:connector-curvature="0" + id="path4160" + style="fill:#f3771c;fill-opacity:1;fill-rule:evenodd;stroke:none" + d="m 427.87689,289.04733 4.33447,42.80506 1.28833,9.39302 c 5.1916,2.194 8.8356,7.3344 8.8356,13.324 0,7.9837 -6.4746,14.4584 -14.4584,14.4584 -7.9838,0 -14.4584,-6.4747 -14.4584,-14.4584 0,-5.9896 3.6439,-11.13 8.8356,-13.324 l 1.12419,-9.14681 z" /><path + sodipodi:nodetypes="cccccccsccsccccccsccccccccccccscc" + inkscape:connector-curvature="0" + id="path4162" + style="fill:#3c5280;fill-opacity:1;fill-rule:evenodd;stroke:none" + d="m 382.10766,315.26637 c 0,0 -4.36735,5.20003 -7.72292,9.81394 -13.7812,24.8958 -8.5306,56.3422 13.1394,75.42 l 9.4666,-8.4844 8.4197,-7.5492 8.7333,-7.8288 c -3.2664,-2.048 -6.0429,-4.8044 -8.1148,-8.0538 -2.5602,-4.0158 -4.0439,-8.7843 -4.0439,-13.8982 0,-11.4001 7.3721,-21.0816 17.6077,-24.5373 l 0.8807,-12.0308 c -17.0538,3.435 -29.9009,18.5037 -29.9009,36.5681 0,8.0438 2.5472,15.4941 6.8791,21.5875 l -8.356,7.4922 -0.0315,0.0284 c -13.6984,-18.1953 -12.852,-43.4563 1.899,-60.7045 z m 54.05308,14.88224 c 10.2356,3.4557 17.6076,13.1375 17.6076,24.5373 0,5.1139 -1.4836,9.8824 -4.0436,13.8979 -2.0718,3.2494 -4.8484,6.0061 -8.1144,8.0538 l 8.7329,7.8288 8.4206,7.5486 -8e-4,9e-4 9.4666,8.4844 c 21.67,-19.0778 26.9206,-50.5242 13.1394,-75.42 l -7.44339,-10.23339 c -9.13531,8.24259 0,0 -9.13531,8.24259 14.7512,17.2482 15.5976,42.5092 1.8992,60.7045 l -0.0317,-0.0284 -8.356,-7.4922 c 4.3319,-6.0936 6.8791,-13.5439 6.8791,-21.5875 0,-18.0644 -12.8472,-33.1328 -29.9007,-36.5681 z" /></g></g></svg> \ No newline at end of file diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/mosquitto-logo-only.svg b/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/mosquitto-logo-only.svg new file mode 100644 index 0000000..e43167d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/mosquitto-logo-only.svg @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + id="svg4136" + version="1.1" + inkscape:version="0.91 r13725" + xml:space="preserve" + width="278.23288" + height="278.23288" + viewBox="0 0 278.23288 278.23288" + sodipodi:docname="mosquitto-logo-only.svg"><metadata + id="metadata4142"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs + id="defs4140" /><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1280" + inkscape:window-height="995" + id="namedview4138" + showgrid="false" + inkscape:zoom="1.7899063" + inkscape:cx="67.324802" + inkscape:cy="84.142768" + inkscape:window-x="1280" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="g4144" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" /><g + id="g4144" + inkscape:groupmode="layer" + inkscape:label="mosquitto" + transform="matrix(1.25,0,0,-1.25,-387.06488,575.71439)"><g + id="g3377" + transform="translate(0,26.44071)"><path + inkscape:connector-curvature="0" + id="path4160" + style="fill:#f3771c;fill-opacity:1;fill-rule:evenodd;stroke:none" + d="m 420.9449,237.9852 3.1034,42.3947 2.5194,34.4248 c 5.1916,2.194 8.8356,7.3344 8.8356,13.324 0,7.9837 -6.4746,14.4584 -14.4584,14.4584 -7.9838,0 -14.4584,-6.4747 -14.4584,-14.4584 0,-5.9896 3.6439,-11.13 8.8356,-13.324 l 2.5194,-34.4248 3.1034,-42.3947 z" /><path + inkscape:connector-curvature="0" + id="path4162" + style="fill:#3c5280;fill-opacity:1;fill-rule:evenodd;stroke:none" + d="m 322.2003,328.1839 c 0,-24.4581 8.9422,-47.3527 24.4508,-65.0437 l -9.347,-8.3787 c -17.5008,19.9159 -27.6522,45.7824 -27.6522,73.4224 0,31.144 12.801,59.3037 33.4258,79.5062 l 0.47,-0.4215 27.6474,-24.7845 C 345.2111,358.664 339.8298,319.926 357.9086,290.084 l 9.5443,8.5556 c -13.7812,24.8958 -8.5306,56.3422 13.1394,75.42 l 9.4666,-8.4844 8.4197,-7.5492 8.7333,-7.8288 c -3.2664,-2.048 -6.0429,-4.8044 -8.1148,-8.0538 -2.5602,-4.0158 -4.0439,-8.7843 -4.0439,-13.8982 0,-11.4001 7.3721,-21.0816 17.6077,-24.5373 l 0.8807,-12.0308 c -17.0538,3.435 -29.9009,18.5037 -29.9009,36.5681 0,8.0438 2.5472,15.4941 6.8791,21.5875 l -8.356,7.4922 -0.0315,0.0284 c -13.6984,-18.1953 -12.852,-43.4563 1.899,-60.7045 L 355.9969,271.518 c -27.6004,31.6071 -28.3884,78.5191 -1.9533,111.0143 l -9.3515,8.3835 c -12.907,-15.6702 -21.0804,-35.3849 -22.3254,-56.9549 l -0.057,-0.0637 0.0507,-0.0454 c -0.1063,-1.876 -0.1601,-3.7655 -0.1601,-5.6679 z m 107.0286,-24.476 c 10.2356,3.4557 17.6076,13.1375 17.6076,24.5373 0,5.1139 -1.4836,9.8824 -4.0436,13.8979 -2.0718,3.2494 -4.8484,6.0061 -8.1144,8.0538 l 8.7329,7.8288 8.4206,7.5486 -8e-4,9e-4 9.4666,8.4844 c 21.67,-19.0778 26.9206,-50.5242 13.1394,-75.42 l 9.5442,-8.5556 c 18.0786,29.842 12.6976,68.58 -13.2865,92.4001 l 27.6486,24.7856 0.4688,0.4204 c 20.6249,-20.2025 33.4259,-48.3622 33.4259,-79.5062 0,-27.64 -10.1515,-53.5065 -27.6523,-73.4224 l -9.3469,8.3787 c 15.5083,17.691 24.4505,40.5856 24.4505,65.0437 0,1.9024 -0.0536,3.7919 -0.1599,5.6679 l 0.0507,0.0454 -0.0569,0.0637 c -1.245,21.57 -9.4184,41.2847 -22.3257,56.9549 l -9.3512,-8.3835 c 26.435,-32.4952 25.6467,-79.4072 -1.9534,-111.0143 l -28.0346,25.1308 c 14.7512,17.2482 15.5976,42.5092 1.8992,60.7045 l -0.0317,-0.0284 -8.356,-7.4922 c 4.3319,-6.0936 6.8791,-13.5439 6.8791,-21.5875 0,-18.0644 -12.8472,-33.1328 -29.9007,-36.5681 l 0.8805,12.0308 z" /></g></g></svg> \ No newline at end of file diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/mosquitto-text-below.svg b/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/mosquitto-text-below.svg new file mode 100644 index 0000000..ef8c3fc --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/mosquitto-text-below.svg @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + id="svg4136" + version="1.1" + inkscape:version="0.91 r13725" + xml:space="preserve" + width="278.96024" + height="275.13074" + viewBox="0 0 278.96024 275.13074" + sodipodi:docname="mosquitto-text-below.svg"><metadata + id="metadata4142"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs + id="defs4140" /><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1366" + inkscape:window-height="706" + id="namedview4138" + showgrid="false" + inkscape:zoom="1.7899063" + inkscape:cx="139.48015" + inkscape:cy="147.14238" + inkscape:window-x="-8" + inkscape:window-y="-8" + inkscape:window-maximized="1" + inkscape:current-layer="g4144" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" /><g + id="g4144" + inkscape:groupmode="layer" + inkscape:label="mosquitto" + transform="matrix(1.25,0,0,-1.25,-386.701,509.61263)"><path + d="m 409.7506,225.3163 c 5.5876,5.061 14.2234,4.6336 19.2841,-0.9541 4.7267,-5.2191 4.6652,-13.0966 0.0839,-18.2373 l 3.1589,-3.956 11.6456,-14.5834 -13.3622,13.0283 -3.625,3.5345 c -5.5678,-4.0518 -13.413,-3.3349 -18.1397,1.884 -5.0607,5.5876 -4.6333,14.2234 0.9544,19.284 z m 15.2422,-14.0252 -2.1532,2.6969 c 0.411,1.3385 0.1272,2.8528 -0.8808,3.9656 -1.5219,1.6807 -4.1193,1.8091 -5.7999,0.2872 -1.6804,-1.5222 -1.8091,-4.1196 -0.2869,-5.8 1.0077,-1.1129 2.4868,-1.5449 3.8594,-1.2679 l 2.4709,-2.4092 c -2.836,-1.4508 -6.4003,-0.8892 -8.6408,1.5846 -2.6776,2.9562 -2.4514,7.5251 0.5048,10.2027 2.9566,2.6776 7.5254,2.4514 10.2031,-0.5048 2.2402,-2.4738 2.4471,-6.0761 0.7234,-8.7551" + style="fill:#f3771c;fill-opacity:1;fill-rule:evenodd;stroke:none" + id="path4156" + inkscape:connector-curvature="0" /><path + d="m 366.7164,228.6371 c 2.4168,0 4.6894,-0.6103 6.817,-1.815 2.1198,-1.2041 3.782,-2.8502 4.9706,-4.9138 1.1962,-2.0719 1.7906,-4.3042 1.7906,-6.7046 0,-2.4171 -0.6026,-4.6734 -1.7988,-6.7773 -1.2042,-2.1039 -2.8344,-3.7417 -4.9062,-4.9303 -2.0716,-1.1806 -4.3523,-1.7742 -6.8491,-1.7742 -3.6694,0 -6.8012,1.3087 -9.3949,3.918 -2.5934,2.6099 -3.8939,5.7819 -3.8939,9.5154 0,3.9985 1.4692,7.3312 4.3999,9.9969 2.5696,2.3205 5.5242,3.4849 8.8648,3.4849 z m 70.837,-0.6582 6.4961,0 0,-12.3335 c 0,-2.3933 0.1605,-4.0632 0.4896,-4.9949 0.3376,-0.9312 0.8594,-1.6617 1.5899,-2.1762 0.7311,-0.5216 1.6302,-0.7784 2.6983,-0.7784 1.0678,0 1.967,0.2568 2.7139,0.7625 0.7466,0.5137 1.3008,1.2609 1.6622,2.2482 0.2645,0.7387 0.3932,2.3128 0.3932,4.7299 l 0,12.5424 6.4483,0 0,-10.8484 c 0,-4.4723 -0.3535,-7.532 -1.0602,-9.1778 -0.8592,-2.0072 -2.1283,-3.5492 -3.8064,-4.6173 -1.6781,-1.0755 -3.814,-1.6135 -6.3992,-1.6135 -2.8105,0 -5.0748,0.6262 -6.8094,1.8788 -1.7342,1.2603 -2.9551,3.003 -3.6615,5.2512 -0.498,1.55 -0.7548,4.3764 -0.7548,8.4634 l 0,10.6636 z m 81.3974,0.6582 c 2.4171,0 4.6896,-0.6103 6.817,-1.815 2.12,-1.2041 3.782,-2.8502 4.9706,-4.9138 1.1965,-2.0719 1.7906,-4.3042 1.7906,-6.7046 0,-2.4171 -0.6024,-4.6734 -1.7986,-6.7773 -1.2041,-2.1039 -2.8346,-3.7417 -4.9065,-4.9303 -2.0712,-1.1806 -4.352,-1.7742 -6.8488,-1.7742 -3.6697,0 -6.8011,1.3087 -9.3948,3.918 -2.5934,2.6099 -3.8943,5.7819 -3.8943,9.5154 0,3.9985 1.4695,7.3312 4.4003,9.9969 2.5696,2.3205 5.5241,3.4849 8.8645,3.4849 z m 0.0963,-6.0465 c -1.9913,0 -3.6535,-0.6982 -4.9782,-2.0878 -1.3249,-1.3892 -1.9836,-3.1631 -1.9836,-5.3234 0,-2.2323 0.6505,-4.0312 1.9675,-5.4122 1.3087,-1.3811 2.9628,-2.0713 4.9703,-2.0713 2.0072,0 3.6776,0.6985 5.0105,2.0954 1.3328,1.3972 1.9995,3.1878 1.9995,5.3881 0,2.192 -0.6505,3.9744 -1.9593,5.3478 -1.3167,1.3728 -2.9874,2.0634 -5.0267,2.0634 z m -25.7833,14.8147 6.3998,0 0,-9.4264 3.8055,0 0,-5.5326 -3.8055,0 0,-20.0662 -6.3998,0 0,20.0662 -3.2925,0 0,5.5326 3.2925,0 0,9.4264 z m -14.4454,0 6.3995,0 0,-9.4264 3.8055,0 0,-5.5326 -3.8055,0 0,-20.0662 -6.3995,0 0,20.0662 -3.2927,0 0,5.5326 3.2927,0 0,9.4264 z m -9.8047,1.108 c 1.1242,0 2.0962,-0.4096 2.9069,-1.2206 0.8028,-0.8186 1.2042,-1.8068 1.2042,-2.9627 0,-1.1484 -0.3932,-2.1277 -1.1963,-2.9308 -0.8027,-0.811 -1.758,-1.2124 -2.8664,-1.2124 -1.1486,0 -2.1282,0.4096 -2.931,1.2368 -0.8107,0.8186 -1.2126,1.8227 -1.2126,2.9945 0,1.1325 0.4019,2.0962 1.1967,2.899 0.8028,0.7948 1.7666,1.1962 2.8985,1.1962 z m -3.2281,-10.5344 6.4482,0 0,-25.5988 -6.4482,0 0,25.5988 z m -156.4248,0 6.4474,0 0,-2.9474 c 1.0998,1.2129 2.3204,2.1121 3.6612,2.7065 1.3416,0.5938 2.8023,0.8991 4.3849,0.8991 1.5976,0 3.043,-0.3937 4.3277,-1.1806 1.2846,-0.7863 2.3204,-1.9273 3.1073,-3.4367 1.0199,1.5094 2.2725,2.6504 3.7499,3.4367 1.4851,0.7869 3.0997,1.1806 4.8578,1.1806 1.8229,0 3.4208,-0.4257 4.8019,-1.277 1.381,-0.843 2.3689,-1.9511 2.971,-3.3159 0.6103,-1.3652 0.9076,-3.5816 0.9076,-6.6566 l 0,-15.0075 -6.4644,0 0,12.9841 c 0,2.9064 -0.3608,4.8659 -1.0837,5.8935 -0.7228,1.0276 -1.8068,1.542 -3.2442,1.542 -1.0999,0 -2.0878,-0.3132 -2.9549,-0.9399 -0.875,-0.6265 -1.5171,-1.4936 -1.9428,-2.6011 -0.4255,-1.1081 -0.6344,-2.8828 -0.6344,-5.332 l 0,-11.5466 -6.4721,0 0,12.3979 c 0,2.2881 -0.1687,3.9503 -0.5057,4.9785 -0.3373,1.0275 -0.8433,1.7901 -1.5177,2.2878 -0.6749,0.506 -1.4859,0.7554 -2.4412,0.7554 -1.0681,0 -2.0392,-0.3214 -2.9066,-0.9558 -0.8671,-0.6341 -1.5256,-1.5256 -1.9511,-2.6657 -0.4337,-1.1483 -0.6505,-2.9469 -0.6505,-5.4125 l 0,-11.3856 -6.4474,0 0,25.5988 z m 91.8425,-3.5815 -3.9745,-3.9751 c -1.6135,1.5985 -3.0753,2.4013 -4.3923,2.4013 -0.7228,0 -1.2928,-0.1528 -1.6942,-0.4578 -0.4096,-0.3048 -0.618,-0.6908 -0.618,-1.1401 0,-0.345 0.1364,-0.6667 0.3932,-0.9553 0.2568,-0.2894 0.8991,-0.6826 1.919,-1.1889 l 2.3446,-1.1721 c 2.4811,-1.2288 4.1836,-2.4729 5.1072,-3.7414 0.9235,-1.2694 1.3892,-2.763 1.3892,-4.4731 0,-2.272 -0.8354,-4.1672 -2.5052,-5.6928 -1.6705,-1.5177 -3.9107,-2.2802 -6.7131,-2.2802 -3.7338,0 -6.7127,1.4607 -8.945,4.3755 l 3.9586,4.3045 c 0.7469,-0.8757 1.6302,-1.5903 2.6419,-2.1283 1.0117,-0.5374 1.9108,-0.811 2.6975,-0.811 0.8435,0 1.5261,0.2007 2.0401,0.6103 0.5218,0.4096 0.7789,0.8756 0.7789,1.4137 0,0.9873 -0.9317,1.951 -2.7947,2.8904 l -2.1676,1.084 c -4.1437,2.0877 -6.2076,4.6973 -6.2076,7.8287 0,2.024 0.7792,3.7582 2.3372,5.1874 1.5573,1.4372 3.5572,2.16 5.9901,2.16 1.662,0 3.2196,-0.3696 4.6888,-1.1001 1.4698,-0.7308 2.7142,-1.7745 3.7259,-3.1396 z m -34.3905,-1.8068 c -1.9914,0 -3.6536,-0.6982 -4.9785,-2.0878 -1.3246,-1.3892 -1.9834,-3.1631 -1.9834,-5.3234 0,-2.2323 0.6503,-4.0312 1.9672,-5.4122 1.3091,-1.3811 2.9631,-2.0713 4.9703,-2.0713 2.0075,0 3.678,0.6985 5.0105,2.0954 1.3329,1.3972 1.9996,3.1878 1.9996,5.3881 0,2.192 -0.6506,3.9744 -1.9593,5.3478 -1.3167,1.3728 -2.9872,2.0634 -5.0264,2.0634" + style="fill:#3c5280;fill-opacity:1;fill-rule:evenodd;stroke:none" + id="path4158" + inkscape:connector-curvature="0" /><path + d="m 420.9449,237.9852 3.1034,42.3947 2.5194,34.4248 c 5.1916,2.194 8.8356,7.3344 8.8356,13.324 0,7.9837 -6.4746,14.4584 -14.4584,14.4584 -7.9838,0 -14.4584,-6.4747 -14.4584,-14.4584 0,-5.9896 3.6439,-11.13 8.8356,-13.324 l 2.5194,-34.4248 3.1034,-42.3947 z" + style="fill:#f3771c;fill-opacity:1;fill-rule:evenodd;stroke:none" + id="path4160" + inkscape:connector-curvature="0" /><path + d="m 322.2003,328.1839 c 0,-24.4581 8.9422,-47.3527 24.4508,-65.0437 l -9.347,-8.3787 c -17.5008,19.9159 -27.6522,45.7824 -27.6522,73.4224 0,31.144 12.801,59.3037 33.4258,79.5062 l 0.47,-0.4215 27.6474,-24.7845 C 345.2111,358.664 339.8298,319.926 357.9086,290.084 l 9.5443,8.5556 c -13.7812,24.8958 -8.5306,56.3422 13.1394,75.42 l 9.4666,-8.4844 8.4197,-7.5492 8.7333,-7.8288 c -3.2664,-2.048 -6.0429,-4.8044 -8.1148,-8.0538 -2.5602,-4.0158 -4.0439,-8.7843 -4.0439,-13.8982 0,-11.4001 7.3721,-21.0816 17.6077,-24.5373 l 0.8807,-12.0308 c -17.0538,3.435 -29.9009,18.5037 -29.9009,36.5681 0,8.0438 2.5472,15.4941 6.8791,21.5875 l -8.356,7.4922 -0.0315,0.0284 c -13.6984,-18.1953 -12.852,-43.4563 1.899,-60.7045 L 355.9969,271.518 c -27.6004,31.6071 -28.3884,78.5191 -1.9533,111.0143 l -9.3515,8.3835 c -12.907,-15.6702 -21.0804,-35.3849 -22.3254,-56.9549 l -0.057,-0.0637 0.0507,-0.0454 c -0.1063,-1.876 -0.1601,-3.7655 -0.1601,-5.6679 z m 107.0286,-24.476 c 10.2356,3.4557 17.6076,13.1375 17.6076,24.5373 0,5.1139 -1.4836,9.8824 -4.0436,13.8979 -2.0718,3.2494 -4.8484,6.0061 -8.1144,8.0538 l 8.7329,7.8288 8.4206,7.5486 -8e-4,9e-4 9.4666,8.4844 c 21.67,-19.0778 26.9206,-50.5242 13.1394,-75.42 l 9.5442,-8.5556 c 18.0786,29.842 12.6976,68.58 -13.2865,92.4001 l 27.6486,24.7856 0.4688,0.4204 c 20.6249,-20.2025 33.4259,-48.3622 33.4259,-79.5062 0,-27.64 -10.1515,-53.5065 -27.6523,-73.4224 l -9.3469,8.3787 c 15.5083,17.691 24.4505,40.5856 24.4505,65.0437 0,1.9024 -0.0536,3.7919 -0.1599,5.6679 l 0.0507,0.0454 -0.0569,0.0637 c -1.245,21.57 -9.4184,41.2847 -22.3257,56.9549 l -9.3512,-8.3835 c 26.435,-32.4952 25.6467,-79.4072 -1.9534,-111.0143 l -28.0346,25.1308 c 14.7512,17.2482 15.5976,42.5092 1.8992,60.7045 l -0.0317,-0.0284 -8.356,-7.4922 c 4.3319,-6.0936 6.8791,-13.5439 6.8791,-21.5875 0,-18.0644 -12.8472,-33.1328 -29.9007,-36.5681 l 0.8805,12.0308 z" + style="fill:#3c5280;fill-opacity:1;fill-rule:evenodd;stroke:none" + id="path4162" + inkscape:connector-curvature="0" /></g></svg> \ No newline at end of file diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/mosquitto-text-side.svg b/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/mosquitto-text-side.svg new file mode 100644 index 0000000..7f50724 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/mosquitto-text-side.svg @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + id="svg4141" + version="1.1" + inkscape:version="0.91 r13725" + xml:space="preserve" + width="338.81839" + height="68.285248" + viewBox="0 0 338.81839 68.285248" + sodipodi:docname="mosquitto-text-side.svg"><metadata + id="metadata4147"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs + id="defs4145" /><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1366" + inkscape:window-height="706" + id="namedview4143" + showgrid="false" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" + inkscape:zoom="2.5677474" + inkscape:cx="169.40919" + inkscape:cy="34.142625" + inkscape:window-x="-8" + inkscape:window-y="-8" + inkscape:window-maximized="1" + inkscape:current-layer="g4149" /><g + id="g4149" + inkscape:groupmode="layer" + inkscape:label="mosquitto" + transform="matrix(1.25,0,0,-1.25,-356.77175,167.07475)"><path + d="m 452.2297,115.9716 c 4.7441,4.2967 12.0762,3.9339 16.3729,-0.8102 4.0131,-4.4311 3.9609,-11.1194 0.0712,-15.4839 l 2.6821,-3.3588 9.8873,-12.3817 -11.3451,11.0616 -3.0773,3.0005 c -4.7274,-3.4399 -11.3882,-2.8313 -15.4012,1.5996 -4.2968,4.744 -3.9339,12.0761 0.8101,16.3729 z m 12.9413,-11.9078 -1.8283,2.2896 c 0.3489,1.1364 0.108,2.4222 -0.7475,3.3669 -1.2923,1.427 -3.4977,1.5361 -4.9244,0.2438 -1.4269,-1.2923 -1.5361,-3.4976 -0.2437,-4.9243 0.8555,-0.9448 2.1112,-1.3116 3.2765,-1.0766 l 2.0979,-2.0452 c -2.4077,-1.232 -5.434,-0.7552 -7.336,1.345 -2.2734,2.5101 -2.0815,6.3893 0.4286,8.6627 2.5101,2.2734 6.3893,2.0812 8.6627,-0.4289 1.902,-2.0999 2.0778,-5.1585 0.6142,-7.433" + style="fill:#f3771c;fill-opacity:1;fill-rule:evenodd;stroke:none" + id="path4153" + inkscape:connector-curvature="0" /><path + d="m 475.835,118.2319 5.5156,0 0,-10.4714 c 0,-2.0319 0.1361,-3.4498 0.4156,-4.2409 0.2866,-0.7906 0.7296,-1.4108 1.3498,-1.8474 0.6208,-0.4428 1.3842,-0.661 2.291,-0.661 0.9065,0 1.6702,0.2182 2.3043,0.6474 0.6338,0.4363 1.1044,1.0704 1.4113,1.9089 0.2245,0.6273 0.3337,1.9635 0.3337,4.0155 l 0,10.6489 5.4745,0 0,-9.2103 c 0,-3.797 -0.2999,-6.395 -0.9,-7.7922 -0.7293,-1.7044 -1.8068,-3.0135 -3.2317,-3.9203 -1.4247,-0.9133 -3.2381,-1.37 -5.4329,-1.37 -2.3862,0 -4.3087,0.5318 -5.7813,1.5954 -1.4726,1.0698 -2.5089,2.5495 -3.109,4.4583 -0.4227,1.3159 -0.6409,3.7157 -0.6409,7.1856 l 0,9.0535 z m -60.1424,0.559 c 2.052,0 3.9815,-0.5181 5.7877,-1.5409 1.7998,-1.0224 3.2111,-2.4199 4.2203,-4.172 1.0156,-1.7592 1.5205,-3.6544 1.5205,-5.6923 0,-2.0523 -0.5117,-3.9679 -1.5276,-5.7543 -1.0222,-1.7861 -2.4064,-3.1768 -4.1652,-4.1859 -1.7589,-1.0024 -3.6953,-1.5064 -5.8153,-1.5064 -3.1153,0 -5.7742,1.1112 -7.9764,3.3268 -2.202,2.2155 -3.3061,4.9087 -3.3061,8.0784 0,3.3951 1.2473,6.2246 3.7358,8.4878 2.1818,1.9704 4.6902,2.9588 7.5263,2.9588 z m -48.6964,-0.559 5.474,0 0,-2.5024 c 0.934,1.0298 1.9703,1.7932 3.1084,2.2981 1.139,0.504 2.3794,0.7633 3.7228,0.7633 1.3566,0 2.5838,-0.3342 3.6745,-1.0023 1.0908,-0.6678 1.9701,-1.6362 2.6382,-2.918 0.866,1.2818 1.9293,2.2502 3.1839,2.918 1.2609,0.6681 2.6314,1.0023 4.1241,1.0023 1.548,0 2.9044,-0.3614 4.0771,-1.0842 1.1724,-0.7158 2.0115,-1.6566 2.5226,-2.8154 0.5181,-1.1588 0.7704,-3.0407 0.7704,-5.6517 l 0,-12.7417 -5.4884,0 0,11.0239 c 0,2.4678 -0.3064,4.1312 -0.9201,5.0037 -0.6137,0.8725 -1.5339,1.3093 -2.7545,1.3093 -0.9337,0 -1.7725,-0.2659 -2.5086,-0.7979 -0.743,-0.5321 -1.2881,-1.2682 -1.6495,-2.2085 -0.3614,-0.9408 -0.5389,-2.4477 -0.5389,-4.5269 l 0,-9.8036 -5.4947,0 0,10.5264 c 0,1.9426 -0.1434,3.3537 -0.4294,4.2268 -0.2863,0.8725 -0.716,1.5199 -1.2886,1.9425 -0.5729,0.4295 -1.2615,0.6412 -2.0727,0.6412 -0.9065,0 -1.7314,-0.2729 -2.4676,-0.8115 -0.7364,-0.5383 -1.2954,-1.2955 -1.6566,-2.2632 -0.3685,-0.9751 -0.5524,-2.5019 -0.5524,-4.5952 l 0,-9.667 -5.474,0 0,21.734 z m 77.9768,-3.0407 -3.3746,-3.3749 c -1.3697,1.3572 -2.6107,2.0387 -3.729,2.0387 -0.6137,0 -1.0976,-0.1296 -1.4386,-0.3887 -0.3475,-0.2588 -0.5247,-0.5862 -0.5247,-0.9677 0,-0.2931 0.1157,-0.5661 0.334,-0.8113 0.2179,-0.2458 0.7633,-0.5797 1.6293,-1.0091 l 1.9908,-0.9953 c 2.1061,-1.0434 3.5518,-2.0999 4.3359,-3.1768 0.784,-1.0774 1.1795,-2.3456 1.1795,-3.7975 0,-1.929 -0.7093,-3.5382 -2.1272,-4.8337 -1.4181,-1.2883 -3.3199,-1.9358 -5.6993,-1.9358 -3.1703,0 -5.6993,1.2402 -7.5946,3.7151 l 3.3608,3.6545 c 0.6344,-0.7436 1.3841,-1.3502 2.243,-1.8068 0.8589,-0.4564 1.6226,-0.6886 2.2904,-0.6886 0.7163,0 1.2957,0.1704 1.732,0.5179 0.443,0.3481 0.6613,0.7435 0.6613,1.2005 0,0.8382 -0.7909,1.6566 -2.3726,2.4539 l -1.8405,0.9204 c -3.5181,1.7726 -5.2702,3.9881 -5.2702,6.6467 0,1.7184 0.6613,3.191 1.9843,4.4042 1.3223,1.2203 3.02,1.834 5.0856,1.834 1.4114,0 2.7337,-0.3138 3.981,-0.934 1.2481,-0.6205 2.3045,-1.5066 3.1634,-2.6657 z m -29.1985,-1.5338 c -1.6906,0 -3.102,-0.593 -4.227,-1.7728 -1.1245,-1.1795 -1.6838,-2.6855 -1.6838,-4.5196 0,-1.8952 0.5522,-3.4225 1.6704,-4.5952 1.1112,-1.1724 2.5155,-1.7586 4.2197,-1.7586 1.7045,0 3.1226,0.5933 4.2539,1.7793 1.1319,1.186 1.6977,2.7062 1.6977,4.5745 0,1.861 -0.5522,3.3744 -1.6634,4.5403 -1.1179,1.1656 -2.5361,1.7521 -4.2675,1.7521 z m 129.1691,5.1335 c 2.0523,0 3.9816,-0.5181 5.7878,-1.5409 1.8,-1.0224 3.2111,-2.4199 4.2202,-4.172 1.016,-1.7592 1.5205,-3.6544 1.5205,-5.6923 0,-2.0523 -0.5116,-3.9679 -1.5273,-5.7543 -1.0224,-1.7861 -2.4066,-3.1768 -4.1655,-4.1859 -1.7586,-1.0024 -3.695,-1.5064 -5.815,-1.5064 -3.1155,0 -5.7742,1.1112 -7.9764,3.3268 -2.2019,2.2155 -3.3063,4.9087 -3.3063,8.0784 0,3.3951 1.2475,6.2246 3.7358,8.4878 2.1818,1.9704 4.6902,2.9588 7.5262,2.9588 z m 0.0819,-5.1335 c -1.6905,0 -3.1019,-0.593 -4.2267,-1.7728 -1.1248,-1.1795 -1.6841,-2.6855 -1.6841,-4.5196 0,-1.8952 0.5525,-3.4225 1.6705,-4.5952 1.1112,-1.1724 2.5155,-1.7586 4.2199,-1.7586 1.7042,0 3.1227,0.5933 4.254,1.7793 1.1319,1.186 1.6977,2.7062 1.6977,4.5745 0,1.861 -0.5525,3.3744 -1.6637,4.5403 -1.1177,1.1656 -2.5362,1.7521 -4.2676,1.7521 z m -21.8908,12.5779 5.4337,0 0,-8.0034 3.231,0 0,-4.6973 -3.231,0 0,-17.0367 -5.4337,0 0,17.0367 -2.7952,0 0,4.6973 2.7952,0 0,8.0034 z m -12.2644,0 5.4332,0 0,-8.0034 3.2312,0 0,-4.6973 -3.2312,0 0,-17.0367 -5.4332,0 0,17.0367 -2.7955,0 0,4.6973 2.7955,0 0,8.0034 z m -8.3245,0.9408 c 0.9545,0 1.7796,-0.3478 2.4682,-1.0364 0.6814,-0.695 1.0221,-1.5338 1.0221,-2.5154 0,-0.9749 -0.3336,-1.8063 -1.0156,-2.4883 -0.6815,-0.6885 -1.4928,-1.0295 -2.4336,-1.0295 -0.9751,0 -1.8068,0.3481 -2.4882,1.0502 -0.6886,0.6951 -1.0298,1.5475 -1.0298,2.5424 0,0.9615 0.3412,1.7799 1.0162,2.4613 0.6814,0.675 1.4995,1.0157 2.4607,1.0157 z m -2.7408,-8.9442 5.4748,0 0,-21.734 -5.4748,0 0,21.734 z" + style="fill:#3c5280;fill-opacity:1;fill-rule:evenodd;stroke:none" + id="path4155" + inkscape:connector-curvature="0" /><path + d="m 321.2427,79.0316 0.999,13.6471 0.811,11.0812 c 1.6713,0.7064 2.8442,2.361 2.8442,4.2891 0,2.5699 -2.0843,4.654 -4.6542,4.654 -2.5701,0 -4.6542,-2.0841 -4.6542,-4.654 0,-1.9281 1.173,-3.5827 2.8443,-4.2891 l 0.811,-11.0812 0.9989,-13.6471 z" + style="fill:#f3771c;fill-opacity:1;fill-rule:evenodd;stroke:none" + id="path4157" + inkscape:connector-curvature="0" /><path + d="m 289.4567,108.0666 c 0,-7.8729 2.8786,-15.2427 7.8707,-20.9375 l -3.0087,-2.6972 c -5.6336,6.4111 -8.9013,14.7373 -8.9013,23.6347 0,10.0253 4.1207,19.0899 10.7597,25.5932 l 0.1514,-0.1358 8.8996,-7.9781 c -8.3642,-7.6677 -10.0964,-20.1373 -4.2769,-29.7437 l 3.0725,2.7542 c -4.4362,8.0141 -2.7462,18.1366 4.2296,24.2776 l 3.0472,-2.7312 2.7102,-2.4299 2.8114,-2.5202 c -1.0516,-0.6591 -1.9454,-1.5463 -2.6121,-2.5923 -0.8243,-1.2929 -1.3017,-2.8279 -1.3017,-4.4739 0,-3.6698 2.3729,-6.7862 5.6676,-7.8985 l 0.2838,-3.873 c -5.4899,1.1058 -9.6254,5.9565 -9.6254,11.7715 0,2.5894 0.8201,4.9875 2.2145,6.9491 l -2.6898,2.4117 -0.01,0.009 c -4.4095,-5.8573 -4.1371,-13.9887 0.6112,-19.5409 l -9.0244,-8.0895 c -8.8843,10.1743 -9.138,25.2751 -0.6287,35.7355 l -3.0101,2.6986 c -4.1548,-5.0443 -6.7859,-11.3905 -7.1867,-18.3337 l -0.0184,-0.0207 0.0164,-0.0144 c -0.0343,-0.6038 -0.0516,-1.2121 -0.0516,-1.8247 z m 34.4526,-7.8786 c 3.2947,1.1123 5.6679,4.2287 5.6679,7.8985 0,1.646 -0.4777,3.181 -1.3017,4.4736 -0.667,1.046 -1.5608,1.9335 -2.6118,2.5926 l 2.8111,2.52 2.7105,2.4301 -3e-4,0 3.0472,2.7312 c 6.9755,-6.141 8.6658,-16.2635 4.2296,-24.2776 l 3.0722,-2.7542 c 5.8198,9.6064 4.0875,22.076 -4.2769,29.7437 l 8.9002,7.9787 0.1508,0.1352 c 6.6393,-6.5033 10.7597,-15.5679 10.7597,-25.5932 0,-8.8974 -3.2675,-17.2236 -8.901,-23.6347 l -3.009,2.6972 c 4.9924,5.6948 7.8707,13.0646 7.8707,20.9375 0,0.6126 -0.0173,1.2209 -0.0513,1.8247 l 0.0161,0.0144 -0.0181,0.0207 c -0.4008,6.9432 -3.032,13.2894 -7.1867,18.3337 l -3.0101,-2.6986 c 8.5093,-10.4604 8.2556,-25.5612 -0.629,-35.7355 l -9.0241,8.0895 c 4.7483,5.5522 5.0207,13.6836 0.6111,19.5409 l -0.0102,-0.009 -2.6898,-2.412 c 1.3944,-1.9613 2.2145,-4.3597 2.2145,-6.9488 0,-5.815 -4.1355,-10.6654 -9.6251,-11.7715 l 0.2835,3.873 z" + style="fill:#3c5280;fill-opacity:1;fill-rule:evenodd;stroke:none" + id="path4159" + inkscape:connector-curvature="0" /></g></svg> \ No newline at end of file diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/mosquitto.ico b/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/mosquitto.ico new file mode 100644 index 0000000..88c9158 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/logo/mosquitto.ico Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/CMakeLists.txt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/CMakeLists.txt new file mode 100644 index 0000000..73e12a6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/CMakeLists.txt @@ -0,0 +1,5 @@ +install(FILES mosquitto_passwd.1 mosquitto_pub.1 mosquitto_sub.1 mosquitto_rr.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) +install(FILES libmosquitto.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) +install(FILES mosquitto.conf.5 DESTINATION ${CMAKE_INSTALL_MANDIR}/man5) +install(FILES mosquitto-tls.7 mqtt.7 DESTINATION ${CMAKE_INSTALL_MANDIR}/man7) +install(FILES mosquitto.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/Makefile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/Makefile new file mode 100644 index 0000000..f7268cc --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/Makefile @@ -0,0 +1,99 @@ +include ../config.mk + +.PHONY : all clean install uninstall dist + +MANPAGES = \ + libmosquitto.3 \ + mosquitto-tls.7 \ + mosquitto.8 \ + mosquitto.conf.5 \ + mosquitto_passwd.1 \ + mosquitto_pub.1 \ + mosquitto_rr.1 \ + mosquitto_sub.1 \ + mqtt.7 + +all : ${MANPAGES} + +clean : + +reallyclean : clean + -rm -f *.orig + -rm -f ${MANPAGES} + +dist : ${MANPAGES} + +install : + $(INSTALL) -d "${DESTDIR}$(mandir)/man8" + $(INSTALL) -m 644 mosquitto.8 "${DESTDIR}${mandir}/man8/mosquitto.8" + $(INSTALL) -d "${DESTDIR}$(mandir)/man5" + $(INSTALL) -m 644 mosquitto.conf.5 "${DESTDIR}${mandir}/man5/mosquitto.conf.5" + $(INSTALL) -d "${DESTDIR}$(mandir)/man1" + $(INSTALL) -m 644 mosquitto_passwd.1 "${DESTDIR}${mandir}/man1/mosquitto_passwd.1" + $(INSTALL) -m 644 mosquitto_pub.1 "${DESTDIR}${mandir}/man1/mosquitto_pub.1" + $(INSTALL) -m 644 mosquitto_sub.1 "${DESTDIR}${mandir}/man1/mosquitto_sub.1" + $(INSTALL) -m 644 mosquitto_rr.1 "${DESTDIR}${mandir}/man1/mosquitto_rr.1" + $(INSTALL) -d "${DESTDIR}$(mandir)/man7" + $(INSTALL) -m 644 mqtt.7 "${DESTDIR}${mandir}/man7/mqtt.7" + $(INSTALL) -m 644 mosquitto-tls.7 "${DESTDIR}${mandir}/man7/mosquitto-tls.7" + $(INSTALL) -d "${DESTDIR}$(mandir)/man3" + $(INSTALL) -m 644 libmosquitto.3 "${DESTDIR}${mandir}/man3/libmosquitto.3" + +uninstall : + -rm -f "${DESTDIR}${mandir}/man8/mosquitto.8" + -rm -f "${DESTDIR}${mandir}/man5/mosquitto.conf.5" + -rm -f "${DESTDIR}${mandir}/man1/mosquitto_passwd.1" + -rm -f "${DESTDIR}${mandir}/man1/mosquitto_pub.1" + -rm -f "${DESTDIR}${mandir}/man1/mosquitto_sub.1" + -rm -f "${DESTDIR}${mandir}/man1/mosquitto_rr.1" + -rm -f "${DESTDIR}${mandir}/man7/mqtt.7" + -rm -f "${DESTDIR}${mandir}/man7/mosquitto-tls.7" + -rm -f "${DESTDIR}${mandir}/man3/libmosquitto.3" + +mosquitto.8 : mosquitto.8.xml + $(XSLTPROC) $^ + +mosquitto.conf.5 : mosquitto.conf.5.xml manpage.xsl + $(XSLTPROC) $< + +mosquitto_passwd.1 : mosquitto_passwd.1.xml + $(XSLTPROC) $^ + +mosquitto_pub.1 : mosquitto_pub.1.xml + $(XSLTPROC) $^ + +mosquitto_sub.1 : mosquitto_sub.1.xml + $(XSLTPROC) $^ + +mosquitto_rr.1 : mosquitto_rr.1.xml + $(XSLTPROC) $^ + +mqtt.7 : mqtt.7.xml + $(XSLTPROC) $^ + +mosquitto-tls.7 : mosquitto-tls.7.xml + $(XSLTPROC) $^ + +libmosquitto.3 : libmosquitto.3.xml + $(XSLTPROC) $^ + +html : *.xml + set -e; for m in *.xml; \ + do \ + hfile=$$(echo $${m} | sed -e 's#\(.*\)\.xml#\1#' | sed -e 's/\./-/g'); \ + $(XSLTPROC) html.xsl $${m} > $${hfile}.html; \ + done + +potgen : + xml2po -o po/mosquitto/mosquitto.8.pot mosquitto.8.xml + xml2po -o po/mosquitto.conf/mosquitto.conf.5.pot mosquitto.conf.5.xml + xml2po -o po/mosquitto_passwd/mosquitto_passwd.1.pot mosquitto_passwd.1.xml + xml2po -o po/mosquitto_pub/mosquitto_pub.1.pot mosquitto_pub.1.xml + xml2po -o po/mosquitto_sub/mosquitto_sub.1.pot mosquitto_sub.1.xml + xml2po -o po/mosquitto_sub/mosquitto_rr.1.pot mosquitto_rr.1.xml + xml2po -o po/mqtt/mqtt.7.pot mqtt.7.xml + xml2po -o po/mosquitto-tls/mosquitto-tls.7.pot mosquitto-tls.7.xml + xml2po -o po/libmosquitto/libmosquitto.3.pot libmosquitto.3.xml + +# To merge new translations do: +# /usr/bin/xml2po -p de.po chapter1.xml > chapter1.de.xml diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/html.xsl b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/html.xsl new file mode 100644 index 0000000..3fba92a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/html.xsl @@ -0,0 +1,12 @@ +<!-- Set parameters for manpage xsl --> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/> + <xsl:output encoding="utf-8" indent="yes"/> + <xsl:param name="html.stylesheet">man.css</xsl:param> + <!-- Generate ansi style function synopses. --> + <xsl:param name="man.funcsynopsis.style">ansi</xsl:param> + <xsl:param name="make.clean.html" select="1"></xsl:param> + <xsl:param name="make.valid.html" select="1"></xsl:param> + <xsl:param name="html.cleanup" select="1"></xsl:param> + <xsl:param name="docbook.css.source"></xsl:param> +</xsl:stylesheet> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/libmosquitto.3 b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/libmosquitto.3 new file mode 100644 index 0000000..c3a49ea --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/libmosquitto.3 @@ -0,0 +1,253 @@ +'\" t +.\" Title: libmosquitto +.\" Author: [see the "Author" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> +.\" Date: 06/18/2019 +.\" Manual: Library calls +.\" Source: Mosquitto Project +.\" Language: English +.\" +.TH "LIBMOSQUITTO" "3" "06/18/2019" "Mosquitto Project" "Library calls" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +libmosquitto \- MQTT version 3\&.1\&.1 client library +.SH "DESCRIPTION" +.PP +This is an overview of how to use libmosquitto to create MQTT aware client programs\&. There may be separate man pages on each of the functions described here in the future\&. +.PP +This man page is woefully incomplete, please see the comments in mosquitto\&.h for missing functions and a description of the functions\&. +.SH "LIBMOSQUITTO SYMBOL NAMES" +.PP +All public functions in libmosquitto have the prefix "mosquitto_"\&. Any other functions defined in the source code are to be treated as private functions and may change between any release\&. Do not use these functions! +.SH "FUNCTIONS" +.SS "Library version" +.HP \w'int\ mosquitto_lib_version('u +.BI "int mosquitto_lib_version(int\ *" "major" ", int\ *" "minor" ", int\ *" "revision" ");" +.PP +Obtain version information about the library\&. If any of major, minor or revision are not NULL they will return the corresponding version numbers\&. The return value is an integer representation of the complete version number (e\&.g\&. 1009001 for 1\&.9\&.1) that can be used for comparisons\&. +.SS "Library initialisation and cleanup" +.HP \w'int\ mosquitto_lib_init('u +.BI "int mosquitto_lib_init(void);" +.HP \w'int\ mosquitto_lib_cleanup('u +.BI "int mosquitto_lib_cleanup(void);" +.PP +Call mosquitto_lib_init() before using any of the other library functions and mosquitto_lib_cleanup() after finishing with the library\&. +.SS "Client constructor/destructor" +.HP \w'struct\ mosquitto\ *mosquitto_new('u +.BI "struct mosquitto *mosquitto_new(const\ char\ *" "id" ", bool\ " "clean_session" ", void\ *" "userdata" ");" +.PP +Create a new mosquitto client instance\&. +.HP \w'void\ mosquitto_destroy('u +.BI "void mosquitto_destroy(struct\ mosquitto\ *" "mosq" ");" +.PP +Use to free memory associated with a mosquitto client instance\&. +.HP \w'int\ mosquitto_reinitialise('u +.BI "int mosquitto_reinitialise(struct\ mosquitto\ *" "mosq" ", const\ char\ *" "id" ", bool\ " "clean_session" ", void\ *" "userdata" ");" +.SS "Authentication and encryption" +.HP \w'int\ mosquitto_username_pw_set('u +.BI "int mosquitto_username_pw_set(struct\ mosquitto\ *" "mosq" ", const\ char\ *" "username" ", const\ char\ *" "password" ");" +.HP \w'int\ mosquitto_tls_set('u +.BI "int mosquitto_tls_set(struct\ mosquitto\ *" "mosq" ", const\ char\ *" "cafile" ", const\ char\ *" "capath" ", const\ char\ *" "certfile" ", const\ char\ *" "keyfile" ", int\ " "(*pw_callback)(char\ *buf,\ int\ size,\ int\ rwflag,\ void\ *userdata)" ");" +.HP \w'int\ mosquitto_tls_opts_set('u +.BI "int mosquitto_tls_opts_set(struct\ mosquitto\ *" "mosq" ", int\ " "cert_reqs" ", const\ char\ *" "tls_version" ", const\ char\ *" "ciphers" ");" +.HP \w'int\ mosquitto_tls_insecure_set('u +.BI "int mosquitto_tls_insecure_set(struct\ mosquitto\ *" "mosq" ", bool\ " "value" ");" +.HP \w'int\ mosquitto_tls_psk_set('u +.BI "int mosquitto_tls_psk_set(struct\ mosquitto\ *" "mosq" ", const\ char\ *" "psk" ", const\ char\ *" "identity" ", const\ char\ *" "ciphers" ");" +.SS "Wills" +.HP \w'int\ mosquitto_will_set('u +.BI "int mosquitto_will_set(struct\ mosquitto\ *" "mosq" ", const\ char\ *" "topic" ", int\ " "payloadlen" ", const\ void\ *" "payload" ", int\ " "qos" ", bool\ " "retain" ");" +.HP \w'int\ mosquitto_will_clear('u +.BI "int mosquitto_will_clear(" "struct\ mosquitto\ *mosq" ");" +.SS "Connect/disconnect" +.HP \w'int\ mosquitto_connect('u +.BI "int mosquitto_connect(struct\ mosquitto\ *" "mosq" ", const\ char\ *" "host" ", int\ " "port" ", int\ " "keepalive" ");" +.HP \w'int\ mosquitto_connect_bind('u +.BI "int mosquitto_connect_bind(struct\ mosquitto\ *" "mosq" ", const\ char\ *" "host" ", int\ " "port" ", int\ " "keepalive" ", const\ char\ *" "bind_address" ");" +.HP \w'int\ mosquitto_connect_async('u +.BI "int mosquitto_connect_async(struct\ mosquitto\ *" "mosq" ", const\ char\ *" "host" ", int\ " "port" ", int\ " "keepalive" ");" +.HP \w'int\ mosquitto_connect_bind_async('u +.BI "int mosquitto_connect_bind_async(struct\ mosquitto\ *" "mosq" ", const\ char\ *" "host" ", int\ " "port" ", int\ " "keepalive" ", const\ char\ *" "bind_address" ");" +.HP \w'int\ mosquitto_reconnect('u +.BI "int mosquitto_reconnect(struct\ mosquitto\ *" "mosq" ");" +.HP \w'int\ mosquitto_reconnect_async('u +.BI "int mosquitto_reconnect_async(struct\ mosquitto\ *" "mosq" ");" +.HP \w'int\ mosquitto_disconnect('u +.BI "int mosquitto_disconnect(struct\ mosquitto\ *" "mosq" ");" +.SS "Publish" +.HP \w'int\ mosquitto_publish('u +.BI "int mosquitto_publish(struct\ mosquitto\ *" "mosq" ", int\ *" "mid" ", const\ char\ *" "topic" ", int\ " "payloadlen" ", const\ void\ *" "payload" ", int\ " "qos" ", bool\ " "retain" ");" +.SS "Subscribe/unsubscribe" +.HP \w'int\ mosquitto_subscribe('u +.BI "int mosquitto_subscribe(struct\ mosquitto\ *" "mosq" ", int\ *" "mid" ", const\ char\ *" "sub" ", int\ " "qos" ");" +.HP \w'int\ mosquitto_unsubscribe('u +.BI "int mosquitto_unsubscribe(struct\ mosquitto\ *" "mosq" ", int\ *" "mid" ", const\ char\ *" "sub" ");" +.SS "Network loop" +.HP \w'int\ mosquitto_loop('u +.BI "int mosquitto_loop(struct\ mosquitto\ *" "mosq" ", int\ " "timeout" ", int\ " "max_packets" ");" +.HP \w'int\ mosquitto_loop_read('u +.BI "int mosquitto_loop_read(struct\ mosquitto\ *" "mosq" ", int\ " "max_packets" ");" +.HP \w'int\ mosquitto_loop_write('u +.BI "int mosquitto_loop_write(struct\ mosquitto\ *" "mosq" ", int\ " "max_packets" ");" +.HP \w'int\ mosquitto_loop_misc('u +.BI "int mosquitto_loop_misc(struct\ mosquitto\ *" "mosq" ");" +.HP \w'int\ mosquitto_loop_forever('u +.BI "int mosquitto_loop_forever(struct\ mosquitto\ *" "mosq" ", int\ " "timeout" ", int\ " "max_packets" ");" +.HP \w'int\ mosquitto_socket('u +.BI "int mosquitto_socket(struct\ mosquitto\ *" "mosq" ");" +.HP \w'bool\ mosquitto_want_write('u +.BI "bool mosquitto_want_write(struct\ mosquitto\ *" "mosq" ");" +.SS "Threaded network loop" +.HP \w'int\ mosquitto_loop_start('u +.BI "int mosquitto_loop_start(struct\ mosquitto\ *" "mosq" ");" +.HP \w'int\ mosquitto_loop_stop('u +.BI "int mosquitto_loop_stop(struct\ mosquitto\ *" "mosq" ", bool\ " "force" ");" +.SS "Misc client functions" +.HP \w'int\ mosquitto_max_inflight_messages_set('u +.BI "int mosquitto_max_inflight_messages_set(struct\ mosquitto\ *" "mosq" ", unsigned\ int\ " "max_inflight_messages" ");" +.HP \w'int\ mosquitto_reconnect_delay_set('u +.BI "int mosquitto_reconnect_delay_set(struct\ mosquitto\ *" "mosq" ", unsigned\ int\ " "reconnect_delay" ", unsigned\ int\ " "reconnect_delay_max" ", bool\ " "reconnect_exponential_backoff" ");" +.HP \w'int\ mosquitto_user_data_set('u +.BI "int mosquitto_user_data_set(struct\ mosquitto\ *" "mosq" ", void\ *" "userdata" ");" +.SS "Callbacks" +.HP \w'int\ mosquitto_connect_callback_set('u +.BI "int mosquitto_connect_callback_set(struct\ mosquitto\ *" "mosq" ", void\ " "(*on_connect)(struct\ mosquitto\ *,\ void\ *,\ int)" ");" +.HP \w'int\ mosquitto_disconnect_callback_set('u +.BI "int mosquitto_disconnect_callback_set(struct\ mosquitto\ *" "mosq" ", void\ " "(*on_disconnect)(struct\ mosquitto\ *,\ void\ *,\ int)" ");" +.HP \w'int\ mosquitto_publish_callback_set('u +.BI "int mosquitto_publish_callback_set(struct\ mosquitto\ *" "mosq" ", void\ " "(*on_publish)(struct\ mosquitto\ *,\ void\ *,\ int)" ");" +.HP \w'int\ mosquitto_message_callback_set('u +.BI "int mosquitto_message_callback_set(struct\ mosquitto\ *" "mosq" ", void\ " "(*on_message)(struct\ mosquitto\ *,\ void\ *,\ const\ struct\ mosquitto_message\ *)" ");" +.HP \w'int\ mosquitto_subscribe_callback_set('u +.BI "int mosquitto_subscribe_callback_set(struct\ mosquitto\ *" "mosq" ", void\ " "(*on_subscribe)(struct\ mosquitto\ *,\ void\ *,\ int,\ int,\ const\ int\ *)" ");" +.HP \w'int\ mosquitto_unsubscribe_callback_set('u +.BI "int mosquitto_unsubscribe_callback_set(struct\ mosquitto\ *" "mosq" ", void\ " "(*on_unsubscribe)(struct\ mosquitto\ *,\ void\ *,\ int)" ");" +.HP \w'int\ mosquitto_log_callback_set('u +.BI "int mosquitto_log_callback_set(struct\ mosquitto\ *" "mosq" ", void\ " "(*on_unsubscribe)(struct\ mosquitto\ *,\ void\ *,\ int,\ const\ char\ *)" ");" +.SS "Utility functions" +.HP \w'const\ char\ *mosquitto_connack_string('u +.BI "const char *mosquitto_connack_string(int\ " "connack_code" ");" +.HP \w'int\ mosquitto_message_copy('u +.BI "int mosquitto_message_copy(struct\ mosquitto_message\ *" "dst" ", const\ struct\ mosquitto_message\ *" "src" ");" +.HP \w'int\ mosquitto_message_free('u +.BI "int mosquitto_message_free(struct\ mosquitto_message\ **" "message" ");" +.HP \w'const\ char\ *mosquitto_strerror('u +.BI "const char *mosquitto_strerror(int\ " "mosq_errno" ");" +.HP \w'int\ mosquitto_sub_topic_tokenise('u +.BI "int mosquitto_sub_topic_tokenise(const\ char\ *" "subtopic" ", char\ ***" "topics" ", int\ *" "count" ");" +.HP \w'int\ mosquitto_sub_topic_tokens_free('u +.BI "int mosquitto_sub_topic_tokens_free(char\ ***" "topics" ", int\ " "count" ");" +.HP \w'int\ mosquitto_topic_matches_sub('u +.BI "int mosquitto_topic_matches_sub(const\ char\ *" "sub" ", const\ char\ *" "topic" ", bool\ *" "result" ");" +.SS "Helper functions" +.HP \w'int\ mosquitto_subscribe_simple('u +.BI "int mosquitto_subscribe_simple(struct\ mosquitto_message\ **" "message" ", int\ " "msg_count" ", bool\ " "want_retained" ", const\ char\ *" "topic" ", int" "qos" ", const\ char\ *" "host" ", int\ " "port" ", const\ char\ *" "client_id" ", int\ " "keepalive" ", bool\ " "clean_session" ", const\ char\ *" "username" ", const\ char\ *" "password" ", const\ struct\ libmosquitto_will\ *" "will" ", const\ struct\ libmosquitto_tls\ *" "tls" ");" +.HP \w'int\ mosquitto_subscribe_callback('u +.BI "int mosquitto_subscribe_callback(int\ " "(*callback)(struct\ mosquitto\ *,\ void\ *,\ const\ struct\ mosquitto_message\ *)" ", void\ *" "userdata" ", const\ char\ *" "topic" ", int\ " "qos" ", const\ char\ *" "host" ", int\ " "port" ", const\ char\ *" "client_id" ", int\ " "keepalive" ", bool\ " "clean_session" ", const\ char\ *" "username" ", const\ char\ *" "password" ", const\ struct\ libmosquitto_will\ *" "will" ", const\ struct\ libmosquitto_tls\ *" "tls" ");" +.SH "EXAMPLES" +.PP +.if n \{\ +.RS 4 +.\} +.nf +#include <stdio\&.h> +#include <mosquitto\&.h> + +void my_message_callback(struct mosquitto *mosq, void *userdata, const struct mosquitto_message *message) +{ + if(message\->payloadlen){ + printf("%s %s\en", message\->topic, message\->payload); + }else{ + printf("%s (null)\en", message\->topic); + } + fflush(stdout); +} + +void my_connect_callback(struct mosquitto *mosq, void *userdata, int result) +{ + int i; + if(!result){ + /* Subscribe to broker information topics on successful connect\&. */ + mosquitto_subscribe(mosq, NULL, "$SYS/#", 2); + }else{ + fprintf(stderr, "Connect failed\en"); + } +} + +void my_subscribe_callback(struct mosquitto *mosq, void *userdata, int mid, int qos_count, const int *granted_qos) +{ + int i; + + printf("Subscribed (mid: %d): %d", mid, granted_qos[0]); + for(i=1; i<qos_count; i++){ + printf(", %d", granted_qos[i]); + } + printf("\en"); +} + +void my_log_callback(struct mosquitto *mosq, void *userdata, int level, const char *str) +{ + /* Pring all log messages regardless of level\&. */ + printf("%s\en", str); +} + +int main(int argc, char *argv[]) +{ + int i; + char *host = "localhost"; + int port = 1883; + int keepalive = 60; + bool clean_session = true; + struct mosquitto *mosq = NULL; + + mosquitto_lib_init(); + mosq = mosquitto_new(NULL, clean_session, NULL); + if(!mosq){ + fprintf(stderr, "Error: Out of memory\&.\en"); + return 1; + } + mosquitto_log_callback_set(mosq, my_log_callback); + mosquitto_connect_callback_set(mosq, my_connect_callback); + mosquitto_message_callback_set(mosq, my_message_callback); + mosquitto_subscribe_callback_set(mosq, my_subscribe_callback); + + if(mosquitto_connect(mosq, host, port, keepalive)){ + fprintf(stderr, "Unable to connect\&.\en"); + return 1; + } + + mosquitto_loop_forever(mosq, \-1, 1); + + mosquitto_destroy(mosq); + mosquitto_lib_cleanup(); + return 0; +} + +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +\fBmosquitto\fR(8)\fBmqtt\fR(7) +.SH "AUTHOR" +.PP +Roger Light +<roger@atchoo\&.org> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/libmosquitto.3.meta b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/libmosquitto.3.meta new file mode 100644 index 0000000..205f3bf --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/libmosquitto.3.meta @@ -0,0 +1,5 @@ +.. title: libmosquitto man page +.. slug: libmosquitto-3 +.. category: man +.. type: man +.. pretty_url: False diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/libmosquitto.3.xml b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/libmosquitto.3.xml new file mode 100644 index 0000000..1aa308a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/libmosquitto.3.xml @@ -0,0 +1,506 @@ +<?xml version='1.0' encoding='UTF-8'?> +<?xml-stylesheet type="text/xsl" href="manpage.xsl"?> + +<refentry xml:id="libmosquitto" xmlns:xlink="http://www.w3.org/1999/xlink"> + <refmeta> + <refentrytitle>libmosquitto</refentrytitle> + <manvolnum>3</manvolnum> + <refmiscinfo class="source">Mosquitto Project</refmiscinfo> + <refmiscinfo class="manual">Library calls</refmiscinfo> + </refmeta> + + <refnamediv> + <refname>libmosquitto</refname> + <refpurpose>MQTT version 3.1.1 client library</refpurpose> + </refnamediv> + + <refsect1> + <title>Description</title> + <para>This is an overview of how to use libmosquitto to create MQTT + aware client programs. There may be separate man pages on each of the + functions described here in the future.</para> + <para>This man page is woefully incomplete, please see the comments + in mosquitto.h for missing functions and a description of the + functions.</para> + </refsect1> + + <refsect1> + <title>libmosquitto symbol names</title> + <para>All public functions in libmosquitto have the prefix + "mosquitto_". Any other functions defined in the source code are to be + treated as private functions and may change between any release. Do not + use these functions!</para> + </refsect1> + + <refsect1> + <title>Functions</title> + + <refsect2> + <title>Library version</title> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_lib_version</function></funcdef> + <paramdef>int *<parameter>major</parameter></paramdef> + <paramdef>int *<parameter>minor</parameter></paramdef> + <paramdef>int *<parameter>revision</parameter></paramdef> + </funcprototype></funcsynopsis> + <para>Obtain version information about the library. If any of + major, minor or revision are not NULL they will return the + corresponding version numbers. The return value is an integer + representation of the complete version number (e.g. 1009001 for 1.9.1) + that can be used for comparisons.</para> + </refsect2> + + <refsect2> + <title>Library initialisation and cleanup</title> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_lib_init</function></funcdef> + <void/></funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_lib_cleanup</function></funcdef> + <void/></funcprototype></funcsynopsis> + <para>Call mosquitto_lib_init() before using any of the other + library functions and mosquitto_lib_cleanup() after finishing + with the library.</para> + </refsect2> + + <refsect2> + <title>Client constructor/destructor</title> + + <funcsynopsis><funcprototype><funcdef>struct mosquitto *<function>mosquitto_new</function></funcdef> + <paramdef>const char *<parameter>id</parameter></paramdef> + <paramdef>bool <parameter>clean_session</parameter></paramdef> + <paramdef>void *<parameter>userdata</parameter></paramdef> + </funcprototype></funcsynopsis> + <para>Create a new mosquitto client instance.</para> + + <funcsynopsis><funcprototype><funcdef>void <function>mosquitto_destroy</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + </funcprototype></funcsynopsis> + <para>Use to free memory associated with a mosquitto client instance.</para> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_reinitialise</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>const char *<parameter>id</parameter></paramdef> + <paramdef>bool <parameter>clean_session</parameter></paramdef> + <paramdef>void *<parameter>userdata</parameter></paramdef> + </funcprototype></funcsynopsis> + </refsect2> + + <refsect2> + <title>Authentication and encryption</title> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_username_pw_set</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>const char *<parameter>username</parameter></paramdef> + <paramdef>const char *<parameter>password</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_tls_set</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>const char *<parameter>cafile</parameter></paramdef> + <paramdef>const char *<parameter>capath</parameter></paramdef> + <paramdef>const char *<parameter>certfile</parameter></paramdef> + <paramdef>const char *<parameter>keyfile</parameter></paramdef> + <paramdef>int <parameter>(*pw_callback)(char *buf, int size, int rwflag, void *userdata)</parameter></paramdef> + </funcprototype></funcsynopsis> + + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_tls_opts_set</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>int <parameter>cert_reqs</parameter></paramdef> + <paramdef>const char *<parameter>tls_version</parameter></paramdef> + <paramdef>const char *<parameter>ciphers</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_tls_insecure_set</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>bool <parameter>value</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_tls_psk_set</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>const char *<parameter>psk</parameter></paramdef> + <paramdef>const char *<parameter>identity</parameter></paramdef> + <paramdef>const char *<parameter>ciphers</parameter></paramdef> + </funcprototype></funcsynopsis> + </refsect2> + + <refsect2> + <title>Wills</title> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_will_set</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>const char *<parameter>topic</parameter></paramdef> + <paramdef>int <parameter>payloadlen</parameter></paramdef> + <paramdef>const void *<parameter>payload</parameter></paramdef> + <paramdef>int <parameter>qos</parameter></paramdef> + <paramdef>bool <parameter>retain</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_will_clear</function></funcdef> + <paramdef><parameter>struct mosquitto *mosq</parameter></paramdef> + </funcprototype></funcsynopsis> + </refsect2> + + <refsect2> + <title>Connect/disconnect</title> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_connect</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>const char *<parameter>host</parameter></paramdef> + <paramdef>int <parameter>port</parameter></paramdef> + <paramdef>int <parameter>keepalive</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_connect_bind</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>const char *<parameter>host</parameter></paramdef> + <paramdef>int <parameter>port</parameter></paramdef> + <paramdef>int <parameter>keepalive</parameter></paramdef> + <paramdef>const char *<parameter>bind_address</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_connect_async</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>const char *<parameter>host</parameter></paramdef> + <paramdef>int <parameter>port</parameter></paramdef> + <paramdef>int <parameter>keepalive</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_connect_bind_async</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>const char *<parameter>host</parameter></paramdef> + <paramdef>int <parameter>port</parameter></paramdef> + <paramdef>int <parameter>keepalive</parameter></paramdef> + <paramdef>const char *<parameter>bind_address</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_reconnect</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_reconnect_async</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_disconnect</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + </funcprototype></funcsynopsis> + </refsect2> + + <refsect2> + <title>Publish</title> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_publish</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>int *<parameter>mid</parameter></paramdef> + <paramdef>const char *<parameter>topic</parameter></paramdef> + <paramdef>int <parameter>payloadlen</parameter></paramdef> + <paramdef>const void *<parameter>payload</parameter></paramdef> + <paramdef>int <parameter>qos</parameter></paramdef> + <paramdef>bool <parameter>retain</parameter></paramdef> + </funcprototype></funcsynopsis> + </refsect2> + + <refsect2> + <title>Subscribe/unsubscribe</title> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_subscribe</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>int *<parameter>mid</parameter></paramdef> + <paramdef>const char *<parameter>sub</parameter></paramdef> + <paramdef>int <parameter>qos</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_unsubscribe</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>int *<parameter>mid</parameter></paramdef> + <paramdef>const char *<parameter>sub</parameter></paramdef> + </funcprototype></funcsynopsis> + </refsect2> + + <refsect2> + <title>Network loop</title> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_loop</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>int <parameter>timeout</parameter></paramdef> + <paramdef>int <parameter>max_packets</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_loop_read</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>int <parameter>max_packets</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_loop_write</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>int <parameter>max_packets</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_loop_misc</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_loop_forever</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>int <parameter>timeout</parameter></paramdef> + <paramdef>int <parameter>max_packets</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_socket</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>bool <function>mosquitto_want_write</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + </funcprototype></funcsynopsis> + </refsect2> + + <refsect2> + <title>Threaded network loop</title> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_loop_start</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_loop_stop</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>bool <parameter>force</parameter></paramdef> + </funcprototype></funcsynopsis> + </refsect2> + + <refsect2> + <title>Misc client functions</title> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_max_inflight_messages_set</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>unsigned int <parameter>max_inflight_messages</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_reconnect_delay_set</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>unsigned int <parameter>reconnect_delay</parameter></paramdef> + <paramdef>unsigned int <parameter>reconnect_delay_max</parameter></paramdef> + <paramdef>bool <parameter>reconnect_exponential_backoff</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_user_data_set</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>void *<parameter>userdata</parameter></paramdef> + </funcprototype></funcsynopsis> + </refsect2> + + <refsect2> + <title>Callbacks</title> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_connect_callback_set</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>void <parameter>(*on_connect)(struct mosquitto *, void *, int)</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_disconnect_callback_set</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>void <parameter>(*on_disconnect)(struct mosquitto *, void *, int)</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_publish_callback_set</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>void <parameter>(*on_publish)(struct mosquitto *, void *, int)</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_message_callback_set</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>void <parameter>(*on_message)(struct mosquitto *, void *, const struct mosquitto_message *)</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_subscribe_callback_set</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>void <parameter>(*on_subscribe)(struct mosquitto *, void *, int, int, const int *)</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_unsubscribe_callback_set</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>void <parameter>(*on_unsubscribe)(struct mosquitto *, void *, int)</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_log_callback_set</function></funcdef> + <paramdef>struct mosquitto *<parameter>mosq</parameter></paramdef> + <paramdef>void <parameter>(*on_unsubscribe)(struct mosquitto *, void *, int, const char *)</parameter></paramdef> + </funcprototype></funcsynopsis> + </refsect2> + + <refsect2> + <title>Utility functions</title> + + <funcsynopsis><funcprototype><funcdef>const char *<function>mosquitto_connack_string</function></funcdef> + <paramdef>int <parameter>connack_code</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_message_copy</function></funcdef> + <paramdef>struct mosquitto_message *<parameter>dst</parameter></paramdef> + <paramdef>const struct mosquitto_message *<parameter>src</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_message_free</function></funcdef> + <paramdef>struct mosquitto_message **<parameter>message</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>const char *<function>mosquitto_strerror</function></funcdef> + <paramdef>int <parameter>mosq_errno</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_sub_topic_tokenise</function></funcdef> + <paramdef>const char *<parameter>subtopic</parameter></paramdef> + <paramdef>char ***<parameter>topics</parameter></paramdef> + <paramdef>int *<parameter>count</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_sub_topic_tokens_free</function></funcdef> + <paramdef>char ***<parameter>topics</parameter></paramdef> + <paramdef>int <parameter>count</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_topic_matches_sub</function></funcdef> + <paramdef>const char *<parameter>sub</parameter></paramdef> + <paramdef>const char *<parameter>topic</parameter></paramdef> + <paramdef>bool *<parameter>result</parameter></paramdef> + </funcprototype></funcsynopsis> + </refsect2> + + <refsect2> + <title>Helper functions</title> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_subscribe_simple</function></funcdef> + <paramdef>struct mosquitto_message **<parameter>message</parameter></paramdef> + <paramdef>int <parameter>msg_count</parameter></paramdef> + <paramdef>bool <parameter>want_retained</parameter></paramdef> + <paramdef>const char *<parameter>topic</parameter></paramdef> + <paramdef>int<parameter>qos</parameter></paramdef> + <paramdef>const char *<parameter>host</parameter></paramdef> + <paramdef>int <parameter>port</parameter></paramdef> + <paramdef>const char *<parameter>client_id</parameter></paramdef> + <paramdef>int <parameter>keepalive</parameter></paramdef> + <paramdef>bool <parameter>clean_session</parameter></paramdef> + <paramdef>const char *<parameter>username</parameter></paramdef> + <paramdef>const char *<parameter>password</parameter></paramdef> + <paramdef>const struct libmosquitto_will *<parameter>will</parameter></paramdef> + <paramdef>const struct libmosquitto_tls *<parameter>tls</parameter></paramdef> + </funcprototype></funcsynopsis> + + <funcsynopsis><funcprototype><funcdef>int <function>mosquitto_subscribe_callback</function></funcdef> + <paramdef>int <parameter>(*callback)(struct mosquitto *, void *, const struct mosquitto_message *)</parameter></paramdef> + <paramdef>void *<parameter>userdata</parameter></paramdef> + <paramdef>const char *<parameter>topic</parameter></paramdef> + <paramdef>int <parameter>qos</parameter></paramdef> + <paramdef>const char *<parameter>host</parameter></paramdef> + <paramdef>int <parameter>port</parameter></paramdef> + <paramdef>const char *<parameter>client_id</parameter></paramdef> + <paramdef>int <parameter>keepalive</parameter></paramdef> + <paramdef>bool <parameter>clean_session</parameter></paramdef> + <paramdef>const char *<parameter>username</parameter></paramdef> + <paramdef>const char *<parameter>password</parameter></paramdef> + <paramdef>const struct libmosquitto_will *<parameter>will</parameter></paramdef> + <paramdef>const struct libmosquitto_tls *<parameter>tls</parameter></paramdef> + </funcprototype></funcsynopsis> + </refsect2> + </refsect1> + + <refsect1> + <title>Examples</title> + <para><programlisting language="C"> +#include <stdio.h> +#include <mosquitto.h> + +void my_message_callback(struct mosquitto *mosq, void *userdata, const struct mosquitto_message *message) +{ + if(message->payloadlen){ + printf("%s %s\n", message->topic, message->payload); + }else{ + printf("%s (null)\n", message->topic); + } + fflush(stdout); +} + +void my_connect_callback(struct mosquitto *mosq, void *userdata, int result) +{ + int i; + if(!result){ + /* Subscribe to broker information topics on successful connect. */ + mosquitto_subscribe(mosq, NULL, "$SYS/#", 2); + }else{ + fprintf(stderr, "Connect failed\n"); + } +} + +void my_subscribe_callback(struct mosquitto *mosq, void *userdata, int mid, int qos_count, const int *granted_qos) +{ + int i; + + printf("Subscribed (mid: %d): %d", mid, granted_qos[0]); + for(i=1; i<qos_count; i++){ + printf(", %d", granted_qos[i]); + } + printf("\n"); +} + +void my_log_callback(struct mosquitto *mosq, void *userdata, int level, const char *str) +{ + /* Pring all log messages regardless of level. */ + printf("%s\n", str); +} + +int main(int argc, char *argv[]) +{ + int i; + char *host = "localhost"; + int port = 1883; + int keepalive = 60; + bool clean_session = true; + struct mosquitto *mosq = NULL; + + mosquitto_lib_init(); + mosq = mosquitto_new(NULL, clean_session, NULL); + if(!mosq){ + fprintf(stderr, "Error: Out of memory.\n"); + return 1; + } + mosquitto_log_callback_set(mosq, my_log_callback); + mosquitto_connect_callback_set(mosq, my_connect_callback); + mosquitto_message_callback_set(mosq, my_message_callback); + mosquitto_subscribe_callback_set(mosq, my_subscribe_callback); + + if(mosquitto_connect(mosq, host, port, keepalive)){ + fprintf(stderr, "Unable to connect.\n"); + return 1; + } + + mosquitto_loop_forever(mosq, -1, 1); + + mosquitto_destroy(mosq); + mosquitto_lib_cleanup(); + return 0; +} + </programlisting></para> + </refsect1> + <refsect1> + <title>See Also</title> + <simplelist type="inline"> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto-8.html">mosquitto</link></refentrytitle> + <manvolnum>8</manvolnum> + </citerefentry> + <citerefentry> + <refentrytitle><link xlink:href="mqtt-7.html">mqtt</link></refentrytitle> + <manvolnum>7</manvolnum> + </citerefentry> + </member> + </simplelist> + </refsect1> + + <refsect1> + <title>Author</title> + <para>Roger Light <email>roger@atchoo.org</email></para> + </refsect1> +</refentry> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/manpage.xsl b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/manpage.xsl new file mode 100644 index 0000000..a5c6050 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/manpage.xsl @@ -0,0 +1,14 @@ +<!-- Set parameters for manpage xsl --> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/> + <xsl:strip-space elements="member"/> + <!-- Don't display notes list of link urls. --> + <xsl:param name="man.endnotes.list.enabled">0</xsl:param> + <xsl:param name="man.endnotes.are.numbered">0</xsl:param> + <!-- But if we do, set a base url for the relative links. --> + <xsl:param name="man.base.url.for.relative.links">https://mosquitto.org/man/</xsl:param> + <!-- Don't output filename when generating. --> + <xsl:param name="man.output.quietly" select="1"></xsl:param> + <!-- Generate ansi style function synopses. --> + <xsl:param name="man.funcsynopsis.style">ansi</xsl:param> +</xsl:stylesheet> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto-tls.7 b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto-tls.7 new file mode 100644 index 0000000..6bba8c0 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto-tls.7 @@ -0,0 +1,185 @@ +'\" t +.\" Title: mosquitto-tls +.\" Author: [see the "Author" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> +.\" Date: 06/18/2019 +.\" Manual: Conventions and miscellaneous +.\" Source: Mosquitto Project +.\" Language: English +.\" +.TH "MOSQUITTO\-TLS" "7" "06/18/2019" "Mosquitto Project" "Conventions and miscellaneous" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +mosquitto-tls \- Configure SSL/TLS support for Mosquitto +.SH "DESCRIPTION" +.PP +\fBmosquitto\fR +provides SSL support for encrypted network connections and authentication\&. This manual describes how to create the files needed\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +.PP +It is important to use different certificate subject parameters for your CA, server and clients\&. If the certificates appear identical, even though generated separately, the broker/client will not be able to distinguish between them and you will experience difficult to diagnose errors\&. +.sp .5v +.RE +.SH "GENERATING CERTIFICATES" +.PP +The sections below give the openssl commands that can be used to generate certificates, but without any context\&. The asciicast at +\m[blue]\fBhttps://asciinema\&.org/a/201826\fR\m[] +gives a full run through of how to use those commands\&. +.SH "CERTIFICATE AUTHORITY" +.PP +Generate a certificate authority certificate and key\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +openssl req \-new \-x509 \-days <duration> \-extensions v3_ca \-keyout ca\&.key \-out ca\&.crt +.RE +.SH "SERVER" +.PP +Generate a server key\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +openssl genrsa \-des3 \-out server\&.key 2048 +.RE +.PP +Generate a server key without encryption\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +openssl genrsa \-out server\&.key 2048 +.RE +.PP +Generate a certificate signing request to send to the CA\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +openssl req \-out server\&.csr \-key server\&.key \-new +.RE +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +.PP +When prompted for the CN (Common Name), please enter either your server (or broker) hostname or domain name\&. +.sp .5v +.RE +.PP +Send the CSR to the CA, or sign it with your CA key: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +openssl x509 \-req \-in server\&.csr \-CA ca\&.crt \-CAkey ca\&.key \-CAcreateserial \-out server\&.crt \-days <duration> +.RE +.SH "CLIENT" +.PP +Generate a client key\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +openssl genrsa \-des3 \-out client\&.key 2048 +.RE +.PP +Generate a certificate signing request to send to the CA\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +openssl req \-out client\&.csr \-key client\&.key \-new +.RE +.PP +Send the CSR to the CA, or sign it with your CA key: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +openssl x509 \-req \-in client\&.csr \-CA ca\&.crt \-CAkey ca\&.key \-CAcreateserial \-out client\&.crt \-days <duration> +.RE +.SH "SEE ALSO" +\fBmosquitto\fR(8), \fBmosquitto-conf\fR(5) +.SH "AUTHOR" +.PP +Roger Light +<roger@atchoo\&.org> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto-tls.7.meta b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto-tls.7.meta new file mode 100644 index 0000000..fed34c4 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto-tls.7.meta @@ -0,0 +1,5 @@ +.. title: mosquitto-tls man page +.. slug: mosquitto-tls-7 +.. category: man +.. type: man +.. pretty_url: False diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto-tls.7.xml b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto-tls.7.xml new file mode 100644 index 0000000..6a34410 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto-tls.7.xml @@ -0,0 +1,110 @@ +<?xml version='1.0' encoding='UTF-8'?> +<?xml-stylesheet type="text/xsl" href="manpage.xsl"?> + +<refentry xml:id="mosquitto-tls" xmlns:xlink="http://www.w3.org/1999/xlink"> + <refmeta> + <refentrytitle>mosquitto-tls</refentrytitle> + <manvolnum>7</manvolnum> + <refmiscinfo class="source">Mosquitto Project</refmiscinfo> + <refmiscinfo class="manual">Conventions and miscellaneous</refmiscinfo> + </refmeta> + + <refnamediv> + <refname>mosquitto-tls</refname> + <refpurpose>Configure SSL/TLS support for Mosquitto</refpurpose> + </refnamediv> + + <refsect1> + <title>Description</title> + <para><command>mosquitto</command> provides SSL support for encrypted + network connections and authentication. This manual describes how + to create the files needed.</para> + <note><para>It is important to use different certificate subject + parameters for your CA, server and clients. If the certificates + appear identical, even though generated separately, the + broker/client will not be able to distinguish between them and + you will experience difficult to diagnose errors.</para></note> + </refsect1> + + <refsect1> + <title>Generating certificates</title> + <para>The sections below give the openssl commands that can be used to + generate certificates, but without any context. The asciicast at + <link + xlink:href="https://asciinema.org/a/201826">https://asciinema.org/a/201826</link> + gives a full run through of how to use those commands.</para> + </refsect1> + + <refsect1> + <title>Certificate Authority</title> + <para>Generate a certificate authority certificate and key.</para> + <itemizedlist mark="circle"> + <listitem><para>openssl req -new -x509 -days <duration> -extensions v3_ca -keyout ca.key -out ca.crt</para></listitem> + </itemizedlist> + </refsect1> + + <refsect1> + <title>Server</title> + <para>Generate a server key.</para> + <itemizedlist mark="circle"> + <listitem><para>openssl genrsa -des3 -out server.key 2048</para></listitem> + </itemizedlist> + + <para>Generate a server key without encryption.</para> + <itemizedlist mark="circle"> + <listitem><para>openssl genrsa -out server.key 2048</para></listitem> + </itemizedlist> + + <para>Generate a certificate signing request to send to the CA.</para> + <itemizedlist mark="circle"> + <listitem><para>openssl req -out server.csr -key server.key -new</para></listitem> + </itemizedlist> + <note><para>When prompted for the CN (Common Name), please enter either your server (or broker) hostname or domain name.</para></note> + + <para>Send the CSR to the CA, or sign it with your CA key:</para> + <itemizedlist mark="circle"> + <listitem><para>openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days <duration></para></listitem> + </itemizedlist> + </refsect1> + + <refsect1> + <title>Client</title> + <para>Generate a client key.</para> + <itemizedlist mark="circle"> + <listitem><para>openssl genrsa -des3 -out client.key 2048</para></listitem> + </itemizedlist> + + <para>Generate a certificate signing request to send to the CA.</para> + <itemizedlist mark="circle"> + <listitem><para>openssl req -out client.csr -key client.key -new</para></listitem> + </itemizedlist> + + <para>Send the CSR to the CA, or sign it with your CA key:</para> + <itemizedlist mark="circle"> + <listitem><para>openssl x509 -req -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out client.crt -days <duration></para></listitem> + </itemizedlist> + </refsect1> + + <refsect1> + <title>See Also</title> + <simplelist type="inline"> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto-8.html">mosquitto</link></refentrytitle> + <manvolnum>8</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto-conf-5.html">mosquitto-conf</link></refentrytitle> + <manvolnum>5</manvolnum> + </citerefentry> + </member> + </simplelist> + </refsect1> + + <refsect1> + <title>Author</title> + <para>Roger Light <email>roger@atchoo.org</email></para> + </refsect1> +</refentry> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.8 b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.8 new file mode 100644 index 0000000..11ffc7a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.8 @@ -0,0 +1,465 @@ +'\" t +.\" Title: mosquitto +.\" Author: [see the "Author" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> +.\" Date: 06/18/2019 +.\" Manual: System management commands +.\" Source: Mosquitto Project +.\" Language: English +.\" +.TH "MOSQUITTO" "8" "06/18/2019" "Mosquitto Project" "System management commands" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +mosquitto \- an MQTT broker +.SH "SYNOPSIS" +.HP \w'\fBmosquitto\fR\ 'u +\fBmosquitto\fR [\-c\ \fIconfig\ file\fR] [\-d | \-\-daemon] [\-p\ \fIport\ number\fR] [\-v] +.SH "DESCRIPTION" +.PP +\fBmosquitto\fR +is a broker for the MQTT protocol version 3\&.1\&.1/3\&.1\&. +.SH "OPTIONS" +.PP +\fB\-c\fR, \fB\-\-config\-file\fR +.RS 4 +Load configuration from a file\&. If not given, the default values as described in +\fBmosquitto.conf\fR(5) +are used\&. +.RE +.PP +\fB\-d\fR, \fB\-\-daemon\fR +.RS 4 +Run +\fBmosquitto\fR +in the background as a daemon\&. All other behaviour remains the same\&. +.RE +.PP +\fB\-p\fR, \fB\-\-port\fR +.RS 4 +Listen on the port specified instead of the default 1883\&. This acts in addition to the port setting in the config file\&. May be specified multiple times to open multiple sockets listening on different ports\&. This socket will be bound to all network interfaces\&. +.RE +.PP +\fB\-v\fR, \fB\-\-verbose\fR +.RS 4 +Use verbose logging\&. This is equivalent to setting +\fBlog_type\fR +to +\fBall\fR +in the configuration file\&. This overrides and logging options given in the configuration file\&. +.RE +.SH "CONFIGURATION" +.PP +The broker can be configured using a configuration file as described in +\fBmosquitto.conf\fR(5) +and this is the main point of information for mosquitto\&. The files required for SSL/TLS support are described in +\fBmosquitto-tls\fR(7)\&. +.SH "BROKER STATUS" +.PP +Clients can find information about the broker by subscribing to topics in the $SYS hierarchy as follows\&. Topics marked as static are only sent once per client on subscription\&. All other topics are updated every +\fBsys_interval\fR +seconds\&. If +\fBsys_interval\fR +is 0, then updates are not sent\&. +.PP +Note that if you are using a command line client to interact with the $SYS topics and your shell interprets $ as an environment variable, you need to place the topic in single quotes \*(Aq$SYS/\&.\&.\&.\*(Aq or to escape the dollar symbol: \e$SYS/\&.\&.\&. otherwise the $SYS will be treated as an environment variable\&. +.PP +\fB$SYS/broker/bytes/received\fR +.RS 4 +The total number of bytes received since the broker started\&. +.RE +.PP +\fB$SYS/broker/bytes/sent\fR +.RS 4 +The total number of bytes sent since the broker started\&. +.RE +.PP +\fB$SYS/broker/clients/connected\fR, \fB$SYS/broker/clients/active\fR (deprecated) +.RS 4 +The number of currently connected clients\&. +.RE +.PP +\fB$SYS/broker/clients/expired\fR +.RS 4 +The number of disconnected persistent clients that have been expired and removed through the persistent_client_expiration option\&. +.RE +.PP +\fB$SYS/broker/clients/disconnected\fR, \fB$SYS/broker/clients/inactive\fR (deprecated) +.RS 4 +The total number of persistent clients (with clean session disabled) that are registered at the broker but are currently disconnected\&. +.RE +.PP +\fB$SYS/broker/clients/maximum\fR +.RS 4 +The maximum number of clients that have been connected to the broker at the same time\&. +.RE +.PP +\fB$SYS/broker/clients/total\fR +.RS 4 +The total number of active and inactive clients currently connected and registered on the broker\&. +.RE +.PP +\fB$SYS/broker/connection/#\fR +.RS 4 +When bridges are configured to/from the broker, common practice is to provide a status topic that indicates the state of the connection\&. This is provided within $SYS/broker/connection/ by default\&. If the value of the topic is 1 the connection is active, if 0 then it is not active\&. See the Bridges section below for more information on bridges\&. +.RE +.PP +\fB$SYS/broker/heap/current size\fR +.RS 4 +The current size of the heap memory in use by mosquitto\&. Note that this topic may be unavailable depending on compile time options\&. +.RE +.PP +\fB$SYS/broker/heap/maximum size\fR +.RS 4 +The largest amount of heap memory used by mosquitto\&. Note that this topic may be unavailable depending on compile time options\&. +.RE +.PP +\fB$SYS/broker/load/connections/+\fR +.RS 4 +The moving average of the number of CONNECT packets received by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of connections received in 1 minute, averaged over 1, 5 or 15 minutes\&. +.RE +.PP +\fB$SYS/broker/load/bytes/received/+\fR +.RS 4 +The moving average of the number of bytes received by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of bytes received in 1 minute, averaged over 1, 5 or 15 minutes\&. +.RE +.PP +\fB$SYS/broker/load/bytes/sent/+\fR +.RS 4 +The moving average of the number of bytes sent by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of bytes sent in 1 minute, averaged over 1, 5 or 15 minutes\&. +.RE +.PP +\fB$SYS/broker/load/messages/received/+\fR +.RS 4 +The moving average of the number of all types of MQTT messages received by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of messages received in 1 minute, averaged over 1, 5 or 15 minutes\&. +.RE +.PP +\fB$SYS/broker/load/messages/sent/+\fR +.RS 4 +The moving average of the number of all types of MQTT messages sent by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of messages send in 1 minute, averaged over 1, 5 or 15 minutes\&. +.RE +.PP +\fB$SYS/broker/load/publish/dropped/+\fR +.RS 4 +The moving average of the number of publish messages dropped by the broker over different time intervals\&. This shows the rate at which durable clients that are disconnected are losing messages\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of messages dropped in 1 minute, averaged over 1, 5 or 15 minutes\&. +.RE +.PP +\fB$SYS/broker/load/publish/received/+\fR +.RS 4 +The moving average of the number of publish messages received by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of publish messages received in 1 minute, averaged over 1, 5 or 15 minutes\&. +.RE +.PP +\fB$SYS/broker/load/publish/sent/+\fR +.RS 4 +The moving average of the number of publish messages sent by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of publish messages sent in 1 minute, averaged over 1, 5 or 15 minutes\&. +.RE +.PP +\fB$SYS/broker/load/sockets/+\fR +.RS 4 +The moving average of the number of socket connections opened to the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of socket connections in 1 minute, averaged over 1, 5 or 15 minutes\&. +.RE +.PP +\fB$SYS/broker/messages/inflight\fR +.RS 4 +The number of messages with QoS>0 that are awaiting acknowledgments\&. +.RE +.PP +\fB$SYS/broker/messages/received\fR +.RS 4 +The total number of messages of any type received since the broker started\&. +.RE +.PP +\fB$SYS/broker/messages/sent\fR +.RS 4 +The total number of messages of any type sent since the broker started\&. +.RE +.PP +\fB$SYS/broker/publish/messages/dropped\fR +.RS 4 +The total number of publish messages that have been dropped due to inflight/queuing limits\&. See the max_inflight_messages and max_queued_messages options in +\fBmosquitto.conf\fR(5) +for more information\&. +.RE +.PP +\fB$SYS/broker/publish/messages/received\fR +.RS 4 +The total number of PUBLISH messages received since the broker started\&. +.RE +.PP +\fB$SYS/broker/publish/messages/sent\fR +.RS 4 +The total number of PUBLISH messages sent since the broker started\&. +.RE +.PP +\fB$SYS/broker/retained messages/count\fR +.RS 4 +The total number of retained messages active on the broker\&. +.RE +.PP +\fB$SYS/broker/store/messages/count\fR, \fB$SYS/broker/messages/stored\fR (deprecated) +.RS 4 +The number of messages currently held in the message store\&. This includes retained messages and messages queued for durable clients\&. +.RE +.PP +\fB$SYS/broker/store/messages/bytes\fR +.RS 4 +The number of bytes currently held by message payloads in the message store\&. This includes retained messages and messages queued for durable clients\&. +.RE +.PP +\fB$SYS/broker/subscriptions/count\fR +.RS 4 +The total number of subscriptions active on the broker\&. +.RE +.PP +\fB$SYS/broker/version\fR +.RS 4 +The version of the broker\&. Static\&. +.RE +.SH "WILDCARD TOPIC SUBSCRIPTIONS" +.PP +In addition to allowing clients to subscribe to specific topics, mosquitto also allows the use of two wildcards in subscriptions\&. +\fB+\fR +is the wildcard used to match a single level of hierarchy\&. For example, for a topic of "a/b/c/d", the following example subscriptions will match: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/b/c/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} ++/b/c/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/+/c/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/+/+/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} ++/+/+/+ +.RE +.PP +The following subscriptions will not match: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/b/c +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +b/+/c/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} ++/+/+ +.RE +.PP +The second wildcard is +\fB#\fR +and is used to match all subsequent levels of hierarchy\&. With a topic of "a/b/c/d", the following example subscriptions will match: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/b/c/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +# +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/# +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/b/# +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/b/c/# +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} ++/b/c/# +.RE +.PP +The $SYS hierarchy does not match a subscription of "#"\&. If you want to observe the entire $SYS hierarchy, subscribe to $SYS/#\&. +.PP +Note that the wildcards must be only ever used on their own, so a subscription of "a/b+/c" is not valid use of a wildcard\&. The +\fB#\fR +wildcard must only ever be used as the final character of a subscription\&. +.SH "BRIDGES" +.PP +Multiple brokers can be connected together with the bridging functionality\&. This is useful where it is desirable to share information between locations, but where not all of the information needs to be shared\&. An example could be where a number of users are running a broker to help record power usage and for a number of other reasons\&. The power usage could be shared through bridging all of the user brokers to a common broker, allowing the power usage of all users to be collected and compared\&. The other information would remain local to each broker\&. +.PP +For information on configuring bridges, see +\fBmosquitto.conf\fR(5)\&. +.SH "SIGNALS" +.PP +SIGHUP +.RS 4 +Upon receiving the SIGHUP signal, mosquitto will attempt to reload configuration file data, assuming that the +\fB\-c\fR +argument was provided when mosquitto was started\&. Not all configuration parameters can be reloaded without restarting\&. See +\fBmosquitto.conf\fR(5) +for details\&. +.RE +.PP +SIGUSR1 +.RS 4 +Upon receiving the SIGUSR1 signal, mosquitto will write the persistence database to disk\&. This signal is only acted upon if persistence is enabled\&. +.RE +.PP +SIGUSR2 +.RS 4 +The SIGUSR2 signal causes mosquitto to print out the current subscription tree, along with information about where retained messages exist\&. This is intended as a testing feature only and may be removed at any time\&. +.RE +.SH "FILES" +.PP +/etc/mosquitto/mosquitto\&.conf +.RS 4 +Configuration file\&. See +\fBmosquitto.conf\fR(5)\&. +.RE +.PP +/var/lib/mosquitto/mosquitto\&.db +.RS 4 +Persistent message data storage location if persist enabled\&. +.RE +.PP +/etc/hosts\&.allow, /etc/hosts\&.deny +.RS 4 +Host access control via tcp\-wrappers as described in +\fBhosts_access\fR(5)\&. +.RE +.SH "BUGS" +.PP +\fBmosquitto\fR +bug information can be found at +\m[blue]\fB\%https://github.com/eclipse/mosquitto/issues\fR\m[] +.SH "SEE ALSO" +\fBmqtt\fR(7), \fBmosquitto-tls\fR(7), \fBmosquitto.conf\fR(5), \fBhosts_access\fR(5), \fBmosquitto_passwd\fR(1), \fBmosquitto_pub\fR(1), \fBmosquitto_rr\fR(1), \fBmosquitto_sub\fR(1), \fBlibmosquitto\fR(3) +.SH "THANKS" +.PP +Thanks to Andy Stanford\-Clark for being one of the people who came up with MQTT in the first place\&. Thanks to Andy and Nicholas O\*(AqLeary for providing clarifications of the protocol\&. +.PP +Thanks also to everybody at the Ubuntu UK Podcast and Linux Outlaws for organising OggCamp, where Andy gave a talk that inspired mosquitto\&. +.SH "AUTHOR" +.PP +Roger Light +<roger@atchoo\&.org> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.8.meta b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.8.meta new file mode 100644 index 0000000..45a1972 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.8.meta @@ -0,0 +1,5 @@ +.. title: Mosquitto man page +.. slug: mosquitto-8 +.. category: man +.. type: man +.. pretty_url: False diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.8.xml b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.8.xml new file mode 100644 index 0000000..fbae44f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.8.xml @@ -0,0 +1,551 @@ +<?xml version='1.0' encoding='UTF-8'?> +<?xml-stylesheet type="text/xsl" href="manpage.xsl"?> + +<refentry xml:id="mosquitto" xmlns:xlink="http://www.w3.org/1999/xlink"> + <refmeta> + <refentrytitle>mosquitto</refentrytitle> + <manvolnum>8</manvolnum> + <refmiscinfo class="source">Mosquitto Project</refmiscinfo> + <refmiscinfo class="manual">System management commands</refmiscinfo> + </refmeta> + + <refnamediv> + <refname>mosquitto</refname> + <refpurpose>an MQTT broker</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <cmdsynopsis> + <command>mosquitto</command> + <arg>-c <replaceable>config file</replaceable></arg> + <group> + <arg choice='plain'>-d</arg> + <arg choice='plain'>--daemon</arg> + </group> + <arg>-p <replaceable>port number</replaceable></arg> + <arg>-v</arg> + </cmdsynopsis> + </refsynopsisdiv> + + <refsect1> + <title>Description</title> + <para><command>mosquitto</command> is a broker for the MQTT protocol version 3.1.1/3.1.</para> + </refsect1> + + <refsect1> + <title>Options</title> + <variablelist> + <varlistentry> + <term><option>-c</option></term> + <term><option>--config-file</option></term> + <listitem> + <para>Load configuration from a file. If not given, the default values as described in <citerefentry><refentrytitle>mosquitto.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> are used.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-d</option></term> + <term><option>--daemon</option></term> + <listitem> + <para>Run <command>mosquitto</command> in the background as a daemon. All other behaviour remains the same.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-p</option></term> + <term><option>--port</option></term> + <listitem> + <para>Listen on the port specified instead of the default 1883. This acts in addition to the port setting in the config file. May be specified multiple times to open multiple sockets listening on different ports. This socket will be bound to all network interfaces.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-v</option></term> + <term><option>--verbose</option></term> + <listitem> + <para>Use verbose logging. This is equivalent to setting + <option>log_type</option> to <option>all</option> in + the configuration file. This overrides and logging + options given in the configuration file.</para> + </listitem> + </varlistentry> + </variablelist> + </refsect1> + + <refsect1> + <title>Configuration</title> + <para>The broker can be configured using a configuration file as + described in + <citerefentry><refentrytitle>mosquitto.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> + and this is the main point of information for mosquitto. + The files required for SSL/TLS support are described in + <citerefentry><refentrytitle>mosquitto-tls</refentrytitle><manvolnum>7</manvolnum></citerefentry>. + </para> + </refsect1> + + <refsect1> + <title>Broker Status</title> + <para>Clients can find information about the broker by subscribing to + topics in the $SYS hierarchy as follows. Topics marked as static are + only sent once per client on subscription. All other topics are updated + every <option>sys_interval</option> seconds. If + <option>sys_interval</option> is 0, then updates are not sent.</para> + <para>Note that if you are using a command line client to interact with the + $SYS topics and your shell interprets $ as an environment variable, + you need to place the topic in single quotes '$SYS/...' or to + escape the dollar symbol: \$SYS/... otherwise the $SYS will be + treated as an environment variable.</para> + <variablelist> + <varlistentry> + <term><option>$SYS/broker/bytes/received</option></term> + <listitem> + <para>The total number of bytes received since the broker + started.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/bytes/sent</option></term> + <listitem> + <para>The total number of bytes sent since the broker + started.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/clients/connected</option></term> + <term><option>$SYS/broker/clients/active</option> (deprecated)</term> + <listitem> + <para>The number of currently connected clients.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/clients/expired</option></term> + <listitem> + <para>The number of disconnected persistent clients that + have been expired and removed through the + persistent_client_expiration option.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/clients/disconnected</option></term> + <term><option>$SYS/broker/clients/inactive</option> (deprecated)</term> + <listitem> + <para>The total number of persistent clients (with clean + session disabled) that are registered at the broker but are + currently disconnected.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/clients/maximum</option></term> + <listitem> + <para>The maximum number of clients that have been + connected to the broker at the same time.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/clients/total</option></term> + <listitem> + <para>The total number of active and inactive clients + currently connected and registered on the + broker.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/connection/#</option></term> + <listitem> + <para>When bridges are configured to/from the broker, + common practice is to provide a status topic that + indicates the state of the connection. This is provided + within $SYS/broker/connection/ by default. If the value + of the topic is 1 the connection is active, if 0 then + it is not active. See the Bridges section below for + more information on bridges.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/heap/current size</option></term> + <listitem> + <para>The current size of the heap memory in use by + mosquitto. Note that this topic may be unavailable + depending on compile time options.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/heap/maximum size</option></term> + <listitem> + <para>The largest amount of heap memory used by + mosquitto. Note that this topic may be unavailable + depending on compile time options.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/load/connections/+</option></term> + <listitem> + <para>The moving average of the number of CONNECT packets + received by the broker over different time intervals. + The final "+" of the hierarchy can be 1min, 5min or + 15min. The value returned represents the number of + connections received in 1 minute, averaged over 1, 5 or + 15 minutes.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/load/bytes/received/+</option></term> + <listitem> + <para>The moving average of the number of bytes received by + the broker over different time intervals. The final "+" + of the hierarchy can be 1min, 5min or 15min. The value + returned represents the number of bytes received in 1 + minute, averaged over 1, 5 or 15 minutes.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/load/bytes/sent/+</option></term> + <listitem> + <para>The moving average of the number of bytes sent by the + broker over different time intervals. The final "+" of + the hierarchy can be 1min, 5min or 15min. The value + returned represents the number of bytes sent in 1 + minute, averaged over 1, 5 or 15 minutes.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/load/messages/received/+</option></term> + <listitem> + <para>The moving average of the number of all types of MQTT + messages received by the broker over different time + intervals. The final "+" of the hierarchy can be 1min, + 5min or 15min. The value returned represents the number + of messages received in 1 minute, averaged over 1, 5 or + 15 minutes.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/load/messages/sent/+</option></term> + <listitem> + <para>The moving average of the number of all types of MQTT + messages sent by the broker over different time + intervals. The final "+" of the hierarchy can be 1min, + 5min or 15min. The value returned represents the number + of messages send in 1 minute, averaged over 1, 5 or 15 + minutes.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/load/publish/dropped/+</option></term> + <listitem> + <para>The moving average of the number of publish messages + dropped by the broker over different time intervals. + This shows the rate at which durable clients that are + disconnected are losing messages. The final "+" of the + hierarchy can be 1min, 5min or 15min. The value + returned represents the number of messages dropped in 1 + minute, averaged over 1, 5 or 15 minutes.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/load/publish/received/+</option></term> + <listitem> + <para>The moving average of the number of publish messages + received by the broker over different time intervals. + The final "+" of the hierarchy can be 1min, 5min or + 15min. The value returned represents the number of + publish messages received in 1 minute, averaged over 1, + 5 or 15 minutes.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/load/publish/sent/+</option></term> + <listitem> + <para>The moving average of the number of publish messages + sent by the broker over different time intervals. The + final "+" of the hierarchy can be 1min, 5min or 15min. + The value returned represents the number of publish + messages sent in 1 minute, averaged over 1, 5 or 15 + minutes.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/load/sockets/+</option></term> + <listitem> + <para>The moving average of the number of socket + connections opened to the broker over different time + intervals. The final "+" of the hierarchy can be 1min, + 5min or 15min. The value returned represents the number + of socket connections in 1 minute, averaged over 1, 5 + or 15 minutes.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/messages/inflight</option></term> + <listitem> + <para>The number of messages with QoS>0 that are awaiting + acknowledgments.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/messages/received</option></term> + <listitem> + <para>The total number of messages of any type received since the broker started.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/messages/sent</option></term> + <listitem> + <para>The total number of messages of any type sent since the broker started.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/publish/messages/dropped</option></term> + <listitem> + <para>The total number of publish messages that have been + dropped due to inflight/queuing limits. See the + max_inflight_messages and max_queued_messages options + in + <citerefentry><refentrytitle>mosquitto.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> + for more information.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/publish/messages/received</option></term> + <listitem> + <para>The total number of PUBLISH messages received since the broker started.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/publish/messages/sent</option></term> + <listitem> + <para>The total number of PUBLISH messages sent since the broker started.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/retained messages/count</option></term> + <listitem> + <para>The total number of retained messages active on the broker.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/store/messages/count</option></term> + <term><option>$SYS/broker/messages/stored</option> (deprecated)</term> + <listitem> + <para>The number of messages currently held in the message + store. This includes retained messages and messages + queued for durable clients.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/store/messages/bytes</option></term> + <listitem> + <para>The number of bytes currently held by message payloads + in the message store. This includes retained messages + and messages queued for durable clients.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/subscriptions/count</option></term> + <listitem> + <para>The total number of subscriptions active on the broker.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>$SYS/broker/version</option></term> + <listitem> + <para>The version of the broker. Static.</para> + </listitem> + </varlistentry> + </variablelist> + </refsect1> + + <refsect1> + <title>Wildcard Topic Subscriptions</title> + <para>In addition to allowing clients to subscribe to specific topics, + mosquitto also allows the use of two wildcards in subscriptions. + <option>+</option> is the wildcard used to match a single level of + hierarchy. For example, for a topic of "a/b/c/d", the following example + subscriptions will match:</para> + <itemizedlist mark="circle"> + <listitem><para>a/b/c/d</para></listitem> + <listitem><para>+/b/c/d</para></listitem> + <listitem><para>a/+/c/d</para></listitem> + <listitem><para>a/+/+/d</para></listitem> + <listitem><para>+/+/+/+</para></listitem> + </itemizedlist> + <para>The following subscriptions will not match:</para> + <itemizedlist mark="circle"> + <listitem><para>a/b/c</para></listitem> + <listitem><para>b/+/c/d</para></listitem> + <listitem><para>+/+/+</para></listitem> + </itemizedlist> + <para>The second wildcard is <option>#</option> and is used to match + all subsequent levels of hierarchy. With a topic of "a/b/c/d", the + following example subscriptions will match:</para> + <itemizedlist mark="circle"> + <listitem><para>a/b/c/d</para></listitem> + <listitem><para>#</para></listitem> + <listitem><para>a/#</para></listitem> + <listitem><para>a/b/#</para></listitem> + <listitem><para>a/b/c/#</para></listitem> + <listitem><para>+/b/c/#</para></listitem> + </itemizedlist> + <para>The $SYS hierarchy does not match a subscription of + "#". If you want to observe the entire $SYS hierarchy, subscribe to + $SYS/#.</para> + <para>Note that the wildcards must be only ever used on their own, so a + subscription of "a/b+/c" is not valid use of a wildcard. The + <option>#</option> wildcard must only ever be used as the final + character of a subscription.</para> + </refsect1> + + <refsect1> + <title>Bridges</title> + <para>Multiple brokers can be connected together with the bridging + functionality. This is useful where it is desirable to share + information between locations, but where not all of the information + needs to be shared. An example could be where a number of users are + running a broker to help record power usage and for a number of other + reasons. The power usage could be shared through bridging all of the + user brokers to a common broker, allowing the power usage of all + users to be collected and compared. The other information would remain + local to each + broker.</para> + <para>For information on configuring bridges, see + <citerefentry><refentrytitle>mosquitto.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para> + </refsect1> + + <refsect1> + <title>Signals</title> + <variablelist> + <varlistentry> + <term>SIGHUP</term> + <listitem> + <para>Upon receiving the SIGHUP signal, mosquitto will + attempt to reload configuration file data, assuming that + the <option>-c</option> argument was provided when + mosquitto was started. Not all configuration parameters can + be reloaded without restarting. See + <citerefentry><refentrytitle>mosquitto.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> + for details.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>SIGUSR1</term> + <listitem> + <para>Upon receiving the SIGUSR1 signal, mosquitto will + write the persistence database to disk. This signal is only + acted upon if persistence is enabled.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>SIGUSR2</term> + <listitem> + <para>The SIGUSR2 signal causes mosquitto to print out the + current subscription tree, along with information about + where retained messages exist. This is intended as a + testing feature only and may be removed at any time.</para> + </listitem> + </varlistentry> + </variablelist> + </refsect1> + + <refsect1> + <title>Files</title> + <variablelist> + <varlistentry> + <term><filename>/etc/mosquitto/mosquitto.conf</filename></term> + <listitem> + <para>Configuration file. See <citerefentry><refentrytitle>mosquitto.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><filename>/var/lib/mosquitto/mosquitto.db</filename></term> + <listitem> + <para>Persistent message data storage location if persist enabled.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><filename>/etc/hosts.allow</filename></term> + <term><filename>/etc/hosts.deny</filename></term> + <listitem> + <para>Host access control via tcp-wrappers as described in <citerefentry><refentrytitle>hosts_access</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para> + </listitem> + </varlistentry> + </variablelist> + </refsect1> + + <refsect1> + <title>Bugs</title> + <para><command>mosquitto</command> bug information can be found at + <ulink url="https://github.com/eclipse/mosquitto/issues"/></para> + </refsect1> + + <refsect1> + <title>See Also</title> + <simplelist type="inline"> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mqtt-7.html">mqtt</link></refentrytitle> + <manvolnum>7</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto-tls-7.html">mosquitto-tls</link></refentrytitle> + <manvolnum>7</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto-conf-5.html">mosquitto.conf</link></refentrytitle> + <manvolnum>5</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="https://linux.die.net/man/5/hosts_access">hosts_access</link></refentrytitle> + <manvolnum>5</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto_passwd-1.html">mosquitto_passwd</link></refentrytitle> + <manvolnum>1</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto_pub-1.html">mosquitto_pub</link></refentrytitle> + <manvolnum>1</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto_rr-1.html">mosquitto_rr</link></refentrytitle> + <manvolnum>1</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto_sub-1.html">mosquitto_sub</link></refentrytitle> + <manvolnum>1</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="libmosquitto-3.html">libmosquitto</link></refentrytitle> + <manvolnum>3</manvolnum> + </citerefentry> + </member> + </simplelist> + </refsect1> + + <refsect1> + <title>Thanks</title> + <para>Thanks to Andy Stanford-Clark for being one of the people who + came up with MQTT in the first place. Thanks to Andy and Nicholas + O'Leary for providing clarifications of the protocol.</para> + <para>Thanks also to everybody at the Ubuntu UK Podcast and Linux + Outlaws for organising OggCamp, where Andy gave a talk that + inspired mosquitto.</para> + </refsect1> + + <refsect1> + <title>Author</title> + <para>Roger Light <email>roger@atchoo.org</email></para> + </refsect1> +</refentry> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.conf.5 b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.conf.5 new file mode 100644 index 0000000..98135e7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.conf.5 @@ -0,0 +1,1560 @@ +'\" t +.\" Title: mosquitto.conf +.\" Author: [see the "Author" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> +.\" Date: 06/18/2019 +.\" Manual: File formats and conventions +.\" Source: Mosquitto Project +.\" Language: English +.\" +.TH "MOSQUITTO\&.CONF" "5" "06/18/2019" "Mosquitto Project" "File formats and conventions" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +mosquitto.conf \- the configuration file for mosquitto +.SH "SYNOPSIS" +.HP \w'\fBmosquitto\&.conf\fR\ 'u +\fBmosquitto\&.conf\fR +.SH "DESCRIPTION" +.PP +\fBmosquitto\&.conf\fR +is the configuration file for mosquitto\&. This file can reside anywhere as long as mosquitto can read it\&. By default, mosquitto does not need a configuration file and will use the default values listed below\&. See +\fBmosquitto\fR(8) +for information on how to load a configuration file\&. +.SH "FILE FORMAT" +.PP +All lines with a # as the very first character are treated as a comment\&. +.PP +Configuration lines start with a variable name\&. The variable value is separated from the name by a single space\&. +.SH "AUTHENTICATION" +.PP +The authentication options described below allow a wide range of possibilities in conjunction with the listener options\&. This section aims to clarify the possibilities\&. +.PP +The simplest option is to have no authentication at all\&. This is the default if no other options are given\&. Unauthenticated encrypted support is provided by using the certificate based SSL/TLS based options cafile/capath, certfile and keyfile\&. +.PP +MQTT provides username/password authentication as part of the protocol\&. Use the password_file option to define the valid usernames and passwords\&. Be sure to use network encryption if you are using this option otherwise the username and password will be vulnerable to interception\&. Use the +\fBper_listener_settings\fR +to control whether passwords are required globally or on a per\-listener basis\&. +.PP +When using certificate based encryption there are three options that affect authentication\&. The first is require_certificate, which may be set to true or false\&. If false, the SSL/TLS component of the client will verify the server but there is no requirement for the client to provide anything for the server: authentication is limited to the MQTT built in username/password\&. If require_certificate is true, the client must provide a valid certificate in order to connect successfully\&. In this case, the second and third options, use_identity_as_username and use_subject_as_username, become relevant\&. If set to true, use_identity_as_username causes the Common Name (CN) from the client certificate to be used instead of the MQTT username for access control purposes\&. The password is not used because it is assumed that only authenticated clients have valid certificates\&. This means that any CA certificates you include in cafile or capath will be able to issue client certificates that are valid for connecting to your broker\&. If use_identity_as_username is false, the client must authenticate as normal (if required by password_file) through the MQTT options\&. The same principle applies for the use_subject_as_username option, but the entire certificate subject is used as the username instead of just the CN\&. +.PP +When using pre\-shared\-key based encryption through the psk_hint and psk_file options, the client must provide a valid identity and key in order to connect to the broker before any MQTT communication takes place\&. If use_identity_as_username is true, the PSK identity is used instead of the MQTT username for access control purposes\&. If use_identity_as_username is false, the client may still authenticate using the MQTT username/password if using the password_file option\&. +.PP +Both certificate and PSK based encryption are configured on a per\-listener basis\&. +.PP +Authentication plugins can be created to augment the password_file, acl_file and psk_file options with e\&.g\&. SQL based lookups\&. +.PP +It is possible to support multiple authentication schemes at once\&. A config could be created that had a listener for all of the different encryption options described above and hence a large number of ways of authenticating\&. +.SH "GENERAL OPTIONS" +.PP +\fBacl_file\fR \fIfile path\fR +.RS 4 +Set the path to an access control list file\&. If defined, the contents of the file are used to control client access to topics on the broker\&. +.sp +If this parameter is defined then only the topics listed will have access\&. Topic access is added with lines of the format: +.sp +topic [read|write|readwrite] <topic> +.sp +The access type is controlled using "read", "write" or "readwrite"\&. This parameter is optional (unless <topic> includes a space character) \- if not given then the access is read/write\&. <topic> can contain the + or # wildcards as in subscriptions\&. +.sp +The first set of topics are applied to anonymous clients, assuming +\fBallow_anonymous\fR +is true\&. User specific topic ACLs are added after a user line as follows: +.sp +user <username> +.sp +The username referred to here is the same as in +\fBpassword_file\fR\&. It is not the clientid\&. +.sp +It is also possible to define ACLs based on pattern substitution within the topic\&. The form is the same as for the topic keyword, but using pattern as the keyword\&. +.sp +pattern [read|write|readwrite] <topic> +.sp +The patterns available for substition are: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +%c to match the client id of the client +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +%u to match the username of the client +.RE +.sp +The substitution pattern must be the only text for that level of hierarchy\&. Pattern ACLs apply to all users even if the "user" keyword has previously been given\&. +.sp +Example: +.sp +pattern write sensor/%u/data +.sp +Allow access for bridge connection messages: +.sp +pattern write $SYS/broker/connection/%c/state +.sp +If the first character of a line of the ACL file is a # it is treated as a comment\&. +.sp +Reloaded on reload signal\&. The currently loaded ACLs will be freed and reloaded\&. Existing subscriptions will be affected after the reload\&. +.RE +.PP +\fBallow_anonymous\fR [ true | false ] +.RS 4 +Boolean value that determines whether clients that connect without providing a username are allowed to connect\&. If set to +\fIfalse\fR +then another means of connection should be created to control authenticated client access\&. +.sp +Defaults to +\fItrue\fR +if no other security options are set\&. If +\fBpassword_file\fR +or +\fBpsk_file\fR +is set, or if an authentication plugin is loaded which implements username/password or TLS\-PSK checks, then +\fBallow_anonymous\fR +defaults to +\fIfalse\fR\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBallow_duplicate_messages\fR [ true | false ] +.RS 4 +If a client is subscribed to multiple subscriptions that overlap, e\&.g\&. foo/# and foo/+/baz , then MQTT expects that when the broker receives a message on a topic that matches both subscriptions, such as foo/bar/baz, then the client should only receive the message once\&. +.sp +Mosquitto keeps track of which clients a message has been sent to in order to meet this requirement\&. This option allows this behaviour to be disabled, which may be useful if you have a large number of clients subscribed to the same set of topics and want to minimise memory usage\&. +.sp +It can be safely set to +\fItrue\fR +if you know in advance that your clients will never have overlapping subscriptions, otherwise your clients must be able to correctly deal with duplicate messages even when then have QoS=2\&. +.sp +Defaults to +\fItrue\fR\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBallow_zero_length_clientid\fR [ true | false ] +.RS 4 +MQTT 3\&.1\&.1 allows clients to connect with a zero length client id and have the broker generate a client id for them\&. Use this option to allow/disallow this behaviour\&. Defaults to true\&. +.sp +See also the +\fBauto_id_prefix\fR +option\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBauth_opt_*\fR \fIvalue\fR +.RS 4 +Options to be passed to the auth plugin\&. See the specific plugin instructions\&. +.RE +.PP +\fBauth_plugin\fR \fIfile path\fR +.RS 4 +Specify an external module to use for authentication and access control\&. This allows custom username/password and access control functions to be created\&. +.sp +Can be specified multiple times to load multiple plugins\&. The plugins will be processed in the order that they are specified\&. +.sp +If +\fBpassword_file\fR, or +\fBacl_file\fR +are used in the config file alongsize +\fBauth_plugin\fR, the plugin checks will run after the built in checks\&. +.sp +Not currently reloaded on reload signal\&. +.RE +.PP +\fBauth_plugin_deny_special_chars\fR [ true | false ] +.RS 4 +If +\fItrue\fR +then before an ACL check is made, the username/client id of the client needing the check is searched for the presence of either a \*(Aq+\*(Aq or \*(Aq#\*(Aq character\&. If either of these characters is found in either the username or client id, then the ACL check is denied before it is sent to the plugin\&. +.sp +This check prevents the case where a malicious user could circumvent an ACL check by using one of these characters as their username or client id\&. This is the same issue as was reported with mosquitto itself as CVE\-2017\-7650\&. +.sp +If you are entirely sure that the plugin you are using is not vulnerable to this attack (i\&.e\&. if you never use usernames or client ids in topics) then you can disable this extra check and hence have all ACL checks delivered to your plugin by setting this option to +\fIfalse\fR\&. +.sp +Defaults to +\fItrue\fR\&. +.sp +Not currently reloaded on reload signal\&. +.RE +.PP +\fBauto_id_prefix\fR \fIprefix\fR +.RS 4 +If +\fBallow_zero_length_clientid\fR +is +\fItrue\fR, this option allows you to set a string that will be prefixed to the automatically generated client ids to aid visibility in logs\&. Defaults to +\fBauto\-\fR\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBautosave_interval\fR \fIseconds\fR +.RS 4 +The number of seconds that mosquitto will wait between each time it saves the in\-memory database to disk\&. If set to 0, the in\-memory database will only be saved when mosquitto exits or when receiving the SIGUSR1 signal\&. Note that this setting only has an effect if persistence is enabled\&. Defaults to 1800 seconds (30 minutes)\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBautosave_on_changes\fR [ true | false ] +.RS 4 +If +\fItrue\fR, mosquitto will count the number of subscription changes, retained messages received and queued messages and if the total exceeds +\fBautosave_interval\fR +then the in\-memory database will be saved to disk\&. If +\fIfalse\fR, mosquitto will save the in\-memory database to disk by treating +\fBautosave_interval\fR +as a time in seconds\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBcheck_retain_source\fR [ true | false ] +.RS 4 +This option affects the scenario when a client subscribes to a topic that has retained messages\&. It is possible that the client that published the retained message to the topic had access at the time they published, but that access has been subsequently removed\&. If +\fBcheck_retain_source\fR +is set to true, the default, the source of a retained message will be checked for access rights before it is republished\&. When set to false, no check will be made and the retained message will always be published\&. +.sp +This option applies globally, regardless of the +\fBper_listener_settings\fR +option\&. +.RE +.PP +\fBclientid_prefixes\fR \fIprefix\fR +.RS 4 +If defined, only clients that have a clientid with a prefix that matches clientid_prefixes will be allowed to connect to the broker\&. For example, setting "secure\-" here would mean a client "secure\-client" could connect but another with clientid "mqtt" couldn\*(Aqt\&. By default, all client ids are valid\&. +.sp +Reloaded on reload signal\&. Note that currently connected clients will be unaffected by any changes\&. +.RE +.PP +\fBconnection_messages\fR [ true | false ] +.RS 4 +If set to +\fItrue\fR, the log will include entries when clients connect and disconnect\&. If set to +\fIfalse\fR, these entries will not appear\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBinclude_dir\fR \fIdir\fR +.RS 4 +External configuration files may be included by using the include_dir option\&. This defines a directory that will be searched for config files\&. All files that end in \*(Aq\&.conf\*(Aq will be loaded as a configuration file\&. It is best to have this as the last option in the main file\&. This option will only be processed from the main configuration file\&. The directory specified must not contain the main configuration file\&. +.sp +The configuration files in +\fBinclude_dir\fR +are loaded in case sensitive alphabetical order, with the upper case of each letter ordered before the lower case of the same letter\&. +.PP +\fBExample\ \&Load Order for include_dir.\ \&\fR +Given the files +\fIb\&.conf\fR, +\fIA\&.conf\fR, +\fI01\&.conf\fR, +\fIa\&.conf\fR, +\fIB\&.conf\fR, and +\fI00\&.conf\fR +inside +\fBinclude_dir\fR, the config files would be loaded in this order: +.sp +.if n \{\ +.RS 4 +.\} +.nf +00\&.conf +01\&.conf +A\&.conf +a\&.conf +B\&.conf +b\&.conf +.fi +.if n \{\ +.RE +.\} + +If this option is used multiple times, then each +\fBinclude_dir\fR +option is processed completely in the order that they are written in the main configuration file\&. +.PP +\fBExample\ \&Load Order for Multiple include_dir.\ \&\fR +Assuming a directory +\fIone\&.d\fR +containing files +\fIB\&.conf\fR +and +\fIC\&.conf\fR, and a second directory +\fItwo\&.d\fR +containing files +\fIA\&.conf\fR +and +\fID\&.conf\fR, and a config: +.sp +.if n \{\ +.RS 4 +.\} +.nf +include_dir one\&.d +include_dir two\&.d +.fi +.if n \{\ +.RE +.\} +.sp +Then the config files would be loaded in this order: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# files from one\&.d +B\&.conf +C\&.conf +# files from two\&.d +A\&.conf +D\&.conf +.fi +.if n \{\ +.RE +.\} +.RE +.PP +\fBlog_dest\fR \fIdestinations\fR +.RS 4 +Send log messages to a particular destination\&. Possible destinations are: +\fBstdout\fR +\fBstderr\fR +\fBsyslog\fR +\fBtopic\fR\&. +.sp +\fBstdout\fR +and +\fBstderr\fR +log to the console on the named output\&. +.sp +\fBsyslog\fR +uses the userspace syslog facility which usually ends up in /var/log/messages or similar and topic logs to the broker topic \*(Aq$SYS/broker/log/<severity>\*(Aq, where severity is one of D, E, W, N, I, M which are debug, error, warning, notice, information and message\&. Message type severity is used by the subscribe and unsubscribe log_type options and publishes log messages at $SYS/broker/log/M/subscribe and $SYS/broker/log/M/unsubscribe\&. +.sp +The +\fBfile\fR +destination requires an additional parameter which is the file to be logged to, e\&.g\&. "log_dest file /var/log/mosquitto\&.log"\&. The file will be closed and reopened when the broker receives a HUP signal\&. Only a single file destination may be configured\&. +.sp +Use "log_dest none" if you wish to disable logging\&. Defaults to stderr\&. This option may be specified multiple times\&. +.sp +Note that if the broker is running as a Windows service it will default to "log_dest none" and neither stdout nor stderr logging is available\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBlog_facility\fR \fIlocal facility\fR +.RS 4 +If using syslog logging (not on Windows), messages will be logged to the "daemon" facility by default\&. Use the +\fBlog_facility\fR +option to choose which of local0 to local7 to log to instead\&. The option value should be an integer value, e\&.g\&. "log_facility 5" to use local5\&. +.RE +.PP +\fBlog_timestamp\fR [ true | false ] +.RS 4 +Boolean value, if set to +\fItrue\fR +a timestamp value will be added to each log entry\&. The default is +\fItrue\fR\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBlog_timestamp_format\fR \fIformat\fR +.RS 4 +Set the format of the log timestamp\&. If left unset, this is the number of seconds since the Unix epoch\&. This option is a free text string which will be passed to the strftime function as the format specifier\&. To get an ISO 8601 datetime, for example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +log_timestamp_format %Y\-%m\-%dT%H:%M:%S + +.fi +.if n \{\ +.RE +.\} +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBlog_type\fR \fItypes\fR +.RS 4 +Choose types of messages to log\&. Possible types are: +\fIdebug\fR, +\fIerror\fR, +\fIwarning\fR, +\fInotice\fR, +\fIinformation\fR, +\fIsubscribe\fR, +\fIunsubscribe\fR, +\fIwebsockets\fR, +\fInone\fR, +\fIall\fR\&. +.sp +Defaults to +\fIerror\fR, +\fIwarning\fR, +\fInotice \fRand +\fIinformation\fR\&. This option may be specified multiple times\&. Note that the +\fIdebug \fRtype (used for decoding incoming/outgoing network packets) is never logged in topics\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBmax_inflight_bytes\fR \fIcount\fR +.RS 4 +QoS 1 and 2 messages will be allowed in flight until this byte limit is reached\&. Defaults to 0\&. (No limit) See also the +\fBmax_inflight_messages\fR +option\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBmax_inflight_messages\fR \fIcount\fR +.RS 4 +The maximum number of QoS 1 or 2 messages that can be in the process of being transmitted simultaneously\&. This includes messages currently going through handshakes and messages that are being retried\&. Defaults to 20\&. Set to 0 for no maximum\&. If set to 1, this will guarantee in\-order delivery of messages\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBmax_keepalive\fR \fIvalue\fR +.RS 4 +For MQTT v5 clients, it is possible to have the server send a "server keepalive" value that will override the keepalive value set by the client\&. This is intended to be used as a mechanism to say that the server will disconnect the client earlier than it anticipated, and that the client should use the new keepalive value\&. The max_keepalive option allows you to specify that clients may only connect with keepalive less than or equal to this value, otherwise they will be sent a server keepalive telling them to use max_keepalive\&. This only applies to MQTT v5 clients\&. The maximum value allowable, and default value, is 65535\&. Do not set below 10 seconds\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBmax_packet_size\fR \fIvalue\fR +.RS 4 +For MQTT v5 clients, it is possible to have the server send a "maximum packet size" value that will instruct the client it will not accept MQTT packets with size greater than +\fBvalue\fR +bytes\&. This applies to the full MQTT packet, not just the payload\&. Setting this option to a positive value will set the maximum packet size to that number of bytes\&. If a client sends a packet which is larger than this value, it will be disconnected\&. This applies to all clients regardless of the protocol version they are using, but v3\&.1\&.1 and earlier clients will of course not have received the maximum packet size information\&. Defaults to no limit\&. +.sp +Setting below 20 bytes is forbidden because it is likely to interfere with normal client operation even with small payloads\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBmax_queued_bytes\fR \fIcount\fR +.RS 4 +QoS 1 and 2 messages above those currently in\-flight will be queued (per client) until this limit is exceeded\&. Defaults to 0\&. (No maximum) See also the +\fBmax_queued_messages\fR +option\&. If both max_queued_messages and max_queued_bytes are specified, packets will be queued until the first limit is reached\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBmax_queued_messages\fR \fIcount\fR +.RS 4 +The maximum number of QoS 1 or 2 messages to hold in the queue (per client) above those messages that are currently in flight\&. Defaults to 100\&. Set to 0 for no maximum (not recommended)\&. See also the +\fBqueue_qos0_messages\fR +and +\fBmax_queued_bytes\fR +options\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBmemory_limit\fR \fIlimit\fR +.RS 4 +This option sets the maximum number of heap memory bytes that the broker will allocate, and hence sets a hard limit on memory use by the broker\&. Memory requests that exceed this value will be denied\&. The effect will vary depending on what has been denied\&. If an incoming message is being processed, then the message will be dropped and the publishing client will be disconnected\&. If an outgoing message is being sent, then the individual message will be dropped and the receiving client will be disconnected\&. Defaults to no limit\&. +.sp +This option is only available if memory tracking support is compiled in\&. +.sp +Reloaded on reload signal\&. Setting to a lower value and reloading will not result in memory being freed\&. +.RE +.PP +\fBmessage_size_limit\fR \fIlimit\fR +.RS 4 +This option sets the maximum publish payload size that the broker will allow\&. Received messages that exceed this size will not be accepted by the broker\&. The default value is 0, which means that all valid MQTT messages are accepted\&. MQTT imposes a maximum payload size of 268435455 bytes\&. +.RE +.PP +\fBpassword_file\fR \fIfile path\fR +.RS 4 +Set the path to a password file\&. If defined, the contents of the file are used to control client access to the broker\&. The file can be created using the +\fBmosquitto_passwd\fR(1) +utility\&. If mosquitto is compiled without TLS support (it is recommended that TLS support is included), then the password file should be a text file with each line in the format "username:password", where the colon and password are optional but recommended\&. If +\fBallow_anonymous\fR +is set to +\fIfalse\fR, only users defined in this file will be able to connect\&. Setting +\fBallow_anonymous\fR +to +\fItrue\fR +when +\fIpassword_file\fRis defined is valid and could be used with acl_file to have e\&.g\&. read only guest/anonymous accounts and defined users that can publish\&. +.sp +Reloaded on reload signal\&. The currently loaded username and password data will be freed and reloaded\&. Clients that are already connected will not be affected\&. +.sp +See also +\fBmosquitto_passwd\fR(1)\&. +.RE +.PP +\fBper_listener_settings\fR [ true | false ] +.RS 4 +If +\fItrue\fR, then authentication and access control settings will be controlled on a per\-listener basis\&. The following options are affected: +.sp +\fBpassword_file\fR, +\fBacl_file\fR, +\fBpsk_file\fR, +\fBallow_anonymous\fR, +\fBallow_zero_length_clientid\fR, +\fBauth_plugin\fR, +\fBauth_opt_*\fR, +\fBauto_id_prefix\fR\&. +.sp +Note that if set to true, then a durable client (i\&.e\&. with clean session set to false) that has disconnected will use the ACL settings defined for the listener that it was most recently connected to\&. +.sp +The default behaviour is for this to be set to +\fIfalse\fR, which maintains the settings behaviour from previous versions of mosquitto\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBpersistence\fR [ true | false ] +.RS 4 +If +\fItrue\fR, connection, subscription and message data will be written to the disk in mosquitto\&.db at the location dictated by persistence_location\&. When mosquitto is restarted, it will reload the information stored in mosquitto\&.db\&. The data will be written to disk when mosquitto closes and also at periodic intervals as defined by autosave_interval\&. Writing of the persistence database may also be forced by sending mosquitto the SIGUSR1 signal\&. If +\fIfalse\fR, the data will be stored in memory only\&. Defaults to +\fIfalse\fR\&. +.sp +The persistence file may change its format in a new version\&. The broker can currently read all old formats, but will only save in the latest format\&. It should always be safe to upgrade, but cautious users may wish to take a copy of the persistence file before installing a new version so that they can roll back to an earlier version if necessary\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBpersistence_file\fR \fIfile name\fR +.RS 4 +The filename to use for the persistent database\&. Defaults to mosquitto\&.db\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBpersistence_location\fR \fIpath\fR +.RS 4 +The path where the persistence database should be stored\&. Must end in a trailing slash\&. If not given, then the current directory is used\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBpersistent_client_expiration\fR \fIduration\fR +.RS 4 +This option allows persistent clients (those with clean session set to false) to be removed if they do not reconnect within a certain time frame\&. This is a non\-standard option\&. As far as the MQTT spec is concerned, persistent clients persist forever\&. +.sp +Badly designed clients may set clean session to false whilst using a randomly generated client id\&. This leads to persistent clients that will never reconnect\&. This option allows these clients to be removed\&. +.sp +The expiration period should be an integer followed by one of h d w m y for hour, day, week, month and year respectively\&. For example: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +persistent_client_expiration 2m +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +persistent_client_expiration 14d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +persistent_client_expiration 1y +.RE +.sp +As this is a non\-standard option, the default if not set is to never expire persistent clients\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBpid_file\fR \fIfile path\fR +.RS 4 +Write a pid file to the file specified\&. If not given (the default), no pid file will be written\&. If the pid file cannot be written, mosquitto will exit\&. This option only has an effect is mosquitto is run in daemon mode\&. +.sp +If mosquitto is being automatically started by an init script it will usually be required to write a pid file\&. This should then be configured as e\&.g\&. /var/run/mosquitto\&.pid +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBpsk_file\fR \fIfile path\fR +.RS 4 +Set the path to a pre\-shared\-key file\&. This option requires a listener to be have PSK support enabled\&. If defined, the contents of the file are used to control client access to the broker\&. Each line should be in the format "identity:key", where the key is a hexadecimal string with no leading "0x"\&. A client connecting to a listener that has PSK support enabled must provide a matching identity and PSK to allow the encrypted connection to proceed\&. +.sp +Reloaded on reload signal\&. The currently loaded identity and key data will be freed and reloaded\&. Clients that are already connected will not be affected\&. +.RE +.PP +\fBqueue_qos0_messages\fR [ true | false ] +.RS 4 +Set to +\fItrue\fR +to queue messages with QoS 0 when a persistent client is disconnected\&. These messages are included in the limit imposed by max_queued_messages\&. Defaults to +\fIfalse\fR\&. +.sp +Note that the MQTT v3\&.1\&.1 spec states that only QoS 1 and 2 messages should be saved in this situation so this is a non\-standard option\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBretain_available\fR [ true | false ] +.RS 4 +If set to false, then retained messages are not supported\&. Clients that send a message with the retain bit will be disconnected if this option is set to false\&. Defaults to true\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBretained_persistence\fR [ true | false ] +.RS 4 +This is a synonym of the +\fBpersistence\fR +option\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBset_tcp_nodelay\fR [ true | false ] +.RS 4 +If set to true, the TCP_NODELAY option will be set on client sockets to disable Nagle\*(Aqs algorithm\&. This has the effect of reducing latency of some messages at potentially increasing the number of TCP packets being sent\&. Defaults to false\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBsys_interval\fR \fIseconds\fR +.RS 4 +The integer number of seconds between updates of the $SYS subscription hierarchy, which provides status information about the broker\&. If unset, defaults to 10 seconds\&. +.sp +Set to 0 to disable publishing the $SYS hierarchy completely\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBupgrade_outgoing_qos\fR [ true | false ] +.RS 4 +The MQTT specification requires that the QoS of a message delivered to a subscriber is never upgraded to match the QoS of the subscription\&. Enabling this option changes this behaviour\&. If +\fBupgrade_outgoing_qos\fR +is set +\fItrue\fR, messages sent to a subscriber will always match the QoS of its subscription\&. This is a non\-standard option not provided for by the spec\&. Defaults to +\fIfalse\fR\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBuser\fR \fIusername\fR +.RS 4 +When run as root, change to this user and its primary group on startup\&. If mosquitto is unable to change to this user and group, it will exit with an error\&. The user specified must have read/write access to the persistence database if it is to be written\&. If run as a non\-root user, this setting has no effect\&. Defaults to mosquitto\&. +.sp +This setting has no effect on Windows and so you should run mosquitto as the user you wish it to run as\&. +.sp +Not reloaded on reload signal\&. +.RE +.SH "LISTENERS" +.PP +The network ports that mosquitto listens on can be controlled using listeners\&. The default listener options can be overridden and further listeners can be created\&. +.SS "General Options" +.PP +\fBbind_address\fR \fIaddress\fR +.RS 4 +Listen for incoming network connections on the specified IP address/hostname only\&. This is useful to restrict access to certain network interfaces\&. To restrict access to mosquitto to the local host only, use "bind_address localhost"\&. This only applies to the default listener\&. Use the listener variable to control other listeners\&. +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBbind_interface\fR \fIdevice\fR +.RS 4 +Listen for incoming network connections only on the specified interface\&. This is similar to the +\fBbind_address\fR +option but is useful when an interface has multiple addresses or the address may change\&. +.sp +It is valid to use this option together with +\fBbind_address\fR +for the default listener, or the +\fIbind address/host\fR +part of the +\fBlistener\fR +definition\&. Care should be taken to ensure that the address being bound to is on the interface being bound to\&. If you set the +\fBbind_interface\fR +to be +\fIeth0\fR, and +\fBbind_address\fR +to +\fI127\&.0\&.0\&.1\fR, then the broker will start correctly but you will be unable to connect\&. +.sp +This option is currently only available on Linux, and requires elevated privileges\&. +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBhttp_dir\fR \fIdirectory\fR +.RS 4 +When a listener is using the websockets protocol, it is possible to serve http data as well\&. Set +\fBhttp_dir\fR +to a directory which contains the files you wish to serve\&. If this option is not specified, then no normal http connections will be possible\&. +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBlistener\fR \fIport\fR \fI[bind address/host]\fR +.RS 4 +Listen for incoming network connection on the specified port\&. A second optional argument allows the listener to be bound to a specific ip address/hostname\&. If this variable is used and neither the global +\fBbind_address\fR +nor +\fBport\fR +options are used then the default listener will not be started\&. +.sp +The +\fBbind address/host\fR +option allows this listener to be bound to a specific IP address by passing an IP address or hostname\&. For websockets listeners, it is only possible to pass an IP address here\&. +.sp +This option may be specified multiple times\&. See also the +\fBmount_point\fR +option\&. +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBmax_connections\fR \fIcount\fR +.RS 4 +Limit the total number of clients connected for the current listener\&. Set to +\-1 +to have "unlimited" connections\&. Note that other limits may be imposed that are outside the control of mosquitto\&. See e\&.g\&. +\fBlimits.conf\fR(5)\&. +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBmaximum_qos\fR \fIcount\fR +.RS 4 +Limit the QoS value allowed when using this listener\&. Defaults to 2, which means any QoS can be used\&. Set to 0 or 1 to limit to those QoS values\&. This makes use of an MQTT v5 feature to notify clients of the limitation\&. MQTT v3\&.1\&.1 clients will not be aware of the limitation\&. Clients publshing to this listener with a too\-high QoS will be disconnected\&. +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBmax_topic_alias\fR \fInumber\fR +.RS 4 +This option sets the maximum number topic aliases that an MQTT v5 client is allowed to create\&. It applies per listener\&. Defaults to 10\&. Set to 0 to disallow topic aliases\&. +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBmount_point\fR \fItopic prefix\fR +.RS 4 +This option is used with the listener option to isolate groups of clients\&. When a client connects to a listener which uses this option, the string argument is attached to the start of all topics for this client\&. This prefix is removed when any messages are sent to the client\&. This means a client connected to a listener with mount point +\fIexample\fR +can only see messages that are published in the topic hierarchy +\fIexample\fR +and below\&. +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBport\fR \fIport number\fR +.RS 4 +Set the network port for the default listener to listen on\&. Defaults to 1883\&. +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBprotocol\fR \fIvalue\fR +.RS 4 +Set the protocol to accept for this listener\&. Can be +\fBmqtt\fR, the default, or +\fBwebsockets\fR +if available\&. +.sp +Websockets support is currently disabled by default at compile time\&. Certificate based TLS may be used with websockets, except that only the +\fBcafile\fR, +\fBcertfile\fR, +\fBkeyfile\fR +and +\fBciphers\fR +options are supported\&. +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBsocket_domain\fR [ ipv4 | ipv6 ] +.RS 4 +By default, a listener will attempt to listen on all supported IP protocol versions\&. If you do not have an IPv4 or IPv6 interface you may wish to disable support for either of those protocol versions\&. In particular, note that due to the limitations of the websockets library, it will only ever attempt to open IPv6 sockets if IPv6 support is compiled in, and so will fail if IPv6 is not available\&. +.sp +Set to +\fBipv4\fR +to force the listener to only use IPv4, or set to +\fBipv6\fR +to force the listener to only use IPv6\&. If you want support for both IPv4 and IPv6, then do not use the +\fBsocket_domain\fR +option\&. +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBuse_username_as_clientid\fR [ true | false ] +.RS 4 +Set +\fBuse_username_as_clientid\fR +to true to replace the clientid that a client connected with with its username\&. This allows authentication to be tied to the clientid, which means that it is possible to prevent one client disconnecting another by using the same clientid\&. Defaults to false\&. +.sp +If a client connects with no username it will be disconnected as not authorised when this option is set to true\&. Do not use in conjunction with +\fBclientid_prefixes\fR\&. +.sp +See also +\fBuse_identity_as_username\fR\&. +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBwebsockets_log_level\fR \fIlevel\fR +.RS 4 +Change the websockets logging level\&. This is a global option, it is not possible to set per listener\&. This is an integer that is interpreted by libwebsockets as a bit mask for its lws_log_levels enum\&. See the libwebsockets documentation for more details\&. +.sp +To use this option, +\fBlog_type websockets\fR +must also be enabled\&. Defaults to 0\&. +.RE +.PP +\fBwebsockets_headers_size\fR \fIsize\fR +.RS 4 +Change the websockets headers size\&. This is a global option, it is not possible to set per listener\&. This option sets the size of the buffer used in the libwebsockets library when reading HTTP headers\&. If you are passing large header data such as cookies then you may need to increase this value\&. If left unset, or set to 0, then the default of 1024 bytes will be used\&. +.RE +.SS "Certificate based SSL/TLS Support" +.PP +The following options are available for all listeners to configure certificate based SSL support\&. See also "Pre\-shared\-key based SSL/TLS support"\&. +.PP +\fBcafile\fR \fIfile path\fR +.RS 4 +At least one of +\fBcafile\fR +or +\fBcapath\fR +must be provided to allow SSL support\&. +.sp +\fBcafile\fR +is used to define the path to a file containing the PEM encoded CA certificates that are trusted\&. +.RE +.PP +\fBcapath\fR \fIdirectory path\fR +.RS 4 +At least one of +\fBcafile\fR +or +\fBcapath\fR +must be provided to allow SSL support\&. +.sp +\fBcapath\fR +is used to define a directory that contains PEM encoded CA certificates that are trusted\&. For +\fBcapath\fR +to work correctly, the certificates files must have "\&.pem" as the file ending and you must run "openssl rehash <path to capath>" each time you add/remove a certificate\&. +.RE +.PP +\fBcertfile\fR \fIfile path\fR +.RS 4 +Path to the PEM encoded server certificate\&. +.RE +.PP +\fBciphers\fR \fIcipher:list\fR +.RS 4 +The list of allowed ciphers, each separated with a colon\&. Available ciphers can be obtained using the "openssl ciphers" command\&. +.RE +.PP +\fBcrlfile\fR \fIfile path\fR +.RS 4 +If you have +\fBrequire_certificate\fR +set to +\fItrue\fR, you can create a certificate revocation list file to revoke access to particular client certificates\&. If you have done this, use crlfile to point to the PEM encoded revocation file\&. +.RE +.PP +\fBdhparamfile\fR \fIfile path\fR +.RS 4 +To allow the use of ephemeral DH key exchange, which provides forward security, the listener must load DH parameters\&. This can be specified with the dhparamfile option\&. The dhparamfile can be generated with the command e\&.g\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +openssl dhparam \-out dhparam\&.pem 2048 +.fi +.if n \{\ +.RE +.\} +.RE +.PP +\fBkeyfile\fR \fIfile path\fR +.RS 4 +Path to the PEM encoded keyfile\&. +.RE +.PP +\fBrequire_certificate\fR [ true | false ] +.RS 4 +By default an SSL/TLS enabled listener will operate in a similar fashion to a https enabled web server, in that the server has a certificate signed by a CA and the client will verify that it is a trusted certificate\&. The overall aim is encryption of the network traffic\&. By setting +\fBrequire_certificate\fR +to +\fItrue\fR, the client must provide a valid certificate in order for the network connection to proceed\&. This allows access to the broker to be controlled outside of the mechanisms provided by MQTT\&. +.RE +.PP +\fBtls_engine\fR \fIengine\fR +.RS 4 +A valid openssl engine id\&. These can be listed with openssl engine command\&. +.RE +.PP +\fBtls_engine_kpass_sha1\fR \fIengine_kpass_sha1\fR +.RS 4 +SHA1 of the private key password when using an TLS engine\&. Some TLS engines such as the TPM engine may require the use of a password in order to be accessed\&. This option allows a hex encoded SHA1 hash of the password to the engine directly, instead of the user being prompted for the password\&. +.RE +.PP +\fBtls_keyform\fR [ pem | engine ] +.RS 4 +Specifies the type of private key in use when making TLS connections\&.\&. This can be "pem" or "engine"\&. This parameter is useful when a TPM module is being used and the private key has been created with it\&. Defaults to "pem", which means normal private key files are used\&. +.RE +.PP +\fBtls_version\fR \fIversion\fR +.RS 4 +Configure the version of the TLS protocol to be used for this listener\&. Possible values are +\fItlsv1\&.3\fR, +\fItlsv1\&.2\fR +and +\fItlsv1\&.1\fR\&. If left unset, the default of allowing all of TLS v1\&.3, v1\&.2 and v1\&.1 is used\&. +.RE +.PP +\fBuse_identity_as_username\fR [ true | false ] +.RS 4 +If +\fBrequire_certificate\fR +is +\fItrue\fR, you may set +\fBuse_identity_as_username\fR +to +\fItrue\fR +to use the CN value from the client certificate as a username\&. If this is +\fItrue\fR, the +\fBpassword_file\fR +option will not be used for this listener\&. +.sp +This takes priority over +\fBuse_subject_as_username\fR +if both are set to +\fItrue\fR\&. +.sp +See also +\fBuse_subject_as_username\fR +.RE +.PP +\fBuse_subject_as_username\fR [ true | false ] +.RS 4 +If +\fBrequire_certificate\fR +is +\fItrue\fR, you may set +\fBuse_subject_as_username\fR +to +\fItrue\fR +to use the complete subject value from the client certificate as a username\&. If this is +\fItrue\fR, the +\fBpassword_file\fR +option will not be used for this listener\&. +.sp +The subject will be generated in a form similar to +\fBCN=test client,OU=Production,O=Server,L=Nottingham,ST=Nottinghamshire,C=GB\fR\&. +.sp +See also +\fBuse_identity_as_username\fR +.RE +.SS "Pre\-shared\-key based SSL/TLS Support" +.PP +The following options are available for all listeners to configure pre\-shared\-key based SSL support\&. See also "Certificate based SSL/TLS support"\&. +.PP +\fBciphers\fR \fIcipher:list\fR +.RS 4 +When using PSK, the encryption ciphers used will be chosen from the list of available PSK ciphers\&. If you want to control which ciphers are available, use this option\&. The list of available ciphers can be optained using the "openssl ciphers" command and should be provided in the same format as the output of that command\&. +.RE +.PP +\fBpsk_hint\fR \fIhint\fR +.RS 4 +The +\fBpsk_hint\fR +option enables pre\-shared\-key support for this listener and also acts as an identifier for this listener\&. The hint is sent to clients and may be used locally to aid authentication\&. The hint is a free form string that doesn\*(Aqt have much meaning in itself, so feel free to be creative\&. +.sp +If this option is provided, see +\fBpsk_file\fR +to define the pre\-shared keys to be used or create a security plugin to handle them\&. +.RE +.PP +\fBtls_version\fR \fIversion\fR +.RS 4 +Configure the version of the TLS protocol to be used for this listener\&. Possible values are +\fItlsv1\&.3\fR, +\fItlsv1\&.2\fR +and +\fItlsv1\&.1\fR\&. If left unset, the default of allowing all of TLS v1\&.3, v1\&.2 and v1\&.1 is used\&. +.RE +.PP +\fBuse_identity_as_username\fR [ true | false ] +.RS 4 +Set +\fBuse_identity_as_username\fR +to have the psk identity sent by the client used as its username\&. The username will be checked as normal, so +\fBpassword_file\fR +or another means of authentication checking must be used\&. No password will be used\&. +.RE +.SH "CONFIGURING BRIDGES" +.PP +Multiple bridges (connections to other brokers) can be configured using the following variables\&. +.PP +Bridges cannot currently be reloaded on reload signal\&. +.PP +\fBaddress\fR \fIaddress[:port]\fR \fI[address[:port]]\fR, \fBaddresses\fR \fIaddress[:port]\fR \fI[address[:port]]\fR +.RS 4 +Specify the address and optionally the port of the bridge to connect to\&. This must be given for each bridge connection\&. If the port is not specified, the default of 1883 is used\&. +.sp +If you use an IPv6 address, then the port is not optional\&. +.sp +Multiple host addresses can be specified on the address config\&. See the +\fBround_robin\fR +option for more details on the behaviour of bridges with multiple addresses\&. +.RE +.PP +\fBbridge_attempt_unsubscribe\fR [ true | false ] +.RS 4 +If a bridge has topics that have "out" direction, the default behaviour is to send an unsubscribe request to the remote broker on that topic\&. This means that changing a topic direction from "in" to "out" will not keep receiving incoming messages\&. Sending these unsubscribe requests is not always desirable, setting +\fBbridge_attempt_unsubscribe\fR +to +\fIfalse\fR +will disable sending the unsubscribe request\&. Defaults to +\fItrue\fR\&. +.RE +.PP +\fBbridge_protocol_version\fR \fIversion\fR +.RS 4 +Set the version of the MQTT protocol to use with for this bridge\&. Can be one of +\fImqttv31\fR +or +\fImqttv311\fR\&. Defaults to +\fImqttv31\fR\&. +.RE +.PP +\fBcleansession\fR [ true | false ] +.RS 4 +Set the clean session option for this bridge\&. Setting to +\fIfalse\fR +(the default), means that all subscriptions on the remote broker are kept in case of the network connection dropping\&. If set to +\fItrue\fR, all subscriptions and messages on the remote broker will be cleaned up if the connection drops\&. Note that setting to +\fItrue\fR +may cause a large amount of retained messages to be sent each time the bridge reconnects\&. +.sp +If you are using bridges with +\fBcleansession\fR +set to +\fIfalse\fR +(the default), then you may get unexpected behaviour from incoming topics if you change what topics you are subscribing to\&. This is because the remote broker keeps the subscription for the old topic\&. If you have this problem, connect your bridge with +\fBcleansession\fR +set to +\fItrue\fR, then reconnect with cleansession set to +\fIfalse\fR +as normal\&. +.RE +.PP +\fBconnection\fR \fIname\fR +.RS 4 +This variable marks the start of a new bridge connection\&. It is also used to give the bridge a name which is used as the client id on the remote broker\&. +.RE +.PP +\fBkeepalive_interval\fR \fIseconds\fR +.RS 4 +Set the number of seconds after which the bridge should send a ping if no other traffic has occurred\&. Defaults to 60\&. A minimum value of 5 seconds is allowed\&. +.RE +.PP +\fBidle_timeout\fR \fIseconds\fR +.RS 4 +Set the amount of time a bridge using the lazy start type must be idle before it will be stopped\&. Defaults to 60 seconds\&. +.RE +.PP +\fBlocal_clientid\fR \fIid\fR +.RS 4 +Set the clientid to use on the local broker\&. If not defined, this defaults to +\fBlocal\&.<remote_clientid>\fR\&. If you are bridging a broker to itself, it is important that local_clientid and remote_clientid do not match\&. +.RE +.PP +\fBlocal_password\fR \fIpassword\fR +.RS 4 +Configure the password to be used when connecting this bridge to the local broker\&. This may be important when authentication and ACLs are being used\&. +.RE +.PP +\fBlocal_username\fR \fIusername\fR +.RS 4 +Configure the username to be used when connecting this bridge to the local broker\&. This may be important when authentication and ACLs are being used\&. +.RE +.PP +\fBnotifications\fR [ true | false ] +.RS 4 +If set to +\fItrue\fR, publish notification messages to the local and remote brokers giving information about the state of the bridge connection\&. Retained messages are published to the topic $SYS/broker/connection/<remote_clientid>/state unless otherwise set with +\fBnotification_topic\fRs\&. If the message is 1 then the connection is active, or 0 if the connection has failed\&. Defaults to +\fItrue\fR\&. +.sp +This uses the Last Will and Testament (LWT) feature\&. +.RE +.PP +\fBnotifications_local_only\fR [ true | false ] +.RS 4 +If set to +\fItrue\fR, only publish notification messages to the local broker giving information about the state of the bridge connection\&. Defaults to +\fIfalse\fR\&. +.RE +.PP +\fBnotification_topic\fR \fItopic\fR +.RS 4 +Choose the topic on which notifications will be published for this bridge\&. If not set the messages will be sent on the topic $SYS/broker/connection/<remote_clientid>/state\&. +.RE +.PP +\fBremote_clientid\fR \fIid\fR +.RS 4 +Set the client id for this bridge connection\&. If not defined, this defaults to \*(Aqname\&.hostname\*(Aq, where name is the connection name and hostname is the hostname of this computer\&. +.sp +This replaces the old "clientid" option to avoid confusion with local/remote sides of the bridge\&. "clientid" remains valid for the time being\&. +.RE +.PP +\fBremote_password\fR \fIvalue\fR +.RS 4 +Configure a password for the bridge\&. This is used for authentication purposes when connecting to a broker that supports MQTT v3\&.1 and up and requires a username and/or password to connect\&. This option is only valid if a remote_username is also supplied\&. +.sp +This replaces the old "password" option to avoid confusion with local/remote sides of the bridge\&. "password" remains valid for the time being\&. +.RE +.PP +\fBremote_username\fR \fIname\fR +.RS 4 +Configure a username for the bridge\&. This is used for authentication purposes when connecting to a broker that supports MQTT v3\&.1 and up and requires a username and/or password to connect\&. See also the +\fBremote_password\fR +option\&. +.sp +This replaces the old "username" option to avoid confusion with local/remote sides of the bridge\&. "username" remains valid for the time being\&. +.RE +.PP +\fBrestart_timeout\fR \fIbase cap\fR, \fBrestart_timeout\fR \fIconstant\fR +.RS 4 +Set the amount of time a bridge using the automatic start type will wait until attempting to reconnect\&. +.sp +This option can be configured to use a constant delay time in seconds, or to use a backoff mechanism based on "Decorrelated Jitter", which adds a degree of randomness to when the restart occurs, starting at the base and increasing up to the cap\&. Set a constant timeout of 20 seconds: +.sp +.if n \{\ +.RS 4 +.\} +.nf +restart_timeout 20 +.fi +.if n \{\ +.RE +.\} +.sp +Set backoff with a base (start value) of 10 seconds and a cap (upper limit) of 60 seconds: +.sp +.if n \{\ +.RS 4 +.\} +.nf +restart_timeout 10 30 +.fi +.if n \{\ +.RE +.\} +.sp +Defaults to jitter with a base of 5 seconds and cap of 30 seconds\&. +.RE +.PP +\fBround_robin\fR [ true | false ] +.RS 4 +If the bridge has more than one address given in the address/addresses configuration, the round_robin option defines the behaviour of the bridge on a failure of the bridge connection\&. If round_robin is +\fIfalse\fR, the default value, then the first address is treated as the main bridge connection\&. If the connection fails, the other secondary addresses will be attempted in turn\&. Whilst connected to a secondary bridge, the bridge will periodically attempt to reconnect to the main bridge until successful\&. +.sp +If round_robin is +\fItrue\fR, then all addresses are treated as equals\&. If a connection fails, the next address will be tried and if successful will remain connected until it fails\&. +.RE +.PP +\fBstart_type\fR [ automatic | lazy | once ] +.RS 4 +Set the start type of the bridge\&. This controls how the bridge starts and can be one of three types: +\fIautomatic\fR, +\fIlazy \fRand +\fIonce\fR\&. Note that RSMB provides a fourth start type "manual" which isn\*(Aqt currently supported by mosquitto\&. +.sp +\fIautomatic\fR +is the default start type and means that the bridge connection will be started automatically when the broker starts and also restarted after a short delay (30 seconds) if the connection fails\&. +.sp +Bridges using the +\fIlazy\fR +start type will be started automatically when the number of queued messages exceeds the number set with the +\fBthreshold\fR +option\&. It will be stopped automatically after the time set by the +\fBidle_timeout\fR +parameter\&. Use this start type if you wish the connection to only be active when it is needed\&. +.sp +A bridge using the +\fIonce\fR +start type will be started automatically when the broker starts but will not be restarted if the connection fails\&. +.RE +.PP +\fBthreshold\fR \fIcount\fR +.RS 4 +Set the number of messages that need to be queued for a bridge with lazy start type to be restarted\&. Defaults to 10 messages\&. +.RE +.PP +\fBtopic\fR \fIpattern\fR [[[ out | in | both ] qos\-level] local\-prefix remote\-prefix] +.RS 4 +Define a topic pattern to be shared between the two brokers\&. Any topics matching the pattern (which may include wildcards) are shared\&. The second parameter defines the direction that the messages will be shared in, so it is possible to import messages from a remote broker using +\fIin\fR, export messages to a remote broker using +\fIout\fR +or share messages in both directions\&. If this parameter is not defined, the default of +\fIout\fR +is used\&. The QoS level defines the publish/subscribe QoS level used for this topic and defaults to 0\&. +.sp +The +\fIlocal\-prefix\fR +and +\fIremote\-prefix\fR +options allow topics to be remapped when publishing to and receiving from remote brokers\&. This allows a topic tree from the local broker to be inserted into the topic tree of the remote broker at an appropriate place\&. +.sp +For incoming topics, the bridge will prepend the pattern with the remote prefix and subscribe to the resulting topic on the remote broker\&. When a matching incoming message is received, the remote prefix will be removed from the topic and then the local prefix added\&. +.sp +For outgoing topics, the bridge will prepend the pattern with the local prefix and subscribe to the resulting topic on the local broker\&. When an outgoing message is processed, the local prefix will be removed from the topic then the remote prefix added\&. +.sp +When using topic mapping, an empty prefix can be defined using the place marker +\fI""\fR\&. Using the empty marker for the topic itself is also valid\&. The table below defines what combination of empty or value is valid\&. The +\fBFull Local Topic\fR +and +\fBFull Remote Topic\fR +show the resulting topics that would be used on the local and remote ends of the bridge\&. For example, for the first table row if you publish to +\fBL/topic\fR +on the local broker, then the remote broker will receive a message on the topic +\fBR/topic\fR\&. +.TS +allbox tab(:); +lB lB lB lB lB lB. +T{ +\fIPattern\fR +T}:T{ +\fILocal Prefix\fR +T}:T{ +\fIRemote Prefix\fR +T}:T{ +\fIValidity\fR +T}:T{ +\fIFull Local Topic\fR +T}:T{ +\fIFull Remote Topic\fR +T} +.T& +l l l l l l +l l l l l l +l l l l l l +l l l l l l +l l l l l l +l l l l l l +l l l l l l +l l l l l l. +T{ +pattern +T}:T{ +L/ +T}:T{ +R/ +T}:T{ +valid +T}:T{ +L/pattern +T}:T{ +R/pattern +T} +T{ +pattern +T}:T{ +L/ +T}:T{ +"" +T}:T{ +valid +T}:T{ +L/pattern +T}:T{ +pattern +T} +T{ +pattern +T}:T{ +"" +T}:T{ +R/ +T}:T{ +valid +T}:T{ +pattern +T}:T{ +R/pattern +T} +T{ +pattern +T}:T{ +"" +T}:T{ +"" +T}:T{ +valid (no remapping) +T}:T{ +pattern +T}:T{ +pattern +T} +T{ +"" +T}:T{ +local +T}:T{ +remote +T}:T{ +valid (remap single local topic to remote) +T}:T{ +local +T}:T{ +remote +T} +T{ +"" +T}:T{ +local +T}:T{ +"" +T}:T{ +invalid +T}:T{ +\ \& +T}:T{ +\ \& +T} +T{ +"" +T}:T{ +"" +T}:T{ +remote +T}:T{ +invalid +T}:T{ +\ \& +T}:T{ +\ \& +T} +T{ +"" +T}:T{ +"" +T}:T{ +"" +T}:T{ +invalid +T}:T{ +\ \& +T}:T{ +\ \& +T} +.TE +.sp 1 +To remap an entire topic tree, use e\&.g\&.: +.sp +.if n \{\ +.RS 4 +.\} +.nf +topic # both 2 local/topic/ remote/topic/ +.fi +.if n \{\ +.RE +.\} +.sp +This option can be specified multiple times per bridge\&. +.sp +Care must be taken to ensure that loops are not created with this option\&. If you are experiencing high CPU load from a broker, it is possible that you have a loop where each broker is forever forwarding each other the same messages\&. +.sp +See also the +\fBcleansession\fR +option if you have messages arriving on unexpected topics when using incoming topics\&. +.PP +\fBExample\ \&Bridge Topic Remapping.\ \&\fR +The configuration below connects a bridge to the broker at +\fBtest\&.mosquitto\&.org\fR\&. It subscribes to the remote topic +\fB$SYS/broker/clients/total\fR +and republishes the messages received to the local topic +\fBtest/mosquitto/org/clients/total\fR +.sp +.if n \{\ +.RS 4 +.\} +.nf +connection test\-mosquitto\-org +address test\&.mosquitto\&.org +cleansession true +topic clients/total in 0 test/mosquitto/org $SYS/broker/ +.fi +.if n \{\ +.RE +.\} +.RE +.PP +\fBtry_private\fR [ true | false ] +.RS 4 +If try_private is set to +\fItrue\fR, the bridge will attempt to indicate to the remote broker that it is a bridge not an ordinary client\&. If successful, this means that loop detection will be more effective and that retained messages will be propagated correctly\&. Not all brokers support this feature so it may be necessary to set +\fBtry_private\fR +to +\fIfalse\fR +if your bridge does not connect properly\&. +.sp +Defaults to +\fItrue\fR\&. +.RE +.SS "SSL/TLS Support" +.PP +The following options are available for all bridges to configure SSL/TLS support\&. +.PP +\fBbridge_alpn\fR \fIalpn\fR +.RS 4 +Configure the application layer protocol negotiation option for the TLS session\&. Useful for brokers that support both websockets and MQTT on the same port\&. +.RE +.PP +\fBbridge_cafile\fR \fIfile path\fR +.RS 4 +One of +\fBbridge_cafile\fR +or +\fBbridge_capath\fR +must be provided to allow SSL/TLS support\&. +.sp +bridge_cafile is used to define the path to a file containing the PEM encoded CA certificates that have signed the certificate for the remote broker\&. +.RE +.PP +\fBbridge_capath\fR \fIfile path\fR +.RS 4 +One of +\fBbridge_capath\fR +or +\fBbridge_capath\fR +must be provided to allow SSL/TLS support\&. +.sp +bridge_capath is used to define the path to a directory containing the PEM encoded CA certificates that have signed the certificate for the remote broker\&. For bridge_capath to work correctly, the certificate files must have "\&.crt" as the file ending and you must run "openssl rehash <path to bridge_capath>" each time you add/remove a certificate\&. +.RE +.PP +\fBbridge_certfile\fR \fIfile path\fR +.RS 4 +Path to the PEM encoded client certificate for this bridge, if required by the remote broker\&. +.RE +.PP +\fBbridge_identity\fR \fIidentity\fR +.RS 4 +Pre\-shared\-key encryption provides an alternative to certificate based encryption\&. A bridge can be configured to use PSK with the +\fBbridge_identity\fR +and +\fBbridge_psk\fR +options\&. This is the client identity used with PSK encryption\&. Only one of certificate and PSK based encryption can be used on one bridge at once\&. +.RE +.PP +\fBbridge_insecure\fR [ true | false ] +.RS 4 +When using certificate based TLS, the bridge will attempt to verify the hostname provided in the remote certificate matches the host/address being connected to\&. This may cause problems in testing scenarios, so +\fBbridge_insecure\fR +may be set to +\fIfalse\fR +to disable the hostname verification\&. +.sp +Setting this option to +\fItrue\fR +means that a malicious third party could potentially inpersonate your server, so it should always be set to +\fIfalse\fR +in production environments\&. +.RE +.PP +\fBbridge_keyfile\fR \fIfile path\fR +.RS 4 +Path to the PEM encoded private key for this bridge, if required by the remote broker\&. +.RE +.PP +\fBbridge_psk\fR \fIkey\fR +.RS 4 +Pre\-shared\-key encryption provides an alternative to certificate based encryption\&. A bridge can be configured to use PSK with the +\fBbridge_identity\fR +and +\fBbridge_psk\fR +options\&. This is the pre\-shared\-key in hexadecimal format with no "0x"\&. Only one of certificate and PSK based encryption can be used on one bridge at once\&. +.RE +.PP +\fBbridge_require_ocsp\fR [ true | false ] +.RS 4 +When set to true, the bridge requires OCSP on the TLS connection it opens as client\&. +.RE +.PP +\fBbridge_tls_version\fR \fIversion\fR +.RS 4 +Configure the version of the TLS protocol to be used for this bridge\&. Possible values are +\fItlsv1\&.3\fR, +\fItlsv1\&.2\fR +and +\fItlsv1\&.1\fR\&. Defaults to +\fItlsv1\&.2\fR\&. The remote broker must support the same version of TLS for the connection to succeed\&. +.RE +.SH "FILES" +.PP +mosquitto\&.conf +.SH "BUGS" +.PP +\fBmosquitto\fR +bug information can be found at +\m[blue]\fB\%https://github.com/eclipse/mosquitto/issues\fR\m[] +.SH "SEE ALSO" +\fBmosquitto\fR(8), \fBmosquitto_passwd\fR(1), \fBmosquitto-tls\fR(7), \fBmqtt\fR(7), \fBlimits.conf\fR(5) +.SH "AUTHOR" +.PP +Roger Light +<roger@atchoo\&.org> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.conf.5.meta b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.conf.5.meta new file mode 100644 index 0000000..5356aff --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.conf.5.meta @@ -0,0 +1,5 @@ +.. title: mosquitto.conf man page +.. slug: mosquitto-conf-5 +.. category: man +.. type: man +.. pretty_url: False diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.conf.5.xml b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.conf.5.xml new file mode 100644 index 0000000..3a9bb7f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto.conf.5.xml @@ -0,0 +1,1890 @@ +<?xml version='1.0' encoding='UTF-8'?> +<?xml-stylesheet type="text/xsl" href="manpage.xsl"?> + +<refentry xml:id="mosquitto.conf" xmlns:xlink="http://www.w3.org/1999/xlink"> + <refmeta> + <refentrytitle>mosquitto.conf</refentrytitle> + <manvolnum>5</manvolnum> + <refmiscinfo class="source">Mosquitto Project</refmiscinfo> + <refmiscinfo class="manual">File formats and conventions</refmiscinfo> + </refmeta> + + <refnamediv> + <refname>mosquitto.conf</refname> + <refpurpose>the configuration file for mosquitto</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <cmdsynopsis> + <command>mosquitto.conf</command> + </cmdsynopsis> + </refsynopsisdiv> + + <refsect1> + <title>Description</title> + <para><command>mosquitto.conf</command> is the configuration file for + mosquitto. This file can reside anywhere as long as mosquitto can read + it. By default, mosquitto does not need a configuration file and will + use the default values listed below. See + <citerefentry><refentrytitle>mosquitto</refentrytitle><manvolnum>8</manvolnum></citerefentry> + for information on how to load a configuration file.</para> + </refsect1> + + <refsect1> + <title>File Format</title> + <para>All lines with a # as the very first character are treated as a + comment.</para> + <para>Configuration lines start with a variable name. The variable + value is separated from the name by a single space.</para> + </refsect1> + + <refsect1> + <title>Authentication</title> + <para>The authentication options described below allow a wide range of + possibilities in conjunction with the listener options. This + section aims to clarify the possibilities.</para> + <para>The simplest option is to have no authentication at all. This is + the default if no other options are given. Unauthenticated + encrypted support is provided by using the certificate based + SSL/TLS based options cafile/capath, certfile and keyfile.</para> + <para>MQTT provides username/password authentication as part of the + protocol. Use the password_file option to define the valid + usernames and passwords. Be sure to use network encryption if you + are using this option otherwise the username and password will be + vulnerable to interception. Use the + <option>per_listener_settings</option> to control whether passwords + are required globally or on a per-listener basis.</para> + <para>When using certificate based encryption there are three options + that affect authentication. The first is require_certificate, which + may be set to true or false. If false, the SSL/TLS component of the + client will verify the server but there is no requirement for the + client to provide anything for the server: authentication is + limited to the MQTT built in username/password. If + require_certificate is true, the client must provide a valid + certificate in order to connect successfully. In this case, the + second and third options, use_identity_as_username and + use_subject_as_username, become relevant. If set to true, + use_identity_as_username causes the Common Name (CN) from the + client certificate to be used instead of the MQTT username for + access control purposes. The password is not used because it is + assumed that only authenticated clients have valid certificates. + This means that any CA certificates you include in cafile or capath + will be able to issue client certificates that are valid for + connecting to your broker. If use_identity_as_username is false, + the client must authenticate as normal (if required by + password_file) through the MQTT options. The same principle applies + for the use_subject_as_username option, but the entire certificate + subject is used as the username instead of just the CN.</para> + <para>When using pre-shared-key based encryption through the psk_hint + and psk_file options, the client must provide a valid identity and + key in order to connect to the broker before any MQTT communication + takes place. If use_identity_as_username is true, the PSK identity + is used instead of the MQTT username for access control purposes. + If use_identity_as_username is false, the client may still + authenticate using the MQTT username/password if using the + password_file option.</para> + <para>Both certificate and PSK based encryption are configured on a + per-listener basis.</para> + <para>Authentication plugins can be created to augment the + password_file, acl_file and psk_file options with e.g. SQL based + lookups.</para> + <para>It is possible to support multiple authentication schemes at + once. A config could be created that had a listener for all of the + different encryption options described above and hence a large + number of ways of authenticating.</para> + </refsect1> + + <refsect1> + <title>General Options</title> + <variablelist> + <varlistentry> + <term><option>acl_file</option> <replaceable>file path</replaceable></term> + <listitem> + <para>Set the path to an access control list file. If + defined, the contents of the file are used to control + client access to topics on the broker.</para> + <para>If this parameter is defined then only the topics + listed will have access. Topic access is added with + lines of the format:</para> + + <para><code>topic [read|write|readwrite] <topic></code></para> + + <para>The access type is controlled using "read", "write" or + "readwrite". This parameter is optional (unless + <topic> includes a space character) - if not + given then the access is read/write. <topic> can + contain the + or # wildcards as in + subscriptions.</para> + + <para>The first set of topics are applied to anonymous + clients, assuming <option>allow_anonymous</option> is + true. User specific topic ACLs are added after a user + line as follows:</para> + + <para><code>user <username></code></para> + + <para>The username referred to here is the same as in + <option>password_file</option>. It is not the + clientid.</para> + + <para>It is also possible to define ACLs based on pattern + substitution within the topic. The form is the same as + for the topic keyword, but using pattern as the + keyword.</para> + <para><code>pattern [read|write|readwrite] <topic></code></para> + + <para>The patterns available for substition are:</para> + <itemizedlist mark="circle"> + <listitem><para>%c to match the client id of the client</para></listitem> + <listitem><para>%u to match the username of the client</para></listitem> + </itemizedlist> + <para>The substitution pattern must be the only text for + that level of hierarchy. Pattern ACLs apply to all + users even if the "user" keyword has previously been + given.</para> + + <para>Example:</para> + <para><code>pattern write sensor/%u/data</code></para> + <para>Allow access for bridge connection messages:</para> + <para><code>pattern write $SYS/broker/connection/%c/state</code></para> + + <para>If the first character of a line of the ACL file is a + # it is treated as a comment.</para> + + <para>Reloaded on reload signal. The currently loaded ACLs + will be freed and reloaded. Existing subscriptions will + be affected after the reload.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>allow_anonymous</option> [ true | false ]</term> + <listitem> + <para>Boolean value that determines whether clients that + connect without providing a username are allowed to + connect. If set to <replaceable>false</replaceable> + then another means of connection should be created to + control authenticated client access.</para> + <para>Defaults to <replaceable>true</replaceable> if no + other security options are set. If <option>password_file</option> + or <option>psk_file</option> is set, or if an + authentication plugin is loaded which implements + username/password or TLS-PSK checks, then + <option>allow_anonymous</option> defaults to + <replaceable>false</replaceable>.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>allow_duplicate_messages</option> [ true | false ]</term> + <listitem> + <para>If a client is subscribed to multiple subscriptions + that overlap, e.g. foo/# and foo/+/baz , then MQTT + expects that when the broker receives a message on a + topic that matches both subscriptions, such as + foo/bar/baz, then the client should only receive the + message once.</para> + <para>Mosquitto keeps track of which clients a message has + been sent to in order to meet this requirement. This + option allows this behaviour to be disabled, which may + be useful if you have a large number of clients + subscribed to the same set of topics and want to + minimise memory usage.</para> + <para>It can be safely set to + <replaceable>true</replaceable> if you know in advance + that your clients will never have overlapping + subscriptions, otherwise your clients must be able to + correctly deal with duplicate messages even when then + have QoS=2.</para> + <para>Defaults to <replaceable>true</replaceable>.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>allow_zero_length_clientid</option> [ true | false ]</term> + <listitem> + <para>MQTT 3.1.1 allows clients to connect with a zero + length client id and have the broker generate a client + id for them. Use this option to allow/disallow this + behaviour. Defaults to true.</para> + <para>See also the <option>auto_id_prefix</option> option.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>auth_opt_*</option> <replaceable>value</replaceable></term> + <listitem> + <para>Options to be passed to the auth plugin. See the + specific plugin instructions. </para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>auth_plugin</option> <replaceable>file path</replaceable></term> + <listitem> + <para>Specify an external module to use for authentication + and access control. This allows custom + username/password and access control functions to be + created.</para> + <para>Can be specified multiple times to load multiple + plugins. The plugins will be processed in the order + that they are specified.</para> + <para>If <option>password_file</option>, or + <option>acl_file</option> are used in the config file + alongsize <option>auth_plugin</option>, the plugin + checks will run after the built in checks.</para> + <para>Not currently reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>auth_plugin_deny_special_chars</option> [ true | false ]</term> + <listitem> + <para>If <replaceable>true</replaceable> then before an ACL + check is made, the username/client id of the client + needing the check is searched for the presence of + either a '+' or '#' character. If either of these + characters is found in either the username or client + id, then the ACL check is denied before it is sent to + the plugin.</para> + <para>This check prevents the case where a malicious user + could circumvent an ACL check by using one of these + characters as their username or client id. This is the + same issue as was reported with mosquitto itself as + CVE-2017-7650.</para> + <para>If you are entirely sure that the plugin you are + using is not vulnerable to this attack (i.e. if you + never use usernames or client ids in topics) then you + can disable this extra check and hence have all ACL + checks delivered to your plugin by setting this option + to <replaceable>false</replaceable>.</para> + <para>Defaults to <replaceable>true</replaceable>.</para> + <para>Not currently reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>auto_id_prefix</option> <replaceable>prefix</replaceable></term> + <listitem> + <para>If <option>allow_zero_length_clientid</option> is + <replaceable>true</replaceable>, this option allows you + to set a string that will be prefixed to the + automatically generated client ids to aid visibility in + logs. Defaults to <option>auto-</option>.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>autosave_interval</option> <replaceable>seconds</replaceable></term> + <listitem> + <para>The number of seconds that mosquitto will wait + between each time it saves the in-memory database to + disk. If set to 0, the in-memory database will only be + saved when mosquitto exits or when receiving the + SIGUSR1 signal. Note that this setting only has an + effect if persistence is enabled. Defaults to 1800 + seconds (30 minutes).</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>autosave_on_changes</option> [ true | false ]</term> + <listitem> + <para>If <replaceable>true</replaceable>, mosquitto will + count the number of subscription changes, retained + messages received and queued messages and if the total + exceeds <option>autosave_interval</option> then the + in-memory database will be saved to disk. If + <replaceable>false</replaceable>, mosquitto will save + the in-memory database to disk by treating + <option>autosave_interval</option> as a time in + seconds.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>check_retain_source</option> [ true | false ]</term> + <listitem> + <para>This option affects the scenario when a client + subscribes to a topic that has retained messages. It is + possible that the client that published the retained + message to the topic had access at the time they + published, but that access has been subsequently + removed. If <option>check_retain_source</option> is set + to true, the default, the source of a retained message + will be checked for access rights before it is + republished. When set to false, no check will be made + and the retained message will always be + published.</para> + <para>This option applies globally, regardless of the + <option>per_listener_settings</option> option.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>clientid_prefixes</option> <replaceable>prefix</replaceable></term> + <listitem> + <para>If defined, only clients that have a clientid with a + prefix that matches clientid_prefixes will be allowed + to connect to the broker. For example, setting + "secure-" here would mean a client "secure-client" + could connect but another with clientid "mqtt" + couldn't. By default, all client ids are valid.</para> + <para>Reloaded on reload signal. Note that currently + connected clients will be unaffected by any + changes.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>connection_messages</option> [ true | false ]</term> + <listitem> + <para>If set to <replaceable>true</replaceable>, the log + will include entries when clients connect and + disconnect. If set to <replaceable>false</replaceable>, + these entries will not appear.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>include_dir</option> <replaceable>dir</replaceable></term> + <listitem> + <para>External configuration files may be included by using + the include_dir option. This defines a directory that + will be searched for config files. All files that end + in '.conf' will be loaded as a configuration file. It + is best to have this as the last option in the main + file. This option will only be processed from the main + configuration file. The directory specified must not + contain the main configuration file.</para> + <para>The configuration files in + <option>include_dir</option> are loaded in case + sensitive alphabetical order, with the upper case of + each letter ordered before the lower case of the same + letter.</para> + <example title="Load Order for include_dir" label="Load Order for include_dir"> + <para>Given the files + <replaceable>b.conf</replaceable>, + <replaceable>A.conf</replaceable>, + <replaceable>01.conf</replaceable>, + <replaceable>a.conf</replaceable>, + <replaceable>B.conf</replaceable>, and + <replaceable>00.conf</replaceable> inside + <option>include_dir</option>, the config files + would be loaded in this order:</para> + <programlisting language="config"> +00.conf +01.conf +A.conf +a.conf +B.conf +b.conf +</programlisting></example> + <para>If this option is used multiple times, then each + <option>include_dir</option> option is processed + completely in the order that they are written in the + main configuration file.</para> + <example title="Load Order for Multiple include_dir" label="Load Order for Multiple include_dir"> + <para>Assuming a directory + <replaceable>one.d</replaceable> containing + files <replaceable>B.conf</replaceable> and + <replaceable>C.conf</replaceable>, and a second + directory <replaceable>two.d</replaceable> + containing files + <replaceable>A.conf</replaceable> and + <replaceable>D.conf</replaceable>, and a + config:</para> + <programlisting language="config"> +include_dir one.d +include_dir two.d +</programlisting><para>Then the config files would be loaded in this order:</para> + <programlisting language="config"> +# files from one.d +B.conf +C.conf +# files from two.d +A.conf +D.conf +</programlisting></example> + </listitem> + </varlistentry> + <varlistentry> + <term><option>log_dest</option> <replaceable>destinations</replaceable></term> + <listitem> + <para>Send log messages to a particular destination. + Possible destinations are: <option>stdout</option> + <option>stderr</option> <option>syslog</option> + <option>topic</option>.</para> + <para><option>stdout</option> and + <option>stderr</option> log to the console on the + named output.</para> + <para><option>syslog</option> uses the userspace syslog + facility which usually ends up in /var/log/messages or + similar and topic logs to the broker topic + '$SYS/broker/log/<severity>', where severity is + one of D, E, W, N, I, M which are debug, error, + warning, notice, information and message. Message type + severity is used by the subscribe and unsubscribe + log_type options and publishes log messages at + $SYS/broker/log/M/subscribe and + $SYS/broker/log/M/unsubscribe.</para> + <para>The <option>file</option> destination requires an + additional parameter which is the file to be logged to, + e.g. "log_dest file /var/log/mosquitto.log". The file + will be closed and reopened when the broker receives a + HUP signal. Only a single file destination may be + configured.</para> + <para>Use "log_dest none" if you wish to disable logging. + Defaults to stderr. This option may be specified + multiple times.</para> + <para>Note that if the broker is running as a Windows + service it will default to "log_dest none" and neither + stdout nor stderr logging is available.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>log_facility</option> <replaceable>local facility</replaceable></term> + <listitem> + <para>If using syslog logging (not on Windows), messages + will be logged to the "daemon" facility by default. Use + the <option>log_facility</option> option to choose + which of local0 to local7 to log to instead. The option + value should be an integer value, e.g. "log_facility 5" + to use local5.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>log_timestamp</option> [ true | false ]</term> + <listitem> + <para>Boolean value, if set to + <replaceable>true</replaceable> a timestamp value will + be added to each log entry. The default is + <replaceable>true</replaceable>.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>log_timestamp_format</option> <replaceable>format</replaceable></term> + <listitem> + <para>Set the format of the log timestamp. If left unset, + this is the number of seconds since the Unix epoch. + This option is a free text string which will be passed + to the strftime function as the format specifier. To + get an ISO 8601 datetime, for example:</para> + <programlisting language="config"> +log_timestamp_format %Y-%m-%dT%H:%M:%S + </programlisting> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>log_type</option> <replaceable>types</replaceable></term> + <listitem> + <para>Choose types of messages to log. Possible types are: + <replaceable>debug</replaceable>, + <replaceable>error</replaceable>, + <replaceable>warning</replaceable>, + <replaceable>notice</replaceable>, + <replaceable>information</replaceable>, + <replaceable>subscribe</replaceable>, + <replaceable>unsubscribe</replaceable>, + <replaceable>websockets</replaceable>, + <replaceable>none</replaceable>, + <replaceable>all</replaceable>.</para> + <para>Defaults to <replaceable>error</replaceable>, + <replaceable>warning</replaceable>, <replaceable>notice + </replaceable>and + <replaceable>information</replaceable>. This option + may be specified multiple times. Note that the + <replaceable>debug </replaceable>type (used for + decoding incoming/outgoing network packets) is never + logged in topics.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>max_inflight_bytes</option> <replaceable>count</replaceable></term> + <listitem> + <para>QoS 1 and 2 messages will be allowed in flight until this byte + limit is reached. Defaults to 0. (No limit) + See also the <option>max_inflight_messages</option> option. + </para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>max_inflight_messages</option> <replaceable>count</replaceable></term> + <listitem> + <para>The maximum number of QoS 1 or 2 messages that can be + in the process of being transmitted simultaneously. + This includes messages currently going through + handshakes and messages that are being retried. + Defaults to 20. Set to 0 for no maximum. If set to 1, + this will guarantee in-order delivery of + messages.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>max_keepalive</option> <replaceable>value</replaceable></term> + <listitem> + <para>For MQTT v5 clients, it is possible to have the + server send a "server keepalive" value that will + override the keepalive value set by the client. This + is intended to be used as a mechanism to say that the + server will disconnect the client earlier than it + anticipated, and that the client should use the new + keepalive value. The max_keepalive option allows you to + specify that clients may only connect with keepalive + less than or equal to this value, otherwise they will + be sent a server keepalive telling them to use + max_keepalive. This only applies to MQTT v5 clients. + The maximum value allowable, and default value, is + 65535. Do not set below 10 seconds.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>max_packet_size</option> <replaceable>value</replaceable></term> + <listitem> + <para>For MQTT v5 clients, it is possible to have the + server send a "maximum packet size" value that will + instruct the client it will not accept MQTT packets + with size greater than <option>value</option> bytes. + This applies to the full MQTT packet, not just the + payload. Setting this option to a positive value will + set the maximum packet size to that number of bytes. If + a client sends a packet which is larger than this + value, it will be disconnected. This applies to all + clients regardless of the protocol version they are + using, but v3.1.1 and earlier clients will of course + not have received the maximum packet size information. + Defaults to no limit.</para> + <para>Setting below 20 bytes is forbidden because it is + likely to interfere with normal client operation even + with small payloads.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>max_queued_bytes</option> <replaceable>count</replaceable></term> + <listitem> + <para>QoS 1 and 2 messages above those currently in-flight will be + queued (per client) until this limit is exceeded. + Defaults to 0. (No maximum) See also the + <option>max_queued_messages</option> option. + If both max_queued_messages and max_queued_bytes are specified, + packets will be queued until the first limit is reached. + </para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>max_queued_messages</option> <replaceable>count</replaceable></term> + <listitem> + <para>The maximum number of QoS 1 or 2 messages to hold in the + queue (per client) above those messages that are currently + in flight. Defaults to 100. Set to 0 for no maximum (not + recommended). See also the + <option>queue_qos0_messages</option> and + <option>max_queued_bytes</option> options. + </para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>memory_limit</option> <replaceable>limit</replaceable></term> + <listitem> + <para> + This option sets the maximum number of heap memory bytes that the broker + will allocate, and hence sets a hard limit on memory use by the broker. + Memory requests that exceed this value will be denied. The effect will + vary depending on what has been denied. If an incoming message is being + processed, then the message will be dropped and the publishing client + will be disconnected. If an outgoing message is being sent, then the + individual message will be dropped and the receiving client will be + disconnected. Defaults to no limit.</para> + <para>This option is only available if memory tracking support is compiled + in.</para> + <para>Reloaded on reload signal. Setting to a lower value and reloading will + not result in memory being freed.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>message_size_limit</option> <replaceable>limit</replaceable></term> + <listitem> + <para>This option sets the maximum publish payload size + that the broker will allow. Received messages that + exceed this size will not be accepted by the broker. + The default value is 0, which means that all valid MQTT + messages are accepted. MQTT imposes a maximum payload + size of 268435455 bytes.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>password_file</option> <replaceable>file path</replaceable></term> + <listitem> + <para>Set the path to a password file. If defined, the + contents of the file are used to control client access + to the broker. The file can be created using the + <citerefentry><refentrytitle>mosquitto_passwd</refentrytitle><manvolnum>1</manvolnum></citerefentry> + utility. If mosquitto is compiled without TLS support + (it is recommended that TLS support is included), then + the password file should be a text file with each line + in the format "username:password", where the colon and + password are optional but recommended. If + <option>allow_anonymous</option> is set to + <replaceable>false</replaceable>, only users defined in + this file will be able to connect. Setting + <option>allow_anonymous</option> to + <replaceable>true</replaceable> when + <replaceable>password_file</replaceable>is defined is + valid and could be used with acl_file to have e.g. read + only guest/anonymous accounts and defined users that + can publish.</para> + <para>Reloaded on reload signal. The currently loaded + username and password data will be freed and reloaded. + Clients that are already connected will not be + affected.</para> + <para>See also + <citerefentry><refentrytitle>mosquitto_passwd</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>per_listener_settings</option> [ true | false ]</term> + <listitem> + <para>If <replaceable>true</replaceable>, then + authentication and access control settings will be + controlled on a per-listener basis. The following + options are affected:</para> + <para><option>password_file</option>, + <option>acl_file</option>, <option>psk_file</option>, + <option>allow_anonymous</option>, + <option>allow_zero_length_clientid</option>, + <option>auth_plugin</option>, + <option>auth_opt_*</option>, + <option>auto_id_prefix</option>.</para> + <para>Note that if set to true, then a durable client (i.e. + with clean session set to false) that has disconnected + will use the ACL settings defined for the listener that + it was most recently connected to.</para> + <para>The default behaviour is for this to be set to + <replaceable>false</replaceable>, which maintains the + settings behaviour from previous versions of + mosquitto.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>persistence</option> [ true | false ]</term> + <listitem> + <para>If <replaceable>true</replaceable>, connection, + subscription and message data will be written to the + disk in mosquitto.db at the location dictated by + persistence_location. When mosquitto is restarted, it + will reload the information stored in mosquitto.db. The + data will be written to disk when mosquitto closes and + also at periodic intervals as defined by + autosave_interval. Writing of the persistence database + may also be forced by sending mosquitto the SIGUSR1 + signal. If <replaceable>false</replaceable>, the data + will be stored in memory only. Defaults to + <replaceable>false</replaceable>.</para> + <para>The persistence file may change its format in a new + version. The broker can currently read all old formats, + but will only save in the latest format. It should always + be safe to upgrade, but cautious users may wish to take a + copy of the persistence file before installing a new + version so that they can roll back to an earlier version + if necessary.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>persistence_file</option> <replaceable>file name</replaceable></term> + <listitem> + <para>The filename to use for the persistent database. + Defaults to mosquitto.db.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>persistence_location</option> <replaceable>path</replaceable></term> + <listitem> + <para>The path where the persistence database should be + stored. Must end in a trailing slash. If not given, + then the current directory is used.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>persistent_client_expiration</option> <replaceable>duration</replaceable></term> + <listitem> + <para>This option allows persistent clients (those with + clean session set to false) to be removed if they do + not reconnect within a certain time frame. This is a + non-standard option. As far as the MQTT spec is + concerned, persistent clients persist forever.</para> + <para>Badly designed clients may set clean session to false + whilst using a randomly generated client id. This leads + to persistent clients that will never reconnect. This + option allows these clients to be removed.</para> + <para>The expiration period should be an integer followed + by one of h d w m y for hour, day, week, month and year + respectively. For example:</para> + <itemizedlist mark="circle"> + <listitem><para>persistent_client_expiration 2m</para></listitem> + <listitem><para>persistent_client_expiration 14d</para></listitem> + <listitem><para>persistent_client_expiration 1y</para></listitem> + </itemizedlist> + <para>As this is a non-standard option, the default if not + set is to never expire persistent clients.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>pid_file</option> <replaceable>file path</replaceable></term> + <listitem> + <para>Write a pid file to the file specified. If not given + (the default), no pid file will be written. If the pid + file cannot be written, mosquitto will exit. This + option only has an effect is mosquitto is run in daemon + mode.</para> + <para>If mosquitto is being automatically started by an + init script it will usually be required to write a pid + file. This should then be configured as e.g. + /var/run/mosquitto.pid</para> + <para>Not reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>psk_file</option> <replaceable>file path</replaceable></term> + <listitem> + <para>Set the path to a pre-shared-key file. This option + requires a listener to be have PSK support enabled. If + defined, the contents of the file are used to control + client access to the broker. Each line should be in the + format "identity:key", where the key is a hexadecimal + string with no leading "0x". A client connecting to a + listener that has PSK support enabled must provide a + matching identity and PSK to allow the encrypted + connection to proceed.</para> + <para>Reloaded on reload signal. The currently loaded + identity and key data will be freed and reloaded. + Clients that are already connected will not be + affected.</para> + </listitem> </varlistentry> + <varlistentry> + <term><option>queue_qos0_messages</option> [ true | false ]</term> + <listitem> + <para>Set to <replaceable>true</replaceable> to queue + messages with QoS 0 when a persistent client is + disconnected. These messages are included in the limit + imposed by max_queued_messages. Defaults to + <replaceable>false</replaceable>.</para> + <para>Note that the MQTT v3.1.1 spec states that only QoS 1 + and 2 messages should be saved in this situation so + this is a non-standard option.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>retain_available</option> [ true | false ]</term> + <listitem> + <para>If set to false, then retained messages are not + supported. Clients that send a message with the retain + bit will be disconnected if this option is set to + false. Defaults to true.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>retained_persistence</option> [ true | false ]</term> + <listitem> + <para>This is a synonym of the <option>persistence</option> + option.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>set_tcp_nodelay</option> [ true | false ]</term> + <listitem> + <para>If set to true, the TCP_NODELAY option will be set on + client sockets to disable Nagle's algorithm. This + has the effect of reducing latency of some messages + at potentially increasing the number of TCP packets + being sent. Defaults to false.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>sys_interval</option> <replaceable>seconds</replaceable></term> + <listitem> + <para>The integer number of seconds between updates of the + $SYS subscription hierarchy, which provides status + information about the broker. If unset, defaults to 10 + seconds.</para> + <para>Set to 0 to disable publishing the $SYS hierarchy + completely.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>upgrade_outgoing_qos</option> [ true | false ]</term> + <listitem> + <para>The MQTT specification requires that the QoS of a + message delivered to a subscriber is never upgraded to + match the QoS of the subscription. Enabling this option + changes this behaviour. If + <option>upgrade_outgoing_qos</option> is set + <replaceable>true</replaceable>, messages sent to a + subscriber will always match the QoS of its + subscription. This is a non-standard option not + provided for by the spec. Defaults to + <replaceable>false</replaceable>.</para> + <para>Reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>user</option> <replaceable>username</replaceable></term> + <listitem> + <para>When run as root, change to this user and its primary + group on startup. If mosquitto is unable to change to + this user and group, it will exit with an error. The + user specified must have read/write access to the + persistence database if it is to be written. If run as + a non-root user, this setting has no effect. Defaults + to mosquitto.</para> + <para>This setting has no effect on Windows and so you + should run mosquitto as the user you wish it to run + as.</para> + <para>Not reloaded on reload signal.</para> + </listitem> + </varlistentry> + </variablelist> + </refsect1> + + <refsect1> + <title>Listeners</title> + <para>The network ports that mosquitto listens on can be controlled + using listeners. The default listener options can be overridden and + further listeners can be created.</para> + <refsect2> + <title>General Options</title> + <variablelist> + <varlistentry> + <term><option>bind_address</option> <replaceable>address</replaceable></term> + <listitem> + <para>Listen for incoming network connections on the + specified IP address/hostname only. This is useful + to restrict access to certain network interfaces. + To restrict access to mosquitto to the local host + only, use "bind_address localhost". This only + applies to the default listener. Use the listener + variable to control other listeners.</para> + <para>Not reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>bind_interface</option> <replaceable>device</replaceable></term> + <listitem> + <para>Listen for incoming network connections only on + the specified interface. This is similar to the + <option>bind_address</option> option but is useful + when an interface has multiple addresses or the + address may change.</para> + <para>It is valid to use this option together with + <option>bind_address</option> for the default + listener, or the <replaceable>bind + address/host</replaceable> part of the + <option>listener</option> definition. Care should + be taken to ensure that the address being bound to + is on the interface being bound to. If you set the + <option>bind_interface</option> to be + <replaceable>eth0</replaceable>, and + <option>bind_address</option> to + <replaceable>127.0.0.1</replaceable>, then the + broker will start correctly but you will be unable + to connect.</para> + <para>This option is currently only available on + Linux, and requires elevated privileges.</para> + <para>Not reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>http_dir</option> <replaceable>directory</replaceable></term> + <listitem> + <para>When a listener is using the websockets protocol, + it is possible to serve http data as well. Set + <option>http_dir</option> to a directory which + contains the files you wish to serve. If this + option is not specified, then no normal http + connections will be possible.</para> + <para>Not reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>listener</option> <replaceable>port</replaceable> <replaceable><optional>bind address/host</optional></replaceable></term> + <listitem> + <para>Listen for incoming network connection on the + specified port. A second optional argument allows + the listener to be bound to a specific ip + address/hostname. If this variable is used and + neither the global <option>bind_address</option> + nor <option>port</option> options are used then the + default listener will not be started.</para> + <para>The <option>bind address/host</option> option + allows this listener to be bound to a specific IP + address by passing an IP address or hostname. For + websockets listeners, it is only possible to pass + an IP address here.</para> + <para>This option may be specified multiple times. See + also the <option>mount_point</option> + option.</para> + <para>Not reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>max_connections</option> <replaceable>count</replaceable></term> + <listitem> + <para>Limit the total number of clients connected for + the current listener. Set to <literal>-1</literal> + to have "unlimited" connections. Note that other + limits may be imposed that are outside the control + of mosquitto. See e.g. + <citerefentry><refentrytitle>limits.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para> + <para>Not reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>maximum_qos</option> <replaceable>count</replaceable></term> + <listitem> + <para>Limit the QoS value allowed when using this + listener. Defaults to 2, which means any QoS can be + used. Set to 0 or 1 to limit to those QoS values. + This makes use of an MQTT v5 feature to notify + clients of the limitation. MQTT v3.1.1 clients will + not be aware of the limitation. Clients publshing + to this listener with a too-high QoS will be + disconnected.</para> + <para>Not reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>max_topic_alias</option> <replaceable>number</replaceable></term> + <listitem> + <para>This option sets the maximum number topic aliases + that an MQTT v5 client is allowed to create. It + applies per listener. Defaults to 10. Set to 0 to + disallow topic aliases.</para> + <para>Not reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>mount_point</option> <replaceable>topic prefix</replaceable></term> + <listitem> + <para>This option is used with the listener option to + isolate groups of clients. When a client connects + to a listener which uses this option, the string + argument is attached to the start of all topics for + this client. This prefix is removed when any + messages are sent to the client. This means a + client connected to a listener with mount point + <replaceable>example</replaceable> can only see + messages that are published in the topic hierarchy + <replaceable>example</replaceable> and below.</para> + <para>Not reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>port</option> <replaceable>port number</replaceable></term> + <listitem> + <para>Set the network port for the default listener to + listen on. Defaults to 1883.</para> + <para>Not reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>protocol</option> <replaceable>value</replaceable></term> + <listitem> + <para>Set the protocol to accept for this listener. Can + be <option>mqtt</option>, the default, or + <option>websockets</option> if available.</para> + <para>Websockets support is currently disabled by + default at compile time. Certificate based TLS may be used + with websockets, except that only the + <option>cafile</option>, <option>certfile</option>, + <option>keyfile</option> and + <option>ciphers</option> options are + supported.</para> + <para>Not reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>socket_domain</option> [ ipv4 | ipv6 ]</term> + <listitem> + <para>By default, a listener will attempt to listen on + all supported IP protocol versions. If you do not + have an IPv4 or IPv6 interface you may wish to + disable support for either of those protocol + versions. In particular, note that due to the + limitations of the websockets library, it will only + ever attempt to open IPv6 sockets if IPv6 support + is compiled in, and so will fail if IPv6 is not + available.</para> + <para>Set to <option>ipv4</option> to force the + listener to only use IPv4, or set to + <option>ipv6</option> to force the listener to only + use IPv6. If you want support for both IPv4 and + IPv6, then do not use the + <option>socket_domain</option> option.</para> + <para>Not reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>use_username_as_clientid</option> [ true | false ]</term> + <listitem> + <para>Set <option>use_username_as_clientid</option> to + true to replace the clientid that a client + connected with with its username. This allows + authentication to be tied to the clientid, which + means that it is possible to prevent one client + disconnecting another by using the same + clientid. Defaults to false.</para> + <para>If a client connects with no username it will be + disconnected as not authorised when this option is + set to true. Do not use in conjunction with + <option>clientid_prefixes</option>.</para> + <para>See also + <option>use_identity_as_username</option>.</para> + <para>Not reloaded on reload signal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>websockets_log_level</option> <replaceable>level</replaceable></term> + <listitem> + <para>Change the websockets logging level. This is a + global option, it is not possible to set per + listener. This is an integer that is interpreted by + libwebsockets as a bit mask for its lws_log_levels + enum. See the libwebsockets documentation for more + details.</para> + <para>To use this option, <option>log_type + websockets</option> must also be enabled. + Defaults to 0.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>websockets_headers_size</option> <replaceable>size</replaceable></term> + <listitem> + <para>Change the websockets headers size. This is a + global option, it is not possible to set per + listener. This option sets the size of the buffer + used in the libwebsockets library when reading HTTP + headers. If you are passing large header data such + as cookies then you may need to increase this + value. If left unset, or set to 0, then the default + of 1024 bytes will be used.</para> + </listitem> + </varlistentry> + </variablelist> + </refsect2> + <refsect2> + <title>Certificate based SSL/TLS Support</title> + <para>The following options are available for all listeners to + configure certificate based SSL support. See also + "Pre-shared-key based SSL/TLS support".</para> + <variablelist> + <varlistentry> + <term><option>cafile</option> <replaceable>file path</replaceable></term> + <listitem> + <para>At least one of <option>cafile</option> or + <option>capath</option> must be provided to allow + SSL support.</para> + <para><option>cafile</option> is used to define the + path to a file containing the PEM encoded CA + certificates that are trusted.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>capath</option> <replaceable>directory path</replaceable></term> + <listitem> + <para>At least one of <option>cafile</option> or + <option>capath</option> must be provided to allow + SSL support.</para> + <para><option>capath</option> is used to define a + directory that contains PEM encoded CA certificates + that are trusted. For <option>capath</option> to + work correctly, the certificates files must have + ".pem" as the file ending and you must run + "openssl rehash <path to capath>" each time you + add/remove a certificate.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>certfile</option> <replaceable>file path</replaceable></term> + <listitem> + <para>Path to the PEM encoded server certificate.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>ciphers</option> <replaceable>cipher:list</replaceable></term> + <listitem> + <para>The list of allowed ciphers, each separated with + a colon. Available ciphers can be obtained using + the "openssl ciphers" command.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>crlfile</option> <replaceable>file path</replaceable></term> + <listitem> + <para>If you have <option>require_certificate</option> + set to <replaceable>true</replaceable>, you can + create a certificate revocation list file to revoke + access to particular client certificates. If you + have done this, use crlfile to point to the PEM + encoded revocation file.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>dhparamfile</option> <replaceable>file path</replaceable></term> + <listitem> + <para>To allow the use of ephemeral DH key exchange, + which provides forward security, the listener must + load DH parameters. This can be specified with the + dhparamfile option. The dhparamfile can be + generated with the command e.g.</para> + <programlisting> +openssl dhparam -out dhparam.pem 2048</programlisting> + </listitem> + </varlistentry> + <varlistentry> + <term><option>keyfile</option> <replaceable>file path</replaceable></term> + <listitem> + <para>Path to the PEM encoded keyfile.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>require_certificate</option> [ true | false ]</term> + <listitem> + <para>By default an SSL/TLS enabled listener will + operate in a similar fashion to a https enabled web + server, in that the server has a certificate signed + by a CA and the client will verify that it is a + trusted certificate. The overall aim is encryption + of the network traffic. By setting + <option>require_certificate</option> to + <replaceable>true</replaceable>, the client must + provide a valid certificate in order for the + network connection to proceed. This allows access + to the broker to be controlled outside of the + mechanisms provided by MQTT.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>tls_engine</option> <replaceable>engine</replaceable></term> + <listitem> + <para>A valid openssl engine id. These can be listed with + openssl engine command.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>tls_engine_kpass_sha1</option> <replaceable>engine_kpass_sha1</replaceable></term> + <listitem> + <para>SHA1 of the private key password when using an + TLS engine. Some TLS engines such as the TPM + engine may require the use of a password in order + to be accessed. This option allows a hex encoded + SHA1 hash of the password to the engine directly, + instead of the user being prompted for the + password.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>tls_keyform</option> [ pem | engine ]</term> + <listitem> + <para>Specifies the type of private key in use when + making TLS connections.. This can be "pem" or + "engine". This parameter is useful when a TPM + module is being used and the private key has been + created with it. Defaults to "pem", which means + normal private key files are used.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>tls_version</option> <replaceable>version</replaceable></term> + <listitem> + <para>Configure the version of the TLS protocol to be + used for this listener. Possible values are + <replaceable>tlsv1.3</replaceable>, + <replaceable>tlsv1.2</replaceable> and + <replaceable>tlsv1.1</replaceable>. If left unset, + the default of allowing all of TLS v1.3, v1.2 and + v1.1 is used.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>use_identity_as_username</option> [ true | false ]</term> + <listitem> + <para>If <option>require_certificate</option> is + <replaceable>true</replaceable>, you may set + <option>use_identity_as_username</option> to + <replaceable>true</replaceable> to use the CN value + from the client certificate as a username. If this + is <replaceable>true</replaceable>, the + <option>password_file</option> option will not be + used for this listener.</para> + <para>This takes priority over + <option>use_subject_as_username</option> if both + are set to <replaceable>true</replaceable>.</para> + <para>See also + <option>use_subject_as_username</option></para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>use_subject_as_username</option> [ true | false ]</term> + <listitem> + <para>If <option>require_certificate</option> is + <replaceable>true</replaceable>, you may set + <option>use_subject_as_username</option> to + <replaceable>true</replaceable> to use the complete subject value + from the client certificate as a username. If this + is <replaceable>true</replaceable>, the + <option>password_file</option> option will not be + used for this listener.</para> + <para>The subject will be generated in a form similar + to <option>CN=test client,OU=Production,O=Server,L=Nottingham,ST=Nottinghamshire,C=GB</option>.</para> + <para>See also + <option>use_identity_as_username</option></para> + </listitem> + </varlistentry> + </variablelist> + </refsect2> + <refsect2> + <title>Pre-shared-key based SSL/TLS Support</title> + <para>The following options are available for all listeners to + configure pre-shared-key based SSL support. See also + "Certificate based SSL/TLS support".</para> + <variablelist> + <varlistentry> + <term><option>ciphers</option> <replaceable>cipher:list</replaceable></term> + <listitem> + <para>When using PSK, the encryption ciphers used will + be chosen from the list of available PSK ciphers. + If you want to control which ciphers are available, + use this option. The list of available ciphers can + be optained using the "openssl ciphers" command and + should be provided in the same format as the output + of that command.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>psk_hint</option> <replaceable>hint</replaceable></term> + <listitem> + <para>The <option>psk_hint</option> option enables + pre-shared-key support for this listener and also + acts as an identifier for this listener. The hint + is sent to clients and may be used locally to aid + authentication. The hint is a free form string that + doesn't have much meaning in itself, so feel free + to be creative.</para> + <para>If this option is provided, see + <option>psk_file</option> to define the pre-shared + keys to be used or create a security plugin to + handle them.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>tls_version</option> <replaceable>version</replaceable></term> + <listitem> + <para>Configure the version of the TLS protocol to be + used for this listener. Possible values are + <replaceable>tlsv1.3</replaceable>, + <replaceable>tlsv1.2</replaceable> and + <replaceable>tlsv1.1</replaceable>. If left unset, + the default of allowing all of TLS v1.3, v1.2 and + v1.1 is used.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>use_identity_as_username</option> [ true | false ]</term> + <listitem> + <para>Set <option>use_identity_as_username</option> to + have the psk identity sent by the client used as + its username. The username will be checked as + normal, so <option>password_file</option> or + another means of authentication checking must be + used. No password will be used.</para> + </listitem> + </varlistentry> + </variablelist> + </refsect2> + </refsect1> + + <refsect1> + <title>Configuring Bridges</title> + <para>Multiple bridges (connections to other brokers) can be configured + using the following variables.</para> + <para>Bridges cannot currently be reloaded on reload signal.</para> + <variablelist> + <varlistentry> + <term><option>address</option> <replaceable>address[:port]</replaceable> <replaceable>[address[:port]]</replaceable></term> + <term><option>addresses</option> <replaceable>address[:port]</replaceable> <replaceable>[address[:port]]</replaceable></term> + <listitem> + <para>Specify the address and optionally the port of the + bridge to connect to. This must be given for each + bridge connection. If the port is not specified, the + default of 1883 is used.</para> + <para>If you use an IPv6 address, then the port is not + optional.</para> + <para>Multiple host addresses can be specified on the + address config. See the <option>round_robin</option> + option for more details on the behaviour of bridges + with multiple addresses.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>bridge_attempt_unsubscribe</option> [ true | false ]</term> + <listitem> + <para>If a bridge has topics that have "out" direction, the + default behaviour is to send an unsubscribe request to + the remote broker on that topic. This means that + changing a topic direction from "in" to "out" will not + keep receiving incoming messages. Sending these + unsubscribe requests is not always desirable, setting + <option>bridge_attempt_unsubscribe</option> to + <replaceable>false</replaceable> will disable sending + the unsubscribe request. Defaults to + <replaceable>true</replaceable>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>bridge_protocol_version</option> <replaceable>version</replaceable></term> + <listitem> + <para>Set the version of the MQTT protocol to use with for + this bridge. Can be one of + <replaceable>mqttv31</replaceable> or + <replaceable>mqttv311</replaceable>. Defaults to + <replaceable>mqttv31</replaceable>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>cleansession</option> [ true | false ]</term> + <listitem> + <para>Set the clean session option for this bridge. Setting + to <replaceable>false</replaceable> (the default), + means that all subscriptions on the remote broker are + kept in case of the network connection dropping. If set + to <replaceable>true</replaceable>, all subscriptions + and messages on the remote broker will be cleaned up if + the connection drops. Note that setting to + <replaceable>true</replaceable> may cause a large + amount of retained messages to be sent each time the + bridge reconnects.</para> + <para>If you are using bridges with + <option>cleansession</option> set to + <replaceable>false</replaceable> (the default), then + you may get unexpected behaviour from incoming topics + if you change what topics you are subscribing to. This + is because the remote broker keeps the subscription for + the old topic. If you have this problem, connect your + bridge with <option>cleansession</option> set to + <replaceable>true</replaceable>, then reconnect with + cleansession set to <replaceable>false</replaceable> as + normal.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>connection</option> <replaceable>name</replaceable></term> + <listitem> + <para>This variable marks the start of a new bridge + connection. It is also used to give the bridge a name + which is used as the client id on the remote + broker.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>keepalive_interval</option> <replaceable>seconds</replaceable></term> + <listitem> + <para>Set the number of seconds after which the bridge + should send a ping if no other traffic has occurred. + Defaults to 60. A minimum value of 5 seconds + is allowed.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>idle_timeout</option> <replaceable>seconds</replaceable></term> + <listitem> + <para>Set the amount of time a bridge using the lazy start + type must be idle before it will be stopped. Defaults + to 60 seconds.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>local_clientid</option> <replaceable>id</replaceable></term> + <listitem> + <para>Set the clientid to use on the local broker. If not + defined, this defaults to + <option>local.<remote_clientid></option>. If you are + bridging a broker to itself, it is important that + local_clientid and remote_clientid do not match.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>local_password</option> <replaceable>password</replaceable></term> + <listitem> + <para>Configure the password to be used when connecting + this bridge to the local broker. This may be important + when authentication and ACLs are being used.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>local_username</option> <replaceable>username</replaceable></term> + <listitem> + <para>Configure the username to be used when connecting + this bridge to the local broker. This may be important + when authentication and ACLs are being used.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>notifications</option> [ true | false ]</term> + <listitem> + <para>If set to <replaceable>true</replaceable>, publish + notification messages to the local and remote brokers + giving information about the state of the bridge + connection. Retained messages are published to the + topic $SYS/broker/connection/<remote_clientid>/state + unless otherwise set with + <option>notification_topic</option>s. If the message + is 1 then the connection is active, or 0 if the + connection has failed. Defaults to + <replaceable>true</replaceable>.</para> + <para>This uses the Last Will and Testament (LWT) feature.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>notifications_local_only</option> [ true | false ]</term> + <listitem> + <para>If set to <replaceable>true</replaceable>, only publish + notification messages to the local broker giving + information about the state of the bridge connection. + Defaults to <replaceable>false</replaceable>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>notification_topic</option> <replaceable>topic</replaceable></term> + <listitem> + <para>Choose the topic on which notifications will be + published for this bridge. If not set the messages will + be sent on the topic + $SYS/broker/connection/<remote_clientid>/state.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>remote_clientid</option> <replaceable>id</replaceable></term> + <listitem> + <para>Set the client id for this bridge connection. If not + defined, this defaults to 'name.hostname', where name + is the connection name and hostname is the hostname of + this computer.</para> + <para>This replaces the old "clientid" option to avoid + confusion with local/remote sides of the bridge. + "clientid" remains valid for the time being.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>remote_password</option> <replaceable>value</replaceable></term> + <listitem> + <para>Configure a password for the bridge. This is used for + authentication purposes when connecting to a broker + that supports MQTT v3.1 and up and requires a username + and/or password to connect. This option is only valid + if a remote_username is also supplied.</para> + <para>This replaces the old "password" option to avoid + confusion with local/remote sides of the bridge. + "password" remains valid for the time being.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>remote_username</option> <replaceable>name</replaceable></term> + <listitem> + <para>Configure a username for the bridge. This is used for + authentication purposes when connecting to a broker + that supports MQTT v3.1 and up and requires a username + and/or password to connect. See also the + <option>remote_password</option> option.</para> + <para>This replaces the old "username" option to avoid + confusion with local/remote sides of the bridge. + "username" remains valid for the time being.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>restart_timeout</option> <replaceable>base cap</replaceable></term> + <term><option>restart_timeout</option> <replaceable>constant</replaceable></term> + <listitem> + <para>Set the amount of time a bridge using the automatic + start type will wait until attempting to reconnect.</para> + <para>This option can be configured to use a constant delay + time in seconds, or to use a backoff mechanism based on + "Decorrelated Jitter", which adds a degree of + randomness to when the restart occurs, starting at the + base and increasing up to the cap. Set a constant + timeout of 20 seconds:</para> + <programlisting language="config"> +restart_timeout 20</programlisting> + <para>Set backoff with a base (start value) of 10 seconds and a cap (upper + limit) of 60 seconds:</para> + <programlisting language="config"> +restart_timeout 10 30</programlisting> + <para>Defaults to jitter with a base of 5 seconds and cap + of 30 seconds.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>round_robin</option> [ true | false ]</term> + <listitem> + <para>If the bridge has more than one address given in the + address/addresses configuration, the round_robin option + defines the behaviour of the bridge on a failure of the + bridge connection. If round_robin is + <replaceable>false</replaceable>, the default value, + then the first address is treated as the main bridge + connection. If the connection fails, the other + secondary addresses will be attempted in turn. Whilst + connected to a secondary bridge, the bridge will + periodically attempt to reconnect to the main bridge + until successful.</para> + <para>If round_robin is <replaceable>true</replaceable>, + then all addresses are treated as equals. If a + connection fails, the next address will be tried and if + successful will remain connected until it fails.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>start_type</option> [ automatic | lazy | once ]</term> + <listitem> + <para>Set the start type of the bridge. This controls how + the bridge starts and can be one of three types: + <replaceable>automatic</replaceable>, <replaceable>lazy + </replaceable>and <replaceable>once</replaceable>. Note + that RSMB provides a fourth start type "manual" which + isn't currently supported by mosquitto.</para> + + <para><replaceable>automatic</replaceable> is the default + start type and means that the bridge connection will be + started automatically when the broker starts and also + restarted after a short delay (30 seconds) if the + connection fails.</para> + + <para>Bridges using the <replaceable>lazy</replaceable> + start type will be started automatically when the + number of queued messages exceeds the number set with + the <option>threshold</option> option. It will be + stopped automatically after the time set by the + <option>idle_timeout</option> parameter. Use this start + type if you wish the connection to only be active when + it is needed.</para> + + <para>A bridge using the <replaceable>once</replaceable> + start type will be started automatically when the + broker starts but will not be restarted if the + connection fails.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>threshold</option> <replaceable>count</replaceable></term> + <listitem> + <para>Set the number of messages that need to be queued for + a bridge with lazy start type to be restarted. + Defaults to 10 messages.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>topic</option> <replaceable>pattern</replaceable> [[[ out | in | both ] qos-level] local-prefix remote-prefix]</term> + <listitem> + <para>Define a topic pattern to be shared between the two + brokers. Any topics matching the pattern (which may + include wildcards) are shared. The second parameter + defines the direction that the messages will be shared + in, so it is possible to import messages from a remote + broker using <replaceable>in</replaceable>, export + messages to a remote broker using + <replaceable>out</replaceable> or share messages in + both directions. If this parameter is not defined, the + default of <replaceable>out</replaceable> is used. The + QoS level defines the publish/subscribe QoS level used + for this topic and defaults to 0.</para> + <para>The <replaceable>local-prefix</replaceable> and + <replaceable>remote-prefix</replaceable> options allow + topics to be remapped when publishing to and receiving + from remote brokers. This allows a topic tree from the + local broker to be inserted into the topic tree of the + remote broker at an appropriate place.</para> + <para>For incoming topics, the bridge will prepend the + pattern with the remote prefix and subscribe to the + resulting topic on the remote broker. When a matching + incoming message is received, the remote prefix will be + removed from the topic and then the local prefix + added.</para> + <para>For outgoing topics, the bridge will prepend the + pattern with the local prefix and subscribe to the + resulting topic on the local broker. When an outgoing + message is processed, the local prefix will be removed + from the topic then the remote prefix added.</para> + <para>When using topic mapping, an empty prefix can be + defined using the place marker + <replaceable>""</replaceable>. Using the empty marker + for the topic itself is also valid. The table below + defines what combination of empty or value is + valid. The <option>Full Local Topic</option> and + <option>Full Remote Topic</option> show the resulting + topics that would be used on the local and remote ends + of the bridge. For example, for the first table row if + you publish to <option>L/topic</option> on the local + broker, then the remote broker will receive a message + on the topic <option>R/topic</option>.</para> + + <informaltable> + <tgroup cols="6"> + <thead> + <row> + <entry><emphasis>Pattern</emphasis></entry> + <entry><emphasis>Local Prefix</emphasis></entry> + <entry><emphasis>Remote Prefix</emphasis></entry> + <entry><emphasis>Validity</emphasis></entry> + <entry><emphasis>Full Local Topic</emphasis></entry> + <entry><emphasis>Full Remote Topic</emphasis></entry> + </row> + </thead> + <tbody> + <row><entry>pattern</entry><entry>L/</entry><entry>R/</entry><entry>valid</entry><entry>L/pattern</entry><entry>R/pattern</entry></row> + <row><entry>pattern</entry><entry>L/</entry><entry>""</entry><entry>valid</entry><entry>L/pattern</entry><entry>pattern</entry></row> + <row><entry>pattern</entry><entry>""</entry><entry>R/</entry><entry>valid</entry><entry>pattern</entry><entry>R/pattern</entry></row> + <row><entry>pattern</entry><entry>""</entry><entry>""</entry><entry>valid (no remapping)</entry><entry>pattern</entry><entry>pattern</entry></row> + <row><entry>""</entry><entry>local</entry><entry>remote</entry><entry>valid (remap single local topic to remote)</entry><entry>local</entry><entry>remote</entry></row> + <row><entry>""</entry><entry>local</entry><entry>""</entry><entry>invalid</entry><entry></entry><entry></entry></row> + <row><entry>""</entry><entry>""</entry><entry>remote</entry><entry>invalid</entry><entry></entry><entry></entry></row> + <row><entry>""</entry><entry>""</entry><entry>""</entry><entry>invalid</entry><entry></entry><entry></entry></row> + </tbody> + </tgroup> + </informaltable> + <para>To remap an entire topic tree, use e.g.:</para> + <programlisting language="config"> +topic # both 2 local/topic/ remote/topic/</programlisting> + + <para>This option can be specified multiple times per + bridge.</para> + <para>Care must be taken to ensure that loops are not + created with this option. If you are experiencing high + CPU load from a broker, it is possible that you have a + loop where each broker is forever forwarding each other + the same messages.</para> + <para>See also the <option>cleansession</option> option if + you have messages arriving on unexpected topics when + using incoming topics.</para> + + <example title="Bridge Topic Remapping" label="Bridge Topic Remapping"> + <para>The configuration below connects a bridge to the + broker at <option>test.mosquitto.org</option>. It + subscribes to the remote topic + <option>$SYS/broker/clients/total</option> and + republishes the messages received to the local topic + <option>test/mosquitto/org/clients/total</option></para> + <programlisting language="config"> +connection test-mosquitto-org +address test.mosquitto.org +cleansession true +topic clients/total in 0 test/mosquitto/org $SYS/broker/ +</programlisting></example> + + </listitem> + </varlistentry> + <varlistentry> + <term><option>try_private</option> [ true | false ]</term> + <listitem> + <para>If try_private is set to + <replaceable>true</replaceable>, the bridge will + attempt to indicate to the remote broker that it is a + bridge not an ordinary client. If successful, this + means that loop detection will be more effective and + that retained messages will be propagated correctly. + Not all brokers support this feature so it may be + necessary to set <option>try_private</option> to + <replaceable>false</replaceable> if your bridge does + not connect properly.</para> + <para>Defaults to <replaceable>true</replaceable>.</para> + </listitem> + </varlistentry> + </variablelist> + <refsect2> + <title>SSL/TLS Support</title> + <para>The following options are available for all bridges to + configure SSL/TLS support.</para> + <variablelist> + <varlistentry> + <term><option>bridge_alpn</option> <replaceable>alpn</replaceable></term> + <listitem> + <para>Configure the application layer protocol negotiation + option for the TLS session. Useful for brokers that support + both websockets and MQTT on the same port.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>bridge_cafile</option> <replaceable>file path</replaceable></term> + <listitem> + <para>One of <option>bridge_cafile</option> or + <option>bridge_capath</option> must be provided to + allow SSL/TLS support.</para> + <para>bridge_cafile is used to define the path to a file + containing the PEM encoded CA certificates that + have signed the certificate for the remote broker. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>bridge_capath</option> <replaceable>file path</replaceable></term> + <listitem> + <para>One of <option>bridge_capath</option> or + <option>bridge_capath</option> must be provided to + allow SSL/TLS support.</para> + <para>bridge_capath is used to define the path to a + directory containing the PEM encoded CA + certificates that have signed the certificate for + the remote broker. For bridge_capath to work + correctly, the certificate files must have ".crt" + as the file ending and you must run "openssl rehash + <path to bridge_capath>" each time you + add/remove a certificate.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>bridge_certfile</option> <replaceable>file path</replaceable></term> + <listitem> + <para>Path to the PEM encoded client certificate for + this bridge, if required by the remote + broker.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>bridge_identity</option> <replaceable>identity</replaceable></term> + <listitem> + <para>Pre-shared-key encryption provides an alternative + to certificate based encryption. A bridge can be + configured to use PSK with the + <option>bridge_identity</option> and + <option>bridge_psk</option> options. This is the + client identity used with PSK encryption. Only one + of certificate and PSK based encryption can be used + on one bridge at once.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>bridge_insecure</option> [ true | false ]</term> + <listitem> + <para>When using certificate based TLS, the bridge will + attempt to verify the hostname provided in the + remote certificate matches the host/address being + connected to. This may cause problems in testing + scenarios, so <option>bridge_insecure</option> may + be set to <replaceable>false</replaceable> to + disable the hostname verification.</para> + <para>Setting this option to + <replaceable>true</replaceable> means that a + malicious third party could potentially inpersonate + your server, so it should always be set to + <replaceable>false</replaceable> in production + environments.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>bridge_keyfile</option> <replaceable>file path</replaceable></term> + <listitem> + <para>Path to the PEM encoded private key for this + bridge, if required by the remote broker.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>bridge_psk</option> <replaceable>key</replaceable></term> + <listitem> + <para>Pre-shared-key encryption provides an alternative + to certificate based encryption. A bridge can be + configured to use PSK with the + <option>bridge_identity</option> and + <option>bridge_psk</option> options. This is the + pre-shared-key in hexadecimal format with no "0x". + Only one of certificate and PSK based encryption + can be used on one bridge at once.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>bridge_require_ocsp</option> [ true | false ]</term> + <listitem> + <para>When set to true, the bridge requires OCSP on the TLS + connection it opens as client.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>bridge_tls_version</option> <replaceable>version</replaceable></term> + <listitem> + <para>Configure the version of the TLS protocol to be + used for this bridge. Possible values are + <replaceable>tlsv1.3</replaceable>, + <replaceable>tlsv1.2</replaceable> and + <replaceable>tlsv1.1</replaceable>. Defaults to + <replaceable>tlsv1.2</replaceable>. The remote + broker must support the same version of TLS for the + connection to succeed.</para> + </listitem> + </varlistentry> + </variablelist> + </refsect2> + </refsect1> + + <refsect1> + <title>Files</title> + <para>mosquitto.conf</para> + </refsect1> + + <refsect1> + <title>Bugs</title> + <para><command>mosquitto</command> bug information can be found at + <ulink url="https://github.com/eclipse/mosquitto/issues"/></para> + </refsect1> + + <refsect1> + <title>See Also</title> + <simplelist type="inline"> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto-8.html">mosquitto</link></refentrytitle> + <manvolnum>8</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto_passwd-1.html">mosquitto_passwd</link></refentrytitle> + <manvolnum>1</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto-tls-7.html">mosquitto-tls</link></refentrytitle> + <manvolnum>7</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mqtt-7.html">mqtt</link></refentrytitle> + <manvolnum>7</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="http://linux.die.net/man/5/limits.conf">limits.conf</link></refentrytitle> + <manvolnum>5</manvolnum> + </citerefentry> + </member> + </simplelist> + </refsect1> + + <refsect1> + <title>Author</title> + <para>Roger Light <email>roger@atchoo.org</email></para> + </refsect1> +</refentry> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_passwd.1 b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_passwd.1 new file mode 100644 index 0000000..1a9a549 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_passwd.1 @@ -0,0 +1,125 @@ +'\" t +.\" Title: mosquitto_passwd +.\" Author: [see the "Author" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> +.\" Date: 06/18/2019 +.\" Manual: Commands +.\" Source: Mosquitto Project +.\" Language: English +.\" +.TH "MOSQUITTO_PASSWD" "1" "06/18/2019" "Mosquitto Project" "Commands" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +mosquitto_passwd \- manage password files for mosquitto +.SH "SYNOPSIS" +.HP \w'\fBmosquitto_passwd\fR\ 'u +\fBmosquitto_passwd\fR [\fB\-c\fR | \fB\-D\fR] \fIpasswordfile\fR \fIusername\fR +.HP \w'\fBmosquitto_passwd\fR\ 'u +\fBmosquitto_passwd\fR \fB\-b\fR \fIpasswordfile\fR \fIusername\fR \fIpassword\fR +.HP \w'\fBmosquitto_passwd\fR\ 'u +\fBmosquitto_passwd\fR \fB\-U\fR \fIpasswordfile\fR +.SH "DESCRIPTION" +.PP +\fBmosquitto_passwd\fR +is a tool for managing password files for the mosquitto MQTT broker\&. +.PP +Usernames must not contain ":"\&. Passwords are stored in a similar format to +\fBcrypt\fR(3)\&. +.SH "OPTIONS" +.PP +\fB\-b\fR +.RS 4 +Run in batch mode\&. This allows the password to be provided at the command line which can be convenient but should be used with care because the password will be visible on the command line and in command history\&. +.RE +.PP +\fB\-c\fR +.RS 4 +Create a new password file\&. If the file already exists, it will be overwritten\&. +.RE +.PP +\fB\-D\fR +.RS 4 +Delete the specified user from the password file\&. +.RE +.PP +\fB\-U\fR +.RS 4 +This option can be used to upgrade/convert a password file with plain text passwords into one using hashed passwords\&. It will modify the specified file\&. It does not detect whether passwords are already hashed, so using it on a password file that already contains hashed passwords will generate new hashes based on the old hashes and render the password file unusable\&. +.RE +.PP +\fBpasswordfile\fR +.RS 4 +The password file to modify\&. +.RE +.PP +\fBusername\fR +.RS 4 +The username to add/update/delete\&. +.RE +.PP +\fBpassword\fR +.RS 4 +The password to use when in batch mode\&. +.RE +.SH "EXAMPLES" +.PP +Add a user to a new password file: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_passwd +\-c +/etc/mosquitto/passwd +ral +.RE +.PP +Delete a user from a password file +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_passwd +\-D +/etc/mosquitto/passwd +ral +.RE +.SH "BUGS" +.PP +\fBmosquitto\fR +bug information can be found at +\m[blue]\fB\%https://github.com/eclipse/mosquitto/issues\fR\m[] +.SH "SEE ALSO" +\fBmosquitto\fR(8), \fBmosquitto.conf\fR(5), \fBmqtt\fR(7) +.SH "AUTHOR" +.PP +Roger Light +<roger@atchoo\&.org> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_passwd.1.meta b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_passwd.1.meta new file mode 100644 index 0000000..6d7c65b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_passwd.1.meta @@ -0,0 +1,5 @@ +.. title: mosquitto_passwd man page +.. slug: mosquitto_passwd-1 +.. category: man +.. type: man +.. pretty_url: False diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_passwd.1.xml b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_passwd.1.xml new file mode 100644 index 0000000..5f144bf --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_passwd.1.xml @@ -0,0 +1,158 @@ +<?xml version='1.0' encoding='UTF-8'?> +<?xml-stylesheet type="text/xsl" href="manpage.xsl"?> + +<refentry xml:id="mosquitto_passwd" xmlns:xlink="http://www.w3.org/1999/xlink"> + <refmeta> + <refentrytitle>mosquitto_passwd</refentrytitle> + <manvolnum>1</manvolnum> + <refmiscinfo class="source">Mosquitto Project</refmiscinfo> + <refmiscinfo class="manual">Commands</refmiscinfo> + </refmeta> + + <refnamediv> + <refname>mosquitto_passwd</refname> + <refpurpose>manage password files for mosquitto</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <cmdsynopsis> + <command>mosquitto_passwd</command> + <group> + <arg choice='plain'><option>-c</option></arg> + <arg choice='plain'><option>-D</option></arg> + </group> + <arg choice='plain'><replaceable>passwordfile</replaceable></arg> + <arg choice='plain'><replaceable>username</replaceable></arg> + </cmdsynopsis> + <cmdsynopsis> + <command>mosquitto_passwd</command> + <arg choice='plain'><option>-b</option></arg> + <arg choice='plain'><replaceable>passwordfile</replaceable></arg> + <arg choice='plain'><replaceable>username</replaceable></arg> + <arg choice='plain'><replaceable>password</replaceable></arg> + </cmdsynopsis> + <cmdsynopsis> + <command>mosquitto_passwd</command> + <arg choice='plain'><option>-U</option></arg> + <arg choice='plain'><replaceable>passwordfile</replaceable></arg> + </cmdsynopsis> + </refsynopsisdiv> + + <refsect1> + <title>Description</title> + <para><command>mosquitto_passwd</command> is a tool for managing + password files for the mosquitto MQTT broker.</para> + <para>Usernames must not contain ":". Passwords are stored in a similar + format to + <citerefentry><refentrytitle>crypt</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para> + </refsect1> + + <refsect1> + <title>Options</title> + <variablelist> + <varlistentry> + <term><option>-b</option></term> + <listitem> + <para>Run in batch mode. This allows the password to be + provided at the command line which can be convenient + but should be used with care because the password will + be visible on the command line and in command + history.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-c</option></term> + <listitem> + <para>Create a new password file. If the file already + exists, it will be overwritten.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-D</option></term> + <listitem> + <para>Delete the specified user from the password + file.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-U</option></term> + <listitem> + <para>This option can be used to upgrade/convert a password + file with plain text passwords into one using hashed + passwords. It will modify the specified file. It does + not detect whether passwords are already hashed, so + using it on a password file that already contains + hashed passwords will generate new hashes based on the + old hashes and render the password file + unusable.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>passwordfile</option></term> + <listitem> + <para>The password file to modify.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>username</option></term> + <listitem> + <para>The username to add/update/delete.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>password</option></term> + <listitem> + <para>The password to use when in batch mode.</para> + </listitem> + </varlistentry> + </variablelist> + </refsect1> + + + <refsect1> + <title>Examples</title> + <para>Add a user to a new password file:</para> + <itemizedlist mark="circle"> + <listitem><para>mosquitto_passwd <literal>-c</literal> /etc/mosquitto/passwd <literal>ral</literal></para></listitem> + </itemizedlist> + <para>Delete a user from a password file</para> + <itemizedlist mark="circle"> + <listitem><para>mosquitto_passwd <literal>-D</literal> /etc/mosquitto/passwd <literal>ral</literal></para></listitem> + </itemizedlist> + </refsect1> + + <refsect1> + <title>Bugs</title> + <para><command>mosquitto</command> bug information can be found at + <ulink url="https://github.com/eclipse/mosquitto/issues"/></para> + </refsect1> + + <refsect1> + <title>See Also</title> + <simplelist type="inline"> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto-8.html">mosquitto</link></refentrytitle> + <manvolnum>8</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto-conf-5.html">mosquitto.conf</link></refentrytitle> + <manvolnum>5</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mqtt-7.html">mqtt</link></refentrytitle> + <manvolnum>7</manvolnum> + </citerefentry> + </member> + </simplelist> + </refsect1> + + <refsect1> + <title>Author</title> + <para>Roger Light <email>roger@atchoo.org</email></para> + </refsect1> +</refentry> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_pub.1 b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_pub.1 new file mode 100644 index 0000000..e38c0e5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_pub.1 @@ -0,0 +1,855 @@ +'\" t +.\" Title: mosquitto_pub +.\" Author: [see the "Author" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> +.\" Date: 06/18/2019 +.\" Manual: Commands +.\" Source: Mosquitto Project +.\" Language: English +.\" +.TH "MOSQUITTO_PUB" "1" "06/18/2019" "Mosquitto Project" "Commands" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +mosquitto_pub \- an MQTT version 5/3\&.1\&.1/3\&.1 client for publishing simple messages +.SH "SYNOPSIS" +.HP \w'\fBmosquitto_pub\fR\ 'u +\fBmosquitto_pub\fR {[\fB\-h\fR\ \fIhostname\fR]\ [\fB\-p\fR\ \fIport\-number\fR]\ [\fB\-u\fR\ \fIusername\fR]\ [\fB\-P\fR\ \fIpassword\fR]\ \fB\-t\fR\ \fImessage\-topic\fR... | \fB\-L\fR\ \fIURL\fR} [\fB\-A\fR\ \fIbind\-address\fR] [\fB\-c\fR] [\fB\-d\fR] [\fB\-D\fR\ \fIcommand\fR\ \fIidentifier\fR\ \fIvalue\fR] [\fB\-i\fR\ \fIclient\-id\fR] [\fB\-I\fR\ \fIclient\-id\-prefix\fR] [\fB\-k\fR\ \fIkeepalive\-time\fR] [\fB\-q\fR\ \fImessage\-QoS\fR] [\fB\-\-quiet\fR] [\fB\-r\fR] [\fB\-\-repeat\fR\ \fIcount\fR] [\fB\-\-repeat\-delay\fR\ \fIseconds\fR] [\fB\-S\fR] {\fB\-f\fR\ \fIfile\fR | \fB\-l\fR | \fB\-m\fR\ \fImessage\fR | \fB\-n\fR | \fB\-s\fR} [\fB\-\-will\-topic\fR\ \fItopic\fR\ [\fB\-\-will\-payload\fR\ \fIpayload\fR]\ [\fB\-\-will\-qos\fR\ \fIqos\fR]\ [\fB\-\-will\-retain\fR]] [[{\fB\-\-cafile\fR\ \fIfile\fR\ |\ \fB\-\-capath\fR\ \fIdir\fR}\ [\fB\-\-cert\fR\ \fIfile\fR]\ [\fB\-\-key\fR\ \fIfile\fR]\ [\fB\-\-ciphers\fR\ \fIciphers\fR]\ [\fB\-\-tls\-version\fR\ \fIversion\fR]\ [\fB\-\-tls\-alpn\fR\ \fIprotocol\fR]\ [\fB\-\-tls\-engine\fR\ \fIengine\fR]\ [\fB\-\-keyform\fR\ {\fIpem\fR\ |\ \fIengine\fR}]\ [\fB\-\-tls\-engine\-kpass\-sha1\fR\ \fIkpass\-sha1\fR]\ [\fB\-\-insecure\fR]] | [\fB\-\-psk\fR\ \fIhex\-key\fR\ \fB\-\-psk\-identity\fR\ \fIidentity\fR\ [\fB\-\-ciphers\fR\ \fIciphers\fR]\ [\fB\-\-tls\-version\fR\ \fIversion\fR]]] [\fB\-\-proxy\fR\ \fIsocks\-url\fR] [\fB\-V\fR\ \fIprotocol\-version\fR] +.HP \w'\fBmosquitto_pub\fR\ 'u +\fBmosquitto_pub\fR [\fB\-\-help\fR] +.SH "DESCRIPTION" +.PP +\fBmosquitto_pub\fR +is a simple MQTT version 5/3\&.1\&.1 client that will publish a single message on a topic and exit\&. +.SH "ENCRYPTED CONNECTIONS" +.PP +\fBmosquitto_pub\fR +supports TLS encrypted connections\&. It is strongly recommended that you use an encrypted connection for anything more than the most basic setup\&. +.PP +To enable TLS connections when using x509 certificates, one of either +\fB\-\-cafile\fR +or +\fB\-\-capath\fR +must be provided as an option\&. +.PP +To enable TLS connections when using TLS\-PSK, you must use the +\fB\-\-psk\fR +and the +\fB\-\-psk\-identity\fR +options\&. +.SH "OPTIONS" +.PP +The options below may be given on the command line, but may also be placed in a config file located at +\fB$XDG_CONFIG_HOME/mosquitto_pub\fR +or +\fB$HOME/\&.config/mosquitto_sub\fR +with one pair of +\fB\-option \fR\fB\fIvalue\fR\fR +per line\&. The values in the config file will be used as defaults and can be overridden by using the command line\&. The exceptions to this are the message type options, of which only one can be specified\&. Note also that currently some options cannot be negated, e\&.g\&. +\fB\-S\fR\&. Config file lines that have a +\fB#\fR +as the first character are treated as comments and not processed any further\&. +.PP +\fB\-A\fR +.RS 4 +Bind the outgoing connection to a local ip address/hostname\&. Use this argument if you need to restrict network communication to a particular interface\&. +.RE +.PP +\fB\-c\fR, \fB\-\-disable\-clean\-session\fR +.RS 4 +Disable the \*(Aqclean session\*(Aq flag\&. This means that all of the subscriptions for the client will be maintained after it disconnects, along with subsequent QoS 1 and QoS 2 messages that arrive\&. When the client reconnects, it will receive all of the queued messages\&. +.sp +If using this option, the client id must be set manually with +\fB\-\-id\fR +.RE +.PP +\fB\-\-cafile\fR +.RS 4 +Define the path to a file containing PEM encoded CA certificates that are trusted\&. Used to enable SSL communication\&. +.sp +See also +\fB\-\-capath\fR +.RE +.PP +\fB\-\-capath\fR +.RS 4 +Define the path to a directory containing PEM encoded CA certificates that are trusted\&. Used to enable SSL communication\&. +.sp +For +\fB\-\-capath\fR +to work correctly, the certificate files must have "\&.crt" as the file ending and you must run "openssl rehash <path to capath>" each time you add/remove a certificate\&. +.sp +See also +\fB\-\-cafile\fR +.RE +.PP +\fB\-\-cert\fR +.RS 4 +Define the path to a file containing a PEM encoded certificate for this client, if required by the server\&. +.sp +See also +\fB\-\-key\fR\&. +.RE +.PP +\fB\-\-ciphers\fR +.RS 4 +An openssl compatible list of TLS ciphers to support in the client\&. See +\fBciphers\fR(1) +for more information\&. +.RE +.PP +\fB\-d\fR, \fB\-\-debug\fR +.RS 4 +Enable debug messages\&. +.RE +.PP +\fB\-D\fR, \fB\-\-property\fR +.RS 4 +Use an MQTT v5 property with this publish\&. If you use this option, the client will be set to be an MQTT v5 client\&. This option has two forms: +.sp +\fB\-D command identifier value\fR +.sp +\fB\-D command identifier name value\fR +.sp +\fBcommand\fR +is the MQTT command/packet identifier and can be one of CONNECT, PUBLISH, PUBREL, DISCONNECT, AUTH, or WILL\&. The properties available for each command are listed in the +Properties +section\&. +.sp +\fBidentifier\fR +is the name of the property to add\&. This is as described in the specification, but with \*(Aq\-\*(Aq as a word separator\&. For example: +\fBpayload\-format\-indicator\fR\&. More details are in the +Properties +section\&. +.sp +\fBvalue\fR +is the value of the property to add, with a data type that is property specific\&. +.sp +\fBname\fR +is only used for the +\fBuser\-property\fR +property as the first of the two strings in the string pair\&. In that case, +\fBvalue\fR +is the second of the strings in the pair\&. +.RE +.PP +\fB\-f\fR, \fB\-\-file\fR +.RS 4 +Send the contents of a file as the message\&. +.RE +.PP +\fB\-\-help\fR +.RS 4 +Display usage information\&. +.RE +.PP +\fB\-h\fR, \fB\-\-host\fR +.RS 4 +Specify the host to connect to\&. Defaults to localhost\&. +.RE +.PP +\fB\-i\fR, \fB\-\-id\fR +.RS 4 +The id to use for this client\&. If not given, defaults to mosquitto_pub_ appended with the process id of the client\&. Cannot be used at the same time as the +\fB\-\-id\-prefix\fR +argument\&. +.RE +.PP +\fB\-I\fR, \fB\-\-id\-prefix\fR +.RS 4 +Provide a prefix that the client id will be built from by appending the process id of the client\&. This is useful where the broker is using the clientid_prefixes option\&. Cannot be used at the same time as the +\fB\-\-id\fR +argument\&. +.RE +.PP +\fB\-\-insecure\fR +.RS 4 +When using certificate based encryption, this option disables verification of the server hostname in the server certificate\&. This can be useful when testing initial server configurations but makes it possible for a malicious third party to impersonate your server through DNS spoofing, for example\&. Use this option in testing +\fIonly\fR\&. If you need to resort to using this option in a production environment, your setup is at fault and there is no point using encryption\&. +.RE +.PP +\fB\-k\fR, \fB\-\-keepalive\fR +.RS 4 +The number of seconds between sending PING commands to the broker for the purposes of informing it we are still connected and functioning\&. Defaults to 60 seconds\&. +.RE +.PP +\fB\-\-key\fR +.RS 4 +Define the path to a file containing a PEM encoded private key for this client, if required by the server\&. +.sp +See also +\fB\-\-cert\fR\&. +.RE +.PP +\fB\-\-keyform\fR +.RS 4 +Specifies the type of private key in use when making TLS connections\&.\&. This can be "pem" or "engine"\&. This parameter is useful when a TPM module is being used and the private key has been created with it\&. Defaults to "pem", which means normal private key files are used\&. +.sp +See also +\fB\-\-tls\-engine\fR\&. +.RE +.PP +\fB\-L\fR, \fB\-\-url\fR +.RS 4 +Specify specify user, password, hostname, port and topic at once as a URL\&. The URL must be in the form: mqtt(s)://[username[:password]@]host[:port]/topic +.sp +If the scheme is mqtt:// then the port defaults to 1883\&. If the scheme is mqtts:// then the port defaults to 8883\&. +.RE +.PP +\fB\-l\fR, \fB\-\-stdin\-line\fR +.RS 4 +Send messages read from stdin, splitting separate lines into separate messages\&. Note that blank lines won\*(Aqt be sent\&. +.RE +.PP +\fB\-m\fR, \fB\-\-message\fR +.RS 4 +Send a single message from the command line\&. +.RE +.PP +\fB\-n\fR, \fB\-\-null\-message\fR +.RS 4 +Send a null (zero length) message\&. +.RE +.PP +\fB\-p\fR, \fB\-\-port\fR +.RS 4 +Connect to the port specified\&. If not given, the default of 1883 for plain MQTT or 8883 for MQTT over TLS will be used\&. +.RE +.PP +\fB\-P\fR, \fB\-\-pw\fR +.RS 4 +Provide a password to be used for authenticating with the broker\&. Using this argument without also specifying a username is invalid when using MQTT v3\&.1 or v3\&.1\&.1\&. See also the +\fB\-\-username\fR +option\&. +.RE +.PP +\fB\-\-proxy\fR +.RS 4 +Specify a SOCKS5 proxy to connect through\&. "None" and "username" authentication types are supported\&. The +\fBsocks\-url\fR +must be of the form +\fBsocks5h://[username[:password]@]host[:port]\fR\&. The protocol prefix +\fBsocks5h\fR +means that hostnames are resolved by the proxy\&. The symbols %25, %3A and %40 are URL decoded into %, : and @ respectively, if present in the username or password\&. +.sp +If username is not given, then no authentication is attempted\&. If the port is not given, then the default of 1080 is used\&. +.sp +More SOCKS versions may be available in the future, depending on demand, and will use different protocol prefixes as described in +\fBcurl\fR(1)\&. +.RE +.PP +\fB\-\-psk\fR +.RS 4 +Provide the hexadecimal (no leading 0x) pre\-shared\-key matching the one used on the broker to use TLS\-PSK encryption support\&. +\fB\-\-psk\-identity\fR +must also be provided to enable TLS\-PSK\&. +.RE +.PP +\fB\-\-psk\-identity\fR +.RS 4 +The client identity to use with TLS\-PSK support\&. This may be used instead of a username if the broker is configured to do so\&. +.RE +.PP +\fB\-q\fR, \fB\-\-qos\fR +.RS 4 +Specify the quality of service to use for the message, from 0, 1 and 2\&. Defaults to 0\&. +.RE +.PP +\fB\-\-quiet\fR +.RS 4 +If this argument is given, no runtime errors will be printed\&. This excludes any error messages given in case of invalid user input (e\&.g\&. using +\fB\-\-port\fR +without a port)\&. +.RE +.PP +\fB\-r\fR, \fB\-\-retain\fR +.RS 4 +If retain is given, the message will be retained as a "last known good" value on the broker\&. See +\fBmqtt\fR(7) +for more information\&. +.RE +.PP +\fB\-\-repeat\fR +.RS 4 +If the publish mode is\fB\-m\fR, +\fB\-f\fR, or +\fB\-s\fR +(i\&.e\&. the modes where only a single message is sent), then +\fB\-\-repeat\fR +can be used to specify that the message will be published multiple times\&. +.sp +See also +\fB\-\-repeat\-delay\fR\&. +.RE +.PP +\fB\-\-repeat\-delay\fR +.RS 4 +If using +\fB\-\-repeat\fR, then the default behaviour is to publish repeated messages as soon as the previous message is delivered\&. Use +\fB\-\-repeat\-delay\fR +to specify the number of seconds to wait after the previous message was delivered before publishing the next\&. Does not need to be an integer number of seconds\&. +.sp +Note that there is no guarantee as to the actual interval between messages, this option simply defines the minimum time from delivery of one message to the start of the publish of the next\&. +.RE +.PP +\fB\-s\fR, \fB\-\-stdin\-file\fR +.RS 4 +Send a message read from stdin, sending the entire content as a single message\&. +.RE +.PP +\fB\-S\fR +.RS 4 +Use SRV lookups to determine which host to connect to\&. Performs lookups to +\fB_mqtt\&._tcp\&.<host>\fR +when used in conjunction with +\fB\-h\fR, otherwise uses +\fB_mqtt\&._tcp\&.<local dns domain>\fR\&. +.RE +.PP +\fB\-t\fR, \fB\-\-topic\fR +.RS 4 +The MQTT topic on which to publish the message\&. See +\fBmqtt\fR(7) +for more information on MQTT topics\&. +.RE +.PP +\fB\-\-tls\-alpn\fR +.RS 4 +Provide a protocol to use when connecting to a broker that has multiple protocols available on a single port, e\&.g\&. MQTT and WebSockets\&. +.RE +.PP +\fB\-\-tls\-engine\fR +.RS 4 +A valid openssl engine id\&. These can be listed with openssl engine command\&. +.sp +See also +\fB\-\-keyform\fR\&. +.RE +.PP +\fB\-\-tls\-engine\-kpass\-sha1\fR +.RS 4 +SHA1 of the private key password when using an TLS engine\&. Some TLS engines such as the TPM engine may require the use of a password in order to be accessed\&. This option allows a hex encoded SHA1 hash of the password to the engine directly, instead of the user being prompted for the password\&. +.sp +See also +\fB\-\-tls\-engine\fR\&. +.RE +.PP +\fB\-\-tls\-version\fR +.RS 4 +Choose which TLS protocol version to use when communicating with the broker\&. Valid options are +\fBtlsv1\&.3\fR, +\fBtlsv1\&.2\fR +and +\fBtlsv1\&.1\fR\&. The default value is +\fBtlsv1\&.2\fR\&. Must match the protocol version used by the broker\&. +.RE +.PP +\fB\-u\fR, \fB\-\-username\fR +.RS 4 +Provide a username to be used for authenticating with the broker\&. See also the +\fB\-\-pw\fR +argument\&. +.RE +.PP +\fB\-V\fR, \fB\-\-protocol\-version\fR +.RS 4 +Specify which version of the MQTT protocol should be used when connecting to the rmeote broker\&. Can be +\fB5\fR, +\fB311\fR, +\fB31\fR, or the more verbose +\fBmqttv5\fR, +\fBmqttv311\fR, or +\fBmqttv31\fR\&. Defaults to +\fB311\fR\&. +.RE +.PP +\fB\-\-will\-payload\fR +.RS 4 +Specify a message that will be stored by the broker and sent out if this client disconnects unexpectedly\&. This must be used in conjunction with +\fB\-\-will\-topic\fR\&. +.RE +.PP +\fB\-\-will\-qos\fR +.RS 4 +The QoS to use for the Will\&. Defaults to 0\&. This must be used in conjunction with +\fB\-\-will\-topic\fR\&. +.RE +.PP +\fB\-\-will\-retain\fR +.RS 4 +If given, if the client disconnects unexpectedly the message sent out will be treated as a retained message\&. This must be used in conjunction with +\fB\-\-will\-topic\fR\&. +.RE +.PP +\fB\-\-will\-topic\fR +.RS 4 +The topic on which to send a Will, in the event that the client disconnects unexpectedly\&. +.RE +.SH "WILLS" +.PP +mosquitto_sub can register a message with the broker that will be sent out if it disconnects unexpectedly\&. See +\fBmqtt\fR(7) +for more information\&. +.PP +The minimum requirement for this is to use +\fB\-\-will\-topic\fR +to specify which topic the will should be sent out on\&. This will result in a non\-retained, zero length message with QoS 0\&. +.PP +Use the +\fB\-\-will\-retain\fR, +\fB\-\-will\-payload\fR +and +\fB\-\-will\-qos\fR +arguments to modify the other will parameters\&. +.SH "PROPERTIES" +.PP +The +\fB\-D\fR +/ +\fB\-\-property\fR +option allows adding properties to different stages of the mosquitto_pub run\&. The properties supported for each command are as follows: +.SS "Connect" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBauthentication\-data\fR +(binary data \- note treated as a string in mosquitto_pub) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBauthentication\-method\fR +(UTF\-8 string pair) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBmaximum\-packet\-size\fR +(32\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBreceive\-maximum\fR +(16\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBrequest\-problem\-information\fR +(8\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBrequest\-response\-information\fR +(8\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBsession\-expiry\-interval\fR +(32\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBtopic\-alias\-maximum\fR +(16\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBuser\-property\fR +(UTF\-8 string pair) +.RE +.SS "Publish" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBcontent\-type\fR +(UTF\-8 string) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBcorrelation\-data\fR +(binary data \- note treated as a string in mosquitto_pub) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBmessage\-expiry\-interval\fR +(32\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBpayload\-format\-indicator\fR +(8\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBresponse\-topic\fR +(UTF\-8 string) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBtopic\-alias\fR +(16\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBuser\-property\fR +(UTF\-8 string pair) +.RE +.SS "Disconnect" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBsession\-expiry\-interval\fR +(32\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBuser\-property\fR +(UTF\-8 string pair) +.RE +.SS "Will properties" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBcontent\-type\fR +(UTF\-8 string) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBcorrelation\-data\fR +(binary data \- note treated as a string in mosquitto_pub) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBmessage\-expiry\-interval\fR +(32\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBpayload\-format\-indicator\fR +(8\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBresponse\-topic\fR +(UTF\-8 string) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBuser\-property\fR +(UTF\-8 string pair) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBwill\-delay\-interval\fR +(32\-bit unsigned integer) +.RE +.SH "EXAMPLES" +.PP +Publish temperature information to localhost with QoS 1: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_pub +\-t +sensors/temperature +\-m +32 +\-q +1 +.RE +.PP +Publish timestamp and temperature information to a remote host on a non\-standard port and QoS 0: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_pub +\-h +192\&.168\&.1\&.1 +\-p +1885 +\-t +sensors/temperature +\-m +"1266193804 32" +.RE +.PP +Publish light switch status\&. Message is set to retained because there may be a long period of time between light switch events: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_pub +\-r +\-t +switches/kitchen_lights/status +\-m +"on" +.RE +.PP +Send the contents of a file in two ways: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_pub +\-t +my/topic +\-f +\&./data +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_pub +\-t +my/topic +\-s +< \&./data +.RE +.PP +Send parsed electricity usage data from a Current Cost meter, reading from stdin with one line/reading as one message: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +read_cc128\&.pl | mosquitto_pub +\-t +sensors/cc128 +\-l +.RE +.SH "FILES" +.PP +$XDG_CONFIG_HOME/mosquitto_pub, $HOME/\&.config/mosquitto_pub +.RS 4 +Configuration file for default options\&. +.RE +.SH "BUGS" +.PP +\fBmosquitto\fR +bug information can be found at +\m[blue]\fB\%https://github.com/eclipse/mosquitto/issues\fR\m[] +.SH "SEE ALSO" +\fBmqtt\fR(7), \fBmosquitto_rr\fR(1), \fBmosquitto_sub\fR(1), \fBmosquitto\fR(8), \fBlibmosquitto\fR(3), \fBmosquitto-tls\fR(7) +.SH "AUTHOR" +.PP +Roger Light +<roger@atchoo\&.org> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_pub.1.meta b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_pub.1.meta new file mode 100644 index 0000000..ef9b035 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_pub.1.meta @@ -0,0 +1,5 @@ +.. title: mosquitto_pub man page +.. slug: mosquitto_pub-1 +.. category: man +.. type: man +.. pretty_url: False diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_pub.1.xml b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_pub.1.xml new file mode 100644 index 0000000..2c1a425 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_pub.1.xml @@ -0,0 +1,744 @@ +<?xml version='1.0' encoding='UTF-8'?> +<?xml-stylesheet type="text/xsl" href="manpage.xsl"?> + +<refentry xml:id="mosquitto_pub" xmlns:xlink="http://www.w3.org/1999/xlink"> + <refmeta> + <refentrytitle>mosquitto_pub</refentrytitle> + <manvolnum>1</manvolnum> + <refmiscinfo class="source">Mosquitto Project</refmiscinfo> + <refmiscinfo class="manual">Commands</refmiscinfo> + </refmeta> + + <refnamediv> + <refname>mosquitto_pub</refname> + <refpurpose>an MQTT version 5/3.1.1/3.1 client for publishing simple messages</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <cmdsynopsis> + <command>mosquitto_pub</command> + <group choice='req'> + <arg choice='plain'> + <arg><option>-h</option> <replaceable>hostname</replaceable></arg> + <arg><option>-p</option> <replaceable>port-number</replaceable></arg> + <arg><option>-u</option> <replaceable>username</replaceable></arg> + <arg><option>-P</option> <replaceable>password</replaceable></arg> + <arg choice='plain' rep='repeat'><option>-t</option> <replaceable>message-topic</replaceable></arg> + </arg> + <arg choice='plain'><option>-L</option> <replaceable>URL</replaceable></arg> + </group> + <arg><option>-A</option> <replaceable>bind-address</replaceable></arg> + <arg><option>-c</option></arg> + <arg><option>-d</option></arg> + <arg><option>-D</option> <replaceable>command</replaceable> <replaceable>identifier</replaceable> <replaceable>value</replaceable></arg> + <arg><option>-i</option> <replaceable>client-id</replaceable></arg> + <arg><option>-I</option> <replaceable>client-id-prefix</replaceable></arg> + <arg><option>-k</option> <replaceable>keepalive-time</replaceable></arg> + <arg><option>-q</option> <replaceable>message-QoS</replaceable></arg> + <arg><option>--quiet</option></arg> + <arg><option>-r</option></arg> + <arg><option>--repeat</option> <replaceable>count</replaceable></arg> + <arg><option>--repeat-delay</option> <replaceable>seconds</replaceable></arg> + <arg><option>-S</option></arg> + <group choice='req'> + <arg choice='plain'><option>-f</option> <replaceable>file</replaceable></arg> + <arg choice='plain'><option>-l</option></arg> + <arg choice='plain'><option>-m</option> <replaceable>message</replaceable></arg> + <arg choice='plain'><option>-n</option></arg> + <arg choice='plain'><option>-s</option></arg> + </group> + <arg> + <option>--will-topic</option> <replaceable>topic</replaceable> + <arg><option>--will-payload</option> <replaceable>payload</replaceable></arg> + <arg><option>--will-qos</option> <replaceable>qos</replaceable></arg> + <arg><option>--will-retain</option></arg> + </arg> + <group> + <arg> + <group choice='req'> + <arg choice='plain'><option>--cafile</option> <replaceable>file</replaceable></arg> + <arg choice='plain'><option>--capath</option> <replaceable>dir</replaceable></arg> + </group> + <arg><option>--cert</option> <replaceable>file</replaceable></arg> + <arg><option>--key</option> <replaceable>file</replaceable></arg> + <arg><option>--ciphers</option> <replaceable>ciphers</replaceable></arg> + <arg><option>--tls-version</option> <replaceable>version</replaceable></arg> + <arg><option>--tls-alpn</option> <replaceable>protocol</replaceable></arg> + <arg><option>--tls-engine</option> <replaceable>engine</replaceable></arg> + <arg><option>--keyform</option> + <group choice='req'> + <arg choice='plain'><replaceable>pem</replaceable></arg> + <arg choice='plain'><replaceable>engine</replaceable></arg> + </group></arg> + <arg><option>--tls-engine-kpass-sha1</option> <replaceable>kpass-sha1</replaceable></arg> + <arg><option>--insecure</option></arg> + </arg> + <arg> + <arg choice='plain'><option>--psk</option> <replaceable>hex-key</replaceable></arg> + <arg choice='plain'><option>--psk-identity</option> <replaceable>identity</replaceable></arg> + <arg><option>--ciphers</option> <replaceable>ciphers</replaceable></arg> + <arg><option>--tls-version</option> <replaceable>version</replaceable></arg> + </arg> + </group> + <arg><option>--proxy</option> <replaceable>socks-url</replaceable></arg> + <arg><option>-V</option> <replaceable>protocol-version</replaceable></arg> + </cmdsynopsis> + <cmdsynopsis> + <command>mosquitto_pub</command> + <group choice='plain'> + <arg><option>--help</option></arg> + </group> + </cmdsynopsis> + </refsynopsisdiv> + + <refsect1> + <title>Description</title> + <para><command>mosquitto_pub</command> is a simple MQTT version 5/3.1.1 + client that will publish a single message on a topic and + exit.</para> + </refsect1> + + <refsect1> + <title>Encrypted Connections</title> + <para><command>mosquitto_pub</command> supports TLS encrypted + connections. It is strongly recommended that you use an encrypted + connection for anything more than the most basic setup.</para> + <para>To enable TLS connections when using x509 certificates, one of + either <option>--cafile</option> or <option>--capath</option> must + be provided as an option.</para> + <para>To enable TLS connections when using TLS-PSK, you must use the + <option>--psk</option> and the <option>--psk-identity</option> + options.</para> + </refsect1> + + <refsect1> + <title>Options</title> + <para>The options below may be given on the command line, but may also + be placed in a config file located at + <option>$XDG_CONFIG_HOME/mosquitto_pub</option> or + <option>$HOME/.config/mosquitto_sub</option> with one pair of + <option>-option <replaceable>value</replaceable></option> + per line. The values in the config file will be used as defaults + and can be overridden by using the command line. The exceptions to + this are the message type options, of which only one can be + specified. Note also that currently some options cannot be negated, + e.g. <option>-S</option>. Config file lines that have a + <option>#</option> as the first character are treated as comments + and not processed any further.</para> + <variablelist> + <varlistentry> + <term><option>-A</option></term> + <listitem> + <para>Bind the outgoing connection to a local ip + address/hostname. Use this argument if you need to + restrict network communication to a particular + interface.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-c</option></term> + <term><option>--disable-clean-session</option></term> + <listitem> + <para>Disable the 'clean session' flag. This means that all + of the subscriptions for the client will be maintained + after it disconnects, along with subsequent QoS 1 and QoS 2 + messages that arrive. When the client reconnects, it will + receive all of the queued messages.</para> + <para>If using this option, the client id must be set + manually with <option>--id</option></para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--cafile</option></term> + <listitem> + <para>Define the path to a file containing PEM encoded CA + certificates that are trusted. Used to enable SSL + communication.</para> + <para>See also <option>--capath</option></para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--capath</option></term> + <listitem> + <para>Define the path to a directory containing PEM encoded CA + certificates that are trusted. Used to enable SSL + communication.</para> + <para>For <option>--capath</option> to work correctly, the + certificate files must have ".crt" as the file ending + and you must run "openssl rehash <path to capath>" each + time you add/remove a certificate.</para> + <para>See also <option>--cafile</option></para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--cert</option></term> + <listitem> + <para>Define the path to a file containing a PEM encoded + certificate for this client, if required by the + server.</para> + <para>See also <option>--key</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--ciphers</option></term> + <listitem> + <para>An openssl compatible list of TLS ciphers to support + in the client. See + <citerefentry><refentrytitle>ciphers</refentrytitle><manvolnum>1</manvolnum></citerefentry> + for more information.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-d</option></term> + <term><option>--debug</option></term> + <listitem> + <para>Enable debug messages.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-D</option></term> + <term><option>--property</option></term> + <listitem> + <para>Use an MQTT v5 property with this publish. If you use + this option, the client will be set to be an MQTT v5 + client. This option has two forms:</para> + <para><option>-D command identifier value</option></para> + <para><option>-D command identifier name value</option></para> + <para><option>command</option> is the MQTT command/packet + identifier and can be one of CONNECT, PUBLISH, PUBREL, + DISCONNECT, AUTH, or WILL. The properties available for + each command are listed in the + <link linkend='properties'>Properties</link> + section.</para> + + <para><option>identifier</option> is the name of the + property to add. This is as described in the + specification, but with '-' as a word separator. For + example: + <option>payload-format-indicator</option>. More details + are in the <link linkend='properties'>Properties</link> + section.</para> + + <para><option>value</option> is the value of the property + to add, with a data type that is property + specific.</para> + + <para><option>name</option> is only used for the + <option>user-property</option> property as the first of + the two strings in the string pair. In that case, + <option>value</option> is the second of the strings in + the pair.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-f</option></term> + <term><option>--file</option></term> + <listitem> + <para>Send the contents of a file as the message.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--help</option></term> + <listitem> + <para>Display usage information.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-h</option></term> + <term><option>--host</option></term> + <listitem> + <para>Specify the host to connect to. Defaults to localhost.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-i</option></term> + <term><option>--id</option></term> + <listitem> + <para>The id to use for this client. If not given, defaults + to mosquitto_pub_ appended with the process id of the + client. Cannot be used at the same time as the + <option>--id-prefix</option> argument.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-I</option></term> + <term><option>--id-prefix</option></term> + <listitem> + <para>Provide a prefix that the client id will be built + from by appending the process id of the client. This is + useful where the broker is using the clientid_prefixes + option. Cannot be used at the same time as the + <option>--id</option> argument.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--insecure</option></term> + <listitem> + <para>When using certificate based encryption, this option + disables verification of the server hostname in the + server certificate. This can be useful when testing + initial server configurations but makes it possible for + a malicious third party to impersonate your server + through DNS spoofing, for example. Use this option in + testing <emphasis>only</emphasis>. If you need to + resort to using this option in a production + environment, your setup is at fault and there is no + point using encryption.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-k</option></term> + <term><option>--keepalive</option></term> + <listitem> + <para>The number of seconds between sending PING commands + to the broker for the purposes of informing it we are still + connected and functioning. Defaults to 60 seconds.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--key</option></term> + <listitem> + <para>Define the path to a file containing a PEM encoded + private key for this client, if required by the + server.</para> + <para>See also <option>--cert</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--keyform</option></term> + <listitem> + <para>Specifies the type of private key in use when making + TLS connections.. This can be "pem" or "engine". This + parameter is useful when a TPM module is being used and + the private key has been created with it. Defaults to + "pem", which means normal private key files are + used.</para> + <para>See also <option>--tls-engine</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-L</option></term> + <term><option>--url</option></term> + <listitem> + <para>Specify specify user, password, hostname, port and + topic at once as a URL. The URL must be in the form: + mqtt(s)://[username[:password]@]host[:port]/topic</para> + <para>If the scheme is mqtt:// then the port defaults to + 1883. If the scheme is mqtts:// then the port defaults + to 8883.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-l</option></term> + <term><option>--stdin-line</option></term> + <listitem> + <para>Send messages read from stdin, splitting separate lines into separate messages. Note that blank lines won't be sent.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-m</option></term> + <term><option>--message</option></term> + <listitem> + <para>Send a single message from the command line.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-n</option></term> + <term><option>--null-message</option></term> + <listitem> + <para>Send a null (zero length) message.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-p</option></term> + <term><option>--port</option></term> + <listitem> + <para>Connect to the port specified. If not given, the + default of 1883 for plain MQTT or 8883 for MQTT over + TLS will be used.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-P</option></term> + <term><option>--pw</option></term> + <listitem> + <para>Provide a password to be used for authenticating with + the broker. Using this argument without also specifying + a username is invalid when using MQTT v3.1 or v3.1.1. + See also the <option>--username</option> option.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--proxy</option></term> + <listitem> + <para>Specify a SOCKS5 proxy to connect through. "None" and + "username" authentication types are supported. The + <option>socks-url</option> must be of the form + <option>socks5h://[username[:password]@]host[:port]</option>. + The protocol prefix <option>socks5h</option> means that + hostnames are resolved by the proxy. The symbols %25, + %3A and %40 are URL decoded into %, : and @ + respectively, if present in the username or + password.</para> + <para>If username is not given, then no authentication is + attempted. If the port is not given, then the default + of 1080 is used.</para> + <para>More SOCKS versions may be available in the future, + depending on demand, and will use different protocol + prefixes as described in <citerefentry> + <refentrytitle>curl</refentrytitle> + <manvolnum>1</manvolnum> </citerefentry>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--psk</option></term> + <listitem> + <para>Provide the hexadecimal (no leading 0x) + pre-shared-key matching the one used on the broker to + use TLS-PSK encryption support. + <option>--psk-identity</option> must also be provided + to enable TLS-PSK.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--psk-identity</option></term> + <listitem> + <para>The client identity to use with TLS-PSK support. This + may be used instead of a username if the broker is + configured to do so.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-q</option></term> + <term><option>--qos</option></term> + <listitem> + <para>Specify the quality of service to use for the message, from 0, 1 and 2. Defaults to 0.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--quiet</option></term> + <listitem> + <para>If this argument is given, no runtime errors will be + printed. This excludes any error messages given in case of + invalid user input (e.g. using <option>--port</option> without a + port).</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-r</option></term> + <term><option>--retain</option></term> + <listitem> + <para>If retain is given, the message will be retained as a "last known good" value on the broker. See <citerefentry><refentrytitle>mqtt</refentrytitle><manvolnum>7</manvolnum></citerefentry> for more information.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--repeat</option></term> + <listitem> + <para>If the publish mode is<option>-m</option>, + <option>-f</option>, or <option>-s</option> (i.e. the modes + where only a single message is sent), then + <option>--repeat</option> can be used to specify that the + message will be published multiple times.</para> + <para>See also <option>--repeat-delay</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--repeat-delay</option></term> + <listitem> + <para>If using <option>--repeat</option>, then the default + behaviour is to publish repeated messages as soon as the + previous message is delivered. Use + <option>--repeat-delay</option> to specify the number of + seconds to wait after the previous message was delivered + before publishing the next. Does not need to be an integer + number of seconds.</para> + <para>Note that there is no guarantee as to the actual interval + between messages, this option simply defines the minimum + time from delivery of one message to the start of the + publish of the next.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-s</option></term> + <term><option>--stdin-file</option></term> + <listitem> + <para>Send a message read from stdin, sending the entire content as a single message.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-S</option></term> + <listitem> + <para>Use SRV lookups to determine which host to connect + to. Performs lookups to + <option>_mqtt._tcp.<host></option> when used in + conjunction with <option>-h</option>, otherwise uses + <option>_mqtt._tcp.<local dns + domain></option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-t</option></term> + <term><option>--topic</option></term> + <listitem> + <para>The MQTT topic on which to publish the message. See <citerefentry><refentrytitle>mqtt</refentrytitle><manvolnum>7</manvolnum></citerefentry> for more information on MQTT topics.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--tls-alpn</option></term> + <listitem> + <para>Provide a protocol to use when connecting to a broker + that has multiple protocols available on a single port, + e.g. MQTT and WebSockets.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--tls-engine</option></term> + <listitem> + <para>A valid openssl engine id. These can be listed with + openssl engine command.</para> + <para>See also <option>--keyform</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--tls-engine-kpass-sha1</option></term> + <listitem> + <para>SHA1 of the private key password when using an TLS + engine. Some TLS engines such as the TPM engine may + require the use of a password in order to be accessed. + This option allows a hex encoded SHA1 hash of the + password to the engine directly, instead of the user + being prompted for the password.</para> + <para>See also <option>--tls-engine</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--tls-version</option></term> + <listitem> + <para>Choose which TLS protocol version to use when + communicating with the broker. Valid options are + <option>tlsv1.3</option>, <option>tlsv1.2</option> and + <option>tlsv1.1</option>. The default value is + <option>tlsv1.2</option>. Must match the protocol + version used by the broker.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-u</option></term> + <term><option>--username</option></term> + <listitem> + <para>Provide a username to be used for authenticating with + the broker. See also the <option>--pw</option> + argument.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-V</option></term> + <term><option>--protocol-version</option></term> + <listitem> + <para>Specify which version of the MQTT protocol should be + used when connecting to the rmeote broker. Can be + <option>5</option>, <option>311</option>, + <option>31</option>, or the more verbose + <option>mqttv5</option>, <option>mqttv311</option>, or + <option>mqttv31</option>. + Defaults to <option>311</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--will-payload</option></term> + <listitem> + <para>Specify a message that will be stored by the broker + and sent out if this client disconnects unexpectedly. This + must be used in conjunction with <option>--will-topic</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--will-qos</option></term> + <listitem> + <para>The QoS to use for the Will. Defaults to 0. This must + be used in conjunction with <option>--will-topic</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--will-retain</option></term> + <listitem> + <para>If given, if the client disconnects unexpectedly the + message sent out will be treated as a retained message. + This must be used in conjunction with <option>--will-topic</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--will-topic</option></term> + <listitem> + <para>The topic on which to send a Will, in the event that + the client disconnects unexpectedly.</para> + </listitem> + </varlistentry> + </variablelist> + </refsect1> + + <refsect1> + <title>Wills</title> + <para>mosquitto_sub can register a message with the broker that will be + sent out if it disconnects unexpectedly. See + <citerefentry><refentrytitle>mqtt</refentrytitle><manvolnum>7</manvolnum></citerefentry> + for more information.</para> + <para>The minimum requirement for this is to use <option>--will-topic</option> to + specify which topic the will should be sent out on. This will result in + a non-retained, zero length message with QoS 0.</para> + <para>Use the <option>--will-retain</option>, + <option>--will-payload</option> and <option>--will-qos</option> + arguments to modify the other will parameters.</para> + </refsect1> + + <refsect1 id='properties'> + <title>Properties</title> + <para>The <option>-D</option> / <option>--property</option> option + allows adding properties to different stages of the mosquitto_pub + run. The properties supported for each command are as + follows:</para> + + <refsect2> + <title>Connect</title> + <itemizedlist> + <listitem><para><option>authentication-data</option> (binary data - note treated as a string in mosquitto_pub)</para></listitem> + <listitem><para><option>authentication-method</option> (UTF-8 string pair)</para></listitem> + <listitem><para><option>maximum-packet-size</option> (32-bit unsigned integer)</para></listitem> + <listitem><para><option>receive-maximum</option> (16-bit unsigned integer)</para></listitem> + <listitem><para><option>request-problem-information</option> (8-bit unsigned integer)</para></listitem> + <listitem><para><option>request-response-information</option> (8-bit unsigned integer)</para></listitem> + <listitem><para><option>session-expiry-interval</option> (32-bit unsigned integer)</para></listitem> + <listitem><para><option>topic-alias-maximum</option> (16-bit unsigned integer)</para></listitem> + <listitem><para><option>user-property</option> (UTF-8 string pair)</para></listitem> + </itemizedlist> + </refsect2> + + <refsect2> + <title>Publish</title> + <itemizedlist> + <listitem><para><option>content-type</option> (UTF-8 string)</para></listitem> + <listitem><para><option>correlation-data</option> (binary data - note treated as a string in mosquitto_pub)</para></listitem> + <listitem><para><option>message-expiry-interval</option> (32-bit unsigned integer)</para></listitem> + <listitem><para><option>payload-format-indicator</option> (8-bit unsigned integer)</para></listitem> + <listitem><para><option>response-topic</option> (UTF-8 string)</para></listitem> + <listitem><para><option>topic-alias</option> (16-bit unsigned integer)</para></listitem> + <listitem><para><option>user-property</option> (UTF-8 string pair)</para></listitem> + </itemizedlist> + </refsect2> + + <refsect2> + <title>Disconnect</title> + <itemizedlist> + <listitem><para><option>session-expiry-interval</option> (32-bit unsigned integer)</para></listitem> + <listitem><para><option>user-property</option> (UTF-8 string pair)</para></listitem> + </itemizedlist> + </refsect2> + + <refsect2> + <title>Will properties</title> + <itemizedlist> + <listitem><para><option>content-type</option> (UTF-8 string)</para></listitem> + <listitem><para><option>correlation-data</option> (binary data - note treated as a string in mosquitto_pub)</para></listitem> + <listitem><para><option>message-expiry-interval</option> (32-bit unsigned integer)</para></listitem> + <listitem><para><option>payload-format-indicator</option> (8-bit unsigned integer)</para></listitem> + <listitem><para><option>response-topic</option> (UTF-8 string)</para></listitem> + <listitem><para><option>user-property</option> (UTF-8 string pair)</para></listitem> + <listitem><para><option>will-delay-interval</option> (32-bit unsigned integer)</para></listitem> + </itemizedlist> + </refsect2> + </refsect1> + + <refsect1> + <title>Examples</title> + <para>Publish temperature information to localhost with QoS 1:</para> + <itemizedlist mark="circle"> + <listitem><para>mosquitto_pub <literal>-t</literal> sensors/temperature <literal>-m</literal> 32 <literal>-q</literal> 1</para></listitem> + </itemizedlist> + <para>Publish timestamp and temperature information to a remote host on a non-standard port and QoS 0:</para> + <itemizedlist mark="circle"> + <listitem><para>mosquitto_pub <literal>-h</literal> 192.168.1.1 + <literal>-p</literal> 1885 <literal>-t</literal> + sensors/temperature <literal>-m</literal> "1266193804 + 32"</para></listitem> + </itemizedlist> + <para>Publish light switch status. Message is set to retained because there may be a long period of time between light switch events:</para> + <itemizedlist mark="circle"> + <listitem><para>mosquitto_pub <literal>-r</literal> <literal>-t</literal> switches/kitchen_lights/status <literal>-m</literal> "on"</para></listitem> + </itemizedlist> + <para>Send the contents of a file in two ways:</para> + <itemizedlist mark="circle"> + <listitem><para>mosquitto_pub <literal>-t</literal> my/topic <literal>-f</literal> ./data</para></listitem> + <listitem><para>mosquitto_pub <literal>-t</literal> my/topic <literal>-s</literal> < ./data</para></listitem> + </itemizedlist> + <para>Send parsed electricity usage data from a Current Cost meter, reading from stdin with one line/reading as one message:</para> + <itemizedlist mark="circle"> + <listitem><para>read_cc128.pl | mosquitto_pub <literal>-t</literal> sensors/cc128 <literal>-l</literal></para></listitem> + </itemizedlist> + </refsect1> + + <refsect1> + <title>Files</title> + <variablelist> + <varlistentry> + <term><filename>$XDG_CONFIG_HOME/mosquitto_pub</filename></term> + <term><filename>$HOME/.config/mosquitto_pub</filename></term> + <listitem> + <para>Configuration file for default options.</para> + </listitem> + </varlistentry> + </variablelist> + </refsect1> + + <refsect1> + <title>Bugs</title> + <para><command>mosquitto</command> bug information can be found at + <ulink url="https://github.com/eclipse/mosquitto/issues"/></para> + </refsect1> + + <refsect1> + <title>See Also</title> + <simplelist type="inline"> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mqtt-7.html">mqtt</link></refentrytitle> + <manvolnum>7</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto_rr-1.html">mosquitto_rr</link></refentrytitle> + <manvolnum>1</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto_sub-1.html">mosquitto_sub</link></refentrytitle> + <manvolnum>1</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto-8.html">mosquitto</link></refentrytitle> + <manvolnum>8</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="libmosquitto-3.html">libmosquitto</link></refentrytitle> + <manvolnum>3</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto-tls-7.html">mosquitto-tls</link></refentrytitle> + <manvolnum>7</manvolnum> + </citerefentry> + </member> + </simplelist> + </refsect1> + + <refsect1> + <title>Author</title> + <para>Roger Light <email>roger@atchoo.org</email></para> + </refsect1> +</refentry> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_rr.1 b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_rr.1 new file mode 100644 index 0000000..0c07a4a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_rr.1 @@ -0,0 +1,1115 @@ +'\" t +.\" Title: mosquitto_rr +.\" Author: [see the "Author" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> +.\" Date: 06/18/2019 +.\" Manual: Commands +.\" Source: Mosquitto Project +.\" Language: English +.\" +.TH "MOSQUITTO_RR" "1" "06/18/2019" "Mosquitto Project" "Commands" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +mosquitto_rr \- an MQTT version 5/3\&.1\&.1 client for request/response messaging +.SH "SYNOPSIS" +.HP \w'\fBmosquitto_rr\fR\ 'u +\fBmosquitto_rr\fR {[\fB\-h\fR\ \fIhostname\fR]\ [\fB\-p\fR\ \fIport\-number\fR]\ [\fB\-u\fR\ \fIusername\fR]\ [\fB\-P\fR\ \fIpassword\fR]\ \fB\-t\fR\ \fImessage\-topic\fR... | \fB\-L\fR\ \fIURL\fR\ [\fB\-t\fR\ \fImessage\-topic\fR...] | [\fB\-e\fR\ \fIresponse\-topic\fR]} {\fB\-f\fR\ \fIfile\fR | \fB\-m\fR\ \fImessage\fR | \fB\-n\fR | \fB\-s\fR} [\fB\-A\fR\ \fIbind\-address\fR] [\fB\-c\fR] [\fB\-d\fR] [\fB\-D\fR\ \fIcommand\fR\ \fIidentifier\fR\ \fIvalue\fR] [\fB\-i\fR\ \fIclient\-id\fR] [\fB\-I\fR\ \fIclient\-id\-prefix\fR] [\fB\-k\fR\ \fIkeepalive\-time\fR] [\fB\-N\fR] [\fB\-q\fR\ \fImessage\-QoS\fR] [\fB\-R\fR] [\fB\-S\fR] [\fB\-v\fR] [\fB\-V\fR\ \fIprotocol\-version\fR] [\fB\-W\fR\ \fImessage\-processing\-timeout\fR] [\fB\-\-proxy\fR\ \fIsocks\-url\fR] [\fB\-\-quiet\fR] [\fB\-\-will\-topic\fR\ \fItopic\fR\ [\fB\-\-will\-payload\fR\ \fIpayload\fR]\ [\fB\-\-will\-qos\fR\ \fIqos\fR]\ [\fB\-\-will\-retain\fR]] [[{\fB\-\-cafile\fR\ \fIfile\fR\ |\ \fB\-\-capath\fR\ \fIdir\fR}\ [\fB\-\-cert\fR\ \fIfile\fR]\ [\fB\-\-key\fR\ \fIfile\fR]\ [\fB\-\-ciphers\fR\ \fIciphers\fR]\ [\fB\-\-tls\-version\fR\ \fIversion\fR]\ [\fB\-\-tls\-alpn\fR\ \fIprotocol\fR]\ [\fB\-\-tls\-engine\fR\ \fIengine\fR]\ [\fB\-\-keyform\fR\ {\fIpem\fR\ |\ \fIengine\fR}]\ [\fB\-\-tls\-engine\-kpass\-sha1\fR\ \fIkpass\-sha1\fR]\ [\fB\-\-insecure\fR]] | [\fB\-\-psk\fR\ \fIhex\-key\fR\ \fB\-\-psk\-identity\fR\ \fIidentity\fR\ [\fB\-\-ciphers\fR\ \fIciphers\fR]\ [\fB\-\-tls\-version\fR\ \fIversion\fR]]] +.HP \w'\fBmosquitto_rr\fR\ 'u +\fBmosquitto_rr\fR [\fB\-\-help\fR] +.SH "DESCRIPTION" +.PP +\fBmosquitto_rr\fR +is an MQTT version 5/3\&.1\&.1 client that can be used to publish a request message and wait for a response\&. When using MQTT v5, which is the default, +\fBmosquitto_rr\fR +will use the Request\-Response feature\&. +.SH "ENCRYPTED CONNECTIONS" +.PP +\fBmosquitto_rr\fR +supports TLS encrypted connections\&. It is strongly recommended that you use an encrypted connection for anything more than the most basic setup\&. +.PP +To enable TLS connections when using x509 certificates, one of either +\fB\-\-cafile\fR +or +\fB\-\-capath\fR +must be provided as an option\&. +.PP +To enable TLS connections when using TLS\-PSK, you must use the +\fB\-\-psk\fR +and the +\fB\-\-psk\-identity\fR +options\&. +.SH "OPTIONS" +.PP +The options below may be given on the command line, but may also be placed in a config file located at +\fB$XDG_CONFIG_HOME/mosquitto_rr\fR +or +\fB$HOME/\&.config/mosquitto_rr\fR +with one pair of +\fB\-option \fR\fB\fIvalue\fR\fR +per line\&. The values in the config file will be used as defaults and can be overridden by using the command line\&. The exceptions to this is +\fB\-t\fR, which if given in the config file will not be overridden\&. Note also that currently some options cannot be negated, e\&.g\&. +\fB\-S\fR\&. Config file lines that have a +\fB#\fR +as the first character are treated as comments and not processed any further\&. +.PP +\fB\-A\fR +.RS 4 +Bind the outgoing connection to a local ip address/hostname\&. Use this argument if you need to restrict network communication to a particular interface\&. +.RE +.PP +\fB\-c\fR, \fB\-\-disable\-clean\-session\fR +.RS 4 +Disable the \*(Aqclean session\*(Aq flag\&. This means that all of the subscriptions for the client will be maintained after it disconnects, along with subsequent QoS 1 and QoS 2 messages that arrive\&. When the client reconnects, it will receive all of the queued messages\&. +.sp +If using this option, the client id must be set manually with +\fB\-\-id\fR +.RE +.PP +\fB\-\-cafile\fR +.RS 4 +Define the path to a file containing PEM encoded CA certificates that are trusted\&. Used to enable SSL communication\&. +.sp +See also +\fB\-\-capath\fR +.RE +.PP +\fB\-\-capath\fR +.RS 4 +Define the path to a directory containing PEM encoded CA certificates that are trusted\&. Used to enable SSL communication\&. +.sp +For +\fB\-\-capath\fR +to work correctly, the certificate files must have "\&.crt" as the file ending and you must run "openssl rehash <path to capath>" each time you add/remove a certificate\&. +.sp +See also +\fB\-\-cafile\fR +.RE +.PP +\fB\-\-cert\fR +.RS 4 +Define the path to a file containing a PEM encoded certificate for this client, if required by the server\&. +.sp +See also +\fB\-\-key\fR\&. +.RE +.PP +\fB\-\-ciphers\fR +.RS 4 +An openssl compatible list of TLS ciphers to support in the client\&. See +\fBciphers\fR(1) +for more information\&. +.RE +.PP +\fB\-d\fR, \fB\-\-debug\fR +.RS 4 +Enable debug messages\&. +.RE +.PP +\fB\-D\fR, \fB\-\-property\fR +.RS 4 +Use an MQTT v5 property with this publish\&. If you use this option, the client will be set to be an MQTT v5 client\&. This option has two forms: +.sp +\fB\-D command identifier value\fR +.sp +\fB\-D command identifier name value\fR +.sp +\fBcommand\fR +is the MQTT command/packet identifier and can be one of CONNECT, PUBACK, PUBREC, PUBCOMP, SUBSCRIBE, UNSUBSCRIBE, DISCONNECT, AUTH, or WILL\&. The properties available for each command are listed in the Properties section\&. +.sp +\fBidentifier\fR +is the name of the property to add\&. This is as described in the specification, but with \*(Aq\-\*(Aq as a word separator\&. For example: +\fBpayload\-format\-indicator\fR\&. More details are in the +Properties +section\&. +.sp +\fBvalue\fR +is the value of the property to add, with a data type that is property specific\&. +.sp +\fBname\fR +is only used for the +\fBuser\-property\fR +property as the first of the two strings in the string pair\&. In that case, +\fBvalue\fR +is the second of the strings in the pair\&. +.RE +.PP +\fB\-f\fR, \fB\-\-file\fR +.RS 4 +Send the contents of a file as the request message\&. +.RE +.PP +\fB\-F\fR +.RS 4 +Specify output printing format\&. This option allows you to choose what information from each message is printed to the screen\&. See the +Output Format +section below for full details\&. +.sp +This option overrides the +\fB\-v\fR +option, but does not override the +\fB\-N\fR +option\&. +.RE +.PP +\fB\-\-help\fR +.RS 4 +Display usage information\&. +.RE +.PP +\fB\-h\fR, \fB\-\-host\fR +.RS 4 +Specify the host to connect to\&. Defaults to localhost\&. +.RE +.PP +\fB\-i\fR, \fB\-\-id\fR +.RS 4 +The id to use for this client\&. If not given, defaults to mosquitto_rr_ appended with the process id of the client\&. Cannot be used at the same time as the +\fB\-\-id\-prefix\fR +argument\&. +.RE +.PP +\fB\-I\fR, \fB\-\-id\-prefix\fR +.RS 4 +Provide a prefix that the client id will be built from by appending the process id of the client\&. This is useful where the broker is using the clientid_prefixes option\&. Cannot be used at the same time as the +\fB\-\-id\fR +argument\&. +.RE +.PP +\fB\-\-insecure\fR +.RS 4 +When using certificate based encryption, this option disables verification of the server hostname in the server certificate\&. This can be useful when testing initial server configurations but makes it possible for a malicious third party to impersonate your server through DNS spoofing, for example\&. Use this option in testing +\fIonly\fR\&. If you need to resort to using this option in a production environment, your setup is at fault and there is no point using encryption\&. +.RE +.PP +\fB\-k\fR, \fB\-\-keepalive\fR +.RS 4 +The number of seconds between sending PING commands to the broker for the purposes of informing it we are still connected and functioning\&. Defaults to 60 seconds\&. +.RE +.PP +\fB\-\-key\fR +.RS 4 +Define the path to a file containing a PEM encoded private key for this client, if required by the server\&. +.sp +See also +\fB\-\-cert\fR\&. +.RE +.PP +\fB\-\-keyform\fR +.RS 4 +Specifies the type of private key in use when making TLS connections\&.\&. This can be "pem" or "engine"\&. This parameter is useful when a TPM module is being used and the private key has been created with it\&. Defaults to "pem", which means normal private key files are used\&. +.sp +See also +\fB\-\-tls\-engine\fR\&. +.RE +.PP +\fB\-L\fR, \fB\-\-url\fR +.RS 4 +Specify specify user, password, hostname, port and topic at once as a URL\&. The URL must be in the form: mqtt(s)://[username[:password]@]host[:port]/topic +.sp +If the scheme is mqtt:// then the port defaults to 1883\&. If the scheme is mqtts:// then the port defaults to 8883\&. +.RE +.PP +\fB\-m\fR, \fB\-\-message\fR +.RS 4 +Send a single request message from the command line\&. +.RE +.PP +\fB\-N\fR +.RS 4 +Do not append an end of line character to the payload when printing\&. This allows streaming of payload data from multiple messages directly to another application unmodified\&. Only really makes sense when not using +\fB\-v\fR\&. +.RE +.PP +\fB\-n\fR, \fB\-\-null\-message\fR +.RS 4 +Send a null (zero length) request message\&. +.RE +.PP +\fB\-p\fR, \fB\-\-port\fR +.RS 4 +Connect to the port specified\&. If not given, the default of 1883 for plain MQTT or 8883 for MQTT over TLS will be used\&. +.RE +.PP +\fB\-P\fR, \fB\-\-pw\fR +.RS 4 +Provide a password to be used for authenticating with the broker\&. Using this argument without also specifying a username is invalid when using MQTT v3\&.1 or v3\&.1\&.1\&. See also the +\fB\-\-username\fR +option\&. +.RE +.PP +\fB\-\-proxy\fR +.RS 4 +Specify a SOCKS5 proxy to connect through\&. "None" and "username" authentication types are supported\&. The +\fBsocks\-url\fR +must be of the form +\fBsocks5h://[username[:password]@]host[:port]\fR\&. The protocol prefix +\fBsocks5h\fR +means that hostnames are resolved by the proxy\&. The symbols %25, %3A and %40 are URL decoded into %, : and @ respectively, if present in the username or password\&. +.sp +If username is not given, then no authentication is attempted\&. If the port is not given, then the default of 1080 is used\&. +.sp +More SOCKS versions may be available in the future, depending on demand, and will use different protocol prefixes as described in +\fBcurl\fR(1)\&. +.RE +.PP +\fB\-\-psk\fR +.RS 4 +Provide the hexadecimal (no leading 0x) pre\-shared\-key matching the one used on the broker to use TLS\-PSK encryption support\&. +\fB\-\-psk\-identity\fR +must also be provided to enable TLS\-PSK\&. +.RE +.PP +\fB\-\-psk\-identity\fR +.RS 4 +The client identity to use with TLS\-PSK support\&. This may be used instead of a username if the broker is configured to do so\&. +.RE +.PP +\fB\-q\fR, \fB\-\-qos\fR +.RS 4 +Specify the quality of service desired for the incoming messages, from 0, 1 and 2\&. Defaults to 0\&. See +\fBmqtt\fR(7) +for more information on QoS\&. +.sp +The QoS is identical for all topics subscribed to in a single instance of mosquitto_rr\&. +.RE +.PP +\fB\-\-quiet\fR +.RS 4 +If this argument is given, no runtime errors will be printed\&. This excludes any error messages given in case of invalid user input (e\&.g\&. using +\fB\-\-port\fR +without a port)\&. +.RE +.PP +\fB\-R\fR +.RS 4 +If this argument is given, messages that are received that have the retain bit set will not be printed\&. Messages with retain set are "stale", in that it is not known when they were originally published\&. When subscribing to a wildcard topic there may be a large number of retained messages\&. This argument suppresses their display\&. +.RE +.PP +\fB\-S\fR +.RS 4 +Use SRV lookups to determine which host to connect to\&. Performs lookups to +\fB_mqtt\&._tcp\&.<host>\fR +when used in conjunction with +\fB\-h\fR, otherwise uses +\fB_mqtt\&._tcp\&.<local dns domain>\fR\&. +.RE +.PP +\fB\-s\fR, \fB\-\-stdin\-file\fR +.RS 4 +Send a request message read from stdin, sending the entire content as a single message\&. +.RE +.PP +\fB\-t\fR, \fB\-\-topic\fR +.RS 4 +The MQTT topic to subscribe to, where responses will be waited for\&. See +\fBmqtt\fR(7) +for more information on MQTT topics\&. +.sp +This option may be repeated to subscribe to multiple topics\&. +.RE +.PP +\fB\-\-tls\-alpn\fR +.RS 4 +Provide a protocol to use when connecting to a broker that has multiple protocols available on a single port, e\&.g\&. MQTT and WebSockets\&. +.RE +.PP +\fB\-\-tls\-engine\fR +.RS 4 +A valid openssl engine id\&. These can be listed with openssl engine command\&. +.sp +See also +\fB\-\-keyform\fR\&. +.RE +.PP +\fB\-\-tls\-engine\-kpass\-sha1\fR +.RS 4 +SHA1 of the private key password when using an TLS engine\&. Some TLS engines such as the TPM engine may require the use of a password in order to be accessed\&. This option allows a hex encoded SHA1 hash of the password to the engine directly, instead of the user being prompted for the password\&. +.sp +See also +\fB\-\-tls\-engine\fR\&. +.RE +.PP +\fB\-\-tls\-version\fR +.RS 4 +Choose which TLS protocol version to use when communicating with the broker\&. Valid options are +\fBtlsv1\&.3\fR, +\fBtlsv1\&.2\fR +and +\fBtlsv1\&.1\fR\&. The default value is +\fBtlsv1\&.2\fR\&. Must match the protocol version used by the broker\&. +.RE +.PP +\fB\-u\fR, \fB\-\-username\fR +.RS 4 +Provide a username to be used for authenticating with the broker\&. See also the +\fB\-\-pw\fR +argument\&. +.RE +.PP +\fB\-v\fR, \fB\-\-verbose\fR +.RS 4 +Print received messages verbosely\&. With this argument, messages will be printed as "topic payload"\&. When this argument is not given, the messages are printed as "payload"\&. +.RE +.PP +\fB\-V\fR, \fB\-\-protocol\-version\fR +.RS 4 +Specify which version of the MQTT protocol should be used when connecting to the rmeote broker\&. Can be +\fB5\fR, +\fB311\fR, +\fB31\fR, or the more verbose +\fBmqttv5\fR, +\fBmqttv311\fR, or +\fBmqttv31\fR\&. Defaults to +\fB311\fR\&. +.RE +.PP +\fB\-\-will\-payload\fR +.RS 4 +Specify a message that will be stored by the broker and sent out if this client disconnects unexpectedly\&. This must be used in conjunction with +\fB\-\-will\-topic\fR\&. +.RE +.PP +\fB\-\-will\-qos\fR +.RS 4 +The QoS to use for the Will\&. Defaults to 0\&. This must be used in conjunction with +\fB\-\-will\-topic\fR\&. +.RE +.PP +\fB\-\-will\-retain\fR +.RS 4 +If given, if the client disconnects unexpectedly the message sent out will be treated as a retained message\&. This must be used in conjunction with +\fB\-\-will\-topic\fR\&. +.RE +.PP +\fB\-\-will\-topic\fR +.RS 4 +The topic on which to send a Will, in the event that the client disconnects unexpectedly\&. +.RE +.SH "OUTPUT FORMAT" +.PP +There are three ways of formatting the output from mosquitto_rr\&. In all cases a new\-line character is appended for each message received unless the +\fB\-N\fR +argument is passed to mosquitto_rr\&. +.PP +Payload\-only is the default output format and will print the payload exactly as it is received\&. +.PP +Verbose mode is activated with +\fB\-v\fR +and prints the message topic and the payload, separated by a space\&. +.PP +The final option is formatted output, which allows the user to define a custom output format\&. The behaviour is controlled with the +\fB\-F format\-string\fR +option\&. The format string is a free text string where interpreted sequences are replaced by different parameters\&. The available interpreted sequences are described below\&. +.PP +Three characters are used to start an interpreted sequence: +\fB%\fR, +\fB@\fR +and +\fB\e\fR\&. Sequences starting with +\fB%\fR +are either parameters related to the MQTT message being printed, or are helper sequences to avoid the need to type long date format strings for example\&. Sequences starting with +\fB@\fR +are passed to the +\fBstrftime\fR(3) +function (with the @ replaced with a % \- note that only the character immediately after the @ is passed to strftime)\&. This allows the construction of a wide variety of time based outputs\&. The output options for strftime vary from platform to platform, so please check what is available for your platform\&. mosquitto_rr does provide one extension to strftime which is +\fB@N\fR, which can be used to obtain the number of nanoseconds passed in the current second\&. The resolution of this option varies depending on the platform\&. The final sequence character is +\fB\e\fR, which is used to input some characters that would otherwise be difficult to enter\&. +.SS "MQTT related parameters" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%%\fR +a literal %\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%l\fR +the length of the payload in bytes\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%m\fR +the message id (only relevant for messages with QoS>0)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%p\fR +the payload raw bytes (may produce non\-printable characters depending on the payload)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%q\fR +the message QoS\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%r\fR +the retained flag for the message\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%t\fR +the message topic\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%x\fR +the payload with each byte as a hexadecimal number (lower case)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%X\fR +the payload with each byte as a hexadecimal number (upper case)\&. +.RE +.SS "Helpers" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%I\fR +ISO\-8601 format date and time, e\&.g\&. 2016\-08\-10T09:47:38+0100 +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%j\fR +JSON output of message parameters and timestamp, with a quoted and escaped payload\&. For example +{"tst":1470825369,"topic":"greeting","qos":0,"retain":0,"payload":"hello world"} +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%J\fR +JSON output of message parameters and timestamp, with a non\-quoted and non\-escaped payload \- this means the payload must itself be valid JSON\&. For example: +{"tst":1470825369,"topic":"foo","qos":0,"retain":0,"payload":{"temperature":27\&.0,"humidity":57}}\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%I\fR +ISO\-8601 format date and time, e\&.g\&. 2016\-08\-10T09:47:38+0100 +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%U\fR +Unix timestamp with nanoseconds, e\&.g\&. 1470818943\&.786368637 +.RE +.SS "Time related parameters" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB@@\fR +a literal @\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB@X\fR +pass the character represented by +\fBX\fR +to the strftime function as +\fB%X\fR\&. The options supported are platform dependent\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB@N\fR +the number of nanoseconds that have passed in the current second, with varying timing resolution depending on platform\&. +.RE +.SS "Escape characters" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\e\e\fR +a literal \e\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\e0\fR +a null character\&. Can be used to separate different parameters that may contain spaces (e\&.g\&. topic, payload) so that processing with tools such as +\fBxargs\fR(1) +is easier\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\ea\fR +alert/bell\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\ee\fR +the escape sequence, which can be used with ANSI colour codes to provide coloured output for example\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\en\fR +end of line\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\er\fR +carriage return\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\et\fR +horizontal tab\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\ev\fR +vertical tab\&. +.RE +.SH "WILLS" +.PP +mosquitto_rr can register a message with the broker that will be sent out if it disconnects unexpectedly\&. See +\fBmqtt\fR(7) +for more information\&. +.PP +The minimum requirement for this is to use +\fB\-\-will\-topic\fR +to specify which topic the will should be sent out on\&. This will result in a non\-retained, zero length message with QoS 0\&. +.PP +Use the +\fB\-\-will\-retain\fR, +\fB\-\-will\-payload\fR +and +\fB\-\-will\-qos\fR +arguments to modify the other will parameters\&. +.SH "PROPERTIES" +.PP +The +\fB\-D\fR +/ +\fB\-\-property\fR +option allows adding properties to different stages of the mosquitto_rr run\&. The properties supported for each command are as follows: +.SS "Connect" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBauthentication\-data\fR +(binary data \- note treated as a string in mosquitto_rr) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBauthentication\-method\fR +(UTF\-8 string pair) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBmaximum\-packet\-size\fR +(32\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBreceive\-maximum\fR +(16\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBrequest\-problem\-information\fR +(8\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBrequest\-response\-information\fR +(8\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBsession\-expiry\-interval\fR +(32\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBtopic\-alias\-maximum\fR +(16\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBuser\-property\fR +(UTF\-8 string pair) +.RE +.SS "Publish" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBcontent\-type\fR +(UTF\-8 string) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBcorrelation\-data\fR +(binary data \- note treated as a string in mosquitto_rr) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBmessage\-expiry\-interval\fR +(32\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBpayload\-format\-indicator\fR +(8\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBresponse\-topic\fR +(UTF\-8 string) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBtopic\-alias\fR +(16\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBuser\-property\fR +(UTF\-8 string pair) +.RE +.SS "Subscribe" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBuser\-property\fR +(UTF\-8 string pair) +.RE +.SS "Unsubscribe" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBuser\-property\fR +(UTF\-8 string pair) +.RE +.SS "Disconnect" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBsession\-expiry\-interval\fR +(32\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBuser\-property\fR +(UTF\-8 string pair) +.RE +.SS "Will properties" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBcontent\-type\fR +(UTF\-8 string) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBcorrelation\-data\fR +(binary data \- note treated as a string in mosquitto_pub) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBmessage\-expiry\-interval\fR +(32\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBpayload\-format\-indicator\fR +(8\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBresponse\-topic\fR +(UTF\-8 string) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBuser\-property\fR +(UTF\-8 string pair) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBwill\-delay\-interval\fR +(32\-bit unsigned integer) +.RE +.SH "FILES" +.PP +$XDG_CONFIG_HOME/mosquitto_rr, $HOME/\&.config/mosquitto_rr +.RS 4 +Configuration file for default options\&. +.RE +.SH "BUGS" +.PP +\fBmosquitto\fR +bug information can be found at +\m[blue]\fB\%https://github.com/eclipse/mosquitto/issues\fR\m[] +.SH "SEE ALSO" +\fBmqtt\fR(7), \fBmosquitto_pub\fR(1), \fBmosquitto_sub\fR(1), \fBmosquitto\fR(8), \fBlibmosquitto\fR(3), \fBmosquitto-tls\fR(7) +.SH "AUTHOR" +.PP +Roger Light +<roger@atchoo\&.org> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_rr.1.meta b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_rr.1.meta new file mode 100644 index 0000000..365b738 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_rr.1.meta @@ -0,0 +1,5 @@ +.. title: mosquitto_rr man page +.. slug: mosquitto_rr-1 +.. category: man +.. type: man +.. pretty_url: False diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_rr.1.xml b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_rr.1.xml new file mode 100644 index 0000000..5af06af --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_rr.1.xml @@ -0,0 +1,851 @@ +<?xml version='1.0' encoding='UTF-8'?> +<?xml-stylesheet type="text/xsl" href="manpage.xsl"?> + +<refentry xml:id="mosquitto_rr" xmlns:xlink="http://www.w3.org/1999/xlink"> + <refmeta> + <refentrytitle>mosquitto_rr</refentrytitle> + <manvolnum>1</manvolnum> + <refmiscinfo class="source">Mosquitto Project</refmiscinfo> + <refmiscinfo class="manual">Commands</refmiscinfo> + </refmeta> + + <refnamediv> + <refname>mosquitto_rr</refname> + <refpurpose>an MQTT version 5/3.1.1 client for request/response messaging</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <cmdsynopsis> + <command>mosquitto_rr</command> + <group choice='req'> + <arg choice='plain'> + <arg><option>-h</option> <replaceable>hostname</replaceable></arg> + <arg><option>-p</option> <replaceable>port-number</replaceable></arg> + <arg><option>-u</option> <replaceable>username</replaceable></arg> + <arg><option>-P</option> <replaceable>password</replaceable></arg> + <arg choice='plain' rep='repeat'><option>-t</option> <replaceable>message-topic</replaceable></arg> + </arg> + <arg choice='plain'> + <arg choice='plain'><option>-L</option> <replaceable>URL</replaceable></arg> + <arg choice='opt' rep='repeat'><option>-t</option> <replaceable>message-topic</replaceable></arg> + </arg> + <arg><option>-e</option> <replaceable>response-topic</replaceable></arg> + </group> + <group choice='req'> + <arg choice='plain'><option>-f</option> <replaceable>file</replaceable></arg> + <arg choice='plain'><option>-m</option> <replaceable>message</replaceable></arg> + <arg choice='plain'><option>-n</option></arg> + <arg choice='plain'><option>-s</option></arg> + </group> + <arg><option>-A</option> <replaceable>bind-address</replaceable></arg> + <arg><option>-c</option></arg> + <arg><option>-d</option></arg> + <arg><option>-D</option> <replaceable>command</replaceable> <replaceable>identifier</replaceable> <replaceable>value</replaceable></arg> + <arg><option>-i</option> <replaceable>client-id</replaceable></arg> + <arg><option>-I</option> <replaceable>client-id-prefix</replaceable></arg> + <arg><option>-k</option> <replaceable>keepalive-time</replaceable></arg> + <arg><option>-N</option></arg> + <arg><option>-q</option> <replaceable>message-QoS</replaceable></arg> + <arg><option>-R</option></arg> + <arg><option>-S</option></arg> + <arg><option>-v</option></arg> + <arg><option>-V</option> <replaceable>protocol-version</replaceable></arg> + <arg><option>-W</option> <replaceable>message-processing-timeout</replaceable></arg> + <arg><option>--proxy</option> <replaceable>socks-url</replaceable></arg> + <arg><option>--quiet</option></arg> + <arg> + <option>--will-topic</option> <replaceable>topic</replaceable> + <arg><option>--will-payload</option> <replaceable>payload</replaceable></arg> + <arg><option>--will-qos</option> <replaceable>qos</replaceable></arg> + <arg><option>--will-retain</option></arg> + </arg> + <group> + <arg> + <group choice='req'> + <arg choice='plain'><option>--cafile</option> <replaceable>file</replaceable></arg> + <arg choice='plain'><option>--capath</option> <replaceable>dir</replaceable></arg> + </group> + <arg><option>--cert</option> <replaceable>file</replaceable></arg> + <arg><option>--key</option> <replaceable>file</replaceable></arg> + <arg><option>--ciphers</option> <replaceable>ciphers</replaceable></arg> + <arg><option>--tls-version</option> <replaceable>version</replaceable></arg> + <arg><option>--tls-alpn</option> <replaceable>protocol</replaceable></arg> + <arg><option>--tls-engine</option> <replaceable>engine</replaceable></arg> + <arg><option>--keyform</option> + <group choice='req'> + <arg choice='plain'><replaceable>pem</replaceable></arg> + <arg choice='plain'><replaceable>engine</replaceable></arg> + </group></arg> + <arg><option>--tls-engine-kpass-sha1</option> <replaceable>kpass-sha1</replaceable></arg> + <arg><option>--insecure</option></arg> + </arg> + <arg> + <arg choice='plain'><option>--psk</option> <replaceable>hex-key</replaceable></arg> + <arg choice='plain'><option>--psk-identity</option> <replaceable>identity</replaceable></arg> + <arg><option>--ciphers</option> <replaceable>ciphers</replaceable></arg> + <arg><option>--tls-version</option> <replaceable>version</replaceable></arg> + </arg> + </group> + </cmdsynopsis> + <cmdsynopsis> + <command>mosquitto_rr</command> + <group choice='plain'> + <arg><option>--help</option></arg> + </group> + </cmdsynopsis> + </refsynopsisdiv> + + <refsect1> + <title>Description</title> + <para><command>mosquitto_rr</command> is an MQTT version 5/3.1.1 + client that can be used to publish a request message and wait for a + response. When using MQTT v5, which is the default, + <command>mosquitto_rr</command> will use the Request-Response + feature.</para> + </refsect1> + + <refsect1> + <title>Encrypted Connections</title> + <para><command>mosquitto_rr</command> supports TLS encrypted + connections. It is strongly recommended that you use an encrypted + connection for anything more than the most basic setup.</para> + <para>To enable TLS connections when using x509 certificates, one of + either <option>--cafile</option> or <option>--capath</option> must + be provided as an option.</para> + <para>To enable TLS connections when using TLS-PSK, you must use the + <option>--psk</option> and the <option>--psk-identity</option> + options.</para> + </refsect1> + + <refsect1> + <title>Options</title> + <para>The options below may be given on the command line, but may also + be placed in a config file located at + <option>$XDG_CONFIG_HOME/mosquitto_rr</option> or + <option>$HOME/.config/mosquitto_rr</option> with one pair of + <option>-option <replaceable>value</replaceable></option> + per line. The values in the config file will be used as defaults + and can be overridden by using the command line. The exceptions to + this is <option>-t</option>, which if given in the config file will + not be overridden. Note also that currently some options cannot be + negated, e.g. <option>-S</option>. Config file lines that have a + <option>#</option> as the first character are treated as comments + and not processed any further.</para> + <variablelist> + <varlistentry> + <term><option>-A</option></term> + <listitem> + <para>Bind the outgoing connection to a local ip + address/hostname. Use this argument if you need to + restrict network communication to a particular + interface.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-c</option></term> + <term><option>--disable-clean-session</option></term> + <listitem> + <para>Disable the 'clean session' flag. This means that all + of the subscriptions for the client will be maintained + after it disconnects, along with subsequent QoS 1 and QoS 2 + messages that arrive. When the client reconnects, it will + receive all of the queued messages.</para> + <para>If using this option, the client id must be set + manually with <option>--id</option></para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--cafile</option></term> + <listitem> + <para>Define the path to a file containing PEM encoded CA + certificates that are trusted. Used to enable SSL + communication.</para> + <para>See also <option>--capath</option></para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--capath</option></term> + <listitem> + <para>Define the path to a directory containing PEM encoded CA + certificates that are trusted. Used to enable SSL + communication.</para> + <para>For <option>--capath</option> to work correctly, the + certificate files must have ".crt" as the file ending + and you must run "openssl rehash <path to capath>" each + time you add/remove a certificate.</para> + <para>See also <option>--cafile</option></para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--cert</option></term> + <listitem> + <para>Define the path to a file containing a PEM encoded + certificate for this client, if required by the + server.</para> + <para>See also <option>--key</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--ciphers</option></term> + <listitem> + <para>An openssl compatible list of TLS ciphers to support + in the client. See + <citerefentry><refentrytitle>ciphers</refentrytitle><manvolnum>1</manvolnum></citerefentry> + for more information.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-d</option></term> + <term><option>--debug</option></term> + <listitem> + <para>Enable debug messages.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-D</option></term> + <term><option>--property</option></term> + <listitem> + <para>Use an MQTT v5 property with this publish. If you use + this option, the client will be set to be an MQTT v5 + client. This option has two forms:</para> + <para><option>-D command identifier value</option></para> + <para><option>-D command identifier name value</option></para> + <para><option>command</option> is the MQTT command/packet + identifier and can be one of CONNECT, PUBACK, PUBREC, + PUBCOMP, SUBSCRIBE, UNSUBSCRIBE, DISCONNECT, AUTH, or + WILL. The properties available for each command are + listed in the Properties section.</para> + + <para><option>identifier</option> is the name of the + property to add. This is as described in the + specification, but with '-' as a word separator. For + example: + <option>payload-format-indicator</option>. More details + are in the <link linkend='properties'>Properties</link> + section.</para> + + <para><option>value</option> is the value of the property + to add, with a data type that is property + specific.</para> + + <para><option>name</option> is only used for the + <option>user-property</option> property as the first of + the two strings in the string pair. In that case, + <option>value</option> is the second of the strings in + the pair.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-f</option></term> + <term><option>--file</option></term> + <listitem> + <para>Send the contents of a file as the request message.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-F</option></term> + <listitem> + <para>Specify output printing format. This option allows + you to choose what information from each message is + printed to the screen. See the <link + linkend='outputformat'>Output Format</link> section + below for full details.</para> + <para>This option overrides the <option>-v</option> option, + but does not override the <option>-N</option> + option.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--help</option></term> + <listitem> + <para>Display usage information.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-h</option></term> + <term><option>--host</option></term> + <listitem> + <para>Specify the host to connect to. Defaults to localhost.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-i</option></term> + <term><option>--id</option></term> + <listitem> + <para>The id to use for this client. If not given, defaults + to mosquitto_rr_ appended with the process id of the + client. Cannot be used at the same time as the + <option>--id-prefix</option> argument.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-I</option></term> + <term><option>--id-prefix</option></term> + <listitem> + <para>Provide a prefix that the client id will be built + from by appending the process id of the client. This is + useful where the broker is using the clientid_prefixes + option. Cannot be used at the same time as the + <option>--id</option> argument.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--insecure</option></term> + <listitem> + <para>When using certificate based encryption, this option + disables verification of the server hostname in the + server certificate. This can be useful when testing + initial server configurations but makes it possible for + a malicious third party to impersonate your server + through DNS spoofing, for example. Use this option in + testing <emphasis>only</emphasis>. If you need to + resort to using this option in a production + environment, your setup is at fault and there is no + point using encryption.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-k</option></term> + <term><option>--keepalive</option></term> + <listitem> + <para>The number of seconds between sending PING commands + to the broker for the purposes of informing it we are still + connected and functioning. Defaults to 60 seconds.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--key</option></term> + <listitem> + <para>Define the path to a file containing a PEM encoded + private key for this client, if required by the + server.</para> + <para>See also <option>--cert</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--keyform</option></term> + <listitem> + <para>Specifies the type of private key in use when making + TLS connections.. This can be "pem" or "engine". This + parameter is useful when a TPM module is being used and + the private key has been created with it. Defaults to + "pem", which means normal private key files are + used.</para> + <para>See also <option>--tls-engine</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-L</option></term> + <term><option>--url</option></term> + <listitem> + <para>Specify specify user, password, hostname, port and + topic at once as a URL. The URL must be in the form: + mqtt(s)://[username[:password]@]host[:port]/topic</para> + <para>If the scheme is mqtt:// then the port defaults to + 1883. If the scheme is mqtts:// then the port defaults + to 8883.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-m</option></term> + <term><option>--message</option></term> + <listitem> + <para>Send a single request message from the command line.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-N</option></term> + <listitem> + <para>Do not append an end of line character to the payload + when printing. This allows streaming of payload data + from multiple messages directly to another application + unmodified. Only really makes sense when not using + <option>-v</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-n</option></term> + <term><option>--null-message</option></term> + <listitem> + <para>Send a null (zero length) request message.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-p</option></term> + <term><option>--port</option></term> + <listitem> + <para>Connect to the port specified. If not given, the + default of 1883 for plain MQTT or 8883 for MQTT over + TLS will be used.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-P</option></term> + <term><option>--pw</option></term> + <listitem> + <para>Provide a password to be used for authenticating with + the broker. Using this argument without also specifying + a username is invalid when using MQTT v3.1 or v3.1.1. + See also the <option>--username</option> option.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--proxy</option></term> + <listitem> + <para>Specify a SOCKS5 proxy to connect through. "None" and + "username" authentication types are supported. The + <option>socks-url</option> must be of the form + <option>socks5h://[username[:password]@]host[:port]</option>. + The protocol prefix <option>socks5h</option> means that + hostnames are resolved by the proxy. The symbols %25, + %3A and %40 are URL decoded into %, : and @ + respectively, if present in the username or + password.</para> + <para>If username is not given, then no authentication is + attempted. If the port is not given, then the default + of 1080 is used.</para> + <para>More SOCKS versions may be available in the future, + depending on demand, and will use different protocol + prefixes as described in <citerefentry> + <refentrytitle>curl</refentrytitle> + <manvolnum>1</manvolnum> </citerefentry>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--psk</option></term> + <listitem> + <para>Provide the hexadecimal (no leading 0x) + pre-shared-key matching the one used on the broker to + use TLS-PSK encryption support. + <option>--psk-identity</option> must also be provided + to enable TLS-PSK.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--psk-identity</option></term> + <listitem> + <para>The client identity to use with TLS-PSK support. This + may be used instead of a username if the broker is + configured to do so.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-q</option></term> + <term><option>--qos</option></term> + <listitem> + <para>Specify the quality of service desired for the + incoming messages, from 0, 1 and 2. Defaults to 0. See + <citerefentry><refentrytitle>mqtt</refentrytitle><manvolnum>7</manvolnum></citerefentry> + for more information on QoS.</para> + <para>The QoS is identical for all topics subscribed to in + a single instance of mosquitto_rr.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--quiet</option></term> + <listitem> + <para>If this argument is given, no runtime errors will be + printed. This excludes any error messages given in case of + invalid user input (e.g. using <option>--port</option> without a + port).</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-R</option></term> + <listitem> + <para>If this argument is given, messages that are received + that have the retain bit set will not be printed. + Messages with retain set are "stale", in that it is not + known when they were originally published. When + subscribing to a wildcard topic there may be a large + number of retained messages. This argument suppresses + their display.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-S</option></term> + <listitem> + <para>Use SRV lookups to determine which host to connect + to. Performs lookups to + <option>_mqtt._tcp.<host></option> when used in + conjunction with <option>-h</option>, otherwise uses + <option>_mqtt._tcp.<local dns + domain></option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-s</option></term> + <term><option>--stdin-file</option></term> + <listitem> + <para>Send a request message read from stdin, sending the entire content as a single message.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-t</option></term> + <term><option>--topic</option></term> + <listitem> + <para>The MQTT topic to subscribe to, where responses will + be waited for. See + <citerefentry><refentrytitle>mqtt</refentrytitle><manvolnum>7</manvolnum></citerefentry> + for more information on MQTT topics.</para> + <para>This option may be repeated to subscribe to multiple topics.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--tls-alpn</option></term> + <listitem> + <para>Provide a protocol to use when connecting to a broker + that has multiple protocols available on a single port, + e.g. MQTT and WebSockets.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--tls-engine</option></term> + <listitem> + <para>A valid openssl engine id. These can be listed with + openssl engine command.</para> + <para>See also <option>--keyform</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--tls-engine-kpass-sha1</option></term> + <listitem> + <para>SHA1 of the private key password when using an TLS + engine. Some TLS engines such as the TPM engine may + require the use of a password in order to be accessed. + This option allows a hex encoded SHA1 hash of the + password to the engine directly, instead of the user + being prompted for the password.</para> + <para>See also <option>--tls-engine</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--tls-version</option></term> + <listitem> + <para>Choose which TLS protocol version to use when + communicating with the broker. Valid options are + <option>tlsv1.3</option>, <option>tlsv1.2</option> and + <option>tlsv1.1</option>. The default value is + <option>tlsv1.2</option>. Must match the protocol + version used by the broker.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-u</option></term> + <term><option>--username</option></term> + <listitem> + <para>Provide a username to be used for authenticating with + the broker. See also the <option>--pw</option> + argument.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-v</option></term> + <term><option>--verbose</option></term> + <listitem> + <para>Print received messages verbosely. With this + argument, messages will be printed as "topic payload". When + this argument is not given, the messages are printed as + "payload".</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-V</option></term> + <term><option>--protocol-version</option></term> + <listitem> + <para>Specify which version of the MQTT protocol should be + used when connecting to the rmeote broker. Can be + <option>5</option>, <option>311</option>, + <option>31</option>, or the more verbose + <option>mqttv5</option>, <option>mqttv311</option>, or + <option>mqttv31</option>. + Defaults to <option>311</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--will-payload</option></term> + <listitem> + <para>Specify a message that will be stored by the broker + and sent out if this client disconnects unexpectedly. This + must be used in conjunction with <option>--will-topic</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--will-qos</option></term> + <listitem> + <para>The QoS to use for the Will. Defaults to 0. This must + be used in conjunction with <option>--will-topic</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--will-retain</option></term> + <listitem> + <para>If given, if the client disconnects unexpectedly the + message sent out will be treated as a retained message. + This must be used in conjunction with <option>--will-topic</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--will-topic</option></term> + <listitem> + <para>The topic on which to send a Will, in the event that + the client disconnects unexpectedly.</para> + </listitem> + </varlistentry> + </variablelist> + </refsect1> + + <refsect1 id='outputformat'> + <title>Output format</title> + <para>There are three ways of formatting the output from mosquitto_rr. + In all cases a new-line character is appended for each message + received unless the <option>-N</option> argument is passed to + mosquitto_rr.</para> + <para>Payload-only is the default output format and will + print the payload exactly as it is received.</para> + <para>Verbose mode is activated with <option>-v</option> and prints the + message topic and the payload, separated by a space.</para> + <para>The final option is formatted output, which allows the user to + define a custom output format. The behaviour is controlled with + the <option>-F format-string</option> option. The format string is + a free text string where interpreted sequences are replaced by + different parameters. The available interpreted sequences are + described below.</para> + <para>Three characters are used to start an interpreted sequence: + <option>%</option>, <option>@</option> and <option>\</option>. + Sequences starting with <option>%</option> are either parameters + related to the MQTT message being printed, or are helper sequences + to avoid the need to type long date format strings for example. + Sequences starting with <option>@</option> are passed to the + <citerefentry><refentrytitle>strftime</refentrytitle><manvolnum>3</manvolnum></citerefentry> + function (with the @ replaced with a % - note that only the + character immediately after the @ is passed to strftime). This + allows the construction of a wide variety of time based outputs. + The output options for strftime vary from platform to platform, so + please check what is available for your platform. mosquitto_rr + does provide one extension to strftime which is + <option>@N</option>, which can be used to obtain the number of + nanoseconds passed in the current second. The resolution of this + option varies depending on the platform. The final sequence + character is <option>\</option>, which is used to input some + characters that would otherwise be difficult to enter.</para> + + <refsect2> + <title>MQTT related parameters</title> + <itemizedlist mark="circle"> + <listitem><para><option>%%</option> a literal %.</para></listitem> + <listitem><para><option>%l</option> the length of the payload in bytes.</para></listitem> + <listitem><para><option>%m</option> the message id (only relevant for messages with QoS>0).</para></listitem> + <listitem><para><option>%p</option> the payload raw bytes (may produce non-printable characters depending on the payload).</para></listitem> + <listitem><para><option>%q</option> the message QoS.</para></listitem> + <listitem><para><option>%r</option> the retained flag for the message.</para></listitem> + <listitem><para><option>%t</option> the message topic.</para></listitem> + <listitem><para><option>%x</option> the payload with each byte as a hexadecimal number (lower case).</para></listitem> + <listitem><para><option>%X</option> the payload with each byte as a hexadecimal number (upper case).</para></listitem> + </itemizedlist> + </refsect2> + + <refsect2> + <title>Helpers</title> + <itemizedlist mark="circle"> + <listitem><para><option>%I</option> ISO-8601 format date and time, e.g. 2016-08-10T09:47:38+0100</para></listitem> + <listitem><para><option>%j</option> JSON output of message + parameters and timestamp, with a quoted and escaped + payload. For example + <code>{"tst":1470825369,"topic":"greeting","qos":0,"retain":0,"payload":"hello + world"}</code></para></listitem> + <listitem><para><option>%J</option> JSON output of message + parameters and timestamp, with a non-quoted and + non-escaped payload - this means the payload must + itself be valid JSON. For example: + <code>{"tst":1470825369,"topic":"foo","qos":0,"retain":0,"payload":{"temperature":27.0,"humidity":57}}</code>.</para></listitem> + <listitem><para><option>%I</option> ISO-8601 format date and time, e.g. 2016-08-10T09:47:38+0100</para></listitem> + <listitem><para><option>%U</option> Unix timestamp with nanoseconds, e.g. 1470818943.786368637</para></listitem> + </itemizedlist> + </refsect2> + + <refsect2> + <title>Time related parameters</title> + <itemizedlist mark="circle"> + <listitem><para><option>@@</option> a literal @.</para></listitem> + <listitem><para><option>@X</option> pass the character represented + by <option>X</option> to the strftime function as + <option>%X</option>. The options supported are platform + dependent.</para></listitem> + <listitem><para><option>@N</option> the number of nanoseconds that + have passed in the current second, with varying timing + resolution depending on platform.</para></listitem> + </itemizedlist> + </refsect2> + + <refsect2> + <title>Escape characters</title> + <itemizedlist mark="circle"> + <listitem><para><option>\\</option> a literal \.</para></listitem> + <listitem><para><option>\0</option> a null character. Can be used + to separate different parameters that may contain spaces + (e.g. topic, payload) so that processing with tools such as + <citerefentry><refentrytitle>xargs</refentrytitle><manvolnum>1</manvolnum></citerefentry> + is easier.</para></listitem> + <listitem><para><option>\a</option> alert/bell.</para></listitem> + <listitem><para><option>\e</option> the escape sequence, which can + be used with ANSI colour codes to provide coloured output + for example.</para></listitem> + <listitem><para><option>\n</option> end of line.</para></listitem> + <listitem><para><option>\r</option> carriage return.</para></listitem> + <listitem><para><option>\t</option> horizontal tab.</para></listitem> + <listitem><para><option>\v</option> vertical tab.</para></listitem> + </itemizedlist> + </refsect2> + </refsect1> + + <refsect1> + <title>Wills</title> + <para>mosquitto_rr can register a message with the broker that will be + sent out if it disconnects unexpectedly. See + <citerefentry><refentrytitle>mqtt</refentrytitle><manvolnum>7</manvolnum></citerefentry> + for more information.</para> + <para>The minimum requirement for this is to use <option>--will-topic</option> to + specify which topic the will should be sent out on. This will result in + a non-retained, zero length message with QoS 0.</para> + <para>Use the <option>--will-retain</option>, <option>--will-payload</option> and <option>--will-qos</option> arguments to + modify the other will parameters.</para> + </refsect1> + + <refsect1 id='properties'> + <title>Properties</title> + <para>The <option>-D</option> / <option>--property</option> option + allows adding properties to different stages of the mosquitto_rr + run. The properties supported for each command are as + follows:</para> + + <refsect2> + <title>Connect</title> + <itemizedlist> + <listitem><para><option>authentication-data</option> (binary data - note treated as a string in mosquitto_rr)</para></listitem> + <listitem><para><option>authentication-method</option> (UTF-8 string pair)</para></listitem> + <listitem><para><option>maximum-packet-size</option> (32-bit unsigned integer)</para></listitem> + <listitem><para><option>receive-maximum</option> (16-bit unsigned integer)</para></listitem> + <listitem><para><option>request-problem-information</option> (8-bit unsigned integer)</para></listitem> + <listitem><para><option>request-response-information</option> (8-bit unsigned integer)</para></listitem> + <listitem><para><option>session-expiry-interval</option> (32-bit unsigned integer)</para></listitem> + <listitem><para><option>topic-alias-maximum</option> (16-bit unsigned integer)</para></listitem> + <listitem><para><option>user-property</option> (UTF-8 string pair)</para></listitem> + </itemizedlist> + </refsect2> + + <refsect2> + <title>Publish</title> + <itemizedlist> + <listitem><para><option>content-type</option> (UTF-8 string)</para></listitem> + <listitem><para><option>correlation-data</option> (binary data - note treated as a string in mosquitto_rr)</para></listitem> + <listitem><para><option>message-expiry-interval</option> (32-bit unsigned integer)</para></listitem> + <listitem><para><option>payload-format-indicator</option> (8-bit unsigned integer)</para></listitem> + <listitem><para><option>response-topic</option> (UTF-8 string)</para></listitem> + <listitem><para><option>topic-alias</option> (16-bit unsigned integer)</para></listitem> + <listitem><para><option>user-property</option> (UTF-8 string pair)</para></listitem> + </itemizedlist> + </refsect2> + + <refsect2> + <title>Subscribe</title> + <itemizedlist> + <listitem><para><option>user-property</option> (UTF-8 string pair)</para></listitem> + </itemizedlist> + </refsect2> + + <refsect2> + <title>Unsubscribe</title> + <itemizedlist> + <listitem><para><option>user-property</option> (UTF-8 string pair)</para></listitem> + </itemizedlist> + </refsect2> + + <refsect2> + <title>Disconnect</title> + <itemizedlist> + <listitem><para><option>session-expiry-interval</option> (32-bit unsigned integer)</para></listitem> + <listitem><para><option>user-property</option> (UTF-8 string pair)</para></listitem> + </itemizedlist> + </refsect2> + + <refsect2> + <title>Will properties</title> + <itemizedlist> + <listitem><para><option>content-type</option> (UTF-8 string)</para></listitem> + <listitem><para><option>correlation-data</option> (binary data - note treated as a string in mosquitto_pub)</para></listitem> + <listitem><para><option>message-expiry-interval</option> (32-bit unsigned integer)</para></listitem> + <listitem><para><option>payload-format-indicator</option> (8-bit unsigned integer)</para></listitem> + <listitem><para><option>response-topic</option> (UTF-8 string)</para></listitem> + <listitem><para><option>user-property</option> (UTF-8 string pair)</para></listitem> + <listitem><para><option>will-delay-interval</option> (32-bit unsigned integer)</para></listitem> + </itemizedlist> + </refsect2> + </refsect1> + + <refsect1> + <title>Files</title> + <variablelist> + <varlistentry> + <term><filename>$XDG_CONFIG_HOME/mosquitto_rr</filename></term> + <term><filename>$HOME/.config/mosquitto_rr</filename></term> + <listitem> + <para>Configuration file for default options.</para> + </listitem> + </varlistentry> + </variablelist> + </refsect1> + + <refsect1> + <title>Bugs</title> + <para><command>mosquitto</command> bug information can be found at + <ulink url="https://github.com/eclipse/mosquitto/issues"/></para> + </refsect1> + + <refsect1> + <title>See Also</title> + <simplelist type="inline"> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mqtt-7.html">mqtt</link></refentrytitle> + <manvolnum>7</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto_pub-1.html">mosquitto_pub</link></refentrytitle> + <manvolnum>1</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto_sub-1.html">mosquitto_sub</link></refentrytitle> + <manvolnum>1</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto-8.html">mosquitto</link></refentrytitle> + <manvolnum>8</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="libmosquitto-3.html">libmosquitto</link></refentrytitle> + <manvolnum>3</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto-tls-7.html">mosquitto-tls</link></refentrytitle> + <manvolnum>7</manvolnum> + </citerefentry> + </member> + </simplelist> + </refsect1> + + <refsect1> + <title>Author</title> + <para>Roger Light <email>roger@atchoo.org</email></para> + </refsect1> +</refentry> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_sub.1 b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_sub.1 new file mode 100644 index 0000000..d86d747 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_sub.1 @@ -0,0 +1,1261 @@ +'\" t +.\" Title: mosquitto_sub +.\" Author: [see the "Author" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> +.\" Date: 06/18/2019 +.\" Manual: Commands +.\" Source: Mosquitto Project +.\" Language: English +.\" +.TH "MOSQUITTO_SUB" "1" "06/18/2019" "Mosquitto Project" "Commands" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +mosquitto_sub \- an MQTT version 5/3\&.1\&.1/3\&.1 client for subscribing to topics +.SH "SYNOPSIS" +.HP \w'\fBmosquitto_sub\fR\ 'u +\fBmosquitto_sub\fR {[\fB\-h\fR\ \fIhostname\fR]\ [\fB\-p\fR\ \fIport\-number\fR]\ [\fB\-u\fR\ \fIusername\fR]\ [\fB\-P\fR\ \fIpassword\fR]\ \fB\-t\fR\ \fImessage\-topic\fR... | \fB\-L\fR\ \fIURL\fR\ [\fB\-t\fR\ \fImessage\-topic\fR...] } [\fB\-A\fR\ \fIbind\-address\fR] [\fB\-c\fR] [\fB\-C\fR\ \fImsg\-count\fR] [\fB\-d\fR] [\fB\-D\fR\ \fIcommand\fR\ \fIidentifier\fR\ \fIvalue\fR] [\fB\-E\fR] [\fB\-i\fR\ \fIclient\-id\fR] [\fB\-I\fR\ \fIclient\-id\-prefix\fR] [\fB\-k\fR\ \fIkeepalive\-time\fR] [\fB\-N\fR] [\fB\-q\fR\ \fImessage\-QoS\fR] [\fB\-\-remove\-retained\fR] [\fB\-R\fR | \fB\-\-retained\-only\fR] [\fB\-\-retain\-as\-published\fR] [\fB\-S\fR] [\fB\-T\fR\ \fIfilter\-out\fR...] [\fB\-U\fR\ \fIunsub\-topic\fR...] [\fB\-v\fR] [\fB\-V\fR\ \fIprotocol\-version\fR] [\fB\-W\fR\ \fImessage\-processing\-timeout\fR] [\fB\-\-proxy\fR\ \fIsocks\-url\fR] [\fB\-\-quiet\fR] [\fB\-\-will\-topic\fR\ \fItopic\fR\ [\fB\-\-will\-payload\fR\ \fIpayload\fR]\ [\fB\-\-will\-qos\fR\ \fIqos\fR]\ [\fB\-\-will\-retain\fR]] [[{\fB\-\-cafile\fR\ \fIfile\fR\ |\ \fB\-\-capath\fR\ \fIdir\fR}\ [\fB\-\-cert\fR\ \fIfile\fR]\ [\fB\-\-key\fR\ \fIfile\fR]\ [\fB\-\-tls\-version\fR\ \fIversion\fR]\ [\fB\-\-tls\-alpn\fR\ \fIprotocol\fR]\ [\fB\-\-tls\-engine\fR\ \fIengine\fR]\ [\fB\-\-keyform\fR\ {\fIpem\fR\ |\ \fIengine\fR}]\ [\fB\-\-tls\-engine\-kpass\-sha1\fR\ \fIkpass\-sha1\fR]\ [\fB\-\-insecure\fR]] | [\fB\-\-psk\fR\ \fIhex\-key\fR\ \fB\-\-psk\-identity\fR\ \fIidentity\fR\ [\fB\-\-tls\-version\fR\ \fIversion\fR]]] +.HP \w'\fBmosquitto_sub\fR\ 'u +\fBmosquitto_sub\fR [\fB\-\-help\fR] +.SH "DESCRIPTION" +.PP +\fBmosquitto_sub\fR +is a simple MQTT version 5/3\&.1\&.1 client that will subscribe to topics and print the messages that it receives\&. +.PP +In addition to subscribing to topics, +\fBmosquitto_sub\fR +can filter out received messages so they are not printed (see the +\fB\-T\fR +option) or unsubscribe from topics (see the +\fB\-U\fR +option)\&. Unsubscribing from topics is useful for clients connecting with clean session set to false\&. +.SH "ENCRYPTED CONNECTIONS" +.PP +\fBmosquitto_sub\fR +supports TLS encrypted connections\&. It is strongly recommended that you use an encrypted connection for anything more than the most basic setup\&. +.PP +To enable TLS connections when using x509 certificates, one of either +\fB\-\-cafile\fR +or +\fB\-\-capath\fR +must be provided as an option\&. +.PP +To enable TLS connections when using TLS\-PSK, you must use the +\fB\-\-psk\fR +and the +\fB\-\-psk\-identity\fR +options\&. +.SH "OPTIONS" +.PP +The options below may be given on the command line, but may also be placed in a config file located at +\fB$XDG_CONFIG_HOME/mosquitto_sub\fR +or +\fB$HOME/\&.config/mosquitto_sub\fR +with one pair of +\fB\-option \fR\fB\fIvalue\fR\fR +per line\&. The values in the config file will be used as defaults and can be overridden by using the command line\&. The exceptions to this are +\fB\-t\fR +and +\fB\-T\fR, which if given in the config file will not be overridden\&. Note also that currently some options cannot be negated, e\&.g\&. +\fB\-S\fR\&. Config file lines that have a +\fB#\fR +as the first character are treated as comments and not processed any further\&. +.PP +\fB\-A\fR +.RS 4 +Bind the outgoing connection to a local ip address/hostname\&. Use this argument if you need to restrict network communication to a particular interface\&. +.RE +.PP +\fB\-c\fR, \fB\-\-disable\-clean\-session\fR +.RS 4 +Disable the \*(Aqclean session\*(Aq flag\&. This means that all of the subscriptions for the client will be maintained after it disconnects, along with subsequent QoS 1 and QoS 2 messages that arrive\&. When the client reconnects, it will receive all of the queued messages\&. +.sp +If using this option, the client id must be set manually with +\fB\-\-id\fR +.RE +.PP +\fB\-\-cafile\fR +.RS 4 +Define the path to a file containing PEM encoded CA certificates that are trusted\&. Used to enable SSL communication\&. +.sp +See also +\fB\-\-capath\fR +.RE +.PP +\fB\-\-capath\fR +.RS 4 +Define the path to a directory containing PEM encoded CA certificates that are trusted\&. Used to enable SSL communication\&. +.sp +For +\fB\-\-capath\fR +to work correctly, the certificate files must have "\&.crt" as the file ending and you must run "openssl rehash <path to capath>" each time you add/remove a certificate\&. +.sp +See also +\fB\-\-cafile\fR +.RE +.PP +\fB\-\-cert\fR +.RS 4 +Define the path to a file containing a PEM encoded certificate for this client, if required by the server\&. +.sp +See also +\fB\-\-key\fR\&. +.RE +.PP +\fB\-\-ciphers\fR +.RS 4 +An openssl compatible list of TLS ciphers to support in the client\&. See +\fBciphers\fR(1) +for more information\&. +.RE +.PP +\fB\-C\fR +.RS 4 +Disconnect and exit the program immediately after the given count of messages have been received\&. This may be useful in shell scripts where on a single status value is required, for example\&. +.sp +Combine with +\fB\-R\fR +to print only the first set of fresh messages (i\&.e\&. that does not have the retained flag set), or with +\fB\-T\fR +to filter which topics are processed\&. +.RE +.PP +\fB\-d\fR, \fB\-\-debug\fR +.RS 4 +Enable debug messages\&. +.RE +.PP +\fB\-D\fR, \fB\-\-property\fR +.RS 4 +Use an MQTT v5 property with this publish\&. If you use this option, the client will be set to be an MQTT v5 client\&. This option has two forms: +.sp +\fB\-D command identifier value\fR +.sp +\fB\-D command identifier name value\fR +.sp +\fBcommand\fR +is the MQTT command/packet identifier and can be one of CONNECT, PUBACK, PUBREC, PUBCOMP, SUBSCRIBE, UNSUBSCRIBE, DISCONNECT, AUTH, or WILL\&. The properties available for each command are listed in the Properties section\&. +.sp +\fBidentifier\fR +is the name of the property to add\&. This is as described in the specification, but with \*(Aq\-\*(Aq as a word separator\&. For example: +\fBpayload\-format\-indicator\fR\&. More details are in the +Properties +section\&. +.sp +\fBvalue\fR +is the value of the property to add, with a data type that is property specific\&. +.sp +\fBname\fR +is only used for the +\fBuser\-property\fR +property as the first of the two strings in the string pair\&. In that case, +\fBvalue\fR +is the second of the strings in the pair\&. +.RE +.PP +\fB\-E\fR +.RS 4 +If this option is given, +\fBmosquitto_sub\fR +will exit immediately that all of its subscriptions have been acknowledged by the broker\&. In conjunction with +\fB\-c\fR +this allows a durable client session to be initialised on the broker for future use without requiring any messages to be received\&. +.RE +.PP +\fB\-F\fR +.RS 4 +Specify output printing format\&. This option allows you to choose what information from each message is printed to the screen\&. See the +Output Format +section below for full details\&. +.sp +This option overrides the +\fB\-v\fR +option, but does not override the +\fB\-N\fR +option\&. +.RE +.PP +\fB\-\-help\fR +.RS 4 +Display usage information\&. +.RE +.PP +\fB\-h\fR, \fB\-\-host\fR +.RS 4 +Specify the host to connect to\&. Defaults to localhost\&. +.RE +.PP +\fB\-i\fR, \fB\-\-id\fR +.RS 4 +The id to use for this client\&. If not given, defaults to mosquitto_sub_ appended with the process id of the client\&. Cannot be used at the same time as the +\fB\-\-id\-prefix\fR +argument\&. +.RE +.PP +\fB\-I\fR, \fB\-\-id\-prefix\fR +.RS 4 +Provide a prefix that the client id will be built from by appending the process id of the client\&. This is useful where the broker is using the clientid_prefixes option\&. Cannot be used at the same time as the +\fB\-\-id\fR +argument\&. +.RE +.PP +\fB\-\-insecure\fR +.RS 4 +When using certificate based encryption, this option disables verification of the server hostname in the server certificate\&. This can be useful when testing initial server configurations but makes it possible for a malicious third party to impersonate your server through DNS spoofing, for example\&. Use this option in testing +\fIonly\fR\&. If you need to resort to using this option in a production environment, your setup is at fault and there is no point using encryption\&. +.RE +.PP +\fB\-k\fR, \fB\-\-keepalive\fR +.RS 4 +The number of seconds between sending PING commands to the broker for the purposes of informing it we are still connected and functioning\&. Defaults to 60 seconds\&. +.RE +.PP +\fB\-\-key\fR +.RS 4 +Define the path to a file containing a PEM encoded private key for this client, if required by the server\&. +.sp +See also +\fB\-\-cert\fR\&. +.RE +.PP +\fB\-\-keyform\fR +.RS 4 +Specifies the type of private key in use when making TLS connections\&.\&. This can be "pem" or "engine"\&. This parameter is useful when a TPM module is being used and the private key has been created with it\&. Defaults to "pem", which means normal private key files are used\&. +.sp +See also +\fB\-\-tls\-engine\fR\&. +.RE +.PP +\fB\-L\fR, \fB\-\-url\fR +.RS 4 +Specify specify user, password, hostname, port and topic at once as a URL\&. The URL must be in the form: mqtt(s)://[username[:password]@]host[:port]/topic +.sp +If the scheme is mqtt:// then the port defaults to 1883\&. If the scheme is mqtts:// then the port defaults to 8883\&. +.RE +.PP +\fB\-N\fR +.RS 4 +Do not append an end of line character to the payload when printing\&. This allows streaming of payload data from multiple messages directly to another application unmodified\&. Only really makes sense when not using +\fB\-v\fR\&. +.RE +.PP +\fB\-p\fR, \fB\-\-port\fR +.RS 4 +Connect to the port specified\&. If not given, the default of 1883 for plain MQTT or 8883 for MQTT over TLS will be used\&. +.RE +.PP +\fB\-P\fR, \fB\-\-pw\fR +.RS 4 +Provide a password to be used for authenticating with the broker\&. Using this argument without also specifying a username is invalid when using MQTT v3\&.1 or v3\&.1\&.1\&. See also the +\fB\-\-username\fR +option\&. +.RE +.PP +\fB\-\-proxy\fR +.RS 4 +Specify a SOCKS5 proxy to connect through\&. "None" and "username" authentication types are supported\&. The +\fBsocks\-url\fR +must be of the form +\fBsocks5h://[username[:password]@]host[:port]\fR\&. The protocol prefix +\fBsocks5h\fR +means that hostnames are resolved by the proxy\&. The symbols %25, %3A and %40 are URL decoded into %, : and @ respectively, if present in the username or password\&. +.sp +If username is not given, then no authentication is attempted\&. If the port is not given, then the default of 1080 is used\&. +.sp +More SOCKS versions may be available in the future, depending on demand, and will use different protocol prefixes as described in +\fBcurl\fR(1)\&. +.RE +.PP +\fB\-\-psk\fR +.RS 4 +Provide the hexadecimal (no leading 0x) pre\-shared\-key matching the one used on the broker to use TLS\-PSK encryption support\&. +\fB\-\-psk\-identity\fR +must also be provided to enable TLS\-PSK\&. +.RE +.PP +\fB\-\-psk\-identity\fR +.RS 4 +The client identity to use with TLS\-PSK support\&. This may be used instead of a username if the broker is configured to do so\&. +.RE +.PP +\fB\-q\fR, \fB\-\-qos\fR +.RS 4 +Specify the quality of service desired for the incoming messages, from 0, 1 and 2\&. Defaults to 0\&. See +\fBmqtt\fR(7) +for more information on QoS\&. +.sp +The QoS is identical for all topics subscribed to in a single instance of mosquitto_sub\&. +.RE +.PP +\fB\-\-quiet\fR +.RS 4 +If this argument is given, no runtime errors will be printed\&. This excludes any error messages given in case of invalid user input (e\&.g\&. using +\fB\-\-port\fR +without a port)\&. +.RE +.PP +\fB\-R\fR +.RS 4 +If this argument is given, messages that are received that have the retain bit set will not be printed\&. Messages with retain set are "stale", in that it is not known when they were originally published\&. When subscribing to a wildcard topic there may be a large number of retained messages\&. This argument suppresses their display\&. +.RE +.PP +\fB\-\-remove\-retained\fR +.RS 4 +If this argument is given, the when mosquitto_sub receives a message with the retained bit set, it will send a message to the broker to clear that retained message\&. This applies to all received messages except those that are filtered out by the +\fB\-T\fR +option\&. This option still takes effect even if +\fB\-R\fR +is used\&. See also the +\fB\-\-retain\-as\-published\fR +and +\fB\-\-retained\-only\fR +options\&. +.PP +\fBExample\ \&1.\ \&\fR +Remove all retained messages on the server, assuming we have access to do so, and then exit: +.sp +.if n \{\ +.RS 4 +.\} +.nf +mosquitto_sub \-t \*(Aq#\*(Aq \-\-remove\-retained \-\-retained\-only +.fi +.if n \{\ +.RE +.\} +.PP +\fBExample\ \&2.\ \&\fR +Remove a whole tree, with the exception of a single topic: +.sp +.if n \{\ +.RS 4 +.\} +.nf +mosquitto_sub \-t \*(Aqbbc/#\*(Aq \-T bbc/bbc1 \-\-remove\-retained +.fi +.if n \{\ +.RE +.\} +.RE +.PP +\fB\-\-retained\-only\fR +.RS 4 +If this argument is given, only messages that are received that have the retain bit set will be printed\&. Messages with retain set are "stale", in that it is not known when they were originally published\&. With this argument in use, the receipt of the first non\-stale message will cause the client to exit\&. See also the +\fB\-\-retain\-as\-published\fR +option\&. +.RE +.PP +\fB\-\-retain\-as\-published\fR +.RS 4 +If this argument is given, the subscriptions will have the "retain as published" option set\&. This means that the retain flag on an incoming message will be exactly as set by the publishing client, rather than indicating whether the message is fresh/stale\&. +.sp +This option is not valid for MQTT v3\&.1/v3\&.1\&.1 clients\&. +.RE +.PP +\fB\-S\fR +.RS 4 +Use SRV lookups to determine which host to connect to\&. Performs lookups to +\fB_mqtt\&._tcp\&.<host>\fR +when used in conjunction with +\fB\-h\fR, otherwise uses +\fB_mqtt\&._tcp\&.<local dns domain>\fR\&. +.RE +.PP +\fB\-t\fR, \fB\-\-topic\fR +.RS 4 +The MQTT topic to subscribe to\&. See +\fBmqtt\fR(7) +for more information on MQTT topics\&. +.sp +This option may be repeated to subscribe to multiple topics\&. +.RE +.PP +\fB\-T\fR, \fB\-\-filter\-out\fR +.RS 4 +Suppress printing of topics that match the filter\&. This allows subscribing to a wildcard topic and only printing a partial set of the wildcard hierarchy\&. +.sp +For example, subscribe to the BBC tree, but suppress output from Radio 3: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_sub +\-t +bbc/# +\-T +bbc/radio3 +.RE +.sp +This option may be repeated to filter out multiple topics or topic trees\&. +.RE +.PP +\fB\-\-tls\-alpn\fR +.RS 4 +Provide a protocol to use when connecting to a broker that has multiple protocols available on a single port, e\&.g\&. MQTT and WebSockets\&. +.RE +.PP +\fB\-\-tls\-engine\fR +.RS 4 +A valid openssl engine id\&. These can be listed with openssl engine command\&. +.sp +See also +\fB\-\-keyform\fR\&. +.RE +.PP +\fB\-\-tls\-engine\-kpass\-sha1\fR +.RS 4 +SHA1 of the private key password when using an TLS engine\&. Some TLS engines such as the TPM engine may require the use of a password in order to be accessed\&. This option allows a hex encoded SHA1 hash of the password to the engine directly, instead of the user being prompted for the password\&. +.sp +See also +\fB\-\-tls\-engine\fR\&. +.RE +.PP +\fB\-\-tls\-version\fR +.RS 4 +Choose which TLS protocol version to use when communicating with the broker\&. Valid options are +\fBtlsv1\&.3\fR, +\fBtlsv1\&.2\fR +and +\fBtlsv1\&.1\fR\&. The default value is +\fBtlsv1\&.2\fR\&. Must match the protocol version used by the broker\&. +.RE +.PP +\fB\-u\fR, \fB\-\-username\fR +.RS 4 +Provide a username to be used for authenticating with the broker\&. See also the +\fB\-\-pw\fR +argument\&. +.RE +.PP +\fB\-U\fR, \fB\-\-unsubscribe\fR +.RS 4 +A topic that will be unsubscribed from\&. This may be used on its own or in conjunction with the +\fB\-\-topic\fR +option and only makes sense when used in conjunction with +\fB\-\-clean\-session\fR\&. +.sp +If used with +\fB\-\-topic\fR +then subscriptions will be processed before unsubscriptions\&. +.sp +Note that it is only possible to unsubscribe from subscriptions that have previously been made\&. It is not possible to punch holes in wildcard subscriptions\&. For example, subscribing to +\fBsensors/#\fR +and then unsubscribing from +\fBsensors/+/temperature\fR +as shown below will still result in messages matching the +\fBsensors/+/temperature\fR +being delivered to the client\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_sub +\-t +sensors/# +\-U +sensors/+/temperature +\-v +.RE +.sp +Note also that because retained messages are published by the broker on receipt of a SUBSCRIBE command, subscribing and unsubscribing to the same topic may result in messages being received at the client\&. +.sp +This option may be repeated to unsubscribe from multiple topics\&. +.RE +.PP +\fB\-v\fR, \fB\-\-verbose\fR +.RS 4 +Print received messages verbosely\&. With this argument, messages will be printed as "topic payload"\&. When this argument is not given, the messages are printed as "payload"\&. +.RE +.PP +\fB\-V\fR, \fB\-\-protocol\-version\fR +.RS 4 +Specify which version of the MQTT protocol should be used when connecting to the remote broker\&. Can be +\fB5\fR, +\fB311\fR, +\fB31\fR, or the more verbose +\fBmqttv5\fR, +\fBmqttv311\fR, or +\fBmqttv31\fR\&. Defaults to +\fB311\fR\&. +.RE +.PP +\fB\-W\fR +.RS 4 +Provide a timeout as an integer number of seconds\&. mosquitto_sub will stop processing messages and disconnect after this number of seconds has passed\&. The timeout starts just after the client has connected to the broker\&. +.RE +.PP +\fB\-\-will\-payload\fR +.RS 4 +Specify a message that will be stored by the broker and sent out if this client disconnects unexpectedly\&. This must be used in conjunction with +\fB\-\-will\-topic\fR\&. +.RE +.PP +\fB\-\-will\-qos\fR +.RS 4 +The QoS to use for the Will\&. Defaults to 0\&. This must be used in conjunction with +\fB\-\-will\-topic\fR\&. +.RE +.PP +\fB\-\-will\-retain\fR +.RS 4 +If given, if the client disconnects unexpectedly the message sent out will be treated as a retained message\&. This must be used in conjunction with +\fB\-\-will\-topic\fR\&. +.RE +.PP +\fB\-\-will\-topic\fR +.RS 4 +The topic on which to send a Will, in the event that the client disconnects unexpectedly\&. +.RE +.SH "OUTPUT FORMAT" +.PP +There are three ways of formatting the output from mosquitto_sub\&. In all cases a new\-line character is appended for each message received unless the +\fB\-N\fR +argument is passed to mosquitto_sub\&. +.PP +Payload\-only is the default output format and will print the payload exactly as it is received\&. +.PP +Verbose mode is activated with +\fB\-v\fR +and prints the message topic and the payload, separated by a space\&. +.PP +The final option is formatted output, which allows the user to define a custom output format\&. The behaviour is controlled with the +\fB\-F format\-string\fR +option\&. The format string is a free text string where interpreted sequences are replaced by different parameters\&. The available interpreted sequences are described below\&. +.PP +Three characters are used to start an interpreted sequence: +\fB%\fR, +\fB@\fR +and +\fB\e\fR\&. Sequences starting with +\fB%\fR +are either parameters related to the MQTT message being printed, or are helper sequences to avoid the need to type long date format strings for example\&. Sequences starting with +\fB@\fR +are passed to the +\fBstrftime\fR(3) +function (with the @ replaced with a % \- note that only the character immediately after the @ is passed to strftime)\&. This allows the construction of a wide variety of time based outputs\&. The output options for strftime vary from platform to platform, so please check what is available for your platform\&. mosquitto_sub does provide one extension to strftime which is +\fB@N\fR, which can be used to obtain the number of nanoseconds passed in the current second\&. The resolution of this option varies depending on the platform\&. The final sequence character is +\fB\e\fR, which is used to input some characters that would otherwise be difficult to enter\&. +.SS "MQTT related parameters" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%%\fR +a literal %\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%l\fR +the length of the payload in bytes\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%m\fR +the message id (only relevant for messages with QoS>0)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%p\fR +the payload raw bytes (may produce non\-printable characters depending on the payload)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%q\fR +the message QoS\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%r\fR +the retained flag for the message\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%t\fR +the message topic\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%x\fR +the payload with each byte as a hexadecimal number (lower case)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%X\fR +the payload with each byte as a hexadecimal number (upper case)\&. +.RE +.SS "Helpers" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%I\fR +ISO\-8601 format date and time, e\&.g\&. 2016\-08\-10T09:47:38+0100 +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%j\fR +JSON output of message parameters and timestamp, with a quoted and escaped payload\&. For example +{"tst":1470825369,"topic":"greeting","qos":0,"retain":0,"payload":"hello world"} +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%J\fR +JSON output of message parameters and timestamp, with a non\-quoted and non\-escaped payload \- this means the payload must itself be valid JSON\&. For example: +{"tst":1470825369,"topic":"foo","qos":0,"retain":0,"payload":{"temperature":27\&.0,"humidity":57}}\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%I\fR +ISO\-8601 format date and time, e\&.g\&. 2016\-08\-10T09:47:38+0100 +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB%U\fR +Unix timestamp with nanoseconds, e\&.g\&. 1470818943\&.786368637 +.RE +.SS "Time related parameters" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB@@\fR +a literal @\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB@X\fR +pass the character represented by +\fBX\fR +to the strftime function as +\fB%X\fR\&. The options supported are platform dependent\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB@N\fR +the number of nanoseconds that have passed in the current second, with varying timing resolution depending on platform\&. +.RE +.SS "Escape characters" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\e\e\fR +a literal \e\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\e0\fR +a null character\&. Can be used to separate different parameters that may contain spaces (e\&.g\&. topic, payload) so that processing with tools such as +\fBxargs\fR(1) +is easier\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\ea\fR +alert/bell\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\ee\fR +the escape sequence, which can be used with ANSI colour codes to provide coloured output for example\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\en\fR +end of line\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\er\fR +carriage return\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\et\fR +horizontal tab\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\ev\fR +vertical tab\&. +.RE +.SH "WILLS" +.PP +mosquitto_sub can register a message with the broker that will be sent out if it disconnects unexpectedly\&. See +\fBmqtt\fR(7) +for more information\&. +.PP +The minimum requirement for this is to use +\fB\-\-will\-topic\fR +to specify which topic the will should be sent out on\&. This will result in a non\-retained, zero length message with QoS 0\&. +.PP +Use the +\fB\-\-will\-retain\fR, +\fB\-\-will\-payload\fR +and +\fB\-\-will\-qos\fR +arguments to modify the other will parameters\&. +.SH "PROPERTIES" +.PP +The +\fB\-D\fR +/ +\fB\-\-property\fR +option allows adding properties to different stages of the mosquitto_sub run\&. The properties supported for each command are as follows: +.SS "Connect" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBauthentication\-data\fR +(binary data \- note treated as a string in mosquitto_sub) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBauthentication\-method\fR +(UTF\-8 string pair) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBmaximum\-packet\-size\fR +(32\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBreceive\-maximum\fR +(16\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBrequest\-problem\-information\fR +(8\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBrequest\-response\-information\fR +(8\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBsession\-expiry\-interval\fR +(32\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBtopic\-alias\-maximum\fR +(16\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBuser\-property\fR +(UTF\-8 string pair) +.RE +.SS "Subscribe" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBuser\-property\fR +(UTF\-8 string pair) +.RE +.SS "Unsubscribe" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBuser\-property\fR +(UTF\-8 string pair) +.RE +.SS "Disconnect" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBsession\-expiry\-interval\fR +(32\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBuser\-property\fR +(UTF\-8 string pair) +.RE +.SS "Will properties" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBcontent\-type\fR +(UTF\-8 string) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBcorrelation\-data\fR +(binary data \- note treated as a string in mosquitto_sub) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBmessage\-expiry\-interval\fR +(32\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBpayload\-format\-indicator\fR +(8\-bit unsigned integer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBresponse\-topic\fR +(UTF\-8 string) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBuser\-property\fR +(UTF\-8 string pair) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBwill\-delay\-interval\fR +(32\-bit unsigned integer) +.RE +.SH "EXAMPLES" +.PP +Note that these really are examples \- the subscriptions will work if you run them as shown, but there must be something publishing messages on those topics for you to receive anything\&. +.PP +Subscribe to temperature information on localhost with QoS 1: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_sub +\-t +sensors/temperature +\-q +1 +.RE +.PP +Subscribe to hard drive temperature updates on multiple machines/hard drives\&. This expects each machine to be publishing its hard drive temperature to sensors/machines/HOSTNAME/temperature/HD_NAME\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_sub +\-t +sensors/machines/+/temperature/+ +.RE +.PP +Subscribe to all broker status messages: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_sub +\-v +\-t +\e$SYS/# +.RE +.PP +Specify the output format as "ISO\-8601 date : topic : payload in hex" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_sub +\-F \*(Aq@Y\-@m\-@dT@H:@M:@S@z : %t : %x\*(Aq +\-t +\*(Aq#\*(Aq +.RE +.PP +Specify the output format as "seconds since epoch\&.nanoseconds : retained flag : qos : mid : payload length" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_sub +\-F \*(Aq%@s\&.@N : %r : %q : %m : %l\*(Aq +\-q 2 +\-t +\*(Aq#\*(Aq +.RE +.PP +Topic and payload output, but with colour where supported\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_sub +\-F \*(Aq\ee[92m%t \ee[96m%p\ee[0m\*(Aq +\-q 2 +\-t +\*(Aq#\*(Aq +.RE +.SH "FILES" +.PP +$XDG_CONFIG_HOME/mosquitto_sub, $HOME/\&.config/mosquitto_sub +.RS 4 +Configuration file for default options\&. +.RE +.SH "BUGS" +.PP +\fBmosquitto\fR +bug information can be found at +\m[blue]\fB\%https://github.com/eclipse/mosquitto/issues\fR\m[] +.SH "SEE ALSO" +\fBmqtt\fR(7), \fBmosquitto_pub\fR(1), \fBmosquitto_rr\fR(1), \fBmosquitto\fR(8), \fBlibmosquitto\fR(3), \fBmosquitto-tls\fR(7) +.SH "AUTHOR" +.PP +Roger Light +<roger@atchoo\&.org> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_sub.1.meta b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_sub.1.meta new file mode 100644 index 0000000..9eedadd --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_sub.1.meta @@ -0,0 +1,5 @@ +.. title: mosquitto_sub man page +.. slug: mosquitto_sub-1 +.. category: man +.. type: man +.. pretty_url: False diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_sub.1.xml b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_sub.1.xml new file mode 100644 index 0000000..83a500a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mosquitto_sub.1.xml @@ -0,0 +1,992 @@ +<?xml version='1.0' encoding='UTF-8'?> +<?xml-stylesheet type="text/xsl" href="manpage.xsl"?> + +<refentry xml:id="mosquitto_sub" xmlns:xlink="http://www.w3.org/1999/xlink"> + <refmeta> + <refentrytitle>mosquitto_sub</refentrytitle> + <manvolnum>1</manvolnum> + <refmiscinfo class="source">Mosquitto Project</refmiscinfo> + <refmiscinfo class="manual">Commands</refmiscinfo> + </refmeta> + + <refnamediv> + <refname>mosquitto_sub</refname> + <refpurpose>an MQTT version 5/3.1.1/3.1 client for subscribing to topics</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <cmdsynopsis> + <command>mosquitto_sub</command> + <group choice='req'> + <arg choice='plain'> + <arg><option>-h</option> <replaceable>hostname</replaceable></arg> + <arg><option>-p</option> <replaceable>port-number</replaceable></arg> + <arg><option>-u</option> <replaceable>username</replaceable></arg> + <arg><option>-P</option> <replaceable>password</replaceable></arg> + <arg choice='plain' rep='repeat'><option>-t</option> <replaceable>message-topic</replaceable></arg> + </arg> + <arg choice='plain'> + <arg choice='plain'><option>-L</option> <replaceable>URL</replaceable></arg> + <arg choice='opt' rep='repeat'><option>-t</option> <replaceable>message-topic</replaceable></arg> + </arg> + </group> + <arg><option>-A</option> <replaceable>bind-address</replaceable></arg> + <arg><option>-c</option></arg> + <arg><option>-C</option> <replaceable>msg-count</replaceable></arg> + <arg><option>-d</option></arg> + <arg><option>-D</option> <replaceable>command</replaceable> <replaceable>identifier</replaceable> <replaceable>value</replaceable></arg> + <arg><option>-E</option></arg> + <arg><option>-i</option> <replaceable>client-id</replaceable></arg> + <arg><option>-I</option> <replaceable>client-id-prefix</replaceable></arg> + <arg><option>-k</option> <replaceable>keepalive-time</replaceable></arg> + <arg><option>-N</option></arg> + <arg><option>-q</option> <replaceable>message-QoS</replaceable></arg> + <arg><option>--remove-retained</option></arg> + <group choice='opt'> + <arg choice='plain'><option>-R</option></arg> + <arg choice='plain'><option>--retained-only</option></arg> + </group> + <arg><option>--retain-as-published</option></arg> + <arg><option>-S</option></arg> + <arg choice='opt' rep='repeat'><option>-T</option> <replaceable>filter-out</replaceable></arg> + <arg choice='opt' rep='repeat'><option>-U</option> <replaceable>unsub-topic</replaceable></arg> + <arg><option>-v</option></arg> + <arg><option>-V</option> <replaceable>protocol-version</replaceable></arg> + <arg><option>-W</option> <replaceable>message-processing-timeout</replaceable></arg> + <arg><option>--proxy</option> <replaceable>socks-url</replaceable></arg> + <arg><option>--quiet</option></arg> + <arg> + <option>--will-topic</option> <replaceable>topic</replaceable> + <arg><option>--will-payload</option> <replaceable>payload</replaceable></arg> + <arg><option>--will-qos</option> <replaceable>qos</replaceable></arg> + <arg><option>--will-retain</option></arg> + </arg> + <group> + <arg> + <group choice='req'> + <arg choice='plain'><option>--cafile</option> <replaceable>file</replaceable></arg> + <arg choice='plain'><option>--capath</option> <replaceable>dir</replaceable></arg> + </group> + <arg><option>--cert</option> <replaceable>file</replaceable></arg> + <arg><option>--key</option> <replaceable>file</replaceable></arg> + <arg><option>--tls-version</option> <replaceable>version</replaceable></arg> + <arg><option>--tls-alpn</option> <replaceable>protocol</replaceable></arg> + <arg><option>--tls-engine</option> <replaceable>engine</replaceable></arg> + <arg><option>--keyform</option> + <group choice='req'> + <arg choice='plain'><replaceable>pem</replaceable></arg> + <arg choice='plain'><replaceable>engine</replaceable></arg> + </group></arg> + <arg><option>--tls-engine-kpass-sha1</option> <replaceable>kpass-sha1</replaceable></arg> + <arg><option>--insecure</option></arg> + </arg> + <arg> + <arg choice='plain'><option>--psk</option> <replaceable>hex-key</replaceable></arg> + <arg choice='plain'><option>--psk-identity</option> <replaceable>identity</replaceable></arg> + <arg><option>--tls-version</option> <replaceable>version</replaceable></arg> + </arg> + </group> + </cmdsynopsis> + <cmdsynopsis> + <command>mosquitto_sub</command> + <group choice='plain'> + <arg><option>--help</option></arg> + </group> + </cmdsynopsis> + </refsynopsisdiv> + + <refsect1> + <title>Description</title> + <para><command>mosquitto_sub</command> is a simple MQTT version 5/3.1.1 + client that will subscribe to topics and print the messages that + it receives.</para> + <para>In addition to subscribing to topics, + <command>mosquitto_sub</command> can filter out received messages + so they are not printed (see the <option>-T</option> option) or + unsubscribe from topics (see the <option>-U</option> option). + Unsubscribing from topics is useful for clients connecting with + clean session set to false. </para> + </refsect1> + + <refsect1> + <title>Encrypted Connections</title> + <para><command>mosquitto_sub</command> supports TLS encrypted + connections. It is strongly recommended that you use an encrypted + connection for anything more than the most basic setup.</para> + <para>To enable TLS connections when using x509 certificates, one of + either <option>--cafile</option> or <option>--capath</option> must + be provided as an option.</para> + <para>To enable TLS connections when using TLS-PSK, you must use the + <option>--psk</option> and the <option>--psk-identity</option> + options.</para> + </refsect1> + + <refsect1> + <title>Options</title> + <para>The options below may be given on the command line, but may also + be placed in a config file located at + <option>$XDG_CONFIG_HOME/mosquitto_sub</option> or + <option>$HOME/.config/mosquitto_sub</option> with one pair of + <option>-option <replaceable>value</replaceable></option> + per line. The values in the config file will be used as defaults + and can be overridden by using the command line. The exceptions to + this are <option>-t</option> and <option>-T</option>, which if + given in the config file will not be overridden. Note also that + currently some options cannot be negated, e.g. + <option>-S</option>. Config file lines that have a + <option>#</option> as the first character are treated as comments + and not processed any further.</para> + <variablelist> + <varlistentry> + <term><option>-A</option></term> + <listitem> + <para>Bind the outgoing connection to a local ip + address/hostname. Use this argument if you need to + restrict network communication to a particular + interface.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-c</option></term> + <term><option>--disable-clean-session</option></term> + <listitem> + <para>Disable the 'clean session' flag. This means that all + of the subscriptions for the client will be maintained + after it disconnects, along with subsequent QoS 1 and QoS 2 + messages that arrive. When the client reconnects, it will + receive all of the queued messages.</para> + <para>If using this option, the client id must be set + manually with <option>--id</option></para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--cafile</option></term> + <listitem> + <para>Define the path to a file containing PEM encoded CA + certificates that are trusted. Used to enable SSL + communication.</para> + <para>See also <option>--capath</option></para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--capath</option></term> + <listitem> + <para>Define the path to a directory containing PEM encoded CA + certificates that are trusted. Used to enable SSL + communication.</para> + <para>For <option>--capath</option> to work correctly, the + certificate files must have ".crt" as the file ending + and you must run "openssl rehash <path to capath>" each + time you add/remove a certificate.</para> + <para>See also <option>--cafile</option></para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--cert</option></term> + <listitem> + <para>Define the path to a file containing a PEM encoded + certificate for this client, if required by the + server.</para> + <para>See also <option>--key</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--ciphers</option></term> + <listitem> + <para>An openssl compatible list of TLS ciphers to support + in the client. See + <citerefentry><refentrytitle>ciphers</refentrytitle><manvolnum>1</manvolnum></citerefentry> + for more information.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-C</option></term> + <listitem> + <para>Disconnect and exit the program immediately after + the given count of messages have been received. This + may be useful in shell scripts where on a single status + value is required, for example.</para> + <para>Combine with <option>-R</option> to print only the + first set of fresh messages (i.e. that does not have + the retained flag set), or with <option>-T</option> to + filter which topics are processed.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-d</option></term> + <term><option>--debug</option></term> + <listitem> + <para>Enable debug messages.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-D</option></term> + <term><option>--property</option></term> + <listitem> + <para>Use an MQTT v5 property with this publish. If you use + this option, the client will be set to be an MQTT v5 + client. This option has two forms:</para> + <para><option>-D command identifier value</option></para> + <para><option>-D command identifier name value</option></para> + <para><option>command</option> is the MQTT command/packet + identifier and can be one of CONNECT, PUBACK, PUBREC, + PUBCOMP, SUBSCRIBE, UNSUBSCRIBE, DISCONNECT, AUTH, or + WILL. The properties available for each command are + listed in the Properties section.</para> + + <para><option>identifier</option> is the name of the + property to add. This is as described in the + specification, but with '-' as a word separator. For + example: + <option>payload-format-indicator</option>. More details + are in the <link linkend='properties'>Properties</link> + section.</para> + + <para><option>value</option> is the value of the property + to add, with a data type that is property + specific.</para> + + <para><option>name</option> is only used for the + <option>user-property</option> property as the first of + the two strings in the string pair. In that case, + <option>value</option> is the second of the strings in + the pair.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-E</option></term> + <listitem> + <para>If this option is given, + <command>mosquitto_sub</command> will exit immediately + that all of its subscriptions have been acknowledged by + the broker. In conjunction with <option>-c</option> + this allows a durable client session to be initialised + on the broker for future use without requiring any + messages to be received.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-F</option></term> + <listitem> + <para>Specify output printing format. This option allows + you to choose what information from each message is + printed to the screen. See the <link + linkend='outputformat'>Output Format</link> section + below for full details.</para> + <para>This option overrides the <option>-v</option> option, + but does not override the <option>-N</option> + option.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--help</option></term> + <listitem> + <para>Display usage information.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-h</option></term> + <term><option>--host</option></term> + <listitem> + <para>Specify the host to connect to. Defaults to localhost.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-i</option></term> + <term><option>--id</option></term> + <listitem> + <para>The id to use for this client. If not given, defaults + to mosquitto_sub_ appended with the process id of the + client. Cannot be used at the same time as the + <option>--id-prefix</option> argument.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-I</option></term> + <term><option>--id-prefix</option></term> + <listitem> + <para>Provide a prefix that the client id will be built + from by appending the process id of the client. This is + useful where the broker is using the clientid_prefixes + option. Cannot be used at the same time as the + <option>--id</option> argument.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--insecure</option></term> + <listitem> + <para>When using certificate based encryption, this option + disables verification of the server hostname in the + server certificate. This can be useful when testing + initial server configurations but makes it possible for + a malicious third party to impersonate your server + through DNS spoofing, for example. Use this option in + testing <emphasis>only</emphasis>. If you need to + resort to using this option in a production + environment, your setup is at fault and there is no + point using encryption.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-k</option></term> + <term><option>--keepalive</option></term> + <listitem> + <para>The number of seconds between sending PING commands + to the broker for the purposes of informing it we are still + connected and functioning. Defaults to 60 seconds.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--key</option></term> + <listitem> + <para>Define the path to a file containing a PEM encoded + private key for this client, if required by the + server.</para> + <para>See also <option>--cert</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--keyform</option></term> + <listitem> + <para>Specifies the type of private key in use when making + TLS connections.. This can be "pem" or "engine". This + parameter is useful when a TPM module is being used and + the private key has been created with it. Defaults to + "pem", which means normal private key files are + used.</para> + <para>See also <option>--tls-engine</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-L</option></term> + <term><option>--url</option></term> + <listitem> + <para>Specify specify user, password, hostname, port and + topic at once as a URL. The URL must be in the form: + mqtt(s)://[username[:password]@]host[:port]/topic</para> + <para>If the scheme is mqtt:// then the port defaults to + 1883. If the scheme is mqtts:// then the port defaults + to 8883.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-N</option></term> + <listitem> + <para>Do not append an end of line character to the payload + when printing. This allows streaming of payload data + from multiple messages directly to another application + unmodified. Only really makes sense when not using + <option>-v</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-p</option></term> + <term><option>--port</option></term> + <listitem> + <para>Connect to the port specified. If not given, the + default of 1883 for plain MQTT or 8883 for MQTT over + TLS will be used.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-P</option></term> + <term><option>--pw</option></term> + <listitem> + <para>Provide a password to be used for authenticating with + the broker. Using this argument without also specifying + a username is invalid when using MQTT v3.1 or v3.1.1. + See also the <option>--username</option> option.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--proxy</option></term> + <listitem> + <para>Specify a SOCKS5 proxy to connect through. "None" and + "username" authentication types are supported. The + <option>socks-url</option> must be of the form + <option>socks5h://[username[:password]@]host[:port]</option>. + The protocol prefix <option>socks5h</option> means that + hostnames are resolved by the proxy. The symbols %25, + %3A and %40 are URL decoded into %, : and @ + respectively, if present in the username or + password.</para> + <para>If username is not given, then no authentication is + attempted. If the port is not given, then the default + of 1080 is used.</para> + <para>More SOCKS versions may be available in the future, + depending on demand, and will use different protocol + prefixes as described in <citerefentry> + <refentrytitle>curl</refentrytitle> + <manvolnum>1</manvolnum> </citerefentry>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--psk</option></term> + <listitem> + <para>Provide the hexadecimal (no leading 0x) + pre-shared-key matching the one used on the broker to + use TLS-PSK encryption support. + <option>--psk-identity</option> must also be provided + to enable TLS-PSK.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--psk-identity</option></term> + <listitem> + <para>The client identity to use with TLS-PSK support. This + may be used instead of a username if the broker is + configured to do so.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-q</option></term> + <term><option>--qos</option></term> + <listitem> + <para>Specify the quality of service desired for the + incoming messages, from 0, 1 and 2. Defaults to 0. See + <citerefentry><refentrytitle>mqtt</refentrytitle><manvolnum>7</manvolnum></citerefentry> + for more information on QoS.</para> + <para>The QoS is identical for all topics subscribed to in + a single instance of mosquitto_sub.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--quiet</option></term> + <listitem> + <para>If this argument is given, no runtime errors will be + printed. This excludes any error messages given in case of + invalid user input (e.g. using <option>--port</option> without a + port).</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-R</option></term> + <listitem> + <para>If this argument is given, messages that are received + that have the retain bit set will not be printed. + Messages with retain set are "stale", in that it is not + known when they were originally published. When + subscribing to a wildcard topic there may be a large + number of retained messages. This argument suppresses + their display.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--remove-retained</option></term> + <listitem> + <para>If this argument is given, the when mosquitto_sub + receives a message with the retained bit set, it will + send a message to the broker to clear that retained + message. This applies to all received messages except + those that are filtered out by the <option>-T</option> + option. This option still takes effect even if + <option>-R</option> is used. See also the + <option>--retain-as-published</option> and + <option>--retained-only</option> options.</para> + + <example title="remove-retained-example-1" label="1"> + <para>Remove all retained messages on the server, + assuming we have access to do so, and then exit:</para> + + <programlisting language="config"> +mosquitto_sub -t '#' --remove-retained --retained-only</programlisting> + </example> + + <example title="remove-retained-example-2" label="2"> + <para>Remove a whole tree, with the exception of a + single topic:</para> + + <programlisting language="config"> +mosquitto_sub -t 'bbc/#' -T bbc/bbc1 --remove-retained</programlisting> + </example> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--retained-only</option></term> + <listitem> + <para>If this argument is given, only messages that are + received that have the retain bit set will be printed. + Messages with retain set are "stale", in that it is not + known when they were originally published. With this + argument in use, the receipt of the first non-stale + message will cause the client to exit. See also the + <option>--retain-as-published</option> option.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--retain-as-published</option></term> + <listitem> + <para>If this argument is given, the subscriptions will + have the "retain as published" option set. This means + that the retain flag on an incoming message will be + exactly as set by the publishing client, rather than + indicating whether the message is fresh/stale.</para> + <para>This option is not valid for MQTT v3.1/v3.1.1 + clients.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-S</option></term> + <listitem> + <para>Use SRV lookups to determine which host to connect + to. Performs lookups to + <option>_mqtt._tcp.<host></option> when used in + conjunction with <option>-h</option>, otherwise uses + <option>_mqtt._tcp.<local dns + domain></option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-t</option></term> + <term><option>--topic</option></term> + <listitem> + <para>The MQTT topic to subscribe to. See + <citerefentry><refentrytitle>mqtt</refentrytitle><manvolnum>7</manvolnum></citerefentry> + for more information on MQTT topics.</para> + <para>This option may be repeated to subscribe to multiple topics.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-T</option></term> + <term><option>--filter-out</option></term> + <listitem> + <para>Suppress printing of topics that match the filter. + This allows subscribing to a wildcard topic and only + printing a partial set of the wildcard + hierarchy.</para> + <para>For example, subscribe to the BBC tree, but suppress output from Radio 3:</para> + <itemizedlist mark="circle"> + <listitem><para>mosquitto_sub <literal>-t</literal> + bbc/# <literal>-T</literal> + bbc/radio3</para></listitem> + </itemizedlist> + <para>This option may be repeated to filter out multiple + topics or topic trees.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--tls-alpn</option></term> + <listitem> + <para>Provide a protocol to use when connecting to a broker + that has multiple protocols available on a single port, + e.g. MQTT and WebSockets.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--tls-engine</option></term> + <listitem> + <para>A valid openssl engine id. These can be listed with + openssl engine command.</para> + <para>See also <option>--keyform</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--tls-engine-kpass-sha1</option></term> + <listitem> + <para>SHA1 of the private key password when using an TLS + engine. Some TLS engines such as the TPM engine may + require the use of a password in order to be accessed. + This option allows a hex encoded SHA1 hash of the + password to the engine directly, instead of the user + being prompted for the password.</para> + <para>See also <option>--tls-engine</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--tls-version</option></term> + <listitem> + <para>Choose which TLS protocol version to use when + communicating with the broker. Valid options are + <option>tlsv1.3</option>, <option>tlsv1.2</option> and + <option>tlsv1.1</option>. The default value is + <option>tlsv1.2</option>. Must match the protocol + version used by the broker.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-u</option></term> + <term><option>--username</option></term> + <listitem> + <para>Provide a username to be used for authenticating with + the broker. See also the <option>--pw</option> + argument.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-U</option></term> + <term><option>--unsubscribe</option></term> + <listitem> + <para>A topic that will be unsubscribed from. This may be + used on its own or in conjunction with the + <option>--topic</option> option and only makes sense + when used in conjunction with + <option>--clean-session</option>.</para> + <para>If used with <option>--topic</option> then + subscriptions will be processed before + unsubscriptions.</para> + <para>Note that it is only possible to unsubscribe from + subscriptions that have previously been made. It is not + possible to punch holes in wildcard subscriptions. For + example, subscribing to <option>sensors/#</option> and + then unsubscribing from + <option>sensors/+/temperature</option> as shown below + will still result in messages matching the + <option>sensors/+/temperature</option> being delivered + to the client.</para> + <itemizedlist mark="circle"> + <listitem><para>mosquitto_sub <literal>-t</literal> sensors/# <literal>-U</literal> sensors/+/temperature <literal>-v</literal></para></listitem> + </itemizedlist> + + <para>Note also that because retained messages are + published by the broker on receipt of a SUBSCRIBE + command, subscribing and unsubscribing to the same + topic may result in messages being received at the + client.</para> + + <para>This option may be repeated to unsubscribe from multiple topics.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-v</option></term> + <term><option>--verbose</option></term> + <listitem> + <para>Print received messages verbosely. With this + argument, messages will be printed as "topic payload". When + this argument is not given, the messages are printed as + "payload".</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-V</option></term> + <term><option>--protocol-version</option></term> + <listitem> + <para>Specify which version of the MQTT protocol should be + used when connecting to the remote broker. Can be + <option>5</option>, <option>311</option>, + <option>31</option>, or the more verbose + <option>mqttv5</option>, <option>mqttv311</option>, or + <option>mqttv31</option>. + Defaults to <option>311</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-W</option></term> + <listitem> + <para>Provide a timeout as an integer number of seconds. + mosquitto_sub will stop processing messages and + disconnect after this number of seconds has + passed. The timeout starts just after the client has + connected to the broker.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--will-payload</option></term> + <listitem> + <para>Specify a message that will be stored by the broker + and sent out if this client disconnects unexpectedly. This + must be used in conjunction with <option>--will-topic</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--will-qos</option></term> + <listitem> + <para>The QoS to use for the Will. Defaults to 0. This must + be used in conjunction with <option>--will-topic</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--will-retain</option></term> + <listitem> + <para>If given, if the client disconnects unexpectedly the + message sent out will be treated as a retained message. + This must be used in conjunction with <option>--will-topic</option>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><option>--will-topic</option></term> + <listitem> + <para>The topic on which to send a Will, in the event that + the client disconnects unexpectedly.</para> + </listitem> + </varlistentry> + </variablelist> + </refsect1> + + <refsect1 id='outputformat'> + <title>Output format</title> + <para>There are three ways of formatting the output from mosquitto_sub. + In all cases a new-line character is appended for each message + received unless the <option>-N</option> argument is passed to + mosquitto_sub.</para> + <para>Payload-only is the default output format and will + print the payload exactly as it is received.</para> + <para>Verbose mode is activated with <option>-v</option> and prints the + message topic and the payload, separated by a space.</para> + <para>The final option is formatted output, which allows the user to + define a custom output format. The behaviour is controlled with + the <option>-F format-string</option> option. The format string is + a free text string where interpreted sequences are replaced by + different parameters. The available interpreted sequences are + described below.</para> + <para>Three characters are used to start an interpreted sequence: + <option>%</option>, <option>@</option> and <option>\</option>. + Sequences starting with <option>%</option> are either parameters + related to the MQTT message being printed, or are helper sequences + to avoid the need to type long date format strings for example. + Sequences starting with <option>@</option> are passed to the + <citerefentry><refentrytitle>strftime</refentrytitle><manvolnum>3</manvolnum></citerefentry> + function (with the @ replaced with a % - note that only the + character immediately after the @ is passed to strftime). This + allows the construction of a wide variety of time based outputs. + The output options for strftime vary from platform to platform, so + please check what is available for your platform. mosquitto_sub + does provide one extension to strftime which is + <option>@N</option>, which can be used to obtain the number of + nanoseconds passed in the current second. The resolution of this + option varies depending on the platform. The final sequence + character is <option>\</option>, which is used to input some + characters that would otherwise be difficult to enter.</para> + + <refsect2> + <title>MQTT related parameters</title> + <itemizedlist mark="circle"> + <listitem><para><option>%%</option> a literal %.</para></listitem> + <listitem><para><option>%l</option> the length of the payload in bytes.</para></listitem> + <listitem><para><option>%m</option> the message id (only relevant for messages with QoS>0).</para></listitem> + <listitem><para><option>%p</option> the payload raw bytes (may produce non-printable characters depending on the payload).</para></listitem> + <listitem><para><option>%q</option> the message QoS.</para></listitem> + <listitem><para><option>%r</option> the retained flag for the message.</para></listitem> + <listitem><para><option>%t</option> the message topic.</para></listitem> + <listitem><para><option>%x</option> the payload with each byte as a hexadecimal number (lower case).</para></listitem> + <listitem><para><option>%X</option> the payload with each byte as a hexadecimal number (upper case).</para></listitem> + </itemizedlist> + </refsect2> + + <refsect2> + <title>Helpers</title> + <itemizedlist mark="circle"> + <listitem><para><option>%I</option> ISO-8601 format date and time, e.g. 2016-08-10T09:47:38+0100</para></listitem> + <listitem><para><option>%j</option> JSON output of message + parameters and timestamp, with a quoted and escaped + payload. For example + <code>{"tst":1470825369,"topic":"greeting","qos":0,"retain":0,"payload":"hello + world"}</code></para></listitem> + <listitem><para><option>%J</option> JSON output of message + parameters and timestamp, with a non-quoted and + non-escaped payload - this means the payload must + itself be valid JSON. For example: + <code>{"tst":1470825369,"topic":"foo","qos":0,"retain":0,"payload":{"temperature":27.0,"humidity":57}}</code>.</para></listitem> + <listitem><para><option>%I</option> ISO-8601 format date and time, e.g. 2016-08-10T09:47:38+0100</para></listitem> + <listitem><para><option>%U</option> Unix timestamp with nanoseconds, e.g. 1470818943.786368637</para></listitem> + </itemizedlist> + </refsect2> + + <refsect2> + <title>Time related parameters</title> + <itemizedlist mark="circle"> + <listitem><para><option>@@</option> a literal @.</para></listitem> + <listitem><para><option>@X</option> pass the character represented + by <option>X</option> to the strftime function as + <option>%X</option>. The options supported are platform + dependent.</para></listitem> + <listitem><para><option>@N</option> the number of nanoseconds that + have passed in the current second, with varying timing + resolution depending on platform.</para></listitem> + </itemizedlist> + </refsect2> + + <refsect2> + <title>Escape characters</title> + <itemizedlist mark="circle"> + <listitem><para><option>\\</option> a literal \.</para></listitem> + <listitem><para><option>\0</option> a null character. Can be used + to separate different parameters that may contain spaces + (e.g. topic, payload) so that processing with tools such as + <citerefentry><refentrytitle>xargs</refentrytitle><manvolnum>1</manvolnum></citerefentry> + is easier.</para></listitem> + <listitem><para><option>\a</option> alert/bell.</para></listitem> + <listitem><para><option>\e</option> the escape sequence, which can + be used with ANSI colour codes to provide coloured output + for example.</para></listitem> + <listitem><para><option>\n</option> end of line.</para></listitem> + <listitem><para><option>\r</option> carriage return.</para></listitem> + <listitem><para><option>\t</option> horizontal tab.</para></listitem> + <listitem><para><option>\v</option> vertical tab.</para></listitem> + </itemizedlist> + </refsect2> + </refsect1> + + <refsect1> + <title>Wills</title> + <para>mosquitto_sub can register a message with the broker that will be + sent out if it disconnects unexpectedly. See + <citerefentry><refentrytitle>mqtt</refentrytitle><manvolnum>7</manvolnum></citerefentry> + for more information.</para> + <para>The minimum requirement for this is to use <option>--will-topic</option> to + specify which topic the will should be sent out on. This will result in + a non-retained, zero length message with QoS 0.</para> + <para>Use the <option>--will-retain</option>, <option>--will-payload</option> and <option>--will-qos</option> arguments to + modify the other will parameters.</para> + </refsect1> + + <refsect1 id='properties'> + <title>Properties</title> + <para>The <option>-D</option> / <option>--property</option> option + allows adding properties to different stages of the mosquitto_sub + run. The properties supported for each command are as + follows:</para> + + <refsect2> + <title>Connect</title> + <itemizedlist> + <listitem><para><option>authentication-data</option> (binary data - note treated as a string in mosquitto_sub)</para></listitem> + <listitem><para><option>authentication-method</option> (UTF-8 string pair)</para></listitem> + <listitem><para><option>maximum-packet-size</option> (32-bit unsigned integer)</para></listitem> + <listitem><para><option>receive-maximum</option> (16-bit unsigned integer)</para></listitem> + <listitem><para><option>request-problem-information</option> (8-bit unsigned integer)</para></listitem> + <listitem><para><option>request-response-information</option> (8-bit unsigned integer)</para></listitem> + <listitem><para><option>session-expiry-interval</option> (32-bit unsigned integer)</para></listitem> + <listitem><para><option>topic-alias-maximum</option> (16-bit unsigned integer)</para></listitem> + <listitem><para><option>user-property</option> (UTF-8 string pair)</para></listitem> + </itemizedlist> + </refsect2> + + <refsect2> + <title>Subscribe</title> + <itemizedlist> + <listitem><para><option>user-property</option> (UTF-8 string pair)</para></listitem> + </itemizedlist> + </refsect2> + + <refsect2> + <title>Unsubscribe</title> + <itemizedlist> + <listitem><para><option>user-property</option> (UTF-8 string pair)</para></listitem> + </itemizedlist> + </refsect2> + + <refsect2> + <title>Disconnect</title> + <itemizedlist> + <listitem><para><option>session-expiry-interval</option> (32-bit unsigned integer)</para></listitem> + <listitem><para><option>user-property</option> (UTF-8 string pair)</para></listitem> + </itemizedlist> + </refsect2> + + <refsect2> + <title>Will properties</title> + <itemizedlist> + <listitem><para><option>content-type</option> (UTF-8 string)</para></listitem> + <listitem><para><option>correlation-data</option> (binary data - note treated as a string in mosquitto_sub)</para></listitem> + <listitem><para><option>message-expiry-interval</option> (32-bit unsigned integer)</para></listitem> + <listitem><para><option>payload-format-indicator</option> (8-bit unsigned integer)</para></listitem> + <listitem><para><option>response-topic</option> (UTF-8 string)</para></listitem> + <listitem><para><option>user-property</option> (UTF-8 string pair)</para></listitem> + <listitem><para><option>will-delay-interval</option> (32-bit unsigned integer)</para></listitem> + </itemizedlist> + </refsect2> + </refsect1> + + <refsect1> + <title>Examples</title> + <para>Note that these really are examples - the subscriptions will work + if you run them as shown, but there must be something publishing + messages on those topics for you to receive anything.</para> + <para>Subscribe to temperature information on localhost with QoS 1:</para> + <itemizedlist mark="circle"> + <listitem><para>mosquitto_sub <literal>-t</literal> sensors/temperature <literal>-q</literal> 1</para></listitem> + </itemizedlist> + <para>Subscribe to hard drive temperature updates on multiple + machines/hard drives. This expects each machine to be publishing its + hard drive temperature to + sensors/machines/HOSTNAME/temperature/HD_NAME.</para> + <itemizedlist mark="circle"> + <listitem><para>mosquitto_sub <literal>-t</literal> sensors/machines/+/temperature/+</para></listitem> + </itemizedlist> + <para>Subscribe to all broker status messages:</para> + <itemizedlist mark="circle"> + <listitem><para>mosquitto_sub <literal>-v</literal> <literal>-t</literal> \$SYS/#</para></listitem> + </itemizedlist> + + <para>Specify the output format as "ISO-8601 date : topic : payload in hex"</para> + <itemizedlist mark="circle"> + <listitem><para>mosquitto_sub <literal>-F '@Y-@m-@dT@H:@M:@S@z : %t : %x'</literal> <literal>-t</literal> '#'</para></listitem> + </itemizedlist> + + <para>Specify the output format as "seconds since epoch.nanoseconds : retained flag : qos : mid : payload length"</para> + <itemizedlist mark="circle"> + <listitem><para>mosquitto_sub <literal>-F '%@s.@N : %r : %q : %m : %l'</literal> <literal>-q 2</literal> <literal>-t</literal> '#'</para></listitem> + </itemizedlist> + + <para>Topic and payload output, but with colour where supported.</para> + <itemizedlist mark="circle"> + <listitem><para>mosquitto_sub <literal>-F '\e[92m%t \e[96m%p\e[0m'</literal> <literal>-q 2</literal> <literal>-t</literal> '#'</para></listitem> + </itemizedlist> + </refsect1> + + <refsect1> + <title>Files</title> + <variablelist> + <varlistentry> + <term><filename>$XDG_CONFIG_HOME/mosquitto_sub</filename></term> + <term><filename>$HOME/.config/mosquitto_sub</filename></term> + <listitem> + <para>Configuration file for default options.</para> + </listitem> + </varlistentry> + </variablelist> + </refsect1> + + <refsect1> + <title>Bugs</title> + <para><command>mosquitto</command> bug information can be found at + <ulink url="https://github.com/eclipse/mosquitto/issues"/></para> + </refsect1> + + <refsect1> + <title>See Also</title> + <simplelist type="inline"> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mqtt-7.html">mqtt</link></refentrytitle> + <manvolnum>7</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto_pub-1.html">mosquitto_pub</link></refentrytitle> + <manvolnum>1</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto_rr-1.html">mosquitto_rr</link></refentrytitle> + <manvolnum>1</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto-8.html">mosquitto</link></refentrytitle> + <manvolnum>8</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="libmosquitto-3.html">libmosquitto</link></refentrytitle> + <manvolnum>3</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto-tls-7.html">mosquitto-tls</link></refentrytitle> + <manvolnum>7</manvolnum> + </citerefentry> + </member> + </simplelist> + </refsect1> + + <refsect1> + <title>Author</title> + <para>Roger Light <email>roger@atchoo.org</email></para> + </refsect1> +</refentry> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mqtt.7 b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mqtt.7 new file mode 100644 index 0000000..e15216e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mqtt.7 @@ -0,0 +1,293 @@ +'\" t +.\" Title: mqtt +.\" Author: [see the "Author" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> +.\" Date: 06/18/2019 +.\" Manual: Conventions and miscellaneous +.\" Source: Mosquitto Project +.\" Language: English +.\" +.TH "MQTT" "7" "06/18/2019" "Mosquitto Project" "Conventions and miscellaneous" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +mqtt \- MQ Telemetry Transport +.SH "SYNOPSIS" +.HP \w'\fBMQTT\fR\ 'u +\fBMQTT\fR +.SH "DESCRIPTION" +.PP +\fBMQTT\fR +is a lightweight publish/subscribe messaging protocol\&. It is useful for use with low power sensors, but is applicable to many scenarios\&. +.PP +This manual describes some of the features of MQTT version 3\&.1\&.1/3\&.1, to assist end users in getting the most out of the protocol\&. For more complete information on MQTT, see +http://mqtt\&.org/\&. +.SH "PUBLISH/SUBSCRIBE" +.PP +The MQTT protocol is based on the principle of publishing messages and subscribing to topics, or "pub/sub"\&. Multiple clients connect to a broker and subscribe to topics that they are interested in\&. Clients also connect to the broker and publish messages to topics\&. Many clients may subscribe to the same topics and do with the information as they please\&. The broker and MQTT act as a simple, common interface for everything to connect to\&. This means that you if you have clients that dump subscribed messages to a database, to Twitter, Cosm or even a simple text file, then it becomes very simple to add new sensors or other data input to a database, Twitter or so on\&. +.SH "TOPICS/SUBSCRIPTIONS" +.PP +Messages in MQTT are published on topics\&. There is no need to configure a topic, publishing on it is enough\&. Topics are treated as a hierarchy, using a slash (/) as a separator\&. This allows sensible arrangement of common themes to be created, much in the same way as a filesystem\&. For example, multiple computers may all publish their hard drive temperature information on the following topic, with their own computer and hard drive name being replaced as appropriate: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +sensors/COMPUTER_NAME/temperature/HARDDRIVE_NAME +.RE +.PP +Clients can receive messages by creating subscriptions\&. A subscription may be to an explicit topic, in which case only messages to that topic will be received, or it may include wildcards\&. Two wildcards are available, +\fB+\fR +or +\fB#\fR\&. +.PP +\fB+\fR +can be used as a wildcard for a single level of hierarchy\&. It could be used with the topic above to get information on all computers and hard drives as follows: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +sensors/+/temperature/+ +.RE +.PP +As another example, for a topic of "a/b/c/d", the following example subscriptions will match: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/b/c/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} ++/b/c/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/+/c/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/+/+/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} ++/+/+/+ +.RE +.PP +The following subscriptions will not match: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/b/c +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +b/+/c/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} ++/+/+ +.RE +.PP +\fB#\fR +can be used as a wildcard for all remaining levels of hierarchy\&. This means that it must be the final character in a subscription\&. With a topic of "a/b/c/d", the following example subscriptions will match: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/b/c/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +# +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/# +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/b/# +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/b/c/# +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} ++/b/c/# +.RE +.PP +Zero length topic levels are valid, which can lead to some slightly non\-obvious behaviour\&. For example, a topic of "a//topic" would correctly match against a subscription of "a/+/topic"\&. Likewise, zero length topic levels can exist at both the beginning and the end of a topic string, so "/a/topic" would match against a subscription of "+/a/topic", "#" or "/#", and a topic "a/topic/" would match against a subscription of "a/topic/+" or "a/topic/#"\&. +.SH "QUALITY OF SERVICE" +.PP +MQTT defines three levels of Quality of Service (QoS)\&. The QoS defines how hard the broker/client will try to ensure that a message is received\&. Messages may be sent at any QoS level, and clients may attempt to subscribe to topics at any QoS level\&. This means that the client chooses the maximum QoS it will receive\&. For example, if a message is published at QoS 2 and a client is subscribed with QoS 0, the message will be delivered to that client with QoS 0\&. If a second client is also subscribed to the same topic, but with QoS 2, then it will receive the same message but with QoS 2\&. For a second example, if a client is subscribed with QoS 2 and a message is published on QoS 0, the client will receive it on QoS 0\&. +.PP +Higher levels of QoS are more reliable, but involve higher latency and have higher bandwidth requirements\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +0: The broker/client will deliver the message once, with no confirmation\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +1: The broker/client will deliver the message at least once, with confirmation required\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +2: The broker/client will deliver the message exactly once by using a four step handshake\&. +.RE +.SH "RETAINED MESSAGES" +.PP +All messages may be set to be retained\&. This means that the broker will keep the message even after sending it to all current subscribers\&. If a new subscription is made that matches the topic of the retained message, then the message will be sent to the client\&. This is useful as a "last known good" mechanism\&. If a topic is only updated infrequently, then without a retained message, a newly subscribed client may have to wait a long time to receive an update\&. With a retained message, the client will receive an instant update\&. +.SH "CLEAN SESSION / DURABLE CONNECTIONS" +.PP +On connection, a client sets the "clean session" flag, which is sometimes also known as the "clean start" flag\&. If clean session is set to false, then the connection is treated as durable\&. This means that when the client disconnects, any subscriptions it has will remain and any subsequent QoS 1 or 2 messages will be stored until it connects again in the future\&. If clean session is true, then all subscriptions will be removed for the client when it disconnects\&. +.SH "WILLS" +.PP +When a client connects to a broker, it may inform the broker that it has a will\&. This is a message that it wishes the broker to send when the client disconnects unexpectedly\&. The will message has a topic, QoS and retain status just the same as any other message\&. +.SH "SEE ALSO" +\fBmosquitto\fR(8), \fBmosquitto_pub\fR(1), \fBmosquitto_sub\fR(1) +.SH "AUTHOR" +.PP +Roger Light +<roger@atchoo\&.org> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mqtt.7.meta b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mqtt.7.meta new file mode 100644 index 0000000..8372744 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mqtt.7.meta @@ -0,0 +1,6 @@ +.. title: MQTT man page +.. slug: mqtt-7 +.. category: man +.. type: man +.. pretty_url: False +.. hide_title: True diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mqtt.7.xml b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mqtt.7.xml new file mode 100644 index 0000000..dc06582 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/man/mqtt.7.xml @@ -0,0 +1,187 @@ +<?xml version='1.0' encoding='UTF-8'?> +<?xml-stylesheet type="text/xsl" href="manpage.xsl"?> + +<refentry xml:id="mqtt" xmlns:xlink="http://www.w3.org/1999/xlink"> + <refmeta> + <refentrytitle>mqtt</refentrytitle> + <manvolnum>7</manvolnum> + <refmiscinfo class="source">Mosquitto Project</refmiscinfo> + <refmiscinfo class="manual">Conventions and miscellaneous</refmiscinfo> + </refmeta> + + <refnamediv> + <refname>mqtt</refname> + <refpurpose>MQ Telemetry Transport</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <cmdsynopsis> + <command>MQTT</command> + </cmdsynopsis> + </refsynopsisdiv> + + <refsect1> + <title>Description</title> + <para><command>MQTT</command> is a lightweight publish/subscribe + messaging protocol. It is useful for use with low power sensors, but + is applicable to many scenarios.</para> <para>This manual describes + some of the features of MQTT version 3.1.1/3.1, to assist end users in + getting the most out of the protocol. For more complete information on + MQTT, see <uri type="webpage">http://mqtt.org/</uri>.</para> + </refsect1> + + <refsect1> + <title>Publish/Subscribe</title> + <para>The MQTT protocol is based on the principle of publishing + messages and subscribing to topics, or "pub/sub". Multiple clients + connect to a broker and subscribe to topics that they are interested + in. Clients also connect to the broker and publish messages to topics. + Many clients may subscribe to the same topics and do with the + information as they please. The broker and MQTT act as a simple, common + interface for everything to connect to. This means that you if you have + clients that dump subscribed messages to a database, to Twitter, + Cosm or even a simple text file, then it becomes very simple to add + new sensors or other data input to a database, Twitter or so on.</para> + </refsect1> + + <refsect1> + <title>Topics/Subscriptions</title> + <para>Messages in MQTT are published on topics. There is no need to + configure a topic, publishing on it is enough. Topics are treated as a + hierarchy, using a slash (/) as a separator. This allows sensible + arrangement of common themes to be created, much in the same way as a + filesystem. For example, multiple computers may all publish their + hard drive temperature information on the following topic, with their + own computer and hard drive name being replaced as appropriate:</para> + <itemizedlist> + <listitem><para>sensors/COMPUTER_NAME/temperature/HARDDRIVE_NAME</para></listitem> + </itemizedlist> + <para>Clients can receive messages by creating subscriptions. A + subscription may be to an explicit topic, in which case only messages + to that topic will be received, or it may include wildcards. Two + wildcards are available, <option>+</option> or <option>#</option>.</para> + <para><option>+</option> can be used as a wildcard for a single level + of hierarchy. It could be used with the topic above to get information + on all computers and hard drives as follows:</para> + <itemizedlist> + <listitem><para>sensors/+/temperature/+</para></listitem> + </itemizedlist> + <para>As another example, for a topic of "a/b/c/d", the following + example subscriptions will match:</para> + <itemizedlist mark="circle"> + <listitem><para>a/b/c/d</para></listitem> + <listitem><para>+/b/c/d</para></listitem> + <listitem><para>a/+/c/d</para></listitem> + <listitem><para>a/+/+/d</para></listitem> + <listitem><para>+/+/+/+</para></listitem> + </itemizedlist> + <para>The following subscriptions will not match:</para> + <itemizedlist mark="circle"> + <listitem><para>a/b/c</para></listitem> + <listitem><para>b/+/c/d</para></listitem> + <listitem><para>+/+/+</para></listitem> + </itemizedlist> + <para><option>#</option> can be used as a wildcard for all remaining levels of + hierarchy. This means that it must be the final character in a + subscription. With a topic of "a/b/c/d", the following example + subscriptions will match:</para> + <itemizedlist mark="circle"> + <listitem><para>a/b/c/d</para></listitem> + <listitem><para>#</para></listitem> + <listitem><para>a/#</para></listitem> + <listitem><para>a/b/#</para></listitem> + <listitem><para>a/b/c/#</para></listitem> + <listitem><para>+/b/c/#</para></listitem> + </itemizedlist> + <para>Zero length topic levels are valid, which can lead to some + slightly non-obvious behaviour. For example, a topic of "a//topic" + would correctly match against a subscription of "a/+/topic". + Likewise, zero length topic levels can exist at both the beginning + and the end of a topic string, so "/a/topic" would match against a + subscription of "+/a/topic", "#" or "/#", and a topic "a/topic/" + would match against a subscription of "a/topic/+" or + "a/topic/#".</para> + </refsect1> + + <refsect1> + <title>Quality of Service</title> + <para>MQTT defines three levels of Quality of Service (QoS). The QoS + defines how hard the broker/client will try to ensure that a message is + received. Messages may be sent at any QoS level, and clients may + attempt to subscribe to topics at any QoS level. This means that the + client chooses the maximum QoS it will receive. For example, if a + message is published at QoS 2 and a client is subscribed with QoS 0, + the message will be delivered to that client with QoS 0. If a second + client is also subscribed to the same topic, but with QoS 2, then it + will receive the same message but with QoS 2. For a second example, if + a client is subscribed with QoS 2 and a message is published on QoS 0, + the client will receive it on QoS 0.</para> + <para>Higher levels of QoS are more reliable, but involve higher + latency and have higher bandwidth requirements.</para> + <itemizedlist> + <listitem><para>0: The broker/client will deliver the message once, with no confirmation.</para></listitem> + <listitem><para>1: The broker/client will deliver the message at least once, with confirmation required.</para></listitem> + <listitem><para>2: The broker/client will deliver the message exactly once by using a four step handshake.</para></listitem> + </itemizedlist> + </refsect1> + + <refsect1> + <title>Retained Messages</title> + <para>All messages may be set to be retained. This means that the + broker will keep the message even after sending it to all current + subscribers. If a new subscription is made that matches the topic of + the retained message, then the message will be sent to the client. This + is useful as a "last known good" mechanism. If a topic is only updated + infrequently, then without a retained message, a newly subscribed + client may have to wait a long time to receive an update. With a + retained message, the client will receive an instant update.</para> + </refsect1> + + <refsect1> + <title>Clean session / Durable connections</title> + <para>On connection, a client sets the "clean session" flag, which is + sometimes also known as the "clean start" flag. If clean session is set + to false, then the connection is treated as durable. This means that + when the client disconnects, any subscriptions it has will remain and + any subsequent QoS 1 or 2 messages will be stored until it connects + again in the future. If clean session is true, then all subscriptions + will be removed for the client when it disconnects.</para> + </refsect1> + + <refsect1> + <title>Wills</title> + <para>When a client connects to a broker, it may inform the broker that + it has a will. This is a message that it wishes the broker to send when + the client disconnects unexpectedly. The will message has a topic, + QoS and retain status just the same as any other message.</para> + </refsect1> + + <refsect1> + <title>See Also</title> + <simplelist type="inline"> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto-8.html">mosquitto</link></refentrytitle> + <manvolnum>8</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto_pub-1.html">mosquitto_pub</link></refentrytitle> + <manvolnum>1</manvolnum> + </citerefentry> + </member> + <member> + <citerefentry> + <refentrytitle><link xlink:href="mosquitto_sub-1.html">mosquitto_sub</link></refentrytitle> + <manvolnum>1</manvolnum> + </citerefentry> + </member> + </simplelist> + </refsect1> + + <refsect1> + <title>Author</title> + <para>Roger Light <email>roger@atchoo.org</email></para> + </refsect1> +</refentry> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/cc128_log_mysql.pl b/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/cc128_log_mysql.pl new file mode 100755 index 0000000..568f611 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/cc128_log_mysql.pl @@ -0,0 +1,55 @@ +#!/usr/bin/perl + +# Log CurrentCost power meter data to a mysql database. +# Assumes data is coming in on MQTT topic sensors/cc128 +# and in format timestamp,temperature,ch1_data +# e.g. 1276605752,12.7,86 + +# To create database, table and user: +# +# CREATE DATABASE powermeter; +# USE 'powermeter'; +# CREATE TABLE powermeter ( +# `id` INT NOT NULL auto_increment, +# `timestamp` INT NOT NULL, +# `temperature` FLOAT NOT NULL DEFAULT 0.0, +# `ch1` INT NOT NULL DEFAULT 0, +# PRIMARY KEY (`id`), +# UNIQUE KEY `timestamp` (`timestamp`) +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +# +# CREATE USER 'powermeter'@'localhost' IDENTIFIED BY '<your password>'; +# GRANT ALL ON powermeter.* to 'powermeter'@'localhost'; + +use strict; +use DBI(); +use FileHandle; + +local $| = 1; + +my $dbname = "powermeter"; +my $dbhost = "localhost"; +my $dbusername = "powermeter"; +my $dbpassword = "<your password>"; +my $dbtable = "powermeter"; + +my $subclient = "mosquitto_sub -t sensors/cc128"; +open(SUB, "$subclient|"); +SUB->autoflush(1); + +my $dbh = DBI->connect("DBI:mysql:database=$dbname;host=$dbhost", + "$dbusername", "$dbpassword", {'RaiseError' => 1}); + +my $query = "INSERT INTO powermeter (timestamp, temperature, ch1) VALUES (?,?,?)"; + +my @vals; +my ($timestamp, $temperature, $ch1); +while (my $line = <SUB>) { + @vals = split(/,/, $line); + $timestamp = @vals[0]; + $temperature = @vals[1]; + $ch1 = @vals[2]; + $dbh->do($query, undef, $timestamp, $temperature, $ch1); +} +$dbh->disconnect(); + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/cc128_parse.pl b/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/cc128_parse.pl new file mode 100755 index 0000000..af38ece --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/cc128_parse.pl @@ -0,0 +1,45 @@ +#!/usr/bin/perl -w + +# Read raw cc128 data and republish without xml. +# Probably only works if you have a single channel. + +use strict; +use HTTP::Date "str2time"; +use FileHandle; + +local $| = 1; + +my $subclient = "mosquitto_sub -t sensors/cc128/raw -q 1"; +my $pubclient = "mosquitto_pub -t sensors/cc128 -q 1 -l"; +my $pubclient_ch1 = "mosquitto_pub -t sensors/cc128/ch1 -q 1 -l"; + +open(SUB, "$subclient|"); +open(PUB, "|$pubclient"); +open(PUB_CH1, "|$pubclient_ch1"); + +SUB->autoflush(1); +PUB->autoflush(1); +PUB_CH1->autoflush(1); + +while (my $line = <SUB>) { + #<msg><src>CC128-v0.12</src><dsb>00002</dsb><time>00:02:12</time><tmpr>15.7</tmpr><sensor>0</sensor><id>03112</id><type>1</type><ch1><watts>00108</watts></ch1></msg> + if ($line =~ m#<time>(.*)</time><tmpr> *([\-\d.]+)</tmpr><sensor>0</sensor><id>[0-9]*</id><type>1</type><ch1><watts>0*(\d+)</watts></ch1></msg.*#){ + my $reading_time = $1; + my $temp = $2; + my $watts = $3; + + my $now = time; + my ($sec,$min,$hour,$mday,$month,$year,$wday,$yday,$isdst,$r_stamp); + + ($sec,$min,$hour,$mday,$month,$year,$wday,$yday,$isdst) = localtime($now); + $year += 1900; + $month += 1; + $r_stamp = str2time("$year-$month-$mday $reading_time"); + if($r_stamp > $now){ + $r_stamp -= 86400; + } + + print PUB "$r_stamp,$temp,$watts\n"; + print PUB_CH1 "$r_stamp $watts\n"; + } +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/cc128_read.pl b/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/cc128_read.pl new file mode 100755 index 0000000..fbf892e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/cc128_read.pl @@ -0,0 +1,23 @@ +#!/usr/bin/perl -w + +# Reads data from a Current Cost device via serial port. +# Spawns + +use strict; +use Device::SerialPort qw( :PARAM :STAT 0.07 ); + +my $pubclient = "mosquitto_pub -t sensors/cc128/raw -q 1 -l"; +my $PORT = "/dev/ttyUSB0"; +local $| = 1; + +my $ob = Device::SerialPort->new($PORT); +$ob->baudrate(57600); +$ob->write_settings; + +open(SERIAL, "+<$PORT"); +open(MQTT, "|$pubclient"); +while (my $line = <SERIAL>) { + print(MQTT "$line"); +} + +close(MQTT); diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/cc128_read.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/cc128_read.py new file mode 100755 index 0000000..ac7cda5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/cc128_read.py @@ -0,0 +1,22 @@ +#!/usr/bin/python -u + +import mosquitto +import serial + +usb = serial.Serial(port='/dev/ttyUSB0', baudrate=57600) + +mosq = mosquitto.Mosquitto() +mosq.connect("localhost") +mosq.loop_start() + +running = True +try: + while running: + line = usb.readline() + mosq.publish("sensors/cc128/raw", line) +except usb.SerialException, e: + running = False + +mosq.disconnect() +mosq.loop_stop() + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/gnome-panel/CurrentCostMQTT.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/gnome-panel/CurrentCostMQTT.py new file mode 100755 index 0000000..1091f19 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/gnome-panel/CurrentCostMQTT.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python + +import gnomeapplet +import gtk +import mosquitto +import sys + +class CurrentCostMQTT(gnomeapplet.Applet): + def on_message(self, mosq, obj, msg): + # Message format is "power" + self.label.set_text(msg.payload+"W") + + def set_label(self, val): + self.label.set_text(val) + + def on_change_background(self, applet, type, color, pixmap): + applet.set_style(None) + applet.modify_style(gtk.RcStyle()) + + if type == gnomeapplet.COLOR_BACKGROUND: + applet.modify_bg(gtk.STATE_NORMAL, color) + elif type == gnomeapplet.PIXMAP_BACKGROUND: + style = applet.get_style().copy() + style.bg_pixmap[gtk.STATE_NORMAL] = pixmap + applet.set_style(style) + + def show_menu(self, widget, event): + print "menu" + + def __init__(self, applet, iid): + self.applet = applet + self.label = gtk.Label("0W") + self.event_box = gtk.EventBox() + self.event_box.add(self.label) + self.event_box.set_events(gtk.gdk.BUTTON_PRESS_MASK) + self.event_box.connect("button_press_event", self.show_menu) + self.applet.add(self.event_box) + self.applet.set_background_widget(applet) + self.applet.show_all() + self.mosq = mosquitto.Mosquitto() + self.mosq.on_message = self.on_message + self.mosq.connect("localhost") + self.mosq.loop_start() + self.mosq.subscribe("sensors/cc128/ch1", 0) + self.applet.connect('change-background', self.on_change_background) + +def CurrentCostMQTT_factory(applet, iid): + CurrentCostMQTT(applet, iid) + return gtk.TRUE + +if len(sys.argv) == 2: + if sys.argv[1] == "-d": #Debug mode + main_window = gtk.Window(gtk.WINDOW_TOPLEVEL) + main_window.set_title("Python Applet") + main_window.connect("destroy", gtk.main_quit) + app = gnomeapplet.Applet() + CurrentCostMQTT_factory(app,None) + app.reparent(main_window) + main_window.show_all() + gtk.main() + sys.exit() + +if __name__ == '__main__': + gnomeapplet.bonobo_factory("OAFIID:CurrentCostMQTT_Factory", gnomeapplet.Applet.__gtype__, "MQTT", "0", CurrentCostMQTT_factory) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/gnome-panel/CurrentCostMQTT.server b/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/gnome-panel/CurrentCostMQTT.server new file mode 100644 index 0000000..9e74bda --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/gnome-panel/CurrentCostMQTT.server @@ -0,0 +1,28 @@ +<oaf_info> + <oaf_server iid="OAFIID:CurrentCostMQTT_Factory" + type="exe" + location="CurrentCostMQTT.py"> + + <oaf_attribute name="repo_ids" type="stringv"> + <item value="IDL:Bonobo/GenericFactory:1.0"/> + <item value="IDL:Bonobo/Unknown:1.0"/> + </oaf_attribute> + <oaf_attribute name="name" type="string" value="CurrentCost MQTT display"/> + <oaf_attribute name="description" type="string" value="Display energy usage published over MQTT"/> + </oaf_server> + + <oaf_server iid="OAFIID:CurrentCostMQTT" + type="factory" + location="OAFIID:CurrentCostMQTT_Factory"> + + <oaf_attribute name="repo_ids" type="stringv"> + <item value="IDL:GNOME/Vertigo/PanelAppletShell:1.0"/> + <item value="IDL:Bonobo/Control:1.0"/> + <item value="IDL:Bonobo/Unknown:1.0"/> + </oaf_attribute> + <oaf_attribute name="name" type="string" value="CurrentCost MQTT display"/> + <oaf_attribute name="description" type="string" value="Display energy usage published over MQTT"/> + <oaf_attribute name="panel:category" type="string" value="Utility"/> + <oaf_attribute name="panel:icon" type="string" value="currentcost.png"/> + </oaf_server> +</oaf_info> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/gnome-panel/currentcost.png b/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/gnome-panel/currentcost.png new file mode 100644 index 0000000..df6d01a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/misc/currentcost/gnome-panel/currentcost.png Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/mosquitto.conf b/proj1_mqttd/mosquitto/mosquitto-1.6.3/mosquitto.conf new file mode 100644 index 0000000..c12193f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/mosquitto.conf @@ -0,0 +1,988 @@ +# Config file for mosquitto +# +# See mosquitto.conf(5) for more information. +# +# Default values are shown, uncomment to change. +# +# Use the # character to indicate a comment, but only if it is the +# very first character on the line. + +# ================================================================= +# General configuration +# ================================================================= + +# Use per listener security settings. +# +# It is recommended this option be set before any other options. +# +# If this option is set to true, then all authentication and access control +# options are controlled on a per listener basis. The following options are +# affected: +# +# password_file acl_file psk_file auth_plugin auth_opt_* allow_anonymous +# auto_id_prefix allow_zero_length_clientid +# +# Note that if set to true, then a durable client (i.e. with clean session set +# to false) that has disconnected will use the ACL settings defined for the +# listener that it was most recently connected to. +# +# The default behaviour is for this to be set to false, which maintains the +# setting behaviour from previous versions of mosquitto. +#per_listener_settings false + + +# If a client is subscribed to multiple subscriptions that overlap, e.g. foo/# +# and foo/+/baz , then MQTT expects that when the broker receives a message on +# a topic that matches both subscriptions, such as foo/bar/baz, then the client +# should only receive the message once. +# Mosquitto keeps track of which clients a message has been sent to in order to +# meet this requirement. The allow_duplicate_messages option allows this +# behaviour to be disabled, which may be useful if you have a large number of +# clients subscribed to the same set of topics and are very concerned about +# minimising memory usage. +# It can be safely set to true if you know in advance that your clients will +# never have overlapping subscriptions, otherwise your clients must be able to +# correctly deal with duplicate messages even when then have QoS=2. +#allow_duplicate_messages false + +# This option controls whether a client is allowed to connect with a zero +# length client id or not. This option only affects clients using MQTT v3.1.1 +# and later. If set to false, clients connecting with a zero length client id +# are disconnected. If set to true, clients will be allocated a client id by +# the broker. This means it is only useful for clients with clean session set +# to true. +#allow_zero_length_clientid true + +# If allow_zero_length_clientid is true, this option allows you to set a prefix +# to automatically generated client ids to aid visibility in logs. +# Defaults to 'auto-' +#auto_id_prefix auto- + +# This option affects the scenario when a client subscribes to a topic that has +# retained messages. It is possible that the client that published the retained +# message to the topic had access at the time they published, but that access +# has been subsequently removed. If check_retain_source is set to true, the +# default, the source of a retained message will be checked for access rights +# before it is republished. When set to false, no check will be made and the +# retained message will always be published. This affects all listeners. +#check_retain_source true + +# QoS 1 and 2 messages will be allowed inflight per client until this limit +# is exceeded. Defaults to 0. (No maximum) +# See also max_inflight_messages +#max_inflight_bytes 0 + +# The maximum number of QoS 1 and 2 messages currently inflight per +# client. +# This includes messages that are partway through handshakes and +# those that are being retried. Defaults to 20. Set to 0 for no +# maximum. Setting to 1 will guarantee in-order delivery of QoS 1 +# and 2 messages. +#max_inflight_messages 20 + +# For MQTT v5 clients, it is possible to have the server send a "server +# keepalive" value that will override the keepalive value set by the client. +# This is intended to be used as a mechanism to say that the server will +# disconnect the client earlier than it anticipated, and that the client should +# use the new keepalive value. The max_keepalive option allows you to specify +# that clients may only connect with keepalive less than or equal to this +# value, otherwise they will be sent a server keepalive telling them to use +# max_keepalive. This only applies to MQTT v5 clients. The maximum value +# allowable is 65535. Do not set below 10. +#max_keepalive 65535 + +# For MQTT v5 clients, it is possible to have the server send a "maximum packet +# size" value that will instruct the client it will not accept MQTT packets +# with size greater than max_packet_size bytes. This applies to the full MQTT +# packet, not just the payload. Setting this option to a positive value will +# set the maximum packet size to that number of bytes. If a client sends a +# packet which is larger than this value, it will be disconnected. This applies +# to all clients regardless of the protocol version they are using, but v3.1.1 +# and earlier clients will of course not have received the maximum packet size +# information. Defaults to no limit. Setting below 20 bytes is forbidden +# because it is likely to interfere with ordinary client operation, even with +# very small payloads. +#max_packet_size 0 + +# QoS 1 and 2 messages above those currently in-flight will be queued per +# client until this limit is exceeded. Defaults to 0. (No maximum) +# See also max_queued_messages. +# If both max_queued_messages and max_queued_bytes are specified, packets will +# be queued until the first limit is reached. +#max_queued_bytes 0 + +# The maximum number of QoS 1 and 2 messages to hold in a queue per client +# above those that are currently in-flight. Defaults to 100. Set +# to 0 for no maximum (not recommended). +# See also queue_qos0_messages. +# See also max_queued_bytes. +#max_queued_messages 100 +# +# This option sets the maximum number of heap memory bytes that the broker will +# allocate, and hence sets a hard limit on memory use by the broker. Memory +# requests that exceed this value will be denied. The effect will vary +# depending on what has been denied. If an incoming message is being processed, +# then the message will be dropped and the publishing client will be +# disconnected. If an outgoing message is being sent, then the individual +# message will be dropped and the receiving client will be disconnected. +# Defaults to no limit. +#memory_limit 0 + +# This option sets the maximum publish payload size that the broker will allow. +# Received messages that exceed this size will not be accepted by the broker. +# The default value is 0, which means that all valid MQTT messages are +# accepted. MQTT imposes a maximum payload size of 268435455 bytes. +#message_size_limit 0 + +# This option allows persistent clients (those with clean session set to false) +# to be removed if they do not reconnect within a certain time frame. +# +# This is a non-standard option in MQTT V3.1 but allowed in MQTT v3.1.1. +# +# Badly designed clients may set clean session to false whilst using a randomly +# generated client id. This leads to persistent clients that will never +# reconnect. This option allows these clients to be removed. +# +# The expiration period should be an integer followed by one of h d w m y for +# hour, day, week, month and year respectively. For example +# +# persistent_client_expiration 2m +# persistent_client_expiration 14d +# persistent_client_expiration 1y +# +# The default if not set is to never expire persistent clients. +#persistent_client_expiration + +# Write process id to a file. Default is a blank string which means +# a pid file shouldn't be written. +# This should be set to /var/run/mosquitto.pid if mosquitto is +# being run automatically on boot with an init script and +# start-stop-daemon or similar. +#pid_file + +# Set to true to queue messages with QoS 0 when a persistent client is +# disconnected. These messages are included in the limit imposed by +# max_queued_messages and max_queued_bytes +# Defaults to false. +# This is a non-standard option for the MQTT v3.1 spec but is allowed in +# v3.1.1. +#queue_qos0_messages false + +# Set to false to disable retained message support. If a client publishes a +# message with the retain bit set, it will be disconnected if this is set to +# false. +#retain_available true + +# Disable Nagle's algorithm on client sockets. This has the effect of reducing +# latency of individual messages at the potential cost of increasing the number +# of packets being sent. +#set_tcp_nodelay false + +# Time in seconds between updates of the $SYS tree. +# Set to 0 to disable the publishing of the $SYS tree. +#sys_interval 10 + +# The MQTT specification requires that the QoS of a message delivered to a +# subscriber is never upgraded to match the QoS of the subscription. Enabling +# this option changes this behaviour. If upgrade_outgoing_qos is set true, +# messages sent to a subscriber will always match the QoS of its subscription. +# This is a non-standard option explicitly disallowed by the spec. +#upgrade_outgoing_qos false + +# When run as root, drop privileges to this user and its primary +# group. +# Set to root to stay as root, but this is not recommended. +# If run as a non-root user, this setting has no effect. +# Note that on Windows this has no effect and so mosquitto should +# be started by the user you wish it to run as. +#user mosquitto + +# ================================================================= +# Default listener +# ================================================================= + +# IP address/hostname to bind the default listener to. If not +# given, the default listener will not be bound to a specific +# address and so will be accessible to all network interfaces. +# bind_address ip-address/host name +#bind_address + +# Port to use for the default listener. +#port 1883 + +# Bind the listener to a specific interface. This is similar to +# bind_address above but is useful when an interface has multiple addresses or +# the address may change. It is valid to use this with the bind_address option, +# but take care that the interface you are binding to contains the address you +# are binding to, otherwise you will not be able to connect. +# Example: bind_interface eth0 +#bind_interface + +# When a listener is using the websockets protocol, it is possible to serve +# http data as well. Set http_dir to a directory which contains the files you +# wish to serve. If this option is not specified, then no normal http +# connections will be possible. +#http_dir + +# The maximum number of client connections to allow. This is +# a per listener setting. +# Default is -1, which means unlimited connections. +# Note that other process limits mean that unlimited connections +# are not really possible. Typically the default maximum number of +# connections possible is around 1024. +#max_connections -1 + +# Choose the protocol to use when listening. +# This can be either mqtt or websockets. +# Websockets support is currently disabled by default at compile time. +# Certificate based TLS may be used with websockets, except that +# only the cafile, certfile, keyfile and ciphers options are supported. +#protocol mqtt + +# Set use_username_as_clientid to true to replace the clientid that a client +# connected with with its username. This allows authentication to be tied to +# the clientid, which means that it is possible to prevent one client +# disconnecting another by using the same clientid. +# If a client connects with no username it will be disconnected as not +# authorised when this option is set to true. +# Do not use in conjunction with clientid_prefixes. +# See also use_identity_as_username. +#use_username_as_clientid + +# ----------------------------------------------------------------- +# Certificate based SSL/TLS support +# ----------------------------------------------------------------- +# The following options can be used to enable SSL/TLS support for +# this listener. Note that the recommended port for MQTT over TLS +# is 8883, but this must be set manually. +# +# See also the mosquitto-tls man page. + +# At least one of cafile or capath must be defined. They both +# define methods of accessing the PEM encoded Certificate +# Authority certificates that have signed your server certificate +# and that you wish to trust. +# cafile defines the path to a file containing the CA certificates. +# capath defines a directory that will be searched for files +# containing the CA certificates. For capath to work correctly, the +# certificate files must have ".crt" as the file ending and you must run +# "openssl rehash <path to capath>" each time you add/remove a certificate. +#cafile +#capath + +# Path to the PEM encoded server certificate. +#certfile + +# Path to the PEM encoded keyfile. +#keyfile + + +# If you have require_certificate set to true, you can create a certificate +# revocation list file to revoke access to particular client certificates. If +# you have done this, use crlfile to point to the PEM encoded revocation file. +#crlfile + +# If you wish to control which encryption ciphers are used, use the ciphers +# option. The list of available ciphers can be obtained using the "openssl +# ciphers" command and should be provided in the same format as the output of +# that command. +# If unset defaults to DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2:@STRENGTH +#ciphers DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2:@STRENGTH + +# To allow the use of ephemeral DH key exchange, which provides forward +# security, the listener must load DH parameters. This can be specified with +# the dhparamfile option. The dhparamfile can be generated with the command +# e.g. "openssl dhparam -out dhparam.pem 2048" +#dhparamfile + +# By default a TLS enabled listener will operate in a similar fashion to a +# https enabled web server, in that the server has a certificate signed by a CA +# and the client will verify that it is a trusted certificate. The overall aim +# is encryption of the network traffic. By setting require_certificate to true, +# the client must provide a valid certificate in order for the network +# connection to proceed. This allows access to the broker to be controlled +# outside of the mechanisms provided by MQTT. +#require_certificate false + +# This option defines the version of the TLS protocol to use for this listener. +# The default value allows all of v1.3, v1.2 and v1.1. The valid values are +# tlsv1.3 tlsv1.2 and tlsv1.1. +#tls_version + +# If require_certificate is true, you may set use_identity_as_username to true +# to use the CN value from the client certificate as a username. If this is +# true, the password_file option will not be used for this listener. +# This takes priority over use_subject_as_username. +# See also use_subject_as_username. +#use_identity_as_username false + +# If require_certificate is true, you may set use_subject_as_username to true +# to use the complete subject value from the client certificate as a username. +# If this is true, the password_file option will not be used for this listener. +# See also use_identity_as_username +#use_subject_as_username false + +# ----------------------------------------------------------------- +# Pre-shared-key based SSL/TLS support +# ----------------------------------------------------------------- +# The following options can be used to enable PSK based SSL/TLS support for +# this listener. Note that the recommended port for MQTT over TLS is 8883, but +# this must be set manually. +# +# See also the mosquitto-tls man page and the "Certificate based SSL/TLS +# support" section. Only one of certificate or PSK encryption support can be +# enabled for any listener. + +# The psk_hint option enables pre-shared-key support for this listener and also +# acts as an identifier for this listener. The hint is sent to clients and may +# be used locally to aid authentication. The hint is a free form string that +# doesn't have much meaning in itself, so feel free to be creative. +# If this option is provided, see psk_file to define the pre-shared keys to be +# used or create a security plugin to handle them. +#psk_hint + +# When using PSK, the encryption ciphers used will be chosen from the list of +# available PSK ciphers. If you want to control which ciphers are available, +# use the "ciphers" option. The list of available ciphers can be obtained +# using the "openssl ciphers" command and should be provided in the same format +# as the output of that command. +#ciphers + +# Set use_identity_as_username to have the psk identity sent by the client used +# as its username. Authentication will be carried out using the PSK rather than +# the MQTT username/password and so password_file will not be used for this +# listener. +#use_identity_as_username false + + +# ================================================================= +# Extra listeners +# ================================================================= + +# Listen on a port/ip address combination. By using this variable +# multiple times, mosquitto can listen on more than one port. If +# this variable is used and neither bind_address nor port given, +# then the default listener will not be started. +# The port number to listen on must be given. Optionally, an ip +# address or host name may be supplied as a second argument. In +# this case, mosquitto will attempt to bind the listener to that +# address and so restrict access to the associated network and +# interface. By default, mosquitto will listen on all interfaces. +# Note that for a websockets listener it is not possible to bind to a host +# name. +# listener port-number [ip address/host name] +#listener + +# Bind the listener to a specific interface. This is similar to +# the [ip address/host name] part of the listener definition, but is useful +# when an interface has multiple addresses or the address may change. It is +# valid to use this with the [ip address/host name] part of the listener +# definition, but take care that the interface you are binding to contains the +# address you are binding to, otherwise you will not be able to connect. +# Only available on Linux and requires elevated privileges. +# +# Example: bind_interface eth0 +#bind_interface + +# When a listener is using the websockets protocol, it is possible to serve +# http data as well. Set http_dir to a directory which contains the files you +# wish to serve. If this option is not specified, then no normal http +# connections will be possible. +#http_dir + +# The maximum number of client connections to allow. This is +# a per listener setting. +# Default is -1, which means unlimited connections. +# Note that other process limits mean that unlimited connections +# are not really possible. Typically the default maximum number of +# connections possible is around 1024. +#max_connections -1 + +# The listener can be restricted to operating within a topic hierarchy using +# the mount_point option. This is achieved be prefixing the mount_point string +# to all topics for any clients connected to this listener. This prefixing only +# happens internally to the broker; the client will not see the prefix. +#mount_point + +# Choose the protocol to use when listening. +# This can be either mqtt or websockets. +# Certificate based TLS may be used with websockets, except that only the +# cafile, certfile, keyfile and ciphers options are supported. +#protocol mqtt + +# Set use_username_as_clientid to true to replace the clientid that a client +# connected with with its username. This allows authentication to be tied to +# the clientid, which means that it is possible to prevent one client +# disconnecting another by using the same clientid. +# If a client connects with no username it will be disconnected as not +# authorised when this option is set to true. +# Do not use in conjunction with clientid_prefixes. +# See also use_identity_as_username. +#use_username_as_clientid + +# Change the websockets headers size. This is a global option, it is not +# possible to set per listener. This option sets the size of the buffer used in +# the libwebsockets library when reading HTTP headers. If you are passing large +# header data such as cookies then you may need to increase this value. If left +# unset, or set to 0, then the default of 1024 bytes will be used. +#websockets_headers_size + +# ----------------------------------------------------------------- +# Certificate based SSL/TLS support +# ----------------------------------------------------------------- +# The following options can be used to enable certificate based SSL/TLS support +# for this listener. Note that the recommended port for MQTT over TLS is 8883, +# but this must be set manually. +# +# See also the mosquitto-tls man page and the "Pre-shared-key based SSL/TLS +# support" section. Only one of certificate or PSK encryption support can be +# enabled for any listener. + +# At least one of cafile or capath must be defined to enable certificate based +# TLS encryption. They both define methods of accessing the PEM encoded +# Certificate Authority certificates that have signed your server certificate +# and that you wish to trust. +# cafile defines the path to a file containing the CA certificates. +# capath defines a directory that will be searched for files +# containing the CA certificates. For capath to work correctly, the +# certificate files must have ".crt" as the file ending and you must run +# "openssl rehash <path to capath>" each time you add/remove a certificate. +#cafile +#capath + +# Path to the PEM encoded server certificate. +#certfile + +# Path to the PEM encoded keyfile. +#keyfile + + +# If you wish to control which encryption ciphers are used, use the ciphers +# option. The list of available ciphers can be optained using the "openssl +# ciphers" command and should be provided in the same format as the output of +# that command. +#ciphers + +# If you have require_certificate set to true, you can create a certificate +# revocation list file to revoke access to particular client certificates. If +# you have done this, use crlfile to point to the PEM encoded revocation file. +#crlfile + +# To allow the use of ephemeral DH key exchange, which provides forward +# security, the listener must load DH parameters. This can be specified with +# the dhparamfile option. The dhparamfile can be generated with the command +# e.g. "openssl dhparam -out dhparam.pem 2048" +#dhparamfile + +# By default an TLS enabled listener will operate in a similar fashion to a +# https enabled web server, in that the server has a certificate signed by a CA +# and the client will verify that it is a trusted certificate. The overall aim +# is encryption of the network traffic. By setting require_certificate to true, +# the client must provide a valid certificate in order for the network +# connection to proceed. This allows access to the broker to be controlled +# outside of the mechanisms provided by MQTT. +#require_certificate false + +# If require_certificate is true, you may set use_identity_as_username to true +# to use the CN value from the client certificate as a username. If this is +# true, the password_file option will not be used for this listener. +#use_identity_as_username false + +# ----------------------------------------------------------------- +# Pre-shared-key based SSL/TLS support +# ----------------------------------------------------------------- +# The following options can be used to enable PSK based SSL/TLS support for +# this listener. Note that the recommended port for MQTT over TLS is 8883, but +# this must be set manually. +# +# See also the mosquitto-tls man page and the "Certificate based SSL/TLS +# support" section. Only one of certificate or PSK encryption support can be +# enabled for any listener. + +# The psk_hint option enables pre-shared-key support for this listener and also +# acts as an identifier for this listener. The hint is sent to clients and may +# be used locally to aid authentication. The hint is a free form string that +# doesn't have much meaning in itself, so feel free to be creative. +# If this option is provided, see psk_file to define the pre-shared keys to be +# used or create a security plugin to handle them. +#psk_hint + +# When using PSK, the encryption ciphers used will be chosen from the list of +# available PSK ciphers. If you want to control which ciphers are available, +# use the "ciphers" option. The list of available ciphers can be optained +# using the "openssl ciphers" command and should be provided in the same format +# as the output of that command. +#ciphers + +# Set use_identity_as_username to have the psk identity sent by the client used +# as its username. Authentication will be carried out using the PSK rather than +# the MQTT username/password and so password_file will not be used for this +# listener. +#use_identity_as_username false + + +# ================================================================= +# Persistence +# ================================================================= + +# If persistence is enabled, save the in-memory database to disk +# every autosave_interval seconds. If set to 0, the persistence +# database will only be written when mosquitto exits. See also +# autosave_on_changes. +# Note that writing of the persistence database can be forced by +# sending mosquitto a SIGUSR1 signal. +#autosave_interval 1800 + +# If true, mosquitto will count the number of subscription changes, retained +# messages received and queued messages and if the total exceeds +# autosave_interval then the in-memory database will be saved to disk. +# If false, mosquitto will save the in-memory database to disk by treating +# autosave_interval as a time in seconds. +#autosave_on_changes false + +# Save persistent message data to disk (true/false). +# This saves information about all messages, including +# subscriptions, currently in-flight messages and retained +# messages. +# retained_persistence is a synonym for this option. +#persistence false + +# The filename to use for the persistent database, not including +# the path. +#persistence_file mosquitto.db + +# Location for persistent database. Must include trailing / +# Default is an empty string (current directory). +# Set to e.g. /var/lib/mosquitto/ if running as a proper service on Linux or +# similar. +#persistence_location + + +# ================================================================= +# Logging +# ================================================================= + +# Places to log to. Use multiple log_dest lines for multiple +# logging destinations. +# Possible destinations are: stdout stderr syslog topic file +# +# stdout and stderr log to the console on the named output. +# +# syslog uses the userspace syslog facility which usually ends up +# in /var/log/messages or similar. +# +# topic logs to the broker topic '$SYS/broker/log/<severity>', +# where severity is one of D, E, W, N, I, M which are debug, error, +# warning, notice, information and message. Message type severity is used by +# the subscribe/unsubscribe log_types and publishes log messages to +# $SYS/broker/log/M/susbcribe or $SYS/broker/log/M/unsubscribe. +# +# The file destination requires an additional parameter which is the file to be +# logged to, e.g. "log_dest file /var/log/mosquitto.log". The file will be +# closed and reopened when the broker receives a HUP signal. Only a single file +# destination may be configured. +# +# Note that if the broker is running as a Windows service it will default to +# "log_dest none" and neither stdout nor stderr logging is available. +# Use "log_dest none" if you wish to disable logging. +#log_dest stderr + +# Types of messages to log. Use multiple log_type lines for logging +# multiple types of messages. +# Possible types are: debug, error, warning, notice, information, +# none, subscribe, unsubscribe, websockets, all. +# Note that debug type messages are for decoding the incoming/outgoing +# network packets. They are not logged in "topics". +#log_type error +#log_type warning +#log_type notice +#log_type information + + +# If set to true, client connection and disconnection messages will be included +# in the log. +#connection_messages true + +# If using syslog logging (not on Windows), messages will be logged to the +# "daemon" facility by default. Use the log_facility option to choose which of +# local0 to local7 to log to instead. The option value should be an integer +# value, e.g. "log_facility 5" to use local5. +#log_facility + +# If set to true, add a timestamp value to each log message. +#log_timestamp true + +# Set the format of the log timestamp. If left unset, this is the number of +# seconds since the Unix epoch. +# This is a free text string which will be passed to the strftime function. To +# get an ISO 8601 datetime, for example: +# log_timestamp_format %Y-%m-%dT%H:%M:%S +#log_timestamp_format + +# Change the websockets logging level. This is a global option, it is not +# possible to set per listener. This is an integer that is interpreted by +# libwebsockets as a bit mask for its lws_log_levels enum. See the +# libwebsockets documentation for more details. "log_type websockets" must also +# be enabled. +#websockets_log_level 0 + + +# ================================================================= +# Security +# ================================================================= + +# If set, only clients that have a matching prefix on their +# clientid will be allowed to connect to the broker. By default, +# all clients may connect. +# For example, setting "secure-" here would mean a client "secure- +# client" could connect but another with clientid "mqtt" couldn't. +#clientid_prefixes + +# Boolean value that determines whether clients that connect +# without providing a username are allowed to connect. If set to +# false then a password file should be created (see the +# password_file option) to control authenticated client access. +# +# Defaults to true if no other security options are set. If `password_file` or +# `psk_file` is set, or if an authentication plugin is loaded which implements +# username/password or TLS-PSK checks, then `allow_anonymous` defaults to +# false. +# +#allow_anonymous true + +# ----------------------------------------------------------------- +# Default authentication and topic access control +# ----------------------------------------------------------------- + +# Control access to the broker using a password file. This file can be +# generated using the mosquitto_passwd utility. If TLS support is not compiled +# into mosquitto (it is recommended that TLS support should be included) then +# plain text passwords are used, in which case the file should be a text file +# with lines in the format: +# username:password +# The password (and colon) may be omitted if desired, although this +# offers very little in the way of security. +# +# See the TLS client require_certificate and use_identity_as_username options +# for alternative authentication options. If an auth_plugin is used as well as +# password_file, the auth_plugin check will be made first. +#password_file + +# Access may also be controlled using a pre-shared-key file. This requires +# TLS-PSK support and a listener configured to use it. The file should be text +# lines in the format: +# identity:key +# The key should be in hexadecimal format without a leading "0x". +# If an auth_plugin is used as well, the auth_plugin check will be made first. +#psk_file + +# Control access to topics on the broker using an access control list +# file. If this parameter is defined then only the topics listed will +# have access. +# If the first character of a line of the ACL file is a # it is treated as a +# comment. +# Topic access is added with lines of the format: +# +# topic [read|write|readwrite] <topic> +# +# The access type is controlled using "read", "write" or "readwrite". This +# parameter is optional (unless <topic> contains a space character) - if not +# given then the access is read/write. <topic> can contain the + or # +# wildcards as in subscriptions. +# +# The first set of topics are applied to anonymous clients, assuming +# allow_anonymous is true. User specific topic ACLs are added after a +# user line as follows: +# +# user <username> +# +# The username referred to here is the same as in password_file. It is +# not the clientid. +# +# +# If is also possible to define ACLs based on pattern substitution within the +# topic. The patterns available for substition are: +# +# %c to match the client id of the client +# %u to match the username of the client +# +# The substitution pattern must be the only text for that level of hierarchy. +# +# The form is the same as for the topic keyword, but using pattern as the +# keyword. +# Pattern ACLs apply to all users even if the "user" keyword has previously +# been given. +# +# If using bridges with usernames and ACLs, connection messages can be allowed +# with the following pattern: +# pattern write $SYS/broker/connection/%c/state +# +# pattern [read|write|readwrite] <topic> +# +# Example: +# +# pattern write sensor/%u/data +# +# If an auth_plugin is used as well as acl_file, the auth_plugin check will be +# made first. +#acl_file + +# ----------------------------------------------------------------- +# External authentication and topic access plugin options +# ----------------------------------------------------------------- + +# External authentication and access control can be supported with the +# auth_plugin option. This is a path to a loadable plugin. See also the +# auth_opt_* options described below. +# +# The auth_plugin option can be specified multiple times to load multiple +# plugins. The plugins will be processed in the order that they are specified +# here. If the auth_plugin option is specified alongside either of +# password_file or acl_file then the plugin checks will be made first. +# +#auth_plugin + +# If the auth_plugin option above is used, define options to pass to the +# plugin here as described by the plugin instructions. All options named +# using the format auth_opt_* will be passed to the plugin, for example: +# +# auth_opt_db_host +# auth_opt_db_port +# auth_opt_db_username +# auth_opt_db_password + + +# ================================================================= +# Bridges +# ================================================================= + +# A bridge is a way of connecting multiple MQTT brokers together. +# Create a new bridge using the "connection" option as described below. Set +# options for the bridges using the remaining parameters. You must specify the +# address and at least one topic to subscribe to. +# +# Each connection must have a unique name. +# +# The address line may have multiple host address and ports specified. See +# below in the round_robin description for more details on bridge behaviour if +# multiple addresses are used. Note that if you use an IPv6 address, then you +# are required to specify a port. +# +# The direction that the topic will be shared can be chosen by +# specifying out, in or both, where the default value is out. +# The QoS level of the bridged communication can be specified with the next +# topic option. The default QoS level is 0, to change the QoS the topic +# direction must also be given. +# +# The local and remote prefix options allow a topic to be remapped when it is +# bridged to/from the remote broker. This provides the ability to place a topic +# tree in an appropriate location. +# +# For more details see the mosquitto.conf man page. +# +# Multiple topics can be specified per connection, but be careful +# not to create any loops. +# +# If you are using bridges with cleansession set to false (the default), then +# you may get unexpected behaviour from incoming topics if you change what +# topics you are subscribing to. This is because the remote broker keeps the +# subscription for the old topic. If you have this problem, connect your bridge +# with cleansession set to true, then reconnect with cleansession set to false +# as normal. +#connection <name> +#address <host>[:<port>] [<host>[:<port>]] +#topic <topic> [[[out | in | both] qos-level] local-prefix remote-prefix] + + +# If a bridge has topics that have "out" direction, the default behaviour is to +# send an unsubscribe request to the remote broker on that topic. This means +# that changing a topic direction from "in" to "out" will not keep receiving +# incoming messages. Sending these unsubscribe requests is not always +# desirable, setting bridge_attempt_unsubscribe to false will disable sending +# the unsubscribe request. +#bridge_attempt_unsubscribe true + +# Set the version of the MQTT protocol to use with for this bridge. Can be one +# of mqttv311 or mqttv11. Defaults to mqttv311. +#bridge_protocol_version mqttv311 + +# Set the clean session variable for this bridge. +# When set to true, when the bridge disconnects for any reason, all +# messages and subscriptions will be cleaned up on the remote +# broker. Note that with cleansession set to true, there may be a +# significant amount of retained messages sent when the bridge +# reconnects after losing its connection. +# When set to false, the subscriptions and messages are kept on the +# remote broker, and delivered when the bridge reconnects. +#cleansession false + +# Set the amount of time a bridge using the lazy start type must be idle before +# it will be stopped. Defaults to 60 seconds. +#idle_timeout 60 + +# Set the keepalive interval for this bridge connection, in +# seconds. +#keepalive_interval 60 + +# Set the clientid to use on the local broker. If not defined, this defaults to +# 'local.<clientid>'. If you are bridging a broker to itself, it is important +# that local_clientid and clientid do not match. +#local_clientid + +# If set to true, publish notification messages to the local and remote brokers +# giving information about the state of the bridge connection. Retained +# messages are published to the topic $SYS/broker/connection/<clientid>/state +# unless the notification_topic option is used. +# If the message is 1 then the connection is active, or 0 if the connection has +# failed. +# This uses the last will and testament feature. +#notifications true + +# Choose the topic on which notification messages for this bridge are +# published. If not set, messages are published on the topic +# $SYS/broker/connection/<clientid>/state +#notification_topic + +# Set the client id to use on the remote end of this bridge connection. If not +# defined, this defaults to 'name.hostname' where name is the connection name +# and hostname is the hostname of this computer. +# This replaces the old "clientid" option to avoid confusion. "clientid" +# remains valid for the time being. +#remote_clientid + +# Set the password to use when connecting to a broker that requires +# authentication. This option is only used if remote_username is also set. +# This replaces the old "password" option to avoid confusion. "password" +# remains valid for the time being. +#remote_password + +# Set the username to use when connecting to a broker that requires +# authentication. +# This replaces the old "username" option to avoid confusion. "username" +# remains valid for the time being. +#remote_username + +# Set the amount of time a bridge using the automatic start type will wait +# until attempting to reconnect. +# This option can be configured to use a constant delay time in seconds, or to +# use a backoff mechanism based on "Decorrelated Jitter", which adds a degree +# of randomness to when the restart occurs. +# +# Set a constant timeout of 20 seconds: +# restart_timeout 20 +# +# Set backoff with a base (start value) of 10 seconds and a cap (upper limit) of +# 60 seconds: +# restart_timeout 10 30 +# +# Defaults to jitter with a base of 5 and cap of 30 +#restart_timeout 5 30 + +# If the bridge has more than one address given in the address/addresses +# configuration, the round_robin option defines the behaviour of the bridge on +# a failure of the bridge connection. If round_robin is false, the default +# value, then the first address is treated as the main bridge connection. If +# the connection fails, the other secondary addresses will be attempted in +# turn. Whilst connected to a secondary bridge, the bridge will periodically +# attempt to reconnect to the main bridge until successful. +# If round_robin is true, then all addresses are treated as equals. If a +# connection fails, the next address will be tried and if successful will +# remain connected until it fails +#round_robin false + +# Set the start type of the bridge. This controls how the bridge starts and +# can be one of three types: automatic, lazy and once. Note that RSMB provides +# a fourth start type "manual" which isn't currently supported by mosquitto. +# +# "automatic" is the default start type and means that the bridge connection +# will be started automatically when the broker starts and also restarted +# after a short delay (30 seconds) if the connection fails. +# +# Bridges using the "lazy" start type will be started automatically when the +# number of queued messages exceeds the number set with the "threshold" +# parameter. It will be stopped automatically after the time set by the +# "idle_timeout" parameter. Use this start type if you wish the connection to +# only be active when it is needed. +# +# A bridge using the "once" start type will be started automatically when the +# broker starts but will not be restarted if the connection fails. +#start_type automatic + +# Set the number of messages that need to be queued for a bridge with lazy +# start type to be restarted. Defaults to 10 messages. +# Must be less than max_queued_messages. +#threshold 10 + +# If try_private is set to true, the bridge will attempt to indicate to the +# remote broker that it is a bridge not an ordinary client. If successful, this +# means that loop detection will be more effective and that retained messages +# will be propagated correctly. Not all brokers support this feature so it may +# be necessary to set try_private to false if your bridge does not connect +# properly. +#try_private true + +# ----------------------------------------------------------------- +# Certificate based SSL/TLS support +# ----------------------------------------------------------------- +# Either bridge_cafile or bridge_capath must be defined to enable TLS support +# for this bridge. +# bridge_cafile defines the path to a file containing the +# Certificate Authority certificates that have signed the remote broker +# certificate. +# bridge_capath defines a directory that will be searched for files containing +# the CA certificates. For bridge_capath to work correctly, the certificate +# files must have ".crt" as the file ending and you must run "openssl rehash +# <path to capath>" each time you add/remove a certificate. +#bridge_cafile +#bridge_capath + + +# If the remote broker has more than one protocol available on its port, e.g. +# MQTT and WebSockets, then use bridge_alpn to configure which protocol is +# requested. Note that WebSockets support for bridges is not yet available. +#bridge_alpn + +# When using certificate based encryption, bridge_insecure disables +# verification of the server hostname in the server certificate. This can be +# useful when testing initial server configurations, but makes it possible for +# a malicious third party to impersonate your server through DNS spoofing, for +# example. Use this option in testing only. If you need to resort to using this +# option in a production environment, your setup is at fault and there is no +# point using encryption. +#bridge_insecure false + +# Path to the PEM encoded client certificate, if required by the remote broker. +#bridge_certfile + +# Path to the PEM encoded client private key, if required by the remote broker. +#bridge_keyfile + +# ----------------------------------------------------------------- +# PSK based SSL/TLS support +# ----------------------------------------------------------------- +# Pre-shared-key encryption provides an alternative to certificate based +# encryption. A bridge can be configured to use PSK with the bridge_identity +# and bridge_psk options. These are the client PSK identity, and pre-shared-key +# in hexadecimal format with no "0x". Only one of certificate and PSK based +# encryption can be used on one +# bridge at once. +#bridge_identity +#bridge_psk + + +# ================================================================= +# External config files +# ================================================================= + +# External configuration files may be included by using the +# include_dir option. This defines a directory that will be searched +# for config files. All files that end in '.conf' will be loaded as +# a configuration file. It is best to have this as the last option +# in the main file. This option will only be processed from the main +# configuration file. The directory specified must not contain the +# main configuration file. +# Files within include_dir will be loaded sorted in case-sensitive +# alphabetical order, with capital letters ordered first. If this option is +# given multiple times, all of the files from the first instance will be +# processed before the next instance. See the man page for examples. +#include_dir diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/notice.html b/proj1_mqttd/mosquitto/mosquitto-1.6.3/notice.html new file mode 100644 index 0000000..f19c483 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/notice.html @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +<title>Eclipse Foundation Software User Agreement</title> +</head> + +<body lang="EN-US"> +<h2>Eclipse Foundation Software User Agreement</h2> +<p>February 1, 2011</p> + +<h3>Usage Of Content</h3> + +<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS + (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND + CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE + OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR + NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND + CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p> + +<h3>Applicable Licenses</h3> + +<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 + ("EPL"). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. + For purposes of the EPL, "Program" will mean the Content.</p> + +<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code + repository ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").</p> + +<ul> + <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").</li> + <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li> + <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins + and/or Fragments associated with that Feature.</li> + <li>Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.</li> +</ul> + +<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and +Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module +including, but not limited to the following locations:</p> + +<ul> + <li>The top-level (root) directory</li> + <li>Plug-in and Fragment directories</li> + <li>Inside Plug-ins and Fragments packaged as JARs</li> + <li>Sub-directories of the directory named "src" of certain Plug-ins</li> + <li>Feature directories</li> +</ul> + +<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license ("Feature Update License") during the +installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or +inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature. +Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in +that directory.</p> + +<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE +OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p> + +<ul> + <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li> + <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li> + <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li> + <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li> + <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li> + <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li> +</ul> + +<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please +contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p> + + +<h3>Use of Provisioning Technology</h3> + +<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse + Update Manager ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or + other materials (collectively "Installable Software"). This capability is provided with the intent of allowing such users to + install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a + href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a> + ("Specification").</p> + +<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the + applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology + in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the + Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p> + +<ol> + <li>A series of actions may occur ("Provisioning Process") in which a user may execute the Provisioning Technology + on a machine ("Target Machine") with the intent of installing, extending or updating the functionality of an Eclipse-based + product.</li> + <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be + accessed and copied to the Target Machine.</li> + <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable + Software ("Installable Software Agreement") and such Installable Software Agreement shall be accessed from the Target + Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern + the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such + indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li> +</ol> + +<h3>Cryptography</h3> + +<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to + another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, + possession, or use, and re-export of encryption software, to see if this is permitted.</p> + +<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p> +</body> +</html> diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/pskfile.example b/proj1_mqttd/mosquitto/mosquitto-1.6.3/pskfile.example new file mode 100644 index 0000000..95299cb --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/pskfile.example @@ -0,0 +1,2 @@ +id:deadbeef +easy:12345 diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/pwfile.example b/proj1_mqttd/mosquitto/mosquitto-1.6.3/pwfile.example new file mode 100644 index 0000000..58b94c9 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/pwfile.example @@ -0,0 +1,3 @@ +roger:$6$clQ4Ocu312S0qWgl$Cv2wUxgEN73c6C6jlBkswqR4AkHsvDLWvtEXZZ8NpsBLgP1WAo/qA+WXcmEN/mjDNgdUwcxRAveqNMs2xUVQYA== +sub_client:$6$U+qg0/32F0g2Fh+n$fBPSkq/rfNyEQ/TkEjRgwGTTVBpvNhKSyGShovH9KHewsvJ731tD5Zx26IHhR5RYCICt0L9qBW0/KK31UkCliw== +pub_client:$6$vxQ89y+7WrsnL2yn$fSPMmEZn9TSrC8s/jaPmxJ9NijWpkP2e7bMJLz78JXR1vW2x8+T3FZ23byJA6xs5Mt+LeOybAHwcUv0OCl40rA== diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/readme-windows.txt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/readme-windows.txt new file mode 100644 index 0000000..9325a4c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/readme-windows.txt @@ -0,0 +1,63 @@ +Mosquitto for Windows +===================== + +Mosquitto for Windows comes in 32-bit and 64-bit flavours. + +In both cases, the dependencies are not provided in this installer and must be +installed separately in the case that they are not already available. + + +Capabilities +------------ + +Some versions of Windows have limitations on the number of concurrent +connections, set at approximately 2048 connections depending on the version of +Windows you are using. + + +Websockets +---------- + +The broker executables provided in the installers have Websockets support +through a statically compiled version of libwebsockets and is being distributed +under the Static Linking Exception (Section 2) of the License. As a result, the +content is not subject to the LGPL 2.1. + +Please note that on Windows, libwebsockets limits connections to a maximum of 64 clients. + +Library Thread Support +---------------------- + +libmosquitto on Windows is currently compiled without thread support, so +neither of mosquitto_loop_start() nor "mosquitto_pub -l" are available. + +A better solution that the old pthreads-win32 is being looked into, so support +will return in the future. If you need thread support, the code still supports +it just fine. Support has been dropped to simplify installation. + +Dependencies +------------ + +* OpenSSL + Link: http://slproweb.com/products/Win32OpenSSL.html + Install "Win32 OpenSSL 1.1.0* Light" or "Win64 OpenSSL 1.1.0* Light" + Required DLLs: libssl-1_1.dll, libcrypto-1_1.dll or libssl-1_1-x64.dll, libcrypto-1_1-x64.dll + +Please ensure that the required DLLs are on the system path, or are in the same directory as +the mosquitto executable - usually C:\Program Files (x86)\mosquitto or C:\Program Files\mosquitto. + +Windows Service +--------------- + +If you wish, mosquitto can be installed as a Windows service so you can +start/stop it from the control panel as well as running it as a normal +executable. + +When running as a service, the configuration file used is mosquitto.conf in the +directory that you installed to. + +If you want to install/uninstall mosquitto as a Windows service run from the +command line as follows: + +C:\Program Files\mosquitto\mosquitto install +C:\Program Files\mosquitto\mosquitto uninstall diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/readme.md b/proj1_mqttd/mosquitto/mosquitto-1.6.3/readme.md new file mode 100644 index 0000000..2dce0f8 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/readme.md @@ -0,0 +1,84 @@ +Eclipse Mosquitto +================= + +Mosquitto is an open source implementation of a server for version 5.0, 3.1.1, +and 3.1 of the MQTT protocol. It also includes a C and C++ client library, and +the `mosquitto_pub` and `mosquitto_sub` utilities for publishing and +subscribing. + +## Links + +See the following links for more information on MQTT: + +- Community page: <http://mqtt.org/> +- MQTT v3.1.1 standard: <https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/mqtt-v3.1.1.html> +- MQTT v5.0 standard: <https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html> + +Mosquitto project information is available at the following locations: + +- Main homepage: <https://mosquitto.org/> +- Find existing bugs or submit a new bug: <https://github.com/eclipse/mosquitto/issues> +- Source code repository: <https://github.com/eclipse/mosquitto> + +There is also a public test server available at <https://test.mosquitto.org/> + +## Installing + +See <https://mosquitto.org/download/> for details on installing binaries for +various platforms. + +## Quick start + +If you have installed a binary package the broker should have been started +automatically. If not, it can be started with a basic configuration: + + mosquitto + +Then use `mosquitto_sub` to subscribe to a topic: + + mosquitto_sub -t 'test/topic' -v + +And to publish a message: + + mosquitto_pub -t 'test/topic' -m 'hello world' + +## Documentation + +Documentation for the broker, clients and client library API can be found in +the man pages, which are available online at <https://mosquitto.org/man/>. There +are also pages with an introduction to the features of MQTT, the +`mosquitto_passwd` utility for dealing with username/passwords, and a +description of the configuration file options available for the broker. + +Detailed client library API documentation can be found at <https://mosquitto.org/api/> + +## Building from source + +To build from source the recommended route for end users is to download the +archive from <https://mosquitto.org/download/>. + +On Windows and Mac, use `cmake` to build. On other platforms, just run `make` +to build. For Windows, see also `readme-windows.md`. + +If you are building from the git repository then the documentation will not +already be built. Use `make binary` to skip building the man pages, or install +`docbook-xsl` on Debian/Ubuntu systems. + +### Build Dependencies + +* c-ares (libc-ares-dev on Debian based systems) - only when compiled with `make WITH_SRV=yes` +* libwebsockets (libwebsockets-dev) - enable with `make WITH_WEBSOCKETS=yes` +* openssl (libssl-dev on Debian based systems) - disable with `make WITH_TLS=no` +* xsltproc (xsltproc and docbook-xsl on Debian based systems) - only needed when building from git sources - disable with `make WITH_DOCS=no` +* uthash / utlist - bundled versions of these headers are provided, disable their use with `make WITH_BUNDLED_DEPS=no` + +Equivalent options for enabling/disabling features are available when using the CMake build. + + +## Credits + +Mosquitto was written by Roger Light <roger@atchoo.org> + +Master: [](https://travis-ci.org/eclipse/mosquitto) +Develop: [](https://travis-ci.org/eclipse/mosquitto) +Fixes: [](https://travis-ci.org/eclipse/mosquitto) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/security/mosquitto.apparmor b/proj1_mqttd/mosquitto/mosquitto-1.6.3/security/mosquitto.apparmor new file mode 100644 index 0000000..705de6c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/security/mosquitto.apparmor @@ -0,0 +1,27 @@ +/usr/sbin/mosquitto { + #include <abstractions/base> + #include <abstractions/nameservice> + + /usr/sbin/mosquitto r, + /etc/mosquitto/mosquitto.conf r, + /etc/mosquitto/ca_certificates/* r, + /etc/mosquitto/certs/* r, + /etc/mosquitto/conf.d/* r, + /var/lib/mosquitto/ r, + /var/lib/mosquitto/mosquitto.db rwk, + /var/run/mosquitto.pid rw, + + network inet stream, + network inet6 stream, + network inet dgram, + network inet6 dgram, + + # For drop privileges + capability setgid, + capability setuid, + + # For tcp-wrappers + /lib{,32,64}/libwrap.so* rm, + /etc/hosts.allow r, + /etc/hosts.deny r, +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/service/monit/mosquitto.monit b/proj1_mqttd/mosquitto/mosquitto-1.6.3/service/monit/mosquitto.monit new file mode 100644 index 0000000..8bcbbea --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/service/monit/mosquitto.monit @@ -0,0 +1,4 @@ +check process mosquitto with pidfile /var/run/mosquitto.pid + start = "/etc/init.d/mosquitto start" + stop = "/etc/init.d/mosquitto stop" + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/service/svscan/run b/proj1_mqttd/mosquitto/mosquitto-1.6.3/service/svscan/run new file mode 100755 index 0000000..2bd9a70 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/service/svscan/run @@ -0,0 +1,3 @@ +#!/bin/sh + +/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/service/systemd/README b/proj1_mqttd/mosquitto/mosquitto-1.6.3/service/systemd/README new file mode 100644 index 0000000..bcf8a10 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/service/systemd/README @@ -0,0 +1,9 @@ +Select appropriate systemd service based on your compile settings. If you +enabled WITH_SYSTEMD, use mosquitto.service.notify, otherwise use +mosquitto.service.simple. The service must be renamed to mosquitto.service +before usage. Don't forget to change default paths in service file if you +changed the default build settings. + +With WITH_SYSTEMD mosquitto will notify a complete startup after +initialization. This means that follow-up units can be started after full +initialization of mosquitto (i.e. sockets are opened). diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/service/systemd/mosquitto.service.notify b/proj1_mqttd/mosquitto/mosquitto-1.6.3/service/systemd/mosquitto.service.notify new file mode 100644 index 0000000..d409887 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/service/systemd/mosquitto.service.notify @@ -0,0 +1,15 @@ +[Unit] +Description=Mosquitto MQTT v3.1/v3.1.1 Broker +Documentation=man:mosquitto.conf(5) man:mosquitto(8) +After=network-online.target +Wants=network-online.target + +[Service] +Type=notify +NotifyAccess=main +ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf +ExecReload=/bin/kill -HUP $MAINPID +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/service/systemd/mosquitto.service.simple b/proj1_mqttd/mosquitto/mosquitto-1.6.3/service/systemd/mosquitto.service.simple new file mode 100644 index 0000000..71ab4c1 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/service/systemd/mosquitto.service.simple @@ -0,0 +1,13 @@ +[Unit] +Description=Mosquitto MQTT v3.1/v3.1.1 Broker +Documentation=man:mosquitto.conf(5) man:mosquitto(8) +After=network-online.target +Wants=network-online.target + +[Service] +ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf +ExecReload=/bin/kill -HUP $MAINPID +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/service/upstart/mosquitto.conf b/proj1_mqttd/mosquitto/mosquitto-1.6.3/service/upstart/mosquitto.conf new file mode 100644 index 0000000..993b4c7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/service/upstart/mosquitto.conf @@ -0,0 +1,8 @@ +description "Mosquitto MQTTv3.1 broker" +author "Roger Light <roger@atchoo.org>" + +start on net-device-up + +respawn + +exec /usr/local/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/CMakeLists.txt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/CMakeLists.txt new file mode 100644 index 0000000..7898ff5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/CMakeLists.txt @@ -0,0 +1,194 @@ +include_directories(${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/src + ${mosquitto_SOURCE_DIR}/lib ${OPENSSL_INCLUDE_DIR} + ${STDBOOL_H_PATH} ${STDINT_H_PATH}) + +set (MOSQ_SRCS + ../lib/alias_mosq.c ../lib/alias_mosq.h + conf.c + conf_includedir.c + context.c + database.c + handle_auth.c + handle_connack.c + handle_connect.c + handle_disconnect.c + ../lib/handle_ping.c + ../lib/handle_pubackcomp.c + handle_publish.c + ../lib/handle_pubrec.c + ../lib/handle_pubrel.c + ../lib/handle_suback.c + handle_subscribe.c + ../lib/handle_unsuback.c + handle_unsubscribe.c + lib_load.h + logging.c + loop.c + ../lib/memory_mosq.c ../lib/memory_mosq.h + mosquitto.c + mosquitto_broker.h mosquitto_broker_internal.h + net.c + ../lib/net_mosq_ocsp.c ../lib/net_mosq.c ../lib/net_mosq.h + ../lib/packet_datatypes.c + ../lib/packet_mosq.c ../lib/packet_mosq.h + persist_read_v234.c persist_read_v5.c persist_read.c + persist_write_v5.c persist_write.c + persist.h + plugin.c + property_broker.c + ../lib/property_mosq.c ../lib/property_mosq.h + read_handle.c + ../lib/read_handle.h + security.c security_default.c + ../lib/send_mosq.c ../lib/send_mosq.h + send_auth.c + send_connack.c + ../lib/send_connect.c + ../lib/send_disconnect.c + ../lib/send_publish.c + send_suback.c + signals.c + ../lib/send_subscribe.c + send_unsuback.c + ../lib/send_unsubscribe.c + session_expiry.c + subs.c + sys_tree.c sys_tree.h + ../lib/time_mosq.c + ../lib/tls_mosq.c + ../lib/util_mosq.c ../lib/util_topic.c ../lib/util_mosq.h + ../lib/utf8_mosq.c + websockets.c + will_delay.c + ../lib/will_mosq.c ../lib/will_mosq.h) + + +option(WITH_BUNDLED_DEPS "Build with bundled dependencies?" ON) +if (WITH_BUNDLED_DEPS) + include_directories(${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/src/deps) +endif (WITH_BUNDLED_DEPS) + +option(INC_BRIDGE_SUPPORT + "Include bridge support for connecting to other brokers?" ON) +if (INC_BRIDGE_SUPPORT) + set (MOSQ_SRCS ${MOSQ_SRCS} bridge.c) + add_definitions("-DWITH_BRIDGE") +endif (INC_BRIDGE_SUPPORT) + + +option(USE_LIBWRAP + "Include tcp-wrappers support?" OFF) + +if (USE_LIBWRAP) + set (MOSQ_LIBS ${MOSQ_LIBS} wrap) + add_definitions("-DWITH_WRAP") +endif (USE_LIBWRAP) + +option(INC_DB_UPGRADE + "Include database upgrade support? (recommended)" ON) + +option(INC_MEMTRACK + "Include memory tracking support?" ON) +if (INC_MEMTRACK) + add_definitions("-DWITH_MEMORY_TRACKING") +endif (INC_MEMTRACK) + +option(WITH_PERSISTENCE + "Include persistence support?" ON) +if (WITH_PERSISTENCE) + add_definitions("-DWITH_PERSISTENCE") +endif (WITH_PERSISTENCE) + +option(WITH_SYS_TREE + "Include $SYS tree support?" ON) +if (WITH_SYS_TREE) + add_definitions("-DWITH_SYS_TREE") +endif (WITH_SYS_TREE) + +if (CMAKE_SYSTEM_NAME STREQUAL Linux) + option(WITH_SYSTEMD + "Include systemd support?" OFF) + if (WITH_SYSTEMD) + add_definitions("-DWITH_SYSTEMD") + find_library(SYSTEMD_LIBRARY systemd) + set (MOSQ_LIBS ${MOSQ_LIBS} ${SYSTEMD_LIBRARY}) + endif (WITH_SYSTEMD) +endif (CMAKE_SYSTEM_NAME STREQUAL Linux) + +option(WITH_WEBSOCKETS "Include websockets support?" OFF) +option(STATIC_WEBSOCKETS "Use the static libwebsockets library?" OFF) +if (WITH_WEBSOCKETS) + add_definitions("-DWITH_WEBSOCKETS") +endif (WITH_WEBSOCKETS) + +if (WIN32 OR CYGWIN) + set (MOSQ_SRCS ${MOSQ_SRCS} service.c) +endif (WIN32 OR CYGWIN) + +add_definitions (-DWITH_BROKER) + +if (WITH_DLT) + message(STATUS "DLT_LIBDIR = ${DLT_LIBDIR}") + link_directories(${DLT_LIBDIR}) + set (MOSQ_LIBS ${DLT_LIBRARIES}) +endif (WITH_DLT) + +set (MOSQ_LIBS ${MOSQ_LIBS} ${OPENSSL_LIBRARIES}) +# Check for getaddrinfo_a +include(CheckLibraryExists) +check_library_exists(anl getaddrinfo_a "" HAVE_GETADDRINFO_A) +if (HAVE_GETADDRINFO_A) + add_definitions(-DHAVE_GETADDRINFO_A) + set (MOSQ_LIBS ${MOSQ_LIBS} anl) +endif (HAVE_GETADDRINFO_A) + + +if (UNIX) + if (APPLE) + set (MOSQ_LIBS ${MOSQ_LIBS} dl m) + elseif(QNX) + set(MOSQ_LIBS ${MOSQ_LIBS} m socket) + else(APPLE) + set (MOSQ_LIBS ${MOSQ_LIBS} dl m) + find_library(LIBRT rt) + if (LIBRT) + set (MOSQ_LIBS ${MOSQ_LIBS} rt) + endif (LIBRT) + endif (APPLE) +endif (UNIX) + +if (WIN32) + set (MOSQ_LIBS ${MOSQ_LIBS} ws2_32) +endif (WIN32) + +if (WITH_WEBSOCKETS) + if (STATIC_WEBSOCKETS) + set (MOSQ_LIBS ${MOSQ_LIBS} websockets_static) + if (WIN32) + set (MOSQ_LIBS ${MOSQ_LIBS} iphlpapi) + link_directories(${mosquitto_SOURCE_DIR}) + endif (WIN32) + else (STATIC_WEBSOCKETS) + set (MOSQ_LIBS ${MOSQ_LIBS} websockets) + endif (STATIC_WEBSOCKETS) +endif (WITH_WEBSOCKETS) + +add_executable(mosquitto ${MOSQ_SRCS}) +target_link_libraries(mosquitto ${MOSQ_LIBS}) + +if (UNIX) + if (APPLE) + set_target_properties(mosquitto PROPERTIES LINK_FLAGS "-Wl,-exported_symbols_list -Wl,${mosquitto_SOURCE_DIR}/src/linker-macosx.syms") + else (APPLE) + set_target_properties(mosquitto PROPERTIES LINK_FLAGS "-Wl,-dynamic-list=${mosquitto_SOURCE_DIR}/src/linker.syms") + endif (APPLE) +endif (UNIX) + +install(TARGETS mosquitto RUNTIME DESTINATION "${CMAKE_INSTALL_SBINDIR}") +install(FILES mosquitto_broker.h mosquitto_plugin.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + +if (WITH_TLS) + add_executable(mosquitto_passwd mosquitto_passwd.c) + target_link_libraries(mosquitto_passwd ${OPENSSL_LIBRARIES}) + install(TARGETS mosquitto_passwd RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") +endif (WITH_TLS) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/Makefile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/Makefile new file mode 100644 index 0000000..2517cb6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/Makefile @@ -0,0 +1,293 @@ +include ../config.mk + +.PHONY: all install uninstall clean reallyclean + +ifeq ($(WITH_TLS),yes) +all : mosquitto mosquitto_passwd +else +all : mosquitto +endif + +OBJS= mosquitto.o \ + alias_mosq.o \ + bridge.o \ + conf.o \ + conf_includedir.o \ + context.o \ + database.o \ + handle_auth.o \ + handle_connack.o \ + handle_connect.o \ + handle_disconnect.o \ + handle_ping.o \ + handle_pubackcomp.o \ + handle_publish.o \ + handle_pubrec.o \ + handle_pubrel.o \ + handle_suback.o \ + handle_subscribe.o \ + handle_unsuback.o \ + handle_unsubscribe.o \ + logging.o \ + loop.o \ + memory_mosq.o \ + net.o \ + net_mosq.o \ + net_mosq_ocsp.o \ + packet_datatypes.o \ + packet_mosq.o \ + property_broker.o \ + property_mosq.o \ + persist_read.o \ + persist_read_v234.o \ + persist_read_v5.o \ + persist_write.o \ + persist_write_v5.o \ + plugin.o \ + read_handle.o \ + security.o \ + security_default.o \ + send_auth.o \ + send_connack.o \ + send_connect.o \ + send_disconnect.o \ + send_mosq.o \ + send_publish.o \ + send_suback.o \ + send_subscribe.o \ + send_unsuback.o \ + send_unsubscribe.o \ + service.o \ + session_expiry.o \ + signals.o \ + subs.o \ + sys_tree.o \ + time_mosq.o \ + tls_mosq.o \ + utf8_mosq.o \ + util_mosq.o \ + util_topic.o \ + websockets.o \ + will_delay.o \ + will_mosq.o + +mosquitto : ${OBJS} + ${CROSS_COMPILE}${CC} ${BROKER_LDFLAGS} $^ -o $@ $(BROKER_LDADD) + +mosquitto.o : mosquitto.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +alias_mosq.o : ../lib/alias_mosq.c ../lib/alias_mosq.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +bridge.o : bridge.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +conf.o : conf.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +conf_includedir.o : conf_includedir.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +context.o : context.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +database.o : database.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +handle_auth.o : handle_auth.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +handle_connack.o : handle_connack.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +handle_connect.o : handle_connect.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +handle_disconnect.o : handle_disconnect.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +handle_ping.o : ../lib/handle_ping.c ../lib/read_handle.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +handle_pubackcomp.o : ../lib/handle_pubackcomp.c ../lib/read_handle.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +handle_publish.o : handle_publish.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +handle_pubrec.o : ../lib/handle_pubrec.c ../lib/read_handle.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +handle_pubrel.o : ../lib/handle_pubrel.c ../lib/read_handle.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +handle_suback.o : ../lib/handle_suback.c ../lib/read_handle.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +handle_subscribe.o : handle_subscribe.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +handle_unsuback.o : ../lib/handle_unsuback.c ../lib/read_handle.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +handle_unsubscribe.o : handle_unsubscribe.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +logging.o : logging.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +loop.o : loop.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +memory_mosq.o : ../lib/memory_mosq.c ../lib/memory_mosq.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +net.o : net.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +net_mosq_ocsp.o : ../lib/net_mosq_ocsp.c ../lib/net_mosq.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +net_mosq.o : ../lib/net_mosq.c ../lib/net_mosq.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +persist_read.o : persist_read.c persist.h mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +persist_read_v234.o : persist_read_v234.c persist.h mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +persist_read_v5.o : persist_read_v5.c persist.h mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +persist_write.o : persist_write.c persist.h mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +persist_write_v5.o : persist_write_v5.c persist.h mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +packet_datatypes.o : ../lib/packet_datatypes.c ../lib/packet_mosq.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +packet_mosq.o : ../lib/packet_mosq.c ../lib/packet_mosq.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +property_broker.o : property_broker.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +property_mosq.o : ../lib/property_mosq.c ../lib/property_mosq.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +plugin.o : plugin.c mosquitto_plugin.h mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +read_handle.o : read_handle.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +security.o : security.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +security_default.o : security_default.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +send_auth.o : send_auth.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +send_connect.o : ../lib/send_connect.c ../lib/send_mosq.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +send_disconnect.o : ../lib/send_disconnect.c ../lib/send_mosq.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +send_connack.o : send_connack.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +send_mosq.o : ../lib/send_mosq.c ../lib/send_mosq.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +send_publish.o : ../lib/send_publish.c ../lib/send_mosq.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +send_suback.o : send_suback.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +send_subscribe.o : ../lib/send_subscribe.c ../lib/send_mosq.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +send_unsuback.o : send_unsuback.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +send_unsubscribe.o : ../lib/send_unsubscribe.c ../lib/send_mosq.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +service.o : service.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +session_expiry.o : session_expiry.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +signals.o : signals.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +subs.o : subs.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +sys_tree.o : sys_tree.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +time_mosq.o : ../lib/time_mosq.c ../lib/time_mosq.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +tls_mosq.o : ../lib/tls_mosq.c + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +util_mosq.o : ../lib/util_mosq.c ../lib/util_mosq.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +util_topic.o : ../lib/util_topic.c ../lib/util_mosq.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +utf8_mosq.o : ../lib/utf8_mosq.c + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +websockets.o : websockets.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +will_delay.o : will_delay.c mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +will_mosq.o : ../lib/will_mosq.c ../lib/will_mosq.h + ${CROSS_COMPILE}${CC} $(BROKER_CPPFLAGS) $(BROKER_CFLAGS) -c $< -o $@ + +mosquitto_passwd : mosquitto_passwd.o + ${CROSS_COMPILE}${CC} ${LDFLAGS} $^ -o $@ $(PASSWD_LDADD) + +mosquitto_passwd.o : mosquitto_passwd.c + ${CROSS_COMPILE}${CC} -I.. $(CPPFLAGS) $(CFLAGS) -c $< -o $@ + +plugin_defer.so : plugin_defer.c mosquitto_plugin.h mosquitto_broker.h mosquitto_broker_internal.h + ${CROSS_COMPILE}${CC} -I. -I../lib -fPIC -shared $< -o $@ + +install : all + $(INSTALL) -d "${DESTDIR}$(prefix)/sbin" + $(INSTALL) ${STRIP_OPTS} mosquitto "${DESTDIR}${prefix}/sbin/mosquitto" + $(INSTALL) -d "${DESTDIR}$(prefix)/include" + $(INSTALL) mosquitto_broker.h "${DESTDIR}${prefix}/include/mosquitto_broker.h" + $(INSTALL) mosquitto_plugin.h "${DESTDIR}${prefix}/include/mosquitto_plugin.h" +ifeq ($(WITH_TLS),yes) + $(INSTALL) -d "${DESTDIR}$(prefix)/bin" + $(INSTALL) ${STRIP_OPTS} mosquitto_passwd "${DESTDIR}${prefix}/bin/mosquitto_passwd" +endif + +uninstall : + -rm -f "${DESTDIR}${prefix}/sbin/mosquitto" + -rm -f "${DESTDIR}${prefix}/include/mosquitto_broker.h" + -rm -f "${DESTDIR}${prefix}/include/mosquitto_plugin.h" + -rm -f "${DESTDIR}${prefix}/bin/mosquitto_passwd" + +clean : + -rm -f *.o mosquitto mosquitto_passwd *.gcda *.gcno + +reallyclean : clean + -rm -rf *.orig *.db diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/bridge.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/bridge.c new file mode 100644 index 0000000..7b46daf --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/bridge.c @@ -0,0 +1,489 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <errno.h> +#include <stdio.h> +#include <string.h> + +#ifndef WIN32 +#include <netdb.h> +#include <sys/socket.h> +#else +#include <winsock2.h> +#include <ws2tcpip.h> +#endif + +#include "mqtt_protocol.h" +#include "mosquitto.h" +#include "mosquitto_broker_internal.h" +#include "mosquitto_internal.h" +#include "net_mosq.h" +#include "memory_mosq.h" +#include "packet_mosq.h" +#include "send_mosq.h" +#include "time_mosq.h" +#include "tls_mosq.h" +#include "util_mosq.h" +#include "will_mosq.h" + +#ifdef WITH_BRIDGE + +static void bridge__backoff_step(struct mosquitto *context); +static void bridge__backoff_reset(struct mosquitto *context); + +int bridge__new(struct mosquitto_db *db, struct mosquitto__bridge *bridge) +{ + struct mosquitto *new_context = NULL; + struct mosquitto **bridges; + char *local_id; + + assert(db); + assert(bridge); + + local_id = mosquitto__strdup(bridge->local_clientid); + + HASH_FIND(hh_id, db->contexts_by_id, local_id, strlen(local_id), new_context); + if(new_context){ + /* (possible from persistent db) */ + mosquitto__free(local_id); + }else{ + /* id wasn't found, so generate a new context */ + new_context = context__init(db, -1); + if(!new_context){ + mosquitto__free(local_id); + return MOSQ_ERR_NOMEM; + } + new_context->id = local_id; + HASH_ADD_KEYPTR(hh_id, db->contexts_by_id, new_context->id, strlen(new_context->id), new_context); + } + new_context->bridge = bridge; + new_context->is_bridge = true; + + new_context->username = new_context->bridge->remote_username; + new_context->password = new_context->bridge->remote_password; + +#ifdef WITH_TLS + new_context->tls_cafile = new_context->bridge->tls_cafile; + new_context->tls_capath = new_context->bridge->tls_capath; + new_context->tls_certfile = new_context->bridge->tls_certfile; + new_context->tls_keyfile = new_context->bridge->tls_keyfile; + new_context->tls_cert_reqs = SSL_VERIFY_PEER; + new_context->tls_ocsp_required = new_context->bridge->tls_ocsp_required; + new_context->tls_version = new_context->bridge->tls_version; + new_context->tls_insecure = new_context->bridge->tls_insecure; + new_context->tls_alpn = new_context->bridge->tls_alpn; +#ifdef FINAL_WITH_TLS_PSK + new_context->tls_psk_identity = new_context->bridge->tls_psk_identity; + new_context->tls_psk = new_context->bridge->tls_psk; +#endif +#endif + + bridge->try_private_accepted = true; + new_context->protocol = bridge->protocol_version; + + bridges = mosquitto__realloc(db->bridges, (db->bridge_count+1)*sizeof(struct mosquitto *)); + if(bridges){ + db->bridges = bridges; + db->bridge_count++; + db->bridges[db->bridge_count-1] = new_context; + }else{ + return MOSQ_ERR_NOMEM; + } + +#if defined(__GLIBC__) && defined(WITH_ADNS) + new_context->bridge->restart_t = 1; /* force quick restart of bridge */ + return bridge__connect_step1(db, new_context); +#else + return bridge__connect(db, new_context); +#endif +} + +#if defined(__GLIBC__) && defined(WITH_ADNS) +int bridge__connect_step1(struct mosquitto_db *db, struct mosquitto *context) +{ + int rc; + char *notification_topic; + int notification_topic_len; + uint8_t notification_payload; + int i; + + if(!context || !context->bridge) return MOSQ_ERR_INVAL; + + context__set_state(context, mosq_cs_new); + context->sock = INVALID_SOCKET; + context->last_msg_in = mosquitto_time(); + context->next_msg_out = mosquitto_time() + context->bridge->keepalive; + context->keepalive = context->bridge->keepalive; + context->clean_start = context->bridge->clean_start; + context->in_packet.payload = NULL; + context->ping_t = 0; + context->bridge->lazy_reconnect = false; + bridge__packet_cleanup(context); + db__message_reconnect_reset(db, context); + + if(context->clean_start){ + db__messages_delete(db, context); + } + + /* Delete all local subscriptions even for clean_start==false. We don't + * remove any messages and the next loop carries out the resubscription + * anyway. This means any unwanted subs will be removed. + */ + sub__clean_session(db, context); + + for(i=0; i<context->bridge->topic_count; i++){ + if(context->bridge->topics[i].direction == bd_out || context->bridge->topics[i].direction == bd_both){ + log__printf(NULL, MOSQ_LOG_DEBUG, "Bridge %s doing local SUBSCRIBE on topic %s", context->id, context->bridge->topics[i].local_topic); + if(sub__add(db, + context, + context->bridge->topics[i].local_topic, + context->bridge->topics[i].qos, + 0, + MQTT_SUB_OPT_NO_LOCAL | MQTT_SUB_OPT_RETAIN_AS_PUBLISHED, + &db->subs) > 0){ + return 1; + } + sub__retain_queue(db, context, + context->bridge->topics[i].local_topic, + context->bridge->topics[i].qos, 0); + } + } + + /* prepare backoff for a possible failure. Restart timeout will be reset if connection gets established */ + bridge__backoff_step(context); + + if(context->bridge->notifications){ + if(context->bridge->notification_topic){ + if(!context->bridge->initial_notification_done){ + notification_payload = '0'; + db__messages_easy_queue(db, context, context->bridge->notification_topic, 1, 1, ¬ification_payload, 1, 0, NULL); + context->bridge->initial_notification_done = true; + } + notification_payload = '0'; + rc = will__set(context, context->bridge->notification_topic, 1, ¬ification_payload, 1, true, NULL); + if(rc != MOSQ_ERR_SUCCESS){ + return rc; + } + }else{ + notification_topic_len = strlen(context->bridge->remote_clientid)+strlen("$SYS/broker/connection//state"); + notification_topic = mosquitto__malloc(sizeof(char)*(notification_topic_len+1)); + if(!notification_topic) return MOSQ_ERR_NOMEM; + + snprintf(notification_topic, notification_topic_len+1, "$SYS/broker/connection/%s/state", context->bridge->remote_clientid); + + if(!context->bridge->initial_notification_done){ + notification_payload = '0'; + db__messages_easy_queue(db, context, notification_topic, 1, 1, ¬ification_payload, 1, 0, NULL); + context->bridge->initial_notification_done = true; + } + + notification_payload = '0'; + rc = will__set(context, notification_topic, 1, ¬ification_payload, 1, true, NULL); + mosquitto__free(notification_topic); + if(rc != MOSQ_ERR_SUCCESS){ + return rc; + } + } + } + + log__printf(NULL, MOSQ_LOG_NOTICE, "Connecting bridge (step 1) %s (%s:%d)", context->bridge->name, context->bridge->addresses[context->bridge->cur_address].address, context->bridge->addresses[context->bridge->cur_address].port); + rc = net__try_connect_step1(context, context->bridge->addresses[context->bridge->cur_address].address); + if(rc > 0 ){ + if(rc == MOSQ_ERR_TLS){ + net__socket_close(db, context); + return rc; /* Error already printed */ + }else if(rc == MOSQ_ERR_ERRNO){ + log__printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", strerror(errno)); + }else if(rc == MOSQ_ERR_EAI){ + log__printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", gai_strerror(errno)); + } + + return rc; + } + + return MOSQ_ERR_SUCCESS; +} + + +int bridge__connect_step2(struct mosquitto_db *db, struct mosquitto *context) +{ + int rc; + + if(!context || !context->bridge) return MOSQ_ERR_INVAL; + + log__printf(NULL, MOSQ_LOG_NOTICE, "Connecting bridge (step 2) %s (%s:%d)", context->bridge->name, context->bridge->addresses[context->bridge->cur_address].address, context->bridge->addresses[context->bridge->cur_address].port); + rc = net__try_connect_step2(context, context->bridge->addresses[context->bridge->cur_address].port, &context->sock); + if(rc > 0){ + if(rc == MOSQ_ERR_TLS){ + net__socket_close(db, context); + return rc; /* Error already printed */ + }else if(rc == MOSQ_ERR_ERRNO){ + log__printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", strerror(errno)); + }else if(rc == MOSQ_ERR_EAI){ + log__printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", gai_strerror(errno)); + } + + return rc; + } + + HASH_ADD(hh_sock, db->contexts_by_sock, sock, sizeof(context->sock), context); + + if(rc == MOSQ_ERR_CONN_PENDING){ + context__set_state(context, mosq_cs_connect_pending); + } + return rc; +} + + +int bridge__connect_step3(struct mosquitto_db *db, struct mosquitto *context) +{ + int rc; + + rc = net__socket_connect_step3(context, context->bridge->addresses[context->bridge->cur_address].address); + if(rc > 0){ + if(rc == MOSQ_ERR_TLS){ + net__socket_close(db, context); + return rc; /* Error already printed */ + }else if(rc == MOSQ_ERR_ERRNO){ + log__printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", strerror(errno)); + }else if(rc == MOSQ_ERR_EAI){ + log__printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", gai_strerror(errno)); + } + + return rc; + } + + if(context->bridge->round_robin == false && context->bridge->cur_address != 0){ + context->bridge->primary_retry = mosquitto_time() + 5; + } + + rc = send__connect(context, context->keepalive, context->clean_start, NULL); + if(rc == MOSQ_ERR_SUCCESS){ + bridge__backoff_reset(context); + return MOSQ_ERR_SUCCESS; + }else if(rc == MOSQ_ERR_ERRNO && errno == ENOTCONN){ + bridge__backoff_reset(context); + return MOSQ_ERR_SUCCESS; + }else{ + if(rc == MOSQ_ERR_TLS){ + return rc; /* Error already printed */ + }else if(rc == MOSQ_ERR_ERRNO){ + log__printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", strerror(errno)); + }else if(rc == MOSQ_ERR_EAI){ + log__printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", gai_strerror(errno)); + } + net__socket_close(db, context); + return rc; + } +} +#else + +int bridge__connect(struct mosquitto_db *db, struct mosquitto *context) +{ + int rc, rc2; + int i; + char *notification_topic; + int notification_topic_len; + uint8_t notification_payload; + + if(!context || !context->bridge) return MOSQ_ERR_INVAL; + + context__set_state(context, mosq_cs_new); + context->sock = INVALID_SOCKET; + context->last_msg_in = mosquitto_time(); + context->next_msg_out = mosquitto_time() + context->bridge->keepalive; + context->keepalive = context->bridge->keepalive; + context->clean_start = context->bridge->clean_start; + context->in_packet.payload = NULL; + context->ping_t = 0; + context->bridge->lazy_reconnect = false; + bridge__packet_cleanup(context); + db__message_reconnect_reset(db, context); + + if(context->clean_start){ + db__messages_delete(db, context); + } + + /* Delete all local subscriptions even for clean_start==false. We don't + * remove any messages and the next loop carries out the resubscription + * anyway. This means any unwanted subs will be removed. + */ + sub__clean_session(db, context); + + for(i=0; i<context->bridge->topic_count; i++){ + if(context->bridge->topics[i].direction == bd_out || context->bridge->topics[i].direction == bd_both){ + log__printf(NULL, MOSQ_LOG_DEBUG, "Bridge %s doing local SUBSCRIBE on topic %s", context->id, context->bridge->topics[i].local_topic); + if(sub__add(db, + context, + context->bridge->topics[i].local_topic, + context->bridge->topics[i].qos, + 0, + MQTT_SUB_OPT_NO_LOCAL | MQTT_SUB_OPT_RETAIN_AS_PUBLISHED, + &db->subs) > 0){ + + return 1; + } + } + } + + /* prepare backoff for a possible failure. Restart timeout will be reset if connection gets established */ + bridge__backoff_step(context); + + if(context->bridge->notifications){ + if(context->bridge->notification_topic){ + if(!context->bridge->initial_notification_done){ + notification_payload = '0'; + db__messages_easy_queue(db, context, context->bridge->notification_topic, 1, 1, ¬ification_payload, 1, 0, NULL); + context->bridge->initial_notification_done = true; + } + + if (!context->bridge->notifications_local_only) { + notification_payload = '0'; + rc = will__set(context, context->bridge->notification_topic, 1, ¬ification_payload, 1, true, NULL); + if(rc != MOSQ_ERR_SUCCESS){ + return rc; + } + } + }else{ + notification_topic_len = strlen(context->bridge->remote_clientid)+strlen("$SYS/broker/connection//state"); + notification_topic = mosquitto__malloc(sizeof(char)*(notification_topic_len+1)); + if(!notification_topic) return MOSQ_ERR_NOMEM; + + snprintf(notification_topic, notification_topic_len+1, "$SYS/broker/connection/%s/state", context->bridge->remote_clientid); + + if(!context->bridge->initial_notification_done){ + notification_payload = '0'; + db__messages_easy_queue(db, context, notification_topic, 1, 1, ¬ification_payload, 1, 0, NULL); + context->bridge->initial_notification_done = true; + } + + if (!context->bridge->notifications_local_only) { + notification_payload = '0'; + rc = will__set(context, notification_topic, 1, ¬ification_payload, 1, true, NULL); + mosquitto__free(notification_topic); + if(rc != MOSQ_ERR_SUCCESS){ + return rc; + } + } + } + } + + log__printf(NULL, MOSQ_LOG_NOTICE, "Connecting bridge %s (%s:%d)", context->bridge->name, context->bridge->addresses[context->bridge->cur_address].address, context->bridge->addresses[context->bridge->cur_address].port); + rc = net__socket_connect(context, context->bridge->addresses[context->bridge->cur_address].address, context->bridge->addresses[context->bridge->cur_address].port, NULL, false); + if(rc > 0){ + if(rc == MOSQ_ERR_TLS){ + net__socket_close(db, context); + return rc; /* Error already printed */ + }else if(rc == MOSQ_ERR_ERRNO){ + log__printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", strerror(errno)); + }else if(rc == MOSQ_ERR_EAI){ + log__printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", gai_strerror(errno)); + } + + return rc; + }else if(rc == MOSQ_ERR_CONN_PENDING){ + context__set_state(context, mosq_cs_connect_pending); + } + + HASH_ADD(hh_sock, db->contexts_by_sock, sock, sizeof(context->sock), context); + + rc2 = send__connect(context, context->keepalive, context->clean_start, NULL); + if(rc2 == MOSQ_ERR_SUCCESS){ + bridge__backoff_reset(context); + return rc; + }else if(rc2 == MOSQ_ERR_ERRNO && errno == ENOTCONN){ + bridge__backoff_reset(context); + return MOSQ_ERR_SUCCESS; + }else{ + if(rc2 == MOSQ_ERR_TLS){ + return rc2; /* Error already printed */ + }else if(rc2 == MOSQ_ERR_ERRNO){ + log__printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", strerror(errno)); + }else if(rc2 == MOSQ_ERR_EAI){ + log__printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", gai_strerror(errno)); + } + net__socket_close(db, context); + return rc2; + } +} +#endif + + +void bridge__packet_cleanup(struct mosquitto *context) +{ + struct mosquitto__packet *packet; + if(!context) return; + + if(context->current_out_packet){ + packet__cleanup(context->current_out_packet); + mosquitto__free(context->current_out_packet); + context->current_out_packet = NULL; + } + while(context->out_packet){ + packet__cleanup(context->out_packet); + packet = context->out_packet; + context->out_packet = context->out_packet->next; + mosquitto__free(packet); + } + context->out_packet = NULL; + context->out_packet_last = NULL; + + packet__cleanup(&(context->in_packet)); +} + +static int rand_between(int base, int cap) +{ + int r; + util__random_bytes(&r, sizeof(int)); + return (r % (cap - base)) + base; +} + +static void bridge__backoff_step(struct mosquitto *context) +{ + struct mosquitto__bridge *bridge; + if(!context || !context->bridge) return; + + bridge = context->bridge; + + /* skip if not using backoff */ + if(bridge->backoff_cap){ + /* “Decorrelated Jitter” calculation, according to: + * https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/ + */ + bridge->restart_timeout = rand_between(bridge->backoff_base, bridge->restart_timeout * 3); + if(bridge->restart_timeout > bridge->backoff_cap){ + bridge->restart_timeout = bridge->backoff_cap; + } + } +} + +static void bridge__backoff_reset(struct mosquitto *context) +{ + struct mosquitto__bridge *bridge; + if(!context || !context->bridge) return; + + bridge = context->bridge; + + /* skip if not using backoff */ + if(bridge->backoff_cap){ + bridge->restart_timeout = bridge->backoff_base; + } +} + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/conf.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/conf.c new file mode 100644 index 0000000..53c622c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/conf.c @@ -0,0 +1,2388 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <limits.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <errno.h> + +#ifdef WIN32 +#else +# include <dirent.h> +# include <strings.h> +#endif + +#ifndef WIN32 +# include <netdb.h> +# include <sys/socket.h> +#else +# include <winsock2.h> +# include <ws2tcpip.h> +#endif + +#if !defined(WIN32) && !defined(__CYGWIN__) +# include <syslog.h> +#endif + +#include "mosquitto_broker_internal.h" +#include "memory_mosq.h" +#include "tls_mosq.h" +#include "util_mosq.h" +#include "mqtt_protocol.h" + +struct config_recurse { + int log_dest; + int log_dest_set; + int log_type; + int log_type_set; + unsigned long max_inflight_bytes; + unsigned long max_queued_bytes; + int max_queued_messages; +}; + +#if defined(WIN32) || defined(__CYGWIN__) +#include <windows.h> +extern SERVICE_STATUS_HANDLE service_handle; +#endif + +static struct mosquitto__security_options *cur_security_options = NULL; + +static int conf__parse_bool(char **token, const char *name, bool *value, char *saveptr); +static int conf__parse_int(char **token, const char *name, int *value, char *saveptr); +static int conf__parse_ssize_t(char **token, const char *name, ssize_t *value, char *saveptr); +static int conf__parse_string(char **token, const char *name, char **value, char *saveptr); +static int config__read_file(struct mosquitto__config *config, bool reload, const char *file, struct config_recurse *config_tmp, int level, int *lineno); +static int config__check(struct mosquitto__config *config); +static void config__cleanup_plugins(struct mosquitto__config *config); + +static char *fgets_extending(char **buf, int *buflen, FILE *stream) +{ + char *rc; + char endchar; + int offset = 0; + char *newbuf; + + do{ + rc = fgets(&((*buf)[offset]), *buflen-offset, stream); + if(feof(stream)){ + return rc; + } + + endchar = (*buf)[strlen(*buf)-1]; + if(endchar == '\n'){ + return rc; + } + /* No EOL char found, so extend buffer */ + offset = *buflen-1; + *buflen += 1000; + newbuf = realloc(*buf, *buflen); + if(!newbuf){ + return NULL; + } + *buf = newbuf; + }while(1); +} + + +static void conf__set_cur_security_options(struct mosquitto__config *config, struct mosquitto__listener *cur_listener, struct mosquitto__security_options **security_options) +{ + if(config->per_listener_settings){ + (*security_options) = &cur_listener->security_options; + }else{ + (*security_options) = &config->security_options; + } +} + +static int conf__attempt_resolve(const char *host, const char *text, int log, const char *msg) +{ + struct addrinfo gai_hints; + struct addrinfo *gai_res; + int rc; + + memset(&gai_hints, 0, sizeof(struct addrinfo)); + gai_hints.ai_family = AF_UNSPEC; + gai_hints.ai_socktype = SOCK_STREAM; + gai_res = NULL; + rc = getaddrinfo(host, NULL, &gai_hints, &gai_res); + if(gai_res){ + freeaddrinfo(gai_res); + } + if(rc != 0){ +#ifndef WIN32 + if(rc == EAI_SYSTEM){ + if(errno == ENOENT){ + log__printf(NULL, log, "%s: Unable to resolve %s %s.", msg, text, host); + }else{ + log__printf(NULL, log, "%s: Error resolving %s: %s.", msg, text, strerror(errno)); + } + }else{ + log__printf(NULL, log, "%s: Error resolving %s: %s.", msg, text, gai_strerror(rc)); + } +#else + if(rc == WSAHOST_NOT_FOUND){ + log__printf(NULL, log, "%s: Error resolving %s.", msg, text); + } +#endif + return MOSQ_ERR_INVAL; + } + return MOSQ_ERR_SUCCESS; +} + + +static void config__init_reload(struct mosquitto_db *db, struct mosquitto__config *config) +{ + int i; + /* Set defaults */ + for(i=0; i<config->listener_count; i++){ + mosquitto__free(config->listeners[i].security_options.acl_file); + config->listeners[i].security_options.acl_file = NULL; + + mosquitto__free(config->listeners[i].security_options.password_file); + config->listeners[i].security_options.password_file = NULL; + + mosquitto__free(config->listeners[i].security_options.psk_file); + config->listeners[i].security_options.psk_file = NULL; + + config->listeners[i].security_options.allow_anonymous = -1; + config->listeners[i].security_options.allow_zero_length_clientid = true; + config->listeners[i].security_options.auto_id_prefix = NULL; + config->listeners[i].security_options.auto_id_prefix_len = 0; + } + + config->allow_duplicate_messages = false; + + mosquitto__free(config->security_options.acl_file); + config->security_options.acl_file = NULL; + + config->security_options.allow_anonymous = -1; + config->security_options.allow_zero_length_clientid = true; + config->security_options.auto_id_prefix = NULL; + config->security_options.auto_id_prefix_len = 0; + + mosquitto__free(config->security_options.password_file); + config->security_options.password_file = NULL; + + mosquitto__free(config->security_options.psk_file); + config->security_options.psk_file = NULL; + + config->autosave_interval = 1800; + config->autosave_on_changes = false; + mosquitto__free(config->clientid_prefixes); + config->connection_messages = true; + config->clientid_prefixes = NULL; + config->per_listener_settings = false; + if(config->log_fptr){ + fclose(config->log_fptr); + config->log_fptr = NULL; + } + mosquitto__free(config->log_file); + config->log_file = NULL; + +#if defined(WIN32) || defined(__CYGWIN__) + if(service_handle){ + /* This is running as a Windows service. Default to no logging. Using + * stdout/stderr is forbidden because the first clients to connect will + * get log information sent to them for some reason. */ + config->log_dest = MQTT3_LOG_NONE; + }else{ + config->log_dest = MQTT3_LOG_STDERR; + } +#else + config->log_facility = LOG_DAEMON; + config->log_dest = MQTT3_LOG_STDERR; + if(db->verbose){ + config->log_type = INT_MAX; + }else{ + config->log_type = MOSQ_LOG_ERR | MOSQ_LOG_WARNING | MOSQ_LOG_NOTICE | MOSQ_LOG_INFO; + } +#endif + config->log_timestamp = true; + mosquitto__free(config->log_timestamp_format); + config->log_timestamp_format = NULL; + config->max_keepalive = 65535; + config->max_packet_size = 0; + config->max_inflight_messages = 20; + config->persistence = false; + mosquitto__free(config->persistence_location); + config->persistence_location = NULL; + mosquitto__free(config->persistence_file); + config->persistence_file = NULL; + config->persistent_client_expiration = 0; + config->queue_qos0_messages = false; + config->retain_available = true; + config->set_tcp_nodelay = false; + config->sys_interval = 10; + config->upgrade_outgoing_qos = false; + + config__cleanup_plugins(config); +} + + +static void config__cleanup_plugins(struct mosquitto__config *config) +{ + int i, j; + struct mosquitto__auth_plugin_config *plug; + + if(config->security_options.auth_plugin_configs){ + for(i=0; i<config->security_options.auth_plugin_config_count; i++){ + plug = &config->security_options.auth_plugin_configs[i]; + mosquitto__free(plug->path); + plug->path = NULL; + + if(plug->options){ + for(j=0; j<plug->option_count; j++){ + mosquitto__free(plug->options[j].key); + mosquitto__free(plug->options[j].value); + } + mosquitto__free(plug->options); + plug->options = NULL; + plug->option_count = 0; + } + } + mosquitto__free(config->security_options.auth_plugin_configs); + config->security_options.auth_plugin_configs = NULL; + } +} + + +void config__init(struct mosquitto_db *db, struct mosquitto__config *config) +{ + memset(config, 0, sizeof(struct mosquitto__config)); + config__init_reload(db, config); + + config->daemon = false; + memset(&config->default_listener, 0, sizeof(struct mosquitto__listener)); + config->default_listener.max_connections = -1; + config->default_listener.protocol = mp_mqtt; + config->default_listener.security_options.allow_anonymous = -1; + config->default_listener.maximum_qos = 2; + config->default_listener.max_topic_alias = 10; +} + +void config__cleanup(struct mosquitto__config *config) +{ + int i; +#ifdef WITH_BRIDGE + int j; +#endif + + mosquitto__free(config->clientid_prefixes); + mosquitto__free(config->persistence_location); + mosquitto__free(config->persistence_file); + mosquitto__free(config->persistence_filepath); + mosquitto__free(config->security_options.auto_id_prefix); + mosquitto__free(config->security_options.acl_file); + mosquitto__free(config->security_options.password_file); + mosquitto__free(config->security_options.psk_file); + mosquitto__free(config->pid_file); + if(config->listeners){ + for(i=0; i<config->listener_count; i++){ + mosquitto__free(config->listeners[i].host); + mosquitto__free(config->listeners[i].bind_interface); + mosquitto__free(config->listeners[i].mount_point); + mosquitto__free(config->listeners[i].socks); + mosquitto__free(config->listeners[i].security_options.auto_id_prefix); + mosquitto__free(config->listeners[i].security_options.acl_file); + mosquitto__free(config->listeners[i].security_options.password_file); + mosquitto__free(config->listeners[i].security_options.psk_file); +#ifdef WITH_TLS + mosquitto__free(config->listeners[i].cafile); + mosquitto__free(config->listeners[i].capath); + mosquitto__free(config->listeners[i].certfile); + mosquitto__free(config->listeners[i].keyfile); + mosquitto__free(config->listeners[i].ciphers); + mosquitto__free(config->listeners[i].psk_hint); + mosquitto__free(config->listeners[i].crlfile); + mosquitto__free(config->listeners[i].dhparamfile); + mosquitto__free(config->listeners[i].tls_version); + mosquitto__free(config->listeners[i].tls_engine); + mosquitto__free(config->listeners[i].tls_engine_kpass_sha1); +#ifdef WITH_WEBSOCKETS + if(!config->listeners[i].ws_context) /* libwebsockets frees its own SSL_CTX */ +#endif + { + SSL_CTX_free(config->listeners[i].ssl_ctx); + } +#endif +#ifdef WITH_WEBSOCKETS + mosquitto__free(config->listeners[i].http_dir); +#endif + } + mosquitto__free(config->listeners); + } +#ifdef WITH_BRIDGE + if(config->bridges){ + for(i=0; i<config->bridge_count; i++){ + mosquitto__free(config->bridges[i].name); + if(config->bridges[i].addresses){ + for(j=0; j<config->bridges[i].address_count; j++){ + mosquitto__free(config->bridges[i].addresses[j].address); + } + mosquitto__free(config->bridges[i].addresses); + } + mosquitto__free(config->bridges[i].remote_clientid); + mosquitto__free(config->bridges[i].remote_username); + mosquitto__free(config->bridges[i].remote_password); + mosquitto__free(config->bridges[i].local_clientid); + mosquitto__free(config->bridges[i].local_username); + mosquitto__free(config->bridges[i].local_password); + if(config->bridges[i].topics){ + for(j=0; j<config->bridges[i].topic_count; j++){ + mosquitto__free(config->bridges[i].topics[j].topic); + mosquitto__free(config->bridges[i].topics[j].local_prefix); + mosquitto__free(config->bridges[i].topics[j].remote_prefix); + mosquitto__free(config->bridges[i].topics[j].local_topic); + mosquitto__free(config->bridges[i].topics[j].remote_topic); + } + mosquitto__free(config->bridges[i].topics); + } + mosquitto__free(config->bridges[i].notification_topic); +#ifdef WITH_TLS + mosquitto__free(config->bridges[i].tls_version); + mosquitto__free(config->bridges[i].tls_cafile); + mosquitto__free(config->bridges[i].tls_alpn); +#ifdef FINAL_WITH_TLS_PSK + mosquitto__free(config->bridges[i].tls_psk_identity); + mosquitto__free(config->bridges[i].tls_psk); +#endif +#endif + } + mosquitto__free(config->bridges); + } +#endif + config__cleanup_plugins(config); + + if(config->log_fptr){ + fclose(config->log_fptr); + config->log_fptr = NULL; + } + if(config->log_file){ + mosquitto__free(config->log_file); + config->log_file = NULL; + } +} + +static void print_usage(void) +{ + printf("mosquitto version %s\n\n", VERSION); + printf("mosquitto is an MQTT v3.1.1 broker.\n\n"); + printf("Usage: mosquitto [-c config_file] [-d] [-h] [-p port]\n\n"); + printf(" -c : specify the broker config file.\n"); + printf(" -d : put the broker into the background after starting.\n"); + printf(" -h : display this help.\n"); + printf(" -p : start the broker listening on the specified port.\n"); + printf(" Not recommended in conjunction with the -c option.\n"); + printf(" -v : verbose mode - enable all logging types. This overrides\n"); + printf(" any logging options given in the config file.\n"); + printf("\nSee http://mosquitto.org/ for more information.\n\n"); +} + +int config__parse_args(struct mosquitto_db *db, struct mosquitto__config *config, int argc, char *argv[]) +{ + int i; + int port_tmp; + + for(i=1; i<argc; i++){ + if(!strcmp(argv[i], "-c") || !strcmp(argv[i], "--config-file")){ + if(i<argc-1){ + db->config_file = argv[i+1]; + + if(config__read(db, config, false)){ + return MOSQ_ERR_INVAL; + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: -c argument given, but no config file specified."); + return MOSQ_ERR_INVAL; + } + i++; + }else if(!strcmp(argv[i], "-d") || !strcmp(argv[i], "--daemon")){ + config->daemon = true; + }else if(!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")){ + print_usage(); + return MOSQ_ERR_INVAL; + }else if(!strcmp(argv[i], "-p") || !strcmp(argv[i], "--port")){ + if(i<argc-1){ + port_tmp = atoi(argv[i+1]); + if(port_tmp<1 || port_tmp>65535){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid port specified (%d).", port_tmp); + return MOSQ_ERR_INVAL; + }else{ + if(config->default_listener.port){ + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Default listener port specified multiple times. Only the latest will be used."); + } + config->default_listener.port = port_tmp; + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: -p argument given, but no port specified."); + return MOSQ_ERR_INVAL; + } + i++; + }else if(!strcmp(argv[i], "-v") || !strcmp(argv[i], "--verbose")){ + db->verbose = true; + }else{ + fprintf(stderr, "Error: Unknown option '%s'.\n",argv[i]); + print_usage(); + return MOSQ_ERR_INVAL; + } + } + + if(config->listener_count == 0 +#ifdef WITH_TLS + || config->default_listener.cafile + || config->default_listener.capath + || config->default_listener.certfile + || config->default_listener.keyfile + || config->default_listener.tls_engine + || config->default_listener.tls_keyform != mosq_k_pem + || config->default_listener.tls_engine_kpass_sha1 + || config->default_listener.ciphers + || config->default_listener.dhparamfile + || config->default_listener.psk_hint + || config->default_listener.require_certificate + || config->default_listener.crlfile + || config->default_listener.use_identity_as_username + || config->default_listener.use_subject_as_username +#endif + || config->default_listener.use_username_as_clientid + || config->default_listener.host + || config->default_listener.port + || config->default_listener.max_connections != -1 + || config->default_listener.maximum_qos != 2 + || config->default_listener.mount_point + || config->default_listener.protocol != mp_mqtt + || config->default_listener.socket_domain + || config->default_listener.security_options.password_file + || config->default_listener.security_options.psk_file + || config->default_listener.security_options.auth_plugin_config_count + || config->default_listener.security_options.allow_anonymous != -1 + ){ + + config->listener_count++; + config->listeners = mosquitto__realloc(config->listeners, sizeof(struct mosquitto__listener)*config->listener_count); + if(!config->listeners){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + memset(&config->listeners[config->listener_count-1], 0, sizeof(struct mosquitto__listener)); + if(config->default_listener.port){ + config->listeners[config->listener_count-1].port = config->default_listener.port; + }else{ + config->listeners[config->listener_count-1].port = 1883; + } + if(config->default_listener.host){ + config->listeners[config->listener_count-1].host = config->default_listener.host; + }else{ + config->listeners[config->listener_count-1].host = NULL; + } + if(config->default_listener.mount_point){ + config->listeners[config->listener_count-1].mount_point = config->default_listener.mount_point; + }else{ + config->listeners[config->listener_count-1].mount_point = NULL; + } + config->listeners[config->listener_count-1].max_connections = config->default_listener.max_connections; + config->listeners[config->listener_count-1].protocol = config->default_listener.protocol; + config->listeners[config->listener_count-1].socket_domain = config->default_listener.socket_domain; + config->listeners[config->listener_count-1].client_count = 0; + config->listeners[config->listener_count-1].socks = NULL; + config->listeners[config->listener_count-1].sock_count = 0; + config->listeners[config->listener_count-1].client_count = 0; + config->listeners[config->listener_count-1].use_username_as_clientid = config->default_listener.use_username_as_clientid; + config->listeners[config->listener_count-1].maximum_qos = config->default_listener.maximum_qos; + config->listeners[config->listener_count-1].max_topic_alias = config->default_listener.max_topic_alias; +#ifdef WITH_TLS + config->listeners[config->listener_count-1].tls_version = config->default_listener.tls_version; + config->listeners[config->listener_count-1].tls_engine = config->default_listener.tls_engine; + config->listeners[config->listener_count-1].tls_keyform = config->default_listener.tls_keyform; + config->listeners[config->listener_count-1].tls_engine_kpass_sha1 = config->default_listener.tls_engine_kpass_sha1; + config->listeners[config->listener_count-1].cafile = config->default_listener.cafile; + config->listeners[config->listener_count-1].capath = config->default_listener.capath; + config->listeners[config->listener_count-1].certfile = config->default_listener.certfile; + config->listeners[config->listener_count-1].keyfile = config->default_listener.keyfile; + config->listeners[config->listener_count-1].ciphers = config->default_listener.ciphers; + config->listeners[config->listener_count-1].dhparamfile = config->default_listener.dhparamfile; + config->listeners[config->listener_count-1].psk_hint = config->default_listener.psk_hint; + config->listeners[config->listener_count-1].require_certificate = config->default_listener.require_certificate; + config->listeners[config->listener_count-1].ssl_ctx = NULL; + config->listeners[config->listener_count-1].crlfile = config->default_listener.crlfile; + config->listeners[config->listener_count-1].use_identity_as_username = config->default_listener.use_identity_as_username; + config->listeners[config->listener_count-1].use_subject_as_username = config->default_listener.use_subject_as_username; +#endif + config->listeners[config->listener_count-1].security_options.acl_file = config->default_listener.security_options.acl_file; + config->listeners[config->listener_count-1].security_options.password_file = config->default_listener.security_options.password_file; + config->listeners[config->listener_count-1].security_options.psk_file = config->default_listener.security_options.psk_file; + config->listeners[config->listener_count-1].security_options.auth_plugin_configs = config->default_listener.security_options.auth_plugin_configs; + config->listeners[config->listener_count-1].security_options.auth_plugin_config_count = config->default_listener.security_options.auth_plugin_config_count; + config->listeners[config->listener_count-1].security_options.allow_anonymous = config->default_listener.security_options.allow_anonymous; + } + + /* Default to drop to mosquitto user if we are privileged and no user specified. */ + if(!config->user){ + config->user = "mosquitto"; + } + if(db->verbose){ + config->log_type = INT_MAX; + } + return config__check(config); +} + +void config__copy(struct mosquitto__config *src, struct mosquitto__config *dest) +{ + mosquitto__free(dest->security_options.acl_file); + dest->security_options.acl_file = src->security_options.acl_file; + + dest->security_options.allow_anonymous = src->security_options.allow_anonymous; + dest->security_options.allow_zero_length_clientid = src->security_options.allow_zero_length_clientid; + + mosquitto__free(dest->security_options.auto_id_prefix); + dest->security_options.auto_id_prefix = src->security_options.auto_id_prefix; + dest->security_options.auto_id_prefix_len = src->security_options.auto_id_prefix_len; + + mosquitto__free(dest->security_options.password_file); + dest->security_options.password_file = src->security_options.password_file; + + mosquitto__free(dest->security_options.psk_file); + dest->security_options.psk_file = src->security_options.psk_file; + + + dest->allow_duplicate_messages = src->allow_duplicate_messages; + + + dest->autosave_interval = src->autosave_interval; + dest->autosave_on_changes = src->autosave_on_changes; + + mosquitto__free(dest->clientid_prefixes); + dest->clientid_prefixes = src->clientid_prefixes; + + dest->connection_messages = src->connection_messages; + dest->log_dest = src->log_dest; + dest->log_facility = src->log_facility; + dest->log_type = src->log_type; + dest->log_timestamp = src->log_timestamp; + + mosquitto__free(dest->log_timestamp_format); + dest->log_timestamp_format = src->log_timestamp_format; + + mosquitto__free(dest->log_file); + dest->log_file = src->log_file; + + dest->message_size_limit = src->message_size_limit; + + dest->persistence = src->persistence; + + mosquitto__free(dest->persistence_location); + dest->persistence_location = src->persistence_location; + + mosquitto__free(dest->persistence_file); + dest->persistence_file = src->persistence_file; + + mosquitto__free(dest->persistence_filepath); + dest->persistence_filepath = src->persistence_filepath; + + dest->persistent_client_expiration = src->persistent_client_expiration; + + + dest->queue_qos0_messages = src->queue_qos0_messages; + dest->sys_interval = src->sys_interval; + dest->upgrade_outgoing_qos = src->upgrade_outgoing_qos; + +#ifdef WITH_WEBSOCKETS + dest->websockets_log_level = src->websockets_log_level; +#endif +} + + +int config__read(struct mosquitto_db *db, struct mosquitto__config *config, bool reload) +{ + int rc = MOSQ_ERR_SUCCESS; + struct config_recurse cr; + int lineno = 0; +#ifdef WITH_PERSISTENCE + int len; +#endif + struct mosquitto__config config_reload; + struct mosquitto__auth_plugin *plugin; + int i, j; + + if(reload){ + memset(&config_reload, 0, sizeof(struct mosquitto__config)); + } + + cr.log_dest = MQTT3_LOG_NONE; + cr.log_dest_set = 0; + cr.log_type = MOSQ_LOG_NONE; + cr.log_type_set = 0; + cr.max_inflight_bytes = 0; + cr.max_queued_bytes = 0; + cr.max_queued_messages = 100; + + if(!db->config_file) return 0; + + if(reload){ + /* Re-initialise appropriate config vars to default for reload. */ + config__init_reload(db, &config_reload); + config_reload.listeners = config->listeners; + config_reload.listener_count = config->listener_count; + rc = config__read_file(&config_reload, reload, db->config_file, &cr, 0, &lineno); + }else{ + rc = config__read_file(config, reload, db->config_file, &cr, 0, &lineno); + } + if(rc){ + if(lineno > 0){ + log__printf(NULL, MOSQ_LOG_ERR, "Error found at %s:%d.", db->config_file, lineno); + } + return rc; + } + + if(reload){ + config__copy(&config_reload, config); + } + + /* If auth/access options are set and allow_anonymous not explicitly set, disallow anon. */ + if(config->per_listener_settings){ + for(i=0; i<config->listener_count; i++){ + if(config->listeners[i].security_options.allow_anonymous == -1){ + /* Default option if no security options set */ + config->listeners[i].security_options.allow_anonymous = true; + + if(config->listeners[i].security_options.password_file + || config->listeners[i].security_options.psk_file){ + + /* allow_anonymous not set explicitly, some other security options + * have been set - so disable allow_anonymous + */ + config->listeners[i].security_options.allow_anonymous = false; + } + + /* Check plugins loaded to see if they have username/password checks enabled */ + for(j=0; j<config->listeners[i].security_options.auth_plugin_config_count; j++){ + plugin = &config->listeners[i].security_options.auth_plugin_configs[j].plugin; + + if(plugin->version == 3 || plugin->version == 2){ + /* Version 2 and 3 always have username/password checks */ + config->listeners[i].security_options.allow_anonymous = false; + break; + }else{ + /* Version 4 has optional unpwd checks. */ + if(plugin->unpwd_check_v4 != NULL){ + config->listeners[i].security_options.allow_anonymous = false; + break; + } + } + } + } + } + }else{ + if(config->security_options.allow_anonymous == -1){ + /* Default option if no security options set */ + config->security_options.allow_anonymous = true; + + if(config->security_options.password_file + || config->security_options.psk_file){ + + /* allow_anonymous not set explicitly, some other security options + * have been set - so disable allow_anonymous + */ + config->security_options.allow_anonymous = false; + } + + /* Check plugins loaded to see if they have username/password checks enabled */ + for(j=0; j<config->security_options.auth_plugin_config_count; j++){ + plugin = &config->security_options.auth_plugin_configs[j].plugin; + + if(plugin->version == 3 || plugin->version == 2){ + /* Version 2 and 3 always have username/password checks */ + config->security_options.allow_anonymous = false; + break; + }else{ + /* Version 4 has optional unpwd checks. */ + if(plugin->unpwd_check_v4 != NULL){ + config->security_options.allow_anonymous = false; + break; + } + } + } + } + } +#ifdef WITH_PERSISTENCE + if(config->persistence){ + if(!config->persistence_file){ + config->persistence_file = mosquitto__strdup("mosquitto.db"); + if(!config->persistence_file) return MOSQ_ERR_NOMEM; + } + mosquitto__free(config->persistence_filepath); + if(config->persistence_location && strlen(config->persistence_location)){ + len = strlen(config->persistence_location) + strlen(config->persistence_file) + 1; + config->persistence_filepath = mosquitto__malloc(len); + if(!config->persistence_filepath) return MOSQ_ERR_NOMEM; + snprintf(config->persistence_filepath, len, "%s%s", config->persistence_location, config->persistence_file); + }else{ + config->persistence_filepath = mosquitto__strdup(config->persistence_file); + if(!config->persistence_filepath) return MOSQ_ERR_NOMEM; + } + } +#endif + /* Default to drop to mosquitto user if no other user specified. This must + * remain here even though it is covered in config__parse_args() because this + * function may be called on its own. */ + if(!config->user){ + config->user = "mosquitto"; + } + + db__limits_set(cr.max_inflight_bytes, cr.max_queued_messages, cr.max_queued_bytes); + +#ifdef WITH_BRIDGE + for(i=0; i<config->bridge_count; i++){ + if(!config->bridges[i].name || !config->bridges[i].addresses || !config->bridges[i].topic_count){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } +#ifdef FINAL_WITH_TLS_PSK + if(config->bridges[i].tls_psk && !config->bridges[i].tls_psk_identity){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration: missing bridge_identity."); + return MOSQ_ERR_INVAL; + } + if(config->bridges[i].tls_psk_identity && !config->bridges[i].tls_psk){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration: missing bridge_psk."); + return MOSQ_ERR_INVAL; + } +#endif + } +#endif + + if(cr.log_dest_set){ + config->log_dest = cr.log_dest; + } + if(db->verbose){ + config->log_type = INT_MAX; + }else if(cr.log_type_set){ + config->log_type = cr.log_type; + } + return MOSQ_ERR_SUCCESS; +} + +int config__read_file_core(struct mosquitto__config *config, bool reload, struct config_recurse *cr, int level, int *lineno, FILE *fptr, char **buf, int *buflen) +{ + int rc; + char *token; + int tmp_int; + char *saveptr = NULL; +#ifdef WITH_BRIDGE + char *tmp_char; + struct mosquitto__bridge *cur_bridge = NULL; + struct mosquitto__bridge_topic *cur_topic; + int len; +#endif + struct mosquitto__auth_plugin_config *cur_auth_plugin_config = NULL; + + time_t expiration_mult; + char *key; + struct mosquitto__listener *cur_listener = &config->default_listener; + int i; + int lineno_ext = 0; + + *lineno = 0; + + while(fgets_extending(buf, buflen, fptr)){ + (*lineno)++; + if((*buf)[0] != '#' && (*buf)[0] != 10 && (*buf)[0] != 13){ + while((*buf)[strlen((*buf))-1] == 10 || (*buf)[strlen((*buf))-1] == 13){ + (*buf)[strlen((*buf))-1] = 0; + } + token = strtok_r((*buf), " ", &saveptr); + if(token){ + if(!strcmp(token, "acl_file")){ + conf__set_cur_security_options(config, cur_listener, &cur_security_options); + if(reload){ + mosquitto__free(cur_security_options->acl_file); + cur_security_options->acl_file = NULL; + } + if(conf__parse_string(&token, "acl_file", &cur_security_options->acl_file, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "address") || !strcmp(token, "addresses")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge || cur_bridge->addresses){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + while((token = strtok_r(NULL, " ", &saveptr))){ + if (token[0] == '#'){ + break; + } + cur_bridge->address_count++; + cur_bridge->addresses = mosquitto__realloc(cur_bridge->addresses, sizeof(struct bridge_address)*cur_bridge->address_count); + if(!cur_bridge->addresses){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + cur_bridge->addresses[cur_bridge->address_count-1].address = token; + } + for(i=0; i<cur_bridge->address_count; i++){ + /* cur_bridge->addresses[i].address is now + * "address[:port]". If address is an IPv6 address, + * then port is required. We must check for the : + * backwards. */ + tmp_char = strrchr(cur_bridge->addresses[i].address, ':'); + if(tmp_char){ + /* Remove ':', so cur_bridge->addresses[i].address + * now just looks like the address. */ + tmp_char[0] = '\0'; + + /* The remainder of the string */ + tmp_int = atoi(&tmp_char[1]); + if(tmp_int < 1 || tmp_int > 65535){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid port value (%d).", tmp_int); + return MOSQ_ERR_INVAL; + } + cur_bridge->addresses[i].port = tmp_int; + }else{ + cur_bridge->addresses[i].port = 1883; + } + /* This looks a bit weird, but isn't. Before this + * call, cur_bridge->addresses[i].address points + * to the tokenised part of the line, it will be + * reused in a future parse of a config line so we + * must duplicate it. */ + cur_bridge->addresses[i].address = mosquitto__strdup(cur_bridge->addresses[i].address); + conf__attempt_resolve(cur_bridge->addresses[i].address, "bridge address", MOSQ_LOG_WARNING, "Warning"); + } + if(cur_bridge->address_count == 0){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty address value in configuration."); + return MOSQ_ERR_INVAL; + } +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "allow_anonymous")){ + conf__set_cur_security_options(config, cur_listener, &cur_security_options); + if(conf__parse_bool(&token, "allow_anonymous", (bool *)&cur_security_options->allow_anonymous, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "allow_duplicate_messages")){ + if(conf__parse_bool(&token, "allow_duplicate_messages", &config->allow_duplicate_messages, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "allow_zero_length_clientid")){ + conf__set_cur_security_options(config, cur_listener, &cur_security_options); + if(conf__parse_bool(&token, "allow_zero_length_clientid", &cur_security_options->allow_zero_length_clientid, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strncmp(token, "auth_opt_", 9)){ + if(reload) continue; // Auth plugin not currently valid for reloading. + if(!cur_auth_plugin_config){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: An auth_opt_ option exists in the config file without an auth_plugin."); + return MOSQ_ERR_INVAL; + } + if(strlen(token) < 12){ + /* auth_opt_ == 9, + one digit key == 10, + one space == 11, + one value == 12 */ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid auth_opt_ config option."); + return MOSQ_ERR_INVAL; + } + key = mosquitto__strdup(&token[9]); + if(!key){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + }else if(STREMPTY(key)){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid auth_opt_ config option."); + mosquitto__free(key); + return MOSQ_ERR_INVAL; + } + token += 9+strlen(key)+1; + while(token[0] == ' ' || token[0] == '\t'){ + token++; + } + if(token[0]){ + cur_auth_plugin_config->option_count++; + cur_auth_plugin_config->options = mosquitto__realloc(cur_auth_plugin_config->options, cur_auth_plugin_config->option_count*sizeof(struct mosquitto_auth_opt)); + if(!cur_auth_plugin_config->options){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + mosquitto__free(key); + return MOSQ_ERR_NOMEM; + } + cur_auth_plugin_config->options[cur_auth_plugin_config->option_count-1].key = key; + cur_auth_plugin_config->options[cur_auth_plugin_config->option_count-1].value = mosquitto__strdup(token); + if(!cur_auth_plugin_config->options[cur_auth_plugin_config->option_count-1].value){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty %s value in configuration.", key); + mosquitto__free(key); + return MOSQ_ERR_INVAL; + } + }else if(!strcmp(token, "auth_plugin")){ + if(reload) continue; // Auth plugin not currently valid for reloading. + conf__set_cur_security_options(config, cur_listener, &cur_security_options); + cur_security_options->auth_plugin_configs = mosquitto__realloc(cur_security_options->auth_plugin_configs, (cur_security_options->auth_plugin_config_count+1)*sizeof(struct mosquitto__auth_plugin_config)); + if(!cur_security_options->auth_plugin_configs){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + cur_auth_plugin_config = &cur_security_options->auth_plugin_configs[cur_security_options->auth_plugin_config_count]; + memset(cur_auth_plugin_config, 0, sizeof(struct mosquitto__auth_plugin_config)); + cur_auth_plugin_config->path = NULL; + cur_auth_plugin_config->options = NULL; + cur_auth_plugin_config->option_count = 0; + cur_auth_plugin_config->deny_special_chars = true; + cur_security_options->auth_plugin_config_count++; + if(conf__parse_string(&token, "auth_plugin", &cur_auth_plugin_config->path, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "auth_plugin_deny_special_chars")){ + if(reload) continue; // Auth plugin not currently valid for reloading. + if(!cur_auth_plugin_config){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: An auth_plugin_deny_special_chars option exists in the config file without an auth_plugin."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_bool(&token, "auth_plugin_deny_special_chars", &cur_auth_plugin_config->deny_special_chars, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "auto_id_prefix")){ + conf__set_cur_security_options(config, cur_listener, &cur_security_options); + if(conf__parse_string(&token, "auto_id_prefix", &cur_security_options->auto_id_prefix, saveptr)) return MOSQ_ERR_INVAL; + if(cur_security_options->auto_id_prefix){ + cur_security_options->auto_id_prefix_len = strlen(cur_security_options->auto_id_prefix); + }else{ + cur_security_options->auto_id_prefix_len = 0; + } + }else if(!strcmp(token, "autosave_interval")){ + if(conf__parse_int(&token, "autosave_interval", &config->autosave_interval, saveptr)) return MOSQ_ERR_INVAL; + if(config->autosave_interval < 0) config->autosave_interval = 0; + }else if(!strcmp(token, "autosave_on_changes")){ + if(conf__parse_bool(&token, "autosave_on_changes", &config->autosave_on_changes, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "bind_address")){ + if(reload) continue; // Listener not valid for reloading. + if(conf__parse_string(&token, "default listener bind_address", &config->default_listener.host, saveptr)) return MOSQ_ERR_INVAL; + if(conf__attempt_resolve(config->default_listener.host, "bind_address", MOSQ_LOG_ERR, "Error")){ + return MOSQ_ERR_INVAL; + } + }else if(!strcmp(token, "bind_interface")){ +#ifdef SO_BINDTODEVICE + if(reload) continue; // Listeners not valid for reloading. + if(conf__parse_string(&token, "bind_interface", &cur_listener->bind_interface, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_ERR, "Error: bind_interface specified but socket option not available."); + return MOSQ_ERR_INVAL; +#endif + }else if(!strcmp(token, "bridge_attempt_unsubscribe")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_bool(&token, "bridge_attempt_unsubscribe", &cur_bridge->attempt_unsubscribe, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "bridge_cafile")){ +#if defined(WITH_BRIDGE) && defined(WITH_TLS) + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } +#ifdef FINAL_WITH_TLS_PSK + if(cur_bridge->tls_psk_identity || cur_bridge->tls_psk){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Cannot use both certificate and psk encryption in a single bridge."); + return MOSQ_ERR_INVAL; + } +#endif + if(conf__parse_string(&token, "bridge_cafile", &cur_bridge->tls_cafile, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge and/or TLS support not available."); +#endif + }else if(!strcmp(token, "bridge_alpn")){ +#if defined(WITH_BRIDGE) && defined(WITH_TLS) + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_string(&token, "bridge_alpn", &cur_bridge->tls_alpn, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge and/or TLS support not available."); +#endif + }else if(!strcmp(token, "bridge_capath")){ +#if defined(WITH_BRIDGE) && defined(WITH_TLS) + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } +#ifdef FINAL_WITH_TLS_PSK + if(cur_bridge->tls_psk_identity || cur_bridge->tls_psk){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Cannot use both certificate and psk encryption in a single bridge."); + return MOSQ_ERR_INVAL; + } +#endif + if(conf__parse_string(&token, "bridge_capath", &cur_bridge->tls_capath, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge and/or TLS support not available."); +#endif + }else if(!strcmp(token, "bridge_certfile")){ +#if defined(WITH_BRIDGE) && defined(WITH_TLS) + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } +#ifdef FINAL_WITH_TLS_PSK + if(cur_bridge->tls_psk_identity || cur_bridge->tls_psk){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Cannot use both certificate and psk encryption in a single bridge."); + return MOSQ_ERR_INVAL; + } +#endif + if(conf__parse_string(&token, "bridge_certfile", &cur_bridge->tls_certfile, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge and/or TLS support not available."); +#endif + }else if(!strcmp(token, "bridge_identity")){ +#if defined(WITH_BRIDGE) && defined(FINAL_WITH_TLS_PSK) + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(cur_bridge->tls_cafile || cur_bridge->tls_capath || cur_bridge->tls_certfile || cur_bridge->tls_keyfile){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Cannot use both certificate and identity encryption in a single bridge."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_string(&token, "bridge_identity", &cur_bridge->tls_psk_identity, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge and/or TLS-PSK support not available."); +#endif + }else if(!strcmp(token, "bridge_insecure")){ +#if defined(WITH_BRIDGE) && defined(WITH_TLS) + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_bool(&token, "bridge_insecure", &cur_bridge->tls_insecure, saveptr)) return MOSQ_ERR_INVAL; + if(cur_bridge->tls_insecure){ + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge %s using insecure mode.", cur_bridge->name); + } +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge and/or TLS-PSK support not available."); +#endif + }else if(!strcmp(token, "bridge_require_ocsp")){ +#if defined(WITH_BRIDGE) && defined(WITH_TLS) + if(reload) continue; // Listeners not valid for reloading. + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_bool(&token, "bridge_require_ocsp", &cur_bridge->tls_ocsp_required, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "bridge_keyfile")){ +#if defined(WITH_BRIDGE) && defined(WITH_TLS) + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } +#ifdef FINAL_WITH_TLS_PSK + if(cur_bridge->tls_psk_identity || cur_bridge->tls_psk){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Cannot use both certificate and psk encryption in a single bridge."); + return MOSQ_ERR_INVAL; + } +#endif + if(conf__parse_string(&token, "bridge_keyfile", &cur_bridge->tls_keyfile, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge and/or TLS support not available."); +#endif + }else if(!strcmp(token, "bridge_protocol_version")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + token = strtok_r(NULL, "", &saveptr); + if(token){ + if(!strcmp(token, "mqttv31")){ + cur_bridge->protocol_version = mosq_p_mqtt31; + }else if(!strcmp(token, "mqttv311")){ + cur_bridge->protocol_version = mosq_p_mqtt311; + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge_protocol_version value (%s).", token); + return MOSQ_ERR_INVAL; + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty bridge_protocol_version value in configuration."); + return MOSQ_ERR_INVAL; + } +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "bridge_psk")){ +#if defined(WITH_BRIDGE) && defined(FINAL_WITH_TLS_PSK) + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(cur_bridge->tls_cafile || cur_bridge->tls_capath || cur_bridge->tls_certfile || cur_bridge->tls_keyfile){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Cannot use both certificate and psk encryption in a single bridge."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_string(&token, "bridge_psk", &cur_bridge->tls_psk, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge and/or TLS-PSK support not available."); +#endif + }else if(!strcmp(token, "bridge_tls_version")){ +#if defined(WITH_BRIDGE) && defined(WITH_TLS) + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_string(&token, "bridge_tls_version", &cur_bridge->tls_version, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge and/or TLS support not available."); +#endif + }else if(!strcmp(token, "cafile")){ +#if defined(WITH_TLS) + if(reload) continue; // Listeners not valid for reloading. + if(cur_listener->psk_hint){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Cannot use both certificate and psk encryption in a single listener."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_string(&token, "cafile", &cur_listener->cafile, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "capath")){ +#ifdef WITH_TLS + if(reload) continue; // Listeners not valid for reloading. + if(conf__parse_string(&token, "capath", &cur_listener->capath, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "certfile")){ +#ifdef WITH_TLS + if(reload) continue; // Listeners not valid for reloading. + if(cur_listener->psk_hint){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Cannot use both certificate and psk encryption in a single listener."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_string(&token, "certfile", &cur_listener->certfile, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "check_retain_source")){ + conf__set_cur_security_options(config, cur_listener, &cur_security_options); + if(conf__parse_bool(&token, "check_retain_source", &config->check_retain_source, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "ciphers")){ +#ifdef WITH_TLS + if(reload) continue; // Listeners not valid for reloading. + if(conf__parse_string(&token, "ciphers", &cur_listener->ciphers, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "clientid") || !strcmp(token, "remote_clientid")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_string(&token, "bridge remote clientid", &cur_bridge->remote_clientid, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "cleansession")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_bool(&token, "cleansession", &cur_bridge->clean_start, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "clientid_prefixes")){ + if(reload){ + mosquitto__free(config->clientid_prefixes); + config->clientid_prefixes = NULL; + } + if(conf__parse_string(&token, "clientid_prefixes", &config->clientid_prefixes, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "connection")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + token = strtok_r(NULL, " ", &saveptr); + if(token){ + /* Check for existing bridge name. */ + for(i=0; i<config->bridge_count; i++){ + if(!strcmp(config->bridges[i].name, token)){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Duplicate bridge name \"%s\".", token); + return MOSQ_ERR_INVAL; + } + } + + config->bridge_count++; + config->bridges = mosquitto__realloc(config->bridges, config->bridge_count*sizeof(struct mosquitto__bridge)); + if(!config->bridges){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + cur_bridge = &(config->bridges[config->bridge_count-1]); + memset(cur_bridge, 0, sizeof(struct mosquitto__bridge)); + cur_bridge->name = mosquitto__strdup(token); + if(!cur_bridge->name){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + cur_bridge->keepalive = 60; + cur_bridge->notifications = true; + cur_bridge->notifications_local_only = false; + cur_bridge->start_type = bst_automatic; + cur_bridge->idle_timeout = 60; + cur_bridge->restart_timeout = 0; + cur_bridge->backoff_base = 5; + cur_bridge->backoff_cap = 30; + cur_bridge->threshold = 10; + cur_bridge->try_private = true; + cur_bridge->attempt_unsubscribe = true; + cur_bridge->protocol_version = mosq_p_mqtt311; + cur_bridge->primary_retry_sock = INVALID_SOCKET; + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty connection value in configuration."); + return MOSQ_ERR_INVAL; + } +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "connection_messages")){ + if(conf__parse_bool(&token, token, &config->connection_messages, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "crlfile")){ +#ifdef WITH_TLS + if(reload) continue; // Listeners not valid for reloading. + if(conf__parse_string(&token, "crlfile", &cur_listener->crlfile, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "dhparamfile")){ +#ifdef WITH_TLS + if(reload) continue; // Listeners not valid for reloading. + if(conf__parse_string(&token, "dhparamfile", &cur_listener->dhparamfile, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "http_dir")){ +#ifdef WITH_WEBSOCKETS + if(reload) continue; // Listeners not valid for reloading. + if(conf__parse_string(&token, "http_dir", &cur_listener->http_dir, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Websockets support not available."); +#endif + }else if(!strcmp(token, "idle_timeout")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_int(&token, "idle_timeout", &cur_bridge->idle_timeout, saveptr)) return MOSQ_ERR_INVAL; + if(cur_bridge->idle_timeout < 1){ + log__printf(NULL, MOSQ_LOG_NOTICE, "idle_timeout interval too low, using 1 second."); + cur_bridge->idle_timeout = 1; + } +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "include_dir")){ + if(level == 0){ + /* Only process include_dir from the main config file. */ + token = strtok_r(NULL, "", &saveptr); + if(!token){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty include_dir value in configuration."); + return 1; + } + + char **files; + int file_count; + rc = config__get_dir_files(token, &files, &file_count); + if(rc) return rc; + + for(i=0; i<file_count; i++){ + log__printf(NULL, MOSQ_LOG_INFO, "Loading config file %s", files[i]); + + rc = config__read_file(config, reload, files[i], cr, level+1, &lineno_ext); + if(rc){ + if(lineno_ext > 0){ + log__printf(NULL, MOSQ_LOG_ERR, "Error found at %s:%d.", files[i], lineno_ext); + } + /* Free happens below */ + break; + } + } + for(i=0; i<file_count; i++){ + mosquitto__free(files[i]); + } + mosquitto__free(files); + if(rc) return rc; /* This returns if config__read_file() fails above */ + } + }else if(!strcmp(token, "keepalive_interval")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_int(&token, "keepalive_interval", &cur_bridge->keepalive, saveptr)) return MOSQ_ERR_INVAL; + if(cur_bridge->keepalive < 5){ + log__printf(NULL, MOSQ_LOG_NOTICE, "keepalive interval too low, using 5 seconds."); + cur_bridge->keepalive = 5; + } +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "keyfile")){ +#ifdef WITH_TLS + if(reload) continue; // Listeners not valid for reloading. + if(conf__parse_string(&token, "keyfile", &cur_listener->keyfile, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "listener")){ + token = strtok_r(NULL, " ", &saveptr); + if(token){ + tmp_int = atoi(token); + if(tmp_int < 1 || tmp_int > 65535){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid port value (%d).", tmp_int); + return MOSQ_ERR_INVAL; + } + + if(reload){ + /* We reload listeners settings based on port number. + * If the port number doesn't already exist, exit with a complaint. */ + cur_listener = NULL; + for(i=0; i<config->listener_count; i++){ + if(config->listeners[i].port == tmp_int){ + cur_listener = &config->listeners[i]; + } + } + if(!cur_listener){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: It is not currently possible to add/remove listeners when reloading the config file."); + return MOSQ_ERR_INVAL; + } + }else{ + config->listener_count++; + config->listeners = mosquitto__realloc(config->listeners, sizeof(struct mosquitto__listener)*config->listener_count); + if(!config->listeners){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + cur_listener = &config->listeners[config->listener_count-1]; + memset(cur_listener, 0, sizeof(struct mosquitto__listener)); + } + + cur_listener->security_options.allow_anonymous = -1; + cur_listener->protocol = mp_mqtt; + cur_listener->port = tmp_int; + cur_listener->maximum_qos = 2; + cur_listener->max_topic_alias = 10; + token = strtok_r(NULL, " ", &saveptr); + if (token != NULL && token[0] == '#'){ + token = NULL; + } + mosquitto__free(cur_listener->host); + if(token){ + cur_listener->host = mosquitto__strdup(token); + }else{ + cur_listener->host = NULL; + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty listener value in configuration."); + return MOSQ_ERR_INVAL; + } + }else if(!strcmp(token, "local_clientid")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_string(&token, "bridge local clientd", &cur_bridge->local_clientid, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "local_password")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_string(&token, "bridge local_password", &cur_bridge->local_password, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "local_username")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_string(&token, "bridge local_username", &cur_bridge->local_username, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "log_dest")){ + token = strtok_r(NULL, " ", &saveptr); + if(token){ + cr->log_dest_set = 1; + if(!strcmp(token, "none")){ + cr->log_dest = MQTT3_LOG_NONE; + }else if(!strcmp(token, "syslog")){ + cr->log_dest |= MQTT3_LOG_SYSLOG; + }else if(!strcmp(token, "stdout")){ + cr->log_dest |= MQTT3_LOG_STDOUT; + }else if(!strcmp(token, "stderr")){ + cr->log_dest |= MQTT3_LOG_STDERR; + }else if(!strcmp(token, "topic")){ + cr->log_dest |= MQTT3_LOG_TOPIC; + }else if(!strcmp(token, "file")){ + cr->log_dest |= MQTT3_LOG_FILE; + if(config->log_fptr || config->log_file){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Duplicate \"log_dest file\" value."); + return MOSQ_ERR_INVAL; + } + /* Get remaining string. */ + token = &token[strlen(token)+1]; + while(token[0] == ' ' || token[0] == '\t'){ + token++; + } + if(token[0]){ + config->log_file = mosquitto__strdup(token); + if(!config->log_file){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty \"log_dest file\" value in configuration."); + return MOSQ_ERR_INVAL; + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid log_dest value (%s).", token); + return MOSQ_ERR_INVAL; + } +#if defined(WIN32) || defined(__CYGWIN__) + if(service_handle){ + if(cr->log_dest == MQTT3_LOG_STDOUT || cr->log_dest == MQTT3_LOG_STDERR){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Cannot log to stdout/stderr when running as a Windows service."); + return MOSQ_ERR_INVAL; + } + } +#endif + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty log_dest value in configuration."); + return MOSQ_ERR_INVAL; + } + }else if(!strcmp(token, "log_facility")){ +#if defined(WIN32) || defined(__CYGWIN__) + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: log_facility not supported on Windows."); +#else + if(conf__parse_int(&token, "log_facility", &tmp_int, saveptr)) return MOSQ_ERR_INVAL; + switch(tmp_int){ + case 0: + config->log_facility = LOG_LOCAL0; + break; + case 1: + config->log_facility = LOG_LOCAL1; + break; + case 2: + config->log_facility = LOG_LOCAL2; + break; + case 3: + config->log_facility = LOG_LOCAL3; + break; + case 4: + config->log_facility = LOG_LOCAL4; + break; + case 5: + config->log_facility = LOG_LOCAL5; + break; + case 6: + config->log_facility = LOG_LOCAL6; + break; + case 7: + config->log_facility = LOG_LOCAL7; + break; + default: + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid log_facility value (%d).", tmp_int); + return MOSQ_ERR_INVAL; + } +#endif + }else if(!strcmp(token, "log_timestamp")){ + if(conf__parse_bool(&token, token, &config->log_timestamp, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "log_timestamp_format")){ + if(conf__parse_string(&token, token, &config->log_timestamp_format, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "log_type")){ + token = strtok_r(NULL, " ", &saveptr); + if(token){ + cr->log_type_set = 1; + if(!strcmp(token, "none")){ + cr->log_type = MOSQ_LOG_NONE; + }else if(!strcmp(token, "information")){ + cr->log_type |= MOSQ_LOG_INFO; + }else if(!strcmp(token, "notice")){ + cr->log_type |= MOSQ_LOG_NOTICE; + }else if(!strcmp(token, "warning")){ + cr->log_type |= MOSQ_LOG_WARNING; + }else if(!strcmp(token, "error")){ + cr->log_type |= MOSQ_LOG_ERR; + }else if(!strcmp(token, "debug")){ + cr->log_type |= MOSQ_LOG_DEBUG; + }else if(!strcmp(token, "subscribe")){ + cr->log_type |= MOSQ_LOG_SUBSCRIBE; + }else if(!strcmp(token, "unsubscribe")){ + cr->log_type |= MOSQ_LOG_UNSUBSCRIBE; + }else if(!strcmp(token, "internal")){ + cr->log_type |= MOSQ_LOG_INTERNAL; +#ifdef WITH_WEBSOCKETS + }else if(!strcmp(token, "websockets")){ + cr->log_type |= MOSQ_LOG_WEBSOCKETS; +#endif + }else if(!strcmp(token, "all")){ + cr->log_type = MOSQ_LOG_ALL; + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid log_type value (%s).", token); + return MOSQ_ERR_INVAL; + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty log_type value in configuration."); + } + }else if(!strcmp(token, "max_connections")){ + if(reload) continue; // Listeners not valid for reloading. + token = strtok_r(NULL, " ", &saveptr); + if(token){ + cur_listener->max_connections = atoi(token); + if(cur_listener->max_connections < 0) cur_listener->max_connections = -1; + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty max_connections value in configuration."); + } + }else if(!strcmp(token, "maximum_qos")){ + if(reload) continue; // Listeners not valid for reloading. + if(conf__parse_int(&token, "maximum_qos", &tmp_int, saveptr)) return MOSQ_ERR_INVAL; + if(tmp_int < 0 || tmp_int > 2){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: maximum_qos must be between 0 and 2 inclusive."); + return MOSQ_ERR_INVAL; + } + cur_listener->maximum_qos = tmp_int; + }else if(!strcmp(token, "max_inflight_bytes")){ + token = strtok_r(NULL, " ", &saveptr); + if(token){ + cr->max_inflight_bytes = atol(token); + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty max_inflight_bytes value in configuration."); + } + }else if(!strcmp(token, "max_inflight_messages")){ + if(conf__parse_int(&token, "max_inflight_messages", &tmp_int, saveptr)) return MOSQ_ERR_INVAL; + if(tmp_int < 0 || tmp_int == 65535){ + tmp_int = 0; + }else if(tmp_int > 65535){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: max_inflight_messages must be <= 65535."); + return MOSQ_ERR_INVAL; + } + config->max_inflight_messages = tmp_int; + }else if(!strcmp(token, "max_keepalive")){ + if(conf__parse_int(&token, "max_keepalive", &tmp_int, saveptr)) return MOSQ_ERR_INVAL; + if(tmp_int < 10 || tmp_int > 65535){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid max_keepalive value (%d).", tmp_int); + return MOSQ_ERR_INVAL; + } + config->max_keepalive = tmp_int; + }else if(!strcmp(token, "max_packet_size")){ + if(conf__parse_int(&token, "max_packet_size", &tmp_int, saveptr)) return MOSQ_ERR_INVAL; + if(tmp_int < 20){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid max_packet_size value (%d).", tmp_int); + return MOSQ_ERR_INVAL; + } + config->max_packet_size = tmp_int; + }else if(!strcmp(token, "max_queued_bytes")){ + token = strtok_r(NULL, " ", &saveptr); + if(token){ + cr->max_queued_bytes = atol(token); /* 63 bits is ok right? */ + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty max_queued_bytes value in configuration."); + } + }else if(!strcmp(token, "max_queued_messages")){ + token = strtok_r(NULL, " ", &saveptr); + if(token){ + cr->max_queued_messages = atoi(token); + if(cr->max_queued_messages < 0) cr->max_queued_messages = 0; + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty max_queued_messages value in configuration."); + } + }else if(!strcmp(token, "memory_limit")){ + ssize_t lim; + if(conf__parse_ssize_t(&token, "memory_limit", &lim, saveptr)) return MOSQ_ERR_INVAL; + if(lim < 0){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid memory_limit value (%ld).", lim); + return MOSQ_ERR_INVAL; + } + memory__set_limit(lim); + }else if(!strcmp(token, "message_size_limit")){ + if(conf__parse_int(&token, "message_size_limit", (int *)&config->message_size_limit, saveptr)) return MOSQ_ERR_INVAL; + if(config->message_size_limit > MQTT_MAX_PAYLOAD){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid message_size_limit value (%u).", config->message_size_limit); + return MOSQ_ERR_INVAL; + } + }else if(!strcmp(token, "mount_point")){ + if(reload) continue; // Listeners not valid for reloading. + if(config->listener_count == 0){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: You must use create a listener before using the mount_point option in the configuration file."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_string(&token, "mount_point", &cur_listener->mount_point, saveptr)) return MOSQ_ERR_INVAL; + if(mosquitto_pub_topic_check(cur_listener->mount_point) != MOSQ_ERR_SUCCESS){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Invalid mount_point '%s'. Does it contain a wildcard character?", + cur_listener->mount_point); + return MOSQ_ERR_INVAL; + } + }else if(!strcmp(token, "notifications")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_bool(&token, "notifications", &cur_bridge->notifications, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "notifications_local_only")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration"); + return MOSQ_ERR_INVAL; + } + if(conf__parse_bool(&token, "notifications_local_only", &cur_bridge->notifications_local_only, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "notification_topic")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_string(&token, "notification_topic", &cur_bridge->notification_topic, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "password") || !strcmp(token, "remote_password")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_string(&token, "bridge remote_password", &cur_bridge->remote_password, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "password_file")){ + conf__set_cur_security_options(config, cur_listener, &cur_security_options); + if(reload){ + mosquitto__free(cur_security_options->password_file); + cur_security_options->password_file = NULL; + } + if(conf__parse_string(&token, "password_file", &cur_security_options->password_file, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "per_listener_settings")){ + if(conf__parse_bool(&token, "per_listener_settings", &config->per_listener_settings, saveptr)) return MOSQ_ERR_INVAL; + if(cur_security_options && config->per_listener_settings){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: per_listener_settings must be set before any other security settings."); + return MOSQ_ERR_INVAL; + } + }else if(!strcmp(token, "persistence") || !strcmp(token, "retained_persistence")){ + if(conf__parse_bool(&token, token, &config->persistence, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "persistence_file")){ + if(conf__parse_string(&token, "persistence_file", &config->persistence_file, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "persistence_location")){ + if(conf__parse_string(&token, "persistence_location", &config->persistence_location, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "persistent_client_expiration")){ + token = strtok_r(NULL, " ", &saveptr); + if(token){ + switch(token[strlen(token)-1]){ + case 'h': + expiration_mult = 3600; + break; + case 'd': + expiration_mult = 86400; + break; + case 'w': + expiration_mult = 86400*7; + break; + case 'm': + expiration_mult = 86400*30; + break; + case 'y': + expiration_mult = 86400*365; + break; + default: + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid persistent_client_expiration duration in configuration."); + return MOSQ_ERR_INVAL; + } + token[strlen(token)-1] = '\0'; + config->persistent_client_expiration = atoi(token)*expiration_mult; + if(config->persistent_client_expiration <= 0){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid persistent_client_expiration duration in configuration."); + return MOSQ_ERR_INVAL; + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty persistent_client_expiration value in configuration."); + } + }else if(!strcmp(token, "pid_file")){ + if(reload) continue; // pid file not valid for reloading. + if(conf__parse_string(&token, "pid_file", &config->pid_file, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "port")){ + if(reload) continue; // Listener not valid for reloading. + if(config->default_listener.port){ + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Default listener port specified multiple times. Only the latest will be used."); + } + if(conf__parse_int(&token, "port", &tmp_int, saveptr)) return MOSQ_ERR_INVAL; + if(tmp_int < 1 || tmp_int > 65535){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid port value (%d).", tmp_int); + return MOSQ_ERR_INVAL; + } + config->default_listener.port = tmp_int; + }else if(!strcmp(token, "protocol")){ + token = strtok_r(NULL, " ", &saveptr); + if(token){ + if(!strcmp(token, "mqtt")){ + cur_listener->protocol = mp_mqtt; + /* + }else if(!strcmp(token, "mqttsn")){ + cur_listener->protocol = mp_mqttsn; + */ + }else if(!strcmp(token, "websockets")){ +#ifdef WITH_WEBSOCKETS + cur_listener->protocol = mp_websockets; + config->have_websockets_listener = true; +#else + log__printf(NULL, MOSQ_LOG_ERR, "Error: Websockets support not available."); + return MOSQ_ERR_INVAL; +#endif + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid protocol value (%s).", token); + return MOSQ_ERR_INVAL; + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty protocol value in configuration."); + } + }else if(!strcmp(token, "psk_file")){ +#ifdef FINAL_WITH_TLS_PSK + conf__set_cur_security_options(config, cur_listener, &cur_security_options); + if(reload){ + mosquitto__free(cur_security_options->psk_file); + cur_security_options->psk_file = NULL; + } + if(conf__parse_string(&token, "psk_file", &cur_security_options->psk_file, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS/TLS-PSK support not available."); +#endif + }else if(!strcmp(token, "psk_hint")){ +#ifdef FINAL_WITH_TLS_PSK + if(reload) continue; // Listeners not valid for reloading. + if(conf__parse_string(&token, "psk_hint", &cur_listener->psk_hint, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS/TLS-PSK support not available."); +#endif + }else if(!strcmp(token, "queue_qos0_messages")){ + if(conf__parse_bool(&token, token, &config->queue_qos0_messages, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "require_certificate")){ +#ifdef WITH_TLS + if(reload) continue; // Listeners not valid for reloading. + if(conf__parse_bool(&token, "require_certificate", &cur_listener->require_certificate, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "restart_timeout")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + token = strtok_r(NULL, " ", &saveptr); + if(!token){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty restart_timeout value in configuration."); + return MOSQ_ERR_INVAL; + } + cur_bridge->restart_timeout = atoi(token); + if(cur_bridge->restart_timeout < 1){ + log__printf(NULL, MOSQ_LOG_NOTICE, "restart_timeout interval too low, using 1 second."); + cur_bridge->restart_timeout = 1; + } + token = strtok_r(NULL, " ", &saveptr); + if(token){ + cur_bridge->backoff_base = cur_bridge->restart_timeout; + cur_bridge->backoff_cap = atoi(token); + if(cur_bridge->backoff_cap < cur_bridge->backoff_base){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: backoff cap is lower than the base in restart_timeout."); + return MOSQ_ERR_INVAL; + } + } +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "retain_available")){ + if(conf__parse_bool(&token, token, &config->retain_available, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "retry_interval")){ + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: The retry_interval option is no longer available."); + }else if(!strcmp(token, "round_robin")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_bool(&token, "round_robin", &cur_bridge->round_robin, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "set_tcp_nodelay")){ + if(conf__parse_bool(&token, "set_tcp_nodelay", &config->set_tcp_nodelay, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "start_type")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + token = strtok_r(NULL, " ", &saveptr); + if(token){ + if(!strcmp(token, "automatic")){ + cur_bridge->start_type = bst_automatic; + }else if(!strcmp(token, "lazy")){ + cur_bridge->start_type = bst_lazy; + }else if(!strcmp(token, "manual")){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Manual start_type not supported."); + return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "once")){ + cur_bridge->start_type = bst_once; + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid start_type value in configuration (%s).", token); + return MOSQ_ERR_INVAL; + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty start_type value in configuration."); + return MOSQ_ERR_INVAL; + } +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "socket_domain")){ + if(reload) continue; // Listeners not valid for reloading. + token = strtok_r(NULL, " ", &saveptr); + if(token){ + if(!strcmp(token, "ipv4")){ + cur_listener->socket_domain = AF_INET; + }else if(!strcmp(token, "ipv6")){ + cur_listener->socket_domain = AF_INET6; + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid socket_domain value \"%s\" in configuration.", token); + return MOSQ_ERR_INVAL; + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty socket_domain value in configuration."); + return MOSQ_ERR_INVAL; + } + }else if(!strcmp(token, "store_clean_interval")){ + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: store_clean_interval is no longer needed."); + }else if(!strcmp(token, "sys_interval")){ + if(conf__parse_int(&token, "sys_interval", &config->sys_interval, saveptr)) return MOSQ_ERR_INVAL; + if(config->sys_interval < 0 || config->sys_interval > 65535){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid sys_interval value (%d).", config->sys_interval); + return MOSQ_ERR_INVAL; + } + }else if(!strcmp(token, "threshold")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_int(&token, "threshold", &cur_bridge->threshold, saveptr)) return MOSQ_ERR_INVAL; + if(cur_bridge->threshold < 1){ + log__printf(NULL, MOSQ_LOG_NOTICE, "threshold too low, using 1 message."); + cur_bridge->threshold = 1; + } +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "tls_engine")){ +#ifdef WITH_TLS + if(reload) continue; // Listeners not valid for reloading. + if(conf__parse_string(&token, "tls_engine", &cur_listener->tls_engine, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "tls_engine_kpass_sha1")){ +#ifdef WITH_TLS + if(reload) continue; // Listeners not valid for reloading. + char *kpass_sha = NULL, *kpass_sha_bin = NULL; + if(conf__parse_string(&token, "tls_engine_kpass_sha1", &kpass_sha, saveptr)) return MOSQ_ERR_INVAL; + if(mosquitto__hex2bin_sha1(kpass_sha, (unsigned char**)&kpass_sha_bin) != MOSQ_ERR_SUCCESS){ + mosquitto__free(kpass_sha); + return MOSQ_ERR_INVAL; + } + cur_listener->tls_engine_kpass_sha1 = kpass_sha_bin; + mosquitto__free(kpass_sha); +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "tls_keyform")){ +#ifdef WITH_TLS + if(reload) continue; // Listeners not valid for reloading. + char *keyform = NULL; + if(conf__parse_string(&token, "tls_keyform", &keyform, saveptr)) return MOSQ_ERR_INVAL; + cur_listener->tls_keyform = mosq_k_pem; + if(!strcmp(keyform, "engine")) cur_listener->tls_keyform = mosq_k_engine; + mosquitto__free(keyform); +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "tls_version")){ +#if defined(WITH_TLS) + if(reload) continue; // Listeners not valid for reloading. + if(conf__parse_string(&token, "tls_version", &cur_listener->tls_version, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "topic")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + token = strtok_r(NULL, " ", &saveptr); + if(token){ + cur_bridge->topic_count++; + cur_bridge->topics = mosquitto__realloc(cur_bridge->topics, + sizeof(struct mosquitto__bridge_topic)*cur_bridge->topic_count); + if(!cur_bridge->topics){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + cur_topic = &cur_bridge->topics[cur_bridge->topic_count-1]; + if(!strcmp(token, "\"\"")){ + cur_topic->topic = NULL; + }else{ + cur_topic->topic = mosquitto__strdup(token); + if(!cur_topic->topic){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + } + cur_topic->direction = bd_out; + cur_topic->qos = 0; + cur_topic->local_prefix = NULL; + cur_topic->remote_prefix = NULL; + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty topic value in configuration."); + return MOSQ_ERR_INVAL; + } + token = strtok_r(NULL, " ", &saveptr); + if(token){ + if(!strcasecmp(token, "out")){ + cur_topic->direction = bd_out; + }else if(!strcasecmp(token, "in")){ + cur_topic->direction = bd_in; + }else if(!strcasecmp(token, "both")){ + cur_topic->direction = bd_both; + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge topic direction '%s'.", token); + return MOSQ_ERR_INVAL; + } + token = strtok_r(NULL, " ", &saveptr); + if(token){ + if (token[0] == '#'){ + strtok_r(NULL, "", &saveptr); + } + cur_topic->qos = atoi(token); + if(cur_topic->qos < 0 || cur_topic->qos > 2){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge QoS level '%s'.", token); + return MOSQ_ERR_INVAL; + } + + token = strtok_r(NULL, " ", &saveptr); + if(token){ + cur_bridge->topic_remapping = true; + if(!strcmp(token, "\"\"") || token[0] == '#'){ + cur_topic->local_prefix = NULL; + if (token[0] == '#'){ + strtok_r(NULL, "", &saveptr); + } + }else{ + if(mosquitto_pub_topic_check(token) != MOSQ_ERR_SUCCESS){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge topic local prefix '%s'.", token); + return MOSQ_ERR_INVAL; + } + cur_topic->local_prefix = mosquitto__strdup(token); + if(!cur_topic->local_prefix){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + } + + token = strtok_r(NULL, " ", &saveptr); + if(token){ + if(!strcmp(token, "\"\"") || token[0] == '#'){ + cur_topic->remote_prefix = NULL; + }else{ + if(mosquitto_pub_topic_check(token) != MOSQ_ERR_SUCCESS){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge topic remote prefix '%s'.", token); + return MOSQ_ERR_INVAL; + } + cur_topic->remote_prefix = mosquitto__strdup(token); + if(!cur_topic->remote_prefix){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + } + } + } + } + } + if(cur_topic->topic == NULL && + (cur_topic->local_prefix == NULL || cur_topic->remote_prefix == NULL)){ + + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge remapping."); + return MOSQ_ERR_INVAL; + } + if(cur_topic->local_prefix){ + if(cur_topic->topic){ + len = strlen(cur_topic->topic) + strlen(cur_topic->local_prefix)+1; + cur_topic->local_topic = mosquitto__malloc(len+1); + if(!cur_topic->local_topic){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + snprintf(cur_topic->local_topic, len+1, "%s%s", cur_topic->local_prefix, cur_topic->topic); + cur_topic->local_topic[len] = '\0'; + }else{ + cur_topic->local_topic = mosquitto__strdup(cur_topic->local_prefix); + if(!cur_topic->local_topic){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + } + }else{ + cur_topic->local_topic = mosquitto__strdup(cur_topic->topic); + if(!cur_topic->local_topic){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + } + + if(cur_topic->remote_prefix){ + if(cur_topic->topic){ + len = strlen(cur_topic->topic) + strlen(cur_topic->remote_prefix)+1; + cur_topic->remote_topic = mosquitto__malloc(len+1); + if(!cur_topic->remote_topic){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + snprintf(cur_topic->remote_topic, len, "%s%s", cur_topic->remote_prefix, cur_topic->topic); + cur_topic->remote_topic[len] = '\0'; + }else{ + cur_topic->remote_topic = mosquitto__strdup(cur_topic->remote_prefix); + if(!cur_topic->remote_topic){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + } + }else{ + cur_topic->remote_topic = mosquitto__strdup(cur_topic->topic); + if(!cur_topic->remote_topic){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + } +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "max_topic_alias")){ + if(reload) continue; // Listeners not valid for reloading. + token = strtok_r(NULL, " ", &saveptr); + if(token){ + cur_listener->max_topic_alias = atoi(token); + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty max_topic_alias value in configuration."); + } + }else if(!strcmp(token, "try_private")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_bool(&token, "try_private", &cur_bridge->try_private, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "upgrade_outgoing_qos")){ + if(conf__parse_bool(&token, token, &config->upgrade_outgoing_qos, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "use_identity_as_username")){ +#ifdef WITH_TLS + if(reload) continue; // Listeners not valid for reloading. + if(conf__parse_bool(&token, "use_identity_as_username", &cur_listener->use_identity_as_username, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "use_subject_as_username")){ +#ifdef WITH_TLS + if(reload) continue; // Listeners not valid for reloading. + if(conf__parse_bool(&token, "use_subject_as_username", &cur_listener->use_subject_as_username, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "user")){ + if(reload) continue; // Drop privileges user not valid for reloading. + if(conf__parse_string(&token, "user", &config->user, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "use_username_as_clientid")){ + if(reload) continue; // Listeners not valid for reloading. + if(conf__parse_bool(&token, "use_username_as_clientid", &cur_listener->use_username_as_clientid, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "username") || !strcmp(token, "remote_username")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(conf__parse_string(&token, "bridge remote_username", &cur_bridge->remote_username, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "websockets_log_level")){ +#ifdef WITH_WEBSOCKETS + if(conf__parse_int(&token, "websockets_log_level", &config->websockets_log_level, saveptr)) return MOSQ_ERR_INVAL; +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Websockets support not available."); +#endif + }else if(!strcmp(token, "websockets_headers_size")){ +#ifdef WITH_WEBSOCKETS +# if defined(LWS_LIBRARY_VERSION_NUMBER) && LWS_LIBRARY_VERSION_NUMBER>=1007000 + if(conf__parse_int(&token, "websockets_headers_size", &config->websockets_headers_size, saveptr)) return MOSQ_ERR_INVAL; +# else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Websockets headers size require libwebsocket 1.7+"); +# endif +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Websockets support not available."); +#endif + }else if(!strcmp(token, "trace_level") + || !strcmp(token, "ffdc_output") + || !strcmp(token, "max_log_entries") + || !strcmp(token, "trace_output")){ + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Unsupported rsmb configuration option \"%s\".", token); + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unknown configuration variable \"%s\".", token); + return MOSQ_ERR_INVAL; + } + } + } + } + return MOSQ_ERR_SUCCESS; +} + +int config__read_file(struct mosquitto__config *config, bool reload, const char *file, struct config_recurse *cr, int level, int *lineno) +{ + int rc; + FILE *fptr = NULL; + char *buf; + int buflen; + + fptr = mosquitto__fopen(file, "rt", false); + if(!fptr){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to open config file %s.", file); + return 1; + } + + buflen = 1000; + buf = mosquitto__malloc(buflen); + if(!buf){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + fclose(fptr); + return MOSQ_ERR_NOMEM; + } + + rc = config__read_file_core(config, reload, cr, level, lineno, fptr, &buf, &buflen); + mosquitto__free(buf); + fclose(fptr); + + return rc; +} + + +static int config__check(struct mosquitto__config *config) +{ + /* Checks that are easy to make after the config has been loaded. */ + + int i; + +#ifdef WITH_BRIDGE + int j; + struct mosquitto__bridge *bridge1, *bridge2; + char hostname[256]; + int len; + + /* Check for bridge duplicate local_clientid, need to generate missing IDs + * first. */ + for(i=0; i<config->bridge_count; i++){ + bridge1 = &config->bridges[i]; + + if(!bridge1->remote_clientid){ + if(!gethostname(hostname, 256)){ + len = strlen(hostname) + strlen(bridge1->name) + 2; + bridge1->remote_clientid = mosquitto__malloc(len); + if(!bridge1->remote_clientid){ + return MOSQ_ERR_NOMEM; + } + snprintf(bridge1->remote_clientid, len, "%s.%s", hostname, bridge1->name); + }else{ + return 1; + } + } + + if(!bridge1->local_clientid){ + len = strlen(bridge1->remote_clientid) + strlen("local.") + 2; + bridge1->local_clientid = mosquitto__malloc(len); + if(!bridge1->local_clientid){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + snprintf(bridge1->local_clientid, len, "local.%s", bridge1->remote_clientid); + } + } + + for(i=0; i<config->bridge_count; i++){ + bridge1 = &config->bridges[i]; + for(j=i+1; j<config->bridge_count; j++){ + bridge2 = &config->bridges[j]; + if(!strcmp(bridge1->local_clientid, bridge2->local_clientid)){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Bridge local_clientid " + "'%s' is not unique. Try changing or setting the " + "local_clientid value for one of the bridges.", + bridge1->local_clientid); + return MOSQ_ERR_INVAL; + } + } + } +#endif + + /* Default to auto_id_prefix = 'auto-' if none set. */ + if(config->per_listener_settings){ + for(i=0; i<config->listener_count; i++){ + if(!config->listeners[i].security_options.auto_id_prefix){ + config->listeners[i].security_options.auto_id_prefix = mosquitto__strdup("auto-"); + if(!config->listeners[i].security_options.auto_id_prefix){ + return MOSQ_ERR_NOMEM; + } + config->listeners[i].security_options.auto_id_prefix_len = strlen("auto-"); + } + } + }else{ + if(!config->security_options.auto_id_prefix){ + config->security_options.auto_id_prefix = mosquitto__strdup("auto-"); + if(!config->security_options.auto_id_prefix){ + return MOSQ_ERR_NOMEM; + } + config->security_options.auto_id_prefix_len = strlen("auto-"); + } + } + + return MOSQ_ERR_SUCCESS; +} + + +static int conf__parse_bool(char **token, const char *name, bool *value, char *saveptr) +{ + *token = strtok_r(NULL, " ", &saveptr); + if(*token){ + if(!strcmp(*token, "false") || !strcmp(*token, "0")){ + *value = false; + }else if(!strcmp(*token, "true") || !strcmp(*token, "1")){ + *value = true; + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid %s value (%s).", name, *token); + return MOSQ_ERR_INVAL; + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty %s value in configuration.", name); + return MOSQ_ERR_INVAL; + } + + return MOSQ_ERR_SUCCESS; +} + +static int conf__parse_int(char **token, const char *name, int *value, char *saveptr) +{ + *token = strtok_r(NULL, " ", &saveptr); + if(*token){ + *value = atoi(*token); + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty %s value in configuration.", name); + return MOSQ_ERR_INVAL; + } + + return MOSQ_ERR_SUCCESS; +} + +static int conf__parse_ssize_t(char **token, const char *name, ssize_t *value, char *saveptr) +{ + *token = strtok_r(NULL, " ", &saveptr); + if(*token){ + *value = atol(*token); + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty %s value in configuration.", name); + return MOSQ_ERR_INVAL; + } + + return MOSQ_ERR_SUCCESS; +} + +static int conf__parse_string(char **token, const char *name, char **value, char *saveptr) +{ + *token = strtok_r(NULL, "", &saveptr); + if(*token){ + if(*value){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Duplicate %s value in configuration.", name); + return MOSQ_ERR_INVAL; + } + /* Deal with multiple spaces at the beginning of the string. */ + while((*token)[0] == ' ' || (*token)[0] == '\t'){ + (*token)++; + } + if(mosquitto_validate_utf8(*token, strlen(*token))){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Malformed UTF-8 in configuration."); + return MOSQ_ERR_INVAL; + } + *value = mosquitto__strdup(*token); + if(!*value){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty %s value in configuration.", name); + return MOSQ_ERR_INVAL; + } + return MOSQ_ERR_SUCCESS; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/conf_includedir.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/conf_includedir.c new file mode 100644 index 0000000..bbbd65b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/conf_includedir.c @@ -0,0 +1,199 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <ctype.h> +#include <limits.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <errno.h> + +#ifdef WIN32 +#else +# include <dirent.h> +#endif + +#ifndef WIN32 +# include <strings.h> +# include <netdb.h> +# include <sys/socket.h> +#else +# include <winsock2.h> +# include <ws2tcpip.h> +#endif + +#if !defined(WIN32) && !defined(__CYGWIN__) && !defined(__QNX__) +# include <sys/syslog.h> +#endif + +#include "mosquitto_broker_internal.h" +#include "memory_mosq.h" +#include "tls_mosq.h" +#include "util_mosq.h" +#include "mqtt_protocol.h" + + +int scmp_p(const void *p1, const void *p2) +{ + const char *s1 = *(const char **)p1; + const char *s2 = *(const char **)p2; + int result; + + while(s1[0] && s2[0]){ + /* Sort by case insensitive part first */ + result = toupper(s1[0]) - toupper(s2[0]); + if(result == 0){ + /* Case insensitive part matched, now distinguish between case */ + result = s1[0] - s2[0]; + if(result != 0){ + return result; + } + }else{ + /* Return case insensitive match fail */ + return result; + } + s1++; + s2++; + } + + return s1[0] - s2[0]; +} + +#ifdef WIN32 +int config__get_dir_files(const char *include_dir, char ***files, int *file_count) +{ + int len; + int i; + char **l_files = NULL; + int l_file_count = 0; + char **files_tmp; + + HANDLE fh; + char dirpath[MAX_PATH]; + WIN32_FIND_DATA find_data; + + snprintf(dirpath, MAX_PATH, "%s\\*.conf", include_dir); + fh = FindFirstFile(dirpath, &find_data); + if(fh == INVALID_HANDLE_VALUE){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to open include_dir '%s'.", include_dir); + return 1; + } + + do{ + len = strlen(include_dir)+1+strlen(find_data.cFileName)+1; + + l_file_count++; + files_tmp = mosquitto__realloc(l_files, l_file_count*sizeof(char *)); + if(!files_tmp){ + for(i=0; i<l_file_count-1; i++){ + mosquitto__free(l_files[i]); + } + mosquitto__free(l_files); + FindClose(fh); + return MOSQ_ERR_NOMEM; + } + l_files = files_tmp; + + l_files[l_file_count-1] = mosquitto__malloc(len+1); + if(!l_files[l_file_count-1]){ + for(i=0; i<l_file_count-1; i++){ + mosquitto__free(l_files[i]); + } + mosquitto__free(l_files); + FindClose(fh); + return MOSQ_ERR_NOMEM; + } + snprintf(l_files[l_file_count-1], len, "%s/%s", include_dir, find_data.cFileName); + l_files[l_file_count-1][len] = '\0'; + }while(FindNextFile(fh, &find_data)); + + FindClose(fh); + + if(l_files){ + qsort(l_files, l_file_count, sizeof(char *), scmp_p); + } + *files = l_files; + *file_count = l_file_count; + + return 0; +} +#endif + + +#ifndef WIN32 + +int config__get_dir_files(const char *include_dir, char ***files, int *file_count) +{ + char **l_files = NULL; + int l_file_count = 0; + char **files_tmp; + int len; + int i; + + DIR *dh; + struct dirent *de; + + dh = opendir(include_dir); + if(!dh){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to open include_dir '%s'.", include_dir); + return 1; + } + while((de = readdir(dh)) != NULL){ + if(strlen(de->d_name) > 5){ + if(!strcmp(&de->d_name[strlen(de->d_name)-5], ".conf")){ + len = strlen(include_dir)+1+strlen(de->d_name)+1; + + l_file_count++; + files_tmp = mosquitto__realloc(l_files, l_file_count*sizeof(char *)); + if(!files_tmp){ + for(i=0; i<l_file_count-1; i++){ + mosquitto__free(l_files[i]); + } + mosquitto__free(l_files); + closedir(dh); + return MOSQ_ERR_NOMEM; + } + l_files = files_tmp; + + l_files[l_file_count-1] = mosquitto__malloc(len+1); + if(!l_files[l_file_count-1]){ + for(i=0; i<l_file_count-1; i++){ + mosquitto__free(l_files[i]); + } + mosquitto__free(l_files); + closedir(dh); + return MOSQ_ERR_NOMEM; + } + snprintf(l_files[l_file_count-1], len, "%s/%s", include_dir, de->d_name); + l_files[l_file_count-1][len] = '\0'; + } + } + } + closedir(dh); + + if(l_files){ + qsort(l_files, l_file_count, sizeof(char *), scmp_p); + } + *files = l_files; + *file_count = l_file_count; + + return 0; +} +#endif + + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/context.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/context.c new file mode 100644 index 0000000..f024d17 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/context.c @@ -0,0 +1,317 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <time.h> + +#include "mosquitto_broker_internal.h" +#include "alias_mosq.h" +#include "memory_mosq.h" +#include "packet_mosq.h" +#include "property_mosq.h" +#include "time_mosq.h" +#include "will_mosq.h" + +#include "uthash.h" + +struct mosquitto *context__init(struct mosquitto_db *db, mosq_sock_t sock) +{ + struct mosquitto *context; + char address[1024]; + + context = mosquitto__calloc(1, sizeof(struct mosquitto)); + if(!context) return NULL; + + context->pollfd_index = -1; + context__set_state(context, mosq_cs_new); + context->sock = sock; + context->last_msg_in = mosquitto_time(); + context->next_msg_out = mosquitto_time() + 60; + context->keepalive = 60; /* Default to 60s */ + context->clean_start = true; + context->id = NULL; + context->last_mid = 0; + context->will = NULL; + context->username = NULL; + context->password = NULL; + context->listener = NULL; + context->acl_list = NULL; + + /* is_bridge records whether this client is a bridge or not. This could be + * done by looking at context->bridge for bridges that we create ourself, + * but incoming bridges need some other way of being recorded. */ + context->is_bridge = false; + + context->in_packet.payload = NULL; + packet__cleanup(&context->in_packet); + context->out_packet = NULL; + context->current_out_packet = NULL; + + context->address = NULL; + if((int)sock >= 0){ + if(!net__socket_get_address(sock, address, 1024)){ + context->address = mosquitto__strdup(address); + } + if(!context->address){ + /* getpeername and inet_ntop failed and not a bridge */ + mosquitto__free(context); + return NULL; + } + } + context->bridge = NULL; + context->msgs_in.inflight_maximum = db->config->max_inflight_messages; + context->msgs_out.inflight_maximum = db->config->max_inflight_messages; + context->msgs_in.inflight_quota = db->config->max_inflight_messages; + context->msgs_out.inflight_quota = db->config->max_inflight_messages; + context->maximum_qos = 2; +#ifdef WITH_TLS + context->ssl = NULL; +#endif + + if((int)context->sock >= 0){ + HASH_ADD(hh_sock, db->contexts_by_sock, sock, sizeof(context->sock), context); + } + return context; +} + +/* + * This will result in any outgoing packets going unsent. If we're disconnected + * forcefully then it is usually an error condition and shouldn't be a problem, + * but it will mean that CONNACK messages will never get sent for bad protocol + * versions for example. + */ +void context__cleanup(struct mosquitto_db *db, struct mosquitto *context, bool do_free) +{ + struct mosquitto__packet *packet; +#ifdef WITH_BRIDGE + int i; +#endif + + if(!context) return; + +#ifdef WITH_BRIDGE + if(context->bridge){ + for(i=0; i<db->bridge_count; i++){ + if(db->bridges[i] == context){ + db->bridges[i] = NULL; + } + } + mosquitto__free(context->bridge->local_clientid); + context->bridge->local_clientid = NULL; + + mosquitto__free(context->bridge->local_username); + context->bridge->local_username = NULL; + + mosquitto__free(context->bridge->local_password); + context->bridge->local_password = NULL; + + if(context->bridge->remote_clientid != context->id){ + mosquitto__free(context->bridge->remote_clientid); + } + context->bridge->remote_clientid = NULL; + + if(context->bridge->remote_username != context->username){ + mosquitto__free(context->bridge->remote_username); + } + context->bridge->remote_username = NULL; + + if(context->bridge->remote_password != context->password){ + mosquitto__free(context->bridge->remote_password); + } + context->bridge->remote_password = NULL; + } +#endif + + alias__free_all(context); + + mosquitto__free(context->auth_method); + context->auth_method = NULL; + + mosquitto__free(context->username); + context->username = NULL; + + mosquitto__free(context->password); + context->password = NULL; + + net__socket_close(db, context); + if(do_free || context->clean_start){ + sub__clean_session(db, context); + db__messages_delete(db, context); + } + + mosquitto__free(context->address); + context->address = NULL; + + context__send_will(db, context); + + if(context->id){ + context__remove_from_by_id(db, context); + mosquitto__free(context->id); + context->id = NULL; + } + packet__cleanup(&(context->in_packet)); + if(context->current_out_packet){ + packet__cleanup(context->current_out_packet); + mosquitto__free(context->current_out_packet); + context->current_out_packet = NULL; + } + while(context->out_packet){ + packet__cleanup(context->out_packet); + packet = context->out_packet; + context->out_packet = context->out_packet->next; + mosquitto__free(packet); + } + if(do_free || context->clean_start){ + db__messages_delete(db, context); + } +#if defined(WITH_BROKER) && defined(__GLIBC__) && defined(WITH_ADNS) + if(context->adns){ + gai_cancel(context->adns); + mosquitto__free((struct addrinfo *)context->adns->ar_request); + mosquitto__free(context->adns); + } +#endif + if(do_free){ + mosquitto__free(context); + } +} + + +void context__send_will(struct mosquitto_db *db, struct mosquitto *ctxt) +{ + if(ctxt->state != mosq_cs_disconnecting && ctxt->will){ + if(ctxt->will_delay_interval > 0){ + will_delay__add(ctxt); + return; + } + + if(mosquitto_acl_check(db, ctxt, + ctxt->will->msg.topic, + ctxt->will->msg.payloadlen, + ctxt->will->msg.payload, + ctxt->will->msg.qos, + ctxt->will->msg.retain, + MOSQ_ACL_WRITE) == MOSQ_ERR_SUCCESS){ + + /* Unexpected disconnect, queue the client will. */ + db__messages_easy_queue(db, ctxt, + ctxt->will->msg.topic, + ctxt->will->msg.qos, + ctxt->will->msg.payloadlen, + ctxt->will->msg.payload, + ctxt->will->msg.retain, + ctxt->will->expiry_interval, + &ctxt->will->properties); + } + } + will__clear(ctxt); +} + + +void context__disconnect(struct mosquitto_db *db, struct mosquitto *context) +{ + net__socket_close(db, context); + + context__send_will(db, context); + if(context->session_expiry_interval == 0){ + +#ifdef WITH_BRIDGE + if(!context->bridge) +#endif + { + + if(context->will_delay_interval == 0){ + /* This will be done later, after the will is published for delay>0. */ + context__add_to_disused(db, context); + } + } + }else{ + session_expiry__add(db, context); + } + context__set_state(context, mosq_cs_disconnected); +} + +void context__add_to_disused(struct mosquitto_db *db, struct mosquitto *context) +{ + if(context->state == mosq_cs_disused) return; + + context__set_state(context, mosq_cs_disused); + + if(context->id){ + context__remove_from_by_id(db, context); + mosquitto__free(context->id); + context->id = NULL; + } + + if(db->ll_for_free){ + context->for_free_next = db->ll_for_free; + db->ll_for_free = context; + }else{ + db->ll_for_free = context; + } +} + +void context__free_disused(struct mosquitto_db *db) +{ + struct mosquitto *context, *next; +#ifdef WITH_WEBSOCKETS + struct mosquitto *last = NULL; +#endif + assert(db); + + context = db->ll_for_free; + while(context){ +#ifdef WITH_WEBSOCKETS + if(context->wsi){ + /* Don't delete yet, lws hasn't finished with it */ + if(last){ + last->for_free_next = context; + }else{ + db->ll_for_free = context; + } + next = context->for_free_next; + context->for_free_next = NULL; + last = context; + context = next; + }else +#endif + { + next = context->for_free_next; + context__cleanup(db, context, true); + context = next; + } + } + db->ll_for_free = NULL; +} + + +void context__remove_from_by_id(struct mosquitto_db *db, struct mosquitto *context) +{ + if(context->removed_from_by_id == false && context->id){ + HASH_DELETE(hh_id, db->contexts_by_id, context); + context->removed_from_by_id = true; + } +} + + +void context__set_state(struct mosquitto *context, enum mosquitto_client_state state) +{ + if(context->state != mosq_cs_disused){ + context->state = state; + } +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/database.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/database.c new file mode 100644 index 0000000..87daf68 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/database.c @@ -0,0 +1,1157 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <stdio.h> +#include <utlist.h> + +#include "mosquitto_broker_internal.h" +#include "memory_mosq.h" +#include "send_mosq.h" +#include "sys_tree.h" +#include "time_mosq.h" +#include "util_mosq.h" + +static unsigned long max_inflight_bytes = 0; +static int max_queued = 100; +static unsigned long max_queued_bytes = 0; + +/** + * Is this context ready to take more in flight messages right now? + * @param context the client context of interest + * @param qos qos for the packet of interest + * @return true if more in flight are allowed. + */ +static bool db__ready_for_flight(struct mosquitto_msg_data *msgs, int qos) +{ + bool valid_bytes; + bool valid_count; + + if(qos == 0 || (msgs->inflight_maximum == 0 && max_inflight_bytes == 0)){ + return true; + } + + valid_bytes = msgs->msg_bytes12 < max_inflight_bytes; + valid_count = msgs->inflight_quota > 0; + + if(msgs->inflight_maximum == 0){ + return valid_bytes; + } + if(max_inflight_bytes == 0){ + return valid_count; + } + + return valid_bytes && valid_count; +} + + +/** + * For a given client context, are more messages allowed to be queued? + * It is assumed that inflight checks and queue_qos0 checks have already + * been made. + * @param context client of interest + * @param qos destination qos for the packet of interest + * @return true if queuing is allowed, false if should be dropped + */ +static bool db__ready_for_queue(struct mosquitto *context, int qos, struct mosquitto_msg_data *msg_data) +{ + int source_count; + int adjust_count; + unsigned long source_bytes; + unsigned long adjust_bytes = max_inflight_bytes; + + if(max_queued == 0 && max_queued_bytes == 0){ + return true; + } + + if(qos == 0){ + source_bytes = msg_data->msg_bytes; + source_count = msg_data->msg_count; + }else{ + source_bytes = msg_data->msg_bytes12; + source_count = msg_data->msg_count12; + } + adjust_count = msg_data->inflight_maximum; + + /* nothing in flight for offline clients */ + if(context->sock == INVALID_SOCKET){ + adjust_bytes = 0; + adjust_count = 0; + } + + bool valid_bytes = source_bytes - adjust_bytes < max_queued_bytes; + bool valid_count = source_count - adjust_count < max_queued; + + if(max_queued_bytes == 0){ + return valid_count; + } + if(max_queued == 0){ + return valid_bytes; + } + + return valid_bytes && valid_count; +} + + +int db__open(struct mosquitto__config *config, struct mosquitto_db *db) +{ + struct mosquitto__subhier *subhier; + + if(!config || !db) return MOSQ_ERR_INVAL; + + db->last_db_id = 0; + + db->contexts_by_id = NULL; + db->contexts_by_sock = NULL; + db->contexts_for_free = NULL; +#ifdef WITH_BRIDGE + db->bridges = NULL; + db->bridge_count = 0; +#endif + + // Initialize the hashtable + db->clientid_index_hash = NULL; + + db->subs = NULL; + + subhier = sub__add_hier_entry(NULL, &db->subs, "", strlen("")); + if(!subhier) return MOSQ_ERR_NOMEM; + + subhier = sub__add_hier_entry(NULL, &db->subs, "$SYS", strlen("$SYS")); + if(!subhier) return MOSQ_ERR_NOMEM; + + db->unpwd = NULL; + +#ifdef WITH_PERSISTENCE + if(persist__restore(db)) return 1; +#endif + + return MOSQ_ERR_SUCCESS; +} + +static void subhier_clean(struct mosquitto_db *db, struct mosquitto__subhier **subhier) +{ + struct mosquitto__subhier *peer, *subhier_tmp; + struct mosquitto__subleaf *leaf, *nextleaf; + + HASH_ITER(hh, *subhier, peer, subhier_tmp){ + leaf = peer->subs; + while(leaf){ + nextleaf = leaf->next; + mosquitto__free(leaf); + leaf = nextleaf; + } + if(peer->retained){ + db__msg_store_ref_dec(db, &peer->retained); + } + subhier_clean(db, &peer->children); + mosquitto__free(peer->topic); + + HASH_DELETE(hh, *subhier, peer); + mosquitto__free(peer); + } +} + +int db__close(struct mosquitto_db *db) +{ + subhier_clean(db, &db->subs); + db__msg_store_clean(db); + + return MOSQ_ERR_SUCCESS; +} + + +void db__msg_store_add(struct mosquitto_db *db, struct mosquitto_msg_store *store) +{ + store->next = db->msg_store; + store->prev = NULL; + if(db->msg_store){ + db->msg_store->prev = store; + } + db->msg_store = store; +} + + +void db__msg_store_remove(struct mosquitto_db *db, struct mosquitto_msg_store *store) +{ + int i; + + if(store->prev){ + store->prev->next = store->next; + if(store->next){ + store->next->prev = store->prev; + } + }else{ + db->msg_store = store->next; + if(store->next){ + store->next->prev = NULL; + } + } + db->msg_store_count--; + db->msg_store_bytes -= store->payloadlen; + + mosquitto__free(store->source_id); + mosquitto__free(store->source_username); + if(store->dest_ids){ + for(i=0; i<store->dest_id_count; i++){ + mosquitto__free(store->dest_ids[i]); + } + mosquitto__free(store->dest_ids); + } + mosquitto__free(store->topic); + mosquitto_property_free_all(&store->properties); + UHPA_FREE_PAYLOAD(store); + mosquitto__free(store); +} + + +void db__msg_store_clean(struct mosquitto_db *db) +{ + struct mosquitto_msg_store *store, *next;; + + store = db->msg_store; + while(store){ + next = store->next; + db__msg_store_remove(db, store); + store = next; + } +} + +void db__msg_store_ref_inc(struct mosquitto_msg_store *store) +{ + store->ref_count++; +} + +void db__msg_store_ref_dec(struct mosquitto_db *db, struct mosquitto_msg_store **store) +{ + (*store)->ref_count--; + if((*store)->ref_count == 0){ + db__msg_store_remove(db, *store); + *store = NULL; + } +} + + +void db__msg_store_compact(struct mosquitto_db *db) +{ + struct mosquitto_msg_store *store, *next; + + store = db->msg_store; + while(store){ + next = store->next; + if(store->ref_count < 1){ + db__msg_store_remove(db, store); + } + store = next; + } +} + + +static void db__message_remove(struct mosquitto_db *db, struct mosquitto_msg_data *msg_data, struct mosquitto_client_msg *item) +{ + if(!msg_data || !item){ + return; + } + + DL_DELETE(msg_data->inflight, item); + if(item->store){ + msg_data->msg_count--; + msg_data->msg_bytes -= item->store->payloadlen; + if(item->qos > 0){ + msg_data->msg_count12--; + msg_data->msg_bytes12 -= item->store->payloadlen; + } + db__msg_store_ref_dec(db, &item->store); + } + + mosquitto_property_free_all(&item->properties); + mosquitto__free(item); +} + + +void db__message_dequeue_first(struct mosquitto *context, struct mosquitto_msg_data *msg_data) +{ + struct mosquitto_client_msg *msg; + + msg = msg_data->queued; + DL_DELETE(msg_data->queued, msg); + DL_APPEND(msg_data->inflight, msg); + if(msg_data->inflight_quota > 0){ + msg_data->inflight_quota--; + } +} + + +int db__message_delete_outgoing(struct mosquitto_db *db, struct mosquitto *context, uint16_t mid, enum mosquitto_msg_state expect_state, int qos) +{ + struct mosquitto_client_msg *tail, *tmp; + int msg_index = 0; + + if(!context) return MOSQ_ERR_INVAL; + + DL_FOREACH_SAFE(context->msgs_out.inflight, tail, tmp){ + msg_index++; + if(tail->mid == mid){ + if(tail->qos != qos){ + return MOSQ_ERR_PROTOCOL; + }else if(qos == 2 && tail->state != expect_state){ + return MOSQ_ERR_PROTOCOL; + } + msg_index--; + db__message_remove(db, &context->msgs_out, tail); + } + } + + DL_FOREACH_SAFE(context->msgs_out.queued, tail, tmp){ + if(context->msgs_out.inflight_maximum != 0 && msg_index >= context->msgs_out.inflight_maximum){ + break; + } + + msg_index++; + tail->timestamp = mosquitto_time(); + switch(tail->qos){ + case 0: + tail->state = mosq_ms_publish_qos0; + break; + case 1: + tail->state = mosq_ms_publish_qos1; + break; + case 2: + tail->state = mosq_ms_publish_qos2; + break; + } + db__message_dequeue_first(context, &context->msgs_out); + } + + return MOSQ_ERR_SUCCESS; +} + +int db__message_insert(struct mosquitto_db *db, struct mosquitto *context, uint16_t mid, enum mosquitto_msg_direction dir, int qos, bool retain, struct mosquitto_msg_store *stored, mosquitto_property *properties) +{ + struct mosquitto_client_msg *msg; + struct mosquitto_msg_data *msg_data; + enum mosquitto_msg_state state = mosq_ms_invalid; + int rc = 0; + int i; + char **dest_ids; + + assert(stored); + if(!context) return MOSQ_ERR_INVAL; + if(!context->id) return MOSQ_ERR_SUCCESS; /* Protect against unlikely "client is disconnected but not entirely freed" scenario */ + + if(dir == mosq_md_out){ + msg_data = &context->msgs_out; + }else{ + msg_data = &context->msgs_in; + } + + /* Check whether we've already sent this message to this client + * for outgoing messages only. + * If retain==true then this is a stale retained message and so should be + * sent regardless. FIXME - this does mean retained messages will received + * multiple times for overlapping subscriptions, although this is only the + * case for SUBSCRIPTION with multiple subs in so is a minor concern. + */ + if(context->protocol != mosq_p_mqtt5 + && db->config->allow_duplicate_messages == false + && dir == mosq_md_out && retain == false && stored->dest_ids){ + + for(i=0; i<stored->dest_id_count; i++){ + if(!strcmp(stored->dest_ids[i], context->id)){ + /* We have already sent this message to this client. */ + mosquitto_property_free_all(&properties); + return MOSQ_ERR_SUCCESS; + } + } + } + if(context->sock == INVALID_SOCKET){ + /* Client is not connected only queue messages with QoS>0. */ + if(qos == 0 && !db->config->queue_qos0_messages){ + if(!context->bridge){ + mosquitto_property_free_all(&properties); + return 2; + }else{ + if(context->bridge->start_type != bst_lazy){ + mosquitto_property_free_all(&properties); + return 2; + } + } + } + } + + if(context->sock != INVALID_SOCKET){ + if(db__ready_for_flight(msg_data, qos)){ + if(dir == mosq_md_out){ + switch(qos){ + case 0: + state = mosq_ms_publish_qos0; + break; + case 1: + state = mosq_ms_publish_qos1; + break; + case 2: + state = mosq_ms_publish_qos2; + break; + } + }else{ + if(qos == 2){ + state = mosq_ms_wait_for_pubrel; + }else{ + mosquitto_property_free_all(&properties); + return 1; + } + } + }else if(db__ready_for_queue(context, qos, msg_data)){ + state = mosq_ms_queued; + rc = 2; + }else{ + /* Dropping message due to full queue. */ + if(context->is_dropping == false){ + context->is_dropping = true; + log__printf(NULL, MOSQ_LOG_NOTICE, + "Outgoing messages are being dropped for client %s.", + context->id); + } + G_MSGS_DROPPED_INC(); + mosquitto_property_free_all(&properties); + return 2; + } + }else{ + if (db__ready_for_queue(context, qos, msg_data)){ + state = mosq_ms_queued; + }else{ + G_MSGS_DROPPED_INC(); + if(context->is_dropping == false){ + context->is_dropping = true; + log__printf(NULL, MOSQ_LOG_NOTICE, + "Outgoing messages are being dropped for client %s.", + context->id); + } + mosquitto_property_free_all(&properties); + return 2; + } + } + assert(state != mosq_ms_invalid); + +#ifdef WITH_PERSISTENCE + if(state == mosq_ms_queued){ + db->persistence_changes++; + } +#endif + + msg = mosquitto__malloc(sizeof(struct mosquitto_client_msg)); + if(!msg) return MOSQ_ERR_NOMEM; + msg->prev = NULL; + msg->next = NULL; + msg->store = stored; + db__msg_store_ref_inc(msg->store); + msg->mid = mid; + msg->timestamp = mosquitto_time(); + msg->direction = dir; + msg->state = state; + msg->dup = false; + if(qos > context->maximum_qos){ + msg->qos = context->maximum_qos; + }else{ + msg->qos = qos; + } + msg->retain = retain; + msg->properties = properties; + + if(state == mosq_ms_queued){ + DL_APPEND(msg_data->queued, msg); + }else{ + DL_APPEND(msg_data->inflight, msg); + } + msg_data->msg_count++; + msg_data->msg_bytes+= msg->store->payloadlen; + if(qos > 0){ + msg_data->msg_count12++; + msg_data->msg_bytes12 += msg->store->payloadlen; + } + + if(db->config->allow_duplicate_messages == false && dir == mosq_md_out && retain == false){ + /* Record which client ids this message has been sent to so we can avoid duplicates. + * Outgoing messages only. + * If retain==true then this is a stale retained message and so should be + * sent regardless. FIXME - this does mean retained messages will received + * multiple times for overlapping subscriptions, although this is only the + * case for SUBSCRIPTION with multiple subs in so is a minor concern. + */ + dest_ids = mosquitto__realloc(stored->dest_ids, sizeof(char *)*(stored->dest_id_count+1)); + if(dest_ids){ + stored->dest_ids = dest_ids; + stored->dest_id_count++; + stored->dest_ids[stored->dest_id_count-1] = mosquitto__strdup(context->id); + if(!stored->dest_ids[stored->dest_id_count-1]){ + return MOSQ_ERR_NOMEM; + } + }else{ + return MOSQ_ERR_NOMEM; + } + } +#ifdef WITH_BRIDGE + if(context->bridge && context->bridge->start_type == bst_lazy + && context->sock == INVALID_SOCKET + && context->msgs_out.msg_count >= context->bridge->threshold){ + + context->bridge->lazy_reconnect = true; + } +#endif + + if(dir == mosq_md_out && msg->qos > 0){ + util__decrement_send_quota(context); + } +#ifdef WITH_WEBSOCKETS + if(context->wsi && rc == 0){ + return db__message_write(db, context); + }else{ + return rc; + } +#else + return rc; +#endif +} + +int db__message_update_outgoing(struct mosquitto *context, uint16_t mid, enum mosquitto_msg_state state, int qos) +{ + struct mosquitto_client_msg *tail; + + DL_FOREACH(context->msgs_out.inflight, tail){ + if(tail->mid == mid){ + if(tail->qos != qos){ + return MOSQ_ERR_PROTOCOL; + } + tail->state = state; + tail->timestamp = mosquitto_time(); + return MOSQ_ERR_SUCCESS; + } + } + return MOSQ_ERR_NOT_FOUND; +} + + +void db__messages_delete_list(struct mosquitto_db *db, struct mosquitto_client_msg **head) +{ + struct mosquitto_client_msg *tail, *tmp; + + DL_FOREACH_SAFE(*head, tail, tmp){ + DL_DELETE(*head, tail); + db__msg_store_ref_dec(db, &tail->store); + mosquitto_property_free_all(&tail->properties); + mosquitto__free(tail); + } + *head = NULL; +} + + +int db__messages_delete(struct mosquitto_db *db, struct mosquitto *context) +{ + if(!context) return MOSQ_ERR_INVAL; + + db__messages_delete_list(db, &context->msgs_in.inflight); + db__messages_delete_list(db, &context->msgs_in.queued); + db__messages_delete_list(db, &context->msgs_out.inflight); + db__messages_delete_list(db, &context->msgs_out.queued); + + context->msgs_in.msg_bytes = 0; + context->msgs_in.msg_bytes12 = 0; + context->msgs_in.msg_count = 0; + context->msgs_in.msg_count12 = 0; + + context->msgs_out.msg_bytes = 0; + context->msgs_out.msg_bytes12 = 0; + context->msgs_out.msg_count = 0; + context->msgs_out.msg_count12 = 0; + + return MOSQ_ERR_SUCCESS; +} + +int db__messages_easy_queue(struct mosquitto_db *db, struct mosquitto *context, const char *topic, int qos, uint32_t payloadlen, const void *payload, int retain, uint32_t message_expiry_interval, mosquitto_property **properties) +{ + struct mosquitto_msg_store *stored; + char *source_id; + char *topic_heap; + mosquitto__payload_uhpa payload_uhpa; + mosquitto_property *local_properties = NULL; + enum mosquitto_msg_origin origin; + + assert(db); + + payload_uhpa.ptr = NULL; + + if(!topic) return MOSQ_ERR_INVAL; + topic_heap = mosquitto__strdup(topic); + if(!topic_heap) return MOSQ_ERR_INVAL; + + if(db->config->retain_available == false){ + retain = 0; + } + + if(UHPA_ALLOC(payload_uhpa, payloadlen) == 0){ + mosquitto__free(topic_heap); + return MOSQ_ERR_NOMEM; + } + memcpy(UHPA_ACCESS(payload_uhpa, payloadlen), payload, payloadlen); + + if(context && context->id){ + source_id = context->id; + }else{ + source_id = ""; + } + if(properties){ + local_properties = *properties; + *properties = NULL; + } + + if(context){ + origin = mosq_mo_client; + }else{ + origin = mosq_mo_broker; + } + if(db__message_store(db, context, 0, topic_heap, qos, payloadlen, &payload_uhpa, retain, &stored, message_expiry_interval, local_properties, 0, origin)) return 1; + + return sub__messages_queue(db, source_id, topic_heap, qos, retain, &stored); +} + +/* This function requires topic to be allocated on the heap. Once called, it owns topic and will free it on error. Likewise payload and properties. */ +int db__message_store(struct mosquitto_db *db, const struct mosquitto *source, uint16_t source_mid, char *topic, int qos, uint32_t payloadlen, mosquitto__payload_uhpa *payload, int retain, struct mosquitto_msg_store **stored, uint32_t message_expiry_interval, mosquitto_property *properties, dbid_t store_id, enum mosquitto_msg_origin origin) +{ + struct mosquitto_msg_store *temp = NULL; + int rc = MOSQ_ERR_SUCCESS; + + assert(db); + assert(stored); + + temp = mosquitto__calloc(1, sizeof(struct mosquitto_msg_store)); + if(!temp){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + rc = MOSQ_ERR_NOMEM; + goto error; + } + + temp->topic = NULL; + temp->payload.ptr = NULL; + + temp->ref_count = 0; + if(source && source->id){ + temp->source_id = mosquitto__strdup(source->id); + }else{ + temp->source_id = mosquitto__strdup(""); + } + if(!temp->source_id){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + rc = MOSQ_ERR_NOMEM; + goto error; + } + + if(source && source->username){ + temp->source_username = mosquitto__strdup(source->username); + if(!temp->source_username){ + rc = MOSQ_ERR_NOMEM; + goto error; + } + } + if(source){ + temp->source_listener = source->listener; + } + temp->source_mid = source_mid; + temp->mid = 0; + temp->qos = qos; + temp->retain = retain; + temp->topic = topic; + topic = NULL; + temp->payloadlen = payloadlen; + temp->properties = properties; + temp->origin = origin; + if(payloadlen){ + UHPA_MOVE(temp->payload, *payload, payloadlen); + }else{ + temp->payload.ptr = NULL; + } + if(message_expiry_interval > 0){ + temp->message_expiry_time = time(NULL) + message_expiry_interval; + }else{ + temp->message_expiry_time = 0; + } + + temp->dest_ids = NULL; + temp->dest_id_count = 0; + db->msg_store_count++; + db->msg_store_bytes += payloadlen; + (*stored) = temp; + + if(!store_id){ + temp->db_id = ++db->last_db_id; + }else{ + temp->db_id = store_id; + } + + db__msg_store_add(db, temp); + + return MOSQ_ERR_SUCCESS; +error: + mosquitto__free(topic); + if(temp){ + mosquitto__free(temp->source_id); + mosquitto__free(temp->source_username); + mosquitto__free(temp->topic); + mosquitto__free(temp); + } + mosquitto_property_free_all(&properties); + UHPA_FREE(*payload, payloadlen); + return rc; +} + +int db__message_store_find(struct mosquitto *context, uint16_t mid, struct mosquitto_msg_store **stored) +{ + struct mosquitto_client_msg *tail; + + if(!context) return MOSQ_ERR_INVAL; + + *stored = NULL; + DL_FOREACH(context->msgs_in.inflight, tail){ + if(tail->store->source_mid == mid){ + *stored = tail->store; + return MOSQ_ERR_SUCCESS; + } + } + + DL_FOREACH(context->msgs_in.queued, tail){ + if(tail->store->source_mid == mid){ + *stored = tail->store; + return MOSQ_ERR_SUCCESS; + } + } + + return 1; +} + +/* Called on reconnect to set outgoing messages to a sensible state and force a + * retry, and to set incoming messages to expect an appropriate retry. */ +int db__message_reconnect_reset_outgoing(struct mosquitto_db *db, struct mosquitto *context) +{ + struct mosquitto_client_msg *msg, *tmp; + + context->msgs_out.msg_bytes = 0; + context->msgs_out.msg_bytes12 = 0; + context->msgs_out.msg_count = 0; + context->msgs_out.msg_count12 = 0; + context->msgs_out.inflight_quota = context->msgs_out.inflight_maximum; + + DL_FOREACH_SAFE(context->msgs_out.inflight, msg, tmp){ + context->msgs_out.msg_count++; + context->msgs_out.msg_bytes += msg->store->payloadlen; + if(msg->qos > 0){ + context->msgs_out.msg_count12++; + context->msgs_out.msg_bytes12 += msg->store->payloadlen; + util__decrement_receive_quota(context); + } + + switch(msg->qos){ + case 0: + msg->state = mosq_ms_publish_qos0; + break; + case 1: + msg->state = mosq_ms_publish_qos1; + break; + case 2: + if(msg->state == mosq_ms_wait_for_pubcomp){ + msg->state = mosq_ms_resend_pubrel; + }else{ + msg->state = mosq_ms_publish_qos2; + } + break; + } + } + /* Messages received when the client was disconnected are put + * in the mosq_ms_queued state. If we don't change them to the + * appropriate "publish" state, then the queued messages won't + * get sent until the client next receives a message - and they + * will be sent out of order. + */ + DL_FOREACH_SAFE(context->msgs_out.queued, msg, tmp){ + context->msgs_out.msg_count++; + context->msgs_out.msg_bytes += msg->store->payloadlen; + if(msg->qos > 0){ + context->msgs_out.msg_count12++; + context->msgs_out.msg_bytes12 += msg->store->payloadlen; + } + if(db__ready_for_flight(&context->msgs_out, msg->qos)){ + switch(msg->qos){ + case 0: + msg->state = mosq_ms_publish_qos0; + break; + case 1: + msg->state = mosq_ms_publish_qos1; + break; + case 2: + msg->state = mosq_ms_publish_qos2; + break; + } + db__message_dequeue_first(context, &context->msgs_out); + } + } + + return MOSQ_ERR_SUCCESS; +} + + +/* Called on reconnect to set incoming messages to expect an appropriate retry. */ +int db__message_reconnect_reset_incoming(struct mosquitto_db *db, struct mosquitto *context) +{ + struct mosquitto_client_msg *msg, *tmp; + + context->msgs_in.msg_bytes = 0; + context->msgs_in.msg_bytes12 = 0; + context->msgs_in.msg_count = 0; + context->msgs_in.msg_count12 = 0; + context->msgs_in.inflight_quota = context->msgs_in.inflight_maximum; + + DL_FOREACH_SAFE(context->msgs_in.inflight, msg, tmp){ + context->msgs_in.msg_count++; + context->msgs_in.msg_bytes += msg->store->payloadlen; + if(msg->qos > 0){ + context->msgs_in.msg_count12++; + context->msgs_in.msg_bytes12 += msg->store->payloadlen; + util__decrement_receive_quota(context); + } + + if(msg->qos != 2){ + /* Anything <QoS 2 can be completely retried by the client at + * no harm. */ + db__message_remove(db, &context->msgs_in, msg); + }else{ + /* Message state can be preserved here because it should match + * whatever the client has got. */ + } + } + + /* Messages received when the client was disconnected are put + * in the mosq_ms_queued state. If we don't change them to the + * appropriate "publish" state, then the queued messages won't + * get sent until the client next receives a message - and they + * will be sent out of order. + */ + DL_FOREACH_SAFE(context->msgs_in.queued, msg, tmp){ + context->msgs_in.msg_count++; + context->msgs_in.msg_bytes += msg->store->payloadlen; + if(msg->qos > 0){ + context->msgs_in.msg_count12++; + context->msgs_in.msg_bytes12 += msg->store->payloadlen; + } + if(db__ready_for_flight(&context->msgs_in, msg->qos)){ + switch(msg->qos){ + case 0: + msg->state = mosq_ms_publish_qos0; + break; + case 1: + msg->state = mosq_ms_publish_qos1; + break; + case 2: + msg->state = mosq_ms_publish_qos2; + break; + } + db__message_dequeue_first(context, &context->msgs_in); + } + } + + return MOSQ_ERR_SUCCESS; +} + + +int db__message_reconnect_reset(struct mosquitto_db *db, struct mosquitto *context) +{ + int rc; + + rc = db__message_reconnect_reset_outgoing(db, context); + if(rc) return rc; + return db__message_reconnect_reset_incoming(db, context); +} + + +int db__message_release_incoming(struct mosquitto_db *db, struct mosquitto *context, uint16_t mid) +{ + struct mosquitto_client_msg *tail, *tmp; + int retain; + char *topic; + char *source_id; + int msg_index = 0; + bool deleted = false; + + if(!context) return MOSQ_ERR_INVAL; + + DL_FOREACH_SAFE(context->msgs_in.inflight, tail, tmp){ + msg_index++; + if(tail->mid == mid){ + if(tail->store->qos != 2){ + return MOSQ_ERR_PROTOCOL; + } + topic = tail->store->topic; + retain = tail->retain; + source_id = tail->store->source_id; + + /* topic==NULL should be a QoS 2 message that was + * denied/dropped and is being processed so the client doesn't + * keep resending it. That means we don't send it to other + * clients. */ + if(!topic || !sub__messages_queue(db, source_id, topic, 2, retain, &tail->store)){ + db__message_remove(db, &context->msgs_in, tail); + deleted = true; + }else{ + return 1; + } + } + } + + DL_FOREACH_SAFE(context->msgs_in.queued, tail, tmp){ + if(context->msgs_in.inflight_maximum != 0 && msg_index >= context->msgs_in.inflight_maximum){ + break; + } + + msg_index++; + tail->timestamp = mosquitto_time(); + + if(tail->qos == 2){ + send__pubrec(context, tail->mid, 0); + tail->state = mosq_ms_wait_for_pubrel; + db__message_dequeue_first(context, &context->msgs_in); + } + } + if(deleted){ + return MOSQ_ERR_SUCCESS; + }else{ + return 1; + } +} + +int db__message_write(struct mosquitto_db *db, struct mosquitto *context) +{ + int rc; + struct mosquitto_client_msg *tail, *tmp; + uint16_t mid; + int retries; + int retain; + const char *topic; + int qos; + uint32_t payloadlen; + const void *payload; + int msg_count = 0; + mosquitto_property *cmsg_props = NULL, *store_props = NULL; + time_t now = 0; + uint32_t expiry_interval; + + if(!context || context->sock == INVALID_SOCKET + || (context->state == mosq_cs_connected && !context->id)){ + return MOSQ_ERR_INVAL; + } + + if(context->state != mosq_cs_connected){ + return MOSQ_ERR_SUCCESS; + } + + DL_FOREACH_SAFE(context->msgs_in.inflight, tail, tmp){ + msg_count++; + expiry_interval = 0; + if(tail->store->message_expiry_time){ + if(now == 0){ + now = time(NULL); + } + if(now > tail->store->message_expiry_time){ + /* Message is expired, must not send. */ + db__message_remove(db, &context->msgs_in, tail); + continue; + }else{ + expiry_interval = tail->store->message_expiry_time - now; + } + } + mid = tail->mid; + retries = tail->dup; + retain = tail->retain; + topic = tail->store->topic; + qos = tail->qos; + payloadlen = tail->store->payloadlen; + payload = UHPA_ACCESS_PAYLOAD(tail->store); + cmsg_props = tail->properties; + store_props = tail->store->properties; + + switch(tail->state){ + case mosq_ms_send_pubrec: + rc = send__pubrec(context, mid, 0); + if(!rc){ + tail->state = mosq_ms_wait_for_pubrel; + }else{ + return rc; + } + break; + + case mosq_ms_resend_pubcomp: + rc = send__pubcomp(context, mid); + if(!rc){ + tail->state = mosq_ms_wait_for_pubrel; + }else{ + return rc; + } + break; + + case mosq_ms_invalid: + case mosq_ms_publish_qos0: + case mosq_ms_publish_qos1: + case mosq_ms_publish_qos2: + case mosq_ms_resend_pubrel: + case mosq_ms_wait_for_puback: + case mosq_ms_wait_for_pubrec: + case mosq_ms_wait_for_pubrel: + case mosq_ms_wait_for_pubcomp: + case mosq_ms_queued: + break; + } + } + + DL_FOREACH_SAFE(context->msgs_out.inflight, tail, tmp){ + msg_count++; + expiry_interval = 0; + if(tail->store->message_expiry_time){ + if(now == 0){ + now = time(NULL); + } + if(now > tail->store->message_expiry_time){ + /* Message is expired, must not send. */ + db__message_remove(db, &context->msgs_out, tail); + continue; + }else{ + expiry_interval = tail->store->message_expiry_time - now; + } + } + mid = tail->mid; + retries = tail->dup; + retain = tail->retain; + topic = tail->store->topic; + qos = tail->qos; + payloadlen = tail->store->payloadlen; + payload = UHPA_ACCESS_PAYLOAD(tail->store); + cmsg_props = tail->properties; + store_props = tail->store->properties; + + switch(tail->state){ + case mosq_ms_publish_qos0: + rc = send__publish(context, mid, topic, payloadlen, payload, qos, retain, retries, cmsg_props, store_props, expiry_interval); + if(rc == MOSQ_ERR_SUCCESS || rc == MOSQ_ERR_OVERSIZE_PACKET){ + db__message_remove(db, &context->msgs_out, tail); + }else{ + return rc; + } + break; + + case mosq_ms_publish_qos1: + rc = send__publish(context, mid, topic, payloadlen, payload, qos, retain, retries, cmsg_props, store_props, expiry_interval); + if(rc == MOSQ_ERR_SUCCESS){ + tail->timestamp = mosquitto_time(); + tail->dup = 1; /* Any retry attempts are a duplicate. */ + tail->state = mosq_ms_wait_for_puback; + }else if(rc == MOSQ_ERR_OVERSIZE_PACKET){ + db__message_remove(db, &context->msgs_out, tail); + }else{ + return rc; + } + break; + + case mosq_ms_publish_qos2: + rc = send__publish(context, mid, topic, payloadlen, payload, qos, retain, retries, cmsg_props, store_props, expiry_interval); + if(rc == MOSQ_ERR_SUCCESS){ + tail->timestamp = mosquitto_time(); + tail->dup = 1; /* Any retry attempts are a duplicate. */ + tail->state = mosq_ms_wait_for_pubrec; + }else if(rc == MOSQ_ERR_OVERSIZE_PACKET){ + db__message_remove(db, &context->msgs_out, tail); + }else{ + return rc; + } + break; + + case mosq_ms_resend_pubrel: + rc = send__pubrel(context, mid); + if(!rc){ + tail->state = mosq_ms_wait_for_pubcomp; + }else{ + return rc; + } + break; + + case mosq_ms_invalid: + case mosq_ms_send_pubrec: + case mosq_ms_resend_pubcomp: + case mosq_ms_wait_for_puback: + case mosq_ms_wait_for_pubrec: + case mosq_ms_wait_for_pubrel: + case mosq_ms_wait_for_pubcomp: + case mosq_ms_queued: + break; + } + } + + DL_FOREACH_SAFE(context->msgs_in.queued, tail, tmp){ + if(context->msgs_out.inflight_maximum != 0 && context->msgs_in.inflight_quota == 0){ + break; + } + + msg_count++; + + if(tail->qos == 2){ + tail->state = mosq_ms_send_pubrec; + db__message_dequeue_first(context, &context->msgs_in); + rc = send__pubrec(context, tail->mid, 0); + if(!rc){ + tail->state = mosq_ms_wait_for_pubrel; + }else{ + return rc; + } + } + } + + DL_FOREACH_SAFE(context->msgs_out.queued, tail, tmp){ + if(context->msgs_out.inflight_maximum != 0 && context->msgs_out.inflight_quota == 0){ + break; + } + + msg_count++; + + switch(tail->qos){ + case 0: + tail->state = mosq_ms_publish_qos0; + break; + case 1: + tail->state = mosq_ms_publish_qos1; + break; + case 2: + tail->state = mosq_ms_publish_qos2; + break; + } + db__message_dequeue_first(context, &context->msgs_out); + } + + return MOSQ_ERR_SUCCESS; +} + +void db__limits_set(unsigned long inflight_bytes, int queued, unsigned long queued_bytes) +{ + max_inflight_bytes = inflight_bytes; + max_queued = queued; + max_queued_bytes = queued_bytes; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/db_dump/Makefile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/db_dump/Makefile new file mode 100644 index 0000000..202af87 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/db_dump/Makefile @@ -0,0 +1,16 @@ +include ../../config.mk + +CFLAGS_FINAL=${CFLAGS} -I.. -I../../lib -I../.. -I../deps + +.PHONY: all clean reallyclean + +all : mosquitto_db_dump + +mosquitto_db_dump : db_dump.o + ${CROSS_COMPILE}${CC} $^ -o $@ ${LDFLAGS} ${LIBS} + +db_dump.o : db_dump.c ../persist.h + ${CROSS_COMPILE}${CC} $(CFLAGS_FINAL) -c $< -o $@ + +clean : + -rm -f *.o mosquitto_db_dump diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/db_dump/db_dump.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/db_dump/db_dump.c new file mode 100644 index 0000000..618a678 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/db_dump/db_dump.c @@ -0,0 +1,618 @@ +/* +Copyright (c) 2010-2012 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include <arpa/inet.h> +#include <assert.h> +#include <errno.h> +#include <fcntl.h> +#include <inttypes.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/stat.h> +#include <time.h> + +#include <mosquitto_broker_internal.h> +#include <memory_mosq.h> +#include <persist.h> + +#define mosquitto__malloc(A) malloc((A)) +#define mosquitto__free(A) free((A)) +#define _mosquitto_malloc(A) malloc((A)) +#define _mosquitto_free(A) free((A)) +#include <uthash.h> + +const unsigned char magic[15] = {0x00, 0xB5, 0x00, 'm','o','s','q','u','i','t','t','o',' ','d','b'}; + +struct client_chunk +{ + UT_hash_handle hh_id; + char *id; + int subscriptions; + int subscription_size; + int messages; + long message_size; +}; + +struct msg_store_chunk +{ + UT_hash_handle hh; + dbid_t store_id; + uint32_t length; +}; + +struct db_sub +{ + char *client_id; + char *topic; + uint8_t qos; +}; + +struct db_client +{ + char *client_id; + uint16_t last_mid; + time_t disconnect_t; +}; + +struct db_client_msg +{ + char *client_id; + uint8_t qos, retain, direction, state, dup; + dbid_t store_id; + uint16_t mid; +}; + +struct db_msg +{ + dbid_t store_id; + uint32_t payloadlen; + uint16_t source_mid, mid; + uint8_t qos, retain; + uint8_t *payload; + char *source_id; + char *source_username; + char *topic; + uint16_t source_port; +}; + +static uint32_t db_version; +static int stats = 0; +static int client_stats = 0; +static int do_print = 1; + +struct client_chunk *clients_by_id = NULL; +struct msg_store_chunk *msgs_by_id = NULL; + +static void +free__db_sub(struct db_sub *sub) +{ + if (sub->client_id) { + free(sub->client_id); + } + if (sub->topic) { + free(sub->topic); + } +} + +static void +free__db_client(struct db_client *client) +{ + if (client->client_id) { + free(client->client_id); + } +} + +static void +free__db_client_msg(struct db_client_msg *msg) +{ + if (msg->client_id) { + free(msg->client_id); + } +} + +static void +free__db_msg(struct db_msg *msg) +{ + if (msg->source_id) { + free(msg->source_id); + } + if (msg->topic) { + free(msg->topic); + } + if (msg->payload) { + free(msg->payload); + } +} + +static void +print_db_client(struct db_client *client, int length) +{ + printf("DB_CHUNK_CLIENT:\n"); + printf("\tLength: %d\n", length); + printf("\tClient ID: %s\n", client->client_id); + printf("\tLast MID: %d\n", client->last_mid); + printf("\tDisconnect time: %ld\n", client->disconnect_t); +} + +static void +print_db_client_msg(struct db_client_msg *msg, int length) +{ + printf("DB_CHUNK_CLIENT_MSG:\n"); + printf("\tLength: %d\n", length); + printf("\tClient ID: %s\n", msg->client_id); + printf("\tStore ID: %" PRIu64 "\n", msg->store_id); + printf("\tMID: %d\n", msg->mid); + printf("\tQoS: %d\n", msg->qos); + printf("\tRetain: %d\n", msg->retain); + printf("\tDirection: %d\n", msg->direction); + printf("\tState: %d\n", msg->state); + printf("\tDup: %d\n", msg->dup); +} + +static void +print_db_sub(struct db_sub *sub, int length) +{ + printf("DB_CHUNK_SUB:\n"); + printf("\tLength: %d\n", length); + printf("\tClient ID: %s\n", sub->client_id); + printf("\tTopic: %s\n", sub->topic); + printf("\tQoS: %d\n", sub->qos); +} + +static void +print_db_msg(struct db_msg *msg, int length) +{ + printf("DB_CHUNK_MSG_STORE:\n"); + printf("\tLength: %d\n", length); + printf("\tStore ID: %" PRIu64 "\n", msg->store_id); + printf("\tSource ID: %s\n", msg->source_id); + printf("\tSource Username: %s\n", msg->source_username); + printf("\tSource Port: %d\n", msg->source_port); + printf("\tSource MID: %d\n", msg->source_mid); + printf("\tMID: %d\n", msg->mid); + printf("\tTopic: %s\n", msg->topic); + printf("\tQoS: %d\n", msg->qos); + printf("\tRetain: %d\n", msg->retain); + printf("\tPayload Length: %d\n", msg->payloadlen); + + bool binary = false; + for(int i=0; i<msg->payloadlen; i++){ + if(msg->payload[i] == 0) binary = true; + } + if(binary == false && msg->payloadlen<256){ + printf("\tPayload: %s\n", msg->payload); + } +} + + +int persist__read_string(FILE *db_fptr, char **str) +{ + uint16_t i16temp; + uint16_t slen; + char *s = NULL; + + if(fread(&i16temp, 1, sizeof(uint16_t), db_fptr) != sizeof(uint16_t)){ + return MOSQ_ERR_INVAL; + } + + slen = ntohs(i16temp); + if(slen){ + s = mosquitto__malloc(slen+1); + if(!s){ + fclose(db_fptr); + fprintf(stderr, "Error: Out of memory.\n"); + return MOSQ_ERR_NOMEM; + } + if(fread(s, 1, slen, db_fptr) != slen){ + mosquitto__free(s); + fprintf(stderr, "Error: %s.\n", strerror(errno)); + return MOSQ_ERR_INVAL; + } + s[slen] = '\0'; + } + + *str = s; + return MOSQ_ERR_SUCCESS; +} + + +static int db__client_chunk_restore(struct mosquitto_db *db, FILE *db_fd, struct db_client *client) +{ + uint16_t i16temp; + int rc = 0; + struct client_chunk *cc; + + rc = persist__read_string(db_fd, &client->client_id); + if(rc){ + fprintf(stderr, "Error: Corrupt persistent database."); + fclose(db_fd); + return rc; + } + + read_e(db_fd, &i16temp, sizeof(uint16_t)); + client->last_mid = ntohs(i16temp); + + if(db_version == 2){ + client->disconnect_t = time(NULL); + }else{ + read_e(db_fd, &client->disconnect_t, sizeof(time_t)); + } + + if(client_stats){ + cc = calloc(1, sizeof(struct client_chunk)); + if(!cc){ + errno = ENOMEM; + goto error; + } + cc->id = strdup(client->client_id); + HASH_ADD_KEYPTR(hh_id, clients_by_id, cc->id, strlen(cc->id), cc); + } + + return rc; +error: + fprintf(stderr, "Error: %s.", strerror(errno)); + if(db_fd) fclose(db_fd); + free(client->client_id); + return 1; +} + +static int db__client_msg_chunk_restore(struct mosquitto_db *db, FILE *db_fd, uint32_t length, struct db_client_msg *msg) +{ + dbid_t i64temp; + uint16_t i16temp; + struct client_chunk *cc; + struct msg_store_chunk *msc; + int rc; + + rc = persist__read_string(db_fd, &msg->client_id); + if(rc){ + fprintf(stderr, "Error: Corrupt persistent database."); + fclose(db_fd); + return rc; + } + + read_e(db_fd, &i64temp, sizeof(dbid_t)); + msg->store_id = i64temp; + + read_e(db_fd, &i16temp, sizeof(uint16_t)); + msg->mid = ntohs(i16temp); + + read_e(db_fd, &msg->qos, sizeof(uint8_t)); + read_e(db_fd, &msg->retain, sizeof(uint8_t)); + read_e(db_fd, &msg->direction, sizeof(uint8_t)); + read_e(db_fd, &msg->state, sizeof(uint8_t)); + read_e(db_fd, &msg->dup, sizeof(uint8_t)); + + if(client_stats){ + HASH_FIND(hh_id, clients_by_id, msg->client_id, strlen(msg->client_id), cc); + if(cc){ + cc->messages++; + cc->message_size += length; + + HASH_FIND(hh, msgs_by_id, &msg->store_id, sizeof(dbid_t), msc); + if(msc){ + cc->message_size += msc->length; + } + } + } + + return 0; +error: + fprintf(stderr, "Error: %s.", strerror(errno)); + if(db_fd) fclose(db_fd); + free(msg->client_id); + return 1; +} + +static int db__msg_store_chunk_restore(struct mosquitto_db *db, FILE *db_fd, uint32_t length, struct db_msg *msg) +{ + dbid_t i64temp; + uint32_t i32temp; + uint16_t i16temp; + int rc = 0; + struct msg_store_chunk *mcs; + + read_e(db_fd, &i64temp, sizeof(dbid_t)); + msg->store_id = i64temp; + + rc = persist__read_string(db_fd, &msg->source_id); + if(rc){ + fprintf(stderr, "Error: Corrupt persistent database."); + fclose(db_fd); + return rc; + } + if(db_version == 4){ + rc = persist__read_string(db_fd, &msg->source_username); + if(rc){ + fprintf(stderr, "Error: %s.", strerror(errno)); + fclose(db_fd); + free(msg->source_id); + free(msg->topic); + free(msg->payload); + free(msg->source_id); + return 1; + } + read_e(db_fd, &i16temp, sizeof(uint16_t)); + msg->source_port = ntohs(i16temp); + } + + + read_e(db_fd, &i16temp, sizeof(uint16_t)); + msg->source_mid = ntohs(i16temp); + + read_e(db_fd, &i16temp, sizeof(uint16_t)); + msg->mid = ntohs(i16temp); + + rc = persist__read_string(db_fd, &msg->topic); + if(rc){ + fprintf(stderr, "Error: Corrupt persistent database."); + fclose(db_fd); + return rc; + } + + read_e(db_fd, &msg->qos, sizeof(uint8_t)); + read_e(db_fd, &msg->retain, sizeof(uint8_t)); + + read_e(db_fd, &i32temp, sizeof(uint32_t)); + msg->payloadlen = ntohl(i32temp); + + if(msg->payloadlen){ + msg->payload = malloc(msg->payloadlen+1); + if(!msg->payload){ + fclose(db_fd); + free(msg->source_id); + free(msg->topic); + fprintf(stderr, "Error: Out of memory."); + return 1; + } + memset(msg->payload, 0, msg->payloadlen+1); + if(fread(msg->payload, 1, msg->payloadlen, db_fd) != msg->payloadlen){ + fprintf(stderr, "Error: %s.", strerror(errno)); + fclose(db_fd); + free(msg->source_id); + free(msg->topic); + free(msg->payload); + return 1; + } + } + + if(client_stats){ + mcs = calloc(1, sizeof(struct msg_store_chunk)); + if(!mcs){ + errno = ENOMEM; + goto error; + } + mcs->store_id = msg->store_id; + mcs->length = length; + HASH_ADD(hh, msgs_by_id, store_id, sizeof(dbid_t), mcs); + } + + return rc; +error: + fprintf(stderr, "Error: %s.", strerror(errno)); + if(db_fd) fclose(db_fd); + free(msg->source_id); + free(msg->topic); + return 1; +} + +static int db__retain_chunk_restore(struct mosquitto_db *db, FILE *db_fd) +{ + dbid_t i64temp, store_id; + + if(fread(&i64temp, sizeof(dbid_t), 1, db_fd) != 1){ + fprintf(stderr, "Error: %s.", strerror(errno)); + fclose(db_fd); + return 1; + } + store_id = i64temp; + if(do_print) printf("\tStore ID: %" PRIu64 "\n", store_id); + return 0; +} + +static int db__sub_chunk_restore(struct mosquitto_db *db, FILE *db_fd, uint32_t length, struct db_sub *sub) +{ + int rc = 0; + struct client_chunk *cc; + + rc = persist__read_string(db_fd, &sub->client_id); + if(rc){ + fprintf(stderr, "Error: Corrupt persistent database."); + fclose(db_fd); + return rc; + } + + rc = persist__read_string(db_fd, &sub->topic); + if(rc){ + fprintf(stderr, "Error: Corrupt persistent database."); + fclose(db_fd); + return rc; + } + + read_e(db_fd, &sub->qos, sizeof(uint8_t)); + + if(client_stats){ + HASH_FIND(hh_id, clients_by_id, sub->client_id, strlen(sub->client_id), cc); + if(cc){ + cc->subscriptions++; + cc->subscription_size += length; + } + } + + return rc; +error: + fprintf(stderr, "Error: %s.", strerror(errno)); + if(db_fd >= 0) fclose(db_fd); + return 1; +} + +int main(int argc, char *argv[]) +{ + FILE *fd; + char header[15]; + int rc = 0; + uint32_t crc; + dbid_t i64temp; + uint32_t i32temp, length; + uint16_t i16temp, chunk; + uint8_t i8temp; + ssize_t rlen; + struct mosquitto_db db; + char *filename; + long cfg_count = 0; + long msg_store_count = 0; + long client_msg_count = 0; + long retain_count = 0; + long sub_count = 0; + long client_count = 0; + struct client_chunk *cc, *cc_tmp; + + if(argc == 2){ + filename = argv[1]; + }else if(argc == 3 && !strcmp(argv[1], "--stats")){ + stats = 1; + do_print = 0; + filename = argv[2]; + }else if(argc == 3 && !strcmp(argv[1], "--client-stats")){ + client_stats = 1; + do_print = 0; + filename = argv[2]; + }else{ + fprintf(stderr, "Usage: db_dump [--stats | --client-stats] <mosquitto db filename>\n"); + return 1; + } + memset(&db, 0, sizeof(struct mosquitto_db)); + fd = fopen(filename, "rb"); + if(!fd) return 0; + read_e(fd, &header, 15); + if(!memcmp(header, magic, 15)){ + if(do_print) printf("Mosquitto DB dump\n"); + // Restore DB as normal + read_e(fd, &crc, sizeof(uint32_t)); + if(do_print) printf("CRC: %d\n", crc); + read_e(fd, &i32temp, sizeof(uint32_t)); + db_version = ntohl(i32temp); + if(do_print) printf("DB version: %d\n", db_version); + + while(rlen = fread(&i16temp, sizeof(uint16_t), 1, fd), rlen == 1){ + chunk = ntohs(i16temp); + read_e(fd, &i32temp, sizeof(uint32_t)); + length = ntohl(i32temp); + switch(chunk){ + case DB_CHUNK_CFG: + cfg_count++; + if(do_print) printf("DB_CHUNK_CFG:\n"); + if(do_print) printf("\tLength: %d\n", length); + read_e(fd, &i8temp, sizeof(uint8_t)); // shutdown + if(do_print) printf("\tShutdown: %d\n", i8temp); + read_e(fd, &i8temp, sizeof(uint8_t)); // sizeof(dbid_t) + if(do_print) printf("\tDB ID size: %d\n", i8temp); + if(i8temp != sizeof(dbid_t)){ + fprintf(stderr, "Error: Incompatible database configuration (dbid size is %d bytes, expected %ld)", + i8temp, sizeof(dbid_t)); + fclose(fd); + return 1; + } + read_e(fd, &i64temp, sizeof(dbid_t)); + if(do_print) printf("\tLast DB ID: %ld\n", (long)i64temp); + break; + + case DB_CHUNK_MSG_STORE: + msg_store_count++; + struct db_msg msg = {0}; + if(db__msg_store_chunk_restore(&db, fd, length, &msg)) return 1; + if(do_print) { + print_db_msg(&msg, length); + } + free__db_msg(&msg); + break; + + case DB_CHUNK_CLIENT_MSG: + client_msg_count++; + struct db_client_msg cmsg = {0}; + if(db__client_msg_chunk_restore(&db, fd, length, &cmsg)) return 1; + if(do_print) { + print_db_client_msg(&cmsg, length); + } + free__db_client_msg(&cmsg); + break; + + case DB_CHUNK_RETAIN: + retain_count++; + if(do_print) printf("DB_CHUNK_RETAIN:\n"); + if(do_print) printf("\tLength: %d\n", length); + if(db__retain_chunk_restore(&db, fd)) return 1; + break; + + case DB_CHUNK_SUB: + sub_count++; + struct db_sub sub = {0}; + if(db__sub_chunk_restore(&db, fd, length, &sub)) return 1; + if(do_print) { + print_db_sub(&sub, length); + } + free__db_sub(&sub); + break; + + case DB_CHUNK_CLIENT: + client_count++; + struct db_client client = {0}; + if(db__client_chunk_restore(&db, fd, &client)) return 1; + if(do_print) { + print_db_client(&client, length); + } + free__db_client(&client); + break; + + default: + fprintf(stderr, "Warning: Unsupported chunk \"%d\" in persistent database file. Ignoring.\n", chunk); + fseek(fd, length, SEEK_CUR); + break; + } + } + if(rlen < 0) goto error; + }else{ + fprintf(stderr, "Error: Unrecognised file format."); + rc = 1; + } + + fclose(fd); + + if(stats){ + printf("DB_CHUNK_CFG: %ld\n", cfg_count); + printf("DB_CHUNK_MSG_STORE: %ld\n", msg_store_count); + printf("DB_CHUNK_CLIENT_MSG: %ld\n", client_msg_count); + printf("DB_CHUNK_RETAIN: %ld\n", retain_count); + printf("DB_CHUNK_SUB: %ld\n", sub_count); + printf("DB_CHUNK_CLIENT: %ld\n", client_count); + } + + if(client_stats){ + HASH_ITER(hh_id, clients_by_id, cc, cc_tmp){ + printf("SC: %d SS: %d MC: %d MS: %ld ", cc->subscriptions, cc->subscription_size, cc->messages, cc->message_size); + printf("%s\n", cc->id); + free(cc->id); + } + } + + return rc; +error: + fprintf(stderr, "Error: %s.", strerror(errno)); + if(fd >= 0) fclose(fd); + return 1; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/deps/uthash.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/deps/uthash.h new file mode 100644 index 0000000..915a825 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/deps/uthash.h @@ -0,0 +1,948 @@ +/* +Copyright (c) 2003-2013, Troy D. Hanson http://troydhanson.github.com/uthash/ +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef UTHASH_H +#define UTHASH_H + +#include <string.h> /* memcmp,strlen */ +#include <stddef.h> /* ptrdiff_t */ +#include <stdlib.h> /* exit() */ + +/* These macros use decltype or the earlier __typeof GNU extension. + As decltype is only available in newer compilers (VS2010 or gcc 4.3+ + when compiling c++ source) this code uses whatever method is needed + or, for VS2008 where neither is available, uses casting workarounds. */ +#ifdef _MSC_VER /* MS compiler */ +#if _MSC_VER >= 1600 && defined(__cplusplus) /* VS2010 or newer in C++ mode */ +#define DECLTYPE(x) (decltype(x)) +#else /* VS2008 or older (or VS2010 in C mode) */ +#define NO_DECLTYPE +#define DECLTYPE(x) +#endif +#else /* GNU, Sun and other compilers */ +#define DECLTYPE(x) (__typeof(x)) +#endif + +#ifdef NO_DECLTYPE +#define DECLTYPE_ASSIGN(dst,src) \ +do { \ + char **_da_dst = (char**)(&(dst)); \ + *_da_dst = (char*)(src); \ +} while(0) +#else +#define DECLTYPE_ASSIGN(dst,src) \ +do { \ + (dst) = DECLTYPE(dst)(src); \ +} while(0) +#endif + +/* a number of the hash function use uint32_t which isn't defined on win32 */ +#ifdef _MSC_VER +typedef unsigned int uint32_t; +typedef unsigned char uint8_t; +#else +#include <inttypes.h> /* uint32_t */ +#endif + +#define UTHASH_VERSION 1.9.8 + +#ifndef uthash_fatal +#define uthash_fatal(msg) exit(-1) /* fatal error (out of memory,etc) */ +#endif +#ifndef uthash_malloc +#define uthash_malloc(sz) malloc(sz) /* malloc fcn */ +#endif +#ifndef uthash_free +#define uthash_free(ptr,sz) free(ptr) /* free fcn */ +#endif + +#ifndef uthash_noexpand_fyi +#define uthash_noexpand_fyi(tbl) /* can be defined to log noexpand */ +#endif +#ifndef uthash_expand_fyi +#define uthash_expand_fyi(tbl) /* can be defined to log expands */ +#endif + +/* initial number of buckets */ +#define HASH_INITIAL_NUM_BUCKETS 32 /* initial number of buckets */ +#define HASH_INITIAL_NUM_BUCKETS_LOG2 5 /* lg2 of initial number of buckets */ +#define HASH_BKT_CAPACITY_THRESH 10 /* expand when bucket count reaches */ + +/* calculate the element whose hash handle address is hhe */ +#define ELMT_FROM_HH(tbl,hhp) ((void*)(((char*)(hhp)) - ((tbl)->hho))) + +#define HASH_FIND(hh,head,keyptr,keylen,out) \ +do { \ + unsigned _hf_bkt,_hf_hashv; \ + out=NULL; \ + if (head) { \ + HASH_FCN(keyptr,keylen, (head)->hh.tbl->num_buckets, _hf_hashv, _hf_bkt); \ + if (HASH_BLOOM_TEST((head)->hh.tbl, _hf_hashv)) { \ + HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ], \ + keyptr,keylen,out); \ + } \ + } \ +} while (0) + +#ifdef HASH_BLOOM +#define HASH_BLOOM_BITLEN (1ULL << HASH_BLOOM) +#define HASH_BLOOM_BYTELEN (HASH_BLOOM_BITLEN/8) + ((HASH_BLOOM_BITLEN%8) ? 1:0) +#define HASH_BLOOM_MAKE(tbl) \ +do { \ + (tbl)->bloom_nbits = HASH_BLOOM; \ + (tbl)->bloom_bv = (uint8_t*)uthash_malloc(HASH_BLOOM_BYTELEN); \ + if (!((tbl)->bloom_bv)) { uthash_fatal( "out of memory"); } \ + memset((tbl)->bloom_bv, 0, HASH_BLOOM_BYTELEN); \ + (tbl)->bloom_sig = HASH_BLOOM_SIGNATURE; \ +} while (0) + +#define HASH_BLOOM_FREE(tbl) \ +do { \ + uthash_free((tbl)->bloom_bv, HASH_BLOOM_BYTELEN); \ +} while (0) + +#define HASH_BLOOM_BITSET(bv,idx) (bv[(idx)/8] |= (1U << ((idx)%8))) +#define HASH_BLOOM_BITTEST(bv,idx) (bv[(idx)/8] & (1U << ((idx)%8))) + +#define HASH_BLOOM_ADD(tbl,hashv) \ + HASH_BLOOM_BITSET((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1))) + +#define HASH_BLOOM_TEST(tbl,hashv) \ + HASH_BLOOM_BITTEST((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1))) + +#else +#define HASH_BLOOM_MAKE(tbl) +#define HASH_BLOOM_FREE(tbl) +#define HASH_BLOOM_ADD(tbl,hashv) +#define HASH_BLOOM_TEST(tbl,hashv) (1) +#define HASH_BLOOM_BYTELEN 0 +#endif + +#define HASH_MAKE_TABLE(hh,head) \ +do { \ + (head)->hh.tbl = (UT_hash_table*)uthash_malloc( \ + sizeof(UT_hash_table)); \ + if (!((head)->hh.tbl)) { uthash_fatal( "out of memory"); } \ + memset((head)->hh.tbl, 0, sizeof(UT_hash_table)); \ + (head)->hh.tbl->tail = &((head)->hh); \ + (head)->hh.tbl->num_buckets = HASH_INITIAL_NUM_BUCKETS; \ + (head)->hh.tbl->log2_num_buckets = HASH_INITIAL_NUM_BUCKETS_LOG2; \ + (head)->hh.tbl->hho = (char*)(&(head)->hh) - (char*)(head); \ + (head)->hh.tbl->buckets = (UT_hash_bucket*)uthash_malloc( \ + HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket)); \ + if (! (head)->hh.tbl->buckets) { uthash_fatal( "out of memory"); } \ + memset((head)->hh.tbl->buckets, 0, \ + HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket)); \ + HASH_BLOOM_MAKE((head)->hh.tbl); \ + (head)->hh.tbl->signature = HASH_SIGNATURE; \ +} while(0) + +#define HASH_ADD(hh,head,fieldname,keylen_in,add) \ + HASH_ADD_KEYPTR(hh,head,&((add)->fieldname),keylen_in,add) + +#define HASH_REPLACE(hh,head,fieldname,keylen_in,add,replaced) \ +do { \ + replaced=NULL; \ + HASH_FIND(hh,head,&((add)->fieldname),keylen_in,replaced); \ + if (replaced!=NULL) { \ + HASH_DELETE(hh,head,replaced); \ + }; \ + HASH_ADD(hh,head,fieldname,keylen_in,add); \ +} while(0) + +#define HASH_ADD_KEYPTR(hh,head,keyptr,keylen_in,add) \ +do { \ + unsigned _ha_bkt; \ + (add)->hh.next = NULL; \ + (add)->hh.key = (char*)keyptr; \ + (add)->hh.keylen = (unsigned)keylen_in; \ + if (!(head)) { \ + head = (add); \ + (head)->hh.prev = NULL; \ + HASH_MAKE_TABLE(hh,head); \ + } else { \ + (head)->hh.tbl->tail->next = (add); \ + (add)->hh.prev = ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail); \ + (head)->hh.tbl->tail = &((add)->hh); \ + } \ + (head)->hh.tbl->num_items++; \ + (add)->hh.tbl = (head)->hh.tbl; \ + HASH_FCN(keyptr,keylen_in, (head)->hh.tbl->num_buckets, \ + (add)->hh.hashv, _ha_bkt); \ + HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt],&(add)->hh); \ + HASH_BLOOM_ADD((head)->hh.tbl,(add)->hh.hashv); \ + HASH_EMIT_KEY(hh,head,keyptr,keylen_in); \ + HASH_FSCK(hh,head); \ +} while(0) + +#define HASH_TO_BKT( hashv, num_bkts, bkt ) \ +do { \ + bkt = ((hashv) & ((num_bkts) - 1)); \ +} while(0) + +/* delete "delptr" from the hash table. + * "the usual" patch-up process for the app-order doubly-linked-list. + * The use of _hd_hh_del below deserves special explanation. + * These used to be expressed using (delptr) but that led to a bug + * if someone used the same symbol for the head and deletee, like + * HASH_DELETE(hh,users,users); + * We want that to work, but by changing the head (users) below + * we were forfeiting our ability to further refer to the deletee (users) + * in the patch-up process. Solution: use scratch space to + * copy the deletee pointer, then the latter references are via that + * scratch pointer rather than through the repointed (users) symbol. + */ +#define HASH_DELETE(hh,head,delptr) \ +do { \ + unsigned _hd_bkt; \ + struct UT_hash_handle *_hd_hh_del; \ + if ( ((delptr)->hh.prev == NULL) && ((delptr)->hh.next == NULL) ) { \ + uthash_free((head)->hh.tbl->buckets, \ + (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \ + HASH_BLOOM_FREE((head)->hh.tbl); \ + uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ + head = NULL; \ + } else { \ + _hd_hh_del = &((delptr)->hh); \ + if ((delptr) == ELMT_FROM_HH((head)->hh.tbl,(head)->hh.tbl->tail)) { \ + (head)->hh.tbl->tail = \ + (UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) + \ + (head)->hh.tbl->hho); \ + } \ + if ((delptr)->hh.prev) { \ + ((UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) + \ + (head)->hh.tbl->hho))->next = (delptr)->hh.next; \ + } else { \ + DECLTYPE_ASSIGN(head,(delptr)->hh.next); \ + } \ + if (_hd_hh_del->next) { \ + ((UT_hash_handle*)((ptrdiff_t)_hd_hh_del->next + \ + (head)->hh.tbl->hho))->prev = \ + _hd_hh_del->prev; \ + } \ + HASH_TO_BKT( _hd_hh_del->hashv, (head)->hh.tbl->num_buckets, _hd_bkt); \ + HASH_DEL_IN_BKT(hh,(head)->hh.tbl->buckets[_hd_bkt], _hd_hh_del); \ + (head)->hh.tbl->num_items--; \ + } \ + HASH_FSCK(hh,head); \ +} while (0) + + +/* convenience forms of HASH_FIND/HASH_ADD/HASH_DEL */ +#define HASH_FIND_STR(head,findstr,out) \ + HASH_FIND(hh,head,findstr,strlen(findstr),out) +#define HASH_ADD_STR(head,strfield,add) \ + HASH_ADD(hh,head,strfield,strlen(add->strfield),add) +#define HASH_REPLACE_STR(head,strfield,add,replaced) \ + HASH_REPLACE(hh,head,strfield,strlen(add->strfield),add,replaced) +#define HASH_FIND_INT(head,findint,out) \ + HASH_FIND(hh,head,findint,sizeof(int),out) +#define HASH_ADD_INT(head,intfield,add) \ + HASH_ADD(hh,head,intfield,sizeof(int),add) +#define HASH_REPLACE_INT(head,intfield,add,replaced) \ + HASH_REPLACE(hh,head,intfield,sizeof(int),add,replaced) +#define HASH_FIND_PTR(head,findptr,out) \ + HASH_FIND(hh,head,findptr,sizeof(void *),out) +#define HASH_ADD_PTR(head,ptrfield,add) \ + HASH_ADD(hh,head,ptrfield,sizeof(void *),add) +#define HASH_REPLACE_PTR(head,ptrfield,add) \ + HASH_REPLACE(hh,head,ptrfield,sizeof(void *),add,replaced) +#define HASH_DEL(head,delptr) \ + HASH_DELETE(hh,head,delptr) + +/* HASH_FSCK checks hash integrity on every add/delete when HASH_DEBUG is defined. + * This is for uthash developer only; it compiles away if HASH_DEBUG isn't defined. + */ +#ifdef HASH_DEBUG +#define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0) +#define HASH_FSCK(hh,head) \ +do { \ + unsigned _bkt_i; \ + unsigned _count, _bkt_count; \ + char *_prev; \ + struct UT_hash_handle *_thh; \ + if (head) { \ + _count = 0; \ + for( _bkt_i = 0; _bkt_i < (head)->hh.tbl->num_buckets; _bkt_i++) { \ + _bkt_count = 0; \ + _thh = (head)->hh.tbl->buckets[_bkt_i].hh_head; \ + _prev = NULL; \ + while (_thh) { \ + if (_prev != (char*)(_thh->hh_prev)) { \ + HASH_OOPS("invalid hh_prev %p, actual %p\n", \ + _thh->hh_prev, _prev ); \ + } \ + _bkt_count++; \ + _prev = (char*)(_thh); \ + _thh = _thh->hh_next; \ + } \ + _count += _bkt_count; \ + if ((head)->hh.tbl->buckets[_bkt_i].count != _bkt_count) { \ + HASH_OOPS("invalid bucket count %d, actual %d\n", \ + (head)->hh.tbl->buckets[_bkt_i].count, _bkt_count); \ + } \ + } \ + if (_count != (head)->hh.tbl->num_items) { \ + HASH_OOPS("invalid hh item count %d, actual %d\n", \ + (head)->hh.tbl->num_items, _count ); \ + } \ + /* traverse hh in app order; check next/prev integrity, count */ \ + _count = 0; \ + _prev = NULL; \ + _thh = &(head)->hh; \ + while (_thh) { \ + _count++; \ + if (_prev !=(char*)(_thh->prev)) { \ + HASH_OOPS("invalid prev %p, actual %p\n", \ + _thh->prev, _prev ); \ + } \ + _prev = (char*)ELMT_FROM_HH((head)->hh.tbl, _thh); \ + _thh = ( _thh->next ? (UT_hash_handle*)((char*)(_thh->next) + \ + (head)->hh.tbl->hho) : NULL ); \ + } \ + if (_count != (head)->hh.tbl->num_items) { \ + HASH_OOPS("invalid app item count %d, actual %d\n", \ + (head)->hh.tbl->num_items, _count ); \ + } \ + } \ +} while (0) +#else +#define HASH_FSCK(hh,head) +#endif + +/* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to + * the descriptor to which this macro is defined for tuning the hash function. + * The app can #include <unistd.h> to get the prototype for write(2). */ +#ifdef HASH_EMIT_KEYS +#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) \ +do { \ + unsigned _klen = fieldlen; \ + write(HASH_EMIT_KEYS, &_klen, sizeof(_klen)); \ + write(HASH_EMIT_KEYS, keyptr, fieldlen); \ +} while (0) +#else +#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) +#endif + +/* default to Jenkin's hash unless overridden e.g. DHASH_FUNCTION=HASH_SAX */ +#ifdef HASH_FUNCTION +#define HASH_FCN HASH_FUNCTION +#else +#define HASH_FCN HASH_JEN +#endif + +/* The Bernstein hash function, used in Perl prior to v5.6 */ +#define HASH_BER(key,keylen,num_bkts,hashv,bkt) \ +do { \ + unsigned _hb_keylen=keylen; \ + char *_hb_key=(char*)(key); \ + (hashv) = 0; \ + while (_hb_keylen--) { (hashv) = ((hashv) * 33) + *_hb_key++; } \ + bkt = (hashv) & (num_bkts-1); \ +} while (0) + + +/* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at + * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx */ +#define HASH_SAX(key,keylen,num_bkts,hashv,bkt) \ +do { \ + unsigned _sx_i; \ + char *_hs_key=(char*)(key); \ + hashv = 0; \ + for(_sx_i=0; _sx_i < keylen; _sx_i++) \ + hashv ^= (hashv << 5) + (hashv >> 2) + _hs_key[_sx_i]; \ + bkt = hashv & (num_bkts-1); \ +} while (0) + +#define HASH_FNV(key,keylen,num_bkts,hashv,bkt) \ +do { \ + unsigned _fn_i; \ + char *_hf_key=(char*)(key); \ + hashv = 2166136261UL; \ + for(_fn_i=0; _fn_i < keylen; _fn_i++) \ + hashv = (hashv * 16777619) ^ _hf_key[_fn_i]; \ + bkt = hashv & (num_bkts-1); \ +} while(0) + +#define HASH_OAT(key,keylen,num_bkts,hashv,bkt) \ +do { \ + unsigned _ho_i; \ + char *_ho_key=(char*)(key); \ + hashv = 0; \ + for(_ho_i=0; _ho_i < keylen; _ho_i++) { \ + hashv += _ho_key[_ho_i]; \ + hashv += (hashv << 10); \ + hashv ^= (hashv >> 6); \ + } \ + hashv += (hashv << 3); \ + hashv ^= (hashv >> 11); \ + hashv += (hashv << 15); \ + bkt = hashv & (num_bkts-1); \ +} while(0) + +#define HASH_JEN_MIX(a,b,c) \ +do { \ + a -= b; a -= c; a ^= ( c >> 13 ); \ + b -= c; b -= a; b ^= ( a << 8 ); \ + c -= a; c -= b; c ^= ( b >> 13 ); \ + a -= b; a -= c; a ^= ( c >> 12 ); \ + b -= c; b -= a; b ^= ( a << 16 ); \ + c -= a; c -= b; c ^= ( b >> 5 ); \ + a -= b; a -= c; a ^= ( c >> 3 ); \ + b -= c; b -= a; b ^= ( a << 10 ); \ + c -= a; c -= b; c ^= ( b >> 15 ); \ +} while (0) + +#define HASH_JEN(key,keylen,num_bkts,hashv,bkt) \ +do { \ + unsigned _hj_i,_hj_j,_hj_k; \ + unsigned char *_hj_key=(unsigned char*)(key); \ + hashv = 0xfeedbeef; \ + _hj_i = _hj_j = 0x9e3779b9; \ + _hj_k = (unsigned)keylen; \ + while (_hj_k >= 12) { \ + _hj_i += (_hj_key[0] + ( (unsigned)_hj_key[1] << 8 ) \ + + ( (unsigned)_hj_key[2] << 16 ) \ + + ( (unsigned)_hj_key[3] << 24 ) ); \ + _hj_j += (_hj_key[4] + ( (unsigned)_hj_key[5] << 8 ) \ + + ( (unsigned)_hj_key[6] << 16 ) \ + + ( (unsigned)_hj_key[7] << 24 ) ); \ + hashv += (_hj_key[8] + ( (unsigned)_hj_key[9] << 8 ) \ + + ( (unsigned)_hj_key[10] << 16 ) \ + + ( (unsigned)_hj_key[11] << 24 ) ); \ + \ + HASH_JEN_MIX(_hj_i, _hj_j, hashv); \ + \ + _hj_key += 12; \ + _hj_k -= 12; \ + } \ + hashv += keylen; \ + switch ( _hj_k ) { \ + case 11: hashv += ( (unsigned)_hj_key[10] << 24 ); \ + case 10: hashv += ( (unsigned)_hj_key[9] << 16 ); \ + case 9: hashv += ( (unsigned)_hj_key[8] << 8 ); \ + case 8: _hj_j += ( (unsigned)_hj_key[7] << 24 ); \ + case 7: _hj_j += ( (unsigned)_hj_key[6] << 16 ); \ + case 6: _hj_j += ( (unsigned)_hj_key[5] << 8 ); \ + case 5: _hj_j += _hj_key[4]; \ + case 4: _hj_i += ( (unsigned)_hj_key[3] << 24 ); \ + case 3: _hj_i += ( (unsigned)_hj_key[2] << 16 ); \ + case 2: _hj_i += ( (unsigned)_hj_key[1] << 8 ); \ + case 1: _hj_i += _hj_key[0]; \ + } \ + HASH_JEN_MIX(_hj_i, _hj_j, hashv); \ + bkt = hashv & (num_bkts-1); \ +} while(0) + +/* The Paul Hsieh hash function */ +#undef get16bits +#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \ + || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__) +#define get16bits(d) (*((const uint16_t *) (d))) +#endif + +#if !defined (get16bits) +#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8) \ + +(uint32_t)(((const uint8_t *)(d))[0]) ) +#endif +#define HASH_SFH(key,keylen,num_bkts,hashv,bkt) \ +do { \ + unsigned char *_sfh_key=(unsigned char*)(key); \ + uint32_t _sfh_tmp, _sfh_len = keylen; \ + \ + int _sfh_rem = _sfh_len & 3; \ + _sfh_len >>= 2; \ + hashv = 0xcafebabe; \ + \ + /* Main loop */ \ + for (;_sfh_len > 0; _sfh_len--) { \ + hashv += get16bits (_sfh_key); \ + _sfh_tmp = (uint32_t)(get16bits (_sfh_key+2)) << 11 ^ hashv; \ + hashv = (hashv << 16) ^ _sfh_tmp; \ + _sfh_key += 2*sizeof (uint16_t); \ + hashv += hashv >> 11; \ + } \ + \ + /* Handle end cases */ \ + switch (_sfh_rem) { \ + case 3: hashv += get16bits (_sfh_key); \ + hashv ^= hashv << 16; \ + hashv ^= (uint32_t)(_sfh_key[sizeof (uint16_t)] << 18); \ + hashv += hashv >> 11; \ + break; \ + case 2: hashv += get16bits (_sfh_key); \ + hashv ^= hashv << 11; \ + hashv += hashv >> 17; \ + break; \ + case 1: hashv += *_sfh_key; \ + hashv ^= hashv << 10; \ + hashv += hashv >> 1; \ + } \ + \ + /* Force "avalanching" of final 127 bits */ \ + hashv ^= hashv << 3; \ + hashv += hashv >> 5; \ + hashv ^= hashv << 4; \ + hashv += hashv >> 17; \ + hashv ^= hashv << 25; \ + hashv += hashv >> 6; \ + bkt = hashv & (num_bkts-1); \ +} while(0) + +#ifdef HASH_USING_NO_STRICT_ALIASING +/* The MurmurHash exploits some CPU's (x86,x86_64) tolerance for unaligned reads. + * For other types of CPU's (e.g. Sparc) an unaligned read causes a bus error. + * MurmurHash uses the faster approach only on CPU's where we know it's safe. + * + * Note the preprocessor built-in defines can be emitted using: + * + * gcc -m64 -dM -E - < /dev/null (on gcc) + * cc -## a.c (where a.c is a simple test file) (Sun Studio) + */ +#if (defined(__i386__) || defined(__x86_64__) || defined(_M_IX86)) +#define MUR_GETBLOCK(p,i) p[i] +#else /* non intel */ +#define MUR_PLUS0_ALIGNED(p) (((unsigned long)p & 0x3) == 0) +#define MUR_PLUS1_ALIGNED(p) (((unsigned long)p & 0x3) == 1) +#define MUR_PLUS2_ALIGNED(p) (((unsigned long)p & 0x3) == 2) +#define MUR_PLUS3_ALIGNED(p) (((unsigned long)p & 0x3) == 3) +#define WP(p) ((uint32_t*)((unsigned long)(p) & ~3UL)) +#if (defined(__BIG_ENDIAN__) || defined(SPARC) || defined(__ppc__) || defined(__ppc64__)) +#define MUR_THREE_ONE(p) ((((*WP(p))&0x00ffffff) << 8) | (((*(WP(p)+1))&0xff000000) >> 24)) +#define MUR_TWO_TWO(p) ((((*WP(p))&0x0000ffff) <<16) | (((*(WP(p)+1))&0xffff0000) >> 16)) +#define MUR_ONE_THREE(p) ((((*WP(p))&0x000000ff) <<24) | (((*(WP(p)+1))&0xffffff00) >> 8)) +#else /* assume little endian non-intel */ +#define MUR_THREE_ONE(p) ((((*WP(p))&0xffffff00) >> 8) | (((*(WP(p)+1))&0x000000ff) << 24)) +#define MUR_TWO_TWO(p) ((((*WP(p))&0xffff0000) >>16) | (((*(WP(p)+1))&0x0000ffff) << 16)) +#define MUR_ONE_THREE(p) ((((*WP(p))&0xff000000) >>24) | (((*(WP(p)+1))&0x00ffffff) << 8)) +#endif +#define MUR_GETBLOCK(p,i) (MUR_PLUS0_ALIGNED(p) ? ((p)[i]) : \ + (MUR_PLUS1_ALIGNED(p) ? MUR_THREE_ONE(p) : \ + (MUR_PLUS2_ALIGNED(p) ? MUR_TWO_TWO(p) : \ + MUR_ONE_THREE(p)))) +#endif +#define MUR_ROTL32(x,r) (((x) << (r)) | ((x) >> (32 - (r)))) +#define MUR_FMIX(_h) \ +do { \ + _h ^= _h >> 16; \ + _h *= 0x85ebca6b; \ + _h ^= _h >> 13; \ + _h *= 0xc2b2ae35l; \ + _h ^= _h >> 16; \ +} while(0) + +#define HASH_MUR(key,keylen,num_bkts,hashv,bkt) \ +do { \ + const uint8_t *_mur_data = (const uint8_t*)(key); \ + const int _mur_nblocks = (keylen) / 4; \ + uint32_t _mur_h1 = 0xf88D5353; \ + uint32_t _mur_c1 = 0xcc9e2d51; \ + uint32_t _mur_c2 = 0x1b873593; \ + uint32_t _mur_k1 = 0; \ + const uint8_t *_mur_tail; \ + const uint32_t *_mur_blocks = (const uint32_t*)(_mur_data+_mur_nblocks*4); \ + int _mur_i; \ + for(_mur_i = -_mur_nblocks; _mur_i; _mur_i++) { \ + _mur_k1 = MUR_GETBLOCK(_mur_blocks,_mur_i); \ + _mur_k1 *= _mur_c1; \ + _mur_k1 = MUR_ROTL32(_mur_k1,15); \ + _mur_k1 *= _mur_c2; \ + \ + _mur_h1 ^= _mur_k1; \ + _mur_h1 = MUR_ROTL32(_mur_h1,13); \ + _mur_h1 = _mur_h1*5+0xe6546b64; \ + } \ + _mur_tail = (const uint8_t*)(_mur_data + _mur_nblocks*4); \ + _mur_k1=0; \ + switch((keylen) & 3) { \ + case 3: _mur_k1 ^= _mur_tail[2] << 16; \ + case 2: _mur_k1 ^= _mur_tail[1] << 8; \ + case 1: _mur_k1 ^= _mur_tail[0]; \ + _mur_k1 *= _mur_c1; \ + _mur_k1 = MUR_ROTL32(_mur_k1,15); \ + _mur_k1 *= _mur_c2; \ + _mur_h1 ^= _mur_k1; \ + } \ + _mur_h1 ^= (keylen); \ + MUR_FMIX(_mur_h1); \ + hashv = _mur_h1; \ + bkt = hashv & (num_bkts-1); \ +} while(0) +#endif /* HASH_USING_NO_STRICT_ALIASING */ + +/* key comparison function; return 0 if keys equal */ +#define HASH_KEYCMP(a,b,len) memcmp(a,b,len) + +/* iterate over items in a known bucket to find desired item */ +#define HASH_FIND_IN_BKT(tbl,hh,head,keyptr,keylen_in,out) \ +do { \ + if (head.hh_head) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,head.hh_head)); \ + else out=NULL; \ + while (out) { \ + if ((out)->hh.keylen == keylen_in) { \ + if ((HASH_KEYCMP((out)->hh.key,keyptr,keylen_in)) == 0) break; \ + } \ + if ((out)->hh.hh_next) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,(out)->hh.hh_next)); \ + else out = NULL; \ + } \ +} while(0) + +/* add an item to a bucket */ +#define HASH_ADD_TO_BKT(head,addhh) \ +do { \ + head.count++; \ + (addhh)->hh_next = head.hh_head; \ + (addhh)->hh_prev = NULL; \ + if (head.hh_head) { (head).hh_head->hh_prev = (addhh); } \ + (head).hh_head=addhh; \ + if (head.count >= ((head.expand_mult+1) * HASH_BKT_CAPACITY_THRESH) \ + && (addhh)->tbl->noexpand != 1) { \ + HASH_EXPAND_BUCKETS((addhh)->tbl); \ + } \ +} while(0) + +/* remove an item from a given bucket */ +#define HASH_DEL_IN_BKT(hh,head,hh_del) \ + (head).count--; \ + if ((head).hh_head == hh_del) { \ + (head).hh_head = hh_del->hh_next; \ + } \ + if (hh_del->hh_prev) { \ + hh_del->hh_prev->hh_next = hh_del->hh_next; \ + } \ + if (hh_del->hh_next) { \ + hh_del->hh_next->hh_prev = hh_del->hh_prev; \ + } + +/* Bucket expansion has the effect of doubling the number of buckets + * and redistributing the items into the new buckets. Ideally the + * items will distribute more or less evenly into the new buckets + * (the extent to which this is true is a measure of the quality of + * the hash function as it applies to the key domain). + * + * With the items distributed into more buckets, the chain length + * (item count) in each bucket is reduced. Thus by expanding buckets + * the hash keeps a bound on the chain length. This bounded chain + * length is the essence of how a hash provides constant time lookup. + * + * The calculation of tbl->ideal_chain_maxlen below deserves some + * explanation. First, keep in mind that we're calculating the ideal + * maximum chain length based on the *new* (doubled) bucket count. + * In fractions this is just n/b (n=number of items,b=new num buckets). + * Since the ideal chain length is an integer, we want to calculate + * ceil(n/b). We don't depend on floating point arithmetic in this + * hash, so to calculate ceil(n/b) with integers we could write + * + * ceil(n/b) = (n/b) + ((n%b)?1:0) + * + * and in fact a previous version of this hash did just that. + * But now we have improved things a bit by recognizing that b is + * always a power of two. We keep its base 2 log handy (call it lb), + * so now we can write this with a bit shift and logical AND: + * + * ceil(n/b) = (n>>lb) + ( (n & (b-1)) ? 1:0) + * + */ +#define HASH_EXPAND_BUCKETS(tbl) \ +do { \ + unsigned _he_bkt; \ + unsigned _he_bkt_i; \ + struct UT_hash_handle *_he_thh, *_he_hh_nxt; \ + UT_hash_bucket *_he_new_buckets, *_he_newbkt; \ + _he_new_buckets = (UT_hash_bucket*)uthash_malloc( \ + 2 * tbl->num_buckets * sizeof(struct UT_hash_bucket)); \ + if (!_he_new_buckets) { uthash_fatal( "out of memory"); } \ + memset(_he_new_buckets, 0, \ + 2 * tbl->num_buckets * sizeof(struct UT_hash_bucket)); \ + tbl->ideal_chain_maxlen = \ + (tbl->num_items >> (tbl->log2_num_buckets+1)) + \ + ((tbl->num_items & ((tbl->num_buckets*2)-1)) ? 1 : 0); \ + tbl->nonideal_items = 0; \ + for(_he_bkt_i = 0; _he_bkt_i < tbl->num_buckets; _he_bkt_i++) \ + { \ + _he_thh = tbl->buckets[ _he_bkt_i ].hh_head; \ + while (_he_thh) { \ + _he_hh_nxt = _he_thh->hh_next; \ + HASH_TO_BKT( _he_thh->hashv, tbl->num_buckets*2, _he_bkt); \ + _he_newbkt = &(_he_new_buckets[ _he_bkt ]); \ + if (++(_he_newbkt->count) > tbl->ideal_chain_maxlen) { \ + tbl->nonideal_items++; \ + _he_newbkt->expand_mult = _he_newbkt->count / \ + tbl->ideal_chain_maxlen; \ + } \ + _he_thh->hh_prev = NULL; \ + _he_thh->hh_next = _he_newbkt->hh_head; \ + if (_he_newbkt->hh_head) _he_newbkt->hh_head->hh_prev = \ + _he_thh; \ + _he_newbkt->hh_head = _he_thh; \ + _he_thh = _he_hh_nxt; \ + } \ + } \ + uthash_free( tbl->buckets, tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \ + tbl->num_buckets *= 2; \ + tbl->log2_num_buckets++; \ + tbl->buckets = _he_new_buckets; \ + tbl->ineff_expands = (tbl->nonideal_items > (tbl->num_items >> 1)) ? \ + (tbl->ineff_expands+1) : 0; \ + if (tbl->ineff_expands > 1) { \ + tbl->noexpand=1; \ + uthash_noexpand_fyi(tbl); \ + } \ + uthash_expand_fyi(tbl); \ +} while(0) + + +/* This is an adaptation of Simon Tatham's O(n log(n)) mergesort */ +/* Note that HASH_SORT assumes the hash handle name to be hh. + * HASH_SRT was added to allow the hash handle name to be passed in. */ +#define HASH_SORT(head,cmpfcn) HASH_SRT(hh,head,cmpfcn) +#define HASH_SRT(hh,head,cmpfcn) \ +do { \ + unsigned _hs_i; \ + unsigned _hs_looping,_hs_nmerges,_hs_insize,_hs_psize,_hs_qsize; \ + struct UT_hash_handle *_hs_p, *_hs_q, *_hs_e, *_hs_list, *_hs_tail; \ + if (head) { \ + _hs_insize = 1; \ + _hs_looping = 1; \ + _hs_list = &((head)->hh); \ + while (_hs_looping) { \ + _hs_p = _hs_list; \ + _hs_list = NULL; \ + _hs_tail = NULL; \ + _hs_nmerges = 0; \ + while (_hs_p) { \ + _hs_nmerges++; \ + _hs_q = _hs_p; \ + _hs_psize = 0; \ + for ( _hs_i = 0; _hs_i < _hs_insize; _hs_i++ ) { \ + _hs_psize++; \ + _hs_q = (UT_hash_handle*)((_hs_q->next) ? \ + ((void*)((char*)(_hs_q->next) + \ + (head)->hh.tbl->hho)) : NULL); \ + if (! (_hs_q) ) break; \ + } \ + _hs_qsize = _hs_insize; \ + while ((_hs_psize > 0) || ((_hs_qsize > 0) && _hs_q )) { \ + if (_hs_psize == 0) { \ + _hs_e = _hs_q; \ + _hs_q = (UT_hash_handle*)((_hs_q->next) ? \ + ((void*)((char*)(_hs_q->next) + \ + (head)->hh.tbl->hho)) : NULL); \ + _hs_qsize--; \ + } else if ( (_hs_qsize == 0) || !(_hs_q) ) { \ + _hs_e = _hs_p; \ + if (_hs_p){ \ + _hs_p = (UT_hash_handle*)((_hs_p->next) ? \ + ((void*)((char*)(_hs_p->next) + \ + (head)->hh.tbl->hho)) : NULL); \ + } \ + _hs_psize--; \ + } else if (( \ + cmpfcn(DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_p)), \ + DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_q))) \ + ) <= 0) { \ + _hs_e = _hs_p; \ + if (_hs_p){ \ + _hs_p = (UT_hash_handle*)((_hs_p->next) ? \ + ((void*)((char*)(_hs_p->next) + \ + (head)->hh.tbl->hho)) : NULL); \ + } \ + _hs_psize--; \ + } else { \ + _hs_e = _hs_q; \ + _hs_q = (UT_hash_handle*)((_hs_q->next) ? \ + ((void*)((char*)(_hs_q->next) + \ + (head)->hh.tbl->hho)) : NULL); \ + _hs_qsize--; \ + } \ + if ( _hs_tail ) { \ + _hs_tail->next = ((_hs_e) ? \ + ELMT_FROM_HH((head)->hh.tbl,_hs_e) : NULL); \ + } else { \ + _hs_list = _hs_e; \ + } \ + if (_hs_e) { \ + _hs_e->prev = ((_hs_tail) ? \ + ELMT_FROM_HH((head)->hh.tbl,_hs_tail) : NULL); \ + } \ + _hs_tail = _hs_e; \ + } \ + _hs_p = _hs_q; \ + } \ + if (_hs_tail){ \ + _hs_tail->next = NULL; \ + } \ + if ( _hs_nmerges <= 1 ) { \ + _hs_looping=0; \ + (head)->hh.tbl->tail = _hs_tail; \ + DECLTYPE_ASSIGN(head,ELMT_FROM_HH((head)->hh.tbl, _hs_list)); \ + } \ + _hs_insize *= 2; \ + } \ + HASH_FSCK(hh,head); \ + } \ +} while (0) + +/* This function selects items from one hash into another hash. + * The end result is that the selected items have dual presence + * in both hashes. There is no copy of the items made; rather + * they are added into the new hash through a secondary hash + * hash handle that must be present in the structure. */ +#define HASH_SELECT(hh_dst, dst, hh_src, src, cond) \ +do { \ + unsigned _src_bkt, _dst_bkt; \ + void *_last_elt=NULL, *_elt; \ + UT_hash_handle *_src_hh, *_dst_hh, *_last_elt_hh=NULL; \ + ptrdiff_t _dst_hho = ((char*)(&(dst)->hh_dst) - (char*)(dst)); \ + if (src) { \ + for(_src_bkt=0; _src_bkt < (src)->hh_src.tbl->num_buckets; _src_bkt++) { \ + for(_src_hh = (src)->hh_src.tbl->buckets[_src_bkt].hh_head; \ + _src_hh; \ + _src_hh = _src_hh->hh_next) { \ + _elt = ELMT_FROM_HH((src)->hh_src.tbl, _src_hh); \ + if (cond(_elt)) { \ + _dst_hh = (UT_hash_handle*)(((char*)_elt) + _dst_hho); \ + _dst_hh->key = _src_hh->key; \ + _dst_hh->keylen = _src_hh->keylen; \ + _dst_hh->hashv = _src_hh->hashv; \ + _dst_hh->prev = _last_elt; \ + _dst_hh->next = NULL; \ + if (_last_elt_hh) { _last_elt_hh->next = _elt; } \ + if (!dst) { \ + DECLTYPE_ASSIGN(dst,_elt); \ + HASH_MAKE_TABLE(hh_dst,dst); \ + } else { \ + _dst_hh->tbl = (dst)->hh_dst.tbl; \ + } \ + HASH_TO_BKT(_dst_hh->hashv, _dst_hh->tbl->num_buckets, _dst_bkt); \ + HASH_ADD_TO_BKT(_dst_hh->tbl->buckets[_dst_bkt],_dst_hh); \ + (dst)->hh_dst.tbl->num_items++; \ + _last_elt = _elt; \ + _last_elt_hh = _dst_hh; \ + } \ + } \ + } \ + } \ + HASH_FSCK(hh_dst,dst); \ +} while (0) + +#define HASH_CLEAR(hh,head) \ +do { \ + if (head) { \ + uthash_free((head)->hh.tbl->buckets, \ + (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket)); \ + HASH_BLOOM_FREE((head)->hh.tbl); \ + uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ + (head)=NULL; \ + } \ +} while(0) + +#define HASH_OVERHEAD(hh,head) \ + (size_t)((((head)->hh.tbl->num_items * sizeof(UT_hash_handle)) + \ + ((head)->hh.tbl->num_buckets * sizeof(UT_hash_bucket)) + \ + (sizeof(UT_hash_table)) + \ + (HASH_BLOOM_BYTELEN))) + +#ifdef NO_DECLTYPE +#define HASH_ITER(hh,head,el,tmp) \ +for((el)=(head), (*(char**)(&(tmp)))=(char*)((head)?(head)->hh.next:NULL); \ + el; (el)=(tmp),(*(char**)(&(tmp)))=(char*)((tmp)?(tmp)->hh.next:NULL)) +#else +#define HASH_ITER(hh,head,el,tmp) \ +for((el)=(head),(tmp)=DECLTYPE(el)((head)?(head)->hh.next:NULL); \ + el; (el)=(tmp),(tmp)=DECLTYPE(el)((tmp)?(tmp)->hh.next:NULL)) +#endif + +/* obtain a count of items in the hash */ +#define HASH_COUNT(head) HASH_CNT(hh,head) +#define HASH_CNT(hh,head) ((head)?((head)->hh.tbl->num_items):0) + +typedef struct UT_hash_bucket { + struct UT_hash_handle *hh_head; + unsigned count; + + /* expand_mult is normally set to 0. In this situation, the max chain length + * threshold is enforced at its default value, HASH_BKT_CAPACITY_THRESH. (If + * the bucket's chain exceeds this length, bucket expansion is triggered). + * However, setting expand_mult to a non-zero value delays bucket expansion + * (that would be triggered by additions to this particular bucket) + * until its chain length reaches a *multiple* of HASH_BKT_CAPACITY_THRESH. + * (The multiplier is simply expand_mult+1). The whole idea of this + * multiplier is to reduce bucket expansions, since they are expensive, in + * situations where we know that a particular bucket tends to be overused. + * It is better to let its chain length grow to a longer yet-still-bounded + * value, than to do an O(n) bucket expansion too often. + */ + unsigned expand_mult; + +} UT_hash_bucket; + +/* random signature used only to find hash tables in external analysis */ +#define HASH_SIGNATURE 0xa0111fe1 +#define HASH_BLOOM_SIGNATURE 0xb12220f2 + +typedef struct UT_hash_table { + UT_hash_bucket *buckets; + unsigned num_buckets, log2_num_buckets; + unsigned num_items; + struct UT_hash_handle *tail; /* tail hh in app order, for fast append */ + ptrdiff_t hho; /* hash handle offset (byte pos of hash handle in element */ + + /* in an ideal situation (all buckets used equally), no bucket would have + * more than ceil(#items/#buckets) items. that's the ideal chain length. */ + unsigned ideal_chain_maxlen; + + /* nonideal_items is the number of items in the hash whose chain position + * exceeds the ideal chain maxlen. these items pay the penalty for an uneven + * hash distribution; reaching them in a chain traversal takes >ideal steps */ + unsigned nonideal_items; + + /* ineffective expands occur when a bucket doubling was performed, but + * afterward, more than half the items in the hash had nonideal chain + * positions. If this happens on two consecutive expansions we inhibit any + * further expansion, as it's not helping; this happens when the hash + * function isn't a good fit for the key domain. When expansion is inhibited + * the hash will still work, albeit no longer in constant time. */ + unsigned ineff_expands, noexpand; + + uint32_t signature; /* used only to find hash tables in external analysis */ +#ifdef HASH_BLOOM + uint32_t bloom_sig; /* used only to test bloom exists in external analysis */ + uint8_t *bloom_bv; + char bloom_nbits; +#endif + +} UT_hash_table; + +typedef struct UT_hash_handle { + struct UT_hash_table *tbl; + void *prev; /* prev element in app order */ + void *next; /* next element in app order */ + struct UT_hash_handle *hh_prev; /* previous hh in bucket order */ + struct UT_hash_handle *hh_next; /* next hh in bucket order */ + void *key; /* ptr to enclosing struct's key */ + unsigned keylen; /* enclosing struct's key len */ + unsigned hashv; /* result of hash-fcn(key) */ +} UT_hash_handle; + +#endif /* UTHASH_H */ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/deps/utlist.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/deps/utlist.h new file mode 100644 index 0000000..5bb1ac9 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/deps/utlist.h @@ -0,0 +1,1073 @@ +/* +Copyright (c) 2007-2018, Troy D. Hanson http://troydhanson.github.com/uthash/ +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef UTLIST_H +#define UTLIST_H + +#define UTLIST_VERSION 2.1.0 + +#include <assert.h> + +/* + * This file contains macros to manipulate singly and doubly-linked lists. + * + * 1. LL_ macros: singly-linked lists. + * 2. DL_ macros: doubly-linked lists. + * 3. CDL_ macros: circular doubly-linked lists. + * + * To use singly-linked lists, your structure must have a "next" pointer. + * To use doubly-linked lists, your structure must "prev" and "next" pointers. + * Either way, the pointer to the head of the list must be initialized to NULL. + * + * ----------------.EXAMPLE ------------------------- + * struct item { + * int id; + * struct item *prev, *next; + * } + * + * struct item *list = NULL: + * + * int main() { + * struct item *item; + * ... allocate and populate item ... + * DL_APPEND(list, item); + * } + * -------------------------------------------------- + * + * For doubly-linked lists, the append and delete macros are O(1) + * For singly-linked lists, append and delete are O(n) but prepend is O(1) + * The sort macro is O(n log(n)) for all types of single/double/circular lists. + */ + +/* These macros use decltype or the earlier __typeof GNU extension. + As decltype is only available in newer compilers (VS2010 or gcc 4.3+ + when compiling c++ source) this code uses whatever method is needed + or, for VS2008 where neither is available, uses casting workarounds. */ +#if !defined(LDECLTYPE) && !defined(NO_DECLTYPE) +#if defined(_MSC_VER) /* MS compiler */ +#if _MSC_VER >= 1600 && defined(__cplusplus) /* VS2010 or newer in C++ mode */ +#define LDECLTYPE(x) decltype(x) +#else /* VS2008 or older (or VS2010 in C mode) */ +#define NO_DECLTYPE +#endif +#elif defined(__BORLANDC__) || defined(__ICCARM__) || defined(__LCC__) || defined(__WATCOMC__) +#define NO_DECLTYPE +#else /* GNU, Sun and other compilers */ +#define LDECLTYPE(x) __typeof(x) +#endif +#endif + +/* for VS2008 we use some workarounds to get around the lack of decltype, + * namely, we always reassign our tmp variable to the list head if we need + * to dereference its prev/next pointers, and save/restore the real head.*/ +#ifdef NO_DECLTYPE +#define IF_NO_DECLTYPE(x) x +#define LDECLTYPE(x) char* +#define UTLIST_SV(elt,list) _tmp = (char*)(list); {char **_alias = (char**)&(list); *_alias = (elt); } +#define UTLIST_NEXT(elt,list,next) ((char*)((list)->next)) +#define UTLIST_NEXTASGN(elt,list,to,next) { char **_alias = (char**)&((list)->next); *_alias=(char*)(to); } +/* #define UTLIST_PREV(elt,list,prev) ((char*)((list)->prev)) */ +#define UTLIST_PREVASGN(elt,list,to,prev) { char **_alias = (char**)&((list)->prev); *_alias=(char*)(to); } +#define UTLIST_RS(list) { char **_alias = (char**)&(list); *_alias=_tmp; } +#define UTLIST_CASTASGN(a,b) { char **_alias = (char**)&(a); *_alias=(char*)(b); } +#else +#define IF_NO_DECLTYPE(x) +#define UTLIST_SV(elt,list) +#define UTLIST_NEXT(elt,list,next) ((elt)->next) +#define UTLIST_NEXTASGN(elt,list,to,next) ((elt)->next)=(to) +/* #define UTLIST_PREV(elt,list,prev) ((elt)->prev) */ +#define UTLIST_PREVASGN(elt,list,to,prev) ((elt)->prev)=(to) +#define UTLIST_RS(list) +#define UTLIST_CASTASGN(a,b) (a)=(b) +#endif + +/****************************************************************************** + * The sort macro is an adaptation of Simon Tatham's O(n log(n)) mergesort * + * Unwieldy variable names used here to avoid shadowing passed-in variables. * + *****************************************************************************/ +#define LL_SORT(list, cmp) \ + LL_SORT2(list, cmp, next) + +#define LL_SORT2(list, cmp, next) \ +do { \ + LDECLTYPE(list) _ls_p; \ + LDECLTYPE(list) _ls_q; \ + LDECLTYPE(list) _ls_e; \ + LDECLTYPE(list) _ls_tail; \ + IF_NO_DECLTYPE(LDECLTYPE(list) _tmp;) \ + int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping; \ + if (list) { \ + _ls_insize = 1; \ + _ls_looping = 1; \ + while (_ls_looping) { \ + UTLIST_CASTASGN(_ls_p,list); \ + (list) = NULL; \ + _ls_tail = NULL; \ + _ls_nmerges = 0; \ + while (_ls_p) { \ + _ls_nmerges++; \ + _ls_q = _ls_p; \ + _ls_psize = 0; \ + for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ + _ls_psize++; \ + UTLIST_SV(_ls_q,list); _ls_q = UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); \ + if (!_ls_q) break; \ + } \ + _ls_qsize = _ls_insize; \ + while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) { \ + if (_ls_psize == 0) { \ + _ls_e = _ls_q; UTLIST_SV(_ls_q,list); _ls_q = \ + UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--; \ + } else if (_ls_qsize == 0 || !_ls_q) { \ + _ls_e = _ls_p; UTLIST_SV(_ls_p,list); _ls_p = \ + UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--; \ + } else if (cmp(_ls_p,_ls_q) <= 0) { \ + _ls_e = _ls_p; UTLIST_SV(_ls_p,list); _ls_p = \ + UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--; \ + } else { \ + _ls_e = _ls_q; UTLIST_SV(_ls_q,list); _ls_q = \ + UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--; \ + } \ + if (_ls_tail) { \ + UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,_ls_e,next); UTLIST_RS(list); \ + } else { \ + UTLIST_CASTASGN(list,_ls_e); \ + } \ + _ls_tail = _ls_e; \ + } \ + _ls_p = _ls_q; \ + } \ + if (_ls_tail) { \ + UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,NULL,next); UTLIST_RS(list); \ + } \ + if (_ls_nmerges <= 1) { \ + _ls_looping=0; \ + } \ + _ls_insize *= 2; \ + } \ + } \ +} while (0) + + +#define DL_SORT(list, cmp) \ + DL_SORT2(list, cmp, prev, next) + +#define DL_SORT2(list, cmp, prev, next) \ +do { \ + LDECLTYPE(list) _ls_p; \ + LDECLTYPE(list) _ls_q; \ + LDECLTYPE(list) _ls_e; \ + LDECLTYPE(list) _ls_tail; \ + IF_NO_DECLTYPE(LDECLTYPE(list) _tmp;) \ + int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping; \ + if (list) { \ + _ls_insize = 1; \ + _ls_looping = 1; \ + while (_ls_looping) { \ + UTLIST_CASTASGN(_ls_p,list); \ + (list) = NULL; \ + _ls_tail = NULL; \ + _ls_nmerges = 0; \ + while (_ls_p) { \ + _ls_nmerges++; \ + _ls_q = _ls_p; \ + _ls_psize = 0; \ + for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ + _ls_psize++; \ + UTLIST_SV(_ls_q,list); _ls_q = UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); \ + if (!_ls_q) break; \ + } \ + _ls_qsize = _ls_insize; \ + while ((_ls_psize > 0) || ((_ls_qsize > 0) && _ls_q)) { \ + if (_ls_psize == 0) { \ + _ls_e = _ls_q; UTLIST_SV(_ls_q,list); _ls_q = \ + UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--; \ + } else if ((_ls_qsize == 0) || (!_ls_q)) { \ + _ls_e = _ls_p; UTLIST_SV(_ls_p,list); _ls_p = \ + UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--; \ + } else if (cmp(_ls_p,_ls_q) <= 0) { \ + _ls_e = _ls_p; UTLIST_SV(_ls_p,list); _ls_p = \ + UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--; \ + } else { \ + _ls_e = _ls_q; UTLIST_SV(_ls_q,list); _ls_q = \ + UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--; \ + } \ + if (_ls_tail) { \ + UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,_ls_e,next); UTLIST_RS(list); \ + } else { \ + UTLIST_CASTASGN(list,_ls_e); \ + } \ + UTLIST_SV(_ls_e,list); UTLIST_PREVASGN(_ls_e,list,_ls_tail,prev); UTLIST_RS(list); \ + _ls_tail = _ls_e; \ + } \ + _ls_p = _ls_q; \ + } \ + UTLIST_CASTASGN((list)->prev, _ls_tail); \ + UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,NULL,next); UTLIST_RS(list); \ + if (_ls_nmerges <= 1) { \ + _ls_looping=0; \ + } \ + _ls_insize *= 2; \ + } \ + } \ +} while (0) + +#define CDL_SORT(list, cmp) \ + CDL_SORT2(list, cmp, prev, next) + +#define CDL_SORT2(list, cmp, prev, next) \ +do { \ + LDECLTYPE(list) _ls_p; \ + LDECLTYPE(list) _ls_q; \ + LDECLTYPE(list) _ls_e; \ + LDECLTYPE(list) _ls_tail; \ + LDECLTYPE(list) _ls_oldhead; \ + LDECLTYPE(list) _tmp; \ + int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping; \ + if (list) { \ + _ls_insize = 1; \ + _ls_looping = 1; \ + while (_ls_looping) { \ + UTLIST_CASTASGN(_ls_p,list); \ + UTLIST_CASTASGN(_ls_oldhead,list); \ + (list) = NULL; \ + _ls_tail = NULL; \ + _ls_nmerges = 0; \ + while (_ls_p) { \ + _ls_nmerges++; \ + _ls_q = _ls_p; \ + _ls_psize = 0; \ + for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ + _ls_psize++; \ + UTLIST_SV(_ls_q,list); \ + if (UTLIST_NEXT(_ls_q,list,next) == _ls_oldhead) { \ + _ls_q = NULL; \ + } else { \ + _ls_q = UTLIST_NEXT(_ls_q,list,next); \ + } \ + UTLIST_RS(list); \ + if (!_ls_q) break; \ + } \ + _ls_qsize = _ls_insize; \ + while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) { \ + if (_ls_psize == 0) { \ + _ls_e = _ls_q; UTLIST_SV(_ls_q,list); _ls_q = \ + UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--; \ + if (_ls_q == _ls_oldhead) { _ls_q = NULL; } \ + } else if (_ls_qsize == 0 || !_ls_q) { \ + _ls_e = _ls_p; UTLIST_SV(_ls_p,list); _ls_p = \ + UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--; \ + if (_ls_p == _ls_oldhead) { _ls_p = NULL; } \ + } else if (cmp(_ls_p,_ls_q) <= 0) { \ + _ls_e = _ls_p; UTLIST_SV(_ls_p,list); _ls_p = \ + UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--; \ + if (_ls_p == _ls_oldhead) { _ls_p = NULL; } \ + } else { \ + _ls_e = _ls_q; UTLIST_SV(_ls_q,list); _ls_q = \ + UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--; \ + if (_ls_q == _ls_oldhead) { _ls_q = NULL; } \ + } \ + if (_ls_tail) { \ + UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,_ls_e,next); UTLIST_RS(list); \ + } else { \ + UTLIST_CASTASGN(list,_ls_e); \ + } \ + UTLIST_SV(_ls_e,list); UTLIST_PREVASGN(_ls_e,list,_ls_tail,prev); UTLIST_RS(list); \ + _ls_tail = _ls_e; \ + } \ + _ls_p = _ls_q; \ + } \ + UTLIST_CASTASGN((list)->prev,_ls_tail); \ + UTLIST_CASTASGN(_tmp,list); \ + UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,_tmp,next); UTLIST_RS(list); \ + if (_ls_nmerges <= 1) { \ + _ls_looping=0; \ + } \ + _ls_insize *= 2; \ + } \ + } \ +} while (0) + +/****************************************************************************** + * singly linked list macros (non-circular) * + *****************************************************************************/ +#define LL_PREPEND(head,add) \ + LL_PREPEND2(head,add,next) + +#define LL_PREPEND2(head,add,next) \ +do { \ + (add)->next = (head); \ + (head) = (add); \ +} while (0) + +#define LL_CONCAT(head1,head2) \ + LL_CONCAT2(head1,head2,next) + +#define LL_CONCAT2(head1,head2,next) \ +do { \ + LDECLTYPE(head1) _tmp; \ + if (head1) { \ + _tmp = (head1); \ + while (_tmp->next) { _tmp = _tmp->next; } \ + _tmp->next=(head2); \ + } else { \ + (head1)=(head2); \ + } \ +} while (0) + +#define LL_APPEND(head,add) \ + LL_APPEND2(head,add,next) + +#define LL_APPEND2(head,add,next) \ +do { \ + LDECLTYPE(head) _tmp; \ + (add)->next=NULL; \ + if (head) { \ + _tmp = (head); \ + while (_tmp->next) { _tmp = _tmp->next; } \ + _tmp->next=(add); \ + } else { \ + (head)=(add); \ + } \ +} while (0) + +#define LL_INSERT_INORDER(head,add,cmp) \ + LL_INSERT_INORDER2(head,add,cmp,next) + +#define LL_INSERT_INORDER2(head,add,cmp,next) \ +do { \ + LDECLTYPE(head) _tmp; \ + if (head) { \ + LL_LOWER_BOUND2(head, _tmp, add, cmp, next); \ + LL_APPEND_ELEM2(head, _tmp, add, next); \ + } else { \ + (head) = (add); \ + (head)->next = NULL; \ + } \ +} while (0) + +#define LL_LOWER_BOUND(head,elt,like,cmp) \ + LL_LOWER_BOUND2(head,elt,like,cmp,next) + +#define LL_LOWER_BOUND2(head,elt,like,cmp,next) \ + do { \ + if ((head) == NULL || (cmp(head, like)) >= 0) { \ + (elt) = NULL; \ + } else { \ + for ((elt) = (head); (elt)->next != NULL; (elt) = (elt)->next) { \ + if (cmp((elt)->next, like) >= 0) { \ + break; \ + } \ + } \ + } \ + } while (0) + +#define LL_DELETE(head,del) \ + LL_DELETE2(head,del,next) + +#define LL_DELETE2(head,del,next) \ +do { \ + LDECLTYPE(head) _tmp; \ + if ((head) == (del)) { \ + (head)=(head)->next; \ + } else { \ + _tmp = (head); \ + while (_tmp->next && (_tmp->next != (del))) { \ + _tmp = _tmp->next; \ + } \ + if (_tmp->next) { \ + _tmp->next = (del)->next; \ + } \ + } \ +} while (0) + +#define LL_COUNT(head,el,counter) \ + LL_COUNT2(head,el,counter,next) \ + +#define LL_COUNT2(head,el,counter,next) \ +do { \ + (counter) = 0; \ + LL_FOREACH2(head,el,next) { ++(counter); } \ +} while (0) + +#define LL_FOREACH(head,el) \ + LL_FOREACH2(head,el,next) + +#define LL_FOREACH2(head,el,next) \ + for ((el) = (head); el; (el) = (el)->next) + +#define LL_FOREACH_SAFE(head,el,tmp) \ + LL_FOREACH_SAFE2(head,el,tmp,next) + +#define LL_FOREACH_SAFE2(head,el,tmp,next) \ + for ((el) = (head); (el) && ((tmp) = (el)->next, 1); (el) = (tmp)) + +#define LL_SEARCH_SCALAR(head,out,field,val) \ + LL_SEARCH_SCALAR2(head,out,field,val,next) + +#define LL_SEARCH_SCALAR2(head,out,field,val,next) \ +do { \ + LL_FOREACH2(head,out,next) { \ + if ((out)->field == (val)) break; \ + } \ +} while (0) + +#define LL_SEARCH(head,out,elt,cmp) \ + LL_SEARCH2(head,out,elt,cmp,next) + +#define LL_SEARCH2(head,out,elt,cmp,next) \ +do { \ + LL_FOREACH2(head,out,next) { \ + if ((cmp(out,elt))==0) break; \ + } \ +} while (0) + +#define LL_REPLACE_ELEM2(head, el, add, next) \ +do { \ + LDECLTYPE(head) _tmp; \ + assert((head) != NULL); \ + assert((el) != NULL); \ + assert((add) != NULL); \ + (add)->next = (el)->next; \ + if ((head) == (el)) { \ + (head) = (add); \ + } else { \ + _tmp = (head); \ + while (_tmp->next && (_tmp->next != (el))) { \ + _tmp = _tmp->next; \ + } \ + if (_tmp->next) { \ + _tmp->next = (add); \ + } \ + } \ +} while (0) + +#define LL_REPLACE_ELEM(head, el, add) \ + LL_REPLACE_ELEM2(head, el, add, next) + +#define LL_PREPEND_ELEM2(head, el, add, next) \ +do { \ + if (el) { \ + LDECLTYPE(head) _tmp; \ + assert((head) != NULL); \ + assert((add) != NULL); \ + (add)->next = (el); \ + if ((head) == (el)) { \ + (head) = (add); \ + } else { \ + _tmp = (head); \ + while (_tmp->next && (_tmp->next != (el))) { \ + _tmp = _tmp->next; \ + } \ + if (_tmp->next) { \ + _tmp->next = (add); \ + } \ + } \ + } else { \ + LL_APPEND2(head, add, next); \ + } \ +} while (0) \ + +#define LL_PREPEND_ELEM(head, el, add) \ + LL_PREPEND_ELEM2(head, el, add, next) + +#define LL_APPEND_ELEM2(head, el, add, next) \ +do { \ + if (el) { \ + assert((head) != NULL); \ + assert((add) != NULL); \ + (add)->next = (el)->next; \ + (el)->next = (add); \ + } else { \ + LL_PREPEND2(head, add, next); \ + } \ +} while (0) \ + +#define LL_APPEND_ELEM(head, el, add) \ + LL_APPEND_ELEM2(head, el, add, next) + +#ifdef NO_DECLTYPE +/* Here are VS2008 / NO_DECLTYPE replacements for a few functions */ + +#undef LL_CONCAT2 +#define LL_CONCAT2(head1,head2,next) \ +do { \ + char *_tmp; \ + if (head1) { \ + _tmp = (char*)(head1); \ + while ((head1)->next) { (head1) = (head1)->next; } \ + (head1)->next = (head2); \ + UTLIST_RS(head1); \ + } else { \ + (head1)=(head2); \ + } \ +} while (0) + +#undef LL_APPEND2 +#define LL_APPEND2(head,add,next) \ +do { \ + if (head) { \ + (add)->next = head; /* use add->next as a temp variable */ \ + while ((add)->next->next) { (add)->next = (add)->next->next; } \ + (add)->next->next=(add); \ + } else { \ + (head)=(add); \ + } \ + (add)->next=NULL; \ +} while (0) + +#undef LL_INSERT_INORDER2 +#define LL_INSERT_INORDER2(head,add,cmp,next) \ +do { \ + if ((head) == NULL || (cmp(head, add)) >= 0) { \ + (add)->next = (head); \ + (head) = (add); \ + } else { \ + char *_tmp = (char*)(head); \ + while ((head)->next != NULL && (cmp((head)->next, add)) < 0) { \ + (head) = (head)->next; \ + } \ + (add)->next = (head)->next; \ + (head)->next = (add); \ + UTLIST_RS(head); \ + } \ +} while (0) + +#undef LL_DELETE2 +#define LL_DELETE2(head,del,next) \ +do { \ + if ((head) == (del)) { \ + (head)=(head)->next; \ + } else { \ + char *_tmp = (char*)(head); \ + while ((head)->next && ((head)->next != (del))) { \ + (head) = (head)->next; \ + } \ + if ((head)->next) { \ + (head)->next = ((del)->next); \ + } \ + UTLIST_RS(head); \ + } \ +} while (0) + +#undef LL_REPLACE_ELEM2 +#define LL_REPLACE_ELEM2(head, el, add, next) \ +do { \ + assert((head) != NULL); \ + assert((el) != NULL); \ + assert((add) != NULL); \ + if ((head) == (el)) { \ + (head) = (add); \ + } else { \ + (add)->next = head; \ + while ((add)->next->next && ((add)->next->next != (el))) { \ + (add)->next = (add)->next->next; \ + } \ + if ((add)->next->next) { \ + (add)->next->next = (add); \ + } \ + } \ + (add)->next = (el)->next; \ +} while (0) + +#undef LL_PREPEND_ELEM2 +#define LL_PREPEND_ELEM2(head, el, add, next) \ +do { \ + if (el) { \ + assert((head) != NULL); \ + assert((add) != NULL); \ + if ((head) == (el)) { \ + (head) = (add); \ + } else { \ + (add)->next = (head); \ + while ((add)->next->next && ((add)->next->next != (el))) { \ + (add)->next = (add)->next->next; \ + } \ + if ((add)->next->next) { \ + (add)->next->next = (add); \ + } \ + } \ + (add)->next = (el); \ + } else { \ + LL_APPEND2(head, add, next); \ + } \ +} while (0) \ + +#endif /* NO_DECLTYPE */ + +/****************************************************************************** + * doubly linked list macros (non-circular) * + *****************************************************************************/ +#define DL_PREPEND(head,add) \ + DL_PREPEND2(head,add,prev,next) + +#define DL_PREPEND2(head,add,prev,next) \ +do { \ + (add)->next = (head); \ + if (head) { \ + (add)->prev = (head)->prev; \ + (head)->prev = (add); \ + } else { \ + (add)->prev = (add); \ + } \ + (head) = (add); \ +} while (0) + +#define DL_APPEND(head,add) \ + DL_APPEND2(head,add,prev,next) + +#define DL_APPEND2(head,add,prev,next) \ +do { \ + if (head) { \ + (add)->prev = (head)->prev; \ + (head)->prev->next = (add); \ + (head)->prev = (add); \ + (add)->next = NULL; \ + } else { \ + (head)=(add); \ + (head)->prev = (head); \ + (head)->next = NULL; \ + } \ +} while (0) + +#define DL_INSERT_INORDER(head,add,cmp) \ + DL_INSERT_INORDER2(head,add,cmp,prev,next) + +#define DL_INSERT_INORDER2(head,add,cmp,prev,next) \ +do { \ + LDECLTYPE(head) _tmp; \ + if (head) { \ + DL_LOWER_BOUND2(head, _tmp, add, cmp, next); \ + DL_APPEND_ELEM2(head, _tmp, add, prev, next); \ + } else { \ + (head) = (add); \ + (head)->prev = (head); \ + (head)->next = NULL; \ + } \ +} while (0) + +#define DL_LOWER_BOUND(head,elt,like,cmp) \ + DL_LOWER_BOUND2(head,elt,like,cmp,next) + +#define DL_LOWER_BOUND2(head,elt,like,cmp,next) \ +do { \ + if ((head) == NULL || (cmp(head, like)) >= 0) { \ + (elt) = NULL; \ + } else { \ + for ((elt) = (head); (elt)->next != NULL; (elt) = (elt)->next) { \ + if ((cmp((elt)->next, like)) >= 0) { \ + break; \ + } \ + } \ + } \ +} while (0) + +#define DL_CONCAT(head1,head2) \ + DL_CONCAT2(head1,head2,prev,next) + +#define DL_CONCAT2(head1,head2,prev,next) \ +do { \ + LDECLTYPE(head1) _tmp; \ + if (head2) { \ + if (head1) { \ + UTLIST_CASTASGN(_tmp, (head2)->prev); \ + (head2)->prev = (head1)->prev; \ + (head1)->prev->next = (head2); \ + UTLIST_CASTASGN((head1)->prev, _tmp); \ + } else { \ + (head1)=(head2); \ + } \ + } \ +} while (0) + +#define DL_DELETE(head,del) \ + DL_DELETE2(head,del,prev,next) + +#define DL_DELETE2(head,del,prev,next) \ +do { \ + assert((head) != NULL); \ + assert((del)->prev != NULL); \ + if ((del)->prev == (del)) { \ + (head)=NULL; \ + } else if ((del)==(head)) { \ + (del)->next->prev = (del)->prev; \ + (head) = (del)->next; \ + } else { \ + (del)->prev->next = (del)->next; \ + if ((del)->next) { \ + (del)->next->prev = (del)->prev; \ + } else { \ + (head)->prev = (del)->prev; \ + } \ + } \ +} while (0) + +#define DL_COUNT(head,el,counter) \ + DL_COUNT2(head,el,counter,next) \ + +#define DL_COUNT2(head,el,counter,next) \ +do { \ + (counter) = 0; \ + DL_FOREACH2(head,el,next) { ++(counter); } \ +} while (0) + +#define DL_FOREACH(head,el) \ + DL_FOREACH2(head,el,next) + +#define DL_FOREACH2(head,el,next) \ + for ((el) = (head); el; (el) = (el)->next) + +/* this version is safe for deleting the elements during iteration */ +#define DL_FOREACH_SAFE(head,el,tmp) \ + DL_FOREACH_SAFE2(head,el,tmp,next) + +#define DL_FOREACH_SAFE2(head,el,tmp,next) \ + for ((el) = (head); (el) && ((tmp) = (el)->next, 1); (el) = (tmp)) + +/* these are identical to their singly-linked list counterparts */ +#define DL_SEARCH_SCALAR LL_SEARCH_SCALAR +#define DL_SEARCH LL_SEARCH +#define DL_SEARCH_SCALAR2 LL_SEARCH_SCALAR2 +#define DL_SEARCH2 LL_SEARCH2 + +#define DL_REPLACE_ELEM2(head, el, add, prev, next) \ +do { \ + assert((head) != NULL); \ + assert((el) != NULL); \ + assert((add) != NULL); \ + if ((head) == (el)) { \ + (head) = (add); \ + (add)->next = (el)->next; \ + if ((el)->next == NULL) { \ + (add)->prev = (add); \ + } else { \ + (add)->prev = (el)->prev; \ + (add)->next->prev = (add); \ + } \ + } else { \ + (add)->next = (el)->next; \ + (add)->prev = (el)->prev; \ + (add)->prev->next = (add); \ + if ((el)->next == NULL) { \ + (head)->prev = (add); \ + } else { \ + (add)->next->prev = (add); \ + } \ + } \ +} while (0) + +#define DL_REPLACE_ELEM(head, el, add) \ + DL_REPLACE_ELEM2(head, el, add, prev, next) + +#define DL_PREPEND_ELEM2(head, el, add, prev, next) \ +do { \ + if (el) { \ + assert((head) != NULL); \ + assert((add) != NULL); \ + (add)->next = (el); \ + (add)->prev = (el)->prev; \ + (el)->prev = (add); \ + if ((head) == (el)) { \ + (head) = (add); \ + } else { \ + (add)->prev->next = (add); \ + } \ + } else { \ + DL_APPEND2(head, add, prev, next); \ + } \ +} while (0) \ + +#define DL_PREPEND_ELEM(head, el, add) \ + DL_PREPEND_ELEM2(head, el, add, prev, next) + +#define DL_APPEND_ELEM2(head, el, add, prev, next) \ +do { \ + if (el) { \ + assert((head) != NULL); \ + assert((add) != NULL); \ + (add)->next = (el)->next; \ + (add)->prev = (el); \ + (el)->next = (add); \ + if ((add)->next) { \ + (add)->next->prev = (add); \ + } else { \ + (head)->prev = (add); \ + } \ + } else { \ + DL_PREPEND2(head, add, prev, next); \ + } \ +} while (0) \ + +#define DL_APPEND_ELEM(head, el, add) \ + DL_APPEND_ELEM2(head, el, add, prev, next) + +#ifdef NO_DECLTYPE +/* Here are VS2008 / NO_DECLTYPE replacements for a few functions */ + +#undef DL_INSERT_INORDER2 +#define DL_INSERT_INORDER2(head,add,cmp,prev,next) \ +do { \ + if ((head) == NULL) { \ + (add)->prev = (add); \ + (add)->next = NULL; \ + (head) = (add); \ + } else if ((cmp(head, add)) >= 0) { \ + (add)->prev = (head)->prev; \ + (add)->next = (head); \ + (head)->prev = (add); \ + (head) = (add); \ + } else { \ + char *_tmp = (char*)(head); \ + while ((head)->next && (cmp((head)->next, add)) < 0) { \ + (head) = (head)->next; \ + } \ + (add)->prev = (head); \ + (add)->next = (head)->next; \ + (head)->next = (add); \ + UTLIST_RS(head); \ + if ((add)->next) { \ + (add)->next->prev = (add); \ + } else { \ + (head)->prev = (add); \ + } \ + } \ +} while (0) +#endif /* NO_DECLTYPE */ + +/****************************************************************************** + * circular doubly linked list macros * + *****************************************************************************/ +#define CDL_APPEND(head,add) \ + CDL_APPEND2(head,add,prev,next) + +#define CDL_APPEND2(head,add,prev,next) \ +do { \ + if (head) { \ + (add)->prev = (head)->prev; \ + (add)->next = (head); \ + (head)->prev = (add); \ + (add)->prev->next = (add); \ + } else { \ + (add)->prev = (add); \ + (add)->next = (add); \ + (head) = (add); \ + } \ +} while (0) + +#define CDL_PREPEND(head,add) \ + CDL_PREPEND2(head,add,prev,next) + +#define CDL_PREPEND2(head,add,prev,next) \ +do { \ + if (head) { \ + (add)->prev = (head)->prev; \ + (add)->next = (head); \ + (head)->prev = (add); \ + (add)->prev->next = (add); \ + } else { \ + (add)->prev = (add); \ + (add)->next = (add); \ + } \ + (head) = (add); \ +} while (0) + +#define CDL_INSERT_INORDER(head,add,cmp) \ + CDL_INSERT_INORDER2(head,add,cmp,prev,next) + +#define CDL_INSERT_INORDER2(head,add,cmp,prev,next) \ +do { \ + LDECLTYPE(head) _tmp; \ + if (head) { \ + CDL_LOWER_BOUND2(head, _tmp, add, cmp, next); \ + CDL_APPEND_ELEM2(head, _tmp, add, prev, next); \ + } else { \ + (head) = (add); \ + (head)->next = (head); \ + (head)->prev = (head); \ + } \ +} while (0) + +#define CDL_LOWER_BOUND(head,elt,like,cmp) \ + CDL_LOWER_BOUND2(head,elt,like,cmp,next) + +#define CDL_LOWER_BOUND2(head,elt,like,cmp,next) \ +do { \ + if ((head) == NULL || (cmp(head, like)) >= 0) { \ + (elt) = NULL; \ + } else { \ + for ((elt) = (head); (elt)->next != (head); (elt) = (elt)->next) { \ + if ((cmp((elt)->next, like)) >= 0) { \ + break; \ + } \ + } \ + } \ +} while (0) + +#define CDL_DELETE(head,del) \ + CDL_DELETE2(head,del,prev,next) + +#define CDL_DELETE2(head,del,prev,next) \ +do { \ + if (((head)==(del)) && ((head)->next == (head))) { \ + (head) = NULL; \ + } else { \ + (del)->next->prev = (del)->prev; \ + (del)->prev->next = (del)->next; \ + if ((del) == (head)) (head)=(del)->next; \ + } \ +} while (0) + +#define CDL_COUNT(head,el,counter) \ + CDL_COUNT2(head,el,counter,next) \ + +#define CDL_COUNT2(head, el, counter,next) \ +do { \ + (counter) = 0; \ + CDL_FOREACH2(head,el,next) { ++(counter); } \ +} while (0) + +#define CDL_FOREACH(head,el) \ + CDL_FOREACH2(head,el,next) + +#define CDL_FOREACH2(head,el,next) \ + for ((el)=(head);el;(el)=(((el)->next==(head)) ? NULL : (el)->next)) + +#define CDL_FOREACH_SAFE(head,el,tmp1,tmp2) \ + CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next) + +#define CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next) \ + for ((el) = (head), (tmp1) = (head) ? (head)->prev : NULL; \ + (el) && ((tmp2) = (el)->next, 1); \ + (el) = ((el) == (tmp1) ? NULL : (tmp2))) + +#define CDL_SEARCH_SCALAR(head,out,field,val) \ + CDL_SEARCH_SCALAR2(head,out,field,val,next) + +#define CDL_SEARCH_SCALAR2(head,out,field,val,next) \ +do { \ + CDL_FOREACH2(head,out,next) { \ + if ((out)->field == (val)) break; \ + } \ +} while (0) + +#define CDL_SEARCH(head,out,elt,cmp) \ + CDL_SEARCH2(head,out,elt,cmp,next) + +#define CDL_SEARCH2(head,out,elt,cmp,next) \ +do { \ + CDL_FOREACH2(head,out,next) { \ + if ((cmp(out,elt))==0) break; \ + } \ +} while (0) + +#define CDL_REPLACE_ELEM2(head, el, add, prev, next) \ +do { \ + assert((head) != NULL); \ + assert((el) != NULL); \ + assert((add) != NULL); \ + if ((el)->next == (el)) { \ + (add)->next = (add); \ + (add)->prev = (add); \ + (head) = (add); \ + } else { \ + (add)->next = (el)->next; \ + (add)->prev = (el)->prev; \ + (add)->next->prev = (add); \ + (add)->prev->next = (add); \ + if ((head) == (el)) { \ + (head) = (add); \ + } \ + } \ +} while (0) + +#define CDL_REPLACE_ELEM(head, el, add) \ + CDL_REPLACE_ELEM2(head, el, add, prev, next) + +#define CDL_PREPEND_ELEM2(head, el, add, prev, next) \ +do { \ + if (el) { \ + assert((head) != NULL); \ + assert((add) != NULL); \ + (add)->next = (el); \ + (add)->prev = (el)->prev; \ + (el)->prev = (add); \ + (add)->prev->next = (add); \ + if ((head) == (el)) { \ + (head) = (add); \ + } \ + } else { \ + CDL_APPEND2(head, add, prev, next); \ + } \ +} while (0) + +#define CDL_PREPEND_ELEM(head, el, add) \ + CDL_PREPEND_ELEM2(head, el, add, prev, next) + +#define CDL_APPEND_ELEM2(head, el, add, prev, next) \ +do { \ + if (el) { \ + assert((head) != NULL); \ + assert((add) != NULL); \ + (add)->next = (el)->next; \ + (add)->prev = (el); \ + (el)->next = (add); \ + (add)->next->prev = (add); \ + } else { \ + CDL_PREPEND2(head, add, prev, next); \ + } \ +} while (0) + +#define CDL_APPEND_ELEM(head, el, add) \ + CDL_APPEND_ELEM2(head, el, add, prev, next) + +#ifdef NO_DECLTYPE +/* Here are VS2008 / NO_DECLTYPE replacements for a few functions */ + +#undef CDL_INSERT_INORDER2 +#define CDL_INSERT_INORDER2(head,add,cmp,prev,next) \ +do { \ + if ((head) == NULL) { \ + (add)->prev = (add); \ + (add)->next = (add); \ + (head) = (add); \ + } else if ((cmp(head, add)) >= 0) { \ + (add)->prev = (head)->prev; \ + (add)->next = (head); \ + (add)->prev->next = (add); \ + (head)->prev = (add); \ + (head) = (add); \ + } else { \ + char *_tmp = (char*)(head); \ + while ((char*)(head)->next != _tmp && (cmp((head)->next, add)) < 0) { \ + (head) = (head)->next; \ + } \ + (add)->prev = (head); \ + (add)->next = (head)->next; \ + (add)->next->prev = (add); \ + (head)->next = (add); \ + UTLIST_RS(head); \ + } \ +} while (0) +#endif /* NO_DECLTYPE */ + +#endif /* UTLIST_H */ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_auth.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_auth.c new file mode 100644 index 0000000..03bf477 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_auth.c @@ -0,0 +1,148 @@ +/* +Copyright (c) 2018-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <stdio.h> +#include <string.h> + +#include "mosquitto_broker_internal.h" +#include "mqtt_protocol.h" +#include "memory_mosq.h" +#include "packet_mosq.h" +#include "property_mosq.h" +#include "send_mosq.h" +#include "will_mosq.h" + + +int handle__auth(struct mosquitto_db *db, struct mosquitto *context) +{ + int rc = 0; + uint8_t reason_code = 0; + mosquitto_property *properties = NULL; + char *auth_method = NULL; + void *auth_data = NULL; + uint16_t auth_data_len = 0; + void *auth_data_out = NULL; + uint16_t auth_data_out_len = 0; + + if(!context) return MOSQ_ERR_INVAL; + + if(context->protocol != mosq_p_mqtt5 || context->auth_method == NULL){ + return MOSQ_ERR_PROTOCOL; + } + + if(context->in_packet.remaining_length > 0){ + if(packet__read_byte(&context->in_packet, &reason_code)) return 1; + if(reason_code != MQTT_RC_CONTINUE_AUTHENTICATION + && reason_code != MQTT_RC_REAUTHENTICATE){ + + send__disconnect(context, MQTT_RC_PROTOCOL_ERROR, NULL); + return MOSQ_ERR_PROTOCOL; + } + + if((reason_code == MQTT_RC_REAUTHENTICATE && context->state != mosq_cs_connected) + || (reason_code == MQTT_RC_CONTINUE_AUTHENTICATION + && context->state != mosq_cs_authenticating && context->state != mosq_cs_reauthenticating)){ + + send__disconnect(context, MQTT_RC_PROTOCOL_ERROR, NULL); + return MOSQ_ERR_PROTOCOL; + } + + rc = property__read_all(CMD_AUTH, &context->in_packet, &properties); + if(rc){ + send__disconnect(context, MQTT_RC_UNSPECIFIED, NULL); + return rc; + } + + + if(mosquitto_property_read_string(properties, MQTT_PROP_AUTHENTICATION_METHOD, &auth_method, false) == NULL){ + mosquitto_property_free_all(&properties); + send__disconnect(context, MQTT_RC_UNSPECIFIED, NULL); + return MOSQ_ERR_PROTOCOL; + } + + if(!auth_method || strcmp(auth_method, context->auth_method)){ + /* No method, or non-matching method */ + mosquitto__free(auth_method); + mosquitto_property_free_all(&properties); + send__disconnect(context, MQTT_RC_PROTOCOL_ERROR, NULL); + return MOSQ_ERR_PROTOCOL; + } + mosquitto__free(auth_method); + + mosquitto_property_read_binary(properties, MQTT_PROP_AUTHENTICATION_DATA, &auth_data, &auth_data_len, false); + + mosquitto_property_free_all(&properties); /* FIXME - TEMPORARY UNTIL PROPERTIES PROCESSED */ + } + + log__printf(NULL, MOSQ_LOG_DEBUG, "Received AUTH from %s (rc%d, %s)", context->id, reason_code, context->auth_method); + + + if(reason_code == MQTT_RC_REAUTHENTICATE){ + /* This is a re-authentication attempt */ + context__set_state(context, mosq_cs_reauthenticating); + rc = mosquitto_security_auth_start(db, context, true, auth_data, auth_data_len, &auth_data_out, &auth_data_out_len); + }else{ + if(context->state != mosq_cs_reauthenticating){ + context__set_state(context, mosq_cs_authenticating); + } + rc = mosquitto_security_auth_continue(db, context, auth_data, auth_data_len, &auth_data_out, &auth_data_out_len); + } + mosquitto__free(auth_data); + if(rc == MOSQ_ERR_SUCCESS){ + if(context->state == mosq_cs_authenticating){ + return connect__on_authorised(db, context, auth_data_out, auth_data_out_len); + }else{ + context__set_state(context, mosq_cs_connected); + rc = send__auth(db, context, MQTT_RC_SUCCESS, auth_data_out, auth_data_out_len); + free(auth_data_out); + return rc; + } + }else if(rc == MOSQ_ERR_AUTH_CONTINUE){ + rc = send__auth(db, context, MQTT_RC_CONTINUE_AUTHENTICATION, auth_data_out, auth_data_out_len); + free(auth_data_out); + return rc; + }else{ + free(auth_data_out); + if(context->state == mosq_cs_authenticating && context->will){ + /* Free will without sending if this is our first authentication attempt */ + will__clear(context); + } + if(rc == MOSQ_ERR_AUTH){ + send__connack(db, context, 0, MQTT_RC_NOT_AUTHORIZED, NULL); + if(context->state == mosq_cs_authenticating){ + mosquitto__free(context->id); + context->id = NULL; + } + return MOSQ_ERR_PROTOCOL; + }else if(rc == MOSQ_ERR_NOT_SUPPORTED){ + /* Client has requested extended authentication, but we don't support it. */ + send__connack(db, context, 0, MQTT_RC_BAD_AUTHENTICATION_METHOD, NULL); + if(context->state == mosq_cs_authenticating){ + mosquitto__free(context->id); + context->id = NULL; + } + return MOSQ_ERR_PROTOCOL; + }else{ + if(context->state == mosq_cs_authenticating){ + mosquitto__free(context->id); + context->id = NULL; + } + return rc; + } + } +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_connack.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_connack.c new file mode 100644 index 0000000..ac08d88 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_connack.c @@ -0,0 +1,137 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <stdio.h> +#include <string.h> + +#include "mosquitto_broker_internal.h" +#include "memory_mosq.h" +#include "mqtt_protocol.h" +#include "packet_mosq.h" +#include "send_mosq.h" +#include "util_mosq.h" + +int handle__connack(struct mosquitto_db *db, struct mosquitto *context) +{ + int rc; + uint8_t connect_acknowledge; + uint8_t reason_code; + int i; + char *notification_topic; + int notification_topic_len; + char notification_payload; + mosquitto_property *properties = NULL; + + if(!context){ + return MOSQ_ERR_INVAL; + } + log__printf(NULL, MOSQ_LOG_DEBUG, "Received CONNACK on connection %s.", context->id); + if(packet__read_byte(&context->in_packet, &connect_acknowledge)) return 1; + if(packet__read_byte(&context->in_packet, &reason_code)) return 1; + + if(context->protocol == mosq_p_mqtt5){ + rc = property__read_all(CMD_CONNACK, &context->in_packet, &properties); + if(rc) return rc; + mosquitto_property_free_all(&properties); + } + mosquitto_property_free_all(&properties); /* FIXME - TEMPORARY UNTIL PROPERTIES PROCESSED */ + + switch(reason_code){ + case CONNACK_ACCEPTED: + if(context->bridge){ + if(context->bridge->notifications){ + notification_payload = '1'; + if(context->bridge->notification_topic){ + if(!context->bridge->notifications_local_only){ + if(send__real_publish(context, mosquitto__mid_generate(context), + context->bridge->notification_topic, 1, ¬ification_payload, 1, true, 0, NULL, NULL, 0)){ + + return 1; + } + } + db__messages_easy_queue(db, context, context->bridge->notification_topic, 1, 1, ¬ification_payload, 1, 0, NULL); + }else{ + notification_topic_len = strlen(context->bridge->remote_clientid)+strlen("$SYS/broker/connection//state"); + notification_topic = mosquitto__malloc(sizeof(char)*(notification_topic_len+1)); + if(!notification_topic) return MOSQ_ERR_NOMEM; + + snprintf(notification_topic, notification_topic_len+1, "$SYS/broker/connection/%s/state", context->bridge->remote_clientid); + notification_payload = '1'; + if(!context->bridge->notifications_local_only){ + if(send__real_publish(context, mosquitto__mid_generate(context), + notification_topic, 1, ¬ification_payload, 1, true, 0, NULL, NULL, 0)){ + + mosquitto__free(notification_topic); + return 1; + } + } + db__messages_easy_queue(db, context, notification_topic, 1, 1, ¬ification_payload, 1, 0, NULL); + mosquitto__free(notification_topic); + } + } + for(i=0; i<context->bridge->topic_count; i++){ + if(context->bridge->topics[i].direction == bd_in || context->bridge->topics[i].direction == bd_both){ + if(send__subscribe(context, NULL, 1, &context->bridge->topics[i].remote_topic, context->bridge->topics[i].qos, NULL)){ + return 1; + } + }else{ + if(context->bridge->attempt_unsubscribe){ + if(send__unsubscribe(context, NULL, 1, &context->bridge->topics[i].remote_topic, NULL)){ + /* direction = inwards only. This means we should not be subscribed + * to the topic. It is possible that we used to be subscribed to + * this topic so unsubscribe. */ + return 1; + } + } + } + } + for(i=0; i<context->bridge->topic_count; i++){ + if(context->bridge->topics[i].direction == bd_out || context->bridge->topics[i].direction == bd_both){ + sub__retain_queue(db, context, + context->bridge->topics[i].local_topic, + context->bridge->topics[i].qos, 0); + } + } + } + context__set_state(context, mosq_cs_connected); + return MOSQ_ERR_SUCCESS; + case CONNACK_REFUSED_PROTOCOL_VERSION: + if(context->bridge){ + context->bridge->try_private_accepted = false; + } + log__printf(NULL, MOSQ_LOG_ERR, "Connection Refused: unacceptable protocol version"); + return 1; + case CONNACK_REFUSED_IDENTIFIER_REJECTED: + log__printf(NULL, MOSQ_LOG_ERR, "Connection Refused: identifier rejected"); + return 1; + case CONNACK_REFUSED_SERVER_UNAVAILABLE: + log__printf(NULL, MOSQ_LOG_ERR, "Connection Refused: broker unavailable"); + return 1; + case CONNACK_REFUSED_BAD_USERNAME_PASSWORD: + log__printf(NULL, MOSQ_LOG_ERR, "Connection Refused: broker unavailable"); + return 1; + case CONNACK_REFUSED_NOT_AUTHORIZED: + log__printf(NULL, MOSQ_LOG_ERR, "Connection Refused: not authorised"); + return 1; + default: + log__printf(NULL, MOSQ_LOG_ERR, "Connection Refused: unknown reason"); + return 1; + } + return 1; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_connect.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_connect.c new file mode 100644 index 0000000..9de98dd --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_connect.c @@ -0,0 +1,883 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <stdio.h> +#include <string.h> +#include <utlist.h> + +#include "mosquitto_broker_internal.h" +#include "mqtt_protocol.h" +#include "memory_mosq.h" +#include "packet_mosq.h" +#include "property_mosq.h" +#include "send_mosq.h" +#include "sys_tree.h" +#include "time_mosq.h" +#include "tls_mosq.h" +#include "util_mosq.h" +#include "will_mosq.h" + +#ifdef WITH_WEBSOCKETS +# include <libwebsockets.h> +#endif + + +static char nibble_to_hex(uint8_t value) +{ + if(value < 0x0A){ + return '0'+value; + }else{ + return 'A'+value-0x0A; + } +} + +static char *client_id_gen(int *idlen, const char *auto_id_prefix, int auto_id_prefix_len) +{ + char *client_id; + uint8_t rnd[16]; + int i; + int pos; + + if(util__random_bytes(rnd, 16)) return NULL; + + *idlen = 36 + auto_id_prefix_len; + + client_id = (char *)mosquitto__calloc((*idlen) + 1, sizeof(char)); + if(!client_id){ + return NULL; + } + if(auto_id_prefix){ + memcpy(client_id, auto_id_prefix, auto_id_prefix_len); + } + + pos = 0; + for(i=0; i<16; i++){ + client_id[auto_id_prefix_len + pos + 0] = nibble_to_hex(rnd[i] & 0x0F); + client_id[auto_id_prefix_len + pos + 1] = nibble_to_hex((rnd[i] >> 4) & 0x0F); + pos += 2; + if(pos == 8 || pos == 13 || pos == 18 || pos == 23){ + client_id[auto_id_prefix_len + pos] = '-'; + pos++; + } + } + + return client_id; +} + +/* Remove any queued messages that are no longer allowed through ACL, + * assuming a possible change of username. */ +void connection_check_acl(struct mosquitto_db *db, struct mosquitto *context, struct mosquitto_client_msg **head) +{ + struct mosquitto_client_msg *msg_tail, *tmp; + + DL_FOREACH_SAFE((*head), msg_tail, tmp){ + if(msg_tail->direction == mosq_md_out){ + if(mosquitto_acl_check(db, context, msg_tail->store->topic, + msg_tail->store->payloadlen, UHPA_ACCESS(msg_tail->store->payload, msg_tail->store->payloadlen), + msg_tail->store->qos, msg_tail->store->retain, MOSQ_ACL_READ) != MOSQ_ERR_SUCCESS){ + + DL_DELETE((*head), msg_tail); + db__msg_store_ref_dec(db, &msg_tail->store); + mosquitto_property_free_all(&msg_tail->properties); + mosquitto__free(msg_tail); + } + } + } +} + + +int connect__on_authorised(struct mosquitto_db *db, struct mosquitto *context, void *auth_data_out, uint16_t auth_data_out_len) +{ + struct mosquitto *found_context; + struct mosquitto__subleaf *leaf; + mosquitto_property *connack_props = NULL; + uint8_t connect_ack = 0; + int i; + int rc; + + /* Find if this client already has an entry. This must be done *after* any security checks. */ + HASH_FIND(hh_id, db->contexts_by_id, context->id, strlen(context->id), found_context); + if(found_context){ + /* Found a matching client */ + if(found_context->sock == INVALID_SOCKET){ + /* Client is reconnecting after a disconnect */ + /* FIXME - does anything need to be done here? */ + }else{ + /* Client is already connected, disconnect old version. This is + * done in context__cleanup() below. */ + if(db->config->connection_messages == true){ + log__printf(NULL, MOSQ_LOG_ERR, "Client %s already connected, closing old connection.", context->id); + } + } + + if(context->clean_start == false && found_context->session_expiry_interval > 0){ + if(context->protocol == mosq_p_mqtt311 || context->protocol == mosq_p_mqtt5){ + connect_ack |= 0x01; + } + + if(found_context->msgs_in.inflight || found_context->msgs_in.queued + || found_context->msgs_out.inflight || found_context->msgs_out.queued){ + + memcpy(&context->msgs_in, &found_context->msgs_in, sizeof(struct mosquitto_msg_data)); + memcpy(&context->msgs_out, &found_context->msgs_out, sizeof(struct mosquitto_msg_data)); + + memset(&found_context->msgs_in, 0, sizeof(struct mosquitto_msg_data)); + memset(&found_context->msgs_out, 0, sizeof(struct mosquitto_msg_data)); + + db__message_reconnect_reset(db, context); + } + context->subs = found_context->subs; + found_context->subs = NULL; + context->sub_count = found_context->sub_count; + found_context->sub_count = 0; + context->last_mid = found_context->last_mid; + + for(i=0; i<context->sub_count; i++){ + if(context->subs[i]){ + leaf = context->subs[i]->subs; + while(leaf){ + if(leaf->context == found_context){ + leaf->context = context; + } + leaf = leaf->next; + } + } + } + } + + session_expiry__remove(found_context); + will_delay__remove(found_context); + will__clear(found_context); + + found_context->clean_start = true; + found_context->session_expiry_interval = 0; + context__set_state(found_context, mosq_cs_duplicate); + do_disconnect(db, found_context, MOSQ_ERR_SUCCESS); + } + + rc = acl__find_acls(db, context); + if(rc){ + free(auth_data_out); + return rc; + } + + if(db->config->connection_messages == true){ + if(context->is_bridge){ + if(context->username){ + log__printf(NULL, MOSQ_LOG_NOTICE, "New bridge connected from %s as %s (p%d, c%d, k%d, u'%s').", + context->address, context->id, context->protocol, context->clean_start, context->keepalive, context->username); + }else{ + log__printf(NULL, MOSQ_LOG_NOTICE, "New bridge connected from %s as %s (p%d, c%d, k%d).", + context->address, context->id, context->protocol, context->clean_start, context->keepalive); + } + }else{ + if(context->username){ + log__printf(NULL, MOSQ_LOG_NOTICE, "New client connected from %s as %s (p%d, c%d, k%d, u'%s').", + context->address, context->id, context->protocol, context->clean_start, context->keepalive, context->username); + }else{ + log__printf(NULL, MOSQ_LOG_NOTICE, "New client connected from %s as %s (p%d, c%d, k%d).", + context->address, context->id, context->protocol, context->clean_start, context->keepalive); + } + } + + if(context->will) { + log__printf(NULL, MOSQ_LOG_DEBUG, "Will message specified (%ld bytes) (r%d, q%d).", + (long)context->will->msg.payloadlen, + context->will->msg.retain, + context->will->msg.qos); + + log__printf(NULL, MOSQ_LOG_DEBUG, "\t%s", context->will->msg.topic); + } else { + log__printf(NULL, MOSQ_LOG_DEBUG, "No will message specified."); + } + } + + context->ping_t = 0; + context->is_dropping = false; + + connection_check_acl(db, context, &context->msgs_in.inflight); + connection_check_acl(db, context, &context->msgs_in.queued); + connection_check_acl(db, context, &context->msgs_out.inflight); + connection_check_acl(db, context, &context->msgs_out.queued); + + HASH_ADD_KEYPTR(hh_id, db->contexts_by_id, context->id, strlen(context->id), context); + +#ifdef WITH_PERSISTENCE + if(!context->clean_start){ + db->persistence_changes++; + } +#endif + context->maximum_qos = context->listener->maximum_qos; + + if(context->protocol == mosq_p_mqtt5){ + if(context->maximum_qos != 2){ + if(mosquitto_property_add_byte(&connack_props, MQTT_PROP_MAXIMUM_QOS, context->maximum_qos)){ + rc = MOSQ_ERR_NOMEM; + goto error; + } + } + if(context->listener->max_topic_alias > 0){ + if(mosquitto_property_add_int16(&connack_props, MQTT_PROP_TOPIC_ALIAS_MAXIMUM, context->listener->max_topic_alias)){ + rc = MOSQ_ERR_NOMEM; + goto error; + } + } + if(context->keepalive > db->config->max_keepalive){ + context->keepalive = db->config->max_keepalive; + if(mosquitto_property_add_int16(&connack_props, MQTT_PROP_SERVER_KEEP_ALIVE, context->keepalive)){ + rc = MOSQ_ERR_NOMEM; + goto error; + } + } + if(context->assigned_id){ + if(mosquitto_property_add_string(&connack_props, MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER, context->id)){ + rc = MOSQ_ERR_NOMEM; + goto error; + } + } + if(context->auth_method){ + if(mosquitto_property_add_string(&connack_props, MQTT_PROP_AUTHENTICATION_METHOD, context->auth_method)){ + rc = MOSQ_ERR_NOMEM; + goto error; + } + + if(auth_data_out && auth_data_out_len > 0){ + if(mosquitto_property_add_binary(&connack_props, MQTT_PROP_AUTHENTICATION_DATA, auth_data_out, auth_data_out_len)){ + rc = MOSQ_ERR_NOMEM; + goto error; + } + } + } + } + free(auth_data_out); + + context__set_state(context, mosq_cs_connected); + rc = send__connack(db, context, connect_ack, CONNACK_ACCEPTED, connack_props); + mosquitto_property_free_all(&connack_props); + return rc; +error: + free(auth_data_out); + mosquitto_property_free_all(&connack_props); + return rc; +} + + +static int will__read(struct mosquitto *context, struct mosquitto_message_all **will, uint8_t will_qos, int will_retain) +{ + int rc = MOSQ_ERR_SUCCESS; + int slen; + struct mosquitto_message_all *will_struct = NULL; + char *will_topic_mount = NULL; + uint16_t payloadlen; + mosquitto_property *properties = NULL; + + will_struct = mosquitto__calloc(1, sizeof(struct mosquitto_message_all)); + if(!will_struct){ + rc = MOSQ_ERR_NOMEM; + goto error_cleanup; + } + if(context->protocol == PROTOCOL_VERSION_v5){ + rc = property__read_all(CMD_WILL, &context->in_packet, &properties); + if(rc) goto error_cleanup; + + rc = property__process_will(context, will_struct, &properties); + mosquitto_property_free_all(&properties); + if(rc) goto error_cleanup; + } + rc = packet__read_string(&context->in_packet, &will_struct->msg.topic, &slen); + if(rc) goto error_cleanup; + if(!slen){ + rc = MOSQ_ERR_PROTOCOL; + goto error_cleanup; + } + + if(context->listener->mount_point){ + slen = strlen(context->listener->mount_point) + strlen(will_struct->msg.topic) + 1; + will_topic_mount = mosquitto__malloc(slen+1); + if(!will_topic_mount){ + rc = MOSQ_ERR_NOMEM; + goto error_cleanup; + } + + snprintf(will_topic_mount, slen, "%s%s", context->listener->mount_point, will_struct->msg.topic); + will_topic_mount[slen] = '\0'; + + mosquitto__free(will_struct->msg.topic); + will_struct->msg.topic = will_topic_mount; + } + + rc = mosquitto_pub_topic_check(will_struct->msg.topic); + if(rc) goto error_cleanup; + + rc = packet__read_uint16(&context->in_packet, &payloadlen); + if(rc) goto error_cleanup; + + will_struct->msg.payloadlen = payloadlen; + if(will_struct->msg.payloadlen > 0){ + will_struct->msg.payload = mosquitto__malloc(will_struct->msg.payloadlen); + if(!will_struct->msg.payload){ + rc = MOSQ_ERR_NOMEM; + goto error_cleanup; + } + + rc = packet__read_bytes(&context->in_packet, will_struct->msg.payload, will_struct->msg.payloadlen); + if(rc) goto error_cleanup; + } + + will_struct->msg.qos = will_qos; + will_struct->msg.retain = will_retain; + + *will = will_struct; + return MOSQ_ERR_SUCCESS; + +error_cleanup: + if(will_struct){ + mosquitto__free(will_struct->msg.topic); + mosquitto__free(will_struct->msg.payload); + mosquitto_property_free_all(&will_struct->properties); + mosquitto__free(will_struct); + } + return rc; +} + + + +int handle__connect(struct mosquitto_db *db, struct mosquitto *context) +{ + char protocol_name[7]; + uint8_t protocol_version; + uint8_t connect_flags; + char *client_id = NULL; + struct mosquitto_message_all *will_struct = NULL; + uint8_t will, will_retain, will_qos, clean_start; + uint8_t username_flag, password_flag; + char *username = NULL, *password = NULL; + int rc; + int slen; + uint16_t slen16; + mosquitto_property *properties = NULL; + void *auth_data = NULL; + uint16_t auth_data_len = 0; + void *auth_data_out = NULL; + uint16_t auth_data_out_len = 0; +#ifdef WITH_TLS + int i; + X509 *client_cert = NULL; + X509_NAME *name; + X509_NAME_ENTRY *name_entry; + ASN1_STRING *name_asn1 = NULL; +#endif + + G_CONNECTION_COUNT_INC(); + + if(!context->listener){ + return MOSQ_ERR_INVAL; + } + + /* Don't accept multiple CONNECT commands. */ + if(context->state != mosq_cs_new){ + log__printf(NULL, MOSQ_LOG_NOTICE, "Bad client %s sending multiple CONNECT messages.", context->id); + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + + /* Read protocol name as length then bytes rather than with read_string + * because the length is fixed and we can check that. Removes the need + * for another malloc as well. */ + if(packet__read_uint16(&context->in_packet, &slen16)){ + rc = 1; + goto handle_connect_error; + } + slen = slen16; + if(slen != 4 /* MQTT */ && slen != 6 /* MQIsdp */){ + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + if(packet__read_bytes(&context->in_packet, protocol_name, slen)){ + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + protocol_name[slen] = '\0'; + + if(packet__read_byte(&context->in_packet, &protocol_version)){ + rc = 1; + goto handle_connect_error; + } + if(!strcmp(protocol_name, PROTOCOL_NAME_v31)){ + if((protocol_version&0x7F) != PROTOCOL_VERSION_v31){ + if(db->config->connection_messages == true){ + log__printf(NULL, MOSQ_LOG_INFO, "Invalid protocol version %d in CONNECT from %s.", + protocol_version, context->address); + } + send__connack(db, context, 0, CONNACK_REFUSED_PROTOCOL_VERSION, NULL); + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + context->protocol = mosq_p_mqtt31; + if((protocol_version&0x80) == 0x80){ + context->is_bridge = true; + } + }else if(!strcmp(protocol_name, PROTOCOL_NAME)){ + if((protocol_version&0x7F) == PROTOCOL_VERSION_v311){ + context->protocol = mosq_p_mqtt311; + + if((protocol_version&0x80) == 0x80){ + context->is_bridge = true; + } + }else if((protocol_version&0x7F) == PROTOCOL_VERSION_v5){ + context->protocol = mosq_p_mqtt5; + }else{ + if(db->config->connection_messages == true){ + log__printf(NULL, MOSQ_LOG_INFO, "Invalid protocol version %d in CONNECT from %s.", + protocol_version, context->address); + } + send__connack(db, context, 0, CONNACK_REFUSED_PROTOCOL_VERSION, NULL); + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + if((context->in_packet.command&0x0F) != 0x00){ + /* Reserved flags not set to 0, must disconnect. */ + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + }else{ + if(db->config->connection_messages == true){ + log__printf(NULL, MOSQ_LOG_INFO, "Invalid protocol \"%s\" in CONNECT from %s.", + protocol_name, context->address); + } + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + + if(packet__read_byte(&context->in_packet, &connect_flags)){ + rc = 1; + goto handle_connect_error; + } + if(context->protocol == mosq_p_mqtt311 || context->protocol == mosq_p_mqtt5){ + if((connect_flags & 0x01) != 0x00){ + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + } + + clean_start = (connect_flags & 0x02) >> 1; + /* session_expiry_interval will be overriden if the properties are read later */ + if(clean_start == false && protocol_version != PROTOCOL_VERSION_v5){ + /* v3* has clean_start == false mean the session never expires */ + context->session_expiry_interval = UINT32_MAX; + }else{ + context->session_expiry_interval = 0; + } + will = connect_flags & 0x04; + will_qos = (connect_flags & 0x18) >> 3; + if(will_qos == 3){ + log__printf(NULL, MOSQ_LOG_INFO, "Invalid Will QoS in CONNECT from %s.", + context->address); + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + will_retain = ((connect_flags & 0x20) == 0x20); // Temporary hack because MSVC<1800 doesn't have stdbool.h. + password_flag = connect_flags & 0x40; + username_flag = connect_flags & 0x80; + + if(will && will_retain && db->config->retain_available == false){ + if(protocol_version == mosq_p_mqtt5){ + send__connack(db, context, 0, MQTT_RC_RETAIN_NOT_SUPPORTED, NULL); + } + rc = 1; + goto handle_connect_error; + } + + if(packet__read_uint16(&context->in_packet, &(context->keepalive))){ + rc = 1; + goto handle_connect_error; + } + + if(protocol_version == PROTOCOL_VERSION_v5){ + rc = property__read_all(CMD_CONNECT, &context->in_packet, &properties); + if(rc) goto handle_connect_error; + } + property__process_connect(context, &properties); + + if(mosquitto_property_read_string(properties, MQTT_PROP_AUTHENTICATION_METHOD, &context->auth_method, false)){ + mosquitto_property_read_binary(properties, MQTT_PROP_AUTHENTICATION_DATA, &auth_data, &auth_data_len, false); + } + + mosquitto_property_free_all(&properties); /* FIXME - TEMPORARY UNTIL PROPERTIES PROCESSED */ + + if(packet__read_string(&context->in_packet, &client_id, &slen)){ + rc = 1; + goto handle_connect_error; + } + + if(slen == 0){ + if(context->protocol == mosq_p_mqtt31){ + send__connack(db, context, 0, CONNACK_REFUSED_IDENTIFIER_REJECTED, NULL); + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + }else{ /* mqtt311/mqtt5 */ + mosquitto__free(client_id); + client_id = NULL; + + bool allow_zero_length_clientid; + if(db->config->per_listener_settings){ + allow_zero_length_clientid = context->listener->security_options.allow_zero_length_clientid; + }else{ + allow_zero_length_clientid = db->config->security_options.allow_zero_length_clientid; + } + if((context->protocol == mosq_p_mqtt311 && clean_start == 0) || allow_zero_length_clientid == false){ + if(context->protocol == mosq_p_mqtt311){ + send__connack(db, context, 0, CONNACK_REFUSED_IDENTIFIER_REJECTED, NULL); + }else{ + send__connack(db, context, 0, MQTT_RC_UNSPECIFIED, NULL); + } + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + }else{ + if(db->config->per_listener_settings){ + client_id = client_id_gen(&slen, context->listener->security_options.auto_id_prefix, context->listener->security_options.auto_id_prefix_len); + }else{ + client_id = client_id_gen(&slen, db->config->security_options.auto_id_prefix, db->config->security_options.auto_id_prefix_len); + } + if(!client_id){ + rc = MOSQ_ERR_NOMEM; + goto handle_connect_error; + } + context->assigned_id = true; + } + } + } + + /* clientid_prefixes check */ + if(db->config->clientid_prefixes){ + if(strncmp(db->config->clientid_prefixes, client_id, strlen(db->config->clientid_prefixes))){ + if(context->protocol == mosq_p_mqtt5){ + send__connack(db, context, 0, MQTT_RC_NOT_AUTHORIZED, NULL); + }else{ + send__connack(db, context, 0, CONNACK_REFUSED_NOT_AUTHORIZED, NULL); + } + rc = 1; + goto handle_connect_error; + } + } + + if(will){ + rc = will__read(context, &will_struct, will_qos, will_retain); + if(rc) goto handle_connect_error; + }else{ + if(context->protocol == mosq_p_mqtt311 || context->protocol == mosq_p_mqtt5){ + if(will_qos != 0 || will_retain != 0){ + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + } + } + + if(username_flag){ + rc = packet__read_string(&context->in_packet, &username, &slen); + if(rc == MOSQ_ERR_NOMEM){ + rc = MOSQ_ERR_NOMEM; + goto handle_connect_error; + }else if(rc != MOSQ_ERR_SUCCESS){ + if(context->protocol == mosq_p_mqtt31){ + /* Username flag given, but no username. Ignore. */ + username_flag = 0; + }else{ + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + } + }else{ + if(context->protocol == mosq_p_mqtt311 || context->protocol == mosq_p_mqtt31){ + if(password_flag){ + /* username_flag == 0 && password_flag == 1 is forbidden */ + log__printf(NULL, MOSQ_LOG_ERR, "Protocol error from %s: password without username, closing connection.", client_id); + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + } + } + if(password_flag){ + rc = packet__read_binary(&context->in_packet, (uint8_t **)&password, &slen); + if(rc == MOSQ_ERR_NOMEM){ + rc = MOSQ_ERR_NOMEM; + goto handle_connect_error; + }else if(rc == MOSQ_ERR_PROTOCOL){ + if(context->protocol == mosq_p_mqtt31){ + /* Password flag given, but no password. Ignore. */ + }else{ + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + } + } + + if(context->in_packet.pos != context->in_packet.remaining_length){ + /* Surplus data at end of packet, this must be an error. */ + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + +#ifdef WITH_TLS + if(context->listener->ssl_ctx && (context->listener->use_identity_as_username || context->listener->use_subject_as_username)){ + /* Don't need the username or password if provided */ + mosquitto__free(username); + username = NULL; + mosquitto__free(password); + password = NULL; + + if(!context->ssl){ + if(context->protocol == mosq_p_mqtt5){ + send__connack(db, context, 0, MQTT_RC_BAD_USERNAME_OR_PASSWORD, NULL); + }else{ + send__connack(db, context, 0, CONNACK_REFUSED_BAD_USERNAME_PASSWORD, NULL); + } + rc = 1; + goto handle_connect_error; + } +#ifdef FINAL_WITH_TLS_PSK + if(context->listener->psk_hint){ + /* Client should have provided an identity to get this far. */ + if(!context->username){ + if(context->protocol == mosq_p_mqtt5){ + send__connack(db, context, 0, MQTT_RC_BAD_USERNAME_OR_PASSWORD, NULL); + }else{ + send__connack(db, context, 0, CONNACK_REFUSED_BAD_USERNAME_PASSWORD, NULL); + } + rc = 1; + goto handle_connect_error; + } + }else{ +#endif /* FINAL_WITH_TLS_PSK */ + client_cert = SSL_get_peer_certificate(context->ssl); + if(!client_cert){ + if(context->protocol == mosq_p_mqtt5){ + send__connack(db, context, 0, MQTT_RC_BAD_USERNAME_OR_PASSWORD, NULL); + }else{ + send__connack(db, context, 0, CONNACK_REFUSED_BAD_USERNAME_PASSWORD, NULL); + } + rc = 1; + goto handle_connect_error; + } + name = X509_get_subject_name(client_cert); + if(!name){ + if(context->protocol == mosq_p_mqtt5){ + send__connack(db, context, 0, MQTT_RC_BAD_USERNAME_OR_PASSWORD, NULL); + }else{ + send__connack(db, context, 0, CONNACK_REFUSED_BAD_USERNAME_PASSWORD, NULL); + } + rc = 1; + goto handle_connect_error; + } + if (context->listener->use_identity_as_username) { //use_identity_as_username + i = X509_NAME_get_index_by_NID(name, NID_commonName, -1); + if(i == -1){ + if(context->protocol == mosq_p_mqtt5){ + send__connack(db, context, 0, MQTT_RC_BAD_USERNAME_OR_PASSWORD, NULL); + }else{ + send__connack(db, context, 0, CONNACK_REFUSED_BAD_USERNAME_PASSWORD, NULL); + } + rc = 1; + goto handle_connect_error; + } + name_entry = X509_NAME_get_entry(name, i); + if(name_entry){ + name_asn1 = X509_NAME_ENTRY_get_data(name_entry); + if (name_asn1 == NULL) { + if(context->protocol == mosq_p_mqtt5){ + send__connack(db, context, 0, MQTT_RC_BAD_USERNAME_OR_PASSWORD, NULL); + }else{ + send__connack(db, context, 0, CONNACK_REFUSED_BAD_USERNAME_PASSWORD, NULL); + } + rc = 1; + goto handle_connect_error; + } +#if OPENSSL_VERSION_NUMBER < 0x10100000L + context->username = mosquitto__strdup((char *) ASN1_STRING_data(name_asn1)); +#else + context->username = mosquitto__strdup((char *) ASN1_STRING_get0_data(name_asn1)); +#endif + if(!context->username){ + if(context->protocol == mosq_p_mqtt5){ + send__connack(db, context, 0, MQTT_RC_SERVER_UNAVAILABLE, NULL); + }else{ + send__connack(db, context, 0, CONNACK_REFUSED_SERVER_UNAVAILABLE, NULL); + } + rc = MOSQ_ERR_NOMEM; + goto handle_connect_error; + } + /* Make sure there isn't an embedded NUL character in the CN */ + if ((size_t)ASN1_STRING_length(name_asn1) != strlen(context->username)) { + if(context->protocol == mosq_p_mqtt5){ + send__connack(db, context, 0, MQTT_RC_BAD_USERNAME_OR_PASSWORD, NULL); + }else{ + send__connack(db, context, 0, CONNACK_REFUSED_BAD_USERNAME_PASSWORD, NULL); + } + rc = 1; + goto handle_connect_error; + } + } + } else { // use_subject_as_username + BIO *subject_bio = BIO_new(BIO_s_mem()); + X509_NAME_print_ex(subject_bio, X509_get_subject_name(client_cert), 0, XN_FLAG_RFC2253); + char *data_start = NULL; + long name_length = BIO_get_mem_data(subject_bio, &data_start); + char *subject = mosquitto__malloc(sizeof(char)*name_length+1); + if(!subject){ + BIO_free(subject_bio); + rc = MOSQ_ERR_NOMEM; + goto handle_connect_error; + } + memcpy(subject, data_start, name_length); + subject[name_length] = '\0'; + BIO_free(subject_bio); + context->username = subject; + } + if(!context->username){ + rc = 1; + goto handle_connect_error; + } + X509_free(client_cert); + client_cert = NULL; +#ifdef FINAL_WITH_TLS_PSK + } +#endif /* FINAL_WITH_TLS_PSK */ + }else{ +#endif /* WITH_TLS */ + if(username_flag || password_flag){ + /* FIXME - these ensure the mosquitto_client_id() and + * mosquitto_client_username() functions work, but is hacky */ + context->id = client_id; + context->username = username; + rc = mosquitto_unpwd_check(db, context, username, password); + context->username = NULL; + context->id = NULL; + switch(rc){ + case MOSQ_ERR_SUCCESS: + break; + case MOSQ_ERR_AUTH: + if(context->protocol == mosq_p_mqtt5){ + send__connack(db, context, 0, MQTT_RC_NOT_AUTHORIZED, NULL); + }else{ + send__connack(db, context, 0, CONNACK_REFUSED_NOT_AUTHORIZED, NULL); + } + context__disconnect(db, context); + rc = 1; + goto handle_connect_error; + break; + default: + context__disconnect(db, context); + rc = 1; + goto handle_connect_error; + break; + } + context->username = username; + context->password = password; + username = NULL; /* Avoid free() in error: below. */ + password = NULL; + }else{ + if((db->config->per_listener_settings && context->listener->security_options.allow_anonymous == false) + || (!db->config->per_listener_settings && db->config->security_options.allow_anonymous == false)){ + + if(context->protocol == mosq_p_mqtt5){ + send__connack(db, context, 0, MQTT_RC_NOT_AUTHORIZED, NULL); + }else{ + send__connack(db, context, 0, CONNACK_REFUSED_NOT_AUTHORIZED, NULL); + } + rc = 1; + goto handle_connect_error; + } + } +#ifdef WITH_TLS + } +#endif + + if(context->listener->use_username_as_clientid){ + if(context->username){ + mosquitto__free(client_id); + client_id = mosquitto__strdup(context->username); + if(!client_id){ + rc = MOSQ_ERR_NOMEM; + goto handle_connect_error; + } + }else{ + if(context->protocol == mosq_p_mqtt5){ + send__connack(db, context, 0, MQTT_RC_NOT_AUTHORIZED, NULL); + }else{ + send__connack(db, context, 0, CONNACK_REFUSED_NOT_AUTHORIZED, NULL); + } + rc = 1; + goto handle_connect_error; + } + } + context->clean_start = clean_start; + context->id = client_id; + context->will = will_struct; + + if(context->auth_method){ + rc = mosquitto_security_auth_start(db, context, false, auth_data, auth_data_len, &auth_data_out, &auth_data_out_len); + mosquitto__free(auth_data); + if(rc == MOSQ_ERR_SUCCESS){ + return connect__on_authorised(db, context, auth_data_out, auth_data_out_len); + }else if(rc == MOSQ_ERR_AUTH_CONTINUE){ + context__set_state(context, mosq_cs_authenticating); + rc = send__auth(db, context, MQTT_RC_CONTINUE_AUTHENTICATION, auth_data_out, auth_data_out_len); + free(auth_data_out); + return rc; + }else{ + free(auth_data_out); + will__clear(context); + if(rc == MOSQ_ERR_AUTH){ + send__connack(db, context, 0, MQTT_RC_NOT_AUTHORIZED, NULL); + mosquitto__free(context->id); + context->id = NULL; + return MOSQ_ERR_PROTOCOL; + }else if(rc == MOSQ_ERR_NOT_SUPPORTED){ + /* Client has requested extended authentication, but we don't support it. */ + send__connack(db, context, 0, MQTT_RC_BAD_AUTHENTICATION_METHOD, NULL); + mosquitto__free(context->id); + context->id = NULL; + return MOSQ_ERR_PROTOCOL; + }else{ + mosquitto__free(context->id); + context->id = NULL; + return rc; + } + } + }else{ + return connect__on_authorised(db, context, NULL, 0); + } + + +handle_connect_error: + mosquitto__free(auth_data); + mosquitto__free(client_id); + mosquitto__free(username); + mosquitto__free(password); + if(will_struct){ + mosquitto_property_free_all(&will_struct->properties); + mosquitto__free(will_struct->msg.payload); + mosquitto__free(will_struct->msg.topic); + mosquitto__free(will_struct); + } +#ifdef WITH_TLS + if(client_cert) X509_free(client_cert); +#endif + /* We return an error here which means the client is freed later on. */ + return rc; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_disconnect.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_disconnect.c new file mode 100644 index 0000000..72db7dd --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_disconnect.c @@ -0,0 +1,75 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include "mosquitto_broker_internal.h" +#include "mqtt_protocol.h" +#include "packet_mosq.h" +#include "property_mosq.h" +#include "send_mosq.h" +#include "will_mosq.h" + + +int handle__disconnect(struct mosquitto_db *db, struct mosquitto *context) +{ + int rc; + uint8_t reason_code = 0; + mosquitto_property *properties = NULL; + + if(!context){ + return MOSQ_ERR_INVAL; + } + + if(context->protocol == mosq_p_mqtt5 && context->in_packet.remaining_length > 1){ + /* FIXME - must handle reason code */ + rc = packet__read_byte(&context->in_packet, &reason_code); + if(rc) return rc; + + if(context->in_packet.remaining_length > 2){ + rc = property__read_all(CMD_DISCONNECT, &context->in_packet, &properties); + if(rc) return rc; + } + } + rc = property__process_disconnect(context, &properties); + if(rc){ + if(rc == MOSQ_ERR_PROTOCOL){ + send__disconnect(context, MQTT_RC_PROTOCOL_ERROR, NULL); + } + mosquitto_property_free_all(&properties); + return rc; + } + mosquitto_property_free_all(&properties); /* FIXME - TEMPORARY UNTIL PROPERTIES PROCESSED */ + + if(context->in_packet.remaining_length != 0){ + return MOSQ_ERR_PROTOCOL; + } + log__printf(NULL, MOSQ_LOG_DEBUG, "Received DISCONNECT from %s", context->id); + if(context->protocol == mosq_p_mqtt311 || context->protocol == mosq_p_mqtt5){ + if((context->in_packet.command&0x0F) != 0x00){ + do_disconnect(db, context, MOSQ_ERR_PROTOCOL); + return MOSQ_ERR_PROTOCOL; + } + } + if(reason_code == MQTT_RC_DISCONNECT_WITH_WILL_MSG){ + context__set_state(context, mosq_cs_disconnect_with_will); + }else{ + will__clear(context); + context__set_state(context, mosq_cs_disconnecting); + } + do_disconnect(db, context, MOSQ_ERR_SUCCESS); + return MOSQ_ERR_SUCCESS; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_publish.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_publish.c new file mode 100644 index 0000000..8b76fd5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_publish.c @@ -0,0 +1,367 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <stdio.h> +#include <string.h> + +#include "mosquitto_broker_internal.h" +#include "alias_mosq.h" +#include "mqtt_protocol.h" +#include "memory_mosq.h" +#include "packet_mosq.h" +#include "property_mosq.h" +#include "read_handle.h" +#include "send_mosq.h" +#include "sys_tree.h" +#include "util_mosq.h" + + +int handle__publish(struct mosquitto_db *db, struct mosquitto *context) +{ + char *topic; + mosquitto__payload_uhpa payload; + uint32_t payloadlen; + uint8_t dup, qos, retain; + uint16_t mid = 0; + int rc = 0; + int rc2; + uint8_t header = context->in_packet.command; + int res = 0; + struct mosquitto_msg_store *stored = NULL; + int len; + int slen; + char *topic_mount; + mosquitto_property *properties = NULL; + mosquitto_property *p, *p_prev; + mosquitto_property *msg_properties = NULL, *msg_properties_last; + uint32_t message_expiry_interval = 0; + int topic_alias = -1; + uint8_t reason_code = 0; + +#ifdef WITH_BRIDGE + char *topic_temp; + int i; + struct mosquitto__bridge_topic *cur_topic; + bool match; +#endif + + if(context->state != mosq_cs_connected){ + return MOSQ_ERR_PROTOCOL; + } + + payload.ptr = NULL; + + dup = (header & 0x08)>>3; + qos = (header & 0x06)>>1; + if(qos == 3){ + log__printf(NULL, MOSQ_LOG_INFO, + "Invalid QoS in PUBLISH from %s, disconnecting.", context->id); + return 1; + } + if(qos > context->maximum_qos){ + log__printf(NULL, MOSQ_LOG_INFO, + "Too high QoS in PUBLISH from %s, disconnecting.", context->id); + return 1; + } + retain = (header & 0x01); + + if(retain && db->config->retain_available == false){ + if(context->protocol == mosq_p_mqtt5){ + send__disconnect(context, MQTT_RC_RETAIN_NOT_SUPPORTED, NULL); + } + return 1; + } + + if(packet__read_string(&context->in_packet, &topic, &slen)) return 1; + if(!slen && context->protocol != mosq_p_mqtt5){ + /* Invalid publish topic, disconnect client. */ + mosquitto__free(topic); + return 1; + } + + if(qos > 0){ + if(packet__read_uint16(&context->in_packet, &mid)){ + mosquitto__free(topic); + return 1; + } + if(mid == 0){ + mosquitto__free(topic); + return MOSQ_ERR_PROTOCOL; + } + } + + /* Handle properties */ + if(context->protocol == mosq_p_mqtt5){ + rc = property__read_all(CMD_PUBLISH, &context->in_packet, &properties); + if(rc) return rc; + + p = properties; + p_prev = NULL; + msg_properties = NULL; + msg_properties_last = NULL; + while(p){ + switch(p->identifier){ + case MQTT_PROP_CONTENT_TYPE: + case MQTT_PROP_CORRELATION_DATA: + case MQTT_PROP_PAYLOAD_FORMAT_INDICATOR: + case MQTT_PROP_RESPONSE_TOPIC: + case MQTT_PROP_USER_PROPERTY: + if(msg_properties){ + msg_properties_last->next = p; + msg_properties_last = p; + }else{ + msg_properties = p; + msg_properties_last = p; + } + if(p_prev){ + p_prev->next = p->next; + p = p_prev->next; + }else{ + properties = p->next; + p = properties; + } + msg_properties_last->next = NULL; + break; + + case MQTT_PROP_TOPIC_ALIAS: + topic_alias = p->value.i16; + p_prev = p; + p = p->next; + break; + + case MQTT_PROP_MESSAGE_EXPIRY_INTERVAL: + message_expiry_interval = p->value.i32; + p_prev = p; + p = p->next; + break; + + case MQTT_PROP_SUBSCRIPTION_IDENTIFIER: + p_prev = p; + p = p->next; + break; + + default: + p = p->next; + break; + } + } + } + mosquitto_property_free_all(&properties); + + if(topic_alias == 0 || (context->listener && topic_alias > context->listener->max_topic_alias)){ + mosquitto__free(topic); + send__disconnect(context, MQTT_RC_TOPIC_ALIAS_INVALID, NULL); + return MOSQ_ERR_PROTOCOL; + }else if(topic_alias > 0){ + if(topic){ + rc = alias__add(context, topic, topic_alias); + if(rc){ + mosquitto__free(topic); + return rc; + } + }else{ + rc = alias__find(context, &topic, topic_alias); + if(rc){ + send__disconnect(context, MQTT_RC_TOPIC_ALIAS_INVALID, NULL); + mosquitto__free(topic); + return rc; + } + } + } + if(mosquitto_validate_utf8(topic, slen) != MOSQ_ERR_SUCCESS){ + log__printf(NULL, MOSQ_LOG_INFO, "Client %s sent topic with invalid UTF-8, disconnecting.", context->id); + mosquitto__free(topic); + return 1; + } + +#ifdef WITH_BRIDGE + if(context->bridge && context->bridge->topics && context->bridge->topic_remapping){ + for(i=0; i<context->bridge->topic_count; i++){ + cur_topic = &context->bridge->topics[i]; + if((cur_topic->direction == bd_both || cur_topic->direction == bd_in) + && (cur_topic->remote_prefix || cur_topic->local_prefix)){ + + /* Topic mapping required on this topic if the message matches */ + + rc = mosquitto_topic_matches_sub(cur_topic->remote_topic, topic, &match); + if(rc){ + mosquitto__free(topic); + return rc; + } + if(match){ + if(cur_topic->remote_prefix){ + /* This prefix needs removing. */ + if(!strncmp(cur_topic->remote_prefix, topic, strlen(cur_topic->remote_prefix))){ + topic_temp = mosquitto__strdup(topic+strlen(cur_topic->remote_prefix)); + if(!topic_temp){ + mosquitto__free(topic); + return MOSQ_ERR_NOMEM; + } + mosquitto__free(topic); + topic = topic_temp; + } + } + + if(cur_topic->local_prefix){ + /* This prefix needs adding. */ + len = strlen(topic) + strlen(cur_topic->local_prefix)+1; + topic_temp = mosquitto__malloc(len+1); + if(!topic_temp){ + mosquitto__free(topic); + return MOSQ_ERR_NOMEM; + } + snprintf(topic_temp, len, "%s%s", cur_topic->local_prefix, topic); + topic_temp[len] = '\0'; + + mosquitto__free(topic); + topic = topic_temp; + } + break; + } + } + } + } +#endif + if(mosquitto_pub_topic_check(topic) != MOSQ_ERR_SUCCESS){ + /* Invalid publish topic, just swallow it. */ + mosquitto__free(topic); + return 1; + } + + payloadlen = context->in_packet.remaining_length - context->in_packet.pos; + G_PUB_BYTES_RECEIVED_INC(payloadlen); + if(context->listener && context->listener->mount_point){ + len = strlen(context->listener->mount_point) + strlen(topic) + 1; + topic_mount = mosquitto__malloc(len+1); + if(!topic_mount){ + mosquitto__free(topic); + mosquitto_property_free_all(&msg_properties); + return MOSQ_ERR_NOMEM; + } + snprintf(topic_mount, len, "%s%s", context->listener->mount_point, topic); + topic_mount[len] = '\0'; + + mosquitto__free(topic); + topic = topic_mount; + } + + if(payloadlen){ + if(db->config->message_size_limit && payloadlen > db->config->message_size_limit){ + log__printf(NULL, MOSQ_LOG_DEBUG, "Dropped too large PUBLISH from %s (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", context->id, dup, qos, retain, mid, topic, (long)payloadlen); + reason_code = MQTT_RC_IMPLEMENTATION_SPECIFIC; + goto process_bad_message; + } + if(UHPA_ALLOC(payload, payloadlen) == 0){ + mosquitto__free(topic); + mosquitto_property_free_all(&msg_properties); + return MOSQ_ERR_NOMEM; + } + + if(packet__read_bytes(&context->in_packet, UHPA_ACCESS(payload, payloadlen), payloadlen)){ + mosquitto__free(topic); + UHPA_FREE(payload, payloadlen); + mosquitto_property_free_all(&msg_properties); + return 1; + } + } + + /* Check for topic access */ + rc = mosquitto_acl_check(db, context, topic, payloadlen, UHPA_ACCESS(payload, payloadlen), qos, retain, MOSQ_ACL_WRITE); + if(rc == MOSQ_ERR_ACL_DENIED){ + log__printf(NULL, MOSQ_LOG_DEBUG, "Denied PUBLISH from %s (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", context->id, dup, qos, retain, mid, topic, (long)payloadlen); + reason_code = MQTT_RC_NOT_AUTHORIZED; + goto process_bad_message; + }else if(rc != MOSQ_ERR_SUCCESS){ + mosquitto__free(topic); + UHPA_FREE(payload, payloadlen); + mosquitto_property_free_all(&msg_properties); + return rc; + } + + log__printf(NULL, MOSQ_LOG_DEBUG, "Received PUBLISH from %s (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", context->id, dup, qos, retain, mid, topic, (long)payloadlen); + if(qos > 0){ + db__message_store_find(context, mid, &stored); + } + if(!stored){ + dup = 0; + if(db__message_store(db, context, mid, topic, qos, payloadlen, &payload, retain, &stored, message_expiry_interval, msg_properties, 0, mosq_mo_client)){ + mosquitto_property_free_all(&msg_properties); + return 1; + } + msg_properties = NULL; /* Now belongs to db__message_store() */ + }else{ + mosquitto__free(topic); + topic = stored->topic; + dup = 1; + mosquitto_property_free_all(&msg_properties); + UHPA_FREE(payload, payloadlen); + } + + switch(qos){ + case 0: + rc2 = sub__messages_queue(db, context->id, topic, qos, retain, &stored); + if(rc2 > 0) rc = 1; + break; + case 1: + util__decrement_receive_quota(context); + rc2 = sub__messages_queue(db, context->id, topic, qos, retain, &stored); + if(rc2 == MOSQ_ERR_SUCCESS || context->protocol != mosq_p_mqtt5){ + if(send__puback(context, mid, 0)) rc = 1; + }else if(rc2 == MOSQ_ERR_NO_SUBSCRIBERS){ + if(send__puback(context, mid, MQTT_RC_NO_MATCHING_SUBSCRIBERS)) rc = 1; + }else{ + rc = rc2; + } + break; + case 2: + if(dup == 0){ + util__decrement_receive_quota(context); + res = db__message_insert(db, context, mid, mosq_md_in, qos, retain, stored, NULL); + }else{ + res = 0; + } + /* db__message_insert() returns 2 to indicate dropped message + * due to queue. This isn't an error so don't disconnect them. */ + if(!res){ + if(send__pubrec(context, mid, 0)) rc = 1; + }else if(res == 1){ + rc = 1; + } + break; + } + + return rc; +process_bad_message: + mosquitto__free(topic); + UHPA_FREE(payload, payloadlen); + switch(qos){ + case 0: + return MOSQ_ERR_SUCCESS; + case 1: + return send__puback(context, mid, reason_code); + case 2: + if(context->protocol == mosq_p_mqtt5){ + return send__pubrec(context, mid, reason_code); + }else{ + return send__pubrec(context, mid, 0); + } + } + return 1; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_subscribe.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_subscribe.c new file mode 100644 index 0000000..2f37ca9 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_subscribe.c @@ -0,0 +1,217 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <stdio.h> +#include <string.h> + +#include "mosquitto_broker_internal.h" +#include "memory_mosq.h" +#include "mqtt_protocol.h" +#include "packet_mosq.h" +#include "property_mosq.h" + + + +int handle__subscribe(struct mosquitto_db *db, struct mosquitto *context) +{ + int rc = 0; + int rc2; + uint16_t mid; + char *sub; + uint8_t subscription_options; + uint32_t subscription_identifier = 0; + uint8_t qos; + uint8_t retain_handling = 0; + uint8_t *payload = NULL, *tmp_payload; + uint32_t payloadlen = 0; + int len; + int slen; + char *sub_mount; + mosquitto_property *properties = NULL; + + if(!context) return MOSQ_ERR_INVAL; + + if(context->state != mosq_cs_connected){ + return MOSQ_ERR_PROTOCOL; + } + + log__printf(NULL, MOSQ_LOG_DEBUG, "Received SUBSCRIBE from %s", context->id); + + if(context->protocol != mosq_p_mqtt31){ + if((context->in_packet.command&0x0F) != 0x02){ + return MOSQ_ERR_PROTOCOL; + } + } + if(packet__read_uint16(&context->in_packet, &mid)) return 1; + if(mid == 0) return MOSQ_ERR_PROTOCOL; + + if(context->protocol == mosq_p_mqtt5){ + rc = property__read_all(CMD_SUBSCRIBE, &context->in_packet, &properties); + if(rc) return rc; + + if(mosquitto_property_read_varint(properties, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, + &subscription_identifier, false)){ + + /* If the identifier was force set to 0, this is an error */ + if(subscription_identifier == 0){ + mosquitto_property_free_all(&properties); + return MOSQ_ERR_PROTOCOL; + } + } + + mosquitto_property_free_all(&properties); + /* Note - User Property not handled */ + } + + while(context->in_packet.pos < context->in_packet.remaining_length){ + sub = NULL; + if(packet__read_string(&context->in_packet, &sub, &slen)){ + mosquitto__free(payload); + return 1; + } + + if(sub){ + if(!slen){ + log__printf(NULL, MOSQ_LOG_INFO, + "Empty subscription string from %s, disconnecting.", + context->address); + mosquitto__free(sub); + mosquitto__free(payload); + return 1; + } + if(mosquitto_sub_topic_check(sub)){ + log__printf(NULL, MOSQ_LOG_INFO, + "Invalid subscription string from %s, disconnecting.", + context->address); + mosquitto__free(sub); + mosquitto__free(payload); + return 1; + } + + if(packet__read_byte(&context->in_packet, &subscription_options)){ + mosquitto__free(sub); + mosquitto__free(payload); + return 1; + } + if(context->protocol == mosq_p_mqtt31 || context->protocol == mosq_p_mqtt311){ + qos = subscription_options; + if(context->is_bridge){ + subscription_options = MQTT_SUB_OPT_RETAIN_AS_PUBLISHED | MQTT_SUB_OPT_NO_LOCAL; + } + }else{ + qos = subscription_options & 0x03; + subscription_options &= 0xFC; + + retain_handling = (subscription_options & 0x30); + if(retain_handling == 0x30 || (subscription_options & 0xC0) != 0){ + return MOSQ_ERR_PROTOCOL; + } + } + if(qos > 2){ + log__printf(NULL, MOSQ_LOG_INFO, + "Invalid QoS in subscription command from %s, disconnecting.", + context->address); + mosquitto__free(sub); + mosquitto__free(payload); + return 1; + } + + + if(context->listener && context->listener->mount_point){ + len = strlen(context->listener->mount_point) + slen + 1; + sub_mount = mosquitto__malloc(len+1); + if(!sub_mount){ + mosquitto__free(sub); + mosquitto__free(payload); + return MOSQ_ERR_NOMEM; + } + snprintf(sub_mount, len, "%s%s", context->listener->mount_point, sub); + sub_mount[len] = '\0'; + + mosquitto__free(sub); + sub = sub_mount; + + } + log__printf(NULL, MOSQ_LOG_DEBUG, "\t%s (QoS %d)", sub, qos); + + if(context->protocol != mosq_p_mqtt31){ + rc2 = mosquitto_acl_check(db, context, sub, 0, NULL, qos, false, MOSQ_ACL_SUBSCRIBE); + switch(rc2){ + case MOSQ_ERR_SUCCESS: + break; + case MOSQ_ERR_ACL_DENIED: + qos = 0x80; + break; + default: + mosquitto__free(sub); + return rc2; + } + } + + if(qos != 0x80){ + rc2 = sub__add(db, context, sub, qos, subscription_identifier, subscription_options, &db->subs); + if(rc2 > 0){ + mosquitto__free(sub); + return rc2; + } + if(context->protocol == mosq_p_mqtt311 || context->protocol == mosq_p_mqtt31){ + if(rc2 == MOSQ_ERR_SUCCESS || rc2 == MOSQ_ERR_SUB_EXISTS){ + if(sub__retain_queue(db, context, sub, qos, 0)) rc = 1; + } + }else{ + if((retain_handling == MQTT_SUB_OPT_SEND_RETAIN_ALWAYS) + || (rc2 == MOSQ_ERR_SUCCESS && retain_handling == MQTT_SUB_OPT_SEND_RETAIN_NEW)){ + + if(sub__retain_queue(db, context, sub, qos, subscription_identifier)) rc = 1; + } + } + + log__printf(NULL, MOSQ_LOG_SUBSCRIBE, "%s %d %s", context->id, qos, sub); + } + mosquitto__free(sub); + + tmp_payload = mosquitto__realloc(payload, payloadlen + 1); + if(tmp_payload){ + payload = tmp_payload; + payload[payloadlen] = qos; + payloadlen++; + }else{ + mosquitto__free(payload); + + return MOSQ_ERR_NOMEM; + } + } + } + + if(context->protocol != mosq_p_mqtt31){ + if(payloadlen == 0){ + /* No subscriptions specified, protocol error. */ + return MOSQ_ERR_PROTOCOL; + } + } + if(send__suback(context, mid, payloadlen, payload)) rc = 1; + mosquitto__free(payload); + +#ifdef WITH_PERSISTENCE + db->persistence_changes++; +#endif + + return rc; +} + + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_unsubscribe.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_unsubscribe.c new file mode 100644 index 0000000..bbf6dc8 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/handle_unsubscribe.c @@ -0,0 +1,125 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <stdio.h> +#include <string.h> + +#include "mosquitto_broker_internal.h" +#include "memory_mosq.h" +#include "mqtt_protocol.h" +#include "packet_mosq.h" +#include "send_mosq.h" + +int handle__unsubscribe(struct mosquitto_db *db, struct mosquitto *context) +{ + uint16_t mid; + char *sub; + int slen; + int rc; + uint8_t reason; + int reason_code_count = 0; + int reason_code_max; + uint8_t *reason_codes = NULL, *reason_tmp; + mosquitto_property *properties = NULL; + + if(!context) return MOSQ_ERR_INVAL; + + if(context->state != mosq_cs_connected){ + return MOSQ_ERR_PROTOCOL; + } + log__printf(NULL, MOSQ_LOG_DEBUG, "Received UNSUBSCRIBE from %s", context->id); + + if(context->protocol != mosq_p_mqtt31){ + if((context->in_packet.command&0x0F) != 0x02){ + return MOSQ_ERR_PROTOCOL; + } + } + if(packet__read_uint16(&context->in_packet, &mid)) return 1; + if(mid == 0) return MOSQ_ERR_PROTOCOL; + + if(context->protocol == mosq_p_mqtt5){ + rc = property__read_all(CMD_UNSUBSCRIBE, &context->in_packet, &properties); + if(rc) return rc; + /* Immediately free, we don't do anything with User Property at the moment */ + mosquitto_property_free_all(&properties); + } + + if(context->protocol == mosq_p_mqtt311 || context->protocol == mosq_p_mqtt5){ + if(context->in_packet.pos == context->in_packet.remaining_length){ + /* No topic specified, protocol error. */ + return MOSQ_ERR_PROTOCOL; + } + } + + reason_code_max = 10; + reason_codes = mosquitto__malloc(reason_code_max); + if(!reason_codes){ + return MOSQ_ERR_NOMEM; + } + + while(context->in_packet.pos < context->in_packet.remaining_length){ + sub = NULL; + if(packet__read_string(&context->in_packet, &sub, &slen)){ + return 1; + } + + if(!slen){ + log__printf(NULL, MOSQ_LOG_INFO, + "Empty unsubscription string from %s, disconnecting.", + context->id); + mosquitto__free(sub); + return 1; + } + if(mosquitto_sub_topic_check(sub)){ + log__printf(NULL, MOSQ_LOG_INFO, + "Invalid unsubscription string from %s, disconnecting.", + context->id); + mosquitto__free(sub); + return 1; + } + + log__printf(NULL, MOSQ_LOG_DEBUG, "\t%s", sub); + rc = sub__remove(db, context, sub, db->subs, &reason); + log__printf(NULL, MOSQ_LOG_UNSUBSCRIBE, "%s %s", context->id, sub); + mosquitto__free(sub); + if(rc) return rc; + + reason_codes[reason_code_count] = reason; + reason_code_count++; + if(reason_code_count == reason_code_max){ + reason_tmp = mosquitto__realloc(reason_codes, reason_code_max*2); + if(!reason_tmp){ + mosquitto__free(reason_codes); + return MOSQ_ERR_NOMEM; + } + reason_codes = reason_tmp; + reason_code_max *= 2; + } + } +#ifdef WITH_PERSISTENCE + db->persistence_changes++; +#endif + + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending UNSUBACK to %s", context->id); + + /* We don't use Reason String or User Property yet. */ + rc = send__unsuback(context, mid, reason_code_count, reason_codes, NULL); + mosquitto__free(reason_codes); + return rc; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/lib_load.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/lib_load.h new file mode 100644 index 0000000..48c5fa5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/lib_load.h @@ -0,0 +1,37 @@ +/* +Copyright (c) 2012-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef LIB_LOAD_H +#define LIB_LOAD_H + +#ifdef WIN32 +# include <windows.h> +#else +# include <dlfcn.h> +#endif + +#ifdef WIN32 +# define LIB_LOAD(A) LoadLibrary(A) +# define LIB_CLOSE(A) FreeLibrary(A) +# define LIB_SYM(HANDLE, SYM) GetProcAddress(HANDLE, SYM) +#else +# define LIB_LOAD(A) dlopen(A, RTLD_NOW|RTLD_GLOBAL) +# define LIB_CLOSE(A) dlclose(A) +# define LIB_SYM(HANDLE, SYM) dlsym(HANDLE, SYM) +#endif + +#define LIB_SYM_EASY(MEMBER, HANDLE, SYM) if(!(MEMBER = LIB_SYM(HANDLE, SYM)) return 1 +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/linker-macosx.syms b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/linker-macosx.syms new file mode 100644 index 0000000..bc943ce --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/linker-macosx.syms @@ -0,0 +1,10 @@ +_mosquitto_log_printf +_mosquitto_client_address +_mosquitto_client_clean_session +_mosquitto_client_id +_mosquitto_client_keepalive +_mosquitto_client_certificate +_mosquitto_client_protocol +_mosquitto_client_sub_count +_mosquitto_client_username +_mosquitto_set_username diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/linker.syms b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/linker.syms new file mode 100644 index 0000000..31420d3 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/linker.syms @@ -0,0 +1,12 @@ +{ + mosquitto_log_printf; + mosquitto_client_address; + mosquitto_client_clean_session; + mosquitto_client_id; + mosquitto_client_keepalive; + mosquitto_client_certificate; + mosquitto_client_protocol; + mosquitto_client_sub_count; + mosquitto_client_username; + mosquitto_set_username; +}; diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/logging.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/logging.c new file mode 100644 index 0000000..bcb6a15 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/logging.c @@ -0,0 +1,404 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ +#include "config.h" + +#include <stdarg.h> +#include <stdio.h> +#include <string.h> +#ifndef WIN32 +#include <syslog.h> +#endif +#include <time.h> + +#ifdef WITH_DLT +#include <dlt/dlt.h> +#endif + +#include "mosquitto_broker_internal.h" +#include "memory_mosq.h" +#include "util_mosq.h" + +extern struct mosquitto_db int_db; + +#ifdef WIN32 +HANDLE syslog_h; +#endif + +/* Options for logging should be: + * + * A combination of: + * Via syslog + * To a file + * To stdout/stderr + * To topics + */ + +/* Give option of logging timestamp. + * Logging pid. + */ +static int log_destinations = MQTT3_LOG_STDERR; +static int log_priorities = MOSQ_LOG_ERR | MOSQ_LOG_WARNING | MOSQ_LOG_NOTICE | MOSQ_LOG_INFO; + +#ifdef WITH_DLT +static DltContext dltContext; +#endif + +static int get_time(struct tm **ti) +{ +#if defined(__APPLE__) + struct timeval tv; +#else + struct timespec ts; +#endif + time_t s; + +#ifdef WIN32 + s = time(NULL); + +#elif defined(__APPLE__) + gettimeofday(&tv, NULL); + s = tv.tv_sec; +#else + if(clock_gettime(CLOCK_REALTIME, &ts) != 0){ + fprintf(stderr, "Error obtaining system time.\n"); + return 1; + } + s = ts.tv_sec; +#endif + + *ti = localtime(&s); + if(!(*ti)){ + fprintf(stderr, "Error obtaining system time.\n"); + return 1; + } + + return 0; +} + + +int log__init(struct mosquitto__config *config) +{ + int rc = 0; + + log_priorities = config->log_type; + log_destinations = config->log_dest; + + if(log_destinations & MQTT3_LOG_SYSLOG){ +#ifndef WIN32 + openlog("mosquitto", LOG_PID|LOG_CONS, config->log_facility); +#else + syslog_h = OpenEventLog(NULL, "mosquitto"); +#endif + } + + if(log_destinations & MQTT3_LOG_FILE){ + if(drop_privileges(config, true)){ + return 1; + } + config->log_fptr = mosquitto__fopen(config->log_file, "at", true); + if(!config->log_fptr){ + log_destinations = MQTT3_LOG_STDERR; + log_priorities = MOSQ_LOG_ERR; + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to open log file %s for writing.", config->log_file); + return MOSQ_ERR_INVAL; + } + restore_privileges(); + } +#ifdef WITH_DLT + DLT_REGISTER_APP("MQTT","mosquitto log"); + dlt_register_context(&dltContext, "MQTT", "mosquitto DLT context"); +#endif + return rc; +} + +int log__close(struct mosquitto__config *config) +{ + if(log_destinations & MQTT3_LOG_SYSLOG){ +#ifndef WIN32 + closelog(); +#else + CloseEventLog(syslog_h); +#endif + } + if(log_destinations & MQTT3_LOG_FILE){ + if(config->log_fptr){ + fclose(config->log_fptr); + config->log_fptr = NULL; + } + } + +#ifdef WITH_DLT + dlt_unregister_context(&dltContext); + DLT_UNREGISTER_APP(); +#endif + /* FIXME - do something for all destinations! */ + return MOSQ_ERR_SUCCESS; +} + +#ifdef WITH_DLT +DltLogLevelType get_dlt_level(int priority) +{ + switch (priority) { + case MOSQ_LOG_ERR: + return DLT_LOG_ERROR; + case MOSQ_LOG_WARNING: + return DLT_LOG_WARN; + case MOSQ_LOG_INFO: + return DLT_LOG_INFO; + case MOSQ_LOG_DEBUG: + return DLT_LOG_DEBUG; + case MOSQ_LOG_NOTICE: + case MOSQ_LOG_SUBSCRIBE: + case MOSQ_LOG_UNSUBSCRIBE: + return DLT_LOG_VERBOSE; + default: + return DLT_LOG_DEFAULT; + } +} +#endif + +int log__vprintf(int priority, const char *fmt, va_list va) +{ + char *s; + char *st; + int len; +#ifdef WIN32 + char *sp; +#endif + const char *topic; + int syslog_priority; + time_t now = time(NULL); + static time_t last_flush = 0; + char time_buf[50]; + bool log_timestamp = true; + char *log_timestamp_format = NULL; + FILE *log_fptr = NULL; + + if(int_db.config){ + log_timestamp = int_db.config->log_timestamp; + log_timestamp_format = int_db.config->log_timestamp_format; + log_fptr = int_db.config->log_fptr; + } + + if((log_priorities & priority) && log_destinations != MQTT3_LOG_NONE){ + switch(priority){ + case MOSQ_LOG_SUBSCRIBE: + topic = "$SYS/broker/log/M/subscribe"; +#ifndef WIN32 + syslog_priority = LOG_NOTICE; +#else + syslog_priority = EVENTLOG_INFORMATION_TYPE; +#endif + break; + case MOSQ_LOG_UNSUBSCRIBE: + topic = "$SYS/broker/log/M/unsubscribe"; +#ifndef WIN32 + syslog_priority = LOG_NOTICE; +#else + syslog_priority = EVENTLOG_INFORMATION_TYPE; +#endif + break; + case MOSQ_LOG_DEBUG: + topic = "$SYS/broker/log/D"; +#ifndef WIN32 + syslog_priority = LOG_DEBUG; +#else + syslog_priority = EVENTLOG_INFORMATION_TYPE; +#endif + break; + case MOSQ_LOG_ERR: + topic = "$SYS/broker/log/E"; +#ifndef WIN32 + syslog_priority = LOG_ERR; +#else + syslog_priority = EVENTLOG_ERROR_TYPE; +#endif + break; + case MOSQ_LOG_WARNING: + topic = "$SYS/broker/log/W"; +#ifndef WIN32 + syslog_priority = LOG_WARNING; +#else + syslog_priority = EVENTLOG_WARNING_TYPE; +#endif + break; + case MOSQ_LOG_NOTICE: + topic = "$SYS/broker/log/N"; +#ifndef WIN32 + syslog_priority = LOG_NOTICE; +#else + syslog_priority = EVENTLOG_INFORMATION_TYPE; +#endif + break; + case MOSQ_LOG_INFO: + topic = "$SYS/broker/log/I"; +#ifndef WIN32 + syslog_priority = LOG_INFO; +#else + syslog_priority = EVENTLOG_INFORMATION_TYPE; +#endif + break; +#ifdef WITH_WEBSOCKETS + case MOSQ_LOG_WEBSOCKETS: + topic = "$SYS/broker/log/WS"; +#ifndef WIN32 + syslog_priority = LOG_DEBUG; +#else + syslog_priority = EVENTLOG_INFORMATION_TYPE; +#endif + break; +#endif + default: + topic = "$SYS/broker/log/E"; +#ifndef WIN32 + syslog_priority = LOG_ERR; +#else + syslog_priority = EVENTLOG_ERROR_TYPE; +#endif + } + len = strlen(fmt) + 500; + s = mosquitto__malloc(len*sizeof(char)); + if(!s) return MOSQ_ERR_NOMEM; + + vsnprintf(s, len, fmt, va); + s[len-1] = '\0'; /* Ensure string is null terminated. */ + + if(log_timestamp && log_timestamp_format){ + struct tm *ti = NULL; + get_time(&ti); + if(strftime(time_buf, 50, log_timestamp_format, ti) == 0){ + snprintf(time_buf, 50, "Time error"); + } + } + if(log_destinations & MQTT3_LOG_STDOUT){ + if(log_timestamp){ + if(log_timestamp_format){ + fprintf(stdout, "%s: %s\n", time_buf, s); + }else{ + fprintf(stdout, "%d: %s\n", (int)now, s); + } + }else{ + fprintf(stdout, "%s\n", s); + } + fflush(stdout); + } + if(log_destinations & MQTT3_LOG_STDERR){ + if(log_timestamp){ + if(log_timestamp_format){ + fprintf(stderr, "%s: %s\n", time_buf, s); + }else{ + fprintf(stderr, "%d: %s\n", (int)now, s); + } + }else{ + fprintf(stderr, "%s\n", s); + } + fflush(stderr); + } + if(log_destinations & MQTT3_LOG_FILE && log_fptr){ + if(log_timestamp){ + if(log_timestamp_format){ + fprintf(log_fptr, "%s: %s\n", time_buf, s); + }else{ + fprintf(log_fptr, "%d: %s\n", (int)now, s); + } + }else{ + fprintf(log_fptr, "%s\n", s); + } + if(now - last_flush > 1){ + fflush(log_fptr); + last_flush = now; + } + } + if(log_destinations & MQTT3_LOG_SYSLOG){ +#ifndef WIN32 + syslog(syslog_priority, "%s", s); +#else + sp = (char *)s; + ReportEvent(syslog_h, syslog_priority, 0, 0, NULL, 1, 0, &sp, NULL); +#endif + } + if(log_destinations & MQTT3_LOG_TOPIC && priority != MOSQ_LOG_DEBUG && priority != MOSQ_LOG_INTERNAL){ + if(log_timestamp){ + len += 30; + st = mosquitto__malloc(len*sizeof(char)); + if(!st){ + mosquitto__free(s); + return MOSQ_ERR_NOMEM; + } + snprintf(st, len, "%d: %s", (int)now, s); + db__messages_easy_queue(&int_db, NULL, topic, 2, strlen(st), st, 0, 20, NULL); + mosquitto__free(st); + }else{ + db__messages_easy_queue(&int_db, NULL, topic, 2, strlen(s), s, 0, 20, NULL); + } + } +#ifdef WITH_DLT + if(priority != MOSQ_LOG_INTERNAL){ + DLT_LOG_STRING(dltContext, get_dlt_level(priority), s); + } +#endif + mosquitto__free(s); + } + + return MOSQ_ERR_SUCCESS; +} + +int log__printf(struct mosquitto *mosq, int priority, const char *fmt, ...) +{ + va_list va; + int rc; + + UNUSED(mosq); + + va_start(va, fmt); + rc = log__vprintf(priority, fmt, va); + va_end(va); + + return rc; +} + +void log__internal(const char *fmt, ...) +{ + va_list va; + char buf[200]; + int len; + + va_start(va, fmt); + len = vsnprintf(buf, 200, fmt, va); + va_end(va); + + if(len >= 200){ + log__printf(NULL, MOSQ_LOG_INTERNAL, "Internal log buffer too short (%d)", len); + return; + } + + log__printf(NULL, MOSQ_LOG_INTERNAL, "%s%s%s", "\e[32m", buf, "\e[0m"); +} + +int mosquitto_log_vprintf(int level, const char *fmt, va_list va) +{ + return log__vprintf(level, fmt, va); +} + +void mosquitto_log_printf(int level, const char *fmt, ...) +{ + va_list va; + + va_start(va, fmt); + log__vprintf(level, fmt, va); + va_end(va); +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/loop.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/loop.c new file mode 100644 index 0000000..5095959 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/loop.c @@ -0,0 +1,844 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. + Tatsuzo Osawa - Add epoll. +*/ + +#include "config.h" + +#ifndef WIN32 +# define _GNU_SOURCE +#endif + +#include <assert.h> +#ifndef WIN32 +#ifdef WITH_EPOLL +#include <sys/epoll.h> +#define MAX_EVENTS 1000 +#endif +#include <poll.h> +#include <unistd.h> +#else +#include <process.h> +#include <winsock2.h> +#include <ws2tcpip.h> +#endif + +#include <errno.h> +#include <signal.h> +#include <stdio.h> +#include <string.h> +#ifndef WIN32 +# include <sys/socket.h> +#endif +#include <time.h> + +#ifdef WITH_WEBSOCKETS +# include <libwebsockets.h> +#endif + +#include "mosquitto_broker_internal.h" +#include "memory_mosq.h" +#include "packet_mosq.h" +#include "send_mosq.h" +#include "sys_tree.h" +#include "time_mosq.h" +#include "util_mosq.h" + +extern bool flag_reload; +#ifdef WITH_PERSISTENCE +extern bool flag_db_backup; +#endif +extern bool flag_tree_print; +extern int run; + +#ifdef WITH_EPOLL +static void loop_handle_reads_writes(struct mosquitto_db *db, mosq_sock_t sock, uint32_t events); +#else +static void loop_handle_reads_writes(struct mosquitto_db *db, struct pollfd *pollfds); +#endif + +#ifdef WITH_WEBSOCKETS +static void temp__expire_websockets_clients(struct mosquitto_db *db) +{ + struct mosquitto *context, *ctxt_tmp; + static time_t last_check = 0; + time_t now = mosquitto_time(); + char *id; + + if(now - last_check > 60){ + HASH_ITER(hh_id, db->contexts_by_id, context, ctxt_tmp){ + if(context->wsi && context->sock != INVALID_SOCKET){ + if(context->keepalive && now - context->last_msg_in > (time_t)(context->keepalive)*3/2){ + if(db->config->connection_messages == true){ + if(context->id){ + id = context->id; + }else{ + id = "<unknown>"; + } + if(db->config->connection_messages == true){ + log__printf(NULL, MOSQ_LOG_NOTICE, "Client %s has exceeded timeout, disconnecting.", id); + } + } + /* Client has exceeded keepalive*1.5 */ + do_disconnect(db, context, MOSQ_ERR_KEEPALIVE); + } + } + } + last_check = mosquitto_time(); + } +} +#endif + +int mosquitto_main_loop(struct mosquitto_db *db, mosq_sock_t *listensock, int listensock_count) +{ +#ifdef WITH_SYS_TREE + time_t start_time = mosquitto_time(); +#endif +#ifdef WITH_PERSISTENCE + time_t last_backup = mosquitto_time(); +#endif + time_t now = 0; + int time_count; + int fdcount; + struct mosquitto *context, *ctxt_tmp; +#ifndef WIN32 + sigset_t sigblock, origsig; +#endif + int i; +#ifdef WITH_EPOLL + int j; + struct epoll_event ev, events[MAX_EVENTS]; +#else + struct pollfd *pollfds = NULL; + int pollfd_index; + int pollfd_max; +#endif +#ifdef WITH_BRIDGE + int rc; + int err; + socklen_t len; +#endif + time_t expiration_check_time = 0; + char *id; + +#ifndef WIN32 + sigemptyset(&sigblock); + sigaddset(&sigblock, SIGINT); + sigaddset(&sigblock, SIGTERM); + sigaddset(&sigblock, SIGUSR1); + sigaddset(&sigblock, SIGUSR2); + sigaddset(&sigblock, SIGHUP); +#endif + +#ifndef WITH_EPOLL +#ifdef WIN32 + pollfd_max = _getmaxstdio(); +#else + pollfd_max = sysconf(_SC_OPEN_MAX); +#endif + + pollfds = mosquitto__malloc(sizeof(struct pollfd)*pollfd_max); + if(!pollfds){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } +#endif + + if(db->config->persistent_client_expiration > 0){ + expiration_check_time = time(NULL) + 3600; + } + +#ifdef WITH_EPOLL + db->epollfd = 0; + if ((db->epollfd = epoll_create(MAX_EVENTS)) == -1) { + log__printf(NULL, MOSQ_LOG_ERR, "Error in epoll creating: %s", strerror(errno)); + return MOSQ_ERR_UNKNOWN; + } + memset(&ev, 0, sizeof(struct epoll_event)); + memset(&events, 0, sizeof(struct epoll_event)*MAX_EVENTS); + for(i=0; i<listensock_count; i++){ + ev.data.fd = listensock[i]; + ev.events = EPOLLIN; + if (epoll_ctl(db->epollfd, EPOLL_CTL_ADD, listensock[i], &ev) == -1) { + log__printf(NULL, MOSQ_LOG_ERR, "Error in epoll initial registering: %s", strerror(errno)); + (void)close(db->epollfd); + db->epollfd = 0; + return MOSQ_ERR_UNKNOWN; + } + } +#ifdef WITH_BRIDGE + HASH_ITER(hh_sock, db->contexts_by_sock, context, ctxt_tmp){ + if(context->bridge){ + ev.data.fd = context->sock; + ev.events = EPOLLIN; + context->events = EPOLLIN; + if (epoll_ctl(db->epollfd, EPOLL_CTL_ADD, context->sock, &ev) == -1) { + log__printf(NULL, MOSQ_LOG_ERR, "Error in epoll initial registering bridge: %s", strerror(errno)); + (void)close(db->epollfd); + db->epollfd = 0; + return MOSQ_ERR_UNKNOWN; + } + } + } +#endif +#endif + + while(run){ + context__free_disused(db); +#ifdef WITH_SYS_TREE + if(db->config->sys_interval > 0){ + sys_tree__update(db, db->config->sys_interval, start_time); + } +#endif + +#ifndef WITH_EPOLL + memset(pollfds, -1, sizeof(struct pollfd)*pollfd_max); + + pollfd_index = 0; + for(i=0; i<listensock_count; i++){ + pollfds[pollfd_index].fd = listensock[i]; + pollfds[pollfd_index].events = POLLIN; + pollfds[pollfd_index].revents = 0; + pollfd_index++; + } +#endif + + time_count = 0; + HASH_ITER(hh_sock, db->contexts_by_sock, context, ctxt_tmp){ + if(time_count > 0){ + time_count--; + }else{ + time_count = 1000; + now = mosquitto_time(); + } + context->pollfd_index = -1; + + if(context->sock != INVALID_SOCKET){ +#ifdef WITH_BRIDGE + if(context->bridge){ + mosquitto__check_keepalive(db, context); + if(context->bridge->round_robin == false + && context->bridge->cur_address != 0 + && context->bridge->primary_retry + && now > context->bridge->primary_retry){ + + if(context->bridge->primary_retry_sock == INVALID_SOCKET){ + rc = net__try_connect(context->bridge->addresses[0].address, + context->bridge->addresses[0].port, + &context->bridge->primary_retry_sock, NULL, false); + + if(rc == 0){ + COMPAT_CLOSE(context->bridge->primary_retry_sock); + context->bridge->primary_retry_sock = INVALID_SOCKET; + context->bridge->primary_retry = 0; + net__socket_close(db, context); + context->bridge->cur_address = 0; + } + }else{ + len = sizeof(int); + if(!getsockopt(context->bridge->primary_retry_sock, SOL_SOCKET, SO_ERROR, (char *)&err, &len)){ + if(err == 0){ + COMPAT_CLOSE(context->bridge->primary_retry_sock); + context->bridge->primary_retry_sock = INVALID_SOCKET; + context->bridge->primary_retry = 0; + net__socket_close(db, context); + context->bridge->cur_address = context->bridge->address_count-1; + }else{ + COMPAT_CLOSE(context->bridge->primary_retry_sock); + context->bridge->primary_retry_sock = INVALID_SOCKET; + context->bridge->primary_retry = now+5; + } + }else{ + COMPAT_CLOSE(context->bridge->primary_retry_sock); + context->bridge->primary_retry_sock = INVALID_SOCKET; + context->bridge->primary_retry = now+5; + } + } + } + } +#endif + + /* Local bridges never time out in this fashion. */ + if(!(context->keepalive) + || context->bridge + || now - context->last_msg_in <= (time_t)(context->keepalive)*3/2){ + + if(db__message_write(db, context) == MOSQ_ERR_SUCCESS){ +#ifdef WITH_EPOLL + if(context->current_out_packet || context->state == mosq_cs_connect_pending || context->ws_want_write){ + if(!(context->events & EPOLLOUT)) { + ev.data.fd = context->sock; + ev.events = EPOLLIN | EPOLLOUT; + if(epoll_ctl(db->epollfd, EPOLL_CTL_ADD, context->sock, &ev) == -1) { + if((errno != EEXIST)||(epoll_ctl(db->epollfd, EPOLL_CTL_MOD, context->sock, &ev) == -1)) { + log__printf(NULL, MOSQ_LOG_DEBUG, "Error in epoll re-registering to EPOLLOUT: %s", strerror(errno)); + } + } + context->events = EPOLLIN | EPOLLOUT; + } + context->ws_want_write = false; + } + else{ + if(context->events & EPOLLOUT) { + ev.data.fd = context->sock; + ev.events = EPOLLIN; + if(epoll_ctl(db->epollfd, EPOLL_CTL_ADD, context->sock, &ev) == -1) { + if((errno != EEXIST)||(epoll_ctl(db->epollfd, EPOLL_CTL_MOD, context->sock, &ev) == -1)) { + log__printf(NULL, MOSQ_LOG_DEBUG, "Error in epoll re-registering to EPOLLIN: %s", strerror(errno)); + } + } + context->events = EPOLLIN; + } + } +#else + pollfds[pollfd_index].fd = context->sock; + pollfds[pollfd_index].events = POLLIN; + pollfds[pollfd_index].revents = 0; + if(context->current_out_packet || context->state == mosq_cs_connect_pending || context->ws_want_write){ + pollfds[pollfd_index].events |= POLLOUT; + context->ws_want_write = false; + } + context->pollfd_index = pollfd_index; + pollfd_index++; +#endif + }else{ + do_disconnect(db, context, MOSQ_ERR_CONN_LOST); + } + }else{ + /* Client has exceeded keepalive*1.5 */ + do_disconnect(db, context, MOSQ_ERR_KEEPALIVE); + } + } + } + +#ifdef WITH_BRIDGE + time_count = 0; + for(i=0; i<db->bridge_count; i++){ + if(!db->bridges[i]) continue; + + context = db->bridges[i]; + + if(context->sock == INVALID_SOCKET){ + if(time_count > 0){ + time_count--; + }else{ + time_count = 1000; + now = mosquitto_time(); + } + /* Want to try to restart the bridge connection */ + if(!context->bridge->restart_t){ + context->bridge->restart_t = now+context->bridge->restart_timeout; + context->bridge->cur_address++; + if(context->bridge->cur_address == context->bridge->address_count){ + context->bridge->cur_address = 0; + } + }else{ + if((context->bridge->start_type == bst_lazy && context->bridge->lazy_reconnect) + || (context->bridge->start_type == bst_automatic && now > context->bridge->restart_t)){ + +#if defined(__GLIBC__) && defined(WITH_ADNS) + if(context->adns){ + /* Connection attempted, waiting on DNS lookup */ + rc = gai_error(context->adns); + if(rc == EAI_INPROGRESS){ + /* Just keep on waiting */ + }else if(rc == 0){ + rc = bridge__connect_step2(db, context); + if(rc == MOSQ_ERR_SUCCESS){ +#ifdef WITH_EPOLL + ev.data.fd = context->sock; + ev.events = EPOLLIN; + if(context->current_out_packet){ + ev.events |= EPOLLOUT; + } + if(epoll_ctl(db->epollfd, EPOLL_CTL_ADD, context->sock, &ev) == -1) { + if((errno != EEXIST)||(epoll_ctl(db->epollfd, EPOLL_CTL_MOD, context->sock, &ev) == -1)) { + log__printf(NULL, MOSQ_LOG_DEBUG, "Error in epoll re-registering bridge: %s", strerror(errno)); + } + }else{ + context->events = ev.events; + } +#else + pollfds[pollfd_index].fd = context->sock; + pollfds[pollfd_index].events = POLLIN; + pollfds[pollfd_index].revents = 0; + if(context->current_out_packet){ + pollfds[pollfd_index].events |= POLLOUT; + } + context->pollfd_index = pollfd_index; + pollfd_index++; +#endif + }else if(rc == MOSQ_ERR_CONN_PENDING){ + context->bridge->restart_t = 0; + }else{ + context->bridge->cur_address++; + if(context->bridge->cur_address == context->bridge->address_count){ + context->bridge->cur_address = 0; + } + context->bridge->restart_t = 0; + } + }else{ + /* Need to retry */ + if(context->adns->ar_result){ + freeaddrinfo(context->adns->ar_result); + } + mosquitto__free(context->adns); + context->adns = NULL; + context->bridge->restart_t = 0; + } + }else{ +#ifdef WITH_EPOLL + /* clean any events triggered in previous connection */ + context->events = 0; +#endif + rc = bridge__connect_step1(db, context); + if(rc){ + context->bridge->cur_address++; + if(context->bridge->cur_address == context->bridge->address_count){ + context->bridge->cur_address = 0; + } + }else{ + /* Short wait for ADNS lookup */ + context->bridge->restart_t = 1; + } + } +#else + { + rc = bridge__connect(db, context); + context->bridge->restart_t = 0; + if(rc == MOSQ_ERR_SUCCESS){ + if(context->bridge->round_robin == false && context->bridge->cur_address != 0){ + context->bridge->primary_retry = now + 5; + } +#ifdef WITH_EPOLL + ev.data.fd = context->sock; + ev.events = EPOLLIN; + if(context->current_out_packet){ + ev.events |= EPOLLOUT; + } + if(epoll_ctl(db->epollfd, EPOLL_CTL_ADD, context->sock, &ev) == -1) { + if((errno != EEXIST)||(epoll_ctl(db->epollfd, EPOLL_CTL_MOD, context->sock, &ev) == -1)) { + log__printf(NULL, MOSQ_LOG_DEBUG, "Error in epoll re-registering bridge: %s", strerror(errno)); + } + }else{ + context->events = ev.events; + } +#else + pollfds[pollfd_index].fd = context->sock; + pollfds[pollfd_index].events = POLLIN; + pollfds[pollfd_index].revents = 0; + if(context->current_out_packet){ + pollfds[pollfd_index].events |= POLLOUT; + } + context->pollfd_index = pollfd_index; + pollfd_index++; +#endif + }else{ + context->bridge->cur_address++; + if(context->bridge->cur_address == context->bridge->address_count){ + context->bridge->cur_address = 0; + } + } + } +#endif + } + } + } + } +#endif + now = time(NULL); + if(db->config->persistent_client_expiration > 0 && now > expiration_check_time){ + HASH_ITER(hh_id, db->contexts_by_id, context, ctxt_tmp){ + if(context->sock == INVALID_SOCKET && context->session_expiry_interval > 0 && context->session_expiry_interval != UINT32_MAX){ + /* This is a persistent client, check to see if the + * last time it connected was longer than + * persistent_client_expiration seconds ago. If so, + * expire it and clean up. + */ + if(now > context->session_expiry_time){ + if(context->id){ + id = context->id; + }else{ + id = "<unknown>"; + } + log__printf(NULL, MOSQ_LOG_NOTICE, "Expiring persistent client %s due to timeout.", id); + G_CLIENTS_EXPIRED_INC(); + context->session_expiry_interval = 0; + context__set_state(context, mosq_cs_expiring); + do_disconnect(db, context, MOSQ_ERR_SUCCESS); + } + } + } + expiration_check_time = time(NULL) + 3600; + } + +#ifndef WIN32 + sigprocmask(SIG_SETMASK, &sigblock, &origsig); +#ifdef WITH_EPOLL + fdcount = epoll_wait(db->epollfd, events, MAX_EVENTS, 100); +#else + fdcount = poll(pollfds, pollfd_index, 100); +#endif + sigprocmask(SIG_SETMASK, &origsig, NULL); +#else + fdcount = WSAPoll(pollfds, pollfd_index, 100); +#endif +#ifdef WITH_EPOLL + switch(fdcount){ + case -1: + if(errno != EINTR){ + log__printf(NULL, MOSQ_LOG_ERR, "Error in epoll waiting: %s.", strerror(errno)); + } + break; + case 0: + break; + default: + for(i=0; i<fdcount; i++){ + for(j=0; j<listensock_count; j++){ + if (events[i].data.fd == listensock[j]) { + if (events[i].events & (EPOLLIN | EPOLLPRI)){ + while((ev.data.fd = net__socket_accept(db, listensock[j])) != -1){ + ev.events = EPOLLIN; + if (epoll_ctl(db->epollfd, EPOLL_CTL_ADD, ev.data.fd, &ev) == -1) { + log__printf(NULL, MOSQ_LOG_ERR, "Error in epoll accepting: %s", strerror(errno)); + } + context = NULL; + HASH_FIND(hh_sock, db->contexts_by_sock, &(ev.data.fd), sizeof(mosq_sock_t), context); + if(!context) { + log__printf(NULL, MOSQ_LOG_ERR, "Error in epoll accepting: no context"); + } + context->events = EPOLLIN; + } + } + break; + } + } + if (j == listensock_count) { + loop_handle_reads_writes(db, events[i].data.fd, events[i].events); + } + } + } +#else + if(fdcount == -1){ + log__printf(NULL, MOSQ_LOG_ERR, "Error in poll: %s.", strerror(errno)); + }else{ + loop_handle_reads_writes(db, pollfds); + + for(i=0; i<listensock_count; i++){ + if(pollfds[i].revents & (POLLIN | POLLPRI)){ + while(net__socket_accept(db, listensock[i]) != -1){ + } + } + } + } +#endif + now = time(NULL); + session_expiry__check(db, now); + will_delay__check(db, now); +#ifdef WITH_PERSISTENCE + if(db->config->persistence && db->config->autosave_interval){ + if(db->config->autosave_on_changes){ + if(db->persistence_changes >= db->config->autosave_interval){ + persist__backup(db, false); + db->persistence_changes = 0; + } + }else{ + if(last_backup + db->config->autosave_interval < mosquitto_time()){ + persist__backup(db, false); + last_backup = mosquitto_time(); + } + } + } +#endif + +#ifdef WITH_PERSISTENCE + if(flag_db_backup){ + persist__backup(db, false); + flag_db_backup = false; + } +#endif + if(flag_reload){ + log__printf(NULL, MOSQ_LOG_INFO, "Reloading config."); + config__read(db, db->config, true); + mosquitto_security_cleanup(db, true); + mosquitto_security_init(db, true); + mosquitto_security_apply(db); + log__close(db->config); + log__init(db->config); + flag_reload = false; + } + if(flag_tree_print){ + sub__tree_print(db->subs, 0); + flag_tree_print = false; + } +#ifdef WITH_WEBSOCKETS + for(i=0; i<db->config->listener_count; i++){ + /* Extremely hacky, should be using the lws provided external poll + * interface, but their interface has changed recently and ours + * will soon, so for now websockets clients are second class + * citizens. */ + if(db->config->listeners[i].ws_context){ + libwebsocket_service(db->config->listeners[i].ws_context, 0); + } + } + if(db->config->have_websockets_listener){ + temp__expire_websockets_clients(db); + } +#endif + } + +#ifdef WITH_EPOLL + (void) close(db->epollfd); + db->epollfd = 0; +#else + mosquitto__free(pollfds); +#endif + return MOSQ_ERR_SUCCESS; +} + +void do_disconnect(struct mosquitto_db *db, struct mosquitto *context, int reason) +{ + char *id; +#ifdef WITH_EPOLL + struct epoll_event ev; +#endif +#ifdef WITH_WEBSOCKETS + bool is_duplicate = false; +#endif + + if(context->state == mosq_cs_disconnected){ + return; + } +#ifdef WITH_WEBSOCKETS + if(context->wsi){ + if(context->state == mosq_cs_duplicate){ + is_duplicate = true; + } + + if(context->state != mosq_cs_disconnecting && context->state != mosq_cs_disconnect_with_will){ + context__set_state(context, mosq_cs_disconnect_ws); + } + if(context->wsi){ + libwebsocket_callback_on_writable(context->ws_context, context->wsi); + } + if(context->sock != INVALID_SOCKET){ + HASH_DELETE(hh_sock, db->contexts_by_sock, context); +#ifdef WITH_EPOLL + if (epoll_ctl(db->epollfd, EPOLL_CTL_DEL, context->sock, &ev) == -1) { + log__printf(NULL, MOSQ_LOG_DEBUG, "Error in epoll disconnecting websockets: %s", strerror(errno)); + } +#endif + context->sock = INVALID_SOCKET; + context->pollfd_index = -1; + } + if(is_duplicate){ + /* This occurs if another client is taking over the same client id. + * It is important to remove this from the by_id hash here, so it + * doesn't leave us with multiple clients in the hash with the same + * id. Websockets doesn't actually close the connection here, + * unlike for normal clients, which means there is extra time when + * there could be two clients with the same id in the hash. */ + context__remove_from_by_id(db, context); + } + }else +#endif + { + if(db->config->connection_messages == true){ + if(context->id){ + id = context->id; + }else{ + id = "<unknown>"; + } + if(context->state != mosq_cs_disconnecting && context->state != mosq_cs_disconnect_with_will){ + switch(reason){ + case MOSQ_ERR_SUCCESS: + break; + case MOSQ_ERR_PROTOCOL: + log__printf(NULL, MOSQ_LOG_NOTICE, "Client %s disconnected due to protocol error.", id); + break; + case MOSQ_ERR_CONN_LOST: + log__printf(NULL, MOSQ_LOG_NOTICE, "Socket error on client %s, disconnecting.", id); + break; + case MOSQ_ERR_AUTH: + log__printf(NULL, MOSQ_LOG_NOTICE, "Client %s disconnected, no longer authorised.", id); + break; + case MOSQ_ERR_KEEPALIVE: + log__printf(NULL, MOSQ_LOG_NOTICE, "Client %s has exceeded timeout, disconnecting.", id); + break; + default: + log__printf(NULL, MOSQ_LOG_NOTICE, "Socket error on client %s, disconnecting.", id); + break; + } + }else{ + log__printf(NULL, MOSQ_LOG_NOTICE, "Client %s disconnected.", id); + } + } +#ifdef WITH_EPOLL + if (context->sock != INVALID_SOCKET && epoll_ctl(db->epollfd, EPOLL_CTL_DEL, context->sock, &ev) == -1) { + if(db->config->connection_messages == true){ + log__printf(NULL, MOSQ_LOG_DEBUG, "Error in epoll disconnecting: %s", strerror(errno)); + } + } +#endif + context__disconnect(db, context); + } +} + + +#ifdef WITH_EPOLL +static void loop_handle_reads_writes(struct mosquitto_db *db, mosq_sock_t sock, uint32_t events) +#else +static void loop_handle_reads_writes(struct mosquitto_db *db, struct pollfd *pollfds) +#endif +{ + struct mosquitto *context; +#ifndef WITH_EPOLL + struct mosquitto *ctxt_tmp; +#endif + int err; + socklen_t len; + +#ifdef WITH_EPOLL + int i; + context = NULL; + HASH_FIND(hh_sock, db->contexts_by_sock, &sock, sizeof(mosq_sock_t), context); + if(!context) { + return; + } + for (i=0;i<1;i++) { +#else + HASH_ITER(hh_sock, db->contexts_by_sock, context, ctxt_tmp){ + if(context->pollfd_index < 0){ + continue; + } + + assert(pollfds[context->pollfd_index].fd == context->sock); +#endif + +#ifdef WITH_WEBSOCKETS + if(context->wsi){ + struct lws_pollfd wspoll; +#ifdef WITH_EPOLL + wspoll.fd = context->sock; + wspoll.events = context->events; + wspoll.revents = events; +#else + wspoll.fd = pollfds[context->pollfd_index].fd; + wspoll.events = pollfds[context->pollfd_index].events; + wspoll.revents = pollfds[context->pollfd_index].revents; +#endif +#ifdef LWS_LIBRARY_VERSION_NUMBER + lws_service_fd(lws_get_context(context->wsi), &wspoll); +#else + lws_service_fd(context->ws_context, &wspoll); +#endif + continue; + } +#endif + +#ifdef WITH_TLS +#ifdef WITH_EPOLL + if(events & EPOLLOUT || +#else + if(pollfds[context->pollfd_index].revents & POLLOUT || +#endif + context->want_write || + (context->ssl && context->state == mosq_cs_new)){ +#else +#ifdef WITH_EPOLL + if(events & EPOLLOUT){ +#else + if(pollfds[context->pollfd_index].revents & POLLOUT){ +#endif +#endif + if(context->state == mosq_cs_connect_pending){ + len = sizeof(int); + if(!getsockopt(context->sock, SOL_SOCKET, SO_ERROR, (char *)&err, &len)){ + if(err == 0){ + context__set_state(context, mosq_cs_new); +#if defined(WITH_ADNS) && defined(WITH_BRIDGE) + if(context->bridge){ + bridge__connect_step3(db, context); + continue; + } +#endif + } + }else{ + do_disconnect(db, context, MOSQ_ERR_CONN_LOST); + continue; + } + } + if(packet__write(context)){ + do_disconnect(db, context, MOSQ_ERR_CONN_LOST); + continue; + } + } + } + +#ifdef WITH_EPOLL + context = NULL; + HASH_FIND(hh_sock, db->contexts_by_sock, &sock, sizeof(mosq_sock_t), context); + if(!context) { + return; + } + for (i=0;i<1;i++) { +#else + HASH_ITER(hh_sock, db->contexts_by_sock, context, ctxt_tmp){ + if(context->pollfd_index < 0){ + continue; + } +#endif +#ifdef WITH_WEBSOCKETS + if(context->wsi){ + // Websocket are already handled above + continue; + } +#endif + +#ifdef WITH_TLS +#ifdef WITH_EPOLL + if(events & EPOLLIN || +#else + if(pollfds[context->pollfd_index].revents & POLLIN || +#endif + (context->ssl && context->state == mosq_cs_new)){ +#else +#ifdef WITH_EPOLL + if(events & EPOLLIN){ +#else + if(pollfds[context->pollfd_index].revents & POLLIN){ +#endif +#endif + do{ + if(packet__read(db, context)){ + do_disconnect(db, context, MOSQ_ERR_CONN_LOST); + continue; + } + }while(SSL_DATA_PENDING(context)); + }else{ +#ifdef WITH_EPOLL + if(events & (EPOLLERR | EPOLLHUP)){ +#else + if(context->pollfd_index >= 0 && pollfds[context->pollfd_index].revents & (POLLERR | POLLNVAL | POLLHUP)){ +#endif + do_disconnect(db, context, MOSQ_ERR_CONN_LOST); + continue; + } + } + } +} + + + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/mosquitto.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/mosquitto.c new file mode 100644 index 0000000..8969f03 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/mosquitto.c @@ -0,0 +1,471 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#ifndef WIN32 +/* For initgroups() */ +# include <unistd.h> +# include <grp.h> +# include <assert.h> +#endif + +#ifndef WIN32 +#include <pwd.h> +#else +#include <process.h> +#include <winsock2.h> +#include <ws2tcpip.h> +#endif + +#ifndef WIN32 +# include <sys/time.h> +#endif + +#include <errno.h> +#include <signal.h> +#include <stdio.h> +#include <string.h> +#ifdef WITH_SYSTEMD +# include <systemd/sd-daemon.h> +#endif +#ifdef WITH_WRAP +#include <tcpd.h> +#endif +#ifdef WITH_WEBSOCKETS +# include <libwebsockets.h> +#endif + +#include "mosquitto_broker_internal.h" +#include "memory_mosq.h" +#include "util_mosq.h" + +struct mosquitto_db int_db; + +bool flag_reload = false; +#ifdef WITH_PERSISTENCE +bool flag_db_backup = false; +#endif +bool flag_tree_print = false; +int run; +#ifdef WITH_WRAP +#include <syslog.h> +int allow_severity = LOG_INFO; +int deny_severity = LOG_INFO; +#endif + +void handle_sigint(int signal); +void handle_sigusr1(int signal); +void handle_sigusr2(int signal); +#ifdef SIGHUP +void handle_sighup(int signal); +#endif + +struct mosquitto_db *mosquitto__get_db(void) +{ + return &int_db; +} + +/* mosquitto shouldn't run as root. + * This function will attempt to change to an unprivileged user and group if + * running as root. The user is given in config->user. + * Returns 1 on failure (unknown user, setuid/setgid failure) + * Returns 0 on success. + * Note that setting config->user to "root" does not produce an error, but it + * strongly discouraged. + */ +int drop_privileges(struct mosquitto__config *config, bool temporary) +{ +#if !defined(__CYGWIN__) && !defined(WIN32) + struct passwd *pwd; + char *err; + int rc; + + const char *snap = getenv("SNAP_NAME"); + if(snap && !strcmp(snap, "mosquitto")){ + /* Don't attempt to drop privileges if running as a snap */ + return MOSQ_ERR_SUCCESS; + } + + if(geteuid() == 0){ + if(config->user && strcmp(config->user, "root")){ + pwd = getpwnam(config->user); + if(!pwd){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid user '%s'.", config->user); + return 1; + } + if(initgroups(config->user, pwd->pw_gid) == -1){ + err = strerror(errno); + log__printf(NULL, MOSQ_LOG_ERR, "Error setting groups whilst dropping privileges: %s.", err); + return 1; + } + if(temporary){ + rc = setegid(pwd->pw_gid); + }else{ + rc = setgid(pwd->pw_gid); + } + if(rc == -1){ + err = strerror(errno); + log__printf(NULL, MOSQ_LOG_ERR, "Error setting gid whilst dropping privileges: %s.", err); + return 1; + } + if(temporary){ + rc = seteuid(pwd->pw_uid); + }else{ + rc = setuid(pwd->pw_uid); + } + if(rc == -1){ + err = strerror(errno); + log__printf(NULL, MOSQ_LOG_ERR, "Error setting uid whilst dropping privileges: %s.", err); + return 1; + } + } + if(geteuid() == 0 || getegid() == 0){ + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Mosquitto should not be run as root/administrator."); + } + } +#endif + return MOSQ_ERR_SUCCESS; +} + +int restore_privileges(void) +{ +#if !defined(__CYGWIN__) && !defined(WIN32) + char *err; + int rc; + + if(getuid() == 0){ + rc = setegid(0); + if(rc == -1){ + err = strerror(errno); + log__printf(NULL, MOSQ_LOG_ERR, "Error setting gid whilst restoring privileges: %s.", err); + return 1; + } + rc = seteuid(0); + if(rc == -1){ + err = strerror(errno); + log__printf(NULL, MOSQ_LOG_ERR, "Error setting uid whilst restoring privileges: %s.", err); + return 1; + } + } +#endif + return MOSQ_ERR_SUCCESS; +} + + +void mosquitto__daemonise(void) +{ +#ifndef WIN32 + char *err; + pid_t pid; + + pid = fork(); + if(pid < 0){ + err = strerror(errno); + log__printf(NULL, MOSQ_LOG_ERR, "Error in fork: %s", err); + exit(1); + } + if(pid > 0){ + exit(0); + } + if(setsid() < 0){ + err = strerror(errno); + log__printf(NULL, MOSQ_LOG_ERR, "Error in setsid: %s", err); + exit(1); + } + + assert(freopen("/dev/null", "r", stdin)); + assert(freopen("/dev/null", "w", stdout)); + assert(freopen("/dev/null", "w", stderr)); +#else + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Can't start in daemon mode in Windows."); +#endif +} + + +int main(int argc, char *argv[]) +{ + mosq_sock_t *listensock = NULL; + int listensock_count = 0; + int listensock_index = 0; + struct mosquitto__config config; + int i, j; + FILE *pid; + int rc; +#ifdef WIN32 + SYSTEMTIME st; +#else + struct timeval tv; +#endif + struct mosquitto *ctxt, *ctxt_tmp; + +#if defined(WIN32) || defined(__CYGWIN__) + if(argc == 2){ + if(!strcmp(argv[1], "run")){ + service_run(); + return 0; + }else if(!strcmp(argv[1], "install")){ + service_install(); + return 0; + }else if(!strcmp(argv[1], "uninstall")){ + service_uninstall(); + return 0; + } + } +#endif + + +#ifdef WIN32 + GetSystemTime(&st); + srand(st.wSecond + st.wMilliseconds); +#else + gettimeofday(&tv, NULL); + srand(tv.tv_sec + tv.tv_usec); +#endif + +#ifdef WIN32 + _setmaxstdio(2048); +#endif + + memset(&int_db, 0, sizeof(struct mosquitto_db)); + + net__broker_init(); + + config__init(&int_db, &config); + rc = config__parse_args(&int_db, &config, argc, argv); + if(rc != MOSQ_ERR_SUCCESS) return rc; + int_db.config = &config; + + if(config.daemon){ + mosquitto__daemonise(); + } + + if(config.daemon && config.pid_file){ + pid = mosquitto__fopen(config.pid_file, "wt", false); + if(pid){ + fprintf(pid, "%d", getpid()); + fclose(pid); + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to write pid file."); + return 1; + } + } + + rc = db__open(&config, &int_db); + if(rc != MOSQ_ERR_SUCCESS){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Couldn't open database."); + return rc; + } + + /* Initialise logging only after initialising the database in case we're + * logging to topics */ + if(log__init(&config)){ + rc = 1; + return rc; + } + log__printf(NULL, MOSQ_LOG_INFO, "mosquitto version %s starting", VERSION); + if(int_db.config_file){ + log__printf(NULL, MOSQ_LOG_INFO, "Config loaded from %s.", int_db.config_file); + }else{ + log__printf(NULL, MOSQ_LOG_INFO, "Using default config."); + } + + rc = mosquitto_security_module_init(&int_db); + if(rc) return rc; + rc = mosquitto_security_init(&int_db, false); + if(rc) return rc; + +#ifdef WITH_SYS_TREE + sys_tree__init(&int_db); +#endif + + listensock_index = 0; + for(i=0; i<config.listener_count; i++){ + if(config.listeners[i].protocol == mp_mqtt){ + if(net__socket_listen(&config.listeners[i])){ + db__close(&int_db); + if(config.pid_file){ + remove(config.pid_file); + } + return 1; + } + listensock_count += config.listeners[i].sock_count; + listensock = mosquitto__realloc(listensock, sizeof(mosq_sock_t)*listensock_count); + if(!listensock){ + db__close(&int_db); + if(config.pid_file){ + remove(config.pid_file); + } + return 1; + } + for(j=0; j<config.listeners[i].sock_count; j++){ + if(config.listeners[i].socks[j] == INVALID_SOCKET){ + db__close(&int_db); + if(config.pid_file){ + remove(config.pid_file); + } + return 1; + } + listensock[listensock_index] = config.listeners[i].socks[j]; + listensock_index++; + } + }else if(config.listeners[i].protocol == mp_websockets){ +#ifdef WITH_WEBSOCKETS + config.listeners[i].ws_context = mosq_websockets_init(&config.listeners[i], &config); + if(!config.listeners[i].ws_context){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to create websockets listener on port %d.", config.listeners[i].port); + return 1; + } +#endif + } + } + + rc = drop_privileges(&config, false); + if(rc != MOSQ_ERR_SUCCESS) return rc; + + signal(SIGINT, handle_sigint); + signal(SIGTERM, handle_sigint); +#ifdef SIGHUP + signal(SIGHUP, handle_sighup); +#endif +#ifndef WIN32 + signal(SIGUSR1, handle_sigusr1); + signal(SIGUSR2, handle_sigusr2); + signal(SIGPIPE, SIG_IGN); +#endif +#ifdef WIN32 + CreateThread(NULL, 0, SigThreadProc, NULL, 0, NULL); +#endif + +#ifdef WITH_BRIDGE + for(i=0; i<config.bridge_count; i++){ + if(bridge__new(&int_db, &(config.bridges[i]))){ + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Unable to connect to bridge %s.", + config.bridges[i].name); + } + } +#endif + +#ifdef WITH_SYSTEMD + sd_notify(0, "READY=1"); +#endif + + run = 1; + rc = mosquitto_main_loop(&int_db, listensock, listensock_count); + + log__printf(NULL, MOSQ_LOG_INFO, "mosquitto version %s terminating", VERSION); + +#ifdef WITH_WEBSOCKETS + for(i=0; i<int_db.config->listener_count; i++){ + if(int_db.config->listeners[i].ws_context){ + libwebsocket_context_destroy(int_db.config->listeners[i].ws_context); + } + mosquitto__free(int_db.config->listeners[i].ws_protocol); + } +#endif + + /* FIXME - this isn't quite right, all wills with will delay zero should be + * sent now, but those with positive will delay should be persisted and + * restored, pending the client reconnecting in time. */ + HASH_ITER(hh_id, int_db.contexts_by_id, ctxt, ctxt_tmp){ + context__send_will(&int_db, ctxt); + } + will_delay__send_all(&int_db); + +#ifdef WITH_PERSISTENCE + if(config.persistence){ + persist__backup(&int_db, true); + } +#endif + session_expiry__remove_all(&int_db); + + HASH_ITER(hh_id, int_db.contexts_by_id, ctxt, ctxt_tmp){ +#ifdef WITH_WEBSOCKETS + if(!ctxt->wsi){ + context__cleanup(&int_db, ctxt, true); + } +#else + context__cleanup(&int_db, ctxt, true); +#endif + } + HASH_ITER(hh_sock, int_db.contexts_by_sock, ctxt, ctxt_tmp){ + context__cleanup(&int_db, ctxt, true); + } +#ifdef WITH_BRIDGE + for(i=0; i<int_db.bridge_count; i++){ + if(int_db.bridges[i]){ + context__cleanup(&int_db, int_db.bridges[i], true); + } + } + mosquitto__free(int_db.bridges); +#endif + context__free_disused(&int_db); + + db__close(&int_db); + + if(listensock){ + for(i=0; i<listensock_count; i++){ + if(listensock[i] != INVALID_SOCKET){ +#ifndef WIN32 + close(listensock[i]); +#else + closesocket(listensock[i]); +#endif + } + } + mosquitto__free(listensock); + } + + mosquitto_security_module_cleanup(&int_db); + + if(config.pid_file){ + remove(config.pid_file); + } + + log__close(&config); + config__cleanup(int_db.config); + net__broker_cleanup(); + + return rc; +} + +#ifdef WIN32 +int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + char **argv; + int argc = 1; + char *token; + char *saveptr = NULL; + int rc; + + argv = mosquitto__malloc(sizeof(char *)*1); + argv[0] = "mosquitto"; + token = strtok_r(lpCmdLine, " ", &saveptr); + while(token){ + argc++; + argv = mosquitto__realloc(argv, sizeof(char *)*argc); + if(!argv){ + fprintf(stderr, "Error: Out of memory.\n"); + return MOSQ_ERR_NOMEM; + } + argv[argc-1] = token; + token = strtok_r(NULL, " ", &saveptr); + } + rc = main(argc, argv); + mosquitto__free(argv); + return rc; +} +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/mosquitto_broker.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/mosquitto_broker.h new file mode 100644 index 0000000..f6f2cc8 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/mosquitto_broker.h @@ -0,0 +1,172 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef MOSQUITTO_BROKER_H +#define MOSQUITTO_BROKER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include <stdbool.h> + +struct mosquitto; + +enum mosquitto_protocol { + mp_mqtt, + mp_mqttsn, + mp_websockets +}; + +/* ========================================================================= + * + * Utility Functions + * + * Use these functions from within your plugin. + * + * There are also very useful functions in libmosquitto. + * + * ========================================================================= */ + + +/* + * Function: mosquitto_log_printf + * + * Write a log message using the broker configured logging. + * + * Parameters: + * level - Log message priority. Can currently be one of: + * + * MOSQ_LOG_INFO + * MOSQ_LOG_NOTICE + * MOSQ_LOG_WARNING + * MOSQ_LOG_ERR + * MOSQ_LOG_DEBUG + * MOSQ_LOG_SUBSCRIBE (not recommended for use by plugins) + * MOSQ_LOG_UNSUBSCRIBE (not recommended for use by plugins) + * + * These values are defined in mosquitto.h. + * + * fmt, ... - printf style format and arguments. + */ +void mosquitto_log_printf(int level, const char *fmt, ...); + + +/* ========================================================================= + * + * Client Functions + * + * Use these functions to access client information. + * + * ========================================================================= */ + +/* + * Function: mosquitto_client_address + * + * Retrieve the IP address of the client as a string. + */ +const char *mosquitto_client_address(const struct mosquitto *client); + + +/* + * Function: mosquitto_client_clean_session + * + * Retrieve the clean session flag value for a client. + */ +bool mosquitto_client_clean_session(const struct mosquitto *client); + + +/* + * Function: mosquitto_client_id + * + * Retrieve the client id associated with a client. + */ +const char *mosquitto_client_id(const struct mosquitto *client); + + +/* + * Function: mosquitto_client_keepalive + * + * Retrieve the keepalive value for a client. + */ +int mosquitto_client_keepalive(const struct mosquitto *client); + + +/* + * Function: mosquitto_client_certificate + * + * If TLS support is enabled, return the certificate provided by a client as an + * X509 pointer from openssl. If the client did not provide a certificate, then + * NULL will be returned. This function will only ever return a non-NULL value + * if the `require_certificate` option is set to true. + * + * If TLS is not supported, this function will always return NULL. + */ +void *mosquitto_client_certificate(const struct mosquitto *client); + + +/* + * Function: mosquitto_client_protocol + * + * Retrieve the protocol with which the client has connected. Can be one of: + * + * mp_mqtt (MQTT over TCP) + * mp_mqttsn (MQTT-SN) + * mp_websockets (MQTT over Websockets) + */ +int mosquitto_client_protocol(const struct mosquitto *client); + + +/* + * Function: mosquitto_client_sub_count + * + * Retrieve the number of subscriptions that have been made by a client. + */ +int mosquitto_client_sub_count(const struct mosquitto *client); + + +/* + * Function: mosquitto_client_username + * + * Retrieve the username associated with a client. + */ +const char *mosquitto_client_username(const struct mosquitto *client); + + +/* Function: mosquitto_set_username + * + * Set the username for a client. + * + * This removes and replaces the current username for a client and hence + * updates its access. + * + * username can be NULL, in which case the client will become anonymous, but + * must not be zero length. + * + * In the case of error, the client will be left with its original username. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success + * MOSQ_ERR_INVAL - if client is NULL, or if username is zero length + * MOSQ_ERR_NOMEM - on out of memory + */ +int mosquitto_set_username(struct mosquitto *client, const char *username); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/mosquitto_broker_internal.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/mosquitto_broker_internal.h new file mode 100644 index 0000000..540dbcb --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/mosquitto_broker_internal.h @@ -0,0 +1,747 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. + Tatsuzo Osawa - Add epoll. +*/ + +#ifndef MOSQUITTO_BROKER_INTERNAL_H +#define MOSQUITTO_BROKER_INTERNAL_H + +#include "config.h" +#include <stdio.h> + +#ifdef WITH_WEBSOCKETS +# include <libwebsockets.h> + +# if defined(LWS_LIBRARY_VERSION_NUMBER) +# define libwebsocket_callback_on_writable(A, B) lws_callback_on_writable((B)) +# define libwebsocket_service(A, B) lws_service((A), (B)) +# define libwebsocket_create_context(A) lws_create_context((A)) +# define libwebsocket_context_destroy(A) lws_context_destroy((A)) +# define libwebsocket_write(A, B, C, D) lws_write((A), (B), (C), (D)) +# define libwebsocket_get_socket_fd(A) lws_get_socket_fd((A)) +# define libwebsockets_return_http_status(A, B, C, D) lws_return_http_status((B), (C), (D)) +# define libwebsockets_get_protocol(A) lws_get_protocol((A)) +# define libwebsocket_context lws_context +# define libwebsocket_protocols lws_protocols +# define libwebsocket_callback_reasons lws_callback_reasons +# define libwebsocket lws +# else +# define lws_pollfd pollfd +# define lws_service_fd(A, B) libwebsocket_service_fd((A), (B)) +# define lws_pollargs libwebsocket_pollargs +# endif +#endif + +#include "mosquitto_internal.h" +#include "mosquitto_broker.h" +#include "mosquitto_plugin.h" +#include "mosquitto.h" +#include "tls_mosq.h" +#include "uthash.h" + +#define uhpa_malloc(size) mosquitto__malloc(size) +#define uhpa_free(ptr) mosquitto__free(ptr) +#include "uhpa.h" + +#ifndef __GNUC__ +#define __attribute__(attrib) +#endif + +/* Log destinations */ +#define MQTT3_LOG_NONE 0x00 +#define MQTT3_LOG_SYSLOG 0x01 +#define MQTT3_LOG_FILE 0x02 +#define MQTT3_LOG_STDOUT 0x04 +#define MQTT3_LOG_STDERR 0x08 +#define MQTT3_LOG_TOPIC 0x10 +#define MQTT3_LOG_ALL 0xFF + +#define WEBSOCKET_CLIENT -2 + +/* ======================================== + * UHPA data types + * ======================================== */ + +/* See uhpa.h + * + * The idea here is that there is potentially a lot of wasted space (and time) + * in malloc calls for frequent, small heap allocations. This can happen if + * small payloads are used by clients or if individual topic elements are + * small. + * + * In both cases, a struct is used that includes a void* or char* pointer to + * point to the dynamically allocated memory used. To allocate and store a + * single byte needs the size of the pointer (8 bytes on a 64 bit + * architecture), the malloc overhead and the memory allocated itself (which + * will often be larger than the memory requested, on 64 bit Linux this can be + * a minimum of 24 bytes). To allocate and store 1 byte of heap memory we need + * in this example 32 bytes. + * + * UHPA uses a union to either store data in an array, or to allocate memory on + * the heap, depending on the size of the data being stored (this does mean + * that the size of the data must always be known). Setting the size of the + * array changes the point at which heap allocation starts. Using the example + * above, this means that an array size of 32 bytes should not result in any + * wasted space, and should be quicker as well. Certainly in the case of topic + * elements (e.g. "bar" out of "foo/bar/baz") it is likely that an array size + * of 32 bytes will mean that the majority of heap allocations are removed. + * + * You can change the size of MOSQ_PAYLOAD_UNION_SIZE and + * MOSQ_TOPIC_ELEMENT_UNION_SIZE to change the size of the uhpa array used for + * the payload (i.e. the published part of a message) and for topic elements + * (e.g. "foo", "bar" or "baz" in the topic "foo/bar/baz"), and so control the + * heap allocation threshold for these data types. You should look at your + * application to decide what values to set, but don't set them too high + * otherwise your overall memory usage will increase. + * + * You could use something like heaptrack + * http://milianw.de/blog/heaptrack-a-heap-memory-profiler-for-linux to + * profile heap allocations. + * + * I would suggest that values for MOSQ_PAYLOAD_UNION_SIZE and + * MOSQ_TOPIC_UNION_SIZE that are equivalent to + * sizeof(void*)+malloc_usable_size(malloc(1)) are a safe value that should + * reduce calls to malloc without increasing memory usage at all. + */ +#define MOSQ_PAYLOAD_UNION_SIZE 8 +typedef union { + void *ptr; + char array[MOSQ_PAYLOAD_UNION_SIZE]; +} mosquitto__payload_uhpa; +#define UHPA_ALLOC_PAYLOAD(A) UHPA_ALLOC((A)->payload, (A)->payloadlen) +#define UHPA_ACCESS_PAYLOAD(A) UHPA_ACCESS((A)->payload, (A)->payloadlen) +#define UHPA_FREE_PAYLOAD(A) UHPA_FREE((A)->payload, (A)->payloadlen) +#define UHPA_MOVE_PAYLOAD(DEST, SRC) UHPA_MOVE((DEST)->payload, (SRC)->payload, (SRC)->payloadlen) + +/* ======================================== + * End UHPA data types + * ======================================== */ + +typedef uint64_t dbid_t; + +typedef int (*FUNC_auth_plugin_init_v4)(void **, struct mosquitto_opt *, int); +typedef int (*FUNC_auth_plugin_cleanup_v4)(void *, struct mosquitto_opt *, int); +typedef int (*FUNC_auth_plugin_security_init_v4)(void *, struct mosquitto_opt *, int, bool); +typedef int (*FUNC_auth_plugin_security_cleanup_v4)(void *, struct mosquitto_opt *, int, bool); +typedef int (*FUNC_auth_plugin_acl_check_v4)(void *, int, struct mosquitto *, struct mosquitto_acl_msg *); +typedef int (*FUNC_auth_plugin_unpwd_check_v4)(void *, struct mosquitto *, const char *, const char *); +typedef int (*FUNC_auth_plugin_psk_key_get_v4)(void *, struct mosquitto *, const char *, const char *, char *, int); +typedef int (*FUNC_auth_plugin_auth_start_v4)(void *, struct mosquitto *, const char *, bool, const void *, uint16_t, void **, uint16_t *); +typedef int (*FUNC_auth_plugin_auth_continue_v4)(void *, struct mosquitto *, const char *, const void *, uint16_t, void **, uint16_t *); + +typedef int (*FUNC_auth_plugin_init_v3)(void **, struct mosquitto_opt *, int); +typedef int (*FUNC_auth_plugin_cleanup_v3)(void *, struct mosquitto_opt *, int); +typedef int (*FUNC_auth_plugin_security_init_v3)(void *, struct mosquitto_opt *, int, bool); +typedef int (*FUNC_auth_plugin_security_cleanup_v3)(void *, struct mosquitto_opt *, int, bool); +typedef int (*FUNC_auth_plugin_acl_check_v3)(void *, int, const struct mosquitto *, struct mosquitto_acl_msg *); +typedef int (*FUNC_auth_plugin_unpwd_check_v3)(void *, const struct mosquitto *, const char *, const char *); +typedef int (*FUNC_auth_plugin_psk_key_get_v3)(void *, const struct mosquitto *, const char *, const char *, char *, int); + +typedef int (*FUNC_auth_plugin_init_v2)(void **, struct mosquitto_auth_opt *, int); +typedef int (*FUNC_auth_plugin_cleanup_v2)(void *, struct mosquitto_auth_opt *, int); +typedef int (*FUNC_auth_plugin_security_init_v2)(void *, struct mosquitto_auth_opt *, int, bool); +typedef int (*FUNC_auth_plugin_security_cleanup_v2)(void *, struct mosquitto_auth_opt *, int, bool); +typedef int (*FUNC_auth_plugin_acl_check_v2)(void *, const char *, const char *, const char *, int); +typedef int (*FUNC_auth_plugin_unpwd_check_v2)(void *, const char *, const char *); +typedef int (*FUNC_auth_plugin_psk_key_get_v2)(void *, const char *, const char *, char *, int); + + +enum mosquitto_msg_origin{ + mosq_mo_client = 0, + mosq_mo_broker = 1 +}; + +struct mosquitto__auth_plugin{ + void *lib; + void *user_data; + int (*plugin_version)(void); + + FUNC_auth_plugin_init_v4 plugin_init_v4; + FUNC_auth_plugin_cleanup_v4 plugin_cleanup_v4; + FUNC_auth_plugin_security_init_v4 security_init_v4; + FUNC_auth_plugin_security_cleanup_v4 security_cleanup_v4; + FUNC_auth_plugin_acl_check_v4 acl_check_v4; + FUNC_auth_plugin_unpwd_check_v4 unpwd_check_v4; + FUNC_auth_plugin_psk_key_get_v4 psk_key_get_v4; + FUNC_auth_plugin_auth_start_v4 auth_start_v4; + FUNC_auth_plugin_auth_continue_v4 auth_continue_v4; + + FUNC_auth_plugin_init_v3 plugin_init_v3; + FUNC_auth_plugin_cleanup_v3 plugin_cleanup_v3; + FUNC_auth_plugin_security_init_v3 security_init_v3; + FUNC_auth_plugin_security_cleanup_v3 security_cleanup_v3; + FUNC_auth_plugin_acl_check_v3 acl_check_v3; + FUNC_auth_plugin_unpwd_check_v3 unpwd_check_v3; + FUNC_auth_plugin_psk_key_get_v3 psk_key_get_v3; + + FUNC_auth_plugin_init_v2 plugin_init_v2; + FUNC_auth_plugin_cleanup_v2 plugin_cleanup_v2; + FUNC_auth_plugin_security_init_v2 security_init_v2; + FUNC_auth_plugin_security_cleanup_v2 security_cleanup_v2; + FUNC_auth_plugin_acl_check_v2 acl_check_v2; + FUNC_auth_plugin_unpwd_check_v2 unpwd_check_v2; + FUNC_auth_plugin_psk_key_get_v2 psk_key_get_v2; + int version; +}; + +struct mosquitto__auth_plugin_config +{ + char *path; + struct mosquitto_opt *options; + int option_count; + bool deny_special_chars; + + struct mosquitto__auth_plugin plugin; +}; + +struct mosquitto__security_options { + /* Any options that get added here also need considering + * in config__read() with regards whether allow_anonymous + * should be disabled when these options are set. + */ + struct mosquitto__acl_user *acl_list; + struct mosquitto__acl *acl_patterns; + char *password_file; + char *psk_file; + char *acl_file; + struct mosquitto__auth_plugin_config *auth_plugin_configs; + int auth_plugin_config_count; + int8_t allow_anonymous; + bool allow_zero_length_clientid; + char *auto_id_prefix; + int auto_id_prefix_len; +}; + +struct mosquitto__listener { + int fd; + uint16_t port; + char *host; + char *bind_interface; + int max_connections; + char *mount_point; + mosq_sock_t *socks; + int sock_count; + int client_count; + enum mosquitto_protocol protocol; + int socket_domain; + bool use_username_as_clientid; + uint8_t maximum_qos; + uint16_t max_topic_alias; +#ifdef WITH_TLS + char *cafile; + char *capath; + char *certfile; + char *keyfile; + char *tls_engine; + char *tls_engine_kpass_sha1; + char *ciphers; + char *psk_hint; + SSL_CTX *ssl_ctx; + char *crlfile; + char *tls_version; + char *dhparamfile; + bool use_identity_as_username; + bool use_subject_as_username; + bool require_certificate; + enum mosquitto__keyform tls_keyform; +#endif +#ifdef WITH_WEBSOCKETS + struct libwebsocket_context *ws_context; + char *http_dir; + struct libwebsocket_protocols *ws_protocol; +#endif + struct mosquitto__security_options security_options; + struct mosquitto__unpwd *unpwd; + struct mosquitto__unpwd *psk_id; +}; + +struct mosquitto__config { + bool allow_duplicate_messages; + int autosave_interval; + bool autosave_on_changes; + bool check_retain_source; + char *clientid_prefixes; + bool connection_messages; + bool daemon; + struct mosquitto__listener default_listener; + struct mosquitto__listener *listeners; + int listener_count; + int log_dest; + int log_facility; + int log_type; + bool log_timestamp; + char *log_timestamp_format; + char *log_file; + FILE *log_fptr; + uint16_t max_inflight_messages; + uint16_t max_keepalive; + uint32_t max_packet_size; + uint32_t message_size_limit; + bool persistence; + char *persistence_location; + char *persistence_file; + char *persistence_filepath; + time_t persistent_client_expiration; + char *pid_file; + bool queue_qos0_messages; + bool per_listener_settings; + bool retain_available; + bool set_tcp_nodelay; + int sys_interval; + bool upgrade_outgoing_qos; + char *user; +#ifdef WITH_WEBSOCKETS + int websockets_log_level; + int websockets_headers_size; + bool have_websockets_listener; +#endif +#ifdef WITH_BRIDGE + struct mosquitto__bridge *bridges; + int bridge_count; +#endif + struct mosquitto__security_options security_options; +}; + +struct mosquitto__subleaf { + struct mosquitto__subleaf *prev; + struct mosquitto__subleaf *next; + struct mosquitto *context; + uint32_t identifier; + uint8_t qos; + bool no_local; + bool retain_as_published; +}; + + +struct mosquitto__subshared_ref { + struct mosquitto__subhier *hier; + struct mosquitto__subshared *shared; +}; + + +struct mosquitto__subshared { + UT_hash_handle hh; + char *name; + struct mosquitto__subleaf *subs; +}; + +struct mosquitto__subhier { + UT_hash_handle hh; + struct mosquitto__subhier *parent; + struct mosquitto__subhier *children; + struct mosquitto__subleaf *subs; + struct mosquitto__subshared *shared; + struct mosquitto_msg_store *retained; + char *topic; + uint16_t topic_len; +}; + +struct mosquitto_msg_store_load{ + UT_hash_handle hh; + dbid_t db_id; + struct mosquitto_msg_store *store; +}; + +struct mosquitto_msg_store{ + struct mosquitto_msg_store *next; + struct mosquitto_msg_store *prev; + dbid_t db_id; + char *source_id; + char *source_username; + struct mosquitto__listener *source_listener; + char **dest_ids; + int dest_id_count; + int ref_count; + char* topic; + mosquitto_property *properties; + mosquitto__payload_uhpa payload; + time_t message_expiry_time; + uint32_t payloadlen; + uint16_t source_mid; + uint16_t mid; + uint8_t qos; + bool retain; + uint8_t origin; +}; + +struct mosquitto_client_msg{ + struct mosquitto_client_msg *prev; + struct mosquitto_client_msg *next; + struct mosquitto_msg_store *store; + mosquitto_property *properties; + time_t timestamp; + uint16_t mid; + uint8_t qos; + bool retain; + enum mosquitto_msg_direction direction; + enum mosquitto_msg_state state; + bool dup; +}; + +struct mosquitto__unpwd{ + char *username; + char *password; +#ifdef WITH_TLS + unsigned int password_len; + unsigned int salt_len; + unsigned char *salt; +#endif + UT_hash_handle hh; +}; + +struct mosquitto__acl{ + struct mosquitto__acl *next; + char *topic; + int access; + int ucount; + int ccount; +}; + +struct mosquitto__acl_user{ + struct mosquitto__acl_user *next; + char *username; + struct mosquitto__acl *acl; +}; + +struct mosquitto_db{ + dbid_t last_db_id; + struct mosquitto__subhier *subs; + struct mosquitto__unpwd *unpwd; + struct mosquitto__unpwd *psk_id; + struct mosquitto *contexts_by_id; + struct mosquitto *contexts_by_sock; + struct mosquitto *contexts_for_free; +#ifdef WITH_BRIDGE + struct mosquitto **bridges; +#endif + struct clientid__index_hash *clientid_index_hash; + struct mosquitto_msg_store *msg_store; + struct mosquitto_msg_store_load *msg_store_load; +#ifdef WITH_BRIDGE + int bridge_count; +#endif + int msg_store_count; + unsigned long msg_store_bytes; + char *config_file; + struct mosquitto__config *config; + int auth_plugin_count; + bool verbose; +#ifdef WITH_SYS_TREE + int subscription_count; + int shared_subscription_count; + int retained_count; +#endif + int persistence_changes; + struct mosquitto *ll_for_free; +#ifdef WITH_EPOLL + int epollfd; +#endif +}; + +enum mosquitto__bridge_direction{ + bd_out = 0, + bd_in = 1, + bd_both = 2 +}; + +enum mosquitto_bridge_start_type{ + bst_automatic = 0, + bst_lazy = 1, + bst_manual = 2, + bst_once = 3 +}; + +struct mosquitto__bridge_topic{ + char *topic; + int qos; + enum mosquitto__bridge_direction direction; + char *local_prefix; + char *remote_prefix; + char *local_topic; /* topic prefixed with local_prefix */ + char *remote_topic; /* topic prefixed with remote_prefix */ +}; + +struct bridge_address{ + char *address; + int port; +}; + +struct mosquitto__bridge{ + char *name; + struct bridge_address *addresses; + int cur_address; + int address_count; + time_t primary_retry; + mosq_sock_t primary_retry_sock; + bool round_robin; + bool try_private; + bool try_private_accepted; + bool clean_start; + int keepalive; + struct mosquitto__bridge_topic *topics; + int topic_count; + bool topic_remapping; + enum mosquitto__protocol protocol_version; + time_t restart_t; + char *remote_clientid; + char *remote_username; + char *remote_password; + char *local_clientid; + char *local_username; + char *local_password; + char *notification_topic; + bool notifications; + bool notifications_local_only; + enum mosquitto_bridge_start_type start_type; + int idle_timeout; + int restart_timeout; + int backoff_base; + int backoff_cap; + int threshold; + bool lazy_reconnect; + bool attempt_unsubscribe; + bool initial_notification_done; +#ifdef WITH_TLS + bool tls_insecure; + bool tls_ocsp_required; + char *tls_cafile; + char *tls_capath; + char *tls_certfile; + char *tls_keyfile; + char *tls_version; + char *tls_alpn; +# ifdef FINAL_WITH_TLS_PSK + char *tls_psk_identity; + char *tls_psk; +# endif +#endif +}; + +#ifdef WITH_WEBSOCKETS +struct libws_mqtt_hack { + char *http_dir; +}; + +struct libws_mqtt_data { + struct mosquitto *mosq; +}; +#endif + +#include <net_mosq.h> + +/* ============================================================ + * Main functions + * ============================================================ */ +int mosquitto_main_loop(struct mosquitto_db *db, mosq_sock_t *listensock, int listensock_count); +struct mosquitto_db *mosquitto__get_db(void); + +/* ============================================================ + * Config functions + * ============================================================ */ +/* Initialise config struct to default values. */ +void config__init(struct mosquitto_db *db, struct mosquitto__config *config); +/* Parse command line options into config. */ +int config__parse_args(struct mosquitto_db *db, struct mosquitto__config *config, int argc, char *argv[]); +/* Read configuration data from config->config_file into config. + * If reload is true, don't process config options that shouldn't be reloaded (listeners etc) + * Returns 0 on success, 1 if there is a configuration error or if a file cannot be opened. + */ +int config__read(struct mosquitto_db *db, struct mosquitto__config *config, bool reload); +/* Free all config data. */ +void config__cleanup(struct mosquitto__config *config); +int config__get_dir_files(const char *include_dir, char ***files, int *file_count); + +int drop_privileges(struct mosquitto__config *config, bool temporary); +int restore_privileges(void); + +/* ============================================================ + * Server send functions + * ============================================================ */ +int send__connack(struct mosquitto_db *db, struct mosquitto *context, int ack, int reason_code, const mosquitto_property *properties); +int send__suback(struct mosquitto *context, uint16_t mid, uint32_t payloadlen, const void *payload); +int send__unsuback(struct mosquitto *context, uint16_t mid, int reason_code_count, uint8_t *reason_codes, const mosquitto_property *properties); +int send__auth(struct mosquitto_db *db, struct mosquitto *context, int reason_code, const void *auth_data, uint16_t auth_data_len); + +/* ============================================================ + * Network functions + * ============================================================ */ +void net__broker_init(void); +void net__broker_cleanup(void); +int net__socket_accept(struct mosquitto_db *db, mosq_sock_t listensock); +int net__socket_listen(struct mosquitto__listener *listener); +int net__socket_get_address(mosq_sock_t sock, char *buf, int len); + +/* ============================================================ + * Read handling functions + * ============================================================ */ +int handle__packet(struct mosquitto_db *db, struct mosquitto *context); +int handle__connack(struct mosquitto_db *db, struct mosquitto *context); +int handle__connect(struct mosquitto_db *db, struct mosquitto *context); +int handle__disconnect(struct mosquitto_db *db, struct mosquitto *context); +int handle__publish(struct mosquitto_db *db, struct mosquitto *context); +int handle__subscribe(struct mosquitto_db *db, struct mosquitto *context); +int handle__unsubscribe(struct mosquitto_db *db, struct mosquitto *context); +int handle__auth(struct mosquitto_db *db, struct mosquitto *context); + +/* ============================================================ + * Database handling + * ============================================================ */ +int db__open(struct mosquitto__config *config, struct mosquitto_db *db); +int db__close(struct mosquitto_db *db); +#ifdef WITH_PERSISTENCE +int persist__backup(struct mosquitto_db *db, bool shutdown); +int persist__restore(struct mosquitto_db *db); +#endif +void db__limits_set(unsigned long inflight_bytes, int queued, unsigned long queued_bytes); +/* Return the number of in-flight messages in count. */ +int db__message_count(int *count); +int db__message_delete_outgoing(struct mosquitto_db *db, struct mosquitto *context, uint16_t mid, enum mosquitto_msg_state expect_state, int qos); +int db__message_insert(struct mosquitto_db *db, struct mosquitto *context, uint16_t mid, enum mosquitto_msg_direction dir, int qos, bool retain, struct mosquitto_msg_store *stored, mosquitto_property *properties); +int db__message_release_incoming(struct mosquitto_db *db, struct mosquitto *context, uint16_t mid); +int db__message_update_outgoing(struct mosquitto *context, uint16_t mid, enum mosquitto_msg_state state, int qos); +int db__message_write(struct mosquitto_db *db, struct mosquitto *context); +void db__message_dequeue_first(struct mosquitto *context, struct mosquitto_msg_data *msg_data); +int db__messages_delete(struct mosquitto_db *db, struct mosquitto *context); +int db__messages_easy_queue(struct mosquitto_db *db, struct mosquitto *context, const char *topic, int qos, uint32_t payloadlen, const void *payload, int retain, uint32_t message_expiry_interval, mosquitto_property **properties); +int db__message_store(struct mosquitto_db *db, const struct mosquitto *source, uint16_t source_mid, char *topic, int qos, uint32_t payloadlen, mosquitto__payload_uhpa *payload, int retain, struct mosquitto_msg_store **stored, uint32_t message_expiry_interval, mosquitto_property *properties, dbid_t store_id, enum mosquitto_msg_origin origin); +int db__message_store_find(struct mosquitto *context, uint16_t mid, struct mosquitto_msg_store **stored); +void db__msg_store_add(struct mosquitto_db *db, struct mosquitto_msg_store *store); +void db__msg_store_remove(struct mosquitto_db *db, struct mosquitto_msg_store *store); +void db__msg_store_ref_inc(struct mosquitto_msg_store *store); +void db__msg_store_ref_dec(struct mosquitto_db *db, struct mosquitto_msg_store **store); +void db__msg_store_clean(struct mosquitto_db *db); +void db__msg_store_compact(struct mosquitto_db *db); +int db__message_reconnect_reset(struct mosquitto_db *db, struct mosquitto *context); +void sys_tree__init(struct mosquitto_db *db); +void sys_tree__update(struct mosquitto_db *db, int interval, time_t start_time); + +/* ============================================================ + * Subscription functions + * ============================================================ */ +int sub__add(struct mosquitto_db *db, struct mosquitto *context, const char *sub, int qos, uint32_t identifier, int options, struct mosquitto__subhier **root); +struct mosquitto__subhier *sub__add_hier_entry(struct mosquitto__subhier *parent, struct mosquitto__subhier **sibling, const char *topic, size_t len); +int sub__remove(struct mosquitto_db *db, struct mosquitto *context, const char *sub, struct mosquitto__subhier *root, uint8_t *reason); +void sub__tree_print(struct mosquitto__subhier *root, int level); +int sub__clean_session(struct mosquitto_db *db, struct mosquitto *context); +int sub__retain_queue(struct mosquitto_db *db, struct mosquitto *context, const char *sub, int sub_qos, uint32_t subscription_identifier); +int sub__messages_queue(struct mosquitto_db *db, const char *source_id, const char *topic, int qos, int retain, struct mosquitto_msg_store **stored); + +/* ============================================================ + * Context functions + * ============================================================ */ +struct mosquitto *context__init(struct mosquitto_db *db, mosq_sock_t sock); +void context__cleanup(struct mosquitto_db *db, struct mosquitto *context, bool do_free); +void context__disconnect(struct mosquitto_db *db, struct mosquitto *context); +void context__add_to_disused(struct mosquitto_db *db, struct mosquitto *context); +void context__free_disused(struct mosquitto_db *db); +void context__send_will(struct mosquitto_db *db, struct mosquitto *context); +void context__remove_from_by_id(struct mosquitto_db *db, struct mosquitto *context); +void context__set_state(struct mosquitto *context, enum mosquitto_client_state state); + +int connect__on_authorised(struct mosquitto_db *db, struct mosquitto *context, void *auth_data_out, uint16_t auth_data_out_len); + +/* ============================================================ + * Logging functions + * ============================================================ */ +int log__init(struct mosquitto__config *config); +int log__close(struct mosquitto__config *config); +int log__printf(struct mosquitto *mosq, int level, const char *fmt, ...) __attribute__((format(printf, 3, 4))); +void log__internal(const char *fmt, ...) __attribute__((format(printf, 1, 2))); + +/* ============================================================ + * Bridge functions + * ============================================================ */ +#ifdef WITH_BRIDGE +int bridge__new(struct mosquitto_db *db, struct mosquitto__bridge *bridge); +int bridge__connect(struct mosquitto_db *db, struct mosquitto *context); +int bridge__connect_step1(struct mosquitto_db *db, struct mosquitto *context); +int bridge__connect_step2(struct mosquitto_db *db, struct mosquitto *context); +int bridge__connect_step3(struct mosquitto_db *db, struct mosquitto *context); +void bridge__packet_cleanup(struct mosquitto *context); +#endif + +/* ============================================================ + * Property related functions + * ============================================================ */ +int property__process_connect(struct mosquitto *context, mosquitto_property **props); +int property__process_will(struct mosquitto *context, struct mosquitto_message_all *msg, mosquitto_property **props); +int property__process_disconnect(struct mosquitto *context, mosquitto_property **props); + +/* ============================================================ + * Security related functions + * ============================================================ */ +int acl__find_acls(struct mosquitto_db *db, struct mosquitto *context); +int mosquitto_security_module_init(struct mosquitto_db *db); +int mosquitto_security_module_cleanup(struct mosquitto_db *db); + +int mosquitto_security_init(struct mosquitto_db *db, bool reload); +int mosquitto_security_apply(struct mosquitto_db *db); +int mosquitto_security_cleanup(struct mosquitto_db *db, bool reload); +int mosquitto_acl_check(struct mosquitto_db *db, struct mosquitto *context, const char *topic, long payloadlen, void* payload, int qos, bool retain, int access); +int mosquitto_unpwd_check(struct mosquitto_db *db, struct mosquitto *context, const char *username, const char *password); +int mosquitto_psk_key_get(struct mosquitto_db *db, struct mosquitto *context, const char *hint, const char *identity, char *key, int max_key_len); + +int mosquitto_security_init_default(struct mosquitto_db *db, bool reload); +int mosquitto_security_apply_default(struct mosquitto_db *db); +int mosquitto_security_cleanup_default(struct mosquitto_db *db, bool reload); +int mosquitto_acl_check_default(struct mosquitto_db *db, struct mosquitto *context, const char *topic, int access); +int mosquitto_unpwd_check_default(struct mosquitto_db *db, struct mosquitto *context, const char *username, const char *password); +int mosquitto_psk_key_get_default(struct mosquitto_db *db, struct mosquitto *context, const char *hint, const char *identity, char *key, int max_key_len); + +int mosquitto_security_auth_start(struct mosquitto_db *db, struct mosquitto *context, bool reauth, const void *data_in, uint16_t data_in_len, void **data_out, uint16_t *data_out_len); +int mosquitto_security_auth_continue(struct mosquitto_db *db, struct mosquitto *context, const void *data_in, uint16_t data_len, void **data_out, uint16_t *data_out_len); + +/* ============================================================ + * Session expiry + * ============================================================ */ +int session_expiry__add(struct mosquitto_db *db, struct mosquitto *context); +void session_expiry__remove(struct mosquitto *context); +void session_expiry__remove_all(struct mosquitto_db *db); +void session_expiry__check(struct mosquitto_db *db, time_t now); +void session_expiry__send_all(struct mosquitto_db *db); + +/* ============================================================ + * Window service and signal related functions + * ============================================================ */ +#if defined(WIN32) || defined(__CYGWIN__) +void service_install(void); +void service_uninstall(void); +void service_run(void); + +DWORD WINAPI SigThreadProc(void* data); +#endif + +/* ============================================================ + * Websockets related functions + * ============================================================ */ +#ifdef WITH_WEBSOCKETS +# if defined(LWS_LIBRARY_VERSION_NUMBER) +struct lws_context *mosq_websockets_init(struct mosquitto__listener *listener, const struct mosquitto__config *conf); +# else +struct libwebsocket_context *mosq_websockets_init(struct mosquitto__listener *listener, const struct mosquitto__config *conf); +# endif +#endif +void do_disconnect(struct mosquitto_db *db, struct mosquitto *context, int reason); + +/* ============================================================ + * Will delay + * ============================================================ */ +int will_delay__add(struct mosquitto *context); +void will_delay__check(struct mosquitto_db *db, time_t now); +void will_delay__send_all(struct mosquitto_db *db); +void will_delay__remove(struct mosquitto *mosq); + +#endif + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/mosquitto_passwd.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/mosquitto_passwd.c new file mode 100644 index 0000000..afe3e19 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/mosquitto_passwd.c @@ -0,0 +1,622 @@ +/* +Copyright (c) 2012-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <errno.h> +#include <openssl/opensslv.h> +#include <openssl/evp.h> +#include <openssl/rand.h> +#include <openssl/buffer.h> +#include <signal.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + + +#ifdef WIN32 +# include <windows.h> +# include <process.h> +# ifndef __cplusplus +# if defined(_MSC_VER) && _MSC_VER < 1900 +# define bool char +# define true 1 +# define false 0 +# else +# include <stdbool.h> +# endif +# endif +# define snprintf sprintf_s +# include <io.h> +# include <windows.h> +#else +# include <stdbool.h> +# include <unistd.h> +# include <termios.h> +# include <sys/stat.h> +#endif + +#define MAX_BUFFER_LEN 1024 +#define SALT_LEN 12 + +#ifdef WIN32 +static FILE *mpw_tmpfile(void) +{ + return tmpfile(); +} +#else + +static char alphanum[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + +static unsigned char tmpfile_path[36]; +static FILE *mpw_tmpfile(void) +{ + int fd; + size_t i; + + if(RAND_bytes(tmpfile_path, sizeof(tmpfile_path)) != 1){ + return NULL; + } + + strcpy((char *)tmpfile_path, "/tmp/"); + + for(i=strlen((char *)tmpfile_path); i<sizeof(tmpfile_path)-8; i++){ + tmpfile_path[i] = alphanum[tmpfile_path[i]%(sizeof(alphanum)-1)]; + } + tmpfile_path[sizeof(tmpfile_path)-8] = '-'; + for(i=sizeof(tmpfile_path)-7; i<sizeof(tmpfile_path)-1; i++){ + tmpfile_path[i] = 'X'; + } + tmpfile_path[sizeof(tmpfile_path)-1] = '\0'; + + umask(077); + fd = mkstemp((char *)tmpfile_path); + if(fd < 0) return NULL; + unlink((char *)tmpfile_path); + + return fdopen(fd, "w+"); +} +#endif + + +int base64_encode(unsigned char *in, unsigned int in_len, char **encoded) +{ + BIO *bmem, *b64; + BUF_MEM *bptr; + + b64 = BIO_new(BIO_f_base64()); + BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL); + bmem = BIO_new(BIO_s_mem()); + b64 = BIO_push(b64, bmem); + BIO_write(b64, in, in_len); + if(BIO_flush(b64) != 1){ + BIO_free_all(b64); + return 1; + } + BIO_get_mem_ptr(b64, &bptr); + *encoded = malloc(bptr->length+1); + if(!(*encoded)){ + BIO_free_all(b64); + return 1; + } + memcpy(*encoded, bptr->data, bptr->length); + (*encoded)[bptr->length] = '\0'; + BIO_free_all(b64); + + return 0; +} + + +void print_usage(void) +{ + printf("mosquitto_passwd is a tool for managing password files for mosquitto.\n\n"); + printf("Usage: mosquitto_passwd [-c | -D] passwordfile username\n"); + printf(" mosquitto_passwd -b passwordfile username password\n"); + printf(" mosquitto_passwd -U passwordfile\n"); + printf(" -b : run in batch mode to allow passing passwords on the command line.\n"); + printf(" -c : create a new password file. This will overwrite existing files.\n"); + printf(" -D : delete the username rather than adding/updating its password.\n"); + printf(" -U : update a plain text password file to use hashed passwords.\n"); + printf("\nSee https://mosquitto.org/ for more information.\n\n"); +} + +int output_new_password(FILE *fptr, const char *username, const char *password) +{ + int rc; + unsigned char salt[SALT_LEN]; + char *salt64 = NULL, *hash64 = NULL; + unsigned char hash[EVP_MAX_MD_SIZE]; + unsigned int hash_len; + const EVP_MD *digest; +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_MD_CTX context; +#else + EVP_MD_CTX *context; +#endif + + rc = RAND_bytes(salt, SALT_LEN); + if(!rc){ + fprintf(stderr, "Error: Insufficient entropy available to perform password generation.\n"); + return 1; + } + + rc = base64_encode(salt, SALT_LEN, &salt64); + if(rc){ + free(salt64); + fprintf(stderr, "Error: Unable to encode salt.\n"); + return 1; + } + + + digest = EVP_get_digestbyname("sha512"); + if(!digest){ + free(salt64); + fprintf(stderr, "Error: Unable to create openssl digest.\n"); + return 1; + } + +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_MD_CTX_init(&context); + EVP_DigestInit_ex(&context, digest, NULL); + EVP_DigestUpdate(&context, password, strlen(password)); + EVP_DigestUpdate(&context, salt, SALT_LEN); + EVP_DigestFinal_ex(&context, hash, &hash_len); + EVP_MD_CTX_cleanup(&context); +#else + context = EVP_MD_CTX_new(); + EVP_DigestInit_ex(context, digest, NULL); + EVP_DigestUpdate(context, password, strlen(password)); + EVP_DigestUpdate(context, salt, SALT_LEN); + EVP_DigestFinal_ex(context, hash, &hash_len); + EVP_MD_CTX_free(context); +#endif + + rc = base64_encode(hash, hash_len, &hash64); + if(rc){ + free(salt64); + free(hash64); + fprintf(stderr, "Error: Unable to encode hash.\n"); + return 1; + } + + fprintf(fptr, "%s:$6$%s$%s\n", username, salt64, hash64); + free(salt64); + free(hash64); + + return 0; +} + +int delete_pwuser(FILE *fptr, FILE *ftmp, const char *username) +{ + char buf[MAX_BUFFER_LEN]; + char lbuf[MAX_BUFFER_LEN], *token; + bool found = false; + int line = 0; + + while(!feof(fptr) && fgets(buf, MAX_BUFFER_LEN, fptr)){ + line++; + memcpy(lbuf, buf, MAX_BUFFER_LEN); + token = strtok(lbuf, ":"); + if(!token){ + fprintf(stderr, "Error: Corrupt password file at line %d.\n", line); + return 1; + } + + if(strcmp(username, token)){ + fprintf(ftmp, "%s", buf); + }else{ + found = true; + } + } + if(!found){ + fprintf(stderr, "Warning: User %s not found in password file.\n", username); + } + return 0; +} + +int update_file(FILE *fptr, FILE *ftmp) +{ + char buf[MAX_BUFFER_LEN]; + char lbuf[MAX_BUFFER_LEN]; + char *username, *password; + int rc; + int len; + + while(!feof(fptr) && fgets(buf, MAX_BUFFER_LEN, fptr)){ + memcpy(lbuf, buf, MAX_BUFFER_LEN); + username = strtok(lbuf, ":"); + password = strtok(NULL, ":"); + if(password){ + len = strlen(password); + while(len && (password[len-1] == '\n' || password[len-1] == '\r')){ + password[len-1] = '\0'; + len = strlen(password); + } + rc = output_new_password(ftmp, username, password); + if(rc) return rc; + }else{ + fprintf(ftmp, "%s", username); + } + } + return 0; +} + +int update_pwuser(FILE *fptr, FILE *ftmp, const char *username, const char *password) +{ + char buf[MAX_BUFFER_LEN]; + char lbuf[MAX_BUFFER_LEN], *token; + bool found = false; + int rc = 1; + int line = 0; + + while(!feof(fptr) && fgets(buf, MAX_BUFFER_LEN, fptr)){ + line++; + memcpy(lbuf, buf, MAX_BUFFER_LEN); + token = strtok(lbuf, ":"); + if(!token){ + fprintf(stderr, "Error: Corrupt password file at line %d.\n", line); + return 1; + } + + if(strcmp(username, token)){ + fprintf(ftmp, "%s", buf); + }else{ + rc = output_new_password(ftmp, username, password); + found = true; + } + } + if(found){ + return rc; + }else{ + return output_new_password(ftmp, username, password); + } +} + +int gets_quiet(char *s, int len) +{ +#ifdef WIN32 + HANDLE h; + DWORD con_orig, con_quiet = 0; + DWORD read_len = 0; + + memset(s, 0, len); + h = GetStdHandle(STD_INPUT_HANDLE); + GetConsoleMode(h, &con_orig); + con_quiet = con_orig; + con_quiet &= ~ENABLE_ECHO_INPUT; + con_quiet |= ENABLE_LINE_INPUT; + SetConsoleMode(h, con_quiet); + if(!ReadConsole(h, s, len, &read_len, NULL)){ + SetConsoleMode(h, con_orig); + return 1; + } + while(s[strlen(s)-1] == 10 || s[strlen(s)-1] == 13){ + s[strlen(s)-1] = 0; + } + if(strlen(s) == 0){ + return 1; + } + SetConsoleMode(h, con_orig); + + return 0; +#else + struct termios ts_quiet, ts_orig; + char *rs; + + memset(s, 0, len); + tcgetattr(0, &ts_orig); + ts_quiet = ts_orig; + ts_quiet.c_lflag &= ~(ECHO | ICANON); + tcsetattr(0, TCSANOW, &ts_quiet); + + rs = fgets(s, len, stdin); + tcsetattr(0, TCSANOW, &ts_orig); + + if(!rs){ + return 1; + }else{ + while(s[strlen(s)-1] == 10 || s[strlen(s)-1] == 13){ + s[strlen(s)-1] = 0; + } + if(strlen(s) == 0){ + return 1; + } + } + return 0; +#endif +} + +int get_password(char *password, int len) +{ + char pw1[MAX_BUFFER_LEN], pw2[MAX_BUFFER_LEN]; + + printf("Password: "); + fflush(stdout); + if(gets_quiet(pw1, MAX_BUFFER_LEN)){ + fprintf(stderr, "Error: Empty password.\n"); + return 1; + } + printf("\n"); + + printf("Reenter password: "); + fflush(stdout); + if(gets_quiet(pw2, MAX_BUFFER_LEN)){ + fprintf(stderr, "Error: Empty password.\n"); + return 1; + } + printf("\n"); + + if(strcmp(pw1, pw2)){ + fprintf(stderr, "Error: Passwords do not match.\n"); + return 1; + } + + strncpy(password, pw1, len); + return 0; +} + +int copy_contents(FILE *src, FILE *dest) +{ + char buf[MAX_BUFFER_LEN]; + size_t len; + + rewind(src); + rewind(dest); + +#ifdef WIN32 + _chsize(fileno(dest), 0); +#else + if(ftruncate(fileno(dest), 0)) return 1; +#endif + + while(!feof(src)){ + len = fread(buf, 1, MAX_BUFFER_LEN, src); + if(len > 0){ + if(fwrite(buf, 1, len, dest) != len){ + return 1; + } + }else{ + return !feof(src); + } + } + return 0; +} + +int create_backup(const char *backup_file, FILE *fptr) +{ + FILE *fbackup; + + fbackup = fopen(backup_file, "wt"); + if(!fbackup){ + fprintf(stderr, "Error creating backup password file \"%s\", not continuing.\n", backup_file); + return 1; + } + if(copy_contents(fptr, fbackup)){ + fprintf(stderr, "Error copying data to backup password file \"%s\", not continuing.\n", backup_file); + fclose(fbackup); + return 1; + } + fclose(fbackup); + rewind(fptr); + return 0; +} +void handle_sigint(int signal) +{ +#ifndef WIN32 + struct termios ts; + + tcgetattr(0, &ts); + ts.c_lflag |= ECHO | ICANON; + tcsetattr(0, TCSANOW, &ts); +#endif + + UNUSED(signal); + + exit(0); +} + +int main(int argc, char *argv[]) +{ + char *password_file_tmp = NULL; + char *password_file = NULL; + char *username = NULL; + char *password_cmd = NULL; + bool batch_mode = false; + bool create_new = false; + bool delete_user = false; + FILE *fptr, *ftmp; + char password[MAX_BUFFER_LEN]; + int rc; + bool do_update_file = false; + char *backup_file; + + signal(SIGINT, handle_sigint); + signal(SIGTERM, handle_sigint); + +#if OPENSSL_VERSION_NUMBER < 0x10100000L || OPENSSL_API_COMPAT < 0x10100000L + OpenSSL_add_all_digests(); +#else + OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \ + | OPENSSL_INIT_ADD_ALL_DIGESTS \ + | OPENSSL_INIT_LOAD_CONFIG, NULL); +#endif + + if(argc == 1){ + print_usage(); + return 1; + } + + if(!strcmp(argv[1], "-c")){ + create_new = true; + if(argc != 4){ + fprintf(stderr, "Error: -c argument given but password file or username missing.\n"); + return 1; + }else{ + password_file_tmp = argv[2]; + username = argv[3]; + } + }else if(!strcmp(argv[1], "-D")){ + delete_user = true; + if(argc != 4){ + fprintf(stderr, "Error: -D argument given but password file or username missing.\n"); + return 1; + }else{ + password_file_tmp = argv[2]; + username = argv[3]; + } + }else if(!strcmp(argv[1], "-b")){ + batch_mode = true; + if(argc != 5){ + fprintf(stderr, "Error: -b argument given but password file, username or password missing.\n"); + return 1; + }else{ + password_file_tmp = argv[2]; + username = argv[3]; + password_cmd = argv[4]; + } + }else if(!strcmp(argv[1], "-U")){ + if(argc != 3){ + fprintf(stderr, "Error: -U argument given but password file missing.\n"); + return 1; + }else{ + do_update_file = true; + password_file_tmp = argv[2]; + } + }else if(argc == 3){ + password_file_tmp = argv[1]; + username = argv[2]; + }else{ + print_usage(); + return 1; + } + +#ifdef WIN32 + password_file = _fullpath(NULL, password_file_tmp, 0); + if(!password_file){ + fprintf(stderr, "Error getting full path for password file.\n"); + return 1; + } +#else + password_file = realpath(password_file_tmp, NULL); + if(!password_file){ + if(errno == ENOENT){ + password_file = strdup(password_file_tmp); + if(!password_file){ + fprintf(stderr, "Error: Out of memory.\n"); + return 1; + } + }else{ + fprintf(stderr, "Error reading password file: %s\n", strerror(errno)); + return 1; + } + } +#endif + + if(create_new){ + rc = get_password(password, 1024); + if(rc){ + free(password_file); + return rc; + } + fptr = fopen(password_file, "wt"); + if(!fptr){ + fprintf(stderr, "Error: Unable to open file %s for writing. %s.\n", password_file, strerror(errno)); + free(password_file); + return 1; + } + free(password_file); + rc = output_new_password(fptr, username, password); + fclose(fptr); + return rc; + }else{ + fptr = fopen(password_file, "r+t"); + if(!fptr){ + fprintf(stderr, "Error: Unable to open password file %s. %s.\n", password_file, strerror(errno)); + free(password_file); + return 1; + } + + backup_file = malloc(strlen(password_file)+5); + if(!backup_file){ + fprintf(stderr, "Error: Out of memory.\n"); + free(password_file); + return 1; + } + snprintf(backup_file, strlen(password_file)+5, "%s.tmp", password_file); + free(password_file); + password_file = NULL; + + if(create_backup(backup_file, fptr)){ + fclose(fptr); + free(backup_file); + return 1; + } + + ftmp = mpw_tmpfile(); + if(!ftmp){ + fprintf(stderr, "Error: Unable to open temporary file. %s.\n", strerror(errno)); + fclose(fptr); + free(backup_file); + return 1; + } + if(delete_user){ + rc = delete_pwuser(fptr, ftmp, username); + }else if(do_update_file){ + rc = update_file(fptr, ftmp); + }else{ + if(batch_mode){ + /* Update password for individual user */ + rc = update_pwuser(fptr, ftmp, username, password_cmd); + }else{ + rc = get_password(password, 1024); + if(rc){ + fclose(fptr); + fclose(ftmp); + unlink(backup_file); + free(backup_file); + return rc; + } + /* Update password for individual user */ + rc = update_pwuser(fptr, ftmp, username, password); + } + } + if(rc){ + fclose(fptr); + fclose(ftmp); + unlink(backup_file); + free(backup_file); + return rc; + } + + if(copy_contents(ftmp, fptr)){ + fclose(fptr); + fclose(ftmp); + fprintf(stderr, "Error occurred updating password file.\n"); + fprintf(stderr, "Password file may be corrupt, check the backup file: %s.\n", backup_file); + free(backup_file); + return 1; + } + fclose(fptr); + fclose(ftmp); + + /* Everything was ok so backup no longer needed. May contain old + * passwords so shouldn't be kept around. */ + unlink(backup_file); + free(backup_file); + } + + return 0; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/mosquitto_plugin.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/mosquitto_plugin.h new file mode 100644 index 0000000..83e55eb --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/mosquitto_plugin.h @@ -0,0 +1,318 @@ +/* +Copyright (c) 2012-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef MOSQUITTO_PLUGIN_H +#define MOSQUITTO_PLUGIN_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define MOSQ_AUTH_PLUGIN_VERSION 4 + +#define MOSQ_ACL_NONE 0x00 +#define MOSQ_ACL_READ 0x01 +#define MOSQ_ACL_WRITE 0x02 +#define MOSQ_ACL_SUBSCRIBE 0x04 + +#include <stdbool.h> + +struct mosquitto; + +struct mosquitto_opt { + char *key; + char *value; +}; + +struct mosquitto_auth_opt { + char *key; + char *value; +}; + +struct mosquitto_acl_msg { + const char *topic; + const void *payload; + long payloadlen; + int qos; + bool retain; +}; + +/* + * To create an authentication plugin you must include this file then implement + * the functions listed in the "Plugin Functions" section below. The resulting + * code should then be compiled as a shared library. Using gcc this can be + * achieved as follows: + * + * gcc -I<path to mosquitto_plugin.h> -fPIC -shared plugin.c -o plugin.so + * + * On Mac OS X: + * + * gcc -I<path to mosquitto_plugin.h> -fPIC -shared plugin.c -undefined dynamic_lookup -o plugin.so + * + * Authentication plugins can implement one or both of authentication and + * access control. If your plugin does not wish to handle either of + * authentication or access control it should return MOSQ_ERR_PLUGIN_DEFER. In + * this case, the next plugin will handle it. If all plugins return + * MOSQ_ERR_PLUGIN_DEFER, the request will be denied. + * + * For each check, the following flow happens: + * + * * The default password file and/or acl file checks are made. If either one + * of these is not defined, then they are considered to be deferred. If either + * one accepts the check, no further checks are made. If an error occurs, the + * check is denied + * * The first plugin does the check, if it returns anything other than + * MOSQ_ERR_PLUGIN_DEFER, then the check returns immediately. If the plugin + * returns MOSQ_ERR_PLUGIN_DEFER then the next plugin runs its check. + * * If the final plugin returns MOSQ_ERR_PLUGIN_DEFER, then access will be + * denied. + */ + +/* ========================================================================= + * + * Helper Functions + * + * ========================================================================= */ + +/* There are functions that are available for plugin developers to use in + * mosquitto_broker.h, including logging and accessor functions. + */ + + +/* ========================================================================= + * + * Plugin Functions + * + * You must implement these functions in your plugin. + * + * ========================================================================= */ + +/* + * Function: mosquitto_auth_plugin_version + * + * The broker will call this function immediately after loading the plugin to + * check it is a supported plugin version. Your code must simply return + * MOSQ_AUTH_PLUGIN_VERSION. + */ +int mosquitto_auth_plugin_version(void); + + +/* + * Function: mosquitto_auth_plugin_init + * + * Called after the plugin has been loaded and <mosquitto_auth_plugin_version> + * has been called. This will only ever be called once and can be used to + * initialise the plugin. + * + * Parameters: + * + * user_data : The pointer set here will be passed to the other plugin + * functions. Use to hold connection information for example. + * opts : Pointer to an array of struct mosquitto_opt, which + * provides the plugin options defined in the configuration file. + * opt_count : The number of elements in the opts array. + * + * Return value: + * Return 0 on success + * Return >0 on failure. + */ +int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *opts, int opt_count); + + +/* + * Function: mosquitto_auth_plugin_cleanup + * + * Called when the broker is shutting down. This will only ever be called once + * per plugin. + * Note that <mosquitto_auth_security_cleanup> will be called directly before + * this function. + * + * Parameters: + * + * user_data : The pointer provided in <mosquitto_auth_plugin_init>. + * opts : Pointer to an array of struct mosquitto_opt, which + * provides the plugin options defined in the configuration file. + * opt_count : The number of elements in the opts array. + * + * Return value: + * Return 0 on success + * Return >0 on failure. + */ +int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *opts, int opt_count); + + +/* + * Function: mosquitto_auth_security_init + * + * This function is called in two scenarios: + * + * 1. When the broker starts up. + * 2. If the broker is requested to reload its configuration whilst running. In + * this case, <mosquitto_auth_security_cleanup> will be called first, then + * this function will be called. In this situation, the reload parameter + * will be true. + * + * Parameters: + * + * user_data : The pointer provided in <mosquitto_auth_plugin_init>. + * opts : Pointer to an array of struct mosquitto_opt, which + * provides the plugin options defined in the configuration file. + * opt_count : The number of elements in the opts array. + * reload : If set to false, this is the first time the function has + * been called. If true, the broker has received a signal + * asking to reload its configuration. + * + * Return value: + * Return 0 on success + * Return >0 on failure. + */ +int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *opts, int opt_count, bool reload); + + +/* + * Function: mosquitto_auth_security_cleanup + * + * This function is called in two scenarios: + * + * 1. When the broker is shutting down. + * 2. If the broker is requested to reload its configuration whilst running. In + * this case, this function will be called, followed by + * <mosquitto_auth_security_init>. In this situation, the reload parameter + * will be true. + * + * Parameters: + * + * user_data : The pointer provided in <mosquitto_auth_plugin_init>. + * opts : Pointer to an array of struct mosquitto_opt, which + * provides the plugin options defined in the configuration file. + * opt_count : The number of elements in the opts array. + * reload : If set to false, this is the first time the function has + * been called. If true, the broker has received a signal + * asking to reload its configuration. + * + * Return value: + * Return 0 on success + * Return >0 on failure. + */ +int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *opts, int opt_count, bool reload); + + +/* + * Function: mosquitto_auth_acl_check + * + * Called by the broker when topic access must be checked. access will be one + * of: + * MOSQ_ACL_SUBSCRIBE when a client is asking to subscribe to a topic string. + * This differs from MOSQ_ACL_READ in that it allows you to + * deny access to topic strings rather than by pattern. For + * example, you may use MOSQ_ACL_SUBSCRIBE to deny + * subscriptions to '#', but allow all topics in + * MOSQ_ACL_READ. This allows clients to subscribe to any + * topic they want, but not discover what topics are in use + * on the server. + * MOSQ_ACL_READ when a message is about to be sent to a client (i.e. whether + * it can read that topic or not). + * MOSQ_ACL_WRITE when a message has been received from a client (i.e. whether + * it can write to that topic or not). + * + * Return: + * MOSQ_ERR_SUCCESS if access was granted. + * MOSQ_ERR_ACL_DENIED if access was not granted. + * MOSQ_ERR_UNKNOWN for an application specific error. + * MOSQ_ERR_PLUGIN_DEFER if your plugin does not wish to handle this check. + */ +int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg); + + +/* + * Function: mosquitto_auth_unpwd_check + * + * This function is OPTIONAL. Only include this function in your plugin if you + * are making basic username/password checks. + * + * Called by the broker when a username/password must be checked. + * + * Return: + * MOSQ_ERR_SUCCESS if the user is authenticated. + * MOSQ_ERR_AUTH if authentication failed. + * MOSQ_ERR_UNKNOWN for an application specific error. + * MOSQ_ERR_PLUGIN_DEFER if your plugin does not wish to handle this check. + */ +int mosquitto_auth_unpwd_check(void *user_data, struct mosquitto *client, const char *username, const char *password); + + +/* + * Function: mosquitto_psk_key_get + * + * This function is OPTIONAL. Only include this function in your plugin if you + * are making TLS-PSK checks. + * + * Called by the broker when a client connects to a listener using TLS/PSK. + * This is used to retrieve the pre-shared-key associated with a client + * identity. + * + * Examine hint and identity to determine the required PSK (which must be a + * hexadecimal string with no leading "0x") and copy this string into key. + * + * Parameters: + * user_data : the pointer provided in <mosquitto_auth_plugin_init>. + * hint : the psk_hint for the listener the client is connecting to. + * identity : the identity string provided by the client + * key : a string where the hex PSK should be copied + * max_key_len : the size of key + * + * Return value: + * Return 0 on success. + * Return >0 on failure. + * Return MOSQ_ERR_PLUGIN_DEFER if your plugin does not wish to handle this check. + */ +int mosquitto_auth_psk_key_get(void *user_data, struct mosquitto *client, const char *hint, const char *identity, char *key, int max_key_len); + +/* + * Function: mosquitto_auth_start + * + * This function is OPTIONAL. Only include this function in your plugin if you + * are making extended authentication checks. + * + * Parameters: + * user_data : the pointer provided in <mosquitto_auth_plugin_init>. + * method : the authentication method + * reauth : this is set to false if this is the first authentication attempt + * on a connection, set to true if the client is attempting to + * reauthenticate. + * data_in : pointer to authentication data, or NULL + * data_in_len : length of data_in, in bytes + * data_out : if your plugin wishes to send authentication data back to the + * client, allocate some memory using malloc or friends and set + * data_out. The broker will free the memory after use. + * data_out_len : Set the length of data_out in bytes. + * + * Return value: + * Return MOSQ_ERR_SUCCESS if authentication was successful. + * Return MOSQ_ERR_AUTH_CONTINUE if the authentication is a multi step process and can continue. + * Return MOSQ_ERR_AUTH if authentication was valid but did not succeed. + * Return any other relevant positive integer MOSQ_ERR_* to produce an error. + */ +int mosquitto_auth_start(void *user_data, struct mosquitto *client, const char *method, bool reauth, const void *data_in, uint16_t data_in_len, void **data_out, uint16_t *data_out_len); + +int mosquitto_auth_continue(void *user_data, struct mosquitto *client, const char *method, const void *data_in, uint16_t data_in_len, void **data_out, uint16_t *data_out_len); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/net.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/net.c new file mode 100644 index 0000000..0b57558 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/net.c @@ -0,0 +1,711 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#ifndef WIN32 +#include <netdb.h> +#include <unistd.h> +#include <arpa/inet.h> +#include <sys/socket.h> +#include <netinet/tcp.h> +#include <net/if.h> +#else +#include <winsock2.h> +#include <ws2tcpip.h> +#endif + +#include <assert.h> +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> +#include <string.h> +#ifdef WITH_WRAP +#include <tcpd.h> +#endif + +#ifdef HAVE_NETINET_IN_H +# include <netinet/in.h> +#endif + +#ifdef __QNX__ +#include <net/netbyte.h> +#endif + +#include "mosquitto_broker_internal.h" +#include "mqtt_protocol.h" +#include "memory_mosq.h" +#include "net_mosq.h" +#include "util_mosq.h" + +#ifdef WITH_TLS +#include "tls_mosq.h" +#include <openssl/err.h> +static int tls_ex_index_context = -1; +static int tls_ex_index_listener = -1; +#endif + +#include "sys_tree.h" + +/* For EMFILE handling */ +static mosq_sock_t spare_sock = INVALID_SOCKET; + +void net__broker_init(void) +{ + spare_sock = socket(AF_INET, SOCK_STREAM, 0); + net__init(); +} + + +void net__broker_cleanup(void) +{ + if(spare_sock != INVALID_SOCKET){ + COMPAT_CLOSE(spare_sock); + spare_sock = INVALID_SOCKET; + } + net__cleanup(); +} + + +static void net__print_error(int log, const char *format_str) +{ + char *buf; + +#ifdef WIN32 + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, WSAGetLastError(), LANG_NEUTRAL, &buf, 0, NULL); + + log__printf(NULL, log, format_str, buf); + LocalFree(buf); +#else + buf = strerror(errno); + log__printf(NULL, log, format_str, buf); +#endif +} + + +int net__socket_accept(struct mosquitto_db *db, mosq_sock_t listensock) +{ + int i; + int j; + mosq_sock_t new_sock = INVALID_SOCKET; + struct mosquitto *new_context; +#ifdef WITH_TLS + BIO *bio; + int rc; + char ebuf[256]; + unsigned long e; +#endif +#ifdef WITH_WRAP + struct request_info wrap_req; + char address[1024]; +#endif + + new_sock = accept(listensock, NULL, 0); + if(new_sock == INVALID_SOCKET){ +#ifdef WIN32 + errno = WSAGetLastError(); + if(errno == WSAEMFILE){ +#else + if(errno == EMFILE || errno == ENFILE){ +#endif + /* Close the spare socket, which means we should be able to accept + * this connection. Accept it, then close it immediately and create + * a new spare_sock. This prevents the situation of ever properly + * running out of sockets. + * It would be nice to send a "server not available" connack here, + * but there are lots of reasons why this would be tricky (TLS + * being the big one). */ + COMPAT_CLOSE(spare_sock); + new_sock = accept(listensock, NULL, 0); + if(new_sock != INVALID_SOCKET){ + COMPAT_CLOSE(new_sock); + } + spare_sock = socket(AF_INET, SOCK_STREAM, 0); + log__printf(NULL, MOSQ_LOG_WARNING, + "Unable to accept new connection, system socket count has been exceeded. Try increasing \"ulimit -n\" or equivalent."); + } + return -1; + } + + G_SOCKET_CONNECTIONS_INC(); + + if(net__socket_nonblock(&new_sock)){ + return INVALID_SOCKET; + } + +#ifdef WITH_WRAP + /* Use tcpd / libwrap to determine whether a connection is allowed. */ + request_init(&wrap_req, RQ_FILE, new_sock, RQ_DAEMON, "mosquitto", 0); + fromhost(&wrap_req); + if(!hosts_access(&wrap_req)){ + /* Access is denied */ + if(db->config->connection_messages == true){ + if(!net__socket_get_address(new_sock, address, 1024)){ + log__printf(NULL, MOSQ_LOG_NOTICE, "Client connection from %s denied access by tcpd.", address); + } + } + COMPAT_CLOSE(new_sock); + return -1; + } +#endif + + if(db->config->set_tcp_nodelay){ + int flag = 1; + if(setsockopt(new_sock, IPPROTO_TCP, TCP_NODELAY, &flag, sizeof(int)) != 0){ + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Unable to set TCP_NODELAY."); + } + } + + new_context = context__init(db, new_sock); + if(!new_context){ + COMPAT_CLOSE(new_sock); + return -1; + } + for(i=0; i<db->config->listener_count; i++){ + for(j=0; j<db->config->listeners[i].sock_count; j++){ + if(db->config->listeners[i].socks[j] == listensock){ + new_context->listener = &db->config->listeners[i]; + new_context->listener->client_count++; + break; + } + } + } + if(!new_context->listener){ + context__cleanup(db, new_context, true); + return -1; + } + + if(new_context->listener->max_connections > 0 && new_context->listener->client_count > new_context->listener->max_connections){ + if(db->config->connection_messages == true){ + log__printf(NULL, MOSQ_LOG_NOTICE, "Client connection from %s denied: max_connections exceeded.", new_context->address); + } + context__cleanup(db, new_context, true); + return -1; + } + +#ifdef WITH_TLS + /* TLS init */ + for(i=0; i<db->config->listener_count; i++){ + for(j=0; j<db->config->listeners[i].sock_count; j++){ + if(db->config->listeners[i].socks[j] == listensock){ + if(db->config->listeners[i].ssl_ctx){ + new_context->ssl = SSL_new(db->config->listeners[i].ssl_ctx); + if(!new_context->ssl){ + context__cleanup(db, new_context, true); + return -1; + } + SSL_set_ex_data(new_context->ssl, tls_ex_index_context, new_context); + SSL_set_ex_data(new_context->ssl, tls_ex_index_listener, &db->config->listeners[i]); + new_context->want_write = true; + bio = BIO_new_socket(new_sock, BIO_NOCLOSE); + SSL_set_bio(new_context->ssl, bio, bio); + ERR_clear_error(); + rc = SSL_accept(new_context->ssl); + if(rc != 1){ + rc = SSL_get_error(new_context->ssl, rc); + if(rc == SSL_ERROR_WANT_READ){ + /* We always want to read. */ + }else if(rc == SSL_ERROR_WANT_WRITE){ + new_context->want_write = true; + }else{ + if(db->config->connection_messages == true){ + e = ERR_get_error(); + while(e){ + log__printf(NULL, MOSQ_LOG_NOTICE, + "Client connection from %s failed: %s.", + new_context->address, ERR_error_string(e, ebuf)); + e = ERR_get_error(); + } + } + context__cleanup(db, new_context, true); + return -1; + } + } + } + } + } + } +#endif + + if(db->config->connection_messages == true){ + log__printf(NULL, MOSQ_LOG_NOTICE, "New connection from %s on port %d.", new_context->address, new_context->listener->port); + } + + return new_sock; +} + +#ifdef WITH_TLS +static int client_certificate_verify(int preverify_ok, X509_STORE_CTX *ctx) +{ + UNUSED(ctx); + + /* Preverify should check expiry, revocation. */ + return preverify_ok; +} +#endif + +#ifdef FINAL_WITH_TLS_PSK +static unsigned int psk_server_callback(SSL *ssl, const char *identity, unsigned char *psk, unsigned int max_psk_len) +{ + struct mosquitto_db *db; + struct mosquitto *context; + struct mosquitto__listener *listener; + char *psk_key = NULL; + int len; + const char *psk_hint; + + if(!identity) return 0; + + db = mosquitto__get_db(); + + context = SSL_get_ex_data(ssl, tls_ex_index_context); + if(!context) return 0; + + listener = SSL_get_ex_data(ssl, tls_ex_index_listener); + if(!listener) return 0; + + psk_hint = listener->psk_hint; + + /* The hex to BN conversion results in the length halving, so we can pass + * max_psk_len*2 as the max hex key here. */ + psk_key = mosquitto__calloc(1, max_psk_len*2 + 1); + if(!psk_key) return 0; + + if(mosquitto_psk_key_get(db, context, psk_hint, identity, psk_key, max_psk_len*2) != MOSQ_ERR_SUCCESS){ + mosquitto__free(psk_key); + return 0; + } + + len = mosquitto__hex2bin(psk_key, psk, max_psk_len); + if (len < 0){ + mosquitto__free(psk_key); + return 0; + } + + if(listener->use_identity_as_username){ + context->username = mosquitto__strdup(identity); + if(!context->username){ + mosquitto__free(psk_key); + return 0; + } + } + + mosquitto__free(psk_key); + return len; +} +#endif + +#ifdef WITH_TLS +static int mosquitto__tls_server_ctx(struct mosquitto__listener *listener) +{ + char buf[256]; + int rc; + FILE *dhparamfile; + DH *dhparam = NULL; + +#if OPENSSL_VERSION_NUMBER < 0x10100000L + listener->ssl_ctx = SSL_CTX_new(SSLv23_server_method()); +#else + listener->ssl_ctx = SSL_CTX_new(TLS_server_method()); +#endif + + if(!listener->ssl_ctx){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to create TLS context."); + return 1; + } + + if(listener->tls_version == NULL){ + SSL_CTX_set_options(listener->ssl_ctx, SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1); +#ifdef SSL_OP_NO_TLSv1_3 + }else if(!strcmp(listener->tls_version, "tlsv1.3")){ + SSL_CTX_set_options(listener->ssl_ctx, SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2); + }else if(!strcmp(listener->tls_version, "tlsv1.2")){ + SSL_CTX_set_options(listener->ssl_ctx, SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_3); + }else if(!strcmp(listener->tls_version, "tlsv1.1")){ + SSL_CTX_set_options(listener->ssl_ctx, SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_2 | SSL_OP_NO_TLSv1_3); +#else + }else if(!strcmp(listener->tls_version, "tlsv1.2")){ + SSL_CTX_set_options(listener->ssl_ctx, SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1); + }else if(!strcmp(listener->tls_version, "tlsv1.1")){ + SSL_CTX_set_options(listener->ssl_ctx, SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_2); +#endif + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unsupported tls_version \"%s\".", listener->tls_version); + return 1; + } + +#ifdef SSL_OP_NO_COMPRESSION + /* Disable compression */ + SSL_CTX_set_options(listener->ssl_ctx, SSL_OP_NO_COMPRESSION); +#endif +#ifdef SSL_OP_CIPHER_SERVER_PREFERENCE + /* Server chooses cipher */ + SSL_CTX_set_options(listener->ssl_ctx, SSL_OP_CIPHER_SERVER_PREFERENCE); +#endif + +#ifdef SSL_MODE_RELEASE_BUFFERS + /* Use even less memory per SSL connection. */ + SSL_CTX_set_mode(listener->ssl_ctx, SSL_MODE_RELEASE_BUFFERS); +#endif + +#ifdef WITH_EC +#if OPENSSL_VERSION_NUMBER >= 0x10002000L && OPENSSL_VERSION_NUMBER < 0x10100000L + SSL_CTX_set_ecdh_auto(listener->ssl_ctx, 1); +#endif +#endif + +#ifdef SSL_OP_NO_RENEGOTIATION + SSL_CTX_set_options(listener->ssl_ctx, SSL_OP_NO_RENEGOTIATION); +#endif + + snprintf(buf, 256, "mosquitto-%d", listener->port); + SSL_CTX_set_session_id_context(listener->ssl_ctx, (unsigned char *)buf, strlen(buf)); + + if(listener->ciphers){ + rc = SSL_CTX_set_cipher_list(listener->ssl_ctx, listener->ciphers); + if(rc == 0){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to set TLS ciphers. Check cipher list \"%s\".", listener->ciphers); + return 1; + } + }else{ + rc = SSL_CTX_set_cipher_list(listener->ssl_ctx, "DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2:@STRENGTH"); + if(rc == 0){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to set TLS ciphers. Check cipher list \"%s\".", listener->ciphers); + return 1; + } + } + if(listener->dhparamfile){ + dhparamfile = fopen(listener->dhparamfile, "r"); + if(!dhparamfile){ + log__printf(NULL, MOSQ_LOG_ERR, "Error loading dhparamfile \"%s\".", listener->dhparamfile); + return 1; + } + dhparam = PEM_read_DHparams(dhparamfile, NULL, NULL, NULL); + fclose(dhparamfile); + + if(dhparam == NULL || SSL_CTX_set_tmp_dh(listener->ssl_ctx, dhparam) != 1){ + log__printf(NULL, MOSQ_LOG_ERR, "Error loading dhparamfile \"%s\".", listener->dhparamfile); + return 1; + } + } + return MOSQ_ERR_SUCCESS; +} +#endif + +/* Creates a socket and listens on port 'port'. + * Returns 1 on failure + * Returns 0 on success. + */ +int net__socket_listen(struct mosquitto__listener *listener) +{ + mosq_sock_t sock = INVALID_SOCKET; + struct addrinfo hints; + struct addrinfo *ainfo, *rp; + char service[10]; + int rc; +#ifndef WIN32 + int ss_opt = 1; +#else + char ss_opt = 1; +#endif +#ifdef WITH_TLS + X509_STORE *store; + X509_LOOKUP *lookup; + ENGINE *engine = NULL; +#endif +#ifdef SO_BINDTODEVICE + struct ifreq ifr; +#endif + + if(!listener) return MOSQ_ERR_INVAL; + + snprintf(service, 10, "%d", listener->port); + memset(&hints, 0, sizeof(struct addrinfo)); + if(listener->socket_domain){ + hints.ai_family = listener->socket_domain; + }else{ + hints.ai_family = AF_UNSPEC; + } + hints.ai_flags = AI_PASSIVE; + hints.ai_socktype = SOCK_STREAM; + + rc = getaddrinfo(listener->host, service, &hints, &ainfo); + if (rc){ + log__printf(NULL, MOSQ_LOG_ERR, "Error creating listener: %s.", gai_strerror(rc)); + return INVALID_SOCKET; + } + + listener->sock_count = 0; + listener->socks = NULL; + + for(rp = ainfo; rp; rp = rp->ai_next){ + if(rp->ai_family == AF_INET){ + log__printf(NULL, MOSQ_LOG_INFO, "Opening ipv4 listen socket on port %d.", ntohs(((struct sockaddr_in *)rp->ai_addr)->sin_port)); + }else if(rp->ai_family == AF_INET6){ + log__printf(NULL, MOSQ_LOG_INFO, "Opening ipv6 listen socket on port %d.", ntohs(((struct sockaddr_in6 *)rp->ai_addr)->sin6_port)); + }else{ + continue; + } + + sock = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); + if(sock == INVALID_SOCKET){ + net__print_error(MOSQ_LOG_WARNING, "Warning: %s"); + continue; + } + listener->sock_count++; + listener->socks = mosquitto__realloc(listener->socks, sizeof(mosq_sock_t)*listener->sock_count); + if(!listener->socks){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + listener->socks[listener->sock_count-1] = sock; + +#ifndef WIN32 + ss_opt = 1; + setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &ss_opt, sizeof(ss_opt)); +#endif +#ifdef IPV6_V6ONLY + ss_opt = 1; + setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, &ss_opt, sizeof(ss_opt)); +#endif + + if(net__socket_nonblock(&sock)){ + return 1; + } + +#ifdef SO_BINDTODEVICE + if(listener->bind_interface){ + memset(&ifr, 0, sizeof(ifr)); + strncpy(ifr.ifr_name, listener->bind_interface, sizeof(ifr.ifr_name)-1); + ifr.ifr_name[sizeof(ifr.ifr_name)-1] = '\0'; + log__printf(NULL, MOSQ_LOG_INFO, "Binding listener to interface \"%s\".", ifr.ifr_name); + if(setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, (void *)&ifr, sizeof(ifr)) < 0) { + net__print_error(MOSQ_LOG_ERR, "Error: %s"); + COMPAT_CLOSE(sock); + return 1; + } + } +#endif + + if(bind(sock, rp->ai_addr, rp->ai_addrlen) == -1){ + net__print_error(MOSQ_LOG_ERR, "Error: %s"); + COMPAT_CLOSE(sock); + return 1; + } + + if(listen(sock, 100) == -1){ + net__print_error(MOSQ_LOG_ERR, "Error: %s"); + COMPAT_CLOSE(sock); + return 1; + } + } + freeaddrinfo(ainfo); + + /* We need to have at least one working socket. */ + if(listener->sock_count > 0){ +#ifdef WITH_TLS + if((listener->cafile || listener->capath) && listener->certfile && listener->keyfile){ + if(mosquitto__tls_server_ctx(listener)){ + COMPAT_CLOSE(sock); + return 1; + } + + rc = SSL_CTX_load_verify_locations(listener->ssl_ctx, listener->cafile, listener->capath); + if(rc == 0){ + if(listener->cafile && listener->capath){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to load CA certificates. Check cafile \"%s\" and capath \"%s\".", listener->cafile, listener->capath); + }else if(listener->cafile){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to load CA certificates. Check cafile \"%s\".", listener->cafile); + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to load CA certificates. Check capath \"%s\".", listener->capath); + } + net__print_error(MOSQ_LOG_ERR, "Error: %s"); + COMPAT_CLOSE(sock); + return 1; + } + if(listener->tls_engine){ +#if !defined(OPENSSL_NO_ENGINE) + engine = ENGINE_by_id(listener->tls_engine); + if(!engine){ + log__printf(NULL, MOSQ_LOG_ERR, "Error loading %s engine\n", listener->tls_engine); + COMPAT_CLOSE(sock); + return 1; + } + if(!ENGINE_init(engine)){ + log__printf(NULL, MOSQ_LOG_ERR, "Failed engine initialisation\n"); + ENGINE_free(engine); + COMPAT_CLOSE(sock); + return 1; + } + ENGINE_set_default(engine, ENGINE_METHOD_ALL); + ENGINE_free(engine); /* release the structural reference from ENGINE_by_id() */ +#endif + } + /* FIXME user data? */ + if(listener->require_certificate){ + SSL_CTX_set_verify(listener->ssl_ctx, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, client_certificate_verify); + }else{ + SSL_CTX_set_verify(listener->ssl_ctx, SSL_VERIFY_NONE, client_certificate_verify); + } + rc = SSL_CTX_use_certificate_chain_file(listener->ssl_ctx, listener->certfile); + if(rc != 1){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to load server certificate \"%s\". Check certfile.", listener->certfile); + net__print_error(MOSQ_LOG_ERR, "Error: %s"); + COMPAT_CLOSE(sock); +#if !defined(OPENSSL_NO_ENGINE) + ENGINE_FINISH(engine); +#endif + return 1; + } + if(listener->tls_keyform == mosq_k_engine){ +#if !defined(OPENSSL_NO_ENGINE) + UI_METHOD *ui_method = net__get_ui_method(); + if(listener->tls_engine_kpass_sha1){ + if(!ENGINE_ctrl_cmd(engine, ENGINE_SECRET_MODE, ENGINE_SECRET_MODE_SHA, NULL, NULL, 0)){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to set engine secret mode sha"); + COMPAT_CLOSE(sock); + ENGINE_FINISH(engine); + return 1; + } + if(!ENGINE_ctrl_cmd(engine, ENGINE_PIN, 0, listener->tls_engine_kpass_sha1, NULL, 0)){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to set engine pin"); + COMPAT_CLOSE(sock); + ENGINE_FINISH(engine); + return 1; + } + ui_method = NULL; + } + EVP_PKEY *pkey = ENGINE_load_private_key(engine, listener->keyfile, ui_method, NULL); + if(!pkey){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to load engine private key file \"%s\".", listener->keyfile); + COMPAT_CLOSE(sock); + ENGINE_FINISH(engine); + return 1; + } + if(SSL_CTX_use_PrivateKey(listener->ssl_ctx, pkey) <= 0){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to use engine private key file \"%s\".", listener->keyfile); + COMPAT_CLOSE(sock); + ENGINE_FINISH(engine); + return 1; + } +#endif + }else{ + rc = SSL_CTX_use_PrivateKey_file(listener->ssl_ctx, listener->keyfile, SSL_FILETYPE_PEM); + if(rc != 1){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to load server key file \"%s\". Check keyfile.", listener->keyfile); + net__print_error(MOSQ_LOG_ERR, "Error: %s"); + COMPAT_CLOSE(sock); +#if !defined(OPENSSL_NO_ENGINE) + ENGINE_FINISH(engine); +#endif + return 1; + } + } + rc = SSL_CTX_check_private_key(listener->ssl_ctx); + if(rc != 1){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Server certificate/key are inconsistent."); + net__print_error(MOSQ_LOG_ERR, "Error: %s"); + COMPAT_CLOSE(sock); +#if !defined(OPENSSL_NO_ENGINE) + ENGINE_FINISH(engine); +#endif + return 1; + } + /* Load CRLs if they exist. */ + if(listener->crlfile){ + store = SSL_CTX_get_cert_store(listener->ssl_ctx); + if(!store){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to obtain TLS store."); + net__print_error(MOSQ_LOG_ERR, "Error: %s"); + COMPAT_CLOSE(sock); +#if !defined(OPENSSL_NO_ENGINE) + ENGINE_FINISH(engine); +#endif + return 1; + } + lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file()); + rc = X509_load_crl_file(lookup, listener->crlfile, X509_FILETYPE_PEM); + if(rc != 1){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to load certificate revocation file \"%s\". Check crlfile.", listener->crlfile); + net__print_error(MOSQ_LOG_ERR, "Error: %s"); + COMPAT_CLOSE(sock); +#if !defined(OPENSSL_NO_ENGINE) + ENGINE_FINISH(engine); +#endif + return 1; + } + X509_STORE_set_flags(store, X509_V_FLAG_CRL_CHECK); + } + +# ifdef FINAL_WITH_TLS_PSK + }else if(listener->psk_hint){ + if(tls_ex_index_context == -1){ + tls_ex_index_context = SSL_get_ex_new_index(0, "client context", NULL, NULL, NULL); + } + if(tls_ex_index_listener == -1){ + tls_ex_index_listener = SSL_get_ex_new_index(0, "listener", NULL, NULL, NULL); + } + + if(mosquitto__tls_server_ctx(listener)){ + COMPAT_CLOSE(sock); +#if !defined(OPENSSL_NO_ENGINE) + ENGINE_FINISH(engine); +#endif + return 1; + } + SSL_CTX_set_psk_server_callback(listener->ssl_ctx, psk_server_callback); + if(listener->psk_hint){ + rc = SSL_CTX_use_psk_identity_hint(listener->ssl_ctx, listener->psk_hint); + if(rc == 0){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to set TLS PSK hint."); + net__print_error(MOSQ_LOG_ERR, "Error: %s"); + COMPAT_CLOSE(sock); +#if !defined(OPENSSL_NO_ENGINE) + ENGINE_FINISH(engine); +#endif + return 1; + } + } +# endif /* FINAL_WITH_TLS_PSK */ + } +#endif /* WITH_TLS */ + return 0; + }else{ + return 1; + } +} + +int net__socket_get_address(mosq_sock_t sock, char *buf, int len) +{ + struct sockaddr_storage addr; + socklen_t addrlen; + + memset(&addr, 0, sizeof(struct sockaddr_storage)); + addrlen = sizeof(addr); + if(!getpeername(sock, (struct sockaddr *)&addr, &addrlen)){ + if(addr.ss_family == AF_INET){ + if(inet_ntop(AF_INET, &((struct sockaddr_in *)&addr)->sin_addr.s_addr, buf, len)){ + return 0; + } + }else if(addr.ss_family == AF_INET6){ + if(inet_ntop(AF_INET6, &((struct sockaddr_in6 *)&addr)->sin6_addr.s6_addr, buf, len)){ + return 0; + } + } + } + return 1; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist.h new file mode 100644 index 0000000..9e2eedd --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist.h @@ -0,0 +1,157 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef PERSIST_H +#define PERSIST_H + +#define MOSQ_DB_VERSION 5 + +/* DB read/write */ +extern const unsigned char magic[15]; +#define DB_CHUNK_CFG 1 +#define DB_CHUNK_MSG_STORE 2 +#define DB_CHUNK_CLIENT_MSG 3 +#define DB_CHUNK_RETAIN 4 +#define DB_CHUNK_SUB 5 +#define DB_CHUNK_CLIENT 6 +/* End DB read/write */ + +#define read_e(f, b, c) if(fread(b, 1, c, f) != c){ goto error; } +#define write_e(f, b, c) if(fwrite(b, 1, c, f) != c){ goto error; } + +/* COMPATIBILITY NOTES + * + * The P_* structs (persist structs) contain all of the data for a particular + * data chunk. They are loaded in multiple parts, so can be rearranged without + * updating the db format version. + * + * The PF_* structs (persist fixed structs) contain the fixed size data for a + * particular data chunk. They are written to disk as is, so they must not be + * rearranged without updating the db format version. When adding new members, + * always use explicit sized datatypes ("uint32_t", not "long"), and check + * whether what is being added can go in an existing hole in the struct. + */ + +struct PF_header{ + uint32_t chunk; + uint32_t length; +}; + + +struct PF_cfg{ + uint64_t last_db_id; + uint8_t shutdown; + uint8_t dbid_size; +}; + +struct PF_client{ + int64_t session_expiry_time; + uint32_t session_expiry_interval; + uint16_t last_mid; + uint16_t id_len; +}; +struct P_client{ + struct PF_client F; + char *client_id; +}; + + +struct PF_client_msg{ + dbid_t store_id; + uint16_t mid; + uint16_t id_len; + uint8_t qos; + uint8_t state; + uint8_t retain_dup; + uint8_t direction; +}; +struct P_client_msg{ + struct PF_client_msg F; + char *client_id; + mosquitto_property *properties; +}; + + +struct PF_msg_store{ + dbid_t store_id; + int64_t expiry_time; + uint32_t payloadlen; + uint16_t source_mid; + uint16_t source_id_len; + uint16_t source_username_len; + uint16_t topic_len; + uint16_t source_port; + uint8_t qos; + uint8_t retain; +}; +struct P_msg_store{ + struct PF_msg_store F; + mosquitto__payload_uhpa payload; + struct mosquitto source; + char *topic; + mosquitto_property *properties; +}; + + +struct PF_sub{ + uint32_t identifier; + uint16_t id_len; + uint16_t topic_len; + uint8_t qos; + uint8_t options; +}; +struct P_sub{ + struct PF_sub F; + char *client_id; + char *topic; +}; + + +struct PF_retain{ + dbid_t store_id; +}; +struct P_retain{ + struct PF_retain F; +}; + + +int persist__read_string_len(FILE *db_fptr, char **str, uint16_t len); +int persist__read_string(FILE *db_fptr, char **str); + +int persist__chunk_header_read_v234(FILE *db_fptr, int *chunk, int *length); +int persist__chunk_cfg_read_v234(FILE *db_fptr, struct PF_cfg *chunk); +int persist__chunk_client_read_v234(FILE *db_fptr, struct P_client *chunk, int db_version); +int persist__chunk_client_msg_read_v234(FILE *db_fptr, struct P_client_msg *chunk); +int persist__chunk_msg_store_read_v234(FILE *db_fptr, struct P_msg_store *chunk, int db_version); +int persist__chunk_retain_read_v234(FILE *db_fptr, struct P_retain *chunk); +int persist__chunk_sub_read_v234(FILE *db_fptr, struct P_sub *chunk); + +int persist__chunk_header_read_v5(FILE *db_fptr, int *chunk, int *length); +int persist__chunk_cfg_read_v5(FILE *db_fptr, struct PF_cfg *chunk); +int persist__chunk_client_read_v5(FILE *db_fptr, struct P_client *chunk); +int persist__chunk_client_msg_read_v5(FILE *db_fptr, struct P_client_msg *chunk, uint32_t length); +int persist__chunk_msg_store_read_v5(FILE *db_fptr, struct P_msg_store *chunk, uint32_t length); +int persist__chunk_retain_read_v5(FILE *db_fptr, struct P_retain *chunk); +int persist__chunk_sub_read_v5(FILE *db_fptr, struct P_sub *chunk); + +int persist__chunk_cfg_write_v5(FILE *db_fptr, struct PF_cfg *chunk); +int persist__chunk_client_write_v5(FILE *db_fptr, struct P_client *chunk); +int persist__chunk_client_msg_write_v5(FILE *db_fptr, struct P_client_msg *chunk); +int persist__chunk_message_store_write_v5(FILE *db_fptr, struct P_msg_store *chunk); +int persist__chunk_retain_write_v5(FILE *db_fptr, struct P_retain *chunk); +int persist__chunk_sub_write_v5(FILE *db_fptr, struct P_sub *chunk); + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist_read.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist_read.c new file mode 100644 index 0000000..48437e4 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist_read.c @@ -0,0 +1,505 @@ +/* +Copyright (c) 2010-2018 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#ifdef WITH_PERSISTENCE + +#ifndef WIN32 +#include <arpa/inet.h> +#endif +#include <assert.h> +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> +#include <string.h> +#include <sys/stat.h> +#include <time.h> +#include <utlist.h> + +#include "mosquitto_broker_internal.h" +#include "memory_mosq.h" +#include "persist.h" +#include "time_mosq.h" +#include "util_mosq.h" + +static uint32_t db_version; + +const unsigned char magic[15] = {0x00, 0xB5, 0x00, 'm','o','s','q','u','i','t','t','o',' ','d','b'}; + +static int persist__restore_sub(struct mosquitto_db *db, const char *client_id, const char *sub, int qos, uint32_t identifier, int options); + +static struct mosquitto *persist__find_or_add_context(struct mosquitto_db *db, const char *client_id, uint16_t last_mid) +{ + struct mosquitto *context; + + if(!client_id) return NULL; + + context = NULL; + HASH_FIND(hh_id, db->contexts_by_id, client_id, strlen(client_id), context); + if(!context){ + context = context__init(db, -1); + if(!context) return NULL; + context->id = mosquitto__strdup(client_id); + if(!context->id){ + mosquitto__free(context); + return NULL; + } + + context->clean_start = false; + + HASH_ADD_KEYPTR(hh_id, db->contexts_by_id, context->id, strlen(context->id), context); + } + if(last_mid){ + context->last_mid = last_mid; + } + return context; +} + + +int persist__read_string_len(FILE *db_fptr, char **str, uint16_t len) +{ + char *s = NULL; + + if(len){ + s = mosquitto__malloc(len+1); + if(!s){ + fclose(db_fptr); + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + if(fread(s, 1, len, db_fptr) != len){ + mosquitto__free(s); + return MOSQ_ERR_NOMEM; + } + s[len] = '\0'; + } + + *str = s; + return MOSQ_ERR_SUCCESS; +} + + +int persist__read_string(FILE *db_fptr, char **str) +{ + uint16_t i16temp; + uint16_t slen; + + if(fread(&i16temp, 1, sizeof(uint16_t), db_fptr) != sizeof(uint16_t)){ + return MOSQ_ERR_INVAL; + } + + slen = ntohs(i16temp); + return persist__read_string_len(db_fptr, str, slen); +} + + +static int persist__client_msg_restore(struct mosquitto_db *db, struct P_client_msg *chunk) +{ + struct mosquitto_client_msg *cmsg; + struct mosquitto_msg_store_load *load; + struct mosquitto *context; + struct mosquitto_msg_data *msg_data; + + cmsg = mosquitto__calloc(1, sizeof(struct mosquitto_client_msg)); + if(!cmsg){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + + cmsg->next = NULL; + cmsg->store = NULL; + cmsg->mid = chunk->F.mid; + cmsg->qos = chunk->F.qos; + cmsg->retain = (chunk->F.retain_dup&0xF0)>>4; + cmsg->timestamp = 0; + cmsg->direction = chunk->F.direction; + cmsg->state = chunk->F.state; + cmsg->dup = chunk->F.retain_dup&0x0F; + cmsg->properties = chunk->properties; + + HASH_FIND(hh, db->msg_store_load, &chunk->F.store_id, sizeof(dbid_t), load); + if(!load){ + mosquitto__free(cmsg); + log__printf(NULL, MOSQ_LOG_ERR, "Error restoring persistent database, message store corrupt."); + return 1; + } + cmsg->store = load->store; + db__msg_store_ref_inc(cmsg->store); + + context = persist__find_or_add_context(db, chunk->client_id, 0); + if(!context){ + mosquitto__free(cmsg); + log__printf(NULL, MOSQ_LOG_ERR, "Error restoring persistent database, message store corrupt."); + return 1; + } + + if(cmsg->direction == mosq_md_out){ + msg_data = &context->msgs_out; + }else{ + msg_data = &context->msgs_in; + } + + if(chunk->F.state == mosq_ms_queued || (chunk->F.qos > 0 && msg_data->inflight_quota == 0)){ + DL_APPEND(msg_data->queued, cmsg); + }else{ + DL_APPEND(msg_data->inflight, cmsg); + if(chunk->F.qos > 0 && msg_data->inflight_quota > 0){ + msg_data->inflight_quota--; + } + } + msg_data->msg_count++; + msg_data->msg_bytes += cmsg->store->payloadlen; + if(chunk->F.qos > 0){ + msg_data->msg_count12++; + msg_data->msg_bytes12 += cmsg->store->payloadlen; + } + + return MOSQ_ERR_SUCCESS; +} + + +static int persist__client_chunk_restore(struct mosquitto_db *db, FILE *db_fptr) +{ + int rc = 0; + struct mosquitto *context; + struct P_client chunk; + + memset(&chunk, 0, sizeof(struct P_client)); + + if(db_version == 5){ + rc = persist__chunk_client_read_v5(db_fptr, &chunk); + }else{ + rc = persist__chunk_client_read_v234(db_fptr, &chunk, db_version); + } + if(rc){ + fclose(db_fptr); + return rc; + } + + context = persist__find_or_add_context(db, chunk.client_id, chunk.F.last_mid); + if(context){ + context->session_expiry_time = chunk.F.session_expiry_time; + context->session_expiry_interval = chunk.F.session_expiry_interval; + /* FIXME - we should expire clients here if they have exceeded their time */ + }else{ + rc = 1; + } + + mosquitto__free(chunk.client_id); + + return rc; +} + + +static int persist__client_msg_chunk_restore(struct mosquitto_db *db, FILE *db_fptr, uint32_t length) +{ + struct P_client_msg chunk; + int rc; + + memset(&chunk, 0, sizeof(struct P_client_msg)); + + if(db_version == 5){ + rc = persist__chunk_client_msg_read_v5(db_fptr, &chunk, length); + }else{ + rc = persist__chunk_client_msg_read_v234(db_fptr, &chunk); + } + if(rc){ + fclose(db_fptr); + return rc; + } + + rc = persist__client_msg_restore(db, &chunk); + mosquitto__free(chunk.client_id); + + return rc; +} + + +static int persist__msg_store_chunk_restore(struct mosquitto_db *db, FILE *db_fptr, uint32_t length) +{ + struct P_msg_store chunk; + struct mosquitto_msg_store *stored = NULL; + struct mosquitto_msg_store_load *load; + int64_t message_expiry_interval64; + uint32_t message_expiry_interval; + int rc = 0; + int i; + + memset(&chunk, 0, sizeof(struct P_msg_store)); + + if(db_version == 5){ + rc = persist__chunk_msg_store_read_v5(db_fptr, &chunk, length); + }else{ + rc = persist__chunk_msg_store_read_v234(db_fptr, &chunk, db_version); + } + if(rc){ + fclose(db_fptr); + return rc; + } + + if(chunk.F.source_port){ + for(i=0; i<db->config->listener_count; i++){ + if(db->config->listeners[i].port == chunk.F.source_port){ + chunk.source.listener = &db->config->listeners[i]; + break; + } + } + } + load = mosquitto__calloc(1, sizeof(struct mosquitto_msg_store_load)); + if(!load){ + fclose(db_fptr); + mosquitto__free(chunk.source.id); + mosquitto__free(chunk.source.username); + mosquitto__free(chunk.topic); + UHPA_FREE(chunk.payload, chunk.F.payloadlen); + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + + if(chunk.F.expiry_time > 0){ + message_expiry_interval64 = chunk.F.expiry_time - time(NULL); + if(message_expiry_interval64 < 0 || message_expiry_interval64 > UINT32_MAX){ + message_expiry_interval = 0; + }else{ + message_expiry_interval = (uint32_t)message_expiry_interval64; + } + }else{ + message_expiry_interval = 0; + } + + rc = db__message_store(db, &chunk.source, chunk.F.source_mid, + chunk.topic, chunk.F.qos, chunk.F.payloadlen, + &chunk.payload, chunk.F.retain, &stored, message_expiry_interval, + chunk.properties, chunk.F.store_id, mosq_mo_client); + + mosquitto__free(chunk.source.id); + mosquitto__free(chunk.source.username); + chunk.source.id = NULL; + chunk.source.username = NULL; + + if(rc == MOSQ_ERR_SUCCESS){ + stored->source_listener = chunk.source.listener; + load->db_id = stored->db_id; + load->store = stored; + + HASH_ADD(hh, db->msg_store_load, db_id, sizeof(dbid_t), load); + return MOSQ_ERR_SUCCESS; + }else{ + mosquitto__free(load); + fclose(db_fptr); + return rc; + } +} + +static int persist__retain_chunk_restore(struct mosquitto_db *db, FILE *db_fptr) +{ + struct mosquitto_msg_store_load *load; + struct P_retain chunk; + int rc; + + memset(&chunk, 0, sizeof(struct P_retain)); + + if(db_version == 5){ + rc = persist__chunk_retain_read_v5(db_fptr, &chunk); + }else{ + rc = persist__chunk_retain_read_v234(db_fptr, &chunk); + } + if(rc){ + fclose(db_fptr); + return rc; + } + + HASH_FIND(hh, db->msg_store_load, &chunk.F.store_id, sizeof(dbid_t), load); + if(load){ + sub__messages_queue(db, NULL, load->store->topic, load->store->qos, load->store->retain, &load->store); + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Corrupt database whilst restoring a retained message."); + return MOSQ_ERR_INVAL; + } + return MOSQ_ERR_SUCCESS; +} + +static int persist__sub_chunk_restore(struct mosquitto_db *db, FILE *db_fptr) +{ + struct P_sub chunk; + int rc; + + memset(&chunk, 0, sizeof(struct P_sub)); + + if(db_version == 5){ + rc = persist__chunk_sub_read_v5(db_fptr, &chunk); + }else{ + rc = persist__chunk_sub_read_v234(db_fptr, &chunk); + } + if(rc){ + fclose(db_fptr); + return rc; + } + + rc = persist__restore_sub(db, chunk.client_id, chunk.topic, chunk.F.qos, chunk.F.identifier, chunk.F.options); + + mosquitto__free(chunk.client_id); + mosquitto__free(chunk.topic); + + return rc; +} + + +int persist__chunk_header_read(FILE *db_fptr, int *chunk, int *length) +{ + if(db_version == 5){ + return persist__chunk_header_read_v5(db_fptr, chunk, length); + }else{ + return persist__chunk_header_read_v234(db_fptr, chunk, length); + } +} + + +int persist__restore(struct mosquitto_db *db) +{ + FILE *fptr; + char header[15]; + int rc = 0; + uint32_t crc; + uint32_t i32temp; + int chunk, length; + ssize_t rlen; + char *err; + struct mosquitto_msg_store_load *load, *load_tmp; + struct PF_cfg cfg_chunk; + + assert(db); + assert(db->config); + + if(!db->config->persistence || db->config->persistence_filepath == NULL){ + return MOSQ_ERR_SUCCESS; + } + + db->msg_store_load = NULL; + + fptr = mosquitto__fopen(db->config->persistence_filepath, "rb", false); + if(fptr == NULL) return MOSQ_ERR_SUCCESS; + rlen = fread(&header, 1, 15, fptr); + if(rlen == 0){ + fclose(fptr); + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Persistence file is empty."); + return 0; + }else if(rlen != 15){ + goto error; + } + if(!memcmp(header, magic, 15)){ + // Restore DB as normal + read_e(fptr, &crc, sizeof(uint32_t)); + read_e(fptr, &i32temp, sizeof(uint32_t)); + db_version = ntohl(i32temp); + /* IMPORTANT - this is where compatibility checks are made. + * Is your DB change still compatible with previous versions? + */ + if(db_version > MOSQ_DB_VERSION && db_version != 0){ + if(db_version == 4){ + }else if(db_version == 3){ + /* Addition of source_username and source_port to msg_store chunk in v4, v1.5.6 */ + }else if(db_version == 2){ + /* Addition of disconnect_t to client chunk in v3. */ + }else{ + fclose(fptr); + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unsupported persistent database format version %d (need version %d).", db_version, MOSQ_DB_VERSION); + return 1; + } + } + + while(persist__chunk_header_read(fptr, &chunk, &length) == MOSQ_ERR_SUCCESS){ + switch(chunk){ + case DB_CHUNK_CFG: + if(db_version == 5){ + if(persist__chunk_cfg_read_v5(fptr, &cfg_chunk)){ + return 1; + } + }else{ + if(persist__chunk_cfg_read_v234(fptr, &cfg_chunk)){ + return 1; + } + } + if(cfg_chunk.dbid_size != sizeof(dbid_t)){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Incompatible database configuration (dbid size is %d bytes, expected %lu)", + cfg_chunk.dbid_size, (unsigned long)sizeof(dbid_t)); + fclose(fptr); + return 1; + } + db->last_db_id = cfg_chunk.last_db_id; + break; + + case DB_CHUNK_MSG_STORE: + if(persist__msg_store_chunk_restore(db, fptr, length)) return 1; + break; + + case DB_CHUNK_CLIENT_MSG: + if(persist__client_msg_chunk_restore(db, fptr, length)) return 1; + break; + + case DB_CHUNK_RETAIN: + if(persist__retain_chunk_restore(db, fptr)) return 1; + break; + + case DB_CHUNK_SUB: + if(persist__sub_chunk_restore(db, fptr)) return 1; + break; + + case DB_CHUNK_CLIENT: + if(persist__client_chunk_restore(db, fptr)) return 1; + break; + + default: + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Unsupported chunk \"%d\" in persistent database file. Ignoring.", chunk); + fseek(fptr, length, SEEK_CUR); + break; + } + } + if(rlen < 0) goto error; + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to restore persistent database. Unrecognised file format."); + rc = 1; + } + + fclose(fptr); + + HASH_ITER(hh, db->msg_store_load, load, load_tmp){ + HASH_DELETE(hh, db->msg_store_load, load); + mosquitto__free(load); + } + return rc; +error: + err = strerror(errno); + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", err); + if(fptr) fclose(fptr); + return 1; +} + +static int persist__restore_sub(struct mosquitto_db *db, const char *client_id, const char *sub, int qos, uint32_t identifier, int options) +{ + struct mosquitto *context; + + assert(db); + assert(client_id); + assert(sub); + + context = persist__find_or_add_context(db, client_id, 0); + if(!context) return 1; + return sub__add(db, context, sub, qos, identifier, options, &db->subs); +} + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist_read_v234.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist_read_v234.c new file mode 100644 index 0000000..c80f98f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist_read_v234.c @@ -0,0 +1,236 @@ +/* +Copyright (c) 2010-2018 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#ifdef WITH_PERSISTENCE + +#ifndef WIN32 +#include <arpa/inet.h> +#endif +#include <assert.h> +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> +#include <string.h> +#include <sys/stat.h> +#include <time.h> + +#include "mosquitto_broker_internal.h" +#include "memory_mosq.h" +#include "persist.h" +#include "time_mosq.h" +#include "util_mosq.h" + + +int persist__chunk_header_read_v234(FILE *db_fptr, int *chunk, int *length) +{ + size_t rlen; + uint16_t i16temp; + uint32_t i32temp; + + rlen = fread(&i16temp, sizeof(uint16_t), 1, db_fptr); + if(rlen != 1) return 1; + + rlen = fread(&i32temp, sizeof(uint32_t), 1, db_fptr); + if(rlen != 1) return 1; + + *chunk = ntohs(i16temp); + *length = ntohl(i32temp); + + return MOSQ_ERR_SUCCESS; +} + + +int persist__chunk_cfg_read_v234(FILE *db_fptr, struct PF_cfg *chunk) +{ + read_e(db_fptr, &chunk->shutdown, sizeof(uint8_t)); // shutdown + read_e(db_fptr, &chunk->dbid_size, sizeof(uint8_t)); // sizeof(dbid_t) + read_e(db_fptr, &chunk->last_db_id, sizeof(dbid_t)); + + return MOSQ_ERR_SUCCESS; +error: + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", strerror(errno)); + return 1; +} + + +int persist__chunk_client_read_v234(FILE *db_fptr, struct P_client *chunk, int db_version) +{ + uint16_t i16temp; + int rc; + time_t temp; + + rc = persist__read_string(db_fptr, &chunk->client_id); + if(rc){ + return rc; + } + + read_e(db_fptr, &i16temp, sizeof(uint16_t)); + chunk->F.last_mid = ntohs(i16temp); + if(db_version != 2){ + read_e(db_fptr, &temp, sizeof(time_t)); + } + + return MOSQ_ERR_SUCCESS; +error: + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", strerror(errno)); + mosquitto__free(chunk->client_id); + return 1; +} + + +int persist__chunk_client_msg_read_v234(FILE *db_fptr, struct P_client_msg *chunk) +{ + uint16_t i16temp; + int rc; + char *err; + uint8_t retain, dup; + + rc = persist__read_string(db_fptr, &chunk->client_id); + if(rc){ + return rc; + } + + read_e(db_fptr, &chunk->F.store_id, sizeof(dbid_t)); + + read_e(db_fptr, &i16temp, sizeof(uint16_t)); + chunk->F.mid = ntohs(i16temp); + + read_e(db_fptr, &chunk->F.qos, sizeof(uint8_t)); + read_e(db_fptr, &retain, sizeof(uint8_t)); + read_e(db_fptr, &chunk->F.direction, sizeof(uint8_t)); + read_e(db_fptr, &chunk->F.state, sizeof(uint8_t)); + read_e(db_fptr, &dup, sizeof(uint8_t)); + + chunk->F.retain_dup = (retain&0x0F)<<4 | (dup&0x0F); + + return MOSQ_ERR_SUCCESS; +error: + err = strerror(errno); + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", err); + mosquitto__free(chunk->client_id); + return 1; +} + + +int persist__chunk_msg_store_read_v234(FILE *db_fptr, struct P_msg_store *chunk, int db_version) +{ + uint32_t i32temp; + uint16_t i16temp; + int rc = 0; + char *err; + + read_e(db_fptr, &chunk->F.store_id, sizeof(dbid_t)); + + rc = persist__read_string(db_fptr, &chunk->source.id); + if(rc){ + return rc; + } + if(db_version == 4){ + rc = persist__read_string(db_fptr, &chunk->source.username); + if(rc){ + mosquitto__free(chunk->source.id); + return rc; + } + read_e(db_fptr, &i16temp, sizeof(uint16_t)); + chunk->F.source_port = ntohs(i16temp); + } + + read_e(db_fptr, &i16temp, sizeof(uint16_t)); + chunk->F.source_mid = ntohs(i16temp); + + /* This is the mid - don't need it */ + read_e(db_fptr, &i16temp, sizeof(uint16_t)); + + rc = persist__read_string(db_fptr, &chunk->topic); + if(rc){ + mosquitto__free(chunk->source.id); + mosquitto__free(chunk->source.username); + return rc; + } + + read_e(db_fptr, &chunk->F.qos, sizeof(uint8_t)); + read_e(db_fptr, &chunk->F.retain, sizeof(uint8_t)); + + read_e(db_fptr, &i32temp, sizeof(uint32_t)); + chunk->F.payloadlen = ntohl(i32temp); + + if(chunk->F.payloadlen){ + if(UHPA_ALLOC(chunk->payload, chunk->F.payloadlen) == 0){ + mosquitto__free(chunk->source.id); + mosquitto__free(chunk->source.username); + mosquitto__free(chunk->topic); + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + read_e(db_fptr, UHPA_ACCESS(chunk->payload, chunk->F.payloadlen), chunk->F.payloadlen); + } + + return MOSQ_ERR_SUCCESS; +error: + err = strerror(errno); + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", err); + mosquitto__free(chunk->source.id); + mosquitto__free(chunk->source.username); + return 1; +} + + +int persist__chunk_retain_read_v234(FILE *db_fptr, struct P_retain *chunk) +{ + dbid_t i64temp; + char *err; + + if(fread(&i64temp, sizeof(dbid_t), 1, db_fptr) != 1){ + err = strerror(errno); + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", err); + return 1; + } + chunk->F.store_id = i64temp; + + return MOSQ_ERR_SUCCESS; +} + + +int persist__chunk_sub_read_v234(FILE *db_fptr, struct P_sub *chunk) +{ + int rc; + char *err; + + rc = persist__read_string(db_fptr, &chunk->client_id); + if(rc){ + return rc; + } + + rc = persist__read_string(db_fptr, &chunk->topic); + if(rc){ + mosquitto__free(chunk->client_id); + return rc; + } + + read_e(db_fptr, &chunk->F.qos, sizeof(uint8_t)); + + return MOSQ_ERR_SUCCESS; +error: + err = strerror(errno); + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", err); + mosquitto__free(chunk->client_id); + mosquitto__free(chunk->topic); + return 1; +} + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist_read_v5.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist_read_v5.c new file mode 100644 index 0000000..684f9e3 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist_read_v5.c @@ -0,0 +1,254 @@ +/* +Copyright (c) 2010-2018 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#ifdef WITH_PERSISTENCE + +#ifndef WIN32 +#include <arpa/inet.h> +#endif +#include <assert.h> +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> +#include <string.h> +#include <sys/stat.h> +#include <time.h> + +#include "mosquitto_broker_internal.h" +#include "memory_mosq.h" +#include "mqtt_protocol.h" +#include "persist.h" +#include "property_mosq.h" +#include "time_mosq.h" +#include "util_mosq.h" + + +int persist__chunk_header_read_v5(FILE *db_fptr, int *chunk, int *length) +{ + size_t rlen; + struct PF_header header; + + rlen = fread(&header, sizeof(struct PF_header), 1, db_fptr); + if(rlen != 1) return 1; + + *chunk = ntohl(header.chunk); + *length = ntohl(header.length); + + return MOSQ_ERR_SUCCESS; +} + + +int persist__chunk_cfg_read_v5(FILE *db_fptr, struct PF_cfg *chunk) +{ + if(fread(chunk, sizeof(struct PF_cfg), 1, db_fptr) != 1){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", strerror(errno)); + return 1; + } + + return MOSQ_ERR_SUCCESS; +} + + +int persist__chunk_client_read_v5(FILE *db_fptr, struct P_client *chunk) +{ + int rc; + + read_e(db_fptr, &chunk->F, sizeof(struct PF_client)); + chunk->F.session_expiry_interval = ntohl(chunk->F.session_expiry_interval); + chunk->F.last_mid = ntohs(chunk->F.last_mid); + chunk->F.id_len = ntohs(chunk->F.id_len); + + rc = persist__read_string_len(db_fptr, &chunk->client_id, chunk->F.id_len); + if(rc || !chunk->client_id){ + return 1; + }else{ + return MOSQ_ERR_SUCCESS; + } +error: + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", strerror(errno)); + return 1; +} + + +int persist__chunk_client_msg_read_v5(FILE *db_fptr, struct P_client_msg *chunk, uint32_t length) +{ + mosquitto_property *properties = NULL; + struct mosquitto__packet prop_packet; + int rc; + + read_e(db_fptr, &chunk->F, sizeof(struct PF_client_msg)); + chunk->F.mid = ntohs(chunk->F.mid); + chunk->F.id_len = ntohs(chunk->F.id_len); + + length -= (sizeof(struct PF_client_msg) + chunk->F.id_len); + + rc = persist__read_string_len(db_fptr, &chunk->client_id, chunk->F.id_len); + if(rc){ + return rc; + } + + if(length > 0){ + memset(&prop_packet, 0, sizeof(struct mosquitto__packet)); + prop_packet.remaining_length = length; + prop_packet.payload = mosquitto__malloc(length); + if(!prop_packet.payload){ + return MOSQ_ERR_NOMEM; + } + read_e(db_fptr, prop_packet.payload, length); + rc = property__read_all(CMD_PUBLISH, &prop_packet, &properties); + mosquitto__free(prop_packet.payload); + if(rc){ + return rc; + } + } + chunk->properties = properties; + + return MOSQ_ERR_SUCCESS; +error: + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", strerror(errno)); + return 1; +} + + +int persist__chunk_msg_store_read_v5(FILE *db_fptr, struct P_msg_store *chunk, uint32_t length) +{ + int rc = 0; + mosquitto_property *properties = NULL; + struct mosquitto__packet prop_packet; + + memset(&prop_packet, 0, sizeof(struct mosquitto__packet)); + + read_e(db_fptr, &chunk->F, sizeof(struct PF_msg_store)); + chunk->F.payloadlen = ntohl(chunk->F.payloadlen); + if(chunk->F.payloadlen > MQTT_MAX_PAYLOAD){ + return MOSQ_ERR_INVAL; + } + chunk->F.source_mid = ntohs(chunk->F.source_mid); + chunk->F.source_id_len = ntohs(chunk->F.source_id_len); + chunk->F.source_username_len = ntohs(chunk->F.source_username_len); + chunk->F.topic_len = ntohs(chunk->F.topic_len); + chunk->F.source_port = ntohs(chunk->F.source_port); + + length -= (sizeof(struct PF_msg_store) + chunk->F.payloadlen + chunk->F.source_id_len + chunk->F.source_username_len + chunk->F.topic_len); + + if(chunk->F.source_id_len){ + rc = persist__read_string_len(db_fptr, &chunk->source.id, chunk->F.source_id_len); + if(rc){ + return rc; + } + } + if(chunk->F.source_username_len){ + rc = persist__read_string_len(db_fptr, &chunk->source.username, chunk->F.source_username_len); + if(rc){ + mosquitto__free(chunk->source.id); + chunk->source.id = NULL; + return rc; + } + } + rc = persist__read_string_len(db_fptr, &chunk->topic, chunk->F.topic_len); + if(rc){ + mosquitto__free(chunk->source.id); + mosquitto__free(chunk->source.username); + chunk->source.id = NULL; + chunk->source.username = NULL; + return rc; + } + + if(chunk->F.payloadlen > 0){ + if(UHPA_ALLOC(chunk->payload, chunk->F.payloadlen) == 0){ + mosquitto__free(chunk->source.id); + mosquitto__free(chunk->source.username); + mosquitto__free(chunk->topic); + chunk->source.id = NULL; + chunk->source.username = NULL; + chunk->topic = NULL; + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + read_e(db_fptr, UHPA_ACCESS(chunk->payload, chunk->F.payloadlen), chunk->F.payloadlen); + } + + if(length > 0){ + prop_packet.remaining_length = length; + prop_packet.payload = mosquitto__malloc(length); + if(!prop_packet.payload){ + mosquitto__free(chunk->source.id); + mosquitto__free(chunk->source.username); + mosquitto__free(chunk->topic); + return MOSQ_ERR_NOMEM; + } + read_e(db_fptr, prop_packet.payload, length); + rc = property__read_all(CMD_PUBLISH, &prop_packet, &properties); + mosquitto__free(prop_packet.payload); + if(rc){ + mosquitto__free(chunk->source.id); + mosquitto__free(chunk->source.username); + mosquitto__free(chunk->topic); + return rc; + } + } + chunk->properties = properties; + + return MOSQ_ERR_SUCCESS; +error: + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", strerror(errno)); + mosquitto__free(chunk->source.id); + mosquitto__free(chunk->source.username); + mosquitto__free(chunk->topic); + mosquitto__free(prop_packet.payload); + return 1; +} + + +int persist__chunk_retain_read_v5(FILE *db_fptr, struct P_retain *chunk) +{ + if(fread(&chunk->F, sizeof(struct P_retain), 1, db_fptr) != 1){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", strerror(errno)); + return 1; + } + return MOSQ_ERR_SUCCESS; +} + + +int persist__chunk_sub_read_v5(FILE *db_fptr, struct P_sub *chunk) +{ + int rc; + + read_e(db_fptr, &chunk->F, sizeof(struct PF_sub)); + chunk->F.identifier = ntohl(chunk->F.identifier); + chunk->F.id_len = ntohs(chunk->F.id_len); + chunk->F.topic_len = ntohs(chunk->F.topic_len); + + rc = persist__read_string_len(db_fptr, &chunk->client_id, chunk->F.id_len); + if(rc){ + return rc; + } + rc = persist__read_string_len(db_fptr, &chunk->topic, chunk->F.topic_len); + if(rc){ + mosquitto__free(chunk->client_id); + chunk->client_id = NULL; + return rc; + } + + return MOSQ_ERR_SUCCESS; +error: + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", strerror(errno)); + return 1; +} + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist_write.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist_write.c new file mode 100644 index 0000000..c24a24d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist_write.c @@ -0,0 +1,397 @@ +/* +Copyright (c) 2010-2018 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#ifdef WITH_PERSISTENCE + +#ifndef WIN32 +#include <arpa/inet.h> +#endif +#include <assert.h> +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> +#include <string.h> +#include <sys/stat.h> +#include <time.h> + +#include "mosquitto_broker_internal.h" +#include "memory_mosq.h" +#include "persist.h" +#include "time_mosq.h" +#include "util_mosq.h" + +static int persist__client_messages_save(struct mosquitto_db *db, FILE *db_fptr, struct mosquitto *context, struct mosquitto_client_msg *queue) +{ + struct P_client_msg chunk; + struct mosquitto_client_msg *cmsg; + int rc; + + assert(db); + assert(db_fptr); + assert(context); + + memset(&chunk, 0, sizeof(struct P_client_msg)); + + cmsg = queue; + while(cmsg){ + if(!strncmp(cmsg->store->topic, "$SYS", 4) + && cmsg->store->ref_count <= 1 + && cmsg->store->dest_id_count == 0){ + + /* This $SYS message won't have been persisted, so we can't persist + * this client message. */ + cmsg = cmsg->next; + continue; + } + + chunk.F.store_id = cmsg->store->db_id; + chunk.F.mid = cmsg->mid; + chunk.F.id_len = strlen(context->id); + chunk.F.qos = cmsg->qos; + chunk.F.retain_dup = (cmsg->retain&0x0F)<<4 | (cmsg->dup&0x0F); + chunk.F.direction = cmsg->direction; + chunk.F.state = cmsg->state; + chunk.client_id = context->id; + chunk.properties = cmsg->properties; + + rc = persist__chunk_client_msg_write_v5(db_fptr, &chunk); + if(rc){ + return rc; + } + + cmsg = cmsg->next; + } + + return MOSQ_ERR_SUCCESS; +} + + +static int persist__message_store_save(struct mosquitto_db *db, FILE *db_fptr) +{ + struct P_msg_store chunk; + struct mosquitto_msg_store *stored; + int rc; + + assert(db); + assert(db_fptr); + + memset(&chunk, 0, sizeof(struct P_msg_store)); + + stored = db->msg_store; + while(stored){ + if(stored->ref_count < 1 || stored->topic == NULL){ + stored = stored->next; + continue; + } + + if(!strncmp(stored->topic, "$SYS", 4)){ + if(stored->ref_count <= 1 && stored->dest_id_count == 0){ + /* $SYS messages that are only retained shouldn't be persisted. */ + stored = stored->next; + continue; + } + /* Don't save $SYS messages as retained otherwise they can give + * misleading information when reloaded. They should still be saved + * because a disconnected durable client may have them in their + * queue. */ + chunk.F.retain = 0; + }else{ + chunk.F.retain = (uint8_t)stored->retain; + } + + chunk.F.store_id = stored->db_id; + chunk.F.expiry_time = stored->message_expiry_time; + chunk.F.payloadlen = stored->payloadlen; + chunk.F.source_mid = stored->source_mid; + if(stored->source_id){ + chunk.F.source_id_len = strlen(stored->source_id); + chunk.source.id = stored->source_id; + }else{ + chunk.F.source_id_len = 0; + chunk.source.id = NULL; + } + if(stored->source_username){ + chunk.F.source_username_len = strlen(stored->source_username); + chunk.source.username = stored->source_username; + }else{ + chunk.F.source_username_len = 0; + chunk.source.username = NULL; + } + + chunk.F.topic_len = strlen(stored->topic); + chunk.topic = stored->topic; + + if(stored->source_listener){ + chunk.F.source_port = stored->source_listener->port; + }else{ + chunk.F.source_port = 0; + } + chunk.F.qos = stored->qos; + chunk.payload = stored->payload; + chunk.properties = stored->properties; + + rc = persist__chunk_message_store_write_v5(db_fptr, &chunk); + if(rc){ + return rc; + } + stored = stored->next; + } + + return MOSQ_ERR_SUCCESS; +} + +static int persist__client_save(struct mosquitto_db *db, FILE *db_fptr) +{ + struct mosquitto *context, *ctxt_tmp; + struct P_client chunk; + int rc; + + assert(db); + assert(db_fptr); + + memset(&chunk, 0, sizeof(struct P_client)); + + HASH_ITER(hh_id, db->contexts_by_id, context, ctxt_tmp){ + if(context && context->clean_start == false){ + chunk.F.session_expiry_time = context->session_expiry_time; + chunk.F.session_expiry_interval = context->session_expiry_interval; + chunk.F.last_mid = context->last_mid; + chunk.F.id_len = strlen(context->id); + chunk.client_id = context->id; + + rc = persist__chunk_client_write_v5(db_fptr, &chunk); + if(rc){ + return rc; + } + + if(persist__client_messages_save(db, db_fptr, context, context->msgs_in.inflight)) return 1; + if(persist__client_messages_save(db, db_fptr, context, context->msgs_in.queued)) return 1; + if(persist__client_messages_save(db, db_fptr, context, context->msgs_out.inflight)) return 1; + if(persist__client_messages_save(db, db_fptr, context, context->msgs_out.queued)) return 1; + } + } + + return MOSQ_ERR_SUCCESS; +} + + +static int persist__subs_retain_save(struct mosquitto_db *db, FILE *db_fptr, struct mosquitto__subhier *node, const char *topic, int level) +{ + struct mosquitto__subhier *subhier, *subhier_tmp; + struct mosquitto__subleaf *sub; + struct P_retain retain_chunk; + struct P_sub sub_chunk; + char *thistopic; + size_t slen; + int rc; + + memset(&retain_chunk, 0, sizeof(struct P_retain)); + memset(&sub_chunk, 0, sizeof(struct P_sub)); + + slen = strlen(topic) + node->topic_len + 2; + thistopic = mosquitto__malloc(sizeof(char)*slen); + if(!thistopic) return MOSQ_ERR_NOMEM; + if(level > 1 || strlen(topic)){ + snprintf(thistopic, slen, "%s/%s", topic, node->topic); + }else{ + snprintf(thistopic, slen, "%s", node->topic); + } + + sub = node->subs; + while(sub){ + if(sub->context->clean_start == false && sub->context->id){ + sub_chunk.F.identifier = sub->identifier; + sub_chunk.F.id_len = strlen(sub->context->id); + sub_chunk.F.topic_len = strlen(thistopic); + sub_chunk.F.qos = (uint8_t)sub->qos; + sub_chunk.F.options = sub->no_local<<2 | sub->retain_as_published<<3; + sub_chunk.client_id = sub->context->id; + sub_chunk.topic = thistopic; + + rc = persist__chunk_sub_write_v5(db_fptr, &sub_chunk); + if(rc){ + mosquitto__free(thistopic); + return rc; + } + } + sub = sub->next; + } + if(node->retained){ + if(strncmp(node->retained->topic, "$SYS", 4)){ + /* Don't save $SYS messages. */ + retain_chunk.F.store_id = node->retained->db_id; + rc = persist__chunk_retain_write_v5(db_fptr, &retain_chunk); + if(rc){ + mosquitto__free(thistopic); + return rc; + } + } + } + + HASH_ITER(hh, node->children, subhier, subhier_tmp){ + persist__subs_retain_save(db, db_fptr, subhier, thistopic, level+1); + } + mosquitto__free(thistopic); + return MOSQ_ERR_SUCCESS; +} + +static int persist__subs_retain_save_all(struct mosquitto_db *db, FILE *db_fptr) +{ + struct mosquitto__subhier *subhier, *subhier_tmp; + + HASH_ITER(hh, db->subs, subhier, subhier_tmp){ + if(subhier->children){ + persist__subs_retain_save(db, db_fptr, subhier->children, "", 0); + } + } + + return MOSQ_ERR_SUCCESS; +} + +int persist__backup(struct mosquitto_db *db, bool shutdown) +{ + int rc = 0; + FILE *db_fptr = NULL; + uint32_t db_version_w = htonl(MOSQ_DB_VERSION); + uint32_t crc = 0; + char *err; + char *outfile = NULL; + int len; + struct PF_cfg cfg_chunk; + + if(!db || !db->config || !db->config->persistence_filepath) return MOSQ_ERR_INVAL; + if(db->config->persistence == false) return MOSQ_ERR_SUCCESS; + + log__printf(NULL, MOSQ_LOG_INFO, "Saving in-memory database to %s.", db->config->persistence_filepath); + + len = strlen(db->config->persistence_filepath)+5; + outfile = mosquitto__malloc(len+1); + if(!outfile){ + log__printf(NULL, MOSQ_LOG_INFO, "Error saving in-memory database, out of memory."); + return MOSQ_ERR_NOMEM; + } + snprintf(outfile, len, "%s.new", db->config->persistence_filepath); + outfile[len] = '\0'; + +#ifndef WIN32 + /** + * + * If a system lost power during the rename operation at the + * end of this file the filesystem could potentially be left + * with a directory that looks like this after powerup: + * + * 24094 -rw-r--r-- 2 root root 4099 May 30 16:27 mosquitto.db + * 24094 -rw-r--r-- 2 root root 4099 May 30 16:27 mosquitto.db.new + * + * The 24094 shows that mosquitto.db.new is hard-linked to the + * same file as mosquitto.db. If fopen(outfile, "wb") is naively + * called then mosquitto.db will be truncated and the database + * potentially corrupted. + * + * Any existing mosquitto.db.new file must be removed prior to + * opening to guarantee that it is not hard-linked to + * mosquitto.db. + * + */ + rc = unlink(outfile); + if (rc != 0) { + rc = 0; + if (errno != ENOENT) { + log__printf(NULL, MOSQ_LOG_INFO, "Error saving in-memory database, unable to remove %s.", outfile); + goto error; + } + } +#endif + + db_fptr = mosquitto__fopen(outfile, "wb", true); + if(db_fptr == NULL){ + log__printf(NULL, MOSQ_LOG_INFO, "Error saving in-memory database, unable to open %s for writing.", outfile); + goto error; + } + + /* Header */ + write_e(db_fptr, magic, 15); + write_e(db_fptr, &crc, sizeof(uint32_t)); + write_e(db_fptr, &db_version_w, sizeof(uint32_t)); + + memset(&cfg_chunk, 0, sizeof(struct PF_cfg)); + cfg_chunk.last_db_id = db->last_db_id; + cfg_chunk.shutdown = shutdown; + cfg_chunk.dbid_size = sizeof(dbid_t); + if(persist__chunk_cfg_write_v5(db_fptr, &cfg_chunk)){ + goto error; + } + + if(persist__message_store_save(db, db_fptr)){ + goto error; + } + + persist__client_save(db, db_fptr); + persist__subs_retain_save_all(db, db_fptr); + +#ifndef WIN32 + /** + * + * Closing a file does not guarantee that the contents are + * written to disk. Need to flush to send data from app to OS + * buffers, then fsync to deliver data from OS buffers to disk + * (as well as disk hardware permits). + * + * man close (http://linux.die.net/man/2/close, 2016-06-20): + * + * "successful close does not guarantee that the data has + * been successfully saved to disk, as the kernel defers + * writes. It is not common for a filesystem to flush + * the buffers when the stream is closed. If you need + * to be sure that the data is physically stored, use + * fsync(2). (It will depend on the disk hardware at this + * point." + * + * This guarantees that the new state file will not overwrite + * the old state file before its contents are valid. + * + */ + + fflush(db_fptr); + fsync(fileno(db_fptr)); +#endif + fclose(db_fptr); + +#ifdef WIN32 + if(remove(db->config->persistence_filepath) != 0){ + if(errno != ENOENT){ + goto error; + } + } +#endif + if(rename(outfile, db->config->persistence_filepath) != 0){ + goto error; + } + mosquitto__free(outfile); + outfile = NULL; + return rc; +error: + mosquitto__free(outfile); + err = strerror(errno); + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", err); + if(db_fptr) fclose(db_fptr); + return 1; +} + + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist_write_v5.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist_write_v5.c new file mode 100644 index 0000000..86563c6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/persist_write_v5.c @@ -0,0 +1,232 @@ +/* +Copyright (c) 2010-2018 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#ifdef WITH_PERSISTENCE + +#ifndef WIN32 +#include <arpa/inet.h> +#endif +#include <assert.h> +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> +#include <string.h> +#include <sys/stat.h> +#include <time.h> + +#include "mosquitto_broker_internal.h" +#include "memory_mosq.h" +#include "persist.h" +#include "packet_mosq.h" +#include "property_mosq.h" +#include "time_mosq.h" +#include "util_mosq.h" + +int persist__chunk_cfg_write_v5(FILE *db_fptr, struct PF_cfg *chunk) +{ + struct PF_header header; + + header.chunk = htonl(DB_CHUNK_CFG); + header.length = htonl(sizeof(struct PF_cfg)); + write_e(db_fptr, &header, sizeof(struct PF_header)); + write_e(db_fptr, chunk, sizeof(struct PF_cfg)); + + return MOSQ_ERR_SUCCESS; +error: + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", strerror(errno)); + return 1; +} + + +int persist__chunk_client_write_v5(FILE *db_fptr, struct P_client *chunk) +{ + struct PF_header header; + uint16_t id_len = chunk->F.id_len; + + chunk->F.session_expiry_interval = htonl(chunk->F.session_expiry_interval); + chunk->F.last_mid = htons(chunk->F.last_mid); + chunk->F.id_len = htons(chunk->F.id_len); + + header.chunk = htonl(DB_CHUNK_CLIENT); + header.length = htonl(sizeof(struct PF_client)+id_len); + + write_e(db_fptr, &header, sizeof(struct PF_header)); + write_e(db_fptr, &chunk->F, sizeof(struct PF_client)); + + write_e(db_fptr, chunk->client_id, id_len); + + return MOSQ_ERR_SUCCESS; +error: + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", strerror(errno)); + return 1; +} + + +int persist__chunk_client_msg_write_v5(FILE *db_fptr, struct P_client_msg *chunk) +{ + struct PF_header header; + struct mosquitto__packet prop_packet; + uint16_t id_len = chunk->F.id_len; + uint32_t proplen = 0; + int rc; + + memset(&prop_packet, 0, sizeof(struct mosquitto__packet)); + if(chunk->properties){ + proplen = property__get_length_all(chunk->properties); + proplen += packet__varint_bytes(proplen); + } + + chunk->F.mid = htons(chunk->F.mid); + chunk->F.id_len = htons(chunk->F.id_len); + + header.chunk = htonl(DB_CHUNK_CLIENT_MSG); + header.length = htonl(sizeof(struct PF_client_msg) + id_len + proplen); + + write_e(db_fptr, &header, sizeof(struct PF_header)); + write_e(db_fptr, &chunk->F, sizeof(struct PF_client_msg)); + write_e(db_fptr, chunk->client_id, id_len); + if(chunk->properties){ + if(proplen > 0){ + prop_packet.remaining_length = proplen; + prop_packet.packet_length = proplen; + prop_packet.payload = mosquitto__malloc(proplen); + if(!prop_packet.payload){ + return MOSQ_ERR_NOMEM; + } + rc = property__write_all(&prop_packet, chunk->properties, true); + if(rc) return rc; + + write_e(db_fptr, prop_packet.payload, proplen); + mosquitto__free(prop_packet.payload); + } + } + + return MOSQ_ERR_SUCCESS; +error: + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", strerror(errno)); + return 1; +} + + +int persist__chunk_message_store_write_v5(FILE *db_fptr, struct P_msg_store *chunk) +{ + struct PF_header header; + uint32_t payloadlen = chunk->F.payloadlen; + uint16_t source_id_len = chunk->F.source_id_len; + uint16_t source_username_len = chunk->F.source_username_len; + uint16_t topic_len = chunk->F.topic_len; + uint32_t proplen = 0; + struct mosquitto__packet prop_packet; + int rc; + + memset(&prop_packet, 0, sizeof(struct mosquitto__packet)); + if(chunk->properties){ + proplen = property__get_length_all(chunk->properties); + proplen += packet__varint_bytes(proplen); + } + + chunk->F.payloadlen = htonl(chunk->F.payloadlen); + chunk->F.source_mid = htons(chunk->F.source_mid); + chunk->F.source_id_len = htons(chunk->F.source_id_len); + chunk->F.source_username_len = htons(chunk->F.source_username_len); + chunk->F.topic_len = htons(chunk->F.topic_len); + chunk->F.source_port = htons(chunk->F.source_port); + + header.chunk = htonl(DB_CHUNK_MSG_STORE); + header.length = htonl(sizeof(struct PF_msg_store) + + topic_len + payloadlen + + source_id_len + source_username_len + proplen); + + write_e(db_fptr, &header, sizeof(struct PF_header)); + write_e(db_fptr, &chunk->F, sizeof(struct PF_msg_store)); + if(source_id_len){ + write_e(db_fptr, chunk->source.id, source_id_len); + } + if(source_username_len){ + write_e(db_fptr, chunk->source.username, source_username_len); + } + write_e(db_fptr, chunk->topic, topic_len); + if(payloadlen){ + write_e(db_fptr, UHPA_ACCESS(chunk->payload, payloadlen), (unsigned int)payloadlen); + } + if(chunk->properties){ + if(proplen > 0){ + prop_packet.remaining_length = proplen; + prop_packet.packet_length = proplen; + prop_packet.payload = mosquitto__malloc(proplen); + if(!prop_packet.payload){ + return MOSQ_ERR_NOMEM; + } + rc = property__write_all(&prop_packet, chunk->properties, true); + if(rc) return rc; + + write_e(db_fptr, prop_packet.payload, proplen); + mosquitto__free(prop_packet.payload); + } + } + + return MOSQ_ERR_SUCCESS; +error: + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", strerror(errno)); + mosquitto__free(prop_packet.payload); + return 1; +} + + +int persist__chunk_retain_write_v5(FILE *db_fptr, struct P_retain *chunk) +{ + struct PF_header header; + + header.chunk = htonl(DB_CHUNK_RETAIN); + header.length = htonl(sizeof(struct PF_retain)); + + write_e(db_fptr, &header, sizeof(struct PF_header)); + write_e(db_fptr, &chunk->F, sizeof(struct PF_retain)); + + return MOSQ_ERR_SUCCESS; +error: + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", strerror(errno)); + return 1; +} + + +int persist__chunk_sub_write_v5(FILE *db_fptr, struct P_sub *chunk) +{ + struct PF_header header; + uint16_t id_len = chunk->F.id_len; + uint16_t topic_len = chunk->F.topic_len; + + chunk->F.identifier = htonl(chunk->F.identifier); + chunk->F.id_len = htons(chunk->F.id_len); + chunk->F.topic_len = htons(chunk->F.topic_len); + + header.chunk = htonl(DB_CHUNK_SUB); + header.length = htonl(sizeof(struct PF_sub) + + id_len + topic_len); + + write_e(db_fptr, &header, sizeof(struct PF_header)); + write_e(db_fptr, &chunk->F, sizeof(struct PF_sub)); + write_e(db_fptr, chunk->client_id, id_len); + write_e(db_fptr, chunk->topic, topic_len); + + return MOSQ_ERR_SUCCESS; +error: + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", strerror(errno)); + return 1; +} +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/plugin.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/plugin.c new file mode 100644 index 0000000..68386fa --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/plugin.c @@ -0,0 +1,118 @@ +/* +Copyright (c) 2016-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include "mosquitto_broker_internal.h" +#include "mosquitto_internal.h" +#include "mosquitto_broker.h" +#include "memory_mosq.h" + +#ifdef WITH_TLS +# include <openssl/ssl.h> +#endif + +const char *mosquitto_client_address(const struct mosquitto *client) +{ + return client->address; +} + + +bool mosquitto_client_clean_session(const struct mosquitto *client) +{ + return client->clean_start; +} + + +const char *mosquitto_client_id(const struct mosquitto *client) +{ + return client->id; +} + + +int mosquitto_client_keepalive(const struct mosquitto *client) +{ + return client->keepalive; +} + + +void *mosquitto_client_certificate(const struct mosquitto *client) +{ +#ifdef WITH_TLS + if(client->ssl){ + return SSL_get_peer_certificate(client->ssl); + }else{ + return NULL; + } +#else + return NULL; +#endif +} + + +int mosquitto_client_protocol(const struct mosquitto *client) +{ + return client->protocol; +} + + +int mosquitto_client_sub_count(const struct mosquitto *client) +{ + return client->sub_count; +} + + +const char *mosquitto_client_username(const struct mosquitto *context) +{ +#ifdef WITH_BRIDGE + if(context->bridge){ + return context->bridge->local_username; + }else +#endif + { + return context->username; + } +} + +int mosquitto_set_username(struct mosquitto *client, const char *username) +{ + char *u_dup; + char *old; + int rc; + + if(!client) return MOSQ_ERR_INVAL; + + if(username){ + u_dup = mosquitto__strdup(username); + if(!u_dup) return MOSQ_ERR_NOMEM; + }else{ + u_dup = NULL; + } + + old = client->username; + client->username = u_dup; + + rc = acl__find_acls(mosquitto__get_db(), client); + if(rc){ + client->username = old; + mosquitto__free(u_dup); + return rc; + }else{ + mosquitto__free(old); + return MOSQ_ERR_SUCCESS; + } +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/plugin_defer.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/plugin_defer.c new file mode 100644 index 0000000..715cd3b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/plugin_defer.c @@ -0,0 +1,65 @@ +/* +Copyright (c) 2015-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +/* This is a skeleton authentication and access control plugin that simply defers all checks. */ + +#include <stdio.h> + +#include "mosquitto_broker.h" +#include "mosquitto_plugin.h" +#include "mosquitto.h" + +int mosquitto_auth_plugin_version(void) +{ + return MOSQ_AUTH_PLUGIN_VERSION; +} + +int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_acl_check(void *user_data, int access, const struct mosquitto *client, struct mosquitto_acl_msg *msg) +{ + printf("mosquitto_acl_check(u:%s)\n", mosquitto_client_username(client)); + return MOSQ_ERR_PLUGIN_DEFER; +} + +int mosquitto_auth_unpwd_check(void *user_data, const struct mosquitto *client, const char *username, const char *password) +{ + return MOSQ_ERR_PLUGIN_DEFER; +} + +int mosquitto_auth_psk_key_get(void *user_data, const struct mosquitto *client, const char *hint, const char *identity, char *key, int max_key_len) +{ + return MOSQ_ERR_PLUGIN_DEFER; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/property_broker.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/property_broker.c new file mode 100644 index 0000000..8fddbda --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/property_broker.c @@ -0,0 +1,133 @@ +/* +Copyright (c) 2018 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <stdio.h> +#include <string.h> + +#include "mosquitto_broker_internal.h" +#include "mqtt_protocol.h" +#include "property_mosq.h" + +/* Process the incoming properties, we should be able to assume that only valid + * properties for CONNECT are present here. */ +int property__process_connect(struct mosquitto *context, mosquitto_property **props) +{ + mosquitto_property *p; + + p = *props; + + while(p){ + if(p->identifier == MQTT_PROP_SESSION_EXPIRY_INTERVAL){ + context->session_expiry_interval = p->value.i32; + }else if(p->identifier == MQTT_PROP_RECEIVE_MAXIMUM){ + if(p->value.i16 == 0){ + return MOSQ_ERR_PROTOCOL; + } + + context->msgs_out.inflight_maximum = p->value.i16; + context->msgs_out.inflight_quota = context->msgs_out.inflight_maximum; + }else if(p->identifier == MQTT_PROP_MAXIMUM_PACKET_SIZE){ + if(p->value.i32 == 0){ + return MOSQ_ERR_PROTOCOL; + } + context->maximum_packet_size = p->value.i32; + } + p = p->next; + } + + return MOSQ_ERR_SUCCESS; +} + + +int property__process_will(struct mosquitto *context, struct mosquitto_message_all *msg, mosquitto_property **props) +{ + mosquitto_property *p, *p_prev; + mosquitto_property *msg_properties, *msg_properties_last; + + p = *props; + p_prev = NULL; + msg_properties = NULL; + msg_properties_last = NULL; + while(p){ + switch(p->identifier){ + case MQTT_PROP_CONTENT_TYPE: + case MQTT_PROP_CORRELATION_DATA: + case MQTT_PROP_PAYLOAD_FORMAT_INDICATOR: + case MQTT_PROP_RESPONSE_TOPIC: + case MQTT_PROP_USER_PROPERTY: + if(msg_properties){ + msg_properties_last->next = p; + msg_properties_last = p; + }else{ + msg_properties = p; + msg_properties_last = p; + } + if(p_prev){ + p_prev->next = p->next; + p = p_prev->next; + }else{ + *props = p->next; + p = *props; + } + msg_properties_last->next = NULL; + break; + + case MQTT_PROP_WILL_DELAY_INTERVAL: + context->will_delay_interval = p->value.i32; + p_prev = p; + p = p->next; + break; + + case MQTT_PROP_MESSAGE_EXPIRY_INTERVAL: + msg->expiry_interval = p->value.i32; + p_prev = p; + p = p->next; + break; + + default: + return MOSQ_ERR_PROTOCOL; + break; + } + } + + msg->properties = msg_properties; + return MOSQ_ERR_SUCCESS; +} + + +/* Process the incoming properties, we should be able to assume that only valid + * properties for DISCONNECT are present here. */ +int property__process_disconnect(struct mosquitto *context, mosquitto_property **props) +{ + mosquitto_property *p; + + p = *props; + + while(p){ + if(p->identifier == MQTT_PROP_SESSION_EXPIRY_INTERVAL){ + if(context->session_expiry_interval == 0 && p->value.i32 != 0){ + return MOSQ_ERR_PROTOCOL; + } + context->session_expiry_interval = p->value.i32; + } + p = p->next; + } + return MOSQ_ERR_SUCCESS; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/read_handle.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/read_handle.c new file mode 100644 index 0000000..8b548b0 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/read_handle.c @@ -0,0 +1,75 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> +#include <stdio.h> +#include <string.h> + +#include "mosquitto_broker_internal.h" +#include "mqtt_protocol.h" +#include "memory_mosq.h" +#include "packet_mosq.h" +#include "read_handle.h" +#include "send_mosq.h" +#include "sys_tree.h" +#include "util_mosq.h" + + +int handle__packet(struct mosquitto_db *db, struct mosquitto *context) +{ + if(!context) return MOSQ_ERR_INVAL; + + switch((context->in_packet.command)&0xF0){ + case CMD_PINGREQ: + return handle__pingreq(context); + case CMD_PINGRESP: + return handle__pingresp(context); + case CMD_PUBACK: + return handle__pubackcomp(db, context, "PUBACK"); + case CMD_PUBCOMP: + return handle__pubackcomp(db, context, "PUBCOMP"); + case CMD_PUBLISH: + return handle__publish(db, context); + case CMD_PUBREC: + return handle__pubrec(db, context); + case CMD_PUBREL: + return handle__pubrel(db, context); + case CMD_CONNECT: + return handle__connect(db, context); + case CMD_DISCONNECT: + return handle__disconnect(db, context); + case CMD_SUBSCRIBE: + return handle__subscribe(db, context); + case CMD_UNSUBSCRIBE: + return handle__unsubscribe(db, context); +#ifdef WITH_BRIDGE + case CMD_CONNACK: + return handle__connack(db, context); + case CMD_SUBACK: + return handle__suback(context); + case CMD_UNSUBACK: + return handle__unsuback(context); +#endif + case CMD_AUTH: + return handle__auth(db, context); + default: + /* If we don't recognise the command, return an error straight away. */ + return MOSQ_ERR_PROTOCOL; + } +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/security.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/security.c new file mode 100644 index 0000000..2ccd737 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/security.c @@ -0,0 +1,879 @@ +/* +Copyright (c) 2011-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <stdio.h> +#include <string.h> + +#include "mosquitto_broker_internal.h" +#include "mosquitto_plugin.h" +#include "memory_mosq.h" +#include "lib_load.h" + +typedef int (*FUNC_auth_plugin_version)(void); + +static int security__cleanup_single(struct mosquitto__security_options *opts, bool reload); + +void LIB_ERROR(void) +{ +#ifdef WIN32 + char *buf; + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING, + NULL, GetLastError(), LANG_NEUTRAL, &buf, 0, NULL); + log__printf(NULL, MOSQ_LOG_ERR, "Load error: %s", buf); + LocalFree(buf); +#else + log__printf(NULL, MOSQ_LOG_ERR, "Load error: %s", dlerror()); +#endif +} + + +int security__load_v2(struct mosquitto__auth_plugin *plugin, struct mosquitto_auth_opt *auth_options, int auth_option_count, void *lib) +{ + int rc; + + if(!(plugin->plugin_init_v2 = (FUNC_auth_plugin_init_v2)LIB_SYM(lib, "mosquitto_auth_plugin_init"))){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_plugin_init()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + if(!(plugin->plugin_cleanup_v2 = (FUNC_auth_plugin_cleanup_v2)LIB_SYM(lib, "mosquitto_auth_plugin_cleanup"))){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_plugin_cleanup()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + if(!(plugin->security_init_v2 = (FUNC_auth_plugin_security_init_v2)LIB_SYM(lib, "mosquitto_auth_security_init"))){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_security_init()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + if(!(plugin->security_cleanup_v2 = (FUNC_auth_plugin_security_cleanup_v2)LIB_SYM(lib, "mosquitto_auth_security_cleanup"))){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_security_cleanup()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + if(!(plugin->acl_check_v2 = (FUNC_auth_plugin_acl_check_v2)LIB_SYM(lib, "mosquitto_auth_acl_check"))){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_acl_check()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + if(!(plugin->unpwd_check_v2 = (FUNC_auth_plugin_unpwd_check_v2)LIB_SYM(lib, "mosquitto_auth_unpwd_check"))){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_unpwd_check()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + if(!(plugin->psk_key_get_v2 = (FUNC_auth_plugin_psk_key_get_v2)LIB_SYM(lib, "mosquitto_auth_psk_key_get"))){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_psk_key_get()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + plugin->lib = lib; + plugin->user_data = NULL; + + if(plugin->plugin_init_v2){ + rc = plugin->plugin_init_v2(&plugin->user_data, auth_options, auth_option_count); + if(rc){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Authentication plugin returned %d when initialising.", rc); + return rc; + } + } + return 0; +} + + +int security__load_v3(struct mosquitto__auth_plugin *plugin, struct mosquitto_opt *auth_options, int auth_option_count, void *lib) +{ + int rc; + + if(!(plugin->plugin_init_v3 = (FUNC_auth_plugin_init_v3)LIB_SYM(lib, "mosquitto_auth_plugin_init"))){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_plugin_init()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + if(!(plugin->plugin_cleanup_v3 = (FUNC_auth_plugin_cleanup_v3)LIB_SYM(lib, "mosquitto_auth_plugin_cleanup"))){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_plugin_cleanup()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + if(!(plugin->security_init_v3 = (FUNC_auth_plugin_security_init_v3)LIB_SYM(lib, "mosquitto_auth_security_init"))){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_security_init()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + if(!(plugin->security_cleanup_v3 = (FUNC_auth_plugin_security_cleanup_v3)LIB_SYM(lib, "mosquitto_auth_security_cleanup"))){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_security_cleanup()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + if(!(plugin->acl_check_v3 = (FUNC_auth_plugin_acl_check_v3)LIB_SYM(lib, "mosquitto_auth_acl_check"))){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_acl_check()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + if(!(plugin->unpwd_check_v3 = (FUNC_auth_plugin_unpwd_check_v3)LIB_SYM(lib, "mosquitto_auth_unpwd_check"))){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_unpwd_check()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + if(!(plugin->psk_key_get_v3 = (FUNC_auth_plugin_psk_key_get_v3)LIB_SYM(lib, "mosquitto_auth_psk_key_get"))){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_psk_key_get()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + plugin->lib = lib; + plugin->user_data = NULL; + if(plugin->plugin_init_v3){ + rc = plugin->plugin_init_v3(&plugin->user_data, auth_options, auth_option_count); + if(rc){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Authentication plugin returned %d when initialising.", rc); + return rc; + } + } + return 0; +} + + +int security__load_v4(struct mosquitto__auth_plugin *plugin, struct mosquitto_opt *auth_options, int auth_option_count, void *lib) +{ + int rc; + + if(!(plugin->plugin_init_v4 = (FUNC_auth_plugin_init_v4)LIB_SYM(lib, "mosquitto_auth_plugin_init"))){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_plugin_init()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + if(!(plugin->plugin_cleanup_v4 = (FUNC_auth_plugin_cleanup_v4)LIB_SYM(lib, "mosquitto_auth_plugin_cleanup"))){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_plugin_cleanup()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + if(!(plugin->security_init_v4 = (FUNC_auth_plugin_security_init_v4)LIB_SYM(lib, "mosquitto_auth_security_init"))){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_security_init()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + if(!(plugin->security_cleanup_v4 = (FUNC_auth_plugin_security_cleanup_v4)LIB_SYM(lib, "mosquitto_auth_security_cleanup"))){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_security_cleanup()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + if(!(plugin->acl_check_v4 = (FUNC_auth_plugin_acl_check_v4)LIB_SYM(lib, "mosquitto_auth_acl_check"))){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_acl_check()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + plugin->unpwd_check_v4 = (FUNC_auth_plugin_unpwd_check_v4)LIB_SYM(lib, "mosquitto_auth_unpwd_check"); + if(plugin->unpwd_check_v4){ + log__printf(NULL, MOSQ_LOG_INFO, + " ├── Username/password checking enabled."); + }else{ + log__printf(NULL, MOSQ_LOG_INFO, + " ├── Username/password checking not enabled."); + } + + plugin->psk_key_get_v4 = (FUNC_auth_plugin_psk_key_get_v4)LIB_SYM(lib, "mosquitto_auth_psk_key_get"); + if(plugin->psk_key_get_v4){ + log__printf(NULL, MOSQ_LOG_INFO, + " ├── TLS-PSK checking enabled."); + }else{ + log__printf(NULL, MOSQ_LOG_INFO, + " ├── TLS-PSK checking not enabled."); + } + + plugin->auth_start_v4 = (FUNC_auth_plugin_auth_start_v4)LIB_SYM(lib, "mosquitto_auth_start"); + plugin->auth_continue_v4 = (FUNC_auth_plugin_auth_continue_v4)LIB_SYM(lib, "mosquitto_auth_continue"); + + if(plugin->auth_start_v4){ + if(plugin->auth_continue_v4){ + log__printf(NULL, MOSQ_LOG_INFO, + " └── Extended authentication enabled."); + }else{ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Plugin has missing mosquitto_auth_continue() function."); + LIB_CLOSE(lib); + return 1; + } + }else{ + log__printf(NULL, MOSQ_LOG_INFO, + " └── Extended authentication not enabled."); + } + + plugin->lib = lib; + plugin->user_data = NULL; + if(plugin->plugin_init_v4){ + rc = plugin->plugin_init_v4(&plugin->user_data, auth_options, auth_option_count); + if(rc){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Authentication plugin returned %d when initialising.", rc); + return rc; + } + } + return 0; +} + + +static int security__module_init_single(struct mosquitto__security_options *opts) +{ + void *lib; + int (*plugin_version)(void) = NULL; + int version; + int i; + int rc; + + if(opts->auth_plugin_config_count == 0){ + return MOSQ_ERR_SUCCESS; + } + + for(i=0; i<opts->auth_plugin_config_count; i++){ + if(opts->auth_plugin_configs[i].path){ + memset(&opts->auth_plugin_configs[i].plugin, 0, sizeof(struct mosquitto__auth_plugin)); + + log__printf(NULL, MOSQ_LOG_INFO, "Loading plugin: %s", opts->auth_plugin_configs[i].path); + + lib = LIB_LOAD(opts->auth_plugin_configs[i].path); + if(!lib){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin \"%s\".", opts->auth_plugin_configs[i].path); + LIB_ERROR(); + return 1; + } + + opts->auth_plugin_configs[i].plugin.lib = NULL; + if(!(plugin_version = (FUNC_auth_plugin_version)LIB_SYM(lib, "mosquitto_auth_plugin_version"))){ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_plugin_version()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + version = plugin_version(); + opts->auth_plugin_configs[i].plugin.version = version; + if(version == 4){ + rc = security__load_v4( + &opts->auth_plugin_configs[i].plugin, + opts->auth_plugin_configs[i].options, + opts->auth_plugin_configs[i].option_count, + lib); + + if(rc){ + return rc; + } + }else if(version == 3){ + rc = security__load_v3( + &opts->auth_plugin_configs[i].plugin, + opts->auth_plugin_configs[i].options, + opts->auth_plugin_configs[i].option_count, + lib); + + if(rc){ + return rc; + } + }else if(version == 2){ + rc = security__load_v2( + &opts->auth_plugin_configs[i].plugin, + (struct mosquitto_auth_opt *)opts->auth_plugin_configs[i].options, + opts->auth_plugin_configs[i].option_count, + lib); + + if(rc){ + return rc; + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, + "Error: Incorrect auth plugin version (got %d, expected %d).", + version, MOSQ_AUTH_PLUGIN_VERSION); + LIB_ERROR(); + + LIB_CLOSE(lib); + return 1; + } + } + } + return MOSQ_ERR_SUCCESS; +} + + +int mosquitto_security_module_init(struct mosquitto_db *db) +{ + int rc = MOSQ_ERR_SUCCESS; + int i; + + if(db->config->per_listener_settings){ + for(i=0; i<db->config->listener_count; i++){ + rc = security__module_init_single(&db->config->listeners[i].security_options); + if(rc) return rc; + } + }else{ + rc = security__module_init_single(&db->config->security_options); + } + return rc; +} + + +static void security__module_cleanup_single(struct mosquitto__security_options *opts) +{ + int i; + + for(i=0; i<opts->auth_plugin_config_count; i++){ + /* Run plugin cleanup function */ + if(opts->auth_plugin_configs[i].plugin.version == 4){ + opts->auth_plugin_configs[i].plugin.plugin_cleanup_v4( + opts->auth_plugin_configs[i].plugin.user_data, + opts->auth_plugin_configs[i].options, + opts->auth_plugin_configs[i].option_count); + + }else if(opts->auth_plugin_configs[i].plugin.version == 3){ + opts->auth_plugin_configs[i].plugin.plugin_cleanup_v3( + opts->auth_plugin_configs[i].plugin.user_data, + opts->auth_plugin_configs[i].options, + opts->auth_plugin_configs[i].option_count); + + }else if(opts->auth_plugin_configs[i].plugin.version == 2){ + opts->auth_plugin_configs[i].plugin.plugin_cleanup_v2( + opts->auth_plugin_configs[i].plugin.user_data, + (struct mosquitto_auth_opt *)opts->auth_plugin_configs[i].options, + opts->auth_plugin_configs[i].option_count); + } + + if(opts->auth_plugin_configs[i].plugin.lib){ + LIB_CLOSE(opts->auth_plugin_configs[i].plugin.lib); + } + memset(&opts->auth_plugin_configs[i].plugin, 0, sizeof(struct mosquitto__auth_plugin)); + } +} + + +int mosquitto_security_module_cleanup(struct mosquitto_db *db) +{ + int i; + + mosquitto_security_cleanup(db, false); + + security__module_cleanup_single(&db->config->security_options); + + for(i=0; i<db->config->listener_count; i++){ + security__module_cleanup_single(&db->config->listeners[i].security_options); + } + + return MOSQ_ERR_SUCCESS; +} + + +static int security__init_single(struct mosquitto__security_options *opts, bool reload) +{ + int i; + int rc; + + for(i=0; i<opts->auth_plugin_config_count; i++){ + if(opts->auth_plugin_configs[i].plugin.version == 4){ + rc = opts->auth_plugin_configs[i].plugin.security_init_v4( + opts->auth_plugin_configs[i].plugin.user_data, + opts->auth_plugin_configs[i].options, + opts->auth_plugin_configs[i].option_count, + reload); + + }else if(opts->auth_plugin_configs[i].plugin.version == 3){ + rc = opts->auth_plugin_configs[i].plugin.security_init_v3( + opts->auth_plugin_configs[i].plugin.user_data, + opts->auth_plugin_configs[i].options, + opts->auth_plugin_configs[i].option_count, + reload); + + }else if(opts->auth_plugin_configs[i].plugin.version == 2){ + rc = opts->auth_plugin_configs[i].plugin.security_init_v2( + opts->auth_plugin_configs[i].plugin.user_data, + (struct mosquitto_auth_opt *)opts->auth_plugin_configs[i].options, + opts->auth_plugin_configs[i].option_count, + reload); + }else{ + rc = MOSQ_ERR_INVAL; + } + if(rc != MOSQ_ERR_SUCCESS){ + return rc; + } + } + return MOSQ_ERR_SUCCESS; +} + + +int mosquitto_security_init(struct mosquitto_db *db, bool reload) +{ + int i; + int rc; + + if(db->config->per_listener_settings){ + for(i=0; i<db->config->listener_count; i++){ + rc = security__init_single(&db->config->listeners[i].security_options, reload); + if(rc != MOSQ_ERR_SUCCESS) return rc; + } + }else{ + rc = security__init_single(&db->config->security_options, reload); + if(rc != MOSQ_ERR_SUCCESS) return rc; + } + return mosquitto_security_init_default(db, reload); +} + +/* Apply security settings after a reload. + * Includes: + * - Disconnecting anonymous users if appropriate + * - Disconnecting users with invalid passwords + * - Reapplying ACLs + */ +int mosquitto_security_apply(struct mosquitto_db *db) +{ + return mosquitto_security_apply_default(db); +} + + +static int security__cleanup_single(struct mosquitto__security_options *opts, bool reload) +{ + int i; + int rc; + + for(i=0; i<opts->auth_plugin_config_count; i++){ + if(opts->auth_plugin_configs[i].plugin.version == 4){ + rc = opts->auth_plugin_configs[i].plugin.security_cleanup_v4( + opts->auth_plugin_configs[i].plugin.user_data, + opts->auth_plugin_configs[i].options, + opts->auth_plugin_configs[i].option_count, + reload); + + }else if(opts->auth_plugin_configs[i].plugin.version == 3){ + rc = opts->auth_plugin_configs[i].plugin.security_cleanup_v3( + opts->auth_plugin_configs[i].plugin.user_data, + opts->auth_plugin_configs[i].options, + opts->auth_plugin_configs[i].option_count, + reload); + + }else if(opts->auth_plugin_configs[i].plugin.version == 2){ + rc = opts->auth_plugin_configs[i].plugin.security_cleanup_v2( + opts->auth_plugin_configs[i].plugin.user_data, + (struct mosquitto_auth_opt *)opts->auth_plugin_configs[i].options, + opts->auth_plugin_configs[i].option_count, + reload); + }else{ + rc = MOSQ_ERR_INVAL; + } + if(rc != MOSQ_ERR_SUCCESS){ + return rc; + } + } + + return MOSQ_ERR_SUCCESS; +} + + +int mosquitto_security_cleanup(struct mosquitto_db *db, bool reload) +{ + int i; + int rc; + + rc = security__cleanup_single(&db->config->security_options, reload); + if(rc != MOSQ_ERR_SUCCESS) return rc; + + for(i=0; i<db->config->listener_count; i++){ + rc = security__cleanup_single(&db->config->listeners[i].security_options, reload); + if(rc != MOSQ_ERR_SUCCESS) return rc; + } + return mosquitto_security_cleanup_default(db, reload); +} + + +//int mosquitto_acl_check(struct mosquitto_db *db, struct mosquitto *context, const char *topic, int access) +static int acl__check_single(struct mosquitto__auth_plugin_config *auth_plugin, struct mosquitto *context, struct mosquitto_acl_msg *msg, int access) +{ + const char *username; + const char *topic = msg->topic; + + username = mosquitto_client_username(context); + if(auth_plugin->deny_special_chars == true){ + /* Check whether the client id or username contains a +, # or / and if + * so deny access. + * + * Do this check for every message regardless, we have to protect the + * plugins against possible pattern based attacks. + */ + if(username && strpbrk(username, "+#")){ + log__printf(NULL, MOSQ_LOG_NOTICE, "ACL denying access to client with dangerous username \"%s\"", username); + return MOSQ_ERR_ACL_DENIED; + } + if(context->id && strpbrk(context->id, "+#")){ + log__printf(NULL, MOSQ_LOG_NOTICE, "ACL denying access to client with dangerous client id \"%s\"", context->id); + return MOSQ_ERR_ACL_DENIED; + } + } + + if(auth_plugin->plugin.version == 4){ + return auth_plugin->plugin.acl_check_v4(auth_plugin->plugin.user_data, access, context, msg); + }else if(auth_plugin->plugin.version == 3){ + return auth_plugin->plugin.acl_check_v3(auth_plugin->plugin.user_data, access, context, msg); + }else if(auth_plugin->plugin.version == 2){ + if(access == MOSQ_ACL_SUBSCRIBE){ + return MOSQ_ERR_SUCCESS; + } + return auth_plugin->plugin.acl_check_v2(auth_plugin->plugin.user_data, context->id, username, topic, access); + }else{ + return MOSQ_ERR_INVAL; + } +} + + +static int acl__check_dollar(const char *topic, int access) +{ + int rc; + bool match = false; + + if(topic[0] != '$') return MOSQ_ERR_SUCCESS; + + if(!strncmp(topic, "$SYS", 4)){ + if(access == MOSQ_ACL_WRITE){ + /* Potentially allow write access for bridge status, otherwise explicitly deny. */ + rc = mosquitto_topic_matches_sub("$SYS/broker/connection/+/state", topic, &match); + if(rc == MOSQ_ERR_SUCCESS && match == true){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_ACL_DENIED; + } + }else{ + return MOSQ_ERR_SUCCESS; + } + }else if(!strncmp(topic, "$share", 6)){ + /* Only allow sub/unsub to shared subscriptions */ + if(access == MOSQ_ACL_SUBSCRIBE){ + //FIXME if(access == MOSQ_ACL_SUBSCRIBE || access == MOSQ_ACL_UNSUBSCRIBE){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_ACL_DENIED; + } + }else{ + /* This is an unknown $ topic, for the moment just defer to actual tests. */ + return MOSQ_ERR_SUCCESS; + } +} + + +int mosquitto_acl_check(struct mosquitto_db *db, struct mosquitto *context, const char *topic, long payloadlen, void* payload, int qos, bool retain, int access) +{ + int rc; + int i; + struct mosquitto__security_options *opts; + struct mosquitto_acl_msg msg; + + if(!context->id){ + return MOSQ_ERR_ACL_DENIED; + } + + rc = acl__check_dollar(topic, access); + if(rc) return rc; + + rc = mosquitto_acl_check_default(db, context, topic, access); + if(rc != MOSQ_ERR_PLUGIN_DEFER){ + return rc; + } + /* Default check has accepted or deferred at this point. + * If no plugins exist we should accept at this point so set rc to success. + */ + rc = MOSQ_ERR_SUCCESS; + + if(db->config->per_listener_settings){ + opts = &context->listener->security_options; + }else{ + opts = &db->config->security_options; + } + + memset(&msg, 0, sizeof(msg)); + msg.topic = topic; + msg.payloadlen = payloadlen; + msg.payload = payload; + msg.qos = qos; + msg.retain = retain; + + for(i=0; i<opts->auth_plugin_config_count; i++){ + rc = acl__check_single(&opts->auth_plugin_configs[i], context, &msg, access); + if(rc != MOSQ_ERR_PLUGIN_DEFER){ + return rc; + } + } + + /* If all plugins deferred, this is a denial. If rc == MOSQ_ERR_SUCCESS + * here, then no plugins were configured. */ + if(rc == MOSQ_ERR_PLUGIN_DEFER){ + rc = MOSQ_ERR_ACL_DENIED; + } + return rc; +} + +int mosquitto_unpwd_check(struct mosquitto_db *db, struct mosquitto *context, const char *username, const char *password) +{ + int rc; + int i; + struct mosquitto__security_options *opts; + + rc = mosquitto_unpwd_check_default(db, context, username, password); + if(rc != MOSQ_ERR_PLUGIN_DEFER){ + return rc; + } + /* Default check has accepted or deferred at this point. + * If no plugins exist we should accept at this point so set rc to success. + */ + if(db->config->per_listener_settings){ + opts = &context->listener->security_options; + }else{ + opts = &db->config->security_options; + } + + rc = MOSQ_ERR_SUCCESS; + for(i=0; i<opts->auth_plugin_config_count; i++){ + if(opts->auth_plugin_configs[i].plugin.version == 4 + && opts->auth_plugin_configs[i].plugin.unpwd_check_v4){ + + rc = opts->auth_plugin_configs[i].plugin.unpwd_check_v4( + opts->auth_plugin_configs[i].plugin.user_data, + context, + username, + password); + + }else if(opts->auth_plugin_configs[i].plugin.version == 3){ + rc = opts->auth_plugin_configs[i].plugin.unpwd_check_v3( + opts->auth_plugin_configs[i].plugin.user_data, + context, + username, + password); + + }else if(opts->auth_plugin_configs[i].plugin.version == 2){ + rc = opts->auth_plugin_configs[i].plugin.unpwd_check_v2( + opts->auth_plugin_configs[i].plugin.user_data, + username, + password); + }else{ + rc = MOSQ_ERR_INVAL; + } + if(rc != MOSQ_ERR_PLUGIN_DEFER){ + return rc; + } + } + /* If all plugins deferred, this is a denial. If rc == MOSQ_ERR_SUCCESS + * here, then no plugins were configured. */ + if(rc == MOSQ_ERR_PLUGIN_DEFER){ + rc = MOSQ_ERR_AUTH; + } + return rc; +} + +int mosquitto_psk_key_get(struct mosquitto_db *db, struct mosquitto *context, const char *hint, const char *identity, char *key, int max_key_len) +{ + int rc; + int i; + struct mosquitto__security_options *opts; + + rc = mosquitto_psk_key_get_default(db, context, hint, identity, key, max_key_len); + if(rc != MOSQ_ERR_PLUGIN_DEFER){ + return rc; + } + + /* Default check has accepted or deferred at this point. + * If no plugins exist we should accept at this point so set rc to success. + */ + + if(db->config->per_listener_settings){ + opts = &context->listener->security_options; + }else{ + opts = &db->config->security_options; + } + + for(i=0; i<opts->auth_plugin_config_count; i++){ + if(opts->auth_plugin_configs[i].plugin.version == 4 + && opts->auth_plugin_configs[i].plugin.psk_key_get_v4){ + + rc = opts->auth_plugin_configs[i].plugin.psk_key_get_v4( + opts->auth_plugin_configs[i].plugin.user_data, + context, + hint, + identity, + key, + max_key_len); + + }else if(opts->auth_plugin_configs[i].plugin.version == 3){ + rc = opts->auth_plugin_configs[i].plugin.psk_key_get_v3( + opts->auth_plugin_configs[i].plugin.user_data, + context, + hint, + identity, + key, + max_key_len); + + }else if(opts->auth_plugin_configs[i].plugin.version == 2){ + rc = opts->auth_plugin_configs[i].plugin.psk_key_get_v2( + opts->auth_plugin_configs[i].plugin.user_data, + hint, + identity, + key, + max_key_len); + }else{ + rc = MOSQ_ERR_INVAL; + } + if(rc != MOSQ_ERR_PLUGIN_DEFER){ + return rc; + } + } + + /* If all plugins deferred, this is a denial. If rc == MOSQ_ERR_SUCCESS + * here, then no plugins were configured. */ + if(rc == MOSQ_ERR_PLUGIN_DEFER){ + rc = MOSQ_ERR_AUTH; + } + return rc; +} + + +int mosquitto_security_auth_start(struct mosquitto_db *db, struct mosquitto *context, bool reauth, const void *data_in, uint16_t data_in_len, void **data_out, uint16_t *data_out_len) +{ + int rc = MOSQ_ERR_PLUGIN_DEFER; + int i; + struct mosquitto__security_options *opts; + + if(!context || !context->listener || !context->auth_method) return MOSQ_ERR_INVAL; + if(!data_out || !data_out_len) return MOSQ_ERR_INVAL; + + if(db->config->per_listener_settings){ + opts = &context->listener->security_options; + }else{ + opts = &db->config->security_options; + } + + for(i=0; i<opts->auth_plugin_config_count; i++){ + if(opts->auth_plugin_configs[i].plugin.auth_start_v4){ + *data_out = NULL; + *data_out_len = 0; + + rc = opts->auth_plugin_configs[i].plugin.auth_start_v4( + opts->auth_plugin_configs[i].plugin.user_data, + context, + context->auth_method, + reauth, + data_in, data_in_len, + data_out, data_out_len); + + if(rc == MOSQ_ERR_SUCCESS){ + return MOSQ_ERR_SUCCESS; + }else if(rc == MOSQ_ERR_AUTH_CONTINUE){ + return MOSQ_ERR_AUTH_CONTINUE; + }else if(rc != MOSQ_ERR_NOT_SUPPORTED){ + return rc; + } + } + } + + return MOSQ_ERR_NOT_SUPPORTED; +} + + +int mosquitto_security_auth_continue(struct mosquitto_db *db, struct mosquitto *context, const void *data_in, uint16_t data_in_len, void **data_out, uint16_t *data_out_len) +{ + int rc = MOSQ_ERR_PLUGIN_DEFER; + int i; + struct mosquitto__security_options *opts; + + if(!context || !context->listener || !context->auth_method) return MOSQ_ERR_INVAL; + if(!data_out || !data_out_len) return MOSQ_ERR_INVAL; + + if(db->config->per_listener_settings){ + opts = &context->listener->security_options; + }else{ + opts = &db->config->security_options; + } + + for(i=0; i<opts->auth_plugin_config_count; i++){ + if(opts->auth_plugin_configs[i].plugin.auth_start_v4){ + *data_out = NULL; + *data_out_len = 0; + + rc = opts->auth_plugin_configs[i].plugin.auth_continue_v4( + opts->auth_plugin_configs[i].plugin.user_data, + context, + context->auth_method, + data_in, data_in_len, + data_out, data_out_len); + + if(rc == MOSQ_ERR_SUCCESS){ + return MOSQ_ERR_SUCCESS; + }else if(rc == MOSQ_ERR_AUTH_CONTINUE){ + return MOSQ_ERR_AUTH_CONTINUE; + }else if(rc != MOSQ_ERR_NOT_SUPPORTED){ + return rc; + } + } + } + + return MOSQ_ERR_NOT_SUPPORTED; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/security_default.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/security_default.c new file mode 100644 index 0000000..cf5d81b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/security_default.c @@ -0,0 +1,1131 @@ +/* +Copyright (c) 2011-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <stdio.h> +#include <string.h> + +#include "mosquitto_broker_internal.h" +#include "memory_mosq.h" +#include "util_mosq.h" + +static int aclfile__parse(struct mosquitto_db *db, struct mosquitto__security_options *security_opts); +static int unpwd__file_parse(struct mosquitto__unpwd **unpwd, const char *password_file); +static int acl__cleanup(struct mosquitto_db *db, bool reload); +static int unpwd__cleanup(struct mosquitto__unpwd **unpwd, bool reload); +static int psk__file_parse(struct mosquitto_db *db, struct mosquitto__unpwd **psk_id, const char *psk_file); +#ifdef WITH_TLS +static int pw__digest(const char *password, const unsigned char *salt, unsigned int salt_len, unsigned char *hash, unsigned int *hash_len); +static int base64__decode(char *in, unsigned char **decoded, unsigned int *decoded_len); +static int mosquitto__memcmp_const(const void *ptr1, const void *b, size_t len); +#endif + + + +int mosquitto_security_init_default(struct mosquitto_db *db, bool reload) +{ + int rc; + int i; + char *pwf; + char *pskf; + + UNUSED(reload); + + /* Load username/password data if required. */ + if(db->config->per_listener_settings){ + for(i=0; i<db->config->listener_count; i++){ + pwf = db->config->listeners[i].security_options.password_file; + if(pwf){ + rc = unpwd__file_parse(&db->config->listeners[i].unpwd, pwf); + if(rc){ + log__printf(NULL, MOSQ_LOG_ERR, "Error opening password file \"%s\".", pwf); + return rc; + } + } + } + }else{ + if(db->config->security_options.password_file){ + pwf = db->config->security_options.password_file; + if(pwf){ + rc = unpwd__file_parse(&db->unpwd, pwf); + if(rc){ + log__printf(NULL, MOSQ_LOG_ERR, "Error opening password file \"%s\".", pwf); + return rc; + } + } + } + } + + /* Load acl data if required. */ + if(db->config->per_listener_settings){ + for(i=0; i<db->config->listener_count; i++){ + if(db->config->listeners[i].security_options.acl_file){ + rc = aclfile__parse(db, &db->config->listeners[i].security_options); + if(rc){ + log__printf(NULL, MOSQ_LOG_ERR, "Error opening acl file \"%s\".", db->config->listeners[i].security_options.acl_file); + return rc; + } + } + } + }else{ + if(db->config->security_options.acl_file){ + rc = aclfile__parse(db, &db->config->security_options); + if(rc){ + log__printf(NULL, MOSQ_LOG_ERR, "Error opening acl file \"%s\".", db->config->security_options.acl_file); + return rc; + } + } + } + + /* Load psk data if required. */ + if(db->config->per_listener_settings){ + for(i=0; i<db->config->listener_count; i++){ + pskf = db->config->listeners[i].security_options.psk_file; + if(pskf){ + rc = psk__file_parse(db, &db->config->listeners[i].psk_id, pskf); + if(rc){ + log__printf(NULL, MOSQ_LOG_ERR, "Error opening psk file \"%s\".", pskf); + return rc; + } + } + } + }else{ + char *pskf = db->config->security_options.psk_file; + if(pskf){ + rc = psk__file_parse(db, &db->psk_id, pskf); + if(rc){ + log__printf(NULL, MOSQ_LOG_ERR, "Error opening psk file \"%s\".", pskf); + return rc; + } + } + } + + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_security_cleanup_default(struct mosquitto_db *db, bool reload) +{ + int rc; + int i; + + rc = acl__cleanup(db, reload); + if(rc != MOSQ_ERR_SUCCESS) return rc; + + rc = unpwd__cleanup(&db->unpwd, reload); + if(rc != MOSQ_ERR_SUCCESS) return rc; + + for(i=0; i<db->config->listener_count; i++){ + if(db->config->listeners[i].unpwd){ + rc = unpwd__cleanup(&db->config->listeners[i].unpwd, reload); + if(rc != MOSQ_ERR_SUCCESS) return rc; + } + } + + rc = unpwd__cleanup(&db->psk_id, reload); + if(rc != MOSQ_ERR_SUCCESS) return rc; + + for(i=0; i<db->config->listener_count; i++){ + if(db->config->listeners[i].psk_id){ + rc = unpwd__cleanup(&db->config->listeners[i].psk_id, reload); + if(rc != MOSQ_ERR_SUCCESS) return rc; + } + } + + return MOSQ_ERR_SUCCESS; +} + + +int add__acl(struct mosquitto__security_options *security_opts, const char *user, const char *topic, int access) +{ + struct mosquitto__acl_user *acl_user=NULL, *user_tail; + struct mosquitto__acl *acl, *acl_tail; + char *local_topic; + bool new_user = false; + + if(!security_opts || !topic) return MOSQ_ERR_INVAL; + + local_topic = mosquitto__strdup(topic); + if(!local_topic){ + return MOSQ_ERR_NOMEM; + } + + if(security_opts->acl_list){ + user_tail = security_opts->acl_list; + while(user_tail){ + if(user == NULL){ + if(user_tail->username == NULL){ + acl_user = user_tail; + break; + } + }else if(user_tail->username && !strcmp(user_tail->username, user)){ + acl_user = user_tail; + break; + } + user_tail = user_tail->next; + } + } + if(!acl_user){ + acl_user = mosquitto__malloc(sizeof(struct mosquitto__acl_user)); + if(!acl_user){ + mosquitto__free(local_topic); + return MOSQ_ERR_NOMEM; + } + new_user = true; + if(user){ + acl_user->username = mosquitto__strdup(user); + if(!acl_user->username){ + mosquitto__free(local_topic); + mosquitto__free(acl_user); + return MOSQ_ERR_NOMEM; + } + }else{ + acl_user->username = NULL; + } + acl_user->next = NULL; + acl_user->acl = NULL; + } + + acl = mosquitto__malloc(sizeof(struct mosquitto__acl)); + if(!acl){ + mosquitto__free(local_topic); + mosquitto__free(acl_user->username); + mosquitto__free(acl_user); + return MOSQ_ERR_NOMEM; + } + acl->access = access; + acl->topic = local_topic; + acl->next = NULL; + acl->ccount = 0; + acl->ucount = 0; + + /* Add acl to user acl list */ + if(acl_user->acl){ + acl_tail = acl_user->acl; + while(acl_tail->next){ + acl_tail = acl_tail->next; + } + acl_tail->next = acl; + }else{ + acl_user->acl = acl; + } + + if(new_user){ + /* Add to end of list */ + if(security_opts->acl_list){ + user_tail = security_opts->acl_list; + while(user_tail->next){ + user_tail = user_tail->next; + } + user_tail->next = acl_user; + }else{ + security_opts->acl_list = acl_user; + } + } + + return MOSQ_ERR_SUCCESS; +} + +int add__acl_pattern(struct mosquitto__security_options *security_opts, const char *topic, int access) +{ + struct mosquitto__acl *acl, *acl_tail; + char *local_topic; + char *s; + + if(!security_opts| !topic) return MOSQ_ERR_INVAL; + + local_topic = mosquitto__strdup(topic); + if(!local_topic){ + return MOSQ_ERR_NOMEM; + } + + acl = mosquitto__malloc(sizeof(struct mosquitto__acl)); + if(!acl){ + mosquitto__free(local_topic); + return MOSQ_ERR_NOMEM; + } + acl->access = access; + acl->topic = local_topic; + acl->next = NULL; + + acl->ccount = 0; + s = local_topic; + while(s){ + s = strstr(s, "%c"); + if(s){ + acl->ccount++; + s+=2; + } + } + + acl->ucount = 0; + s = local_topic; + while(s){ + s = strstr(s, "%u"); + if(s){ + acl->ucount++; + s+=2; + } + } + + if(acl->ccount == 0 && acl->ucount == 0){ + log__printf(NULL, MOSQ_LOG_WARNING, + "Warning: ACL pattern '%s' does not contain '%%c' or '%%u'.", + topic); + } + + if(security_opts->acl_patterns){ + acl_tail = security_opts->acl_patterns; + while(acl_tail->next){ + acl_tail = acl_tail->next; + } + acl_tail->next = acl; + }else{ + security_opts->acl_patterns = acl; + } + + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_acl_check_default(struct mosquitto_db *db, struct mosquitto *context, const char *topic, int access) +{ + char *local_acl; + struct mosquitto__acl *acl_root; + bool result; + int i; + int len, tlen, clen, ulen; + char *s; + struct mosquitto__security_options *security_opts = NULL; + + if(!db || !context || !topic) return MOSQ_ERR_INVAL; + if(context->bridge) return MOSQ_ERR_SUCCESS; + + if(db->config->per_listener_settings){ + if(!context->listener) return MOSQ_ERR_ACL_DENIED; + security_opts = &context->listener->security_options; + }else{ + security_opts = &db->config->security_options; + } + if(!security_opts->acl_file && !security_opts->acl_list && !security_opts->acl_patterns){ + return MOSQ_ERR_PLUGIN_DEFER; + } + + if(access == MOSQ_ACL_SUBSCRIBE) return MOSQ_ERR_SUCCESS; /* FIXME - implement ACL subscription strings. */ + if(!context->acl_list && !security_opts->acl_patterns) return MOSQ_ERR_ACL_DENIED; + + if(context->acl_list){ + acl_root = context->acl_list->acl; + }else{ + acl_root = NULL; + } + + /* Loop through all ACLs for this client. */ + while(acl_root){ + /* Loop through the topic looking for matches to this ACL. */ + + /* If subscription starts with $, acl_root->topic must also start with $. */ + if(topic[0] == '$' && acl_root->topic[0] != '$'){ + acl_root = acl_root->next; + continue; + } + mosquitto_topic_matches_sub(acl_root->topic, topic, &result); + if(result){ + if(access & acl_root->access){ + /* And access is allowed. */ + return MOSQ_ERR_SUCCESS; + } + } + acl_root = acl_root->next; + } + + acl_root = security_opts->acl_patterns; + + if(acl_root){ + /* We are using pattern based acls. Check whether the username or + * client id contains a + or # and if so deny access. + * + * Without this, a malicious client may configure its username/client + * id to bypass ACL checks (or have a username/client id that cannot + * publish or receive messages to its own place in the hierarchy). + */ + if(context->username && strpbrk(context->username, "+#")){ + log__printf(NULL, MOSQ_LOG_NOTICE, "ACL denying access to client with dangerous username \"%s\"", context->username); + return MOSQ_ERR_ACL_DENIED; + } + + if(context->id && strpbrk(context->id, "+#")){ + log__printf(NULL, MOSQ_LOG_NOTICE, "ACL denying access to client with dangerous client id \"%s\"", context->id); + return MOSQ_ERR_ACL_DENIED; + } + } + + /* Loop through all pattern ACLs. */ + if(!context->id) return MOSQ_ERR_ACL_DENIED; + clen = strlen(context->id); + + while(acl_root){ + tlen = strlen(acl_root->topic); + + if(acl_root->ucount && !context->username){ + acl_root = acl_root->next; + continue; + } + + if(context->username){ + ulen = strlen(context->username); + len = tlen + acl_root->ccount*(clen-2) + acl_root->ucount*(ulen-2); + }else{ + ulen = 0; + len = tlen + acl_root->ccount*(clen-2); + } + local_acl = mosquitto__malloc(len+1); + if(!local_acl) return 1; // FIXME + s = local_acl; + for(i=0; i<tlen; i++){ + if(i<tlen-1 && acl_root->topic[i] == '%'){ + if(acl_root->topic[i+1] == 'c'){ + i++; + strncpy(s, context->id, clen); + s+=clen; + continue; + }else if(context->username && acl_root->topic[i+1] == 'u'){ + i++; + strncpy(s, context->username, ulen); + s+=ulen; + continue; + } + } + s[0] = acl_root->topic[i]; + s++; + } + local_acl[len] = '\0'; + + mosquitto_topic_matches_sub(local_acl, topic, &result); + mosquitto__free(local_acl); + if(result){ + if(access & acl_root->access){ + /* And access is allowed. */ + return MOSQ_ERR_SUCCESS; + } + } + + acl_root = acl_root->next; + } + + return MOSQ_ERR_ACL_DENIED; +} + + +static int aclfile__parse(struct mosquitto_db *db, struct mosquitto__security_options *security_opts) +{ + FILE *aclfptr; + char buf[1024]; + char *token; + char *user = NULL; + char *topic; + char *access_s; + int access; + int rc; + int slen; + int topic_pattern; + char *saveptr = NULL; + + if(!db || !db->config) return MOSQ_ERR_INVAL; + if(!security_opts) return MOSQ_ERR_INVAL; + if(!security_opts->acl_file) return MOSQ_ERR_SUCCESS; + + aclfptr = mosquitto__fopen(security_opts->acl_file, "rt", false); + if(!aclfptr){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to open acl_file \"%s\".", security_opts->acl_file); + return 1; + } + + // topic [read|write] <topic> + // user <user> + + while(fgets(buf, 1024, aclfptr)){ + slen = strlen(buf); + while(slen > 0 && (buf[slen-1] == 10 || buf[slen-1] == 13)){ + buf[slen-1] = '\0'; + slen = strlen(buf); + } + if(buf[0] == '#'){ + continue; + } + token = strtok_r(buf, " ", &saveptr); + if(token){ + if(!strcmp(token, "topic") || !strcmp(token, "pattern")){ + if(!strcmp(token, "topic")){ + topic_pattern = 0; + }else{ + topic_pattern = 1; + } + + access_s = strtok_r(NULL, " ", &saveptr); + if(!access_s){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty topic in acl_file \"%s\".", security_opts->acl_file); + mosquitto__free(user); + fclose(aclfptr); + return MOSQ_ERR_INVAL; + } + token = strtok_r(NULL, "", &saveptr); + if(token){ + topic = token; + /* Ignore duplicate spaces */ + while(topic[0] == ' '){ + topic++; + } + }else{ + topic = access_s; + access_s = NULL; + } + if(access_s){ + if(!strcmp(access_s, "read")){ + access = MOSQ_ACL_READ; + }else if(!strcmp(access_s, "write")){ + access = MOSQ_ACL_WRITE; + }else if(!strcmp(access_s, "readwrite")){ + access = MOSQ_ACL_READ | MOSQ_ACL_WRITE; + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid topic access type \"%s\" in acl_file \"%s\".", access_s, security_opts->acl_file); + mosquitto__free(user); + fclose(aclfptr); + return MOSQ_ERR_INVAL; + } + }else{ + access = MOSQ_ACL_READ | MOSQ_ACL_WRITE; + } + if(topic_pattern == 0){ + rc = add__acl(security_opts, user, topic, access); + }else{ + rc = add__acl_pattern(security_opts, topic, access); + } + if(rc){ + mosquitto__free(user); + fclose(aclfptr); + return rc; + } + }else if(!strcmp(token, "user")){ + token = strtok_r(NULL, "", &saveptr); + if(token){ + /* Ignore duplicate spaces */ + while(token[0] == ' '){ + token++; + } + mosquitto__free(user); + user = mosquitto__strdup(token); + if(!user){ + fclose(aclfptr); + return MOSQ_ERR_NOMEM; + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Missing username in acl_file \"%s\".", security_opts->acl_file); + mosquitto__free(user); + fclose(aclfptr); + return 1; + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid line in acl_file \"%s\": %s.", security_opts->acl_file, buf); + fclose(aclfptr); + return 1; + } + } + } + + mosquitto__free(user); + fclose(aclfptr); + + return MOSQ_ERR_SUCCESS; +} + +static void free__acl(struct mosquitto__acl *acl) +{ + if(!acl) return; + + if(acl->next){ + free__acl(acl->next); + } + mosquitto__free(acl->topic); + mosquitto__free(acl); +} + + +static void acl__cleanup_single(struct mosquitto__security_options *security_opts) +{ + struct mosquitto__acl_user *user_tail; + + while(security_opts->acl_list){ + user_tail = security_opts->acl_list->next; + + free__acl(security_opts->acl_list->acl); + mosquitto__free(security_opts->acl_list->username); + mosquitto__free(security_opts->acl_list); + + security_opts->acl_list = user_tail; + } + + if(security_opts->acl_patterns){ + free__acl(security_opts->acl_patterns); + security_opts->acl_patterns = NULL; + } +} + + +static int acl__cleanup(struct mosquitto_db *db, bool reload) +{ + struct mosquitto *context, *ctxt_tmp; + int i; + + UNUSED(reload); + + if(!db) return MOSQ_ERR_INVAL; + + /* As we're freeing ACLs, we must clear context->acl_list to ensure no + * invalid memory accesses take place later. + * This *requires* the ACLs to be reapplied after acl__cleanup() + * is called if we are reloading the config. If this is not done, all + * access will be denied to currently connected clients. + */ + HASH_ITER(hh_id, db->contexts_by_id, context, ctxt_tmp){ + context->acl_list = NULL; + } + + if(db->config->per_listener_settings){ + for(i=0; i<db->config->listener_count; i++){ + acl__cleanup_single(&db->config->listeners[i].security_options); + } + }else{ + acl__cleanup_single(&db->config->security_options); + } + + return MOSQ_ERR_SUCCESS; +} + + +int acl__find_acls(struct mosquitto_db *db, struct mosquitto *context) +{ + struct mosquitto__acl_user *acl_tail; + struct mosquitto__security_options *security_opts; + + /* Associate user with its ACL, assuming we have ACLs loaded. */ + if(db->config->per_listener_settings){ + if(!context->listener){ + return MOSQ_ERR_INVAL; + } + security_opts = &context->listener->security_options; + }else{ + security_opts = &db->config->security_options; + } + + if(security_opts->acl_list){ + acl_tail = security_opts->acl_list; + while(acl_tail){ + if(context->username){ + if(acl_tail->username && !strcmp(context->username, acl_tail->username)){ + context->acl_list = acl_tail; + break; + } + }else{ + if(acl_tail->username == NULL){ + context->acl_list = acl_tail; + break; + } + } + acl_tail = acl_tail->next; + } + }else{ + context->acl_list = NULL; + } + + return MOSQ_ERR_SUCCESS; +} + + +static int pwfile__parse(const char *file, struct mosquitto__unpwd **root) +{ + FILE *pwfile; + struct mosquitto__unpwd *unpwd; + char buf[256]; + char *username, *password; + int len; + char *saveptr = NULL; + + pwfile = mosquitto__fopen(file, "rt", false); + if(!pwfile){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to open pwfile \"%s\".", file); + return 1; + } + + while(!feof(pwfile)){ + if(fgets(buf, 256, pwfile)){ + if(buf[0] == '#') continue; + if(!strchr(buf, ':')) continue; + + username = strtok_r(buf, ":", &saveptr); + if(username){ + unpwd = mosquitto__calloc(1, sizeof(struct mosquitto__unpwd)); + if(!unpwd){ + fclose(pwfile); + return MOSQ_ERR_NOMEM; + } + unpwd->username = mosquitto__strdup(username); + if(!unpwd->username){ + mosquitto__free(unpwd); + fclose(pwfile); + return MOSQ_ERR_NOMEM; + } + len = strlen(unpwd->username); + while(unpwd->username[len-1] == 10 || unpwd->username[len-1] == 13){ + unpwd->username[len-1] = '\0'; + len = strlen(unpwd->username); + } + password = strtok_r(NULL, ":", &saveptr); + if(password){ + unpwd->password = mosquitto__strdup(password); + if(!unpwd->password){ + fclose(pwfile); + mosquitto__free(unpwd->username); + mosquitto__free(unpwd); + return MOSQ_ERR_NOMEM; + } + len = strlen(unpwd->password); + while(len && (unpwd->password[len-1] == 10 || unpwd->password[len-1] == 13)){ + unpwd->password[len-1] = '\0'; + len = strlen(unpwd->password); + } + + HASH_ADD_KEYPTR(hh, *root, unpwd->username, strlen(unpwd->username), unpwd); + }else{ + log__printf(NULL, MOSQ_LOG_NOTICE, "Warning: Invalid line in password file '%s': %s", file, buf); + mosquitto__free(unpwd->username); + mosquitto__free(unpwd); + } + } + } + } + fclose(pwfile); + + return MOSQ_ERR_SUCCESS; +} + + +#ifdef WITH_TLS + +static void unpwd__free_item(struct mosquitto__unpwd **unpwd, struct mosquitto__unpwd *item) +{ + mosquitto__free(item->username); + mosquitto__free(item->password); + mosquitto__free(item->salt); + HASH_DEL(*unpwd, item); + mosquitto__free(item); +} + + +static int unpwd__decode_passwords(struct mosquitto__unpwd **unpwd) +{ + struct mosquitto__unpwd *u, *tmp; + char *token; + unsigned char *salt; + unsigned int salt_len; + unsigned char *password; + unsigned int password_len; + int rc; + + HASH_ITER(hh, *unpwd, u, tmp){ + /* Need to decode password into hashed data + salt. */ + if(u->password){ + token = strtok(u->password, "$"); + if(token && !strcmp(token, "6")){ + token = strtok(NULL, "$"); + if(token){ + rc = base64__decode(token, &salt, &salt_len); + if(rc == MOSQ_ERR_SUCCESS && salt_len == 12){ + u->salt = salt; + u->salt_len = salt_len; + token = strtok(NULL, "$"); + if(token){ + rc = base64__decode(token, &password, &password_len); + if(rc == MOSQ_ERR_SUCCESS && password_len == 64){ + mosquitto__free(u->password); + u->password = (char *)password; + u->password_len = password_len; + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to decode password for user %s, removing entry.", u->username); + unpwd__free_item(unpwd, u); + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid password hash for user %s, removing entry.", u->username); + unpwd__free_item(unpwd, u); + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to decode password salt for user %s, removing entry.", u->username); + unpwd__free_item(unpwd, u); + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid password hash for user %s, removing entry.", u->username); + unpwd__free_item(unpwd, u); + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid password hash for user %s, removing entry.", u->username); + unpwd__free_item(unpwd, u); + } + }else{ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Missing password hash for user %s, removing entry.", u->username); + unpwd__free_item(unpwd, u); + } + } + + return MOSQ_ERR_SUCCESS; +} +#endif + + +static int unpwd__file_parse(struct mosquitto__unpwd **unpwd, const char *password_file) +{ + int rc; + if(!unpwd) return MOSQ_ERR_INVAL; + + if(!password_file) return MOSQ_ERR_SUCCESS; + + rc = pwfile__parse(password_file, unpwd); + +#ifdef WITH_TLS + if(rc) return rc; + rc = unpwd__decode_passwords(unpwd); +#endif + + return rc; +} + +static int psk__file_parse(struct mosquitto_db *db, struct mosquitto__unpwd **psk_id, const char *psk_file) +{ + int rc; + struct mosquitto__unpwd *u, *tmp; + + if(!db || !db->config || !psk_id) return MOSQ_ERR_INVAL; + + /* We haven't been asked to parse a psk file. */ + if(!psk_file) return MOSQ_ERR_SUCCESS; + + rc = pwfile__parse(psk_file, psk_id); + if(rc) return rc; + + HASH_ITER(hh, (*psk_id), u, tmp){ + /* Check for hex only digits */ + if(!u->password){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty psk for identity \"%s\".", u->username); + return MOSQ_ERR_INVAL; + } + if(strspn(u->password, "0123456789abcdefABCDEF") < strlen(u->password)){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: psk for identity \"%s\" contains non-hexadecimal characters.", u->username); + return MOSQ_ERR_INVAL; + } + } + return MOSQ_ERR_SUCCESS; +} + + +#ifdef WITH_TLS +static int mosquitto__memcmp_const(const void *a, const void *b, size_t len) +{ + size_t i; + int rc = 0; + + if(!a || !b) return 1; + + for(i=0; i<len; i++){ + if( ((char *)a)[i] != ((char *)b)[i] ){ + rc = 1; + } + } + return rc; +} +#endif + + +int mosquitto_unpwd_check_default(struct mosquitto_db *db, struct mosquitto *context, const char *username, const char *password) +{ + struct mosquitto__unpwd *u, *tmp; + struct mosquitto__unpwd *unpwd_ref; +#ifdef WITH_TLS + unsigned char hash[EVP_MAX_MD_SIZE]; + unsigned int hash_len; + int rc; +#endif + + if(!db) return MOSQ_ERR_INVAL; + + if(db->config->per_listener_settings){ + if(context->bridge) return MOSQ_ERR_SUCCESS; + if(!context->listener) return MOSQ_ERR_INVAL; + if(!context->listener->unpwd) return MOSQ_ERR_PLUGIN_DEFER; + unpwd_ref = context->listener->unpwd; + }else{ + if(!db->unpwd) return MOSQ_ERR_PLUGIN_DEFER; + unpwd_ref = db->unpwd; + } + if(!username){ + /* Check must be made only after checking unpwd_ref. + * This is DENY here, because in MQTT v5 username can be missing when + * password is present, but we don't support that. */ + return MOSQ_ERR_AUTH; + } + + HASH_ITER(hh, unpwd_ref, u, tmp){ + if(!strcmp(u->username, username)){ + if(u->password){ + if(password){ +#ifdef WITH_TLS + rc = pw__digest(password, u->salt, u->salt_len, hash, &hash_len); + if(rc == MOSQ_ERR_SUCCESS){ + if(hash_len == u->password_len && !mosquitto__memcmp_const(u->password, hash, hash_len)){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_AUTH; + } + }else{ + return rc; + } +#else + if(!strcmp(u->password, password)){ + return MOSQ_ERR_SUCCESS; + } +#endif + }else{ + return MOSQ_ERR_AUTH; + } + }else{ + return MOSQ_ERR_SUCCESS; + } + } + } + + return MOSQ_ERR_AUTH; +} + +static int unpwd__cleanup(struct mosquitto__unpwd **root, bool reload) +{ + struct mosquitto__unpwd *u, *tmp; + + UNUSED(reload); + + if(!root) return MOSQ_ERR_INVAL; + + HASH_ITER(hh, *root, u, tmp){ + HASH_DEL(*root, u); + mosquitto__free(u->password); + mosquitto__free(u->username); +#ifdef WITH_TLS + mosquitto__free(u->salt); +#endif + mosquitto__free(u); + } + + *root = NULL; + + return MOSQ_ERR_SUCCESS; +} + +/* Apply security settings after a reload. + * Includes: + * - Disconnecting anonymous users if appropriate + * - Disconnecting users with invalid passwords + * - Reapplying ACLs + */ +int mosquitto_security_apply_default(struct mosquitto_db *db) +{ + struct mosquitto *context, *ctxt_tmp; + struct mosquitto__acl_user *acl_user_tail; + bool allow_anonymous; + struct mosquitto__security_options *security_opts = NULL; + + if(!db) return MOSQ_ERR_INVAL; + + + HASH_ITER(hh_id, db->contexts_by_id, context, ctxt_tmp){ + /* Check for anonymous clients when allow_anonymous is false */ + if(db->config->per_listener_settings){ + if(context->listener){ + allow_anonymous = context->listener->security_options.allow_anonymous; + }else{ + /* Client not currently connected, so defer judgement until it does connect */ + allow_anonymous = true; + } + }else{ + allow_anonymous = db->config->security_options.allow_anonymous; + } + + if(!allow_anonymous && !context->username){ + context__set_state(context, mosq_cs_disconnecting); + do_disconnect(db, context, MOSQ_ERR_AUTH); + continue; + } + /* Check for connected clients that are no longer authorised */ + if(mosquitto_unpwd_check(db, context, context->username, context->password) != MOSQ_ERR_SUCCESS){ + context__set_state(context, mosq_cs_disconnecting); + do_disconnect(db, context, MOSQ_ERR_AUTH); + continue; + } + /* Check for ACLs and apply to user. */ + if(db->config->per_listener_settings){ + if(context->listener){ + security_opts = &context->listener->security_options; + }else{ + if(context->state != mosq_cs_connected){ + context__set_state(context, mosq_cs_disconnecting); + do_disconnect(db, context, MOSQ_ERR_AUTH); + continue; + } + } + }else{ + security_opts = &db->config->security_options; + } + + if(security_opts && security_opts->acl_list){ + acl_user_tail = security_opts->acl_list; + while(acl_user_tail){ + if(acl_user_tail->username){ + if(context->username){ + if(!strcmp(acl_user_tail->username, context->username)){ + context->acl_list = acl_user_tail; + break; + } + } + }else{ + if(!context->username){ + context->acl_list = acl_user_tail; + break; + } + } + acl_user_tail = acl_user_tail->next; + } + } + } + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_psk_key_get_default(struct mosquitto_db *db, struct mosquitto *context, const char *hint, const char *identity, char *key, int max_key_len) +{ + struct mosquitto__unpwd *u, *tmp; + struct mosquitto__unpwd *psk_id_ref = NULL; + + if(!db || !hint || !identity || !key) return MOSQ_ERR_INVAL; + + if(db->config->per_listener_settings){ + if(!context->listener) return MOSQ_ERR_INVAL; + if(!context->listener->psk_id) return MOSQ_ERR_PLUGIN_DEFER; + psk_id_ref = context->listener->psk_id; + }else{ + if(!db->psk_id) return MOSQ_ERR_PLUGIN_DEFER; + psk_id_ref = db->psk_id; + } + if(!psk_id_ref) return MOSQ_ERR_PLUGIN_DEFER; + + HASH_ITER(hh, psk_id_ref, u, tmp){ + if(!strcmp(u->username, identity)){ + strncpy(key, u->password, max_key_len); + return MOSQ_ERR_SUCCESS; + } + } + + return MOSQ_ERR_AUTH; +} + +#ifdef WITH_TLS +int pw__digest(const char *password, const unsigned char *salt, unsigned int salt_len, unsigned char *hash, unsigned int *hash_len) +{ + const EVP_MD *digest; +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_MD_CTX context; + + digest = EVP_get_digestbyname("sha512"); + if(!digest){ + // FIXME fprintf(stderr, "Error: Unable to create openssl digest.\n"); + return 1; + } + + EVP_MD_CTX_init(&context); + EVP_DigestInit_ex(&context, digest, NULL); + EVP_DigestUpdate(&context, password, strlen(password)); + EVP_DigestUpdate(&context, salt, salt_len); + /* hash is assumed to be EVP_MAX_MD_SIZE bytes long. */ + EVP_DigestFinal_ex(&context, hash, hash_len); + EVP_MD_CTX_cleanup(&context); +#else + EVP_MD_CTX *context; + + digest = EVP_get_digestbyname("sha512"); + if(!digest){ + // FIXME fprintf(stderr, "Error: Unable to create openssl digest.\n"); + return 1; + } + + context = EVP_MD_CTX_new(); + EVP_DigestInit_ex(context, digest, NULL); + EVP_DigestUpdate(context, password, strlen(password)); + EVP_DigestUpdate(context, salt, salt_len); + /* hash is assumed to be EVP_MAX_MD_SIZE bytes long. */ + EVP_DigestFinal_ex(context, hash, hash_len); + EVP_MD_CTX_free(context); +#endif + + return MOSQ_ERR_SUCCESS; +} + +int base64__decode(char *in, unsigned char **decoded, unsigned int *decoded_len) +{ + BIO *bmem, *b64; + int slen; + + slen = strlen(in); + + b64 = BIO_new(BIO_f_base64()); + if(!b64){ + return 1; + } + BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL); + + bmem = BIO_new(BIO_s_mem()); + if(!bmem){ + BIO_free_all(b64); + return 1; + } + b64 = BIO_push(b64, bmem); + BIO_write(bmem, in, slen); + + if(BIO_flush(bmem) != 1){ + BIO_free_all(b64); + return 1; + } + *decoded = mosquitto__calloc(slen, 1); + if(!(*decoded)){ + BIO_free_all(b64); + return 1; + } + *decoded_len = BIO_read(b64, *decoded, slen); + BIO_free_all(b64); + + if(*decoded_len <= 0){ + mosquitto__free(*decoded); + *decoded = NULL; + *decoded_len = 0; + return 1; + } + + return 0; +} + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/send_auth.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/send_auth.c new file mode 100644 index 0000000..8da559c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/send_auth.c @@ -0,0 +1,83 @@ +/* +Copyright (c) 2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include "mosquitto_broker_internal.h" +#include "mqtt_protocol.h" +#include "memory_mosq.h" +#include "packet_mosq.h" +#include "property_mosq.h" +#include "util_mosq.h" + +int send__auth(struct mosquitto_db *db, struct mosquitto *context, int reason_code, const void *auth_data, uint16_t auth_data_len) +{ + struct mosquitto__packet *packet = NULL; + int rc; + mosquitto_property *properties = NULL; + int proplen, varbytes; + uint32_t remaining_length; + + if(context->auth_method == NULL) return MOSQ_ERR_INVAL; + if(context->protocol != mosq_p_mqtt5) return MOSQ_ERR_PROTOCOL; + + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending AUTH to %s (rc%d, %s)", context->id, reason_code, context->auth_method); + + remaining_length = 1; + + rc = mosquitto_property_add_string(&properties, MQTT_PROP_AUTHENTICATION_METHOD, context->auth_method); + if(rc){ + mosquitto_property_free_all(&properties); + return rc; + } + + if(auth_data != NULL && auth_data_len > 0){ + rc = mosquitto_property_add_binary(&properties, MQTT_PROP_AUTHENTICATION_DATA, auth_data, auth_data_len); + if(rc){ + mosquitto_property_free_all(&properties); + return rc; + } + } + + proplen = property__get_length_all(properties); + varbytes = packet__varint_bytes(proplen); + remaining_length += proplen + varbytes; + + if(packet__check_oversize(context, remaining_length)){ + mosquitto_property_free_all(&properties); + mosquitto__free(packet); + return MOSQ_ERR_OVERSIZE_PACKET; + } + + packet = mosquitto__calloc(1, sizeof(struct mosquitto__packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + packet->command = CMD_AUTH; + packet->remaining_length = remaining_length; + + rc = packet__alloc(packet); + if(rc){ + mosquitto_property_free_all(&properties); + mosquitto__free(packet); + return rc; + } + packet__write_byte(packet, reason_code); + property__write_all(packet, properties, true); + mosquitto_property_free_all(&properties); + + return packet__queue(context, packet); +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/send_connack.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/send_connack.c new file mode 100644 index 0000000..2a67d9e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/send_connack.c @@ -0,0 +1,95 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include "mosquitto_broker_internal.h" +#include "mqtt_protocol.h" +#include "memory_mosq.h" +#include "packet_mosq.h" +#include "property_mosq.h" +#include "util_mosq.h" + +int send__connack(struct mosquitto_db *db, struct mosquitto *context, int ack, int reason_code, const mosquitto_property *properties) +{ + struct mosquitto__packet *packet = NULL; + int rc; + mosquitto_property *connack_props = NULL; + int proplen, varbytes; + uint32_t remaining_length; + + rc = mosquitto_property_copy_all(&connack_props, properties); + if(rc){ + return rc; + } + + if(context->id){ + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending CONNACK to %s (%d, %d)", context->id, ack, reason_code); + }else{ + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending CONNACK to %s (%d, %d)", context->address, ack, reason_code); + } + + remaining_length = 2; + + if(context->protocol == mosq_p_mqtt5){ + if(reason_code < 128 && db->config->retain_available == false){ + rc = mosquitto_property_add_byte(&connack_props, MQTT_PROP_RETAIN_AVAILABLE, 0); + if(rc){ + mosquitto_property_free_all(&connack_props); + return rc; + } + } + if(db->config->max_packet_size > 0){ + rc = mosquitto_property_add_int32(&connack_props, MQTT_PROP_MAXIMUM_PACKET_SIZE, db->config->max_packet_size); + if(rc){ + mosquitto_property_free_all(&connack_props); + return rc; + } + } + + proplen = property__get_length_all(connack_props); + varbytes = packet__varint_bytes(proplen); + remaining_length += proplen + varbytes; + } + + if(packet__check_oversize(context, remaining_length)){ + mosquitto_property_free_all(&connack_props); + mosquitto__free(packet); + return MOSQ_ERR_OVERSIZE_PACKET; + } + + packet = mosquitto__calloc(1, sizeof(struct mosquitto__packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + packet->command = CMD_CONNACK; + packet->remaining_length = remaining_length; + + rc = packet__alloc(packet); + if(rc){ + mosquitto_property_free_all(&connack_props); + mosquitto__free(packet); + return rc; + } + packet__write_byte(packet, ack); + packet__write_byte(packet, reason_code); + if(context->protocol == mosq_p_mqtt5){ + property__write_all(packet, connack_props, true); + } + mosquitto_property_free_all(&connack_props); + + return packet__queue(context, packet); +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/send_suback.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/send_suback.c new file mode 100644 index 0000000..b9eeae6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/send_suback.c @@ -0,0 +1,63 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include "mosquitto_broker_internal.h" +#include "mqtt_protocol.h" +#include "memory_mosq.h" +#include "packet_mosq.h" +#include "property_mosq.h" +#include "util_mosq.h" + + +int send__suback(struct mosquitto *context, uint16_t mid, uint32_t payloadlen, const void *payload) +{ + struct mosquitto__packet *packet = NULL; + int rc; + mosquitto_property *properties = NULL; + int proplen, varbytes; + + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending SUBACK to %s", context->id); + + packet = mosquitto__calloc(1, sizeof(struct mosquitto__packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + packet->command = CMD_SUBACK; + packet->remaining_length = 2+payloadlen; + if(context->protocol == mosq_p_mqtt5){ + proplen = property__get_length_all(properties); + varbytes = packet__varint_bytes(proplen); + packet->remaining_length += proplen + varbytes; + } + rc = packet__alloc(packet); + if(rc){ + mosquitto__free(packet); + return rc; + } + packet__write_uint16(packet, mid); + + if(context->protocol == mosq_p_mqtt5){ + /* We don't use Reason String or User Property yet. */ + property__write_all(packet, properties, true); + } + + if(payloadlen){ + packet__write_bytes(packet, payload, payloadlen); + } + + return packet__queue(context, packet); +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/send_unsuback.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/send_unsuback.c new file mode 100644 index 0000000..9a310fa --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/send_unsuback.c @@ -0,0 +1,61 @@ +/* +Copyright (c) 2009-2018 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <assert.h> + +#include "mosquitto_broker_internal.h" +#include "mqtt_protocol.h" +#include "memory_mosq.h" +#include "packet_mosq.h" +#include "property_mosq.h" + + +int send__unsuback(struct mosquitto *mosq, uint16_t mid, int reason_code_count, uint8_t *reason_codes, const mosquitto_property *properties) +{ + struct mosquitto__packet *packet = NULL; + int rc; + int proplen, varbytes; + + assert(mosq); + packet = mosquitto__calloc(1, sizeof(struct mosquitto__packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + packet->command = CMD_UNSUBACK; + packet->remaining_length = 2; + + if(mosq->protocol == mosq_p_mqtt5){ + proplen = property__get_length_all(properties); + varbytes = packet__varint_bytes(proplen); + packet->remaining_length += varbytes + proplen + reason_code_count; + } + + rc = packet__alloc(packet); + if(rc){ + mosquitto__free(packet); + return rc; + } + + packet__write_uint16(packet, mid); + + if(mosq->protocol == mosq_p_mqtt5){ + property__write_all(packet, properties, true); + packet__write_bytes(packet, reason_codes, reason_code_count); + } + + return packet__queue(mosq, packet); +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/service.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/service.c new file mode 100644 index 0000000..ff6cf2f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/service.c @@ -0,0 +1,170 @@ +/* +Copyright (c) 2011-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#if defined(WIN32) || defined(__CYGWIN__) + +#include "config.h" + +#include <windows.h> + +#include "memory_mosq.h" + +extern int run; +SERVICE_STATUS_HANDLE service_handle = 0; +static SERVICE_STATUS service_status; +int main(int argc, char *argv[]); + +static void print_error(void) +{ + char *buf; + + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, GetLastError(), LANG_NEUTRAL, &buf, 0, NULL); + + fprintf(stderr, "Error: %s\n", buf); + LocalFree(buf); +} + + +/* Service control callback */ +void __stdcall service_handler(DWORD fdwControl) +{ + switch(fdwControl){ + case SERVICE_CONTROL_CONTINUE: + /* Continue from Paused state. */ + break; + case SERVICE_CONTROL_PAUSE: + /* Pause service. */ + break; + case SERVICE_CONTROL_SHUTDOWN: + /* System is shutting down. */ + case SERVICE_CONTROL_STOP: + /* Service should stop. */ + service_status.dwCurrentState = SERVICE_STOP_PENDING; + SetServiceStatus(service_handle, &service_status); + run = 0; + break; + } +} + +/* Function called when started as a service. */ +void __stdcall service_main(DWORD dwArgc, LPTSTR *lpszArgv) +{ + char **argv; + int argc = 1; + char conf_path[MAX_PATH + 20]; + int rc; + + service_handle = RegisterServiceCtrlHandler("mosquitto", service_handler); + if(service_handle){ + memset(conf_path, 0, MAX_PATH + 20); + rc = GetEnvironmentVariable("MOSQUITTO_DIR", conf_path, MAX_PATH); + if(!rc || rc == MAX_PATH){ + service_status.dwCurrentState = SERVICE_STOPPED; + SetServiceStatus(service_handle, &service_status); + return; + } + strcat(conf_path, "/mosquitto.conf"); + + argv = mosquitto__malloc(sizeof(char *)*3); + argv[0] = "mosquitto"; + argv[1] = "-c"; + argv[2] = conf_path; + argc = 3; + + service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; + service_status.dwCurrentState = SERVICE_RUNNING; + service_status.dwControlsAccepted = SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_STOP; + service_status.dwWin32ExitCode = NO_ERROR; + service_status.dwCheckPoint = 0; + SetServiceStatus(service_handle, &service_status); + + main(argc, argv); + mosquitto__free(argv); + + service_status.dwCurrentState = SERVICE_STOPPED; + SetServiceStatus(service_handle, &service_status); + } +} + +void service_install(void) +{ + SC_HANDLE sc_manager, svc_handle; + char exe_path[MAX_PATH + 5]; + SERVICE_DESCRIPTION svc_desc; + + memset(exe_path, 0, MAX_PATH+5); + if(GetModuleFileName(NULL, exe_path, MAX_PATH) == MAX_PATH){ + fprintf(stderr, "Error: Path too long.\n"); + return; + } + strcat(exe_path, " run"); + + sc_manager = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE); + if(sc_manager){ + svc_handle = CreateService(sc_manager, "mosquitto", "Mosquitto Broker", + SERVICE_START | SERVICE_STOP | SERVICE_CHANGE_CONFIG, + SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, + exe_path, NULL, NULL, NULL, NULL, NULL); + + if(svc_handle){ + svc_desc.lpDescription = "MQTT v3.1.1 broker"; + ChangeServiceConfig2(svc_handle, SERVICE_CONFIG_DESCRIPTION, &svc_desc); + CloseServiceHandle(svc_handle); + }else{ + print_error(); + } + CloseServiceHandle(sc_manager); + } else { + print_error(); + } +} + +void service_uninstall(void) +{ + SC_HANDLE sc_manager, svc_handle; + SERVICE_STATUS status; + + sc_manager = OpenSCManager(NULL, SERVICES_ACTIVE_DATABASE, SC_MANAGER_CONNECT); + if(sc_manager){ + svc_handle = OpenService(sc_manager, "mosquitto", SERVICE_QUERY_STATUS | DELETE); + if(svc_handle){ + if(QueryServiceStatus(svc_handle, &status)){ + if(status.dwCurrentState == SERVICE_STOPPED){ + DeleteService(svc_handle); + } + } + CloseServiceHandle(svc_handle); + }else{ + print_error(); + } + CloseServiceHandle(sc_manager); + }else{ + print_error(); + } +} + +void service_run(void) +{ + SERVICE_TABLE_ENTRY ste[] = { + { "mosquitto", service_main }, + { NULL, NULL } + }; + + StartServiceCtrlDispatcher(ste); +} + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/session_expiry.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/session_expiry.c new file mode 100644 index 0000000..057e032 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/session_expiry.c @@ -0,0 +1,110 @@ +/* +Copyright (c) 2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <math.h> +#include <stdio.h> +#include <utlist.h> + +#include "mosquitto_broker_internal.h" +#include "memory_mosq.h" +#include "time_mosq.h" + +static struct session_expiry_list *expiry_list = NULL; +static time_t last_check = 0; + + +static int session_expiry__cmp(struct session_expiry_list *i1, struct session_expiry_list *i2) +{ + return i1->context->session_expiry_interval - i2->context->session_expiry_interval; +} + + +int session_expiry__add(struct mosquitto_db *db, struct mosquitto *context) +{ + struct session_expiry_list *item; + + item = mosquitto__calloc(1, sizeof(struct session_expiry_list)); + if(!item) return MOSQ_ERR_NOMEM; + + item->context = context; + item->context->session_expiry_time = time(NULL); + if(db->config->persistent_client_expiration == 0 || + db->config->persistent_client_expiration < item->context->session_expiry_interval){ + + item->context->session_expiry_time += item->context->session_expiry_interval; + }else{ + item->context->session_expiry_time += db->config->persistent_client_expiration; + } + context->expiry_list_item = item; + + DL_INSERT_INORDER(expiry_list, item, session_expiry__cmp); + + return MOSQ_ERR_SUCCESS; +} + + +void session_expiry__remove(struct mosquitto *context) +{ + if(context->expiry_list_item){ + DL_DELETE(expiry_list, context->expiry_list_item); + mosquitto__free(context->expiry_list_item); + context->expiry_list_item = NULL; + } +} + + +/* Call on broker shutdown only */ +void session_expiry__remove_all(struct mosquitto_db *db) +{ + struct session_expiry_list *item, *tmp; + struct mosquitto *context; + + DL_FOREACH_SAFE(expiry_list, item, tmp){ + context = item->context; + session_expiry__remove(context); + context->session_expiry_interval = 0; + context->will_delay_interval = 0; + context__disconnect(db, context); + } + +} + +void session_expiry__check(struct mosquitto_db *db, time_t now) +{ + struct session_expiry_list *item, *tmp; + struct mosquitto *context; + + if(now <= last_check) return; + + last_check = now; + + DL_FOREACH_SAFE(expiry_list, item, tmp){ + if(item->context->session_expiry_time < now){ + context = item->context; + session_expiry__remove(context); + + context->session_expiry_interval = 0; + context__send_will(db, context); + context__add_to_disused(db, context); + }else{ + return; + } + } + +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/signals.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/signals.c new file mode 100644 index 0000000..38ff68d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/signals.c @@ -0,0 +1,147 @@ +/* +Copyright (c) 2016-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. + Dmitry Kaukov - windows named events implementation. +*/ + +#include "config.h" + +#ifndef WIN32 +# include <unistd.h> +# include <grp.h> +# include <assert.h> +#endif + +#ifndef WIN32 +#include <pwd.h> +#else +#include <process.h> +#include <winsock2.h> +#include <ws2tcpip.h> +#endif + +#ifndef WIN32 +# include <sys/time.h> +#endif + +#include <errno.h> +#include <signal.h> +#include <stdio.h> +#include <string.h> +#ifdef WITH_SYSTEMD +# include <systemd/sd-daemon.h> +#endif +#ifdef WITH_WRAP +#include <tcpd.h> +#endif +#ifdef WITH_WEBSOCKETS +# include <libwebsockets.h> +#endif + +#include "mosquitto_broker_internal.h" +#include "memory_mosq.h" +#include "util_mosq.h" + +extern bool flag_reload; +#ifdef WITH_PERSISTENCE +extern bool flag_db_backup; +#endif +extern bool flag_tree_print; +extern int run; + +#ifdef SIGHUP +/* Signal handler for SIGHUP - flag a config reload. */ +void handle_sighup(int signal) +{ + UNUSED(signal); + + flag_reload = true; +} +#endif + +/* Signal handler for SIGINT and SIGTERM - just stop gracefully. */ +void handle_sigint(int signal) +{ + UNUSED(signal); + + run = 0; +} + +/* Signal handler for SIGUSR1 - backup the db. */ +void handle_sigusr1(int signal) +{ + UNUSED(signal); + +#ifdef WITH_PERSISTENCE + flag_db_backup = true; +#endif +} + +/* Signal handler for SIGUSR2 - print subscription / retained tree. */ +void handle_sigusr2(int signal) +{ + UNUSED(signal); + + flag_tree_print = true; +} + +/* + * + * Signalling mosquitto process on Win32. + * + * On Windows we we can use named events to pass signals to the mosquitto process. + * List of events : + * + * mosqPID_shutdown + * mosqPID_reload + * mosqPID_backup + * + * (where PID is the PID of the mosquitto process). + */ +#ifdef WIN32 +DWORD WINAPI SigThreadProc(void* data) +{ + TCHAR evt_name[MAX_PATH]; + static HANDLE evt[3]; + int pid = GetCurrentProcessId(); + + sprintf_s(evt_name, MAX_PATH, "mosq%d_shutdown", pid); + evt[0] = CreateEvent(NULL, TRUE, FALSE, evt_name); + sprintf_s(evt_name, MAX_PATH, "mosq%d_reload", pid); + evt[1] = CreateEvent(NULL, FALSE, FALSE, evt_name); + sprintf_s(evt_name, MAX_PATH, "mosq%d_backup", pid); + evt[2] = CreateEvent(NULL, FALSE, FALSE, evt_name); + + while (true) { + int wr = WaitForMultipleObjects(sizeof(evt) / sizeof(HANDLE), evt, FALSE, INFINITE); + switch (wr) { + case WAIT_OBJECT_0 + 0: + handle_sigint(SIGINT); + break; + case WAIT_OBJECT_0 + 1: + flag_reload = true; + continue; + case WAIT_OBJECT_0 + 2: + handle_sigusr1(0); + continue; + break; + } + } + CloseHandle(evt[0]); + CloseHandle(evt[1]); + CloseHandle(evt[2]); + return 0; +} +#endif + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/subs.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/subs.c new file mode 100644 index 0000000..aae3266 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/subs.c @@ -0,0 +1,1125 @@ +/* +Copyright (c) 2010-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +/* A note on matching topic subscriptions. + * + * Topics can be up to 32767 characters in length. The / character is used as a + * hierarchy delimiter. Messages are published to a particular topic. + * Clients may subscribe to particular topics directly, but may also use + * wildcards in subscriptions. The + and # characters are used as wildcards. + * The # wildcard can be used at the end of a subscription only, and is a + * wildcard for the level of hierarchy at which it is placed and all subsequent + * levels. + * The + wildcard may be used at any point within the subscription and is a + * wildcard for only the level of hierarchy at which it is placed. + * Neither wildcard may be used as part of a substring. + * Valid: + * a/b/+ + * a/+/c + * a/# + * a/b/# + * # + * +/b/c + * +/+/+ + * Invalid: + * a/#/c + * a+/b/c + * Valid but non-matching: + * a/b + * a/+ + * +/b + * b/c/a + * a/b/d + */ + +#include "config.h" + +#include <assert.h> +#include <stdio.h> +#include <string.h> + +#include "mosquitto_broker_internal.h" +#include "memory_mosq.h" +#include "mqtt_protocol.h" +#include "util_mosq.h" + +#include "utlist.h" + +struct sub__token { + struct sub__token *next; + char *topic; + uint16_t topic_len; +}; + + +static int subs__send(struct mosquitto_db *db, struct mosquitto__subleaf *leaf, const char *topic, int qos, int retain, struct mosquitto_msg_store *stored) +{ + bool client_retain; + uint16_t mid; + int client_qos, msg_qos; + mosquitto_property *properties = NULL; + int rc2; + + /* Check for ACL topic access. */ + rc2 = mosquitto_acl_check(db, leaf->context, topic, stored->payloadlen, UHPA_ACCESS(stored->payload, stored->payloadlen), stored->qos, stored->retain, MOSQ_ACL_READ); + if(rc2 == MOSQ_ERR_ACL_DENIED){ + return MOSQ_ERR_SUCCESS; + }else if(rc2 == MOSQ_ERR_SUCCESS){ + client_qos = leaf->qos; + + if(db->config->upgrade_outgoing_qos){ + msg_qos = client_qos; + }else{ + if(qos > client_qos){ + msg_qos = client_qos; + }else{ + msg_qos = qos; + } + } + if(msg_qos){ + mid = mosquitto__mid_generate(leaf->context); + }else{ + mid = 0; + } + if(leaf->retain_as_published){ + client_retain = retain; + }else{ + client_retain = false; + } + if(leaf->identifier){ + mosquitto_property_add_varint(&properties, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, leaf->identifier); + } + if(db__message_insert(db, leaf->context, mid, mosq_md_out, msg_qos, client_retain, stored, properties) == 1){ + return 1; + } + }else{ + return 1; /* Application error */ + } + return 0; +} + + +static int subs__shared_process(struct mosquitto_db *db, struct mosquitto__subhier *hier, const char *topic, int qos, int retain, struct mosquitto_msg_store *stored) +{ + int rc = 0, rc2; + struct mosquitto__subshared *shared, *shared_tmp; + struct mosquitto__subleaf *leaf; + + HASH_ITER(hh, hier->shared, shared, shared_tmp){ + leaf = shared->subs; + rc2 = subs__send(db, leaf, topic, qos, retain, stored); + /* Remove current from the top, add back to the bottom */ + DL_DELETE(shared->subs, leaf); + DL_APPEND(shared->subs, leaf); + + if(rc2) rc = 1; + } + + return rc; +} + +static int subs__process(struct mosquitto_db *db, struct mosquitto__subhier *hier, const char *source_id, const char *topic, int qos, int retain, struct mosquitto_msg_store *stored, bool set_retain) +{ + int rc = 0; + int rc2; + struct mosquitto__subleaf *leaf; + + if(retain && set_retain){ +#ifdef WITH_PERSISTENCE + if(strncmp(topic, "$SYS", 4)){ + /* Retained messages count as a persistence change, but only if + * they aren't for $SYS. */ + db->persistence_changes++; + } +#endif + if(hier->retained){ + db__msg_store_ref_dec(db, &hier->retained); +#ifdef WITH_SYS_TREE + db->retained_count--; +#endif + } + if(stored->payloadlen){ + hier->retained = stored; + db__msg_store_ref_inc(hier->retained); +#ifdef WITH_SYS_TREE + db->retained_count++; +#endif + }else{ + hier->retained = NULL; + } + } + + rc = subs__shared_process(db, hier, topic, qos, retain, stored); + + leaf = hier->subs; + while(source_id && leaf){ + if(!leaf->context->id || (leaf->no_local && !strcmp(leaf->context->id, source_id))){ + leaf = leaf->next; + continue; + } + rc2 = subs__send(db, leaf, topic, qos, retain, stored); + if(rc2){ + rc = 1; + } + leaf = leaf->next; + } + if(hier->subs || hier->shared){ + return rc; + }else{ + return MOSQ_ERR_NO_SUBSCRIBERS; + } +} + +static struct sub__token *sub__topic_append(struct sub__token **tail, struct sub__token **topics, char *topic) +{ + struct sub__token *new_topic; + + if(!topic){ + return NULL; + } + new_topic = mosquitto__malloc(sizeof(struct sub__token)); + if(!new_topic){ + return NULL; + } + new_topic->next = NULL; + new_topic->topic_len = strlen(topic); + new_topic->topic = mosquitto__malloc(new_topic->topic_len+1); + if(!new_topic->topic){ + mosquitto__free(new_topic); + return NULL; + } + strncpy(new_topic->topic, topic, new_topic->topic_len+1); + + if(*tail){ + (*tail)->next = new_topic; + *tail = (*tail)->next; + }else{ + *topics = new_topic; + *tail = new_topic; + } + return new_topic; +} + +static int sub__topic_tokenise(const char *subtopic, struct sub__token **topics) +{ + struct sub__token *new_topic, *tail = NULL; + int len; + int start, stop, tlen; + int i; + char *topic; + + assert(subtopic); + assert(topics); + + if(subtopic[0] != '$'){ + new_topic = sub__topic_append(&tail, topics, ""); + if(!new_topic) goto cleanup; + } + + len = strlen(subtopic); + + if(subtopic[0] == '/'){ + new_topic = sub__topic_append(&tail, topics, ""); + if(!new_topic) goto cleanup; + + start = 1; + }else{ + start = 0; + } + + stop = 0; + for(i=start; i<len+1; i++){ + if(subtopic[i] == '/' || subtopic[i] == '\0'){ + stop = i; + + if(start != stop){ + tlen = stop-start; + + topic = mosquitto__malloc(tlen+1); + if(!topic) goto cleanup; + memcpy(topic, &subtopic[start], tlen); + topic[tlen] = '\0'; + new_topic = sub__topic_append(&tail, topics, topic); + mosquitto__free(topic); + }else{ + new_topic = sub__topic_append(&tail, topics, ""); + } + if(!new_topic) goto cleanup; + start = i+1; + } + } + + return MOSQ_ERR_SUCCESS; + +cleanup: + tail = *topics; + *topics = NULL; + while(tail){ + mosquitto__free(tail->topic); + new_topic = tail->next; + mosquitto__free(tail); + tail = new_topic; + } + return 1; +} + +static void sub__topic_tokens_free(struct sub__token *tokens) +{ + struct sub__token *tail; + + while(tokens){ + tail = tokens->next; + mosquitto__free(tokens->topic); + mosquitto__free(tokens); + tokens = tail; + } +} + + +static int sub__add_leaf(struct mosquitto *context, int qos, uint32_t identifier, int options, struct mosquitto__subleaf **head, struct mosquitto__subleaf **newleaf) +{ + struct mosquitto__subleaf *leaf; + + *newleaf = NULL; + leaf = *head; + + while(leaf){ + if(leaf->context && leaf->context->id && !strcmp(leaf->context->id, context->id)){ + /* Client making a second subscription to same topic. Only + * need to update QoS. Return MOSQ_ERR_SUB_EXISTS to + * indicate this to the calling function. */ + leaf->qos = qos; + leaf->identifier = identifier; + return MOSQ_ERR_SUB_EXISTS; + } + leaf = leaf->next; + } + leaf = mosquitto__calloc(1, sizeof(struct mosquitto__subleaf)); + if(!leaf) return MOSQ_ERR_NOMEM; + leaf->context = context; + leaf->qos = qos; + leaf->identifier = identifier; + leaf->no_local = ((options & MQTT_SUB_OPT_NO_LOCAL) != 0); + leaf->retain_as_published = ((options & MQTT_SUB_OPT_RETAIN_AS_PUBLISHED) != 0); + + DL_APPEND(*head, leaf); + *newleaf = leaf; + + return MOSQ_ERR_SUCCESS; +} + + +static void sub__remove_shared_leaf(struct mosquitto__subhier *subhier, struct mosquitto__subshared *shared, struct mosquitto__subleaf *leaf) +{ + DL_DELETE(shared->subs, leaf); + if(shared->subs == NULL){ + HASH_DELETE(hh, subhier->shared, shared); + mosquitto__free(shared->name); + mosquitto__free(shared); + } + mosquitto__free(leaf); +} + + +static int sub__add_shared(struct mosquitto_db *db, struct mosquitto *context, int qos, uint32_t identifier, int options, struct mosquitto__subhier *subhier, char *sharename) +{ + struct mosquitto__subleaf *newleaf; + struct mosquitto__subshared *shared = NULL; + struct mosquitto__subshared_ref **shared_subs; + struct mosquitto__subshared_ref *shared_ref; + int i; + unsigned int slen; + int rc; + + slen = strlen(sharename); + + HASH_FIND(hh, subhier->shared, sharename, slen, shared); + if(shared){ + mosquitto__free(sharename); + }else{ + shared = mosquitto__calloc(1, sizeof(struct mosquitto__subshared)); + if(!shared){ + mosquitto__free(sharename); + return MOSQ_ERR_NOMEM; + } + shared->name = sharename; + + HASH_ADD_KEYPTR(hh, subhier->shared, shared->name, slen, shared); + } + + rc = sub__add_leaf(context, qos, identifier, options, &shared->subs, &newleaf); + if(rc > 0){ + if(shared->subs == NULL){ + HASH_DELETE(hh, subhier->shared, shared); + mosquitto__free(shared->name); + mosquitto__free(shared); + } + return rc; + } + + if(rc != MOSQ_ERR_SUB_EXISTS){ + shared_ref = mosquitto__calloc(1, sizeof(struct mosquitto__subshared_ref)); + if(!shared_ref){ + sub__remove_shared_leaf(subhier, shared, newleaf); + return MOSQ_ERR_NOMEM; + } + shared_ref->hier = subhier; + shared_ref->shared = shared; + + for(i=0; i<context->shared_sub_count; i++){ + if(!context->shared_subs[i]){ + context->shared_subs[i] = shared_ref; + break; + } + } + if(i == context->shared_sub_count){ + shared_subs = mosquitto__realloc(context->shared_subs, sizeof(struct mosquitto__subhier_ref *)*(context->shared_sub_count + 1)); + if(!shared_subs){ + sub__remove_shared_leaf(subhier, shared, newleaf); + return MOSQ_ERR_NOMEM; + } + context->shared_subs = shared_subs; + context->shared_sub_count++; + context->shared_subs[context->shared_sub_count-1] = shared_ref; + } +#ifdef WITH_SYS_TREE + db->shared_subscription_count++; +#endif + } + + if(context->protocol == mosq_p_mqtt31 || context->protocol == mosq_p_mqtt5){ + return rc; + }else{ + /* mqttv311/mqttv5 requires retained messages are resent on + * resubscribe. */ + return MOSQ_ERR_SUCCESS; + } +} + + +static int sub__add_normal(struct mosquitto_db *db, struct mosquitto *context, int qos, uint32_t identifier, int options, struct mosquitto__subhier *subhier) +{ + struct mosquitto__subleaf *newleaf = NULL; + struct mosquitto__subhier **subs; + int i; + int rc; + + rc = sub__add_leaf(context, qos, identifier, options, &subhier->subs, &newleaf); + if(rc > 0){ + return rc; + } + + if(rc != MOSQ_ERR_SUB_EXISTS){ + for(i=0; i<context->sub_count; i++){ + if(!context->subs[i]){ + context->subs[i] = subhier; + break; + } + } + if(i == context->sub_count){ + subs = mosquitto__realloc(context->subs, sizeof(struct mosquitto__subhier *)*(context->sub_count + 1)); + if(!subs){ + DL_DELETE(subhier->subs, newleaf); + mosquitto__free(newleaf); + return MOSQ_ERR_NOMEM; + } + context->subs = subs; + context->sub_count++; + context->subs[context->sub_count-1] = subhier; + } +#ifdef WITH_SYS_TREE + db->subscription_count++; +#endif + } + + if(context->protocol == mosq_p_mqtt31 || context->protocol == mosq_p_mqtt5){ + return rc; + }else{ + /* mqttv311/mqttv5 requires retained messages are resent on + * resubscribe. */ + return MOSQ_ERR_SUCCESS; + } +} + + +static int sub__add_context(struct mosquitto_db *db, struct mosquitto *context, int qos, uint32_t identifier, int options, struct mosquitto__subhier *subhier, struct sub__token *tokens, char *sharename) +{ + struct mosquitto__subhier *branch; + + /* Find leaf node */ + while(tokens){ + HASH_FIND(hh, subhier->children, tokens->topic, tokens->topic_len, branch); + if(!branch){ + /* Not found */ + branch = sub__add_hier_entry(subhier, &subhier->children, tokens->topic, tokens->topic_len); + if(!branch) return MOSQ_ERR_NOMEM; + } + subhier = branch; + tokens = tokens ->next; + } + + /* Add add our context */ + if(context && context->id){ + if(sharename){ + return sub__add_shared(db, context, qos, identifier, options, subhier, sharename); + }else{ + return sub__add_normal(db, context, qos, identifier, options, subhier); + } + }else{ + return MOSQ_ERR_SUCCESS; + } +} + + +static int sub__remove_normal(struct mosquitto_db *db, struct mosquitto *context, struct mosquitto__subhier *subhier, uint8_t *reason) +{ + struct mosquitto__subleaf *leaf; + int i; + + leaf = subhier->subs; + while(leaf){ + if(leaf->context==context){ +#ifdef WITH_SYS_TREE + db->subscription_count--; +#endif + DL_DELETE(subhier->subs, leaf); + mosquitto__free(leaf); + + /* Remove the reference to the sub that the client is keeping. + * It would be nice to be able to use the reference directly, + * but that would involve keeping a copy of the topic string in + * each subleaf. Might be worth considering though. */ + for(i=0; i<context->sub_count; i++){ + if(context->subs[i] == subhier){ + context->subs[i] = NULL; + break; + } + } + *reason = 0; + return MOSQ_ERR_SUCCESS; + } + leaf = leaf->next; + } + return MOSQ_ERR_NO_SUBSCRIBERS; +} + + +static int sub__remove_shared(struct mosquitto_db *db, struct mosquitto *context, struct mosquitto__subhier *subhier, uint8_t *reason, char *sharename) +{ + struct mosquitto__subshared *shared; + struct mosquitto__subleaf *leaf; + int i; + + HASH_FIND(hh, subhier->shared, sharename, strlen(sharename), shared); + mosquitto__free(sharename); + if(shared){ + leaf = shared->subs; + while(leaf){ + if(leaf->context==context){ +#ifdef WITH_SYS_TREE + db->shared_subscription_count--; +#endif + DL_DELETE(shared->subs, leaf); + mosquitto__free(leaf); + + /* Remove the reference to the sub that the client is keeping. + * It would be nice to be able to use the reference directly, + * but that would involve keeping a copy of the topic string in + * each subleaf. Might be worth considering though. */ + for(i=0; i<context->shared_sub_count; i++){ + if(context->shared_subs[i] + && context->shared_subs[i]->hier == subhier + && context->shared_subs[i]->shared == shared){ + + mosquitto__free(context->shared_subs[i]); + context->shared_subs[i] = NULL; + break; + } + } + + if(shared->subs == NULL){ + HASH_DELETE(hh, subhier->shared, shared); + mosquitto__free(shared->name); + mosquitto__free(shared); + } + + *reason = 0; + return MOSQ_ERR_SUCCESS; + } + leaf = leaf->next; + } + return MOSQ_ERR_NO_SUBSCRIBERS; + }else{ + return MOSQ_ERR_NO_SUBSCRIBERS; + } +} + + +static int sub__remove_recurse(struct mosquitto_db *db, struct mosquitto *context, struct mosquitto__subhier *subhier, struct sub__token *tokens, uint8_t *reason, char *sharename) +{ + struct mosquitto__subhier *branch; + + if(!tokens){ + if(sharename){ + return sub__remove_shared(db, context, subhier, reason, sharename); + }else{ + return sub__remove_normal(db, context, subhier, reason); + } + } + + HASH_FIND(hh, subhier->children, tokens->topic, tokens->topic_len, branch); + if(branch){ + sub__remove_recurse(db, context, branch, tokens->next, reason, sharename); + if(!branch->children && !branch->subs && !branch->retained && !branch->shared){ + HASH_DELETE(hh, subhier->children, branch); + mosquitto__free(branch->topic); + mosquitto__free(branch); + } + } + return MOSQ_ERR_SUCCESS; +} + +static int sub__search(struct mosquitto_db *db, struct mosquitto__subhier *subhier, struct sub__token *tokens, const char *source_id, const char *topic, int qos, int retain, struct mosquitto_msg_store *stored, bool set_retain) +{ + /* FIXME - need to take into account source_id if the client is a bridge */ + struct mosquitto__subhier *branch; + int rc; + bool have_subscribers = false; + + if(tokens){ + /* Check for literal match */ + HASH_FIND(hh, subhier->children, tokens->topic, tokens->topic_len, branch); + + if(branch){ + rc = sub__search(db, branch, tokens->next, source_id, topic, qos, retain, stored, set_retain); + if(rc == MOSQ_ERR_SUCCESS){ + have_subscribers = true; + }else if(rc != MOSQ_ERR_NO_SUBSCRIBERS){ + return rc; + } + if(!tokens->next){ + rc = subs__process(db, branch, source_id, topic, qos, retain, stored, set_retain); + if(rc == MOSQ_ERR_SUCCESS){ + have_subscribers = true; + }else if(rc != MOSQ_ERR_NO_SUBSCRIBERS){ + return rc; + } + } + } + + /* Check for + match */ + HASH_FIND(hh, subhier->children, "+", 1, branch); + + if(branch){ + rc = sub__search(db, branch, tokens->next, source_id, topic, qos, retain, stored, false); + if(rc == MOSQ_ERR_SUCCESS){ + have_subscribers = true; + }else if(rc != MOSQ_ERR_NO_SUBSCRIBERS){ + return rc; + } + if(!tokens->next){ + rc = subs__process(db, branch, source_id, topic, qos, retain, stored, false); + if(rc == MOSQ_ERR_SUCCESS){ + have_subscribers = true; + }else if(rc != MOSQ_ERR_NO_SUBSCRIBERS){ + return rc; + } + } + } + } + + /* Check for # match */ + HASH_FIND(hh, subhier->children, "#", 1, branch); + if(branch && !branch->children){ + /* The topic matches due to a # wildcard - process the + * subscriptions but *don't* return. Although this branch has ended + * there may still be other subscriptions to deal with. + */ + rc = subs__process(db, branch, source_id, topic, qos, retain, stored, false); + if(rc == MOSQ_ERR_SUCCESS){ + have_subscribers = true; + }else if(rc != MOSQ_ERR_NO_SUBSCRIBERS){ + return rc; + } + } + + if(have_subscribers){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_NO_SUBSCRIBERS; + } +} + + +struct mosquitto__subhier *sub__add_hier_entry(struct mosquitto__subhier *parent, struct mosquitto__subhier **sibling, const char *topic, size_t len) +{ + struct mosquitto__subhier *child; + + assert(sibling); + + child = mosquitto__calloc(1, sizeof(struct mosquitto__subhier)); + if(!child){ + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return NULL; + } + child->parent = parent; + child->topic_len = len; + child->topic = malloc(len+1); + if(!child->topic){ + child->topic_len = 0; + mosquitto__free(child); + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return NULL; + }else{ + strncpy(child->topic, topic, child->topic_len+1); + } + + HASH_ADD_KEYPTR(hh, *sibling, child->topic, child->topic_len, child); + + return child; +} + + +int sub__add(struct mosquitto_db *db, struct mosquitto *context, const char *sub, int qos, uint32_t identifier, int options, struct mosquitto__subhier **root) +{ + int rc = 0; + struct mosquitto__subhier *subhier; + struct sub__token *tokens = NULL, *t; + char *sharename = NULL; + + assert(root); + assert(*root); + assert(sub); + + if(sub__topic_tokenise(sub, &tokens)) return 1; + + if(!strcmp(tokens->topic, "$share")){ + if(!tokens->next || !tokens->next->next){ + sub__topic_tokens_free(tokens); + return MOSQ_ERR_PROTOCOL; + } + t = tokens->next; + mosquitto__free(tokens->topic); + mosquitto__free(tokens); + tokens = t; + + sharename = tokens->topic; + + tokens->topic = mosquitto__strdup(""); + if(!tokens->topic){ + tokens->topic = sharename; + sub__topic_tokens_free(tokens); + return MOSQ_ERR_PROTOCOL; + } + tokens->topic_len = 0; + } + + HASH_FIND(hh, *root, tokens->topic, tokens->topic_len, subhier); + if(!subhier){ + subhier = sub__add_hier_entry(NULL, root, tokens->topic, tokens->topic_len); + if(!subhier){ + sub__topic_tokens_free(tokens); + log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + + } + rc = sub__add_context(db, context, qos, identifier, options, subhier, tokens, sharename); + + sub__topic_tokens_free(tokens); + + return rc; +} + +int sub__remove(struct mosquitto_db *db, struct mosquitto *context, const char *sub, struct mosquitto__subhier *root, uint8_t *reason) +{ + int rc = 0; + struct mosquitto__subhier *subhier; + struct sub__token *tokens = NULL, *t; + char *sharename = NULL; + + assert(root); + assert(sub); + + if(sub__topic_tokenise(sub, &tokens)) return 1; + + if(!strcmp(tokens->topic, "$share")){ + if(!tokens->next || !tokens->next->next){ + sub__topic_tokens_free(tokens); + return MOSQ_ERR_PROTOCOL; + } + t = tokens->next; + mosquitto__free(tokens->topic); + mosquitto__free(tokens); + tokens = t; + + sharename = tokens->topic; + + tokens->topic = mosquitto__strdup(""); + if(!tokens->topic){ + tokens->topic = sharename; + sub__topic_tokens_free(tokens); + return MOSQ_ERR_PROTOCOL; + } + tokens->topic_len = 0; + } + + HASH_FIND(hh, root, tokens->topic, tokens->topic_len, subhier); + if(subhier){ + *reason = MQTT_RC_NO_SUBSCRIPTION_EXISTED; + rc = sub__remove_recurse(db, context, subhier, tokens, reason, sharename); + } + + sub__topic_tokens_free(tokens); + + return rc; +} + +int sub__messages_queue(struct mosquitto_db *db, const char *source_id, const char *topic, int qos, int retain, struct mosquitto_msg_store **stored) +{ + int rc = 0; + struct mosquitto__subhier *subhier; + struct sub__token *tokens = NULL; + + assert(db); + assert(topic); + + if(sub__topic_tokenise(topic, &tokens)) return 1; + + /* Protect this message until we have sent it to all + clients - this is required because websockets client calls + db__message_write(), which could remove the message if ref_count==0. + */ + db__msg_store_ref_inc(*stored); + + HASH_FIND(hh, db->subs, tokens->topic, tokens->topic_len, subhier); + if(subhier){ + if(retain){ + /* We have a message that needs to be retained, so ensure that the subscription + * tree for its topic exists. + */ + sub__add_context(db, NULL, 0, 0, 0, subhier, tokens, NULL); + } + rc = sub__search(db, subhier, tokens, source_id, topic, qos, retain, *stored, true); + } + sub__topic_tokens_free(tokens); + + /* Remove our reference and free if needed. */ + db__msg_store_ref_dec(db, stored); + + return rc; +} + + +/* Remove a subhier element, and return its parent if that needs freeing as well. */ +static struct mosquitto__subhier *tmp_remove_subs(struct mosquitto__subhier *sub) +{ + struct mosquitto__subhier *parent; + + if(!sub || !sub->parent){ + return NULL; + } + + if(sub->children || sub->subs || sub->retained){ + return NULL; + } + + parent = sub->parent; + HASH_DELETE(hh, parent->children, sub); + mosquitto__free(sub->topic); + mosquitto__free(sub); + + if(parent->subs == NULL + && parent->children == NULL + && parent->retained == NULL + && parent->shared == NULL + && parent->parent){ + + return parent; + }else{ + return NULL; + } +} + + +static int sub__clean_session_shared(struct mosquitto_db *db, struct mosquitto *context) +{ + int i; + struct mosquitto__subleaf *leaf; + struct mosquitto__subhier *hier; + + for(i=0; i<context->shared_sub_count; i++){ + if(context->shared_subs[i] == NULL){ + continue; + } + leaf = context->shared_subs[i]->shared->subs; + while(leaf){ + if(leaf->context==context){ +#ifdef WITH_SYS_TREE + db->shared_subscription_count--; +#endif + sub__remove_shared_leaf(context->shared_subs[i]->hier, context->shared_subs[i]->shared, leaf); + break; + } + leaf = leaf->next; + } + if(context->shared_subs[i]->hier->subs == NULL + && context->shared_subs[i]->hier->children == NULL + && context->shared_subs[i]->hier->retained == NULL + && context->shared_subs[i]->hier->shared == NULL + && context->shared_subs[i]->hier->parent){ + + hier = context->shared_subs[i]->hier; + context->shared_subs[i]->hier = NULL; + do{ + hier = tmp_remove_subs(hier); + }while(hier); + } + mosquitto__free(context->shared_subs[i]); + } + mosquitto__free(context->shared_subs); + context->shared_subs = NULL; + context->shared_sub_count = 0; + + return MOSQ_ERR_SUCCESS; +} + +/* Remove all subscriptions for a client. + */ +int sub__clean_session(struct mosquitto_db *db, struct mosquitto *context) +{ + int i; + struct mosquitto__subleaf *leaf; + struct mosquitto__subhier *hier; + + for(i=0; i<context->sub_count; i++){ + if(context->subs[i] == NULL){ + continue; + } + leaf = context->subs[i]->subs; + while(leaf){ + if(leaf->context==context){ +#ifdef WITH_SYS_TREE + db->subscription_count--; +#endif + DL_DELETE(context->subs[i]->subs, leaf); + mosquitto__free(leaf); + break; + } + leaf = leaf->next; + } + if(context->subs[i]->subs == NULL + && context->subs[i]->children == NULL + && context->subs[i]->retained == NULL + && context->subs[i]->shared == NULL + && context->subs[i]->parent){ + + hier = context->subs[i]; + context->subs[i] = NULL; + do{ + hier = tmp_remove_subs(hier); + }while(hier); + } + } + mosquitto__free(context->subs); + context->subs = NULL; + context->sub_count = 0; + + return sub__clean_session_shared(db, context); +} + +void sub__tree_print(struct mosquitto__subhier *root, int level) +{ + int i; + struct mosquitto__subhier *branch, *branch_tmp; + struct mosquitto__subleaf *leaf; + + HASH_ITER(hh, root, branch, branch_tmp){ + if(level > -1){ + for(i=0; i<(level+2)*2; i++){ + printf(" "); + } + printf("%s", branch->topic); + leaf = branch->subs; + while(leaf){ + if(leaf->context){ + printf(" (%s, %d)", leaf->context->id, leaf->qos); + }else{ + printf(" (%s, %d)", "", leaf->qos); + } + leaf = leaf->next; + } + if(branch->retained){ + printf(" (r)"); + } + printf("\n"); + } + + sub__tree_print(branch->children, level+1); + } +} + +static int retain__process(struct mosquitto_db *db, struct mosquitto__subhier *branch, struct mosquitto *context, int sub_qos, uint32_t subscription_identifier, time_t now) +{ + int rc = 0; + int qos; + uint16_t mid; + mosquitto_property *properties = NULL; + struct mosquitto_msg_store *retained; + + if(branch->retained->message_expiry_time > 0 && now > branch->retained->message_expiry_time){ + db__msg_store_ref_dec(db, &branch->retained); + branch->retained = NULL; +#ifdef WITH_SYS_TREE + db->retained_count--; +#endif + return MOSQ_ERR_SUCCESS; + } + + retained = branch->retained; + + rc = mosquitto_acl_check(db, context, retained->topic, retained->payloadlen, UHPA_ACCESS(retained->payload, retained->payloadlen), + retained->qos, retained->retain, MOSQ_ACL_READ); + if(rc == MOSQ_ERR_ACL_DENIED){ + return MOSQ_ERR_SUCCESS; + }else if(rc != MOSQ_ERR_SUCCESS){ + return rc; + } + + /* Check for original source access */ + if(db->config->check_retain_source && retained->origin != mosq_mo_broker && retained->source_id){ + struct mosquitto retain_ctxt; + memset(&retain_ctxt, 0, sizeof(struct mosquitto)); + + retain_ctxt.id = retained->source_id; + retain_ctxt.username = retained->source_username; + retain_ctxt.listener = retained->source_listener; + + rc = acl__find_acls(db, &retain_ctxt); + if(rc) return rc; + + rc = mosquitto_acl_check(db, &retain_ctxt, retained->topic, retained->payloadlen, UHPA_ACCESS(retained->payload, retained->payloadlen), + retained->qos, retained->retain, MOSQ_ACL_WRITE); + if(rc == MOSQ_ERR_ACL_DENIED){ + return MOSQ_ERR_SUCCESS; + }else if(rc != MOSQ_ERR_SUCCESS){ + return rc; + } + } + + if (db->config->upgrade_outgoing_qos){ + qos = sub_qos; + } else { + qos = retained->qos; + if(qos > sub_qos) qos = sub_qos; + } + if(qos > 0){ + mid = mosquitto__mid_generate(context); + }else{ + mid = 0; + } + if(subscription_identifier > 0){ + mosquitto_property_add_varint(&properties, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, subscription_identifier); + } + return db__message_insert(db, context, mid, mosq_md_out, qos, true, retained, properties); +} + +static int retain__search(struct mosquitto_db *db, struct mosquitto__subhier *subhier, struct sub__token *tokens, struct mosquitto *context, const char *sub, int sub_qos, uint32_t subscription_identifier, time_t now, int level) +{ + struct mosquitto__subhier *branch, *branch_tmp; + int flag = 0; + + if(!strcmp(tokens->topic, "#") && !tokens->next){ + HASH_ITER(hh, subhier->children, branch, branch_tmp){ + /* Set flag to indicate that we should check for retained messages + * on "foo" when we are subscribing to e.g. "foo/#" and then exit + * this function and return to an earlier retain__search(). + */ + flag = -1; + if(branch->retained){ + retain__process(db, branch, context, sub_qos, subscription_identifier, now); + } + if(branch->children){ + retain__search(db, branch, tokens, context, sub, sub_qos, subscription_identifier, now, level+1); + } + } + }else{ + if(!strcmp(tokens->topic, "+")){ + HASH_ITER(hh, subhier->children, branch, branch_tmp){ + if(tokens->next){ + if(retain__search(db, branch, tokens->next, context, sub, sub_qos, subscription_identifier, now, level+1) == -1 + || (tokens->next && !strcmp(tokens->next->topic, "#") && level>0)){ + + if(branch->retained){ + retain__process(db, branch, context, sub_qos, subscription_identifier, now); + } + } + }else{ + if(branch->retained){ + retain__process(db, branch, context, sub_qos, subscription_identifier, now); + } + } + } + }else{ + HASH_FIND(hh, subhier->children, tokens->topic, tokens->topic_len, branch); + if(branch){ + if(tokens->next){ + if(retain__search(db, branch, tokens->next, context, sub, sub_qos, subscription_identifier, now, level+1) == -1 + || (tokens->next && !strcmp(tokens->next->topic, "#") && level>0)){ + + if(branch->retained){ + retain__process(db, branch, context, sub_qos, subscription_identifier, now); + } + } + }else{ + if(branch->retained){ + retain__process(db, branch, context, sub_qos, subscription_identifier, now); + } + } + } + } + } + return flag; +} + +int sub__retain_queue(struct mosquitto_db *db, struct mosquitto *context, const char *sub, int sub_qos, uint32_t subscription_identifier) +{ + struct mosquitto__subhier *subhier; + struct sub__token *tokens = NULL, *tail; + time_t now; + + assert(db); + assert(context); + assert(sub); + + if(sub__topic_tokenise(sub, &tokens)) return 1; + + HASH_FIND(hh, db->subs, tokens->topic, tokens->topic_len, subhier); + + if(subhier){ + now = time(NULL); + retain__search(db, subhier, tokens, context, sub, sub_qos, subscription_identifier, now, 0); + } + while(tokens){ + tail = tokens->next; + mosquitto__free(tokens->topic); + mosquitto__free(tokens); + tokens = tail; + } + + return MOSQ_ERR_SUCCESS; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/sys_tree.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/sys_tree.c new file mode 100644 index 0000000..6ae9ce6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/sys_tree.c @@ -0,0 +1,381 @@ +/* +Copyright (c) 2009-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifdef WITH_SYS_TREE + +#include "config.h" + +#include <math.h> +#include <stdio.h> + +#include "mosquitto_broker_internal.h" +#include "memory_mosq.h" +#include "time_mosq.h" + +#define BUFLEN 100 + +#define SYS_TREE_QOS 2 + +uint64_t g_bytes_received = 0; +uint64_t g_bytes_sent = 0; +uint64_t g_pub_bytes_received = 0; +uint64_t g_pub_bytes_sent = 0; +unsigned long g_msgs_received = 0; +unsigned long g_msgs_sent = 0; +unsigned long g_pub_msgs_received = 0; +unsigned long g_pub_msgs_sent = 0; +unsigned long g_msgs_dropped = 0; +int g_clients_expired = 0; +unsigned int g_socket_connections = 0; +unsigned int g_connection_count = 0; + +void sys_tree__init(struct mosquitto_db *db) +{ + char buf[64]; + + if(db->config->sys_interval == 0){ + return; + } + + /* Set static $SYS messages */ + snprintf(buf, 64, "mosquitto version %s", VERSION); + db__messages_easy_queue(db, NULL, "$SYS/broker/version", SYS_TREE_QOS, strlen(buf), buf, 1, 0, NULL); +} + +static void sys_tree__update_clients(struct mosquitto_db *db, char *buf) +{ + static int client_count = -1; + static int clients_expired = -1; + static int client_max = 0; + static int disconnected_count = -1; + static int connected_count = -1; + + int count_total, count_by_sock; + + count_total = HASH_CNT(hh_id, db->contexts_by_id); + count_by_sock = HASH_CNT(hh_sock, db->contexts_by_sock); + + if(client_count != count_total){ + client_count = count_total; + snprintf(buf, BUFLEN, "%d", client_count); + db__messages_easy_queue(db, NULL, "$SYS/broker/clients/total", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + + if(client_count > client_max){ + client_max = client_count; + snprintf(buf, BUFLEN, "%d", client_max); + db__messages_easy_queue(db, NULL, "$SYS/broker/clients/maximum", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } + } + + if(disconnected_count != count_total-count_by_sock){ + disconnected_count = count_total-count_by_sock; + if(disconnected_count < 0){ + /* If a client has connected but not sent a CONNECT at this point, + * then it is possible that count_by_sock will be bigger than + * count_total, causing a negative number. This situation should + * not last for long, so just cap at zero and ignore. */ + disconnected_count = 0; + } + snprintf(buf, BUFLEN, "%d", disconnected_count); + db__messages_easy_queue(db, NULL, "$SYS/broker/clients/inactive", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + db__messages_easy_queue(db, NULL, "$SYS/broker/clients/disconnected", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } + if(connected_count != count_by_sock){ + connected_count = count_by_sock; + snprintf(buf, BUFLEN, "%d", connected_count); + db__messages_easy_queue(db, NULL, "$SYS/broker/clients/active", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + db__messages_easy_queue(db, NULL, "$SYS/broker/clients/connected", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } + if(g_clients_expired != clients_expired){ + clients_expired = g_clients_expired; + snprintf(buf, BUFLEN, "%d", clients_expired); + db__messages_easy_queue(db, NULL, "$SYS/broker/clients/expired", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } +} + +#ifdef REAL_WITH_MEMORY_TRACKING +static void sys_tree__update_memory(struct mosquitto_db *db, char *buf) +{ + static unsigned long current_heap = -1; + static unsigned long max_heap = -1; + unsigned long value_ul; + + value_ul = mosquitto__memory_used(); + if(current_heap != value_ul){ + current_heap = value_ul; + snprintf(buf, BUFLEN, "%lu", current_heap); + db__messages_easy_queue(db, NULL, "$SYS/broker/heap/current", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } + value_ul =mosquitto__max_memory_used(); + if(max_heap != value_ul){ + max_heap = value_ul; + snprintf(buf, BUFLEN, "%lu", max_heap); + db__messages_easy_queue(db, NULL, "$SYS/broker/heap/maximum", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } +} +#endif + +static void calc_load(struct mosquitto_db *db, char *buf, const char *topic, bool initial, double exponent, double interval, double *current) +{ + double new_value; + + if (initial) { + new_value = *current; + snprintf(buf, BUFLEN, "%.2f", new_value); + db__messages_easy_queue(db, NULL, topic, SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } else { + new_value = interval + exponent*((*current) - interval); + if(fabs(new_value - (*current)) >= 0.01){ + snprintf(buf, BUFLEN, "%.2f", new_value); + db__messages_easy_queue(db, NULL, topic, SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } + } + (*current) = new_value; +} + +/* Send messages for the $SYS hierarchy if the last update is longer than + * 'interval' seconds ago. + * 'interval' is the amount of seconds between updates. If 0, then no periodic + * messages are sent for the $SYS hierarchy. + * 'start_time' is the result of time() that the broker was started at. + */ +void sys_tree__update(struct mosquitto_db *db, int interval, time_t start_time) +{ + static time_t last_update = 0; + time_t now; + time_t uptime; + char buf[BUFLEN]; + + static int msg_store_count = -1; + static unsigned long msg_store_bytes = -1; + static unsigned long msgs_received = -1; + static unsigned long msgs_sent = -1; + static unsigned long publish_dropped = -1; + static unsigned long pub_msgs_received = -1; + static unsigned long pub_msgs_sent = -1; + static unsigned long long bytes_received = -1; + static unsigned long long bytes_sent = -1; + static unsigned long long pub_bytes_received = -1; + static unsigned long long pub_bytes_sent = -1; + static int subscription_count = -1; + static int shared_subscription_count = -1; + static int retained_count = -1; + + static double msgs_received_load1 = 0; + static double msgs_received_load5 = 0; + static double msgs_received_load15 = 0; + static double msgs_sent_load1 = 0; + static double msgs_sent_load5 = 0; + static double msgs_sent_load15 = 0; + static double publish_dropped_load1 = 0; + static double publish_dropped_load5 = 0; + static double publish_dropped_load15 = 0; + double msgs_received_interval, msgs_sent_interval, publish_dropped_interval; + + static double publish_received_load1 = 0; + static double publish_received_load5 = 0; + static double publish_received_load15 = 0; + static double publish_sent_load1 = 0; + static double publish_sent_load5 = 0; + static double publish_sent_load15 = 0; + double publish_received_interval, publish_sent_interval; + + static double bytes_received_load1 = 0; + static double bytes_received_load5 = 0; + static double bytes_received_load15 = 0; + static double bytes_sent_load1 = 0; + static double bytes_sent_load5 = 0; + static double bytes_sent_load15 = 0; + double bytes_received_interval, bytes_sent_interval; + + static double socket_load1 = 0; + static double socket_load5 = 0; + static double socket_load15 = 0; + double socket_interval; + + static double connection_load1 = 0; + static double connection_load5 = 0; + static double connection_load15 = 0; + double connection_interval; + + double exponent; + double i_mult; + + now = mosquitto_time(); + + if(interval && now - interval > last_update){ + uptime = now - start_time; + snprintf(buf, BUFLEN, "%d seconds", (int)uptime); + db__messages_easy_queue(db, NULL, "$SYS/broker/uptime", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + + sys_tree__update_clients(db, buf); + bool initial_publish = false; + if(last_update == 0){ + initial_publish = true; + last_update = 1; + } + if(last_update > 0){ + i_mult = 60.0/(double)(now-last_update); + + msgs_received_interval = (g_msgs_received - msgs_received)*i_mult; + msgs_sent_interval = (g_msgs_sent - msgs_sent)*i_mult; + publish_dropped_interval = (g_msgs_dropped - publish_dropped)*i_mult; + + publish_received_interval = (g_pub_msgs_received - pub_msgs_received)*i_mult; + publish_sent_interval = (g_pub_msgs_sent - pub_msgs_sent)*i_mult; + + bytes_received_interval = (g_bytes_received - bytes_received)*i_mult; + bytes_sent_interval = (g_bytes_sent - bytes_sent)*i_mult; + + socket_interval = g_socket_connections*i_mult; + g_socket_connections = 0; + connection_interval = g_connection_count*i_mult; + g_connection_count = 0; + + /* 1 minute load */ + exponent = exp(-1.0*(now-last_update)/60.0); + + calc_load(db, buf, "$SYS/broker/load/messages/received/1min", initial_publish, exponent, msgs_received_interval, &msgs_received_load1); + calc_load(db, buf, "$SYS/broker/load/messages/sent/1min", initial_publish, exponent, msgs_sent_interval, &msgs_sent_load1); + calc_load(db, buf, "$SYS/broker/load/publish/dropped/1min", initial_publish, exponent, publish_dropped_interval, &publish_dropped_load1); + calc_load(db, buf, "$SYS/broker/load/publish/received/1min", initial_publish, exponent, publish_received_interval, &publish_received_load1); + calc_load(db, buf, "$SYS/broker/load/publish/sent/1min", initial_publish, exponent, publish_sent_interval, &publish_sent_load1); + calc_load(db, buf, "$SYS/broker/load/bytes/received/1min", initial_publish, exponent, bytes_received_interval, &bytes_received_load1); + calc_load(db, buf, "$SYS/broker/load/bytes/sent/1min", initial_publish, exponent, bytes_sent_interval, &bytes_sent_load1); + calc_load(db, buf, "$SYS/broker/load/sockets/1min", initial_publish, exponent, socket_interval, &socket_load1); + calc_load(db, buf, "$SYS/broker/load/connections/1min", initial_publish, exponent, connection_interval, &connection_load1); + + /* 5 minute load */ + exponent = exp(-1.0*(now-last_update)/300.0); + + calc_load(db, buf, "$SYS/broker/load/messages/received/5min", initial_publish, exponent, msgs_received_interval, &msgs_received_load5); + calc_load(db, buf, "$SYS/broker/load/messages/sent/5min", initial_publish, exponent, msgs_sent_interval, &msgs_sent_load5); + calc_load(db, buf, "$SYS/broker/load/publish/dropped/5min", initial_publish, exponent, publish_dropped_interval, &publish_dropped_load5); + calc_load(db, buf, "$SYS/broker/load/publish/received/5min", initial_publish, exponent, publish_received_interval, &publish_received_load5); + calc_load(db, buf, "$SYS/broker/load/publish/sent/5min", initial_publish, exponent, publish_sent_interval, &publish_sent_load5); + calc_load(db, buf, "$SYS/broker/load/bytes/received/5min", initial_publish, exponent, bytes_received_interval, &bytes_received_load5); + calc_load(db, buf, "$SYS/broker/load/bytes/sent/5min", initial_publish, exponent, bytes_sent_interval, &bytes_sent_load5); + calc_load(db, buf, "$SYS/broker/load/sockets/5min", initial_publish, exponent, socket_interval, &socket_load5); + calc_load(db, buf, "$SYS/broker/load/connections/5min", initial_publish, exponent, connection_interval, &connection_load5); + + /* 15 minute load */ + exponent = exp(-1.0*(now-last_update)/900.0); + + calc_load(db, buf, "$SYS/broker/load/messages/received/15min", initial_publish, exponent, msgs_received_interval, &msgs_received_load15); + calc_load(db, buf, "$SYS/broker/load/messages/sent/15min", initial_publish, exponent, msgs_sent_interval, &msgs_sent_load15); + calc_load(db, buf, "$SYS/broker/load/publish/dropped/15min", initial_publish, exponent, publish_dropped_interval, &publish_dropped_load15); + calc_load(db, buf, "$SYS/broker/load/publish/received/15min", initial_publish, exponent, publish_received_interval, &publish_received_load15); + calc_load(db, buf, "$SYS/broker/load/publish/sent/15min", initial_publish, exponent, publish_sent_interval, &publish_sent_load15); + calc_load(db, buf, "$SYS/broker/load/bytes/received/15min", initial_publish, exponent, bytes_received_interval, &bytes_received_load15); + calc_load(db, buf, "$SYS/broker/load/bytes/sent/15min", initial_publish, exponent, bytes_sent_interval, &bytes_sent_load15); + calc_load(db, buf, "$SYS/broker/load/sockets/15min", initial_publish, exponent, socket_interval, &socket_load15); + calc_load(db, buf, "$SYS/broker/load/connections/15min", initial_publish, exponent, connection_interval, &connection_load15); + } + + if(db->msg_store_count != msg_store_count){ + msg_store_count = db->msg_store_count; + snprintf(buf, BUFLEN, "%d", msg_store_count); + db__messages_easy_queue(db, NULL, "$SYS/broker/messages/stored", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + db__messages_easy_queue(db, NULL, "$SYS/broker/store/messages/count", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } + + if (db->msg_store_bytes != msg_store_bytes){ + msg_store_bytes = db->msg_store_bytes; + snprintf(buf, BUFLEN, "%lu", msg_store_bytes); + db__messages_easy_queue(db, NULL, "$SYS/broker/store/messages/bytes", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } + + if(db->subscription_count != subscription_count){ + subscription_count = db->subscription_count; + snprintf(buf, BUFLEN, "%d", subscription_count); + db__messages_easy_queue(db, NULL, "$SYS/broker/subscriptions/count", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } + + if(db->shared_subscription_count != shared_subscription_count){ + shared_subscription_count = db->shared_subscription_count; + snprintf(buf, BUFLEN, "%d", shared_subscription_count); + db__messages_easy_queue(db, NULL, "$SYS/broker/shared_subscriptions/count", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } + + if(db->retained_count != retained_count){ + retained_count = db->retained_count; + snprintf(buf, BUFLEN, "%d", retained_count); + db__messages_easy_queue(db, NULL, "$SYS/broker/retained messages/count", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } + +#ifdef REAL_WITH_MEMORY_TRACKING + sys_tree__update_memory(db, buf); +#endif + + if(msgs_received != g_msgs_received){ + msgs_received = g_msgs_received; + snprintf(buf, BUFLEN, "%lu", msgs_received); + db__messages_easy_queue(db, NULL, "$SYS/broker/messages/received", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } + + if(msgs_sent != g_msgs_sent){ + msgs_sent = g_msgs_sent; + snprintf(buf, BUFLEN, "%lu", msgs_sent); + db__messages_easy_queue(db, NULL, "$SYS/broker/messages/sent", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } + + if(publish_dropped != g_msgs_dropped){ + publish_dropped = g_msgs_dropped; + snprintf(buf, BUFLEN, "%lu", publish_dropped); + db__messages_easy_queue(db, NULL, "$SYS/broker/publish/messages/dropped", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } + + if(pub_msgs_received != g_pub_msgs_received){ + pub_msgs_received = g_pub_msgs_received; + snprintf(buf, BUFLEN, "%lu", pub_msgs_received); + db__messages_easy_queue(db, NULL, "$SYS/broker/publish/messages/received", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } + + if(pub_msgs_sent != g_pub_msgs_sent){ + pub_msgs_sent = g_pub_msgs_sent; + snprintf(buf, BUFLEN, "%lu", pub_msgs_sent); + db__messages_easy_queue(db, NULL, "$SYS/broker/publish/messages/sent", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } + + if(bytes_received != g_bytes_received){ + bytes_received = g_bytes_received; + snprintf(buf, BUFLEN, "%llu", bytes_received); + db__messages_easy_queue(db, NULL, "$SYS/broker/bytes/received", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } + + if(bytes_sent != g_bytes_sent){ + bytes_sent = g_bytes_sent; + snprintf(buf, BUFLEN, "%llu", bytes_sent); + db__messages_easy_queue(db, NULL, "$SYS/broker/bytes/sent", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } + + if(pub_bytes_received != g_pub_bytes_received){ + pub_bytes_received = g_pub_bytes_received; + snprintf(buf, BUFLEN, "%llu", pub_bytes_received); + db__messages_easy_queue(db, NULL, "$SYS/broker/publish/bytes/received", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } + + if(pub_bytes_sent != g_pub_bytes_sent){ + pub_bytes_sent = g_pub_bytes_sent; + snprintf(buf, BUFLEN, "%llu", pub_bytes_sent); + db__messages_easy_queue(db, NULL, "$SYS/broker/publish/bytes/sent", SYS_TREE_QOS, strlen(buf), buf, 1, 60, NULL); + } + + last_update = mosquitto_time(); + } +} + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/sys_tree.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/sys_tree.h new file mode 100644 index 0000000..603d2f0 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/sys_tree.h @@ -0,0 +1,64 @@ +/* +Copyright (c) 2015-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef SYS_TREE_H +#define SYS_TREE_H + +#if defined(WITH_SYS_TREE) && defined(WITH_BROKER) +extern uint64_t g_bytes_received; +extern uint64_t g_bytes_sent; +extern uint64_t g_pub_bytes_received; +extern uint64_t g_pub_bytes_sent; +extern unsigned long g_msgs_received; +extern unsigned long g_msgs_sent; +extern unsigned long g_pub_msgs_received; +extern unsigned long g_pub_msgs_sent; +extern unsigned long g_msgs_dropped; +extern int g_clients_expired; +extern unsigned int g_socket_connections; +extern unsigned int g_connection_count; + +#define G_BYTES_RECEIVED_INC(A) (g_bytes_received+=(A)) +#define G_BYTES_SENT_INC(A) (g_bytes_sent+=(A)) +#define G_PUB_BYTES_RECEIVED_INC(A) (g_pub_bytes_received+=(A)) +#define G_PUB_BYTES_SENT_INC(A) (g_pub_bytes_sent+=(A)) +#define G_MSGS_RECEIVED_INC(A) (g_msgs_received+=(A)) +#define G_MSGS_SENT_INC(A) (g_msgs_sent+=(A)) +#define G_PUB_MSGS_RECEIVED_INC(A) (g_pub_msgs_received+=(A)) +#define G_PUB_MSGS_SENT_INC(A) (g_pub_msgs_sent+=(A)) +#define G_MSGS_DROPPED_INC() (g_msgs_dropped++) +#define G_CLIENTS_EXPIRED_INC() (g_clients_expired++) +#define G_SOCKET_CONNECTIONS_INC() (g_socket_connections++) +#define G_CONNECTION_COUNT_INC() (g_connection_count++) + +#else + +#define G_BYTES_RECEIVED_INC(A) +#define G_BYTES_SENT_INC(A) +#define G_PUB_BYTES_RECEIVED_INC(A) +#define G_PUB_BYTES_SENT_INC(A) +#define G_MSGS_RECEIVED_INC(A) +#define G_MSGS_SENT_INC(A) +#define G_PUB_MSGS_RECEIVED_INC(A) +#define G_PUB_MSGS_SENT_INC(A) +#define G_MSGS_DROPPED_INC(A) +#define G_CLIENTS_EXPIRED_INC(A) +#define G_SOCKET_CONNECTIONS_INC(A) +#define G_CONNECTION_COUNT_INC(A) + +#endif + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/uhpa.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/uhpa.h new file mode 100644 index 0000000..cad4d2c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/uhpa.h @@ -0,0 +1,171 @@ +/* +Copyright (c) 2015-2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ +#ifndef UHPA_H +#define UHPA_H + +/* "Union of heap pointer and array" + * + * This set of macros is intended to provide a simple means of treating a + * variable as a heap pointer or a fixed size array, depending on the size of + * the data being stored. It was borne out of the situation where the majority + * of calls to malloc for a struct member were ending up less than 8 bytes - + * i.e. the size of the 64-bit pointer. By using uhpa a great number of calls + * to malloc could be avoided. The downsize to this method is that you must + * always know the length of data that you are dealing with. + * + * The data structure you provide must look something like: + * + * typedef union { + * void *ptr; + * char array[MAX_ARRAY_SIZE]; + * } uhpa_u + * + * This code really only makes sense if the data types you want to store are + * smaller than a pointer - the most obvious choice being bytes. All of these + * functions assume that the array is made up of single bytes. + * + * You can change the type of ptr to match your needs, with the above caveat + * about array. So make ptr a char*, uint8_t*, unsigned char*, ... + * + * It should be possible to modify the code to work with arrays that have + * element sizes bigger than a byte. + * + * Define MAX_ARRAY_SIZE to be as large as you want, depending on the size of + * your commonly used data. Define MAX_ARRAY_SIZE to be sizeof(void *) if you + * do not want to "waste" any memory per item - with the tradeoff that calls to + * malloc will be more frequent because MAX_ARRAY_SIZE will only be 4 or 8 + * bytes, depending on your architecture. + * + * ============================================================================= + * Basic Functions + * ============================================================================= + * + * Note that if you are using strings, set size to be strlen(s)+1, so that the + * null terminator is included, or use the _STR functions below. + * + * UHPA_ALLOC(u, size) + * Call to allocate memory to a uhpa variable if required. + * + * u : the uhpa data type that will have memory allocated or not, + * depending on "size". + * size : the length of the data to be stored, in bytes. + * + * returns : 1 if memory was allocated successfully + * 0 if memory was not able to be allocated + * -1 if no memory needed to be allocated + * + * UHPA_ACCESS(u, size) + * Call to access (for read or write) a uhpa variable that has already had + * UHPA_ALLOC() called on it. + * + * u : the uhpa data type that has already had memory allocated. + * size : the length of the stored data, in bytes. + * + * returns : an appropriate pointer/array address + * + * UHPA_FREE(u, size) + * Call to free memory associated with a uhpa variable. This is safe to + * call with a data structure that does not have heap allocated memory. + * + * u : the uhpa data type that has already had memory allocated. + * size : the length of the stored data, in bytes. + * + * UHPA_MOVE(dest, src, src_size) + * Call to move memory stored in one uhpa variable to another. If the data + * is stored with heap allocated memory, then dest.ptr is set to src.ptr. + * If the data is stored as an array, memmove is used to copy data from + * src to dest. In both cases the data stored in src is invalidated by + * setting src.ptr to NULL and calling memset(src.array, 0, src_size) + * respectively. + * + * ============================================================================= + * String Functions + * ============================================================================= + * + * Convenience functions when working with strings. These are identical to the + * non-string versions, except that they increase the value of "size" by 1, to + * take into account the need for storing the 0 termination character. + * + * UHPA_ALLOC_STR(u, size) + * UHPA_ACCESS_STR(u, size) + * UHPA_FREE_STR(u, size) + * UHPA_MOVE_STR(dest, src, size) + * + * ============================================================================= + * Forcing use of malloc + * ============================================================================= + * + * If you wish to force the use of malloc without removing the UHPA macros from + * your code (i.e. the macros will never use the array part of the union) then + * #define UHPA_FORCE_MALLOC before including this file. + * + * ============================================================================= + * Memory Functions + * ============================================================================= + * + * If you wish to use your own memory functions for alloc/free, #define both + * uhpa_malloc and uhpa_free to your own functions. + */ + + +#ifndef uhpa_malloc +# define uhpa_malloc(size) malloc(size) +#endif + +#ifndef uhpa_free +# define uhpa_free(ptr) free(ptr) +#endif + +#define UHPA_ALLOC_CHK(u, size) \ + ((size) > sizeof((u).array)? \ + (((u).ptr = uhpa_malloc((size)))?1:0) \ + :-1) + +#define UHPA_ACCESS_CHK(u, size) ((size) > sizeof((u).array)?(u).ptr:(u).array) + +#define UHPA_FREE_CHK(u, size) \ + if((size) > sizeof((u).array) && (u).ptr){ \ + uhpa_free((u).ptr); \ + (u).ptr = NULL; \ + } + +#define UHPA_MOVE_CHK(dest, src, src_size) \ + if((src_size) > sizeof((src).array) && (src).ptr){ \ + (dest).ptr = (src).ptr; \ + (src).ptr = NULL; \ + }else{ \ + memmove((dest).array, (src).array, (src_size)); \ + memset((src).array, 0, (src_size)); \ + } + +#ifdef UHPA_FORCE_MALLOC +# define UHPA_ALLOC(u, size) ((u).ptr = uhpa_malloc(size)) +# define UHPA_ACCESS(u, size) (u).ptr +# define UHPA_FREE(u, size) uhpa_free((u).ptr); (u).ptr = NULL; +# define UHPA_MOVE(dest, src, src_size) {(dest).ptr = (src).ptr; (src).ptr = NULL;} +#else +# define UHPA_ALLOC(u, size) UHPA_ALLOC_CHK(u, size) +# define UHPA_ACCESS(u, size) UHPA_ACCESS_CHK(u, size) +# define UHPA_FREE(u, size) UHPA_FREE_CHK(u, size) +# define UHPA_MOVE(dest, src, src_size) UHPA_MOVE_CHK(dest, src, src_size) +#endif + +#define UHPA_ALLOC_STR(u, size) UHPA_ALLOC((u), (size)+1) +#define UHPA_ACCESS_STR(u, size) ((char *)UHPA_ACCESS((u), (size)+1)) +#define UHPA_FREE_STR(u, size) UHPA_FREE((u), (size)+1) +#define UHPA_MOVE_STR(dest, src, src_size) UHPA_MOVE((dest), (src), (src_size)+1) + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/websockets.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/websockets.c new file mode 100644 index 0000000..8a6d3aa --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/websockets.c @@ -0,0 +1,777 @@ +/* +Copyright (c) 2014-2019 Roger Light <roger@atchoo.org> +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of mosquitto nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifdef WITH_WEBSOCKETS + +#include "config.h" + +#include <libwebsockets.h> +#include "mosquitto_internal.h" +#include "mosquitto_broker_internal.h" +#include "mqtt_protocol.h" +#include "memory_mosq.h" +#include "packet_mosq.h" +#include "sys_tree.h" + +#include <stdlib.h> +#include <errno.h> +#include <sys/stat.h> + +#ifndef WIN32 +# include <sys/socket.h> +#endif + +extern struct mosquitto_db int_db; + +#if defined(LWS_LIBRARY_VERSION_NUMBER) +static int callback_mqtt( +#else +static int callback_mqtt(struct libwebsocket_context *context, +#endif + struct libwebsocket *wsi, + enum libwebsocket_callback_reasons reason, + void *user, + void *in, + size_t len); + +#if defined(LWS_LIBRARY_VERSION_NUMBER) +static int callback_http( +#else +static int callback_http(struct libwebsocket_context *context, +#endif + struct libwebsocket *wsi, + enum libwebsocket_callback_reasons reason, + void *user, + void *in, + size_t len); + +enum mosq_ws_protocols { + PROTOCOL_HTTP = 0, + PROTOCOL_MQTT, + DEMO_PROTOCOL_COUNT +}; + +struct libws_http_data { + FILE *fptr; +}; + +static struct libwebsocket_protocols protocols[] = { + /* first protocol must always be HTTP handler */ + { + "http-only", /* name */ + callback_http, /* lws_callback_function */ + sizeof (struct libws_http_data), /* per_session_data_size */ + 0, /* rx_buffer_size */ +#ifndef LWS_LIBRARY_VERSION_NUMBER + 0, /* no_buffer_all_partial_tx v1.3 only */ +#endif +#ifdef LWS_FEATURE_PROTOCOLS_HAS_ID_FIELD + 0, /* id */ +#endif +#ifdef LWS_LIBRARY_VERSION_NUMBER + NULL, /* user v1.4 on */ +# if LWS_LIBRARY_VERSION_NUMBER >= 2003000 + 0 /* tx_packet_size v2.3.0 */ +# endif +#endif + }, + { + "mqtt", + callback_mqtt, + sizeof(struct libws_mqtt_data), + 0, /* rx_buffer_size */ +#ifndef LWS_LIBRARY_VERSION_NUMBER + 0, /* no_buffer_all_partial_tx v1.3 only */ +#endif +#ifdef LWS_FEATURE_PROTOCOLS_HAS_ID_FIELD + 1, /* id */ +#endif +#ifdef LWS_LIBRARY_VERSION_NUMBER + NULL, /* user v1.4 on */ +# if LWS_LIBRARY_VERSION_NUMBER >= 2003000 + 0 /* tx_packet_size v2.3.0 */ +# endif +#endif + }, + { + "mqttv3.1", + callback_mqtt, + sizeof(struct libws_mqtt_data), + 0, /* rx_buffer_size */ +#ifndef LWS_LIBRARY_VERSION_NUMBER + 0, /* no_buffer_all_partial_tx v1.3 only */ +#endif +#ifdef LWS_FEATURE_PROTOCOLS_HAS_ID_FIELD + 2, /* id */ +#endif +#ifdef LWS_LIBRARY_VERSION_NUMBER + NULL, /* user v1.4 on */ +# if LWS_LIBRARY_VERSION_NUMBER >= 2003000 + 0 /* tx_packet_size v2.3.0 */ +# endif +#endif + }, + { + NULL, + NULL, + 0, + 0, /* rx_buffer_size */ +#ifndef LWS_LIBRARY_VERSION_NUMBER + 0, /* no_buffer_all_partial_tx v1.3 only */ +#endif +#ifdef LWS_FEATURE_PROTOCOLS_HAS_ID_FIELD + 0, /* id */ +#endif +#ifdef LWS_LIBRARY_VERSION_NUMBER + NULL, /* user v1.4 on */ +# if LWS_LIBRARY_VERSION_NUMBER >= 2003000 + 0 /* tx_packet_size v2.3.0 */ +# endif +#endif + } +}; + +static void easy_address(int sock, struct mosquitto *mosq) +{ + char address[1024]; + + if(!net__socket_get_address(sock, address, 1024)){ + mosq->address = mosquitto__strdup(address); + } +} + +#if defined(LWS_LIBRARY_VERSION_NUMBER) +static int callback_mqtt( +#else +static int callback_mqtt(struct libwebsocket_context *context, +#endif + struct libwebsocket *wsi, + enum libwebsocket_callback_reasons reason, + void *user, + void *in, + size_t len) +{ + struct mosquitto_db *db; + struct mosquitto *mosq = NULL; + struct mosquitto__packet *packet; + int count, i, j; + const struct libwebsocket_protocols *p; + struct libws_mqtt_data *u = (struct libws_mqtt_data *)user; + size_t pos; + uint8_t *buf; + int rc; + uint8_t byte; + + db = &int_db; + + switch (reason) { + case LWS_CALLBACK_ESTABLISHED: + mosq = context__init(db, WEBSOCKET_CLIENT); + if(mosq){ + p = libwebsockets_get_protocol(wsi); + for (i=0; i<db->config->listener_count; i++){ + if (db->config->listeners[i].protocol == mp_websockets) { + for (j=0; db->config->listeners[i].ws_protocol[j].name; j++){ + if (p == &db->config->listeners[i].ws_protocol[j]){ + mosq->listener = &db->config->listeners[i]; + mosq->listener->client_count++; + } + } + } + } + if(!mosq->listener){ + mosquitto__free(mosq); + return -1; + } +#if !defined(LWS_LIBRARY_VERSION_NUMBER) + mosq->ws_context = context; +#endif + mosq->wsi = wsi; +#ifdef WITH_TLS + if(in){ + mosq->ssl = (SSL *)in; + if(!mosq->listener->ssl_ctx){ + mosq->listener->ssl_ctx = SSL_get_SSL_CTX(mosq->ssl); + } + } +#endif + u->mosq = mosq; + }else{ + return -1; + } + easy_address(libwebsocket_get_socket_fd(wsi), mosq); + if(!mosq->address){ + /* getpeername and inet_ntop failed and not a bridge */ + mosquitto__free(mosq); + u->mosq = NULL; + return -1; + } + if(mosq->listener->max_connections > 0 && mosq->listener->client_count > mosq->listener->max_connections){ + if(db->config->connection_messages == true){ + log__printf(NULL, MOSQ_LOG_NOTICE, "Client connection from %s denied: max_connections exceeded.", mosq->address); + } + mosquitto__free(mosq->address); + mosquitto__free(mosq); + u->mosq = NULL; + return -1; + } + mosq->sock = libwebsocket_get_socket_fd(wsi); + HASH_ADD(hh_sock, db->contexts_by_sock, sock, sizeof(mosq->sock), mosq); + break; + + case LWS_CALLBACK_CLOSED: + if(!u){ + return -1; + } + mosq = u->mosq; + if(mosq){ + if(mosq->sock != INVALID_SOCKET){ + HASH_DELETE(hh_sock, db->contexts_by_sock, mosq); + mosq->sock = INVALID_SOCKET; + mosq->pollfd_index = -1; + } + mosq->wsi = NULL; +#ifdef WITH_TLS + mosq->ssl = NULL; +#endif + do_disconnect(db, mosq, MOSQ_ERR_CONN_LOST); + } + break; + + case LWS_CALLBACK_SERVER_WRITEABLE: + if(!u){ + return -1; + } + mosq = u->mosq; + if(!mosq){ + return -1; + } + + db__message_write(db, mosq); + + if(mosq->out_packet && !mosq->current_out_packet){ + mosq->current_out_packet = mosq->out_packet; + mosq->out_packet = mosq->out_packet->next; + if(!mosq->out_packet){ + mosq->out_packet_last = NULL; + } + } + + if(mosq->current_out_packet && !lws_send_pipe_choked(mosq->wsi)){ + packet = mosq->current_out_packet; + + if(packet->pos == 0 && packet->to_process == packet->packet_length){ + /* First time this packet has been dealt with. + * libwebsockets requires that the payload has + * LWS_SEND_BUFFER_PRE_PADDING space available before the + * actual data and LWS_SEND_BUFFER_POST_PADDING afterwards. + * We've already made the payload big enough to allow this, + * but need to move it into position here. */ + memmove(&packet->payload[LWS_SEND_BUFFER_PRE_PADDING], packet->payload, packet->packet_length); + packet->pos += LWS_SEND_BUFFER_PRE_PADDING; + } + count = libwebsocket_write(wsi, &packet->payload[packet->pos], packet->to_process, LWS_WRITE_BINARY); + if(count < 0){ + if (mosq->state == mosq_cs_disconnect_ws || mosq->state == mosq_cs_disconnecting){ + return -1; + } + return 0; + } +#ifdef WITH_SYS_TREE + g_bytes_sent += count; +#endif + packet->to_process -= count; + packet->pos += count; + if(packet->to_process > 0){ + if (mosq->state == mosq_cs_disconnect_ws || mosq->state == mosq_cs_disconnecting){ + return -1; + } + break; + } + +#ifdef WITH_SYS_TREE + g_msgs_sent++; + if(((packet->command)&0xF6) == CMD_PUBLISH){ + g_pub_msgs_sent++; + } +#endif + + /* Free data and reset values */ + mosq->current_out_packet = mosq->out_packet; + if(mosq->out_packet){ + mosq->out_packet = mosq->out_packet->next; + if(!mosq->out_packet){ + mosq->out_packet_last = NULL; + } + } + + packet__cleanup(packet); + mosquitto__free(packet); + + mosq->next_msg_out = mosquitto_time() + mosq->keepalive; + } + if (mosq->state == mosq_cs_disconnect_ws || mosq->state == mosq_cs_disconnecting){ + return -1; + } + if(mosq->current_out_packet){ + libwebsocket_callback_on_writable(mosq->ws_context, mosq->wsi); + } + break; + + case LWS_CALLBACK_RECEIVE: + if(!u || !u->mosq){ + return -1; + } + mosq = u->mosq; + pos = 0; + buf = (uint8_t *)in; + G_BYTES_RECEIVED_INC(len); + while(pos < len){ + if(!mosq->in_packet.command){ + mosq->in_packet.command = buf[pos]; + pos++; + /* Clients must send CONNECT as their first command. */ + if(mosq->state == mosq_cs_new && (mosq->in_packet.command&0xF0) != CMD_CONNECT){ + return -1; + } + } + if(mosq->in_packet.remaining_count <= 0){ + do{ + if(pos == len){ + return 0; + } + byte = buf[pos]; + pos++; + + mosq->in_packet.remaining_count--; + /* Max 4 bytes length for remaining length as defined by protocol. + * Anything more likely means a broken/malicious client. + */ + if(mosq->in_packet.remaining_count < -4){ + return -1; + } + + mosq->in_packet.remaining_length += (byte & 127) * mosq->in_packet.remaining_mult; + mosq->in_packet.remaining_mult *= 128; + }while((byte & 128) != 0); + mosq->in_packet.remaining_count *= -1; + + if(mosq->in_packet.remaining_length > 0){ + mosq->in_packet.payload = mosquitto__malloc(mosq->in_packet.remaining_length*sizeof(uint8_t)); + if(!mosq->in_packet.payload){ + return -1; + } + mosq->in_packet.to_process = mosq->in_packet.remaining_length; + } + } + if(mosq->in_packet.to_process>0){ + if(len - pos >= mosq->in_packet.to_process){ + memcpy(&mosq->in_packet.payload[mosq->in_packet.pos], &buf[pos], mosq->in_packet.to_process); + mosq->in_packet.pos += mosq->in_packet.to_process; + pos += mosq->in_packet.to_process; + mosq->in_packet.to_process = 0; + }else{ + memcpy(&mosq->in_packet.payload[mosq->in_packet.pos], &buf[pos], len-pos); + mosq->in_packet.pos += len-pos; + mosq->in_packet.to_process -= len-pos; + return 0; + } + } + /* All data for this packet is read. */ + mosq->in_packet.pos = 0; + +#ifdef WITH_SYS_TREE + G_MSGS_RECEIVED_INC(1); + if(((mosq->in_packet.command)&0xF5) == CMD_PUBLISH){ + G_PUB_MSGS_RECEIVED_INC(1); + } +#endif + rc = handle__packet(db, mosq); + + /* Free data and reset values */ + packet__cleanup(&mosq->in_packet); + + mosq->last_msg_in = mosquitto_time(); + + if(rc && (mosq->out_packet || mosq->current_out_packet)) { + if(mosq->state != mosq_cs_disconnecting){ + context__set_state(mosq, mosq_cs_disconnect_ws); + } + libwebsocket_callback_on_writable(mosq->ws_context, mosq->wsi); + } else if (rc) { + do_disconnect(db, mosq, MOSQ_ERR_CONN_LOST); + return -1; + } + } + break; + + default: + break; + } + + return 0; +} + + +static char *http__canonical_filename( +#ifndef LWS_LIBRARY_VERSION_NUMBER + struct libwebsocket_context *context, +#endif + struct libwebsocket *wsi, + const char *in, + const char *http_dir) +{ + size_t inlen, slen; + char *filename, *filename_canonical; + + inlen = strlen(in); + if(in[inlen-1] == '/'){ + slen = strlen(http_dir) + inlen + strlen("/index.html") + 2; + }else{ + slen = strlen(http_dir) + inlen + 2; + } + filename = mosquitto__malloc(slen); + if(!filename){ + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_INTERNAL_SERVER_ERROR, NULL); + return NULL; + } + if(((char *)in)[inlen-1] == '/'){ + snprintf(filename, slen, "%s%sindex.html", http_dir, (char *)in); + }else{ + snprintf(filename, slen, "%s%s", http_dir, (char *)in); + } + + + /* Get canonical path and check it is within our http_dir */ +#ifdef WIN32 + filename_canonical = _fullpath(NULL, filename, 0); + mosquitto__free(filename); + if(!filename_canonical){ + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_INTERNAL_SERVER_ERROR, NULL); + return NULL; + } +#else + filename_canonical = realpath(filename, NULL); + mosquitto__free(filename); + if(!filename_canonical){ + if(errno == EACCES){ + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_FORBIDDEN, NULL); + }else if(errno == EINVAL || errno == EIO || errno == ELOOP){ + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_INTERNAL_SERVER_ERROR, NULL); + }else if(errno == ENAMETOOLONG){ + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_REQ_URI_TOO_LONG, NULL); + }else if(errno == ENOENT || errno == ENOTDIR){ + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_NOT_FOUND, NULL); + } + return NULL; + } +#endif + if(strncmp(http_dir, filename_canonical, strlen(http_dir))){ + /* Requested file isn't within http_dir, deny access. */ + free(filename_canonical); + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_FORBIDDEN, NULL); + return NULL; + } + + return filename_canonical; +} + + +#if defined(LWS_LIBRARY_VERSION_NUMBER) +static int callback_http( +#else +static int callback_http(struct libwebsocket_context *context, +#endif + struct libwebsocket *wsi, + enum libwebsocket_callback_reasons reason, + void *user, + void *in, + size_t len) +{ + struct libws_http_data *u = (struct libws_http_data *)user; + struct libws_mqtt_hack *hack; + char *http_dir; + size_t buflen; + size_t wlen; + char *filename_canonical; + unsigned char buf[4096]; + struct stat filestat; + struct mosquitto_db *db = &int_db; + struct mosquitto *mosq; + struct lws_pollargs *pollargs = (struct lws_pollargs *)in; + + /* FIXME - ssl cert verification is done here. */ + + switch (reason) { + case LWS_CALLBACK_HTTP: + if(!u){ + return -1; + } + +#if defined(LWS_LIBRARY_VERSION_NUMBER) + hack = (struct libws_mqtt_hack *)lws_context_user(lws_get_context(wsi)); +#else + hack = (struct libws_mqtt_hack *)libwebsocket_context_user(context); +#endif + if(!hack){ + return -1; + } + http_dir = hack->http_dir; + + if(!http_dir){ + /* http disabled */ + return -1; + } + + /* Forbid POST */ + if(lws_hdr_total_length(wsi, WSI_TOKEN_POST_URI)){ + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_METHOD_NOT_ALLOWED, NULL); + return -1; + } + +#if defined(LWS_LIBRARY_VERSION_NUMBER) + filename_canonical = http__canonical_filename(wsi, (char *)in, http_dir); +#else + filename_canonical = http__canonical_filename(context, wsi, (char *)in, http_dir); +#endif + if(!filename_canonical) return -1; + + u->fptr = fopen(filename_canonical, "rb"); + if(!u->fptr){ + free(filename_canonical); + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_NOT_FOUND, NULL); + return -1; + } + if(fstat(fileno(u->fptr), &filestat) < 0){ + free(filename_canonical); + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_INTERNAL_SERVER_ERROR, NULL); + fclose(u->fptr); + u->fptr = NULL; + return -1; + } + + + if((filestat.st_mode & S_IFDIR) == S_IFDIR){ + fclose(u->fptr); + u->fptr = NULL; + free(filename_canonical); + + /* FIXME - use header functions from lws 2.x */ + buflen = snprintf((char *)buf, 4096, "HTTP/1.0 302 OK\r\n" + "Location: %s/\r\n\r\n", + (char *)in); + return libwebsocket_write(wsi, buf, buflen, LWS_WRITE_HTTP); + } + + if((filestat.st_mode & S_IFREG) != S_IFREG){ + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_FORBIDDEN, NULL); + fclose(u->fptr); + u->fptr = NULL; + free(filename_canonical); + return -1; + } + + log__printf(NULL, MOSQ_LOG_DEBUG, "http serving file \"%s\".", filename_canonical); + free(filename_canonical); + /* FIXME - use header functions from lws 2.x */ + buflen = snprintf((char *)buf, 4096, "HTTP/1.0 200 OK\r\n" + "Server: mosquitto\r\n" + "Content-Length: %u\r\n\r\n", + (unsigned int)filestat.st_size); + if(libwebsocket_write(wsi, buf, buflen, LWS_WRITE_HTTP) < 0){ + fclose(u->fptr); + u->fptr = NULL; + return -1; + } + libwebsocket_callback_on_writable(context, wsi); + break; + + case LWS_CALLBACK_HTTP_BODY: + /* For extra POST data? */ + return -1; + + case LWS_CALLBACK_HTTP_BODY_COMPLETION: + /* For end of extra POST data? */ + return -1; + + case LWS_CALLBACK_FILTER_HTTP_CONNECTION: + /* Access control here */ + return 0; + + case LWS_CALLBACK_HTTP_WRITEABLE: + /* Send our data here */ + if(u && u->fptr){ + do{ + buflen = fread(buf, 1, sizeof(buf), u->fptr); + if(buflen < 1){ + fclose(u->fptr); + u->fptr = NULL; + return -1; + } + wlen = libwebsocket_write(wsi, buf, buflen, LWS_WRITE_HTTP); + if(wlen < buflen){ + if(fseek(u->fptr, buflen-wlen, SEEK_CUR) < 0){ + fclose(u->fptr); + u->fptr = NULL; + return -1; + } + }else{ + if(buflen < sizeof(buf)){ + fclose(u->fptr); + u->fptr = NULL; + } + } + }while(u->fptr && !lws_send_pipe_choked(wsi)); + libwebsocket_callback_on_writable(context, wsi); + }else{ + return -1; + } + break; + + case LWS_CALLBACK_CLOSED: + case LWS_CALLBACK_CLOSED_HTTP: + case LWS_CALLBACK_HTTP_FILE_COMPLETION: + if(u && u->fptr){ + fclose(u->fptr); + u->fptr = NULL; + } + break; + + case LWS_CALLBACK_ADD_POLL_FD: + case LWS_CALLBACK_DEL_POLL_FD: + case LWS_CALLBACK_CHANGE_MODE_POLL_FD: + HASH_FIND(hh_sock, db->contexts_by_sock, &pollargs->fd, sizeof(pollargs->fd), mosq); + if(mosq && (pollargs->events & POLLOUT)){ + mosq->ws_want_write = true; + } + break; + +#ifdef WITH_TLS + case LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION: + if(!len || (SSL_get_verify_result((SSL*)in) != X509_V_OK)){ + return 1; + } + break; +#endif + + default: + return 0; + } + + return 0; +} + +static void log_wrap(int level, const char *line) +{ + char *l = (char *)line; + l[strlen(line)-1] = '\0'; // Remove \n + log__printf(NULL, MOSQ_LOG_WEBSOCKETS, "%s", l); +} + +struct libwebsocket_context *mosq_websockets_init(struct mosquitto__listener *listener, const struct mosquitto__config *conf) +{ + struct lws_context_creation_info info; + struct libwebsocket_protocols *p; + int protocol_count; + int i; + struct libws_mqtt_hack *user; + + /* Count valid protocols */ + for(protocol_count=0; protocols[protocol_count].name; protocol_count++); + + p = mosquitto__calloc(protocol_count+1, sizeof(struct libwebsocket_protocols)); + if(!p){ + log__printf(NULL, MOSQ_LOG_ERR, "Out of memory."); + return NULL; + } + for(i=0; protocols[i].name; i++){ + p[i].name = protocols[i].name; + p[i].callback = protocols[i].callback; + p[i].per_session_data_size = protocols[i].per_session_data_size; + p[i].rx_buffer_size = protocols[i].rx_buffer_size; + } + + memset(&info, 0, sizeof(info)); + info.iface = listener->host; + info.port = listener->port; + info.protocols = p; + info.gid = -1; + info.uid = -1; +#ifdef WITH_TLS + info.ssl_ca_filepath = listener->cafile; + info.ssl_cert_filepath = listener->certfile; + info.ssl_private_key_filepath = listener->keyfile; + info.ssl_cipher_list = listener->ciphers; + if(listener->require_certificate){ + info.options |= LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT; + } +#endif + +#if LWS_LIBRARY_VERSION_MAJOR>1 + info.options |= LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT; +#endif + if(listener->socket_domain == AF_INET){ + info.options |= LWS_SERVER_OPTION_DISABLE_IPV6; + } +#if defined(LWS_LIBRARY_VERSION_NUMBER) && LWS_LIBRARY_VERSION_NUMBER>=1007000 + info.max_http_header_data = conf->websockets_headers_size; +#endif + + user = mosquitto__calloc(1, sizeof(struct libws_mqtt_hack)); + if(!user){ + mosquitto__free(p); + log__printf(NULL, MOSQ_LOG_ERR, "Out of memory."); + return NULL; + } + + if(listener->http_dir){ +#ifdef WIN32 + user->http_dir = _fullpath(NULL, listener->http_dir, 0); +#else + user->http_dir = realpath(listener->http_dir, NULL); +#endif + if(!user->http_dir){ + mosquitto__free(user); + mosquitto__free(p); + log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to open http dir \"%s\".", listener->http_dir); + return NULL; + } + } + + info.user = user; + listener->ws_protocol = p; + + lws_set_log_level(conf->websockets_log_level, log_wrap); + + log__printf(NULL, MOSQ_LOG_INFO, "Opening websockets listen socket on port %d.", listener->port); + return libwebsocket_create_context(&info); +} + + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/will_delay.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/will_delay.c new file mode 100644 index 0000000..4bed7a8 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/src/will_delay.c @@ -0,0 +1,102 @@ +/* +Copyright (c) 2019 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include "config.h" + +#include <math.h> +#include <stdio.h> +#include <utlist.h> + +#include "mosquitto_broker_internal.h" +#include "memory_mosq.h" +#include "time_mosq.h" + +static struct will_delay_list *delay_list = NULL; +static time_t last_check = 0; + + +static int will_delay__cmp(struct will_delay_list *i1, struct will_delay_list *i2) +{ + return i1->context->will_delay_interval - i2->context->will_delay_interval; +} + + +int will_delay__add(struct mosquitto *context) +{ + struct will_delay_list *item; + + item = mosquitto__calloc(1, sizeof(struct will_delay_list)); + if(!item) return MOSQ_ERR_NOMEM; + + item->context = context; + context->will_delay_entry = item; + item->context->will_delay_time = time(NULL) + item->context->will_delay_interval; + + DL_INSERT_INORDER(delay_list, item, will_delay__cmp); + + return MOSQ_ERR_SUCCESS; +} + + +/* Call on broker shutdown only */ +void will_delay__send_all(struct mosquitto_db *db) +{ + struct will_delay_list *item, *tmp; + + DL_FOREACH_SAFE(delay_list, item, tmp){ + DL_DELETE(delay_list, item); + item->context->will_delay_interval = 0; + item->context->will_delay_entry = NULL; + context__send_will(db, item->context); + mosquitto__free(item); + } + +} + +void will_delay__check(struct mosquitto_db *db, time_t now) +{ + struct will_delay_list *item, *tmp; + + if(now <= last_check) return; + + last_check = now; + + DL_FOREACH_SAFE(delay_list, item, tmp){ + if(item->context->will_delay_time < now){ + DL_DELETE(delay_list, item); + item->context->will_delay_interval = 0; + item->context->will_delay_entry = NULL; + context__send_will(db, item->context); + if(item->context->session_expiry_interval == 0){ + context__add_to_disused(db, item->context); + } + mosquitto__free(item); + }else{ + return; + } + } + +} + + +void will_delay__remove(struct mosquitto *mosq) +{ + if(mosq->will_delay_entry != NULL){ + DL_DELETE(delay_list, mosq->will_delay_entry); + mosq->will_delay_entry = NULL; + } +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/tags b/proj1_mqttd/mosquitto/mosquitto-1.6.3/tags new file mode 100644 index 0000000..a9bf836 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/tags @@ -0,0 +1,8028 @@ +!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ +!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ +!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/ +!_TAG_PROGRAM_NAME Exuberant Ctags // +!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ +!_TAG_PROGRAM_VERSION 5.9~svn20110310 // +ALIAS_MOSQ_H lib/alias_mosq.h 18;" d +ALL_DEPS client/Makefile /^ALL_DEPS:= mosquitto_pub mosquitto_sub mosquitto_rr$/;" m +ALL_DEPS client/Makefile /^ALL_DEPS:= static_pub static_sub static_rr$/;" m +ALL_DEPS lib/Makefile /^ALL_DEPS:=$/;" m +ALL_DEPS lib/cpp/Makefile /^ALL_DEPS=libmosquittopp.so.${SOVERSION}$/;" m +BROKER_CFLAGS config.mk /^ BROKER_CFLAGS:=$(BROKER_CFLAGS) -coverage$/;" m +BROKER_CFLAGS config.mk /^BROKER_CFLAGS:=${CFLAGS} -DVERSION="\\"${VERSION}\\"" -DWITH_BROKER$/;" m +BROKER_CPPFLAGS config.mk /^ BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_EPOLL$/;" m +BROKER_CPPFLAGS config.mk /^ BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_MEMORY_TRACKING$/;" m +BROKER_CPPFLAGS config.mk /^ BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_TLS_PSK$/;" m +BROKER_CPPFLAGS config.mk /^ BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_ADNS$/;" m +BROKER_CPPFLAGS config.mk /^ BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_BRIDGE$/;" m +BROKER_CPPFLAGS config.mk /^ BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_EC$/;" m +BROKER_CPPFLAGS config.mk /^ BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_PERSISTENCE$/;" m +BROKER_CPPFLAGS config.mk /^ BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_SYSTEMD$/;" m +BROKER_CPPFLAGS config.mk /^ BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_SYS_TREE$/;" m +BROKER_CPPFLAGS config.mk /^ BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_TLS$/;" m +BROKER_CPPFLAGS config.mk /^ BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_WEBSOCKETS$/;" m +BROKER_CPPFLAGS config.mk /^ BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_WRAP$/;" m +BROKER_CPPFLAGS config.mk /^ BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -Ideps$/;" m +BROKER_CPPFLAGS config.mk /^BROKER_CPPFLAGS:=$(LIB_CPPFLAGS)$/;" m +BROKER_LDADD config.mk /^ BROKER_LDADD:=$(BROKER_LDADD) -lanl$/;" m +BROKER_LDADD config.mk /^ BROKER_LDADD:=$(BROKER_LDADD) -ldl -lm$/;" m +BROKER_LDADD config.mk /^ BROKER_LDADD:=$(BROKER_LDADD) -lm$/;" m +BROKER_LDADD config.mk /^ BROKER_LDADD:=$(BROKER_LDADD) -lrt$/;" m +BROKER_LDADD config.mk /^ BROKER_LDADD:=$(BROKER_LDADD) -lsocket -lnsl$/;" m +BROKER_LDADD config.mk /^ BROKER_LDADD:=$(BROKER_LDADD) -lsocket$/;" m +BROKER_LDADD config.mk /^ BROKER_LDADD:=$(BROKER_LDADD) -lssl -lcrypto$/;" m +BROKER_LDADD config.mk /^ BROKER_LDADD:=$(BROKER_LDADD) -lsystemd$/;" m +BROKER_LDADD config.mk /^ BROKER_LDADD:=$(BROKER_LDADD) -lwebsockets$/;" m +BROKER_LDADD config.mk /^ BROKER_LDADD:=$(BROKER_LDADD) -lwrap$/;" m +BROKER_LDADD config.mk /^ BROKER_LDADD:=$(BROKER_LDADD) -static -lwebsockets$/;" m +BROKER_LDADD config.mk /^BROKER_LDADD:=$/;" m +BROKER_LDFLAGS config.mk /^ BROKER_LDFLAGS:=$(BROKER_LDFLAGS) -Wl,--dynamic-list=linker.syms$/;" m +BROKER_LDFLAGS config.mk /^ BROKER_LDFLAGS:=$(BROKER_LDFLAGS) -coverage$/;" m +BROKER_LDFLAGS config.mk /^BROKER_LDFLAGS:=${LDFLAGS}$/;" m +BUFLEN src/sys_tree.c 28;" d file: +BrokerMonitor test/broker/03-publish-qos1-queued-bytes.py /^class BrokerMonitor(threading.Thread):$/;" c +CC test/old/Makefile /^CC=cc$/;" m +CDL_APPEND src/deps/utlist.h 860;" d +CDL_APPEND2 src/deps/utlist.h 863;" d +CDL_APPEND_ELEM src/deps/utlist.h 1040;" d +CDL_APPEND_ELEM2 src/deps/utlist.h 1026;" d +CDL_COUNT src/deps/utlist.h 940;" d +CDL_COUNT2 src/deps/utlist.h 943;" d +CDL_DELETE src/deps/utlist.h 926;" d +CDL_DELETE2 src/deps/utlist.h 929;" d +CDL_FOREACH src/deps/utlist.h 949;" d +CDL_FOREACH2 src/deps/utlist.h 952;" d +CDL_FOREACH_SAFE src/deps/utlist.h 955;" d +CDL_FOREACH_SAFE2 src/deps/utlist.h 958;" d +CDL_INSERT_INORDER src/deps/utlist.h 894;" d +CDL_INSERT_INORDER2 src/deps/utlist.h 1046;" d +CDL_INSERT_INORDER2 src/deps/utlist.h 1047;" d +CDL_INSERT_INORDER2 src/deps/utlist.h 897;" d +CDL_LOWER_BOUND src/deps/utlist.h 910;" d +CDL_LOWER_BOUND2 src/deps/utlist.h 913;" d +CDL_PREPEND src/deps/utlist.h 877;" d +CDL_PREPEND2 src/deps/utlist.h 880;" d +CDL_PREPEND_ELEM src/deps/utlist.h 1023;" d +CDL_PREPEND_ELEM2 src/deps/utlist.h 1006;" d +CDL_REPLACE_ELEM src/deps/utlist.h 1003;" d +CDL_REPLACE_ELEM2 src/deps/utlist.h 983;" d +CDL_SEARCH src/deps/utlist.h 973;" d +CDL_SEARCH2 src/deps/utlist.h 976;" d +CDL_SEARCH_SCALAR src/deps/utlist.h 963;" d +CDL_SEARCH_SCALAR2 src/deps/utlist.h 966;" d +CDL_SORT src/deps/utlist.h 235;" d +CDL_SORT2 src/deps/utlist.h 238;" d +CFLAGS config.mk /^ CFLAGS?=-O$/;" m +CFLAGS config.mk /^ CFLAGS?=-Wall -ggdb -O2$/;" m +CFLAGS config.mk /^ CFLAGS?=-Wall -ggdb -O2$/;" m +CFLAGS examples/mysql_log/Makefile /^CFLAGS=-Wall -ggdb$/;" m +CFLAGS examples/temperature_conversion/Makefile /^CFLAGS=-Wall -ggdb -I..\/..\/lib -I..\/..\/lib\/cpp$/;" m +CFLAGS test/broker/c/Makefile /^CFLAGS=-I..\/..\/..\/lib -I..\/..\/..\/src -Wall -Werror$/;" m +CFLAGS test/lib/c/Makefile /^CFLAGS=-I..\/..\/..\/lib -Werror$/;" m +CFLAGS test/lib/cpp/Makefile /^CFLAGS=-I..\/..\/..\/lib -I..\/..\/..\/lib\/cpp -DDEBUG$/;" m +CFLAGS test/old/Makefile /^CFLAGS=-I..\/..\/src -I..\/..\/lib -I. -I..\/.. -Wall -ggdb -DDEBUG -DWITH_CLIENT$/;" m +CFLAGS test/unit/Makefile /^CFLAGS:=$(CFLAGS) -coverage -Wall -ggdb$/;" m +CFLAGS_FINAL src/db_dump/Makefile /^CFLAGS_FINAL=${CFLAGS} -I.. -I..\/..\/lib -I..\/.. -I..\/deps$/;" m +CLIENT_CFLAGS config.mk /^ CLIENT_CFLAGS:=$(CLIENT_CFLAGS) -coverage$/;" m +CLIENT_CFLAGS config.mk /^CLIENT_CFLAGS:=${CFLAGS} -DVERSION="\\"${VERSION}\\""$/;" m +CLIENT_CONFIG_H client/client_shared.h 18;" d +CLIENT_CPPFLAGS config.mk /^ CLIENT_CPPFLAGS:=$(CLIENT_CPPFLAGS) -DWITH_TLS_PSK$/;" m +CLIENT_CPPFLAGS config.mk /^ CLIENT_CPPFLAGS:=$(CLIENT_CPPFLAGS) -DWITH_SOCKS$/;" m +CLIENT_CPPFLAGS config.mk /^ CLIENT_CPPFLAGS:=$(CLIENT_CPPFLAGS) -DWITH_SRV$/;" m +CLIENT_CPPFLAGS config.mk /^ CLIENT_CPPFLAGS:=$(CLIENT_CPPFLAGS) -DWITH_THREADING$/;" m +CLIENT_CPPFLAGS config.mk /^ CLIENT_CPPFLAGS:=$(CLIENT_CPPFLAGS) -DWITH_TLS$/;" m +CLIENT_CPPFLAGS config.mk /^CLIENT_CPPFLAGS:=$(CPPFLAGS) -I.. -I..\/lib$/;" m +CLIENT_LDADD config.mk /^ CLIENT_LDADD:=${CLIENT_LDADD} ..\/lib\/libmosquitto.so.${SOVERSION}$/;" m +CLIENT_LDADD config.mk /^CLIENT_LDADD:=$/;" m +CLIENT_LDFLAGS config.mk /^ CLIENT_LDFLAGS:=$(CLIENT_LDFLAGS) -coverage$/;" m +CLIENT_LDFLAGS config.mk /^CLIENT_LDFLAGS:=$(LDFLAGS) -L..\/lib$/;" m +CLIENT_PUB client/client_shared.h 36;" d +CLIENT_RESPONSE_TOPIC client/client_shared.h 39;" d +CLIENT_RR client/client_shared.h 38;" d +CLIENT_SUB client/client_shared.h 37;" d +CMD_AUTH lib/mqtt_protocol.h 44;" d +CMD_CONNACK lib/mqtt_protocol.h 31;" d +CMD_CONNECT lib/mqtt_protocol.h 30;" d +CMD_DISCONNECT lib/mqtt_protocol.h 43;" d +CMD_PINGREQ lib/mqtt_protocol.h 41;" d +CMD_PINGRESP lib/mqtt_protocol.h 42;" d +CMD_PUBACK lib/mqtt_protocol.h 33;" d +CMD_PUBCOMP lib/mqtt_protocol.h 36;" d +CMD_PUBLISH lib/mqtt_protocol.h 32;" d +CMD_PUBREC lib/mqtt_protocol.h 34;" d +CMD_PUBREL lib/mqtt_protocol.h 35;" d +CMD_SUBACK lib/mqtt_protocol.h 38;" d +CMD_SUBSCRIBE lib/mqtt_protocol.h 37;" d +CMD_UNSUBACK lib/mqtt_protocol.h 40;" d +CMD_UNSUBSCRIBE lib/mqtt_protocol.h 39;" d +CMD_WILL lib/mqtt_protocol.h 47;" d +COMPAT_CLOSE lib/net_mosq.h 34;" d +COMPAT_CLOSE lib/net_mosq.h 38;" d +COMPAT_ECONNRESET lib/net_mosq.h 35;" d +COMPAT_ECONNRESET lib/net_mosq.h 39;" d +COMPAT_EWOULDBLOCK lib/net_mosq.h 36;" d +COMPAT_EWOULDBLOCK lib/net_mosq.h 40;" d +CONFIG_H config.h 2;" d +CONNACK_ACCEPTED lib/mqtt_protocol.h /^ CONNACK_ACCEPTED = 0,$/;" e enum:mqtt311_connack_codes +CONNACK_REFUSED_BAD_USERNAME_PASSWORD lib/mqtt_protocol.h /^ CONNACK_REFUSED_BAD_USERNAME_PASSWORD = 4,$/;" e enum:mqtt311_connack_codes +CONNACK_REFUSED_IDENTIFIER_REJECTED lib/mqtt_protocol.h /^ CONNACK_REFUSED_IDENTIFIER_REJECTED = 2,$/;" e enum:mqtt311_connack_codes +CONNACK_REFUSED_NOT_AUTHORIZED lib/mqtt_protocol.h /^ CONNACK_REFUSED_NOT_AUTHORIZED = 5,$/;" e enum:mqtt311_connack_codes +CONNACK_REFUSED_PROTOCOL_VERSION lib/mqtt_protocol.h /^ CONNACK_REFUSED_PROTOCOL_VERSION = 1,$/;" e enum:mqtt311_connack_codes +CONNACK_REFUSED_SERVER_UNAVAILABLE lib/mqtt_protocol.h /^ CONNACK_REFUSED_SERVER_UNAVAILABLE = 3,$/;" e enum:mqtt311_connack_codes +COUNT examples/subscribe_simple/multiple.c 5;" d file: +CPPFLAGS test/unit/Makefile /^CPPFLAGS:=$(CPPFLAGS) -I..\/.. -I..\/..\/lib -I..\/..\/src -I..\/..\/src\/deps$/;" m +CurrentCostMQTT misc/currentcost/gnome-panel/CurrentCostMQTT.py /^class CurrentCostMQTT(gnomeapplet.Applet):$/;" c +CurrentCostMQTT_factory misc/currentcost/gnome-panel/CurrentCostMQTT.py /^def CurrentCostMQTT_factory(applet, iid):$/;" f +DB_CHUNK_CFG src/persist.h 24;" d +DB_CHUNK_CLIENT src/persist.h 29;" d +DB_CHUNK_CLIENT_MSG src/persist.h 26;" d +DB_CHUNK_MSG_STORE src/persist.h 25;" d +DB_CHUNK_RETAIN src/persist.h 27;" d +DB_CHUNK_SUB src/persist.h 28;" d +DB_HTML_XSL config.mk /^DB_HTML_XSL=man\/html.xsl$/;" m +DECLTYPE src/deps/uthash.h 37;" d +DECLTYPE src/deps/uthash.h 40;" d +DECLTYPE src/deps/uthash.h 43;" d +DECLTYPE_ASSIGN src/deps/uthash.h 47;" d +DECLTYPE_ASSIGN src/deps/uthash.h 53;" d +DEMO_PROTOCOL_COUNT src/websockets.c /^ DEMO_PROTOCOL_COUNT$/;" e enum:mosq_ws_protocols file: +DEPRECATED lib/cpp/mosquittopp.h 31;" d +DEPRECATED lib/cpp/mosquittopp.h 33;" d +DIRS Makefile /^DIRS=lib client src$/;" m +DISTDIRS Makefile /^DISTDIRS=man$/;" m +DISTFILES Makefile /^DISTFILES= \\$/;" m +DL_APPEND src/deps/utlist.h 636;" d +DL_APPEND2 src/deps/utlist.h 639;" d +DL_APPEND_ELEM src/deps/utlist.h 821;" d +DL_APPEND_ELEM2 src/deps/utlist.h 803;" d +DL_CONCAT src/deps/utlist.h 685;" d +DL_CONCAT2 src/deps/utlist.h 688;" d +DL_COUNT src/deps/utlist.h 725;" d +DL_COUNT2 src/deps/utlist.h 728;" d +DL_DELETE src/deps/utlist.h 703;" d +DL_DELETE2 src/deps/utlist.h 706;" d +DL_FOREACH src/deps/utlist.h 734;" d +DL_FOREACH2 src/deps/utlist.h 737;" d +DL_FOREACH_SAFE src/deps/utlist.h 741;" d +DL_FOREACH_SAFE src/handle_connect.c /^ DL_FOREACH_SAFE((*head), msg_tail, tmp){$/;" f +DL_FOREACH_SAFE src/session_expiry.c /^ DL_FOREACH_SAFE(expiry_list, item, tmp){$/;" f +DL_FOREACH_SAFE src/will_delay.c /^ DL_FOREACH_SAFE(delay_list, item, tmp){$/;" f +DL_FOREACH_SAFE2 src/deps/utlist.h 744;" d +DL_INSERT_INORDER src/deps/utlist.h 653;" d +DL_INSERT_INORDER2 src/deps/utlist.h 656;" d +DL_INSERT_INORDER2 src/deps/utlist.h 827;" d +DL_INSERT_INORDER2 src/deps/utlist.h 828;" d +DL_LOWER_BOUND src/deps/utlist.h 669;" d +DL_LOWER_BOUND2 src/deps/utlist.h 672;" d +DL_PREPEND src/deps/utlist.h 621;" d +DL_PREPEND2 src/deps/utlist.h 624;" d +DL_PREPEND_ELEM src/deps/utlist.h 800;" d +DL_PREPEND_ELEM2 src/deps/utlist.h 782;" d +DL_REPLACE_ELEM src/deps/utlist.h 779;" d +DL_REPLACE_ELEM2 src/deps/utlist.h 753;" d +DL_SEARCH src/deps/utlist.h 749;" d +DL_SEARCH2 src/deps/utlist.h 751;" d +DL_SEARCH_SCALAR src/deps/utlist.h 748;" d +DL_SEARCH_SCALAR2 src/deps/utlist.h 750;" d +DL_SORT src/deps/utlist.h 172;" d +DL_SORT2 src/deps/utlist.h 175;" d +DOCDIRS Makefile /^DOCDIRS=man$/;" m +DUMMYPTHREAD_H lib/dummypthread.h 2;" d +ELMT_FROM_HH src/deps/uthash.h 92;" d +ENGINE_FINISH lib/net_mosq.h 76;" d +ENGINE_PIN lib/net_mosq.h 79;" d +ENGINE_SECRET_MODE lib/net_mosq.h 77;" d +ENGINE_SECRET_MODE_SHA lib/net_mosq.h 78;" d +EPROTO config.h 28;" d +F src/persist.h /^ struct PF_client F;$/;" m struct:P_client typeref:struct:P_client::PF_client +F src/persist.h /^ struct PF_client_msg F;$/;" m struct:P_client_msg typeref:struct:P_client_msg::PF_client_msg +F src/persist.h /^ struct PF_msg_store F;$/;" m struct:P_msg_store typeref:struct:P_msg_store::PF_msg_store +F src/persist.h /^ struct PF_retain F;$/;" m struct:P_retain typeref:struct:P_retain::PF_retain +F src/persist.h /^ struct PF_sub F;$/;" m struct:P_sub typeref:struct:P_sub::PF_sub +FINAL_WITH_TLS_PSK config.h 47;" d +FUNC_auth_plugin_acl_check_v2 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_acl_check_v2)(void *, const char *, const char *, const char *, int);$/;" t +FUNC_auth_plugin_acl_check_v3 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_acl_check_v3)(void *, int, const struct mosquitto *, struct mosquitto_acl_msg *);$/;" t +FUNC_auth_plugin_acl_check_v4 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_acl_check_v4)(void *, int, struct mosquitto *, struct mosquitto_acl_msg *);$/;" t +FUNC_auth_plugin_auth_continue_v4 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_auth_continue_v4)(void *, struct mosquitto *, const char *, const void *, uint16_t, void **, uint16_t *);$/;" t +FUNC_auth_plugin_auth_start_v4 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_auth_start_v4)(void *, struct mosquitto *, const char *, bool, const void *, uint16_t, void **, uint16_t *);$/;" t +FUNC_auth_plugin_cleanup_v2 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_cleanup_v2)(void *, struct mosquitto_auth_opt *, int);$/;" t +FUNC_auth_plugin_cleanup_v3 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_cleanup_v3)(void *, struct mosquitto_opt *, int);$/;" t +FUNC_auth_plugin_cleanup_v4 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_cleanup_v4)(void *, struct mosquitto_opt *, int);$/;" t +FUNC_auth_plugin_init_v2 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_init_v2)(void **, struct mosquitto_auth_opt *, int);$/;" t +FUNC_auth_plugin_init_v3 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_init_v3)(void **, struct mosquitto_opt *, int);$/;" t +FUNC_auth_plugin_init_v4 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_init_v4)(void **, struct mosquitto_opt *, int);$/;" t +FUNC_auth_plugin_psk_key_get_v2 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_psk_key_get_v2)(void *, const char *, const char *, char *, int);$/;" t +FUNC_auth_plugin_psk_key_get_v3 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_psk_key_get_v3)(void *, const struct mosquitto *, const char *, const char *, char *, int);$/;" t +FUNC_auth_plugin_psk_key_get_v4 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_psk_key_get_v4)(void *, struct mosquitto *, const char *, const char *, char *, int);$/;" t +FUNC_auth_plugin_security_cleanup_v2 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_security_cleanup_v2)(void *, struct mosquitto_auth_opt *, int, bool);$/;" t +FUNC_auth_plugin_security_cleanup_v3 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_security_cleanup_v3)(void *, struct mosquitto_opt *, int, bool);$/;" t +FUNC_auth_plugin_security_cleanup_v4 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_security_cleanup_v4)(void *, struct mosquitto_opt *, int, bool);$/;" t +FUNC_auth_plugin_security_init_v2 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_security_init_v2)(void *, struct mosquitto_auth_opt *, int, bool);$/;" t +FUNC_auth_plugin_security_init_v3 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_security_init_v3)(void *, struct mosquitto_opt *, int, bool);$/;" t +FUNC_auth_plugin_security_init_v4 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_security_init_v4)(void *, struct mosquitto_opt *, int, bool);$/;" t +FUNC_auth_plugin_unpwd_check_v2 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_unpwd_check_v2)(void *, const char *, const char *);$/;" t +FUNC_auth_plugin_unpwd_check_v3 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_unpwd_check_v3)(void *, const struct mosquitto *, const char *, const char *);$/;" t +FUNC_auth_plugin_unpwd_check_v4 src/mosquitto_broker_internal.h /^typedef int (*FUNC_auth_plugin_unpwd_check_v4)(void *, struct mosquitto *, const char *, const char *);$/;" t +FUNC_auth_plugin_version src/security.c /^typedef int (*FUNC_auth_plugin_version)(void);$/;" t file: +G_BYTES_RECEIVED_INC lib/packet_datatypes.c 40;" d file: +G_BYTES_RECEIVED_INC lib/packet_mosq.c 41;" d file: +G_BYTES_RECEIVED_INC src/sys_tree.h 34;" d +G_BYTES_RECEIVED_INC src/sys_tree.h 49;" d +G_BYTES_SENT_INC lib/packet_datatypes.c 41;" d file: +G_BYTES_SENT_INC lib/packet_mosq.c 42;" d file: +G_BYTES_SENT_INC src/sys_tree.h 35;" d +G_BYTES_SENT_INC src/sys_tree.h 50;" d +G_CLIENTS_EXPIRED_INC src/sys_tree.h 43;" d +G_CLIENTS_EXPIRED_INC src/sys_tree.h 58;" d +G_CONNECTION_COUNT_INC src/sys_tree.h 45;" d +G_CONNECTION_COUNT_INC src/sys_tree.h 60;" d +G_MSGS_DROPPED_INC src/sys_tree.h 42;" d +G_MSGS_DROPPED_INC src/sys_tree.h 57;" d +G_MSGS_RECEIVED_INC src/sys_tree.h 38;" d +G_MSGS_RECEIVED_INC src/sys_tree.h 53;" d +G_MSGS_SENT_INC lib/packet_datatypes.c 42;" d file: +G_MSGS_SENT_INC lib/packet_mosq.c 43;" d file: +G_MSGS_SENT_INC src/sys_tree.h 39;" d +G_MSGS_SENT_INC src/sys_tree.h 54;" d +G_PUB_BYTES_RECEIVED_INC src/sys_tree.h 36;" d +G_PUB_BYTES_RECEIVED_INC src/sys_tree.h 51;" d +G_PUB_BYTES_SENT_INC lib/send_mosq.c 27;" d file: +G_PUB_BYTES_SENT_INC lib/send_publish.c 26;" d file: +G_PUB_BYTES_SENT_INC src/sys_tree.h 37;" d +G_PUB_BYTES_SENT_INC src/sys_tree.h 52;" d +G_PUB_MSGS_RECEIVED_INC src/sys_tree.h 40;" d +G_PUB_MSGS_RECEIVED_INC src/sys_tree.h 55;" d +G_PUB_MSGS_SENT_INC lib/packet_datatypes.c 43;" d file: +G_PUB_MSGS_SENT_INC lib/packet_mosq.c 44;" d file: +G_PUB_MSGS_SENT_INC src/sys_tree.h 41;" d +G_PUB_MSGS_SENT_INC src/sys_tree.h 56;" d +G_SOCKET_CONNECTIONS_INC src/sys_tree.h 44;" d +G_SOCKET_CONNECTIONS_INC src/sys_tree.h 59;" d +HASH_ADD src/deps/uthash.h 160;" d +HASH_ADD_INT src/deps/uthash.h 260;" d +HASH_ADD_KEYPTR src/deps/uthash.h 173;" d +HASH_ADD_PTR src/deps/uthash.h 266;" d +HASH_ADD_STR src/deps/uthash.h 254;" d +HASH_ADD_TO_BKT src/deps/uthash.h 611;" d +HASH_BER src/deps/uthash.h 355;" d +HASH_BKT_CAPACITY_THRESH src/deps/uthash.h 89;" d +HASH_BLOOM_ADD src/deps/uthash.h 127;" d +HASH_BLOOM_ADD src/deps/uthash.h 136;" d +HASH_BLOOM_BITLEN src/deps/uthash.h 108;" d +HASH_BLOOM_BITSET src/deps/uthash.h 124;" d +HASH_BLOOM_BITTEST src/deps/uthash.h 125;" d +HASH_BLOOM_BYTELEN src/deps/uthash.h 109;" d +HASH_BLOOM_BYTELEN src/deps/uthash.h 138;" d +HASH_BLOOM_FREE src/deps/uthash.h 119;" d +HASH_BLOOM_FREE src/deps/uthash.h 135;" d +HASH_BLOOM_MAKE src/deps/uthash.h 110;" d +HASH_BLOOM_MAKE src/deps/uthash.h 134;" d +HASH_BLOOM_SIGNATURE src/deps/uthash.h 902;" d +HASH_BLOOM_TEST src/deps/uthash.h 130;" d +HASH_BLOOM_TEST src/deps/uthash.h 137;" d +HASH_CLEAR src/deps/uthash.h 849;" d +HASH_CNT src/deps/uthash.h 878;" d +HASH_COUNT src/deps/uthash.h 877;" d +HASH_DEL src/deps/uthash.h 270;" d +HASH_DELETE src/deps/uthash.h 215;" d +HASH_DEL_IN_BKT src/deps/uthash.h 625;" d +HASH_EMIT_KEY src/deps/uthash.h 337;" d +HASH_EMIT_KEY src/deps/uthash.h 344;" d +HASH_EXPAND_BUCKETS src/deps/uthash.h 666;" d +HASH_FCN src/deps/uthash.h 349;" d +HASH_FCN src/deps/uthash.h 351;" d +HASH_FIND src/deps/uthash.h 94;" d +HASH_FIND_INT src/deps/uthash.h 258;" d +HASH_FIND_IN_BKT src/deps/uthash.h 597;" d +HASH_FIND_PTR src/deps/uthash.h 264;" d +HASH_FIND_STR src/deps/uthash.h 252;" d +HASH_FNV src/deps/uthash.h 377;" d +HASH_FSCK src/deps/uthash.h 278;" d +HASH_FSCK src/deps/uthash.h 330;" d +HASH_INITIAL_NUM_BUCKETS src/deps/uthash.h 87;" d +HASH_INITIAL_NUM_BUCKETS_LOG2 src/deps/uthash.h 88;" d +HASH_ITER src/db_dump/db_dump.c /^ HASH_ITER(hh_id, clients_by_id, cc, cc_tmp){$/;" f +HASH_ITER src/deps/uthash.h 867;" d +HASH_ITER src/deps/uthash.h 871;" d +HASH_ITER src/mosquitto.c /^ HASH_ITER(hh_id, int_db.contexts_by_id, ctxt, ctxt_tmp){$/;" f +HASH_ITER src/mosquitto.c /^ HASH_ITER(hh_sock, int_db.contexts_by_sock, ctxt, ctxt_tmp){$/;" f +HASH_ITER src/security_default.c /^ HASH_ITER(hh, (*psk_id), u, tmp){$/;" f +HASH_ITER src/security_default.c /^ HASH_ITER(hh, psk_id_ref, u, tmp){$/;" f +HASH_ITER src/security_default.c /^ HASH_ITER(hh, unpwd_ref, u, tmp){$/;" f +HASH_ITER src/subs.c /^ HASH_ITER(hh, root, branch, branch_tmp){$/;" f +HASH_JEN src/deps/uthash.h 416;" d +HASH_JEN_MIX src/deps/uthash.h 403;" d +HASH_KEYCMP src/deps/uthash.h 594;" d +HASH_MAKE_TABLE src/deps/uthash.h 141;" d +HASH_MUR src/deps/uthash.h 554;" d +HASH_OAT src/deps/uthash.h 387;" d +HASH_OOPS src/deps/uthash.h 277;" d +HASH_OVERHEAD src/deps/uthash.h 860;" d +HASH_REPLACE src/deps/uthash.h 163;" d +HASH_REPLACE_INT src/deps/uthash.h 262;" d +HASH_REPLACE_PTR src/deps/uthash.h 268;" d +HASH_REPLACE_STR src/deps/uthash.h 256;" d +HASH_SAX src/deps/uthash.h 367;" d +HASH_SELECT src/deps/uthash.h 811;" d +HASH_SFH src/deps/uthash.h 468;" d +HASH_SIGNATURE src/deps/uthash.h 901;" d +HASH_SORT src/deps/uthash.h 718;" d +HASH_SRT src/deps/uthash.h 719;" d +HASH_TO_BKT src/deps/uthash.h 198;" d +HAVE_GETRANDOM lib/util_mosq.c 34;" d file: +HAVE_NETINET_IN_H config.h 12;" d +HAVE_PSELECT lib/loop.c 34;" d file: +HAVE_PTHREAD_CANCEL config.h 66;" d +HOST test/old/msgsps_common.h 1;" d +IF_NO_DECLTYPE src/deps/utlist.h 84;" d +IF_NO_DECLTYPE src/deps/utlist.h 94;" d +INSTALL config.mk /^INSTALL?=install$/;" m +INVALID_SOCKET lib/net_mosq.h 45;" d +LDADD test/unit/Makefile /^LDADD:=$(LDADD) -lcunit$/;" m +LDECLTYPE src/deps/utlist.h 69;" d +LDECLTYPE src/deps/utlist.h 76;" d +LDECLTYPE src/deps/utlist.h 85;" d +LDFLAGS examples/mysql_log/Makefile /^LDFLAGS=..\/..\/lib\/libmosquitto.so.1 -lmysqlclient$/;" m +LDFLAGS examples/temperature_conversion/Makefile /^LDFLAGS=-L..\/..\/lib ..\/..\/lib\/cpp\/libmosquittopp.so.1 ..\/..\/lib\/libmosquitto.so.1$/;" m +LDFLAGS test/old/Makefile /^LDFLAGS=$/;" m +LDFLAGS test/unit/Makefile /^LDFLAGS:=$(LDFLAGS) -coverage$/;" m +LD_LIBRARY_PATH test/lib/Makefile /^LD_LIBRARY_PATH=..\/..\/lib$/;" m +LIBMOSQUITTO_MAJOR lib/mosquitto.h 49;" d +LIBMOSQUITTO_MINOR lib/mosquitto.h 50;" d +LIBMOSQUITTO_REVISION lib/mosquitto.h 51;" d +LIBMOSQUITTO_VERSION_NUMBER lib/mosquitto.h 53;" d +LIBS test/lib/c/Makefile /^LIBS=..\/..\/..\/lib\/libmosquitto.so.1$/;" m +LIBS test/lib/cpp/Makefile /^LIBS=..\/..\/..\/lib\/libmosquitto.so.1 ..\/..\/..\/lib\/cpp\/libmosquittopp.so.1$/;" m +LIB_CFLAGS config.mk /^ LIB_CFLAGS:=$(LIB_CFLAGS) -fPIC$/;" m +LIB_CFLAGS config.mk /^ LIB_CFLAGS:=$(LIB_CFLAGS) -xc99 -KPIC$/;" m +LIB_CFLAGS config.mk /^ LIB_CFLAGS:=$(LIB_CFLAGS) -coverage$/;" m +LIB_CFLAGS config.mk /^ LIB_CFLAGS:=$(LIB_CFLAGS) -fPIC$/;" m +LIB_CFLAGS config.mk /^LIB_CFLAGS:=$(CFLAGS)$/;" m +LIB_CLOSE src/lib_load.h 28;" d +LIB_CLOSE src/lib_load.h 32;" d +LIB_CPPFLAGS config.mk /^ LIB_CPPFLAGS:=$(LIB_CPPFLAGS) -DWITH_TLS_PSK$/;" m +LIB_CPPFLAGS config.mk /^ LIB_CPPFLAGS:=$(LIB_CPPFLAGS) -DWITH_SOCKS$/;" m +LIB_CPPFLAGS config.mk /^ LIB_CPPFLAGS:=$(LIB_CPPFLAGS) -DWITH_SRV$/;" m +LIB_CPPFLAGS config.mk /^ LIB_CPPFLAGS:=$(LIB_CPPFLAGS) -DWITH_THREADING$/;" m +LIB_CPPFLAGS config.mk /^ LIB_CPPFLAGS:=$(LIB_CPPFLAGS) -DWITH_TLS$/;" m +LIB_CPPFLAGS config.mk /^LIB_CPPFLAGS=$(CPPFLAGS) -I. -I.. -I..\/lib -I..\/src\/deps$/;" m +LIB_CXXFLAGS config.mk /^ LIB_CXXFLAGS:=$(LIB_CXXFLAGS) -KPIC$/;" m +LIB_CXXFLAGS config.mk /^ LIB_CXXFLAGS:=$(LIB_CXXFLAGS) -fPIC$/;" m +LIB_CXXFLAGS config.mk /^ LIB_CXXFLAGS:=$(LIB_CXXFLAGS) -fPIC$/;" m +LIB_CXXFLAGS config.mk /^LIB_CXXFLAGS:=$(CXXFLAGS)$/;" m +LIB_DEP test/random/Makefile /^LIB_DEP:=..\/..\/lib\/libmosquitto.a$/;" m +LIB_DEP test/random/Makefile /^LIB_DEP:=..\/..\/lib\/libmosquitto.so.${SOVERSION}$/;" m +LIB_ERROR src/security.c /^void LIB_ERROR(void)$/;" f +LIB_LDFLAGS config.mk /^ LIB_LDFLAGS:=$(LIB_LDFLAGS) -Wl,--version-script=linker.version -Wl,-soname,libmosquitto.so.$(SOVERSION)$/;" m +LIB_LDFLAGS config.mk /^ LIB_LDFLAGS:=$(LIB_LDFLAGS) -coverage$/;" m +LIB_LDFLAGS config.mk /^LIB_LDFLAGS:=$(LDFLAGS)$/;" m +LIB_LDFLAGS lib/cpp/Makefile /^ LIB_LDFLAGS:=$(LDFLAGS) -Wl,-soname,libmosquittopp.so.${SOVERSION}$/;" m +LIB_LIBADD config.mk /^ LIB_LIBADD:=$(LIB_LIBADD) -lcares$/;" m +LIB_LIBADD config.mk /^ LIB_LIBADD:=$(LIB_LIBADD) -lpthread$/;" m +LIB_LIBADD config.mk /^ LIB_LIBADD:=$(LIB_LIBADD) -lrt$/;" m +LIB_LIBADD config.mk /^ LIB_LIBADD:=$(LIB_LIBADD) -lsocket -lnsl$/;" m +LIB_LIBADD config.mk /^ LIB_LIBADD:=$(LIB_LIBADD) -lsocket$/;" m +LIB_LIBADD config.mk /^ LIB_LIBADD:=$(LIB_LIBADD) -lssl -lcrypto$/;" m +LIB_LIBADD config.mk /^LIB_LIBADD:=$(LIBADD)$/;" m +LIB_LOAD src/lib_load.h 27;" d +LIB_LOAD src/lib_load.h 31;" d +LIB_LOAD_H src/lib_load.h 18;" d +LIB_OBJS test/unit/Makefile /^LIB_OBJS = memory_mosq.o \\$/;" m +LIB_SYM src/lib_load.h 29;" d +LIB_SYM src/lib_load.h 33;" d +LIB_SYM_EASY src/lib_load.h 36;" d +LL_APPEND src/deps/utlist.h 338;" d +LL_APPEND2 src/deps/utlist.h 341;" d +LL_APPEND2 src/deps/utlist.h 526;" d +LL_APPEND2 src/deps/utlist.h 527;" d +LL_APPEND_ELEM src/deps/utlist.h 506;" d +LL_APPEND_ELEM2 src/deps/utlist.h 494;" d +LL_CONCAT src/deps/utlist.h 323;" d +LL_CONCAT2 src/deps/utlist.h 326;" d +LL_CONCAT2 src/deps/utlist.h 512;" d +LL_CONCAT2 src/deps/utlist.h 513;" d +LL_COUNT src/deps/utlist.h 404;" d +LL_COUNT2 src/deps/utlist.h 407;" d +LL_DELETE src/deps/utlist.h 385;" d +LL_DELETE2 src/deps/utlist.h 388;" d +LL_DELETE2 src/deps/utlist.h 556;" d +LL_DELETE2 src/deps/utlist.h 557;" d +LL_FOREACH src/deps/utlist.h 413;" d +LL_FOREACH2 src/deps/utlist.h 416;" d +LL_FOREACH_SAFE src/deps/utlist.h 419;" d +LL_FOREACH_SAFE2 src/deps/utlist.h 422;" d +LL_INSERT_INORDER src/deps/utlist.h 354;" d +LL_INSERT_INORDER2 src/deps/utlist.h 357;" d +LL_INSERT_INORDER2 src/deps/utlist.h 539;" d +LL_INSERT_INORDER2 src/deps/utlist.h 540;" d +LL_LOWER_BOUND src/deps/utlist.h 369;" d +LL_LOWER_BOUND2 src/deps/utlist.h 372;" d +LL_PREPEND src/deps/utlist.h 314;" d +LL_PREPEND2 src/deps/utlist.h 317;" d +LL_PREPEND_ELEM src/deps/utlist.h 491;" d +LL_PREPEND_ELEM2 src/deps/utlist.h 468;" d +LL_PREPEND_ELEM2 src/deps/utlist.h 593;" d +LL_PREPEND_ELEM2 src/deps/utlist.h 594;" d +LL_REPLACE_ELEM src/deps/utlist.h 465;" d +LL_REPLACE_ELEM2 src/deps/utlist.h 445;" d +LL_REPLACE_ELEM2 src/deps/utlist.h 573;" d +LL_REPLACE_ELEM2 src/deps/utlist.h 574;" d +LL_SEARCH src/deps/utlist.h 435;" d +LL_SEARCH2 src/deps/utlist.h 438;" d +LL_SEARCH_SCALAR src/deps/utlist.h 425;" d +LL_SEARCH_SCALAR2 src/deps/utlist.h 428;" d +LL_SORT src/deps/utlist.h 108;" d +LL_SORT2 src/deps/utlist.h 111;" d +LOGGING_MOSQ_H lib/logging_mosq.h 17;" d +MAKE_ALL config.mk /^ MAKE_ALL:=$(MAKE_ALL) docs$/;" m +MAKE_ALL config.mk /^MAKE_ALL:=mosquitto$/;" m +MANPAGES man/Makefile /^MANPAGES = \\$/;" m +MAX_BUFFER_LEN src/mosquitto_passwd.c 52;" d file: +MAX_EVENTS src/loop.c 28;" d file: +MEMORY_MOSQ_H lib/memory_mosq.h 18;" d +MESSAGES_MOSQ_H lib/messages_mosq.h 17;" d +MESSAGE_COUNT test/old/msgsps_common.h 7;" d +MESSAGE_SIZE test/old/msgsps_common.h 8;" d +MOSQUITTOPP_H lib/cpp/mosquittopp.h 18;" d +MOSQUITTO_BROKER_H src/mosquitto_broker.h 18;" d +MOSQUITTO_BROKER_INTERNAL_H src/mosquitto_broker_internal.h 19;" d +MOSQUITTO_H lib/mosquitto.h 18;" d +MOSQUITTO_INTERNAL_H lib/mosquitto_internal.h 19;" d +MOSQUITTO_PLUGIN_H src/mosquitto_plugin.h 18;" d +MOSQUITTO_PLUGIN_H test/broker/c/mosquitto_plugin_v2.h 18;" d +MOSQ_ACL_NONE src/mosquitto_plugin.h 26;" d +MOSQ_ACL_NONE test/broker/c/mosquitto_plugin_v2.h 22;" d +MOSQ_ACL_READ src/mosquitto_plugin.h 27;" d +MOSQ_ACL_READ test/broker/c/mosquitto_plugin_v2.h 23;" d +MOSQ_ACL_SUBSCRIBE src/mosquitto_plugin.h 29;" d +MOSQ_ACL_WRITE src/mosquitto_plugin.h 28;" d +MOSQ_ACL_WRITE test/broker/c/mosquitto_plugin_v2.h 24;" d +MOSQ_AUTH_PLUGIN_VERSION src/mosquitto_plugin.h 24;" d +MOSQ_AUTH_PLUGIN_VERSION test/broker/c/mosquitto_plugin_v2.h 20;" d +MOSQ_DB_VERSION src/persist.h 20;" d +MOSQ_ERR_ACL_DENIED lib/mosquitto.h /^ MOSQ_ERR_ACL_DENIED = 12,$/;" e enum:mosq_err_t +MOSQ_ERR_ACL_DENIED test/broker/c/auth_plugin_v2.c /^ MOSQ_ERR_ACL_DENIED = 12$/;" e enum:mosq_err_t file: +MOSQ_ERR_AUTH lib/mosquitto.h /^ MOSQ_ERR_AUTH = 11,$/;" e enum:mosq_err_t +MOSQ_ERR_AUTH test/broker/c/auth_plugin_v2.c /^ MOSQ_ERR_AUTH = 11,$/;" e enum:mosq_err_t file: +MOSQ_ERR_AUTH_CONTINUE lib/mosquitto.h /^ MOSQ_ERR_AUTH_CONTINUE = -4,$/;" e enum:mosq_err_t +MOSQ_ERR_CONN_LOST lib/mosquitto.h /^ MOSQ_ERR_CONN_LOST = 7,$/;" e enum:mosq_err_t +MOSQ_ERR_CONN_PENDING lib/mosquitto.h /^ MOSQ_ERR_CONN_PENDING = -1,$/;" e enum:mosq_err_t +MOSQ_ERR_CONN_REFUSED lib/mosquitto.h /^ MOSQ_ERR_CONN_REFUSED = 5,$/;" e enum:mosq_err_t +MOSQ_ERR_DUPLICATE_PROPERTY lib/mosquitto.h /^ MOSQ_ERR_DUPLICATE_PROPERTY = 22,$/;" e enum:mosq_err_t +MOSQ_ERR_EAI lib/mosquitto.h /^ MOSQ_ERR_EAI = 15,$/;" e enum:mosq_err_t +MOSQ_ERR_ERRNO lib/mosquitto.h /^ MOSQ_ERR_ERRNO = 14,$/;" e enum:mosq_err_t +MOSQ_ERR_INVAL lib/mosquitto.h /^ MOSQ_ERR_INVAL = 3,$/;" e enum:mosq_err_t +MOSQ_ERR_KEEPALIVE lib/mosquitto.h /^ MOSQ_ERR_KEEPALIVE = 19,$/;" e enum:mosq_err_t +MOSQ_ERR_LOOKUP lib/mosquitto.h /^ MOSQ_ERR_LOOKUP = 20,$/;" e enum:mosq_err_t +MOSQ_ERR_MALFORMED_PACKET lib/mosquitto.h /^ MOSQ_ERR_MALFORMED_PACKET = 21,$/;" e enum:mosq_err_t +MOSQ_ERR_MALFORMED_UTF8 lib/mosquitto.h /^ MOSQ_ERR_MALFORMED_UTF8 = 18,$/;" e enum:mosq_err_t +MOSQ_ERR_NOMEM lib/mosquitto.h /^ MOSQ_ERR_NOMEM = 1,$/;" e enum:mosq_err_t +MOSQ_ERR_NOT_FOUND lib/mosquitto.h /^ MOSQ_ERR_NOT_FOUND = 6,$/;" e enum:mosq_err_t +MOSQ_ERR_NOT_SUPPORTED lib/mosquitto.h /^ MOSQ_ERR_NOT_SUPPORTED = 10,$/;" e enum:mosq_err_t +MOSQ_ERR_NO_CONN lib/mosquitto.h /^ MOSQ_ERR_NO_CONN = 4,$/;" e enum:mosq_err_t +MOSQ_ERR_NO_SUBSCRIBERS lib/mosquitto.h /^ MOSQ_ERR_NO_SUBSCRIBERS = -3,$/;" e enum:mosq_err_t +MOSQ_ERR_OCSP lib/mosquitto.h /^ MOSQ_ERR_OCSP = 26,$/;" e enum:mosq_err_t +MOSQ_ERR_OVERSIZE_PACKET lib/mosquitto.h /^ MOSQ_ERR_OVERSIZE_PACKET = 25,$/;" e enum:mosq_err_t +MOSQ_ERR_PAYLOAD_SIZE lib/mosquitto.h /^ MOSQ_ERR_PAYLOAD_SIZE = 9,$/;" e enum:mosq_err_t +MOSQ_ERR_PLUGIN_DEFER lib/mosquitto.h /^ MOSQ_ERR_PLUGIN_DEFER = 17,$/;" e enum:mosq_err_t +MOSQ_ERR_PROTOCOL lib/mosquitto.h /^ MOSQ_ERR_PROTOCOL = 2,$/;" e enum:mosq_err_t +MOSQ_ERR_PROXY lib/mosquitto.h /^ MOSQ_ERR_PROXY = 16,$/;" e enum:mosq_err_t +MOSQ_ERR_QOS_NOT_SUPPORTED lib/mosquitto.h /^ MOSQ_ERR_QOS_NOT_SUPPORTED = 24,$/;" e enum:mosq_err_t +MOSQ_ERR_SUB_EXISTS lib/mosquitto.h /^ MOSQ_ERR_SUB_EXISTS = -2,$/;" e enum:mosq_err_t +MOSQ_ERR_SUCCESS lib/mosquitto.h /^ MOSQ_ERR_SUCCESS = 0,$/;" e enum:mosq_err_t +MOSQ_ERR_SUCCESS test/broker/c/auth_plugin_v2.c /^ MOSQ_ERR_SUCCESS = 0,$/;" e enum:mosq_err_t file: +MOSQ_ERR_TLS lib/mosquitto.h /^ MOSQ_ERR_TLS = 8,$/;" e enum:mosq_err_t +MOSQ_ERR_TLS_HANDSHAKE lib/mosquitto.h /^ MOSQ_ERR_TLS_HANDSHAKE = 23,$/;" e enum:mosq_err_t +MOSQ_ERR_UNKNOWN lib/mosquitto.h /^ MOSQ_ERR_UNKNOWN = 13,$/;" e enum:mosq_err_t +MOSQ_LOG_ALL lib/mosquitto.h 66;" d +MOSQ_LOG_DEBUG lib/mosquitto.h 61;" d +MOSQ_LOG_ERR lib/mosquitto.h 60;" d +MOSQ_LOG_INFO lib/mosquitto.h 57;" d +MOSQ_LOG_INTERNAL lib/mosquitto.h 65;" d +MOSQ_LOG_NONE lib/mosquitto.h 56;" d +MOSQ_LOG_NOTICE lib/mosquitto.h 58;" d +MOSQ_LOG_SUBSCRIBE lib/mosquitto.h 62;" d +MOSQ_LOG_UNSUBSCRIBE lib/mosquitto.h 63;" d +MOSQ_LOG_WARNING lib/mosquitto.h 59;" d +MOSQ_LOG_WEBSOCKETS lib/mosquitto.h 64;" d +MOSQ_LSB lib/net_mosq.h 50;" d +MOSQ_MQTT_ID_MAX_LENGTH lib/mosquitto.h 119;" d +MOSQ_MSB lib/net_mosq.h 49;" d +MOSQ_OBJS lib/Makefile /^MOSQ_OBJS=mosquitto.o \\$/;" m +MOSQ_OPT_PROTOCOL_VERSION lib/mosquitto.h /^ MOSQ_OPT_PROTOCOL_VERSION = 1,$/;" e enum:mosq_opt_t +MOSQ_OPT_RECEIVE_MAXIMUM lib/mosquitto.h /^ MOSQ_OPT_RECEIVE_MAXIMUM = 4,$/;" e enum:mosq_opt_t +MOSQ_OPT_SEND_MAXIMUM lib/mosquitto.h /^ MOSQ_OPT_SEND_MAXIMUM = 5,$/;" e enum:mosq_opt_t +MOSQ_OPT_SSL_CTX lib/mosquitto.h /^ MOSQ_OPT_SSL_CTX = 2,$/;" e enum:mosq_opt_t +MOSQ_OPT_SSL_CTX_WITH_DEFAULTS lib/mosquitto.h /^ MOSQ_OPT_SSL_CTX_WITH_DEFAULTS = 3,$/;" e enum:mosq_opt_t +MOSQ_OPT_TLS_ALPN lib/mosquitto.h /^ MOSQ_OPT_TLS_ALPN = 10,$/;" e enum:mosq_opt_t +MOSQ_OPT_TLS_ENGINE lib/mosquitto.h /^ MOSQ_OPT_TLS_ENGINE = 7,$/;" e enum:mosq_opt_t +MOSQ_OPT_TLS_ENGINE_KPASS_SHA1 lib/mosquitto.h /^ MOSQ_OPT_TLS_ENGINE_KPASS_SHA1 = 8,$/;" e enum:mosq_opt_t +MOSQ_OPT_TLS_KEYFORM lib/mosquitto.h /^ MOSQ_OPT_TLS_KEYFORM = 6,$/;" e enum:mosq_opt_t +MOSQ_OPT_TLS_OCSP_REQUIRED lib/mosquitto.h /^ MOSQ_OPT_TLS_OCSP_REQUIRED = 9,$/;" e enum:mosq_opt_t +MOSQ_PAYLOAD_UNION_SIZE src/mosquitto_broker_internal.h 118;" d +MQTT3_LOG_ALL src/mosquitto_broker_internal.h 69;" d +MQTT3_LOG_FILE src/mosquitto_broker_internal.h 65;" d +MQTT3_LOG_NONE src/mosquitto_broker_internal.h 63;" d +MQTT3_LOG_STDERR src/mosquitto_broker_internal.h 67;" d +MQTT3_LOG_STDOUT src/mosquitto_broker_internal.h 66;" d +MQTT3_LOG_SYSLOG src/mosquitto_broker_internal.h 64;" d +MQTT3_LOG_TOPIC src/mosquitto_broker_internal.h 68;" d +MQTT_MAX_PAYLOAD lib/mqtt_protocol.h 156;" d +MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER lib/mqtt_protocol.h /^ MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER = 18, \/* UTF-8 string : CONNACK *\/$/;" e enum:mqtt5_property +MQTT_PROP_AUTHENTICATION_DATA lib/mqtt_protocol.h /^ MQTT_PROP_AUTHENTICATION_DATA = 22, \/* Binary Data : CONNECT, CONNACK, AUTH *\/$/;" e enum:mqtt5_property +MQTT_PROP_AUTHENTICATION_METHOD lib/mqtt_protocol.h /^ MQTT_PROP_AUTHENTICATION_METHOD = 21, \/* UTF-8 string : CONNECT, CONNACK, AUTH *\/$/;" e enum:mqtt5_property +MQTT_PROP_CONTENT_TYPE lib/mqtt_protocol.h /^ MQTT_PROP_CONTENT_TYPE = 3, \/* UTF-8 string : PUBLISH, Will Properties *\/$/;" e enum:mqtt5_property +MQTT_PROP_CORRELATION_DATA lib/mqtt_protocol.h /^ MQTT_PROP_CORRELATION_DATA = 9, \/* Binary Data : PUBLISH, Will Properties *\/$/;" e enum:mqtt5_property +MQTT_PROP_MAXIMUM_PACKET_SIZE lib/mqtt_protocol.h /^ MQTT_PROP_MAXIMUM_PACKET_SIZE = 39, \/* 4 byte int : CONNECT, CONNACK *\/$/;" e enum:mqtt5_property +MQTT_PROP_MAXIMUM_QOS lib/mqtt_protocol.h /^ MQTT_PROP_MAXIMUM_QOS = 36, \/* Byte : CONNACK *\/$/;" e enum:mqtt5_property +MQTT_PROP_MESSAGE_EXPIRY_INTERVAL lib/mqtt_protocol.h /^ MQTT_PROP_MESSAGE_EXPIRY_INTERVAL = 2, \/* 4 byte int : PUBLISH, Will Properties *\/$/;" e enum:mqtt5_property +MQTT_PROP_PAYLOAD_FORMAT_INDICATOR lib/mqtt_protocol.h /^ MQTT_PROP_PAYLOAD_FORMAT_INDICATOR = 1, \/* Byte : PUBLISH, Will Properties *\/$/;" e enum:mqtt5_property +MQTT_PROP_REASON_STRING lib/mqtt_protocol.h /^ MQTT_PROP_REASON_STRING = 31, \/* UTF-8 string : All except Will properties *\/$/;" e enum:mqtt5_property +MQTT_PROP_RECEIVE_MAXIMUM lib/mqtt_protocol.h /^ MQTT_PROP_RECEIVE_MAXIMUM = 33, \/* 2 byte int : CONNECT, CONNACK *\/$/;" e enum:mqtt5_property +MQTT_PROP_REQUEST_PROBLEM_INFORMATION lib/mqtt_protocol.h /^ MQTT_PROP_REQUEST_PROBLEM_INFORMATION = 23, \/* Byte : CONNECT *\/$/;" e enum:mqtt5_property +MQTT_PROP_REQUEST_RESPONSE_INFORMATION lib/mqtt_protocol.h /^ MQTT_PROP_REQUEST_RESPONSE_INFORMATION = 25,\/* Byte : CONNECT *\/$/;" e enum:mqtt5_property +MQTT_PROP_RESPONSE_INFORMATION lib/mqtt_protocol.h /^ MQTT_PROP_RESPONSE_INFORMATION = 26, \/* UTF-8 string : CONNACK *\/$/;" e enum:mqtt5_property +MQTT_PROP_RESPONSE_TOPIC lib/mqtt_protocol.h /^ MQTT_PROP_RESPONSE_TOPIC = 8, \/* UTF-8 string : PUBLISH, Will Properties *\/$/;" e enum:mqtt5_property +MQTT_PROP_RETAIN_AVAILABLE lib/mqtt_protocol.h /^ MQTT_PROP_RETAIN_AVAILABLE = 37, \/* Byte : CONNACK *\/$/;" e enum:mqtt5_property +MQTT_PROP_SERVER_KEEP_ALIVE lib/mqtt_protocol.h /^ MQTT_PROP_SERVER_KEEP_ALIVE = 19, \/* 2 byte int : CONNACK *\/$/;" e enum:mqtt5_property +MQTT_PROP_SERVER_REFERENCE lib/mqtt_protocol.h /^ MQTT_PROP_SERVER_REFERENCE = 28, \/* UTF-8 string : CONNACK, DISCONNECT *\/$/;" e enum:mqtt5_property +MQTT_PROP_SESSION_EXPIRY_INTERVAL lib/mqtt_protocol.h /^ MQTT_PROP_SESSION_EXPIRY_INTERVAL = 17, \/* 4 byte int : CONNECT, CONNACK, DISCONNECT *\/$/;" e enum:mqtt5_property +MQTT_PROP_SHARED_SUB_AVAILABLE lib/mqtt_protocol.h /^ MQTT_PROP_SHARED_SUB_AVAILABLE = 42, \/* Byte : CONNACK *\/$/;" e enum:mqtt5_property +MQTT_PROP_SUBSCRIPTION_IDENTIFIER lib/mqtt_protocol.h /^ MQTT_PROP_SUBSCRIPTION_IDENTIFIER = 11, \/* Variable byte int : PUBLISH, SUBSCRIBE *\/$/;" e enum:mqtt5_property +MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE lib/mqtt_protocol.h /^ MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE = 41, \/* Byte : CONNACK *\/$/;" e enum:mqtt5_property +MQTT_PROP_TOPIC_ALIAS lib/mqtt_protocol.h /^ MQTT_PROP_TOPIC_ALIAS = 35, \/* 2 byte int : PUBLISH *\/$/;" e enum:mqtt5_property +MQTT_PROP_TOPIC_ALIAS_MAXIMUM lib/mqtt_protocol.h /^ MQTT_PROP_TOPIC_ALIAS_MAXIMUM = 34, \/* 2 byte int : CONNECT, CONNACK *\/$/;" e enum:mqtt5_property +MQTT_PROP_TYPE_BINARY lib/mqtt_protocol.h /^ MQTT_PROP_TYPE_BINARY = 5,$/;" e enum:mqtt5_property_type +MQTT_PROP_TYPE_BYTE lib/mqtt_protocol.h /^ MQTT_PROP_TYPE_BYTE = 1,$/;" e enum:mqtt5_property_type +MQTT_PROP_TYPE_INT16 lib/mqtt_protocol.h /^ MQTT_PROP_TYPE_INT16 = 2,$/;" e enum:mqtt5_property_type +MQTT_PROP_TYPE_INT32 lib/mqtt_protocol.h /^ MQTT_PROP_TYPE_INT32 = 3,$/;" e enum:mqtt5_property_type +MQTT_PROP_TYPE_STRING lib/mqtt_protocol.h /^ MQTT_PROP_TYPE_STRING = 6,$/;" e enum:mqtt5_property_type +MQTT_PROP_TYPE_STRING_PAIR lib/mqtt_protocol.h /^ MQTT_PROP_TYPE_STRING_PAIR = 7$/;" e enum:mqtt5_property_type +MQTT_PROP_TYPE_VARINT lib/mqtt_protocol.h /^ MQTT_PROP_TYPE_VARINT = 4,$/;" e enum:mqtt5_property_type +MQTT_PROP_USER_PROPERTY lib/mqtt_protocol.h /^ MQTT_PROP_USER_PROPERTY = 38, \/* UTF-8 string pair : All *\/$/;" e enum:mqtt5_property +MQTT_PROP_WILDCARD_SUB_AVAILABLE lib/mqtt_protocol.h /^ MQTT_PROP_WILDCARD_SUB_AVAILABLE = 40, \/* Byte : CONNACK *\/$/;" e enum:mqtt5_property +MQTT_PROP_WILL_DELAY_INTERVAL lib/mqtt_protocol.h /^ MQTT_PROP_WILL_DELAY_INTERVAL = 24, \/* 4 byte int : Will properties *\/$/;" e enum:mqtt5_property +MQTT_PROTOCOL_H lib/mqtt_protocol.h 18;" d +MQTT_PROTOCOL_V31 lib/mosquitto.h 121;" d +MQTT_PROTOCOL_V311 lib/mosquitto.h 122;" d +MQTT_PROTOCOL_V5 lib/mosquitto.h 123;" d +MQTT_RC_ADMINISTRATIVE_ACTION lib/mqtt_protocol.h /^ MQTT_RC_ADMINISTRATIVE_ACTION = 152, \/* DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_ADMINISTRATIVE_ACTION test/mqtt5_rc.py /^MQTT_RC_ADMINISTRATIVE_ACTION = 152$/;" v +MQTT_RC_BAD_AUTHENTICATION_METHOD lib/mqtt_protocol.h /^ MQTT_RC_BAD_AUTHENTICATION_METHOD = 140, \/* CONNACK *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_BAD_AUTHENTICATION_METHOD test/mqtt5_rc.py /^MQTT_RC_BAD_AUTHENTICATION_METHOD = 140$/;" v +MQTT_RC_BAD_USERNAME_OR_PASSWORD lib/mqtt_protocol.h /^ MQTT_RC_BAD_USERNAME_OR_PASSWORD = 134, \/* CONNACK *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_BAD_USERNAME_OR_PASSWORD test/mqtt5_rc.py /^MQTT_RC_BAD_USERNAME_OR_PASSWORD = 134$/;" v +MQTT_RC_BANNED lib/mqtt_protocol.h /^ MQTT_RC_BANNED = 138, \/* CONNACK *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_BANNED test/mqtt5_rc.py /^MQTT_RC_BANNED = 138$/;" v +MQTT_RC_CLIENTID_NOT_VALID lib/mqtt_protocol.h /^ MQTT_RC_CLIENTID_NOT_VALID = 133, \/* CONNACK *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_CLIENTID_NOT_VALID test/mqtt5_rc.py /^MQTT_RC_CLIENTID_NOT_VALID = 133$/;" v +MQTT_RC_CONNECTION_RATE_EXCEEDED lib/mqtt_protocol.h /^ MQTT_RC_CONNECTION_RATE_EXCEEDED = 159, \/* CONNACK, DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_CONNECTION_RATE_EXCEEDED test/mqtt5_rc.py /^MQTT_RC_CONNECTION_RATE_EXCEEDED = 159$/;" v +MQTT_RC_CONTINUE_AUTHENTICATION lib/mqtt_protocol.h /^ MQTT_RC_CONTINUE_AUTHENTICATION = 24, \/* AUTH *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_CONTINUE_AUTHENTICATION test/mqtt5_rc.py /^MQTT_RC_CONTINUE_AUTHENTICATION = 24$/;" v +MQTT_RC_DISCONNECT_WITH_WILL_MSG lib/mqtt_protocol.h /^ MQTT_RC_DISCONNECT_WITH_WILL_MSG = 4, \/* DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_DISCONNECT_WITH_WILL_MSG test/mqtt5_rc.py /^MQTT_RC_DISCONNECT_WITH_WILL_MSG = 4$/;" v +MQTT_RC_GRANTED_QOS0 lib/mqtt_protocol.h /^ MQTT_RC_GRANTED_QOS0 = 0, \/* SUBACK *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_GRANTED_QOS0 test/mqtt5_rc.py /^MQTT_RC_GRANTED_QOS0 = 0$/;" v +MQTT_RC_GRANTED_QOS1 lib/mqtt_protocol.h /^ MQTT_RC_GRANTED_QOS1 = 1, \/* SUBACK *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_GRANTED_QOS1 test/mqtt5_rc.py /^MQTT_RC_GRANTED_QOS1 = 1$/;" v +MQTT_RC_GRANTED_QOS2 lib/mqtt_protocol.h /^ MQTT_RC_GRANTED_QOS2 = 2, \/* SUBACK *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_GRANTED_QOS2 test/mqtt5_rc.py /^MQTT_RC_GRANTED_QOS2 = 2$/;" v +MQTT_RC_IMPLEMENTATION_SPECIFIC lib/mqtt_protocol.h /^ MQTT_RC_IMPLEMENTATION_SPECIFIC = 131, \/* CONNACK, PUBACK, PUBREC, SUBACK, UNSUBACK, DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_IMPLEMENTATION_SPECIFIC test/mqtt5_rc.py /^MQTT_RC_IMPLEMENTATION_SPECIFIC = 131$/;" v +MQTT_RC_KEEP_ALIVE_TIMEOUT lib/mqtt_protocol.h /^ MQTT_RC_KEEP_ALIVE_TIMEOUT = 141, \/* DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_KEEP_ALIVE_TIMEOUT test/mqtt5_rc.py /^MQTT_RC_KEEP_ALIVE_TIMEOUT = 141$/;" v +MQTT_RC_MALFORMED_PACKET lib/mqtt_protocol.h /^ MQTT_RC_MALFORMED_PACKET = 129, \/* CONNACK, DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_MALFORMED_PACKET test/mqtt5_rc.py /^MQTT_RC_MALFORMED_PACKET = 129$/;" v +MQTT_RC_MAXIMUM_CONNECT_TIME lib/mqtt_protocol.h /^ MQTT_RC_MAXIMUM_CONNECT_TIME = 160, \/* DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_MAXIMUM_CONNECT_TIME test/mqtt5_rc.py /^MQTT_RC_MAXIMUM_CONNECT_TIME = 160$/;" v +MQTT_RC_MESSAGE_RATE_TOO_HIGH lib/mqtt_protocol.h /^ MQTT_RC_MESSAGE_RATE_TOO_HIGH = 150, \/* DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_MESSAGE_RATE_TOO_HIGH test/mqtt5_rc.py /^MQTT_RC_MESSAGE_RATE_TOO_HIGH = 150$/;" v +MQTT_RC_NORMAL_DISCONNECTION lib/mqtt_protocol.h /^ MQTT_RC_NORMAL_DISCONNECTION = 0, \/* DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_NORMAL_DISCONNECTION test/mqtt5_rc.py /^MQTT_RC_NORMAL_DISCONNECTION = 0$/;" v +MQTT_RC_NOT_AUTHORIZED lib/mqtt_protocol.h /^ MQTT_RC_NOT_AUTHORIZED = 135, \/* CONNACK, PUBACK, PUBREC, SUBACK, UNSUBACK, DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_NOT_AUTHORIZED test/mqtt5_rc.py /^MQTT_RC_NOT_AUTHORIZED = 135$/;" v +MQTT_RC_NO_MATCHING_SUBSCRIBERS lib/mqtt_protocol.h /^ MQTT_RC_NO_MATCHING_SUBSCRIBERS = 16, \/* PUBACK, PUBREC *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_NO_MATCHING_SUBSCRIBERS test/mqtt5_rc.py /^MQTT_RC_NO_MATCHING_SUBSCRIBERS = 16$/;" v +MQTT_RC_NO_SUBSCRIPTION_EXISTED lib/mqtt_protocol.h /^ MQTT_RC_NO_SUBSCRIPTION_EXISTED = 17, \/* UNSUBACK *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_NO_SUBSCRIPTION_EXISTED test/mqtt5_rc.py /^MQTT_RC_NO_SUBSCRIPTION_EXISTED = 17$/;" v +MQTT_RC_PACKET_ID_IN_USE lib/mqtt_protocol.h /^ MQTT_RC_PACKET_ID_IN_USE = 145, \/* PUBACK, SUBACK, UNSUBACK *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_PACKET_ID_IN_USE test/mqtt5_rc.py /^MQTT_RC_PACKET_ID_IN_USE = 145$/;" v +MQTT_RC_PACKET_ID_NOT_FOUND lib/mqtt_protocol.h /^ MQTT_RC_PACKET_ID_NOT_FOUND = 146, \/* PUBREL, PUBCOMP *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_PACKET_ID_NOT_FOUND test/mqtt5_rc.py /^MQTT_RC_PACKET_ID_NOT_FOUND = 146$/;" v +MQTT_RC_PACKET_TOO_LARGE lib/mqtt_protocol.h /^ MQTT_RC_PACKET_TOO_LARGE = 149, \/* CONNACK, PUBACK, PUBREC, DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_PACKET_TOO_LARGE test/mqtt5_rc.py /^MQTT_RC_PACKET_TOO_LARGE = 149$/;" v +MQTT_RC_PAYLOAD_FORMAT_INVALID lib/mqtt_protocol.h /^ MQTT_RC_PAYLOAD_FORMAT_INVALID = 153, \/* CONNACK, DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_PAYLOAD_FORMAT_INVALID test/mqtt5_rc.py /^MQTT_RC_PAYLOAD_FORMAT_INVALID = 153$/;" v +MQTT_RC_PROTOCOL_ERROR lib/mqtt_protocol.h /^ MQTT_RC_PROTOCOL_ERROR = 130, \/* DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_PROTOCOL_ERROR test/mqtt5_rc.py /^MQTT_RC_PROTOCOL_ERROR = 130$/;" v +MQTT_RC_QOS_NOT_SUPPORTED lib/mqtt_protocol.h /^ MQTT_RC_QOS_NOT_SUPPORTED = 155, \/* CONNACK, DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_QOS_NOT_SUPPORTED test/mqtt5_rc.py /^MQTT_RC_QOS_NOT_SUPPORTED = 155$/;" v +MQTT_RC_QUOTA_EXCEEDED lib/mqtt_protocol.h /^ MQTT_RC_QUOTA_EXCEEDED = 151, \/* PUBACK, PUBREC, SUBACK, DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_QUOTA_EXCEEDED test/mqtt5_rc.py /^MQTT_RC_QUOTA_EXCEEDED = 151$/;" v +MQTT_RC_REAUTHENTICATE lib/mqtt_protocol.h /^ MQTT_RC_REAUTHENTICATE = 25, \/* AUTH *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_REAUTHENTICATE test/mqtt5_rc.py /^MQTT_RC_REAUTHENTICATE = 25$/;" v +MQTT_RC_RECEIVE_MAXIMUM_EXCEEDED lib/mqtt_protocol.h /^ MQTT_RC_RECEIVE_MAXIMUM_EXCEEDED = 147, \/* DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_RECEIVE_MAXIMUM_EXCEEDED test/mqtt5_rc.py /^MQTT_RC_RECEIVE_MAXIMUM_EXCEEDED = 147$/;" v +MQTT_RC_RETAIN_NOT_SUPPORTED lib/mqtt_protocol.h /^ MQTT_RC_RETAIN_NOT_SUPPORTED = 154, \/* CONNACK, DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_RETAIN_NOT_SUPPORTED test/mqtt5_rc.py /^MQTT_RC_RETAIN_NOT_SUPPORTED = 154$/;" v +MQTT_RC_SERVER_BUSY lib/mqtt_protocol.h /^ MQTT_RC_SERVER_BUSY = 137, \/* CONNACK, DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_SERVER_BUSY test/mqtt5_rc.py /^MQTT_RC_SERVER_BUSY = 137$/;" v +MQTT_RC_SERVER_MOVED lib/mqtt_protocol.h /^ MQTT_RC_SERVER_MOVED = 157, \/* CONNACK, DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_SERVER_MOVED test/mqtt5_rc.py /^MQTT_RC_SERVER_MOVED = 157$/;" v +MQTT_RC_SERVER_SHUTTING_DOWN lib/mqtt_protocol.h /^ MQTT_RC_SERVER_SHUTTING_DOWN = 139, \/* DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_SERVER_SHUTTING_DOWN test/mqtt5_rc.py /^MQTT_RC_SERVER_SHUTTING_DOWN = 139$/;" v +MQTT_RC_SERVER_UNAVAILABLE lib/mqtt_protocol.h /^ MQTT_RC_SERVER_UNAVAILABLE = 136, \/* CONNACK *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_SERVER_UNAVAILABLE test/mqtt5_rc.py /^MQTT_RC_SERVER_UNAVAILABLE = 136$/;" v +MQTT_RC_SESSION_TAKEN_OVER lib/mqtt_protocol.h /^ MQTT_RC_SESSION_TAKEN_OVER = 142, \/* DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_SESSION_TAKEN_OVER test/mqtt5_rc.py /^MQTT_RC_SESSION_TAKEN_OVER = 142$/;" v +MQTT_RC_SHARED_SUBS_NOT_SUPPORTED lib/mqtt_protocol.h /^ MQTT_RC_SHARED_SUBS_NOT_SUPPORTED = 158, \/* SUBACK, DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_SHARED_SUBS_NOT_SUPPORTED test/mqtt5_rc.py /^MQTT_RC_SHARED_SUBS_NOT_SUPPORTED = 158$/;" v +MQTT_RC_SUBSCRIPTION_IDS_NOT_SUPPORTED lib/mqtt_protocol.h /^ MQTT_RC_SUBSCRIPTION_IDS_NOT_SUPPORTED = 161, \/* SUBACK, DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_SUBSCRIPTION_IDS_NOT_SUPPORTED test/mqtt5_rc.py /^MQTT_RC_SUBSCRIPTION_IDS_NOT_SUPPORTED = 161$/;" v +MQTT_RC_SUCCESS lib/mqtt_protocol.h /^ MQTT_RC_SUCCESS = 0, \/* CONNACK, PUBACK, PUBREC, PUBREL, PUBCOMP, UNSUBACK, AUTH *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_SUCCESS test/mqtt5_rc.py /^MQTT_RC_SUCCESS = 0$/;" v +MQTT_RC_TOPIC_ALIAS_INVALID lib/mqtt_protocol.h /^ MQTT_RC_TOPIC_ALIAS_INVALID = 148, \/* DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_TOPIC_ALIAS_INVALID test/mqtt5_rc.py /^MQTT_RC_TOPIC_ALIAS_INVALID = 148$/;" v +MQTT_RC_TOPIC_FILTER_INVALID lib/mqtt_protocol.h /^ MQTT_RC_TOPIC_FILTER_INVALID = 143, \/* SUBACK, UNSUBACK, DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_TOPIC_FILTER_INVALID test/mqtt5_rc.py /^MQTT_RC_TOPIC_FILTER_INVALID = 143$/;" v +MQTT_RC_TOPIC_NAME_INVALID lib/mqtt_protocol.h /^ MQTT_RC_TOPIC_NAME_INVALID = 144, \/* CONNACK, PUBACK, PUBREC, DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_TOPIC_NAME_INVALID test/mqtt5_rc.py /^MQTT_RC_TOPIC_NAME_INVALID = 144$/;" v +MQTT_RC_UNSPECIFIED lib/mqtt_protocol.h /^ MQTT_RC_UNSPECIFIED = 128, \/* CONNACK, PUBACK, PUBREC, SUBACK, UNSUBACK, DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_UNSPECIFIED test/mqtt5_rc.py /^MQTT_RC_UNSPECIFIED = 128$/;" v +MQTT_RC_UNSUPPORTED_PROTOCOL_VERSION lib/mqtt_protocol.h /^ MQTT_RC_UNSUPPORTED_PROTOCOL_VERSION = 132, \/* CONNACK *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_UNSUPPORTED_PROTOCOL_VERSION test/mqtt5_rc.py /^MQTT_RC_UNSUPPORTED_PROTOCOL_VERSION = 132$/;" v +MQTT_RC_USE_ANOTHER_SERVER lib/mqtt_protocol.h /^ MQTT_RC_USE_ANOTHER_SERVER = 156, \/* CONNACK, DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_USE_ANOTHER_SERVER test/mqtt5_rc.py /^MQTT_RC_USE_ANOTHER_SERVER = 156$/;" v +MQTT_RC_WILDCARD_SUBS_NOT_SUPPORTED lib/mqtt_protocol.h /^ MQTT_RC_WILDCARD_SUBS_NOT_SUPPORTED = 162, \/* SUBACK, DISCONNECT *\/$/;" e enum:mqtt5_return_codes +MQTT_RC_WILDCARD_SUBS_NOT_SUPPORTED test/mqtt5_rc.py /^MQTT_RC_WILDCARD_SUBS_NOT_SUPPORTED = 162$/;" v +MQTT_SUB_OPT_NO_LOCAL lib/mqtt_protocol.h /^ MQTT_SUB_OPT_NO_LOCAL = 0x04,$/;" e enum:mqtt5_sub_options +MQTT_SUB_OPT_NO_LOCAL test/mqtt5_opts.py /^MQTT_SUB_OPT_NO_LOCAL = 0x04$/;" v +MQTT_SUB_OPT_RETAIN_AS_PUBLISHED lib/mqtt_protocol.h /^ MQTT_SUB_OPT_RETAIN_AS_PUBLISHED = 0x08,$/;" e enum:mqtt5_sub_options +MQTT_SUB_OPT_RETAIN_AS_PUBLISHED test/mqtt5_opts.py /^MQTT_SUB_OPT_RETAIN_AS_PUBLISHED = 0x08$/;" v +MQTT_SUB_OPT_SEND_RETAIN_ALWAYS lib/mqtt_protocol.h /^ MQTT_SUB_OPT_SEND_RETAIN_ALWAYS = 0x00,$/;" e enum:mqtt5_sub_options +MQTT_SUB_OPT_SEND_RETAIN_ALWAYS test/mqtt5_opts.py /^MQTT_SUB_OPT_SEND_RETAIN_ALWAYS = 0x00$/;" v +MQTT_SUB_OPT_SEND_RETAIN_NEVER lib/mqtt_protocol.h /^ MQTT_SUB_OPT_SEND_RETAIN_NEVER = 0x20,$/;" e enum:mqtt5_sub_options +MQTT_SUB_OPT_SEND_RETAIN_NEVER test/mqtt5_opts.py /^MQTT_SUB_OPT_SEND_RETAIN_NEVER = 0x20$/;" v +MQTT_SUB_OPT_SEND_RETAIN_NEW lib/mqtt_protocol.h /^ MQTT_SUB_OPT_SEND_RETAIN_NEW = 0x10,$/;" e enum:mqtt5_sub_options +MQTT_SUB_OPT_SEND_RETAIN_NEW test/mqtt5_opts.py /^MQTT_SUB_OPT_SEND_RETAIN_NEW = 0x10$/;" v +MSGMODE_CMD client/client_shared.h 30;" d +MSGMODE_FILE client/client_shared.h 33;" d +MSGMODE_NONE client/client_shared.h 29;" d +MSGMODE_NULL client/client_shared.h 34;" d +MSGMODE_STDIN_FILE client/client_shared.h 32;" d +MSGMODE_STDIN_LINE client/client_shared.h 31;" d +MUR_FMIX src/deps/uthash.h 545;" d +MUR_GETBLOCK src/deps/uthash.h 523;" d +MUR_GETBLOCK src/deps/uthash.h 539;" d +MUR_ONE_THREE src/deps/uthash.h 533;" d +MUR_ONE_THREE src/deps/uthash.h 537;" d +MUR_PLUS0_ALIGNED src/deps/uthash.h 525;" d +MUR_PLUS1_ALIGNED src/deps/uthash.h 526;" d +MUR_PLUS2_ALIGNED src/deps/uthash.h 527;" d +MUR_PLUS3_ALIGNED src/deps/uthash.h 528;" d +MUR_ROTL32 src/deps/uthash.h 544;" d +MUR_THREE_ONE src/deps/uthash.h 531;" d +MUR_THREE_ONE src/deps/uthash.h 535;" d +MUR_TWO_TWO src/deps/uthash.h 532;" d +MUR_TWO_TWO src/deps/uthash.h 536;" d +NET_MOSQ_H lib/net_mosq.h 17;" d +NO_DECLTYPE src/deps/uthash.h 39;" d +NO_DECLTYPE src/deps/utlist.h 71;" d +NO_DECLTYPE src/deps/utlist.h 74;" d +OBJS src/Makefile /^OBJS= mosquitto.o \\$/;" m +OPENSSL_LOAD_CONF config.h 21;" d +PACKET_MOSQ_H lib/packet_mosq.h 17;" d +PASSWD_LDADD config.mk /^ PASSWD_LDADD:=$(PASSWD_LDADD) -lcrypto$/;" m +PASSWD_LDADD config.mk /^PASSWD_LDADD:=$/;" m +PERSIST_H src/persist.h 18;" d +PERSIST_READ_OBJS test/unit/Makefile /^PERSIST_READ_OBJS = \\$/;" m +PERSIST_READ_TEST_OBJS test/unit/Makefile /^PERSIST_READ_TEST_OBJS = \\$/;" m +PERSIST_WRITE_OBJS test/unit/Makefile /^PERSIST_WRITE_OBJS = \\$/;" m +PERSIST_WRITE_TEST_OBJS test/unit/Makefile /^PERSIST_WRITE_TEST_OBJS = \\$/;" m +PF_cfg src/persist.h /^struct PF_cfg{$/;" s +PF_client src/persist.h /^struct PF_client{$/;" s +PF_client_msg src/persist.h /^struct PF_client_msg{$/;" s +PF_header src/persist.h /^struct PF_header{$/;" s +PF_msg_store src/persist.h /^struct PF_msg_store{$/;" s +PF_retain src/persist.h /^struct PF_retain{$/;" s +PF_sub src/persist.h /^struct PF_sub{$/;" s +PLUGINS test/broker/c/Makefile /^PLUGINS = ${PLUGIN_SRC:.c=.so}$/;" m +PLUGIN_SRC test/broker/c/Makefile /^PLUGIN_SRC = \\$/;" m +PORT test/old/msgsps_common.h 2;" d +PROPERTY_MOSQ_H lib/property_mosq.h 17;" d +PROP_ASSIGNED_CLIENT_IDENTIFIER test/mqtt5_props.py /^PROP_ASSIGNED_CLIENT_IDENTIFIER = 18$/;" v +PROP_AUTHENTICATION_DATA test/mqtt5_props.py /^PROP_AUTHENTICATION_DATA = 22$/;" v +PROP_AUTHENTICATION_METHOD test/mqtt5_props.py /^PROP_AUTHENTICATION_METHOD = 21$/;" v +PROP_CONTENT_TYPE test/mqtt5_props.py /^PROP_CONTENT_TYPE = 3$/;" v +PROP_CORRELATION_DATA test/mqtt5_props.py /^PROP_CORRELATION_DATA = 9$/;" v +PROP_MAXIMUM_PACKET_SIZE test/mqtt5_props.py /^PROP_MAXIMUM_PACKET_SIZE = 39$/;" v +PROP_MAXIMUM_QOS test/mqtt5_props.py /^PROP_MAXIMUM_QOS = 36$/;" v +PROP_MESSAGE_EXPIRY_INTERVAL test/mqtt5_props.py /^PROP_MESSAGE_EXPIRY_INTERVAL = 2$/;" v +PROP_PAYLOAD_FORMAT_INDICATOR test/mqtt5_props.py /^PROP_PAYLOAD_FORMAT_INDICATOR = 1$/;" v +PROP_REASON_STRING test/mqtt5_props.py /^PROP_REASON_STRING = 31$/;" v +PROP_RECEIVE_MAXIMUM test/mqtt5_props.py /^PROP_RECEIVE_MAXIMUM = 33$/;" v +PROP_REQUEST_PROBLEM_INFO test/mqtt5_props.py /^PROP_REQUEST_PROBLEM_INFO = 23$/;" v +PROP_REQUEST_RESPONSE_INFO test/mqtt5_props.py /^PROP_REQUEST_RESPONSE_INFO = 25$/;" v +PROP_RESPONSE_INFO test/mqtt5_props.py /^PROP_RESPONSE_INFO = 26$/;" v +PROP_RESPONSE_TOPIC test/mqtt5_props.py /^PROP_RESPONSE_TOPIC = 8$/;" v +PROP_RETAIN_AVAILABLE test/mqtt5_props.py /^PROP_RETAIN_AVAILABLE = 37$/;" v +PROP_SERVER_KEEP_ALIVE test/mqtt5_props.py /^PROP_SERVER_KEEP_ALIVE = 19$/;" v +PROP_SERVER_REFERENCE test/mqtt5_props.py /^PROP_SERVER_REFERENCE = 28$/;" v +PROP_SESSION_EXPIRY_INTERVAL test/mqtt5_props.py /^PROP_SESSION_EXPIRY_INTERVAL = 17$/;" v +PROP_SHARED_SUB_AVAILABLE test/mqtt5_props.py /^PROP_SHARED_SUB_AVAILABLE = 42$/;" v +PROP_SUBSCRIPTION_IDENTIFIER test/mqtt5_props.py /^PROP_SUBSCRIPTION_IDENTIFIER = 11$/;" v +PROP_SUBSCRIPTION_ID_AVAILABLE test/mqtt5_props.py /^PROP_SUBSCRIPTION_ID_AVAILABLE = 41$/;" v +PROP_TOPIC_ALIAS test/mqtt5_props.py /^PROP_TOPIC_ALIAS = 35$/;" v +PROP_TOPIC_ALIAS_MAXIMUM test/mqtt5_props.py /^PROP_TOPIC_ALIAS_MAXIMUM = 34$/;" v +PROP_TYPE_BINARY client/client_props.c /^ PROP_TYPE_BINARY,$/;" e enum:prop_type file: +PROP_TYPE_BYTE client/client_props.c /^ PROP_TYPE_BYTE,$/;" e enum:prop_type file: +PROP_TYPE_INT16 client/client_props.c /^ PROP_TYPE_INT16,$/;" e enum:prop_type file: +PROP_TYPE_INT32 client/client_props.c /^ PROP_TYPE_INT32,$/;" e enum:prop_type file: +PROP_TYPE_STRING client/client_props.c /^ PROP_TYPE_STRING,$/;" e enum:prop_type file: +PROP_TYPE_STRING_PAIR client/client_props.c /^ PROP_TYPE_STRING_PAIR$/;" e enum:prop_type file: +PROP_USER_PROPERTY test/mqtt5_props.py /^PROP_USER_PROPERTY = 38$/;" v +PROP_WILDCARD_SUB_AVAILABLE test/mqtt5_props.py /^PROP_WILDCARD_SUB_AVAILABLE = 40$/;" v +PROP_WILL_DELAY_INTERVAL test/mqtt5_props.py /^PROP_WILL_DELAY_INTERVAL = 24$/;" v +PROTOCOL_HTTP src/websockets.c /^ PROTOCOL_HTTP = 0,$/;" e enum:mosq_ws_protocols file: +PROTOCOL_MQTT src/websockets.c /^ PROTOCOL_MQTT,$/;" e enum:mosq_ws_protocols file: +PROTOCOL_NAME lib/mqtt_protocol.h 23;" d +PROTOCOL_NAME_v31 lib/mqtt_protocol.h 20;" d +PROTOCOL_VERSION_v31 lib/mqtt_protocol.h 21;" d +PROTOCOL_VERSION_v311 lib/mqtt_protocol.h 25;" d +PROTOCOL_VERSION_v5 lib/mqtt_protocol.h 26;" d +PUB_QOS test/old/msgsps_common.h 4;" d +PUB_SHARED_H client/pub_shared.h 17;" d +P_client src/persist.h /^struct P_client{$/;" s +P_client_msg src/persist.h /^struct P_client_msg{$/;" s +P_msg_store src/persist.h /^struct P_msg_store{$/;" s +P_retain src/persist.h /^struct P_retain{$/;" s +P_sub src/persist.h /^struct P_sub{$/;" s +READ_HANDLE_H lib/read_handle.h 17;" d +REAL_WITH_MEMORY_TRACKING lib/memory_mosq.h 24;" d +SALT_LEN src/mosquitto_passwd.c 53;" d file: +SEND_MOSQ_H lib/send_mosq.h 17;" d +SHARED_DEP client/Makefile /^SHARED_DEP:=..\/lib\/libmosquitto.so.${SOVERSION}$/;" m +SOCKS_ATYPE_DOMAINNAME lib/socks_mosq.c 47;" d file: +SOCKS_ATYPE_IP_V4 lib/socks_mosq.c 46;" d file: +SOCKS_ATYPE_IP_V6 lib/socks_mosq.c 48;" d file: +SOCKS_AUTH_GSS lib/socks_mosq.c 42;" d file: +SOCKS_AUTH_NONE lib/socks_mosq.c 41;" d file: +SOCKS_AUTH_NO_ACCEPTABLE lib/socks_mosq.c 44;" d file: +SOCKS_AUTH_USERPASS lib/socks_mosq.c 43;" d file: +SOCKS_MOSQ_H lib/socks_mosq.h 18;" d +SOCKS_REPLY_ADDRESS_TYPE_NOT_SUPPORTED lib/socks_mosq.c 58;" d file: +SOCKS_REPLY_COMMAND_NOT_SUPPORTED lib/socks_mosq.c 57;" d file: +SOCKS_REPLY_CONNECTION_NOT_ALLOWED lib/socks_mosq.c 52;" d file: +SOCKS_REPLY_CONNECTION_REFUSED lib/socks_mosq.c 55;" d file: +SOCKS_REPLY_GENERAL_FAILURE lib/socks_mosq.c 51;" d file: +SOCKS_REPLY_HOST_UNREACHABLE lib/socks_mosq.c 54;" d file: +SOCKS_REPLY_NETWORK_UNREACHABLE lib/socks_mosq.c 53;" d file: +SOCKS_REPLY_SUCCEEDED lib/socks_mosq.c 50;" d file: +SOCKS_REPLY_TTL_EXPIRED lib/socks_mosq.c 56;" d file: +SOVERSION config.mk /^SOVERSION=1$/;" m +SOVERSION test/old/Makefile /^SOVERSION=1$/;" m +SRC test/broker/c/Makefile /^SRC = \\$/;" m +SRC test/lib/c/Makefile /^SRC = \\$/;" m +SSL_DATA_PENDING lib/tls_mosq.h 21;" d +SSL_DATA_PENDING lib/tls_mosq.h 23;" d +STATIC_LIB_DEPS config.mk /^ STATIC_LIB_DEPS:=$(STATIC_LIB_DEPS) -lcares$/;" m +STATIC_LIB_DEPS config.mk /^ STATIC_LIB_DEPS:=$(STATIC_LIB_DEPS) -lpthread$/;" m +STATIC_LIB_DEPS config.mk /^ STATIC_LIB_DEPS:=$(STATIC_LIB_DEPS) -lssl -lcrypto$/;" m +STATIC_LIB_DEPS config.mk /^STATIC_LIB_DEPS:=$/;" m +STATUS_CONNACK_RECVD client/pub_shared.h 20;" d +STATUS_CONNECTING client/pub_shared.h 19;" d +STATUS_DISCONNECTED client/pub_shared.h 23;" d +STATUS_DISCONNECTING client/pub_shared.h 22;" d +STATUS_WAITING client/pub_shared.h 21;" d +STREMPTY lib/mosquitto_internal.h 353;" d +STRIP config.mk /^STRIP?=strip$/;" m +STRIP_OPTS config.mk /^ STRIP_OPTS?=-s --strip-program=${CROSS_COMPILE}${STRIP}$/;" m +SUB_QOS test/old/msgsps_common.h 5;" d +SYS_TREE_H src/sys_tree.h 18;" d +SYS_TREE_QOS src/sys_tree.c 30;" d file: +SigThreadProc src/signals.c /^DWORD WINAPI SigThreadProc(void* data)$/;" f +StoreCounts test/broker/03-publish-qos1-queued-bytes.py /^class StoreCounts():$/;" c +TEMPERATURE_CONVERSION_H examples/temperature_conversion/temperature_conversion.h 2;" d +TESTS test/broker/c/Makefile /^TESTS = ${SRC:.c=.test}$/;" m +TESTS test/lib/c/Makefile /^TESTS = ${SRC:.c=.test}$/;" m +TEST_OBJS test/unit/Makefile /^TEST_OBJS = test.o \\$/;" m +TEST_add_all_connack test/unit/property_add.c /^static void TEST_add_all_connack(void)$/;" f file: +TEST_add_all_connect test/unit/property_add.c /^static void TEST_add_all_connect(void)$/;" f file: +TEST_add_bad_binary test/unit/property_add.c /^static void TEST_add_bad_binary(void)$/;" f file: +TEST_add_bad_byte test/unit/property_add.c /^static void TEST_add_bad_byte(void)$/;" f file: +TEST_add_bad_int16 test/unit/property_add.c /^static void TEST_add_bad_int16(void)$/;" f file: +TEST_add_bad_int32 test/unit/property_add.c /^static void TEST_add_bad_int32(void)$/;" f file: +TEST_add_bad_string test/unit/property_add.c /^static void TEST_add_bad_string(void)$/;" f file: +TEST_add_bad_string_pair test/unit/property_add.c /^static void TEST_add_bad_string_pair(void)$/;" f file: +TEST_add_bad_varint test/unit/property_add.c /^static void TEST_add_bad_varint(void)$/;" f file: +TEST_add_single_binary test/unit/property_add.c /^static void TEST_add_single_binary(void)$/;" f file: +TEST_add_single_byte test/unit/property_add.c /^static void TEST_add_single_byte(void)$/;" f file: +TEST_add_single_int16 test/unit/property_add.c /^static void TEST_add_single_int16(void)$/;" f file: +TEST_add_single_int32 test/unit/property_add.c /^static void TEST_add_single_int32(void)$/;" f file: +TEST_add_single_string test/unit/property_add.c /^static void TEST_add_single_string(void)$/;" f file: +TEST_add_single_string_pair test/unit/property_add.c /^static void TEST_add_single_string_pair(void)$/;" f file: +TEST_add_single_varint test/unit/property_add.c /^static void TEST_add_single_varint(void)$/;" f file: +TEST_bad_content_type test/unit/property_read.c /^static void TEST_bad_content_type(void)$/;" f file: +TEST_bad_identifier test/unit/property_write.c /^static void TEST_bad_identifier(void)$/;" f file: +TEST_bad_maximum_packet_size test/unit/property_read.c /^static void TEST_bad_maximum_packet_size(void)$/;" f file: +TEST_bad_maximum_qos test/unit/property_read.c /^static void TEST_bad_maximum_qos(void)$/;" f file: +TEST_bad_receive_maximum test/unit/property_read.c /^static void TEST_bad_receive_maximum(void)$/;" f file: +TEST_bad_request_problem_information test/unit/property_read.c /^static void TEST_bad_request_problem_information(void)$/;" f file: +TEST_bad_request_response_information test/unit/property_read.c /^static void TEST_bad_request_response_information(void)$/;" f file: +TEST_bad_retain_available test/unit/property_read.c /^static void TEST_bad_retain_available(void)$/;" f file: +TEST_bad_shared_sub_available test/unit/property_read.c /^static void TEST_bad_shared_sub_available(void)$/;" f file: +TEST_bad_subscription_id_available test/unit/property_read.c /^static void TEST_bad_subscription_id_available(void)$/;" f file: +TEST_bad_subscription_identifier test/unit/property_read.c /^static void TEST_bad_subscription_identifier(void)$/;" f file: +TEST_bad_topic_alias test/unit/property_read.c /^static void TEST_bad_topic_alias(void)$/;" f file: +TEST_bad_wildcard_sub_available test/unit/property_read.c /^static void TEST_bad_wildcard_sub_available(void)$/;" f file: +TEST_binary_data_read_empty test/unit/datatype_read.c /^static void TEST_binary_data_read_empty(void)$/;" f file: +TEST_binary_data_read_truncated test/unit/datatype_read.c /^static void TEST_binary_data_read_truncated(void)$/;" f file: +TEST_byte_read_empty test/unit/datatype_read.c /^static void TEST_byte_read_empty(void)$/;" f file: +TEST_byte_read_success test/unit/datatype_read.c /^static void TEST_byte_read_success(void)$/;" f file: +TEST_byte_write test/unit/datatype_write.c /^static void TEST_byte_write(void)$/;" f file: +TEST_bytes_read_empty test/unit/datatype_read.c /^static void TEST_bytes_read_empty(void)$/;" f file: +TEST_bytes_read_success test/unit/datatype_read.c /^static void TEST_bytes_read_success(void)$/;" f file: +TEST_bytes_read_truncated test/unit/datatype_read.c /^static void TEST_bytes_read_truncated(void)$/;" f file: +TEST_corrupt_header test/unit/persist_read_test.c /^static void TEST_corrupt_header(void)$/;" f file: +TEST_duplicate_assigned_client_identifier test/unit/property_read.c /^static void TEST_duplicate_assigned_client_identifier(void)$/;" f file: +TEST_duplicate_authentication_data test/unit/property_read.c /^static void TEST_duplicate_authentication_data(void)$/;" f file: +TEST_duplicate_authentication_method test/unit/property_read.c /^static void TEST_duplicate_authentication_method(void)$/;" f file: +TEST_duplicate_content_type test/unit/property_read.c /^static void TEST_duplicate_content_type(void)$/;" f file: +TEST_duplicate_correlation_data test/unit/property_read.c /^static void TEST_duplicate_correlation_data(void)$/;" f file: +TEST_duplicate_maximum_packet_size test/unit/property_read.c /^static void TEST_duplicate_maximum_packet_size(void)$/;" f file: +TEST_duplicate_maximum_qos test/unit/property_read.c /^static void TEST_duplicate_maximum_qos(void)$/;" f file: +TEST_duplicate_message_expiry_interval test/unit/property_read.c /^static void TEST_duplicate_message_expiry_interval(void)$/;" f file: +TEST_duplicate_payload_format_indicator test/unit/property_read.c /^static void TEST_duplicate_payload_format_indicator(void)$/;" f file: +TEST_duplicate_reason_string test/unit/property_read.c /^static void TEST_duplicate_reason_string(void)$/;" f file: +TEST_duplicate_receive_maximum test/unit/property_read.c /^static void TEST_duplicate_receive_maximum(void)$/;" f file: +TEST_duplicate_request_problem_information test/unit/property_read.c /^static void TEST_duplicate_request_problem_information(void)$/;" f file: +TEST_duplicate_request_response_information test/unit/property_read.c /^static void TEST_duplicate_request_response_information(void)$/;" f file: +TEST_duplicate_response_information test/unit/property_read.c /^static void TEST_duplicate_response_information(void)$/;" f file: +TEST_duplicate_response_topic test/unit/property_read.c /^static void TEST_duplicate_response_topic(void)$/;" f file: +TEST_duplicate_retain_available test/unit/property_read.c /^static void TEST_duplicate_retain_available(void)$/;" f file: +TEST_duplicate_server_keep_alive test/unit/property_read.c /^static void TEST_duplicate_server_keep_alive(void)$/;" f file: +TEST_duplicate_server_reference test/unit/property_read.c /^static void TEST_duplicate_server_reference(void)$/;" f file: +TEST_duplicate_session_expiry_interval test/unit/property_read.c /^static void TEST_duplicate_session_expiry_interval(void)$/;" f file: +TEST_duplicate_shared_subscription_available test/unit/property_read.c /^static void TEST_duplicate_shared_subscription_available(void)$/;" f file: +TEST_duplicate_subscription_identifier test/unit/property_read.c /^static void TEST_duplicate_subscription_identifier(void)$/;" f file: +TEST_duplicate_subscription_identifier_available test/unit/property_read.c /^static void TEST_duplicate_subscription_identifier_available(void)$/;" f file: +TEST_duplicate_topic_alias test/unit/property_read.c /^static void TEST_duplicate_topic_alias(void)$/;" f file: +TEST_duplicate_topic_alias_maximum test/unit/property_read.c /^static void TEST_duplicate_topic_alias_maximum(void)$/;" f file: +TEST_duplicate_user_property test/unit/property_read.c /^static void TEST_duplicate_user_property(void)$/;" f file: +TEST_duplicate_wildcard_subscription_available test/unit/property_read.c /^static void TEST_duplicate_wildcard_subscription_available(void)$/;" f file: +TEST_duplicate_will_delay_interval test/unit/property_read.c /^static void TEST_duplicate_will_delay_interval(void)$/;" f file: +TEST_empty_file test/unit/persist_read_test.c /^static void TEST_empty_file(void)$/;" f file: +TEST_empty_file test/unit/persist_write_test.c /^static void TEST_empty_file(void)$/;" f file: +TEST_empty_input test/unit/util_topic_test.c /^static void TEST_empty_input(void)$/;" f file: +TEST_invalid test/unit/util_topic_test.c /^static void TEST_invalid(void)$/;" f file: +TEST_invalid_but_matching test/unit/util_topic_test.c /^static void TEST_invalid_but_matching(void)$/;" f file: +TEST_invalid_property_id test/unit/property_read.c /^static void TEST_invalid_property_id(void)$/;" f file: +TEST_maximum_packet_size test/unit/publish_test.c /^static void TEST_maximum_packet_size(void)$/;" f file: +TEST_no_properties test/unit/property_read.c /^static void TEST_no_properties(void)$/;" f file: +TEST_packet_auth test/unit/property_read.c /^static void TEST_packet_auth(void)$/;" f file: +TEST_packet_connack test/unit/property_read.c /^static void TEST_packet_connack(void)$/;" f file: +TEST_packet_connect test/unit/property_read.c /^static void TEST_packet_connect(void)$/;" f file: +TEST_packet_disconnect test/unit/property_read.c /^static void TEST_packet_disconnect(void)$/;" f file: +TEST_packet_puback test/unit/property_read.c /^static void TEST_packet_puback(void)$/;" f file: +TEST_packet_pubcomp test/unit/property_read.c /^static void TEST_packet_pubcomp(void)$/;" f file: +TEST_packet_publish test/unit/property_read.c /^static void TEST_packet_publish(void)$/;" f file: +TEST_packet_pubrec test/unit/property_read.c /^static void TEST_packet_pubrec(void)$/;" f file: +TEST_packet_pubrel test/unit/property_read.c /^static void TEST_packet_pubrel(void)$/;" f file: +TEST_packet_suback test/unit/property_read.c /^static void TEST_packet_suback(void)$/;" f file: +TEST_packet_subscribe test/unit/property_read.c /^static void TEST_packet_subscribe(void)$/;" f file: +TEST_packet_unsuback test/unit/property_read.c /^static void TEST_packet_unsuback(void)$/;" f file: +TEST_packet_unsubscribe test/unit/property_read.c /^static void TEST_packet_unsubscribe(void)$/;" f file: +TEST_persistence_disabled test/unit/persist_read_test.c /^static void TEST_persistence_disabled(void)$/;" f file: +TEST_persistence_disabled test/unit/persist_write_test.c /^static void TEST_persistence_disabled(void)$/;" f file: +TEST_pub_topic_invalid test/unit/util_topic_test.c /^static void TEST_pub_topic_invalid(void)$/;" f file: +TEST_pub_topic_valid test/unit/util_topic_test.c /^static void TEST_pub_topic_valid(void)$/;" f file: +TEST_read_missing test/unit/property_user_read.c /^static void TEST_read_missing(void)$/;" f file: +TEST_read_single_binary test/unit/property_user_read.c /^static void TEST_read_single_binary(void)$/;" f file: +TEST_read_single_byte test/unit/property_user_read.c /^static void TEST_read_single_byte(void)$/;" f file: +TEST_read_single_int16 test/unit/property_user_read.c /^static void TEST_read_single_int16(void)$/;" f file: +TEST_read_single_int32 test/unit/property_user_read.c /^static void TEST_read_single_int32(void)$/;" f file: +TEST_read_single_string test/unit/property_user_read.c /^static void TEST_read_single_string(void)$/;" f file: +TEST_read_single_string_pair test/unit/property_user_read.c /^static void TEST_read_single_string_pair(void)$/;" f file: +TEST_read_single_varint test/unit/property_user_read.c /^static void TEST_read_single_varint(void)$/;" f file: +TEST_single_assigned_client_identifier test/unit/property_read.c /^static void TEST_single_assigned_client_identifier(void)$/;" f file: +TEST_single_assigned_client_identifier test/unit/property_write.c /^static void TEST_single_assigned_client_identifier(void)$/;" f file: +TEST_single_authentication_data test/unit/property_read.c /^static void TEST_single_authentication_data(void)$/;" f file: +TEST_single_authentication_data test/unit/property_write.c /^static void TEST_single_authentication_data(void)$/;" f file: +TEST_single_authentication_method test/unit/property_read.c /^static void TEST_single_authentication_method(void)$/;" f file: +TEST_single_authentication_method test/unit/property_write.c /^static void TEST_single_authentication_method(void)$/;" f file: +TEST_single_content_type test/unit/property_read.c /^static void TEST_single_content_type(void)$/;" f file: +TEST_single_content_type test/unit/property_write.c /^static void TEST_single_content_type(void)$/;" f file: +TEST_single_correlation_data test/unit/property_read.c /^static void TEST_single_correlation_data(void)$/;" f file: +TEST_single_correlation_data test/unit/property_write.c /^static void TEST_single_correlation_data(void)$/;" f file: +TEST_single_maximum_packet_size test/unit/property_read.c /^static void TEST_single_maximum_packet_size(void)$/;" f file: +TEST_single_maximum_packet_size test/unit/property_write.c /^static void TEST_single_maximum_packet_size(void)$/;" f file: +TEST_single_maximum_qos test/unit/property_read.c /^static void TEST_single_maximum_qos(void)$/;" f file: +TEST_single_maximum_qos test/unit/property_write.c /^static void TEST_single_maximum_qos(void)$/;" f file: +TEST_single_message_expiry_interval test/unit/property_read.c /^static void TEST_single_message_expiry_interval(void)$/;" f file: +TEST_single_message_expiry_interval test/unit/property_write.c /^static void TEST_single_message_expiry_interval(void)$/;" f file: +TEST_single_payload_format_indicator test/unit/property_read.c /^static void TEST_single_payload_format_indicator(void)$/;" f file: +TEST_single_payload_format_indicator test/unit/property_write.c /^static void TEST_single_payload_format_indicator(void)$/;" f file: +TEST_single_reason_string test/unit/property_read.c /^static void TEST_single_reason_string(void)$/;" f file: +TEST_single_reason_string test/unit/property_write.c /^static void TEST_single_reason_string(void)$/;" f file: +TEST_single_receive_maximum test/unit/property_read.c /^static void TEST_single_receive_maximum(void)$/;" f file: +TEST_single_receive_maximum test/unit/property_write.c /^static void TEST_single_receive_maximum(void)$/;" f file: +TEST_single_request_problem_information test/unit/property_read.c /^static void TEST_single_request_problem_information(void)$/;" f file: +TEST_single_request_problem_information test/unit/property_write.c /^static void TEST_single_request_problem_information(void)$/;" f file: +TEST_single_request_response_information test/unit/property_read.c /^static void TEST_single_request_response_information(void)$/;" f file: +TEST_single_request_response_information test/unit/property_write.c /^static void TEST_single_request_response_information(void)$/;" f file: +TEST_single_response_information test/unit/property_read.c /^static void TEST_single_response_information(void)$/;" f file: +TEST_single_response_information test/unit/property_write.c /^static void TEST_single_response_information(void)$/;" f file: +TEST_single_response_topic test/unit/property_read.c /^static void TEST_single_response_topic(void)$/;" f file: +TEST_single_response_topic test/unit/property_write.c /^static void TEST_single_response_topic(void)$/;" f file: +TEST_single_retain_available test/unit/property_read.c /^static void TEST_single_retain_available(void)$/;" f file: +TEST_single_retain_available test/unit/property_write.c /^static void TEST_single_retain_available(void)$/;" f file: +TEST_single_server_keep_alive test/unit/property_read.c /^static void TEST_single_server_keep_alive(void)$/;" f file: +TEST_single_server_keep_alive test/unit/property_write.c /^static void TEST_single_server_keep_alive(void)$/;" f file: +TEST_single_server_reference test/unit/property_read.c /^static void TEST_single_server_reference(void)$/;" f file: +TEST_single_server_reference test/unit/property_write.c /^static void TEST_single_server_reference(void)$/;" f file: +TEST_single_session_expiry_interval test/unit/property_read.c /^static void TEST_single_session_expiry_interval(void)$/;" f file: +TEST_single_session_expiry_interval test/unit/property_write.c /^static void TEST_single_session_expiry_interval(void)$/;" f file: +TEST_single_shared_subscription_available test/unit/property_read.c /^static void TEST_single_shared_subscription_available(void)$/;" f file: +TEST_single_shared_subscription_available test/unit/property_write.c /^static void TEST_single_shared_subscription_available(void)$/;" f file: +TEST_single_subscription_identifier test/unit/property_read.c /^static void TEST_single_subscription_identifier(void)$/;" f file: +TEST_single_subscription_identifier test/unit/property_write.c /^static void TEST_single_subscription_identifier(void)$/;" f file: +TEST_single_subscription_identifier_available test/unit/property_read.c /^static void TEST_single_subscription_identifier_available(void)$/;" f file: +TEST_single_subscription_identifier_available test/unit/property_write.c /^static void TEST_single_subscription_identifier_available(void)$/;" f file: +TEST_single_topic_alias test/unit/property_read.c /^static void TEST_single_topic_alias(void)$/;" f file: +TEST_single_topic_alias test/unit/property_write.c /^static void TEST_single_topic_alias(void)$/;" f file: +TEST_single_topic_alias_maximum test/unit/property_read.c /^static void TEST_single_topic_alias_maximum(void)$/;" f file: +TEST_single_topic_alias_maximum test/unit/property_write.c /^static void TEST_single_topic_alias_maximum(void)$/;" f file: +TEST_single_user_property test/unit/property_read.c /^static void TEST_single_user_property(void)$/;" f file: +TEST_single_user_property test/unit/property_write.c /^static void TEST_single_user_property(void)$/;" f file: +TEST_single_wildcard_subscription_available test/unit/property_read.c /^static void TEST_single_wildcard_subscription_available(void)$/;" f file: +TEST_single_wildcard_subscription_available test/unit/property_write.c /^static void TEST_single_wildcard_subscription_available(void)$/;" f file: +TEST_single_will_delay_interval test/unit/property_read.c /^static void TEST_single_will_delay_interval(void)$/;" f file: +TEST_single_will_delay_interval test/unit/property_write.c /^static void TEST_single_will_delay_interval(void)$/;" f file: +TEST_string_read_empty test/unit/datatype_read.c /^static void TEST_string_read_empty(void)$/;" f file: +TEST_string_read_empty_string test/unit/datatype_read.c /^static void TEST_string_read_empty_string(void)$/;" f file: +TEST_string_read_malformed_string test/unit/datatype_read.c /^static void TEST_string_read_malformed_string(void)$/;" f file: +TEST_string_read_mqtt_1_5_4_3 test/unit/datatype_read.c /^static void TEST_string_read_mqtt_1_5_4_3(void)$/;" f file: +TEST_string_read_truncated test/unit/datatype_read.c /^static void TEST_string_read_truncated(void)$/;" f file: +TEST_string_read_valid_string test/unit/datatype_read.c /^static void TEST_string_read_valid_string(void)$/;" f file: +TEST_string_to_property_info test/unit/property_user_read.c /^static void TEST_string_to_property_info(void)$/;" f file: +TEST_string_write test/unit/datatype_write.c /^static void TEST_string_write(void)$/;" f file: +TEST_sub_topic_invalid test/unit/util_topic_test.c /^static void TEST_sub_topic_invalid(void)$/;" f file: +TEST_sub_topic_valid test/unit/util_topic_test.c /^static void TEST_sub_topic_valid(void)$/;" f file: +TEST_truncated test/unit/property_read.c /^static void TEST_truncated(void)$/;" f file: +TEST_uint16_read_empty test/unit/datatype_read.c /^static void TEST_uint16_read_empty(void)$/;" f file: +TEST_uint16_read_success test/unit/datatype_read.c /^static void TEST_uint16_read_success(void)$/;" f file: +TEST_uint16_read_truncated test/unit/datatype_read.c /^static void TEST_uint16_read_truncated(void)$/;" f file: +TEST_uint16_write test/unit/datatype_write.c /^static void TEST_uint16_write(void)$/;" f file: +TEST_uint32_read_empty test/unit/datatype_read.c /^static void TEST_uint32_read_empty(void)$/;" f file: +TEST_uint32_read_success test/unit/datatype_read.c /^static void TEST_uint32_read_success(void)$/;" f file: +TEST_uint32_read_truncated test/unit/datatype_read.c /^static void TEST_uint32_read_truncated(void)$/;" f file: +TEST_uint32_write test/unit/datatype_write.c /^static void TEST_uint32_write(void)$/;" f file: +TEST_unsupported_version test/unit/persist_read_test.c /^static void TEST_unsupported_version(void)$/;" f file: +TEST_utf8_boundary_conditions test/unit/utf8.c /^static void TEST_utf8_boundary_conditions(void)$/;" f file: +TEST_utf8_control_characters test/unit/utf8.c /^void TEST_utf8_control_characters(void)$/;" f +TEST_utf8_empty test/unit/utf8.c /^static void TEST_utf8_empty(void)$/;" f file: +TEST_utf8_illegal_code_positions test/unit/utf8.c /^static void TEST_utf8_illegal_code_positions(void)$/;" f file: +TEST_utf8_malformed_sequences test/unit/utf8.c /^static void TEST_utf8_malformed_sequences(void)$/;" f file: +TEST_utf8_mqtt_1_5_4_2 test/unit/utf8.c /^void TEST_utf8_mqtt_1_5_4_2(void)$/;" f +TEST_utf8_mqtt_1_5_4_3 test/unit/utf8.c /^void TEST_utf8_mqtt_1_5_4_3(void)$/;" f +TEST_utf8_overlong_encoding test/unit/utf8.c /^static void TEST_utf8_overlong_encoding(void)$/;" f file: +TEST_utf8_truncated test/unit/utf8.c /^static void TEST_utf8_truncated(void)$/;" f file: +TEST_utf8_valid test/unit/utf8.c /^static void TEST_utf8_valid(void)$/;" f file: +TEST_v3_bad_chunk test/unit/persist_read_test.c /^static void TEST_v3_bad_chunk(void)$/;" f file: +TEST_v3_client test/unit/persist_read_test.c /^static void TEST_v3_client(void)$/;" f file: +TEST_v3_client_message test/unit/persist_read_test.c /^static void TEST_v3_client_message(void)$/;" f file: +TEST_v3_config_bad_dbid test/unit/persist_read_test.c /^static void TEST_v3_config_bad_dbid(void)$/;" f file: +TEST_v3_config_ok test/unit/persist_read_test.c /^static void TEST_v3_config_ok(void)$/;" f file: +TEST_v3_config_truncated test/unit/persist_read_test.c /^static void TEST_v3_config_truncated(void)$/;" f file: +TEST_v3_message_store test/unit/persist_read_test.c /^static void TEST_v3_message_store(void)$/;" f file: +TEST_v3_retain test/unit/persist_read_test.c /^static void TEST_v3_retain(void)$/;" f file: +TEST_v3_sub test/unit/persist_read_test.c /^static void TEST_v3_sub(void)$/;" f file: +TEST_v4_config_ok test/unit/persist_read_test.c /^static void TEST_v4_config_ok(void)$/;" f file: +TEST_v4_message_store test/unit/persist_read_test.c /^static void TEST_v4_message_store(void)$/;" f file: +TEST_v5_bad_chunk test/unit/persist_read_test.c /^static void TEST_v5_bad_chunk(void)$/;" f file: +TEST_v5_client test/unit/persist_read_test.c /^static void TEST_v5_client(void)$/;" f file: +TEST_v5_client test/unit/persist_write_test.c /^static void TEST_v5_client(void)$/;" f file: +TEST_v5_client_message test/unit/persist_read_test.c /^static void TEST_v5_client_message(void)$/;" f file: +TEST_v5_client_message test/unit/persist_write_test.c /^static void TEST_v5_client_message(void)$/;" f file: +TEST_v5_client_message_props test/unit/persist_read_test.c /^static void TEST_v5_client_message_props(void)$/;" f file: +TEST_v5_client_message_props test/unit/persist_write_test.c /^static void TEST_v5_client_message_props(void)$/;" f file: +TEST_v5_config_ok test/unit/persist_read_test.c /^static void TEST_v5_config_ok(void)$/;" f file: +TEST_v5_config_ok test/unit/persist_write_test.c /^static void TEST_v5_config_ok(void)$/;" f file: +TEST_v5_config_truncated test/unit/persist_read_test.c /^static void TEST_v5_config_truncated(void)$/;" f file: +TEST_v5_message_store test/unit/persist_read_test.c /^static void TEST_v5_message_store(void)$/;" f file: +TEST_v5_message_store_no_ref test/unit/persist_write_test.c /^static void TEST_v5_message_store_no_ref(void)$/;" f file: +TEST_v5_message_store_props test/unit/persist_read_test.c /^static void TEST_v5_message_store_props(void)$/;" f file: +TEST_v5_message_store_props test/unit/persist_write_test.c /^static void TEST_v5_message_store_props(void)$/;" f file: +TEST_v5_retain test/unit/persist_read_test.c /^static void TEST_v5_retain(void)$/;" f file: +TEST_v5_sub test/unit/persist_read_test.c /^static void TEST_v5_sub(void)$/;" f file: +TEST_v5_sub test/unit/persist_write_test.c /^static void TEST_v5_sub(void)$/;" f file: +TEST_valid_matching test/unit/util_topic_test.c /^static void TEST_valid_matching(void)$/;" f file: +TEST_valid_no_matching test/unit/util_topic_test.c /^static void TEST_valid_no_matching(void)$/;" f file: +TEST_varint_read_5_bytes test/unit/datatype_read.c /^static void TEST_varint_read_5_bytes(void)$/;" f file: +TEST_varint_read_boundaries test/unit/datatype_read.c /^static void TEST_varint_read_boundaries(void)$/;" f file: +TEST_varint_read_empty test/unit/datatype_read.c /^static void TEST_varint_read_empty(void)$/;" f file: +TEST_varint_read_overlong_encoding test/unit/datatype_read.c /^static void TEST_varint_read_overlong_encoding(void)$/;" f file: +TEST_varint_read_truncated test/unit/datatype_read.c /^static void TEST_varint_read_truncated(void)$/;" f file: +TIME_MOSQ_H lib/time_mosq.h 18;" d +TLS_MOSQ_H lib/tls_mosq.h 18;" d +UHPA_ACCESS src/uhpa.h 156;" d +UHPA_ACCESS src/uhpa.h 161;" d +UHPA_ACCESS_CHK src/uhpa.h 137;" d +UHPA_ACCESS_PAYLOAD src/mosquitto_broker_internal.h 124;" d +UHPA_ACCESS_STR src/uhpa.h 167;" d +UHPA_ALLOC src/uhpa.h 155;" d +UHPA_ALLOC src/uhpa.h 160;" d +UHPA_ALLOC_CHK src/uhpa.h 132;" d +UHPA_ALLOC_PAYLOAD src/mosquitto_broker_internal.h 123;" d +UHPA_ALLOC_STR src/uhpa.h 166;" d +UHPA_FREE src/uhpa.h 157;" d +UHPA_FREE src/uhpa.h 162;" d +UHPA_FREE_CHK src/uhpa.h 139;" d +UHPA_FREE_PAYLOAD src/mosquitto_broker_internal.h 125;" d +UHPA_FREE_STR src/uhpa.h 168;" d +UHPA_H src/uhpa.h 17;" d +UHPA_MOVE src/uhpa.h 158;" d +UHPA_MOVE src/uhpa.h 163;" d +UHPA_MOVE_CHK src/uhpa.h 145;" d +UHPA_MOVE_PAYLOAD src/mosquitto_broker_internal.h 126;" d +UHPA_MOVE_STR src/uhpa.h 169;" d +UNAME config.mk /^UNAME:=$(shell uname -s)$/;" m +UNUSED config.h 62;" d +UNUSED lib/cpp/mosquittopp.cpp 21;" d file: +UTHASH_H src/deps/uthash.h 25;" d +UTHASH_VERSION src/deps/uthash.h 67;" d +UTIL_MOSQ_H lib/util_mosq.h 17;" d +UTLIST_CASTASGN src/deps/utlist.h 101;" d +UTLIST_CASTASGN src/deps/utlist.h 92;" d +UTLIST_H src/deps/utlist.h 25;" d +UTLIST_NEXT src/deps/utlist.h 87;" d +UTLIST_NEXT src/deps/utlist.h 96;" d +UTLIST_NEXTASGN src/deps/utlist.h 88;" d +UTLIST_NEXTASGN src/deps/utlist.h 97;" d +UTLIST_PREVASGN src/deps/utlist.h 90;" d +UTLIST_PREVASGN src/deps/utlist.h 99;" d +UTLIST_RS src/deps/utlist.h 100;" d +UTLIST_RS src/deps/utlist.h 91;" d +UTLIST_SV src/deps/utlist.h 86;" d +UTLIST_SV src/deps/utlist.h 95;" d +UTLIST_VERSION src/deps/utlist.h 27;" d +UT_hash_bucket src/deps/uthash.h /^typedef struct UT_hash_bucket {$/;" s +UT_hash_bucket src/deps/uthash.h /^} UT_hash_bucket;$/;" t typeref:struct:UT_hash_bucket +UT_hash_handle src/deps/uthash.h /^typedef struct UT_hash_handle {$/;" s +UT_hash_handle src/deps/uthash.h /^} UT_hash_handle;$/;" t typeref:struct:UT_hash_handle +UT_hash_table src/deps/uthash.h /^typedef struct UT_hash_table {$/;" s +UT_hash_table src/deps/uthash.h /^} UT_hash_table;$/;" t typeref:struct:UT_hash_table +VERSION config.mk /^VERSION=1.6.3$/;" m +WEBSOCKET_CLIENT src/mosquitto_broker_internal.h 71;" d +WILL_MOSQ_H lib/will_mosq.h 18;" d +WITH_BRIDGE config.mk /^WITH_BRIDGE:=yes$/;" m +WITH_BROKER test/unit/persist_read_stubs.c 3;" d file: +WITH_BROKER test/unit/persist_read_test.c 9;" d file: +WITH_BROKER test/unit/persist_write_stubs.c 3;" d file: +WITH_BROKER test/unit/persist_write_test.c 9;" d file: +WITH_BUNDLED_DEPS config.mk /^WITH_BUNDLED_DEPS:=yes$/;" m +WITH_COVERAGE config.mk /^WITH_COVERAGE:=no$/;" m +WITH_DOCS config.mk /^WITH_DOCS:=yes$/;" m +WITH_EC config.mk /^WITH_EC:=yes$/;" m +WITH_EPOLL config.mk /^WITH_EPOLL:=yes$/;" m +WITH_MEMORY_TRACKING config.mk /^WITH_MEMORY_TRACKING:=yes$/;" m +WITH_PERSISTENCE config.mk /^WITH_PERSISTENCE:=yes$/;" m +WITH_PERSISTENCE test/unit/persist_read_test.c 10;" d file: +WITH_PERSISTENCE test/unit/persist_write_test.c 10;" d file: +WITH_SHARED_LIBRARIES config.mk /^WITH_SHARED_LIBRARIES:=yes$/;" m +WITH_SOCKS config.mk /^WITH_SOCKS:=yes$/;" m +WITH_SRV config.mk /^WITH_SRV:=no$/;" m +WITH_STATIC_LIBRARIES config.mk /^WITH_STATIC_LIBRARIES:=no$/;" m +WITH_STRIP config.mk /^WITH_STRIP:=no$/;" m +WITH_SYSTEMD config.mk /^WITH_SYSTEMD:=no$/;" m +WITH_SYS_TREE config.mk /^WITH_SYS_TREE:=yes$/;" m +WITH_THREADING config.mk /^WITH_THREADING:=yes$/;" m +WITH_TLS config.mk /^WITH_TLS:=yes$/;" m +WITH_TLS_PSK config.mk /^WITH_TLS_PSK:=yes$/;" m +WITH_WEBSOCKETS config.mk /^WITH_WEBSOCKETS:=no$/;" m +WP src/deps/uthash.h 529;" d +WinMain src/mosquitto.c /^int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)$/;" f +XSLTPROC config.mk /^XSLTPROC=xsltproc --nonet$/;" m +_DEFAULT_SOURCE config.h 15;" d +_Float128 config.h 59;" d +_Float32 config.h 55;" d +_Float32x config.h 56;" d +_Float64 config.h 57;" d +_Float64x config.h 58;" d +_GNU_SOURCE config.h 19;" d +_GNU_SOURCE lib/net_mosq.c 17;" d file: +_GNU_SOURCE lib/net_mosq.c 26;" d file: +_GNU_SOURCE src/loop.c 21;" d file: +_POSIX_C_SOURCE config.h 16;" d +_WIN32_WINNT lib/time_mosq.c 25;" d file: +_XOPEN_SOURCE config.h 10;" d +_XOPEN_SOURCE config.h 14;" d +__BSD_VISIBLE config.h 11;" d +__DARWIN_C_SOURCE config.h 8;" d +__attribute__ src/mosquitto_broker_internal.h 59;" d +__init__ misc/currentcost/gnome-panel/CurrentCostMQTT.py /^ def __init__(self, applet, iid):$/;" m class:CurrentCostMQTT +__init__ test/broker/03-publish-qos1-queued-bytes.py /^ def __init__(self):$/;" m class:StoreCounts +__init__ test/broker/03-publish-qos1-queued-bytes.py /^ def __init__(self, group=None, target=None, name=None, args=(), kwargs=None, verbose=None):$/;" m class:BrokerMonitor +__repr__ test/broker/03-publish-qos1-queued-bytes.py /^ def __repr__(self):$/;" m class:StoreCounts file: +_gen_command_with_mid test/mosq_test.py /^def _gen_command_with_mid(cmd, mid, proto_ver=4, reason_code=-1, properties=None):$/;" f +_gen_short test/mosq_test.py /^def _gen_short(cmd, reason_code=-1, proto_ver=5, properties=None):$/;" f +_mosquitto_free src/db_dump/db_dump.c 35;" d file: +_mosquitto_malloc src/db_dump/db_dump.c 34;" d file: +_ui_method lib/net_mosq.c /^UI_METHOD *_ui_method = NULL;$/;" v +access src/mosquitto_broker_internal.h /^ int access;$/;" m struct:mosquitto__acl +access src/security_default.c /^ int access;$/;" l +access_s src/security_default.c /^ char *access_s;$/;" l +achan lib/mosquitto_internal.h /^ ares_channel achan;$/;" m struct:mosquitto +acl src/mosquitto_broker_internal.h /^ struct mosquitto__acl *acl;$/;" m struct:mosquitto__acl_user typeref:struct:mosquitto__acl_user::mosquitto__acl +acl src/security_default.c /^ struct mosquitto__acl *acl, *acl_tail;$/;" l +acl__check_dollar src/security.c /^static int acl__check_dollar(const char *topic, int access)$/;" f file: +acl__check_single src/security.c /^static int acl__check_single(struct mosquitto__auth_plugin_config *auth_plugin, struct mosquitto *context, struct mosquitto_acl_msg *msg, int access)$/;" f file: +acl__cleanup src/security_default.c /^static int acl__cleanup(struct mosquitto_db *db, bool reload)$/;" f file: +acl__cleanup_single src/security_default.c /^static void acl__cleanup_single(struct mosquitto__security_options *security_opts)$/;" f file: +acl__find_acls src/security_default.c /^int acl__find_acls(struct mosquitto_db *db, struct mosquitto *context)$/;" f +acl__find_acls test/unit/persist_write_stubs.c /^int acl__find_acls(struct mosquitto_db *db, struct mosquitto *context)$/;" f +acl_check_v2 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_acl_check_v2 acl_check_v2;$/;" m struct:mosquitto__auth_plugin +acl_check_v3 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_acl_check_v3 acl_check_v3;$/;" m struct:mosquitto__auth_plugin +acl_check_v4 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_acl_check_v4 acl_check_v4;$/;" m struct:mosquitto__auth_plugin +acl_file src/mosquitto_broker_internal.h /^ char *acl_file;$/;" m struct:mosquitto__security_options +acl_file test/broker/09-acl-change.py /^acl_file = os.path.basename(__file__).replace('.py', '.acl')$/;" v +acl_file test/broker/09-extended-auth-change-username.py /^acl_file = os.path.basename(__file__).replace('.py', '.acl')$/;" v +acl_list lib/mosquitto_internal.h /^ struct mosquitto__acl_user *acl_list;$/;" m struct:mosquitto typeref:struct:mosquitto::mosquitto__acl_user +acl_list src/mosquitto_broker_internal.h /^ struct mosquitto__acl_user *acl_list;$/;" m struct:mosquitto__security_options typeref:struct:mosquitto__security_options::mosquitto__acl_user +acl_patterns src/mosquitto_broker_internal.h /^ struct mosquitto__acl *acl_patterns;$/;" m struct:mosquitto__security_options typeref:struct:mosquitto__security_options::mosquitto__acl +acl_root src/security_default.c /^ struct mosquitto__acl *acl_root;$/;" l +acl_tail src/security_default.c /^ struct mosquitto__acl *acl, *acl_tail;$/;" l +acl_tail src/security_default.c /^ struct mosquitto__acl_user *acl_tail;$/;" l +acl_test test/broker/09-acl-access-variants.py /^def acl_test(port, per_listener, global_en, user_en, pattern_en):$/;" f +acl_user src/security_default.c /^ struct mosquitto__acl_user *acl_user=NULL, *user_tail;$/;" l +acl_user_tail src/security_default.c /^ struct mosquitto__acl_user *acl_user_tail;$/;" l +aclfile__parse src/security_default.c /^static int aclfile__parse(struct mosquitto_db *db, struct mosquitto__security_options *security_opts)$/;" f file: +aclfptr src/security_default.c /^ FILE *aclfptr;$/;" l +add__acl src/security_default.c /^int add__acl(struct mosquitto__security_options *security_opts, const char *user, const char *topic, int access)$/;" f +add__acl_pattern src/security_default.c /^int add__acl_pattern(struct mosquitto__security_options *security_opts, const char *topic, int access)$/;" f +addr src/net.c /^ struct sockaddr_storage addr;$/;" l +addr_ipv4 lib/socks_mosq.c /^ struct in_addr addr_ipv4;$/;" l +addr_ipv6 lib/socks_mosq.c /^ struct in6_addr addr_ipv6;$/;" l +address lib/mosquitto_internal.h /^ char *address;$/;" m struct:mosquitto +address src/context.c /^ char address[1024];$/;" l +address src/mosquitto_broker_internal.h /^ char *address;$/;" m struct:bridge_address +address src/net.c /^ char address[1024];$/;" l +address src/websockets.c /^ char address[1024];$/;" l +address_count src/mosquitto_broker_internal.h /^ int address_count;$/;" m struct:mosquitto__bridge +addresses src/mosquitto_broker_internal.h /^ struct bridge_address *addresses;$/;" m struct:mosquitto__bridge typeref:struct:mosquitto__bridge::bridge_address +addrlen src/net.c /^ socklen_t addrlen;$/;" l +adjust_bytes src/database.c /^ unsigned long adjust_bytes = max_inflight_bytes;$/;" l +adjust_count src/database.c /^ int adjust_count;$/;" l +adns lib/mosquitto_internal.h /^ struct gaicb *adns; \/* For getaddrinfo_a *\/$/;" m struct:mosquitto typeref:struct:mosquitto::gaicb +ainfo lib/net_mosq.c /^ struct addrinfo *ainfo, *rp;$/;" l +ainfo src/net.c /^ struct addrinfo *ainfo, *rp;$/;" l +ainfo_bind lib/net_mosq.c /^ struct addrinfo *ainfo_bind, *rp_bind;$/;" l +alias lib/mosquitto_internal.h /^ uint16_t alias;$/;" m struct:mosquitto__alias +alias__add lib/alias_mosq.c /^int alias__add(struct mosquitto *mosq, const char *topic, int alias)$/;" f +alias__find lib/alias_mosq.c /^int alias__find(struct mosquitto *mosq, char **topic, int alias)$/;" f +alias__free_all lib/alias_mosq.c /^void alias__free_all(struct mosquitto *mosq)$/;" f +alias_count lib/mosquitto_internal.h /^ int alias_count;$/;" m struct:mosquitto +aliases lib/alias_mosq.c /^ struct mosquitto__alias *aliases;$/;" l +aliases lib/mosquitto_internal.h /^ struct mosquitto__alias *aliases;$/;" m struct:mosquitto typeref:struct:mosquitto::mosquitto__alias +all_tests test/broker/09-pwfile-parse-invalid.py /^def all_tests(port):$/;" f +allow_anonymous src/mosquitto_broker_internal.h /^ int8_t allow_anonymous;$/;" m struct:mosquitto__security_options +allow_anonymous src/security_default.c /^ bool allow_anonymous;$/;" l +allow_duplicate_messages src/mosquitto_broker_internal.h /^ bool allow_duplicate_messages;$/;" m struct:mosquitto__config +allow_severity src/mosquitto.c /^int allow_severity = LOG_INFO;$/;" v +allow_zero_length_clientid src/handle_connect.c /^ bool allow_zero_length_clientid;$/;" l +allow_zero_length_clientid src/mosquitto_broker_internal.h /^ bool allow_zero_length_clientid;$/;" m struct:mosquitto__security_options +alphanum lib/connect.c /^static char alphanum[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";$/;" v file: +alphanum src/mosquitto_passwd.c /^static char alphanum[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";$/;" v file: +argc src/mosquitto.c /^ int argc = 1;$/;" l +argc src/service.c /^ int argc = 1;$/;" l +args client/client_shared.c /^ char *args[3];$/;" l +argv src/mosquitto.c /^ char **argv;$/;" l +argv src/service.c /^ char **argv;$/;" l +array src/mosquitto_broker_internal.h /^ char array[MOSQ_PAYLOAD_UNION_SIZE];$/;" m union:__anon1 +assigned_id lib/mosquitto_internal.h /^ bool assigned_id;$/;" m struct:mosquitto +attempt_unsubscribe src/mosquitto_broker_internal.h /^ bool attempt_unsubscribe;$/;" m struct:mosquitto__bridge +auth test/random/random_client.py /^auth = p["auth"]$/;" v +auth1_1_packet test/broker/09-extended-auth-multistep-reauth.py /^auth1_1_packet = mosq_test.gen_auth(reason_code=mqtt5_rc.MQTT_RC_CONTINUE_AUTHENTICATION, properties=props)$/;" v +auth1_2_packet test/broker/09-extended-auth-multistep-reauth.py /^auth1_2_packet = mosq_test.gen_auth(reason_code=mqtt5_rc.MQTT_RC_CONTINUE_AUTHENTICATION, properties=props)$/;" v +auth1_packet test/broker/09-extended-auth-multistep.py /^auth1_packet = mosq_test.gen_auth(reason_code=mqtt5_rc.MQTT_RC_CONTINUE_AUTHENTICATION, properties=props)$/;" v +auth2_1_packet test/broker/09-extended-auth-multistep-reauth.py /^auth2_1_packet = mosq_test.gen_auth(reason_code=mqtt5_rc.MQTT_RC_CONTINUE_AUTHENTICATION, properties=props)$/;" v +auth2_2_packet test/broker/09-extended-auth-multistep-reauth.py /^auth2_2_packet = mosq_test.gen_auth(reason_code=mqtt5_rc.MQTT_RC_CONTINUE_AUTHENTICATION, properties=props)$/;" v +auth2_3_packet test/broker/09-extended-auth-multistep-reauth.py /^auth2_3_packet = mosq_test.gen_auth(reason_code=0, properties=props)$/;" v +auth2_packet test/broker/09-extended-auth-multistep.py /^auth2_packet = mosq_test.gen_auth(reason_code=mqtt5_rc.MQTT_RC_CONTINUE_AUTHENTICATION, properties=props)$/;" v +auth_continue_v4 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_auth_continue_v4 auth_continue_v4;$/;" m struct:mosquitto__auth_plugin +auth_data src/handle_auth.c /^ void *auth_data = NULL;$/;" l +auth_data src/handle_connect.c /^ void *auth_data = NULL;$/;" l +auth_data_len src/handle_auth.c /^ uint16_t auth_data_len = 0;$/;" l +auth_data_len src/handle_connect.c /^ uint16_t auth_data_len = 0;$/;" l +auth_data_out src/handle_auth.c /^ void *auth_data_out = NULL;$/;" l +auth_data_out src/handle_connect.c /^ void *auth_data_out = NULL;$/;" l +auth_data_out_len src/handle_auth.c /^ uint16_t auth_data_out_len = 0;$/;" l +auth_data_out_len src/handle_connect.c /^ uint16_t auth_data_out_len = 0;$/;" l +auth_method lib/mosquitto_internal.h /^ char *auth_method;$/;" m struct:mosquitto +auth_method src/handle_auth.c /^ char *auth_method = NULL;$/;" l +auth_plugin_config_count src/mosquitto_broker_internal.h /^ int auth_plugin_config_count;$/;" m struct:mosquitto__security_options +auth_plugin_configs src/mosquitto_broker_internal.h /^ struct mosquitto__auth_plugin_config *auth_plugin_configs;$/;" m struct:mosquitto__security_options typeref:struct:mosquitto__security_options::mosquitto__auth_plugin_config +auth_plugin_count src/mosquitto_broker_internal.h /^ int auth_plugin_count;$/;" m struct:mosquitto_db +auth_start_v4 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_auth_start_v4 auth_start_v4;$/;" m struct:mosquitto__auth_plugin +auto_id_prefix src/mosquitto_broker_internal.h /^ char *auto_id_prefix;$/;" m struct:mosquitto__security_options +auto_id_prefix_len src/mosquitto_broker_internal.h /^ int auto_id_prefix_len;$/;" m struct:mosquitto__security_options +autosave_interval src/mosquitto_broker_internal.h /^ int autosave_interval;$/;" m struct:mosquitto__config +autosave_on_changes src/mosquitto_broker_internal.h /^ bool autosave_on_changes;$/;" m struct:mosquitto__config +aux_message client/pub_shared.c /^ char *aux_message = NULL;$/;" l +b test/broker/01-connect-invalid-id-utf8.py /^b = list(struct.unpack("B"*len(connect_packet), connect_packet))$/;" v +b test/broker/01-connect-uname-invalid-utf8.py /^b = list(struct.unpack("B"*len(connect_packet), connect_packet))$/;" v +b test/broker/01-connect-uname-no-flag.py /^b = list(struct.unpack("B"*len(connect_packet), connect_packet))$/;" v +b test/broker/01-connect-uname-pwd-no-flag.py /^b = list(struct.unpack("B"*len(connect_packet), connect_packet))$/;" v +b test/broker/02-subscribe-invalid-utf8.py /^b = list(struct.unpack("B"*len(subscribe_packet), subscribe_packet))$/;" v +b test/broker/03-publish-invalid-utf8.py /^b = list(struct.unpack("B"*len(publish_packet), publish_packet))$/;" v +b test/broker/07-will-invalid-utf8.py /^b = list(struct.unpack("B"*len(connect_packet), connect_packet))$/;" v +b test/broker/07-will-no-flag.py /^b = list(struct.unpack("B"*len(connect_packet), connect_packet))$/;" v +b64 src/mosquitto_passwd.c /^ BIO *bmem, *b64;$/;" l +b64 src/security_default.c /^ BIO *bmem, *b64;$/;" l +backoff_base src/mosquitto_broker_internal.h /^ int backoff_base;$/;" m struct:mosquitto__bridge +backoff_cap src/mosquitto_broker_internal.h /^ int backoff_cap;$/;" m struct:mosquitto__bridge +backup_file src/mosquitto_passwd.c /^ char *backup_file;$/;" l +bad_add_binary_helper test/unit/property_add.c /^static void bad_add_binary_helper(int identifier)$/;" f file: +bad_add_byte_helper test/unit/property_add.c /^static void bad_add_byte_helper(int identifier)$/;" f file: +bad_add_int16_helper test/unit/property_add.c /^static void bad_add_int16_helper(int identifier)$/;" f file: +bad_add_int32_helper test/unit/property_add.c /^static void bad_add_int32_helper(int identifier)$/;" f file: +bad_add_string_helper test/unit/property_add.c /^static void bad_add_string_helper(int identifier)$/;" f file: +bad_add_string_pair_helper test/unit/property_add.c /^static void bad_add_string_pair_helper(int identifier)$/;" f file: +bad_add_varint_helper test/unit/property_add.c /^static void bad_add_varint_helper(int identifier)$/;" f file: +bad_byte_helper test/unit/property_read.c /^static void bad_byte_helper(int command, int identifier)$/;" f file: +bad_publish_packet test/lib/11-prop-oversize-packet.py /^bad_publish_packet = mosq_test.gen_publish("pub\/test", qos=0, payload="0123456789012345678", proto_ver=5)$/;" v +bad_string_helper test/unit/property_read.c /^static void bad_string_helper(int identifier)$/;" f file: +base64__decode src/security_default.c /^int base64__decode(char *in, unsigned char **decoded, unsigned int *decoded_len)$/;" f +base64_encode src/mosquitto_passwd.c /^int base64_encode(unsigned char *in, unsigned int in_len, char **encoded)$/;" f +batch_mode src/mosquitto_passwd.c /^ bool batch_mode = false;$/;" l +bd_both src/mosquitto_broker_internal.h /^ bd_both = 2$/;" e enum:mosquitto__bridge_direction +bd_in src/mosquitto_broker_internal.h /^ bd_in = 1,$/;" e enum:mosquitto__bridge_direction +bd_out src/mosquitto_broker_internal.h /^ bd_out = 0,$/;" e enum:mosquitto__bridge_direction +bin lib/property_mosq.h /^ struct mqtt__string bin;$/;" m union:mqtt5__property::__anon2 typeref:struct:mqtt5__property::__anon2::mqtt__string +binary src/db_dump/db_dump.c /^ bool binary = false;$/;" l +binary_prop_read_helper test/unit/property_read.c /^static void binary_prop_read_helper($/;" f file: +binary_prop_write_helper test/unit/property_write.c /^static void binary_prop_write_helper($/;" f file: +binary_read_helper test/unit/datatype_read.c /^static void binary_read_helper($/;" f file: +bind examples/mysql_log/mysql_log.c /^ MYSQL_BIND bind[2];$/;" l +bind_address client/client_shared.h /^ char *bind_address;$/;" m struct:mosq_config +bind_address lib/mosquitto_internal.h /^ char *bind_address;$/;" m struct:mosquitto +bind_interface src/mosquitto_broker_internal.h /^ char *bind_interface;$/;" m struct:mosquitto__listener +bio lib/net_mosq.c /^ BIO *bio;$/;" l +bio src/net.c /^ BIO *bio;$/;" l +bloom_bv src/deps/uthash.h /^ uint8_t *bloom_bv;$/;" m struct:UT_hash_table +bloom_nbits src/deps/uthash.h /^ char bloom_nbits;$/;" m struct:UT_hash_table +bloom_sig src/deps/uthash.h /^ uint32_t bloom_sig; \/* used only to test bloom exists in external analysis *\/$/;" m struct:UT_hash_table +bmem src/mosquitto_passwd.c /^ BIO *bmem, *b64;$/;" l +bmem src/security_default.c /^ BIO *bmem, *b64;$/;" l +bmod test/broker/07-will-no-flag.py /^bmod = b[0:len(b)-2]$/;" v +bn lib/util_mosq.c /^ BIGNUM *bn = NULL;$/;" l +bool lib/mosquitto.h 36;" d +bool src/mosquitto_passwd.c 35;" d file: +booleans test/random/random_client.py /^booleans = [True, False]$/;" v +bptr src/mosquitto_passwd.c /^ BUF_MEM *bptr;$/;" l +br lib/net_mosq_ocsp.c /^ OCSP_BASICRESP *br = NULL;$/;" l +branch src/subs.c /^ struct mosquitto__subhier *branch, *branch_tmp;$/;" l +branch src/subs.c /^ struct mosquitto__subhier *branch;$/;" l +branch_tmp src/subs.c /^ struct mosquitto__subhier *branch, *branch_tmp;$/;" l +bridge lib/mosquitto_internal.h /^ struct mosquitto__bridge *bridge;$/;" m struct:mosquitto typeref:struct:mosquitto::mosquitto__bridge +bridge src/bridge.c /^ struct mosquitto__bridge *bridge;$/;" l +bridge test/broker/08-tls-psk-bridge.py /^bridge = mosq_test.start_broker(filename=os.path.basename(__file__)+'_bridge', cmd=bridge_cmd, port=port3)$/;" v +bridge1 src/conf.c /^ struct mosquitto__bridge *bridge1, *bridge2;$/;" l +bridge2 src/conf.c /^ struct mosquitto__bridge *bridge1, *bridge2;$/;" l +bridge__backoff_reset src/bridge.c /^static void bridge__backoff_reset(struct mosquitto *context)$/;" f file: +bridge__backoff_step src/bridge.c /^static void bridge__backoff_step(struct mosquitto *context)$/;" f file: +bridge__connect src/bridge.c /^int bridge__connect(struct mosquitto_db *db, struct mosquitto *context)$/;" f +bridge__connect_step1 src/bridge.c /^int bridge__connect_step1(struct mosquitto_db *db, struct mosquitto *context)$/;" f +bridge__connect_step2 src/bridge.c /^int bridge__connect_step2(struct mosquitto_db *db, struct mosquitto *context)$/;" f +bridge__connect_step3 src/bridge.c /^int bridge__connect_step3(struct mosquitto_db *db, struct mosquitto *context)$/;" f +bridge__new src/bridge.c /^int bridge__new(struct mosquitto_db *db, struct mosquitto__bridge *bridge)$/;" f +bridge__packet_cleanup src/bridge.c /^void bridge__packet_cleanup(struct mosquitto *context)$/;" f +bridge_address src/mosquitto_broker_internal.h /^struct bridge_address{$/;" s +bridge_cmd test/broker/08-tls-psk-bridge.py /^bridge_cmd = ['..\/..\/src\/mosquitto', '-c', '08-tls-psk-bridge.conf2']$/;" v +bridge_count src/mosquitto_broker_internal.h /^ int bridge_count;$/;" m struct:mosquitto__config +bridge_count src/mosquitto_broker_internal.h /^ int bridge_count;$/;" m struct:mosquitto_db +bridges src/bridge.c /^ struct mosquitto **bridges;$/;" l +bridges src/mosquitto_broker_internal.h /^ struct mosquitto **bridges;$/;" m struct:mosquitto_db typeref:struct:mosquitto_db::mosquitto +bridges src/mosquitto_broker_internal.h /^ struct mosquitto__bridge *bridges;$/;" m struct:mosquitto__config typeref:struct:mosquitto__config::mosquitto__bridge +broker test/broker/01-connect-anon-denied.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/01-connect-bad-packet.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/01-connect-disconnect-v5.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/01-connect-duplicate-v5.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/01-connect-duplicate.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/01-connect-invalid-id-0-311.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/01-connect-invalid-id-0.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/01-connect-invalid-id-missing.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/01-connect-invalid-id-utf8.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/01-connect-invalid-protonum.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/01-connect-invalid-reserved.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/01-connect-success-v5.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/01-connect-success.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/01-connect-uname-invalid-utf8.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/01-connect-uname-no-flag.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/01-connect-uname-no-password-denied.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/01-connect-uname-password-denied-no-will.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/01-connect-uname-password-denied.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/01-connect-uname-password-success-no-tls.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/01-connect-uname-password-success.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/01-connect-uname-pwd-no-flag.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-shared-qos0-v5.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subhier-crash.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos0-retain-as-publish.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos0-send-retain.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos0-subscription-id.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos0-topic-alias-unknown.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos0-topic-alias.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos0-v5.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos0.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos1-bad-pubcomp.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos1-bad-pubrec.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos1-message-expiry-retain.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos1-message-expiry-will.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos1-message-expiry.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos1-nolocal.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos1-v5.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos1.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos2-bad-puback-1.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos2-bad-puback-2.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos2-bad-pubcomp.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos2-pubrec-error.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos2-receive-maximum-1.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos2-receive-maximum-2.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos2-v5.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subpub-qos2.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subscribe-invalid-utf8.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subscribe-persistence-flipflop.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subscribe-qos0.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subscribe-qos1.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-subscribe-qos2.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-unsubscribe-invalid-no-topic.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-unsubscribe-qos0.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-unsubscribe-qos1.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-unsubscribe-qos2-multiple-v5.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-unsubscribe-qos2-multiple.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-unsubscribe-qos2-v5.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/02-unsubscribe-qos2.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/03-publish-b2c-disconnect-qos1.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/03-publish-b2c-disconnect-qos2.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/03-publish-b2c-timeout-qos1.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__))$/;" v +broker test/broker/03-publish-b2c-timeout-qos2.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__))$/;" v +broker test/broker/03-publish-c2b-disconnect-qos2.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/03-publish-c2b-timeout-qos2.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__))$/;" v +broker test/broker/03-publish-dollar-v5.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/03-publish-dollar.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/03-publish-invalid-utf8.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/03-publish-qos1-no-subscribers-v5.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/03-publish-qos1-queued-bytes.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/03-publish-qos1-retain-disabled.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/03-publish-qos1.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/03-publish-qos2.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/04-retain-qos0-clear.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/04-retain-qos0-fresh.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/04-retain-qos0-repeated.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/04-retain-qos0.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/04-retain-qos1-qos0.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/04-retain-upgrade-outgoing-qos.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/05-clean-session-qos1.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/05-session-expiry-v5.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/06-bridge-b2br-disconnect-qos1.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/06-bridge-b2br-disconnect-qos2.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/06-bridge-b2br-late-connection-retain.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/06-bridge-b2br-late-connection.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/06-bridge-b2br-remapping.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/06-bridge-br2b-disconnect-qos1.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/06-bridge-br2b-disconnect-qos2.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/06-bridge-br2b-remapping.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/06-bridge-fail-persist-resend-qos1.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/06-bridge-fail-persist-resend-qos2.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/06-bridge-per-listener-settings.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/06-bridge-reconnect-local-out.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port1, use_conf=False)$/;" v +broker test/broker/07-will-invalid-utf8.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/07-will-no-flag.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/07-will-null-topic.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/07-will-null.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/08-ssl-bridge.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/08-ssl-connect-cert-auth-crl.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/08-ssl-connect-cert-auth-expired.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/08-ssl-connect-cert-auth-revoked.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/08-ssl-connect-cert-auth-without.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/08-ssl-connect-cert-auth.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/08-ssl-connect-identity.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/08-ssl-connect-no-auth-wrong-ca.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/08-ssl-connect-no-auth.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/08-ssl-connect-no-identity.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True)$/;" v +broker test/broker/08-tls-psk-bridge.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port1)$/;" v +broker test/broker/08-tls-psk-pub.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port2)$/;" v +broker test/broker/09-acl-change.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/09-auth-bad-method.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/09-extended-auth-multistep-reauth.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/09-extended-auth-multistep.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/09-extended-auth-single.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/09-extended-auth-unsupported.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/09-plugin-auth-acl-pub.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/09-plugin-auth-acl-sub-denied.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/09-plugin-auth-acl-sub.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/09-plugin-auth-context-params.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/09-plugin-auth-defer-unpwd-fail.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/09-plugin-auth-defer-unpwd-success.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/09-plugin-auth-msg-params.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/09-plugin-auth-unpwd-fail.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/09-plugin-auth-unpwd-success.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/09-plugin-auth-v2-unpwd-fail.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/09-plugin-auth-v2-unpwd-success.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/10-listener-mount-point.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port1)$/;" v +broker test/broker/11-message-expiry.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/11-persistent-subscription-no-local.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/11-persistent-subscription-v5.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/11-persistent-subscription.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/11-pub-props.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/11-subscription-id.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port)$/;" v +broker test/broker/12-prop-maximum-packet-size-broker.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port, use_conf=True)$/;" v +broker test/broker/12-prop-maximum-packet-size-connect.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/12-prop-maximum-packet-size-publish-qos1.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/12-prop-maximum-packet-size-publish-qos2.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/12-prop-maximum-packet-size-publish.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/12-prop-response-topic-correlation-data.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/12-prop-response-topic.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +broker test/broker/12-prop-server-keepalive.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port, use_conf=True)$/;" v +broker test/broker/12-prop-session-expiry-invalid.py /^broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port)$/;" v +brokerMonitor test/broker/03-publish-qos1-queued-bytes.py /^brokerMonitor = BrokerMonitor(args=(rq,cq))$/;" v +bst_automatic src/mosquitto_broker_internal.h /^ bst_automatic = 0,$/;" e enum:mosquitto_bridge_start_type +bst_lazy src/mosquitto_broker_internal.h /^ bst_lazy = 1,$/;" e enum:mosquitto_bridge_start_type +bst_manual src/mosquitto_broker_internal.h /^ bst_manual = 2,$/;" e enum:mosquitto_bridge_start_type +bst_once src/mosquitto_broker_internal.h /^ bst_once = 3$/;" e enum:mosquitto_bridge_start_type +buckets src/deps/uthash.h /^ UT_hash_bucket *buckets;$/;" m struct:UT_hash_table +buf client/pub_shared.c /^ char buf[1024];$/;" l +buf client/sub_client_output.c /^ char buf[100];$/;" l +buf examples/temperature_conversion/temperature_conversion.cpp /^ char buf[51];$/;" l +buf lib/util_mosq.c /^ char buf[4096];$/;" l +buf src/conf.c /^ char *buf;$/;" l +buf src/logging.c /^ char buf[200];$/;" l +buf src/mosquitto_passwd.c /^ char buf[MAX_BUFFER_LEN];$/;" l +buf src/net.c /^ char *buf;$/;" l +buf src/net.c /^ char buf[256];$/;" l +buf src/security.c /^ char *buf;$/;" l +buf src/security_default.c /^ char buf[1024];$/;" l +buf src/security_default.c /^ char buf[256];$/;" l +buf src/service.c /^ char *buf;$/;" l +buf src/sys_tree.c /^ char buf[64];$/;" l +buf src/sys_tree.c /^ char buf[BUFLEN];$/;" l +buf src/websockets.c /^ uint8_t *buf;$/;" l +buf src/websockets.c /^ unsigned char buf[4096];$/;" l +buf test/old/msgsps_pub.c /^ uint8_t *buf;$/;" l +buf test/unit/utf8.c /^ char buf[100];$/;" l +buf test/unit/utf8.c /^ char buf[10] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', '\\0'};$/;" l +buf test/unit/utf8.c /^ char buf[10] = {'a', 'b', 0xEF, 0xBB, 0xBF, 'f', 'g', 'h', 'i', '\\0'};$/;" l +buf test/unit/utf8.c /^ char buf[10];$/;" l +buf test/unit/utf8.c /^ char buf[4];$/;" l +buf2 client/pub_client.c /^ char *buf2;$/;" l +buf_len_actual client/pub_client.c /^ int buf_len_actual;$/;" l +buflen src/conf.c /^ int buflen;$/;" l +buflen src/websockets.c /^ size_t buflen;$/;" l +byte lib/packet_datatypes.c /^ uint8_t byte;$/;" l +byte lib/packet_mosq.c /^ uint8_t byte;$/;" l +byte lib/packet_mosq.c /^ uint8_t remaining_bytes[5], byte;$/;" l +byte lib/property_mosq.c /^ uint8_t byte;$/;" l +byte lib/send_connect.c /^ uint8_t byte;$/;" l +byte src/websockets.c /^ uint8_t byte;$/;" l +byte_count lib/property_mosq.c /^ int8_t byte_count;$/;" l +byte_prop_read_helper test/unit/property_read.c /^static void byte_prop_read_helper($/;" f file: +byte_prop_write_helper test/unit/property_write.c /^static void byte_prop_write_helper($/;" f file: +byte_read_helper test/unit/datatype_read.c /^static void byte_read_helper($/;" f file: +byte_value test/unit/property_user_read.c /^ uint8_t byte_value;$/;" l +bytes test/unit/datatype_read.c /^ int8_t bytes = -1;$/;" l +bytes_read_helper test/unit/datatype_read.c /^static void bytes_read_helper($/;" f file: +bytes_received src/sys_tree.c /^ static unsigned long long bytes_received = -1;$/;" l file: +bytes_received_interval src/sys_tree.c /^ double bytes_received_interval, bytes_sent_interval;$/;" l +bytes_received_load1 src/sys_tree.c /^ static double bytes_received_load1 = 0;$/;" l file: +bytes_received_load15 src/sys_tree.c /^ static double bytes_received_load15 = 0;$/;" l file: +bytes_received_load5 src/sys_tree.c /^ static double bytes_received_load5 = 0;$/;" l file: +bytes_sent src/sys_tree.c /^ static unsigned long long bytes_sent = -1;$/;" l file: +bytes_sent_interval src/sys_tree.c /^ double bytes_received_interval, bytes_sent_interval;$/;" l +bytes_sent_load1 src/sys_tree.c /^ static double bytes_sent_load1 = 0;$/;" l file: +bytes_sent_load15 src/sys_tree.c /^ static double bytes_sent_load15 = 0;$/;" l file: +bytes_sent_load5 src/sys_tree.c /^ static double bytes_sent_load5 = 0;$/;" l file: +c lib/util_topic.c /^ char c = '\\0';$/;" l +c_connack_packet test/broker/06-bridge-b2br-late-connection-retain.py /^c_connack_packet = mosq_test.gen_connack(rc=0)$/;" v +c_connack_packet test/broker/06-bridge-b2br-late-connection.py /^c_connack_packet = mosq_test.gen_connack(rc=0)$/;" v +c_connect_packet test/broker/06-bridge-b2br-late-connection-retain.py /^c_connect_packet = mosq_test.gen_connect("client", keepalive=keepalive)$/;" v +c_connect_packet test/broker/06-bridge-b2br-late-connection.py /^c_connect_packet = mosq_test.gen_connect("client", keepalive=keepalive)$/;" v +cafile client/client_shared.h /^ char *cafile;$/;" m struct:mosq_config +cafile lib/mosquitto.h /^ char *cafile;$/;" m struct:libmosquitto_tls +cafile src/mosquitto_broker_internal.h /^ char *cafile;$/;" m struct:mosquitto__listener +calc_load src/sys_tree.c /^static void calc_load(struct mosquitto_db *db, char *buf, const char *topic, bool initial, double exponent, double interval, double *current)$/;" f file: +callback lib/helpers.c /^ int (*callback)(struct mosquitto *, void *, const struct mosquitto_message *);$/;" m struct:userdata__callback file: +callback_http src/websockets.c /^static int callback_http($/;" f file: +callback_mqtt src/websockets.c /^static int callback_mqtt($/;" f file: +callback_mutex lib/mosquitto_internal.h /^ pthread_mutex_t callback_mutex;$/;" m struct:mosquitto +capath client/client_shared.h /^ char *capath;$/;" m struct:mosq_config +capath lib/mosquitto.h /^ char *capath;$/;" m struct:libmosquitto_tls +capath src/mosquitto_broker_internal.h /^ char *capath;$/;" m struct:mosquitto__listener +cb_userdata lib/helpers.c /^ struct userdata__callback cb_userdata;$/;" l +cc src/db_dump/db_dump.c /^ struct client_chunk *cc, *cc_tmp;$/;" l +cc src/db_dump/db_dump.c /^ struct client_chunk *cc;$/;" l +cc_tmp src/db_dump/db_dump.c /^ struct client_chunk *cc, *cc_tmp;$/;" l +ccount src/mosquitto_broker_internal.h /^ int ccount;$/;" m struct:mosquitto__acl +cert lib/tls_mosq.c /^ X509 *cert;$/;" l +cert_reqs lib/mosquitto.h /^ int cert_reqs;$/;" m struct:libmosquitto_tls +cert_status lib/net_mosq_ocsp.c /^ int cert_status, crl_reason;$/;" l +certfile client/client_shared.h /^ char *certfile;$/;" m struct:mosq_config +certfile lib/mosquitto.h /^ char *certfile;$/;" m struct:libmosquitto_tls +certfile src/mosquitto_broker_internal.h /^ char *certfile;$/;" m struct:mosquitto__listener +cfg client/pub_shared.c /^struct mosq_config cfg;$/;" v typeref:struct:mosq_config +cfg client/pub_shared.h /^extern struct mosq_config cfg;$/;" x +cfg client/rr_client.c /^struct mosq_config cfg;$/;" v typeref:struct:mosq_config +cfg client/sub_client.c /^struct mosq_config cfg;$/;" v typeref:struct:mosq_config +cfg client/sub_client_output.c /^extern struct mosq_config cfg;$/;" x +cfg_add_topic client/client_shared.c /^int cfg_add_topic(struct mosq_config *cfg, int type, char *topic, const char *arg)$/;" f +cfg_chunk src/persist_read.c /^ struct PF_cfg cfg_chunk;$/;" l +cfg_chunk src/persist_write.c /^ struct PF_cfg cfg_chunk;$/;" l +cfg_count src/db_dump/db_dump.c /^ long cfg_count = 0;$/;" l +cfg_parse_property client/client_props.c /^int cfg_parse_property(struct mosq_config *cfg, int argc, char *argv[], int *idx)$/;" f +check_format client/client_shared.c /^static int check_format(const char *str)$/;" f file: +check_repeat_time client/pub_client.c /^static int check_repeat_time(void)$/;" f file: +check_retain_source src/mosquitto_broker_internal.h /^ bool check_retain_source;$/;" m struct:mosquitto__config +child src/subs.c /^ struct mosquitto__subhier *child;$/;" l +children src/mosquitto_broker_internal.h /^ struct mosquitto__subhier *children;$/;" m struct:mosquitto__subhier typeref:struct:mosquitto__subhier::mosquitto__subhier +chunk src/db_dump/db_dump.c /^ uint16_t i16temp, chunk;$/;" l +chunk src/persist.h /^ uint32_t chunk;$/;" m struct:PF_header +chunk src/persist_read.c /^ int chunk, length;$/;" l +chunk src/persist_read.c /^ struct P_client chunk;$/;" l +chunk src/persist_read.c /^ struct P_client_msg chunk;$/;" l +chunk src/persist_read.c /^ struct P_msg_store chunk;$/;" l +chunk src/persist_read.c /^ struct P_retain chunk;$/;" l +chunk src/persist_read.c /^ struct P_sub chunk;$/;" l +chunk src/persist_write.c /^ struct P_client chunk;$/;" l +chunk src/persist_write.c /^ struct P_client_msg chunk;$/;" l +chunk src/persist_write.c /^ struct P_msg_store chunk;$/;" l +ciphers client/client_shared.h /^ char *ciphers;$/;" m struct:mosq_config +ciphers lib/mosquitto.h /^ char *ciphers;$/;" m struct:libmosquitto_tls +ciphers src/mosquitto_broker_internal.h /^ char *ciphers;$/;" m struct:mosquitto__listener +clean_session client/client_shared.h /^ bool clean_session;$/;" m struct:mosq_config +clean_start lib/mosquitto_internal.h /^ bool clean_start;$/;" m struct:mosquitto +clean_start src/handle_connect.c /^ uint8_t will, will_retain, will_qos, clean_start;$/;" l +clean_start src/mosquitto_broker_internal.h /^ bool clean_start;$/;" m struct:mosquitto__bridge +clean_start test/random/random_client.py /^clean_start = random.choice(booleans)$/;" v +cleanup_ui_method lib/net_mosq.c /^static void cleanup_ui_method(void)$/;" f file: +clen src/security_default.c /^ int len, tlen, clen, ulen;$/;" l +client src/db_dump/db_dump.c /^ struct db_client client = {0};$/;" l +client test/lib/01-con-discon-success.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/01-keepalive-pingreq.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/01-no-clean-session.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/01-server-keepalive-pingreq.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/01-unpwd-set.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/01-will-set.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/01-will-unpwd-set.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/02-subscribe-qos0.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/02-subscribe-qos1.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/02-subscribe-qos2.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/02-unsubscribe-multiple-v5.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/02-unsubscribe-v5.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/02-unsubscribe.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/03-publish-b2c-qos1.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/03-publish-b2c-qos2.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/03-publish-c2b-qos1-disconnect.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/03-publish-c2b-qos1-receive-maximum.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/03-publish-c2b-qos1-timeout.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/03-publish-c2b-qos2-disconnect.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/03-publish-c2b-qos2-maximum-qos-0.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/03-publish-c2b-qos2-maximum-qos-1.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/03-publish-c2b-qos2-pubrec-error.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/03-publish-c2b-qos2-timeout.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/03-publish-c2b-qos2.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/03-publish-qos0-no-payload.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/03-publish-qos0.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/04-retain-qos0.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/08-ssl-bad-cacert.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env)$/;" v +client test/lib/08-ssl-connect-cert-auth-enc.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/08-ssl-connect-cert-auth.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/08-ssl-connect-no-auth.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/08-ssl-fake-cacert.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/09-util-topic-tokenise.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env)$/;" v +client test/lib/11-prop-oversize-packet.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/11-prop-send-content-type.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client test/lib/11-prop-send-payload-format.py /^client = mosq_test.start_client(filename=sys.argv[1].replace('\/', '-'), cmd=client_args, env=env, port=port)$/;" v +client1 test/lib/03-request-response-correlation.py /^client1 = mosq_test.start_client(filename="03-request-response-correlation-1.log", cmd=["c\/03-request-response-correlation-1.test"], env=env, port=port)$/;" v +client1 test/lib/03-request-response.py /^client1 = mosq_test.start_client(filename="03-request-response-1.log", cmd=["c\/03-request-response-1.test"], env=env, port=port)$/;" v +client2 test/lib/03-request-response-correlation.py /^ client2 = mosq_test.start_client(filename="03-request-response-2.log", cmd=["c\/03-request-response-2.test"], env=env, port=port)$/;" v +client2 test/lib/03-request-response.py /^ client2 = mosq_test.start_client(filename="03-request-response-2.log", cmd=["c\/03-request-response-2.test"], env=env, port=port)$/;" v +client_args test/lib/01-con-discon-success.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/01-keepalive-pingreq.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/01-no-clean-session.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/01-server-keepalive-pingreq.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/01-unpwd-set.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/01-will-set.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/01-will-unpwd-set.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/02-subscribe-qos0.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/02-subscribe-qos1.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/02-subscribe-qos2.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/02-unsubscribe-multiple-v5.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/02-unsubscribe-v5.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/02-unsubscribe.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/03-publish-b2c-qos1.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/03-publish-b2c-qos2.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/03-publish-c2b-qos1-disconnect.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/03-publish-c2b-qos1-receive-maximum.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/03-publish-c2b-qos1-timeout.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/03-publish-c2b-qos2-disconnect.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/03-publish-c2b-qos2-maximum-qos-0.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/03-publish-c2b-qos2-maximum-qos-1.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/03-publish-c2b-qos2-pubrec-error.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/03-publish-c2b-qos2-timeout.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/03-publish-c2b-qos2.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/03-publish-qos0-no-payload.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/03-publish-qos0.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/04-retain-qos0.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/08-ssl-bad-cacert.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/08-ssl-connect-cert-auth-enc.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/08-ssl-connect-cert-auth.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/08-ssl-connect-no-auth.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/08-ssl-fake-cacert.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/09-util-topic-tokenise.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/11-prop-oversize-packet.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/11-prop-send-content-type.py /^client_args = sys.argv[1:]$/;" v +client_args test/lib/11-prop-send-payload-format.py /^client_args = sys.argv[1:]$/;" v +client_cert src/handle_connect.c /^ X509 *client_cert = NULL;$/;" l +client_certificate_verify src/net.c /^static int client_certificate_verify(int preverify_ok, X509_STORE_CTX *ctx)$/;" f file: +client_chunk src/db_dump/db_dump.c /^struct client_chunk$/;" s file: +client_config_cleanup client/client_shared.c /^void client_config_cleanup(struct mosq_config *cfg)$/;" f +client_config_line_proc client/client_shared.c /^int client_config_line_proc(struct mosq_config *cfg, int pub_or_sub, int argc, char *argv[])$/;" f +client_config_load client/client_shared.c /^int client_config_load(struct mosq_config *cfg, int pub_or_sub, int argc, char *argv[])$/;" f +client_connack_packet test/broker/06-bridge-b2br-remapping.py /^client_connack_packet = mosq_test.gen_connack(rc=0)$/;" v +client_connack_packet test/broker/06-bridge-br2b-remapping.py /^client_connack_packet = mosq_test.gen_connack(rc=0)$/;" v +client_connack_packet test/broker/06-bridge-per-listener-settings.py /^client_connack_packet = mosq_test.gen_connack(rc=0)$/;" v +client_connect client/client_shared.c /^int client_connect(struct mosquitto *mosq, struct mosq_config *cfg)$/;" f +client_connect_packet test/broker/06-bridge-b2br-remapping.py /^client_connect_packet = mosq_test.gen_connect("pub-test", keepalive=keepalive)$/;" v +client_connect_packet test/broker/06-bridge-br2b-remapping.py /^client_connect_packet = mosq_test.gen_connect("pub-test", keepalive=keepalive)$/;" v +client_connect_packet test/broker/06-bridge-per-listener-settings.py /^client_connect_packet = mosq_test.gen_connect("pub-test", keepalive=keepalive)$/;" v +client_count src/db_dump/db_dump.c /^ long client_count = 0;$/;" l +client_count src/mosquitto_broker_internal.h /^ int client_count;$/;" m struct:mosquitto__listener +client_count src/sys_tree.c /^ static int client_count = -1;$/;" l file: +client_generated lib/property_mosq.h /^ bool client_generated;$/;" m struct:mqtt5__property +client_id src/db_dump/db_dump.c /^ char *client_id;$/;" m struct:db_client file: +client_id src/db_dump/db_dump.c /^ char *client_id;$/;" m struct:db_client_msg file: +client_id src/db_dump/db_dump.c /^ char *client_id;$/;" m struct:db_sub file: +client_id src/handle_connect.c /^ char *client_id = NULL;$/;" l +client_id src/handle_connect.c /^ char *client_id;$/;" l +client_id src/persist.h /^ char *client_id;$/;" m struct:P_client +client_id src/persist.h /^ char *client_id;$/;" m struct:P_client_msg +client_id src/persist.h /^ char *client_id;$/;" m struct:P_sub +client_id test/broker/06-bridge-b2br-disconnect-qos1.py /^client_id = socket.gethostname()+".bridge_sample"$/;" v +client_id test/broker/06-bridge-b2br-disconnect-qos2.py /^client_id = socket.gethostname()+".bridge_sample"$/;" v +client_id test/broker/06-bridge-b2br-late-connection-retain.py /^client_id = socket.gethostname()+".bridge_sample"$/;" v +client_id test/broker/06-bridge-b2br-late-connection.py /^client_id = socket.gethostname()+".bridge_sample"$/;" v +client_id test/broker/06-bridge-b2br-remapping.py /^client_id = socket.gethostname()+".bridge_sample"$/;" v +client_id test/broker/06-bridge-br2b-disconnect-qos1.py /^client_id = socket.gethostname()+".bridge_sample"$/;" v +client_id test/broker/06-bridge-br2b-disconnect-qos2.py /^client_id = socket.gethostname()+".bridge_sample"$/;" v +client_id test/broker/06-bridge-br2b-remapping.py /^client_id = socket.gethostname()+".bridge_sample"$/;" v +client_id test/broker/06-bridge-per-listener-settings.py /^client_id = socket.gethostname()+".bridge_sample"$/;" v +client_id test/broker/08-ssl-bridge.py /^client_id = socket.gethostname()+".bridge_test"$/;" v +client_id test/random/random_client.py /^client_id = "cid"+sys.argv[1]$/;" v +client_id_gen src/handle_connect.c /^static char *client_id_gen(int *idlen, const char *auto_id_prefix, int auto_id_prefix_len)$/;" f file: +client_id_generate client/client_shared.c /^int client_id_generate(struct mosq_config *cfg)$/;" f +client_max src/sys_tree.c /^ static int client_max = 0;$/;" l file: +client_msg_count src/db_dump/db_dump.c /^ long client_msg_count = 0;$/;" l +client_opts_set client/client_shared.c /^int client_opts_set(struct mosquitto *mosq, struct mosq_config *cfg)$/;" f +client_qos src/subs.c /^ int client_qos, msg_qos;$/;" l +client_retain src/subs.c /^ bool client_retain;$/;" l +client_state client/rr_client.c /^static enum rr__state client_state = rr_s_new;$/;" v typeref:enum:rr__state file: +client_stats src/db_dump/db_dump.c /^static int client_stats = 0;$/;" v file: +clientid examples/mysql_log/mysql_log.c /^ char clientid[24];$/;" l +clientid lib/handle_connack.c /^ char *clientid = NULL;$/;" l +clientid lib/send_connect.c /^ char *clientid, *username, *password;$/;" l +clientid_index_hash src/mosquitto_broker_internal.h /^ struct clientid__index_hash *clientid_index_hash;$/;" m struct:mosquitto_db typeref:struct:mosquitto_db::clientid__index_hash +clientid_prefixes src/mosquitto_broker_internal.h /^ char *clientid_prefixes;$/;" m struct:mosquitto__config +clients_by_id src/db_dump/db_dump.c /^struct client_chunk *clients_by_id = NULL;$/;" v typeref:struct:client_chunk +clients_expired src/sys_tree.c /^ static int clients_expired = -1;$/;" l file: +cmd client/client_props.c /^ int cmd, identifier, type;$/;" l +cmd_subfolder test/broker/mosq_test_helper.py /^cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],"..")))$/;" v +cmd_subfolder test/lib/mosq_test_helper.py /^cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],"..")))$/;" v +cmdname client/client_props.c /^ char *cmdname = NULL, *propname = NULL;$/;" l +cmsg src/db_dump/db_dump.c /^ struct db_client_msg cmsg = {0};$/;" l +cmsg src/persist_read.c /^ struct mosquitto_client_msg *cmsg;$/;" l +cmsg src/persist_write.c /^ struct mosquitto_client_msg *cmsg;$/;" l +cmsg_props src/database.c /^ mosquitto_property *cmsg_props = NULL, *store_props = NULL;$/;" l +codelen lib/utf8_mosq.c /^ int codelen;$/;" l +codepoint lib/utf8_mosq.c /^ int codepoint;$/;" l +colon client/client_shared.c /^ char *colon = strchr(url, ':');$/;" l +command lib/mosquitto_internal.h /^ uint8_t command;$/;" m struct:mosquitto__packet +con_orig src/mosquitto_passwd.c /^ DWORD con_orig, con_quiet = 0;$/;" l +con_quiet src/mosquitto_passwd.c /^ DWORD con_orig, con_quiet = 0;$/;" l +conf__attempt_resolve src/conf.c /^static int conf__attempt_resolve(const char *host, const char *text, int log, const char *msg)$/;" f file: +conf__parse_bool src/conf.c /^static int conf__parse_bool(char **token, const char *name, bool *value, char *saveptr)$/;" f file: +conf__parse_int src/conf.c /^static int conf__parse_int(char **token, const char *name, int *value, char *saveptr)$/;" f file: +conf__parse_ssize_t src/conf.c /^static int conf__parse_ssize_t(char **token, const char *name, ssize_t *value, char *saveptr)$/;" f file: +conf__parse_string src/conf.c /^static int conf__parse_string(char **token, const char *name, char **value, char *saveptr)$/;" f file: +conf__set_cur_security_options src/conf.c /^static void conf__set_cur_security_options(struct mosquitto__config *config, struct mosquitto__listener *cur_listener, struct mosquitto__security_options **security_options)$/;" f file: +conf_file test/broker/01-connect-anon-denied.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/01-connect-uname-no-password-denied.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/01-connect-uname-password-denied-no-will.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/01-connect-uname-password-denied.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/01-connect-uname-password-success-no-tls.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/01-connect-uname-password-success.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/03-publish-qos1-retain-disabled.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/04-retain-upgrade-outgoing-qos.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/06-bridge-b2br-disconnect-qos1.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/06-bridge-b2br-disconnect-qos2.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/06-bridge-b2br-late-connection-retain.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/06-bridge-b2br-late-connection.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/06-bridge-b2br-remapping.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/06-bridge-br2b-disconnect-qos1.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/06-bridge-br2b-disconnect-qos2.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/06-bridge-br2b-remapping.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/06-bridge-fail-persist-resend-qos1.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/06-bridge-fail-persist-resend-qos2.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/06-bridge-per-listener-settings.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/06-bridge-reconnect-local-out.py /^conf_file = '06-bridge-reconnect-local-out.conf'$/;" v +conf_file test/broker/08-ssl-bridge.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/08-ssl-connect-cert-auth-crl.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/08-ssl-connect-cert-auth-expired.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/08-ssl-connect-cert-auth-revoked.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/08-ssl-connect-cert-auth-without.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/08-ssl-connect-cert-auth.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/08-ssl-connect-identity.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/08-ssl-connect-no-auth-wrong-ca.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/08-ssl-connect-no-auth.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/08-ssl-connect-no-identity.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/08-tls-psk-pub.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/09-acl-change.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/09-extended-auth-change-username.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/09-extended-auth-multistep-reauth.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/09-extended-auth-multistep.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/09-extended-auth-single.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/09-extended-auth-single2.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/09-plugin-auth-acl-pub.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/09-plugin-auth-acl-sub-denied.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/09-plugin-auth-acl-sub.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/09-plugin-auth-context-params.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/09-plugin-auth-defer-unpwd-fail.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/09-plugin-auth-defer-unpwd-success.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/09-plugin-auth-msg-params.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/09-plugin-auth-unpwd-fail.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/09-plugin-auth-unpwd-success.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/09-plugin-auth-v2-unpwd-fail.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/09-plugin-auth-v2-unpwd-success.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/09-pwfile-parse-invalid.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/10-listener-mount-point.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/11-message-expiry.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/11-persistent-subscription-no-local.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/11-persistent-subscription-v5.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/11-persistent-subscription.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/11-pub-props.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/11-subscription-id.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/12-prop-maximum-packet-size-broker.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file test/broker/12-prop-server-keepalive.py /^conf_file = os.path.basename(__file__).replace('.py', '.conf')$/;" v +conf_file1 test/broker/08-tls-psk-bridge.py /^conf_file1 = "08-tls-psk-bridge.conf"$/;" v +conf_file2 test/broker/08-tls-psk-bridge.py /^conf_file2 = "08-tls-psk-bridge.conf2"$/;" v +conf_path src/service.c /^ char conf_path[MAX_PATH + 20];$/;" l +config src/mosquitto.c /^ struct mosquitto__config config;$/;" l +config src/mosquitto_broker_internal.h /^ struct mosquitto__config *config;$/;" m struct:mosquitto_db typeref:struct:mosquitto_db::mosquitto__config +config test/unit/persist_read_test.c /^ struct mosquitto__config config;$/;" l +config test/unit/persist_write_test.c /^ struct mosquitto__config config;$/;" l +config__check src/conf.c /^static int config__check(struct mosquitto__config *config)$/;" f file: +config__cleanup src/conf.c /^void config__cleanup(struct mosquitto__config *config)$/;" f +config__cleanup_plugins src/conf.c /^static void config__cleanup_plugins(struct mosquitto__config *config)$/;" f file: +config__copy src/conf.c /^void config__copy(struct mosquitto__config *src, struct mosquitto__config *dest)$/;" f +config__get_dir_files src/conf_includedir.c /^int config__get_dir_files(const char *include_dir, char ***files, int *file_count)$/;" f +config__init src/conf.c /^void config__init(struct mosquitto_db *db, struct mosquitto__config *config)$/;" f +config__init_reload src/conf.c /^static void config__init_reload(struct mosquitto_db *db, struct mosquitto__config *config)$/;" f file: +config__parse_args src/conf.c /^int config__parse_args(struct mosquitto_db *db, struct mosquitto__config *config, int argc, char *argv[])$/;" f +config__read src/conf.c /^int config__read(struct mosquitto_db *db, struct mosquitto__config *config, bool reload)$/;" f +config__read_file src/conf.c /^int config__read_file(struct mosquitto__config *config, bool reload, const char *file, struct config_recurse *cr, int level, int *lineno)$/;" f +config__read_file_core src/conf.c /^int config__read_file_core(struct mosquitto__config *config, bool reload, struct config_recurse *cr, int level, int *lineno, FILE *fptr, char **buf, int *buflen)$/;" f +config_file src/mosquitto_broker_internal.h /^ char *config_file;$/;" m struct:mosquitto_db +config_recurse src/conf.c /^struct config_recurse {$/;" s file: +config_reload src/conf.c /^ struct mosquitto__config config_reload;$/;" l +connack1_packet test/broker/01-connect-uname-password-denied-no-will.py /^connack1_packet = mosq_test.gen_connack(rc=0)$/;" v +connack1_packet test/broker/02-shared-qos0-v5.py /^connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack1_packet test/broker/02-subpub-qos0-topic-alias.py /^connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack1_packet test/broker/02-subpub-qos1-message-expiry-will.py /^connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack1_packet test/broker/02-subpub-qos1-message-expiry.py /^connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack1_packet test/broker/03-publish-b2c-disconnect-qos1.py /^connack1_packet = mosq_test.gen_connack(flags=0, rc=0)$/;" v +connack1_packet test/broker/03-publish-b2c-disconnect-qos2.py /^connack1_packet = mosq_test.gen_connack(flags=0, rc=0)$/;" v +connack1_packet test/broker/05-clean-session-qos1.py /^connack1_packet = mosq_test.gen_connack(flags=0, rc=0)$/;" v +connack1_packet test/broker/05-session-expiry-v5.py /^connack1_packet = mosq_test.gen_connack(flags=0, rc=0, proto_ver=5)$/;" v +connack1_packet test/broker/09-extended-auth-multistep-reauth.py /^connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props)$/;" v +connack1_packet test/broker/09-plugin-auth-acl-pub.py /^connack1_packet = mosq_test.gen_connack(rc=0)$/;" v +connack1_packet test/broker/11-message-expiry.py /^connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack1a_packet test/broker/09-acl-change.py /^connack1a_packet = mosq_test.gen_connack(rc=0)$/;" v +connack1b_packet test/broker/09-acl-change.py /^connack1b_packet = mosq_test.gen_connack(rc=0, flags=1)$/;" v +connack2_packet test/broker/01-connect-uname-password-denied-no-will.py /^connack2_packet = mosq_test.gen_connack(rc=5)$/;" v +connack2_packet test/broker/02-shared-qos0-v5.py /^connack2_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack2_packet test/broker/02-subpub-qos0-topic-alias.py /^connack2_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack2_packet test/broker/02-subpub-qos1-message-expiry-will.py /^connack2_packet = mosq_test.gen_connack(rc=0, proto_ver=5, flags=1)$/;" v +connack2_packet test/broker/02-subpub-qos1-message-expiry.py /^connack2_packet = mosq_test.gen_connack(rc=0, proto_ver=5, flags=1)$/;" v +connack2_packet test/broker/03-publish-b2c-disconnect-qos1.py /^connack2_packet = mosq_test.gen_connack(flags=1, rc=0)$/;" v +connack2_packet test/broker/03-publish-b2c-disconnect-qos2.py /^connack2_packet = mosq_test.gen_connack(flags=1, rc=0)$/;" v +connack2_packet test/broker/05-clean-session-qos1.py /^connack2_packet = mosq_test.gen_connack(flags=1, rc=0)$/;" v +connack2_packet test/broker/05-session-expiry-v5.py /^connack2_packet = mosq_test.gen_connack(flags=1, rc=0, proto_ver=5)$/;" v +connack2_packet test/broker/09-acl-change.py /^connack2_packet = mosq_test.gen_connack(rc=0)$/;" v +connack2_packet test/broker/09-extended-auth-single.py /^connack2_packet = mosq_test.gen_connack(rc=mqtt5_rc.MQTT_RC_BAD_AUTHENTICATION_METHOD, proto_ver=5, properties=None)$/;" v +connack2_packet test/broker/09-plugin-auth-acl-pub.py /^connack2_packet = mosq_test.gen_connack(rc=0,flags=1)$/;" v +connack2_packet test/broker/11-message-expiry.py /^connack2_packet = mosq_test.gen_connack(rc=0, proto_ver=5, flags=1)$/;" v +connack3_packet test/broker/02-shared-qos0-v5.py /^connack3_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack3_packet test/broker/09-extended-auth-single.py /^connack3_packet = mosq_test.gen_connack(rc=mqtt5_rc.MQTT_RC_NOT_AUTHORIZED, proto_ver=5, properties=None)$/;" v +connack4_packet test/broker/02-shared-qos0-v5.py /^connack4_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack4_packet test/broker/09-extended-auth-single.py /^connack4_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props)$/;" v +connack5_packet test/broker/02-shared-qos0-v5.py /^connack5_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack5_packet test/broker/09-extended-auth-single.py /^connack5_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props)$/;" v +connack_packet test/broker/01-connect-anon-denied.py /^connack_packet = mosq_test.gen_connack(rc=5)$/;" v +connack_packet test/broker/01-connect-disconnect-v5.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/01-connect-duplicate-v5.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/01-connect-duplicate.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/01-connect-invalid-id-0-311.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/01-connect-invalid-id-0.py /^connack_packet = mosq_test.gen_connack(rc=2)$/;" v +connack_packet test/broker/01-connect-invalid-id-missing.py /^connack_packet = mosq_test.gen_connack(rc=2)$/;" v +connack_packet test/broker/01-connect-invalid-protonum.py /^connack_packet = mosq_test.gen_connack(rc=1)$/;" v +connack_packet test/broker/01-connect-success-v5.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/01-connect-success.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/01-connect-uname-no-flag.py /^connack_packet = mosq_test.gen_connack(rc=5)$/;" v +connack_packet test/broker/01-connect-uname-no-password-denied.py /^connack_packet = mosq_test.gen_connack(rc=5)$/;" v +connack_packet test/broker/01-connect-uname-password-denied.py /^connack_packet = mosq_test.gen_connack(rc=5)$/;" v +connack_packet test/broker/01-connect-uname-password-success-no-tls.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/01-connect-uname-password-success.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/01-connect-uname-pwd-no-flag.py /^connack_packet = mosq_test.gen_connack(rc=5)$/;" v +connack_packet test/broker/02-subhier-crash.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/02-subpub-qos0-retain-as-publish.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/02-subpub-qos0-send-retain.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/02-subpub-qos0-subscription-id.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/02-subpub-qos0-topic-alias-unknown.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/02-subpub-qos0-v5.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/02-subpub-qos0.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/02-subpub-qos1-bad-pubcomp.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/02-subpub-qos1-bad-pubrec.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/02-subpub-qos1-message-expiry-retain.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/02-subpub-qos1-nolocal.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/02-subpub-qos1-v5.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/02-subpub-qos1.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/02-subpub-qos2-bad-puback-1.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/02-subpub-qos2-bad-puback-2.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/02-subpub-qos2-bad-pubcomp.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/02-subpub-qos2-pubrec-error-helper.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/02-subpub-qos2-pubrec-error.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/02-subpub-qos2-receive-maximum-1.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/02-subpub-qos2-receive-maximum-2.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/02-subpub-qos2-receive-maximum-helper.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/02-subpub-qos2-v5.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/02-subpub-qos2.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/02-subscribe-invalid-utf8.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/02-subscribe-qos0.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/02-subscribe-qos1.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/02-subscribe-qos2.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/02-unsubscribe-invalid-no-topic.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/02-unsubscribe-qos0.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/02-unsubscribe-qos1.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/02-unsubscribe-qos2-multiple-v5.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/02-unsubscribe-qos2-multiple.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/02-unsubscribe-qos2-v5.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/02-unsubscribe-qos2.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/03-pattern-matching-helper.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/03-publish-b2c-disconnect-qos1-helper.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/03-publish-b2c-disconnect-qos2-helper.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/03-publish-b2c-qos1-len-helper.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/03-publish-b2c-qos2-len-helper.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/03-publish-b2c-timeout-qos1-helper.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/03-publish-b2c-timeout-qos1.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/03-publish-b2c-timeout-qos2-helper.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/03-publish-b2c-timeout-qos2.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/03-publish-c2b-disconnect-qos2.py /^connack_packet = mosq_test.gen_connack(flags=0, rc=0)$/;" v +connack_packet test/broker/03-publish-c2b-timeout-qos2.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/03-publish-dollar-v5.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/03-publish-dollar.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/03-publish-invalid-utf8.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/03-publish-qos1-no-subscribers-v5.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/03-publish-qos1-retain-disabled.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props)$/;" v +connack_packet test/broker/03-publish-qos1.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/03-publish-qos2.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/04-retain-qos0-clear.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/04-retain-qos0-fresh.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/04-retain-qos0-repeated.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/04-retain-qos0.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/04-retain-qos1-qos0.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/04-retain-upgrade-outgoing-qos.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/05-clean-session-qos1-helper.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/06-bridge-b2br-disconnect-qos1.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/06-bridge-b2br-disconnect-qos2.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/06-bridge-b2br-late-connection-retain.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/06-bridge-b2br-late-connection.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/06-bridge-b2br-remapping.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/06-bridge-br2b-disconnect-qos1-helper.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/06-bridge-br2b-disconnect-qos1.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/06-bridge-br2b-disconnect-qos2-helper.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/06-bridge-br2b-disconnect-qos2.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/06-bridge-br2b-remapping.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/06-bridge-fail-persist-resend-qos1.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/06-bridge-fail-persist-resend-qos2.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/06-bridge-per-listener-settings.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/06-bridge-reconnect-local-out-helper.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/06-bridge-reconnect-local-out.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/07-will-null-helper.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/07-will-null-topic.py /^connack_packet = mosq_test.gen_connack(rc=2)$/;" v +connack_packet test/broker/07-will-null.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/08-ssl-bridge-helper.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/08-ssl-bridge.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/08-ssl-connect-cert-auth-crl.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/08-ssl-connect-cert-auth.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/08-ssl-connect-identity.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/08-ssl-connect-no-auth-wrong-ca.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/08-ssl-connect-no-auth.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/08-ssl-connect-no-identity.py /^connack_packet = mosq_test.gen_connack(rc=4)$/;" v +connack_packet test/broker/08-tls-psk-bridge.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/08-tls-psk-pub.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/09-auth-bad-method.py /^connack_packet = mosq_test.gen_connack(rc=mqtt5_rc.MQTT_RC_BAD_AUTHENTICATION_METHOD, proto_ver=5, properties=None)$/;" v +connack_packet test/broker/09-extended-auth-multistep.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props)$/;" v +connack_packet test/broker/09-extended-auth-unsupported.py /^connack_packet = mosq_test.gen_connack(rc=mqtt5_rc.MQTT_RC_BAD_AUTHENTICATION_METHOD, proto_ver=5, properties=None)$/;" v +connack_packet test/broker/09-plugin-auth-acl-sub-denied.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/09-plugin-auth-acl-sub.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/09-plugin-auth-context-params.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/09-plugin-auth-defer-unpwd-fail.py /^connack_packet = mosq_test.gen_connack(rc=5)$/;" v +connack_packet test/broker/09-plugin-auth-defer-unpwd-success.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/09-plugin-auth-msg-params.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/09-plugin-auth-unpwd-fail.py /^connack_packet = mosq_test.gen_connack(rc=5)$/;" v +connack_packet test/broker/09-plugin-auth-unpwd-success.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/09-plugin-auth-v2-unpwd-fail.py /^connack_packet = mosq_test.gen_connack(rc=5)$/;" v +connack_packet test/broker/09-plugin-auth-v2-unpwd-success.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/10-listener-mount-point-helper.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/10-listener-mount-point.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/11-persistent-subscription-no-local.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/11-persistent-subscription-v5.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/11-persistent-subscription.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/broker/11-pub-props.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/11-subscription-id.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/12-prop-maximum-packet-size-broker.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props)$/;" v +connack_packet test/broker/12-prop-maximum-packet-size-publish-qos1.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/12-prop-maximum-packet-size-publish-qos2.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/12-prop-maximum-packet-size-publish.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/12-prop-response-topic-correlation-data.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/12-prop-response-topic.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/broker/12-prop-server-keepalive.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props)$/;" v +connack_packet test/broker/12-prop-session-expiry-invalid.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/lib/01-con-discon-success.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/lib/01-keepalive-pingreq.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/lib/01-server-keepalive-pingreq.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props)$/;" v +connack_packet test/lib/02-subscribe-qos0.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/lib/02-subscribe-qos1.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/lib/02-subscribe-qos2.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/lib/02-unsubscribe-multiple-v5.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/lib/02-unsubscribe-v5.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/lib/02-unsubscribe.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/lib/03-publish-b2c-qos1.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/lib/03-publish-b2c-qos2.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/lib/03-publish-c2b-qos1-disconnect.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/lib/03-publish-c2b-qos1-receive-maximum.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props)$/;" v +connack_packet test/lib/03-publish-c2b-qos1-timeout.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/lib/03-publish-c2b-qos2-disconnect.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/lib/03-publish-c2b-qos2-maximum-qos-0.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props)$/;" v +connack_packet test/lib/03-publish-c2b-qos2-maximum-qos-1.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props)$/;" v +connack_packet test/lib/03-publish-c2b-qos2-pubrec-error.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props)$/;" v +connack_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props)$/;" v +connack_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props)$/;" v +connack_packet test/lib/03-publish-c2b-qos2-timeout.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/lib/03-publish-c2b-qos2.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/lib/03-publish-qos0-no-payload.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/lib/03-publish-qos0.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/lib/03-request-response-correlation.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/lib/03-request-response.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/lib/04-retain-qos0.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/lib/08-ssl-connect-cert-auth-enc.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/lib/08-ssl-connect-cert-auth.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/lib/08-ssl-connect-no-auth.py /^connack_packet = mosq_test.gen_connack(rc=0)$/;" v +connack_packet test/lib/11-prop-oversize-packet.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props)$/;" v +connack_packet test/lib/11-prop-send-content-type.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet test/lib/11-prop-send-payload-format.py /^connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +connack_packet2 test/broker/11-persistent-subscription-no-local.py /^connack_packet2 = mosq_test.gen_connack(rc=0, flags=1, proto_ver=5) # session present$/;" v +connack_packet2 test/broker/11-persistent-subscription-v5.py /^connack_packet2 = mosq_test.gen_connack(rc=0, flags=1, proto_ver=5) # session present$/;" v +connack_packet2 test/broker/11-persistent-subscription.py /^connack_packet2 = mosq_test.gen_connack(rc=0, flags=1) # session present$/;" v +connack_packet2 test/broker/11-subscription-id.py /^connack_packet2 = mosq_test.gen_connack(rc=0, flags=1, proto_ver=5) # session present$/;" v +connack_packet_pub test/broker/02-subscribe-persistence-flipflop.py /^connack_packet_pub = mosq_test.gen_connack(rc=0)$/;" v +connack_packet_sub test/broker/02-subscribe-persistence-flipflop.py /^connack_packet_sub = mosq_test.gen_connack(rc=0)$/;" v +connack_props src/handle_connect.c /^ mosquitto_property *connack_props = NULL;$/;" l +connack_props src/send_connack.c /^ mosquitto_property *connack_props = NULL;$/;" l +connack_string lib/cpp/mosquittopp.cpp /^const char* connack_string(int connack_code)$/;" f namespace:mosqpp +connect lib/cpp/mosquittopp.cpp /^int mosquittopp::connect(const char *host, int port, int keepalive)$/;" f class:mosqpp::mosquittopp +connect lib/cpp/mosquittopp.cpp /^int mosquittopp::connect(const char *host, int port, int keepalive, const char *bind_address)$/;" f class:mosqpp::mosquittopp +connect1_packet test/broker/01-connect-uname-password-denied-no-will.py /^connect1_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="user", password="password", will_topic="will\/test", will_payload=b"will msg")$/;" v +connect1_packet test/broker/02-shared-qos0-v5.py /^connect1_packet = mosq_test.gen_connect("client1", keepalive=keepalive, proto_ver=5)$/;" v +connect1_packet test/broker/02-subpub-qos0-topic-alias.py /^connect1_packet = mosq_test.gen_connect("sub-test", keepalive=keepalive, proto_ver=5)$/;" v +connect1_packet test/broker/09-acl-change.py /^connect1_packet = mosq_test.gen_connect("acl-check", keepalive=keepalive, username=username, clean_session=False)$/;" v +connect1_packet test/broker/09-extended-auth-multistep-reauth.py /^connect1_packet = mosq_test.gen_connect("client-params-test", keepalive=42, proto_ver=5, properties=props)$/;" v +connect1_packet test/broker/09-extended-auth-single.py /^connect1_packet = mosq_test.gen_connect("client-params-test1", keepalive=42, proto_ver=5, properties=props)$/;" v +connect1_packet test/broker/09-plugin-auth-acl-pub.py /^connect1_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="readwrite", clean_session=False)$/;" v +connect1_packet test/lib/03-request-response-correlation.py /^connect1_packet = mosq_test.gen_connect("request-test", keepalive=keepalive, proto_ver=5)$/;" v +connect1_packet test/lib/03-request-response.py /^connect1_packet = mosq_test.gen_connect("request-test", keepalive=keepalive, proto_ver=5)$/;" v +connect2_packet test/broker/01-connect-uname-password-denied-no-will.py /^connect2_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="user", password="password9")$/;" v +connect2_packet test/broker/02-shared-qos0-v5.py /^connect2_packet = mosq_test.gen_connect("client2", keepalive=keepalive, proto_ver=5)$/;" v +connect2_packet test/broker/02-subpub-qos0-topic-alias.py /^connect2_packet = mosq_test.gen_connect("pub-test", keepalive=keepalive, proto_ver=5)$/;" v +connect2_packet test/broker/09-acl-change.py /^connect2_packet = mosq_test.gen_connect("helper", keepalive=keepalive, username=username)$/;" v +connect2_packet test/broker/09-extended-auth-single.py /^connect2_packet = mosq_test.gen_connect("client-params-test2", keepalive=42, proto_ver=5, properties=props)$/;" v +connect2_packet test/broker/09-plugin-auth-acl-pub.py /^connect2_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="readwrite", clean_session=False)$/;" v +connect2_packet test/lib/03-request-response-correlation.py /^connect2_packet = mosq_test.gen_connect("response-test", keepalive=keepalive, proto_ver=5)$/;" v +connect2_packet test/lib/03-request-response.py /^connect2_packet = mosq_test.gen_connect("response-test", keepalive=keepalive, proto_ver=5)$/;" v +connect3_packet test/broker/02-shared-qos0-v5.py /^connect3_packet = mosq_test.gen_connect("client3", keepalive=keepalive, proto_ver=5)$/;" v +connect3_packet test/broker/09-extended-auth-single.py /^connect3_packet = mosq_test.gen_connect("client-params-test3", keepalive=42, proto_ver=5, properties=props)$/;" v +connect4_packet test/broker/02-shared-qos0-v5.py /^connect4_packet = mosq_test.gen_connect("client4", keepalive=keepalive, proto_ver=5)$/;" v +connect4_packet test/broker/09-extended-auth-single.py /^connect4_packet = mosq_test.gen_connect("client-params-test5", keepalive=42, proto_ver=5, properties=props)$/;" v +connect5_packet test/broker/02-shared-qos0-v5.py /^connect5_packet = mosq_test.gen_connect("client5", keepalive=keepalive, proto_ver=5)$/;" v +connect5_packet test/broker/09-extended-auth-single.py /^connect5_packet = mosq_test.gen_connect("client-params-test6", keepalive=42, proto_ver=5, properties=props)$/;" v +connect__on_authorised src/handle_connect.c /^int connect__on_authorised(struct mosquitto_db *db, struct mosquitto *context, void *auth_data_out, uint16_t auth_data_out_len)$/;" f +connect_ack src/handle_connect.c /^ uint8_t connect_ack = 0;$/;" l +connect_acknowledge src/handle_connack.c /^ uint8_t connect_acknowledge;$/;" l +connect_async lib/cpp/mosquittopp.cpp /^int mosquittopp::connect_async(const char *host, int port, int keepalive)$/;" f class:mosqpp::mosquittopp +connect_async lib/cpp/mosquittopp.cpp /^int mosquittopp::connect_async(const char *host, int port, int keepalive, const char *bind_address)$/;" f class:mosqpp::mosquittopp +connect_callback examples/mysql_log/mysql_log.c /^void connect_callback(struct mosquitto *mosq, void *obj, int result)$/;" f +connect_flags lib/handle_connack.c /^ uint8_t connect_flags;$/;" l +connect_flags src/handle_connect.c /^ uint8_t connect_flags;$/;" l +connect_packet test/broker/01-connect-anon-denied.py /^connect_packet = mosq_test.gen_connect("connect-anon-test", keepalive=keepalive)$/;" v +connect_packet test/broker/01-connect-disconnect-v5.py /^connect_packet = mosq_test.gen_connect("connect-disconnect-test", proto_ver=5, keepalive=keepalive)$/;" v +connect_packet test/broker/01-connect-duplicate-v5.py /^connect_packet = mosq_test.gen_connect("connect-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/broker/01-connect-duplicate.py /^connect_packet = mosq_test.gen_connect("connect-test", keepalive=keepalive)$/;" v +connect_packet test/broker/01-connect-invalid-id-0-311.py /^connect_packet = mosq_test.gen_connect("", keepalive=keepalive, proto_ver=4)$/;" v +connect_packet test/broker/01-connect-invalid-id-0.py /^connect_packet = mosq_test.gen_connect("", keepalive=keepalive, proto_ver=3)$/;" v +connect_packet test/broker/01-connect-invalid-id-missing.py /^connect_packet = mosq_test.gen_connect(None, keepalive=keepalive, proto_ver=3)$/;" v +connect_packet test/broker/01-connect-invalid-id-utf8.py /^connect_packet = mosq_test.gen_connect("connect-invalid-utf8", keepalive=keepalive)$/;" v +connect_packet test/broker/01-connect-invalid-id-utf8.py /^connect_packet = struct.pack("B"*len(b), *b)$/;" v +connect_packet test/broker/01-connect-invalid-protonum.py /^connect_packet = mosq_test.gen_connect("connect-invalid-test", keepalive=keepalive, proto_ver=0)$/;" v +connect_packet test/broker/01-connect-invalid-reserved.py /^connect_packet = mosq_test.gen_connect("connect-invalid-test", keepalive=keepalive, connect_reserved=True, proto_ver=4)$/;" v +connect_packet test/broker/01-connect-success-v5.py /^connect_packet = mosq_test.gen_connect("connect-success-test", proto_ver=5, keepalive=keepalive)$/;" v +connect_packet test/broker/01-connect-success.py /^connect_packet = mosq_test.gen_connect("connect-success-test", keepalive=keepalive)$/;" v +connect_packet test/broker/01-connect-uname-invalid-utf8.py /^connect_packet = mosq_test.gen_connect("connect-invalid-utf8", keepalive=keepalive, username="invalid\/utf8")$/;" v +connect_packet test/broker/01-connect-uname-invalid-utf8.py /^connect_packet = struct.pack("B"*len(b), *b)$/;" v +connect_packet test/broker/01-connect-uname-no-flag.py /^connect_packet = mosq_test.gen_connect("connect-uname-test", keepalive=keepalive, username="user")$/;" v +connect_packet test/broker/01-connect-uname-no-flag.py /^connect_packet = struct.pack("B"*len(b), *b)$/;" v +connect_packet test/broker/01-connect-uname-no-password-denied.py /^connect_packet = mosq_test.gen_connect("connect-uname-test", keepalive=keepalive, username="user")$/;" v +connect_packet test/broker/01-connect-uname-password-denied.py /^connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="user", password="password9")$/;" v +connect_packet test/broker/01-connect-uname-password-success-no-tls.py /^connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="user", password="password")$/;" v +connect_packet test/broker/01-connect-uname-password-success.py /^connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="user", password="password")$/;" v +connect_packet test/broker/01-connect-uname-pwd-no-flag.py /^connect_packet = mosq_test.gen_connect("connect-uname-test", keepalive=keepalive, username="user", password="pw")$/;" v +connect_packet test/broker/01-connect-uname-pwd-no-flag.py /^connect_packet = struct.pack("B"*len(b), *b)$/;" v +connect_packet test/broker/02-subhier-crash.py /^connect_packet = mosq_test.gen_connect("subhier-crash", keepalive=keepalive)$/;" v +connect_packet test/broker/02-subpub-qos0-retain-as-publish.py /^connect_packet = mosq_test.gen_connect("subpub-qos1-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/broker/02-subpub-qos0-send-retain.py /^connect_packet = mosq_test.gen_connect("subpub-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/broker/02-subpub-qos0-subscription-id.py /^connect_packet = mosq_test.gen_connect("subpub-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/broker/02-subpub-qos0-topic-alias-unknown.py /^connect_packet = mosq_test.gen_connect("sub-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/broker/02-subpub-qos0-v5.py /^connect_packet = mosq_test.gen_connect("subpub-qos0-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/broker/02-subpub-qos0.py /^connect_packet = mosq_test.gen_connect("subpub-qos0-test", keepalive=keepalive)$/;" v +connect_packet test/broker/02-subpub-qos1-bad-pubcomp.py /^connect_packet = mosq_test.gen_connect("subpub-qos1-test", keepalive=keepalive)$/;" v +connect_packet test/broker/02-subpub-qos1-bad-pubrec.py /^connect_packet = mosq_test.gen_connect("subpub-qos1-test", keepalive=keepalive)$/;" v +connect_packet test/broker/02-subpub-qos1-message-expiry-retain.py /^connect_packet = mosq_test.gen_connect("subpub", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/broker/02-subpub-qos1-message-expiry-will.py /^connect_packet = mosq_test.gen_connect("subpub-qos0-test", keepalive=keepalive, proto_ver=5, clean_session=False, properties=props)$/;" v +connect_packet test/broker/02-subpub-qos1-message-expiry.py /^connect_packet = mosq_test.gen_connect("subpub-qos0-test", keepalive=keepalive, proto_ver=5, clean_session=False, properties=props)$/;" v +connect_packet test/broker/02-subpub-qos1-nolocal.py /^connect_packet = mosq_test.gen_connect("subpub-qos1-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/broker/02-subpub-qos1-v5.py /^connect_packet = mosq_test.gen_connect("subpub-qos1-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/broker/02-subpub-qos1.py /^connect_packet = mosq_test.gen_connect("subpub-qos1-test", keepalive=keepalive)$/;" v +connect_packet test/broker/02-subpub-qos2-bad-puback-1.py /^connect_packet = mosq_test.gen_connect("subpub-qos2-test", keepalive=keepalive)$/;" v +connect_packet test/broker/02-subpub-qos2-bad-puback-2.py /^connect_packet = mosq_test.gen_connect("subpub-qos2-test", keepalive=keepalive)$/;" v +connect_packet test/broker/02-subpub-qos2-bad-pubcomp.py /^connect_packet = mosq_test.gen_connect("subpub-qos2-test", keepalive=keepalive)$/;" v +connect_packet test/broker/02-subpub-qos2-pubrec-error-helper.py /^connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive)$/;" v +connect_packet test/broker/02-subpub-qos2-pubrec-error.py /^connect_packet = mosq_test.gen_connect("pub-qo2-timeout-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/broker/02-subpub-qos2-receive-maximum-1.py /^connect_packet = mosq_test.gen_connect("subpub-qos2-test", keepalive=keepalive, proto_ver=5, properties=props)$/;" v +connect_packet test/broker/02-subpub-qos2-receive-maximum-2.py /^connect_packet = mosq_test.gen_connect("subpub-qos2-test", keepalive=keepalive, proto_ver=5, properties=props)$/;" v +connect_packet test/broker/02-subpub-qos2-receive-maximum-helper.py /^connect_packet = mosq_test.gen_connect("subpub-qos2-test-helper", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/broker/02-subpub-qos2-v5.py /^connect_packet = mosq_test.gen_connect("subpub-qos2-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/broker/02-subpub-qos2.py /^connect_packet = mosq_test.gen_connect("subpub-qos2-test", keepalive=keepalive)$/;" v +connect_packet test/broker/02-subscribe-invalid-utf8.py /^connect_packet = mosq_test.gen_connect("subscribe-invalid-utf8", keepalive=keepalive)$/;" v +connect_packet test/broker/02-subscribe-qos0.py /^connect_packet = mosq_test.gen_connect("subscribe-qos0-test", keepalive=keepalive)$/;" v +connect_packet test/broker/02-subscribe-qos1.py /^connect_packet = mosq_test.gen_connect("subscribe-qos1-test", keepalive=keepalive)$/;" v +connect_packet test/broker/02-subscribe-qos2.py /^connect_packet = mosq_test.gen_connect("subscribe-qos2-test", keepalive=keepalive)$/;" v +connect_packet test/broker/02-unsubscribe-invalid-no-topic.py /^connect_packet = mosq_test.gen_connect("unsubscribe-invalid-no-topic-test", keepalive=keepalive, proto_ver=4)$/;" v +connect_packet test/broker/02-unsubscribe-qos0.py /^connect_packet = mosq_test.gen_connect("unsubscribe-qos0-test", keepalive=keepalive)$/;" v +connect_packet test/broker/02-unsubscribe-qos1.py /^connect_packet = mosq_test.gen_connect("unsubscribe-qos1-test", keepalive=keepalive)$/;" v +connect_packet test/broker/02-unsubscribe-qos2-multiple-v5.py /^connect_packet = mosq_test.gen_connect("unsubscribe-qos2-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/broker/02-unsubscribe-qos2-multiple.py /^connect_packet = mosq_test.gen_connect("unsubscribe-qos2-test", keepalive=keepalive)$/;" v +connect_packet test/broker/02-unsubscribe-qos2-v5.py /^connect_packet = mosq_test.gen_connect("unsubscribe-qos2-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/broker/02-unsubscribe-qos2.py /^connect_packet = mosq_test.gen_connect("unsubscribe-qos2-test", keepalive=keepalive)$/;" v +connect_packet test/broker/03-pattern-matching-helper.py /^connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive)$/;" v +connect_packet test/broker/03-publish-b2c-disconnect-qos1-helper.py /^connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive)$/;" v +connect_packet test/broker/03-publish-b2c-disconnect-qos1.py /^connect_packet = mosq_test.gen_connect("pub-qos1-disco-test", keepalive=keepalive, clean_session=False)$/;" v +connect_packet test/broker/03-publish-b2c-disconnect-qos2-helper.py /^connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive)$/;" v +connect_packet test/broker/03-publish-b2c-disconnect-qos2.py /^connect_packet = mosq_test.gen_connect("pub-qos2-disco-test", keepalive=keepalive, clean_session=False)$/;" v +connect_packet test/broker/03-publish-b2c-qos1-len-helper.py /^connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive)$/;" v +connect_packet test/broker/03-publish-b2c-qos2-len-helper.py /^connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive)$/;" v +connect_packet test/broker/03-publish-b2c-timeout-qos1-helper.py /^connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive)$/;" v +connect_packet test/broker/03-publish-b2c-timeout-qos1.py /^connect_packet = mosq_test.gen_connect("pub-qos1-timeout-test", keepalive=keepalive)$/;" v +connect_packet test/broker/03-publish-b2c-timeout-qos2-helper.py /^connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive)$/;" v +connect_packet test/broker/03-publish-b2c-timeout-qos2.py /^connect_packet = mosq_test.gen_connect("pub-qo2-timeout-test", keepalive=keepalive)$/;" v +connect_packet test/broker/03-publish-c2b-disconnect-qos2.py /^connect_packet = mosq_test.gen_connect("pub-qos2-disco-test", keepalive=keepalive, clean_session=False, proto_ver=3)$/;" v +connect_packet test/broker/03-publish-c2b-timeout-qos2.py /^connect_packet = mosq_test.gen_connect("pub-qos2-timeout-test", keepalive=keepalive)$/;" v +connect_packet test/broker/03-publish-dollar-v5.py /^connect_packet = mosq_test.gen_connect("pub-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/broker/03-publish-dollar.py /^connect_packet = mosq_test.gen_connect("pub-dollar-test", keepalive=keepalive)$/;" v +connect_packet test/broker/03-publish-invalid-utf8.py /^connect_packet = mosq_test.gen_connect("publish-invalid-utf8", keepalive=keepalive)$/;" v +connect_packet test/broker/03-publish-qos1-no-subscribers-v5.py /^connect_packet = mosq_test.gen_connect("pub-qos1-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/broker/03-publish-qos1-retain-disabled.py /^connect_packet = mosq_test.gen_connect("pub-qos1-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/broker/03-publish-qos1.py /^connect_packet = mosq_test.gen_connect("pub-qos1-test", keepalive=keepalive)$/;" v +connect_packet test/broker/03-publish-qos2.py /^connect_packet = mosq_test.gen_connect("pub-qos2-test", keepalive=keepalive)$/;" v +connect_packet test/broker/04-retain-qos0-clear.py /^connect_packet = mosq_test.gen_connect("retain-clear-test", keepalive=keepalive)$/;" v +connect_packet test/broker/04-retain-qos0-fresh.py /^connect_packet = mosq_test.gen_connect("retain-qos0-fresh-test", keepalive=keepalive)$/;" v +connect_packet test/broker/04-retain-qos0-repeated.py /^connect_packet = mosq_test.gen_connect("retain-qos0-rep-test", keepalive=keepalive)$/;" v +connect_packet test/broker/04-retain-qos0.py /^connect_packet = mosq_test.gen_connect("retain-qos0-test", keepalive=keepalive)$/;" v +connect_packet test/broker/04-retain-qos1-qos0.py /^connect_packet = mosq_test.gen_connect("retain-qos1-test", keepalive=keepalive)$/;" v +connect_packet test/broker/04-retain-upgrade-outgoing-qos.py /^connect_packet = mosq_test.gen_connect("retain-qos0-test", keepalive=keepalive)$/;" v +connect_packet test/broker/05-clean-session-qos1-helper.py /^connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive)$/;" v +connect_packet test/broker/05-clean-session-qos1.py /^connect_packet = mosq_test.gen_connect("clean-qos2-test", keepalive=keepalive, clean_session=False)$/;" v +connect_packet test/broker/05-session-expiry-v5.py /^connect_packet = mosq_test.gen_connect("clean-qos2-test", keepalive=keepalive, clean_session=False, proto_ver=5, properties=props)$/;" v +connect_packet test/broker/06-bridge-b2br-disconnect-qos1.py /^connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+4)$/;" v +connect_packet test/broker/06-bridge-b2br-disconnect-qos2.py /^connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+4)$/;" v +connect_packet test/broker/06-bridge-b2br-late-connection-retain.py /^connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+4)$/;" v +connect_packet test/broker/06-bridge-b2br-late-connection.py /^connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+4)$/;" v +connect_packet test/broker/06-bridge-b2br-remapping.py /^connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+4)$/;" v +connect_packet test/broker/06-bridge-br2b-disconnect-qos1-helper.py /^connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive)$/;" v +connect_packet test/broker/06-bridge-br2b-disconnect-qos1.py /^connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+4)$/;" v +connect_packet test/broker/06-bridge-br2b-disconnect-qos2-helper.py /^connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive)$/;" v +connect_packet test/broker/06-bridge-br2b-disconnect-qos2.py /^connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+4)$/;" v +connect_packet test/broker/06-bridge-br2b-remapping.py /^connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+4)$/;" v +connect_packet test/broker/06-bridge-fail-persist-resend-qos1.py /^connect_packet = mosq_test.gen_connect("bridge-u-test", keepalive=keepalive)$/;" v +connect_packet test/broker/06-bridge-fail-persist-resend-qos2.py /^connect_packet = mosq_test.gen_connect("bridge-u-test", keepalive=keepalive)$/;" v +connect_packet test/broker/06-bridge-per-listener-settings.py /^connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+4)$/;" v +connect_packet test/broker/06-bridge-reconnect-local-out-helper.py /^connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive)$/;" v +connect_packet test/broker/06-bridge-reconnect-local-out.py /^connect_packet = mosq_test.gen_connect("bridge-reconnect-test", keepalive=keepalive)$/;" v +connect_packet test/broker/07-will-invalid-utf8.py /^connect_packet = mosq_test.gen_connect("will-invalid-utf8", keepalive=keepalive, will_topic="invalid\/utf8")$/;" v +connect_packet test/broker/07-will-invalid-utf8.py /^connect_packet = struct.pack("B"*len(b), *b)$/;" v +connect_packet test/broker/07-will-no-flag.py /^connect_packet = mosq_test.gen_connect("will-no-payload", keepalive=keepalive, will_topic="will\/topic", will_qos=1, will_retain=True)$/;" v +connect_packet test/broker/07-will-no-flag.py /^connect_packet = struct.pack("B"*len(bmod), *bmod)$/;" v +connect_packet test/broker/07-will-null-helper.py /^connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive, will_topic="will\/null\/test")$/;" v +connect_packet test/broker/07-will-null-topic.py /^connect_packet = mosq_test.gen_connect("will-null-topic", keepalive=keepalive, will_topic="", will_payload=struct.pack("!4sB7s", b"will", 0, b"message"))$/;" v +connect_packet test/broker/07-will-null.py /^connect_packet = mosq_test.gen_connect("will-qos0-test", keepalive=keepalive)$/;" v +connect_packet test/broker/08-ssl-bridge-helper.py /^connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive)$/;" v +connect_packet test/broker/08-ssl-bridge.py /^connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+4)$/;" v +connect_packet test/broker/08-ssl-connect-cert-auth-crl.py /^connect_packet = mosq_test.gen_connect("connect-success-test", keepalive=keepalive)$/;" v +connect_packet test/broker/08-ssl-connect-cert-auth-expired.py /^connect_packet = mosq_test.gen_connect("connect-success-test", keepalive=keepalive)$/;" v +connect_packet test/broker/08-ssl-connect-cert-auth-revoked.py /^connect_packet = mosq_test.gen_connect("connect-revoked-test", keepalive=keepalive)$/;" v +connect_packet test/broker/08-ssl-connect-cert-auth-without.py /^connect_packet = mosq_test.gen_connect("connect-cert-test", keepalive=keepalive)$/;" v +connect_packet test/broker/08-ssl-connect-cert-auth.py /^connect_packet = mosq_test.gen_connect("connect-success-test", keepalive=keepalive)$/;" v +connect_packet test/broker/08-ssl-connect-identity.py /^connect_packet = mosq_test.gen_connect("connect-identity-test", keepalive=keepalive)$/;" v +connect_packet test/broker/08-ssl-connect-no-auth-wrong-ca.py /^connect_packet = mosq_test.gen_connect("connect-success-test", keepalive=keepalive)$/;" v +connect_packet test/broker/08-ssl-connect-no-auth.py /^connect_packet = mosq_test.gen_connect("connect-success-test", keepalive=keepalive)$/;" v +connect_packet test/broker/08-ssl-connect-no-identity.py /^connect_packet = mosq_test.gen_connect("connect-no-identity-test", keepalive=keepalive)$/;" v +connect_packet test/broker/08-tls-psk-bridge.py /^connect_packet = mosq_test.gen_connect("no-psk-test-client", keepalive=keepalive)$/;" v +connect_packet test/broker/08-tls-psk-pub.py /^connect_packet = mosq_test.gen_connect("no-psk-test-client", keepalive=keepalive)$/;" v +connect_packet test/broker/09-auth-bad-method.py /^connect_packet = mosq_test.gen_connect("connect-test", proto_ver=5, keepalive=keepalive, properties=props)$/;" v +connect_packet test/broker/09-extended-auth-multistep.py /^connect_packet = mosq_test.gen_connect("client-params-test", keepalive=42, proto_ver=5, properties=props)$/;" v +connect_packet test/broker/09-extended-auth-unsupported.py /^connect_packet = mosq_test.gen_connect("client-params-test", keepalive=42, proto_ver=5, properties=props)$/;" v +connect_packet test/broker/09-plugin-auth-acl-sub-denied.py /^connect_packet = mosq_test.gen_connect("sub-denied-test", keepalive=keepalive, username="denied")$/;" v +connect_packet test/broker/09-plugin-auth-acl-sub.py /^connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="readonly")$/;" v +connect_packet test/broker/09-plugin-auth-context-params.py /^connect_packet = mosq_test.gen_connect("client-params-test", keepalive=42, username="client-username")$/;" v +connect_packet test/broker/09-plugin-auth-defer-unpwd-fail.py /^connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="test-username@v2", password="doesNotMatter")$/;" v +connect_packet test/broker/09-plugin-auth-defer-unpwd-success.py /^connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="test-username@v2", password="doesNotMatter")$/;" v +connect_packet test/broker/09-plugin-auth-msg-params.py /^connect_packet = mosq_test.gen_connect("msg-param-test", keepalive=keepalive)$/;" v +connect_packet test/broker/09-plugin-auth-unpwd-fail.py /^connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="test-username", password="wrong")$/;" v +connect_packet test/broker/09-plugin-auth-unpwd-success.py /^connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="test-username", password="cnwTICONIURW")$/;" v +connect_packet test/broker/09-plugin-auth-v2-unpwd-fail.py /^connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="test-username", password="wrong")$/;" v +connect_packet test/broker/09-plugin-auth-v2-unpwd-success.py /^connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="test-username", password="cnwTICONIURW")$/;" v +connect_packet test/broker/10-listener-mount-point-helper.py /^connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive)$/;" v +connect_packet test/broker/10-listener-mount-point.py /^connect_packet = mosq_test.gen_connect("test2", keepalive=keepalive)$/;" v +connect_packet test/broker/11-message-expiry.py /^connect_packet = mosq_test.gen_connect("subpub-qos0-test", keepalive=keepalive, proto_ver=5, clean_session=False, properties=props)$/;" v +connect_packet test/broker/11-persistent-subscription-no-local.py /^connect_packet = mosq_test.gen_connect($/;" v +connect_packet test/broker/11-persistent-subscription-v5.py /^connect_packet = mosq_test.gen_connect($/;" v +connect_packet test/broker/11-persistent-subscription.py /^connect_packet = mosq_test.gen_connect($/;" v +connect_packet test/broker/11-pub-props.py /^connect_packet = mosq_test.gen_connect($/;" v +connect_packet test/broker/11-subscription-id.py /^connect_packet = mosq_test.gen_connect($/;" v +connect_packet test/broker/12-prop-maximum-packet-size-broker.py /^connect_packet = mosq_test.gen_connect("test", proto_ver=5, keepalive=keepalive)$/;" v +connect_packet test/broker/12-prop-maximum-packet-size-connect.py /^connect_packet = mosq_test.gen_connect("test", proto_ver=5, keepalive=keepalive, properties=props)$/;" v +connect_packet test/broker/12-prop-maximum-packet-size-publish-qos1.py /^connect_packet = mosq_test.gen_connect("test", proto_ver=5, keepalive=keepalive, properties=props)$/;" v +connect_packet test/broker/12-prop-maximum-packet-size-publish-qos2.py /^connect_packet = mosq_test.gen_connect("test", proto_ver=5, keepalive=keepalive, properties=props)$/;" v +connect_packet test/broker/12-prop-maximum-packet-size-publish.py /^connect_packet = mosq_test.gen_connect("test", proto_ver=5, keepalive=keepalive, properties=props)$/;" v +connect_packet test/broker/12-prop-server-keepalive.py /^connect_packet = mosq_test.gen_connect("test", proto_ver=5, keepalive=keepalive)$/;" v +connect_packet test/broker/12-prop-session-expiry-invalid.py /^connect_packet = mosq_test.gen_connect("test", proto_ver=5, keepalive=keepalive, properties=props)$/;" v +connect_packet test/lib/01-con-discon-success.py /^connect_packet = mosq_test.gen_connect("01-con-discon-success", keepalive=keepalive)$/;" v +connect_packet test/lib/01-keepalive-pingreq.py /^connect_packet = mosq_test.gen_connect("01-keepalive-pingreq", keepalive=keepalive)$/;" v +connect_packet test/lib/01-no-clean-session.py /^connect_packet = mosq_test.gen_connect("01-no-clean-session", clean_session=False, keepalive=keepalive)$/;" v +connect_packet test/lib/01-server-keepalive-pingreq.py /^connect_packet = mosq_test.gen_connect("01-server-keepalive-pingreq", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/lib/01-unpwd-set.py /^connect_packet = mosq_test.gen_connect("01-unpwd-set", keepalive=keepalive, username="uname", password=";'[08gn=#")$/;" v +connect_packet test/lib/01-will-set.py /^connect_packet = mosq_test.gen_connect("01-will-set", keepalive=keepalive, will_topic="topic\/on\/unexpected\/disconnect", will_qos=1, will_retain=True, will_payload=b"will message")$/;" v +connect_packet test/lib/01-will-unpwd-set.py /^connect_packet = mosq_test.gen_connect("01-will-unpwd-set",$/;" v +connect_packet test/lib/02-subscribe-qos0.py /^connect_packet = mosq_test.gen_connect("subscribe-qos0-test", keepalive=keepalive)$/;" v +connect_packet test/lib/02-subscribe-qos1.py /^connect_packet = mosq_test.gen_connect("subscribe-qos1-test", keepalive=keepalive)$/;" v +connect_packet test/lib/02-subscribe-qos2.py /^connect_packet = mosq_test.gen_connect("subscribe-qos2-test", keepalive=keepalive)$/;" v +connect_packet test/lib/02-unsubscribe-multiple-v5.py /^connect_packet = mosq_test.gen_connect("unsubscribe-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/lib/02-unsubscribe-v5.py /^connect_packet = mosq_test.gen_connect("unsubscribe-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/lib/02-unsubscribe.py /^connect_packet = mosq_test.gen_connect("unsubscribe-test", keepalive=keepalive)$/;" v +connect_packet test/lib/03-publish-b2c-qos1.py /^connect_packet = mosq_test.gen_connect("publish-qos1-test", keepalive=keepalive)$/;" v +connect_packet test/lib/03-publish-b2c-qos2.py /^connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive)$/;" v +connect_packet test/lib/03-publish-c2b-qos1-disconnect.py /^connect_packet = mosq_test.gen_connect("publish-qos1-test", keepalive=keepalive)$/;" v +connect_packet test/lib/03-publish-c2b-qos1-receive-maximum.py /^connect_packet = mosq_test.gen_connect("publish-qos1-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/lib/03-publish-c2b-qos1-timeout.py /^connect_packet = mosq_test.gen_connect("publish-qos1-test", keepalive=keepalive)$/;" v +connect_packet test/lib/03-publish-c2b-qos2-disconnect.py /^connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive)$/;" v +connect_packet test/lib/03-publish-c2b-qos2-maximum-qos-0.py /^connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/lib/03-publish-c2b-qos2-maximum-qos-1.py /^connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/lib/03-publish-c2b-qos2-pubrec-error.py /^connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/lib/03-publish-c2b-qos2-timeout.py /^connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive)$/;" v +connect_packet test/lib/03-publish-c2b-qos2.py /^connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive)$/;" v +connect_packet test/lib/03-publish-qos0-no-payload.py /^connect_packet = mosq_test.gen_connect("publish-qos0-test-np", keepalive=keepalive)$/;" v +connect_packet test/lib/03-publish-qos0.py /^connect_packet = mosq_test.gen_connect("publish-qos0-test", keepalive=keepalive)$/;" v +connect_packet test/lib/04-retain-qos0.py /^connect_packet = mosq_test.gen_connect("retain-qos0-test", keepalive=keepalive)$/;" v +connect_packet test/lib/08-ssl-connect-cert-auth-enc.py /^connect_packet = mosq_test.gen_connect("08-ssl-connect-crt-auth-enc", keepalive=keepalive)$/;" v +connect_packet test/lib/08-ssl-connect-cert-auth.py /^connect_packet = mosq_test.gen_connect("08-ssl-connect-crt-auth", keepalive=keepalive)$/;" v +connect_packet test/lib/08-ssl-connect-no-auth.py /^connect_packet = mosq_test.gen_connect("08-ssl-connect-no-auth", keepalive=keepalive)$/;" v +connect_packet test/lib/11-prop-oversize-packet.py /^connect_packet = mosq_test.gen_connect("publish-qos0-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/lib/11-prop-send-content-type.py /^connect_packet = mosq_test.gen_connect("prop-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet test/lib/11-prop-send-payload-format.py /^connect_packet = mosq_test.gen_connect("prop-test", keepalive=keepalive, proto_ver=5)$/;" v +connect_packet1 test/broker/12-prop-response-topic-correlation-data.py /^connect_packet1 = mosq_test.gen_connect("client1", proto_ver=5, keepalive=keepalive)$/;" v +connect_packet1 test/broker/12-prop-response-topic.py /^connect_packet1 = mosq_test.gen_connect("client1", proto_ver=5, keepalive=keepalive)$/;" v +connect_packet2 test/broker/12-prop-response-topic-correlation-data.py /^connect_packet2 = mosq_test.gen_connect("client2", proto_ver=5, keepalive=keepalive)$/;" v +connect_packet2 test/broker/12-prop-response-topic.py /^connect_packet2 = mosq_test.gen_connect("client2", proto_ver=5, keepalive=keepalive)$/;" v +connect_packet_pub test/broker/02-subscribe-persistence-flipflop.py /^connect_packet_pub = mosq_test.gen_connect("flipflop-test-pub", keepalive=keepalive)$/;" v +connect_packet_sub_clean test/broker/02-subscribe-persistence-flipflop.py /^connect_packet_sub_clean = mosq_test.gen_connect("flipflop-test", keepalive=keepalive, clean_session=True)$/;" v +connect_packet_sub_persistent test/broker/02-subscribe-persistence-flipflop.py /^connect_packet_sub_persistent = mosq_test.gen_connect("flipflop-test", keepalive=keepalive, clean_session=False)$/;" v +connect_props client/client_shared.h /^ mosquitto_property *connect_props;$/;" m struct:mosq_config +connected_count src/sys_tree.c /^ static int connected_count = -1;$/;" l file: +connection examples/mysql_log/mysql_log.c /^ MYSQL *connection;$/;" l +connection_check_acl src/handle_connect.c /^void connection_check_acl(struct mosquitto_db *db, struct mosquitto *context, struct mosquitto_client_msg **head)$/;" f +connection_interval src/sys_tree.c /^ double connection_interval;$/;" l +connection_load1 src/sys_tree.c /^ static double connection_load1 = 0;$/;" l file: +connection_load15 src/sys_tree.c /^ static double connection_load15 = 0;$/;" l file: +connection_load5 src/sys_tree.c /^ static double connection_load5 = 0;$/;" l file: +connection_messages src/mosquitto_broker_internal.h /^ bool connection_messages;$/;" m struct:mosquitto__config +context lib/mosquitto_internal.h /^ struct mosquitto *context;$/;" m struct:session_expiry_list typeref:struct:session_expiry_list::mosquitto +context lib/mosquitto_internal.h /^ struct mosquitto *context;$/;" m struct:will_delay_list typeref:struct:will_delay_list::mosquitto +context src/context.c /^ struct mosquitto *context, *next;$/;" l +context src/context.c /^ struct mosquitto *context;$/;" l +context src/loop.c /^ struct mosquitto *context, *ctxt_tmp;$/;" l +context src/loop.c /^ struct mosquitto *context;$/;" l +context src/mosquitto_broker_internal.h /^ struct mosquitto *context;$/;" m struct:mosquitto__subleaf typeref:struct:mosquitto__subleaf::mosquitto +context src/mosquitto_passwd.c /^ EVP_MD_CTX *context;$/;" l +context src/mosquitto_passwd.c /^ EVP_MD_CTX context;$/;" l +context src/net.c /^ struct mosquitto *context;$/;" l +context src/persist_read.c /^ struct mosquitto *context;$/;" l +context src/persist_write.c /^ struct mosquitto *context, *ctxt_tmp;$/;" l +context src/security_default.c /^ EVP_MD_CTX *context;$/;" l +context src/security_default.c /^ EVP_MD_CTX context;$/;" l +context src/security_default.c /^ struct mosquitto *context, *ctxt_tmp;$/;" l +context src/session_expiry.c /^ struct mosquitto *context;$/;" l +context test/unit/persist_read_test.c /^ struct mosquitto *context;$/;" l +context__add_to_disused src/context.c /^void context__add_to_disused(struct mosquitto_db *db, struct mosquitto *context)$/;" f +context__cleanup src/context.c /^void context__cleanup(struct mosquitto_db *db, struct mosquitto *context, bool do_free)$/;" f +context__disconnect src/context.c /^void context__disconnect(struct mosquitto_db *db, struct mosquitto *context)$/;" f +context__free_disused src/context.c /^void context__free_disused(struct mosquitto_db *db)$/;" f +context__init src/context.c /^struct mosquitto *context__init(struct mosquitto_db *db, mosq_sock_t sock)$/;" f +context__init test/unit/persist_read_stubs.c /^struct mosquitto *context__init(struct mosquitto_db *db, mosq_sock_t sock)$/;" f +context__init test/unit/persist_write_stubs.c /^struct mosquitto *context__init(struct mosquitto_db *db, mosq_sock_t sock)$/;" f +context__remove_from_by_id src/context.c /^void context__remove_from_by_id(struct mosquitto_db *db, struct mosquitto *context)$/;" f +context__send_will src/context.c /^void context__send_will(struct mosquitto_db *db, struct mosquitto *ctxt)$/;" f +context__set_state src/context.c /^void context__set_state(struct mosquitto *context, enum mosquitto_client_state state)$/;" f +contexts_by_id src/mosquitto_broker_internal.h /^ struct mosquitto *contexts_by_id;$/;" m struct:mosquitto_db typeref:struct:mosquitto_db::mosquitto +contexts_by_sock src/mosquitto_broker_internal.h /^ struct mosquitto *contexts_by_sock;$/;" m struct:mosquitto_db typeref:struct:mosquitto_db::mosquitto +contexts_for_free src/mosquitto_broker_internal.h /^ struct mosquitto *contexts_for_free;$/;" m struct:mosquitto_db typeref:struct:mosquitto_db::mosquitto +copy_contents src/mosquitto_passwd.c /^int copy_contents(FILE *src, FILE *dest)$/;" f +count client/client_shared.c /^ int count;$/;" l +count lib/packet_datatypes.c /^ int count = 0;$/;" l +count src/deps/uthash.h /^ unsigned count;$/;" m struct:UT_hash_bucket +count src/websockets.c /^ int count, i, j;$/;" l +count test/unit/property_add.c /^ int count;$/;" l +count_by_sock src/sys_tree.c /^ int count_total, count_by_sock;$/;" l +count_total src/sys_tree.c /^ int count_total, count_by_sock;$/;" l +counts test/broker/03-publish-qos1-queued-bytes.py /^ counts = StoreCounts()$/;" v +cp lib/net_mosq_ocsp.c /^ const unsigned char *cp;$/;" l +cq test/broker/03-publish-qos1-queued-bytes.py /^cq = Queue.Queue()$/;" v +cr src/conf.c /^ struct config_recurse cr;$/;" l +crc src/db_dump/db_dump.c /^ uint32_t crc;$/;" l +crc src/persist_read.c /^ uint32_t crc;$/;" l +crc src/persist_write.c /^ uint32_t crc = 0;$/;" l +create_backup src/mosquitto_passwd.c /^int create_backup(const char *backup_file, FILE *fptr)$/;" f +create_new src/mosquitto_passwd.c /^ bool create_new = false;$/;" l +crl_reason lib/net_mosq_ocsp.c /^ int cert_status, crl_reason;$/;" l +crlfile src/mosquitto_broker_internal.h /^ char *crlfile;$/;" m struct:mosquitto__listener +ctxt src/mosquitto.c /^ struct mosquitto *ctxt, *ctxt_tmp;$/;" l +ctxt_tmp src/loop.c /^ struct mosquitto *context, *ctxt_tmp;$/;" l +ctxt_tmp src/loop.c /^ struct mosquitto *ctxt_tmp;$/;" l +ctxt_tmp src/mosquitto.c /^ struct mosquitto *ctxt, *ctxt_tmp;$/;" l +ctxt_tmp src/persist_write.c /^ struct mosquitto *context, *ctxt_tmp;$/;" l +ctxt_tmp src/security_default.c /^ struct mosquitto *context, *ctxt_tmp;$/;" l +cur lib/messages_mosq.c /^ struct mosquitto_message_all *cur, *tmp;$/;" l +cur_address src/mosquitto_broker_internal.h /^ int cur_address;$/;" m struct:mosquitto__bridge +cur_auth_plugin_config src/conf.c /^ struct mosquitto__auth_plugin_config *cur_auth_plugin_config = NULL;$/;" l +cur_bridge src/conf.c /^ struct mosquitto__bridge *cur_bridge = NULL;$/;" l +cur_listener src/conf.c /^ struct mosquitto__listener *cur_listener = &config->default_listener;$/;" l +cur_security_options src/conf.c /^static struct mosquitto__security_options *cur_security_options = NULL;$/;" v typeref:struct:mosquitto__security_options file: +cur_topic lib/send_publish.c /^ struct mosquitto__bridge_topic *cur_topic;$/;" l +cur_topic src/conf.c /^ struct mosquitto__bridge_topic *cur_topic;$/;" l +cur_topic src/handle_publish.c /^ struct mosquitto__bridge_topic *cur_topic;$/;" l +current_heap src/sys_tree.c /^ static unsigned long current_heap = -1;$/;" l file: +current_out_packet lib/mosquitto_internal.h /^ struct mosquitto__packet *current_out_packet;$/;" m struct:mosquitto typeref:struct:mosquitto::mosquitto__packet +current_out_packet_mutex lib/mosquitto_internal.h /^ pthread_mutex_t current_out_packet_mutex;$/;" m struct:mosquitto +daemon src/mosquitto_broker_internal.h /^ bool daemon;$/;" m struct:mosquitto__config +data lib/tls_mosq.c /^ const unsigned char *data;$/;" l +data test/broker/01-connect-bad-packet.py /^ data = sock.recv(1)$/;" v +data test/broker/01-connect-duplicate-v5.py /^ data = sock.recv(1)$/;" v +data test/broker/01-connect-duplicate.py /^ data = sock.recv(1)$/;" v +data1 test/unit/persist_write_test.c /^ uint8_t *data1 = NULL, *data2 = NULL;$/;" l +data2 test/unit/persist_write_test.c /^ uint8_t *data1 = NULL, *data2 = NULL;$/;" l +data_start src/handle_connect.c /^ char *data_start = NULL;$/;" l +db src/db_dump/db_dump.c /^ struct mosquitto_db db;$/;" l +db src/net.c /^ struct mosquitto_db *db;$/;" l +db src/websockets.c /^ struct mosquitto_db *db = &int_db;$/;" l +db src/websockets.c /^ struct mosquitto_db *db;$/;" l +db test/unit/persist_read_test.c /^ struct mosquitto_db db;$/;" l +db test/unit/persist_write_test.c /^ struct mosquitto_db db;$/;" l +db__client_chunk_restore src/db_dump/db_dump.c /^static int db__client_chunk_restore(struct mosquitto_db *db, FILE *db_fd, struct db_client *client)$/;" f file: +db__client_msg_chunk_restore src/db_dump/db_dump.c /^static int db__client_msg_chunk_restore(struct mosquitto_db *db, FILE *db_fd, uint32_t length, struct db_client_msg *msg)$/;" f file: +db__close src/database.c /^int db__close(struct mosquitto_db *db)$/;" f +db__limits_set src/database.c /^void db__limits_set(unsigned long inflight_bytes, int queued, unsigned long queued_bytes)$/;" f +db__message_delete_outgoing src/database.c /^int db__message_delete_outgoing(struct mosquitto_db *db, struct mosquitto *context, uint16_t mid, enum mosquitto_msg_state expect_state, int qos)$/;" f +db__message_dequeue_first src/database.c /^void db__message_dequeue_first(struct mosquitto *context, struct mosquitto_msg_data *msg_data)$/;" f +db__message_insert src/database.c /^int db__message_insert(struct mosquitto_db *db, struct mosquitto *context, uint16_t mid, enum mosquitto_msg_direction dir, int qos, bool retain, struct mosquitto_msg_store *stored, mosquitto_property *properties)$/;" f +db__message_reconnect_reset src/database.c /^int db__message_reconnect_reset(struct mosquitto_db *db, struct mosquitto *context)$/;" f +db__message_reconnect_reset_incoming src/database.c /^int db__message_reconnect_reset_incoming(struct mosquitto_db *db, struct mosquitto *context)$/;" f +db__message_reconnect_reset_outgoing src/database.c /^int db__message_reconnect_reset_outgoing(struct mosquitto_db *db, struct mosquitto *context)$/;" f +db__message_release_incoming src/database.c /^int db__message_release_incoming(struct mosquitto_db *db, struct mosquitto *context, uint16_t mid)$/;" f +db__message_remove src/database.c /^static void db__message_remove(struct mosquitto_db *db, struct mosquitto_msg_data *msg_data, struct mosquitto_client_msg *item)$/;" f file: +db__message_store src/database.c /^int db__message_store(struct mosquitto_db *db, const struct mosquitto *source, uint16_t source_mid, char *topic, int qos, uint32_t payloadlen, mosquitto__payload_uhpa *payload, int retain, struct mosquitto_msg_store **stored, uint32_t message_expiry_interval, mosquitto_property *properties, dbid_t store_id, enum mosquitto_msg_origin origin)$/;" f +db__message_store test/unit/persist_read_stubs.c /^int db__message_store(struct mosquitto_db *db, const struct mosquitto *source, uint16_t source_mid, char *topic, int qos, uint32_t payloadlen, mosquitto__payload_uhpa *payload, int retain, struct mosquitto_msg_store **stored, uint32_t message_expiry_interval, mosquitto_property *properties, dbid_t store_id, enum mosquitto_msg_origin origin)$/;" f +db__message_store_find src/database.c /^int db__message_store_find(struct mosquitto *context, uint16_t mid, struct mosquitto_msg_store **stored)$/;" f +db__message_update_outgoing src/database.c /^int db__message_update_outgoing(struct mosquitto *context, uint16_t mid, enum mosquitto_msg_state state, int qos)$/;" f +db__message_write src/database.c /^int db__message_write(struct mosquitto_db *db, struct mosquitto *context)$/;" f +db__messages_delete src/database.c /^int db__messages_delete(struct mosquitto_db *db, struct mosquitto *context)$/;" f +db__messages_delete_list src/database.c /^void db__messages_delete_list(struct mosquitto_db *db, struct mosquitto_client_msg **head)$/;" f +db__messages_easy_queue src/database.c /^int db__messages_easy_queue(struct mosquitto_db *db, struct mosquitto *context, const char *topic, int qos, uint32_t payloadlen, const void *payload, int retain, uint32_t message_expiry_interval, mosquitto_property **properties)$/;" f +db__msg_store_add src/database.c /^void db__msg_store_add(struct mosquitto_db *db, struct mosquitto_msg_store *store)$/;" f +db__msg_store_chunk_restore src/db_dump/db_dump.c /^static int db__msg_store_chunk_restore(struct mosquitto_db *db, FILE *db_fd, uint32_t length, struct db_msg *msg)$/;" f file: +db__msg_store_clean src/database.c /^void db__msg_store_clean(struct mosquitto_db *db)$/;" f +db__msg_store_compact src/database.c /^void db__msg_store_compact(struct mosquitto_db *db)$/;" f +db__msg_store_ref_dec src/database.c /^void db__msg_store_ref_dec(struct mosquitto_db *db, struct mosquitto_msg_store **store)$/;" f +db__msg_store_ref_inc src/database.c /^void db__msg_store_ref_inc(struct mosquitto_msg_store *store)$/;" f +db__msg_store_ref_inc test/unit/persist_read_stubs.c /^void db__msg_store_ref_inc(struct mosquitto_msg_store *store)$/;" f +db__msg_store_remove src/database.c /^void db__msg_store_remove(struct mosquitto_db *db, struct mosquitto_msg_store *store)$/;" f +db__open src/database.c /^int db__open(struct mosquitto__config *config, struct mosquitto_db *db)$/;" f +db__ready_for_flight src/database.c /^static bool db__ready_for_flight(struct mosquitto_msg_data *msgs, int qos)$/;" f file: +db__ready_for_queue src/database.c /^static bool db__ready_for_queue(struct mosquitto *context, int qos, struct mosquitto_msg_data *msg_data)$/;" f file: +db__retain_chunk_restore src/db_dump/db_dump.c /^static int db__retain_chunk_restore(struct mosquitto_db *db, FILE *db_fd)$/;" f file: +db__sub_chunk_restore src/db_dump/db_dump.c /^static int db__sub_chunk_restore(struct mosquitto_db *db, FILE *db_fd, uint32_t length, struct db_sub *sub)$/;" f file: +db_client src/db_dump/db_dump.c /^struct db_client$/;" s file: +db_client_msg src/db_dump/db_dump.c /^struct db_client_msg$/;" s file: +db_database examples/mysql_log/mysql_log.c 18;" d file: +db_fptr src/persist_write.c /^ FILE *db_fptr = NULL;$/;" l +db_host examples/mysql_log/mysql_log.c 15;" d file: +db_id src/mosquitto_broker_internal.h /^ dbid_t db_id;$/;" m struct:mosquitto_msg_store +db_id src/mosquitto_broker_internal.h /^ dbid_t db_id;$/;" m struct:mosquitto_msg_store_load +db_msg src/db_dump/db_dump.c /^struct db_msg$/;" s file: +db_password examples/mysql_log/mysql_log.c 17;" d file: +db_port examples/mysql_log/mysql_log.c 19;" d file: +db_query examples/mysql_log/mysql_log.c 21;" d file: +db_sub src/db_dump/db_dump.c /^struct db_sub$/;" s file: +db_username examples/mysql_log/mysql_log.c 16;" d file: +db_version src/db_dump/db_dump.c /^static uint32_t db_version;$/;" v file: +db_version src/persist_read.c /^static uint32_t db_version;$/;" v file: +db_version_w src/persist_write.c /^ uint32_t db_version_w = htonl(MOSQ_DB_VERSION);$/;" l +dbid_size src/persist.h /^ uint8_t dbid_size;$/;" m struct:PF_cfg +dbid_t src/mosquitto_broker_internal.h /^typedef uint64_t dbid_t;$/;" t +de src/conf_includedir.c /^ struct dirent *de;$/;" l +debug client/client_shared.h /^ bool debug;$/;" m struct:mosq_config +default_listener src/mosquitto_broker_internal.h /^ struct mosquitto__listener default_listener;$/;" m struct:mosquitto__config typeref:struct:mosquitto__config::mosquitto__listener +delay_list src/will_delay.c /^static struct will_delay_list *delay_list = NULL;$/;" v typeref:struct:will_delay_list file: +delete_pwuser src/mosquitto_passwd.c /^int delete_pwuser(FILE *fptr, FILE *ftmp, const char *username)$/;" f +delete_user src/mosquitto_passwd.c /^ bool delete_user = false;$/;" l +deleted src/database.c /^ bool deleted = false;$/;" l +deny_severity src/mosquitto.c /^int deny_severity = LOG_INFO;$/;" v +deny_special_chars src/mosquitto_broker_internal.h /^ bool deny_special_chars;$/;" m struct:mosquitto__auth_plugin_config +dest_id_count src/mosquitto_broker_internal.h /^ int dest_id_count;$/;" m struct:mosquitto_msg_store +dest_ids src/database.c /^ char **dest_ids;$/;" l +dest_ids src/mosquitto_broker_internal.h /^ char **dest_ids;$/;" m struct:mosquitto_msg_store +dh src/conf_includedir.c /^ DIR *dh;$/;" l +dhparam src/net.c /^ DH *dhparam = NULL;$/;" l +dhparamfile src/mosquitto_broker_internal.h /^ char *dhparamfile;$/;" m struct:mosquitto__listener +dhparamfile src/net.c /^ FILE *dhparamfile;$/;" l +diff test/old/msgsps_pub.c /^ double dstart, dstop, diff;$/;" l +diff test/old/msgsps_sub.c /^ double dstart, dstop, diff;$/;" l +digest src/mosquitto_passwd.c /^ const EVP_MD *digest;$/;" l +digest src/security_default.c /^ const EVP_MD *digest;$/;" l +direction src/db_dump/db_dump.c /^ uint8_t qos, retain, direction, state, dup;$/;" m struct:db_client_msg file: +direction src/mosquitto_broker_internal.h /^ enum mosquitto__bridge_direction direction;$/;" m struct:mosquitto__bridge_topic typeref:enum:mosquitto__bridge_topic::mosquitto__bridge_direction +direction src/mosquitto_broker_internal.h /^ enum mosquitto_msg_direction direction;$/;" m struct:mosquitto_client_msg typeref:enum:mosquitto_client_msg::mosquitto_msg_direction +direction src/persist.h /^ uint8_t direction;$/;" m struct:PF_client_msg +dirpath src/conf_includedir.c /^ char dirpath[MAX_PATH];$/;" l +disco_test test/broker/01-connect-disconnect-v5.py /^def disco_test(test, disconnect_packet):$/;" f +disconnect lib/cpp/mosquittopp.cpp /^int mosquittopp::disconnect()$/;" f class:mosqpp::mosquittopp +disconnect2_packet test/broker/05-session-expiry-v5.py /^disconnect2_packet = mosq_test.gen_disconnect(proto_ver=5, properties=props)$/;" v +disconnect3_packet test/broker/09-extended-auth-multistep-reauth.py /^disconnect3_packet = mosq_test.gen_disconnect(reason_code=mqtt5_rc.MQTT_RC_PROTOCOL_ERROR, proto_ver=5)$/;" v +disconnect_client_packet test/broker/12-prop-response-topic-correlation-data.py /^disconnect_client_packet = mosq_test.gen_disconnect(proto_ver=5, properties=props)$/;" v +disconnect_client_packet test/broker/12-prop-response-topic.py /^disconnect_client_packet = mosq_test.gen_disconnect(proto_ver=5, properties=props)$/;" v +disconnect_client_packet test/broker/12-prop-session-expiry-invalid.py /^disconnect_client_packet = mosq_test.gen_disconnect(proto_ver=5, properties=props)$/;" v +disconnect_packet test/broker/01-connect-disconnect-v5.py /^ disconnect_packet = mosq_test.gen_disconnect(proto_ver=5)$/;" v +disconnect_packet test/broker/01-connect-disconnect-v5.py /^ disconnect_packet = mosq_test.gen_disconnect(proto_ver=5, reason_code=0)$/;" v +disconnect_packet test/broker/01-connect-disconnect-v5.py /^ disconnect_packet = mosq_test.gen_disconnect(proto_ver=5, reason_code=0, properties="")$/;" v +disconnect_packet test/broker/01-connect-disconnect-v5.py /^ disconnect_packet = mosq_test.gen_disconnect(proto_ver=5, reason_code=0, properties=props)$/;" v +disconnect_packet test/broker/02-subhier-crash.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/broker/02-subpub-qos0-topic-alias-unknown.py /^disconnect_packet = mosq_test.gen_disconnect(reason_code=148, proto_ver=5)$/;" v +disconnect_packet test/broker/03-publish-qos1-retain-disabled.py /^disconnect_packet = mosq_test.gen_disconnect(reason_code=154, proto_ver=5)$/;" v +disconnect_packet test/broker/05-clean-session-qos1.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/broker/05-session-expiry-v5.py /^disconnect_packet = mosq_test.gen_disconnect(proto_ver=5, properties=props)$/;" v +disconnect_packet test/broker/06-bridge-reconnect-local-out-helper.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/broker/08-ssl-bridge-helper.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/broker/09-acl-change.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/broker/12-prop-maximum-packet-size-broker.py /^disconnect_packet = mosq_test.gen_disconnect(reason_code=149, proto_ver=5)$/;" v +disconnect_packet test/lib/01-con-discon-success.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/lib/02-subscribe-qos0.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/lib/02-subscribe-qos1.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/lib/02-subscribe-qos2.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/lib/02-unsubscribe-multiple-v5.py /^disconnect_packet = mosq_test.gen_disconnect(proto_ver=5)$/;" v +disconnect_packet test/lib/02-unsubscribe-v5.py /^disconnect_packet = mosq_test.gen_disconnect(proto_ver=5)$/;" v +disconnect_packet test/lib/02-unsubscribe.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/lib/03-publish-b2c-qos1.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/lib/03-publish-b2c-qos2.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/lib/03-publish-c2b-qos1-disconnect.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/lib/03-publish-c2b-qos1-receive-maximum.py /^disconnect_packet = mosq_test.gen_disconnect(proto_ver=5)$/;" v +disconnect_packet test/lib/03-publish-c2b-qos1-timeout.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/lib/03-publish-c2b-qos2-disconnect.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/lib/03-publish-c2b-qos2-maximum-qos-0.py /^disconnect_packet = mosq_test.gen_disconnect(proto_ver=5)$/;" v +disconnect_packet test/lib/03-publish-c2b-qos2-maximum-qos-1.py /^disconnect_packet = mosq_test.gen_disconnect(proto_ver=5)$/;" v +disconnect_packet test/lib/03-publish-c2b-qos2-pubrec-error.py /^disconnect_packet = mosq_test.gen_disconnect(proto_ver=5)$/;" v +disconnect_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^disconnect_packet = mosq_test.gen_disconnect(proto_ver=5)$/;" v +disconnect_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^disconnect_packet = mosq_test.gen_disconnect(proto_ver=5)$/;" v +disconnect_packet test/lib/03-publish-c2b-qos2-timeout.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/lib/03-publish-c2b-qos2.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/lib/03-publish-qos0-no-payload.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/lib/03-publish-qos0.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/lib/08-ssl-connect-cert-auth-enc.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/lib/08-ssl-connect-cert-auth.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/lib/08-ssl-connect-no-auth.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/lib/11-prop-oversize-packet.py /^disconnect_packet = mosq_test.gen_disconnect()$/;" v +disconnect_packet test/lib/11-prop-send-content-type.py /^disconnect_packet = mosq_test.gen_disconnect(proto_ver=5)$/;" v +disconnect_packet test/lib/11-prop-send-payload-format.py /^disconnect_packet = mosq_test.gen_disconnect(proto_ver=5)$/;" v +disconnect_props client/client_shared.h /^ mosquitto_property *disconnect_props;$/;" m struct:mosq_config +disconnect_sent client/pub_client.c /^static bool disconnect_sent = false;$/;" v file: +disconnect_server_packet test/broker/12-prop-response-topic-correlation-data.py /^disconnect_server_packet = mosq_test.gen_disconnect(proto_ver=5, reason_code=130)$/;" v +disconnect_server_packet test/broker/12-prop-response-topic.py /^disconnect_server_packet = mosq_test.gen_disconnect(proto_ver=5, reason_code=130)$/;" v +disconnect_server_packet test/broker/12-prop-session-expiry-invalid.py /^disconnect_server_packet = mosq_test.gen_disconnect(proto_ver=5, reason_code=130)$/;" v +disconnect_t src/db_dump/db_dump.c /^ time_t disconnect_t;$/;" m struct:db_client file: +disconnected_count src/sys_tree.c /^ static int disconnected_count = -1;$/;" l file: +dltContext src/logging.c /^static DltContext dltContext;$/;" v file: +do_client_connect test/mosq_test.py /^def do_client_connect(connect_packet, connack_packet, hostname="localhost", port=1888, timeout=60, connack_error="connack"):$/;" f +do_client_disconnect lib/connect.c /^void do_client_disconnect(struct mosquitto *mosq, int reason_code, const mosquitto_property *properties)$/;" f +do_disconnect src/loop.c /^void do_disconnect(struct mosquitto_db *db, struct mosquitto *context, int reason)$/;" f +do_ping test/mosq_test.py /^def do_ping(sock, error_string="pingresp"):$/;" f +do_print src/db_dump/db_dump.c /^static int do_print = 1;$/;" v file: +do_publish test/random/random_client.py /^def do_publish(client):$/;" f +do_send_receive test/mosq_test.py /^def do_send_receive(sock, send_packet, receive_packet, error_string="send receive error"):$/;" f +do_test test/broker/02-subscribe-dollar-v5.py /^def do_test(proto_ver):$/;" f +do_test test/broker/04-retain-check-source-persist-diff-port.py /^def do_test(per_listener, username):$/;" f +do_test test/broker/04-retain-check-source-persist.py /^def do_test(per_listener, username):$/;" f +do_test test/broker/04-retain-check-source.py /^def do_test(per_listener):$/;" f +do_test test/broker/06-bridge-no-local.py /^def do_test(proto_ver_connect, proto_ver_msgs, sub_opts):$/;" f +do_test test/broker/07-will-delay-reconnect.py /^def do_test():$/;" f +do_test test/broker/07-will-delay-recover.py /^def do_test(clean_session):$/;" f +do_test test/broker/07-will-delay.py /^def do_test(clean_session):$/;" f +do_test test/broker/07-will-disconnect-with-will.py /^def do_test():$/;" f +do_test test/broker/07-will-properties.py /^def do_test(will_props, recvd_props):$/;" f +do_test test/broker/07-will-qos0.py /^def do_test(proto_ver, clean_session):$/;" f +do_test test/broker/07-will-reconnect-1273.py /^def do_test(proto_ver):$/;" f +do_test test/broker/09-acl-access-variants.py /^def do_test(port, per_listener):$/;" f +do_test test/broker/09-acl-empty-file.py /^def do_test(port, per_listener):$/;" f +do_test test/broker/09-extended-auth-change-username.py /^def do_test(per_listener):$/;" f +do_test test/broker/09-extended-auth-single2.py /^def do_test(suffix):$/;" f +do_test test/broker/09-pwfile-parse-invalid.py /^def do_test(port, connack_rc, username, password):$/;" f +do_test test/broker/12-prop-assigned-client-identifier.py /^def do_test(clean_start):$/;" f +do_test test/broker/12-prop-topic-alias-invalid.py /^def do_test(value):$/;" f +do_update_file src/mosquitto_passwd.c /^ bool do_update_file = false;$/;" l +drop_privileges src/mosquitto.c /^int drop_privileges(struct mosquitto__config *config, bool temporary)$/;" f +dstart test/old/msgsps_pub.c /^ double dstart, dstop, diff;$/;" l +dstart test/old/msgsps_sub.c /^ double dstart, dstop, diff;$/;" l +dstop test/old/msgsps_pub.c /^ double dstart, dstop, diff;$/;" l +dstop test/old/msgsps_sub.c /^ double dstart, dstop, diff;$/;" l +dup lib/mosquitto_internal.h /^ bool dup;$/;" m struct:mosquitto_message_all +dup src/db_dump/db_dump.c /^ uint8_t qos, retain, direction, state, dup;$/;" m struct:db_client_msg file: +dup src/handle_publish.c /^ uint8_t dup, qos, retain;$/;" l +dup src/mosquitto_broker_internal.h /^ bool dup;$/;" m struct:mosquitto_client_msg +dup src/persist_read_v234.c /^ uint8_t retain, dup;$/;" l +duplicate_binary_helper test/unit/property_read.c /^static void duplicate_binary_helper(int command, int identifier)$/;" f file: +duplicate_byte_helper test/unit/property_read.c /^static void duplicate_byte_helper(int command, int identifier)$/;" f file: +duplicate_int16_helper test/unit/property_read.c /^static void duplicate_int16_helper(int command, int identifier)$/;" f file: +duplicate_int32_helper test/unit/property_read.c /^static void duplicate_int32_helper(int command, int identifier)$/;" f file: +duplicate_string_helper test/unit/property_read.c /^static void duplicate_string_helper(int command, int identifier)$/;" f file: +dwCreationDisposition lib/util_mosq.c /^ DWORD dwCreationDisposition;$/;" l +e lib/net_mosq.c /^ unsigned long e;$/;" l +e src/net.c /^ unsigned long e;$/;" l +ea lib/util_mosq.c /^ EXPLICIT_ACCESS ea;$/;" l +easy_address src/websockets.c /^static void easy_address(int sock, struct mosquitto *mosq)$/;" f file: +ebuf lib/net_mosq.c /^ char ebuf[256];$/;" l +ebuf src/net.c /^ char ebuf[256];$/;" l +endchar src/conf.c /^ char endchar;$/;" l +eng lib/options.c /^ ENGINE *eng;$/;" l +engine lib/net_mosq.c /^ ENGINE *engine = NULL;$/;" l +engine src/net.c /^ ENGINE *engine = NULL;$/;" l +env client/client_shared.c /^ char *env;$/;" l +env client/client_shared.c /^ char env[1024];$/;" l +env test/broker/08-tls-psk-bridge.py /^env = dict(os.environ)$/;" v +env test/broker/08-tls-psk-pub.py /^env = dict(os.environ)$/;" v +env test/lib/01-con-discon-success.py /^env = dict(os.environ)$/;" v +env test/lib/01-keepalive-pingreq.py /^env = dict(os.environ)$/;" v +env test/lib/01-no-clean-session.py /^env = dict(os.environ)$/;" v +env test/lib/01-server-keepalive-pingreq.py /^env = dict(os.environ)$/;" v +env test/lib/01-unpwd-set.py /^env = dict(os.environ)$/;" v +env test/lib/01-will-set.py /^env = dict(os.environ)$/;" v +env test/lib/01-will-unpwd-set.py /^env = dict(os.environ)$/;" v +env test/lib/02-subscribe-qos0.py /^env = dict(os.environ)$/;" v +env test/lib/02-subscribe-qos1.py /^env = dict(os.environ)$/;" v +env test/lib/02-subscribe-qos2.py /^env = dict(os.environ)$/;" v +env test/lib/02-unsubscribe-multiple-v5.py /^env = dict(os.environ)$/;" v +env test/lib/02-unsubscribe-v5.py /^env = dict(os.environ)$/;" v +env test/lib/02-unsubscribe.py /^env = dict(os.environ)$/;" v +env test/lib/03-publish-b2c-qos1.py /^env = dict(os.environ)$/;" v +env test/lib/03-publish-b2c-qos2.py /^env = dict(os.environ)$/;" v +env test/lib/03-publish-c2b-qos1-disconnect.py /^env = dict(os.environ)$/;" v +env test/lib/03-publish-c2b-qos1-receive-maximum.py /^env = dict(os.environ)$/;" v +env test/lib/03-publish-c2b-qos1-timeout.py /^env = dict(os.environ)$/;" v +env test/lib/03-publish-c2b-qos2-disconnect.py /^env = dict(os.environ)$/;" v +env test/lib/03-publish-c2b-qos2-maximum-qos-0.py /^env = dict(os.environ)$/;" v +env test/lib/03-publish-c2b-qos2-maximum-qos-1.py /^env = dict(os.environ)$/;" v +env test/lib/03-publish-c2b-qos2-pubrec-error.py /^env = dict(os.environ)$/;" v +env test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^env = dict(os.environ)$/;" v +env test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^env = dict(os.environ)$/;" v +env test/lib/03-publish-c2b-qos2-timeout.py /^env = dict(os.environ)$/;" v +env test/lib/03-publish-c2b-qos2.py /^env = dict(os.environ)$/;" v +env test/lib/03-publish-qos0-no-payload.py /^env = dict(os.environ)$/;" v +env test/lib/03-publish-qos0.py /^env = dict(os.environ)$/;" v +env test/lib/03-request-response-correlation.py /^env = dict(os.environ)$/;" v +env test/lib/03-request-response.py /^env = dict(os.environ)$/;" v +env test/lib/04-retain-qos0.py /^env = dict(os.environ)$/;" v +env test/lib/08-ssl-bad-cacert.py /^env = dict(os.environ)$/;" v +env test/lib/08-ssl-connect-cert-auth-enc.py /^env = dict(os.environ)$/;" v +env test/lib/08-ssl-connect-cert-auth.py /^env = dict(os.environ)$/;" v +env test/lib/08-ssl-connect-no-auth.py /^env = dict(os.environ)$/;" v +env test/lib/08-ssl-fake-cacert.py /^env = dict(os.environ)$/;" v +env test/lib/09-util-topic-tokenise.py /^env = dict(os.environ)$/;" v +env test/lib/11-prop-oversize-packet.py /^env = dict(os.environ)$/;" v +env test/lib/11-prop-send-content-type.py /^env = dict(os.environ)$/;" v +env test/lib/11-prop-send-payload-format.py /^env = dict(os.environ)$/;" v +env test/random/test.py /^env = {}$/;" v +eol client/client_shared.h /^ bool eol; \/* sub *\/$/;" m struct:mosq_config +epollfd src/mosquitto_broker_internal.h /^ int epollfd;$/;" m struct:mosquitto_db +err client/client_shared.c /^ char *err;$/;" l +err lib/net_mosq.c /^ int err;$/;" l +err lib/net_mosq.c /^ int ret, err;$/;" l +err src/loop.c /^ int err;$/;" l +err src/mosquitto.c /^ char *err;$/;" l +err src/persist_read.c /^ char *err;$/;" l +err src/persist_read_v234.c /^ char *err;$/;" l +err src/persist_write.c /^ char *err;$/;" l +err_printf client/client_shared.c /^void err_printf(const struct mosq_config *cfg, const char *fmt, ...)$/;" f +ev src/loop.c /^ struct epoll_event ev, events[MAX_EVENTS];$/;" l +ev src/loop.c /^ struct epoll_event ev;$/;" l +events lib/mosquitto_internal.h /^ uint32_t events;$/;" m struct:mosquitto +events src/loop.c /^ struct epoll_event ev, events[MAX_EVENTS];$/;" l +evt src/signals.c /^ static HANDLE evt[3];$/;" l file: +evt_name src/signals.c /^ TCHAR evt_name[MAX_PATH];$/;" l +exe_path src/service.c /^ char exe_path[MAX_PATH + 5];$/;" l +exit_after_sub client/client_shared.h /^ bool exit_after_sub; \/* sub *\/$/;" m struct:mosq_config +expand_mult src/deps/uthash.h /^ unsigned expand_mult;$/;" m struct:UT_hash_bucket +expect_packet test/mosq_test.py /^def expect_packet(sock, name, expected):$/;" f +expiration_check_time src/loop.c /^ time_t expiration_check_time = 0;$/;" l +expiration_mult src/conf.c /^ time_t expiration_mult;$/;" l +expiry_interval lib/mosquitto_internal.h /^ uint32_t expiry_interval;$/;" m struct:mosquitto_message_all +expiry_interval src/database.c /^ uint32_t expiry_interval;$/;" l +expiry_list src/session_expiry.c /^static struct session_expiry_list *expiry_list = NULL;$/;" v typeref:struct:session_expiry_list file: +expiry_list_item lib/mosquitto_internal.h /^ struct session_expiry_list *expiry_list_item;$/;" m struct:mosquitto typeref:struct:mosquitto::session_expiry_list +expiry_prop lib/send_publish.c /^ mosquitto_property expiry_prop;$/;" l +expiry_time src/persist.h /^ int64_t expiry_time;$/;" m struct:PF_msg_store +exponent src/sys_tree.c /^ double exponent;$/;" l +f client/client_shared.c /^ float f;$/;" l +fails test/unit/persist_read_test.c /^ int fails;$/;" l +fails test/unit/persist_write_test.c /^ unsigned int fails;$/;" l +fails test/unit/test.c /^ unsigned int fails;$/;" l +false lib/mosquitto.h 38;" d +false src/mosquitto_passwd.c 37;" d file: +family lib/net_mosq.c /^ int family[2] = {AF_INET, AF_INET6};$/;" l +fbackup src/mosquitto_passwd.c /^ FILE *fbackup;$/;" l +fd lib/util_mosq.c /^ int fd = _open_osfhandle((intptr_t)hfile, 0);$/;" l +fd src/db_dump/db_dump.c /^ FILE *fd;$/;" l +fd src/mosquitto_broker_internal.h /^ int fd;$/;" m struct:mosquitto__listener +fd src/mosquitto_passwd.c /^ int fd;$/;" l +fdcount lib/loop.c /^ int fdcount;$/;" l +fdcount src/loop.c /^ int fdcount;$/;" l +fgets_extending src/conf.c /^static char *fgets_extending(char **buf, int *buflen, FILE *stream)$/;" f file: +fh src/conf_includedir.c /^ HANDLE fh;$/;" l +file_count src/conf.c /^ int file_count;$/;" l +file_diff test/unit/persist_write_test.c /^static int file_diff(const char *one, const char *two)$/;" f file: +file_input client/client_shared.h /^ char *file_input; \/* pub, rr *\/$/;" m struct:mosq_config +file_read test/unit/persist_write_test.c /^static int file_read(const char *filename, uint8_t **data, size_t *len)$/;" f file: +filename src/db_dump/db_dump.c /^ char *filename;$/;" l +filename src/websockets.c /^ char *filename, *filename_canonical;$/;" l +filename_canonical src/websockets.c /^ char *filename, *filename_canonical;$/;" l +filename_canonical src/websockets.c /^ char *filename_canonical;$/;" l +files src/conf.c /^ char **files;$/;" l +files_tmp src/conf_includedir.c /^ char **files_tmp;$/;" l +filestat src/websockets.c /^ struct stat filestat;$/;" l +filter_out_count client/client_shared.h /^ int filter_out_count; \/* sub *\/$/;" m struct:mosq_config +filter_outs client/client_shared.h /^ char **filter_outs; \/* sub *\/$/;" m struct:mosq_config +find_data src/conf_includedir.c /^ WIN32_FIND_DATA find_data;$/;" l +first_connection test/lib/c/03-publish-c2b-qos1-disconnect.c /^static int first_connection = 1;$/;" v file: +first_connection test/lib/c/03-publish-c2b-qos2-disconnect.c /^static int first_connection = 1;$/;" v file: +first_connection test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp /^static int first_connection = 1;$/;" v file: +first_connection test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp /^static int first_connection = 1;$/;" v file: +first_publish client/pub_client.c /^static bool first_publish = true;$/;" v file: +flag src/net.c /^ int flag = 1;$/;" l +flag src/subs.c /^ int flag = 0;$/;" l +flag_db_backup src/loop.c /^extern bool flag_db_backup;$/;" x +flag_db_backup src/mosquitto.c /^bool flag_db_backup = false;$/;" v +flag_db_backup src/signals.c /^extern bool flag_db_backup;$/;" x +flag_reload src/loop.c /^extern bool flag_reload;$/;" x +flag_reload src/mosquitto.c /^bool flag_reload = false;$/;" v +flag_reload src/signals.c /^extern bool flag_reload;$/;" x +flag_tree_print src/loop.c /^extern bool flag_tree_print;$/;" x +flag_tree_print src/mosquitto.c /^bool flag_tree_print = false;$/;" v +flag_tree_print src/signals.c /^extern bool flag_tree_print;$/;" x +for_free_next lib/mosquitto_internal.h /^ struct mosquitto *for_free_next;$/;" m struct:mosquitto typeref:struct:mosquitto::mosquitto +format client/client_shared.h /^ char *format; \/* sub *\/$/;" m struct:mosq_config +formatted_print client/sub_client_output.c /^static void formatted_print(const struct mosq_config *lcfg, const struct mosquitto_message *message)$/;" f file: +found lib/messages_mosq.c /^ bool found = false;$/;" l +found src/mosquitto_passwd.c /^ bool found = false;$/;" l +found_context src/handle_connect.c /^ struct mosquitto *found_context;$/;" l +fptr client/client_shared.c /^ FILE *fptr;$/;" l +fptr client/pub_shared.c /^ FILE *fptr = NULL;$/;" l +fptr lib/options.c /^ FILE *fptr;$/;" l +fptr lib/util_mosq.c /^ FILE *fptr = _fdopen(fd, mode);$/;" l +fptr src/conf.c /^ FILE *fptr = NULL;$/;" l +fptr src/mosquitto_passwd.c /^ FILE *fptr, *ftmp;$/;" l +fptr src/persist_read.c /^ FILE *fptr;$/;" l +fptr src/websockets.c /^ FILE *fptr;$/;" m struct:libws_http_data file: +fptr test/old/msgsps_sub.c /^FILE *fptr = NULL;$/;" v +fptr test/unit/persist_write_test.c /^ FILE *fptr;$/;" l +free__acl src/security_default.c /^static void free__acl(struct mosquitto__acl *acl)$/;" f file: +free__db_client src/db_dump/db_dump.c /^free__db_client(struct db_client *client)$/;" f file: +free__db_client_msg src/db_dump/db_dump.c /^free__db_client_msg(struct db_client_msg *msg)$/;" f file: +free__db_msg src/db_dump/db_dump.c /^free__db_msg(struct db_msg *msg)$/;" f file: +free__db_sub src/db_dump/db_dump.c /^free__db_sub(struct db_sub *sub)$/;" f file: +ftmp src/mosquitto_passwd.c /^ FILE *fptr, *ftmp;$/;" l +g_bytes_received src/sys_tree.c /^uint64_t g_bytes_received = 0;$/;" v +g_bytes_received src/sys_tree.h /^extern uint64_t g_bytes_received;$/;" x +g_bytes_sent src/sys_tree.c /^uint64_t g_bytes_sent = 0;$/;" v +g_bytes_sent src/sys_tree.h /^extern uint64_t g_bytes_sent;$/;" x +g_clients_expired src/sys_tree.c /^int g_clients_expired = 0;$/;" v +g_clients_expired src/sys_tree.h /^extern int g_clients_expired;$/;" x +g_connection_count src/sys_tree.c /^unsigned int g_connection_count = 0;$/;" v +g_connection_count src/sys_tree.h /^extern unsigned int g_connection_count;$/;" x +g_msgs_dropped src/sys_tree.c /^unsigned long g_msgs_dropped = 0;$/;" v +g_msgs_dropped src/sys_tree.h /^extern unsigned long g_msgs_dropped;$/;" x +g_msgs_received src/sys_tree.c /^unsigned long g_msgs_received = 0;$/;" v +g_msgs_received src/sys_tree.h /^extern unsigned long g_msgs_received;$/;" x +g_msgs_sent src/sys_tree.c /^unsigned long g_msgs_sent = 0;$/;" v +g_msgs_sent src/sys_tree.h /^extern unsigned long g_msgs_sent;$/;" x +g_pub_bytes_received src/sys_tree.c /^uint64_t g_pub_bytes_received = 0;$/;" v +g_pub_bytes_received src/sys_tree.h /^extern uint64_t g_pub_bytes_received;$/;" x +g_pub_bytes_sent src/sys_tree.c /^uint64_t g_pub_bytes_sent = 0;$/;" v +g_pub_bytes_sent src/sys_tree.h /^extern uint64_t g_pub_bytes_sent;$/;" x +g_pub_msgs_received src/sys_tree.c /^unsigned long g_pub_msgs_received = 0;$/;" v +g_pub_msgs_received src/sys_tree.h /^extern unsigned long g_pub_msgs_received;$/;" x +g_pub_msgs_sent src/sys_tree.c /^unsigned long g_pub_msgs_sent = 0;$/;" v +g_pub_msgs_sent src/sys_tree.h /^extern unsigned long g_pub_msgs_sent;$/;" x +g_socket_connections src/sys_tree.c /^unsigned int g_socket_connections = 0;$/;" v +g_socket_connections src/sys_tree.h /^extern unsigned int g_socket_connections;$/;" x +gai_hints src/conf.c /^ struct addrinfo gai_hints;$/;" l +gai_res src/conf.c /^ struct addrinfo *gai_res;$/;" l +gen_auth test/mosq_test.py /^def gen_auth(reason_code=-1, properties=None):$/;" f +gen_byte_prop test/mqtt5_props.py /^def gen_byte_prop(identifier, byte):$/;" f +gen_connack test/mosq_test.py /^def gen_connack(flags=0, rc=0, proto_ver=4, properties=b""):$/;" f +gen_connect test/mosq_test.py /^def gen_connect(client_id, clean_session=True, keepalive=60, username=None, password=None, will_topic=None, will_qos=0, will_retain=False, will_payload=b"", proto_ver=4, connect_reserved=False, properties=b"", will_properties=b""):$/;" f +gen_disconnect test/mosq_test.py /^def gen_disconnect(reason_code=-1, proto_ver=4, properties=None):$/;" f +gen_pingreq test/mosq_test.py /^def gen_pingreq():$/;" f +gen_pingresp test/mosq_test.py /^def gen_pingresp():$/;" f +gen_puback test/mosq_test.py /^def gen_puback(mid, proto_ver=4, reason_code=-1, properties=None):$/;" f +gen_pubcomp test/mosq_test.py /^def gen_pubcomp(mid, proto_ver=4, reason_code=-1, properties=None):$/;" f +gen_publish test/mosq_test.py /^def gen_publish(topic, qos, payload=None, retain=False, dup=False, mid=0, proto_ver=4, properties=b""):$/;" f +gen_pubrec test/mosq_test.py /^def gen_pubrec(mid, proto_ver=4, reason_code=-1, properties=None):$/;" f +gen_pubrel test/mosq_test.py /^def gen_pubrel(mid, dup=False, proto_ver=4, reason_code=-1, properties=None):$/;" f +gen_string_pair_prop test/mqtt5_props.py /^def gen_string_pair_prop(identifier, s1, s2):$/;" f +gen_string_prop test/mqtt5_props.py /^def gen_string_prop(identifier, s):$/;" f +gen_suback test/mosq_test.py /^def gen_suback(mid, qos, proto_ver=4):$/;" f +gen_subscribe test/mosq_test.py /^def gen_subscribe(mid, topic, qos, proto_ver=4, properties=b""):$/;" f +gen_uint16_prop test/mqtt5_props.py /^def gen_uint16_prop(identifier, word):$/;" f +gen_uint32_prop test/mqtt5_props.py /^def gen_uint32_prop(identifier, word):$/;" f +gen_unsuback test/mosq_test.py /^def gen_unsuback(mid, proto_ver=4, reason_code=0):$/;" f +gen_unsubscribe test/mosq_test.py /^def gen_unsubscribe(mid, topic, proto_ver=4):$/;" f +gen_unsubscribe_invalid_no_topic test/broker/02-unsubscribe-invalid-no-topic.py /^def gen_unsubscribe_invalid_no_topic(mid):$/;" f +gen_unsubscribe_multiple test/mosq_test.py /^def gen_unsubscribe_multiple(mid, topics, proto_ver=4):$/;" f +gen_varint_prop test/mqtt5_props.py /^def gen_varint_prop(identifier, val):$/;" f +generate_full_proplist test/unit/property_user_read.c /^static void generate_full_proplist(mosquitto_property **proplist)$/;" f file: +generate_partial_proplist test/unit/property_user_read.c /^static void generate_partial_proplist(mosquitto_property **proplist)$/;" f file: +get16bits src/deps/uthash.h 458;" d +get16bits src/deps/uthash.h 461;" d +get16bits src/deps/uthash.h 465;" d +get_dlt_level src/logging.c /^DltLogLevelType get_dlt_level(int priority)$/;" f +get_lib_port test/mosq_test.py /^def get_lib_port():$/;" f +get_password src/mosquitto_passwd.c /^int get_password(char *password, int len)$/;" f +get_port test/mosq_test.py /^def get_port(count=1):$/;" f +get_time client/sub_client_output.c /^static int get_time(struct tm **ti, long *ns)$/;" f file: +get_time src/logging.c /^static int get_time(struct tm **ti)$/;" f file: +gets_quiet src/mosquitto_passwd.c /^int gets_quiet(char *s, int len)$/;" f +granted_qos lib/handle_suback.c /^ int *granted_qos;$/;" l +h lib/srv_mosq.c /^ char *h;$/;" l +h src/mosquitto_passwd.c /^ HANDLE h;$/;" l +hack src/websockets.c /^ struct libws_mqtt_hack *hack;$/;" l +handle__auth lib/handle_auth.c /^int handle__auth(struct mosquitto *mosq)$/;" f +handle__auth src/handle_auth.c /^int handle__auth(struct mosquitto_db *db, struct mosquitto *context)$/;" f +handle__connack lib/handle_connack.c /^int handle__connack(struct mosquitto *mosq)$/;" f +handle__connack src/handle_connack.c /^int handle__connack(struct mosquitto_db *db, struct mosquitto *context)$/;" f +handle__connect src/handle_connect.c /^int handle__connect(struct mosquitto_db *db, struct mosquitto *context)$/;" f +handle__disconnect lib/handle_disconnect.c /^int handle__disconnect(struct mosquitto *mosq)$/;" f +handle__disconnect src/handle_disconnect.c /^int handle__disconnect(struct mosquitto_db *db, struct mosquitto *context)$/;" f +handle__packet lib/read_handle.c /^int handle__packet(struct mosquitto *mosq)$/;" f +handle__packet src/read_handle.c /^int handle__packet(struct mosquitto_db *db, struct mosquitto *context)$/;" f +handle__pingreq lib/handle_ping.c /^int handle__pingreq(struct mosquitto *mosq)$/;" f +handle__pingresp lib/handle_ping.c /^int handle__pingresp(struct mosquitto *mosq)$/;" f +handle__pubackcomp lib/handle_pubackcomp.c /^int handle__pubackcomp(struct mosquitto_db *db, struct mosquitto *mosq, const char *type)$/;" f +handle__publish lib/handle_publish.c /^int handle__publish(struct mosquitto *mosq)$/;" f +handle__publish src/handle_publish.c /^int handle__publish(struct mosquitto_db *db, struct mosquitto *context)$/;" f +handle__pubrec lib/handle_pubrec.c /^int handle__pubrec(struct mosquitto_db *db, struct mosquitto *mosq)$/;" f +handle__pubrel lib/handle_pubrel.c /^int handle__pubrel(struct mosquitto_db *db, struct mosquitto *mosq)$/;" f +handle__suback lib/handle_suback.c /^int handle__suback(struct mosquitto *mosq)$/;" f +handle__subscribe src/handle_subscribe.c /^int handle__subscribe(struct mosquitto_db *db, struct mosquitto *context)$/;" f +handle__unsuback lib/handle_unsuback.c /^int handle__unsuback(struct mosquitto *mosq)$/;" f +handle__unsubscribe src/handle_unsubscribe.c /^int handle__unsubscribe(struct mosquitto_db *db, struct mosquitto *context)$/;" f +handle_sighup src/signals.c /^void handle_sighup(int signal)$/;" f +handle_sigint src/mosquitto_passwd.c /^void handle_sigint(int signal)$/;" f +handle_sigint src/signals.c /^void handle_sigint(int signal)$/;" f +handle_signal examples/mysql_log/mysql_log.c /^void handle_signal(int s)$/;" f +handle_sigusr1 src/signals.c /^void handle_sigusr1(int signal)$/;" f +handle_sigusr2 src/signals.c /^void handle_sigusr2(int signal)$/;" f +hash src/mosquitto_passwd.c /^ unsigned char hash[EVP_MAX_MD_SIZE];$/;" l +hash src/security_default.c /^ unsigned char hash[EVP_MAX_MD_SIZE];$/;" l +hash64 src/mosquitto_passwd.c /^ char *salt64 = NULL, *hash64 = NULL;$/;" l +hash_len src/mosquitto_passwd.c /^ unsigned int hash_len;$/;" l +hash_len src/security_default.c /^ unsigned int hash_len;$/;" l +hashv src/deps/uthash.h /^ unsigned hashv; \/* result of hash-fcn(key) *\/$/;" m struct:UT_hash_handle +have_auth client/client_shared.c /^ bool have_auth = false;$/;" l +have_san_dns lib/tls_mosq.c /^ bool have_san_dns = false;$/;" l +have_subscribers src/subs.c /^ bool have_subscribers = false;$/;" l +have_topic_alias client/client_shared.h /^ bool have_topic_alias; \/* pub *\/$/;" m struct:mosq_config +have_topic_alias lib/actions.c /^ bool have_topic_alias;$/;" l +have_websockets_listener src/mosquitto_broker_internal.h /^ bool have_websockets_listener;$/;" m struct:mosquitto__config +header lib/handle_publish.c /^ uint8_t header;$/;" l +header src/db_dump/db_dump.c /^ char header[15];$/;" l +header src/handle_publish.c /^ uint8_t header = context->in_packet.command;$/;" l +header src/persist_read.c /^ char header[15];$/;" l +header src/persist_read_v5.c /^ struct PF_header header;$/;" l +header src/persist_write_v5.c /^ struct PF_header header;$/;" l +headerlen lib/send_connect.c /^ int headerlen;$/;" l +helper test/broker/02-subpub-qos1-bad-pubcomp.py /^ helper = mosq_test.do_client_connect(helper_connect, helper_connack, timeout=20, port=port)$/;" v +helper test/broker/02-subpub-qos1-bad-pubrec.py /^ helper = mosq_test.do_client_connect(helper_connect, helper_connack, timeout=20, port=port)$/;" v +helper test/broker/02-subpub-qos1-message-expiry-retain.py /^ helper = mosq_test.do_client_connect(helper_connect, helper_connack, timeout=20, port=port)$/;" v +helper test/broker/02-subpub-qos1-message-expiry-will.py /^ helper = mosq_test.do_client_connect(helper_connect, helper_connack, timeout=20, port=port)$/;" v +helper test/broker/02-subpub-qos1-message-expiry.py /^ helper = mosq_test.do_client_connect(helper_connect, helper_connack, timeout=20, port=port)$/;" v +helper test/broker/02-subpub-qos2-bad-puback-1.py /^ helper = mosq_test.do_client_connect(helper_connect, helper_connack, timeout=20, port=port)$/;" v +helper test/broker/02-subpub-qos2-bad-puback-2.py /^ helper = mosq_test.do_client_connect(helper_connect, helper_connack, timeout=20, port=port)$/;" v +helper test/broker/02-subpub-qos2-bad-pubcomp.py /^ helper = mosq_test.do_client_connect(helper_connect, helper_connack, timeout=20, port=port)$/;" v +helper test/broker/03-publish-dollar-v5.py /^def helper(topic, reason_code):$/;" f +helper_connack test/broker/02-subpub-qos1-bad-pubcomp.py /^helper_connack = mosq_test.gen_connack(rc=0)$/;" v +helper_connack test/broker/02-subpub-qos1-bad-pubrec.py /^helper_connack = mosq_test.gen_connack(rc=0)$/;" v +helper_connack test/broker/02-subpub-qos1-message-expiry-retain.py /^helper_connack = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +helper_connack test/broker/02-subpub-qos1-message-expiry-will.py /^helper_connack = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +helper_connack test/broker/02-subpub-qos1-message-expiry.py /^helper_connack = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +helper_connack test/broker/02-subpub-qos2-bad-puback-1.py /^helper_connack = mosq_test.gen_connack(rc=0)$/;" v +helper_connack test/broker/02-subpub-qos2-bad-puback-2.py /^helper_connack = mosq_test.gen_connack(rc=0)$/;" v +helper_connack test/broker/02-subpub-qos2-bad-pubcomp.py /^helper_connack = mosq_test.gen_connack(rc=0)$/;" v +helper_connack test/broker/11-message-expiry.py /^helper_connack = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +helper_connack_packet test/broker/11-subscription-id.py /^helper_connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5)$/;" v +helper_connect test/broker/02-subpub-qos1-bad-pubcomp.py /^helper_connect = mosq_test.gen_connect("helper", keepalive=keepalive)$/;" v +helper_connect test/broker/02-subpub-qos1-bad-pubrec.py /^helper_connect = mosq_test.gen_connect("helper", keepalive=keepalive)$/;" v +helper_connect test/broker/02-subpub-qos1-message-expiry-retain.py /^helper_connect = mosq_test.gen_connect("helper", proto_ver=5)$/;" v +helper_connect test/broker/02-subpub-qos1-message-expiry-will.py /^helper_connect = mosq_test.gen_connect("helper", proto_ver=5, will_topic="subpub\/qos1", will_qos=1, will_payload=b"message", will_properties=props, keepalive=2)$/;" v +helper_connect test/broker/02-subpub-qos1-message-expiry.py /^helper_connect = mosq_test.gen_connect("helper", proto_ver=5)$/;" v +helper_connect test/broker/02-subpub-qos2-bad-puback-1.py /^helper_connect = mosq_test.gen_connect("helper", keepalive=keepalive)$/;" v +helper_connect test/broker/02-subpub-qos2-bad-puback-2.py /^helper_connect = mosq_test.gen_connect("helper", keepalive=keepalive)$/;" v +helper_connect test/broker/02-subpub-qos2-bad-pubcomp.py /^helper_connect = mosq_test.gen_connect("helper", keepalive=keepalive)$/;" v +helper_connect test/broker/11-message-expiry.py /^helper_connect = mosq_test.gen_connect("helper", proto_ver=5)$/;" v +helper_connect_packet test/broker/11-subscription-id.py /^helper_connect_packet = mosq_test.gen_connect("helper", keepalive=keepalive, clean_session=True, proto_ver=5)$/;" v +helper_puback_packet test/broker/11-subscription-id.py /^helper_puback_packet = mosq_test.gen_puback(mid, proto_ver=5)$/;" v +helper_publish_packet test/broker/11-subscription-id.py /^helper_publish_packet = mosq_test.gen_publish("subpub\/qos1", qos=1, mid=mid, payload="message", proto_ver=5)$/;" v +hfile lib/util_mosq.c /^ HANDLE hfile;$/;" l +hh src/db_dump/db_dump.c /^ UT_hash_handle hh;$/;" m struct:msg_store_chunk file: +hh src/mosquitto_broker_internal.h /^ UT_hash_handle hh;$/;" m struct:mosquitto__subhier +hh src/mosquitto_broker_internal.h /^ UT_hash_handle hh;$/;" m struct:mosquitto__subshared +hh src/mosquitto_broker_internal.h /^ UT_hash_handle hh;$/;" m struct:mosquitto__unpwd +hh src/mosquitto_broker_internal.h /^ UT_hash_handle hh;$/;" m struct:mosquitto_msg_store_load +hh_head src/deps/uthash.h /^ struct UT_hash_handle *hh_head;$/;" m struct:UT_hash_bucket typeref:struct:UT_hash_bucket::UT_hash_handle +hh_id lib/mosquitto_internal.h /^ UT_hash_handle hh_id;$/;" m struct:mosquitto +hh_id src/db_dump/db_dump.c /^ UT_hash_handle hh_id;$/;" m struct:client_chunk file: +hh_next src/deps/uthash.h /^ struct UT_hash_handle *hh_next; \/* next hh in bucket order *\/$/;" m struct:UT_hash_handle typeref:struct:UT_hash_handle::UT_hash_handle +hh_prev src/deps/uthash.h /^ struct UT_hash_handle *hh_prev; \/* previous hh in bucket order *\/$/;" m struct:UT_hash_handle typeref:struct:UT_hash_handle::UT_hash_handle +hh_sock lib/mosquitto_internal.h /^ UT_hash_handle hh_sock;$/;" m struct:mosquitto +hho src/deps/uthash.h /^ ptrdiff_t hho; \/* hash handle offset (byte pos of hash handle in element *\/$/;" m struct:UT_hash_table +hier lib/mosquitto.c /^ int hier;$/;" l +hier src/mosquitto_broker_internal.h /^ struct mosquitto__subhier *hier;$/;" m struct:mosquitto__subshared_ref typeref:struct:mosquitto__subshared_ref::mosquitto__subhier +hier src/subs.c /^ struct mosquitto__subhier *hier;$/;" l +hier_count lib/mosquitto.c /^ int hier_count = 1;$/;" l +hints lib/net_mosq.c /^ struct addrinfo *hints;$/;" l +hints lib/net_mosq.c /^ struct addrinfo hints;$/;" l +hints src/net.c /^ struct addrinfo hints;$/;" l +host client/client_shared.c /^ char *username = NULL, *password = NULL, *host = NULL, *port = NULL;$/;" l +host client/client_shared.h /^ char *host;$/;" m struct:mosq_config +host lib/mosquitto_internal.h /^ char *host;$/;" m struct:mosquitto +host src/mosquitto_broker_internal.h /^ char *host;$/;" m struct:mosquitto__listener +hostname src/conf.c /^ char hostname[256];$/;" l +hrc test/broker/03-publish-b2c-disconnect-qos2.py /^ hrc = pub.wait()$/;" v +http__canonical_filename src/websockets.c /^static char *http__canonical_filename($/;" f file: +http_dir src/mosquitto_broker_internal.h /^ char *http_dir;$/;" m struct:libws_mqtt_hack +http_dir src/mosquitto_broker_internal.h /^ char *http_dir;$/;" m struct:mosquitto__listener +http_dir src/websockets.c /^ char *http_dir;$/;" l +i client/client_shared.c /^ int i, j;$/;" l +i client/client_shared.c /^ int i;$/;" l +i client/client_shared.c /^ size_t i;$/;" l +i client/sub_client.c /^ int i;$/;" l +i client/sub_client_output.c /^ int i;$/;" l +i examples/subscribe_simple/multiple.c /^ int i;$/;" l +i lib/actions.c /^ int i;$/;" l +i lib/alias_mosq.c /^ int i;$/;" l +i lib/connect.c /^ int i;$/;" l +i lib/handle_suback.c /^ int i = 0;$/;" l +i lib/helpers.c /^ int i;$/;" l +i lib/loop.c /^ int i;$/;" l +i lib/mosquitto.c /^ int i, j;$/;" l +i lib/mosquitto.c /^ int i;$/;" l +i lib/net_mosq.c /^ int i;$/;" l +i lib/net_mosq_ocsp.c /^ int ocsp_status, result2, i;$/;" l +i lib/packet_datatypes.c /^ int i;$/;" l +i lib/packet_mosq.c /^ int i;$/;" l +i lib/send_publish.c /^ int i;$/;" l +i lib/send_subscribe.c /^ int i;$/;" l +i lib/send_unsubscribe.c /^ int i;$/;" l +i lib/socks_mosq.c /^ uint8_t i;$/;" l +i lib/tls_mosq.c /^ int i;$/;" l +i lib/utf8_mosq.c /^ int i;$/;" l +i lib/util_mosq.c /^ int i;$/;" l +i lib/util_mosq.c /^ size_t i = 0;$/;" l +i lib/util_topic.c /^ size_t i;$/;" l +i src/bridge.c /^ int i;$/;" l +i src/conf.c /^ int i, j;$/;" l +i src/conf.c /^ int i;$/;" l +i src/conf_includedir.c /^ int i;$/;" l +i src/context.c /^ int i;$/;" l +i src/database.c /^ int i;$/;" l +i src/handle_connack.c /^ int i;$/;" l +i src/handle_connect.c /^ int i;$/;" l +i src/handle_publish.c /^ int i;$/;" l +i src/loop.c /^ int i;$/;" l +i src/mosquitto.c /^ int i, j;$/;" l +i src/mosquitto_passwd.c /^ size_t i;$/;" l +i src/net.c /^ int i;$/;" l +i src/persist_read.c /^ int i;$/;" l +i src/security.c /^ int i;$/;" l +i src/security_default.c /^ int i;$/;" l +i src/security_default.c /^ size_t i;$/;" l +i src/subs.c /^ int i;$/;" l +i src/websockets.c /^ int count, i, j;$/;" l +i src/websockets.c /^ int i;$/;" l +i test/broker/c/auth_plugin_extended_multiple.c /^ int i;$/;" l +i test/broker/c/auth_plugin_extended_single.c /^ int i;$/;" l +i test/broker/c/auth_plugin_extended_single2.c /^ int i;$/;" l +i test/lib/c/03-publish-c2b-qos1-receive-maximum.c /^ int i;$/;" l +i test/lib/c/03-publish-c2b-qos2-receive-maximum-1.c /^ int i;$/;" l +i test/lib/c/03-publish-c2b-qos2-receive-maximum-2.c /^ int i;$/;" l +i test/lib/c/09-util-topic-tokenise.c /^ int i;$/;" l +i test/lib/cpp/09-util-topic-tokenise.cpp /^ int i;$/;" l +i test/old/msgsps_pub.c /^ int i;$/;" l +i test/unit/datatype_read.c /^ int i;$/;" l +i test/unit/datatype_write.c /^ int i;$/;" l +i test/unit/utf8.c /^ int i;$/;" l +i16 lib/property_mosq.h /^ uint16_t i16;$/;" m union:mqtt5__property::__anon2 +i16temp src/db_dump/db_dump.c /^ uint16_t i16temp, chunk;$/;" l +i16temp src/db_dump/db_dump.c /^ uint16_t i16temp;$/;" l +i16temp src/persist_read.c /^ uint16_t i16temp;$/;" l +i16temp src/persist_read_v234.c /^ uint16_t i16temp;$/;" l +i32 lib/property_mosq.h /^ uint32_t i32;$/;" m union:mqtt5__property::__anon2 +i32temp src/db_dump/db_dump.c /^ uint32_t i32temp, length;$/;" l +i32temp src/db_dump/db_dump.c /^ uint32_t i32temp;$/;" l +i32temp src/persist_read.c /^ uint32_t i32temp;$/;" l +i32temp src/persist_read_v234.c /^ uint32_t i32temp;$/;" l +i64temp src/db_dump/db_dump.c /^ dbid_t i64temp, store_id;$/;" l +i64temp src/db_dump/db_dump.c /^ dbid_t i64temp;$/;" l +i64temp src/persist_read_v234.c /^ dbid_t i64temp;$/;" l +i8 lib/property_mosq.h /^ uint8_t i8;$/;" m union:mqtt5__property::__anon2 +i8temp src/db_dump/db_dump.c /^ uint8_t i8temp;$/;" l +i_mult src/sys_tree.c /^ double i_mult;$/;" l +id client/client_shared.h /^ char *id;$/;" m struct:mosq_config +id lib/mosquitto_internal.h /^ char *id;$/;" m struct:mosquitto +id src/db_dump/db_dump.c /^ char *id;$/;" m struct:client_chunk file: +id src/loop.c /^ char *id;$/;" l +id test/old/msgsps_sub.c /^ char id[50];$/;" l +id_len src/persist.h /^ uint16_t id_len;$/;" m struct:PF_client +id_len src/persist.h /^ uint16_t id_len;$/;" m struct:PF_client_msg +id_len src/persist.h /^ uint16_t id_len;$/;" m struct:PF_sub +id_len src/persist_write_v5.c /^ uint16_t id_len = chunk->F.id_len;$/;" l +id_prefix client/client_shared.h /^ char *id_prefix;$/;" m struct:mosq_config +ideal_chain_maxlen src/deps/uthash.h /^ unsigned ideal_chain_maxlen;$/;" m struct:UT_hash_table +identifier client/client_props.c /^ int cmd, identifier, type;$/;" l +identifier lib/property_mosq.h /^ int32_t identifier;$/;" m struct:mqtt5__property +identifier src/mosquitto_broker_internal.h /^ uint32_t identifier;$/;" m struct:mosquitto__subleaf +identifier src/persist.h /^ uint32_t identifier;$/;" m struct:PF_sub +identifier test/unit/property_user_read.c /^ int identifier, type;$/;" l +idle_timeout src/mosquitto_broker_internal.h /^ int idle_timeout;$/;" m struct:mosquitto__bridge +ifr src/net.c /^ struct ifreq ifr;$/;" l +in_callback lib/mosquitto_internal.h /^ bool in_callback;$/;" m struct:mosquitto +in_packet lib/mosquitto_internal.h /^ struct mosquitto__packet in_packet;$/;" m struct:mosquitto typeref:struct:mosquitto::mosquitto__packet +incdir config.mk /^incdir?=${prefix}\/include$/;" m +ineff_expands src/deps/uthash.h /^ unsigned ineff_expands, noexpand;$/;" m struct:UT_hash_table +inflight lib/mosquitto_internal.h /^ struct mosquitto_client_msg *inflight;$/;" m struct:mosquitto_msg_data typeref:struct:mosquitto_msg_data::mosquitto_client_msg +inflight_maximum lib/mosquitto_internal.h /^ uint16_t inflight_maximum;$/;" m struct:mosquitto_msg_data +inflight_quota lib/mosquitto_internal.h /^ int inflight_quota;$/;" m struct:mosquitto_msg_data +info src/websockets.c /^ struct lws_context_creation_info info;$/;" l +init_config client/client_shared.c /^void init_config(struct mosq_config *cfg, int pub_or_sub)$/;" f +init_datatype_read_tests test/unit/datatype_read.c /^int init_datatype_read_tests(void)$/;" f +init_datatype_write_tests test/unit/datatype_write.c /^int init_datatype_write_tests(void)$/;" f +init_persist_read_tests test/unit/persist_read_test.c /^int init_persist_read_tests(void)$/;" f +init_property_add_tests test/unit/property_add.c /^int init_property_add_tests(void)$/;" f +init_property_read_tests test/unit/property_read.c /^int init_property_read_tests(void)$/;" f +init_property_user_read_tests test/unit/property_user_read.c /^int init_property_user_read_tests(void)$/;" f +init_property_write_tests test/unit/property_write.c /^int init_property_write_tests(void)$/;" f +init_publish_tests test/unit/publish_test.c /^int init_publish_tests(void)$/;" f +init_utf8_tests test/unit/utf8.c /^int init_utf8_tests(void)$/;" f +init_util_topic_tests test/unit/util_topic_test.c /^int init_util_topic_tests(void)$/;" f +initial_notification_done src/mosquitto_broker_internal.h /^ bool initial_notification_done;$/;" m struct:mosquitto__bridge +initial_publish src/sys_tree.c /^ bool initial_publish = false;$/;" l +inlen src/websockets.c /^ size_t inlen, slen;$/;" l +insecure client/client_shared.h /^ bool insecure;$/;" m struct:mosq_config +int16_prop_read_helper test/unit/property_read.c /^static void int16_prop_read_helper($/;" f file: +int16_prop_write_helper test/unit/property_write.c /^static void int16_prop_write_helper($/;" f file: +int16_value test/unit/property_user_read.c /^ uint16_t int16_value;$/;" l +int32_prop_read_helper test/unit/property_read.c /^static void int32_prop_read_helper($/;" f file: +int32_prop_write_helper test/unit/property_write.c /^static void int32_prop_write_helper($/;" f file: +int32_value test/unit/property_user_read.c /^ uint32_t int32_value;$/;" l +int_db src/logging.c /^extern struct mosquitto_db int_db;$/;" x +int_db src/mosquitto.c /^struct mosquitto_db int_db;$/;" v typeref:struct:mosquitto_db +int_db src/websockets.c /^extern struct mosquitto_db int_db;$/;" x +ipv4_addr lib/tls_mosq.c /^ unsigned char ipv4_addr[4];$/;" l +ipv4_ok lib/tls_mosq.c /^ int ipv4_ok;$/;" l +ipv4_pton_result lib/socks_mosq.c /^ int ipv4_pton_result;$/;" l +ipv6_addr lib/tls_mosq.c /^ unsigned char ipv6_addr[16];$/;" l +ipv6_ok lib/tls_mosq.c /^ int ipv6_ok;$/;" l +ipv6_pton_result lib/socks_mosq.c /^ int ipv6_pton_result;$/;" l +is_bridge lib/mosquitto_internal.h /^ bool is_bridge;$/;" m struct:mosquitto +is_dropping lib/mosquitto_internal.h /^ bool is_dropping;$/;" m struct:mosquitto +is_duplicate src/loop.c /^ bool is_duplicate = false;$/;" l +is_first lib/property_mosq.c /^ bool is_first = true;$/;" l +item src/session_expiry.c /^ struct session_expiry_list *item, *tmp;$/;" l +item src/session_expiry.c /^ struct session_expiry_list *item;$/;" l +item src/will_delay.c /^ struct will_delay_list *item, *tmp;$/;" l +item src/will_delay.c /^ struct will_delay_list *item;$/;" l +ival lib/options.c /^ int ival;$/;" l +j client/client_shared.c /^ int i, j;$/;" l +j lib/mosquitto.c /^ int i, j;$/;" l +j lib/utf8_mosq.c /^ int j;$/;" l +j src/conf.c /^ int i, j;$/;" l +j src/conf.c /^ int j;$/;" l +j src/loop.c /^ int j;$/;" l +j src/mosquitto.c /^ int i, j;$/;" l +j src/net.c /^ int j;$/;" l +j src/websockets.c /^ int count, i, j;$/;" l +json_print client/sub_client_output.c /^static void json_print(const struct mosquitto_message *message, const struct tm *ti, bool escaped)$/;" f file: +keepalive client/client_shared.h /^ int keepalive;$/;" m struct:mosq_config +keepalive examples/temperature_conversion/temperature_conversion.cpp /^ int keepalive = 60;$/;" l +keepalive lib/mosquitto_internal.h /^ uint16_t keepalive;$/;" m struct:mosquitto +keepalive src/mosquitto_broker_internal.h /^ int keepalive;$/;" m struct:mosquitto__bridge +keepalive test/broker/01-connect-anon-denied.py /^keepalive = 10$/;" v +keepalive test/broker/01-connect-disconnect-v5.py /^keepalive = 10$/;" v +keepalive test/broker/01-connect-duplicate-v5.py /^keepalive = 10$/;" v +keepalive test/broker/01-connect-duplicate.py /^keepalive = 10$/;" v +keepalive test/broker/01-connect-invalid-id-0-311.py /^keepalive = 10$/;" v +keepalive test/broker/01-connect-invalid-id-0.py /^keepalive = 10$/;" v +keepalive test/broker/01-connect-invalid-id-missing.py /^keepalive = 10$/;" v +keepalive test/broker/01-connect-invalid-id-utf8.py /^keepalive = 60$/;" v +keepalive test/broker/01-connect-invalid-protonum.py /^keepalive = 10$/;" v +keepalive test/broker/01-connect-invalid-reserved.py /^keepalive = 10$/;" v +keepalive test/broker/01-connect-success-v5.py /^keepalive = 10$/;" v +keepalive test/broker/01-connect-success.py /^keepalive = 10$/;" v +keepalive test/broker/01-connect-uname-invalid-utf8.py /^keepalive = 60$/;" v +keepalive test/broker/01-connect-uname-no-flag.py /^keepalive = 10$/;" v +keepalive test/broker/01-connect-uname-no-password-denied.py /^keepalive = 10$/;" v +keepalive test/broker/01-connect-uname-password-denied-no-will.py /^keepalive = 10$/;" v +keepalive test/broker/01-connect-uname-password-denied.py /^keepalive = 10$/;" v +keepalive test/broker/01-connect-uname-password-success-no-tls.py /^keepalive = 10$/;" v +keepalive test/broker/01-connect-uname-password-success.py /^keepalive = 10$/;" v +keepalive test/broker/01-connect-uname-pwd-no-flag.py /^keepalive = 10$/;" v +keepalive test/broker/02-shared-qos0-v5.py /^keepalive = 60$/;" v +keepalive test/broker/02-subhier-crash.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos0-retain-as-publish.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos0-send-retain.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos0-subscription-id.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos0-topic-alias-unknown.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos0-topic-alias.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos0-v5.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos0.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos1-bad-pubcomp.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos1-bad-pubrec.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos1-message-expiry-retain.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos1-message-expiry-will.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos1-message-expiry.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos1-nolocal.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos1-v5.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos1.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos2-bad-puback-1.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos2-bad-puback-2.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos2-bad-pubcomp.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos2-pubrec-error-helper.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos2-pubrec-error.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos2-receive-maximum-1.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos2-receive-maximum-2.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos2-receive-maximum-helper.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos2-v5.py /^keepalive = 60$/;" v +keepalive test/broker/02-subpub-qos2.py /^keepalive = 60$/;" v +keepalive test/broker/02-subscribe-invalid-utf8.py /^keepalive = 60$/;" v +keepalive test/broker/02-subscribe-persistence-flipflop.py /^keepalive = 60$/;" v +keepalive test/broker/02-subscribe-qos0.py /^keepalive = 60$/;" v +keepalive test/broker/02-subscribe-qos1.py /^keepalive = 60$/;" v +keepalive test/broker/02-subscribe-qos2.py /^keepalive = 60$/;" v +keepalive test/broker/02-unsubscribe-invalid-no-topic.py /^keepalive = 60$/;" v +keepalive test/broker/02-unsubscribe-qos0.py /^keepalive = 60$/;" v +keepalive test/broker/02-unsubscribe-qos1.py /^keepalive = 60$/;" v +keepalive test/broker/02-unsubscribe-qos2-multiple-v5.py /^keepalive = 60$/;" v +keepalive test/broker/02-unsubscribe-qos2-multiple.py /^keepalive = 60$/;" v +keepalive test/broker/02-unsubscribe-qos2-v5.py /^keepalive = 60$/;" v +keepalive test/broker/02-unsubscribe-qos2.py /^keepalive = 60$/;" v +keepalive test/broker/03-pattern-matching-helper.py /^keepalive = 60$/;" v +keepalive test/broker/03-publish-b2c-disconnect-qos1-helper.py /^keepalive = 60$/;" v +keepalive test/broker/03-publish-b2c-disconnect-qos1.py /^keepalive = 60$/;" v +keepalive test/broker/03-publish-b2c-disconnect-qos2-helper.py /^keepalive = 60$/;" v +keepalive test/broker/03-publish-b2c-disconnect-qos2.py /^keepalive = 60$/;" v +keepalive test/broker/03-publish-b2c-qos1-len-helper.py /^keepalive = 60$/;" v +keepalive test/broker/03-publish-b2c-qos2-len-helper.py /^keepalive = 60$/;" v +keepalive test/broker/03-publish-b2c-timeout-qos1-helper.py /^keepalive = 60$/;" v +keepalive test/broker/03-publish-b2c-timeout-qos1.py /^keepalive = 60$/;" v +keepalive test/broker/03-publish-b2c-timeout-qos2-helper.py /^keepalive = 60$/;" v +keepalive test/broker/03-publish-b2c-timeout-qos2.py /^keepalive = 60$/;" v +keepalive test/broker/03-publish-c2b-disconnect-qos2.py /^keepalive = 60$/;" v +keepalive test/broker/03-publish-c2b-timeout-qos2.py /^keepalive = 600$/;" v +keepalive test/broker/03-publish-dollar-v5.py /^keepalive = 60$/;" v +keepalive test/broker/03-publish-dollar.py /^keepalive = 60$/;" v +keepalive test/broker/03-publish-invalid-utf8.py /^keepalive = 60$/;" v +keepalive test/broker/03-publish-qos1-no-subscribers-v5.py /^keepalive = 60$/;" v +keepalive test/broker/03-publish-qos1-retain-disabled.py /^keepalive = 60$/;" v +keepalive test/broker/03-publish-qos1.py /^keepalive = 60$/;" v +keepalive test/broker/03-publish-qos2.py /^keepalive = 60$/;" v +keepalive test/broker/04-retain-qos0-clear.py /^keepalive = 60$/;" v +keepalive test/broker/04-retain-qos0-fresh.py /^keepalive = 60$/;" v +keepalive test/broker/04-retain-qos0-repeated.py /^keepalive = 60$/;" v +keepalive test/broker/04-retain-qos0.py /^keepalive = 60$/;" v +keepalive test/broker/04-retain-qos1-qos0.py /^keepalive = 60$/;" v +keepalive test/broker/04-retain-upgrade-outgoing-qos.py /^keepalive = 60$/;" v +keepalive test/broker/05-clean-session-qos1-helper.py /^keepalive = 60$/;" v +keepalive test/broker/05-clean-session-qos1.py /^keepalive = 60$/;" v +keepalive test/broker/05-session-expiry-v5.py /^keepalive = 60$/;" v +keepalive test/broker/06-bridge-b2br-disconnect-qos1.py /^keepalive = 60$/;" v +keepalive test/broker/06-bridge-b2br-disconnect-qos2.py /^keepalive = 60$/;" v +keepalive test/broker/06-bridge-b2br-late-connection-retain.py /^keepalive = 60$/;" v +keepalive test/broker/06-bridge-b2br-late-connection.py /^keepalive = 60$/;" v +keepalive test/broker/06-bridge-b2br-remapping.py /^keepalive = 60$/;" v +keepalive test/broker/06-bridge-br2b-disconnect-qos1-helper.py /^keepalive = 60$/;" v +keepalive test/broker/06-bridge-br2b-disconnect-qos1.py /^keepalive = 60$/;" v +keepalive test/broker/06-bridge-br2b-disconnect-qos2-helper.py /^keepalive = 60$/;" v +keepalive test/broker/06-bridge-br2b-disconnect-qos2.py /^keepalive = 60$/;" v +keepalive test/broker/06-bridge-br2b-remapping.py /^keepalive = 60$/;" v +keepalive test/broker/06-bridge-fail-persist-resend-qos1.py /^keepalive = 60$/;" v +keepalive test/broker/06-bridge-fail-persist-resend-qos2.py /^keepalive = 60$/;" v +keepalive test/broker/06-bridge-per-listener-settings.py /^keepalive = 60$/;" v +keepalive test/broker/06-bridge-reconnect-local-out-helper.py /^keepalive = 60$/;" v +keepalive test/broker/06-bridge-reconnect-local-out.py /^keepalive = 60$/;" v +keepalive test/broker/07-will-invalid-utf8.py /^keepalive = 60$/;" v +keepalive test/broker/07-will-no-flag.py /^keepalive = 10$/;" v +keepalive test/broker/07-will-null-helper.py /^keepalive = 60$/;" v +keepalive test/broker/07-will-null-topic.py /^keepalive = 60$/;" v +keepalive test/broker/07-will-null.py /^keepalive = 60$/;" v +keepalive test/broker/08-ssl-bridge-helper.py /^keepalive = 60$/;" v +keepalive test/broker/08-ssl-bridge.py /^keepalive = 60$/;" v +keepalive test/broker/08-ssl-connect-cert-auth-crl.py /^keepalive = 10$/;" v +keepalive test/broker/08-ssl-connect-cert-auth-expired.py /^keepalive = 10$/;" v +keepalive test/broker/08-ssl-connect-cert-auth-revoked.py /^keepalive = 10$/;" v +keepalive test/broker/08-ssl-connect-cert-auth-without.py /^keepalive = 10$/;" v +keepalive test/broker/08-ssl-connect-cert-auth.py /^keepalive = 10$/;" v +keepalive test/broker/08-ssl-connect-identity.py /^keepalive = 10$/;" v +keepalive test/broker/08-ssl-connect-no-auth-wrong-ca.py /^keepalive = 10$/;" v +keepalive test/broker/08-ssl-connect-no-auth.py /^keepalive = 10$/;" v +keepalive test/broker/08-ssl-connect-no-identity.py /^keepalive = 10$/;" v +keepalive test/broker/08-tls-psk-bridge.py /^keepalive = 60$/;" v +keepalive test/broker/08-tls-psk-pub.py /^keepalive = 10$/;" v +keepalive test/broker/09-acl-change.py /^keepalive = 60$/;" v +keepalive test/broker/09-auth-bad-method.py /^keepalive = 10$/;" v +keepalive test/broker/09-plugin-auth-acl-pub.py /^keepalive = 10$/;" v +keepalive test/broker/09-plugin-auth-acl-sub-denied.py /^keepalive = 10$/;" v +keepalive test/broker/09-plugin-auth-acl-sub.py /^keepalive = 10$/;" v +keepalive test/broker/09-plugin-auth-defer-unpwd-fail.py /^keepalive = 10$/;" v +keepalive test/broker/09-plugin-auth-defer-unpwd-success.py /^keepalive = 10$/;" v +keepalive test/broker/09-plugin-auth-msg-params.py /^keepalive = 10$/;" v +keepalive test/broker/09-plugin-auth-unpwd-fail.py /^keepalive = 10$/;" v +keepalive test/broker/09-plugin-auth-unpwd-success.py /^keepalive = 10$/;" v +keepalive test/broker/09-plugin-auth-v2-unpwd-fail.py /^keepalive = 10$/;" v +keepalive test/broker/09-plugin-auth-v2-unpwd-success.py /^keepalive = 10$/;" v +keepalive test/broker/10-listener-mount-point-helper.py /^keepalive = 60$/;" v +keepalive test/broker/10-listener-mount-point.py /^keepalive = 60$/;" v +keepalive test/broker/11-message-expiry.py /^keepalive = 60$/;" v +keepalive test/broker/11-persistent-subscription-no-local.py /^keepalive = 60$/;" v +keepalive test/broker/11-persistent-subscription-v5.py /^keepalive = 60$/;" v +keepalive test/broker/11-persistent-subscription.py /^keepalive = 60$/;" v +keepalive test/broker/11-pub-props.py /^keepalive = 60$/;" v +keepalive test/broker/11-subscription-id.py /^keepalive = 60$/;" v +keepalive test/broker/12-prop-maximum-packet-size-broker.py /^keepalive = 10$/;" v +keepalive test/broker/12-prop-maximum-packet-size-connect.py /^keepalive = 10$/;" v +keepalive test/broker/12-prop-maximum-packet-size-publish-qos1.py /^keepalive = 10$/;" v +keepalive test/broker/12-prop-maximum-packet-size-publish-qos2.py /^keepalive = 10$/;" v +keepalive test/broker/12-prop-maximum-packet-size-publish.py /^keepalive = 10$/;" v +keepalive test/broker/12-prop-response-topic-correlation-data.py /^keepalive = 10$/;" v +keepalive test/broker/12-prop-response-topic.py /^keepalive = 10$/;" v +keepalive test/broker/12-prop-server-keepalive.py /^keepalive = 61$/;" v +keepalive test/broker/12-prop-session-expiry-invalid.py /^keepalive = 10$/;" v +keepalive test/lib/01-con-discon-success.py /^keepalive = 60$/;" v +keepalive test/lib/01-keepalive-pingreq.py /^keepalive = 4$/;" v +keepalive test/lib/01-no-clean-session.py /^keepalive = 60$/;" v +keepalive test/lib/01-server-keepalive-pingreq.py /^keepalive = 60$/;" v +keepalive test/lib/01-unpwd-set.py /^keepalive = 60$/;" v +keepalive test/lib/01-will-set.py /^keepalive = 60$/;" v +keepalive test/lib/01-will-unpwd-set.py /^keepalive = 60$/;" v +keepalive test/lib/02-subscribe-qos0.py /^keepalive = 60$/;" v +keepalive test/lib/02-subscribe-qos1.py /^keepalive = 60$/;" v +keepalive test/lib/02-subscribe-qos2.py /^keepalive = 60$/;" v +keepalive test/lib/02-unsubscribe-multiple-v5.py /^keepalive = 60$/;" v +keepalive test/lib/02-unsubscribe-v5.py /^keepalive = 60$/;" v +keepalive test/lib/02-unsubscribe.py /^keepalive = 60$/;" v +keepalive test/lib/03-publish-b2c-qos1.py /^keepalive = 60$/;" v +keepalive test/lib/03-publish-b2c-qos2.py /^keepalive = 60$/;" v +keepalive test/lib/03-publish-c2b-qos1-disconnect.py /^keepalive = 60$/;" v +keepalive test/lib/03-publish-c2b-qos1-receive-maximum.py /^keepalive = 60$/;" v +keepalive test/lib/03-publish-c2b-qos1-timeout.py /^keepalive = 60$/;" v +keepalive test/lib/03-publish-c2b-qos2-disconnect.py /^keepalive = 60$/;" v +keepalive test/lib/03-publish-c2b-qos2-maximum-qos-0.py /^keepalive = 60$/;" v +keepalive test/lib/03-publish-c2b-qos2-maximum-qos-1.py /^keepalive = 60$/;" v +keepalive test/lib/03-publish-c2b-qos2-pubrec-error.py /^keepalive = 60$/;" v +keepalive test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^keepalive = 60$/;" v +keepalive test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^keepalive = 60$/;" v +keepalive test/lib/03-publish-c2b-qos2-timeout.py /^keepalive = 60$/;" v +keepalive test/lib/03-publish-c2b-qos2.py /^keepalive = 60$/;" v +keepalive test/lib/03-publish-qos0-no-payload.py /^keepalive = 60$/;" v +keepalive test/lib/03-publish-qos0.py /^keepalive = 60$/;" v +keepalive test/lib/03-request-response-correlation.py /^keepalive = 60$/;" v +keepalive test/lib/03-request-response.py /^keepalive = 60$/;" v +keepalive test/lib/04-retain-qos0.py /^keepalive = 60$/;" v +keepalive test/lib/08-ssl-connect-cert-auth-enc.py /^keepalive = 60$/;" v +keepalive test/lib/08-ssl-connect-cert-auth.py /^keepalive = 60$/;" v +keepalive test/lib/08-ssl-connect-no-auth.py /^keepalive = 60$/;" v +keepalive test/lib/11-prop-oversize-packet.py /^keepalive = 60$/;" v +keepalive test/lib/11-prop-send-content-type.py /^keepalive = 60$/;" v +keepalive test/lib/11-prop-send-payload-format.py /^keepalive = 60$/;" v +key client/client_props.c /^ char *key = NULL, *value = NULL;$/;" l +key src/conf.c /^ char *key;$/;" l +key src/deps/uthash.h /^ void *key; \/* ptr to enclosing struct's key *\/$/;" m struct:UT_hash_handle +key src/mosquitto_plugin.h /^ char *key;$/;" m struct:mosquitto_auth_opt +key src/mosquitto_plugin.h /^ char *key;$/;" m struct:mosquitto_opt +key test/broker/c/mosquitto_plugin_v2.h /^ char *key;$/;" m struct:mosquitto_auth_opt +key test/unit/property_user_read.c /^ char *key = NULL, *value = NULL;$/;" l +key test/unit/property_user_read.c /^ char *key, *value;$/;" l +keyfile client/client_shared.h /^ char *keyfile;$/;" m struct:mosq_config +keyfile lib/mosquitto.h /^ char *keyfile;$/;" m struct:libmosquitto_tls +keyfile src/mosquitto_broker_internal.h /^ char *keyfile;$/;" m struct:mosquitto__listener +keyform client/client_shared.h /^ char *keyform;$/;" m struct:mosq_config +keyform src/conf.c /^ char *keyform = NULL;$/;" l +keylen src/deps/uthash.h /^ unsigned keylen; \/* enclosing struct's key len *\/$/;" m struct:UT_hash_handle +kpass_sha src/conf.c /^ char *kpass_sha = NULL, *kpass_sha_bin = NULL;$/;" l +kpass_sha_bin src/conf.c /^ char *kpass_sha = NULL, *kpass_sha_bin = NULL;$/;" l +l src/websockets.c /^ char *l = (char *)line;$/;" l +l_file_count src/conf_includedir.c /^ int l_file_count = 0;$/;" l +l_files src/conf_includedir.c /^ char **l_files = NULL;$/;" l +last src/context.c /^ struct mosquitto *last = NULL;$/;" l +last_backup src/loop.c /^ time_t last_backup = mosquitto_time();$/;" l +last_check src/loop.c /^ static time_t last_check = 0;$/;" l file: +last_check src/session_expiry.c /^static time_t last_check = 0;$/;" v file: +last_check src/will_delay.c /^static time_t last_check = 0;$/;" v file: +last_db_id src/mosquitto_broker_internal.h /^ dbid_t last_db_id;$/;" m struct:mosquitto_db +last_db_id src/persist.h /^ uint64_t last_db_id;$/;" m struct:PF_cfg +last_flush src/logging.c /^ static time_t last_flush = 0;$/;" l file: +last_identifier test/unit/persist_read_stubs.c /^extern uint32_t last_identifier;$/;" x +last_identifier test/unit/persist_read_test.c /^uint32_t last_identifier;$/;" v +last_mid client/pub_client.c /^static int last_mid = -1;$/;" v file: +last_mid client/sub_client.c /^int last_mid = 0;$/;" v +last_mid lib/mosquitto_internal.h /^ uint16_t last_mid;$/;" m struct:mosquitto +last_mid src/db_dump/db_dump.c /^ uint16_t last_mid;$/;" m struct:db_client file: +last_mid src/persist.h /^ uint16_t last_mid;$/;" m struct:PF_client +last_mid_sent client/pub_client.c /^static int last_mid_sent = -1;$/;" v file: +last_msg_in lib/mosquitto_internal.h /^ time_t last_msg_in;$/;" m struct:mosquitto +last_msg_in lib/util_mosq.c /^ time_t last_msg_in;$/;" l +last_qos test/unit/persist_read_stubs.c /^extern int last_qos;$/;" x +last_qos test/unit/persist_read_test.c /^int last_qos;$/;" v +last_qos test/unit/persist_write_stubs.c /^extern int last_qos;$/;" x +last_qos test/unit/persist_write_test.c /^int last_qos;$/;" v +last_retained test/unit/persist_read_stubs.c /^extern uint64_t last_retained;$/;" x +last_retained test/unit/persist_read_test.c /^uint64_t last_retained;$/;" v +last_retained test/unit/persist_write_stubs.c /^extern uint64_t last_retained;$/;" x +last_retained test/unit/persist_write_test.c /^uint64_t last_retained;$/;" v +last_sub test/unit/persist_read_stubs.c /^extern char *last_sub;$/;" x +last_sub test/unit/persist_read_test.c /^char *last_sub = NULL;$/;" v +last_sub test/unit/persist_write_stubs.c /^extern char *last_sub;$/;" x +last_sub test/unit/persist_write_test.c /^char *last_sub = NULL;$/;" v +last_update src/sys_tree.c /^ static time_t last_update = 0;$/;" l file: +lazy_reconnect src/mosquitto_broker_internal.h /^ bool lazy_reconnect;$/;" m struct:mosquitto__bridge +lbuf src/mosquitto_passwd.c /^ char lbuf[MAX_BUFFER_LEN], *token;$/;" l +lbuf src/mosquitto_passwd.c /^ char lbuf[MAX_BUFFER_LEN];$/;" l +lbytes lib/packet_datatypes.c /^ uint8_t lbytes = 0;$/;" l +leading_zero lib/util_mosq.c /^ int leading_zero = 0;$/;" l +leaf src/database.c /^ struct mosquitto__subleaf *leaf, *nextleaf;$/;" l +leaf src/handle_connect.c /^ struct mosquitto__subleaf *leaf;$/;" l +leaf src/subs.c /^ struct mosquitto__subleaf *leaf;$/;" l +len client/client_shared.c /^ int len;$/;" l +len client/client_shared.c /^ size_t len;$/;" l +len client/sub_client_output.c /^ int len;$/;" l +len lib/logging_mosq.c /^ int len;$/;" l +len lib/mosquitto.c /^ int len;$/;" l +len lib/net_mosq.c /^ int len;$/;" l +len lib/net_mosq_ocsp.c /^ long len = SSL_get_tlsext_status_ocsp_resp(mosq->ssl, &p);$/;" l +len lib/packet_mosq.c /^ uint32_t len;$/;" l +len lib/property_mosq.c /^ int len = 0;$/;" l +len lib/property_mosq.h /^ int len;$/;" m struct:mqtt__string +len lib/send_publish.c /^ size_t len;$/;" l +len lib/socks_mosq.c /^ ssize_t len;$/;" l +len lib/tls_mosq.c /^ int len;$/;" l +len lib/util_mosq.c /^ int len;$/;" l +len lib/util_topic.c /^ int len = 0;$/;" l +len src/conf.c /^ int len;$/;" l +len src/conf_includedir.c /^ int len;$/;" l +len src/handle_publish.c /^ int len;$/;" l +len src/handle_subscribe.c /^ int len;$/;" l +len src/logging.c /^ int len;$/;" l +len src/loop.c /^ socklen_t len;$/;" l +len src/mosquitto_passwd.c /^ int len;$/;" l +len src/mosquitto_passwd.c /^ size_t len;$/;" l +len src/net.c /^ int len;$/;" l +len src/persist_write.c /^ int len;$/;" l +len src/security_default.c /^ int len, tlen, clen, ulen;$/;" l +len src/security_default.c /^ int len;$/;" l +len src/subs.c /^ int len;$/;" l +len test/broker/c/auth_plugin_extended_multiple.c /^ int len;$/;" l +len1 test/unit/persist_write_test.c /^ size_t len1, len2;$/;" l +len2 test/unit/persist_write_test.c /^ size_t len1, len2;$/;" l +len_expected test/unit/property_read.c /^ CU_ASSERT_EQUAL(property__get_length_all(properties), 1+2+len_expected);$/;" l +len_expected test/unit/property_write.c /^ CU_ASSERT_EQUAL(property__get_length_all(properties), 1+2+len_expected);$/;" l +len_test test/broker/03-publish-b2c-qos1-len.py /^def len_test(test, puback_packet):$/;" f +len_test test/broker/03-publish-b2c-qos2-len.py /^def len_test(test, pubrec_packet, pubcomp_packet):$/;" f +len_test test/broker/03-publish-c2b-qos2-len.py /^def len_test(test, pubrel_packet):$/;" f +len_test test/lib/03-publish-b2c-qos2-len.py /^def len_test(test, pubrel_packet):$/;" f +len_test test/lib/03-publish-c2b-qos1-len.py /^def len_test(test, puback_packet):$/;" f +len_test test/lib/03-publish-c2b-qos2-len.py /^def len_test(test, pubrec_packet, pubcomp_packet):$/;" f +length src/db_dump/db_dump.c /^ uint32_t i32temp, length;$/;" l +length src/db_dump/db_dump.c /^ uint32_t length;$/;" m struct:msg_store_chunk file: +length src/persist.h /^ uint32_t length;$/;" m struct:PF_header +length src/persist_read.c /^ int chunk, length;$/;" l +length test/unit/datatype_read.c /^ int length = -1;$/;" l +length test/unit/property_user_read.c /^ uint16_t length;$/;" l +lib src/mosquitto_broker_internal.h /^ void *lib;$/;" m struct:mosquitto__auth_plugin +lib src/security.c /^ void *lib;$/;" l +lib_cleanup lib/cpp/mosquittopp.cpp /^int lib_cleanup()$/;" f namespace:mosqpp +lib_init lib/cpp/mosquittopp.cpp /^int lib_init()$/;" f namespace:mosqpp +lib_version lib/cpp/mosquittopp.cpp /^int lib_version(int *major, int *minor, int *revision)$/;" f namespace:mosqpp +libdir config.mk /^libdir?=${prefix}\/lib${LIB_SUFFIX}$/;" m +libmosq_EXPORT lib/mosquitto.h 26;" d +libmosq_EXPORT lib/mosquitto.h 28;" d +libmosq_EXPORT lib/mosquitto.h 31;" d +libmosquitto_auth lib/mosquitto.h /^struct libmosquitto_auth {$/;" s +libmosquitto_tls lib/mosquitto.h /^struct libmosquitto_tls {$/;" s +libmosquitto_will lib/mosquitto.h /^struct libmosquitto_will {$/;" s +libwebsocket src/mosquitto_broker_internal.h 39;" d +libwebsocket_callback_on_writable src/mosquitto_broker_internal.h 28;" d +libwebsocket_callback_reasons src/mosquitto_broker_internal.h 38;" d +libwebsocket_context src/mosquitto_broker_internal.h 36;" d +libwebsocket_context_destroy src/mosquitto_broker_internal.h 31;" d +libwebsocket_create_context src/mosquitto_broker_internal.h 30;" d +libwebsocket_get_socket_fd src/mosquitto_broker_internal.h 33;" d +libwebsocket_protocols src/mosquitto_broker_internal.h 37;" d +libwebsocket_service src/mosquitto_broker_internal.h 29;" d +libwebsocket_write src/mosquitto_broker_internal.h 32;" d +libwebsockets_get_protocol src/mosquitto_broker_internal.h 35;" d +libwebsockets_return_http_status src/mosquitto_broker_internal.h 34;" d +libws_http_data src/websockets.c /^struct libws_http_data {$/;" s file: +libws_mqtt_data src/mosquitto_broker_internal.h /^struct libws_mqtt_data {$/;" s +libws_mqtt_hack src/mosquitto_broker_internal.h /^struct libws_mqtt_hack {$/;" s +lifetime test/random/random_client.py /^lifetime = time.time() + random.uniform(5.0, 10.0)$/;" v +lim src/conf.c /^ ssize_t lim;$/;" l +line client/client_shared.c /^ char line[1024];$/;" l +line misc/currentcost/cc128_read.py /^ line = usb.readline()$/;" v +line src/mosquitto_passwd.c /^ int line = 0;$/;" l +line_buf client/pub_client.c /^static char *line_buf = NULL;$/;" v file: +line_buf_len client/pub_client.c /^static int line_buf_len = 1024;$/;" v file: +lineno src/conf.c /^ int lineno = 0;$/;" l +lineno_ext src/conf.c /^ int lineno_ext = 0;$/;" l +listener lib/mosquitto_internal.h /^ struct mosquitto__listener *listener;$/;" m struct:mosquitto typeref:struct:mosquitto::mosquitto__listener +listener src/net.c /^ struct mosquitto__listener *listener;$/;" l +listener test/unit/persist_read_test.c /^ struct mosquitto__listener listener;$/;" l +listener test/unit/persist_write_test.c /^ struct mosquitto__listener listener;$/;" l +listener_count src/mosquitto_broker_internal.h /^ int listener_count;$/;" m struct:mosquitto__config +listeners src/mosquitto_broker_internal.h /^ struct mosquitto__listener *listeners;$/;" m struct:mosquitto__config typeref:struct:mosquitto__config::mosquitto__listener +listensock lib/net_mosq.c /^ mosq_sock_t listensock;$/;" l +listensock src/mosquitto.c /^ mosq_sock_t *listensock = NULL;$/;" l +listensock_count src/mosquitto.c /^ int listensock_count = 0;$/;" l +listensock_index src/mosquitto.c /^ int listensock_index = 0;$/;" l +ll_for_free src/mosquitto_broker_internal.h /^ struct mosquitto *ll_for_free;$/;" m struct:mosquitto_db typeref:struct:mosquitto_db::mosquitto +load src/persist_read.c /^ struct mosquitto_msg_store_load *load, *load_tmp;$/;" l +load src/persist_read.c /^ struct mosquitto_msg_store_load *load;$/;" l +load_file client/pub_shared.c /^int load_file(const char *filename)$/;" f +load_stdin client/pub_shared.c /^int load_stdin(void)$/;" f +load_tmp src/persist_read.c /^ struct mosquitto_msg_store_load *load, *load_tmp;$/;" l +loc client/client_shared.c /^ char *loc = NULL;$/;" l +local_acl src/security_default.c /^ char *local_acl;$/;" l +local_broker test/broker/06-bridge-reconnect-local-out.py /^local_broker = mosq_test.start_broker(cmd=local_cmd, filename=os.path.basename(__file__)+'_local1', use_conf=False, port=port2)$/;" v +local_broker test/broker/06-bridge-reconnect-local-out.py /^local_broker = mosq_test.start_broker(cmd=local_cmd, filename=os.path.basename(__file__)+'_local2', port=port2)$/;" v +local_clientid src/mosquitto_broker_internal.h /^ char *local_clientid;$/;" m struct:mosquitto__bridge +local_cmd test/broker/06-bridge-reconnect-local-out.py /^local_cmd = ['..\/..\/src\/mosquitto', '-c', '06-bridge-reconnect-local-out.conf']$/;" v +local_id src/bridge.c /^ char *local_id;$/;" l +local_mid lib/actions.c /^ uint16_t local_mid;$/;" l +local_mid lib/send_subscribe.c /^ uint16_t local_mid;$/;" l +local_mid lib/send_unsubscribe.c /^ uint16_t local_mid;$/;" l +local_password src/mosquitto_broker_internal.h /^ char *local_password;$/;" m struct:mosquitto__bridge +local_prefix src/mosquitto_broker_internal.h /^ char *local_prefix;$/;" m struct:mosquitto__bridge_topic +local_properties src/database.c /^ mosquitto_property *local_properties = NULL;$/;" l +local_property lib/actions.c /^ mosquitto_property local_property;$/;" l +local_property lib/connect.c /^ mosquitto_property local_property;$/;" l +local_props lib/send_connect.c /^ mosquitto_property *local_props = NULL;$/;" l +local_timeout lib/loop.c /^ struct timespec local_timeout;$/;" l +local_topic src/mosquitto_broker_internal.h /^ char *local_topic; \/* topic prefixed with local_prefix *\/$/;" m struct:mosquitto__bridge_topic +local_topic src/security_default.c /^ char *local_topic;$/;" l +local_username src/mosquitto_broker_internal.h /^ char *local_username;$/;" m struct:mosquitto__bridge +localedir config.mk /^localedir?=${prefix}\/share\/locale$/;" m +log2_num_buckets src/deps/uthash.h /^ unsigned num_buckets, log2_num_buckets;$/;" m struct:UT_hash_table +log__close src/logging.c /^int log__close(struct mosquitto__config *config)$/;" f +log__init src/logging.c /^int log__init(struct mosquitto__config *config)$/;" f +log__internal src/logging.c /^void log__internal(const char *fmt, ...)$/;" f +log__printf lib/logging_mosq.c /^int log__printf(struct mosquitto *mosq, int priority, const char *fmt, ...)$/;" f +log__printf src/logging.c /^int log__printf(struct mosquitto *mosq, int priority, const char *fmt, ...)$/;" f +log__printf test/unit/persist_read_stubs.c /^int log__printf(struct mosquitto *mosq, int priority, const char *fmt, ...)$/;" f +log__printf test/unit/persist_write_stubs.c /^int log__printf(struct mosquitto *mosq, int priority, const char *fmt, ...)$/;" f +log__printf test/unit/stubs.c /^int log__printf(struct mosquitto *mosq, int priority, const char *fmt, ...)$/;" f +log__vprintf src/logging.c /^int log__vprintf(int priority, const char *fmt, va_list va)$/;" f +log_callback_mutex lib/mosquitto_internal.h /^ pthread_mutex_t log_callback_mutex;$/;" m struct:mosquitto +log_dest src/conf.c /^ int log_dest;$/;" m struct:config_recurse file: +log_dest src/mosquitto_broker_internal.h /^ int log_dest;$/;" m struct:mosquitto__config +log_dest_set src/conf.c /^ int log_dest_set;$/;" m struct:config_recurse file: +log_destinations src/logging.c /^static int log_destinations = MQTT3_LOG_STDERR;$/;" v file: +log_facility src/mosquitto_broker_internal.h /^ int log_facility;$/;" m struct:mosquitto__config +log_file src/mosquitto_broker_internal.h /^ char *log_file;$/;" m struct:mosquitto__config +log_fptr src/logging.c /^ FILE *log_fptr = NULL;$/;" l +log_fptr src/mosquitto_broker_internal.h /^ FILE *log_fptr;$/;" m struct:mosquitto__config +log_priorities src/logging.c /^static int log_priorities = MOSQ_LOG_ERR | MOSQ_LOG_WARNING | MOSQ_LOG_NOTICE | MOSQ_LOG_INFO;$/;" v file: +log_timestamp src/logging.c /^ bool log_timestamp = true;$/;" l +log_timestamp src/mosquitto_broker_internal.h /^ bool log_timestamp;$/;" m struct:mosquitto__config +log_timestamp_format src/logging.c /^ char *log_timestamp_format = NULL;$/;" l +log_timestamp_format src/mosquitto_broker_internal.h /^ char *log_timestamp_format;$/;" m struct:mosquitto__config +log_type src/conf.c /^ int log_type;$/;" m struct:config_recurse file: +log_type src/mosquitto_broker_internal.h /^ int log_type;$/;" m struct:mosquitto__config +log_type_set src/conf.c /^ int log_type_set;$/;" m struct:config_recurse file: +log_wrap src/websockets.c /^static void log_wrap(int level, const char *line)$/;" f file: +lookup src/net.c /^ X509_LOOKUP *lookup;$/;" l +loop lib/cpp/mosquittopp.cpp /^int mosquittopp::loop(int timeout, int max_packets)$/;" f class:mosqpp::mosquittopp +loop_delay client/pub_client.c /^ int loop_delay = 1000;$/;" l +loop_forever lib/cpp/mosquittopp.cpp /^int mosquittopp::loop_forever(int timeout, int max_packets)$/;" f class:mosqpp::mosquittopp +loop_handle_reads_writes src/loop.c /^static void loop_handle_reads_writes(struct mosquitto_db *db, mosq_sock_t sock, uint32_t events)$/;" f file: +loop_misc lib/cpp/mosquittopp.cpp /^int mosquittopp::loop_misc()$/;" f class:mosqpp::mosquittopp +loop_read lib/cpp/mosquittopp.cpp /^int mosquittopp::loop_read(int max_packets)$/;" f class:mosqpp::mosquittopp +loop_start lib/cpp/mosquittopp.cpp /^int mosquittopp::loop_start()$/;" f class:mosqpp::mosquittopp +loop_stop lib/cpp/mosquittopp.cpp /^int mosquittopp::loop_stop(bool force)$/;" f class:mosqpp::mosquittopp +loop_write lib/cpp/mosquittopp.cpp /^int mosquittopp::loop_write(int max_packets)$/;" f class:mosqpp::mosquittopp +lsb lib/packet_datatypes.c /^ uint8_t msb, lsb;$/;" l +lword lib/packet_datatypes.c /^ int32_t lword = 0;$/;" l +lws_pollargs src/mosquitto_broker_internal.h 43;" d +lws_pollfd src/mosquitto_broker_internal.h 41;" d +lws_service_fd src/mosquitto_broker_internal.h 42;" d +m lib/cpp/mosquittopp.cpp /^ class mosquittopp *m = (class mosquittopp *)userdata;$/;" l +m test/unit/persist_read_stubs.c /^ struct mosquitto *m;$/;" l +m_mosq lib/cpp/mosquittopp.h /^ struct mosquitto *m_mosq;$/;" v typeref:struct:mosquitto +magic src/db_dump/db_dump.c /^const unsigned char magic[15] = {0x00, 0xB5, 0x00, 'm','o','s','q','u','i','t','t','o',' ','d','b'};$/;" v +magic src/persist.h /^extern const unsigned char magic[15];$/;" x +magic src/persist_read.c /^const unsigned char magic[15] = {0x00, 0xB5, 0x00, 'm','o','s','q','u','i','t','t','o',' ','d','b'};$/;" v +main client/pub_client.c /^int main(int argc, char *argv[])$/;" f +main client/rr_client.c /^int main(int argc, char *argv[])$/;" f +main client/sub_client.c /^int main(int argc, char *argv[])$/;" f +main examples/mysql_log/mysql_log.c /^int main(int argc, char *argv[])$/;" f +main examples/subscribe_simple/callback.c /^int main(int argc, char *argv[])$/;" f +main examples/subscribe_simple/multiple.c /^int main(int argc, char *argv[])$/;" f +main examples/subscribe_simple/single.c /^int main(int argc, char *argv[])$/;" f +main examples/temperature_conversion/main.cpp /^int main(int argc, char *argv[])$/;" f +main src/db_dump/db_dump.c /^int main(int argc, char *argv[])$/;" f +main src/mosquitto.c /^int main(int argc, char *argv[])$/;" f +main src/mosquitto_passwd.c /^int main(int argc, char *argv[])$/;" f +main test/broker/c/08-tls-psk-bridge.c /^int main(int argc, char *argv[])$/;" f +main test/broker/c/08-tls-psk-pub.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/01-con-discon-success.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/01-keepalive-pingreq.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/01-no-clean-session.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/01-server-keepalive-pingreq.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/01-unpwd-set.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/01-will-set.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/01-will-unpwd-set.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/02-subscribe-qos0.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/02-subscribe-qos1.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/02-subscribe-qos2.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/02-unsubscribe-multiple-v5.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/02-unsubscribe-v5.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/02-unsubscribe.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/03-publish-b2c-qos1.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/03-publish-b2c-qos2-len.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/03-publish-b2c-qos2.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/03-publish-c2b-qos1-disconnect.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/03-publish-c2b-qos1-len.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/03-publish-c2b-qos1-receive-maximum.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/03-publish-c2b-qos2-disconnect.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/03-publish-c2b-qos2-len.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/03-publish-c2b-qos2-maximum-qos-0.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/03-publish-c2b-qos2-maximum-qos-1.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/03-publish-c2b-qos2-pubrec-error.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/03-publish-c2b-qos2-receive-maximum-1.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/03-publish-c2b-qos2-receive-maximum-2.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/03-publish-c2b-qos2.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/03-publish-qos0-no-payload.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/03-publish-qos0.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/03-request-response-1.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/03-request-response-2.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/03-request-response-correlation-1.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/04-retain-qos0.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/08-ssl-bad-cacert.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/08-ssl-connect-cert-auth-enc.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/08-ssl-connect-cert-auth.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/08-ssl-connect-no-auth.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/08-ssl-fake-cacert.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/09-util-topic-tokenise.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/11-prop-oversize-packet.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/11-prop-send-content-type.c /^int main(int argc, char *argv[])$/;" f +main test/lib/c/11-prop-send-payload-format.c /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/01-con-discon-success.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/01-keepalive-pingreq.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/01-no-clean-session.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/01-unpwd-set.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/01-will-set.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/01-will-unpwd-set.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/02-subscribe-qos0.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/02-subscribe-qos1.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/02-subscribe-qos2.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/02-unsubscribe.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/03-publish-b2c-qos1.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/03-publish-b2c-qos2.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/03-publish-c2b-qos2.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/03-publish-qos0-no-payload.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/03-publish-qos0.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/04-retain-qos0.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/08-ssl-bad-cacert.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/08-ssl-connect-cert-auth.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/08-ssl-connect-no-auth.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/08-ssl-fake-cacert.cpp /^int main(int argc, char *argv[])$/;" f +main test/lib/cpp/09-util-topic-tokenise.cpp /^int main(int argc, char *argv[])$/;" f +main test/old/msgsps_pub.c /^int main(int argc, char *argv[])$/;" f +main test/old/msgsps_sub.c /^int main(int argc, char *argv[])$/;" f +main test/random/random_client.py /^def main():$/;" f +main test/unit/persist_read_test.c /^int main(int argc, char *argv[])$/;" f +main test/unit/persist_write_test.c /^int main(int argc, char *argv[])$/;" f +main test/unit/test.c /^int main(int argc, char *argv[])$/;" f +major client/pub_client.c /^ int major, minor, revision;$/;" l +major client/rr_client.c /^ int major, minor, revision;$/;" l +major client/sub_client.c /^ int major, minor, revision;$/;" l +malloc_usable_size lib/memory_mosq.c 27;" d file: +mandir config.mk /^mandir?=${prefix}\/share\/man$/;" m +mapped_topic lib/send_publish.c /^ char *mapped_topic = NULL;$/;" l +match lib/send_publish.c /^ bool match;$/;" l +match src/handle_publish.c /^ bool match;$/;" l +match src/security.c /^ bool match = false;$/;" l +match test/lib/c/09-util-topic-tokenise.c /^ bool match;$/;" l +match test/unit/util_topic_test.c /^ bool match;$/;" l +match_helper test/unit/util_topic_test.c /^static void match_helper(const char *sub, const char *topic)$/;" f file: +max_connections src/mosquitto_broker_internal.h /^ int max_connections;$/;" m struct:mosquitto__listener +max_heap src/sys_tree.c /^ static unsigned long max_heap = -1;$/;" l file: +max_inflight client/client_shared.h /^ unsigned int max_inflight;$/;" m struct:mosq_config +max_inflight_bytes src/conf.c /^ unsigned long max_inflight_bytes;$/;" m struct:config_recurse file: +max_inflight_bytes src/database.c /^static unsigned long max_inflight_bytes = 0;$/;" v file: +max_inflight_messages src/mosquitto_broker_internal.h /^ uint16_t max_inflight_messages;$/;" m struct:mosquitto__config +max_inflight_messages_set lib/cpp/mosquittopp.cpp /^int mosquittopp::max_inflight_messages_set(unsigned int max_inflight_messages)$/;" f class:mosqpp::mosquittopp +max_keepalive src/mosquitto_broker_internal.h /^ uint16_t max_keepalive;$/;" m struct:mosquitto__config +max_memcount lib/memory_mosq.c /^static unsigned long max_memcount = 0;$/;" v file: +max_msg_count lib/helpers.c /^ int max_msg_count;$/;" m struct:userdata__simple file: +max_packet_size src/mosquitto_broker_internal.h /^ uint32_t max_packet_size;$/;" m struct:mosquitto__config +max_queued src/database.c /^static int max_queued = 100;$/;" v file: +max_queued_bytes src/conf.c /^ unsigned long max_queued_bytes;$/;" m struct:config_recurse file: +max_queued_bytes src/database.c /^static unsigned long max_queued_bytes = 0;$/;" v file: +max_queued_messages src/conf.c /^ int max_queued_messages;$/;" m struct:config_recurse file: +max_topic_alias src/mosquitto_broker_internal.h /^ uint16_t max_topic_alias;$/;" m struct:mosquitto__listener +maxfd lib/loop.c /^ int maxfd = 0;$/;" l +maximum_packet_size lib/mosquitto_internal.h /^ uint32_t maximum_packet_size;$/;" m struct:mosquitto +maximum_qos lib/mosquitto_internal.h /^ uint8_t maximum_qos;$/;" m struct:mosquitto +maximum_qos src/mosquitto_broker_internal.h /^ uint8_t maximum_qos;$/;" m struct:mosquitto__listener +mcs src/db_dump/db_dump.c /^ struct msg_store_chunk *mcs;$/;" l +mem lib/memory_mosq.c /^ void *mem = calloc(nmemb, size);$/;" l +mem lib/memory_mosq.c /^ void *mem = malloc(size);$/;" l +mem lib/memory_mosq.c /^ void *mem;$/;" l +mem_limit lib/memory_mosq.c /^static size_t mem_limit = 0;$/;" v file: +memcount lib/memory_mosq.c /^static unsigned long memcount = 0;$/;" v file: +memory__set_limit lib/memory_mosq.c /^void memory__set_limit(size_t lim)$/;" f +message client/client_shared.h /^ char *message; \/* pub, rr *\/$/;" m struct:mosq_config +message lib/actions.c /^ struct mosquitto_message_all *message;$/;" l +message lib/handle_publish.c /^ struct mosquitto_message_all *message;$/;" l +message lib/handle_pubrel.c /^ struct mosquitto_message_all *message = NULL;$/;" l +message lib/messages_mosq.c /^ struct mosquitto_message_all *message, *tmp;$/;" l +message lib/messages_mosq.c /^ struct mosquitto_message_all *message;$/;" l +message__cleanup lib/messages_mosq.c /^void message__cleanup(struct mosquitto_message_all **message)$/;" f +message__cleanup_all lib/messages_mosq.c /^void message__cleanup_all(struct mosquitto *mosq)$/;" f +message__delete lib/messages_mosq.c /^int message__delete(struct mosquitto *mosq, uint16_t mid, enum mosquitto_msg_direction dir, int qos)$/;" f +message__out_update lib/messages_mosq.c /^int message__out_update(struct mosquitto *mosq, uint16_t mid, enum mosquitto_msg_state state, int qos)$/;" f +message__queue lib/messages_mosq.c /^int message__queue(struct mosquitto *mosq, struct mosquitto_message_all *message, enum mosquitto_msg_direction dir)$/;" f +message__reconnect_reset lib/messages_mosq.c /^void message__reconnect_reset(struct mosquitto *mosq)$/;" f +message__release_to_inflight lib/messages_mosq.c /^int message__release_to_inflight(struct mosquitto *mosq, enum mosquitto_msg_direction dir)$/;" f +message__remove lib/messages_mosq.c /^int message__remove(struct mosquitto *mosq, uint16_t mid, enum mosquitto_msg_direction dir, struct mosquitto_message_all **message, int qos)$/;" f +message__retry_check lib/messages_mosq.c /^void message__retry_check(struct mosquitto *mosq)$/;" f +message_callback examples/mysql_log/mysql_log.c /^void message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message)$/;" f +message_count lib/helpers.c /^ int message_count;$/;" m struct:userdata__simple file: +message_count test/old/msgsps_pub.c /^static int message_count = 0;$/;" v file: +message_count test/old/msgsps_sub.c /^static int message_count = 0;$/;" v file: +message_expiry_interval src/handle_publish.c /^ uint32_t message_expiry_interval = 0;$/;" l +message_expiry_interval src/persist_read.c /^ uint32_t message_expiry_interval;$/;" l +message_expiry_interval64 src/persist_read.c /^ int64_t message_expiry_interval64;$/;" l +message_expiry_time src/mosquitto_broker_internal.h /^ time_t message_expiry_time;$/;" m struct:mosquitto_msg_store +message_retry_set lib/cpp/mosquittopp.cpp /^void mosquittopp::message_retry_set(unsigned int message_retry)$/;" f class:mosqpp::mosquittopp +message_size src/db_dump/db_dump.c /^ long message_size;$/;" m struct:client_chunk file: +message_size_limit src/mosquitto_broker_internal.h /^ uint32_t message_size_limit;$/;" m struct:mosquitto__config +messages lib/helpers.c /^ struct mosquitto_message *messages;$/;" m struct:userdata__simple typeref:struct:userdata__simple::mosquitto_message file: +messages src/db_dump/db_dump.c /^ int messages;$/;" m struct:client_chunk file: +mid lib/handle_pubackcomp.c /^ uint16_t mid;$/;" l +mid lib/handle_publish.c /^ uint16_t mid;$/;" l +mid lib/handle_pubrec.c /^ uint16_t mid;$/;" l +mid lib/handle_pubrel.c /^ uint16_t mid;$/;" l +mid lib/handle_suback.c /^ uint16_t mid;$/;" l +mid lib/handle_unsuback.c /^ uint16_t mid;$/;" l +mid lib/mosquitto.h /^ int mid;$/;" m struct:mosquitto_message +mid lib/mosquitto_internal.h /^ uint16_t mid;$/;" m struct:mosquitto__packet +mid lib/util_mosq.c /^ uint16_t mid;$/;" l +mid src/database.c /^ uint16_t mid;$/;" l +mid src/db_dump/db_dump.c /^ uint16_t mid;$/;" m struct:db_client_msg file: +mid src/db_dump/db_dump.c /^ uint16_t source_mid, mid;$/;" m struct:db_msg file: +mid src/handle_publish.c /^ uint16_t mid = 0;$/;" l +mid src/handle_subscribe.c /^ uint16_t mid;$/;" l +mid src/handle_unsubscribe.c /^ uint16_t mid;$/;" l +mid src/mosquitto_broker_internal.h /^ uint16_t mid;$/;" m struct:mosquitto_client_msg +mid src/mosquitto_broker_internal.h /^ uint16_t mid;$/;" m struct:mosquitto_msg_store +mid src/persist.h /^ uint16_t mid;$/;" m struct:PF_client_msg +mid src/subs.c /^ uint16_t mid;$/;" l +mid test/broker/01-connect-bad-packet.py /^mid = 2$/;" v +mid test/broker/01-connect-uname-password-denied-no-will.py /^mid = 1$/;" v +mid test/broker/02-shared-qos0-v5.py /^mid = 1$/;" v +mid test/broker/02-shared-qos0-v5.py /^mid = 2$/;" v +mid test/broker/02-subhier-crash.py /^mid = 1$/;" v +mid test/broker/02-subhier-crash.py /^mid = 2$/;" v +mid test/broker/02-subhier-crash.py /^mid = 3$/;" v +mid test/broker/02-subpub-qos0-retain-as-publish.py /^mid = 1$/;" v +mid test/broker/02-subpub-qos0-retain-as-publish.py /^mid = 530$/;" v +mid test/broker/02-subpub-qos0-retain-as-publish.py /^mid = 531$/;" v +mid test/broker/02-subpub-qos0-send-retain.py /^mid = 530$/;" v +mid test/broker/02-subpub-qos0-send-retain.py /^mid = 531$/;" v +mid test/broker/02-subpub-qos0-send-retain.py /^mid = 532$/;" v +mid test/broker/02-subpub-qos0-subscription-id.py /^mid = 1$/;" v +mid test/broker/02-subpub-qos0-subscription-id.py /^mid = 2$/;" v +mid test/broker/02-subpub-qos0-subscription-id.py /^mid = 3$/;" v +mid test/broker/02-subpub-qos0-subscription-id.py /^mid = 4$/;" v +mid test/broker/02-subpub-qos0-subscription-id.py /^mid = 5$/;" v +mid test/broker/02-subpub-qos0-subscription-id.py /^mid = 6$/;" v +mid test/broker/02-subpub-qos0-topic-alias.py /^mid = 1$/;" v +mid test/broker/02-subpub-qos0-v5.py /^mid = 53$/;" v +mid test/broker/02-subpub-qos0.py /^mid = 53$/;" v +mid test/broker/02-subpub-qos1-bad-pubcomp.py /^mid = 1$/;" v +mid test/broker/02-subpub-qos1-bad-pubrec.py /^mid = 1$/;" v +mid test/broker/02-subpub-qos1-message-expiry-retain.py /^mid = 1$/;" v +mid test/broker/02-subpub-qos1-message-expiry-retain.py /^mid = 2$/;" v +mid test/broker/02-subpub-qos1-message-expiry-retain.py /^mid=1$/;" v +mid test/broker/02-subpub-qos1-message-expiry-retain.py /^mid=2$/;" v +mid test/broker/02-subpub-qos1-message-expiry-will.py /^mid = 53$/;" v +mid test/broker/02-subpub-qos1-message-expiry.py /^mid = 53$/;" v +mid test/broker/02-subpub-qos1-message-expiry.py /^mid=1$/;" v +mid test/broker/02-subpub-qos1-message-expiry.py /^mid=2$/;" v +mid test/broker/02-subpub-qos1-nolocal.py /^mid = 1$/;" v +mid test/broker/02-subpub-qos1-nolocal.py /^mid = 300$/;" v +mid test/broker/02-subpub-qos1-nolocal.py /^mid = 301$/;" v +mid test/broker/02-subpub-qos1-nolocal.py /^mid = 530$/;" v +mid test/broker/02-subpub-qos1-nolocal.py /^mid = 531$/;" v +mid test/broker/02-subpub-qos1-v5.py /^mid = 1$/;" v +mid test/broker/02-subpub-qos1-v5.py /^mid = 300$/;" v +mid test/broker/02-subpub-qos1-v5.py /^mid = 530$/;" v +mid test/broker/02-subpub-qos1.py /^mid = 1$/;" v +mid test/broker/02-subpub-qos1.py /^mid = 300$/;" v +mid test/broker/02-subpub-qos1.py /^mid = 530$/;" v +mid test/broker/02-subpub-qos2-bad-puback-1.py /^mid = 1$/;" v +mid test/broker/02-subpub-qos2-bad-puback-2.py /^mid = 1$/;" v +mid test/broker/02-subpub-qos2-bad-pubcomp.py /^mid = 1$/;" v +mid test/broker/02-subpub-qos2-pubrec-error-helper.py /^mid = 1$/;" v +mid test/broker/02-subpub-qos2-pubrec-error-helper.py /^mid = 2$/;" v +mid test/broker/02-subpub-qos2-pubrec-error.py /^mid = 1$/;" v +mid test/broker/02-subpub-qos2-pubrec-error.py /^mid = 2$/;" v +mid test/broker/02-subpub-qos2-receive-maximum-1.py /^mid = 1$/;" v +mid test/broker/02-subpub-qos2-receive-maximum-1.py /^mid = 2$/;" v +mid test/broker/02-subpub-qos2-receive-maximum-1.py /^mid = 3$/;" v +mid test/broker/02-subpub-qos2-receive-maximum-2.py /^mid = 1$/;" v +mid test/broker/02-subpub-qos2-receive-maximum-2.py /^mid = 2$/;" v +mid test/broker/02-subpub-qos2-receive-maximum-2.py /^mid = 3$/;" v +mid test/broker/02-subpub-qos2-receive-maximum-helper.py /^mid = 1$/;" v +mid test/broker/02-subpub-qos2-receive-maximum-helper.py /^mid = 2$/;" v +mid test/broker/02-subpub-qos2-receive-maximum-helper.py /^mid = 3$/;" v +mid test/broker/02-subpub-qos2-v5.py /^mid = 1$/;" v +mid test/broker/02-subpub-qos2-v5.py /^mid = 301$/;" v +mid test/broker/02-subpub-qos2-v5.py /^mid = 530$/;" v +mid test/broker/02-subpub-qos2.py /^mid = 1$/;" v +mid test/broker/02-subpub-qos2.py /^mid = 301$/;" v +mid test/broker/02-subpub-qos2.py /^mid = 530$/;" v +mid test/broker/02-subscribe-invalid-utf8.py /^mid = 53$/;" v +mid test/broker/02-subscribe-persistence-flipflop.py /^mid=1$/;" v +mid test/broker/02-subscribe-qos0.py /^mid = 53$/;" v +mid test/broker/02-subscribe-qos1.py /^mid = 79$/;" v +mid test/broker/02-subscribe-qos2.py /^mid = 3$/;" v +mid test/broker/02-unsubscribe-invalid-no-topic.py /^mid = 3$/;" v +mid test/broker/02-unsubscribe-qos0.py /^mid = 53$/;" v +mid test/broker/02-unsubscribe-qos1.py /^mid = 79$/;" v +mid test/broker/02-unsubscribe-qos2-multiple-v5.py /^mid = 1$/;" v +mid test/broker/02-unsubscribe-qos2-multiple-v5.py /^mid = 3$/;" v +mid test/broker/02-unsubscribe-qos2-multiple.py /^mid = 3$/;" v +mid test/broker/02-unsubscribe-qos2-v5.py /^mid = 3$/;" v +mid test/broker/02-unsubscribe-qos2.py /^mid = 3$/;" v +mid test/broker/03-publish-b2c-disconnect-qos1-helper.py /^mid = 128$/;" v +mid test/broker/03-publish-b2c-disconnect-qos1.py /^mid = 1$/;" v +mid test/broker/03-publish-b2c-disconnect-qos1.py /^mid = 3265$/;" v +mid test/broker/03-publish-b2c-disconnect-qos1.py /^mid = 3266$/;" v +mid test/broker/03-publish-b2c-disconnect-qos2-helper.py /^mid = 312$/;" v +mid test/broker/03-publish-b2c-disconnect-qos2.py /^mid = 1$/;" v +mid test/broker/03-publish-b2c-disconnect-qos2.py /^mid = 3265$/;" v +mid test/broker/03-publish-b2c-disconnect-qos2.py /^mid = 3266$/;" v +mid test/broker/03-publish-b2c-qos1-len-helper.py /^mid = 1$/;" v +mid test/broker/03-publish-b2c-qos2-len-helper.py /^mid = 1$/;" v +mid test/broker/03-publish-b2c-timeout-qos1-helper.py /^mid = 128$/;" v +mid test/broker/03-publish-b2c-timeout-qos1.py /^mid = 1$/;" v +mid test/broker/03-publish-b2c-timeout-qos1.py /^mid = 3265$/;" v +mid test/broker/03-publish-b2c-timeout-qos2-helper.py /^mid = 312$/;" v +mid test/broker/03-publish-b2c-timeout-qos2.py /^mid = 1$/;" v +mid test/broker/03-publish-b2c-timeout-qos2.py /^mid = 3265$/;" v +mid test/broker/03-publish-c2b-disconnect-qos2.py /^mid = 1$/;" v +mid test/broker/03-publish-c2b-disconnect-qos2.py /^mid = 3265$/;" v +mid test/broker/03-publish-c2b-timeout-qos2.py /^mid = 1926$/;" v +mid test/broker/03-publish-dollar-v5.py /^mid = 1$/;" v +mid test/broker/03-publish-dollar.py /^mid = 19$/;" v +mid test/broker/03-publish-invalid-utf8.py /^mid = 53$/;" v +mid test/broker/03-publish-qos1-no-subscribers-v5.py /^mid = 1$/;" v +mid test/broker/03-publish-qos1-no-subscribers-v5.py /^mid = 2$/;" v +mid test/broker/03-publish-qos1-no-subscribers-v5.py /^mid = 3$/;" v +mid test/broker/03-publish-qos1-no-subscribers-v5.py /^mid = 4$/;" v +mid test/broker/03-publish-qos1-no-subscribers-v5.py /^mid = 5$/;" v +mid test/broker/03-publish-qos1-no-subscribers-v5.py /^mid = 6$/;" v +mid test/broker/03-publish-qos1-no-subscribers-v5.py /^mid = 7$/;" v +mid test/broker/03-publish-qos1-retain-disabled.py /^mid = 1$/;" v +mid test/broker/03-publish-qos1.py /^mid = 19$/;" v +mid test/broker/03-publish-qos2.py /^mid = 312$/;" v +mid test/broker/04-retain-qos0-fresh.py /^mid = 16$/;" v +mid test/broker/04-retain-qos0-repeated.py /^mid = 16$/;" v +mid test/broker/04-retain-qos0.py /^mid = 16$/;" v +mid test/broker/04-retain-qos1-qos0.py /^mid = 18$/;" v +mid test/broker/04-retain-qos1-qos0.py /^mid = 6$/;" v +mid test/broker/04-retain-upgrade-outgoing-qos.py /^mid = 16$/;" v +mid test/broker/05-clean-session-qos1-helper.py /^mid = 128$/;" v +mid test/broker/05-clean-session-qos1.py /^mid = 1$/;" v +mid test/broker/05-clean-session-qos1.py /^mid = 109$/;" v +mid test/broker/06-bridge-b2br-disconnect-qos1.py /^mid = 1$/;" v +mid test/broker/06-bridge-b2br-disconnect-qos1.py /^mid = 2$/;" v +mid test/broker/06-bridge-b2br-disconnect-qos1.py /^mid = 20$/;" v +mid test/broker/06-bridge-b2br-disconnect-qos1.py /^mid = 3$/;" v +mid test/broker/06-bridge-b2br-disconnect-qos2.py /^mid = 1$/;" v +mid test/broker/06-bridge-b2br-disconnect-qos2.py /^mid = 2$/;" v +mid test/broker/06-bridge-b2br-disconnect-qos2.py /^mid = 3$/;" v +mid test/broker/06-bridge-b2br-disconnect-qos2.py /^mid = 5$/;" v +mid test/broker/06-bridge-b2br-late-connection-retain.py /^mid = 1$/;" v +mid test/broker/06-bridge-b2br-late-connection.py /^mid = 1$/;" v +mid test/broker/06-bridge-br2b-disconnect-qos1-helper.py /^mid = 128$/;" v +mid test/broker/06-bridge-br2b-disconnect-qos1.py /^mid = 1$/;" v +mid test/broker/06-bridge-br2b-disconnect-qos1.py /^mid = 2$/;" v +mid test/broker/06-bridge-br2b-disconnect-qos1.py /^mid = 3$/;" v +mid test/broker/06-bridge-br2b-disconnect-qos2-helper.py /^mid = 312$/;" v +mid test/broker/06-bridge-br2b-disconnect-qos2.py /^mid = 1$/;" v +mid test/broker/06-bridge-br2b-disconnect-qos2.py /^mid = 2$/;" v +mid test/broker/06-bridge-br2b-disconnect-qos2.py /^mid = 3$/;" v +mid test/broker/06-bridge-br2b-disconnect-qos2.py /^mid = 4$/;" v +mid test/broker/06-bridge-fail-persist-resend-qos1.py /^mid = 180$/;" v +mid test/broker/06-bridge-fail-persist-resend-qos2.py /^mid = 180$/;" v +mid test/broker/06-bridge-reconnect-local-out.py /^mid = 180$/;" v +mid test/broker/07-will-invalid-utf8.py /^mid = 53$/;" v +mid test/broker/07-will-null.py /^mid = 53$/;" v +mid test/broker/08-ssl-bridge.py /^mid = 1$/;" v +mid test/broker/08-tls-psk-bridge.py /^mid = 1$/;" v +mid test/broker/08-tls-psk-pub.py /^mid = 1$/;" v +mid test/broker/09-acl-change.py /^mid = 1$/;" v +mid test/broker/09-acl-change.py /^mid = 2$/;" v +mid test/broker/09-acl-change.py /^mid = 3$/;" v +mid test/broker/09-plugin-auth-acl-pub.py /^mid = 1$/;" v +mid test/broker/09-plugin-auth-acl-pub.py /^mid = 2$/;" v +mid test/broker/09-plugin-auth-acl-sub-denied.py /^mid = 53$/;" v +mid test/broker/09-plugin-auth-acl-sub.py /^mid = 53$/;" v +mid test/broker/09-plugin-auth-context-params.py /^mid = 1$/;" v +mid test/broker/09-plugin-auth-context-params.py /^mid = 2$/;" v +mid test/broker/09-plugin-auth-context-params.py /^mid = 3$/;" v +mid test/broker/09-plugin-auth-msg-params.py /^mid = 1$/;" v +mid test/broker/09-plugin-auth-msg-params.py /^mid = 2$/;" v +mid test/broker/09-plugin-auth-msg-params.py /^mid = 3$/;" v +mid test/broker/10-listener-mount-point.py /^mid = 1$/;" v +mid test/broker/11-message-expiry.py /^mid = 53$/;" v +mid test/broker/11-message-expiry.py /^mid=1$/;" v +mid test/broker/11-message-expiry.py /^mid=2$/;" v +mid test/broker/11-message-expiry.py /^mid=3$/;" v +mid test/broker/11-persistent-subscription-no-local.py /^mid = 1$/;" v +mid test/broker/11-persistent-subscription-no-local.py /^mid = 2$/;" v +mid test/broker/11-persistent-subscription-v5.py /^mid = 1$/;" v +mid test/broker/11-persistent-subscription-v5.py /^mid = 300$/;" v +mid test/broker/11-persistent-subscription-v5.py /^mid = 530$/;" v +mid test/broker/11-persistent-subscription.py /^mid = 1$/;" v +mid test/broker/11-persistent-subscription.py /^mid = 300$/;" v +mid test/broker/11-persistent-subscription.py /^mid = 530$/;" v +mid test/broker/11-pub-props.py /^mid = 1$/;" v +mid test/broker/11-subscription-id.py /^mid = 1$/;" v +mid test/broker/12-prop-maximum-packet-size-publish-qos1.py /^mid = 1$/;" v +mid test/broker/12-prop-maximum-packet-size-publish-qos1.py /^mid=1$/;" v +mid test/broker/12-prop-maximum-packet-size-publish-qos1.py /^mid=2$/;" v +mid test/broker/12-prop-maximum-packet-size-publish-qos2.py /^mid = 1$/;" v +mid test/broker/12-prop-maximum-packet-size-publish-qos2.py /^mid=1$/;" v +mid test/broker/12-prop-maximum-packet-size-publish-qos2.py /^mid=2$/;" v +mid test/broker/12-prop-maximum-packet-size-publish.py /^mid = 1$/;" v +mid test/lib/02-subscribe-qos0.py /^mid = 1$/;" v +mid test/lib/02-subscribe-qos1.py /^mid = 1$/;" v +mid test/lib/02-subscribe-qos2.py /^mid = 1$/;" v +mid test/lib/02-unsubscribe-multiple-v5.py /^mid = 1$/;" v +mid test/lib/02-unsubscribe-multiple-v5.py /^mid = 2$/;" v +mid test/lib/02-unsubscribe-v5.py /^mid = 1$/;" v +mid test/lib/02-unsubscribe.py /^mid = 1$/;" v +mid test/lib/03-publish-b2c-qos1.py /^mid = 123$/;" v +mid test/lib/03-publish-b2c-qos2-len.py /^mid = 56$/;" v +mid test/lib/03-publish-b2c-qos2.py /^mid = 13423$/;" v +mid test/lib/03-publish-c2b-qos1-disconnect.py /^mid = 1$/;" v +mid test/lib/03-publish-c2b-qos1-receive-maximum.py /^mid = 1$/;" v +mid test/lib/03-publish-c2b-qos1-receive-maximum.py /^mid = 2$/;" v +mid test/lib/03-publish-c2b-qos1-receive-maximum.py /^mid = 3$/;" v +mid test/lib/03-publish-c2b-qos1-receive-maximum.py /^mid = 4$/;" v +mid test/lib/03-publish-c2b-qos1-receive-maximum.py /^mid = 5$/;" v +mid test/lib/03-publish-c2b-qos1-receive-maximum.py /^mid = 6$/;" v +mid test/lib/03-publish-c2b-qos1-timeout.py /^mid = 1$/;" v +mid test/lib/03-publish-c2b-qos2-disconnect.py /^mid = 1$/;" v +mid test/lib/03-publish-c2b-qos2-maximum-qos-1.py /^mid = 1$/;" v +mid test/lib/03-publish-c2b-qos2-pubrec-error.py /^mid = 1$/;" v +mid test/lib/03-publish-c2b-qos2-pubrec-error.py /^mid = 2$/;" v +mid test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^mid = 1$/;" v +mid test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^mid = 2$/;" v +mid test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^mid = 3$/;" v +mid test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^mid = 4$/;" v +mid test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^mid = 5$/;" v +mid test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^mid = 1$/;" v +mid test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^mid = 2$/;" v +mid test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^mid = 3$/;" v +mid test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^mid = 4$/;" v +mid test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^mid = 5$/;" v +mid test/lib/03-publish-c2b-qos2-timeout.py /^mid = 1$/;" v +mid test/lib/03-publish-c2b-qos2.py /^mid = 1$/;" v +mid test/lib/03-request-response-correlation.py /^mid = 1$/;" v +mid test/lib/03-request-response.py /^mid = 1$/;" v +mid test/lib/04-retain-qos0.py /^mid = 16$/;" v +mid test/old/msgsps_sub.c /^ int mid = 0;$/;" l +mid_fail test/broker/09-plugin-auth-acl-sub.py /^mid_fail = 54$/;" v +mid_mutex lib/mosquitto_internal.h /^ pthread_mutex_t mid_mutex;$/;" m struct:mosquitto +mid_pub test/broker/09-plugin-auth-acl-sub-denied.py /^mid_pub = 54$/;" v +mid_sent client/pub_shared.c /^int mid_sent = -1;$/;" v +mid_sent client/pub_shared.h /^extern int mid_sent;$/;" x +mid_sub test/broker/04-retain-qos0-clear.py /^mid_sub = 592$/;" v +mid_unknown test/broker/06-bridge-fail-persist-resend-qos1.py /^mid_unknown = 2000$/;" v +mid_unknown test/broker/06-bridge-fail-persist-resend-qos2.py /^mid_unknown = 2000$/;" v +mid_unsub test/broker/04-retain-qos0-clear.py /^mid_unsub = 593$/;" v +minor client/pub_client.c /^ int major, minor, revision;$/;" l +minor client/rr_client.c /^ int major, minor, revision;$/;" l +minor client/sub_client.c /^ int major, minor, revision;$/;" l +missing_read_helper test/unit/property_user_read.c /^static void missing_read_helper(mosquitto_property *proplist)$/;" f file: +mode client/pub_client.c /^ int mode;$/;" l +mosq client/pub_client.c /^ struct mosquitto *mosq = NULL;$/;" l +mosq client/rr_client.c /^struct mosquitto *mosq = NULL;$/;" v typeref:struct:mosquitto +mosq client/sub_client.c /^struct mosquitto *mosq = NULL;$/;" v typeref:struct:mosquitto +mosq examples/mysql_log/mysql_log.c /^ struct mosquitto *mosq;$/;" l +mosq lib/helpers.c /^ struct mosquitto *mosq;$/;" l +mosq lib/mosquitto.c /^ struct mosquitto *mosq = NULL;$/;" l +mosq lib/net_mosq.c /^ struct mosquitto *mosq;$/;" l +mosq lib/net_mosq_ocsp.c /^ struct mosquitto *mosq = (struct mosquitto *)arg;$/;" l +mosq lib/srv_mosq.c /^ struct mosquitto *mosq = arg;$/;" l +mosq lib/thread_mosq.c /^ struct mosquitto *mosq = obj;$/;" l +mosq lib/tls_mosq.c /^ struct mosquitto *mosq;$/;" l +mosq misc/currentcost/cc128_read.py /^mosq = mosquitto.Mosquitto()$/;" v +mosq src/mosquitto_broker_internal.h /^ struct mosquitto *mosq;$/;" m struct:libws_mqtt_data typeref:struct:libws_mqtt_data::mosquitto +mosq src/websockets.c /^ easy_address(libwebsocket_get_socket_fd(wsi), mosq);$/;" l +mosq src/websockets.c /^ struct mosquitto *mosq = NULL;$/;" l +mosq src/websockets.c /^ struct mosquitto *mosq;$/;" l +mosq test/broker/c/08-tls-psk-bridge.c /^ struct mosquitto *mosq;$/;" l +mosq test/broker/c/08-tls-psk-pub.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/01-con-discon-success.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/01-keepalive-pingreq.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/01-no-clean-session.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/01-server-keepalive-pingreq.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/01-unpwd-set.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/01-will-set.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/01-will-unpwd-set.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/02-subscribe-qos0.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/02-subscribe-qos1.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/02-subscribe-qos2.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/02-unsubscribe-multiple-v5.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/02-unsubscribe-v5.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/02-unsubscribe.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/03-publish-b2c-qos1.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/03-publish-b2c-qos2-len.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/03-publish-b2c-qos2.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/03-publish-c2b-qos1-disconnect.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/03-publish-c2b-qos1-len.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/03-publish-c2b-qos1-receive-maximum.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/03-publish-c2b-qos2-disconnect.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/03-publish-c2b-qos2-len.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/03-publish-c2b-qos2-maximum-qos-0.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/03-publish-c2b-qos2-maximum-qos-1.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/03-publish-c2b-qos2-pubrec-error.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/03-publish-c2b-qos2-receive-maximum-1.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/03-publish-c2b-qos2-receive-maximum-2.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/03-publish-c2b-qos2.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/03-publish-qos0-no-payload.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/03-publish-qos0.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/03-request-response-1.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/03-request-response-2.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/03-request-response-correlation-1.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/04-retain-qos0.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/08-ssl-bad-cacert.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/08-ssl-connect-cert-auth-enc.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/08-ssl-connect-cert-auth.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/08-ssl-connect-no-auth.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/08-ssl-fake-cacert.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/11-prop-oversize-packet.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/11-prop-send-content-type.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/c/11-prop-send-payload-format.c /^ struct mosquitto *mosq;$/;" l +mosq test/lib/cpp/01-con-discon-success.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/01-keepalive-pingreq.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/01-no-clean-session.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/01-unpwd-set.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/01-will-set.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/01-will-unpwd-set.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/02-subscribe-qos0.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/02-subscribe-qos1.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/02-subscribe-qos2.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/02-unsubscribe.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/03-publish-b2c-qos1.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/03-publish-b2c-qos2.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/03-publish-c2b-qos2.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/03-publish-qos0-no-payload.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/03-publish-qos0.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/04-retain-qos0.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/08-ssl-bad-cacert.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/08-ssl-connect-cert-auth.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/08-ssl-connect-no-auth.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/lib/cpp/08-ssl-fake-cacert.cpp /^ struct mosquittopp_test *mosq;$/;" l +mosq test/old/msgsps_pub.c /^ struct mosquitto *mosq;$/;" l +mosq test/old/msgsps_sub.c /^ struct mosquitto *mosq;$/;" l +mosq test/unit/publish_test.c /^ struct mosquitto mosq;$/;" l +mosq_config client/client_shared.h /^struct mosq_config {$/;" s +mosq_cs_authenticating lib/mosquitto_internal.h /^ mosq_cs_authenticating = 20, \/* Client has sent CONNECT but is still undergoing extended authentication *\/$/;" e enum:mosquitto_client_state +mosq_cs_connect_async lib/mosquitto_internal.h /^ mosq_cs_connect_async = 3,$/;" e enum:mosquitto_client_state +mosq_cs_connect_pending lib/mosquitto_internal.h /^ mosq_cs_connect_pending = 4,$/;" e enum:mosquitto_client_state +mosq_cs_connect_srv lib/mosquitto_internal.h /^ mosq_cs_connect_srv = 5,$/;" e enum:mosquitto_client_state +mosq_cs_connected lib/mosquitto_internal.h /^ mosq_cs_connected = 1,$/;" e enum:mosquitto_client_state +mosq_cs_connecting lib/mosquitto_internal.h /^ mosq_cs_connecting = 16,$/;" e enum:mosquitto_client_state +mosq_cs_disconnect_with_will lib/mosquitto_internal.h /^ mosq_cs_disconnect_with_will = 18,$/;" e enum:mosquitto_client_state +mosq_cs_disconnect_ws lib/mosquitto_internal.h /^ mosq_cs_disconnect_ws = 6,$/;" e enum:mosquitto_client_state +mosq_cs_disconnected lib/mosquitto_internal.h /^ mosq_cs_disconnected = 7,$/;" e enum:mosquitto_client_state +mosq_cs_disconnecting lib/mosquitto_internal.h /^ mosq_cs_disconnecting = 2,$/;" e enum:mosquitto_client_state +mosq_cs_disused lib/mosquitto_internal.h /^ mosq_cs_disused = 19, \/* client that has been added to the disused list to be freed *\/$/;" e enum:mosquitto_client_state +mosq_cs_duplicate lib/mosquitto_internal.h /^ mosq_cs_duplicate = 17, \/* client that has been taken over by another with the same id *\/$/;" e enum:mosquitto_client_state +mosq_cs_expiring lib/mosquitto_internal.h /^ mosq_cs_expiring = 15,$/;" e enum:mosquitto_client_state +mosq_cs_new lib/mosquitto_internal.h /^ mosq_cs_new = 0,$/;" e enum:mosquitto_client_state +mosq_cs_reauthenticating lib/mosquitto_internal.h /^ mosq_cs_reauthenticating = 21, \/* Client is undergoing reauthentication and shouldn't do anything else until complete *\/$/;" e enum:mosquitto_client_state +mosq_cs_socks5_auth_ok lib/mosquitto_internal.h /^ mosq_cs_socks5_auth_ok = 12,$/;" e enum:mosquitto_client_state +mosq_cs_socks5_new lib/mosquitto_internal.h /^ mosq_cs_socks5_new = 8,$/;" e enum:mosquitto_client_state +mosq_cs_socks5_reply lib/mosquitto_internal.h /^ mosq_cs_socks5_reply = 11,$/;" e enum:mosquitto_client_state +mosq_cs_socks5_request lib/mosquitto_internal.h /^ mosq_cs_socks5_request = 10,$/;" e enum:mosquitto_client_state +mosq_cs_socks5_send_userpass lib/mosquitto_internal.h /^ mosq_cs_socks5_send_userpass = 14,$/;" e enum:mosquitto_client_state +mosq_cs_socks5_start lib/mosquitto_internal.h /^ mosq_cs_socks5_start = 9,$/;" e enum:mosquitto_client_state +mosq_cs_socks5_userpass_reply lib/mosquitto_internal.h /^ mosq_cs_socks5_userpass_reply = 13,$/;" e enum:mosquitto_client_state +mosq_err_t lib/mosquitto.h /^enum mosq_err_t {$/;" g +mosq_err_t test/broker/c/auth_plugin_v2.c /^enum mosq_err_t {$/;" g file: +mosq_k_engine lib/mosquitto_internal.h /^ mosq_k_engine = 1,$/;" e enum:mosquitto__keyform +mosq_k_pem lib/mosquitto_internal.h /^ mosq_k_pem = 0,$/;" e enum:mosquitto__keyform +mosq_md_in lib/mosquitto_internal.h /^ mosq_md_in = 0,$/;" e enum:mosquitto_msg_direction +mosq_md_out lib/mosquitto_internal.h /^ mosq_md_out = 1$/;" e enum:mosquitto_msg_direction +mosq_mo_broker src/mosquitto_broker_internal.h /^ mosq_mo_broker = 1$/;" e enum:mosquitto_msg_origin +mosq_mo_client src/mosquitto_broker_internal.h /^ mosq_mo_client = 0,$/;" e enum:mosquitto_msg_origin +mosq_ms_invalid lib/mosquitto_internal.h /^ mosq_ms_invalid = 0,$/;" e enum:mosquitto_msg_state +mosq_ms_publish_qos0 lib/mosquitto_internal.h /^ mosq_ms_publish_qos0 = 1,$/;" e enum:mosquitto_msg_state +mosq_ms_publish_qos1 lib/mosquitto_internal.h /^ mosq_ms_publish_qos1 = 2,$/;" e enum:mosquitto_msg_state +mosq_ms_publish_qos2 lib/mosquitto_internal.h /^ mosq_ms_publish_qos2 = 4,$/;" e enum:mosquitto_msg_state +mosq_ms_queued lib/mosquitto_internal.h /^ mosq_ms_queued = 11$/;" e enum:mosquitto_msg_state +mosq_ms_resend_pubcomp lib/mosquitto_internal.h /^ mosq_ms_resend_pubcomp = 8,$/;" e enum:mosquitto_msg_state +mosq_ms_resend_pubrel lib/mosquitto_internal.h /^ mosq_ms_resend_pubrel = 6,$/;" e enum:mosquitto_msg_state +mosq_ms_send_pubrec lib/mosquitto_internal.h /^ mosq_ms_send_pubrec = 10,$/;" e enum:mosquitto_msg_state +mosq_ms_wait_for_puback lib/mosquitto_internal.h /^ mosq_ms_wait_for_puback = 3,$/;" e enum:mosquitto_msg_state +mosq_ms_wait_for_pubcomp lib/mosquitto_internal.h /^ mosq_ms_wait_for_pubcomp = 9,$/;" e enum:mosquitto_msg_state +mosq_ms_wait_for_pubrec lib/mosquitto_internal.h /^ mosq_ms_wait_for_pubrec = 5,$/;" e enum:mosquitto_msg_state +mosq_ms_wait_for_pubrel lib/mosquitto_internal.h /^ mosq_ms_wait_for_pubrel = 7,$/;" e enum:mosquitto_msg_state +mosq_opt_t lib/mosquitto.h /^enum mosq_opt_t {$/;" g +mosq_p_invalid lib/mosquitto_internal.h /^ mosq_p_invalid = 0,$/;" e enum:mosquitto__protocol +mosq_p_mqtt31 lib/mosquitto_internal.h /^ mosq_p_mqtt31 = 1,$/;" e enum:mosquitto__protocol +mosq_p_mqtt311 lib/mosquitto_internal.h /^ mosq_p_mqtt311 = 2,$/;" e enum:mosquitto__protocol +mosq_p_mqtt5 lib/mosquitto_internal.h /^ mosq_p_mqtt5 = 5,$/;" e enum:mosquitto__protocol +mosq_p_mqtts lib/mosquitto_internal.h /^ mosq_p_mqtts = 3,$/;" e enum:mosquitto__protocol +mosq_sock_t lib/mosquitto_internal.h /^typedef SOCKET mosq_sock_t;$/;" t +mosq_sock_t lib/mosquitto_internal.h /^typedef int mosq_sock_t;$/;" t +mosq_t_invalid lib/mosquitto_internal.h /^ mosq_t_invalid = 0,$/;" e enum:mosquitto__transport +mosq_t_sctp lib/mosquitto_internal.h /^ mosq_t_sctp = 3$/;" e enum:mosquitto__transport +mosq_t_tcp lib/mosquitto_internal.h /^ mosq_t_tcp = 1,$/;" e enum:mosquitto__transport +mosq_t_ws lib/mosquitto_internal.h /^ mosq_t_ws = 2,$/;" e enum:mosquitto__transport +mosq_ts_external lib/mosquitto_internal.h /^ mosq_ts_external \/* Threads started by external code *\/$/;" e enum:mosquitto__threaded_state +mosq_ts_none lib/mosquitto_internal.h /^ mosq_ts_none, \/* No threads in use *\/$/;" e enum:mosquitto__threaded_state +mosq_ts_self lib/mosquitto_internal.h /^ mosq_ts_self, \/* Threads started by libmosquitto *\/$/;" e enum:mosquitto__threaded_state +mosq_websockets_init src/websockets.c /^struct libwebsocket_context *mosq_websockets_init(struct mosquitto__listener *listener, const struct mosquitto__config *conf)$/;" f +mosq_ws_protocols src/websockets.c /^enum mosq_ws_protocols {$/;" g file: +mosqpp lib/cpp/mosquittopp.cpp /^namespace mosqpp {$/;" n file: +mosqpp_EXPORT lib/cpp/mosquittopp.h 22;" d +mosqpp_EXPORT lib/cpp/mosquittopp.h 24;" d +mosqpp_EXPORT lib/cpp/mosquittopp.h 27;" d +mosquitto lib/mosquitto.h /^struct mosquitto;$/;" x +mosquitto lib/mosquitto_internal.h /^struct mosquitto {$/;" s +mosquitto src/mosquitto_broker.h /^struct mosquitto;$/;" x +mosquitto src/mosquitto_plugin.h /^struct mosquitto;$/;" x +mosquitto__acl src/mosquitto_broker_internal.h /^struct mosquitto__acl{$/;" s +mosquitto__acl_user src/mosquitto_broker_internal.h /^struct mosquitto__acl_user{$/;" s +mosquitto__alias lib/mosquitto_internal.h /^struct mosquitto__alias{$/;" s +mosquitto__auth_plugin src/mosquitto_broker_internal.h /^struct mosquitto__auth_plugin{$/;" s +mosquitto__auth_plugin_config src/mosquitto_broker_internal.h /^struct mosquitto__auth_plugin_config$/;" s +mosquitto__bridge src/mosquitto_broker_internal.h /^struct mosquitto__bridge{$/;" s +mosquitto__bridge_direction src/mosquitto_broker_internal.h /^enum mosquitto__bridge_direction{$/;" g +mosquitto__bridge_topic src/mosquitto_broker_internal.h /^struct mosquitto__bridge_topic{$/;" s +mosquitto__calloc lib/memory_mosq.c /^void *mosquitto__calloc(size_t nmemb, size_t size)$/;" f +mosquitto__check_keepalive lib/util_mosq.c /^int mosquitto__check_keepalive(struct mosquitto_db *db, struct mosquitto *mosq)$/;" f +mosquitto__cmp_hostname_wildcard lib/tls_mosq.c /^int mosquitto__cmp_hostname_wildcard(char *certname, const char *hostname)$/;" f +mosquitto__config src/mosquitto_broker_internal.h /^struct mosquitto__config {$/;" s +mosquitto__connect_init lib/connect.c /^static int mosquitto__connect_init(struct mosquitto *mosq, const char *host, int port, int keepalive, const char *bind_address)$/;" f file: +mosquitto__daemonise src/mosquitto.c /^void mosquitto__daemonise(void)$/;" f +mosquitto__destroy lib/mosquitto.c /^void mosquitto__destroy(struct mosquitto *mosq)$/;" f +mosquitto__fopen lib/util_mosq.c /^FILE *mosquitto__fopen(const char *path, const char *mode, bool restrict_read)$/;" f +mosquitto__free lib/memory_mosq.c /^void mosquitto__free(void *mem)$/;" f +mosquitto__free src/db_dump/db_dump.c 33;" d file: +mosquitto__get_db src/mosquitto.c /^struct mosquitto_db *mosquitto__get_db(void)$/;" f +mosquitto__hex2bin lib/util_mosq.c /^int mosquitto__hex2bin(const char *hex, unsigned char *bin, int bin_max_len)$/;" f +mosquitto__hex2bin_sha1 lib/util_mosq.c /^int mosquitto__hex2bin_sha1(const char *hex, unsigned char **bin)$/;" f +mosquitto__keyform lib/mosquitto_internal.h /^enum mosquitto__keyform {$/;" g +mosquitto__listener src/mosquitto_broker_internal.h /^struct mosquitto__listener {$/;" s +mosquitto__loop_rc_handle lib/loop.c /^static int mosquitto__loop_rc_handle(struct mosquitto *mosq, int rc)$/;" f file: +mosquitto__malloc lib/memory_mosq.c /^void *mosquitto__malloc(size_t size)$/;" f +mosquitto__malloc src/db_dump/db_dump.c 32;" d file: +mosquitto__max_memory_used lib/memory_mosq.c /^unsigned long mosquitto__max_memory_used(void)$/;" f +mosquitto__memcmp_const src/security_default.c /^static int mosquitto__memcmp_const(const void *a, const void *b, size_t len)$/;" f file: +mosquitto__memory_used lib/memory_mosq.c /^unsigned long mosquitto__memory_used(void)$/;" f +mosquitto__mid_generate lib/util_mosq.c /^uint16_t mosquitto__mid_generate(struct mosquitto *mosq)$/;" f +mosquitto__packet lib/mosquitto_internal.h /^struct mosquitto__packet{$/;" s +mosquitto__parse_socks_url client/client_shared.c /^static int mosquitto__parse_socks_url(struct mosq_config *cfg, char *url)$/;" f file: +mosquitto__payload_uhpa src/mosquitto_broker_internal.h /^} mosquitto__payload_uhpa;$/;" t typeref:union:__anon1 +mosquitto__protocol lib/mosquitto_internal.h /^enum mosquitto__protocol {$/;" g +mosquitto__realloc lib/memory_mosq.c /^void *mosquitto__realloc(void *ptr, size_t size)$/;" f +mosquitto__reconnect lib/connect.c /^static int mosquitto__reconnect(struct mosquitto *mosq, bool blocking, const mosquitto_property *properties)$/;" f file: +mosquitto__security_options src/mosquitto_broker_internal.h /^struct mosquitto__security_options {$/;" s +mosquitto__server_certificate_verify lib/tls_mosq.c /^int mosquitto__server_certificate_verify(int preverify_ok, X509_STORE_CTX *ctx)$/;" f +mosquitto__strdup lib/memory_mosq.c /^char *mosquitto__strdup(const char *s)$/;" f +mosquitto__subhier src/mosquitto_broker_internal.h /^struct mosquitto__subhier {$/;" s +mosquitto__subleaf src/mosquitto_broker_internal.h /^struct mosquitto__subleaf {$/;" s +mosquitto__subshared src/mosquitto_broker_internal.h /^struct mosquitto__subshared {$/;" s +mosquitto__subshared_ref src/mosquitto_broker_internal.h /^struct mosquitto__subshared_ref {$/;" s +mosquitto__thread_main lib/thread_mosq.c /^void *mosquitto__thread_main(void *obj)$/;" f +mosquitto__threaded_state lib/mosquitto_internal.h /^enum mosquitto__threaded_state {$/;" g +mosquitto__tls_server_ctx src/net.c /^static int mosquitto__tls_server_ctx(struct mosquitto__listener *listener)$/;" f file: +mosquitto__transport lib/mosquitto_internal.h /^enum mosquitto__transport {$/;" g +mosquitto__unpwd src/mosquitto_broker_internal.h /^struct mosquitto__unpwd{$/;" s +mosquitto__urldecode client/client_shared.c /^static int mosquitto__urldecode(char *str)$/;" f file: +mosquitto__verify_certificate_hostname lib/tls_mosq.c /^int mosquitto__verify_certificate_hostname(X509 *cert, const char *hostname)$/;" f +mosquitto__verify_ocsp_status_cb lib/net_mosq_ocsp.c /^int mosquitto__verify_ocsp_status_cb(SSL * ssl, void *arg)$/;" f +mosquitto_acl_check src/security.c /^int mosquitto_acl_check(struct mosquitto_db *db, struct mosquitto *context, const char *topic, long payloadlen, void* payload, int qos, bool retain, int access)$/;" f +mosquitto_acl_check test/unit/persist_write_stubs.c /^int mosquitto_acl_check(struct mosquitto_db *db, struct mosquitto *context, const char *topic, long payloadlen, void* payload, int qos, bool retain, int access)$/;" f +mosquitto_acl_check_default src/security_default.c /^int mosquitto_acl_check_default(struct mosquitto_db *db, struct mosquitto *context, const char *topic, int access)$/;" f +mosquitto_acl_msg src/mosquitto_plugin.h /^struct mosquitto_acl_msg {$/;" s +mosquitto_auth_acl_check src/plugin_defer.c /^int mosquitto_auth_acl_check(void *user_data, int access, const struct mosquitto *client, struct mosquitto_acl_msg *msg)$/;" f +mosquitto_auth_acl_check test/broker/c/auth_plugin.c /^int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg)$/;" f +mosquitto_auth_acl_check test/broker/c/auth_plugin_acl.c /^int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg)$/;" f +mosquitto_auth_acl_check test/broker/c/auth_plugin_acl_sub_denied.c /^int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg)$/;" f +mosquitto_auth_acl_check test/broker/c/auth_plugin_context_params.c /^int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg)$/;" f +mosquitto_auth_acl_check test/broker/c/auth_plugin_extended_multiple.c /^int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg)$/;" f +mosquitto_auth_acl_check test/broker/c/auth_plugin_extended_single.c /^int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg)$/;" f +mosquitto_auth_acl_check test/broker/c/auth_plugin_extended_single2.c /^int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg)$/;" f +mosquitto_auth_acl_check test/broker/c/auth_plugin_msg_params.c /^int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg)$/;" f +mosquitto_auth_acl_check test/broker/c/auth_plugin_pwd.c /^int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg)$/;" f +mosquitto_auth_acl_check test/broker/c/auth_plugin_v2.c /^int mosquitto_auth_acl_check(void *user_data, const char *clientid, const char *username, const char *topic, int access)$/;" f +mosquitto_auth_acl_check test/random/auth_plugin.c /^int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg)$/;" f +mosquitto_auth_continue test/broker/c/auth_plugin_extended_multiple.c /^int mosquitto_auth_continue(void *user_data, struct mosquitto *client, const char *method, const void *data, uint16_t data_len, void **data_out, uint16_t *data_out_len)$/;" f +mosquitto_auth_continue test/broker/c/auth_plugin_extended_single.c /^int mosquitto_auth_continue(void *user_data, struct mosquitto *client, const char *method, const void *data, uint16_t data_len, void **data_out, uint16_t *data_out_len)$/;" f +mosquitto_auth_continue test/broker/c/auth_plugin_extended_single2.c /^int mosquitto_auth_continue(void *user_data, struct mosquitto *client, const char *method, const void *data, uint16_t data_len, void **data_out, uint16_t *data_out_len)$/;" f +mosquitto_auth_opt src/mosquitto_plugin.h /^struct mosquitto_auth_opt {$/;" s +mosquitto_auth_opt test/broker/c/mosquitto_plugin_v2.h /^struct mosquitto_auth_opt {$/;" s +mosquitto_auth_plugin_cleanup src/plugin_defer.c /^int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_cleanup test/broker/c/auth_plugin.c /^int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_cleanup test/broker/c/auth_plugin_acl.c /^int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_cleanup test/broker/c/auth_plugin_acl_sub_denied.c /^int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_cleanup test/broker/c/auth_plugin_context_params.c /^int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_cleanup test/broker/c/auth_plugin_extended_multiple.c /^int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_cleanup test/broker/c/auth_plugin_extended_single.c /^int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_cleanup test/broker/c/auth_plugin_extended_single2.c /^int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_cleanup test/broker/c/auth_plugin_msg_params.c /^int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_cleanup test/broker/c/auth_plugin_pwd.c /^int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_cleanup test/broker/c/auth_plugin_v2.c /^int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_cleanup test/random/auth_plugin.c /^int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_init src/plugin_defer.c /^int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_init test/broker/c/auth_plugin.c /^int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_init test/broker/c/auth_plugin_acl.c /^int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_init test/broker/c/auth_plugin_acl_sub_denied.c /^int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_init test/broker/c/auth_plugin_context_params.c /^int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_init test/broker/c/auth_plugin_extended_multiple.c /^int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_init test/broker/c/auth_plugin_extended_single.c /^int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_init test/broker/c/auth_plugin_extended_single2.c /^int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_init test/broker/c/auth_plugin_msg_params.c /^int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_init test/broker/c/auth_plugin_pwd.c /^int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_init test/broker/c/auth_plugin_v2.c /^int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_init test/random/auth_plugin.c /^int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count)$/;" f +mosquitto_auth_plugin_version src/plugin_defer.c /^int mosquitto_auth_plugin_version(void)$/;" f +mosquitto_auth_plugin_version test/broker/c/auth_plugin.c /^int mosquitto_auth_plugin_version(void)$/;" f +mosquitto_auth_plugin_version test/broker/c/auth_plugin_acl.c /^int mosquitto_auth_plugin_version(void)$/;" f +mosquitto_auth_plugin_version test/broker/c/auth_plugin_acl_sub_denied.c /^int mosquitto_auth_plugin_version(void)$/;" f +mosquitto_auth_plugin_version test/broker/c/auth_plugin_context_params.c /^int mosquitto_auth_plugin_version(void)$/;" f +mosquitto_auth_plugin_version test/broker/c/auth_plugin_extended_multiple.c /^int mosquitto_auth_plugin_version(void)$/;" f +mosquitto_auth_plugin_version test/broker/c/auth_plugin_extended_single.c /^int mosquitto_auth_plugin_version(void)$/;" f +mosquitto_auth_plugin_version test/broker/c/auth_plugin_extended_single2.c /^int mosquitto_auth_plugin_version(void)$/;" f +mosquitto_auth_plugin_version test/broker/c/auth_plugin_msg_params.c /^int mosquitto_auth_plugin_version(void)$/;" f +mosquitto_auth_plugin_version test/broker/c/auth_plugin_pwd.c /^int mosquitto_auth_plugin_version(void)$/;" f +mosquitto_auth_plugin_version test/broker/c/auth_plugin_v2.c /^int mosquitto_auth_plugin_version(void)$/;" f +mosquitto_auth_plugin_version test/random/auth_plugin.c /^int mosquitto_auth_plugin_version(void)$/;" f +mosquitto_auth_psk_key_get src/plugin_defer.c /^int mosquitto_auth_psk_key_get(void *user_data, const struct mosquitto *client, const char *hint, const char *identity, char *key, int max_key_len)$/;" f +mosquitto_auth_psk_key_get test/broker/c/auth_plugin.c /^int mosquitto_auth_psk_key_get(void *user_data, struct mosquitto *client, const char *hint, const char *identity, char *key, int max_key_len)$/;" f +mosquitto_auth_psk_key_get test/broker/c/auth_plugin_acl.c /^int mosquitto_auth_psk_key_get(void *user_data, struct mosquitto *client, const char *hint, const char *identity, char *key, int max_key_len)$/;" f +mosquitto_auth_psk_key_get test/broker/c/auth_plugin_acl_sub_denied.c /^int mosquitto_auth_psk_key_get(void *user_data, struct mosquitto *client, const char *hint, const char *identity, char *key, int max_key_len)$/;" f +mosquitto_auth_psk_key_get test/broker/c/auth_plugin_context_params.c /^int mosquitto_auth_psk_key_get(void *user_data, struct mosquitto *client, const char *hint, const char *identity, char *key, int max_key_len)$/;" f +mosquitto_auth_psk_key_get test/broker/c/auth_plugin_msg_params.c /^int mosquitto_auth_psk_key_get(void *user_data, struct mosquitto *client, const char *hint, const char *identity, char *key, int max_key_len)$/;" f +mosquitto_auth_psk_key_get test/broker/c/auth_plugin_pwd.c /^int mosquitto_auth_psk_key_get(void *user_data, struct mosquitto *client, const char *hint, const char *identity, char *key, int max_key_len)$/;" f +mosquitto_auth_psk_key_get test/broker/c/auth_plugin_v2.c /^int mosquitto_auth_psk_key_get(void *user_data, const char *hint, const char *identity, char *key, int max_key_len)$/;" f +mosquitto_auth_psk_key_get test/random/auth_plugin.c /^int mosquitto_auth_psk_key_get(void *user_data, struct mosquitto *client, const char *hint, const char *identity, char *key, int max_key_len)$/;" f +mosquitto_auth_security_cleanup src/plugin_defer.c /^int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_cleanup test/broker/c/auth_plugin.c /^int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_cleanup test/broker/c/auth_plugin_acl.c /^int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_cleanup test/broker/c/auth_plugin_acl_sub_denied.c /^int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_cleanup test/broker/c/auth_plugin_context_params.c /^int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_cleanup test/broker/c/auth_plugin_extended_multiple.c /^int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_cleanup test/broker/c/auth_plugin_extended_single.c /^int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_cleanup test/broker/c/auth_plugin_extended_single2.c /^int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_cleanup test/broker/c/auth_plugin_msg_params.c /^int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_cleanup test/broker/c/auth_plugin_pwd.c /^int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_cleanup test/broker/c/auth_plugin_v2.c /^int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_cleanup test/random/auth_plugin.c /^int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_init src/plugin_defer.c /^int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_init test/broker/c/auth_plugin.c /^int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_init test/broker/c/auth_plugin_acl.c /^int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_init test/broker/c/auth_plugin_acl_sub_denied.c /^int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_init test/broker/c/auth_plugin_context_params.c /^int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_init test/broker/c/auth_plugin_extended_multiple.c /^int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_init test/broker/c/auth_plugin_extended_single.c /^int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_init test/broker/c/auth_plugin_extended_single2.c /^int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_init test/broker/c/auth_plugin_msg_params.c /^int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_init test/broker/c/auth_plugin_pwd.c /^int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_init test/broker/c/auth_plugin_v2.c /^int mosquitto_auth_security_init(void *user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_security_init test/random/auth_plugin.c /^int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload)$/;" f +mosquitto_auth_start test/broker/c/auth_plugin_extended_multiple.c /^int mosquitto_auth_start(void *user_data, struct mosquitto *client, const char *method, bool reauth, const void *data, uint16_t data_len, void **data_out, uint16_t *data_out_len)$/;" f +mosquitto_auth_start test/broker/c/auth_plugin_extended_single.c /^int mosquitto_auth_start(void *user_data, struct mosquitto *client, const char *method, bool reauth, const void *data, uint16_t data_len, void **data_out, uint16_t *data_out_len)$/;" f +mosquitto_auth_start test/broker/c/auth_plugin_extended_single2.c /^int mosquitto_auth_start(void *user_data, struct mosquitto *client, const char *method, bool reauth, const void *data, uint16_t data_len, void **data_out, uint16_t *data_out_len)$/;" f +mosquitto_auth_unpwd_check src/plugin_defer.c /^int mosquitto_auth_unpwd_check(void *user_data, const struct mosquitto *client, const char *username, const char *password)$/;" f +mosquitto_auth_unpwd_check test/broker/c/auth_plugin.c /^int mosquitto_auth_unpwd_check(void *user_data, struct mosquitto *client, const char *username, const char *password)$/;" f +mosquitto_auth_unpwd_check test/broker/c/auth_plugin_acl.c /^int mosquitto_auth_unpwd_check(void *user_data, struct mosquitto *client, const char *username, const char *password)$/;" f +mosquitto_auth_unpwd_check test/broker/c/auth_plugin_acl_sub_denied.c /^int mosquitto_auth_unpwd_check(void *user_data, struct mosquitto *client, const char *username, const char *password)$/;" f +mosquitto_auth_unpwd_check test/broker/c/auth_plugin_context_params.c /^int mosquitto_auth_unpwd_check(void *user_data, struct mosquitto *client, const char *username, const char *password)$/;" f +mosquitto_auth_unpwd_check test/broker/c/auth_plugin_msg_params.c /^int mosquitto_auth_unpwd_check(void *user_data, struct mosquitto *client, const char *username, const char *password)$/;" f +mosquitto_auth_unpwd_check test/broker/c/auth_plugin_pwd.c /^int mosquitto_auth_unpwd_check(void *user_data, struct mosquitto *client, const char *username, const char *password)$/;" f +mosquitto_auth_unpwd_check test/broker/c/auth_plugin_v2.c /^int mosquitto_auth_unpwd_check(void *user_data, const char *username, const char *password)$/;" f +mosquitto_auth_unpwd_check test/random/auth_plugin.c /^int mosquitto_auth_unpwd_check(void *user_data, struct mosquitto *client, const char *username, const char *password)$/;" f +mosquitto_bridge_start_type src/mosquitto_broker_internal.h /^enum mosquitto_bridge_start_type{$/;" g +mosquitto_client_address src/plugin.c /^const char *mosquitto_client_address(const struct mosquitto *client)$/;" f +mosquitto_client_certificate src/plugin.c /^void *mosquitto_client_certificate(const struct mosquitto *client)$/;" f +mosquitto_client_clean_session src/plugin.c /^bool mosquitto_client_clean_session(const struct mosquitto *client)$/;" f +mosquitto_client_id src/plugin.c /^const char *mosquitto_client_id(const struct mosquitto *client)$/;" f +mosquitto_client_keepalive src/plugin.c /^int mosquitto_client_keepalive(const struct mosquitto *client)$/;" f +mosquitto_client_msg lib/mosquitto_internal.h /^struct mosquitto_client_msg;$/;" x +mosquitto_client_msg src/mosquitto_broker_internal.h /^struct mosquitto_client_msg{$/;" s +mosquitto_client_protocol src/plugin.c /^int mosquitto_client_protocol(const struct mosquitto *client)$/;" f +mosquitto_client_state lib/mosquitto_internal.h /^enum mosquitto_client_state {$/;" g +mosquitto_client_sub_count src/plugin.c /^int mosquitto_client_sub_count(const struct mosquitto *client)$/;" f +mosquitto_client_username src/plugin.c /^const char *mosquitto_client_username(const struct mosquitto *context)$/;" f +mosquitto_connack_string lib/mosquitto.c /^const char *mosquitto_connack_string(int connack_code)$/;" f +mosquitto_connect lib/connect.c /^int mosquitto_connect(struct mosquitto *mosq, const char *host, int port, int keepalive)$/;" f +mosquitto_connect_async lib/connect.c /^int mosquitto_connect_async(struct mosquitto *mosq, const char *host, int port, int keepalive)$/;" f +mosquitto_connect_bind lib/connect.c /^int mosquitto_connect_bind(struct mosquitto *mosq, const char *host, int port, int keepalive, const char *bind_address)$/;" f +mosquitto_connect_bind_async lib/connect.c /^int mosquitto_connect_bind_async(struct mosquitto *mosq, const char *host, int port, int keepalive, const char *bind_address)$/;" f +mosquitto_connect_bind_v5 lib/connect.c /^int mosquitto_connect_bind_v5(struct mosquitto *mosq, const char *host, int port, int keepalive, const char *bind_address, const mosquitto_property *properties)$/;" f +mosquitto_connect_callback_set lib/callbacks.c /^void mosquitto_connect_callback_set(struct mosquitto *mosq, void (*on_connect)(struct mosquitto *, void *, int))$/;" f +mosquitto_connect_srv lib/srv_mosq.c /^int mosquitto_connect_srv(struct mosquitto *mosq, const char *host, int keepalive, const char *bind_address)$/;" f +mosquitto_connect_v5_callback_set lib/callbacks.c /^void mosquitto_connect_v5_callback_set(struct mosquitto *mosq, void (*on_connect)(struct mosquitto *, void *, int, int, const mosquitto_property *))$/;" f +mosquitto_connect_with_flags_callback_set lib/callbacks.c /^void mosquitto_connect_with_flags_callback_set(struct mosquitto *mosq, void (*on_connect)(struct mosquitto *, void *, int, int))$/;" f +mosquitto_db lib/net_mosq.h /^struct mosquitto_db;$/;" x +mosquitto_db lib/packet_mosq.h /^struct mosquitto_db;$/;" x +mosquitto_db lib/read_handle.h /^struct mosquitto_db;$/;" x +mosquitto_db src/mosquitto_broker_internal.h /^struct mosquitto_db{$/;" s +mosquitto_destroy lib/mosquitto.c /^void mosquitto_destroy(struct mosquitto *mosq)$/;" f +mosquitto_disconnect lib/connect.c /^int mosquitto_disconnect(struct mosquitto *mosq)$/;" f +mosquitto_disconnect_callback_set lib/callbacks.c /^void mosquitto_disconnect_callback_set(struct mosquitto *mosq, void (*on_disconnect)(struct mosquitto *, void *, int))$/;" f +mosquitto_disconnect_v5 lib/connect.c /^int mosquitto_disconnect_v5(struct mosquitto *mosq, int reason_code, const mosquitto_property *properties)$/;" f +mosquitto_disconnect_v5_callback_set lib/callbacks.c /^void mosquitto_disconnect_v5_callback_set(struct mosquitto *mosq, void (*on_disconnect)(struct mosquitto *, void *, int, const mosquitto_property *))$/;" f +mosquitto_int_option lib/options.c /^int mosquitto_int_option(struct mosquitto *mosq, enum mosq_opt_t option, int value)$/;" f +mosquitto_lib_cleanup lib/mosquitto.c /^int mosquitto_lib_cleanup(void)$/;" f +mosquitto_lib_init lib/mosquitto.c /^int mosquitto_lib_init(void)$/;" f +mosquitto_lib_version lib/mosquitto.c /^int mosquitto_lib_version(int *major, int *minor, int *revision)$/;" f +mosquitto_log_callback_set lib/callbacks.c /^void mosquitto_log_callback_set(struct mosquitto *mosq, void (*on_log)(struct mosquitto *, void *, int, const char *))$/;" f +mosquitto_log_printf src/logging.c /^void mosquitto_log_printf(int level, const char *fmt, ...)$/;" f +mosquitto_log_vprintf src/logging.c /^int mosquitto_log_vprintf(int level, const char *fmt, va_list va)$/;" f +mosquitto_loop lib/loop.c /^int mosquitto_loop(struct mosquitto *mosq, int timeout, int max_packets)$/;" f +mosquitto_loop_forever lib/loop.c /^int mosquitto_loop_forever(struct mosquitto *mosq, int timeout, int max_packets)$/;" f +mosquitto_loop_misc lib/loop.c /^int mosquitto_loop_misc(struct mosquitto *mosq)$/;" f +mosquitto_loop_read lib/loop.c /^int mosquitto_loop_read(struct mosquitto *mosq, int max_packets)$/;" f +mosquitto_loop_start lib/thread_mosq.c /^int mosquitto_loop_start(struct mosquitto *mosq)$/;" f +mosquitto_loop_stop lib/thread_mosq.c /^int mosquitto_loop_stop(struct mosquitto *mosq, bool force)$/;" f +mosquitto_loop_write lib/loop.c /^int mosquitto_loop_write(struct mosquitto *mosq, int max_packets)$/;" f +mosquitto_main_loop src/loop.c /^int mosquitto_main_loop(struct mosquitto_db *db, mosq_sock_t *listensock, int listensock_count)$/;" f +mosquitto_max_inflight_messages_set lib/messages_mosq.c /^int mosquitto_max_inflight_messages_set(struct mosquitto *mosq, unsigned int max_inflight_messages)$/;" f +mosquitto_message lib/mosquitto.h /^struct mosquitto_message{$/;" s +mosquitto_message_all lib/mosquitto_internal.h /^struct mosquitto_message_all{$/;" s +mosquitto_message_callback_set lib/callbacks.c /^void mosquitto_message_callback_set(struct mosquitto *mosq, void (*on_message)(struct mosquitto *, void *, const struct mosquitto_message *))$/;" f +mosquitto_message_copy lib/messages_mosq.c /^int mosquitto_message_copy(struct mosquitto_message *dst, const struct mosquitto_message *src)$/;" f +mosquitto_message_free lib/messages_mosq.c /^void mosquitto_message_free(struct mosquitto_message **message)$/;" f +mosquitto_message_free_contents lib/messages_mosq.c /^void mosquitto_message_free_contents(struct mosquitto_message *message)$/;" f +mosquitto_message_retry_set lib/messages_mosq.c /^void mosquitto_message_retry_set(struct mosquitto *mosq, unsigned int message_retry)$/;" f +mosquitto_message_v5_callback_set lib/callbacks.c /^void mosquitto_message_v5_callback_set(struct mosquitto *mosq, void (*on_message)(struct mosquitto *, void *, const struct mosquitto_message *, const mosquitto_property *props))$/;" f +mosquitto_msg_data lib/mosquitto_internal.h /^struct mosquitto_msg_data{$/;" s +mosquitto_msg_direction lib/mosquitto_internal.h /^enum mosquitto_msg_direction {$/;" g +mosquitto_msg_origin src/mosquitto_broker_internal.h /^enum mosquitto_msg_origin{$/;" g +mosquitto_msg_state lib/mosquitto_internal.h /^enum mosquitto_msg_state {$/;" g +mosquitto_msg_store src/mosquitto_broker_internal.h /^struct mosquitto_msg_store{$/;" s +mosquitto_msg_store_load src/mosquitto_broker_internal.h /^struct mosquitto_msg_store_load{$/;" s +mosquitto_new lib/mosquitto.c /^struct mosquitto *mosquitto_new(const char *id, bool clean_start, void *userdata)$/;" f +mosquitto_opt src/mosquitto_plugin.h /^struct mosquitto_opt {$/;" s +mosquitto_opts_set lib/options.c /^int mosquitto_opts_set(struct mosquitto *mosq, enum mosq_opt_t option, void *value)$/;" f +mosquitto_property lib/mosquitto.h /^typedef struct mqtt5__property mosquitto_property;$/;" t typeref:struct:mqtt5__property +mosquitto_property_add_binary lib/property_mosq.c /^int mosquitto_property_add_binary(mosquitto_property **proplist, int identifier, const void *value, uint16_t len)$/;" f +mosquitto_property_add_byte lib/property_mosq.c /^int mosquitto_property_add_byte(mosquitto_property **proplist, int identifier, uint8_t value)$/;" f +mosquitto_property_add_int16 lib/property_mosq.c /^int mosquitto_property_add_int16(mosquitto_property **proplist, int identifier, uint16_t value)$/;" f +mosquitto_property_add_int32 lib/property_mosq.c /^int mosquitto_property_add_int32(mosquitto_property **proplist, int identifier, uint32_t value)$/;" f +mosquitto_property_add_string lib/property_mosq.c /^int mosquitto_property_add_string(mosquitto_property **proplist, int identifier, const char *value)$/;" f +mosquitto_property_add_string_pair lib/property_mosq.c /^int mosquitto_property_add_string_pair(mosquitto_property **proplist, int identifier, const char *name, const char *value)$/;" f +mosquitto_property_add_varint lib/property_mosq.c /^int mosquitto_property_add_varint(mosquitto_property **proplist, int identifier, uint32_t value)$/;" f +mosquitto_property_check_all lib/property_mosq.c /^int mosquitto_property_check_all(int command, const mosquitto_property *properties)$/;" f +mosquitto_property_check_command lib/property_mosq.c /^int mosquitto_property_check_command(int command, int identifier)$/;" f +mosquitto_property_copy_all lib/property_mosq.c /^int mosquitto_property_copy_all(mosquitto_property **dest, const mosquitto_property *src)$/;" f +mosquitto_property_free_all lib/property_mosq.c /^void mosquitto_property_free_all(mosquitto_property **property)$/;" f +mosquitto_property_read_binary lib/property_mosq.c /^const mosquitto_property *mosquitto_property_read_binary(const mosquitto_property *proplist, int identifier, void **value, uint16_t *len, bool skip_first)$/;" f +mosquitto_property_read_byte lib/property_mosq.c /^const mosquitto_property *mosquitto_property_read_byte(const mosquitto_property *proplist, int identifier, uint8_t *value, bool skip_first)$/;" f +mosquitto_property_read_int16 lib/property_mosq.c /^const mosquitto_property *mosquitto_property_read_int16(const mosquitto_property *proplist, int identifier, uint16_t *value, bool skip_first)$/;" f +mosquitto_property_read_int32 lib/property_mosq.c /^const mosquitto_property *mosquitto_property_read_int32(const mosquitto_property *proplist, int identifier, uint32_t *value, bool skip_first)$/;" f +mosquitto_property_read_string lib/property_mosq.c /^const mosquitto_property *mosquitto_property_read_string(const mosquitto_property *proplist, int identifier, char **value, bool skip_first)$/;" f +mosquitto_property_read_string_pair lib/property_mosq.c /^const mosquitto_property *mosquitto_property_read_string_pair(const mosquitto_property *proplist, int identifier, char **name, char **value, bool skip_first)$/;" f +mosquitto_property_read_varint lib/property_mosq.c /^const mosquitto_property *mosquitto_property_read_varint(const mosquitto_property *proplist, int identifier, uint32_t *value, bool skip_first)$/;" f +mosquitto_protocol src/mosquitto_broker.h /^enum mosquitto_protocol {$/;" g +mosquitto_psk_key_get src/security.c /^int mosquitto_psk_key_get(struct mosquitto_db *db, struct mosquitto *context, const char *hint, const char *identity, char *key, int max_key_len)$/;" f +mosquitto_psk_key_get_default src/security_default.c /^int mosquitto_psk_key_get_default(struct mosquitto_db *db, struct mosquitto *context, const char *hint, const char *identity, char *key, int max_key_len)$/;" f +mosquitto_pub_topic_check lib/util_topic.c /^int mosquitto_pub_topic_check(const char *str)$/;" f +mosquitto_pub_topic_check2 lib/util_topic.c /^int mosquitto_pub_topic_check2(const char *str, size_t len)$/;" f +mosquitto_publish lib/actions.c /^int mosquitto_publish(struct mosquitto *mosq, int *mid, const char *topic, int payloadlen, const void *payload, int qos, bool retain)$/;" f +mosquitto_publish_callback_set lib/callbacks.c /^void mosquitto_publish_callback_set(struct mosquitto *mosq, void (*on_publish)(struct mosquitto *, void *, int))$/;" f +mosquitto_publish_v5 lib/actions.c /^int mosquitto_publish_v5(struct mosquitto *mosq, int *mid, const char *topic, int payloadlen, const void *payload, int qos, bool retain, const mosquitto_property *properties)$/;" f +mosquitto_publish_v5_callback_set lib/callbacks.c /^void mosquitto_publish_v5_callback_set(struct mosquitto *mosq, void (*on_publish)(struct mosquitto *, void *, int, int, const mosquitto_property *props))$/;" f +mosquitto_reason_string lib/mosquitto.c /^const char *mosquitto_reason_string(int reason_code)$/;" f +mosquitto_reconnect lib/connect.c /^int mosquitto_reconnect(struct mosquitto *mosq)$/;" f +mosquitto_reconnect_async lib/connect.c /^int mosquitto_reconnect_async(struct mosquitto *mosq)$/;" f +mosquitto_reconnect_delay_set lib/options.c /^int mosquitto_reconnect_delay_set(struct mosquitto *mosq, unsigned int reconnect_delay, unsigned int reconnect_delay_max, bool reconnect_exponential_backoff)$/;" f +mosquitto_reinitialise lib/mosquitto.c /^int mosquitto_reinitialise(struct mosquitto *mosq, const char *id, bool clean_start, void *userdata)$/;" f +mosquitto_security_apply src/security.c /^int mosquitto_security_apply(struct mosquitto_db *db)$/;" f +mosquitto_security_apply_default src/security_default.c /^int mosquitto_security_apply_default(struct mosquitto_db *db)$/;" f +mosquitto_security_auth_continue src/security.c /^int mosquitto_security_auth_continue(struct mosquitto_db *db, struct mosquitto *context, const void *data_in, uint16_t data_in_len, void **data_out, uint16_t *data_out_len)$/;" f +mosquitto_security_auth_start src/security.c /^int mosquitto_security_auth_start(struct mosquitto_db *db, struct mosquitto *context, bool reauth, const void *data_in, uint16_t data_in_len, void **data_out, uint16_t *data_out_len)$/;" f +mosquitto_security_cleanup src/security.c /^int mosquitto_security_cleanup(struct mosquitto_db *db, bool reload)$/;" f +mosquitto_security_cleanup_default src/security_default.c /^int mosquitto_security_cleanup_default(struct mosquitto_db *db, bool reload)$/;" f +mosquitto_security_init src/security.c /^int mosquitto_security_init(struct mosquitto_db *db, bool reload)$/;" f +mosquitto_security_init_default src/security_default.c /^int mosquitto_security_init_default(struct mosquitto_db *db, bool reload)$/;" f +mosquitto_security_module_cleanup src/security.c /^int mosquitto_security_module_cleanup(struct mosquitto_db *db)$/;" f +mosquitto_security_module_init src/security.c /^int mosquitto_security_module_init(struct mosquitto_db *db)$/;" f +mosquitto_set_username src/plugin.c /^int mosquitto_set_username(struct mosquitto *client, const char *username)$/;" f +mosquitto_socket lib/mosquitto.c /^int mosquitto_socket(struct mosquitto *mosq)$/;" f +mosquitto_socks5_set lib/socks_mosq.c /^int mosquitto_socks5_set(struct mosquitto *mosq, const char *host, int port, const char *username, const char *password)$/;" f +mosquitto_strerror lib/mosquitto.c /^const char *mosquitto_strerror(int mosq_errno)$/;" f +mosquitto_string_option lib/options.c /^int mosquitto_string_option(struct mosquitto *mosq, enum mosq_opt_t option, const char *value)$/;" f +mosquitto_string_to_command lib/mosquitto.c /^int mosquitto_string_to_command(const char *str, int *cmd)$/;" f +mosquitto_string_to_property_info lib/property_mosq.c /^int mosquitto_string_to_property_info(const char *propname, int *identifier, int *type)$/;" f +mosquitto_sub_topic_check lib/util_topic.c /^int mosquitto_sub_topic_check(const char *str)$/;" f +mosquitto_sub_topic_check2 lib/util_topic.c /^int mosquitto_sub_topic_check2(const char *str, size_t len)$/;" f +mosquitto_sub_topic_tokenise lib/mosquitto.c /^int mosquitto_sub_topic_tokenise(const char *subtopic, char ***topics, int *count)$/;" f +mosquitto_sub_topic_tokens_free lib/mosquitto.c /^int mosquitto_sub_topic_tokens_free(char ***topics, int count)$/;" f +mosquitto_subscribe lib/actions.c /^int mosquitto_subscribe(struct mosquitto *mosq, int *mid, const char *sub, int qos)$/;" f +mosquitto_subscribe_callback lib/helpers.c /^libmosq_EXPORT int mosquitto_subscribe_callback($/;" f +mosquitto_subscribe_callback_set lib/callbacks.c /^void mosquitto_subscribe_callback_set(struct mosquitto *mosq, void (*on_subscribe)(struct mosquitto *, void *, int, int, const int *))$/;" f +mosquitto_subscribe_multiple lib/actions.c /^int mosquitto_subscribe_multiple(struct mosquitto *mosq, int *mid, int sub_count, char *const *const sub, int qos, int options, const mosquitto_property *properties)$/;" f +mosquitto_subscribe_simple lib/helpers.c /^libmosq_EXPORT int mosquitto_subscribe_simple($/;" f +mosquitto_subscribe_v5 lib/actions.c /^int mosquitto_subscribe_v5(struct mosquitto *mosq, int *mid, const char *sub, int qos, int options, const mosquitto_property *properties)$/;" f +mosquitto_subscribe_v5_callback_set lib/callbacks.c /^void mosquitto_subscribe_v5_callback_set(struct mosquitto *mosq, void (*on_subscribe)(struct mosquitto *, void *, int, int, const int *, const mosquitto_property *props))$/;" f +mosquitto_threaded_set lib/thread_mosq.c /^int mosquitto_threaded_set(struct mosquitto *mosq, bool threaded)$/;" f +mosquitto_time lib/time_mosq.c /^time_t mosquitto_time(void)$/;" f +mosquitto_time test/unit/persist_read_stubs.c /^time_t mosquitto_time(void)$/;" f +mosquitto_time test/unit/persist_write_stubs.c /^time_t mosquitto_time(void)$/;" f +mosquitto_tls_insecure_set lib/options.c /^int mosquitto_tls_insecure_set(struct mosquitto *mosq, bool value)$/;" f +mosquitto_tls_opts_set lib/options.c /^int mosquitto_tls_opts_set(struct mosquitto *mosq, int cert_reqs, const char *tls_version, const char *ciphers)$/;" f +mosquitto_tls_psk_set lib/options.c /^int mosquitto_tls_psk_set(struct mosquitto *mosq, const char *psk, const char *identity, const char *ciphers)$/;" f +mosquitto_tls_set lib/options.c /^int mosquitto_tls_set(struct mosquitto *mosq, const char *cafile, const char *capath, const char *certfile, const char *keyfile, int (*pw_callback)(char *buf, int size, int rwflag, void *userdata))$/;" f +mosquitto_topic_matches_sub lib/util_topic.c /^int mosquitto_topic_matches_sub(const char *sub, const char *topic, bool *result)$/;" f +mosquitto_topic_matches_sub2 lib/util_topic.c /^int mosquitto_topic_matches_sub2(const char *sub, size_t sublen, const char *topic, size_t topiclen, bool *result)$/;" f +mosquitto_unpwd_check src/security.c /^int mosquitto_unpwd_check(struct mosquitto_db *db, struct mosquitto *context, const char *username, const char *password)$/;" f +mosquitto_unpwd_check_default src/security_default.c /^int mosquitto_unpwd_check_default(struct mosquitto_db *db, struct mosquitto *context, const char *username, const char *password)$/;" f +mosquitto_unsubscribe lib/actions.c /^int mosquitto_unsubscribe(struct mosquitto *mosq, int *mid, const char *sub)$/;" f +mosquitto_unsubscribe_callback_set lib/callbacks.c /^void mosquitto_unsubscribe_callback_set(struct mosquitto *mosq, void (*on_unsubscribe)(struct mosquitto *, void *, int))$/;" f +mosquitto_unsubscribe_multiple lib/actions.c /^int mosquitto_unsubscribe_multiple(struct mosquitto *mosq, int *mid, int sub_count, char *const *const sub, const mosquitto_property *properties)$/;" f +mosquitto_unsubscribe_v5 lib/actions.c /^int mosquitto_unsubscribe_v5(struct mosquitto *mosq, int *mid, const char *sub, const mosquitto_property *properties)$/;" f +mosquitto_unsubscribe_v5_callback_set lib/callbacks.c /^void mosquitto_unsubscribe_v5_callback_set(struct mosquitto *mosq, void (*on_unsubscribe)(struct mosquitto *, void *, int, const mosquitto_property *props))$/;" f +mosquitto_user_data_set lib/options.c /^void mosquitto_user_data_set(struct mosquitto *mosq, void *userdata)$/;" f +mosquitto_userdata lib/options.c /^void *mosquitto_userdata(struct mosquitto *mosq)$/;" f +mosquitto_username_pw_set lib/options.c /^int mosquitto_username_pw_set(struct mosquitto *mosq, const char *username, const char *password)$/;" f +mosquitto_validate_utf8 lib/utf8_mosq.c /^int mosquitto_validate_utf8(const char *str, int len)$/;" f +mosquitto_void_option lib/options.c /^int mosquitto_void_option(struct mosquitto *mosq, enum mosq_opt_t option, void *value)$/;" f +mosquitto_want_write lib/mosquitto.c /^bool mosquitto_want_write(struct mosquitto *mosq)$/;" f +mosquitto_will_clear lib/options.c /^int mosquitto_will_clear(struct mosquitto *mosq)$/;" f +mosquitto_will_set lib/options.c /^int mosquitto_will_set(struct mosquitto *mosq, const char *topic, int payloadlen, const void *payload, int qos, bool retain)$/;" f +mosquitto_will_set_v5 lib/options.c /^int mosquitto_will_set_v5(struct mosquitto *mosq, const char *topic, int payloadlen, const void *payload, int qos, bool retain, mosquitto_property *properties)$/;" f +mosquittopp lib/cpp/mosquittopp.cpp /^mosquittopp::mosquittopp(const char *id, bool clean_session)$/;" f class:mosqpp::mosquittopp +mosquittopp_test test/lib/cpp/01-con-discon-success.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/01-con-discon-success.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/01-keepalive-pingreq.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/01-keepalive-pingreq.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/01-no-clean-session.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/01-no-clean-session.cpp /^mosquittopp_test::mosquittopp_test(const char *id, bool clean_session) : mosqpp::mosquittopp(id, clean_session)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/01-unpwd-set.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/01-unpwd-set.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/01-will-set.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/01-will-set.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/01-will-unpwd-set.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/01-will-unpwd-set.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/02-subscribe-qos0.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/02-subscribe-qos0.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/02-subscribe-qos1.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/02-subscribe-qos1.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/02-subscribe-qos2.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/02-subscribe-qos2.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/02-unsubscribe.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/02-unsubscribe.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/03-publish-b2c-qos1.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/03-publish-b2c-qos1.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/03-publish-b2c-qos2.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/03-publish-b2c-qos2.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/03-publish-c2b-qos2.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/03-publish-c2b-qos2.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/03-publish-qos0-no-payload.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/03-publish-qos0-no-payload.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/03-publish-qos0.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/03-publish-qos0.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/04-retain-qos0.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/04-retain-qos0.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/08-ssl-bad-cacert.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/08-ssl-bad-cacert.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/08-ssl-connect-cert-auth.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/08-ssl-connect-cert-auth.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/08-ssl-connect-no-auth.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/08-ssl-connect-no-auth.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mosquittopp_test test/lib/cpp/08-ssl-fake-cacert.cpp /^class mosquittopp_test : public mosqpp::mosquittopp$/;" c file: +mosquittopp_test test/lib/cpp/08-ssl-fake-cacert.cpp /^mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id)$/;" f class:mosquittopp_test +mount_point src/mosquitto_broker_internal.h /^ char *mount_point;$/;" m struct:mosquitto__listener +mp_mqtt src/mosquitto_broker.h /^ mp_mqtt,$/;" e enum:mosquitto_protocol +mp_mqttsn src/mosquitto_broker.h /^ mp_mqttsn,$/;" e enum:mosquitto_protocol +mp_websockets src/mosquitto_broker.h /^ mp_websockets$/;" e enum:mosquitto_protocol +mpw_tmpfile src/mosquitto_passwd.c /^static FILE *mpw_tmpfile(void)$/;" f file: +mqtt311_connack_codes lib/mqtt_protocol.h /^enum mqtt311_connack_codes {$/;" g +mqtt5__property lib/property_mosq.h /^struct mqtt5__property {$/;" s +mqtt5_property lib/mqtt_protocol.h /^enum mqtt5_property {$/;" g +mqtt5_property_type lib/mqtt_protocol.h /^enum mqtt5_property_type {$/;" g +mqtt5_return_codes lib/mqtt_protocol.h /^enum mqtt5_return_codes {$/;" g +mqtt5_sub_options lib/mqtt_protocol.h /^enum mqtt5_sub_options {$/;" g +mqtt__string lib/property_mosq.h /^struct mqtt__string {$/;" s +mqtt_host examples/mysql_log/mysql_log.c 23;" d file: +mqtt_port examples/mysql_log/mysql_log.c 24;" d file: +mqtt_tempconv examples/temperature_conversion/temperature_conversion.cpp /^mqtt_tempconv::mqtt_tempconv(const char *id, const char *host, int port) : mosquittopp(id)$/;" f class:mqtt_tempconv +msb lib/packet_datatypes.c /^ uint8_t msb, lsb;$/;" l +msc src/db_dump/db_dump.c /^ struct msg_store_chunk *msc;$/;" l +msg examples/subscribe_simple/multiple.c /^ struct mosquitto_message *msg;$/;" l +msg examples/subscribe_simple/single.c /^ struct mosquitto_message *msg;$/;" l +msg lib/messages_mosq.c /^ struct mosquitto_message *msg;$/;" l +msg lib/messages_mosq.c /^ struct mosquitto_message_all *msg;$/;" l +msg lib/mosquitto_internal.h /^ struct mosquitto_message msg;$/;" m struct:mosquitto_message_all typeref:struct:mosquitto_message_all::mosquitto_message +msg src/database.c /^ struct mosquitto_client_msg *msg, *tmp;$/;" l +msg src/database.c /^ struct mosquitto_client_msg *msg;$/;" l +msg src/db_dump/db_dump.c /^ struct db_msg msg = {0};$/;" l +msg src/security.c /^ struct mosquitto_acl_msg msg;$/;" l +msg_bytes lib/mosquitto_internal.h /^ unsigned long msg_bytes;$/;" m struct:mosquitto_msg_data +msg_bytes12 lib/mosquitto_internal.h /^ unsigned long msg_bytes12;$/;" m struct:mosquitto_msg_data +msg_count client/client_shared.h /^ int msg_count; \/* sub *\/$/;" m struct:mosq_config +msg_count client/rr_client.c /^int msg_count = 0;$/;" v +msg_count client/sub_client.c /^int msg_count = 0;$/;" v +msg_count lib/mosquitto_internal.h /^ int msg_count;$/;" m struct:mosquitto_msg_data +msg_count src/database.c /^ int msg_count = 0;$/;" l +msg_count12 lib/mosquitto_internal.h /^ int msg_count12;$/;" m struct:mosquitto_msg_data +msg_data src/database.c /^ struct mosquitto_msg_data *msg_data;$/;" l +msg_data src/persist_read.c /^ struct mosquitto_msg_data *msg_data;$/;" l +msg_index src/database.c /^ int msg_index = 0;$/;" l +msg_properties src/handle_publish.c /^ mosquitto_property *msg_properties = NULL, *msg_properties_last;$/;" l +msg_properties src/property_broker.c /^ mosquitto_property *msg_properties, *msg_properties_last;$/;" l +msg_properties_last src/handle_publish.c /^ mosquitto_property *msg_properties = NULL, *msg_properties_last;$/;" l +msg_properties_last src/property_broker.c /^ mosquitto_property *msg_properties, *msg_properties_last;$/;" l +msg_qos src/subs.c /^ int client_qos, msg_qos;$/;" l +msg_store src/mosquitto_broker_internal.h /^ struct mosquitto_msg_store *msg_store;$/;" m struct:mosquitto_db typeref:struct:mosquitto_db::mosquitto_msg_store +msg_store_bytes src/mosquitto_broker_internal.h /^ unsigned long msg_store_bytes;$/;" m struct:mosquitto_db +msg_store_bytes src/sys_tree.c /^ static unsigned long msg_store_bytes = -1;$/;" l file: +msg_store_chunk src/db_dump/db_dump.c /^struct msg_store_chunk$/;" s file: +msg_store_count src/db_dump/db_dump.c /^ long msg_store_count = 0;$/;" l +msg_store_count src/mosquitto_broker_internal.h /^ int msg_store_count;$/;" m struct:mosquitto_db +msg_store_count src/sys_tree.c /^ static int msg_store_count = -1;$/;" l file: +msg_store_load src/mosquitto_broker_internal.h /^ struct mosquitto_msg_store_load *msg_store_load;$/;" m struct:mosquitto_db typeref:struct:mosquitto_db::mosquitto_msg_store_load +msg_tail src/handle_connect.c /^ struct mosquitto_client_msg *msg_tail, *tmp;$/;" l +msglen client/client_shared.h /^ long msglen; \/* pub, rr *\/$/;" m struct:mosq_config +msgs_by_id src/db_dump/db_dump.c /^struct msg_store_chunk *msgs_by_id = NULL;$/;" v typeref:struct:msg_store_chunk +msgs_in lib/mosquitto_internal.h /^ struct mosquitto_msg_data msgs_in;$/;" m struct:mosquitto typeref:struct:mosquitto::mosquitto_msg_data +msgs_medium10 test/broker/03-publish-qos1-queued-bytes.py /^ msgs_medium10 = [("test\/publish\/queueing\/%d" % x,$/;" v +msgs_out lib/mosquitto_internal.h /^ struct mosquitto_msg_data msgs_out;$/;" m struct:mosquitto typeref:struct:mosquitto::mosquitto_msg_data +msgs_received src/sys_tree.c /^ static unsigned long msgs_received = -1;$/;" l file: +msgs_received_interval src/sys_tree.c /^ double msgs_received_interval, msgs_sent_interval, publish_dropped_interval;$/;" l +msgs_received_load1 src/sys_tree.c /^ static double msgs_received_load1 = 0;$/;" l file: +msgs_received_load15 src/sys_tree.c /^ static double msgs_received_load15 = 0;$/;" l file: +msgs_received_load5 src/sys_tree.c /^ static double msgs_received_load5 = 0;$/;" l file: +msgs_sent src/sys_tree.c /^ static unsigned long msgs_sent = -1;$/;" l file: +msgs_sent_interval src/sys_tree.c /^ double msgs_received_interval, msgs_sent_interval, publish_dropped_interval;$/;" l +msgs_sent_load1 src/sys_tree.c /^ static double msgs_sent_load1 = 0;$/;" l file: +msgs_sent_load15 src/sys_tree.c /^ static double msgs_sent_load15 = 0;$/;" l file: +msgs_sent_load5 src/sys_tree.c /^ static double msgs_sent_load5 = 0;$/;" l file: +msgs_short10 test/broker/03-publish-qos1-queued-bytes.py /^ msgs_short10 = [("test\/publish\/queueing\/%d" % x,$/;" v +msgtime_mutex lib/mosquitto_internal.h /^ pthread_mutex_t msgtime_mutex;$/;" m struct:mosquitto +my_connect_callback client/pub_client.c /^void my_connect_callback(struct mosquitto *mosq, void *obj, int result, int flags, const mosquitto_property *properties)$/;" f +my_connect_callback client/rr_client.c /^void my_connect_callback(struct mosquitto *mosq, void *obj, int result, int flags, const mosquitto_property *properties)$/;" f +my_connect_callback client/sub_client.c /^void my_connect_callback(struct mosquitto *mosq, void *obj, int result, int flags, const mosquitto_property *properties)$/;" f +my_connect_callback test/old/msgsps_pub.c /^void my_connect_callback(struct mosquitto *mosq, void *obj, int rc)$/;" f +my_connect_callback test/old/msgsps_sub.c /^void my_connect_callback(struct mosquitto *mosq, void *obj, int rc)$/;" f +my_disconnect_callback client/pub_client.c /^void my_disconnect_callback(struct mosquitto *mosq, void *obj, int rc, const mosquitto_property *properties)$/;" f +my_disconnect_callback test/old/msgsps_pub.c /^void my_disconnect_callback(struct mosquitto *mosq, void *obj, int result)$/;" f +my_disconnect_callback test/old/msgsps_sub.c /^void my_disconnect_callback(struct mosquitto *mosq, void *obj, int result)$/;" f +my_log_callback client/pub_shared.c /^void my_log_callback(struct mosquitto *mosq, void *obj, int level, const char *str)$/;" f +my_log_callback client/sub_client.c /^void my_log_callback(struct mosquitto *mosq, void *obj, int level, const char *str)$/;" f +my_message_callback client/rr_client.c /^void my_message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message, const mosquitto_property *properties)$/;" f +my_message_callback client/sub_client.c /^void my_message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message, const mosquitto_property *properties)$/;" f +my_message_callback test/old/msgsps_sub.c /^void my_message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *msg)$/;" f +my_publish client/pub_client.c /^int my_publish(struct mosquitto *mosq, int *mid, const char *topic, int payloadlen, void *payload, int qos, bool retain)$/;" f +my_publish client/rr_client.c /^int my_publish(struct mosquitto *mosq, int *mid, const char *topic, int payloadlen, void *payload, int qos, bool retain)$/;" f +my_publish_callback client/pub_client.c /^void my_publish_callback(struct mosquitto *mosq, void *obj, int mid, int reason_code, const mosquitto_property *properties)$/;" f +my_publish_callback client/rr_client.c /^void my_publish_callback(struct mosquitto *mosq, void *obj, int mid, int reason_code, const mosquitto_property *properties)$/;" f +my_publish_callback client/sub_client.c /^void my_publish_callback(struct mosquitto *mosq, void *obj, int mid, int reason_code, const mosquitto_property *properties)$/;" f +my_publish_callback test/old/msgsps_pub.c /^void my_publish_callback(struct mosquitto *mosq, void *obj, int mid)$/;" f +my_signal_handler client/rr_client.c /^void my_signal_handler(int signum)$/;" f +my_signal_handler client/sub_client.c /^void my_signal_handler(int signum)$/;" f +my_subscribe_callback client/rr_client.c /^void my_subscribe_callback(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos)$/;" f +my_subscribe_callback client/sub_client.c /^void my_subscribe_callback(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos)$/;" f +name lib/property_mosq.h /^ struct mqtt__string name;$/;" m struct:mqtt5__property typeref:struct:mqtt5__property::mqtt__string +name lib/tls_mosq.c /^ char name[256];$/;" l +name src/handle_connect.c /^ X509_NAME *name;$/;" l +name src/mosquitto_broker_internal.h /^ char *name;$/;" m struct:mosquitto__bridge +name src/mosquitto_broker_internal.h /^ char *name;$/;" m struct:mosquitto__subshared +name_asn1 src/handle_connect.c /^ ASN1_STRING *name_asn1 = NULL;$/;" l +name_entry src/handle_connect.c /^ X509_NAME_ENTRY *name_entry;$/;" l +name_length src/handle_connect.c /^ long name_length = BIO_get_mem_data(subject_bio, &data_start);$/;" l +net__broker_cleanup src/net.c /^void net__broker_cleanup(void)$/;" f +net__broker_init src/net.c /^void net__broker_init(void)$/;" f +net__cleanup lib/net_mosq.c /^void net__cleanup(void)$/;" f +net__get_ui_method lib/net_mosq.c /^UI_METHOD *net__get_ui_method(void)$/;" f +net__init lib/net_mosq.c /^int net__init(void)$/;" f +net__init_ssl_ctx lib/net_mosq.c /^static int net__init_ssl_ctx(struct mosquitto *mosq)$/;" f file: +net__print_error src/net.c /^static void net__print_error(int log, const char *format_str)$/;" f file: +net__print_ssl_error lib/net_mosq.c /^void net__print_ssl_error(struct mosquitto *mosq)$/;" f +net__read lib/net_mosq.c /^ssize_t net__read(struct mosquitto *mosq, void *buf, size_t count)$/;" f +net__socket_accept src/net.c /^int net__socket_accept(struct mosquitto_db *db, mosq_sock_t listensock)$/;" f +net__socket_close lib/net_mosq.c /^int net__socket_close(struct mosquitto_db *db, struct mosquitto *mosq)$/;" f +net__socket_close test/unit/persist_read_stubs.c /^int net__socket_close(struct mosquitto_db *db, struct mosquitto *mosq)$/;" f +net__socket_close test/unit/persist_write_stubs.c /^int net__socket_close(struct mosquitto_db *db, struct mosquitto *mosq)$/;" f +net__socket_connect lib/net_mosq.c /^int net__socket_connect(struct mosquitto *mosq, const char *host, uint16_t port, const char *bind_address, bool blocking)$/;" f +net__socket_connect_step3 lib/net_mosq.c /^int net__socket_connect_step3(struct mosquitto *mosq, const char *host)$/;" f +net__socket_connect_tls lib/net_mosq.c /^int net__socket_connect_tls(struct mosquitto *mosq)$/;" f +net__socket_get_address src/net.c /^int net__socket_get_address(mosq_sock_t sock, char *buf, int len)$/;" f +net__socket_listen src/net.c /^int net__socket_listen(struct mosquitto__listener *listener)$/;" f +net__socket_nonblock lib/net_mosq.c /^int net__socket_nonblock(mosq_sock_t *sock)$/;" f +net__socketpair lib/net_mosq.c /^int net__socketpair(mosq_sock_t *pairR, mosq_sock_t *pairW)$/;" f +net__try_connect lib/net_mosq.c /^int net__try_connect(const char *host, uint16_t port, mosq_sock_t *sock, const char *bind_address, bool blocking)$/;" f +net__try_connect_step1 lib/net_mosq.c /^int net__try_connect_step1(struct mosquitto *mosq, const char *host)$/;" f +net__try_connect_step2 lib/net_mosq.c /^int net__try_connect_step2(struct mosquitto *mosq, uint16_t port, mosq_sock_t *sock)$/;" f +net__write lib/net_mosq.c /^ssize_t net__write(struct mosquitto *mosq, void *buf, size_t count)$/;" f +new_context src/bridge.c /^ struct mosquitto *new_context = NULL;$/;" l +new_context src/net.c /^ struct mosquitto *new_context;$/;" l +new_sock src/net.c /^ mosq_sock_t new_sock = INVALID_SOCKET;$/;" l +new_topic src/subs.c /^ struct sub__token *new_topic, *tail = NULL;$/;" l +new_topic src/subs.c /^ struct sub__token *new_topic;$/;" l +new_user src/security_default.c /^ bool new_user = false;$/;" l +new_value src/sys_tree.c /^ double new_value;$/;" l +newbuf src/conf.c /^ char *newbuf;$/;" l +newleaf src/subs.c /^ struct mosquitto__subleaf *newleaf = NULL;$/;" l +newleaf src/subs.c /^ struct mosquitto__subleaf *newleaf;$/;" l +next lib/mosquitto_internal.h /^ struct mosquitto__packet *next;$/;" m struct:mosquitto__packet typeref:struct:mosquitto__packet::mosquitto__packet +next lib/mosquitto_internal.h /^ struct mosquitto_message_all *next;$/;" m struct:mosquitto_message_all typeref:struct:mosquitto_message_all::mosquitto_message_all +next lib/mosquitto_internal.h /^ struct session_expiry_list *next;$/;" m struct:session_expiry_list typeref:struct:session_expiry_list::session_expiry_list +next lib/mosquitto_internal.h /^ struct will_delay_list *next;$/;" m struct:will_delay_list typeref:struct:will_delay_list::will_delay_list +next lib/property_mosq.c /^ mosquitto_property *p, *next;$/;" l +next lib/property_mosq.h /^ struct mqtt5__property *next;$/;" m struct:mqtt5__property typeref:struct:mqtt5__property::mqtt5__property +next src/context.c /^ struct mosquitto *context, *next;$/;" l +next src/database.c /^ struct mosquitto_msg_store *store, *next;$/;" l +next src/database.c /^ struct mosquitto_msg_store *store, *next;;$/;" l +next src/deps/uthash.h /^ void *next; \/* next element in app order *\/$/;" m struct:UT_hash_handle +next src/mosquitto_broker_internal.h /^ struct mosquitto__acl *next;$/;" m struct:mosquitto__acl typeref:struct:mosquitto__acl::mosquitto__acl +next src/mosquitto_broker_internal.h /^ struct mosquitto__acl_user *next;$/;" m struct:mosquitto__acl_user typeref:struct:mosquitto__acl_user::mosquitto__acl_user +next src/mosquitto_broker_internal.h /^ struct mosquitto__subleaf *next;$/;" m struct:mosquitto__subleaf typeref:struct:mosquitto__subleaf::mosquitto__subleaf +next src/mosquitto_broker_internal.h /^ struct mosquitto_client_msg *next;$/;" m struct:mosquitto_client_msg typeref:struct:mosquitto_client_msg::mosquitto_client_msg +next src/mosquitto_broker_internal.h /^ struct mosquitto_msg_store *next;$/;" m struct:mosquitto_msg_store typeref:struct:mosquitto_msg_store::mosquitto_msg_store +next src/subs.c /^ struct sub__token *next;$/;" m struct:sub__token typeref:struct:sub__token::sub__token file: +next_client test/random/test.py /^def next_client(clients):$/;" f +next_msg_out lib/mosquitto_internal.h /^ time_t next_msg_out;$/;" m struct:mosquitto +next_msg_out lib/util_mosq.c /^ time_t next_msg_out;$/;" l +next_publish_time test/random/random_client.py /^next_publish_time = time.time() + random.uniform(0.1, 2.0)$/;" v +next_publish_tv client/pub_client.c /^static struct timeval next_publish_tv;$/;" v typeref:struct:timeval file: +next_publish_tv client/pub_client.c /^static uint64_t next_publish_tv;$/;" v file: +next_test test/ptest.py /^def next_test(tests, ports):$/;" f +nextleaf src/database.c /^ struct mosquitto__subleaf *leaf, *nextleaf;$/;" l +nextupd lib/net_mosq_ocsp.c /^ ASN1_GENERALIZEDTIME *rev, *thisupd, *nextupd;$/;" l +nibble_to_hex src/handle_connect.c /^static char nibble_to_hex(uint8_t value)$/;" f file: +no_local src/mosquitto_broker_internal.h /^ bool no_local;$/;" m struct:mosquitto__subleaf +no_match_helper test/unit/util_topic_test.c /^static void no_match_helper(int rc_expected, const char *sub, const char *topic)$/;" f file: +no_retain client/client_shared.h /^ bool no_retain; \/* sub *\/$/;" m struct:mosq_config +noexpand src/deps/uthash.h /^ unsigned ineff_expands, noexpand;$/;" m struct:UT_hash_table +nonideal_items src/deps/uthash.h /^ unsigned nonideal_items;$/;" m struct:UT_hash_table +notification_payload src/bridge.c /^ uint8_t notification_payload;$/;" l +notification_payload src/handle_connack.c /^ char notification_payload;$/;" l +notification_topic src/bridge.c /^ char *notification_topic;$/;" l +notification_topic src/handle_connack.c /^ char *notification_topic;$/;" l +notification_topic src/mosquitto_broker_internal.h /^ char *notification_topic;$/;" m struct:mosquitto__bridge +notification_topic_len src/bridge.c /^ int notification_topic_len;$/;" l +notification_topic_len src/handle_connack.c /^ int notification_topic_len;$/;" l +notifications src/mosquitto_broker_internal.h /^ bool notifications;$/;" m struct:mosquitto__bridge +notifications_local_only src/mosquitto_broker_internal.h /^ bool notifications_local_only;$/;" m struct:mosquitto__bridge +now lib/loop.c /^ time_t now;$/;" l +now lib/messages_mosq.c /^ time_t now = mosquitto_time();$/;" l +now lib/util_mosq.c /^ time_t now = mosquitto_time();$/;" l +now src/database.c /^ time_t now = 0;$/;" l +now src/logging.c /^ time_t now = time(NULL);$/;" l +now src/loop.c /^ time_t now = 0;$/;" l +now src/loop.c /^ time_t now = mosquitto_time();$/;" l +now src/subs.c /^ time_t now;$/;" l +now src/sys_tree.c /^ time_t now;$/;" l +ns client/sub_client_output.c /^ long ns;$/;" l +num_buckets src/deps/uthash.h /^ unsigned num_buckets, log2_num_buckets;$/;" m struct:UT_hash_table +num_items src/deps/uthash.h /^ unsigned num_items;$/;" m struct:UT_hash_table +nval lib/tls_mosq.c /^ const GENERAL_NAME *nval;$/;" l +ocsp_status lib/net_mosq_ocsp.c /^ int ocsp_status, result2, i;$/;" l +offset src/conf.c /^ int offset = 0;$/;" l +old src/plugin.c /^ char *old;$/;" l +on_change_background misc/currentcost/gnome-panel/CurrentCostMQTT.py /^ def on_change_background(self, applet, type, color, pixmap):$/;" m class:CurrentCostMQTT +on_connect examples/temperature_conversion/temperature_conversion.cpp /^void mqtt_tempconv::on_connect(int rc)$/;" f class:mqtt_tempconv +on_connect lib/cpp/mosquittopp.h /^ virtual void on_connect(int \/*rc*\/) {return;}$/;" f +on_connect lib/helpers.c /^static void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f file: +on_connect lib/mosquitto_internal.h /^ void (*on_connect)(struct mosquitto *, void *userdata, int rc);$/;" m struct:mosquitto +on_connect test/broker/c/08-tls-psk-bridge.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/broker/c/08-tls-psk-pub.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/01-con-discon-success.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/01-keepalive-pingreq.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/01-server-keepalive-pingreq.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/02-subscribe-qos0.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/02-subscribe-qos1.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/02-subscribe-qos2.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/02-unsubscribe-multiple-v5.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/02-unsubscribe-v5.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/02-unsubscribe.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/03-publish-b2c-qos1.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/03-publish-b2c-qos2-len.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/03-publish-b2c-qos2.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/03-publish-c2b-qos1-disconnect.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/03-publish-c2b-qos1-len.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/03-publish-c2b-qos1-receive-maximum.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc, int flags, const mosquitto_property *properties)$/;" f +on_connect test/lib/c/03-publish-c2b-qos2-disconnect.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/03-publish-c2b-qos2-len.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/03-publish-c2b-qos2-maximum-qos-0.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/03-publish-c2b-qos2-maximum-qos-1.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/03-publish-c2b-qos2-pubrec-error.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc, int flags, const mosquitto_property *properties)$/;" f +on_connect test/lib/c/03-publish-c2b-qos2-receive-maximum-1.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc, int flags, const mosquitto_property *properties)$/;" f +on_connect test/lib/c/03-publish-c2b-qos2-receive-maximum-2.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc, int flags, const mosquitto_property *properties)$/;" f +on_connect test/lib/c/03-publish-c2b-qos2.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/03-publish-qos0-no-payload.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/03-publish-qos0.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/03-request-response-1.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/03-request-response-2.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/03-request-response-correlation-1.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/04-retain-qos0.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/08-ssl-connect-cert-auth-enc.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/08-ssl-connect-cert-auth.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/08-ssl-connect-no-auth.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/08-ssl-fake-cacert.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/11-prop-oversize-packet.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/11-prop-send-content-type.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/c/11-prop-send-payload-format.c /^void on_connect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_connect test/lib/cpp/01-con-discon-success.cpp /^void mosquittopp_test::on_connect(int rc)$/;" f class:mosquittopp_test +on_connect test/lib/cpp/01-keepalive-pingreq.cpp /^void mosquittopp_test::on_connect(int rc)$/;" f class:mosquittopp_test +on_connect test/lib/cpp/02-subscribe-qos0.cpp /^void mosquittopp_test::on_connect(int rc)$/;" f class:mosquittopp_test +on_connect test/lib/cpp/02-subscribe-qos1.cpp /^void mosquittopp_test::on_connect(int rc)$/;" f class:mosquittopp_test +on_connect test/lib/cpp/02-subscribe-qos2.cpp /^void mosquittopp_test::on_connect(int rc)$/;" f class:mosquittopp_test +on_connect test/lib/cpp/02-unsubscribe.cpp /^void mosquittopp_test::on_connect(int rc)$/;" f class:mosquittopp_test +on_connect test/lib/cpp/03-publish-b2c-qos1.cpp /^void mosquittopp_test::on_connect(int rc)$/;" f class:mosquittopp_test +on_connect test/lib/cpp/03-publish-b2c-qos2.cpp /^void mosquittopp_test::on_connect(int rc)$/;" f class:mosquittopp_test +on_connect test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp /^void mosquittopp_test::on_connect(int rc)$/;" f class:mosquittopp_test +on_connect test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp /^void mosquittopp_test::on_connect(int rc)$/;" f class:mosquittopp_test +on_connect test/lib/cpp/03-publish-c2b-qos2.cpp /^void mosquittopp_test::on_connect(int rc)$/;" f class:mosquittopp_test +on_connect test/lib/cpp/03-publish-qos0-no-payload.cpp /^void mosquittopp_test::on_connect(int rc)$/;" f class:mosquittopp_test +on_connect test/lib/cpp/03-publish-qos0.cpp /^void mosquittopp_test::on_connect(int rc)$/;" f class:mosquittopp_test +on_connect test/lib/cpp/04-retain-qos0.cpp /^void mosquittopp_test::on_connect(int rc)$/;" f class:mosquittopp_test +on_connect test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp /^void mosquittopp_test::on_connect(int rc)$/;" f class:mosquittopp_test +on_connect test/lib/cpp/08-ssl-connect-cert-auth.cpp /^void mosquittopp_test::on_connect(int rc)$/;" f class:mosquittopp_test +on_connect test/lib/cpp/08-ssl-connect-no-auth.cpp /^void mosquittopp_test::on_connect(int rc)$/;" f class:mosquittopp_test +on_connect test/lib/cpp/08-ssl-fake-cacert.cpp /^void mosquittopp_test::on_connect(int rc)$/;" f class:mosquittopp_test +on_connect test/random/random_client.py /^def on_connect(client, userdata, flags, rc):$/;" f +on_connect_v5 lib/mosquitto_internal.h /^ void (*on_connect_v5)(struct mosquitto *, void *userdata, int rc, int flags, const mosquitto_property *props);$/;" m struct:mosquitto +on_connect_with_flags lib/cpp/mosquittopp.h /^ virtual void on_connect_with_flags(int \/*rc*\/, int \/*flags*\/) {return;}$/;" f +on_connect_with_flags lib/mosquitto_internal.h /^ void (*on_connect_with_flags)(struct mosquitto *, void *userdata, int rc, int flags);$/;" m struct:mosquitto +on_connect_with_flags_wrapper lib/cpp/mosquittopp.cpp /^static void on_connect_with_flags_wrapper(struct mosquitto *mosq, void *userdata, int rc, int flags)$/;" f namespace:mosqpp +on_connect_wrapper lib/cpp/mosquittopp.cpp /^static void on_connect_wrapper(struct mosquitto *mosq, void *userdata, int rc)$/;" f namespace:mosqpp +on_disconnect lib/cpp/mosquittopp.h /^ virtual void on_disconnect(int \/*rc*\/) {return;}$/;" f +on_disconnect lib/mosquitto_internal.h /^ void (*on_disconnect)(struct mosquitto *, void *userdata, int rc);$/;" m struct:mosquitto +on_disconnect test/broker/c/08-tls-psk-bridge.c /^void on_disconnect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_disconnect test/broker/c/08-tls-psk-pub.c /^void on_disconnect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_disconnect test/lib/c/01-con-discon-success.c /^void on_disconnect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_disconnect test/lib/c/02-subscribe-qos0.c /^void on_disconnect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_disconnect test/lib/c/02-subscribe-qos1.c /^void on_disconnect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_disconnect test/lib/c/02-subscribe-qos2.c /^void on_disconnect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_disconnect test/lib/c/02-unsubscribe-multiple-v5.c /^void on_disconnect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_disconnect test/lib/c/02-unsubscribe-v5.c /^void on_disconnect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_disconnect test/lib/c/02-unsubscribe.c /^void on_disconnect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_disconnect test/lib/c/03-publish-b2c-qos2-len.c /^void on_disconnect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_disconnect test/lib/c/03-publish-c2b-qos1-disconnect.c /^void on_disconnect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_disconnect test/lib/c/03-publish-c2b-qos1-len.c /^void on_disconnect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_disconnect test/lib/c/03-publish-c2b-qos2-disconnect.c /^void on_disconnect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_disconnect test/lib/c/03-publish-c2b-qos2-len.c /^void on_disconnect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_disconnect test/lib/c/03-publish-c2b-qos2-maximum-qos-0.c /^void on_disconnect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_disconnect test/lib/c/03-publish-c2b-qos2-maximum-qos-1.c /^void on_disconnect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_disconnect test/lib/c/03-publish-c2b-qos2.c /^void on_disconnect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_disconnect test/lib/c/08-ssl-connect-cert-auth-enc.c /^void on_disconnect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_disconnect test/lib/c/08-ssl-connect-cert-auth.c /^void on_disconnect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_disconnect test/lib/c/08-ssl-connect-no-auth.c /^void on_disconnect(struct mosquitto *mosq, void *obj, int rc)$/;" f +on_disconnect test/lib/cpp/01-con-discon-success.cpp /^void mosquittopp_test::on_disconnect(int rc)$/;" f class:mosquittopp_test +on_disconnect test/lib/cpp/02-subscribe-qos0.cpp /^void mosquittopp_test::on_disconnect(int rc)$/;" f class:mosquittopp_test +on_disconnect test/lib/cpp/02-subscribe-qos1.cpp /^void mosquittopp_test::on_disconnect(int rc)$/;" f class:mosquittopp_test +on_disconnect test/lib/cpp/02-subscribe-qos2.cpp /^void mosquittopp_test::on_disconnect(int rc)$/;" f class:mosquittopp_test +on_disconnect test/lib/cpp/02-unsubscribe.cpp /^void mosquittopp_test::on_disconnect(int rc)$/;" f class:mosquittopp_test +on_disconnect test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp /^void mosquittopp_test::on_disconnect(int rc)$/;" f class:mosquittopp_test +on_disconnect test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp /^void mosquittopp_test::on_disconnect(int rc)$/;" f class:mosquittopp_test +on_disconnect test/lib/cpp/03-publish-c2b-qos2.cpp /^void mosquittopp_test::on_disconnect(int rc)$/;" f class:mosquittopp_test +on_disconnect test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp /^void mosquittopp_test::on_disconnect(int rc)$/;" f class:mosquittopp_test +on_disconnect test/lib/cpp/08-ssl-connect-cert-auth.cpp /^void mosquittopp_test::on_disconnect(int rc)$/;" f class:mosquittopp_test +on_disconnect test/lib/cpp/08-ssl-connect-no-auth.cpp /^void mosquittopp_test::on_disconnect(int rc)$/;" f class:mosquittopp_test +on_disconnect test/random/random_client.py /^def on_disconnect(client, userdata, rc):$/;" f +on_disconnect_v5 lib/mosquitto_internal.h /^ void (*on_disconnect_v5)(struct mosquitto *, void *userdata, int rc, const mosquitto_property *props);$/;" m struct:mosquitto +on_disconnect_wrapper lib/cpp/mosquittopp.cpp /^static void on_disconnect_wrapper(struct mosquitto *mosq, void *userdata, int rc)$/;" f namespace:mosqpp +on_error lib/cpp/mosquittopp.h /^ virtual void on_error() {return;}$/;" f +on_log lib/cpp/mosquittopp.h /^ virtual void on_log(int \/*level*\/, const char * \/*str*\/) {return;}$/;" f +on_log lib/mosquitto_internal.h /^ void (*on_log)(struct mosquitto *, void *userdata, int level, const char *str);$/;" m struct:mosquitto +on_log test/broker/c/08-tls-psk-bridge.c /^void on_log(struct mosquitto *mosq, void *obj, int level, const char *str)$/;" f +on_log_wrapper lib/cpp/mosquittopp.cpp /^static void on_log_wrapper(struct mosquitto *mosq, void *userdata, int level, const char *str)$/;" f namespace:mosqpp +on_message examples/subscribe_simple/callback.c /^int on_message(struct mosquitto *mosq, void *userdata, const struct mosquitto_message *msg)$/;" f +on_message examples/temperature_conversion/temperature_conversion.cpp /^void mqtt_tempconv::on_message(const struct mosquitto_message *message)$/;" f class:mqtt_tempconv +on_message lib/cpp/mosquittopp.h /^ virtual void on_message(const struct mosquitto_message * \/*message*\/) {return;}$/;" f +on_message lib/mosquitto_internal.h /^ void (*on_message)(struct mosquitto *, void *userdata, const struct mosquitto_message *message);$/;" m struct:mosquitto +on_message misc/currentcost/gnome-panel/CurrentCostMQTT.py /^ def on_message(self, mosq, obj, msg):$/;" m class:CurrentCostMQTT +on_message test/lib/c/03-publish-b2c-qos1.c /^void on_message(struct mosquitto *mosq, void *obj, const struct mosquitto_message *msg)$/;" f +on_message test/lib/c/03-publish-b2c-qos2-len.c /^void on_message(struct mosquitto *mosq, void *obj, const struct mosquitto_message *msg)$/;" f +on_message test/lib/c/03-publish-b2c-qos2.c /^void on_message(struct mosquitto *mosq, void *obj, const struct mosquitto_message *msg)$/;" f +on_message test/lib/c/03-request-response-1.c /^void on_message(struct mosquitto *mosq, void *obj, const struct mosquitto_message *msg)$/;" f +on_message test/lib/c/03-request-response-correlation-1.c /^void on_message(struct mosquitto *mosq, void *obj, const struct mosquitto_message *msg)$/;" f +on_message test/lib/cpp/03-publish-b2c-qos1.cpp /^void mosquittopp_test::on_message(const struct mosquitto_message *msg)$/;" f class:mosquittopp_test +on_message test/lib/cpp/03-publish-b2c-qos2.cpp /^void mosquittopp_test::on_message(const struct mosquitto_message *msg)$/;" f class:mosquittopp_test +on_message test/random/random_client.py /^def on_message(client, userdata, msg):$/;" f +on_message_callback lib/helpers.c /^static void on_message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message)$/;" f file: +on_message_simple lib/helpers.c /^static int on_message_simple(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message)$/;" f file: +on_message_v5 lib/mosquitto_internal.h /^ void (*on_message_v5)(struct mosquitto *, void *userdata, const struct mosquitto_message *message, const mosquitto_property *props);$/;" m struct:mosquitto +on_message_v5 test/lib/c/03-request-response-2.c /^void on_message_v5(struct mosquitto *mosq, void *obj, const struct mosquitto_message *msg, const mosquitto_property *props)$/;" f +on_message_wrapper lib/cpp/mosquittopp.cpp /^static void on_message_wrapper(struct mosquitto *mosq, void *userdata, const struct mosquitto_message *message)$/;" f namespace:mosqpp +on_publish lib/cpp/mosquittopp.h /^ virtual void on_publish(int \/*mid*\/) {return;}$/;" f +on_publish lib/mosquitto_internal.h /^ void (*on_publish)(struct mosquitto *, void *userdata, int mid);$/;" m struct:mosquitto +on_publish test/broker/c/08-tls-psk-bridge.c /^void on_publish(struct mosquitto *mosq, void *obj, int mid)$/;" f +on_publish test/broker/c/08-tls-psk-pub.c /^void on_publish(struct mosquitto *mosq, void *obj, int mid)$/;" f +on_publish test/lib/c/03-publish-c2b-qos1-disconnect.c /^void on_publish(struct mosquitto *mosq, void *obj, int mid)$/;" f +on_publish test/lib/c/03-publish-c2b-qos1-len.c /^void on_publish(struct mosquitto *mosq, void *obj, int mid)$/;" f +on_publish test/lib/c/03-publish-c2b-qos1-receive-maximum.c /^void on_publish(struct mosquitto *mosq, void *obj, int mid, int reason_code, const mosquitto_property *properties)$/;" f +on_publish test/lib/c/03-publish-c2b-qos2-disconnect.c /^void on_publish(struct mosquitto *mosq, void *obj, int mid)$/;" f +on_publish test/lib/c/03-publish-c2b-qos2-len.c /^void on_publish(struct mosquitto *mosq, void *obj, int mid, int reason_code, const mosquitto_property *properties)$/;" f +on_publish test/lib/c/03-publish-c2b-qos2-maximum-qos-0.c /^void on_publish(struct mosquitto *mosq, void *obj, int mid)$/;" f +on_publish test/lib/c/03-publish-c2b-qos2-maximum-qos-1.c /^void on_publish(struct mosquitto *mosq, void *obj, int mid)$/;" f +on_publish test/lib/c/03-publish-c2b-qos2-pubrec-error.c /^void on_publish(struct mosquitto *mosq, void *obj, int mid, int reason_code, const mosquitto_property *properties)$/;" f +on_publish test/lib/c/03-publish-c2b-qos2-receive-maximum-1.c /^void on_publish(struct mosquitto *mosq, void *obj, int mid, int reason_code, const mosquitto_property *properties)$/;" f +on_publish test/lib/c/03-publish-c2b-qos2-receive-maximum-2.c /^void on_publish(struct mosquitto *mosq, void *obj, int mid, int reason_code, const mosquitto_property *properties)$/;" f +on_publish test/lib/c/03-publish-c2b-qos2.c /^void on_publish(struct mosquitto *mosq, void *obj, int mid)$/;" f +on_publish test/lib/c/03-publish-qos0-no-payload.c /^void on_publish(struct mosquitto *mosq, void *obj, int mid)$/;" f +on_publish test/lib/c/03-publish-qos0.c /^void on_publish(struct mosquitto *mosq, void *obj, int mid)$/;" f +on_publish test/lib/c/03-request-response-2.c /^void on_publish(struct mosquitto *mosq, void *obj, int mid)$/;" f +on_publish test/lib/c/11-prop-oversize-packet.c /^void on_publish(struct mosquitto *mosq, void *obj, int mid)$/;" f +on_publish test/lib/c/11-prop-send-content-type.c /^void on_publish(struct mosquitto *mosq, void *obj, int mid)$/;" f +on_publish test/lib/c/11-prop-send-payload-format.c /^void on_publish(struct mosquitto *mosq, void *obj, int mid)$/;" f +on_publish test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp /^void mosquittopp_test::on_publish(int mid)$/;" f class:mosquittopp_test +on_publish test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp /^void mosquittopp_test::on_publish(int mid)$/;" f class:mosquittopp_test +on_publish test/lib/cpp/03-publish-c2b-qos2.cpp /^void mosquittopp_test::on_publish(int mid)$/;" f class:mosquittopp_test +on_publish test/lib/cpp/03-publish-qos0-no-payload.cpp /^void mosquittopp_test::on_publish(int mid)$/;" f class:mosquittopp_test +on_publish test/lib/cpp/03-publish-qos0.cpp /^void mosquittopp_test::on_publish(int mid)$/;" f class:mosquittopp_test +on_publish test/random/random_client.py /^def on_publish(client, userdata, mid):$/;" f +on_publish_v5 lib/mosquitto_internal.h /^ void (*on_publish_v5)(struct mosquitto *, void *userdata, int mid, int reason_code, const mosquitto_property *props);$/;" m struct:mosquitto +on_publish_wrapper lib/cpp/mosquittopp.cpp /^static void on_publish_wrapper(struct mosquitto *mosq, void *userdata, int mid)$/;" f namespace:mosqpp +on_subscribe examples/temperature_conversion/temperature_conversion.cpp /^void mqtt_tempconv::on_subscribe(int mid, int qos_count, const int *granted_qos)$/;" f class:mqtt_tempconv +on_subscribe lib/cpp/mosquittopp.h /^ virtual void on_subscribe(int \/*mid*\/, int \/*qos_count*\/, const int * \/*granted_qos*\/) {return;}$/;" f +on_subscribe lib/mosquitto_internal.h /^ void (*on_subscribe)(struct mosquitto *, void *userdata, int mid, int qos_count, const int *granted_qos);$/;" m struct:mosquitto +on_subscribe test/lib/c/02-subscribe-qos0.c /^void on_subscribe(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos)$/;" f +on_subscribe test/lib/c/02-subscribe-qos1.c /^void on_subscribe(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos)$/;" f +on_subscribe test/lib/c/02-subscribe-qos2.c /^void on_subscribe(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos)$/;" f +on_subscribe test/lib/c/02-unsubscribe-multiple-v5.c /^void on_subscribe(struct mosquitto *mosq, void *obj, int mid, int sub_count, const int *subs)$/;" f +on_subscribe test/lib/c/03-request-response-1.c /^void on_subscribe(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos)$/;" f +on_subscribe test/lib/c/03-request-response-correlation-1.c /^void on_subscribe(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos)$/;" f +on_subscribe test/lib/cpp/02-subscribe-qos0.cpp /^void mosquittopp_test::on_subscribe(int mid, int qos_count, const int *granted_qos)$/;" f class:mosquittopp_test +on_subscribe test/lib/cpp/02-subscribe-qos1.cpp /^void mosquittopp_test::on_subscribe(int mid, int qos_count, const int *granted_qos)$/;" f class:mosquittopp_test +on_subscribe test/lib/cpp/02-subscribe-qos2.cpp /^void mosquittopp_test::on_subscribe(int mid, int qos_count, const int *granted_qos)$/;" f class:mosquittopp_test +on_subscribe_v5 lib/mosquitto_internal.h /^ void (*on_subscribe_v5)(struct mosquitto *, void *userdata, int mid, int qos_count, const int *granted_qos, const mosquitto_property *props);$/;" m struct:mosquitto +on_subscribe_wrapper lib/cpp/mosquittopp.cpp /^static void on_subscribe_wrapper(struct mosquitto *mosq, void *userdata, int mid, int qos_count, const int *granted_qos)$/;" f namespace:mosqpp +on_unsubscribe lib/cpp/mosquittopp.h /^ virtual void on_unsubscribe(int \/*mid*\/) {return;}$/;" f +on_unsubscribe lib/mosquitto_internal.h /^ void (*on_unsubscribe)(struct mosquitto *, void *userdata, int mid);$/;" m struct:mosquitto +on_unsubscribe test/lib/c/02-unsubscribe-multiple-v5.c /^void on_unsubscribe(struct mosquitto *mosq, void *obj, int mid)$/;" f +on_unsubscribe test/lib/c/02-unsubscribe-v5.c /^void on_unsubscribe(struct mosquitto *mosq, void *obj, int mid)$/;" f +on_unsubscribe test/lib/c/02-unsubscribe.c /^void on_unsubscribe(struct mosquitto *mosq, void *obj, int mid)$/;" f +on_unsubscribe test/lib/cpp/02-unsubscribe.cpp /^void mosquittopp_test::on_unsubscribe(int mid)$/;" f class:mosquittopp_test +on_unsubscribe_v5 lib/mosquitto_internal.h /^ void (*on_unsubscribe_v5)(struct mosquitto *, void *userdata, int mid, const mosquitto_property *props);$/;" m struct:mosquitto +on_unsubscribe_wrapper lib/cpp/mosquittopp.cpp /^static void on_unsubscribe_wrapper(struct mosquitto *mosq, void *userdata, int mid)$/;" f namespace:mosqpp +opt lib/net_mosq.c /^ int opt;$/;" l +option_count src/mosquitto_broker_internal.h /^ int option_count;$/;" m struct:mosquitto__auth_plugin_config +options src/mosquitto_broker_internal.h /^ struct mosquitto_opt *options;$/;" m struct:mosquitto__auth_plugin_config typeref:struct:mosquitto__auth_plugin_config::mosquitto_opt +options src/persist.h /^ uint8_t options;$/;" m struct:PF_sub +opts src/security.c /^ struct mosquitto__security_options *opts;$/;" l +opts_set lib/cpp/mosquittopp.cpp /^int mosquittopp::opts_set(enum mosq_opt_t option, void *value)$/;" f class:mosqpp::mosquittopp +origin src/database.c /^ enum mosquitto_msg_origin origin;$/;" l +origin src/mosquitto_broker_internal.h /^ uint8_t origin;$/;" m struct:mosquitto_msg_store +origsig src/loop.c /^ sigset_t sigblock, origsig;$/;" l +out_packet lib/mosquitto_internal.h /^ struct mosquitto__packet *out_packet;$/;" m struct:mosquitto typeref:struct:mosquitto::mosquitto__packet +out_packet_last lib/mosquitto_internal.h /^ struct mosquitto__packet *out_packet_last;$/;" m struct:mosquitto typeref:struct:mosquitto::mosquitto__packet +out_packet_mutex lib/mosquitto_internal.h /^ pthread_mutex_t out_packet_mutex;$/;" m struct:mosquitto +outfile src/persist_write.c /^ char *outfile = NULL;$/;" l +outgoing_properties lib/actions.c /^ const mosquitto_property *outgoing_properties = NULL;$/;" l +outgoing_properties lib/connect.c /^ const mosquitto_property *outgoing_properties = NULL;$/;" l +output_new_password src/mosquitto_passwd.c /^int output_new_password(FILE *fptr, const char *username, const char *password)$/;" f +p lib/actions.c /^ const mosquitto_property *p;$/;" l +p lib/net_mosq_ocsp.c /^ unsigned char *p;$/;" l +p lib/property_mosq.c /^ const mosquitto_property *p, *tail;$/;" l +p lib/property_mosq.c /^ const mosquitto_property *p;$/;" l +p lib/property_mosq.c /^ mosquitto_property *p, *next;$/;" l +p lib/property_mosq.c /^ mosquitto_property *p, *tail = NULL;$/;" l +p lib/property_mosq.c /^ mosquitto_property *p;$/;" l +p lib/will_mosq.c /^ mosquitto_property *p;$/;" l +p src/handle_publish.c /^ mosquitto_property *p, *p_prev;$/;" l +p src/property_broker.c /^ mosquitto_property *p, *p_prev;$/;" l +p src/property_broker.c /^ mosquitto_property *p;$/;" l +p src/websockets.c /^ const struct libwebsocket_protocols *p;$/;" l +p src/websockets.c /^ struct libwebsocket_protocols *p;$/;" l +p test/broker/02-subpub-qos1-bad-pubcomp.py /^ p = sock.recv(len(pingresp_packet))$/;" v +p test/broker/02-subpub-qos1-bad-pubrec.py /^ p = sock.recv(len(pingresp_packet))$/;" v +p test/broker/02-subpub-qos2-bad-puback-1.py /^ p = sock.recv(len(pingresp_packet))$/;" v +p test/broker/02-subpub-qos2-bad-puback-2.py /^ p = sock.recv(len(pingresp_packet))$/;" v +p test/broker/02-subpub-qos2-bad-pubcomp.py /^ p = sock.recv(len(pingresp_packet))$/;" v +p test/random/random_client.py /^p = random.choice(ports)$/;" v +p test/unit/property_add.c /^ mosquitto_property *p;$/;" l +p test/unit/property_read.c /^ mosquitto_property *properties, *p;$/;" l +p_corr test/lib/c/03-request-response-2.c /^ const mosquitto_property *p_resp, *p_corr = NULL;$/;" l +p_prev src/handle_publish.c /^ mosquitto_property *p, *p_prev;$/;" l +p_prev src/property_broker.c /^ mosquitto_property *p, *p_prev;$/;" l +p_resp test/lib/c/03-request-response-2.c /^ const mosquitto_property *p_resp, *p_corr = NULL;$/;" l +pack_remaining_length test/mosq_test.py /^def pack_remaining_length(remaining_length):$/;" f +pack_varint test/mqtt5_props.py /^def pack_varint(varint):$/;" f +packet lib/connect.c /^ struct mosquitto__packet *packet;$/;" l +packet lib/mosquitto.c /^ struct mosquitto__packet *packet;$/;" l +packet lib/packet_mosq.c /^ struct mosquitto__packet *packet;$/;" l +packet lib/send_connect.c /^ struct mosquitto__packet *packet = NULL;$/;" l +packet lib/send_disconnect.c /^ struct mosquitto__packet *packet = NULL;$/;" l +packet lib/send_mosq.c /^ struct mosquitto__packet *packet = NULL;$/;" l +packet lib/send_publish.c /^ struct mosquitto__packet *packet = NULL;$/;" l +packet lib/send_subscribe.c /^ struct mosquitto__packet *packet = NULL;$/;" l +packet lib/send_unsubscribe.c /^ struct mosquitto__packet *packet = NULL;$/;" l +packet lib/socks_mosq.c /^ struct mosquitto__packet *packet;$/;" l +packet src/bridge.c /^ struct mosquitto__packet *packet;$/;" l +packet src/context.c /^ struct mosquitto__packet *packet;$/;" l +packet src/send_auth.c /^ struct mosquitto__packet *packet = NULL;$/;" l +packet src/send_connack.c /^ struct mosquitto__packet *packet = NULL;$/;" l +packet src/send_suback.c /^ struct mosquitto__packet *packet = NULL;$/;" l +packet src/send_unsuback.c /^ struct mosquitto__packet *packet = NULL;$/;" l +packet src/websockets.c /^ struct mosquitto__packet *packet;$/;" l +packet test/broker/02-subpub-qos1-message-expiry-will.py /^ packet = sock.recv(len(publish2s_packet))$/;" v +packet test/broker/02-subpub-qos1-message-expiry.py /^ packet = sock.recv(len(publish2s_packet))$/;" v +packet test/unit/datatype_read.c /^ struct mosquitto__packet packet;$/;" l +packet test/unit/datatype_write.c /^ struct mosquitto__packet packet;$/;" l +packet test/unit/property_read.c /^ struct mosquitto__packet packet;$/;" l +packet test/unit/property_write.c /^ struct mosquitto__packet packet;$/;" l +packet__alloc lib/packet_mosq.c /^int packet__alloc(struct mosquitto__packet *packet)$/;" f +packet__check_oversize lib/packet_mosq.c /^int packet__check_oversize(struct mosquitto *mosq, uint32_t remaining_length)$/;" f +packet__cleanup lib/packet_mosq.c /^void packet__cleanup(struct mosquitto__packet *packet)$/;" f +packet__queue lib/packet_mosq.c /^int packet__queue(struct mosquitto *mosq, struct mosquitto__packet *packet)$/;" f +packet__read lib/packet_mosq.c /^int packet__read(struct mosquitto_db *db, struct mosquitto *mosq)$/;" f +packet__read_binary lib/packet_datatypes.c /^int packet__read_binary(struct mosquitto__packet *packet, uint8_t **data, int *length)$/;" f +packet__read_byte lib/packet_datatypes.c /^int packet__read_byte(struct mosquitto__packet *packet, uint8_t *byte)$/;" f +packet__read_bytes lib/packet_datatypes.c /^int packet__read_bytes(struct mosquitto__packet *packet, void *bytes, uint32_t count)$/;" f +packet__read_string lib/packet_datatypes.c /^int packet__read_string(struct mosquitto__packet *packet, char **str, int *length)$/;" f +packet__read_uint16 lib/packet_datatypes.c /^int packet__read_uint16(struct mosquitto__packet *packet, uint16_t *word)$/;" f +packet__read_uint32 lib/packet_datatypes.c /^int packet__read_uint32(struct mosquitto__packet *packet, uint32_t *word)$/;" f +packet__read_varint lib/packet_datatypes.c /^int packet__read_varint(struct mosquitto__packet *packet, int32_t *word, int8_t *bytes)$/;" f +packet__varint_bytes lib/packet_datatypes.c /^int packet__varint_bytes(int32_t word)$/;" f +packet__write lib/packet_mosq.c /^int packet__write(struct mosquitto *mosq)$/;" f +packet__write_byte lib/packet_datatypes.c /^void packet__write_byte(struct mosquitto__packet *packet, uint8_t byte)$/;" f +packet__write_bytes lib/packet_datatypes.c /^void packet__write_bytes(struct mosquitto__packet *packet, const void *bytes, uint32_t count)$/;" f +packet__write_string lib/packet_datatypes.c /^void packet__write_string(struct mosquitto__packet *packet, const char *str, uint16_t length)$/;" f +packet__write_uint16 lib/packet_datatypes.c /^void packet__write_uint16(struct mosquitto__packet *packet, uint16_t word)$/;" f +packet__write_uint32 lib/packet_datatypes.c /^void packet__write_uint32(struct mosquitto__packet *packet, uint32_t word)$/;" f +packet__write_varint lib/packet_datatypes.c /^int packet__write_varint(struct mosquitto__packet *packet, int32_t word)$/;" f +packet_helper_reason_string_user_property test/unit/property_read.c /^static void packet_helper_reason_string_user_property(int command)$/;" f file: +packet_length lib/mosquitto_internal.h /^ uint32_t packet_length;$/;" m struct:mosquitto__packet +packet_matches test/mosq_test.py /^def packet_matches(name, recvd, expected):$/;" f +packetlen lib/send_publish.c /^ int packetlen;$/;" l +packetlen lib/send_subscribe.c /^ uint32_t packetlen;$/;" l +packetlen lib/send_unsubscribe.c /^ uint32_t packetlen;$/;" l +pacl lib/util_mosq.c /^ PACL pacl = NULL;$/;" l +pairbuf lib/loop.c /^ char pairbuf;$/;" l +parent src/mosquitto_broker_internal.h /^ struct mosquitto__subhier *parent;$/;" m struct:mosquitto__subhier typeref:struct:mosquitto__subhier::mosquitto__subhier +parent src/subs.c /^ struct mosquitto__subhier *parent;$/;" l +password client/client_shared.c /^ char *username = NULL, *password = NULL, *host = NULL, *port = NULL;$/;" l +password client/client_shared.h /^ char *password;$/;" m struct:mosq_config +password lib/mosquitto.h /^ char *password;$/;" m struct:libmosquitto_auth +password lib/mosquitto_internal.h /^ char *password;$/;" m struct:mosquitto +password lib/send_connect.c /^ char *clientid, *username, *password;$/;" l +password src/handle_connect.c /^ char *username = NULL, *password = NULL;$/;" l +password src/mosquitto_broker_internal.h /^ char *password;$/;" m struct:mosquitto__unpwd +password src/mosquitto_passwd.c /^ char *username, *password;$/;" l +password src/mosquitto_passwd.c /^ char password[MAX_BUFFER_LEN];$/;" l +password src/security_default.c /^ char *username, *password;$/;" l +password src/security_default.c /^ unsigned char *password;$/;" l +password_callback test/lib/c/08-ssl-connect-cert-auth-enc.c /^static int password_callback(char* buf, int size, int rwflag, void* userdata)$/;" f file: +password_callback test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp /^static int password_callback(char* buf, int size, int rwflag, void* userdata)$/;" f file: +password_cmd src/mosquitto_passwd.c /^ char *password_cmd = NULL;$/;" l +password_file src/mosquitto_broker_internal.h /^ char *password_file;$/;" m struct:mosquitto__security_options +password_file src/mosquitto_passwd.c /^ char *password_file = NULL;$/;" l +password_file_tmp src/mosquitto_passwd.c /^ char *password_file_tmp = NULL;$/;" l +password_flag src/handle_connect.c /^ uint8_t username_flag, password_flag;$/;" l +password_len src/mosquitto_broker_internal.h /^ unsigned int password_len;$/;" m struct:mosquitto__unpwd +password_len src/security_default.c /^ unsigned int password_len;$/;" l +path src/mosquitto_broker_internal.h /^ char *path;$/;" m struct:mosquitto__auth_plugin_config +pattern_test test/broker/03-pattern-matching.py /^def pattern_test(sub_topic, pub_topic):$/;" f +payload lib/mosquitto.h /^ void *payload;$/;" m struct:libmosquitto_will +payload lib/mosquitto.h /^ void *payload;$/;" m struct:mosquitto_message +payload lib/mosquitto_internal.h /^ uint8_t *payload;$/;" m struct:mosquitto__packet +payload lib/socks_mosq.c /^ uint8_t *payload;$/;" l +payload src/database.c /^ const void *payload;$/;" l +payload src/database.c /^ memcpy(UHPA_ACCESS(payload_uhpa, payloadlen), payload, payloadlen);$/;" l +payload src/db_dump/db_dump.c /^ uint8_t *payload;$/;" m struct:db_msg file: +payload src/handle_publish.c /^ mosquitto__payload_uhpa payload;$/;" l +payload src/handle_subscribe.c /^ uint8_t *payload = NULL, *tmp_payload;$/;" l +payload src/mosquitto_broker_internal.h /^ mosquitto__payload_uhpa payload;$/;" m struct:mosquitto_msg_store +payload src/mosquitto_plugin.h /^ const void *payload;$/;" m struct:mosquitto_acl_msg +payload src/persist.h /^ mosquitto__payload_uhpa payload;$/;" m struct:P_msg_store +payload test/unit/datatype_read.c /^ uint8_t payload[20];$/;" l +payload test/unit/datatype_write.c /^ uint8_t *payload;$/;" l +payload test/unit/datatype_write.c /^ uint8_t payload[100];$/;" l +payload test/unit/datatype_write.c /^ uint8_t payload[260];$/;" l +payload test/unit/datatype_write.c /^ uint8_t payload[650];$/;" l +payload test/unit/property_read.c /^ uint8_t payload[20];$/;" l +payload test/unit/property_read.c /^ uint8_t payload[24] = {23,$/;" l +payload test/unit/property_read.c /^ uint8_t payload[5];$/;" l +payload test/unit/property_read.c /^ uint8_t payload[] = {0,$/;" l +payload test/unit/property_write.c /^ uint8_t payload[10];$/;" l +payload test/unit/property_write.c /^ uint8_t payload[5] = {1, 'e', 0, 'l', 9};$/;" l +payload16 test/unit/datatype_write.c /^ uint16_t *payload16;$/;" l +payload32 test/unit/datatype_write.c /^ uint32_t *payload32;$/;" l +payload_uhpa src/database.c /^ mosquitto__payload_uhpa payload_uhpa;$/;" l +payloadlen lib/mosquitto.h /^ int payloadlen;$/;" m struct:libmosquitto_will +payloadlen lib/mosquitto.h /^ int payloadlen;$/;" m struct:mosquitto_message +payloadlen lib/send_connect.c /^ int payloadlen;$/;" l +payloadlen src/database.c /^ memcpy(UHPA_ACCESS(payload_uhpa, payloadlen), payload, payloadlen);$/;" l +payloadlen src/database.c /^ uint32_t payloadlen;$/;" l +payloadlen src/db_dump/db_dump.c /^ uint32_t payloadlen;$/;" m struct:db_msg file: +payloadlen src/handle_connect.c /^ uint16_t payloadlen;$/;" l +payloadlen src/handle_publish.c /^ uint32_t payloadlen;$/;" l +payloadlen src/handle_subscribe.c /^ uint32_t payloadlen = 0;$/;" l +payloadlen src/mosquitto_broker_internal.h /^ uint32_t payloadlen;$/;" m struct:mosquitto_msg_store +payloadlen src/mosquitto_plugin.h /^ long payloadlen;$/;" m struct:mosquitto_acl_msg +payloadlen src/persist.h /^ uint32_t payloadlen;$/;" m struct:PF_msg_store +payloadlen src/persist_write_v5.c /^ uint32_t payloadlen = chunk->F.payloadlen;$/;" l +peer src/database.c /^ struct mosquitto__subhier *peer, *subhier_tmp;$/;" l +per_listener_settings src/mosquitto_broker_internal.h /^ bool per_listener_settings;$/;" m struct:mosquitto__config +persist__backup src/persist_write.c /^int persist__backup(struct mosquitto_db *db, bool shutdown)$/;" f +persist__chunk_cfg_read_v234 src/persist_read_v234.c /^int persist__chunk_cfg_read_v234(FILE *db_fptr, struct PF_cfg *chunk)$/;" f +persist__chunk_cfg_read_v5 src/persist_read_v5.c /^int persist__chunk_cfg_read_v5(FILE *db_fptr, struct PF_cfg *chunk)$/;" f +persist__chunk_cfg_write_v5 src/persist_write_v5.c /^int persist__chunk_cfg_write_v5(FILE *db_fptr, struct PF_cfg *chunk)$/;" f +persist__chunk_client_msg_read_v234 src/persist_read_v234.c /^int persist__chunk_client_msg_read_v234(FILE *db_fptr, struct P_client_msg *chunk)$/;" f +persist__chunk_client_msg_read_v5 src/persist_read_v5.c /^int persist__chunk_client_msg_read_v5(FILE *db_fptr, struct P_client_msg *chunk, uint32_t length)$/;" f +persist__chunk_client_msg_write_v5 src/persist_write_v5.c /^int persist__chunk_client_msg_write_v5(FILE *db_fptr, struct P_client_msg *chunk)$/;" f +persist__chunk_client_read_v234 src/persist_read_v234.c /^int persist__chunk_client_read_v234(FILE *db_fptr, struct P_client *chunk, int db_version)$/;" f +persist__chunk_client_read_v5 src/persist_read_v5.c /^int persist__chunk_client_read_v5(FILE *db_fptr, struct P_client *chunk)$/;" f +persist__chunk_client_write_v5 src/persist_write_v5.c /^int persist__chunk_client_write_v5(FILE *db_fptr, struct P_client *chunk)$/;" f +persist__chunk_header_read src/persist_read.c /^int persist__chunk_header_read(FILE *db_fptr, int *chunk, int *length)$/;" f +persist__chunk_header_read_v234 src/persist_read_v234.c /^int persist__chunk_header_read_v234(FILE *db_fptr, int *chunk, int *length)$/;" f +persist__chunk_header_read_v5 src/persist_read_v5.c /^int persist__chunk_header_read_v5(FILE *db_fptr, int *chunk, int *length)$/;" f +persist__chunk_message_store_write_v5 src/persist_write_v5.c /^int persist__chunk_message_store_write_v5(FILE *db_fptr, struct P_msg_store *chunk)$/;" f +persist__chunk_msg_store_read_v234 src/persist_read_v234.c /^int persist__chunk_msg_store_read_v234(FILE *db_fptr, struct P_msg_store *chunk, int db_version)$/;" f +persist__chunk_msg_store_read_v5 src/persist_read_v5.c /^int persist__chunk_msg_store_read_v5(FILE *db_fptr, struct P_msg_store *chunk, uint32_t length)$/;" f +persist__chunk_retain_read_v234 src/persist_read_v234.c /^int persist__chunk_retain_read_v234(FILE *db_fptr, struct P_retain *chunk)$/;" f +persist__chunk_retain_read_v5 src/persist_read_v5.c /^int persist__chunk_retain_read_v5(FILE *db_fptr, struct P_retain *chunk)$/;" f +persist__chunk_retain_write_v5 src/persist_write_v5.c /^int persist__chunk_retain_write_v5(FILE *db_fptr, struct P_retain *chunk)$/;" f +persist__chunk_sub_read_v234 src/persist_read_v234.c /^int persist__chunk_sub_read_v234(FILE *db_fptr, struct P_sub *chunk)$/;" f +persist__chunk_sub_read_v5 src/persist_read_v5.c /^int persist__chunk_sub_read_v5(FILE *db_fptr, struct P_sub *chunk)$/;" f +persist__chunk_sub_write_v5 src/persist_write_v5.c /^int persist__chunk_sub_write_v5(FILE *db_fptr, struct P_sub *chunk)$/;" f +persist__client_chunk_restore src/persist_read.c /^static int persist__client_chunk_restore(struct mosquitto_db *db, FILE *db_fptr)$/;" f file: +persist__client_messages_save src/persist_write.c /^static int persist__client_messages_save(struct mosquitto_db *db, FILE *db_fptr, struct mosquitto *context, struct mosquitto_client_msg *queue)$/;" f file: +persist__client_msg_chunk_restore src/persist_read.c /^static int persist__client_msg_chunk_restore(struct mosquitto_db *db, FILE *db_fptr, uint32_t length)$/;" f file: +persist__client_msg_restore src/persist_read.c /^static int persist__client_msg_restore(struct mosquitto_db *db, struct P_client_msg *chunk)$/;" f file: +persist__client_save src/persist_write.c /^static int persist__client_save(struct mosquitto_db *db, FILE *db_fptr)$/;" f file: +persist__find_or_add_context src/persist_read.c /^static struct mosquitto *persist__find_or_add_context(struct mosquitto_db *db, const char *client_id, uint16_t last_mid)$/;" f file: +persist__message_store_save src/persist_write.c /^static int persist__message_store_save(struct mosquitto_db *db, FILE *db_fptr)$/;" f file: +persist__msg_store_chunk_restore src/persist_read.c /^static int persist__msg_store_chunk_restore(struct mosquitto_db *db, FILE *db_fptr, uint32_t length)$/;" f file: +persist__read_string src/db_dump/db_dump.c /^int persist__read_string(FILE *db_fptr, char **str)$/;" f +persist__read_string src/persist_read.c /^int persist__read_string(FILE *db_fptr, char **str)$/;" f +persist__read_string_len src/persist_read.c /^int persist__read_string_len(FILE *db_fptr, char **str, uint16_t len)$/;" f +persist__restore src/persist_read.c /^int persist__restore(struct mosquitto_db *db)$/;" f +persist__restore_sub src/persist_read.c /^static int persist__restore_sub(struct mosquitto_db *db, const char *client_id, const char *sub, int qos, uint32_t identifier, int options)$/;" f file: +persist__retain_chunk_restore src/persist_read.c /^static int persist__retain_chunk_restore(struct mosquitto_db *db, FILE *db_fptr)$/;" f file: +persist__sub_chunk_restore src/persist_read.c /^static int persist__sub_chunk_restore(struct mosquitto_db *db, FILE *db_fptr)$/;" f file: +persist__subs_retain_save src/persist_write.c /^static int persist__subs_retain_save(struct mosquitto_db *db, FILE *db_fptr, struct mosquitto__subhier *node, const char *topic, int level)$/;" f file: +persist__subs_retain_save_all src/persist_write.c /^static int persist__subs_retain_save_all(struct mosquitto_db *db, FILE *db_fptr)$/;" f file: +persistence src/mosquitto_broker_internal.h /^ bool persistence;$/;" m struct:mosquitto__config +persistence_changes src/mosquitto_broker_internal.h /^ int persistence_changes;$/;" m struct:mosquitto_db +persistence_file src/mosquitto_broker_internal.h /^ char *persistence_file;$/;" m struct:mosquitto__config +persistence_file test/broker/06-bridge-b2br-late-connection-retain.py /^persistence_file = os.path.basename(__file__).replace('.py', '.db')$/;" v +persistence_filepath src/mosquitto_broker_internal.h /^ char *persistence_filepath;$/;" m struct:mosquitto__config +persistence_location src/mosquitto_broker_internal.h /^ char *persistence_location;$/;" m struct:mosquitto__config +persistent_client_expiration src/mosquitto_broker_internal.h /^ time_t persistent_client_expiration;$/;" m struct:mosquitto__config +pid src/mosquitto.c /^ FILE *pid;$/;" l +pid src/mosquitto.c /^ pid_t pid;$/;" l +pid src/signals.c /^ int pid = GetCurrentProcessId();$/;" l +pid_file src/mosquitto_broker_internal.h /^ char *pid_file;$/;" m struct:mosquitto__config +ping_t lib/mosquitto_internal.h /^ time_t ping_t;$/;" m struct:mosquitto +pingreq_packet test/broker/02-subpub-qos1-bad-pubcomp.py /^pingreq_packet = mosq_test.gen_pingreq()$/;" v +pingreq_packet test/broker/02-subpub-qos1-bad-pubrec.py /^pingreq_packet = mosq_test.gen_pingreq()$/;" v +pingreq_packet test/broker/02-subpub-qos2-bad-puback-1.py /^pingreq_packet = mosq_test.gen_pingreq()$/;" v +pingreq_packet test/broker/02-subpub-qos2-bad-puback-2.py /^pingreq_packet = mosq_test.gen_pingreq()$/;" v +pingreq_packet test/broker/02-subpub-qos2-bad-pubcomp.py /^pingreq_packet = mosq_test.gen_pingreq()$/;" v +pingreq_packet test/lib/01-keepalive-pingreq.py /^pingreq_packet = mosq_test.gen_pingreq()$/;" v +pingreq_packet test/lib/01-server-keepalive-pingreq.py /^pingreq_packet = mosq_test.gen_pingreq()$/;" v +pingresp_packet test/broker/02-subpub-qos1-bad-pubcomp.py /^pingresp_packet = mosq_test.gen_pingresp()$/;" v +pingresp_packet test/broker/02-subpub-qos1-bad-pubrec.py /^pingresp_packet = mosq_test.gen_pingresp()$/;" v +pingresp_packet test/broker/02-subpub-qos2-bad-puback-1.py /^pingresp_packet = mosq_test.gen_pingresp()$/;" v +pingresp_packet test/broker/02-subpub-qos2-bad-puback-2.py /^pingresp_packet = mosq_test.gen_pingresp()$/;" v +pingresp_packet test/broker/02-subpub-qos2-bad-pubcomp.py /^pingresp_packet = mosq_test.gen_pingresp()$/;" v +pingresp_packet test/lib/01-keepalive-pingreq.py /^pingresp_packet = mosq_test.gen_pingresp()$/;" v +pingresp_packet test/lib/01-server-keepalive-pingreq.py /^pingresp_packet = mosq_test.gen_pingresp()$/;" v +pkey lib/net_mosq.c /^ EVP_PKEY *pkey = ENGINE_load_private_key(engine, mosq->tls_keyfile, ui_method, NULL);$/;" l +pkey src/net.c /^ EVP_PKEY *pkey = ENGINE_load_private_key(engine, listener->keyfile, ui_method, NULL);$/;" l +plast lib/property_mosq.c /^ mosquitto_property *pnew, *plast = NULL;$/;" l +plen lib/socks_mosq.c /^ int ulen, plen;$/;" l +plug src/conf.c /^ struct mosquitto__auth_plugin_config *plug;$/;" l +plugin src/conf.c /^ struct mosquitto__auth_plugin *plugin;$/;" l +plugin src/mosquitto_broker_internal.h /^ struct mosquitto__auth_plugin plugin;$/;" m struct:mosquitto__auth_plugin_config typeref:struct:mosquitto__auth_plugin_config::mosquitto__auth_plugin +plugin_cleanup_v2 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_cleanup_v2 plugin_cleanup_v2;$/;" m struct:mosquitto__auth_plugin +plugin_cleanup_v3 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_cleanup_v3 plugin_cleanup_v3;$/;" m struct:mosquitto__auth_plugin +plugin_cleanup_v4 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_cleanup_v4 plugin_cleanup_v4;$/;" m struct:mosquitto__auth_plugin +plugin_init_v2 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_init_v2 plugin_init_v2;$/;" m struct:mosquitto__auth_plugin +plugin_init_v3 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_init_v3 plugin_init_v3;$/;" m struct:mosquitto__auth_plugin +plugin_init_v4 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_init_v4 plugin_init_v4;$/;" m struct:mosquitto__auth_plugin +plugin_version src/mosquitto_broker_internal.h /^ int (*plugin_version)(void);$/;" m struct:mosquitto__auth_plugin +pnew lib/property_mosq.c /^ mosquitto_property *pnew, *plast = NULL;$/;" l +pollargs src/websockets.c /^ struct lws_pollargs *pollargs = (struct lws_pollargs *)in;$/;" l +pollfd_index lib/mosquitto_internal.h /^ int pollfd_index;$/;" m struct:mosquitto +pollfd_index src/loop.c /^ int pollfd_index;$/;" l +pollfd_max src/loop.c /^ int pollfd_max;$/;" l +pollfds src/loop.c /^ struct pollfd *pollfds = NULL;$/;" l +port client/client_shared.c /^ char *username = NULL, *password = NULL, *host = NULL, *port = NULL;$/;" l +port client/client_shared.c /^ int port;$/;" l +port client/client_shared.h /^ int port;$/;" m struct:mosq_config +port lib/mosquitto_internal.h /^ int port;$/;" m struct:mosquitto +port src/mosquitto_broker_internal.h /^ int port;$/;" m struct:bridge_address +port src/mosquitto_broker_internal.h /^ uint16_t port;$/;" m struct:mosquitto__listener +port test/broker/01-connect-anon-denied.py /^port = mosq_test.get_port()$/;" v +port test/broker/01-connect-bad-packet.py /^port = mosq_test.get_port()$/;" v +port test/broker/01-connect-disconnect-v5.py /^port = mosq_test.get_port()$/;" v +port test/broker/01-connect-duplicate-v5.py /^port = mosq_test.get_port()$/;" v +port test/broker/01-connect-duplicate.py /^port = mosq_test.get_port()$/;" v +port test/broker/01-connect-invalid-id-0-311.py /^port = mosq_test.get_port()$/;" v +port test/broker/01-connect-invalid-id-0.py /^port = mosq_test.get_port()$/;" v +port test/broker/01-connect-invalid-id-missing.py /^port = mosq_test.get_port()$/;" v +port test/broker/01-connect-invalid-id-utf8.py /^port = mosq_test.get_port()$/;" v +port test/broker/01-connect-invalid-protonum.py /^port = mosq_test.get_port()$/;" v +port test/broker/01-connect-invalid-reserved.py /^port = mosq_test.get_port()$/;" v +port test/broker/01-connect-success-v5.py /^port = mosq_test.get_port()$/;" v +port test/broker/01-connect-success.py /^port = mosq_test.get_port()$/;" v +port test/broker/01-connect-uname-invalid-utf8.py /^port = mosq_test.get_port()$/;" v +port test/broker/01-connect-uname-no-flag.py /^port = mosq_test.get_port()$/;" v +port test/broker/01-connect-uname-no-password-denied.py /^port = mosq_test.get_port()$/;" v +port test/broker/01-connect-uname-password-denied-no-will.py /^port = mosq_test.get_port()$/;" v +port test/broker/01-connect-uname-password-denied.py /^port = mosq_test.get_port()$/;" v +port test/broker/01-connect-uname-password-success-no-tls.py /^port = mosq_test.get_port()$/;" v +port test/broker/01-connect-uname-password-success.py /^port = mosq_test.get_port()$/;" v +port test/broker/01-connect-uname-pwd-no-flag.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-shared-qos0-v5.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subhier-crash.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos0-retain-as-publish.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos0-send-retain.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos0-subscription-id.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos0-topic-alias-unknown.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos0-topic-alias.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos0-v5.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos0.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos1-bad-pubcomp.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos1-bad-pubrec.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos1-message-expiry-retain.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos1-message-expiry-will.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos1-message-expiry.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos1-nolocal.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos1-v5.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos1.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos2-bad-puback-1.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos2-bad-puback-2.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos2-bad-pubcomp.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos2-pubrec-error-helper.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos2-pubrec-error.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos2-receive-maximum-1.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos2-receive-maximum-2.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos2-receive-maximum-helper.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos2-v5.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subpub-qos2.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subscribe-invalid-utf8.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subscribe-persistence-flipflop.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subscribe-qos0.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subscribe-qos1.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-subscribe-qos2.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-unsubscribe-invalid-no-topic.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-unsubscribe-qos0.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-unsubscribe-qos1.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-unsubscribe-qos2-multiple-v5.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-unsubscribe-qos2-multiple.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-unsubscribe-qos2-v5.py /^port = mosq_test.get_port()$/;" v +port test/broker/02-unsubscribe-qos2.py /^port = mosq_test.get_port()$/;" v +port test/broker/03-pattern-matching-helper.py /^port = int(sys.argv[2])$/;" v +port test/broker/03-publish-b2c-disconnect-qos1-helper.py /^port = mosq_test.get_port()$/;" v +port test/broker/03-publish-b2c-disconnect-qos1.py /^port = mosq_test.get_port()$/;" v +port test/broker/03-publish-b2c-disconnect-qos2-helper.py /^port = mosq_test.get_port()$/;" v +port test/broker/03-publish-b2c-disconnect-qos2.py /^port = mosq_test.get_port()$/;" v +port test/broker/03-publish-b2c-qos1-len-helper.py /^port = mosq_test.get_port()$/;" v +port test/broker/03-publish-b2c-qos2-len-helper.py /^port = mosq_test.get_port()$/;" v +port test/broker/03-publish-c2b-disconnect-qos2.py /^port = mosq_test.get_port()$/;" v +port test/broker/03-publish-dollar-v5.py /^port = mosq_test.get_port()$/;" v +port test/broker/03-publish-dollar.py /^port = mosq_test.get_port()$/;" v +port test/broker/03-publish-invalid-utf8.py /^port = mosq_test.get_port()$/;" v +port test/broker/03-publish-qos1-no-subscribers-v5.py /^port = mosq_test.get_port()$/;" v +port test/broker/03-publish-qos1-queued-bytes.py /^port = mosq_test.get_port()$/;" v +port test/broker/03-publish-qos1-retain-disabled.py /^port = mosq_test.get_port()$/;" v +port test/broker/03-publish-qos1.py /^port = mosq_test.get_port()$/;" v +port test/broker/03-publish-qos2.py /^port = mosq_test.get_port()$/;" v +port test/broker/04-retain-check-source-persist.py /^port = mosq_test.get_port()$/;" v +port test/broker/04-retain-check-source.py /^port = mosq_test.get_port()$/;" v +port test/broker/04-retain-qos0-clear.py /^port = mosq_test.get_port()$/;" v +port test/broker/04-retain-qos0-fresh.py /^port = mosq_test.get_port()$/;" v +port test/broker/04-retain-qos0-repeated.py /^port = mosq_test.get_port()$/;" v +port test/broker/04-retain-qos0.py /^port = mosq_test.get_port()$/;" v +port test/broker/04-retain-qos1-qos0.py /^port = mosq_test.get_port()$/;" v +port test/broker/04-retain-upgrade-outgoing-qos.py /^port = mosq_test.get_port()$/;" v +port test/broker/05-clean-session-qos1-helper.py /^port = mosq_test.get_port()$/;" v +port test/broker/05-clean-session-qos1.py /^port = mosq_test.get_port()$/;" v +port test/broker/05-session-expiry-v5.py /^port = mosq_test.get_port()$/;" v +port test/broker/06-bridge-b2br-remapping.py /^ port=port2,$/;" v +port test/broker/06-bridge-br2b-disconnect-qos1-helper.py /^port = mosq_test.get_port()$/;" v +port test/broker/06-bridge-br2b-disconnect-qos2-helper.py /^port = mosq_test.get_port()$/;" v +port test/broker/06-bridge-br2b-remapping.py /^ port=port2,$/;" v +port test/broker/06-bridge-no-local.py /^port = mosq_test.get_port()$/;" v +port test/broker/06-bridge-per-listener-settings.py /^ port=port2,$/;" v +port test/broker/06-bridge-reconnect-local-out-helper.py /^port = mosq_test.get_port()$/;" v +port test/broker/07-will-invalid-utf8.py /^port = mosq_test.get_port()$/;" v +port test/broker/07-will-no-flag.py /^port = mosq_test.get_port()$/;" v +port test/broker/07-will-null-helper.py /^port = mosq_test.get_port()$/;" v +port test/broker/07-will-null-topic.py /^port = mosq_test.get_port()$/;" v +port test/broker/07-will-null.py /^port = mosq_test.get_port()$/;" v +port test/broker/08-ssl-bridge-helper.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-acl-access-variants.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-acl-change.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-acl-empty-file.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-auth-bad-method.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-extended-auth-change-username.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-extended-auth-multistep-reauth.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-extended-auth-multistep.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-extended-auth-single.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-extended-auth-single2.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-extended-auth-unsupported.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-plugin-auth-acl-pub.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-plugin-auth-acl-sub-denied.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-plugin-auth-acl-sub.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-plugin-auth-context-params.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-plugin-auth-defer-unpwd-fail.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-plugin-auth-defer-unpwd-success.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-plugin-auth-msg-params.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-plugin-auth-unpwd-fail.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-plugin-auth-unpwd-success.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-plugin-auth-v2-unpwd-fail.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-plugin-auth-v2-unpwd-success.py /^port = mosq_test.get_port()$/;" v +port test/broker/09-pwfile-parse-invalid.py /^port = mosq_test.get_port()$/;" v +port test/broker/10-listener-mount-point-helper.py /^port = mosq_test.get_port()$/;" v +port test/broker/11-message-expiry.py /^port = mosq_test.get_port()$/;" v +port test/broker/11-persistent-subscription-no-local.py /^port = mosq_test.get_port()$/;" v +port test/broker/11-persistent-subscription-v5.py /^port = mosq_test.get_port()$/;" v +port test/broker/11-persistent-subscription.py /^port = mosq_test.get_port()$/;" v +port test/broker/11-pub-props.py /^port = mosq_test.get_port()$/;" v +port test/broker/11-subscription-id.py /^port = mosq_test.get_port()$/;" v +port test/broker/12-prop-maximum-packet-size-broker.py /^port = mosq_test.get_port()$/;" v +port test/broker/12-prop-maximum-packet-size-connect.py /^port = mosq_test.get_port()$/;" v +port test/broker/12-prop-maximum-packet-size-publish-qos1.py /^port = mosq_test.get_port()$/;" v +port test/broker/12-prop-maximum-packet-size-publish-qos2.py /^port = mosq_test.get_port()$/;" v +port test/broker/12-prop-maximum-packet-size-publish.py /^port = mosq_test.get_port()$/;" v +port test/broker/12-prop-response-topic-correlation-data.py /^port = mosq_test.get_port()$/;" v +port test/broker/12-prop-response-topic.py /^port = mosq_test.get_port()$/;" v +port test/broker/12-prop-server-keepalive.py /^port = mosq_test.get_port(1)$/;" v +port test/broker/12-prop-session-expiry-invalid.py /^port = mosq_test.get_port()$/;" v +port test/broker/c/08-tls-psk-bridge.c /^ int port;$/;" l +port test/broker/c/08-tls-psk-pub.c /^ int port;$/;" l +port test/lib/01-con-discon-success.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/01-keepalive-pingreq.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/01-no-clean-session.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/01-server-keepalive-pingreq.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/01-unpwd-set.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/01-will-set.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/01-will-unpwd-set.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/02-subscribe-qos0.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/02-subscribe-qos1.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/02-subscribe-qos2.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/02-unsubscribe-multiple-v5.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/02-unsubscribe-v5.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/02-unsubscribe.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/03-publish-b2c-qos1.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/03-publish-b2c-qos2.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/03-publish-c2b-qos1-disconnect.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/03-publish-c2b-qos1-receive-maximum.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/03-publish-c2b-qos1-timeout.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/03-publish-c2b-qos2-disconnect.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/03-publish-c2b-qos2-maximum-qos-0.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/03-publish-c2b-qos2-maximum-qos-1.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/03-publish-c2b-qos2-pubrec-error.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/03-publish-c2b-qos2-timeout.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/03-publish-c2b-qos2.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/03-publish-qos0-no-payload.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/03-publish-qos0.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/03-request-response-correlation.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/03-request-response.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/04-retain-qos0.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/08-ssl-connect-cert-auth-enc.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/08-ssl-connect-cert-auth.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/08-ssl-connect-no-auth.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/08-ssl-fake-cacert.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/11-prop-oversize-packet.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/11-prop-send-content-type.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/11-prop-send-payload-format.py /^port = mosq_test.get_lib_port()$/;" v +port test/lib/c/01-con-discon-success.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/01-keepalive-pingreq.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/01-no-clean-session.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/01-server-keepalive-pingreq.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/01-unpwd-set.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/01-will-set.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/01-will-unpwd-set.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/02-subscribe-qos0.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/02-subscribe-qos1.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/02-subscribe-qos2.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/02-unsubscribe-multiple-v5.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/02-unsubscribe-v5.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/02-unsubscribe.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/03-publish-b2c-qos1.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/03-publish-b2c-qos2-len.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/03-publish-b2c-qos2.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/03-publish-c2b-qos1-disconnect.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/03-publish-c2b-qos1-len.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/03-publish-c2b-qos1-receive-maximum.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/03-publish-c2b-qos2-disconnect.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/03-publish-c2b-qos2-len.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/03-publish-c2b-qos2-maximum-qos-0.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/03-publish-c2b-qos2-maximum-qos-1.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/03-publish-c2b-qos2-pubrec-error.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/03-publish-c2b-qos2-receive-maximum-1.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/03-publish-c2b-qos2-receive-maximum-2.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/03-publish-c2b-qos2.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/03-publish-qos0-no-payload.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/03-publish-qos0.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/03-request-response-1.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/03-request-response-2.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/03-request-response-correlation-1.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/04-retain-qos0.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/08-ssl-connect-cert-auth-enc.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/08-ssl-connect-cert-auth.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/08-ssl-connect-no-auth.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/08-ssl-fake-cacert.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/11-prop-oversize-packet.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/11-prop-send-content-type.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/c/11-prop-send-payload-format.c /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/01-con-discon-success.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/01-keepalive-pingreq.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/01-no-clean-session.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/01-unpwd-set.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/01-will-set.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/01-will-unpwd-set.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/02-subscribe-qos0.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/02-subscribe-qos1.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/02-subscribe-qos2.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/02-unsubscribe.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/03-publish-b2c-qos1.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/03-publish-b2c-qos2.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/03-publish-c2b-qos2.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/03-publish-qos0-no-payload.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/03-publish-qos0.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/04-retain-qos0.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/08-ssl-connect-cert-auth.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/08-ssl-connect-no-auth.cpp /^ int port = atoi(argv[1]);$/;" l +port test/lib/cpp/08-ssl-fake-cacert.cpp /^ int port = atoi(argv[1]);$/;" l +port test/random/random_client.py /^port = p["port"]$/;" v +port_int client/client_shared.c /^ int port_int;$/;" l +port_tmp src/conf.c /^ int port_tmp;$/;" l +ports test/random/random_client.py /^ports = [$/;" v +pos client/pub_client.c /^ int pos;$/;" l +pos client/pub_shared.c /^ long pos = 0, rlen;$/;" l +pos client/pub_shared.c /^ long pos, rlen;$/;" l +pos lib/mosquitto_internal.h /^ uint32_t pos;$/;" m struct:mosquitto__packet +pos src/handle_connect.c /^ int pos;$/;" l +pos src/websockets.c /^ size_t pos;$/;" l +pp test/broker/08-tls-psk-bridge.py /^ pp = ''$/;" v +pp test/broker/08-tls-psk-pub.py /^ pp = ''$/;" v +pp test/lib/01-con-discon-success.py /^ pp = ''$/;" v +pp test/lib/01-con-discon-success.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/01-keepalive-pingreq.py /^ pp = ''$/;" v +pp test/lib/01-keepalive-pingreq.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/01-no-clean-session.py /^ pp = ''$/;" v +pp test/lib/01-no-clean-session.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/01-server-keepalive-pingreq.py /^ pp = ''$/;" v +pp test/lib/01-server-keepalive-pingreq.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/01-unpwd-set.py /^ pp = ''$/;" v +pp test/lib/01-unpwd-set.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/01-will-set.py /^ pp = ''$/;" v +pp test/lib/01-will-set.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/01-will-unpwd-set.py /^ pp = ''$/;" v +pp test/lib/01-will-unpwd-set.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/02-subscribe-qos0.py /^ pp = ''$/;" v +pp test/lib/02-subscribe-qos0.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/02-subscribe-qos1.py /^ pp = ''$/;" v +pp test/lib/02-subscribe-qos1.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/02-subscribe-qos2.py /^ pp = ''$/;" v +pp test/lib/02-subscribe-qos2.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/02-unsubscribe-multiple-v5.py /^ pp = ''$/;" v +pp test/lib/02-unsubscribe-multiple-v5.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/02-unsubscribe-v5.py /^ pp = ''$/;" v +pp test/lib/02-unsubscribe-v5.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/02-unsubscribe.py /^ pp = ''$/;" v +pp test/lib/02-unsubscribe.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/03-publish-b2c-qos1.py /^ pp = ''$/;" v +pp test/lib/03-publish-b2c-qos1.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/03-publish-b2c-qos2.py /^ pp = ''$/;" v +pp test/lib/03-publish-b2c-qos2.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/03-publish-c2b-qos1-disconnect.py /^ pp = ''$/;" v +pp test/lib/03-publish-c2b-qos1-disconnect.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/03-publish-c2b-qos1-receive-maximum.py /^ pp = ''$/;" v +pp test/lib/03-publish-c2b-qos1-receive-maximum.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/03-publish-c2b-qos1-timeout.py /^ pp = ''$/;" v +pp test/lib/03-publish-c2b-qos1-timeout.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/03-publish-c2b-qos2-disconnect.py /^ pp = ''$/;" v +pp test/lib/03-publish-c2b-qos2-disconnect.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/03-publish-c2b-qos2-maximum-qos-0.py /^ pp = ''$/;" v +pp test/lib/03-publish-c2b-qos2-maximum-qos-0.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/03-publish-c2b-qos2-maximum-qos-1.py /^ pp = ''$/;" v +pp test/lib/03-publish-c2b-qos2-maximum-qos-1.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/03-publish-c2b-qos2-pubrec-error.py /^ pp = ''$/;" v +pp test/lib/03-publish-c2b-qos2-pubrec-error.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^ pp = ''$/;" v +pp test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^ pp = ''$/;" v +pp test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/03-publish-c2b-qos2-timeout.py /^ pp = ''$/;" v +pp test/lib/03-publish-c2b-qos2-timeout.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/03-publish-c2b-qos2.py /^ pp = ''$/;" v +pp test/lib/03-publish-c2b-qos2.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/03-publish-qos0-no-payload.py /^ pp = ''$/;" v +pp test/lib/03-publish-qos0-no-payload.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/03-publish-qos0.py /^ pp = ''$/;" v +pp test/lib/03-publish-qos0.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/03-request-response-correlation.py /^ pp = ''$/;" v +pp test/lib/03-request-response-correlation.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/03-request-response.py /^ pp = ''$/;" v +pp test/lib/03-request-response.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/04-retain-qos0.py /^ pp = ''$/;" v +pp test/lib/04-retain-qos0.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/08-ssl-bad-cacert.py /^ pp = ''$/;" v +pp test/lib/08-ssl-bad-cacert.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/08-ssl-connect-cert-auth-enc.py /^ pp = ''$/;" v +pp test/lib/08-ssl-connect-cert-auth-enc.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/08-ssl-connect-cert-auth.py /^ pp = ''$/;" v +pp test/lib/08-ssl-connect-cert-auth.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/08-ssl-connect-no-auth.py /^ pp = ''$/;" v +pp test/lib/08-ssl-connect-no-auth.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/08-ssl-fake-cacert.py /^ pp = ''$/;" v +pp test/lib/08-ssl-fake-cacert.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/09-util-topic-tokenise.py /^ pp = ''$/;" v +pp test/lib/09-util-topic-tokenise.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/11-prop-oversize-packet.py /^ pp = ''$/;" v +pp test/lib/11-prop-oversize-packet.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/11-prop-send-content-type.py /^ pp = ''$/;" v +pp test/lib/11-prop-send-content-type.py /^ pp = env['PYTHONPATH']$/;" v +pp test/lib/11-prop-send-payload-format.py /^ pp = ''$/;" v +pp test/lib/11-prop-send-payload-format.py /^ pp = env['PYTHONPATH']$/;" v +prefix config.mk /^prefix?=\/usr\/local$/;" m +prev lib/mosquitto_internal.h /^ struct mosquitto_message_all *prev;$/;" m struct:mosquitto_message_all typeref:struct:mosquitto_message_all::mosquitto_message_all +prev lib/mosquitto_internal.h /^ struct session_expiry_list *prev;$/;" m struct:session_expiry_list typeref:struct:session_expiry_list::session_expiry_list +prev lib/mosquitto_internal.h /^ struct will_delay_list *prev;$/;" m struct:will_delay_list typeref:struct:will_delay_list::will_delay_list +prev src/deps/uthash.h /^ void *prev; \/* prev element in app order *\/$/;" m struct:UT_hash_handle +prev src/mosquitto_broker_internal.h /^ struct mosquitto__subleaf *prev;$/;" m struct:mosquitto__subleaf typeref:struct:mosquitto__subleaf::mosquitto__subleaf +prev src/mosquitto_broker_internal.h /^ struct mosquitto_client_msg *prev;$/;" m struct:mosquitto_client_msg typeref:struct:mosquitto_client_msg::mosquitto_client_msg +prev src/mosquitto_broker_internal.h /^ struct mosquitto_msg_store *prev;$/;" m struct:mosquitto_msg_store typeref:struct:mosquitto_msg_store::mosquitto_msg_store +primary_retry src/mosquitto_broker_internal.h /^ time_t primary_retry;$/;" m struct:mosquitto__bridge +primary_retry_sock src/mosquitto_broker_internal.h /^ mosq_sock_t primary_retry_sock;$/;" m struct:mosquitto__bridge +print_db_client src/db_dump/db_dump.c /^print_db_client(struct db_client *client, int length)$/;" f file: +print_db_client_msg src/db_dump/db_dump.c /^print_db_client_msg(struct db_client_msg *msg, int length)$/;" f file: +print_db_msg src/db_dump/db_dump.c /^print_db_msg(struct db_msg *msg, int length)$/;" f file: +print_db_sub src/db_dump/db_dump.c /^print_db_sub(struct db_sub *sub, int length)$/;" f file: +print_error src/service.c /^static void print_error(void)$/;" f file: +print_error test/lib/c/09-util-topic-tokenise.c /^void print_error(const char *topic, char **topics, int topic_count)$/;" f +print_error test/lib/cpp/09-util-topic-tokenise.cpp /^void print_error(const char *topic, char **topics, int topic_count)$/;" f +print_message client/sub_client_output.c /^void print_message(struct mosq_config *cfg, const struct mosquitto_message *message)$/;" f +print_usage client/pub_client.c /^void print_usage(void)$/;" f +print_usage client/rr_client.c /^void print_usage(void)$/;" f +print_usage client/sub_client.c /^void print_usage(void)$/;" f +print_usage src/conf.c /^static void print_usage(void)$/;" f file: +print_usage src/mosquitto_passwd.c /^void print_usage(void)$/;" f +process_messages client/rr_client.c /^bool process_messages = true;$/;" v +process_messages client/sub_client.c /^bool process_messages = true;$/;" v +prop lib/property_mosq.c /^ mosquitto_property *prop;$/;" l +prop test/unit/property_user_read.c /^ const mosquitto_property *prop;$/;" l +prop_finalise test/mqtt5_props.py /^def prop_finalise(props):$/;" f +prop_packet src/persist_read_v5.c /^ struct mosquitto__packet prop_packet;$/;" l +prop_packet src/persist_write_v5.c /^ struct mosquitto__packet prop_packet;$/;" l +prop_subpub_helper test/broker/prop_subpub_helper.py /^def prop_subpub_helper(props_out, props_in):$/;" f +prop_type client/client_props.c /^enum prop_type$/;" g file: +properties lib/handle_auth.c /^ mosquitto_property *properties = NULL;$/;" l +properties lib/handle_connack.c /^ mosquitto_property *properties = NULL;$/;" l +properties lib/handle_disconnect.c /^ mosquitto_property *properties = NULL;$/;" l +properties lib/handle_pubackcomp.c /^ mosquitto_property *properties = NULL;$/;" l +properties lib/handle_publish.c /^ mosquitto_property *properties = NULL;$/;" l +properties lib/handle_pubrec.c /^ mosquitto_property *properties = NULL;$/;" l +properties lib/handle_pubrel.c /^ mosquitto_property *properties = NULL;$/;" l +properties lib/handle_suback.c /^ mosquitto_property *properties = NULL;$/;" l +properties lib/handle_unsuback.c /^ mosquitto_property *properties = NULL;$/;" l +properties lib/mosquitto_internal.h /^ mosquitto_property *properties;$/;" m struct:mosquitto_message_all +properties src/handle_auth.c /^ mosquitto_property *properties = NULL;$/;" l +properties src/handle_connack.c /^ mosquitto_property *properties = NULL;$/;" l +properties src/handle_connect.c /^ mosquitto_property *properties = NULL;$/;" l +properties src/handle_disconnect.c /^ mosquitto_property *properties = NULL;$/;" l +properties src/handle_publish.c /^ mosquitto_property *properties = NULL;$/;" l +properties src/handle_subscribe.c /^ mosquitto_property *properties = NULL;$/;" l +properties src/handle_unsubscribe.c /^ mosquitto_property *properties = NULL;$/;" l +properties src/mosquitto_broker_internal.h /^ mosquitto_property *properties;$/;" m struct:mosquitto_client_msg +properties src/mosquitto_broker_internal.h /^ mosquitto_property *properties;$/;" m struct:mosquitto_msg_store +properties src/persist.h /^ mosquitto_property *properties;$/;" m struct:P_client_msg +properties src/persist.h /^ mosquitto_property *properties;$/;" m struct:P_msg_store +properties src/persist_read_v5.c /^ mosquitto_property *properties = NULL;$/;" l +properties src/send_auth.c /^ mosquitto_property *properties = NULL;$/;" l +properties src/send_suback.c /^ mosquitto_property *properties = NULL;$/;" l +properties src/subs.c /^ mosquitto_property *properties = NULL;$/;" l +properties test/unit/property_read.c /^ mosquitto_property *properties = NULL;$/;" l +properties test/unit/property_read.c /^ mosquitto_property *properties, *p;$/;" l +properties test/unit/property_read.c /^ mosquitto_property *properties;$/;" l +properties test/unit/property_write.c /^ mosquitto_property *properties;$/;" l +property test/unit/property_write.c /^ mosquitto_property property;$/;" l +property__add lib/property_mosq.c /^static void property__add(mosquitto_property **proplist, struct mqtt5__property *prop)$/;" f file: +property__free lib/property_mosq.c /^void property__free(mosquitto_property **property)$/;" f +property__get_length lib/property_mosq.c /^int property__get_length(const mosquitto_property *property)$/;" f +property__get_length_all lib/property_mosq.c /^int property__get_length_all(const mosquitto_property *property)$/;" f +property__get_property lib/property_mosq.c /^const mosquitto_property *property__get_property(const mosquitto_property *proplist, int identifier, bool skip_first)$/;" f +property__process_connect src/property_broker.c /^int property__process_connect(struct mosquitto *context, mosquitto_property **props)$/;" f +property__process_disconnect src/property_broker.c /^int property__process_disconnect(struct mosquitto *context, mosquitto_property **props)$/;" f +property__process_will src/property_broker.c /^int property__process_will(struct mosquitto *context, struct mosquitto_message_all *msg, mosquitto_property **props)$/;" f +property__read lib/property_mosq.c /^int property__read(struct mosquitto__packet *packet, int32_t *len, mosquitto_property *property)$/;" f +property__read_all lib/property_mosq.c /^int property__read_all(int command, struct mosquitto__packet *packet, mosquitto_property **properties)$/;" f +property__write lib/property_mosq.c /^int property__write(struct mosquitto__packet *packet, const mosquitto_property *property)$/;" f +property__write_all lib/property_mosq.c /^int property__write_all(struct mosquitto__packet *packet, const mosquitto_property *properties, bool write_len)$/;" f +property_identifier lib/property_mosq.c /^ int32_t property_identifier;$/;" l +proplen lib/property_mosq.c /^ int32_t proplen;$/;" l +proplen lib/send_connect.c /^ int proplen = 0, will_proplen, varbytes;$/;" l +proplen lib/send_disconnect.c /^ int proplen, varbytes;$/;" l +proplen lib/send_mosq.c /^ int proplen, varbytes;$/;" l +proplen lib/send_publish.c /^ int proplen = 0, varbytes;$/;" l +proplen lib/send_subscribe.c /^ int proplen, varbytes;$/;" l +proplen lib/send_unsubscribe.c /^ int proplen, varbytes;$/;" l +proplen src/persist_write_v5.c /^ uint32_t proplen = 0;$/;" l +proplen src/send_auth.c /^ int proplen, varbytes;$/;" l +proplen src/send_connack.c /^ int proplen, varbytes;$/;" l +proplen src/send_suback.c /^ int proplen, varbytes;$/;" l +proplen src/send_unsuback.c /^ int proplen, varbytes;$/;" l +proplist client/client_props.c /^ mosquitto_property **proplist;$/;" l +proplist test/lib/c/11-prop-send-content-type.c /^ mosquitto_property *proplist = NULL;$/;" l +proplist test/lib/c/11-prop-send-payload-format.c /^ mosquitto_property *proplist = NULL;$/;" l +proplist test/unit/property_add.c /^ mosquitto_property *proplist = NULL;$/;" l +proplist test/unit/property_user_read.c /^ mosquitto_property *proplist = NULL, *proplist_copy = NULL;$/;" l +proplist_copy test/unit/property_user_read.c /^ mosquitto_property *proplist = NULL, *proplist_copy = NULL;$/;" l +propname client/client_props.c /^ char *cmdname = NULL, *propname = NULL;$/;" l +props test/broker/01-connect-disconnect-v5.py /^ props = mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key", "value")$/;" v +props test/broker/02-subpub-qos0-subscription-id.py /^props = mqtt5_props.gen_varint_prop(mqtt5_props.PROP_SUBSCRIPTION_IDENTIFIER, 1)$/;" v +props test/broker/02-subpub-qos0-subscription-id.py /^props = mqtt5_props.gen_varint_prop(mqtt5_props.PROP_SUBSCRIPTION_IDENTIFIER, 14)$/;" v +props test/broker/02-subpub-qos0-subscription-id.py /^props = mqtt5_props.gen_varint_prop(mqtt5_props.PROP_SUBSCRIPTION_IDENTIFIER, 19)$/;" v +props test/broker/02-subpub-qos0-subscription-id.py /^props = mqtt5_props.gen_varint_prop(mqtt5_props.PROP_SUBSCRIPTION_IDENTIFIER, 21)$/;" v +props test/broker/02-subpub-qos0-topic-alias-unknown.py /^props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_TOPIC_ALIAS, 3)$/;" v +props test/broker/02-subpub-qos0-topic-alias.py /^props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_TOPIC_ALIAS, 3)$/;" v +props test/broker/02-subpub-qos1-message-expiry-retain.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MESSAGE_EXPIRY_INTERVAL, 4)$/;" v +props test/broker/02-subpub-qos1-message-expiry-will.py /^ props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MESSAGE_EXPIRY_INTERVAL, i)$/;" v +props test/broker/02-subpub-qos1-message-expiry-will.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MESSAGE_EXPIRY_INTERVAL, 10)$/;" v +props test/broker/02-subpub-qos1-message-expiry-will.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 60)$/;" v +props test/broker/02-subpub-qos1-message-expiry.py /^ props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MESSAGE_EXPIRY_INTERVAL, i)$/;" v +props test/broker/02-subpub-qos1-message-expiry.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MESSAGE_EXPIRY_INTERVAL, 1)$/;" v +props test/broker/02-subpub-qos1-message-expiry.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MESSAGE_EXPIRY_INTERVAL, 10)$/;" v +props test/broker/02-subpub-qos1-message-expiry.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 60)$/;" v +props test/broker/02-subpub-qos2-receive-maximum-1.py /^props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_RECEIVE_MAXIMUM, 1)$/;" v +props test/broker/02-subpub-qos2-receive-maximum-2.py /^props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_RECEIVE_MAXIMUM, 2)$/;" v +props test/broker/03-publish-b2c-qos1-len.py /^props = mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key", "value")$/;" v +props test/broker/03-publish-b2c-qos2-len.py /^props = mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key", "value")$/;" v +props test/broker/03-publish-c2b-qos2-len.py /^props = mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key", "value")$/;" v +props test/broker/03-publish-qos1-retain-disabled.py /^props = mqtt5_props.gen_byte_prop(mqtt5_props.PROP_RETAIN_AVAILABLE, 0)$/;" v +props test/broker/05-session-expiry-v5.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 0)$/;" v +props test/broker/05-session-expiry-v5.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 1)$/;" v +props test/broker/05-session-expiry-v5.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 3)$/;" v +props test/broker/09-auth-bad-method.py /^props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "basic")$/;" v +props test/broker/09-extended-auth-multistep-reauth.py /^props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "badmethod")$/;" v +props test/broker/09-extended-auth-multistep-reauth.py /^props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "mirror")$/;" v +props test/broker/09-extended-auth-multistep.py /^props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "mirror")$/;" v +props test/broker/09-extended-auth-single.py /^props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "error")$/;" v +props test/broker/09-extended-auth-single.py /^props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "mirror")$/;" v +props test/broker/09-extended-auth-single.py /^props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "non-matching")$/;" v +props test/broker/09-extended-auth-single.py /^props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "single")$/;" v +props test/broker/09-extended-auth-unsupported.py /^props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "unsupported")$/;" v +props test/broker/11-message-expiry.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MESSAGE_EXPIRY_INTERVAL, 1)$/;" v +props test/broker/11-message-expiry.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MESSAGE_EXPIRY_INTERVAL, 100)$/;" v +props test/broker/11-message-expiry.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 60)$/;" v +props test/broker/11-persistent-subscription-no-local.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 100)$/;" v +props test/broker/11-persistent-subscription-v5.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 100)$/;" v +props test/broker/11-pub-props.py /^props = mqtt5_props.gen_byte_prop(mqtt5_props.PROP_PAYLOAD_FORMAT_INDICATOR, 1)$/;" v +props test/broker/11-subscription-id.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 100)$/;" v +props test/broker/11-subscription-id.py /^props = mqtt5_props.gen_varint_prop(mqtt5_props.PROP_SUBSCRIPTION_IDENTIFIER, 53)$/;" v +props test/broker/12-prop-maximum-packet-size-broker.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MAXIMUM_PACKET_SIZE, 30)$/;" v +props test/broker/12-prop-maximum-packet-size-connect.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MAXIMUM_PACKET_SIZE, 2)$/;" v +props test/broker/12-prop-maximum-packet-size-publish-qos1.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MAXIMUM_PACKET_SIZE, 20)$/;" v +props test/broker/12-prop-maximum-packet-size-publish-qos2.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MAXIMUM_PACKET_SIZE, 20)$/;" v +props test/broker/12-prop-maximum-packet-size-publish.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MAXIMUM_PACKET_SIZE, 20)$/;" v +props test/broker/12-prop-response-topic-correlation-data.py /^props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_CORRELATION_DATA, "45vyvynq30q3vt4 nuy893b4v3")$/;" v +props test/broker/12-prop-response-topic-correlation-data.py /^props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_RESPONSE_TOPIC, "response\/topic")$/;" v +props test/broker/12-prop-response-topic.py /^props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_RESPONSE_TOPIC, "response\/topic")$/;" v +props test/broker/12-prop-server-keepalive.py /^props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_SERVER_KEEP_ALIVE, 60)$/;" v +props test/broker/12-prop-session-expiry-invalid.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 0)$/;" v +props test/broker/12-prop-session-expiry-invalid.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 1)$/;" v +props test/lib/01-server-keepalive-pingreq.py /^props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_SERVER_KEEP_ALIVE, server_keepalive)$/;" v +props test/lib/03-publish-b2c-qos2-len.py /^props = mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key", "value")$/;" v +props test/lib/03-publish-c2b-qos1-len.py /^props = mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key", "value")$/;" v +props test/lib/03-publish-c2b-qos1-receive-maximum.py /^props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_RECEIVE_MAXIMUM, 3)$/;" v +props test/lib/03-publish-c2b-qos2-len.py /^props = mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key", "value")$/;" v +props test/lib/03-publish-c2b-qos2-maximum-qos-0.py /^props = mqtt5_props.gen_byte_prop(mqtt5_props.PROP_MAXIMUM_QOS, 0)$/;" v +props test/lib/03-publish-c2b-qos2-maximum-qos-1.py /^props = mqtt5_props.gen_byte_prop(mqtt5_props.PROP_MAXIMUM_QOS, 1)$/;" v +props test/lib/03-publish-c2b-qos2-pubrec-error.py /^props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_RECEIVE_MAXIMUM, 1)$/;" v +props test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_RECEIVE_MAXIMUM, 1)$/;" v +props test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_RECEIVE_MAXIMUM, 2)$/;" v +props test/lib/03-request-response-correlation.py /^props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_CORRELATION_DATA, "corridor")$/;" v +props test/lib/03-request-response-correlation.py /^props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_RESPONSE_TOPIC, resp_topic)$/;" v +props test/lib/03-request-response.py /^props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_RESPONSE_TOPIC, resp_topic)$/;" v +props test/lib/11-prop-oversize-packet.py /^props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MAXIMUM_PACKET_SIZE, 30)$/;" v +props test/lib/11-prop-send-content-type.py /^props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_CONTENT_TYPE, "application\/json")$/;" v +props test/lib/11-prop-send-payload-format.py /^props = mqtt5_props.gen_byte_prop(mqtt5_props.PROP_PAYLOAD_FORMAT_INDICATOR, 0x01)$/;" v +props test/lib/c/03-publish-c2b-qos1-receive-maximum.c /^ mosquitto_property *props = NULL;$/;" l +props test/lib/c/03-publish-c2b-qos2-pubrec-error.c /^ mosquitto_property *props = NULL;$/;" l +props test/lib/c/03-publish-c2b-qos2-receive-maximum-1.c /^ mosquitto_property *props = NULL;$/;" l +props test/lib/c/03-publish-c2b-qos2-receive-maximum-2.c /^ mosquitto_property *props = NULL;$/;" l +props test/lib/c/03-request-response-1.c /^ mosquitto_property *props = NULL;$/;" l +props test/lib/c/03-request-response-correlation-1.c /^ mosquitto_property *props = NULL;$/;" l +props_in test/broker/12-prop-subpub-content-type.py /^props_in = mqtt5_props.gen_string_prop(mqtt5_props.PROP_CONTENT_TYPE, "text")$/;" v +props_in test/broker/12-prop-subpub-payload-format.py /^props_in = mqtt5_props.gen_byte_prop(mqtt5_props.PROP_PAYLOAD_FORMAT_INDICATOR, 0xed)$/;" v +props_out test/broker/12-prop-subpub-content-type.py /^props_out = mqtt5_props.gen_string_prop(mqtt5_props.PROP_CONTENT_TYPE, "text")$/;" v +props_out test/broker/12-prop-subpub-content-type.py /^props_out = props_out+mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_TOPIC_ALIAS, 1)$/;" v +props_out test/broker/12-prop-subpub-payload-format.py /^props_out = mqtt5_props.gen_byte_prop(mqtt5_props.PROP_PAYLOAD_FORMAT_INDICATOR, 0xed)$/;" v +props_out test/broker/12-prop-subpub-payload-format.py /^props_out = props_out+mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_TOPIC_ALIAS, 1)$/;" v +protocol lib/mosquitto_internal.h /^ enum mosquitto__protocol protocol;$/;" m struct:mosquitto typeref:enum:mosquitto::mosquitto__protocol +protocol src/mosquitto_broker_internal.h /^ enum mosquitto_protocol protocol;$/;" m struct:mosquitto__listener typeref:enum:mosquitto__listener::mosquitto_protocol +protocol test/random/random_client.py /^protocol = paho.MQTTv311$/;" v +protocol_count src/websockets.c /^ int protocol_count;$/;" l +protocol_name src/handle_connect.c /^ char protocol_name[7];$/;" l +protocol_version client/client_shared.h /^ int protocol_version;$/;" m struct:mosq_config +protocol_version src/handle_connect.c /^ uint8_t protocol_version;$/;" l +protocol_version src/mosquitto_broker_internal.h /^ enum mosquitto__protocol protocol_version;$/;" m struct:mosquitto__bridge typeref:enum:mosquitto__bridge::mosquitto__protocol +protocols src/websockets.c /^static struct libwebsocket_protocols protocols[] = {$/;" v typeref:struct:libwebsocket_protocols file: +provider lib/util_mosq.c /^ HCRYPTPROV provider;$/;" l +psk client/client_shared.h /^ char *psk;$/;" m struct:mosq_config +psk__file_parse src/security_default.c /^static int psk__file_parse(struct mosquitto_db *db, struct mosquitto__unpwd **psk_id, const char *psk_file)$/;" f file: +psk_client_callback lib/net_mosq.c /^static unsigned int psk_client_callback(SSL *ssl, const char *hint,$/;" f file: +psk_file src/mosquitto_broker_internal.h /^ char *psk_file;$/;" m struct:mosquitto__security_options +psk_hint src/mosquitto_broker_internal.h /^ char *psk_hint;$/;" m struct:mosquitto__listener +psk_hint src/net.c /^ const char *psk_hint;$/;" l +psk_id src/mosquitto_broker_internal.h /^ struct mosquitto__unpwd *psk_id;$/;" m struct:mosquitto__listener typeref:struct:mosquitto__listener::mosquitto__unpwd +psk_id src/mosquitto_broker_internal.h /^ struct mosquitto__unpwd *psk_id;$/;" m struct:mosquitto_db typeref:struct:mosquitto_db::mosquitto__unpwd +psk_id_ref src/security_default.c /^ struct mosquitto__unpwd *psk_id_ref = NULL;$/;" l +psk_identity client/client_shared.h /^ char *psk_identity;$/;" m struct:mosq_config +psk_key src/net.c /^ char *psk_key = NULL;$/;" l +psk_key_get_v2 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_psk_key_get_v2 psk_key_get_v2;$/;" m struct:mosquitto__auth_plugin +psk_key_get_v3 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_psk_key_get_v3 psk_key_get_v3;$/;" m struct:mosquitto__auth_plugin +psk_key_get_v4 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_psk_key_get_v4 psk_key_get_v4;$/;" m struct:mosquitto__auth_plugin +psk_server_callback src/net.c /^static unsigned int psk_server_callback(SSL *ssl, const char *identity, unsigned char *psk, unsigned int max_psk_len)$/;" f file: +pskf src/security_default.c /^ char *pskf = db->config->security_options.psk_file;$/;" l +pskf src/security_default.c /^ char *pskf;$/;" l +pthread_cancel lib/dummypthread.h 6;" d +pthread_create lib/dummypthread.h 4;" d +pthread_join lib/dummypthread.h 5;" d +pthread_mutex_destroy lib/dummypthread.h 9;" d +pthread_mutex_init lib/dummypthread.h 8;" d +pthread_mutex_lock lib/dummypthread.h 10;" d +pthread_mutex_unlock lib/dummypthread.h 11;" d +ptr src/mosquitto_broker_internal.h /^ void *ptr;$/;" m union:__anon1 +pub test/broker/02-subpub-qos2-pubrec-error.py /^ pub = subprocess.Popen(['.\/02-subpub-qos2-pubrec-error-helper.py', str(port)], stdout=subprocess.PIPE, stderr=subprocess.PIPE)$/;" v +pub test/broker/02-subpub-qos2-receive-maximum-1.py /^ pub = subprocess.Popen(['.\/02-subpub-qos2-receive-maximum-helper.py', str(port)], stdout=subprocess.PIPE, stderr=subprocess.PIPE)$/;" v +pub test/broker/02-subpub-qos2-receive-maximum-2.py /^ pub = subprocess.Popen(['.\/02-subpub-qos2-receive-maximum-helper.py', str(port)], stdout=subprocess.PIPE, stderr=subprocess.PIPE)$/;" v +pub test/broker/03-publish-b2c-disconnect-qos1.py /^ pub = subprocess.Popen(['.\/03-publish-b2c-disconnect-qos1-helper.py', str(port)], stdout=subprocess.PIPE, stderr=subprocess.PIPE)$/;" v +pub test/broker/03-publish-b2c-disconnect-qos2.py /^ pub = subprocess.Popen(['.\/03-publish-b2c-disconnect-qos2-helper.py', str(port)], stdout=subprocess.PIPE, stderr=subprocess.PIPE)$/;" v +pub test/broker/03-publish-b2c-timeout-qos1.py /^ pub = subprocess.Popen(['.\/03-publish-b2c-timeout-qos1-helper.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE))$/;" v +pub test/broker/03-publish-b2c-timeout-qos2.py /^ pub = subprocess.Popen(['.\/03-publish-b2c-timeout-qos2-helper.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE))$/;" v +pub test/broker/05-clean-session-qos1.py /^ pub = subprocess.Popen(['.\/05-clean-session-qos1-helper.py', str(port)], stdout=subprocess.PIPE, stderr=subprocess.PIPE)$/;" v +pub test/broker/06-bridge-reconnect-local-out.py /^pub = None$/;" v +pub test/broker/08-tls-psk-bridge.py /^ pub = subprocess.Popen(['.\/c\/08-tls-psk-bridge.test', str(port3)], env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE)$/;" v +pub test/broker/08-tls-psk-bridge.py /^pub = None$/;" v +pub test/broker/08-tls-psk-pub.py /^ pub = subprocess.Popen(['.\/c\/08-tls-psk-pub.test', str(port1)], env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE)$/;" v +pub_bytes_received src/sys_tree.c /^ static unsigned long long pub_bytes_received = -1;$/;" l file: +pub_bytes_sent src/sys_tree.c /^ static unsigned long long pub_bytes_sent = -1;$/;" l file: +pub_mode client/client_shared.h /^ int pub_mode; \/* pub, rr *\/$/;" m struct:mosq_config +pub_msgs_received src/sys_tree.c /^ static unsigned long pub_msgs_received = -1;$/;" l file: +pub_msgs_sent src/sys_tree.c /^ static unsigned long pub_msgs_sent = -1;$/;" l file: +pub_shared_cleanup client/pub_client.c /^void pub_shared_cleanup(void)$/;" f +pub_shared_init client/pub_client.c /^int pub_shared_init(void)$/;" f +pub_shared_loop client/pub_client.c /^int pub_shared_loop(struct mosquitto *mosq)$/;" f +pub_sock test/broker/02-subscribe-persistence-flipflop.py /^ pub_sock = mosq_test.do_client_connect(connect_packet_pub, connack_packet_pub, port=port)$/;" v +pub_topic test/lib/03-request-response-correlation.py /^pub_topic = "request\/topic"$/;" v +pub_topic test/lib/03-request-response.py /^pub_topic = "request\/topic"$/;" v +pub_topic_helper test/unit/util_topic_test.c /^static void pub_topic_helper(const char *topic, int rc_expected)$/;" f file: +puback1_packet test/broker/02-subpub-qos1-message-expiry-retain.py /^puback1_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS)$/;" v +puback1_packet test/broker/03-publish-qos1-no-subscribers-v5.py /^puback1_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS)$/;" v +puback1_packet test/broker/11-persistent-subscription-no-local.py /^puback1_packet = mosq_test.gen_puback(mid, proto_ver=5)$/;" v +puback1_packet test/broker/12-prop-maximum-packet-size-publish-qos1.py /^puback1_packet = mosq_test.gen_puback(mid, proto_ver=5)$/;" v +puback1b_packet test/broker/03-publish-qos1-no-subscribers-v5.py /^puback1b_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS)$/;" v +puback1r_packet test/broker/02-subpub-qos2-bad-puback-1.py /^puback1r_packet = mosq_test.gen_puback(mid)$/;" v +puback1r_packet test/broker/02-subpub-qos2-bad-puback-2.py /^puback1r_packet = mosq_test.gen_puback(mid)$/;" v +puback1r_packet test/broker/09-acl-change.py /^puback1r_packet = mosq_test.gen_puback(mid)$/;" v +puback1s_packet test/broker/02-subpub-qos1-bad-pubcomp.py /^puback1s_packet = mosq_test.gen_puback(mid)$/;" v +puback1s_packet test/broker/02-subpub-qos1-bad-pubrec.py /^puback1s_packet = mosq_test.gen_puback(mid)$/;" v +puback1s_packet test/broker/02-subpub-qos1-message-expiry.py /^puback1s_packet = mosq_test.gen_puback(mid)$/;" v +puback1s_packet test/broker/09-acl-change.py /^puback1s_packet = mosq_test.gen_puback(mid)$/;" v +puback1s_packet test/broker/11-message-expiry.py /^puback1s_packet = mosq_test.gen_puback(mid)$/;" v +puback2_packet test/broker/02-subpub-qos1-nolocal.py /^puback2_packet = mosq_test.gen_puback(mid, proto_ver=5)$/;" v +puback2_packet test/broker/03-publish-b2c-disconnect-qos1.py /^puback2_packet = mosq_test.gen_puback(mid)$/;" v +puback2_packet test/broker/03-publish-b2c-disconnect-qos2.py /^puback2_packet = mosq_test.gen_puback(mid)$/;" v +puback2_packet test/broker/03-publish-qos1-no-subscribers-v5.py /^puback2_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS)$/;" v +puback2_packet test/broker/06-bridge-b2br-disconnect-qos1.py /^puback2_packet = mosq_test.gen_puback(mid)$/;" v +puback2_packet test/broker/09-plugin-auth-acl-pub.py /^puback2_packet = mosq_test.gen_puback(mid)$/;" v +puback2_packet test/broker/12-prop-maximum-packet-size-publish-qos1.py /^puback2_packet = mosq_test.gen_puback(mid, proto_ver=5)$/;" v +puback2a_packet test/broker/11-persistent-subscription-no-local.py /^puback2a_packet = mosq_test.gen_puback(mid, proto_ver=5)$/;" v +puback2b_packet test/broker/03-publish-qos1-no-subscribers-v5.py /^puback2b_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS)$/;" v +puback2b_packet test/broker/11-persistent-subscription-no-local.py /^puback2b_packet = mosq_test.gen_puback(mid, proto_ver=5)$/;" v +puback2r_packet test/broker/02-subpub-qos1-message-expiry-retain.py /^puback2r_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS)$/;" v +puback2s_packet test/broker/02-subpub-qos1-message-expiry-retain.py /^puback2s_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS)$/;" v +puback2s_packet test/broker/02-subpub-qos1-message-expiry-will.py /^puback2s_packet = mosq_test.gen_puback(mid)$/;" v +puback2s_packet test/broker/02-subpub-qos1-message-expiry.py /^puback2s_packet = mosq_test.gen_puback(mid)$/;" v +puback2s_packet test/broker/09-acl-change.py /^puback2s_packet = mosq_test.gen_puback(mid)$/;" v +puback2s_packet test/broker/11-message-expiry.py /^puback2s_packet = mosq_test.gen_puback(mid)$/;" v +puback2s_packet test/broker/11-persistent-subscription-no-local.py /^puback2s_packet = mosq_test.gen_puback(mid, proto_ver=5)$/;" v +puback3_packet test/broker/03-publish-qos1-no-subscribers-v5.py /^puback3_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS)$/;" v +puback3_packet test/broker/11-message-expiry.py /^puback3_packet = mosq_test.gen_puback(mid)$/;" v +puback3b_packet test/broker/03-publish-qos1-no-subscribers-v5.py /^puback3b_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS)$/;" v +puback3r_packet test/broker/09-acl-change.py /^puback3r_packet = mosq_test.gen_puback(mid)$/;" v +puback3s_packet test/broker/09-acl-change.py /^puback3s_packet = mosq_test.gen_puback(mid)$/;" v +puback4_packet test/broker/03-publish-qos1-no-subscribers-v5.py /^puback4_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS)$/;" v +puback4s_packet test/broker/09-acl-change.py /^puback4s_packet = mosq_test.gen_puback(mid)$/;" v +puback_1_packet test/lib/03-publish-c2b-qos1-receive-maximum.py /^puback_1_packet = mosq_test.gen_puback(mid, proto_ver=5)$/;" v +puback_1_packet test/lib/03-publish-c2b-qos2-maximum-qos-1.py /^puback_1_packet = mosq_test.gen_puback(mid, proto_ver=5)$/;" v +puback_2_packet test/lib/03-publish-c2b-qos1-receive-maximum.py /^puback_2_packet = mosq_test.gen_puback(mid, proto_ver=5)$/;" v +puback_3_packet test/lib/03-publish-c2b-qos1-receive-maximum.py /^puback_3_packet = mosq_test.gen_puback(mid, proto_ver=5)$/;" v +puback_4_packet test/lib/03-publish-c2b-qos1-receive-maximum.py /^puback_4_packet = mosq_test.gen_puback(mid, proto_ver=5)$/;" v +puback_5_packet test/lib/03-publish-c2b-qos1-receive-maximum.py /^puback_5_packet = mosq_test.gen_puback(mid, proto_ver=5)$/;" v +puback_6_packet test/lib/03-publish-c2b-qos1-receive-maximum.py /^puback_6_packet = mosq_test.gen_puback(mid, proto_ver=5)$/;" v +puback_packet test/broker/01-connect-bad-packet.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/02-subpub-qos1-nolocal.py /^puback_packet = mosq_test.gen_puback(mid, proto_ver=5)$/;" v +puback_packet test/broker/02-subpub-qos1-v5.py /^puback_packet = mosq_test.gen_puback(mid, proto_ver=5)$/;" v +puback_packet test/broker/02-subpub-qos1.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/02-subscribe-persistence-flipflop.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/03-publish-b2c-disconnect-qos1-helper.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/03-publish-b2c-disconnect-qos1.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/03-publish-b2c-qos1-len-helper.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/03-publish-b2c-qos1-len.py /^puback_packet = mosq_test.gen_puback(1)$/;" v +puback_packet test/broker/03-publish-b2c-qos1-len.py /^puback_packet = mosq_test.gen_puback(1, proto_ver=5, reason_code=0x00)$/;" v +puback_packet test/broker/03-publish-b2c-qos1-len.py /^puback_packet = mosq_test.gen_puback(1, proto_ver=5, reason_code=0x00, properties="")$/;" v +puback_packet test/broker/03-publish-b2c-qos1-len.py /^puback_packet = mosq_test.gen_puback(1, proto_ver=5, reason_code=0x00, properties=props)$/;" v +puback_packet test/broker/03-publish-b2c-timeout-qos1-helper.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/03-publish-b2c-timeout-qos1.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/03-publish-dollar.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/03-publish-invalid-utf8.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/03-publish-qos1-retain-disabled.py /^puback_packet = mosq_test.gen_puback(mid, proto_ver=5)$/;" v +puback_packet test/broker/03-publish-qos1.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/04-retain-qos1-qos0.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/05-clean-session-qos1-helper.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/05-clean-session-qos1.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/06-bridge-b2br-disconnect-qos1.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/06-bridge-b2br-late-connection-retain.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/06-bridge-b2br-late-connection.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/06-bridge-br2b-disconnect-qos1-helper.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/06-bridge-br2b-disconnect-qos1.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/06-bridge-fail-persist-resend-qos1.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/06-bridge-fail-persist-resend-qos2.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/06-bridge-reconnect-local-out-helper.py /^puback_packet = mosq_test.gen_puback(mid=1)$/;" v +puback_packet test/broker/09-plugin-auth-acl-sub-denied.py /^puback_packet = mosq_test.gen_puback(mid_pub)$/;" v +puback_packet test/broker/09-plugin-auth-context-params.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/09-plugin-auth-msg-params.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/11-persistent-subscription-v5.py /^puback_packet = mosq_test.gen_puback(mid, proto_ver=5)$/;" v +puback_packet test/broker/11-persistent-subscription.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/broker/11-pub-props.py /^puback_packet = mosq_test.gen_puback(mid, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS, proto_ver=5)$/;" v +puback_packet test/lib/03-publish-b2c-qos1.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/lib/03-publish-c2b-qos1-disconnect.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet test/lib/03-publish-c2b-qos1-len.py /^puback_packet = mosq_test.gen_puback(1)$/;" v +puback_packet test/lib/03-publish-c2b-qos1-len.py /^puback_packet = mosq_test.gen_puback(1, proto_ver=5, reason_code=0x00)$/;" v +puback_packet test/lib/03-publish-c2b-qos1-len.py /^puback_packet = mosq_test.gen_puback(1, proto_ver=5, reason_code=0x00, properties="")$/;" v +puback_packet test/lib/03-publish-c2b-qos1-len.py /^puback_packet = mosq_test.gen_puback(1, proto_ver=5, reason_code=0x00, properties=props)$/;" v +puback_packet test/lib/03-publish-c2b-qos1-timeout.py /^puback_packet = mosq_test.gen_puback(mid)$/;" v +puback_packet_unknown test/broker/06-bridge-fail-persist-resend-qos1.py /^puback_packet_unknown = mosq_test.gen_puback(mid_unknown)$/;" v +pubcomp1_packet test/broker/09-plugin-auth-acl-pub.py /^pubcomp1_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp1_packet test/broker/12-prop-maximum-packet-size-publish-qos2.py /^pubcomp1_packet = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp1r_packet test/broker/02-subpub-qos1-bad-pubcomp.py /^pubcomp1r_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp1r_packet test/broker/02-subpub-qos2-bad-pubcomp.py /^pubcomp1r_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp1s_packet test/broker/02-subpub-qos2-bad-puback-1.py /^pubcomp1s_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp1s_packet test/broker/02-subpub-qos2-bad-puback-2.py /^pubcomp1s_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp1s_packet test/broker/02-subpub-qos2-bad-pubcomp.py /^pubcomp1s_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp2_packet test/broker/12-prop-maximum-packet-size-publish-qos2.py /^pubcomp2_packet = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_1_packet test/broker/02-subpub-qos2-pubrec-error-helper.py /^pubcomp_1_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp_1_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^pubcomp_1_packet = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_1_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^pubcomp_1_packet = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_2_packet test/broker/02-subpub-qos2-pubrec-error-helper.py /^pubcomp_2_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp_2_packet test/broker/02-subpub-qos2-pubrec-error.py /^pubcomp_2_packet = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_2_packet test/lib/03-publish-c2b-qos2-pubrec-error.py /^pubcomp_2_packet = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_2_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^pubcomp_2_packet = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_2_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^pubcomp_2_packet = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_3_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^pubcomp_3_packet = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_3_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^pubcomp_3_packet = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_4_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^pubcomp_4_packet = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_4_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^pubcomp_4_packet = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_5_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^pubcomp_5_packet = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_5_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^pubcomp_5_packet = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_packet test/broker/02-subpub-qos2-receive-maximum-helper.py /^pubcomp_packet = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_packet test/broker/02-subpub-qos2-v5.py /^pubcomp_packet = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_packet test/broker/02-subpub-qos2.py /^pubcomp_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp_packet test/broker/03-publish-b2c-disconnect-qos2-helper.py /^pubcomp_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp_packet test/broker/03-publish-b2c-disconnect-qos2.py /^pubcomp_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp_packet test/broker/03-publish-b2c-qos2-len-helper.py /^pubcomp_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp_packet test/broker/03-publish-b2c-qos2-len.py /^pubcomp_packet = mosq_test.gen_pubcomp(1)$/;" v +pubcomp_packet test/broker/03-publish-b2c-qos2-len.py /^pubcomp_packet = mosq_test.gen_pubcomp(1, proto_ver=5, reason_code=0x00)$/;" v +pubcomp_packet test/broker/03-publish-b2c-qos2-len.py /^pubcomp_packet = mosq_test.gen_pubcomp(1, proto_ver=5, reason_code=0x00, properties="")$/;" v +pubcomp_packet test/broker/03-publish-b2c-qos2-len.py /^pubcomp_packet = mosq_test.gen_pubcomp(1, proto_ver=5, reason_code=0x00, properties=props)$/;" v +pubcomp_packet test/broker/03-publish-b2c-timeout-qos2-helper.py /^pubcomp_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp_packet test/broker/03-publish-b2c-timeout-qos2.py /^pubcomp_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp_packet test/broker/03-publish-c2b-disconnect-qos2.py /^pubcomp_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp_packet test/broker/03-publish-c2b-timeout-qos2.py /^pubcomp_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp_packet test/broker/03-publish-qos2.py /^pubcomp_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp_packet test/broker/06-bridge-b2br-disconnect-qos2.py /^pubcomp_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp_packet test/broker/06-bridge-br2b-disconnect-qos2-helper.py /^pubcomp_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp_packet test/broker/06-bridge-br2b-disconnect-qos2.py /^pubcomp_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp_packet test/lib/03-publish-b2c-qos2.py /^pubcomp_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp_packet test/lib/03-publish-c2b-qos2-disconnect.py /^pubcomp_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp_packet test/lib/03-publish-c2b-qos2-len.py /^pubcomp_packet = mosq_test.gen_pubcomp(1)$/;" v +pubcomp_packet test/lib/03-publish-c2b-qos2-len.py /^pubcomp_packet = mosq_test.gen_pubcomp(1, proto_ver=5, reason_code=0x00)$/;" v +pubcomp_packet test/lib/03-publish-c2b-qos2-len.py /^pubcomp_packet = mosq_test.gen_pubcomp(1, proto_ver=5, reason_code=0x00, properties="")$/;" v +pubcomp_packet test/lib/03-publish-c2b-qos2-len.py /^pubcomp_packet = mosq_test.gen_pubcomp(1, proto_ver=5, reason_code=0x00, properties=props)$/;" v +pubcomp_packet test/lib/03-publish-c2b-qos2-timeout.py /^pubcomp_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp_packet test/lib/03-publish-c2b-qos2.py /^pubcomp_packet = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp_packet1 test/broker/02-subpub-qos2-receive-maximum-1.py /^pubcomp_packet1 = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_packet1 test/broker/02-subpub-qos2-receive-maximum-2.py /^pubcomp_packet1 = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_packet2 test/broker/02-subpub-qos2-receive-maximum-1.py /^pubcomp_packet2 = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_packet2 test/broker/02-subpub-qos2-receive-maximum-2.py /^pubcomp_packet2 = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_packet2 test/broker/02-subpub-qos2-receive-maximum-helper.py /^pubcomp_packet2 = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_packet2 test/broker/02-subpub-qos2-v5.py /^pubcomp_packet2 = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_packet2 test/broker/02-subpub-qos2.py /^pubcomp_packet2 = mosq_test.gen_pubcomp(mid)$/;" v +pubcomp_packet3 test/broker/02-subpub-qos2-receive-maximum-1.py /^pubcomp_packet3 = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_packet3 test/broker/02-subpub-qos2-receive-maximum-2.py /^pubcomp_packet3 = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_packet3 test/broker/02-subpub-qos2-receive-maximum-helper.py /^pubcomp_packet3 = mosq_test.gen_pubcomp(mid, proto_ver=5)$/;" v +pubcomp_packet_unknown2 test/broker/06-bridge-fail-persist-resend-qos2.py /^pubcomp_packet_unknown2 = mosq_test.gen_pubcomp(mid_unknown+2)$/;" v +pubcomp_packet_unknown3 test/broker/06-bridge-fail-persist-resend-qos2.py /^pubcomp_packet_unknown3 = mosq_test.gen_pubcomp(mid_unknown+3)$/;" v +publish lib/cpp/mosquittopp.cpp /^int mosquittopp::publish(int *mid, const char *topic, int payloadlen, const void *payload, int qos, bool retain)$/;" f class:mosqpp::mosquittopp +publish0_packet test/broker/04-retain-qos1-qos0.py /^publish0_packet = mosq_test.gen_publish("retain\/qos1\/test", qos=0, payload="retained message", retain=True)$/;" v +publish1_packet test/broker/02-shared-qos0-v5.py /^publish1_packet = mosq_test.gen_publish("share-test", qos=0, payload="message1", proto_ver=5)$/;" v +publish1_packet test/broker/02-subpub-qos0-retain-as-publish.py /^publish1_packet = mosq_test.gen_publish("subpub\/normal", qos=0, retain=True, payload="message", proto_ver=5)$/;" v +publish1_packet test/broker/02-subpub-qos0-send-retain.py /^publish1_packet = mosq_test.gen_publish("subpub\/always", qos=0, retain=True, payload="message", proto_ver=5)$/;" v +publish1_packet test/broker/02-subpub-qos0-subscription-id.py /^publish1_packet = mosq_test.gen_publish("subpub\/id1", qos=0, payload="message1", proto_ver=5)$/;" v +publish1_packet test/broker/02-subpub-qos0-topic-alias-unknown.py /^publish1_packet = mosq_test.gen_publish("", qos=0, payload="message", proto_ver=5, properties=props)$/;" v +publish1_packet test/broker/02-subpub-qos0-topic-alias.py /^publish1_packet = mosq_test.gen_publish("subpub\/alias", qos=0, payload="message", proto_ver=5, properties=props)$/;" v +publish1_packet test/broker/02-subpub-qos1-message-expiry-retain.py /^publish1_packet = mosq_test.gen_publish("subpub\/expired", mid=mid, qos=1, retain=True, payload="message1", proto_ver=5, properties=props)$/;" v +publish1_packet test/broker/03-publish-qos1-no-subscribers-v5.py /^publish1_packet = mosq_test.gen_publish("pub", qos=1, mid=mid, payload="message", proto_ver=5)$/;" v +publish1_packet test/broker/09-plugin-auth-acl-pub.py /^publish1_packet = mosq_test.gen_publish("readonly", qos=2, mid=mid, payload="message")$/;" v +publish1_packet test/broker/11-persistent-subscription-no-local.py /^publish1_packet = mosq_test.gen_publish("subpub\/nolocal", qos=1, mid=mid, payload="message", proto_ver=5)$/;" v +publish1_packet test/broker/12-prop-maximum-packet-size-publish-qos1.py /^publish1_packet = mosq_test.gen_publish(topic="test\/topic", mid=mid, qos=1, payload="12345678901234567890", proto_ver=5)$/;" v +publish1_packet test/broker/12-prop-maximum-packet-size-publish-qos2.py /^publish1_packet = mosq_test.gen_publish(topic="test\/topic", mid=mid, qos=2, payload="12345678901234567890", proto_ver=5)$/;" v +publish1_packet test/broker/12-prop-maximum-packet-size-publish.py /^publish1_packet = mosq_test.gen_publish(topic="test\/topic", qos=0, payload="12345678901234567890", proto_ver=5)$/;" v +publish1_packet test/lib/03-request-response.py /^publish1_packet = mosq_test.gen_publish(pub_topic, qos=0, payload="action", proto_ver=5, properties=props)$/;" v +publish1_packet_incoming test/lib/03-request-response-correlation.py /^publish1_packet_incoming = mosq_test.gen_publish(pub_topic, qos=0, payload="action", proto_ver=5, properties=props)$/;" v +publish1_packet_outgoing test/lib/03-request-response-correlation.py /^publish1_packet_outgoing = mosq_test.gen_publish(pub_topic, qos=0, payload="action", proto_ver=5, properties=props)$/;" v +publish1b_packet test/broker/03-publish-qos1-no-subscribers-v5.py /^publish1b_packet = mosq_test.gen_publish("pub", qos=1, mid=mid, payload="message", proto_ver=5)$/;" v +publish1r1_packet test/broker/02-subpub-qos0-send-retain.py /^publish1r1_packet = mosq_test.gen_publish("subpub\/always", qos=0, retain=True, payload="message", proto_ver=5)$/;" v +publish1r2_packet test/broker/02-subpub-qos0-send-retain.py /^publish1r2_packet = mosq_test.gen_publish("subpub\/always", qos=0, retain=True, payload="message", proto_ver=5)$/;" v +publish1r_packet test/broker/02-subpub-qos0-retain-as-publish.py /^publish1r_packet = mosq_test.gen_publish("subpub\/normal", qos=0, retain=False, payload="message", proto_ver=5)$/;" v +publish1r_packet test/broker/02-subpub-qos0-subscription-id.py /^publish1r_packet = mosq_test.gen_publish("subpub\/id1", qos=0, payload="message1", proto_ver=5, properties=props)$/;" v +publish1r_packet test/broker/02-subpub-qos1-bad-pubcomp.py /^publish1r_packet = mosq_test.gen_publish("subpub\/qos1", qos=1, mid=mid, payload="message")$/;" v +publish1r_packet test/broker/02-subpub-qos1-bad-pubrec.py /^publish1r_packet = mosq_test.gen_publish("subpub\/qos1", qos=1, mid=mid, payload="message")$/;" v +publish1r_packet test/broker/02-subpub-qos2-bad-puback-1.py /^publish1r_packet = mosq_test.gen_publish("subpub\/qos2", qos=2, mid=mid, payload="message")$/;" v +publish1r_packet test/broker/02-subpub-qos2-bad-puback-2.py /^publish1r_packet = mosq_test.gen_publish("subpub\/qos2", qos=2, mid=mid, payload="message")$/;" v +publish1r_packet test/broker/02-subpub-qos2-bad-pubcomp.py /^publish1r_packet = mosq_test.gen_publish("subpub\/qos2", qos=2, mid=mid, payload="message")$/;" v +publish1r_packet test/broker/09-acl-change.py /^publish1r_packet = mosq_test.gen_publish(topic="topic\/one", mid=mid, qos=1, payload="message1")$/;" v +publish1ru_packet test/broker/02-subpub-qos0-subscription-id.py /^publish1ru_packet = mosq_test.gen_publish("subpub\/id1", qos=0, payload="message1", proto_ver=5)$/;" v +publish1s_packet test/broker/02-subpub-qos1-bad-pubcomp.py /^publish1s_packet = mosq_test.gen_publish("subpub\/qos1", qos=1, mid=mid, payload="message")$/;" v +publish1s_packet test/broker/02-subpub-qos1-bad-pubrec.py /^publish1s_packet = mosq_test.gen_publish("subpub\/qos1", qos=1, mid=mid, payload="message")$/;" v +publish1s_packet test/broker/02-subpub-qos1-message-expiry.py /^publish1s_packet = mosq_test.gen_publish("subpub\/qos1", mid=mid, qos=1, payload="message1", proto_ver=5, properties=props)$/;" v +publish1s_packet test/broker/02-subpub-qos2-bad-puback-1.py /^publish1s_packet = mosq_test.gen_publish("subpub\/qos2", qos=2, mid=mid, payload="message")$/;" v +publish1s_packet test/broker/02-subpub-qos2-bad-puback-2.py /^publish1s_packet = mosq_test.gen_publish("subpub\/qos2", qos=2, mid=mid, payload="message")$/;" v +publish1s_packet test/broker/02-subpub-qos2-bad-pubcomp.py /^publish1s_packet = mosq_test.gen_publish("subpub\/qos2", qos=2, mid=mid, payload="message")$/;" v +publish1s_packet test/broker/09-acl-change.py /^publish1s_packet = mosq_test.gen_publish(topic="topic\/one", mid=mid, qos=1, payload="message1")$/;" v +publish1s_packet test/broker/11-message-expiry.py /^publish1s_packet = mosq_test.gen_publish("subpub\/qos1", mid=mid, qos=1, payload="message1", proto_ver=5, properties=props)$/;" v +publish2_packet test/broker/02-shared-qos0-v5.py /^publish2_packet = mosq_test.gen_publish("share-test", qos=0, payload="message2", proto_ver=5)$/;" v +publish2_packet test/broker/02-subpub-qos0-retain-as-publish.py /^publish2_packet = mosq_test.gen_publish("subpub\/rap", qos=0, retain=True, payload="message", proto_ver=5)$/;" v +publish2_packet test/broker/02-subpub-qos0-send-retain.py /^publish2_packet = mosq_test.gen_publish("subpub\/new", qos=0, retain=True, payload="message", proto_ver=5)$/;" v +publish2_packet test/broker/02-subpub-qos0-subscription-id.py /^publish2_packet = mosq_test.gen_publish("subpub\/test\/id2", qos=0, payload="message2", proto_ver=5)$/;" v +publish2_packet test/broker/02-subpub-qos1-nolocal.py /^publish2_packet = mosq_test.gen_publish("subpub\/receive", qos=1, mid=mid, payload="success", proto_ver=5)$/;" v +publish2_packet test/broker/03-publish-b2c-disconnect-qos1.py /^publish2_packet = mosq_test.gen_publish("qos1\/outgoing", qos=1, mid=mid, payload="outgoing-message")$/;" v +publish2_packet test/broker/03-publish-b2c-disconnect-qos2.py /^publish2_packet = mosq_test.gen_publish("qos1\/outgoing", qos=1, mid=mid, payload="outgoing-message")$/;" v +publish2_packet test/broker/03-publish-qos1-no-subscribers-v5.py /^publish2_packet = mosq_test.gen_publish("pub\/qos1", qos=1, mid=mid, payload="message", proto_ver=5)$/;" v +publish2_packet test/broker/06-bridge-b2br-disconnect-qos1.py /^publish2_packet = mosq_test.gen_publish("bridge\/disconnect\/test", qos=1, mid=mid, payload="disconnect-message")$/;" v +publish2_packet test/broker/09-plugin-auth-acl-pub.py /^publish2_packet = mosq_test.gen_publish("writeable", qos=1, mid=mid, payload="message")$/;" v +publish2_packet test/broker/11-pub-props.py /^publish2_packet = mosq_test.gen_publish("subpub\/qos1", qos=0, payload="message", proto_ver=5, properties=props, retain=True)$/;" v +publish2_packet test/broker/12-prop-maximum-packet-size-publish-qos1.py /^publish2_packet = mosq_test.gen_publish(topic="test\/topic", mid=mid, qos=1, payload="7890", proto_ver=5)$/;" v +publish2_packet test/broker/12-prop-maximum-packet-size-publish-qos2.py /^publish2_packet = mosq_test.gen_publish(topic="test\/topic", mid=mid, qos=2, payload="7890", proto_ver=5)$/;" v +publish2_packet test/broker/12-prop-maximum-packet-size-publish.py /^publish2_packet = mosq_test.gen_publish(topic="test\/topic", qos=0, payload="67890", proto_ver=5)$/;" v +publish2_packet test/lib/03-request-response-correlation.py /^publish2_packet = mosq_test.gen_publish(resp_topic, qos=0, payload="a response", proto_ver=5, properties=props)$/;" v +publish2_packet test/lib/03-request-response.py /^publish2_packet = mosq_test.gen_publish(resp_topic, qos=0, payload="a response", proto_ver=5)$/;" v +publish2a_packet test/broker/11-persistent-subscription-no-local.py /^publish2a_packet = mosq_test.gen_publish("subpub\/local", qos=1, mid=mid, payload="message", proto_ver=5)$/;" v +publish2b_packet test/broker/03-publish-qos1-no-subscribers-v5.py /^publish2b_packet = mosq_test.gen_publish("pub\/qos1", qos=1, mid=mid, payload="message", proto_ver=5)$/;" v +publish2b_packet test/broker/11-persistent-subscription-no-local.py /^publish2b_packet = mosq_test.gen_publish("subpub\/local", qos=1, mid=mid, payload="message", proto_ver=5)$/;" v +publish2r1_packet test/broker/02-subpub-qos0-send-retain.py /^publish2r1_packet = mosq_test.gen_publish("subpub\/new", qos=0, retain=True, payload="message", proto_ver=5)$/;" v +publish2r2_packet test/broker/02-subpub-qos0-send-retain.py /^publish2r2_packet = mosq_test.gen_publish("subpub\/new", qos=0, retain=False, payload="message", proto_ver=5)$/;" v +publish2r_packet test/broker/02-subpub-qos0-retain-as-publish.py /^publish2r_packet = mosq_test.gen_publish("subpub\/rap", qos=0, retain=True, payload="message", proto_ver=5)$/;" v +publish2r_packet test/broker/02-subpub-qos0-subscription-id.py /^publish2r_packet = mosq_test.gen_publish("subpub\/test\/id2", qos=0, payload="message2", proto_ver=5, properties=props)$/;" v +publish2r_packet test/broker/02-subpub-qos0-topic-alias.py /^publish2r_packet = mosq_test.gen_publish("subpub\/alias", qos=0, payload="message", proto_ver=5)$/;" v +publish2r_packet test/broker/02-subpub-qos1-message-expiry-retain.py /^publish2r_packet = mosq_test.gen_publish("subpub\/kept", mid=mid, qos=1, retain=True, payload="message2", proto_ver=5)$/;" v +publish2r_packet test/broker/02-subpub-qos1-message-expiry-will.py /^ publish2r_packet = mosq_test.gen_publish("subpub\/qos1", mid=1, qos=1, payload="message", proto_ver=5, properties=props)$/;" v +publish2r_packet test/broker/02-subpub-qos1-message-expiry.py /^ publish2r_packet = mosq_test.gen_publish("subpub\/qos1", mid=2, qos=1, payload="message2", proto_ver=5, properties=props)$/;" v +publish2ru_packet test/broker/02-subpub-qos0-subscription-id.py /^publish2ru_packet = mosq_test.gen_publish("subpub\/test\/id2", qos=0, payload="message2", proto_ver=5, properties=props)$/;" v +publish2s_packet test/broker/02-subpub-qos0-topic-alias.py /^publish2s_packet = mosq_test.gen_publish("", qos=0, payload="message", proto_ver=5, properties=props)$/;" v +publish2s_packet test/broker/02-subpub-qos1-message-expiry-retain.py /^publish2s_packet = mosq_test.gen_publish("subpub\/kept", mid=mid, qos=1, retain=True, payload="message2", proto_ver=5)$/;" v +publish2s_packet test/broker/02-subpub-qos1-message-expiry-will.py /^publish2s_packet = mosq_test.gen_publish("subpub\/qos1", mid=mid, qos=1, payload="message2", proto_ver=5, properties=props)$/;" v +publish2s_packet test/broker/02-subpub-qos1-message-expiry.py /^publish2s_packet = mosq_test.gen_publish("subpub\/qos1", mid=mid, qos=1, payload="message2", proto_ver=5, properties=props)$/;" v +publish2s_packet test/broker/09-acl-change.py /^publish2s_packet = mosq_test.gen_publish(topic="topic\/two", mid=mid, qos=1, payload="message2")$/;" v +publish2s_packet test/broker/11-message-expiry.py /^publish2s_packet = mosq_test.gen_publish("subpub\/qos1", mid=mid, qos=1, payload="message2", proto_ver=5, properties=props)$/;" v +publish2s_packet test/broker/11-persistent-subscription-no-local.py /^publish2s_packet = mosq_test.gen_publish("subpub\/local", qos=1, mid=mid, payload="message", proto_ver=5)$/;" v +publish3_packet test/broker/02-shared-qos0-v5.py /^publish3_packet = mosq_test.gen_publish("share-test", qos=0, payload="message3", proto_ver=5)$/;" v +publish3_packet test/broker/02-subpub-qos0-retain-as-publish.py /^publish3_packet = mosq_test.gen_publish("subpub\/receive", qos=1, mid=mid, payload="success", proto_ver=5)$/;" v +publish3_packet test/broker/02-subpub-qos0-send-retain.py /^publish3_packet = mosq_test.gen_publish("subpub\/never", qos=0, retain=True, payload="message", proto_ver=5)$/;" v +publish3_packet test/broker/02-subpub-qos0-subscription-id.py /^publish3_packet = mosq_test.gen_publish("subpub\/noid", qos=0, payload="message3", proto_ver=5)$/;" v +publish3_packet test/broker/02-subpub-qos1-nolocal.py /^publish3_packet = mosq_test.gen_publish("subpub\/receive", qos=1, mid=mid, payload="success", proto_ver=5)$/;" v +publish3_packet test/broker/03-publish-qos1-no-subscribers-v5.py /^publish3_packet = mosq_test.gen_publish("pub\/qos1\/test", qos=1, mid=mid, payload="message", proto_ver=5)$/;" v +publish3_packet test/broker/11-message-expiry.py /^publish3_packet = mosq_test.gen_publish("subpub\/qos1", mid=mid, qos=1, payload="message3", proto_ver=5)$/;" v +publish3b_packet test/broker/03-publish-qos1-no-subscribers-v5.py /^publish3b_packet = mosq_test.gen_publish("pub\/qos1\/test", qos=1, mid=mid, payload="message", proto_ver=5)$/;" v +publish3r1_packet test/broker/02-subpub-qos0-send-retain.py /^publish3r1_packet = mosq_test.gen_publish("subpub\/never", qos=0, retain=False, payload="message", proto_ver=5)$/;" v +publish3r2_packet test/broker/02-subpub-qos0-send-retain.py /^publish3r2_packet = mosq_test.gen_publish("subpub\/never", qos=0, retain=False, payload="message", proto_ver=5)$/;" v +publish3r_packet test/broker/09-acl-change.py /^publish3r_packet = mosq_test.gen_publish(topic="topic\/one", mid=mid, qos=1, payload="message3")$/;" v +publish3ru_packet test/broker/02-subpub-qos0-subscription-id.py /^publish3ru_packet = mosq_test.gen_publish("subpub\/noid", qos=0, payload="message3", proto_ver=5, properties=props)$/;" v +publish3s_packet test/broker/09-acl-change.py /^publish3s_packet = mosq_test.gen_publish(topic="topic\/one", mid=mid, qos=1, payload="message3")$/;" v +publish4_packet test/broker/03-publish-qos1-no-subscribers-v5.py /^publish4_packet = mosq_test.gen_publish("pub\/qos1\/test", qos=1, mid=mid, payload="message", proto_ver=5, retain=True)$/;" v +publish4s_packet test/broker/09-acl-change.py /^publish4s_packet = mosq_test.gen_publish(topic="topic\/two", mid=mid, qos=1, payload="message4")$/;" v +publish_1_packet test/broker/02-subpub-qos2-pubrec-error-helper.py /^publish_1_packet = mosq_test.gen_publish("qos2\/pubrec\/rejected", qos=2, mid=mid, payload="rejected-message")$/;" v +publish_1_packet test/broker/02-subpub-qos2-pubrec-error.py /^publish_1_packet = mosq_test.gen_publish("qos2\/pubrec\/rejected", qos=2, mid=mid, payload="rejected-message", proto_ver=5)$/;" v +publish_1_packet test/lib/03-publish-c2b-qos1-receive-maximum.py /^publish_1_packet = mosq_test.gen_publish("topic", qos=1, mid=mid, payload="12345", proto_ver=5)$/;" v +publish_1_packet test/lib/03-publish-c2b-qos2-maximum-qos-0.py /^publish_1_packet = mosq_test.gen_publish("maximum\/qos\/qos0", qos=0, payload="message", proto_ver=5)$/;" v +publish_1_packet test/lib/03-publish-c2b-qos2-maximum-qos-1.py /^publish_1_packet = mosq_test.gen_publish("maximum\/qos\/qos1", qos=1, mid=mid, payload="message", proto_ver=5)$/;" v +publish_1_packet test/lib/03-publish-c2b-qos2-pubrec-error.py /^publish_1_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="rejected", proto_ver=5)$/;" v +publish_1_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^publish_1_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="12345", proto_ver=5)$/;" v +publish_1_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^publish_1_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="12345", proto_ver=5)$/;" v +publish_2_packet test/broker/02-subpub-qos2-pubrec-error-helper.py /^publish_2_packet = mosq_test.gen_publish("qos2\/pubrec\/accepted", qos=2, mid=mid, payload="accepted-message")$/;" v +publish_2_packet test/broker/02-subpub-qos2-pubrec-error.py /^publish_2_packet = mosq_test.gen_publish("qos2\/pubrec\/accepted", qos=2, mid=mid, payload="accepted-message", proto_ver=5)$/;" v +publish_2_packet test/lib/03-publish-c2b-qos1-receive-maximum.py /^publish_2_packet = mosq_test.gen_publish("topic", qos=1, mid=mid, payload="12345", proto_ver=5)$/;" v +publish_2_packet test/lib/03-publish-c2b-qos2-maximum-qos-1.py /^publish_2_packet = mosq_test.gen_publish("maximum\/qos\/qos0", qos=0, payload="message", proto_ver=5)$/;" v +publish_2_packet test/lib/03-publish-c2b-qos2-pubrec-error.py /^publish_2_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="accepted", proto_ver=5)$/;" v +publish_2_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^publish_2_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="12345", proto_ver=5)$/;" v +publish_2_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^publish_2_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="12345", proto_ver=5)$/;" v +publish_3_packet test/lib/03-publish-c2b-qos1-receive-maximum.py /^publish_3_packet = mosq_test.gen_publish("topic", qos=1, mid=mid, payload="12345", proto_ver=5)$/;" v +publish_3_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^publish_3_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="12345", proto_ver=5)$/;" v +publish_3_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^publish_3_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="12345", proto_ver=5)$/;" v +publish_4_packet test/lib/03-publish-c2b-qos1-receive-maximum.py /^publish_4_packet = mosq_test.gen_publish("topic", qos=1, mid=mid, payload="12345", proto_ver=5)$/;" v +publish_4_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^publish_4_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="12345", proto_ver=5)$/;" v +publish_4_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^publish_4_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="12345", proto_ver=5)$/;" v +publish_5_packet test/lib/03-publish-c2b-qos1-receive-maximum.py /^publish_5_packet = mosq_test.gen_publish("topic", qos=1, mid=mid, payload="12345", proto_ver=5)$/;" v +publish_5_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^publish_5_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="12345", proto_ver=5)$/;" v +publish_5_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^publish_5_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="12345", proto_ver=5)$/;" v +publish_6_packet test/lib/03-publish-c2b-qos1-receive-maximum.py /^publish_6_packet = mosq_test.gen_publish("topic", qos=1, mid=mid, payload="12345", proto_ver=5)$/;" v +publish_count client/pub_client.c /^static int publish_count = 0;$/;" v file: +publish_dropped src/sys_tree.c /^ static unsigned long publish_dropped = -1;$/;" l file: +publish_dropped test/broker/03-publish-qos1-queued-bytes.py /^ def publish_dropped(self, client, userdata, message):$/;" m class:BrokerMonitor +publish_dropped_interval src/sys_tree.c /^ double msgs_received_interval, msgs_sent_interval, publish_dropped_interval;$/;" l +publish_dropped_load1 src/sys_tree.c /^ static double publish_dropped_load1 = 0;$/;" l file: +publish_dropped_load15 src/sys_tree.c /^ static double publish_dropped_load15 = 0;$/;" l file: +publish_dropped_load5 src/sys_tree.c /^ static double publish_dropped_load5 = 0;$/;" l file: +publish_dup_packet test/broker/03-publish-b2c-disconnect-qos1.py /^publish_dup_packet = mosq_test.gen_publish("qos1\/disconnect\/test", qos=1, mid=mid, payload="disconnect-message", dup=True)$/;" v +publish_dup_packet test/broker/03-publish-b2c-disconnect-qos2.py /^publish_dup_packet = mosq_test.gen_publish("qos2\/disconnect\/test", qos=2, mid=mid, payload="disconnect-message", dup=True)$/;" v +publish_dup_packet test/broker/03-publish-b2c-timeout-qos1.py /^publish_dup_packet = mosq_test.gen_publish("qos1\/timeout\/test", qos=1, mid=mid, payload="timeout-message", dup=True)$/;" v +publish_dup_packet test/broker/03-publish-b2c-timeout-qos2.py /^publish_dup_packet = mosq_test.gen_publish("qos2\/timeout\/test", qos=2, mid=mid, payload="timeout-message", dup=True)$/;" v +publish_dup_packet test/broker/03-publish-c2b-disconnect-qos2.py /^publish_dup_packet = mosq_test.gen_publish("qos2\/disconnect\/test", qos=2, mid=mid, payload="disconnect-message", dup=True)$/;" v +publish_dup_packet test/broker/06-bridge-b2br-disconnect-qos1.py /^publish_dup_packet = mosq_test.gen_publish("bridge\/disconnect\/test", qos=1, mid=mid, payload="disconnect-message", dup=True)$/;" v +publish_dup_packet test/broker/06-bridge-b2br-disconnect-qos2.py /^publish_dup_packet = mosq_test.gen_publish("bridge\/disconnect\/test", qos=2, mid=mid, payload="disconnect-message", dup=True)$/;" v +publish_dup_packet test/broker/06-bridge-br2b-disconnect-qos1.py /^publish_dup_packet = mosq_test.gen_publish("bridge\/disconnect\/test", qos=1, mid=mid, payload="disconnect-message", dup=True)$/;" v +publish_dup_packet test/broker/06-bridge-br2b-disconnect-qos2.py /^publish_dup_packet = mosq_test.gen_publish("bridge\/disconnect\/test", qos=2, mid=mid, payload="disconnect-message", dup=True)$/;" v +publish_dup_packet test/lib/03-publish-c2b-qos2-disconnect.py /^publish_dup_packet = mosq_test.gen_publish("pub\/qos2\/test", qos=2, mid=mid, payload="message", dup=True)$/;" v +publish_dup_packet test/lib/03-publish-c2b-qos2-timeout.py /^publish_dup_packet = mosq_test.gen_publish("pub\/qos2\/test", qos=2, mid=mid, payload="message", dup=True)$/;" v +publish_dup_packet test/lib/03-publish-c2b-qos2.py /^publish_dup_packet = mosq_test.gen_publish("pub\/qos2\/test", qos=2, mid=mid, payload="message", dup=True)$/;" v +publish_fresh_packet test/broker/04-retain-qos0-fresh.py /^publish_fresh_packet = mosq_test.gen_publish("retain\/qos0\/test", qos=0, payload="retained message")$/;" v +publish_packet test/broker/01-connect-bad-packet.py /^publish_packet = mosq_test.gen_publish("pub\/qos1\/test", qos=1, mid=mid, payload="message")$/;" v +publish_packet test/broker/02-subpub-qos0-v5.py /^publish_packet = mosq_test.gen_publish("subpub\/qos0", qos=0, payload="message", proto_ver=5)$/;" v +publish_packet test/broker/02-subpub-qos0.py /^publish_packet = mosq_test.gen_publish("subpub\/qos0", qos=0, payload="message")$/;" v +publish_packet test/broker/02-subpub-qos1-nolocal.py /^publish_packet = mosq_test.gen_publish("subpub\/qos1", qos=1, mid=mid, payload="message", proto_ver=5)$/;" v +publish_packet test/broker/02-subpub-qos1-v5.py /^publish_packet = mosq_test.gen_publish("subpub\/qos1", qos=1, mid=mid, payload="message", proto_ver=5)$/;" v +publish_packet test/broker/02-subpub-qos1.py /^publish_packet = mosq_test.gen_publish("subpub\/qos1", qos=1, mid=mid, payload="message")$/;" v +publish_packet test/broker/02-subpub-qos2-receive-maximum-helper.py /^publish_packet = mosq_test.gen_publish("subpub\/qos2", qos=2, mid=mid, payload="message1", proto_ver=5)$/;" v +publish_packet test/broker/02-subpub-qos2-v5.py /^publish_packet = mosq_test.gen_publish("subpub\/qos2", qos=2, mid=mid, payload="message", proto_ver=5)$/;" v +publish_packet test/broker/02-subpub-qos2.py /^publish_packet = mosq_test.gen_publish("subpub\/qos2", qos=2, mid=mid, payload="message")$/;" v +publish_packet test/broker/02-subscribe-persistence-flipflop.py /^publish_packet = mosq_test.gen_publish("flipflop\/test", qos=1, mid=mid, payload="message")$/;" v +publish_packet test/broker/03-pattern-matching-helper.py /^publish_packet = mosq_test.gen_publish(sys.argv[1], qos=0, retain=True, payload="message")$/;" v +publish_packet test/broker/03-publish-b2c-disconnect-qos1-helper.py /^publish_packet = mosq_test.gen_publish("qos1\/disconnect\/test", qos=1, mid=mid, payload="disconnect-message")$/;" v +publish_packet test/broker/03-publish-b2c-disconnect-qos1.py /^publish_packet = mosq_test.gen_publish("qos1\/disconnect\/test", qos=1, mid=mid, payload="disconnect-message")$/;" v +publish_packet test/broker/03-publish-b2c-disconnect-qos2-helper.py /^publish_packet = mosq_test.gen_publish("qos2\/disconnect\/test", qos=2, mid=mid, payload="disconnect-message")$/;" v +publish_packet test/broker/03-publish-b2c-disconnect-qos2.py /^publish_packet = mosq_test.gen_publish("qos2\/disconnect\/test", qos=2, mid=mid, payload="disconnect-message")$/;" v +publish_packet test/broker/03-publish-b2c-qos1-len-helper.py /^publish_packet = mosq_test.gen_publish("qos1\/len\/test", qos=1, mid=mid, payload="len-message")$/;" v +publish_packet test/broker/03-publish-b2c-qos2-len-helper.py /^publish_packet = mosq_test.gen_publish("qos2\/len\/test", qos=2, mid=mid, payload="len-message")$/;" v +publish_packet test/broker/03-publish-b2c-timeout-qos1-helper.py /^publish_packet = mosq_test.gen_publish("qos1\/timeout\/test", qos=1, mid=mid, payload="timeout-message")$/;" v +publish_packet test/broker/03-publish-b2c-timeout-qos1.py /^publish_packet = mosq_test.gen_publish("qos1\/timeout\/test", qos=1, mid=mid, payload="timeout-message")$/;" v +publish_packet test/broker/03-publish-b2c-timeout-qos2-helper.py /^publish_packet = mosq_test.gen_publish("qos2\/timeout\/test", qos=2, mid=mid, payload="timeout-message")$/;" v +publish_packet test/broker/03-publish-b2c-timeout-qos2.py /^publish_packet = mosq_test.gen_publish("qos2\/timeout\/test", qos=2, mid=mid, payload="timeout-message")$/;" v +publish_packet test/broker/03-publish-c2b-disconnect-qos2.py /^publish_packet = mosq_test.gen_publish("qos2\/disconnect\/test", qos=2, mid=mid, payload="disconnect-message")$/;" v +publish_packet test/broker/03-publish-c2b-timeout-qos2.py /^publish_packet = mosq_test.gen_publish("pub\/qos2\/test", qos=2, mid=mid, payload="timeout-message")$/;" v +publish_packet test/broker/03-publish-dollar.py /^publish_packet = mosq_test.gen_publish("$test\/test", qos=1, mid=mid, payload="message")$/;" v +publish_packet test/broker/03-publish-invalid-utf8.py /^publish_packet = mosq_test.gen_publish("invalid\/utf8", 1, mid=mid)$/;" v +publish_packet test/broker/03-publish-invalid-utf8.py /^publish_packet = struct.pack("B"*len(b), *b)$/;" v +publish_packet test/broker/03-publish-qos1-retain-disabled.py /^publish_packet = mosq_test.gen_publish("pub\/qos1\/test", qos=1, mid=mid, payload="message", retain=True, proto_ver=5)$/;" v +publish_packet test/broker/03-publish-qos1.py /^publish_packet = mosq_test.gen_publish("pub\/qos1\/test", qos=1, mid=mid, payload="message")$/;" v +publish_packet test/broker/03-publish-qos2.py /^publish_packet = mosq_test.gen_publish("pub\/qos2\/test", qos=2, mid=mid, payload="message")$/;" v +publish_packet test/broker/04-retain-qos0-clear.py /^publish_packet = mosq_test.gen_publish("retain\/clear\/test", qos=0, payload="retained message", retain=True)$/;" v +publish_packet test/broker/04-retain-qos0-fresh.py /^publish_packet = mosq_test.gen_publish("retain\/qos0\/test", qos=0, payload="retained message", retain=True)$/;" v +publish_packet test/broker/04-retain-qos0-repeated.py /^publish_packet = mosq_test.gen_publish("retain\/qos0\/test", qos=0, payload="retained message", retain=True)$/;" v +publish_packet test/broker/04-retain-qos0.py /^publish_packet = mosq_test.gen_publish("retain\/qos0\/test", qos=0, payload="retained message", retain=True)$/;" v +publish_packet test/broker/04-retain-qos1-qos0.py /^publish_packet = mosq_test.gen_publish("retain\/qos1\/test", qos=1, mid=mid, payload="retained message", retain=True)$/;" v +publish_packet test/broker/04-retain-upgrade-outgoing-qos.py /^publish_packet = mosq_test.gen_publish("retain\/qos0\/test", qos=0, payload="retained message", retain=True)$/;" v +publish_packet test/broker/05-clean-session-qos1-helper.py /^publish_packet = mosq_test.gen_publish("qos1\/clean_session\/test", qos=1, mid=mid, payload="clean-session-message")$/;" v +publish_packet test/broker/05-clean-session-qos1.py /^publish_packet = mosq_test.gen_publish("qos1\/clean_session\/test", qos=1, mid=mid, payload="clean-session-message")$/;" v +publish_packet test/broker/06-bridge-b2br-disconnect-qos1.py /^publish_packet = mosq_test.gen_publish("bridge\/disconnect\/test", qos=1, mid=mid, payload="disconnect-message")$/;" v +publish_packet test/broker/06-bridge-b2br-disconnect-qos2.py /^publish_packet = mosq_test.gen_publish("bridge\/disconnect\/test", qos=2, mid=mid, payload="disconnect-message")$/;" v +publish_packet test/broker/06-bridge-b2br-late-connection-retain.py /^publish_packet = mosq_test.gen_publish("bridge\/test", qos=1, mid=mid, payload="message", retain=True)$/;" v +publish_packet test/broker/06-bridge-b2br-late-connection.py /^publish_packet = mosq_test.gen_publish("bridge\/test", qos=1, mid=mid, payload="message")$/;" v +publish_packet test/broker/06-bridge-br2b-disconnect-qos1-helper.py /^publish_packet = mosq_test.gen_publish("bridge\/disconnect\/test", qos=1, mid=mid, payload="disconnect-message")$/;" v +publish_packet test/broker/06-bridge-br2b-disconnect-qos1.py /^publish_packet = mosq_test.gen_publish("bridge\/disconnect\/test", qos=1, mid=mid, payload="disconnect-message")$/;" v +publish_packet test/broker/06-bridge-br2b-disconnect-qos2-helper.py /^publish_packet = mosq_test.gen_publish("bridge\/disconnect\/test", qos=2, mid=mid, payload="disconnect-message")$/;" v +publish_packet test/broker/06-bridge-br2b-disconnect-qos2.py /^publish_packet = mosq_test.gen_publish("bridge\/disconnect\/test", qos=2, mid=mid, payload="disconnect-message")$/;" v +publish_packet test/broker/06-bridge-fail-persist-resend-qos1.py /^publish_packet = mosq_test.gen_publish("bridge\/unknown\/qos1", qos=1, payload="bridge-message", mid=mid)$/;" v +publish_packet test/broker/06-bridge-fail-persist-resend-qos2.py /^publish_packet = mosq_test.gen_publish("bridge\/unknown\/qos2", qos=1, payload="bridge-message", mid=mid)$/;" v +publish_packet test/broker/06-bridge-reconnect-local-out-helper.py /^publish_packet = mosq_test.gen_publish("bridge\/reconnect", qos=1, mid=1, payload="bridge-reconnect-message")$/;" v +publish_packet test/broker/06-bridge-reconnect-local-out.py /^publish_packet = mosq_test.gen_publish("bridge\/reconnect", qos=0, payload="bridge-reconnect-message")$/;" v +publish_packet test/broker/07-will-null.py /^publish_packet = mosq_test.gen_publish("will\/null\/test", qos=0)$/;" v +publish_packet test/broker/08-ssl-bridge-helper.py /^publish_packet = mosq_test.gen_publish("bridge\/ssl\/test", qos=0, payload="message")$/;" v +publish_packet test/broker/08-ssl-bridge.py /^publish_packet = mosq_test.gen_publish("bridge\/ssl\/test", qos=0, payload="message")$/;" v +publish_packet test/broker/08-tls-psk-bridge.py /^publish_packet = mosq_test.gen_publish(topic="psk\/test", payload="message", qos=0)$/;" v +publish_packet test/broker/08-tls-psk-pub.py /^publish_packet = mosq_test.gen_publish(topic="psk\/test", payload="message", qos=0)$/;" v +publish_packet test/broker/09-plugin-auth-acl-sub-denied.py /^publish_packet = mosq_test.gen_publish("topic", qos=1, payload="test", mid=mid_pub)$/;" v +publish_packet test/broker/09-plugin-auth-context-params.py /^publish_packet = mosq_test.gen_publish(topic="param\/topic", qos=1, payload="payload contents", retain=1, mid=mid)$/;" v +publish_packet test/broker/09-plugin-auth-msg-params.py /^publish_packet = mosq_test.gen_publish(topic="param\/topic", qos=1, payload="payload contents", retain=1, mid=mid)$/;" v +publish_packet test/broker/10-listener-mount-point-helper.py /^publish_packet = mosq_test.gen_publish("test", qos=0, payload="mount point")$/;" v +publish_packet test/broker/10-listener-mount-point.py /^publish_packet = mosq_test.gen_publish("mount\/test", qos=0, payload="mount point")$/;" v +publish_packet test/broker/11-persistent-subscription-v5.py /^publish_packet = mosq_test.gen_publish("subpub\/qos1", qos=1, mid=mid, payload="message", proto_ver=5)$/;" v +publish_packet test/broker/11-persistent-subscription.py /^publish_packet = mosq_test.gen_publish("subpub\/qos1", qos=1, mid=mid, payload="message")$/;" v +publish_packet test/broker/11-pub-props.py /^publish_packet = mosq_test.gen_publish("subpub\/qos1", qos=1, mid=mid, payload="message", proto_ver=5, properties=props, retain=True)$/;" v +publish_packet test/broker/12-prop-maximum-packet-size-broker.py /^publish_packet = mosq_test.gen_publish("test\/topic", qos=0, payload="0123456789012345678901234567890", proto_ver=5)$/;" v +publish_packet test/lib/03-publish-b2c-qos1.py /^publish_packet = mosq_test.gen_publish("pub\/qos1\/receive", qos=1, mid=mid, payload="message")$/;" v +publish_packet test/lib/03-publish-b2c-qos2.py /^publish_packet = mosq_test.gen_publish("pub\/qos2\/receive", qos=2, mid=mid, payload="message")$/;" v +publish_packet test/lib/03-publish-c2b-qos1-disconnect.py /^publish_packet = mosq_test.gen_publish("pub\/qos1\/test", qos=1, mid=mid, payload="message")$/;" v +publish_packet test/lib/03-publish-c2b-qos1-timeout.py /^publish_packet = mosq_test.gen_publish("pub\/qos1\/test", qos=1, mid=mid, payload="message")$/;" v +publish_packet test/lib/03-publish-c2b-qos2-disconnect.py /^publish_packet = mosq_test.gen_publish("pub\/qos2\/test", qos=2, mid=mid, payload="message")$/;" v +publish_packet test/lib/03-publish-c2b-qos2-timeout.py /^publish_packet = mosq_test.gen_publish("pub\/qos2\/test", qos=2, mid=mid, payload="message")$/;" v +publish_packet test/lib/03-publish-c2b-qos2.py /^publish_packet = mosq_test.gen_publish("pub\/qos2\/test", qos=2, mid=mid, payload="message")$/;" v +publish_packet test/lib/03-publish-qos0-no-payload.py /^publish_packet = mosq_test.gen_publish("pub\/qos0\/no-payload\/test", qos=0)$/;" v +publish_packet test/lib/03-publish-qos0.py /^publish_packet = mosq_test.gen_publish("pub\/qos0\/test", qos=0, payload="message")$/;" v +publish_packet test/lib/04-retain-qos0.py /^publish_packet = mosq_test.gen_publish("retain\/qos0\/test", qos=0, payload="retained message", retain=True)$/;" v +publish_packet test/lib/11-prop-oversize-packet.py /^publish_packet = mosq_test.gen_publish("pub\/test", qos=0, payload="012345678901234567", proto_ver=5)$/;" v +publish_packet test/lib/11-prop-send-content-type.py /^publish_packet = mosq_test.gen_publish("prop\/qos0", qos=0, payload="message", proto_ver=5, properties=props)$/;" v +publish_packet test/lib/11-prop-send-payload-format.py /^publish_packet = mosq_test.gen_publish("prop\/qos0", qos=0, payload="message", proto_ver=5, properties=props)$/;" v +publish_packet1 test/broker/02-subpub-qos2-receive-maximum-1.py /^publish_packet1 = mosq_test.gen_publish("subpub\/qos2", qos=2, mid=mid, payload="message1", proto_ver=5)$/;" v +publish_packet1 test/broker/02-subpub-qos2-receive-maximum-2.py /^publish_packet1 = mosq_test.gen_publish("subpub\/qos2", qos=2, mid=mid, payload="message1", proto_ver=5)$/;" v +publish_packet1 test/broker/12-prop-response-topic-correlation-data.py /^publish_packet1 = mosq_test.gen_publish(topic="response\/topic", qos=0, payload="22", proto_ver=5)$/;" v +publish_packet1 test/broker/12-prop-response-topic.py /^publish_packet1 = mosq_test.gen_publish(topic="response\/topic", qos=0, payload="22", proto_ver=5)$/;" v +publish_packet2 test/broker/02-subpub-qos1-bad-pubcomp.py /^publish_packet2 = mosq_test.gen_publish("subpub\/qos1", qos=1, mid=mid, payload="message")$/;" v +publish_packet2 test/broker/02-subpub-qos1-v5.py /^publish_packet2 = mosq_test.gen_publish("subpub\/qos1", qos=1, mid=mid, payload="message", proto_ver=5)$/;" v +publish_packet2 test/broker/02-subpub-qos1.py /^publish_packet2 = mosq_test.gen_publish("subpub\/qos1", qos=1, mid=mid, payload="message")$/;" v +publish_packet2 test/broker/02-subpub-qos2-receive-maximum-1.py /^publish_packet2 = mosq_test.gen_publish("subpub\/qos2", qos=2, mid=mid, payload="message2", proto_ver=5)$/;" v +publish_packet2 test/broker/02-subpub-qos2-receive-maximum-2.py /^publish_packet2 = mosq_test.gen_publish("subpub\/qos2", qos=2, mid=mid, payload="message2", proto_ver=5)$/;" v +publish_packet2 test/broker/02-subpub-qos2-receive-maximum-helper.py /^publish_packet2 = mosq_test.gen_publish("subpub\/qos2", qos=2, mid=mid, payload="message2", proto_ver=5)$/;" v +publish_packet2 test/broker/02-subpub-qos2-v5.py /^publish_packet2 = mosq_test.gen_publish("subpub\/qos2", qos=2, mid=mid, payload="message", proto_ver=5)$/;" v +publish_packet2 test/broker/02-subpub-qos2.py /^publish_packet2 = mosq_test.gen_publish("subpub\/qos2", qos=2, mid=mid, payload="message")$/;" v +publish_packet2 test/broker/04-retain-upgrade-outgoing-qos.py /^publish_packet2 = mosq_test.gen_publish("retain\/qos0\/test", mid=1, qos=1, payload="retained message", retain=True)$/;" v +publish_packet2 test/broker/11-persistent-subscription-v5.py /^publish_packet2 = mosq_test.gen_publish("subpub\/qos1", qos=1, mid=mid, payload="message", proto_ver=5)$/;" v +publish_packet2 test/broker/11-persistent-subscription.py /^publish_packet2 = mosq_test.gen_publish("subpub\/qos1", qos=1, mid=mid, payload="message")$/;" v +publish_packet2 test/broker/11-subscription-id.py /^publish_packet2 = mosq_test.gen_publish("subpub\/qos1", qos=1, mid=mid, payload="message", proto_ver=5, properties=props)$/;" v +publish_packet2 test/broker/12-prop-response-topic-correlation-data.py /^publish_packet2 = mosq_test.gen_publish(topic="normal\/topic", qos=0, payload="2", proto_ver=5, properties=props)$/;" v +publish_packet2 test/broker/12-prop-response-topic.py /^publish_packet2 = mosq_test.gen_publish(topic="normal\/topic", qos=0, payload="2", proto_ver=5, properties=props)$/;" v +publish_packet3 test/broker/02-subpub-qos2-receive-maximum-1.py /^publish_packet3 = mosq_test.gen_publish("subpub\/qos2", qos=2, mid=mid, payload="message3", proto_ver=5)$/;" v +publish_packet3 test/broker/02-subpub-qos2-receive-maximum-2.py /^publish_packet3 = mosq_test.gen_publish("subpub\/qos2", qos=2, mid=mid, payload="message3", proto_ver=5)$/;" v +publish_packet3 test/broker/02-subpub-qos2-receive-maximum-helper.py /^publish_packet3 = mosq_test.gen_publish("subpub\/qos2", qos=2, mid=mid, payload="message3", proto_ver=5)$/;" v +publish_packet_dup test/lib/03-publish-c2b-qos1-disconnect.py /^publish_packet_dup = mosq_test.gen_publish("pub\/qos1\/test", qos=1, mid=mid, payload="message", dup=True)$/;" v +publish_packet_dup test/lib/03-publish-c2b-qos1-timeout.py /^publish_packet_dup = mosq_test.gen_publish("pub\/qos1\/test", qos=1, mid=mid, payload="message", dup=True)$/;" v +publish_packet_recv test/broker/09-plugin-auth-context-params.py /^publish_packet_recv = mosq_test.gen_publish(topic="param\/topic", qos=1, payload="payload contents", retain=0, mid=mid)$/;" v +publish_packet_recv test/broker/09-plugin-auth-msg-params.py /^publish_packet_recv = mosq_test.gen_publish(topic="param\/topic", qos=1, payload="payload contents", retain=0, mid=mid)$/;" v +publish_props client/client_shared.h /^ mosquitto_property *publish_props;$/;" m struct:mosq_config +publish_received_interval src/sys_tree.c /^ double publish_received_interval, publish_sent_interval;$/;" l +publish_received_load1 src/sys_tree.c /^ static double publish_received_load1 = 0;$/;" l file: +publish_received_load15 src/sys_tree.c /^ static double publish_received_load15 = 0;$/;" l file: +publish_received_load5 src/sys_tree.c /^ static double publish_received_load5 = 0;$/;" l file: +publish_sent_interval src/sys_tree.c /^ double publish_received_interval, publish_sent_interval;$/;" l +publish_sent_load1 src/sys_tree.c /^ static double publish_sent_load1 = 0;$/;" l file: +publish_sent_load15 src/sys_tree.c /^ static double publish_sent_load15 = 0;$/;" l file: +publish_sent_load5 src/sys_tree.c /^ static double publish_sent_load5 = 0;$/;" l file: +pubrec1_packet test/broker/09-plugin-auth-acl-pub.py /^pubrec1_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec1_packet test/broker/12-prop-maximum-packet-size-publish-qos2.py /^pubrec1_packet = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec1r_packet test/broker/02-subpub-qos1-bad-pubrec.py /^pubrec1r_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec1r_packet test/broker/02-subpub-qos2-bad-puback-2.py /^pubrec1r_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec1s_packet test/broker/02-subpub-qos2-bad-puback-1.py /^pubrec1s_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec1s_packet test/broker/02-subpub-qos2-bad-puback-2.py /^pubrec1s_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec1s_packet test/broker/02-subpub-qos2-bad-pubcomp.py /^pubrec1s_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec2_packet test/broker/12-prop-maximum-packet-size-publish-qos2.py /^pubrec2_packet = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_1_packet test/broker/02-subpub-qos2-pubrec-error-helper.py /^pubrec_1_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec_1_packet test/broker/02-subpub-qos2-pubrec-error.py /^pubrec_1_packet = mosq_test.gen_pubrec(mid, proto_ver=5, reason_code=0x80)$/;" v +pubrec_1_packet test/lib/03-publish-c2b-qos2-pubrec-error.py /^pubrec_1_packet = mosq_test.gen_pubrec(mid, proto_ver=5, reason_code=0x80)$/;" v +pubrec_1_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^pubrec_1_packet = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_1_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^pubrec_1_packet = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_2_packet test/broker/02-subpub-qos2-pubrec-error-helper.py /^pubrec_2_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec_2_packet test/broker/02-subpub-qos2-pubrec-error.py /^pubrec_2_packet = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_2_packet test/lib/03-publish-c2b-qos2-pubrec-error.py /^pubrec_2_packet = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_2_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^pubrec_2_packet = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_2_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^pubrec_2_packet = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_3_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^pubrec_3_packet = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_3_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^pubrec_3_packet = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_4_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^pubrec_4_packet = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_4_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^pubrec_4_packet = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_5_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^pubrec_5_packet = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_5_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^pubrec_5_packet = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_packet test/broker/02-subpub-qos2-receive-maximum-helper.py /^pubrec_packet = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_packet test/broker/02-subpub-qos2-v5.py /^pubrec_packet = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_packet test/broker/02-subpub-qos2.py /^pubrec_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec_packet test/broker/03-publish-b2c-disconnect-qos2-helper.py /^pubrec_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec_packet test/broker/03-publish-b2c-disconnect-qos2.py /^pubrec_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec_packet test/broker/03-publish-b2c-qos2-len-helper.py /^pubrec_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec_packet test/broker/03-publish-b2c-qos2-len.py /^pubrec_packet = mosq_test.gen_pubrec(1)$/;" v +pubrec_packet test/broker/03-publish-b2c-qos2-len.py /^pubrec_packet = mosq_test.gen_pubrec(1, proto_ver=5, reason_code=0x00)$/;" v +pubrec_packet test/broker/03-publish-b2c-qos2-len.py /^pubrec_packet = mosq_test.gen_pubrec(1, proto_ver=5, reason_code=0x00, properties="")$/;" v +pubrec_packet test/broker/03-publish-b2c-qos2-len.py /^pubrec_packet = mosq_test.gen_pubrec(1, proto_ver=5, reason_code=0x00, properties=props)$/;" v +pubrec_packet test/broker/03-publish-b2c-timeout-qos2-helper.py /^pubrec_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec_packet test/broker/03-publish-b2c-timeout-qos2.py /^pubrec_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec_packet test/broker/03-publish-c2b-disconnect-qos2.py /^pubrec_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec_packet test/broker/03-publish-c2b-timeout-qos2.py /^pubrec_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec_packet test/broker/03-publish-qos2.py /^pubrec_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec_packet test/broker/06-bridge-b2br-disconnect-qos2.py /^pubrec_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec_packet test/broker/06-bridge-br2b-disconnect-qos2-helper.py /^pubrec_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec_packet test/broker/06-bridge-br2b-disconnect-qos2.py /^pubrec_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec_packet test/lib/03-publish-b2c-qos2.py /^pubrec_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec_packet test/lib/03-publish-c2b-qos2-disconnect.py /^pubrec_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec_packet test/lib/03-publish-c2b-qos2-len.py /^pubrec_packet = mosq_test.gen_pubrec(1)$/;" v +pubrec_packet test/lib/03-publish-c2b-qos2-len.py /^pubrec_packet = mosq_test.gen_pubrec(1, proto_ver=5, reason_code=0x00)$/;" v +pubrec_packet test/lib/03-publish-c2b-qos2-len.py /^pubrec_packet = mosq_test.gen_pubrec(1, proto_ver=5, reason_code=0x00, properties="")$/;" v +pubrec_packet test/lib/03-publish-c2b-qos2-len.py /^pubrec_packet = mosq_test.gen_pubrec(1, proto_ver=5, reason_code=0x00, properties=props)$/;" v +pubrec_packet test/lib/03-publish-c2b-qos2-timeout.py /^pubrec_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec_packet test/lib/03-publish-c2b-qos2.py /^pubrec_packet = mosq_test.gen_pubrec(mid)$/;" v +pubrec_packet1 test/broker/02-subpub-qos2-receive-maximum-1.py /^pubrec_packet1 = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_packet1 test/broker/02-subpub-qos2-receive-maximum-2.py /^pubrec_packet1 = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_packet2 test/broker/02-subpub-qos2-receive-maximum-1.py /^pubrec_packet2 = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_packet2 test/broker/02-subpub-qos2-receive-maximum-2.py /^pubrec_packet2 = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_packet2 test/broker/02-subpub-qos2-receive-maximum-helper.py /^pubrec_packet2 = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_packet2 test/broker/02-subpub-qos2-v5.py /^pubrec_packet2 = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_packet2 test/broker/02-subpub-qos2.py /^pubrec_packet2 = mosq_test.gen_pubrec(mid)$/;" v +pubrec_packet3 test/broker/02-subpub-qos2-receive-maximum-1.py /^pubrec_packet3 = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_packet3 test/broker/02-subpub-qos2-receive-maximum-2.py /^pubrec_packet3 = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_packet3 test/broker/02-subpub-qos2-receive-maximum-helper.py /^pubrec_packet3 = mosq_test.gen_pubrec(mid, proto_ver=5)$/;" v +pubrec_packet_unknown1 test/broker/06-bridge-fail-persist-resend-qos2.py /^pubrec_packet_unknown1 = mosq_test.gen_pubrec(mid_unknown+1)$/;" v +pubrel1_packet test/broker/09-plugin-auth-acl-pub.py /^pubrel1_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel1_packet test/broker/12-prop-maximum-packet-size-publish-qos2.py /^pubrel1_packet = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel1r_packet test/broker/02-subpub-qos2-bad-puback-2.py /^pubrel1r_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel1s_packet test/broker/02-subpub-qos2-bad-puback-1.py /^pubrel1s_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel1s_packet test/broker/02-subpub-qos2-bad-puback-2.py /^pubrel1s_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel1s_packet test/broker/02-subpub-qos2-bad-pubcomp.py /^pubrel1s_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel2_packet test/broker/12-prop-maximum-packet-size-publish-qos2.py /^pubrel2_packet = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_1_packet test/broker/02-subpub-qos2-pubrec-error-helper.py /^pubrel_1_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel_1_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^pubrel_1_packet = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_1_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^pubrel_1_packet = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_2_packet test/broker/02-subpub-qos2-pubrec-error-helper.py /^pubrel_2_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel_2_packet test/broker/02-subpub-qos2-pubrec-error.py /^pubrel_2_packet = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_2_packet test/lib/03-publish-c2b-qos2-pubrec-error.py /^pubrel_2_packet = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_2_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^pubrel_2_packet = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_2_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^pubrel_2_packet = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_3_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^pubrel_3_packet = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_3_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^pubrel_3_packet = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_4_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^pubrel_4_packet = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_4_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^pubrel_4_packet = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_5_packet test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^pubrel_5_packet = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_5_packet test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^pubrel_5_packet = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_dup_packet test/broker/03-publish-c2b-disconnect-qos2.py /^pubrel_dup_packet = mosq_test.gen_pubrel(mid, dup=True)$/;" v +pubrel_packet test/broker/02-subpub-qos2-receive-maximum-helper.py /^pubrel_packet = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_packet test/broker/02-subpub-qos2-v5.py /^pubrel_packet = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_packet test/broker/02-subpub-qos2.py /^pubrel_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel_packet test/broker/03-publish-b2c-disconnect-qos2-helper.py /^pubrel_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel_packet test/broker/03-publish-b2c-disconnect-qos2.py /^pubrel_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel_packet test/broker/03-publish-b2c-qos2-len-helper.py /^pubrel_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel_packet test/broker/03-publish-b2c-timeout-qos2-helper.py /^pubrel_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel_packet test/broker/03-publish-b2c-timeout-qos2.py /^pubrel_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel_packet test/broker/03-publish-c2b-disconnect-qos2.py /^pubrel_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel_packet test/broker/03-publish-c2b-qos2-len.py /^pubrel_packet = mosq_test.gen_pubrel(1)$/;" v +pubrel_packet test/broker/03-publish-c2b-qos2-len.py /^pubrel_packet = mosq_test.gen_pubrel(1, proto_ver=5, reason_code=0x00)$/;" v +pubrel_packet test/broker/03-publish-c2b-qos2-len.py /^pubrel_packet = mosq_test.gen_pubrel(1, proto_ver=5, reason_code=0x00, properties="")$/;" v +pubrel_packet test/broker/03-publish-c2b-qos2-len.py /^pubrel_packet = mosq_test.gen_pubrel(1, proto_ver=5, reason_code=0x00, properties=props)$/;" v +pubrel_packet test/broker/03-publish-c2b-timeout-qos2.py /^pubrel_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel_packet test/broker/03-publish-qos2.py /^pubrel_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel_packet test/broker/06-bridge-b2br-disconnect-qos2.py /^pubrel_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel_packet test/broker/06-bridge-br2b-disconnect-qos2-helper.py /^pubrel_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel_packet test/broker/06-bridge-br2b-disconnect-qos2.py /^pubrel_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel_packet test/lib/03-publish-b2c-qos2-len.py /^pubrel_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel_packet test/lib/03-publish-b2c-qos2-len.py /^pubrel_packet = mosq_test.gen_pubrel(mid, proto_ver=5, reason_code=0x00)$/;" v +pubrel_packet test/lib/03-publish-b2c-qos2-len.py /^pubrel_packet = mosq_test.gen_pubrel(mid, proto_ver=5, reason_code=0x00, properties="")$/;" v +pubrel_packet test/lib/03-publish-b2c-qos2-len.py /^pubrel_packet = mosq_test.gen_pubrel(mid, proto_ver=5, reason_code=0x00, properties=props)$/;" v +pubrel_packet test/lib/03-publish-b2c-qos2.py /^pubrel_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel_packet test/lib/03-publish-c2b-qos2-disconnect.py /^pubrel_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel_packet test/lib/03-publish-c2b-qos2-timeout.py /^pubrel_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel_packet test/lib/03-publish-c2b-qos2.py /^pubrel_packet = mosq_test.gen_pubrel(mid)$/;" v +pubrel_packet1 test/broker/02-subpub-qos2-receive-maximum-1.py /^pubrel_packet1 = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_packet1 test/broker/02-subpub-qos2-receive-maximum-2.py /^pubrel_packet1 = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_packet2 test/broker/02-subpub-qos2-receive-maximum-1.py /^pubrel_packet2 = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_packet2 test/broker/02-subpub-qos2-receive-maximum-2.py /^pubrel_packet2 = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_packet2 test/broker/02-subpub-qos2-receive-maximum-helper.py /^pubrel_packet2 = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_packet2 test/broker/02-subpub-qos2-v5.py /^pubrel_packet2 = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_packet2 test/broker/02-subpub-qos2.py /^pubrel_packet2 = mosq_test.gen_pubrel(mid)$/;" v +pubrel_packet3 test/broker/02-subpub-qos2-receive-maximum-1.py /^pubrel_packet3 = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_packet3 test/broker/02-subpub-qos2-receive-maximum-2.py /^pubrel_packet3 = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_packet3 test/broker/02-subpub-qos2-receive-maximum-helper.py /^pubrel_packet3 = mosq_test.gen_pubrel(mid, proto_ver=5)$/;" v +pubrel_packet_unknown1 test/broker/06-bridge-fail-persist-resend-qos2.py /^pubrel_packet_unknown1 = mosq_test.gen_pubrel(mid_unknown+1)$/;" v +pubrel_packet_unknown2 test/broker/06-bridge-fail-persist-resend-qos2.py /^pubrel_packet_unknown2 = mosq_test.gen_pubrel(mid_unknown+2)$/;" v +pw1 src/mosquitto_passwd.c /^ char pw1[MAX_BUFFER_LEN], pw2[MAX_BUFFER_LEN];$/;" l +pw2 src/mosquitto_passwd.c /^ char pw1[MAX_BUFFER_LEN], pw2[MAX_BUFFER_LEN];$/;" l +pw__digest src/security_default.c /^int pw__digest(const char *password, const unsigned char *salt, unsigned int salt_len, unsigned char *hash, unsigned int *hash_len)$/;" f +pw_callback lib/mosquitto.h /^ int (*pw_callback)(char *buf, int size, int rwflag, void *userdata);$/;" m struct:libmosquitto_tls +pw_file test/broker/01-connect-uname-password-denied-no-will.py /^pw_file = os.path.basename(__file__).replace('.py', '.pwfile')$/;" v +pw_file test/broker/09-pwfile-parse-invalid.py /^pw_file = os.path.basename(__file__).replace('.py', '.pwfile')$/;" v +pwd src/mosquitto.c /^ struct passwd *pwd;$/;" l +pwf src/security_default.c /^ char *pwf;$/;" l +pwfile src/security_default.c /^ FILE *pwfile;$/;" l +pwfile__parse src/security_default.c /^static int pwfile__parse(const char *file, struct mosquitto__unpwd **root)$/;" f file: +qos client/client_shared.h /^ int qos;$/;" m struct:mosq_config +qos lib/handle_pubackcomp.c /^ int qos;$/;" l +qos lib/handle_suback.c /^ uint8_t qos;$/;" l +qos lib/helpers.c /^ int qos;$/;" m struct:userdata__callback file: +qos lib/mosquitto.h /^ int qos;$/;" m struct:libmosquitto_will +qos lib/mosquitto.h /^ int qos;$/;" m struct:mosquitto_message +qos src/database.c /^ int qos;$/;" l +qos src/db_dump/db_dump.c /^ uint8_t qos, retain, direction, state, dup;$/;" m struct:db_client_msg file: +qos src/db_dump/db_dump.c /^ uint8_t qos, retain;$/;" m struct:db_msg file: +qos src/db_dump/db_dump.c /^ uint8_t qos;$/;" m struct:db_sub file: +qos src/handle_publish.c /^ uint8_t dup, qos, retain;$/;" l +qos src/handle_subscribe.c /^ uint8_t qos;$/;" l +qos src/mosquitto_broker_internal.h /^ int qos;$/;" m struct:mosquitto__bridge_topic +qos src/mosquitto_broker_internal.h /^ uint8_t qos;$/;" m struct:mosquitto__subleaf +qos src/mosquitto_broker_internal.h /^ uint8_t qos;$/;" m struct:mosquitto_client_msg +qos src/mosquitto_broker_internal.h /^ uint8_t qos;$/;" m struct:mosquitto_msg_store +qos src/mosquitto_plugin.h /^ int qos;$/;" m struct:mosquitto_acl_msg +qos src/persist.h /^ uint8_t qos;$/;" m struct:PF_client_msg +qos src/persist.h /^ uint8_t qos;$/;" m struct:PF_msg_store +qos src/persist.h /^ uint8_t qos;$/;" m struct:PF_sub +qos src/subs.c /^ int qos;$/;" l +qos_count lib/handle_suback.c /^ int qos_count;$/;" l +qos_values test/random/random_client.py /^qos_values = [0, 1, 2]$/;" v +queue_qos0_messages src/mosquitto_broker_internal.h /^ bool queue_qos0_messages;$/;" m struct:mosquitto__config +queued lib/mosquitto_internal.h /^ struct mosquitto_client_msg *queued;$/;" m struct:mosquitto_msg_data typeref:struct:mosquitto_msg_data::mosquitto_client_msg +quiet client/client_shared.h /^ bool quiet;$/;" m struct:mosq_config +r src/bridge.c /^ int r;$/;" l +rand_between src/bridge.c /^static int rand_between(int base, int cap)$/;" f file: +rc client/client_props.c /^ int rc;$/;" l +rc client/client_shared.c /^ int rc;$/;" l +rc client/pub_client.c /^ int rc = MOSQ_ERR_SUCCESS;$/;" l +rc client/pub_client.c /^ int rc, rc2;$/;" l +rc client/pub_client.c /^ int rc;$/;" l +rc client/rr_client.c /^ int rc;$/;" l +rc client/sub_client.c /^ int rc;$/;" l +rc examples/mysql_log/mysql_log.c /^ int rc = 0;$/;" l +rc examples/subscribe_simple/callback.c /^ int rc;$/;" l +rc examples/subscribe_simple/multiple.c /^ int rc;$/;" l +rc examples/subscribe_simple/single.c /^ int rc;$/;" l +rc examples/temperature_conversion/main.cpp /^ int rc;$/;" l +rc lib/actions.c /^ int rc;$/;" l +rc lib/connect.c /^ int rc = mosquitto__connect_init(mosq, host, port, keepalive, bind_address);$/;" l +rc lib/connect.c /^ int rc;$/;" l +rc lib/cpp/mosquittopp.cpp /^ int rc;$/;" l +rc lib/handle_auth.c /^ int rc = 0;$/;" l +rc lib/handle_connack.c /^ int rc;$/;" l +rc lib/handle_disconnect.c /^ int rc;$/;" l +rc lib/handle_pubackcomp.c /^ int rc;$/;" l +rc lib/handle_publish.c /^ int rc = 0;$/;" l +rc lib/handle_pubrec.c /^ int rc;$/;" l +rc lib/handle_pubrel.c /^ int rc;$/;" l +rc lib/handle_suback.c /^ int rc;$/;" l +rc lib/handle_unsuback.c /^ int rc;$/;" l +rc lib/helpers.c /^ int rc;$/;" l +rc lib/helpers.c /^ int rc;$/;" m struct:userdata__callback file: +rc lib/loop.c /^ int rc;$/;" l +rc lib/messages_mosq.c /^ int rc = MOSQ_ERR_SUCCESS;$/;" l +rc lib/messages_mosq.c /^ int rc;$/;" l +rc lib/mosquitto.c /^ int rc;$/;" l +rc lib/net_mosq.c /^ int rc = 0;$/;" l +rc lib/net_mosq.c /^ int rc = MOSQ_ERR_SUCCESS;$/;" l +rc lib/net_mosq.c /^ int rc = net__init_ssl_ctx(mosq);$/;" l +rc lib/net_mosq.c /^ int rc, rc2;$/;" l +rc lib/net_mosq.c /^ int rc;$/;" l +rc lib/options.c /^ int rc;$/;" l +rc lib/packet_datatypes.c /^ int rc;$/;" l +rc lib/packet_mosq.c /^ int rc = 0;$/;" l +rc lib/property_mosq.c /^ int rc;$/;" l +rc lib/send_connect.c /^ int rc;$/;" l +rc lib/send_disconnect.c /^ int rc;$/;" l +rc lib/send_mosq.c /^ int rc;$/;" l +rc lib/send_publish.c /^ int rc;$/;" l +rc lib/send_subscribe.c /^ int rc;$/;" l +rc lib/send_unsubscribe.c /^ int rc;$/;" l +rc lib/socks_mosq.c /^ int rc = net__socket_connect_step3(mosq, mosq->host);$/;" l +rc lib/srv_mosq.c /^ int rc;$/;" l +rc lib/util_mosq.c /^ int rc = MOSQ_ERR_UNKNOWN;$/;" l +rc lib/util_mosq.c /^ int rc;$/;" l +rc lib/will_mosq.c /^ int rc = MOSQ_ERR_SUCCESS;$/;" l +rc src/bridge.c /^ int rc, rc2;$/;" l +rc src/bridge.c /^ int rc;$/;" l +rc src/conf.c /^ char *rc;$/;" l +rc src/conf.c /^ int rc = MOSQ_ERR_SUCCESS;$/;" l +rc src/conf.c /^ int rc;$/;" l +rc src/database.c /^ int rc = 0;$/;" l +rc src/database.c /^ int rc = MOSQ_ERR_SUCCESS;$/;" l +rc src/database.c /^ int rc;$/;" l +rc src/db_dump/db_dump.c /^ int rc = 0;$/;" l +rc src/db_dump/db_dump.c /^ int rc;$/;" l +rc src/handle_auth.c /^ int rc = 0;$/;" l +rc src/handle_connack.c /^ int rc;$/;" l +rc src/handle_connect.c /^ int rc = MOSQ_ERR_SUCCESS;$/;" l +rc src/handle_connect.c /^ int rc;$/;" l +rc src/handle_disconnect.c /^ int rc;$/;" l +rc src/handle_publish.c /^ int rc = 0;$/;" l +rc src/handle_subscribe.c /^ int rc = 0;$/;" l +rc src/handle_unsubscribe.c /^ int rc;$/;" l +rc src/logging.c /^ int rc = 0;$/;" l +rc src/logging.c /^ int rc;$/;" l +rc src/loop.c /^ int rc;$/;" l +rc src/mosquitto.c /^ int rc;$/;" l +rc src/mosquitto_passwd.c /^ int rc = 1;$/;" l +rc src/mosquitto_passwd.c /^ int rc;$/;" l +rc src/net.c /^ int rc;$/;" l +rc src/persist_read.c /^ int rc = 0;$/;" l +rc src/persist_read.c /^ int rc;$/;" l +rc src/persist_read_v234.c /^ int rc = 0;$/;" l +rc src/persist_read_v234.c /^ int rc;$/;" l +rc src/persist_read_v5.c /^ int rc = 0;$/;" l +rc src/persist_read_v5.c /^ int rc;$/;" l +rc src/persist_write.c /^ int rc = 0;$/;" l +rc src/persist_write.c /^ int rc;$/;" l +rc src/persist_write_v5.c /^ int rc;$/;" l +rc src/plugin.c /^ int rc;$/;" l +rc src/security.c /^ int rc = MOSQ_ERR_PLUGIN_DEFER;$/;" l +rc src/security.c /^ int rc = MOSQ_ERR_SUCCESS;$/;" l +rc src/security.c /^ int rc;$/;" l +rc src/security_default.c /^ int rc = 0;$/;" l +rc src/security_default.c /^ int rc;$/;" l +rc src/send_auth.c /^ int rc;$/;" l +rc src/send_connack.c /^ int rc;$/;" l +rc src/send_suback.c /^ int rc;$/;" l +rc src/send_unsuback.c /^ int rc;$/;" l +rc src/service.c /^ int rc;$/;" l +rc src/subs.c /^ int rc = 0, rc2;$/;" l +rc src/subs.c /^ int rc = 0;$/;" l +rc src/subs.c /^ int rc;$/;" l +rc src/websockets.c /^ int rc;$/;" l +rc test/broker/01-connect-anon-denied.py /^rc = 1$/;" v +rc test/broker/01-connect-bad-packet.py /^ rc = 0$/;" v +rc test/broker/01-connect-bad-packet.py /^ rc = 0$/;" v +rc test/broker/01-connect-bad-packet.py /^rc = 1$/;" v +rc test/broker/01-connect-disconnect-v5.py /^rc = 4$/;" v +rc test/broker/01-connect-duplicate-v5.py /^ rc = 0$/;" v +rc test/broker/01-connect-duplicate-v5.py /^ rc = 0$/;" v +rc test/broker/01-connect-duplicate-v5.py /^rc = 1$/;" v +rc test/broker/01-connect-duplicate.py /^ rc = 0$/;" v +rc test/broker/01-connect-duplicate.py /^ rc = 0$/;" v +rc test/broker/01-connect-duplicate.py /^rc = 1$/;" v +rc test/broker/01-connect-invalid-id-0-311.py /^ rc = 0$/;" v +rc test/broker/01-connect-invalid-id-0-311.py /^rc = 1$/;" v +rc test/broker/01-connect-invalid-id-0.py /^ rc = 0$/;" v +rc test/broker/01-connect-invalid-id-0.py /^rc = 1$/;" v +rc test/broker/01-connect-invalid-id-missing.py /^ rc = 0$/;" v +rc test/broker/01-connect-invalid-id-missing.py /^rc = 1$/;" v +rc test/broker/01-connect-invalid-id-utf8.py /^ rc = 0$/;" v +rc test/broker/01-connect-invalid-id-utf8.py /^rc = 1$/;" v +rc test/broker/01-connect-invalid-protonum.py /^ rc = 0$/;" v +rc test/broker/01-connect-invalid-protonum.py /^rc = 1$/;" v +rc test/broker/01-connect-invalid-reserved.py /^ rc = 0$/;" v +rc test/broker/01-connect-invalid-reserved.py /^rc = 1$/;" v +rc test/broker/01-connect-success-v5.py /^ rc = 0$/;" v +rc test/broker/01-connect-success-v5.py /^rc = 1$/;" v +rc test/broker/01-connect-success.py /^ rc = 0$/;" v +rc test/broker/01-connect-success.py /^rc = 1$/;" v +rc test/broker/01-connect-uname-invalid-utf8.py /^ rc = 0$/;" v +rc test/broker/01-connect-uname-invalid-utf8.py /^rc = 1$/;" v +rc test/broker/01-connect-uname-no-flag.py /^ rc = 0$/;" v +rc test/broker/01-connect-uname-no-flag.py /^rc = 1$/;" v +rc test/broker/01-connect-uname-no-password-denied.py /^rc = 1$/;" v +rc test/broker/01-connect-uname-password-denied-no-will.py /^rc = 1$/;" v +rc test/broker/01-connect-uname-password-denied.py /^rc = 1$/;" v +rc test/broker/01-connect-uname-password-success-no-tls.py /^rc = 1$/;" v +rc test/broker/01-connect-uname-password-success.py /^rc = 1$/;" v +rc test/broker/01-connect-uname-pwd-no-flag.py /^ rc = 0$/;" v +rc test/broker/01-connect-uname-pwd-no-flag.py /^rc = 1$/;" v +rc test/broker/02-shared-qos0-v5.py /^ rc = 0$/;" v +rc test/broker/02-shared-qos0-v5.py /^rc = 1$/;" v +rc test/broker/02-subhier-crash.py /^ rc = 0$/;" v +rc test/broker/02-subhier-crash.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos0-retain-as-publish.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos0-retain-as-publish.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos0-send-retain.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos0-send-retain.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos0-subscription-id.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos0-subscription-id.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos0-topic-alias-unknown.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos0-topic-alias-unknown.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos0-topic-alias.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos0-topic-alias.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos0-v5.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos0-v5.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos0.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos0.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos1-bad-pubcomp.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos1-bad-pubcomp.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos1-bad-pubrec.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos1-bad-pubrec.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos1-message-expiry-retain.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos1-message-expiry-retain.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos1-message-expiry-will.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos1-message-expiry-will.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos1-message-expiry.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos1-message-expiry.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos1-nolocal.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos1-nolocal.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos1-v5.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos1-v5.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos1.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos1.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos2-bad-puback-1.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos2-bad-puback-1.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos2-bad-puback-2.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos2-bad-puback-2.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos2-bad-pubcomp.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos2-bad-pubcomp.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos2-pubrec-error-helper.py /^rc = 0$/;" v +rc test/broker/02-subpub-qos2-pubrec-error-helper.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos2-pubrec-error.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos2-pubrec-error.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos2-receive-maximum-1.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos2-receive-maximum-1.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos2-receive-maximum-2.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos2-receive-maximum-2.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos2-receive-maximum-helper.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos2-receive-maximum-helper.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos2-v5.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos2-v5.py /^rc = 1$/;" v +rc test/broker/02-subpub-qos2.py /^ rc = 0$/;" v +rc test/broker/02-subpub-qos2.py /^rc = 1$/;" v +rc test/broker/02-subscribe-invalid-utf8.py /^ rc = 0$/;" v +rc test/broker/02-subscribe-invalid-utf8.py /^rc = 1$/;" v +rc test/broker/02-subscribe-persistence-flipflop.py /^ rc = 0$/;" v +rc test/broker/02-subscribe-persistence-flipflop.py /^rc = 1$/;" v +rc test/broker/02-subscribe-qos0.py /^ rc = 0$/;" v +rc test/broker/02-subscribe-qos0.py /^rc = 1$/;" v +rc test/broker/02-subscribe-qos1.py /^ rc = 0$/;" v +rc test/broker/02-subscribe-qos1.py /^rc = 1$/;" v +rc test/broker/02-subscribe-qos2.py /^ rc = 0$/;" v +rc test/broker/02-subscribe-qos2.py /^rc = 1$/;" v +rc test/broker/02-unsubscribe-invalid-no-topic.py /^ rc = 0$/;" v +rc test/broker/02-unsubscribe-invalid-no-topic.py /^rc = 1$/;" v +rc test/broker/02-unsubscribe-qos0.py /^ rc = 0$/;" v +rc test/broker/02-unsubscribe-qos0.py /^rc = 1$/;" v +rc test/broker/02-unsubscribe-qos1.py /^ rc = 0$/;" v +rc test/broker/02-unsubscribe-qos1.py /^rc = 1$/;" v +rc test/broker/02-unsubscribe-qos2-multiple-v5.py /^ rc = 0$/;" v +rc test/broker/02-unsubscribe-qos2-multiple-v5.py /^rc = 1$/;" v +rc test/broker/02-unsubscribe-qos2-multiple.py /^ rc = 0$/;" v +rc test/broker/02-unsubscribe-qos2-multiple.py /^rc = 1$/;" v +rc test/broker/02-unsubscribe-qos2-v5.py /^ rc = 0$/;" v +rc test/broker/02-unsubscribe-qos2-v5.py /^rc = 1$/;" v +rc test/broker/02-unsubscribe-qos2.py /^ rc = 0$/;" v +rc test/broker/02-unsubscribe-qos2.py /^rc = 1$/;" v +rc test/broker/03-pattern-matching-helper.py /^rc = 0$/;" v +rc test/broker/03-pattern-matching-helper.py /^rc = 1$/;" v +rc test/broker/03-publish-b2c-disconnect-qos1-helper.py /^rc = 0$/;" v +rc test/broker/03-publish-b2c-disconnect-qos1-helper.py /^rc = 1$/;" v +rc test/broker/03-publish-b2c-disconnect-qos1.py /^ rc = 0$/;" v +rc test/broker/03-publish-b2c-disconnect-qos1.py /^rc = 1$/;" v +rc test/broker/03-publish-b2c-disconnect-qos2-helper.py /^rc = 0$/;" v +rc test/broker/03-publish-b2c-disconnect-qos2-helper.py /^rc = 1$/;" v +rc test/broker/03-publish-b2c-disconnect-qos2.py /^ rc = 0$/;" v +rc test/broker/03-publish-b2c-disconnect-qos2.py /^rc = 1$/;" v +rc test/broker/03-publish-b2c-qos1-len-helper.py /^rc = 0$/;" v +rc test/broker/03-publish-b2c-qos1-len-helper.py /^rc = 1$/;" v +rc test/broker/03-publish-b2c-qos2-len-helper.py /^rc = 0$/;" v +rc test/broker/03-publish-b2c-qos2-len-helper.py /^rc = 1$/;" v +rc test/broker/03-publish-b2c-timeout-qos1-helper.py /^rc = 0$/;" v +rc test/broker/03-publish-b2c-timeout-qos1-helper.py /^rc = 1$/;" v +rc test/broker/03-publish-b2c-timeout-qos1.py /^ rc = 0$/;" v +rc test/broker/03-publish-b2c-timeout-qos1.py /^rc = 1$/;" v +rc test/broker/03-publish-b2c-timeout-qos2-helper.py /^rc = 0$/;" v +rc test/broker/03-publish-b2c-timeout-qos2-helper.py /^rc = 1$/;" v +rc test/broker/03-publish-b2c-timeout-qos2.py /^ rc = 0$/;" v +rc test/broker/03-publish-b2c-timeout-qos2.py /^rc = 1$/;" v +rc test/broker/03-publish-c2b-disconnect-qos2.py /^ rc = 0$/;" v +rc test/broker/03-publish-c2b-disconnect-qos2.py /^rc = 1$/;" v +rc test/broker/03-publish-c2b-timeout-qos2.py /^ rc = 0$/;" v +rc test/broker/03-publish-c2b-timeout-qos2.py /^rc = 1$/;" v +rc test/broker/03-publish-dollar-v5.py /^ rc = 0$/;" v +rc test/broker/03-publish-dollar-v5.py /^rc = 1$/;" v +rc test/broker/03-publish-dollar.py /^ rc = 0$/;" v +rc test/broker/03-publish-dollar.py /^rc = 1$/;" v +rc test/broker/03-publish-invalid-utf8.py /^ rc = 0$/;" v +rc test/broker/03-publish-invalid-utf8.py /^rc = 1$/;" v +rc test/broker/03-publish-qos1-no-subscribers-v5.py /^ rc = 0$/;" v +rc test/broker/03-publish-qos1-no-subscribers-v5.py /^rc = 1$/;" v +rc test/broker/03-publish-qos1-queued-bytes.py /^ rc = 0$/;" v +rc test/broker/03-publish-qos1-queued-bytes.py /^rc = 1$/;" v +rc test/broker/03-publish-qos1-retain-disabled.py /^rc = 1$/;" v +rc test/broker/03-publish-qos1.py /^ rc = 0$/;" v +rc test/broker/03-publish-qos1.py /^rc = 1$/;" v +rc test/broker/03-publish-qos2.py /^ rc = 0$/;" v +rc test/broker/03-publish-qos2.py /^rc = 1$/;" v +rc test/broker/04-retain-qos0-clear.py /^ rc = 0$/;" v +rc test/broker/04-retain-qos0-clear.py /^rc = 1$/;" v +rc test/broker/04-retain-qos0-fresh.py /^ rc = 0$/;" v +rc test/broker/04-retain-qos0-fresh.py /^rc = 1$/;" v +rc test/broker/04-retain-qos0-repeated.py /^ rc = 0$/;" v +rc test/broker/04-retain-qos0-repeated.py /^rc = 1$/;" v +rc test/broker/04-retain-qos0.py /^ rc = 0$/;" v +rc test/broker/04-retain-qos0.py /^rc = 1$/;" v +rc test/broker/04-retain-qos1-qos0.py /^ rc = 0$/;" v +rc test/broker/04-retain-qos1-qos0.py /^rc = 1$/;" v +rc test/broker/04-retain-upgrade-outgoing-qos.py /^rc = 1$/;" v +rc test/broker/05-clean-session-qos1-helper.py /^rc = 0$/;" v +rc test/broker/05-clean-session-qos1-helper.py /^rc = 1$/;" v +rc test/broker/05-clean-session-qos1.py /^ rc = 0$/;" v +rc test/broker/05-clean-session-qos1.py /^rc = 1$/;" v +rc test/broker/05-session-expiry-v5.py /^ rc = 0$/;" v +rc test/broker/05-session-expiry-v5.py /^rc = 1$/;" v +rc test/broker/06-bridge-b2br-disconnect-qos1.py /^rc = 1$/;" v +rc test/broker/06-bridge-b2br-disconnect-qos2.py /^rc = 1$/;" v +rc test/broker/06-bridge-b2br-late-connection-retain.py /^rc = 1$/;" v +rc test/broker/06-bridge-b2br-late-connection.py /^rc = 1$/;" v +rc test/broker/06-bridge-b2br-remapping.py /^ rc = test(bridge, sock)$/;" v +rc test/broker/06-bridge-b2br-remapping.py /^rc = 1$/;" v +rc test/broker/06-bridge-br2b-disconnect-qos1-helper.py /^rc = 0$/;" v +rc test/broker/06-bridge-br2b-disconnect-qos1-helper.py /^rc = 1$/;" v +rc test/broker/06-bridge-br2b-disconnect-qos1.py /^rc = 1$/;" v +rc test/broker/06-bridge-br2b-disconnect-qos2-helper.py /^ rc = 0$/;" v +rc test/broker/06-bridge-br2b-disconnect-qos2-helper.py /^rc = 1$/;" v +rc test/broker/06-bridge-br2b-disconnect-qos2.py /^rc = 1$/;" v +rc test/broker/06-bridge-br2b-remapping.py /^ rc = test(bridge, sock)$/;" v +rc test/broker/06-bridge-br2b-remapping.py /^rc = 1$/;" v +rc test/broker/06-bridge-fail-persist-resend-qos1.py /^ rc = 0$/;" v +rc test/broker/06-bridge-fail-persist-resend-qos1.py /^rc = 1$/;" v +rc test/broker/06-bridge-fail-persist-resend-qos2.py /^ rc = 0$/;" v +rc test/broker/06-bridge-fail-persist-resend-qos2.py /^rc = 1$/;" v +rc test/broker/06-bridge-per-listener-settings.py /^ rc = test(bridge, sock)$/;" v +rc test/broker/06-bridge-per-listener-settings.py /^rc = 1$/;" v +rc test/broker/06-bridge-reconnect-local-out-helper.py /^rc = 0$/;" v +rc test/broker/06-bridge-reconnect-local-out-helper.py /^rc = 1$/;" v +rc test/broker/06-bridge-reconnect-local-out.py /^rc = 1$/;" v +rc test/broker/07-will-invalid-utf8.py /^ rc = 0$/;" v +rc test/broker/07-will-invalid-utf8.py /^rc = 1$/;" v +rc test/broker/07-will-no-flag.py /^ rc = 0$/;" v +rc test/broker/07-will-no-flag.py /^rc = 1$/;" v +rc test/broker/07-will-null-helper.py /^rc = 0$/;" v +rc test/broker/07-will-null-helper.py /^rc = 1$/;" v +rc test/broker/07-will-null-topic.py /^ rc = 0$/;" v +rc test/broker/07-will-null-topic.py /^rc = 1$/;" v +rc test/broker/07-will-null.py /^ rc = 0$/;" v +rc test/broker/07-will-null.py /^rc = 1$/;" v +rc test/broker/08-ssl-bridge-helper.py /^rc = 1$/;" v +rc test/broker/08-ssl-bridge.py /^rc = 1$/;" v +rc test/broker/08-ssl-connect-cert-auth-crl.py /^rc = 1$/;" v +rc test/broker/08-ssl-connect-cert-auth-expired.py /^rc = 1$/;" v +rc test/broker/08-ssl-connect-cert-auth-revoked.py /^rc = 1$/;" v +rc test/broker/08-ssl-connect-cert-auth-without.py /^ rc = 0$/;" v +rc test/broker/08-ssl-connect-cert-auth-without.py /^rc = 1$/;" v +rc test/broker/08-ssl-connect-cert-auth.py /^rc = 1$/;" v +rc test/broker/08-ssl-connect-identity.py /^rc = 1$/;" v +rc test/broker/08-ssl-connect-no-auth-wrong-ca.py /^rc = 1$/;" v +rc test/broker/08-ssl-connect-no-auth.py /^rc = 1$/;" v +rc test/broker/08-ssl-connect-no-identity.py /^rc = 1$/;" v +rc test/broker/08-tls-psk-bridge.py /^ rc = 0$/;" v +rc test/broker/08-tls-psk-bridge.py /^rc = 1$/;" v +rc test/broker/08-tls-psk-pub.py /^ rc = 0$/;" v +rc test/broker/08-tls-psk-pub.py /^rc = 1$/;" v +rc test/broker/09-acl-change.py /^rc = 1$/;" v +rc test/broker/09-auth-bad-method.py /^ rc = 0$/;" v +rc test/broker/09-auth-bad-method.py /^rc = 1$/;" v +rc test/broker/09-extended-auth-multistep-reauth.py /^rc = 1$/;" v +rc test/broker/09-extended-auth-multistep.py /^rc = 1$/;" v +rc test/broker/09-extended-auth-single.py /^rc = 1$/;" v +rc test/broker/09-extended-auth-unsupported.py /^ rc = 0$/;" v +rc test/broker/09-extended-auth-unsupported.py /^rc = 1$/;" v +rc test/broker/09-plugin-auth-acl-pub.py /^rc = 1$/;" v +rc test/broker/09-plugin-auth-acl-sub-denied.py /^rc = 1$/;" v +rc test/broker/09-plugin-auth-acl-sub.py /^rc = 1$/;" v +rc test/broker/09-plugin-auth-context-params.py /^rc = 1$/;" v +rc test/broker/09-plugin-auth-defer-unpwd-fail.py /^rc = 1$/;" v +rc test/broker/09-plugin-auth-defer-unpwd-success.py /^rc = 1$/;" v +rc test/broker/09-plugin-auth-msg-params.py /^rc = 1$/;" v +rc test/broker/09-plugin-auth-unpwd-fail.py /^rc = 1$/;" v +rc test/broker/09-plugin-auth-unpwd-success.py /^rc = 1$/;" v +rc test/broker/09-plugin-auth-v2-unpwd-fail.py /^rc = 1$/;" v +rc test/broker/09-plugin-auth-v2-unpwd-success.py /^rc = 1$/;" v +rc test/broker/10-listener-mount-point-helper.py /^rc = 0$/;" v +rc test/broker/10-listener-mount-point-helper.py /^rc = 1$/;" v +rc test/broker/10-listener-mount-point.py /^rc = 1$/;" v +rc test/broker/11-message-expiry.py /^rc = 1$/;" v +rc test/broker/11-persistent-subscription-no-local.py /^rc = 1$/;" v +rc test/broker/11-persistent-subscription-v5.py /^rc = 1$/;" v +rc test/broker/11-persistent-subscription.py /^rc = 1$/;" v +rc test/broker/11-pub-props.py /^rc = 1$/;" v +rc test/broker/11-subscription-id.py /^rc = 1$/;" v +rc test/broker/12-prop-maximum-packet-size-broker.py /^rc = 1$/;" v +rc test/broker/12-prop-maximum-packet-size-connect.py /^ rc = 0$/;" v +rc test/broker/12-prop-maximum-packet-size-connect.py /^rc = 1$/;" v +rc test/broker/12-prop-maximum-packet-size-publish-qos1.py /^ rc = 0$/;" v +rc test/broker/12-prop-maximum-packet-size-publish-qos1.py /^rc = 1$/;" v +rc test/broker/12-prop-maximum-packet-size-publish-qos2.py /^ rc = 0$/;" v +rc test/broker/12-prop-maximum-packet-size-publish-qos2.py /^rc = 1$/;" v +rc test/broker/12-prop-maximum-packet-size-publish.py /^ rc = 0$/;" v +rc test/broker/12-prop-maximum-packet-size-publish.py /^rc = 1$/;" v +rc test/broker/12-prop-response-topic-correlation-data.py /^ rc = 0$/;" v +rc test/broker/12-prop-response-topic-correlation-data.py /^rc = 1$/;" v +rc test/broker/12-prop-response-topic.py /^ rc = 0$/;" v +rc test/broker/12-prop-response-topic.py /^rc = 1$/;" v +rc test/broker/12-prop-server-keepalive.py /^rc = 1$/;" v +rc test/broker/12-prop-session-expiry-invalid.py /^ rc = 0$/;" v +rc test/broker/12-prop-session-expiry-invalid.py /^rc = 1$/;" v +rc test/broker/c/08-tls-psk-bridge.c /^ int rc;$/;" l +rc test/broker/c/08-tls-psk-pub.c /^ int rc;$/;" l +rc test/lib/01-con-discon-success.py /^ rc = 0$/;" v +rc test/lib/01-con-discon-success.py /^rc = 1$/;" v +rc test/lib/01-keepalive-pingreq.py /^ rc = 0$/;" v +rc test/lib/01-keepalive-pingreq.py /^rc = 1$/;" v +rc test/lib/01-no-clean-session.py /^ rc = 0$/;" v +rc test/lib/01-no-clean-session.py /^rc = 1$/;" v +rc test/lib/01-server-keepalive-pingreq.py /^ rc = 0$/;" v +rc test/lib/01-server-keepalive-pingreq.py /^rc = 1$/;" v +rc test/lib/01-unpwd-set.py /^ rc = 0$/;" v +rc test/lib/01-unpwd-set.py /^rc = 1$/;" v +rc test/lib/01-will-set.py /^ rc = 0$/;" v +rc test/lib/01-will-set.py /^rc = 1$/;" v +rc test/lib/01-will-unpwd-set.py /^ rc = 0$/;" v +rc test/lib/01-will-unpwd-set.py /^rc = 1$/;" v +rc test/lib/02-subscribe-qos0.py /^ rc = 0$/;" v +rc test/lib/02-subscribe-qos0.py /^rc = 1$/;" v +rc test/lib/02-subscribe-qos1.py /^ rc = 0$/;" v +rc test/lib/02-subscribe-qos1.py /^rc = 1$/;" v +rc test/lib/02-subscribe-qos2.py /^ rc = 0$/;" v +rc test/lib/02-subscribe-qos2.py /^rc = 1$/;" v +rc test/lib/02-unsubscribe-multiple-v5.py /^ rc = 0$/;" v +rc test/lib/02-unsubscribe-multiple-v5.py /^rc = 1$/;" v +rc test/lib/02-unsubscribe-v5.py /^ rc = 0$/;" v +rc test/lib/02-unsubscribe.py /^ rc = 0$/;" v +rc test/lib/02-unsubscribe.py /^rc = 1$/;" v +rc test/lib/03-publish-b2c-qos1.py /^ rc = 0$/;" v +rc test/lib/03-publish-b2c-qos1.py /^rc = 1$/;" v +rc test/lib/03-publish-b2c-qos2.py /^ rc = 0$/;" v +rc test/lib/03-publish-b2c-qos2.py /^rc = 1$/;" v +rc test/lib/03-publish-c2b-qos1-disconnect.py /^ rc = 0$/;" v +rc test/lib/03-publish-c2b-qos1-disconnect.py /^rc = 1$/;" v +rc test/lib/03-publish-c2b-qos1-receive-maximum.py /^ rc = 0$/;" v +rc test/lib/03-publish-c2b-qos1-receive-maximum.py /^rc = 1$/;" v +rc test/lib/03-publish-c2b-qos1-timeout.py /^ rc = 0$/;" v +rc test/lib/03-publish-c2b-qos1-timeout.py /^rc = 1$/;" v +rc test/lib/03-publish-c2b-qos2-disconnect.py /^ rc = 0$/;" v +rc test/lib/03-publish-c2b-qos2-disconnect.py /^rc = 1$/;" v +rc test/lib/03-publish-c2b-qos2-maximum-qos-0.py /^ rc = 0$/;" v +rc test/lib/03-publish-c2b-qos2-maximum-qos-0.py /^rc = 1$/;" v +rc test/lib/03-publish-c2b-qos2-maximum-qos-1.py /^ rc = 0$/;" v +rc test/lib/03-publish-c2b-qos2-maximum-qos-1.py /^rc = 1$/;" v +rc test/lib/03-publish-c2b-qos2-pubrec-error.py /^ rc = 0$/;" v +rc test/lib/03-publish-c2b-qos2-pubrec-error.py /^rc = 1$/;" v +rc test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^ rc = 0$/;" v +rc test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^rc = 1$/;" v +rc test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^ rc = 0$/;" v +rc test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^rc = 1$/;" v +rc test/lib/03-publish-c2b-qos2-timeout.py /^ rc = 0$/;" v +rc test/lib/03-publish-c2b-qos2-timeout.py /^rc = 1$/;" v +rc test/lib/03-publish-c2b-qos2.py /^ rc = 0$/;" v +rc test/lib/03-publish-c2b-qos2.py /^rc = 1$/;" v +rc test/lib/03-publish-qos0-no-payload.py /^ rc = 0$/;" v +rc test/lib/03-publish-qos0-no-payload.py /^rc = 1$/;" v +rc test/lib/03-publish-qos0.py /^ rc = 0$/;" v +rc test/lib/03-publish-qos0.py /^rc = 1$/;" v +rc test/lib/03-request-response-correlation.py /^ rc = 0$/;" v +rc test/lib/03-request-response-correlation.py /^rc = 1$/;" v +rc test/lib/03-request-response.py /^ rc = 0$/;" v +rc test/lib/03-request-response.py /^rc = 1$/;" v +rc test/lib/04-retain-qos0.py /^ rc = 0$/;" v +rc test/lib/04-retain-qos0.py /^rc = 1$/;" v +rc test/lib/08-ssl-bad-cacert.py /^rc = 1$/;" v +rc test/lib/08-ssl-bad-cacert.py /^rc = client.returncode$/;" v +rc test/lib/08-ssl-connect-cert-auth-enc.py /^ rc = 0$/;" v +rc test/lib/08-ssl-connect-cert-auth-enc.py /^rc = 1$/;" v +rc test/lib/08-ssl-connect-cert-auth.py /^ rc = 0$/;" v +rc test/lib/08-ssl-connect-cert-auth.py /^rc = 1$/;" v +rc test/lib/08-ssl-connect-no-auth.py /^ rc = 0$/;" v +rc test/lib/08-ssl-connect-no-auth.py /^rc = 1$/;" v +rc test/lib/09-util-topic-tokenise.py /^rc = 1$/;" v +rc test/lib/11-prop-oversize-packet.py /^ rc = 0$/;" v +rc test/lib/11-prop-oversize-packet.py /^rc = 1$/;" v +rc test/lib/11-prop-send-content-type.py /^ rc = 0$/;" v +rc test/lib/11-prop-send-content-type.py /^rc = 1$/;" v +rc test/lib/11-prop-send-payload-format.py /^ rc = 0$/;" v +rc test/lib/11-prop-send-payload-format.py /^rc = 1$/;" v +rc test/lib/c/01-con-discon-success.c /^ int rc;$/;" l +rc test/lib/c/01-keepalive-pingreq.c /^ int rc;$/;" l +rc test/lib/c/01-no-clean-session.c /^ int rc;$/;" l +rc test/lib/c/01-server-keepalive-pingreq.c /^ int rc;$/;" l +rc test/lib/c/01-unpwd-set.c /^ int rc;$/;" l +rc test/lib/c/01-will-set.c /^ int rc;$/;" l +rc test/lib/c/01-will-unpwd-set.c /^ int rc;$/;" l +rc test/lib/c/02-subscribe-qos0.c /^ int rc;$/;" l +rc test/lib/c/02-subscribe-qos1.c /^ int rc;$/;" l +rc test/lib/c/02-subscribe-qos2.c /^ int rc;$/;" l +rc test/lib/c/02-unsubscribe-multiple-v5.c /^ int rc;$/;" l +rc test/lib/c/02-unsubscribe-v5.c /^ int rc;$/;" l +rc test/lib/c/02-unsubscribe.c /^ int rc;$/;" l +rc test/lib/c/03-publish-b2c-qos1.c /^ int rc;$/;" l +rc test/lib/c/03-publish-b2c-qos2-len.c /^ int rc;$/;" l +rc test/lib/c/03-publish-b2c-qos2.c /^ int rc;$/;" l +rc test/lib/c/03-publish-c2b-qos1-disconnect.c /^ int rc;$/;" l +rc test/lib/c/03-publish-c2b-qos1-len.c /^ int rc;$/;" l +rc test/lib/c/03-publish-c2b-qos1-receive-maximum.c /^ int rc;$/;" l +rc test/lib/c/03-publish-c2b-qos2-disconnect.c /^ int rc;$/;" l +rc test/lib/c/03-publish-c2b-qos2-len.c /^ int rc;$/;" l +rc test/lib/c/03-publish-c2b-qos2-maximum-qos-0.c /^ int rc;$/;" l +rc test/lib/c/03-publish-c2b-qos2-maximum-qos-1.c /^ int rc;$/;" l +rc test/lib/c/03-publish-c2b-qos2-pubrec-error.c /^ int rc;$/;" l +rc test/lib/c/03-publish-c2b-qos2-receive-maximum-1.c /^ int rc;$/;" l +rc test/lib/c/03-publish-c2b-qos2-receive-maximum-2.c /^ int rc;$/;" l +rc test/lib/c/03-publish-c2b-qos2.c /^ int rc;$/;" l +rc test/lib/c/03-publish-qos0-no-payload.c /^ int rc;$/;" l +rc test/lib/c/03-publish-qos0.c /^ int rc;$/;" l +rc test/lib/c/03-request-response-1.c /^ int rc;$/;" l +rc test/lib/c/03-request-response-2.c /^ int rc;$/;" l +rc test/lib/c/03-request-response-correlation-1.c /^ int rc;$/;" l +rc test/lib/c/04-retain-qos0.c /^ int rc;$/;" l +rc test/lib/c/08-ssl-bad-cacert.c /^ int rc = 1;$/;" l +rc test/lib/c/08-ssl-connect-cert-auth-enc.c /^ int rc;$/;" l +rc test/lib/c/08-ssl-connect-cert-auth.c /^ int rc;$/;" l +rc test/lib/c/08-ssl-connect-no-auth.c /^ int rc;$/;" l +rc test/lib/c/08-ssl-fake-cacert.c /^ int rc;$/;" l +rc test/lib/c/11-prop-oversize-packet.c /^ int rc;$/;" l +rc test/lib/c/11-prop-send-content-type.c /^ int rc;$/;" l +rc test/lib/c/11-prop-send-payload-format.c /^ int rc;$/;" l +rc test/lib/cpp/08-ssl-bad-cacert.cpp /^ int rc = 1;$/;" l +rc test/lib/cpp/08-ssl-fake-cacert.cpp /^ int rc;$/;" l +rc test/unit/datatype_read.c /^ int rc;$/;" l +rc test/unit/persist_read_stubs.c /^ int rc = MOSQ_ERR_SUCCESS;$/;" l +rc test/unit/persist_read_test.c /^ int rc;$/;" l +rc test/unit/persist_write_test.c /^ int rc = 1;$/;" l +rc test/unit/persist_write_test.c /^ int rc;$/;" l +rc test/unit/persist_write_test.c /^ size_t rc;$/;" l +rc test/unit/property_add.c /^ int rc;$/;" l +rc test/unit/property_read.c /^ int rc;$/;" l +rc test/unit/property_user_read.c /^ int rc;$/;" l +rc test/unit/property_write.c /^ int rc;$/;" l +rc test/unit/publish_test.c /^ int rc;$/;" l +rc test/unit/util_topic_test.c /^ int rc;$/;" l +rc2 client/pub_client.c /^ int rc, rc2;$/;" l +rc2 lib/net_mosq.c /^ int rc, rc2;$/;" l +rc2 src/bridge.c /^ int rc, rc2;$/;" l +rc2 src/handle_publish.c /^ int rc2;$/;" l +rc2 src/handle_subscribe.c /^ int rc2;$/;" l +rc2 src/subs.c /^ int rc = 0, rc2;$/;" l +rc2 src/subs.c /^ int rc2;$/;" l +rc2 test/lib/c/11-prop-send-content-type.c /^ int rc2;$/;" l +rc2 test/lib/c/11-prop-send-payload-format.c /^ int rc2;$/;" l +read_binary_helper test/unit/property_user_read.c /^static void read_binary_helper(const mosquitto_property *proplist, int identifier, void *expected_value, int expected_length)$/;" f file: +read_byte_helper test/unit/property_user_read.c /^static void read_byte_helper(const mosquitto_property *proplist, int identifier, uint8_t expected_value)$/;" f file: +read_e src/persist.h 32;" d +read_int16_helper test/unit/property_user_read.c /^static void read_int16_helper(const mosquitto_property *proplist, int identifier, uint16_t expected_value)$/;" f file: +read_int32_helper test/unit/property_user_read.c /^static void read_int32_helper(const mosquitto_property *proplist, int identifier, uint32_t expected_value)$/;" f file: +read_len client/pub_client.c /^ int read_len;$/;" l +read_len src/mosquitto_passwd.c /^ DWORD read_len = 0;$/;" l +read_length lib/packet_mosq.c /^ ssize_t read_length;$/;" l +read_string_helper test/unit/property_user_read.c /^static void read_string_helper(const mosquitto_property *proplist, int identifier, char *expected_value)$/;" f file: +read_string_pair_helper test/unit/property_user_read.c /^static void read_string_pair_helper(const mosquitto_property *proplist, int identifier, char *expected_key, char *expected_value)$/;" f file: +read_varint_helper test/unit/property_user_read.c /^static void read_varint_helper(const mosquitto_property *proplist, int identifier, uint32_t expected_value)$/;" f file: +readfds lib/loop.c /^ fd_set readfds, writefds;$/;" l +ready_for_repeat client/pub_client.c /^static bool ready_for_repeat = false;$/;" v file: +reason src/handle_unsubscribe.c /^ uint8_t reason;$/;" l +reason_code lib/handle_auth.c /^ uint8_t reason_code;$/;" l +reason_code lib/handle_connack.c /^ uint8_t reason_code;$/;" l +reason_code lib/handle_disconnect.c /^ uint8_t reason_code;$/;" l +reason_code lib/handle_pubackcomp.c /^ uint8_t reason_code = 0;$/;" l +reason_code lib/handle_pubrec.c /^ uint8_t reason_code = 0;$/;" l +reason_code lib/handle_pubrel.c /^ uint8_t reason_code;$/;" l +reason_code src/handle_auth.c /^ uint8_t reason_code = 0;$/;" l +reason_code src/handle_connack.c /^ uint8_t reason_code;$/;" l +reason_code src/handle_disconnect.c /^ uint8_t reason_code = 0;$/;" l +reason_code src/handle_publish.c /^ uint8_t reason_code = 0;$/;" l +reason_code_count src/handle_unsubscribe.c /^ int reason_code_count = 0;$/;" l +reason_code_max src/handle_unsubscribe.c /^ int reason_code_max;$/;" l +reason_codes src/handle_unsubscribe.c /^ uint8_t *reason_codes = NULL, *reason_tmp;$/;" l +reason_tmp src/handle_unsubscribe.c /^ uint8_t *reason_codes = NULL, *reason_tmp;$/;" l +reauth2_packet test/broker/09-extended-auth-multistep-reauth.py /^reauth2_packet = mosq_test.gen_auth(reason_code=mqtt5_rc.MQTT_RC_REAUTHENTICATE, properties=props)$/;" v +reauth3_packet test/broker/09-extended-auth-multistep-reauth.py /^reauth3_packet = mosq_test.gen_auth(reason_code=mqtt5_rc.MQTT_RC_REAUTHENTICATE, properties=props)$/;" v +receive_maximum lib/mosquitto_internal.h /^ uint16_t receive_maximum;$/;" m struct:mosquitto +receive_maximum lib/send_connect.c /^ uint16_t receive_maximum;$/;" l +reconnect examples/mysql_log/mysql_log.c /^ my_bool reconnect = true;$/;" l +reconnect lib/cpp/mosquittopp.cpp /^int mosquittopp::reconnect()$/;" f class:mosqpp::mosquittopp +reconnect_async lib/cpp/mosquittopp.cpp /^int mosquittopp::reconnect_async()$/;" f class:mosqpp::mosquittopp +reconnect_delay lib/loop.c /^ unsigned long reconnect_delay;$/;" l +reconnect_delay lib/mosquitto_internal.h /^ unsigned int reconnect_delay;$/;" m struct:mosquitto +reconnect_delay_max lib/mosquitto_internal.h /^ unsigned int reconnect_delay_max;$/;" m struct:mosquitto +reconnect_delay_set lib/cpp/mosquittopp.cpp /^void mosquittopp::reconnect_delay_set(unsigned int reconnect_delay, unsigned int reconnect_delay_max, bool reconnect_exponential_backoff)$/;" f class:mosqpp::mosquittopp +reconnect_exponential_backoff lib/mosquitto_internal.h /^ bool reconnect_exponential_backoff;$/;" m struct:mosquitto +reconnects lib/loop.c /^ unsigned int reconnects = 0;$/;" l +recv_props test/broker/07-will-properties.py /^recv_props = mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key1", "value1")$/;" v +recv_props test/broker/07-will-properties.py /^recv_props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_RESPONSE_TOPIC, "response\/topic")$/;" v +ref_count src/mosquitto_broker_internal.h /^ int ref_count;$/;" m struct:mosquitto_msg_store +registerOfflineSubscriber test/broker/03-publish-qos1-queued-bytes.py /^def registerOfflineSubscriber():$/;" f +reinitialise lib/cpp/mosquittopp.cpp /^int mosquittopp::reinitialise(const char *id, bool clean_session)$/;" f class:mosqpp::mosquittopp +rem lib/loop.c /^ struct timespec req, rem;$/;" l +remaining_bytes lib/packet_mosq.c /^ uint8_t remaining_bytes[5], byte;$/;" l +remaining_count lib/mosquitto_internal.h /^ int8_t remaining_count;$/;" m struct:mosquitto__packet +remaining_length lib/actions.c /^ uint32_t remaining_length = 0;$/;" l +remaining_length lib/actions.c /^ uint32_t remaining_length;$/;" l +remaining_length lib/mosquitto_internal.h /^ uint32_t remaining_length;$/;" m struct:mosquitto__packet +remaining_length lib/packet_mosq.c /^ uint32_t remaining_length;$/;" l +remaining_length src/send_auth.c /^ uint32_t remaining_length;$/;" l +remaining_length src/send_connack.c /^ uint32_t remaining_length;$/;" l +remaining_length test/mosq_test.py /^def remaining_length(packet):$/;" f +remaining_mult lib/mosquitto_internal.h /^ uint32_t remaining_mult;$/;" m struct:mosquitto__packet +remaining_mult lib/packet_datatypes.c /^ int remaining_mult = 1;$/;" l +remote_clientid src/mosquitto_broker_internal.h /^ char *remote_clientid;$/;" m struct:mosquitto__bridge +remote_password src/mosquitto_broker_internal.h /^ char *remote_password;$/;" m struct:mosquitto__bridge +remote_prefix src/mosquitto_broker_internal.h /^ char *remote_prefix;$/;" m struct:mosquitto__bridge_topic +remote_topic src/mosquitto_broker_internal.h /^ char *remote_topic; \/* topic prefixed with remote_prefix *\/$/;" m struct:mosquitto__bridge_topic +remote_username src/mosquitto_broker_internal.h /^ char *remote_username;$/;" m struct:mosquitto__bridge +remove_retained client/client_shared.h /^ bool remove_retained; \/* sub *\/$/;" m struct:mosq_config +removed_from_by_id lib/mosquitto_internal.h /^ bool removed_from_by_id; \/* True if removed from by_id hash *\/$/;" m struct:mosquitto +repeat_count client/client_shared.h /^ int repeat_count; \/* pub *\/$/;" m struct:mosq_config +repeat_delay client/client_shared.h /^ struct timeval repeat_delay; \/* pub *\/$/;" m struct:mosq_config typeref:struct:mosq_config::timeval +reply lib/srv_mosq.c /^ struct ares_srv_reply *reply = NULL;$/;" l +req lib/loop.c /^ struct timespec req, rem;$/;" l +require_certificate src/mosquitto_broker_internal.h /^ bool require_certificate;$/;" m struct:mosquitto__listener +res client/sub_client.c /^ bool res;$/;" l +res lib/net_mosq.c /^ long res;$/;" l +res src/handle_publish.c /^ int res = 0;$/;" l +resp_topic test/lib/03-request-response-correlation.py /^resp_topic = "response\/topic"$/;" v +resp_topic test/lib/03-request-response.py /^resp_topic = "response\/topic"$/;" v +resp_topic test/lib/c/03-request-response-2.c /^ char *resp_topic = NULL;$/;" l +response_topic client/client_shared.h /^ char *response_topic; \/* rr *\/$/;" m struct:mosq_config +restart_t src/mosquitto_broker_internal.h /^ time_t restart_t;$/;" m struct:mosquitto__bridge +restart_timeout src/mosquitto_broker_internal.h /^ int restart_timeout;$/;" m struct:mosquitto__bridge +restore_privileges src/mosquitto.c /^int restore_privileges(void)$/;" f +result lib/mosquitto.c /^ bool result = false;$/;" l +result src/conf_includedir.c /^ int result;$/;" l +result src/security_default.c /^ bool result;$/;" l +result test/unit/utf8.c /^ int result;$/;" l +result2 lib/net_mosq_ocsp.c /^ int ocsp_status, result2, i;$/;" l +ret lib/net_mosq.c /^ int ret, err;$/;" l +ret lib/net_mosq.c /^ int ret;$/;" l +retain client/client_shared.h /^ bool retain;$/;" m struct:mosq_config +retain lib/mosquitto.h /^ bool retain;$/;" m struct:libmosquitto_will +retain lib/mosquitto.h /^ bool retain;$/;" m struct:mosquitto_message +retain src/database.c /^ int retain;$/;" l +retain src/db_dump/db_dump.c /^ uint8_t qos, retain, direction, state, dup;$/;" m struct:db_client_msg file: +retain src/db_dump/db_dump.c /^ uint8_t qos, retain;$/;" m struct:db_msg file: +retain src/handle_publish.c /^ uint8_t dup, qos, retain;$/;" l +retain src/mosquitto_broker_internal.h /^ bool retain;$/;" m struct:mosquitto_client_msg +retain src/mosquitto_broker_internal.h /^ bool retain;$/;" m struct:mosquitto_msg_store +retain src/mosquitto_plugin.h /^ bool retain;$/;" m struct:mosquitto_acl_msg +retain src/persist.h /^ uint8_t retain;$/;" m struct:PF_msg_store +retain src/persist_read_v234.c /^ uint8_t retain, dup;$/;" l +retain__process src/subs.c /^static int retain__process(struct mosquitto_db *db, struct mosquitto__subhier *branch, struct mosquitto *context, int sub_qos, uint32_t subscription_identifier, time_t now)$/;" f file: +retain__search src/subs.c /^static int retain__search(struct mosquitto_db *db, struct mosquitto__subhier *subhier, struct sub__token *tokens, struct mosquitto *context, const char *sub, int sub_qos, uint32_t subscription_identifier, time_t now, int level)$/;" f file: +retain_as_published src/mosquitto_broker_internal.h /^ bool retain_as_published;$/;" m struct:mosquitto__subleaf +retain_available src/mosquitto_broker_internal.h /^ bool retain_available;$/;" m struct:mosquitto__config +retain_chunk src/persist_write.c /^ struct P_retain retain_chunk;$/;" l +retain_clear_packet test/broker/04-retain-qos0-clear.py /^retain_clear_packet = mosq_test.gen_publish("retain\/clear\/test", qos=0, payload=None, retain=True)$/;" v +retain_count src/db_dump/db_dump.c /^ long retain_count = 0;$/;" l +retain_ctxt src/subs.c /^ struct mosquitto retain_ctxt;$/;" l +retain_dup src/persist.h /^ uint8_t retain_dup;$/;" m struct:PF_client_msg +retain_handling src/handle_subscribe.c /^ uint8_t retain_handling = 0;$/;" l +retained src/mosquitto_broker_internal.h /^ struct mosquitto_msg_store *retained;$/;" m struct:mosquitto__subhier typeref:struct:mosquitto__subhier::mosquitto_msg_store +retained src/subs.c /^ struct mosquitto_msg_store *retained;$/;" l +retained_count src/mosquitto_broker_internal.h /^ int retained_count;$/;" m struct:mosquitto_db +retained_count src/sys_tree.c /^ static int retained_count = -1;$/;" l file: +retained_only client/client_shared.h /^ bool retained_only; \/* sub *\/$/;" m struct:mosq_config +retries src/database.c /^ int retries;$/;" l +rev lib/net_mosq_ocsp.c /^ ASN1_GENERALIZEDTIME *rev, *thisupd, *nextupd;$/;" l +revision client/pub_client.c /^ int major, minor, revision;$/;" l +revision client/rr_client.c /^ int major, minor, revision;$/;" l +revision client/sub_client.c /^ int major, minor, revision;$/;" l +rlen client/pub_shared.c /^ long pos = 0, rlen;$/;" l +rlen client/pub_shared.c /^ long pos, rlen;$/;" l +rlen src/db_dump/db_dump.c /^ ssize_t rlen;$/;" l +rlen src/persist_read.c /^ ssize_t rlen;$/;" l +rlen src/persist_read_v234.c /^ size_t rlen;$/;" l +rlen src/persist_read_v5.c /^ size_t rlen;$/;" l +rnd src/handle_connect.c /^ uint8_t rnd[16];$/;" l +round_robin src/mosquitto_broker_internal.h /^ bool round_robin;$/;" m struct:mosquitto__bridge +rp lib/net_mosq.c /^ struct addrinfo *ainfo, *rp;$/;" l +rp src/net.c /^ struct addrinfo *ainfo, *rp;$/;" l +rp_bind lib/net_mosq.c /^ struct addrinfo *ainfo_bind, *rp_bind;$/;" l +rq test/broker/03-publish-qos1-queued-bytes.py /^rq = Queue.Queue()$/;" v +rr__state client/rr_client.c /^enum rr__state {$/;" g file: +rr_s_connected client/rr_client.c /^ rr_s_connected,$/;" e enum:rr__state file: +rr_s_disconnect client/rr_client.c /^ rr_s_disconnect$/;" e enum:rr__state file: +rr_s_new client/rr_client.c /^ rr_s_new,$/;" e enum:rr__state file: +rr_s_ready_to_publish client/rr_client.c /^ rr_s_ready_to_publish,$/;" e enum:rr__state file: +rr_s_subscribed client/rr_client.c /^ rr_s_subscribed,$/;" e enum:rr__state file: +rr_s_wait_for_response client/rr_client.c /^ rr_s_wait_for_response,$/;" e enum:rr__state file: +rsp lib/net_mosq_ocsp.c /^ OCSP_RESPONSE *rsp = NULL;$/;" l +run examples/mysql_log/mysql_log.c /^static int run = 1;$/;" v file: +run lib/loop.c /^ int run = 1;$/;" l +run src/loop.c /^extern int run;$/;" x +run src/mosquitto.c /^int run;$/;" v +run src/service.c /^extern int run;$/;" x +run src/signals.c /^extern int run;$/;" x +run test/broker/03-publish-qos1-queued-bytes.py /^ def run(self):$/;" m class:BrokerMonitor +run test/broker/c/08-tls-psk-bridge.c /^static int run = -1;$/;" v file: +run test/broker/c/08-tls-psk-pub.c /^static int run = -1;$/;" v file: +run test/lib/c/01-con-discon-success.c /^static int run = -1;$/;" v file: +run test/lib/c/01-keepalive-pingreq.c /^static int run = -1;$/;" v file: +run test/lib/c/01-no-clean-session.c /^static int run = -1;$/;" v file: +run test/lib/c/01-server-keepalive-pingreq.c /^static int run = -1;$/;" v file: +run test/lib/c/01-unpwd-set.c /^static int run = -1;$/;" v file: +run test/lib/c/01-will-set.c /^static int run = -1;$/;" v file: +run test/lib/c/01-will-unpwd-set.c /^static int run = -1;$/;" v file: +run test/lib/c/02-subscribe-qos0.c /^static int run = -1;$/;" v file: +run test/lib/c/02-subscribe-qos1.c /^static int run = -1;$/;" v file: +run test/lib/c/02-subscribe-qos2.c /^static int run = -1;$/;" v file: +run test/lib/c/02-unsubscribe-multiple-v5.c /^static int run = -1;$/;" v file: +run test/lib/c/02-unsubscribe-v5.c /^static int run = -1;$/;" v file: +run test/lib/c/02-unsubscribe.c /^static int run = -1;$/;" v file: +run test/lib/c/03-publish-b2c-qos2-len.c /^static int run = -1;$/;" v file: +run test/lib/c/03-publish-b2c-qos2.c /^static int run = -1;$/;" v file: +run test/lib/c/03-publish-c2b-qos1-disconnect.c /^static int run = -1;$/;" v file: +run test/lib/c/03-publish-c2b-qos1-len.c /^static int run = -1;$/;" v file: +run test/lib/c/03-publish-c2b-qos1-receive-maximum.c /^static int run = -1;$/;" v file: +run test/lib/c/03-publish-c2b-qos2-disconnect.c /^static int run = -1;$/;" v file: +run test/lib/c/03-publish-c2b-qos2-len.c /^static int run = -1;$/;" v file: +run test/lib/c/03-publish-c2b-qos2-maximum-qos-0.c /^static int run = -1;$/;" v file: +run test/lib/c/03-publish-c2b-qos2-maximum-qos-1.c /^static int run = -1;$/;" v file: +run test/lib/c/03-publish-c2b-qos2-pubrec-error.c /^static int run = -1;$/;" v file: +run test/lib/c/03-publish-c2b-qos2-receive-maximum-1.c /^static int run = -1;$/;" v file: +run test/lib/c/03-publish-c2b-qos2-receive-maximum-2.c /^static int run = -1;$/;" v file: +run test/lib/c/03-publish-c2b-qos2.c /^static int run = -1;$/;" v file: +run test/lib/c/03-publish-qos0-no-payload.c /^static int run = -1;$/;" v file: +run test/lib/c/03-publish-qos0.c /^static int run = -1;$/;" v file: +run test/lib/c/03-request-response-1.c /^static int run = -1;$/;" v file: +run test/lib/c/03-request-response-2.c /^static int run = -1;$/;" v file: +run test/lib/c/03-request-response-correlation-1.c /^static int run = -1;$/;" v file: +run test/lib/c/04-retain-qos0.c /^static int run = -1;$/;" v file: +run test/lib/c/08-ssl-connect-cert-auth-enc.c /^static int run = -1;$/;" v file: +run test/lib/c/08-ssl-connect-cert-auth.c /^static int run = -1;$/;" v file: +run test/lib/c/08-ssl-connect-no-auth.c /^static int run = -1;$/;" v file: +run test/lib/c/08-ssl-fake-cacert.c /^static int run = -1;$/;" v file: +run test/lib/c/11-prop-oversize-packet.c /^static int run = -1;$/;" v file: +run test/lib/c/11-prop-send-content-type.c /^static int run = -1;$/;" v file: +run test/lib/c/11-prop-send-payload-format.c /^static int run = -1;$/;" v file: +run test/lib/cpp/01-con-discon-success.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/01-keepalive-pingreq.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/01-no-clean-session.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/01-unpwd-set.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/01-will-set.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/01-will-unpwd-set.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/02-subscribe-qos0.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/02-subscribe-qos1.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/02-subscribe-qos2.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/02-unsubscribe.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/03-publish-b2c-qos2.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/03-publish-c2b-qos2.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/03-publish-qos0-no-payload.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/03-publish-qos0.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/04-retain-qos0.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/08-ssl-bad-cacert.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/08-ssl-connect-cert-auth.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/08-ssl-connect-no-auth.cpp /^static int run = -1;$/;" v file: +run test/lib/cpp/08-ssl-fake-cacert.cpp /^static int run = -1;$/;" v file: +run test/old/msgsps_pub.c /^static bool run = true;$/;" v file: +run test/old/msgsps_sub.c /^static bool run = true;$/;" v file: +run_clients test/random/test.py /^def run_clients(max_clients):$/;" f +run_tests test/ptest.py /^def run_tests(tests, minport=1888, max_running=20):$/;" f +running misc/currentcost/cc128_read.py /^ running = False$/;" v +running misc/currentcost/cc128_read.py /^running = True$/;" v +running test/random/random_client.py /^running = True$/;" v +s client/sub_client_output.c /^ time_t s;$/;" l +s lib/logging_mosq.c /^ char *s;$/;" l +s lib/net_mosq.c /^ int s;$/;" l +s lib/property_mosq.h /^ struct mqtt__string s;$/;" m union:mqtt5__property::__anon2 typeref:struct:mqtt5__property::__anon2::mqtt__string +s src/db_dump/db_dump.c /^ char *s = NULL;$/;" l +s src/logging.c /^ char *s;$/;" l +s src/logging.c /^ time_t s;$/;" l +s src/persist_read.c /^ char *s = NULL;$/;" l +s src/security_default.c /^ char *s;$/;" l +s1 src/conf_includedir.c /^ const char *s1 = *(const char **)p1;$/;" l +s2 src/conf_includedir.c /^ const char *s2 = *(const char **)p2;$/;" l +sa lib/net_mosq.c /^ struct sockaddr_in *sa = (struct sockaddr_in *)&ss;$/;" l +sa6 lib/net_mosq.c /^ struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)&ss;$/;" l +salt src/mosquitto_broker_internal.h /^ unsigned char *salt;$/;" m struct:mosquitto__unpwd +salt src/mosquitto_passwd.c /^ unsigned char salt[SALT_LEN];$/;" l +salt src/security_default.c /^ unsigned char *salt;$/;" l +salt64 src/mosquitto_passwd.c /^ char *salt64 = NULL, *hash64 = NULL;$/;" l +salt_len src/mosquitto_broker_internal.h /^ unsigned int salt_len;$/;" m struct:mosquitto__unpwd +salt_len src/security_default.c /^ unsigned int salt_len;$/;" l +saveptr src/conf.c /^ char *saveptr = NULL;$/;" l +saveptr src/mosquitto.c /^ char *saveptr = NULL;$/;" l +saveptr src/security_default.c /^ char *saveptr = NULL;$/;" l +sc_manager src/service.c /^ SC_HANDLE sc_manager, svc_handle;$/;" l +scmp_p src/conf_includedir.c /^int scmp_p(const void *p1, const void *p2)$/;" f +sd lib/util_mosq.c /^ SECURITY_DESCRIPTOR sd;$/;" l +sec lib/util_mosq.c /^ SECURITY_ATTRIBUTES sec;$/;" l +security__cleanup_single src/security.c /^static int security__cleanup_single(struct mosquitto__security_options *opts, bool reload)$/;" f file: +security__init_single src/security.c /^static int security__init_single(struct mosquitto__security_options *opts, bool reload)$/;" f file: +security__load_v2 src/security.c /^int security__load_v2(struct mosquitto__auth_plugin *plugin, struct mosquitto_auth_opt *auth_options, int auth_option_count, void *lib)$/;" f +security__load_v3 src/security.c /^int security__load_v3(struct mosquitto__auth_plugin *plugin, struct mosquitto_opt *auth_options, int auth_option_count, void *lib)$/;" f +security__load_v4 src/security.c /^int security__load_v4(struct mosquitto__auth_plugin *plugin, struct mosquitto_opt *auth_options, int auth_option_count, void *lib)$/;" f +security__module_cleanup_single src/security.c /^static void security__module_cleanup_single(struct mosquitto__security_options *opts)$/;" f file: +security__module_init_single src/security.c /^static int security__module_init_single(struct mosquitto__security_options *opts)$/;" f file: +security_cleanup_v2 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_security_cleanup_v2 security_cleanup_v2;$/;" m struct:mosquitto__auth_plugin +security_cleanup_v3 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_security_cleanup_v3 security_cleanup_v3;$/;" m struct:mosquitto__auth_plugin +security_cleanup_v4 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_security_cleanup_v4 security_cleanup_v4;$/;" m struct:mosquitto__auth_plugin +security_init_v2 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_security_init_v2 security_init_v2;$/;" m struct:mosquitto__auth_plugin +security_init_v3 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_security_init_v3 security_init_v3;$/;" m struct:mosquitto__auth_plugin +security_init_v4 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_security_init_v4 security_init_v4;$/;" m struct:mosquitto__auth_plugin +security_options src/mosquitto_broker_internal.h /^ struct mosquitto__security_options security_options;$/;" m struct:mosquitto__config typeref:struct:mosquitto__config::mosquitto__security_options +security_options src/mosquitto_broker_internal.h /^ struct mosquitto__security_options security_options;$/;" m struct:mosquitto__listener typeref:struct:mosquitto__listener::mosquitto__security_options +security_opts src/security_default.c /^ struct mosquitto__security_options *security_opts = NULL;$/;" l +security_opts src/security_default.c /^ struct mosquitto__security_options *security_opts;$/;" l +send__auth src/send_auth.c /^int send__auth(struct mosquitto_db *db, struct mosquitto *context, int reason_code, const void *auth_data, uint16_t auth_data_len)$/;" f +send__command_with_mid lib/send_mosq.c /^int send__command_with_mid(struct mosquitto *mosq, uint8_t command, uint16_t mid, bool dup, uint8_t reason_code, const mosquitto_property *properties)$/;" f +send__connack src/send_connack.c /^int send__connack(struct mosquitto_db *db, struct mosquitto *context, int ack, int reason_code, const mosquitto_property *properties)$/;" f +send__connect lib/send_connect.c /^int send__connect(struct mosquitto *mosq, uint16_t keepalive, bool clean_session, const mosquitto_property *properties)$/;" f +send__disconnect lib/send_disconnect.c /^int send__disconnect(struct mosquitto *mosq, uint8_t reason_code, const mosquitto_property *properties)$/;" f +send__pingreq lib/send_mosq.c /^int send__pingreq(struct mosquitto *mosq)$/;" f +send__pingreq test/unit/persist_read_stubs.c /^int send__pingreq(struct mosquitto *mosq)$/;" f +send__pingreq test/unit/persist_write_stubs.c /^int send__pingreq(struct mosquitto *mosq)$/;" f +send__pingresp lib/send_mosq.c /^int send__pingresp(struct mosquitto *mosq)$/;" f +send__puback lib/send_mosq.c /^int send__puback(struct mosquitto *mosq, uint16_t mid, uint8_t reason_code)$/;" f +send__pubcomp lib/send_mosq.c /^int send__pubcomp(struct mosquitto *mosq, uint16_t mid)$/;" f +send__pubcomp test/unit/persist_write_stubs.c /^int send__pubcomp(struct mosquitto *mosq, uint16_t mid)$/;" f +send__publish lib/send_publish.c /^int send__publish(struct mosquitto *mosq, uint16_t mid, const char *topic, uint32_t payloadlen, const void *payload, int qos, bool retain, bool dup, const mosquitto_property *cmsg_props, const mosquitto_property *store_props, uint32_t expiry_interval)$/;" f +send__publish test/unit/persist_write_stubs.c /^int send__publish(struct mosquitto *mosq, uint16_t mid, const char *topic, uint32_t payloadlen, const void *payload, int qos, bool retain, bool dup, const mosquitto_property *cmsg_props, const mosquitto_property *store_props, uint32_t expiry_interval)$/;" f +send__pubrec lib/send_mosq.c /^int send__pubrec(struct mosquitto *mosq, uint16_t mid, uint8_t reason_code)$/;" f +send__pubrec test/unit/persist_write_stubs.c /^int send__pubrec(struct mosquitto *mosq, uint16_t mid, uint8_t reason_code)$/;" f +send__pubrel lib/send_mosq.c /^int send__pubrel(struct mosquitto *mosq, uint16_t mid)$/;" f +send__pubrel test/unit/persist_write_stubs.c /^int send__pubrel(struct mosquitto *mosq, uint16_t mid)$/;" f +send__real_publish lib/send_publish.c /^int send__real_publish(struct mosquitto *mosq, uint16_t mid, const char *topic, uint32_t payloadlen, const void *payload, int qos, bool retain, bool dup, const mosquitto_property *cmsg_props, const mosquitto_property *store_props, uint32_t expiry_interval)$/;" f +send__simple_command lib/send_mosq.c /^int send__simple_command(struct mosquitto *mosq, uint8_t command)$/;" f +send__suback src/send_suback.c /^int send__suback(struct mosquitto *context, uint16_t mid, uint32_t payloadlen, const void *payload)$/;" f +send__subscribe lib/send_subscribe.c /^int send__subscribe(struct mosquitto *mosq, int *mid, int topic_count, const char **topic, int topic_qos, const mosquitto_property *properties)$/;" f +send__unsuback src/send_unsuback.c /^int send__unsuback(struct mosquitto *mosq, uint16_t mid, int reason_code_count, uint8_t *reason_codes, const mosquitto_property *properties)$/;" f +send__unsubscribe lib/send_unsubscribe.c /^int send__unsubscribe(struct mosquitto *mosq, int *mid, int topic_count, char *const *const topic, const mosquitto_property *properties)$/;" f +send_maximum lib/mosquitto_internal.h /^ uint16_t send_maximum;$/;" m struct:mosquitto +sent_mid test/broker/c/08-tls-psk-bridge.c /^static int sent_mid;$/;" v file: +sent_mid test/broker/c/08-tls-psk-pub.c /^static int sent_mid;$/;" v file: +sent_mid test/lib/c/03-publish-qos0-no-payload.c /^static int sent_mid = -1;$/;" v file: +sent_mid test/lib/c/03-publish-qos0.c /^static int sent_mid = -1;$/;" v file: +sent_mid test/lib/c/03-request-response-1.c /^static int sent_mid = -1;$/;" v file: +sent_mid test/lib/c/03-request-response-2.c /^static int sent_mid = -1;$/;" v file: +sent_mid test/lib/c/03-request-response-correlation-1.c /^static int sent_mid = -1;$/;" v file: +sent_mid test/lib/c/11-prop-oversize-packet.c /^static int sent_mid = -1;$/;" v file: +sent_mid test/lib/c/11-prop-send-content-type.c /^static int sent_mid = -1;$/;" v file: +sent_mid test/lib/c/11-prop-send-payload-format.c /^static int sent_mid = -1;$/;" v file: +sent_mid test/lib/cpp/03-publish-qos0-no-payload.cpp /^static int sent_mid = -1;$/;" v file: +sent_mid test/lib/cpp/03-publish-qos0.cpp /^static int sent_mid = -1;$/;" v file: +server_keepalive test/lib/01-server-keepalive-pingreq.py /^server_keepalive = 4$/;" v +service src/net.c /^ char service[10];$/;" l +service_handle src/conf.c /^extern SERVICE_STATUS_HANDLE service_handle;$/;" x +service_handle src/service.c /^SERVICE_STATUS_HANDLE service_handle = 0;$/;" v +service_handler src/service.c /^void __stdcall service_handler(DWORD fdwControl)$/;" f +service_install src/service.c /^void service_install(void)$/;" f +service_main src/service.c /^void __stdcall service_main(DWORD dwArgc, LPTSTR *lpszArgv)$/;" f +service_run src/service.c /^void service_run(void)$/;" f +service_status src/service.c /^static SERVICE_STATUS service_status;$/;" v file: +service_uninstall src/service.c /^void service_uninstall(void)$/;" f +session_expiry__add src/session_expiry.c /^int session_expiry__add(struct mosquitto_db *db, struct mosquitto *context)$/;" f +session_expiry__check src/session_expiry.c /^void session_expiry__check(struct mosquitto_db *db, time_t now)$/;" f +session_expiry__cmp src/session_expiry.c /^static int session_expiry__cmp(struct session_expiry_list *i1, struct session_expiry_list *i2)$/;" f file: +session_expiry__remove src/session_expiry.c /^void session_expiry__remove(struct mosquitto *context)$/;" f +session_expiry__remove_all src/session_expiry.c /^void session_expiry__remove_all(struct mosquitto_db *db)$/;" f +session_expiry_interval lib/mosquitto_internal.h /^ uint32_t session_expiry_interval;$/;" m struct:mosquitto +session_expiry_interval src/persist.h /^ uint32_t session_expiry_interval;$/;" m struct:PF_client +session_expiry_list lib/mosquitto_internal.h /^struct session_expiry_list {$/;" s +session_expiry_time lib/mosquitto_internal.h /^ time_t session_expiry_time;$/;" m struct:mosquitto +session_expiry_time src/persist.h /^ int64_t session_expiry_time;$/;" m struct:PF_client +set_label misc/currentcost/gnome-panel/CurrentCostMQTT.py /^ def set_label(self, val):$/;" m class:CurrentCostMQTT +set_repeat_time client/pub_client.c /^static void set_repeat_time(void)$/;" f file: +set_tcp_nodelay src/mosquitto_broker_internal.h /^ bool set_tcp_nodelay;$/;" m struct:mosquitto__config +setup_ui_method lib/net_mosq.c /^static void setup_ui_method(void)$/;" f file: +sevp lib/net_mosq.c /^ void *sevp = NULL;$/;" l +sha lib/util_mosq.c /^ unsigned char *sha, tmp[SHA_DIGEST_LENGTH];$/;" l +shared src/mosquitto_broker_internal.h /^ struct mosquitto__subshared *shared;$/;" m struct:mosquitto__subhier typeref:struct:mosquitto__subhier::mosquitto__subshared +shared src/mosquitto_broker_internal.h /^ struct mosquitto__subshared *shared;$/;" m struct:mosquitto__subshared_ref typeref:struct:mosquitto__subshared_ref::mosquitto__subshared +shared src/subs.c /^ struct mosquitto__subshared *shared = NULL;$/;" l +shared src/subs.c /^ struct mosquitto__subshared *shared, *shared_tmp;$/;" l +shared src/subs.c /^ struct mosquitto__subshared *shared;$/;" l +shared_ref src/subs.c /^ struct mosquitto__subshared_ref *shared_ref;$/;" l +shared_sub_count lib/mosquitto_internal.h /^ int shared_sub_count;$/;" m struct:mosquitto +shared_subs lib/mosquitto_internal.h /^ struct mosquitto__subshared_ref **shared_subs;$/;" m struct:mosquitto typeref:struct:mosquitto::mosquitto__subshared_ref +shared_subs src/subs.c /^ struct mosquitto__subshared_ref **shared_subs;$/;" l +shared_subscription_count src/mosquitto_broker_internal.h /^ int shared_subscription_count;$/;" m struct:mosquitto_db +shared_subscription_count src/sys_tree.c /^ static int shared_subscription_count = -1;$/;" l file: +shared_tmp src/subs.c /^ struct mosquitto__subshared *shared, *shared_tmp;$/;" l +sharename src/subs.c /^ char *sharename = NULL;$/;" l +show_menu misc/currentcost/gnome-panel/CurrentCostMQTT.py /^ def show_menu(self, widget, event):$/;" m class:CurrentCostMQTT +shutdown src/persist.h /^ uint8_t shutdown;$/;" m struct:PF_cfg +sigact client/rr_client.c /^ struct sigaction sigact;$/;" l +sigact client/sub_client.c /^ struct sigaction sigact;$/;" l +sigblock src/loop.c /^ sigset_t sigblock, origsig;$/;" l +signature src/deps/uthash.h /^ uint32_t signature; \/* used only to find hash tables in external analysis *\/$/;" m struct:UT_hash_table +single lib/net_mosq_ocsp.c /^ OCSP_SINGLERESP *single = NULL;$/;" l +single_add_binary_helper test/unit/property_add.c /^static void single_add_binary_helper(int identifier)$/;" f file: +single_add_byte_helper test/unit/property_add.c /^static void single_add_byte_helper(int identifier)$/;" f file: +single_add_int16_helper test/unit/property_add.c /^static void single_add_int16_helper(int identifier)$/;" f file: +single_add_int32_helper test/unit/property_add.c /^static void single_add_int32_helper(int identifier)$/;" f file: +single_add_string_helper test/unit/property_add.c /^static void single_add_string_helper(int identifier)$/;" f file: +single_add_string_pair_helper test/unit/property_add.c /^static void single_add_string_pair_helper(int identifier)$/;" f file: +single_add_varint_helper test/unit/property_add.c /^static void single_add_varint_helper(int identifier)$/;" f file: +single_test test/broker/09-acl-access-variants.py /^def single_test(port, per_listener, username, topic, expect_deny):$/;" f +sleep_time test/broker/06-bridge-fail-persist-resend-qos1.py /^ sleep_time = 0.5$/;" v +sleep_time test/broker/06-bridge-fail-persist-resend-qos2.py /^ sleep_time = 0.5$/;" v +slen lib/actions.c /^ int slen;$/;" l +slen lib/handle_publish.c /^ int slen;$/;" l +slen lib/packet_datatypes.c /^ uint16_t slen;$/;" l +slen lib/socks_mosq.c /^ int slen;$/;" l +slen src/db_dump/db_dump.c /^ uint16_t slen;$/;" l +slen src/handle_connect.c /^ int slen;$/;" l +slen src/handle_publish.c /^ int slen;$/;" l +slen src/handle_subscribe.c /^ int slen;$/;" l +slen src/handle_unsubscribe.c /^ int slen;$/;" l +slen src/persist_read.c /^ uint16_t slen;$/;" l +slen src/persist_write.c /^ size_t slen;$/;" l +slen src/security_default.c /^ int slen;$/;" l +slen src/subs.c /^ unsigned int slen;$/;" l +slen src/websockets.c /^ size_t inlen, slen;$/;" l +slen1 lib/property_mosq.c /^ int slen1, slen2;$/;" l +slen16 src/handle_connect.c /^ uint16_t slen16;$/;" l +slen2 lib/property_mosq.c /^ int slen1, slen2;$/;" l +snap src/mosquitto.c /^ const char *snap = getenv("SNAP_NAME");$/;" l +snprintf client/client_props.c 30;" d file: +snprintf client/client_shared.c 31;" d file: +snprintf client/pub_client.c 30;" d file: +snprintf client/pub_shared.c 29;" d file: +snprintf client/rr_client.c 31;" d file: +snprintf client/sub_client.c 31;" d file: +snprintf client/sub_client_output.c 30;" d file: +snprintf config.h 27;" d +snprintf examples/mysql_log/mysql_log.c 9;" d file: +snprintf src/mosquitto_passwd.c 42;" d file: +sock lib/mosquitto_internal.h /^ mosq_sock_t sock;$/;" m struct:mosquitto +sock lib/net_mosq.c /^ mosq_sock_t sock = INVALID_SOCKET;$/;" l +sock src/net.c /^ mosq_sock_t sock = INVALID_SOCKET;$/;" l +sock test/broker/01-connect-bad-packet.py /^ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/broker/01-connect-duplicate-v5.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/01-connect-duplicate.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/01-connect-invalid-id-0-311.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/01-connect-invalid-id-0.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/01-connect-invalid-id-missing.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/01-connect-invalid-id-utf8.py /^ sock = mosq_test.do_client_connect(connect_packet, b"", port=port)$/;" v +sock test/broker/01-connect-invalid-protonum.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/01-connect-invalid-reserved.py /^ sock = mosq_test.do_client_connect(connect_packet, b"", port=port)$/;" v +sock test/broker/01-connect-success-v5.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/01-connect-success.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/01-connect-uname-invalid-utf8.py /^ sock = mosq_test.do_client_connect(connect_packet, b"", port=port)$/;" v +sock test/broker/01-connect-uname-no-flag.py /^ sock = mosq_test.do_client_connect(connect_packet, b"", port=port)$/;" v +sock test/broker/01-connect-uname-pwd-no-flag.py /^ sock = mosq_test.do_client_connect(connect_packet, b"", port=port)$/;" v +sock test/broker/02-subpub-qos0-retain-as-publish.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos0-send-retain.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=5, port=port)$/;" v +sock test/broker/02-subpub-qos0-subscription-id.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos0-topic-alias-unknown.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=5, port=port)$/;" v +sock test/broker/02-subpub-qos0-v5.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos0.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos1-bad-pubcomp.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos1-bad-pubrec.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos1-message-expiry-retain.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos1-message-expiry-retain.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos1-message-expiry-will.py /^ sock = mosq_test.do_client_connect(connect_packet, connack1_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos1-message-expiry-will.py /^ sock = mosq_test.do_client_connect(connect_packet, connack2_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos1-message-expiry.py /^ sock = mosq_test.do_client_connect(connect_packet, connack1_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos1-message-expiry.py /^ sock = mosq_test.do_client_connect(connect_packet, connack2_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos1-nolocal.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos1-v5.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos1.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos2-bad-puback-1.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos2-bad-puback-2.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos2-bad-pubcomp.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos2-pubrec-error-helper.py /^sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack", port=port)$/;" v +sock test/broker/02-subpub-qos2-pubrec-error.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/02-subpub-qos2-receive-maximum-1.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos2-receive-maximum-2.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos2-receive-maximum-helper.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos2-v5.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subpub-qos2.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/02-subscribe-invalid-utf8.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/02-subscribe-qos0.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/02-subscribe-qos1.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/02-subscribe-qos2.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/02-unsubscribe-invalid-no-topic.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/02-unsubscribe-qos0.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/02-unsubscribe-qos1.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/02-unsubscribe-qos2-multiple-v5.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/02-unsubscribe-qos2-multiple.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/02-unsubscribe-qos2-v5.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/02-unsubscribe-qos2.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/03-pattern-matching-helper.py /^sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack", port=port)$/;" v +sock test/broker/03-publish-b2c-disconnect-qos1-helper.py /^sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack", port=port)$/;" v +sock test/broker/03-publish-b2c-disconnect-qos1.py /^ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/broker/03-publish-b2c-disconnect-qos1.py /^ sock = mosq_test.do_client_connect(connect_packet, connack1_packet, port=port)$/;" v +sock test/broker/03-publish-b2c-disconnect-qos2-helper.py /^sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack", port=port)$/;" v +sock test/broker/03-publish-b2c-disconnect-qos2.py /^ sock = mosq_test.do_client_connect(connect_packet, connack2_packet, port=port)$/;" v +sock test/broker/03-publish-b2c-disconnect-qos2.py /^ sock = mosq_test.do_client_connect(connect_packet, connack2_packet, port=port)$/;" v +sock test/broker/03-publish-b2c-disconnect-qos2.py /^ sock = mosq_test.do_client_connect(connect_packet, connack1_packet, port=port)$/;" v +sock test/broker/03-publish-b2c-qos1-len-helper.py /^sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack", port=port)$/;" v +sock test/broker/03-publish-b2c-qos2-len-helper.py /^sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack", port=port)$/;" v +sock test/broker/03-publish-b2c-timeout-qos1-helper.py /^sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack")$/;" v +sock test/broker/03-publish-b2c-timeout-qos1.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet)$/;" v +sock test/broker/03-publish-b2c-timeout-qos2-helper.py /^sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack")$/;" v +sock test/broker/03-publish-b2c-timeout-qos2.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet)$/;" v +sock test/broker/03-publish-c2b-disconnect-qos2.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/03-publish-c2b-disconnect-qos2.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/03-publish-c2b-timeout-qos2.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet)$/;" v +sock test/broker/03-publish-dollar-v5.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/03-publish-dollar.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/03-publish-invalid-utf8.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/03-publish-qos1-no-subscribers-v5.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/03-publish-qos1.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/03-publish-qos2.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/04-retain-qos0-clear.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=4, port=port)$/;" v +sock test/broker/04-retain-qos0-fresh.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/04-retain-qos0-repeated.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/04-retain-qos0.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/04-retain-qos1-qos0.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/05-clean-session-qos1-helper.py /^sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/05-clean-session-qos1.py /^ sock = mosq_test.do_client_connect(connect_packet, connack1_packet, port=port)$/;" v +sock test/broker/05-clean-session-qos1.py /^ sock = mosq_test.do_client_connect(connect_packet, connack2_packet, timeout=30, port=port)$/;" v +sock test/broker/05-session-expiry-v5.py /^ sock = mosq_test.do_client_connect(connect_packet, connack1_packet, port=port, connack_error="connack 1")$/;" v +sock test/broker/05-session-expiry-v5.py /^ sock = mosq_test.do_client_connect(connect_packet, connack1_packet, port=port, connack_error="connack 3")$/;" v +sock test/broker/05-session-expiry-v5.py /^ sock = mosq_test.do_client_connect(connect_packet, connack1_packet, port=port, connack_error="connack 6")$/;" v +sock test/broker/05-session-expiry-v5.py /^ sock = mosq_test.do_client_connect(connect_packet, connack1_packet, port=port, connack_error="connack 7")$/;" v +sock test/broker/05-session-expiry-v5.py /^ sock = mosq_test.do_client_connect(connect_packet, connack2_packet, port=port, connack_error="connack 2")$/;" v +sock test/broker/05-session-expiry-v5.py /^ sock = mosq_test.do_client_connect(connect_packet, connack2_packet, port=port, connack_error="connack 4")$/;" v +sock test/broker/05-session-expiry-v5.py /^ sock = mosq_test.do_client_connect(connect_packet, connack2_packet, port=port, connack_error="connack 5")$/;" v +sock test/broker/06-bridge-b2br-remapping.py /^ sock = mosq_test.do_client_connect($/;" v +sock test/broker/06-bridge-br2b-disconnect-qos1-helper.py /^sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port, connack_error="helper connack")$/;" v +sock test/broker/06-bridge-br2b-disconnect-qos2-helper.py /^sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port, connack_error="helper connack")$/;" v +sock test/broker/06-bridge-br2b-remapping.py /^ sock = mosq_test.do_client_connect($/;" v +sock test/broker/06-bridge-fail-persist-resend-qos1.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/broker/06-bridge-fail-persist-resend-qos2.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/broker/06-bridge-per-listener-settings.py /^ sock = mosq_test.do_client_connect($/;" v +sock test/broker/06-bridge-reconnect-local-out-helper.py /^sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port, connack_error="helper connack")$/;" v +sock test/broker/07-will-invalid-utf8.py /^ sock = mosq_test.do_client_connect(connect_packet, b"", timeout=30, port=port)$/;" v +sock test/broker/07-will-no-flag.py /^ sock = mosq_test.do_client_connect(connect_packet, b"", port=port)$/;" v +sock test/broker/07-will-null-helper.py /^sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/07-will-null-topic.py /^ sock = mosq_test.do_client_connect(connect_packet, b"", timeout=30, port=port)$/;" v +sock test/broker/07-will-null.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=30, port=port)$/;" v +sock test/broker/08-ssl-bridge-helper.py /^sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port, connack_error="helper connack")$/;" v +sock test/broker/08-ssl-bridge.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/broker/08-ssl-connect-cert-auth-without.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/broker/08-ssl-connect-no-auth-wrong-ca.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/broker/08-tls-psk-bridge.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=30, port=port1)$/;" v +sock test/broker/08-tls-psk-pub.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port2)$/;" v +sock test/broker/09-auth-bad-method.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/09-extended-auth-unsupported.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port)$/;" v +sock test/broker/10-listener-mount-point-helper.py /^sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port, connack_error="helper connack")$/;" v +sock test/broker/12-prop-maximum-packet-size-connect.py /^ sock = mosq_test.do_client_connect(connect_packet, b"", port=port)$/;" v +sock test/broker/12-prop-maximum-packet-size-publish-qos1.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/12-prop-maximum-packet-size-publish-qos2.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/12-prop-maximum-packet-size-publish.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/broker/12-prop-session-expiry-invalid.py /^ sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port)$/;" v +sock test/lib/01-con-discon-success.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/01-keepalive-pingreq.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/01-no-clean-session.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/01-server-keepalive-pingreq.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/01-unpwd-set.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/01-will-set.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/01-will-unpwd-set.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/02-subscribe-qos0.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/02-subscribe-qos1.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/02-subscribe-qos2.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/02-unsubscribe-multiple-v5.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/02-unsubscribe-v5.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/02-unsubscribe.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/03-publish-b2c-qos1.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/03-publish-b2c-qos2.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/03-publish-c2b-qos1-disconnect.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/03-publish-c2b-qos1-receive-maximum.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/03-publish-c2b-qos1-timeout.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/03-publish-c2b-qos2-disconnect.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/03-publish-c2b-qos2-maximum-qos-0.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/03-publish-c2b-qos2-maximum-qos-1.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/03-publish-c2b-qos2-pubrec-error.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/03-publish-c2b-qos2-receive-maximum-1.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/03-publish-c2b-qos2-receive-maximum-2.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/03-publish-c2b-qos2-timeout.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/03-publish-c2b-qos2.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/03-publish-qos0-no-payload.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/03-publish-qos0.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/03-request-response-correlation.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/03-request-response.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/04-retain-qos0.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/08-ssl-connect-cert-auth-enc.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/08-ssl-connect-cert-auth.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/08-ssl-connect-no-auth.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/08-ssl-fake-cacert.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/11-prop-oversize-packet.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/11-prop-send-content-type.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock test/lib/11-prop-send-payload-format.py /^sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +sock1 test/broker/02-shared-qos0-v5.py /^ sock1 = mosq_test.do_client_connect(connect1_packet, connack1_packet, timeout=20, port=port)$/;" v +sock1 test/broker/02-subpub-qos0-topic-alias.py /^ sock1 = mosq_test.do_client_connect(connect1_packet, connack1_packet, timeout=5, port=port)$/;" v +sock1 test/broker/12-prop-response-topic-correlation-data.py /^ sock1 = mosq_test.do_client_connect(connect_packet1, connack_packet, port=port)$/;" v +sock1 test/broker/12-prop-response-topic.py /^ sock1 = mosq_test.do_client_connect(connect_packet1, connack_packet, port=port)$/;" v +sock2 test/broker/02-shared-qos0-v5.py /^ sock2 = mosq_test.do_client_connect(connect2_packet, connack2_packet, timeout=20, port=port)$/;" v +sock2 test/broker/02-subpub-qos0-topic-alias.py /^ sock2 = mosq_test.do_client_connect(connect2_packet, connack2_packet, timeout=5, port=port)$/;" v +sock2 test/broker/12-prop-response-topic-correlation-data.py /^ sock2 = mosq_test.do_client_connect(connect_packet2, connack_packet, port=port)$/;" v +sock2 test/broker/12-prop-response-topic.py /^ sock2 = mosq_test.do_client_connect(connect_packet2, connack_packet, port=port)$/;" v +sock3 test/broker/02-shared-qos0-v5.py /^ sock3 = mosq_test.do_client_connect(connect3_packet, connack3_packet, timeout=20, port=port)$/;" v +sock4 test/broker/02-shared-qos0-v5.py /^ sock4 = mosq_test.do_client_connect(connect4_packet, connack4_packet, timeout=20, port=port)$/;" v +sock5 test/broker/02-shared-qos0-v5.py /^ sock5 = mosq_test.do_client_connect(connect5_packet, connack5_packet, timeout=20, port=port)$/;" v +sock_count src/mosquitto_broker_internal.h /^ int sock_count;$/;" m struct:mosquitto__listener +socket lib/cpp/mosquittopp.cpp /^int mosquittopp::socket()$/;" f class:mosqpp::mosquittopp +socket_domain src/mosquitto_broker_internal.h /^ int socket_domain;$/;" m struct:mosquitto__listener +socket_interval src/sys_tree.c /^ double socket_interval;$/;" l +socket_load1 src/sys_tree.c /^ static double socket_load1 = 0;$/;" l file: +socket_load15 src/sys_tree.c /^ static double socket_load15 = 0;$/;" l file: +socket_load5 src/sys_tree.c /^ static double socket_load5 = 0;$/;" l file: +sockpairR lib/mosquitto_internal.h /^ mosq_sock_t sockpairR, sockpairW;$/;" m struct:mosquitto +sockpairW lib/mosquitto_internal.h /^ mosq_sock_t sockpairR, sockpairW;$/;" m struct:mosquitto +sockpair_data lib/packet_mosq.c /^ char sockpair_data = 0;$/;" l +sockpair_data lib/thread_mosq.c /^ char sockpair_data = 0;$/;" l +socks src/mosquitto_broker_internal.h /^ mosq_sock_t *socks;$/;" m struct:mosquitto__listener +socks5__read lib/socks_mosq.c /^int socks5__read(struct mosquitto *mosq)$/;" f +socks5__send lib/socks_mosq.c /^int socks5__send(struct mosquitto *mosq)$/;" f +socks5_host client/client_shared.h /^ char *socks5_host;$/;" m struct:mosq_config +socks5_host lib/mosquitto_internal.h /^ char *socks5_host;$/;" m struct:mosquitto +socks5_password client/client_shared.h /^ char *socks5_password;$/;" m struct:mosq_config +socks5_password lib/mosquitto_internal.h /^ char *socks5_password;$/;" m struct:mosquitto +socks5_port client/client_shared.h /^ int socks5_port;$/;" m struct:mosq_config +socks5_port lib/mosquitto_internal.h /^ int socks5_port;$/;" m struct:mosquitto +socks5_set lib/cpp/mosquittopp.cpp /^int mosquittopp::socks5_set(const char *host, int port, const char *username, const char *password)$/;" f class:mosqpp::mosquittopp +socks5_username client/client_shared.h /^ char *socks5_username;$/;" m struct:mosq_config +socks5_username lib/mosquitto_internal.h /^ char *socks5_username;$/;" m struct:mosquitto +source src/persist.h /^ struct mosquitto source;$/;" m struct:P_msg_store typeref:struct:P_msg_store::mosquitto +source_bytes src/database.c /^ unsigned long source_bytes;$/;" l +source_count src/database.c /^ int source_count;$/;" l +source_id src/database.c /^ char *source_id;$/;" l +source_id src/db_dump/db_dump.c /^ char *source_id;$/;" m struct:db_msg file: +source_id src/mosquitto_broker_internal.h /^ char *source_id;$/;" m struct:mosquitto_msg_store +source_id_len src/persist.h /^ uint16_t source_id_len;$/;" m struct:PF_msg_store +source_id_len src/persist_write_v5.c /^ uint16_t source_id_len = chunk->F.source_id_len;$/;" l +source_listener src/mosquitto_broker_internal.h /^ struct mosquitto__listener *source_listener;$/;" m struct:mosquitto_msg_store typeref:struct:mosquitto_msg_store::mosquitto__listener +source_mid src/db_dump/db_dump.c /^ uint16_t source_mid, mid;$/;" m struct:db_msg file: +source_mid src/mosquitto_broker_internal.h /^ uint16_t source_mid;$/;" m struct:mosquitto_msg_store +source_mid src/persist.h /^ uint16_t source_mid;$/;" m struct:PF_msg_store +source_port src/db_dump/db_dump.c /^ uint16_t source_port;$/;" m struct:db_msg file: +source_port src/persist.h /^ uint16_t source_port;$/;" m struct:PF_msg_store +source_username src/db_dump/db_dump.c /^ char *source_username;$/;" m struct:db_msg file: +source_username src/mosquitto_broker_internal.h /^ char *source_username;$/;" m struct:mosquitto_msg_store +source_username_len src/persist.h /^ uint16_t source_username_len;$/;" m struct:PF_msg_store +source_username_len src/persist_write_v5.c /^ uint16_t source_username_len = chunk->F.source_username_len;$/;" l +sp src/logging.c /^ char *sp;$/;" l +spR lib/net_mosq.c /^ mosq_sock_t spR, spW;$/;" l +spW lib/net_mosq.c /^ mosq_sock_t spR, spW;$/;" l +spare_sock src/net.c /^static mosq_sock_t spare_sock = INVALID_SOCKET;$/;" v file: +spos lib/util_topic.c /^ size_t spos;$/;" l +srv_callback lib/srv_mosq.c /^static void srv_callback(void *arg, int status, int timeouts, unsigned char *abuf, int alen)$/;" f file: +ss lib/net_mosq.c /^ struct sockaddr_storage ss;$/;" l +ss_len lib/net_mosq.c /^ socklen_t ss_len;$/;" l +ss_opt src/net.c /^ char ss_opt = 1;$/;" l +ss_opt src/net.c /^ int ss_opt = 1;$/;" l +ssize_t lib/net_mosq.h /^typedef SSIZE_T ssize_t;$/;" t +ssl lib/mosquitto_internal.h /^ SSL *ssl;$/;" m struct:mosquitto +ssl lib/tls_mosq.c /^ SSL *ssl;$/;" l +ssl_ctx lib/mosquitto_internal.h /^ SSL_CTX *ssl_ctx;$/;" m struct:mosquitto +ssl_ctx src/mosquitto_broker_internal.h /^ SSL_CTX *ssl_ctx;$/;" m struct:mosquitto__listener +ssl_ctx_defaults lib/mosquitto_internal.h /^ bool ssl_ctx_defaults;$/;" m struct:mosquitto +ssock test/broker/06-bridge-b2br-disconnect-qos1.py /^ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +ssock test/broker/06-bridge-b2br-disconnect-qos2.py /^ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +ssock test/broker/06-bridge-b2br-late-connection-retain.py /^ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +ssock test/broker/06-bridge-b2br-late-connection.py /^ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +ssock test/broker/06-bridge-b2br-remapping.py /^ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +ssock test/broker/06-bridge-br2b-disconnect-qos1.py /^ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +ssock test/broker/06-bridge-br2b-disconnect-qos2.py /^ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +ssock test/broker/06-bridge-br2b-remapping.py /^ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +ssock test/broker/06-bridge-per-listener-settings.py /^ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)$/;" v +ssock test/broker/08-ssl-bridge.py /^ssock = ssl.wrap_socket(sock, ca_certs="..\/ssl\/all-ca.crt", keyfile="..\/ssl\/server.key", certfile="..\/ssl\/server.crt", server_side=True)$/;" v +ssock test/broker/08-ssl-connect-cert-auth-without.py /^ssock = ssl.wrap_socket(sock, ca_certs="..\/ssl\/test-root-ca.crt", cert_reqs=ssl.CERT_REQUIRED)$/;" v +ssock test/broker/08-ssl-connect-no-auth-wrong-ca.py /^ssock = ssl.wrap_socket(sock, ca_certs="..\/ssl\/test-alt-ca.crt", cert_reqs=ssl.CERT_REQUIRED)$/;" v +ssock test/lib/08-ssl-connect-cert-auth-enc.py /^ssock = ssl.wrap_socket(sock, ca_certs="..\/ssl\/all-ca.crt",$/;" v +ssock test/lib/08-ssl-connect-cert-auth.py /^ssock = ssl.wrap_socket(sock, ca_certs="..\/ssl\/all-ca.crt",$/;" v +ssock test/lib/08-ssl-connect-no-auth.py /^ssock = ssl.wrap_socket(sock, ca_certs="..\/ssl\/all-ca.crt", keyfile="..\/ssl\/server.key", certfile="..\/ssl\/server.crt", server_side=True)$/;" v +ssock test/lib/08-ssl-fake-cacert.py /^ssock = ssl.wrap_socket(sock, ca_certs="..\/ssl\/all-ca.crt",$/;" v +st client/sub_client_output.c /^ SYSTEMTIME st;$/;" l +st lib/net_mosq_ocsp.c /^ X509_STORE *st = NULL;$/;" l +st src/logging.c /^ char *st;$/;" l +st src/mosquitto.c /^ SYSTEMTIME st;$/;" l +start client/client_shared.c /^ size_t start;$/;" l +start lib/mosquitto.c /^ int start, stop;$/;" l +start lib/util_mosq.c /^ int start = 0;$/;" l +start src/subs.c /^ int start, stop, tlen;$/;" l +start test/old/msgsps_pub.c /^static struct timeval start, stop;$/;" v typeref:struct:timeval file: +start test/old/msgsps_sub.c /^static struct timeval start, stop;$/;" v typeref:struct:timeval file: +start_broker test/mosq_test.py /^def start_broker(filename, cmd=None, port=0, use_conf=False, expect_fail=False):$/;" f +start_client test/mosq_test.py /^def start_client(filename, cmd, env, port=1888):$/;" f +start_time src/loop.c /^ time_t start_time = mosquitto_time();$/;" l +start_type src/mosquitto_broker_internal.h /^ enum mosquitto_bridge_start_type start_type;$/;" m struct:mosquitto__bridge typeref:enum:mosquitto__bridge::mosquitto_bridge_start_type +state lib/mosquitto_internal.h /^ enum mosquitto_client_state state;$/;" m struct:mosquitto typeref:enum:mosquitto::mosquitto_client_state +state lib/mosquitto_internal.h /^ enum mosquitto_msg_state state;$/;" m struct:mosquitto_message_all typeref:enum:mosquitto_message_all::mosquitto_msg_state +state lib/thread_mosq.c /^ int state;$/;" l +state src/database.c /^ enum mosquitto_msg_state state = mosq_ms_invalid;$/;" l +state src/db_dump/db_dump.c /^ uint8_t qos, retain, direction, state, dup;$/;" m struct:db_client_msg file: +state src/mosquitto_broker_internal.h /^ enum mosquitto_msg_state state;$/;" m struct:mosquitto_client_msg typeref:enum:mosquitto_client_msg::mosquitto_msg_state +state src/persist.h /^ uint8_t state;$/;" m struct:PF_client_msg +state_mutex lib/mosquitto_internal.h /^ pthread_mutex_t state_mutex;$/;" m struct:mosquitto +stats src/db_dump/db_dump.c /^static int stats = 0;$/;" v file: +status client/pub_shared.c /^int status = STATUS_CONNECTING;$/;" v +status client/pub_shared.h /^extern int status;$/;" x +status src/service.c /^ SERVICE_STATUS status;$/;" l +stdin_finished client/pub_client.c /^ bool stdin_finished = false;$/;" l +ste src/service.c /^ SERVICE_TABLE_ENTRY ste[] = {$/;" l +stmt examples/mysql_log/mysql_log.c /^static MYSQL_STMT *stmt = NULL;$/;" v file: +stop lib/mosquitto.c /^ int start, stop;$/;" l +stop src/subs.c /^ int start, stop, tlen;$/;" l +stop test/old/msgsps_pub.c /^static struct timeval start, stop;$/;" v typeref:struct: file: +stop test/old/msgsps_sub.c /^static struct timeval start, stop;$/;" v typeref:struct: file: +store src/database.c /^ struct mosquitto_msg_store *store, *next;$/;" l +store src/database.c /^ struct mosquitto_msg_store *store, *next;;$/;" l +store src/mosquitto_broker_internal.h /^ struct mosquitto_msg_store *store;$/;" m struct:mosquitto_client_msg typeref:struct:mosquitto_client_msg::mosquitto_msg_store +store src/mosquitto_broker_internal.h /^ struct mosquitto_msg_store *store;$/;" m struct:mosquitto_msg_store_load typeref:struct:mosquitto_msg_store_load::mosquitto_msg_store +store src/net.c /^ X509_STORE *store;$/;" l +store_bytes test/broker/03-publish-qos1-queued-bytes.py /^ def store_bytes(self, client, userdata, message):$/;" m class:BrokerMonitor +store_count test/broker/03-publish-qos1-queued-bytes.py /^ def store_count(self, client, userdata, message):$/;" m class:BrokerMonitor +store_id src/db_dump/db_dump.c /^ dbid_t i64temp, store_id;$/;" l +store_id src/db_dump/db_dump.c /^ dbid_t store_id;$/;" m struct:db_client_msg file: +store_id src/db_dump/db_dump.c /^ dbid_t store_id;$/;" m struct:db_msg file: +store_id src/db_dump/db_dump.c /^ dbid_t store_id;$/;" m struct:msg_store_chunk file: +store_id src/persist.h /^ dbid_t store_id;$/;" m struct:PF_client_msg +store_id src/persist.h /^ dbid_t store_id;$/;" m struct:PF_msg_store +store_id src/persist.h /^ dbid_t store_id;$/;" m struct:PF_retain +store_props src/database.c /^ mosquitto_property *cmsg_props = NULL, *store_props = NULL;$/;" l +stored src/database.c /^ struct mosquitto_msg_store *stored;$/;" l +stored src/handle_publish.c /^ struct mosquitto_msg_store *stored = NULL;$/;" l +stored src/persist_read.c /^ struct mosquitto_msg_store *stored = NULL;$/;" l +stored src/persist_write.c /^ struct mosquitto_msg_store *stored;$/;" l +str client/client_shared.c /^ char *str;$/;" l +str lib/memory_mosq.c /^ char *str = strdup(s);$/;" l +str lib/options.c /^ char *str;$/;" l +str1 lib/property_mosq.c /^ char *str1, *str2;$/;" l +str2 lib/property_mosq.c /^ char *str1, *str2;$/;" l +strcasecmp config.h 33;" d +strerror lib/cpp/mosquittopp.cpp /^const char* strerror(int mosq_errno)$/;" f namespace:mosqpp +strerror_r config.h 36;" d +strf client/sub_client_output.c /^ char strf[3];$/;" l +string_pair_prop_read_helper test/unit/property_read.c /^static void string_pair_prop_read_helper($/;" f file: +string_pair_prop_write_helper test/unit/property_write.c /^static void string_pair_prop_write_helper($/;" f file: +string_prop_read_helper test/unit/property_read.c /^static void string_prop_read_helper($/;" f file: +string_prop_write_helper test/unit/property_write.c /^static void string_prop_write_helper($/;" f file: +string_read_helper test/unit/datatype_read.c /^static void string_read_helper($/;" f file: +string_to_property_info_helper test/unit/property_user_read.c /^static void string_to_property_info_helper(const char *str, int rc_expected, int identifier_expected, int type_expected)$/;" f file: +strncasecmp client/client_props.c 31;" d file: +strncasecmp client/client_shared.c 32;" d file: +strtok_r config.h 35;" d +sub src/db_dump/db_dump.c /^ struct db_sub sub = {0};$/;" l +sub src/handle_subscribe.c /^ char *sub;$/;" l +sub src/handle_unsubscribe.c /^ char *sub;$/;" l +sub src/persist_write.c /^ struct mosquitto__subleaf *sub;$/;" l +sub__add src/subs.c /^int sub__add(struct mosquitto_db *db, struct mosquitto *context, const char *sub, int qos, uint32_t identifier, int options, struct mosquitto__subhier **root)$/;" f +sub__add test/unit/persist_read_stubs.c /^int sub__add(struct mosquitto_db *db, struct mosquitto *context, const char *sub, int qos, uint32_t identifier, int options, struct mosquitto__subhier **root)$/;" f +sub__add_context src/subs.c /^static int sub__add_context(struct mosquitto_db *db, struct mosquitto *context, int qos, uint32_t identifier, int options, struct mosquitto__subhier *subhier, struct sub__token *tokens, char *sharename)$/;" f file: +sub__add_hier_entry src/subs.c /^struct mosquitto__subhier *sub__add_hier_entry(struct mosquitto__subhier *parent, struct mosquitto__subhier **sibling, const char *topic, size_t len)$/;" f +sub__add_leaf src/subs.c /^static int sub__add_leaf(struct mosquitto *context, int qos, uint32_t identifier, int options, struct mosquitto__subleaf **head, struct mosquitto__subleaf **newleaf)$/;" f file: +sub__add_normal src/subs.c /^static int sub__add_normal(struct mosquitto_db *db, struct mosquitto *context, int qos, uint32_t identifier, int options, struct mosquitto__subhier *subhier)$/;" f file: +sub__add_shared src/subs.c /^static int sub__add_shared(struct mosquitto_db *db, struct mosquitto *context, int qos, uint32_t identifier, int options, struct mosquitto__subhier *subhier, char *sharename)$/;" f file: +sub__clean_session src/subs.c /^int sub__clean_session(struct mosquitto_db *db, struct mosquitto *context)$/;" f +sub__clean_session_shared src/subs.c /^static int sub__clean_session_shared(struct mosquitto_db *db, struct mosquitto *context)$/;" f file: +sub__messages_queue src/subs.c /^int sub__messages_queue(struct mosquitto_db *db, const char *source_id, const char *topic, int qos, int retain, struct mosquitto_msg_store **stored)$/;" f +sub__messages_queue test/unit/persist_read_stubs.c /^int sub__messages_queue(struct mosquitto_db *db, const char *source_id, const char *topic, int qos, int retain, struct mosquitto_msg_store **stored)$/;" f +sub__remove src/subs.c /^int sub__remove(struct mosquitto_db *db, struct mosquitto *context, const char *sub, struct mosquitto__subhier *root, uint8_t *reason)$/;" f +sub__remove_normal src/subs.c /^static int sub__remove_normal(struct mosquitto_db *db, struct mosquitto *context, struct mosquitto__subhier *subhier, uint8_t *reason)$/;" f file: +sub__remove_recurse src/subs.c /^static int sub__remove_recurse(struct mosquitto_db *db, struct mosquitto *context, struct mosquitto__subhier *subhier, struct sub__token *tokens, uint8_t *reason, char *sharename)$/;" f file: +sub__remove_shared src/subs.c /^static int sub__remove_shared(struct mosquitto_db *db, struct mosquitto *context, struct mosquitto__subhier *subhier, uint8_t *reason, char *sharename)$/;" f file: +sub__remove_shared_leaf src/subs.c /^static void sub__remove_shared_leaf(struct mosquitto__subhier *subhier, struct mosquitto__subshared *shared, struct mosquitto__subleaf *leaf)$/;" f file: +sub__retain_queue src/subs.c /^int sub__retain_queue(struct mosquitto_db *db, struct mosquitto *context, const char *sub, int sub_qos, uint32_t subscription_identifier)$/;" f +sub__search src/subs.c /^static int sub__search(struct mosquitto_db *db, struct mosquitto__subhier *subhier, struct sub__token *tokens, const char *source_id, const char *topic, int qos, int retain, struct mosquitto_msg_store *stored, bool set_retain)$/;" f file: +sub__token src/subs.c /^struct sub__token {$/;" s file: +sub__topic_append src/subs.c /^static struct sub__token *sub__topic_append(struct sub__token **tail, struct sub__token **topics, char *topic)$/;" f file: +sub__topic_tokenise src/subs.c /^static int sub__topic_tokenise(const char *subtopic, struct sub__token **topics)$/;" f file: +sub__topic_tokens_free src/subs.c /^static void sub__topic_tokens_free(struct sub__token *tokens)$/;" f file: +sub__tree_print src/subs.c /^void sub__tree_print(struct mosquitto__subhier *root, int level)$/;" f +sub_chunk src/persist_write.c /^ struct P_sub sub_chunk;$/;" l +sub_count lib/mosquitto_internal.h /^ int sub_count;$/;" m struct:mosquitto +sub_count src/db_dump/db_dump.c /^ long sub_count = 0;$/;" l +sub_mount src/handle_subscribe.c /^ char *sub_mount;$/;" l +sub_opts client/client_shared.h /^ int sub_opts; \/* sub *\/$/;" m struct:mosq_config +sub_sock test/broker/02-subscribe-persistence-flipflop.py /^ sub_sock = mosq_test.do_client_connect(connect_packet_sub_clean, connack_packet_sub, port=port)$/;" v +sub_sock test/broker/02-subscribe-persistence-flipflop.py /^ sub_sock = mosq_test.do_client_connect(connect_packet_sub_persistent, connack_packet_sub, port=port)$/;" v +sub_topic_helper test/unit/util_topic_test.c /^static void sub_topic_helper(const char *topic, int rc_expected)$/;" f file: +sub_topic_tokenise lib/cpp/mosquittopp.cpp /^int sub_topic_tokenise(const char *subtopic, char ***topics, int *count)$/;" f namespace:mosqpp +sub_topic_tokens_free lib/cpp/mosquittopp.cpp /^int sub_topic_tokens_free(char ***topics, int count)$/;" f namespace:mosqpp +suback1_packet test/broker/02-shared-qos0-v5.py /^suback1_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback1_packet test/broker/02-subhier-crash.py /^suback1_packet = mosq_test.gen_suback(mid, 0)$/;" v +suback1_packet test/broker/02-subpub-qos0-retain-as-publish.py /^suback1_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback1_packet test/broker/02-subpub-qos0-send-retain.py /^suback1_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback1_packet test/broker/02-subpub-qos0-subscription-id.py /^suback1_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback1_packet test/broker/02-subpub-qos1-message-expiry-retain.py /^suback1_packet = mosq_test.gen_suback(mid, 1, proto_ver=5)$/;" v +suback1_packet test/broker/09-acl-change.py /^suback1_packet = mosq_test.gen_suback(mid=mid, qos=1)$/;" v +suback1_packet test/broker/11-persistent-subscription-no-local.py /^suback1_packet = mosq_test.gen_suback(mid, 1, proto_ver=5)$/;" v +suback1u_packet test/broker/02-subpub-qos0-subscription-id.py /^suback1u_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback2_packet test/broker/02-shared-qos0-v5.py /^suback2_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback2_packet test/broker/02-subhier-crash.py /^suback2_packet = mosq_test.gen_suback(mid, 0)$/;" v +suback2_packet test/broker/02-subpub-qos0-retain-as-publish.py /^suback2_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback2_packet test/broker/02-subpub-qos0-send-retain.py /^suback2_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback2_packet test/broker/02-subpub-qos0-subscription-id.py /^suback2_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback2_packet test/broker/02-subpub-qos1-message-expiry-retain.py /^suback2_packet = mosq_test.gen_suback(mid, 1, proto_ver=5)$/;" v +suback2_packet test/broker/02-subpub-qos1-nolocal.py /^suback2_packet = mosq_test.gen_suback(mid, 1, proto_ver=5)$/;" v +suback2_packet test/broker/06-bridge-b2br-disconnect-qos1.py /^suback2_packet = mosq_test.gen_suback(mid, 1)$/;" v +suback2_packet test/broker/06-bridge-b2br-disconnect-qos2.py /^suback2_packet = mosq_test.gen_suback(mid, 2)$/;" v +suback2_packet test/broker/06-bridge-br2b-disconnect-qos1.py /^suback2_packet = mosq_test.gen_suback(mid, 1)$/;" v +suback2_packet test/broker/06-bridge-br2b-disconnect-qos2.py /^suback2_packet = mosq_test.gen_suback(mid, 2)$/;" v +suback2_packet test/broker/09-acl-change.py /^suback2_packet = mosq_test.gen_suback(mid=mid, qos=1)$/;" v +suback2_packet test/broker/11-persistent-subscription-no-local.py /^suback2_packet = mosq_test.gen_suback(mid, 1, proto_ver=5)$/;" v +suback2u_packet test/broker/02-subpub-qos0-subscription-id.py /^suback2u_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback3_packet test/broker/02-subpub-qos0-send-retain.py /^suback3_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback3_packet test/broker/02-subpub-qos0-subscription-id.py /^suback3_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback3_packet test/broker/06-bridge-b2br-disconnect-qos2.py /^suback3_packet = mosq_test.gen_suback(mid, 2)$/;" v +suback3_packet test/broker/06-bridge-br2b-disconnect-qos2.py /^suback3_packet = mosq_test.gen_suback(mid, 2)$/;" v +suback3a_packet test/broker/02-shared-qos0-v5.py /^suback3a_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback3b_packet test/broker/02-shared-qos0-v5.py /^suback3b_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback3u_packet test/broker/02-subpub-qos0-subscription-id.py /^suback3u_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback4_packet test/broker/02-shared-qos0-v5.py /^suback4_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback5_packet test/broker/02-shared-qos0-v5.py /^suback5_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback_packet test/broker/01-connect-uname-password-denied-no-will.py /^suback_packet = mosq_test.gen_suback(mid, 0)$/;" v +suback_packet test/broker/02-subpub-qos0-topic-alias.py /^suback_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback_packet test/broker/02-subpub-qos0-v5.py /^suback_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback_packet test/broker/02-subpub-qos0.py /^suback_packet = mosq_test.gen_suback(mid, 0)$/;" v +suback_packet test/broker/02-subpub-qos1-bad-pubcomp.py /^suback_packet = mosq_test.gen_suback(mid, 1)$/;" v +suback_packet test/broker/02-subpub-qos1-bad-pubrec.py /^suback_packet = mosq_test.gen_suback(mid, 1)$/;" v +suback_packet test/broker/02-subpub-qos1-message-expiry-will.py /^suback_packet = mosq_test.gen_suback(mid, 1, proto_ver=5)$/;" v +suback_packet test/broker/02-subpub-qos1-message-expiry.py /^suback_packet = mosq_test.gen_suback(mid, 1, proto_ver=5)$/;" v +suback_packet test/broker/02-subpub-qos1-nolocal.py /^suback_packet = mosq_test.gen_suback(mid, 1, proto_ver=5)$/;" v +suback_packet test/broker/02-subpub-qos1-v5.py /^suback_packet = mosq_test.gen_suback(mid, 1, proto_ver=5)$/;" v +suback_packet test/broker/02-subpub-qos1.py /^suback_packet = mosq_test.gen_suback(mid, 1)$/;" v +suback_packet test/broker/02-subpub-qos2-bad-puback-1.py /^suback_packet = mosq_test.gen_suback(mid, 2)$/;" v +suback_packet test/broker/02-subpub-qos2-bad-puback-2.py /^suback_packet = mosq_test.gen_suback(mid, 2)$/;" v +suback_packet test/broker/02-subpub-qos2-bad-pubcomp.py /^suback_packet = mosq_test.gen_suback(mid, 2)$/;" v +suback_packet test/broker/02-subpub-qos2-pubrec-error.py /^suback_packet = mosq_test.gen_suback(mid, 2, proto_ver=5)$/;" v +suback_packet test/broker/02-subpub-qos2-receive-maximum-1.py /^suback_packet = mosq_test.gen_suback(mid, 2, proto_ver=5)$/;" v +suback_packet test/broker/02-subpub-qos2-receive-maximum-2.py /^suback_packet = mosq_test.gen_suback(mid, 2, proto_ver=5)$/;" v +suback_packet test/broker/02-subpub-qos2-v5.py /^suback_packet = mosq_test.gen_suback(mid, 2, proto_ver=5)$/;" v +suback_packet test/broker/02-subpub-qos2.py /^suback_packet = mosq_test.gen_suback(mid, 2)$/;" v +suback_packet test/broker/02-subscribe-invalid-utf8.py /^suback_packet = mosq_test.gen_suback(mid, 0)$/;" v +suback_packet test/broker/02-subscribe-persistence-flipflop.py /^suback_packet = mosq_test.gen_suback(mid, 1)$/;" v +suback_packet test/broker/02-subscribe-qos0.py /^suback_packet = mosq_test.gen_suback(mid, 0)$/;" v +suback_packet test/broker/02-subscribe-qos1.py /^suback_packet = mosq_test.gen_suback(mid, 1)$/;" v +suback_packet test/broker/02-subscribe-qos2.py /^suback_packet = mosq_test.gen_suback(mid, 2)$/;" v +suback_packet test/broker/02-unsubscribe-qos2-multiple-v5.py /^suback_packet = mosq_test.gen_suback(mid, 2, proto_ver=5)$/;" v +suback_packet test/broker/03-publish-b2c-disconnect-qos1.py /^suback_packet = mosq_test.gen_suback(mid, 1)$/;" v +suback_packet test/broker/03-publish-b2c-disconnect-qos2.py /^suback_packet = mosq_test.gen_suback(mid, 2)$/;" v +suback_packet test/broker/03-publish-b2c-timeout-qos1.py /^suback_packet = mosq_test.gen_suback(mid, 1)$/;" v +suback_packet test/broker/03-publish-b2c-timeout-qos2.py /^suback_packet = mosq_test.gen_suback(mid, 2)$/;" v +suback_packet test/broker/03-publish-c2b-disconnect-qos2.py /^suback_packet = mosq_test.gen_suback(mid, 2)$/;" v +suback_packet test/broker/04-retain-qos0-clear.py /^suback_packet = mosq_test.gen_suback(mid_sub, 0)$/;" v +suback_packet test/broker/04-retain-qos0-fresh.py /^suback_packet = mosq_test.gen_suback(mid, 0)$/;" v +suback_packet test/broker/04-retain-qos0-repeated.py /^suback_packet = mosq_test.gen_suback(mid, 0)$/;" v +suback_packet test/broker/04-retain-qos0.py /^suback_packet = mosq_test.gen_suback(mid, 0)$/;" v +suback_packet test/broker/04-retain-qos1-qos0.py /^suback_packet = mosq_test.gen_suback(mid, 0)$/;" v +suback_packet test/broker/04-retain-upgrade-outgoing-qos.py /^suback_packet = mosq_test.gen_suback(mid, 1)$/;" v +suback_packet test/broker/05-clean-session-qos1.py /^suback_packet = mosq_test.gen_suback(mid, 1)$/;" v +suback_packet test/broker/06-bridge-b2br-disconnect-qos1.py /^suback_packet = mosq_test.gen_suback(mid, 1)$/;" v +suback_packet test/broker/06-bridge-b2br-disconnect-qos2.py /^suback_packet = mosq_test.gen_suback(mid, 2)$/;" v +suback_packet test/broker/06-bridge-br2b-disconnect-qos1.py /^suback_packet = mosq_test.gen_suback(mid, 1)$/;" v +suback_packet test/broker/06-bridge-br2b-disconnect-qos2.py /^suback_packet = mosq_test.gen_suback(mid, 2)$/;" v +suback_packet test/broker/06-bridge-reconnect-local-out.py /^suback_packet = mosq_test.gen_suback(mid, 0)$/;" v +suback_packet test/broker/07-will-null.py /^suback_packet = mosq_test.gen_suback(mid, 0)$/;" v +suback_packet test/broker/08-ssl-bridge.py /^suback_packet = mosq_test.gen_suback(mid, 0)$/;" v +suback_packet test/broker/08-tls-psk-bridge.py /^suback_packet = mosq_test.gen_suback(mid, 0)$/;" v +suback_packet test/broker/08-tls-psk-pub.py /^suback_packet = mosq_test.gen_suback(mid, 0)$/;" v +suback_packet test/broker/09-plugin-auth-acl-pub.py /^suback_packet = mosq_test.gen_suback(mid, 2)$/;" v +suback_packet test/broker/09-plugin-auth-acl-sub-denied.py /^suback_packet = mosq_test.gen_suback(mid, 128)$/;" v +suback_packet test/broker/09-plugin-auth-acl-sub.py /^suback_packet = mosq_test.gen_suback(mid, 0)$/;" v +suback_packet test/broker/09-plugin-auth-context-params.py /^suback_packet = mosq_test.gen_suback(mid, 1)$/;" v +suback_packet test/broker/09-plugin-auth-msg-params.py /^suback_packet = mosq_test.gen_suback(mid, 1)$/;" v +suback_packet test/broker/10-listener-mount-point.py /^suback_packet = mosq_test.gen_suback(mid, 0)$/;" v +suback_packet test/broker/11-message-expiry.py /^suback_packet = mosq_test.gen_suback(mid, 1, proto_ver=5)$/;" v +suback_packet test/broker/11-persistent-subscription-v5.py /^suback_packet = mosq_test.gen_suback(mid, 1, proto_ver=5)$/;" v +suback_packet test/broker/11-persistent-subscription.py /^suback_packet = mosq_test.gen_suback(mid, 1)$/;" v +suback_packet test/broker/11-pub-props.py /^suback_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback_packet test/broker/11-subscription-id.py /^suback_packet = mosq_test.gen_suback(mid, 1, proto_ver=5)$/;" v +suback_packet test/broker/12-prop-maximum-packet-size-publish-qos1.py /^suback_packet = mosq_test.gen_suback(mid, 1, proto_ver=5)$/;" v +suback_packet test/broker/12-prop-maximum-packet-size-publish-qos2.py /^suback_packet = mosq_test.gen_suback(mid, 2, proto_ver=5)$/;" v +suback_packet test/broker/12-prop-maximum-packet-size-publish.py /^suback_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback_packet test/broker/12-prop-response-topic-correlation-data.py /^suback_packet = mosq_test.gen_suback(mid=1, qos=0, proto_ver=5)$/;" v +suback_packet test/broker/12-prop-response-topic.py /^suback_packet = mosq_test.gen_suback(mid=1, qos=0, proto_ver=5)$/;" v +suback_packet test/lib/02-subscribe-qos0.py /^suback_packet = mosq_test.gen_suback(mid, 0)$/;" v +suback_packet test/lib/02-subscribe-qos1.py /^suback_packet = mosq_test.gen_suback(mid, 1)$/;" v +suback_packet test/lib/02-subscribe-qos2.py /^suback_packet = mosq_test.gen_suback(mid, 2)$/;" v +suback_packet test/lib/02-unsubscribe-multiple-v5.py /^suback_packet = mosq_test.gen_suback(mid, 2, proto_ver=5)$/;" v +suback_packet test/lib/03-request-response-correlation.py /^suback_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback_packet test/lib/03-request-response.py /^suback_packet = mosq_test.gen_suback(mid, 0, proto_ver=5)$/;" v +suback_packet_fail test/broker/09-plugin-auth-acl-sub.py /^suback_packet_fail = mosq_test.gen_suback(mid_fail, 0x80)$/;" v +subhier src/database.c /^ struct mosquitto__subhier *subhier;$/;" l +subhier src/persist_write.c /^ struct mosquitto__subhier *subhier, *subhier_tmp;$/;" l +subhier src/subs.c /^ struct mosquitto__subhier *subhier;$/;" l +subhier_clean src/database.c /^static void subhier_clean(struct mosquitto_db *db, struct mosquitto__subhier **subhier)$/;" f file: +subhier_tmp src/database.c /^ struct mosquitto__subhier *peer, *subhier_tmp;$/;" l +subhier_tmp src/persist_write.c /^ struct mosquitto__subhier *subhier, *subhier_tmp;$/;" l +subj lib/tls_mosq.c /^ X509_NAME *subj;$/;" l +subject src/handle_connect.c /^ char *subject = mosquitto__malloc(sizeof(char)*name_length+1);$/;" l +subject_bio src/handle_connect.c /^ BIO *subject_bio = BIO_new(BIO_s_mem());$/;" l +subs lib/mosquitto_internal.h /^ struct mosquitto__subhier **subs;$/;" m struct:mosquitto typeref:struct:mosquitto::mosquitto__subhier +subs src/mosquitto_broker_internal.h /^ struct mosquitto__subhier *subs;$/;" m struct:mosquitto_db typeref:struct:mosquitto_db::mosquitto__subhier +subs src/mosquitto_broker_internal.h /^ struct mosquitto__subleaf *subs;$/;" m struct:mosquitto__subhier typeref:struct:mosquitto__subhier::mosquitto__subleaf +subs src/mosquitto_broker_internal.h /^ struct mosquitto__subleaf *subs;$/;" m struct:mosquitto__subshared typeref:struct:mosquitto__subshared::mosquitto__subleaf +subs src/subs.c /^ struct mosquitto__subhier **subs;$/;" l +subs__process src/subs.c /^static int subs__process(struct mosquitto_db *db, struct mosquitto__subhier *hier, const char *source_id, const char *topic, int qos, int retain, struct mosquitto_msg_store *stored, bool set_retain)$/;" f file: +subs__send src/subs.c /^static int subs__send(struct mosquitto_db *db, struct mosquitto__subleaf *leaf, const char *topic, int qos, int retain, struct mosquitto_msg_store *stored)$/;" f file: +subs__shared_process src/subs.c /^static int subs__shared_process(struct mosquitto_db *db, struct mosquitto__subhier *hier, const char *topic, int qos, int retain, struct mosquitto_msg_store *stored)$/;" f file: +subscribe lib/cpp/mosquittopp.cpp /^int mosquittopp::subscribe(int *mid, const char *sub, int qos)$/;" f class:mosqpp::mosquittopp +subscribe1_packet test/broker/02-shared-qos0-v5.py /^subscribe1_packet = mosq_test.gen_subscribe(mid, "#", 0, proto_ver=5)$/;" v +subscribe1_packet test/broker/02-subhier-crash.py /^subscribe1_packet = mosq_test.gen_subscribe(mid, "topic\/a", 0)$/;" v +subscribe1_packet test/broker/02-subpub-qos0-retain-as-publish.py /^subscribe1_packet = mosq_test.gen_subscribe(mid, "subpub\/normal", 0, proto_ver=5)$/;" v +subscribe1_packet test/broker/02-subpub-qos0-send-retain.py /^subscribe1_packet = mosq_test.gen_subscribe(mid, "subpub\/always", 0 | mqtt5_opts.MQTT_SUB_OPT_SEND_RETAIN_ALWAYS, proto_ver=5)$/;" v +subscribe1_packet test/broker/02-subpub-qos0-subscription-id.py /^subscribe1_packet = mosq_test.gen_subscribe(mid, "subpub\/id1", 0, proto_ver=5, properties=props)$/;" v +subscribe1_packet test/broker/02-subpub-qos1-message-expiry-retain.py /^subscribe1_packet = mosq_test.gen_subscribe(mid, "subpub\/expired", 1, proto_ver=5)$/;" v +subscribe1_packet test/broker/09-acl-change.py /^subscribe1_packet = mosq_test.gen_subscribe(mid=mid, topic="topic\/one", qos=1)$/;" v +subscribe1_packet test/broker/11-persistent-subscription-no-local.py /^subscribe1_packet = mosq_test.gen_subscribe(mid, "subpub\/nolocal", 5, proto_ver=5)$/;" v +subscribe1_packet test/lib/03-request-response-correlation.py /^subscribe1_packet = mosq_test.gen_subscribe(mid, resp_topic, 0, proto_ver=5)$/;" v +subscribe1_packet test/lib/03-request-response.py /^subscribe1_packet = mosq_test.gen_subscribe(mid, resp_topic, 0, proto_ver=5)$/;" v +subscribe1u_packet test/broker/02-subpub-qos0-subscription-id.py /^subscribe1u_packet = mosq_test.gen_subscribe(mid, "subpub\/id1", 0, proto_ver=5)$/;" v +subscribe2_packet test/broker/02-shared-qos0-v5.py /^subscribe2_packet = mosq_test.gen_subscribe(mid, "$share\/one\/share-test", 0, proto_ver=5)$/;" v +subscribe2_packet test/broker/02-subhier-crash.py /^subscribe2_packet = mosq_test.gen_subscribe(mid, "topic\/b", 0)$/;" v +subscribe2_packet test/broker/02-subpub-qos0-retain-as-publish.py /^subscribe2_packet = mosq_test.gen_subscribe(mid, "subpub\/rap", 0 | mqtt5_opts.MQTT_SUB_OPT_RETAIN_AS_PUBLISHED, proto_ver=5)$/;" v +subscribe2_packet test/broker/02-subpub-qos0-send-retain.py /^subscribe2_packet = mosq_test.gen_subscribe(mid, "subpub\/new", 0 | mqtt5_opts.MQTT_SUB_OPT_SEND_RETAIN_NEW, proto_ver=5)$/;" v +subscribe2_packet test/broker/02-subpub-qos0-subscription-id.py /^subscribe2_packet = mosq_test.gen_subscribe(mid, "subpub\/+\/id2", 0, proto_ver=5, properties=props)$/;" v +subscribe2_packet test/broker/02-subpub-qos1-message-expiry-retain.py /^subscribe2_packet = mosq_test.gen_subscribe(mid, "subpub\/kept", 1, proto_ver=5)$/;" v +subscribe2_packet test/broker/02-subpub-qos1-nolocal.py /^subscribe2_packet = mosq_test.gen_subscribe(mid, "subpub\/receive", 1, proto_ver=5)$/;" v +subscribe2_packet test/broker/06-bridge-b2br-disconnect-qos1.py /^subscribe2_packet = mosq_test.gen_subscribe(mid, "bridge\/#", 1)$/;" v +subscribe2_packet test/broker/06-bridge-b2br-disconnect-qos2.py /^subscribe2_packet = mosq_test.gen_subscribe(mid, "bridge\/#", 2)$/;" v +subscribe2_packet test/broker/06-bridge-br2b-disconnect-qos1.py /^subscribe2_packet = mosq_test.gen_subscribe(mid, "bridge\/#", 1)$/;" v +subscribe2_packet test/broker/06-bridge-br2b-disconnect-qos2.py /^subscribe2_packet = mosq_test.gen_subscribe(mid, "bridge\/#", 2)$/;" v +subscribe2_packet test/broker/09-acl-change.py /^subscribe2_packet = mosq_test.gen_subscribe(mid=mid, topic="topic\/two", qos=1)$/;" v +subscribe2_packet test/broker/11-persistent-subscription-no-local.py /^subscribe2_packet = mosq_test.gen_subscribe(mid, "subpub\/local", 1, proto_ver=5)$/;" v +subscribe2_packet test/lib/03-request-response-correlation.py /^subscribe2_packet = mosq_test.gen_subscribe(mid, pub_topic, 0, proto_ver=5)$/;" v +subscribe2_packet test/lib/03-request-response.py /^subscribe2_packet = mosq_test.gen_subscribe(mid, pub_topic, 0, proto_ver=5)$/;" v +subscribe2u_packet test/broker/02-subpub-qos0-subscription-id.py /^subscribe2u_packet = mosq_test.gen_subscribe(mid, "subpub\/+\/id2", 0, proto_ver=5, properties=props)$/;" v +subscribe3_packet test/broker/02-subpub-qos0-send-retain.py /^subscribe3_packet = mosq_test.gen_subscribe(mid, "subpub\/never", 0 | mqtt5_opts.MQTT_SUB_OPT_SEND_RETAIN_NEVER, proto_ver=5)$/;" v +subscribe3_packet test/broker/02-subpub-qos0-subscription-id.py /^subscribe3_packet = mosq_test.gen_subscribe(mid, "subpub\/noid", 0, proto_ver=5)$/;" v +subscribe3_packet test/broker/06-bridge-b2br-disconnect-qos2.py /^subscribe3_packet = mosq_test.gen_subscribe(mid, "bridge\/#", 2)$/;" v +subscribe3_packet test/broker/06-bridge-br2b-disconnect-qos2.py /^subscribe3_packet = mosq_test.gen_subscribe(mid, "bridge\/#", 2)$/;" v +subscribe3a_packet test/broker/02-shared-qos0-v5.py /^subscribe3a_packet = mosq_test.gen_subscribe(mid, "$share\/one\/share-test", 0, proto_ver=5)$/;" v +subscribe3b_packet test/broker/02-shared-qos0-v5.py /^subscribe3b_packet = mosq_test.gen_subscribe(mid, "$share\/two\/share-test", 0, proto_ver=5)$/;" v +subscribe3u_packet test/broker/02-subpub-qos0-subscription-id.py /^subscribe3u_packet = mosq_test.gen_subscribe(mid, "subpub\/noid", 0, proto_ver=5, properties=props)$/;" v +subscribe4_packet test/broker/02-shared-qos0-v5.py /^subscribe4_packet = mosq_test.gen_subscribe(mid, "$share\/two\/share-test", 0, proto_ver=5)$/;" v +subscribe5_packet test/broker/02-shared-qos0-v5.py /^subscribe5_packet = mosq_test.gen_subscribe(mid, "$share\/one\/share-test", 0, proto_ver=5)$/;" v +subscribe_callback lib/cpp/mosquittopp.cpp /^mosqpp_EXPORT int subscribe_callback($/;" f namespace:mosqpp +subscribe_packet test/broker/01-connect-uname-password-denied-no-will.py /^subscribe_packet = mosq_test.gen_subscribe(mid, topic="will\/test", qos=0)$/;" v +subscribe_packet test/broker/02-subpub-qos0-topic-alias.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/alias", 0, proto_ver=5)$/;" v +subscribe_packet test/broker/02-subpub-qos0-v5.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos0", 0, proto_ver=5)$/;" v +subscribe_packet test/broker/02-subpub-qos0.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos0", 0)$/;" v +subscribe_packet test/broker/02-subpub-qos1-bad-pubcomp.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos1", 1)$/;" v +subscribe_packet test/broker/02-subpub-qos1-bad-pubrec.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos1", 1)$/;" v +subscribe_packet test/broker/02-subpub-qos1-message-expiry-will.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos1", 1, proto_ver=5)$/;" v +subscribe_packet test/broker/02-subpub-qos1-message-expiry.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos1", 1, proto_ver=5)$/;" v +subscribe_packet test/broker/02-subpub-qos1-nolocal.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos1", 1 | mqtt5_opts.MQTT_SUB_OPT_NO_LOCAL, proto_ver=5)$/;" v +subscribe_packet test/broker/02-subpub-qos1-v5.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos1", 1, proto_ver=5)$/;" v +subscribe_packet test/broker/02-subpub-qos1.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos1", 1)$/;" v +subscribe_packet test/broker/02-subpub-qos2-bad-puback-1.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos2", 2)$/;" v +subscribe_packet test/broker/02-subpub-qos2-bad-puback-2.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos2", 2)$/;" v +subscribe_packet test/broker/02-subpub-qos2-bad-pubcomp.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos2", 2)$/;" v +subscribe_packet test/broker/02-subpub-qos2-pubrec-error.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "qos2\/pubrec\/+", 2, proto_ver=5)$/;" v +subscribe_packet test/broker/02-subpub-qos2-receive-maximum-1.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos2", 2, proto_ver=5)$/;" v +subscribe_packet test/broker/02-subpub-qos2-receive-maximum-2.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos2", 2, proto_ver=5)$/;" v +subscribe_packet test/broker/02-subpub-qos2-v5.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos2", 2, proto_ver=5)$/;" v +subscribe_packet test/broker/02-subpub-qos2.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos2", 2)$/;" v +subscribe_packet test/broker/02-subscribe-invalid-utf8.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "invalid\/utf8", 0)$/;" v +subscribe_packet test/broker/02-subscribe-invalid-utf8.py /^subscribe_packet = struct.pack("B"*len(b), *b)$/;" v +subscribe_packet test/broker/02-subscribe-persistence-flipflop.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "flipflop\/test", 1)$/;" v +subscribe_packet test/broker/02-subscribe-qos0.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "qos0\/test", 0)$/;" v +subscribe_packet test/broker/02-subscribe-qos1.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "qos1\/test", 1)$/;" v +subscribe_packet test/broker/02-subscribe-qos2.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "qos2\/test", 2)$/;" v +subscribe_packet test/broker/02-unsubscribe-qos2-multiple-v5.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "qos2\/two", 2, proto_ver=5)$/;" v +subscribe_packet test/broker/03-publish-b2c-disconnect-qos1.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "qos1\/disconnect\/test", 1)$/;" v +subscribe_packet test/broker/03-publish-b2c-disconnect-qos2.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "qos2\/disconnect\/test", 2)$/;" v +subscribe_packet test/broker/03-publish-b2c-timeout-qos1.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "qos1\/timeout\/test", 1)$/;" v +subscribe_packet test/broker/03-publish-b2c-timeout-qos2.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "qos2\/timeout\/test", 2)$/;" v +subscribe_packet test/broker/03-publish-c2b-disconnect-qos2.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "qos2\/disconnect\/test", 2)$/;" v +subscribe_packet test/broker/04-retain-qos0-clear.py /^subscribe_packet = mosq_test.gen_subscribe(mid_sub, "retain\/clear\/test", 0)$/;" v +subscribe_packet test/broker/04-retain-qos0-fresh.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "retain\/qos0\/test", 0)$/;" v +subscribe_packet test/broker/04-retain-qos0-repeated.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "retain\/qos0\/test", 0)$/;" v +subscribe_packet test/broker/04-retain-qos0.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "retain\/qos0\/test", 0)$/;" v +subscribe_packet test/broker/04-retain-qos1-qos0.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "retain\/qos1\/test", 0)$/;" v +subscribe_packet test/broker/04-retain-upgrade-outgoing-qos.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "retain\/qos0\/test", 1)$/;" v +subscribe_packet test/broker/05-clean-session-qos1.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "qos1\/clean_session\/test", 1)$/;" v +subscribe_packet test/broker/06-bridge-b2br-disconnect-qos1.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "bridge\/#", 1)$/;" v +subscribe_packet test/broker/06-bridge-b2br-disconnect-qos2.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "bridge\/#", 2)$/;" v +subscribe_packet test/broker/06-bridge-br2b-disconnect-qos1.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "bridge\/#", 1)$/;" v +subscribe_packet test/broker/06-bridge-br2b-disconnect-qos2.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "bridge\/#", 2)$/;" v +subscribe_packet test/broker/06-bridge-reconnect-local-out.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "bridge\/#", 0)$/;" v +subscribe_packet test/broker/07-will-null.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "will\/null\/test", 0)$/;" v +subscribe_packet test/broker/08-ssl-bridge.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "bridge\/#", 0)$/;" v +subscribe_packet test/broker/08-tls-psk-bridge.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "psk\/test", 0)$/;" v +subscribe_packet test/broker/08-tls-psk-pub.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "psk\/test", 0)$/;" v +subscribe_packet test/broker/09-plugin-auth-acl-pub.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "readonly", 2)$/;" v +subscribe_packet test/broker/09-plugin-auth-acl-sub-denied.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "qos0\/test", 0)$/;" v +subscribe_packet test/broker/09-plugin-auth-acl-sub.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "qos0\/test", 0)$/;" v +subscribe_packet test/broker/09-plugin-auth-context-params.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "param\/topic", 1)$/;" v +subscribe_packet test/broker/09-plugin-auth-msg-params.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "param\/topic", 1)$/;" v +subscribe_packet test/broker/10-listener-mount-point.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "#", 0)$/;" v +subscribe_packet test/broker/11-message-expiry.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos1", 1, proto_ver=5)$/;" v +subscribe_packet test/broker/11-persistent-subscription-v5.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos1", 1, proto_ver=5)$/;" v +subscribe_packet test/broker/11-persistent-subscription.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos1", 1)$/;" v +subscribe_packet test/broker/11-pub-props.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos1", 0, proto_ver=5)$/;" v +subscribe_packet test/broker/11-subscription-id.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "subpub\/qos1", 1, proto_ver=5, properties=props)$/;" v +subscribe_packet test/broker/12-prop-maximum-packet-size-publish-qos1.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "test\/topic", 1, proto_ver=5)$/;" v +subscribe_packet test/broker/12-prop-maximum-packet-size-publish-qos2.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "test\/topic", 2, proto_ver=5)$/;" v +subscribe_packet test/broker/12-prop-maximum-packet-size-publish.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "test\/topic", 0, proto_ver=5)$/;" v +subscribe_packet test/lib/02-subscribe-qos0.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "qos0\/test", 0)$/;" v +subscribe_packet test/lib/02-subscribe-qos1.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "qos1\/test", 1)$/;" v +subscribe_packet test/lib/02-subscribe-qos2.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "qos2\/test", 2)$/;" v +subscribe_packet test/lib/02-unsubscribe-multiple-v5.py /^subscribe_packet = mosq_test.gen_subscribe(mid, "unsubscribe\/test", 2, proto_ver=5)$/;" v +subscribe_packet1 test/broker/12-prop-response-topic-correlation-data.py /^subscribe_packet1 = mosq_test.gen_subscribe(mid=1, topic="normal\/topic", qos=0, proto_ver=5)$/;" v +subscribe_packet1 test/broker/12-prop-response-topic.py /^subscribe_packet1 = mosq_test.gen_subscribe(mid=1, topic="normal\/topic", qos=0, proto_ver=5)$/;" v +subscribe_packet2 test/broker/12-prop-response-topic-correlation-data.py /^subscribe_packet2 = mosq_test.gen_subscribe(mid=1, topic="response\/topic", qos=0, proto_ver=5)$/;" v +subscribe_packet2 test/broker/12-prop-response-topic.py /^subscribe_packet2 = mosq_test.gen_subscribe(mid=1, topic="response\/topic", qos=0, proto_ver=5)$/;" v +subscribe_packet_fail test/broker/09-plugin-auth-acl-sub.py /^subscribe_packet_fail = mosq_test.gen_subscribe(mid_fail, "#", 0)$/;" v +subscribe_props client/client_shared.h /^ mosquitto_property *subscribe_props;$/;" m struct:mosq_config +subscribe_qos test/random/random_client.py /^subscribe_qos = random.choice(qos_values)$/;" v +subscribe_simple lib/cpp/mosquittopp.cpp /^int subscribe_simple($/;" f namespace:mosqpp +subscription_count src/mosquitto_broker_internal.h /^ int subscription_count;$/;" m struct:mosquitto_db +subscription_count src/sys_tree.c /^ static int subscription_count = -1;$/;" l file: +subscription_identifier src/handle_subscribe.c /^ uint32_t subscription_identifier = 0;$/;" l +subscription_options src/handle_subscribe.c /^ uint8_t subscription_options;$/;" l +subscription_size src/db_dump/db_dump.c /^ int subscription_size;$/;" m struct:client_chunk file: +subscriptions src/db_dump/db_dump.c /^ int subscriptions;$/;" m struct:client_chunk file: +svc_desc src/service.c /^ SERVICE_DESCRIPTION svc_desc;$/;" l +svc_handle src/service.c /^ SC_HANDLE sc_manager, svc_handle;$/;" l +sys_interval src/mosquitto_broker_internal.h /^ int sys_interval;$/;" m struct:mosquitto__config +sys_tree__init src/sys_tree.c /^void sys_tree__init(struct mosquitto_db *db)$/;" f +sys_tree__update src/sys_tree.c /^void sys_tree__update(struct mosquitto_db *db, int interval, time_t start_time)$/;" f +sys_tree__update_clients src/sys_tree.c /^static void sys_tree__update_clients(struct mosquitto_db *db, char *buf)$/;" f file: +sys_tree__update_memory src/sys_tree.c /^static void sys_tree__update_memory(struct mosquitto_db *db, char *buf)$/;" f file: +syslog_h src/logging.c /^HANDLE syslog_h;$/;" v +syslog_priority src/logging.c /^ int syslog_priority;$/;" l +t src/subs.c /^ struct sub__token *tokens = NULL, *t;$/;" l +tail lib/messages_mosq.c /^ struct mosquitto_message_all *tail, *tmp;$/;" l +tail lib/property_mosq.c /^ const mosquitto_property *p, *tail;$/;" l +tail lib/property_mosq.c /^ mosquitto_property *p, *tail = NULL;$/;" l +tail src/database.c /^ struct mosquitto_client_msg *tail, *tmp;$/;" l +tail src/database.c /^ struct mosquitto_client_msg *tail;$/;" l +tail src/deps/uthash.h /^ struct UT_hash_handle *tail; \/* tail hh in app order, for fast append *\/$/;" m struct:UT_hash_table typeref:struct:UT_hash_table::UT_hash_handle +tail src/subs.c /^ struct sub__token *new_topic, *tail = NULL;$/;" l +tail src/subs.c /^ struct sub__token *tail;$/;" l +tail src/subs.c /^ struct sub__token *tokens = NULL, *tail;$/;" l +tbl src/deps/uthash.h /^ struct UT_hash_table *tbl;$/;" m struct:UT_hash_handle typeref:struct:UT_hash_handle::UT_hash_table +temp src/database.c /^ struct mosquitto_msg_store *temp = NULL;$/;" l +temp src/persist_read_v234.c /^ time_t temp;$/;" l +temp test/unit/persist_read_stubs.c /^ struct mosquitto_msg_store *temp = NULL;$/;" l +temp__expire_websockets_clients src/loop.c /^static void temp__expire_websockets_clients(struct mosquitto_db *db)$/;" f file: +temp_celsius examples/temperature_conversion/temperature_conversion.cpp /^ double temp_celsius, temp_farenheit;$/;" l +temp_farenheit examples/temperature_conversion/temperature_conversion.cpp /^ double temp_celsius, temp_farenheit;$/;" l +tempconv examples/temperature_conversion/main.cpp /^ class mqtt_tempconv *tempconv;$/;" l +test test/broker/02-subhier-crash.py /^def test():$/;" f +test test/broker/06-bridge-b2br-remapping.py /^def test(bridge, sock):$/;" f +test test/broker/06-bridge-br2b-remapping.py /^def test(bridge, sock):$/;" f +test test/broker/06-bridge-per-listener-settings.py /^def test(bridge, sock):$/;" f +test_cleanup test/mosq_test.py /^def test_cleanup():$/;" f +test_suite test/unit/datatype_read.c /^ CU_pSuite test_suite = NULL;$/;" l +test_suite test/unit/datatype_write.c /^ CU_pSuite test_suite = NULL;$/;" l +test_suite test/unit/persist_read_test.c /^ CU_pSuite test_suite = NULL;$/;" l +test_suite test/unit/persist_write_test.c /^ CU_pSuite test_suite = NULL;$/;" l +test_suite test/unit/property_add.c /^ CU_pSuite test_suite = NULL;$/;" l +test_suite test/unit/property_read.c /^ CU_pSuite test_suite = NULL;$/;" l +test_suite test/unit/property_user_read.c /^ CU_pSuite test_suite = NULL;$/;" l +test_suite test/unit/property_write.c /^ CU_pSuite test_suite = NULL;$/;" l +test_suite test/unit/publish_test.c /^ CU_pSuite test_suite = NULL;$/;" l +test_suite test/unit/utf8.c /^ CU_pSuite test_suite = NULL;$/;" l +test_suite test/unit/util_topic_test.c /^ CU_pSuite test_suite = NULL;$/;" l +tests test/broker/test.py /^tests = [$/;" v +tests test/lib/test.py /^tests = [$/;" v +thistopic src/persist_write.c /^ char *thistopic;$/;" l +thisupd lib/net_mosq_ocsp.c /^ ASN1_GENERALIZEDTIME *rev, *thisupd, *nextupd;$/;" l +thread_id lib/mosquitto_internal.h /^ pthread_t thread_id;$/;" m struct:mosquitto +threaded lib/mosquitto_internal.h /^ char threaded;$/;" m struct:mosquitto +threaded_set lib/cpp/mosquittopp.cpp /^int mosquittopp::threaded_set(bool threaded)$/;" f class:mosqpp::mosquittopp +threshold src/mosquitto_broker_internal.h /^ int threshold;$/;" m struct:mosquitto__bridge +ti client/sub_client_output.c /^ struct tm *ti = NULL;$/;" l +ti src/logging.c /^ struct tm *ti = NULL;$/;" l +ticks client/pub_client.c /^ uint64_t ticks = GetTickCount64();$/;" l +time_buf src/logging.c /^ char time_buf[50];$/;" l +time_count src/loop.c /^ int time_count;$/;" l +timeout client/client_shared.h /^ int timeout; \/* sub *\/$/;" m struct:mosq_config +timestamp lib/mosquitto_internal.h /^ time_t timestamp;$/;" m struct:mosquitto_message_all +timestamp src/mosquitto_broker_internal.h /^ time_t timestamp;$/;" m struct:mosquitto_client_msg +tlen lib/actions.c /^ int tlen = 0;$/;" l +tlen lib/mosquitto.c /^ int tlen;$/;" l +tlen src/security_default.c /^ int len, tlen, clen, ulen;$/;" l +tlen src/subs.c /^ int start, stop, tlen;$/;" l +tls_alpn client/client_shared.h /^ char *tls_alpn;$/;" m struct:mosq_config +tls_alpn lib/mosquitto_internal.h /^ char *tls_alpn;$/;" m struct:mosquitto +tls_alpn src/mosquitto_broker_internal.h /^ char *tls_alpn;$/;" m struct:mosquitto__bridge +tls_alpn_len lib/net_mosq.c /^ uint8_t tls_alpn_len;$/;" l +tls_alpn_wire lib/net_mosq.c /^ uint8_t tls_alpn_wire[256];$/;" l +tls_cafile lib/mosquitto_internal.h /^ char *tls_cafile;$/;" m struct:mosquitto +tls_cafile src/mosquitto_broker_internal.h /^ char *tls_cafile;$/;" m struct:mosquitto__bridge +tls_capath lib/mosquitto_internal.h /^ char *tls_capath;$/;" m struct:mosquitto +tls_capath src/mosquitto_broker_internal.h /^ char *tls_capath;$/;" m struct:mosquitto__bridge +tls_cert_reqs lib/mosquitto_internal.h /^ int tls_cert_reqs;$/;" m struct:mosquitto +tls_certfile lib/mosquitto_internal.h /^ char *tls_certfile;$/;" m struct:mosquitto +tls_certfile src/mosquitto_broker_internal.h /^ char *tls_certfile;$/;" m struct:mosquitto__bridge +tls_ciphers lib/mosquitto_internal.h /^ char *tls_ciphers;$/;" m struct:mosquitto +tls_engine client/client_shared.h /^ char *tls_engine;$/;" m struct:mosq_config +tls_engine lib/mosquitto_internal.h /^ char *tls_engine;$/;" m struct:mosquitto +tls_engine src/mosquitto_broker_internal.h /^ char *tls_engine;$/;" m struct:mosquitto__listener +tls_engine_kpass_sha1 client/client_shared.h /^ char *tls_engine_kpass_sha1;$/;" m struct:mosq_config +tls_engine_kpass_sha1 lib/mosquitto_internal.h /^ char *tls_engine_kpass_sha1;$/;" m struct:mosquitto +tls_engine_kpass_sha1 src/mosquitto_broker_internal.h /^ char *tls_engine_kpass_sha1;$/;" m struct:mosquitto__listener +tls_ex_index_context src/net.c /^static int tls_ex_index_context = -1;$/;" v file: +tls_ex_index_listener src/net.c /^static int tls_ex_index_listener = -1;$/;" v file: +tls_ex_index_mosq lib/net_mosq.c /^int tls_ex_index_mosq = -1;$/;" v +tls_ex_index_mosq lib/tls_mosq.c /^extern int tls_ex_index_mosq;$/;" x +tls_insecure lib/mosquitto_internal.h /^ bool tls_insecure;$/;" m struct:mosquitto +tls_insecure src/mosquitto_broker_internal.h /^ bool tls_insecure;$/;" m struct:mosquitto__bridge +tls_insecure_set lib/cpp/mosquittopp.cpp /^int mosquittopp::tls_insecure_set(bool value)$/;" f class:mosqpp::mosquittopp +tls_keyfile lib/mosquitto_internal.h /^ char *tls_keyfile;$/;" m struct:mosquitto +tls_keyfile src/mosquitto_broker_internal.h /^ char *tls_keyfile;$/;" m struct:mosquitto__bridge +tls_keyform lib/mosquitto_internal.h /^ enum mosquitto__keyform tls_keyform;$/;" m struct:mosquitto typeref:enum:mosquitto::mosquitto__keyform +tls_keyform src/mosquitto_broker_internal.h /^ enum mosquitto__keyform tls_keyform;$/;" m struct:mosquitto__listener typeref:enum:mosquitto__listener::mosquitto__keyform +tls_ocsp_required lib/mosquitto_internal.h /^ bool tls_ocsp_required;$/;" m struct:mosquitto +tls_ocsp_required src/mosquitto_broker_internal.h /^ bool tls_ocsp_required;$/;" m struct:mosquitto__bridge +tls_opts_set lib/cpp/mosquittopp.cpp /^int mosquittopp::tls_opts_set(int cert_reqs, const char *tls_version, const char *ciphers)$/;" f class:mosqpp::mosquittopp +tls_psk lib/mosquitto_internal.h /^ char *tls_psk;$/;" m struct:mosquitto +tls_psk src/mosquitto_broker_internal.h /^ char *tls_psk;$/;" m struct:mosquitto__bridge +tls_psk_identity lib/mosquitto_internal.h /^ char *tls_psk_identity;$/;" m struct:mosquitto +tls_psk_identity src/mosquitto_broker_internal.h /^ char *tls_psk_identity;$/;" m struct:mosquitto__bridge +tls_psk_set lib/cpp/mosquittopp.cpp /^int mosquittopp::tls_psk_set(const char *psk, const char *identity, const char *ciphers)$/;" f class:mosqpp::mosquittopp +tls_pw_callback lib/mosquitto_internal.h /^ int (*tls_pw_callback)(char *buf, int size, int rwflag, void *userdata);$/;" m struct:mosquitto +tls_set lib/cpp/mosquittopp.cpp /^int mosquittopp::tls_set(const char *cafile, const char *capath, const char *certfile, const char *keyfile, int (*pw_callback)(char *buf, int size, int rwflag, void *userdata))$/;" f class:mosqpp::mosquittopp +tls_version client/client_shared.h /^ char *tls_version;$/;" m struct:mosq_config +tls_version lib/mosquitto.h /^ char *tls_version;$/;" m struct:libmosquitto_tls +tls_version lib/mosquitto_internal.h /^ char *tls_version;$/;" m struct:mosquitto +tls_version src/mosquitto_broker_internal.h /^ char *tls_version;$/;" m struct:mosquitto__bridge +tls_version src/mosquitto_broker_internal.h /^ char *tls_version;$/;" m struct:mosquitto__listener +tmp client/client_shared.c /^ char *tmp;$/;" l +tmp lib/messages_mosq.c /^ struct mosquitto_message_all *cur, *tmp;$/;" l +tmp lib/messages_mosq.c /^ struct mosquitto_message_all *message, *tmp;$/;" l +tmp lib/messages_mosq.c /^ struct mosquitto_message_all *tail, *tmp;$/;" l +tmp lib/util_mosq.c /^ unsigned char *sha, tmp[SHA_DIGEST_LENGTH];$/;" l +tmp src/database.c /^ struct mosquitto_client_msg *msg, *tmp;$/;" l +tmp src/database.c /^ struct mosquitto_client_msg *tail, *tmp;$/;" l +tmp src/handle_connect.c /^ struct mosquitto_client_msg *msg_tail, *tmp;$/;" l +tmp src/security_default.c /^ struct mosquitto__unpwd *u, *tmp;$/;" l +tmp src/session_expiry.c /^ struct session_expiry_list *item, *tmp;$/;" l +tmp src/will_delay.c /^ struct will_delay_list *item, *tmp;$/;" l +tmp test/broker/c/auth_plugin_context_params.c /^ const char *tmp;$/;" l +tmp test/lib/c/11-prop-send-content-type.c /^ int tmp;$/;" l +tmp test/lib/c/11-prop-send-payload-format.c /^ int tmp;$/;" l +tmp_char src/conf.c /^ char *tmp_char;$/;" l +tmp_int src/conf.c /^ int tmp_int;$/;" l +tmp_payload src/handle_subscribe.c /^ uint8_t *payload = NULL, *tmp_payload;$/;" l +tmp_remove_subs src/subs.c /^static struct mosquitto__subhier *tmp_remove_subs(struct mosquitto__subhier *sub)$/;" f file: +tmpfile_path src/mosquitto_passwd.c /^static unsigned char tmpfile_path[36];$/;" v file: +to_hex_string test/mosq_test.py /^def to_hex_string(packet):$/;" f +to_process lib/mosquitto_internal.h /^ uint32_t to_process;$/;" m struct:mosquitto__packet +to_string test/mosq_test.py /^def to_string(packet):$/;" f +token src/conf.c /^ char *token;$/;" l +token src/mosquitto.c /^ char *token;$/;" l +token src/mosquitto_passwd.c /^ char lbuf[MAX_BUFFER_LEN], *token;$/;" l +token src/security_default.c /^ char *token;$/;" l +tokens src/subs.c /^ struct sub__token *tokens = NULL, *t;$/;" l +tokens src/subs.c /^ struct sub__token *tokens = NULL, *tail;$/;" l +tokens src/subs.c /^ struct sub__token *tokens = NULL;$/;" l +topic client/client_shared.c /^ char *topic;$/;" l +topic client/client_shared.h /^ char *topic; \/* pub, rr *\/$/;" m struct:mosq_config +topic lib/helpers.c /^ const char *topic;$/;" m struct:userdata__callback file: +topic lib/mosquitto.h /^ char *topic;$/;" m struct:libmosquitto_will +topic lib/mosquitto.h /^ char *topic;$/;" m struct:mosquitto_message +topic lib/mosquitto_internal.h /^ char *topic;$/;" m struct:mosquitto__alias +topic src/database.c /^ char *topic;$/;" l +topic src/database.c /^ const char *topic;$/;" l +topic src/db_dump/db_dump.c /^ char *topic;$/;" m struct:db_msg file: +topic src/db_dump/db_dump.c /^ char *topic;$/;" m struct:db_sub file: +topic src/handle_publish.c /^ char *topic;$/;" l +topic src/logging.c /^ const char *topic;$/;" l +topic src/mosquitto_broker_internal.h /^ char *topic;$/;" m struct:mosquitto__acl +topic src/mosquitto_broker_internal.h /^ char *topic;$/;" m struct:mosquitto__bridge_topic +topic src/mosquitto_broker_internal.h /^ char *topic;$/;" m struct:mosquitto__subhier +topic src/mosquitto_broker_internal.h /^ char* topic;$/;" m struct:mosquitto_msg_store +topic src/mosquitto_plugin.h /^ const char *topic;$/;" m struct:mosquitto_acl_msg +topic src/persist.h /^ char *topic;$/;" m struct:P_msg_store +topic src/persist.h /^ char *topic;$/;" m struct:P_sub +topic src/security.c /^ const char *topic = msg->topic;$/;" l +topic src/security_default.c /^ char *topic;$/;" l +topic src/subs.c /^ char *topic;$/;" l +topic src/subs.c /^ char *topic;$/;" m struct:sub__token file: +topic_alias src/handle_publish.c /^ int topic_alias = -1;$/;" l +topic_count client/client_shared.h /^ int topic_count; \/* sub *\/$/;" m struct:mosq_config +topic_count src/mosquitto_broker_internal.h /^ int topic_count;$/;" m struct:mosquitto__bridge +topic_count test/lib/c/09-util-topic-tokenise.c /^ int topic_count;$/;" l +topic_count test/lib/cpp/09-util-topic-tokenise.cpp /^ int topic_count;$/;" l +topic_heap src/database.c /^ char *topic_heap;$/;" l +topic_len src/mosquitto_broker_internal.h /^ uint16_t topic_len;$/;" m struct:mosquitto__subhier +topic_len src/persist.h /^ uint16_t topic_len;$/;" m struct:PF_msg_store +topic_len src/persist.h /^ uint16_t topic_len;$/;" m struct:PF_sub +topic_len src/persist_write_v5.c /^ uint16_t topic_len = chunk->F.topic_len;$/;" l +topic_len src/subs.c /^ uint16_t topic_len;$/;" m struct:sub__token file: +topic_matches_sub lib/cpp/mosquittopp.cpp /^int topic_matches_sub(const char *sub, const char *topic, bool *result)$/;" f namespace:mosqpp +topic_mount src/handle_publish.c /^ char *topic_mount;$/;" l +topic_pattern src/security_default.c /^ int topic_pattern;$/;" l +topic_remapping src/mosquitto_broker_internal.h /^ bool topic_remapping;$/;" m struct:mosquitto__bridge +topic_temp lib/send_publish.c /^ char *topic_temp = NULL;$/;" l +topic_temp src/handle_publish.c /^ char *topic_temp;$/;" l +topics client/client_shared.h /^ char **topics; \/* sub *\/$/;" m struct:mosq_config +topics src/mosquitto_broker_internal.h /^ struct mosquitto__bridge_topic *topics;$/;" m struct:mosquitto__bridge typeref:struct:mosquitto__bridge::mosquitto__bridge_topic +topics test/lib/c/09-util-topic-tokenise.c /^ char **topics;$/;" l +topics test/lib/cpp/09-util-topic-tokenise.cpp /^ char **topics;$/;" l +transport test/random/random_client.py /^transport = p["transport"]$/;" v +true lib/mosquitto.h 37;" d +true src/mosquitto_passwd.c 36;" d file: +try_private src/mosquitto_broker_internal.h /^ bool try_private;$/;" m struct:mosquitto__bridge +try_private_accepted src/mosquitto_broker_internal.h /^ bool try_private_accepted;$/;" m struct:mosquitto__bridge +ts client/pub_client.c /^ struct timespec ts;$/;" l +ts lib/thread_mosq.c /^ struct timespec ts;$/;" l +ts src/mosquitto_passwd.c /^ struct termios ts;$/;" l +tv client/pub_client.c /^ struct timeval tv;$/;" l +tv src/logging.c /^ struct timeval tv;$/;" l +tv src/mosquitto.c /^ struct timeval tv;$/;" l +type client/client_props.c /^ int cmd, identifier, type;$/;" l +type test/unit/property_user_read.c /^ int identifier, type;$/;" l +u src/security_default.c /^ struct mosquitto__unpwd *u, *tmp;$/;" l +u src/websockets.c /^ struct libws_http_data *u = (struct libws_http_data *)user;$/;" l +u src/websockets.c /^ struct libws_mqtt_data *u = (struct libws_mqtt_data *)user;$/;" l +u_dup src/plugin.c /^ char *u_dup;$/;" l +ucount src/mosquitto_broker_internal.h /^ int ucount;$/;" m struct:mosquitto__acl +uhpa_free src/mosquitto_broker_internal.h 55;" d +uhpa_free src/uhpa.h 129;" d +uhpa_malloc src/mosquitto_broker_internal.h 54;" d +uhpa_malloc src/uhpa.h 125;" d +ui_close lib/net_mosq.c /^static int ui_close(UI *ui)$/;" f file: +ui_method lib/net_mosq.c /^ UI_METHOD *ui_method = net__get_ui_method();$/;" l +ui_method src/net.c /^ UI_METHOD *ui_method = net__get_ui_method();$/;" l +ui_open lib/net_mosq.c /^static int ui_open(UI *ui)$/;" f file: +ui_read lib/net_mosq.c /^static int ui_read(UI *ui, UI_STRING *uis)$/;" f file: +ui_write lib/net_mosq.c /^static int ui_write(UI *ui, UI_STRING *uis)$/;" f file: +uint16 lib/property_mosq.c /^ uint16_t uint16;$/;" l +uint16_read_helper test/unit/datatype_read.c /^static void uint16_read_helper($/;" f file: +uint16_t lib/mosquitto_internal.h /^ typedef unsigned short uint16_t;$/;" t +uint32 lib/property_mosq.c /^ uint32_t uint32;$/;" l +uint32_read_helper test/unit/datatype_read.c /^static void uint32_read_helper($/;" f file: +uint32_t lib/mosquitto_internal.h /^ typedef unsigned int uint32_t;$/;" t +uint32_t src/deps/uthash.h /^typedef unsigned int uint32_t;$/;" t +uint64_t lib/mosquitto_internal.h /^ typedef unsigned long long uint64_t;$/;" t +uint8_t lib/mosquitto_internal.h /^ typedef unsigned char uint8_t;$/;" t +uint8_t src/deps/uthash.h /^typedef unsigned char uint8_t;$/;" t +ulen lib/socks_mosq.c /^ int ulen, plen;$/;" l +ulen lib/util_mosq.c /^ int ulen = UNLEN;$/;" l +ulen src/security_default.c /^ int len, tlen, clen, ulen;$/;" l +unpwd src/mosquitto_broker_internal.h /^ struct mosquitto__unpwd *unpwd;$/;" m struct:mosquitto__listener typeref:struct:mosquitto__listener::mosquitto__unpwd +unpwd src/mosquitto_broker_internal.h /^ struct mosquitto__unpwd *unpwd;$/;" m struct:mosquitto_db typeref:struct:mosquitto_db::mosquitto__unpwd +unpwd src/security_default.c /^ struct mosquitto__unpwd *unpwd;$/;" l +unpwd__cleanup src/security_default.c /^static int unpwd__cleanup(struct mosquitto__unpwd **root, bool reload)$/;" f file: +unpwd__decode_passwords src/security_default.c /^static int unpwd__decode_passwords(struct mosquitto__unpwd **unpwd)$/;" f file: +unpwd__file_parse src/security_default.c /^static int unpwd__file_parse(struct mosquitto__unpwd **unpwd, const char *password_file)$/;" f file: +unpwd__free_item src/security_default.c /^static void unpwd__free_item(struct mosquitto__unpwd **unpwd, struct mosquitto__unpwd *item)$/;" f file: +unpwd_check_v2 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_unpwd_check_v2 unpwd_check_v2;$/;" m struct:mosquitto__auth_plugin +unpwd_check_v3 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_unpwd_check_v3 unpwd_check_v3;$/;" m struct:mosquitto__auth_plugin +unpwd_check_v4 src/mosquitto_broker_internal.h /^ FUNC_auth_plugin_unpwd_check_v4 unpwd_check_v4;$/;" m struct:mosquitto__auth_plugin +unpwd_ref src/security_default.c /^ struct mosquitto__unpwd *unpwd_ref;$/;" l +unsub_mid test/broker/04-retain-qos0-repeated.py /^unsub_mid = 13$/;" v +unsub_topic_count client/client_shared.h /^ int unsub_topic_count; \/* sub *\/$/;" m struct:mosq_config +unsub_topics client/client_shared.h /^ char **unsub_topics; \/* sub *\/$/;" m struct:mosq_config +unsuback1_packet test/broker/02-shared-qos0-v5.py /^unsuback1_packet = mosq_test.gen_unsuback(mid, proto_ver=5)$/;" v +unsuback1_packet test/broker/02-subhier-crash.py /^unsuback1_packet = mosq_test.gen_unsuback(mid)$/;" v +unsuback2_packet test/broker/02-shared-qos0-v5.py /^unsuback2_packet = mosq_test.gen_unsuback(mid, proto_ver=5)$/;" v +unsuback3a_packet test/broker/02-shared-qos0-v5.py /^unsuback3a_packet = mosq_test.gen_unsuback(mid, proto_ver=5)$/;" v +unsuback3b_packet test/broker/02-shared-qos0-v5.py /^unsuback3b_packet = mosq_test.gen_unsuback(mid, proto_ver=5)$/;" v +unsuback4_packet test/broker/02-shared-qos0-v5.py /^unsuback4_packet = mosq_test.gen_unsuback(mid, proto_ver=5)$/;" v +unsuback5_packet test/broker/02-shared-qos0-v5.py /^unsuback5_packet = mosq_test.gen_unsuback(mid, proto_ver=5)$/;" v +unsuback_packet test/broker/02-unsubscribe-qos0.py /^unsuback_packet = mosq_test.gen_unsuback(mid)$/;" v +unsuback_packet test/broker/02-unsubscribe-qos1.py /^unsuback_packet = mosq_test.gen_unsuback(mid)$/;" v +unsuback_packet test/broker/02-unsubscribe-qos2-multiple-v5.py /^unsuback_packet = mosq_test.gen_unsuback(mid, proto_ver=5, reason_code=[17, 0])$/;" v +unsuback_packet test/broker/02-unsubscribe-qos2-multiple.py /^unsuback_packet = mosq_test.gen_unsuback(mid)$/;" v +unsuback_packet test/broker/02-unsubscribe-qos2-v5.py /^unsuback_packet = mosq_test.gen_unsuback(mid, proto_ver=5, reason_code=17)$/;" v +unsuback_packet test/broker/02-unsubscribe-qos2.py /^unsuback_packet = mosq_test.gen_unsuback(mid)$/;" v +unsuback_packet test/broker/04-retain-qos0-clear.py /^unsuback_packet = mosq_test.gen_unsuback(mid_unsub)$/;" v +unsuback_packet test/broker/04-retain-qos0-repeated.py /^unsuback_packet = mosq_test.gen_unsuback(unsub_mid)$/;" v +unsuback_packet test/broker/06-bridge-fail-persist-resend-qos1.py /^unsuback_packet = mosq_test.gen_unsuback(1)$/;" v +unsuback_packet test/broker/06-bridge-fail-persist-resend-qos2.py /^unsuback_packet = mosq_test.gen_unsuback(1)$/;" v +unsuback_packet test/lib/02-unsubscribe-multiple-v5.py /^unsuback_packet = mosq_test.gen_unsuback(mid, reason_code=[0, 17], proto_ver=5)$/;" v +unsuback_packet test/lib/02-unsubscribe-v5.py /^unsuback_packet = mosq_test.gen_unsuback(mid, proto_ver=5)$/;" v +unsuback_packet test/lib/02-unsubscribe.py /^unsuback_packet = mosq_test.gen_unsuback(mid)$/;" v +unsubs test/lib/c/02-unsubscribe-multiple-v5.c /^ char *unsubs[] = {"unsubscribe\/test", "no-sub"};$/;" l +unsubscribe lib/cpp/mosquittopp.cpp /^int mosquittopp::unsubscribe(int *mid, const char *sub)$/;" f class:mosqpp::mosquittopp +unsubscribe1_packet test/broker/02-shared-qos0-v5.py /^unsubscribe1_packet = mosq_test.gen_unsubscribe(mid, "#", proto_ver=5)$/;" v +unsubscribe1_packet test/broker/02-subhier-crash.py /^unsubscribe1_packet = mosq_test.gen_unsubscribe(mid, "topic\/a")$/;" v +unsubscribe2_packet test/broker/02-shared-qos0-v5.py /^unsubscribe2_packet = mosq_test.gen_unsubscribe(mid, "$share\/one\/share-test", proto_ver=5)$/;" v +unsubscribe3a_packet test/broker/02-shared-qos0-v5.py /^unsubscribe3a_packet = mosq_test.gen_unsubscribe(mid, "$share\/one\/share-test", proto_ver=5)$/;" v +unsubscribe3b_packet test/broker/02-shared-qos0-v5.py /^unsubscribe3b_packet = mosq_test.gen_unsubscribe(mid, "$share\/two\/share-test", proto_ver=5)$/;" v +unsubscribe4_packet test/broker/02-shared-qos0-v5.py /^unsubscribe4_packet = mosq_test.gen_unsubscribe(mid, "$share\/two\/share-test", proto_ver=5)$/;" v +unsubscribe5_packet test/broker/02-shared-qos0-v5.py /^unsubscribe5_packet = mosq_test.gen_unsubscribe(mid, "$share\/one\/share-test", proto_ver=5)$/;" v +unsubscribe_packet test/broker/02-unsubscribe-invalid-no-topic.py /^unsubscribe_packet = gen_unsubscribe_invalid_no_topic(mid)$/;" v +unsubscribe_packet test/broker/02-unsubscribe-qos0.py /^unsubscribe_packet = mosq_test.gen_unsubscribe(mid, "qos0\/test")$/;" v +unsubscribe_packet test/broker/02-unsubscribe-qos1.py /^unsubscribe_packet = mosq_test.gen_unsubscribe(mid, "qos1\/test")$/;" v +unsubscribe_packet test/broker/02-unsubscribe-qos2-multiple-v5.py /^unsubscribe_packet = mosq_test.gen_unsubscribe_multiple(mid, ["qos2\/one", "qos2\/two"], proto_ver=5)$/;" v +unsubscribe_packet test/broker/02-unsubscribe-qos2-multiple.py /^unsubscribe_packet = mosq_test.gen_unsubscribe_multiple(mid, ["qos2\/one", "qos2\/two"])$/;" v +unsubscribe_packet test/broker/02-unsubscribe-qos2-v5.py /^unsubscribe_packet = mosq_test.gen_unsubscribe(mid, "qos2\/test", proto_ver=5)$/;" v +unsubscribe_packet test/broker/02-unsubscribe-qos2.py /^unsubscribe_packet = mosq_test.gen_unsubscribe(mid, "qos2\/test")$/;" v +unsubscribe_packet test/broker/04-retain-qos0-clear.py /^unsubscribe_packet = mosq_test.gen_unsubscribe(mid_unsub, "retain\/clear\/test")$/;" v +unsubscribe_packet test/broker/04-retain-qos0-repeated.py /^unsubscribe_packet = mosq_test.gen_unsubscribe(unsub_mid, "retain\/qos0\/test")$/;" v +unsubscribe_packet test/broker/06-bridge-fail-persist-resend-qos1.py /^unsubscribe_packet = mosq_test.gen_unsubscribe(1, "bridge\/#")$/;" v +unsubscribe_packet test/broker/06-bridge-fail-persist-resend-qos2.py /^unsubscribe_packet = mosq_test.gen_unsubscribe(1, "bridge\/#")$/;" v +unsubscribe_packet test/lib/02-unsubscribe-multiple-v5.py /^unsubscribe_packet = mosq_test.gen_unsubscribe_multiple(mid, ["unsubscribe\/test", "no-sub"], proto_ver=5)$/;" v +unsubscribe_packet test/lib/02-unsubscribe-v5.py /^unsubscribe_packet = mosq_test.gen_unsubscribe(mid, "unsubscribe\/test", proto_ver=5)$/;" v +unsubscribe_packet test/lib/02-unsubscribe.py /^unsubscribe_packet = mosq_test.gen_unsubscribe(mid, "unsubscribe\/test")$/;" v +unsubscribe_props client/client_shared.h /^ mosquitto_property *unsubscribe_props;$/;" m struct:mosq_config +update test/broker/03-publish-qos1-queued-bytes.py /^ def update(self, tup):$/;" m class:StoreCounts +update_file src/mosquitto_passwd.c /^int update_file(FILE *fptr, FILE *ftmp)$/;" f +update_pwuser src/mosquitto_passwd.c /^int update_pwuser(FILE *fptr, FILE *ftmp, const char *username, const char *password)$/;" f +upgrade_outgoing_qos src/mosquitto_broker_internal.h /^ bool upgrade_outgoing_qos;$/;" m struct:mosquitto__config +uptime src/sys_tree.c /^ time_t uptime;$/;" l +url client/client_shared.c /^ char *url = argv[i+1];$/;" l +usb misc/currentcost/cc128_read.py /^usb = serial.Serial(port='\/dev\/ttyUSB0', baudrate=57600)$/;" v +use_identity_as_username src/mosquitto_broker_internal.h /^ bool use_identity_as_username;$/;" m struct:mosquitto__listener +use_srv client/client_shared.h /^ bool use_srv;$/;" m struct:mosq_config +use_subject_as_username src/mosquitto_broker_internal.h /^ bool use_subject_as_username;$/;" m struct:mosquitto__listener +use_tls test/random/random_client.py /^use_tls = p["tls"]$/;" v +use_username_as_clientid src/mosquitto_broker_internal.h /^ bool use_username_as_clientid;$/;" m struct:mosquitto__listener +user src/mosquitto_broker_internal.h /^ char *user;$/;" m struct:mosquitto__config +user src/security_default.c /^ char *user = NULL;$/;" l +user src/websockets.c /^ struct libws_mqtt_hack *user;$/;" l +user_data src/mosquitto_broker_internal.h /^ void *user_data;$/;" m struct:mosquitto__auth_plugin +user_data_set lib/cpp/mosquittopp.cpp /^void mosquittopp::user_data_set(void *userdata)$/;" f class:mosqpp::mosquittopp +user_tail src/security_default.c /^ struct mosquitto__acl_user *acl_user=NULL, *user_tail;$/;" l +user_tail src/security_default.c /^ struct mosquitto__acl_user *user_tail;$/;" l +userdata lib/helpers.c /^ struct userdata__callback *userdata = obj;$/;" l +userdata lib/helpers.c /^ struct userdata__simple *userdata = obj;$/;" l +userdata lib/helpers.c /^ struct userdata__simple userdata;$/;" l +userdata lib/helpers.c /^ void *userdata;$/;" m struct:userdata__callback file: +userdata lib/mosquitto_internal.h /^ void *userdata;$/;" m struct:mosquitto +userdata__callback lib/helpers.c /^struct userdata__callback {$/;" s file: +userdata__simple lib/helpers.c /^struct userdata__simple {$/;" s file: +username client/client_shared.c /^ char *username = NULL, *password = NULL, *host = NULL, *port = NULL;$/;" l +username client/client_shared.h /^ char *username;$/;" m struct:mosq_config +username lib/mosquitto.h /^ char *username;$/;" m struct:libmosquitto_auth +username lib/mosquitto_internal.h /^ char *username;$/;" m struct:mosquitto +username lib/send_connect.c /^ char *clientid, *username, *password;$/;" l +username lib/util_mosq.c /^ char username[UNLEN + 1];$/;" l +username src/handle_connect.c /^ char *username = NULL, *password = NULL;$/;" l +username src/mosquitto_broker_internal.h /^ char *username;$/;" m struct:mosquitto__acl_user +username src/mosquitto_broker_internal.h /^ char *username;$/;" m struct:mosquitto__unpwd +username src/mosquitto_passwd.c /^ char *username = NULL;$/;" l +username src/mosquitto_passwd.c /^ char *username, *password;$/;" l +username src/security.c /^ const char *username;$/;" l +username src/security_default.c /^ char *username, *password;$/;" l +username test/broker/09-acl-change.py /^username = "username"$/;" v +username test/broker/c/auth_plugin.c /^ const char *username = mosquitto_client_username(client);$/;" l +username test/broker/c/auth_plugin_acl.c /^ const char *username = mosquitto_client_username(client);$/;" l +username_flag src/handle_connect.c /^ uint8_t username_flag, password_flag;$/;" l +username_or_host client/client_shared.c /^ char *username_or_host = NULL;$/;" l +username_password_tests test/broker/09-pwfile-parse-invalid.py /^def username_password_tests(port):$/;" f +username_pw_set lib/cpp/mosquittopp.cpp /^int mosquittopp::username_pw_set(const char *username, const char *password)$/;" f class:mosqpp::mosquittopp +ustr lib/utf8_mosq.c /^ const unsigned char *ustr = (const unsigned char *)str;$/;" l +utf8_helper test/unit/utf8.c /^static void utf8_helper(const char *text, int expected)$/;" f file: +utf8_helper_len test/unit/utf8.c /^static void utf8_helper_len(const char *text, int len, int expected)$/;" f file: +uthash_expand_fyi src/deps/uthash.h 83;" d +uthash_fatal src/deps/uthash.h 70;" d +uthash_free config.h 41;" d +uthash_free src/deps/uthash.h 76;" d +uthash_malloc config.h 40;" d +uthash_malloc src/deps/uthash.h 73;" d +uthash_noexpand_fyi src/deps/uthash.h 80;" d +util__decrement_receive_quota lib/util_mosq.c /^void util__decrement_receive_quota(struct mosquitto *mosq)$/;" f +util__decrement_send_quota lib/util_mosq.c /^void util__decrement_send_quota(struct mosquitto *mosq)$/;" f +util__increment_receive_quota lib/util_mosq.c /^void util__increment_receive_quota(struct mosquitto *mosq)$/;" f +util__increment_send_quota lib/util_mosq.c /^void util__increment_send_quota(struct mosquitto *mosq)$/;" f +util__random_bytes lib/util_mosq.c /^int util__random_bytes(void *bytes, int count)$/;" f +v lib/property_mosq.h /^ char *v;$/;" m struct:mqtt__string +va client/client_shared.c /^ va_list va;$/;" l +va lib/logging_mosq.c /^ va_list va;$/;" l +va src/logging.c /^ va_list va;$/;" l +val lib/net_mosq.c /^ uint32_t val = 1;$/;" l +val lib/packet_datatypes.c /^ uint32_t val = 0;$/;" l +valid_bytes src/database.c /^ bool valid_bytes = source_bytes - adjust_bytes < max_queued_bytes;$/;" l +valid_bytes src/database.c /^ bool valid_bytes;$/;" l +valid_count src/database.c /^ bool valid_count = source_count - adjust_count < max_queued;$/;" l +valid_count src/database.c /^ bool valid_count;$/;" l +validate_utf8 lib/cpp/mosquittopp.cpp /^int validate_utf8(const char *str, int len)$/;" f namespace:mosqpp +value client/client_props.c /^ char *key = NULL, *value = NULL;$/;" l +value lib/property_mosq.h /^ } value;$/;" m struct:mqtt5__property typeref:union:mqtt5__property::__anon2 +value src/mosquitto_plugin.h /^ char *value;$/;" m struct:mosquitto_auth_opt +value src/mosquitto_plugin.h /^ char *value;$/;" m struct:mosquitto_opt +value test/broker/c/mosquitto_plugin_v2.h /^ char *value;$/;" m struct:mosquitto_auth_opt +value test/unit/datatype_read.c /^ int32_t value = -1;$/;" l +value test/unit/datatype_read.c /^ uint16_t value = 0;$/;" l +value test/unit/datatype_read.c /^ uint32_t value = 0;$/;" l +value test/unit/datatype_read.c /^ uint8_t *value = NULL;$/;" l +value test/unit/datatype_read.c /^ uint8_t value = 0;$/;" l +value test/unit/datatype_read.c /^ uint8_t value[count];$/;" l +value test/unit/property_user_read.c /^ char *key = NULL, *value = NULL;$/;" l +value test/unit/property_user_read.c /^ char *key, *value;$/;" l +value test/unit/property_user_read.c /^ char *value = NULL;$/;" l +value test/unit/property_user_read.c /^ uint16_t value;$/;" l +value test/unit/property_user_read.c /^ uint32_t value;$/;" l +value test/unit/property_user_read.c /^ uint8_t value;$/;" l +value test/unit/property_user_read.c /^ void *value = NULL;$/;" l +value_ul src/sys_tree.c /^ unsigned long value_ul;$/;" l +varbytes lib/send_connect.c /^ int proplen = 0, will_proplen, varbytes;$/;" l +varbytes lib/send_disconnect.c /^ int proplen, varbytes;$/;" l +varbytes lib/send_mosq.c /^ int proplen, varbytes;$/;" l +varbytes lib/send_publish.c /^ int proplen = 0, varbytes;$/;" l +varbytes lib/send_subscribe.c /^ int proplen, varbytes;$/;" l +varbytes lib/send_unsubscribe.c /^ int proplen, varbytes;$/;" l +varbytes src/send_auth.c /^ int proplen, varbytes;$/;" l +varbytes src/send_connack.c /^ int proplen, varbytes;$/;" l +varbytes src/send_suback.c /^ int proplen, varbytes;$/;" l +varbytes src/send_unsuback.c /^ int proplen, varbytes;$/;" l +varint lib/property_mosq.c /^ int32_t varint;$/;" l +varint lib/property_mosq.h /^ uint32_t varint;$/;" m union:mqtt5__property::__anon2 +varint_prop_read_helper test/unit/property_read.c /^static void varint_prop_read_helper($/;" f file: +varint_prop_write_helper test/unit/property_write.c /^static void varint_prop_write_helper($/;" f file: +varint_read_helper test/unit/datatype_read.c /^static void varint_read_helper($/;" f file: +ver test/lib/c/03-request-response-1.c /^ int ver = PROTOCOL_VERSION_v5;$/;" l +ver test/lib/c/03-request-response-2.c /^ int ver = PROTOCOL_VERSION_v5;$/;" l +ver test/lib/c/03-request-response-correlation-1.c /^ int ver = PROTOCOL_VERSION_v5;$/;" l +verbose client/client_shared.h /^ bool verbose; \/* sub *\/$/;" m struct:mosq_config +verbose src/mosquitto_broker_internal.h /^ bool verbose;$/;" m struct:mosquitto_db +version lib/send_connect.c /^ uint8_t version;$/;" l +version src/mosquitto_broker_internal.h /^ int version;$/;" m struct:mosquitto__auth_plugin +version src/security.c /^ int version;$/;" l +vg_index test/mosq_test.py /^vg_index = 1$/;" v +vg_logfiles test/mosq_test.py /^vg_logfiles = []$/;" v +want_connect lib/mosquitto_internal.h /^ bool want_connect;$/;" m struct:mosquitto +want_retained lib/helpers.c /^ bool want_retained;$/;" m struct:userdata__simple file: +want_write lib/cpp/mosquittopp.cpp /^bool mosquittopp::want_write()$/;" f class:mosqpp::mosquittopp +want_write lib/mosquitto_internal.h /^ bool want_write;$/;" m struct:mosquitto +websockets_headers_size src/mosquitto_broker_internal.h /^ int websockets_headers_size;$/;" m struct:mosquitto__config +websockets_log_level src/mosquitto_broker_internal.h /^ int websockets_log_level;$/;" m struct:mosquitto__config +will lib/mosquitto_internal.h /^ struct mosquitto_message_all *will;$/;" m struct:mosquitto typeref:struct:mosquitto::mosquitto_message_all +will lib/send_connect.c /^ uint8_t will = 0;$/;" l +will src/handle_connect.c /^ uint8_t will, will_retain, will_qos, clean_start;$/;" l +will test/broker/07-will-null.py /^ will = subprocess.Popen(['.\/07-will-null-helper.py', str(port)], stdout=subprocess.PIPE, stderr=subprocess.PIPE)$/;" v +will__clear lib/will_mosq.c /^int will__clear(struct mosquitto *mosq)$/;" f +will__read src/handle_connect.c /^static int will__read(struct mosquitto *context, struct mosquitto_message_all **will, uint8_t will_qos, int will_retain)$/;" f file: +will__set lib/will_mosq.c /^int will__set(struct mosquitto *mosq, const char *topic, int payloadlen, const void *payload, int qos, bool retain, mosquitto_property *properties)$/;" f +will_clear lib/cpp/mosquittopp.cpp /^int mosquittopp::will_clear()$/;" f class:mosqpp::mosquittopp +will_delay__add src/will_delay.c /^int will_delay__add(struct mosquitto *context)$/;" f +will_delay__check src/will_delay.c /^void will_delay__check(struct mosquitto_db *db, time_t now)$/;" f +will_delay__cmp src/will_delay.c /^static int will_delay__cmp(struct will_delay_list *i1, struct will_delay_list *i2)$/;" f file: +will_delay__remove src/will_delay.c /^void will_delay__remove(struct mosquitto *mosq)$/;" f +will_delay__send_all src/will_delay.c /^void will_delay__send_all(struct mosquitto_db *db)$/;" f +will_delay_entry lib/mosquitto_internal.h /^ struct will_delay_list *will_delay_entry;$/;" m struct:mosquitto typeref:struct:mosquitto::will_delay_list +will_delay_interval lib/mosquitto_internal.h /^ uint32_t will_delay_interval;$/;" m struct:mosquitto +will_delay_list lib/mosquitto_internal.h /^struct will_delay_list {$/;" s +will_delay_time lib/mosquitto_internal.h /^ time_t will_delay_time;$/;" m struct:mosquitto +will_payload client/client_shared.h /^ char *will_payload;$/;" m struct:mosq_config +will_payloadlen client/client_shared.h /^ long will_payloadlen;$/;" m struct:mosq_config +will_proplen lib/send_connect.c /^ int proplen = 0, will_proplen, varbytes;$/;" l +will_props client/client_shared.h /^ mosquitto_property *will_props;$/;" m struct:mosq_config +will_props test/broker/07-will-properties.py /^will_props = mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key1", "value1")$/;" v +will_props test/broker/07-will-properties.py /^will_props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_RESPONSE_TOPIC, "response\/topic")$/;" v +will_props test/broker/07-will-properties.py /^will_props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_WILL_DELAY_INTERVAL, 0)$/;" v +will_qos client/client_shared.h /^ int will_qos;$/;" m struct:mosq_config +will_qos src/handle_connect.c /^ uint8_t will, will_retain, will_qos, clean_start;$/;" l +will_retain client/client_shared.h /^ bool will_retain;$/;" m struct:mosq_config +will_retain src/handle_connect.c /^ uint8_t will, will_retain, will_qos, clean_start;$/;" l +will_set lib/cpp/mosquittopp.cpp /^int mosquittopp::will_set(const char *topic, int payloadlen, const void *payload, int qos, bool retain)$/;" f class:mosqpp::mosquittopp +will_struct src/handle_connect.c /^ struct mosquitto_message_all *will_struct = NULL;$/;" l +will_topic client/client_shared.h /^ char *will_topic;$/;" m struct:mosq_config +will_topic_mount src/handle_connect.c /^ char *will_topic_mount = NULL;$/;" l +wlen src/websockets.c /^ size_t wlen;$/;" l +wr src/signals.c /^ int wr = WaitForMultipleObjects(sizeof(evt) \/ sizeof(HANDLE), evt, FALSE, INFINITE);$/;" l +wrap_req src/net.c /^ struct request_info wrap_req;$/;" l +write_acl test/broker/09-acl-access-variants.py /^def write_acl(filename, global_en, user_en, pattern_en):$/;" f +write_acl test/broker/09-acl-change.py /^def write_acl(filename, en):$/;" f +write_acl test/broker/09-acl-empty-file.py /^def write_acl(filename):$/;" f +write_acl test/broker/09-extended-auth-change-username.py /^def write_acl(filename):$/;" f +write_acl_1 test/broker/04-retain-check-source-persist-diff-port.py /^def write_acl_1(filename, username):$/;" f +write_acl_1 test/broker/04-retain-check-source-persist.py /^def write_acl_1(filename, username):$/;" f +write_acl_1 test/broker/04-retain-check-source.py /^def write_acl_1(filename):$/;" f +write_acl_2 test/broker/04-retain-check-source-persist-diff-port.py /^def write_acl_2(filename, username):$/;" f +write_acl_2 test/broker/04-retain-check-source-persist.py /^def write_acl_2(filename, username):$/;" f +write_acl_2 test/broker/04-retain-check-source.py /^def write_acl_2(filename):$/;" f +write_config test/broker/01-connect-anon-denied.py /^def write_config(filename, port):$/;" f +write_config test/broker/01-connect-uname-no-password-denied.py /^def write_config(filename, port):$/;" f +write_config test/broker/01-connect-uname-password-denied-no-will.py /^def write_config(filename, port, pw_file):$/;" f +write_config test/broker/01-connect-uname-password-denied.py /^def write_config(filename, port):$/;" f +write_config test/broker/01-connect-uname-password-success-no-tls.py /^def write_config(filename, port):$/;" f +write_config test/broker/01-connect-uname-password-success.py /^def write_config(filename, port):$/;" f +write_config test/broker/03-publish-qos1-retain-disabled.py /^def write_config(filename, port):$/;" f +write_config test/broker/04-retain-check-source-persist-diff-port.py /^def write_config(filename, port1, port2, per_listener):$/;" f +write_config test/broker/04-retain-check-source-persist.py /^def write_config(filename, port, per_listener):$/;" f +write_config test/broker/04-retain-check-source.py /^def write_config(filename, port, per_listener):$/;" f +write_config test/broker/04-retain-upgrade-outgoing-qos.py /^def write_config(filename, port):$/;" f +write_config test/broker/06-bridge-b2br-disconnect-qos1.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/06-bridge-b2br-disconnect-qos2.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/06-bridge-b2br-late-connection.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/06-bridge-b2br-remapping.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/06-bridge-br2b-disconnect-qos1.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/06-bridge-br2b-disconnect-qos2.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/06-bridge-br2b-remapping.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/06-bridge-fail-persist-resend-qos1.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/06-bridge-fail-persist-resend-qos2.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/06-bridge-per-listener-settings.py /^def write_config(filename, port1, port2, port3):$/;" f +write_config test/broker/06-bridge-reconnect-local-out.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/08-ssl-bridge.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/08-ssl-connect-cert-auth-crl.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/08-ssl-connect-cert-auth-expired.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/08-ssl-connect-cert-auth-revoked.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/08-ssl-connect-cert-auth-without.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/08-ssl-connect-cert-auth.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/08-ssl-connect-identity.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/08-ssl-connect-no-auth-wrong-ca.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/08-ssl-connect-no-auth.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/08-ssl-connect-no-identity.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/08-tls-psk-pub.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/09-acl-access-variants.py /^def write_config(filename, port, per_listener):$/;" f +write_config test/broker/09-acl-change.py /^def write_config(filename, port, per_listener):$/;" f +write_config test/broker/09-acl-empty-file.py /^def write_config(filename, port, per_listener):$/;" f +write_config test/broker/09-extended-auth-change-username.py /^def write_config(filename, acl_file, port, per_listener):$/;" f +write_config test/broker/09-extended-auth-multistep-reauth.py /^def write_config(filename, port):$/;" f +write_config test/broker/09-extended-auth-multistep.py /^def write_config(filename, port):$/;" f +write_config test/broker/09-extended-auth-single.py /^def write_config(filename, port):$/;" f +write_config test/broker/09-extended-auth-single2.py /^def write_config(filename, port):$/;" f +write_config test/broker/09-plugin-auth-acl-pub.py /^def write_config(filename, port):$/;" f +write_config test/broker/09-plugin-auth-acl-sub-denied.py /^def write_config(filename, port):$/;" f +write_config test/broker/09-plugin-auth-acl-sub.py /^def write_config(filename, port):$/;" f +write_config test/broker/09-plugin-auth-context-params.py /^def write_config(filename, port):$/;" f +write_config test/broker/09-plugin-auth-defer-unpwd-fail.py /^def write_config(filename, port):$/;" f +write_config test/broker/09-plugin-auth-defer-unpwd-success.py /^def write_config(filename, port):$/;" f +write_config test/broker/09-plugin-auth-msg-params.py /^def write_config(filename, port):$/;" f +write_config test/broker/09-plugin-auth-unpwd-fail.py /^def write_config(filename, port):$/;" f +write_config test/broker/09-plugin-auth-unpwd-success.py /^def write_config(filename, port):$/;" f +write_config test/broker/09-plugin-auth-v2-unpwd-fail.py /^def write_config(filename, port):$/;" f +write_config test/broker/09-plugin-auth-v2-unpwd-success.py /^def write_config(filename, port):$/;" f +write_config test/broker/09-pwfile-parse-invalid.py /^def write_config(filename, port, per_listener):$/;" f +write_config test/broker/10-listener-mount-point.py /^def write_config(filename, port1, port2):$/;" f +write_config test/broker/11-message-expiry.py /^def write_config(filename, port):$/;" f +write_config test/broker/11-persistent-subscription-no-local.py /^def write_config(filename, port):$/;" f +write_config test/broker/11-persistent-subscription-v5.py /^def write_config(filename, port):$/;" f +write_config test/broker/11-persistent-subscription.py /^def write_config(filename, port):$/;" f +write_config test/broker/11-pub-props.py /^def write_config(filename, port):$/;" f +write_config test/broker/11-subscription-id.py /^def write_config(filename, port):$/;" f +write_config test/broker/12-prop-maximum-packet-size-broker.py /^def write_config(filename, port):$/;" f +write_config test/broker/12-prop-server-keepalive.py /^def write_config(filename, port):$/;" f +write_config1 test/broker/06-bridge-b2br-late-connection-retain.py /^def write_config1(filename, persistence_file, port1, port2):$/;" f +write_config1 test/broker/08-tls-psk-bridge.py /^def write_config1(filename, port1, port2):$/;" f +write_config2 test/broker/06-bridge-b2br-late-connection-retain.py /^def write_config2(filename, persistence_file, port1, port2):$/;" f +write_config2 test/broker/08-tls-psk-bridge.py /^def write_config2(filename, port2, port3):$/;" f +write_e src/persist.h 33;" d +write_json_payload client/sub_client_output.c /^static void write_json_payload(const char *payload, int payloadlen)$/;" f file: +write_length lib/packet_mosq.c /^ ssize_t write_length;$/;" l +write_payload client/sub_client_output.c /^static void write_payload(const unsigned char *payload, int payloadlen, int hex)$/;" f file: +write_pwfile test/broker/01-connect-uname-password-denied-no-will.py /^def write_pwfile(filename):$/;" f +write_pwfile test/broker/09-pwfile-parse-invalid.py /^def write_pwfile(filename, bad_line1, bad_line2):$/;" f +writefds lib/loop.c /^ fd_set readfds, writefds;$/;" l +ws_context lib/mosquitto_internal.h /^ struct libwebsocket_context *ws_context;$/;" m struct:mosquitto typeref:struct:mosquitto::libwebsocket_context +ws_context src/mosquitto_broker_internal.h /^ struct libwebsocket_context *ws_context;$/;" m struct:mosquitto__listener typeref:struct:mosquitto__listener::libwebsocket_context +ws_protocol src/mosquitto_broker_internal.h /^ struct libwebsocket_protocols *ws_protocol;$/;" m struct:mosquitto__listener typeref:struct:mosquitto__listener::libwebsocket_protocols +ws_want_write lib/mosquitto_internal.h /^ bool ws_want_write;$/;" m struct:mosquitto +wsaData lib/net_mosq.c /^ WSADATA wsaData;$/;" l +wsi lib/mosquitto_internal.h /^ struct libwebsocket *wsi;$/;" m struct:mosquitto typeref:struct:mosquitto::libwebsocket +wsi lib/mosquitto_internal.h /^ struct lws *wsi;$/;" m struct:mosquitto typeref:struct:mosquitto::lws +wspoll src/loop.c /^ struct lws_pollfd wspoll;$/;" l +~mosquittopp lib/cpp/mosquittopp.cpp /^mosquittopp::~mosquittopp()$/;" f class:mosqpp::mosquittopp +~mqtt_tempconv examples/temperature_conversion/temperature_conversion.cpp /^mqtt_tempconv::~mqtt_tempconv()$/;" f class:mqtt_tempconv diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/Makefile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/Makefile new file mode 100644 index 0000000..119d61e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/Makefile @@ -0,0 +1,24 @@ +include ../config.mk + +.PHONY: all check test ptest clean + +all : + +check : test + +test : utest + $(MAKE) -C broker test + $(MAKE) -C lib test + +ptest : utest + $(MAKE) -C broker ptest + $(MAKE) -C lib ptest + +utest : + $(MAKE) -C unit test + +reallyclean : clean +clean : + $(MAKE) -C lib clean + $(MAKE) -C broker clean + $(MAKE) -C unit clean diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-anon-denied.pwfile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-anon-denied.pwfile new file mode 100644 index 0000000..0fec1e9 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-anon-denied.pwfile @@ -0,0 +1 @@ +user:$6$kyuI0x+unN8lbv9U$b6c3O8U/3fCJLEg7/qDHnE9oOE6gu8JqwBXNLAPBQInJuHhpB3teOaSxb3Lx9O+ukglIRPOI0NCENcincSPCvQ== diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-anon-denied.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-anon-denied.py new file mode 100755 index 0000000..d4616bf --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-anon-denied.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 + +# Test whether an anonymous connection is correctly denied. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("password_file %s\n" % (filename.replace('.conf', '.pwfile'))) + f.write("allow_anonymous false\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-anon-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.close() + rc = 0 +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-bad-packet.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-bad-packet.py new file mode 100755 index 0000000..87300ad --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-bad-packet.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 + +# Test whether a first packet of non-CONNECT is rejected. + +from mosq_test_helper import * + +rc = 1 +mid = 2 +publish_packet = mosq_test.gen_publish("pub/qos1/test", qos=1, mid=mid, payload="message") +puback_packet = mosq_test.gen_puback(mid) + + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.settimeout(5) + sock.connect(("localhost", port)) + sock.send(publish_packet) + data = sock.recv(1) + sock.close() + if len(data) == 0: + rc = 0 +except socket.error: + rc = 0 +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-disconnect-v5.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-disconnect-v5.py new file mode 100755 index 0000000..45fa601 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-disconnect-v5.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 + +# loop through the different v5 DISCONNECT reason_code/properties options. + +from mosq_test_helper import * + +def disco_test(test, disconnect_packet): + global rc + + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.send(disconnect_packet) + sock.close() + rc -= 1 + + +rc = 4 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-disconnect-test", proto_ver=5, keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + + +try: + # No reason code, no properties, len=0 + disconnect_packet = mosq_test.gen_disconnect(proto_ver=5) + disco_test("disco len=0", disconnect_packet) + + # Reason code, no properties, len=1 + disconnect_packet = mosq_test.gen_disconnect(proto_ver=5, reason_code=0) + disco_test("disco len=1", disconnect_packet) + + # Reason code, empty properties, len=2 + disconnect_packet = mosq_test.gen_disconnect(proto_ver=5, reason_code=0, properties="") + disco_test("disco len=2", disconnect_packet) + + # Reason code, one property, len>2 + props = mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key", "value") + disconnect_packet = mosq_test.gen_disconnect(proto_ver=5, reason_code=0, properties=props) + disco_test("disco len>2", disconnect_packet) +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +if rc != 0: + print(test) + exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-duplicate-v5.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-duplicate-v5.py new file mode 100755 index 0000000..7f736a6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-duplicate-v5.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 + +# Test whether a duplicate CONNECT is rejected. MQTT v5 + +from mosq_test_helper import * + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-test", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.settimeout(3) + sock.send(connect_packet) + data = sock.recv(1) + if len(data) == 0: + rc = 0 +except socket.error: + rc = 0 +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-duplicate.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-duplicate.py new file mode 100755 index 0000000..90d1dca --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-duplicate.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 + +# Test whether a duplicate CONNECT is rejected. + +from mosq_test_helper import * + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.settimeout(3) + sock.send(connect_packet) + data = sock.recv(1) + if len(data) == 0: + rc = 0 +except socket.error: + rc = 0 +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-id-0-311.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-id-0-311.py new file mode 100755 index 0000000..5878564 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-id-0-311.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 + +# Test whether a CONNECT with a zero length client id results in the correct CONNACK packet. + +from mosq_test_helper import * + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("", keepalive=keepalive, proto_ver=4) +connack_packet = mosq_test.gen_connack(rc=0) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.close() + rc = 0 +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-id-0.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-id-0.py new file mode 100755 index 0000000..07dfcf7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-id-0.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 + +# Test whether a CONNECT with a zero length client id results in the correct CONNACK packet. + +from mosq_test_helper import * + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("", keepalive=keepalive, proto_ver=3) +connack_packet = mosq_test.gen_connack(rc=2) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.close() + rc = 0 +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-id-missing.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-id-missing.py new file mode 100755 index 0000000..eeac39f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-id-missing.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 + +# Test whether a CONNECT with a zero length client id results in the correct CONNACK packet. + +from mosq_test_helper import * + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect(None, keepalive=keepalive, proto_ver=3) +connack_packet = mosq_test.gen_connack(rc=2) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.close() + rc = 0 +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-id-utf8.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-id-utf8.py new file mode 100755 index 0000000..11423bf --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-id-utf8.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 + +# Test whether a client id with invalid UTF-8 fails. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("connect-invalid-utf8", keepalive=keepalive) +b = list(struct.unpack("B"*len(connect_packet), connect_packet)) +b[21] = 0 # Client id should never have a 0x0000 +connect_packet = struct.pack("B"*len(b), *b) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + time.sleep(0.5) + + sock = mosq_test.do_client_connect(connect_packet, b"", port=port) + # Exception occurs if connack packet returned + rc = 0 + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-protonum.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-protonum.py new file mode 100755 index 0000000..348b39f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-protonum.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 + +# Test whether a CONNECT with an invalid protocol number results in the correct CONNACK packet. + +from mosq_test_helper import * + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-invalid-test", keepalive=keepalive, proto_ver=0) +connack_packet = mosq_test.gen_connack(rc=1) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.close() + rc = 0 + +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-reserved.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-reserved.py new file mode 100755 index 0000000..10f56c6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-invalid-reserved.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +# Test whether a CONNECT with reserved set to 1 results in a disconnect. MQTT-3.1.2-3 + +from mosq_test_helper import * + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-invalid-test", keepalive=keepalive, connect_reserved=True, proto_ver=4) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, b"", port=port) + sock.close() + rc = 0 + +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-success-v5.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-success-v5.py new file mode 100755 index 0000000..ce368aa --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-success-v5.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +# Test whether a valid CONNECT results in the correct CONNACK packet for MQTT v5. + +from mosq_test_helper import * + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-success-test", proto_ver=5, keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.close() + rc = 0 +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-success.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-success.py new file mode 100755 index 0000000..2e58ec2 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-success.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +# Test whether a valid CONNECT results in the correct CONNACK packet. + +from mosq_test_helper import * + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-success-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.close() + rc = 0 +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-invalid-utf8.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-invalid-utf8.py new file mode 100755 index 0000000..2ba1f45 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-invalid-utf8.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 + +# Test whether a username with invalid UTF-8 fails. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("connect-invalid-utf8", keepalive=keepalive, username="invalid/utf8") +b = list(struct.unpack("B"*len(connect_packet), connect_packet)) +b[43] = 0 # Username should never have a 0x0000 +connect_packet = struct.pack("B"*len(b), *b) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + time.sleep(0.5) + + sock = mosq_test.do_client_connect(connect_packet, b"", port=port) + # Exception occurs if connack packet returned + rc = 0 + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-no-flag.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-no-flag.py new file mode 100755 index 0000000..b9beb7a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-no-flag.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 + +# Test whether a connection is disconnected if it provides a username but the +# username flag is 0. + +from mosq_test_helper import * + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-uname-test", keepalive=keepalive, username="user") +b = list(struct.unpack("B"*len(connect_packet), connect_packet)) +b[9] = 2 # Remove username flag +connect_packet = struct.pack("B"*len(b), *b) + +connack_packet = mosq_test.gen_connack(rc=5) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, b"", port=port) + sock.close() + rc = 0 +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-no-password-denied.pwfile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-no-password-denied.pwfile new file mode 100644 index 0000000..fd4ac0a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-no-password-denied.pwfile @@ -0,0 +1 @@ +user:$6$Ut1cUS9PG8+gC3vn$tOjCfSJJDe1Alu9HktxxyyzwN4+6mAMSWGRAF9gmMN8pzcGTPVEYYMAZpCEp96Oz2ZRRz5YKM6lPMf1tUbb6zA== diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-no-password-denied.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-no-password-denied.py new file mode 100755 index 0000000..83a5e34 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-no-password-denied.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +# Test whether a connection is denied if it provides just a username when it +# needs a username and password. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("password_file %s\n" % (filename.replace('.conf', '.pwfile'))) + f.write("allow_anonymous false\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-uname-test", keepalive=keepalive, username="user") +connack_packet = mosq_test.gen_connack(rc=5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.close() + rc = 0 +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-denied-no-will.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-denied-no-will.py new file mode 100755 index 0000000..8888802 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-denied-no-will.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 + +# Test whether a connection is denied if it provides a correct username but +# incorrect password. The client has a will, but it should not be sent. Check that. + +from mosq_test_helper import * + +def write_config(filename, port, pw_file): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("password_file %s\n" % (pw_file)) + f.write("allow_anonymous false\n") + +def write_pwfile(filename): + with open(filename, 'w') as f: + # Username user, password password + f.write('user:$6$vZY4TS+/HBxHw38S$vvjVFECzb8dyuu/mruD2QKTfdFn0WmKxbc+1TsdB0L8EdHk3v9JRmfjHd56+VaTnUcSZOZ/hzkdvWCtxlX7AUQ==\n') + +pw_file = os.path.basename(__file__).replace('.py', '.pwfile') +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port, pw_file) +write_pwfile(pw_file) + +rc = 1 +keepalive = 10 +connect1_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="user", password="password", will_topic="will/test", will_payload=b"will msg") +connack1_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, topic="will/test", qos=0) +suback_packet = mosq_test.gen_suback(mid, 0) + +connect2_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="user", password="password9") +connack2_packet = mosq_test.gen_connack(rc=5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock1 = mosq_test.do_client_connect(connect1_packet, connack1_packet, port=port) + mosq_test.do_send_receive(sock1, subscribe_packet, suback_packet) + + sock2 = mosq_test.do_client_connect(connect2_packet, connack2_packet, port=port) + sock2.close() + + # If we receive a will here, this is an error + mosq_test.do_ping(sock1) + sock1.close() + rc = 0 + +finally: + os.remove(conf_file) + os.remove(pw_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-denied.pwfile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-denied.pwfile new file mode 100644 index 0000000..913477d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-denied.pwfile @@ -0,0 +1 @@ +user:$6$vZY4TS+/HBxHw38S$vvjVFECzb8dyuu/mruD2QKTfdFn0WmKxbc+1TsdB0L8EdHk3v9JRmfjHd56+VaTnUcSZOZ/hzkdvWCtxlX7AUQ== diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-denied.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-denied.py new file mode 100755 index 0000000..2762d64 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-denied.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 + +# Test whether a connection is denied if it provides a correct username but +# incorrect password. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("password_file %s\n" % (filename.replace('.conf', '.pwfile'))) + f.write("allow_anonymous false\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="user", password="password9") +connack_packet = mosq_test.gen_connack(rc=5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.close() + rc = 0 + +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-success-no-tls.pwfile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-success-no-tls.pwfile new file mode 100644 index 0000000..28b9bb2 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-success-no-tls.pwfile @@ -0,0 +1 @@ +user:password diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-success-no-tls.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-success-no-tls.py new file mode 100755 index 0000000..8ea0197 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-success-no-tls.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 + +# Test whether a connection is denied if it provides a correct username but +# incorrect password. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("password_file %s\n" % (filename.replace('.conf', '.pwfile'))) + f.write("allow_anonymous false\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="user", password="password") +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.close() + rc = 0 + +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-success.pwfile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-success.pwfile new file mode 100644 index 0000000..e516eb7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-success.pwfile @@ -0,0 +1 @@ +user:$6$LIg/OiUz2yPftClP$dQu0vVNqRHOcMOzDLuqv4e+5rTFW83DFm3s+C8fy9F7Ip73cdIGUlsNGBs4MtKWNjtMl8LnT+pIQZ7ic1ZttyQ== diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-success.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-success.py new file mode 100755 index 0000000..8ea0197 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-password-success.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 + +# Test whether a connection is denied if it provides a correct username but +# incorrect password. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("password_file %s\n" % (filename.replace('.conf', '.pwfile'))) + f.write("allow_anonymous false\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="user", password="password") +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.close() + rc = 0 + +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-pwd-no-flag.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-pwd-no-flag.py new file mode 100755 index 0000000..a10c1c3 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/01-connect-uname-pwd-no-flag.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 + +# Test whether a connection is disconnected if it provides a password but the +# password flag is 0. + +from mosq_test_helper import * + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-uname-test", keepalive=keepalive, username="user", password="pw") +b = list(struct.unpack("B"*len(connect_packet), connect_packet)) +b[9] = 66 # Remove password flag +connect_packet = struct.pack("B"*len(b), *b) + +connack_packet = mosq_test.gen_connack(rc=5) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, b"", port=port) + sock.close() + rc = 0 +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-shared-qos0-v5.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-shared-qos0-v5.py new file mode 100755 index 0000000..eaebcb2 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-shared-qos0-v5.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python3 + +# Test whether shared subscriptions work + +# Client 1 subscribes to #, non shared. Should receive everything. +# Client 2 subscribes to $share/one/share-test +# Client 3 subscribes to $share/one/share-test and $share/two/share-test +# Client 4 subscribes to $share/two/share-test +# Client 5 subscribes to $share/one/share-test + +# A publish to "share-test" should always go to client 1. +# The first publish should also go to client 2 (share one) and client 3 (share two) +# The second publish should also go to client 3 (share one) and client 4 (share two) +# The third publish should also go to client 3 (share two) and client 5 (share one) + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +mid = 1 + +connect1_packet = mosq_test.gen_connect("client1", keepalive=keepalive, proto_ver=5) +connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +connect2_packet = mosq_test.gen_connect("client2", keepalive=keepalive, proto_ver=5) +connack2_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +connect3_packet = mosq_test.gen_connect("client3", keepalive=keepalive, proto_ver=5) +connack3_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +connect4_packet = mosq_test.gen_connect("client4", keepalive=keepalive, proto_ver=5) +connack4_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +connect5_packet = mosq_test.gen_connect("client5", keepalive=keepalive, proto_ver=5) +connack5_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +subscribe1_packet = mosq_test.gen_subscribe(mid, "#", 0, proto_ver=5) +suback1_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + +subscribe2_packet = mosq_test.gen_subscribe(mid, "$share/one/share-test", 0, proto_ver=5) +suback2_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + +subscribe3a_packet = mosq_test.gen_subscribe(mid, "$share/one/share-test", 0, proto_ver=5) +suback3a_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + +subscribe3b_packet = mosq_test.gen_subscribe(mid, "$share/two/share-test", 0, proto_ver=5) +suback3b_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + +subscribe4_packet = mosq_test.gen_subscribe(mid, "$share/two/share-test", 0, proto_ver=5) +suback4_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + +subscribe5_packet = mosq_test.gen_subscribe(mid, "$share/one/share-test", 0, proto_ver=5) +suback5_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + +publish1_packet = mosq_test.gen_publish("share-test", qos=0, payload="message1", proto_ver=5) +publish2_packet = mosq_test.gen_publish("share-test", qos=0, payload="message2", proto_ver=5) +publish3_packet = mosq_test.gen_publish("share-test", qos=0, payload="message3", proto_ver=5) + +mid = 2 +unsubscribe1_packet = mosq_test.gen_unsubscribe(mid, "#", proto_ver=5) +unsuback1_packet = mosq_test.gen_unsuback(mid, proto_ver=5) + +unsubscribe2_packet = mosq_test.gen_unsubscribe(mid, "$share/one/share-test", proto_ver=5) +unsuback2_packet = mosq_test.gen_unsuback(mid, proto_ver=5) + +unsubscribe3a_packet = mosq_test.gen_unsubscribe(mid, "$share/one/share-test", proto_ver=5) +unsuback3a_packet = mosq_test.gen_unsuback(mid, proto_ver=5) + +unsubscribe3b_packet = mosq_test.gen_unsubscribe(mid, "$share/two/share-test", proto_ver=5) +unsuback3b_packet = mosq_test.gen_unsuback(mid, proto_ver=5) + +unsubscribe4_packet = mosq_test.gen_unsubscribe(mid, "$share/two/share-test", proto_ver=5) +unsuback4_packet = mosq_test.gen_unsuback(mid, proto_ver=5) + +unsubscribe5_packet = mosq_test.gen_unsubscribe(mid, "$share/one/share-test", proto_ver=5) +unsuback5_packet = mosq_test.gen_unsuback(mid, proto_ver=5) + + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock1 = mosq_test.do_client_connect(connect1_packet, connack1_packet, timeout=20, port=port) + sock2 = mosq_test.do_client_connect(connect2_packet, connack2_packet, timeout=20, port=port) + sock3 = mosq_test.do_client_connect(connect3_packet, connack3_packet, timeout=20, port=port) + sock4 = mosq_test.do_client_connect(connect4_packet, connack4_packet, timeout=20, port=port) + sock5 = mosq_test.do_client_connect(connect5_packet, connack5_packet, timeout=20, port=port) + + mosq_test.do_send_receive(sock1, subscribe1_packet, suback1_packet, "suback1") + mosq_test.do_send_receive(sock2, subscribe2_packet, suback2_packet, "suback2") + mosq_test.do_send_receive(sock3, subscribe3a_packet, suback3a_packet, "suback3a") + mosq_test.do_send_receive(sock3, subscribe3b_packet, suback3b_packet, "suback3b") + mosq_test.do_send_receive(sock4, subscribe4_packet, suback4_packet, "suback4") + mosq_test.do_send_receive(sock5, subscribe5_packet, suback5_packet, "suback5") + + sock1.send(publish1_packet) + if mosq_test.expect_packet(sock1, "publish1 1", publish1_packet): + if mosq_test.expect_packet(sock2, "publish1 2", publish1_packet): + if mosq_test.expect_packet(sock3, "publish1 3", publish1_packet): + + sock1.send(publish2_packet) + if mosq_test.expect_packet(sock1, "publish2 1", publish2_packet): + if mosq_test.expect_packet(sock3, "publish2 3", publish2_packet): + if mosq_test.expect_packet(sock4, "publish2 4", publish2_packet): + + sock1.send(publish3_packet) + if mosq_test.expect_packet(sock1, "publish3 1", publish3_packet): + if mosq_test.expect_packet(sock3, "publish3 3", publish3_packet): + if mosq_test.expect_packet(sock5, "publish3 5", publish3_packet): + mosq_test.do_send_receive(sock1, unsubscribe1_packet, unsuback1_packet, "unsuback1") + mosq_test.do_send_receive(sock2, unsubscribe2_packet, unsuback2_packet, "unsuback2") + mosq_test.do_send_receive(sock3, unsubscribe3a_packet, unsuback3a_packet, "unsuback3a") + mosq_test.do_send_receive(sock3, unsubscribe3b_packet, unsuback3b_packet, "unsuback3b") + mosq_test.do_send_receive(sock4, unsubscribe4_packet, unsuback4_packet, "unsuback4") + mosq_test.do_send_receive(sock5, unsubscribe5_packet, unsuback5_packet, "unsuback5") + + rc = 0 + + sock1.close() + sock2.close() + sock3.close() + sock4.close() + sock5.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subhier-crash.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subhier-crash.py new file mode 100755 index 0000000..9a3c267 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subhier-crash.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 + +# Test related to https://github.com/eclipse/mosquitto/issues/505 + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subhier-crash", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe1_packet = mosq_test.gen_subscribe(mid, "topic/a", 0) +suback1_packet = mosq_test.gen_suback(mid, 0) + +mid = 2 +subscribe2_packet = mosq_test.gen_subscribe(mid, "topic/b", 0) +suback2_packet = mosq_test.gen_suback(mid, 0) + +mid = 3 +unsubscribe1_packet = mosq_test.gen_unsubscribe(mid, "topic/a") +unsuback1_packet = mosq_test.gen_unsuback(mid) + +disconnect_packet = mosq_test.gen_disconnect() + + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +def test(): + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, subscribe1_packet, suback1_packet, "suback 1") + mosq_test.do_send_receive(sock, subscribe2_packet, suback2_packet, "suback 2") + mosq_test.do_send_receive(sock, unsubscribe1_packet, unsuback1_packet, "unsuback") + + sock.send(disconnect_packet) + sock.close() + + +try: + time.sleep(0.5) + + test() + # Repeat test to check broker is still there + test() + + rc = 0 + +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-retain-as-publish.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-retain-as-publish.py new file mode 100755 index 0000000..2ae92a2 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-retain-as-publish.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 + +# Test whether a client subscribed to a topic with retain-as-published set works as expected. +# MQTT v5 + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subpub-qos1-test", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid = 530 +subscribe1_packet = mosq_test.gen_subscribe(mid, "subpub/normal", 0, proto_ver=5) +suback1_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + +mid = 531 +subscribe2_packet = mosq_test.gen_subscribe(mid, "subpub/rap", 0 | mqtt5_opts.MQTT_SUB_OPT_RETAIN_AS_PUBLISHED, proto_ver=5) +suback2_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + +publish1_packet = mosq_test.gen_publish("subpub/normal", qos=0, retain=True, payload="message", proto_ver=5) +publish2_packet = mosq_test.gen_publish("subpub/rap", qos=0, retain=True, payload="message", proto_ver=5) + +publish1r_packet = mosq_test.gen_publish("subpub/normal", qos=0, retain=False, payload="message", proto_ver=5) +publish2r_packet = mosq_test.gen_publish("subpub/rap", qos=0, retain=True, payload="message", proto_ver=5) + +mid = 1 +publish3_packet = mosq_test.gen_publish("subpub/receive", qos=1, mid=mid, payload="success", proto_ver=5) + + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + + mosq_test.do_send_receive(sock, subscribe1_packet, suback1_packet, "suback1") + mosq_test.do_send_receive(sock, subscribe2_packet, suback2_packet, "suback2") + + mosq_test.do_send_receive(sock, publish1_packet, publish1r_packet, "publish1") + mosq_test.do_send_receive(sock, publish2_packet, publish2r_packet, "publish2") + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-send-retain.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-send-retain.py new file mode 100755 index 0000000..6362f6f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-send-retain.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python3 + +# Test whether "send retain" subscribe options work +# MQTT v5 + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subpub-test", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid = 530 +subscribe1_packet = mosq_test.gen_subscribe(mid, "subpub/always", 0 | mqtt5_opts.MQTT_SUB_OPT_SEND_RETAIN_ALWAYS, proto_ver=5) +suback1_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + +mid = 531 +subscribe2_packet = mosq_test.gen_subscribe(mid, "subpub/new", 0 | mqtt5_opts.MQTT_SUB_OPT_SEND_RETAIN_NEW, proto_ver=5) +suback2_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + +mid = 532 +subscribe3_packet = mosq_test.gen_subscribe(mid, "subpub/never", 0 | mqtt5_opts.MQTT_SUB_OPT_SEND_RETAIN_NEVER, proto_ver=5) +suback3_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + + +publish1_packet = mosq_test.gen_publish("subpub/always", qos=0, retain=True, payload="message", proto_ver=5) +publish2_packet = mosq_test.gen_publish("subpub/new", qos=0, retain=True, payload="message", proto_ver=5) +publish3_packet = mosq_test.gen_publish("subpub/never", qos=0, retain=True, payload="message", proto_ver=5) + +publish1r1_packet = mosq_test.gen_publish("subpub/always", qos=0, retain=True, payload="message", proto_ver=5) +publish1r2_packet = mosq_test.gen_publish("subpub/always", qos=0, retain=True, payload="message", proto_ver=5) +publish2r1_packet = mosq_test.gen_publish("subpub/new", qos=0, retain=True, payload="message", proto_ver=5) +publish2r2_packet = mosq_test.gen_publish("subpub/new", qos=0, retain=False, payload="message", proto_ver=5) +publish3r1_packet = mosq_test.gen_publish("subpub/never", qos=0, retain=False, payload="message", proto_ver=5) +publish3r2_packet = mosq_test.gen_publish("subpub/never", qos=0, retain=False, payload="message", proto_ver=5) + + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=5, port=port) + + sock.send(publish1_packet) + sock.send(publish2_packet) + sock.send(publish3_packet) + + # Don't expect a message after this + mosq_test.do_send_receive(sock, subscribe3_packet, suback3_packet, "suback3") + # Don't expect a message after this + mosq_test.do_send_receive(sock, subscribe3_packet, suback3_packet, "suback3") + + # Expect a message after this, because it is the first subscribe + mosq_test.do_send_receive(sock, subscribe2_packet, suback2_packet, "suback2") + if mosq_test.expect_packet(sock, "publish2r1", publish2r1_packet): + # Don't expect a message after this, it is the second subscribe + mosq_test.do_send_receive(sock, subscribe2_packet, suback2_packet, "suback2") + + # Always expect a message after this + mosq_test.do_send_receive(sock, subscribe1_packet, suback1_packet, "suback1") + if mosq_test.expect_packet(sock, "publish1r1", publish1r1_packet): + # Always expect a message after this + mosq_test.do_send_receive(sock, subscribe1_packet, suback1_packet, "suback1") + if mosq_test.expect_packet(sock, "publish1r1", publish1r2_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-subscription-id.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-subscription-id.py new file mode 100755 index 0000000..a7ecbc8 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-subscription-id.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python3 + +# Does setting and updating subscription identifiers work as expected? +# MQTT v5 + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subpub-test", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid = 1 +props = mqtt5_props.gen_varint_prop(mqtt5_props.PROP_SUBSCRIPTION_IDENTIFIER, 1) +subscribe1_packet = mosq_test.gen_subscribe(mid, "subpub/id1", 0, proto_ver=5, properties=props) +suback1_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + +mid = 2 +props = mqtt5_props.gen_varint_prop(mqtt5_props.PROP_SUBSCRIPTION_IDENTIFIER, 14) +subscribe2_packet = mosq_test.gen_subscribe(mid, "subpub/+/id2", 0, proto_ver=5, properties=props) +suback2_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + +mid = 3 +subscribe3_packet = mosq_test.gen_subscribe(mid, "subpub/noid", 0, proto_ver=5) +suback3_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + +# Updated version of subscribe1, now without a subscription identifier +mid = 4 +subscribe1u_packet = mosq_test.gen_subscribe(mid, "subpub/id1", 0, proto_ver=5) +suback1u_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + +# Updated version of subscribe2, with a new subscription identifier +mid = 5 +props = mqtt5_props.gen_varint_prop(mqtt5_props.PROP_SUBSCRIPTION_IDENTIFIER, 19) +subscribe2u_packet = mosq_test.gen_subscribe(mid, "subpub/+/id2", 0, proto_ver=5, properties=props) +suback2u_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + +# Updated version of subscribe3, now with a subscription identifier +mid = 6 +props = mqtt5_props.gen_varint_prop(mqtt5_props.PROP_SUBSCRIPTION_IDENTIFIER, 21) +subscribe3u_packet = mosq_test.gen_subscribe(mid, "subpub/noid", 0, proto_ver=5, properties=props) +suback3u_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + + +publish1_packet = mosq_test.gen_publish("subpub/id1", qos=0, payload="message1", proto_ver=5) + +props = mqtt5_props.gen_varint_prop(mqtt5_props.PROP_SUBSCRIPTION_IDENTIFIER, 1) +publish1r_packet = mosq_test.gen_publish("subpub/id1", qos=0, payload="message1", proto_ver=5, properties=props) + +publish2_packet = mosq_test.gen_publish("subpub/test/id2", qos=0, payload="message2", proto_ver=5) +props = mqtt5_props.gen_varint_prop(mqtt5_props.PROP_SUBSCRIPTION_IDENTIFIER, 14) +publish2r_packet = mosq_test.gen_publish("subpub/test/id2", qos=0, payload="message2", proto_ver=5, properties=props) + +publish3_packet = mosq_test.gen_publish("subpub/noid", qos=0, payload="message3", proto_ver=5) + + +# Updated version of publish1r, now with no id +publish1ru_packet = mosq_test.gen_publish("subpub/id1", qos=0, payload="message1", proto_ver=5) + +# Updated verison of publish2r, with updated id +props = mqtt5_props.gen_varint_prop(mqtt5_props.PROP_SUBSCRIPTION_IDENTIFIER, 19) +publish2ru_packet = mosq_test.gen_publish("subpub/test/id2", qos=0, payload="message2", proto_ver=5, properties=props) + +# Updated version of publish3r, now with an id +props = mqtt5_props.gen_varint_prop(mqtt5_props.PROP_SUBSCRIPTION_IDENTIFIER, 21) +publish3ru_packet = mosq_test.gen_publish("subpub/noid", qos=0, payload="message3", proto_ver=5, properties=props) + + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + + mosq_test.do_send_receive(sock, subscribe1_packet, suback1_packet, "suback1") + mosq_test.do_send_receive(sock, subscribe2_packet, suback2_packet, "suback2") + mosq_test.do_send_receive(sock, subscribe3_packet, suback3_packet, "suback3") + + mosq_test.do_send_receive(sock, publish3_packet, publish3_packet, "publish3") + mosq_test.do_send_receive(sock, publish2_packet, publish2r_packet, "publish2") + mosq_test.do_send_receive(sock, publish1_packet, publish1r_packet, "publish1") + + # Now update the subscription identifiers + mosq_test.do_send_receive(sock, subscribe1u_packet, suback1u_packet, "suback1u") + mosq_test.do_send_receive(sock, subscribe2u_packet, suback2u_packet, "suback2u") + mosq_test.do_send_receive(sock, subscribe3u_packet, suback3u_packet, "suback3u") + + mosq_test.do_send_receive(sock, publish2_packet, publish2ru_packet, "publish2u") + mosq_test.do_send_receive(sock, publish3_packet, publish3ru_packet, "publish3u") + mosq_test.do_send_receive(sock, publish1_packet, publish1ru_packet, "publish1u") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-topic-alias-unknown.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-topic-alias-unknown.py new file mode 100755 index 0000000..3bb04a8 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-topic-alias-unknown.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 + +# Test whether "topic alias" works to the broker +# MQTT v5 + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("sub-test", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_TOPIC_ALIAS, 3) +publish1_packet = mosq_test.gen_publish("", qos=0, payload="message", proto_ver=5, properties=props) + +disconnect_packet = mosq_test.gen_disconnect(reason_code=148, proto_ver=5) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=5, port=port) + sock.send(publish1_packet) + + if mosq_test.expect_packet(sock, "disconnect", disconnect_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-topic-alias.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-topic-alias.py new file mode 100755 index 0000000..e57b7df --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-topic-alias.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 + +# Test whether "topic alias" works to the broker +# MQTT v5 + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect1_packet = mosq_test.gen_connect("sub-test", keepalive=keepalive, proto_ver=5) +connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +connect2_packet = mosq_test.gen_connect("pub-test", keepalive=keepalive, proto_ver=5) +connack2_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/alias", 0, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + +props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_TOPIC_ALIAS, 3) +publish1_packet = mosq_test.gen_publish("subpub/alias", qos=0, payload="message", proto_ver=5, properties=props) + +props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_TOPIC_ALIAS, 3) +publish2s_packet = mosq_test.gen_publish("", qos=0, payload="message", proto_ver=5, properties=props) +publish2r_packet = mosq_test.gen_publish("subpub/alias", qos=0, payload="message", proto_ver=5) + + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock1 = mosq_test.do_client_connect(connect1_packet, connack1_packet, timeout=5, port=port) + sock2 = mosq_test.do_client_connect(connect2_packet, connack2_packet, timeout=5, port=port) + + sock1.send(publish1_packet) + + mosq_test.do_send_receive(sock2, subscribe_packet, suback_packet, "suback") + + sock1.send(publish2s_packet) + + if mosq_test.expect_packet(sock2, "publish2r", publish2r_packet): + rc = 0 + + sock1.close() + sock2.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-v5.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-v5.py new file mode 100755 index 0000000..7d6c3b5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0-v5.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 + +# Test whether a client subscribed to a topic receives its own message sent to that topic. +# MQTT v5 + +from mosq_test_helper import * + +rc = 1 +mid = 53 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subpub-qos0-test", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos0", 0, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + +publish_packet = mosq_test.gen_publish("subpub/qos0", qos=0, payload="message", proto_ver=5) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + mosq_test.do_send_receive(sock, publish_packet, publish_packet, "publish") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0.py new file mode 100755 index 0000000..1c42dbd --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos0.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +# Test whether a client subscribed to a topic receives its own message sent to that topic. + +from mosq_test_helper import * + +rc = 1 +mid = 53 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subpub-qos0-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos0", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +publish_packet = mosq_test.gen_publish("subpub/qos0", qos=0, payload="message") + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + mosq_test.do_send_receive(sock, publish_packet, publish_packet, "publish") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-bad-pubcomp.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-bad-pubcomp.py new file mode 100755 index 0000000..30000da --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-bad-pubcomp.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python3 + +# Test what the broker does if receiving a PUBCOMP in response to a QoS 1 PUBLISH. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 + +connect_packet = mosq_test.gen_connect("subpub-qos1-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos1", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +mid = 1 +publish_packet2 = mosq_test.gen_publish("subpub/qos1", qos=1, mid=mid, payload="message") + + +helper_connect = mosq_test.gen_connect("helper", keepalive=keepalive) +helper_connack = mosq_test.gen_connack(rc=0) + +mid = 1 +publish1s_packet = mosq_test.gen_publish("subpub/qos1", qos=1, mid=mid, payload="message") +puback1s_packet = mosq_test.gen_puback(mid) + +mid = 1 +publish1r_packet = mosq_test.gen_publish("subpub/qos1", qos=1, mid=mid, payload="message") +pubcomp1r_packet = mosq_test.gen_pubcomp(mid) + +pingreq_packet = mosq_test.gen_pingreq() +pingresp_packet = mosq_test.gen_pingresp() + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + helper = mosq_test.do_client_connect(helper_connect, helper_connack, timeout=20, port=port) + mosq_test.do_send_receive(helper, publish1s_packet, puback1s_packet, "puback 1s") + helper.close() + + if mosq_test.expect_packet(sock, "publish 1r", publish1r_packet): + sock.send(pubcomp1r_packet) + sock.send(pingreq_packet) + p = sock.recv(len(pingresp_packet)) + if len(p) == 0: + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-bad-pubrec.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-bad-pubrec.py new file mode 100755 index 0000000..f7d416e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-bad-pubrec.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python3 + +# Test what the broker does if receiving a PUBREC in response to a QoS 1 PUBLISH. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 + +connect_packet = mosq_test.gen_connect("subpub-qos1-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos1", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +helper_connect = mosq_test.gen_connect("helper", keepalive=keepalive) +helper_connack = mosq_test.gen_connack(rc=0) + +mid = 1 +publish1s_packet = mosq_test.gen_publish("subpub/qos1", qos=1, mid=mid, payload="message") +puback1s_packet = mosq_test.gen_puback(mid) + +mid = 1 +publish1r_packet = mosq_test.gen_publish("subpub/qos1", qos=1, mid=mid, payload="message") +pubrec1r_packet = mosq_test.gen_pubrec(mid) + +pingreq_packet = mosq_test.gen_pingreq() +pingresp_packet = mosq_test.gen_pingresp() + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + helper = mosq_test.do_client_connect(helper_connect, helper_connack, timeout=20, port=port) + mosq_test.do_send_receive(helper, publish1s_packet, puback1s_packet, "puback 1s") + helper.close() + + if mosq_test.expect_packet(sock, "publish 1r", publish1r_packet): + sock.send(pubrec1r_packet) + sock.send(pingreq_packet) + p = sock.recv(len(pingresp_packet)) + if len(p) == 0: + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-message-expiry-retain.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-message-expiry-retain.py new file mode 100755 index 0000000..6974a50 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-message-expiry-retain.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3 + +# Test whether the broker reduces the message expiry interval when republishing +# a retained message, and eventually removes it. +# MQTT v5 + +# Helper publishes a message, with a medium length expiry with retained set. It +# publishes a second message with retained set but no expiry. +# Client connects, subscribes, gets messages, disconnects. +# We wait until the expiry will have expired. +# Client connects, subscribes, doesn't get expired message, does get +# non-expired message. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subpub", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid = 1 +subscribe1_packet = mosq_test.gen_subscribe(mid, "subpub/expired", 1, proto_ver=5) +suback1_packet = mosq_test.gen_suback(mid, 1, proto_ver=5) + +mid = 2 +subscribe2_packet = mosq_test.gen_subscribe(mid, "subpub/kept", 1, proto_ver=5) +suback2_packet = mosq_test.gen_suback(mid, 1, proto_ver=5) + +helper_connect = mosq_test.gen_connect("helper", proto_ver=5) +helper_connack = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid=1 +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MESSAGE_EXPIRY_INTERVAL, 4) +publish1_packet = mosq_test.gen_publish("subpub/expired", mid=mid, qos=1, retain=True, payload="message1", proto_ver=5, properties=props) +puback1_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS) + +mid=2 +publish2s_packet = mosq_test.gen_publish("subpub/kept", mid=mid, qos=1, retain=True, payload="message2", proto_ver=5) +puback2s_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS) + +mid=1 +publish2r_packet = mosq_test.gen_publish("subpub/kept", mid=mid, qos=1, retain=True, payload="message2", proto_ver=5) +puback2r_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS) + + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + helper = mosq_test.do_client_connect(helper_connect, helper_connack, timeout=20, port=port) + mosq_test.do_send_receive(helper, publish1_packet, puback1_packet, "puback 1") + mosq_test.do_send_receive(helper, publish2s_packet, puback2s_packet, "puback 2") + helper.close() + + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe1_packet, suback1_packet, "suback 1-1") + + if mosq_test.expect_packet(sock, "publish 1", publish1_packet): + sock.send(puback1_packet) + + mosq_test.do_send_receive(sock, subscribe2_packet, suback2_packet, "suback 2-1") + if mosq_test.expect_packet(sock, "publish 2", publish2s_packet): + sock.send(puback2s_packet) + + sock.close() + + time.sleep(5) + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe1_packet, suback1_packet, "suback 1-2") + # We shouldn't receive a publish here + # This will fail if we do receive a publish + mosq_test.do_send_receive(sock, subscribe2_packet, suback2_packet, "suback 2-2") + if mosq_test.expect_packet(sock, "publish 2", publish2r_packet): + sock.send(puback2r_packet) + sock.close() + rc = 0 + +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-message-expiry-will.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-message-expiry-will.py new file mode 100755 index 0000000..cf64ad0 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-message-expiry-will.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python3 + +# Test whether the broker reduces the message expiry interval when republishing a will. +# MQTT v5 + +# Client connects with clean session set false, subscribes with qos=1, then disconnects +# Helper publishes two messages, one with a short expiry and one with a long expiry +# We wait until the short expiry will have expired but the long one not. +# Client reconnects, expects delivery of the long expiry message with a reduced +# expiry interval property. + +from mosq_test_helper import * + +rc = 1 +mid = 53 +keepalive = 60 +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 60) +connect_packet = mosq_test.gen_connect("subpub-qos0-test", keepalive=keepalive, proto_ver=5, clean_session=False, properties=props) +connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=5) +connack2_packet = mosq_test.gen_connack(rc=0, proto_ver=5, flags=1) + +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos1", 1, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid, 1, proto_ver=5) + + +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MESSAGE_EXPIRY_INTERVAL, 10) +helper_connect = mosq_test.gen_connect("helper", proto_ver=5, will_topic="subpub/qos1", will_qos=1, will_payload=b"message", will_properties=props, keepalive=2) +helper_connack = mosq_test.gen_connack(rc=0, proto_ver=5) + +#mid=2 +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MESSAGE_EXPIRY_INTERVAL, 10) +publish2s_packet = mosq_test.gen_publish("subpub/qos1", mid=mid, qos=1, payload="message2", proto_ver=5, properties=props) +puback2s_packet = mosq_test.gen_puback(mid) + + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack1_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + sock.close() + + helper = mosq_test.do_client_connect(helper_connect, helper_connack, timeout=20, port=port) + + time.sleep(2) + + sock = mosq_test.do_client_connect(connect_packet, connack2_packet, timeout=20, port=port) + packet = sock.recv(len(publish2s_packet)) + for i in range(10, 5, -1): + props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MESSAGE_EXPIRY_INTERVAL, i) + publish2r_packet = mosq_test.gen_publish("subpub/qos1", mid=1, qos=1, payload="message", proto_ver=5, properties=props) + if packet == publish2r_packet: + rc = 0 + break + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-message-expiry.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-message-expiry.py new file mode 100755 index 0000000..27c7b27 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-message-expiry.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python3 + +# Test whether the broker reduces the message expiry interval when republishing. +# MQTT v5 + +# Client connects with clean session set false, subscribes with qos=1, then disconnects +# Helper publishes two messages, one with a short expiry and one with a long expiry +# We wait until the short expiry will have expired but the long one not. +# Client reconnects, expects delivery of the long expiry message with a reduced +# expiry interval property. + +from mosq_test_helper import * + +rc = 1 +mid = 53 +keepalive = 60 +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 60) +connect_packet = mosq_test.gen_connect("subpub-qos0-test", keepalive=keepalive, proto_ver=5, clean_session=False, properties=props) +connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=5) +connack2_packet = mosq_test.gen_connack(rc=0, proto_ver=5, flags=1) + +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos1", 1, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid, 1, proto_ver=5) + + + +helper_connect = mosq_test.gen_connect("helper", proto_ver=5) +helper_connack = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid=1 +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MESSAGE_EXPIRY_INTERVAL, 1) +publish1s_packet = mosq_test.gen_publish("subpub/qos1", mid=mid, qos=1, payload="message1", proto_ver=5, properties=props) +puback1s_packet = mosq_test.gen_puback(mid) + +mid=2 +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MESSAGE_EXPIRY_INTERVAL, 10) +publish2s_packet = mosq_test.gen_publish("subpub/qos1", mid=mid, qos=1, payload="message2", proto_ver=5, properties=props) +puback2s_packet = mosq_test.gen_puback(mid) + + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack1_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + sock.close() + + helper = mosq_test.do_client_connect(helper_connect, helper_connack, timeout=20, port=port) + mosq_test.do_send_receive(helper, publish1s_packet, puback1s_packet, "puback 1") + mosq_test.do_send_receive(helper, publish2s_packet, puback2s_packet, "puback 2") + + time.sleep(2) + + sock = mosq_test.do_client_connect(connect_packet, connack2_packet, timeout=20, port=port) + packet = sock.recv(len(publish2s_packet)) + for i in range(9, 5, -1): + props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MESSAGE_EXPIRY_INTERVAL, i) + publish2r_packet = mosq_test.gen_publish("subpub/qos1", mid=2, qos=1, payload="message2", proto_ver=5, properties=props) + if packet == publish2r_packet: + rc = 0 + break + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-nolocal.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-nolocal.py new file mode 100755 index 0000000..b4f20ae --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-nolocal.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python3 + +# Test whether a client subscribed to a topic does not receive its own message +# sent to that topic if no local is set. +# MQTT v5 + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subpub-qos1-test", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid = 530 +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos1", 1 | mqtt5_opts.MQTT_SUB_OPT_NO_LOCAL, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid, 1, proto_ver=5) + +mid = 531 +subscribe2_packet = mosq_test.gen_subscribe(mid, "subpub/receive", 1, proto_ver=5) +suback2_packet = mosq_test.gen_suback(mid, 1, proto_ver=5) + +mid = 300 +publish_packet = mosq_test.gen_publish("subpub/qos1", qos=1, mid=mid, payload="message", proto_ver=5) +puback_packet = mosq_test.gen_puback(mid, proto_ver=5) + +mid = 301 +publish2_packet = mosq_test.gen_publish("subpub/receive", qos=1, mid=mid, payload="success", proto_ver=5) +puback2_packet = mosq_test.gen_puback(mid, proto_ver=5) + +mid = 1 +publish3_packet = mosq_test.gen_publish("subpub/receive", qos=1, mid=mid, payload="success", proto_ver=5) + + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + mosq_test.do_send_receive(sock, subscribe2_packet, suback2_packet, "suback2") + + mosq_test.do_send_receive(sock, publish_packet, puback_packet, "puback") + mosq_test.do_send_receive(sock, publish2_packet, puback2_packet, "puback2") + + if mosq_test.expect_packet(sock, "publish3", publish3_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-v5.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-v5.py new file mode 100755 index 0000000..ecddfde --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1-v5.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 + +# Test whether a client subscribed to a topic receives its own message sent to that topic. +# MQTT v5 + +from mosq_test_helper import * + +rc = 1 +mid = 530 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subpub-qos1-test", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos1", 1, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid, 1, proto_ver=5) + +mid = 300 +publish_packet = mosq_test.gen_publish("subpub/qos1", qos=1, mid=mid, payload="message", proto_ver=5) +puback_packet = mosq_test.gen_puback(mid, proto_ver=5) + +mid = 1 +publish_packet2 = mosq_test.gen_publish("subpub/qos1", qos=1, mid=mid, payload="message", proto_ver=5) + + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + mosq_test.do_send_receive(sock, publish_packet, puback_packet, "puback") + + if mosq_test.expect_packet(sock, "publish2", publish_packet2): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1.py new file mode 100755 index 0000000..268dc37 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos1.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 + +# Test whether a client subscribed to a topic receives its own message sent to that topic. + +from mosq_test_helper import * + +rc = 1 +mid = 530 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subpub-qos1-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos1", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +mid = 300 +publish_packet = mosq_test.gen_publish("subpub/qos1", qos=1, mid=mid, payload="message") +puback_packet = mosq_test.gen_puback(mid) + +mid = 1 +publish_packet2 = mosq_test.gen_publish("subpub/qos1", qos=1, mid=mid, payload="message") + + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + mosq_test.do_send_receive(sock, publish_packet, puback_packet, "puback") + + if mosq_test.expect_packet(sock, "publish2", publish_packet2): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-bad-puback-1.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-bad-puback-1.py new file mode 100755 index 0000000..dd4bb7f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-bad-puback-1.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 + +# Test what the broker does if receiving a PUBACK in response to a QoS 2 PUBLISH. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 + +connect_packet = mosq_test.gen_connect("subpub-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos2", 2) +suback_packet = mosq_test.gen_suback(mid, 2) + +helper_connect = mosq_test.gen_connect("helper", keepalive=keepalive) +helper_connack = mosq_test.gen_connack(rc=0) + +mid = 1 +publish1s_packet = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message") +pubrec1s_packet = mosq_test.gen_pubrec(mid) +pubrel1s_packet = mosq_test.gen_pubrel(mid) +pubcomp1s_packet = mosq_test.gen_pubcomp(mid) + +mid = 1 +publish1r_packet = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message") +puback1r_packet = mosq_test.gen_puback(mid) + +pingreq_packet = mosq_test.gen_pingreq() +pingresp_packet = mosq_test.gen_pingresp() + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + helper = mosq_test.do_client_connect(helper_connect, helper_connack, timeout=20, port=port) + mosq_test.do_send_receive(helper, publish1s_packet, pubrec1s_packet, "pubrec 1s") + mosq_test.do_send_receive(helper, pubrel1s_packet, pubcomp1s_packet, "pubcomp 1s") + helper.close() + + if mosq_test.expect_packet(sock, "publish 1r", publish1r_packet): + sock.send(puback1r_packet) + sock.send(pingreq_packet) + p = sock.recv(len(pingresp_packet)) + if len(p) == 0: + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-bad-puback-2.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-bad-puback-2.py new file mode 100755 index 0000000..41bcc77 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-bad-puback-2.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python3 + +# Test what the broker does if receiving a PUBACK in response to a QoS 2 PUBREL. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 + +connect_packet = mosq_test.gen_connect("subpub-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos2", 2) +suback_packet = mosq_test.gen_suback(mid, 2) + +helper_connect = mosq_test.gen_connect("helper", keepalive=keepalive) +helper_connack = mosq_test.gen_connack(rc=0) + +mid = 1 +publish1s_packet = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message") +pubrec1s_packet = mosq_test.gen_pubrec(mid) +pubrel1s_packet = mosq_test.gen_pubrel(mid) +pubcomp1s_packet = mosq_test.gen_pubcomp(mid) + +mid = 1 +publish1r_packet = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message") +pubrec1r_packet = mosq_test.gen_pubrec(mid) +pubrel1r_packet = mosq_test.gen_pubrel(mid) +puback1r_packet = mosq_test.gen_puback(mid) + +pingreq_packet = mosq_test.gen_pingreq() +pingresp_packet = mosq_test.gen_pingresp() + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + helper = mosq_test.do_client_connect(helper_connect, helper_connack, timeout=20, port=port) + mosq_test.do_send_receive(helper, publish1s_packet, pubrec1s_packet, "pubrec 1s") + mosq_test.do_send_receive(helper, pubrel1s_packet, pubcomp1s_packet, "pubcomp 1s") + helper.close() + + if mosq_test.expect_packet(sock, "publish 1r", publish1r_packet): + mosq_test.do_send_receive(sock, pubrec1s_packet, pubrel1s_packet, "pubrel 1r") + sock.send(puback1r_packet) + sock.send(pingreq_packet) + p = sock.recv(len(pingresp_packet)) + if len(p) == 0: + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-bad-pubcomp.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-bad-pubcomp.py new file mode 100755 index 0000000..0b841be --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-bad-pubcomp.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 + +# Test what the broker does if receiving a PUBCOMP in response to a QoS 2 PUBLISH. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 + +connect_packet = mosq_test.gen_connect("subpub-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos2", 2) +suback_packet = mosq_test.gen_suback(mid, 2) + +helper_connect = mosq_test.gen_connect("helper", keepalive=keepalive) +helper_connack = mosq_test.gen_connack(rc=0) + +mid = 1 +publish1s_packet = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message") +pubrec1s_packet = mosq_test.gen_pubrec(mid) +pubrel1s_packet = mosq_test.gen_pubrel(mid) +pubcomp1s_packet = mosq_test.gen_pubcomp(mid) + +mid = 1 +publish1r_packet = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message") +pubcomp1r_packet = mosq_test.gen_pubcomp(mid) + +pingreq_packet = mosq_test.gen_pingreq() +pingresp_packet = mosq_test.gen_pingresp() + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + helper = mosq_test.do_client_connect(helper_connect, helper_connack, timeout=20, port=port) + mosq_test.do_send_receive(helper, publish1s_packet, pubrec1s_packet, "pubrec 1s") + mosq_test.do_send_receive(helper, pubrel1s_packet, pubcomp1s_packet, "pubcomp 1s") + helper.close() + + if mosq_test.expect_packet(sock, "publish 1r", publish1r_packet): + sock.send(pubcomp1r_packet) + sock.send(pingreq_packet) + p = sock.recv(len(pingresp_packet)) + if len(p) == 0: + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-pubrec-error-helper.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-pubrec-error-helper.py new file mode 100755 index 0000000..721236b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-pubrec-error-helper.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +publish_1_packet = mosq_test.gen_publish("qos2/pubrec/rejected", qos=2, mid=mid, payload="rejected-message") +pubrec_1_packet = mosq_test.gen_pubrec(mid) +pubrel_1_packet = mosq_test.gen_pubrel(mid) +pubcomp_1_packet = mosq_test.gen_pubcomp(mid) + +mid = 2 +publish_2_packet = mosq_test.gen_publish("qos2/pubrec/accepted", qos=2, mid=mid, payload="accepted-message") +pubrec_2_packet = mosq_test.gen_pubrec(mid) +pubrel_2_packet = mosq_test.gen_pubrel(mid) +pubcomp_2_packet = mosq_test.gen_pubcomp(mid) + +port = mosq_test.get_port() +sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack", port=port) + +mosq_test.do_send_receive(sock, publish_1_packet, pubrec_1_packet, "helper pubrec") +mosq_test.do_send_receive(sock, pubrel_1_packet, pubcomp_1_packet, "helper pubcomp") + +mosq_test.do_send_receive(sock, publish_2_packet, pubrec_2_packet, "helper pubrec") +mosq_test.do_send_receive(sock, pubrel_2_packet, pubcomp_2_packet, "helper pubcomp") + +rc = 0 + +sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-pubrec-error.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-pubrec-error.py new file mode 100755 index 0000000..05eae9c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-pubrec-error.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 + +# Test whether a PUBREC with reason code >= 0x80 is handled correctly + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("pub-qo2-timeout-test", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "qos2/pubrec/+", 2, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid, 2, proto_ver=5) + +mid = 1 +publish_1_packet = mosq_test.gen_publish("qos2/pubrec/rejected", qos=2, mid=mid, payload="rejected-message", proto_ver=5) +pubrec_1_packet = mosq_test.gen_pubrec(mid, proto_ver=5, reason_code=0x80) + +mid = 2 +publish_2_packet = mosq_test.gen_publish("qos2/pubrec/accepted", qos=2, mid=mid, payload="accepted-message", proto_ver=5) +pubrec_2_packet = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_2_packet = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_2_packet = mosq_test.gen_pubcomp(mid, proto_ver=5) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + pub = subprocess.Popen(['./02-subpub-qos2-pubrec-error-helper.py', str(port)], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + pub.wait() + (stdo, stde) = pub.communicate() + # Should have now received a publish command + + if mosq_test.expect_packet(sock, "publish 1", publish_1_packet): + sock.send(pubrec_1_packet) + + if mosq_test.expect_packet(sock, "publish 2", publish_2_packet): + mosq_test.do_send_receive(sock, pubrec_2_packet, pubrel_2_packet, "pubrel 2") + sock.send(pubcomp_2_packet) + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-receive-maximum-1.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-receive-maximum-1.py new file mode 100755 index 0000000..ba0c8d6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-receive-maximum-1.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 + +# Does the broker respect receive maximum==1? +# MQTT v5 + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_RECEIVE_MAXIMUM, 1) +connect_packet = mosq_test.gen_connect("subpub-qos2-test", keepalive=keepalive, proto_ver=5, properties=props) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos2", 2, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid, 2, proto_ver=5) + +mid = 1 +publish_packet1 = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message1", proto_ver=5) +pubrec_packet1 = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_packet1 = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_packet1 = mosq_test.gen_pubcomp(mid, proto_ver=5) + +mid = 2 +publish_packet2 = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message2", proto_ver=5) +pubrec_packet2 = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_packet2 = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_packet2 = mosq_test.gen_pubcomp(mid, proto_ver=5) + +mid = 3 +publish_packet3 = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message3", proto_ver=5) +pubrec_packet3 = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_packet3 = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_packet3 = mosq_test.gen_pubcomp(mid, proto_ver=5) + + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + pub = subprocess.Popen(['./02-subpub-qos2-receive-maximum-helper.py', str(port)], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + pub.wait() + (stdo, stde) = pub.communicate() + + if mosq_test.expect_packet(sock, "publish1", publish_packet1): + mosq_test.do_send_receive(sock, pubrec_packet1, pubrel_packet1, "pubrel1") + sock.send(pubcomp_packet1) + + if mosq_test.expect_packet(sock, "publish2", publish_packet2): + mosq_test.do_send_receive(sock, pubrec_packet2, pubrel_packet2, "pubrel2") + sock.send(pubcomp_packet2) + + if mosq_test.expect_packet(sock, "publish3", publish_packet3): + mosq_test.do_send_receive(sock, pubrec_packet3, pubrel_packet3, "pubrel3") + sock.send(pubcomp_packet3) + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-receive-maximum-2.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-receive-maximum-2.py new file mode 100755 index 0000000..f475b19 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-receive-maximum-2.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 + +# Does the broker respect receive maximum==2? +# MQTT v5 + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_RECEIVE_MAXIMUM, 2) +connect_packet = mosq_test.gen_connect("subpub-qos2-test", keepalive=keepalive, proto_ver=5, properties=props) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos2", 2, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid, 2, proto_ver=5) + +mid = 1 +publish_packet1 = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message1", proto_ver=5) +pubrec_packet1 = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_packet1 = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_packet1 = mosq_test.gen_pubcomp(mid, proto_ver=5) + +mid = 2 +publish_packet2 = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message2", proto_ver=5) +pubrec_packet2 = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_packet2 = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_packet2 = mosq_test.gen_pubcomp(mid, proto_ver=5) + +mid = 3 +publish_packet3 = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message3", proto_ver=5) +pubrec_packet3 = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_packet3 = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_packet3 = mosq_test.gen_pubcomp(mid, proto_ver=5) + + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + pub = subprocess.Popen(['./02-subpub-qos2-receive-maximum-helper.py', str(port)], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + pub.wait() + (stdo, stde) = pub.communicate() + + if mosq_test.expect_packet(sock, "publish1", publish_packet1): + if mosq_test.expect_packet(sock, "publish2", publish_packet2): + mosq_test.do_send_receive(sock, pubrec_packet1, pubrel_packet1, "pubrel1") + sock.send(pubcomp_packet1) + + if mosq_test.expect_packet(sock, "publish3", publish_packet3): + mosq_test.do_send_receive(sock, pubrec_packet2, pubrel_packet2, "pubrel2") + sock.send(pubcomp_packet2) + + mosq_test.do_send_receive(sock, pubrec_packet3, pubrel_packet3, "pubrel3") + sock.send(pubcomp_packet3) + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-receive-maximum-helper.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-receive-maximum-helper.py new file mode 100755 index 0000000..14e8f8a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-receive-maximum-helper.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 + +# Test whether a client subscribed to a topic receives its own message sent to that topic. +# MQTT v5 + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subpub-qos2-test-helper", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid = 1 +publish_packet = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message1", proto_ver=5) +pubrec_packet = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_packet = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_packet = mosq_test.gen_pubcomp(mid, proto_ver=5) + +mid = 2 +publish_packet2 = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message2", proto_ver=5) +pubrec_packet2 = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_packet2 = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_packet2 = mosq_test.gen_pubcomp(mid, proto_ver=5) + +mid = 3 +publish_packet3 = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message3", proto_ver=5) +pubrec_packet3 = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_packet3 = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_packet3 = mosq_test.gen_pubcomp(mid, proto_ver=5) + + +port = mosq_test.get_port() + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + + mosq_test.do_send_receive(sock, publish_packet, pubrec_packet, "pubrec") + mosq_test.do_send_receive(sock, pubrel_packet, pubcomp_packet, "pubcomp") + + mosq_test.do_send_receive(sock, publish_packet2, pubrec_packet2, "pubrec2") + mosq_test.do_send_receive(sock, pubrel_packet2, pubcomp_packet2, "pubcomp2") + + mosq_test.do_send_receive(sock, publish_packet3, pubrec_packet3, "pubrec3") + mosq_test.do_send_receive(sock, pubrel_packet3, pubcomp_packet3, "pubcomp3") + rc = 0 + + sock.close() +finally: + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-v5.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-v5.py new file mode 100755 index 0000000..559a632 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2-v5.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 + +# Test whether a client subscribed to a topic receives its own message sent to that topic. +# MQTT v5 + +from mosq_test_helper import * + +rc = 1 +mid = 530 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subpub-qos2-test", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos2", 2, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid, 2, proto_ver=5) + +mid = 301 +publish_packet = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message", proto_ver=5) +pubrec_packet = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_packet = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_packet = mosq_test.gen_pubcomp(mid, proto_ver=5) + +mid = 1 +publish_packet2 = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message", proto_ver=5) +pubrec_packet2 = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_packet2 = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_packet2 = mosq_test.gen_pubcomp(mid, proto_ver=5) + + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + mosq_test.do_send_receive(sock, publish_packet, pubrec_packet, "pubrec") + mosq_test.do_send_receive(sock, pubrel_packet, pubcomp_packet, "pubcomp") + + if mosq_test.expect_packet(sock, "publish2", publish_packet2): + mosq_test.do_send_receive(sock, pubrec_packet2, pubrel_packet2, "pubrel2") + # Broker side of flow complete so can quit here. + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2.py new file mode 100755 index 0000000..260e2eb --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subpub-qos2.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 + +# Test whether a client subscribed to a topic receives its own message sent to that topic. + +from mosq_test_helper import * + +rc = 1 +mid = 530 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subpub-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos2", 2) +suback_packet = mosq_test.gen_suback(mid, 2) + +mid = 301 +publish_packet = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message") +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +mid = 1 +publish_packet2 = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message") +pubrec_packet2 = mosq_test.gen_pubrec(mid) +pubrel_packet2 = mosq_test.gen_pubrel(mid) +pubcomp_packet2 = mosq_test.gen_pubcomp(mid) + + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + mosq_test.do_send_receive(sock, publish_packet, pubrec_packet, "pubrec") + mosq_test.do_send_receive(sock, pubrel_packet, pubcomp_packet, "pubcomp") + + if mosq_test.expect_packet(sock, "publish2", publish_packet2): + mosq_test.do_send_receive(sock, pubrec_packet2, pubrel_packet2, "pubrel2") + # Broker side of flow complete so can quit here. + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-dollar-v5.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-dollar-v5.py new file mode 100755 index 0000000..574fac0 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-dollar-v5.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 + +# Test whether a SUBSCRIBE to $SYS or $share succeeds + +from mosq_test_helper import * + +def do_test(proto_ver): + rc = 1 + keepalive = 60 + connect_packet = mosq_test.gen_connect("subscribe-test", keepalive=keepalive, proto_ver=proto_ver) + connack_packet = mosq_test.gen_connack(rc=0, proto_ver=proto_ver) + + mid = 1 + subscribe1_packet = mosq_test.gen_subscribe(mid, "$SYS/broker/missing", 0, proto_ver=proto_ver) + suback1_packet = mosq_test.gen_suback(mid, 0, proto_ver=proto_ver) + + mid = 2 + subscribe2_packet = mosq_test.gen_subscribe(mid, "$share/share/#", 0, proto_ver=proto_ver) + suback2_packet = mosq_test.gen_suback(mid, 0, proto_ver=proto_ver) + + port = mosq_test.get_port() + broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + + try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, subscribe1_packet, suback1_packet, "suback1") + mosq_test.do_send_receive(sock, subscribe2_packet, suback2_packet, "suback2") + + rc = 0 + + sock.close() + finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + exit(rc) + +do_test(4) +do_test(5) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-invalid-utf8.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-invalid-utf8.py new file mode 100755 index 0000000..c5a961b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-invalid-utf8.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python3 + +# Test whether a SUBSCRIBE to a topic with an invalid UTF-8 topic fails + +from mosq_test_helper import * + +rc = 1 +mid = 53 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subscribe-invalid-utf8", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "invalid/utf8", 0) +b = list(struct.unpack("B"*len(subscribe_packet), subscribe_packet)) +b[13] = 0 # Topic should never have a 0x0000 +subscribe_packet = struct.pack("B"*len(b), *b) + +suback_packet = mosq_test.gen_suback(mid, 0) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + time.sleep(0.5) + + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, b"", "suback") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-persistence-flipflop.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-persistence-flipflop.py new file mode 100755 index 0000000..4fad088 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-persistence-flipflop.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 + +# Test switching between persistence and a clean session. +# +# Bug #874: +# +# +# mosquitto_sub -i sub -t 'topic' -v -p 29883 -q 1 -d -c +# ^C +# mosquitto_sub -i sub -t 'topic' -v -p 29883 -q 1 -d +# ^C +# +# SUBSCRIBE to topic is no longer respected by mosquitto +# +# run: +# +# mosquitto_sub -i sub -t 'topic' -v -p 29883 -q 1 -d -c +# +# and in a separate shell +# +# mosquitto_pub -i pub -t topic -m 'hello' -p 29883 -q 1 +# +# sub does not receive the message + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet_sub_persistent = mosq_test.gen_connect("flipflop-test", keepalive=keepalive, clean_session=False) +connect_packet_sub_clean = mosq_test.gen_connect("flipflop-test", keepalive=keepalive, clean_session=True) +connack_packet_sub = mosq_test.gen_connack(rc=0) + +connect_packet_pub = mosq_test.gen_connect("flipflop-test-pub", keepalive=keepalive) +connack_packet_pub = mosq_test.gen_connack(rc=0) + +mid=1 +subscribe_packet = mosq_test.gen_subscribe(mid, "flipflop/test", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +mid=1 +publish_packet = mosq_test.gen_publish("flipflop/test", qos=1, mid=mid, payload="message") +puback_packet = mosq_test.gen_puback(mid) + + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + # mosquitto_sub -i sub -t 'topic' -q 1 -d -c + sub_sock = mosq_test.do_client_connect(connect_packet_sub_persistent, connack_packet_sub, port=port) + mosq_test.do_send_receive(sub_sock, subscribe_packet, suback_packet, "subscribe persistent 1") + # And disconnect + sub_sock.close() + + # mosquitto_sub -i sub -t 'topic' -q 1 -d + sub_sock = mosq_test.do_client_connect(connect_packet_sub_clean, connack_packet_sub, port=port) + mosq_test.do_send_receive(sub_sock, subscribe_packet, suback_packet, "subscribe clean") + # And disconnect + sub_sock.close() + + # mosquitto_sub -i sub -t 'topic' -v -q 1 -d -c + sub_sock = mosq_test.do_client_connect(connect_packet_sub_persistent, connack_packet_sub, port=port) + mosq_test.do_send_receive(sub_sock, subscribe_packet, suback_packet, "subscribe persistent 2") + + # and in a separate shell + # + # mosquitto_pub -i pub -t topic -m 'hello' -p 29883 -q 1 + pub_sock = mosq_test.do_client_connect(connect_packet_pub, connack_packet_pub, port=port) + mosq_test.do_send_receive(pub_sock, publish_packet, puback_packet, "publish") + + if mosq_test.expect_packet(sub_sock, "publish receive", publish_packet): + rc = 0 + + sub_sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-qos0.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-qos0.py new file mode 100755 index 0000000..722f668 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-qos0.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python3 + +# Test whether a SUBSCRIBE to a topic with QoS 0 results in the correct SUBACK packet. + +from mosq_test_helper import * + +rc = 1 +mid = 53 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subscribe-qos0-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "qos0/test", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + time.sleep(0.5) + + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-qos1.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-qos1.py new file mode 100755 index 0000000..24b6263 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-qos1.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 + +# Test whether a SUBSCRIBE to a topic with QoS 1 results in the correct SUBACK packet. + +from mosq_test_helper import * + +rc = 1 +mid = 79 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subscribe-qos1-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "qos1/test", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-qos2.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-qos2.py new file mode 100755 index 0000000..19d5132 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-subscribe-qos2.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 + +# Test whether a SUBSCRIBE to a topic with QoS 2 results in the correct SUBACK packet. + +from mosq_test_helper import * + +rc = 1 +mid = 3 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subscribe-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "qos2/test", 2) +suback_packet = mosq_test.gen_suback(mid, 2) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-invalid-no-topic.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-invalid-no-topic.py new file mode 100755 index 0000000..cdeb2dc --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-invalid-no-topic.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 + +# Test whether a UNSUBSCRIBE with no topic results in a disconnect. MQTT-3.10.3-2 + +from mosq_test_helper import * + +def gen_unsubscribe_invalid_no_topic(mid): + pack_format = "!BBH" + return struct.pack(pack_format, 162, 2, mid) + +rc = 1 +mid = 3 +keepalive = 60 +connect_packet = mosq_test.gen_connect("unsubscribe-invalid-no-topic-test", keepalive=keepalive, proto_ver=4) +connack_packet = mosq_test.gen_connack(rc=0) + +unsubscribe_packet = gen_unsubscribe_invalid_no_topic(mid) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, unsubscribe_packet, b"", "disconnect") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos0.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos0.py new file mode 100755 index 0000000..b0ab8c2 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos0.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 + +# Test whether a UNSUBSCRIBE to a topic with QoS 0 results in the correct UNSUBACK packet. +# This doesn't assume a subscription exists. + +from mosq_test_helper import * + +rc = 1 +mid = 53 +keepalive = 60 +connect_packet = mosq_test.gen_connect("unsubscribe-qos0-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +unsubscribe_packet = mosq_test.gen_unsubscribe(mid, "qos0/test") +unsuback_packet = mosq_test.gen_unsuback(mid) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, unsubscribe_packet, unsuback_packet, "unsuback") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos1.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos1.py new file mode 100755 index 0000000..dfe91d9 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos1.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 + +# Test whether a SUBSCRIBE to a topic with QoS 1 results in the correct SUBACK packet. + +from mosq_test_helper import * + +rc = 1 +mid = 79 +keepalive = 60 +connect_packet = mosq_test.gen_connect("unsubscribe-qos1-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +unsubscribe_packet = mosq_test.gen_unsubscribe(mid, "qos1/test") +unsuback_packet = mosq_test.gen_unsuback(mid) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, unsubscribe_packet, unsuback_packet, "unsuback") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos2-multiple-v5.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos2-multiple-v5.py new file mode 100755 index 0000000..71ab855 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos2-multiple-v5.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python3 + +# Test whether a v5 UNSUBSCRIBE to multiple topics with QoS 2 results in the +# correct UNSUBACK packet, when one subscription exists and the other does not. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("unsubscribe-qos2-test", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "qos2/two", 2, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid, 2, proto_ver=5) + +mid = 3 +unsubscribe_packet = mosq_test.gen_unsubscribe_multiple(mid, ["qos2/one", "qos2/two"], proto_ver=5) +unsuback_packet = mosq_test.gen_unsuback(mid, proto_ver=5, reason_code=[17, 0]) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + mosq_test.do_send_receive(sock, unsubscribe_packet, unsuback_packet, "unsuback") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos2-multiple.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos2-multiple.py new file mode 100755 index 0000000..f4d98d5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos2-multiple.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 + +# Test whether a SUBSCRIBE to multiple topics with QoS 2 results in the correct SUBACK packet. + +from mosq_test_helper import * + +rc = 1 +mid = 3 +keepalive = 60 +connect_packet = mosq_test.gen_connect("unsubscribe-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +unsubscribe_packet = mosq_test.gen_unsubscribe_multiple(mid, ["qos2/one", "qos2/two"]) +unsuback_packet = mosq_test.gen_unsuback(mid) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, unsubscribe_packet, unsuback_packet, "unsuback") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos2-v5.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos2-v5.py new file mode 100755 index 0000000..0fe1d58 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos2-v5.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 + +# Test whether a SUBSCRIBE to a topic with QoS 2 results in the correct SUBACK packet. +# MQTT 5 + +from mosq_test_helper import * + +rc = 1 +mid = 3 +keepalive = 60 +connect_packet = mosq_test.gen_connect("unsubscribe-qos2-test", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +unsubscribe_packet = mosq_test.gen_unsubscribe(mid, "qos2/test", proto_ver=5) +unsuback_packet = mosq_test.gen_unsuback(mid, proto_ver=5, reason_code=17) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, unsubscribe_packet, unsuback_packet, "unsuback") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos2.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos2.py new file mode 100755 index 0000000..b2078a6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/02-unsubscribe-qos2.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 + +# Test whether a SUBSCRIBE to a topic with QoS 2 results in the correct SUBACK packet. + +from mosq_test_helper import * + +rc = 1 +mid = 3 +keepalive = 60 +connect_packet = mosq_test.gen_connect("unsubscribe-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +unsubscribe_packet = mosq_test.gen_unsubscribe(mid, "qos2/test") +unsuback_packet = mosq_test.gen_unsuback(mid) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, unsubscribe_packet, unsuback_packet, "unsuback") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-pattern-matching-helper.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-pattern-matching-helper.py new file mode 100755 index 0000000..b411483 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-pattern-matching-helper.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +port = int(sys.argv[2]) + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish(sys.argv[1], qos=0, retain=True, payload="message") + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack", port=port) +sock.send(publish_packet) +rc = 0 +sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-pattern-matching.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-pattern-matching.py new file mode 100755 index 0000000..1e05ff0 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-pattern-matching.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +def pattern_test(sub_topic, pub_topic): + rc = 1 + keepalive = 60 + connect_packet = mosq_test.gen_connect("pattern-sub-test", keepalive=keepalive) + connack_packet = mosq_test.gen_connack(rc=0) + + publish_packet = mosq_test.gen_publish(pub_topic, qos=0, payload="message") + publish_retained_packet = mosq_test.gen_publish(pub_topic, qos=0, retain=True, payload="message") + + mid = 312 + subscribe_packet = mosq_test.gen_subscribe(mid, sub_topic, 0) + suback_packet = mosq_test.gen_suback(mid, 0) + + mid = 234; + unsubscribe_packet = mosq_test.gen_unsubscribe(mid, sub_topic) + unsuback_packet = mosq_test.gen_unsuback(mid) + + port = mosq_test.get_port() + broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + + try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + pub = subprocess.Popen(['./03-pattern-matching-helper.py', pub_topic, str(port)], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + pub.wait() + (stdo, stde) = pub.communicate() + + if mosq_test.expect_packet(sock, "publish", publish_packet): + mosq_test.do_send_receive(sock, unsubscribe_packet, unsuback_packet, "unsuback") + + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + if mosq_test.expect_packet(sock, "publish retained", publish_retained_packet): + rc = 0 + + sock.close() + finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + print(stdo.decode('utf-8')) + sys.exit(rc) + + return rc + +pattern_test("#", "test/topic") +pattern_test("#", "/test/topic") +pattern_test("foo/#", "foo/bar/baz") +pattern_test("foo/+/baz", "foo/bar/baz") +pattern_test("foo/+/baz/#", "foo/bar/baz") +pattern_test("foo/+/baz/#", "foo/bar/baz/bar") +pattern_test("foo/foo/baz/#", "foo/foo/baz/bar") +pattern_test("foo/#", "foo") +pattern_test("foo/#", "foo/") +pattern_test("/#", "/foo") +pattern_test("test/topic/", "test/topic/") +pattern_test("test/topic/+", "test/topic/") +pattern_test("+/+/+/+/+/+/+/+/+/+/test", "one/two/three/four/five/six/seven/eight/nine/ten/test") + +pattern_test("#", "test////a//topic") +pattern_test("#", "/test////a//topic") +pattern_test("foo/#", "foo//bar///baz") +pattern_test("foo/+/baz", "foo//baz") +pattern_test("foo/+/baz//", "foo//baz//") +pattern_test("foo/+/baz/#", "foo//baz") +pattern_test("foo/+/baz/#", "foo//baz/bar") +pattern_test("foo//baz/#", "foo//baz/bar") +pattern_test("foo/foo/baz/#", "foo/foo/baz/bar") +pattern_test("/#", "////foo///bar") + +exit(0) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-disconnect-qos1-helper.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-disconnect-qos1-helper.py new file mode 100755 index 0000000..a46101e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-disconnect-qos1-helper.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +port = mosq_test.get_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 128 +publish_packet = mosq_test.gen_publish("qos1/disconnect/test", qos=1, mid=mid, payload="disconnect-message") +puback_packet = mosq_test.gen_puback(mid) + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack", port=port) + +mosq_test.do_send_receive(sock, publish_packet, puback_packet, "helper puback") + +rc = 0 + +sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-disconnect-qos1.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-disconnect-qos1.py new file mode 100755 index 0000000..7f32dcd --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-disconnect-qos1.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +port = mosq_test.get_port() + +rc = 1 +mid = 3265 +keepalive = 60 +connect_packet = mosq_test.gen_connect("pub-qos1-disco-test", keepalive=keepalive, clean_session=False) +connack1_packet = mosq_test.gen_connack(flags=0, rc=0) +connack2_packet = mosq_test.gen_connack(flags=1, rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "qos1/disconnect/test", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +mid = 1 +publish_packet = mosq_test.gen_publish("qos1/disconnect/test", qos=1, mid=mid, payload="disconnect-message") +publish_dup_packet = mosq_test.gen_publish("qos1/disconnect/test", qos=1, mid=mid, payload="disconnect-message", dup=True) +puback_packet = mosq_test.gen_puback(mid) + +mid = 3266 +publish2_packet = mosq_test.gen_publish("qos1/outgoing", qos=1, mid=mid, payload="outgoing-message") +puback2_packet = mosq_test.gen_puback(mid) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack1_packet, port=port) + + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + pub = subprocess.Popen(['./03-publish-b2c-disconnect-qos1-helper.py', str(port)], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + pub.wait() + (stdo, stde) = pub.communicate() + # Should have now received a publish command + + if mosq_test.expect_packet(sock, "publish", publish_packet): + # Send our outgoing message. When we disconnect the broker + # should get rid of it and assume we're going to retry. + sock.send(publish2_packet) + sock.close() + + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.settimeout(60) # 60 seconds timeout is much longer than 5 seconds message retry. + sock.connect(("localhost", port)) + + mosq_test.do_send_receive(sock, connect_packet, connack2_packet, "connack") + + if mosq_test.expect_packet(sock, "dup publish", publish_dup_packet): + sock.send(puback_packet) + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-disconnect-qos2-helper.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-disconnect-qos2-helper.py new file mode 100755 index 0000000..4a904d0 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-disconnect-qos2-helper.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 + +# Test whether a PUBLISH to a topic with QoS 2 results in the correct packet flow. + +from mosq_test_helper import * + +port = mosq_test.get_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 312 +publish_packet = mosq_test.gen_publish("qos2/disconnect/test", qos=2, mid=mid, payload="disconnect-message") +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack", port=port) + +mosq_test.do_send_receive(sock, publish_packet, pubrec_packet, "helper pubrec") +mosq_test.do_send_receive(sock, pubrel_packet, pubcomp_packet, "helper pubcomp") + +rc = 0 + +sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-disconnect-qos2.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-disconnect-qos2.py new file mode 100755 index 0000000..36e72fc --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-disconnect-qos2.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +rc = 1 +mid = 3265 +keepalive = 60 +connect_packet = mosq_test.gen_connect("pub-qos2-disco-test", keepalive=keepalive, clean_session=False) +connack1_packet = mosq_test.gen_connack(flags=0, rc=0) +connack2_packet = mosq_test.gen_connack(flags=1, rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "qos2/disconnect/test", 2) +suback_packet = mosq_test.gen_suback(mid, 2) + +mid = 1 +publish_packet = mosq_test.gen_publish("qos2/disconnect/test", qos=2, mid=mid, payload="disconnect-message") +publish_dup_packet = mosq_test.gen_publish("qos2/disconnect/test", qos=2, mid=mid, payload="disconnect-message", dup=True) +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +mid = 3266 +publish2_packet = mosq_test.gen_publish("qos1/outgoing", qos=1, mid=mid, payload="outgoing-message") +puback2_packet = mosq_test.gen_puback(mid) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack1_packet, port=port) + + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + pub = subprocess.Popen(['./03-publish-b2c-disconnect-qos2-helper.py', str(port)], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + hrc = pub.wait() + (stdo, stde) = pub.communicate() + if hrc: + exit(hrc) + # Should have now received a publish command + + if mosq_test.expect_packet(sock, "publish", publish_packet): + # Send our outgoing message. When we disconnect the broker + # should get rid of it and assume we're going to retry. + sock.send(publish2_packet) + sock.close() + + sock = mosq_test.do_client_connect(connect_packet, connack2_packet, port=port) + if mosq_test.expect_packet(sock, "dup publish", publish_dup_packet): + mosq_test.do_send_receive(sock, pubrec_packet, pubrel_packet, "pubrel") + + sock.close() + + sock = mosq_test.do_client_connect(connect_packet, connack2_packet, port=port) + if mosq_test.expect_packet(sock, "dup pubrel", pubrel_packet): + sock.send(pubcomp_packet) + rc = 0 + sock.close() + +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-qos1-len-helper.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-qos1-len-helper.py new file mode 100755 index 0000000..1179ae7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-qos1-len-helper.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +port = mosq_test.get_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +publish_packet = mosq_test.gen_publish("qos1/len/test", qos=1, mid=mid, payload="len-message") +puback_packet = mosq_test.gen_puback(mid) + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack", port=port) + +mosq_test.do_send_receive(sock, publish_packet, puback_packet, "helper puback") + +rc = 0 + +sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-qos1-len.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-qos1-len.py new file mode 100755 index 0000000..a9fe7c6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-qos1-len.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python3 + +# Check whether the broker handles a v5 PUBACK with all combinations +# of with/without reason code and properties. + +from mosq_test_helper import * + +def len_test(test, puback_packet): + port = mosq_test.get_port() + + rc = 1 + mid = 3265 + keepalive = 60 + connect_packet = mosq_test.gen_connect("pub-qos1-test", keepalive=keepalive, clean_session=False, proto_ver=5) + connack_packet = mosq_test.gen_connack(flags=0, rc=0, proto_ver=5) + + subscribe_packet = mosq_test.gen_subscribe(mid, "qos1/len/test", 1, proto_ver=5) + suback_packet = mosq_test.gen_suback(mid, 1, proto_ver=5) + + mid = 1 + publish_packet = mosq_test.gen_publish("qos1/len/test", qos=1, mid=mid, payload="len-message", proto_ver=5) + + broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + + try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + pub = subprocess.Popen(['./03-publish-b2c-qos1-len-helper.py', str(port)], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + pub.wait() + (stdo, stde) = pub.communicate() + # Should have now received a publish command + + if mosq_test.expect_packet(sock, "publish", publish_packet): + sock.send(puback_packet) + + mosq_test.do_ping(sock) + rc = 0 + + sock.close() + finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + + if rc != 0: + print(test) + exit(rc) + + +# No reason code, no properties +puback_packet = mosq_test.gen_puback(1) +len_test("qos1 len 2", puback_packet) + +# Reason code, no properties +puback_packet = mosq_test.gen_puback(1, proto_ver=5, reason_code=0x00) +len_test("qos1 len 3", puback_packet) + +# Reason code, empty properties +puback_packet = mosq_test.gen_puback(1, proto_ver=5, reason_code=0x00, properties="") +len_test("qos1 len 4", puback_packet) + +# Reason code, one property +props = mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key", "value") +puback_packet = mosq_test.gen_puback(1, proto_ver=5, reason_code=0x00, properties=props) +len_test("qos1 len >5", puback_packet) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-qos2-len-helper.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-qos2-len-helper.py new file mode 100755 index 0000000..921404f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-qos2-len-helper.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +port = mosq_test.get_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +publish_packet = mosq_test.gen_publish("qos2/len/test", qos=2, mid=mid, payload="len-message") +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack", port=port) + +mosq_test.do_send_receive(sock, publish_packet, pubrec_packet, "helper pubrec") +mosq_test.do_send_receive(sock, pubrel_packet, pubcomp_packet, "helper pubcomp") + +rc = 0 + +sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-qos2-len.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-qos2-len.py new file mode 100755 index 0000000..a354749 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-qos2-len.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python3 + +# Check whether the broker handles a v5 PUBREC, PUBCOMP with all combinations +# of with/without reason code and properties. + +from mosq_test_helper import * + +def len_test(test, pubrec_packet, pubcomp_packet): + port = mosq_test.get_port() + + rc = 1 + mid = 3265 + keepalive = 60 + connect_packet = mosq_test.gen_connect("pub-test", keepalive=keepalive, clean_session=False, proto_ver=5) + connack_packet = mosq_test.gen_connack(flags=0, rc=0, proto_ver=5) + + subscribe_packet = mosq_test.gen_subscribe(mid, "qos2/len/test", 2, proto_ver=5) + suback_packet = mosq_test.gen_suback(mid, 2, proto_ver=5) + + mid = 1 + publish_packet = mosq_test.gen_publish("qos2/len/test", qos=2, mid=mid, payload="len-message", proto_ver=5) + pubrel_packet = mosq_test.gen_pubrel(mid) + + broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + + try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + pub = subprocess.Popen(['./03-publish-b2c-qos2-len-helper.py', str(port)], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + pub.wait() + (stdo, stde) = pub.communicate() + # Should have now received a publish command + + if mosq_test.expect_packet(sock, "publish", publish_packet): + mosq_test.do_send_receive(sock, pubrec_packet, pubrel_packet, "pubrel") + sock.send(pubcomp_packet) + + mosq_test.do_ping(sock) + rc = 0 + + sock.close() + finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + + if rc != 0: + print(test) + exit(rc) + + +# No reason code, no properties +pubrec_packet = mosq_test.gen_pubrec(1) +pubcomp_packet = mosq_test.gen_pubcomp(1) +len_test("qos2 len 2", pubrec_packet, pubcomp_packet) + +# Reason code, no properties +pubrec_packet = mosq_test.gen_pubrec(1, proto_ver=5, reason_code=0x00) +pubcomp_packet = mosq_test.gen_pubcomp(1, proto_ver=5, reason_code=0x00) +len_test("qos2 len 3", pubrec_packet, pubcomp_packet) + +# Reason code, empty properties +pubrec_packet = mosq_test.gen_pubrec(1, proto_ver=5, reason_code=0x00, properties="") +pubcomp_packet = mosq_test.gen_pubcomp(1, proto_ver=5, reason_code=0x00, properties="") +len_test("qos2 len 4", pubrec_packet, pubcomp_packet) + +# Reason code, one property +props = mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key", "value") +pubrec_packet = mosq_test.gen_pubrec(1, proto_ver=5, reason_code=0x00, properties=props) +props = mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key", "value") +pubcomp_packet = mosq_test.gen_pubcomp(1, proto_ver=5, reason_code=0x00, properties=props) +len_test("qos2 len >5", pubrec_packet, pubcomp_packet) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-timeout-qos1-helper.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-timeout-qos1-helper.py new file mode 100755 index 0000000..2621453 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-timeout-qos1-helper.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 + +# Test whether a PUBLISH to a topic with QoS 2 results in the correct packet flow. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 128 +publish_packet = mosq_test.gen_publish("qos1/timeout/test", qos=1, mid=mid, payload="timeout-message") +puback_packet = mosq_test.gen_puback(mid) + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack") +mosq_test.do_send_receive(sock, publish_packet, puback_packet, "helper puback") + +rc = 0 + +sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-timeout-qos1.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-timeout-qos1.py new file mode 100755 index 0000000..80d0fb6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-timeout-qos1.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 + +# Test whether a SUBSCRIBE to a topic with QoS 2 results in the correct SUBACK packet. + +from mosq_test_helper import * + +rc = 1 +mid = 3265 +keepalive = 60 +connect_packet = mosq_test.gen_connect("pub-qos1-timeout-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "qos1/timeout/test", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +mid = 1 +publish_packet = mosq_test.gen_publish("qos1/timeout/test", qos=1, mid=mid, payload="timeout-message") +publish_dup_packet = mosq_test.gen_publish("qos1/timeout/test", qos=1, mid=mid, payload="timeout-message", dup=True) +puback_packet = mosq_test.gen_puback(mid) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__)) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + pub = subprocess.Popen(['./03-publish-b2c-timeout-qos1-helper.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)) + pub.wait() + (stdo, stde) = pub.communicate() + # Should have now received a publish command + + if mosq_test.expect_packet(sock, "publish", publish_packet): + # Wait for longer than 5 seconds to get republish with dup set + # This is covered by the 8 second timeout + + if mosq_test.expect_packet(sock, "dup publish", publish_dup_packet): + sock.send(puback_packet) + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-timeout-qos2-helper.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-timeout-qos2-helper.py new file mode 100755 index 0000000..da255af --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-timeout-qos2-helper.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +# Test whether a PUBLISH to a topic with QoS 2 results in the correct packet flow. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 312 +publish_packet = mosq_test.gen_publish("qos2/timeout/test", qos=2, mid=mid, payload="timeout-message") +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack") +mosq_test.do_send_receive(sock, publish_packet, pubrec_packet, "helper pubrec") +mosq_test.do_send_receive(sock, pubrel_packet, pubcomp_packet, "helper pubcomp") + +rc = 0 + +sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-timeout-qos2.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-timeout-qos2.py new file mode 100755 index 0000000..a23b69a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-b2c-timeout-qos2.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 + +# Test whether a SUBSCRIBE to a topic with QoS 2 results in the correct SUBACK packet. + +from mosq_test_helper import * + +rc = 1 +mid = 3265 +keepalive = 60 +connect_packet = mosq_test.gen_connect("pub-qo2-timeout-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "qos2/timeout/test", 2) +suback_packet = mosq_test.gen_suback(mid, 2) + +mid = 1 +publish_packet = mosq_test.gen_publish("qos2/timeout/test", qos=2, mid=mid, payload="timeout-message") +publish_dup_packet = mosq_test.gen_publish("qos2/timeout/test", qos=2, mid=mid, payload="timeout-message", dup=True) +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__)) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + pub = subprocess.Popen(['./03-publish-b2c-timeout-qos2-helper.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)) + pub.wait() + (stdo, stde) = pub.communicate() + # Should have now received a publish command + + if mosq_test.expect_packet(sock, "publish", publish_packet): + # Wait for longer than 5 seconds to get republish with dup set + # This is covered by the 8 second timeout + + if mosq_test.expect_packet(sock, "dup publish", publish_dup_packet): + mosq_test.do_send_receive(sock, pubrec_packet, pubrel_packet, "pubrel") + + # Wait for longer than 5 seconds to get republish with dup set + # This is covered by the 8 second timeout + + if mosq_test.expect_packet(sock, "dup pubrel", pubrel_packet): + sock.send(pubcomp_packet) + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-c2b-disconnect-qos2.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-c2b-disconnect-qos2.py new file mode 100755 index 0000000..4a6d80f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-c2b-disconnect-qos2.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +rc = 1 +mid = 3265 +keepalive = 60 +connect_packet = mosq_test.gen_connect("pub-qos2-disco-test", keepalive=keepalive, clean_session=False, proto_ver=3) +connack_packet = mosq_test.gen_connack(flags=0, rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "qos2/disconnect/test", 2) +suback_packet = mosq_test.gen_suback(mid, 2) + +mid = 1 +publish_packet = mosq_test.gen_publish("qos2/disconnect/test", qos=2, mid=mid, payload="disconnect-message") +publish_dup_packet = mosq_test.gen_publish("qos2/disconnect/test", qos=2, mid=mid, payload="disconnect-message", dup=True) +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubrel_dup_packet = mosq_test.gen_pubrel(mid, dup=True) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + + mosq_test.do_send_receive(sock, publish_packet, pubrec_packet, "pubrec") + + # We're now going to disconnect and pretend we didn't receive the pubrec. + sock.close() + + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.send(publish_dup_packet) + + if mosq_test.expect_packet(sock, "pubrec", pubrec_packet): + mosq_test.do_send_receive(sock, pubrel_packet, pubcomp_packet, "pubcomp") + + # Again, pretend we didn't receive this pubcomp + sock.close() + + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, pubrel_dup_packet, pubcomp_packet, "pubcomp") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-c2b-qos2-len.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-c2b-qos2-len.py new file mode 100755 index 0000000..3febae6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-c2b-qos2-len.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 + +# Check whether the broker handles a v5 PUBREL with all combinations +# of with/without reason code and properties. + +from mosq_test_helper import * + +def len_test(test, pubrel_packet): + port = mosq_test.get_port() + + rc = 1 + mid = 3265 + keepalive = 60 + connect_packet = mosq_test.gen_connect("pub-test", keepalive=keepalive, clean_session=False, proto_ver=5) + connack_packet = mosq_test.gen_connack(flags=0, rc=0, proto_ver=5) + + mid = 1 + publish_packet = mosq_test.gen_publish("qos2/len/test", qos=2, mid=mid, payload="len-message", proto_ver=5) + pubrec_packet = mosq_test.gen_pubrec(mid) + pubcomp_packet = mosq_test.gen_pubcomp(mid) + + broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + + try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + + mosq_test.do_send_receive(sock, publish_packet, pubrec_packet, "pubrec") + mosq_test.do_send_receive(sock, pubrel_packet, pubcomp_packet, "pubcomp") + + mosq_test.do_ping(sock) + rc = 0 + + sock.close() + finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + + if rc != 0: + print(test) + exit(rc) + + +# No reason code, no properties +pubrel_packet = mosq_test.gen_pubrel(1) +len_test("qos2 len 2", pubrel_packet) + +# Reason code, no properties +pubrel_packet = mosq_test.gen_pubrel(1, proto_ver=5, reason_code=0x00) +len_test("qos2 len 3", pubrel_packet) + +# Reason code, empty properties +pubrel_packet = mosq_test.gen_pubrel(1, proto_ver=5, reason_code=0x00, properties="") +len_test("qos2 len 4", pubrel_packet) + +# Reason code, one property +props = mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key", "value") +pubrel_packet = mosq_test.gen_pubrel(1, proto_ver=5, reason_code=0x00, properties=props) +len_test("qos2 len >5", pubrel_packet) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-c2b-timeout-qos2.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-c2b-timeout-qos2.py new file mode 100755 index 0000000..b5877bd --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-c2b-timeout-qos2.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python3 + +# Test whether a PUBLISH to a topic with QoS 2 results in the correct packet +# flow. This test introduces delays into the flow in order to force the broker +# to send duplicate PUBREC and PUBCOMP messages. + +from mosq_test_helper import * + +rc = 1 +keepalive = 600 +connect_packet = mosq_test.gen_connect("pub-qos2-timeout-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1926 +publish_packet = mosq_test.gen_publish("pub/qos2/test", qos=2, mid=mid, payload="timeout-message") +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__)) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + mosq_test.do_send_receive(sock, publish_packet, pubrec_packet, "pubrec") + + # Timeout is 8 seconds which means the broker should repeat the PUBREC. + + if mosq_test.expect_packet(sock, "pubrec", pubrec_packet): + mosq_test.do_send_receive(sock, pubrel_packet, pubcomp_packet, "pubcomp") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-dollar-v5.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-dollar-v5.py new file mode 100755 index 0000000..7942444 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-dollar-v5.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 + +# Test whether a PUBLISH to $ topics QoS 1 results in the expected PUBACK packet. + +from mosq_test_helper import * + +mid = 1 +def helper(topic, reason_code): + global mid + + publish_packet = mosq_test.gen_publish(topic, qos=1, mid=mid, payload="message", proto_ver=5) + if reason_code == 0: + puback_packet = mosq_test.gen_puback(mid, proto_ver=5) + else: + puback_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=reason_code) + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, publish_packet, puback_packet, "puback%d"%(mid)) + + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("pub-test", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + helper("$SYS/broker/uptime", mqtt5_rc.MQTT_RC_NOT_AUTHORIZED) + helper("$SYS/broker/connection/me", mqtt5_rc.MQTT_RC_NOT_AUTHORIZED) + helper("$SYS/broker/connection/me/state", mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS) + helper("$share/share/topic", mqtt5_rc.MQTT_RC_NOT_AUTHORIZED) + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-dollar.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-dollar.py new file mode 100755 index 0000000..2ef5ab9 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-dollar.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 + +# Test whether a PUBLISH to a topic starting with $ succeeds + +from mosq_test_helper import * + +rc = 1 +mid = 19 +keepalive = 60 +connect_packet = mosq_test.gen_connect("pub-dollar-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("$test/test", qos=1, mid=mid, payload="message") +puback_packet = mosq_test.gen_puback(mid) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, publish_packet, puback_packet, "puback") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-invalid-utf8.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-invalid-utf8.py new file mode 100755 index 0000000..7b5ab74 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-invalid-utf8.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python3 + +# Test whether a PUBLISH to a topic with an invalid UTF-8 topic fails + +from mosq_test_helper import * + +rc = 1 +mid = 53 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-invalid-utf8", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("invalid/utf8", 1, mid=mid) +b = list(struct.unpack("B"*len(publish_packet), publish_packet)) +b[11] = 0 # Topic should never have a 0x0000 +publish_packet = struct.pack("B"*len(b), *b) + +puback_packet = mosq_test.gen_puback(mid) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + time.sleep(0.5) + + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, publish_packet, b"", "puback") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos1-no-subscribers-v5.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos1-no-subscribers-v5.py new file mode 100755 index 0000000..29a51bb --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos1-no-subscribers-v5.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 + +# Test whether a PUBLISH to a topic with QoS 1 results in the correct PUBACK +# packet when there are no subscribers. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("pub-qos1-test", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + + +mid = 1 +publish1_packet = mosq_test.gen_publish("pub", qos=1, mid=mid, payload="message", proto_ver=5) +puback1_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS) + +mid = 2 +publish2_packet = mosq_test.gen_publish("pub/qos1", qos=1, mid=mid, payload="message", proto_ver=5) +puback2_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS) + +mid = 3 +publish3_packet = mosq_test.gen_publish("pub/qos1/test", qos=1, mid=mid, payload="message", proto_ver=5) +puback3_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS) + +mid = 4 +publish4_packet = mosq_test.gen_publish("pub/qos1/test", qos=1, mid=mid, payload="message", proto_ver=5, retain=True) +puback4_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS) + +mid = 5 +publish1b_packet = mosq_test.gen_publish("pub", qos=1, mid=mid, payload="message", proto_ver=5) +puback1b_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS) + +mid = 6 +publish2b_packet = mosq_test.gen_publish("pub/qos1", qos=1, mid=mid, payload="message", proto_ver=5) +puback2b_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS) + +mid = 7 +publish3b_packet = mosq_test.gen_publish("pub/qos1/test", qos=1, mid=mid, payload="message", proto_ver=5) +puback3b_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + + # None of the pub/qos1/test topic tree exists here + mosq_test.do_send_receive(sock, publish1_packet, puback1_packet, "puback1a") + mosq_test.do_send_receive(sock, publish2_packet, puback2_packet, "puback2a") + mosq_test.do_send_receive(sock, publish3_packet, puback3_packet, "puback3a") + + # This publish sets a retained message, which means the topic tree exists + mosq_test.do_send_receive(sock, publish4_packet, puback4_packet, "puback4") + + # So now test again + mosq_test.do_send_receive(sock, publish1b_packet, puback1b_packet, "puback1b") + mosq_test.do_send_receive(sock, publish2b_packet, puback2b_packet, "puback2b") + mosq_test.do_send_receive(sock, publish3b_packet, puback3b_packet, "puback3b") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos1-queued-bytes.conf b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos1-queued-bytes.conf new file mode 100644 index 0000000..6f85310 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos1-queued-bytes.conf @@ -0,0 +1,4 @@ +sys_interval 1 +max_queued_messages 0 +max_queued_bytes 400 +port 1888 diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos1-queued-bytes.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos1-queued-bytes.py new file mode 100755 index 0000000..3e26375 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos1-queued-bytes.py @@ -0,0 +1,161 @@ +#!/usr/bin/env python3 + +# Test whether a PUBLISH to a topic with an offline subscriber results in a queued message +import Queue +import random +import string +import subprocess +import socket +import threading +import time + +try: + import paho.mqtt.client + import paho.mqtt.publish +except ImportError: + print("WARNING: paho.mqtt module not available, skipping byte count test.") + exit(0) + + +from mosq_test_helper import * + +rc = 1 + +port = mosq_test.get_port() + +def registerOfflineSubscriber(): + """Just a durable client to trigger queuing""" + client = paho.mqtt.client.Client("sub-qos1-offline", clean_session=False) + client.connect("localhost", port=port) + client.subscribe("test/publish/queueing/#", 1) + client.loop() + client.disconnect() + + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +class BrokerMonitor(threading.Thread): + def __init__(self, group=None, target=None, name=None, args=(), kwargs=None, verbose=None): + threading.Thread.__init__(self, group=group, target=target, name=name, verbose=verbose) + self.rq, self.cq = args + self.stored = -1 + self.stored_bytes = -1 + self.dropped = -1 + + def store_count(self, client, userdata, message): + self.stored = int(message.payload) + + def store_bytes(self, client, userdata, message): + self.stored_bytes = int(message.payload) + + def publish_dropped(self, client, userdata, message): + self.dropped = int(message.payload) + + def run(self): + client = paho.mqtt.client.Client("broker-monitor") + client.connect("localhost", port=port) + client.message_callback_add("$SYS/broker/store/messages/count", self.store_count) + client.message_callback_add("$SYS/broker/store/messages/bytes", self.store_bytes) + client.message_callback_add("$SYS/broker/publish/messages/dropped", self.publish_dropped) + client.subscribe("$SYS/broker/store/messages/#") + client.subscribe("$SYS/broker/publish/messages/dropped") + + while True: + expect_drops = cq.get() + self.cq.task_done() + if expect_drops == "quit": + break + first = time.time() + while self.stored < 0 or self.stored_bytes < 0 or (expect_drops and self.dropped < 0): + client.loop(timeout=0.5) + if time.time() - 10 > first: + print("ABORT TIMEOUT") + break + + if expect_drops: + self.rq.put((self.stored, self.stored_bytes, self.dropped)) + else: + self.rq.put((self.stored, self.stored_bytes, 0)) + self.stored = -1 + self.stored_bytes = -1 + self.dropped = -1 + + client.disconnect() + +rq = Queue.Queue() +cq = Queue.Queue() +brokerMonitor = BrokerMonitor(args=(rq,cq)) + +class StoreCounts(): + def __init__(self): + self.stored = 0 + self.bstored = 0 + self.drops = 0 + self.diff_stored = 0 + self.diff_bstored = 0 + self.diff_drops = 0 + + def update(self, tup): + self.diff_stored = tup[0] - self.stored + self.stored = tup[0] + self.diff_bstored = tup[1] - self.bstored + self.bstored = tup[1] + self.diff_drops = tup[2] - self.drops + self.drops = tup[2] + + def __repr__(self): + return "s: %d (%d) b: %d (%d) d: %d (%d)" % (self.stored, self.diff_stored, self.bstored, self.diff_bstored, self.drops, self.diff_drops) + +try: + registerOfflineSubscriber() + time.sleep(2.5) # Wait for first proper dump of stats + brokerMonitor.start() + counts = StoreCounts() + cq.put(True) # Expect a dropped count (of 0, initial) + counts.update(rq.get()) # Initial start + print("rq.get (INITIAL) gave us: ", counts) + rq.task_done() + + # publish 10 short messages, should be no drops + print("publishing 10 short") + cq.put(False) # expect no updated drop count + msgs_short10 = [("test/publish/queueing/%d" % x, + ''.join(random.choice(string.hexdigits) for _ in range(10)), + 1, False) for x in range(1, 10 + 1)] + paho.mqtt.publish.multiple(msgs_short10, port=port) + counts.update(rq.get()) # Initial start + print("rq.get (short) gave us: ", counts) + rq.task_done() + if counts.diff_stored != 10 or counts.diff_bstored < 100: + raise ValueError + if counts.diff_drops != 0: + raise ValueError + + # publish 10 mediums (40bytes). should fail after 8, when it finally crosses 400 + print("publishing 10 medium") + cq.put(True) # expect a drop count + msgs_medium10 = [("test/publish/queueing/%d" % x, + ''.join(random.choice(string.hexdigits) for _ in range(40)), + 1, False) for x in range(1, 10 + 1)] + paho.mqtt.publish.multiple(msgs_medium10, port=port) + counts.update(rq.get()) # Initial start + print("rq.get (medium) gave us: ", counts) + rq.task_done() + if counts.diff_stored != 8 or counts.diff_bstored < 320: + raise ValueError + if counts.diff_drops != 2: + raise ValueError + rc = 0 + +finally: + cq.put("quit") + brokerMonitor.join() + rq.join() + cq.join() + broker.terminate() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos1-retain-disabled.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos1-retain-disabled.py new file mode 100755 index 0000000..771f459 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos1-retain-disabled.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 + +# Test whether a PUBLISH with a retain set when retains are disabled results in +# the correct DISCONNECT. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("retain_available false\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +mid = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("pub-qos1-test", keepalive=keepalive, proto_ver=5) + +props = mqtt5_props.gen_byte_prop(mqtt5_props.PROP_RETAIN_AVAILABLE, 0) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props) + +publish_packet = mosq_test.gen_publish("pub/qos1/test", qos=1, mid=mid, payload="message", retain=True, proto_ver=5) +puback_packet = mosq_test.gen_puback(mid, proto_ver=5) + +disconnect_packet = mosq_test.gen_disconnect(reason_code=154, proto_ver=5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, publish_packet, disconnect_packet, "disconnect") + + rc = 0 + + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos1.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos1.py new file mode 100755 index 0000000..4ce2ad4 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos1.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 + +# Test whether a PUBLISH to a topic with QoS 1 results in the correct PUBACK packet. + +from mosq_test_helper import * + +rc = 1 +mid = 19 +keepalive = 60 +connect_packet = mosq_test.gen_connect("pub-qos1-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("pub/qos1/test", qos=1, mid=mid, payload="message") +puback_packet = mosq_test.gen_puback(mid) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, publish_packet, puback_packet, "puback") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos2.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos2.py new file mode 100755 index 0000000..3197dab --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/03-publish-qos2.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 + +# Test whether a PUBLISH to a topic with QoS 2 results in the correct packet flow. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("pub-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 312 +publish_packet = mosq_test.gen_publish("pub/qos2/test", qos=2, mid=mid, payload="message") +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, publish_packet, pubrec_packet, "pubrec") + mosq_test.do_send_receive(sock, pubrel_packet, pubcomp_packet, "pubcomp") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-check-source-persist-diff-port.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-check-source-persist-diff-port.py new file mode 100755 index 0000000..aa6fc24 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-check-source-persist-diff-port.py @@ -0,0 +1,108 @@ +#!/usr/bin/env python3 + +# Test for CVE-2018-12546, with the broker being stopped to write the persistence file, plus subscriber on different port. + +from mosq_test_helper import * +import signal + +def write_config(filename, port1, port2, per_listener): + with open(filename, 'w') as f: + f.write("per_listener_settings %s\n" % (per_listener)) + f.write("check_retain_source true\n") + f.write("port %d\n" % (port1)) + f.write("acl_file %s\n" % (filename.replace('.conf', '.acl'))) + f.write("persistence true\n") + f.write("persistence_file %s\n" % (filename.replace('.conf', '.db'))) + f.write("listener %d\n" % (port2)) + +def write_acl_1(filename, username): + with open(filename, 'w') as f: + if username is not None: + f.write('user %s\n' % (username)) + f.write('topic readwrite test/topic\n') + +def write_acl_2(filename, username): + with open(filename, 'w') as f: + if username is not None: + f.write('user %s\n' % (username)) + f.write('topic read test/topic\n') + + +def do_test(per_listener, username): + conf_file = os.path.basename(__file__).replace('.py', '.conf') + write_config(conf_file, port1, port2, per_listener) + + persistence_file = os.path.basename(__file__).replace('.py', '.db') + try: + os.remove(persistence_file) + except OSError: + pass + + acl_file = os.path.basename(__file__).replace('.py', '.acl') + write_acl_1(acl_file, username) + + + rc = 1 + keepalive = 60 + connect_packet = mosq_test.gen_connect("retain-check", keepalive=keepalive, username=username) + connack_packet = mosq_test.gen_connack(rc=0) + + if per_listener == "true": + u = None + else: + # If per listener is false, then the second client will be denied + # unless we provide a username + u = username + + connect2_packet = mosq_test.gen_connect("retain-recv", keepalive=keepalive, username=u) + connack2_packet = mosq_test.gen_connack(rc=0) + + mid = 1 + publish_packet = mosq_test.gen_publish("test/topic", qos=0, payload="retained message", retain=True) + subscribe_packet = mosq_test.gen_subscribe(mid, "test/topic", 0) + suback_packet = mosq_test.gen_suback(mid, 0) + + broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port1) + + try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port1) + sock.send(publish_packet) + sock.close() + + sock = mosq_test.do_client_connect(connect2_packet, connack2_packet, port=port2) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback 1") + + if mosq_test.expect_packet(sock, "publish", publish_packet): + sock.close() + + # Remove "write" ability + write_acl_2(acl_file, username) + broker.terminate() + broker.wait() + + broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port1) + + sock = mosq_test.do_client_connect(connect2_packet, connack2_packet, port=port2) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback 2") + # If we receive the retained message here, it is a failure. + mosq_test.do_ping(sock) + rc = 0 + + sock.close() + finally: + broker.terminate() + broker.wait() + os.remove(conf_file) + os.remove(acl_file) + os.remove(persistence_file) + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + exit(rc) + + +(port1, port2) = mosq_test.get_port(2) +do_test("true", username=None) +do_test("true", username="test") +do_test("false", username=None) +do_test("false", username="test") diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-check-source-persist.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-check-source-persist.py new file mode 100755 index 0000000..0fbd475 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-check-source-persist.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python3 + +# Test for CVE-2018-12546, with the broker being stopped to write the persistence file. + +from mosq_test_helper import * +import signal + +def write_config(filename, port, per_listener): + with open(filename, 'w') as f: + f.write("per_listener_settings %s\n" % (per_listener)) + f.write("check_retain_source true\n") + f.write("port %d\n" % (port)) + f.write("acl_file %s\n" % (filename.replace('.conf', '.acl'))) + f.write("persistence true\n") + f.write("persistence_file %s\n" % (filename.replace('.conf', '.db'))) + +def write_acl_1(filename, username): + with open(filename, 'w') as f: + if username is not None: + f.write('user %s\n' % (username)) + f.write('topic readwrite test/topic\n') + +def write_acl_2(filename, username): + with open(filename, 'w') as f: + if username is not None: + f.write('user %s\n' % (username)) + f.write('topic read test/topic\n') + + +def do_test(per_listener, username): + conf_file = os.path.basename(__file__).replace('.py', '.conf') + write_config(conf_file, port, per_listener) + + persistence_file = os.path.basename(__file__).replace('.py', '.db') + try: + os.remove(persistence_file) + except OSError: + pass + + acl_file = os.path.basename(__file__).replace('.py', '.acl') + write_acl_1(acl_file, username) + + + rc = 1 + keepalive = 60 + connect_packet = mosq_test.gen_connect("retain-check", keepalive=keepalive, username=username) + connack_packet = mosq_test.gen_connack(rc=0) + + mid = 1 + publish_packet = mosq_test.gen_publish("test/topic", qos=0, payload="retained message", retain=True) + subscribe_packet = mosq_test.gen_subscribe(mid, "test/topic", 0) + suback_packet = mosq_test.gen_suback(mid, 0) + + broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + + try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.send(publish_packet) + sock.close() + + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback 1") + + if mosq_test.expect_packet(sock, "publish", publish_packet): + sock.close() + + # Remove "write" ability + write_acl_2(acl_file, username) + broker.terminate() + broker.wait() + + broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback 2") + # If we receive the retained message here, it is a failure. + mosq_test.do_ping(sock) + rc = 0 + + sock.close() + finally: + broker.terminate() + broker.wait() + os.remove(conf_file) + os.remove(acl_file) + os.remove(persistence_file) + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + exit(rc) + + +port = mosq_test.get_port() +do_test("true", username=None) +do_test("true", username="test") +do_test("false", username=None) +do_test("false", username="test") diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-check-source.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-check-source.py new file mode 100755 index 0000000..b3adecb --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-check-source.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python3 + +# Test for CVE-2018-12546 + +from mosq_test_helper import * +import signal + +def write_config(filename, port, per_listener): + with open(filename, 'w') as f: + f.write("per_listener_settings %s\n" % (per_listener)) + f.write("check_retain_source true\n") + f.write("port %d\n" % (port)) + f.write("acl_file %s\n" % (filename.replace('.conf', '.acl'))) + +def write_acl_1(filename): + with open(filename, 'w') as f: + f.write('topic readwrite test/topic\n') + +def write_acl_2(filename): + with open(filename, 'w') as f: + f.write('topic read test/topic\n') + + +def do_test(per_listener): + conf_file = os.path.basename(__file__).replace('.py', '.conf') + write_config(conf_file, port, per_listener) + + acl_file = os.path.basename(__file__).replace('.py', '.acl') + write_acl_1(acl_file) + + + rc = 1 + keepalive = 60 + connect_packet = mosq_test.gen_connect("retain-check", keepalive=keepalive) + connack_packet = mosq_test.gen_connack(rc=0) + + mid = 1 + publish_packet = mosq_test.gen_publish("test/topic", qos=0, payload="retained message", retain=True) + subscribe_packet = mosq_test.gen_subscribe(mid, "test/topic", 0) + suback_packet = mosq_test.gen_suback(mid, 0) + + broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + + try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.send(publish_packet) + sock.close() + + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback 1") + + if mosq_test.expect_packet(sock, "publish", publish_packet): + sock.close() + + # Remove "write" ability + write_acl_2(acl_file) + broker.send_signal(signal.SIGHUP) + + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback 2") + # If we receive the retained message here, it is a failure. + mosq_test.do_ping(sock) + rc = 0 + + sock.close() + finally: + os.remove(conf_file) + os.remove(acl_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + exit(rc) + +port = mosq_test.get_port() +do_test("true") +do_test("false") diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-qos0-clear.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-qos0-clear.py new file mode 100755 index 0000000..48ca603 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-qos0-clear.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 + +# Test whether a retained PUBLISH is cleared when a zero length retained +# message is published to a topic. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("retain-clear-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("retain/clear/test", qos=0, payload="retained message", retain=True) +retain_clear_packet = mosq_test.gen_publish("retain/clear/test", qos=0, payload=None, retain=True) +mid_sub = 592 +subscribe_packet = mosq_test.gen_subscribe(mid_sub, "retain/clear/test", 0) +suback_packet = mosq_test.gen_suback(mid_sub, 0) + +mid_unsub = 593 +unsubscribe_packet = mosq_test.gen_unsubscribe(mid_unsub, "retain/clear/test") +unsuback_packet = mosq_test.gen_unsuback(mid_unsub) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=4, port=port) + # Send retained message + sock.send(publish_packet) + # Subscribe to topic, we should get the retained message back. + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + if mosq_test.expect_packet(sock, "publish", publish_packet): + # Now unsubscribe from the topic before we clear the retained + # message. + mosq_test.do_send_receive(sock, unsubscribe_packet, unsuback_packet, "unsuback") + + # Now clear the retained message. + sock.send(retain_clear_packet) + + # Subscribe to topic, we shouldn't get anything back apart + # from the SUBACK. + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + time.sleep(1) + # If we do get something back, it should be before this ping, so if + # this succeeds then we're ok. + mosq_test.do_ping(sock) + # This is the expected event + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-qos0-fresh.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-qos0-fresh.py new file mode 100755 index 0000000..420a8d9 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-qos0-fresh.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +# Test whether a retained PUBLISH to a topic with QoS 0 is sent with +# retain=false to an already subscribed client. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +mid = 16 +connect_packet = mosq_test.gen_connect("retain-qos0-fresh-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("retain/qos0/test", qos=0, payload="retained message", retain=True) +publish_fresh_packet = mosq_test.gen_publish("retain/qos0/test", qos=0, payload="retained message") +subscribe_packet = mosq_test.gen_subscribe(mid, "retain/qos0/test", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + mosq_test.do_send_receive(sock, publish_packet, publish_fresh_packet, "publish") + + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-qos0-repeated.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-qos0-repeated.py new file mode 100755 index 0000000..5f63858 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-qos0-repeated.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 + +# Test whether a retained PUBLISH to a topic with QoS 0 is actually retained +# and delivered when multiple sub/unsub operations are carried out. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +mid = 16 +connect_packet = mosq_test.gen_connect("retain-qos0-rep-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("retain/qos0/test", qos=0, payload="retained message", retain=True) +subscribe_packet = mosq_test.gen_subscribe(mid, "retain/qos0/test", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +unsub_mid = 13 +unsubscribe_packet = mosq_test.gen_unsubscribe(unsub_mid, "retain/qos0/test") +unsuback_packet = mosq_test.gen_unsuback(unsub_mid) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + sock.send(publish_packet) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + if mosq_test.expect_packet(sock, "publish", publish_packet): + mosq_test.do_send_receive(sock, unsubscribe_packet, unsuback_packet, "unsuback") + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + if mosq_test.expect_packet(sock, "publish", publish_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-qos0.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-qos0.py new file mode 100755 index 0000000..c789ee1 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-qos0.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 + +# Test whether a retained PUBLISH to a topic with QoS 0 is actually retained. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +mid = 16 +connect_packet = mosq_test.gen_connect("retain-qos0-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("retain/qos0/test", qos=0, payload="retained message", retain=True) +subscribe_packet = mosq_test.gen_subscribe(mid, "retain/qos0/test", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.send(publish_packet) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + if mosq_test.expect_packet(sock, "publish", publish_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-qos1-qos0.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-qos1-qos0.py new file mode 100755 index 0000000..ea71956 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-qos1-qos0.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python3 + +# Test whether a retained PUBLISH to a topic with QoS 1 is retained. +# Subscription is made with QoS 0 so the retained message should also have QoS +# 0. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("retain-qos1-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 6 +publish_packet = mosq_test.gen_publish("retain/qos1/test", qos=1, mid=mid, payload="retained message", retain=True) +puback_packet = mosq_test.gen_puback(mid) +mid = 18 +subscribe_packet = mosq_test.gen_subscribe(mid, "retain/qos1/test", 0) +suback_packet = mosq_test.gen_suback(mid, 0) +publish0_packet = mosq_test.gen_publish("retain/qos1/test", qos=0, payload="retained message", retain=True) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, publish_packet, puback_packet, "puback") + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + if mosq_test.expect_packet(sock, "publish0", publish0_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-upgrade-outgoing-qos.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-upgrade-outgoing-qos.py new file mode 100755 index 0000000..e9f0295 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/04-retain-upgrade-outgoing-qos.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 + +# Test whether a retained PUBLISH to a topic with QoS 0 is sent with subscriber QoS +# when upgrade_outgoing_qos is true + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("upgrade_outgoing_qos true\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +keepalive = 60 +mid = 16 +connect_packet = mosq_test.gen_connect("retain-qos0-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("retain/qos0/test", qos=0, payload="retained message", retain=True) +subscribe_packet = mosq_test.gen_subscribe(mid, "retain/qos0/test", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +publish_packet2 = mosq_test.gen_publish("retain/qos0/test", mid=1, qos=1, payload="retained message", retain=True) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.send(publish_packet) + + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + if mosq_test.expect_packet(sock, "publish", publish_packet2): + rc = 0 + + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/05-clean-session-qos1-helper.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/05-clean-session-qos1-helper.py new file mode 100755 index 0000000..6857aea --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/05-clean-session-qos1-helper.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +# Test whether a clean session client has a QoS 1 message queued for it. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 128 +publish_packet = mosq_test.gen_publish("qos1/clean_session/test", qos=1, mid=mid, payload="clean-session-message") +puback_packet = mosq_test.gen_puback(mid) + +port = mosq_test.get_port() +sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) +mosq_test.do_send_receive(sock, publish_packet, puback_packet, "puback") + +rc = 0 + +sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/05-clean-session-qos1.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/05-clean-session-qos1.py new file mode 100755 index 0000000..b7dd9ca --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/05-clean-session-qos1.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 + +# Test whether a clean session client has a QoS 1 message queued for it. + +from mosq_test_helper import * + +rc = 1 +mid = 109 +keepalive = 60 +connect_packet = mosq_test.gen_connect("clean-qos2-test", keepalive=keepalive, clean_session=False) +connack1_packet = mosq_test.gen_connack(flags=0, rc=0) +connack2_packet = mosq_test.gen_connack(flags=1, rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +subscribe_packet = mosq_test.gen_subscribe(mid, "qos1/clean_session/test", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +mid = 1 +publish_packet = mosq_test.gen_publish("qos1/clean_session/test", qos=1, mid=mid, payload="clean-session-message") +puback_packet = mosq_test.gen_puback(mid) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack1_packet, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + sock.send(disconnect_packet) + sock.close() + + pub = subprocess.Popen(['./05-clean-session-qos1-helper.py', str(port)], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + pub.wait() + (stdo, stde) = pub.communicate() + + # Now reconnect and expect a publish message. + sock = mosq_test.do_client_connect(connect_packet, connack2_packet, timeout=30, port=port) + if mosq_test.expect_packet(sock, "publish", publish_packet): + sock.send(puback_packet) + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/05-session-expiry-v5.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/05-session-expiry-v5.py new file mode 100755 index 0000000..96e41ad --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/05-session-expiry-v5.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python3 + +# MQTT v5. Test whether session expiry interval works correctly. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 + +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 1) +connect_packet = mosq_test.gen_connect("clean-qos2-test", keepalive=keepalive, clean_session=False, proto_ver=5, properties=props) +connack1_packet = mosq_test.gen_connack(flags=0, rc=0, proto_ver=5) + +connack2_packet = mosq_test.gen_connack(flags=1, rc=0, proto_ver=5) + +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 3) +disconnect_packet = mosq_test.gen_disconnect(proto_ver=5, properties=props) + +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 0) +disconnect2_packet = mosq_test.gen_disconnect(proto_ver=5, properties=props) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + # First connect, clean start is false, we expect a normal connack + sock = mosq_test.do_client_connect(connect_packet, connack1_packet, port=port, connack_error="connack 1") + # Forceful disconnect + sock.close() + + # Immediate second connect, clean start is false, we expect a connack with + # previous state + sock = mosq_test.do_client_connect(connect_packet, connack2_packet, port=port, connack_error="connack 2") + sock.close() + + # Session should expire in one second, so sleep longer + time.sleep(2) + + # Third connect, clean start is false, session should have expired so we + # expect a normal connack + sock = mosq_test.do_client_connect(connect_packet, connack1_packet, port=port, connack_error="connack 3") + # Send DISCONNECT with new session expiry, then close + sock.send(disconnect_packet) + sock.close() + + # Immediate reconnect, clean start is false, we expect a connack with + # previous state + sock = mosq_test.do_client_connect(connect_packet, connack2_packet, port=port, connack_error="connack 4") + # Send DISCONNECT with new session expiry, then close + sock.send(disconnect_packet) + sock.close() + + # Session should expire in three seconds if it has been updated, sleep for + # 2 to check it is updated from 1 second. + time.sleep(2) + + # Immediate reconnect, clean start is false, we expect a connack with + # previous state + sock = mosq_test.do_client_connect(connect_packet, connack2_packet, port=port, connack_error="connack 5") + # Send DISCONNECT with new session expiry, then close + sock.send(disconnect_packet) + sock.close() + + # Session should expire in three seconds, so sleep longer + time.sleep(4) + # Third connect, clean start is false, session should have expired so we + # expect a normal connack + sock = mosq_test.do_client_connect(connect_packet, connack1_packet, port=port, connack_error="connack 6") + # Send DISCONNECT with 0 session expiry, then close + sock.send(disconnect2_packet) + sock.close() + + # Immediate reconnect, session should have been removed. + sock = mosq_test.do_client_connect(connect_packet, connack1_packet, port=port, connack_error="connack 7") + sock.close() + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-b2br-disconnect-qos1.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-b2br-disconnect-qos1.py new file mode 100755 index 0000000..d45236e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-b2br-disconnect-qos1.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python3 + +# Does a bridge resend a QoS=1 message correctly after a disconnect? + +from mosq_test_helper import * + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("\n") + f.write("connection bridge_sample\n") + f.write("address 127.0.0.1:%d\n" % (port1)) + f.write("topic bridge/# both 1\n") + f.write("notifications false\n") + f.write("restart_timeout 5\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 60 +client_id = socket.gethostname()+".bridge_sample" +connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+4) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "bridge/#", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +mid = 2 +subscribe2_packet = mosq_test.gen_subscribe(mid, "bridge/#", 1) +suback2_packet = mosq_test.gen_suback(mid, 1) + +mid = 3 +publish_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=1, mid=mid, payload="disconnect-message") +publish_dup_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=1, mid=mid, payload="disconnect-message", dup=True) +puback_packet = mosq_test.gen_puback(mid) + +mid = 20 +publish2_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=1, mid=mid, payload="disconnect-message") +puback2_packet = mosq_test.gen_puback(mid) + +ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +ssock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock.settimeout(40) +ssock.bind(('', port1)) +ssock.listen(5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) + +try: + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "subscribe", subscribe_packet): + bridge.send(suback_packet) + + bridge.send(publish_packet) + # Bridge doesn't have time to respond but should expect us to retry + # and so remove PUBACK. + bridge.close() + + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "2nd subscribe", subscribe2_packet): + bridge.send(suback2_packet) + + # Send a different publish message to make sure the response isn't to the old one. + bridge.send(publish2_packet) + if mosq_test.expect_packet(bridge, "puback", puback2_packet): + rc = 0 + + bridge.close() +finally: + os.remove(conf_file) + try: + bridge.close() + except NameError: + pass + + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + ssock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-b2br-disconnect-qos2.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-b2br-disconnect-qos2.py new file mode 100755 index 0000000..8516f97 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-b2br-disconnect-qos2.py @@ -0,0 +1,114 @@ +#!/usr/bin/env python3 + +# Does a bridge resend a QoS=1 message correctly after a disconnect? + +from mosq_test_helper import * + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("\n") + f.write("connection bridge_sample\n") + f.write("address 127.0.0.1:%d\n" % (port1)) + f.write("topic bridge/# both 2\n") + f.write("notifications false\n") + f.write("restart_timeout 5\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 60 +client_id = socket.gethostname()+".bridge_sample" +connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+4) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "bridge/#", 2) +suback_packet = mosq_test.gen_suback(mid, 2) + +mid = 2 +subscribe2_packet = mosq_test.gen_subscribe(mid, "bridge/#", 2) +suback2_packet = mosq_test.gen_suback(mid, 2) + +mid = 3 +subscribe3_packet = mosq_test.gen_subscribe(mid, "bridge/#", 2) +suback3_packet = mosq_test.gen_suback(mid, 2) + +mid = 5 +publish_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=2, mid=mid, payload="disconnect-message") +publish_dup_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=2, mid=mid, payload="disconnect-message", dup=True) +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +ssock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock.settimeout(40) +ssock.bind(('', port1)) +ssock.listen(5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) + +try: + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "subscribe", subscribe_packet): + bridge.send(suback_packet) + + bridge.send(publish_packet) + bridge.close() + + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "2nd subscribe", subscribe2_packet): + bridge.send(suback2_packet) + bridge.send(publish_dup_packet) + + if mosq_test.expect_packet(bridge, "pubrec", pubrec_packet): + bridge.send(pubrel_packet) + bridge.close() + + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "3rd subscribe", subscribe3_packet): + bridge.send(suback3_packet) + + bridge.send(publish_dup_packet) + + if mosq_test.expect_packet(bridge, "2nd pubrec", pubrec_packet): + bridge.send(pubrel_packet) + + if mosq_test.expect_packet(bridge, "pubcomp", pubcomp_packet): + rc = 0 + + bridge.close() +finally: + os.remove(conf_file) + try: + bridge.close() + except NameError: + pass + + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + ssock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-b2br-late-connection-retain.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-b2br-late-connection-retain.py new file mode 100755 index 0000000..ba64621 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-b2br-late-connection-retain.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python3 + +# Does a bridge queue up retained messages correctly if the remote broker starts up late? + +from mosq_test_helper import * + +def write_config1(filename, persistence_file, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("\n") + f.write("persistence true\n") + f.write("persistence_file %s\n" % (persistence_file)) + +def write_config2(filename, persistence_file, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("\n") + f.write("connection bridge_sample\n") + f.write("address 127.0.0.1:%d\n" % (port1)) + f.write("topic bridge/# out 1\n") + f.write("notifications false\n") + f.write("bridge_attempt_unsubscribe false\n") + f.write("persistence true\n") + f.write("persistence_file %s\n" % (persistence_file)) + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +persistence_file = os.path.basename(__file__).replace('.py', '.db') + +rc = 1 +keepalive = 60 +client_id = socket.gethostname()+".bridge_sample" +connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+4) +connack_packet = mosq_test.gen_connack(rc=0) + +c_connect_packet = mosq_test.gen_connect("client", keepalive=keepalive) +c_connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +publish_packet = mosq_test.gen_publish("bridge/test", qos=1, mid=mid, payload="message", retain=True) +puback_packet = mosq_test.gen_puback(mid) + +ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +ssock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock.settimeout(40) +ssock.bind(('', port1)) +ssock.listen(5) + +write_config1(conf_file, persistence_file, port1, port2) +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) + +try: + client = mosq_test.do_client_connect(c_connect_packet, c_connack_packet, timeout=20, port=port2) + mosq_test.do_send_receive(client, publish_packet, puback_packet, "puback") + client.close() + + broker.terminate() + broker.wait() + + # Restart, with retained message in place + write_config2(conf_file, persistence_file, port1, port2) + broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) + + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "publish", publish_packet): + bridge.send(puback_packet) + # Guard against multiple retained messages of the same type by + # sending a pingreq to give us something to expect back. If we get + # a publish, it's a fail. + mosq_test.do_ping(bridge) + rc = 0 + + bridge.close() +finally: + os.remove(conf_file) + try: + bridge.close() + except NameError: + pass + + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + os.remove(persistence_file) + if rc: + print(stde.decode('utf-8')) + ssock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-b2br-late-connection.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-b2br-late-connection.py new file mode 100755 index 0000000..71b40f8 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-b2br-late-connection.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python3 + +# Does a bridge queue up messages correctly if the remote broker starts up late? + +from mosq_test_helper import * + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("\n") + f.write("connection bridge_sample\n") + f.write("address 127.0.0.1:%d\n" % (port1)) + f.write("topic bridge/# out 1\n") + f.write("notifications false\n") + f.write("bridge_attempt_unsubscribe false\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 60 +client_id = socket.gethostname()+".bridge_sample" +connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+4) +connack_packet = mosq_test.gen_connack(rc=0) + +c_connect_packet = mosq_test.gen_connect("client", keepalive=keepalive) +c_connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +publish_packet = mosq_test.gen_publish("bridge/test", qos=1, mid=mid, payload="message") +puback_packet = mosq_test.gen_puback(mid) + +ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +ssock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock.settimeout(40) +ssock.bind(('', port1)) +ssock.listen(5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) + +try: + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + client = mosq_test.do_client_connect(c_connect_packet, c_connack_packet, timeout=20, port=port2) + mosq_test.do_send_receive(client, publish_packet, puback_packet, "puback") + client.close() + # We've now sent a message to the broker that should be delivered to us via the bridge + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "publish", publish_packet): + rc = 0 + + bridge.close() +finally: + os.remove(conf_file) + try: + bridge.close() + except NameError: + pass + + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + ssock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-b2br-remapping.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-b2br-remapping.py new file mode 100755 index 0000000..e468117 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-b2br-remapping.py @@ -0,0 +1,129 @@ +#!/usr/bin/env python3 + +# Test remapping of topic name for incoming message + +from mosq_test_helper import * + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("\n") + f.write("connection bridge_sample\n") + f.write("address 127.0.0.1:%d\n" % (port1)) + f.write("bridge_attempt_unsubscribe false\n") + f.write("topic # in 0 local/topic/ remote/topic/\n") + f.write("topic prefix/# in 0 local2/topic/ remote2/topic/\n") + f.write("topic +/value in 0 local3/topic/ remote3/topic/\n") + f.write("topic ic/+ in 0 local4/top remote4/tip\n") + f.write("topic clients/total in 0 test/mosquitto/org $SYS/broker/\n") + f.write("notifications false\n") + f.write("restart_timeout 5\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 60 +client_id = socket.gethostname()+".bridge_sample" +connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+4) +connack_packet = mosq_test.gen_connack(rc=0) + +client_connect_packet = mosq_test.gen_connect("pub-test", keepalive=keepalive) +client_connack_packet = mosq_test.gen_connack(rc=0) + +ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +ssock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock.settimeout(4) +ssock.bind(('', port1)) +ssock.listen(5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) + + +def test(bridge, sock): + if not mosq_test.expect_packet(bridge, "connect", connect_packet): + return 1 + bridge.send(connack_packet) + + mid = 0 + patterns = [ + "remote/topic/#", + "remote2/topic/prefix/#", + "remote3/topic/+/value", + "remote4/tipic/+", + "$SYS/broker/clients/total", + ] + for pattern in ("remote/topic/#", "remote2/topic/prefix/#", "remote3/topic/+/value"): + mid += 1 + subscribe_packet = mosq_test.gen_subscribe(mid, pattern, 0) + suback_packet = mosq_test.gen_suback(mid, 0) + if not mosq_test.expect_packet(bridge, "subscribe", subscribe_packet): + return 1 + bridge.send(suback_packet) + + mid += 1 + subscribe_packet = mosq_test.gen_subscribe(mid, "#", 0) + suback_packet = mosq_test.gen_suback(mid, 0) + sock.send(subscribe_packet) + if not mosq_test.expect_packet(sock, "suback", suback_packet): + return 1 + + cases = [ + ('local/topic/something', 'remote/topic/something'), + ('local/topic/some/t/h/i/n/g', 'remote/topic/some/t/h/i/n/g'), + ('local/topic/value', 'remote/topic/value'), + # Don't work, #40 must be fixed before + # ('local/topic', 'remote/topic'), + ('local2/topic/prefix/something', 'remote2/topic/prefix/something'), + ('local3/topic/something/value', 'remote3/topic/something/value'), + ('local4/topic/something', 'remote4/tipic/something'), + ('test/mosquitto/orgclients/total', '$SYS/broker/clients/total'), + ] + + for (local_topic, remote_topic) in cases: + mid += 1 + remote_publish_packet = mosq_test.gen_publish( + remote_topic, qos=0, mid=mid, payload='' + ) + local_publish_packet = mosq_test.gen_publish( + local_topic, qos=0, mid=mid, payload='' + ) + + bridge.send(remote_publish_packet) + match = mosq_test.expect_packet(sock, "publish", local_publish_packet) + if not match: + print("Fail on cases local_topic=%r, remote_topic=%r" % ( + local_topic, remote_topic, + )) + return 1 + return 0 + +try: + (bridge, address) = ssock.accept() + bridge.settimeout(2) + + sock = mosq_test.do_client_connect( + client_connect_packet, client_connack_packet, + port=port2, + ) + + rc = test(bridge, sock) + + sock.close() + bridge.close() +finally: + os.remove(conf_file) + try: + bridge.close() + except NameError: + pass + + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + ssock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-br2b-disconnect-qos1-helper.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-br2b-disconnect-qos1-helper.py new file mode 100755 index 0000000..14e6651 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-br2b-disconnect-qos1-helper.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +port = mosq_test.get_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 128 +publish_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=1, mid=mid, payload="disconnect-message") +puback_packet = mosq_test.gen_puback(mid) + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port, connack_error="helper connack") +mosq_test.do_send_receive(sock, publish_packet, puback_packet, "helper puback") + +rc = 0 + +sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-br2b-disconnect-qos1.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-br2b-disconnect-qos1.py new file mode 100755 index 0000000..9022f7c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-br2b-disconnect-qos1.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python3 + +# Does a bridge resend a QoS=1 message correctly after a disconnect? + +from mosq_test_helper import * + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("\n") + f.write("connection bridge_sample\n") + f.write("address 127.0.0.1:%d\n" % (port1)) + f.write("topic bridge/# both 1\n") + f.write("notifications false\n") + f.write("restart_timeout 5\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 60 +client_id = socket.gethostname()+".bridge_sample" +connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+4) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "bridge/#", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +mid = 3 +subscribe2_packet = mosq_test.gen_subscribe(mid, "bridge/#", 1) +suback2_packet = mosq_test.gen_suback(mid, 1) + +mid = 2 +publish_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=1, mid=mid, payload="disconnect-message") +publish_dup_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=1, mid=mid, payload="disconnect-message", dup=True) +puback_packet = mosq_test.gen_puback(mid) + +ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +ssock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock.settimeout(40) +ssock.bind(('', port1)) +ssock.listen(5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) + +try: + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "subscribe", subscribe_packet): + bridge.send(suback_packet) + + pub = subprocess.Popen(['./06-bridge-br2b-disconnect-qos1-helper.py', str(port2)], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + if pub.wait(): + exit(1) + (stdo, stde) = pub.communicate() + + if mosq_test.expect_packet(bridge, "publish", publish_packet): + bridge.close() + + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "2nd connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "2nd subscribe", subscribe2_packet): + bridge.send(suback2_packet) + + if mosq_test.expect_packet(bridge, "2nd publish", publish_dup_packet): + rc = 0 + + bridge.close() +finally: + os.remove(conf_file) + try: + bridge.close() + except NameError: + pass + + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + ssock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-br2b-disconnect-qos2-helper.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-br2b-disconnect-qos2-helper.py new file mode 100755 index 0000000..ef11ca8 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-br2b-disconnect-qos2-helper.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +port = mosq_test.get_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 312 +publish_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=2, mid=mid, payload="disconnect-message") +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port, connack_error="helper connack") +sock.send(publish_packet) + +if mosq_test.expect_packet(sock, "helper pubrec", pubrec_packet): + sock.send(pubrel_packet) + + if mosq_test.expect_packet(sock, "helper pubcomp", pubcomp_packet): + rc = 0 + +sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-br2b-disconnect-qos2.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-br2b-disconnect-qos2.py new file mode 100755 index 0000000..ccd3c16 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-br2b-disconnect-qos2.py @@ -0,0 +1,116 @@ +#!/usr/bin/env python3 + +# Does a bridge resend a QoS=1 message correctly after a disconnect? + +from mosq_test_helper import * + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("\n") + f.write("connection bridge_sample\n") + f.write("address 127.0.0.1:%d\n" % (port1)) + f.write("topic bridge/# both 2\n") + f.write("notifications false\n") + f.write("restart_timeout 5\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 60 +client_id = socket.gethostname()+".bridge_sample" +connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+4) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "bridge/#", 2) +suback_packet = mosq_test.gen_suback(mid, 2) + +mid = 3 +subscribe2_packet = mosq_test.gen_subscribe(mid, "bridge/#", 2) +suback2_packet = mosq_test.gen_suback(mid, 2) + +mid = 4 +subscribe3_packet = mosq_test.gen_subscribe(mid, "bridge/#", 2) +suback3_packet = mosq_test.gen_suback(mid, 2) + +mid = 2 +publish_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=2, mid=mid, payload="disconnect-message") +publish_dup_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=2, mid=mid, payload="disconnect-message", dup=True) +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +ssock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock.settimeout(40) +ssock.bind(('', port1)) +ssock.listen(5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) + +try: + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "subscribe", subscribe_packet): + bridge.send(suback_packet) + + pub = subprocess.Popen(['./06-bridge-br2b-disconnect-qos2-helper.py', str(port2)], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + if pub.wait(): + exit(1) + (stdo, stde) = pub.communicate() + + if mosq_test.expect_packet(bridge, "publish", publish_packet): + bridge.close() + + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "2nd subscribe", subscribe2_packet): + bridge.send(suback2_packet) + + if mosq_test.expect_packet(bridge, "2nd publish", publish_dup_packet): + bridge.send(pubrec_packet) + + if mosq_test.expect_packet(bridge, "pubrel", pubrel_packet): + bridge.close() + + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "3rd subscribe", subscribe3_packet): + bridge.send(suback3_packet) + + if mosq_test.expect_packet(bridge, "2nd pubrel", pubrel_packet): + bridge.send(pubcomp_packet) + rc = 0 + + bridge.close() +finally: + os.remove(conf_file) + try: + bridge.close() + except NameError: + pass + + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + ssock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-br2b-remapping.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-br2b-remapping.py new file mode 100755 index 0000000..ab29a08 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-br2b-remapping.py @@ -0,0 +1,116 @@ +#!/usr/bin/env python3 + +# Test remapping of topic name for outgoing message + +from mosq_test_helper import * + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("\n") + f.write("connection bridge_sample\n") + f.write("address 127.0.0.1:%d\n" % (port1)) + f.write("bridge_attempt_unsubscribe false\n") + f.write("topic # out 0 local/topic/ remote/topic/\n") + f.write("topic prefix/# out 0 local2/topic/ remote2/topic/\n") + f.write("topic +/value out 0 local3/topic/ remote3/topic/\n") + f.write("topic ic/+ out 0 local4/top remote4/tip\n") + f.write("# this one is invalid\n") + f.write("topic +/value out 0 local5/top remote5/tip\n") + f.write("notifications false\n") + f.write("restart_timeout 5\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 60 +client_id = socket.gethostname()+".bridge_sample" +connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+4) +connack_packet = mosq_test.gen_connack(rc=0) + +client_connect_packet = mosq_test.gen_connect("pub-test", keepalive=keepalive) +client_connack_packet = mosq_test.gen_connack(rc=0) + +ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +ssock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock.settimeout(4) +ssock.bind(('', port1)) +ssock.listen(5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) + + +def test(bridge, sock): + if not mosq_test.expect_packet(bridge, "connect", connect_packet): + return 1 + + bridge.send(connack_packet) + + cases = [ + ('local/topic/something', 'remote/topic/something'), + ('local/topic/some/t/h/i/n/g', 'remote/topic/some/t/h/i/n/g'), + ('local/topic/value', 'remote/topic/value'), + # Don't work, #40 must be fixed before + # ('local/topic', 'remote/topic'), + ('local2/topic/something', None), # don't match topic pattern + ('local2/topic/prefix/something', 'remote2/topic/prefix/something'), + ('local3/topic/something/value', 'remote3/topic/something/value'), + ('local4/topic/something', 'remote4/tipic/something'), + ('local5/topic/something', None), + ] + + mid = 3 + for (local_topic, remote_topic) in cases: + mid += 1 + local_publish_packet = mosq_test.gen_publish( + local_topic, qos=0, mid=mid, payload='' + ) + sock.send(local_publish_packet) + if remote_topic: + remote_publish_packet = mosq_test.gen_publish( + remote_topic, qos=0, mid=mid, payload='' + ) + match = mosq_test.expect_packet(bridge, "publish", remote_publish_packet) + if not match: + print("Fail on cases local_topic=%r, remote_topic=%r" % ( + local_topic, remote_topic, + )) + return 1 + else: + time.sleep(1) + mosq_test.do_ping(bridge, + "FAIL: Received data when nothing is expected\nFail on cases local_topic=%r, remote_topic=%r" % ( + local_topic, remote_topic, + )) + return 0 + +try: + (bridge, address) = ssock.accept() + bridge.settimeout(2) + + sock = mosq_test.do_client_connect( + client_connect_packet, client_connack_packet, + port=port2, + ) + + rc = test(bridge, sock) + + sock.close() + bridge.close() +finally: + os.remove(conf_file) + try: + bridge.close() + except NameError: + pass + + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + ssock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-fail-persist-resend-qos1.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-fail-persist-resend-qos1.py new file mode 100755 index 0000000..5c5866e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-fail-persist-resend-qos1.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3 + +# Test whether a bridge can cope with an unknown PUBACK + +from mosq_test_helper import * + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("\n") + f.write("connection bridge-u-test\n") + f.write("remote_clientid bridge-u-test\n") + f.write("address 127.0.0.1:%d\n" % (port1)) + f.write("topic bridge/# out\n") + f.write("\n") + f.write("cleansession true\n") + f.write("notifications false\n") + f.write("restart_timeout 5\n") + f.write("try_private false\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("bridge-u-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 180 +mid_unknown = 2000 + +publish_packet = mosq_test.gen_publish("bridge/unknown/qos1", qos=1, payload="bridge-message", mid=mid) +puback_packet = mosq_test.gen_puback(mid) +puback_packet_unknown = mosq_test.gen_puback(mid_unknown) + + +unsubscribe_packet = mosq_test.gen_unsubscribe(1, "bridge/#") +unsuback_packet = mosq_test.gen_unsuback(1) + + +if os.environ.get('MOSQ_USE_VALGRIND') is not None: + sleep_time = 5 +else: + sleep_time = 0.5 + + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port1)) +sock.listen(5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) +time.sleep(sleep_time) + +try: + (conn, address) = sock.accept() + conn.settimeout(20) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "unsubscribe", unsubscribe_packet): + conn.send(unsuback_packet) + + # Send the unexpected puback packet + conn.send(puback_packet_unknown) + + # Send a legitimate publish packet to verify everything is still ok + conn.send(publish_packet) + + if mosq_test.expect_packet(conn, "puback", puback_packet): + rc = 0 + +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-fail-persist-resend-qos2.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-fail-persist-resend-qos2.py new file mode 100755 index 0000000..486a77b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-fail-persist-resend-qos2.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python3 + +# Test whether a bridge can cope with an unknown PUBACK + +from mosq_test_helper import * + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("\n") + f.write("connection bridge-u-test\n") + f.write("remote_clientid bridge-u-test\n") + f.write("address 127.0.0.1:%d\n" % (port1)) + f.write("topic bridge/# out\n") + f.write("\n") + f.write("cleansession true\n") + f.write("notifications false\n") + f.write("restart_timeout 5\n") + f.write("try_private false\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("bridge-u-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 180 +mid_unknown = 2000 + +publish_packet = mosq_test.gen_publish("bridge/unknown/qos2", qos=1, payload="bridge-message", mid=mid) +puback_packet = mosq_test.gen_puback(mid) + +pubrec_packet_unknown1 = mosq_test.gen_pubrec(mid_unknown+1) +pubrel_packet_unknown1 = mosq_test.gen_pubrel(mid_unknown+1) + +pubrel_packet_unknown2 = mosq_test.gen_pubrel(mid_unknown+2) +pubcomp_packet_unknown2 = mosq_test.gen_pubcomp(mid_unknown+2) + +pubcomp_packet_unknown3 = mosq_test.gen_pubcomp(mid_unknown+3) + + +unsubscribe_packet = mosq_test.gen_unsubscribe(1, "bridge/#") +unsuback_packet = mosq_test.gen_unsuback(1) + + +if os.environ.get('MOSQ_USE_VALGRIND') is not None: + sleep_time = 5 +else: + sleep_time = 0.5 + + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port1)) +sock.listen(5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) +time.sleep(sleep_time) + +try: + (conn, address) = sock.accept() + conn.settimeout(20) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "unsubscribe", unsubscribe_packet): + conn.send(unsuback_packet) + + # Send the unexpected pubrec packet + conn.send(pubrec_packet_unknown1) + if mosq_test.expect_packet(conn, "pubrel", pubrel_packet_unknown1): + + conn.send(pubrel_packet_unknown2) + if mosq_test.expect_packet(conn, "pubcomp", pubcomp_packet_unknown2): + + conn.send(pubcomp_packet_unknown3) + + # Send a legitimate publish packet to verify everything is still ok + conn.send(publish_packet) + + if mosq_test.expect_packet(conn, "puback", puback_packet): + rc = 0 + +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-no-local.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-no-local.py new file mode 100755 index 0000000..7b54a14 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-no-local.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 + +# Check whether an incoming bridge connection receives its own messages. It +# shouldn't because for v3.1 and v3.1.1 we have no-local set for all bridges. + +from mosq_test_helper import * + +port = mosq_test.get_port() + +def do_test(proto_ver_connect, proto_ver_msgs, sub_opts): + rc = 1 + keepalive = 60 + connect_packet = mosq_test.gen_connect("bridge-test", keepalive=keepalive, proto_ver=proto_ver_connect) + connack_packet = mosq_test.gen_connack(rc=0, proto_ver=proto_ver_msgs) + + mid = 1 + subscribe_packet = mosq_test.gen_subscribe(mid, "loop/test", 0 | sub_opts, proto_ver=proto_ver_msgs) + suback_packet = mosq_test.gen_suback(mid, 0, proto_ver=proto_ver_msgs) + + publish_packet = mosq_test.gen_publish("loop/test", qos=0, payload="message", proto_ver=proto_ver_msgs) + + port = mosq_test.get_port() + broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + + try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + sock.send(publish_packet) + mosq_test.do_ping(sock) + rc = 0 + + sock.close() + finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + exit(rc) + +do_test(128+3, 3, 0) +do_test(128+4, 4, 0) +do_test(5, 5, mqtt5_opts.MQTT_SUB_OPT_NO_LOCAL) + +exit(0) + + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-per-listener-settings.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-per-listener-settings.py new file mode 100755 index 0000000..f714b5c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-per-listener-settings.py @@ -0,0 +1,131 @@ +#!/usr/bin/env python3 + +# Test remapping of topic name for incoming message + +from mosq_test_helper import * + +def write_config(filename, port1, port2, port3): + with open(filename, 'w') as f: + f.write("per_listener_settings true\n") + f.write("port %d\n" % (port2)) + f.write("listener %d 127.0.0.1\n" % (port3)) + f.write("\n") + f.write("connection bridge_sample\n") + f.write("address 127.0.0.1:%d\n" % (port1)) + f.write("bridge_attempt_unsubscribe false\n") + f.write("topic # in 0 local/topic/ remote/topic/\n") + f.write("topic prefix/# in 0 local2/topic/ remote2/topic/\n") + f.write("topic +/value in 0 local3/topic/ remote3/topic/\n") + f.write("topic ic/+ in 0 local4/top remote4/tip\n") + f.write("topic clients/total in 0 test/mosquitto/org $SYS/broker/\n") + f.write("notifications false\n") + f.write("restart_timeout 5\n") + +(port1, port2, port3) = mosq_test.get_port(3) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2, port3) + +rc = 1 +keepalive = 60 +client_id = socket.gethostname()+".bridge_sample" +connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+4) +connack_packet = mosq_test.gen_connack(rc=0) + +client_connect_packet = mosq_test.gen_connect("pub-test", keepalive=keepalive) +client_connack_packet = mosq_test.gen_connack(rc=0) + +ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +ssock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock.settimeout(4) +ssock.bind(('', port1)) +ssock.listen(5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) + + +def test(bridge, sock): + if not mosq_test.expect_packet(bridge, "connect", connect_packet): + return 1 + bridge.send(connack_packet) + + mid = 0 + patterns = [ + "remote/topic/#", + "remote2/topic/prefix/#", + "remote3/topic/+/value", + "remote4/tipic/+", + "$SYS/broker/clients/total", + ] + for pattern in ("remote/topic/#", "remote2/topic/prefix/#", "remote3/topic/+/value"): + mid += 1 + subscribe_packet = mosq_test.gen_subscribe(mid, pattern, 0) + suback_packet = mosq_test.gen_suback(mid, 0) + if not mosq_test.expect_packet(bridge, "subscribe", subscribe_packet): + return 1 + bridge.send(suback_packet) + + mid += 1 + subscribe_packet = mosq_test.gen_subscribe(mid, "#", 0) + suback_packet = mosq_test.gen_suback(mid, 0) + sock.send(subscribe_packet) + if not mosq_test.expect_packet(sock, "suback", suback_packet): + return 1 + + cases = [ + ('local/topic/something', 'remote/topic/something'), + ('local/topic/some/t/h/i/n/g', 'remote/topic/some/t/h/i/n/g'), + ('local/topic/value', 'remote/topic/value'), + # Don't work, #40 must be fixed before + # ('local/topic', 'remote/topic'), + ('local2/topic/prefix/something', 'remote2/topic/prefix/something'), + ('local3/topic/something/value', 'remote3/topic/something/value'), + ('local4/topic/something', 'remote4/tipic/something'), + ('test/mosquitto/orgclients/total', '$SYS/broker/clients/total'), + ] + + for (local_topic, remote_topic) in cases: + mid += 1 + remote_publish_packet = mosq_test.gen_publish( + remote_topic, qos=0, mid=mid, payload='' + ) + local_publish_packet = mosq_test.gen_publish( + local_topic, qos=0, mid=mid, payload='' + ) + + bridge.send(remote_publish_packet) + match = mosq_test.expect_packet(sock, "publish", local_publish_packet) + if not match: + print("Fail on cases local_topic=%r, remote_topic=%r" % ( + local_topic, remote_topic, + )) + return 1 + return 0 + +try: + (bridge, address) = ssock.accept() + bridge.settimeout(2) + + sock = mosq_test.do_client_connect( + client_connect_packet, client_connack_packet, + port=port2, + ) + + rc = test(bridge, sock) + + sock.close() + bridge.close() +finally: + os.remove(conf_file) + try: + bridge.close() + except NameError: + pass + + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + ssock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-reconnect-local-out-helper.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-reconnect-local-out-helper.py new file mode 100755 index 0000000..359d508 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-reconnect-local-out-helper.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +port = mosq_test.get_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("bridge/reconnect", qos=1, mid=1, payload="bridge-reconnect-message") +puback_packet = mosq_test.gen_puback(mid=1) + +disconnect_packet = mosq_test.gen_disconnect() + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port, connack_error="helper connack") +mosq_test.do_send_receive(sock, publish_packet, puback_packet, "puback") + +sock.send(disconnect_packet) +rc = 0 + +sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-reconnect-local-out.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-reconnect-local-out.py new file mode 100755 index 0000000..0b360b2 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/06-bridge-reconnect-local-out.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python3 + +# Test whether a bridge topics work correctly after reconnection. +# Important point here is that persistence is enabled. + +from mosq_test_helper import * + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("\n") + f.write("persistence true\n") + f.write("persistence_file mosquitto-%d.db" % (port1)) + f.write("\n") + f.write("connection bridge_sample\n") + f.write("address 127.0.0.1:%d\n" % (port1)) + f.write("topic bridge/# out\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = '06-bridge-reconnect-local-out.conf' +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("bridge-reconnect-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 180 +subscribe_packet = mosq_test.gen_subscribe(mid, "bridge/#", 0) +suback_packet = mosq_test.gen_suback(mid, 0) +publish_packet = mosq_test.gen_publish("bridge/reconnect", qos=0, payload="bridge-reconnect-message") + +try: + os.remove('mosquitto-%d.db' % (port1)) +except OSError: + pass + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port1, use_conf=False) + +local_cmd = ['../../src/mosquitto', '-c', '06-bridge-reconnect-local-out.conf'] +local_broker = mosq_test.start_broker(cmd=local_cmd, filename=os.path.basename(__file__)+'_local1', use_conf=False, port=port2) +if os.environ.get('MOSQ_USE_VALGRIND') is not None: + time.sleep(5) +else: + time.sleep(0.5) +local_broker.terminate() +local_broker.wait() +if os.environ.get('MOSQ_USE_VALGRIND') is not None: + time.sleep(5) +else: + time.sleep(0.5) +local_broker = mosq_test.start_broker(cmd=local_cmd, filename=os.path.basename(__file__)+'_local2', port=port2) +if os.environ.get('MOSQ_USE_VALGRIND') is not None: + time.sleep(5) +else: + time.sleep(0.5) + +pub = None +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port1) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + pub = subprocess.Popen(['./06-bridge-reconnect-local-out-helper.py', str(port2)], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + pub.wait() + (stdo, stde) = pub.communicate() + # Should have now received a publish command + + if mosq_test.expect_packet(sock, "publish", publish_packet): + rc = 0 + + sock.close() +finally: + os.remove(conf_file) + time.sleep(1) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + local_broker.terminate() + local_broker.wait() + if rc: + (stdo, stde) = local_broker.communicate() + print(stde.decode('utf-8')) + if pub: + (stdo, stde) = pub.communicate() + print(stdo.decode('utf-8')) + + try: + os.remove('mosquitto-%d.db' % (port1)) + except OSError: + pass + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-delay-reconnect.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-delay-reconnect.py new file mode 100755 index 0000000..2f435f3 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-delay-reconnect.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 + +# Test whether a client with a will delay handles correctly on the client reconnecting +# First connection is durable, second is clean session, and without a will, so the will should not be received. +# MQTT 5 + +from mosq_test_helper import * + + +def do_test(): + rc = 1 + keepalive = 60 + + mid = 1 + connect1_packet = mosq_test.gen_connect("will-qos0-test", keepalive=keepalive, proto_ver=5) + connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + + props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_WILL_DELAY_INTERVAL, 3) + connect2a_packet = mosq_test.gen_connect("will-helper", keepalive=keepalive, proto_ver=5, will_topic="will/test", will_payload=b"will delay", will_properties=props, clean_session=False) + connack2a_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + + connect2b_packet = mosq_test.gen_connect("will-helper", keepalive=keepalive, proto_ver=5, clean_session=True) + connack2b_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + + subscribe_packet = mosq_test.gen_subscribe(mid, "will/test", 0, proto_ver=5) + suback_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + + port = mosq_test.get_port() + broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + + try: + sock1 = mosq_test.do_client_connect(connect1_packet, connack1_packet, timeout=30, port=port) + mosq_test.do_send_receive(sock1, subscribe_packet, suback_packet, "suback") + + sock2 = mosq_test.do_client_connect(connect2a_packet, connack2a_packet, timeout=30, port=port) + sock2.close() + + time.sleep(1) + sock2 = mosq_test.do_client_connect(connect2b_packet, connack2b_packet, timeout=30, port=port) + time.sleep(3) + + # The client2 has reconnected within the original will delay interval, which has now + # passed, but it should have been deleted anyway. Disconnect and see + # whether we get the old will. We should not. + sock2.close() + + mosq_test.do_ping(sock1) + rc = 0 + + sock1.close() + sock2.close() + finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + exit(rc) + + +do_test() diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-delay-recover.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-delay-recover.py new file mode 100755 index 0000000..852c549 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-delay-recover.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 + +# Test whether a client with a will delay recovers on the client reconnecting +# MQTT 5 + +from mosq_test_helper import * + + +def do_test(clean_session): + rc = 1 + keepalive = 60 + + mid = 1 + connect1_packet = mosq_test.gen_connect("will-qos0-test", keepalive=keepalive, proto_ver=5) + connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + + connect_props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 30) + props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_WILL_DELAY_INTERVAL, 3) + connect2_packet = mosq_test.gen_connect("will-helper", keepalive=keepalive, proto_ver=5, will_topic="will/test", will_payload=b"will delay", will_properties=props, clean_session=clean_session, properties=connect_props) + connack2a_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + if clean_session == True: + connack2b_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + else: + connack2b_packet = mosq_test.gen_connack(rc=0, proto_ver=5, flags=1) + + subscribe_packet = mosq_test.gen_subscribe(mid, "will/test", 0, proto_ver=5) + suback_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + + port = mosq_test.get_port() + broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + + try: + sock1 = mosq_test.do_client_connect(connect1_packet, connack1_packet, timeout=30, port=port) + mosq_test.do_send_receive(sock1, subscribe_packet, suback_packet, "suback") + + sock2 = mosq_test.do_client_connect(connect2_packet, connack2a_packet, timeout=30, port=port) + sock2.close() + + time.sleep(1) + sock2 = mosq_test.do_client_connect(connect2_packet, connack2b_packet, timeout=30, port=port) + time.sleep(3) + + # The client2 has reconnected within the will delay interval, which has now + # passed. We should not have received the will at this point. + mosq_test.do_ping(sock1) + rc = 0 + + sock1.close() + sock2.close() + finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + exit(rc) + + +do_test(clean_session=True) +do_test(clean_session=False) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-delay.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-delay.py new file mode 100755 index 0000000..796356d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-delay.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 + +# Test whether a client will is transmitted with a delay correctly. +# MQTT 5 + +from mosq_test_helper import * + +def do_test(clean_session): + rc = 1 + keepalive = 60 + + mid = 1 + connect1_packet = mosq_test.gen_connect("will-qos0-test", keepalive=keepalive, proto_ver=5) + connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + + props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_WILL_DELAY_INTERVAL, 3) + connect2_packet = mosq_test.gen_connect("will-helper", keepalive=keepalive, proto_ver=5, will_topic="will/test", will_payload=b"will delay", will_qos=2, will_properties=props, clean_session=clean_session) + connack2_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + + subscribe_packet = mosq_test.gen_subscribe(mid, "will/test", 0, proto_ver=5) + suback_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + + publish_packet = mosq_test.gen_publish("will/test", qos=0, payload="will delay", proto_ver=5) + + port = mosq_test.get_port() + broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + + try: + sock1 = mosq_test.do_client_connect(connect1_packet, connack1_packet, timeout=30, port=port) + mosq_test.do_send_receive(sock1, subscribe_packet, suback_packet, "suback") + + sock2 = mosq_test.do_client_connect(connect2_packet, connack2_packet, timeout=30, port=port) + sock2.close() + + t_start = time.time() + if mosq_test.expect_packet(sock1, "publish", publish_packet): + t_finish = time.time() + if t_finish - t_start > 2 and t_finish - t_start < 5: + rc = 0 + + sock1.close() + finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + exit(rc) + +do_test(clean_session=True) +do_test(clean_session=False) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-disconnect-with-will.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-disconnect-with-will.py new file mode 100755 index 0000000..6bbd542 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-disconnect-with-will.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 + +# Test whether a client will is transmitted when a client disconnects with DISCONNECT with will. +# MQTT 5 + +from mosq_test_helper import * + +def do_test(): + rc = 1 + keepalive = 60 + + mid = 1 + connect1_packet = mosq_test.gen_connect("will-qos0-test", keepalive=keepalive, proto_ver=5) + connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + + connect2_packet = mosq_test.gen_connect("will-helper", keepalive=keepalive, proto_ver=5, will_topic="will/test", will_payload=b"will delay", will_qos=2) + connack2_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + disconnect_packet = mosq_test.gen_disconnect(reason_code=4, proto_ver=5) + + subscribe_packet = mosq_test.gen_subscribe(mid, "will/test", 0, proto_ver=5) + suback_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + + publish_packet = mosq_test.gen_publish("will/test", qos=0, payload="will delay", proto_ver=5) + + port = mosq_test.get_port() + broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + + try: + sock1 = mosq_test.do_client_connect(connect1_packet, connack1_packet, timeout=30, port=port) + mosq_test.do_send_receive(sock1, subscribe_packet, suback_packet, "suback") + + sock2 = mosq_test.do_client_connect(connect2_packet, connack2_packet, timeout=30, port=port) + sock2.send(disconnect_packet) + + if mosq_test.expect_packet(sock1, "publish", publish_packet): + rc = 0 + + sock2.close() + sock1.close() + finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + exit(rc) + +do_test() diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-invalid-utf8.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-invalid-utf8.py new file mode 100755 index 0000000..3c5b3ee --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-invalid-utf8.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 + +# Test whether a will topic with invalid UTF-8 fails + +from mosq_test_helper import * + +rc = 1 +mid = 53 +keepalive = 60 +connect_packet = mosq_test.gen_connect("will-invalid-utf8", keepalive=keepalive, will_topic="invalid/utf8") + +b = list(struct.unpack("B"*len(connect_packet), connect_packet)) +b[40] = 0 # Topic should never have a 0x0000 +connect_packet = struct.pack("B"*len(b), *b) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, b"", timeout=30, port=port) + rc = 0 + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-no-flag.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-no-flag.py new file mode 100755 index 0000000..27bed5d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-no-flag.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 + +# Test whether a connection is disconnected if it sets the will flag but does +# not provide a will payload. + +from mosq_test_helper import * + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("will-no-payload", keepalive=keepalive, will_topic="will/topic", will_qos=1, will_retain=True) +b = list(struct.unpack("B"*len(connect_packet), connect_packet)) + +bmod = b[0:len(b)-2] +bmod[1] = bmod[1] - 2 # Reduce remaining length by two to remove final two payload length values + +connect_packet = struct.pack("B"*len(bmod), *bmod) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, b"", port=port) + sock.close() + rc = 0 +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-null-helper.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-null-helper.py new file mode 100755 index 0000000..7e56f42 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-null-helper.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +# Connect a client with a will, then disconnect without DISCONNECT. + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive, will_topic="will/null/test") +connack_packet = mosq_test.gen_connack(rc=0) + +port = mosq_test.get_port() +sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) +rc = 0 +sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-null-topic.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-null-topic.py new file mode 100755 index 0000000..b600754 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-null-topic.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +import struct + +from mosq_test_helper import * + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("will-null-topic", keepalive=keepalive, will_topic="", will_payload=struct.pack("!4sB7s", b"will", 0, b"message")) +connack_packet = mosq_test.gen_connack(rc=2) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, b"", timeout=30, port=port) + rc = 0 + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-null.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-null.py new file mode 100755 index 0000000..2ac2432 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-null.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 + +# Test whether a client will is transmitted correctly with a null character in the middle. + +from mosq_test_helper import * + +rc = 1 +mid = 53 +keepalive = 60 +connect_packet = mosq_test.gen_connect("will-qos0-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "will/null/test", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +publish_packet = mosq_test.gen_publish("will/null/test", qos=0) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=30, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + will = subprocess.Popen(['./07-will-null-helper.py', str(port)], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + will.wait() + (stdo, stde) = will.communicate() + + if mosq_test.expect_packet(sock, "publish", publish_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-properties.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-properties.py new file mode 100755 index 0000000..b9e78d0 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-properties.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python3 + +# Test for bug #1244. This occurs if a V5 will message is used where the first +# Will property is one of: content-type, payload-format-indicator, +# response-topic. These are the properties that are attached to the will for +# later use, as opposed to e.g. will-delay-interval which is a value which is +# read immediately and not passed + +from mosq_test_helper import * + +def do_test(will_props, recvd_props): + rc = 1 + keepalive = 60 + + mid = 1 + connect1_packet = mosq_test.gen_connect("will-helper", keepalive=keepalive, proto_ver=5) + connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + + subscribe1_packet = mosq_test.gen_subscribe(mid, "will/test", 0, proto_ver=5) + suback1_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + + connect2_packet = mosq_test.gen_connect("will-test", keepalive=keepalive, proto_ver=5, will_topic="will/test", will_payload=b"will payload", will_properties=will_props) + connack2_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + + publish_packet = mosq_test.gen_publish("will/test", qos=0, payload="will payload", proto_ver=5, properties=recvd_props) + + port = mosq_test.get_port() + broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + + try: + sock1 = mosq_test.do_client_connect(connect1_packet, connack1_packet, timeout=30, port=port) + mosq_test.do_send_receive(sock1, subscribe1_packet, suback1_packet, "suback") + + sock2 = mosq_test.do_client_connect(connect2_packet, connack2_packet, timeout=30, port=port) + sock2.close() + + if mosq_test.expect_packet(sock1, "publish", publish_packet): + rc = 0 + + sock1.close() + finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + exit(rc) + + +# Single test property +will_props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_RESPONSE_TOPIC, "response/topic") +#do_test(will_props, will_props) + +# Multiple test properties +will_props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_RESPONSE_TOPIC, "response/topic") +will_props += mqtt5_props.gen_byte_prop(mqtt5_props.PROP_PAYLOAD_FORMAT_INDICATOR, 0) +#do_test(will_props, will_props) + +# Multiple test properties, with property that is removed +will_props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_RESPONSE_TOPIC, "response/topic") +will_props += mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_WILL_DELAY_INTERVAL, 0) +will_props += mqtt5_props.gen_byte_prop(mqtt5_props.PROP_PAYLOAD_FORMAT_INDICATOR, 0) + +recv_props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_RESPONSE_TOPIC, "response/topic") +recv_props += mqtt5_props.gen_byte_prop(mqtt5_props.PROP_PAYLOAD_FORMAT_INDICATOR, 0) +#do_test(will_props, recv_props) + +# Multiple test properties, with property that is removed *first* +will_props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_WILL_DELAY_INTERVAL, 0) +will_props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_RESPONSE_TOPIC, "response/topic") +will_props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_CORRELATION_DATA, "data") + +recv_props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_RESPONSE_TOPIC, "response/topic") +recv_props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_CORRELATION_DATA, "data") +#do_test(will_props, recv_props) + +# All properties, plus multiple user properties (excluding +# message-expiry-interval, for ease of testing reasons) +will_props = mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key1", "value1") +will_props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_RESPONSE_TOPIC, "response/topic") +will_props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_CORRELATION_DATA, "data") +will_props += mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_WILL_DELAY_INTERVAL, 0) +will_props += mqtt5_props.gen_byte_prop(mqtt5_props.PROP_PAYLOAD_FORMAT_INDICATOR, 1) +will_props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_CONTENT_TYPE, "application/test") +will_props += mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key2", "value2") + +recv_props = mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key1", "value1") +recv_props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_RESPONSE_TOPIC, "response/topic") +recv_props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_CORRELATION_DATA, "data") +recv_props += mqtt5_props.gen_byte_prop(mqtt5_props.PROP_PAYLOAD_FORMAT_INDICATOR, 1) +recv_props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_CONTENT_TYPE, "application/test") +recv_props += mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key2", "value2") +do_test(will_props, recv_props) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-qos0.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-qos0.py new file mode 100755 index 0000000..bf28439 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-qos0.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 + +# Test whether a client will is transmitted correctly. + +from mosq_test_helper import * + + +def do_test(proto_ver, clean_session): + rc = 1 + mid = 53 + keepalive = 60 + connect1_packet = mosq_test.gen_connect("will-qos0-test", keepalive=keepalive, proto_ver=proto_ver) + connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=proto_ver) + + if proto_ver == 5: + props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 100) + else: + props = None + + connect2_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive, will_topic="will/qos0/test", will_payload=b"will-message", clean_session=clean_session, proto_ver=proto_ver, properties=props) + connack2_packet = mosq_test.gen_connack(rc=0, proto_ver=proto_ver) + + subscribe_packet = mosq_test.gen_subscribe(mid, "will/qos0/test", 0, proto_ver=proto_ver) + suback_packet = mosq_test.gen_suback(mid, 0, proto_ver=proto_ver) + + publish_packet = mosq_test.gen_publish("will/qos0/test", qos=0, payload="will-message", proto_ver=proto_ver) + + port = mosq_test.get_port() + broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + + try: + sock = mosq_test.do_client_connect(connect1_packet, connack1_packet, timeout=5, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + sock2 = mosq_test.do_client_connect(connect2_packet, connack2_packet, port=port, timeout=5) + sock2.close() + + if mosq_test.expect_packet(sock, "publish", publish_packet): + rc = 0 + + sock.close() + except Exception as e: + print(e) + finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + exit(rc) + +do_test(4, True) +do_test(4, False) +do_test(5, True) +do_test(5, False) +exit(0) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-reconnect-1273.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-reconnect-1273.py new file mode 100755 index 0000000..bd8a5a5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/07-will-reconnect-1273.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python3 + +# Test whether a persistent client that disconnects with DISCONNECT has its +# will published when it reconnects. It shouldn't. Bug 1273: +# https://github.com/eclipse/mosquitto/issues/1273 + +from mosq_test_helper import * + + +def do_test(proto_ver): + rc = 1 + keepalive = 60 + + connect1_packet = mosq_test.gen_connect("will-sub", keepalive=keepalive, proto_ver=proto_ver) + connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=proto_ver) + + mid = 1 + subscribe1_packet = mosq_test.gen_subscribe(mid, "will/test", 0, proto_ver=proto_ver) + suback1_packet = mosq_test.gen_suback(mid, 0, proto_ver=proto_ver) + + if proto_ver == 5: + props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 100) + else: + props = None + + connect2_packet = mosq_test.gen_connect("will-1273", keepalive=keepalive, will_topic="will/test", will_payload=b"will msg",clean_session=False, proto_ver=proto_ver, properties=props) + connack2a_packet = mosq_test.gen_connack(rc=0, proto_ver=proto_ver) + connack2b_packet = mosq_test.gen_connack(rc=0, flags=1, proto_ver=proto_ver) + + disconnect_packet = mosq_test.gen_disconnect(proto_ver=proto_ver) + + publish_packet = mosq_test.gen_publish("will/test", qos=0, payload="alive", proto_ver=proto_ver) + + port = mosq_test.get_port() + broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + + try: + # Connect and subscribe will-sub + sock1 = mosq_test.do_client_connect(connect1_packet, connack1_packet, timeout=30, port=port, connack_error="connack1") + mosq_test.do_send_receive(sock1, subscribe1_packet, suback1_packet, "suback") + + # Connect will-1273 + sock2 = mosq_test.do_client_connect(connect2_packet, connack2a_packet, timeout=30, port=port) + # Publish our "alive" message + sock2.send(publish_packet) + # Clean disconnect + sock2.send(disconnect_packet) + + # will-1273 should get the "alive" + mosq_test.expect_packet(sock1, "publish1", publish_packet) + + sock2.close() + + # Reconnect + sock2 = mosq_test.do_client_connect(connect2_packet, connack2b_packet, timeout=30, port=port, connack_error="connack2") + # will-1273 to publish "alive" again, and will-sub to receive it. + sock2.send(publish_packet) + mosq_test.expect_packet(sock1, "publish2", publish_packet) + # Do a ping to make sure there are no other packets received. + mosq_test.do_ping(sock1) + rc = 0 + + sock1.close() + sock2.close() + finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + exit(rc) + +do_test(4) +do_test(5) +exit(0) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-bridge-helper.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-bridge-helper.py new file mode 100755 index 0000000..8531143 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-bridge-helper.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +port = mosq_test.get_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("bridge/ssl/test", qos=0, payload="message") + +disconnect_packet = mosq_test.gen_disconnect() + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port, connack_error="helper connack") +sock.send(publish_packet) +sock.send(disconnect_packet) +sock.close() + +exit(0) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-bridge.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-bridge.py new file mode 100755 index 0000000..a2641c3 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-bridge.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("\n") + f.write("connection bridge_test\n") + f.write("address 127.0.0.1:%d\n" % (port1)) + f.write("topic bridge/# both 0\n") + f.write("notifications false\n") + f.write("restart_timeout 2\n") + f.write("\n") + f.write("bridge_cafile ../ssl/all-ca.crt\n") + f.write("bridge_insecure true\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 60 +client_id = socket.gethostname()+".bridge_test" +connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+4) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "bridge/#", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +publish_packet = mosq_test.gen_publish("bridge/ssl/test", qos=0, payload="message") + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock = ssl.wrap_socket(sock, ca_certs="../ssl/all-ca.crt", keyfile="../ssl/server.key", certfile="../ssl/server.crt", server_side=True) +ssock.settimeout(20) +ssock.bind(('', port1)) +ssock.listen(5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) + +try: + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "subscribe", subscribe_packet): + bridge.send(suback_packet) + + pub = subprocess.Popen(['./08-ssl-bridge-helper.py', str(port2)], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + pub.wait() + (stdo, stde) = pub.communicate() + + if mosq_test.expect_packet(bridge, "publish", publish_packet): + rc = 0 + + bridge.close() +finally: + os.remove(conf_file) + try: + bridge.close() + except NameError: + pass + + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + ssock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-cert-auth-crl.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-cert-auth-crl.py new file mode 100755 index 0000000..54d76c4 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-cert-auth-crl.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("listener %d\n" % (port1)) + f.write("cafile ../ssl/all-ca.crt\n") + f.write("certfile ../ssl/server.crt\n") + f.write("keyfile ../ssl/server.key\n") + f.write("require_certificate true\n") + f.write("crlfile ../ssl/crl.pem\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-success-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) + +try: + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + ssock = ssl.wrap_socket(sock, ca_certs="../ssl/test-root-ca.crt", certfile="../ssl/client.crt", keyfile="../ssl/client.key", cert_reqs=ssl.CERT_REQUIRED) + ssock.settimeout(20) + ssock.connect(("localhost", port1)) + + mosq_test.do_send_receive(ssock, connect_packet, connack_packet, "connack") + + rc = 0 + + ssock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-cert-auth-expired.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-cert-auth-expired.py new file mode 100755 index 0000000..a7de9dd --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-cert-auth-expired.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 + +# Test whether a valid CONNECT results in the correct CONNACK packet using an +# SSL connection with client certificates required. + +from mosq_test_helper import * + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("\n") + f.write("listener %d\n" % (port1)) + f.write("cafile ../ssl/all-ca.crt\n") + f.write("certfile ../ssl/server.crt\n") + f.write("keyfile ../ssl/server.key\n") + f.write("require_certificate true\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-success-test", keepalive=keepalive) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) + +try: + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + ssock = ssl.wrap_socket(sock, ca_certs="../ssl/test-root-ca.crt", certfile="../ssl/client-expired.crt", keyfile="../ssl/client.key", cert_reqs=ssl.CERT_REQUIRED) + ssock.settimeout(20) + try: + ssock.connect(("localhost", port1)) + mosq_test.do_send_receive(ssock, connect_packet, "", "connack") + except ssl.SSLError as err: + if err.errno == 1: + rc = 0 + else: + broker.terminate() + raise ValueError(err.errno) +finally: + os.remove(conf_file) + time.sleep(0.5) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-cert-auth-revoked.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-cert-auth-revoked.py new file mode 100755 index 0000000..767b57c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-cert-auth-revoked.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("listener %d\n" % (port1)) + f.write("cafile ../ssl/all-ca.crt\n") + f.write("certfile ../ssl/server.crt\n") + f.write("keyfile ../ssl/server.key\n") + f.write("require_certificate true\n") + f.write("crlfile ../ssl/crl.pem\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-revoked-test", keepalive=keepalive) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) + +try: + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + ssock = ssl.wrap_socket(sock, ca_certs="../ssl/test-root-ca.crt", certfile="../ssl/client-revoked.crt", keyfile="../ssl/client-revoked.key", cert_reqs=ssl.CERT_REQUIRED) + ssock.settimeout(20) + try: + ssock.connect(("localhost", port1)) + mosq_test.do_send_receive(ssock, connect_packet, "", "connack") + except ssl.SSLError as err: + if err.errno == 1 and "certificate revoked" in err.strerror: + rc = 0 + else: + broker.terminate() + print(err.strerror) + raise ValueError(err.errno) + +finally: + os.remove(conf_file) + time.sleep(0.5) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-cert-auth-without.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-cert-auth-without.py new file mode 100755 index 0000000..c28ab5d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-cert-auth-without.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 + +# Test whether a client can connect without an SSL certificate if one is required. + +from mosq_test_helper import * +import errno + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("listener %d\n" % (port1)) + f.write("cafile ../ssl/all-ca.crt\n") + f.write("certfile ../ssl/server.crt\n") + f.write("keyfile ../ssl/server.key\n") + f.write("require_certificate true\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-cert-test", keepalive=keepalive) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +ssock = ssl.wrap_socket(sock, ca_certs="../ssl/test-root-ca.crt", cert_reqs=ssl.CERT_REQUIRED) +ssock.settimeout(20) +try: + ssock.connect(("localhost", port1)) + mosq_test.do_send_receive(ssock, connect_packet, "", "connack") +except ssl.SSLError as err: + if err.errno == 1: + rc = 0 +except socket.error as err: + if err.errno == errno.ECONNRESET: + rc = 0 +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-cert-auth.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-cert-auth.py new file mode 100755 index 0000000..a39c5b1 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-cert-auth.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 + +# Test whether a valid CONNECT results in the correct CONNACK packet using an SSL connection. + +from mosq_test_helper import * + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("listener %d\n" % (port1)) + f.write("cafile ../ssl/all-ca.crt\n") + f.write("certfile ../ssl/server.crt\n") + f.write("keyfile ../ssl/server.key\n") + f.write("require_certificate true\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-success-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) + +try: + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + ssock = ssl.wrap_socket(sock, ca_certs="../ssl/test-root-ca.crt", certfile="../ssl/client.crt", keyfile="../ssl/client.key", cert_reqs=ssl.CERT_REQUIRED) + ssock.settimeout(20) + ssock.connect(("localhost", port1)) + + mosq_test.do_send_receive(ssock, connect_packet, connack_packet, "connack") + + rc = 0 + + ssock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-identity.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-identity.py new file mode 100755 index 0000000..e7d17a5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-identity.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 + +# Client connects with a certificate to a server that has use_identity_as_username=true. Shouldn't be rejected. + +from mosq_test_helper import * + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("\n") + f.write("listener %d\n" %(port1)) + f.write("cafile ../ssl/all-ca.crt\n") + f.write("certfile ../ssl/server.crt\n") + f.write("keyfile ../ssl/server.key\n") + f.write("\n") + f.write("use_identity_as_username true\n") + f.write("require_certificate true\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-identity-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) + +try: + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + ssock = ssl.wrap_socket(sock, ca_certs="../ssl/test-root-ca.crt", certfile="../ssl/client.crt", keyfile="../ssl/client.key", cert_reqs=ssl.CERT_REQUIRED) + ssock.settimeout(20) + ssock.connect(("localhost", port1)) + + mosq_test.do_send_receive(ssock, connect_packet, connack_packet, "connack") + + rc = 0 + + ssock.close() +finally: + os.remove(conf_file) + time.sleep(0.5) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-no-auth-wrong-ca.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-no-auth-wrong-ca.py new file mode 100755 index 0000000..88365e0 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-no-auth-wrong-ca.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 + +# Test whether a valid CONNECT results in the correct CONNACK packet using an SSL connection. + +from mosq_test_helper import * + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("\n") + f.write("listener %d\n" % (port1)) + f.write("cafile ../ssl/all-ca.crt\n") + f.write("certfile ../ssl/server.crt\n") + f.write("keyfile ../ssl/server.key\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-success-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +ssock = ssl.wrap_socket(sock, ca_certs="../ssl/test-alt-ca.crt", cert_reqs=ssl.CERT_REQUIRED) +ssock.settimeout(20) +try: + ssock.connect(("localhost", port1)) +except ssl.SSLError as err: + if err.errno == 1: + rc = 0 +finally: + os.remove(conf_file) + ssock.close() + +time.sleep(0.5) +broker.terminate() +broker.wait() +(stdo, stde) = broker.communicate() +if rc: + print(stde.decode('utf-8')) +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-no-auth.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-no-auth.py new file mode 100755 index 0000000..f4f2f79 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-no-auth.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 + +# Test whether a valid CONNECT results in the correct CONNACK packet using an SSL connection. + +from mosq_test_helper import * + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("\n") + f.write("listener %d\n" % (port1)) + f.write("cafile ../ssl/all-ca.crt\n") + f.write("certfile ../ssl/server.crt\n") + f.write("keyfile ../ssl/server.key\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-success-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) + +try: + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + ssock = ssl.wrap_socket(sock, ca_certs="../ssl/test-root-ca.crt", cert_reqs=ssl.CERT_REQUIRED) + ssock.settimeout(20) + ssock.connect(("localhost", port1)) + + mosq_test.do_send_receive(ssock, connect_packet, connack_packet, "connack") + + rc = 0 + + ssock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-no-identity.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-no-identity.py new file mode 100755 index 0000000..3e909bd --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-ssl-connect-no-identity.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 + +# Client connects without a certificate to a server that has use_identity_as_username=true. Should be rejected. + +from mosq_test_helper import * + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port2)) + f.write("\n") + f.write("listener %d\n" % (port1)) + f.write("cafile ../ssl/all-ca.crt\n") + f.write("certfile ../ssl/server.crt\n") + f.write("keyfile ../ssl/server.key\n") + f.write("\n") + f.write("use_identity_as_username true\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-no-identity-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=4) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port2, use_conf=True) + +try: + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + ssock = ssl.wrap_socket(sock, ca_certs="../ssl/test-root-ca.crt", cert_reqs=ssl.CERT_REQUIRED) + ssock.settimeout(20) + ssock.connect(("localhost", port1)) + + mosq_test.do_send_receive(ssock, connect_packet, connack_packet, "connack") + + rc = 0 + + ssock.close() +finally: + os.remove(conf_file) + time.sleep(2) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-tls-psk-bridge.psk b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-tls-psk-bridge.psk new file mode 100644 index 0000000..a12d690 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-tls-psk-bridge.psk @@ -0,0 +1 @@ +psk-test:deadbeef diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-tls-psk-bridge.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-tls-psk-bridge.py new file mode 100755 index 0000000..25c753c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-tls-psk-bridge.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +def write_config1(filename, port1, port2): + with open(filename, 'w') as f: + f.write("allow_anonymous true\n") + f.write("\n") + f.write("psk_file 08-tls-psk-bridge.psk\n") + f.write("\n") + f.write("port %d\n" % (port1)) + f.write("\n") + f.write("listener %d\n" % (port2)) + f.write("psk_hint hint\n") + +def write_config2(filename, port2, port3): + with open(filename, 'w') as f: + f.write("port %d\n" % (port3)) + f.write("\n") + f.write("connection bridge-psk\n") + f.write("address localhost:%d\n" % (port2)) + f.write("topic psk/test out\n") + f.write("bridge_identity psk-test\n") + f.write("bridge_psk deadbeef\n") + +(port1, port2, port3) = mosq_test.get_port(3) +conf_file1 = "08-tls-psk-bridge.conf" +conf_file2 = "08-tls-psk-bridge.conf2" +write_config1(conf_file1, port1, port2) +write_config2(conf_file2, port2, port3) + +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp + + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("no-psk-test-client", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "psk/test", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +publish_packet = mosq_test.gen_publish(topic="psk/test", payload="message", qos=0) + +bridge_cmd = ['../../src/mosquitto', '-c', '08-tls-psk-bridge.conf2'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port1) +bridge = mosq_test.start_broker(filename=os.path.basename(__file__)+'_bridge', cmd=bridge_cmd, port=port3) + +pub = None +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=30, port=port1) + + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + pub = subprocess.Popen(['./c/08-tls-psk-bridge.test', str(port3)], env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + if pub.wait(): + raise ValueError + (stdo, stde) = pub.communicate() + + if mosq_test.expect_packet(sock, "publish", publish_packet): + rc = 0 + + sock.close() +finally: + os.remove(conf_file1) + os.remove(conf_file2) + time.sleep(1) + broker.terminate() + broker.wait() + time.sleep(1) + bridge.terminate() + bridge.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + (stdo, stde) = bridge.communicate() + print(stde.decode('utf-8')) + if pub: + (stdo, stde) = pub.communicate() + print(stdo.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-tls-psk-pub.psk b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-tls-psk-pub.psk new file mode 100644 index 0000000..6e98667 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-tls-psk-pub.psk @@ -0,0 +1 @@ +psk-id:deadbeef diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-tls-psk-pub.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-tls-psk-pub.py new file mode 100755 index 0000000..5342810 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/08-tls-psk-pub.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("allow_anonymous true\n") + f.write("psk_file 08-tls-psk-pub.psk\n") + f.write("\n") + f.write("port %d\n" % (port1)) + f.write("psk_hint hint\n") + f.write("\n") + f.write("listener %d\n" % (port2)) + f.write("log_type all\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp + + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("no-psk-test-client", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "psk/test", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +publish_packet = mosq_test.gen_publish(topic="psk/test", payload="message", qos=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port2) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port2) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + pub = subprocess.Popen(['./c/08-tls-psk-pub.test', str(port1)], env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + if pub.wait(): + raise ValueError + (stdo, stde) = pub.communicate() + + if mosq_test.expect_packet(sock, "publish", publish_packet): + rc = 0 + + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-acl-access-variants.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-acl-access-variants.py new file mode 100755 index 0000000..f20a5ee --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-acl-access-variants.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python3 + +# Check access + +from mosq_test_helper import * + +def write_config(filename, port, per_listener): + with open(filename, 'w') as f: + f.write("per_listener_settings %s\n" % (per_listener)) + f.write("port %d\n" % (port)) + f.write("acl_file %s\n" % (filename.replace('.conf', '.acl'))) + +def write_acl(filename, global_en, user_en, pattern_en): + with open(filename, 'w') as f: + if global_en: + f.write('topic readwrite topic/global\n') + if user_en: + f.write('user username\n') + f.write('topic readwrite topic/username\n') + if pattern_en: + f.write('pattern readwrite pattern/%u\n') + + + +def single_test(port, per_listener, username, topic, expect_deny): + rc = 1 + + conf_file = os.path.basename(__file__).replace('.py', '.conf') + write_config(conf_file, port, per_listener) + + broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + + try: + keepalive = 60 + connect_packet = mosq_test.gen_connect("acl-check", keepalive=keepalive, username=username) + connack_packet = mosq_test.gen_connack(rc=0) + + mid = 1 + subscribe_packet = mosq_test.gen_subscribe(mid=mid, topic=topic, qos=1) + suback_packet = mosq_test.gen_suback(mid=mid, qos=1) + + mid = 2 + publish1s_packet = mosq_test.gen_publish(topic=topic, mid=mid, qos=1, payload="message") + puback1s_packet = mosq_test.gen_puback(mid) + + mid=1 + publish1r_packet = mosq_test.gen_publish(topic=topic, mid=mid, qos=1, payload="message") + + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + mosq_test.do_send_receive(sock, publish1s_packet, puback1s_packet, "puback") + if expect_deny: + mosq_test.do_ping(sock) + else: + mosq_test.expect_packet(sock, "publish1r", publish1r_packet) + sock.close() + + rc = 0 + finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + exit(rc) + +def acl_test(port, per_listener, global_en, user_en, pattern_en): + acl_file = os.path.basename(__file__).replace('.py', '.acl') + + write_acl(acl_file, global_en=global_en, user_en=user_en, pattern_en=pattern_en) + + if global_en: + single_test(port, per_listener, username=None, topic="topic/global", expect_deny=False) + single_test(port, per_listener, username="username", topic="topic/global", expect_deny=True) + if user_en: + single_test(port, per_listener, username=None, topic="topic/username", expect_deny=True) + single_test(port, per_listener, username="username", topic="topic/username", expect_deny=False) + if pattern_en: + single_test(port, per_listener, username=None, topic="pattern/username", expect_deny=True) + single_test(port, per_listener, username="username", topic="pattern/username", expect_deny=False) + +def do_test(port, per_listener): + try: + acl_test(port, per_listener, global_en=False, user_en=False, pattern_en=True) + acl_test(port, per_listener, global_en=False, user_en=True, pattern_en=False) + acl_test(port, per_listener, global_en=True, user_en=False, pattern_en=False) + acl_test(port, per_listener, global_en=False, user_en=True, pattern_en=True) + acl_test(port, per_listener, global_en=True, user_en=False, pattern_en=True) + acl_test(port, per_listener, global_en=True, user_en=True, pattern_en=True) + finally: + acl_file = os.path.basename(__file__).replace('.py', '.acl') + os.remove(acl_file) + +port = mosq_test.get_port() + +do_test(port, "true") +do_test(port, "false") diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-acl-change.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-acl-change.py new file mode 100755 index 0000000..09d16f6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-acl-change.py @@ -0,0 +1,124 @@ +#!/usr/bin/env python3 + +# Check whether messages deliver or not after some access is revoked. + +from mosq_test_helper import * +import signal + +def write_config(filename, port, per_listener): + with open(filename, 'w') as f: + f.write("per_listener_settings %s\n" % (per_listener)) + f.write("port %d\n" % (port)) + f.write("acl_file %s\n" % (filename.replace('.conf', '.acl'))) + +def write_acl(filename, en): + with open(filename, 'w') as f: + f.write('user username\n') + f.write('topic readwrite topic/one\n') + if en: + f.write('topic readwrite topic/two\n') + +keepalive = 60 +username = "username" + +connect1_packet = mosq_test.gen_connect("acl-check", keepalive=keepalive, username=username, clean_session=False) +connack1a_packet = mosq_test.gen_connack(rc=0) +connack1b_packet = mosq_test.gen_connack(rc=0, flags=1) + +mid = 1 +subscribe1_packet = mosq_test.gen_subscribe(mid=mid, topic="topic/one", qos=1) +suback1_packet = mosq_test.gen_suback(mid=mid, qos=1) + +mid = 2 +subscribe2_packet = mosq_test.gen_subscribe(mid=mid, topic="topic/two", qos=1) +suback2_packet = mosq_test.gen_suback(mid=mid, qos=1) + +disconnect_packet = mosq_test.gen_disconnect() + +connect2_packet = mosq_test.gen_connect("helper", keepalive=keepalive, username=username) +connack2_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +publish1s_packet = mosq_test.gen_publish(topic="topic/one", mid=mid, qos=1, payload="message1") +puback1s_packet = mosq_test.gen_puback(mid) + +mid = 2 +publish2s_packet = mosq_test.gen_publish(topic="topic/two", mid=mid, qos=1, payload="message2") +puback2s_packet = mosq_test.gen_puback(mid) + +mid = 1 +publish1r_packet = mosq_test.gen_publish(topic="topic/one", mid=mid, qos=1, payload="message1") +puback1r_packet = mosq_test.gen_puback(mid) + +mid = 2 +publish3s_packet = mosq_test.gen_publish(topic="topic/one", mid=mid, qos=1, payload="message3") +puback3s_packet = mosq_test.gen_puback(mid) + +mid = 3 +publish3r_packet = mosq_test.gen_publish(topic="topic/one", mid=mid, qos=1, payload="message3") +puback3r_packet = mosq_test.gen_puback(mid) + +mid = 3 +publish4s_packet = mosq_test.gen_publish(topic="topic/two", mid=mid, qos=1, payload="message4") +puback4s_packet = mosq_test.gen_puback(mid) + +rc = 1 + +port = mosq_test.get_port() + +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port, "false") + +acl_file = os.path.basename(__file__).replace('.py', '.acl') +write_acl(acl_file, True) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + keepalive = 60 + + # Connect, subscribe, then disconnect + sock = mosq_test.do_client_connect(connect1_packet, connack1a_packet, port=port) + mosq_test.do_send_receive(sock, subscribe1_packet, suback1_packet, "suback1") + mosq_test.do_send_receive(sock, subscribe2_packet, suback2_packet, "suback2") + sock.send(disconnect_packet) + sock.close() + + # Helper publish to topic/one and topic/two, will be queued for other client + sock = mosq_test.do_client_connect(connect2_packet, connack2_packet, port=port) + mosq_test.do_send_receive(sock, publish1s_packet, puback1s_packet, "puback1") + mosq_test.do_send_receive(sock, publish2s_packet, puback2s_packet, "puback2") + sock.close() + + # Reload ACLs with topic/two now disabled + write_acl(acl_file, False) + broker.send_signal(signal.SIGHUP) + + sock = mosq_test.do_client_connect(connect1_packet, connack1b_packet, port=port) + sock.settimeout(10) + mosq_test.expect_packet(sock, "publish1r", publish1r_packet) + # We don't expect messages to topic/two any more, so we don't expect the queued one + mosq_test.do_send_receive(sock, publish3s_packet, puback3s_packet, "puback3") + mosq_test.expect_packet(sock, "publish3r", publish3r_packet) + + # Send this, don't expect it to succeed + mosq_test.do_send_receive(sock, publish4s_packet, puback4s_packet, "puback4") + + # Check for non delivery with a ping + mosq_test.do_ping(sock) + + sock.close() + rc = 0 + +finally: + os.remove(conf_file) + os.remove(acl_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + exit(rc) + +port = mosq_test.get_port() + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-acl-empty-file.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-acl-empty-file.py new file mode 100755 index 0000000..ab02c24 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-acl-empty-file.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python3 + +# Test for CVE-2018-xxxxx + +from mosq_test_helper import * +import signal + +def write_config(filename, port, per_listener): + with open(filename, 'w') as f: + f.write("per_listener_settings %s\n" % (per_listener)) + f.write("port %d\n" % (port)) + f.write("acl_file %s\n" % (filename.replace('.conf', '.acl'))) + +def write_acl(filename): + with open(filename, 'w') as f: + f.write('#comment\n') + f.write('\n') + + +def do_test(port, per_listener): + conf_file = os.path.basename(__file__).replace('.py', '.conf') + write_config(conf_file, port, per_listener) + + acl_file = os.path.basename(__file__).replace('.py', '.acl') + write_acl(acl_file) + + rc = 1 + keepalive = 60 + connect_packet = mosq_test.gen_connect("acl-check", keepalive=keepalive) + connack_packet = mosq_test.gen_connack(rc=0) + + mid = 1 + publish_packet = mosq_test.gen_publish("test/topic", qos=0, payload="message") + subscribe_packet = mosq_test.gen_subscribe(mid, "test/topic", 0) + suback_packet = mosq_test.gen_suback(mid, 0) + + broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + + try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + sock.send(publish_packet) + + # If we receive the message, this will fail. + mosq_test.do_ping(sock) + rc = 0 + + sock.close() + finally: + os.remove(conf_file) + os.remove(acl_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + exit(rc) + +port = mosq_test.get_port() +do_test(port, "false") +do_test(port, "true") diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-auth-bad-method.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-auth-bad-method.py new file mode 100755 index 0000000..7ecde8d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-auth-bad-method.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 + +# Test whether sending an Authentication Method produces the correct response +# when no auth methods are defined. + +from mosq_test_helper import * + +rc = 1 +keepalive = 10 +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "basic") +connect_packet = mosq_test.gen_connect("connect-test", proto_ver=5, keepalive=keepalive, properties=props) +connack_packet = mosq_test.gen_connack(rc=mqtt5_rc.MQTT_RC_BAD_AUTHENTICATION_METHOD, proto_ver=5, properties=None) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.close() + rc = 0 +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-change-username.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-change-username.py new file mode 100755 index 0000000..89b4a82 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-change-username.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python + +# Check whether an extended auth plugin can change the username of a client. + +from mosq_test_helper import * + +def write_config(filename, acl_file, port, per_listener): + with open(filename, 'w') as f: + f.write("per_listener_settings %s\n" % (per_listener)) + f.write("port %d\n" % (port)) + f.write("acl_file %s\n" % (acl_file)) + f.write("auth_plugin c/auth_plugin_extended_single.so\n") + +def write_acl(filename): + with open(filename, 'w') as f: + f.write('user new_username\n') + f.write('topic readwrite topic/one\n') + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +acl_file = os.path.basename(__file__).replace('.py', '.acl') + +def do_test(per_listener): + write_config(conf_file, acl_file, port, per_listener) + write_acl(acl_file) + rc = 1 + + # Connect without a username - this means no access + connect1_packet = mosq_test.gen_connect("client-params-test1", keepalive=42, proto_ver=5) + connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + + mid = 1 + subscribe_packet = mosq_test.gen_subscribe(mid, "topic/one", 1, proto_ver=5) + suback_packet = mosq_test.gen_suback(mid, 1, proto_ver=5) + + mid = 2 + publish1_packet = mosq_test.gen_publish("topic/one", qos=1, mid=mid, payload="message", proto_ver=5) + puback1_packet = mosq_test.gen_puback(mid, proto_ver=5, reason_code=mqtt5_rc.MQTT_RC_NOT_AUTHORIZED) + + # Connect without a username, but have the plugin change it + props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "change") + connect2_packet = mosq_test.gen_connect("client-params-test2", keepalive=42, proto_ver=5, properties=props) + props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "change") + connack2_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props) + + mid = 2 + publish2s_packet = mosq_test.gen_publish("topic/one", qos=1, mid=mid, payload="message", proto_ver=5) + puback2s_packet = mosq_test.gen_puback(mid, proto_ver=5) + + mid = 1 + publish2r_packet = mosq_test.gen_publish("topic/one", qos=1, mid=mid, payload="message", proto_ver=5) + + broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + + try: + sock = mosq_test.do_client_connect(connect1_packet, connack1_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback1") + mosq_test.do_send_receive(sock, publish1_packet, puback1_packet, "puback1") + mosq_test.do_ping(sock) + sock.close() + + sock = mosq_test.do_client_connect(connect2_packet, connack2_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback2") + mosq_test.do_send_receive(sock, publish2s_packet, puback2s_packet, "puback2") + if mosq_test.expect_packet(sock, "publish2", publish2r_packet): + mosq_test.do_ping(sock) + rc = 0 + + sock.close() + + finally: + os.remove(conf_file) + os.remove(acl_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + exit(rc) + + +do_test("true") +do_test("false") +exit(0) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-multistep-reauth.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-multistep-reauth.py new file mode 100755 index 0000000..0f3ae97 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-multistep-reauth.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("auth_plugin c/auth_plugin_extended_multiple.so\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 + +# First auth +# ========== +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "mirror") +props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_DATA, "step1") +connect1_packet = mosq_test.gen_connect("client-params-test", keepalive=42, proto_ver=5, properties=props) + +# Server to client +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "mirror") +props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_DATA, "1pets") +auth1_1_packet = mosq_test.gen_auth(reason_code=mqtt5_rc.MQTT_RC_CONTINUE_AUTHENTICATION, properties=props) + +# Client to server +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "mirror") +props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_DATA, "supercalifragilisticexpialidocious") +auth1_2_packet = mosq_test.gen_auth(reason_code=mqtt5_rc.MQTT_RC_CONTINUE_AUTHENTICATION, properties=props) + +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "mirror") +connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props) + +# Second auth +# =========== +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "mirror") +props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_DATA, "step1") +reauth2_packet = mosq_test.gen_auth(reason_code=mqtt5_rc.MQTT_RC_REAUTHENTICATE, properties=props) + +# Server to client +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "mirror") +props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_DATA, "1pets") +auth2_1_packet = mosq_test.gen_auth(reason_code=mqtt5_rc.MQTT_RC_CONTINUE_AUTHENTICATION, properties=props) + +# Client to server +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "mirror") +props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_DATA, "supercalifragilisticexpialidocious") +auth2_2_packet = mosq_test.gen_auth(reason_code=mqtt5_rc.MQTT_RC_CONTINUE_AUTHENTICATION, properties=props) + +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "mirror") +auth2_3_packet = mosq_test.gen_auth(reason_code=0, properties=props) + + +# Third auth - bad due to different method +# ======================================== +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "badmethod") +props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_DATA, "step1") +reauth3_packet = mosq_test.gen_auth(reason_code=mqtt5_rc.MQTT_RC_REAUTHENTICATE, properties=props) + +# Server to client +disconnect3_packet = mosq_test.gen_disconnect(reason_code=mqtt5_rc.MQTT_RC_PROTOCOL_ERROR, proto_ver=5) + + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect1_packet, auth1_1_packet, timeout=20, port=port, connack_error="auth1") + mosq_test.do_send_receive(sock, auth1_2_packet, connack1_packet, "connack1") + mosq_test.do_ping(sock, "pingresp1") + + mosq_test.do_send_receive(sock, reauth2_packet, auth2_1_packet, "auth2_1") + mosq_test.do_send_receive(sock, auth2_2_packet, auth2_3_packet, "auth2_3") + mosq_test.do_ping(sock, "pingresp2") + + mosq_test.do_send_receive(sock, reauth3_packet, disconnect3_packet, "disconnect3") + + rc = 0 + + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-multistep.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-multistep.py new file mode 100755 index 0000000..4414e81 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-multistep.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("auth_plugin c/auth_plugin_extended_multiple.so\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 + +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "mirror") +props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_DATA, "step1") +connect_packet = mosq_test.gen_connect("client-params-test", keepalive=42, proto_ver=5, properties=props) + +# Server to client +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "mirror") +props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_DATA, "1pets") +auth1_packet = mosq_test.gen_auth(reason_code=mqtt5_rc.MQTT_RC_CONTINUE_AUTHENTICATION, properties=props) + +# Client to server +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "mirror") +props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_DATA, "supercalifragilisticexpialidocious") +auth2_packet = mosq_test.gen_auth(reason_code=mqtt5_rc.MQTT_RC_CONTINUE_AUTHENTICATION, properties=props) + +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "mirror") +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props) + + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, auth1_packet, timeout=20, port=port, connack_error="auth1") + mosq_test.do_send_receive(sock, auth2_packet, connack_packet) + + rc = 0 + + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-single.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-single.py new file mode 100755 index 0000000..2b7ba34 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-single.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python + +# Multi tests for extended auth with a single step. +# * Error in plugin +# * No matching authentication method +# * Matching authentication method, but auth rejected +# * Matching authentication method, auth succeeds +# * Matching authentication method, auth succeeds, new auth data sent back to client + + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("auth_plugin c/auth_plugin_extended_single.so\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 + +# Single, error in plugin +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "error") +connect1_packet = mosq_test.gen_connect("client-params-test1", keepalive=42, proto_ver=5, properties=props) + +# Single, no matching authentication method +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "non-matching") +connect2_packet = mosq_test.gen_connect("client-params-test2", keepalive=42, proto_ver=5, properties=props) +connack2_packet = mosq_test.gen_connack(rc=mqtt5_rc.MQTT_RC_BAD_AUTHENTICATION_METHOD, proto_ver=5, properties=None) + +# Single step, matching method, failure +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "single") +props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_DATA, "baddata") +connect3_packet = mosq_test.gen_connect("client-params-test3", keepalive=42, proto_ver=5, properties=props) +connack3_packet = mosq_test.gen_connack(rc=mqtt5_rc.MQTT_RC_NOT_AUTHORIZED, proto_ver=5, properties=None) + +# Single step, matching method, success +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "single") +props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_DATA, "data") +connect4_packet = mosq_test.gen_connect("client-params-test5", keepalive=42, proto_ver=5, properties=props) +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "single") +connack4_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props) + +# Single step, matching method, success, auth data back to client +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "mirror") +props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_DATA, "somedata") +connect5_packet = mosq_test.gen_connect("client-params-test6", keepalive=42, proto_ver=5, properties=props) +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "mirror") +props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_DATA, "atademos") +connack5_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props) + + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect1_packet, b"", timeout=20, port=port) + sock.close() + + sock = mosq_test.do_client_connect(connect2_packet, connack2_packet, timeout=20, port=port) + sock.close() + + sock = mosq_test.do_client_connect(connect3_packet, connack3_packet, timeout=20, port=port) + sock.close() + + sock = mosq_test.do_client_connect(connect4_packet, connack4_packet, timeout=20, port=port) + sock.close() + + sock = mosq_test.do_client_connect(connect5_packet, connack5_packet, timeout=20, port=port) + sock.close() + + rc = 0 +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-single2.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-single2.py new file mode 100755 index 0000000..d86f917 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-single2.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python + +# Multi tests for extended auth with a single step - multiple plugins at once. +# * Error in plugin +# * No matching authentication method +# * Matching authentication method, but auth rejected +# * Matching authentication method, auth succeeds +# * Matching authentication method, auth succeeds, new auth data sent back to client + + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("auth_plugin c/auth_plugin_extended_single.so\n") + f.write("auth_plugin c/auth_plugin_extended_single2.so\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') + + +def do_test(suffix): + write_config(conf_file, port) + rc = 1 + # Single, error in plugin + props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "error%s" % (suffix)) + connect1_packet = mosq_test.gen_connect("client-params-test1", keepalive=42, proto_ver=5, properties=props) + + # Single, no matching authentication method + props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "non-matching%s" % (suffix)) + connect2_packet = mosq_test.gen_connect("client-params-test2", keepalive=42, proto_ver=5, properties=props) + connack2_packet = mosq_test.gen_connack(rc=mqtt5_rc.MQTT_RC_BAD_AUTHENTICATION_METHOD, proto_ver=5, properties=None) + + # Single step, matching method, failure + props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "single%s" % (suffix)) + props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_DATA, "baddata") + connect3_packet = mosq_test.gen_connect("client-params-test3", keepalive=42, proto_ver=5, properties=props) + connack3_packet = mosq_test.gen_connack(rc=mqtt5_rc.MQTT_RC_NOT_AUTHORIZED, proto_ver=5, properties=None) + + # Single step, matching method, success + props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "single%s" % (suffix)) + props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_DATA, "data") + connect4_packet = mosq_test.gen_connect("client-params-test5", keepalive=42, proto_ver=5, properties=props) + props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "single%s" % (suffix)) + connack4_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props) + + # Single step, matching method, success, auth data back to client + props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "mirror%s" % (suffix)) + props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_DATA, "somedata") + connect5_packet = mosq_test.gen_connect("client-params-test6", keepalive=42, proto_ver=5, properties=props) + props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "mirror%s" % (suffix)) + props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_DATA, "atademos") + connack5_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props) + + + broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + + try: + sock = mosq_test.do_client_connect(connect1_packet, b"", timeout=20, port=port) + sock.close() + + sock = mosq_test.do_client_connect(connect2_packet, connack2_packet, timeout=20, port=port) + sock.close() + + sock = mosq_test.do_client_connect(connect3_packet, connack3_packet, timeout=20, port=port) + sock.close() + + sock = mosq_test.do_client_connect(connect4_packet, connack4_packet, timeout=20, port=port) + sock.close() + + sock = mosq_test.do_client_connect(connect5_packet, connack5_packet, timeout=20, port=port) + sock.close() + + rc = 0 + finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + exit(rc) + +do_test("") +do_test("2") +exit(0) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-unsupported.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-unsupported.py new file mode 100755 index 0000000..762d492 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-extended-auth-unsupported.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python + +# Test whether an unsupported extended auth is rejected. + +from mosq_test_helper import * + +port = mosq_test.get_port() + +rc = 1 + +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_METHOD, "unsupported") +props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_AUTHENTICATION_DATA, "test") +connect_packet = mosq_test.gen_connect("client-params-test", keepalive=42, proto_ver=5, properties=props) +connack_packet = mosq_test.gen_connack(rc=mqtt5_rc.MQTT_RC_BAD_AUTHENTICATION_METHOD, proto_ver=5, properties=None) + + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-acl-pub.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-acl-pub.py new file mode 100755 index 0000000..d546f95 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-acl-pub.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 + +# Bug specific test - if a QoS2 publish is denied, then we publish again with +# the same mid to a topic that is allowed, does it work properly? + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("auth_plugin c/auth_plugin.so\n") + f.write("allow_anonymous false\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +keepalive = 10 +connect1_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="readwrite", clean_session=False) +connack1_packet = mosq_test.gen_connack(rc=0) + +connect2_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="readwrite", clean_session=False) +connack2_packet = mosq_test.gen_connack(rc=0,flags=1) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "readonly", 2) +suback_packet = mosq_test.gen_suback(mid, 2) + +mid = 2 +publish1_packet = mosq_test.gen_publish("readonly", qos=2, mid=mid, payload="message") +pubrec1_packet = mosq_test.gen_pubrec(mid) +pubrel1_packet = mosq_test.gen_pubrel(mid) +pubcomp1_packet = mosq_test.gen_pubcomp(mid) + +mid = 2 +publish2_packet = mosq_test.gen_publish("writeable", qos=1, mid=mid, payload="message") +puback2_packet = mosq_test.gen_puback(mid) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect1_packet, connack1_packet, timeout=20, port=port) + + mosq_test.do_send_receive(sock, publish1_packet, pubrec1_packet, "pubrec1") + sock.close() + + sock = mosq_test.do_client_connect(connect2_packet, connack2_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, publish2_packet, puback2_packet, "puback2") + + mosq_test.do_ping(sock) + + rc = 0 + + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-acl-sub-denied.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-acl-sub-denied.py new file mode 100755 index 0000000..7046a31 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-acl-sub-denied.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 + +# Test topic subscription. All SUBSCRIBE requests are denied. Check this +# produces the correct response, and check the client isn't disconnected (ref: +# issue #1016). + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("auth_plugin c/auth_plugin_acl_sub_denied.so\n") + f.write("allow_anonymous false\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("sub-denied-test", keepalive=keepalive, username="denied") +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 53 +subscribe_packet = mosq_test.gen_subscribe(mid, "qos0/test", 0) +suback_packet = mosq_test.gen_suback(mid, 128) + +mid_pub = 54 +publish_packet = mosq_test.gen_publish("topic", qos=1, payload="test", mid=mid_pub) +puback_packet = mosq_test.gen_puback(mid_pub) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + mosq_test.do_send_receive(sock, publish_packet, puback_packet, "puback") + + rc = 0 + + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-acl-sub.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-acl-sub.py new file mode 100755 index 0000000..d4f76dd --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-acl-sub.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 + +# Test topic subscription. All topic are allowed but not using wildcard in subscribe. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("auth_plugin c/auth_plugin.so\n") + f.write("allow_anonymous false\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="readonly") +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 53 +subscribe_packet = mosq_test.gen_subscribe(mid, "qos0/test", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +mid_fail = 54 +subscribe_packet_fail = mosq_test.gen_subscribe(mid_fail, "#", 0) +suback_packet_fail = mosq_test.gen_suback(mid_fail, 0x80) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + mosq_test.do_send_receive(sock, subscribe_packet_fail, suback_packet_fail, "suback") + + rc = 0 + + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-context-params.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-context-params.py new file mode 100755 index 0000000..00f6e24 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-context-params.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 + +# Test whether message parameters are passed to the plugin acl check function. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("auth_plugin c/auth_plugin_context_params.so\n") + f.write("allow_anonymous false\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +connect_packet = mosq_test.gen_connect("client-params-test", keepalive=42, username="client-username") +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 2 +subscribe_packet = mosq_test.gen_subscribe(mid, "param/topic", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +mid = 3 +publish_packet = mosq_test.gen_publish(topic="param/topic", qos=1, payload="payload contents", retain=1, mid=mid) +puback_packet = mosq_test.gen_puback(mid) + +mid = 1 +publish_packet_recv = mosq_test.gen_publish(topic="param/topic", qos=1, payload="payload contents", retain=0, mid=mid) + + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + rc = 0 + + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-defer-unpwd-fail.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-defer-unpwd-fail.py new file mode 100755 index 0000000..1733e42 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-defer-unpwd-fail.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +# Test whether a connection fail when using a auth_plugin that defer authentication. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("auth_plugin c/auth_plugin.so\n") + f.write("allow_anonymous false\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="test-username@v2", password="doesNotMatter") +connack_packet = mosq_test.gen_connack(rc=5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + rc = 0 + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-defer-unpwd-success.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-defer-unpwd-success.py new file mode 100755 index 0000000..c8e1e02 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-defer-unpwd-success.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python3 + +# Test whether a connection is successful with correct username and password +# when using a two auth_plugin (first will defer, second will accept). + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("auth_plugin c/auth_plugin.so\n") + f.write("auth_plugin c/auth_plugin_v2.so\n") + f.write("allow_anonymous false\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="test-username@v2", password="doesNotMatter") +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + rc = 0 + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-msg-params.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-msg-params.py new file mode 100755 index 0000000..5b03a96 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-msg-params.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 + +# Test whether message parameters are passed to the plugin acl check function. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("auth_plugin c/auth_plugin_msg_params.so\n") + f.write("allow_anonymous true\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("msg-param-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 2 +subscribe_packet = mosq_test.gen_subscribe(mid, "param/topic", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +mid = 3 +publish_packet = mosq_test.gen_publish(topic="param/topic", qos=1, payload="payload contents", retain=1, mid=mid) +puback_packet = mosq_test.gen_puback(mid) + +mid = 1 +publish_packet_recv = mosq_test.gen_publish(topic="param/topic", qos=1, payload="payload contents", retain=0, mid=mid) + + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + mosq_test.do_send_receive(sock, publish_packet, puback_packet, "puback") + + if mosq_test.expect_packet(sock, "publish receive", publish_packet_recv): + rc = 0 + + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-unpwd-fail.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-unpwd-fail.py new file mode 100755 index 0000000..812e954 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-unpwd-fail.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 + +# Test whether a connection is successful with correct username and password +# when using a simple auth_plugin. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("auth_plugin c/auth_plugin.so\n") + f.write("allow_anonymous false\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="test-username", password="wrong") +connack_packet = mosq_test.gen_connack(rc=5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + rc = 0 + + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-unpwd-success.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-unpwd-success.py new file mode 100755 index 0000000..834a7c0 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-unpwd-success.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 + +# Test whether a connection is successful with correct username and password +# when using a simple auth_plugin. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("auth_plugin c/auth_plugin.so\n") + f.write("allow_anonymous false\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="test-username", password="cnwTICONIURW") +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + rc = 0 + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-v2-unpwd-fail.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-v2-unpwd-fail.py new file mode 100755 index 0000000..4b6a1cd --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-v2-unpwd-fail.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +# Test whether a connection is successful with correct username and password +# when using a simple auth_plugin. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("auth_plugin c/auth_plugin_v2.so\n") + f.write("allow_anonymous false\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="test-username", password="wrong") +connack_packet = mosq_test.gen_connack(rc=5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + rc = 0 + + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-v2-unpwd-success.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-v2-unpwd-success.py new file mode 100755 index 0000000..7ffafca --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-plugin-auth-v2-unpwd-success.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +# Test whether a connection is successful with correct username and password +# when using a simple auth_plugin. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("auth_plugin c/auth_plugin_v2.so\n") + f.write("allow_anonymous false\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="test-username", password="cnwTICONIURW") +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + rc = 0 + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-pwfile-parse-invalid.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-pwfile-parse-invalid.py new file mode 100755 index 0000000..f6b76bc --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/09-pwfile-parse-invalid.py @@ -0,0 +1,165 @@ +#!/usr/bin/env python3 + +# Test for CVE-2018-xxxxx. + +from mosq_test_helper import * +import signal + +def write_config(filename, port, per_listener): + with open(filename, 'w') as f: + f.write("per_listener_settings %s\n" % (per_listener)) + f.write("port %d\n" % (port)) + f.write("password_file %s\n" % (filename.replace('.conf', '.pwfile'))) + f.write("allow_anonymous false") + +def write_pwfile(filename, bad_line1, bad_line2): + with open(filename, 'w') as f: + if bad_line1 is not None: + f.write('%s\n' % (bad_line1)) + # Username test, password test + f.write('test:$6$njERlZMi/7DzNB9E$iiavfuXvUm8iyDZArTy7smTxh07GXXOrOsqxfW6gkOYVXHGk+W+i/8d3xDxrMwEPygEBhoA8A/gjQC0N2M4Lkw==\n') + # Username empty, password 0 length + f.write('empty:$6$o+53eGXtmlfHeYrg$FY7X9DNQ4uU1j0NiPmGOOSU05ZSzhqNmNhXIof/0nLpVb1zDhcRHdaC72E3YryH7dtTiG/r6jH6C8J+30cZBgA==\n') + if bad_line2 is not None: + f.write('%s\n' % (bad_line2)) + +def do_test(port, connack_rc, username, password): + rc = 1 + keepalive = 60 + connect_packet = mosq_test.gen_connect("username-password-check", keepalive=keepalive, username=username, password=password) + connack_packet = mosq_test.gen_connack(rc=connack_rc) + + try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + rc = 0 + sock.close() + finally: + if rc: + raise AssertionError + + +def username_password_tests(port): + broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + + try: + do_test(port, connack_rc=0, username='test', password='test') + do_test(port, connack_rc=5, username='test', password='bad') + do_test(port, connack_rc=5, username='test', password='') + do_test(port, connack_rc=5, username='test', password=None) + do_test(port, connack_rc=5, username='empty', password='test') + do_test(port, connack_rc=5, username='empty', password='bad') + do_test(port, connack_rc=5, username='empty', password='') + do_test(port, connack_rc=5, username='empty', password=None) + do_test(port, connack_rc=5, username='bad', password='test') + do_test(port, connack_rc=5, username='bad', password='bad') + do_test(port, connack_rc=5, username='bad', password='') + do_test(port, connack_rc=5, username='bad', password=None) + do_test(port, connack_rc=5, username='', password='test') + do_test(port, connack_rc=5, username='', password='bad') + do_test(port, connack_rc=5, username='', password='') + do_test(port, connack_rc=5, username='', password=None) + do_test(port, connack_rc=5, username=None, password='test') + do_test(port, connack_rc=5, username=None, password='bad') + do_test(port, connack_rc=5, username=None, password='') + do_test(port, connack_rc=5, username=None, password=None) + except ValueError: + pass + finally: + broker.terminate() + broker.wait() + + +def all_tests(port): + # Valid file, single user + write_pwfile(pw_file, bad_line1=None, bad_line2=None) + username_password_tests(port) + + # Invalid file, first line blank + write_pwfile(pw_file, bad_line1='', bad_line2=None) + username_password_tests(port) + + # Invalid file, last line blank + write_pwfile(pw_file, bad_line1=None, bad_line2='') + username_password_tests(port) + + # Invalid file, first and last line blank + write_pwfile(pw_file, bad_line1='', bad_line2='') + username_password_tests(port) + + # Invalid file, first line 'comment' + write_pwfile(pw_file, bad_line1='#comment', bad_line2=None) + username_password_tests(port) + + # Invalid file, last line 'comment' + write_pwfile(pw_file, bad_line1=None, bad_line2='#comment') + username_password_tests(port) + + # Invalid file, first and last line 'comment' + write_pwfile(pw_file, bad_line1='#comment', bad_line2='#comment') + username_password_tests(port) + + # Invalid file, first line blank and last line 'comment' + write_pwfile(pw_file, bad_line1='', bad_line2='#comment') + username_password_tests(port) + + # Invalid file, first line incomplete + write_pwfile(pw_file, bad_line1='bad:', bad_line2=None) + username_password_tests(port) + + # Invalid file, first line incomplete, but with "password" + write_pwfile(pw_file, bad_line1='bad:bad', bad_line2=None) + username_password_tests(port) + + # Invalid file, first line incomplete, partial password hash + write_pwfile(pw_file, bad_line1='bad:$', bad_line2=None) + username_password_tests(port) + + # Invalid file, first line incomplete, partial password hash + write_pwfile(pw_file, bad_line1='bad:$6', bad_line2=None) + username_password_tests(port) + + # Invalid file, first line incomplete, partial password hash + write_pwfile(pw_file, bad_line1='bad:$6$', bad_line2=None) + username_password_tests(port) + + # Valid file, first line incomplete, has valid salt but no password hash + write_pwfile(pw_file, bad_line1='bad:$6$njERlZMi/7DzNB9E', bad_line2=None) + username_password_tests(port) + + # Valid file, first line incomplete, has valid salt but no password hash + write_pwfile(pw_file, bad_line1='bad:$6$njERlZMi/7DzNB9E$', bad_line2=None) + username_password_tests(port) + + # Valid file, first line has invalid hash designator + write_pwfile(pw_file, bad_line1='bad:$5$njERlZMi/7DzNB9E$iiavfuXvUm8iyDZArTy7smTxh07GXXOrOsqxfW6gkOYVXHGk+W+i/8d3xDxrMwEPygEBhoA8A/gjQC0N2M4Lkw==', bad_line2=None) + username_password_tests(port) + + # Invalid file, missing username but valid password hash + write_pwfile(pw_file, bad_line1=':$6$njERlZMi/7DzNB9E$iiavfuXvUm8iyDZArTy7smTxh07GXXOrOsqxfW6gkOYVXHGk+W+i/8d3xDxrMwEPygEBhoA8A/gjQC0N2M4Lkw==', bad_line2=None) + username_password_tests(port) + + # Valid file, valid username but password salt not base64 + write_pwfile(pw_file, bad_line1='bad:$6$njER{ZMi/7DzNB9E$iiavfuXvUm8iyDZArTy7smTxh07GXXOrOsqxfW6gkOYVXHGk+W+i/8d3xDxrMwEPygEBhoA8A/gjQC0N2M4Lkw==', bad_line2=None) + username_password_tests(port) + + # Valid file, valid username but password hash not base64 + write_pwfile(pw_file, bad_line1='bad:$6$njERlZMi/7DzNB9E$iiavfuXv{}8iyDZArTy7smTxh07GXXOrOsqxfW6gkOYVXHGk+W+i/8d3xDxrMwEPygEBhoA8A/gjQC0N2M4Lkw==', bad_line2=None) + username_password_tests(port) + + + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +pw_file = os.path.basename(__file__).replace('.py', '.pwfile') + +try: + write_config(conf_file, port, "false") + all_tests(port) + + write_config(conf_file, port, "true") + all_tests(port) +finally: + os.remove(conf_file) + os.remove(pw_file) + +sys.exit(0) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/10-listener-mount-point-helper.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/10-listener-mount-point-helper.py new file mode 100755 index 0000000..1612e75 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/10-listener-mount-point-helper.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +port = mosq_test.get_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("test", qos=0, payload="mount point") + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port, connack_error="helper connack") +sock.send(publish_packet) +rc = 0 +sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/10-listener-mount-point.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/10-listener-mount-point.py new file mode 100755 index 0000000..8ffc825 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/10-listener-mount-point.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +def write_config(filename, port1, port2): + with open(filename, 'w') as f: + f.write("port %d\n" % (port1)) + f.write("\n") + f.write("listener %d\n" % (port2)) + f.write("mount_point mount/\n") + f.write("\n") + f.write("log_type debug\n") + +(port1, port2) = mosq_test.get_port(2) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port1, port2) + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test2", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "#", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +publish_packet = mosq_test.gen_publish("mount/test", qos=0, payload="mount point") + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port1) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port1) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + pub = subprocess.Popen(['./10-listener-mount-point-helper.py', str(port2)], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + pub.wait() + (stdo, stde) = pub.communicate() + # Should have now received a publish command + + if mosq_test.expect_packet(sock, "publish", publish_packet): + rc = 0 + + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-message-expiry.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-message-expiry.py new file mode 100755 index 0000000..d7b107c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-message-expiry.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python3 + +# Test whether the broker reduces the message expiry interval when republishing. +# MQTT v5, with a broker restart and persistence. + +# Client connects with clean session set false, subscribes with qos=1, then disconnects +# Helper publishes two messages, one with a short expiry and one with a long expiry +# We wait until the short expiry will have expired but the long one not. +# Client reconnects, expects delivery of the long expiry message with a reduced +# expiry interval property. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("persistence true\n") + f.write("persistence_file mosquitto-%d.db\n" % (port)) + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + + +rc = 1 +keepalive = 60 +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 60) +connect_packet = mosq_test.gen_connect("subpub-qos0-test", keepalive=keepalive, proto_ver=5, clean_session=False, properties=props) +connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=5) +connack2_packet = mosq_test.gen_connack(rc=0, proto_ver=5, flags=1) + +mid = 53 +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos1", 1, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid, 1, proto_ver=5) + + + +helper_connect = mosq_test.gen_connect("helper", proto_ver=5) +helper_connack = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid=1 +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MESSAGE_EXPIRY_INTERVAL, 1) +publish1s_packet = mosq_test.gen_publish("subpub/qos1", mid=mid, qos=1, payload="message1", proto_ver=5, properties=props) +puback1s_packet = mosq_test.gen_puback(mid) + +mid=2 +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MESSAGE_EXPIRY_INTERVAL, 100) +publish2s_packet = mosq_test.gen_publish("subpub/qos1", mid=mid, qos=1, payload="message2", proto_ver=5, properties=props) +puback2s_packet = mosq_test.gen_puback(mid) + +mid=3 +publish3_packet = mosq_test.gen_publish("subpub/qos1", mid=mid, qos=1, payload="message3", proto_ver=5) +puback3_packet = mosq_test.gen_puback(mid) + + +if os.path.exists('mosquitto-%d.db' % (port)): + os.unlink('mosquitto-%d.db' % (port)) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack1_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + sock.close() + + helper = mosq_test.do_client_connect(helper_connect, helper_connack, timeout=20, port=port) + mosq_test.do_send_receive(helper, publish1s_packet, puback1s_packet, "puback 1") + mosq_test.do_send_receive(helper, publish2s_packet, puback2s_packet, "puback 2") + mosq_test.do_send_receive(helper, publish3_packet, puback3_packet, "puback 3") + + broker.terminate() + broker.wait() + (stdo1, stde1) = broker.communicate() + sock.close() + broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + + if os.environ.get('TRAVIS') is not None: + time.sleep(5) + else: + time.sleep(2) + + sock = mosq_test.do_client_connect(connect_packet, connack2_packet, timeout=20, port=port) + packet = sock.recv(len(publish2s_packet)) + for i in range(100, 1, -1): + props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MESSAGE_EXPIRY_INTERVAL, i) + publish2r_packet = mosq_test.gen_publish("subpub/qos1", mid=2, qos=1, payload="message2", proto_ver=5, properties=props) + if packet == publish2r_packet: + mosq_test.expect_packet(sock, "publish3", publish3_packet) + rc = 0 + break + + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + if os.path.exists('mosquitto-%d.db' % (port)): + os.unlink('mosquitto-%d.db' % (port)) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-persistent-subscription-no-local.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-persistent-subscription-no-local.py new file mode 100755 index 0000000..258c32e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-persistent-subscription-no-local.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python3 + +# Test whether a client subscribed to a topic receives its own message sent to that topic. +# And whether the no-local option is persisted. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("persistence true\n") + f.write("persistence_file mosquitto-%d.db\n" % (port)) + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +keepalive = 60 +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 100) +connect_packet = mosq_test.gen_connect( + "persistent-subscription-test", keepalive=keepalive, clean_session=False, proto_ver=5, properties=props +) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) +connack_packet2 = mosq_test.gen_connack(rc=0, flags=1, proto_ver=5) # session present + +mid = 1 +subscribe1_packet = mosq_test.gen_subscribe(mid, "subpub/nolocal", 5, proto_ver=5) +suback1_packet = mosq_test.gen_suback(mid, 1, proto_ver=5) + +mid = 2 +subscribe2_packet = mosq_test.gen_subscribe(mid, "subpub/local", 1, proto_ver=5) +suback2_packet = mosq_test.gen_suback(mid, 1, proto_ver=5) + +mid = 1 +publish1_packet = mosq_test.gen_publish("subpub/nolocal", qos=1, mid=mid, payload="message", proto_ver=5) +puback1_packet = mosq_test.gen_puback(mid, proto_ver=5) + +mid = 2 +publish2s_packet = mosq_test.gen_publish("subpub/local", qos=1, mid=mid, payload="message", proto_ver=5) +puback2s_packet = mosq_test.gen_puback(mid, proto_ver=5) + +mid = 1 +publish2a_packet = mosq_test.gen_publish("subpub/local", qos=1, mid=mid, payload="message", proto_ver=5) +puback2a_packet = mosq_test.gen_puback(mid, proto_ver=5) + +mid = 2 +publish2b_packet = mosq_test.gen_publish("subpub/local", qos=1, mid=mid, payload="message", proto_ver=5) +puback2b_packet = mosq_test.gen_puback(mid, proto_ver=5) + +if os.path.exists('mosquitto-%d.db' % (port)): + os.unlink('mosquitto-%d.db' % (port)) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +(stdo1, stde1) = ("", "") +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe1_packet, suback1_packet, "suback1") + mosq_test.do_send_receive(sock, subscribe2_packet, suback2_packet, "suback2") + + mosq_test.do_send_receive(sock, publish1_packet, puback1_packet, "puback1a") + mosq_test.do_send_receive(sock, publish2s_packet, puback2s_packet, "puback2a") + + if mosq_test.expect_packet(sock, "publish2a", publish2a_packet): + sock.send(puback2a_packet) + + broker.terminate() + broker.wait() + (stdo1, stde1) = broker.communicate() + sock.close() + + broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + + sock = mosq_test.do_client_connect(connect_packet, connack_packet2, timeout=20, port=port) + + mosq_test.do_send_receive(sock, publish1_packet, puback1_packet, "puback1b") + mosq_test.do_send_receive(sock, publish2s_packet, puback2s_packet, "puback2b") + + if mosq_test.expect_packet(sock, "publish2b", publish2b_packet): + rc = 0 + + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + if os.path.exists('mosquitto-%d.db' % (port)): + os.unlink('mosquitto-%d.db' % (port)) + + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-persistent-subscription-v5.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-persistent-subscription-v5.py new file mode 100755 index 0000000..777256d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-persistent-subscription-v5.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python3 + +# Test whether a client subscribed to a topic receives its own message sent to that topic. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("persistence true\n") + f.write("persistence_file mosquitto-%d.db\n" % (port)) + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +mid = 530 +keepalive = 60 + +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 100) +connect_packet = mosq_test.gen_connect( + "persistent-subscription-test", keepalive=keepalive, clean_session=False, proto_ver=5, properties=props +) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) +connack_packet2 = mosq_test.gen_connack(rc=0, flags=1, proto_ver=5) # session present + +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos1", 1, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid, 1, proto_ver=5) + +mid = 300 +publish_packet = mosq_test.gen_publish("subpub/qos1", qos=1, mid=mid, payload="message", proto_ver=5) +puback_packet = mosq_test.gen_puback(mid, proto_ver=5) + +mid = 1 +publish_packet2 = mosq_test.gen_publish("subpub/qos1", qos=1, mid=mid, payload="message", proto_ver=5) + +if os.path.exists('mosquitto-%d.db' % (port)): + os.unlink('mosquitto-%d.db' % (port)) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +(stdo1, stde1) = ("", "") +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + broker.terminate() + broker.wait() + (stdo1, stde1) = broker.communicate() + sock.close() + broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + + sock = mosq_test.do_client_connect(connect_packet, connack_packet2, timeout=20, port=port) + + mosq_test.do_send_receive(sock, publish_packet, puback_packet, "puback") + + if mosq_test.expect_packet(sock, "publish2", publish_packet2): + rc = 0 + + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + if os.path.exists('mosquitto-%d.db' % (port)): + os.unlink('mosquitto-%d.db' % (port)) + + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-persistent-subscription.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-persistent-subscription.py new file mode 100755 index 0000000..0bcfc41 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-persistent-subscription.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 + +# Test whether a client subscribed to a topic receives its own message sent to that topic. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("persistence true\n") + f.write("persistence_file mosquitto-%d.db\n" % (port)) + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +mid = 530 +keepalive = 60 +connect_packet = mosq_test.gen_connect( + "persistent-subscription-test", keepalive=keepalive, clean_session=False, +) +connack_packet = mosq_test.gen_connack(rc=0) +connack_packet2 = mosq_test.gen_connack(rc=0, flags=1) # session present + +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos1", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +mid = 300 +publish_packet = mosq_test.gen_publish("subpub/qos1", qos=1, mid=mid, payload="message") +puback_packet = mosq_test.gen_puback(mid) + +mid = 1 +publish_packet2 = mosq_test.gen_publish("subpub/qos1", qos=1, mid=mid, payload="message") + +if os.path.exists('mosquitto-%d.db' % (port)): + os.unlink('mosquitto-%d.db' % (port)) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +(stdo1, stde1) = ("", "") +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + broker.terminate() + broker.wait() + (stdo1, stde1) = broker.communicate() + sock.close() + broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + + sock = mosq_test.do_client_connect(connect_packet, connack_packet2, timeout=20, port=port) + + mosq_test.do_send_receive(sock, publish_packet, puback_packet, "puback") + + if mosq_test.expect_packet(sock, "publish2", publish_packet2): + rc = 0 + + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + if os.path.exists('mosquitto-%d.db' % (port)): + os.unlink('mosquitto-%d.db' % (port)) + + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-pub-props.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-pub-props.py new file mode 100755 index 0000000..253cb55 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-pub-props.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python3 + +# Does a persisted PUBLISH keep its properties? + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("persistence true\n") + f.write("persistence_file mosquitto-%d.db\n" % (port)) + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect( + "persistent-props-test", keepalive=keepalive, clean_session=True, proto_ver=5 +) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid = 1 +props = mqtt5_props.gen_byte_prop(mqtt5_props.PROP_PAYLOAD_FORMAT_INDICATOR, 1) +props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_CONTENT_TYPE, "plain/text") +props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_RESPONSE_TOPIC, "/dev/null") +props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_CORRELATION_DATA, "2357289375902345") +props += mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "name", "value") +publish_packet = mosq_test.gen_publish("subpub/qos1", qos=1, mid=mid, payload="message", proto_ver=5, properties=props, retain=True) +puback_packet = mosq_test.gen_puback(mid, reason_code=mqtt5_rc.MQTT_RC_NO_MATCHING_SUBSCRIBERS, proto_ver=5) + +publish2_packet = mosq_test.gen_publish("subpub/qos1", qos=0, payload="message", proto_ver=5, properties=props, retain=True) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos1", 0, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + +if os.path.exists('mosquitto-%d.db' % (port)): + os.unlink('mosquitto-%d.db' % (port)) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +(stdo1, stde1) = ("", "") +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, publish_packet, puback_packet, "puback") + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + if mosq_test.expect_packet(sock, "publish2", publish2_packet): + + broker.terminate() + broker.wait() + (stdo1, stde1) = broker.communicate() + sock.close() + broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + + if mosq_test.expect_packet(sock, "publish2", publish2_packet): + rc = 0 + + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + if os.path.exists('mosquitto-%d.db' % (port)): + os.unlink('mosquitto-%d.db' % (port)) + + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-subscription-id.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-subscription-id.py new file mode 100755 index 0000000..548cd28 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/11-subscription-id.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python3 + +# Test whether a client message maintains its subscription id when persisted and restored. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("persistence true\n") + f.write("persistence_file mosquitto-%d.db\n" % (port)) + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 +keepalive = 60 + +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 100) +connect_packet = mosq_test.gen_connect( + "persistent-subscription-test", keepalive=keepalive, clean_session=False, proto_ver=5, properties=props +) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) +connack_packet2 = mosq_test.gen_connack(rc=0, flags=1, proto_ver=5) # session present + +mid = 1 +props = mqtt5_props.gen_varint_prop(mqtt5_props.PROP_SUBSCRIPTION_IDENTIFIER, 53) +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos1", 1, proto_ver=5, properties=props) +suback_packet = mosq_test.gen_suback(mid, 1, proto_ver=5) + +mid = 1 +props = mqtt5_props.gen_varint_prop(mqtt5_props.PROP_SUBSCRIPTION_IDENTIFIER, 53) +publish_packet2 = mosq_test.gen_publish("subpub/qos1", qos=1, mid=mid, payload="message", proto_ver=5, properties=props) + + +helper_connect_packet = mosq_test.gen_connect("helper", keepalive=keepalive, clean_session=True, proto_ver=5) +helper_connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid = 1 +helper_publish_packet = mosq_test.gen_publish("subpub/qos1", qos=1, mid=mid, payload="message", proto_ver=5) +helper_puback_packet = mosq_test.gen_puback(mid, proto_ver=5) + + +if os.path.exists('mosquitto-%d.db' % (port)): + os.unlink('mosquitto-%d.db' % (port)) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + +(stdo1, stde1) = ("", "") +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + sock.close() + + sock = mosq_test.do_client_connect(helper_connect_packet, helper_connack_packet, timeout=20, port=port) + mosq_test.do_send_receive(sock, helper_publish_packet, helper_puback_packet, "helper puback") + sock.close() + + broker.terminate() + broker.wait() + (stdo1, stde1) = broker.communicate() + broker = mosq_test.start_broker(filename=os.path.basename(__file__), use_conf=True, port=port) + + sock = mosq_test.do_client_connect(connect_packet, connack_packet2, timeout=20, port=port) + + if mosq_test.expect_packet(sock, "publish2", publish_packet2): + rc = 0 + + sock.close() +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + if os.path.exists('mosquitto-%d.db' % (port)): + os.unlink('mosquitto-%d.db' % (port)) + pass + + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-assigned-client-identifier.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-assigned-client-identifier.py new file mode 100755 index 0000000..28f5037 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-assigned-client-identifier.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 + +# Test whether sending a non zero session expiry interval in DISCONNECT after +# having sent a zero session expiry interval is treated correctly in MQTT v5. + +from mosq_test_helper import * + + + + +def do_test(clean_start): + rc = 1 + keepalive = 10 + connect_packet = mosq_test.gen_connect(None, proto_ver=5, keepalive=keepalive, clean_session=clean_start) + + props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_ASSIGNED_CLIENT_IDENTIFIER, "auto-00000000-0000-0000-0000-000000000000") + connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props) + + props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 1) + disconnect_client_packet = mosq_test.gen_disconnect(proto_ver=5, properties=props) + + disconnect_server_packet = mosq_test.gen_disconnect(proto_ver=5, reason_code=130) + + port = mosq_test.get_port() + broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + + try: + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.settimeout(10) + sock.connect(("localhost", port)) + + sock.send(connect_packet) + connack_recvd = sock.recv(len(connack_packet)) + + if connack_recvd[0:12] == connack_packet[0:12]: + # FIXME - this test could be tightened up a lot + rc = 0 + + sock.close() + finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + exit(rc) + + +do_test(True) +do_test(False) +exit(0) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-maximum-packet-size-broker.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-maximum-packet-size-broker.py new file mode 100755 index 0000000..43e6a19 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-maximum-packet-size-broker.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 + +# Check whether the broker disconnects a client nicely when they send a too large packet. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("max_packet_size 30\n") + +port = mosq_test.get_port() +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + +rc = 1 + +keepalive = 10 +connect_packet = mosq_test.gen_connect("test", proto_ver=5, keepalive=keepalive) +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MAXIMUM_PACKET_SIZE, 30) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props) + +publish_packet = mosq_test.gen_publish("test/topic", qos=0, payload="0123456789012345678901234567890", proto_ver=5) +disconnect_packet = mosq_test.gen_disconnect(reason_code=149, proto_ver=5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port, use_conf=True) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, publish_packet, disconnect_packet, "disconnect") + rc = 0 +finally: + broker.terminate() + broker.wait() + os.remove(conf_file) + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-maximum-packet-size-connect.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-maximum-packet-size-connect.py new file mode 100755 index 0000000..1d6582f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-maximum-packet-size-connect.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 + +# Test whether setting maximum packet size to smaller than a CONNACK packet +# results in the CONNECT being rejected. +# MQTTv5 + +from mosq_test_helper import * + +rc = 1 + +keepalive = 10 +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MAXIMUM_PACKET_SIZE, 2) +connect_packet = mosq_test.gen_connect("test", proto_ver=5, keepalive=keepalive, properties=props) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, b"", port=port) + # Exception occurs if connack packet returned + rc = 0 +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-maximum-packet-size-publish-qos1.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-maximum-packet-size-publish-qos1.py new file mode 100755 index 0000000..4fee7c7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-maximum-packet-size-publish-qos1.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 + +# Test whether maximum packet size is honoured on a PUBLISH to a client +# MQTTv5 + +from mosq_test_helper import * + +rc = 1 + +keepalive = 10 +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MAXIMUM_PACKET_SIZE, 20) +connect_packet = mosq_test.gen_connect("test", proto_ver=5, keepalive=keepalive, properties=props) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "test/topic", 1, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid, 1, proto_ver=5) + +mid=1 +publish1_packet = mosq_test.gen_publish(topic="test/topic", mid=mid, qos=1, payload="12345678901234567890", proto_ver=5) +puback1_packet = mosq_test.gen_puback(mid, proto_ver=5) + +mid=2 +publish2_packet = mosq_test.gen_publish(topic="test/topic", mid=mid, qos=1, payload="7890", proto_ver=5) +puback2_packet = mosq_test.gen_puback(mid, proto_ver=5) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet) + + mosq_test.do_send_receive(sock, publish1_packet, puback1_packet, "puback 1") + + # We shouldn't receive the publish here because it is > MAXIMUM_PACKET_SIZE + mosq_test.do_ping(sock) + + mosq_test.do_send_receive(sock, publish2_packet, puback2_packet, "puback 2") + + if mosq_test.expect_packet(sock, "publish2", publish2_packet): + rc = 0 +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-maximum-packet-size-publish-qos2.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-maximum-packet-size-publish-qos2.py new file mode 100755 index 0000000..d789520 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-maximum-packet-size-publish-qos2.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 + +# Test whether maximum packet size is honoured on a PUBLISH to a client +# MQTTv5 + +from mosq_test_helper import * + +rc = 1 + +keepalive = 10 +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MAXIMUM_PACKET_SIZE, 20) +connect_packet = mosq_test.gen_connect("test", proto_ver=5, keepalive=keepalive, properties=props) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "test/topic", 2, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid, 2, proto_ver=5) + +mid=1 +publish1_packet = mosq_test.gen_publish(topic="test/topic", mid=mid, qos=2, payload="12345678901234567890", proto_ver=5) +pubrec1_packet = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel1_packet = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp1_packet = mosq_test.gen_pubcomp(mid, proto_ver=5) + +mid=2 +publish2_packet = mosq_test.gen_publish(topic="test/topic", mid=mid, qos=2, payload="7890", proto_ver=5) +pubrec2_packet = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel2_packet = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp2_packet = mosq_test.gen_pubcomp(mid, proto_ver=5) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet) + + mosq_test.do_send_receive(sock, publish1_packet, pubrec1_packet, "pubrec 1") + mosq_test.do_send_receive(sock, pubrel1_packet, pubcomp1_packet, "pubcomp 1") + + # We shouldn't receive the publish here because it is > MAXIMUM_PACKET_SIZE + mosq_test.do_ping(sock) + + mosq_test.do_send_receive(sock, publish2_packet, pubrec2_packet, "pubrec 2") + mosq_test.do_send_receive(sock, pubrel2_packet, pubcomp2_packet, "pubcomp 2") + + if mosq_test.expect_packet(sock, "publish2", publish2_packet): + rc = 0 +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-maximum-packet-size-publish.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-maximum-packet-size-publish.py new file mode 100755 index 0000000..dca9e34 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-maximum-packet-size-publish.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python3 + +# Test whether maximum packet size is honoured on a PUBLISH to a client +# MQTTv5 + +from mosq_test_helper import * + +rc = 1 + +keepalive = 10 +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MAXIMUM_PACKET_SIZE, 20) +connect_packet = mosq_test.gen_connect("test", proto_ver=5, keepalive=keepalive, properties=props) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "test/topic", 0, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + +publish1_packet = mosq_test.gen_publish(topic="test/topic", qos=0, payload="12345678901234567890", proto_ver=5) +publish2_packet = mosq_test.gen_publish(topic="test/topic", qos=0, payload="67890", proto_ver=5) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet) + sock.send(publish1_packet) + # We shouldn't receive the publish here because it is > MAXIMUM_PACKET_SIZE + mosq_test.do_ping(sock, "pingresp1") + mosq_test.do_send_receive(sock, publish2_packet, publish2_packet) + mosq_test.do_ping(sock, "pingresp2") + rc = 0 +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-response-topic-correlation-data.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-response-topic-correlation-data.py new file mode 100755 index 0000000..18d50a4 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-response-topic-correlation-data.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 + +# client 1 subscribes to normal-topic +# client 2 susbscribes to response-topic +# client 2 publishes message to normal-topic with response-topic property and correlation-data property +# client 1 receives message, publishes a response on response-topic +# client 2 receives message, checks payload + +from mosq_test_helper import * + +rc = 1 + +keepalive = 10 + +connect_packet1 = mosq_test.gen_connect("client1", proto_ver=5, keepalive=keepalive) +connect_packet2 = mosq_test.gen_connect("client2", proto_ver=5, keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +subscribe_packet1 = mosq_test.gen_subscribe(mid=1, topic="normal/topic", qos=0, proto_ver=5) +subscribe_packet2 = mosq_test.gen_subscribe(mid=1, topic="response/topic", qos=0, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid=1, qos=0, proto_ver=5) + +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_RESPONSE_TOPIC, "response/topic") +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_CORRELATION_DATA, "45vyvynq30q3vt4 nuy893b4v3") +publish_packet2 = mosq_test.gen_publish(topic="normal/topic", qos=0, payload="2", proto_ver=5, properties=props) + +publish_packet1 = mosq_test.gen_publish(topic="response/topic", qos=0, payload="22", proto_ver=5) + +disconnect_client_packet = mosq_test.gen_disconnect(proto_ver=5, properties=props) + +disconnect_server_packet = mosq_test.gen_disconnect(proto_ver=5, reason_code=130) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock1 = mosq_test.do_client_connect(connect_packet1, connack_packet, port=port) + sock2 = mosq_test.do_client_connect(connect_packet2, connack_packet, port=port) + + mosq_test.do_send_receive(sock1, subscribe_packet1, suback_packet, "subscribe1") + mosq_test.do_send_receive(sock2, subscribe_packet2, suback_packet, "subscribe2") + + sock2.send(publish_packet2) + if mosq_test.expect_packet(sock1, "publish1", publish_packet2): + # FIXME - it would be better to extract the property and payload, even though we know them + sock1.send(publish_packet1) + if mosq_test.expect_packet(sock2, "publish2", publish_packet1): + rc = 0 + + sock1.close() + sock2.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-response-topic.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-response-topic.py new file mode 100755 index 0000000..2a4ea7b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-response-topic.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python3 + +# client 1 subscribes to normal-topic +# client 2 susbscribes to response-topic +# client 2 publishes message to normal-topic with response-topic property +# client 1 receives message, publishes a response on response-topic +# client 2 receives message, checks payload + +from mosq_test_helper import * + +rc = 1 + +keepalive = 10 + +connect_packet1 = mosq_test.gen_connect("client1", proto_ver=5, keepalive=keepalive) +connect_packet2 = mosq_test.gen_connect("client2", proto_ver=5, keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +subscribe_packet1 = mosq_test.gen_subscribe(mid=1, topic="normal/topic", qos=0, proto_ver=5) +subscribe_packet2 = mosq_test.gen_subscribe(mid=1, topic="response/topic", qos=0, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid=1, qos=0, proto_ver=5) + +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_RESPONSE_TOPIC, "response/topic") +publish_packet2 = mosq_test.gen_publish(topic="normal/topic", qos=0, payload="2", proto_ver=5, properties=props) + +publish_packet1 = mosq_test.gen_publish(topic="response/topic", qos=0, payload="22", proto_ver=5) + +disconnect_client_packet = mosq_test.gen_disconnect(proto_ver=5, properties=props) + +disconnect_server_packet = mosq_test.gen_disconnect(proto_ver=5, reason_code=130) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock1 = mosq_test.do_client_connect(connect_packet1, connack_packet, port=port) + sock2 = mosq_test.do_client_connect(connect_packet2, connack_packet, port=port) + + mosq_test.do_send_receive(sock1, subscribe_packet1, suback_packet, "subscribe1") + mosq_test.do_send_receive(sock2, subscribe_packet2, suback_packet, "subscribe2") + + sock2.send(publish_packet2) + if mosq_test.expect_packet(sock1, "publish1", publish_packet2): + # FIXME - it would be better to extract the property and payload, even though we know them + sock1.send(publish_packet1) + if mosq_test.expect_packet(sock2, "publish2", publish_packet1): + rc = 0 + + sock1.close() + sock2.close() +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-server-keepalive.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-server-keepalive.py new file mode 100755 index 0000000..31d92a4 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-server-keepalive.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python3 + +# Test whether sending a non zero session expiry interval in DISCONNECT after +# having sent a zero session expiry interval is treated correctly in MQTT v5. + +from mosq_test_helper import * + +def write_config(filename, port): + with open(filename, 'w') as f: + f.write("port %d\n" % (port)) + f.write("\n") + f.write("max_keepalive 60\n") + +port = mosq_test.get_port(1) +conf_file = os.path.basename(__file__).replace('.py', '.conf') +write_config(conf_file, port) + + +rc = 1 + +keepalive = 61 +connect_packet = mosq_test.gen_connect("test", proto_ver=5, keepalive=keepalive) + +props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_SERVER_KEEP_ALIVE, 60) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port, use_conf=True) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.close() + rc = 0 +finally: + os.remove(conf_file) + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-session-expiry-invalid.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-session-expiry-invalid.py new file mode 100755 index 0000000..afc8706 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-session-expiry-invalid.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 + +# Test whether sending a non zero session expiry interval in DISCONNECT after +# having sent a zero session expiry interval is treated correctly in MQTT v5. + +from mosq_test_helper import * + +rc = 1 + +keepalive = 10 +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 0) +connect_packet = mosq_test.gen_connect("test", proto_ver=5, keepalive=keepalive, properties=props) + +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 1) +disconnect_client_packet = mosq_test.gen_disconnect(proto_ver=5, properties=props) + +disconnect_server_packet = mosq_test.gen_disconnect(proto_ver=5, reason_code=130) + +port = mosq_test.get_port() +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + mosq_test.do_send_receive(sock, disconnect_client_packet, disconnect_server_packet, "disconnect") + sock.close() + rc = 0 +finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-subpub-content-type.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-subpub-content-type.py new file mode 100755 index 0000000..2fa453b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-subpub-content-type.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +# Test whether a client subscribed to a topic receives its own message sent to that topic. +# Does the Content Type property get sent through? +# MQTT v5 + +import prop_subpub_helper as helper +from mosq_test_helper import * + +props_out = mqtt5_props.gen_string_prop(mqtt5_props.PROP_CONTENT_TYPE, "text") +props_out = props_out+mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_TOPIC_ALIAS, 1) + +props_in = mqtt5_props.gen_string_prop(mqtt5_props.PROP_CONTENT_TYPE, "text") + +helper.prop_subpub_helper(props_out, props_in) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-subpub-payload-format.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-subpub-payload-format.py new file mode 100755 index 0000000..99c6a6b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-subpub-payload-format.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +# Test whether a client subscribed to a topic receives its own message sent to that topic. +# Does the Payload Format Indicator property get sent through? +# MQTT v5 + +import prop_subpub_helper as helper +from mosq_test_helper import * + +props_out = mqtt5_props.gen_byte_prop(mqtt5_props.PROP_PAYLOAD_FORMAT_INDICATOR, 0xed) +props_out = props_out+mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_TOPIC_ALIAS, 1) + +props_in = mqtt5_props.gen_byte_prop(mqtt5_props.PROP_PAYLOAD_FORMAT_INDICATOR, 0xed) + +helper.prop_subpub_helper(props_out, props_in) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-topic-alias-invalid.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-topic-alias-invalid.py new file mode 100755 index 0000000..877a895 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/12-prop-topic-alias-invalid.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 + +# Test whether the broker handles a topic alias of >max_topic_alias correctly. +# MQTTv5 + +from mosq_test_helper import * + +def do_test(value): + rc = 1 + + keepalive = 10 + connect_packet = mosq_test.gen_connect("test", proto_ver=5, keepalive=keepalive) + connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + + props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_TOPIC_ALIAS, value) + publish_packet = mosq_test.gen_publish(topic="test/topic", qos=0, payload="12345678901234567890", proto_ver=5, properties=props) + + disconnect_packet = mosq_test.gen_disconnect(reason_code=mqtt5_rc.MQTT_RC_TOPIC_ALIAS_INVALID, proto_ver=5) + port = mosq_test.get_port() + broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + + try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=port) + sock.send(publish_packet) + if mosq_test.expect_packet(sock, "disconnect", disconnect_packet): + rc = 0 + finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + exit(rc) + + +do_test(11) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/Makefile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/Makefile new file mode 100644 index 0000000..ba91fb8 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/Makefile @@ -0,0 +1,214 @@ +include ../../config.mk + +.PHONY: all check clean test ptest +.NOTPARALLEL: + +all : + +check : test + +clean : + -rm -f *.vglog *.db + $(MAKE) -C c clean + +test-compile : + $(MAKE) -C c + +ptest : test-compile + ./test.py + +test : test-compile 01 02 03 04 05 06 07 08 09 10 11 12 + +01 : + ./01-connect-anon-denied.py + ./01-connect-bad-packet.py + ./01-connect-disconnect-v5.py + ./01-connect-duplicate-v5.py + ./01-connect-duplicate.py + ./01-connect-invalid-id-0-311.py + ./01-connect-invalid-id-0.py + ./01-connect-invalid-id-missing.py + ./01-connect-invalid-id-utf8.py + ./01-connect-invalid-protonum.py + ./01-connect-invalid-reserved.py + ./01-connect-success-v5.py + ./01-connect-success.py + ./01-connect-uname-invalid-utf8.py + ./01-connect-uname-no-flag.py + ./01-connect-uname-no-password-denied.py + ./01-connect-uname-password-denied-no-will.py + ./01-connect-uname-password-denied.py + ./01-connect-uname-pwd-no-flag.py +ifeq ($(WITH_TLS),yes) + ./01-connect-uname-password-success.py +else + ./01-connect-uname-password-success-no-tls.py +endif + + +02 : + ./02-shared-qos0-v5.py + ./02-subhier-crash.py + ./02-subpub-qos0-retain-as-publish.py + ./02-subpub-qos0-send-retain.py + ./02-subpub-qos0-subscription-id.py + ./02-subpub-qos0-topic-alias-unknown.py + ./02-subpub-qos0-topic-alias.py + ./02-subpub-qos0-v5.py + ./02-subpub-qos0.py + ./02-subpub-qos1-bad-pubcomp.py + ./02-subpub-qos1-bad-pubrec.py + ./02-subpub-qos1-message-expiry-retain.py + ./02-subpub-qos1-message-expiry-will.py + ./02-subpub-qos1-message-expiry.py + ./02-subpub-qos1-nolocal.py + ./02-subpub-qos1-v5.py + ./02-subpub-qos1.py + ./02-subpub-qos2-bad-puback-1.py + ./02-subpub-qos2-bad-puback-2.py + ./02-subpub-qos2-bad-pubcomp.py + ./02-subpub-qos2-pubrec-error.py + ./02-subpub-qos2-receive-maximum-1.py + ./02-subpub-qos2-receive-maximum-2.py + ./02-subpub-qos2-v5.py + ./02-subpub-qos2.py + ./02-subscribe-dollar-v5.py + ./02-subscribe-invalid-utf8.py + ./02-subscribe-persistence-flipflop.py + ./02-subscribe-qos0.py + ./02-subscribe-qos1.py + ./02-subscribe-qos2.py + ./02-unsubscribe-invalid-no-topic.py + ./02-unsubscribe-qos0.py + ./02-unsubscribe-qos1.py + ./02-unsubscribe-qos2-multiple-v5.py + ./02-unsubscribe-qos2-multiple.py + ./02-unsubscribe-qos2-v5.py + ./02-unsubscribe-qos2.py + +03 : + #./03-publish-qos1-queued-bytes.py + ./03-pattern-matching.py + ./03-publish-b2c-disconnect-qos1.py + ./03-publish-b2c-disconnect-qos2.py + ./03-publish-b2c-qos1-len.py + ./03-publish-b2c-qos2-len.py + ./03-publish-c2b-disconnect-qos2.py + ./03-publish-c2b-qos2-len.py + ./03-publish-dollar-v5.py + ./03-publish-dollar.py + ./03-publish-invalid-utf8.py + ./03-publish-qos1-no-subscribers-v5.py + ./03-publish-qos1-retain-disabled.py + ./03-publish-qos1.py + ./03-publish-qos2.py + +04 : + ./04-retain-check-source-persist-diff-port.py + ./04-retain-check-source-persist.py + ./04-retain-check-source.py + ./04-retain-qos0-clear.py + ./04-retain-qos0-fresh.py + ./04-retain-qos0-repeated.py + ./04-retain-qos0.py + ./04-retain-qos1-qos0.py + ./04-retain-upgrade-outgoing-qos.py + +05 : + ./05-clean-session-qos1.py + ./05-session-expiry-v5.py + +06 : + ./06-bridge-b2br-disconnect-qos1.py + ./06-bridge-b2br-disconnect-qos2.py + ./06-bridge-b2br-late-connection-retain.py + ./06-bridge-b2br-late-connection.py + ./06-bridge-b2br-remapping.py + ./06-bridge-br2b-disconnect-qos1.py + ./06-bridge-br2b-disconnect-qos2.py + ./06-bridge-br2b-remapping.py + ./06-bridge-fail-persist-resend-qos1.py + ./06-bridge-fail-persist-resend-qos2.py + ./06-bridge-no-local.py + ./06-bridge-per-listener-settings.py + ./06-bridge-reconnect-local-out.py + +07 : + ./07-will-delay-reconnect.py + ./07-will-delay-recover.py + ./07-will-delay.py + ./07-will-disconnect-with-will.py + ./07-will-invalid-utf8.py + ./07-will-no-flag.py + ./07-will-null-topic.py + ./07-will-null.py + ./07-will-properties.py + ./07-will-qos0.py + ./07-will-reconnect-1273.py + +08 : +ifeq ($(WITH_TLS),yes) + ./08-ssl-bridge.py + ./08-ssl-connect-cert-auth-crl.py + ./08-ssl-connect-cert-auth-expired.py + ./08-ssl-connect-cert-auth-revoked.py + ./08-ssl-connect-cert-auth-without.py + ./08-ssl-connect-cert-auth.py + ./08-ssl-connect-identity.py + ./08-ssl-connect-no-auth-wrong-ca.py + ./08-ssl-connect-no-auth.py + ./08-ssl-connect-no-identity.py +ifeq ($(WITH_TLS_PSK),yes) + ./08-tls-psk-pub.py + ./08-tls-psk-bridge.py +endif +endif + +09 : + ./09-acl-access-variants.py + ./09-acl-change.py + ./09-acl-empty-file.py + ./09-auth-bad-method.py + ./09-extended-auth-change-username.py + ./09-extended-auth-multistep-reauth.py + ./09-extended-auth-multistep.py + ./09-extended-auth-single.py + ./09-extended-auth-unsupported.py + ./09-plugin-auth-acl-pub.py + ./09-plugin-auth-acl-sub-denied.py + ./09-plugin-auth-acl-sub.py + ./09-plugin-auth-context-params.py + ./09-plugin-auth-defer-unpwd-fail.py + ./09-plugin-auth-defer-unpwd-success.py + ./09-plugin-auth-msg-params.py + ./09-plugin-auth-unpwd-fail.py + ./09-plugin-auth-unpwd-success.py + ./09-plugin-auth-v2-unpwd-fail.py + ./09-plugin-auth-v2-unpwd-success.py + ./09-pwfile-parse-invalid.py + +10 : + ./10-listener-mount-point.py + +11 : + ./11-message-expiry.py + ./11-persistent-subscription.py + ./11-persistent-subscription-v5.py + ./11-persistent-subscription-no-local.py + ./11-pub-props.py + ./11-subscription-id.py + +12 : + ./12-prop-assigned-client-identifier.py + ./12-prop-maximum-packet-size-broker.py + ./12-prop-maximum-packet-size-connect.py + ./12-prop-maximum-packet-size-publish-qos1.py + ./12-prop-maximum-packet-size-publish-qos2.py + ./12-prop-maximum-packet-size-publish.py + ./12-prop-response-topic-correlation-data.py + ./12-prop-response-topic.py + ./12-prop-server-keepalive.py + ./12-prop-session-expiry-invalid.py + ./12-prop-subpub-content-type.py + ./12-prop-subpub-payload-format.py + ./12-prop-topic-alias-invalid.py diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/08-tls-psk-bridge.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/08-tls-psk-bridge.c new file mode 100644 index 0000000..884efd7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/08-tls-psk-bridge.c @@ -0,0 +1,66 @@ +#include <errno.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; +static int sent_mid; + +void on_log(struct mosquitto *mosq, void *obj, int level, const char *str) +{ + printf("%s\n", str); +} + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_publish(mosq, &sent_mid, "psk/test", strlen("message"), "message", 1, false); + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + if(mid == sent_mid){ + mosquitto_disconnect(mosq); + run = 0; + }else{ + exit(1); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + int port; + + port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("08-tls-psk-bridge", true, NULL); + mosquitto_tls_opts_set(mosq, 1, "tlsv1", NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_publish_callback_set(mosq, on_publish); + mosquitto_log_callback_set(mosq, on_log); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + if(rc) return rc; + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/08-tls-psk-pub.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/08-tls-psk-pub.c new file mode 100644 index 0000000..11105a5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/08-tls-psk-pub.c @@ -0,0 +1,70 @@ +#include <errno.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; +static int sent_mid; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_publish(mosq, &sent_mid, "psk/test", strlen("message"), "message", 0, false); + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + if(mid == sent_mid){ + mosquitto_disconnect(mosq); + run = 0; + }else{ + exit(1); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +int main(int argc, char *argv[]) +{ + int rc; + int port; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + port = atoi(argv[1]); + + mosq = mosquitto_new("08-tls-psk-pub", true, NULL); + mosquitto_tls_opts_set(mosq, 1, "tlsv1", NULL); + rc = mosquitto_tls_psk_set(mosq, "deadbeef", "psk-id", NULL); + if(rc){ + mosquitto_destroy(mosq); + return rc; + } + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_publish_callback_set(mosq, on_publish); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + if(rc){ + mosquitto_destroy(mosq); + return rc; + } + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_destroy(mosq); + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/Makefile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/Makefile new file mode 100644 index 0000000..cdef589 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/Makefile @@ -0,0 +1,40 @@ +.PHONY: all test clean reallyclean + +CFLAGS=-I../../../lib -I../../../src -Wall -Werror + +PLUGIN_SRC = \ + auth_plugin.c \ + auth_plugin_pwd.c \ + auth_plugin_acl.c \ + auth_plugin_acl_sub_denied.c \ + auth_plugin_v2.c \ + auth_plugin_context_params.c \ + auth_plugin_msg_params.c \ + auth_plugin_extended_multiple.c \ + auth_plugin_extended_single.c \ + auth_plugin_extended_single2.c + +PLUGINS = ${PLUGIN_SRC:.c=.so} + +SRC = \ + 08-tls-psk-pub.c \ + 08-tls-psk-bridge.c + +TESTS = ${SRC:.c=.test} + + +all : ${PLUGINS} ${TESTS} + +${PLUGINS} : %.so: %.c + $(CC) ${CFLAGS} -fPIC -shared $< -o $@ + + +${TESTS} : %.test: %.c + $(CC) ${CFLAGS} $< -o $@ ../../../lib/libmosquitto.so.1 + + +reallyclean : clean + -rm -f *.orig + +clean : + rm -f *.so *.test diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin.c new file mode 100644 index 0000000..f99e8c7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin.c @@ -0,0 +1,71 @@ +#include <stdio.h> +#include <string.h> +#include <mosquitto.h> +#include <mosquitto_broker.h> +#include <mosquitto_plugin.h> + +int mosquitto_auth_plugin_version(void) +{ + return MOSQ_AUTH_PLUGIN_VERSION; +} + +int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg) +{ + const char *username = mosquitto_client_username(client); + + if(username && !strcmp(username, "readonly") && access == MOSQ_ACL_READ){ + return MOSQ_ERR_SUCCESS; + }else if(username && !strcmp(username, "readonly") && access == MOSQ_ACL_SUBSCRIBE &&!strchr(msg->topic, '#') && !strchr(msg->topic, '+')) { + return MOSQ_ERR_SUCCESS; + }else if(username && !strcmp(username, "readwrite")){ + if((!strcmp(msg->topic, "readonly") && access == MOSQ_ACL_READ) + || !strcmp(msg->topic, "writeable")){ + + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_ACL_DENIED; + } + + }else{ + return MOSQ_ERR_ACL_DENIED; + } +} + +int mosquitto_auth_unpwd_check(void *user_data, struct mosquitto *client, const char *username, const char *password) +{ + if(!strcmp(username, "test-username") && password && !strcmp(password, "cnwTICONIURW")){ + return MOSQ_ERR_SUCCESS; + }else if(!strcmp(username, "readonly") || !strcmp(username, "readwrite")){ + return MOSQ_ERR_SUCCESS; + }else if(!strcmp(username, "test-username@v2")){ + return MOSQ_ERR_PLUGIN_DEFER; + }else{ + return MOSQ_ERR_AUTH; + } +} + +int mosquitto_auth_psk_key_get(void *user_data, struct mosquitto *client, const char *hint, const char *identity, char *key, int max_key_len) +{ + return MOSQ_ERR_AUTH; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_acl.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_acl.c new file mode 100644 index 0000000..90d10e0 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_acl.c @@ -0,0 +1,54 @@ +#include <stdio.h> +#include <string.h> +#include <mosquitto.h> +#include <mosquitto_broker.h> +#include <mosquitto_plugin.h> + +int mosquitto_auth_plugin_version(void) +{ + return MOSQ_AUTH_PLUGIN_VERSION; +} + +int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg) +{ + const char *username = mosquitto_client_username(client); + + if(username && !strcmp(username, "readonly") && access == MOSQ_ACL_READ){ + return MOSQ_ERR_SUCCESS; + }else if(username && !strcmp(username, "readonly") && access == MOSQ_ACL_SUBSCRIBE &&!strchr(msg->topic, '#') && !strchr(msg->topic, '+')) { + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_ACL_DENIED; + } +} + +int mosquitto_auth_unpwd_check(void *user_data, struct mosquitto *client, const char *username, const char *password) +{ + return MOSQ_ERR_PLUGIN_DEFER; +} + +int mosquitto_auth_psk_key_get(void *user_data, struct mosquitto *client, const char *hint, const char *identity, char *key, int max_key_len) +{ + return MOSQ_ERR_AUTH; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_acl_sub_denied.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_acl_sub_denied.c new file mode 100644 index 0000000..d6147df --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_acl_sub_denied.c @@ -0,0 +1,49 @@ +#include <stdio.h> +#include <string.h> +#include <mosquitto.h> +#include <mosquitto_broker.h> +#include <mosquitto_plugin.h> + +int mosquitto_auth_plugin_version(void) +{ + return MOSQ_AUTH_PLUGIN_VERSION; +} + +int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg) +{ + if(access == MOSQ_ACL_SUBSCRIBE){ + return MOSQ_ERR_ACL_DENIED; + }else{ + return MOSQ_ERR_SUCCESS; + } +} + +int mosquitto_auth_unpwd_check(void *user_data, struct mosquitto *client, const char *username, const char *password) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_psk_key_get(void *user_data, struct mosquitto *client, const char *hint, const char *identity, char *key, int max_key_len) +{ + return MOSQ_ERR_AUTH; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_context_params.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_context_params.c new file mode 100644 index 0000000..5fbc9c1 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_context_params.c @@ -0,0 +1,91 @@ +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <mosquitto.h> +#include <mosquitto_broker.h> +#include <mosquitto_plugin.h> + +int mosquitto_auth_plugin_version(void) +{ + return MOSQ_AUTH_PLUGIN_VERSION; +} + +int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg) +{ + return MOSQ_ERR_PLUGIN_DEFER; +} + +int mosquitto_auth_unpwd_check(void *user_data, struct mosquitto *client, const char *username, const char *password) +{ + const char *tmp; + + tmp = mosquitto_client_address(client); + if(!tmp || strcmp(tmp, "127.0.0.1")){ + return MOSQ_ERR_AUTH; + } + + if(!mosquitto_client_clean_session(client)){ + fprintf(stderr, "mosquitto_auth_unpwd_check clean_session error: %d\n", mosquitto_client_clean_session(client)); + return MOSQ_ERR_AUTH; + } + + tmp = mosquitto_client_id(client); + if(!tmp || strcmp(tmp, "client-params-test")){ + fprintf(stderr, "mosquitto_auth_unpwd_check client_id error: %s\n", tmp); + return MOSQ_ERR_AUTH; + } + + if(mosquitto_client_keepalive(client) != 42){ + fprintf(stderr, "mosquitto_auth_unpwd_check keepalive error: %d\n", mosquitto_client_keepalive(client)); + return MOSQ_ERR_AUTH; + } + + if(!mosquitto_client_certificate(client)){ + // FIXME + //return MOSQ_ERR_AUTH; + } + + if(mosquitto_client_protocol(client) != 2){ + fprintf(stderr, "mosquitto_auth_unpwd_check protocol error: %d\n", mosquitto_client_protocol(client)); + return MOSQ_ERR_AUTH; + } + + if(mosquitto_client_sub_count(client)){ + fprintf(stderr, "mosquitto_auth_unpwd_check sub_count error: %d\n", mosquitto_client_sub_count(client)); + return MOSQ_ERR_AUTH; + } + + tmp = mosquitto_client_username(client); + if(!tmp || strcmp(tmp, "client-username")){ + fprintf(stderr, "mosquitto_auth_unpwd_check username error: %s\n", tmp); + return MOSQ_ERR_AUTH; + } + + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_psk_key_get(void *user_data, struct mosquitto *client, const char *hint, const char *identity, char *key, int max_key_len) +{ + return MOSQ_ERR_AUTH; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_extended_multiple.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_extended_multiple.c new file mode 100644 index 0000000..d4f670c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_extended_multiple.c @@ -0,0 +1,80 @@ +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <mosquitto.h> +#include <mosquitto_broker.h> +#include <mosquitto_plugin.h> + +int mosquitto_auth_plugin_version(void) +{ + return MOSQ_AUTH_PLUGIN_VERSION; +} + +int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg) +{ + return MOSQ_ERR_PLUGIN_DEFER; +} + + +int mosquitto_auth_start(void *user_data, struct mosquitto *client, const char *method, bool reauth, const void *data, uint16_t data_len, void **data_out, uint16_t *data_out_len) +{ + int i; + + if(!strcmp(method, "mirror")){ + if(data_len > 0){ + *data_out = malloc(data_len); + if(!(*data_out)){ + return MOSQ_ERR_NOMEM; + } + for(i=0; i<data_len; i++){ + ((uint8_t *)(*data_out))[i] = ((uint8_t *)data)[data_len-i-1]; + } + *data_out_len = data_len; + + return MOSQ_ERR_AUTH_CONTINUE; + }else{ + return MOSQ_ERR_INVAL; + } + } + return MOSQ_ERR_NOT_SUPPORTED; +} + + +int mosquitto_auth_continue(void *user_data, struct mosquitto *client, const char *method, const void *data, uint16_t data_len, void **data_out, uint16_t *data_out_len) +{ + int len; + + if(!strcmp(method, "mirror")){ + if(data_len > 0){ + len = strlen("supercalifragilisticexpialidocious")>data_len?data_len:strlen("supercalifragilisticexpialidocious"); + if(!memcmp(data, "supercalifragilisticexpialidocious", len)){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_AUTH; + } + }else{ + return MOSQ_ERR_INVAL; + } + } + return MOSQ_ERR_NOT_SUPPORTED; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_extended_single.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_extended_single.c new file mode 100644 index 0000000..8425b76 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_extended_single.c @@ -0,0 +1,78 @@ +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <mosquitto.h> +#include <mosquitto_broker.h> +#include <mosquitto_plugin.h> + +int mosquitto_auth_plugin_version(void) +{ + return MOSQ_AUTH_PLUGIN_VERSION; +} + +int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg) +{ + return MOSQ_ERR_PLUGIN_DEFER; +} + + +int mosquitto_auth_start(void *user_data, struct mosquitto *client, const char *method, bool reauth, const void *data, uint16_t data_len, void **data_out, uint16_t *data_out_len) +{ + int i; + + if(!strcmp(method, "error")){ + return MOSQ_ERR_INVAL; + }else if(!strcmp(method, "non-matching")){ + return MOSQ_ERR_NOT_SUPPORTED; + }else if(!strcmp(method, "single")){ + data_len = data_len>strlen("data")?strlen("data"):data_len; + if(!memcmp(data, "data", data_len)){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_AUTH; + } + }else if(!strcmp(method, "change")){ + return mosquitto_set_username(client, "new_username"); + }else if(!strcmp(method, "mirror")){ + if(data_len > 0){ + *data_out = malloc(data_len); + if(!(*data_out)){ + return MOSQ_ERR_NOMEM; + } + for(i=0; i<data_len; i++){ + ((uint8_t *)(*data_out))[i] = ((uint8_t *)data)[data_len-i-1]; + } + *data_out_len = data_len; + + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_INVAL; + } + } + return MOSQ_ERR_NOT_SUPPORTED; +} + +int mosquitto_auth_continue(void *user_data, struct mosquitto *client, const char *method, const void *data, uint16_t data_len, void **data_out, uint16_t *data_out_len) +{ + return MOSQ_ERR_AUTH; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_extended_single2.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_extended_single2.c new file mode 100644 index 0000000..a0773cd --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_extended_single2.c @@ -0,0 +1,78 @@ +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <mosquitto.h> +#include <mosquitto_broker.h> +#include <mosquitto_plugin.h> + +int mosquitto_auth_plugin_version(void) +{ + return MOSQ_AUTH_PLUGIN_VERSION; +} + +int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg) +{ + return MOSQ_ERR_PLUGIN_DEFER; +} + + +int mosquitto_auth_start(void *user_data, struct mosquitto *client, const char *method, bool reauth, const void *data, uint16_t data_len, void **data_out, uint16_t *data_out_len) +{ + int i; + + if(!strcmp(method, "error2")){ + return MOSQ_ERR_INVAL; + }else if(!strcmp(method, "non-matching2")){ + return MOSQ_ERR_NOT_SUPPORTED; + }else if(!strcmp(method, "single2")){ + data_len = data_len>strlen("data")?strlen("data"):data_len; + if(!memcmp(data, "data", data_len)){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_AUTH; + } + }else if(!strcmp(method, "change2")){ + return mosquitto_set_username(client, "new_username"); + }else if(!strcmp(method, "mirror2")){ + if(data_len > 0){ + *data_out = malloc(data_len); + if(!(*data_out)){ + return MOSQ_ERR_NOMEM; + } + for(i=0; i<data_len; i++){ + ((uint8_t *)(*data_out))[i] = ((uint8_t *)data)[data_len-i-1]; + } + *data_out_len = data_len; + + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_INVAL; + } + } + return MOSQ_ERR_NOT_SUPPORTED; +} + +int mosquitto_auth_continue(void *user_data, struct mosquitto *client, const char *method, const void *data, uint16_t data_len, void **data_out, uint16_t *data_out_len) +{ + return MOSQ_ERR_AUTH; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_msg_params.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_msg_params.c new file mode 100644 index 0000000..859f521 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_msg_params.c @@ -0,0 +1,76 @@ +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <mosquitto.h> +#include <mosquitto_broker.h> +#include <mosquitto_plugin.h> + +int mosquitto_auth_plugin_version(void) +{ + return MOSQ_AUTH_PLUGIN_VERSION; +} + +int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg) +{ + if(access == MOSQ_ACL_SUBSCRIBE){ + return MOSQ_ERR_SUCCESS; + } + + if(!msg->topic || strcmp(msg->topic, "param/topic")){ + abort(); + return MOSQ_ERR_ACL_DENIED; + } + + if(!msg->payload || strncmp(msg->payload, "payload contents", strlen("payload contents"))){ + abort(); + return MOSQ_ERR_ACL_DENIED; + } + + if(msg->payloadlen != strlen("payload contents")){ + abort(); + return MOSQ_ERR_ACL_DENIED; + } + + if(msg->qos != 1){ + abort(); + return MOSQ_ERR_ACL_DENIED; + } + + if(!msg->retain){ + abort(); + return MOSQ_ERR_ACL_DENIED; + } + + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_unpwd_check(void *user_data, struct mosquitto *client, const char *username, const char *password) +{ + return MOSQ_ERR_PLUGIN_DEFER; +} + +int mosquitto_auth_psk_key_get(void *user_data, struct mosquitto *client, const char *hint, const char *identity, char *key, int max_key_len) +{ + return MOSQ_ERR_AUTH; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_pwd.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_pwd.c new file mode 100644 index 0000000..35a118e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_pwd.c @@ -0,0 +1,54 @@ +#include <stdio.h> +#include <string.h> +#include <mosquitto.h> +#include <mosquitto_broker.h> +#include <mosquitto_plugin.h> + +int mosquitto_auth_plugin_version(void) +{ + return MOSQ_AUTH_PLUGIN_VERSION; +} + +int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg) +{ + return MOSQ_ERR_PLUGIN_DEFER; +} + +int mosquitto_auth_unpwd_check(void *user_data, struct mosquitto *client, const char *username, const char *password) +{ + if(!strcmp(username, "test-username") && password && !strcmp(password, "cnwTICONIURW")){ + return MOSQ_ERR_SUCCESS; + }else if(!strcmp(username, "readonly")){ + return MOSQ_ERR_SUCCESS; + }else if(!strcmp(username, "test-username@v2")){ + return MOSQ_ERR_PLUGIN_DEFER; + }else{ + return MOSQ_ERR_AUTH; + } +} + +int mosquitto_auth_psk_key_get(void *user_data, struct mosquitto *client, const char *hint, const char *identity, char *key, int max_key_len) +{ + return MOSQ_ERR_AUTH; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_v2.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_v2.c new file mode 100644 index 0000000..3b039ef --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/auth_plugin_v2.c @@ -0,0 +1,67 @@ +#include <string.h> +#include <stdbool.h> +#include "mosquitto_plugin_v2.h" + +/* + * Following constant come from mosquitto.h + * + * They are copied here to fix value of those constant at the time of MOSQ_AUTH_PLUGIN_VERSION == 2 + */ +enum mosq_err_t { + MOSQ_ERR_SUCCESS = 0, + MOSQ_ERR_AUTH = 11, + MOSQ_ERR_ACL_DENIED = 12 +}; + +int mosquitto_auth_plugin_version(void) +{ + return MOSQ_AUTH_PLUGIN_VERSION; +} + +int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_init(void *user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_acl_check(void *user_data, const char *clientid, const char *username, const char *topic, int access) +{ + if(!strcmp(username, "readonly") && access == MOSQ_ACL_READ){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_ACL_DENIED; + } +} + +int mosquitto_auth_unpwd_check(void *user_data, const char *username, const char *password) +{ + if(!strcmp(username, "test-username") && password && !strcmp(password, "cnwTICONIURW")){ + return MOSQ_ERR_SUCCESS; + }else if(!strcmp(username, "readonly")){ + return MOSQ_ERR_SUCCESS; + }else if(!strcmp(username, "test-username@v2")){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_AUTH; + } +} + +int mosquitto_auth_psk_key_get(void *user_data, const char *hint, const char *identity, char *key, int max_key_len) +{ + return MOSQ_ERR_AUTH; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/mosquitto_plugin_v2.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/mosquitto_plugin_v2.h new file mode 100644 index 0000000..5b6449c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/c/mosquitto_plugin_v2.h @@ -0,0 +1,228 @@ +/* +Copyright (c) 2012-2014 Roger Light <roger@atchoo.org> + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef MOSQUITTO_PLUGIN_H +#define MOSQUITTO_PLUGIN_H + +#define MOSQ_AUTH_PLUGIN_VERSION 2 + +#define MOSQ_ACL_NONE 0x00 +#define MOSQ_ACL_READ 0x01 +#define MOSQ_ACL_WRITE 0x02 + +struct mosquitto_auth_opt { + char *key; + char *value; +}; + +/* + * To create an authentication plugin you must include this file then implement + * the functions listed below. The resulting code should then be compiled as a + * shared library. Using gcc this can be achieved as follows: + * + * gcc -I<path to mosquitto_plugin.h> -fPIC -shared plugin.c -o plugin.so + * + * On Mac OS X: + * + * gcc -I<path to mosquitto_plugin.h> -fPIC -shared plugin.c -undefined dynamic_lookup -o plugin.so + * + */ + +/* ========================================================================= + * + * Utility Functions + * + * Use these functions from within your plugin. + * + * There are also very useful functions in libmosquitto. + * + * ========================================================================= */ + +/* + * Function: mosquitto_log_printf + * + * Write a log message using the broker configured logging. + * + * Parameters: + * level - Log message priority. Can currently be one of: + * + * MOSQ_LOG_INFO + * MOSQ_LOG_NOTICE + * MOSQ_LOG_WARNING + * MOSQ_LOG_ERR + * MOSQ_LOG_DEBUG + * MOSQ_LOG_SUBSCRIBE (not recommended for use by plugins) + * MOSQ_LOG_UNSUBSCRIBE (not recommended for use by plugins) + * + * These values are defined in mosquitto.h. + * + * fmt, ... - printf style format and arguments. + */ +void mosquitto_log_printf(int level, const char *fmt, ...); + + + +/* ========================================================================= + * + * Plugin Functions + * + * You must implement these functions in your plugin. + * + * ========================================================================= */ + +/* + * Function: mosquitto_auth_plugin_version + * + * The broker will call this function immediately after loading the plugin to + * check it is a supported plugin version. Your code must simply return + * MOSQ_AUTH_PLUGIN_VERSION. + */ +int mosquitto_auth_plugin_version(void); + +/* + * Function: mosquitto_auth_plugin_init + * + * Called after the plugin has been loaded and <mosquitto_auth_plugin_version> + * has been called. This will only ever be called once and can be used to + * initialise the plugin. + * + * Parameters: + * + * user_data : The pointer set here will be passed to the other plugin + * functions. Use to hold connection information for example. + * auth_opts : Pointer to an array of struct mosquitto_auth_opt, which + * provides the plugin options defined in the configuration file. + * auth_opt_count : The number of elements in the auth_opts array. + * + * Return value: + * Return 0 on success + * Return >0 on failure. + */ +int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count); + +/* + * Function: mosquitto_auth_plugin_cleanup + * + * Called when the broker is shutting down. This will only ever be called once. + * Note that <mosquitto_auth_security_cleanup> will be called directly before + * this function. + * + * Parameters: + * + * user_data : The pointer provided in <mosquitto_auth_plugin_init>. + * auth_opts : Pointer to an array of struct mosquitto_auth_opt, which + * provides the plugin options defined in the configuration file. + * auth_opt_count : The number of elements in the auth_opts array. + * + * Return value: + * Return 0 on success + * Return >0 on failure. + */ +int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count); + +/* + * Function: mosquitto_auth_security_init + * + * Called when the broker initialises the security functions when it starts up. + * If the broker is requested to reload its configuration whilst running, + * <mosquitto_auth_security_cleanup> will be called, followed by this function. + * In this situation, the reload parameter will be true. + * + * Parameters: + * + * user_data : The pointer provided in <mosquitto_auth_plugin_init>. + * auth_opts : Pointer to an array of struct mosquitto_auth_opt, which + * provides the plugin options defined in the configuration file. + * auth_opt_count : The number of elements in the auth_opts array. + * reload : If set to false, this is the first time the function has + * been called. If true, the broker has received a signal + * asking to reload its configuration. + * + * Return value: + * Return 0 on success + * Return >0 on failure. + */ +int mosquitto_auth_security_init(void *user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count, bool reload); + +/* + * Function: mosquitto_auth_security_cleanup + * + * Called when the broker cleans up the security functions when it shuts down. + * If the broker is requested to reload its configuration whilst running, + * this function will be called, followed by <mosquitto_auth_security_init>. + * In this situation, the reload parameter will be true. + * + * Parameters: + * + * user_data : The pointer provided in <mosquitto_auth_plugin_init>. + * auth_opts : Pointer to an array of struct mosquitto_auth_opt, which + * provides the plugin options defined in the configuration file. + * auth_opt_count : The number of elements in the auth_opts array. + * reload : If set to false, this is the first time the function has + * been called. If true, the broker has received a signal + * asking to reload its configuration. + * + * Return value: + * Return 0 on success + * Return >0 on failure. + */ +int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count, bool reload); + +/* + * Function: mosquitto_auth_acl_check + * + * Called by the broker when topic access must be checked. access will be one + * of MOSQ_ACL_READ (for subscriptions) or MOSQ_ACL_WRITE (for publish). Return + * MOSQ_ERR_SUCCESS if access was granted, MOSQ_ERR_ACL_DENIED if access was + * not granted, or MOSQ_ERR_UNKNOWN for an application specific error. + */ +int mosquitto_auth_acl_check(void *user_data, const char *clientid, const char *username, const char *topic, int access); + +/* + * Function: mosquitto_auth_unpwd_check + * + * Called by the broker when a username/password must be checked. Return + * MOSQ_ERR_SUCCESS if the user is authenticated, MOSQ_ERR_AUTH if + * authentication failed, or MOSQ_ERR_UNKNOWN for an application specific + * error. + */ +int mosquitto_auth_unpwd_check(void *user_data, const char *username, const char *password); + +/* + * Function: mosquitto_psk_key_get + * + * Called by the broker when a client connects to a listener using TLS/PSK. + * This is used to retrieve the pre-shared-key associated with a client + * identity. + * + * Examine hint and identity to determine the required PSK (which must be a + * hexadecimal string with no leading "0x") and copy this string into key. + * + * Parameters: + * user_data : the pointer provided in <mosquitto_auth_plugin_init>. + * hint : the psk_hint for the listener the client is connecting to. + * identity : the identity string provided by the client + * key : a string where the hex PSK should be copied + * max_key_len : the size of key + * + * Return value: + * Return 0 on success. + * Return >0 on failure. + * Return >0 if this function is not required. + */ +int mosquitto_auth_psk_key_get(void *user_data, const char *hint, const char *identity, char *key, int max_key_len); + +#endif diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/mosq_test_helper.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/mosq_test_helper.py new file mode 100644 index 0000000..7354839 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/mosq_test_helper.py @@ -0,0 +1,17 @@ +import inspect, os, sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test +import mqtt5_opts +import mqtt5_props +import mqtt5_rc + +import socket +import ssl +import struct +import subprocess +import time diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/prop_subpub_helper.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/prop_subpub_helper.py new file mode 100755 index 0000000..9059f31 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/prop_subpub_helper.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python3 + +# Test whether a client subscribed to a topic receives its own message sent to that topic. +# Does a given property get sent through? +# MQTT v5 + +from mosq_test_helper import * + +def prop_subpub_helper(props_out, props_in): + rc = 1 + mid = 53 + keepalive = 60 + connect_packet = mosq_test.gen_connect("subpub-qos0-test", keepalive=keepalive, proto_ver=5) + connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + + subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos0", 0, proto_ver=5) + suback_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + + publish_packet_out = mosq_test.gen_publish("subpub/qos0", qos=0, payload="message", proto_ver=5, properties=props_out) + + publish_packet_expected = mosq_test.gen_publish("subpub/qos0", qos=0, payload="message", proto_ver=5, properties=props_in) + + port = mosq_test.get_port() + broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) + + try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20, port=port) + + mosq_test.do_send_receive(sock, subscribe_packet, suback_packet, "suback") + mosq_test.do_send_receive(sock, publish_packet_out, publish_packet_expected, "publish") + + rc = 0 + + sock.close() + finally: + broker.terminate() + broker.wait() + (stdo, stde) = broker.communicate() + if rc: + print(stde.decode('utf-8')) + + exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/readme.txt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/readme.txt new file mode 100644 index 0000000..37f062e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/readme.txt @@ -0,0 +1,19 @@ +----- Broker Tests ----- + +This folder contains a number of tests to exercise the functionality of the +broker. Feel free to add more. + +Numbering is as follows: + +01: Connection tests +02: Subscribe/unsubscribe tests +03: Publish tests +04: Retained message tests +05: Session management tests +06: Bridge tests +07: Will tests +08: TLS tests +09: Auth tests +10: Listener tests +11: Persistence tests +12: Property tests diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/test.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/test.py new file mode 100755 index 0000000..497e362 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/broker/test.py @@ -0,0 +1,182 @@ +#!/usr/bin/env python3 + +import mosq_test_helper +import ptest + +tests = [ + #(ports required, 'path'), + (1, './01-connect-anon-denied.py'), + (1, './01-connect-bad-packet.py'), + (1, './01-connect-disconnect-v5.py'), + (1, './01-connect-duplicate-v5.py'), + (1, './01-connect-duplicate.py'), + (1, './01-connect-invalid-id-0-311.py'), + (1, './01-connect-invalid-id-0.py'), + (1, './01-connect-invalid-id-missing.py'), + (1, './01-connect-invalid-id-utf8.py'), + (1, './01-connect-invalid-protonum.py'), + (1, './01-connect-invalid-reserved.py'), + (1, './01-connect-success-v5.py'), + (1, './01-connect-success.py'), + (1, './01-connect-uname-invalid-utf8.py'), + (1, './01-connect-uname-no-flag.py'), + (1, './01-connect-uname-no-password-denied.py'), + (1, './01-connect-uname-password-denied-no-will.py'), + (1, './01-connect-uname-password-denied.py'), + (1, './01-connect-uname-password-success.py'), + (1, './01-connect-uname-pwd-no-flag.py'), + + (1, './02-shared-qos0-v5.py'), + (1, './02-subhier-crash.py'), + (1, './02-subpub-qos0-retain-as-publish.py'), + (1, './02-subpub-qos0-send-retain.py'), + (1, './02-subpub-qos0-subscription-id.py'), + (1, './02-subpub-qos0-topic-alias-unknown.py'), + (1, './02-subpub-qos0-topic-alias.py'), + (1, './02-subpub-qos0-v5.py'), + (1, './02-subpub-qos0.py'), + (1, './02-subpub-qos1-bad-pubcomp.py'), + (1, './02-subpub-qos1-bad-pubrec.py'), + (1, './02-subpub-qos1-message-expiry-retain.py'), + (1, './02-subpub-qos1-message-expiry-will.py'), + (1, './02-subpub-qos1-message-expiry.py'), + (1, './02-subpub-qos1-nolocal.py'), + (1, './02-subpub-qos1-v5.py'), + (1, './02-subpub-qos1.py'), + (1, './02-subpub-qos2-bad-puback-1.py'), + (1, './02-subpub-qos2-bad-puback-2.py'), + (1, './02-subpub-qos2-bad-pubcomp.py'), + (1, './02-subpub-qos2-pubrec-error.py'), + (1, './02-subpub-qos2-receive-maximum-1.py'), + (1, './02-subpub-qos2-receive-maximum-2.py'), + (1, './02-subpub-qos2-v5.py'), + (1, './02-subpub-qos2.py'), + (1, './02-subscribe-dollar-v5.py'), + (1, './02-subscribe-invalid-utf8.py'), + (1, './02-subscribe-persistence-flipflop.py'), + (1, './02-subscribe-qos0.py'), + (1, './02-subscribe-qos1.py'), + (1, './02-subscribe-qos2.py'), + (1, './02-unsubscribe-invalid-no-topic.py'), + (1, './02-unsubscribe-qos0.py'), + (1, './02-unsubscribe-qos1.py'), + (1, './02-unsubscribe-qos2-multiple-v5.py'), + (1, './02-unsubscribe-qos2-multiple.py'), + (1, './02-unsubscribe-qos2-v5.py'), + (1, './02-unsubscribe-qos2.py'), + + #(1, './03-publish-qos1-queued-bytes.py'), + (1, './03-pattern-matching.py'), + (1, './03-publish-b2c-disconnect-qos1.py'), + (1, './03-publish-b2c-disconnect-qos2.py'), + (1, './03-publish-b2c-qos1-len.py'), + (1, './03-publish-b2c-qos2-len.py'), + (1, './03-publish-c2b-disconnect-qos2.py'), + (1, './03-publish-c2b-qos2-len.py'), + (1, './03-publish-dollar-v5.py'), + (1, './03-publish-dollar.py'), + (1, './03-publish-invalid-utf8.py'), + (1, './03-publish-qos1-no-subscribers-v5.py'), + (1, './03-publish-qos1-retain-disabled.py'), + (1, './03-publish-qos1.py'), + (1, './03-publish-qos2.py'), + + (1, './04-retain-check-source-persist.py'), + (1, './04-retain-check-source.py'), + (1, './04-retain-qos0-clear.py'), + (1, './04-retain-qos0-fresh.py'), + (1, './04-retain-qos0-repeated.py'), + (1, './04-retain-qos0.py'), + (1, './04-retain-qos1-qos0.py'), + (1, './04-retain-upgrade-outgoing-qos.py'), + (2, './04-retain-check-source-persist-diff-port.py'), + + (1, './05-clean-session-qos1.py'), + (1, './05-session-expiry-v5.py'), + + (2, './06-bridge-b2br-disconnect-qos1.py'), + (2, './06-bridge-b2br-disconnect-qos2.py'), + (2, './06-bridge-b2br-late-connection-retain.py'), + (2, './06-bridge-b2br-late-connection.py'), + (2, './06-bridge-b2br-remapping.py'), + (2, './06-bridge-br2b-disconnect-qos1.py'), + (2, './06-bridge-br2b-disconnect-qos2.py'), + (2, './06-bridge-br2b-remapping.py'), + (2, './06-bridge-fail-persist-resend-qos1.py'), + (2, './06-bridge-fail-persist-resend-qos2.py'), + (1, './06-bridge-no-local.py'), + (3, './06-bridge-per-listener-settings.py'), + (2, './06-bridge-reconnect-local-out.py'), + + (1, './07-will-delay-reconnect.py'), + (1, './07-will-delay-recover.py'), + (1, './07-will-delay.py'), + (1, './07-will-disconnect-with-will.py'), + (1, './07-will-invalid-utf8.py'), + (1, './07-will-no-flag.py'), + (1, './07-will-null-topic.py'), + (1, './07-will-null.py'), + (1, './07-will-properties.py'), + (1, './07-will-qos0.py'), + (1, './07-will-reconnect-1273.py'), + + (2, './08-ssl-bridge.py'), + (2, './08-ssl-connect-cert-auth-crl.py'), + (2, './08-ssl-connect-cert-auth-expired.py'), + (2, './08-ssl-connect-cert-auth-revoked.py'), + (2, './08-ssl-connect-cert-auth-without.py'), + (2, './08-ssl-connect-cert-auth.py'), + (2, './08-ssl-connect-identity.py'), + (2, './08-ssl-connect-no-auth-wrong-ca.py'), + (2, './08-ssl-connect-no-auth.py'), + (2, './08-ssl-connect-no-identity.py'), + (2, './08-tls-psk-pub.py'), + (3, './08-tls-psk-bridge.py'), + + (1, './09-acl-access-variants.py'), + (1, './09-acl-change.py'), + (1, './09-acl-empty-file.py'), + (1, './09-auth-bad-method.py'), + (1, './09-extended-auth-change-username.py'), + (1, './09-extended-auth-multistep-reauth.py'), + (1, './09-extended-auth-multistep.py'), + (1, './09-extended-auth-single.py'), + (1, './09-extended-auth-unsupported.py'), + (1, './09-plugin-auth-acl-pub.py'), + (1, './09-plugin-auth-acl-sub-denied.py'), + (1, './09-plugin-auth-acl-sub.py'), + (1, './09-plugin-auth-context-params.py'), + (1, './09-plugin-auth-defer-unpwd-fail.py'), + (1, './09-plugin-auth-defer-unpwd-success.py'), + (1, './09-plugin-auth-msg-params.py'), + (1, './09-plugin-auth-unpwd-fail.py'), + (1, './09-plugin-auth-unpwd-success.py'), + (1, './09-plugin-auth-v2-unpwd-fail.py'), + (1, './09-plugin-auth-v2-unpwd-success.py'), + (1, './09-pwfile-parse-invalid.py'), + + (2, './10-listener-mount-point.py'), + + (1, './11-message-expiry.py'), + (1, './11-persistent-subscription.py'), + (1, './11-persistent-subscription-v5.py'), + (1, './11-persistent-subscription-no-local.py'), + (1, './11-pub-props.py'), + (1, './11-subscription-id.py'), + + (1, './12-prop-assigned-client-identifier.py'), + (1, './12-prop-maximum-packet-size-broker.py'), + (1, './12-prop-maximum-packet-size-connect.py'), + (1, './12-prop-maximum-packet-size-publish-qos1.py'), + (1, './12-prop-maximum-packet-size-publish-qos2.py'), + (1, './12-prop-maximum-packet-size-publish.py'), + (1, './12-prop-response-topic-correlation-data.py'), + (1, './12-prop-response-topic.py'), + (1, './12-prop-server-keepalive.py'), + (1, './12-prop-session-expiry-invalid.py'), + (1, './12-prop-subpub-content-type.py'), + (1, './12-prop-subpub-payload-format.py'), + (1, './12-prop-topic-alias-invalid.py'), + ] + +ptest.run_tests(tests) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-con-discon-success.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-con-discon-success.py new file mode 100755 index 0000000..469ecb1 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-con-discon-success.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python3 + +# Test whether a client produces a correct connect and subsequent disconnect. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id 01-con-discon-success +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK and verifying that rc=0, the client should send a DISCONNECT +# message. If rc!=0, the client should exit with an error. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("01-con-discon-success", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp + +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + #client.terminate() + client.wait() + sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-keepalive-pingreq.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-keepalive-pingreq.py new file mode 100755 index 0000000..a58fb45 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-keepalive-pingreq.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python3 + +# Test whether a client sends a pingreq after the keepalive time + +# The client should connect to port 1888 with keepalive=4, clean session set, +# and client id 01-keepalive-pingreq +# The client should send a PINGREQ message after the appropriate amount of time +# (4 seconds after no traffic). + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 4 +connect_packet = mosq_test.gen_connect("01-keepalive-pingreq", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +pingreq_packet = mosq_test.gen_pingreq() +pingresp_packet = mosq_test.gen_pingresp() + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(keepalive+10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "pingreq", pingreq_packet): + time.sleep(1.0) + conn.send(pingresp_packet) + + if mosq_test.expect_packet(conn, "pingreq", pingreq_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-no-clean-session.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-no-clean-session.py new file mode 100755 index 0000000..29ea42d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-no-clean-session.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 + +# Test whether a client produces a correct connect with clean session not set. + +# The client should connect to port 1888 with keepalive=60, clean session not +# set, and client id 01-no-clean-session. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("01-no-clean-session", clean_session=False, keepalive=keepalive) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-server-keepalive-pingreq.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-server-keepalive-pingreq.py new file mode 100755 index 0000000..d375c97 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-server-keepalive-pingreq.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python3 + +# Test whether a client sends a pingreq after the keepalive time +# Client sets a keepalive of 60 seconds, but receives a server keepalive to set +# it back to 4 seconds. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +server_keepalive = 4 +connect_packet = mosq_test.gen_connect("01-server-keepalive-pingreq", keepalive=keepalive, proto_ver=5) + +props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_SERVER_KEEP_ALIVE, server_keepalive) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props) + +pingreq_packet = mosq_test.gen_pingreq() +pingresp_packet = mosq_test.gen_pingresp() + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(server_keepalive+10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "pingreq", pingreq_packet): + time.sleep(1.0) + conn.send(pingresp_packet) + + if mosq_test.expect_packet(conn, "pingreq", pingreq_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-unpwd-set.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-unpwd-set.py new file mode 100755 index 0000000..6d4ad19 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-unpwd-set.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 + +# Test whether a client produces a correct connect with a username and password. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# client id 01-unpwd-set, username set to uname and password set to ;'[08gn=# + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("01-unpwd-set", keepalive=keepalive, username="uname", password=";'[08gn=#") + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-will-set.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-will-set.py new file mode 100755 index 0000000..af9ae78 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-will-set.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 + +# Test whether a client produces a correct connect with a will. +# Will QoS=1, will retain=1. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# client id 01-will-set will topic set to topic/on/unexpected/disconnect , will +# payload set to "will message", will qos set to 1 and will retain set. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("01-will-set", keepalive=keepalive, will_topic="topic/on/unexpected/disconnect", will_qos=1, will_retain=True, will_payload=b"will message") + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-will-unpwd-set.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-will-unpwd-set.py new file mode 100755 index 0000000..534d267 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/01-will-unpwd-set.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 + +# Test whether a client produces a correct connect with a will, username and password. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# client id 01-will-unpwd-set , will topic set to "will-topic", will payload +# set to "will message", will qos=2, will retain not set, username set to +# "oibvvwqw" and password set to "#'^2hg9a&nm38*us". + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("01-will-unpwd-set", + keepalive=keepalive, username="oibvvwqw", password="#'^2hg9a&nm38*us", + will_topic="will-topic", will_qos=2, will_payload=b"will message") + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-subscribe-qos0.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-subscribe-qos0.py new file mode 100755 index 0000000..692c6e6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-subscribe-qos0.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 + +# Test whether a client sends a correct SUBSCRIBE to a topic with QoS 0. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id subscribe-qos0-test +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK and verifying that rc=0, the client should send a SUBSCRIBE +# message to subscribe to topic "qos0/test" with QoS=0. If rc!=0, the client +# should exit with an error. +# Upon receiving the correct SUBSCRIBE message, the test will reply with a +# SUBACK message with the accepted QoS set to 0. On receiving the SUBACK +# message, the client should send a DISCONNECT message. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subscribe-qos0-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "qos0/test", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "subscribe", subscribe_packet): + conn.send(suback_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-subscribe-qos1.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-subscribe-qos1.py new file mode 100755 index 0000000..4e237d5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-subscribe-qos1.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 + +# Test whether a client sends a correct SUBSCRIBE to a topic with QoS 1. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id subscribe-qos1-test +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK and verifying that rc=0, the client should send a SUBSCRIBE +# message to subscribe to topic "qos1/test" with QoS=1. If rc!=0, the client +# should exit with an error. +# Upon receiving the correct SUBSCRIBE message, the test will reply with a +# SUBACK message with the accepted QoS set to 1. On receiving the SUBACK +# message, the client should send a DISCONNECT message. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subscribe-qos1-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "qos1/test", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "subscribe", subscribe_packet): + conn.send(suback_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-subscribe-qos2.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-subscribe-qos2.py new file mode 100755 index 0000000..2c41e35 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-subscribe-qos2.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 + +# Test whether a client sends a correct SUBSCRIBE to a topic with QoS 2. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id subscribe-qos2-test +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK and verifying that rc=0, the client should send a SUBSCRIBE +# message to subscribe to topic "qos2/test" with QoS=2. If rc!=0, the client +# should exit with an error. +# Upon receiving the correct SUBSCRIBE message, the test will reply with a +# SUBACK message with the accepted QoS set to 2. On receiving the SUBACK +# message, the client should send a DISCONNECT message. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subscribe-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "qos2/test", 2) +suback_packet = mosq_test.gen_suback(mid, 2) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "subscribe", subscribe_packet): + conn.send(suback_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-unsubscribe-multiple-v5.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-unsubscribe-multiple-v5.py new file mode 100755 index 0000000..ab50b93 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-unsubscribe-multiple-v5.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 + +# Test whether a v5 client sends a correct UNSUBSCRIBE packet with multiple +# topics, and handles the UNSUBACK. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +keepalive = 60 +connect_packet = mosq_test.gen_connect("unsubscribe-test", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +disconnect_packet = mosq_test.gen_disconnect(proto_ver=5) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "unsubscribe/test", 2, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid, 2, proto_ver=5) + +mid = 2 +unsubscribe_packet = mosq_test.gen_unsubscribe_multiple(mid, ["unsubscribe/test", "no-sub"], proto_ver=5) +unsuback_packet = mosq_test.gen_unsuback(mid, reason_code=[0, 17], proto_ver=5) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +rc = 1 +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "subscribe", subscribe_packet): + conn.send(suback_packet) + + if mosq_test.expect_packet(conn, "unsubscribe", unsubscribe_packet): + conn.send(unsuback_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-unsubscribe-v5.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-unsubscribe-v5.py new file mode 100755 index 0000000..32d565a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-unsubscribe-v5.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 + +# Test whether a v5 client sends a correct UNSUBSCRIBE packet, and handles the UNSUBACK. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +keepalive = 60 +connect_packet = mosq_test.gen_connect("unsubscribe-test", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +disconnect_packet = mosq_test.gen_disconnect(proto_ver=5) + +mid = 1 +unsubscribe_packet = mosq_test.gen_unsubscribe(mid, "unsubscribe/test", proto_ver=5) +unsuback_packet = mosq_test.gen_unsuback(mid, proto_ver=5) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "unsubscribe", unsubscribe_packet): + conn.send(unsuback_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-unsubscribe.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-unsubscribe.py new file mode 100755 index 0000000..39aa05b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/02-unsubscribe.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 + +# Test whether a client sends a correct UNSUBSCRIBE packet. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("unsubscribe-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 1 +unsubscribe_packet = mosq_test.gen_unsubscribe(mid, "unsubscribe/test") +unsuback_packet = mosq_test.gen_unsuback(mid) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "unsubscribe", unsubscribe_packet): + conn.send(unsuback_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-b2c-qos1.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-b2c-qos1.py new file mode 100755 index 0000000..0d01cbe --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-b2c-qos1.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 + +# Test whether a client responds correctly to a PUBLISH with QoS 1. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id publish-qos1-test +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK the client should verify that rc==0. +# The test will send the client a PUBLISH message with topic +# "pub/qos1/receive", payload of "message", QoS=1 and mid=123. The client +# should handle this as per the spec by sending a PUBACK message. +# The client should then exit with return code==0. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos1-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 123 +publish_packet = mosq_test.gen_publish("pub/qos1/receive", qos=1, mid=mid, payload="message") +puback_packet = mosq_test.gen_puback(mid) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + conn.send(publish_packet) + + if mosq_test.expect_packet(conn, "puback", puback_packet): + rc = 0 + + conn.close() +finally: + for i in range(0, 5): + if client.returncode != None: + break + time.sleep(0.1) + + try: + client.terminate() + except OSError: + pass + client.wait() + sock.close() + if client.returncode != 0: + exit(1) + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-b2c-qos2-len.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-b2c-qos2-len.py new file mode 100755 index 0000000..fe37977 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-b2c-qos2-len.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python3 + +# Check whether a v5 client handles a v5 PUBREL with all combinations +# of with/without reason code and properties. + +from mosq_test_helper import * + +mid = 56 + +def len_test(test, pubrel_packet): + port = mosq_test.get_lib_port() + + rc = 1 + keepalive = 60 + connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive, proto_ver=5) + connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + + disconnect_packet = mosq_test.gen_disconnect(proto_ver=5) + + publish_packet = mosq_test.gen_publish("len/qos2/test", qos=2, mid=mid, payload="message", proto_ver=5) + pubrec_packet = mosq_test.gen_pubrec(mid, proto_ver=5) + pubcomp_packet = mosq_test.gen_pubcomp(mid, proto_ver=5) + + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + sock.settimeout(10) + sock.bind(('', port)) + sock.listen(5) + + client_args = sys.argv[1:] + env = dict(os.environ) + env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' + try: + pp = env['PYTHONPATH'] + except KeyError: + pp = '' + env['PYTHONPATH'] = '../../lib/python:'+pp + + client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + + try: + (conn, address) = sock.accept() + conn.settimeout(15) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + mosq_test.do_send_receive(conn, publish_packet, pubrec_packet, "pubrec") + mosq_test.do_send_receive(conn, pubrel_packet, pubcomp_packet, "pubcomp") + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() + finally: + client.terminate() + client.wait() + sock.close() + + if rc != 0: + print(test) + exit(rc) + + +# No reason code, no properties +pubrel_packet = mosq_test.gen_pubrel(mid) +len_test("qos2 len 2", pubrel_packet) + +# Reason code, no properties +pubrel_packet = mosq_test.gen_pubrel(mid, proto_ver=5, reason_code=0x00) +len_test("qos2 len 3", pubrel_packet) + +# Reason code, empty properties +pubrel_packet = mosq_test.gen_pubrel(mid, proto_ver=5, reason_code=0x00, properties="") +len_test("qos2 len 4", pubrel_packet) + +# Reason code, one property +props = mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key", "value") +pubrel_packet = mosq_test.gen_pubrel(mid, proto_ver=5, reason_code=0x00, properties=props) +len_test("qos2 len >5", pubrel_packet) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-b2c-qos2.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-b2c-qos2.py new file mode 100755 index 0000000..32589db --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-b2c-qos2.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 + +# Test whether a client responds correctly to a PUBLISH with QoS 1. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id publish-qos2-test +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK the client should verify that rc==0. +# The test will send the client a PUBLISH message with topic +# "pub/qos2/receive", payload of "message", QoS=2 and mid=13423. The client +# should handle this as per the spec by sending a PUBREC message. +# The test will not respond to the first PUBREC message, so the client must +# resend the PUBREC message with dup=1. Note that to keep test durations low, a +# message retry timeout of less than 10 seconds is required for this test. +# On receiving the second PUBREC with dup==1, the test will send the correct +# PUBREL message. The client should respond to this with the correct PUBCOMP +# message and then exit with return code=0. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 13423 +publish_packet = mosq_test.gen_publish("pub/qos2/receive", qos=2, mid=mid, payload="message") +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + conn.send(publish_packet) + + if mosq_test.expect_packet(conn, "pubrec", pubrec_packet): + conn.send(pubrel_packet) + + if mosq_test.expect_packet(conn, "pubcomp", pubcomp_packet): + rc = 0 + + conn.close() +finally: + for i in range(0, 5): + if client.returncode != None: + break + time.sleep(0.1) + + try: + client.terminate() + except OSError: + pass + + client.wait() + sock.close() + if client.returncode != 0: + exit(1) + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos1-disconnect.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos1-disconnect.py new file mode 100755 index 0000000..2900489 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos1-disconnect.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 + +# Test whether a client sends a correct PUBLISH to a topic with QoS 1, then responds correctly to a disconnect. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos1-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 1 +publish_packet = mosq_test.gen_publish("pub/qos1/test", qos=1, mid=mid, payload="message") +publish_packet_dup = mosq_test.gen_publish("pub/qos1/test", qos=1, mid=mid, payload="message", dup=True) +puback_packet = mosq_test.gen_puback(mid) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp + +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(15) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + # Disconnect client. It should reconnect. + conn.close() + + (conn, address) = sock.accept() + conn.settimeout(15) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "retried publish", publish_packet_dup): + conn.send(puback_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos1-len.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos1-len.py new file mode 100755 index 0000000..a3107b3 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos1-len.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python3 + +# Check whether a v5 client handles a v5 PUBACK with all combinations +# of with/without reason code and properties. + +from mosq_test_helper import * + +def len_test(test, puback_packet): + port = mosq_test.get_lib_port() + + rc = 1 + keepalive = 60 + connect_packet = mosq_test.gen_connect("publish-qos1-test", keepalive=keepalive, proto_ver=5) + connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + + disconnect_packet = mosq_test.gen_disconnect(proto_ver=5) + + mid = 1 + publish_packet = mosq_test.gen_publish("pub/qos1/test", qos=1, mid=mid, payload="message", proto_ver=5) + + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + sock.settimeout(10) + sock.bind(('', port)) + sock.listen(5) + + client_args = sys.argv[1:] + env = dict(os.environ) + env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' + try: + pp = env['PYTHONPATH'] + except KeyError: + pp = '' + env['PYTHONPATH'] = '../../lib/python:'+pp + + client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + + try: + (conn, address) = sock.accept() + conn.settimeout(15) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + conn.send(puback_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() + finally: + client.terminate() + client.wait() + sock.close() + + if rc != 0: + print(test) + exit(rc) + + +# No reason code, no properties +puback_packet = mosq_test.gen_puback(1) +len_test("qos1 len 2", puback_packet) + +# Reason code, no properties +puback_packet = mosq_test.gen_puback(1, proto_ver=5, reason_code=0x00) +len_test("qos1 len 3", puback_packet) + +# Reason code, empty properties +puback_packet = mosq_test.gen_puback(1, proto_ver=5, reason_code=0x00, properties="") +len_test("qos1 len 4", puback_packet) + +# Reason code, one property +props = mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key", "value") +puback_packet = mosq_test.gen_puback(1, proto_ver=5, reason_code=0x00, properties=props) +len_test("qos1 len >5", puback_packet) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos1-receive-maximum.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos1-receive-maximum.py new file mode 100755 index 0000000..8a09e5e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos1-receive-maximum.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python3 + +# Test whether a client responds correctly to multiple PUBLISH with QoS 1, with +# receive maximum set to 3. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos1-test", keepalive=keepalive, proto_ver=5) + +props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_RECEIVE_MAXIMUM, 3) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props) + +disconnect_packet = mosq_test.gen_disconnect(proto_ver=5) + +mid = 1 +publish_1_packet = mosq_test.gen_publish("topic", qos=1, mid=mid, payload="12345", proto_ver=5) +puback_1_packet = mosq_test.gen_puback(mid, proto_ver=5) + +mid = 2 +publish_2_packet = mosq_test.gen_publish("topic", qos=1, mid=mid, payload="12345", proto_ver=5) +puback_2_packet = mosq_test.gen_puback(mid, proto_ver=5) + +mid = 3 +publish_3_packet = mosq_test.gen_publish("topic", qos=1, mid=mid, payload="12345", proto_ver=5) +puback_3_packet = mosq_test.gen_puback(mid, proto_ver=5) + +mid = 4 +publish_4_packet = mosq_test.gen_publish("topic", qos=1, mid=mid, payload="12345", proto_ver=5) +puback_4_packet = mosq_test.gen_puback(mid, proto_ver=5) + +mid = 5 +publish_5_packet = mosq_test.gen_publish("topic", qos=1, mid=mid, payload="12345", proto_ver=5) +puback_5_packet = mosq_test.gen_puback(mid, proto_ver=5) + +mid = 6 +publish_6_packet = mosq_test.gen_publish("topic", qos=1, mid=mid, payload="12345", proto_ver=5) +puback_6_packet = mosq_test.gen_puback(mid, proto_ver=5) + + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish 1", publish_1_packet): + if mosq_test.expect_packet(conn, "publish 2", publish_2_packet): + if mosq_test.expect_packet(conn, "publish 3", publish_3_packet): + conn.send(puback_1_packet) + conn.send(puback_2_packet) + + if mosq_test.expect_packet(conn, "publish 4", publish_4_packet): + if mosq_test.expect_packet(conn, "publish 5", publish_5_packet): + conn.send(puback_3_packet) + + if mosq_test.expect_packet(conn, "publish 6", publish_6_packet): + conn.send(puback_4_packet) + conn.send(puback_5_packet) + conn.send(puback_6_packet) + rc = 0 + + conn.close() +finally: + for i in range(0, 5): + if client.returncode != None: + break + time.sleep(0.1) + + try: + client.terminate() + except OSError: + pass + + client.wait() + sock.close() + if client.returncode != 0: + exit(1) + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos1-timeout.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos1-timeout.py new file mode 100755 index 0000000..73889ce --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos1-timeout.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python3 + +# Test whether a client sends a correct PUBLISH to a topic with QoS 1 and responds to a delay. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id publish-qos1-test +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK the client should verify that rc==0. If not, it should exit with +# return code=1. +# On a successful CONNACK, the client should send a PUBLISH message with topic +# "pub/qos1/test", payload "message" and QoS=1. +# The test will not respond to the first PUBLISH message, so the client must +# resend the PUBLISH message with dup=1. Note that to keep test durations low, a +# message retry timeout of less than 10 seconds is required for this test. +# On receiving the second PUBLISH message, the test will send the correct +# PUBACK response. On receiving the correct PUBACK response, the client should +# send a DISCONNECT message. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos1-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 1 +publish_packet = mosq_test.gen_publish("pub/qos1/test", qos=1, mid=mid, payload="message") +publish_packet_dup = mosq_test.gen_publish("pub/qos1/test", qos=1, mid=mid, payload="message", dup=True) +puback_packet = mosq_test.gen_puback(mid) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + # Delay for > 3 seconds (message retry time) + + if mosq_test.expect_packet(conn, "dup publish", publish_packet_dup): + conn.send(puback_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-disconnect.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-disconnect.py new file mode 100755 index 0000000..ee8ed3c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-disconnect.py @@ -0,0 +1,82 @@ +#!/usr/bin/env python3 + +# Test whether a client sends a correct PUBLISH to a topic with QoS 2 and responds to a disconnect. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 1 +publish_packet = mosq_test.gen_publish("pub/qos2/test", qos=2, mid=mid, payload="message") +publish_dup_packet = mosq_test.gen_publish("pub/qos2/test", qos=2, mid=mid, payload="message", dup=True) +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + # Disconnect client. It should reconnect. + conn.close() + + (conn, address) = sock.accept() + conn.settimeout(15) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "retried publish", publish_dup_packet): + conn.send(pubrec_packet) + + if mosq_test.expect_packet(conn, "pubrel", pubrel_packet): + # Disconnect client. It should reconnect. + conn.close() + + (conn, address) = sock.accept() + conn.settimeout(15) + + # Complete connection and message flow. + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "retried pubrel", pubrel_packet): + conn.send(pubcomp_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-len.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-len.py new file mode 100755 index 0000000..12fd27a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-len.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3 + +# Check whether a v5 client handles a v5 PUBREC, PUBCOMP with all combinations +# of with/without reason code and properties. + +from mosq_test_helper import * + +def len_test(test, pubrec_packet, pubcomp_packet): + port = mosq_test.get_lib_port() + + rc = 1 + keepalive = 60 + connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive, proto_ver=5) + connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + + disconnect_packet = mosq_test.gen_disconnect(proto_ver=5) + + mid = 1 + publish_packet = mosq_test.gen_publish("pub/qos2/test", qos=2, mid=mid, payload="message", proto_ver=5) + pubrel_packet = mosq_test.gen_pubrel(mid, proto_ver=5) + + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + sock.settimeout(10) + sock.bind(('', port)) + sock.listen(5) + + client_args = sys.argv[1:] + env = dict(os.environ) + env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' + try: + pp = env['PYTHONPATH'] + except KeyError: + pp = '' + env['PYTHONPATH'] = '../../lib/python:'+pp + + client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + + try: + (conn, address) = sock.accept() + conn.settimeout(15) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + conn.send(pubrec_packet) + + if mosq_test.expect_packet(conn, "pubrel", pubrel_packet): + conn.send(pubcomp_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() + finally: + client.terminate() + client.wait() + sock.close() + + if rc != 0: + print(test) + exit(rc) + + +# No reason code, no properties +pubrec_packet = mosq_test.gen_pubrec(1) +pubcomp_packet = mosq_test.gen_pubcomp(1) +len_test("qos2 len 2", pubrec_packet, pubcomp_packet) + +# Reason code, no properties +pubrec_packet = mosq_test.gen_pubrec(1, proto_ver=5, reason_code=0x00) +pubcomp_packet = mosq_test.gen_pubcomp(1, proto_ver=5, reason_code=0x00) +len_test("qos2 len 3", pubrec_packet, pubcomp_packet) + +# Reason code, empty properties +pubrec_packet = mosq_test.gen_pubrec(1, proto_ver=5, reason_code=0x00, properties="") +pubcomp_packet = mosq_test.gen_pubcomp(1, proto_ver=5, reason_code=0x00, properties="") +len_test("qos2 len 4", pubrec_packet, pubcomp_packet) + +# Reason code, one property +props = mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key", "value") +pubrec_packet = mosq_test.gen_pubrec(1, proto_ver=5, reason_code=0x00, properties=props) +props = mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "key", "value") +pubcomp_packet = mosq_test.gen_pubcomp(1, proto_ver=5, reason_code=0x00, properties=props) +len_test("qos2 len >5", pubrec_packet, pubcomp_packet) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-maximum-qos-0.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-maximum-qos-0.py new file mode 100755 index 0000000..224b85a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-maximum-qos-0.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python3 + +# Test whether a client correctly handles sending a message with QoS > maximum QoS. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive, proto_ver=5) + +props = mqtt5_props.gen_byte_prop(mqtt5_props.PROP_MAXIMUM_QOS, 0) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props) + +disconnect_packet = mosq_test.gen_disconnect(proto_ver=5) + +publish_1_packet = mosq_test.gen_publish("maximum/qos/qos0", qos=0, payload="message", proto_ver=5) + +disconnect_packet = mosq_test.gen_disconnect(proto_ver=5) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish 1", publish_1_packet): + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + for i in range(0, 5): + if client.returncode != None: + break + time.sleep(0.1) + + try: + client.terminate() + except OSError: + pass + + client.wait() + sock.close() + if client.returncode != 0: + exit(1) + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-maximum-qos-1.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-maximum-qos-1.py new file mode 100755 index 0000000..b93cab0 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-maximum-qos-1.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python3 + +# Test whether a client correctly handles sending a message with QoS > maximum QoS. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive, proto_ver=5) + +props = mqtt5_props.gen_byte_prop(mqtt5_props.PROP_MAXIMUM_QOS, 1) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props) + +disconnect_packet = mosq_test.gen_disconnect(proto_ver=5) + +mid = 1 +publish_1_packet = mosq_test.gen_publish("maximum/qos/qos1", qos=1, mid=mid, payload="message", proto_ver=5) +puback_1_packet = mosq_test.gen_puback(mid, proto_ver=5) + +publish_2_packet = mosq_test.gen_publish("maximum/qos/qos0", qos=0, payload="message", proto_ver=5) + +disconnect_packet = mosq_test.gen_disconnect(proto_ver=5) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish 1", publish_1_packet): + conn.send(puback_1_packet) + if mosq_test.expect_packet(conn, "publish 2", publish_2_packet): + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + for i in range(0, 5): + if client.returncode != None: + break + time.sleep(0.1) + + try: + client.terminate() + except OSError: + pass + + client.wait() + sock.close() + if client.returncode != 0: + exit(1) + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-pubrec-error.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-pubrec-error.py new file mode 100755 index 0000000..67c7a87 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-pubrec-error.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python3 + +# Test whether a client responds correctly when sending multiple PUBLISH with +# QoS 2, with the broker rejecting the first PUBLISH by setting the reason code +# in PUBACK to >= 0x80. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive, proto_ver=5) + +props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_RECEIVE_MAXIMUM, 1) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props) + +disconnect_packet = mosq_test.gen_disconnect(proto_ver=5) + +mid = 1 +publish_1_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="rejected", proto_ver=5) +pubrec_1_packet = mosq_test.gen_pubrec(mid, proto_ver=5, reason_code=0x80) + +mid = 2 +publish_2_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="accepted", proto_ver=5) +pubrec_2_packet = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_2_packet = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_2_packet = mosq_test.gen_pubcomp(mid, proto_ver=5) + +disconnect_packet = mosq_test.gen_disconnect(proto_ver=5) + + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish 1", publish_1_packet): + conn.send(pubrec_1_packet) + + if mosq_test.expect_packet(conn, "publish 2", publish_2_packet): + conn.send(pubrec_2_packet) + + if mosq_test.expect_packet(conn, "pubrel 2", pubrel_2_packet): + conn.send(pubcomp_2_packet) + rc = 0 + + conn.close() +finally: + for i in range(0, 5): + if client.returncode != None: + break + time.sleep(0.1) + + try: + client.terminate() + except OSError: + pass + + client.wait() + sock.close() + if client.returncode != 0: + exit(1) + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-receive-maximum-1.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-receive-maximum-1.py new file mode 100755 index 0000000..c56c707 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-receive-maximum-1.py @@ -0,0 +1,118 @@ +#!/usr/bin/env python3 + +# Test whether a client responds correctly to multiple PUBLISH with QoS 2, with +# receive maximum set to 1. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive, proto_ver=5) + +props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_RECEIVE_MAXIMUM, 1) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props) + +disconnect_packet = mosq_test.gen_disconnect(proto_ver=5) + +mid = 1 +publish_1_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="12345", proto_ver=5) +pubrec_1_packet = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_1_packet = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_1_packet = mosq_test.gen_pubcomp(mid, proto_ver=5) + +mid = 2 +publish_2_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="12345", proto_ver=5) +pubrec_2_packet = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_2_packet = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_2_packet = mosq_test.gen_pubcomp(mid, proto_ver=5) + +mid = 3 +publish_3_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="12345", proto_ver=5) +pubrec_3_packet = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_3_packet = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_3_packet = mosq_test.gen_pubcomp(mid, proto_ver=5) + +mid = 4 +publish_4_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="12345", proto_ver=5) +pubrec_4_packet = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_4_packet = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_4_packet = mosq_test.gen_pubcomp(mid, proto_ver=5) + +mid = 5 +publish_5_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="12345", proto_ver=5) +pubrec_5_packet = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_5_packet = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_5_packet = mosq_test.gen_pubcomp(mid, proto_ver=5) + + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish 1", publish_1_packet): + conn.send(pubrec_1_packet) + if mosq_test.expect_packet(conn, "pubrel 1", pubrel_1_packet): + conn.send(pubcomp_1_packet) + + if mosq_test.expect_packet(conn, "publish 2", publish_2_packet): + conn.send(pubrec_2_packet) + if mosq_test.expect_packet(conn, "pubrel 2", pubrel_2_packet): + conn.send(pubcomp_2_packet) + + if mosq_test.expect_packet(conn, "publish 3", publish_3_packet): + conn.send(pubrec_3_packet) + if mosq_test.expect_packet(conn, "pubrel 3", pubrel_3_packet): + conn.send(pubcomp_3_packet) + + if mosq_test.expect_packet(conn, "publish 4", publish_4_packet): + conn.send(pubrec_4_packet) + if mosq_test.expect_packet(conn, "pubrel 4", pubrel_4_packet): + conn.send(pubcomp_4_packet) + + if mosq_test.expect_packet(conn, "publish 5", publish_5_packet): + conn.send(pubrec_5_packet) + if mosq_test.expect_packet(conn, "pubrel 5", pubrel_5_packet): + conn.send(pubcomp_5_packet) + rc = 0 + + conn.close() +finally: + for i in range(0, 5): + if client.returncode != None: + break + time.sleep(0.1) + + try: + client.terminate() + except OSError: + pass + + client.wait() + sock.close() + if client.returncode != 0: + exit(1) + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-receive-maximum-2.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-receive-maximum-2.py new file mode 100755 index 0000000..2859cb5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-receive-maximum-2.py @@ -0,0 +1,119 @@ +#!/usr/bin/env python3 + +# Test whether a client responds correctly to multiple PUBLISH with QoS 2, with +# receive maximum set to 2. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive, proto_ver=5) + +props = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_RECEIVE_MAXIMUM, 2) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props) + +disconnect_packet = mosq_test.gen_disconnect(proto_ver=5) + +mid = 1 +publish_1_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="12345", proto_ver=5) +pubrec_1_packet = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_1_packet = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_1_packet = mosq_test.gen_pubcomp(mid, proto_ver=5) + +mid = 2 +publish_2_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="12345", proto_ver=5) +pubrec_2_packet = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_2_packet = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_2_packet = mosq_test.gen_pubcomp(mid, proto_ver=5) + +mid = 3 +publish_3_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="12345", proto_ver=5) +pubrec_3_packet = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_3_packet = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_3_packet = mosq_test.gen_pubcomp(mid, proto_ver=5) + +mid = 4 +publish_4_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="12345", proto_ver=5) +pubrec_4_packet = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_4_packet = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_4_packet = mosq_test.gen_pubcomp(mid, proto_ver=5) + +mid = 5 +publish_5_packet = mosq_test.gen_publish("topic", qos=2, mid=mid, payload="12345", proto_ver=5) +pubrec_5_packet = mosq_test.gen_pubrec(mid, proto_ver=5) +pubrel_5_packet = mosq_test.gen_pubrel(mid, proto_ver=5) +pubcomp_5_packet = mosq_test.gen_pubcomp(mid, proto_ver=5) + + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish 1", publish_1_packet): + if mosq_test.expect_packet(conn, "publish 2", publish_2_packet): + conn.send(pubrec_1_packet) + conn.send(pubrec_2_packet) + + if mosq_test.expect_packet(conn, "pubrel 1", pubrel_1_packet): + if mosq_test.expect_packet(conn, "pubrel 2", pubrel_2_packet): + conn.send(pubcomp_1_packet) + conn.send(pubcomp_2_packet) + + if mosq_test.expect_packet(conn, "publish 3", publish_3_packet): + if mosq_test.expect_packet(conn, "publish 4", publish_4_packet): + conn.send(pubrec_3_packet) + conn.send(pubrec_4_packet) + + if mosq_test.expect_packet(conn, "pubrel 3", pubrel_3_packet): + if mosq_test.expect_packet(conn, "pubrel 4", pubrel_4_packet): + conn.send(pubcomp_3_packet) + conn.send(pubcomp_4_packet) + + if mosq_test.expect_packet(conn, "publish 5", publish_5_packet): + conn.send(pubrec_5_packet) + + if mosq_test.expect_packet(conn, "pubrel 5", pubrel_5_packet): + conn.send(pubcomp_5_packet) + rc = 0 + + conn.close() +finally: + for i in range(0, 5): + if client.returncode != None: + break + time.sleep(0.1) + + try: + client.terminate() + except OSError: + pass + + client.wait() + sock.close() + if client.returncode != 0: + exit(1) + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-timeout.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-timeout.py new file mode 100755 index 0000000..8cd785f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2-timeout.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 + +# Test whether a client sends a correct PUBLISH to a topic with QoS 1 and responds to a delay. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id publish-qos2-test +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK the client should verify that rc==0. If not, it should exit with +# return code=1. +# On a successful CONNACK, the client should send a PUBLISH message with topic +# "pub/qos2/test", payload "message" and QoS=2. +# The test will not respond to the first PUBLISH message, so the client must +# resend the PUBLISH message with dup=1. Note that to keep test durations low, a +# message retry timeout of less than 10 seconds is required for this test. +# On receiving the second PUBLISH message, the test will send the correct +# PUBREC response. On receiving the correct PUBREC response, the client should +# send a PUBREL message. +# The test will not respond to the first PUBREL message, so the client must +# resend the PUBREL message with dup=1. On receiving the second PUBREL message, +# the test will send the correct PUBCOMP response. On receiving the correct +# PUBCOMP response, the client should send a DISCONNECT message. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 1 +publish_packet = mosq_test.gen_publish("pub/qos2/test", qos=2, mid=mid, payload="message") +publish_dup_packet = mosq_test.gen_publish("pub/qos2/test", qos=2, mid=mid, payload="message", dup=True) +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + # Delay for > 3 seconds (message retry time) + + if mosq_test.expect_packet(conn, "dup publish", publish_dup_packet): + conn.send(pubrec_packet) + + if mosq_test.expect_packet(conn, "pubrel", pubrel_packet): + if mosq_test.expect_packet(conn, "dup pubrel", pubrel_packet): + conn.send(pubcomp_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2.py new file mode 100755 index 0000000..24cdc66 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-c2b-qos2.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python3 + +# Test whether a client sends a correct PUBLISH to a topic with QoS 2. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id publish-qos2-test +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK the client should verify that rc==0. If not, it should exit with +# return code=1. +# On a successful CONNACK, the client should send a PUBLISH message with topic +# "pub/qos2/test", payload "message" and QoS=2. +# The test will not respond to the first PUBLISH message, so the client must +# resend the PUBLISH message with dup=1. Note that to keep test durations low, a +# message retry timeout of less than 10 seconds is required for this test. +# On receiving the second PUBLISH message, the test will send the correct +# PUBREC response. On receiving the correct PUBREC response, the client should +# send a PUBREL message. +# The test will not respond to the first PUBREL message, so the client must +# resend the PUBREL message with dup=1. On receiving the second PUBREL message, +# the test will send the correct PUBCOMP response. On receiving the correct +# PUBCOMP response, the client should send a DISCONNECT message. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 1 +publish_packet = mosq_test.gen_publish("pub/qos2/test", qos=2, mid=mid, payload="message") +publish_dup_packet = mosq_test.gen_publish("pub/qos2/test", qos=2, mid=mid, payload="message", dup=True) +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + conn.send(pubrec_packet) + + if mosq_test.expect_packet(conn, "pubrel", pubrel_packet): + conn.send(pubcomp_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-qos0-no-payload.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-qos0-no-payload.py new file mode 100755 index 0000000..437ec90 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-qos0-no-payload.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python3 + +# Test whether a client sends a correct PUBLISH to a topic with QoS 0 and no payload. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id publish-qos0-test-np +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK and verifying that rc=0, the client should send a PUBLISH message +# to topic "pub/qos0/no-payload/test" with zero length payload and QoS=0. If +# rc!=0, the client should exit with an error. +# After sending the PUBLISH message, the client should send a DISCONNECT message. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos0-test-np", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("pub/qos0/no-payload/test", qos=0) + +disconnect_packet = mosq_test.gen_disconnect() + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-qos0.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-qos0.py new file mode 100755 index 0000000..9af5b86 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-publish-qos0.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python3 + +# Test whether a client sends a correct PUBLISH to a topic with QoS 0. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id publish-qos0-test +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK and verifying that rc=0, the client should send a PUBLISH message +# to topic "pub/qos0/test" with payload "message" and QoS=0. If rc!=0, the +# client should exit with an error. +# After sending the PUBLISH message, the client should send a DISCONNECT message. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos0-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("pub/qos0/test", qos=0, payload="message") + +disconnect_packet = mosq_test.gen_disconnect() + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + if rc: + (stdo, stde) = client.communicate() + print(stde) + sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-request-response-correlation.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-request-response-correlation.py new file mode 100755 index 0000000..01a297f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-request-response-correlation.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + + +resp_topic = "response/topic" +pub_topic = "request/topic" + +rc = 1 +keepalive = 60 +connect1_packet = mosq_test.gen_connect("request-test", keepalive=keepalive, proto_ver=5) +connect2_packet = mosq_test.gen_connect("response-test", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid = 1 +subscribe1_packet = mosq_test.gen_subscribe(mid, resp_topic, 0, proto_ver=5) +subscribe2_packet = mosq_test.gen_subscribe(mid, pub_topic, 0, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + + +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_RESPONSE_TOPIC, resp_topic) +props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_CORRELATION_DATA, "corridor") +publish1_packet_incoming = mosq_test.gen_publish(pub_topic, qos=0, payload="action", proto_ver=5, properties=props) + +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_RESPONSE_TOPIC, resp_topic) +props += mqtt5_props.gen_string_prop(mqtt5_props.PROP_CORRELATION_DATA, "corridor") +props += mqtt5_props.gen_string_pair_prop(mqtt5_props.PROP_USER_PROPERTY, "user", "data") +publish1_packet_outgoing = mosq_test.gen_publish(pub_topic, qos=0, payload="action", proto_ver=5, properties=props) + +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_CORRELATION_DATA, "corridor") +publish2_packet = mosq_test.gen_publish(resp_topic, qos=0, payload="a response", proto_ver=5, properties=props) + + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client1 = mosq_test.start_client(filename="03-request-response-correlation-1.log", cmd=["c/03-request-response-correlation-1.test"], env=env, port=port) + +try: + (conn1, address) = sock.accept() + conn1.settimeout(10) + + client2 = mosq_test.start_client(filename="03-request-response-2.log", cmd=["c/03-request-response-2.test"], env=env, port=port) + (conn2, address) = sock.accept() + conn2.settimeout(10) + + if mosq_test.expect_packet(conn1, "connect1", connect1_packet): + conn1.send(connack_packet) + + if mosq_test.expect_packet(conn2, "connect2", connect2_packet): + conn2.send(connack_packet) + + if mosq_test.expect_packet(conn1, "subscribe1", subscribe1_packet): + conn1.send(suback_packet) + + if mosq_test.expect_packet(conn2, "subscribe2", subscribe2_packet): + conn2.send(suback_packet) + + if mosq_test.expect_packet(conn1, "publish1", publish1_packet_incoming): + conn2.send(publish1_packet_outgoing) + + if mosq_test.expect_packet(conn2, "publish2", publish2_packet): + rc = 0 + + conn1.close() + conn2.close() +finally: + client1.terminate() + client1.wait() + client2.terminate() + client2.wait() + if rc: + (stdo, stde) = client1.communicate() + print(stde) + (stdo, stde) = client2.communicate() + print(stde) + sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-request-response.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-request-response.py new file mode 100755 index 0000000..00c7d76 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/03-request-response.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + + +resp_topic = "response/topic" +pub_topic = "request/topic" + +rc = 1 +keepalive = 60 +connect1_packet = mosq_test.gen_connect("request-test", keepalive=keepalive, proto_ver=5) +connect2_packet = mosq_test.gen_connect("response-test", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +mid = 1 +subscribe1_packet = mosq_test.gen_subscribe(mid, resp_topic, 0, proto_ver=5) +subscribe2_packet = mosq_test.gen_subscribe(mid, pub_topic, 0, proto_ver=5) +suback_packet = mosq_test.gen_suback(mid, 0, proto_ver=5) + + +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_RESPONSE_TOPIC, resp_topic) +publish1_packet = mosq_test.gen_publish(pub_topic, qos=0, payload="action", proto_ver=5, properties=props) + +publish2_packet = mosq_test.gen_publish(resp_topic, qos=0, payload="a response", proto_ver=5) + + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client1 = mosq_test.start_client(filename="03-request-response-1.log", cmd=["c/03-request-response-1.test"], env=env, port=port) + +try: + (conn1, address) = sock.accept() + conn1.settimeout(10) + + client2 = mosq_test.start_client(filename="03-request-response-2.log", cmd=["c/03-request-response-2.test"], env=env, port=port) + (conn2, address) = sock.accept() + conn2.settimeout(10) + + if mosq_test.expect_packet(conn1, "connect1", connect1_packet): + conn1.send(connack_packet) + + if mosq_test.expect_packet(conn2, "connect2", connect2_packet): + conn2.send(connack_packet) + + if mosq_test.expect_packet(conn1, "subscribe1", subscribe1_packet): + conn1.send(suback_packet) + + if mosq_test.expect_packet(conn2, "subscribe2", subscribe2_packet): + conn2.send(suback_packet) + + if mosq_test.expect_packet(conn1, "publish1", publish1_packet): + conn2.send(publish1_packet) + + if mosq_test.expect_packet(conn2, "publish2", publish2_packet): + rc = 0 + + conn1.close() + conn2.close() +finally: + client1.terminate() + client1.wait() + client2.terminate() + client2.wait() + if rc: + (stdo, stde) = client1.communicate() + print(stde) + (stdo, stde) = client2.communicate() + print(stde) + sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/04-retain-qos0.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/04-retain-qos0.py new file mode 100755 index 0000000..117a2f5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/04-retain-qos0.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 + +# Test whether a client sends a correct retained PUBLISH to a topic with QoS 0. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +mid = 16 +connect_packet = mosq_test.gen_connect("retain-qos0-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("retain/qos0/test", qos=0, payload="retained message", retain=True) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/08-ssl-bad-cacert.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/08-ssl-bad-cacert.py new file mode 100755 index 0000000..e223a5f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/08-ssl-bad-cacert.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +rc = 1 + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp + +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) +client.wait() + +rc = client.returncode + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/08-ssl-connect-cert-auth-enc.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/08-ssl-connect-cert-auth-enc.py new file mode 100755 index 0000000..ef84dea --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/08-ssl-connect-cert-auth-enc.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python3 + +# Test whether a client produces a correct connect and subsequent disconnect when using SSL. +# Client must provide a certificate. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id 08-ssl-connect-crt-auth +# It should use the CA certificate ssl/test-root-ca.crt for verifying the server. +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK and verifying that rc=0, the client should send a DISCONNECT +# message. If rc!=0, the client should exit with an error. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("08-ssl-connect-crt-auth-enc", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) +disconnect_packet = mosq_test.gen_disconnect() + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock = ssl.wrap_socket(sock, ca_certs="../ssl/all-ca.crt", + keyfile="../ssl/server.key", certfile="../ssl/server.crt", + server_side=True, cert_reqs=ssl.CERT_REQUIRED) +ssock.settimeout(10) +ssock.bind(('', port)) +ssock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = ssock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + ssock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/08-ssl-connect-cert-auth.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/08-ssl-connect-cert-auth.py new file mode 100755 index 0000000..4e1dfd6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/08-ssl-connect-cert-auth.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python3 + +# Test whether a client produces a correct connect and subsequent disconnect when using SSL. +# Client must provide a certificate. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id 08-ssl-connect-crt-auth +# It should use the CA certificate ssl/test-root-ca.crt for verifying the server. +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK and verifying that rc=0, the client should send a DISCONNECT +# message. If rc!=0, the client should exit with an error. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("08-ssl-connect-crt-auth", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) +disconnect_packet = mosq_test.gen_disconnect() + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock = ssl.wrap_socket(sock, ca_certs="../ssl/all-ca.crt", + keyfile="../ssl/server.key", certfile="../ssl/server.crt", + server_side=True, cert_reqs=ssl.CERT_REQUIRED) +ssock.settimeout(10) +ssock.bind(('', port)) +ssock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = ssock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + ssock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/08-ssl-connect-no-auth.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/08-ssl-connect-no-auth.py new file mode 100755 index 0000000..dd3215b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/08-ssl-connect-no-auth.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python3 + +# Test whether a client produces a correct connect and subsequent disconnect when using SSL. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id 08-ssl-connect-no-auth +# It should use the CA certificate ssl/test-ca.crt for verifying the server. +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK and verifying that rc=0, the client should send a DISCONNECT +# message. If rc!=0, the client should exit with an error. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("08-ssl-connect-no-auth", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) +disconnect_packet = mosq_test.gen_disconnect() + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock = ssl.wrap_socket(sock, ca_certs="../ssl/all-ca.crt", keyfile="../ssl/server.key", certfile="../ssl/server.crt", server_side=True) +ssock.settimeout(10) +ssock.bind(('', port)) +ssock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = ssock.accept() + conn.settimeout(100) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + ssock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/08-ssl-fake-cacert.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/08-ssl-fake-cacert.py new file mode 100755 index 0000000..cb61b63 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/08-ssl-fake-cacert.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock = ssl.wrap_socket(sock, ca_certs="../ssl/all-ca.crt", + keyfile="../ssl/server.key", certfile="../ssl/server.crt", + server_side=True, cert_reqs=ssl.CERT_REQUIRED) +ssock.settimeout(10) +ssock.bind(('', port)) +ssock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = ssock.accept() + + conn.close() +except ssl.SSLError: + # Expected error due to ca certs not matching. + pass +finally: + time.sleep(1.0) + try: + client.terminate() + except OSError: + pass + client.wait() + ssock.close() + +if client.returncode == 0: + exit(0) +else: + exit(1) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/09-util-topic-tokenise.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/09-util-topic-tokenise.py new file mode 100755 index 0000000..dc9ec36 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/09-util-topic-tokenise.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +rc = 1 + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp + +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) +client.wait() +exit(client.returncode) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/11-prop-oversize-packet.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/11-prop-oversize-packet.py new file mode 100755 index 0000000..8151ff3 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/11-prop-oversize-packet.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python3 + +# Test whether a client publishing an oversize packet correctly. +# The client should try to publish a message that is too big, then the one below which is ok. +# It should also try to subscribe with a too large topic + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos0-test", keepalive=keepalive, proto_ver=5) +props = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_MAXIMUM_PACKET_SIZE, 30) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5, properties=props) + +bad_publish_packet = mosq_test.gen_publish("pub/test", qos=0, payload="0123456789012345678", proto_ver=5) +publish_packet = mosq_test.gen_publish("pub/test", qos=0, payload="012345678901234567", proto_ver=5) + +disconnect_packet = mosq_test.gen_disconnect() + + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + if rc: + (stdo, stde) = client.communicate() + print(stde) + sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/11-prop-send-content-type.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/11-prop-send-content-type.py new file mode 100755 index 0000000..dddbfe3 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/11-prop-send-content-type.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("prop-test", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +props = mqtt5_props.gen_string_prop(mqtt5_props.PROP_CONTENT_TYPE, "application/json") +publish_packet = mosq_test.gen_publish("prop/qos0", qos=0, payload="message", proto_ver=5, properties=props) + +disconnect_packet = mosq_test.gen_disconnect(proto_ver=5) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + if rc: + (stdo, stde) = client.communicate() + print(stde) + sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/11-prop-send-payload-format.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/11-prop-send-payload-format.py new file mode 100755 index 0000000..6a82637 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/11-prop-send-payload-format.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 + +# Test whether a client sends a correct PUBLISH to a topic with QoS 0. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id publish-qos0-test +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK and verifying that rc=0, the client should send a PUBLISH message +# to topic "pub/qos0/test" with payload "message" and QoS=0. If rc!=0, the +# client should exit with an error. +# After sending the PUBLISH message, the client should send a DISCONNECT message. + +from mosq_test_helper import * + +port = mosq_test.get_lib_port() + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("prop-test", keepalive=keepalive, proto_ver=5) +connack_packet = mosq_test.gen_connack(rc=0, proto_ver=5) + +props = mqtt5_props.gen_byte_prop(mqtt5_props.PROP_PAYLOAD_FORMAT_INDICATOR, 0x01) +publish_packet = mosq_test.gen_publish("prop/qos0", qos=0, payload="message", proto_ver=5, properties=props) + +disconnect_packet = mosq_test.gen_disconnect(proto_ver=5) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', port)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env, port=port) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + if rc: + (stdo, stde) = client.communicate() + print(stde) + sock.close() + +exit(rc) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/Makefile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/Makefile new file mode 100644 index 0000000..180e660 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/Makefile @@ -0,0 +1,72 @@ +include ../../config.mk + +.PHONY: all check test test-compile test-compile-c test-compile-cpp c cpp +.NOTPARALLEL: + +LD_LIBRARY_PATH=../../lib + +all : + +check : test + +ptest : test-compile + ./test.py + +test : c cpp + +test-compile : test-compile-c test-compile-cpp + +test-compile-c : + $(MAKE) -C c + +test-compile-cpp : + $(MAKE) -C cpp + +c : test-compile + ./01-con-discon-success.py $@/01-con-discon-success.test + ./01-keepalive-pingreq.py $@/01-keepalive-pingreq.test + ./01-no-clean-session.py $@/01-no-clean-session.test + ./01-server-keepalive-pingreq.py $@/01-server-keepalive-pingreq.test + ./01-unpwd-set.py $@/01-unpwd-set.test + ./01-will-set.py $@/01-will-set.test + ./01-will-unpwd-set.py $@/01-will-unpwd-set.test + ./02-subscribe-qos0.py $@/02-subscribe-qos0.test + ./02-subscribe-qos1.py $@/02-subscribe-qos1.test + ./02-subscribe-qos2.py $@/02-subscribe-qos2.test + ./02-unsubscribe-multiple-v5.py $@/02-unsubscribe-multiple-v5.test + ./02-unsubscribe-v5.py $@/02-unsubscribe-v5.test + ./02-unsubscribe.py $@/02-unsubscribe.test + ./03-publish-b2c-qos1.py $@/03-publish-b2c-qos1.test + ./03-publish-b2c-qos2-len.py $@/03-publish-b2c-qos2-len.test + ./03-publish-b2c-qos2.py $@/03-publish-b2c-qos2.test + ./03-publish-c2b-qos1-disconnect.py $@/03-publish-c2b-qos1-disconnect.test + ./03-publish-c2b-qos1-len.py $@/03-publish-c2b-qos1-len.test + ./03-publish-c2b-qos1-receive-maximum.py $@/03-publish-c2b-qos1-receive-maximum.test + ./03-publish-c2b-qos2-disconnect.py $@/03-publish-c2b-qos2-disconnect.test + ./03-publish-c2b-qos2-len.py $@/03-publish-c2b-qos2-len.test + ./03-publish-c2b-qos2-maximum-qos-0.py $@/03-publish-c2b-qos2-maximum-qos-0.test + ./03-publish-c2b-qos2-maximum-qos-1.py $@/03-publish-c2b-qos2-maximum-qos-1.test + ./03-publish-c2b-qos2-pubrec-error.py $@/03-publish-c2b-qos2-pubrec-error.test + ./03-publish-c2b-qos2-receive-maximum-1.py $@/03-publish-c2b-qos2-receive-maximum-1.test + ./03-publish-c2b-qos2-receive-maximum-2.py $@/03-publish-c2b-qos2-receive-maximum-2.test + ./03-publish-c2b-qos2.py $@/03-publish-c2b-qos2.test + ./03-publish-qos0-no-payload.py $@/03-publish-qos0-no-payload.test + ./03-publish-qos0.py $@/03-publish-qos0.test + ./03-request-response-correlation.py $@/03-request-response-correlation.test + ./03-request-response.py $@/03-request-response.test + ./04-retain-qos0.py $@/04-retain-qos0.test +ifeq ($(WITH_TLS),yes) + #./08-ssl-fake-cacert.py $@/08-ssl-fake-cacert.test + ./08-ssl-bad-cacert.py $@/08-ssl-bad-cacert.test + ./08-ssl-connect-cert-auth-enc.py $@/08-ssl-connect-cert-auth-enc.test + ./08-ssl-connect-cert-auth.py $@/08-ssl-connect-cert-auth.test + ./08-ssl-connect-no-auth.py $@/08-ssl-connect-no-auth.test +endif + ./09-util-topic-tokenise.py $@/09-util-topic-tokenise.test + ./11-prop-oversize-packet.py $@/11-prop-oversize-packet.test + ./11-prop-send-content-type.py $@/11-prop-send-content-type.test + ./11-prop-send-payload-format.py $@/11-prop-send-payload-format.test + +clean : + $(MAKE) -C c clean + $(MAKE) -C cpp clean diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-con-discon-success.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-con-discon-success.c new file mode 100644 index 0000000..5f17e80 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-con-discon-success.c @@ -0,0 +1,45 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_disconnect(mosq); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("01-con-discon-success", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_destroy(mosq); + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-keepalive-pingreq.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-keepalive-pingreq.c new file mode 100644 index 0000000..4db7a70 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-keepalive-pingreq.c @@ -0,0 +1,36 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + } +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("01-keepalive-pingreq", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + + rc = mosquitto_connect(mosq, "localhost", port, 4); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_destroy(mosq); + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-no-clean-session.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-no-clean-session.c new file mode 100644 index 0000000..d2b9a61 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-no-clean-session.c @@ -0,0 +1,27 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("01-no-clean-session", false, NULL); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-server-keepalive-pingreq.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-server-keepalive-pingreq.c new file mode 100644 index 0000000..99da6f6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-server-keepalive-pingreq.c @@ -0,0 +1,37 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + } +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("01-server-keepalive-pingreq", true, NULL); + mosquitto_int_option(mosq, MOSQ_OPT_PROTOCOL_VERSION, MQTT_PROTOCOL_V5); + mosquitto_connect_callback_set(mosq, on_connect); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_destroy(mosq); + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-unpwd-set.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-unpwd-set.c new file mode 100644 index 0000000..4d1c244 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-unpwd-set.c @@ -0,0 +1,28 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("01-unpwd-set", true, NULL); + mosquitto_username_pw_set(mosq, "uname", ";'[08gn=#"); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-will-set.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-will-set.c new file mode 100644 index 0000000..098cce7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-will-set.c @@ -0,0 +1,28 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("01-will-set", true, NULL); + mosquitto_will_set(mosq, "topic/on/unexpected/disconnect", strlen("will message"), "will message", 1, true); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-will-unpwd-set.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-will-unpwd-set.c new file mode 100644 index 0000000..94a6472 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/01-will-unpwd-set.c @@ -0,0 +1,29 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("01-will-unpwd-set", true, NULL); + mosquitto_username_pw_set(mosq, "oibvvwqw", "#'^2hg9a&nm38*us"); + mosquitto_will_set(mosq, "will-topic", strlen("will message"), "will message", 2, false); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-subscribe-qos0.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-subscribe-qos0.c new file mode 100644 index 0000000..cbaea3c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-subscribe-qos0.c @@ -0,0 +1,49 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_subscribe(mosq, NULL, "qos0/test", 0); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +void on_subscribe(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos) +{ + mosquitto_disconnect(mosq); +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("subscribe-qos0-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_subscribe_callback_set(mosq, on_subscribe); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-subscribe-qos1.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-subscribe-qos1.c new file mode 100644 index 0000000..757b105 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-subscribe-qos1.c @@ -0,0 +1,49 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_subscribe(mosq, NULL, "qos1/test", 1); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +void on_subscribe(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos) +{ + mosquitto_disconnect(mosq); +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("subscribe-qos1-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_subscribe_callback_set(mosq, on_subscribe); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-subscribe-qos2.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-subscribe-qos2.c new file mode 100644 index 0000000..6866030 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-subscribe-qos2.c @@ -0,0 +1,49 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_subscribe(mosq, NULL, "qos2/test", 2); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +void on_subscribe(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos) +{ + mosquitto_disconnect(mosq); +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("subscribe-qos2-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_subscribe_callback_set(mosq, on_subscribe); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-unsubscribe-multiple-v5.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-unsubscribe-multiple-v5.c new file mode 100644 index 0000000..7403a63 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-unsubscribe-multiple-v5.c @@ -0,0 +1,59 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_subscribe(mosq, NULL, "unsubscribe/test", 2); + } +} + +void on_subscribe(struct mosquitto *mosq, void *obj, int mid, int sub_count, const int *subs) +{ + char *unsubs[] = {"unsubscribe/test", "no-sub"}; + + mosquitto_unsubscribe_multiple(mosq, NULL, 2, unsubs, NULL); +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +void on_unsubscribe(struct mosquitto *mosq, void *obj, int mid) +{ + mosquitto_disconnect(mosq); +} + + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("unsubscribe-test", true, NULL); + mosquitto_int_option(mosq, MOSQ_OPT_PROTOCOL_VERSION, MQTT_PROTOCOL_V5); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_subscribe_callback_set(mosq, on_subscribe); + mosquitto_unsubscribe_callback_set(mosq, on_unsubscribe); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-unsubscribe-v5.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-unsubscribe-v5.c new file mode 100644 index 0000000..50e7377 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-unsubscribe-v5.c @@ -0,0 +1,50 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_unsubscribe(mosq, NULL, "unsubscribe/test"); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +void on_unsubscribe(struct mosquitto *mosq, void *obj, int mid) +{ + mosquitto_disconnect(mosq); +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("unsubscribe-test", true, NULL); + mosquitto_int_option(mosq, MOSQ_OPT_PROTOCOL_VERSION, MQTT_PROTOCOL_V5); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_unsubscribe_callback_set(mosq, on_unsubscribe); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-unsubscribe.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-unsubscribe.c new file mode 100644 index 0000000..c757f51 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/02-unsubscribe.c @@ -0,0 +1,49 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_unsubscribe(mosq, NULL, "unsubscribe/test"); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +void on_unsubscribe(struct mosquitto *mosq, void *obj, int mid) +{ + mosquitto_disconnect(mosq); +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("unsubscribe-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_unsubscribe_callback_set(mosq, on_unsubscribe); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-b2c-qos1.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-b2c-qos1.c new file mode 100644 index 0000000..f68ce55 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-b2c-qos1.c @@ -0,0 +1,66 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + } +} + +void on_message(struct mosquitto *mosq, void *obj, const struct mosquitto_message *msg) +{ + if(msg->mid != 123){ + printf("Invalid mid (%d)\n", msg->mid); + exit(1); + } + if(msg->qos != 1){ + printf("Invalid qos (%d)\n", msg->qos); + exit(1); + } + if(strcmp(msg->topic, "pub/qos1/receive")){ + printf("Invalid topic (%s)\n", msg->topic); + exit(1); + } + if(strcmp(msg->payload, "message")){ + printf("Invalid payload (%s)\n", (char *)msg->payload); + exit(1); + } + if(msg->payloadlen != 7){ + printf("Invalid payloadlen (%d)\n", msg->payloadlen); + exit(1); + } + if(msg->retain != false){ + printf("Invalid retain (%d)\n", msg->retain); + exit(1); + } + + exit(0); +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos1-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_message_callback_set(mosq, on_message); + mosquitto_message_retry_set(mosq, 3); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(1){ + mosquitto_loop(mosq, 300, 1); + } + + mosquitto_lib_cleanup(); + return 1; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-b2c-qos2-len.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-b2c-qos2-len.c new file mode 100644 index 0000000..3975d91 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-b2c-qos2-len.c @@ -0,0 +1,74 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + } +} + +void on_message(struct mosquitto *mosq, void *obj, const struct mosquitto_message *msg) +{ + if(msg->mid != 56){ + printf("Invalid mid (%d)\n", msg->mid); + exit(1); + } + if(msg->qos != 2){ + printf("Invalid qos (%d)\n", msg->qos); + exit(1); + } + if(strcmp(msg->topic, "len/qos2/test")){ + printf("Invalid topic (%s)\n", msg->topic); + exit(1); + } + if(strcmp(msg->payload, "message")){ + printf("Invalid payload (%s)\n", (char *)msg->payload); + exit(1); + } + if(msg->payloadlen != 7){ + printf("Invalid payloadlen (%d)\n", msg->payloadlen); + exit(1); + } + if(msg->retain != false){ + printf("Invalid retain (%d)\n", msg->retain); + exit(1); + } + + mosquitto_disconnect(mosq); +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = 0; +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos2-test", true, &run); + mosquitto_int_option(mosq, MOSQ_OPT_PROTOCOL_VERSION, MQTT_PROTOCOL_V5); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_message_callback_set(mosq, on_message); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, 100, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-b2c-qos2.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-b2c-qos2.c new file mode 100644 index 0000000..3c2f340 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-b2c-qos2.c @@ -0,0 +1,68 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + } +} + +void on_message(struct mosquitto *mosq, void *obj, const struct mosquitto_message *msg) +{ + if(msg->mid != 13423){ + printf("Invalid mid (%d)\n", msg->mid); + exit(1); + } + if(msg->qos != 2){ + printf("Invalid qos (%d)\n", msg->qos); + exit(1); + } + if(strcmp(msg->topic, "pub/qos2/receive")){ + printf("Invalid topic (%s)\n", msg->topic); + exit(1); + } + if(strcmp(msg->payload, "message")){ + printf("Invalid payload (%s)\n", (char *)msg->payload); + exit(1); + } + if(msg->payloadlen != 7){ + printf("Invalid payloadlen (%d)\n", msg->payloadlen); + exit(1); + } + if(msg->retain != false){ + printf("Invalid retain (%d)\n", msg->retain); + exit(1); + } + + run = 0; +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos2-test", true, &run); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_message_callback_set(mosq, on_message); + mosquitto_message_retry_set(mosq, 5); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, 300, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos1-disconnect.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos1-disconnect.c new file mode 100644 index 0000000..53238fb --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos1-disconnect.c @@ -0,0 +1,59 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; +static int first_connection = 1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + if(first_connection == 1){ + mosquitto_publish(mosq, NULL, "pub/qos1/test", strlen("message"), "message", 1, false); + first_connection = 0; + } + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + mosquitto_disconnect(mosq); +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + mosquitto_reconnect(mosq); + }else{ + run = 0; + } +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos1-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_publish_callback_set(mosq, on_publish); + mosquitto_message_retry_set(mosq, 3); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, 300, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos1-len.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos1-len.c new file mode 100644 index 0000000..66fe76e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos1-len.c @@ -0,0 +1,52 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_publish(mosq, NULL, "pub/qos1/test", strlen("message"), "message", 1, false); + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + mosquitto_disconnect(mosq); +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = 0; +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos1-test", true, NULL); + mosquitto_int_option(mosq, MOSQ_OPT_PROTOCOL_VERSION, MQTT_PROTOCOL_V5); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_publish_callback_set(mosq, on_publish); + mosquitto_message_retry_set(mosq, 3); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, 300, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos1-receive-maximum.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos1-receive-maximum.c new file mode 100644 index 0000000..5ef072a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos1-receive-maximum.c @@ -0,0 +1,54 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc, int flags, const mosquitto_property *properties) +{ + int i; + + if(rc){ + exit(1); + } + + for(i=0; i<6; i++){ + mosquitto_publish_v5(mosq, NULL, "topic", 5, "12345", 1, false, NULL); + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid, int reason_code, const mosquitto_property *properties) +{ + if(mid == 6){ + mosquitto_disconnect(mosq); + run = 0; + } +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + mosquitto_property *props = NULL; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos1-test", true, &run); + mosquitto_int_option(mosq, MOSQ_OPT_PROTOCOL_VERSION, MQTT_PROTOCOL_V5); + + mosquitto_connect_v5_callback_set(mosq, on_connect); + mosquitto_publish_v5_callback_set(mosq, on_publish); + + rc = mosquitto_connect_bind_v5(mosq, "localhost", port, 60, NULL, NULL); + + while(run == -1){ + mosquitto_loop(mosq, 300, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-disconnect.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-disconnect.c new file mode 100644 index 0000000..8de4f82 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-disconnect.c @@ -0,0 +1,59 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; +static int first_connection = 1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + if(first_connection == 1){ + mosquitto_publish(mosq, NULL, "pub/qos2/test", strlen("message"), "message", 2, false); + first_connection = 0; + } + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + mosquitto_disconnect(mosq); +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + mosquitto_reconnect(mosq); + }else{ + run = 0; + } +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos2-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_publish_callback_set(mosq, on_publish); + mosquitto_message_retry_set(mosq, 3); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, 300, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-len.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-len.c new file mode 100644 index 0000000..ab59adb --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-len.c @@ -0,0 +1,52 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_publish(mosq, NULL, "pub/qos2/test", strlen("message"), "message", 2, false); + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid, int reason_code, const mosquitto_property *properties) +{ + mosquitto_disconnect(mosq); +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = 0; +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos2-test", true, NULL); + mosquitto_int_option(mosq, MOSQ_OPT_PROTOCOL_VERSION, MQTT_PROTOCOL_V5); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_publish_v5_callback_set(mosq, on_publish); + mosquitto_message_retry_set(mosq, 3); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, 300, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-maximum-qos-0.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-maximum-qos-0.c new file mode 100644 index 0000000..cfe7ab1 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-maximum-qos-0.c @@ -0,0 +1,58 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + rc = mosquitto_publish(mosq, NULL, "maximum/qos/qos2", strlen("message"), "message", 2, false); + if(rc != MOSQ_ERR_QOS_NOT_SUPPORTED) run = 1; + rc = mosquitto_publish(mosq, NULL, "maximum/qos/qos1", strlen("message"), "message", 1, false); + if(rc != MOSQ_ERR_QOS_NOT_SUPPORTED) run = 1; + rc = mosquitto_publish(mosq, NULL, "maximum/qos/qos0", strlen("message"), "message", 0, false); + if(rc != MOSQ_ERR_SUCCESS) run = 1; + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + if(mid == 1){ + mosquitto_disconnect(mosq); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = 0; +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos2-test", true, NULL); + mosquitto_int_option(mosq, MOSQ_OPT_PROTOCOL_VERSION, MQTT_PROTOCOL_V5); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_publish_callback_set(mosq, on_publish); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, 50, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-maximum-qos-1.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-maximum-qos-1.c new file mode 100644 index 0000000..b4c0981 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-maximum-qos-1.c @@ -0,0 +1,59 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + rc = mosquitto_publish(mosq, NULL, "maximum/qos/qos2", strlen("message"), "message", 2, false); + if(rc != MOSQ_ERR_QOS_NOT_SUPPORTED) run = 1; + rc = mosquitto_publish(mosq, NULL, "maximum/qos/qos1", strlen("message"), "message", 1, false); + if(rc != MOSQ_ERR_SUCCESS) run = 1; + rc = mosquitto_publish(mosq, NULL, "maximum/qos/qos0", strlen("message"), "message", 0, false); + if(rc != MOSQ_ERR_SUCCESS) run = 1; + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + if(mid == 2){ + mosquitto_disconnect(mosq); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = 0; +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos2-test", true, NULL); + mosquitto_int_option(mosq, MOSQ_OPT_PROTOCOL_VERSION, MQTT_PROTOCOL_V5); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_publish_callback_set(mosq, on_publish); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, 50, 1); + } + mosquitto_loop(mosq, 50, 1); + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-pubrec-error.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-pubrec-error.c new file mode 100644 index 0000000..f7a64b1 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-pubrec-error.c @@ -0,0 +1,49 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc, int flags, const mosquitto_property *properties) +{ + if(rc){ + exit(1); + } + mosquitto_publish_v5(mosq, NULL, "topic", strlen("rejected"), "rejected", 2, false, NULL); + mosquitto_publish_v5(mosq, NULL, "topic", strlen("accepted"), "accepted", 2, false, NULL); +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid, int reason_code, const mosquitto_property *properties) +{ + if(mid == 2){ + run = 0; + } +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + mosquitto_property *props = NULL; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos2-test", true, &run); + mosquitto_int_option(mosq, MOSQ_OPT_PROTOCOL_VERSION, MQTT_PROTOCOL_V5); + + mosquitto_connect_v5_callback_set(mosq, on_connect); + mosquitto_publish_v5_callback_set(mosq, on_publish); + + rc = mosquitto_connect_bind_v5(mosq, "localhost", port, 60, NULL, NULL); + + while(run == -1){ + mosquitto_loop(mosq, 100, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-receive-maximum-1.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-receive-maximum-1.c new file mode 100644 index 0000000..ab50798 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-receive-maximum-1.c @@ -0,0 +1,54 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc, int flags, const mosquitto_property *properties) +{ + int i; + + if(rc){ + exit(1); + } + + for(i=0; i<5; i++){ + mosquitto_publish_v5(mosq, NULL, "topic", 5, "12345", 2, false, NULL); + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid, int reason_code, const mosquitto_property *properties) +{ + if(mid == 5){ + mosquitto_disconnect(mosq); + run = 0; + } +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + mosquitto_property *props = NULL; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos2-test", true, &run); + mosquitto_int_option(mosq, MOSQ_OPT_PROTOCOL_VERSION, MQTT_PROTOCOL_V5); + + mosquitto_connect_v5_callback_set(mosq, on_connect); + mosquitto_publish_v5_callback_set(mosq, on_publish); + + rc = mosquitto_connect_bind_v5(mosq, "localhost", port, 60, NULL, NULL); + + while(run == -1){ + mosquitto_loop(mosq, 300, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-receive-maximum-2.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-receive-maximum-2.c new file mode 100644 index 0000000..ab50798 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2-receive-maximum-2.c @@ -0,0 +1,54 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc, int flags, const mosquitto_property *properties) +{ + int i; + + if(rc){ + exit(1); + } + + for(i=0; i<5; i++){ + mosquitto_publish_v5(mosq, NULL, "topic", 5, "12345", 2, false, NULL); + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid, int reason_code, const mosquitto_property *properties) +{ + if(mid == 5){ + mosquitto_disconnect(mosq); + run = 0; + } +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + mosquitto_property *props = NULL; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos2-test", true, &run); + mosquitto_int_option(mosq, MOSQ_OPT_PROTOCOL_VERSION, MQTT_PROTOCOL_V5); + + mosquitto_connect_v5_callback_set(mosq, on_connect); + mosquitto_publish_v5_callback_set(mosq, on_publish); + + rc = mosquitto_connect_bind_v5(mosq, "localhost", port, 60, NULL, NULL); + + while(run == -1){ + mosquitto_loop(mosq, 300, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2.c new file mode 100644 index 0000000..ec58ba7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-c2b-qos2.c @@ -0,0 +1,50 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_publish(mosq, NULL, "pub/qos2/test", strlen("message"), "message", 2, false); + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + mosquitto_disconnect(mosq); +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = 0; +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos2-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_publish_callback_set(mosq, on_publish); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, 300, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-qos0-no-payload.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-qos0-no-payload.c new file mode 100644 index 0000000..b63130f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-qos0-no-payload.c @@ -0,0 +1,50 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; +static int sent_mid = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_publish(mosq, &sent_mid, "pub/qos0/no-payload/test", 0, NULL, 0, false); + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + if(mid == sent_mid){ + mosquitto_disconnect(mosq); + run = 0; + }else{ + exit(1); + } +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos0-test-np", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_publish_callback_set(mosq, on_publish); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-qos0.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-qos0.c new file mode 100644 index 0000000..5d4a246 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-publish-qos0.c @@ -0,0 +1,50 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; +static int sent_mid = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_publish(mosq, &sent_mid, "pub/qos0/test", strlen("message"), "message", 0, false); + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + if(mid == sent_mid){ + mosquitto_disconnect(mosq); + run = 0; + }else{ + exit(1); + } +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos0-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_publish_callback_set(mosq, on_publish); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + rc = mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-request-response-1.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-request-response-1.c new file mode 100644 index 0000000..1cdd407 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-request-response-1.c @@ -0,0 +1,61 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> +#include <mqtt_protocol.h> + +static int run = -1; +static int sent_mid = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_subscribe(mosq, NULL, "response/topic", 0); + } +} + +void on_subscribe(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos) +{ + mosquitto_property *props = NULL; + mosquitto_property_add_string(&props, MQTT_PROP_RESPONSE_TOPIC, "response/topic"); + mosquitto_publish_v5(mosq, NULL, "request/topic", 6, "action", 0, 0, props); + mosquitto_property_free_all(&props); +} + +void on_message(struct mosquitto *mosq, void *obj, const struct mosquitto_message *msg) +{ + if(!strcmp(msg->payload, "a response")){ + run = 0; + }else{ + run = 1; + } +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + int ver = PROTOCOL_VERSION_v5; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("request-test", true, NULL); + mosquitto_opts_set(mosq, MOSQ_OPT_PROTOCOL_VERSION, &ver); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_subscribe_callback_set(mosq, on_subscribe); + mosquitto_message_callback_set(mosq, on_message); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + rc = mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-request-response-2.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-request-response-2.c new file mode 100644 index 0000000..3419f39 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-request-response-2.c @@ -0,0 +1,66 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> +#include <mqtt_protocol.h> + +static int run = -1; +static int sent_mid = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_subscribe(mosq, NULL, "request/topic", 0); + } +} + +void on_message_v5(struct mosquitto *mosq, void *obj, const struct mosquitto_message *msg, const mosquitto_property *props) +{ + const mosquitto_property *p_resp, *p_corr = NULL; + char *resp_topic = NULL; + int rc; + + if(!strcmp(msg->topic, "request/topic")){ + p_resp = mosquitto_property_read_string(props, MQTT_PROP_RESPONSE_TOPIC, &resp_topic, false); + if(p_resp){ + p_corr = mosquitto_property_read_binary(props, MQTT_PROP_CORRELATION_DATA, NULL, NULL, false); + rc = mosquitto_publish_v5(mosq, NULL, resp_topic, strlen("a response"), "a response", 0, false, p_corr); + free(resp_topic); + } + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + run = 0; +} + + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + int ver = PROTOCOL_VERSION_v5; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("response-test", true, NULL); + mosquitto_opts_set(mosq, MOSQ_OPT_PROTOCOL_VERSION, &ver); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_publish_callback_set(mosq, on_publish); + mosquitto_message_v5_callback_set(mosq, on_message_v5); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + rc = mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-request-response-correlation-1.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-request-response-correlation-1.c new file mode 100644 index 0000000..35190af --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/03-request-response-correlation-1.c @@ -0,0 +1,62 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> +#include <mqtt_protocol.h> + +static int run = -1; +static int sent_mid = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_subscribe(mosq, NULL, "response/topic", 0); + } +} + +void on_subscribe(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos) +{ + mosquitto_property *props = NULL; + mosquitto_property_add_string(&props, MQTT_PROP_RESPONSE_TOPIC, "response/topic"); + mosquitto_property_add_binary(&props, MQTT_PROP_CORRELATION_DATA, "corridor", 8); + mosquitto_publish_v5(mosq, NULL, "request/topic", 6, "action", 0, 0, props); + mosquitto_property_free_all(&props); +} + +void on_message(struct mosquitto *mosq, void *obj, const struct mosquitto_message *msg) +{ + if(!strcmp(msg->payload, "a response")){ + run = 0; + }else{ + run = 1; + } +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + int ver = PROTOCOL_VERSION_v5; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("request-test", true, NULL); + mosquitto_opts_set(mosq, MOSQ_OPT_PROTOCOL_VERSION, &ver); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_subscribe_callback_set(mosq, on_subscribe); + mosquitto_message_callback_set(mosq, on_message); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + rc = mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/04-retain-qos0.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/04-retain-qos0.c new file mode 100644 index 0000000..aa1b54f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/04-retain-qos0.c @@ -0,0 +1,38 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_publish(mosq, NULL, "retain/qos0/test", strlen("retained message"), "retained message", 0, true); + } +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("retain-qos0-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/08-ssl-bad-cacert.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/08-ssl-bad-cacert.c new file mode 100644 index 0000000..d32a8dd --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/08-ssl-bad-cacert.c @@ -0,0 +1,20 @@ +#include <errno.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <mosquitto.h> + +int main(int argc, char *argv[]) +{ + int rc = 1; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("08-ssl-bad-cacert", true, NULL); + if(mosquitto_tls_set(mosq, "this/file/doesnt/exist", NULL, NULL, NULL, NULL) == MOSQ_ERR_INVAL){ + rc = 0; + } + mosquitto_lib_cleanup(); + return rc; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/08-ssl-connect-cert-auth-enc.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/08-ssl-connect-cert-auth-enc.c new file mode 100644 index 0000000..e75f2f3 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/08-ssl-connect-cert-auth-enc.c @@ -0,0 +1,54 @@ +#include <errno.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_disconnect(mosq); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +static int password_callback(char* buf, int size, int rwflag, void* userdata) +{ + strncpy(buf, "password", size); + buf[size-1] = '\0'; + + return strlen(buf); +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("08-ssl-connect-crt-auth-enc", true, NULL); + mosquitto_tls_set(mosq, "../ssl/test-root-ca.crt", "../ssl/certs", "../ssl/client-encrypted.crt", "../ssl/client-encrypted.key", password_callback); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/08-ssl-connect-cert-auth.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/08-ssl-connect-cert-auth.c new file mode 100644 index 0000000..58f7da0 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/08-ssl-connect-cert-auth.c @@ -0,0 +1,45 @@ +#include <errno.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_disconnect(mosq); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("08-ssl-connect-crt-auth", true, NULL); + mosquitto_tls_set(mosq, "../ssl/test-root-ca.crt", "../ssl/certs", "../ssl/client.crt", "../ssl/client.key", NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/08-ssl-connect-no-auth.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/08-ssl-connect-no-auth.c new file mode 100644 index 0000000..677cea4 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/08-ssl-connect-no-auth.c @@ -0,0 +1,45 @@ +#include <errno.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_disconnect(mosq); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("08-ssl-connect-no-auth", true, NULL); + mosquitto_tls_set(mosq, "../ssl/all-ca.crt", NULL, NULL, NULL, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/08-ssl-fake-cacert.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/08-ssl-fake-cacert.c new file mode 100644 index 0000000..b866d5d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/08-ssl-fake-cacert.c @@ -0,0 +1,36 @@ +#include <errno.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <mosquitto.h> + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + exit(1); +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("08-ssl-connect-crt-auth", true, NULL); + mosquitto_tls_set(mosq, "../ssl/test-fake-root-ca.crt", NULL, "../ssl/client.crt", "../ssl/client.key", NULL); + mosquitto_connect_callback_set(mosq, on_connect); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + rc = mosquitto_loop_forever(mosq, -1, 1); + if(rc == MOSQ_ERR_ERRNO && errno == EPROTO){ + return 0; + }else{ + return 1; + } +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/09-util-topic-tokenise.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/09-util-topic-tokenise.c new file mode 100644 index 0000000..24baf07 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/09-util-topic-tokenise.c @@ -0,0 +1,130 @@ +#include <stdio.h> +#include <string.h> +#include <mosquitto.h> + +void print_error(const char *topic, char **topics, int topic_count) +{ + int i; + printf("TOPIC: %s\n", topic); + printf("TOKENS: "); + for(i=0; i<topic_count; i++){ + printf("%s", topics[i]); + if(i+1<topic_count){ + printf("/"); + } + } + printf("\n"); +} + +int main(int argc, char *argv[]) +{ + char **topics; + int topic_count; + bool match; + + if(mosquitto_sub_topic_tokenise("topic", &topics, &topic_count)){ + printf("Out of memory.\n"); + return 1; + } + if(topic_count != 1 || strcmp(topics[0], "topic")){ + print_error("topic", topics, topic_count); + return 1; + } + + if(mosquitto_sub_topic_tokenise("a/deep/topic/hierarchy", &topics, &topic_count)){ + printf("Out of memory.\n"); + return 1; + } + if(topic_count != 4 + || strcmp(topics[0], "a") + || strcmp(topics[1], "deep") + || strcmp(topics[2], "topic") + || strcmp(topics[3], "hierarchy")){ + print_error("a/deep/topic/hierarchy", topics, topic_count); + return 1; + } + + if(mosquitto_sub_topic_tokenise("/a/deep/topic/hierarchy", &topics, &topic_count)){ + printf("Out of memory.\n"); + return 1; + } + if(topic_count != 5 + || topics[0] + || strcmp(topics[1], "a") + || strcmp(topics[2], "deep") + || strcmp(topics[3], "topic") + || strcmp(topics[4], "hierarchy")){ + print_error("/a/deep/topic/hierarchy", topics, topic_count); + return 1; + } + + if(mosquitto_sub_topic_tokenise("a/b/c", &topics, &topic_count)){ + printf("Out of memory.\n"); + return 1; + } + if(topic_count != 3 + || strcmp(topics[0], "a") + || strcmp(topics[1], "b") + || strcmp(topics[2], "c")){ + print_error("a/b/c", topics, topic_count); + return 1; + } + + if(mosquitto_sub_topic_tokenise("/a/b/c", &topics, &topic_count)){ + printf("Out of memory.\n"); + return 1; + } + if(topic_count != 4 + || topics[0] + || strcmp(topics[1], "a") + || strcmp(topics[2], "b") + || strcmp(topics[3], "c")){ + print_error("/a/b/c", topics, topic_count); + return 1; + } + + if(mosquitto_sub_topic_tokenise("a///hierarchy", &topics, &topic_count)){ + printf("Out of memory.\n"); + return 1; + } + if(topic_count != 4 + || strcmp(topics[0], "a") + || topics[1] + || topics[2] + || strcmp(topics[3], "hierarchy")){ + print_error("a///hierarchy", topics, topic_count); + return 1; + } + + if(mosquitto_sub_topic_tokenise("/a///hierarchy", &topics, &topic_count)){ + printf("Out of memory.\n"); + return 1; + } + if(topic_count != 5 + || topics[0] + || strcmp(topics[1], "a") + || topics[2] + || topics[3] + || strcmp(topics[4], "hierarchy")){ + print_error("/a///hierarchy", topics, topic_count); + return 1; + } + + if(mosquitto_sub_topic_tokenise("/a///hierarchy/", &topics, &topic_count)){ + printf("Out of memory.\n"); + return 1; + } + if(topic_count != 6 + || topics[0] + || strcmp(topics[1], "a") + || topics[2] + || topics[3] + || strcmp(topics[4], "hierarchy") + || topics[3]){ + print_error("/a///hierarchy/", topics, topic_count); + return 1; + } + + return 0; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/11-prop-oversize-packet.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/11-prop-oversize-packet.c new file mode 100644 index 0000000..c96526f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/11-prop-oversize-packet.c @@ -0,0 +1,72 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> + +static int run = -1; +static int sent_mid = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + rc = mosquitto_subscribe(mosq, NULL, "0123456789012345678901234567890", 0); + if(rc != MOSQ_ERR_OVERSIZE_PACKET){ + printf("Fail on subscribe\n"); + exit(1); + } + + rc = mosquitto_unsubscribe(mosq, NULL, "0123456789012345678901234567890"); + if(rc != MOSQ_ERR_OVERSIZE_PACKET){ + printf("Fail on unsubscribe\n"); + exit(1); + } + + rc = mosquitto_publish(mosq, &sent_mid, "pub/test", strlen("0123456789012345678"), "0123456789012345678", 0, false); + if(rc != MOSQ_ERR_OVERSIZE_PACKET){ + printf("Fail on publish 1\n"); + exit(1); + } + rc = mosquitto_publish(mosq, &sent_mid, "pub/test", strlen("012345678901234567"), "012345678901234567", 0, false); + if(rc != MOSQ_ERR_SUCCESS){ + printf("Fail on publish 2\n"); + exit(1); + } + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + if(mid == sent_mid){ + mosquitto_disconnect(mosq); + run = 0; + }else{ + exit(1); + } +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos0-test", true, NULL); + mosquitto_int_option(mosq, MOSQ_OPT_PROTOCOL_VERSION, MQTT_PROTOCOL_V5); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_publish_callback_set(mosq, on_publish); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + rc = mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/11-prop-send-content-type.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/11-prop-send-content-type.c new file mode 100644 index 0000000..d60c8b5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/11-prop-send-content-type.c @@ -0,0 +1,58 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> +#include <mqtt_protocol.h> + +static int run = -1; +static int sent_mid = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + int rc2; + mosquitto_property *proplist = NULL; + + if(rc){ + exit(1); + }else{ + rc2 = mosquitto_property_add_string(&proplist, MQTT_PROP_CONTENT_TYPE, "application/json"); + mosquitto_publish_v5(mosq, &sent_mid, "prop/qos0", strlen("message"), "message", 0, false, proplist); + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + if(mid == sent_mid){ + mosquitto_disconnect(mosq); + run = 0; + }else{ + exit(1); + } +} + +int main(int argc, char *argv[]) +{ + int rc; + int tmp; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("prop-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_publish_callback_set(mosq, on_publish); + tmp = MQTT_PROTOCOL_V5; + mosquitto_opts_set(mosq, MOSQ_OPT_PROTOCOL_VERSION, &tmp); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + rc = mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/11-prop-send-payload-format.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/11-prop-send-payload-format.c new file mode 100644 index 0000000..516d86d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/11-prop-send-payload-format.c @@ -0,0 +1,58 @@ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <mosquitto.h> +#include <mqtt_protocol.h> + +static int run = -1; +static int sent_mid = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + int rc2; + mosquitto_property *proplist = NULL; + + if(rc){ + exit(1); + }else{ + rc2 = mosquitto_property_add_byte(&proplist, MQTT_PROP_PAYLOAD_FORMAT_INDICATOR, 1); + mosquitto_publish_v5(mosq, &sent_mid, "prop/qos0", strlen("message"), "message", 0, false, proplist); + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + if(mid == sent_mid){ + mosquitto_disconnect(mosq); + run = 0; + }else{ + exit(1); + } +} + +int main(int argc, char *argv[]) +{ + int rc; + int tmp; + struct mosquitto *mosq; + + int port = atoi(argv[1]); + + mosquitto_lib_init(); + + mosq = mosquitto_new("prop-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_publish_callback_set(mosq, on_publish); + tmp = MQTT_PROTOCOL_V5; + mosquitto_opts_set(mosq, MOSQ_OPT_PROTOCOL_VERSION, &tmp); + + rc = mosquitto_connect(mosq, "localhost", port, 60); + + while(run == -1){ + rc = mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/Makefile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/Makefile new file mode 100644 index 0000000..4eed7da --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/c/Makefile @@ -0,0 +1,61 @@ +.PHONY: all clean reallyclean + +CFLAGS=-I../../../lib -Werror +LIBS=../../../lib/libmosquitto.so.1 + +SRC = \ + 01-con-discon-success.c \ + 01-will-set.c \ + 01-unpwd-set.c \ + 01-will-unpwd-set.c \ + 01-no-clean-session.c \ + 01-keepalive-pingreq.c \ + 01-server-keepalive-pingreq.c \ + 02-subscribe-qos0.c \ + 02-subscribe-qos1.c \ + 02-subscribe-qos2.c \ + 02-unsubscribe.c \ + 02-unsubscribe-v5.c \ + 02-unsubscribe-multiple-v5.c \ + 03-publish-qos0.c \ + 03-publish-qos0-no-payload.c \ + 03-publish-c2b-qos1-disconnect.c \ + 03-publish-c2b-qos1-len.c \ + 03-publish-c2b-qos2.c \ + 03-publish-c2b-qos2-disconnect.c \ + 03-publish-c2b-qos2-len.c \ + 03-publish-b2c-qos2-len.c \ + 03-publish-c2b-qos1-receive-maximum.c \ + 03-publish-c2b-qos2-receive-maximum-1.c \ + 03-publish-c2b-qos2-receive-maximum-2.c \ + 03-publish-c2b-qos2-pubrec-error.c \ + 03-publish-c2b-qos2-maximum-qos-0.c \ + 03-publish-c2b-qos2-maximum-qos-1.c \ + 03-publish-b2c-qos1.c \ + 03-publish-b2c-qos2.c \ + 03-request-response-1.c \ + 03-request-response-2.c \ + 03-request-response-correlation-1.c \ + 04-retain-qos0.c \ + 08-ssl-connect-no-auth.c \ + 08-ssl-connect-cert-auth.c \ + 08-ssl-connect-cert-auth-enc.c \ + 08-ssl-bad-cacert.c \ + 08-ssl-fake-cacert.c \ + 09-util-topic-tokenise.c \ + 11-prop-oversize-packet.c \ + 11-prop-send-payload-format.c \ + 11-prop-send-content-type.c + +TESTS = ${SRC:.c=.test} + +all : ${TESTS} + +${TESTS} : %.test: %.c + $(CC) $< -o $@ $(CFLAGS) $(LIBS) + +reallyclean : clean + -rm -f *.orig + +clean : + rm -f *.test diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-con-discon-success.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-con-discon-success.cpp new file mode 100644 index 0000000..82cc8b4 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-con-discon-success.cpp @@ -0,0 +1,55 @@ +//#include <stdbool.h> +//#include <cstdio> +//#include <stdlib.h> +#include <mosquittopp.h> + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + disconnect(); + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + run = rc; +} + + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("01-con-discon-success"); + + mosq->connect("localhost", port, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-keepalive-pingreq.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-keepalive-pingreq.cpp new file mode 100644 index 0000000..bf3c81b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-keepalive-pingreq.cpp @@ -0,0 +1,43 @@ +#include <mosquittopp.h> + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + } +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("01-keepalive-pingreq"); + + mosq->connect("localhost", port, 4); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-no-clean-session.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-no-clean-session.cpp new file mode 100644 index 0000000..0a6f498 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-no-clean-session.cpp @@ -0,0 +1,35 @@ +#include <cstring> +#include <mosquittopp.h> + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id, bool clean_session); +}; + +mosquittopp_test::mosquittopp_test(const char *id, bool clean_session) : mosqpp::mosquittopp(id, clean_session) +{ +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("01-no-clean-session", false); + + mosq->connect("localhost", port, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-unpwd-set.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-unpwd-set.cpp new file mode 100644 index 0000000..24e53f4 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-unpwd-set.cpp @@ -0,0 +1,36 @@ +#include <cstring> +#include <mosquittopp.h> + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("01-unpwd-set"); + mosq->username_pw_set("uname", ";'[08gn=#"); + + mosq->connect("localhost", port, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-will-set.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-will-set.cpp new file mode 100644 index 0000000..1b9f713 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-will-set.cpp @@ -0,0 +1,39 @@ +//#include <stdbool.h> +//#include <cstdio> +//#include <stdlib.h> +#include <cstring> +#include <mosquittopp.h> + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("01-will-set"); + mosq->will_set("topic/on/unexpected/disconnect", strlen("will message"), "will message", 1, true); + + mosq->connect("localhost", port, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-will-unpwd-set.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-will-unpwd-set.cpp new file mode 100644 index 0000000..f3ee1fe --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/01-will-unpwd-set.cpp @@ -0,0 +1,37 @@ +#include <cstring> +#include <mosquittopp.h> + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("01-will-unpwd-set"); + mosq->username_pw_set("oibvvwqw", "#'^2hg9a&nm38*us"); + mosq->will_set("will-topic", strlen("will message"), "will message", 2, false); + + mosq->connect("localhost", port, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/02-subscribe-qos0.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/02-subscribe-qos0.cpp new file mode 100644 index 0000000..5a1582b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/02-subscribe-qos0.cpp @@ -0,0 +1,57 @@ +#include <mosquittopp.h> + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); + void on_subscribe(int mid, int qos_count, const int *granted_qos); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + subscribe(NULL, "qos0/test", 0); + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + run = rc; +} + +void mosquittopp_test::on_subscribe(int mid, int qos_count, const int *granted_qos) +{ + disconnect(); +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("subscribe-qos0-test"); + + mosq->connect("localhost", port, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/02-subscribe-qos1.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/02-subscribe-qos1.cpp new file mode 100644 index 0000000..3b53bf2 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/02-subscribe-qos1.cpp @@ -0,0 +1,58 @@ +#include <mosquittopp.h> + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); + void on_subscribe(int mid, int qos_count, const int *granted_qos); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + subscribe(NULL, "qos1/test", 1); + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + run = rc; +} + +void mosquittopp_test::on_subscribe(int mid, int qos_count, const int *granted_qos) +{ + disconnect(); +} + + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("subscribe-qos1-test"); + + mosq->connect("localhost", port, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/02-subscribe-qos2.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/02-subscribe-qos2.cpp new file mode 100644 index 0000000..3b2d111 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/02-subscribe-qos2.cpp @@ -0,0 +1,58 @@ +#include <mosquittopp.h> + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); + void on_subscribe(int mid, int qos_count, const int *granted_qos); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + subscribe(NULL, "qos2/test", 2); + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + run = rc; +} + +void mosquittopp_test::on_subscribe(int mid, int qos_count, const int *granted_qos) +{ + disconnect(); +} + + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("subscribe-qos2-test"); + + mosq->connect("localhost", port, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/02-unsubscribe.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/02-unsubscribe.cpp new file mode 100644 index 0000000..80df934 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/02-unsubscribe.cpp @@ -0,0 +1,57 @@ +#include <mosquittopp.h> + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); + void on_unsubscribe(int mid); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + unsubscribe(NULL, "unsubscribe/test"); + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + run = rc; +} + +void mosquittopp_test::on_unsubscribe(int mid) +{ + disconnect(); +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("unsubscribe-test"); + + mosq->connect("localhost", port, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-b2c-qos1.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-b2c-qos1.cpp new file mode 100644 index 0000000..d7e3cb2 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-b2c-qos1.cpp @@ -0,0 +1,78 @@ +#include <cstdio> +#include <cstdlib> +#include <cstring> + +#include <mosquittopp.h> + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_message(const struct mosquitto_message *msg); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + } +} + +void mosquittopp_test::on_message(const struct mosquitto_message *msg) +{ + if(msg->mid != 123){ + printf("Invalid mid (%d)\n", msg->mid); + exit(1); + } + if(msg->qos != 1){ + printf("Invalid qos (%d)\n", msg->qos); + exit(1); + } + if(strcmp(msg->topic, "pub/qos1/receive")){ + printf("Invalid topic (%s)\n", msg->topic); + exit(1); + } + if(strcmp((char *)msg->payload, "message")){ + printf("Invalid payload (%s)\n", (char *)msg->payload); + exit(1); + } + if(msg->payloadlen != 7){ + printf("Invalid payloadlen (%d)\n", msg->payloadlen); + exit(1); + } + if(msg->retain != false){ + printf("Invalid retain (%d)\n", msg->retain); + exit(1); + } + + exit(0); +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("publish-qos1-test"); + mosq->message_retry_set(3); + + mosq->connect("localhost", port, 60); + + while(1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return 1; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-b2c-qos2.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-b2c-qos2.cpp new file mode 100644 index 0000000..a4feeed --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-b2c-qos2.cpp @@ -0,0 +1,80 @@ +#include <cstdio> +#include <cstdlib> +#include <cstring> + +#include <mosquittopp.h> + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_message(const struct mosquitto_message *msg); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + } +} + +void mosquittopp_test::on_message(const struct mosquitto_message *msg) +{ + if(msg->mid != 13423){ + printf("Invalid mid (%d)\n", msg->mid); + exit(1); + } + if(msg->qos != 2){ + printf("Invalid qos (%d)\n", msg->qos); + exit(1); + } + if(strcmp(msg->topic, "pub/qos2/receive")){ + printf("Invalid topic (%s)\n", msg->topic); + exit(1); + } + if(strcmp((char *)msg->payload, "message")){ + printf("Invalid payload (%s)\n", (char *)msg->payload); + exit(1); + } + if(msg->payloadlen != 7){ + printf("Invalid payloadlen (%d)\n", msg->payloadlen); + exit(1); + } + if(msg->retain != false){ + printf("Invalid retain (%d)\n", msg->retain); + exit(1); + } + + run = 0; +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("publish-qos2-test"); + mosq->message_retry_set(3); + + mosq->connect("localhost", port, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp new file mode 100644 index 0000000..c17eae1 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp @@ -0,0 +1,70 @@ +#include <cstdlib> +#include <cstring> + +#include <mosquittopp.h> + +static int run = -1; +static int first_connection = 1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); + void on_publish(int mid); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + if(first_connection == 1){ + publish(NULL, "pub/qos1/test", strlen("message"), "message", 1, false); + first_connection = 0; + } + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + if(rc){ + reconnect(); + }else{ + run = 0; + } +} + +void mosquittopp_test::on_publish(int mid) +{ + disconnect(); +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("publish-qos1-test"); + mosq->message_retry_set(3); + + mosq->connect("localhost", port, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp new file mode 100644 index 0000000..96991f2 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp @@ -0,0 +1,70 @@ +#include <cstdlib> +#include <cstring> + +#include <mosquittopp.h> + +static int run = -1; +static int first_connection = 1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); + void on_publish(int mid); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + if(first_connection == 1){ + publish(NULL, "pub/qos2/test", strlen("message"), "message", 2, false); + first_connection = 0; + } + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + if(rc){ + reconnect(); + }else{ + run = 0; + } +} + +void mosquittopp_test::on_publish(int mid) +{ + disconnect(); +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("publish-qos2-test"); + mosq->message_retry_set(3); + + mosq->connect("localhost", port, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-c2b-qos2.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-c2b-qos2.cpp new file mode 100644 index 0000000..9fe606e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-c2b-qos2.cpp @@ -0,0 +1,61 @@ +#include <cstdlib> +#include <cstring> + +#include <mosquittopp.h> + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); + void on_publish(int mid); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + publish(NULL, "pub/qos2/test", strlen("message"), "message", 2, false); + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + run = 0; +} + +void mosquittopp_test::on_publish(int mid) +{ + disconnect(); +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("publish-qos2-test"); + + mosq->connect("localhost", port, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-qos0-no-payload.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-qos0-no-payload.cpp new file mode 100644 index 0000000..acd97e0 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-qos0-no-payload.cpp @@ -0,0 +1,58 @@ +#include <cstring> + +#include <mosquittopp.h> + +static int run = -1; +static int sent_mid = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_publish(int mid); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + publish(&sent_mid, "pub/qos0/no-payload/test", 0, NULL, 0, false); + } +} + +void mosquittopp_test::on_publish(int mid) +{ + if(sent_mid == mid){ + disconnect(); + }else{ + exit(1); + } +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("publish-qos0-test-np"); + + mosq->connect("localhost", port, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-qos0.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-qos0.cpp new file mode 100644 index 0000000..fba30ba --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/03-publish-qos0.cpp @@ -0,0 +1,58 @@ +#include <cstring> + +#include <mosquittopp.h> + +static int run = -1; +static int sent_mid = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_publish(int mid); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + publish(&sent_mid, "pub/qos0/test", strlen("message"), "message", 0, false); + } +} + +void mosquittopp_test::on_publish(int mid) +{ + if(sent_mid == mid){ + disconnect(); + }else{ + exit(1); + } +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("publish-qos0-test"); + + mosq->connect("localhost", port, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/04-retain-qos0.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/04-retain-qos0.cpp new file mode 100644 index 0000000..6b7b61e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/04-retain-qos0.cpp @@ -0,0 +1,47 @@ +#include <cstring> + +#include <mosquittopp.h> + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + publish(NULL, "retain/qos0/test", strlen("retained message"), "retained message", 0, true); + } +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("retain-qos0-test"); + + mosq->connect("localhost", port, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/08-ssl-bad-cacert.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/08-ssl-bad-cacert.cpp new file mode 100644 index 0000000..b54d4fc --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/08-ssl-bad-cacert.cpp @@ -0,0 +1,31 @@ +#include <mosquittopp.h> + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + int rc = 1; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("08-ssl-bad-cacert"); + + mosq->tls_opts_set(1, "tlsv1", NULL); + if(mosq->tls_set("this/file/doesnt/exist") == MOSQ_ERR_INVAL){ + rc = 0; + } + mosqpp::lib_cleanup(); + + return rc; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp new file mode 100644 index 0000000..55d8bc7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp @@ -0,0 +1,64 @@ +#include <cstring> +#include <mosquittopp.h> + +static int run = -1; + +static int password_callback(char* buf, int size, int rwflag, void* userdata) +{ + strncpy(buf, "password", size); + buf[size-1] = '\0'; + + return strlen(buf); +} + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + disconnect(); + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + run = rc; +} + + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("08-ssl-connect-crt-auth-enc"); + + mosq->tls_opts_set(1, "tlsv1", NULL); + //mosq->tls_set("../ssl/test-ca.crt", NULL, "../ssl/client.crt", "../ssl/client.key"); + mosq->tls_set("../ssl/all-ca.crt", NULL, "../ssl/client-encrypted.crt", "../ssl/client-encrypted.key", password_callback); + mosq->connect("localhost", port, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/08-ssl-connect-cert-auth.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/08-ssl-connect-cert-auth.cpp new file mode 100644 index 0000000..8e04151 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/08-ssl-connect-cert-auth.cpp @@ -0,0 +1,55 @@ +#include <mosquittopp.h> + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + disconnect(); + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + run = rc; +} + + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("08-ssl-connect-crt-auth"); + + mosq->tls_opts_set(1, "tlsv1", NULL); + //mosq->tls_set("../ssl/test-ca.crt", NULL, "../ssl/client.crt", "../ssl/client.key"); + mosq->tls_set("../ssl/all-ca.crt", NULL, "../ssl/client.crt", "../ssl/client.key"); + mosq->connect("localhost", port, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/08-ssl-connect-no-auth.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/08-ssl-connect-no-auth.cpp new file mode 100644 index 0000000..cfa0402 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/08-ssl-connect-no-auth.cpp @@ -0,0 +1,55 @@ +#include <mosquittopp.h> + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + disconnect(); + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + run = rc; +} + + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("08-ssl-connect-no-auth"); + + mosq->tls_opts_set(1, "tlsv1", NULL); + //mosq->tls_set("../ssl/test-root-ca.crt"); + mosq->tls_set("../ssl/all-ca.crt"); + mosq->connect("localhost", port, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/08-ssl-fake-cacert.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/08-ssl-fake-cacert.cpp new file mode 100644 index 0000000..d4aa0dd --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/08-ssl-fake-cacert.cpp @@ -0,0 +1,44 @@ +#include <errno.h> +#include <mosquittopp.h> + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + exit(1); +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + int rc; + + int port = atoi(argv[1]); + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("08-ssl-fake-cacert"); + + mosq->tls_opts_set(1, "tlsv1", NULL); + mosq->tls_set("../ssl/test-fake-root-ca.crt", NULL, "../ssl/client.crt", "../ssl/client.key"); + mosq->connect("localhost", port, 60); + + rc = mosq->loop_forever(); + if(rc == MOSQ_ERR_ERRNO && errno == EPROTO){ + return 0; + }else{ + return 1; + } +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/09-util-topic-tokenise.cpp b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/09-util-topic-tokenise.cpp new file mode 100644 index 0000000..3094d29 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/09-util-topic-tokenise.cpp @@ -0,0 +1,129 @@ +#include <cstdio> +#include <cstring> +#include <mosquittopp.h> + +void print_error(const char *topic, char **topics, int topic_count) +{ + int i; + printf("TOPIC: %s\n", topic); + printf("TOKENS: "); + for(i=0; i<topic_count; i++){ + printf("%s", topics[i]); + if(i+1<topic_count){ + printf("/"); + } + } + printf("\n"); +} + +int main(int argc, char *argv[]) +{ + char **topics; + int topic_count; + + if(mosqpp::sub_topic_tokenise("topic", &topics, &topic_count)){ + printf("Out of memory.\n"); + return 1; + } + if(topic_count != 1 || strcmp(topics[0], "topic")){ + print_error("topic", topics, topic_count); + return 1; + } + + if(mosqpp::sub_topic_tokenise("a/deep/topic/hierarchy", &topics, &topic_count)){ + printf("Out of memory.\n"); + return 1; + } + if(topic_count != 4 + || strcmp(topics[0], "a") + || strcmp(topics[1], "deep") + || strcmp(topics[2], "topic") + || strcmp(topics[3], "hierarchy")){ + print_error("a/deep/topic/hierarchy", topics, topic_count); + return 1; + } + + if(mosqpp::sub_topic_tokenise("/a/deep/topic/hierarchy", &topics, &topic_count)){ + printf("Out of memory.\n"); + return 1; + } + if(topic_count != 5 + || topics[0] + || strcmp(topics[1], "a") + || strcmp(topics[2], "deep") + || strcmp(topics[3], "topic") + || strcmp(topics[4], "hierarchy")){ + print_error("/a/deep/topic/hierarchy", topics, topic_count); + return 1; + } + + if(mosqpp::sub_topic_tokenise("a/b/c", &topics, &topic_count)){ + printf("Out of memory.\n"); + return 1; + } + if(topic_count != 3 + || strcmp(topics[0], "a") + || strcmp(topics[1], "b") + || strcmp(topics[2], "c")){ + print_error("a/b/c", topics, topic_count); + return 1; + } + + if(mosqpp::sub_topic_tokenise("/a/b/c", &topics, &topic_count)){ + printf("Out of memory.\n"); + return 1; + } + if(topic_count != 4 + || topics[0] + || strcmp(topics[1], "a") + || strcmp(topics[2], "b") + || strcmp(topics[3], "c")){ + print_error("/a/b/c", topics, topic_count); + return 1; + } + + if(mosqpp::sub_topic_tokenise("a///hierarchy", &topics, &topic_count)){ + printf("Out of memory.\n"); + return 1; + } + if(topic_count != 4 + || strcmp(topics[0], "a") + || topics[1] + || topics[2] + || strcmp(topics[3], "hierarchy")){ + print_error("a///hierarchy", topics, topic_count); + return 1; + } + + if(mosqpp::sub_topic_tokenise("/a///hierarchy", &topics, &topic_count)){ + printf("Out of memory.\n"); + return 1; + } + if(topic_count != 5 + || topics[0] + || strcmp(topics[1], "a") + || topics[2] + || topics[3] + || strcmp(topics[4], "hierarchy")){ + print_error("/a///hierarchy", topics, topic_count); + return 1; + } + + if(mosqpp::sub_topic_tokenise("/a///hierarchy/", &topics, &topic_count)){ + printf("Out of memory.\n"); + return 1; + } + if(topic_count != 6 + || topics[0] + || strcmp(topics[1], "a") + || topics[2] + || topics[3] + || strcmp(topics[4], "hierarchy") + || topics[3]){ + print_error("/a///hierarchy/", topics, topic_count); + return 1; + } + + return 0; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/Makefile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/Makefile new file mode 100644 index 0000000..42db17c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/cpp/Makefile @@ -0,0 +1,96 @@ +.PHONY: all test 01 02 03 04 08 09 clean reallyclean + +CFLAGS=-I../../../lib -I../../../lib/cpp -DDEBUG +LIBS=../../../lib/libmosquitto.so.1 ../../../lib/cpp/libmosquittopp.so.1 + +all : 01 02 03 04 08 09 + +01-con-discon-success.test : 01-con-discon-success.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +01-will-set.test : 01-will-set.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +01-unpwd-set.test : 01-unpwd-set.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +01-will-unpwd-set.test : 01-will-unpwd-set.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +01-no-clean-session.test : 01-no-clean-session.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +01-keepalive-pingreq.test : 01-keepalive-pingreq.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +02-subscribe-qos0.test : 02-subscribe-qos0.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +02-subscribe-qos1.test : 02-subscribe-qos1.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +02-subscribe-qos2.test : 02-subscribe-qos2.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +02-unsubscribe.test : 02-unsubscribe.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +03-publish-qos0.test : 03-publish-qos0.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +03-publish-qos0-no-payload.test : 03-publish-qos0-no-payload.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +03-publish-c2b-qos1-disconnect.test : 03-publish-c2b-qos1-disconnect.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +03-publish-c2b-qos2.test : 03-publish-c2b-qos2.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +03-publish-c2b-qos2-disconnect.test : 03-publish-c2b-qos2-disconnect.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +03-publish-b2c-qos1.test : 03-publish-b2c-qos1.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +03-publish-b2c-qos2.test : 03-publish-b2c-qos2.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +04-retain-qos0.test : 04-retain-qos0.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +08-ssl-connect-no-auth.test : 08-ssl-connect-no-auth.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +08-ssl-connect-cert-auth.test : 08-ssl-connect-cert-auth.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +08-ssl-connect-cert-auth-enc.test : 08-ssl-connect-cert-auth-enc.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +08-ssl-bad-cacert.test : 08-ssl-bad-cacert.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +08-ssl-fake-cacert.test : 08-ssl-fake-cacert.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +09-util-topic-tokenise.test : 09-util-topic-tokenise.cpp + $(CXX) $< -o $@ $(CFLAGS) $(LIBS) + +01 : 01-con-discon-success.test 01-will-set.test 01-unpwd-set.test 01-will-unpwd-set.test 01-no-clean-session.test 01-keepalive-pingreq.test + +02 : 02-subscribe-qos0.test 02-subscribe-qos1.test 02-subscribe-qos2.test 02-unsubscribe.test + +03 : 03-publish-qos0.test 03-publish-qos0-no-payload.test 03-publish-c2b-qos1-disconnect.test 03-publish-c2b-qos2.test 03-publish-c2b-qos2-disconnect.test 03-publish-b2c-qos1.test 03-publish-b2c-qos2.test + +04 : 04-retain-qos0.test + +08 : 08-ssl-connect-no-auth.test 08-ssl-connect-cert-auth.test 08-ssl-connect-cert-auth-enc.test 08-ssl-bad-cacert.test 08-ssl-fake-cacert.test + +09 : 09-util-topic-tokenise.test + +reallyclean : clean + -rm -f *.orig + +clean : + rm -f *.test diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/mosq_test_helper.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/mosq_test_helper.py new file mode 100644 index 0000000..0e861db --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/mosq_test_helper.py @@ -0,0 +1,15 @@ +import inspect, os, sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test +import mqtt5_props + +import socket +import ssl +import struct +import subprocess +import time diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/test.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/test.py new file mode 100755 index 0000000..2bc8464 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/lib/test.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3 + +import mosq_test_helper +import ptest + +tests = [ + (1, ['./01-con-discon-success.py', 'c/01-con-discon-success.test']), + (1, ['./01-keepalive-pingreq.py', 'c/01-keepalive-pingreq.test']), + (1, ['./01-no-clean-session.py', 'c/01-no-clean-session.test']), + (1, ['./01-server-keepalive-pingreq.py', 'c/01-server-keepalive-pingreq.test']), + (1, ['./01-unpwd-set.py', 'c/01-unpwd-set.test']), + (1, ['./01-will-set.py', 'c/01-will-set.test']), + (1, ['./01-will-unpwd-set.py', 'c/01-will-unpwd-set.test']), + + (1, ['./02-subscribe-qos0.py', 'c/02-subscribe-qos0.test']), + (1, ['./02-subscribe-qos1.py', 'c/02-subscribe-qos1.test']), + (1, ['./02-subscribe-qos2.py', 'c/02-subscribe-qos2.test']), + (1, ['./02-unsubscribe-multiple-v5.py', 'c/02-unsubscribe-multiple-v5.test']), + (1, ['./02-unsubscribe-v5.py', 'c/02-unsubscribe-v5.test']), + (1, ['./02-unsubscribe.py', 'c/02-unsubscribe.test']), + + (1, ['./03-publish-b2c-qos1.py', 'c/03-publish-b2c-qos1.test']), + (1, ['./03-publish-b2c-qos2-len.py', 'c/03-publish-b2c-qos2-len.test']), + (1, ['./03-publish-b2c-qos2.py', 'c/03-publish-b2c-qos2.test']), + (1, ['./03-publish-c2b-qos1-disconnect.py', 'c/03-publish-c2b-qos1-disconnect.test']), + (1, ['./03-publish-c2b-qos1-len.py', 'c/03-publish-c2b-qos1-len.test']), + (1, ['./03-publish-c2b-qos1-receive-maximum.py', 'c/03-publish-c2b-qos1-receive-maximum.test']), + (1, ['./03-publish-c2b-qos2-disconnect.py', 'c/03-publish-c2b-qos2-disconnect.test']), + (1, ['./03-publish-c2b-qos2-len.py', 'c/03-publish-c2b-qos2-len.test']), + (1, ['./03-publish-c2b-qos2-maximum-qos-0.py', 'c/03-publish-c2b-qos2-maximum-qos-0.test']), + (1, ['./03-publish-c2b-qos2-maximum-qos-1.py', 'c/03-publish-c2b-qos2-maximum-qos-1.test']), + (1, ['./03-publish-c2b-qos2-pubrec-error.py', 'c/03-publish-c2b-qos2-pubrec-error.test']), + (1, ['./03-publish-c2b-qos2-receive-maximum-1.py', 'c/03-publish-c2b-qos2-receive-maximum-1.test']), + (1, ['./03-publish-c2b-qos2-receive-maximum-2.py', 'c/03-publish-c2b-qos2-receive-maximum-2.test']), + (1, ['./03-publish-c2b-qos2.py', 'c/03-publish-c2b-qos2.test']), + (1, ['./03-publish-qos0-no-payload.py', 'c/03-publish-qos0-no-payload.test']), + (1, ['./03-publish-qos0.py', 'c/03-publish-qos0.test']), + (1, ['./03-request-response-correlation.py', 'c/03-request-response-correlation.test']), + (1, ['./03-request-response.py', 'c/03-request-response.test']), + + (1, ['./04-retain-qos0.py', 'c/04-retain-qos0.test']), + + (1, ['./08-ssl-bad-cacert.py', 'c/08-ssl-bad-cacert.test']), + (1, ['./08-ssl-connect-cert-auth-enc.py', 'c/08-ssl-connect-cert-auth-enc.test']), + (1, ['./08-ssl-connect-cert-auth.py', 'c/08-ssl-connect-cert-auth.test']), + (1, ['./08-ssl-connect-no-auth.py', 'c/08-ssl-connect-no-auth.test']), + + (1, ['./09-util-topic-tokenise.py', 'c/09-util-topic-tokenise.test']), + + (1, ['./11-prop-oversize-packet.py', 'c/11-prop-oversize-packet.test']), + (1, ['./11-prop-send-content-type.py', 'c/11-prop-send-content-type.test']), + (1, ['./11-prop-send-payload-format.py', 'c/11-prop-send-payload-format.test']), + + + (1, ['./01-con-discon-success.py', 'cpp/01-con-discon-success.test']), + (1, ['./01-keepalive-pingreq.py', 'cpp/01-keepalive-pingreq.test']), + (1, ['./01-no-clean-session.py', 'cpp/01-no-clean-session.test']), + (1, ['./01-unpwd-set.py', 'cpp/01-unpwd-set.test']), + (1, ['./01-will-set.py', 'cpp/01-will-set.test']), + (1, ['./01-will-unpwd-set.py', 'cpp/01-will-unpwd-set.test']), + + (1, ['./02-subscribe-qos0.py', 'cpp/02-subscribe-qos0.test']), + (1, ['./02-subscribe-qos1.py', 'cpp/02-subscribe-qos1.test']), + (1, ['./02-subscribe-qos2.py', 'cpp/02-subscribe-qos2.test']), + (1, ['./02-unsubscribe.py', 'cpp/02-unsubscribe.test']), + + (1, ['./03-publish-b2c-qos1.py', 'cpp/03-publish-b2c-qos1.test']), + (1, ['./03-publish-b2c-qos2.py', 'cpp/03-publish-b2c-qos2.test']), + (1, ['./03-publish-c2b-qos1-disconnect.py', 'cpp/03-publish-c2b-qos1-disconnect.test']), + (1, ['./03-publish-c2b-qos2-disconnect.py', 'cpp/03-publish-c2b-qos2-disconnect.test']), + (1, ['./03-publish-c2b-qos2.py', 'cpp/03-publish-c2b-qos2.test']), + (1, ['./03-publish-qos0-no-payload.py', 'cpp/03-publish-qos0-no-payload.test']), + (1, ['./03-publish-qos0.py', 'cpp/03-publish-qos0.test']), + + (1, ['./04-retain-qos0.py', 'cpp/04-retain-qos0.test']), + + (1, ['./08-ssl-bad-cacert.py', 'cpp/08-ssl-bad-cacert.test']), + (1, ['./08-ssl-connect-cert-auth-enc.py', 'cpp/08-ssl-connect-cert-auth-enc.test']), + (1, ['./08-ssl-connect-cert-auth.py', 'cpp/08-ssl-connect-cert-auth.test']), + (1, ['./08-ssl-connect-no-auth.py', 'cpp/08-ssl-connect-no-auth.test']), + + (1, ['./09-util-topic-tokenise.py', 'cpp/09-util-topic-tokenise.test']), + ] + + +ptest.run_tests(tests) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/mosq_test.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/mosq_test.py new file mode 100644 index 0000000..2093e32 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/mosq_test.py @@ -0,0 +1,620 @@ +import errno +import os +import socket +import subprocess +import struct +import sys +import time + +import mqtt5_props + +import __main__ + +import atexit +vg_index = 1 +vg_logfiles = [] + + +def start_broker(filename, cmd=None, port=0, use_conf=False, expect_fail=False): + global vg_index + global vg_logfiles + + delay = 0.1 + + if use_conf == True: + cmd = ['../../src/mosquitto', '-v', '-c', filename.replace('.py', '.conf')] + + if port == 0: + port = 1888 + else: + if cmd is None and port != 0: + cmd = ['../../src/mosquitto', '-v', '-p', str(port)] + elif cmd is None and port == 0: + port = 1888 + cmd = ['../../src/mosquitto', '-v', '-c', filename.replace('.py', '.conf')] + elif cmd is not None and port == 0: + port = 1888 + + if os.environ.get('MOSQ_USE_VALGRIND') is not None: + logfile = filename+'.'+str(vg_index)+'.vglog' + cmd = ['valgrind', '-q', '--trace-children=yes', '--leak-check=full', '--show-leak-kinds=all', '--log-file='+logfile] + cmd + vg_logfiles.append(logfile) + vg_index += 1 + delay = 1 + + #print(port) + #print(cmd) + broker = subprocess.Popen(cmd, stderr=subprocess.PIPE) + for i in range(0, 20): + time.sleep(delay) + c = None + try: + c = socket.create_connection(("localhost", port)) + except socket.error as err: + if err.errno != errno.ECONNREFUSED: + raise + + if c is not None: + c.close() + time.sleep(delay) + return broker + + if expect_fail == False: + raise IOError + else: + return None + +def start_client(filename, cmd, env, port=1888): + if cmd is None: + raise ValueError + if os.environ.get('MOSQ_USE_VALGRIND') is not None: + cmd = ['valgrind', '-q', '--log-file='+filename+'.vglog'] + cmd + + cmd = cmd + [str(port)] + return subprocess.Popen(cmd, env=env) + + +def expect_packet(sock, name, expected): + if len(expected) > 0: + rlen = len(expected) + else: + rlen = 1 + + packet_recvd = sock.recv(rlen) + return packet_matches(name, packet_recvd, expected) + + +def packet_matches(name, recvd, expected): + if recvd != expected: + print("FAIL: Received incorrect "+name+".") + try: + print("Received: "+to_string(recvd)) + except struct.error: + print("Received (not decoded, len=%d): %s" % (len(recvd), recvd)) + for i in range(0, len(recvd)): + print('%c'%(recvd[i]),) + try: + print("Expected: "+to_string(expected)) + except struct.error: + print("Expected (not decoded, len=%d): %s" % (len(expected), expected)) + for i in range(0, len(expected)): + print('%c'%(expected[i]),) + + return 0 + else: + return 1 + + +def do_send_receive(sock, send_packet, receive_packet, error_string="send receive error"): + sock.send(send_packet) + + if expect_packet(sock, error_string, receive_packet): + return sock + else: + sock.close() + raise ValueError + + +def do_client_connect(connect_packet, connack_packet, hostname="localhost", port=1888, timeout=60, connack_error="connack"): + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.settimeout(timeout) + sock.connect((hostname, port)) + + return do_send_receive(sock, connect_packet, connack_packet, connack_error) + + +def remaining_length(packet): + l = min(5, len(packet)) + all_bytes = struct.unpack("!"+"B"*l, packet[:l]) + mult = 1 + rl = 0 + for i in range(1,l-1): + byte = all_bytes[i] + + rl += (byte & 127) * mult + mult *= 128 + if byte & 128 == 0: + packet = packet[i+1:] + break + + return (packet, rl) + + +def to_hex_string(packet): + if len(packet) == 0: + return "" + + s = "" + while len(packet) > 0: + packet0 = struct.unpack("!B", packet[0]) + s = s+hex(packet0[0]) + " " + packet = packet[1:] + + return s + + +def to_string(packet): + if len(packet) == 0: + return "" + + packet0 = struct.unpack("!B", bytes(packet[0])) + packet0 = packet0[0] + cmd = packet0 & 0xF0 + if cmd == 0x00: + # Reserved + return "0x00" + elif cmd == 0x10: + # CONNECT + (packet, rl) = remaining_length(packet) + pack_format = "!H" + str(len(packet)-2) + 's' + (slen, packet) = struct.unpack(pack_format, packet) + pack_format = "!" + str(slen)+'sBBH' + str(len(packet)-slen-4) + 's' + (protocol, proto_ver, flags, keepalive, packet) = struct.unpack(pack_format, packet) + s = "CONNECT, proto="+protocol+str(proto_ver)+", keepalive="+str(keepalive) + if flags&2: + s = s+", clean-session" + else: + s = s+", durable" + + pack_format = "!H" + str(len(packet)-2) + 's' + (slen, packet) = struct.unpack(pack_format, packet) + pack_format = "!" + str(slen)+'s' + str(len(packet)-slen) + 's' + (client_id, packet) = struct.unpack(pack_format, packet) + s = s+", id="+client_id + + if flags&4: + pack_format = "!H" + str(len(packet)-2) + 's' + (slen, packet) = struct.unpack(pack_format, packet) + pack_format = "!" + str(slen)+'s' + str(len(packet)-slen) + 's' + (will_topic, packet) = struct.unpack(pack_format, packet) + s = s+", will-topic="+will_topic + + pack_format = "!H" + str(len(packet)-2) + 's' + (slen, packet) = struct.unpack(pack_format, packet) + pack_format = "!" + str(slen)+'s' + str(len(packet)-slen) + 's' + (will_message, packet) = struct.unpack(pack_format, packet) + s = s+", will-message="+will_message + + s = s+", will-qos="+str((flags&24)>>3) + s = s+", will-retain="+str((flags&32)>>5) + + if flags&128: + pack_format = "!H" + str(len(packet)-2) + 's' + (slen, packet) = struct.unpack(pack_format, packet) + pack_format = "!" + str(slen)+'s' + str(len(packet)-slen) + 's' + (username, packet) = struct.unpack(pack_format, packet) + s = s+", username="+username + + if flags&64: + pack_format = "!H" + str(len(packet)-2) + 's' + (slen, packet) = struct.unpack(pack_format, packet) + pack_format = "!" + str(slen)+'s' + str(len(packet)-slen) + 's' + (password, packet) = struct.unpack(pack_format, packet) + s = s+", password="+password + + if flags&1: + s = s+", reserved=1" + + return s + elif cmd == 0x20: + # CONNACK + (cmd, rl, resv, rc) = struct.unpack('!BBBB', packet) + return "CONNACK, rl="+str(rl)+", res="+str(resv)+", rc="+str(rc) + elif cmd == 0x30: + # PUBLISH + dup = (packet0 & 0x08)>>3 + qos = (packet0 & 0x06)>>1 + retain = (packet0 & 0x01) + (packet, rl) = remaining_length(packet) + pack_format = "!H" + str(len(packet)-2) + 's' + (tlen, packet) = struct.unpack(pack_format, packet) + pack_format = "!" + str(tlen)+'s' + str(len(packet)-tlen) + 's' + (topic, packet) = struct.unpack(pack_format, packet) + s = "PUBLISH, rl="+str(rl)+", topic="+topic+", qos="+str(qos)+", retain="+str(retain)+", dup="+str(dup) + if qos > 0: + pack_format = "!H" + str(len(packet)-2) + 's' + (mid, packet) = struct.unpack(pack_format, packet) + s = s + ", mid="+str(mid) + + s = s + ", payload="+packet + return s + elif cmd == 0x40: + # PUBACK + (cmd, rl, mid) = struct.unpack('!BBH', packet) + return "PUBACK, rl="+str(rl)+", mid="+str(mid) + elif cmd == 0x50: + # PUBREC + (cmd, rl, mid) = struct.unpack('!BBH', packet) + return "PUBREC, rl="+str(rl)+", mid="+str(mid) + elif cmd == 0x60: + # PUBREL + dup = (packet0 & 0x08)>>3 + (cmd, rl, mid) = struct.unpack('!BBH', packet) + return "PUBREL, rl="+str(rl)+", mid="+str(mid)+", dup="+str(dup) + elif cmd == 0x70: + # PUBCOMP + (cmd, rl, mid) = struct.unpack('!BBH', packet) + return "PUBCOMP, rl="+str(rl)+", mid="+str(mid) + elif cmd == 0x80: + # SUBSCRIBE + (packet, rl) = remaining_length(packet) + pack_format = "!H" + str(len(packet)-2) + 's' + (mid, packet) = struct.unpack(pack_format, packet) + s = "SUBSCRIBE, rl="+str(rl)+", mid="+str(mid) + topic_index = 0 + while len(packet) > 0: + pack_format = "!H" + str(len(packet)-2) + 's' + (tlen, packet) = struct.unpack(pack_format, packet) + pack_format = "!" + str(tlen)+'sB' + str(len(packet)-tlen-1) + 's' + (topic, qos, packet) = struct.unpack(pack_format, packet) + s = s + ", topic"+str(topic_index)+"="+topic+","+str(qos) + return s + elif cmd == 0x90: + # SUBACK + (packet, rl) = remaining_length(packet) + pack_format = "!H" + str(len(packet)-2) + 's' + (mid, packet) = struct.unpack(pack_format, packet) + pack_format = "!" + "B"*len(packet) + granted_qos = struct.unpack(pack_format, packet) + + s = "SUBACK, rl="+str(rl)+", mid="+str(mid)+", granted_qos="+str(granted_qos[0]) + for i in range(1, len(granted_qos)-1): + s = s+", "+str(granted_qos[i]) + return s + elif cmd == 0xA0: + # UNSUBSCRIBE + (packet, rl) = remaining_length(packet) + pack_format = "!H" + str(len(packet)-2) + 's' + (mid, packet) = struct.unpack(pack_format, packet) + s = "UNSUBSCRIBE, rl="+str(rl)+", mid="+str(mid) + topic_index = 0 + while len(packet) > 0: + pack_format = "!H" + str(len(packet)-2) + 's' + (tlen, packet) = struct.unpack(pack_format, packet) + pack_format = "!" + str(tlen)+'s' + str(len(packet)-tlen) + 's' + (topic, packet) = struct.unpack(pack_format, packet) + s = s + ", topic"+str(topic_index)+"="+topic + return s + elif cmd == 0xB0: + # UNSUBACK + (cmd, rl, mid) = struct.unpack('!BBH', packet) + return "UNSUBACK, rl="+str(rl)+", mid="+str(mid) + elif cmd == 0xC0: + # PINGREQ + (cmd, rl) = struct.unpack('!BB', packet) + return "PINGREQ, rl="+str(rl) + elif cmd == 0xD0: + # PINGRESP + (cmd, rl) = struct.unpack('!BB', packet) + return "PINGRESP, rl="+str(rl) + elif cmd == 0xE0: + # DISCONNECT + (cmd, rl) = struct.unpack('!BB', packet) + return "DISCONNECT, rl="+str(rl) + elif cmd == 0xF0: + # AUTH + (cmd, rl) = struct.unpack('!BB', packet) + return "AUTH, rl="+str(rl) + +def gen_connect(client_id, clean_session=True, keepalive=60, username=None, password=None, will_topic=None, will_qos=0, will_retain=False, will_payload=b"", proto_ver=4, connect_reserved=False, properties=b"", will_properties=b""): + if (proto_ver&0x7F) == 3 or proto_ver == 0: + remaining_length = 12 + elif (proto_ver&0x7F) == 4 or proto_ver == 5: + remaining_length = 10 + else: + raise ValueError + + if client_id != None: + client_id = client_id.encode("utf-8") + remaining_length = remaining_length + 2+len(client_id) + else: + remaining_length = remaining_length + 2 + + connect_flags = 0 + + if connect_reserved: + connect_flags = connect_flags | 0x01 + + if clean_session: + connect_flags = connect_flags | 0x02 + + if proto_ver == 5: + if properties == b"": + properties += mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_RECEIVE_MAXIMUM, 20) + properties = mqtt5_props.prop_finalise(properties) + remaining_length += len(properties) + + if will_topic != None: + will_topic = will_topic.encode("utf-8") + remaining_length = remaining_length + 2+len(will_topic) + 2+len(will_payload) + connect_flags = connect_flags | 0x04 | ((will_qos&0x03) << 3) + if will_retain: + connect_flags = connect_flags | 32 + if proto_ver == 5: + will_properties = mqtt5_props.prop_finalise(will_properties) + remaining_length += len(will_properties) + + if username != None: + username = username.encode("utf-8") + remaining_length = remaining_length + 2+len(username) + connect_flags = connect_flags | 0x80 + if password != None: + password = password.encode("utf-8") + connect_flags = connect_flags | 0x40 + remaining_length = remaining_length + 2+len(password) + + rl = pack_remaining_length(remaining_length) + packet = struct.pack("!B"+str(len(rl))+"s", 0x10, rl) + if (proto_ver&0x7F) == 3 or proto_ver == 0: + packet = packet + struct.pack("!H6sBBH", len(b"MQIsdp"), b"MQIsdp", proto_ver, connect_flags, keepalive) + elif (proto_ver&0x7F) == 4 or proto_ver == 5: + packet = packet + struct.pack("!H4sBBH", len(b"MQTT"), b"MQTT", proto_ver, connect_flags, keepalive) + + if proto_ver == 5: + packet += properties + + if client_id != None: + packet = packet + struct.pack("!H"+str(len(client_id))+"s", len(client_id), bytes(client_id)) + else: + packet = packet + struct.pack("!H", 0) + + if will_topic != None: + packet += will_properties + packet = packet + struct.pack("!H"+str(len(will_topic))+"s", len(will_topic), will_topic) + if len(will_payload) > 0: + packet = packet + struct.pack("!H"+str(len(will_payload))+"s", len(will_payload), will_payload) + else: + packet = packet + struct.pack("!H", 0) + + if username != None: + packet = packet + struct.pack("!H"+str(len(username))+"s", len(username), username) + if password != None: + packet = packet + struct.pack("!H"+str(len(password))+"s", len(password), password) + return packet + +def gen_connack(flags=0, rc=0, proto_ver=4, properties=b""): + if proto_ver == 5: + if properties is not None: + properties = mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_TOPIC_ALIAS_MAXIMUM, 10) + properties + else: + properties = b"" + properties = mqtt5_props.prop_finalise(properties) + + packet = struct.pack('!BBBB', 32, 2+len(properties), flags, rc) + properties + else: + packet = struct.pack('!BBBB', 32, 2, flags, rc); + + return packet + +def gen_publish(topic, qos, payload=None, retain=False, dup=False, mid=0, proto_ver=4, properties=b""): + topic = topic.encode("utf-8") + rl = 2+len(topic) + pack_format = "H"+str(len(topic))+"s" + if qos > 0: + rl = rl + 2 + pack_format = pack_format + "H" + + if proto_ver == 5: + properties = mqtt5_props.prop_finalise(properties) + rl += len(properties) + # This will break if len(properties) > 127 + pack_format = pack_format + "%ds"%(len(properties)) + + if payload != None: + payload = payload.encode("utf-8") + rl = rl + len(payload) + pack_format = pack_format + str(len(payload))+"s" + else: + payload = b"" + pack_format = pack_format + "0s" + + rlpacked = pack_remaining_length(rl) + cmd = 48 | (qos<<1) + if retain: + cmd = cmd + 1 + if dup: + cmd = cmd + 8 + + if proto_ver == 5: + if qos > 0: + return struct.pack("!B" + str(len(rlpacked))+"s" + pack_format, cmd, rlpacked, len(topic), topic, mid, properties, payload) + else: + return struct.pack("!B" + str(len(rlpacked))+"s" + pack_format, cmd, rlpacked, len(topic), topic, properties, payload) + else: + if qos > 0: + return struct.pack("!B" + str(len(rlpacked))+"s" + pack_format, cmd, rlpacked, len(topic), topic, mid, payload) + else: + return struct.pack("!B" + str(len(rlpacked))+"s" + pack_format, cmd, rlpacked, len(topic), topic, payload) + +def _gen_command_with_mid(cmd, mid, proto_ver=4, reason_code=-1, properties=None): + if proto_ver == 5 and (reason_code != -1 or properties is not None): + if reason_code == -1: + reason_code = 0 + + if properties is None: + return struct.pack('!BBHB', cmd, 3, mid, reason_code) + elif properties == "": + return struct.pack('!BBHBB', cmd, 4, mid, reason_code, 0) + else: + properties = mqtt5_props.prop_finalise(properties) + pack_format = "!BBHB"+str(len(properties))+"s" + return struct.pack(pack_format, cmd, 2+1+len(properties), mid, reason_code, properties) + else: + return struct.pack('!BBH', cmd, 2, mid) + +def gen_puback(mid, proto_ver=4, reason_code=-1, properties=None): + return _gen_command_with_mid(64, mid, proto_ver, reason_code, properties) + +def gen_pubrec(mid, proto_ver=4, reason_code=-1, properties=None): + return _gen_command_with_mid(80, mid, proto_ver, reason_code, properties) + +def gen_pubrel(mid, dup=False, proto_ver=4, reason_code=-1, properties=None): + if dup: + cmd = 96+8+2 + else: + cmd = 96+2 + return _gen_command_with_mid(cmd, mid, proto_ver, reason_code, properties) + +def gen_pubcomp(mid, proto_ver=4, reason_code=-1, properties=None): + return _gen_command_with_mid(112, mid, proto_ver, reason_code, properties) + +def gen_subscribe(mid, topic, qos, proto_ver=4, properties=b""): + topic = topic.encode("utf-8") + if proto_ver == 5: + if properties == b"": + pack_format = "!BBHBH"+str(len(topic))+"sB" + return struct.pack(pack_format, 130, 2+1+2+len(topic)+1, mid, 0, len(topic), topic, qos) + else: + properties = mqtt5_props.prop_finalise(properties) + pack_format = "!BBH"+str(len(properties))+"s"+"H"+str(len(topic))+"sB" + return struct.pack(pack_format, 130, 2+1+2+len(topic)+len(properties), mid, properties, len(topic), topic, qos) + else: + pack_format = "!BBHH"+str(len(topic))+"sB" + return struct.pack(pack_format, 130, 2+2+len(topic)+1, mid, len(topic), topic, qos) + +def gen_suback(mid, qos, proto_ver=4): + if proto_ver == 5: + return struct.pack('!BBHBB', 144, 2+1+1, mid, 0, qos) + else: + return struct.pack('!BBHB', 144, 2+1, mid, qos) + +def gen_unsubscribe(mid, topic, proto_ver=4): + topic = topic.encode("utf-8") + if proto_ver == 5: + pack_format = "!BBHBH"+str(len(topic))+"s" + return struct.pack(pack_format, 162, 2+2+len(topic)+1, mid, 0, len(topic), topic) + else: + pack_format = "!BBHH"+str(len(topic))+"s" + return struct.pack(pack_format, 162, 2+2+len(topic), mid, len(topic), topic) + +def gen_unsubscribe_multiple(mid, topics, proto_ver=4): + packet = b"" + remaining_length = 0 + for t in topics: + t = t.encode("utf-8") + remaining_length += 2+len(t) + packet += struct.pack("!H"+str(len(t))+"s", len(t), t) + + if proto_ver == 5: + remaining_length += 2+1 + + return struct.pack("!BBHB", 162, remaining_length, mid, 0) + packet + else: + remaining_length += 2 + + return struct.pack("!BBH", 162, remaining_length, mid) + packet + +def gen_unsuback(mid, proto_ver=4, reason_code=0): + if proto_ver == 5: + if isinstance(reason_code, list): + reason_code_count = len(reason_code) + p = struct.pack('!BBHB', 176, 3+reason_code_count, mid, 0) + for r in reason_code: + p += struct.pack('B', r) + return p + else: + return struct.pack('!BBHBB', 176, 4, mid, 0, reason_code) + else: + return struct.pack('!BBH', 176, 2, mid) + +def gen_pingreq(): + return struct.pack('!BB', 192, 0) + +def gen_pingresp(): + return struct.pack('!BB', 208, 0) + + +def _gen_short(cmd, reason_code=-1, proto_ver=5, properties=None): + if proto_ver == 5 and (reason_code != -1 or properties is not None): + if reason_code == -1: + reason_code = 0 + + if properties is None: + return struct.pack('!BBB', cmd, 1, reason_code) + elif properties == "": + return struct.pack('!BBBB', cmd, 2, reason_code, 0) + else: + properties = mqtt5_props.prop_finalise(properties) + return struct.pack("!BBB", cmd, 1+len(properties), reason_code) + properties + else: + return struct.pack('!BB', cmd, 0) + +def gen_disconnect(reason_code=-1, proto_ver=4, properties=None): + return _gen_short(0xE0, reason_code, proto_ver, properties) + +def gen_auth(reason_code=-1, properties=None): + return _gen_short(0xF0, reason_code, 5, properties) + + +def pack_remaining_length(remaining_length): + s = b"" + while True: + byte = remaining_length % 128 + remaining_length = remaining_length // 128 + # If there are more digits to encode, set the top bit of this digit + if remaining_length > 0: + byte = byte | 0x80 + + s = s + struct.pack("!B", byte) + if remaining_length == 0: + return s + + +def get_port(count=1): + if count == 1: + if len(sys.argv) == 2: + return int(sys.argv[1]) + else: + return 1888 + else: + if len(sys.argv) == 1+count: + p = () + for i in range(0, count): + p = p + (int(sys.argv[1+i]),) + return p + else: + return tuple(range(1888, 1888+count)) + + +def get_lib_port(): + if len(sys.argv) == 3: + return int(sys.argv[2]) + else: + return 1888 + + +def do_ping(sock, error_string="pingresp"): + do_send_receive(sock, gen_pingreq(), gen_pingresp(), error_string) + + +@atexit.register +def test_cleanup(): + global vg_logfiles + + if os.environ.get('MOSQ_USE_VALGRIND') is not None: + for f in vg_logfiles: + try: + if os.stat(f).st_size == 0: + os.remove(f) + except OSError: + pass diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/mqtt5_opts.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/mqtt5_opts.py new file mode 100644 index 0000000..55675a7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/mqtt5_opts.py @@ -0,0 +1,5 @@ +MQTT_SUB_OPT_NO_LOCAL = 0x04 +MQTT_SUB_OPT_RETAIN_AS_PUBLISHED = 0x08 +MQTT_SUB_OPT_SEND_RETAIN_ALWAYS = 0x00 +MQTT_SUB_OPT_SEND_RETAIN_NEW = 0x10 +MQTT_SUB_OPT_SEND_RETAIN_NEVER = 0x20 diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/mqtt5_props.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/mqtt5_props.py new file mode 100644 index 0000000..9f6ad4b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/mqtt5_props.py @@ -0,0 +1,73 @@ +import struct + +PROP_PAYLOAD_FORMAT_INDICATOR = 1 +PROP_MESSAGE_EXPIRY_INTERVAL = 2 +PROP_CONTENT_TYPE = 3 +PROP_RESPONSE_TOPIC = 8 +PROP_CORRELATION_DATA = 9 +PROP_SUBSCRIPTION_IDENTIFIER = 11 +PROP_SESSION_EXPIRY_INTERVAL = 17 +PROP_ASSIGNED_CLIENT_IDENTIFIER = 18 +PROP_SERVER_KEEP_ALIVE = 19 +PROP_AUTHENTICATION_METHOD = 21 +PROP_AUTHENTICATION_DATA = 22 +PROP_REQUEST_PROBLEM_INFO = 23 +PROP_WILL_DELAY_INTERVAL = 24 +PROP_REQUEST_RESPONSE_INFO = 25 +PROP_RESPONSE_INFO = 26 +PROP_SERVER_REFERENCE = 28 +PROP_REASON_STRING = 31 +PROP_RECEIVE_MAXIMUM = 33 +PROP_TOPIC_ALIAS_MAXIMUM = 34 +PROP_TOPIC_ALIAS = 35 +PROP_MAXIMUM_QOS = 36 +PROP_RETAIN_AVAILABLE = 37 +PROP_USER_PROPERTY = 38 +PROP_MAXIMUM_PACKET_SIZE = 39 +PROP_WILDCARD_SUB_AVAILABLE = 40 +PROP_SUBSCRIPTION_ID_AVAILABLE = 41 +PROP_SHARED_SUB_AVAILABLE = 42 + +def gen_byte_prop(identifier, byte): + prop = struct.pack('BB', identifier, byte) + return prop + +def gen_uint16_prop(identifier, word): + prop = struct.pack('!BH', identifier, word) + return prop + +def gen_uint32_prop(identifier, word): + prop = struct.pack('!BI', identifier, word) + return prop + +def gen_string_prop(identifier, s): + s = s.encode("utf-8") + prop = struct.pack('!BH%ds'%(len(s)), identifier, len(s), s) + return prop + +def gen_string_pair_prop(identifier, s1, s2): + s1 = s1.encode("utf-8") + s2 = s2.encode("utf-8") + prop = struct.pack('!BH%dsH%ds'%(len(s1), len(s2)), identifier, len(s1), s1, len(s2), s2) + return prop + +def gen_varint_prop(identifier, val): + v = pack_varint(val) + return struct.pack("!B"+str(len(v))+"s", identifier, v) + +def pack_varint(varint): + s = b"" + while True: + byte = varint % 128 + varint = varint // 128 + # If there are more digits to encode, set the top bit of this digit + if varint > 0: + byte = byte | 0x80 + + s = s + struct.pack("!B", byte) + if varint == 0: + return s + +def prop_finalise(props): + return pack_varint(len(props)) + props + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/mqtt5_rc.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/mqtt5_rc.py new file mode 100644 index 0000000..3987e72 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/mqtt5_rc.py @@ -0,0 +1,46 @@ +MQTT_RC_SUCCESS = 0 +MQTT_RC_NORMAL_DISCONNECTION = 0 +MQTT_RC_GRANTED_QOS0 = 0 +MQTT_RC_GRANTED_QOS1 = 1 +MQTT_RC_GRANTED_QOS2 = 2 +MQTT_RC_DISCONNECT_WITH_WILL_MSG = 4 +MQTT_RC_NO_MATCHING_SUBSCRIBERS = 16 +MQTT_RC_NO_SUBSCRIPTION_EXISTED = 17 +MQTT_RC_CONTINUE_AUTHENTICATION = 24 +MQTT_RC_REAUTHENTICATE = 25 + +MQTT_RC_UNSPECIFIED = 128 +MQTT_RC_MALFORMED_PACKET = 129 +MQTT_RC_PROTOCOL_ERROR = 130 +MQTT_RC_IMPLEMENTATION_SPECIFIC = 131 +MQTT_RC_UNSUPPORTED_PROTOCOL_VERSION = 132 +MQTT_RC_CLIENTID_NOT_VALID = 133 +MQTT_RC_BAD_USERNAME_OR_PASSWORD = 134 +MQTT_RC_NOT_AUTHORIZED = 135 +MQTT_RC_SERVER_UNAVAILABLE = 136 +MQTT_RC_SERVER_BUSY = 137 +MQTT_RC_BANNED = 138 +MQTT_RC_SERVER_SHUTTING_DOWN = 139 +MQTT_RC_BAD_AUTHENTICATION_METHOD = 140 +MQTT_RC_KEEP_ALIVE_TIMEOUT = 141 +MQTT_RC_SESSION_TAKEN_OVER = 142 +MQTT_RC_TOPIC_FILTER_INVALID = 143 +MQTT_RC_TOPIC_NAME_INVALID = 144 +MQTT_RC_PACKET_ID_IN_USE = 145 +MQTT_RC_PACKET_ID_NOT_FOUND = 146 +MQTT_RC_RECEIVE_MAXIMUM_EXCEEDED = 147 +MQTT_RC_TOPIC_ALIAS_INVALID = 148 +MQTT_RC_PACKET_TOO_LARGE = 149 +MQTT_RC_MESSAGE_RATE_TOO_HIGH = 150 +MQTT_RC_QUOTA_EXCEEDED = 151 +MQTT_RC_ADMINISTRATIVE_ACTION = 152 +MQTT_RC_PAYLOAD_FORMAT_INVALID = 153 +MQTT_RC_RETAIN_NOT_SUPPORTED = 154 +MQTT_RC_QOS_NOT_SUPPORTED = 155 +MQTT_RC_USE_ANOTHER_SERVER = 156 +MQTT_RC_SERVER_MOVED = 157 +MQTT_RC_SHARED_SUBS_NOT_SUPPORTED = 158 +MQTT_RC_CONNECTION_RATE_EXCEEDED = 159 +MQTT_RC_MAXIMUM_CONNECT_TIME = 160 +MQTT_RC_SUBSCRIPTION_IDS_NOT_SUPPORTED = 161 +MQTT_RC_WILDCARD_SUBS_NOT_SUPPORTED = 162 diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/old/Makefile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/old/Makefile new file mode 100644 index 0000000..d1f914d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/old/Makefile @@ -0,0 +1,25 @@ +include ../../config.mk + +CC=cc +CFLAGS=-I../../src -I../../lib -I. -I../.. -Wall -ggdb -DDEBUG -DWITH_CLIENT +LDFLAGS= +SOVERSION=1 + +.PHONY: all test clean + +all : msgsps_pub msgsps_sub + +msgsps_pub : msgsps_pub.o + ${CC} $^ -o $@ ../../lib/libmosquitto.so.${SOVERSION} + +msgsps_pub.o : msgsps_pub.c msgsps_common.h + ${CC} $(CFLAGS) -c $< -o $@ + +msgsps_sub : msgsps_sub.o + ${CC} $^ -o $@ ../../lib/libmosquitto.so.${SOVERSION} + +msgsps_sub.o : msgsps_sub.c msgsps_common.h + ${CC} $(CFLAGS) -c $< -o $@ + +clean : + -rm -f *.o msgsps_pub msgsps_sub diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/old/msgsps_common.h b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/old/msgsps_common.h new file mode 100644 index 0000000..5465786 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/old/msgsps_common.h @@ -0,0 +1,9 @@ +#define HOST "127.0.0.1" +#define PORT 1888 + +#define PUB_QOS 1 +#define SUB_QOS 1 + +#define MESSAGE_COUNT 100000L +#define MESSAGE_SIZE 1024L + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/old/msgsps_pub.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/old/msgsps_pub.c new file mode 100644 index 0000000..df4554b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/old/msgsps_pub.c @@ -0,0 +1,81 @@ +/* This provides a crude manner of testing the performance of a broker in messages/s. */ + +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <sys/time.h> +#include <mosquitto.h> + +#include <msgsps_common.h> + +static bool run = true; +static int message_count = 0; +static struct timeval start, stop; + +void my_connect_callback(struct mosquitto *mosq, void *obj, int rc) +{ + printf("rc: %d\n", rc); + gettimeofday(&start, NULL); +} + +void my_disconnect_callback(struct mosquitto *mosq, void *obj, int result) +{ + run = false; +} + +void my_publish_callback(struct mosquitto *mosq, void *obj, int mid) +{ + message_count++; + if(message_count == MESSAGE_COUNT){ + gettimeofday(&stop, NULL); + mosquitto_disconnect((struct mosquitto *)obj); + } +} + +int main(int argc, char *argv[]) +{ + struct mosquitto *mosq; + int i; + double dstart, dstop, diff; + uint8_t *buf; + + buf = malloc(MESSAGE_SIZE*MESSAGE_COUNT); + if(!buf){ + printf("Error: Out of memory.\n"); + return 1; + } + + start.tv_sec = 0; + start.tv_usec = 0; + stop.tv_sec = 0; + stop.tv_usec = 0; + + mosquitto_lib_init(); + + mosq = mosquitto_new("perftest", true, NULL); + mosquitto_connect_callback_set(mosq, my_connect_callback); + mosquitto_disconnect_callback_set(mosq, my_disconnect_callback); + mosquitto_publish_callback_set(mosq, my_publish_callback); + + mosquitto_connect(mosq, HOST, PORT, 600); + + mosquitto_loop_start(mosq); + + i=0; + for(i=0; i<MESSAGE_COUNT; i++){ + mosquitto_publish(mosq, NULL, "perf/test", MESSAGE_SIZE, &buf[i*MESSAGE_SIZE], PUB_QOS, false); + } + mosquitto_loop_stop(mosq, false); + + dstart = (double)start.tv_sec*1.0e6 + (double)start.tv_usec; + dstop = (double)stop.tv_sec*1.0e6 + (double)stop.tv_usec; + diff = (dstop-dstart)/1.0e6; + + printf("Start: %g\nStop: %g\nDiff: %g\nMessages/s: %g\n", dstart, dstop, diff, (double)MESSAGE_COUNT/diff); + + mosquitto_destroy(mosq); + mosquitto_lib_cleanup(); + + return 0; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/old/msgsps_sub.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/old/msgsps_sub.c new file mode 100644 index 0000000..3156d74 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/old/msgsps_sub.c @@ -0,0 +1,82 @@ +/* This provides a crude manner of testing the performance of a broker in messages/s. */ + +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <sys/time.h> +#include <unistd.h> +#include <mosquitto.h> + +#include <msgsps_common.h> + +static bool run = true; +static int message_count = 0; +static struct timeval start, stop; +FILE *fptr = NULL; + + +void my_connect_callback(struct mosquitto *mosq, void *obj, int rc) +{ + printf("rc: %d\n", rc); +} + +void my_disconnect_callback(struct mosquitto *mosq, void *obj, int result) +{ + run = false; +} + +void my_message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *msg) +{ + if(message_count == 0){ + gettimeofday(&start, NULL); + } + //fwrite(msg->payload, sizeof(uint8_t), msg->payloadlen, fptr); + message_count++; + if(message_count == MESSAGE_COUNT){ + gettimeofday(&stop, NULL); + mosquitto_disconnect((struct mosquitto *)obj); + } +} + +int main(int argc, char *argv[]) +{ + struct mosquitto *mosq; + double dstart, dstop, diff; + int mid = 0; + char id[50]; + + start.tv_sec = 0; + start.tv_usec = 0; + stop.tv_sec = 0; + stop.tv_usec = 0; + + fptr = fopen("msgsps_sub.dat", "wb"); + if(!fptr){ + printf("Error: Unable to write to msgsps_sub.dat.\n"); + return 1; + } + mosquitto_lib_init(); + + snprintf(id, 50, "msgps_sub_%d", getpid()); + mosq = mosquitto_new(id, true, NULL); + mosquitto_connect_callback_set(mosq, my_connect_callback); + mosquitto_disconnect_callback_set(mosq, my_disconnect_callback); + mosquitto_message_callback_set(mosq, my_message_callback); + + mosquitto_connect(mosq, HOST, PORT, 600); + mosquitto_subscribe(mosq, &mid, "perf/test", SUB_QOS); + + mosquitto_loop_forever(mosq, 10, 1); + + dstart = (double)start.tv_sec*1.0e6 + (double)start.tv_usec; + dstop = (double)stop.tv_sec*1.0e6 + (double)stop.tv_usec; + diff = (dstop-dstart)/1.0e6; + + printf("Start: %g\nStop: %g\nDiff: %g\nMessages/s: %g\n", dstart, dstop, diff, (double)MESSAGE_COUNT/diff); + + mosquitto_destroy(mosq); + mosquitto_lib_cleanup(); + fclose(fptr); + + return 0; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ptest.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ptest.py new file mode 100755 index 0000000..233f609 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ptest.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python3 + +import subprocess +import time +import sys + +def next_test(tests, ports): + if len(tests) == 0 or len(ports) == 0: + return + + test = tests.pop() + proc_ports = () + + if len(ports) < test[0]: + tests.insert(0, test) + return None + else: + if isinstance(test[1], (list,)): + args = test[1] + else: + args = [test[1]] + + for i in range(0, test[0]): + proc_port = ports.pop() + proc_ports = proc_ports + (proc_port,) + args.append(str(proc_port)) + + proc = subprocess.Popen(args) + proc.start_time = time.time() + proc.mosq_port = proc_ports + return proc + + +def run_tests(tests, minport=1888, max_running=20): + ports = list(range(minport, minport+max_running+1)) + start_time = time.time() + passed = 0 + failed = 0 + + failed_tests = [] + + running_tests = [] + while len(tests) > 0 or len(running_tests) > 0: + if len(running_tests) <= max_running: + t = next_test(tests, ports) + if t is None: + time.sleep(0.1) + else: + running_tests.append(t) + + for t in running_tests: + t.poll() + if t.returncode is not None: + running_tests.remove(t) + if isinstance(t.mosq_port, tuple): + for portret in t.mosq_port: + ports.append(portret) + else: + ports.append(t.mosq_port) + t.terminate() + t.wait() + runtime = time.time() - t.start_time + #(stdo, stde) = t.communicate() + if t.returncode == 1: + print("%0.3fs : \033[31m%s\033[0m" % (runtime, t.args[0])) + failed = failed + 1 + failed_tests.append(t.args[0]) + else: + passed = passed + 1 + print("%0.3fs : \033[32m%s\033[0m" % (runtime, t.args[0])) + + print("Passed: %d\nFailed: %d\nTotal: %d\nTotal time: %0.2f" % (passed, failed, passed+failed, time.time()-start_time)) + if failed > 0: + print("Failing tests:") + for f in failed_tests: + print(f) + sys.exit(1) + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/Makefile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/Makefile new file mode 100644 index 0000000..87477d4 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/Makefile @@ -0,0 +1,26 @@ +include ../../config.mk + +.PHONY: all test + +ifeq ($(WITH_SHARED_LIBRARIES),yes) +LIB_DEP:=../../lib/libmosquitto.so.${SOVERSION} +else +LIB_DEP:=../../lib/libmosquitto.a +endif + +all : auth_plugin.so + +auth_plugin.so : auth_plugin.c + $(CC) ${CFLAGS} -fPIC -shared $< -o $@ -I../../lib -I../../src + +../lib/libmosquitto.so.${SOVERSION} : + $(MAKE) -C ../../lib + +../lib/libmosquitto.a : + $(MAKE) -C ../../lib libmosquitto.a + +clean : + -rm -f *.o random_client *.gcda *.gcno + +test : all + ./test.py diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/auth_plugin.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/auth_plugin.c new file mode 100644 index 0000000..0df05e6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/auth_plugin.c @@ -0,0 +1,56 @@ +#include <stdio.h> +#include <stdlib.h> +#include <time.h> +#include <mosquitto.h> +#include <mosquitto_broker.h> +#include <mosquitto_plugin.h> + +int mosquitto_auth_plugin_version(void) +{ + return MOSQ_AUTH_PLUGIN_VERSION; +} + +int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + srandom(time(NULL)); + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg) +{ + if(random() % 2 == 0){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_ACL_DENIED; + } +} + +int mosquitto_auth_unpwd_check(void *user_data, struct mosquitto *client, const char *username, const char *password) +{ + if(random() % 2 == 0){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_AUTH; + } +} + +int mosquitto_auth_psk_key_get(void *user_data, struct mosquitto *client, const char *hint, const char *identity, char *key, int max_key_len) +{ + return MOSQ_ERR_AUTH; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/pwfile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/pwfile new file mode 100644 index 0000000..9556df9 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/pwfile @@ -0,0 +1 @@ +test:$6$cBP7e6sUriMSh8yf$+Z3E9P1g+Hui8zDJA+XJpTHl6+0eym0MtWokmOY4j1svAR5RtjZoXB4OQuHYzrGrdp1e8gXoqcKlcP+1lmepmg== diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/random.conf b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/random.conf new file mode 100644 index 0000000..171923b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/random.conf @@ -0,0 +1,92 @@ +per_listener_settings true + +# Unencrypted MQTT over TCP +listener 1883 + +listener 1884 +password_file pwfile + +listener 1885 +auth_plugin ./auth_plugin.so + +listener 1886 +password_file pwfile +auth_plugin ./auth_plugin.so + + +# Encrypted MQTT over TCP +listener 8883 +cafile ../ssl/all-ca.crt +certfile ../ssl/server.crt +keyfile ../ssl/server.key + +listener 8884 +cafile ../ssl/all-ca.crt +certfile ../ssl/server.crt +keyfile ../ssl/server.key +password_file pwfile + +listener 8885 +cafile ../ssl/all-ca.crt +certfile ../ssl/server.crt +keyfile ../ssl/server.key +auth_plugin ./auth_plugin.so + +listener 8886 +cafile ../ssl/all-ca.crt +certfile ../ssl/server.crt +keyfile ../ssl/server.key +password_file pwfile +auth_plugin ./auth_plugin.so + + +# Unencrypted MQTT over WebSockets +listener 8000 +protocol websockets + +listener 8001 +protocol websockets +password_file pwfile + +listener 8002 +protocol websockets +auth_plugin ./auth_plugin.so + +listener 8003 +protocol websockets +password_file pwfile +auth_plugin ./auth_plugin.so + + +# Encrypted MQTT over WebSockets +listener 4430 +protocol websockets +cafile ../ssl/all-ca.crt +certfile ../ssl/server.crt +keyfile ../ssl/server.key + +listener 4431 +protocol websockets +cafile ../ssl/all-ca.crt +certfile ../ssl/server.crt +keyfile ../ssl/server.key +password_file pwfile + +listener 4432 +protocol websockets +cafile ../ssl/all-ca.crt +certfile ../ssl/server.crt +keyfile ../ssl/server.key +auth_plugin ./auth_plugin.so + +listener 4433 +protocol websockets +cafile ../ssl/all-ca.crt +certfile ../ssl/server.crt +keyfile ../ssl/server.key +password_file pwfile +auth_plugin ./auth_plugin.so + + +#log_dest file mosquitto.log +#log_type all diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/random_client.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/random_client.py new file mode 100755 index 0000000..6206485 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/random_client.py @@ -0,0 +1,150 @@ +#!/usr/bin/env python3 + +import paho.mqtt.client as paho +import random +import sys +import time + +# This is a client that carries out randomised behaviour. It is intended for +# use with the local config file. This file has multiple listeners configured: +# * 1883 - unencrypted MQTT over TCP with no authentication +# * 1884 - unencrypted MQTT over TCP with password authentication +# * 1885 - unencrypted MQTT over TCP with plugin authentication +# * 1886 - unencrypted MQTT over TCP with password and plugin authentication +# +# * 8883 - encrypted MQTT over TCP with no authentication +# * 8884 - encrypted MQTT over TCP with password authentication +# * 8885 - encrypted MQTT over TCP with plugin authentication +# * 8886 - encrypted MQTT over TCP with password and plugin authentication +# +# * 8000 - unencrypted MQTT over WebSockets with no authentication +# * 8001 - unencrypted MQTT over WebSockets with password authentication +# * 8002 - unencrypted MQTT over WebSockets with plugin authentication +# * 8003 - unencrypted MQTT over WebSockets with password and plugin authentication +# +# * 4430 - encrypted MQTT over WebSockets with no authentication +# * 4431 - encrypted MQTT over WebSockets with password authentication +# * 4432 - encrypted MQTT over WebSockets with plugin authentication +# * 4433 - encrypted MQTT over WebSockets with password and plugin authentication +# +# The client randomly picks: +# * A port out of the list +# * Whether to use encryption +# * Whether to use WebSockets +# * Clean start or not +# * Session expiry interval or not +# * QoS to use when subscribing - topics "outgoing/[client id]/message" and "response/#" +# * Lifetime of connection +# On a per publish message basis it chooses: +# * QoS of message +# * Topic of message "outgoing/[0-max client]/message" +# * Retain +# * Interval until next outgoing message + +ports = [ + {"port":1883, "tls":False, "transport":"tcp", "auth":False}, + {"port":1884, "tls":False, "transport":"tcp", "auth":True}, + {"port":1885, "tls":False, "transport":"tcp", "auth":True}, + {"port":1886, "tls":False, "transport":"tcp", "auth":True}, + + {"port":8883, "tls":True, "transport":"tcp", "auth":False}, + {"port":8884, "tls":True, "transport":"tcp", "auth":True}, + {"port":8885, "tls":True, "transport":"tcp", "auth":True}, + {"port":8886, "tls":True, "transport":"tcp", "auth":True}, + + {"port":8000, "tls":False, "transport":"websockets", "auth":False}, + {"port":8001, "tls":False, "transport":"websockets", "auth":True}, + {"port":8002, "tls":False, "transport":"websockets", "auth":True}, + {"port":8003, "tls":False, "transport":"websockets", "auth":True}, + + {"port":4430, "tls":True, "transport":"websockets", "auth":False}, + {"port":4431, "tls":True, "transport":"websockets", "auth":True}, + {"port":4432, "tls":True, "transport":"websockets", "auth":True}, + {"port":4433, "tls":True, "transport":"websockets", "auth":True}, + ] + +booleans = [True, False] +qos_values = [0, 1, 2] + + +def on_connect(client, userdata, flags, rc): + global running + if rc == 0: + client.subscribe("response/#", subscribe_qos) + client.subscribe("outgoing/%s/message" % (client_id), subscribe_qos) + else: + running = False + + +def on_message(client, userdata, msg): + pass + + +def on_publish(client, userdata, mid): + pass + + +def on_disconnect(client, userdata, rc): + running = False + + +def do_publish(client): + retain = random.choice(booleans) + qos = random.choice(qos_values) + topic = "outgoing/%d/message" % (random.uniform(1, 1000)) + payload = "message" + + client.publish(topic, payload, qos, retain) + + next_publish_time = time.time() + random.uniform(0.1, 2.0) + + +def main(): + global running + global lifetime + + mqttc = paho.Client(client_id, clean_session=clean_start, protocol=protocol, transport=transport) + mqttc.on_message = on_message + mqttc.on_publish = on_publish + mqttc.on_connect = on_connect + mqttc.on_disconnect = on_disconnect + if auth and random.choice(booleans): + if random.choice(booleans): + mqttc.username_pw_set("test", "password") + else: + mqttc.username_pw_set("bad", "bad") + + if use_tls: + mqttc.tls_set(ca_certs="../ssl/all-ca.crt") + + mqttc.connect("localhost", port) + mqttc.loop_start() + + while running: + time.sleep(0.1) + now = time.time() + if now > next_publish_time: + do_publish(mqttc) + if now > lifetime: + if random.choice(booleans): + mqttc.disconnect() + lifetime += 5.0 + else: + running = False + + +p = random.choice(ports) +port = p["port"] +use_tls = p["tls"] +transport = p["transport"] +auth = p["auth"] + +client_id = "cid"+sys.argv[1] +clean_start = random.choice(booleans) +subscribe_qos = random.choice(qos_values) +protocol = paho.MQTTv311 +next_publish_time = time.time() + random.uniform(0.1, 2.0) +lifetime = time.time() + random.uniform(5.0, 10.0) +running = True + +main() diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/test.py b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/test.py new file mode 100755 index 0000000..6d05818 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/random/test.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 + +import subprocess +import time +import sys + +def next_client(clients): + if len(clients) == 0: + return + + c = clients.pop() + args = ["./random_client.py", str(c)] + + proc = subprocess.Popen(args, stderr=subprocess.DEVNULL) + proc.cid = c + return proc + + +def run_clients(max_clients): + clients = list(range(1, max_clients)) + start_time = time.time() + + running_clients = [] + while True: + print(len(running_clients)) + if len(running_clients) < max_clients: + c = next_client(clients) + if c is not None: + running_clients.append(c) + else: + time.sleep(0.1) + + for c in running_clients: + c.poll() + if c.returncode is not None: + running_clients.remove(c) + clients.append(c.cid) + c.terminate() + c.wait() + + +env = {} +env["LD_LIBRARY_PATH"] = "../../lib" + +#broker = subprocess.Popen(["../../src/mosquitto", "-c", "random.conf"], env=env) +run_clients(1000) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/all-ca.crt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/all-ca.crt new file mode 100644 index 0000000..8ca6f20 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/all-ca.crt @@ -0,0 +1,75 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=GB, ST=Derbyshire, L=Derby, O=Mosquitto Project, OU=Testing, CN=Root CA + Validity + Not Before: Sep 18 10:49:47 2018 GMT + Not After : Sep 17 10:49:47 2023 GMT + Subject: C=GB, ST=Derbyshire, O=Mosquitto Project, OU=Testing, CN=Signing CA + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (1024 bit) + Modulus: + 00:b7:32:f2:08:04:4c:77:03:70:3e:10:88:84:cd: + cd:f2:87:2f:3c:67:8f:78:01:5e:d5:51:f1:11:68: + 4d:a7:e2:73:b0:69:b5:67:07:59:88:cc:b8:7f:ce: + 97:52:bc:fb:73:7b:60:95:a2:7b:c2:9a:f1:4d:5a: + c4:42:55:c4:6e:02:50:a1:71:41:68:d1:6c:96:e0: + 3d:af:10:3f:7b:64:c1:3a:3a:c3:a9:39:71:08:29: + 45:c8:cc:da:33:65:b4:70:fb:36:bc:15:0d:a7:31: + ef:d5:ec:59:ac:75:2b:77:35:0b:f0:db:3d:14:f5: + 9a:41:e6:a0:b7:b7:62:2b:e7 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + EE:60:BB:C7:17:5F:D3:72:AC:33:EE:8E:84:CC:2D:DB:1A:CC:8A:52 + X509v3 Authority Key Identifier: + keyid:DA:20:AB:E0:98:22:39:28:E0:70:D6:74:65:53:26:E0:6B:4C:96:39 + + X509v3 Basic Constraints: + CA:TRUE + Signature Algorithm: sha256WithRSAEncryption + 8a:98:17:cd:e1:dc:2b:1b:5b:16:40:99:21:c4:d4:db:3f:5c: + 6a:ed:7b:a2:b6:df:aa:7c:d8:6a:3f:11:39:da:4c:ce:3f:e5: + 99:6a:a4:b8:82:1e:53:7a:5d:f1:52:be:df:f1:3b:59:9a:a8: + bb:7e:f1:30:33:4b:7c:c3:ab:85:1e:c4:0e:ac:d1:7e:2b:cb: + 9d:19:5b:df:94:b4:89:e1:da:5d:31:19:85:34:d5:33:55:f8: + af:92:ea:9a:17:c9:da:68:00:df:10:e9:e4:33:35:cd:15:57: + 80:56:1a:58:94:37:d7:f2:02:de:9b:0b:d3:02:64:c5:8e:6f: + 25:31 +-----BEGIN CERTIFICATE----- +MIICnTCCAgagAwIBAgIBATANBgkqhkiG9w0BAQsFADByMQswCQYDVQQGEwJHQjET +MBEGA1UECAwKRGVyYnlzaGlyZTEOMAwGA1UEBwwFRGVyYnkxGjAYBgNVBAoMEU1v +c3F1aXR0byBQcm9qZWN0MRAwDgYDVQQLDAdUZXN0aW5nMRAwDgYDVQQDDAdSb290 +IENBMB4XDTE4MDkxODEwNDk0N1oXDTIzMDkxNzEwNDk0N1owZTELMAkGA1UEBhMC +R0IxEzARBgNVBAgMCkRlcmJ5c2hpcmUxGjAYBgNVBAoMEU1vc3F1aXR0byBQcm9q +ZWN0MRAwDgYDVQQLDAdUZXN0aW5nMRMwEQYDVQQDDApTaWduaW5nIENBMIGfMA0G +CSqGSIb3DQEBAQUAA4GNADCBiQKBgQC3MvIIBEx3A3A+EIiEzc3yhy88Z494AV7V +UfERaE2n4nOwabVnB1mIzLh/zpdSvPtze2CVonvCmvFNWsRCVcRuAlChcUFo0WyW +4D2vED97ZME6OsOpOXEIKUXIzNozZbRw+za8FQ2nMe/V7FmsdSt3NQvw2z0U9ZpB +5qC3t2Ir5wIDAQABo1AwTjAdBgNVHQ4EFgQU7mC7xxdf03KsM+6OhMwt2xrMilIw +HwYDVR0jBBgwFoAU2iCr4JgiOSjgcNZ0ZVMm4GtMljkwDAYDVR0TBAUwAwEB/zAN +BgkqhkiG9w0BAQsFAAOBgQCKmBfN4dwrG1sWQJkhxNTbP1xq7Xuitt+qfNhqPxE5 +2kzOP+WZaqS4gh5Tel3xUr7f8TtZmqi7fvEwM0t8w6uFHsQOrNF+K8udGVvflLSJ +4dpdMRmFNNUzVfivkuqaF8naaADfEOnkMzXNFVeAVhpYlDfX8gLemwvTAmTFjm8l +MQ== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICsjCCAhugAwIBAgIJAOcAUKw/VPlMMA0GCSqGSIb3DQEBCwUAMHIxCzAJBgNV +BAYTAkdCMRMwEQYDVQQIDApEZXJieXNoaXJlMQ4wDAYDVQQHDAVEZXJieTEaMBgG +A1UECgwRTW9zcXVpdHRvIFByb2plY3QxEDAOBgNVBAsMB1Rlc3RpbmcxEDAOBgNV +BAMMB1Jvb3QgQ0EwHhcNMTgwOTE4MTA0OTQ3WhcNMjgwOTE1MTA0OTQ3WjByMQsw +CQYDVQQGEwJHQjETMBEGA1UECAwKRGVyYnlzaGlyZTEOMAwGA1UEBwwFRGVyYnkx +GjAYBgNVBAoMEU1vc3F1aXR0byBQcm9qZWN0MRAwDgYDVQQLDAdUZXN0aW5nMRAw +DgYDVQQDDAdSb290IENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCeTh1y +KRZ1NIeLVvhBxSQC3Cvfe9L3IC8415CVbgipLgZKe7Nl1JBqFYDxXKBn2eVQ6EwL +sCz+U2oa2oCql8r5eYEKpmWFiIcKdrL8aSXNvMKEOu0AJlsIXBe2sDFPxuuw143n +W/odqBiWedciVd5pmJWZZ93neWdkkjnPZZMN4wIDAQABo1AwTjAdBgNVHQ4EFgQU +2iCr4JgiOSjgcNZ0ZVMm4GtMljkwHwYDVR0jBBgwFoAU2iCr4JgiOSjgcNZ0ZVMm +4GtMljkwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOBgQBIs2GY/GQL76rz ++0qSWZvQ7l+HovHdp7C49auI+hiSRAzv3p2y7y3DmZrpmYJlTZJWlaA8eg769sLg +Cyfkt6AIsZPadJiTTUayh8oCF5aMH+OetC+63USFBNYXJN6AOXp9vu/K3TdM8ao6 +WsAf26+DKYAPmvu+oU7ScpCrCSdC+Q== +-----END CERTIFICATE----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client-encrypted.crt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client-encrypted.crt new file mode 100644 index 0000000..fa0ca02 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client-encrypted.crt @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 5 (0x5) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=GB, ST=Derbyshire, O=Mosquitto Project, OU=Testing, CN=Signing CA + Validity + Not Before: Sep 18 10:50:08 2018 GMT + Not After : Sep 17 10:50:08 2023 GMT + Subject: C=GB, ST=Nottinghamshire, L=Nottingham, O=Server, OU=Production, CN=test client encrypted + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (1024 bit) + Modulus: + 00:b6:a9:fe:16:1b:58:bb:96:6c:6e:a4:cf:39:60: + d0:0a:8c:18:9c:0c:75:eb:6f:5b:31:f9:1f:15:a5: + c8:7b:85:c1:cc:fc:1b:72:ba:af:ef:08:b8:e6:31: + bb:e7:20:cb:6a:f1:af:9c:db:df:12:71:3c:d2:98: + fb:14:dd:87:63:ed:6f:49:ab:30:12:aa:45:ab:ad: + 50:21:84:b5:9d:3e:b1:36:8e:92:87:e6:ee:b5:3b: + 9e:da:25:88:74:d9:28:c8:1f:6c:93:29:e7:1d:14: + dc:dc:14:72:1f:b9:84:32:a1:09:d7:cc:e5:21:a8: + 30:8c:d7:73:d7:b1:6f:2d:b7 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: + CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + CD:6E:DB:18:BC:30:76:0F:58:6D:6A:5A:1D:3E:AB:0B:D0:DB:BA:8C + X509v3 Authority Key Identifier: + keyid:EE:60:BB:C7:17:5F:D3:72:AC:33:EE:8E:84:CC:2D:DB:1A:CC:8A:52 + + Signature Algorithm: sha256WithRSAEncryption + 34:91:a4:18:93:ce:b6:8d:2a:17:c4:cc:48:34:3f:00:99:4f: + c2:2a:23:47:2f:75:fe:ef:34:da:39:12:16:63:86:9b:eb:30: + b3:d7:26:ff:96:4b:d6:00:c9:71:05:5d:08:c7:e1:52:70:d1: + ab:55:4f:2b:da:a7:ae:47:6d:b7:5d:84:2c:5e:c6:2a:3e:81: + 63:55:99:3f:8b:e1:43:a4:0a:5a:34:4e:50:3e:f8:0a:76:53: + 6b:e0:fc:42:14:b0:7e:ce:25:17:19:b9:d9:8b:dd:99:be:7e: + 6a:a9:7f:ae:d8:a3:7b:c6:48:7a:04:75:3b:8f:6b:85:c1:f0: + 43:18 +-----BEGIN CERTIFICATE----- +MIIC2TCCAkKgAwIBAgIBBTANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQGEwJHQjET +MBEGA1UECAwKRGVyYnlzaGlyZTEaMBgGA1UECgwRTW9zcXVpdHRvIFByb2plY3Qx +EDAOBgNVBAsMB1Rlc3RpbmcxEzARBgNVBAMMClNpZ25pbmcgQ0EwHhcNMTgwOTE4 +MTA1MDA4WhcNMjMwOTE3MTA1MDA4WjCBgjELMAkGA1UEBhMCR0IxGDAWBgNVBAgM +D05vdHRpbmdoYW1zaGlyZTETMBEGA1UEBwwKTm90dGluZ2hhbTEPMA0GA1UECgwG +U2VydmVyMRMwEQYDVQQLDApQcm9kdWN0aW9uMR4wHAYDVQQDDBV0ZXN0IGNsaWVu +dCBlbmNyeXB0ZWQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALap/hYbWLuW +bG6kzzlg0AqMGJwMdetvWzH5HxWlyHuFwcz8G3K6r+8IuOYxu+cgy2rxr5zb3xJx +PNKY+xTdh2Ptb0mrMBKqRautUCGEtZ0+sTaOkofm7rU7ntoliHTZKMgfbJMp5x0U +3NwUch+5hDKhCdfM5SGoMIzXc9exby23AgMBAAGjezB5MAkGA1UdEwQCMAAwLAYJ +YIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1Ud +DgQWBBTNbtsYvDB2D1htalodPqsL0Nu6jDAfBgNVHSMEGDAWgBTuYLvHF1/Tcqwz +7o6EzC3bGsyKUjANBgkqhkiG9w0BAQsFAAOBgQA0kaQYk862jSoXxMxIND8AmU/C +KiNHL3X+7zTaORIWY4ab6zCz1yb/lkvWAMlxBV0Ix+FScNGrVU8r2qeuR223XYQs +XsYqPoFjVZk/i+FDpApaNE5QPvgKdlNr4PxCFLB+ziUXGbnZi92Zvn5qqX+u2KN7 +xkh6BHU7j2uFwfBDGA== +-----END CERTIFICATE----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client-encrypted.key b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client-encrypted.key new file mode 100644 index 0000000..c6325d8 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client-encrypted.key @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,A17E5BCB1FEA5A08 + +bK5ojhRrYmfh0nhgiLPZoGT6i6NqLoVmHrtxJBumois0wznY0n693KktYs4bIikl +YG5xGU+oOyuPCsi6NH/krIuDpzZzN8r6lTNX3b9BQdiEEL02QO9RJ/qjBz7OqNJF +QrtBZQiXpXw3GgkB9CCnLYV8MzEeEWFJnRifKYZLSN8kEdcekudm7m+ih/yLzoFH +MsnWR52uSVv58vOPqsGSXT5mvIWxZIeHBF5qSgre55rZjzzj5dn3PM/wBOeFIwep +ZWQlm/Y3cg+cpBBe9GRkC+E0WA7iHmBL7WIvuiGq8EHq/LkPsNVPuL4K9YjXL7fH +GSIvJqNq6cZb/dSxHY+8rgckZpnE4y/QH5xRmN43T9uzsno1nkRmojm61M3viObJ +85dlaagMrBgatJABmbtvUzRYQqabFG0R4xcITuZFxWaBZFAWzpn6C65adtN4myoU +nREOHXVWX+oz6E8vZbCaEPH21d8No6geH6+RhRoe+49gnodf57ZY/tlHz+4TL2lP +UQRcEGnZCXHRUZ0lg1eqs50/HB37GMs15pKA+4Bw42eRYQiUbYErsGtzFQPYsLYP +jPyoK5dvq0ZdVOSw8wnIMVX0LgI6v8G9i5R4AOLGHigkUBApwtHA22f+6ubZP/tQ +QHZGBZgpxhwe1aRPGmra6GGpDzzg61zFIulSowt1TXYtzj1CNHCVFMt5DF93bSo6 +g0i9O6fiw6DbX3gB587jvqSgiI2ia+5AA9hrG/Nld9wIH2kvtEa9IUNg97bl+GTr +uen5Y2xlA7Q3HVsxAU9W1CzBIFJYdDBYVkrKHPlKt6HAp5m4NEy+2g== +-----END RSA PRIVATE KEY----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client-expired.crt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client-expired.crt new file mode 100644 index 0000000..3992793 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client-expired.crt @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 3 (0x3) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=GB, ST=Derbyshire, O=Mosquitto Project, OU=Testing, CN=Signing CA + Validity + Not Before: Aug 20 00:00:00 2012 GMT + Not After : Aug 21 00:00:00 2012 GMT + Subject: C=GB, ST=Nottinghamshire, L=Nottingham, O=Server, OU=Production, CN=test client expired + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (1024 bit) + Modulus: + 00:cf:a2:94:2e:b7:84:9f:ec:67:86:ce:6a:71:75: + 6a:9d:9a:a3:69:2b:83:8e:a8:23:05:51:bc:ab:98: + 1e:01:bc:06:03:26:bd:34:ec:52:15:a7:4b:45:a5: + 62:f4:3c:c1:95:fe:7b:07:16:f7:03:ae:9a:19:4b: + a2:b9:49:80:5d:63:8b:a8:cb:d4:ed:86:9d:da:71: + 4f:15:6f:c5:0d:c6:81:cb:ad:57:75:7c:d9:2e:65: + a7:86:a4:8f:84:70:0d:c5:3a:53:6c:da:29:a3:1d: + b2:ac:4b:a0:86:7f:f3:16:2e:8d:99:dd:44:30:2b: + 81:89:e3:ae:79:b8:d7:ae:e9 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: + CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + FB:66:3B:5D:45:33:5B:61:14:52:C0:E4:04:FF:12:73:AD:B3:9B:56 + X509v3 Authority Key Identifier: + keyid:EE:60:BB:C7:17:5F:D3:72:AC:33:EE:8E:84:CC:2D:DB:1A:CC:8A:52 + + Signature Algorithm: sha256WithRSAEncryption + 80:89:73:0e:35:ea:ce:88:27:9e:71:7a:6c:13:46:2f:e9:cd: + 2a:04:6d:86:98:83:e3:0d:c3:d4:75:9d:6a:96:ec:b4:92:d0: + 7a:3f:f5:e2:84:bb:67:3e:1f:9f:f6:3b:b4:98:2d:17:7f:c6: + 2b:27:8f:4d:e1:4b:5c:7e:ae:e6:e6:e8:b7:82:3f:50:4b:78: + af:ae:2f:13:bf:c6:f1:f1:95:16:c2:46:73:8d:d9:3e:25:cd: + 90:15:e3:63:7d:0a:a2:19:f8:00:70:1e:7a:a1:a6:4e:3c:79: + b9:e1:66:7c:fd:67:40:69:c5:6b:3a:15:55:81:10:b6:4d:d2: + 22:b1 +-----BEGIN CERTIFICATE----- +MIIC1zCCAkCgAwIBAgIBAzANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQGEwJHQjET +MBEGA1UECAwKRGVyYnlzaGlyZTEaMBgGA1UECgwRTW9zcXVpdHRvIFByb2plY3Qx +EDAOBgNVBAsMB1Rlc3RpbmcxEzARBgNVBAMMClNpZ25pbmcgQ0EwHhcNMTIwODIw +MDAwMDAwWhcNMTIwODIxMDAwMDAwWjCBgDELMAkGA1UEBhMCR0IxGDAWBgNVBAgM +D05vdHRpbmdoYW1zaGlyZTETMBEGA1UEBwwKTm90dGluZ2hhbTEPMA0GA1UECgwG +U2VydmVyMRMwEQYDVQQLDApQcm9kdWN0aW9uMRwwGgYDVQQDDBN0ZXN0IGNsaWVu +dCBleHBpcmVkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPopQut4Sf7GeG +zmpxdWqdmqNpK4OOqCMFUbyrmB4BvAYDJr007FIVp0tFpWL0PMGV/nsHFvcDrpoZ +S6K5SYBdY4uoy9Tthp3acU8Vb8UNxoHLrVd1fNkuZaeGpI+EcA3FOlNs2imjHbKs +S6CGf/MWLo2Z3UQwK4GJ4655uNeu6QIDAQABo3sweTAJBgNVHRMEAjAAMCwGCWCG +SAGG+EIBDQQfFh1PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4E +FgQU+2Y7XUUzW2EUUsDkBP8Sc62zm1YwHwYDVR0jBBgwFoAU7mC7xxdf03KsM+6O +hMwt2xrMilIwDQYJKoZIhvcNAQELBQADgYEAgIlzDjXqzognnnF6bBNGL+nNKgRt +hpiD4w3D1HWdapbstJLQej/14oS7Zz4fn/Y7tJgtF3/GKyePTeFLXH6u5ubot4I/ +UEt4r64vE7/G8fGVFsJGc43ZPiXNkBXjY30Kohn4AHAeeqGmTjx5ueFmfP1nQGnF +azoVVYEQtk3SIrE= +-----END CERTIFICATE----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client-revoked.crt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client-revoked.crt new file mode 100644 index 0000000..f6f10e6 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client-revoked.crt @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4 (0x4) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=GB, ST=Derbyshire, O=Mosquitto Project, OU=Testing, CN=Signing CA + Validity + Not Before: Sep 18 10:49:58 2018 GMT + Not After : Sep 17 10:49:58 2023 GMT + Subject: C=GB, ST=Nottinghamshire, L=Nottingham, O=Server, OU=Production, CN=test client revoked + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (1024 bit) + Modulus: + 00:cf:30:dc:74:50:c8:4b:4c:0f:c5:15:b1:cc:f4: + 2d:c1:f2:f5:14:16:d3:c9:ff:82:0e:56:f2:98:8b: + 6d:d5:b9:c8:95:fa:33:cc:b3:9e:26:1d:5f:2a:0d: + ce:8d:49:02:f3:6e:a5:c6:90:26:e3:15:4e:d2:bf: + 22:ac:1c:25:5b:b1:06:aa:03:6a:b9:d8:e6:09:e2: + f6:31:e9:e2:76:08:b9:5a:a6:9d:a2:f2:ca:ec:f1: + 97:87:a1:5c:14:4a:06:44:77:1d:13:36:43:b8:36: + bf:6d:6f:0a:c1:91:a6:0b:ea:37:34:08:7b:2d:9f: + e0:ec:ba:5d:52:77:9e:a0:9f + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: + CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + 56:B4:1E:17:B3:35:C7:16:DB:45:A5:76:40:73:3E:C3:EA:42:5D:F8 + X509v3 Authority Key Identifier: + keyid:EE:60:BB:C7:17:5F:D3:72:AC:33:EE:8E:84:CC:2D:DB:1A:CC:8A:52 + + Signature Algorithm: sha256WithRSAEncryption + b5:42:ed:22:06:a9:6d:55:e7:72:c2:09:cf:05:6d:f1:cb:2b: + ae:38:24:63:b4:e2:f3:d6:13:ab:85:08:3f:e1:6e:e4:f4:2c: + 30:7b:cd:ec:be:1d:c1:a6:4b:53:f6:0d:13:55:ef:10:60:b5: + 85:72:b8:85:34:82:28:97:4c:d8:0e:70:7f:4a:b2:ec:ec:13: + 50:14:53:94:ae:04:e3:bf:c8:02:19:ce:9e:d4:85:2a:59:27: + 9b:dc:e7:5f:5a:c7:83:2e:fb:2b:47:e4:51:11:6f:ad:51:bb: + 2e:85:2c:7c:a7:c3:a9:db:72:ab:54:93:f7:70:9e:9b:9c:50: + 20:73 +-----BEGIN CERTIFICATE----- +MIIC1zCCAkCgAwIBAgIBBDANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQGEwJHQjET +MBEGA1UECAwKRGVyYnlzaGlyZTEaMBgGA1UECgwRTW9zcXVpdHRvIFByb2plY3Qx +EDAOBgNVBAsMB1Rlc3RpbmcxEzARBgNVBAMMClNpZ25pbmcgQ0EwHhcNMTgwOTE4 +MTA0OTU4WhcNMjMwOTE3MTA0OTU4WjCBgDELMAkGA1UEBhMCR0IxGDAWBgNVBAgM +D05vdHRpbmdoYW1zaGlyZTETMBEGA1UEBwwKTm90dGluZ2hhbTEPMA0GA1UECgwG +U2VydmVyMRMwEQYDVQQLDApQcm9kdWN0aW9uMRwwGgYDVQQDDBN0ZXN0IGNsaWVu +dCByZXZva2VkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPMNx0UMhLTA/F +FbHM9C3B8vUUFtPJ/4IOVvKYi23VuciV+jPMs54mHV8qDc6NSQLzbqXGkCbjFU7S +vyKsHCVbsQaqA2q52OYJ4vYx6eJ2CLlapp2i8srs8ZeHoVwUSgZEdx0TNkO4Nr9t +bwrBkaYL6jc0CHstn+Dsul1Sd56gnwIDAQABo3sweTAJBgNVHRMEAjAAMCwGCWCG +SAGG+EIBDQQfFh1PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4E +FgQUVrQeF7M1xxbbRaV2QHM+w+pCXfgwHwYDVR0jBBgwFoAU7mC7xxdf03KsM+6O +hMwt2xrMilIwDQYJKoZIhvcNAQELBQADgYEAtULtIgapbVXncsIJzwVt8csrrjgk +Y7Ti89YTq4UIP+Fu5PQsMHvN7L4dwaZLU/YNE1XvEGC1hXK4hTSCKJdM2A5wf0qy +7OwTUBRTlK4E47/IAhnOntSFKlknm9znX1rHgy77K0fkURFvrVG7LoUsfKfDqdty +q1ST93Cem5xQIHM= +-----END CERTIFICATE----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client-revoked.key b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client-revoked.key new file mode 100644 index 0000000..da14580 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client-revoked.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQDPMNx0UMhLTA/FFbHM9C3B8vUUFtPJ/4IOVvKYi23VuciV+jPM +s54mHV8qDc6NSQLzbqXGkCbjFU7SvyKsHCVbsQaqA2q52OYJ4vYx6eJ2CLlapp2i +8srs8ZeHoVwUSgZEdx0TNkO4Nr9tbwrBkaYL6jc0CHstn+Dsul1Sd56gnwIDAQAB +AoGBAMqQ0Nh/qnPDl59uiHkDOkFnEilj8AiL4FG4vFJb7zSIAQ5wong+HB7TlJj/ +CrSjb1klErrBcOOPj5MIABQZKINrwgsHlkQIzvC2EGF/I0tfFJDbUjlZ7y1Vh15O +pAOhhx2SuBwvNMHrz6L70Koqg9Y2v1WHQ2IBPuo8i5VBcWSxAkEA9DUZm/Tj4Gqb +pXWiSd2/gV5H2NgVT2t9Jth1Z9nfK9g6GTfVEMbKkp4EGHW3rqL3UbphNK72/v3S +2YTMU0JM7QJBANkyKUbgdUMcqYDypZoBliom2qUqk+kIvWdGSp+W3M5LEQgfuTkN +uW9qz7ncXT3d8cka7Xlg7KO2UKAKnGJbvjsCQQCTYXiTJrhgN/a3ZMcMzUdGTCAQ +PlieFcDyMLCqfFKzo0ts7MUp2s9mrPbLzD+OpcudB16i7PUj7wvROtQVa24BAkAW +5M6tBePWWyMS0IDcJuapMsdBOae1nJI6XJJpGAHWTNtSu+VOOkAdmmii8rNxXf+q +bwgxDyJib0k4VWX+iCUZAkBWqLqyXcclfqAsiTKdzEfQV8uoiu+6hQ6OCh0J1Np3 +7g9p/MLyXkwtAgrtz80zWxkQH+FcFgdTwebrEF1z5kpx +-----END RSA PRIVATE KEY----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client.crt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client.crt new file mode 100644 index 0000000..c6b0626 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client.crt @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 2 (0x2) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=GB, ST=Derbyshire, O=Mosquitto Project, OU=Testing, CN=Signing CA + Validity + Not Before: Sep 18 10:49:56 2018 GMT + Not After : Sep 17 10:49:56 2023 GMT + Subject: C=GB, ST=Nottinghamshire, L=Nottingham, O=Server, OU=Production, CN=test client + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (1024 bit) + Modulus: + 00:cf:a2:94:2e:b7:84:9f:ec:67:86:ce:6a:71:75: + 6a:9d:9a:a3:69:2b:83:8e:a8:23:05:51:bc:ab:98: + 1e:01:bc:06:03:26:bd:34:ec:52:15:a7:4b:45:a5: + 62:f4:3c:c1:95:fe:7b:07:16:f7:03:ae:9a:19:4b: + a2:b9:49:80:5d:63:8b:a8:cb:d4:ed:86:9d:da:71: + 4f:15:6f:c5:0d:c6:81:cb:ad:57:75:7c:d9:2e:65: + a7:86:a4:8f:84:70:0d:c5:3a:53:6c:da:29:a3:1d: + b2:ac:4b:a0:86:7f:f3:16:2e:8d:99:dd:44:30:2b: + 81:89:e3:ae:79:b8:d7:ae:e9 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: + CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + FB:66:3B:5D:45:33:5B:61:14:52:C0:E4:04:FF:12:73:AD:B3:9B:56 + X509v3 Authority Key Identifier: + keyid:EE:60:BB:C7:17:5F:D3:72:AC:33:EE:8E:84:CC:2D:DB:1A:CC:8A:52 + + Signature Algorithm: sha256WithRSAEncryption + 48:b6:47:12:77:53:07:36:44:93:d7:ea:88:f0:f5:4f:b0:b4: + 52:06:36:ec:7b:df:80:cc:2a:31:fa:b3:b4:c9:0e:4a:6c:b0: + 83:0a:89:2d:58:25:f2:ee:0f:60:93:01:59:db:0a:6d:93:81: + ad:ea:21:cf:ee:d1:a9:b4:c2:b8:77:8c:bf:9d:1f:78:3c:35: + c2:2d:18:11:25:02:f8:7c:9c:42:fd:9b:0f:21:7b:81:88:b3: + c3:84:62:b1:b9:24:3c:8c:94:24:93:c2:74:33:2c:82:ca:b3: + 8f:37:3f:71:6d:b7:79:9b:dd:2e:ee:36:bd:7c:fa:0a:4d:3b: + 88:4b +-----BEGIN CERTIFICATE----- +MIICzjCCAjegAwIBAgIBAjANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQGEwJHQjET +MBEGA1UECAwKRGVyYnlzaGlyZTEaMBgGA1UECgwRTW9zcXVpdHRvIFByb2plY3Qx +EDAOBgNVBAsMB1Rlc3RpbmcxEzARBgNVBAMMClNpZ25pbmcgQ0EwHhcNMTgwOTE4 +MTA0OTU2WhcNMjMwOTE3MTA0OTU2WjB4MQswCQYDVQQGEwJHQjEYMBYGA1UECAwP +Tm90dGluZ2hhbXNoaXJlMRMwEQYDVQQHDApOb3R0aW5naGFtMQ8wDQYDVQQKDAZT +ZXJ2ZXIxEzARBgNVBAsMClByb2R1Y3Rpb24xFDASBgNVBAMMC3Rlc3QgY2xpZW50 +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPopQut4Sf7GeGzmpxdWqdmqNp +K4OOqCMFUbyrmB4BvAYDJr007FIVp0tFpWL0PMGV/nsHFvcDrpoZS6K5SYBdY4uo +y9Tthp3acU8Vb8UNxoHLrVd1fNkuZaeGpI+EcA3FOlNs2imjHbKsS6CGf/MWLo2Z +3UQwK4GJ4655uNeu6QIDAQABo3sweTAJBgNVHRMEAjAAMCwGCWCGSAGG+EIBDQQf +Fh1PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQU+2Y7XUUz +W2EUUsDkBP8Sc62zm1YwHwYDVR0jBBgwFoAU7mC7xxdf03KsM+6OhMwt2xrMilIw +DQYJKoZIhvcNAQELBQADgYEASLZHEndTBzZEk9fqiPD1T7C0UgY27HvfgMwqMfqz +tMkOSmywgwqJLVgl8u4PYJMBWdsKbZOBreohz+7RqbTCuHeMv50feDw1wi0YESUC ++HycQv2bDyF7gYizw4RisbkkPIyUJJPCdDMsgsqzjzc/cW23eZvdLu42vXz6Ck07 +iEs= +-----END CERTIFICATE----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client.key b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client.key new file mode 100644 index 0000000..64eb5c5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/client.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXwIBAAKBgQDPopQut4Sf7GeGzmpxdWqdmqNpK4OOqCMFUbyrmB4BvAYDJr00 +7FIVp0tFpWL0PMGV/nsHFvcDrpoZS6K5SYBdY4uoy9Tthp3acU8Vb8UNxoHLrVd1 +fNkuZaeGpI+EcA3FOlNs2imjHbKsS6CGf/MWLo2Z3UQwK4GJ4655uNeu6QIDAQAB +AoGBAMwdfSK30i8MzXEedlF3JgotPLtkxX12GIdgJONjNQxrdFWgvZvLPZ5/yWV8 +Al0rZPs5ImSD1OzPtjlru1n+wapHp8zE2xtl3druicErs1A0hF73yx5lJx9rO5V4 +c7FoTFDDs3LJVy9P9gsV/+1iWwgJvvxDs01DWhhi35zFZmoBAkEA5wuDEScxYXbx +KY5irMhsPACwNgzx/c3GBwZ56nx0hGVrqDmghw03sf6leTceKRhLE6xzyk56Z4kD +6/QtpTZMyQJBAOYPxg80W5uZPC7R56jlAzo8fnpwEidTjJlctbS4sDSnITe9yugs +x7SzLhqxzuEuJiLOfzCs/X5TL1UdN1azASECQQCgF6763MBvu34BgILJHJs6vHNd +EH1BkyrrRUaG/zOxZaFCUKP10GfOMxevtUx1xzqGaFFXViekxCDuhyR1vPlZAkEA +h+GBJbHS+ZAED9NCdGrvARKB0WcoEbozLNGpMNh0mmSsJfQfSApK2duKu5GRk0Zi +l+RHE0TZZCdVqXvcF4UagQJBAK3Jdi/F/n6+BYIU6IcFtsHCcm8Nr+Lz3iSt4CT5 +gIZstvNrIy/fJoN/NrrfVUh8JD0UZpEUt1lNclNLxCh/wec= +-----END RSA PRIVATE KEY----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/crl.pem b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/crl.pem new file mode 100644 index 0000000..04b0932 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/crl.pem @@ -0,0 +1,10 @@ +-----BEGIN X509 CRL----- +MIIBVTCBvwIBATANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQGEwJHQjETMBEGA1UE +CAwKRGVyYnlzaGlyZTEaMBgGA1UECgwRTW9zcXVpdHRvIFByb2plY3QxEDAOBgNV +BAsMB1Rlc3RpbmcxEzARBgNVBAMMClNpZ25pbmcgQ0EXDTE4MDkxODEwNDk1OVoY +DzIxMDAxMTA3MTA0OTU5WjAUMBICAQQXDTE4MDkxODEwNDk1OVqgDjAMMAoGA1Ud +FAQDAgEBMA0GCSqGSIb3DQEBCwUAA4GBABMwUjGo9PMd1kqWqrfqTO3eaesPATX9 +xm6OQyoPEJ0CIwhm9jjWrvKMoJth8W7qnS91AK5vt0avGlUFIC+VG4aNc8MLFzmk +2g425K4d8dQ92OBCc3d6U8cUmpfB2bpK5kPxDliWtH+iBnuWkjTIsaXsfdmnnXhz +3PAFwU9beIef +-----END X509 CRL----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/demoCA/crlnumber b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/demoCA/crlnumber new file mode 100644 index 0000000..eeee65e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/demoCA/crlnumber @@ -0,0 +1 @@ +05 diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/demoCA/index.txt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/demoCA/index.txt new file mode 100644 index 0000000..ced7051 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/demoCA/index.txt @@ -0,0 +1 @@ +R 391118144000Z 120703155846Z CDAE0E564A2891A7 unknown /C=GB/ST=United Kingdom/L=Derby/O=Mosquitto Test Suite/OU=Broker Test/CN=localhost-client-test diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/demoCA/index.txt.attr b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/demoCA/index.txt.attr new file mode 100644 index 0000000..3a7e39e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = no diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/demoCA/serial b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/demoCA/serial new file mode 100644 index 0000000..8a0f05e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/demoCA/serial @@ -0,0 +1 @@ +01 diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/gen.sh b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/gen.sh new file mode 100755 index 0000000..a52159c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/gen.sh @@ -0,0 +1,75 @@ +# This file generates the keys and certificates used for testing mosquitto. +# None of the keys are encrypted, so do not just use this script to generate +# files for your own use. + +rm -f *.crt *.key *.csr +for a in root signing; do + rm -rf ${a}CA/ + mkdir -p ${a}CA/newcerts + touch ${a}CA/index.txt + echo 01 > ${a}CA/serial + echo 01 > ${a}CA/crlnumber +done +rm -rf certs + +BASESUBJ="/C=GB/ST=Derbyshire/L=Derby/O=Mosquitto Project/OU=Testing" +SBASESUBJ="/C=GB/ST=Nottinghamshire/L=Nottingham/O=Server/OU=Production" +BBASESUBJ="/C=GB/ST=Nottinghamshire/L=Nottingham/O=Server/OU=Bridge" + +# The root CA +openssl genrsa -out test-root-ca.key 1024 +openssl req -new -x509 -days 3650 -key test-root-ca.key -out test-root-ca.crt -config openssl.cnf -subj "${BASESUBJ}/CN=Root CA/" + +# Another root CA that doesn't sign anything +openssl genrsa -out test-bad-root-ca.key 1024 +openssl req -new -x509 -days 3650 -key test-bad-root-ca.key -out test-bad-root-ca.crt -config openssl.cnf -subj "${BASESUBJ}/CN=Bad Root CA/" + +# This is a root CA that has the exact same details as the real root CA, but is a different key and certificate. Effectively a "fake" CA. +openssl genrsa -out test-fake-root-ca.key 1024 +openssl req -new -x509 -days 3650 -key test-fake-root-ca.key -out test-fake-root-ca.crt -config openssl.cnf -subj "${BASESUBJ}/CN=Root CA/" + +# An intermediate CA, signed by the root CA, used to sign server/client csrs. +openssl genrsa -out test-signing-ca.key 1024 +openssl req -out test-signing-ca.csr -key test-signing-ca.key -new -config openssl.cnf -subj "${BASESUBJ}/CN=Signing CA/" +openssl ca -batch -config openssl.cnf -name CA_root -extensions v3_ca -out test-signing-ca.crt -infiles test-signing-ca.csr + +# An alternative intermediate CA, signed by the root CA, not used to sign anything. +openssl genrsa -out test-alt-ca.key 1024 +openssl req -out test-alt-ca.csr -key test-alt-ca.key -new -config openssl.cnf -subj "${BASESUBJ}/CN=Alternative Signing CA/" +openssl ca -batch -config openssl.cnf -name CA_root -extensions v3_ca -out test-alt-ca.crt -infiles test-alt-ca.csr + +# Valid server key and certificate. +openssl genrsa -out server.key 1024 +openssl req -new -key server.key -out server.csr -config openssl.cnf -subj "${SBASESUBJ}/CN=localhost/" +openssl ca -batch -config openssl.cnf -name CA_signing -out server.crt -infiles server.csr + +# Expired server certificate, based on the above server key. +openssl req -new -days 1 -key server.key -out server-expired.csr -config openssl.cnf -subj "${SBASESUBJ}/CN=localhost/" +openssl ca -batch -config openssl.cnf -name CA_signing -days 1 -startdate 120820000000Z -enddate 120821000000Z -out server-expired.crt -infiles server-expired.csr + +# Valid client key and certificate. +openssl genrsa -out client.key 1024 +openssl req -new -key client.key -out client.csr -config openssl.cnf -subj "${SBASESUBJ}/CN=test client/" +openssl ca -batch -config openssl.cnf -name CA_signing -out client.crt -infiles client.csr + +# Expired client certificate, based on the above client key. +openssl req -new -days 1 -key client.key -out client-expired.csr -config openssl.cnf -subj "${SBASESUBJ}/CN=test client expired/" +openssl ca -batch -config openssl.cnf -name CA_signing -days 1 -startdate 120820000000Z -enddate 120821000000Z -out client-expired.crt -infiles client-expired.csr + +# Revoked client certificate, based on a new client key. +openssl genrsa -out client-revoked.key 1024 +openssl req -new -days 1 -key client-revoked.key -out client-revoked.csr -config openssl.cnf -subj "${SBASESUBJ}/CN=test client revoked/" +openssl ca -batch -config openssl.cnf -name CA_signing -out client-revoked.crt -infiles client-revoked.csr +openssl ca -batch -config openssl.cnf -name CA_signing -revoke client-revoked.crt +openssl ca -batch -config openssl.cnf -name CA_signing -gencrl -out crl.pem + +# Valid client key and certificate, encrypted (use "password" as password) +openssl genrsa -des3 -out client-encrypted.key -passout pass:password 1024 +openssl req -new -key client-encrypted.key -out client-encrypted.csr -config openssl.cnf -subj "${SBASESUBJ}/CN=test client encrypted/" -passin pass:password +openssl ca -batch -config openssl.cnf -name CA_signing -out client-encrypted.crt -infiles client-encrypted.csr + +cat test-signing-ca.crt test-root-ca.crt > all-ca.crt +#mkdir certs +#cp test-signing-ca.crt certs/test-signing-ca.pem +#cp test-root-ca.crt certs/test-root.ca.pem +openssl rehash certs diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/openssl.cnf b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/openssl.cnf new file mode 100644 index 0000000..0612f44 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/openssl.cnf @@ -0,0 +1,406 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca', 'req' and 'ts'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +# Policies used by the TSA examples. +tsa_policy1 = 1.2.3.4.1 +tsa_policy2 = 1.2.3.4.5.6 +tsa_policy3 = 1.2.3.4.5.7 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_signing ] + +dir = ./signingCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = test-signing-ca.crt # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = test-signing-ca.key # The private key +RANDFILE = $dir/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 1825 # how long to certify for +default_crl_days= 30000 # how long before next CRL +default_md = default # use public key default MD +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_anything + +[ CA_inter ] +dir = ./interCA +certs = $dir/certs +crl_dir = $dir/crl +database = $dir/index.txt +new_certs_dir = $dir/newcerts + +certificate = test-inter-ca.crt +serial = $dir/serial +crlnumber = $dir/crlnumber +crl = $dir/crl.pem +private_key = test-inter-ca.key +RANDFILE = $dir/.rand + +#x509_extensions = v3_ca +x509_extensions = usr_cert + +name_opt = ca_default +cert_opt = ca_default + +default_days = 1825 +default_crl_days = 30 +default_md = default +preserve = no + +policy = policy_match +unique_subject = yes + +[ CA_root ] +dir = ./rootCA +certs = $dir/certs +crl_dir = $dir/crl +database = $dir/index.txt +new_certs_dir = $dir/newcerts + +certificate = test-root-ca.crt +serial = $dir/serial +crlnumber = $dir/crlnumber +crl = $dir/crl.pem +private_key = test-root-ca.key +RANDFILE = $dir/.rand + +x509_extensions = v3_ca + +name_opt = ca_default +cert_opt = ca_default + +default_days = 1825 +default_crl_days = 30 +default_md = default +preserve = no + +policy = policy_match +unique_subject = yes + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 2048 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString (PKIX recommendation before 2004) +# utf8only: only UTF8Strings (PKIX recommendation after 2004). +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings. +string_mask = utf8only + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = GB +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Derbyshire + +localityName = Locality Name (eg, city) +localityName_default = Derby + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = Mosquitto Project + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Testing + +commonName = Common Name (e.g. server FQDN or YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This is required for TSA certificates. +# extendedKeyUsage = critical,timeStamping + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer + +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo + +#################################################################### +[ tsa ] + +default_tsa = tsa_config1 # the default TSA section + +[ tsa_config1 ] + +# These are used by the TSA reply generation only. +dir = ./demoCA # TSA root directory +serial = $dir/tsaserial # The current serial number (mandatory) +crypto_device = builtin # OpenSSL engine to use for signing +signer_cert = $dir/tsacert.pem # The TSA signing certificate + # (optional) +certs = $dir/cacert.pem # Certificate chain to include in reply + # (optional) +signer_key = $dir/private/tsakey.pem # The TSA private key (optional) + +default_policy = tsa_policy1 # Policy if request did not specify it + # (optional) +other_policies = tsa_policy2, tsa_policy3 # acceptable policies (optional) +digests = md5, sha1 # Acceptable message digests (mandatory) +accuracy = secs:1, millisecs:500, microsecs:100 # (optional) +clock_precision_digits = 0 # number of digits after dot. (optional) +ordering = yes # Is ordering defined for timestamps? + # (optional, default: no) +tsa_name = yes # Must the TSA name be included in the reply? + # (optional, default: no) +ess_cert_id_chain = no # Must the ESS cert id chain be included? + # (optional, default: no) diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/readme.txt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/readme.txt new file mode 100644 index 0000000..bbb6ad3 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/readme.txt @@ -0,0 +1,2 @@ +This directory contains certificates and keys required for SSL testing. +The CA key has password "password". diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/rootCA/crlnumber b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/rootCA/crlnumber new file mode 100644 index 0000000..8a0f05e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/rootCA/crlnumber @@ -0,0 +1 @@ +01 diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/rootCA/index.txt.attr b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/rootCA/index.txt.attr new file mode 100644 index 0000000..8f7e63a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/rootCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/rootCA/serial b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/rootCA/serial new file mode 100644 index 0000000..75016ea --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/rootCA/serial @@ -0,0 +1 @@ +03 diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/server-expired.crt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/server-expired.crt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/server-expired.crt diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/server.crt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/server.crt new file mode 100644 index 0000000..843e29d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/server.crt @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=GB, ST=Derbyshire, O=Mosquitto Project, OU=Testing, CN=Signing CA + Validity + Not Before: Sep 18 10:49:54 2018 GMT + Not After : Sep 17 10:49:54 2023 GMT + Subject: C=GB, ST=Nottinghamshire, L=Nottingham, O=Server, OU=Production, CN=localhost + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (1024 bit) + Modulus: + 00:cc:a0:1e:6a:7c:20:f0:3f:b2:48:2d:61:8d:b9: + db:a8:a5:65:6b:13:88:37:c7:12:d7:32:dc:b6:fd: + 89:4c:fd:2e:bf:e6:34:f5:ac:9d:db:82:54:b1:9c: + 84:7b:a7:af:3a:7e:89:fd:7e:fe:f1:3d:6f:46:1b: + 28:f2:d9:65:76:0d:11:4a:10:8b:a9:eb:bd:11:2c: + a8:5d:0a:30:65:c7:99:1f:96:88:2e:f1:a5:15:62: + a9:4a:2b:50:9e:70:04:0c:3d:24:55:4b:c3:d2:86: + 57:4f:76:91:6b:2b:35:40:10:b2:f0:c2:17:3f:da: + dd:d1:00:a7:32:64:37:24:b5 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: + CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + F9:F6:14:B3:4E:D1:D5:35:9F:15:D4:74:10:0E:85:F5:FF:8C:D2:C9 + X509v3 Authority Key Identifier: + keyid:EE:60:BB:C7:17:5F:D3:72:AC:33:EE:8E:84:CC:2D:DB:1A:CC:8A:52 + + Signature Algorithm: sha256WithRSAEncryption + 94:f9:64:c6:99:00:68:03:bb:58:e8:cd:71:65:82:02:30:ff: + cf:87:c3:5f:98:51:c8:96:93:c2:92:c0:f5:d4:78:5b:a2:0b: + ee:1a:77:6c:1e:bb:f8:d9:d9:93:b5:d2:9e:84:1b:bd:e3:0d: + 43:91:5b:a3:87:b3:a5:87:6b:ed:a3:93:e2:5a:7c:1e:09:f0: + 2a:27:97:39:3b:c4:a0:23:b4:84:50:c1:a2:1c:4d:0b:dc:66: + 16:d4:ef:1b:3b:bf:ef:69:a2:de:e1:01:b8:ca:e3:d3:be:f0: + e2:87:e1:1f:b5:92:93:25:32:e9:12:19:cb:78:dc:16:56:48: + ea:7c +-----BEGIN CERTIFICATE----- +MIICzDCCAjWgAwIBAgIBATANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQGEwJHQjET +MBEGA1UECAwKRGVyYnlzaGlyZTEaMBgGA1UECgwRTW9zcXVpdHRvIFByb2plY3Qx +EDAOBgNVBAsMB1Rlc3RpbmcxEzARBgNVBAMMClNpZ25pbmcgQ0EwHhcNMTgwOTE4 +MTA0OTU0WhcNMjMwOTE3MTA0OTU0WjB2MQswCQYDVQQGEwJHQjEYMBYGA1UECAwP +Tm90dGluZ2hhbXNoaXJlMRMwEQYDVQQHDApOb3R0aW5naGFtMQ8wDQYDVQQKDAZT +ZXJ2ZXIxEzARBgNVBAsMClByb2R1Y3Rpb24xEjAQBgNVBAMMCWxvY2FsaG9zdDCB +nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAzKAeanwg8D+ySC1hjbnbqKVlaxOI +N8cS1zLctv2JTP0uv+Y09ayd24JUsZyEe6evOn6J/X7+8T1vRhso8tlldg0RShCL +qeu9ESyoXQowZceZH5aILvGlFWKpSitQnnAEDD0kVUvD0oZXT3aRays1QBCy8MIX +P9rd0QCnMmQ3JLUCAwEAAaN7MHkwCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYd +T3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFPn2FLNO0dU1 +nxXUdBAOhfX/jNLJMB8GA1UdIwQYMBaAFO5gu8cXX9NyrDPujoTMLdsazIpSMA0G +CSqGSIb3DQEBCwUAA4GBAJT5ZMaZAGgDu1jozXFlggIw/8+Hw1+YUciWk8KSwPXU +eFuiC+4ad2weu/jZ2ZO10p6EG73jDUORW6OHs6WHa+2jk+JafB4J8Conlzk7xKAj +tIRQwaIcTQvcZhbU7xs7v+9pot7hAbjK49O+8OKH4R+1kpMlMukSGct43BZWSOp8 +-----END CERTIFICATE----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/server.key b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/server.key new file mode 100644 index 0000000..fe26ae2 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/server.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXAIBAAKBgQDMoB5qfCDwP7JILWGNuduopWVrE4g3xxLXMty2/YlM/S6/5jT1 +rJ3bglSxnIR7p686fon9fv7xPW9GGyjy2WV2DRFKEIup670RLKhdCjBlx5kflogu +8aUVYqlKK1CecAQMPSRVS8PShldPdpFrKzVAELLwwhc/2t3RAKcyZDcktQIDAQAB +AoGBAKS4MEPf8FP1snpPrbv85Un4+o8bhggAhLYfB3V22tPS65MmqXMqpVhSrgLb +z/oKnhAkVMhvNqLTpYN10ZzMS9MvaUK2G7TeNAFVuZcs4bit0YJchf/s947SOuZp +lSjIqbjiAkHsediyqsSZxMMwP2SxpevlmgPcdJfvwFeL6siBAkEA5vf1XPLF/etj +bcGim24wo5rbfq2pgszbKRbhr3syeRSv7NFsC2adRswQ7ZL3pIP0KezlEXCuoY0Z +fxs6QcFB/QJBAOLNSoihg26Z1omRR9LGS6iXrsLkznB/O6wGZl2dPMUO6fhXjOx0 +jXvubvrsuaZlavPc3U1bz9Q0r8xt++sXbxkCQHgEqzxUbyvmEDGtaBjKZn3tb1dh +WG8+kjfEyxuLsguXA1/U5wb5mIp8aeN59jNH2i2bCuFII4aRMomJFXmrueUCQGdX +r4yOO7sbsdvBLP7nh/XsF5+Kbl5oOyJpUB971ALehtG34uijOwyrWjpPv1AIijFQ +BC6JlStWTnxR6SX36ZECQGtidHZtfChaaeGi5rgORalVSngj+b5qjeR/x6KbDw6y +XmRC0C20CEyTgVwVsQVSAUoDiJSi4ol3/k5Yo5R9Lc0= +-----END RSA PRIVATE KEY----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/signingCA/crlnumber b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/signingCA/crlnumber new file mode 100644 index 0000000..9e22bcb --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/signingCA/crlnumber @@ -0,0 +1 @@ +02 diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/signingCA/index.txt.attr b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/signingCA/index.txt.attr new file mode 100644 index 0000000..8f7e63a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/signingCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/signingCA/serial b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/signingCA/serial new file mode 100644 index 0000000..cd672a5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/signingCA/serial @@ -0,0 +1 @@ +06 diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-alt-ca.crt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-alt-ca.crt new file mode 100644 index 0000000..161b806 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-alt-ca.crt @@ -0,0 +1,58 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 2 (0x2) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=GB, ST=Derbyshire, L=Derby, O=Mosquitto Project, OU=Testing, CN=Root CA + Validity + Not Before: Sep 18 10:49:53 2018 GMT + Not After : Sep 17 10:49:53 2023 GMT + Subject: C=GB, ST=Derbyshire, O=Mosquitto Project, OU=Testing, CN=Alternative Signing CA + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (1024 bit) + Modulus: + 00:d9:91:e8:a7:67:b4:bf:8e:c9:6a:23:ee:00:14: + 6b:1f:b9:73:4d:af:ab:d3:96:5f:76:e5:0d:59:d4: + 0b:35:d4:48:5d:9b:9f:fc:e0:c2:29:b2:32:a9:e7: + 5b:81:bf:9c:55:e5:7f:e1:64:c5:c7:bc:10:3f:6e: + 05:16:82:47:e9:ae:86:97:75:2f:93:56:b2:4b:df: + 80:e1:a3:75:22:03:e0:de:93:5d:2d:98:ae:a9:c7: + 53:7d:a2:1a:c9:5d:83:0e:e2:60:52:a5:a8:82:fe: + 04:ae:be:1d:c4:c6:5c:ae:08:41:33:7a:88:4d:82: + e8:da:93:b8:01:ad:c6:1b:75 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + EC:E8:0A:3E:42:B9:F1:5D:F9:74:6E:07:8D:39:3F:63:53:7A:2C:17 + X509v3 Authority Key Identifier: + keyid:DA:20:AB:E0:98:22:39:28:E0:70:D6:74:65:53:26:E0:6B:4C:96:39 + + X509v3 Basic Constraints: + CA:TRUE + Signature Algorithm: sha256WithRSAEncryption + 0a:14:f7:e7:54:44:59:39:14:b0:aa:d3:0e:bd:94:e2:0a:b3: + e9:65:31:c7:8c:0b:af:55:b9:c0:96:bb:2f:12:40:6a:4e:3e: + 13:c8:7e:cc:02:06:83:41:ad:22:2b:15:ea:fe:c4:09:25:2d: + e7:d4:f4:91:59:4e:6b:c9:8c:c5:a3:e0:f7:d2:56:1a:ea:82: + a6:06:15:d8:25:03:2f:71:c4:78:5c:ba:ce:8c:a4:80:67:58: + 33:12:86:df:ae:da:bd:d2:ff:e5:71:d0:8a:1f:ad:b4:0a:70: + 52:d7:04:0f:f8:2c:b9:1c:8e:1b:5b:c2:df:f8:ca:c9:97:4e: + 1a:0c +-----BEGIN CERTIFICATE----- +MIICqTCCAhKgAwIBAgIBAjANBgkqhkiG9w0BAQsFADByMQswCQYDVQQGEwJHQjET +MBEGA1UECAwKRGVyYnlzaGlyZTEOMAwGA1UEBwwFRGVyYnkxGjAYBgNVBAoMEU1v +c3F1aXR0byBQcm9qZWN0MRAwDgYDVQQLDAdUZXN0aW5nMRAwDgYDVQQDDAdSb290 +IENBMB4XDTE4MDkxODEwNDk1M1oXDTIzMDkxNzEwNDk1M1owcTELMAkGA1UEBhMC +R0IxEzARBgNVBAgMCkRlcmJ5c2hpcmUxGjAYBgNVBAoMEU1vc3F1aXR0byBQcm9q +ZWN0MRAwDgYDVQQLDAdUZXN0aW5nMR8wHQYDVQQDDBZBbHRlcm5hdGl2ZSBTaWdu +aW5nIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDZkeinZ7S/jslqI+4A +FGsfuXNNr6vTll925Q1Z1As11Ehdm5/84MIpsjKp51uBv5xV5X/hZMXHvBA/bgUW +gkfproaXdS+TVrJL34Dho3UiA+Dek10tmK6px1N9ohrJXYMO4mBSpaiC/gSuvh3E +xlyuCEEzeohNgujak7gBrcYbdQIDAQABo1AwTjAdBgNVHQ4EFgQU7OgKPkK58V35 +dG4HjTk/Y1N6LBcwHwYDVR0jBBgwFoAU2iCr4JgiOSjgcNZ0ZVMm4GtMljkwDAYD +VR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOBgQAKFPfnVERZORSwqtMOvZTiCrPp +ZTHHjAuvVbnAlrsvEkBqTj4TyH7MAgaDQa0iKxXq/sQJJS3n1PSRWU5ryYzFo+D3 +0lYa6oKmBhXYJQMvccR4XLrOjKSAZ1gzEobfrtq90v/lcdCKH620CnBS1wQP+Cy5 +HI4bW8Lf+MrJl04aDA== +-----END CERTIFICATE----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-alt-ca.key b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-alt-ca.key new file mode 100644 index 0000000..3e59fb4 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-alt-ca.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQDZkeinZ7S/jslqI+4AFGsfuXNNr6vTll925Q1Z1As11Ehdm5/8 +4MIpsjKp51uBv5xV5X/hZMXHvBA/bgUWgkfproaXdS+TVrJL34Dho3UiA+Dek10t +mK6px1N9ohrJXYMO4mBSpaiC/gSuvh3ExlyuCEEzeohNgujak7gBrcYbdQIDAQAB +AoGBAKh2ovekhD7i17AYu/tR1BSPaulXQaumvqp39tt8JWX7xkC89KdAfPb+JN6L +5r3TWMDl4BvtBHuAcfA7RzNDk1u/DZUT25ZnkbnL9iuQhBweRLETGSbBcrJ/VvGi +BXBB9bQfAbtUqF4MiPVIjgBSZn/Jtgz0A9PAKYpnhqvpIVStAkEA8kBBNAOA0ZI7 +r3DPEiL9QEMad0tDBIkM8hcFYVwPqi0O5mRt4YXDev0OzyvTVYX5Z1BaF5uJvUSH +y1lvDdpYkwJBAOXrDhnmW0K6xCYIqLVfdXG4LIx/exCQuYr78QGVV1rE4UCuIDZl +zOlRmmLzFsP1T8bArYGSxWqtU1ZYgv8uaNcCQQDlT1VpOvexaU7+Hzaj4GMBdYOT +8LYbkO+kKY56Pn7Fg6lbBS3OEKSdwvVFviJqDkurNDBTsHONqVUxdBLfdhPpAkB8 +9ZLVasig7OcckMo4wWgQZXv45HRbXX0qV6H2LVer4qNWRw0E47FKAer56oqt+E7i +g+gJK18Wiptnq3WPAYdDAkAdaJWEoOWkQROPvlKWlD51hAqCReb9ElxAeJOcte/Y +k1xir4zsMLo8cjqr/GLWVMhYv4zw9ZoKMNR7tfmYLZUC +-----END RSA PRIVATE KEY----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-bad-root-ca.crt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-bad-root-ca.crt new file mode 100644 index 0000000..1e72d2e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-bad-root-ca.crt @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICujCCAiOgAwIBAgIJAOk0UydITfTbMA0GCSqGSIb3DQEBCwUAMHYxCzAJBgNV +BAYTAkdCMRMwEQYDVQQIDApEZXJieXNoaXJlMQ4wDAYDVQQHDAVEZXJieTEaMBgG +A1UECgwRTW9zcXVpdHRvIFByb2plY3QxEDAOBgNVBAsMB1Rlc3RpbmcxFDASBgNV +BAMMC0JhZCBSb290IENBMB4XDTE4MDkxODEwNDk0N1oXDTI4MDkxNTEwNDk0N1ow +djELMAkGA1UEBhMCR0IxEzARBgNVBAgMCkRlcmJ5c2hpcmUxDjAMBgNVBAcMBURl +cmJ5MRowGAYDVQQKDBFNb3NxdWl0dG8gUHJvamVjdDEQMA4GA1UECwwHVGVzdGlu +ZzEUMBIGA1UEAwwLQmFkIFJvb3QgQ0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ +AoGBANuiMnQx8FL6FD2kGa3xG0Tv4iH1yECdJ8hzcdxESC/ecmaXMwGPiEmUyymU +/xRyQysHafhchc1lJvDmeFL13z4vgNPpJDhVCdji2QAq2IAKasLSZ3rhCYFhjvIO +wPHZxLtWeOgVqYRxWC58eF5H8wnBMOcfRBy5R/N9PYA2sZjdAgMBAAGjUDBOMB0G +A1UdDgQWBBTi2KR5GQHHN6hKI+Tfhqy4mLDMUTAfBgNVHSMEGDAWgBTi2KR5GQHH +N6hKI+Tfhqy4mLDMUTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4GBAIr6 +ie8HXzJYNZagjLVV/BkYKKe65FpmVk+3DdPqTtDhKGr8MpqkQlbBH8Ovocm3+eeN +om2qrwfymji5FGh9SV6kI7UCiIZ4r3VCo+npmwh8QKTv5yP5nCiUGrDEFUkg4VOt +HZTDW6L52WTHDJc/5Dh/MRhT07wox7BesgNWv21w +-----END CERTIFICATE----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-bad-root-ca.key b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-bad-root-ca.key new file mode 100644 index 0000000..936370d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-bad-root-ca.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXgIBAAKBgQDbojJ0MfBS+hQ9pBmt8RtE7+Ih9chAnSfIc3HcREgv3nJmlzMB +j4hJlMsplP8UckMrB2n4XIXNZSbw5nhS9d8+L4DT6SQ4VQnY4tkAKtiACmrC0md6 +4QmBYY7yDsDx2cS7VnjoFamEcVgufHheR/MJwTDnH0QcuUfzfT2ANrGY3QIDAQAB +AoGBANXsSIpGbdbUP8y+Pkjes3nU0IPVWmQc7jfewgMR+uGtH+5uzL5zaAKLS8rH +lh/7HxMVGJFQxP6GzIQNZxse4n1oXVstqa9xCoXQhUHpq6a/HdzbtMvg25SK6BXy +0F5d3y+MZAkat2JBIIRhpEm9A42Zy2z+uD5t/tJoF8hGw5g9AkEA8K1hUZYlf77p +hsHK79bAa9LTCqA+GX18Dbwixq1m01Mf1+JUJVURfuZOPlHldmUR30ELu6ojo84f +2TCLnenPawJBAOmd13FummA+UZNqK7GjXE0gYXqR99Q1zV8ZL5fgE3femiUIPIor +WpjzxNOcDqgGaHmXsh7s4HBJsAAKuWJUstcCQQDhE7PkYb815WttK8TGYRZYf7P/ +xvXsTq76BUyccsOrs5we/7ljpFeVTnozy9EE1OZO2/zGBwoHgZfFPKIFDwh7AkBM +jQdCyS5W6TTL7Fdi/xfIwhqPEnO2GucwCU26I5fdiJjUF63WzLwEMKTHfnSjBG6J +oXahgZdN1CeS6/CxUvXDAkEA48RD37aRhPBhE7s4Z0oODABYst+dKLOfbvnM8KY1 +XXYblkJPmmBfWb4bG+huYIaDYkfjZ6KJfJtk3tG8E3TWbA== +-----END RSA PRIVATE KEY----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-ca.srl b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-ca.srl new file mode 100644 index 0000000..53b5530 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-ca.srl @@ -0,0 +1 @@ +CDAE0E564A2891AA diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-fake-root-ca.crt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-fake-root-ca.crt new file mode 100644 index 0000000..5534380 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-fake-root-ca.crt @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICsjCCAhugAwIBAgIJANlFsLqxEDJbMA0GCSqGSIb3DQEBCwUAMHIxCzAJBgNV +BAYTAkdCMRMwEQYDVQQIDApEZXJieXNoaXJlMQ4wDAYDVQQHDAVEZXJieTEaMBgG +A1UECgwRTW9zcXVpdHRvIFByb2plY3QxEDAOBgNVBAsMB1Rlc3RpbmcxEDAOBgNV +BAMMB1Jvb3QgQ0EwHhcNMTgwOTE4MTA0OTQ3WhcNMjgwOTE1MTA0OTQ3WjByMQsw +CQYDVQQGEwJHQjETMBEGA1UECAwKRGVyYnlzaGlyZTEOMAwGA1UEBwwFRGVyYnkx +GjAYBgNVBAoMEU1vc3F1aXR0byBQcm9qZWN0MRAwDgYDVQQLDAdUZXN0aW5nMRAw +DgYDVQQDDAdSb290IENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDX3o3H +JPVGSfB/MdMNIBw+goqXmJdeAm4Ied0pkvC+KqIIp3xn0tiIdn+cKzn2hRk9UnW1 +IxAxKwVYRrASIRkFSFieRzhCTbZ1DxoI+DxLiE9RNH6b9M4u8nhlb9qApRgfpQsL +6gM5mG7QbXADyKPS9ToHU0YM3MpOiLOEDDbV/QIDAQABo1AwTjAdBgNVHQ4EFgQU +tQbx/zTi/+cZAQS63KiVZy+KaHAwHwYDVR0jBBgwFoAUtQbx/zTi/+cZAQS63KiV +Zy+KaHAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOBgQBLHJkJGaeAZoMq +d+wHJ+W/QJuU2xPACbCb7b5nA3WXnCj7A81IoFOJzdvlaHf9re7FvuVjK5kdhbVR +jz79e/RWHu2Q1vb8ftFqx8XISy3+wQR07NPmrFRmT0cfV06yiYjL0obQFyiXQ1y+ +xXVWHQ/2EkTGVBFKyuRBBmqWbzFj7w== +-----END CERTIFICATE----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-fake-root-ca.key b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-fake-root-ca.key new file mode 100644 index 0000000..81c538d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-fake-root-ca.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQDX3o3HJPVGSfB/MdMNIBw+goqXmJdeAm4Ied0pkvC+KqIIp3xn +0tiIdn+cKzn2hRk9UnW1IxAxKwVYRrASIRkFSFieRzhCTbZ1DxoI+DxLiE9RNH6b +9M4u8nhlb9qApRgfpQsL6gM5mG7QbXADyKPS9ToHU0YM3MpOiLOEDDbV/QIDAQAB +AoGAKzBjvUwvpnh0nX4ic6XRANCtWdc1saFa0mdPUFoNwH5XHNQll8Afgm3y6hPb +7O6ENjihRDRXsP6iex7pazckAgQ9zvIhXwyfAxHJ8T8+xJrb2ohMNbl/mdWkZzJS +HmfLwmTl8n2FTnUWOCRZ4DWZmxoqK04VcxFK2/ZvY9neZCECQQD88xjgt8zfk9k0 +UAKRQyqnoWbpthMDecLGwL3jjfGDts79TvSv7iwtq10uSQycFApMQlKysz7a4wsV +IMir+Z2XAkEA2nj7o7kiN/lhREcTf865mjo6Lol4vk6UDcNGQ8zHeoYiQMwIyhiR +MnFYzMeZT/tjD6O5JuJwyO74dCHqhYaDiwJBAIlhVp+l88VyPUOmON7ARghpJsXE +N6tplBnyUK+oRgWtYdo96bMrfh8HtUIQNqMGV1l3pAaeR4MGUNyWw6Zzmd0CQQDB +6E+w6Ujt1XH3X/52mc0yjivF0k5Q2v2dmYxr8P28SgFs8at7dIKq+t+OIjp5Ou6Z +mv9i++iO70umB9RX3yQxAkBY1E0dLGusSZ8BWugiminaZ8E0QdAwENIl02NleerY +ANdCQvvt3/KtfqiAhwakyGv4sdxa7Uo5KUaDKhqZ++0N +-----END RSA PRIVATE KEY----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-root-ca.crt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-root-ca.crt new file mode 100644 index 0000000..d0bf051 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-root-ca.crt @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICsjCCAhugAwIBAgIJAOcAUKw/VPlMMA0GCSqGSIb3DQEBCwUAMHIxCzAJBgNV +BAYTAkdCMRMwEQYDVQQIDApEZXJieXNoaXJlMQ4wDAYDVQQHDAVEZXJieTEaMBgG +A1UECgwRTW9zcXVpdHRvIFByb2plY3QxEDAOBgNVBAsMB1Rlc3RpbmcxEDAOBgNV +BAMMB1Jvb3QgQ0EwHhcNMTgwOTE4MTA0OTQ3WhcNMjgwOTE1MTA0OTQ3WjByMQsw +CQYDVQQGEwJHQjETMBEGA1UECAwKRGVyYnlzaGlyZTEOMAwGA1UEBwwFRGVyYnkx +GjAYBgNVBAoMEU1vc3F1aXR0byBQcm9qZWN0MRAwDgYDVQQLDAdUZXN0aW5nMRAw +DgYDVQQDDAdSb290IENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCeTh1y +KRZ1NIeLVvhBxSQC3Cvfe9L3IC8415CVbgipLgZKe7Nl1JBqFYDxXKBn2eVQ6EwL +sCz+U2oa2oCql8r5eYEKpmWFiIcKdrL8aSXNvMKEOu0AJlsIXBe2sDFPxuuw143n +W/odqBiWedciVd5pmJWZZ93neWdkkjnPZZMN4wIDAQABo1AwTjAdBgNVHQ4EFgQU +2iCr4JgiOSjgcNZ0ZVMm4GtMljkwHwYDVR0jBBgwFoAU2iCr4JgiOSjgcNZ0ZVMm +4GtMljkwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOBgQBIs2GY/GQL76rz ++0qSWZvQ7l+HovHdp7C49auI+hiSRAzv3p2y7y3DmZrpmYJlTZJWlaA8eg769sLg +Cyfkt6AIsZPadJiTTUayh8oCF5aMH+OetC+63USFBNYXJN6AOXp9vu/K3TdM8ao6 +WsAf26+DKYAPmvu+oU7ScpCrCSdC+Q== +-----END CERTIFICATE----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-root-ca.key b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-root-ca.key new file mode 100644 index 0000000..7b7843f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-root-ca.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXAIBAAKBgQCeTh1yKRZ1NIeLVvhBxSQC3Cvfe9L3IC8415CVbgipLgZKe7Nl +1JBqFYDxXKBn2eVQ6EwLsCz+U2oa2oCql8r5eYEKpmWFiIcKdrL8aSXNvMKEOu0A +JlsIXBe2sDFPxuuw143nW/odqBiWedciVd5pmJWZZ93neWdkkjnPZZMN4wIDAQAB +AoGAYXzLh20kJmOGAVo6og4sohJCdmtDvOo2CnQ91rgfX0g3mZDaJqCjmqDJelnH +cozuOkgD5MLGwoxN8GGVEPlPhiCzPIAp4ZIKcdpHxlAPmVRAhkLDgJuMD66OksPn +FxE5AqCUfZG+jpGy5KzlU2fyXyXt3zu9G6+Y9dbghXpnDekCQQDOxaGk50S2vJrJ +y5U+DaiSjr9+Qt6bDgdg2Q2ZE8oF3T6jI0QG/c9S3NbIRWe5HydrZ4YRn7GNmKQz ++Moy/43lAkEAw/6EwrUAfrJJ8TVeRsHLYs8H68Nswo0RQPqXSeLcqJc5AwqVfWpe +dJWSFpoHtelWfC7MMGrH26dwzt3YGUuwJwJBAIFqqyimY5ioZY1mMcv8CoVoeSyS +t/d+iVmxoNQt0aVn+7tp6DskAu6PMJN69VelyytrSTugoyXH4wZwckYHM40CQGYD +1JaEH/3STyp93NR3iqWjnTvaPIIHazOnO5f5vWEDVWl/2M+uzftg3ulkwx6slZeN +xDpvWhe6z7zdO93ux4ECQCXOCNFRha+Rs5Leyd4us6/6yo9o0rgHowNY8HIHBH9F +sEgq1pJxpSO3L7S5LpnhYkecIAHRzeGs1ikIDzIU/k4= +-----END RSA PRIVATE KEY----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-signing-ca.crt b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-signing-ca.crt new file mode 100644 index 0000000..f22216c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-signing-ca.crt @@ -0,0 +1,58 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=GB, ST=Derbyshire, L=Derby, O=Mosquitto Project, OU=Testing, CN=Root CA + Validity + Not Before: Sep 18 10:49:47 2018 GMT + Not After : Sep 17 10:49:47 2023 GMT + Subject: C=GB, ST=Derbyshire, O=Mosquitto Project, OU=Testing, CN=Signing CA + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (1024 bit) + Modulus: + 00:b7:32:f2:08:04:4c:77:03:70:3e:10:88:84:cd: + cd:f2:87:2f:3c:67:8f:78:01:5e:d5:51:f1:11:68: + 4d:a7:e2:73:b0:69:b5:67:07:59:88:cc:b8:7f:ce: + 97:52:bc:fb:73:7b:60:95:a2:7b:c2:9a:f1:4d:5a: + c4:42:55:c4:6e:02:50:a1:71:41:68:d1:6c:96:e0: + 3d:af:10:3f:7b:64:c1:3a:3a:c3:a9:39:71:08:29: + 45:c8:cc:da:33:65:b4:70:fb:36:bc:15:0d:a7:31: + ef:d5:ec:59:ac:75:2b:77:35:0b:f0:db:3d:14:f5: + 9a:41:e6:a0:b7:b7:62:2b:e7 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + EE:60:BB:C7:17:5F:D3:72:AC:33:EE:8E:84:CC:2D:DB:1A:CC:8A:52 + X509v3 Authority Key Identifier: + keyid:DA:20:AB:E0:98:22:39:28:E0:70:D6:74:65:53:26:E0:6B:4C:96:39 + + X509v3 Basic Constraints: + CA:TRUE + Signature Algorithm: sha256WithRSAEncryption + 8a:98:17:cd:e1:dc:2b:1b:5b:16:40:99:21:c4:d4:db:3f:5c: + 6a:ed:7b:a2:b6:df:aa:7c:d8:6a:3f:11:39:da:4c:ce:3f:e5: + 99:6a:a4:b8:82:1e:53:7a:5d:f1:52:be:df:f1:3b:59:9a:a8: + bb:7e:f1:30:33:4b:7c:c3:ab:85:1e:c4:0e:ac:d1:7e:2b:cb: + 9d:19:5b:df:94:b4:89:e1:da:5d:31:19:85:34:d5:33:55:f8: + af:92:ea:9a:17:c9:da:68:00:df:10:e9:e4:33:35:cd:15:57: + 80:56:1a:58:94:37:d7:f2:02:de:9b:0b:d3:02:64:c5:8e:6f: + 25:31 +-----BEGIN CERTIFICATE----- +MIICnTCCAgagAwIBAgIBATANBgkqhkiG9w0BAQsFADByMQswCQYDVQQGEwJHQjET +MBEGA1UECAwKRGVyYnlzaGlyZTEOMAwGA1UEBwwFRGVyYnkxGjAYBgNVBAoMEU1v +c3F1aXR0byBQcm9qZWN0MRAwDgYDVQQLDAdUZXN0aW5nMRAwDgYDVQQDDAdSb290 +IENBMB4XDTE4MDkxODEwNDk0N1oXDTIzMDkxNzEwNDk0N1owZTELMAkGA1UEBhMC +R0IxEzARBgNVBAgMCkRlcmJ5c2hpcmUxGjAYBgNVBAoMEU1vc3F1aXR0byBQcm9q +ZWN0MRAwDgYDVQQLDAdUZXN0aW5nMRMwEQYDVQQDDApTaWduaW5nIENBMIGfMA0G +CSqGSIb3DQEBAQUAA4GNADCBiQKBgQC3MvIIBEx3A3A+EIiEzc3yhy88Z494AV7V +UfERaE2n4nOwabVnB1mIzLh/zpdSvPtze2CVonvCmvFNWsRCVcRuAlChcUFo0WyW +4D2vED97ZME6OsOpOXEIKUXIzNozZbRw+za8FQ2nMe/V7FmsdSt3NQvw2z0U9ZpB +5qC3t2Ir5wIDAQABo1AwTjAdBgNVHQ4EFgQU7mC7xxdf03KsM+6OhMwt2xrMilIw +HwYDVR0jBBgwFoAU2iCr4JgiOSjgcNZ0ZVMm4GtMljkwDAYDVR0TBAUwAwEB/zAN +BgkqhkiG9w0BAQsFAAOBgQCKmBfN4dwrG1sWQJkhxNTbP1xq7Xuitt+qfNhqPxE5 +2kzOP+WZaqS4gh5Tel3xUr7f8TtZmqi7fvEwM0t8w6uFHsQOrNF+K8udGVvflLSJ +4dpdMRmFNNUzVfivkuqaF8naaADfEOnkMzXNFVeAVhpYlDfX8gLemwvTAmTFjm8l +MQ== +-----END CERTIFICATE----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-signing-ca.key b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-signing-ca.key new file mode 100644 index 0000000..2426228 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/ssl/test-signing-ca.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQC3MvIIBEx3A3A+EIiEzc3yhy88Z494AV7VUfERaE2n4nOwabVn +B1mIzLh/zpdSvPtze2CVonvCmvFNWsRCVcRuAlChcUFo0WyW4D2vED97ZME6OsOp +OXEIKUXIzNozZbRw+za8FQ2nMe/V7FmsdSt3NQvw2z0U9ZpB5qC3t2Ir5wIDAQAB +AoGAU6dZybtcx0O0r0KRdEMd9c8xDJ4lbyEBEtu1/sLoIu9O8JF0mjVK9yK0ZPgL +NWbCU3tVIT7u0HA8G5yE3d2YMfVCHTqkzrJ2pWlntgYcnYQSR2gjDnZl6iG/1VJ5 +aZh5+CjlwOstDiQLv+TKCfNVAa5Z4CC0jNt57tVuq/L0ieECQQDq4r+H5+DMUxaU +sXQgLizqTubMlhumcRTa+edgBWGLMbgK00wVeDpQD+j6qZFbiklll2fB5fF/Qj/c +D5RyByFZAkEAx6rEzYfIQLrJmy4RYcAlMFDMBvkpGTc1IGTDyjjsUmnOdF3ydnBx +GUqQzuf6Iv9Af64r1WUwSzA+iy200brPPwJBAODsEyasZ/qhEf1/VElAjmgs+Bwv +HfkrTiJGrkanwHmPOcK8BZ6Fi6mBIsNtvzDeYlxzOLtXWwNWyFoNXUQ4CbkCQQC8 +WhSjCibXIR1T/QY6nya1yFJfdaXWeqTsNQIZfs84A0XVslYqcnHOeO/Xry/g2cd/ +as9A097V3uHxKyG7Ay3DAkAtD9ifXcuCvtCeG5bsUlClOGmtzHX0Vw6ItYrI7WlX +lKJux35Y2z5E3/x2nHHvw1tuQnuwldU6lbSs3/cy67+d +-----END RSA PRIVATE KEY----- diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/Makefile b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/Makefile new file mode 100644 index 0000000..9d42242 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/Makefile @@ -0,0 +1,127 @@ +include ../../config.mk + +.PHONY: all check test test-broker test-lib clean coverage + +CPPFLAGS:=$(CPPFLAGS) -I../.. -I../../lib -I../../src -I../../src/deps +CFLAGS:=$(CFLAGS) -coverage -Wall -ggdb +LDFLAGS:=$(LDFLAGS) -coverage +LDADD:=$(LDADD) -lcunit + +TEST_OBJS = test.o \ + datatype_read.o \ + datatype_write.o \ + property_add.o \ + property_read.o \ + property_user_read.o \ + property_write.o \ + stubs.o \ + util_topic_test.o \ + utf8.o + +LIB_OBJS = memory_mosq.o \ + packet_datatypes.o \ + property_mosq.o \ + util_topic.o \ + utf8_mosq.o + +PERSIST_READ_TEST_OBJS = \ + persist_read_test.o \ + persist_read_stubs.o + +PERSIST_READ_OBJS = \ + memory_mosq.o \ + packet_datatypes.o \ + persist_read.o \ + persist_read_v234.o \ + persist_read_v5.o \ + property_mosq.o \ + utf8_mosq.o \ + util_mosq.o + +PERSIST_WRITE_TEST_OBJS = \ + persist_write_test.o \ + persist_write_stubs.o + +PERSIST_WRITE_OBJS = \ + database.o \ + memory_mosq.o \ + packet_datatypes.o \ + persist_read.o \ + persist_read_v234.o \ + persist_read_v5.o \ + persist_write.o \ + persist_write_v5.o \ + property_mosq.o \ + subs.o \ + utf8_mosq.o \ + util_mosq.o + +all : test + +check : test + +mosq_test : ${TEST_OBJS} ${LIB_OBJS} + $(CROSS_COMPILE)$(CC) $(LDFLAGS) -o $@ $^ $(LDADD) + +persist_read_test : ${PERSIST_READ_TEST_OBJS} ${PERSIST_READ_OBJS} + $(CROSS_COMPILE)$(CC) $(LDFLAGS) -o $@ $^ $(LDADD) + +persist_write_test : ${PERSIST_WRITE_TEST_OBJS} ${PERSIST_WRITE_OBJS} + $(CROSS_COMPILE)$(CC) $(LDFLAGS) -o $@ $^ $(LDADD) + + +database.o : ../../src/database.c + $(CROSS_COMPILE)$(CC) $(CPPFLAGS) $(CFLAGS) -DWITH_BROKER -DWITH_PERSISTENCE -c -o $@ $^ + +memory_mosq.o : ../../lib/memory_mosq.c + $(CROSS_COMPILE)$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $^ + +packet_datatypes.o : ../../lib/packet_datatypes.c + $(CROSS_COMPILE)$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $^ + +persist_read.o : ../../src/persist_read.c + $(CROSS_COMPILE)$(CC) $(CPPFLAGS) $(CFLAGS) -DWITH_BROKER -DWITH_PERSISTENCE -c -o $@ $^ + +persist_read_v234.o : ../../src/persist_read_v234.c + $(CROSS_COMPILE)$(CC) $(CPPFLAGS) $(CFLAGS) -DWITH_BROKER -DWITH_PERSISTENCE -c -o $@ $^ + +persist_read_v5.o : ../../src/persist_read_v5.c + $(CROSS_COMPILE)$(CC) $(CPPFLAGS) $(CFLAGS) -DWITH_BROKER -DWITH_PERSISTENCE -c -o $@ $^ + +persist_write.o : ../../src/persist_write.c + $(CROSS_COMPILE)$(CC) $(CPPFLAGS) $(CFLAGS) -DWITH_BROKER -DWITH_PERSISTENCE -c -o $@ $^ + +persist_write_v5.o : ../../src/persist_write_v5.c + $(CROSS_COMPILE)$(CC) $(CPPFLAGS) $(CFLAGS) -DWITH_BROKER -DWITH_PERSISTENCE -c -o $@ $^ + +property_mosq.o : ../../lib/property_mosq.c + $(CROSS_COMPILE)$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $^ + +subs.o : ../../src/subs.c + $(CROSS_COMPILE)$(CC) $(CPPFLAGS) $(CFLAGS) -DWITH_BROKER -DWITH_PERSISTENCE -c -o $@ $^ + +util_mosq.o : ../../lib/util_mosq.c + $(CROSS_COMPILE)$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $^ + +util_topic.o : ../../lib/util_topic.c + $(CROSS_COMPILE)$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $^ + +utf8_mosq.o : ../../lib/utf8_mosq.c + $(CROSS_COMPILE)$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $^ + +test-lib : mosq_test + ./mosq_test + +test-broker : persist_read_test persist_write_test + ./persist_read_test + ./persist_write_test + +test : test-broker test-lib + +clean : + -rm -rf mosq_test persist_read_test persist_write_test + -rm -rf *.o *.gcda *.gcno coverage.info out/ + +coverage : + lcov --capture --directory . --output-file coverage.info + genhtml coverage.info --output-directory out diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/datatype_read.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/datatype_read.c new file mode 100644 index 0000000..6001cbe --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/datatype_read.c @@ -0,0 +1,829 @@ +#include <CUnit/CUnit.h> +#include <CUnit/Basic.h> + +#include "packet_mosq.h" + +static void byte_read_helper( + uint8_t *payload, + int remaining_length, + int rc_expected, + uint8_t value_expected) +{ + struct mosquitto__packet packet; + uint8_t value = 0; + int rc; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = remaining_length; + rc = packet__read_byte(&packet, &value); + CU_ASSERT_EQUAL(rc, rc_expected); + CU_ASSERT_EQUAL(value, value_expected); +} + + +static void uint16_read_helper( + uint8_t *payload, + int remaining_length, + int rc_expected, + uint16_t value_expected) +{ + struct mosquitto__packet packet; + uint16_t value = 0; + int rc; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = remaining_length; + rc = packet__read_uint16(&packet, &value); + CU_ASSERT_EQUAL(rc, rc_expected); + CU_ASSERT_EQUAL(value, value_expected); +} + + +static void uint32_read_helper( + uint8_t *payload, + int remaining_length, + int rc_expected, + uint32_t value_expected) +{ + struct mosquitto__packet packet; + uint32_t value = 0; + int rc; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = remaining_length; + rc = packet__read_uint32(&packet, &value); + CU_ASSERT_EQUAL(rc, rc_expected); + CU_ASSERT_EQUAL(value, value_expected); +} + + +static void varint_read_helper( + uint8_t *payload, + int remaining_length, + int rc_expected, + int32_t value_expected, + int8_t bytes_expected) +{ + struct mosquitto__packet packet; + int32_t value = -1; + int8_t bytes = -1; + int rc; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = remaining_length; + rc = packet__read_varint(&packet, &value, &bytes); + CU_ASSERT_EQUAL(rc, rc_expected); + CU_ASSERT_EQUAL(value, value_expected); + CU_ASSERT_EQUAL(bytes, bytes_expected); +} + + +static void binary_read_helper( + uint8_t *payload, + int remaining_length, + int rc_expected, + const uint8_t *value_expected, + int length_expected) +{ + struct mosquitto__packet packet; + uint8_t *value = NULL; + int length = -1; + int rc; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = remaining_length; + rc = packet__read_binary(&packet, (uint8_t **)&value, &length); + CU_ASSERT_EQUAL(rc, rc_expected); + if(value_expected){ + /* FIXME - this should be a memcmp */ + CU_ASSERT_NSTRING_EQUAL(value, value_expected, length_expected); + }else{ + CU_ASSERT_EQUAL(value, NULL); + } + CU_ASSERT_EQUAL(length, length_expected); + free(value); +} + + +static void string_read_helper( + uint8_t *payload, + int remaining_length, + int rc_expected, + const uint8_t *value_expected, + int length_expected) +{ + struct mosquitto__packet packet; + uint8_t *value = NULL; + int length = -1; + int rc; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = remaining_length; + rc = packet__read_string(&packet, (char **)&value, &length); + CU_ASSERT_EQUAL(rc, rc_expected); + if(value_expected){ + if(value){ + CU_ASSERT_NSTRING_EQUAL(value, value_expected, length_expected); + } + }else{ + CU_ASSERT_PTR_NULL(value); + } + CU_ASSERT_EQUAL(length, length_expected); + free(value); +} + + +static void bytes_read_helper( + uint8_t *payload, + int remaining_length, + int rc_expected, + const uint8_t *value_expected, + int count) +{ + struct mosquitto__packet packet; + uint8_t value[count]; + int rc; + int i; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = remaining_length; + rc = packet__read_bytes(&packet, value, count); + CU_ASSERT_EQUAL(rc, rc_expected); + if(rc == MOSQ_ERR_SUCCESS){ + CU_ASSERT_EQUAL(packet.pos, count); + } + if(value_expected){ + for(i=0; i<count; i++){ + CU_ASSERT_EQUAL(value[i], value_expected[i]); + } + } +} + + +/* ======================================================================== + * BYTE INTEGER TESTS + * ======================================================================== */ + +/* This tests reading a Byte from an incoming packet. + * + * It tests: + * * Empty packets + */ +static void TEST_byte_read_empty(void) +{ + /* Empty packet */ + byte_read_helper(NULL, 0, MOSQ_ERR_PROTOCOL, 0); +} + + +/* This tests reading a Byte from an incoming packet. + * + * It tests: + * * Success at boundaries + */ +static void TEST_byte_read_success(void) +{ + uint8_t payload[20]; + + /* 0 value */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x00; + byte_read_helper(payload, 1, MOSQ_ERR_SUCCESS, 0x00); + + /* Middle */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x1F; + byte_read_helper(payload, 1, MOSQ_ERR_SUCCESS, 0x1F); + + /* 255 value */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0xFF; + byte_read_helper(payload, 1, MOSQ_ERR_SUCCESS, 0xFF); + +} + + +/* ======================================================================== + * TWO BYTE INTEGER TESTS + * ======================================================================== */ + +/* This tests reading a Two Byte Integer from an incoming packet. + * + * It tests: + * * Empty packets + */ +static void TEST_uint16_read_empty(void) +{ + /* Empty packet */ + uint16_read_helper(NULL, 0, MOSQ_ERR_PROTOCOL, 0); +} + + +/* This tests reading a Two Byte Integer from an incoming packet. + * + * It tests: + * * Truncated packets + */ +static void TEST_uint16_read_truncated(void) +{ + uint8_t payload[20]; + + /* 1 byte packet */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x38; + uint16_read_helper(payload, 1, MOSQ_ERR_PROTOCOL, 0); +} + + +/* This tests reading a Two Byte Integer from an incoming packet. + * + * It tests: + * * Success at boundaries + * * Endianness + */ +static void TEST_uint16_read_success(void) +{ + uint8_t payload[20]; + + /* 0 value */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x00; + payload[1] = 0x00; + uint16_read_helper(payload, 2, MOSQ_ERR_SUCCESS, 0x0000); + + /* Endian check */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x38; + payload[1] = 0xF3; + uint16_read_helper(payload, 2, MOSQ_ERR_SUCCESS, 0x38F3); + + /* 65,535 value */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0xFF; + payload[1] = 0xFF; + uint16_read_helper(payload, 2, MOSQ_ERR_SUCCESS, 0xFFFF); + +} + + +/* ======================================================================== + * FOUR BYTE INTEGER TESTS + * ======================================================================== */ + +/* This tests reading a Four Byte Integer from an incoming packet. + * + * It tests: + * * Empty packets + */ +static void TEST_uint32_read_empty(void) +{ + /* Empty packet */ + uint32_read_helper(NULL, 0, MOSQ_ERR_PROTOCOL, 0); +} + + +/* This tests reading a Four Byte Integer from an incoming packet. + * + * It tests: + * * Truncated packets + */ +static void TEST_uint32_read_truncated(void) +{ + uint8_t payload[20]; + + /* 1 byte packet */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x38; + uint32_read_helper(payload, 1, MOSQ_ERR_PROTOCOL, 0); + + /* 2 byte packet */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x38; + payload[1] = 0x38; + uint32_read_helper(payload, 2, MOSQ_ERR_PROTOCOL, 0); + + /* 3 byte packet */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x38; + payload[1] = 0x38; + payload[2] = 0x38; + uint32_read_helper(payload, 3, MOSQ_ERR_PROTOCOL, 0); +} + + +/* This tests reading a Four Byte Integer from an incoming packet. + * + * It tests: + * * Success at boundaries + * * Endianness + */ +static void TEST_uint32_read_success(void) +{ + uint8_t payload[20]; + + /* 0 value */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x00; + payload[1] = 0x00; + payload[2] = 0x00; + payload[3] = 0x00; + uint32_read_helper(payload, 4, MOSQ_ERR_SUCCESS, 0x00000000); + + /* Endian check */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x12; + payload[1] = 0x34; + payload[2] = 0x56; + payload[3] = 0x78; + uint32_read_helper(payload, 4, MOSQ_ERR_SUCCESS, 0x12345678); + + /* Biggest value */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0xFF; + payload[1] = 0xFF; + payload[2] = 0xFF; + payload[3] = 0xFF; + uint32_read_helper(payload, 4, MOSQ_ERR_SUCCESS, 0xFFFFFFFF); + +} + + +/* ======================================================================== + * VARIABLE BYTE INTEGER TESTS + * ======================================================================== */ + +/* This tests reading a Variable Byte Integer from an incoming packet. + * + * It tests: + * * Empty packet + */ +static void TEST_varint_read_empty(void) +{ + /* Empty packet */ + varint_read_helper(NULL, 0, MOSQ_ERR_PROTOCOL, -1, -1); +} + + +/* This tests reading a Variable Byte Integer from an incoming packet. + * + * It tests: + * * Truncated packets (varint encoding is longer than data) + */ +static void TEST_varint_read_truncated(void) +{ + uint8_t payload[20]; + + /* Varint bigger than packet */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x80; + varint_read_helper(payload, 1, MOSQ_ERR_PROTOCOL, -1, -1); + + /* Varint bigger than packet */ + memset(payload, 1, sizeof(payload)); + payload[0] = 0x80; + payload[1] = 0x80; + varint_read_helper(payload, 2, MOSQ_ERR_PROTOCOL, -1, -1); + + /* Varint bigger than packet */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x80; + payload[1] = 0x80; + payload[2] = 0x80; + varint_read_helper(payload, 3, MOSQ_ERR_PROTOCOL, -1, -1); + + /* Varint bigger than packet */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x80; + payload[1] = 0x80; + payload[2] = 0x80; + payload[3] = 0x80; + varint_read_helper(payload, 4, MOSQ_ERR_PROTOCOL, -1, -1); +} + + +/* This tests reading a Variable Byte Integer from an incoming packet. + * + * It tests: + * * Correct values on boundaries of 1, 2, 3, 4 byte encodings + */ +static void TEST_varint_read_boundaries(void) +{ + uint8_t payload[20]; + + /* Value = 0 */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x00; + varint_read_helper(payload, 1, MOSQ_ERR_SUCCESS, 0, 1); + + /* Value = 127 (just beneath the crossover to two bytes */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x7F; + varint_read_helper(payload, 1, MOSQ_ERR_SUCCESS, 127, 1); + + /* Value = 128 (just after the crossover to two bytes */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x80; + payload[1] = 0x01; + varint_read_helper(payload, 2, MOSQ_ERR_SUCCESS, 128, 2); + + /* Value = 16383 (just before the crossover to three bytes */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0xFF; + payload[1] = 0x7F; + varint_read_helper(payload, 2, MOSQ_ERR_SUCCESS, 16383, 2); + + /* Value = 16384 (just after the crossover to three bytes */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x80; + payload[1] = 0x80; + payload[2] = 0x01; + varint_read_helper(payload, 3, MOSQ_ERR_SUCCESS, 16384, 3); + + /* Value = 2,097,151 (just before the crossover to four bytes */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0xFF; + payload[1] = 0xFF; + payload[2] = 0x7F; + varint_read_helper(payload, 3, MOSQ_ERR_SUCCESS, 2097151, 3); + + /* Value = 2,097,152 (just after the crossover to four bytes */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x80; + payload[1] = 0x80; + payload[2] = 0x80; + payload[3] = 0x01; + varint_read_helper(payload, 4, MOSQ_ERR_SUCCESS, 2097152, 4); + + /* Value = 268,435,455 (highest value allowed) */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0xFF; + payload[1] = 0xFF; + payload[2] = 0xFF; + payload[3] = 0x7F; + varint_read_helper(payload, 4, MOSQ_ERR_SUCCESS, 268435455, 4); +} + +/* This tests reading a Variable Byte Integer from an incoming packet. + * + * It tests: + * * Too long encoding (5 bytes) + */ +static void TEST_varint_read_5_bytes(void) +{ + uint8_t payload[20]; + + /* Value = 268,435,456 (one higher than highest value allowed) */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x80; + payload[1] = 0x80; + payload[2] = 0x80; + payload[3] = 0x80; + payload[4] = 0x01; + varint_read_helper(payload, 5, MOSQ_ERR_PROTOCOL, -1, -1); +} + + +/* This tests reading a Variable Byte Integer from an incoming packet. + * + * It tests: + * * Overlong encodings (e.g. 2 bytes to encode "1") + */ +static void TEST_varint_read_overlong_encoding(void) +{ + uint8_t payload[20]; + + /* Overlong encoding of 0 (1 byte value encoded as 2 bytes) */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x80; + payload[1] = 0x00; + varint_read_helper(payload, 2, MOSQ_ERR_PROTOCOL, -1, -1); + + /* Overlong encoding of 127 (1 byte value encoded as 2 bytes) */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0xFF; + payload[1] = 0x00; + varint_read_helper(payload, 2, MOSQ_ERR_PROTOCOL, -1, -1); + + /* Overlong encoding of 128 (2 byte value encoded as 3 bytes) */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x80; + payload[1] = 0x81; + payload[2] = 0x00; + varint_read_helper(payload, 3, MOSQ_ERR_PROTOCOL, -1, -1); + + /* Overlong encoding of 16,383 (2 byte value encoded as 3 bytes) */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0xFF; + payload[1] = 0xFF; + payload[2] = 0x00; + varint_read_helper(payload, 3, MOSQ_ERR_PROTOCOL, -1, -1); + + /* Overlong encoding of 16,384 (3 byte value encoded as 4 bytes) */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x80; + payload[1] = 0x80; + payload[2] = 0x81; + payload[3] = 0x00; + varint_read_helper(payload, 4, MOSQ_ERR_PROTOCOL, -1, -1); + + /* Overlong encoding of 2,097,151 (3 byte value encoded as 4 bytes) */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0xFF; + payload[1] = 0xFF; + payload[2] = 0xFF; + payload[3] = 0x00; + varint_read_helper(payload, 4, MOSQ_ERR_PROTOCOL, -1, -1); +} + + +/* ======================================================================== + * UTF-8 STRING TESTS + * ======================================================================== */ + +/* This tests reading a UTF-8 Encoded String from an incoming packet. + * + * It tests: + * * Empty packet + */ +static void TEST_string_read_empty(void) +{ + string_read_helper(NULL, 0, MOSQ_ERR_PROTOCOL, NULL, -1); +} + +/* This tests reading a UTF-8 Encoded String from an incoming packet. + * + * It tests: + * * Truncated packets + */ +static void TEST_string_read_truncated(void) +{ + uint8_t payload[20]; + + /* 1 byte packet */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x02; + string_read_helper(payload, 1, MOSQ_ERR_PROTOCOL, NULL, -1); + + /* 2 byte packet */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x02; + payload[1] = 0x02; + string_read_helper(payload, 2, MOSQ_ERR_PROTOCOL, NULL, -1); + + /* 3 byte packet */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x00; + payload[1] = 0x02; + payload[2] = 'a'; + string_read_helper(payload, 3, MOSQ_ERR_PROTOCOL, NULL, -1); + + /* 3 byte packet */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x00; + payload[1] = 0x03; + payload[2] = 'a'; + payload[3] = 'b'; + string_read_helper(payload, 4, MOSQ_ERR_PROTOCOL, NULL, -1); +} + + +/* This tests reading a UTF-8 Encoded String from an incoming packet. + * + * It tests: + * * Empty string + */ +static void TEST_string_read_empty_string(void) +{ + uint8_t payload[20]; + + memset(payload, 0, sizeof(payload)); + payload[0] = 0x00; + payload[1] = 0x00; + string_read_helper(payload, 2, MOSQ_ERR_SUCCESS, (const uint8_t *)"", 0); +} + +/* This tests reading a UTF-8 Encoded String from an incoming packet. + * + * It tests: + * * Valid string + */ +static void TEST_string_read_valid_string(void) +{ + uint8_t payload[20]; + + memset(payload, 0, sizeof(payload)); + payload[0] = 0x00; + payload[1] = 0x0b; + payload[2] = 't'; + payload[3] = 'e'; + payload[4] = 's'; + payload[5] = 't'; + payload[6] = ' '; + payload[7] = 's'; + payload[8] = 't'; + payload[9] = 'r'; + payload[10] = 'i'; + payload[11] = 'n'; + payload[12] = 'g'; + string_read_helper(payload, 13, MOSQ_ERR_SUCCESS, (const uint8_t *)"test string", 11); +} + + +/* This tests reading a UTF-8 Encoded String from an incoming packet. + * + * It tests: + * * Malformed UTF-8 (note, comprehensive UTF-8 tests are elsewhere) + */ +static void TEST_string_read_malformed_string(void) +{ + uint8_t payload[20]; + + memset(payload, 0, sizeof(payload)); + payload[0] = 0x00; + payload[1] = 0x07; + payload[2] = 't'; + payload[3] = 'e'; + payload[4] = 's'; + payload[5] = 't'; + payload[6] = 0xED; /* U+D800 - single UTF-16 surrogate */ + payload[7] = 0xA0; + payload[8] = 0x80; + string_read_helper(payload, 9, MOSQ_ERR_MALFORMED_UTF8, NULL, -1); +} + + +/* This tests reading a UTF-8 Encoded String from an incoming packet. + * + * It tests: + * * MQTT-1.5.4-3 - Is 0xEF 0xBB 0xBF treated correctly. + */ +static void TEST_string_read_mqtt_1_5_4_3(void) +{ + uint8_t payload[20]; + + memset(payload, 0, sizeof(payload)); + payload[0] = 0x00; + payload[1] = 0x0b; + payload[2] = 't'; + payload[3] = 'e'; + payload[4] = 's'; + payload[5] = 't'; + payload[6] = 0xEF; /* U+FEFF - zero with no-break space */ + payload[7] = 0xBB; + payload[8] = 0xBF; + payload[9] = 't'; + payload[10] = 'e'; + payload[11] = 's'; + payload[12] = 't'; + string_read_helper(payload, 13, MOSQ_ERR_SUCCESS, &payload[2], 11); +} + + +/* ======================================================================== + * BINARY DATA TESTS + * ======================================================================== */ + +/* This tests reading Binary Data from an incoming packet. + * + * It tests: + * * Empty packet + */ +static void TEST_binary_data_read_empty(void) +{ + binary_read_helper(NULL, 0, MOSQ_ERR_PROTOCOL, NULL, -1); +} + + +/* This tests reading Binary Data from an incoming packet. + * + * It tests: + * * Truncated packets + */ +static void TEST_binary_data_read_truncated(void) +{ + uint8_t payload[20]; + + /* 1 byte packet */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x02; + binary_read_helper(payload, 1, MOSQ_ERR_PROTOCOL, NULL, -1); + + /* 2 byte packet */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x02; + payload[1] = 0x02; + binary_read_helper(payload, 2, MOSQ_ERR_PROTOCOL, NULL, -1); + + /* 3 byte packet */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x00; + payload[1] = 0x02; + payload[2] = 'a'; + binary_read_helper(payload, 3, MOSQ_ERR_PROTOCOL, NULL, -1); + + /* 3 byte packet */ + memset(payload, 0, sizeof(payload)); + payload[0] = 0x00; + payload[1] = 0x03; + payload[2] = 'a'; + payload[3] = 'b'; + binary_read_helper(payload, 4, MOSQ_ERR_PROTOCOL, NULL, -1); +} + + +/* ======================================================================== + * MULTIPLE BYTE TESTS + * ======================================================================== */ + +/* This tests reading multiple bytes (payload) from an incoming packet. + * + * It tests: + * * Empty packets + */ +static void TEST_bytes_read_empty(void) +{ + /* Empty packet */ + bytes_read_helper(NULL, 0, MOSQ_ERR_SUCCESS, NULL, 0); +} + +/* This tests reading multiple bytes (payload) from an incoming packet. + * + * It tests: + * * Truncated packets + */ +static void TEST_bytes_read_truncated(void) +{ + bytes_read_helper(NULL, 0, MOSQ_ERR_PROTOCOL, NULL, 1); +} + +/* This tests reading multiple bytes from an incoming packet. + * + * It tests: + * * Success + */ +static void TEST_bytes_read_success(void) +{ + uint8_t payload[20]; + int i; + + for(i=0; i<20; i++){ + payload[i] = i*2; + } + bytes_read_helper(payload, 20, MOSQ_ERR_SUCCESS, payload, 20); +} + + +/* ======================================================================== + * TEST SUITE SETUP + * ======================================================================== */ + +int init_datatype_read_tests(void) +{ + CU_pSuite test_suite = NULL; + + test_suite = CU_add_suite("Datatype read", NULL, NULL); + if(!test_suite){ + printf("Error adding CUnit test suite.\n"); + return 1; + } + + if(0 + || !CU_add_test(test_suite, "Byte read (empty packet)", TEST_byte_read_empty) + || !CU_add_test(test_suite, "Byte read (success values)", TEST_byte_read_success) + || !CU_add_test(test_suite, "Two Byte Integer read (empty packet)", TEST_uint16_read_empty) + || !CU_add_test(test_suite, "Two Byte Integer read (truncated packet)", TEST_uint16_read_truncated) + || !CU_add_test(test_suite, "Two Byte Integer read (success values)", TEST_uint16_read_success) + || !CU_add_test(test_suite, "Four Byte Integer read (empty packet)", TEST_uint32_read_empty) + || !CU_add_test(test_suite, "Four Byte Integer read (truncated packet)", TEST_uint32_read_truncated) + || !CU_add_test(test_suite, "Four Byte Integer read (success values)", TEST_uint32_read_success) + || !CU_add_test(test_suite, "Variable Byte Integer read (empty packet)", TEST_varint_read_empty) + || !CU_add_test(test_suite, "Variable Byte Integer read (truncated packets)", TEST_varint_read_truncated) + || !CU_add_test(test_suite, "Variable Byte Integer read (encoding boundaries)", TEST_varint_read_boundaries) + || !CU_add_test(test_suite, "Variable Byte Integer read (five byte encoding)", TEST_varint_read_5_bytes) + || !CU_add_test(test_suite, "Variable Byte Integer read (overlong encodings)", TEST_varint_read_overlong_encoding) + || !CU_add_test(test_suite, "UTF-8 string read (empty packet)", TEST_string_read_empty) + || !CU_add_test(test_suite, "UTF-8 string read (truncated packet)", TEST_string_read_truncated) + || !CU_add_test(test_suite, "UTF-8 string read (empty string)", TEST_string_read_empty_string) + || !CU_add_test(test_suite, "UTF-8 string read (valid string)", TEST_string_read_valid_string) + || !CU_add_test(test_suite, "UTF-8 string read (malformed string)", TEST_string_read_malformed_string) + || !CU_add_test(test_suite, "UTF-8 string read (MQTT-1.5.4-3)", TEST_string_read_mqtt_1_5_4_3) + || !CU_add_test(test_suite, "Binary Data read (empty packet)", TEST_binary_data_read_empty) + || !CU_add_test(test_suite, "Binary Data read (truncated packet)", TEST_binary_data_read_truncated) + || !CU_add_test(test_suite, "Bytes read (empty packet)", TEST_bytes_read_empty) + || !CU_add_test(test_suite, "Bytes read (truncated packet)", TEST_bytes_read_truncated) + || !CU_add_test(test_suite, "Bytes read (success)", TEST_bytes_read_success) + ){ + + printf("Error adding Datatype read CUnit tests.\n"); + return 1; + } + + return 0; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/datatype_write.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/datatype_write.c new file mode 100644 index 0000000..9fb9a5b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/datatype_write.c @@ -0,0 +1,153 @@ +#include <CUnit/CUnit.h> +#include <CUnit/Basic.h> + +#include <arpa/inet.h> + +#include "packet_mosq.h" + +/* ======================================================================== + * BYTE TESTS + * ======================================================================== */ + +/* This tests writing a Byte to an incoming packet. */ +static void TEST_byte_write(void) +{ + uint8_t payload[260]; + struct mosquitto__packet packet; + int i; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + memset(payload, 0, sizeof(payload)); + packet.payload = payload; + packet.packet_length = 256; + + for(i=0; i<256; i++){ + packet__write_byte(&packet, 255-i); + } + + CU_ASSERT_EQUAL(packet.pos, 256); + for(i=0; i<256; i++){ + CU_ASSERT_EQUAL(payload[i], 255-i); + } +} + + +/* ======================================================================== + * TWO BYTE INTEGER TESTS + * ======================================================================== */ + +/* This tests writing a Two Byte Integer to an incoming packet. */ +static void TEST_uint16_write(void) +{ + uint8_t payload[650]; + uint16_t *payload16; + struct mosquitto__packet packet; + int i; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + memset(payload, 0, sizeof(payload)); + packet.payload = payload; + packet.packet_length = 650; + + for(i=0; i<325; i++){ + packet__write_uint16(&packet, 100*i); + } + + CU_ASSERT_EQUAL(packet.pos, 650); + payload16 = (uint16_t *)payload; + for(i=0; i<325; i++){ + CU_ASSERT_EQUAL(payload16[i], htons(100*i)); + } +} + + +/* ======================================================================== + * FOUR BYTE INTEGER TESTS + * ======================================================================== */ + +/* This tests writing a Four Byte Integer to an incoming packet. */ +static void TEST_uint32_write(void) +{ + uint8_t *payload; + uint32_t *payload32; + struct mosquitto__packet packet; + int i; + + payload = calloc(42000, sizeof(uint32_t)); + if(!payload){ + CU_FAIL_FATAL("Out of memory"); + } + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.packet_length = 42000; + + for(i=0; i<10500; i++){ + packet__write_uint32(&packet, 1000*i); + } + + CU_ASSERT_EQUAL(packet.pos, 42000); + payload32 = (uint32_t *)payload; + for(i=0; i<10500; i++){ + CU_ASSERT_EQUAL(payload32[i], htonl(1000*i)); + } + free(payload); +} + + +/* ======================================================================== + * UTF-8 STRING TESTS + * ======================================================================== */ + +/* This tests writing a UTF-8 String to an incoming packet. */ +static void TEST_string_write(void) +{ + uint8_t payload[100]; + struct mosquitto__packet packet; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + memset(payload, 0, 100); + + packet.payload = payload; + packet.packet_length = 100; + + packet__write_string(&packet, "first test", strlen("first test")); + packet__write_string(&packet, "second test", strlen("second test")); + + CU_ASSERT_EQUAL(packet.pos, 2+10+2+11); + CU_ASSERT_EQUAL(payload[0], 0); + CU_ASSERT_EQUAL(payload[1], 10); + CU_ASSERT_NSTRING_EQUAL(payload+2, "first test", 10); + CU_ASSERT_EQUAL(payload[2+10+0], 0); + CU_ASSERT_EQUAL(payload[2+10+1], 11); + CU_ASSERT_NSTRING_EQUAL(payload+2+10+2, "second test", 11); +} + + +/* ======================================================================== + * TEST SUITE SETUP + * ======================================================================== */ + +int init_datatype_write_tests(void) +{ + CU_pSuite test_suite = NULL; + + test_suite = CU_add_suite("Datatype write", NULL, NULL); + if(!test_suite){ + printf("Error adding CUnit test suite.\n"); + return 1; + } + + if(0 + || !CU_add_test(test_suite, "Byte write", TEST_byte_write) + || !CU_add_test(test_suite, "Two Byte Integer write", TEST_uint16_write) + || !CU_add_test(test_suite, "Four Byte Integer write", TEST_uint32_write) + || !CU_add_test(test_suite, "UTF-8 String write", TEST_string_write) + ){ + + printf("Error adding Datatype write CUnit tests.\n"); + return 1; + } + + return 0; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/corrupt-header-long.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/corrupt-header-long.test-db new file mode 100644 index 0000000..7fa94b1 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/corrupt-header-long.test-db @@ -0,0 +1 @@ +corruptcorruptcorruptcorruptcorruptcorrupt diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/corrupt-header-short.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/corrupt-header-short.test-db new file mode 100644 index 0000000..4d5a80d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/corrupt-header-short.test-db @@ -0,0 +1 @@ +corrupt diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/empty.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/empty.test-db new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/empty.test-db diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/unsupported-version.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/unsupported-version.test-db new file mode 100644 index 0000000..1d3177d --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/unsupported-version.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-bad-chunk.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-bad-chunk.test-db new file mode 100644 index 0000000..9936a8f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-bad-chunk.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-cfg-bad-dbid.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-cfg-bad-dbid.test-db new file mode 100644 index 0000000..d85dace --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-cfg-bad-dbid.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-cfg-truncated.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-cfg-truncated.test-db new file mode 100644 index 0000000..9a8943b --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-cfg-truncated.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-cfg.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-cfg.test-db new file mode 100644 index 0000000..78d0ec5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-cfg.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-client-message.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-client-message.test-db new file mode 100644 index 0000000..01a83e5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-client-message.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-client.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-client.test-db new file mode 100644 index 0000000..378601e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-client.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-message-store.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-message-store.test-db new file mode 100644 index 0000000..beceeda --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-message-store.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-retain.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-retain.test-db new file mode 100644 index 0000000..0265060 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-retain.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-sub.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-sub.test-db new file mode 100644 index 0000000..dc2cda7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v3-sub.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v4-cfg.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v4-cfg.test-db new file mode 100644 index 0000000..b649e35 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v4-cfg.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v4-message-store.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v4-message-store.test-db new file mode 100644 index 0000000..a3059b5 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v4-message-store.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-bad-chunk.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-bad-chunk.test-db new file mode 100644 index 0000000..39af7f9 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-bad-chunk.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-cfg-truncated.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-cfg-truncated.test-db new file mode 100644 index 0000000..00b2b66 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-cfg-truncated.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-cfg.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-cfg.test-db new file mode 100644 index 0000000..2449222 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-cfg.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-client-message-props.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-client-message-props.test-db new file mode 100644 index 0000000..b34f6db --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-client-message-props.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-client-message.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-client-message.test-db new file mode 100644 index 0000000..1aac12c --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-client-message.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-client.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-client.test-db new file mode 100644 index 0000000..9115676 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-client.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-message-store-props.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-message-store-props.test-db new file mode 100644 index 0000000..a5c296a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-message-store-props.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-message-store.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-message-store.test-db new file mode 100644 index 0000000..f16b390 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-message-store.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-retain.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-retain.test-db new file mode 100644 index 0000000..f9d8a4f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-retain.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-sub.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-sub.test-db new file mode 100644 index 0000000..acd1437 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_read/v5-sub.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_write/empty.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_write/empty.test-db new file mode 100644 index 0000000..26169f3 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_write/empty.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_write/v4-full.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_write/v4-full.test-db new file mode 100644 index 0000000..bd1ab31 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_write/v4-full.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_write/v5-message-store-no-ref.test-db b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_write/v5-message-store-no-ref.test-db new file mode 100644 index 0000000..2449222 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/files/persist_write/v5-message-store-no-ref.test-db Binary files differ diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/persist_read_stubs.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/persist_read_stubs.c new file mode 100644 index 0000000..568016e --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/persist_read_stubs.c @@ -0,0 +1,150 @@ +#include <time.h> + +#define WITH_BROKER + +#include <logging_mosq.h> +#include <memory_mosq.h> +#include <mosquitto_broker_internal.h> +#include <net_mosq.h> +#include <send_mosq.h> +#include <time_mosq.h> + +extern uint64_t last_retained; +extern char *last_sub; +extern int last_qos; +extern uint32_t last_identifier; + +struct mosquitto *context__init(struct mosquitto_db *db, mosq_sock_t sock) +{ + struct mosquitto *m; + + m = mosquitto__calloc(1, sizeof(struct mosquitto)); + if(m){ + m->msgs_in.inflight_maximum = 20; + m->msgs_out.inflight_maximum = 20; + m->msgs_in.inflight_quota = 20; + m->msgs_out.inflight_quota = 20; + } + return m; +} + +int db__message_store(struct mosquitto_db *db, const struct mosquitto *source, uint16_t source_mid, char *topic, int qos, uint32_t payloadlen, mosquitto__payload_uhpa *payload, int retain, struct mosquitto_msg_store **stored, uint32_t message_expiry_interval, mosquitto_property *properties, dbid_t store_id, enum mosquitto_msg_origin origin) +{ + struct mosquitto_msg_store *temp = NULL; + int rc = MOSQ_ERR_SUCCESS; + + temp = mosquitto__calloc(1, sizeof(struct mosquitto_msg_store)); + if(!temp){ + rc = MOSQ_ERR_NOMEM; + goto error; + } + + if(source && source->id){ + temp->source_id = mosquitto__strdup(source->id); + }else{ + temp->source_id = mosquitto__strdup(""); + } + if(!temp->source_id){ + rc = MOSQ_ERR_NOMEM; + goto error; + } + + if(source && source->username){ + temp->source_username = mosquitto__strdup(source->username); + if(!temp->source_username){ + rc = MOSQ_ERR_NOMEM; + goto error; + } + } + if(source){ + temp->source_listener = source->listener; + } + temp->source_mid = source_mid; + temp->mid = 0; + temp->qos = qos; + temp->retain = retain; + temp->topic = topic; + topic = NULL; + temp->payloadlen = payloadlen; + temp->properties = properties; + if(payloadlen){ + UHPA_MOVE(temp->payload, *payload, payloadlen); + }else{ + temp->payload.ptr = NULL; + } + if(message_expiry_interval > 0){ + temp->message_expiry_time = time(NULL) + message_expiry_interval; + }else{ + temp->message_expiry_time = 0; + } + + temp->dest_ids = NULL; + temp->dest_id_count = 0; + db->msg_store_count++; + db->msg_store_bytes += payloadlen; + (*stored) = temp; + + if(!store_id){ + temp->db_id = ++db->last_db_id; + }else{ + temp->db_id = store_id; + } + + db->msg_store = temp; + + return MOSQ_ERR_SUCCESS; +error: + mosquitto__free(topic); + if(temp){ + mosquitto__free(temp->source_id); + mosquitto__free(temp->source_username); + mosquitto__free(temp->topic); + mosquitto__free(temp); + } + UHPA_FREE(*payload, payloadlen); + return rc; +} + +int log__printf(struct mosquitto *mosq, int priority, const char *fmt, ...) +{ + return 0; +} + +time_t mosquitto_time(void) +{ + return 123; +} + +int net__socket_close(struct mosquitto_db *db, struct mosquitto *mosq) +{ + return MOSQ_ERR_SUCCESS; +} + +int send__pingreq(struct mosquitto *mosq) +{ + return MOSQ_ERR_SUCCESS; +} + +int sub__add(struct mosquitto_db *db, struct mosquitto *context, const char *sub, int qos, uint32_t identifier, int options, struct mosquitto__subhier **root) +{ + last_sub = strdup(sub); + last_qos = qos; + last_identifier = identifier; + + return MOSQ_ERR_SUCCESS; +} + +int sub__messages_queue(struct mosquitto_db *db, const char *source_id, const char *topic, int qos, int retain, struct mosquitto_msg_store **stored) +{ + if(retain){ + last_retained = (*stored)->db_id; + } + return MOSQ_ERR_SUCCESS; +} + + +void db__msg_store_ref_inc(struct mosquitto_msg_store *store) +{ + store->ref_count++; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/persist_read_test.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/persist_read_test.c new file mode 100644 index 0000000..d1c7e78 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/persist_read_test.c @@ -0,0 +1,820 @@ +/* Tests for persistence. + * + * FIXME - these need to be aggressive about finding failures, at the moment + * they are just confirming that good behaviour works. */ + +#include <CUnit/CUnit.h> +#include <CUnit/Basic.h> + +#define WITH_BROKER +#define WITH_PERSISTENCE + +#include "mosquitto_broker_internal.h" +#include "persist.h" +#include "property_mosq.h" + +uint64_t last_retained; +char *last_sub = NULL; +int last_qos; +uint32_t last_identifier; + +static void TEST_persistence_disabled(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); +} + + +static void TEST_empty_file(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + + config.persistence_filepath = "files/persist_read/empty.test-db"; + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); +} + + +static void TEST_corrupt_header(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + + config.persistence_filepath = "files/persist_read/corrupt-header-short.test-db"; + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, 1); + + config.persistence_filepath = "files/persist_read/corrupt-header-long.test-db"; + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, 1); +} + +static void TEST_unsupported_version(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/unsupported-version.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, 1); +} + + +static void TEST_v3_config_ok(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v3-cfg.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_EQUAL(db.last_db_id, 0x7856341200000000); +} + + +static void TEST_v4_config_ok(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v4-cfg.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_EQUAL(db.last_db_id, 0x7856341200000000); +} + + +static void TEST_v3_config_truncated(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v3-cfg-truncated.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, 1); + CU_ASSERT_EQUAL(db.last_db_id, 0); +} + + +static void TEST_v3_config_bad_dbid(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v3-cfg-bad-dbid.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, 1); + CU_ASSERT_EQUAL(db.last_db_id, 0); +} + + +static void TEST_v3_bad_chunk(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v3-bad-chunk.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_EQUAL(db.last_db_id, 0x17); +} + + +static void TEST_v3_message_store(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v3-message-store.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_EQUAL(db.msg_store_count, 1); + CU_ASSERT_EQUAL(db.msg_store_bytes, 7); + CU_ASSERT_PTR_NOT_NULL(db.msg_store); + if(db.msg_store){ + CU_ASSERT_EQUAL(db.msg_store->db_id, 1); + CU_ASSERT_STRING_EQUAL(db.msg_store->source_id, "source_id"); + CU_ASSERT_EQUAL(db.msg_store->source_mid, 2); + CU_ASSERT_EQUAL(db.msg_store->mid, 0); + CU_ASSERT_EQUAL(db.msg_store->qos, 2); + CU_ASSERT_EQUAL(db.msg_store->retain, 1); + CU_ASSERT_PTR_NOT_NULL(db.msg_store->topic); + if(db.msg_store->topic){ + CU_ASSERT_STRING_EQUAL(db.msg_store->topic, "topic"); + } + CU_ASSERT_EQUAL(db.msg_store->payloadlen, 7); + if(db.msg_store->payloadlen == 7){ + CU_ASSERT_NSTRING_EQUAL(UHPA_ACCESS_PAYLOAD(db.msg_store), "payload", 7); + } + } +} + +static void TEST_v3_client(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + struct mosquitto *context; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v3-client.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + CU_ASSERT_PTR_NOT_NULL(db.contexts_by_id); + HASH_FIND(hh_id, db.contexts_by_id, "client-id", strlen("client-id"), context); + CU_ASSERT_PTR_NOT_NULL(context); + if(context){ + CU_ASSERT_PTR_NULL(context->msgs_in.inflight); + CU_ASSERT_PTR_NULL(context->msgs_out.inflight); + CU_ASSERT_EQUAL(context->last_mid, 0x5287); + } +} + +static void TEST_v3_client_message(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + struct mosquitto *context; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v3-client-message.test-db"; + config.max_inflight_messages = 20; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + CU_ASSERT_PTR_NOT_NULL(db.contexts_by_id); + HASH_FIND(hh_id, db.contexts_by_id, "client-id", strlen("client-id"), context); + CU_ASSERT_PTR_NOT_NULL(context); + if(context){ + CU_ASSERT_PTR_NOT_NULL(context->msgs_out.inflight); + if(context->msgs_out.inflight){ + CU_ASSERT_PTR_NULL(context->msgs_out.inflight->next); + CU_ASSERT_PTR_NOT_NULL(context->msgs_out.inflight->store); + if(context->msgs_out.inflight->store){ + CU_ASSERT_EQUAL(context->msgs_out.inflight->store->ref_count, 1); + CU_ASSERT_STRING_EQUAL(context->msgs_out.inflight->store->source_id, "source_id"); + CU_ASSERT_EQUAL(context->msgs_out.inflight->store->source_mid, 2); + CU_ASSERT_EQUAL(context->msgs_out.inflight->store->mid, 0); + CU_ASSERT_EQUAL(context->msgs_out.inflight->store->qos, 2); + CU_ASSERT_EQUAL(context->msgs_out.inflight->store->retain, 1); + CU_ASSERT_PTR_NOT_NULL(context->msgs_out.inflight->store->topic); + if(context->msgs_out.inflight->store->topic){ + CU_ASSERT_STRING_EQUAL(context->msgs_out.inflight->store->topic, "topic"); + } + CU_ASSERT_EQUAL(context->msgs_out.inflight->store->payloadlen, 7); + if(context->msgs_out.inflight->store->payloadlen == 7){ + CU_ASSERT_NSTRING_EQUAL(UHPA_ACCESS_PAYLOAD(context->msgs_out.inflight->store), "payload", 7); + } + } + CU_ASSERT_EQUAL(context->msgs_out.inflight->mid, 0x73); + CU_ASSERT_EQUAL(context->msgs_out.inflight->qos, 1); + CU_ASSERT_EQUAL(context->msgs_out.inflight->retain, 0); + CU_ASSERT_EQUAL(context->msgs_out.inflight->direction, mosq_md_out); + CU_ASSERT_EQUAL(context->msgs_out.inflight->state, mosq_ms_wait_for_puback); + CU_ASSERT_EQUAL(context->msgs_out.inflight->dup, 0); + CU_ASSERT_PTR_NULL(context->msgs_out.inflight->properties); + } + } +} + +static void TEST_v3_retain(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + last_retained = 0; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v3-retain.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_EQUAL(db.msg_store_count, 1); + CU_ASSERT_EQUAL(db.msg_store_bytes, 7); + CU_ASSERT_PTR_NOT_NULL(db.msg_store); + if(db.msg_store){ + CU_ASSERT_EQUAL(db.msg_store->db_id, 0x54); + CU_ASSERT_STRING_EQUAL(db.msg_store->source_id, "source_id"); + CU_ASSERT_EQUAL(db.msg_store->source_mid, 2); + CU_ASSERT_EQUAL(db.msg_store->mid, 0); + CU_ASSERT_EQUAL(db.msg_store->qos, 2); + CU_ASSERT_EQUAL(db.msg_store->retain, 1); + CU_ASSERT_PTR_NOT_NULL(db.msg_store->topic); + if(db.msg_store->topic){ + CU_ASSERT_STRING_EQUAL(db.msg_store->topic, "topic"); + } + CU_ASSERT_EQUAL(db.msg_store->payloadlen, 7); + if(db.msg_store->payloadlen == 7){ + CU_ASSERT_NSTRING_EQUAL(UHPA_ACCESS_PAYLOAD(db.msg_store), "payload", 7); + } + } + CU_ASSERT_EQUAL(last_retained, 0x54); +} + +static void TEST_v3_sub(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + struct mosquitto *context; + int rc; + + last_sub = NULL; + last_qos = -1; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v3-sub.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + CU_ASSERT_PTR_NOT_NULL(db.contexts_by_id); + HASH_FIND(hh_id, db.contexts_by_id, "client-id", strlen("client-id"), context); + CU_ASSERT_PTR_NOT_NULL(context); + if(context){ + CU_ASSERT_PTR_NOT_NULL(last_sub); + if(last_sub){ + CU_ASSERT_STRING_EQUAL(last_sub, "subscription") + free(last_sub); + } + CU_ASSERT_EQUAL(last_qos, 1); + } +} + +static void TEST_v4_message_store(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v4-message-store.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_EQUAL(db.msg_store_count, 1); + CU_ASSERT_EQUAL(db.msg_store_bytes, 7); + CU_ASSERT_PTR_NOT_NULL(db.msg_store); + if(db.msg_store){ + CU_ASSERT_EQUAL(db.msg_store->db_id, 0xFEDCBA9876543210); + CU_ASSERT_STRING_EQUAL(db.msg_store->source_id, "source_id"); + CU_ASSERT_EQUAL(db.msg_store->source_mid, 0x88); + CU_ASSERT_EQUAL(db.msg_store->mid, 0); + CU_ASSERT_EQUAL(db.msg_store->qos, 1); + CU_ASSERT_EQUAL(db.msg_store->retain, 0); + CU_ASSERT_PTR_NOT_NULL(db.msg_store->topic); + if(db.msg_store->topic){ + CU_ASSERT_STRING_EQUAL(db.msg_store->topic, "topic"); + } + CU_ASSERT_EQUAL(db.msg_store->payloadlen, 7); + if(db.msg_store->payloadlen == 7){ + CU_ASSERT_NSTRING_EQUAL(UHPA_ACCESS_PAYLOAD(db.msg_store), "payload", 7); + } + } +} + +static void TEST_v5_config_ok(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v5-cfg.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_EQUAL(db.last_db_id, 0x7856341200000000); +} + + +static void TEST_v5_config_truncated(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v5-cfg-truncated.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, 1); + CU_ASSERT_EQUAL(db.last_db_id, 0); +} + + +static void TEST_v5_bad_chunk(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v5-bad-chunk.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_EQUAL(db.last_db_id, 0x17); +} + + +static void TEST_v5_message_store(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v5-message-store.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_EQUAL(db.msg_store_count, 1); + CU_ASSERT_EQUAL(db.msg_store_bytes, 7); + CU_ASSERT_PTR_NOT_NULL(db.msg_store); + if(db.msg_store){ + CU_ASSERT_EQUAL(db.msg_store->db_id, 1); + CU_ASSERT_STRING_EQUAL(db.msg_store->source_id, "source_id"); + CU_ASSERT_EQUAL(db.msg_store->source_mid, 2); + CU_ASSERT_EQUAL(db.msg_store->mid, 0); + CU_ASSERT_EQUAL(db.msg_store->qos, 2); + CU_ASSERT_EQUAL(db.msg_store->retain, 1); + CU_ASSERT_STRING_EQUAL(db.msg_store->topic, "topic"); + CU_ASSERT_EQUAL(db.msg_store->payloadlen, 7); + if(db.msg_store->payloadlen == 7){ + CU_ASSERT_NSTRING_EQUAL(UHPA_ACCESS_PAYLOAD(db.msg_store), "payload", 7); + } + CU_ASSERT_PTR_NULL(db.msg_store->properties); + } +} + + +static void TEST_v5_message_store_props(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + struct mosquitto__listener listener; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + memset(&listener, 0, sizeof(struct mosquitto__listener)); + db.config = &config; + + listener.port = 1883; + config.listeners = &listener; + config.listener_count = 1; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v5-message-store-props.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_EQUAL(db.msg_store_count, 1); + CU_ASSERT_EQUAL(db.msg_store_bytes, 7); + CU_ASSERT_PTR_NOT_NULL(db.msg_store); + if(db.msg_store){ + CU_ASSERT_EQUAL(db.msg_store->db_id, 1); + CU_ASSERT_STRING_EQUAL(db.msg_store->source_id, "source_id"); + CU_ASSERT_EQUAL(db.msg_store->source_mid, 2); + CU_ASSERT_EQUAL(db.msg_store->mid, 0); + CU_ASSERT_EQUAL(db.msg_store->qos, 2); + CU_ASSERT_EQUAL(db.msg_store->retain, 1); + CU_ASSERT_STRING_EQUAL(db.msg_store->topic, "topic"); + CU_ASSERT_EQUAL(db.msg_store->payloadlen, 7); + if(db.msg_store->payloadlen == 7){ + CU_ASSERT_NSTRING_EQUAL(UHPA_ACCESS_PAYLOAD(db.msg_store), "payload", 7); + } + CU_ASSERT_PTR_NOT_NULL(db.msg_store->properties); + if(db.msg_store->properties){ + CU_ASSERT_EQUAL(db.msg_store->properties->identifier, 1); + CU_ASSERT_EQUAL(db.msg_store->properties->value.i8, 1); + } + CU_ASSERT_PTR_NOT_NULL(db.msg_store->source_listener); + } +} + +static void TEST_v5_client(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + struct mosquitto *context; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v5-client.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + CU_ASSERT_PTR_NOT_NULL(db.contexts_by_id); + HASH_FIND(hh_id, db.contexts_by_id, "client-id", strlen("client-id"), context); + CU_ASSERT_PTR_NOT_NULL(context); + if(context){ + CU_ASSERT_PTR_NULL(context->msgs_in.inflight); + CU_ASSERT_PTR_NULL(context->msgs_out.inflight); + CU_ASSERT_EQUAL(context->last_mid, 0x5287); + } +} + +static void TEST_v5_client_message(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + struct mosquitto *context; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v5-client-message.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + CU_ASSERT_PTR_NOT_NULL(db.contexts_by_id); + HASH_FIND(hh_id, db.contexts_by_id, "client-id", strlen("client-id"), context); + CU_ASSERT_PTR_NOT_NULL(context); + if(context){ + CU_ASSERT_PTR_NOT_NULL(context->msgs_out.inflight); + if(context->msgs_out.inflight){ + CU_ASSERT_PTR_NULL(context->msgs_out.inflight->next); + CU_ASSERT_PTR_NOT_NULL(context->msgs_out.inflight->store); + if(context->msgs_out.inflight->store){ + CU_ASSERT_EQUAL(context->msgs_out.inflight->store->ref_count, 1); + CU_ASSERT_STRING_EQUAL(context->msgs_out.inflight->store->source_id, "source_id"); + CU_ASSERT_EQUAL(context->msgs_out.inflight->store->source_mid, 2); + CU_ASSERT_EQUAL(context->msgs_out.inflight->store->mid, 0); + CU_ASSERT_EQUAL(context->msgs_out.inflight->store->qos, 2); + CU_ASSERT_EQUAL(context->msgs_out.inflight->store->retain, 1); + CU_ASSERT_STRING_EQUAL(context->msgs_out.inflight->store->topic, "topic"); + CU_ASSERT_EQUAL(context->msgs_out.inflight->store->payloadlen, 7); + if(context->msgs_out.inflight->store->payloadlen == 7){ + CU_ASSERT_NSTRING_EQUAL(UHPA_ACCESS_PAYLOAD(context->msgs_out.inflight->store), "payload", 7); + } + } + CU_ASSERT_EQUAL(context->msgs_out.inflight->mid, 0x73); + CU_ASSERT_EQUAL(context->msgs_out.inflight->qos, 1); + CU_ASSERT_EQUAL(context->msgs_out.inflight->retain, 0); + CU_ASSERT_EQUAL(context->msgs_out.inflight->direction, mosq_md_out); + CU_ASSERT_EQUAL(context->msgs_out.inflight->state, mosq_ms_wait_for_puback); + CU_ASSERT_EQUAL(context->msgs_out.inflight->dup, 0); + CU_ASSERT_PTR_NULL(context->msgs_out.inflight->properties); + } + } +} + +static void TEST_v5_client_message_props(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + struct mosquitto *context; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v5-client-message-props.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + CU_ASSERT_PTR_NOT_NULL(db.contexts_by_id); + HASH_FIND(hh_id, db.contexts_by_id, "client-id", strlen("client-id"), context); + CU_ASSERT_PTR_NOT_NULL(context); + if(context){ + CU_ASSERT_PTR_NOT_NULL(context->msgs_out.inflight); + if(context->msgs_out.inflight){ + CU_ASSERT_PTR_NULL(context->msgs_out.inflight->next); + CU_ASSERT_PTR_NOT_NULL(context->msgs_out.inflight->store); + if(context->msgs_out.inflight->store){ + CU_ASSERT_EQUAL(context->msgs_out.inflight->store->ref_count, 1); + CU_ASSERT_STRING_EQUAL(context->msgs_out.inflight->store->source_id, "source_id"); + CU_ASSERT_EQUAL(context->msgs_out.inflight->store->source_mid, 2); + CU_ASSERT_EQUAL(context->msgs_out.inflight->store->mid, 0); + CU_ASSERT_EQUAL(context->msgs_out.inflight->store->qos, 2); + CU_ASSERT_EQUAL(context->msgs_out.inflight->store->retain, 1); + CU_ASSERT_STRING_EQUAL(context->msgs_out.inflight->store->topic, "topic"); + CU_ASSERT_EQUAL(context->msgs_out.inflight->store->payloadlen, 7); + if(context->msgs_out.inflight->store->payloadlen == 7){ + CU_ASSERT_NSTRING_EQUAL(UHPA_ACCESS_PAYLOAD(context->msgs_out.inflight->store), "payload", 7); + } + } + CU_ASSERT_EQUAL(context->msgs_out.inflight->mid, 0x73); + CU_ASSERT_EQUAL(context->msgs_out.inflight->qos, 1); + CU_ASSERT_EQUAL(context->msgs_out.inflight->retain, 0); + CU_ASSERT_EQUAL(context->msgs_out.inflight->direction, mosq_md_out); + CU_ASSERT_EQUAL(context->msgs_out.inflight->state, mosq_ms_wait_for_puback); + CU_ASSERT_EQUAL(context->msgs_out.inflight->dup, 0); + CU_ASSERT_PTR_NOT_NULL(context->msgs_out.inflight->properties); + if(context->msgs_out.inflight->properties){ + CU_ASSERT_EQUAL(context->msgs_out.inflight->properties->identifier, 1); + CU_ASSERT_EQUAL(context->msgs_out.inflight->properties->value.i8, 1); + } + } + } +} + +static void TEST_v5_retain(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + last_retained = 0; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v5-retain.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_EQUAL(db.msg_store_count, 1); + CU_ASSERT_EQUAL(db.msg_store_bytes, 7); + CU_ASSERT_PTR_NOT_NULL(db.msg_store); + if(db.msg_store){ + CU_ASSERT_EQUAL(db.msg_store->db_id, 0x54); + CU_ASSERT_STRING_EQUAL(db.msg_store->source_id, "source_id"); + CU_ASSERT_EQUAL(db.msg_store->source_mid, 2); + CU_ASSERT_EQUAL(db.msg_store->mid, 0); + CU_ASSERT_EQUAL(db.msg_store->qos, 2); + CU_ASSERT_EQUAL(db.msg_store->retain, 1); + CU_ASSERT_STRING_EQUAL(db.msg_store->topic, "topic"); + CU_ASSERT_EQUAL(db.msg_store->payloadlen, 7); + if(db.msg_store->payloadlen == 7){ + CU_ASSERT_NSTRING_EQUAL(UHPA_ACCESS_PAYLOAD(db.msg_store), "payload", 7); + } + } + CU_ASSERT_EQUAL(last_retained, 0x54); +} + +static void TEST_v5_sub(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + struct mosquitto *context; + int rc; + + last_sub = NULL; + last_qos = -1; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v5-sub.test-db"; + + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + CU_ASSERT_PTR_NOT_NULL(db.contexts_by_id); + HASH_FIND(hh_id, db.contexts_by_id, "client-id", strlen("client-id"), context); + CU_ASSERT_PTR_NOT_NULL(context); + if(context){ + CU_ASSERT_PTR_NOT_NULL(last_sub); + if(last_sub){ + CU_ASSERT_STRING_EQUAL(last_sub, "subscription") + free(last_sub); + } + CU_ASSERT_EQUAL(last_qos, 1); + CU_ASSERT_EQUAL(last_identifier, 0x7623); + } +} + +/* ======================================================================== + * TEST SUITE SETUP + * ======================================================================== */ + +int init_persist_read_tests(void) +{ + CU_pSuite test_suite = NULL; + + test_suite = CU_add_suite("Persist read", NULL, NULL); + if(!test_suite){ + printf("Error adding CUnit persist read test suite.\n"); + return 1; + } + + if(0 + || !CU_add_test(test_suite, "Persistence disabled", TEST_persistence_disabled) + || !CU_add_test(test_suite, "Empty file", TEST_empty_file) + || !CU_add_test(test_suite, "Corrupt header", TEST_corrupt_header) + || !CU_add_test(test_suite, "Unsupported version", TEST_unsupported_version) + || !CU_add_test(test_suite, "v3 config ok", TEST_v3_config_ok) + || !CU_add_test(test_suite, "v3 config bad truncated", TEST_v3_config_truncated) + || !CU_add_test(test_suite, "v3 config bad dbid", TEST_v3_config_bad_dbid) + || !CU_add_test(test_suite, "v3 bad chunk", TEST_v3_bad_chunk) + || !CU_add_test(test_suite, "v3 message store", TEST_v3_message_store) + || !CU_add_test(test_suite, "v3 client", TEST_v3_client) + || !CU_add_test(test_suite, "v3 client message", TEST_v3_client_message) + || !CU_add_test(test_suite, "v3 retain", TEST_v3_retain) + || !CU_add_test(test_suite, "v3 sub", TEST_v3_sub) + || !CU_add_test(test_suite, "v4 config ok", TEST_v4_config_ok) + || !CU_add_test(test_suite, "v4 message store", TEST_v4_message_store) + || !CU_add_test(test_suite, "v5 config ok", TEST_v5_config_ok) + || !CU_add_test(test_suite, "v5 config bad truncated", TEST_v5_config_truncated) + || !CU_add_test(test_suite, "v5 bad chunk", TEST_v5_bad_chunk) + || !CU_add_test(test_suite, "v5 message store", TEST_v5_message_store) + || !CU_add_test(test_suite, "v5 message store+props", TEST_v5_message_store_props) + || !CU_add_test(test_suite, "v5 client", TEST_v5_client) + || !CU_add_test(test_suite, "v5 client message", TEST_v5_client_message) + || !CU_add_test(test_suite, "v5 client message+props", TEST_v5_client_message_props) + || !CU_add_test(test_suite, "v5 retain", TEST_v5_retain) + || !CU_add_test(test_suite, "v5 sub", TEST_v5_sub) + ){ + + printf("Error adding persist CUnit tests.\n"); + return 1; + } + + return 0; +} + +int main(int argc, char *argv[]) +{ + int fails; + + if(CU_initialize_registry() != CUE_SUCCESS){ + printf("Error initializing CUnit registry.\n"); + return 1; + } + + if(0 + || init_persist_read_tests() + ){ + + CU_cleanup_registry(); + return 1; + } + + CU_basic_set_mode(CU_BRM_VERBOSE); + CU_basic_run_tests(); + fails = CU_get_number_of_failures(); + CU_cleanup_registry(); + + return (int)fails; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/persist_write_stubs.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/persist_write_stubs.c new file mode 100644 index 0000000..97bb8e0 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/persist_write_stubs.c @@ -0,0 +1,71 @@ +#include <time.h> + +#define WITH_BROKER + +#include <logging_mosq.h> +#include <memory_mosq.h> +#include <mosquitto_broker_internal.h> +#include <net_mosq.h> +#include <send_mosq.h> +#include <time_mosq.h> + +extern uint64_t last_retained; +extern char *last_sub; +extern int last_qos; + +struct mosquitto *context__init(struct mosquitto_db *db, mosq_sock_t sock) +{ + return mosquitto__calloc(1, sizeof(struct mosquitto)); +} + +int log__printf(struct mosquitto *mosq, int priority, const char *fmt, ...) +{ + return 0; +} + +time_t mosquitto_time(void) +{ + return 123; +} + +int net__socket_close(struct mosquitto_db *db, struct mosquitto *mosq) +{ + return MOSQ_ERR_SUCCESS; +} + +int send__pingreq(struct mosquitto *mosq) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_acl_check(struct mosquitto_db *db, struct mosquitto *context, const char *topic, long payloadlen, void* payload, int qos, bool retain, int access) +{ + return MOSQ_ERR_SUCCESS; +} + +int acl__find_acls(struct mosquitto_db *db, struct mosquitto *context) +{ + return MOSQ_ERR_SUCCESS; +} + + +int send__publish(struct mosquitto *mosq, uint16_t mid, const char *topic, uint32_t payloadlen, const void *payload, int qos, bool retain, bool dup, const mosquitto_property *cmsg_props, const mosquitto_property *store_props, uint32_t expiry_interval) +{ + return MOSQ_ERR_SUCCESS; +} + +int send__pubcomp(struct mosquitto *mosq, uint16_t mid) +{ + return MOSQ_ERR_SUCCESS; +} + +int send__pubrec(struct mosquitto *mosq, uint16_t mid, uint8_t reason_code) +{ + return MOSQ_ERR_SUCCESS; +} + +int send__pubrel(struct mosquitto *mosq, uint16_t mid) +{ + return MOSQ_ERR_SUCCESS; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/persist_write_test.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/persist_write_test.c new file mode 100644 index 0000000..b604376 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/persist_write_test.c @@ -0,0 +1,386 @@ +/* Tests for persistence. + * + * FIXME - these need to be aggressive about finding failures, at the moment + * they are just confirming that good behaviour works. */ + +#include <CUnit/CUnit.h> +#include <CUnit/Basic.h> + +#define WITH_BROKER +#define WITH_PERSISTENCE + +#include "mosquitto_broker_internal.h" +#include "persist.h" + +uint64_t last_retained; +char *last_sub = NULL; +int last_qos; + + +/* read entire file into memory */ +static int file_read(const char *filename, uint8_t **data, size_t *len) +{ + FILE *fptr; + size_t rc; + + fptr = fopen(filename, "rb"); + if(!fptr) return 1; + + fseek(fptr, 0, SEEK_END); + *len = ftell(fptr); + *data = malloc(*len); + if(!(*data)){ + fclose(fptr); + return 1; + } + fseek(fptr, 0, SEEK_SET); + rc = fread(*data, 1, *len, fptr); + fclose(fptr); + + if(rc == *len){ + return 0; + }else{ + *len = 0; + free(*data); + return 1; + } +} + +/* Crude file diff, only for small files */ +static int file_diff(const char *one, const char *two) +{ + size_t len1, len2; + uint8_t *data1 = NULL, *data2 = NULL; + int rc = 1; + + if(file_read(one, &data1, &len1)){ + return 1; + } + + if(file_read(two, &data2, &len2)){ + free(data1); + return 1; + } + + if(len1 == len2){ + rc = memcmp(data1, data2, len1); + } + free(data1); + free(data2); + + return rc; +} + +static void TEST_persistence_disabled(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + rc = persist__backup(&db, false); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); + + config.persistence_filepath = "disabled.db"; + rc = persist__backup(&db, false); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); +} + + +static void TEST_empty_file(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + + config.persistence_filepath = "empty.db"; + rc = persist__backup(&db, false); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_EQUAL(0, file_diff("files/persist_write/empty.test-db", "empty.db")); + unlink("empty.db"); +} + + +static void TEST_v5_config_ok(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v5-cfg.test-db"; + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + config.persistence_filepath = "v5-cfg.db"; + rc = persist__backup(&db, true); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + CU_ASSERT_EQUAL(0, file_diff("files/persist_read/v5-cfg.test-db", "v5-cfg.db")); + unlink("v5-cfg.db"); +} + + +static void TEST_v5_message_store_no_ref(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v5-message-store.test-db"; + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + config.persistence_filepath = "v5-message-store-no-ref.db"; + rc = persist__backup(&db, true); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + CU_ASSERT_EQUAL(0, file_diff("files/persist_write/v5-message-store-no-ref.test-db", "v5-message-store-no-ref.db")); + unlink("v5-message-store-no-ref.db"); +} + + +static void TEST_v5_message_store_props(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + struct mosquitto__listener listener; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + memset(&listener, 0, sizeof(struct mosquitto__listener)); + db.config = &config; + listener.port = 1883; + config.listeners = &listener; + config.listener_count = 1; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v5-message-store-props.test-db"; + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + config.persistence_filepath = "v5-message-store-props.db"; + rc = persist__backup(&db, true); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + CU_ASSERT_EQUAL(0, file_diff("files/persist_read/v5-message-store-props.test-db", "v5-message-store-props.db")); + unlink("v5-message-store-props.db"); +} + + +static void TEST_v5_client(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v5-client.test-db"; + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + config.persistence_filepath = "v5-client.db"; + rc = persist__backup(&db, true); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + CU_ASSERT_EQUAL(0, file_diff("files/persist_read/v5-client.test-db", "v5-client.db")); + unlink("v5-client.db"); +} + + +static void TEST_v5_client_message(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + struct mosquitto__listener listener; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + memset(&listener, 0, sizeof(struct mosquitto__listener)); + db.config = &config; + listener.port = 1883; + config.listeners = &listener; + config.listener_count = 1; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v5-client-message.test-db"; + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + config.persistence_filepath = "v5-client-message.db"; + rc = persist__backup(&db, true); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + CU_ASSERT_EQUAL(0, file_diff("files/persist_read/v5-client-message.test-db", "v5-client-message.db")); + unlink("v5-client-message.db"); +} + + +static void TEST_v5_client_message_props(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + struct mosquitto__listener listener; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + memset(&listener, 0, sizeof(struct mosquitto__listener)); + db.config = &config; + listener.port = 1883; + config.listeners = &listener; + config.listener_count = 1; + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v5-client-message-props.test-db"; + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + CU_ASSERT_PTR_NOT_NULL(db.msg_store); + if(db.msg_store){ + CU_ASSERT_PTR_NOT_NULL(db.msg_store->source_listener); + if(db.msg_store->source_listener){ + CU_ASSERT_EQUAL(db.msg_store->source_listener->port, 1883); + } + } + + config.persistence_filepath = "v5-client-message-props.db"; + rc = persist__backup(&db, true); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + CU_ASSERT_EQUAL(0, file_diff("files/persist_read/v5-client-message-props.test-db", "v5-client-message-props.db")); + unlink("v5-client-message-props.db"); +} + + +static void TEST_v5_sub(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + struct mosquitto__listener listener; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + memset(&listener, 0, sizeof(struct mosquitto__listener)); + db.config = &config; + listener.port = 1883; + config.listeners = &listener; + config.listener_count = 1; + + db__open(&config, &db); + + config.persistence = true; + config.persistence_filepath = "files/persist_read/v5-sub.test-db"; + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + config.persistence_filepath = "v5-sub.db"; + rc = persist__backup(&db, true); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + CU_ASSERT_EQUAL(0, file_diff("files/persist_read/v5-sub.test-db", "v5-sub.db")); + unlink("v5-sub.db"); +} + + +#if 0 +NOT WORKING +static void TEST_v5_full(void) +{ + struct mosquitto_db db; + struct mosquitto__config config; + int rc; + + memset(&db, 0, sizeof(struct mosquitto_db)); + memset(&config, 0, sizeof(struct mosquitto__config)); + db.config = &config; + + db__open(&config, &db); + + config.persistence = true; + config.persistence_filepath = "files/persist_write/v5-full.test-db"; + rc = persist__restore(&db); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + config.persistence_filepath = "v5-full.db"; + rc = persist__backup(&db, true); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + + CU_ASSERT_EQUAL(0, file_diff("files/persist_write/v5-full.test-db", "v5-full.db")); + unlink("v5-full.db"); +} +#endif + + +/* ======================================================================== + * TEST SUITE SETUP + * ======================================================================== */ + + +int main(int argc, char *argv[]) +{ + CU_pSuite test_suite = NULL; + unsigned int fails; + + if(CU_initialize_registry() != CUE_SUCCESS){ + printf("Error initializing CUnit registry.\n"); + return 1; + } + + test_suite = CU_add_suite("Persist write", NULL, NULL); + if(!test_suite){ + printf("Error adding CUnit persist write test suite.\n"); + CU_cleanup_registry(); + return 1; + } + + if(0 + || !CU_add_test(test_suite, "Persistence disabled", TEST_persistence_disabled) + || !CU_add_test(test_suite, "Empty file", TEST_empty_file) + || !CU_add_test(test_suite, "v5 config ok", TEST_v5_config_ok) + || !CU_add_test(test_suite, "v5 message store (message has no refs)", TEST_v5_message_store_no_ref) + || !CU_add_test(test_suite, "v5 message store + props", TEST_v5_message_store_props) + || !CU_add_test(test_suite, "v5 client", TEST_v5_client) + || !CU_add_test(test_suite, "v5 client message", TEST_v5_client_message) + || !CU_add_test(test_suite, "v5 client message+props", TEST_v5_client_message_props) + || !CU_add_test(test_suite, "v5 sub", TEST_v5_sub) + //|| !CU_add_test(test_suite, "v5 full", TEST_v5_full) + ){ + + printf("Error adding persist CUnit tests.\n"); + CU_cleanup_registry(); + return 1; + } + + CU_basic_set_mode(CU_BRM_VERBOSE); + CU_basic_run_tests(); + fails = CU_get_number_of_failures(); + CU_cleanup_registry(); + + return (int)fails; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/property_add.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/property_add.c new file mode 100644 index 0000000..341c008 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/property_add.c @@ -0,0 +1,614 @@ +#include <CUnit/CUnit.h> +#include <CUnit/Basic.h> + +#include "mqtt_protocol.h" +#include "property_mosq.h" +#include "packet_mosq.h" + +/* ======================================================================== + * BAD IDENTIFIER + * ======================================================================== */ + +static void bad_add_byte_helper(int identifier) +{ + mosquitto_property *proplist = NULL; + int rc; + + rc = mosquitto_property_add_byte(&proplist, identifier, 1); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); + CU_ASSERT_PTR_NULL(proplist); +} + +static void bad_add_int16_helper(int identifier) +{ + mosquitto_property *proplist = NULL; + int rc; + + rc = mosquitto_property_add_int16(&proplist, identifier, 1); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); + CU_ASSERT_PTR_NULL(proplist); +} + +static void bad_add_int32_helper(int identifier) +{ + mosquitto_property *proplist = NULL; + int rc; + + rc = mosquitto_property_add_int32(&proplist, identifier, 1); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); + CU_ASSERT_PTR_NULL(proplist); +} + +static void bad_add_varint_helper(int identifier) +{ + mosquitto_property *proplist = NULL; + int rc; + + rc = mosquitto_property_add_varint(&proplist, identifier, 1); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); + CU_ASSERT_PTR_NULL(proplist); +} + +static void bad_add_binary_helper(int identifier) +{ + mosquitto_property *proplist = NULL; + int rc; + + rc = mosquitto_property_add_binary(&proplist, identifier, "test", 4); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); + CU_ASSERT_PTR_NULL(proplist); +} + +static void bad_add_string_helper(int identifier) +{ + mosquitto_property *proplist = NULL; + int rc; + + rc = mosquitto_property_add_string(&proplist, identifier, "test"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); + CU_ASSERT_PTR_NULL(proplist); +} + +static void bad_add_string_pair_helper(int identifier) +{ + mosquitto_property *proplist = NULL; + int rc; + + rc = mosquitto_property_add_string_pair(&proplist, identifier, "key", "value"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); + CU_ASSERT_PTR_NULL(proplist); +} + +static void TEST_add_bad_byte(void) +{ + bad_add_byte_helper(MQTT_PROP_MESSAGE_EXPIRY_INTERVAL); + bad_add_byte_helper(MQTT_PROP_CONTENT_TYPE); + bad_add_byte_helper(MQTT_PROP_RESPONSE_TOPIC); + bad_add_byte_helper(MQTT_PROP_CORRELATION_DATA); + bad_add_byte_helper(MQTT_PROP_SUBSCRIPTION_IDENTIFIER); + bad_add_byte_helper(MQTT_PROP_SESSION_EXPIRY_INTERVAL); + bad_add_byte_helper(MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER); + bad_add_byte_helper(MQTT_PROP_SERVER_KEEP_ALIVE); + bad_add_byte_helper(MQTT_PROP_AUTHENTICATION_METHOD); + bad_add_byte_helper(MQTT_PROP_AUTHENTICATION_DATA); + bad_add_byte_helper(MQTT_PROP_WILL_DELAY_INTERVAL); + bad_add_byte_helper(MQTT_PROP_RESPONSE_INFORMATION); + bad_add_byte_helper(MQTT_PROP_SERVER_REFERENCE); + bad_add_byte_helper(MQTT_PROP_REASON_STRING); + bad_add_byte_helper(MQTT_PROP_RECEIVE_MAXIMUM); + bad_add_byte_helper(MQTT_PROP_TOPIC_ALIAS_MAXIMUM); + bad_add_byte_helper(MQTT_PROP_TOPIC_ALIAS); + bad_add_byte_helper(MQTT_PROP_USER_PROPERTY); + bad_add_byte_helper(MQTT_PROP_MAXIMUM_PACKET_SIZE); +} + +static void TEST_add_bad_int16(void) +{ + bad_add_int16_helper(MQTT_PROP_PAYLOAD_FORMAT_INDICATOR); + bad_add_int16_helper(MQTT_PROP_MESSAGE_EXPIRY_INTERVAL); + bad_add_int16_helper(MQTT_PROP_CONTENT_TYPE); + bad_add_int16_helper(MQTT_PROP_RESPONSE_TOPIC); + bad_add_int16_helper(MQTT_PROP_CORRELATION_DATA); + bad_add_int16_helper(MQTT_PROP_SUBSCRIPTION_IDENTIFIER); + bad_add_int16_helper(MQTT_PROP_SESSION_EXPIRY_INTERVAL); + bad_add_int16_helper(MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER); + bad_add_int16_helper(MQTT_PROP_AUTHENTICATION_METHOD); + bad_add_int16_helper(MQTT_PROP_AUTHENTICATION_DATA); + bad_add_int16_helper(MQTT_PROP_REQUEST_PROBLEM_INFORMATION); + bad_add_int16_helper(MQTT_PROP_WILL_DELAY_INTERVAL); + bad_add_int16_helper(MQTT_PROP_REQUEST_RESPONSE_INFORMATION); + bad_add_int16_helper(MQTT_PROP_RESPONSE_INFORMATION); + bad_add_int16_helper(MQTT_PROP_SERVER_REFERENCE); + bad_add_int16_helper(MQTT_PROP_REASON_STRING); + bad_add_int16_helper(MQTT_PROP_MAXIMUM_QOS); + bad_add_int16_helper(MQTT_PROP_RETAIN_AVAILABLE); + bad_add_int16_helper(MQTT_PROP_USER_PROPERTY); + bad_add_int16_helper(MQTT_PROP_MAXIMUM_PACKET_SIZE); + bad_add_int16_helper(MQTT_PROP_WILDCARD_SUB_AVAILABLE); + bad_add_int16_helper(MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE); + bad_add_int16_helper(MQTT_PROP_SHARED_SUB_AVAILABLE); +} + +static void TEST_add_bad_int32(void) +{ + bad_add_int32_helper(MQTT_PROP_PAYLOAD_FORMAT_INDICATOR); + bad_add_int32_helper(MQTT_PROP_CONTENT_TYPE); + bad_add_int32_helper(MQTT_PROP_RESPONSE_TOPIC); + bad_add_int32_helper(MQTT_PROP_CORRELATION_DATA); + bad_add_int32_helper(MQTT_PROP_SUBSCRIPTION_IDENTIFIER); + bad_add_int32_helper(MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER); + bad_add_int32_helper(MQTT_PROP_SERVER_KEEP_ALIVE); + bad_add_int32_helper(MQTT_PROP_AUTHENTICATION_METHOD); + bad_add_int32_helper(MQTT_PROP_AUTHENTICATION_DATA); + bad_add_int32_helper(MQTT_PROP_REQUEST_PROBLEM_INFORMATION); + bad_add_int32_helper(MQTT_PROP_REQUEST_RESPONSE_INFORMATION); + bad_add_int32_helper(MQTT_PROP_RESPONSE_INFORMATION); + bad_add_int32_helper(MQTT_PROP_SERVER_REFERENCE); + bad_add_int32_helper(MQTT_PROP_REASON_STRING); + bad_add_int32_helper(MQTT_PROP_RECEIVE_MAXIMUM); + bad_add_int32_helper(MQTT_PROP_TOPIC_ALIAS_MAXIMUM); + bad_add_int32_helper(MQTT_PROP_TOPIC_ALIAS); + bad_add_int32_helper(MQTT_PROP_MAXIMUM_QOS); + bad_add_int32_helper(MQTT_PROP_RETAIN_AVAILABLE); + bad_add_int32_helper(MQTT_PROP_USER_PROPERTY); + bad_add_int32_helper(MQTT_PROP_WILDCARD_SUB_AVAILABLE); + bad_add_int32_helper(MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE); + bad_add_int32_helper(MQTT_PROP_SHARED_SUB_AVAILABLE); +} + +static void TEST_add_bad_varint(void) +{ + bad_add_varint_helper(MQTT_PROP_PAYLOAD_FORMAT_INDICATOR); + bad_add_varint_helper(MQTT_PROP_MESSAGE_EXPIRY_INTERVAL); + bad_add_varint_helper(MQTT_PROP_CONTENT_TYPE); + bad_add_varint_helper(MQTT_PROP_RESPONSE_TOPIC); + bad_add_varint_helper(MQTT_PROP_CORRELATION_DATA); + bad_add_varint_helper(MQTT_PROP_SESSION_EXPIRY_INTERVAL); + bad_add_varint_helper(MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER); + bad_add_varint_helper(MQTT_PROP_SERVER_KEEP_ALIVE); + bad_add_varint_helper(MQTT_PROP_AUTHENTICATION_METHOD); + bad_add_varint_helper(MQTT_PROP_AUTHENTICATION_DATA); + bad_add_varint_helper(MQTT_PROP_REQUEST_PROBLEM_INFORMATION); + bad_add_varint_helper(MQTT_PROP_WILL_DELAY_INTERVAL); + bad_add_varint_helper(MQTT_PROP_REQUEST_RESPONSE_INFORMATION); + bad_add_varint_helper(MQTT_PROP_RESPONSE_INFORMATION); + bad_add_varint_helper(MQTT_PROP_SERVER_REFERENCE); + bad_add_varint_helper(MQTT_PROP_REASON_STRING); + bad_add_varint_helper(MQTT_PROP_RECEIVE_MAXIMUM); + bad_add_varint_helper(MQTT_PROP_TOPIC_ALIAS_MAXIMUM); + bad_add_varint_helper(MQTT_PROP_TOPIC_ALIAS); + bad_add_varint_helper(MQTT_PROP_MAXIMUM_QOS); + bad_add_varint_helper(MQTT_PROP_RETAIN_AVAILABLE); + bad_add_varint_helper(MQTT_PROP_USER_PROPERTY); + bad_add_varint_helper(MQTT_PROP_MAXIMUM_PACKET_SIZE); + bad_add_varint_helper(MQTT_PROP_WILDCARD_SUB_AVAILABLE); + bad_add_varint_helper(MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE); + bad_add_varint_helper(MQTT_PROP_SHARED_SUB_AVAILABLE); +} + +static void TEST_add_bad_binary(void) +{ + bad_add_binary_helper(MQTT_PROP_PAYLOAD_FORMAT_INDICATOR); + bad_add_binary_helper(MQTT_PROP_MESSAGE_EXPIRY_INTERVAL); + bad_add_binary_helper(MQTT_PROP_CONTENT_TYPE); + bad_add_binary_helper(MQTT_PROP_RESPONSE_TOPIC); + bad_add_binary_helper(MQTT_PROP_SUBSCRIPTION_IDENTIFIER); + bad_add_binary_helper(MQTT_PROP_SESSION_EXPIRY_INTERVAL); + bad_add_binary_helper(MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER); + bad_add_binary_helper(MQTT_PROP_SERVER_KEEP_ALIVE); + bad_add_binary_helper(MQTT_PROP_AUTHENTICATION_METHOD); + bad_add_binary_helper(MQTT_PROP_REQUEST_PROBLEM_INFORMATION); + bad_add_binary_helper(MQTT_PROP_WILL_DELAY_INTERVAL); + bad_add_binary_helper(MQTT_PROP_REQUEST_RESPONSE_INFORMATION); + bad_add_binary_helper(MQTT_PROP_RESPONSE_INFORMATION); + bad_add_binary_helper(MQTT_PROP_SERVER_REFERENCE); + bad_add_binary_helper(MQTT_PROP_REASON_STRING); + bad_add_binary_helper(MQTT_PROP_RECEIVE_MAXIMUM); + bad_add_binary_helper(MQTT_PROP_TOPIC_ALIAS_MAXIMUM); + bad_add_binary_helper(MQTT_PROP_TOPIC_ALIAS); + bad_add_binary_helper(MQTT_PROP_MAXIMUM_QOS); + bad_add_binary_helper(MQTT_PROP_RETAIN_AVAILABLE); + bad_add_binary_helper(MQTT_PROP_USER_PROPERTY); + bad_add_binary_helper(MQTT_PROP_MAXIMUM_PACKET_SIZE); + bad_add_binary_helper(MQTT_PROP_WILDCARD_SUB_AVAILABLE); + bad_add_binary_helper(MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE); + bad_add_binary_helper(MQTT_PROP_SHARED_SUB_AVAILABLE); +} + +static void TEST_add_bad_string(void) +{ + bad_add_string_helper(MQTT_PROP_PAYLOAD_FORMAT_INDICATOR); + bad_add_string_helper(MQTT_PROP_MESSAGE_EXPIRY_INTERVAL); + bad_add_string_helper(MQTT_PROP_CORRELATION_DATA); + bad_add_string_helper(MQTT_PROP_SUBSCRIPTION_IDENTIFIER); + bad_add_string_helper(MQTT_PROP_SESSION_EXPIRY_INTERVAL); + bad_add_string_helper(MQTT_PROP_SERVER_KEEP_ALIVE); + bad_add_string_helper(MQTT_PROP_AUTHENTICATION_DATA); + bad_add_string_helper(MQTT_PROP_REQUEST_PROBLEM_INFORMATION); + bad_add_string_helper(MQTT_PROP_WILL_DELAY_INTERVAL); + bad_add_string_helper(MQTT_PROP_REQUEST_RESPONSE_INFORMATION); + bad_add_string_helper(MQTT_PROP_RECEIVE_MAXIMUM); + bad_add_string_helper(MQTT_PROP_TOPIC_ALIAS_MAXIMUM); + bad_add_string_helper(MQTT_PROP_TOPIC_ALIAS); + bad_add_string_helper(MQTT_PROP_MAXIMUM_QOS); + bad_add_string_helper(MQTT_PROP_RETAIN_AVAILABLE); + bad_add_string_helper(MQTT_PROP_USER_PROPERTY); + bad_add_string_helper(MQTT_PROP_MAXIMUM_PACKET_SIZE); + bad_add_string_helper(MQTT_PROP_WILDCARD_SUB_AVAILABLE); + bad_add_string_helper(MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE); + bad_add_string_helper(MQTT_PROP_SHARED_SUB_AVAILABLE); +} + +static void TEST_add_bad_string_pair(void) +{ + bad_add_string_pair_helper(MQTT_PROP_PAYLOAD_FORMAT_INDICATOR); + bad_add_string_pair_helper(MQTT_PROP_MESSAGE_EXPIRY_INTERVAL); + bad_add_string_pair_helper(MQTT_PROP_CONTENT_TYPE); + bad_add_string_pair_helper(MQTT_PROP_RESPONSE_TOPIC); + bad_add_string_pair_helper(MQTT_PROP_CORRELATION_DATA); + bad_add_string_pair_helper(MQTT_PROP_SUBSCRIPTION_IDENTIFIER); + bad_add_string_pair_helper(MQTT_PROP_SESSION_EXPIRY_INTERVAL); + bad_add_string_pair_helper(MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER); + bad_add_string_pair_helper(MQTT_PROP_SERVER_KEEP_ALIVE); + bad_add_string_pair_helper(MQTT_PROP_AUTHENTICATION_METHOD); + bad_add_string_pair_helper(MQTT_PROP_AUTHENTICATION_DATA); + bad_add_string_pair_helper(MQTT_PROP_REQUEST_PROBLEM_INFORMATION); + bad_add_string_pair_helper(MQTT_PROP_WILL_DELAY_INTERVAL); + bad_add_string_pair_helper(MQTT_PROP_REQUEST_RESPONSE_INFORMATION); + bad_add_string_pair_helper(MQTT_PROP_RESPONSE_INFORMATION); + bad_add_string_pair_helper(MQTT_PROP_SERVER_REFERENCE); + bad_add_string_pair_helper(MQTT_PROP_REASON_STRING); + bad_add_string_pair_helper(MQTT_PROP_RECEIVE_MAXIMUM); + bad_add_string_pair_helper(MQTT_PROP_TOPIC_ALIAS_MAXIMUM); + bad_add_string_pair_helper(MQTT_PROP_TOPIC_ALIAS); + bad_add_string_pair_helper(MQTT_PROP_MAXIMUM_QOS); + bad_add_string_pair_helper(MQTT_PROP_RETAIN_AVAILABLE); + bad_add_string_pair_helper(MQTT_PROP_MAXIMUM_PACKET_SIZE); + bad_add_string_pair_helper(MQTT_PROP_WILDCARD_SUB_AVAILABLE); + bad_add_string_pair_helper(MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE); + bad_add_string_pair_helper(MQTT_PROP_SHARED_SUB_AVAILABLE); +} + +/* ======================================================================== + * SINGLE ADD + * ======================================================================== */ + +static void single_add_byte_helper(int identifier) +{ + mosquitto_property *proplist = NULL; + int rc; + + rc = mosquitto_property_add_byte(&proplist, identifier, 1); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + if(proplist){ + CU_ASSERT_EQUAL(proplist->identifier, identifier); + CU_ASSERT_EQUAL(proplist->value.i8, 1); + CU_ASSERT_PTR_NULL(proplist->next); + + mosquitto_property_free_all(&proplist); + } +} + +static void single_add_int16_helper(int identifier) +{ + mosquitto_property *proplist = NULL; + int rc; + + rc = mosquitto_property_add_int16(&proplist, identifier, 11234); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + if(proplist){ + CU_ASSERT_EQUAL(proplist->identifier, identifier); + CU_ASSERT_EQUAL(proplist->value.i16, 11234); + CU_ASSERT_PTR_NULL(proplist->next); + + mosquitto_property_free_all(&proplist); + } +} + +static void single_add_int32_helper(int identifier) +{ + mosquitto_property *proplist = NULL; + int rc; + + rc = mosquitto_property_add_int32(&proplist, identifier, 765432); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + if(proplist){ + CU_ASSERT_EQUAL(proplist->identifier, identifier); + CU_ASSERT_EQUAL(proplist->value.i32, 765432); + CU_ASSERT_PTR_NULL(proplist->next); + + mosquitto_property_free_all(&proplist); + } +} + +static void single_add_varint_helper(int identifier) +{ + mosquitto_property *proplist = NULL; + int rc; + + rc = mosquitto_property_add_varint(&proplist, identifier, 139123999); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + if(proplist){ + CU_ASSERT_EQUAL(proplist->identifier, identifier); + CU_ASSERT_EQUAL(proplist->value.varint, 139123999); + CU_ASSERT_PTR_NULL(proplist->next); + + mosquitto_property_free_all(&proplist); + } +} + +static void single_add_binary_helper(int identifier) +{ + mosquitto_property *proplist = NULL; + int rc; + + rc = mosquitto_property_add_binary(&proplist, identifier, "test", 4); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + if(proplist){ + CU_ASSERT_EQUAL(proplist->identifier, identifier); + CU_ASSERT_EQUAL(proplist->value.bin.len, 4); + CU_ASSERT_NSTRING_EQUAL(proplist->value.bin.v, "test", 4); + CU_ASSERT_PTR_NULL(proplist->next); + + mosquitto_property_free_all(&proplist); + } +} + +static void single_add_string_helper(int identifier) +{ + mosquitto_property *proplist = NULL; + int rc; + + rc = mosquitto_property_add_string(&proplist, identifier, "string"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + if(proplist){ + CU_ASSERT_EQUAL(proplist->identifier, identifier); + CU_ASSERT_STRING_EQUAL(proplist->value.s.v, "string"); + CU_ASSERT_EQUAL(proplist->value.s.len, strlen("string")); + CU_ASSERT_PTR_NULL(proplist->next); + + mosquitto_property_free_all(&proplist); + } +} + +static void single_add_string_pair_helper(int identifier) +{ + mosquitto_property *proplist = NULL; + int rc; + + rc = mosquitto_property_add_string_pair(&proplist, identifier, "key", "value"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + if(proplist){ + CU_ASSERT_EQUAL(proplist->identifier, identifier); + CU_ASSERT_STRING_EQUAL(proplist->name.v, "key"); + CU_ASSERT_EQUAL(proplist->name.len, strlen("key")); + CU_ASSERT_STRING_EQUAL(proplist->value.s.v, "value"); + CU_ASSERT_EQUAL(proplist->value.s.len, strlen("value")); + CU_ASSERT_PTR_NULL(proplist->next); + + mosquitto_property_free_all(&proplist); + } +} + +static void TEST_add_single_byte(void) +{ + single_add_byte_helper(MQTT_PROP_PAYLOAD_FORMAT_INDICATOR); + single_add_byte_helper(MQTT_PROP_REQUEST_PROBLEM_INFORMATION); + single_add_byte_helper(MQTT_PROP_REQUEST_RESPONSE_INFORMATION); + single_add_byte_helper(MQTT_PROP_MAXIMUM_QOS); + single_add_byte_helper(MQTT_PROP_RETAIN_AVAILABLE); + single_add_byte_helper(MQTT_PROP_WILDCARD_SUB_AVAILABLE); + single_add_byte_helper(MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE); + single_add_byte_helper(MQTT_PROP_SHARED_SUB_AVAILABLE); +} + +static void TEST_add_single_int16(void) +{ + single_add_int16_helper(MQTT_PROP_SERVER_KEEP_ALIVE); + single_add_int16_helper(MQTT_PROP_RECEIVE_MAXIMUM); + single_add_int16_helper(MQTT_PROP_TOPIC_ALIAS_MAXIMUM); + single_add_int16_helper(MQTT_PROP_TOPIC_ALIAS); +} + +static void TEST_add_single_int32(void) +{ + single_add_int32_helper(MQTT_PROP_MESSAGE_EXPIRY_INTERVAL); + single_add_int32_helper(MQTT_PROP_SESSION_EXPIRY_INTERVAL); + single_add_int32_helper(MQTT_PROP_WILL_DELAY_INTERVAL); + single_add_int32_helper(MQTT_PROP_MAXIMUM_PACKET_SIZE); +} + +static void TEST_add_single_varint(void) +{ + single_add_varint_helper(MQTT_PROP_SUBSCRIPTION_IDENTIFIER); +} + +static void TEST_add_single_binary(void) +{ + single_add_binary_helper(MQTT_PROP_CORRELATION_DATA); + single_add_binary_helper(MQTT_PROP_AUTHENTICATION_DATA); +} + +static void TEST_add_single_string(void) +{ + single_add_string_helper(MQTT_PROP_CONTENT_TYPE); + single_add_string_helper(MQTT_PROP_RESPONSE_TOPIC); + single_add_string_helper(MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER); + single_add_string_helper(MQTT_PROP_AUTHENTICATION_METHOD); + single_add_string_helper(MQTT_PROP_RESPONSE_INFORMATION); + single_add_string_helper(MQTT_PROP_SERVER_REFERENCE); + single_add_string_helper(MQTT_PROP_REASON_STRING); +} + +static void TEST_add_single_string_pair(void) +{ + single_add_string_pair_helper(MQTT_PROP_USER_PROPERTY); +} + +/* ======================================================================== + * ADD ALL PROPERTIES FOR A COMMAND + * ======================================================================== */ + +static void TEST_add_all_connect(void) +{ + mosquitto_property *proplist = NULL; + mosquitto_property *p; + int count; + int rc; + + rc = mosquitto_property_add_int32(&proplist, MQTT_PROP_SESSION_EXPIRY_INTERVAL, 86400); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_string(&proplist, MQTT_PROP_AUTHENTICATION_METHOD, "basic"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_binary(&proplist, MQTT_PROP_AUTHENTICATION_DATA, "password", strlen("password")); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_byte(&proplist, MQTT_PROP_REQUEST_PROBLEM_INFORMATION, 1); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_byte(&proplist, MQTT_PROP_REQUEST_RESPONSE_INFORMATION, 1); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_int16(&proplist, MQTT_PROP_RECEIVE_MAXIMUM, 1024); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_int16(&proplist, MQTT_PROP_TOPIC_ALIAS_MAXIMUM, 64); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_string_pair(&proplist, MQTT_PROP_USER_PROPERTY, "user-agent", "mosquitto/test"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_int32(&proplist, MQTT_PROP_MAXIMUM_PACKET_SIZE, 200000000); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + + p = proplist; + count = 0; + while(p){ + count++; + p = p->next; + } + CU_ASSERT_EQUAL(count, 9); + + mosquitto_property_free_all(&proplist); +} + + +static void TEST_add_all_connack(void) +{ + mosquitto_property *proplist = NULL; + mosquitto_property *p; + int count; + int rc; + + rc = mosquitto_property_add_int32(&proplist, MQTT_PROP_SESSION_EXPIRY_INTERVAL, 86400); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_string(&proplist, MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER, "clientid"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_int16(&proplist, MQTT_PROP_SERVER_KEEP_ALIVE, 900); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_string(&proplist, MQTT_PROP_AUTHENTICATION_METHOD, "basic"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_binary(&proplist, MQTT_PROP_AUTHENTICATION_DATA, "password", strlen("password")); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_string(&proplist, MQTT_PROP_RESPONSE_INFORMATION, "response"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_string(&proplist, MQTT_PROP_SERVER_REFERENCE, "localhost"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_string(&proplist, MQTT_PROP_REASON_STRING, "reason"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_int16(&proplist, MQTT_PROP_RECEIVE_MAXIMUM, 1024); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_int16(&proplist, MQTT_PROP_TOPIC_ALIAS_MAXIMUM, 64); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_byte(&proplist, MQTT_PROP_MAXIMUM_QOS, 1); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_byte(&proplist, MQTT_PROP_RETAIN_AVAILABLE, 0); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_string_pair(&proplist, MQTT_PROP_USER_PROPERTY, "user-agent", "mosquitto/test"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_int32(&proplist, MQTT_PROP_MAXIMUM_PACKET_SIZE, 200000000); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_byte(&proplist, MQTT_PROP_WILDCARD_SUB_AVAILABLE, 0); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_byte(&proplist, MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE, 0); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + rc = mosquitto_property_add_byte(&proplist, MQTT_PROP_SHARED_SUB_AVAILABLE, 0); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist); + + p = proplist; + count = 0; + while(p){ + count++; + p = p->next; + } + CU_ASSERT_EQUAL(count, 17); + + mosquitto_property_free_all(&proplist); +} + +/* ======================================================================== + * TEST SUITE SETUP + * ======================================================================== */ + +int init_property_add_tests(void) +{ + CU_pSuite test_suite = NULL; + + test_suite = CU_add_suite("Property add", NULL, NULL); + if(!test_suite){ + printf("Error adding CUnit Property add test suite.\n"); + return 1; + } + + if(0 + || !CU_add_test(test_suite, "Add bad byte", TEST_add_bad_byte) + || !CU_add_test(test_suite, "Add bad int16", TEST_add_bad_int16) + || !CU_add_test(test_suite, "Add bad int32", TEST_add_bad_int32) + || !CU_add_test(test_suite, "Add bad varint", TEST_add_bad_varint) + || !CU_add_test(test_suite, "Add bad binary", TEST_add_bad_binary) + || !CU_add_test(test_suite, "Add bad string", TEST_add_bad_string) + || !CU_add_test(test_suite, "Add bad string pair", TEST_add_bad_string_pair) + || !CU_add_test(test_suite, "Add single byte", TEST_add_single_byte) + || !CU_add_test(test_suite, "Add single int16", TEST_add_single_int16) + || !CU_add_test(test_suite, "Add single int32", TEST_add_single_int32) + || !CU_add_test(test_suite, "Add single varint", TEST_add_single_varint) + || !CU_add_test(test_suite, "Add single binary", TEST_add_single_binary) + || !CU_add_test(test_suite, "Add single string", TEST_add_single_string) + || !CU_add_test(test_suite, "Add single string pair", TEST_add_single_string_pair) + || !CU_add_test(test_suite, "Add all CONNECT", TEST_add_all_connect) + || !CU_add_test(test_suite, "Add all CONNACK", TEST_add_all_connack) + ){ + + printf("Error adding Property Add CUnit tests.\n"); + return 1; + } + + return 0; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/property_read.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/property_read.c new file mode 100644 index 0000000..e305bf3 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/property_read.c @@ -0,0 +1,1910 @@ +#include <CUnit/CUnit.h> +#include <CUnit/Basic.h> + +#include "mqtt_protocol.h" +#include "property_mosq.h" +#include "packet_mosq.h" + +static void byte_prop_read_helper( + int command, + uint8_t *payload, + int remaining_length, + int rc_expected, + int identifier, + uint8_t value_expected) +{ + struct mosquitto__packet packet; + mosquitto_property *properties; + int rc; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = remaining_length; + rc = property__read_all(command, &packet, &properties); + + CU_ASSERT_EQUAL(rc, rc_expected); + CU_ASSERT_EQUAL(packet.pos, remaining_length); + if(properties){ + CU_ASSERT_EQUAL(properties->identifier, identifier); + CU_ASSERT_EQUAL(properties->value.i8, value_expected); + CU_ASSERT_PTR_EQUAL(properties->next, NULL); + CU_ASSERT_EQUAL(property__get_length_all(properties), 2); + mosquitto_property_free_all(&properties); + } + CU_ASSERT_PTR_EQUAL(properties, NULL); +} + +static void duplicate_byte_helper(int command, int identifier) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 4; /* Proplen = (Identifier + byte)*2 */ + payload[1] = identifier; + payload[2] = 1; + payload[3] = identifier; + payload[4] = 0; + + byte_prop_read_helper(command, payload, 5, MOSQ_ERR_DUPLICATE_PROPERTY, identifier, 1); +} + +static void bad_byte_helper(int command, int identifier) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 2; /* Proplen = Identifier + byte */ + payload[1] = identifier; + payload[2] = 2; /* 0, 1 are only valid values */ + + byte_prop_read_helper(command, payload, 3, MOSQ_ERR_PROTOCOL, identifier, 0); +} + + +static void int32_prop_read_helper( + int command, + uint8_t *payload, + int remaining_length, + int rc_expected, + int identifier, + uint32_t value_expected) +{ + struct mosquitto__packet packet; + mosquitto_property *properties; + int rc; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = remaining_length; + rc = property__read_all(command, &packet, &properties); + + CU_ASSERT_EQUAL(rc, rc_expected); + CU_ASSERT_EQUAL(packet.pos, remaining_length); + if(properties){ + CU_ASSERT_EQUAL(properties->identifier, identifier); + CU_ASSERT_EQUAL(properties->value.i32, value_expected); + CU_ASSERT_PTR_EQUAL(properties->next, NULL); + CU_ASSERT_EQUAL(property__get_length_all(properties), 5); + mosquitto_property_free_all(&properties); + } + CU_ASSERT_PTR_EQUAL(properties, NULL); +} + +static void duplicate_int32_helper(int command, int identifier) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 10; /* Proplen = (Identifier + int32)*2 */ + payload[1] = identifier; + payload[2] = 1; + payload[3] = 1; + payload[4] = 1; + payload[5] = 1; + payload[6] = identifier; + payload[7] = 0; + payload[8] = 0; + payload[9] = 0; + payload[10] = 0; + + int32_prop_read_helper(command, payload, 11, MOSQ_ERR_DUPLICATE_PROPERTY, identifier, 1); +} + + +static void int16_prop_read_helper( + int command, + uint8_t *payload, + int remaining_length, + int rc_expected, + int identifier, + uint16_t value_expected) +{ + struct mosquitto__packet packet; + mosquitto_property *properties; + int rc; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = remaining_length; + rc = property__read_all(command, &packet, &properties); + + CU_ASSERT_EQUAL(rc, rc_expected); + CU_ASSERT_EQUAL(packet.pos, remaining_length); + if(properties){ + CU_ASSERT_EQUAL(properties->identifier, identifier); + CU_ASSERT_EQUAL(properties->value.i16, value_expected); + CU_ASSERT_PTR_EQUAL(properties->next, NULL); + CU_ASSERT_EQUAL(property__get_length_all(properties), 3); + mosquitto_property_free_all(&properties); + } + CU_ASSERT_PTR_EQUAL(properties, NULL); +} + +static void duplicate_int16_helper(int command, int identifier) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 6; /* Proplen = (Identifier + int16)*2 */ + payload[1] = identifier; + payload[2] = 1; + payload[3] = 1; + payload[4] = identifier; + payload[5] = 0; + payload[6] = 0; + + int16_prop_read_helper(command, payload, 7, MOSQ_ERR_DUPLICATE_PROPERTY, identifier, 1); +} + +static void string_prop_read_helper( + int command, + uint8_t *payload, + int remaining_length, + int rc_expected, + int identifier, + const char *value_expected) +{ + struct mosquitto__packet packet; + mosquitto_property *properties; + int rc; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = remaining_length; + rc = property__read_all(command, &packet, &properties); + + CU_ASSERT_EQUAL(rc, rc_expected); + CU_ASSERT_EQUAL(packet.pos, remaining_length); + if(properties){ + CU_ASSERT_EQUAL(properties->identifier, identifier); + CU_ASSERT_EQUAL(properties->value.s.len, strlen(value_expected)); + CU_ASSERT_STRING_EQUAL(properties->value.s.v, value_expected); + CU_ASSERT_PTR_EQUAL(properties->next, NULL); + CU_ASSERT_EQUAL(property__get_length_all(properties), 1+2+strlen(value_expected)); + mosquitto_property_free_all(&properties); + } + CU_ASSERT_PTR_EQUAL(properties, NULL); +} + +static void duplicate_string_helper(int command, int identifier) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 8; + payload[1] = identifier; + payload[2] = 0; + payload[3] = 1; /* 1 length string */ + payload[4] = 'h'; + payload[5] = identifier; + payload[6] = 0; + payload[7] = 1; + payload[8] = 'h'; + + string_prop_read_helper(command, payload, 9, MOSQ_ERR_DUPLICATE_PROPERTY, identifier, ""); +} + +static void bad_string_helper(int identifier) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 6; + payload[1] = identifier; + payload[2] = 0; + payload[3] = 3; /* 1 length string */ + payload[4] = 'h'; + payload[5] = 0; /* 0 in string not allowed */ + payload[6] = 'h'; + + string_prop_read_helper(CMD_PUBLISH, payload, 7, MOSQ_ERR_MALFORMED_UTF8, identifier, ""); +} + +static void binary_prop_read_helper( + int command, + uint8_t *payload, + int remaining_length, + int rc_expected, + int identifier, + const uint8_t *value_expected, + int len_expected) +{ + struct mosquitto__packet packet; + mosquitto_property *properties; + int rc; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = remaining_length; + rc = property__read_all(command, &packet, &properties); + + CU_ASSERT_EQUAL(rc, rc_expected); + CU_ASSERT_EQUAL(packet.pos, remaining_length); + if(properties){ + CU_ASSERT_EQUAL(properties->identifier, identifier); + CU_ASSERT_EQUAL(properties->value.bin.len, len_expected); + CU_ASSERT_EQUAL(memcmp(properties->value.bin.v, value_expected, len_expected), 0); + CU_ASSERT_PTR_EQUAL(properties->next, NULL); + CU_ASSERT_EQUAL(property__get_length_all(properties), 1+2+len_expected); + mosquitto_property_free_all(&properties); + } + CU_ASSERT_PTR_EQUAL(properties, NULL); +} + +static void duplicate_binary_helper(int command, int identifier) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 8; + payload[1] = identifier; + payload[2] = 0; + payload[3] = 1; /* 2 length binary */ + payload[4] = 'h'; + payload[5] = identifier; + payload[6] = 0; + payload[7] = 1; + payload[8] = 'h'; + + string_prop_read_helper(command, payload, 9, MOSQ_ERR_DUPLICATE_PROPERTY, identifier, ""); +} + +static void string_pair_prop_read_helper( + uint8_t *payload, + int remaining_length, + int rc_expected, + int identifier, + const char *name_expected, + const char *value_expected, + bool expect_multiple) +{ + struct mosquitto__packet packet; + mosquitto_property *properties; + int rc; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = remaining_length; + rc = property__read_all(CMD_CONNECT, &packet, &properties); + + CU_ASSERT_EQUAL(rc, rc_expected); + CU_ASSERT_EQUAL(packet.pos, remaining_length); + if(properties){ + CU_ASSERT_EQUAL(properties->identifier, identifier); + CU_ASSERT_EQUAL(properties->name.len, strlen(name_expected)); + CU_ASSERT_EQUAL(properties->value.s.len, strlen(value_expected)); + CU_ASSERT_STRING_EQUAL(properties->name.v, name_expected); + CU_ASSERT_STRING_EQUAL(properties->value.s.v, value_expected); + if(expect_multiple){ + CU_ASSERT_PTR_NOT_NULL(properties->next); + }else{ + CU_ASSERT_PTR_NULL(properties->next); + CU_ASSERT_EQUAL(property__get_length_all(properties), 1+2+strlen(name_expected)+2+strlen(value_expected)); + } + mosquitto_property_free_all(&properties); + } + CU_ASSERT_PTR_NULL(properties); +} + +static void varint_prop_read_helper( + uint8_t *payload, + int remaining_length, + int rc_expected, + int identifier, + uint32_t value_expected) +{ + struct mosquitto__packet packet; + mosquitto_property *properties; + int rc; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = remaining_length; + rc = property__read_all(CMD_PUBLISH, &packet, &properties); + + CU_ASSERT_EQUAL(rc, rc_expected); + if(properties){ + CU_ASSERT_EQUAL(properties->identifier, identifier); + CU_ASSERT_EQUAL(properties->value.varint, value_expected); + CU_ASSERT_PTR_NULL(properties->next); + CU_ASSERT_EQUAL(property__get_length_all(properties), packet__varint_bytes(value_expected)+1); + mosquitto_property_free_all(&properties); + } + CU_ASSERT_PTR_NULL(properties); +} + +static void packet_helper_reason_string_user_property(int command) +{ + uint8_t payload[24] = {23, + MQTT_PROP_REASON_STRING, 0, 6, 'r', 'e', 'a', 's', 'o', 'n', + MQTT_PROP_USER_PROPERTY, 0, 4, 'n', 'a', 'm', 'e', 0, 5, 'v', 'a', 'l', 'u', 'e'}; + + struct mosquitto__packet packet; + mosquitto_property *properties, *p; + int rc; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = sizeof(payload);; + rc = property__read_all(command, &packet, &properties); + + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(properties); + if(properties){ + CU_ASSERT_PTR_NOT_NULL(properties->next); + p = properties; + + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_REASON_STRING); + CU_ASSERT_STRING_EQUAL(p->value.s.v, "reason"); + CU_ASSERT_EQUAL(p->value.s.len, strlen("reason")); + + p = p->next; + if(p){ + CU_ASSERT_PTR_NULL(p->next); + + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_USER_PROPERTY); + CU_ASSERT_STRING_EQUAL(p->value.s.v, "value"); + CU_ASSERT_EQUAL(p->value.s.len, strlen("value")); + CU_ASSERT_STRING_EQUAL(p->name.v, "name"); + CU_ASSERT_EQUAL(p->name.len, strlen("name")); + } + + mosquitto_property_free_all(&properties); + } +} + +/* ======================================================================== + * NO PROPERTIES + * ======================================================================== */ + +static void TEST_no_properties(void) +{ + struct mosquitto__packet packet; + mosquitto_property *properties = NULL; + uint8_t payload[5]; + int rc; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + memset(payload, 0, sizeof(payload)); + packet.payload = payload; + packet.remaining_length = 1; + rc = property__read_all(CMD_CONNECT, &packet, &properties); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_EQUAL(properties, NULL); + CU_ASSERT_EQUAL(packet.pos, 1); +} + +static void TEST_truncated(void) +{ + struct mosquitto__packet packet; + mosquitto_property *properties = NULL; + uint8_t payload[5]; + int rc; + + /* Zero length packet */ + memset(&packet, 0, sizeof(struct mosquitto__packet)); + memset(payload, 0, sizeof(payload)); + packet.payload = payload; + packet.remaining_length = 0; + rc = property__read_all(CMD_CONNECT, &packet, &properties); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_PROTOCOL); + CU_ASSERT_PTR_EQUAL(properties, NULL); + CU_ASSERT_EQUAL(packet.pos, 0); + + /* Proplen > 0 but not enough data */ + memset(&packet, 0, sizeof(struct mosquitto__packet)); + memset(payload, 0, sizeof(payload)); + payload[0] = 2; + packet.payload = payload; + packet.remaining_length = 1; + rc = property__read_all(CMD_CONNECT, &packet, &properties); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_PROTOCOL); + CU_ASSERT_PTR_EQUAL(properties, NULL); + CU_ASSERT_EQUAL(packet.pos, 1); + + /* Proplen > 0 but not enough data */ + memset(&packet, 0, sizeof(struct mosquitto__packet)); + memset(payload, 0, sizeof(payload)); + payload[0] = 4; + payload[1] = MQTT_PROP_PAYLOAD_FORMAT_INDICATOR; + packet.payload = payload; + packet.remaining_length = 2; + rc = property__read_all(CMD_CONNECT, &packet, &properties); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_PROTOCOL); + CU_ASSERT_PTR_EQUAL(properties, NULL); + CU_ASSERT_EQUAL(packet.pos, 2); +} + +/* ======================================================================== + * INVALID PROPERTY ID + * ======================================================================== */ + +static void TEST_invalid_property_id(void) +{ + struct mosquitto__packet packet; + mosquitto_property *properties = NULL; + uint8_t payload[5]; + int rc; + + /* ID = 0 */ + memset(&packet, 0, sizeof(struct mosquitto__packet)); + memset(payload, 0, sizeof(payload)); + payload[0] = 4; + packet.payload = payload; + packet.remaining_length = 2; + rc = property__read_all(CMD_CONNECT, &packet, &properties); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_MALFORMED_PACKET); + CU_ASSERT_PTR_EQUAL(properties, NULL); + CU_ASSERT_EQUAL(packet.pos, 2); + + /* ID = 4 */ + memset(&packet, 0, sizeof(struct mosquitto__packet)); + memset(payload, 0, sizeof(payload)); + payload[0] = 4; + payload[1] = 4; + packet.payload = payload; + packet.remaining_length = 2; + rc = property__read_all(CMD_CONNECT, &packet, &properties); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_MALFORMED_PACKET); + CU_ASSERT_PTR_EQUAL(properties, NULL); + CU_ASSERT_EQUAL(packet.pos, 2); +} + +/* ======================================================================== + * SINGLE PROPERTIES + * ======================================================================== */ + +static void TEST_single_payload_format_indicator(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 2; /* Proplen = Identifier + byte */ + payload[1] = MQTT_PROP_PAYLOAD_FORMAT_INDICATOR; + payload[2] = 1; + + byte_prop_read_helper(CMD_PUBLISH, payload, 3, MOSQ_ERR_SUCCESS, MQTT_PROP_PAYLOAD_FORMAT_INDICATOR, 1); +} + +static void TEST_single_request_problem_information(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 2; /* Proplen = Identifier + byte */ + payload[1] = MQTT_PROP_REQUEST_PROBLEM_INFORMATION; + payload[2] = 1; + + byte_prop_read_helper(CMD_CONNECT, payload, 3, MOSQ_ERR_SUCCESS, MQTT_PROP_REQUEST_PROBLEM_INFORMATION, 1); +} + +static void TEST_single_request_response_information(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 2; /* Proplen = Identifier + byte */ + payload[1] = MQTT_PROP_REQUEST_RESPONSE_INFORMATION; + payload[2] = 1; + + byte_prop_read_helper(CMD_CONNECT, payload, 3, MOSQ_ERR_SUCCESS, MQTT_PROP_REQUEST_RESPONSE_INFORMATION, 1); +} + +static void TEST_single_maximum_qos(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 2; /* Proplen = Identifier + byte */ + payload[1] = MQTT_PROP_MAXIMUM_QOS; + payload[2] = 1; + + byte_prop_read_helper(CMD_CONNACK, payload, 3, MOSQ_ERR_SUCCESS, MQTT_PROP_MAXIMUM_QOS, 1); +} + +static void TEST_single_retain_available(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 2; /* Proplen = Identifier + byte */ + payload[1] = MQTT_PROP_RETAIN_AVAILABLE; + payload[2] = 1; + + byte_prop_read_helper(CMD_CONNACK, payload, 3, MOSQ_ERR_SUCCESS, MQTT_PROP_RETAIN_AVAILABLE, 1); +} + +static void TEST_single_wildcard_subscription_available(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 2; /* Proplen = Identifier + byte */ + payload[1] = MQTT_PROP_WILDCARD_SUB_AVAILABLE; + payload[2] = 0; + + byte_prop_read_helper(CMD_CONNACK, payload, 3, MOSQ_ERR_SUCCESS, MQTT_PROP_WILDCARD_SUB_AVAILABLE, 0); +} + +static void TEST_single_subscription_identifier_available(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 2; /* Proplen = Identifier + byte */ + payload[1] = MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE; + payload[2] = 0; + + byte_prop_read_helper(CMD_CONNACK, payload, 3, MOSQ_ERR_SUCCESS, MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE, 0); +} + +static void TEST_single_shared_subscription_available(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 2; /* Proplen = Identifier + byte */ + payload[1] = MQTT_PROP_SHARED_SUB_AVAILABLE; + payload[2] = 1; + + byte_prop_read_helper(CMD_CONNACK, payload, 3, MOSQ_ERR_SUCCESS, MQTT_PROP_SHARED_SUB_AVAILABLE, 1); +} + +static void TEST_single_message_expiry_interval(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 5; /* Proplen = Identifier + int32 */ + payload[1] = MQTT_PROP_MESSAGE_EXPIRY_INTERVAL; + payload[2] = 0x12; + payload[3] = 0x23; + payload[4] = 0x34; + payload[5] = 0x45; + + int32_prop_read_helper(CMD_WILL, payload, 6, MOSQ_ERR_SUCCESS, MQTT_PROP_MESSAGE_EXPIRY_INTERVAL, 0x12233445); +} + +static void TEST_single_session_expiry_interval(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 5; /* Proplen = Identifier + int32 */ + payload[1] = MQTT_PROP_SESSION_EXPIRY_INTERVAL; + payload[2] = 0x45; + payload[3] = 0x34; + payload[4] = 0x23; + payload[5] = 0x12; + + int32_prop_read_helper(CMD_CONNACK, payload, 6, MOSQ_ERR_SUCCESS, MQTT_PROP_SESSION_EXPIRY_INTERVAL, 0x45342312); +} + +static void TEST_single_will_delay_interval(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 5; /* Proplen = Identifier + int32 */ + payload[1] = MQTT_PROP_WILL_DELAY_INTERVAL; + payload[2] = 0x45; + payload[3] = 0x34; + payload[4] = 0x23; + payload[5] = 0x12; + + int32_prop_read_helper(CMD_WILL, payload, 6, MOSQ_ERR_SUCCESS, MQTT_PROP_WILL_DELAY_INTERVAL, 0x45342312); +} + +static void TEST_single_maximum_packet_size(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 5; /* Proplen = Identifier + int32 */ + payload[1] = MQTT_PROP_MAXIMUM_PACKET_SIZE; + payload[2] = 0x45; + payload[3] = 0x34; + payload[4] = 0x23; + payload[5] = 0x12; + + int32_prop_read_helper(CMD_CONNECT, payload, 6, MOSQ_ERR_SUCCESS, MQTT_PROP_MAXIMUM_PACKET_SIZE, 0x45342312); +} + +static void TEST_single_server_keep_alive(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 3; /* Proplen = Identifier + int16 */ + payload[1] = MQTT_PROP_SERVER_KEEP_ALIVE; + payload[2] = 0x45; + payload[3] = 0x34; + + int16_prop_read_helper(CMD_CONNACK, payload, 4, MOSQ_ERR_SUCCESS, MQTT_PROP_SERVER_KEEP_ALIVE, 0x4534); +} + +static void TEST_single_receive_maximum(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 3; /* Proplen = Identifier + int16 */ + payload[1] = MQTT_PROP_RECEIVE_MAXIMUM; + payload[2] = 0x68; + payload[3] = 0x42; + + int16_prop_read_helper(CMD_CONNACK, payload, 4, MOSQ_ERR_SUCCESS, MQTT_PROP_RECEIVE_MAXIMUM, 0x6842); +} + +static void TEST_single_topic_alias_maximum(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 3; /* Proplen = Identifier + int16 */ + payload[1] = MQTT_PROP_TOPIC_ALIAS_MAXIMUM; + payload[2] = 0x68; + payload[3] = 0x42; + + int16_prop_read_helper(CMD_CONNECT, payload, 4, MOSQ_ERR_SUCCESS, MQTT_PROP_TOPIC_ALIAS_MAXIMUM, 0x6842); +} + +static void TEST_single_topic_alias(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 3; /* Proplen = Identifier + int16 */ + payload[1] = MQTT_PROP_TOPIC_ALIAS; + payload[2] = 0x68; + payload[3] = 0x42; + + int16_prop_read_helper(CMD_PUBLISH, payload, 4, MOSQ_ERR_SUCCESS, MQTT_PROP_TOPIC_ALIAS, 0x6842); +} + +static void TEST_single_content_type(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 8; + payload[1] = MQTT_PROP_CONTENT_TYPE; + payload[2] = 0x00; + payload[3] = 0x05; + payload[4] = 'h'; + payload[5] = 'e'; + payload[6] = 'l'; + payload[7] = 'l'; + payload[8] = 'o'; + + string_prop_read_helper(CMD_PUBLISH, payload, 9, MOSQ_ERR_SUCCESS, MQTT_PROP_CONTENT_TYPE, "hello"); +} + +static void TEST_single_response_topic(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 8; + payload[1] = MQTT_PROP_RESPONSE_TOPIC; + payload[2] = 0x00; + payload[3] = 0x05; + payload[4] = 'h'; + payload[5] = 'e'; + payload[6] = 'l'; + payload[7] = 'l'; + payload[8] = 'o'; + + string_prop_read_helper(CMD_WILL, payload, 9, MOSQ_ERR_SUCCESS, MQTT_PROP_RESPONSE_TOPIC, "hello"); +} + +static void TEST_single_assigned_client_identifier(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 8; + payload[1] = MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER; + payload[2] = 0x00; + payload[3] = 0x05; + payload[4] = 'h'; + payload[5] = 'e'; + payload[6] = 'l'; + payload[7] = 'l'; + payload[8] = 'o'; + + string_prop_read_helper(CMD_CONNACK, payload, 9, MOSQ_ERR_SUCCESS, MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER, "hello"); +} + +static void TEST_single_authentication_method(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 8; + payload[1] = MQTT_PROP_AUTHENTICATION_METHOD; + payload[2] = 0x00; + payload[3] = 0x05; + payload[4] = 'h'; + payload[5] = 'e'; + payload[6] = 'l'; + payload[7] = 'l'; + payload[8] = 'o'; + + string_prop_read_helper(CMD_AUTH, payload, 9, MOSQ_ERR_SUCCESS, MQTT_PROP_AUTHENTICATION_METHOD, "hello"); +} + +static void TEST_single_response_information(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 8; + payload[1] = MQTT_PROP_RESPONSE_INFORMATION; + payload[2] = 0x00; + payload[3] = 0x05; + payload[4] = 'h'; + payload[5] = 'e'; + payload[6] = 'l'; + payload[7] = 'l'; + payload[8] = 'o'; + + string_prop_read_helper(CMD_CONNACK, payload, 9, MOSQ_ERR_SUCCESS, MQTT_PROP_RESPONSE_INFORMATION, "hello"); +} + +static void TEST_single_server_reference(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 8; + payload[1] = MQTT_PROP_SERVER_REFERENCE; + payload[2] = 0x00; + payload[3] = 0x05; + payload[4] = 'h'; + payload[5] = 'e'; + payload[6] = 'l'; + payload[7] = 'l'; + payload[8] = 'o'; + + string_prop_read_helper(CMD_CONNACK, payload, 9, MOSQ_ERR_SUCCESS, MQTT_PROP_SERVER_REFERENCE, "hello"); +} + +static void TEST_single_reason_string(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 8; + payload[1] = MQTT_PROP_REASON_STRING; + payload[2] = 0x00; + payload[3] = 0x05; + payload[4] = 'h'; + payload[5] = 'e'; + payload[6] = 'l'; + payload[7] = 'l'; + payload[8] = 'o'; + + string_prop_read_helper(CMD_PUBCOMP, payload, 9, MOSQ_ERR_SUCCESS, MQTT_PROP_REASON_STRING, "hello"); +} + +static void TEST_single_correlation_data(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 8; + payload[1] = MQTT_PROP_CORRELATION_DATA; + payload[2] = 0x00; + payload[3] = 0x05; + payload[4] = 1; + payload[5] = 'e'; + payload[6] = 0; + payload[7] = 'l'; + payload[8] = 9; + + binary_prop_read_helper(CMD_PUBLISH, payload, 9, MOSQ_ERR_SUCCESS, MQTT_PROP_CORRELATION_DATA, &payload[4], 5); +} + +static void TEST_single_authentication_data(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 8; + payload[1] = MQTT_PROP_AUTHENTICATION_DATA; + payload[2] = 0x00; + payload[3] = 0x05; + payload[4] = 1; + payload[5] = 'e'; + payload[6] = 0; + payload[7] = 'l'; + payload[8] = 9; + + binary_prop_read_helper(CMD_CONNECT, payload, 9, MOSQ_ERR_SUCCESS, MQTT_PROP_AUTHENTICATION_DATA, &payload[4], 5); +} + +static void TEST_single_user_property(void) +{ + uint8_t payload[20]; + + payload[0] = 9; + payload[1] = MQTT_PROP_USER_PROPERTY; + payload[2] = 0; + payload[3] = 2; + payload[4] = 'z'; + payload[5] = 'a'; + payload[6] = 0; + payload[7] = 2; + payload[8] = 'b'; + payload[9] = 'c'; + + string_pair_prop_read_helper(payload, 10, MOSQ_ERR_SUCCESS, MQTT_PROP_USER_PROPERTY, "za", "bc", false); +} + +static void TEST_single_subscription_identifier(void) +{ + uint8_t payload[20]; + + payload[0] = 2; + payload[1] = MQTT_PROP_SUBSCRIPTION_IDENTIFIER; + payload[2] = 0; + varint_prop_read_helper(payload, 3, MOSQ_ERR_SUCCESS, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 0); + + payload[0] = 2; + payload[1] = MQTT_PROP_SUBSCRIPTION_IDENTIFIER; + payload[2] = 0x7F; + varint_prop_read_helper(payload, 3, MOSQ_ERR_SUCCESS, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 127); + + payload[0] = 3; + payload[1] = MQTT_PROP_SUBSCRIPTION_IDENTIFIER; + payload[2] = 0x80; + payload[3] = 0x01; + varint_prop_read_helper(payload, 4, MOSQ_ERR_SUCCESS, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 128); + + payload[0] = 3; + payload[1] = MQTT_PROP_SUBSCRIPTION_IDENTIFIER; + payload[2] = 0xFF; + payload[3] = 0x7F; + varint_prop_read_helper(payload, 4, MOSQ_ERR_SUCCESS, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 16383); + + payload[0] = 4; + payload[1] = MQTT_PROP_SUBSCRIPTION_IDENTIFIER; + payload[2] = 0x80; + payload[3] = 0x80; + payload[4] = 0x01; + varint_prop_read_helper(payload, 5, MOSQ_ERR_SUCCESS, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 16384); + + payload[0] = 4; + payload[1] = MQTT_PROP_SUBSCRIPTION_IDENTIFIER; + payload[2] = 0xFF; + payload[3] = 0xFF; + payload[4] = 0x7F; + varint_prop_read_helper(payload, 5, MOSQ_ERR_SUCCESS, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 2097151); + + payload[0] = 5; + payload[1] = MQTT_PROP_SUBSCRIPTION_IDENTIFIER; + payload[2] = 0x80; + payload[3] = 0x80; + payload[4] = 0x80; + payload[5] = 0x01; + varint_prop_read_helper(payload, 6, MOSQ_ERR_SUCCESS, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 2097152); + + + payload[0] = 5; + payload[1] = MQTT_PROP_SUBSCRIPTION_IDENTIFIER; + payload[2] = 0xFF; + payload[3] = 0xFF; + payload[4] = 0xFF; + payload[5] = 0x7F; + varint_prop_read_helper(payload, 6, MOSQ_ERR_SUCCESS, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 268435455); +} + +/* ======================================================================== + * DUPLICATE PROPERTIES + * ======================================================================== */ + +static void TEST_duplicate_payload_format_indicator(void) +{ + duplicate_byte_helper(CMD_PUBLISH, MQTT_PROP_PAYLOAD_FORMAT_INDICATOR); +} + +static void TEST_duplicate_request_problem_information(void) +{ + duplicate_byte_helper(CMD_CONNECT, MQTT_PROP_REQUEST_PROBLEM_INFORMATION); +} + +static void TEST_duplicate_request_response_information(void) +{ + duplicate_byte_helper(CMD_CONNECT, MQTT_PROP_REQUEST_RESPONSE_INFORMATION); +} + +static void TEST_duplicate_maximum_qos(void) +{ + duplicate_byte_helper(CMD_CONNACK, MQTT_PROP_MAXIMUM_QOS); +} + +static void TEST_duplicate_retain_available(void) +{ + duplicate_byte_helper(CMD_CONNACK, MQTT_PROP_RETAIN_AVAILABLE); +} + +static void TEST_duplicate_wildcard_subscription_available(void) +{ + duplicate_byte_helper(CMD_CONNACK, MQTT_PROP_WILDCARD_SUB_AVAILABLE); +} + +static void TEST_duplicate_subscription_identifier_available(void) +{ + duplicate_byte_helper(CMD_CONNACK, MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE); +} + +static void TEST_duplicate_shared_subscription_available(void) +{ + duplicate_byte_helper(CMD_CONNACK, MQTT_PROP_SHARED_SUB_AVAILABLE); +} + +static void TEST_duplicate_message_expiry_interval(void) +{ + duplicate_int32_helper(CMD_PUBLISH, MQTT_PROP_MESSAGE_EXPIRY_INTERVAL); +} + +static void TEST_duplicate_session_expiry_interval(void) +{ + duplicate_int32_helper(CMD_DISCONNECT, MQTT_PROP_SESSION_EXPIRY_INTERVAL); +} + +static void TEST_duplicate_will_delay_interval(void) +{ + duplicate_int32_helper(CMD_WILL, MQTT_PROP_WILL_DELAY_INTERVAL); +} + +static void TEST_duplicate_maximum_packet_size(void) +{ + duplicate_int32_helper(CMD_CONNECT, MQTT_PROP_MAXIMUM_PACKET_SIZE); +} + +static void TEST_duplicate_server_keep_alive(void) +{ + duplicate_int16_helper(CMD_CONNACK, MQTT_PROP_SERVER_KEEP_ALIVE); +} + +static void TEST_duplicate_receive_maximum(void) +{ + duplicate_int16_helper(CMD_CONNACK, MQTT_PROP_RECEIVE_MAXIMUM); +} + +static void TEST_duplicate_topic_alias_maximum(void) +{ + duplicate_int16_helper(CMD_CONNECT, MQTT_PROP_TOPIC_ALIAS_MAXIMUM); +} + +static void TEST_duplicate_topic_alias(void) +{ + duplicate_int16_helper(CMD_PUBLISH, MQTT_PROP_TOPIC_ALIAS); +} + +static void TEST_duplicate_content_type(void) +{ + duplicate_string_helper(CMD_PUBLISH, MQTT_PROP_CONTENT_TYPE); +} + +static void TEST_duplicate_response_topic(void) +{ + duplicate_string_helper(CMD_PUBLISH, MQTT_PROP_RESPONSE_TOPIC); +} + +static void TEST_duplicate_assigned_client_identifier(void) +{ + duplicate_string_helper(CMD_CONNACK, MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER); +} + +static void TEST_duplicate_authentication_method(void) +{ + duplicate_string_helper(CMD_AUTH, MQTT_PROP_AUTHENTICATION_METHOD); +} + +static void TEST_duplicate_response_information(void) +{ + duplicate_string_helper(CMD_CONNACK, MQTT_PROP_RESPONSE_INFORMATION); +} + +static void TEST_duplicate_server_reference(void) +{ + duplicate_string_helper(CMD_CONNACK, MQTT_PROP_SERVER_REFERENCE); +} + +static void TEST_duplicate_reason_string(void) +{ + duplicate_string_helper(CMD_PUBACK, MQTT_PROP_REASON_STRING); +} + +static void TEST_duplicate_correlation_data(void) +{ + duplicate_binary_helper(CMD_PUBLISH, MQTT_PROP_CORRELATION_DATA); +} + +static void TEST_duplicate_authentication_data(void) +{ + duplicate_binary_helper(CMD_CONNACK, MQTT_PROP_AUTHENTICATION_DATA); +} + +static void TEST_duplicate_user_property(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 18; /* Proplen = (Identifier + byte)*2 */ + payload[1] = MQTT_PROP_USER_PROPERTY; + payload[2] = 0; + payload[3] = 2; + payload[4] = 'a'; + payload[5] = 'b'; + payload[6] = 0; + payload[7] = 2; + payload[8] = 'g'; + payload[9] = 'h'; + payload[10] = MQTT_PROP_USER_PROPERTY; + payload[11] = 0; + payload[12] = 2; + payload[13] = 'c'; + payload[14] = 'd'; + payload[15] = 0; + payload[16] = 2; + payload[17] = 'e'; + payload[18] = 'f'; + + string_pair_prop_read_helper(payload, 19, MOSQ_ERR_SUCCESS, MQTT_PROP_USER_PROPERTY, "ab", "gh", true); +} + +static void TEST_duplicate_subscription_identifier(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 4; /* Proplen = (Identifier + byte)*2 */ + payload[1] = MQTT_PROP_SUBSCRIPTION_IDENTIFIER; + payload[2] = 0x80; + payload[3] = 0x02; + payload[4] = MQTT_PROP_SUBSCRIPTION_IDENTIFIER; + payload[5] = 0x04; + + varint_prop_read_helper(payload, 5, MOSQ_ERR_PROTOCOL, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 0); +} + +/* ======================================================================== + * BAD PROPERTY VALUES + * ======================================================================== */ + +static void TEST_bad_request_problem_information(void) +{ + bad_byte_helper(CMD_CONNECT, MQTT_PROP_REQUEST_PROBLEM_INFORMATION); +} + +static void TEST_bad_request_response_information(void) +{ + bad_byte_helper(CMD_CONNECT, MQTT_PROP_REQUEST_RESPONSE_INFORMATION); +} + +static void TEST_bad_maximum_qos(void) +{ + bad_byte_helper(CMD_CONNACK, MQTT_PROP_MAXIMUM_QOS); +} + +static void TEST_bad_retain_available(void) +{ + bad_byte_helper(CMD_CONNACK, MQTT_PROP_RETAIN_AVAILABLE); +} + +static void TEST_bad_wildcard_sub_available(void) +{ + bad_byte_helper(CMD_CONNACK, MQTT_PROP_WILDCARD_SUB_AVAILABLE); +} + +static void TEST_bad_subscription_id_available(void) +{ + bad_byte_helper(CMD_CONNACK, MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE); +} + +static void TEST_bad_shared_sub_available(void) +{ + bad_byte_helper(CMD_CONNACK, MQTT_PROP_SHARED_SUB_AVAILABLE); +} + +static void TEST_bad_maximum_packet_size(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 5; /* Proplen = Identifier + int32 */ + payload[1] = MQTT_PROP_MAXIMUM_PACKET_SIZE; + payload[2] = 0; + payload[3] = 0; + payload[4] = 0; + payload[5] = 0; /* 0 is invalid */ + + int32_prop_read_helper(CMD_CONNACK, payload, 6, MOSQ_ERR_PROTOCOL, MQTT_PROP_MAXIMUM_PACKET_SIZE, 0); +} + +static void TEST_bad_receive_maximum(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 3; /* Proplen = Identifier + int16 */ + payload[1] = MQTT_PROP_RECEIVE_MAXIMUM; + payload[2] = 0; + payload[3] = 0; /* 0 is invalid */ + + int32_prop_read_helper(CMD_CONNECT, payload, 4, MOSQ_ERR_PROTOCOL, MQTT_PROP_RECEIVE_MAXIMUM, 0); +} + +static void TEST_bad_topic_alias(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 3; /* Proplen = Identifier + int16 */ + payload[1] = MQTT_PROP_TOPIC_ALIAS; + payload[2] = 0; + payload[3] = 0; /* 0 is invalid */ + + int32_prop_read_helper(CMD_PUBLISH, payload, 4, MOSQ_ERR_PROTOCOL, MQTT_PROP_TOPIC_ALIAS, 0); +} + +static void TEST_bad_content_type(void) +{ + bad_string_helper(MQTT_PROP_CONTENT_TYPE); +} + +static void TEST_bad_subscription_identifier(void) +{ + uint8_t payload[20]; + + memset(&payload, 0, sizeof(payload)); + payload[0] = 6; + payload[1] = MQTT_PROP_SUBSCRIPTION_IDENTIFIER; + payload[2] = 0xFF; + payload[3] = 0xFF; + payload[4] = 0xFF; + payload[5] = 0xFF; + payload[6] = 0x01; + + varint_prop_read_helper(payload, 7, MOSQ_ERR_PROTOCOL, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 0); +} + +/* ======================================================================== + * CONTROL PACKET TESTS + * ======================================================================== */ + +static void TEST_packet_connect(void) +{ + uint8_t payload[] = {0, + MQTT_PROP_SESSION_EXPIRY_INTERVAL, 0x12, 0x45, 0x00, 0x00, + MQTT_PROP_RECEIVE_MAXIMUM, 0x00, 0x05, + MQTT_PROP_MAXIMUM_PACKET_SIZE, 0x12, 0x45, 0x00, 0x00, + MQTT_PROP_TOPIC_ALIAS_MAXIMUM, 0x00, 0x02, + MQTT_PROP_REQUEST_PROBLEM_INFORMATION, 1, + MQTT_PROP_REQUEST_RESPONSE_INFORMATION, 1, + MQTT_PROP_USER_PROPERTY, 0, 4, 'n', 'a', 'm', 'e', 0, 5, 'v', 'a', 'l', 'u', 'e', + MQTT_PROP_AUTHENTICATION_METHOD, 0x00, 0x04, 'n', 'o', 'n', 'e', + MQTT_PROP_AUTHENTICATION_DATA, 0x00, 0x02, 1, 2}; + + struct mosquitto__packet packet; + mosquitto_property *properties, *p; + int rc; + + payload[0] = sizeof(payload)-1; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = sizeof(payload);; + rc = property__read_all(CMD_CONNECT, &packet, &properties); + + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + p = properties; + CU_ASSERT_PTR_NOT_NULL(properties); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_SESSION_EXPIRY_INTERVAL); + CU_ASSERT_EQUAL(p->value.i32, 0x12450000); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_RECEIVE_MAXIMUM); + CU_ASSERT_EQUAL(p->value.i16, 0x0005); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_MAXIMUM_PACKET_SIZE); + CU_ASSERT_EQUAL(p->value.i32, 0x12450000); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_TOPIC_ALIAS_MAXIMUM); + CU_ASSERT_EQUAL(p->value.i16, 0x0002); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_REQUEST_PROBLEM_INFORMATION); + CU_ASSERT_EQUAL(p->value.i8, 1); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_REQUEST_RESPONSE_INFORMATION); + CU_ASSERT_EQUAL(p->value.i8, 1); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_USER_PROPERTY); + CU_ASSERT_STRING_EQUAL(p->value.s.v, "value"); + CU_ASSERT_EQUAL(p->value.s.len, strlen("value")); + CU_ASSERT_STRING_EQUAL(p->name.v, "name"); + CU_ASSERT_EQUAL(p->name.len, strlen("name")); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_AUTHENTICATION_METHOD); + CU_ASSERT_STRING_EQUAL(p->value.s.v, "none"); + CU_ASSERT_EQUAL(p->value.s.len, strlen("none")); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_AUTHENTICATION_DATA); + CU_ASSERT_EQUAL(p->value.bin.v[0], 1); + CU_ASSERT_EQUAL(p->value.bin.v[1], 2); + CU_ASSERT_EQUAL(p->value.s.len, 2); + } + } + } + } + } + } + } + } + } + + mosquitto_property_free_all(&properties); +} + +static void TEST_packet_connack(void) +{ + uint8_t payload[] = {0, + MQTT_PROP_SESSION_EXPIRY_INTERVAL, 0x12, 0x45, 0x00, 0x00, + MQTT_PROP_RECEIVE_MAXIMUM, 0x00, 0x05, + MQTT_PROP_MAXIMUM_QOS, 1, + MQTT_PROP_RETAIN_AVAILABLE, 0, + MQTT_PROP_MAXIMUM_PACKET_SIZE, 0x12, 0x45, 0x00, 0x00, + MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER, 0x00, 0x02, 'a', 'b', + MQTT_PROP_TOPIC_ALIAS_MAXIMUM, 0x00, 0x02, + MQTT_PROP_REASON_STRING, 0, 6, 'r', 'e', 'a', 's', 'o', 'n', + MQTT_PROP_USER_PROPERTY, 0, 4, 'n', 'a', 'm', 'e', 0, 5, 'v', 'a', 'l', 'u', 'e', + MQTT_PROP_WILDCARD_SUB_AVAILABLE, 0, + MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE, 0, + MQTT_PROP_SHARED_SUB_AVAILABLE, 0, + MQTT_PROP_SERVER_KEEP_ALIVE, 0x00, 0xFF, + MQTT_PROP_RESPONSE_INFORMATION, 0x00, 0x03, 'r', 's', 'p', + MQTT_PROP_SERVER_REFERENCE, 0x00, 0x04, 's', 'e', 'r', 'v', + MQTT_PROP_AUTHENTICATION_METHOD, 0x00, 0x04, 'n', 'o', 'n', 'e', + MQTT_PROP_AUTHENTICATION_DATA, 0x00, 0x02, 1, 2}; + + struct mosquitto__packet packet; + mosquitto_property *properties, *p; + int rc; + + payload[0] = sizeof(payload)-1; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = sizeof(payload);; + rc = property__read_all(CMD_CONNACK, &packet, &properties); + + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(properties); + p = properties; + + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_SESSION_EXPIRY_INTERVAL); + CU_ASSERT_EQUAL(p->value.i32, 0x12450000); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_RECEIVE_MAXIMUM); + CU_ASSERT_EQUAL(p->value.i16, 0x0005); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_MAXIMUM_QOS); + CU_ASSERT_EQUAL(p->value.i8, 1); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_RETAIN_AVAILABLE); + CU_ASSERT_EQUAL(p->value.i8, 0); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_MAXIMUM_PACKET_SIZE); + CU_ASSERT_EQUAL(p->value.i32, 0x12450000); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER); + CU_ASSERT_STRING_EQUAL(p->value.s.v, "ab"); + CU_ASSERT_EQUAL(p->value.s.len, strlen("ab")); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_TOPIC_ALIAS_MAXIMUM); + CU_ASSERT_EQUAL(p->value.i16, 0x0002); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_REASON_STRING); + CU_ASSERT_STRING_EQUAL(p->value.s.v, "reason"); + CU_ASSERT_EQUAL(p->value.s.len, strlen("reason")); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_USER_PROPERTY); + CU_ASSERT_STRING_EQUAL(p->value.s.v, "value"); + CU_ASSERT_EQUAL(p->value.s.len, strlen("value")); + CU_ASSERT_STRING_EQUAL(p->name.v, "name"); + CU_ASSERT_EQUAL(p->name.len, strlen("name")); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_WILDCARD_SUB_AVAILABLE); + CU_ASSERT_EQUAL(p->value.i8, 0); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE); + CU_ASSERT_EQUAL(p->value.i8, 0); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_SHARED_SUB_AVAILABLE); + CU_ASSERT_EQUAL(p->value.i8, 0); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_SERVER_KEEP_ALIVE); + CU_ASSERT_EQUAL(p->value.i16, 0x00FF); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_RESPONSE_INFORMATION); + CU_ASSERT_STRING_EQUAL(p->value.s.v, "rsp"); + CU_ASSERT_EQUAL(p->value.s.len, strlen("rsp")); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_SERVER_REFERENCE); + CU_ASSERT_STRING_EQUAL(p->value.s.v, "serv"); + CU_ASSERT_EQUAL(p->value.s.len, strlen("serv")); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_AUTHENTICATION_METHOD); + CU_ASSERT_STRING_EQUAL(p->value.s.v, "none"); + CU_ASSERT_EQUAL(p->value.s.len, strlen("none")); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_AUTHENTICATION_DATA); + CU_ASSERT_EQUAL(p->value.bin.v[0], 1); + CU_ASSERT_EQUAL(p->value.bin.v[1], 2); + CU_ASSERT_EQUAL(p->value.s.len, 2); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + + mosquitto_property_free_all(&properties); +} + +static void TEST_packet_publish(void) +{ + uint8_t payload[] = {0, + MQTT_PROP_PAYLOAD_FORMAT_INDICATOR, 1, + MQTT_PROP_MESSAGE_EXPIRY_INTERVAL, 0x12, 0x45, 0x00, 0x00, + MQTT_PROP_TOPIC_ALIAS, 0x00, 0x02, + MQTT_PROP_RESPONSE_TOPIC, 0, 6, 'r', 'e', 's', 'p', 'o', 'n', + MQTT_PROP_CORRELATION_DATA, 0x00, 0x02, 1, 2, + MQTT_PROP_USER_PROPERTY, 0, 4, 'n', 'a', 'm', 'e', 0, 5, 'v', 'a', 'l', 'u', 'e', + MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 0x04, + MQTT_PROP_CONTENT_TYPE, 0, 5, 'e', 'm', 'p', 't', 'y'}; + + struct mosquitto__packet packet; + mosquitto_property *properties, *p; + int rc; + + payload[0] = sizeof(payload)-1; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = sizeof(payload);; + rc = property__read_all(CMD_PUBLISH, &packet, &properties); + + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + p = properties; + + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_PAYLOAD_FORMAT_INDICATOR); + CU_ASSERT_EQUAL(p->value.i8, 1); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_MESSAGE_EXPIRY_INTERVAL); + CU_ASSERT_EQUAL(p->value.i32, 0x12450000); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_TOPIC_ALIAS); + CU_ASSERT_EQUAL(p->value.i16, 0x0002); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_RESPONSE_TOPIC); + CU_ASSERT_STRING_EQUAL(p->value.s.v, "respon"); + CU_ASSERT_EQUAL(p->value.s.len, strlen("respon")); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_CORRELATION_DATA); + CU_ASSERT_EQUAL(p->value.bin.v[0], 1); + CU_ASSERT_EQUAL(p->value.bin.v[1], 2); + CU_ASSERT_EQUAL(p->value.bin.len, 2); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_USER_PROPERTY); + CU_ASSERT_STRING_EQUAL(p->value.s.v, "value"); + CU_ASSERT_EQUAL(p->value.s.len, strlen("value")); + CU_ASSERT_STRING_EQUAL(p->name.v, "name"); + CU_ASSERT_EQUAL(p->name.len, strlen("name")); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_SUBSCRIPTION_IDENTIFIER); + CU_ASSERT_EQUAL(p->value.varint, 0x00000004); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_CONTENT_TYPE); + CU_ASSERT_STRING_EQUAL(p->value.s.v, "empty"); + CU_ASSERT_EQUAL(p->value.s.len, strlen("empty")); + } + } + } + } + } + } + } + } + + mosquitto_property_free_all(&properties); +} + +static void TEST_packet_puback(void) +{ + packet_helper_reason_string_user_property(CMD_PUBACK); +} + +static void TEST_packet_pubrec(void) +{ + packet_helper_reason_string_user_property(CMD_PUBREC); +} + +static void TEST_packet_pubrel(void) +{ + packet_helper_reason_string_user_property(CMD_PUBREL); +} + +static void TEST_packet_pubcomp(void) +{ + packet_helper_reason_string_user_property(CMD_PUBCOMP); +} + +static void TEST_packet_subscribe(void) +{ + uint8_t payload[] = {0, + MQTT_PROP_USER_PROPERTY, 0, 4, 'n', 'a', 'm', 'e', 0, 5, 'v', 'a', 'l', 'u', 'e', + MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 0x04}; + + struct mosquitto__packet packet; + mosquitto_property *properties, *p; + int rc; + + payload[0] = sizeof(payload)-1; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = sizeof(payload);; + rc = property__read_all(CMD_SUBSCRIBE, &packet, &properties); + + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + p = properties; + + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_USER_PROPERTY); + CU_ASSERT_STRING_EQUAL(p->value.s.v, "value"); + CU_ASSERT_EQUAL(p->value.s.len, strlen("value")); + CU_ASSERT_STRING_EQUAL(p->name.v, "name"); + CU_ASSERT_EQUAL(p->name.len, strlen("name")); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_SUBSCRIPTION_IDENTIFIER); + CU_ASSERT_EQUAL(p->value.varint, 0x00000004); + } + } + + mosquitto_property_free_all(&properties); +} + +static void TEST_packet_suback(void) +{ + packet_helper_reason_string_user_property(CMD_SUBACK); +} + +static void TEST_packet_unsubscribe(void) +{ + uint8_t payload[] = {0, + MQTT_PROP_USER_PROPERTY, 0, 4, 'n', 'a', 'm', 'e', 0, 5, 'v', 'a', 'l', 'u', 'e'}; + + struct mosquitto__packet packet; + mosquitto_property *properties, *p; + int rc; + + payload[0] = sizeof(payload)-1; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = sizeof(payload);; + rc = property__read_all(CMD_UNSUBSCRIBE, &packet, &properties); + + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + p = properties; + + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_USER_PROPERTY); + CU_ASSERT_STRING_EQUAL(p->value.s.v, "value"); + CU_ASSERT_EQUAL(p->value.s.len, strlen("value")); + CU_ASSERT_STRING_EQUAL(p->name.v, "name"); + CU_ASSERT_EQUAL(p->name.len, strlen("name")); + } + + mosquitto_property_free_all(&properties); +} + +static void TEST_packet_unsuback(void) +{ + packet_helper_reason_string_user_property(CMD_UNSUBACK); +} + +static void TEST_packet_disconnect(void) +{ + uint8_t payload[] = {0, + MQTT_PROP_SESSION_EXPIRY_INTERVAL, 0x12, 0x45, 0x00, 0x00, + MQTT_PROP_REASON_STRING, 0, 6, 'r', 'e', 'a', 's', 'o', 'n', + MQTT_PROP_USER_PROPERTY, 0, 4, 'n', 'a', 'm', 'e', 0, 5, 'v', 'a', 'l', 'u', 'e'}; + + struct mosquitto__packet packet; + mosquitto_property *properties, *p; + int rc; + + payload[0] = sizeof(payload)-1; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = sizeof(payload);; + rc = property__read_all(CMD_DISCONNECT, &packet, &properties); + + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + p = properties; + + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_SESSION_EXPIRY_INTERVAL); + CU_ASSERT_EQUAL(p->value.i32, 0x12450000); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_REASON_STRING); + CU_ASSERT_STRING_EQUAL(p->value.s.v, "reason"); + CU_ASSERT_EQUAL(p->value.s.len, strlen("reason")); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_USER_PROPERTY); + CU_ASSERT_STRING_EQUAL(p->value.s.v, "value"); + CU_ASSERT_EQUAL(p->value.s.len, strlen("value")); + CU_ASSERT_STRING_EQUAL(p->name.v, "name"); + CU_ASSERT_EQUAL(p->name.len, strlen("name")); + } + } + } + + mosquitto_property_free_all(&properties); +} + +static void TEST_packet_auth(void) +{ + uint8_t payload[] = {0, + MQTT_PROP_AUTHENTICATION_METHOD, 0x00, 0x04, 'n', 'o', 'n', 'e', + MQTT_PROP_AUTHENTICATION_DATA, 0x00, 0x02, 1, 2, + MQTT_PROP_REASON_STRING, 0, 6, 'r', 'e', 'a', 's', 'o', 'n', + MQTT_PROP_USER_PROPERTY, 0, 4, 'n', 'a', 'm', 'e', 0, 5, 'v', 'a', 'l', 'u', 'e'}; + + struct mosquitto__packet packet; + mosquitto_property *properties, *p; + int rc; + + payload[0] = sizeof(payload)-1; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.payload = payload; + packet.remaining_length = sizeof(payload);; + rc = property__read_all(CMD_AUTH, &packet, &properties); + + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + p = properties; + + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_AUTHENTICATION_METHOD); + CU_ASSERT_STRING_EQUAL(p->value.s.v, "none"); + CU_ASSERT_EQUAL(p->value.s.len, strlen("none")); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_AUTHENTICATION_DATA); + CU_ASSERT_EQUAL(p->value.bin.v[0], 1); + CU_ASSERT_EQUAL(p->value.bin.v[1], 2); + CU_ASSERT_EQUAL(p->value.s.len, 2); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NOT_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_REASON_STRING); + CU_ASSERT_STRING_EQUAL(p->value.s.v, "reason"); + CU_ASSERT_EQUAL(p->value.s.len, strlen("reason")); + + p = p->next; + CU_ASSERT_PTR_NOT_NULL(p); + if(p){ + CU_ASSERT_PTR_NULL(p->next); + CU_ASSERT_EQUAL(p->identifier, MQTT_PROP_USER_PROPERTY); + CU_ASSERT_STRING_EQUAL(p->value.s.v, "value"); + CU_ASSERT_EQUAL(p->value.s.len, strlen("value")); + CU_ASSERT_STRING_EQUAL(p->name.v, "name"); + CU_ASSERT_EQUAL(p->name.len, strlen("name")); + } + } + } + } + + mosquitto_property_free_all(&properties); +} + + +/* ======================================================================== + * TEST SUITE SETUP + * ======================================================================== */ + +int init_property_read_tests(void) +{ + CU_pSuite test_suite = NULL; + + test_suite = CU_add_suite("Property read", NULL, NULL); + if(!test_suite){ + printf("Error adding CUnit Property read test suite.\n"); + return 1; + } + + if(0 + || !CU_add_test(test_suite, "Truncated packet", TEST_truncated) + || !CU_add_test(test_suite, "Invalid property ID", TEST_invalid_property_id) + || !CU_add_test(test_suite, "No properties", TEST_no_properties) + || !CU_add_test(test_suite, "Single Payload Format Indicator", TEST_single_payload_format_indicator) + || !CU_add_test(test_suite, "Single Request Problem Information", TEST_single_request_problem_information) + || !CU_add_test(test_suite, "Single Request Response Information", TEST_single_request_response_information) + || !CU_add_test(test_suite, "Single Maximum QoS", TEST_single_maximum_qos) + || !CU_add_test(test_suite, "Single Retain Available", TEST_single_retain_available) + || !CU_add_test(test_suite, "Single Wildcard Subscription Available", TEST_single_wildcard_subscription_available) + || !CU_add_test(test_suite, "Single Subscription Identifier Available", TEST_single_subscription_identifier_available) + || !CU_add_test(test_suite, "Single Shared Subscription Available", TEST_single_shared_subscription_available) + || !CU_add_test(test_suite, "Single Message Expiry Interval", TEST_single_message_expiry_interval) + || !CU_add_test(test_suite, "Single Session Expiry Interval", TEST_single_session_expiry_interval) + || !CU_add_test(test_suite, "Single Will Delay Interval", TEST_single_will_delay_interval) + || !CU_add_test(test_suite, "Single Maximum Packet Size", TEST_single_maximum_packet_size) + || !CU_add_test(test_suite, "Single Server Keep Alive", TEST_single_server_keep_alive) + || !CU_add_test(test_suite, "Single Receive Maximum", TEST_single_receive_maximum) + || !CU_add_test(test_suite, "Single Topic Alias Maximum", TEST_single_topic_alias_maximum) + || !CU_add_test(test_suite, "Single Topic Alias", TEST_single_topic_alias) + || !CU_add_test(test_suite, "Single Content Type", TEST_single_content_type) + || !CU_add_test(test_suite, "Single Response Topic", TEST_single_response_topic) + || !CU_add_test(test_suite, "Single Assigned Client Identifier", TEST_single_assigned_client_identifier) + || !CU_add_test(test_suite, "Single Authentication Method", TEST_single_authentication_method) + || !CU_add_test(test_suite, "Single Response Information", TEST_single_response_information) + || !CU_add_test(test_suite, "Single Server Reference", TEST_single_server_reference) + || !CU_add_test(test_suite, "Single Reason String", TEST_single_reason_string) + || !CU_add_test(test_suite, "Single Correlation Data", TEST_single_correlation_data) + || !CU_add_test(test_suite, "Single Authentication Data", TEST_single_authentication_data) + || !CU_add_test(test_suite, "Single User Property", TEST_single_user_property) + || !CU_add_test(test_suite, "Single Subscription Identifier", TEST_single_subscription_identifier) + || !CU_add_test(test_suite, "Duplicate Payload Format Indicator", TEST_duplicate_payload_format_indicator) + || !CU_add_test(test_suite, "Duplicate Request Problem Information", TEST_duplicate_request_problem_information) + || !CU_add_test(test_suite, "Duplicate Request Response Information", TEST_duplicate_request_response_information) + || !CU_add_test(test_suite, "Duplicate Maximum QoS", TEST_duplicate_maximum_qos) + || !CU_add_test(test_suite, "Duplicate Retain Available", TEST_duplicate_retain_available) + || !CU_add_test(test_suite, "Duplicate Wildcard Subscription Available", TEST_duplicate_wildcard_subscription_available) + || !CU_add_test(test_suite, "Duplicate Subscription Identifier Available", TEST_duplicate_subscription_identifier_available) + || !CU_add_test(test_suite, "Duplicate Shared Subscription Available", TEST_duplicate_shared_subscription_available) + || !CU_add_test(test_suite, "Duplicate Message Expiry Interval", TEST_duplicate_message_expiry_interval) + || !CU_add_test(test_suite, "Duplicate Session Expiry Interval", TEST_duplicate_session_expiry_interval) + || !CU_add_test(test_suite, "Duplicate Will Delay Interval", TEST_duplicate_will_delay_interval) + || !CU_add_test(test_suite, "Duplicate Maximum Packet Size", TEST_duplicate_maximum_packet_size) + || !CU_add_test(test_suite, "Duplicate Server Keep Alive", TEST_duplicate_server_keep_alive) + || !CU_add_test(test_suite, "Duplicate Receive Maximum", TEST_duplicate_receive_maximum) + || !CU_add_test(test_suite, "Duplicate Topic Alias Maximum", TEST_duplicate_topic_alias_maximum) + || !CU_add_test(test_suite, "Duplicate Topic Alias", TEST_duplicate_topic_alias) + || !CU_add_test(test_suite, "Duplicate Content Type", TEST_duplicate_content_type) + || !CU_add_test(test_suite, "Duplicate Response Topic", TEST_duplicate_response_topic) + || !CU_add_test(test_suite, "Duplicate Assigned Client ID", TEST_duplicate_assigned_client_identifier) + || !CU_add_test(test_suite, "Duplicate Authentication Method", TEST_duplicate_authentication_method) + || !CU_add_test(test_suite, "Duplicate Response Information", TEST_duplicate_response_information) + || !CU_add_test(test_suite, "Duplicate Server Reference", TEST_duplicate_server_reference) + || !CU_add_test(test_suite, "Duplicate Reason String", TEST_duplicate_reason_string) + || !CU_add_test(test_suite, "Duplicate Correlation Data", TEST_duplicate_correlation_data) + || !CU_add_test(test_suite, "Duplicate Authentication Data", TEST_duplicate_authentication_data) + || !CU_add_test(test_suite, "Duplicate User Property", TEST_duplicate_user_property) + || !CU_add_test(test_suite, "Duplicate Subscription Identifier", TEST_duplicate_subscription_identifier) + || !CU_add_test(test_suite, "Bad Request Problem Information", TEST_bad_request_problem_information) + || !CU_add_test(test_suite, "Bad Request Response Information", TEST_bad_request_response_information) + || !CU_add_test(test_suite, "Bad Maximum QoS", TEST_bad_maximum_qos) + || !CU_add_test(test_suite, "Bad Retain Available", TEST_bad_retain_available) + || !CU_add_test(test_suite, "Bad Wildcard Subscription Available", TEST_bad_wildcard_sub_available) + || !CU_add_test(test_suite, "Bad Subscription Identifier Available", TEST_bad_subscription_id_available) + || !CU_add_test(test_suite, "Bad Shared Subscription Available", TEST_bad_shared_sub_available) + || !CU_add_test(test_suite, "Bad Maximum Packet Size", TEST_bad_maximum_packet_size) + || !CU_add_test(test_suite, "Bad Receive Maximum", TEST_bad_receive_maximum) + || !CU_add_test(test_suite, "Bad Topic Alias", TEST_bad_topic_alias) + || !CU_add_test(test_suite, "Bad Content Type", TEST_bad_content_type) + || !CU_add_test(test_suite, "Bad Subscription Identifier", TEST_bad_subscription_identifier) + || !CU_add_test(test_suite, "Packet CONNECT", TEST_packet_connect) + || !CU_add_test(test_suite, "Packet CONNACK", TEST_packet_connack) + || !CU_add_test(test_suite, "Packet PUBLISH", TEST_packet_publish) + || !CU_add_test(test_suite, "Packet PUBACK", TEST_packet_puback) + || !CU_add_test(test_suite, "Packet PUBREC", TEST_packet_pubrec) + || !CU_add_test(test_suite, "Packet PUBREL", TEST_packet_pubrel) + || !CU_add_test(test_suite, "Packet PUBCOMP", TEST_packet_pubcomp) + || !CU_add_test(test_suite, "Packet SUBSCRIBE", TEST_packet_subscribe) + || !CU_add_test(test_suite, "Packet SUBACK", TEST_packet_suback) + || !CU_add_test(test_suite, "Packet UNSUBSCRIBE", TEST_packet_unsubscribe) + || !CU_add_test(test_suite, "Packet UNSUBACK", TEST_packet_unsuback) + || !CU_add_test(test_suite, "Packet DISCONNECT", TEST_packet_disconnect) + || !CU_add_test(test_suite, "Packet AUTH", TEST_packet_auth) + ){ + + printf("Error adding Property read CUnit tests.\n"); + return 1; + } + + return 0; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/property_user_read.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/property_user_read.c new file mode 100644 index 0000000..d458eb7 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/property_user_read.c @@ -0,0 +1,613 @@ +#include <CUnit/CUnit.h> +#include <CUnit/Basic.h> + +#include "mqtt_protocol.h" +#include "property_mosq.h" +#include "packet_mosq.h" + +static void generate_full_proplist(mosquitto_property **proplist) +{ + int rc; + + /* This isn't a valid proplist for sending, because it contains every + * property. Very useful for testing though. */ + rc = mosquitto_property_add_byte(proplist, MQTT_PROP_PAYLOAD_FORMAT_INDICATOR, 1); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_int32(proplist, MQTT_PROP_MESSAGE_EXPIRY_INTERVAL, 3600); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_string(proplist, MQTT_PROP_CONTENT_TYPE, "application/json"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_string(proplist, MQTT_PROP_RESPONSE_TOPIC, "response/topic"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_binary(proplist, MQTT_PROP_CORRELATION_DATA, "correlation-data", strlen("correlation-data")); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_varint(proplist, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 63); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_int32(proplist, MQTT_PROP_SESSION_EXPIRY_INTERVAL, 86400); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_string(proplist, MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER, "mosquitto-test"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_int16(proplist, MQTT_PROP_SERVER_KEEP_ALIVE, 180); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_string(proplist, MQTT_PROP_AUTHENTICATION_METHOD, "basic"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_binary(proplist, MQTT_PROP_AUTHENTICATION_DATA, "password", strlen("password")); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_byte(proplist, MQTT_PROP_REQUEST_PROBLEM_INFORMATION, 1); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_int32(proplist, MQTT_PROP_WILL_DELAY_INTERVAL, 1800); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_byte(proplist, MQTT_PROP_REQUEST_RESPONSE_INFORMATION, 1); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_string(proplist, MQTT_PROP_RESPONSE_INFORMATION, "response"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_string(proplist, MQTT_PROP_SERVER_REFERENCE, "localhost"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_string(proplist, MQTT_PROP_REASON_STRING, "reason"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_int16(proplist, MQTT_PROP_RECEIVE_MAXIMUM, 1024); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_int16(proplist, MQTT_PROP_TOPIC_ALIAS_MAXIMUM, 64); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_int16(proplist, MQTT_PROP_TOPIC_ALIAS, 15); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_byte(proplist, MQTT_PROP_MAXIMUM_QOS, 0); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_byte(proplist, MQTT_PROP_RETAIN_AVAILABLE, 0); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_string_pair(proplist, MQTT_PROP_USER_PROPERTY, "user-agent", "mosquitto/test"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_int32(proplist, MQTT_PROP_MAXIMUM_PACKET_SIZE, 200000000); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_byte(proplist, MQTT_PROP_WILDCARD_SUB_AVAILABLE, 0); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_byte(proplist, MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE, 0); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + if(rc != MOSQ_ERR_SUCCESS) return; + rc = mosquitto_property_add_byte(proplist, MQTT_PROP_SHARED_SUB_AVAILABLE, 0); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); +} + +static void generate_partial_proplist(mosquitto_property **proplist) +{ + int rc; + + // BYTE MISSING: MQTT_PROP_PAYLOAD_FORMAT_INDICATOR + rc = mosquitto_property_add_int32(proplist, MQTT_PROP_MESSAGE_EXPIRY_INTERVAL, 3600); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + // STRING MISSING: MQTT_PROP_CONTENT_TYPE + rc = mosquitto_property_add_string(proplist, MQTT_PROP_RESPONSE_TOPIC, "response/topic"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + // BINARY MISSING: MQTT_PROP_CORRELATION_DATA + // VARINT MISSING: MQTT_PROP_SUBSCRIPTION_IDENTIFIER + // INT32 MISSING: MQTT_PROP_SESSION_EXPIRY_INTERVAL + rc = mosquitto_property_add_string(proplist, MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER, "mosquitto-test"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + // INT16 MISSING: MQTT_PROP_SERVER_KEEP_ALIVE + rc = mosquitto_property_add_string(proplist, MQTT_PROP_AUTHENTICATION_METHOD, "basic"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + rc = mosquitto_property_add_binary(proplist, MQTT_PROP_AUTHENTICATION_DATA, "password", strlen("password")); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + rc = mosquitto_property_add_byte(proplist, MQTT_PROP_REQUEST_PROBLEM_INFORMATION, 1); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + rc = mosquitto_property_add_int32(proplist, MQTT_PROP_WILL_DELAY_INTERVAL, 1800); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + rc = mosquitto_property_add_byte(proplist, MQTT_PROP_REQUEST_RESPONSE_INFORMATION, 1); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + rc = mosquitto_property_add_string(proplist, MQTT_PROP_RESPONSE_INFORMATION, "response"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + rc = mosquitto_property_add_string(proplist, MQTT_PROP_SERVER_REFERENCE, "localhost"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + rc = mosquitto_property_add_string(proplist, MQTT_PROP_REASON_STRING, "reason"); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + rc = mosquitto_property_add_int16(proplist, MQTT_PROP_RECEIVE_MAXIMUM, 1024); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + rc = mosquitto_property_add_int16(proplist, MQTT_PROP_TOPIC_ALIAS_MAXIMUM, 64); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + rc = mosquitto_property_add_int16(proplist, MQTT_PROP_TOPIC_ALIAS, 15); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + rc = mosquitto_property_add_byte(proplist, MQTT_PROP_MAXIMUM_QOS, 0); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + rc = mosquitto_property_add_byte(proplist, MQTT_PROP_RETAIN_AVAILABLE, 0); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + // STRING PAIR MISSING: MQTT_PROP_USER_PROPERTY + rc = mosquitto_property_add_int32(proplist, MQTT_PROP_MAXIMUM_PACKET_SIZE, 200000000); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + rc = mosquitto_property_add_byte(proplist, MQTT_PROP_WILDCARD_SUB_AVAILABLE, 0); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + rc = mosquitto_property_add_byte(proplist, MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE, 0); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + rc = mosquitto_property_add_byte(proplist, MQTT_PROP_SHARED_SUB_AVAILABLE, 0); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); +} + +/* ======================================================================== + * SINGLE READ + * ======================================================================== */ + +static void read_byte_helper(const mosquitto_property *proplist, int identifier, uint8_t expected_value) +{ + const mosquitto_property *prop; + uint8_t value; + + prop = mosquitto_property_read_byte(proplist, identifier, &value, false); + CU_ASSERT_PTR_NOT_NULL(prop); + CU_ASSERT_EQUAL(value, expected_value); +} + +static void read_int16_helper(const mosquitto_property *proplist, int identifier, uint16_t expected_value) +{ + const mosquitto_property *prop; + uint16_t value; + + prop = mosquitto_property_read_int16(proplist, identifier, &value, false); + CU_ASSERT_PTR_NOT_NULL(prop); + CU_ASSERT_EQUAL(value, expected_value); +} + +static void read_int32_helper(const mosquitto_property *proplist, int identifier, uint32_t expected_value) +{ + const mosquitto_property *prop; + uint32_t value; + + prop = mosquitto_property_read_int32(proplist, identifier, &value, false); + CU_ASSERT_PTR_NOT_NULL(prop); + CU_ASSERT_EQUAL(value, expected_value); +} + +static void read_varint_helper(const mosquitto_property *proplist, int identifier, uint32_t expected_value) +{ + const mosquitto_property *prop; + uint32_t value; + + prop = mosquitto_property_read_varint(proplist, identifier, &value, false); + CU_ASSERT_PTR_NOT_NULL(prop); + CU_ASSERT_EQUAL(value, expected_value); +} + +static void read_binary_helper(const mosquitto_property *proplist, int identifier, void *expected_value, int expected_length) +{ + const mosquitto_property *prop; + void *value = NULL; + uint16_t length; + + prop = mosquitto_property_read_binary(proplist, identifier, &value, &length, false); + CU_ASSERT_PTR_NOT_NULL(prop); + CU_ASSERT_EQUAL(length, expected_length); + CU_ASSERT_PTR_NOT_NULL(value); + if(value){ + CU_ASSERT_NSTRING_EQUAL(value, expected_value, expected_length); + } + free(value); +} + +static void read_string_helper(const mosquitto_property *proplist, int identifier, char *expected_value) +{ + const mosquitto_property *prop; + char *value = NULL; + + prop = mosquitto_property_read_string(proplist, identifier, &value, false); + CU_ASSERT_PTR_NOT_NULL(prop); + CU_ASSERT_PTR_NOT_NULL(value); + if(value){ + CU_ASSERT_STRING_EQUAL(value, expected_value); + } + free(value); +} + +static void read_string_pair_helper(const mosquitto_property *proplist, int identifier, char *expected_key, char *expected_value) +{ + const mosquitto_property *prop; + char *key = NULL, *value = NULL; + + prop = mosquitto_property_read_string_pair(proplist, identifier, &key, &value, false); + CU_ASSERT_PTR_NOT_NULL(prop); + + CU_ASSERT_PTR_NOT_NULL(key); + if(key){ + CU_ASSERT_STRING_EQUAL(key, expected_key); + } + + CU_ASSERT_PTR_NOT_NULL(value); + if(value){ + CU_ASSERT_STRING_EQUAL(value, expected_value); + } + free(key); + free(value); +} + + +static void TEST_read_single_byte(void) +{ + int rc; + mosquitto_property *proplist = NULL, *proplist_copy = NULL; + + generate_full_proplist(&proplist); + if(!proplist) return; + + read_byte_helper(proplist, MQTT_PROP_PAYLOAD_FORMAT_INDICATOR, 1); + read_byte_helper(proplist, MQTT_PROP_REQUEST_PROBLEM_INFORMATION, 1); + read_byte_helper(proplist, MQTT_PROP_REQUEST_RESPONSE_INFORMATION, 1); + read_byte_helper(proplist, MQTT_PROP_MAXIMUM_QOS, 0); + read_byte_helper(proplist, MQTT_PROP_RETAIN_AVAILABLE, 0); + read_byte_helper(proplist, MQTT_PROP_WILDCARD_SUB_AVAILABLE, 0); + read_byte_helper(proplist, MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE, 0); + read_byte_helper(proplist, MQTT_PROP_SHARED_SUB_AVAILABLE, 0); + + rc = mosquitto_property_copy_all(&proplist_copy, proplist); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist_copy); + + read_byte_helper(proplist_copy, MQTT_PROP_PAYLOAD_FORMAT_INDICATOR, 1); + read_byte_helper(proplist_copy, MQTT_PROP_REQUEST_PROBLEM_INFORMATION, 1); + read_byte_helper(proplist_copy, MQTT_PROP_REQUEST_RESPONSE_INFORMATION, 1); + read_byte_helper(proplist_copy, MQTT_PROP_MAXIMUM_QOS, 0); + read_byte_helper(proplist_copy, MQTT_PROP_RETAIN_AVAILABLE, 0); + read_byte_helper(proplist_copy, MQTT_PROP_WILDCARD_SUB_AVAILABLE, 0); + read_byte_helper(proplist_copy, MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE, 0); + read_byte_helper(proplist_copy, MQTT_PROP_SHARED_SUB_AVAILABLE, 0); + + mosquitto_property_free_all(&proplist); + mosquitto_property_free_all(&proplist_copy); +} + +static void TEST_read_single_int16(void) +{ + int rc; + mosquitto_property *proplist = NULL, *proplist_copy = NULL; + + generate_full_proplist(&proplist); + if(!proplist) return; + + read_int16_helper(proplist, MQTT_PROP_SERVER_KEEP_ALIVE, 180); + read_int16_helper(proplist, MQTT_PROP_RECEIVE_MAXIMUM, 1024); + read_int16_helper(proplist, MQTT_PROP_TOPIC_ALIAS_MAXIMUM, 64); + read_int16_helper(proplist, MQTT_PROP_TOPIC_ALIAS, 15); + + rc = mosquitto_property_copy_all(&proplist_copy, proplist); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist_copy); + + read_int16_helper(proplist_copy, MQTT_PROP_SERVER_KEEP_ALIVE, 180); + read_int16_helper(proplist_copy, MQTT_PROP_RECEIVE_MAXIMUM, 1024); + read_int16_helper(proplist_copy, MQTT_PROP_TOPIC_ALIAS_MAXIMUM, 64); + read_int16_helper(proplist_copy, MQTT_PROP_TOPIC_ALIAS, 15); + + mosquitto_property_free_all(&proplist); + mosquitto_property_free_all(&proplist_copy); +} + +static void TEST_read_single_int32(void) +{ + int rc; + mosquitto_property *proplist = NULL, *proplist_copy = NULL; + + generate_full_proplist(&proplist); + if(!proplist) return; + + read_int32_helper(proplist, MQTT_PROP_MESSAGE_EXPIRY_INTERVAL, 3600); + read_int32_helper(proplist, MQTT_PROP_SESSION_EXPIRY_INTERVAL, 86400); + read_int32_helper(proplist, MQTT_PROP_WILL_DELAY_INTERVAL, 1800); + read_int32_helper(proplist, MQTT_PROP_MAXIMUM_PACKET_SIZE, 200000000); + + rc = mosquitto_property_copy_all(&proplist_copy, proplist); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist_copy); + + read_int32_helper(proplist_copy, MQTT_PROP_MESSAGE_EXPIRY_INTERVAL, 3600); + read_int32_helper(proplist_copy, MQTT_PROP_SESSION_EXPIRY_INTERVAL, 86400); + read_int32_helper(proplist_copy, MQTT_PROP_WILL_DELAY_INTERVAL, 1800); + read_int32_helper(proplist_copy, MQTT_PROP_MAXIMUM_PACKET_SIZE, 200000000); + + mosquitto_property_free_all(&proplist); + mosquitto_property_free_all(&proplist_copy); +} + +static void TEST_read_single_varint(void) +{ + int rc; + mosquitto_property *proplist = NULL, *proplist_copy = NULL; + + generate_full_proplist(&proplist); + if(!proplist) return; + + read_varint_helper(proplist, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 63); + + rc = mosquitto_property_copy_all(&proplist_copy, proplist); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist_copy); + + read_varint_helper(proplist_copy, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 63); + + mosquitto_property_free_all(&proplist); + mosquitto_property_free_all(&proplist_copy); +} + +static void TEST_read_single_binary(void) +{ + int rc; + mosquitto_property *proplist = NULL, *proplist_copy = NULL; + + generate_full_proplist(&proplist); + if(!proplist) return; + + read_binary_helper(proplist, MQTT_PROP_CORRELATION_DATA, "correlation-data", strlen("correlation-data")); + read_binary_helper(proplist, MQTT_PROP_AUTHENTICATION_DATA, "password", strlen("password")); + + rc = mosquitto_property_copy_all(&proplist_copy, proplist); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist_copy); + + if(proplist_copy){ + read_binary_helper(proplist_copy, MQTT_PROP_CORRELATION_DATA, "correlation-data", strlen("correlation-data")); + read_binary_helper(proplist_copy, MQTT_PROP_AUTHENTICATION_DATA, "password", strlen("password")); + } + + mosquitto_property_free_all(&proplist); + mosquitto_property_free_all(&proplist_copy); +} + +static void TEST_read_single_string(void) +{ + int rc; + mosquitto_property *proplist = NULL, *proplist_copy = NULL; + + generate_full_proplist(&proplist); + if(!proplist) return; + + read_string_helper(proplist, MQTT_PROP_CONTENT_TYPE, "application/json"); + read_string_helper(proplist, MQTT_PROP_RESPONSE_TOPIC, "response/topic"); + read_string_helper(proplist, MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER, "mosquitto-test"); + read_string_helper(proplist, MQTT_PROP_AUTHENTICATION_METHOD, "basic"); + read_string_helper(proplist, MQTT_PROP_RESPONSE_INFORMATION, "response"); + read_string_helper(proplist, MQTT_PROP_SERVER_REFERENCE, "localhost"); + read_string_helper(proplist, MQTT_PROP_REASON_STRING, "reason"); + + rc = mosquitto_property_copy_all(&proplist_copy, proplist); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist_copy); + + if(proplist_copy){ + read_string_helper(proplist_copy, MQTT_PROP_CONTENT_TYPE, "application/json"); + read_string_helper(proplist_copy, MQTT_PROP_RESPONSE_TOPIC, "response/topic"); + read_string_helper(proplist_copy, MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER, "mosquitto-test"); + read_string_helper(proplist_copy, MQTT_PROP_AUTHENTICATION_METHOD, "basic"); + read_string_helper(proplist_copy, MQTT_PROP_RESPONSE_INFORMATION, "response"); + read_string_helper(proplist_copy, MQTT_PROP_SERVER_REFERENCE, "localhost"); + read_string_helper(proplist_copy, MQTT_PROP_REASON_STRING, "reason"); + } + + mosquitto_property_free_all(&proplist); + mosquitto_property_free_all(&proplist_copy); +} + +static void TEST_read_single_string_pair(void) +{ + int rc; + mosquitto_property *proplist = NULL, *proplist_copy = NULL; + + generate_full_proplist(&proplist); + if(!proplist) return; + + read_string_pair_helper(proplist, MQTT_PROP_USER_PROPERTY, "user-agent", "mosquitto/test"); + + rc = mosquitto_property_copy_all(&proplist_copy, proplist); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist_copy); + + if(proplist_copy){ + read_string_pair_helper(proplist_copy, MQTT_PROP_USER_PROPERTY, "user-agent", "mosquitto/test"); + } + + mosquitto_property_free_all(&proplist); + mosquitto_property_free_all(&proplist_copy); +} + +/* ======================================================================== + * MISSING READ + * ======================================================================== */ + +static void missing_read_helper(mosquitto_property *proplist) +{ + const mosquitto_property *prop; + uint8_t byte_value; + uint16_t int16_value; + uint32_t int32_value; + char *key, *value; + uint16_t length; + + /* MISSING */ + prop = mosquitto_property_read_byte(proplist, MQTT_PROP_MESSAGE_EXPIRY_INTERVAL, &byte_value, false); + CU_ASSERT_PTR_NULL(prop); + + /* NOT MISSING */ + prop = mosquitto_property_read_int32(proplist, MQTT_PROP_WILL_DELAY_INTERVAL, &int32_value, false); + CU_ASSERT_PTR_NOT_NULL(prop); + CU_ASSERT_EQUAL(int32_value, 1800); + + /* MISSING */ + prop = mosquitto_property_read_string(proplist, MQTT_PROP_CONTENT_TYPE, &value, false); + CU_ASSERT_PTR_NULL(prop); + + /* NOT MISSING */ + prop = mosquitto_property_read_string(proplist, MQTT_PROP_RESPONSE_TOPIC, &value, false); + CU_ASSERT_PTR_NOT_NULL(prop); + CU_ASSERT_STRING_EQUAL(value, "response/topic"); + free(value); + + /* MISSING */ + prop = mosquitto_property_read_binary(proplist, MQTT_PROP_CORRELATION_DATA, (void **)&value, &length, false); + CU_ASSERT_PTR_NULL(prop); + + /* NOT MISSING */ + prop = mosquitto_property_read_byte(proplist, MQTT_PROP_REQUEST_PROBLEM_INFORMATION, &byte_value, false); + CU_ASSERT_PTR_NOT_NULL(prop); + CU_ASSERT_EQUAL(byte_value, 1); + + /* MISSING */ + prop = mosquitto_property_read_varint(proplist, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, &int32_value, false); + CU_ASSERT_PTR_NULL(prop); + + /* NOT MISSING */ + prop = mosquitto_property_read_string(proplist, MQTT_PROP_SERVER_REFERENCE, &value, false); + CU_ASSERT_PTR_NOT_NULL(prop); + CU_ASSERT_STRING_EQUAL(value, "localhost"); + free(value); + + /* MISSING */ + prop = mosquitto_property_read_int32(proplist, MQTT_PROP_SESSION_EXPIRY_INTERVAL, &int32_value, false); + CU_ASSERT_PTR_NULL(prop); + + /* NOT MISSING */ + prop = mosquitto_property_read_binary(proplist, MQTT_PROP_AUTHENTICATION_DATA, (void **)&value, &length, false); + CU_ASSERT_PTR_NOT_NULL(prop); + CU_ASSERT_NSTRING_EQUAL(value, "password", strlen("password")); + CU_ASSERT_EQUAL(length, strlen("password")); + free(value); + + /* MISSING */ + prop = mosquitto_property_read_int16(proplist, MQTT_PROP_SERVER_KEEP_ALIVE, &int16_value, false); + CU_ASSERT_PTR_NULL(prop); + + /* NOT MISSING */ + prop = mosquitto_property_read_int16(proplist, MQTT_PROP_RECEIVE_MAXIMUM, &int16_value, false); + CU_ASSERT_PTR_NOT_NULL(prop); + CU_ASSERT_EQUAL(int16_value, 1024); + + /* MISSING */ + prop = mosquitto_property_read_string_pair(proplist, MQTT_PROP_USER_PROPERTY, &key, &value, false); + CU_ASSERT_PTR_NULL(prop); +} + + +static void TEST_read_missing(void) +{ + mosquitto_property *proplist = NULL, *proplist_copy = NULL; + int rc; + + generate_partial_proplist(&proplist); + if(!proplist) return; + + missing_read_helper(proplist); + rc = mosquitto_property_copy_all(&proplist_copy, proplist); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_PTR_NOT_NULL(proplist_copy); + if(proplist_copy){ + missing_read_helper(proplist_copy); + } + + mosquitto_property_free_all(&proplist); + mosquitto_property_free_all(&proplist_copy); +} + +/* ======================================================================== + * STRING TO PROPERTY INFO + * ======================================================================== */ + +static void string_to_property_info_helper(const char *str, int rc_expected, int identifier_expected, int type_expected) +{ + int rc; + int identifier, type; + + rc = mosquitto_string_to_property_info(str, &identifier, &type); + CU_ASSERT_EQUAL(rc, rc_expected); + if(rc == MOSQ_ERR_SUCCESS){ + CU_ASSERT_EQUAL(identifier, identifier_expected); + CU_ASSERT_EQUAL(type, type_expected); + } +} + +static void TEST_string_to_property_info(void) +{ + string_to_property_info_helper("payload-format-indicator", MOSQ_ERR_SUCCESS, MQTT_PROP_PAYLOAD_FORMAT_INDICATOR, MQTT_PROP_TYPE_BYTE); + string_to_property_info_helper("message-expiry-interval", MOSQ_ERR_SUCCESS, MQTT_PROP_MESSAGE_EXPIRY_INTERVAL, MQTT_PROP_TYPE_INT32); + string_to_property_info_helper("content-type", MOSQ_ERR_SUCCESS, MQTT_PROP_CONTENT_TYPE, MQTT_PROP_TYPE_STRING); + string_to_property_info_helper("response-topic", MOSQ_ERR_SUCCESS, MQTT_PROP_RESPONSE_TOPIC, MQTT_PROP_TYPE_STRING); + string_to_property_info_helper("correlation-data", MOSQ_ERR_SUCCESS, MQTT_PROP_CORRELATION_DATA, MQTT_PROP_TYPE_BINARY); + string_to_property_info_helper("subscription-identifier", MOSQ_ERR_SUCCESS, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, MQTT_PROP_TYPE_VARINT); + string_to_property_info_helper("session-expiry-interval", MOSQ_ERR_SUCCESS, MQTT_PROP_SESSION_EXPIRY_INTERVAL, MQTT_PROP_TYPE_INT32); + string_to_property_info_helper("assigned-client-identifier", MOSQ_ERR_SUCCESS, MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER, MQTT_PROP_TYPE_STRING); + string_to_property_info_helper("server-keep-alive", MOSQ_ERR_SUCCESS, MQTT_PROP_SERVER_KEEP_ALIVE, MQTT_PROP_TYPE_INT16); + string_to_property_info_helper("authentication-method", MOSQ_ERR_SUCCESS, MQTT_PROP_AUTHENTICATION_METHOD, MQTT_PROP_TYPE_STRING); + string_to_property_info_helper("authentication-data", MOSQ_ERR_SUCCESS, MQTT_PROP_AUTHENTICATION_DATA, MQTT_PROP_TYPE_BINARY); + string_to_property_info_helper("request-problem-information", MOSQ_ERR_SUCCESS, MQTT_PROP_REQUEST_PROBLEM_INFORMATION, MQTT_PROP_TYPE_BYTE); + string_to_property_info_helper("will-delay-interval", MOSQ_ERR_SUCCESS, MQTT_PROP_WILL_DELAY_INTERVAL, MQTT_PROP_TYPE_INT32); + string_to_property_info_helper("request-response-information", MOSQ_ERR_SUCCESS, MQTT_PROP_REQUEST_RESPONSE_INFORMATION, MQTT_PROP_TYPE_BYTE); + string_to_property_info_helper("response-information", MOSQ_ERR_SUCCESS, MQTT_PROP_RESPONSE_INFORMATION, MQTT_PROP_TYPE_STRING); + string_to_property_info_helper("server-reference", MOSQ_ERR_SUCCESS, MQTT_PROP_SERVER_REFERENCE, MQTT_PROP_TYPE_STRING); + string_to_property_info_helper("reason-string", MOSQ_ERR_SUCCESS, MQTT_PROP_REASON_STRING, MQTT_PROP_TYPE_STRING); + string_to_property_info_helper("receive-maximum", MOSQ_ERR_SUCCESS, MQTT_PROP_RECEIVE_MAXIMUM, MQTT_PROP_TYPE_INT16); + string_to_property_info_helper("topic-alias-maximum", MOSQ_ERR_SUCCESS, MQTT_PROP_TOPIC_ALIAS_MAXIMUM, MQTT_PROP_TYPE_INT16); + string_to_property_info_helper("topic-alias", MOSQ_ERR_SUCCESS, MQTT_PROP_TOPIC_ALIAS, MQTT_PROP_TYPE_INT16); + string_to_property_info_helper("maximum-qos", MOSQ_ERR_SUCCESS, MQTT_PROP_MAXIMUM_QOS, MQTT_PROP_TYPE_BYTE); + string_to_property_info_helper("retain-available", MOSQ_ERR_SUCCESS, MQTT_PROP_RETAIN_AVAILABLE, MQTT_PROP_TYPE_BYTE); + string_to_property_info_helper("user-property", MOSQ_ERR_SUCCESS, MQTT_PROP_USER_PROPERTY, MQTT_PROP_TYPE_STRING_PAIR); + string_to_property_info_helper("maximum-packet-size", MOSQ_ERR_SUCCESS, MQTT_PROP_MAXIMUM_PACKET_SIZE, MQTT_PROP_TYPE_INT32); + string_to_property_info_helper("wildcard-subscription-available", MOSQ_ERR_SUCCESS, MQTT_PROP_WILDCARD_SUB_AVAILABLE, MQTT_PROP_TYPE_BYTE); + string_to_property_info_helper("subscription-identifier-available", MOSQ_ERR_SUCCESS, MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE, MQTT_PROP_TYPE_BYTE); + string_to_property_info_helper("shared-subscription-available", MOSQ_ERR_SUCCESS, MQTT_PROP_SHARED_SUB_AVAILABLE, MQTT_PROP_TYPE_BYTE); + + string_to_property_info_helper("payload-format-indicator1", MOSQ_ERR_INVAL, 0, 0); + string_to_property_info_helper("payload", MOSQ_ERR_INVAL, 0, 0); + string_to_property_info_helper("", MOSQ_ERR_INVAL, 0, 0); + string_to_property_info_helper(NULL, MOSQ_ERR_INVAL, 0, 0); +} + + +/* ======================================================================== + * TEST SUITE SETUP + * ======================================================================== */ + +int init_property_user_read_tests(void) +{ + CU_pSuite test_suite = NULL; + + test_suite = CU_add_suite("Property user read", NULL, NULL); + if(!test_suite){ + printf("Error adding CUnit Property user read test suite.\n"); + return 1; + } + + if(0 + || !CU_add_test(test_suite, "Read single byte", TEST_read_single_byte) + || !CU_add_test(test_suite, "Read single int16", TEST_read_single_int16) + || !CU_add_test(test_suite, "Read single int32", TEST_read_single_int32) + || !CU_add_test(test_suite, "Read single varint", TEST_read_single_varint) + || !CU_add_test(test_suite, "Read single binary", TEST_read_single_binary) + || !CU_add_test(test_suite, "Read single string", TEST_read_single_string) + || !CU_add_test(test_suite, "Read single string pair", TEST_read_single_string_pair) + || !CU_add_test(test_suite, "Read missing", TEST_read_missing) + || !CU_add_test(test_suite, "String to property info", TEST_string_to_property_info) + ){ + + printf("Error adding Property Add CUnit tests.\n"); + return 1; + } + + return 0; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/property_write.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/property_write.c new file mode 100644 index 0000000..2618fee --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/property_write.c @@ -0,0 +1,576 @@ +#include <CUnit/CUnit.h> +#include <CUnit/Basic.h> + +#include "mqtt_protocol.h" +#include "property_mosq.h" +#include "packet_mosq.h" + +static void byte_prop_write_helper( + int command, + int remaining_length, + int rc_expected, + int identifier, + uint8_t value_expected) +{ + mosquitto_property property; + struct mosquitto__packet packet; + mosquitto_property *properties; + int rc; + + memset(&property, 0, sizeof(mosquitto_property)); + + property.identifier = identifier; + property.value.i8 = value_expected; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.remaining_length = property__get_length_all(&property)+1; + packet.packet_length = packet.remaining_length+10; + packet.payload = calloc(packet.remaining_length+10, 1); + + CU_ASSERT_PTR_NOT_NULL(packet.payload); + if(!packet.payload) return; + + property__write_all(&packet, &property, true); + packet.pos = 0; + + rc = property__read_all(command, &packet, &properties); + + CU_ASSERT_EQUAL(rc, rc_expected); + CU_ASSERT_EQUAL(packet.pos, remaining_length); + if(properties){ + CU_ASSERT_EQUAL(properties->identifier, identifier); + CU_ASSERT_EQUAL(properties->value.i8, value_expected); + CU_ASSERT_PTR_EQUAL(properties->next, NULL); + CU_ASSERT_EQUAL(property__get_length_all(properties), 2); + mosquitto_property_free_all(&properties); + } + CU_ASSERT_PTR_EQUAL(properties, NULL); + free(packet.payload); +} + + +static void int32_prop_write_helper( + int command, + int remaining_length, + int rc_expected, + int identifier, + uint32_t value_expected) +{ + mosquitto_property property; + struct mosquitto__packet packet; + mosquitto_property *properties; + int rc; + + memset(&property, 0, sizeof(mosquitto_property)); + + property.identifier = identifier; + property.value.i32 = value_expected; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.remaining_length = property__get_length_all(&property)+1; + packet.packet_length = packet.remaining_length+10; + packet.payload = calloc(packet.remaining_length+10, 1); + + CU_ASSERT_PTR_NOT_NULL(packet.payload); + if(!packet.payload) return; + + property__write_all(&packet, &property, true); + packet.pos = 0; + + rc = property__read_all(command, &packet, &properties); + + CU_ASSERT_EQUAL(rc, rc_expected); + CU_ASSERT_EQUAL(packet.pos, remaining_length); + if(properties){ + CU_ASSERT_EQUAL(properties->identifier, identifier); + CU_ASSERT_EQUAL(properties->value.i32, value_expected); + CU_ASSERT_PTR_EQUAL(properties->next, NULL); + CU_ASSERT_EQUAL(property__get_length_all(properties), 5); + mosquitto_property_free_all(&properties); + } + CU_ASSERT_PTR_EQUAL(properties, NULL); + free(packet.payload); +} + + +static void int16_prop_write_helper( + int command, + int remaining_length, + int rc_expected, + int identifier, + uint16_t value_expected) +{ + mosquitto_property property; + struct mosquitto__packet packet; + mosquitto_property *properties; + int rc; + + memset(&property, 0, sizeof(mosquitto_property)); + + property.identifier = identifier; + property.value.i16 = value_expected; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.remaining_length = property__get_length_all(&property)+1; + packet.packet_length = packet.remaining_length+10; + packet.payload = calloc(packet.remaining_length+10, 1); + + CU_ASSERT_PTR_NOT_NULL(packet.payload); + if(!packet.payload) return; + + property__write_all(&packet, &property, true); + packet.pos = 0; + + rc = property__read_all(command, &packet, &properties); + + CU_ASSERT_EQUAL(rc, rc_expected); + CU_ASSERT_EQUAL(packet.pos, remaining_length); + if(properties){ + CU_ASSERT_EQUAL(properties->identifier, identifier); + CU_ASSERT_EQUAL(properties->value.i16, value_expected); + CU_ASSERT_PTR_EQUAL(properties->next, NULL); + CU_ASSERT_EQUAL(property__get_length_all(properties), 3); + mosquitto_property_free_all(&properties); + } + CU_ASSERT_PTR_EQUAL(properties, NULL); + free(packet.payload); +} + +static void string_prop_write_helper( + int command, + int remaining_length, + int rc_expected, + int identifier, + const char *value_expected) +{ + mosquitto_property property; + struct mosquitto__packet packet; + mosquitto_property *properties; + int rc; + + memset(&property, 0, sizeof(mosquitto_property)); + + property.identifier = identifier; + property.value.s.v = strdup(value_expected); + CU_ASSERT_PTR_NOT_NULL(property.value.s.v); + if(!property.value.s.v) return; + + property.value.s.len = strlen(value_expected); + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.remaining_length = property__get_length_all(&property)+1; + packet.packet_length = packet.remaining_length+10; + packet.payload = calloc(packet.remaining_length+10, 1); + + CU_ASSERT_PTR_NOT_NULL(packet.payload); + if(!packet.payload) return; + + property__write_all(&packet, &property, true); + packet.pos = 0; + + rc = property__read_all(command, &packet, &properties); + + CU_ASSERT_EQUAL(rc, rc_expected); + CU_ASSERT_EQUAL(packet.pos, remaining_length); + if(properties){ + CU_ASSERT_EQUAL(properties->identifier, identifier); + CU_ASSERT_EQUAL(properties->value.s.len, strlen(value_expected)); + CU_ASSERT_STRING_EQUAL(properties->value.s.v, value_expected); + CU_ASSERT_PTR_EQUAL(properties->next, NULL); + CU_ASSERT_EQUAL(property__get_length_all(properties), 1+2+strlen(value_expected)); + mosquitto_property_free_all(&properties); + } + CU_ASSERT_PTR_EQUAL(properties, NULL); + free(property.value.s.v); + free(packet.payload); +} + + +static void binary_prop_write_helper( + int command, + int remaining_length, + int rc_expected, + int identifier, + const uint8_t *value_expected, + int len_expected) +{ + mosquitto_property property; + struct mosquitto__packet packet; + mosquitto_property *properties; + int rc; + + memset(&property, 0, sizeof(mosquitto_property)); + + property.identifier = identifier; + property.value.bin.v = malloc(len_expected); + CU_ASSERT_PTR_NOT_NULL(property.value.bin.v); + if(!property.value.bin.v) return; + + memcpy(property.value.bin.v, value_expected, len_expected); + property.value.bin.len = len_expected; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.remaining_length = property__get_length_all(&property)+1; + packet.packet_length = packet.remaining_length+10; + packet.payload = calloc(packet.remaining_length+10, 1); + + CU_ASSERT_PTR_NOT_NULL(packet.payload); + if(!packet.payload) return; + + property__write_all(&packet, &property, true); + packet.pos = 0; + + rc = property__read_all(command, &packet, &properties); + + CU_ASSERT_EQUAL(rc, rc_expected); + CU_ASSERT_EQUAL(packet.pos, remaining_length); + if(properties){ + CU_ASSERT_EQUAL(properties->identifier, identifier); + CU_ASSERT_EQUAL(properties->value.bin.len, len_expected); + CU_ASSERT_EQUAL(memcmp(properties->value.bin.v, value_expected, len_expected), 0); + CU_ASSERT_PTR_EQUAL(properties->next, NULL); + CU_ASSERT_EQUAL(property__get_length_all(properties), 1+2+len_expected); + mosquitto_property_free_all(&properties); + } + CU_ASSERT_PTR_EQUAL(properties, NULL); + free(property.value.bin.v); + free(packet.payload); +} + +static void string_pair_prop_write_helper( + int remaining_length, + int rc_expected, + int identifier, + const char *name_expected, + const char *value_expected, + bool expect_multiple) +{ + mosquitto_property property; + struct mosquitto__packet packet; + mosquitto_property *properties; + int rc; + + memset(&property, 0, sizeof(mosquitto_property)); + + property.identifier = identifier; + property.value.s.v = strdup(value_expected); + CU_ASSERT_PTR_NOT_NULL(property.value.s.v); + if(!property.value.s.v) return; + property.value.s.len = strlen(value_expected); + + property.name.v = strdup(name_expected); + CU_ASSERT_PTR_NOT_NULL(property.name.v); + if(!property.name.v) return; + + property.name.len = strlen(name_expected); + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.remaining_length = property__get_length_all(&property)+1; + packet.packet_length = packet.remaining_length+10; + packet.payload = calloc(packet.remaining_length+10, 1); + + CU_ASSERT_PTR_NOT_NULL(packet.payload); + if(!packet.payload) return; + + property__write_all(&packet, &property, true); + packet.pos = 0; + + rc = property__read_all(CMD_CONNECT, &packet, &properties); + + CU_ASSERT_EQUAL(rc, rc_expected); + CU_ASSERT_EQUAL(packet.pos, remaining_length); + if(properties){ + CU_ASSERT_EQUAL(properties->identifier, identifier); + CU_ASSERT_EQUAL(properties->name.len, strlen(name_expected)); + CU_ASSERT_EQUAL(properties->value.s.len, strlen(value_expected)); + CU_ASSERT_STRING_EQUAL(properties->name.v, name_expected); + CU_ASSERT_STRING_EQUAL(properties->value.s.v, value_expected); + if(expect_multiple){ + CU_ASSERT_PTR_NOT_NULL(properties->next); + }else{ + CU_ASSERT_PTR_NULL(properties->next); + CU_ASSERT_EQUAL(property__get_length_all(properties), 1+2+strlen(name_expected)+2+strlen(value_expected)); + } + mosquitto_property_free_all(&properties); + } + CU_ASSERT_PTR_NULL(properties); + free(property.value.s.v); + free(property.name.v); + free(packet.payload); +} + +static void varint_prop_write_helper( + int remaining_length, + int rc_expected, + int identifier, + uint32_t value_expected) +{ + mosquitto_property property; + struct mosquitto__packet packet; + mosquitto_property *properties; + int rc; + + memset(&property, 0, sizeof(mosquitto_property)); + + property.identifier = identifier; + property.value.varint = value_expected; + + memset(&packet, 0, sizeof(struct mosquitto__packet)); + packet.remaining_length = property__get_length_all(&property)+1; + packet.packet_length = packet.remaining_length+10; + packet.payload = calloc(packet.remaining_length+10, 1); + + CU_ASSERT_PTR_NOT_NULL(packet.payload); + if(!packet.payload) return; + + property__write_all(&packet, &property, true); + packet.pos = 0; + + rc = property__read_all(CMD_PUBLISH, &packet, &properties); + + CU_ASSERT_EQUAL(rc, rc_expected); + if(properties){ + CU_ASSERT_EQUAL(properties->identifier, identifier); + CU_ASSERT_EQUAL(properties->value.varint, value_expected); + CU_ASSERT_PTR_NULL(properties->next); + if(value_expected < 128){ + CU_ASSERT_EQUAL(property__get_length_all(properties), 2); + }else if(value_expected < 16384){ + CU_ASSERT_EQUAL(property__get_length_all(properties), 3); + }else if(value_expected < 2097152){ + CU_ASSERT_EQUAL(property__get_length_all(properties), 4); + }else if(value_expected < 268435456){ + CU_ASSERT_EQUAL(property__get_length_all(properties), 5); + }else{ + CU_FAIL("Incorrect varint value."); + } + mosquitto_property_free_all(&properties); + } + CU_ASSERT_PTR_NULL(properties); + free(packet.payload); +} + +/* ======================================================================== + * BAD IDENTIFIER + * ======================================================================== */ + +static void TEST_bad_identifier(void) +{ + mosquitto_property property; + struct mosquitto__packet packet; + uint8_t payload[10]; + int rc; + + memset(&property, 0, sizeof(mosquitto_property)); + memset(&packet, 0, sizeof(struct mosquitto__packet)); + property.identifier = 0xFFFF; + packet.packet_length = 10; + packet.remaining_length = 8; + packet.payload = payload; + rc = property__write_all(&packet, &property, true); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); +} + + +/* ======================================================================== + * SINGLE PROPERTIES + * ======================================================================== */ + +static void TEST_single_payload_format_indicator(void) +{ + byte_prop_write_helper(CMD_PUBLISH, 3, MOSQ_ERR_SUCCESS, MQTT_PROP_PAYLOAD_FORMAT_INDICATOR, 1); +} + +static void TEST_single_request_problem_information(void) +{ + byte_prop_write_helper(CMD_CONNECT, 3, MOSQ_ERR_SUCCESS, MQTT_PROP_REQUEST_PROBLEM_INFORMATION, 1); +} + +static void TEST_single_request_response_information(void) +{ + byte_prop_write_helper(CMD_CONNECT, 3, MOSQ_ERR_SUCCESS, MQTT_PROP_REQUEST_RESPONSE_INFORMATION, 1); +} + +static void TEST_single_maximum_qos(void) +{ + byte_prop_write_helper(CMD_CONNACK, 3, MOSQ_ERR_SUCCESS, MQTT_PROP_MAXIMUM_QOS, 1); +} + +static void TEST_single_retain_available(void) +{ + byte_prop_write_helper(CMD_CONNACK, 3, MOSQ_ERR_SUCCESS, MQTT_PROP_RETAIN_AVAILABLE, 1); +} + +static void TEST_single_wildcard_subscription_available(void) +{ + byte_prop_write_helper(CMD_CONNACK, 3, MOSQ_ERR_SUCCESS, MQTT_PROP_WILDCARD_SUB_AVAILABLE, 0); +} + +static void TEST_single_subscription_identifier_available(void) +{ + byte_prop_write_helper(CMD_CONNACK, 3, MOSQ_ERR_SUCCESS, MQTT_PROP_SUBSCRIPTION_ID_AVAILABLE, 0); +} + +static void TEST_single_shared_subscription_available(void) +{ + byte_prop_write_helper(CMD_CONNACK, 3, MOSQ_ERR_SUCCESS, MQTT_PROP_SHARED_SUB_AVAILABLE, 1); +} + +static void TEST_single_message_expiry_interval(void) +{ + int32_prop_write_helper(CMD_PUBLISH, 6, MOSQ_ERR_SUCCESS, MQTT_PROP_MESSAGE_EXPIRY_INTERVAL, 0x12233445); +} + +static void TEST_single_session_expiry_interval(void) +{ + int32_prop_write_helper(CMD_CONNACK, 6, MOSQ_ERR_SUCCESS, MQTT_PROP_SESSION_EXPIRY_INTERVAL, 0x45342312); +} + +static void TEST_single_will_delay_interval(void) +{ + int32_prop_write_helper(CMD_WILL, 6, MOSQ_ERR_SUCCESS, MQTT_PROP_WILL_DELAY_INTERVAL, 0x45342312); +} + +static void TEST_single_maximum_packet_size(void) +{ + int32_prop_write_helper(CMD_CONNECT, 6, MOSQ_ERR_SUCCESS, MQTT_PROP_MAXIMUM_PACKET_SIZE, 0x45342312); +} + +static void TEST_single_server_keep_alive(void) +{ + int16_prop_write_helper(CMD_CONNACK, 4, MOSQ_ERR_SUCCESS, MQTT_PROP_SERVER_KEEP_ALIVE, 0x4534); +} + +static void TEST_single_receive_maximum(void) +{ + int16_prop_write_helper(CMD_CONNACK, 4, MOSQ_ERR_SUCCESS, MQTT_PROP_RECEIVE_MAXIMUM, 0x6842); +} + +static void TEST_single_topic_alias_maximum(void) +{ + int16_prop_write_helper(CMD_CONNECT, 4, MOSQ_ERR_SUCCESS, MQTT_PROP_TOPIC_ALIAS_MAXIMUM, 0x6842); +} + +static void TEST_single_topic_alias(void) +{ + int16_prop_write_helper(CMD_PUBLISH, 4, MOSQ_ERR_SUCCESS, MQTT_PROP_TOPIC_ALIAS, 0x6842); +} + +static void TEST_single_content_type(void) +{ + string_prop_write_helper(CMD_PUBLISH, 9, MOSQ_ERR_SUCCESS, MQTT_PROP_CONTENT_TYPE, "hello"); +} + +static void TEST_single_response_topic(void) +{ + string_prop_write_helper(CMD_WILL, 9, MOSQ_ERR_SUCCESS, MQTT_PROP_RESPONSE_TOPIC, "hello"); +} + +static void TEST_single_assigned_client_identifier(void) +{ + string_prop_write_helper(CMD_CONNACK, 9, MOSQ_ERR_SUCCESS, MQTT_PROP_ASSIGNED_CLIENT_IDENTIFIER, "hello"); +} + +static void TEST_single_authentication_method(void) +{ + string_prop_write_helper(CMD_CONNECT, 9, MOSQ_ERR_SUCCESS, MQTT_PROP_AUTHENTICATION_METHOD, "hello"); +} + +static void TEST_single_response_information(void) +{ + string_prop_write_helper(CMD_CONNACK, 9, MOSQ_ERR_SUCCESS, MQTT_PROP_RESPONSE_INFORMATION, "hello"); +} + +static void TEST_single_server_reference(void) +{ + string_prop_write_helper(CMD_CONNACK, 9, MOSQ_ERR_SUCCESS, MQTT_PROP_SERVER_REFERENCE, "hello"); +} + +static void TEST_single_reason_string(void) +{ + string_prop_write_helper(CMD_PUBREC, 9, MOSQ_ERR_SUCCESS, MQTT_PROP_REASON_STRING, "hello"); +} + +static void TEST_single_correlation_data(void) +{ + uint8_t payload[5] = {1, 'e', 0, 'l', 9}; + + binary_prop_write_helper(CMD_PUBLISH, 9, MOSQ_ERR_SUCCESS, MQTT_PROP_CORRELATION_DATA, payload, 5); +} + +static void TEST_single_authentication_data(void) +{ + uint8_t payload[5] = {1, 'e', 0, 'l', 9}; + + binary_prop_write_helper(CMD_CONNECT, 9, MOSQ_ERR_SUCCESS, MQTT_PROP_AUTHENTICATION_DATA, payload, 5); +} + +static void TEST_single_user_property(void) +{ + string_pair_prop_write_helper(10, MOSQ_ERR_SUCCESS, MQTT_PROP_USER_PROPERTY, "za", "bc", false); +} + +static void TEST_single_subscription_identifier(void) +{ + varint_prop_write_helper(3, MOSQ_ERR_SUCCESS, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 0); + varint_prop_write_helper(3, MOSQ_ERR_SUCCESS, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 127); + varint_prop_write_helper(4, MOSQ_ERR_SUCCESS, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 128); + varint_prop_write_helper(4, MOSQ_ERR_SUCCESS, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 16383); + varint_prop_write_helper(5, MOSQ_ERR_SUCCESS, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 16384); + varint_prop_write_helper(5, MOSQ_ERR_SUCCESS, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 2097151); + varint_prop_write_helper(6, MOSQ_ERR_SUCCESS, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 2097152); + varint_prop_write_helper(6, MOSQ_ERR_SUCCESS, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 268435455); +} + + +/* ======================================================================== + * TEST SUITE SETUP + * ======================================================================== */ + +int init_property_write_tests(void) +{ + CU_pSuite test_suite = NULL; + + test_suite = CU_add_suite("Property write", NULL, NULL); + if(!test_suite){ + printf("Error adding CUnit Property write test suite.\n"); + return 1; + } + + if(0 + || !CU_add_test(test_suite, "Bad identifier", TEST_bad_identifier) + || !CU_add_test(test_suite, "Single Payload Format Indicator", TEST_single_payload_format_indicator) + || !CU_add_test(test_suite, "Single Request Problem Information", TEST_single_request_problem_information) + || !CU_add_test(test_suite, "Single Request Response Information", TEST_single_request_response_information) + || !CU_add_test(test_suite, "Single Maximum QoS", TEST_single_maximum_qos) + || !CU_add_test(test_suite, "Single Retain Available", TEST_single_retain_available) + || !CU_add_test(test_suite, "Single Wildcard Subscription Available", TEST_single_wildcard_subscription_available) + || !CU_add_test(test_suite, "Single Subscription Identifier Available", TEST_single_subscription_identifier_available) + || !CU_add_test(test_suite, "Single Shared Subscription Available", TEST_single_shared_subscription_available) + || !CU_add_test(test_suite, "Single Message Expiry Interval", TEST_single_message_expiry_interval) + || !CU_add_test(test_suite, "Single Session Expiry Interval", TEST_single_session_expiry_interval) + || !CU_add_test(test_suite, "Single Will Delay Interval", TEST_single_will_delay_interval) + || !CU_add_test(test_suite, "Single Maximum Packet Size", TEST_single_maximum_packet_size) + || !CU_add_test(test_suite, "Single Server Keep Alive", TEST_single_server_keep_alive) + || !CU_add_test(test_suite, "Single Receive Maximum", TEST_single_receive_maximum) + || !CU_add_test(test_suite, "Single Topic Alias Maximum", TEST_single_topic_alias_maximum) + || !CU_add_test(test_suite, "Single Topic Alias", TEST_single_topic_alias) + || !CU_add_test(test_suite, "Single Content Type", TEST_single_content_type) + || !CU_add_test(test_suite, "Single Response Topic", TEST_single_response_topic) + || !CU_add_test(test_suite, "Single Assigned Client Identifier", TEST_single_assigned_client_identifier) + || !CU_add_test(test_suite, "Single Authentication Method", TEST_single_authentication_method) + || !CU_add_test(test_suite, "Single Response Information", TEST_single_response_information) + || !CU_add_test(test_suite, "Single Server Reference", TEST_single_server_reference) + || !CU_add_test(test_suite, "Single Reason String", TEST_single_reason_string) + || !CU_add_test(test_suite, "Single Correlation Data", TEST_single_correlation_data) + || !CU_add_test(test_suite, "Single Authentication Data", TEST_single_authentication_data) + || !CU_add_test(test_suite, "Single User Property", TEST_single_user_property) + || !CU_add_test(test_suite, "Single Subscription Identifier", TEST_single_subscription_identifier) + ){ + + printf("Error adding Property read CUnit tests.\n"); + return 1; + } + + return 0; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/publish_test.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/publish_test.c new file mode 100644 index 0000000..6371db3 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/publish_test.c @@ -0,0 +1,43 @@ +#include <CUnit/CUnit.h> +#include <CUnit/Basic.h> + +#include <mosquitto_internal.h> +#include <util_mosq.h> + + +static void TEST_maximum_packet_size(void) +{ + struct mosquitto mosq; + int rc; + + memset(&mosq, 0, sizeof(struct mosquitto)); + + mosq.maximum_packet_size = 5; + rc = mosquitto_publish(&mosq, NULL, "topic/oversize", strlen("payload"), "payload", 0, 0); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_OVERSIZE_PACKET); +} + +/* ======================================================================== + * TEST SUITE SETUP + * ======================================================================== */ + +int init_publish_tests(void) +{ + CU_pSuite test_suite = NULL; + + test_suite = CU_add_suite("Publish", NULL, NULL); + if(!test_suite){ + printf("Error adding CUnit Publish test suite.\n"); + return 1; + } + + if(0 + || !CU_add_test(test_suite, "v5: Maximum packet size", TEST_maximum_packet_size) + ){ + + printf("Error adding Publish CUnit tests.\n"); + return 1; + } + + return 0; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/stubs.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/stubs.c new file mode 100644 index 0000000..f4b7c97 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/stubs.c @@ -0,0 +1,6 @@ +#include <logging_mosq.h> + +int log__printf(struct mosquitto *mosq, int priority, const char *fmt, ...) +{ + return 0; +} diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/test.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/test.c new file mode 100644 index 0000000..b6f836f --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/test.c @@ -0,0 +1,47 @@ +#include "config.h" +#include <stdio.h> + +#include <CUnit/CUnit.h> +#include <CUnit/Basic.h> + +int init_datatype_read_tests(void); +int init_datatype_write_tests(void); +int init_property_add_tests(void); +int init_property_read_tests(void); +int init_property_user_read_tests(void); +int init_property_write_tests(void); +int init_utf8_tests(void); +int init_util_topic_tests(void); + +int main(int argc, char *argv[]) +{ + unsigned int fails; + + if(CU_initialize_registry() != CUE_SUCCESS){ + printf("Error initializing CUnit registry.\n"); + return 1; + } + + if(0 + || init_utf8_tests() + || init_datatype_read_tests() + || init_datatype_write_tests() + || init_property_add_tests() + || init_property_read_tests() + || init_property_user_read_tests() + || init_property_write_tests() + || init_util_topic_tests() + ){ + + CU_cleanup_registry(); + return 1; + } + + CU_basic_set_mode(CU_BRM_VERBOSE); + CU_basic_run_tests(); + fails = CU_get_number_of_failures(); + CU_cleanup_registry(); + + return (int)fails; +} + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/utf8.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/utf8.c new file mode 100644 index 0000000..1982da8 --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/utf8.c @@ -0,0 +1,482 @@ +#include <CUnit/CUnit.h> +#include <CUnit/Basic.h> + +#include "mosquitto.h" + +/* Test data taken from + * http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt but modified for + * updated standard (no 5, 6 byte lengths) */ + +static void utf8_helper_len(const char *text, int len, int expected) +{ + int result; + + result = mosquitto_validate_utf8(text, len); + CU_ASSERT_EQUAL(result, expected); +} + +static void utf8_helper(const char *text, int expected) +{ + utf8_helper_len(text, strlen(text), expected); +} + + +static void TEST_utf8_empty(void) +{ + utf8_helper_len(NULL, 0, MOSQ_ERR_INVAL); +} + + +static void TEST_utf8_valid(void) +{ + /* 1 Some correct UTF-8 text */ + utf8_helper("", MOSQ_ERR_SUCCESS); + utf8_helper("You should see the Greek word 'kosme': \"κόσμε\"", MOSQ_ERR_SUCCESS); +} + + +static void TEST_utf8_truncated(void) +{ + char buf[4]; + + /* As per boundary condition tests, but less one character */ + buf[0] = 0xC2; buf[1] = 0; + utf8_helper(buf, MOSQ_ERR_MALFORMED_UTF8); + + buf[0] = 0xE0; buf[1] = 0xA0; buf[2] = 0; + utf8_helper(buf, MOSQ_ERR_MALFORMED_UTF8); + + buf[0] = 0xF0; buf[1] = 0x90; buf[2] = 0x80; buf[3] = 0; + utf8_helper(buf, MOSQ_ERR_MALFORMED_UTF8); +} + + +static void TEST_utf8_boundary_conditions(void) +{ + /* 2 Boundary condition test cases */ + /* 2.1 First possible sequence of a certain length */ + utf8_helper_len("2.1.1 1 byte (U-00000000): \"\0\"", 39, MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("2.1.2 2 bytes (U-00000080): \"\"", MOSQ_ERR_MALFORMED_UTF8); /* control char */ + utf8_helper("2.1.3 3 bytes (U-00000800): \"ࠀ\"", MOSQ_ERR_SUCCESS); + utf8_helper("2.1.4 4 bytes (U-00010000): \"𐀀\"", MOSQ_ERR_SUCCESS); + + /* 2.2 Last possible sequence of a certain length */ + + utf8_helper("2.2.1 1 byte (U-0000007F): \"\"", MOSQ_ERR_MALFORMED_UTF8); /* control char */ + utf8_helper("2.2.2 2 bytes (U-000007FF): \"߿\"", MOSQ_ERR_SUCCESS); + /* Non character */ + utf8_helper("2.2.3 3 bytes (U-0000FFFF): \"\"", MOSQ_ERR_MALFORMED_UTF8); + /* Non character */ + utf8_helper("2.2.4 4 bytes (U-0010FFFF): \"����\"", MOSQ_ERR_MALFORMED_UTF8); + + /* 2.3 Other boundary conditions */ + + utf8_helper("2.3.1 U-0000D7FF = ed 9f bf = \"\"", MOSQ_ERR_SUCCESS); + utf8_helper("2.3.2 U-0000E000 = ee 80 80 = \"\"", MOSQ_ERR_SUCCESS); + utf8_helper("2.3.3 U-0000FFFD = ef bf bd = \"�\"", MOSQ_ERR_SUCCESS); + /* Non character */ + utf8_helper("2.3.4 U-0010FFFF = f4 8f bf bf = \"\"", MOSQ_ERR_MALFORMED_UTF8); + /* This used to be valid in pre-2003 utf-8 */ + utf8_helper("2.3.5 U-00110000 = f4 90 80 80 = \"����\"", MOSQ_ERR_MALFORMED_UTF8); +} + + +static void TEST_utf8_malformed_sequences(void) +{ + char buf[100]; + int i; + /* 3 Malformed sequences */ + /* 3.1 Unexpected continuation bytes */ + utf8_helper("3.1.1 First continuation byte 0x80: \"�\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("3.1.2 Last continuation byte 0xbf: \"�\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("3.1.3 2 continuation bytes: \"��\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("3.1.4 3 continuation bytes: \"���\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("3.1.5 4 continuation bytes: \"����\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("3.1.6 5 continuation bytes: \"�����\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("3.1.7 6 continuation bytes: \"������\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("3.1.8 7 continuation bytes: \"�������\"", MOSQ_ERR_MALFORMED_UTF8); + + /* 3.1.9 Sequence of all 64 possible continuation bytes (0x80-0xbf): */ + memset(buf, 0, sizeof(buf)); + for(i=0x80; i<0x90; i++){ + buf[i-0x80] = i; + } + utf8_helper(buf, MOSQ_ERR_MALFORMED_UTF8); + memset(buf, 0, sizeof(buf)); + for(i=0x90; i<0xa0; i++){ + buf[i-0x90] = i; + } + utf8_helper(buf, MOSQ_ERR_MALFORMED_UTF8); + + for(i=0x80; i<0xA0; i++){ + buf[0] = i; + buf[1] = 0; + utf8_helper(buf, MOSQ_ERR_MALFORMED_UTF8); + } + + for(i=0xA0; i<0xC0; i++){ + buf[0] = i; + buf[1] = 0; + utf8_helper(buf, MOSQ_ERR_MALFORMED_UTF8); + } + + /* 3.2 Lonely start characters */ + + /* 3.2.1 All 32 first bytes of 2-byte sequences (0xc0-0xdf), + each followed by a space character: */ + utf8_helper("� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ", MOSQ_ERR_MALFORMED_UTF8); + for(i=0xC0; i<0xE0; i++){ + buf[0] = i; + buf[1] = ' '; + buf[2] = 0; + utf8_helper(buf, MOSQ_ERR_MALFORMED_UTF8); + } + + /* 3.2.2 All 16 first bytes of 3-byte sequences (0xe0-0xef), + each followed by a space character: */ + utf8_helper("\"� � � � � � � � � � � � � � � � \"", MOSQ_ERR_MALFORMED_UTF8); + for(i=0xe0; i<0xf0; i++){ + buf[0] = i; + buf[1] = ' '; + buf[2] = 0; + utf8_helper(buf, MOSQ_ERR_MALFORMED_UTF8); + } + + /* 3.2.3 All 8 first bytes of 4-byte sequences (0xf0-0xf7), + each followed by a space character: */ + utf8_helper("\"� � � � � � � � \"", MOSQ_ERR_MALFORMED_UTF8); + for(i=0xF0; i<0xF8; i++){ + buf[0] = i; + buf[1] = ' '; + buf[2] = 0; + utf8_helper(buf, MOSQ_ERR_MALFORMED_UTF8); + } + + /* 3.2.4 All 4 first bytes of 5-byte sequences (0xf8-0xfb), + each followed by a space character: */ + utf8_helper("\"� � � � \"", MOSQ_ERR_MALFORMED_UTF8); + for(i=0xF8; i<0xFC; i++){ + buf[0] = i; + buf[1] = ' '; + buf[2] = 0; + utf8_helper(buf, MOSQ_ERR_MALFORMED_UTF8); + } + + /* 3.2.5 All 2 first bytes of 6-byte sequences (0xfc-0xfd), + each followed by a space character: */ + utf8_helper("\"� � \"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("� ", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("� ", MOSQ_ERR_MALFORMED_UTF8); + for(i=0xFC; i<0xFE; i++){ + buf[0] = i; + buf[1] = ' '; + buf[2] = 0; + utf8_helper(buf, MOSQ_ERR_MALFORMED_UTF8); + } + + /* 3.3 Sequences with last continuation byte missing + + All bytes of an incomplete sequence should be signalled as a single + malformed sequence, i.e., you should see only a single replacement + character in each of the next 10 tests. (Characters as in section 2) */ + + utf8_helper("3.3.1 2-byte sequence with last byte missing (U+0000): \"�\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("3.3.2 3-byte sequence with last byte missing (U+0000): \"��\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("3.3.3 4-byte sequence with last byte missing (U+0000): \"���\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("3.3.4 5-byte sequence with last byte missing (U+0000): \"����\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("3.3.5 6-byte sequence with last byte missing (U+0000): \"�����\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("3.3.6 2-byte sequence with last byte missing (U-000007FF): \"�\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("3.3.7 3-byte sequence with last byte missing (U-0000FFFF): \"�\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("3.3.8 4-byte sequence with last byte missing (U-001FFFFF): \"���\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("3.3.9 5-byte sequence with last byte missing (U-03FFFFFF): \"����\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("3.3.10 6-byte sequence with last byte missing (U-7FFFFFFF): \"�����\"", MOSQ_ERR_MALFORMED_UTF8); + + /* 3.4 Concatenation of incomplete sequences + + All the 10 sequences of 3.3 concatenated, you should see 10 malformed + sequences being signalled:*/ + + utf8_helper("\"�����������������������������\"", MOSQ_ERR_MALFORMED_UTF8); + + /* 3.5 Impossible bytes + + The following two bytes cannot appear in a correct UTF-8 string */ + + utf8_helper("3.5.1 fe = \"�\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("3.5.2 ff = \"�\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("3.5.3 fe fe ff ff = \"����\"", MOSQ_ERR_MALFORMED_UTF8); +} + +static void TEST_utf8_overlong_encoding(void) +{ + /* 4 Overlong sequences + + The following sequences are not malformed according to the letter of + the Unicode 2.0 standard. However, they are longer then necessary and + a correct UTF-8 encoder is not allowed to produce them. A "safe UTF-8 + decoder" should reject them just like malformed sequences for two + reasons: (1) It helps to debug applications if overlong sequences are + not treated as valid representations of characters, because this helps + to spot problems more quickly. (2) Overlong sequences provide + alternative representations of characters, that could maliciously be + used to bypass filters that check only for ASCII characters. For + instance, a 2-byte encoded line feed (LF) would not be caught by a + line counter that counts only 0x0a bytes, but it would still be + processed as a line feed by an unsafe UTF-8 decoder later in the + pipeline. From a security point of view, ASCII compatibility of UTF-8 + sequences means also, that ASCII characters are *only* allowed to be + represented by ASCII bytes in the range 0x00-0x7f. To ensure this + aspect of ASCII compatibility, use only "safe UTF-8 decoders" that + reject overlong UTF-8 sequences for which a shorter encoding exists. */ + + /* 4.1 Examples of an overlong ASCII character + + With a safe UTF-8 decoder, all of the following five overlong + representations of the ASCII character slash ("/") should be rejected + like a malformed UTF-8 sequence, for instance by substituting it with + a replacement character. If you see a slash below, you do not have a + safe UTF-8 decoder! */ + + utf8_helper("4.1.1 U+002F = c0 af = \"��\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("4.1.2 U+002F = e0 80 af = \"���\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("4.1.3 U+002F = f0 80 80 af = \"����\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("4.1.4 U+002F = f8 80 80 80 af = \"�����\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("4.1.5 U+002F = fc 80 80 80 80 af = \"������\"", MOSQ_ERR_MALFORMED_UTF8); + + /* 4.2 Maximum overlong sequences + + Below you see the highest Unicode value that is still resulting in an + overlong sequence if represented with the given number of bytes. This + is a boundary test for safe UTF-8 decoders. All five characters should + be rejected like malformed UTF-8 sequences. */ + + utf8_helper("4.2.1 U-0000007F = c1 bf = \"��\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("4.2.2 U-000007FF = e0 9f bf = \"���\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("4.2.3 U-0000FFFF = f0 8f bf bf = \"����\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("4.2.4 U-001FFFFF = f8 87 bf bf bf = \"�����\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("4.2.5 U-03FFFFFF = fc 83 bf bf bf bf = \"������\"", MOSQ_ERR_MALFORMED_UTF8); + + /* 4.3 Overlong representation of the NUL character + + The following five sequences should also be rejected like malformed + UTF-8 sequences and should not be treated like the ASCII NUL + character. */ + + utf8_helper("4.3.1 U+0000 = c0 80 = \"��\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("4.3.2 U+0000 = e0 80 80 = \"���\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("4.3.3 U+0000 = f0 80 80 80 = \"����\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("4.3.4 U+0000 = f8 80 80 80 80 = \"�����\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("4.3.5 U+0000 = fc 80 80 80 80 80 = \"������\"", MOSQ_ERR_MALFORMED_UTF8); +} + + +static void TEST_utf8_illegal_code_positions(void) +{ + /* 5 Illegal code positions + + The following UTF-8 sequences should be rejected like malformed + sequences, because they never represent valid ISO 10646 characters and + a UTF-8 decoder that accepts them might introduce security problems + comparable to overlong UTF-8 sequences. */ + + /* 5.1 Single UTF-16 surrogates */ + + utf8_helper("5.1.1 U+D800 = ed a0 80 = \"�\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("5.1.2 U+DB7F = ed ad bf = \"�\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("5.1.3 U+DB80 = ed ae 80 = \"�\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("5.1.4 U+DBFF = ed af bf = \"�\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("5.1.5 U+DC00 = ed b0 80 = \"�\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("5.1.6 U+DF80 = ed be 80 = \"�\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("5.1.7 U+DFFF = ed bf bf = \"�\"", MOSQ_ERR_MALFORMED_UTF8); + + /* 5.2 Paired UTF-16 surrogates */ + + utf8_helper("5.2.1 U+D800 U+DC00 = ed a0 80 ed b0 80 = \"��\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("5.2.2 U+D800 U+DFFF = ed a0 80 ed bf bf = \"��\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("5.2.3 U+DB7F U+DC00 = ed ad bf ed b0 80 = \"��\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("5.2.4 U+DB7F U+DFFF = ed ad bf ed bf bf = \"��\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("5.2.5 U+DB80 U+DC00 = ed ae 80 ed b0 80 = \"��\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("5.2.6 U+DB80 U+DFFF = ed ae 80 ed bf bf = \"��\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("5.2.7 U+DBFF U+DC00 = ed af bf ed b0 80 = \"��\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("5.2.8 U+DBFF U+DFFF = ed af bf ed bf bf = \"��\"", MOSQ_ERR_MALFORMED_UTF8); + + /* 5.3 Noncharacter code positions + + The following "noncharacters" are "reserved for internal use" by + applications, and according to older versions of the Unicode Standard + "should never be interchanged". Unicode Corrigendum #9 dropped the + latter restriction. Nevertheless, their presence in incoming UTF-8 data + can remain a potential security risk, depending on what use is made of + these codes subsequently. Examples of such internal use: + + - Some file APIs with 16-bit characters may use the integer value -1 + = U+FFFF to signal an end-of-file (EOF) or error condition. + + - In some UTF-16 receivers, code point U+FFFE might trigger a + byte-swap operation (to convert between UTF-16LE and UTF-16BE). + + With such internal use of noncharacters, it may be desirable and safer + to block those code points in UTF-8 decoders, as they should never + occur legitimately in incoming UTF-8 data, and could trigger unsafe + behaviour in subsequent processing. + + Particularly problematic noncharacters in 16-bit applications: */ + utf8_helper("5.3.1 U+FFFE = ef bf be = \"\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("5.3.2 U+FFFF = ef bf bf = \"\"", MOSQ_ERR_MALFORMED_UTF8); + + /* Other noncharacters: */ + + /* FIXME - these need splitting up into separate tests. */ + utf8_helper("5.3.3 U+FDD0 .. U+FDEF = \"\"", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + + /* 5.3.4 U+nFFFE U+nFFFF (for n = 1..10) */ + + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); + utf8_helper("", MOSQ_ERR_MALFORMED_UTF8); +} + + +void TEST_utf8_control_characters(void) +{ + char buf[10]; + int i; + + /* U+0001 to U+001F are single byte control characters */ + for(i=0x01; i<0x20; i++){ + buf[0] = i; + buf[1] = '\0'; + utf8_helper(buf, MOSQ_ERR_MALFORMED_UTF8); + } + + /* U+007F is a single byte control character */ + buf[0] = 0x7F; + buf[1] = '\0'; + utf8_helper(buf, MOSQ_ERR_MALFORMED_UTF8); + + /* U+007F to U+009F are two byte control characters */ + for(i=0x80; i<0xA0; i++){ + buf[0] = 0xC2; + buf[1] = i-0x80; + buf[2] = '\0'; + utf8_helper(buf, MOSQ_ERR_MALFORMED_UTF8); + } + +} + + +void TEST_utf8_mqtt_1_5_4_2(void) +{ + char buf[10] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', '\0'}; + + utf8_helper_len(buf, 9, MOSQ_ERR_SUCCESS); + + buf[3] = '\0'; + utf8_helper_len(buf, 9, MOSQ_ERR_MALFORMED_UTF8); +} + + +void TEST_utf8_mqtt_1_5_4_3(void) +{ + char buf[10] = {'a', 'b', 0xEF, 0xBB, 0xBF, 'f', 'g', 'h', 'i', '\0'}; + + utf8_helper_len(buf, 9, MOSQ_ERR_SUCCESS); +} + + +/* ======================================================================== + * TEST SUITE SETUP + * ======================================================================== */ + +int init_utf8_tests(void) +{ + CU_pSuite test_suite = NULL; + + test_suite = CU_add_suite("UTF-8", NULL, NULL); + if(!test_suite){ + printf("Error adding CUnit test suite.\n"); + return 1; + } + + if(0 + || !CU_add_test(test_suite, "UTF-8 empty", TEST_utf8_empty) + || !CU_add_test(test_suite, "UTF-8 valid", TEST_utf8_valid) + || !CU_add_test(test_suite, "UTF-8 truncated", TEST_utf8_truncated) + || !CU_add_test(test_suite, "UTF-8 boundary conditions", TEST_utf8_boundary_conditions) + || !CU_add_test(test_suite, "UTF-8 malformed sequences", TEST_utf8_malformed_sequences) + || !CU_add_test(test_suite, "UTF-8 overlong encoding", TEST_utf8_overlong_encoding) + || !CU_add_test(test_suite, "UTF-8 illegal code positions", TEST_utf8_illegal_code_positions) + || !CU_add_test(test_suite, "UTF-8 control characters", TEST_utf8_control_characters) + || !CU_add_test(test_suite, "UTF-8 MQTT-1.5.4-2", TEST_utf8_mqtt_1_5_4_2) + || !CU_add_test(test_suite, "UTF-8 MQTT-1.5.4-3", TEST_utf8_mqtt_1_5_4_3) + ){ + + printf("Error adding UTF-8 CUnit tests.\n"); + return 1; + } + + return 0; +} + + diff --git a/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/util_topic_test.c b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/util_topic_test.c new file mode 100644 index 0000000..88f668a --- /dev/null +++ b/proj1_mqttd/mosquitto/mosquitto-1.6.3/test/unit/util_topic_test.c @@ -0,0 +1,284 @@ +#include <CUnit/CUnit.h> +#include <CUnit/Basic.h> + +#include <util_mosq.h> + +static void match_helper(const char *sub, const char *topic) +{ + int rc; + bool match; + + rc = mosquitto_topic_matches_sub(sub, topic, &match); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_EQUAL(match, true); +} + +static void no_match_helper(int rc_expected, const char *sub, const char *topic) +{ + int rc; + bool match; + + rc = mosquitto_topic_matches_sub(sub, topic, &match); + CU_ASSERT_EQUAL(rc, rc_expected); + CU_ASSERT_EQUAL(match, false); +} + +/* ======================================================================== + * EMPTY INPUT + * ======================================================================== */ + +static void TEST_empty_input(void) +{ + int rc; + bool match; + + rc = mosquitto_topic_matches_sub("sub", NULL, &match); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); + CU_ASSERT_EQUAL(match, false); + + rc = mosquitto_topic_matches_sub(NULL, "topic", &match); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); + CU_ASSERT_EQUAL(match, false); + + rc = mosquitto_topic_matches_sub(NULL, NULL, &match); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); + CU_ASSERT_EQUAL(match, false); + + rc = mosquitto_topic_matches_sub("sub", "", &match); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); + CU_ASSERT_EQUAL(match, false); + + rc = mosquitto_topic_matches_sub("", "topic", &match); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); + CU_ASSERT_EQUAL(match, false); + + rc = mosquitto_topic_matches_sub("", "", &match); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); + CU_ASSERT_EQUAL(match, false); + + rc = mosquitto_topic_matches_sub2("sub", 3, NULL, 0, &match); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); + CU_ASSERT_EQUAL(match, false); + + rc = mosquitto_topic_matches_sub2(NULL, 0, "topic", 5, &match); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); + CU_ASSERT_EQUAL(match, false); + + rc = mosquitto_topic_matches_sub2(NULL, 0, NULL, 0, &match); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); + CU_ASSERT_EQUAL(match, false); + + rc = mosquitto_topic_matches_sub2("sub", 3, "", 0, &match); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); + CU_ASSERT_EQUAL(match, false); + + rc = mosquitto_topic_matches_sub2("", 0, "topic", 5, &match); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); + CU_ASSERT_EQUAL(match, false); + + rc = mosquitto_topic_matches_sub2("", 0, "", 0, &match); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_INVAL); + CU_ASSERT_EQUAL(match, false); +} + +/* ======================================================================== + * VALID MATCHING AND NON-MATCHING + * ======================================================================== */ + +static void TEST_valid_matching(void) +{ + match_helper("foo/#", "foo/"); + match_helper("foo/#", "foo"); + match_helper("foo//bar", "foo//bar"); + match_helper("foo//+", "foo//bar"); + match_helper("foo/+/+/baz", "foo///baz"); + match_helper("foo/bar/+", "foo/bar/"); + match_helper("foo/bar", "foo/bar"); + match_helper("foo/+", "foo/bar"); + match_helper("foo/+/baz", "foo/bar/baz"); + match_helper("A/B/+/#", "A/B/B/C"); + match_helper("foo/+/#", "foo/bar/baz"); + match_helper("foo/+/#", "foo/bar"); + match_helper("#", "foo/bar/baz"); + match_helper("#", "foo/bar/baz"); + match_helper("#", "/foo/bar"); + match_helper("/#", "/foo/bar"); +} + + +static void TEST_invalid_but_matching(void) +{ + /* Matching here is "naive treatment of the wildcards would produce a + * match". They shouldn't really match, they should fail. */ + no_match_helper(MOSQ_ERR_INVAL, "+foo", "+foo"); + no_match_helper(MOSQ_ERR_INVAL, "fo+o", "fo+o"); + no_match_helper(MOSQ_ERR_INVAL, "foo+", "foo+"); + no_match_helper(MOSQ_ERR_INVAL, "+foo/bar", "+foo/bar"); + no_match_helper(MOSQ_ERR_INVAL, "foo+/bar", "foo+/bar"); + no_match_helper(MOSQ_ERR_INVAL, "foo/+bar", "foo/+bar"); + no_match_helper(MOSQ_ERR_INVAL, "foo/bar+", "foo/bar+"); + + no_match_helper(MOSQ_ERR_INVAL, "+foo", "afoo"); + no_match_helper(MOSQ_ERR_INVAL, "fo+o", "foao"); + no_match_helper(MOSQ_ERR_INVAL, "foo+", "fooa"); + no_match_helper(MOSQ_ERR_INVAL, "+foo/bar", "afoo/bar"); + no_match_helper(MOSQ_ERR_INVAL, "foo+/bar", "fooa/bar"); + no_match_helper(MOSQ_ERR_INVAL, "foo/+bar", "foo/abar"); + no_match_helper(MOSQ_ERR_INVAL, "foo/bar+", "foo/bara"); + + no_match_helper(MOSQ_ERR_INVAL, "#foo", "#foo"); + no_match_helper(MOSQ_ERR_INVAL, "fo#o", "fo#o"); + no_match_helper(MOSQ_ERR_INVAL, "foo#", "foo#"); + no_match_helper(MOSQ_ERR_INVAL, "#foo/bar", "#foo/bar"); + no_match_helper(MOSQ_ERR_INVAL, "foo#/bar", "foo#/bar"); + no_match_helper(MOSQ_ERR_INVAL, "foo/#bar", "foo/#bar"); + no_match_helper(MOSQ_ERR_INVAL, "foo/bar#", "foo/bar#"); + + no_match_helper(MOSQ_ERR_INVAL, "foo+", "fooa"); +} + + +static void TEST_valid_no_matching(void) +{ + no_match_helper(MOSQ_ERR_SUCCESS, "test/6/#", "test/3"); + + no_match_helper(MOSQ_ERR_SUCCESS, "foo/bar", "foo"); + no_match_helper(MOSQ_ERR_SUCCESS, "foo/+", "foo/bar/baz"); + no_match_helper(MOSQ_ERR_SUCCESS, "foo/+/baz", "foo/bar/bar"); + + no_match_helper(MOSQ_ERR_SUCCESS, "foo/+/#", "fo2/bar/baz"); + + no_match_helper(MOSQ_ERR_SUCCESS, "/#", "foo/bar"); + + no_match_helper(MOSQ_ERR_SUCCESS, "#", "$SYS/bar"); + no_match_helper(MOSQ_ERR_SUCCESS, "$BOB/bar", "$SYS/bar"); +} + + +static void TEST_invalid(void) +{ + no_match_helper(MOSQ_ERR_INVAL, "foo#", "foo"); + no_match_helper(MOSQ_ERR_INVAL, "fo#o/", "foo"); + no_match_helper(MOSQ_ERR_INVAL, "foo#", "fooa"); + no_match_helper(MOSQ_ERR_INVAL, "foo+", "foo"); + no_match_helper(MOSQ_ERR_INVAL, "foo/#a", "foo"); + no_match_helper(MOSQ_ERR_INVAL, "#a", "foo"); + no_match_helper(MOSQ_ERR_INVAL, "foo/#abc", "foo"); + no_match_helper(MOSQ_ERR_INVAL, "#abc", "foo"); + no_match_helper(MOSQ_ERR_INVAL, "/#a", "foo/bar"); +} + +/* ======================================================================== + * PUB TOPIC CHECK + * ======================================================================== */ + +static void pub_topic_helper(const char *topic, int rc_expected) +{ + int rc; + + rc = mosquitto_pub_topic_check(topic); + CU_ASSERT_EQUAL(rc, rc_expected); + + rc = mosquitto_pub_topic_check2(topic, strlen(topic)); + CU_ASSERT_EQUAL(rc, rc_expected); +} + +static void TEST_pub_topic_valid(void) +{ + pub_topic_helper("pub/topic", MOSQ_ERR_SUCCESS); + pub_topic_helper("pub//topic", MOSQ_ERR_SUCCESS); + pub_topic_helper("pub/ /topic", MOSQ_ERR_SUCCESS); +} + +static void TEST_pub_topic_invalid(void) +{ + pub_topic_helper("+pub/topic", MOSQ_ERR_INVAL); + pub_topic_helper("pub+/topic", MOSQ_ERR_INVAL); + pub_topic_helper("pub/+topic", MOSQ_ERR_INVAL); + pub_topic_helper("pub/topic+", MOSQ_ERR_INVAL); + pub_topic_helper("pub/topic/+", MOSQ_ERR_INVAL); + pub_topic_helper("#pub/topic", MOSQ_ERR_INVAL); + pub_topic_helper("pub#/topic", MOSQ_ERR_INVAL); + pub_topic_helper("pub/#topic", MOSQ_ERR_INVAL); + pub_topic_helper("pub/topic#", MOSQ_ERR_INVAL); + pub_topic_helper("pub/topic/#", MOSQ_ERR_INVAL); + pub_topic_helper("+/pub/topic", MOSQ_ERR_INVAL); +} + + +/* ======================================================================== + * SUB TOPIC CHECK + * ======================================================================== */ + +static void sub_topic_helper(const char *topic, int rc_expected) +{ + int rc; + + rc = mosquitto_sub_topic_check(topic); + CU_ASSERT_EQUAL(rc, rc_expected); + + rc = mosquitto_sub_topic_check2(topic, strlen(topic)); + CU_ASSERT_EQUAL(rc, rc_expected); +} + +static void TEST_sub_topic_valid(void) +{ + sub_topic_helper("sub/topic", MOSQ_ERR_SUCCESS); + sub_topic_helper("sub//topic", MOSQ_ERR_SUCCESS); + sub_topic_helper("sub/ /topic", MOSQ_ERR_SUCCESS); + sub_topic_helper("sub/+/topic", MOSQ_ERR_SUCCESS); + sub_topic_helper("+/+/+", MOSQ_ERR_SUCCESS); + sub_topic_helper("+", MOSQ_ERR_SUCCESS); + sub_topic_helper("sub/topic/#", MOSQ_ERR_SUCCESS); + sub_topic_helper("sub//topic/#", MOSQ_ERR_SUCCESS); + sub_topic_helper("sub/ /topic/#", MOSQ_ERR_SUCCESS); + sub_topic_helper("sub/+/topic/#", MOSQ_ERR_SUCCESS); + sub_topic_helper("+/+/+/#", MOSQ_ERR_SUCCESS); + sub_topic_helper("#", MOSQ_ERR_SUCCESS); +} + +static void TEST_sub_topic_invalid(void) +{ + sub_topic_helper("+sub/topic", MOSQ_ERR_INVAL); + sub_topic_helper("sub+/topic", MOSQ_ERR_INVAL); + sub_topic_helper("sub/+topic", MOSQ_ERR_INVAL); + sub_topic_helper("sub/topic+", MOSQ_ERR_INVAL); + sub_topic_helper("#sub/topic", MOSQ_ERR_INVAL); + sub_topic_helper("sub#/topic", MOSQ_ERR_INVAL); + sub_topic_helper("sub/#topic", MOSQ_ERR_INVAL); + sub_topic_helper("sub/topic#", MOSQ_ERR_INVAL); + sub_topic_helper("#/sub/topic", MOSQ_ERR_INVAL); +} + +/* ======================================================================== + * TEST SUITE SETUP + * ======================================================================== */ + +int init_util_topic_tests(void) +{ + CU_pSuite test_suite = NULL; + + test_suite = CU_add_suite("Util topic", NULL, NULL); + if(!test_suite){ + printf("Error adding CUnit util topic test suite.\n"); + return 1; + } + + if(0 + || !CU_add_test(test_suite, "Matching: Empty input", TEST_empty_input) + || !CU_add_test(test_suite, "Matching: Valid matching", TEST_valid_matching) + || !CU_add_test(test_suite, "Matching: Valid no matching", TEST_valid_no_matching) + || !CU_add_test(test_suite, "Matching: Invalid but matching", TEST_invalid_but_matching) + || !CU_add_test(test_suite, "Matching: Invalid", TEST_invalid) + || !CU_add_test(test_suite, "Pub topic: Valid", TEST_pub_topic_valid) + || !CU_add_test(test_suite, "Pub topic: Invalid", TEST_pub_topic_invalid) + || !CU_add_test(test_suite, "Sub topic: Valid", TEST_sub_topic_valid) + || !CU_add_test(test_suite, "Sub topic: Invalid", TEST_sub_topic_invalid) + ){ + + printf("Error adding util topic CUnit tests.\n"); + return 1; + } + + return 0; +} -- Gitblit v1.9.1